pptx-ts 3.7.0 → 4.0.1
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/README.md +116 -269
- package/dist/autopage-odPz7zZO.js +536 -0
- package/dist/autopage-odPz7zZO.js.map +1 -0
- package/dist/binary-string-CKVAYI3M.js +24 -0
- package/dist/binary-string-CKVAYI3M.js.map +1 -0
- package/dist/body-insets-Dw_BeWD_.js +54 -0
- package/dist/body-insets-Dw_BeWD_.js.map +1 -0
- package/dist/browser.d.ts +29 -9
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +41 -14
- package/dist/browser.js.map +1 -1
- package/dist/clip-Bl01BPcN.d.ts +67 -0
- package/dist/clip-Bl01BPcN.d.ts.map +1 -0
- package/dist/diagnostics-D8ot4Ei7.d.ts +244 -0
- package/dist/diagnostics-D8ot4Ei7.d.ts.map +1 -0
- package/dist/embedded-fonts-DarT9aoa.d.ts +20 -0
- package/dist/embedded-fonts-DarT9aoa.d.ts.map +1 -0
- package/dist/entry-compose-DCnvBZz2.d.ts +1046 -0
- package/dist/entry-compose-DCnvBZz2.d.ts.map +1 -0
- package/dist/{enums-CvRYniUA.d.ts → enums-BUKTUB6V.d.ts} +21 -13
- package/dist/{enums-CvRYniUA.d.ts.map → enums-BUKTUB6V.d.ts.map} +1 -1
- package/dist/{errors-Bvln0H-7.js → errors-C4oENPcu.js} +92 -2
- package/dist/errors-C4oENPcu.js.map +1 -0
- package/dist/families.d.ts +260 -0
- package/dist/families.d.ts.map +1 -0
- package/dist/families.js +57 -0
- package/dist/families.js.map +1 -0
- package/dist/{fit-BKs0zxMI.js → fit-Cb7naFj6.js} +249 -167
- package/dist/fit-Cb7naFj6.js.map +1 -0
- package/dist/font-metrics-v5fn7s7e.d.ts +613 -0
- package/dist/font-metrics-v5fn7s7e.d.ts.map +1 -0
- package/dist/grid-DikTjFey.js +187 -0
- package/dist/grid-DikTjFey.js.map +1 -0
- package/dist/{html-dom-B0I0QSbU.js → html-dom-Iuog2wdK.js} +121 -91
- package/dist/html-dom-Iuog2wdK.js.map +1 -0
- package/dist/html.d.ts +6 -6
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +7 -6
- package/dist/html.js.map +1 -1
- package/dist/image-size-CvN2iCA4.js +1611 -0
- package/dist/image-size-CvN2iCA4.js.map +1 -0
- package/dist/index.d.ts +24 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -11
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +40 -31
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +40 -48
- package/dist/inspect.js.map +1 -1
- package/dist/math.d.ts +7 -5
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +16 -7
- package/dist/math.js.map +1 -1
- package/dist/measure.d.ts +12 -225
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +3 -3
- package/dist/node.d.ts +22 -8
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +27 -7
- package/dist/node.js.map +1 -1
- package/dist/notes-Dh12JAbn.js +3264 -0
- package/dist/notes-Dh12JAbn.js.map +1 -0
- package/dist/options-internal-WqgMf720.js +43 -0
- package/dist/options-internal-WqgMf720.js.map +1 -0
- package/dist/{package-CaOLXSNi.d.ts → package-J49Ck6S2.d.ts} +27 -12
- package/dist/package-J49Ck6S2.d.ts.map +1 -0
- package/dist/playbtn-CUqQdoDf.js +22 -0
- package/dist/playbtn-CUqQdoDf.js.map +1 -0
- package/dist/{slide-ZqAdVvHV.d.ts → pres-C6qgOFAa.d.ts} +1021 -1423
- package/dist/pres-C6qgOFAa.d.ts.map +1 -0
- package/dist/{presentation-DrJtj3-C.js → presentation-DGYlAWhl.js} +3208 -2727
- package/dist/presentation-DGYlAWhl.js.map +1 -0
- package/dist/{presentation-types-CDjScsev.d.ts → presentation-types-8jLQHI4M.d.ts} +1070 -683
- package/dist/presentation-types-8jLQHI4M.d.ts.map +1 -0
- package/dist/read.d.ts +9 -9
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +4 -4
- package/dist/script.d.ts +80 -66
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +2399 -1139
- package/dist/script.js.map +1 -1
- package/dist/{shapes-BemroU-z.js → shapes-re0KyQk_.js} +2807 -1609
- package/dist/shapes-re0KyQk_.js.map +1 -0
- package/dist/slide-Dx2ZeVZ6.d.ts +1256 -0
- package/dist/slide-Dx2ZeVZ6.d.ts.map +1 -0
- package/dist/slide-size-BalTjFuv.js +88 -0
- package/dist/slide-size-BalTjFuv.js.map +1 -0
- package/dist/{units-internal-Dg95w_YD.js → table-cell-margins-EVg0EwxT.js} +235 -273
- package/dist/table-cell-margins-EVg0EwxT.js.map +1 -0
- package/dist/table-dom-BTDP3lEP.js +21 -0
- package/dist/table-dom-BTDP3lEP.js.map +1 -0
- package/dist/text-anchor-CrYXAfUu.js +176 -0
- package/dist/text-anchor-CrYXAfUu.js.map +1 -0
- package/dist/text-sN64Otf_.js +3980 -0
- package/dist/text-sN64Otf_.js.map +1 -0
- package/dist/transition-speed-kUEWDWTx.js +14 -0
- package/dist/transition-speed-kUEWDWTx.js.map +1 -0
- package/dist/units-internal-XJlf-hOl.js +649 -0
- package/dist/units-internal-XJlf-hOl.js.map +1 -0
- package/dist/zip-C0leZZMj.d.ts +67 -0
- package/dist/zip-C0leZZMj.d.ts.map +1 -0
- package/dist/zip-CKd8ihcf.js +177 -0
- package/dist/zip-CKd8ihcf.js.map +1 -0
- package/dist/zip.d.ts +3 -68
- package/dist/zip.js +3 -163
- package/dist/zoom-DPUHh85d.js +8865 -0
- package/dist/zoom-DPUHh85d.js.map +1 -0
- package/package.json +106 -19
- package/skills/ts-pptx-upstream/SKILL.md +58 -57
- package/dist/autopage-DkjYZUFD.js +0 -423
- package/dist/autopage-DkjYZUFD.js.map +0 -1
- package/dist/diagnostics-DfBdDHre.d.ts +0 -829
- package/dist/diagnostics-DfBdDHre.d.ts.map +0 -1
- package/dist/errors-Bvln0H-7.js.map +0 -1
- package/dist/errors-PflMPWBn.d.ts +0 -182
- package/dist/errors-PflMPWBn.d.ts.map +0 -1
- package/dist/fit-BKs0zxMI.js.map +0 -1
- package/dist/html-dom-B0I0QSbU.js.map +0 -1
- package/dist/namespaces-BVnNu7sg.js +0 -666
- package/dist/namespaces-BVnNu7sg.js.map +0 -1
- package/dist/notes-CJFJaG6M.js +0 -1724
- package/dist/notes-CJFJaG6M.js.map +0 -1
- package/dist/package-CaOLXSNi.d.ts.map +0 -1
- package/dist/pres-BcBR3CSM.d.ts +0 -202
- package/dist/pres-BcBR3CSM.d.ts.map +0 -1
- package/dist/presentation-DrJtj3-C.js.map +0 -1
- package/dist/presentation-types-CDjScsev.d.ts.map +0 -1
- package/dist/shapes-BemroU-z.js.map +0 -1
- package/dist/slide-ZqAdVvHV.d.ts.map +0 -1
- package/dist/text-B8SLEaZx.js +0 -11327
- package/dist/text-B8SLEaZx.js.map +0 -1
- package/dist/units-1kRzYShk.js +0 -231
- package/dist/units-1kRzYShk.js.map +0 -1
- package/dist/units-internal-Dg95w_YD.js.map +0 -1
- package/dist/zip.d.ts.map +0 -1
- package/dist/zip.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-B8SLEaZx.js","names":["neverLineCap","OD","relationship","PROP","NS","relationship"],"sources":["../src/media/content-type.ts","../src/gen/define/background.ts","../src/gen/drawingml/line.ts","../src/gen/chart/data-refs.ts","../src/gen/chart/chart-parts.ts","../src/gen/define/chart.ts","../src/gen/define/comment.ts","../src/gen/define/object-name.ts","../src/gen/define/connector.ts","../src/gen/define/image-rel.ts","../src/gen/define/image.ts","../src/gen/drawingml/geometry.ts","../src/gen/define/hyperlinks.ts","../src/gen/define/shape.ts","../src/gen/define/text.ts","../src/gen/define/group.ts","../src/media/placeholders.ts","../src/gen/define/media.ts","../src/gen/define/preview-image.ts","../src/gen/define/model3d.ts","../src/gen/define/notes.ts","../src/gen/define/ole.ts","../src/gen/table/spans.ts","../src/gen/define/table.ts","../src/gen/define/zoom.ts","../src/slide.ts","../src/gen/chart/chart-axes.ts","../src/gen/chart/plot-cat-axis.ts","../src/gen/chart/plot-scatter.ts","../src/gen/chart/plot-bubble.ts","../src/gen/chart/plot-pie.ts","../src/gen/chart/plot-stock.ts","../src/gen/chart/plot-surface.ts","../src/gen/chart/chart-xml.ts","../src/gen/chart/chartex-data.ts","../src/gen/chart/chartex-xml.ts","../src/gen/chart/chartex-style.ts","../src/gen/chart/embed-xlsx.ts","../src/gen/define/master.ts","../src/gen/define/placeholder.ts","../src/gen/media.ts","../src/gen/prepare.ts","../src/gen/slide/shape-ids.ts","../src/gen/anim/animation.ts","../src/gen/anim/timing.ts","../src/gen/anim/transition.ts","../src/gen/drawingml/locks.ts","../src/gen/slide/objects/shared.ts","../src/gen/drawingml/text-body.ts","../src/gen/slide/objects/chart.ts","../src/gen/slide/objects/connector.ts","../src/gen/drawingml/image.ts","../src/gen/slide/objects/image.ts","../src/gen/slide/objects/media.ts","../src/gen/slide/objects/model3d.ts","../src/gen/slide/objects/ole.ts","../src/gen/drawingml/table-border.ts","../src/gen/drawingml/table-cell3d.ts","../src/gen/slide/objects/table.ts","../src/gen/slide/objects/text.ts","../src/gen/slide/objects/zoom.ts","../src/gen/slide/object.ts","../src/gen/slide/slide.ts","../src/gen/pres/theme.ts","../src/gen/opc/app.ts","../src/gen/opc/content-types.ts","../src/gen/opc/core.ts","../src/gen/opc/custom-props.ts","../src/gen/opc/root-rels.ts","../src/gen/pres/presentation-rels.ts","../src/gen/pres/presentation.ts","../src/gen/pres/table-styles.ts","../src/gen/slide/comments.ts","../src/gen/slide/layout.ts","../src/gen/slide/master.ts","../src/package/assemble.ts","../src/presentation.ts","../src/runtime/fetch-media.ts","../src/clip.ts","../src/types/text.ts"],"sourcesContent":["/**\n * OPC content types for embedded media parts, keyed by file extension.\n *\n * Both mappings reproduce what PowerPoint itself authors rather than the IANA-preferred\n * spelling — a package that disagrees (e.g. `audio/mp3` for an `.mp3`) is the kind of thing\n * PowerPoint offers to repair.\n */\n\n/**\n * Map an image file extension to its OOXML content type.\n * Inverse of the read-side `IMAGE_EXTENSION_BY_CONTENT_TYPE` (src/read/api/shapes/picture.ts):\n * EMF/WMF use the `x-`-prefixed forms PowerPoint authors (and that the read side\n * expects), `jpg`/`jpeg` normalize to `image/jpeg`, and `svg` to `image/svg+xml`.\n * Only the content type is derived here; the file extension (used for the media\n * Target filename) is left to the caller.\n * @param {string} extn - image file extension (e.g. `png`, `jpg`, `emf`)\n * @returns {string} OOXML content type (e.g. `image/png`, `image/x-emf`)\n */\nexport function imageContentType(extn: string): string {\n\tswitch ((extn || '').toLowerCase()) {\n\t\tcase 'emf':\n\t\t\treturn 'image/x-emf'\n\t\tcase 'wmf':\n\t\t\treturn 'image/x-wmf'\n\t\tcase 'svg':\n\t\t\treturn 'image/svg+xml'\n\t\tcase 'jpg':\n\t\tcase 'jpeg':\n\t\t\treturn 'image/jpeg'\n\t\tdefault:\n\t\t\treturn 'image/' + (extn || '').toLowerCase()\n\t}\n}\n\n/**\n * Resolve the file extension an embedded image part should carry, from the caller's source.\n *\n * A `data:` URI states its mime type outright, so it wins over `path`: the bytes are the thing\n * being embedded, and a caller may supply them with no path at all (or with a path whose\n * extension disagrees with the payload). The extension chosen here names the media part *and*,\n * via {@link imageContentType}, decides the `<Default>` the package declares for it — so\n * getting it from a placeholder path is how a deck ends up declaring `image/png` over SVG\n * bytes, which is exactly the mismatch PowerPoint offers to \"repair\".\n *\n * `image/svg+xml` needs its own test because the `\\w+` mime capture stops at the `+`. The\n * result is always lower-cased, so a `data:image/PNG;` source names its part the same way a\n * `photo.PNG` path does.\n * @param {string} path - caller-supplied path/URL (may be empty); query and fragment are stripped\n * @param {string} data - caller-supplied `data:`/base64 payload (may be empty)\n * @returns {string} file extension, no dot (e.g. `png`, `jpeg`, `svg`)\n */\nexport function imageExtensionForSource(path: string, data: string): string {\n\t// NOTE: Split to address URLs with params (eg: `path/brent.jpg?someParam=true`)\n\tconst strPath = path || ''\n\tconst strData = data || ''\n\tconst pathFile = strPath.slice(strPath.lastIndexOf('/') + 1).split('?')[0] || ''\n\tconst pathExtn = ((pathFile.split('.').pop() || 'png').split('#')[0] || 'png').toLowerCase()\n\n\t// Pre-encoded images can be whatever mime-type they want (and good for them!)\n\tconst mimeMatch = /image\\/(\\w+);/.exec(strData)\n\tif (strData && mimeMatch?.[1]) return mimeMatch[1].toLowerCase()\n\tif (strData.toLowerCase().includes('image/svg+xml')) return 'svg'\n\treturn pathExtn\n}\n\n/**\n * Map an audio content type's subtype back to the file extension a media part should use.\n *\n * Needed because a caller supplying sound bytes as a `data:` URI states a *content type*\n * (`data:audio/x-wav;base64,…`), while the media part needs a *filename*. Taking the subtype\n * verbatim produces `audio1.x-wav` — legal, since the package would then declare a matching\n * `<Default Extension=\"x-wav\"/>`, but a file type that does not exist and that no other tool\n * recognises. `audio/x-wav` in particular is not an edge case: it is exactly what PowerPoint\n * authors for an embedded transition sound, so it arrives on any deck read back in.\n *\n * Only the spellings that are *not* already an extension are listed; anything else (`ogg`,\n * `flac`, `aac`, …) is its own extension and falls through. Read against {@link avContentType},\n * which maps the same pairs in the other direction.\n */\nexport function audioExtensionForSubtype(subtype: string): string {\n\tswitch ((subtype || '').toLowerCase()) {\n\t\tcase 'x-wav':\n\t\tcase 'wave':\n\t\tcase 'vnd.wave':\n\t\t\treturn 'wav'\n\t\tcase 'mpeg':\n\t\t\treturn 'mp3'\n\t\tcase 'x-ms-wma':\n\t\t\treturn 'wma'\n\t\tcase 'mp4':\n\t\t\treturn 'm4a'\n\t\tdefault:\n\t\t\treturn (subtype || '').toLowerCase()\n\t}\n}\n\n/**\n * Resolve the OPC content type for an embedded audio/video part by file extension,\n * matching what PowerPoint authors (e.g. `mp3` → `audio/mpeg`, not `audio/mp3`).\n * The `mtype` disambiguates extensions Office maps differently per kind and seeds\n * the `mtype/extn` fallback for anything unlisted.\n * @param {string} extn - media file extension (no dot), case-insensitive\n * @param {'audio' | 'video'} mtype - whether the item is audio or video\n */\nexport function avContentType(extn: string, mtype: 'audio' | 'video'): string {\n\tswitch ((extn || '').toLowerCase()) {\n\t\t// video\n\t\tcase 'mp4':\n\t\t\treturn mtype === 'audio' ? 'audio/mp4' : 'video/mp4'\n\t\tcase 'm4v':\n\t\t\treturn 'video/mp4'\n\t\tcase 'mov':\n\t\t\treturn 'video/quicktime'\n\t\tcase 'avi':\n\t\t\treturn 'video/avi'\n\t\tcase 'wmv':\n\t\t\treturn 'video/x-ms-wmv'\n\t\tcase 'mpg':\n\t\tcase 'mpeg':\n\t\t\treturn mtype === 'audio' ? 'audio/mpeg' : 'video/mpeg'\n\t\tcase 'ogv':\n\t\t\treturn 'video/ogg'\n\t\tcase 'webm':\n\t\t\treturn 'video/webm'\n\t\t// audio\n\t\tcase 'mp3':\n\t\t\treturn 'audio/mpeg'\n\t\tcase 'm4a':\n\t\t\treturn 'audio/mp4'\n\t\tcase 'wav':\n\t\t\treturn 'audio/x-wav' // PowerPoint authors the x- form (e.g. embedded transition sounds)\n\t\tcase 'wma':\n\t\t\treturn 'audio/x-ms-wma'\n\t\tcase 'aac':\n\t\t\treturn 'audio/aac'\n\t\tcase 'oga':\n\t\tcase 'ogg':\n\t\t\treturn 'audio/ogg'\n\t\tcase 'flac':\n\t\t\treturn 'audio/flac'\n\t\tdefault:\n\t\t\treturn mtype + '/' + (extn || '').toLowerCase()\n\t}\n}\n","/**\n * ts-pptx: Background Definition\n *\n * Registers an `addBackground()` image as a slide media rel (color backgrounds carry no rel);\n * the `<p:bg>` XML is emitted later at slide / layout serialize time.\n */\nimport type { BackgroundProps } from '../../types/index.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { imageContentType, imageExtensionForSource } from '../../media/content-type.js'\n\n/**\n * Reduce a slide/layout name to something safe to embed in a media part name.\n *\n * A background rel's `Target` is used twice over: it is written into the `.rels` part *and*,\n * with `..` swapped for `ppt`, used verbatim as the ZIP entry name (`presentation.ts`). A layout's\n * name is caller-supplied (`defineSlideMaster({ title })`), so without this the caller can put\n * arbitrary characters into an OPC part name. XML-escaping does not help — the escaping is\n * undone before the target is resolved, and the ZIP entry is never escaped at all. Demonstrated\n * breakage before this was added:\n * - `%` produced an invalid percent-escape, so the target would not decode at all\n * - `?` and `#` began a query/fragment, truncating the resolved path (`what?now-image-1.png`\n * resolves to `ppt/media/what`, which is not in the package)\n * - `/` silently pushed the media into a subdirectory\n *\n * So the safe set is the URI \"unreserved\" characters. Runs of anything else collapse to a\n * single `-` (subsuming the whitespace handling this replaces), leading/trailing punctuation is\n * trimmed, and a name left empty — including an all-non-ASCII one — falls back to `media`.\n * The result is cosmetic: it names the media part, and nothing resolves a layout by it.\n */\nfunction sanitizeMediaNamePart(name: string): string {\n\tconst safe = name\n\t\t.replace(/[^A-Za-z0-9._-]+/g, '-')\n\t\t.replace(/^[-.]+/, '')\n\t\t.replace(/[-.]+$/, '')\n\treturn safe || 'media'\n}\n\n/**\n * Adds a background image or color to a slide definition.\n * @param {BackgroundProps} props - color string or an object with image definition\n * @param {PresSlideInternal} target - slide object that the background is set to\n */\nexport function addBackgroundDefinition(props: BackgroundProps | undefined, target: SlideLayoutInternal): void {\n\t// Handle media\n\tif (props && (props.path || props.data)) {\n\t\t// The `data:` mime wins over `path`, as it does for `addImage()`: a background supplied as\n\t\t// bytes alone used to fall back on the `preencoded.png` placeholder path and declare\n\t\t// `image/png` no matter what it actually carried, so `{ data: 'data:image/svg+xml;…' }`\n\t\t// shipped SVG bytes in a part the package announced as PNG.\n\t\tlet strImgExtn = imageExtensionForSource(props.path || '', props.data || '')\n\t\tif (strImgExtn === 'jpg') strImgExtn = 'jpeg' // base64-encoded jpg's come out as \"data:image/jpeg;base64,/9j/[...]\", so correct exttnesion to avoid content warnings at PPT startup\n\t\t// Allow the use of only the data key (`path` isnt reqd). Kept local: `props` is the\n\t\t// caller's own object on the `slide.background =` path, not a clone.\n\t\tconst strImgPath = props.path || `preencoded.${strImgExtn}`\n\n\t\ttarget._relsMedia = target._relsMedia || []\n\t\tconst intRels = target._relsMedia.length + 1\n\t\t// NOTE: `Target` cannot have spaces (eg:\"Slide 1-image-1.jpg\") or a \"presentation is corrupt\"\n\t\t// warning comes up — `sanitizeMediaNamePart` covers that case along with the rest.\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImgPath,\n\t\t\ttype: imageContentType(strImgExtn),\n\t\t\textn: strImgExtn,\n\t\t\tdata: props.data || undefined,\n\t\t\trId: intRels,\n\t\t\tTarget: `../media/${sanitizeMediaNamePart(target._name || '')}-image-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t})\n\t\ttarget._bkgdImgRid = intRels\n\t}\n}\n","/**\n * ts-pptx: DrawingML line (stroke) properties\n *\n * Resolve the pieces of an `<a:ln>` stroke: its width, its `cap` attribute, and\n * its paint child. The paint reuses the shape fill group (`fill.ts`), because\n * DrawingML allows the same fills inside `<a:ln>` as inside a shape.\n */\n\nimport type { BorderProps, LineCap, ShapeLineProps } from '../../types/index.js'\nimport { genXmlColorSelection, genXmlGradientFill } from './fill.js'\nimport { InvalidOptionError } from '../../errors.js'\nimport { warnOnce } from '../../diagnostics.js'\nimport { checkEnumOrWarn } from '../../ooxml/check-enum.js'\nimport { PRESET_LINE_DASHES } from '../../ooxml/st-enums.js'\nimport { voidEl } from '../oxml/el.js'\n\n/** Every key `BorderProps` defines. Keep in step with the interface in `types/style.ts`. */\nconst BORDER_KEYS: readonly string[] = ['type', 'dashType', 'color', 'width', 'transparency', 'cap']\n\n/**\n * Resolve the `a:prstDash/@val` a border should emit.\n *\n * `BorderProps.type` is a three-way switch, so on its own it can only say \"dashed\" and\n * every dashed border collapses onto `sysDash`. `dashType` names the preset directly and\n * therefore wins when both are given; `type: 'none'` never reaches here, being decided by\n * the caller before any dash is chosen.\n *\n * A value outside `ST_PresetLineDashVal` would make the part schema-invalid, which\n * PowerPoint reports as a corrupt file rather than a mis-set option — so an unrecognized\n * one is reported and dropped back to what `type` implies.\n * @param {BorderProps} border - the caller's border properties\n * @returns {string} a value legal for `a:prstDash/@val`\n */\nexport function resolveBorderDash(border: BorderProps): string {\n\tconst fromType = border.type === 'dash' ? 'sysDash' : 'solid'\n\treturn (\n\t\tcheckEnumOrWarn(border.dashType, PRESET_LINE_DASHES, 'border/invalid-dash-type', 'border: dashType') ?? fromType\n\t)\n}\n\n/**\n * Report an authored key that is not part of `BorderProps`, which the library would\n * otherwise drop without a sound.\n *\n * TypeScript's excess-property check already rejects a stray key on a border written\n * *inline* at the call site. It deliberately does not fire when the border is built as\n * a variable first (`const b = {...}; addTable(rows, { border: b })`) — a variable may\n * legitimately be a supertype. That exemption covers precisely the reuse pattern a\n * shared grid style encourages, so the mistake reaches here typed as valid and the\n * wrong-named value is discarded during generation. A `.pptx` gives no other signal:\n * nothing throws, the deck opens, and the border simply renders at its default weight.\n * @param border - the caller's border properties\n */\nfunction warnUnknownBorderKeys(border: BorderProps): void {\n\tfor (const key in border) {\n\t\tif (!Object.hasOwn(border, key) || BORDER_KEYS.includes(key)) continue\n\t\twarnOnce(\n\t\t\t'border/unknown-key',\n\t\t\t`border: unknown option \\`${key}\\` is ignored — valid keys are ${BORDER_KEYS.join(', ')}. ` +\n\t\t\t\t'Line thickness is `width`, in points.',\n\t\t\t{ received: key, valid: BORDER_KEYS }\n\t\t)\n\t}\n}\n\n/**\n * Resolve a border's line width in points, falling back to `defaultPt` when `width`\n * is not a usable number.\n *\n * Every `BorderProps` the library reads — table cell borders, table-style regions, and\n * every chart border — resolves its width through here, so this doubles as the one\n * place that can vet a border's shape for all of them ({@link warnUnknownBorderKeys}).\n * @param {BorderProps} border - border properties (may carry `width`)\n * @param {number} defaultPt - width to use when `width` is not a finite number\n * @returns {number} resolved width in points\n */\nexport function resolveBorderWidth(border: BorderProps, defaultPt: number): number {\n\twarnUnknownBorderKeys(border)\n\tconst val = border.width\n\treturn typeof val === 'number' && !isNaN(val) ? val : defaultPt\n}\n\n/**\n * Map a friendly `LineCap` value to the OOXML `cap` attribute value (`flat`/`sq`/`rnd`).\n * @param {LineCap} [lineCap] - line cap style (defaults to `flat`)\n * @returns {string} value for the `cap` attribute on `<a:ln>`\n */\nexport function createLineCap(lineCap?: LineCap): string {\n\tif (!lineCap || lineCap === 'flat') {\n\t\treturn 'flat'\n\t} else if (lineCap === 'square') {\n\t\treturn 'sq'\n\t} else if (lineCap === 'round') {\n\t\treturn 'rnd'\n\t} else {\n\t\tconst neverLineCap: never = lineCap\n\t\tthrow new InvalidOptionError('line/invalid-cap', `Invalid line cap: ${String(neverLineCap)}`)\n\t}\n}\n\n/**\n * Emit the paint child of an `<a:ln>` stroke.\n * DrawingML allows the same fill group inside `<a:ln>` as inside a shape fill, so a\n * stroke can be a gradient/pattern as well as a solid color:\n * - a `gradient` (or `type: 'gradient'`) produces a `<a:gradFill>` (gradient stroke);\n * - a `pattern`/`image` type delegates to the shared fill dispatch;\n * - otherwise a `color` produces a `<a:solidFill>`.\n * Returns '' when the line specifies no paint, so the caller emits no fill child and\n * the stroke inherits its color from the theme/placeholder.\n * @param {ShapeLineProps} line line options\n * @returns XML string\n */\nexport function genXmlLineFill(line: ShapeLineProps): string {\n\t// `type: 'none'` is an explicit *no stroke*, and it is not the same as saying nothing.\n\t// Omitting the paint child leaves the outline to the theme or placeholder, so a shape\n\t// authored with `line: { type: 'none' }` grew the theme's border instead of losing it.\n\tif (line.type === 'none') return voidEl('a:noFill')\n\t// `gradient` presence selects a gradient stroke even when `type` was omitted.\n\tif (line.gradient || line.type === 'gradient') return genXmlGradientFill(line.gradient)\n\tif (line.type === 'pattern' || line.type === 'image') return genXmlColorSelection(line)\n\tif (line.color) return genXmlColorSelection(line)\n\treturn ''\n}\n","/**\n * ts-pptx: Chart Series-Data ↔ Worksheet-Cell Mapping\n *\n * The tiny pure helpers that both chart package parts share: the empty-array-safe\n * accessors over the normalized (internal) chart-series arrays, and the builders that\n * turn a (column, row) into an absolute reference into the chart's embedded `Sheet1`.\n * The embedded-workbook builder ({@link ../chart/embed-xlsx}) writes the cells; the\n * chart-XML builder ({@link ../chart/chart-xml}) points `<c:f>` formulas back at them —\n * so this mapping lives in one place to keep column letters and `$`-anchoring from\n * drifting between the two sides.\n */\n\nimport { LETTERS } from '../../constants-internal.js'\nimport type { OptsChartDataInternal } from '../../types/internal.js'\n\n// ===== Series-data accessors =====\n// The normalized (internal) chart-series arrays are populated at addChart time but stay\n// optional on OptsChartDataInternal; read them through these accessors with an empty-array\n// fallback so the OOXML/worksheet assembly never dereferences `undefined`. They also\n// tolerate an absent series (`data[0]` on an empty set) by returning an empty array.\nexport const dataLabels = (d: OptsChartDataInternal | undefined): string[][] => d?.labels ?? []\nexport const dataValues = (d: OptsChartDataInternal | undefined): number[] => d?.values ?? []\nexport const dataSizes = (d: OptsChartDataInternal | undefined): number[] => d?.sizes ?? []\n// The first label group of a series (`labels[0]`), empty when the series or group is absent.\nexport const firstLabelGroup = (d: OptsChartDataInternal | undefined): string[] => dataLabels(d)[0] ?? []\n\n// ===== Worksheet-cell references =====\n\n/**\n * Calc and return excel column name for a given column length\n * @param colIndex column index\n * @return column name\n * @example 1 returns 'A'\n * @example 27 returns 'AA'\n */\nexport function getExcelColName(colIndex: number): string {\n\tlet colStr: string\n\tconst colIdx = colIndex - 1 // Subtract 1 so `LETTERS[columnIndex]` returns \"A\" etc\n\n\tif (colIdx <= 25) {\n\t\t// A-Z\n\t\tcolStr = LETTERS[colIdx] ?? ''\n\t} else {\n\t\t// AA-ZZ (ZZ = index 702)\n\t\tcolStr = `${LETTERS[Math.floor(colIdx / LETTERS.length - 1)]}${LETTERS[colIdx % LETTERS.length]}`\n\t}\n\n\treturn colStr\n}\n\n/**\n * Build an absolute single-cell reference into the embedded workbook's `Sheet1`,\n * as emitted in a chart series `<c:f>` formula: `Sheet1!$C$2`. Centralizes the\n * `$`-anchoring so the column letter and `$` placement can't drift between sites.\n * @param colIndex 1-based column index (1 => 'A')\n * @param row 1-based row number\n */\nexport function sheetCellRef(colIndex: number, row: number): string {\n\treturn `Sheet1!$${getExcelColName(colIndex)}$${row}`\n}\n\n/**\n * Build an absolute range reference into the embedded workbook's `Sheet1`, as\n * emitted in a chart series `<c:f>` formula: `Sheet1!$C$2:$C$6`. A same-column\n * range (the common case) passes the same index for `colFrom`/`colTo`; deriving\n * the column letter once per endpoint removes the duplicated `getExcelColName`\n * call that was a real off-by-one surface.\n * @param colFrom 1-based start column index\n * @param rowFrom 1-based start row\n * @param colTo 1-based end column index\n * @param rowTo 1-based end row\n */\nexport function sheetRangeRef(colFrom: number, rowFrom: number, colTo: number, rowTo: number): string {\n\treturn `Sheet1!$${getExcelColName(colFrom)}$${rowFrom}:$${getExcelColName(colTo)}$${rowTo}`\n}\n","/**\n * ts-pptx: Shared Chart Fragment Builders\n *\n * The leaf builders every chart region reuses -- titles, gridlines, series data points,\n * error bars, number caches, leader lines, borders. Each is a pure string builder with\n * no dependency on any other module in this directory, which is what lets the plot\n * builders ({@link ./plot-cat-axis}, {@link ./plot-scatter}, {@link ./plot-bubble},\n * {@link ./plot-pie}), the axes ({@link ./chart-axes}), and the chart envelope\n * ({@link ./chart-xml}) all draw on them without a cycle.\n */\n\nimport { ChartType } from '../../enums.js'\nimport {\n\tBARCHART_COLORS,\n\tDEF_CHART_GRIDLINE,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n\tDEF_SHAPE_SHADOW,\n\tPIECHART_COLORS,\n} from '../../constants-internal.js'\nimport type { BorderProps, ChartErrorBarOptions, ChartPropsTitle, OptsChartGridLine } from '../../types/index.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { createShadowEffectLst } from '../drawingml/effect.js'\nimport { genXmlColorSelection, genXmlPatternFill } from '../drawingml/fill.js'\nimport { createLineCap, resolveBorderWidth } from '../drawingml/line.js'\nimport { convertAngleUnits, ptsToEmuLenient } from '../../units-internal.js'\nimport { ptToHundredths } from '../../units.js'\nimport { dataValues } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\n\nexport const VALID_CHART_TIME_UNITS = ['days', 'months', 'years']\n\n/**\n * A validated, lowercased axis time unit, or `undefined` when the value is not one.\n *\n * A garbage time unit does not degrade the chart -- it corrupts it, and PowerPoint renders\n * nothing at all -- so an unrecognized value warns and is dropped rather than emitted.\n *\n * This replaces two copies of a loop that wrote `opts[opt] = undefined` back onto the options\n * bag from inside an XML builder. Nothing downstream was corrupted (`ChartOptsInternal` is a\n * copy `gen/define/chart.ts` already made, guarded by\n * `test/regression/chart/chart-input-immutability.test.js`), but it meant calling the same axis\n * builder twice gave a different answer the second time, and it put validation somewhere nobody\n * would look for it.\n *\n * @param value - the caller's time unit, or `undefined`\n * @param optionName - the option as the caller spells it, for the warning\n */\nexport function validTimeUnit(value: string | undefined, optionName: string): string | undefined {\n\tif (!value) return undefined\n\tif (typeof value !== 'string' || !VALID_CHART_TIME_UNITS.includes(value.toLowerCase())) {\n\t\twarn('chart/invalid-axis-time-unit', `\"${optionName}\" must be one of: 'days','months','years' !`)\n\t\treturn undefined\n\t}\n\treturn value.toLowerCase()\n}\n\n/**\n * The palette colour for series/point `idx`, cycling back to the start once the palette runs out.\n *\n * Every palette lookup in this directory goes through here so that a deck with more series or\n * data points than the palette has entries still emits the same bytes on every build.\n */\n/**\n * The built-in series palette for a chart type.\n *\n * Pie and doughnut colour their *data points* rather than their series, so they take the wider,\n * flatter `PIECHART_COLORS`; everything else takes `BARCHART_COLORS`. A combo chart's `_type` is\n * an array, which is neither, and lands on the bar palette its subcharts already use.\n * @param {ChartOptsInternal['_type']} type - the normalized chart type\n * @returns {string[]} the palette that applies when the caller named none\n */\nexport function defaultChartPalette(type: ChartOptsInternal['_type']): string[] {\n\treturn type === ChartType.pie || type === ChartType.doughnut ? PIECHART_COLORS : BARCHART_COLORS\n}\n\n/**\n * The palette a chart's series and data points draw from: the caller's `chartColors` when it has\n * entries, otherwise {@link defaultChartPalette} for this chart's type.\n *\n * `addChartDefinition` resolves `chartColors` the same way, so for a plain chart this agrees with\n * what normalization already put there. It is not redundant: a combo subchart's options are not\n * put through that pass (`SUBCHART_VALIDATED_KEYS` does not list `chartColors`), so this is the\n * only place a subchart's palette is decided. Six plot builders wrote the lookup out; going\n * through one function is what makes \"no colours named\" a single decision rather than six.\n */\nexport function resolveChartPalette(opts: ChartOptsInternal): string[] {\n\treturn opts.chartColors?.length ? opts.chartColors : defaultChartPalette(opts._type)\n}\n\nexport function paletteColor(palette: readonly string[], idx: number, fallback = '000000'): string {\n\tif (palette.length === 0) return fallback\n\treturn palette[idx % palette.length] ?? fallback\n}\n\n// DEF_CHART_GRIDLINE.color is optional on the type but always present on the constant.\nexport const DEF_GRIDLINE_COLOR: string = DEF_CHART_GRIDLINE.color ?? '888888'\n\n/**\n * Fill fragment for a `chartColors`-derived series/line/marker colour.\n *\n * A `'transparent'` entry means \"no fill\" — an invisible series, connecting line, or marker\n * stroke — and maps to `<a:noFill/>`. Any real colour goes through the normal solid-fill path.\n * The series and marker *fill* paths already special-case `'transparent'`; without this the\n * *stroke* paths (`<a:ln>` on the series line and marker border) would instead pass the literal\n * `'transparent'` through colour validation, warn \"not a valid scheme color or hex RGB\", and\n * render as black — leaving a stray black line/border where a transparent series was requested.\n */\nexport function chartColorLineFill(color: string): string {\n\treturn color === 'transparent' ? voidEl('a:noFill') : genXmlColorSelection(color)\n}\n/**\n * Emit the `<a:latin>/<a:ea>/<a:cs>` font trio for a chart text run.\n *\n * In DrawingML run properties a typeface applies only to the script class of\n * its element: `<a:latin>` covers Latin/ASCII, `<a:ea>` covers East Asian, and\n * `<a:cs>` covers complex scripts. Emitting `<a:latin>` alone leaves East Asian\n * (e.g. Chinese) and complex-script glyphs falling back to the theme font, so a\n * user-specified font never takes effect for that text — most visibly on\n * PowerPoint for Mac. Stamping the same typeface onto all three classes is what\n * choosing a font in PowerPoint's UI does.\n * @param {string} typeface - font face name\n * @return {string} `<a:latin/><a:ea/><a:cs/>` XML\n */\n\nexport function createChartTextFonts(typeface: string): string {\n\t// Every caller passes a caller-supplied font option (dataLabelFontFace, catAxisLabelFontFace,\n\t// legendFontFace, ...), so escaping happens here — one site covers all of them. voidEl()'s\n\t// attrs escape by construction: an unescaped `\"` or `&` would otherwise close the attribute\n\t// early and emit a non-parseable chart part.\n\treturn voidEl('a:latin', { typeface }) + voidEl('a:ea', { typeface }) + voidEl('a:cs', { typeface })\n}\n\nexport function genXmlTitle(opts: ChartPropsTitle, chartX?: number, chartY?: number): string {\n\t// `sizeAttr` is empty when the caller set no font size — PowerPoint then picks the default —\n\t// and interpolating it empty leaves TWO spaces between the tag name and `b=`. Those are\n\t// emitted bytes, and `el()` writes exactly one space before an attribute by design, so the\n\t// two run-property tags below stay hand-written. Dropping the padding would be the real fix —\n\t// no XML consumer can see it — but that is an output change, and a whitespace-only diff is a\n\t// stop rather than a cleanup. Two other sites in this directory are in the same position; the\n\t// ratchet header lists them.\n\tconst sizeAttr = opts.fontSize ? `sz=\"${ptToHundredths(opts.fontSize)}\"` : ''\n\tconst runAttrs = ` ${sizeAttr} b=\"${opts.titleBold ? 1 : 0}\" i=\"${opts.titleItalic ? 1 : 0}\" u=\"${opts.titleUnderline ? 'sng' : 'none'}\" strike=\"noStrike\">`\n\tconst runChildren =\n\t\t'\\n ' +\n\t\tgenXmlColorSelection(opts.color || DEF_FONT_COLOR) +\n\t\t'\\n ' +\n\t\tcreateChartTextFonts(opts.fontFace || 'Arial') +\n\t\t'\\n '\n\n\t// NOTE: manualLayout x/y vals are *relative to the entire slide*. Each axis is independent in\n\t// CT_ManualLayout: omitting xMode/x (or yMode/y) leaves that axis on automatic layout, so a\n\t// caller can center horizontally while still applying a manual vertical offset (and vice-versa).\n\t// Schema order is xMode, yMode, x, y.\n\tconst hasX = opts.titlePos && typeof opts.titlePos.x === 'number'\n\tconst hasY = opts.titlePos && typeof opts.titlePos.y === 'number'\n\t/** Fold a slide-relative offset into the fraction-of-chart value `c:x`/`c:y` want. */\n\tconst edgeFraction = (offset: number): number => {\n\t\tlet val = offset === 0 ? 0 : (offset * (offset / 5)) / 10\n\t\tif (val >= 1) val = val / 10\n\t\tif (val >= 0.1) val = val / 10\n\t\treturn val\n\t}\n\tlet layout = voidEl('c:layout')\n\tif (hasX || hasY) {\n\t\tconst modes = (hasX ? voidEl('c:xMode', { val: 'edge' }) : '') + (hasY ? voidEl('c:yMode', { val: 'edge' }) : '')\n\t\tconst vals =\n\t\t\t(hasX ? voidEl('c:x', { val: edgeFraction((opts.titlePos?.x ?? 0) + (chartX ?? 0)) }) : '') +\n\t\t\t(hasY ? voidEl('c:y', { val: edgeFraction((opts.titlePos?.y ?? 0) + (chartY ?? 0)) }) : '')\n\t\tlayout = el('c:layout', null, raw(el('c:manualLayout', null, raw(modes + vals))))\n\t}\n\n\tconst paragraph = el(\n\t\t'a:p',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:pPr',\n\t\t\t\t\topts.titleAlign === 'left' || opts.titleAlign === 'right' ? { algn: opts.titleAlign.slice(0, 1) } : null,\n\t\t\t\t\traw('\\n <a:defRPr' + runAttrs + runChildren + '</a:defRPr>'),\n\t\t\t\t\t{ openPrefix: '\\n ', closePrefix: '\\n ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:r',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw('\\n <a:rPr' + runAttrs + runChildren + '</a:rPr>'),\n\t\t\t\t\t\traw('\\n ' + el('a:t', null, opts.title ?? '')),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: '\\n ', closePrefix: '\\n ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: '\\n ', closePrefix: '\\n ' }\n\t)\n\tconst rich = el(\n\t\t'c:rich',\n\t\tnull,\n\t\t[\n\t\t\t// Don't specify a rotation when none was asked for, so the default applies (which is\n\t\t\t// vertical on a category axis).\n\t\t\traw(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'a:bodyPr',\n\t\t\t\t\t{ rot: opts.titleRotate ? convertAngleUnits(opts.titleRotate, 'titleRotate') : undefined },\n\t\t\t\t\t{ openPrefix: '\\n ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: '\\n ' })),\n\t\t\traw(paragraph),\n\t\t],\n\t\t{ openPrefix: '\\n ', closePrefix: '\\n ' }\n\t)\n\treturn el(\n\t\t'c:title',\n\t\tnull,\n\t\t[\n\t\t\traw(el('c:tx', null, raw(rich), { openPrefix: '\\n ', closePrefix: '\\n ' })),\n\t\t\traw('\\n ' + layout),\n\t\t\traw(voidEl('c:overlay', { val: 0 }, { openPrefix: '\\n ' })),\n\t\t],\n\t\t{ closePrefix: '\\n ' }\n\t)\n}\n\n/**\n * Create Grid Line Element\n * @param {OptsChartGridLine} glOpts {size, color, style}\n * @return {string} XML\n */\nexport function createGridLineElement(glOpts: OptsChartGridLine): string {\n\tconst line = el(\n\t\t'a:ln',\n\t\t{\n\t\t\tw: ptsToEmuLenient(glOpts.size || DEF_CHART_GRIDLINE.size || 1),\n\t\t\tcap: createLineCap(glOpts.cap || DEF_CHART_GRIDLINE.cap),\n\t\t},\n\t\t[\n\t\t\traw(' ' + el('a:solidFill', null, raw(createColorElement(glOpts.color || DEF_GRIDLINE_COLOR)))),\n\t\t\traw(' ' + voidEl('a:prstDash', { val: glOpts.style || DEF_CHART_GRIDLINE.style }) + voidEl('a:round')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\treturn el('c:majorGridlines', null, raw(el('c:spPr', null, raw(line), { openPrefix: ' ', closePrefix: ' ' })))\n}\n\n/**\n * The plot-level `<c:dLbls>` block: number format, run properties, and the six `show*` flags.\n *\n * Shared by the category-axis and scatter plots, which carried a 20-line copy each. The two\n * differed in exactly one thing that reaches the bytes -- whether `<c:showLeaderLines>` is\n * emitted -- so that is the parameter. (They also differed in `? 1 : 0` versus `? '1' : '0'`\n * for the bold/italic flags, which is the same byte either way.)\n *\n * `<c:showLeaderLines>` is last in CT_DLbls' group and optional, which is why omitting it is a\n * legal shape and not a schema gap: leader lines connect a moved label back to its point, and a\n * scatter plot has no `<c:dLblPos>` layout that moves one.\n *\n * @param opts - the chart's normalized options\n * @param leaderLines - emit the trailing `<c:showLeaderLines>` (category-axis plots only)\n */\nexport function chartDataLabels(opts: ChartOptsInternal, leaderLines: boolean): string {\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tb: opts.dataLabelFontBold ? 1 : 0,\n\t\t\ti: opts.dataLabelFontItalic ? 1 : 0,\n\t\t\tstrike: 'noStrike',\n\t\t\tsz: ptToHundredths(opts.dataLabelFontSize || DEF_FONT_SIZE),\n\t\t\tu: 'none',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(opts.dataLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('a:bodyPr', null, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(el('a:p', null, raw(el('a:pPr', null, raw(defRPr), { closePrefix: ' ' })), { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el(\n\t\t'c:dLbls',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'c:numFmt',\n\t\t\t\t\t{ formatCode: (opts.dataLabelFormatCode ?? '') || 'General', sourceLinked: 0 },\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(txPr),\n\t\t\topts.dataLabelPosition ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition }, { openPrefix: ' ' })) : null,\n\t\t\traw(voidEl('c:showLegendKey', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showVal', { val: opts.showValue ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showCatName', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showSerName', { val: opts.showSerName ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showPercent', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showBubbleSize', { val: 0 }, { openPrefix: ' ' })),\n\t\t\tleaderLines\n\t\t\t\t? raw(voidEl('c:showLeaderLines', { val: opts.showLeaderLines ? 1 : 0 }, { openPrefix: ' ' }))\n\t\t\t\t: null,\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n}\n\n/**\n * An `<a:solidFill>` of the theme text colour dimmed towards the background — the grey the chart\n * furniture (stock hi-low lines and up/down bars, the data-table grid) is drawn in.\n * `lumMod`/`lumOff` are the two halves of one dimming: how much of the luminance survives, and\n * how much white is mixed back in.\n * @param lumMod - surviving luminance, in thousandths of a percent\n * @param lumOff - luminance added back, in thousandths of a percent\n */\nexport function dimmedTextFill(lumMod: number, lumOff: number): string {\n\treturn el(\n\t\t'a:solidFill',\n\t\tnull,\n\t\traw(\n\t\t\tel('a:schemeClr', { val: 'tx1' }, [\n\t\t\t\traw(voidEl('a:lumMod', { val: lumMod })),\n\t\t\t\traw(voidEl('a:lumOff', { val: lumOff })),\n\t\t\t])\n\t\t)\n\t)\n}\n\n/** The hairline outline drawn in {@link dimmedTextFill}, at the same three dimming levels. */\nexport function dimmedTextLine(lumMod: number, lumOff: number, fmt?: { openPrefix?: string }): string {\n\treturn el(\n\t\t'a:ln',\n\t\t{ w: 9525, cap: 'flat', cmpd: 'sng', algn: 'ctr' },\n\t\t[raw(dimmedTextFill(lumMod, lumOff)), raw(voidEl('a:round'))],\n\t\tfmt\n\t)\n}\n\n/**\n * Build a `<c:pt>` numeric-cache data point, or '' to leave a gap.\n *\n * `<c:v>` inside a `<c:numCache>` is an `xsd:double`; emitting `NaN`, `Infinity`\n * or an empty string yields an invalid value that makes PowerPoint report the\n * package as needing repair. Null/undefined are intentional gaps and are skipped\n * silently (a sparse, idx-keyed cache is valid); other non-finite numbers are\n * skipped with a warning, per the library's \"warn rather than emit a degenerate\n * result\" policy.\n * @param idx - zero-based data-point index (emitted as `idx`)\n * @param value - numeric value (or null/undefined gap)\n */\nexport function numCachePt(idx: number, value: number | null | undefined): string {\n\tif (value == null) return ''\n\tif (!Number.isFinite(value)) {\n\t\twarn('chart/non-finite-value', `chart value \"${value}\" at index ${idx} is not a finite number; data point omitted.`)\n\t\treturn ''\n\t}\n\treturn el('c:pt', { idx }, raw(el('c:v', null, value)))\n}\n\n/**\n * Build the error-bar elements (`<c:errBars>`) for a single series.\n *\n * Schema position (CT_*Ser): after `dLbls`/`trendline`, before `cat`/`val` (bar/line/area)\n * or `xVal`/`yVal` (scatter). CT_ErrBars child order is errDir → errBarType → errValType →\n * noEndCap → plus → minus → val → spPr.\n *\n * @param chartType - chart this series belongs to (used to bound how many bars are legal)\n * @param errorBars - one config, or an array (X+Y) for scatter/area; bar/line keep only the first\n * @param obj - the series data object (only `name`, for warnings)\n */\nexport function makeChartErrorBarsXml(\n\tchartType: ChartType,\n\terrorBars: ChartErrorBarOptions | ChartErrorBarOptions[] | undefined,\n\tobj: OptsChartDataInternal\n): string {\n\tif (!errorBars) return ''\n\tconst bars = Array.isArray(errorBars) ? errorBars : [errorBars]\n\t// CT_BarSer/CT_LineSer allow a single <c:errBars>; only scatter/area permit two (x + y).\n\tconst maxBars = chartType === ChartType.scatter || chartType === ChartType.area ? 2 : 1\n\tlet strXml = ''\n\n\tbars.slice(0, maxBars).forEach((eb) => {\n\t\tif (!eb) return\n\t\tconst valueType = eb.valueType || 'fixedVal'\n\t\tconst barType = eb.barType || 'both'\n\t\tconst direction = eb.direction || 'y'\n\n\t\tlet children =\n\t\t\tvoidEl('c:errDir', { val: direction }) +\n\t\t\tvoidEl('c:errBarType', { val: barType }) +\n\t\t\tvoidEl('c:errValType', { val: valueType }) +\n\t\t\tvoidEl('c:noEndCap', { val: eb.noEndCap ? 1 : 0 })\n\n\t\tif (valueType === 'cust') {\n\t\t\t// Custom amounts: <c:plus>/<c:minus> each hold a number source (we emit <c:numLit>).\n\t\t\t// `barType` decides which sides are present; warn (don't silently drop) on a missing side.\n\t\t\tif (barType !== 'minus') {\n\t\t\t\tif (!eb.plusValues?.length)\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'chart/error-bars-missing-values',\n\t\t\t\t\t\t`chart series \"${obj.name}\" errorBars valueType 'cust' needs \\`plusValues\\` for barType '${barType}'.`\n\t\t\t\t\t)\n\t\t\t\tchildren += makeErrBarNumLit('plus', eb.plusValues || [])\n\t\t\t}\n\t\t\tif (barType !== 'plus') {\n\t\t\t\tif (!eb.minusValues?.length)\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'chart/error-bars-missing-values',\n\t\t\t\t\t\t`chart series \"${obj.name}\" errorBars valueType 'cust' needs \\`minusValues\\` for barType '${barType}'.`\n\t\t\t\t\t)\n\t\t\t\tchildren += makeErrBarNumLit('minus', eb.minusValues || [])\n\t\t\t}\n\t\t} else if (valueType !== 'stdErr') {\n\t\t\t// fixedVal / percentage / stdDev use a single magnitude (stdErr derives it from the data).\n\t\t\tchildren += voidEl('c:val', { val: eb.value ?? 1 })\n\t\t}\n\n\t\tif (eb.color || eb.size != null) {\n\t\t\tchildren += el(\n\t\t\t\t'c:spPr',\n\t\t\t\tnull,\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'a:ln',\n\t\t\t\t\t\t{ w: eb.size != null ? ptsToEmuLenient(eb.size) : undefined },\n\t\t\t\t\t\traw(eb.color ? genXmlColorSelection(eb.color) : '')\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\tstrXml += el('c:errBars', null, raw(children))\n\t})\n\n\treturn strXml\n}\n\n/**\n * Build a `<c:plus>`/`<c:minus>` number-literal source for custom error-bar amounts.\n * @param tag - `'plus'` or `'minus'`\n * @param values - per-point magnitudes (index-aligned with the series values)\n */\nfunction makeErrBarNumLit(tag: 'plus' | 'minus', values: number[]): string {\n\tconst numLit = el('c:numLit', null, [\n\t\traw(el('c:formatCode', null, 'General')),\n\t\traw(voidEl('c:ptCount', { val: values.length })),\n\t\traw(values.map((value, idx) => numCachePt(idx, value)).join('')),\n\t])\n\treturn el(`c:${tag}`, null, raw(numLit))\n}\n\n/**\n * Build a `<c:serLines>` (\"Series Lines\") element for a bar chart.\n * @param opt - `true` for PowerPoint automatic styling, an {@link OptsChartGridLine}\n * to customize the line, or falsy / `{ style: 'none' }` to omit the element.\n */\nexport function createSerLinesElement(opt?: boolean | OptsChartGridLine): string {\n\tif (!opt) return ''\n\tif (opt === true) return voidEl('c:serLines')\n\tif (opt.style === 'none') return ''\n\tconst line = el(\n\t\t'a:ln',\n\t\t{\n\t\t\tw: ptsToEmuLenient(opt.size || DEF_CHART_GRIDLINE.size || 1),\n\t\t\tcap: createLineCap(opt.cap || DEF_CHART_GRIDLINE.cap),\n\t\t},\n\t\t[\n\t\t\traw(el('a:solidFill', null, raw(createColorElement(opt.color || DEF_GRIDLINE_COLOR)))),\n\t\t\traw(voidEl('a:prstDash', { val: opt.style || DEF_CHART_GRIDLINE.style }) + voidEl('a:round')),\n\t\t]\n\t)\n\n\treturn el('c:serLines', null, raw(el('c:spPr', null, raw(line))))\n}\n\n/**\n * Build the `<c:leaderLines>` element for pie/doughnut data labels.\n *\n * Schema position: inside `<c:dLbls>`, immediately after `<c:showLeaderLines>`\n * (CT_DLbls / Group_DLbls order: showLeaderLines → leaderLines).\n *\n * Returns `''` unless the caller both enabled leader lines (`showLeaderLines`)\n * and configured their appearance (`leaderLineColor` / `leaderLineSize`). When\n * appearance is unset we leave the element off so PowerPoint applies its\n * automatic leader-line color, matching prior behavior.\n *\n * @param opts - chart options (reads `showLeaderLines`, `leaderLineColor`, `leaderLineSize`)\n */\nexport function createLeaderLinesElement(opts: ChartOptsInternal): string {\n\tif (!opts.showLeaderLines) return ''\n\tif (!opts.leaderLineColor && opts.leaderLineSize == null) return ''\n\tconst w = ptsToEmuLenient(opts.leaderLineSize ?? 0.75)\n\tconst color = opts.leaderLineColor || '808080'\n\tconst line = el('a:ln', { w, cap: 'flat' }, [\n\t\traw(genXmlColorSelection(color)),\n\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\traw(voidEl('a:round')),\n\t])\n\treturn el('c:leaderLines', null, raw(el('c:spPr', null, [raw(line), raw(voidEl('a:effectLst'))])))\n}\n\n/**\n * Build a single custom `<c:dLbl>` (rich-text data label) overriding one data point's label.\n *\n * Used when a series supplies explicit per-point label text: the emitted `<c:idx>` pins the\n * override to that point, and the `<c:rich>` run carries the label's own font styling (size,\n * bold, italic, color, face) resolved from the chart-level dataLabel* options. All the\n * `show*` flags are forced off so only the literal `text` renders (no value/category/percent).\n * @param idx - zero-based data-point index this label overrides\n * @param text - the literal label text (XML-escaped here)\n * @param opts - chart options supplying dataLabel font/color defaults and `lang`\n * @return {string} a `<c:dLbl>` element\n */\nexport function makeCustomDLblXml(idx: number, text: string, opts: ChartOptsInternal): string {\n\tconst sz = ptToHundredths(opts.dataLabelFontSize || DEF_FONT_SIZE)\n\tconst bold = opts.dataLabelFontBold ? 1 : 0\n\tconst italic = opts.dataLabelFontItalic ? 1 : 0\n\tconst color = createColorElement(opts.dataLabelColor || DEF_FONT_COLOR)\n\tconst face = opts.dataLabelFontFace || 'Arial'\n\tconst lang = opts.lang || 'en-US'\n\tconst runChildren = [raw(el('a:solidFill', null, raw(color))), raw(createChartTextFonts(face))]\n\tconst fontAttrs = { sz, b: bold, i: italic, u: 'none', strike: 'noStrike' }\n\tconst paragraph = el('a:p', null, [\n\t\traw(el('a:pPr', null, raw(el('a:defRPr', fontAttrs, runChildren)))),\n\t\traw(el('a:r', null, [raw(el('a:rPr', { lang, ...fontAttrs, dirty: 0 }, runChildren)), raw(el('a:t', null, text))])),\n\t])\n\tconst rich = el('c:rich', null, [raw(voidEl('a:bodyPr')), raw(voidEl('a:lstStyle')), raw(paragraph)])\n\treturn el('c:dLbl', null, [\n\t\traw(voidEl('c:idx', { val: idx })),\n\t\traw(el('c:tx', null, raw(rich))),\n\t\traw(voidEl('c:showLegendKey', { val: 0 })),\n\t\traw(voidEl('c:showVal', { val: 0 })),\n\t\traw(voidEl('c:showCatName', { val: 0 })),\n\t\traw(voidEl('c:showSerName', { val: 0 })),\n\t\traw(voidEl('c:showPercent', { val: 0 })),\n\t\traw(voidEl('c:showBubbleSize', { val: 0 })),\n\t])\n}\n\n/**\n * Build an `<a:ln>` border element from a per-data-point `BorderProps`.\n * @param border - point border style (`type`, `color`, `pt`)\n */\nexport function createChartBorderLine(border: BorderProps): string {\n\tif (border.type === 'none') return el('a:ln', null, raw(voidEl('a:noFill')))\n\treturn el('a:ln', { w: ptsToEmuLenient(resolveBorderWidth(border, 1)), cap: 'flat' }, [\n\t\traw(genXmlColorSelection({ color: border.color || '666666', transparency: border.transparency })),\n\t\traw(voidEl('a:prstDash', { val: border.type === 'dash' ? 'dash' : 'solid' })),\n\t\traw(voidEl('a:round')),\n\t])\n}\n\n/**\n * Build `<c:dPt>` entries for a series in the bar/line/area/scatter loops.\n *\n * Merges two sources into a single `c:dPt` per index so we never emit a\n * duplicate `<c:idx>` (which corrupts the chart):\n * - legacy single-series color-vary fills (bar/scatter), supplied via `varyColors`\n * - per-point `pointStyles` border/fill overrides\n *\n * Must be emitted in schema position *before* `c:dLbls` (CT_*Ser order).\n * RADAR is skipped: extra per-point markup historically corrupts the chart.\n *\n * @param chartType - series chart type\n * @param obj - series data (reads `values`, `pointStyles`)\n * @param opts - chart options (fill/shadow/lineSize context)\n * @param varyColors - color array when single-series color-vary applies, else `null`\n */\nexport function makeSeriesDataPointsXml(\n\tchartType: ChartType,\n\tobj: OptsChartDataInternal,\n\topts: ChartOptsInternal,\n\tvaryColors: string[] | null\n): string {\n\tif (chartType === ChartType.radar) return ''\n\tconst pointStyles = obj.pointStyles\n\tif (!varyColors && !pointStyles?.length) return ''\n\n\tconst isBar = chartType === ChartType.bar || chartType === ChartType.bar3d\n\tconst isScatter = chartType === ChartType.scatter\n\tlet xml = ''\n\tdataValues(obj).forEach((value, index) => {\n\t\tconst ptStyle = pointStyles?.[index]\n\t\tconst arrColors = varyColors\n\t\t\t? value < 0\n\t\t\t\t? opts.invertedColors || opts.chartColors || BARCHART_COLORS\n\t\t\t\t: varyColors\n\t\t\t: null\n\t\tconst fillColor = ptStyle?.fill || (arrColors ? arrColors[index % arrColors.length] : null)\n\t\tconst pattern = ptStyle?.pattern\n\t\tconst border = ptStyle?.border\n\t\t// Nothing to style for this point -> omit the c:dPt entirely\n\t\tif (!fillColor && !pattern && !border) return\n\n\t\tlet shape = ''\n\t\tif ((isBar || isScatter) && opts.lineSize === 0 && !border && !ptStyle?.fill && !pattern) {\n\t\t\t// Preserve legacy color-vary behavior: hide outline when lineSize===0\n\t\t\tshape = el('a:ln', null, raw(voidEl('a:noFill')))\n\t\t} else {\n\t\t\t// Pattern fill takes precedence over a solid fill (OOXML allows only one fill per c:dPt).\n\t\t\t// Default the pattern foreground to this point's resolved color so it reads as a hatched bar.\n\t\t\tif (pattern) {\n\t\t\t\tshape = genXmlPatternFill(fillColor && !pattern.fgColor ? { ...pattern, fgColor: fillColor } : pattern)\n\t\t\t} else if (fillColor) {\n\t\t\t\t// BAR3D color-vary historically tints the edge line, not the face fill\n\t\t\t\tshape =\n\t\t\t\t\tchartType === ChartType.bar3d\n\t\t\t\t\t\t? el('a:ln', null, raw(genXmlColorSelection(fillColor)))\n\t\t\t\t\t\t: genXmlColorSelection(fillColor)\n\t\t\t}\n\t\t\tif (border) shape += createChartBorderLine(border)\n\t\t}\n\t\txml += el('c:dPt', null, [\n\t\t\traw(voidEl('c:idx', { val: index })),\n\t\t\tisBar ? raw(voidEl('c:invertIfNegative', { val: 0 })) : null,\n\t\t\traw(voidEl('c:bubble3D', { val: 0 })),\n\t\t\traw(el('c:spPr', null, [raw(shape), raw(createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW))])),\n\t\t])\n\t})\n\treturn xml\n}\n\n/**\n * The whitespace spelling a {@link strRefBlock} is emitted with.\n *\n * The five hand-written copies this replaces produced the same elements three different ways —\n * `plot-scatter`, `plot-bubble` and `plot-cat-axis` agreed on one indentation, `plot-surface` ran\n * everything together with none, and `plot-pie` broke the cache across four lines. All three are\n * inert to PowerPoint, and all three are *emitted* bytes, so this extraction has to preserve which\n * one each call site produced. That is what this parameter is for, and it is exactly what a\n * whitespace normalization would erase — which is why that is its own deliberate, re-baselined\n * piece of work and this is not.\n */\nexport type StrRefLayout = 'indented' | 'compact' | 'expanded'\n\n/**\n * A `<c:tx>` series-name block: the `<c:f>` formula plus the one-point `<c:strCache>` mirroring\n * the header cell it points at. The string counterpart of {@link numRefBlock}.\n *\n * Built through `el()`/`voidEl()` rather than by concatenation, with the indentation carried on\n * the `openPrefix`/`childPrefix`/`closePrefix` byte-layout hooks those helpers already have. The\n * five copies this replaces were all hand-built strings, so routing them here takes fifty-odd\n * hand-written delimiters out of `src/gen/chart/` rather than moving them into one file.\n * @param ref - the `<c:f>` formula, from {@link sheetCellRef} or written inline\n * @param name - the series name to cache; escaped on the way into `<c:v>`\n * @param layout - which of the three historical whitespace spellings to emit; see {@link StrRefLayout}\n */\nexport function strRefBlock(ref: string, name: string, layout: StrRefLayout = 'indented'): string {\n\tconst compact = layout === 'compact'\n\tconst pt = el('c:pt', { idx: 0 }, raw(el('c:v', null, name)))\n\tconst cacheChildren = [raw(voidEl('c:ptCount', { val: 1 })), raw(pt)]\n\tconst strCache =\n\t\tlayout === 'expanded'\n\t\t\t? el('c:strCache', null, cacheChildren, { childPrefix: ' ', closePrefix: ' ' })\n\t\t\t: el('c:strCache', null, cacheChildren)\n\tconst indent = (spaces: string): string => (compact ? '' : spaces)\n\tconst strRef = el('c:strRef', null, [raw(el('c:f', null, ref)), raw(strCache)], {\n\t\topenPrefix: indent(' '),\n\t\tchildPrefix: indent(' '),\n\t\tclosePrefix: indent(' '),\n\t})\n\treturn el('c:tx', null, raw(strRef), { openPrefix: indent(' '), closePrefix: indent(' ') })\n}\n\n/**\n * A `<c:cat>` category reference: the `<c:f>` formula plus the `<c:numCache>`/`<c:strCache>` that\n * mirrors the label cells it points at.\n *\n * `kind` picks the cache: `'num'` for numeric categories — dates, which need a `<c:formatCode>` so\n * PowerPoint renders them as dates rather than serial numbers — and `'str'` for text ones. Stock\n * and cat-axis each carried both arms of that choice, and surface carried the string one, five\n * copies of the same `<c:f>` + `<c:ptCount>` + `<c:pt idx>` loop.\n *\n * `layout` preserves which whitespace spelling each site emitted, for the reason\n * {@link StrRefLayout} gives. The `<c:multiLvlStrRef>` arm of a cat-axis is deliberately not\n * folded in: multi-level categories nest a `<c:lvl>` per label group, which is a different shape\n * rather than a different spelling.\n * @param kind - `num` for a numeric (date) category cache, `str` for a text one\n * @param ref - the `<c:f>` formula\n * @param labels - the category labels, in order; escaped on the way into `<c:v>`\n * @param formatCode - the cached `<c:formatCode>`; numeric caches only\n * @param layout - which whitespace spelling to emit\n */\nexport function catRefBlock(\n\tkind: 'num' | 'str',\n\tref: string,\n\tlabels: string[],\n\tformatCode?: string,\n\tlayout: 'compact' | 'indented' = 'compact'\n): string {\n\tconst indent = (spaces: string): string => (layout === 'indented' ? spaces : '')\n\t// `<c:ptCount>` and the points it counts are ONE child: the indented sites put whitespace\n\t// before the count and none before each point, so splitting them would indent every point.\n\tconst points = labels.map((label, idx) => el('c:pt', { idx }, raw(el('c:v', null, label)))).join('')\n\tconst cache = el(\n\t\t`c:${kind}Cache`,\n\t\tnull,\n\t\t[\n\t\t\tformatCode === undefined ? null : raw(el('c:formatCode', null, formatCode)),\n\t\t\traw(voidEl('c:ptCount', { val: labels.length }) + points),\n\t\t],\n\t\t{ childPrefix: indent(' '), closePrefix: indent(' ') }\n\t)\n\treturn el(`c:${kind}Ref`, null, [raw(el('c:f', null, ref)), raw(cache)], {\n\t\topenPrefix: indent(' '),\n\t\tchildPrefix: indent(' '),\n\t\tclosePrefix: indent(' '),\n\t})\n}\n\n/**\n * A `<c:xVal>`/`<c:yVal>` numeric-reference block: the `<c:f>` formula plus the `<c:numCache>`\n * that mirrors the cells it points at.\n *\n * Scatter and bubble each carried their own copy of this twice over, four near-identical\n * twelve-line blocks. `values` is the exact point list to cache, so the caller decides what a\n * gap is: the Y series is emitted against the X series' length (a caller may supply fewer Y\n * values than X — a timeline with only the first few months filled in), and the shorter array's\n * tail arrives here as `undefined`, which {@link numCachePt} skips.\n *\n * @param tag - the wrapping element, `c:xVal` or `c:yVal`\n * @param ref - the `<c:f>` formula, from {@link sheetRangeRef} or written inline\n * @param formatCode - the cached `<c:formatCode>`\n * @param values - the points to cache, in order; `null`/`undefined` entries are gaps\n * @param refIndent - leading whitespace before `<c:f>`. Bubble's `c:yVal` has none where every\n * other block has four spaces. That is inert inter-element whitespace, but it is *emitted*\n * whitespace, and this extraction is behaviour-preserving — normalizing it would be a byte\n * change wearing a cleanup's clothes, which the byte-identity gate exists to refuse.\n */\nexport function numRefBlock(\n\ttag: 'c:xVal' | 'c:yVal',\n\tref: string,\n\tformatCode: string,\n\tvalues: Array<number | null | undefined>,\n\trefIndent = ' '\n): string {\n\tconst numCache = el(\n\t\t'c:numCache',\n\t\tnull,\n\t\t[\n\t\t\traw(el('c:formatCode', null, formatCode, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:ptCount', { val: values.length }, { openPrefix: ' ' })),\n\t\t\traw(values.map((value, idx) => numCachePt(idx, value)).join('')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst numRef = el('c:numRef', null, [raw(el('c:f', null, ref, { openPrefix: refIndent })), raw(numCache)], {\n\t\topenPrefix: ' ',\n\t\tclosePrefix: ' ',\n\t})\n\treturn el(tag, null, raw(numRef))\n}\n","/**\n * ts-pptx: Chart Definition\n *\n * `addChartDefinition` normalizes `addChart()` options onto the slide model and registers the\n * chart part rel; the `normalize*` / `clamp*` helpers apply the schema-valid defaults and range\n * clamps. The chart *XML* is emitted later by `gen/chart/chart-xml.ts`.\n */\nimport {\n\tasChartType,\n\ttype CHART_NAME,\n\tChartType,\n\tisChartExType,\n\tisChartType,\n\tSchemeColor,\n\tSlideObjectType,\n} from '../../enums.js'\nimport { DEF_CHART_BORDER } from '../../constants-internal.js'\nimport { defaultChartPalette } from '../chart/chart-parts.js'\nimport { warn } from '../../diagnostics.js'\nimport { InvalidOptionError } from '../../errors.js'\nimport type { ChartMulti, ChartOpts, OptsChartData, OptsChartGridLine } from '../../types/index.js'\nimport type { ChartOptsInternal, OptsChartDataInternal, PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, validateObjectName } from '../utils.js'\nimport { correctShadowOptions } from '../drawingml/effect.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\n\n/**\n * Copy one series into the internal shape the emitters read, without touching the caller's object.\n *\n * `labels` is widened to the nested `string[][]` form the multi-level category serializer wants and\n * `_dataIndex` records the series' position. Both used to be assigned back onto the caller's own\n * series object, so `data[0].labels` became `[['A','B','C']]` after `addChart` and any code that\n * reused the same array afterwards (a legend, a table, a second chart) silently saw one nested array\n * instead of three strings.\n *\n * The copy is one level deep on purpose: everything under `src/gen/chart/` is a pure string builder\n * that only reads `values`/`sizes`/`customLabels`/`pointStyles`/`errorBars`, so sharing those arrays\n * with the caller is safe.\n * @param item - caller-supplied series\n * @param index - series position, across all subcharts for a combo chart\n */\nfunction normalizeChartSeries(item: OptsChartData, index: number): OptsChartDataInternal {\n\tconst labels = item.labels\n\treturn {\n\t\t...item,\n\t\t_dataIndex: index,\n\t\tlabels: labels === undefined ? undefined : Array.isArray(labels[0]) ? (labels as string[][]) : [labels as string[]],\n\t}\n}\n\n/**\n * Copy a caller-supplied `ChartOpts` so the normalization below never writes back onto it.\n *\n * `addChartDefinition` fills in defaults, clamps out-of-range values and deletes invalid keys\n * (`layout.x`, `catGridLine.size`, `dataLabelPosition`, …). Doing that in place mutated the\n * caller's object, which is both surprising on its own and order-dependent when one options\n * object is shared across two charts.\n *\n * Nested objects are copied wherever a normalizer writes into them. `structuredClone` is\n * deliberately not used: it would deep-copy the `ChartMulti[]` on `_type` — breaking the series\n * identity the combo emit path depends on — and throws on a stray function in an untyped\n * caller's option bag.\n * @param opts - caller-supplied chart options\n */\nfunction copyChartOptions(opts: ChartOpts | ChartOptsInternal): ChartOptsInternal {\n\tconst copy: ChartOptsInternal = { ...opts }\n\t// `_type` is derived from the `type` argument below; never inherit a caller-stamped one.\n\tdelete copy._type\n\tif (copy.plotArea) {\n\t\tcopy.plotArea = { ...copy.plotArea }\n\t\tif (copy.plotArea.border) copy.plotArea.border = { ...copy.plotArea.border }\n\t\tif (copy.plotArea.fill) copy.plotArea.fill = { ...copy.plotArea.fill }\n\t}\n\tif (copy.chartArea) copy.chartArea = { ...copy.chartArea }\n\tif (copy.dataBorder) copy.dataBorder = { ...copy.dataBorder }\n\tif (copy.layout) copy.layout = { ...copy.layout }\n\tif (copy.catGridLine) copy.catGridLine = { ...copy.catGridLine }\n\tif (copy.valGridLine) copy.valGridLine = { ...copy.valGridLine }\n\tif (copy.serGridLine) copy.serGridLine = { ...copy.serGridLine }\n\t// `correctShadowOptions` normalizes its argument in place (angle rounding, `_alpha`).\n\tif (copy.shadow) copy.shadow = { ...copy.shadow }\n\treturn copy\n}\n\n/**\n * Round and clamp an integer chart percentage/angle option into a schema-valid range.\n *\n * Several chart attributes are bounded integer types whose out-of-range values make\n * PowerPoint report the package as needing repair: `<c:overlap>` (ST_Overlap, -100..100),\n * `<c:gapWidth>`/`<c:gapDepth>` (ST_GapAmount, 0..500), `<c:holeSize>` (ST_HoleSize, 10..90)\n * and `<c:firstSliceAng>` (ST_FirstSliceAng, 0..360). Missing/non-numeric input returns\n * `undefined` so the caller can apply its own default; an out-of-range value is clamped\n * and a warning is emitted (per the library's warn-rather-than-degrade policy).\n * @param value - caller-supplied option value\n * @param min - inclusive lower bound\n * @param max - inclusive upper bound\n * @param name - option name, for the warning message\n */\nfunction clampChartPct(value: number | undefined, min: number, max: number, name: string): number | undefined {\n\tif (typeof value !== 'number' || isNaN(value)) return undefined\n\tconst clamped = Math.min(max, Math.max(min, Math.round(value)))\n\tif (clamped !== value)\n\t\twarn('chart/option-out-of-range', `${name} ${value} is outside the valid range ${min}-${max}; using ${clamped}.`)\n\treturn clamped\n}\n\n/**\n * Drop `dataLabelPosition` values that are invalid for the chart type / bar grouping,\n * per the OOXML data-label placement rules, so PowerPoint does not flag the file.\n *\n * `chartType` is passed in rather than read off `options._type` so the combo path can run the\n * same rules per subchart: a combo chart's `_type` is a `ChartMulti[]`, which matches none of\n * the comparisons below (see {@link normalizeComboSubchartOptions}).\n * @param options - options bag to correct in place\n * @param chartType - the plot type these options are emitted for, if known\n */\nfunction normalizeChartDataLabelPosition(options: ChartOptsInternal, chartType: ChartType | undefined): void {\n\tif (options.dataLabelPosition) {\n\t\tconst dataLabelPosition = options.dataLabelPosition\n\t\tif (\n\t\t\tchartType === ChartType.area ||\n\t\t\tchartType === ChartType.bar3d ||\n\t\t\tchartType === ChartType.doughnut ||\n\t\t\tchartType === ChartType.radar\n\t\t) {\n\t\t\tdelete options.dataLabelPosition\n\t\t}\n\t\tif (chartType === ChartType.pie) {\n\t\t\tif (!['bestFit', 'ctr', 'inEnd', 'outEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t}\n\t\tif (\n\t\t\tchartType === ChartType.bubble ||\n\t\t\tchartType === ChartType.bubble3d ||\n\t\t\tchartType === ChartType.line ||\n\t\t\tchartType === ChartType.scatter\n\t\t) {\n\t\t\tif (!['b', 'ctr', 'l', 'r', 't'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t}\n\t\tif (chartType === ChartType.bar) {\n\t\t\tif (!['stacked', 'percentStacked'].includes(options.barGrouping || '')) {\n\t\t\t\tif (!['ctr', 'inBase', 'inEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t\t}\n\t\t\tif (!['clustered'].includes(options.barGrouping || '')) {\n\t\t\t\tif (!['ctr', 'inBase', 'inEnd', 'outEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Correct `barGrouping` to a value `<c:grouping>` (ST_Grouping) accepts for the given chart type.\n *\n * Split out of `addChartDefinition` for the same reason as\n * {@link normalizeChartDataLabelPosition}: the combo path needs it per subchart, keyed to that\n * subchart's own type.\n * @param options - options bag to correct in place\n * @param chartType - the plot type these options are emitted for, if known\n */\nfunction normalizeChartBarGrouping(options: ChartOptsInternal, chartType: ChartType | undefined): void {\n\t// barGrouping: \"21.2.3.17 ST_Grouping (Grouping)\"\n\tif (chartType === ChartType.area) {\n\t\tif (!['stacked', 'standard', 'percentStacked'].includes(options.barGrouping || '')) options.barGrouping = 'standard'\n\t}\n\tif (chartType === ChartType.bar) {\n\t\tif (!['clustered', 'stacked', 'percentStacked'].includes(options.barGrouping || ''))\n\t\t\toptions.barGrouping = 'clustered'\n\t}\n\tif (chartType === ChartType.bar3d) {\n\t\tif (!['clustered', 'stacked', 'standard', 'percentStacked'].includes(options.barGrouping || ''))\n\t\t\toptions.barGrouping = 'standard'\n\t}\n}\n\n/**\n * Apply plotArea option defaults: show* toggles, axis-line visibility, and the 3D view angles.\n */\nfunction normalizeChartPlotAreaOptions(options: ChartOptsInternal): void {\n\t// The eleven `show*` toggles are deliberately NOT defaulted here. Each one used to carry\n\t// a statement of the form `x = x || !x ? x : <default>`, but `a || !a` is true for every\n\t// value of `a`, so the alternative never ran and the whole statement was an identity\n\t// assignment. Every consumer reads these as plain truthiness (`opts.showPercent ? 1 : 0`,\n\t// `!opts.showDataTableKeys ? 0 : 1`), which makes an absent option behave as `false` — and\n\t// that is what the public types document (`@default false` on `showDataTable`,\n\t// `showPercent`, `v3DRAngAx`). Removing the dead statements changes no emitted byte;\n\t// *applying* the defaults those ternaries appear to promise would, so do not \"restore\"\n\t// them without treating it as the behavior change it is.\n\toptions.catAxisLineShow = typeof options.catAxisLineShow !== 'undefined' ? options.catAxisLineShow : true\n\toptions.valAxisLineShow = typeof options.valAxisLineShow !== 'undefined' ? options.valAxisLineShow : true\n\toptions.serAxisLineShow = typeof options.serAxisLineShow !== 'undefined' ? options.serAxisLineShow : true\n\n\toptions.v3DRotX =\n\t\ttypeof options.v3DRotX === 'number' && !isNaN(options.v3DRotX) && options.v3DRotX >= -90 && options.v3DRotX <= 90\n\t\t\t? options.v3DRotX\n\t\t\t: 30\n\toptions.v3DRotY =\n\t\ttypeof options.v3DRotY === 'number' && !isNaN(options.v3DRotY) && options.v3DRotY >= 0 && options.v3DRotY <= 360\n\t\t\t? options.v3DRotY\n\t\t\t: 30\n\t// v3DRAngAx: same dead-ternary shape as the show* block above, same reason for its absence.\n\toptions.v3DPerspective =\n\t\ttypeof options.v3DPerspective === 'number' &&\n\t\t!isNaN(options.v3DPerspective) &&\n\t\toptions.v3DPerspective >= 0 &&\n\t\toptions.v3DPerspective <= 240\n\t\t\t? options.v3DPerspective\n\t\t\t: 30\n}\n\n/**\n * Apply chart-level option defaults: gap/overlap/hole clamps, chart colors, plotArea/chartArea\n * borders and fills, data border, data-label format codes, line size and multi-level cat labels.\n */\nfunction normalizeChartOptions(options: ChartOptsInternal): void {\n\toptions.barGapWidthPct = clampChartPct(options.barGapWidthPct, 0, 500, 'barGapWidthPct') ?? 150\n\toptions.barGapDepthPct = clampChartPct(options.barGapDepthPct, 0, 500, 'barGapDepthPct') ?? 150\n\toptions.barOverlapPct = clampChartPct(options.barOverlapPct, -100, 100, 'barOverlapPct')\n\t// `<c:holeSize>` is ST_HoleSize (10..90); `<c:firstSliceAng>` is ST_FirstSliceAng (0..360).\n\toptions.holeSize = clampChartPct(options.holeSize, 10, 90, 'holeSize')\n\toptions.firstSliceAng = clampChartPct(options.firstSliceAng, 0, 360, 'firstSliceAng')\n\n\t// An empty array is not a palette, so it means what saying nothing means: the built-in\n\t// default for this chart type. It used to survive this pass (`Array.isArray([])` is true)\n\t// and meet the plot builders' fallback instead, which was the *bar* palette on every type —\n\t// so `{ chartColors: [] }` on a pie was neither the caller's colours nor the pie default.\n\toptions.chartColors = options.chartColors?.length ? options.chartColors : defaultChartPalette(options._type)\n\toptions.chartColorsOpacity =\n\t\toptions.chartColorsOpacity && !isNaN(options.chartColorsOpacity) ? options.chartColorsOpacity : undefined\n\toptions.plotArea = options.plotArea || {}\n\toptions.plotArea.border =\n\t\toptions.plotArea.border && typeof options.plotArea.border === 'object' ? options.plotArea.border : undefined\n\tif (options.plotArea.border && (!options.plotArea.border.width || isNaN(options.plotArea.border.width)))\n\t\toptions.plotArea.border.width = DEF_CHART_BORDER.width\n\tif (\n\t\toptions.plotArea.border &&\n\t\t(!options.plotArea.border.color || typeof options.plotArea.border.color !== 'string')\n\t) {\n\t\toptions.plotArea.border.color = DEF_CHART_BORDER.color\n\t}\n\toptions.plotArea.fill = options.plotArea.fill || {}\n\toptions.chartArea = options.chartArea || {}\n\toptions.chartArea.border =\n\t\toptions.chartArea.border && typeof options.chartArea.border === 'object' ? options.chartArea.border : undefined\n\tif (options.chartArea.border) {\n\t\toptions.chartArea.border = {\n\t\t\tcolor: options.chartArea.border.color || DEF_CHART_BORDER.color,\n\t\t\twidth: options.chartArea.border.width || DEF_CHART_BORDER.width,\n\t\t\ttransparency: options.chartArea.border.transparency,\n\t\t}\n\t}\n\toptions.chartArea.roundedCorners =\n\t\ttypeof options.chartArea.roundedCorners === 'boolean' ? options.chartArea.roundedCorners : true\n\t//\n\toptions.dataBorder = options.dataBorder && typeof options.dataBorder === 'object' ? options.dataBorder : undefined\n\tif (options.dataBorder && (!options.dataBorder.width || isNaN(options.dataBorder.width)))\n\t\toptions.dataBorder.width = 0.75\n\tif (options.dataBorder && options.dataBorder.color) {\n\t\tconst isHexColor =\n\t\t\ttypeof options.dataBorder.color === 'string' &&\n\t\t\toptions.dataBorder.color.length === 6 &&\n\t\t\t/^[0-9A-Fa-f]{6}$/.test(options.dataBorder.color)\n\t\tconst isSchemeColor = Object.values(SchemeColor).includes(options.dataBorder.color as SchemeColor)\n\t\tif (!isHexColor && !isSchemeColor) {\n\t\t\toptions.dataBorder.color = 'F9F9F9' // Fallback if neither hex nor scheme color\n\t\t}\n\t}\n\t//\n\tif (!options.dataLabelFormatCode && options._type === ChartType.scatter) options.dataLabelFormatCode = 'General'\n\tif (!options.dataLabelFormatCode && (options._type === ChartType.pie || options._type === ChartType.doughnut)) {\n\t\toptions.dataLabelFormatCode = options.showPercent ? '0%' : 'General'\n\t}\n\toptions.dataLabelFormatCode =\n\t\toptions.dataLabelFormatCode && typeof options.dataLabelFormatCode === 'string'\n\t\t\t? options.dataLabelFormatCode\n\t\t\t: '#,##0'\n\t//\n\t// Set default format for Scatter chart labels to custom string if not defined\n\tif (!options.dataLabelFormatScatter && options._type === ChartType.scatter) options.dataLabelFormatScatter = 'custom'\n\t//\n\toptions.lineSize = typeof options.lineSize === 'number' ? options.lineSize : 2\n\toptions.valAxisMajorUnit = typeof options.valAxisMajorUnit === 'number' ? options.valAxisMajorUnit : undefined\n\n\tif (\n\t\toptions._type === ChartType.area ||\n\t\toptions._type === ChartType.bar ||\n\t\toptions._type === ChartType.bar3d ||\n\t\toptions._type === ChartType.line\n\t) {\n\t\toptions.catAxisMultiLevelLabels = !!options.catAxisMultiLevelLabels\n\t} else {\n\t\tdelete options.catAxisMultiLevelLabels\n\t}\n\n\tif (options._type === ChartType.waterfall && options.subtotals !== undefined) {\n\t\t// <cx:subtotals> holds zero-based category indices; drop non-integer / negative entries\n\t\t// (they would make PowerPoint report the chartEx part as needing repair). Warn per the\n\t\t// library's warn-rather-than-degrade policy.\n\t\tconst clean = (Array.isArray(options.subtotals) ? options.subtotals : []).filter((idx) => {\n\t\t\tconst ok = typeof idx === 'number' && Number.isInteger(idx) && idx >= 0\n\t\t\tif (!ok)\n\t\t\t\twarn(\n\t\t\t\t\t'chart/invalid-subtotal-index',\n\t\t\t\t\t`chart waterfall subtotal index \"${String(idx)}\" is not a non-negative integer; entry skipped.`\n\t\t\t\t)\n\t\t\treturn ok\n\t\t})\n\t\toptions.subtotals = clean.length > 0 ? clean : undefined\n\t}\n}\n\n/**\n * Options a combo subchart may override that land in a bounded or enumerated OOXML attribute,\n * i.e. the ones {@link normalizeComboSubchartOptions} is allowed to write back.\n */\nconst SUBCHART_VALIDATED_KEYS = [\n\t'barDir',\n\t'barGrouping',\n\t'barGapWidthPct',\n\t'barGapDepthPct',\n\t'barOverlapPct',\n\t'bar3DShape',\n\t'holeSize',\n\t'firstSliceAng',\n\t'lineDataSymbol',\n\t'lineDataSymbolSize',\n\t'lineDataSymbolLineSize',\n\t'dataLabelPosition',\n] as const\n\n/**\n * Clamp and correct one combo subchart's option overrides.\n *\n * `addChartDefinition` normalizes the chart-level options once, but a combo chart's per-subchart\n * `ChartMulti.options` are merged over them only at emit time (`gen/chart/chart-xml.ts`) — after\n * every clamp and enum correction has already run. Anything set there therefore reached the part\n * verbatim: `barOverlapPct: 250` emitted `<c:overlap val=\"250\"/>` where ST_Overlap is -100..100,\n * `barGapWidthPct: 9999` blew past ST_GapAmount's 500, and `barGrouping: 'sideways'` failed the\n * ST_Grouping enumeration — three PowerPoint-repair prompts reachable only through the combo API.\n *\n * The gap runs the other way too: for a combo chart `options._type` is a `ChartMulti[]`, so the\n * *type-dependent* chart-level corrections (`barGrouping`, `dataLabelPosition`) match no branch\n * and never fire at all.\n *\n * Both are fixed by validating the value the emitter actually reads — `{...chartOptions,\n * ...subOptions}` — against this subchart's own type, then writing back only the keys a\n * correction changed so the subchart bag stays a sparse override of the chart-level options.\n * @param subOptions - caller-supplied `ChartMulti.options` (never written to)\n * @param chartOptions - the already-normalized chart-level options\n * @param subType - this subchart's own plot type\n * @param callerSetBarGapWidthPct - whether the caller supplied a chart-level `barGapWidthPct`\n */\nfunction normalizeComboSubchartOptions(\n\tsubOptions: ChartOpts | undefined,\n\tchartOptions: ChartOptsInternal,\n\tsubType: ChartType,\n\tcallerSetBarGapWidthPct: boolean\n): ChartOpts {\n\tconst sub: ChartOpts = subOptions && typeof subOptions === 'object' ? subOptions : {}\n\t// What the emitter reads for this subchart today, and the corrected copy to diff against it.\n\tconst merged: ChartOptsInternal = { ...chartOptions, ...sub }\n\tconst fixed: ChartOptsInternal = { ...merged }\n\n\t// Enumerations emitted verbatim: `<c:barDir>` (ST_BarDir), `<c:grouping>` (ST_Grouping),\n\t// `<c:shape>` (ST_Shape), `<c:symbol>` (ST_MarkerStyle).\n\tif (!['bar', 'col'].includes(fixed.barDir || '')) fixed.barDir = 'col'\n\tnormalizeChartBarGrouping(fixed, subType)\n\tif (!['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'].includes(fixed.bar3DShape || ''))\n\t\tfixed.bar3DShape = 'box'\n\tif (!['circle', 'dash', 'diamond', 'dot', 'none', 'square', 'triangle'].includes(fixed.lineDataSymbol || ''))\n\t\tfixed.lineDataSymbol = 'circle'\n\t// A stacked bar group takes the narrower default gap a chart-level stacked bar gets. The\n\t// merged bag already carries the clustered default, so only step in when neither the\n\t// chart-level nor the subchart caller asked for a specific width.\n\tif (fixed.barGrouping?.includes('tacked') && !callerSetBarGapWidthPct && sub.barGapWidthPct == null)\n\t\tfixed.barGapWidthPct = 50\n\t// Depends on the corrected grouping above, so it has to run after it.\n\tnormalizeChartDataLabelPosition(fixed, subType)\n\n\t// Bounded integers. A non-numeric override falls back to the chart-level value, which\n\t// `normalizeChartOptions` has already put in range.\n\tfixed.barGapWidthPct = clampChartPct(fixed.barGapWidthPct, 0, 500, 'barGapWidthPct') ?? chartOptions.barGapWidthPct\n\tfixed.barGapDepthPct = clampChartPct(fixed.barGapDepthPct, 0, 500, 'barGapDepthPct') ?? chartOptions.barGapDepthPct\n\tfixed.barOverlapPct = clampChartPct(fixed.barOverlapPct, -100, 100, 'barOverlapPct')\n\tfixed.holeSize = clampChartPct(fixed.holeSize, 10, 90, 'holeSize')\n\tfixed.firstSliceAng = clampChartPct(fixed.firstSliceAng, 0, 360, 'firstSliceAng')\n\t// `<c:size val>` is ST_MarkerSize: an integer 2..72 points.\n\tif (fixed.lineDataSymbolSize != null && !isNaN(fixed.lineDataSymbolSize)) {\n\t\tconst symbolSize = Math.min(72, Math.max(2, Math.round(fixed.lineDataSymbolSize)))\n\t\tif (symbolSize !== fixed.lineDataSymbolSize)\n\t\t\twarn(\n\t\t\t\t'chart/symbol-size-out-of-range',\n\t\t\t\t`lineDataSymbolSize ${fixed.lineDataSymbolSize} is outside the valid marker size range (integer 2-72); using ${symbolSize}.`\n\t\t\t)\n\t\tfixed.lineDataSymbolSize = symbolSize\n\t}\n\t// Points -> EMU, but only for a width this subchart supplied: the chart-level value has\n\t// already been through `ptsToEmuLenient` and converting it twice would emit a hairline.\n\tif (sub.lineDataSymbolLineSize != null && !isNaN(sub.lineDataSymbolLineSize))\n\t\tfixed.lineDataSymbolLineSize = ptsToEmuLenient(sub.lineDataSymbolLineSize)\n\n\tconst result: ChartOptsInternal = { ...sub }\n\tfor (const key of SUBCHART_VALIDATED_KEYS) {\n\t\tif (fixed[key] !== merged[key]) (result as Record<string, unknown>)[key] = fixed[key]\n\t}\n\treturn result\n}\n\n/**\n * Generate the chart based on input data.\n * OOXML Chart Spec: ISO/IEC 29500-1:2016(E)\n *\n * @param {CHART_NAME | ChartMulti[]} `type` should belong to: 'column', 'pie'\n * @param {[]} `data` a JSON object with follow the following format\n * @param {ChartOptsInternal} `opt` chart options\n * @param {PresSlideInternal} `target` slide object that the chart will be added to\n * @return {object} chart object\n * {\n * title: 'eSurvey chart',\n * data: [\n * {\n * name: 'Income',\n * labels: ['2005', '2006', '2007', '2008', '2009'],\n * values: [23.5, 26.2, 30.1, 29.5, 24.6]\n * },\n * {\n * name: 'Expense',\n * labels: ['2005', '2006', '2007', '2008', '2009'],\n * values: [18.1, 22.8, 23.9, 25.1, 25]\n * }\n * ]\n * }\n */\nexport function addChartDefinition(\n\ttarget: PresSlideInternal,\n\ttype: CHART_NAME | ChartMulti[],\n\tdata: OptsChartData[] | ChartOpts,\n\topt?: ChartOptsInternal\n): object {\n\tfunction correctGridLineOptions(glOpts: OptsChartGridLine): void {\n\t\tif (!glOpts || glOpts.style === 'none') return\n\t\tif (glOpts.size !== undefined && (isNaN(Number(glOpts.size)) || glOpts.size <= 0)) {\n\t\t\twarn('chart/invalid-grid-line-size', 'chart.gridLine.size must be greater than 0.')\n\t\t\tdelete glOpts.size // delete prop to used defaults\n\t\t}\n\t\tif (glOpts.style && !['solid', 'dash', 'dot'].includes(glOpts.style)) {\n\t\t\twarn('chart/invalid-grid-line-style', 'chart.gridLine.style options: `solid`, `dash`, `dot`.')\n\t\t\tdelete glOpts.style\n\t\t}\n\t\tif (glOpts.cap && !['flat', 'square', 'round'].includes(glOpts.cap)) {\n\t\t\twarn('chart/invalid-grid-line-cap', 'chart.gridLine.cap options: `flat`, `square`, `round`.')\n\t\t\tdelete glOpts.cap\n\t\t}\n\t}\n\n\t// Placeholder part identity, unique only within this target. The authoritative,\n\t// package-unique chart part filename is assigned at write time by a per-presentation\n\t// pass in `buildPackageParts` (`package/assemble.ts`, STEP 2). A module-global counter\n\t// here was never reset, so two identical decks built in one process emitted different\n\t// chart part filenames — same input, different bytes.\n\tconst chartId = target._relsChart.length + 1\n\tconst resultObject: SlideObject = {\n\t\t_type: SlideObjectType.chart,\n\t}\n\t// DESIGN: `type` can an object (ex: `ChartType.doughnut`) or an array of chart objects\n\t// EX: addChartDefinition([ { type:ChartType.bar, data:{name:'', labels:[], values[]} }, {<etc>} ])\n\t// Multi-Type Charts\n\tlet tmpOpt: ChartOpts | ChartOptsInternal | undefined\n\tlet tmpData: OptsChartDataInternal[] = []\n\tlet tmpTypes: ChartMulti[] | undefined\n\tif (Array.isArray(type)) {\n\t\t// For multi-type charts there needs to be data for each type, as well as a single data\n\t\t// source for non-series operations. The series are indexed across subcharts to keep the\n\t\t// data in order when segmented into types.\n\t\t//\n\t\t// The whole `ChartMulti[]` is rebuilt around the normalized copies, not just flattened\n\t\t// into `tmpData`: the combo emit path plots each subchart from `opts._type[i].data`\n\t\t// (see gen/chart/chart-xml.ts), so both views have to reference the same series objects.\n\t\tlet seriesIndex = 0\n\t\ttmpTypes = type.map((obj) => {\n\t\t\tconst seriesData = (Array.isArray(obj.data) ? obj.data : []).map((item) =>\n\t\t\t\tnormalizeChartSeries(item, seriesIndex++)\n\t\t\t)\n\t\t\ttmpData = tmpData.concat(seriesData)\n\t\t\treturn { ...obj, data: seriesData }\n\t\t})\n\t\ttmpOpt = !Array.isArray(data) && data && typeof data === 'object' ? data : opt\n\t} else {\n\t\ttmpData = (Array.isArray(data) ? data : []).map(normalizeChartSeries)\n\t\ttmpOpt = opt\n\t}\n\t// Everything below normalizes onto this copy; the caller's options object is a read-only input.\n\tconst options: ChartOptsInternal = copyChartOptions(tmpOpt && typeof tmpOpt === 'object' ? tmpOpt : {})\n\t// Captured before normalization fills in the default, so the combo pass below can tell an\n\t// explicit gap width from an inherited one.\n\tconst callerSetBarGapWidthPct = typeof options.barGapWidthPct === 'number' && !isNaN(options.barGapWidthPct)\n\n\t// STEP 1: Set default options/decode user options\n\t// A: Core\n\t// The `type` is checked against the catalog here, at the boundary, because neither emitter can:\n\t// `makeChartType` and `chartExLayoutId` each own half of `ChartType` and treat the other half as\n\t// not theirs, so an off-catalog string matches no arm anywhere and would otherwise reach the deck\n\t// as a chart frame with no plot inside it.\n\tfor (const name of tmpTypes ? tmpTypes.map((sub) => sub.type) : [type as CHART_NAME]) {\n\t\tif (!isChartType(name)) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'chart/unknown-type',\n\t\t\t\t`addChart: \"${String(name)}\" is not a chart type. Valid types are: ${Object.values(ChartType).join(', ')}.`,\n\t\t\t\t{ detail: { type: name } }\n\t\t\t)\n\t\t}\n\t}\n\toptions._type = tmpTypes ?? asChartType(type as CHART_NAME)\n\toptions.x = typeof options.x !== 'undefined' && options.x != null && !isNaN(Number(options.x)) ? options.x : 1\n\toptions.y = typeof options.y !== 'undefined' && options.y != null && !isNaN(Number(options.y)) ? options.y : 1\n\toptions.w = options.w || '50%'\n\toptions.h = options.h || '50%'\n\toptions.objectName = options.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(options.objectName, 'chart'))\n\t\t: `Chart ${target._slideObjects.filter((obj) => obj._type === SlideObjectType.chart).length}`\n\n\t// B: Options: misc\n\tif (!['bar', 'col'].includes(options.barDir || '')) options.barDir = 'col'\n\n\t// barGrouping must be handled before data label validation as it can affect valid label positioning\n\tconst chartLevelType = Array.isArray(options._type) ? undefined : options._type\n\tnormalizeChartBarGrouping(options, chartLevelType)\n\tif (options.barGrouping?.includes('tacked')) {\n\t\tif (!options.barGapWidthPct) options.barGapWidthPct = 50\n\t}\n\t// Clean up and validate data label positions\n\t// REFERENCE: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/e2b1697c-7adc-463d-9081-3daef72f656f?redirectedfrom=MSDN\n\tnormalizeChartDataLabelPosition(options, chartLevelType)\n\t// dataLabelBkgrdColors: same dead-ternary shape as the show* block in\n\t// normalizeChartPlotAreaOptions, same reason for its absence.\n\tif (!['b', 'l', 'r', 't', 'tr'].includes(options.legendPos || '')) options.legendPos = 'r'\n\n\t// 3D bar: ST_Shape\n\tif (!['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'].includes(options.bar3DShape || ''))\n\t\toptions.bar3DShape = 'box'\n\t// lineDataSymbol: http://www.datypic.com/sc/ooxml/a-val-32.html\n\t// Spec has [plus,star,x] however neither PPT2013 nor PPT-Online support them\n\tif (!['circle', 'dash', 'diamond', 'dot', 'none', 'square', 'triangle'].includes(options.lineDataSymbol || ''))\n\t\toptions.lineDataSymbol = 'circle'\n\tif (!['gap', 'span', 'zero'].includes(options.displayBlanksAs || '')) options.displayBlanksAs = 'gap'\n\tif (!['radar', 'markers', 'filled'].includes(options.radarStyle || '')) options.radarStyle = 'radar'\n\t// Marker size emits as `<c:size val>` (ST_MarkerSize): an integer in [2,72] points.\n\t// Out-of-range or non-integer values make PowerPoint report the file as needing\n\t// repair, so round and clamp into range and warn when the input is coerced.\n\t{\n\t\tconst rawSymbolSize = options.lineDataSymbolSize\n\t\tconst hasSymbolSize = rawSymbolSize != null && !isNaN(rawSymbolSize)\n\t\tconst symbolSize = Math.min(72, Math.max(2, Math.round(hasSymbolSize ? rawSymbolSize : 6)))\n\t\tif (hasSymbolSize && symbolSize !== rawSymbolSize) {\n\t\t\twarn(\n\t\t\t\t'chart/symbol-size-out-of-range',\n\t\t\t\t`lineDataSymbolSize ${rawSymbolSize} is outside the valid marker size range (integer 2-72); using ${symbolSize}.`\n\t\t\t)\n\t\t}\n\t\toptions.lineDataSymbolSize = symbolSize\n\t}\n\toptions.lineDataSymbolLineSize =\n\t\toptions.lineDataSymbolLineSize && !isNaN(options.lineDataSymbolLineSize)\n\t\t\t? ptsToEmuLenient(options.lineDataSymbolLineSize)\n\t\t\t: ptsToEmuLenient(0.75)\n\t// `layout` allows the override of PPT defaults to maximize space\n\tconst chartLayout = options.layout\n\tif (chartLayout) {\n\t\t;(['x', 'y', 'w', 'h'] as const).forEach((key) => {\n\t\t\tconst val = chartLayout[key]\n\t\t\tconst numVal = Number(val)\n\t\t\tif (isNaN(numVal) || numVal < 0 || numVal > 1) {\n\t\t\t\twarn('chart/layout-out-of-range', 'chart.layout.' + key + ' can only be 0-1')\n\t\t\t\tdelete chartLayout[key] // remove invalid value so that default will be used\n\t\t\t}\n\t\t})\n\t}\n\n\t// Set gridline defaults\n\toptions.catGridLine =\n\t\toptions.catGridLine || (options._type === ChartType.scatter ? { color: 'D9D9D9', size: 1 } : { style: 'none' })\n\toptions.valGridLine = options.valGridLine || (options._type === ChartType.scatter ? { color: 'D9D9D9', size: 1 } : {})\n\toptions.serGridLine =\n\t\toptions.serGridLine || (options._type === ChartType.scatter ? { color: 'D9D9D9', size: 1 } : { style: 'none' })\n\tcorrectGridLineOptions(options.catGridLine)\n\tcorrectGridLineOptions(options.valGridLine)\n\tcorrectGridLineOptions(options.serGridLine)\n\tcorrectShadowOptions(options.shadow)\n\n\t// C: Options: plotArea\n\tnormalizeChartPlotAreaOptions(options)\n\n\t// D: Options: chart\n\t// `<c:gapWidth>`/`<c:gapDepth>` are ST_GapAmount (integer 0..500); `<c:overlap>` is\n\t// ST_Overlap (integer -100..100). Out-of-range values trigger PowerPoint repair.\n\tnormalizeChartOptions(options)\n\n\t// E: Options: combo subcharts\n\t// A `ChartMulti` entry's options override the chart-level ones at emit time, so they have to\n\t// go through the same clamps and enum corrections — keyed to that subchart's own plot type.\n\tif (Array.isArray(options._type)) {\n\t\toptions._type.forEach((sub) => {\n\t\t\t// Safe to assign: these entries are the copies built above, not the caller's objects.\n\t\t\tsub.options = normalizeComboSubchartOptions(sub.options, options, asChartType(sub.type), callerSetBarGapWidthPct)\n\t\t})\n\t}\n\n\t// Stock charts require their series in a fixed order (see `stockStyle`); default to the\n\t// three-value High-Low-Close style and warn (rather than corrupt) when the number of data\n\t// series doesn't match the style, since PowerPoint expects an exact count per style.\n\tif (options._type === ChartType.stock) {\n\t\tconst STOCK_SERIES_COUNT: Record<string, number> = { hlc: 3, ohlc: 4, vhlc: 4, vohlc: 5 }\n\t\tif (!Object.keys(STOCK_SERIES_COUNT).includes(options.stockStyle || '')) options.stockStyle = 'hlc'\n\t\tconst expected = STOCK_SERIES_COUNT[options.stockStyle as string]\n\t\tif (tmpData.length !== expected) {\n\t\t\twarn(\n\t\t\t\t'chart/stock-series-count',\n\t\t\t\t`stock chart style \"${options.stockStyle}\" expects ${expected} data series (got ${tmpData.length}); the chart may not render as intended.`\n\t\t\t)\n\t\t}\n\t}\n\n\t// STEP 4: Set props\n\tresultObject._type = SlideObjectType.chart\n\tresultObject.options = options\n\tresultObject.chartRid = getNewRelId(target)\n\n\t// STEP 5: Add this chart to this Slide Rels (rId/rels count spans all slides! Count all images to get next rId)\n\t// chartEx charts (waterfall, …) live alongside classic charts in `ppt/charts/` but use the\n\t// `chartEx{N}.xml` name, the `chartex+xml` content type and the MS chartEx rel type. The\n\t// authoritative, package-unique filename is (re)assigned at write time in\n\t// `buildPackageParts` (`package/assemble.ts`); this placeholder mirrors the same\n\t// Ex-prefix rule so a single-chart deck is already correct.\n\tconst isChartEx = isChartExType(options._type)\n\tconst chartBase = isChartEx ? `chartEx${chartId}` : `chart${chartId}`\n\ttarget._relsChart.push({\n\t\trId: getNewRelId(target),\n\t\tdata: tmpData,\n\t\topts: options,\n\t\ttype: options._type,\n\t\tglobalId: chartId,\n\t\tisChartEx,\n\t\tfileName: `${chartBase}.xml`,\n\t\tTarget: `/ppt/charts/${chartBase}.xml`,\n\t})\n\n\ttarget._slideObjects.push(resultObject)\n\treturn resultObject\n}\n","/**\n * ts-pptx: Comment Definition\n *\n * Validates `addComment()` author / text / position and stashes a review comment on the slide\n * (`_comments`); the `<p:cm>` XML is emitted later by `gen/slide/comments.ts`.\n */\nimport { warn } from '../../diagnostics.js'\nimport type { CommentProps } from '../../types/index.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\n\n/**\n * Derive 1-2 letter initials from an author display name (e.g. \"Ada Lovelace\" -> \"AL\").\n * Falls back to the first character when the name is a single word.\n */\nfunction deriveAuthorInitials(author: string): string {\n\tconst words = author.trim().split(/\\s+/).filter(Boolean)\n\tconst first = words[0]\n\tif (!first) return '?'\n\tif (words.length === 1) return first.charAt(0).toUpperCase()\n\tconst last = words[words.length - 1] ?? first\n\treturn (first.charAt(0) + last.charAt(0)).toUpperCase()\n}\n\n/**\n * Adds a review comment to a slide (legacy ISO/IEC 29500 §13 comment).\n * @param {PresSlideInternal} target slide object the comment is attached to\n * @param {CommentProps} opts comment author/text/position options\n */\nexport function addCommentDefinition(target: PresSlideInternal, opts: CommentProps): void {\n\tconst author = typeof opts?.author === 'string' ? opts.author.trim() : ''\n\tconst text = typeof opts?.text === 'string' ? opts.text : ''\n\t// Don't silently coerce: a comment with no author or no body is meaningless, so warn + skip\n\t// rather than emit a degenerate <p:cm> (API policy: warn over silent coercion).\n\tif (!author) {\n\t\twarn('comment/missing-author', 'addComment() requires a non-empty `author`; comment ignored.')\n\t\treturn\n\t}\n\tif (!text) {\n\t\twarn('comment/missing-text', 'addComment() requires non-empty `text`; comment ignored.')\n\t\treturn\n\t}\n\n\tconst initials =\n\t\ttypeof opts.initials === 'string' && opts.initials.trim() ? opts.initials.trim() : deriveAuthorInitials(author)\n\tconst x = typeof opts.x === 'number' && Number.isFinite(opts.x) ? opts.x : 0.5\n\tconst y = typeof opts.y === 'number' && Number.isFinite(opts.y) ? opts.y : 0.5\n\tlet date: string | undefined\n\tif (opts.date instanceof Date) date = opts.date.toISOString()\n\telse if (typeof opts.date === 'string' && opts.date) date = opts.date\n\n\tif (!target._comments) target._comments = []\n\ttarget._comments.push({ author, initials, text, x, y, date })\n}\n","/**\n * ts-pptx: Slide-Object Name Indexing\n *\n * The per-slide default-name counter shared by every `add*Definition`. Kept in one place so a\n * grouped child and a later top-level object never collide on the same Selection Pane name\n * (see the note on {@link nextObjectNameIdx}).\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\n\n/**\n * Take the next slide-wide index for `type`'s default Selection Pane name (`Shape 0`, `Image 1`,\n * `Group 1`, …).\n *\n * Default names used to be derived by counting the matching objects already in\n * `target._slideObjects`. `buildGroupObject` splices group children back out of that array, so the\n * count never advanced past them and a later top-level object reused a grouped child's name. This\n * counter is immune to the splice: every object of a kind consumes an index when it is added,\n * whether it stays top-level or moves into a group — at any nesting depth, since `target` stays the\n * slide all the way down.\n *\n * Shapes and text boxes deliberately share the `text` bucket (both are `_type === text`), which is\n * what keeps `Shape 0` and `Text 0` from colliding on one slide. Callers take an index\n * unconditionally, including when the caller supplied an explicit `objectName`, so an object's\n * index is its ordinal among its kind rather than a count of the defaulted ones.\n * @param target - slide (or master) the object is being added to\n * @param type - the object's `_type`\n * @returns the index this object takes\n */\nexport function nextObjectNameIdx(target: PresSlideInternal, type: SlideObjectType): number {\n\tconst counts = (target._objectNameCounts ??= {})\n\tconst idx = counts[type] ?? 0\n\tcounts[type] = idx + 1\n\treturn idx\n}\n","/**\n * ts-pptx: Connector Definition\n *\n * `addConnectorDefinition` converts two endpoints to a flip-oriented bounding box, resolves the\n * connector preset + adjust guides, and optionally binds start / end shapes. Emitted later as\n * `<p:cxnSp>`.\n */\nimport { connectorPresetFor, SlideObjectType } from '../../enums.js'\nimport { DEF_SHAPE_LINE_COLOR } from '../../constants-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport type { ConnectorProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { EMU_PER_INCH, FIXED_PCT_PER_PERCENT } from '../../units.js'\nimport { encodeXmlAttrValue, validateObjectName } from '../utils.js'\nimport { getSmartParseNumber } from '../../units-internal.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/**\n * Adds a connector object to a slide definition.\n * A connector is a line between two points emitted as a PowerPoint connector (`<p:cxnSp>`).\n * Endpoints are converted to a bounding box (`x/y/w/h`) plus `flipH`/`flipV` so the box can be\n * oriented from any corner; the connector preset geometry is derived from `type`.\n * @param {PresSlideInternal} target - slide the connector is added to\n * @param {ConnectorProps} opts - connector options (endpoints + line styling)\n */\nexport function addConnectorDefinition(target: PresSlideInternal, opts: ConnectorProps): void {\n\tif (!opts || [opts.x1, opts.y1, opts.x2, opts.y2].some((v) => typeof v === 'undefined')) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'connector/missing-endpoints',\n\t\t\t'addConnector requires { x1, y1, x2, y2 }. Example: `slide.addConnector({ x1:1, y1:1, x2:4, y2:3 })`'\n\t\t)\n\t}\n\n\tconst type = opts.type || 'straight'\n\tif (type !== 'straight' && type !== 'elbow' && type !== 'curved') {\n\t\tthrow new InvalidOptionError(\n\t\t\t'connector/invalid-type',\n\t\t\t`Invalid connector type \"${String(type)}\". Use 'straight', 'elbow', or 'curved'.`\n\t\t)\n\t}\n\n\t// Resolve the preset variant + adjust guides. `bentConnector{3,4,5}` / `curvedConnector{3,4,5}`\n\t// each expose `bends` adjustable jogs as `<a:gd name=\"adjN\" fmla=\"val …\"/>` (1000ths-of-a-percent,\n\t// so 50% → 50000; values verified against PowerPoint-authored decks). `straightConnector1` has none.\n\tconst adjInput = opts.adj === undefined ? [] : Array.isArray(opts.adj) ? opts.adj : [opts.adj]\n\tconst bends = opts.bends ?? (adjInput.length || 1)\n\tlet connectorAdj: number[] = []\n\tif (type === 'straight') {\n\t\tif (opts.bends !== undefined || opts.adj !== undefined) {\n\t\t\twarn(\n\t\t\t\t'connector/bends-ignored-for-straight',\n\t\t\t\t'addConnector `bends`/`adj` are ignored for type \"straight\" (a straight connector has no bends).'\n\t\t\t)\n\t\t}\n\t} else {\n\t\tif (bends !== 1 && bends !== 2 && bends !== 3) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'connector/invalid-bends',\n\t\t\t\t`addConnector \\`bends\\` must be 1, 2, or 3 (got ${String(bends)}).`\n\t\t\t)\n\t\t}\n\t\tif (opts.adj !== undefined && adjInput.length !== bends) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'connector/adj-count-mismatch',\n\t\t\t\t`addConnector \\`adj\\` must supply ${bends} value(s) to match \\`bends\\`=${bends} (got ${adjInput.length}).`\n\t\t\t)\n\t\t}\n\t\t// Convert each percent to OOXML 1000ths-of-a-percent. Fail loud on non-finite input\n\t\t// (silent coercion would emit a degenerate guide PowerPoint repairs); warn but allow\n\t\t// out-of-range, which legitimately places a jog beyond the endpoint box.\n\t\tconnectorAdj = adjInput.map((pct, i) => {\n\t\t\tif (typeof pct !== 'number' || !Number.isFinite(pct)) {\n\t\t\t\tthrow new InvalidOptionError(\n\t\t\t\t\t'connector/adj-non-finite',\n\t\t\t\t\t`addConnector \\`adj\\` value #${i + 1} must be a finite number (percent 0–100); got ${String(pct)}.`\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (pct < 0 || pct > 100) {\n\t\t\t\twarn(\n\t\t\t\t\t'connector/adj-out-of-range',\n\t\t\t\t\t`addConnector \\`adj\\` value ${pct} is outside 0–100; the bend will sit beyond the endpoint box.`\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn Math.round(pct * FIXED_PCT_PER_PERCENT)\n\t\t})\n\t}\n\tconst preset = connectorPresetFor(type, bends)\n\n\t// Optional shape binding (<a:stCxn>/<a:endCxn>). The target id is resolved at serialize time\n\t// (it equals the shape's slide-object index + 2); here we just capture the name + site index.\n\t// The site index must be a non-negative integer — a bad idx makes PowerPoint repair the connector.\n\tconst resolveCxn = (\n\t\tshapeName: string | undefined,\n\t\tidx: number | undefined,\n\t\tend: 'startShape' | 'endShape'\n\t): { name: string; idx: number } | undefined => {\n\t\tif (shapeName === undefined) return undefined\n\t\tif (typeof shapeName !== 'string' || shapeName.trim().length === 0) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'connector/invalid-binding-name',\n\t\t\t\t`addConnector \\`${end}\\` must be a non-empty shape objectName.`\n\t\t\t)\n\t\t}\n\t\tconst site = idx ?? 0\n\t\tif (!Number.isInteger(site) || site < 0) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'connector/invalid-connection-site',\n\t\t\t\t`addConnector \\`${end}Idx\\` must be a non-negative integer (got ${String(site)}).`\n\t\t\t)\n\t\t}\n\t\t// Stored as the caller spelled it: `resolveObjectNameToId` escapes its own lookup key at\n\t\t// serialize time (see its docblock), so escaping here too would look up `Q&amp;A`.\n\t\treturn { name: shapeName, idx: site }\n\t}\n\tconst startCxn = resolveCxn(opts.startShape, opts.startShapeIdx, 'startShape')\n\tconst endCxn = resolveCxn(opts.endShape, opts.endShapeIdx, 'endShape')\n\tconst connectorNameIdx = nextObjectNameIdx(target, SlideObjectType.connector)\n\n\t// Resolve all four endpoints to inches up front (handles every `Coord` form: number,\n\t// '50%', '2in', etc.). The connector box uses the min corner as its origin and flips\n\t// horizontally/vertically when the end point is left of / above the start point.\n\tconst x1 = getSmartParseNumber(opts.x1, 'X', target._presLayout) / EMU_PER_INCH\n\tconst y1 = getSmartParseNumber(opts.y1, 'Y', target._presLayout) / EMU_PER_INCH\n\tconst x2 = getSmartParseNumber(opts.x2, 'X', target._presLayout) / EMU_PER_INCH\n\tconst y2 = getSmartParseNumber(opts.y2, 'Y', target._presLayout) / EMU_PER_INCH\n\n\tconst newObject: SlideObject = {\n\t\t_type: SlideObjectType.connector,\n\t\t// store the connector preset on `shape`; the serializer emits it as the prstGeom `prst`\n\t\tshape: preset,\n\t\toptions: {\n\t\t\tx: Math.min(x1, x2),\n\t\t\ty: Math.min(y1, y2),\n\t\t\tw: Math.abs(x2 - x1),\n\t\t\th: Math.abs(y2 - y1),\n\t\t\tflipH: x2 < x1,\n\t\t\tflipV: y2 < y1,\n\t\t\t_connectorAdj: connectorAdj.length ? connectorAdj : undefined,\n\t\t\t_startCxn: startCxn,\n\t\t\t_endCxn: endCxn,\n\t\t\tline: {\n\t\t\t\ttype: 'solid',\n\t\t\t\tcolor: opts.color || DEF_SHAPE_LINE_COLOR,\n\t\t\t\twidth: typeof opts.width === 'number' ? opts.width : 1,\n\t\t\t\tdashType: opts.dashType || 'solid',\n\t\t\t\tbeginArrowType: opts.beginArrowType,\n\t\t\t\tendArrowType: opts.endArrowType,\n\t\t\t},\n\t\t\taltText: opts.altText,\n\t\t\tobjectName: opts.objectName\n\t\t\t\t? encodeXmlAttrValue(validateObjectName(opts.objectName, 'connector'))\n\t\t\t\t: `Connector ${connectorNameIdx}`,\n\t\t},\n\t}\n\n\ttarget._slideObjects.push(newObject)\n}\n","/**\n * ts-pptx: the one place an image is registered as a slide media relationship.\n *\n * Three definers need the identical fifteen lines — an image *fill* on a shape or text box\n * (`registerImageFillMedia`), an `addImage()` raster (`addImageDefinition`), and the cached\n * preview raster a Zoom tile or OLE object is drawn from (`registerPreviewImage`). They had\n * three copies, and the drift had already started: only one of them still carried the comment\n * explaining the path-versus-data match below.\n */\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { mediaSlideKey } from '../utils.js'\nimport { imageContentType } from '../../media/content-type.js'\n\n/**\n * Push an image media rel onto `target`, reusing an identical source's package part.\n *\n * De-dup is per target and by source, not by bytes: file-path images are matched on `path`,\n * while base64 `data` images have no real path — they all share the `preencoded.<extn>`\n * placeholder — so they are matched on their payload instead, which is what stops the same\n * inline image being embedded once per use. A rel already marked `isDuplicate` is never\n * matched against, so every duplicate points at the one original rather than at a chain.\n *\n * This is a *slide-local* optimization. `package/assemble.ts` runs a second, deck-wide collapse\n * keyed on extension + bytes once every rel's data is loaded, which subsumes this one for reuse\n * across slides and for sources that only turn out identical after loading.\n * @param target - slide (or layout/master) the rel is registered on\n * @param source - the resolved image source: a `path`, a base64 `data` payload, or both\n * @param relId - the relationship id already allocated for this use\n */\nexport function registerImageMediaRel(\n\ttarget: PresSlideInternal,\n\tsource: { path?: string; data?: string; extn: string },\n\trelId: number\n): void {\n\tconst path = source.path || ''\n\tconst data = source.data || ''\n\tconst type = imageContentType(source.extn)\n\tconst dupe = target._relsMedia.find((item) => {\n\t\tif (item.isDuplicate || !item.Target || item.type !== type) return false\n\t\treturn path ? item.path === path : !!data && item.data === data\n\t})\n\ttarget._relsMedia.push({\n\t\tpath: path || 'preencoded.' + source.extn,\n\t\ttype,\n\t\textn: source.extn,\n\t\tdata,\n\t\trId: relId,\n\t\tisDuplicate: !!dupe?.Target,\n\t\t// `_relsMedia.length + 1` is read BEFORE this push, so the first rel on a slide lands on\n\t\t// `image-<key>-1`. Keep the read here rather than hoisting it.\n\t\tTarget: dupe?.Target\n\t\t\t? dupe.Target\n\t\t\t: `../media/image-${mediaSlideKey(target)}-${target._relsMedia.length + 1}.${source.extn}`,\n\t})\n}\n","/**\n * ts-pptx: Image Definition\n *\n * `addImageDefinition` resolves an `addImage()` source, allocates its drawing rel(s) (SVG needs\n * a second for the PNG fallback), registers the media bytes through `registerImageMediaRel` and\n * inherits any placeholder geometry. `registerImageFillMedia` does the same media-rel registration\n * for an image *fill* used by a shape or text box.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport { warn } from '../../diagnostics.js'\nimport type { Coord, ImageProps, ObjectOptions, ShapeFillProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, mediaSlideKey, validateObjectName } from '../utils.js'\nimport { correctShadowOptions } from '../drawingml/effect.js'\nimport { svgMarkupToDataUri } from '../../media/base64.js'\nimport { imageExtensionForSource } from '../../media/content-type.js'\nimport { getImageSizeFromBase64 } from '../../media/image-size.js'\nimport { getSmartParseNumber } from '../../units-internal.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { registerImageMediaRel } from './image-rel.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/** DPI PowerPoint assumes when sizing an inserted raster image (natural pixels / 96 == inches) */\nconst IMAGE_NATURAL_DPI = 96\n\n/**\n * Register a raster image fill as a slide media relationship and stash the resolved\n * rId on the fill object so serialization can emit `<a:blipFill r:embed=\"rIdN\">`.\n * Mirrors the non-SVG media-registration path used by `addImageDefinition()`,\n * including de-duplication of identical sources. SVG sources are not\n * supported as fills yet.\n * @param {PresSlideInternal} target - slide the owning object belongs to\n * @param {ShapeFillProps} fill - fill options carrying `image: { path | data }`\n */\nexport function registerImageFillMedia(target: PresSlideInternal, fill: ShapeFillProps): void {\n\tconst strImagePath = fill.image?.path || ''\n\tconst strImageData = fill.image?.data || ''\n\n\tif (!strImagePath && !strImageData) {\n\t\twarn('image-fill/missing-source', 'image fill requires `image.path` or `image.data`; ignoring image fill.')\n\t\tfill.type = 'none'\n\t\treturn\n\t}\n\tif (strImageData && !strImageData.toLowerCase().includes('base64,')) {\n\t\twarn(\n\t\t\t'image-fill/missing-base64-header',\n\t\t\t\"image fill `data` value lacks a base64 header (ex: 'image/png;base64,...'); ignoring image fill.\"\n\t\t)\n\t\tfill.type = 'none'\n\t\treturn\n\t}\n\n\tconst strImgExtn = imageExtensionForSource(strImagePath, strImageData)\n\n\tif (strImgExtn === 'svg') {\n\t\twarn(\n\t\t\t'image-fill/svg-unsupported',\n\t\t\t'SVG image fills are not supported; ignoring image fill. Use a raster format (PNG/JPEG/GIF/BMP/WebP).'\n\t\t)\n\t\tfill.type = 'none'\n\t\treturn\n\t}\n\n\tconst imageRelId = getNewRelId(target)\n\tregisterImageMediaRel(target, { path: strImagePath, data: strImageData, extn: strImgExtn }, imageRelId)\n\tfill.type = 'image'\n\tfill._imgRid = imageRelId\n}\n\n/**\n * Adds an image object to a slide definition.\n * This method can be called with only two args (opt, target) - this is supposed to be the only way in future.\n * @param {ImageProps} `opt` - object containing `path`/`data`, `x`, `y`, etc.\n * @param {PresSlideInternal} `target` - slide that the image should be added to (if not specified as the 2nd arg)\n * @note: Remote images (eg: \"http://whatev.com/blah\"/from web and/or remote server arent supported yet - we'd need to create an <img>, load it, then send to canvas\n * @see: https://stackoverflow.com/questions/164181/how-to-fetch-a-remote-image-to-display-in-a-canvas)\n */\n/**\n * Normalize an `addImage()` call into a slide image object and register its media relationships.\n *\n * Resolves the image source (path or base64 `data:`), allocates the drawing relationship id(s)\n * — SVG needs a second rId for its PNG rasterization fallback — appends the bytes to\n * `target._relsMedia` (deduping identical sources), and inherits any omitted x/y/w/h from a\n * matching layout picture placeholder. The resulting `SlideObject` is pushed onto the slide;\n * `gen/slide/objects/image.ts` later emits the `<p:pic>`.\n * @param target - slide (or master/group) the image is appended to\n * @param opt - the caller's `ImageProps` (path/data, geometry, sizing, hyperlink, placeholder, …)\n */\nexport function addImageDefinition(target: PresSlideInternal, opt: ImageProps): void {\n\tconst newObject: SlideObject = {\n\t\t_type: SlideObjectType.image,\n\t}\n\n\t// Inherit geometry from a matching layout placeholder: an image targeting a\n\t// placeholder adopts that placeholder's position/size for any of x/y/w/h the caller omits.\n\t// Explicit `opt` values always win; this only fills the gaps so a picture placeholder no longer\n\t// collapses to the image's natural/1in fallback when no dimensions are supplied. Mirrors the\n\t// text-object placeholder inheritance in addTextDefinition().\n\tlet phX: Coord | undefined\n\tlet phY: Coord | undefined\n\tlet phW: Coord | undefined\n\tlet phH: Coord | undefined\n\tif (opt.placeholder && target._slideLayout?._slideObjects) {\n\t\tconst placeHold = target._slideLayout._slideObjects.find(\n\t\t\t(item) => item._type === SlideObjectType.placeholder && item.options?.placeholder === opt.placeholder\n\t\t)\n\t\tif (placeHold?.options) {\n\t\t\tphX = placeHold.options.x\n\t\t\tphY = placeHold.options.y\n\t\t\tphW = placeHold.options.w\n\t\t\tphH = placeHold.options.h\n\t\t}\n\t}\n\n\t// FIRST: Set vars for this image (object param replaces positional args in 1.1.0)\n\tconst intPosX = opt.x ?? phX ?? 0\n\tconst intPosY = opt.y ?? phY ?? 0\n\tconst intWidth = opt.w ?? phW ?? 0\n\tconst intHeight = opt.h ?? phH ?? 0\n\tconst sizing = opt.sizing\n\tconst objHyperlink = opt.hyperlink || ''\n\t// Convenience: accept raw SVG markup via `svg` and encode it to a data URI.\n\t// `data`/`path` win when also supplied, matching the documented precedence.\n\tconst strImageData = opt.data || (opt.svg && !opt.path ? svgMarkupToDataUri(opt.svg) : '')\n\tconst strImagePath = opt.path || ''\n\tlet imageRelId = getNewRelId(target)\n\tconst imageNameIdx = nextObjectNameIdx(target, SlideObjectType.image)\n\tconst objectName = opt.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opt.objectName, 'image'))\n\t\t: `Image ${imageNameIdx}`\n\n\t// REALITY-CHECK: an unusable source has nothing to degrade to — there is no image to place —\n\t// so these reject rather than warn. `addMedia()` already rejects the missing-source and\n\t// missing-header cases, as does the `hyperlink` check further down this same function.\n\tif (!strImagePath && !strImageData) {\n\t\tthrow new InvalidOptionError('image/missing-source', \"addImage(): either 'data' or 'path' is required\")\n\t} else if (strImagePath && typeof strImagePath !== 'string') {\n\t\tthrow new InvalidOptionError(\n\t\t\t'image/path-not-a-string',\n\t\t\t`addImage(): 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(strImagePath)}`\n\t\t)\n\t} else if (strImageData && typeof strImageData !== 'string') {\n\t\tthrow new InvalidOptionError(\n\t\t\t'image/data-not-a-string',\n\t\t\t`addImage(): 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(strImageData)}`\n\t\t)\n\t} else if (strImageData && typeof strImageData === 'string' && !strImageData.toLowerCase().includes('base64,')) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'image/missing-base64-header',\n\t\t\t\"addImage(): `data` value lacks a base64 header, ex: 'image/png;base64,NMP[...]'\"\n\t\t)\n\t}\n\n\t// STEP 1: Set extension (the `data:` mime wins over the path when both are supplied)\n\tconst strImgExtn = imageExtensionForSource(strImagePath, strImageData)\n\n\t// STEP 2: Set type/path\n\tnewObject._type = SlideObjectType.image\n\tnewObject.image = strImagePath || 'preencoded.png'\n\n\t// STEP 3: Default any missing dimension from the image's intrinsic (natural) size.\n\t// For base64 `data` images the bytes are already in hand, so we can read the\n\t// natural pixel size synchronously and avoid the legacy 1x1 fallback that\n\t// squished data-only images into a 1in square.\n\t// Path images can't be measured synchronously (bytes load async during export),\n\t// so the missing extent is flagged via `_szAuto` and backfilled at serialize time\n\t// once the media bytes are available.\n\t// PowerPoint inserts images at 96 DPI, so natural pixels / 96 == inches.\n\t//\n\t// A vector source is measured for its RATIO only. An SVG's user units are dependable\n\t// relative to each other and merely conventional in absolute terms — a 24-unit icon is\n\t// authored to be drawn at whatever size it is placed, not as a quarter-inch object — so an\n\t// SVG with one side given derives the other, and an SVG with neither keeps the 1in fallback.\n\tlet defWidth = intWidth\n\tlet defHeight = intHeight\n\tlet szAuto: { w: boolean; h: boolean } | undefined\n\tconst vectorWithNoExtent = strImgExtn === 'svg' && !intWidth && !intHeight\n\tif ((!intWidth || !intHeight) && !vectorWithNoExtent) {\n\t\tconst natural = strImageData ? getImageSizeFromBase64(strImageData) : null\n\t\tif (natural) {\n\t\t\tif (!intWidth && !intHeight) {\n\t\t\t\t// Neither given: use the natural size (inches @ 96 DPI)\n\t\t\t\tdefWidth = natural.w / IMAGE_NATURAL_DPI\n\t\t\t\tdefHeight = natural.h / IMAGE_NATURAL_DPI\n\t\t\t} else if (typeof intWidth === 'number' && intWidth && !intHeight) {\n\t\t\t\t// Only width given: preserve aspect ratio for height (same unit as width)\n\t\t\t\tdefHeight = intWidth * (natural.h / natural.w)\n\t\t\t} else if (typeof intHeight === 'number' && intHeight && !intWidth) {\n\t\t\t\t// Only height given: preserve aspect ratio for width (same unit as height)\n\t\t\t\tdefWidth = intHeight * (natural.w / natural.h)\n\t\t\t}\n\t\t} else if (strImagePath) {\n\t\t\t// Path image: defer measurement to serialize time. Record which side(s) to derive\n\t\t\t// from the natural ratio; the 1in fallback below still applies if it stays unmeasurable.\n\t\t\tszAuto = { w: !intWidth, h: !intHeight }\n\t\t}\n\t}\n\n\t// STEP 4: Set image properties & options\n\tconst objectOptions: ObjectOptions = {\n\t\tx: intPosX || 0,\n\t\ty: intPosY || 0,\n\t\tw: defWidth || 1,\n\t\th: defHeight || 1,\n\t\taltText: opt.altText || '',\n\t\trounding: typeof opt.rounding === 'boolean' ? opt.rounding : false,\n\t\tshape: opt.shape,\n\t\tpoints: opt.points,\n\t\trectRadius: opt.rectRadius,\n\t\tshapeAdjust: opt.shapeAdjust,\n\t\tsizing,\n\t\tcrop: opt.crop,\n\t\tplaceholder: opt.placeholder,\n\t\trotate: opt.rotate || 0,\n\t\tflipV: opt.flipV || false,\n\t\tflipH: opt.flipH || false,\n\t\ttransparency: opt.transparency || 0,\n\t\tduotone: opt.duotone,\n\t\tgrayscale: opt.grayscale,\n\t\tbiLevel: opt.biLevel,\n\t\tclrChange: opt.clrChange,\n\t\tobjectName,\n\t\tobjectLock: opt.objectLock,\n\t\tshadow: correctShadowOptions(opt.shadow),\n\t\t...(szAuto ? { _szAuto: szAuto } : {}),\n\t}\n\tnewObject.options = objectOptions\n\n\t// STEP 5: Add this image to this Slide Rels (rId/rels count spans all slides! Count all images to get next rId)\n\tconst mediaKey = mediaSlideKey(target)\n\tif (strImgExtn === 'svg') {\n\t\t// SVG files consume *TWO* rId's: (a png version and the svg image)\n\t\t// <Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"../media/image1.png\"/>\n\t\t// <Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"../media/image2.svg\"/>\n\t\t//\n\t\t// Neither push goes through `registerImageMediaRel`, and neither needs to. The PNG\n\t\t// fallback is rasterized per call from a per-call `svgSize`, so two uses at different\n\t\t// sizes are genuinely two different images. The SVG source has no such excuse, but the\n\t\t// deck-wide collapse in `package/assemble.ts` already keys on extension + bytes and\n\t\t// merges them: the same SVG placed twice — on one slide or two, by path or by data —\n\t\t// measures as a single `ppt/media/*.svg` part in the emitted package.\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImagePath || strImageData + 'png',\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\tdata: strImageData || '',\n\t\t\trId: imageRelId,\n\t\t\tTarget: `../media/image-${mediaKey}-${target._relsMedia.length + 1}.png`,\n\t\t\tisSvgPng: true,\n\t\t\tsvgSize: {\n\t\t\t\tw: getSmartParseNumber(objectOptions.w, 'X', target._presLayout),\n\t\t\t\th: getSmartParseNumber(objectOptions.h, 'Y', target._presLayout),\n\t\t\t},\n\t\t})\n\t\tnewObject.imageRid = imageRelId\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImagePath || strImageData,\n\t\t\ttype: 'image/svg+xml',\n\t\t\textn: strImgExtn,\n\t\t\tdata: strImageData || '',\n\t\t\trId: imageRelId + 1,\n\t\t\tTarget: `../media/image-${mediaKey}-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t})\n\t\tnewObject.imageRid = imageRelId + 1\n\t} else {\n\t\tregisterImageMediaRel(target, { path: strImagePath, data: strImageData, extn: strImgExtn }, imageRelId)\n\t\tnewObject.imageRid = imageRelId\n\t}\n\n\t// STEP 6: Hyperlink support\n\tif (typeof objHyperlink === 'object') {\n\t\tif (!objHyperlink.url && !objHyperlink.slide)\n\t\t\tthrow new InvalidOptionError('hyperlink/missing-target', 'addImage: `hyperlink` requires either `url` or `slide`')\n\t\telse {\n\t\t\timageRelId++\n\n\t\t\ttarget._rels.push({\n\t\t\t\ttype: SlideObjectType.hyperlink,\n\t\t\t\tdata: objHyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\trId: imageRelId,\n\t\t\t\t// `Target` is stored RAW; every emitter escapes it. See the note on `SlideRel.Target`.\n\t\t\t\tTarget: objHyperlink.url ? objHyperlink.url : String(objHyperlink.slide),\n\t\t\t})\n\n\t\t\tobjHyperlink._rId = imageRelId\n\t\t\tnewObject.hyperlink = objHyperlink\n\t\t}\n\t}\n\n\t// STEP 7: Add object to slide\n\ttarget._slideObjects.push(newObject)\n}\n","/**\n * ts-pptx: DrawingML geometry\n *\n * Emit `<a:prstGeom>` (preset shapes with their adjustment guides) and\n * `<a:custGeom>` (freeform paths built from the `points` DSL). Shared by the\n * shape and image code paths so path/preset emission stays in one place.\n */\n\nimport { VALID_SHAPE_PRESETS } from '../../enums.js'\nimport type { Coord, GeometryPoint, ObjectOptions, PresLayout, ShapeAdjustHandleXY } from '../../types/index.js'\nimport { convertAngleUnits, convertArcAngle, getSmartParseNumber } from '../../units-internal.js'\nimport { EMU_PER_INCH, PERCENT_SCALE } from '../../units.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { warn } from '../../diagnostics.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/**\n * Several `<a:custGeom>` children are emitted as `<a:avLst />` — with a space before the\n * slash — where the rest of the tree writes `<a:avLst/>`. Byte-significant, so it stays.\n */\nconst SPACE_BEFORE_SLASH = { closePrefix: ' ' }\n\n/**\n * The path nodes inside `<a:cubicBezTo>`/`<a:quadBezTo>` are newline-and-tab separated,\n * an artifact of the source indentation these were originally written with. It reaches\n * the emitted bytes, so it is described here rather than left to leak from a literal.\n */\nconst BEZ_INDENT = { childPrefix: '\\n\\t\\t\\t\\t\\t', closePrefix: '\\n\\t\\t\\t\\t\\t' }\n\n/**\n * The 17 guide-formula operations ECMA-376 Part 1 §20.1.9.11 (`a:gd/@fmla`) defines.\n * The set is closed — the spec enumerates every operation with its arity — so an\n * unrecognized leading token is always a caller mistake, not a newer dialect.\n *\n * Only the operation is checked. The operands are deliberately left uninterpreted:\n * they may be literals, adjust names, or other guide names resolved in declaration\n * order, and validating them would mean re-implementing the geometry engine — which\n * is exactly what this passthrough exists to avoid.\n */\nconst GEOM_GUIDE_OPS = new Set([\n\t'*/',\n\t'+-',\n\t'+/',\n\t'?:',\n\t'abs',\n\t'at2',\n\t'cat2',\n\t'cos',\n\t'max',\n\t'min',\n\t'mod',\n\t'pin',\n\t'sat2',\n\t'sin',\n\t'sqrt',\n\t'tan',\n\t'val',\n])\n\n/**\n * Emit an `<a:prstGeom>` for a preset shape, including any adjust values (`<a:avLst>`).\n * Shared by the shape and image code paths so that geometry + adjust handling stays in one place.\n * @param {string} shapeName - preset geometry name (e.g. `rect`, `ellipse`, `roundRect`, `hexagon`)\n * @param {ObjectOptions} options - object options carrying optional `rectRadius`/`angleRange`/`arcThicknessRatio`\n * @param {number} cx - shape width (EMU), used to scale `rectRadius`\n * @param {number} cy - shape height (EMU), used to scale `rectRadius`\n * @return {string} `<a:prstGeom>` XML\n */\n// Shapes whose corner-radius adjust value is named adj1 (+ adj2) instead of adj.\n// Sourced from ECMA-376 Annex D electronic addenda (presetShapeDefinitions.xml).\nconst RECT_RADIUS_ADJ1_SHAPES = new Set(['round2SameRect', 'round2DiagRect'])\n\n/**\n * Reject a preset PowerPoint can't parse.\n *\n * An unknown `prst` value corrupts the package: PowerPoint shows the \"needs\n * repair\" dialog and drops the shape. So this is the safety net for every\n * `prstGeom` emitter — `addShape`, and the `shape` option on `addText`/`addImage`\n * — and it is also called during `addShape` normalization, so the caller sees\n * their own typo at the API boundary rather than at serialization time.\n * @param {string} shapeName - the resolved preset geometry name\n * @throws {InvalidOptionError} `shape/unknown-preset` when the name is not a preset\n */\nexport function assertKnownPreset(shapeName: string): void {\n\tif (VALID_SHAPE_PRESETS.has(shapeName)) return\n\tthrow new InvalidOptionError(\n\t\t'shape/unknown-preset',\n\t\t`Invalid shape \"${String(shapeName)}\"! Use a value from \\`ShapeType.*\\` (e.g. \\`ShapeType.rect\\`). PowerPoint can't render unknown preset geometries and will drop the shape during repair.`\n\t)\n}\n\nexport function genXmlPresetGeom(shapeName: string, options: ObjectOptions, cx: number, cy: number): string {\n\tassertKnownPreset(shapeName)\n\t// Collect adjustment guides; track names so the generic `shapeAdjust` passthrough\n\t// never emits a duplicate `<a:gd>` for a handle a friendly shortcut already set.\n\tlet avLst = ''\n\tconst emittedAdjNames = new Set<string>()\n\tconst emitGuide = (name: string, fmlaVal: number): void => {\n\t\t// `voidEl` escapes the guide name, which the `shapeAdjust` passthrough takes from the\n\t\t// caller. It is validated as a non-empty string but not charset-checked, so escaping is\n\t\t// a real (if narrow) hardening; every in-tree name is a plain `adj*` so bytes don't move.\n\t\tavLst += voidEl('a:gd', { name, fmla: `val ${fmlaVal}` })\n\t\temittedAdjNames.add(name)\n\t}\n\t// Zero is a deliberate value for every shortcut here — radius 0 is a sharp corner,\n\t// `[0, 0]` is a closed arc, thickness ratio 0 is a zero-thickness band — so each gate\n\t// asks whether the option was supplied (`!== undefined`), not whether it is truthy.\n\t// A truthy check silently dropped rectRadius: 0's guide entirely (PowerPoint then fell\n\t// back to the preset default rounding) and arcThicknessRatio: 0's adj3. (#24)\n\tif (options.rectRadius !== undefined) {\n\t\tconst adjVal = Math.round((options.rectRadius * EMU_PER_INCH * PERCENT_SCALE) / Math.min(cx, cy))\n\t\tif (RECT_RADIUS_ADJ1_SHAPES.has(shapeName)) {\n\t\t\temitGuide('adj1', adjVal)\n\t\t\temitGuide('adj2', 0)\n\t\t} else {\n\t\t\temitGuide('adj', adjVal)\n\t\t}\n\t} else if (options.angleRange !== undefined) {\n\t\tfor (let i = 0; i < 2; i++) {\n\t\t\tconst angle = options.angleRange[i] ?? 0\n\t\t\temitGuide(`adj${i + 1}`, convertAngleUnits(angle, `angleRange[${i}]`))\n\t\t}\n\n\t\tif (options.arcThicknessRatio !== undefined) {\n\t\t\temitGuide('adj3', Math.round(options.arcThicknessRatio * (PERCENT_SCALE / 2)))\n\t\t}\n\t}\n\t// Generic adjustment handles (`shapeAdjust`) for any preset shape.\n\tif (options.shapeAdjust) {\n\t\tconst adjusts = Array.isArray(options.shapeAdjust) ? options.shapeAdjust : [options.shapeAdjust]\n\t\tadjusts.forEach((adj) => {\n\t\t\t// Silent coercion of a bad guide produces a shape PowerPoint silently drops or repairs,\n\t\t\t// so warn and skip instead of emitting a degenerate `<a:gd>`.\n\t\t\tif (\n\t\t\t\t!adj ||\n\t\t\t\ttypeof adj.name !== 'string' ||\n\t\t\t\tadj.name.length === 0 ||\n\t\t\t\ttypeof adj.value !== 'number' ||\n\t\t\t\t!isFinite(adj.value)\n\t\t\t) {\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/invalid-shape-adjust',\n\t\t\t\t\t`shapeAdjust entry ${JSON.stringify(adj)} is invalid (needs { name:string, value:number }) and was ignored.`\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (emittedAdjNames.has(adj.name)) {\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/shape-adjust-overridden',\n\t\t\t\t\t`shapeAdjust \"${adj.name}\" was ignored because rectRadius/angleRange already set that handle.`\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// `value` is a 0.0-1.0 fraction of the handle range, emitted as a percentage guide (1/100000 units).\n\t\t\temitGuide(adj.name, Math.round(adj.value * PERCENT_SCALE))\n\t\t})\n\t}\n\treturn el('a:prstGeom', { prst: shapeName }, raw(el('a:avLst', null, raw(avLst))))\n}\n\n/**\n * Narrow a freeform path node to an arc segment. An arc is the one curve node with no end\n * point, so it must be split off before the remaining curve nodes can be read for x/y.\n */\nfunction isArcPoint(point: GeometryPoint): point is Extract<GeometryPoint, { curve: { type: 'arc' } }> {\n\treturn 'curve' in point && point.curve.type === 'arc'\n}\n\n/**\n * Emit an `<a:custGeom>` for a freeform path built from `points`, plus any caller-supplied\n * connection sites (`connectionSites` → `<a:cxnLst>`), adjust handles (`adjustHandles` →\n * `<a:ahLst>`) and guide formulas (`guides` → `<a:gdLst>`) that make the shape connectable and\n * editable. Shared by the shape and image code paths so that path emission stays in one place.\n * Points and connection-site/handle positions are authored in the object's own inch/EMU space\n * (0..cx, 0..cy) — not slide-relative and not normalized; a bare non-`Coord` string is passed\n * through verbatim as a guide-name reference (matching `ST_AdjCoordinate`'s number-or-name union).\n * @param {ObjectOptions} options - object options carrying `points`/`guides`/`connectionSites`/`adjustHandles`\n * @param {number} cx - object width (EMU), used as the path viewport width\n * @param {number} cy - object height (EMU), used as the path viewport height\n * @param {PresLayout} layout - presentation layout used to resolve point coordinates to EMU\n * @return {string} `<a:custGeom>` XML\n */\nexport function genXmlCustGeom(options: ObjectOptions, cx: number, cy: number, layout: PresLayout): string {\n\tconst points = options.points\n\n\t/**\n\t * Resolve an `ST_AdjCoordinate` value: a number / unit-suffixed `Coord` → EMU (like `points`),\n\t * but a token that starts with a letter/underscore is a guide-name reference emitted verbatim.\n\t * `undefined` → `undefined`, so `el`/`voidEl` drop the (optional) attribute entirely.\n\t */\n\tconst adjCoord = (v: Coord | string | undefined, axis: 'X' | 'Y'): string | undefined => {\n\t\tif (v === undefined || v === null) return undefined\n\t\tif (typeof v === 'string' && /^[A-Za-z_]/.test(v.trim())) return v\n\t\treturn String(getSmartParseNumber(v as Coord, axis, layout))\n\t}\n\n\t/** `<a:pt>` in the object's own EMU space. */\n\tconst pt = (x: Coord | undefined, y: Coord | undefined): string =>\n\t\tvoidEl(\n\t\t\t'a:pt',\n\t\t\t{ x: getSmartParseNumber(x, 'X', layout), y: getSmartParseNumber(y, 'Y', layout) },\n\t\t\tSPACE_BEFORE_SLASH\n\t\t)\n\n\tconst nodes: string[] = []\n\tpoints?.forEach((point, i) => {\n\t\tif (isArcPoint(point)) {\n\t\t\t// An `<a:arcTo>` has no end point: it is derived from the pen position, radii and sweep.\n\t\t\t// An authored x/y is silently unused, so say so rather than let it read as meaningful.\n\t\t\t// (A union excess-property check does not reject one, so this is the only signal.)\n\t\t\tif ('x' in point || 'y' in point)\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/arc-node-point-ignored',\n\t\t\t\t\t'freeform arc node: x/y are ignored — an arcTo end point is computed from stAng/swAng and the radii.'\n\t\t\t\t)\n\t\t\tnodes.push(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'a:arcTo',\n\t\t\t\t\t{\n\t\t\t\t\t\thR: getSmartParseNumber(point.curve.hR, 'Y', layout),\n\t\t\t\t\t\twR: getSmartParseNumber(point.curve.wR, 'X', layout),\n\t\t\t\t\t\tstAng: convertArcAngle(point.curve.stAng, 'stAng'),\n\t\t\t\t\t\tswAng: convertArcAngle(point.curve.swAng, 'swAng'),\n\t\t\t\t\t},\n\t\t\t\t\tSPACE_BEFORE_SLASH\n\t\t\t\t)\n\t\t\t)\n\t\t} else if ('curve' in point) {\n\t\t\tswitch (point.curve.type) {\n\t\t\t\tcase 'cubic':\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'a:cubicBezTo',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t[pt(point.curve.x1, point.curve.y1), pt(point.curve.x2, point.curve.y2), pt(point.x, point.y)].map(raw),\n\t\t\t\t\t\t\tBEZ_INDENT\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'quadratic':\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\tel('a:quadBezTo', null, [pt(point.curve.x1, point.curve.y1), pt(point.x, point.y)].map(raw), BEZ_INDENT)\n\t\t\t\t\t)\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t} else if ('close' in point) {\n\t\t\tnodes.push(voidEl('a:close', null, SPACE_BEFORE_SLASH))\n\t\t} else if (point.moveTo || i === 0) {\n\t\t\tnodes.push(el('a:moveTo', null, raw(pt(point.x, point.y))))\n\t\t} else {\n\t\t\tnodes.push(el('a:lnTo', null, raw(pt(point.x, point.y))))\n\t\t}\n\t})\n\n\t// custGeom preamble — the sub-lists OOXML requires before `<a:pathLst>` in this exact order:\n\t// adjust values (avLst), guide formulas (gdLst), adjust handles (ahLst), connection sites\n\t// (cxnLst), and the text rectangle (rect). `avLst` and `rect` stay as ts-pptx drives them\n\t// from the path; the other three are populated from caller options when supplied, and MUST\n\t// fall back to today's exact empty-case bytes when absent (byte-identity contract).\n\n\t// `<a:gdLst>`: named construction formulas, emitted verbatim (advanced escape hatch).\n\tlet gdLst = el('a:gdLst')\n\tif (options.guides?.length) {\n\t\tconst guideEls: string[] = []\n\t\toptions.guides.forEach((g) => {\n\t\t\t// A degenerate `<a:gd>` (empty name or formula) is one PowerPoint silently repairs, so\n\t\t\t// warn and skip rather than emit it (mirrors the `shapeAdjust` guard in genXmlPresetGeom).\n\t\t\tif (\n\t\t\t\t!g ||\n\t\t\t\ttypeof g.name !== 'string' ||\n\t\t\t\tg.name.length === 0 ||\n\t\t\t\ttypeof g.formula !== 'string' ||\n\t\t\t\tg.formula.length === 0\n\t\t\t) {\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/invalid-guide',\n\t\t\t\t\t`guide entry ${JSON.stringify(g)} is invalid (needs { name:string, formula:string }) and was ignored.`\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// The formula is passed through uninterpreted, but its leading operation is a\n\t\t\t// closed set: an unknown one emits schema-shaped, semantically dead geometry\n\t\t\t// whose first feedback is a PowerPoint repair prompt. Warn and skip instead.\n\t\t\tconst op = g.formula.trimStart().split(/\\s+/)[0] ?? ''\n\t\t\tif (!GEOM_GUIDE_OPS.has(op)) {\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/unknown-guide-operation',\n\t\t\t\t\t`guide \"${g.name}\" formula ${JSON.stringify(g.formula)} starts with an unknown operation \"${op}\" (expected one of ${[...GEOM_GUIDE_OPS].join(' ')}) and was ignored.`\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tguideEls.push(voidEl('a:gd', { name: g.name, fmla: g.formula }))\n\t\t})\n\t\tif (guideEls.length) gdLst = el('a:gdLst', null, guideEls.map(raw))\n\t}\n\n\t// `<a:cxnLst>`: connection sites a connector can attach to (indexed by startShapeIdx/endShapeIdx).\n\tlet cxnLst = el('a:cxnLst')\n\tif (options.connectionSites?.length) {\n\t\tconst cxnEls: string[] = []\n\t\toptions.connectionSites.forEach((c) => {\n\t\t\tif (!c || typeof c.ang !== 'number' || !isFinite(c.ang)) {\n\t\t\t\twarn(\n\t\t\t\t\t'geometry/invalid-connection-site',\n\t\t\t\t\t`connectionSite entry ${JSON.stringify(c)} is invalid (needs a finite \\`ang\\` in degrees) and was ignored.`\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst pos = voidEl('a:pos', { x: adjCoord(c.x, 'X'), y: adjCoord(c.y, 'Y') })\n\t\t\tcxnEls.push(el('a:cxn', { ang: convertAngleUnits(c.ang, 'connectionSite ang') }, raw(pos)))\n\t\t})\n\t\tif (cxnEls.length) cxnLst = el('a:cxnLst', null, cxnEls.map(raw))\n\t}\n\n\t// `<a:ahLst>`: draggable adjust handles — XY or polar, discriminated by any polar-only key.\n\tlet ahLst = voidEl('a:ahLst', null, SPACE_BEFORE_SLASH)\n\tif (options.adjustHandles?.length) {\n\t\tconst ahEls: string[] = options.adjustHandles.map((h) => {\n\t\t\tconst pos = raw(voidEl('a:pos', { x: adjCoord(h.x, 'X'), y: adjCoord(h.y, 'Y') }))\n\t\t\tconst isPolar = 'gdRefR' in h || 'minR' in h || 'maxR' in h || 'gdRefAng' in h || 'minAng' in h || 'maxAng' in h\n\t\t\t// `isPolar` is an aliased condition, so TS narrows `h` to `ShapeAdjustHandlePolar` in the\n\t\t\t// positive branch. The negation of a multi-`in` OR does not narrow the other way, so the\n\t\t\t// XY branch keeps an explicit cast.\n\t\t\tif (isPolar) {\n\t\t\t\treturn el(\n\t\t\t\t\t'a:ahPolar',\n\t\t\t\t\t{\n\t\t\t\t\t\tgdRefR: h.gdRefR,\n\t\t\t\t\t\tminR: adjCoord(h.minR, 'X'),\n\t\t\t\t\t\tmaxR: adjCoord(h.maxR, 'X'),\n\t\t\t\t\t\tgdRefAng: h.gdRefAng,\n\t\t\t\t\t\tminAng: h.minAng == null ? undefined : convertAngleUnits(h.minAng, 'adjustHandle minAng'),\n\t\t\t\t\t\tmaxAng: h.maxAng == null ? undefined : convertAngleUnits(h.maxAng, 'adjustHandle maxAng'),\n\t\t\t\t\t},\n\t\t\t\t\tpos\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst xy = h as ShapeAdjustHandleXY\n\t\t\treturn el(\n\t\t\t\t'a:ahXY',\n\t\t\t\t{\n\t\t\t\t\tgdRefX: xy.gdRefX,\n\t\t\t\t\tminX: adjCoord(xy.minX, 'X'),\n\t\t\t\t\tmaxX: adjCoord(xy.maxX, 'X'),\n\t\t\t\t\tgdRefY: xy.gdRefY,\n\t\t\t\t\tminY: adjCoord(xy.minY, 'Y'),\n\t\t\t\t\tmaxY: adjCoord(xy.maxY, 'Y'),\n\t\t\t\t},\n\t\t\t\tpos\n\t\t\t)\n\t\t})\n\t\tahLst = el('a:ahLst', null, ahEls.map(raw))\n\t}\n\n\treturn el(\n\t\t'a:custGeom',\n\t\tnull,\n\t\t[\n\t\t\tvoidEl('a:avLst', null, SPACE_BEFORE_SLASH),\n\t\t\tgdLst,\n\t\t\tahLst,\n\t\t\tcxnLst,\n\t\t\tvoidEl('a:rect', { l: 'l', t: 't', r: 'r', b: 'b' }, SPACE_BEFORE_SLASH),\n\t\t\tel('a:pathLst', null, raw(el('a:path', { w: cx, h: cy }, nodes.map(raw)))),\n\t\t].map(raw)\n\t)\n}\n","/**\n * ts-pptx: Hyperlink Relationship Registration\n *\n * Walks the text / table-cell object tree from `addText()` / `addTable()` and registers a\n * `hyperlink`-type slide rel for every hyperlink found, stamping the resolved `_rId` back onto\n * each hyperlink so serialization can emit `r:id`. Shared by the shape, text and table layers.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { ObjectOptions, TableCell, TextProps, TextPropsOptions } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { getNewRelId } from '../utils.js'\n\ntype HyperlinkTextObject = (TextProps | SlideObject | TableCell) & {\n\toptions?: TextPropsOptions | ObjectOptions\n\ttext?: string | number | TextProps[] | TableCell[]\n}\n\n/**\n * Parses text/text-objects from `addText()` and `addTable()` methods; creates 'hyperlink'-type Slide Rels for each hyperlink found\n * @param {PresSlideInternal} target - slide object that any hyperlinks will be be added to\n * @param {number | string | TextProps | TextProps[] | TableCell[][]} text - text to parse\n */\nexport function createHyperlinkRels(\n\ttarget: PresSlideInternal,\n\ttext: number | string | SlideObject | TextProps | TextProps[] | TableCell[] | TableCell[][],\n\toptions?: TextPropsOptions[]\n): void {\n\tlet textObjs: Array<HyperlinkTextObject | TableCell[]> = []\n\n\t// Only text objects can have hyperlinks, bail when text param is plain text\n\tif (typeof text === 'string' || typeof text === 'number') return\n\t// IMPORTANT: \"else if\" Array.isArray must come before typeof===object! Otherwise, code will exhaust recursion!\n\telse if (Array.isArray(text)) textObjs = text\n\telse if (typeof text === 'object') textObjs = [text]\n\n\ttextObjs.forEach((text: HyperlinkTextObject | TableCell[], idx: number) => {\n\t\t// NOTE: `text` can be an array of other `text` objects (table cell word-level formatting), continue parsing using recursion\n\t\tif (Array.isArray(text)) {\n\t\t\tconst cellOpts: TextPropsOptions[] = []\n\t\t\ttext.forEach((tablecell) => {\n\t\t\t\tif (tablecell.options) {\n\t\t\t\t\tcellOpts.push(tablecell.options)\n\t\t\t\t}\n\t\t\t})\n\t\t\tcreateHyperlinkRels(target, text, cellOpts)\n\t\t\treturn\n\t\t}\n\n\t\t// IMPORTANT: `options` are lost due to recursion/copy!\n\t\tif (options && options[idx] && options[idx].hyperlink) text.options = { ...text.options, ...options[idx] }\n\t\tif (Array.isArray(text.text)) {\n\t\t\tcreateHyperlinkRels(target, text.text, options && options[idx] ? [options[idx]] : undefined)\n\t\t} else if (\n\t\t\ttext &&\n\t\t\ttypeof text === 'object' &&\n\t\t\ttext.options &&\n\t\t\ttext.options.hyperlink &&\n\t\t\t!text.options.hyperlink._rId\n\t\t) {\n\t\t\tconst hyperlink = text.options.hyperlink\n\t\t\t// Only a `url` or a `slide` needs a relationship. Two other shapes reach here and mint\n\t\t\t// nothing, for opposite reasons:\n\t\t\t// - A navigation action button (`action` alone) is legitimately rel-free — the\n\t\t\t// `ppaction://hlinkshowjump` action is self-contained, so the emitter writes `r:id=\"\"`.\n\t\t\t// - A malformed hyperlink (not an object, or no target at all) is not reportable here.\n\t\t\t// The run emitter rejects the same input with `hyperlink/not-an-object` /\n\t\t\t// `hyperlink/missing-target` when the deck is written; a console line ahead of that\n\t\t\t// throw was one fault reported twice, the first time unroutably.\n\t\t\tif (typeof hyperlink === 'object' && (hyperlink.url || hyperlink.slide)) {\n\t\t\t\tconst relId = getNewRelId(target)\n\n\t\t\t\ttarget._rels.push({\n\t\t\t\t\ttype: SlideObjectType.hyperlink,\n\t\t\t\t\tdata: hyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\t\trId: relId,\n\t\t\t\t\t// `Target` is stored RAW; every emitter escapes it. See the note on `SlideRel.Target`.\n\t\t\t\t\tTarget: hyperlink.url ? hyperlink.url : String(hyperlink.slide),\n\t\t\t\t})\n\n\t\t\t\thyperlink._rId = relId\n\t\t\t}\n\t\t} else if (\n\t\t\ttext &&\n\t\t\ttypeof text === 'object' &&\n\t\t\ttext.options &&\n\t\t\ttext.options.hyperlink &&\n\t\t\ttext.options.hyperlink._rId\n\t\t) {\n\t\t\tconst hyperlink = text.options.hyperlink\n\t\t\tconst hyperlinkRelId = hyperlink._rId\n\t\t\t// NOTE: auto-paging will create new slides, but skip above as _rId exists, BUT this is a new slide, so add rels!\n\t\t\tif (hyperlinkRelId && !target._rels.some((rel) => rel.rId === hyperlinkRelId)) {\n\t\t\t\ttarget._rels.push({\n\t\t\t\t\ttype: SlideObjectType.hyperlink,\n\t\t\t\t\tdata: hyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\t\trId: hyperlinkRelId,\n\t\t\t\t\t// `Target` is stored RAW; every emitter escapes it. See the note on `SlideRel.Target`.\n\t\t\t\t\tTarget: hyperlink.url ? hyperlink.url : String(hyperlink.slide),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}\n","/**\n * ts-pptx: Shape Definition\n *\n * `addShapeDefinition` normalizes an `addShape()` preset (mapping friendly aliases, rejecting\n * presets PowerPoint can't parse), applies line defaults, registers hyperlink + image-fill rels,\n * and pushes a `text`-type shape object.\n */\nimport { type SHAPE_NAME, ShapeType, SlideObjectType } from '../../enums.js'\nimport { DEF_SHAPE_LINE_COLOR } from '../../constants-internal.js'\nimport type { ShapeLineProps, ShapeProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, validateObjectName } from '../utils.js'\nimport { correctShadowOptions } from '../drawingml/effect.js'\nimport { assertKnownPreset } from '../drawingml/geometry.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { createHyperlinkRels } from './hyperlinks.js'\nimport { registerImageFillMedia } from './image.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/**\n * Map of common friendly shape names users pass as bare strings to their\n * valid OOXML preset values. PowerPoint can't parse the friendly spellings\n * and removes the shape during repair .\n */\nconst SHAPE_NAME_ALIASES: { [key: string]: SHAPE_NAME } = {\n\toval: 'ellipse',\n\trectangle: 'rect',\n\troundedRectangle: 'roundRect',\n\troundedrectangle: 'roundRect',\n}\n\n// ===== Shapes & connectors =====\n\n/**\n * Adds a shape object to a slide definition.\n * @param {PresSlideInternal} target slide object that the shape should be added to\n * @param {SHAPE_NAME} shapeName shape name\n * @param {ShapeProps} opts shape options\n */\nexport function addShapeDefinition(target: PresSlideInternal, shapeName: SHAPE_NAME, opts: ShapeProps): void {\n\t// Take ownership of the options before touching them, the same way `addTextDefinition` does.\n\t// Everything below writes normalization back onto whatever object it is handed — the `line`\n\t// defaults and the assigned `objectName` above all — so without the copy a style literal reused\n\t// across shapes carries one shape's settings to the next:\n\t//\n\t// slide.addShape('rect', STYLE) // STYLE now holds `objectName: 'Shape 0'`\n\t// slide.addShape('ellipse', { ...STYLE }) // …spread onto the second, and the third\n\t//\n\t// which emits three shapes named `Shape 0` and a duplicate-`objectName` warning.\n\t//\n\t// Nested caller objects (`fill`, `shadow`) stay shared by reference, as in `addTextDefinition`:\n\t// the image fill's rel id is registered through that reference and read back at emit time.\n\t// `shadow` follows text rather than `copyChartOptions`, which does copy it. `correctShadowOptions`\n\t// normalizes in place, so the caller's shadow object comes back with a rounded `angle` and the\n\t// derived `_alpha` on it — but those are idempotent normalizations of the caller's own values,\n\t// not one shape's identity carried to the next, and `test/regression/shape/shared-shadow.test.js`\n\t// pins that `_alpha` precisely because a shadow object shared across shapes has to keep emitting\n\t// the same `<a:effectLst>`.\n\tconst options: ShapeProps = typeof opts === 'object' ? { ...opts } : {}\n\toptions.line = options.line || { type: 'none' }\n\toptions.shadow = correctShadowOptions(options.shadow)\n\t// Normalize friendly shape names (e.g. \"oval\" -> \"ellipse\") to their valid\n\t// OOXML preset spellings before storing on the slide object.\n\tconst resolvedShapeName: SHAPE_NAME =\n\t\ttypeof shapeName === 'string' && SHAPE_NAME_ALIASES[shapeName] ? SHAPE_NAME_ALIASES[shapeName] : shapeName\n\tconst newObject: SlideObject = {\n\t\t_type: SlideObjectType.text,\n\t\tshape: resolvedShapeName || ShapeType.rect,\n\t\toptions,\n\t}\n\n\t// Reality check\n\tif (!shapeName)\n\t\tthrow new InvalidOptionError(\n\t\t\t'shape/missing-type',\n\t\t\t'Missing/Invalid shape parameter! Example: `addShape(ShapeType.line, {x:1, y:1, w:1, h:1});`'\n\t\t)\n\n\t// Reject presets PowerPoint can't parse (a typo, or an unmapped friendly name)\n\t// here at the API boundary as well as at serialization time, so the message\n\t// names the call the caller actually made.\n\tassertKnownPreset(resolvedShapeName)\n\n\t// 1: ShapeLineProps defaults\n\t// A stroke can carry a non-solid paint (a `gradient`) just like a fill, so infer the\n\t// stroke `type` from the gradient when the caller omits it (`line: { gradient }`) and\n\t// preserve the gradient through normalization. Only a solid stroke gets the default\n\t// line color; a gradient stroke takes its colors from its stops.\n\t//\n\t// Spread first, then override only the keys this block actually defaults. Listing the\n\t// carried keys instead is what broke `pattern`, `image` and `cap`: each was added to\n\t// `ShapeLineProps` without being added here, so the emitter read a key normalization\n\t// had already dropped — `line: { type: 'pattern' }` reached `genXmlPatternFill` with no\n\t// pattern object and threw. A spread cannot fall out of sync with the type.\n\tconst lineType = options.line.type || (options.line.gradient ? 'gradient' : 'solid')\n\tconst newLineOpts: ShapeLineProps = {\n\t\t...options.line,\n\t\ttype: lineType,\n\t\tcolor: lineType === 'solid' ? options.line.color || DEF_SHAPE_LINE_COLOR : options.line.color,\n\t\ttransparency: options.line.transparency || 0,\n\t\twidth: options.line.width || 1,\n\t\tdashType: options.line.dashType || 'solid',\n\t}\n\tif (typeof options.line === 'object' && options.line.type !== 'none') options.line = newLineOpts\n\n\t// 2: Set options defaults\n\toptions.x = options.x || (options.x === 0 ? 0 : 1)\n\toptions.y = options.y || (options.y === 0 ? 0 : 1)\n\toptions.w = options.w || (options.w === 0 ? 0 : 1)\n\toptions.h = options.h || (options.h === 0 ? 0 : 1)\n\t// Shapes are `_type === text` objects, so they share the text-box name bucket (`Shape 0`,\n\t// `Text 1`, …) — which is what stops a shape and a text box colliding on `0`.\n\tconst shapeNameIdx = nextObjectNameIdx(target, SlideObjectType.text)\n\toptions.objectName = options.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(options.objectName, 'shape'))\n\t\t: `Shape ${shapeNameIdx}`\n\n\t// 3: Create hyperlink rels\n\tcreateHyperlinkRels(target, newObject)\n\n\t// 5: Register an image fill (if any) as a media relationship for serialize-time blipFill\n\tif (typeof options.fill === 'object' && (options.fill.type === 'image' || options.fill.image)) {\n\t\tregisterImageFillMedia(target, options.fill)\n\t}\n\n\t// LAST: Add object to slide\n\ttarget._slideObjects.push(newObject)\n}\n","/**\n * ts-pptx: Text Definition\n *\n * `addTextDefinition` cleans shape / run options (color, bullets, placeholder inheritance, body\n * properties, columns, align / valign), registers hyperlink + picture-bullet + image-fill rels,\n * and pushes a `text` / `placeholder` object. `createBulletImageRels` handles the picture-bullet\n * media rels.\n */\nimport { AlignH, type PLACEHOLDER_TYPE, ShapeType, SlideObjectType, TextAnchor } from '../../enums.js'\nimport { DEF_FONT_COLOR, DEF_SHAPE_LINE_COLOR } from '../../constants-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport type { ObjectOptions, ShapeLineProps, TextProps, TextPropsOptions } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, mediaSlideKey, validateObjectName } from '../utils.js'\nimport { correctShadowOptions } from '../drawingml/effect.js'\nimport { imageContentType, imageExtensionForSource } from '../../media/content-type.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { createHyperlinkRels } from './hyperlinks.js'\nimport { registerImageFillMedia } from './image.js'\n\n/**\n * Adds a text object to a slide definition.\n * @param {PresSlideInternal} target - slide object that the text should be added to\n * @param {string|TextProps[]} text text string or object\n * @param {TextPropsOptions} opts text options\n * @param {boolean} isPlaceholder whether this a placeholder object\n */\nexport function addTextDefinition(\n\ttarget: PresSlideInternal,\n\ttext: TextProps[],\n\topts: TextPropsOptions,\n\tisPlaceholder: boolean\n): void {\n\t// Take ownership of the options before touching them. Everything below writes internal state\n\t// (`_bodyProp`, `objectName`, `_placeholderType`, defaulted `color`/`line`) onto whatever object\n\t// it is handed, and `gen/drawingml/text-run.ts` writes more of it (`_lineIdx`, paragraph props\n\t// inherited from the shape) at emit time. Without `own()` that state lands on the CALLER's\n\t// object, so a style literal reused across shapes carries one shape's settings to the next:\n\t//\n\t// slide.addText('a', STYLE) // STYLE now holds a `_bodyProp`\n\t// slide.addText('b', { ...STYLE, columns: 2 }) // the spread aliases that same `_bodyProp`…\n\t// slide.addText('c', { ...STYLE }) // …so all three shapes emit numCol=\"2\"\n\t//\n\t// plus a duplicate-`objectName` warning, because the name assigned to the first shape is spread\n\t// onto the second.\n\t//\n\t// Identity WITHIN one call is preserved on purpose, which is why this memoizes instead of\n\t// spreading at each use. Sharing between the shape's options and a run's is load-bearing:\n\t// `SlideBuilder.addText`'s string shorthand hands the same object to both, so `cleanOpts` runs\n\t// over it twice, and the second pass emits bytes the first cannot (see the line-defaults case in\n\t// `test/regression/text/text-definition.test.js`). Copying each reference separately would\n\t// quietly change that shape's `<a:ln>`. The caller is protected either way — the aliasing is\n\t// between two objects this function now owns.\n\t//\n\t// Nested option objects the caller supplies (`bullet`, `shadow`, `fill`) are deliberately still\n\t// shared: `bullet._rId` and the image fill's rel id are registered through those references and\n\t// read back at emit time, and auto-paging relies on a cloned text object reaching the same bullet.\n\tconst owned = new Map<TextPropsOptions, ObjectOptions>()\n\t/** Copy a caller-supplied options object once, returning the same copy for the same input. */\n\tconst own = (source?: TextPropsOptions): ObjectOptions => {\n\t\tif (!source) return {}\n\t\tconst already = owned.get(source)\n\t\tif (already) return already\n\t\tconst copy: ObjectOptions = { ...source }\n\t\towned.set(source, copy)\n\t\treturn copy\n\t}\n\n\tconst textObjects = (!text || text.length === 0 ? [{ text: '' }] : text).map((item) => ({\n\t\t...item,\n\t\toptions: own(item.options),\n\t}))\n\tconst objectOptions: ObjectOptions = own(opts)\n\tconst newObject: SlideObject = {\n\t\t_type: isPlaceholder ? SlideObjectType.placeholder : SlideObjectType.text,\n\t\tshape: opts.shape || ShapeType.rect,\n\t\ttext: textObjects,\n\t\toptions: objectOptions,\n\t}\n\t// One index for the whole text object, taken here rather than inside `cleanOpts` — that runs once\n\t// for the object and again for every run, so naming from inside it would burn an index per run.\n\tconst textNameIdx = nextObjectNameIdx(target, newObject._type)\n\n\tfunction cleanOpts(itemOpts: ObjectOptions): TextPropsOptions {\n\t\t// STEP 1: Set some options\n\t\t{\n\t\t\t// A.1: Color (placeholders should inherit their colors or override them, so don't default them)\n\t\t\tif (!itemOpts.placeholder) {\n\t\t\t\t// A hyperlink run with no color configured anywhere inherits the theme hyperlink color\n\t\t\t\t// (a:schemeClr hlink, and folHlink once visited), which PowerPoint applies automatically\n\t\t\t\t// when the run carries no explicit fill. Defaulting it to DEF_FONT_COLOR would emit a\n\t\t\t\t// solidFill plus hlinkClr=\"tx\", pinning the link to black and suppressing the theme\n\t\t\t\t// hyperlink/visited colors. Only non-hyperlink text falls back to DEF_FONT_COLOR.\n\t\t\t\titemOpts.color =\n\t\t\t\t\titemOpts.color ||\n\t\t\t\t\tobjectOptions.color ||\n\t\t\t\t\ttarget.color ||\n\t\t\t\t\t(itemOpts.hyperlink || objectOptions.hyperlink ? undefined : DEF_FONT_COLOR)\n\t\t\t}\n\n\t\t\t// A.2: Placeholder should inherit their bullets or override them, so don't default them\n\t\t\tif (itemOpts.placeholder || isPlaceholder) {\n\t\t\t\titemOpts.bullet = itemOpts.bullet || false\n\t\t\t}\n\n\t\t\t// A.3: Text targeting a placeholder need to inherit the placeholders options (eg: margin, valign, etc.)\n\t\t\tif (itemOpts.placeholder && target._slideLayout && target._slideLayout._slideObjects) {\n\t\t\t\tconst placeHold = target._slideLayout._slideObjects.filter(\n\t\t\t\t\t(item) =>\n\t\t\t\t\t\titem._type === SlideObjectType.placeholder &&\n\t\t\t\t\t\titem.options &&\n\t\t\t\t\t\titem.options.placeholder &&\n\t\t\t\t\t\titem.options.placeholder === itemOpts.placeholder\n\t\t\t\t)[0]\n\t\t\t\tif (placeHold?.options) itemOpts = { ...itemOpts, ...placeHold.options }\n\t\t\t}\n\n\t\t\t// B:\n\t\t\tif (itemOpts.shape === ShapeType.line) {\n\t\t\t\tconst itemLine = typeof itemOpts.line === 'object' && itemOpts.line ? itemOpts.line : {}\n\t\t\t\t// ShapeLineProps defaults. Spread first, override only what is defaulted here —\n\t\t\t\t// see the same block in define/shape.ts for why listing the carried keys instead\n\t\t\t\t// silently dropped `gradient`, `pattern`, `image` and `cap` off this path.\n\t\t\t\tconst newLineOpts: ShapeLineProps = {\n\t\t\t\t\t...itemLine,\n\t\t\t\t\ttype: itemLine.type || 'solid',\n\t\t\t\t\tcolor: itemLine.color || DEF_SHAPE_LINE_COLOR,\n\t\t\t\t\ttransparency: itemLine.transparency || 0,\n\t\t\t\t\twidth: itemLine.width || 1,\n\t\t\t\t\tdashType: itemLine.dashType || 'solid',\n\t\t\t\t}\n\t\t\t\tif (typeof itemOpts.line === 'object') itemOpts.line = newLineOpts\n\t\t\t}\n\n\t\t\t// C: Line opts\n\t\t\titemOpts.line = itemOpts.line || {}\n\t\t\titemOpts.lineSpacing = itemOpts.lineSpacing && !isNaN(itemOpts.lineSpacing) ? itemOpts.lineSpacing : undefined\n\t\t\titemOpts.lineSpacingMultiple =\n\t\t\t\titemOpts.lineSpacingMultiple && !isNaN(itemOpts.lineSpacingMultiple) ? itemOpts.lineSpacingMultiple : undefined\n\n\t\t\t// D: Transform text options to bodyProperties as thats how we build XML\n\t\t\t// Copy, never adopt: an incoming `_bodyProp` belongs to something else. It arrives here\n\t\t\t// from a caller reusing a literal that a previous `addText` wrote to, and from the\n\t\t\t// A.3 branch above, which spreads a LAYOUT placeholder's options onto the slide's.\n\t\t\t// Adopting it makes the two shapes share one body-property record, so the last writer\n\t\t\t// of `numCol`/`anchor`/`vert` wins for all of them.\n\t\t\titemOpts._bodyProp = { ...itemOpts._bodyProp }\n\t\t\titemOpts._bodyProp.anchor = !itemOpts.placeholder ? TextAnchor.ctr : undefined // VALS: [t,ctr,b]\n\t\t\t// `textDirection` is the documented public option; `vert` is a legacy/extended alias kept as an\n\t\t\t// escape hatch for the full ST_TextVerticalType range (eaVert, mongolianVert, wordArtVertRtl).\n\t\t\t// Both map directly to the `<a:bodyPr vert=\"…\">` attribute, so prefer the documented one.\n\t\t\titemOpts._bodyProp.vert = itemOpts.textDirection ?? itemOpts.vert // VALS: [eaVert,horz,mongolianVert,vert,vert270,wordArtVert,wordArtVertRtl]\n\t\t\titemOpts._bodyProp.wrap = typeof itemOpts.wrap === 'boolean' ? itemOpts.wrap : true\n\t\t\titemOpts._bodyProp.prstTxWarp = itemOpts.textWarp // preset text warp (`<a:prstTxWarp>`), e.g. 'textArchUp'\n\n\t\t\t// D.1: Text columns (`numCol` range is 1-16 per ECMA-376 ST_TextColumnCount)\n\t\t\tif (itemOpts.columns !== undefined) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof itemOpts.columns !== 'number' ||\n\t\t\t\t\tisNaN(itemOpts.columns) ||\n\t\t\t\t\titemOpts.columns < 1 ||\n\t\t\t\t\titemOpts.columns > 16\n\t\t\t\t) {\n\t\t\t\t\twarn('text/invalid-columns', 'text `columns` must be a number 1-16 (ignoring value)')\n\t\t\t\t} else {\n\t\t\t\t\titemOpts._bodyProp.numCol = Math.round(itemOpts.columns)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (itemOpts.columnSpacing !== undefined) {\n\t\t\t\tif (typeof itemOpts.columnSpacing !== 'number' || isNaN(itemOpts.columnSpacing) || itemOpts.columnSpacing < 0) {\n\t\t\t\t\twarn('text/invalid-column-spacing', 'text `columnSpacing` must be a number >= 0 (ignoring value)')\n\t\t\t\t} else {\n\t\t\t\t\titemOpts._bodyProp.spcCol = ptsToEmuLenient(itemOpts.columnSpacing)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// E: Normalize shorthand `underline: true` to the object form\n\t\t\tif (typeof itemOpts.underline === 'boolean' && itemOpts.underline === true) itemOpts.underline = { style: 'sng' }\n\t\t}\n\n\t\t// STEP 2: Transform `align`/`valign` to XML values, store in _bodyProp for XML gen\n\t\t{\n\t\t\tconst align = (itemOpts.align || '').toLowerCase()\n\t\t\tconst valign = (itemOpts.valign || '').toLowerCase()\n\t\t\tif (align.startsWith('c')) itemOpts._bodyProp.align = AlignH.center\n\t\t\telse if (align.startsWith('l')) itemOpts._bodyProp.align = AlignH.left\n\t\t\telse if (align.startsWith('r')) itemOpts._bodyProp.align = AlignH.right\n\t\t\telse if (align.startsWith('j')) itemOpts._bodyProp.align = AlignH.justify\n\n\t\t\tif (valign.startsWith('b')) itemOpts._bodyProp.anchor = TextAnchor.b\n\t\t\telse if (valign.startsWith('m')) itemOpts._bodyProp.anchor = TextAnchor.ctr\n\t\t\telse if (valign.startsWith('t')) itemOpts._bodyProp.anchor = TextAnchor.t\n\t\t}\n\n\t\t// STEP 3: ROBUST: Set rational values for some shadow props if needed\n\t\tcorrectShadowOptions(itemOpts.shadow)\n\n\t\treturn itemOpts\n\t}\n\n\t// STEP 1: Create/Clean object options\n\tnewObject.options = cleanOpts(objectOptions)\n\n\t// STEP 1a: Selection Pane identity (`objectName`). Set once here, on the shape-level object\n\t// only — not inside `cleanOpts`, which also runs per text run (STEP 2 below). `Slide.addText`'s\n\t// single-string convenience form reuses the same options object for both the shape and its lone\n\t// run, so encoding this inside `cleanOpts` encoded a caller-supplied name twice. A placeholder's\n\t// default identity is its declared name (falling back to its type, then its idx). Placeholders\n\t// are `placeholder`-typed objects and so take their name index from their own bucket; naming\n\t// them `Text N` off the text-box bucket would collide with the slide's real text boxes.\n\tnewObject.options.objectName = newObject.options.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(newObject.options.objectName, 'text'))\n\t\t: isPlaceholder\n\t\t\t? encodeXmlAttrValue(\n\t\t\t\t\tString(\n\t\t\t\t\t\tnewObject.options.placeholder ||\n\t\t\t\t\t\t\tnewObject.options._placeholderType ||\n\t\t\t\t\t\t\t`Placeholder ${newObject.options._placeholderIdx ?? target._slideObjects.length}`\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t: `Text ${textNameIdx}`\n\n\t// STEP 1b: Standalone placeholder type (accessibility \"Missing Slide Title\")\n\t// `placeholder` is documented as a placeholder *type* ('title', 'body', et. al.). When it\n\t// resolves to a layout placeholder the layout object supplies the <p:ph> at serialize time,\n\t// but with a blank/default layout there is no match and no <p:ph> was emitted - so PowerPoint's\n\t// accessibility checker reports the slide as having no title. Record the type here so a real\n\t// <p:ph type=\"...\"/> is emitted on the slide shape even without a matching layout placeholder.\n\tif (!isPlaceholder && newObject.options.placeholder && !newObject.options._placeholderType) {\n\t\tnewObject.options._placeholderType = newObject.options.placeholder as PLACEHOLDER_TYPE\n\t}\n\n\t// STEP 2: Create/Clean text options\n\ttextObjects.forEach((item) => (item.options = cleanOpts(item.options || {})))\n\n\t// STEP 3: Create hyperlinks\n\tcreateHyperlinkRels(target, textObjects)\n\n\t// STEP 4: Create picture-bullet image rels\n\tcreateBulletImageRels(target, newObject.options, textObjects)\n\n\t// STEP 5: Register an image fill (if any) as a media relationship for serialize-time blipFill\n\tif (\n\t\ttypeof newObject.options.fill === 'object' &&\n\t\t(newObject.options.fill.type === 'image' || newObject.options.fill.image)\n\t) {\n\t\tregisterImageFillMedia(target, newObject.options.fill)\n\t}\n\n\t// LAST: Add object to Slide\n\ttarget._slideObjects.push(newObject)\n}\n\n/**\n * Register slide media relationships for any picture bullets (`bullet.image`) used by a text object.\n * Picture bullets render as `<a:buBlip><a:blip r:embed=\"rId..\"/></a:buBlip>`, so the bullet image\n * needs the same media-rel + package-part plumbing as `addImage()`. The assigned `rId` is stored on\n * the bullet options object (`_rId`) so XML generation can reference it.\n * @param {PresSlideInternal} target - slide receiving the rels\n * @param {ObjectOptions} objectOptions - shape-level text options (bullet may live here)\n * @param {TextProps[]} textObjects - per-paragraph text options (bullet may live here too)\n */\nfunction createBulletImageRels(\n\ttarget: PresSlideInternal,\n\tobjectOptions: ObjectOptions,\n\ttextObjects: TextProps[]\n): void {\n\t// Collect every bullet options object that requests a picture bullet (shape-level + per-paragraph).\n\t// Shape-level bullets are later shared by reference onto the first run, so the same object may appear\n\t// twice; the `_rId` guard below makes the registration idempotent.\n\tconst bulletObjs: Array<{ image?: { path?: string; data?: string }; _rId?: number; _rIdSvg?: number }> = []\n\tconst collect = (opts?: TextPropsOptions): void => {\n\t\tif (opts && typeof opts.bullet === 'object' && opts.bullet) bulletObjs.push(opts.bullet)\n\t}\n\tcollect(objectOptions)\n\ttextObjects.forEach((item) => collect(item.options))\n\n\tbulletObjs.forEach((bullet) => {\n\t\tconst img = bullet.image\n\t\tif (!img || (!img.path && !img.data)) return\n\n\t\t// REALITY-CHECK: base64 `data` must carry a base64 header (mirror addImage()). Unlike\n\t\t// `addImage()` this warns rather than throws: refusing the rel is not fatal, because the run\n\t\t// emitter falls back to a default glyph and the deck still opens.\n\t\tif (img.data && (typeof img.data !== 'string' || !img.data.toLowerCase().includes('base64,'))) {\n\t\t\twarn(\n\t\t\t\t'bullet/image-missing-base64-header',\n\t\t\t\t\"bullet.image `data` value lacks a base64 header, ex: 'image/png;base64,iVBOR[...]'\"\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\t// Auto-paging clones text objects onto new slides while sharing the bullet options object by\n\t\t// reference, so `_rId` may already be set from the originating slide. Skip when this slide already\n\t\t// carries the rel; otherwise (re-)register so the new slide's .rels and media part exist.\n\t\tif (bullet._rId && target._relsMedia.some((rel) => rel.rId === bullet._rId)) return\n\n\t\t// Determine extension: the `data:` mime wins, else parse the path (mirror addImageDefinition())\n\t\tconst strImgExtn = imageExtensionForSource(img.path || '', img.data || '')\n\n\t\tconst relId = bullet._rId || getNewRelId(target)\n\t\tconst mediaKey = mediaSlideKey(target)\n\n\t\tif (strImgExtn === 'svg') {\n\t\t\t// SVG bullets consume *TWO* rels, mirroring addImage(): a PNG preview (referenced by the\n\t\t\t// `<a:buBlip><a:blip r:embed>`) plus the SVG itself (referenced by the `asvg:svgBlip` ext).\n\t\t\t// The preview rel is flagged `isSvgPng` so the media pipeline generates its PNG fallback.\n\t\t\ttarget._relsMedia.push({\n\t\t\t\tpath: img.path || img.data + 'png',\n\t\t\t\ttype: 'image/png',\n\t\t\t\textn: 'png',\n\t\t\t\tdata: img.data || '',\n\t\t\t\trId: relId,\n\t\t\t\tTarget: `../media/image-${mediaKey}-${target._relsMedia.length + 1}.png`,\n\t\t\t\tisSvgPng: true,\n\t\t\t})\n\t\t\ttarget._relsMedia.push({\n\t\t\t\tpath: img.path || img.data || 'preencoded.svg',\n\t\t\t\ttype: 'image/svg+xml',\n\t\t\t\textn: 'svg',\n\t\t\t\tdata: img.data || '',\n\t\t\t\trId: relId + 1,\n\t\t\t\tTarget: `../media/image-${mediaKey}-${target._relsMedia.length + 1}.svg`,\n\t\t\t})\n\t\t\tbullet._rId = relId\n\t\t\tbullet._rIdSvg = relId + 1\n\t\t} else {\n\t\t\ttarget._relsMedia.push({\n\t\t\t\tpath: img.path || 'preencoded.' + strImgExtn,\n\t\t\t\ttype: imageContentType(strImgExtn),\n\t\t\t\textn: strImgExtn,\n\t\t\t\tdata: img.data || '',\n\t\t\t\trId: relId,\n\t\t\t\tTarget: `../media/image-${mediaKey}-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t\t})\n\t\t\tbullet._rId = relId\n\t\t}\n\t})\n}\n","/**\n * ts-pptx: Group Definition\n *\n * The group (`<p:grpSp>`) definition layer: `addGroupDefinition` builds a group from child\n * descriptors (recursing for nested groups), `groupObjectsDefinition` lifts already-authored\n * top-level objects into a group, and `addChildDefinition` is the shared child-descriptor\n * dispatch (also used by the slide-master definition).\n */\nimport { ShapeType, SlideObjectType } from '../../enums.js'\nimport { warn } from '../../diagnostics.js'\nimport type { GroupChildProps, GroupProps, SlideMasterObject } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, validateObjectName } from '../utils.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { addChartDefinition } from './chart.js'\nimport { addImageDefinition } from './image.js'\nimport { addShapeDefinition } from './shape.js'\nimport { addTextDefinition } from './text.js'\nimport { InvalidOptionError, UnsupportedFeatureError } from '../../errors.js'\n\n/**\n * Dispatch a key-tagged child-object descriptor (`{ text }`, `{ image }`, `{ shape }`, …) to the\n * matching `add*Definition`. Shared by `createSlideMaster` (slide master `objects`) and\n * `addGroupDefinition` (group children) so the descriptor mapping lives in one place.\n *\n * `placeholder` is intentionally not handled here — it is master-specific and needs the object's\n * index for `_placeholderIdx`, so `createSlideMaster` handles that case itself.\n * @param target - slide (or master) the object is appended to\n * @param object - the child descriptor\n * @returns `true` if the descriptor was recognized and added, else `false`\n */\nexport function addChildDefinition(target: PresSlideInternal, object: SlideMasterObject | GroupChildProps): boolean {\n\tif ('chart' in object)\n\t\taddChartDefinition(target, object.chart.type, object.chart.data, object.chart.opts || object.chart.options || {})\n\telse if ('image' in object) addImageDefinition(target, object.image)\n\telse if ('line' in object) addShapeDefinition(target, ShapeType.line, object.line)\n\telse if ('rect' in object) addShapeDefinition(target, ShapeType.rect, object.rect)\n\telse if ('roundRect' in object) addShapeDefinition(target, ShapeType.roundRect, object.roundRect)\n\telse if ('shape' in object) addShapeDefinition(target, object.shape.type, object.shape.options || {})\n\telse if ('text' in object)\n\t\taddTextDefinition(\n\t\t\ttarget,\n\t\t\tArray.isArray(object.text.text) ? object.text.text : [{ text: object.text.text }],\n\t\t\tobject.text.options || {},\n\t\t\tfalse\n\t\t)\n\telse return false\n\treturn true\n}\n\n/**\n * Build a group (`<p:grpSp>`) render-object from its child descriptors, without appending the\n * group itself to the slide. Nested `group` children recurse, so a group can contain other groups.\n *\n * An identity child coordinate space is kept at every depth (emitted in `gen/slide/object.ts` as\n * `chOff/chExt == off/ext`), so children — including descendants of nested groups — keep their\n * slide-absolute coordinates and grouping is visually a no-op while making the objects one\n * selectable PowerPoint group. Charts, media, tables, and placeholders are not supported as group\n * children yet; each is skipped with a warning. When `opts.x/y/w/h` are omitted the group's bounds\n * are auto-computed (in `gen/slide/object.ts`) as the bounding box of its children.\n *\n * `target` stays the slide at every depth so leaf descendants register their image/chart rels and\n * unique ids slide-level, even when nested inside child groups.\n * @param target - slide the group's leaf children register rels against\n * @param children - the child-object descriptors\n * @param opts - group position/size/name options\n */\nfunction buildGroupObject(target: PresSlideInternal, children: GroupChildProps[], opts: GroupProps): SlideObject {\n\tconst groupObjects: SlideObject[] = []\n\n\t;(children || []).forEach((child) => {\n\t\t// Nested group: recurse and embed the child group object directly (no slide splice — its own\n\t\t// leaf descendants still register against `target` inside the recursive call).\n\t\tif ('group' in child) {\n\t\t\tgroupObjects.push(buildGroupObject(target, child.group.children, child.group.options || {}))\n\t\t\treturn\n\t\t}\n\t\t// Reject object types grouping does not support yet (rels/ID/transform work pending).\n\t\tif ('chart' in child || 'placeholder' in child || 'table' in child || 'media' in child) {\n\t\t\twarn('group/unsupported-child', `addGroup() does not support '${Object.keys(child)[0]}' children yet; skipping.`)\n\t\t\treturn\n\t\t}\n\t\t// Reuse the existing add*Definition logic (which registers any image/chart rels on the slide,\n\t\t// correctly — grouped children still reference slide-level relationships), then move the\n\t\t// just-appended object(s) off the slide's top-level list into this group's child list.\n\t\tconst before = target._slideObjects.length\n\t\tif (!addChildDefinition(target, child)) {\n\t\t\twarn(\n\t\t\t\t'group/unrecognized-child',\n\t\t\t\t`addGroup() received an unrecognized child descriptor (${Object.keys(child).join(', ')}); skipping.`\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t\tgroupObjects.push(...target._slideObjects.splice(before))\n\t})\n\n\t// A group with no renderable children resolves to a zero-size <p:grpSp> (auto-bounds over an empty\n\t// bbox is 0×0). That is the degenerate result AGENTS.md says to warn on rather than emit silently —\n\t// the same class as the partial-frame fallback. Warn once here, at the group that is actually empty:\n\t// a nested empty group has already warned in its own recursion, and its non-empty parent has not.\n\tif (groupObjects.length === 0) {\n\t\twarn(\n\t\t\t'group/no-children',\n\t\t\t`addGroup(): group \"${opts.objectName ?? ''}\" has no renderable children; emitting an empty, zero-size group. ` +\n\t\t\t\t'Pass at least one supported child (text/shape, image, or a nested group).'\n\t\t)\n\t}\n\n\t// Called after the children above so nested groups number inside-out (see `makeGroupObject`).\n\treturn makeGroupObject(target, groupObjects, opts)\n}\n\n/**\n * Wrap already-built child render-objects in a group (`<p:grpSp>`) render-object, without appending\n * the group anywhere. Shared by `buildGroupObject` (children built from descriptors) and\n * `groupObjectsDefinition` (children lifted off the slide) so both entry points name and frame a\n * group identically — including the all-or-nothing frame, which is left to `gen/slide/object.ts` to resolve:\n * passing `x/y/w/h` through unset is what makes the bounds auto-compute to the children's bounding\n * box, so neither caller needs bounds math of its own.\n *\n * Call this *after* the children exist, so nested groups number inside-out: the name index is taken\n * here, and a child group that was built first has already taken a lower one.\n * @param target - slide the group belongs to (owns the name counter)\n * @param groupObjects - the group's child render-objects, in z-order\n * @param opts - group position/size/name options\n */\nfunction makeGroupObject(target: PresSlideInternal, groupObjects: SlideObject[], opts: GroupProps): SlideObject {\n\t// Per slide rather than per process: a module-global counter made two identical presentations\n\t// built in one process disagree on their group names. `Group N` is 1-based, matching PowerPoint.\n\tconst groupNameIdx = nextObjectNameIdx(target, SlideObjectType.group)\n\tconst objectName = opts.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opts.objectName, 'group'))\n\t\t: `Group ${groupNameIdx + 1}`\n\n\treturn {\n\t\t_type: SlideObjectType.group,\n\t\t_groupObjects: groupObjects,\n\t\toptions: {\n\t\t\tx: opts.x,\n\t\t\ty: opts.y,\n\t\t\tw: opts.w,\n\t\t\th: opts.h,\n\t\t\trotate: opts.rotate,\n\t\t\tflipH: opts.flipH,\n\t\t\tflipV: opts.flipV,\n\t\t\tobjectName,\n\t\t\taltText: opts.altText,\n\t\t\tobjectLock: opts.objectLock,\n\t\t},\n\t}\n}\n\n/**\n * Add a group (`<p:grpSp>`) of child objects to a slide. Children may include nested groups.\n * @param target - slide the group is added to\n * @param children - the child-object descriptors\n * @param opts - group position/size/name options\n */\nexport function addGroupDefinition(target: PresSlideInternal, children: GroupChildProps[], opts: GroupProps): void {\n\ttarget._slideObjects.push(buildGroupObject(target, children, opts))\n}\n\n/**\n * Object kinds `groupObjects()` accepts. Text (which shapes and text boxes both are), images,\n * connectors, and groups — the last so consumers can build nested logical groups out of groups they\n * already made. Charts, media, tables, and placeholders are excluded for the same reason\n * `addGroup()` excludes them (rels/id/transform work pending); a placeholder is excluded on top of\n * that because grouping it would sever the layout inheritance that makes it a placeholder.\n */\nconst GROUPABLE_TYPES: readonly SlideObjectType[] = [\n\tSlideObjectType.text,\n\tSlideObjectType.image,\n\tSlideObjectType.connector,\n\tSlideObjectType.group,\n]\n\n/**\n * Whether `groupObjects()` would accept this object, given only what it is. The remaining reasons a\n * call can still fail are about the *selection* rather than the object — an unresolved, duplicated\n * or ambiguous name — so a consumer cannot decide those from one object either way.\n *\n * Exported because `Slide.objects` reports it as `canGroup`, and a consumer that had to re-state the\n * rule would be pinning a copy of the list above: it would keep refusing the day grouping learns a\n * new kind, and go on offering the day one is withdrawn, with nothing failing in either direction.\n * @param {SlideObject} obj - a top-level authored object\n * @returns {boolean} true when its kind is groupable and it is not a placeholder\n */\nexport function isGroupableObject(obj: SlideObject): boolean {\n\treturn GROUPABLE_TYPES.includes(obj._type) && !obj.options?.placeholder\n}\n\n/**\n * Depth-first search for an object whose *stored* name is `key`, among group children. Used only to\n * explain a failed lookup, so it takes the same attribute-escaped key the caller already compared\n * against `_slideObjects` (see `groupObjectsDefinition`) rather than escaping again per call.\n */\nfunction findNameInGroups(objects: SlideObject[], key: string): boolean {\n\treturn objects.some((obj) => {\n\t\tif (obj._type !== SlideObjectType.group) return false\n\t\treturn (obj._groupObjects || []).some(\n\t\t\t(child) => child.options?.objectName === key || findNameInGroups([child], key)\n\t\t)\n\t})\n}\n\n/**\n * Move already-authored, top-level slide objects into one group (`<p:grpSp>`), addressed by\n * `objectName`. The counterpart to `addGroup()` for consumers that compose a slide from independent\n * renderers: the objects already exist, so replaying their descriptors just to group them would mean\n * every renderer exposing its internals.\n *\n * Grouping is visually a no-op — children keep their slide-absolute geometry, their ids, their rels,\n * and their relative z-order, exactly as with `addGroup()`. Two ordering rules make that true:\n * children are ordered by their existing slide z-order (**not** by the order they are named, which\n * would silently restack the slide), and the group itself takes the topmost member's former slot, so\n * it lands where the selection's top edge already was.\n *\n * Every failure here throws rather than warns. An unmatched name is not a degenerate deck the author\n * might still want — it means the intended object is silently still loose on the slide, which is the\n * footgun the group was meant to remove.\n * @param target - slide holding the objects\n * @param objectNames - `objectName`s of the top-level objects to group\n * @param opts - group position/size/name options (same semantics as `addGroup()`)\n */\nexport function groupObjectsDefinition(target: PresSlideInternal, objectNames: string[], opts: GroupProps): void {\n\tif (!Array.isArray(objectNames) || objectNames.length === 0) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'group/missing-object-names',\n\t\t\t\"groupObjects() requires a non-empty array of objectNames. Ex: `slide.groupObjects(['Title', 'Logo'])`\"\n\t\t)\n\t}\n\n\tconst requested = new Set<string>()\n\tobjectNames.forEach((name) => {\n\t\tif (typeof name !== 'string' || name.trim().length === 0) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'group/invalid-object-name',\n\t\t\t\t`groupObjects(): every objectName must be a non-empty string (got ${JSON.stringify(name)}).`\n\t\t\t)\n\t\t}\n\t\tif (requested.has(name))\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'group/duplicate-object-name',\n\t\t\t\t`groupObjects(): objectName \"${name}\" was named more than once.`\n\t\t\t)\n\t\trequested.add(name)\n\t})\n\n\t// Resolve every name before moving anything, so a bad name leaves the slide untouched instead of\n\t// half-grouped.\n\tconst members: SlideObject[] = []\n\tobjectNames.forEach((name) => {\n\t\t// Match the stored name, which every `add*Definition` attribute-escapes before it reaches\n\t\t// `options` (same rule as `resolveObjectNameToId`, which this lookup does not go through).\n\t\t// Comparing raw made `groupObjects(['Q&A'])` throw for a shape that is right there on the slide.\n\t\t// Every message below stays on the caller's raw spelling.\n\t\tconst key = encodeXmlAttrValue(name)\n\t\tconst matches = target._slideObjects.filter((obj) => obj.options?.objectName === key)\n\t\tconst [obj, ambiguous] = matches\n\t\tif (!obj) {\n\t\t\t// Distinguish \"no such object\" from \"already grouped\": both leave the caller's name\n\t\t\t// unresolved, but only one of them is a typo.\n\t\t\tconst hint = findNameInGroups(target._slideObjects, key)\n\t\t\t\t? 'it is already inside a group (an object can only belong to one group)'\n\t\t\t\t: 'no top-level object on this slide has that objectName'\n\t\t\tthrow new InvalidOptionError('group/unresolved-object-name', `groupObjects(): cannot group \"${name}\" — ${hint}.`)\n\t\t}\n\t\tif (ambiguous) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'group/ambiguous-object-name',\n\t\t\t\t`groupObjects(): objectName \"${name}\" is ambiguous — ${matches.length} objects on this slide share it. Give them unique objectNames.`\n\t\t\t)\n\t\t}\n\t\tif (!isGroupableObject(obj)) {\n\t\t\tconst kind = obj.options?.placeholder ? 'placeholder' : obj._type\n\t\t\tthrow new UnsupportedFeatureError(\n\t\t\t\t'group/kind-not-groupable',\n\t\t\t\t`groupObjects(): cannot group \"${name}\" — grouping a ${String(kind)} is not supported yet.`\n\t\t\t)\n\t\t}\n\t\tmembers.push(obj)\n\t})\n\n\t// Order children by existing z-order, not by the order named: grouping must not restack the slide.\n\tconst memberSet = new Set(members)\n\tconst children = target._slideObjects.filter((obj) => memberSet.has(obj))\n\n\t// The wrapper takes the topmost member's former slot — i.e. it sits above everything the selection\n\t// sat above, and below everything it sat below. Counting the *survivors* ahead of that slot gives\n\t// the post-removal index directly, so the removal below cannot shift it.\n\tconst topmostIdx = Math.max(...members.map((obj) => target._slideObjects.indexOf(obj)))\n\tconst insertAt = target._slideObjects.slice(0, topmostIdx).filter((obj) => !memberSet.has(obj)).length\n\n\tconst regrouped = target._slideObjects.filter((obj) => !memberSet.has(obj))\n\tregrouped.splice(insertAt, 0, makeGroupObject(target, children, opts))\n\t// Rewrite in place (rather than reassigning `_slideObjects`) so any held reference stays live.\n\ttarget._slideObjects.splice(0, target._slideObjects.length, ...regrouped)\n}\n","/**\n * The three base64 placeholder images the library falls back to.\n *\n * Their own module because of where the bundler puts them, not because they group naturally.\n * The chunker splits by module, so a constant is pulled into every chunk that reaches the module\n * declaring it — and these lived in `constants-internal.ts` beside `XML_DECL`, `DEF_FONT_SIZE`\n * and the rest of the vocabulary all of `src/gen/` imports. The result was that `IMG_PLAYBTN`,\n * a 74 KB PNG wanted by exactly one module, landed in two chunks and cost 149 KB of the shipped\n * package, 13% of the largest chunk. A caller who only ever wrote text boxes paid for the video\n * poster.\n *\n * So the rule this module encodes: a payload measured in tens of kilobytes does not share a\n * module with vocabulary, however tidy that grouping reads.\n */\n\n/** Shown in place of media that failed to load, under `onMediaError: 'placeholder'`. */\nexport const IMG_BROKEN =\n\t'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAB3CAYAAAD1oOVhAAAGAUlEQVR4Xu2dT0xcRRzHf7tAYSsc0EBSIq2xEg8mtTGebVzEqOVIolz0siRE4gGTStqKwdpWsXoyGhMuyAVJOHBgqyvLNgonDkabeCBYW/8kTUr0wsJC+Wfm0bfuvn37Znbem9mR9303mJnf/Pb7ed95M7PDI5JIJPYJV5EC7e3t1N/fT62trdqViQCIu+bVgpIHEo/Hqbe3V/sdYVKHyWSSZmZm8ilVA0oeyNjYmEnaVC2Xvr6+qg5fAOJAz4DU1dURGzFSqZRVqtMpAFIGyMjICC0vL9PExIRWKADiAYTNshYWFrRCARAOEFZcCKWtrY0GBgaUTYkBRACIE4rKZwqACALR5RQAqQCIDqcASIVAVDsFQCSAqHQKgEgCUeUUAPEBRIVTAMQnEBvK5OQkbW9vk991CoAEAMQJxc86BUACAhKUUwAkQCBBOAVAAgbi1ykAogCIH6cAiCIgsk4BEIVAZJwCIIqBVLqiBxANQFgXS0tLND4+zl08AogmIG5OSSQS1gGKwgtANAIRcQqAaAbCe6YASBWA2E6xDyeyDUl7+AKQMkDYYevm5mZHabA/Li4uUi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1g/1Cw4pIXLrzO+1c+/wg7tBbFDle/EbQcjFCPWQJCau5EoBoFpzXHYDwFNJcDiCaBed1ByA8hTSXA4hmwXndAQhPIc3lAKJZcF53AMJTSHM5gGgWnNcdgPAU0lwOIJoF53UHIDyFNJcfSiCdnZ0Ui8U0SxlMd7lcjubn561gh+Y1scFIU/0o/3sgeLO12E2k7UXKYumgFoAYdg8ACIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6ZQ4JB6PKzviYthnNy4d9h+1M5mMlVckkUjsG5dhiBMCEMPg/wuOfrZZ/RSywQAAAABJRU5ErkJggg=='\n\n/** 1x1 transparent PNG, standing in for an SVG the runtime could not rasterize. */\nexport const IMG_SVG_PLACEHOLDER =\n\t'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='\n\n/** The default poster frame for an embedded video: PowerPoint's play-button overlay. */\nexport const IMG_PLAYBTN =\n\t'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAVnCAYAAACzfHDVAAAAYHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaVcjJDYAwDEXBu6ughBfH+YnLQSwSHVA+Yrkwx7HtPHabHuEWrQ+lBBAZ6TMweBWoCwUH8quZH6VWFXVT696zxp12ARkVFEqn8wB8AAAACXBIWXMAAC4jAAAuIwF4pT92AADZLklEQVR42uzdd5hV9Z0/8M+dmcsUZmDovYOhKCiKYhR7JJuoSTCWGFI0WUxijBoTTXazVlyza4maYm9rTRSJigVsqCDNQhHBAogKCEgRMjMMU+7vj93sL8kqClLmnPt6PY+PeXZM9vP9vO8jZ+Y955xMfJLjorBrRMuSgmiViyjN1Ee2oSCyucbIBAAAAAAAAADbXaYgcoWNUZcrirpMbdRsysa69wbF+rggGrf439vSF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ySffnzVrVpVPGAAAAE1Fpuexsd9HfaF+ZcSal0ptCAAAIAE6deqUPf744zvtueeeXbp3796lbdu2XSorKzuXlpZ2KS0t7VBYWFhhSztGQ0PDxpqampU1NTXL169fv+yDDz5Y9s477yybPXv2sj/96U8rVqxYUWdLAAAAbE9t9q6Jog4f/TUFMAAAQEJks9nMt7/97Y4jRozo1bdv397t2rXrXl5e3rWsrKxzcXFx+4gosKUmp7G2tnZVTU3Nso0bNy5btWrV0tdff/2tJ598cvG999672noAAADYFgpgAACAhPne977X6a9Fb/v27Xu1bNmyV1lZWa8kvXOXLauvr9/wl7/8ZdG6desWL1u2bNHChQsX/fGPf1w8derUjbYDAADAliiAAQAAmqhsNps59dRTuxx66KH9+/Tp87n27dv3Ly8v719UVOSRzXlq06ZNKzZu3Pj6+++//8abb775xqOPPvrG3XffvcpmAAAA+CsFMAAAQBNx6qmndvniF784qHfv3v3btWv3uYqKis8VFhaW2wxbUl9fv37Dhg1vfPDBB68vXrz4jccee2z+jTfeuNxmAAAA8pMCGAAAYBc45phjWn/rW9/aq3///kPatGnTv6Kiop9HOLO9NDQ0VG/cuPGtNWvWLFy4cOGcO+6445WHHnporc0AAACknwIYAABgJzjjjDO6f+lLX9qrV69eg1u3bj2orKysR0RkbIadJFddXb103bp18xcvXjz30UcffeXqq69+x1oAAADSRwEMAACwnZWWlhb86le/2u3QQw8d1r17931btmw5qLCwsMxmaEoaGhqqP/zww/nvvPPOzGeeeWbW2LFj36ipqWm0GQAAgGRTAAMAAGwHP/7xj7t+9atf3bdXr15D27Ztu1c2m21jKyRJXV3dmg8++OCVRYsWvfznP/95xh/+8IdltgIAAJA8CmAAAIBtcOKJJ7Y75ZRTDujXr9+w1q1bD81ms61shTSpq6tbt3bt2pfffPPNWbfccsvUe++9d7WtAAAANH0KYAAAgE+hoqKi4IILLhg0YsSI/bp27bpfy5YtB2YymUKbIR/kcrmGDz/8cP6777474/nnn59x4YUXvrZx40aPiwYAAGiCFMAAAAAf4/jjj2/7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999wHp06dutFGAACAfKIABgAAdomf//znPU855ZQTu3btemRhYWGZjQDbW2NjY92KFSuevOWWW+689NJLF9kIAACQDxTAAADATuMxz8Cusn79+rlPP/30f5188slT6+rqcjYCAACklQIYAADY4fr27Vv8hz/84a+Pee5nI8CuUlNT8+68efPu/8EPfvDgwoULN9kIAACQNgpgAABghxkyZEjpNddc89XBgwefWFxc3MFGgKaitrZ21dy5c+/5yU9+8uc5c+bU2AgAAJAWWyqAPYoNAADYJqNHj+4wb968n06ZMuXRYcOGnaH8BZqa4uLi9sOGDTtjypQpj86bN++nJ510UntbAQAA0s4dwAAAwFY599xze33/+9//dufOnY/IZDJZGwGSIpfL1S1fvvzJG2644fbLLrvsbRsBAACSyiOgAQCAz+y8887r+53vfOfbHTt2PDyTyRTaCJBUuVyuYcWKFU/cdNNN//XrX/96sY0AAABJowAGAAC22WWXXTboG9/4xg9at249zDaAtFm7du2su++++9pzzjnnNdsAAACSQgEMAABsNcUvkE8UwQAAQJIogAEAgE9N8Qvks7Vr18665557rvv5z38+3zYAAICmaksFcGHlwOj6UV9orIqoWZG1PQAAyBO/+MUvet9xxx3nHHrooT8pLS3tYiNAPiotLe2y7777HvP973+/X1lZ2ZIpU6assxUAAKCpKetcHwXlH/01BTAAAOS5M844o/u99957zpe//OWflZeX94qIjK0AeS5TXl7e8+CDDx71/e9/v3dEvDVjxowPrQUAAGgqFMAAAMD/ceKJJ7a77777fjJq1Kh/KS8v7xOKX4B/lCkvL+99+OGHj/rWt77VfvXq1Qvnz59fbS0AAMCutqUC2DuAAQAgzwwdOrTs+uuvP6l///4nFRYWltkI20NjY2Ns2rQpqquro6amJurr62PTpk2xefPmqK+vj+rq6qivr4/NmzfHpk2boqGhYZv/fxUWFkZJSUk0a9YsioqKoqysLIqKiqJZs2ZRUlISRUVFUVpa+r9/FRQUCIjtoqGhoeq11167a8yYMffMmTOnxkYAAIBdZUvvAFYAAwBAnujUqVP2nnvuGbXXXnudnM1mK22Ej9PQ0BAbN26MDRs2/J+/Nm7cGBs3boyamprYtGlTbNq0KWpqaqK2trbJnqe4uDhKSkqitLT0f/9eUVERFRUV0aJFi//zV0VFRRQWFvog8LHq6urWvvjii7eceOKJf169enW9jQAAADubAhgAAPLcXXfdddAXv/jF00tLS7vZRn7L5XKxYcOGWLt2baxbty7Wrl37d3+tW7cuNmzYkPd7atGiRbRu3TpatWoVrVu3jjZt2vzvf27dunW0aNHCh4morq5e+sgjj1zzne98Z6ptAAAAO5MCGAAA8tTVV189+MQTTzyzoqJioG3kj8bGxli5cmUsX748Pvjgg1i9evX//n3t2rXR2NhoSZ9RYWFhtGrVKtq1axdt27b937937tw5OnTo4LHTeWbDhg3z77333qvOPPPMebYBAADsDApgAADIM1/72tfaXHrppad27979qIjQRKVUQ0NDrFq1KlasWBHvv//+//595cqVTfqRzGlXXFwcHTp0iI4dO0bnzp2jY8eO0alTp2jXrp1HS6dYLpdrfOeddx76+c9/fv2ECRPW2QgAALAjKYABACBP9OrVq9ldd931jT322OM7hYWFZTaSHh9++GG88847sXTp0njvvfdixYoVsXr16mhoaLCchCgsLIz27dtHp06dolu3btG9e/fo3r27x0mnTENDQ9W8efNu++Y3v/nHJUuWbLYRAABgR1AAAwBAHrjrrrtG/NM//dOZJSUlXWwj2davXx9Lly6Nd955539L3w8//NBiUqqysvJ/y+C//tWqVSuLSbiamppljz322G9Gjx49xTYAAIDtTQEMAAAp9qtf/arPD3/4w5+1atVqL9tIno0bN8aSJUvirbfeikWLFsV7770XmzZtspg8V1JSEl27do0+ffpE3759o3fv3lFeXm4xCbRu3bqXr7322ivGjh27yDYAAIDtRQEMAAApNGjQoNI77rjju7vttttJBQUFWRtJhtWrV8ebb74ZixcvjiVLlsTy5cujsbHRYtiigoKC6Ny5c/Tu3Tt69+4d/fr1i7Zt21pMQjQ2Nta98cYbd33rW9+6ff78+TU2AgAAfFYKYAAASJHS0tKCBx988Jj99tvvn7PZbBsbaboaGhri7bffjrfeeisWLFgQS5YscXcv201FRUX06tUr+vbtG3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sbGxpqJEydecuyxxz5pGwAA0HR5BzAAAHwK7dq1K3ruued+1qNHj6/axsdbtGhR3H///bF48WLLABKnV69ecdxxx0WfPn0sYwuWLl3654MOOujy1atX19sGAAA0Pd4BDAAAn2DYsGHNn3766V936tTpC7bx0TZs2BD33Xdf/PGPf4y1a9daCJBI69evj2nTpsW6deuiZ8+eUVLiYQ8fpbKysv+3v/3t/lOmTJmyfPlyz/cHAIAmxjuAAQBgC372s5/1uP76669t0aKF54J+hJqamhg/fnzcfPPN8fbbb0cul7MUINFyuVy888478cwzz0RVVVX07t07slk/A/lHZWVl3U488cTD6+rqZkyfPv1DGwEAgCZ0va4ABgCAj3bFFVfscdZZZ11dXFzcwTb+Xi6XixkzZsR1110XCxYsiMbGRksBUqWxsTGWLFkSM2bMiPLy8ujSpUtkMhmL+RvZbLbFQQcddHibNm1mP/HEE6ttBAAAmoYtFcDeAQwAQN6aNGnSqAMOOODsTCZTaBt/b9GiRXHPPffEu+++axlA3ujWrVucdNJJ0bt3b8v4B7lcrm7y5Mm//vKXv/yIbQAAwK63pXcAK4ABAMg7paWlBTNnzjyzT58+x9vG39uwYUOMGzcuZsyY4VHPQF7KZDKx3377xde//vWoqKiwkH+waNGiP+27775X1dTUeCwEAADsQgpgAAD4H926dctOnjz5V506dRppG/9fLpeLqVOnxp///OfYuHGjhQB5r6KiIkaNGhX777+/x0L/g+XLlz9+6KGHXvLuu+/W2QYAAOwaWyqAvQMYAIC8MXz48PInnnjiynbt2o2wjf/vnXfeiWuvvTaee+652Lx5s4UARMTmzZtjzpw58dprr0XPnj2jRYsWlvI/Kioq+n7rW98aMnXq1Ofee+89f3AAAMAusKV3ACuAAQDIC9/+9rc73n777X9o0aLFANv4b1VVVXHXXXfFvffeG+vXr7cQgI+wbt26eP7552P9+vWx2267RVFRkaVERElJSefjjjvuoA8++GDKK6+88hcbAQCAnUsBDABAXjv//PP7XXzxxX8oKSnpbBv/bfr06XHttdfGokWLLAPgU3jnnXdi2rRp0bp16+jc2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h075u0joUtLSzudcMIJ+7/00ktPv/3227U+FQAA8NkogAEASJVhw4Y1v++++37TsmXLQfl4/vr6+hg/fnz88Y9/jNpaP0MHSILNmzfHiy++GJs3b47ddtstCgoK8m4HxcXFbY866qg9n3vuuaeXL1/ucdAAAPAZKIABAEiNI488snLcuHG/b9GixcB8PP97770XV111VcyZM8eHASCBFi1aFC+//HL069cvWrRokXfnLykp6XDcccftP2fOnGcWLVq0yScCAAC2jQIYAIBUOPLIIyvvvPPO35aXl++Wj+d/+umn48Ybb4wPP/zQhwEgwf7yl7/ECy+8ECUlJdGrV6+8O3+zZs3aHHXUUfspgQEAYNspgAEASLxjjz227W233faH5s2b98m3s1dVVcXNN98cTz31VDQ2NvowAKRAY2NjzJ8/P5YtWxYDBgyIZs2a5dX5mzVr1uaYY4458M0333xm4cKFNT4RAACwdRTAAAAk2qGHHtritttuuzofy9+33347rrnmmli8eLEPAkAKvf/++/HKK69Enz59orKyMq/Ons1mK4888sh9Zs6c+dTSpUs3+zQAAMCnpwAGACCxjjjiiJb33nvvteXl5f3y6dy5XC4mTZoUN998c1RVVfkgAKRYVVVVTJ06NbLZbPTp0ycymUzenL24uLjtV7/61c+/8sorTy1evLjWpwEAAD4dBTAAAIl06KGHtrj33nt/l2/lb3V1ddx0000xefLkyOVyPggAeSCXy8WCBQvi3Xffjd133z2y2fz5mUyzZs1aH3300fvNmDHjSXcCAwDAp6MABgAgcYYOHVo2fvz4qysqKgbk07mXLVsWV111lUc+A+SplStXxiuvvBKf+9znoqKiIm/O3axZszZHH3300GeeeebJFStW1PkkAADAlimAAQBIlCFDhpQ++uij17Rs2XL3fDr31KlT49prr42NGzf6EADksaqqqpg+fXq0bds2unTpkjfnLikpaT9q1KihTz755JMrV66s90kAAICPt6UCuMB6AABoSjp16pSdMGHCv1dWVu6RL2dubGyMcePGxR133BF1dW56AiCitrY2br755hg/fnw0NjbmzbkrKyv3mDBhwr9369bNXQkAALCNFMAAADQZrVq1Kpw+ffolbdq02T9fzlx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fyktLe2exvNNmDBB+QtAXpg0aVI89NBDqTxbaWlpj3vuuedfstlsRtIAAOQDBTAAANvs+eef/06HDh0OTePZHn744Xj44YeFDEDeeOSRR+LPf/5zKs/WoUOHw5599tlvSxkAgHygAAYAYJvcd999hw8ePPjUNJ7t/vvvjwkTJggZgLzz2GOPxX333ZfKs+25554/+NOf/nSYlAEASDvvAAYAYKudccYZ3ceMGXN5QUFBcdrONnHixHjkkUeEDEDeWrx4cWSz2ejbt2/ajpbp06fPvn/5y18mz5w5c4OkAQBIsi29A1gBDADAVhk2bFjzG2+88Q/NmjVrl7azPfroo6l99CUAbI2FCxdGUVFR9OvXL1XnKigoKD7wwAP3e/LJJx9dsWJFnaQBAEiqLRXAHgENAMBWuffee39ZWlraPW3nevzxx+PBBx8UMAD8jz//+c8xceLE1J2rtLS0x3333fdLCQMAkFYKYAAAPrVJkyaN6tSp0xEpPFeMHz9ewADwD8aPHx+TJ09O3bk6der0hUmTJn1VwgAApJFHQAMA8Kmcd955fU888cR/z2QyRWk618yZM+Puu+8WMAB8jNdeey06duwYnTt3TtW5unbtuk9BQcHzzz333DopAwCQNN4BDADAZ3LEEUe0vOKKK67NZrOVaTrXyy+/HDfffHPkcjkhA8DHyOVyMXv27OjSpUt06tQpNefKZDJF++yzz/CpU6c+9u67726WNAAASeIdwAAAbLNsNpu55ZZb/q2kpKRjms61YMGCuPnmm6OxsVHIAPAJGhsb4+abb44333wzVecqLS3tcvfdd5+fzWYzUgYAIC0UwAAAbNGkSZO+3rZt2wPTdKZly5bFDTfcEPX19QIGgE+prq4urr322li+fHmqztWuXbsDH3/88VESBgAgLTwCGgCAj3XZZZcN+upXvzo2k8mk5hcH33///bjyyiujqqpKwACwlerq6uLll1+OIUOGRHl5eWrO1aVLl31LS0unPvPMM2ukDABAEngENAAAW61///4lJ5988q8ymUxRWs60YcOG+P3vfx8bN24UMABso40bN8bvfve7VP15WlBQkP3hD394ft++fYslDABA4q9vrQAAgI/y4IMPnl1WVtYrLeeprq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5544glhAkCemjhxYixYsCDRZxg+fPiPjjjiiJbSBABgV1AAAwCkyBVXXHFyUVFRRVLnr6qqijvvvDNyuZwwASBP5XK5uP3226O6ujqxZygqKmrxm9/85mRpAgCwKyiAAQBS4vzzz+/Xu3fv45J8httvvz0+/PBDYQJAnlu3bl3cfvvtiT5D7969jz///PP7SRMAgJ1NAQwAkALZbDZz6qmn/jyTyST2+m769OkxZ84cYQIAERExe/bsmDFjRmLnz2QyBaeeeurPs9lsRpoAAOxMCmAAgBT44x//eERlZeXgpM6/du3auPfeewUJAPyde+65J9atW5fY+SsrKwf/6U9/+oIkAQDYmRTAAAAJ17dv3+JDDjnkR0k+w9133x01NTXCBAD+Tk1NTdx9992JPsPBBx/8o759+xZLEwCAnUUBDACQcHfdddc3S0pKOiV1/smTJ8e8efMECQB8pLlz58azzz6b2PlLSko63nPPPd+SJAAAO4sCGAAgwb70pS9VDhw48KSkzr9mzZoYP368IAGALXrggQdizZo1iZ2/f//+Jx111FGtJAkAwM6gAAYASLArrrji1MLCwvIkzp7L5eK2226LTZs2CRIA2KJNmzbFbbfdFrlcLpHzFxYWll1++eU/kCQAADuDAhgAIKF+8Ytf9O7evftXkjr/s88+G2+88YYgAYBP5Y033ojnn38+sfN369bt6F/96ld9JAkAwI6mAAYASKgf/vCHP8pkMom8nvvggw/igQceECIAsFXGjRsX69atS+TsmUym4NRTT/2xFAEA2NEUwAAACXTdddcNa9eu3YFJnD2Xy8Udd9wRtbW1ggQAtsqmTZvizjvvTOz8bdq02f+mm27aT5IAAOxICmAAgIQpLS0t+NrXvnZ6Uud/4YUXYuHChYIEALbJq6++GjNmzEjs/Mccc8zpFRUVfiYHAMAO42ITACBhbr/99oMrKip2S+LsGzZsiHHjxgkRAPhM7r///qiqqkrk7OXl5X3/67/+6wgpAgCwoyiAAQASpKKiouCwww47Nanz33vvvYn9YS0A0HRs2LAh7r///sTOf9BBB/1zq1atCiUJAMCOoAAGAEiQ+++//+iysrKeSZx9zpw58dJLLwkRANguXnjhhViwYEEiZy8tLe32xz/+8StSBABgR1AAAwAkRN++fYv33Xfff07i7LW1tXHvvfcKEQDYru6+++6oq6tL5Oz77bffKf379y+RIgAA25sCGAAgIW6++eZRxcXFbZM4+yOPPBJr164VIgCwXa1atSoee+yxRM6ezWbb3njjjV+TIgAA25sCGAAgAYYOHVq21157fSeJs7/33nvxxBNPCBEA2CEmTpwYK1asSOTsQ4YM+c7QoUPLpAgAwPakAAYASIBrr732xKKiosqkzZ3L5eKee+6JxsZGIQIAO0R9fX3cddddkcvlEjd7UVFR5bXXXnuCFAEA2J4UwAAATdwBBxxQMWDAgG8kcfYZM2bEW2+9JUQAYId6880348UXX0zk7AMGDPjG8OHDy6UIAMD2ogAGAGjirrrqqhOKiooqkjb3pk2b4oEHHhAgALBT3H///VFbW5u4uYuKilpcffXV7gIGAGC7UQADADRhBx10UEX//v0Teffvww8/HB9++KEQAYCdYv369TFhwoREzj5w4MBvHHDAARVSBABge1AAAwA0Yf/5n/95bGFhYfOkzb1q1aqYPHmyAAGAnerpp5+O1atXJ27uwsLC8ssuu2yUBAEA2B4UwAAATdQBBxxQMWjQoNFJnP3uu++O+vp6IQIAO1V9fX3cddddiZx99913/+bQoUPLpAgAwGelAAYAaKIuv/zyYwsLC8uTNvfcuXNjwYIFAgQAdokFCxbE3LlzEzd3UVFRi9/97ndflyAAAJ+VAhgAoAkaOnRo2aBBgxL37t+6urr405/+JEAAYJf605/+FHV1dYmbe/fdd//mkCFDSiUIAMBnoQAGAGiCfvOb33ylqKioZdLmfu655xL53j0AIF1Wr14dzz33XOLmLioqann11VcfLUEAAD4LBTAAQBPTq1evZoMHD/5m0uaurq6ORx55RIAAQJPwyCOPRHV1deLmHjJkyLe6deuWlSAAANtKAQwA0MTcdNNNxxQXF7dN2twTJkyIqqoqAQIATUJVVVUifzmtuLi43a233uouYAAAtpkCGACgCWnVqlXhXnvtdVLS5l61alU8++yzAgQAmpTJkyfHqlWrEjf30KFDR7dq1apQggAAbAsFMABAE3L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eCOruX9j+KioqYtSoUXHxxRfH4YcfHkVFRZYC4LpouyosLGz+H//xHwdLDQCACAUwAMAOteeeex6ZlFnXrl0b8+bNExrsIK1atYrjjz8+LrroohgxYkQUFPh2DKApmzdvXqxZsyYx8+61115HSg0AgAgFMADADnPMMce0bt269b5Jmfe5556LxsZGwcEO1qZNmxg9enRcfPHFimCAJqyxsTGee+65JP35MvyYY45pLTkAAPykAQBgBznzzDMPz2Qyibjeqq+vj6lTpwoNdqK2bdvG6NGj47zzzovhw4crggGaoBdeeCHq6+sTMWsmkyk844wzDpUaAAB+wgAAsIP079//C0mZdc6cObFhwwahwS7QqVOnOPnkk+Pf/u3fYu+9945MJmMpAE3Ehg0bYvbs2YmZd8CAAR4DDQCAAhgAYEf43ve+16mysnKPpMybpMcbQlp17tw5xowZE7/61a8UwQBNyPPPP5+YWSsrKwd/73vf6yQ1AID8pgAGANgBTj755CMiIhHtzcqVK+P1118XGjQRXbt2jTFjxsQ555wTgwcPthCAXez111+PlStXJmXczMknn3y41AAA8psCGABgB+jXr19iHv88ZcqUyOVyQoMmpnfv3nHaaafFOeecE/3797cQgF0kl8vFlClTknQd6jHQAAB5TgEMALCdnX766d0qKip2S8Ks9fX1MW3aNKFBE9anT58466yz4pxzzonddtvNQgB2gWnTpkV9fX0iZq2oqNjt9NNP7yY1AID8pQAGANjORo8efURSZp03b15s3LhRaJAAffr0ibPPPjvOPPPM6Nmzp4UA7EQbN26MefPmuR4FACARFMAAANtZr169EvPetSQ9zhD4bwMGDIhf/vKXceaZZ0b37t0tBGAnmTp1apKuRw+TGABA/lIAAwBsR2eccUb38vLyvkmYdf369fHaa68JDRJqwIAB8S//8i9x2mmnRbdunvQJsKPNnz8/Pvzww0TMWl5e3u9HP/pRF6kBAOQnBTAAwHZ03HHHHZSUWWfMmBGNjY1CgwTLZDIxePDg+Nd//dcYM2ZMdOjQwVIAdpDGxsaYMWNGYub9xje+cYjUAADykwIYAGA76tOnz8FJmDOXyyXqMYbAlmUymdh7773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7MTrr79e29DQsKmwsLBDttZYXFwcZWVlsWXLFgMDIBYsWBDjx4+PJUuWaAZkobKysiguLs7qGhsaGjYuWLCgzrQAAJJNAAwA8B62bt26vF27dh2yucauXbsKgAGauYULF8b48eNj8eLFmgFZLAm3t2zbtm25SQEAJJ8AGADgPVRVVS1t167d0GyusWfPnrFw4ULDAmiGli1bFo899ljMnz9fMyABevbsmfU1VlZWLjUpAIDkEwADALyHdevWLevTp09W15iEF4kA7ForVqyIRx99VPALCZOEfdvatWuXmRQAQPIJgAEA3sPChQuXHX744VldY69evQwKoJlYtWpVjB8/PubOnRuZTEZDIGGSsG9buHDhMpMCAEg+ATAAwHuYNm3a0ksuuSSra+zevXvk5+dHU1OTgQHkqHXr1sX48eNj9uzZgl9IqIKCgkR8A/jpp59eZloAADmw/9QCAICde+ihhzbcd999W/Pz80uzdjNXUBBdunSJNWvWGBhAjqmoqIiJEyfGyy+/HOl0WkMgwbp27RoFBdn9Gq6xsbH6kUce2WBaAADJJwAGAHgf27ZtW15WVnZwNtfYq1cvATBADqmqqoqJEyfG888/74YHyBFJ+P7vtm3blpsUAEBuEAADALyPLVu2LMv2ALhnz57x0ksvGRZAwm3evDkef/zxeOGFF6KxsVFDIIck4fu/W7ZsWWpSAAC5QQAMAPA+1q9fvyzbT2z06NHDoAASbMuWLTFlypSYOXNm1NfXawjkoCTs19avX7/MpAAAcoMAGADgfSxYsGDh0KFDs7rGfffdN1KpVGQyGQMDSJCampqYMmVKPPPMM4JfyGGpVCr23XffrK9z/vz5C00LACA3CIABAN7Ho48++uYFF1yQ1TWWlJRE586dY926dQYGkAC1tbUxefLkePbZZ6Ourk5DIMd17do1WrVqlfV1/vnPf15kWgAAuUEADADwPiZNmlRVX1+/oaioqGM217nvvvsKgAGy3Pbt22P69OkxderU2LZtm4ZAM9GnT5+sr7G+vr7iySefrDItAIDcIAAGAPgAW7duXZTtAXCfPn3ipZdeMiyALNTQ0BDTpk2Lp556KqqrqzUEmpkkXP+8detWp38BAHK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2fPxLx97N69ewwcODDmzJljgOS0LVu2xIQJE+KFF16IxsZGDQHIMYceemh069YtUTWvXr36qRkzZlSbHgAAH8QJYACAvejXv/71HyMiUR8SPeuss5wCJmdt27YtHn300bjtttviueeeE/4C5KC8vLwYM2ZM0srO/OpXv/qT6QEA8KH2vFoAALD3fP/733+rqqoqUR/V7dGjR3zqU58yPHJKfX19TJ06Nb71rW/F1KlTo76+XlMActSIESOiS5cuiap506ZNf73rrruWmh4AAB+GABgAYC975plnHkpazWeccUbk5dlKkjvmzZsXjz76aGzdulUzAHJYQUFBnH766Ymre9q0aQ+aHgAAH5a3dgAAe9nYsWNn1tfXr01SzZ07d47DDjvM8ACARBk5cmR06NAhUTXX1dWtHjt27POmBwDAhyUABgDYyyorK5tee+21Pyat7jPPPDMKCgoMEABIhBYtWiTy9O/s2bP/UF1dnTZBAAA+LAEwAEAWuOqqqyY0NjZWJanm9u3bx9FHH214AEAiHHfccdGmTZtE1dzQ0LDxiiuumGh6AAB8FAJgAIAssGDBgrqFCxc+lrS6R48eHYWFhQYIAGS1li1bxsknn5y4uhcuXDhu6dKl200QAICPQgAMAJAlvv71r/8pnU7XJqnmtm3bximnnGJ4AEBWO+2006K0tDRRNTc1NdV+7Wtfe8j0AAD4qATAAABZ4umnn968fPnyxF3xN3r06GjXrp0BAgBZqUOHDnH88ccnru5ly5ZNmD59+hYTBADgoxIAAwBkkbvvvvtPmUymKUk1FxYWxumnn254AEBWOvPMMxP3yYpMJtN41113/dH0AAD4OATAAABZ5Be/+MWatWvXTkta3UcccUT06tXLAAGArNK7d+847LDDEld3eXn5X+6///51JggAwMchAAYAyDIPP/zwn5JWcyqVijPPPNPwAICsMmbMmEilUomr+8EHH/yT6QEA8HEJgAEAsszXv/71NzZs2DAraXUPHDgwDj74YAMEALLCoEGDYsCAAYmru6KiYuatt966wAQBAPi4BMAAAFlo3Lhxv01i3WPGjIm8PFtMAGDvysvLizFjxiSy9j//+c+/NUEAAD7RflgLAACyz/XXXz+nqqr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aVLl3jjjTeiqanJgwDQzBQVFcWll14aJ554YrP53m/EP07+Pv7447dffPHFMz0FAADwwQTAAAAk0iOPPLLs0EMPXbb//vs3mxA4IqJHjx4xZMiQePPNN2Pr1q0eBIBmonv37vEv//IvccABBzSrdWcymaYnnnji9s997nPPeAoAAODDEQADAJBYDz/88NJjjjlmY+/evY+KiGZzFKq0tDSGDx8eq1evjvXr13sQAHLcwIED45prrol27do1t6VnZsyY8YOzzjprqqcAAAA+PAEwAACJdv/99795zDHHVO6zzz5HRDMKgVu0aBGHHXZYtGzZMhYuXBjpdNrDAJBjCgoK4pxzzonzzz8/WrRo0dyWn37uuefuOuWUUyZ4EgAA4KMRAAMAkHi///3v5w8bNmxF3759j2lO10GnUqno27dvDB06NBYvXhxbtmzxMADkiJ49e8YNN9wQgwcPblbf+434x7XPU6ZM+fbpp58+2ZMAAAAfnQAYAICc8OCDDy4ZNmzYin79+jWrEDgionXr1nHEEUdEfX19LF261MMAkGCpVCpOOOGEuOKKK6JNmzbNbv07wt9vnXPOOX/xNAAAwMcjAAYAIGc89NBDS4YNG7a8X79+xza3EDg/Pz8OPvjg6NWrV8yfPz8aGho8EAAJU1JSEpdffnmccMIJkZ+f3+zWn8lkGp944olvffazn53maQAAgI9PAAwAQE556KGHlo4cOXJdnz59RqWa252ZEdG1a9cYNmxYLFu2LCorKz0QAAnRt2/fuO6662K//fZrluvPZDLpp59++rvnnHPO054GAAD4ZATAAADknD/96U+LDj300KX7779/s7sOOiKiuLg4jjzyyCgpKYk333wz0um0hwIgSxUUFMRnP/vZuPDCC6OkpKRZ9iCdTjc88sgjt5x//vnTPREAAPDJCYABAMhJDz/88NId3wQelUqlmt09mqlUKvr06RMHH3xwLFy4MLZt2+ahAMgynTt3jrFjx8bQoUOjGV5aERH/CH+feOKJ2y+88MLnPBEAALBrCIABAMhZDz300JIePXq8NmjQoGPz8vJaNMcetG3bNkaNGhVNTU2xZMkSDwVAFkilUjF69Oi48soro0OHDs22D01NTdt++9vf/stll132oqcCAAB2HQEwAAA5bdKkSeXdu3efM3jw4GYbAufn58eAAQOiV69esWDBgti+fbsHA2Avad26dVx66aVx/PHHR35+frPtQ2NjY/WvfvWrf7nuuute81QAAMCuJQAGACDnTZ48eW1jY+OMI4444uiCgoKS5tqHrl27xqhRo2Lbtm2xcuVKDwbAHpRKpWLUqFExduzY6NWrV7PuRX19/fo77rjjK9/61rcWejIAAGDXEwADANAsPP/881UbNmx45rjjjjuqsLCwrLn2obCwMAYNGhT77bdfLF68OGpraz0cALtZ+/bt44orrogTTzwxCgub9/uU2tralTfffPPVP/nJT1Z7MgAAYPcQAAMA0Gz87W9/27p27doZJ5xwwsjCwsK2zbkXnTp1ipEjR0Z1dbXTwAC70ciRI+Pqq6+OHj16NPte1NTULL/hhhuu/e1vf7vOkwEAALuPABgAgGbltdde2zpv3rynTznllKFFRUWdmnMvCgsL49BDD4399tsvFi1a5DQwwC709qnfk08+udmf+o2I2Lx587yLL774unHjxm30dAAAwO71fgFwat9zYsTOftC4LmLjq610DwCAxOrVq1fhs88++69du3Y9QTciGhoaYurUqTF58uRobGzUEICPqaCgIE499dQYPXq04HeH8vLyp4499tjvrly5skE3AABg9+swrDYKuuz8ZwJgAAByWuvWrfNeeumlm/fdd9+zdeMfVq9eHffff38sWbJEMwA+ov322y8uuugi1z2/w8KFC38/fPjwnzY0NGR0AwAA9gwBMAAAzd7zzz9/8aGHHnp1RKR0IyKTycTMmTPjz3/+c9TV1WkIwAcoKSmJ8847L0aMGBGplL9Kdki//PLL9xx77LEPagUAAOxZ7xcA+wYwAADNwn333Tfn+OOP39yrV6/DQwgcqVQqevfuHcOHD49169ZFRUWFhwTgPRxyyCExduzY6N+/v/B3h0wm0/jMM8/828knnzxONwAAYM97v28AC4ABAGg2fve7370xePDgJf369Ts6lUrl60hEcXFxjBgxInr06BFLly6N2tpaTQHYoUOHDvGFL3whzjzzzCguLtaQHZqammoeeOCBWz73uc9N1w0AANg7BMAAALDDww8/vKygoOC54cOHH1FQUFCqI//QrVu3OO6446K0tDQWL14cTU1NmgI0Wy1btoxzzjknLr300ujevbuGvENtbe2K22677arbbrvtDd0AAIC9RwAMAADv8Oyzz25avHjx0yeddNKQoqKiTjryD3l5edGnT58YOXJkbN26NVatWqUpQLNz+OGHx1e+8pUYMGBA5OXlacg7VFVV/e3CCy+8/oEHHvDdAAAA2MsEwAAA8C7z58+vefbZZ58+44wz+hcXF/fSkf/RsmXLGDJkSOyzzz6xdOnSqKmp0RQg53Xs2DG++MUvximnnBItW7bUkHdZt27dMyeffPI3Xn755W26AQAAe9/7BcCpfc+JETv7QeO6iI2vttI9AAByWmFhYer555//0sEHH3y5bvxfTU1N8fzzz8f48eOjurpaQ4Cc07p16zjzzDPjyCOPdOJ35zJ///vff3rMMcfc39DQkNEOAADIDh2G1UZBl53/TAAMAAARMWnSpM8cc8wxt6RSKdfg7ERNTU1MmTIlpk2bFg0NDRoCJF5hYWGccsopcdJJJ0VRUZGG7EQ6na6fOnXqd88555y/6AYAAGSX9wuAXQENAAAR8Yc//GHhfvvt98aAAQOOysvLkwS8S2FhYQwYMCCGDh0amzZtinXr1mkKkFiDBw+Oq666KoYOHRoFBQUashONjY1Vv//972/5whe+MEs3AAAg+/gGMAAAfAgTJkxYXV1dPf3II4/8VGFhYTsd+b9KS0vjsMMOi/79+8eaNWti8+bNmgIkRu/evePyyy+PU045JUpLSzXkPWzdunXxLbfccs33vve9hboBAADZyTeAAQDgI+jTp0+LJ5988us9evQ4TTfe3/z58+ORRx6JlStXagaQtXr16hXnnHNODBgwQDM+wKpVq5444YQTfrBy5Ur3/QMAQBbzDWAAAPgYnnnmmfOHDx9+fSqVytON95bJZGL27Nkxbty4qKio0BAga3Tu3DnOOuusGDp0aKRSKQ15/z/Lm2bNmvXDk08++THdAACA7OcbwAAA8DH85je/eX3//fd//cADDzzSd4HfWyqViu7du8cxxxwT7dq1i2XLlkV9fb3GAHtN27Zt49xzz42LL744evToIfz9AI2NjdUPPvjgLZ/97Gf/ohsAAJAMvg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V69eUVBQoDkJtXXr1sUPPvjgj6699tq/6wYAALArCYABAKAZaNeuXf64cePOGTp06BUFBQWtdST56uvrY+XKlf88KbxixYpYu3ZtpNNpzUm4vLy86Nq1a+yzzz7//KdXr17RsmVLzckBjY2NW/7617/+4pxzznm0srKySUcAAIBdTQAMAADNyIknntjmnnvuuXzfffcdk0qlHB3MMdu3b481a9bEmjVrYu3atbF27dooLy+PDRs2CIazUF5eXnTs2DG6desWXbt2jW7dukW3bt2iR48eUVhYqEE5JpPJNC5ZsuRR1z0DAAC7mwAYAACaoa9+9av7Xnfdddd16NDhCN3IfY2Njf8MhNetWxfr1q2LioqKWLduXWzbtk2DdrPS0tLo3LnzP//p0qVLdO3aNbp27eoK52Ziw4YNM//rv/7rxz/60Y+W6wYAALC7CYABAKAZ++UvfznirLPOuq64uNj3gZupmpqaWL9+/T//qaioiMrKyqisrIxNmzZFY2OjJn2AgoKCaN++fbRr1y7at28fHTt2jC5dukSnTp2ic+fOUVxcrEnN1NatW98aP378PVdcccXLugEAAOwpAmAAAGjm2rVrl//ggw+eOWLEiCsLCwvb6gjvtHnz5n+GwZs2bYrKysqorq6OLVu2xJYtW6K6ujqqq6sjk8nk3NpTqVS0bt06WrduHWVlZdGmTZsoLS39X2Fvu3btok2bNh4U/peGhobKl1566efnnHPO+OrqavevAwAAe5QAGAAAiIiIoUOHFt97770XHHjggRfk5+c7ssiHlk6n/xkEV1dXR01Nzfv+k8lkora2NtLpdNTX10dTU1PU1dXt0u8U5+XlRcuWLSM/Pz+KiooiLy8vWrVqFalUKoqLi3f6T0lJSbRq1eqfgW9paWnk5eUZMB9aU1NTzYIFC/745S9/+Y+zZ8+u0REAAGBvEAADAAD/y2mnndb2rrvuurRPnz5n5+XlFeoIe9LbgfDbtm/f/r7XUBcUFESLFi3++b/fDnxhT8pkMg1LliwZd8stt/xq0qRJVToCAADsTQJgAABgp0477bS2d95554X777//5wTBAP9XJpNpWLhw4QO33nrrHwS/AABAtni/ADi/7UHRc2c/SG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qUKROuvfbav+sIAADA/yYABgAAEqNPnz4t/v3f/33UyJEjz2rfvv2nIiKlK9AsZDZt2vTXF1544bGvfe1rzzntCwAA8N4EwAAAQCJddNFFXa6++uqTDzzwwLNbtmzZTUcg99TV1a1ZsGDBuJ/+9KdP3n///et0BAAA4IMJgAEAgETr1q1b4d13333k4YcffmqHDh2OyMvLK9QVSK50Ot2wcePGWbNmzZp8/fXXz6qoqGjUFQAAgA9PAAwAAOSMo48+uvWtt956/CGHHHJKu3btBkdEnq5AIqQrKytfmzdv3uQ777xz+owZM6q1BAAA4OMRAAMAADnpuOOOK/vGN75x/CGHHHJa27ZtB4bvBUO2yVRVVc2dN2/epO9///vTpk+fvkVLAAAAPjkBMAAAkPNuu+22vmedddZJffr0Oa5Vq1a9dQT2ntra2uXLly+f/uijjz51xx13vKUjAAAAu5YAGAAAaFa+9KUvdbv44ouP7t+//wlOBsMekamqqpq7cOHCv/z+97+fcd9995VrCQAAwO4jAAYAAJqtSy65pOtll112jDAYdrl0VVXVvIULF/7lV7/61bO/+93v1moJAADAniEABgAAiIirr766x/nnnz9q//33P7JNmzZDUqlUga7Ah5fJZBoqKyv/vnjx4uf+9Kc/zbr33ntX6woAAMCeJwAGAAB4l379+hV97WtfGzRy5MhRPXv2PLaoqKizrsD/VV9fv37VqlXPvPDCC8/9+7//+5zFixfX6woAAMDeJQAGAAB4H61bt8678847Bx599NFHde/efURpaen+4apomq/M1q1bF69Zs+bF5557btY3v/nNOdXV1WltAQAAyB4CYAAAgI9g8ODBrcaOHXvI8OHDD+vevfvw1q1bHxACYXJXprq6+s01a9a88sorr7z8k5/8ZN5rr71Wqy0AAADZSwAMAADwCVx//fX7nHHGGYf169dvePv27Yfm5+e31hWSrLGxsXrjxo2vvvXWWy+PHz/+lR//+McrdQUAACA5BMAAAAC70Je//OUe55xzzvA+ffoM7tix45CioqKuukI2q6+vX7t27doXFy9ePGfixImv3Xvvvat1BQAAILkEwAAAALvRl7/85R6f+cxnBvfr129Qly5dDm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LPDu1yuGyZHSVAAAAAAAAAK/XOGe4ueSvZ4e8M8xZbVe5ceuPufvy3Oqkw4+v5emDX+fuuTlLhhwsEYIBAAAAAAAAXpclGR8OuXP0TR4cPM/9z/+SRyfNDf/1TZezOp/87KdjzizJZkhO7edMy/w/nAUAAAAAAADg/zaMWcZkP8/ZLsmLacr2/MV8+cnvs/tP5/4FmLjAq1ifcioAAAAASUVORK5CYII='\n","/**\n * ts-pptx: Media Definition\n *\n * `addMediaDefinition` registers an `addMedia()` audio / video (or online video) source: each\n * embedded A/V consumes two rels (ECMA video + MS-2007 media) plus a cover image; online videos\n * use the external-link variant. The timing / `<p:pic>` XML is emitted later.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport { IMG_PLAYBTN } from '../../media/placeholders.js'\nimport type { MediaProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, validateObjectName } from '../utils.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/**\n * Adds a media object to a slide definition.\n * @param {PresSlideInternal} `target` - slide object that the media will be added to\n * @param {MediaProps} `opt` - media options\n */\nexport function addMediaDefinition(target: PresSlideInternal, opt: MediaProps): void {\n\tconst intPosX = opt.x || 0\n\tconst intPosY = opt.y || 0\n\tconst intSizeX = opt.w || 2\n\tconst intSizeY = opt.h || 2\n\tconst strData = opt.data || ''\n\tconst strLink = opt.link || ''\n\tconst strPath = opt.path || ''\n\tconst strType = opt.type || 'audio'\n\tlet strExtn = ''\n\tconst strCover = opt.cover || IMG_PLAYBTN\n\tconst mediaNameIdx = nextObjectNameIdx(target, SlideObjectType.media)\n\tconst objectName = opt.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opt.objectName, 'media'))\n\t\t: `Media ${mediaNameIdx}`\n\tconst slideData: SlideObject = { _type: SlideObjectType.media }\n\n\t// STEP 1: REALITY-CHECK\n\tif (!strPath && !strData && strType !== 'online') {\n\t\tthrow new InvalidOptionError('media/missing-source', 'addMedia(): either `data` or `path` are required!')\n\t} else if (strData && !strData.toLowerCase().includes('base64,')) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'media/missing-base64-header',\n\t\t\t\"addMedia(): `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')\"\n\t\t)\n\t} else if (strCover && !strCover.toLowerCase().includes('base64,')) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'media/cover-missing-base64-header',\n\t\t\t\"addMedia(): `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')\"\n\t\t)\n\t}\n\t// Online Video: requires `link`\n\tif (strType === 'online' && !strLink) {\n\t\tthrow new InvalidOptionError('media/online-missing-link', 'addMedia(): online videos require `link` value')\n\t}\n\n\tstrExtn = opt.extn || (strData ? (strData.split(';')[0] ?? '').split('/')[1] : strPath.split('.').pop()) || 'mp3'\n\n\t// STEP 2: Set type, media\n\tslideData.mtype = strType\n\tslideData.media = strPath || 'preencoded.mov'\n\tslideData.options = {}\n\n\t// Playback looping (embedded audio/video only; online embeds have no timing tree)\n\tif (strType !== 'online') {\n\t\tif (opt.loop) slideData.loop = true\n\t\telse if (typeof opt.loopCount === 'number' && opt.loopCount > 0) slideData.loopCount = opt.loopCount\n\t}\n\n\t// STEP 3: Set media properties & options\n\tslideData.options.x = intPosX\n\tslideData.options.y = intPosY\n\tslideData.options.w = intSizeX\n\tslideData.options.h = intSizeY\n\tslideData.options.objectName = objectName\n\tif (opt.altText) slideData.options.altText = opt.altText\n\tif (opt.objectLock) slideData.options.objectLock = opt.objectLock\n\n\t// STEP 4: Add this media to this Slide Rels (rId/rels count spans all slides! Count all media to get next rId)\n\t/**\n\t * NOTE:\n\t * - rId starts at 2 (hence the intRels+1 below) as slideLayout.xml is rId=1!\n\t *\n\t * NOTE:\n\t * - Audio/Video files consume *TWO* rId's:\n\t * <Relationship Id=\"rId2\" Target=\"../media/media1.mov\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\"/>\n\t * <Relationship Id=\"rId3\" Target=\"../media/media1.mov\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\"/>\n\t */\n\tif (strType === 'online') {\n\t\tconst relId1 = getNewRelId(target)\n\t\t// A: ECMA video rel (external link) — referenced by <a:videoFile r:link>.\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\tdata: 'dummy',\n\t\t\ttype: 'online',\n\t\t\textn: strExtn,\n\t\t\trId: relId1,\n\t\t\tTarget: strLink,\n\t\t})\n\t\tslideData.mediaRid = relId1\n\n\t\t// B: MS-2007 media rel — PowerPoint authors a second external rel sharing the\n\t\t// same link Target; the body points at it via <p14:media r:link>. (Mirrors the\n\t\t// embedded A/V pair, but External and with no media binary part.)\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\tdata: 'dummy',\n\t\t\ttype: 'online',\n\t\t\textn: strExtn,\n\t\t\trId: getNewRelId(target),\n\t\t\tTarget: strLink,\n\t\t})\n\n\t\t// C: Add cover (preview/overlay) image\n\t\ttarget._relsMedia.push({\n\t\t\tpath: 'preencoded.png',\n\t\t\tdata: strCover,\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\trId: getNewRelId(target),\n\t\t\tTarget: `../media/image-${target._slideNum}-${target._relsMedia.length + 1}.png`,\n\t\t})\n\t} else {\n\t\t// PERF: Duplicate media should reuse existing `Target` value and not create an additional copy.\n\t\t// Path-based media match by `path`; base64/`data` media (which share the `preencoded`\n\t\t// placeholder path) match by their data payload so identical inline media embed once.\n\t\tconst dupeItem = target._relsMedia.find((item) => {\n\t\t\tif (item.isDuplicate || !item.Target || item.type !== strType + '/' + strExtn) return false\n\t\t\treturn strPath ? item.path === strPath : !!strData && item.data === strData\n\t\t})\n\n\t\t// A: \"relationships/video\"\n\t\tconst relId1 = getNewRelId(target)\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\ttype: strType + '/' + strExtn,\n\t\t\textn: strExtn,\n\t\t\tdata: strData || '',\n\t\t\trId: relId1,\n\t\t\tisDuplicate: !!dupeItem?.Target,\n\t\t\tTarget: dupeItem?.Target\n\t\t\t\t? dupeItem.Target\n\t\t\t\t: `../media/media-${target._slideNum}-${target._relsMedia.length + 1}.${strExtn}`,\n\t\t})\n\t\tslideData.mediaRid = relId1\n\n\t\t// B: \"relationships/media\"\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\ttype: strType + '/' + strExtn,\n\t\t\textn: strExtn,\n\t\t\tdata: strData || '',\n\t\t\trId: getNewRelId(target),\n\t\t\tisDuplicate: !!dupeItem?.Target,\n\t\t\tTarget: dupeItem?.Target\n\t\t\t\t? dupeItem.Target\n\t\t\t\t: `../media/media-${target._slideNum}-${target._relsMedia.length + 0}.${strExtn}`,\n\t\t})\n\n\t\t// C: Add cover (preview/overlay) image\n\t\ttarget._relsMedia.push({\n\t\t\tpath: 'preencoded.png',\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\tdata: strCover,\n\t\t\trId: getNewRelId(target),\n\t\t\tTarget: `../media/image-${target._slideNum}-${target._relsMedia.length + 1}.png`,\n\t\t})\n\t}\n\n\t// LAST\n\ttarget._slideObjects.push(slideData)\n}\n","/**\n * ts-pptx: preview/cover image registration.\n *\n * Several objects are drawn from a cached raster the library cannot render itself — a Zoom tile's\n * thumbnail of its target slide, an OLE object's picture of the embedded document. Each registers\n * that raster as an ordinary slide image rel and references it by rId. Shared here so the two\n * definers agree on the placeholder fallback and on extension sniffing; the rel itself goes through\n * `registerImageMediaRel`, the same call `addImage` and image fills use.\n */\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { getNewRelId } from '../utils.js'\nimport { imageExtensionForSource } from '../../media/content-type.js'\nimport { registerImageMediaRel } from './image-rel.js'\n\n/** 32×32 solid #E7E6E6 PNG — the neutral placeholder shown when the caller supplies no cover image. */\nconst PLACEHOLDER_PNG =\n\t'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAxSURBVFhH7c4hAQAACMAw+geFGOAJAGbi5mpRmf1Z7HEdAAAAAAAAAAAAAAAAAADAAPwOyNPFH3F8AAAAAElFTkSuQmCC'\n\n/**\n * Register a preview/cover image as a slide media rel (deduped like `addImage`) and return its rId.\n * Falls back to the gray placeholder PNG when no cover image is supplied.\n * @param target - slide the image rel is registered on\n * @param cover - caller-supplied cover image (`path` or base64 `data`); omitted → gray placeholder\n * @returns the rId of the image rel\n */\nexport function registerPreviewImage(target: PresSlideInternal, cover?: { path?: string; data?: string }): number {\n\tconst strImagePath = cover?.path || ''\n\tlet strImageData = cover?.data || ''\n\tif (!strImagePath && !strImageData) strImageData = 'image/png;base64,' + PLACEHOLDER_PNG\n\tconst extn = imageExtensionForSource(strImagePath, strImageData)\n\n\tconst rId = getNewRelId(target)\n\tregisterImageMediaRel(target, { path: strImagePath, data: strImageData, extn }, rId)\n\treturn rId\n}\n","/**\n * ts-pptx: 3D model Definition (`addModel3d()` — PowerPoint's Insert ▸ 3D Models).\n *\n * Registers the `.glb` payload as an embedded media part plus a preview-picture image rel, and\n * pushes a `SlideObject{ _type: model3d, model3d }` for `gen/slide/objects/model3d.ts` to emit as\n * an `<mc:AlternateContent>` wrapping a `<p:graphicFrame>`.\n *\n * Ground truth for the package-level choices here (verified against a deck authored by PowerPoint\n * via `Shapes.Add3DModel` — `test/read/fixtures/model3d.pptx`):\n * - the payload is referenced with the Microsoft `…/office/2017/06/relationships/model3d` rel\n * type and registered by a content-type `Default` for `glb` — `model/gltf.binary`, spelled\n * with a dot, not the `model/gltf-binary` of the IANA-style media type;\n * - both the payload and the preview picture live in `ppt/media/`, the payload named `model3dN`;\n * - the preview picture is an ordinary image rel, referenced twice — once by `am3d:raster`'s\n * `am3d:blip` and once by the `mc:Fallback` picture.\n *\n * Camera: PowerPoint derives its camera from the model's bounding box (it normalizes the largest\n * extent to 1 metre, then frames the resulting bounding sphere). This library does not parse\n * glTF, so it emits the camera PowerPoint wrote for a 2×2×2 cube and lets the caller override the\n * scale — see `docs/3d-models.md`.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { Model3dProps, Model3dPoint, Model3dCameraProps } from '../../types/model3d.js'\nimport type { PresSlideInternal, SlideObject, Model3dInternal } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, mediaSlideKey, validateObjectName } from '../utils.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { registerPreviewImage } from './preview-image.js'\nimport { InvalidOptionError } from '../../errors.js'\nimport { warn } from '../../diagnostics.js'\n\n/** OPC content type for a glTF binary, as PowerPoint spells it in `[Content_Types].xml`. */\nconst GLB_CONTENT_TYPE = 'model/gltf.binary'\n/** `.rels` `Type` URI for the embedded 3D model part. Note `2017/06` — not the namespace's `2017`. */\nconst MODEL3D_REL_TYPE = 'http://schemas.microsoft.com/office/2017/06/relationships/model3d'\n\n/** Fixed-point denominator for `am3d` linear values: `am3d:up@dy=\"36000000\"` is the unit vector. */\nconst AM3D_UNIT = 36000000\n/** Denominator of every `am3d` rational (`meterPerModelUnit`, `scale`, `illuminance`, `intensity`). */\nconst AM3D_RATIO_DEN = 1000000\n/** `am3d:perspective@fov` is in 60000ths of a degree, like every other DrawingML angle. */\nconst FOV_PER_DEGREE = 60000\n\n/**\n * The camera PowerPoint wrote for the 2×2×2 cube fixture, in caller units (metres / degrees).\n * `z` is `sqrt(3)/2 / sin(22.5°)` — the bounding sphere of a 1-metre cube framed at a 45° fov.\n */\nconst DEFAULT_CAMERA = {\n\tpos: { x: 0, y: 0, z: 2.2630334 },\n\tlookAt: { x: 0, y: 0, z: 0 },\n\tup: { x: 0, y: 1, z: 0 },\n\tfov: 45,\n} as const\n/** `am3d:meterPerModelUnit` for the cube fixture: 1 / (its 2-unit largest extent). */\nconst DEFAULT_METER_PER_MODEL_UNIT = 0.5\n\n/** Reject a non-finite camera component rather than letting `NaN` reach the XML as `\"NaN\"`. */\nfunction toAm3dUnits(point: Model3dPoint | undefined, fallback: Model3dPoint, label: string): Model3dPoint {\n\tconst src = point ?? fallback\n\tfor (const axis of ['x', 'y', 'z'] as const) {\n\t\tif (!Number.isFinite(src[axis])) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'model3d/invalid-camera',\n\t\t\t\t`addModel3d(): camera.${label}.${axis} must be a finite number, got ${String(src[axis])}.`\n\t\t\t)\n\t\t}\n\t}\n\treturn { x: Math.round(src.x * AM3D_UNIT), y: Math.round(src.y * AM3D_UNIT), z: Math.round(src.z * AM3D_UNIT) }\n}\n\n/** Resolve `camera` + `meterPerModelUnit` into the wire units {@link Model3dInternal} carries. */\nfunction resolveCamera(\n\tcamera: Model3dCameraProps | undefined,\n\tmeterPerModelUnit: number | undefined\n): Omit<Model3dInternal, 'modelRid' | 'previewRid'> {\n\tconst fovDeg = camera?.fov ?? DEFAULT_CAMERA.fov\n\tif (!Number.isFinite(fovDeg) || fovDeg <= 0 || fovDeg >= 180) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'model3d/invalid-fov',\n\t\t\t`addModel3d(): camera.fov must be greater than 0 and less than 180 degrees, got ${String(fovDeg)}.`\n\t\t)\n\t}\n\tconst scale = meterPerModelUnit ?? DEFAULT_METER_PER_MODEL_UNIT\n\tif (!Number.isFinite(scale) || scale <= 0) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'model3d/invalid-scale',\n\t\t\t`addModel3d(): meterPerModelUnit must be a finite number greater than 0, got ${String(scale)}.`\n\t\t)\n\t}\n\tconst up = toAm3dUnits(camera?.up, DEFAULT_CAMERA.up, 'up')\n\treturn {\n\t\tpos: toAm3dUnits(camera?.pos, DEFAULT_CAMERA.pos, 'pos'),\n\t\tlookAt: toAm3dUnits(camera?.lookAt, DEFAULT_CAMERA.lookAt, 'lookAt'),\n\t\tup: { dx: up.x, dy: up.y, dz: up.z },\n\t\tfov: Math.round(fovDeg * FOV_PER_DEGREE),\n\t\tmeterPerModelUnitN: Math.round(scale * AM3D_RATIO_DEN),\n\t}\n}\n\n/**\n * Adds an embedded 3D model to a slide definition.\n * @param {PresSlideInternal} target - slide the model will be added to\n * @param {Model3dProps} opt - 3D model options\n */\nexport function addModel3dDefinition(target: PresSlideInternal, opt: Model3dProps): void {\n\tconst strData = opt.data || ''\n\tconst strPath = opt.path || ''\n\n\t// STEP 1: REALITY-CHECK. The payload is the whole point; there is no meaningful default.\n\tif (!strPath && !strData) {\n\t\tthrow new InvalidOptionError('model3d/missing-source', 'addModel3d(): either `data` or `path` are required!')\n\t}\n\n\t// STEP 2: Resolve the camera before touching the rel table, so an invalid option throws without\n\t// leaving a half-registered part behind.\n\tconst camera = resolveCamera(opt.camera, opt.meterPerModelUnit)\n\tconst nameIdx = nextObjectNameIdx(target, SlideObjectType.model3d)\n\tconst objectName = opt.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opt.objectName, 'model3d'))\n\t\t: `3D Model ${nameIdx + 1}`\n\n\t// STEP 3: Register the `.glb` payload rel. Every model gets its own rel and its own camera; the\n\t// package-part de-dup in `package/assemble.ts` still collapses byte-identical payloads to one\n\t// part, which is wanted here (a model is read-only geometry, unlike an OLE payload, which is\n\t// exempted there because double-clicking one would rewrite the other's source).\n\tconst modelRid = getNewRelId(target)\n\tconst mediaKey = mediaSlideKey(target)\n\ttarget._relsMedia.push({\n\t\tpath: strPath || 'preencoded.glb',\n\t\ttype: GLB_CONTENT_TYPE,\n\t\textn: 'glb',\n\t\tdata: strData,\n\t\trId: modelRid,\n\t\tmodel3dRelType: MODEL3D_REL_TYPE,\n\t\tTarget: `../media/model3d-${mediaKey}-${target._relsMedia.length + 1}.glb`,\n\t})\n\n\t// STEP 4: Register the preview picture. Unlike OLE's silent placeholder, say so out loud — a\n\t// missing preview is invisible in PowerPoint (which draws the live model over it) and shows up\n\t// only in thumbnails, PDF export, and older viewers, i.e. long after the deck was checked.\n\tif (!opt.preview?.path && !opt.preview?.data) {\n\t\twarn(\n\t\t\t'model3d/preview-missing',\n\t\t\t'addModel3d(): no `preview` image supplied, so a gray placeholder is embedded. PowerPoint 2019+ ' +\n\t\t\t\t'draws the live model over it, but thumbnails, PDF export and older viewers show the placeholder.'\n\t\t)\n\t}\n\tconst previewRid = registerPreviewImage(target, opt.preview)\n\n\t// LAST: Push the slide object for the `<mc:AlternateContent>` emitter.\n\tconst slideData: SlideObject = {\n\t\t_type: SlideObjectType.model3d,\n\t\toptions: {\n\t\t\tx: opt.x ?? 0,\n\t\t\ty: opt.y ?? 0,\n\t\t\t// A 3D model has no aspect ratio and the library never opens the payload, so — as with\n\t\t\t// `addOleObject` — there is no natural size to measure.\n\t\t\tw: opt.w ?? 4,\n\t\t\th: opt.h ?? 3,\n\t\t\tobjectName,\n\t\t\t...(opt.altText ? { altText: opt.altText } : {}),\n\t\t\t...(opt.objectLock ? { objectLock: opt.objectLock } : {}),\n\t\t},\n\t\tmodel3d: { modelRid, previewRid, ...camera },\n\t}\n\ttarget._slideObjects.push(slideData)\n}\n","/**\n * ts-pptx: Notes Definition\n *\n * Normalizes plain or rich `addNotes()` input to a `TextProps[]` run list and pushes a\n * `notes`-type slide object; the notes-slide XML is emitted later by `gen/slide/notes.ts`.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { NotesProps, TextProps } from '../../types/index.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\n\n/**\n * Adds Notes to a slide.\n * @param {PresSlideInternal} `target` slide object\n * @param {string | NotesProps | NotesProps[]} `notes` plain text, or rich runs (inline formatting / hyperlinks)\n */\nexport function addNotesDefinition(target: PresSlideInternal, notes: string | NotesProps | NotesProps[]): void {\n\t// Normalize all input forms to a TextProps[] run list so the notes-slide serializer\n\t// (which reuses the standard text-run generator) can handle plain and rich notes uniformly.\n\tconst runs: TextProps[] =\n\t\ttypeof notes === 'string'\n\t\t\t? [{ text: notes }]\n\t\t\t: (Array.isArray(notes) ? notes : [notes]).map((run) => ({ text: run.text, options: run.options }))\n\n\ttarget._slideObjects.push({\n\t\t_type: SlideObjectType.notes,\n\t\ttext: runs,\n\t})\n}\n","/**\n * ts-pptx: OLE / Embedded Object Definition (`addOleObject()` — PowerPoint's Insert ▸ Object).\n *\n * Registers the payload as an embedded package part plus a preview-picture image rel, and pushes a\n * `SlideObject{ _type: oleObject, ole }` for `gen/slide/objects/ole.ts` to emit as a `<p:graphicFrame>`.\n *\n * Ground truth for the two package-level choices here (verified against a deck authored by\n * PowerPoint via `Shapes.AddOLEObject`):\n * - an embedded Office file (xlsx/docx/pptx — each an OPC package in its own right) is referenced\n * with the `.../relationships/package` rel type and gets a content-type `Default` for its\n * extension; only a non-package OLE server blob uses `.../relationships/oleObject` with a `.bin`\n * part (ECMA-376 Part 1 §15.2.10);\n * - the payload lives in `ppt/embeddings/`, the preview picture in `ppt/media/` as an ordinary image.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { OleObjectProps } from '../../types/media.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, mediaSlideKey, validateObjectName } from '../utils.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { registerPreviewImage } from './preview-image.js'\nimport { InvalidOptionError } from '../../errors.js'\nimport { OFFICE_REL } from '../../ooxml/rel-types.js'\n\nconst OD = 'application/vnd.openxmlformats-officedocument.'\n/** Rel type for an embedded OPC package (an Office file, itself a zip). */\nconst PACKAGE_REL = OFFICE_REL + 'package'\n/** Rel type for a generic OLE-server blob — a compound-file `.bin` (ECMA-376 Part 1 §15.2.10). */\nconst OLE_OBJECT_REL = OFFICE_REL + 'oleObject'\n\ninterface OleFormat {\n\t/** OPC content type, emitted as a `Default` entry for the part's extension. */\n\tcontentType: string\n\t/** `.rels` `Type` URI for the payload part. */\n\trelType: string\n\t/** Default `p:oleObj@progId`. */\n\tprogId: string\n\t/** Default `p:oleObj@name` — how PowerPoint labels the object's kind. */\n\tname: string\n}\n\n/**\n * Embeddable payload formats, keyed by file extension. The six Office extensions are OPC packages\n * and keep their own extension in `ppt/embeddings/`; everything else is embedded as a generic OLE\n * blob under {@link BIN_FORMAT}.\n */\nconst OLE_FORMATS: Record<string, OleFormat> = {\n\txlsx: { contentType: OD + 'spreadsheetml.sheet', relType: PACKAGE_REL, progId: 'Excel.Sheet.12', name: 'Worksheet' },\n\txlsm: {\n\t\tcontentType: 'application/vnd.ms-excel.sheet.macroEnabled.12',\n\t\trelType: PACKAGE_REL,\n\t\tprogId: 'Excel.SheetMacroEnabled.12',\n\t\tname: 'Worksheet',\n\t},\n\tdocx: {\n\t\tcontentType: OD + 'wordprocessingml.document',\n\t\trelType: PACKAGE_REL,\n\t\tprogId: 'Word.Document.12',\n\t\tname: 'Document',\n\t},\n\tdocm: {\n\t\tcontentType: 'application/vnd.ms-word.document.macroEnabled.12',\n\t\trelType: PACKAGE_REL,\n\t\tprogId: 'Word.DocumentMacroEnabled.12',\n\t\tname: 'Document',\n\t},\n\tpptx: {\n\t\tcontentType: OD + 'presentationml.presentation',\n\t\trelType: PACKAGE_REL,\n\t\tprogId: 'PowerPoint.Show.12',\n\t\tname: 'Presentation',\n\t},\n\tpptm: {\n\t\tcontentType: 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\n\t\trelType: PACKAGE_REL,\n\t\tprogId: 'PowerPoint.ShowMacroEnabled.12',\n\t\tname: 'Presentation',\n\t},\n}\n/** Fallback for any payload that is not one of the {@link OLE_FORMATS} Office packages. */\nconst BIN_FORMAT: OleFormat = {\n\tcontentType: OD + 'oleObject',\n\trelType: OLE_OBJECT_REL,\n\tprogId: 'Package',\n\tname: 'Object',\n}\n\n/** Reverse of {@link OLE_FORMATS}: a caller-supplied `progId` implies the payload's extension. */\nconst EXTN_BY_PROG_ID = new Map(Object.entries(OLE_FORMATS).map(([extn, fmt]) => [fmt.progId.toLowerCase(), extn]))\n/** Reverse of {@link OLE_FORMATS}: a `data:` URI's MIME implies the payload's extension. */\nconst EXTN_BY_CONTENT_TYPE = new Map(\n\tObject.entries(OLE_FORMATS).map(([extn, fmt]) => [fmt.contentType.toLowerCase(), extn])\n)\n\n/**\n * Resolve the embedded part's extension from whatever the caller gave us, in decreasing order of\n * explicitness: `extn`, the `data:` URI's MIME, the `path`'s extension, then the `progId`. Anything\n * unrecognized becomes `bin`, the generic OLE blob — which is what PowerPoint itself writes for a\n * shell-packaged payload, so an unknown extension never leaks into `[Content_Types].xml`.\n */\nfunction resolvePartExtn(opt: OleObjectProps): string {\n\tconst explicit = (opt.extn || '').replace(/^\\./, '').toLowerCase()\n\tif (explicit) return explicit in OLE_FORMATS ? explicit : 'bin'\n\n\tconst mime = /^data:([^;,]+)[;,]/.exec(opt.data || '')?.[1]?.toLowerCase()\n\tconst byMime = mime ? EXTN_BY_CONTENT_TYPE.get(mime) : undefined\n\tif (byMime) return byMime\n\n\tconst file = (opt.path || '').split(/[?#]/)[0] ?? ''\n\tconst byPath = file.includes('.') ? (file.split('.').pop() ?? '').toLowerCase() : ''\n\tif (byPath in OLE_FORMATS) return byPath\n\n\treturn EXTN_BY_PROG_ID.get((opt.progId || '').toLowerCase()) ?? 'bin'\n}\n\n/**\n * Adds an embedded OLE object to a slide definition.\n * @param {PresSlideInternal} target - slide the object will be added to\n * @param {OleObjectProps} opt - OLE object options\n */\nexport function addOleObjectDefinition(target: PresSlideInternal, opt: OleObjectProps): void {\n\tconst strData = opt.data || ''\n\tconst strPath = opt.path || ''\n\n\t// STEP 1: REALITY-CHECK. The payload is the whole point; there is no meaningful default.\n\tif (!strPath && !strData) {\n\t\tthrow new InvalidOptionError('ole/missing-source', 'addOleObject(): either `data` or `path` are required!')\n\t}\n\n\t// STEP 2: Resolve the payload format — part extension, content type, rel type, progId.\n\tconst extn = resolvePartExtn(opt)\n\tconst format = OLE_FORMATS[extn] ?? BIN_FORMAT\n\tconst nameIdx = nextObjectNameIdx(target, SlideObjectType.oleObject)\n\tconst objectName = opt.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opt.objectName, 'oleObject'))\n\t\t: `Object ${nameIdx + 1}`\n\n\t// STEP 3: Register the payload part rel. Deliberately NOT deduped against an identical payload\n\t// elsewhere in the deck: PowerPoint gives every OLE object its own embedding part, and sharing\n\t// one would make editing either object rewrite the other's source.\n\tconst objectRid = getNewRelId(target)\n\tconst mediaKey = mediaSlideKey(target)\n\ttarget._relsMedia.push({\n\t\tpath: strPath || `preencoded.${extn}`,\n\t\ttype: format.contentType,\n\t\textn,\n\t\tdata: strData,\n\t\trId: objectRid,\n\t\toleRelType: format.relType,\n\t\tTarget: `../embeddings/oleObject-${mediaKey}-${target._relsMedia.length + 1}.${extn}`,\n\t})\n\n\t// STEP 4: Register the preview picture (gray placeholder when the caller supplied no cover).\n\tconst previewRid = registerPreviewImage(target, opt.cover)\n\n\t// LAST: Push the slide object for the `<p:graphicFrame>` emitter.\n\tconst slideData: SlideObject = {\n\t\t_type: SlideObjectType.oleObject,\n\t\toptions: {\n\t\t\tx: opt.x ?? 0,\n\t\t\ty: opt.y ?? 0,\n\t\t\t// The library never opens the payload, so there is no natural size to measure.\n\t\t\tw: opt.w ?? 4,\n\t\t\th: opt.h ?? 3,\n\t\t\tobjectName,\n\t\t\t...(opt.altText ? { altText: opt.altText } : {}),\n\t\t\t...(opt.objectLock ? { objectLock: opt.objectLock } : {}),\n\t\t},\n\t\tole: {\n\t\t\tobjectRid,\n\t\t\tpreviewRid,\n\t\t\tprogId: opt.progId || format.progId,\n\t\t\tname: format.name,\n\t\t\tshowAsIcon: !!opt.showAsIcon,\n\t\t\t...(typeof opt.imgW === 'number' ? { imgW: opt.imgW } : {}),\n\t\t\t...(typeof opt.imgH === 'number' ? { imgH: opt.imgH } : {}),\n\t\t},\n\t}\n\ttarget._slideObjects.push(slideData)\n}\n","/**\n * ts-pptx: table `colspan`/`rowspan` range checking.\n *\n * The spans decide two allocations, on two different paths, and both used to trust the caller:\n * the merge grid's `new Array(colspan - 1)` in `gen/slide/objects/table.ts`, and the auto-pager's\n * per-column depth array, sized from a column count that is a sum of colspans\n * (`gen/table/autopage.ts`). `new Array(4294967294).fill(undefined)` is not a slow path — V8\n * aborts on the allocation and there is no exception to catch — so a table built with\n * `autoPage: true` and one without needed the same guard, which is why it lives here rather than\n * in either of them.\n *\n * This is the write side, so the bad number comes from the calling program rather than from a\n * hostile file, which makes it far less serious than the read-side twin in the chart point caches\n * (`read/oxml/point-cache.ts`, the model this copies). It is still the project's stated line: warn\n * on out-of-range input rather than emit a degenerate result.\n */\n\nimport type { TableCell } from '../../types/index.js'\nimport { warn } from '../../diagnostics.js'\n\n/**\n * The largest `colspan`/`rowspan` this library will honour.\n *\n * Unlike the read side's point-cache ceiling there is no format number to borrow: `a:tc@gridSpan`\n * is a bare `xsd:int`. So this is a sanity bound rather than a schema one, and it is set an order\n * of magnitude past PowerPoint's own maximum table (its Insert Table dialog stops at 75 columns\n * and 75 rows), which is what makes it something no authored table can reach. What it stops is\n * the other end, where the allocation takes the host process with it.\n */\nexport const MAX_TABLE_SPAN = 1000\n\n/**\n * Validate one cell's `colspan`/`rowspan`, warning and falling back to `1` when it is not a whole\n * number in `1..MAX_TABLE_SPAN`.\n *\n * `undefined` is the common case and means \"no span\" — it warns about nothing and returns `1`.\n * Everything else is caller error: `NaN`, a negative, a fraction and a span past the ceiling all\n * describe a table that cannot be built (a fractional span silently truncates, a negative one\n * shifts every column after it, an enormous one is the allocation above).\n * @param value - the raw option value\n * @param kind - `'colspan'` or `'rowspan'`, for the diagnostic\n * @returns the span to use, at least 1\n */\nexport function resolveSpan(value: number | undefined, kind: 'colspan' | 'rowspan'): number {\n\tif (value === undefined) return 1\n\tif (!Number.isInteger(value) || value < 1 || value > MAX_TABLE_SPAN) {\n\t\twarn(\n\t\t\t'table/span-out-of-range',\n\t\t\t`table cell: ${kind} must be a whole number between 1 and ${MAX_TABLE_SPAN}; got ${String(value)}. Using 1.`\n\t\t)\n\t\treturn 1\n\t}\n\treturn value\n}\n\n/**\n * Re-clone `rows` with every out-of-range `colspan`/`rowspan` corrected to `1`.\n *\n * Runs once, up front, so the column count, the `_hmerge`/`_vmerge` dummies, the auto-pager's\n * grid and the emitted `gridSpan`/`rowSpan` attributes all read the same number — checking at\n * each of those sites instead would warn several times per bad cell and could still disagree.\n *\n * A cell whose spans are fine is passed through by identity, not copied: `_spanOrigin` links the\n * merge dummies back to the origin *object*, and the all-valid path is every real table, which\n * must stay allocation-free and byte-identical.\n * @param rows - the rows to check; row arrays are never mutated\n * @returns the same rows with only the offending cells replaced\n */\nexport function withCheckedSpans(rows: TableCell[][]): TableCell[][] {\n\treturn rows.map((cells) =>\n\t\tcells.map((cell) => {\n\t\t\tconst opts = cell?.options\n\t\t\tif (!opts) return cell\n\t\t\tconst colspan = resolveSpan(opts.colspan, 'colspan')\n\t\t\tconst rowspan = resolveSpan(opts.rowspan, 'rowspan')\n\t\t\tconst colspanOk = opts.colspan === undefined || opts.colspan === colspan\n\t\t\tconst rowspanOk = opts.rowspan === undefined || opts.rowspan === rowspan\n\t\t\tif (colspanOk && rowspanOk) return cell\n\t\t\treturn {\n\t\t\t\t...cell,\n\t\t\t\toptions: {\n\t\t\t\t\t...opts,\n\t\t\t\t\t...(opts.colspan === undefined ? {} : { colspan }),\n\t\t\t\t\t...(opts.rowspan === undefined ? {} : { rowspan }),\n\t\t\t\t},\n\t\t\t}\n\t\t})\n\t)\n}\n","/**\n * ts-pptx: Table Definition\n *\n * `addTableDefinition` applies the `headerRow` / `columns` sugar, normalizes rows into\n * fully-resolved `TableCell`s (incl. 4-side borders), computes width, and — when `autoPage` is\n * set — shreds the table across overflow slides via `getSlidesForTableRows`.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport {\n\tDEF_CELL_BORDER,\n\tDEF_CELL_MARGIN_IN,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n\tDEF_SLIDE_MARGIN_IN,\n} from '../../constants-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport type {\n\tAddSlideProps,\n\tBorderProps,\n\tPresLayout,\n\tShapeFillProps,\n\tTableCell,\n\tTableProps,\n\tTableRow,\n} from '../../types/index.js'\nimport type { PresSlideInternal, SlideLayoutInternal } from '../../types/internal.js'\nimport { getSlidesForTableRows } from '../table/autopage.js'\nimport { withCheckedSpans } from '../table/spans.js'\nimport { encodeXmlAttrValue, validateObjectName } from '../utils.js'\nimport { getSmartParseNumber } from '../../units-internal.js'\nimport { EMU_PER_INCH } from '../../units.js'\nimport { createHyperlinkRels } from './hyperlinks.js'\nimport { registerImageFillMedia } from './image.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/** A per-cell TRBL border tuple; a null side is *omitted* (inherits), not erased. */\ntype BorderTuple = [BorderProps | null, BorderProps | null, BorderProps | null, BorderProps | null]\ntype OuterBorderTuple = [BorderProps?, BorderProps?, BorderProps?, BorderProps?]\n\n/**\n * Expand a cell/table border into the 4-side tuple the rest of the pipeline expects.\n * A single `BorderProps` is broadcast to all four sides `[top, right, bottom, left]`;\n * an already-4-element `BorderTuple` passes through unchanged.\n * @param border - one border style (applied to every side) or a per-side tuple\n * @return {BorderTuple} a 4-element `[top, right, bottom, left]` tuple\n */\nfunction normalizeBorderTuple(border: BorderProps | BorderTuple): BorderTuple {\n\treturn Array.isArray(border) ? border : [border, border, border, border]\n}\n\n/** Fill a border's defaulted keys, preserving anything else the caller set (`cap`, `dashType`, …). */\nfunction withBorderDefaults(side: BorderProps): BorderProps {\n\treturn {\n\t\t...side,\n\t\ttype: side.type || DEF_CELL_BORDER.type,\n\t\tcolor: side.color || DEF_CELL_BORDER.color,\n\t\twidth: typeof side.width === 'number' ? side.width : DEF_CELL_BORDER.width,\n\t}\n}\n\n/**\n * Resolve `TableProps.outerBorder` into the `[top, right, bottom, left]` tuple the emitter\n * applies to the table's edge cells, with `undefined` for a side the caller left out.\n *\n * A sparse side is *not* the same as `{ type: 'none' }`: it means \"leave this edge to\n * whatever `border` (or the cell's own `options.border`) already drew\", whereas `'none'` is\n * an explicit instruction to erase the rule there. Keeping the hole is what lets\n * `outerBorder: [rule, undefined, rule, undefined]` add rules above and below a table\n * without also clearing its left and right edges.\n */\nfunction normalizeOuterBorder(outer: TableProps['outerBorder']): OuterBorderTuple | undefined {\n\tif (!outer || typeof outer !== 'object') return undefined\n\tconst sides: OuterBorderTuple = Array.isArray(outer) ? outer : [outer, outer, outer, outer]\n\tconst resolved = ([0, 1, 2, 3] as const).map((idx) => {\n\t\tconst side = sides[idx]\n\t\treturn side && typeof side === 'object' ? withBorderDefaults(side) : undefined\n\t}) as OuterBorderTuple\n\treturn resolved.some((side) => side !== undefined) ? resolved : undefined\n}\n\n/**\n * Adds a table object to a slide definition.\n * @param {PresSlideInternal} target - slide object that the table should be added to\n * @param {TableRow[]} tableRows - table data\n * @param {TableProps} options - table options\n * @param {SlideLayoutInternal} slideLayout - Slide layout\n * @param {PresLayout} presLayout - Presentation layout\n * @param {Function} addSlide - method\n * @param {Function} getSlide - method\n */\n/**\n * Apply the `headerRow` / `columns` inline-styling sugar: bake blanket header/column\n * formatting into per-cell options so it flows through the normal cell pipeline. Sets\n * `opt.hasHeader` when `headerRow` implies it. Returns the (possibly shallow-copied) rows.\n */\nfunction applyTableHeaderColumnSugar(tableRows: TableRow[], opt: TableProps): TableRow[] {\n\tconst hdr = opt.headerRow && typeof opt.headerRow === 'object' ? opt.headerRow : undefined\n\tconst cols = Array.isArray(opt.columns) && opt.columns.length ? opt.columns : undefined\n\tlet srcRows: TableRow[] = tableRows\n\tif ((hdr || cols) && Array.isArray(tableRows[0])) {\n\t\tif (hdr && opt.hasHeader === undefined) opt.hasHeader = true\n\t\tsrcRows = tableRows.map((row, rowIdx) => {\n\t\t\tif (!Array.isArray(row)) return row\n\t\t\t// Column-scoped defaults only apply when we actually have `columns`; the header row\n\t\t\t// alone is a cheaper positional map. Skip untouched body rows to avoid needless copies.\n\t\t\tif (!cols && rowIdx !== 0) return row\n\t\t\tlet colCursor = 0\n\t\t\treturn row.map((cell: number | string | TableCell): TableCell => {\n\t\t\t\tconst cellObj: TableCell =\n\t\t\t\t\ttypeof cell === 'string' || typeof cell === 'number'\n\t\t\t\t\t\t? { text: String(cell), options: {} }\n\t\t\t\t\t\t: { ...cell, options: { ...cell.options } }\n\t\t\t\tconst colDef = cols ? cols[colCursor] : undefined\n\t\t\t\tcolCursor += cellObj.options?.colspan || 1\n\t\t\t\tcellObj.options = {\n\t\t\t\t\t...(colDef && typeof colDef === 'object' ? colDef : {}),\n\t\t\t\t\t...(rowIdx === 0 && hdr ? hdr : {}),\n\t\t\t\t\t...cellObj.options,\n\t\t\t\t}\n\t\t\t\treturn cellObj\n\t\t\t})\n\t\t})\n\t}\n\treturn srcRows\n}\n\n/**\n * Transform loosely-typed table rows (strings / numbers / TableCell) into a grid of\n * well-formed TableCell objects with fully-resolved 4-side cell borders.\n *\n * @param srcRows - the rows as authored, after the `headerRow`/`columns` sugar\n * @param opt - the table's options\n */\nfunction normalizeTableRows(srcRows: TableRow[], opt: TableProps): TableCell[][] {\n\tconst arrRows: TableCell[][] = []\n\tsrcRows.forEach((row, idx) => {\n\t\tconst newRow: TableCell[] = []\n\n\t\tif (Array.isArray(row)) {\n\t\t\trow.forEach((cell: number | string | TableCell) => {\n\t\t\t\t// A:\n\t\t\t\tconst newCellOptions = typeof cell === 'object' && cell.options ? cell.options : {}\n\t\t\t\tconst newCell: TableCell = {\n\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\ttext: '',\n\t\t\t\t\toptions: newCellOptions,\n\t\t\t\t}\n\n\t\t\t\t// B:\n\t\t\t\tif (typeof cell === 'string' || typeof cell === 'number') newCell.text = cell.toString()\n\t\t\t\telse if (cell.text) {\n\t\t\t\t\t// Cell can contain complex text type, or string, or number\n\t\t\t\t\tif (typeof cell.text === 'string' || typeof cell.text === 'number') newCell.text = cell.text.toString()\n\t\t\t\t\telse if (cell.text) newCell.text = cell.text\n\t\t\t\t\t// Capture options\n\t\t\t\t\tif (cell.options && typeof cell.options === 'object') newCell.options = cell.options\n\t\t\t\t}\n\n\t\t\t\t// C: Set cell borders\n\t\t\t\t// A side nobody asked for is written as an explicit `{type:'none'}`. That is direct\n\t\t\t\t// formatting, so it beats any border a built-in table style would draw — which is\n\t\t\t\t// what keeps an unstyled table free of grid lines, PowerPoint's own no-style look\n\t\t\t\t// being a black hairline grid. Whatever the caller *did* author, on the cell or on\n\t\t\t\t// the table, is untouched.\n\t\t\t\t//\n\t\t\t\t// A table that names a `tableStyle` asked for that style's grid, so the default is\n\t\t\t\t// skipped there and the edges stay absent: direct formatting beats the style, and\n\t\t\t\t// filling in four no-fills erased the very thing the caller selected the style for\n\t\t\t\t// (#23). Author `border: { type: 'none' }` to erase a styled table's grid anyway.\n\t\t\t\tconst authoredBorder = newCellOptions.border || opt.border\n\t\t\t\tnewCellOptions.border =\n\t\t\t\t\tauthoredBorder ||\n\t\t\t\t\t(opt.tableStyle ? undefined : [{ type: 'none' }, { type: 'none' }, { type: 'none' }, { type: 'none' }])\n\t\t\t\tlet cellBorder = newCellOptions.border\n\n\t\t\t\t// CASE 1: border interface is: BorderOptions | [BorderOptions, BorderOptions, BorderOptions, BorderOptions]\n\t\t\t\tif (cellBorder && typeof cellBorder === 'object') {\n\t\t\t\t\tcellBorder = normalizeBorderTuple(cellBorder)\n\t\t\t\t\tnewCellOptions.border = cellBorder\n\t\t\t\t}\n\t\t\t\t// Handle: [null, null, {type:'solid'}, null]. A null side is *omitted*, not erased:\n\t\t\t\t// it keeps inheriting from the built-in style/theme, exactly the distinction\n\t\t\t\t// `normalizeOuterBorder` documents for the perimeter (\"a sparse side is NOT\n\t\t\t\t// `{ type: 'none' }`\"). Converting a hole into an explicit `<a:noFill/>` overrides\n\t\t\t\t// that inheritance and there was no spelling left for \"draw this edge, leave that one\".\n\t\t\t\t// The whole tuple is absent when a styled table authored no border at all, which is\n\t\t\t\t// the same distinction one level up: nothing to complete, nothing to emit.\n\t\t\t\tconst cellBorderTuple = newCellOptions.border as BorderTuple | undefined\n\n\t\t\t\t// set complete BorderOptions for the sides that were authored\n\t\t\t\tif (cellBorderTuple) {\n\t\t\t\t\tconst arrSides = [0, 1, 2, 3] as const\n\t\t\t\t\tarrSides.forEach((idx) => {\n\t\t\t\t\t\tconst side = cellBorderTuple[idx]\n\t\t\t\t\t\tif (!side) return\n\t\t\t\t\t\t// `withBorderDefaults` spreads first and overrides only the defaulted keys.\n\t\t\t\t\t\t// Rebuilding the side from a fixed key list dropped `cap` — public on\n\t\t\t\t\t\t// `BorderProps` and already read by `genTableCellBorderXml`, so every table\n\t\t\t\t\t\t// border emitted cap=\"flat\" whatever the caller asked for (and `dashType`\n\t\t\t\t\t\t// would go the same way). The spread also gives each side its own object,\n\t\t\t\t\t\t// which the single-BorderProps form (one object shared across all four)\n\t\t\t\t\t\t// relies on.\n\t\t\t\t\t\tcellBorderTuple[idx] = withBorderDefaults(side)\n\t\t\t\t\t})\n\t\t\t\t\tnewCellOptions.border = cellBorderTuple\n\t\t\t\t}\n\n\t\t\t\t// LAST:\n\t\t\t\tnewRow.push(newCell)\n\t\t\t})\n\t\t} else {\n\t\t\t// The same condition STEP 1 rejects for row 0, reaching us on a later row. It used to log\n\t\t\t// and push an empty row, so a deck built fine and quietly lost a row of content.\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'table/rows-not-nested',\n\t\t\t\t`addTable: 'rows' should be an array of cells! Row ${idx} is ${JSON.stringify(row)}`\n\t\t\t)\n\t\t}\n\n\t\tarrRows.push(newRow)\n\t})\n\treturn arrRows\n}\n\n/**\n * Register the slide media relationship behind every image fill this table uses, so the\n * cell emitter can resolve `<a:blipFill r:embed=\"rIdN\">` instead of warning and dropping\n * the fill. Tables were the last major object kind not wired into `registerImageFillMedia`\n * (shapes do it at `define/shape.ts`, text boxes at `define/text.ts`).\n *\n * Three fill sources are walked, which between them cover every way a picture reaches a table:\n * the resolved cells (per-cell `options.fill`, plus `headerRow` and `columns[i]`, both baked\n * onto cells by the sugar step above), the table-level `fill`, which is *not* baked —\n * `gen/slide/objects/table.ts` copies it onto each cell at emit time — and `tableFill`, which\n * lands on `a:tblPr` itself and so needs its own relationship for the same reason.\n *\n * Keyed on fill **object identity**, not on the image source. The sugar spreads its options\n * shallowly, so one `headerRow` fill object is shared by every cell it styles; registering\n * per cell would mint a redundant relationship each time and let the later call overwrite\n * the `_imgRid` the first one stashed. Two cells given separately-authored fills for the\n * same file still get one relationship each — matching how two shapes sharing an image\n * behave — while the bytes are deduped into a single media part downstream.\n *\n * Must run only after auto-paging has shredded the rows across slides, for the same reason\n * `createHyperlinkRels` does: `target` has to be the slide the cell actually lands on, or\n * every relationship piles onto the first slide.\n */\nfunction registerTableImageFills(target: PresSlideInternal, rows: TableCell[][], opt: TableProps): void {\n\tconst seen = new Set<ShapeFillProps>()\n\tconst register = (fill: ShapeFillProps | undefined): void => {\n\t\t// `type:'image'` and a bare `image:{…}` are both accepted, mirroring the shape path.\n\t\tif (!fill || typeof fill !== 'object') return\n\t\tif (fill.type !== 'image' && !fill.image) return\n\t\tif (seen.has(fill)) return\n\t\tseen.add(fill)\n\t\tregisterImageFillMedia(target, fill)\n\t}\n\n\tregister(opt.fill)\n\tregister(opt.tableFill)\n\trows.forEach((row) => {\n\t\trow.forEach((cell) => {\n\t\t\tregister(cell.options?.fill)\n\t\t})\n\t})\n}\n\nexport function addTableDefinition(\n\ttarget: PresSlideInternal,\n\ttableRows: TableRow[],\n\toptions: TableProps,\n\tslideLayout: SlideLayoutInternal | null,\n\tpresLayout: PresLayout,\n\taddSlide: (options?: AddSlideProps) => PresSlideInternal,\n\tgetSlide: (slideNumber: number) => PresSlideInternal | undefined\n): PresSlideInternal[] {\n\tconst slides: PresSlideInternal[] = [target] // Create array of Slides as more may be added by auto-paging\n\t// Take ownership of the options before touching them, the same way `addTextDefinition` does.\n\t// Everything below normalizes in place — `objectName`, `fontSize`, `margin`, `color`, the\n\t// `autoPage*` family, the resolved `w`/`colW` — and STEP 5 hands this object to every plain\n\t// string cell as that cell's options, so the cell emitters write onto it too. Without the copy\n\t// all of that lands on the CALLER's object, and a style literal reused across tables carries one\n\t// table's settings (and its `objectName`) into the next.\n\t//\n\t// Identity WITHIN one call is kept on purpose: the string cells in STEP 5 all share this one\n\t// object, which is what `gen/slide/objects/table.ts` reads back. Copying per cell would change\n\t// the emitted bytes.\n\t//\n\t// `border` is copied because the array normalization below writes `withBorderDefaults` results\n\t// back into its slots; `fill` and the cell-level objects stay shared by reference, since rel ids\n\t// are registered through them and read back at emit time.\n\tconst opt: TableProps = options && typeof options === 'object' ? { ...options } : {}\n\tif (Array.isArray(opt.border)) opt.border = [...opt.border] as typeof opt.border\n\topt.objectName = opt.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opt.objectName, 'table'))\n\t\t: `Table ${target._slideObjects.filter((obj) => obj._type === SlideObjectType.table).length}`\n\n\t// STEP 0: PLACEHOLDER — a table targeting a layout placeholder inherits that placeholder's\n\t// position/size for any of x/y/w/h the caller omits, mirroring the image and\n\t// text placeholder inheritance. Explicit values always win; this only fills the gaps so\n\t// the table fills the placeholder geometry rather than the default 1in/full-width fallback.\n\tif (opt.placeholder && slideLayout?._slideObjects) {\n\t\tconst placeHold = slideLayout._slideObjects.find(\n\t\t\t(item) => item._type === SlideObjectType.placeholder && item.options?.placeholder === opt.placeholder\n\t\t)\n\t\tif (placeHold?.options) {\n\t\t\tif (opt.x === undefined) opt.x = placeHold.options.x\n\t\t\tif (opt.y === undefined) opt.y = placeHold.options.y\n\t\t\tif (opt.w === undefined) opt.w = placeHold.options.w\n\t\t\tif (opt.h === undefined) opt.h = placeHold.options.h\n\t\t}\n\t}\n\n\t// STEP 1: REALITY-CHECK\n\t{\n\t\t// A: check for empty\n\t\tif (tableRows === null || tableRows.length === 0 || !Array.isArray(tableRows)) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'table/rows-not-an-array',\n\t\t\t\t\"addTable: Array expected! EX: 'slide.addTable( [rows], {options} );'\"\n\t\t\t)\n\t\t}\n\n\t\t// B: check for non-well-formatted array (ex: rows=['a','b'] instead of [['a','b']])\n\t\tif (!tableRows[0] || !Array.isArray(tableRows[0])) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'table/rows-not-nested',\n\t\t\t\t\"addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );'\"\n\t\t\t)\n\t\t}\n\t}\n\n\t// STEP 1.5: `headerRow` / `columns` inline sugar — bake blanket styling into cells as\n\t// direct per-cell formatting so it flows through the normal cell pipeline (incl. border\n\t// defaulting below). Precedence (highest wins), matching how PowerPoint resolves styling\n\t// (direct formatting overrides a style region): explicit per-cell `options` > `headerRow`\n\t// (row 0) > `columns[colIdx]` > `tableStyle`/defaults. The merge is property-level, so a\n\t// header cell keeps `headerRow` typography and takes its column's fill when they differ.\n\t// Setting `headerRow` implies `hasHeader` unless the caller set it explicitly. The caller's\n\t// `tableRows` array is not mutated — only affected rows (and their cells) are shallow-copied.\n\tconst srcRows = applyTableHeaderColumnSugar(tableRows, opt)\n\n\t// STEP 2: Transform `tableRows` into well-formatted TableCell's\n\t// tableRows can be object or plain text array: `[{text:'cell 1'}, {text:'cell 2', options:{color:'ff0000'}}]` | `[\"cell 1\", \"cell 2\"]`\n\t// Range-check the spans before anything reads them. Both downstream consumers size an array\n\t// from a span — the auto-pager's per-column depth array and the emitter's merge grid — and a\n\t// caller-supplied `colspan: 4294967295` aborts the process rather than throwing. Doing it here\n\t// rather than in each of them is what makes one bad cell warn once, and what keeps the paged\n\t// and unpaged paths agreeing on the grid.\n\tconst arrRows = withCheckedSpans(normalizeTableRows(srcRows, opt))\n\n\t// STEP 3: Set options\n\t// Keep x/y/w/h as raw user `Coord` (inches/percent/unit-string). They are resolved to EMU\n\t// exactly once at emission (`gen/slide/objects/table.ts`) and by the auto-pager (getSlidesForTableRows); no\n\t// pre-conversion here, so a value is never parsed twice. Default position is 0.5in.\n\tif (opt.x === undefined || opt.x === null) opt.x = 0.5\n\tif (opt.y === undefined || opt.y === null) opt.y = 0.5\n\t// NOTE: Dont set default `h` - leaving it null triggers auto-rowH in `makeXMLSlide()`\n\topt.fontSize = opt.fontSize || DEF_FONT_SIZE\n\topt.margin = opt.margin === 0 || opt.margin ? opt.margin : DEF_CELL_MARGIN_IN\n\tif (typeof opt.margin === 'number')\n\t\topt.margin = [Number(opt.margin), Number(opt.margin), Number(opt.margin), Number(opt.margin)]\n\t// defensive fallback - if `opt.margin` is not a 4-element array of finite numbers, use defaults so non-numeric table-level margins don't leak NaN into <a:tcPr>\n\tif (\n\t\t!Array.isArray(opt.margin) ||\n\t\topt.margin.length !== 4 ||\n\t\topt.margin.some((v: unknown) => typeof v !== 'number' || !Number.isFinite(v))\n\t) {\n\t\topt.margin = DEF_CELL_MARGIN_IN\n\t}\n\t// Black lands on the table and is inherited by every cell that has no colour of its own\n\t// (`gen/slide/objects/table.ts`), as direct formatting. One thing stands it down: a\n\t// hyperlink anywhere in the grid, because the default paints the whole run, so the words\n\t// *after* a link come out black instead of following the link colour. That run is then\n\t// emitted with no `<a:solidFill>` and PowerPoint resolves the text from the theme's `tx1`.\n\tif (!JSON.stringify({ arrRows }).includes('hyperlink')) {\n\t\tif (!opt.color) opt.color = DEF_FONT_COLOR // table option > inherit from Slide > default to black\n\t}\n\tif (typeof opt.border === 'string') {\n\t\twarn('table/invalid-border', \"addTable `border` option must be an object. Ex: `{border: {type:'none'}}`\")\n\t\topt.border = undefined\n\t} else if (Array.isArray(opt.border)) {\n\t\tconst border = opt.border\n\t\t;([0, 1, 2, 3] as const).forEach((idx) => {\n\t\t\tconst side = border[idx]\n\t\t\tborder[idx] = side ? withBorderDefaults(side) : { type: 'none' }\n\t\t})\n\t}\n\tif (typeof opt.outerBorder === 'string') {\n\t\twarn(\n\t\t\t'table/invalid-outer-border',\n\t\t\t\"addTable `outerBorder` option must be an object. Ex: `{outerBorder: {type:'solid'}}`\"\n\t\t)\n\t\topt.outerBorder = undefined\n\t}\n\t// The perimeter is resolved here but applied at emit time: which cells sit on the table's\n\t// outer edge is only knowable once the merge grid exists, and the serializer is what builds\n\t// it — a colspan reaching the last column puts that column's rule on a *covered* cell.\n\topt.outerBorder = normalizeOuterBorder(opt.outerBorder)\n\n\topt.autoPage = typeof opt.autoPage === 'boolean' ? opt.autoPage : false\n\topt.autoPagePlaceholder = typeof opt.autoPagePlaceholder === 'boolean' ? opt.autoPagePlaceholder : false\n\topt.autoPageRepeatHeader = typeof opt.autoPageRepeatHeader === 'boolean' ? opt.autoPageRepeatHeader : false\n\topt.autoPageHeaderRows =\n\t\ttypeof opt.autoPageHeaderRows !== 'undefined' && !isNaN(Number(opt.autoPageHeaderRows))\n\t\t\t? Number(opt.autoPageHeaderRows)\n\t\t\t: 1\n\topt.autoPageLineWeight =\n\t\ttypeof opt.autoPageLineWeight !== 'undefined' && !isNaN(Number(opt.autoPageLineWeight))\n\t\t\t? Number(opt.autoPageLineWeight)\n\t\t\t: 0\n\tif (opt.autoPageLineWeight) {\n\t\tif (opt.autoPageLineWeight > 1) opt.autoPageLineWeight = 1\n\t\telse if (opt.autoPageLineWeight < -1) opt.autoPageLineWeight = -1\n\t}\n\t// autoPage ^^^\n\n\t// Set/Calc table width\n\t// Get slide margins - start with default values, then adjust if master or slide margins exist\n\tlet arrTableMargin = DEF_SLIDE_MARGIN_IN\n\t// Master margins override the defaults, if present\n\tif (slideLayout && typeof slideLayout._margin !== 'undefined') {\n\t\tif (Array.isArray(slideLayout._margin)) arrTableMargin = slideLayout._margin\n\t\telse if (!isNaN(Number(slideLayout._margin))) {\n\t\t\tarrTableMargin = [\n\t\t\t\tNumber(slideLayout._margin),\n\t\t\t\tNumber(slideLayout._margin),\n\t\t\t\tNumber(slideLayout._margin),\n\t\t\t\tNumber(slideLayout._margin),\n\t\t\t]\n\t\t}\n\t}\n\n\t/**\n\t * Calc table width depending upon what data we have - several scenarios exist (including bad data, eg: colW doesnt match col count)\n\t * The API does not require a `w` value, but XML generation does, hence, code to calc a width below using colW value(s)\n\t */\n\tif (opt.colW) {\n\t\tconst firstRowColCnt = (arrRows[0] ?? []).reduce((totalLen, c) => {\n\t\t\tif (c?.options?.colspan && typeof c.options.colspan === 'number') {\n\t\t\t\ttotalLen += c.options.colspan\n\t\t\t} else {\n\t\t\t\ttotalLen += 1\n\t\t\t}\n\t\t\treturn totalLen\n\t\t}, 0)\n\n\t\tif (typeof opt.colW === 'string' || typeof opt.colW === 'number') {\n\t\t\t// Ex: `colW = 3` or `colW = '3'`\n\t\t\topt.w = Math.floor(Number(opt.colW) * firstRowColCnt)\n\t\t\topt.colW = undefined // IMPORTANT: Unset `colW` so table is created using `opt.w`, which will evenly divide cols\n\t\t} else if (opt.colW && Array.isArray(opt.colW) && opt.colW.length === 1 && firstRowColCnt > 1) {\n\t\t\t// Ex: `colW=[3]` but with >1 cols (same as above, user is saying \"use this width for all\")\n\t\t\topt.w = Math.floor(Number(opt.colW) * firstRowColCnt)\n\t\t\topt.colW = undefined // IMPORTANT: Unset `colW` so table is created using `opt.w`, which will evenly divide cols\n\t\t} else if (opt.colW && Array.isArray(opt.colW) && opt.colW.length !== firstRowColCnt) {\n\t\t\t// Err: Mismatched colW and cols count\n\t\t\twarn(\n\t\t\t\t'table/col-width-count-mismatch',\n\t\t\t\t'addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths.'\n\t\t\t)\n\t\t\topt.colW = undefined\n\t\t}\n\t} else if (opt.w) {\n\t\t// Keep raw user `Coord` — resolved to EMU once at emission. (No pre-conversion.)\n\t} else {\n\t\topt.w = Math.floor((presLayout._sizeW || presLayout.width) / EMU_PER_INCH - arrTableMargin[1] - arrTableMargin[3])\n\t}\n\n\t// Shrink-to-fit (`fitColumns: 'shrink'`): proportionally scale columns down so a\n\t// too-wide table fits between `x` and the right slide margin. Runs after the width-calc\n\t// above so it sees the resolved form — either a surviving per-column `colW` array, or a\n\t// single `w`. Rewriting the widths here (the table definition) means both the emitter and\n\t// the measured-fit pass inherit the fitted grid; shrink only, no minimum-width floor.\n\tif (opt.fitColumns === 'shrink') {\n\t\tconst slideWin = (presLayout._sizeW || presLayout.width) / EMU_PER_INCH\n\t\tconst xIn = getSmartParseNumber(opt.x, 'X', presLayout) / EMU_PER_INCH\n\t\t// `arrTableMargin` is TRBL, so the margin to the RIGHT of the table is index 1. This\n\t\t// read index 3 (the left margin) — invisible with the default symmetric [0.5 × 4], and\n\t\t// wrong by the difference for any master whose `_margin` is asymmetric, which is\n\t\t// exactly the layout a caller sets a left gutter on.\n\t\tconst availWin = slideWin - xIn - arrTableMargin[1]\n\t\tif (availWin > 0) {\n\t\t\tif (Array.isArray(opt.colW)) {\n\t\t\t\tconst sumIn = opt.colW.reduce((p, n) => p + (Number.isFinite(n) ? n : 0), 0)\n\t\t\t\tif (sumIn > availWin) {\n\t\t\t\t\tconst factor = availWin / sumIn\n\t\t\t\t\topt.colW = opt.colW.map((n) => (Number.isFinite(n) ? n * factor : n))\n\t\t\t\t\topt.w = availWin\n\t\t\t\t}\n\t\t\t} else if (typeof opt.w === 'number' && opt.w > availWin) {\n\t\t\t\topt.w = availWin\n\t\t\t}\n\t\t}\n\t}\n\n\t// STEP 5: Loop over cells: transform each to TableCell; check to see whether to unset `autoPage` while here\n\tarrRows.forEach((row) => {\n\t\trow.forEach((cell, idy) => {\n\t\t\t// A: Transform cell data if needed\n\t\t\t/* Table rows can be an object or plain text - transform into object when needed\n\t\t\t\t// EX:\n\t\t\t\tconst arrTabRows1 = [\n\t\t\t\t\t[ { text:'A1\\nA2', options:{rowspan:2, fill:'99FFCC'} } ]\n\t\t\t\t\t,[ 'B2', 'C2', 'D2', 'E2' ]\n\t\t\t\t]\n\t\t\t*/\n\t\t\tif (typeof cell === 'number' || typeof cell === 'string') {\n\t\t\t\t// Grab table formatting `opts` to use here so text style/format inherits as it should\n\t\t\t\trow[idy] = { _type: SlideObjectType.tablecell, text: String(row[idy]), options: opt }\n\t\t\t} else if (typeof cell === 'object') {\n\t\t\t\tconst target = row[idy]\n\t\t\t\tif (!target) return\n\t\t\t\t// ARG0: `text` (numeric input was already coerced to a string in the first pass)\n\t\t\t\tif (typeof cell.text === 'undefined' || cell.text === null) target.text = ''\n\n\t\t\t\t// ARG1: `options`: ensure options exists\n\t\t\t\ttarget.options = cell.options || {}\n\n\t\t\t\t// Set type to tabelcell\n\t\t\t\ttarget._type = SlideObjectType.tablecell\n\t\t\t}\n\n\t\t\t// B: Check for fine-grained formatting, disable auto-page when found\n\t\t\t// Since genXmlTextBody already checks for text array ( text:[{},..{}] ) we're done!\n\t\t\t// Text in individual cells will be formatted as they are added by calls to genXmlTextBody within table builder\n\t\t})\n\t})\n\n\t// If autoPage = true, we need to return references to newly created slides if any\n\tconst newAutoPagedSlides: PresSlideInternal[] = []\n\n\t// STEP 6: Auto-Paging: (via {options} and used internally)\n\t// (used internally by `tableToSlides()` to not engage recursion - we've already paged the table data, just add this one)\n\tif (opt && !opt.autoPage) {\n\t\t// Create hyperlink rels (IMPORTANT: Wait until table has been shredded across Slides or all rels will end-up on Slide 1!)\n\t\tcreateHyperlinkRels(target, arrRows)\n\n\t\t// Same timing rule as the hyperlink rels above: resolve cell image fills to media rels\n\t\t// on the slide this table actually landed on.\n\t\tregisterTableImageFills(target, arrRows, opt)\n\n\t\t// Add slideObjects (NOTE: Use `extend` to avoid mutation)\n\t\t// `columns` (per-column TableCellProps[]) is consumed in STEP 1.5 and baked into cells;\n\t\t// drop it here so it is not carried into `ObjectOptions`, where `columns` is the unrelated\n\t\t// text-column *count* (`number`). Leaving it in would be both meaningless and a type clash.\n\t\ttarget._slideObjects.push({\n\t\t\t_type: SlideObjectType.table,\n\t\t\tarrTabRows: arrRows,\n\t\t\toptions: { ...opt, columns: undefined },\n\t\t})\n\t} else {\n\t\tif (opt.autoPageRepeatHeader)\n\t\t\topt._arrObjTabHeadRows = arrRows.filter((_row, idx) => idx < (opt.autoPageHeaderRows || 1))\n\n\t\t// snapshot populated placeholders on the source slide (e.g. a title added via\n\t\t// `addText(text, { placeholder })`) so they can be re-rendered on each overflow slide.\n\t\t// Overflow slides otherwise inherit only the layout's empty placeholders. Captured before\n\t\t// the loop so the table object added per-slide below is never included.\n\t\tconst sourcePlaceholders =\n\t\t\topt.autoPagePlaceholder && Array.isArray(target._slideObjects)\n\t\t\t\t? target._slideObjects.filter((obj) => obj._type !== SlideObjectType.table && obj.options?.placeholder)\n\t\t\t\t: []\n\n\t\t// Loop over rows and create 1-N tables as needed\n\t\tgetSlidesForTableRows(arrRows, opt, presLayout, slideLayout).forEach((slide, idx) => {\n\t\t\t// A: Create new Slide when needed, otherwise, use existing (NOTE: More than 1 table can be on a Slide, so we will go up AND down the Slide chain)\n\t\t\tlet newSlide = getSlide(target._slideNum + idx)\n\t\t\tif (!newSlide) {\n\t\t\t\tnewSlide = addSlide({ masterTitle: slideLayout?._name || undefined })\n\t\t\t\tslides.push(newSlide)\n\t\t\t}\n\n\t\t\t// B: Reset opt.y to `option`/`margin` after first Slide\n\t\t\t// Keep raw inches — resolved to EMU once at emission. (No pre-conversion.)\n\t\t\tif (idx > 0) opt.y = opt.autoPageSlideStartY || arrTableMargin[0]\n\n\t\t\t// C: Add this table to new Slide\n\t\t\t{\n\t\t\t\topt.autoPage = false\n\n\t\t\t\t// copy the source slide's populated placeholders onto each overflow slide\n\t\t\t\t// (idx 0 is the source slide itself and already has them).\n\t\t\t\tif (idx > 0 && sourcePlaceholders.length > 0) {\n\t\t\t\t\tsourcePlaceholders.forEach((ph) => newSlide._slideObjects.push(structuredClone(ph)))\n\t\t\t\t}\n\n\t\t\t\t// Create hyperlink rels (IMPORTANT: Wait until table has been shredded across Slides or all rels will end-up on Slide 1!)\n\t\t\t\tcreateHyperlinkRels(newSlide, slide.rows)\n\n\t\t\t\t// Add rows to new slide. When `rowH` is an array it is keyed by *original* row index,\n\t\t\t\t// which no longer matches the per-slide physical row order after pagination; use the\n\t\t\t\t// per-slide heights the auto-pager resolved so each row keeps its configured height\n\t\t\t\t// instead of inheriting whatever row lands at the same index.\n\t\t\t\t// `slide.rowH` may contain `undefined` holes (auto-height rows); the table serializer\n\t\t\t\t// treats a falsy per-row height as \"auto\", so the cast to number[] is safe.\n\t\t\t\tnewSlide.addTable(slide.rows, {\n\t\t\t\t\t...opt,\n\t\t\t\t\trowH: Array.isArray(opt.rowH) && slide.rowH ? (slide.rowH as number[]) : opt.rowH,\n\t\t\t\t})\n\n\t\t\t\t// Add reference to the new slide so it can be returned, but don't add the first one because the user already has a reference to that one.\n\t\t\t\tif (idx > 0) newAutoPagedSlides.push(newSlide)\n\t\t\t}\n\t\t})\n\t}\n\treturn newAutoPagedSlides\n}\n","/**\n * ts-pptx: Zoom Definition (Slide / Section / Summary Zoom — Insert ▸ Zoom).\n *\n * Resolves a zoom's target(s) to the ids the emitter needs (`sldId` / section GUID), registers\n * the preview-image media rel and the `.../slide` fallback rel(s), lays out the Summary Zoom grid,\n * and pushes a `SlideObject{ _type: zoom, zoom }` for `gen/slide/objects/zoom.ts` to emit as a\n * `<p:graphicFrame>`. See {@link ../../types/zoom} for the preview-image behavior.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport { warn } from '../../diagnostics.js'\nimport type { SectionZoomProps, SlideZoomProps, SummaryZoomProps } from '../../types/zoom.js'\nimport type {\n\tPresSlideInternal,\n\tSectionInternalProps,\n\tSlideObject,\n\tZoomInternal,\n\tZoomTileInternal,\n} from '../../types/internal.js'\nimport { encodeXmlAttrValue, getNewRelId, getUuid, validateObjectName } from '../utils.js'\nimport { getSmartParseNumber } from '../../units-internal.js'\nimport { nextObjectNameIdx } from './object-name.js'\nimport { registerPreviewImage } from './preview-image.js'\n\nconst ZOOM_LABEL = { slide: 'Slide Zoom', section: 'Section Zoom', summary: 'Summary Zoom' } as const\n\n/** A fresh, braced, upper-case v4 GUID for a `zmPr@id`. */\nfunction zoomGuid(): string {\n\treturn `{${getUuid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase()}}`\n}\n\n/** Register a `.../slide` rel (used by the fallback picture's `hlinkClick`) to a 1-based slide number. */\nfunction registerSlideRel(target: PresSlideInternal, slideNum: number): number {\n\tconst rId = getNewRelId(target)\n\ttarget._rels.push({ type: SlideObjectType.hyperlink, data: 'slide', rId, Target: String(slideNum) })\n\treturn rId\n}\n\n/** Shared object-name + object-scaffold for all three variants. */\nfunction pushZoomObject(\n\ttarget: PresSlideInternal,\n\tvariant: ZoomInternal['variant'],\n\topts: SlideZoomProps | SectionZoomProps | SummaryZoomProps,\n\tzoom: Omit<ZoomInternal, 'variant'>\n): void {\n\tconst nameIdx = nextObjectNameIdx(target, SlideObjectType.zoom)\n\tconst objectName = opts.objectName\n\t\t? encodeXmlAttrValue(validateObjectName(opts.objectName, 'zoom'))\n\t\t: `${ZOOM_LABEL[variant]} ${nameIdx + 1}`\n\tconst newObject: SlideObject = {\n\t\t_type: SlideObjectType.zoom,\n\t\toptions: {\n\t\t\tx: opts.x ?? 0,\n\t\t\ty: opts.y ?? 0,\n\t\t\tw: opts.w ?? 0,\n\t\t\th: opts.h ?? 0,\n\t\t\tobjectName,\n\t\t\t...(opts.objectLock ? { objectLock: opts.objectLock } : {}),\n\t\t},\n\t\tzoom: { variant, ...zoom },\n\t}\n\ttarget._slideObjects.push(newObject)\n}\n\n/** Slide Zoom — one tile linking to a single target slide. */\nexport function addSlideZoomDefinition(target: PresSlideInternal, opts: SlideZoomProps): void {\n\tif (!opts?.target) {\n\t\twarn(\n\t\t\t'zoom/missing-target',\n\t\t\t'addSlideZoom requires a `target` slide (a Slide object or its 1-based number); ignoring.'\n\t\t)\n\t\treturn\n\t}\n\tconst targetSlide = opts.target as PresSlideInternal\n\tconst sldId = typeof opts.target === 'number' ? 256 + (opts.target - 1) : targetSlide._slideId\n\tconst slideNum = typeof opts.target === 'number' ? opts.target : targetSlide._slideNum\n\tif (sldId == null || slideNum == null) {\n\t\twarn('zoom/unresolved-target', 'addSlideZoom: could not resolve the target slide; ignoring.')\n\t\treturn\n\t}\n\n\tconst previewRid = registerPreviewImage(target, opts.coverImage)\n\tconst fallbackSlideRid = registerSlideRel(target, slideNum)\n\tconst tile: ZoomTileInternal = { sldId, previewRid, fallbackSlideRid, zmPrId: zoomGuid() }\n\tpushZoomObject(target, 'slide', opts, {\n\t\ttiles: [tile],\n\t\treturnToParent: !!opts.returnToParent,\n\t\ttransitionDur: opts.transitionDur ?? 1000,\n\t})\n}\n\n/** Section Zoom — one tile linking to the start of a named section. */\nexport function addSectionZoomDefinition(\n\ttarget: PresSlideInternal,\n\topts: SectionZoomProps,\n\tsections: SectionInternalProps[]\n): void {\n\tif (!opts?.sectionTitle) {\n\t\twarn('zoom/missing-section-title', 'addSectionZoom requires a `sectionTitle`; ignoring.')\n\t\treturn\n\t}\n\tconst section = sections.find((s) => s.title === opts.sectionTitle)\n\tif (!section) {\n\t\twarn('zoom/section-not-found', `addSectionZoom: no section titled \"${opts.sectionTitle}\"; ignoring.`)\n\t\treturn\n\t}\n\tconst firstSlide = section._slides[0]\n\tif (!firstSlide) {\n\t\twarn('zoom/section-empty', `addSectionZoom: section \"${opts.sectionTitle}\" has no slides; ignoring.`)\n\t\treturn\n\t}\n\n\tconst previewRid = registerPreviewImage(target, opts.coverImage)\n\tconst fallbackSlideRid = registerSlideRel(target, firstSlide._slideNum)\n\tconst tile: ZoomTileInternal = { sectionId: section._id, previewRid, fallbackSlideRid, zmPrId: zoomGuid() }\n\tpushZoomObject(target, 'section', opts, {\n\t\ttiles: [tile],\n\t\treturnToParent: !!opts.returnToParent,\n\t\ttransitionDur: opts.transitionDur ?? 1000,\n\t})\n}\n\n/**\n * Summary Zoom — a grid of tiles, one per section (excluding the host slide's own section).\n * All tiles share the single placeholder/cover image; each links to its section's first slide.\n */\nexport function addSummaryZoomDefinition(\n\ttarget: PresSlideInternal,\n\topts: SummaryZoomProps,\n\tsections: SectionInternalProps[]\n): void {\n\t// Exclude the section that contains this (host) slide — a summary does not link to itself.\n\tconst hostSection = sections.find((s) => s._slides.some((sl) => sl._slideNum === target._slideNum))\n\tconst targets = sections.filter((s) => s !== hostSection && s._slides.length > 0)\n\tif (targets.length === 0) {\n\t\twarn(\n\t\t\t'zoom/no-sections-to-summarize',\n\t\t\t'addSummaryZoom: no sections to summarize (need at least one section besides this slide’s own); ignoring.'\n\t\t)\n\t\treturn\n\t}\n\n\t// Grid geometry (EMU). Tiles preserve the slide aspect ratio; the grid is centered in the frame,\n\t// last row left-aligned (matching PowerPoint). See the Summary oracle in plan `foamy-imagining-narwhal`.\n\tconst frameCx = getSmartParseNumber(opts.w ?? 0, 'X', target._presLayout)\n\tconst frameCy = getSmartParseNumber(opts.h ?? 0, 'Y', target._presLayout)\n\tconst ar = target._presLayout.width / target._presLayout.height\n\tconst n = targets.length\n\tconst cols = Math.ceil(Math.sqrt(n))\n\tconst rows = Math.ceil(n / cols)\n\tconst gap = Math.round(frameCx * 0.0124)\n\tlet tileW = (frameCx - (cols - 1) * gap) / cols\n\tlet tileH = tileW / ar\n\tconst tileHFit = (frameCy - (rows - 1) * gap) / rows\n\tif (tileH > tileHFit) {\n\t\ttileH = tileHFit\n\t\ttileW = tileH * ar\n\t}\n\ttileW = Math.round(tileW)\n\ttileH = Math.round(tileH)\n\tconst gridW = cols * tileW + (cols - 1) * gap\n\tconst gridH = rows * tileH + (rows - 1) * gap\n\tconst originX = Math.round((frameCx - gridW) / 2)\n\tconst originY = Math.round((frameCy - gridH) / 2)\n\n\t// One shared preview image across all tiles (identical placeholder/cover).\n\tconst previewRid = registerPreviewImage(target, opts.coverImage)\n\tconst tiles: ZoomTileInternal[] = []\n\ttargets.forEach((section, i) => {\n\t\tconst firstSlide = section._slides[0]\n\t\tif (!firstSlide) return // guarded above (length > 0), but keeps the emit total-function\n\t\tconst r = Math.floor(i / cols)\n\t\tconst c = i % cols\n\t\ttiles.push({\n\t\t\tsectionId: section._id,\n\t\t\tpreviewRid,\n\t\t\tfallbackSlideRid: registerSlideRel(target, firstSlide._slideNum),\n\t\t\tzmPrId: zoomGuid(),\n\t\t\tgrid: { x: originX + c * (tileW + gap), y: originY + r * (tileH + gap), cx: tileW, cy: tileH },\n\t\t})\n\t})\n\n\tpushZoomObject(target, 'summary', opts, {\n\t\ttiles,\n\t\treturnToParent: !!opts.returnToParent,\n\t\ttransitionDur: opts.transitionDur ?? 1000,\n\t})\n}\n","/**\n * ts-pptx: SlideBuilder — write-side implementation of the public `Slide` interface\n */\n\nimport type { CHART_NAME, SHAPE_NAME } from './enums.js'\nimport type {\n\tAddSlideProps,\n\tAnimationProps,\n\tBackgroundProps,\n\tCommentProps,\n\tConnectorProps,\n\tGroupChildProps,\n\tGroupProps,\n\tHexColor,\n\tChartMulti,\n\tChartOpts,\n\tSlideComment,\n\tImageProps,\n\tMediaProps,\n\tModel3dProps,\n\tNotesProps,\n\tOleObjectProps,\n\tPresLayout,\n\tShapeProps,\n\tSlideNumberProps,\n\tSlideObjectInfo,\n\tOptsChartData,\n\tTableProps,\n\tTableRow,\n\tTextProps,\n\tTextPropsOptions,\n\tTransitionProps,\n\tSlideZoomProps,\n\tSectionZoomProps,\n\tSummaryZoomProps,\n} from './types/index.js'\nimport type { Slide } from './types/slide.js'\nimport type {\n\tSlideObject,\n\tSlideRel,\n\tSlideRelChart,\n\tSlideRelMedia,\n\tPresSlideInternal,\n\tSlideLayoutInternal,\n\tSectionInternalProps,\n} from './types/internal.js'\nimport { emuToInches } from './units.js'\nimport { decodeXmlAttrValue } from './gen/utils.js'\nimport { InvalidOptionError } from './errors.js'\nimport { addBackgroundDefinition } from './gen/define/background.js'\nimport { addChartDefinition } from './gen/define/chart.js'\nimport { addCommentDefinition } from './gen/define/comment.js'\nimport { addConnectorDefinition } from './gen/define/connector.js'\nimport { addGroupDefinition, groupObjectsDefinition, isGroupableObject } from './gen/define/group.js'\nimport { addImageDefinition } from './gen/define/image.js'\nimport { addMediaDefinition } from './gen/define/media.js'\nimport { addModel3dDefinition } from './gen/define/model3d.js'\nimport { addNotesDefinition } from './gen/define/notes.js'\nimport { addOleObjectDefinition } from './gen/define/ole.js'\nimport { addShapeDefinition } from './gen/define/shape.js'\nimport { addTableDefinition } from './gen/define/table.js'\nimport { addTextDefinition } from './gen/define/text.js'\nimport { addSectionZoomDefinition, addSlideZoomDefinition, addSummaryZoomDefinition } from './gen/define/zoom.js'\n\n/**\n * Project one authored render-object onto the public {@link SlideObjectInfo}, recursing into a\n * group's children.\n *\n * The name is decoded on the way out. Every `add*Definition` stores it attribute-escaped, and\n * `groupObjects()` escapes the caller's spelling before it compares, so handing the stored form\n * back would escape it twice and resolve nothing — the same mismatch that once made `groupObjects`\n * throw for an object plainly on the slide, arriving from the other direction.\n *\n * Every `add*Definition` also *generates* a name when the caller passed none, so the fallback below\n * is unreachable through the public API. It is there because the field is typed non-optional\n * internally only by convention, and an empty name would otherwise read back as `undefined` from a\n * surface that promises a string.\n */\nfunction toSlideObjectInfo(obj: SlideObject): SlideObjectInfo {\n\tconst stored = obj.options?.objectName\n\treturn {\n\t\ttype: obj._type,\n\t\tobjectName: typeof stored === 'string' && stored.length > 0 ? decodeXmlAttrValue(stored) : '',\n\t\tisPlaceholder: !!obj.options?.placeholder,\n\t\tcanGroup: isGroupableObject(obj),\n\t\tchildren: (obj._groupObjects ?? []).map(toSlideObjectInfo),\n\t}\n}\n\n/** Distinguish a multi-type (combo) chart array (`ChartMulti[]`) from a single chart's data (`OptsChartData[]`). */\nfunction isMultiChart(arg: OptsChartData[] | ChartMulti[]): arg is ChartMulti[] {\n\tconst first = arg[0] as Partial<ChartMulti> | undefined\n\treturn !!first && typeof first === 'object' && 'type' in first && 'data' in first\n}\n\nexport default class SlideBuilder {\n\tprivate readonly _setSlideNum: (value: SlideNumberProps) => void\n\n\tpublic addSlide: (options?: AddSlideProps) => PresSlideInternal\n\tpublic getSlide: (slideNum: number) => PresSlideInternal | undefined\n\tpublic getSections: () => SectionInternalProps[]\n\tpublic _name: string\n\tpublic _presLayout: PresLayout\n\tpublic _rels: SlideRel[]\n\tpublic _relsChart: SlideRelChart[]\n\tpublic _relsMedia: SlideRelMedia[]\n\tpublic _rId: number\n\tpublic _slideId: number\n\tpublic _slideLayout: SlideLayoutInternal | null\n\tpublic _slideNum: number\n\tpublic _slideNumberProps: SlideNumberProps | null\n\tpublic _slideObjects: SlideObject[]\n\tpublic _comments: SlideComment[] = []\n\tpublic _newAutoPagedSlides: PresSlideInternal[] = []\n\tpublic _animations: AnimationProps[] = []\n\n\tconstructor(params: {\n\t\taddSlide: (options?: AddSlideProps) => PresSlideInternal\n\t\tgetSlide: (slideNum: number) => PresSlideInternal | undefined\n\t\tgetSections?: () => SectionInternalProps[]\n\t\tpresLayout: PresLayout\n\t\tsetSlideNum: (value: SlideNumberProps) => void\n\t\tslideId: number\n\t\tslideRId: number\n\t\tslideNumber: number\n\t\tslideLayout?: SlideLayoutInternal\n\t}) {\n\t\tthis.addSlide = params.addSlide\n\t\tthis.getSlide = params.getSlide\n\t\tthis.getSections = params.getSections ?? (() => [])\n\t\tthis._name = `Slide ${params.slideNumber}`\n\t\tthis._presLayout = params.presLayout\n\t\tthis._rId = params.slideRId\n\t\tthis._rels = []\n\t\tthis._relsChart = []\n\t\tthis._relsMedia = []\n\t\tthis._setSlideNum = params.setSlideNum\n\t\tthis._slideId = params.slideId\n\t\tthis._slideLayout = params.slideLayout || null\n\t\tthis._slideNum = params.slideNumber\n\t\tthis._slideObjects = []\n\t\t/** NOTE: Slide Numbers: In order for Slide Numbers to function they need to be in all 3 files: master/layout/slide\n\t\t * `defineSlideMaster` and `addNewSlide.slideNumber` will add {slideNumber} to `this.masterSlide` and `this.slideLayouts`\n\t\t * so, lastly, add to the Slide now.\n\t\t */\n\t\tthis._slideNumberProps = this._slideLayout?._slideNumberProps ? this._slideLayout._slideNumberProps : null\n\t}\n\n\t/**\n\t * Background color or image\n\t * @type {BackgroundProps}\n\t * @example solid color `background: { color:'FF0000' }`\n\t * @example color+trans `background: { color:'FF0000', transparency:0.5 }`\n\t * @example base64 `background: { data:'image/png;base64,ABC[...]123' }`\n\t * @example url `background: { path:'https://some.url/image.jpg'}`\n\t */\n\tprivate _background?: BackgroundProps\n\tpublic set background(props: BackgroundProps) {\n\t\tthis._background = props\n\t\t// Add background (image data/path must be captured before the package is built)\n\t\tif (props) addBackgroundDefinition(props, this)\n\t}\n\n\tpublic get background(): BackgroundProps | undefined {\n\t\treturn this._background\n\t}\n\n\t/**\n\t * Default font color\n\t * @type {HexColor}\n\t */\n\tprivate _color?: HexColor\n\tpublic set color(value: HexColor) {\n\t\tthis._color = value\n\t}\n\n\tpublic get color(): HexColor | undefined {\n\t\treturn this._color\n\t}\n\n\t/**\n\t * @type {boolean}\n\t */\n\tprivate _hidden = false\n\tpublic set hidden(value: boolean) {\n\t\tthis._hidden = value\n\t}\n\n\tpublic get hidden(): boolean {\n\t\treturn this._hidden\n\t}\n\n\t/**\n\t * Slide-show transition (`p:transition`) played when advancing to this slide.\n\t * @type {TransitionProps}\n\t */\n\tprivate _transition?: TransitionProps\n\tpublic set transition(value: TransitionProps | undefined) {\n\t\tthis._transition = value\n\t}\n\n\tpublic get transition(): TransitionProps | undefined {\n\t\treturn this._transition\n\t}\n\n\t/**\n\t * @type {SlideNumberProps}\n\t */\n\tpublic set slideNumber(value: SlideNumberProps) {\n\t\t// NOTE: Slide Numbers: In order for Slide Numbers to function they need to be in all 3 files: master/layout/slide\n\t\tthis._slideNumberProps = value\n\t\tthis._setSlideNum(value)\n\t}\n\n\tpublic get slideNumber(): SlideNumberProps | undefined {\n\t\treturn this._slideNumberProps ?? undefined\n\t}\n\n\tpublic get newAutoPagedSlides(): Slide[] {\n\t\treturn this._newAutoPagedSlides\n\t}\n\n\t/**\n\t * The objects authored on this slide so far, bottom-to-top in z-order.\n\t *\n\t * Built fresh on every access rather than cached: the underlying list is mutated in place by\n\t * `addGroup`/`groupObjects` as well as appended to, so a cache would have to be invalidated from\n\t * every authoring path and would go stale the first time one was added without remembering.\n\t * Building it costs a walk of a list a slide-sized deck keeps in the dozens.\n\t */\n\tpublic get objects(): readonly SlideObjectInfo[] {\n\t\treturn this._slideObjects.map(toSlideObjectInfo)\n\t}\n\n\t/** Slide width in inches (resolved from the active presentation layout). */\n\tpublic get width(): number {\n\t\treturn emuToInches(this._presLayout.width)\n\t}\n\n\t/** Slide height in inches (resolved from the active presentation layout). */\n\tpublic get height(): number {\n\t\treturn emuToInches(this._presLayout.height)\n\t}\n\n\t/**\n\t * Add chart to Slide\n\t * @param {OptsChartData[]} data - chart data\n\t * @param {ChartOpts & { type: CHART_NAME }} options - chart options; `type` is required here\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddChart(data: OptsChartData[], options: ChartOpts & { type: CHART_NAME }): SlideBuilder\n\t/**\n\t * Add a multi-type (combo) chart to Slide\n\t * @param {ChartMulti[]} charts - per-type chart definitions (each carries its own `type`/`data`)\n\t * @param {ChartOpts} options - shared chart options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddChart(charts: ChartMulti[], options?: ChartOpts): SlideBuilder\n\taddChart(arg1: OptsChartData[] | ChartMulti[], arg2?: ChartOpts & { type?: CHART_NAME }): SlideBuilder {\n\t\tlet type: CHART_NAME | ChartMulti[]\n\t\tlet data: OptsChartData[]\n\t\tlet options: ChartOpts\n\n\t\tif (Array.isArray(arg1) && isMultiChart(arg1)) {\n\t\t\t// Multi-type (combo) chart: addChart(ChartMulti[], options?)\n\t\t\ttype = arg1\n\t\t\tdata = []\n\t\t\toptions = arg2 ?? {}\n\t\t} else {\n\t\t\t// Canonical single-type form: addChart(data, { type, ...options })\n\t\t\tdata = arg1 ?? []\n\t\t\toptions = arg2 ?? {}\n\t\t\tconst optType = (options as ChartOpts & { type?: CHART_NAME }).type\n\t\t\tif (!optType) {\n\t\t\t\tthrow new InvalidOptionError(\n\t\t\t\t\t'chart/missing-type',\n\t\t\t\t\t'addChart: a chart `type` is required on the options object, e.g. addChart(data, { type: ChartType.bar }).'\n\t\t\t\t)\n\t\t\t}\n\t\t\ttype = optType\n\t\t}\n\n\t\t// `_type` is set by `addChartDefinition` on its own copy of the options — stamping it here\n\t\t// too would write an internal field onto the caller's object for no gain.\n\t\t// addChartDefinition's multi-type branch reads the shared options from its `data` slot\n\t\tif (Array.isArray(type)) {\n\t\t\taddChartDefinition(this, type, options, undefined)\n\t\t} else {\n\t\t\taddChartDefinition(this, type, data, options)\n\t\t}\n\t\treturn this\n\t}\n\n\t/**\n\t * Add image to Slide\n\t * @param {ImageProps} options - image options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddImage(options: ImageProps): SlideBuilder {\n\t\taddImageDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add media (audio/video) to Slide\n\t * @param {MediaProps} options - media options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddMedia(options: MediaProps): SlideBuilder {\n\t\taddMediaDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add an embedded OLE object (PowerPoint's Insert ▸ Object ▸ Create from File) to the Slide.\n\t *\n\t * The payload's bytes ship inside the `.pptx`, so a double-click in PowerPoint opens the source\n\t * document in place. Supply a `cover` screenshot for what the slide shows; without one a neutral\n\t * gray placeholder is embedded (PowerPoint draws the live object over it, other consumers do not).\n\t * @param {OleObjectProps} options - OLE object options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addOleObject({ path: 'budget.xlsx', cover: { path: 'budget.png' }, x: 1, y: 1, w: 6, h: 3 })\n\t */\n\taddOleObject(options: OleObjectProps): SlideBuilder {\n\t\taddOleObjectDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add an embedded 3D model (PowerPoint's Insert ▸ 3D Models) to the Slide.\n\t *\n\t * The `.glb` bytes ship inside the `.pptx`, so PowerPoint 2019+ renders the model live and lets\n\t * the viewer orbit it. Everything else — older PowerPoint, thumbnails, PDF export — draws the\n\t * `preview` picture instead; without one a neutral gray placeholder is embedded.\n\t *\n\t * Most models also need `meterPerModelUnit`: ts-pptx does not parse the `.glb`, so it cannot\n\t * measure the bounding box PowerPoint would have scaled the scene by. Set it to\n\t * `1 / <largest bounding-box dimension in model units>`.\n\t * @param {Model3dProps} options - 3D model options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addModel3d({ path: 'engine.glb', preview: { path: 'engine.png' }, x: 1, y: 1, w: 6, h: 4 })\n\t */\n\taddModel3d(options: Model3dProps): SlideBuilder {\n\t\taddModel3dDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add speaker notes to Slide\n\t * @param {string | NotesProps | NotesProps[]} notes - notes text, or rich runs with inline\n\t * formatting / hyperlinks. A plain string is the single-run case; pass run objects to add\n\t * hyperlinks (external `url` only) or per-run bold/italic/underline/color/fontSize/fontFace.\n\t * @example slide.addNotes('Remember to smile')\n\t * @example slide.addNotes([{ text: 'See ' }, { text: 'the docs', options: { hyperlink: { url: 'https://example.com/' } } }])\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddNotes(notes: string | NotesProps | NotesProps[]): SlideBuilder {\n\t\taddNotesDefinition(this, notes)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a review comment to the Slide (legacy PowerPoint comment).\n\t * Comments by the same author (name + initials) are grouped under one author entry in the deck.\n\t * @param {CommentProps} options - comment author, text, and optional marker position/date\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addComment({ author: 'Ada Lovelace', text: 'Tighten this headline', x: 1, y: 0.5 })\n\t */\n\taddComment(options: CommentProps): SlideBuilder {\n\t\taddCommentDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add shape to Slide\n\t * @param {SHAPE_NAME} shapeName - shape name\n\t * @param {ShapeProps} options - shape options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddShape(shapeName: SHAPE_NAME, options?: ShapeProps): SlideBuilder {\n\t\t// `shapeName` is a plain string preset name (e.g. `ShapeType.rect` === \"rect\").\n\t\taddShapeDefinition(this, shapeName, options || {})\n\t\treturn this\n\t}\n\n\t/**\n\t * Group slide objects into a single PowerPoint group (`<p:grpSp>`).\n\t *\n\t * Children keep their slide-absolute `x/y/w/h` (identity child coordinate space at every depth),\n\t * and the objects become one selectable/movable group in PowerPoint. A `group` child nests\n\t * another group. The group's frame is all-or-nothing: pass all four of `options.x/y/w/h`, or none\n\t * to have the bounds be the bounding box of the children (recursing into nested groups). A\n\t * partial frame warns and uses auto-bounds. Charts, media, tables, and placeholders are not\n\t * supported as group children yet (each is skipped with a warning).\n\t * @param {GroupChildProps[]} children - child object descriptors (`{ text }`, `{ image }`, `{ shape }`, `{ rect }`, `{ roundRect }`, `{ line }`, `{ group }`)\n\t * @param {GroupProps} options - group position/size/name options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addGroup([{ rect: { x: 1, y: 1, w: 2, h: 1, fill: { color: 'CC0000' } } }, { text: { text: 'Hi', options: { x: 1, y: 1, w: 2, h: 1 } } }])\n\t * @example slide.addGroup([{ rect: { x: 1, y: 1, w: 4, h: 3 } }, { group: { children: [{ text: { text: 'Hi', options: { x: 1.5, y: 1.5, w: 2, h: 1 } } }] } }])\n\t */\n\taddGroup(children: GroupChildProps[], options?: GroupProps): SlideBuilder {\n\t\taddGroupDefinition(this, children, options || {})\n\t\treturn this\n\t}\n\n\t/**\n\t * Group objects already added to this slide into a single PowerPoint group (`<p:grpSp>`),\n\t * addressed by their `objectName`. The counterpart to {@link SlideBuilder.addGroup} for slides composed\n\t * from independent renderers, where the objects exist already and replaying their descriptors just\n\t * to group them is not practical.\n\t *\n\t * Grouping is visually a no-op: children keep their slide-absolute geometry and their relative\n\t * z-order, and the group takes the topmost member's former slot in the stack. Name the objects in\n\t * any order — z-order decides the children's order, not the array. Groups may be named, so groups\n\t * can be nested into larger logical groups. Charts, media, tables, and placeholders cannot be\n\t * grouped yet.\n\t *\n\t * Unlike `addGroup()`, every problem throws: a name that matches nothing, matches an object\n\t * already inside another group, is ambiguous across two same-named objects, or names an\n\t * ungroupable kind. Each would otherwise leave the object loose on the slide, silently.\n\t * @param {string[]} objectNames - `objectName`s of the top-level objects to group\n\t * @param {GroupProps} options - group position/size/name options (frame is all-or-nothing, as with `addGroup`)\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addText('Hi', { x: 1, y: 1, w: 2, h: 1, objectName: 'Caption' })\n\t * @example slide.addImage({ path: 'logo.png', x: 1, y: 2, w: 2, h: 2, objectName: 'Logo' })\n\t * @example slide.groupObjects(['Caption', 'Logo'], { objectName: 'Branding' })\n\t */\n\tgroupObjects(objectNames: string[], options?: GroupProps): SlideBuilder {\n\t\tgroupObjectsDefinition(this, objectNames, options || {})\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a connector (a line drawn between two points, emitted as a PowerPoint `<p:cxnSp>`).\n\t * @param {ConnectorProps} options - connector endpoints (`x1,y1,x2,y2`) and line styling\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addConnector({ type: 'elbow', x1: 1, y1: 1, x2: 5, y2: 3, endArrowType: 'triangle' })\n\t */\n\taddConnector(options: ConnectorProps): SlideBuilder {\n\t\taddConnectorDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add table to Slide\n\t * @param {TableRow[]} tableRows - table rows\n\t * @param {TableProps} options - table options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddTable(tableRows: TableRow[], options?: TableProps): SlideBuilder {\n\t\tthis._newAutoPagedSlides = addTableDefinition(\n\t\t\tthis,\n\t\t\ttableRows,\n\t\t\toptions || {},\n\t\t\tthis._slideLayout,\n\t\t\tthis._presLayout,\n\t\t\tthis.addSlide,\n\t\t\tthis.getSlide\n\t\t)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add text to Slide\n\t * @param {string|TextProps[]} text - text string or complex object\n\t * @param {TextPropsOptions} options - text options\n\t * @return {SlideBuilder} this Slide\n\t */\n\taddText(text: string | number | TextProps[], options?: TextPropsOptions): SlideBuilder {\n\t\tconst textParam = typeof text === 'string' || typeof text === 'number' ? [{ text, options }] : text\n\t\taddTextDefinition(this, textParam, options || {}, false)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a preset build animation (entrance/emphasis/exit) to a shape on this slide.\n\t * Effects play in the order added and are grouped into click steps by `trigger`.\n\t * Target the shape by its 0-based add order (`shapeIndex`) or by `objectName`.\n\t * @param {AnimationProps} options - preset, target shape, trigger, and duration\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addAnimation({ preset: 'fadeIn', shapeIndex: 0 })\n\t * @example slide.addAnimation({ preset: 'grow', objectName: 'logo', trigger: 'afterPrevious' })\n\t */\n\taddAnimation(options: AnimationProps): SlideBuilder {\n\t\tthis._animations.push(options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a Slide Zoom — a clickable tile that zooms to a single target slide (Insert ▸ Zoom).\n\t * The tile shows a neutral placeholder until PowerPoint regenerates the live thumbnail\n\t * (once the target slide is next edited); pass `coverImage` to ship a fixed thumbnail.\n\t * @param {SlideZoomProps} options - target slide (`Slide` or 1-based number), position, and options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addSlideZoom({ target: intro, x: 1, y: 1, w: 3, h: 1.7 })\n\t */\n\taddSlideZoom(options: SlideZoomProps): SlideBuilder {\n\t\taddSlideZoomDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a Section Zoom — a clickable tile that zooms to the start of a named section.\n\t * @param {SectionZoomProps} options - target `sectionTitle`, position, and options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addSectionZoom({ sectionTitle: 'Results', x: 1, y: 1, w: 3, h: 1.7 })\n\t */\n\taddSectionZoom(options: SectionZoomProps): SlideBuilder {\n\t\taddSectionZoomDefinition(this, options, this.getSections())\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a Summary Zoom — a grid of tiles, one per section (excluding this slide's own section),\n\t * each zooming to that section's start.\n\t * @param {SummaryZoomProps} options - grid position/size and options\n\t * @return {SlideBuilder} this Slide\n\t * @example slide.addSummaryZoom({ x: 0.5, y: 1.5, w: 11, h: 4.5 })\n\t */\n\taddSummaryZoom(options: SummaryZoomProps): SlideBuilder {\n\t\taddSummaryZoomDefinition(this, options, this.getSections())\n\t\treturn this\n\t}\n}\n","/**\n * ts-pptx: Chart Axis Assembly\n *\n * Builds the `<c:catAx>` / `<c:valAx>` / `<c:serAx>` elements. The three share a\n * structure -- scaling, delete flag, tick marks, label position, text properties,\n * gridlines, optional axis title -- but PowerPoint requires the child elements in a\n * fixed order that differs per axis, so they stay as three separate builders rather\n * than one parameterized one. Called by {@link ./chart-xml}'s axis region.\n *\n * Sub-blocks are shared where they can be shared *exactly*: {@link axisLineSpPr} covers\n * `<c:spPr>`, which differs between the three only by indent width. `<c:txPr>` stays\n * duplicated — its inherited indentation is irregular *within* each copy as well as between\n * them (the category axis closes `</a:defRPr>` at three spaces, the value axis at six), so\n * one parameterised builder would take about as many indent arguments as it has lines, and\n * would hide the quirks rather than share the structure. Each copy states its own layout at\n * its own call site instead.\n *\n * Regularising that whitespace so one builder *could* serve all three is still open, and\n * still a byte change — AGENTS.md is explicit that a whitespace-only diff is a STOP, not a\n * known divergence. It is a decision to take deliberately, with a re-baselined gate, not a\n * cleanup to fold into something else.\n */\n\nimport { asChartType, ChartType } from '../../enums.js'\nimport {\n\tAXIS_ID_CATEGORY_PRIMARY,\n\tAXIS_ID_CATEGORY_SECONDARY,\n\tAXIS_ID_VALUE_PRIMARY,\n\tAXIS_ID_VALUE_SECONDARY,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n} from '../../constants-internal.js'\nimport type { ChartOptsInternal } from '../../types/internal.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { convertAngleUnits, ptsToEmuLenient } from '../../units-internal.js'\nimport { EMU_PER_POINT, ptToHundredths } from '../../units.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tcreateChartTextFonts,\n\tcreateGridLineElement,\n\tDEF_GRIDLINE_COLOR,\n\tgenXmlTitle,\n\tvalidTimeUnit,\n} from './chart-parts.js'\n\n/**\n * The `<c:spPr>` axis-line block, identical in shape on all three axes.\n *\n * The only thing that differed between the three copies was how far each was indented — two\n * spaces on the category and series axes, one on the value axis — and that irregularity is\n * inherited, not meaningful. It is reproduced here rather than normalised because inter-element\n * whitespace being inert does not make changing it free: byte-identity is the gate that proves\n * an emitter refactor changed nothing, and it cannot tell a \"harmless\" whitespace edit from a\n * real one. `indent` keeps the quirk visible at the call site.\n * @param {number} indent - leading spaces on the `<c:spPr>` line; children step out by 2 and 4\n * @param {number} widthEmu - line width for `a:ln@w`\n * @param {boolean | undefined} show - false emits `<a:noFill/>` instead of a colour\n * @param {string | undefined} color - line colour, defaulting to {@link DEF_GRIDLINE_COLOR}\n * @param {string} dash - `a:prstDash@val`\n * @return {string} XML `<c:spPr>`\n */\nfunction axisLineSpPr(\n\tindent: number,\n\twidthEmu: number,\n\tshow: boolean | undefined,\n\tcolor: string | undefined,\n\tdash: string\n): string {\n\tconst at = (extra: number): string => ' '.repeat(indent + extra)\n\tconst line = el(\n\t\t'a:ln',\n\t\t{ w: widthEmu, cap: 'flat' },\n\t\t[\n\t\t\traw(!show ? voidEl('a:noFill') : genXmlColorSelection(color || DEF_GRIDLINE_COLOR)),\n\t\t\traw(voidEl('a:prstDash', { val: dash }, { openPrefix: at(4) })),\n\t\t\traw(voidEl('a:round', null, { openPrefix: at(4) })),\n\t\t],\n\t\t{ openPrefix: at(2), closePrefix: at(2) }\n\t)\n\treturn el('c:spPr', null, raw(line), { openPrefix: at(0), closePrefix: at(0) })\n}\n\nexport function makeCatAxis(opts: ChartOptsInternal, axisId: string, valAxisId: string): string {\n\tconst usesValueAxisForCategories =\n\t\topts._type === ChartType.scatter || opts._type === ChartType.bubble || opts._type === ChartType.bubble3d\n\tconst usesCategoryAxis = !usesValueAxisForCategories && !opts.catLabelFormatCode\n\t// NOTE: scatter and bubble charts display numbers on the X axis, so their category axis is a\n\t// second value axis; a `catLabelFormatCode` means dates, which is a `<c:dateAx>`.\n\tconst tag = usesValueAxisForCategories ? 'c:valAx' : opts.catLabelFormatCode ? 'c:dateAx' : 'c:catAx'\n\n\tconst scaling = el(\n\t\t'c:scaling',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:orientation', { val: opts.catAxisOrientation || 'minMax' })),\n\t\t\topts.catAxisMaxVal || opts.catAxisMaxVal === 0 ? raw(voidEl('c:max', { val: opts.catAxisMaxVal })) : null,\n\t\t\topts.catAxisMinVal || opts.catAxisMinVal === 0 ? raw(voidEl('c:min', { val: opts.catAxisMinVal })) : null,\n\t\t],\n\t\t{ openPrefix: ' ' }\n\t)\n\n\t// Scatter/bubble read the X format off the category option, falling back to the value one.\n\tconst numFmt = usesValueAxisForCategories\n\t\t? voidEl(\n\t\t\t\t'c:numFmt',\n\t\t\t\t{ formatCode: (opts.catAxisLabelFormatCode ?? opts.valAxisLabelFormatCode) || 'General', sourceLinked: 1 },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\t\t: voidEl(\n\t\t\t\t'c:numFmt',\n\t\t\t\t{ formatCode: (opts.catLabelFormatCode ?? '') || 'General', sourceLinked: 1 },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\n\tconst ticks =\n\t\topts._type === ChartType.scatter\n\t\t\t? voidEl('c:majorTickMark', { val: 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:minorTickMark', { val: 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:tickLblPos', { val: opts.catAxisLabelPos || 'nextTo' }, { openPrefix: ' ' })\n\t\t\t: voidEl('c:majorTickMark', { val: opts.catAxisMajorTickMark || 'out' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:minorTickMark', { val: opts.catAxisMinorTickMark || 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl(\n\t\t\t\t\t'c:tickLblPos',\n\t\t\t\t\t{ val: opts.catAxisLabelPos || (opts.barDir === 'col' ? 'low' : 'nextTo') },\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tsz: ptToHundredths(opts.catAxisLabelFontSize || DEF_FONT_SIZE),\n\t\t\tb: opts.catAxisLabelFontBold ? 1 : 0,\n\t\t\ti: opts.catAxisLabelFontItalic ? 1 : 0,\n\t\t\tu: 'none',\n\t\t\tstrike: 'noStrike',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(opts.catAxisLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(' ' + createChartTextFonts(opts.catAxisLabelFontFace || 'Arial')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\t// NOTE: don't specify `rot=\"0\"` — leaving it off is what gets the auto behavior.\n\t\t\traw(\n\t\t\t\tvoidEl('a:bodyPr', {\n\t\t\t\t\trot: opts.catAxisLabelRotate ? convertAngleUnits(opts.catAxisLabelRotate, 'catAxisLabelRotate') : undefined,\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:pPr', null, raw(defRPr), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: opts.lang || 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\tconst valAxisCrossTag = typeof opts.valAxisCrossesAt === 'number' ? 'crossesAt' : 'crosses'\n\tconst valAxisCrossValue =\n\t\ttypeof opts.valAxisCrossesAt === 'number' ? opts.valAxisCrossesAt : opts.valAxisCrossesAt || 'autoZero'\n\n\t// PPT auto-adjusts these once it has calculated the date bounds, so they are emitted only when\n\t// the caller asked for them. Major/minor units are also allowed on a double value axis.\n\tlet units = ''\n\tif (opts.catLabelFormatCode || usesValueAxisForCategories) {\n\t\tif (opts.catLabelFormatCode) {\n\t\t\t// All three resolved before any is emitted, so the warnings still arrive in option order.\n\t\t\tconst baseTimeUnit = validTimeUnit(opts.catAxisBaseTimeUnit, 'catAxisBaseTimeUnit')\n\t\t\tconst majorTimeUnit = validTimeUnit(opts.catAxisMajorTimeUnit, 'catAxisMajorTimeUnit')\n\t\t\tconst minorTimeUnit = validTimeUnit(opts.catAxisMinorTimeUnit, 'catAxisMinorTimeUnit')\n\t\t\tif (baseTimeUnit) units += voidEl('c:baseTimeUnit', { val: baseTimeUnit })\n\t\t\tif (majorTimeUnit) units += voidEl('c:majorTimeUnit', { val: majorTimeUnit })\n\t\t\tif (minorTimeUnit) units += voidEl('c:minorTimeUnit', { val: minorTimeUnit })\n\t\t}\n\t\tif (opts.catAxisMajorUnit) units += voidEl('c:majorUnit', { val: opts.catAxisMajorUnit })\n\t\tif (opts.catAxisMinorUnit) units += voidEl('c:minorUnit', { val: opts.catAxisMinorUnit })\n\t}\n\n\treturn el(tag, null, [\n\t\traw(voidEl('c:axId', { val: axisId }, { openPrefix: ' ' })),\n\t\traw(scaling),\n\t\traw(voidEl('c:delete', { val: opts.catAxisHidden ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:axPos', { val: opts.barDir === 'col' ? 'b' : 'l' }, { openPrefix: ' ' })),\n\t\traw(opts.catGridLine && opts.catGridLine.style !== 'none' ? createGridLineElement(opts.catGridLine) : ''),\n\t\t// `<c:title>` comes between `</c:majorGridlines>` and `<c:numFmt>`.\n\t\topts.showCatAxisTitle\n\t\t\t? raw(\n\t\t\t\t\tgenXmlTitle({\n\t\t\t\t\t\tcolor: opts.catAxisTitleColor,\n\t\t\t\t\t\tfontFace: opts.catAxisTitleFontFace,\n\t\t\t\t\t\tfontSize: opts.catAxisTitleFontSize,\n\t\t\t\t\t\ttitleRotate: opts.catAxisTitleRotate,\n\t\t\t\t\t\ttitle: opts.catAxisTitle || 'Axis Title',\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t: null,\n\t\traw(numFmt),\n\t\traw(ticks),\n\t\traw(\n\t\t\taxisLineSpPr(\n\t\t\t\t2,\n\t\t\t\topts.catAxisLineSize ? ptsToEmuLenient(opts.catAxisLineSize) : EMU_PER_POINT,\n\t\t\t\topts.catAxisLineShow,\n\t\t\t\topts.catAxisLineColor,\n\t\t\t\topts.catAxisLineStyle || 'solid'\n\t\t\t)\n\t\t),\n\t\traw(txPr),\n\t\traw(voidEl('c:crossAx', { val: valAxisId }, { openPrefix: ' ' })),\n\t\traw(voidEl(`c:${valAxisCrossTag}`, { val: valAxisCrossValue }, { openPrefix: ' ' })),\n\t\tusesValueAxisForCategories ? null : raw(voidEl('c:auto', { val: 1 }, { openPrefix: ' ' })),\n\t\tusesCategoryAxis ? raw(voidEl('c:lblAlgn', { val: 'ctr' }, { openPrefix: ' ' })) : null,\n\t\tusesCategoryAxis && opts.catAxisLabelFrequency\n\t\t\t? raw(voidEl('c:tickLblSkip', { val: opts.catAxisLabelFrequency }, { openPrefix: ' ' }))\n\t\t\t: null,\n\t\tusesCategoryAxis\n\t\t\t? raw(voidEl('c:noMultiLvlLbl', { val: opts.catAxisMultiLevelLabels ? 0 : 1 }, { openPrefix: ' ' }))\n\t\t\t: null,\n\t\traw(units),\n\t])\n}\n\n/**\n * Create Value Axis (Used by `bar3D`)\n * @param {ChartOptsInternal} opts - chart options\n * @param {string} valAxisId - value\n * @return {string} XML\n */\nexport function makeValAxis(opts: ChartOptsInternal, valAxisId: string): string {\n\tlet axisPos =\n\t\tvalAxisId === AXIS_ID_VALUE_PRIMARY ? (opts.barDir === 'col' ? 'l' : 'b') : opts.barDir !== 'col' ? 'r' : 't'\n\tif (valAxisId === AXIS_ID_VALUE_SECONDARY) axisPos = 'r' // default behavior for PPT is showing 2nd val axis on right (primary axis on left)\n\tconst crossAxId = valAxisId === AXIS_ID_VALUE_PRIMARY ? AXIS_ID_CATEGORY_PRIMARY : AXIS_ID_CATEGORY_SECONDARY\n\n\tconst scaling = el(\n\t\t'c:scaling',\n\t\tnull,\n\t\t[\n\t\t\topts.valAxisLogScaleBase ? raw(voidEl('c:logBase', { val: opts.valAxisLogScaleBase })) : null,\n\t\t\traw(voidEl('c:orientation', { val: opts.valAxisOrientation || 'minMax' })),\n\t\t\topts.valAxisMaxVal || opts.valAxisMaxVal === 0 ? raw(voidEl('c:max', { val: opts.valAxisMaxVal })) : null,\n\t\t\topts.valAxisMinVal || opts.valAxisMinVal === 0 ? raw(voidEl('c:min', { val: opts.valAxisMinVal })) : null,\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\tconst ticks =\n\t\topts._type === ChartType.scatter\n\t\t\t? voidEl('c:majorTickMark', { val: 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:minorTickMark', { val: 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:tickLblPos', { val: 'nextTo' }, { openPrefix: ' ' })\n\t\t\t: voidEl('c:majorTickMark', { val: opts.valAxisMajorTickMark || 'out' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl('c:minorTickMark', { val: opts.valAxisMinorTickMark || 'none' }, { openPrefix: ' ' }) +\n\t\t\t\tvoidEl(\n\t\t\t\t\t'c:tickLblPos',\n\t\t\t\t\t{ val: opts.valAxisLabelPos || (opts.barDir === 'col' ? 'nextTo' : 'low') },\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tsz: ptToHundredths(opts.valAxisLabelFontSize || DEF_FONT_SIZE),\n\t\t\tb: opts.valAxisLabelFontBold ? 1 : 0,\n\t\t\ti: opts.valAxisLabelFontItalic ? 1 : 0,\n\t\t\tu: 'none',\n\t\t\tstrike: 'noStrike',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(opts.valAxisLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(' ' + createChartTextFonts(opts.valAxisLabelFontFace || 'Arial')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\t// Don't specify `rot=\"0\"`, so we get the auto behavior.\n\t\t\traw(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'a:bodyPr',\n\t\t\t\t\t{\n\t\t\t\t\t\trot: opts.valAxisLabelRotate ? convertAngleUnits(opts.valAxisLabelRotate, 'valAxisLabelRotate') : undefined,\n\t\t\t\t\t},\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:pPr', null, raw(defRPr), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: opts.lang || 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\t// Where this axis meets its category axis: an explicit position, an explicit rule, or the\n\t// default — a right/top axis crosses at the maximum, everything else at zero.\n\tconst crosses =\n\t\ttypeof opts.catAxisCrossesAt === 'number'\n\t\t\t? voidEl('c:crossesAt', { val: opts.catAxisCrossesAt }, { openPrefix: ' ' })\n\t\t\t: typeof opts.catAxisCrossesAt === 'string'\n\t\t\t\t? voidEl('c:crosses', { val: opts.catAxisCrossesAt }, { openPrefix: ' ' })\n\t\t\t\t: voidEl('c:crosses', { val: axisPos === 'r' || axisPos === 't' ? 'max' : 'autoZero' }, { openPrefix: ' ' })\n\tconst crossBetween =\n\t\topts.valAxisCrossBetween ||\n\t\t(opts._type === ChartType.scatter ||\n\t\t!!(Array.isArray(opts._type) && opts._type.some((type) => asChartType(type.type) === ChartType.area))\n\t\t\t? 'midCat'\n\t\t\t: 'between')\n\n\treturn el('c:valAx', null, [\n\t\traw(voidEl('c:axId', { val: valAxisId }, { openPrefix: ' ' })),\n\t\traw(scaling),\n\t\traw(voidEl('c:delete', { val: opts.valAxisHidden ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:axPos', { val: axisPos }, { openPrefix: ' ' })),\n\t\topts.valGridLine && opts.valGridLine.style !== 'none' ? raw(createGridLineElement(opts.valGridLine)) : null,\n\t\t// `<c:title>` comes between `</c:majorGridlines>` and `<c:numFmt>`.\n\t\topts.showValAxisTitle\n\t\t\t? raw(\n\t\t\t\t\tgenXmlTitle({\n\t\t\t\t\t\tcolor: opts.valAxisTitleColor,\n\t\t\t\t\t\tfontFace: opts.valAxisTitleFontFace,\n\t\t\t\t\t\tfontSize: opts.valAxisTitleFontSize,\n\t\t\t\t\t\ttitleRotate: opts.valAxisTitleRotate,\n\t\t\t\t\t\ttitle: opts.valAxisTitle || 'Axis Title',\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t: null,\n\t\traw(voidEl('c:numFmt', { formatCode: opts.valAxisLabelFormatCode || 'General', sourceLinked: 0 })),\n\t\traw(ticks),\n\t\traw(\n\t\t\taxisLineSpPr(\n\t\t\t\t1,\n\t\t\t\topts.valAxisLineSize ? ptsToEmuLenient(opts.valAxisLineSize) : EMU_PER_POINT,\n\t\t\t\topts.valAxisLineShow,\n\t\t\t\topts.valAxisLineColor,\n\t\t\t\topts.valAxisLineStyle || 'solid'\n\t\t\t)\n\t\t),\n\t\traw(txPr),\n\t\traw(voidEl('c:crossAx', { val: crossAxId }, { openPrefix: ' ' })),\n\t\traw(crosses),\n\t\traw(voidEl('c:crossBetween', { val: crossBetween }, { openPrefix: ' ' })),\n\t\topts.valAxisMajorUnit ? raw(voidEl('c:majorUnit', { val: opts.valAxisMajorUnit }, { openPrefix: ' ' })) : null,\n\t\topts.valAxisDisplayUnit\n\t\t\t? raw(\n\t\t\t\t\tel('c:dispUnits', null, [\n\t\t\t\t\t\traw(voidEl('c:builtInUnit', { val: opts.valAxisDisplayUnit })),\n\t\t\t\t\t\traw(opts.valAxisDisplayUnitLabel ? voidEl('c:dispUnitsLbl') : ''),\n\t\t\t\t\t])\n\t\t\t\t)\n\t\t\t: null,\n\t])\n}\n\n/**\n * Create Series Axis (Used by `bar3D`)\n * @param {ChartOptsInternal} opts - chart options\n * @param {string} axisId - axis ID\n * @param {string} valAxisId - value\n * @return {string} XML\n */\nexport function makeSerAxis(opts: ChartOptsInternal, axisId: string, valAxisId: string): string {\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tsz: ptToHundredths(opts.serAxisLabelFontSize || DEF_FONT_SIZE),\n\t\t\tb: opts.serAxisLabelFontBold ? 1 : 0,\n\t\t\ti: opts.serAxisLabelFontItalic ? 1 : 0,\n\t\t\tu: 'none',\n\t\t\tstrike: 'noStrike',\n\t\t},\n\t\t[\n\t\t\traw(' ' + genXmlColorSelection(opts.serAxisLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(' ' + createChartTextFonts(opts.serAxisLabelFontFace || 'Arial')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\t// Don't specify `rot=\"0\"`, so we get the auto behavior.\n\t\t\traw(voidEl('a:bodyPr', null, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:pPr', null, raw(defRPr), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: opts.lang || 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\t// PPT auto-adjusts these once it has calculated the date bounds, so they are emitted only when\n\t// the caller asked for them.\n\tlet units = ''\n\tif (opts.serLabelFormatCode) {\n\t\t// All three resolved before any is emitted, so the warnings still arrive in option order.\n\t\tconst baseTimeUnit = validTimeUnit(opts.serAxisBaseTimeUnit, 'serAxisBaseTimeUnit')\n\t\tconst majorTimeUnit = validTimeUnit(opts.serAxisMajorTimeUnit, 'serAxisMajorTimeUnit')\n\t\tconst minorTimeUnit = validTimeUnit(opts.serAxisMinorTimeUnit, 'serAxisMinorTimeUnit')\n\t\t// `baseTimeUnit` keeps its template string on purpose: it emits TWO spaces before\n\t\t// `val`, and voidEl() joins attributes with exactly one. Normalizing the spacing\n\t\t// would be a byte change, so the quirk stays visible here rather than being\n\t\t// silently \"fixed\" by the builder.\n\t\tif (baseTimeUnit) units += ` <c:baseTimeUnit val=\"${baseTimeUnit}\"/>`\n\t\tif (majorTimeUnit) units += voidEl('c:majorTimeUnit', { val: majorTimeUnit }, { openPrefix: ' ' })\n\t\tif (minorTimeUnit) units += voidEl('c:minorTimeUnit', { val: minorTimeUnit }, { openPrefix: ' ' })\n\t\tif (opts.serAxisMajorUnit) units += voidEl('c:majorUnit', { val: opts.serAxisMajorUnit }, { openPrefix: ' ' })\n\t\tif (opts.serAxisMinorUnit) units += voidEl('c:minorUnit', { val: opts.serAxisMinorUnit }, { openPrefix: ' ' })\n\t}\n\n\treturn el('c:serAx', null, [\n\t\traw(voidEl('c:axId', { val: axisId }, { openPrefix: ' ' })),\n\t\traw(\n\t\t\tel('c:scaling', null, raw(voidEl('c:orientation', { val: opts.serAxisOrientation || 'minMax' })), {\n\t\t\t\topenPrefix: ' ',\n\t\t\t})\n\t\t),\n\t\traw(voidEl('c:delete', { val: opts.serAxisHidden ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:axPos', { val: opts.barDir === 'col' ? 'b' : 'l' }, { openPrefix: ' ' })),\n\t\traw(opts.serGridLine && opts.serGridLine.style !== 'none' ? createGridLineElement(opts.serGridLine) : ''),\n\t\t// `<c:title>` comes between `</c:majorGridlines>` and `<c:numFmt>`.\n\t\topts.showSerAxisTitle\n\t\t\t? raw(\n\t\t\t\t\tgenXmlTitle({\n\t\t\t\t\t\tcolor: opts.serAxisTitleColor,\n\t\t\t\t\t\tfontFace: opts.serAxisTitleFontFace,\n\t\t\t\t\t\tfontSize: opts.serAxisTitleFontSize,\n\t\t\t\t\t\ttitleRotate: opts.serAxisTitleRotate,\n\t\t\t\t\t\ttitle: opts.serAxisTitle || 'Axis Title',\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t: null,\n\t\traw(\n\t\t\tvoidEl(\n\t\t\t\t'c:numFmt',\n\t\t\t\t{ formatCode: (opts.serLabelFormatCode ?? '') || 'General', sourceLinked: 0 },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\traw(voidEl('c:majorTickMark', { val: 'out' }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:minorTickMark', { val: 'none' }, { openPrefix: ' ' })),\n\t\traw(\n\t\t\tvoidEl(\n\t\t\t\t'c:tickLblPos',\n\t\t\t\t{ val: opts.serAxisLabelPos || (opts.barDir === 'col' ? 'low' : 'nextTo') },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\traw(axisLineSpPr(2, EMU_PER_POINT, opts.serAxisLineShow, opts.serAxisLineColor, 'solid')),\n\t\traw(txPr),\n\t\traw(voidEl('c:crossAx', { val: valAxisId }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:crosses', { val: 'autoZero' }, { openPrefix: ' ' })),\n\t\topts.serAxisLabelFrequency\n\t\t\t? raw(voidEl('c:tickLblSkip', { val: opts.serAxisLabelFrequency }, { openPrefix: ' ' }))\n\t\t\t: null,\n\t\traw(units),\n\t])\n}\n","/**\n * ts-pptx: Category-Axis Plot Assembly\n *\n * Emits the `<c:areaChart>` / `<c:barChart>` / `<c:bar3DChart>` / `<c:lineChart>` /\n * `<c:radarChart>` plot elements. These five chart types share one builder because they\n * share a plot shape -- grouping, per-series `<c:ser>` with a category reference and a\n * value cache, then the axis-id pair -- and differ only in a handful of type-gated\n * children. Reached through {@link ./chart-xml}'s `makeChartType` dispatch.\n */\n\nimport { ChartType } from '../../enums.js'\nimport {\n\tAXIS_ID_SERIES_PRIMARY,\n\tBARCHART_COLORS,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n\tDEF_SHAPE_SHADOW,\n} from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { createShadowEffectLst } from '../drawingml/effect.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { createLineCap, resolveBorderWidth } from '../drawingml/line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { FIXED_PCT_PER_PERCENT, ptToHundredths } from '../../units.js'\nimport { dataLabels, dataValues, firstLabelGroup, sheetCellRef, sheetRangeRef } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tchartColorLineFill,\n\tchartDataLabels,\n\tcreateChartTextFonts,\n\tcreateSerLinesElement,\n\tmakeChartErrorBarsXml,\n\tmakeCustomDLblXml,\n\tmakeSeriesDataPointsXml,\n\tnumCachePt,\n\tpaletteColor,\n\tresolveChartPalette,\n\tstrRefBlock,\n\tcatRefBlock,\n} from './chart-parts.js'\n\n/** The chart types drawn as a line (a marker per point, an optional smooth) rather than as a body. */\nconst isLineLike = (chartType: ChartType): boolean => chartType === ChartType.line || chartType === ChartType.radar\n\n/** The two bar families, which share `<c:barDir>`, `<c:invertIfNegative>` and a gap width. */\nconst isBarLike = (chartType: ChartType): boolean => chartType === ChartType.bar || chartType === ChartType.bar3d\n\n/** The type-gated children that open a plot element, before `<c:varyColors>`. */\nfunction plotGrouping(chartType: ChartType, opts: ChartOptsInternal): string {\n\tif (chartType === ChartType.area || chartType === ChartType.line) {\n\t\t// CT_Line/AreaChart take ST_Grouping, which has no `clustered`; anything not stacked is standard.\n\t\tconst lineGrouping =\n\t\t\topts.barGrouping === 'stacked' || opts.barGrouping === 'percentStacked' ? opts.barGrouping : 'standard'\n\t\treturn voidEl('c:grouping', { val: lineGrouping })\n\t}\n\tif (isBarLike(chartType)) {\n\t\treturn voidEl('c:barDir', { val: opts.barDir }) + voidEl('c:grouping', { val: opts.barGrouping || 'clustered' })\n\t}\n\tif (chartType === ChartType.radar) {\n\t\t// Map the public PowerPoint-UI names to ST_RadarStyle wire values.\n\t\tconst radarStyleWire =\n\t\t\t{ radar: 'standard', markers: 'marker', filled: 'filled' }[opts.radarStyle || 'radar'] ?? 'standard'\n\t\treturn voidEl('c:radarStyle', { val: radarStyleWire })\n\t}\n\treturn ''\n}\n\n/** Fill, outline and shadow for one series, from its resolved colour and the line/border options. */\nfunction serShapeProps(\n\tchartType: ChartType,\n\topts: ChartOptsInternal,\n\tseriesColor: string,\n\tlineSize: number | undefined,\n\tserIndex: number\n): string {\n\tconst fill =\n\t\tseriesColor === 'transparent'\n\t\t\t? voidEl('a:noFill')\n\t\t\t: opts.chartColorsOpacity\n\t\t\t\t? el(\n\t\t\t\t\t\t'a:solidFill',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tcreateColorElement(\n\t\t\t\t\t\t\t\tseriesColor,\n\t\t\t\t\t\t\t\tvoidEl('a:alpha', { val: Math.round(opts.chartColorsOpacity * FIXED_PCT_PER_PERCENT) })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t: genXmlColorSelection(seriesColor)\n\tlet line = ''\n\tif (isLineLike(chartType)) {\n\t\tconst effectiveLineSize = lineSize ?? opts.lineSize ?? 2\n\t\tline =\n\t\t\teffectiveLineSize === 0\n\t\t\t\t? el('a:ln', null, raw(voidEl('a:noFill')))\n\t\t\t\t: el('a:ln', { w: ptsToEmuLenient(effectiveLineSize), cap: createLineCap(opts.lineCap) }, [\n\t\t\t\t\t\traw(chartColorLineFill(seriesColor)),\n\t\t\t\t\t\traw(voidEl('a:prstDash', { val: opts.lineDashValues?.[serIndex] ?? opts.lineDash ?? 'solid' })),\n\t\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t\t])\n\t} else if (opts.dataBorder) {\n\t\tline = el(\n\t\t\t'a:ln',\n\t\t\t{ w: ptsToEmuLenient(resolveBorderWidth(opts.dataBorder, 0.75)), cap: createLineCap(opts.lineCap) },\n\t\t\t[\n\t\t\t\traw(\n\t\t\t\t\tgenXmlColorSelection({\n\t\t\t\t\t\tcolor: opts.dataBorder.color ?? '363636',\n\t\t\t\t\t\ttransparency: opts.dataBorder.transparency,\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\traw(voidEl('a:round')),\n\t\t\t]\n\t\t)\n\t}\n\treturn el('c:spPr', null, [raw(fill), raw(line), raw(createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW))], {\n\t\topenPrefix: ' ',\n\t\tclosePrefix: ' ',\n\t})\n}\n\n/**\n * The point marker for a line/radar series. `<c:marker>` must precede `<c:dLbls>` in CT_LineSer\n * (schema order: spPr → marker → dPt → dLbls).\n */\nfunction serMarker(opts: ChartOptsInternal, markerColor: string, seriesColor: string): string {\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(markerColor === 'transparent' ? voidEl('a:noFill') : genXmlColorSelection(markerColor)),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:ln',\n\t\t\t\t\t{ w: opts.lineDataSymbolLineSize, cap: 'flat' },\n\t\t\t\t\t[\n\t\t\t\t\t\traw(chartColorLineFill(opts.lineDataSymbolLineColor || seriesColor)),\n\t\t\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(voidEl('a:effectLst', null, { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:marker', null, [\n\t\traw(voidEl('c:symbol', { val: opts.lineDataSymbol }, { openPrefix: ' ' })),\n\t\t// Defaults to \"auto\" otherwise (but this is usually too small, so there is a default).\n\t\topts.lineDataSymbolSize ? raw(voidEl('c:size', { val: opts.lineDataSymbolSize })) : null,\n\t\traw(spPr),\n\t])\n}\n\n/** Per-series `<c:dLbls>`: number format, an optional label background, text style, show flags. */\nfunction serDataLabels(obj: OptsChartDataInternal, opts: ChartOptsInternal, seriesColor: string): string {\n\tconst over = opts.seriesOptions?.[obj._dataIndex]\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tb: (over?.dataLabelFontBold ?? opts.dataLabelFontBold ?? false) ? 1 : 0,\n\t\t\ti: (over?.dataLabelFontItalic ?? opts.dataLabelFontItalic ?? false) ? 1 : 0,\n\t\t\tstrike: 'noStrike',\n\t\t\tsz: ptToHundredths(over?.dataLabelFontSize ?? opts.dataLabelFontSize ?? DEF_FONT_SIZE),\n\t\t\tu: 'none',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(over?.dataLabelColor ?? opts.dataLabelColor ?? DEF_FONT_COLOR)),\n\t\t\traw(createChartTextFonts(over?.dataLabelFontFace ?? opts.dataLabelFontFace ?? 'Arial')),\n\t\t]\n\t)\n\tconst txPr = el('c:txPr', null, [\n\t\traw(voidEl('a:bodyPr')),\n\t\traw(voidEl('a:lstStyle')),\n\t\traw(el('a:p', null, raw(el('a:pPr', null, raw(defRPr))))),\n\t])\n\tconst lblFmtCode = over?.dataLabelFormatCode ?? opts.dataLabelFormatCode\n\treturn el('c:dLbls', null, [\n\t\t// Per-point custom labels precede the aggregate settings (CT_DLbls order: dLbl* then Group_DLbls).\n\t\traw((obj.customLabels ?? []).map((lbl, idx) => (lbl ? makeCustomDLblXml(idx, lbl, opts) : '')).join('')),\n\t\traw(voidEl('c:numFmt', { formatCode: (lblFmtCode ?? '') || 'General', sourceLinked: 0 })),\n\t\topts.dataLabelBkgrdColors ? raw(el('c:spPr', null, raw(genXmlColorSelection(seriesColor)))) : null,\n\t\traw(txPr),\n\t\topts.dataLabelPosition ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition })) : null,\n\t\traw(voidEl('c:showLegendKey', { val: 0 })),\n\t\traw(voidEl('c:showVal', { val: opts.showValue ? 1 : 0 })),\n\t\traw(voidEl('c:showCatName', { val: 0 })),\n\t\traw(voidEl('c:showSerName', { val: opts.showSerName ? 1 : 0 })),\n\t\traw(voidEl('c:showPercent', { val: 0 })),\n\t\traw(voidEl('c:showBubbleSize', { val: 0 })),\n\t\traw(voidEl('c:showLeaderLines', { val: opts.showLeaderLines ? 1 : 0 })),\n\t])\n}\n\n/**\n * The `<c:cat>` category reference. Numeric (date) categories and single-level text ones are\n * {@link catRefBlock}; multi-level labels nest a `<c:lvl>` per group, which is a different shape\n * rather than a different spelling of the same one.\n */\nfunction serCategories(obj: OptsChartDataInternal, opts: ChartOptsInternal): string {\n\tconst groups = dataLabels(obj)\n\tconst cats = firstLabelGroup(obj)\n\tconst catRef = `Sheet1!$A$2:$A$${cats.length + 1}`\n\tif (opts.catLabelFormatCode) {\n\t\t// A `catLabelFormatCode` implies numbers, so the cache is a numRef carrying that format.\n\t\treturn el('c:cat', null, raw(catRefBlock('num', catRef, cats, opts.catLabelFormatCode || 'General', 'indented')))\n\t}\n\tif (groups.length === 1) return el('c:cat', null, raw(catRefBlock('str', catRef, cats, undefined, 'indented')))\n\tconst lvls = groups\n\t\t.map((labelsGroup) =>\n\t\t\tel('c:lvl', null, raw(labelsGroup.map((label, idx) => el('c:pt', { idx }, raw(el('c:v', null, label)))).join('')))\n\t\t)\n\t\t.join('')\n\tconst cache = el(\n\t\t'c:multiLvlStrCache',\n\t\tnull,\n\t\t[raw(voidEl('c:ptCount', { val: cats.length }, { openPrefix: ' ' })), raw(lvls)],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst ref = el(\n\t\t'c:multiLvlStrRef',\n\t\tnull,\n\t\t[raw(el('c:f', null, sheetRangeRef(1, 2, groups.length, cats.length + 1), { openPrefix: ' ' })), raw(cache)],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:cat', null, raw(ref))\n}\n\n/** The `<c:val>` numeric cache: the series' own sheet column, one point per category. */\nfunction serValues(obj: OptsChartDataInternal, valFmtCode: string): string {\n\tconst valCol = obj._dataIndex + dataLabels(obj).length + 1\n\tconst catCount = firstLabelGroup(obj).length\n\tconst numCache = el(\n\t\t'c:numCache',\n\t\tnull,\n\t\t[\n\t\t\traw(el('c:formatCode', null, valFmtCode, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:ptCount', { val: catCount }, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tdataValues(obj)\n\t\t\t\t\t.map((value, idx) => numCachePt(idx, value))\n\t\t\t\t\t.join('')\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst numRef = el(\n\t\t'c:numRef',\n\t\tnull,\n\t\t[raw(el('c:f', null, sheetRangeRef(valCol, 2, valCol, catCount + 1))), raw(numCache)],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:val', null, raw(numRef))\n}\n\n/**\n * Plot a category-axis chart family (area / bar / bar3d / line / radar) into a\n * `<c:xxxChart>` element. These share the grouping / series / cat+val axis structure.\n */\nexport function makeCatAxisPlot(\n\tchartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string,\n\tvalFmtCode: string\n): string {\n\t/* EX1:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Region 1',\n\t\t\t\t labels: [['April', 'May', 'June', 'July']],\n\t\t\t\t values: [17, 26, 53, 96]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t name: 'Region 2',\n\t\t\t\t labels: [['April', 'May', 'June', 'July']],\n\t\t\t\t values: [55, 43, 70, 58]\n\t\t\t\t }\n\t\t\t\t]\n */\n\t/* EX2:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Region 1',\n\t\t\t\t labels: [\n\t\t\t\t\t ['April', 'May', 'June', 'April', 'May', 'June'],\n\t\t\t\t\t ['2020', '', '', '2021', '', '']\n\t\t\t\t ],\n\t\t\t\t values: [17, 26, 53, 96, 40, 33]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t name: 'Region 2',\n\t\t\t\t labels: [\n\t\t\t\t\t ['April', 'May', 'June', 'April', 'May', 'June'],\n\t\t\t\t\t ['2020', '', '', '2021', '', '']\n\t\t\t\t ],\n\t\t\t\t values: [55, 43, 70, 58, 78, 63]\n\t\t\t\t }\n\t\t\t\t]\n */\n\t// `chartColors` is always populated by addChartDefinition() (defaulting to BARCHART_COLORS); the\n\t// fallback in `paletteColor` only satisfies the optional type and keeps a colour a non-null string.\n\tconst chartColors = resolveChartPalette(opts)\n\t// A single bar series varies its own colours when the caller asked for a palette other than the\n\t// default one, or supplied `invertedColors`; every other shape colours by series.\n\tconst barVaryColors =\n\t\tisBarLike(chartType) &&\n\t\tdata.length === 1 &&\n\t\t((opts.chartColors && opts.chartColors !== BARCHART_COLORS && opts.chartColors.length > 1) ||\n\t\t\topts.invertedColors?.length)\n\t\t\t? opts.chartColors || BARCHART_COLORS\n\t\t\t: null\n\n\t// One `<c:ser>` per data row.\n\tconst sers = data\n\t\t.map((obj, serIndex) => {\n\t\t\tconst seriesOverride = opts.seriesOptions?.[obj._dataIndex]\n\t\t\tconst seriesColor = seriesOverride?.color ?? paletteColor(chartColors, serIndex)\n\t\t\treturn el('c:ser', null, [\n\t\t\t\traw(voidEl('c:idx', { val: obj._dataIndex }, { openPrefix: ' ' })),\n\t\t\t\traw(voidEl('c:order', { val: obj._dataIndex })),\n\t\t\t\traw(strRefBlock(sheetCellRef(obj._dataIndex + dataLabels(obj).length + 1, 1), obj.name ?? '')),\n\t\t\t\traw(serShapeProps(chartType, opts, seriesColor, seriesOverride?.lineSize, serIndex)),\n\t\t\t\t// `invertIfNegative` is bar-only in the schema (CT_BarSer); area/line/radar must omit it.\n\t\t\t\tisBarLike(chartType) ? raw(voidEl('c:invertIfNegative', { val: 0 }, { openPrefix: ' ' })) : null,\n\t\t\t\tisLineLike(chartType) ? raw(serMarker(opts, paletteColor(chartColors, obj._dataIndex), seriesColor)) : null,\n\t\t\t\t// Per-point data points (`c:dPt`) MUST precede `c:dLbls` in CT_*Ser schema order.\n\t\t\t\traw(makeSeriesDataPointsXml(chartType, obj, opts, barVaryColors)),\n\t\t\t\t// NOTE: [20190117] Adding data labels to a RADAR chart causes unrecoverable corruption,\n\t\t\t\t// and CT_RadarSer has no error bars either.\n\t\t\t\tchartType === ChartType.radar ? null : raw(serDataLabels(obj, opts, seriesColor)),\n\t\t\t\tchartType === ChartType.radar ? null : raw(makeChartErrorBarsXml(chartType, obj.errorBars, obj)),\n\t\t\t\traw(serCategories(obj, opts)),\n\t\t\t\traw(serValues(obj, valFmtCode)),\n\t\t\t\tchartType === ChartType.line ? raw(voidEl('c:smooth', { val: opts.lineSmooth ? 1 : 0 })) : null,\n\t\t\t])\n\t\t})\n\t\t.join('')\n\n\t// Per-type plot options. Schema order (CT_BarChart): gapWidth → overlap → serLines → axId.\n\tlet plotOptions = ''\n\tif (chartType === ChartType.bar) {\n\t\tplotOptions =\n\t\t\tvoidEl('c:gapWidth', { val: opts.barGapWidthPct }, { openPrefix: ' ' }) +\n\t\t\tvoidEl(\n\t\t\t\t'c:overlap',\n\t\t\t\t{ val: opts.barOverlapPct ?? ((opts.barGrouping || '').includes('tacked') ? 100 : 0) },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t) +\n\t\t\t// `<c:serLines>` connects data points across stacked bar/column series.\n\t\t\tcreateSerLinesElement(opts.barSeriesLine)\n\t} else if (chartType === ChartType.bar3d) {\n\t\tplotOptions =\n\t\t\tvoidEl('c:gapWidth', { val: opts.barGapWidthPct }, { openPrefix: ' ' }) +\n\t\t\tvoidEl('c:gapDepth', { val: opts.barGapDepthPct }, { openPrefix: ' ' }) +\n\t\t\tvoidEl('c:shape', { val: opts.bar3DShape }, { openPrefix: ' ' })\n\t} else if (chartType === ChartType.line) {\n\t\tplotOptions = voidEl('c:marker', { val: 1 }, { openPrefix: ' ' })\n\t}\n\n\treturn el(`c:${chartType}Chart`, null, [\n\t\traw(plotGrouping(chartType, opts)),\n\t\traw(voidEl('c:varyColors', { val: 0 })),\n\t\traw(sers),\n\t\traw(chartDataLabels(opts, true)),\n\t\traw(plotOptions),\n\t\t// Axis id order matters: category comes first. Only 3-D charts get a series axis — emitting a\n\t\t// SERIES_PRIMARY axId for a 2-D chart left a dangling reference, and every axId in\n\t\t// `<c:plotArea>` must resolve to a defined catAx/valAx.\n\t\traw(voidEl('c:axId', { val: catAxisId })),\n\t\traw(voidEl('c:axId', { val: valAxisId })),\n\t\tchartType === ChartType.bar3d ? raw(voidEl('c:axId', { val: AXIS_ID_SERIES_PRIMARY })) : null,\n\t])\n}\n","/**\n * ts-pptx: Scatter Plot Assembly\n *\n * Emits the `<c:scatterChart>` plot element. Scatter is the one family whose first data\n * row supplies X *values* rather than categories, so each `<c:ser>` carries an\n * `<c:xVal>`/`<c:yVal>` pair instead of `<c:cat>`/`<c:val>` -- which is why it does not\n * share the category-axis builder. Reached through {@link ./chart-xml}'s `makeChartType`\n * dispatch.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { BARCHART_COLORS, DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_SHAPE_SHADOW } from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { getUuid } from '../utils.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { createShadowEffectLst } from '../drawingml/effect.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { createLineCap } from '../drawingml/line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { FIXED_PCT_PER_PERCENT, ptToHundredths } from '../../units.js'\nimport { dataLabels, dataValues, firstLabelGroup, sheetCellRef, sheetRangeRef } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tchartColorLineFill,\n\tchartDataLabels,\n\tcreateChartTextFonts,\n\tmakeChartErrorBarsXml,\n\tmakeSeriesDataPointsXml,\n\tnumRefBlock,\n\tpaletteColor,\n\tresolveChartPalette,\n\tstrRefBlock,\n} from './chart-parts.js'\n\n/** The font attributes a scatter label's `<a:defRPr>` and `<a:rPr>` both carry, in schema order. */\nfunction labelFontAttrs(opts: ChartOptsInternal): Record<string, string | number> {\n\treturn {\n\t\tsz: ptToHundredths(opts.dataLabelFontSize || DEF_FONT_SIZE),\n\t\tb: opts.dataLabelFontBold ? 1 : 0,\n\t\ti: opts.dataLabelFontItalic ? 1 : 0,\n\t\tu: 'none',\n\t\tstrike: 'noStrike',\n\t}\n}\n\n/** The colour and typeface children of those run properties; `indent` is theirs, not the parent's. */\nfunction labelFontChildren(opts: ChartOptsInternal, indent: string) {\n\treturn [\n\t\traw(indent + el('a:solidFill', null, raw(createColorElement(opts.dataLabelColor || DEF_FONT_COLOR)))),\n\t\traw(indent + createChartTextFonts(opts.dataLabelFontFace || 'Arial')),\n\t]\n}\n\n/**\n * The `(x, y)` runs appended to a `customXY` label: a literal `\" (\"`, an `XVALUE` field, a\n * `\", \"`, a `YVALUE` field and a `\")\"`.\n *\n * Each `<a:fld>` id is minted per build. A field id has to be unique, which is a property a\n * derived id would have to reproduce without an oracle for how far that uniqueness has to\n * reach — so the ids stay random and the *comparison* gives: `NORMALIZERS` in\n * `scripts/pptx-parts.mjs` erases exactly these two field types before the byte-identity gate\n * diffs a part. Do not \"fix\" the nondeterminism here.\n */\nfunction customXYRuns(obj: OptsChartDataInternal, opts: ChartOptsInternal): string {\n\tconst lang = opts.lang || 'en-US'\n\tconst literal = (text: string): string =>\n\t\tel(\n\t\t\t'a:r',\n\t\t\tnull,\n\t\t\t[\n\t\t\t\traw(voidEl('a:rPr', { lang, baseline: 0, dirty: 0 }, { openPrefix: ' ' })),\n\t\t\t\traw(el('a:t', null, text, { openPrefix: ' ' })),\n\t\t\t],\n\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t)\n\tconst field = (type: 'XVALUE' | 'YVALUE', text: string): string =>\n\t\tel(\n\t\t\t'a:fld',\n\t\t\t{ id: `{${getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')}}`, type },\n\t\t\t[\n\t\t\t\traw(voidEl('a:rPr', { lang, baseline: 0 }, { openPrefix: ' ' })),\n\t\t\t\traw(\n\t\t\t\t\tel('a:pPr', null, raw(voidEl('a:defRPr', null, { openPrefix: ' ' })), {\n\t\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\traw(' ' + el('a:t', null, text)),\n\t\t\t],\n\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t)\n\treturn (\n\t\tliteral(' (') +\n\t\tfield('XVALUE', '[' + (obj.name ?? '')) +\n\t\tliteral(', ') +\n\t\tfield('YVALUE', '[' + (obj.name ?? '') + ']') +\n\t\tliteral(')') +\n\t\tvoidEl('a:endParaRPr', { lang, dirty: 0 }, { openPrefix: ' ' })\n\t)\n}\n\n/**\n * One per-point `<c:dLbl>` for the `custom` / `customXY` label formats: rich text carrying the\n * caller's label, optionally followed by the X/Y value fields.\n */\nfunction scatterCustomLabel(\n\tobj: OptsChartDataInternal,\n\topts: ChartOptsInternal,\n\tlabel: string,\n\tidx: number,\n\tchartUuid: string\n): string {\n\tconst rich = el(\n\t\t'c:rich',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tel('a:bodyPr', null, raw(voidEl('a:spAutoFit', null, { openPrefix: ' ' })), {\n\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t'a:pPr',\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\tel('a:defRPr', labelFontAttrs(opts), labelFontChildren(opts, ' '), {\n\t\t\t\t\t\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\t\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t'a:r',\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t\t'a:rPr',\n\t\t\t\t\t\t\t\t\t\t\t{ lang: opts.lang || 'en-US', ...labelFontAttrs(opts), dirty: 0 },\n\t\t\t\t\t\t\t\t\t\t\tlabelFontChildren(opts, ' '),\n\t\t\t\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\traw(' ' + el('a:t', null, label)),\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// The X/Y values are appended only for a label that is not blank or all spaces,\n\t\t\t\t\t\t// which is what lets a caller label a subset of the points.\n\t\t\t\t\t\topts.dataLabelFormatScatter === 'customXY' && !/^ *$/.test(label) ? raw(customXYRuns(obj, opts)) : null,\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('a:noFill', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel('a:ln', null, raw(voidEl('a:noFill', null, { openPrefix: ' ' })), {\n\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(voidEl('a:effectLst', null, { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst extLst = el(\n\t\t'c:extLst',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'c:ext',\n\t\t\t\t\t{\n\t\t\t\t\t\turi: '{CE6537A1-D6FC-4f65-9D91-7224C49458BB}',\n\t\t\t\t\t\t'xmlns:c15': 'http://schemas.microsoft.com/office/drawing/2012/chart',\n\t\t\t\t\t},\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'c:ext',\n\t\t\t\t\t{\n\t\t\t\t\t\turi: '{C3380CC4-5D6E-409C-BE32-E72D297353CC}',\n\t\t\t\t\t\t'xmlns:c16': 'http://schemas.microsoft.com/office/drawing/2014/chart',\n\t\t\t\t\t},\n\t\t\t\t\traw(\n\t\t\t\t\t\tvoidEl(\n\t\t\t\t\t\t\t'c16:uniqueId',\n\t\t\t\t\t\t\t{ val: `{${String(idx + 1).padStart(8, '0')}${chartUuid}}` },\n\t\t\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el(\n\t\t'c:dLbl',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:idx', { val: idx }, { openPrefix: ' ' })),\n\t\t\traw(el('c:tx', null, raw(rich), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\traw(spPr),\n\t\t\topts.dataLabelPosition ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition }, { openPrefix: ' ' })) : null,\n\t\t\traw(voidEl('c:showLegendKey', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showVal', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showCatName', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showSerName', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showPercent', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showBubbleSize', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showLeaderLines', { val: 1 }, { openPrefix: ' ' })),\n\t\t\traw(extLst),\n\t\t],\n\t\t{ openPrefix: ' ' }\n\t)\n}\n\n/** The single chart-level `<c:dLbls>` of the `XY` label format: PowerPoint composes the text. */\nfunction scatterXYLabels(opts: ChartOptsInternal): string {\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('a:noFill', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel('a:ln', null, raw(voidEl('a:noFill', null, { openPrefix: ' ' })), {\n\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(voidEl('a:effectLst', null, { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tel('a:bodyPr', null, raw(voidEl('a:spAutoFit', null, { openPrefix: ' ' })), {\n\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t'a:pPr',\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\tel('a:defRPr', labelFontAttrs(opts), labelFontChildren(opts, ' '), {\n\t\t\t\t\t\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\t\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: opts.lang || 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst extLst = el(\n\t\t'c:extLst',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'c:ext',\n\t\t\t\t{\n\t\t\t\t\turi: '{CE6537A1-D6FC-4f65-9D91-7224C49458BB}',\n\t\t\t\t\t'xmlns:c15': 'http://schemas.microsoft.com/office/drawing/2012/chart',\n\t\t\t\t},\n\t\t\t\traw(voidEl('c15:showLeaderLines', { val: 1 }, { openPrefix: ' ' })),\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:dLbls', null, [\n\t\traw(spPr),\n\t\traw(txPr),\n\t\topts.dataLabelPosition ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition }, { openPrefix: ' ' })) : null,\n\t\traw(voidEl('c:showLegendKey', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showVal', { val: opts.showLabel ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showCatName', { val: opts.showLabel ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showSerName', { val: opts.showSerName ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showPercent', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showBubbleSize', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(extLst),\n\t])\n}\n\n/** Fill, outline and shadow for one scatter series. */\nfunction scatterSerShapeProps(opts: ChartOptsInternal, serColor: string, serIndex: number): string {\n\tconst fill =\n\t\tserColor === 'transparent'\n\t\t\t? voidEl('a:noFill')\n\t\t\t: opts.chartColorsOpacity\n\t\t\t\t? el(\n\t\t\t\t\t\t'a:solidFill',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tcreateColorElement(\n\t\t\t\t\t\t\t\tserColor,\n\t\t\t\t\t\t\t\tvoidEl('a:alpha', { val: Math.round(opts.chartColorsOpacity * FIXED_PCT_PER_PERCENT) })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t: genXmlColorSelection(serColor)\n\tconst line =\n\t\topts.lineSize === 0\n\t\t\t? el('a:ln', null, raw(voidEl('a:noFill')))\n\t\t\t: el('a:ln', { w: ptsToEmuLenient(opts.lineSize ?? 2), cap: createLineCap(opts.lineCap) }, [\n\t\t\t\t\traw(chartColorLineFill(serColor)),\n\t\t\t\t\traw(voidEl('a:prstDash', { val: opts.lineDashValues?.[serIndex] ?? opts.lineDash ?? 'solid' })),\n\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t])\n\treturn el('c:spPr', null, [raw(fill), raw(line), raw(createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW))], {\n\t\topenPrefix: ' ',\n\t\tclosePrefix: ' ',\n\t})\n}\n\n/** The point marker: symbol, optional size, and its own fill and outline. */\nfunction scatterMarker(opts: ChartOptsInternal, markerColor: string): string {\n\tconst spPr = el('c:spPr', null, [\n\t\traw(markerColor === 'transparent' ? voidEl('a:noFill') : genXmlColorSelection(markerColor)),\n\t\traw(\n\t\t\tel('a:ln', { w: opts.lineDataSymbolLineSize, cap: 'flat' }, [\n\t\t\t\traw(chartColorLineFill(opts.lineDataSymbolLineColor || markerColor)),\n\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\traw(voidEl('a:round')),\n\t\t\t])\n\t\t),\n\t\traw(voidEl('a:effectLst')),\n\t])\n\treturn el('c:marker', null, [\n\t\traw(voidEl('c:symbol', { val: opts.lineDataSymbol }, { openPrefix: ' ' })),\n\t\t// Defaults to \"auto\" otherwise (but this is usually too small, so there is a default).\n\t\topts.lineDataSymbolSize ? raw(voidEl('c:size', { val: opts.lineDataSymbolSize })) : null,\n\t\traw(spPr),\n\t])\n}\n\n/**\n * Plot an XY scatter chart into `<c:scatterChart>` (paired X/Y numeric series).\n */\nexport function makeScatterPlot(\n\tchartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string,\n\tvalFmtCode: string\n): string {\n\t/*\n\t\t\t\t`data` = [\n\t\t\t\t\t{ name:'X-Axis', values:[1,2,3,4,5,6,7,8,9,10,11,12] },\n\t\t\t\t\t{ name:'Y-Value 1', values:[13, 20, 21, 25] },\n\t\t\t\t\t{ name:'Y-Value 2', values:[ 1, 2, 5, 9] }\n\t\t\t\t];\n */\n\tconst chartColors = resolveChartPalette(opts)\n\t// X values come from the first row; each later row is one Y series.\n\tconst xValues = dataValues(data[0])\n\t// Legacy single-series colour-vary, and it can never fire: a scatter `data` array is one row of\n\t// X values plus one row per Y series, the loop below runs over `data.slice(1)`, so by the time\n\t// `data.length === 1` there are no series left to colour. The intent was presumably \"one Y\n\t// series\" (`=== 2`). Fixing it would start emitting `<c:dPt>` colour-vary for single-series\n\t// scatter charts, which is an output change and a question about what such a chart should look\n\t// like — so the condition is left exactly as it has always been, said out loud rather than\n\t// quietly corrected.\n\tconst scatterVaryColors =\n\t\tdata.length === 1 && opts.chartColors !== BARCHART_COLORS ? opts.chartColors || BARCHART_COLORS : null\n\n\tconst sers = data\n\t\t.slice(1)\n\t\t.map((obj, idx) => {\n\t\t\tconst serColor = paletteColor(chartColors, idx)\n\t\t\tconst yValues = dataValues(obj)\n\t\t\t// The Y series is cached against the X series' length, so a caller who supplied fewer Y\n\t\t\t// values than X leaves gaps rather than a short cache.\n\t\t\tconst values =\n\t\t\t\tnumRefBlock('c:xVal', `Sheet1!$A$2:$A$${xValues.length + 1}`, valFmtCode, xValues) +\n\t\t\t\tnumRefBlock(\n\t\t\t\t\t'c:yVal',\n\t\t\t\t\tsheetRangeRef(idx + 2, 2, idx + 2, xValues.length + 1),\n\t\t\t\t\tvalFmtCode,\n\t\t\t\t\txValues.map((_value, i) => yValues[i])\n\t\t\t\t)\n\n\t\t\t// Scatter data point labels. `chartUuid` tails each point's `c16:uniqueId` and is minted\n\t\t\t// per build, for the reason {@link customXYRuns} gives about the `a:fld` ids.\n\t\t\tlet labels = ''\n\t\t\tif (opts.showLabel) {\n\t\t\t\tconst chartUuid = getUuid('-xxxx-xxxx-xxxx-xxxxxxxxxxxx')\n\t\t\t\tconst isCustom = opts.dataLabelFormatScatter === 'custom' || opts.dataLabelFormatScatter === 'customXY'\n\t\t\t\tif (dataLabels(obj)[0] && isCustom) {\n\t\t\t\t\tlabels += el(\n\t\t\t\t\t\t'c:dLbls',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tfirstLabelGroup(obj)\n\t\t\t\t\t\t\t\t.map((label, pointIdx) => scatterCustomLabel(obj, opts, label, pointIdx, chartUuid))\n\t\t\t\t\t\t\t\t.join('')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tif (opts.dataLabelFormatScatter === 'XY') labels += scatterXYLabels(opts)\n\t\t\t}\n\n\t\t\treturn el('c:ser', null, [\n\t\t\t\traw(voidEl('c:idx', { val: idx }, { openPrefix: ' ' })),\n\t\t\t\traw(voidEl('c:order', { val: idx }, { openPrefix: ' ' })),\n\t\t\t\traw(strRefBlock(sheetCellRef(idx + 2, 1), obj.name ?? '')),\n\t\t\t\traw(scatterSerShapeProps(opts, serColor, idx)),\n\t\t\t\traw(scatterMarker(opts, serColor)),\n\t\t\t\t// Per-point data points (`c:dPt`) MUST precede `c:dLbls` (CT_ScatterSer schema order).\n\t\t\t\traw(makeSeriesDataPointsXml(chartType, obj, opts, scatterVaryColors)),\n\t\t\t\traw(labels),\n\t\t\t\t// Error bars come after dLbls and before xVal/yVal in schema order.\n\t\t\t\traw(makeChartErrorBarsXml(chartType, obj.errorBars, obj)),\n\t\t\t\traw(values),\n\t\t\t\traw(voidEl('c:smooth', { val: opts.lineSmooth ? 1 : 0 })),\n\t\t\t])\n\t\t})\n\t\t.join('')\n\n\treturn el(`c:${chartType}Chart`, null, [\n\t\traw(voidEl('c:scatterStyle', { val: 'lineMarker' })),\n\t\traw(voidEl('c:varyColors', { val: 0 })),\n\t\traw(sers),\n\t\traw(chartDataLabels(opts, false)),\n\t\t// Axis id order matters: category comes first.\n\t\traw(voidEl('c:axId', { val: catAxisId })),\n\t\traw(voidEl('c:axId', { val: valAxisId })),\n\t])\n}\n","/**\n * ts-pptx: Bubble Plot Assembly\n *\n * Emits the `<c:bubbleChart>` plot element for `bubble` and `bubble3D`. Like scatter it\n * takes X values from the first data row, and adds a third `<c:bubbleSize>` cache per\n * series. Reached through {@link ./chart-xml}'s `makeChartType` dispatch.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_SHAPE_SHADOW } from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { createShadowEffectLst } from '../drawingml/effect.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { resolveBorderWidth } from '../drawingml/line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { FIXED_PCT_PER_PERCENT, ptToHundredths } from '../../units.js'\nimport { dataSizes, dataValues, sheetCellRef, sheetRangeRef } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tcreateChartTextFonts,\n\tnumCachePt,\n\tnumRefBlock,\n\tpaletteColor,\n\tresolveChartPalette,\n\tstrRefBlock,\n} from './chart-parts.js'\n\n/** Fill + outline + shadow for one bubble series, from the palette colour and the line options. */\nfunction bubbleSerShapeProps(opts: ChartOptsInternal, serColor: string, serIndex: number): string {\n\tconst fill =\n\t\tserColor === 'transparent'\n\t\t\t? voidEl('a:noFill')\n\t\t\t: opts.chartColorsOpacity\n\t\t\t\t? el(\n\t\t\t\t\t\t'a:solidFill',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tcreateColorElement(\n\t\t\t\t\t\t\t\tserColor,\n\t\t\t\t\t\t\t\tvoidEl('a:alpha', { val: Math.round(opts.chartColorsOpacity * FIXED_PCT_PER_PERCENT) })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t: genXmlColorSelection(serColor)\n\tconst line =\n\t\topts.lineSize === 0\n\t\t\t? el('a:ln', null, raw(voidEl('a:noFill')))\n\t\t\t: opts.dataBorder\n\t\t\t\t? el('a:ln', { w: ptsToEmuLenient(resolveBorderWidth(opts.dataBorder, 0.75)), cap: 'flat' }, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tgenXmlColorSelection({\n\t\t\t\t\t\t\t\tcolor: opts.dataBorder.color ?? '363636',\n\t\t\t\t\t\t\t\ttransparency: opts.dataBorder.transparency,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t\t])\n\t\t\t\t: el('a:ln', { w: ptsToEmuLenient(opts.lineSize ?? 2), cap: 'flat' }, [\n\t\t\t\t\t\traw(genXmlColorSelection(serColor)),\n\t\t\t\t\t\traw(voidEl('a:prstDash', { val: opts.lineDashValues?.[serIndex] ?? opts.lineDash ?? 'solid' })),\n\t\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t\t])\n\treturn el('c:spPr', null, [raw(fill), raw(line), raw(createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW))])\n}\n\n/**\n * The `<c:bubbleSize>` cache: the per-point sizes that scale each bubble. Its own block rather\n * than {@link numRefBlock} because the wrapping tag differs and so does the indentation — the\n * `<c:ptCount>` here sits three spaces further in than anything around it.\n */\nfunction bubbleSizeBlock(obj: OptsChartDataInternal, ref: string): string {\n\tconst sizes = dataSizes(obj)\n\tconst numCache = el(\n\t\t'c:numCache',\n\t\tnull,\n\t\t[\n\t\t\traw(el('c:formatCode', null, 'General', { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:ptCount', { val: sizes.length }, { openPrefix: ' ' })),\n\t\t\traw(sizes.map((value, idx) => numCachePt(idx, value)).join('')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst numRef = el('c:numRef', null, [raw(el('c:f', null, ref)), raw(numCache)], {\n\t\topenPrefix: ' ',\n\t\tclosePrefix: ' ',\n\t})\n\treturn el('c:bubbleSize', null, raw(numRef), { openPrefix: ' ', closePrefix: ' ' })\n}\n\n/** The shared `<c:dLbls>` block: number format, label text style, and which parts are shown. */\nfunction bubbleDataLabels(opts: ChartOptsInternal): string {\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tb: opts.dataLabelFontBold ? 1 : 0,\n\t\t\ti: opts.dataLabelFontItalic ? 1 : 0,\n\t\t\tstrike: 'noStrike',\n\t\t\tsz: ptToHundredths(opts.dataLabelFontSize || DEF_FONT_SIZE),\n\t\t\tu: 'none',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(opts.dataLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(createChartTextFonts(opts.dataLabelFontFace || 'Arial')),\n\t\t]\n\t)\n\tconst txPr = el('c:txPr', null, [\n\t\traw(voidEl('a:bodyPr')),\n\t\traw(voidEl('a:lstStyle')),\n\t\traw(el('a:p', null, raw(el('a:pPr', null, raw(defRPr))))),\n\t])\n\t// The 2012 chart extension carrying the leader-line toggle; it has no c: equivalent.\n\tconst extLst = el(\n\t\t'c:extLst',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'c:ext',\n\t\t\t\t{\n\t\t\t\t\turi: '{CE6537A1-D6FC-4f65-9D91-7224C49458BB}',\n\t\t\t\t\t'xmlns:c15': 'http://schemas.microsoft.com/office/drawing/2012/chart',\n\t\t\t\t},\n\t\t\t\traw(voidEl('c15:showLeaderLines', { val: opts.showLeaderLines ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t)\n\t)\n\treturn el('c:dLbls', null, [\n\t\traw(voidEl('c:numFmt', { formatCode: (opts.dataLabelFormatCode ?? '') || 'General', sourceLinked: 0 })),\n\t\traw(txPr),\n\t\topts.dataLabelPosition ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition })) : null,\n\t\traw(voidEl('c:showLegendKey', { val: 0 })),\n\t\traw(voidEl('c:showVal', { val: opts.showValue ? 1 : 0 })),\n\t\traw(voidEl('c:showCatName', { val: 0 })),\n\t\traw(voidEl('c:showSerName', { val: opts.showSerName ? 1 : 0 })),\n\t\traw(voidEl('c:showPercent', { val: 0 })),\n\t\traw(voidEl('c:showBubbleSize', { val: opts.showBubbleSize ? 1 : 0 })),\n\t\traw(extLst),\n\t])\n}\n\n/**\n * Plot a bubble / bubble3d chart into `<c:bubbleChart>` (X/Y plus per-point size).\n */\nexport function makeBubblePlot(\n\tchartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string,\n\tvalFmtCode: string\n): string {\n\t/*\n\t\t\t\t`data` = [\n\t\t\t\t\t{ name:'X-Axis', values:[1,2,3,4,5,6,7,8,9,10,11,12] },\n\t\t\t\t\t{ name:'Y-Values 1', values:[13, 20, 21, 25], sizes:[10, 5, 20, 15] },\n\t\t\t\t\t{ name:'Y-Values 2', values:[ 1, 2, 5, 9], sizes:[ 5, 3, 9, 3] }\n\t\t\t\t];\n */\n\tconst chartColors = resolveChartPalette(opts)\n\t// X values come from the first row; each later row is one series, and consumes two sheet\n\t// columns — its Y values and its sizes.\n\tconst xValues = dataValues(data[0])\n\tlet idxColLtr = 1\n\n\t// One series per Y-Axis row.\n\tconst sers = data\n\t\t.slice(1)\n\t\t.map((obj, idx) => {\n\t\t\tconst name = strRefBlock(sheetCellRef(idxColLtr + 1, 1), obj.name ?? '')\n\t\t\tconst spPr = bubbleSerShapeProps(opts, paletteColor(chartColors, idx), idx)\n\t\t\t// The Y series is cached against the X series' length, so a caller who supplied fewer Y\n\t\t\t// values than X leaves gaps rather than a short cache.\n\t\t\tconst yValues = dataValues(obj)\n\t\t\tconst xVal = numRefBlock('c:xVal', `Sheet1!$A$2:$A$${xValues.length + 1}`, valFmtCode, xValues)\n\t\t\tconst yVal = numRefBlock(\n\t\t\t\t'c:yVal',\n\t\t\t\tsheetRangeRef(idxColLtr + 1, 2, idxColLtr + 1, xValues.length + 1),\n\t\t\t\tvalFmtCode,\n\t\t\t\txValues.map((_value, i) => yValues[i]),\n\t\t\t\t'' // bubble's yVal has never indented its `<c:f>`; see numRefBlock\n\t\t\t)\n\t\t\tidxColLtr++\n\t\t\tconst sizeRef = sheetRangeRef(idxColLtr + 1, 2, idxColLtr + 1, dataSizes(obj).length + 1)\n\t\t\tidxColLtr++\n\t\t\treturn el('c:ser', null, [\n\t\t\t\traw(voidEl('c:idx', { val: idx }, { openPrefix: ' ' })),\n\t\t\t\traw(voidEl('c:order', { val: idx }, { openPrefix: ' ' })),\n\t\t\t\traw(name),\n\t\t\t\traw(spPr),\n\t\t\t\t// No `<c:dLbls>` per series — the chart-level block below carries the labels.\n\t\t\t\traw(xVal),\n\t\t\t\traw(yVal),\n\t\t\t\traw(bubbleSizeBlock(obj, sizeRef)),\n\t\t\t\traw(voidEl('c:bubble3D', { val: chartType === ChartType.bubble3d ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\t])\n\t\t})\n\t\t.join('')\n\n\t// `<c:bubbleScale>` / `<c:showNegBubbles>` are intentionally omitted so PowerPoint applies its\n\t// own defaults; no library option exposes them yet.\n\treturn el('c:bubbleChart', null, [\n\t\traw(voidEl('c:varyColors', { val: 0 })),\n\t\traw(sers),\n\t\traw(bubbleDataLabels(opts)),\n\t\t// Axis id order matters: category comes first.\n\t\traw(voidEl('c:axId', { val: catAxisId })),\n\t\traw(voidEl('c:axId', { val: valAxisId })),\n\t])\n}\n","/**\n * ts-pptx: Pie & Doughnut Plot Assembly\n *\n * Emits the `<c:pieChart>` / `<c:doughnutChart>` plot elements. These are the only\n * families with no axes at all -- a single series, one `<c:dPt>` per slice carrying its\n * own fill, and optional leader lines -- so the builder takes no axis ids. Reached\n * through {@link ./chart-xml}'s `makeChartType` dispatch.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_SHAPE_SHADOW } from '../../constants-internal.js'\nimport type { ChartDataPointStyle } from '../../types/chart.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { createShadowEffectLst } from '../drawingml/effect.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { resolveBorderWidth } from '../drawingml/line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { ptToHundredths } from '../../units.js'\nimport { dataValues, firstLabelGroup } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tcreateChartBorderLine,\n\tcreateChartTextFonts,\n\tcreateLeaderLinesElement,\n\tpaletteColor,\n\tresolveChartPalette,\n\tstrRefBlock,\n} from './chart-parts.js'\n\n/** The label run properties both `<c:txPr>` spellings share, differing only in their indentation. */\nfunction labelDefRPr(opts: ChartOptsInternal, fontsIndent: string, fmt: { openPrefix: string; closePrefix: string }) {\n\treturn el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tsz: ptToHundredths(opts.dataLabelFontSize || DEF_FONT_SIZE),\n\t\t\tb: opts.dataLabelFontBold ? 1 : 0,\n\t\t\ti: opts.dataLabelFontItalic ? 1 : 0,\n\t\t\tu: 'none',\n\t\t\tstrike: 'noStrike',\n\t\t},\n\t\t[\n\t\t\traw(genXmlColorSelection(opts.dataLabelColor || DEF_FONT_COLOR)),\n\t\t\traw(fontsIndent + createChartTextFonts(opts.dataLabelFontFace || 'Arial')),\n\t\t],\n\t\tfmt\n\t)\n}\n\n/** One `<c:dPt>`: the slice's own fill, its border override, and the shared shadow. */\nfunction pieDataPoint(\n\tidx: number,\n\tptStyle: ChartDataPointStyle | undefined,\n\topts: ChartOptsInternal,\n\tfallbackColor: string\n): string {\n\t// A per-point border override takes precedence over the chart-level `dataBorder`.\n\tconst border = ptStyle?.border\n\t\t? createChartBorderLine(ptStyle.border)\n\t\t: opts.dataBorder\n\t\t\t? el('a:ln', { w: ptsToEmuLenient(resolveBorderWidth(opts.dataBorder, 0.75)), cap: 'flat' }, [\n\t\t\t\t\traw(\n\t\t\t\t\t\tgenXmlColorSelection({\n\t\t\t\t\t\t\tcolor: opts.dataBorder.color ?? '363636',\n\t\t\t\t\t\t\ttransparency: opts.dataBorder.transparency,\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t])\n\t\t\t: ''\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(el('a:solidFill', null, raw(createColorElement(ptStyle?.fill || fallbackColor)))),\n\t\t\traw(border),\n\t\t\traw(createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW)),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:dPt', null, [\n\t\traw(voidEl('c:idx', { val: idx }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:bubble3D', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(spPr),\n\t])\n}\n\n/**\n * One `<c:dLbl>`: a pie labels its points, not its series, so every slice carries its own copy of\n * the number format, text style and show flags. A `customLabels` entry replaces the value with\n * literal rich text, which is why it also forces `<c:showVal>` off.\n */\nfunction pieDataLabel(idx: number, customLbl: string | undefined, opts: ChartOptsInternal, chartType: ChartType) {\n\tconst numFmt = voidEl(\n\t\t'c:numFmt',\n\t\t{ formatCode: (opts.dataLabelFormatCode ?? '') || 'General', sourceLinked: 0 },\n\t\t{ openPrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('a:bodyPr', null, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:lstStyle')),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('a:pPr', null, raw(labelDefRPr(opts, ' ', { openPrefix: ' ', closePrefix: ' ' })), {\n\t\t\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ closePrefix: ' ' }\n\t)\n\treturn el(\n\t\t'c:dLbl',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:idx', { val: idx }, { openPrefix: ' ' })),\n\t\t\t// `c:tx` must precede `c:numFmt` per CT_DLbl / Group_DLbl / EG_DLblShared schema order.\n\t\t\tcustomLbl\n\t\t\t\t? raw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'c:tx',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel('c:rich', null, [\n\t\t\t\t\t\t\t\t\traw(voidEl('a:bodyPr')),\n\t\t\t\t\t\t\t\t\traw(voidEl('a:lstStyle')),\n\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t\t'a:p',\n\t\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\t\t\tel('a:r', null, [\n\t\t\t\t\t\t\t\t\t\t\t\t\traw(voidEl('a:rPr', { lang: opts.lang || 'en-US', dirty: 0 })),\n\t\t\t\t\t\t\t\t\t\t\t\t\traw(el('a:t', null, customLbl)),\n\t\t\t\t\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t: null,\n\t\t\traw(numFmt),\n\t\t\traw(voidEl('c:spPr', null, { openPrefix: ' ' })),\n\t\t\traw(txPr),\n\t\t\tchartType === ChartType.pie && opts.dataLabelPosition\n\t\t\t\t? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition }))\n\t\t\t\t: null,\n\t\t\traw(voidEl('c:showLegendKey', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showVal', { val: customLbl ? 0 : opts.showValue ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showCatName', { val: opts.showLabel ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showSerName', { val: opts.showSerName ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showPercent', { val: opts.showPercent ? 1 : 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:showBubbleSize', { val: 0 }, { openPrefix: ' ' })),\n\t\t],\n\t\t{ closePrefix: ' ' }\n\t)\n}\n\n/** The `<c:cat>` slice-name reference and the `<c:val>` cache, both keyed on the label count. */\nfunction pieCategories(labels: string[]): string {\n\tconst strCache = el(\n\t\t'c:strCache',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:ptCount', { val: labels.length }, { openPrefix: ' ' })),\n\t\t\traw(labels.map((label, idx) => el('c:pt', { idx }, raw(el('c:v', null, label)))).join('')),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst strRef = el(\n\t\t'c:strRef',\n\t\tnull,\n\t\t[raw(el('c:f', null, `Sheet1!$A$2:$A$${labels.length + 1}`, { openPrefix: ' ' })), raw(strCache)],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:cat', null, raw(strRef))\n}\n\n/** The `<c:val>` numeric cache. A missing value keeps its `<c:pt>` with an empty `<c:v>`. */\nfunction pieValues(obj: OptsChartDataInternal, count: number, valFmtCode: string): string {\n\tconst points = dataValues(obj)\n\t\t.map((value, idx) => el('c:pt', { idx }, raw(el('c:v', null, value || value === 0 ? value : ''))))\n\t\t.join('')\n\tconst numCache = el(\n\t\t'c:numCache',\n\t\tnull,\n\t\t[\n\t\t\traw(el('c:formatCode', null, valFmtCode, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:ptCount', { val: count }, { openPrefix: ' ' })),\n\t\t\traw(points),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst numRef = el(\n\t\t'c:numRef',\n\t\tnull,\n\t\t[raw(el('c:f', null, `Sheet1!$B$2:$B$${count + 1}`, { openPrefix: ' ' })), raw(numCache)],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:val', null, raw(numRef), { openPrefix: ' ', closePrefix: ' ' })\n}\n\n/**\n * Plot a single-series pie / doughnut chart into `<c:pieChart>` / `<c:doughnutChart>`.\n */\nexport function makePiePlot(\n\tchartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalFmtCode: string\n): string {\n\t/* EX:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Project Status',\n\t\t\t\t labels: ['Red', 'Amber', 'Green', 'Unknown'],\n\t\t\t\t values: [10, 20, 38, 2]\n\t\t\t\t }\n\t\t\t\t]\n */\n\tconst optsChartData = data[0]\n\tif (!optsChartData) return ''\n\tconst chartColors = resolveChartPalette(opts)\n\tconst labels = firstLabelGroup(optsChartData)\n\n\t// The series' own shape props are a placeholder — every slice overrides them in its `<c:dPt>`.\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(el('a:solidFill', null, raw(voidEl('a:schemeClr', { val: 'accent1' })), { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:ln',\n\t\t\t\t\t{ w: 9525, cap: 'flat' },\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:srgbClr', { val: 'F9F9F9' })))),\n\t\t\t\t\t\traw(voidEl('a:prstDash', { val: 'solid' })),\n\t\t\t\t\t\traw(voidEl('a:round')),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(opts.dataNoEffects ? voidEl('a:effectLst') : createShadowEffectLst(opts.shadow, DEF_SHAPE_SHADOW)),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\n\t// The plot-level `<c:dLbls>` carries the defaults; the per-point ones above it carry the overrides.\n\tconst dLbls = el('c:dLbls', null, [\n\t\traw(labels.map((_label, idx) => pieDataLabel(idx, optsChartData.customLabels?.[idx], opts, chartType)).join('')),\n\t\traw(\n\t\t\tvoidEl(\n\t\t\t\t'c:numFmt',\n\t\t\t\t{ formatCode: (opts.dataLabelFormatCode ?? '') || 'General', sourceLinked: 0 },\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'c:txPr',\n\t\t\t\tnull,\n\t\t\t\t[\n\t\t\t\t\traw(voidEl('a:bodyPr', null, { openPrefix: ' ' })),\n\t\t\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'a:p',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t'a:pPr',\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\traw(labelDefRPr(opts, ' ', { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\tchartType === ChartType.pie ? raw(voidEl('c:dLblPos', { val: opts.dataLabelPosition || 'ctr' })) : null,\n\t\traw(voidEl('c:showLegendKey', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showVal', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showCatName', { val: 1 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showSerName', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showPercent', { val: 1 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showBubbleSize', { val: 0 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showLeaderLines', { val: opts.showLeaderLines ? 1 : 0 }, { openPrefix: ' ' })),\n\t\traw(createLeaderLinesElement(opts)),\n\t])\n\n\tconst ser = el(\n\t\t'c:ser',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:idx', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('c:order', { val: 0 }, { openPrefix: ' ' })),\n\t\t\traw(strRefBlock('Sheet1!$B$1', optsChartData.name ?? '', 'expanded')),\n\t\t\traw(spPr),\n\t\t\traw(\n\t\t\t\tlabels\n\t\t\t\t\t.map((_label, idx) =>\n\t\t\t\t\t\tpieDataPoint(idx, optsChartData.pointStyles?.[idx], opts, paletteColor(chartColors, idx))\n\t\t\t\t\t)\n\t\t\t\t\t.join('')\n\t\t\t),\n\t\t\traw(dLbls),\n\t\t\traw(pieCategories(labels)),\n\t\t\traw(pieValues(optsChartData, labels.length, valFmtCode)),\n\t\t],\n\t\t{ closePrefix: ' ' }\n\t)\n\n\treturn el(`c:${chartType}Chart`, null, [\n\t\traw(voidEl('c:varyColors', { val: 1 }, { openPrefix: ' ' })),\n\t\traw(ser),\n\t\traw(\n\t\t\tvoidEl('c:firstSliceAng', { val: opts.firstSliceAng ? Math.round(opts.firstSliceAng) : 0 }, { openPrefix: ' ' })\n\t\t),\n\t\tchartType === ChartType.doughnut\n\t\t\t? raw(voidEl('c:holeSize', { val: typeof opts.holeSize === 'number' ? opts.holeSize : 50 }))\n\t\t\t: null,\n\t])\n}\n","/**\n * ts-pptx: Stock (High-Low-Close) Plot Assembly\n *\n * Emits the classic `<c:stockChart>` element (plus, for the volume styles, a leading\n * `<c:barChart>` volume series on a secondary axis pair). A stock chart is a fixed-order\n * multi-series line chart drawn with invisible lines: `<c:hiLowLines>` connect the\n * high/low of each category, and the open-high-low-close styles add `<c:upDownBars>`.\n * Reached through {@link ./chart-xml}'s `makeChartType` dispatch; its axes are built by\n * the stock branch of `makeChartAxesXml` (which reuses {@link ./chart-axes}).\n */\n\nimport { ChartType } from '../../enums.js'\nimport {\n\tAXIS_ID_CATEGORY_PRIMARY,\n\tAXIS_ID_CATEGORY_SECONDARY,\n\tAXIS_ID_VALUE_PRIMARY,\n\tAXIS_ID_VALUE_SECONDARY,\n} from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { dataLabels, dataValues, firstLabelGroup, sheetCellRef, sheetRangeRef } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport {\n\tcatRefBlock,\n\tdimmedTextFill,\n\tdimmedTextLine,\n\tnumCachePt,\n\tpaletteColor,\n\tresolveChartPalette,\n\tstrRefBlock,\n} from './chart-parts.js'\n\ntype StockStyle = 'hlc' | 'ohlc' | 'vhlc' | 'vohlc'\n\n/**\n * Per-style stock chart geometry: how many value series the style expects, whether the first\n * series is a Volume column drawn as a bar (on its own axis pair), and whether the open-close\n * `<c:upDownBars>` are drawn. HLC/VHLC are three-value (no open) and instead mark the close\n * with a dot; OHLC/VOHLC are four-value and use up/down bars for the open-close body.\n */\nconst STOCK_STYLE_SPEC: Record<StockStyle, { seriesCount: number; volume: boolean; upDownBars: boolean }> = {\n\thlc: { seriesCount: 3, volume: false, upDownBars: false },\n\tohlc: { seriesCount: 4, volume: false, upDownBars: true },\n\tvhlc: { seriesCount: 4, volume: true, upDownBars: false },\n\tvohlc: { seriesCount: 5, volume: true, upDownBars: true },\n}\n\n/** True when the given (already-normalized) stock style leads with a Volume bar series. */\nexport const isVolumeStockStyle = (style: StockStyle | undefined): boolean => !!style && STOCK_STYLE_SPEC[style].volume\n\n/** Minimal `<c:dLbls>` block (all labels off) shared by the stock and volume-bar subcharts. */\nconst STOCK_DLBLS = el('c:dLbls', null, [\n\traw(voidEl('c:showLegendKey', { val: 0 })),\n\traw(voidEl('c:showVal', { val: 0 })),\n\traw(voidEl('c:showCatName', { val: 0 })),\n\traw(voidEl('c:showSerName', { val: 0 })),\n\traw(voidEl('c:showPercent', { val: 0 })),\n\traw(voidEl('c:showBubbleSize', { val: 0 })),\n])\n\n/** Emit the shared `<c:cat>` + `<c:val>` refs for a stock/volume series (single-level categories). */\nfunction stockCatVal(obj: OptsChartDataInternal, opts: ChartOptsInternal, valFmtCode: string): string {\n\tconst cats = firstLabelGroup(obj)\n\tconst valColRow = obj._dataIndex + dataLabels(obj).length + 1\n\tconst catRef = `Sheet1!$A$2:$A$${cats.length + 1}`\n\t// Numeric categories (dates) take a `numRef` carrying the source format, so PowerPoint renders\n\t// them as dates rather than serial numbers; text ones take a plain `strRef`.\n\tconst cat = el(\n\t\t'c:cat',\n\t\tnull,\n\t\traw(\n\t\t\topts.catLabelFormatCode\n\t\t\t\t? catRefBlock('num', catRef, cats, opts.catLabelFormatCode || 'General')\n\t\t\t\t: catRefBlock('str', catRef, cats)\n\t\t)\n\t)\n\tconst numCache = el('c:numCache', null, [\n\t\traw(el('c:formatCode', null, valFmtCode)),\n\t\traw(voidEl('c:ptCount', { val: cats.length })),\n\t\traw(\n\t\t\tdataValues(obj)\n\t\t\t\t.map((value, idx) => numCachePt(idx, value))\n\t\t\t\t.join('')\n\t\t),\n\t])\n\tconst numRef = el('c:numRef', null, [\n\t\traw(el('c:f', null, sheetRangeRef(valColRow, 2, valColRow, cats.length + 1))),\n\t\traw(numCache),\n\t])\n\treturn cat + el('c:val', null, raw(numRef))\n}\n\n/** Emit the `<c:tx>` series-name reference for a stock/volume series. */\nfunction stockSeriesName(obj: OptsChartDataInternal): string {\n\tconst nameCol = obj._dataIndex + dataLabels(obj).length + 1\n\treturn strRefBlock(sheetCellRef(nameCol, 1), obj.name ?? '', 'compact')\n}\n\n/** Emit a single stock (line) series: invisible line, optional close-marker, cat/val refs. */\nfunction makeStockLineSer(\n\tobj: OptsChartDataInternal,\n\topts: ChartOptsInternal,\n\tvalFmtCode: string,\n\tmarkCloseColor: string | null\n): string {\n\t// Stock series draw no line themselves (the hi-low lines / up-down bars carry the visual).\n\tconst spPr = el('c:spPr', null, [\n\t\traw(el('a:ln', { w: 19050, cap: 'rnd' }, [raw(voidEl('a:noFill')), raw(voidEl('a:round'))])),\n\t\traw(voidEl('a:effectLst')),\n\t])\n\tconst marker = markCloseColor\n\t\t? el('c:marker', null, [\n\t\t\t\traw(voidEl('c:symbol', { val: 'dot' })),\n\t\t\t\traw(voidEl('c:size', { val: 5 })),\n\t\t\t\traw(\n\t\t\t\t\tel('c:spPr', null, [\n\t\t\t\t\t\traw(genXmlColorSelection(markCloseColor)),\n\t\t\t\t\t\traw(el('a:ln', { w: 9525 }, raw(genXmlColorSelection(markCloseColor)))),\n\t\t\t\t\t\traw(voidEl('a:effectLst')),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t: el('c:marker', null, raw(voidEl('c:symbol', { val: 'none' })))\n\treturn el('c:ser', null, [\n\t\traw(voidEl('c:idx', { val: obj._dataIndex })),\n\t\traw(voidEl('c:order', { val: obj._dataIndex })),\n\t\traw(stockSeriesName(obj)),\n\t\traw(spPr),\n\t\traw(marker),\n\t\traw(stockCatVal(obj, opts, valFmtCode)),\n\t\traw(voidEl('c:smooth', { val: 0 })),\n\t])\n}\n\n/**\n * Plot a stock chart. For `vhlc`/`vohlc` the first data series is a Volume column drawn as a\n * `<c:barChart>` on the primary axis pair, with the remaining high/low/close(/open) series in a\n * `<c:stockChart>` on the secondary axis pair; the non-volume styles draw only the stock chart on\n * the primary pair. `valAxisId`/`catAxisId` are the primary ids passed by the dispatch.\n */\nexport function makeStockPlot(\n\t_chartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string,\n\tvalFmtCode: string\n): string {\n\tconst spec = STOCK_STYLE_SPEC[(opts.stockStyle as StockStyle) || 'hlc']\n\tconst chartColors = resolveChartPalette(opts)\n\tconst volumeSeries = spec.volume ? data[0] : null\n\tconst stockSeries = spec.volume ? data.slice(1) : data\n\tlet strXml = ''\n\n\t// VOLUME: a bar series on the PRIMARY axis pair (drawn behind the price series).\n\tif (volumeSeries) {\n\t\tconst volumeSer = el('c:ser', null, [\n\t\t\traw(voidEl('c:idx', { val: volumeSeries._dataIndex })),\n\t\t\traw(voidEl('c:order', { val: volumeSeries._dataIndex })),\n\t\t\traw(stockSeriesName(volumeSeries)),\n\t\t\traw(el('c:spPr', null, raw(genXmlColorSelection(chartColors[0] ?? '4472C4')))),\n\t\t\traw(voidEl('c:invertIfNegative', { val: 0 })),\n\t\t\traw(stockCatVal(volumeSeries, opts, valFmtCode)),\n\t\t])\n\t\tstrXml += el('c:barChart', null, [\n\t\t\traw(voidEl('c:barDir', { val: 'col' })),\n\t\t\traw(voidEl('c:grouping', { val: 'clustered' })),\n\t\t\traw(voidEl('c:varyColors', { val: 0 })),\n\t\t\traw(volumeSer),\n\t\t\traw(STOCK_DLBLS),\n\t\t\traw(voidEl('c:gapWidth', { val: 150 })),\n\t\t\traw(voidEl('c:axId', { val: AXIS_ID_CATEGORY_PRIMARY })),\n\t\t\traw(voidEl('c:axId', { val: AXIS_ID_VALUE_PRIMARY })),\n\t\t])\n\t}\n\n\t// STOCK: the price series drawn with invisible lines + hi-low lines (+ up-down bars for OHLC).\n\tconst sers = stockSeries\n\t\t.map((obj, idx) => {\n\t\t\t// HLC/VHLC (no up-down bars) mark the final \"close\" series with a dot so it reads on the chart.\n\t\t\tconst isClose = !spec.upDownBars && idx === stockSeries.length - 1\n\t\t\tconst markColor = isClose ? paletteColor(chartColors, obj._dataIndex, 'ED7D31') : null\n\t\t\treturn makeStockLineSer(obj, opts, valFmtCode, markColor)\n\t\t})\n\t\t.join('')\n\tconst hiLowLines = el(\n\t\t'c:hiLowLines',\n\t\tnull,\n\t\traw(el('c:spPr', null, [raw(dimmedTextLine(75000, 25000)), raw(voidEl('a:effectLst'))]))\n\t)\n\t// The up bar is a hollow body (background fill), the down bar a filled one; both are outlined in\n\t// the same grey, which is how a rising and a falling category tell themselves apart.\n\tconst upDownBars = spec.upDownBars\n\t\t? el('c:upDownBars', null, [\n\t\t\t\traw(voidEl('c:gapWidth', { val: 150 })),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'c:upBars',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('c:spPr', null, [\n\t\t\t\t\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:schemeClr', { val: 'bg1' })))),\n\t\t\t\t\t\t\t\traw(dimmedTextLine(65000, 35000)),\n\t\t\t\t\t\t\t\traw(voidEl('a:effectLst')),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'c:downBars',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('c:spPr', null, [\n\t\t\t\t\t\t\t\traw(dimmedTextFill(65000, 35000)),\n\t\t\t\t\t\t\t\traw(dimmedTextLine(65000, 35000)),\n\t\t\t\t\t\t\t\traw(voidEl('a:effectLst')),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t])\n\t\t: ''\n\t// Volume styles put the price series on the SECONDARY axis pair (the bar owns the primary pair).\n\tconst stockCatId = spec.volume ? AXIS_ID_CATEGORY_SECONDARY : catAxisId\n\tconst stockValId = spec.volume ? AXIS_ID_VALUE_SECONDARY : valAxisId\n\tstrXml += el('c:stockChart', null, [\n\t\traw(sers),\n\t\traw(STOCK_DLBLS),\n\t\traw(hiLowLines),\n\t\traw(upDownBars),\n\t\traw(voidEl('c:axId', { val: stockCatId })),\n\t\traw(voidEl('c:axId', { val: stockValId })),\n\t])\n\n\treturn strXml\n}\n","/**\n * ts-pptx: Surface Plot Assembly\n *\n * Emits the classic `<c:surface3DChart>` (a 3-D surface) or `<c:surfaceChart>` (a 2-D\n * contour / top view), selected by the `surface3D` option; `wireframe` toggles the\n * mesh-only look. A surface chart interpolates a colored sheet over the category (X) and\n * series (Z) axes with the value as height (Y), so — like `bar3D` — it needs all three\n * axes and a `<c:view3D>` + floor/side/back walls (emitted by the surface branch of\n * `makeChartHeaderXml`). Reached through {@link ./chart-xml}'s `makeChartType` dispatch.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { AXIS_ID_SERIES_PRIMARY } from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal } from '../../types/internal.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { dataLabels, dataValues, firstLabelGroup, sheetCellRef, sheetRangeRef } from './data-refs.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { catRefBlock, numCachePt, paletteColor, resolveChartPalette, strRefBlock } from './chart-parts.js'\n\n/** True when the (normalized) surface options select the 3-D surface rather than a 2-D contour. */\nconst isSurface3D = (opts: ChartOptsInternal): boolean => opts.surface3D !== false\n\n/** Emit the shared `<c:cat>` (strRef) + `<c:val>` (numRef) refs for a surface series. */\nfunction surfaceCatVal(obj: OptsChartDataInternal, valFmtCode: string): string {\n\tconst cats = firstLabelGroup(obj)\n\tconst valCol = obj._dataIndex + dataLabels(obj).length + 1\n\tconst numCache = el('c:numCache', null, [\n\t\traw(el('c:formatCode', null, valFmtCode)),\n\t\traw(voidEl('c:ptCount', { val: cats.length })),\n\t\traw(\n\t\t\tdataValues(obj)\n\t\t\t\t.map((value, idx) => numCachePt(idx, value))\n\t\t\t\t.join('')\n\t\t),\n\t])\n\tconst numRef = el('c:numRef', null, [\n\t\traw(el('c:f', null, sheetRangeRef(valCol, 2, valCol, cats.length + 1))),\n\t\traw(numCache),\n\t])\n\treturn (\n\t\tel('c:cat', null, raw(catRefBlock('str', `Sheet1!$A$2:$A$${cats.length + 1}`, cats))) +\n\t\tel('c:val', null, raw(numRef))\n\t)\n}\n\n/** Emit a single surface series: name ref, 3-D shape props, and cat/val refs. */\nfunction makeSurfaceSer(obj: OptsChartDataInternal, valFmtCode: string, seriesColor: string): string {\n\tconst nameCol = obj._dataIndex + dataLabels(obj).length + 1\n\t// A surface series carries 3-D shape props; the surface itself is colored by value band, but the\n\t// per-series fill still styles the wireframe / legend key.\n\tconst spPr = el('c:spPr', null, [\n\t\traw(genXmlColorSelection(seriesColor)),\n\t\traw(voidEl('a:ln')),\n\t\traw(voidEl('a:effectLst')),\n\t\traw(voidEl('a:sp3d')),\n\t])\n\treturn el('c:ser', null, [\n\t\traw(voidEl('c:idx', { val: obj._dataIndex })),\n\t\traw(voidEl('c:order', { val: obj._dataIndex })),\n\t\traw(strRefBlock(sheetCellRef(nameCol, 1), obj.name ?? '', 'compact')),\n\t\traw(spPr),\n\t\traw(surfaceCatVal(obj, valFmtCode)),\n\t])\n}\n\n/**\n * Plot a surface chart into a `<c:surface3DChart>` (3-D) or `<c:surfaceChart>` (2-D contour). Every\n * series shares the category axis; the series axis (Z) is the third axis. `valAxisId`/`catAxisId`\n * are the primary ids passed by the dispatch; the series axis uses `AXIS_ID_SERIES_PRIMARY`.\n */\nexport function makeSurfacePlot(\n\t_chartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string,\n\tvalFmtCode: string\n): string {\n\tconst tag = isSurface3D(opts) ? 'surface3DChart' : 'surfaceChart'\n\tconst chartColors = resolveChartPalette(opts)\n\tconst sers = data\n\t\t.map((obj, idx) => makeSurfaceSer(obj, valFmtCode, paletteColor(chartColors, idx, '4472C4')))\n\t\t.join('')\n\treturn el(`c:${tag}`, null, [\n\t\traw(voidEl('c:wireframe', { val: opts.surfaceWireframe ? 1 : 0 })),\n\t\traw(sers),\n\t\t// Surface, value and series axes (category X, value Y/height, series Z).\n\t\traw(voidEl('c:axId', { val: catAxisId })),\n\t\traw(voidEl('c:axId', { val: valAxisId })),\n\t\traw(voidEl('c:axId', { val: AXIS_ID_SERIES_PRIMARY })),\n\t])\n}\n\n/**\n * Build the `<c:view3D>` + floor/side/back walls for a surface chart. A 3-D surface tilts the scene\n * (using the shared `v3DRotX`/`v3DRotY` options, which the define layer defaults to 30); a 2-D\n * contour looks straight down the value axis (rotX 90, flat perspective). These precede\n * `<c:plotArea>` in CT_Chart document order (view3D → floor → sideWall → backWall → plotArea).\n */\nexport function makeSurfaceScene(opts: ChartOptsInternal): string {\n\tconst wall =\n\t\tvoidEl('c:thickness', { val: 0 }) +\n\t\tel('c:spPr', null, [\n\t\t\traw(voidEl('a:noFill')),\n\t\t\traw(el('a:ln', null, raw(voidEl('a:noFill')))),\n\t\t\traw(voidEl('a:effectLst')),\n\t\t\traw(voidEl('a:sp3d')),\n\t\t])\n\tconst scene = isSurface3D(opts)\n\t\t? [\n\t\t\t\traw(voidEl('c:rotX', { val: opts.v3DRotX })),\n\t\t\t\traw(voidEl('c:rotY', { val: opts.v3DRotY })),\n\t\t\t\traw(voidEl('c:rAngAx', { val: 0 })),\n\t\t\t]\n\t\t: // Contour / top view: look straight down the value axis, flat perspective.\n\t\t\t[\n\t\t\t\traw(voidEl('c:rotX', { val: 90 })),\n\t\t\t\traw(voidEl('c:rotY', { val: 0 })),\n\t\t\t\traw(voidEl('c:rAngAx', { val: 0 })),\n\t\t\t\traw(voidEl('c:perspective', { val: 0 })),\n\t\t\t]\n\treturn (\n\t\tel('c:view3D', null, scene) +\n\t\tel('c:floor', null, raw(wall)) +\n\t\tel('c:sideWall', null, raw(wall)) +\n\t\tel('c:backWall', null, raw(wall))\n\t)\n}\n","/**\n * ts-pptx: Chart DrawingML Assembly\n *\n * Builds a chart's `ppt/charts/chartN.xml` -- the `<c:chartSpace>` DrawingML that\n * PowerPoint renders. `makeXmlCharts` assembles the top-level envelope (header, plot\n * area, axes region, legend, metadata) and `makeChartType` dispatches the plot itself to\n * the per-family builder: {@link ./plot-cat-axis} for area/bar/bar3D/line/radar,\n * {@link ./plot-scatter}, {@link ./plot-bubble}, {@link ./plot-pie}. Axes come from\n * {@link ./chart-axes} and the shared leaf fragments from {@link ./chart-parts}.\n *\n * Every function in this directory is a pure string builder -- no I/O, no mutation of\n * the presentation model. The `<c:f>` series formulas here point back at the cells\n * written by the embedded workbook ({@link ./embed-xlsx}); that mapping lives in\n * {@link ./data-refs}.\n */\n\nimport { asChartType, ChartType } from '../../enums.js'\nimport {\n\tAXIS_ID_CATEGORY_PRIMARY,\n\tAXIS_ID_CATEGORY_SECONDARY,\n\tAXIS_ID_SERIES_PRIMARY,\n\tAXIS_ID_VALUE_PRIMARY,\n\tAXIS_ID_VALUE_SECONDARY,\n\tDEF_FONT_SIZE,\n\tDEF_FONT_TITLE_SIZE,\n\tXML_DECL,\n} from '../../constants-internal.js'\nimport type { ChartOptsInternal, OptsChartDataInternal, SlideRelChart } from '../../types/internal.js'\nimport type { BorderProps, ShapeFillProps } from '../../types/index.js'\nimport { warn } from '../../diagnostics.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { resolveBorderWidth } from '../drawingml/line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { ptToHundredths } from '../../units.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { createChartTextFonts, dimmedTextFill, dimmedTextLine, genXmlTitle } from './chart-parts.js'\nimport { makeCatAxis, makeSerAxis, makeValAxis } from './chart-axes.js'\nimport { makeCatAxisPlot } from './plot-cat-axis.js'\nimport { makeScatterPlot } from './plot-scatter.js'\nimport { makeBubblePlot } from './plot-bubble.js'\nimport { makePiePlot } from './plot-pie.js'\nimport { isVolumeStockStyle, makeStockPlot } from './plot-stock.js'\nimport { makeSurfacePlot, makeSurfaceScene } from './plot-surface.js'\nimport { InternalError, InvalidOptionError } from '../../errors.js'\n\n/** The three namespaces every `<c:chartSpace>` declares, in the order PowerPoint writes them. */\nconst CHART_SPACE_NS = {\n\t'xmlns:c': 'http://schemas.openxmlformats.org/drawingml/2006/chart',\n\t'xmlns:a': 'http://schemas.openxmlformats.org/drawingml/2006/main',\n\t'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n}\n\n/**\n * Whether a chart-area/plot-area `fill` says anything the fill dispatch can act on.\n *\n * `c:spPr` is `a:CT_ShapeProperties` — the same optional `EG_FillProperties` group the\n * shape path writes into — so gradient, pattern and an omitted fill child are all legal\n * here. The gate used to be `fill?.color`, which meant every spelling carrying no colour\n * (`gradient`, `pattern`, `image`, `inherit`) fell to the no-fill arm and did nothing.\n *\n * The gate cannot simply be `fill != null`. `normalizeChartOptions` defaults\n * `plotArea.fill` to `{}`, so every chart in existence arrives here with a fill object,\n * and a presence check would paint each one a default grey. The same is true of the one\n * input a caller can write by hand: `{ transparency: 50 }` alone is not a fill, since\n * there is no colour for the alpha to apply to. Both stay no-fill.\n *\n * A payload with no `type` (`{ gradient }`, `{ pattern }`) is likewise not stated, which\n * matches the shape path: only `line` infers its type from a bare `gradient`, fills have\n * always wanted `type: 'gradient'` spelled out.\n */\nfunction isStatedFill(fill?: ShapeFillProps): fill is ShapeFillProps {\n\treturn Boolean(fill?.color || fill?.type)\n}\n\n/**\n * The chart title (or the `autoTitleDeleted` flag that suppresses PowerPoint's default one)\n * followed by the 3-D scene, for the two families that plot into one.\n */\nfunction makeChartHeaderXml(rel: SlideRelChart): string {\n\t// NOTE: `autoTitleDeleted` is emitted in both arms — without it PowerPoint creates a default\n\t// chart title even when `showTitle` is false.\n\tconst title = rel.opts.showTitle\n\t\t? genXmlTitle(\n\t\t\t\t{\n\t\t\t\t\ttitle: rel.opts.title || 'Chart Title',\n\t\t\t\t\tcolor: rel.opts.titleColor,\n\t\t\t\t\tfontFace: rel.opts.titleFontFace,\n\t\t\t\t\tfontSize: rel.opts.titleFontSize || DEF_FONT_TITLE_SIZE,\n\t\t\t\t\ttitleAlign: rel.opts.titleAlign,\n\t\t\t\t\ttitleBold: rel.opts.titleBold,\n\t\t\t\t\ttitleItalic: rel.opts.titleItalic,\n\t\t\t\t\ttitleUnderline: rel.opts.titleUnderline,\n\t\t\t\t\ttitlePos: rel.opts.titlePos,\n\t\t\t\t\ttitleRotate: rel.opts.titleRotate,\n\t\t\t\t},\n\t\t\t\trel.opts.x as number,\n\t\t\t\trel.opts.y as number\n\t\t\t) + voidEl('c:autoTitleDeleted', { val: 0 })\n\t\t: voidEl('c:autoTitleDeleted', { val: 1 })\n\t// 3-D view: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_perspective_topic_ID0E6BUQB.html\n\tif (rel.opts._type === ChartType.bar3d) {\n\t\treturn (\n\t\t\ttitle +\n\t\t\tel('c:view3D', null, [\n\t\t\t\traw(voidEl('c:rotX', { val: rel.opts.v3DRotX })),\n\t\t\t\traw(voidEl('c:rotY', { val: rel.opts.v3DRotY })),\n\t\t\t\traw(voidEl('c:rAngAx', { val: !rel.opts.v3DRAngAx ? 0 : 1 })),\n\t\t\t\traw(voidEl('c:perspective', { val: rel.opts.v3DPerspective })),\n\t\t\t])\n\t\t)\n\t}\n\t// A surface chart is a 3-D scene: view3D + floor/side/back walls precede the plotArea.\n\tif (rel.opts._type === ChartType.surface) return title + makeSurfaceScene(rel.opts)\n\treturn title\n}\n\n/**\n * The plot area's `<c:layout>`. Manual layout is emitted only when the caller asked for one:\n * an empty `<c:layout/>` lets PowerPoint auto-fit, which it does well across all four TRBL\n * legend positions.\n */\nfunction makePlotAreaLayoutXml(rel: SlideRelChart): string {\n\tconst layout = rel.opts.layout\n\tif (!layout) return voidEl('c:layout')\n\tconst manualLayout = el(\n\t\t'c:manualLayout',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('c:layoutTarget', { val: 'inner' }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:xMode', { val: 'edge' }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:yMode', { val: 'edge' }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:x', { val: layout.x || 0 }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:y', { val: layout.y || 0 }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:w', { val: layout.w || 1 }, { closePrefix: ' ' })),\n\t\t\traw(voidEl('c:h', { val: layout.h || 1 }, { closePrefix: ' ' })),\n\t\t],\n\t\t{ childPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:layout', null, raw(manualLayout), { childPrefix: ' ' })\n}\n\n/**\n * Build the category/value/series axis XML (empty for pie/doughnut). Resolves combo-chart\n * category axes to val axes when owned by a scatter/bubble subchart, per the tracked flags.\n */\nfunction makeChartAxesXml(\n\trel: SlideRelChart,\n\tusesSecondaryValAxis: boolean,\n\tusesSecondaryCatAxis: boolean,\n\tprimaryCatAxisValType: ChartType | null,\n\tsecondaryCatAxisValType: ChartType | null,\n\tprimaryCatAxisHasCategoryChart: boolean,\n\tsecondaryCatAxisHasCategoryChart: boolean\n): string {\n\tlet strXml = ''\n\t// Stock charts drive their own (date/category)+value axis pair. The non-volume styles use just\n\t// the primary pair (the generic path below would also produce it), but the volume styles add a\n\t// secondary pair for the price series (the volume bar owns the primary pair) — so route all stock\n\t// axes here, reusing the shared cat/val emitters. `barDir` defaults to 'col' in the define layer,\n\t// which already gives the correct axis positions (category at bottom, value at left).\n\tif (rel.opts._type === ChartType.stock) {\n\t\tlet stockXml = makeCatAxis(rel.opts, AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_VALUE_PRIMARY)\n\t\tstockXml += makeValAxis(rel.opts, AXIS_ID_VALUE_PRIMARY)\n\t\tif (isVolumeStockStyle(rel.opts.stockStyle)) {\n\t\t\t// Secondary value axis (right) for the price series, then a hidden secondary category axis.\n\t\t\tstockXml += makeValAxis(rel.opts, AXIS_ID_VALUE_SECONDARY)\n\t\t\tstockXml += makeCatAxis({ ...rel.opts, catAxisHidden: true }, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_VALUE_SECONDARY)\n\t\t}\n\t\treturn stockXml\n\t}\n\tif (rel.opts._type !== ChartType.pie && rel.opts._type !== ChartType.doughnut) {\n\t\t// Param check\n\t\tif (rel.opts.valAxes && rel.opts.valAxes.length > 1 && !usesSecondaryValAxis) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'chart/secondary-axis-unused',\n\t\t\t\t'Secondary axis must be used by one of the multiple charts'\n\t\t\t)\n\t\t}\n\n\t\t// Resolve the effective `_type` for a combo category axis so scatter/bubble\n\t\t// subcharts get a `<c:valAx>` X axis. Returns the scatter/bubble type when\n\t\t// that axis is owned only by such a subchart, else null (category axis).\n\t\tconst comboCatAxisType = (isSecondary: boolean): { _type: ChartType } | Record<string, never> => {\n\t\t\tconst valType = isSecondary ? secondaryCatAxisValType : primaryCatAxisValType\n\t\t\tconst hasCategoryChart = isSecondary ? secondaryCatAxisHasCategoryChart : primaryCatAxisHasCategoryChart\n\t\t\tif (!valType) return {}\n\t\t\tif (hasCategoryChart) {\n\t\t\t\t// A category-based chart and a scatter/bubble chart cannot share one\n\t\t\t\t// axis (one needs <c:catAx>, the other <c:valAx>). Keep the category\n\t\t\t\t// axis and warn rather than silently emit a repair-triggering file.\n\t\t\t\twarn(\n\t\t\t\t\t'chart/axis-type-conflict',\n\t\t\t\t\t`A category-based chart and a scatter/bubble chart cannot share the same ${isSecondary ? 'secondary' : 'primary'} category axis; emitting a category axis. Put the scatter/bubble series on a separate axis.`\n\t\t\t\t)\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn { _type: valType }\n\t\t}\n\n\t\tif (rel.opts.catAxes) {\n\t\t\tif (!rel.opts.valAxes || rel.opts.valAxes.length !== rel.opts.catAxes.length) {\n\t\t\t\tthrow new InvalidOptionError(\n\t\t\t\t\t'chart/axis-count-mismatch',\n\t\t\t\t\t'There must be the same number of value and category axes.'\n\t\t\t\t)\n\t\t\t}\n\t\t\tstrXml += makeCatAxis(\n\t\t\t\t{ ...rel.opts, ...rel.opts.catAxes[0], ...comboCatAxisType(false) },\n\t\t\t\tAXIS_ID_CATEGORY_PRIMARY,\n\t\t\t\tAXIS_ID_VALUE_PRIMARY\n\t\t\t)\n\t\t} else {\n\t\t\tstrXml += makeCatAxis(\n\t\t\t\t{ ...rel.opts, ...comboCatAxisType(false) },\n\t\t\t\tAXIS_ID_CATEGORY_PRIMARY,\n\t\t\t\tAXIS_ID_VALUE_PRIMARY\n\t\t\t)\n\t\t}\n\n\t\tif (rel.opts.valAxes) {\n\t\t\tstrXml += makeValAxis({ ...rel.opts, ...rel.opts.valAxes[0] }, AXIS_ID_VALUE_PRIMARY)\n\t\t\tif (rel.opts.valAxes[1]) {\n\t\t\t\tstrXml += makeValAxis({ ...rel.opts, ...rel.opts.valAxes[1] }, AXIS_ID_VALUE_SECONDARY)\n\t\t\t}\n\t\t} else {\n\t\t\tstrXml += makeValAxis(rel.opts, AXIS_ID_VALUE_PRIMARY)\n\n\t\t\t// Add series axis for 3D bar and surface (both plot over a category × series grid)\n\t\t\tif (rel.opts._type === ChartType.bar3d || rel.opts._type === ChartType.surface) {\n\t\t\t\tstrXml += makeSerAxis(rel.opts, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY)\n\t\t\t}\n\n\t\t\t// For combo charts referencing a secondary value axis via the\n\t\t\t// `secondaryValAxis: true` flag (without a `valAxes` array),\n\t\t\t// auto-synthesise the missing secondary value axis def so that\n\t\t\t// the axId references in <c:plotArea> all resolve.\n\t\t\tif (usesSecondaryValAxis) {\n\t\t\t\tstrXml += makeValAxis(rel.opts, AXIS_ID_VALUE_SECONDARY)\n\t\t\t}\n\t\t}\n\n\t\t// Combo Charts: Add secondary axes after all vals\n\t\tif (rel.opts?.catAxes && rel.opts?.catAxes[1]) {\n\t\t\tstrXml += makeCatAxis(\n\t\t\t\t{ ...rel.opts, ...rel.opts.catAxes[1], ...comboCatAxisType(true) },\n\t\t\t\tAXIS_ID_CATEGORY_SECONDARY,\n\t\t\t\tAXIS_ID_VALUE_SECONDARY\n\t\t\t)\n\t\t} else if (usesSecondaryCatAxis && (!rel.opts.catAxes || !rel.opts.catAxes[1])) {\n\t\t\t// Same as above for the secondary category axis.\n\t\t\tstrXml += makeCatAxis(\n\t\t\t\t{ ...rel.opts, ...comboCatAxisType(true) },\n\t\t\t\tAXIS_ID_CATEGORY_SECONDARY,\n\t\t\t\tAXIS_ID_VALUE_SECONDARY\n\t\t\t)\n\t\t}\n\t}\n\treturn strXml\n}\n\n/**\n * The `<c:spPr>` shared by the plot area and the chart space: a stated fill or none, a border\n * or an explicit no-line, and an empty effect list. The two differ only in how far in they are\n * indented, which is what `fmt` and `effectIndent` carry.\n */\nfunction chartShapeProps(\n\tfill: ShapeFillProps | undefined,\n\tborder: BorderProps | undefined,\n\teffectIndent: string,\n\tfmt: { openPrefix?: string; closePrefix?: string }\n): string {\n\treturn el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(isStatedFill(fill) ? genXmlColorSelection(fill) : voidEl('a:noFill')),\n\t\t\traw(\n\t\t\t\tborder\n\t\t\t\t\t? el(\n\t\t\t\t\t\t\t'a:ln',\n\t\t\t\t\t\t\t{ w: ptsToEmuLenient(resolveBorderWidth(border, 1)), cap: 'flat' },\n\t\t\t\t\t\t\traw(genXmlColorSelection({ color: border.color ?? '363636', transparency: border.transparency }))\n\t\t\t\t\t\t)\n\t\t\t\t\t: el('a:ln', null, raw(voidEl('a:noFill')))\n\t\t\t),\n\t\t\traw(voidEl('a:effectLst', null, { openPrefix: effectIndent })),\n\t\t],\n\t\tfmt\n\t)\n}\n\n/**\n * The `<c:dTable>` grid drawn under the plot. Sits between the last `</c:valAx>` and the plot\n * area's own `<c:spPr>`.\n */\nfunction makeDataTableXml(rel: SlideRelChart): string {\n\tconst spPr = el(\n\t\t'c:spPr',\n\t\tnull,\n\t\t[\n\t\t\traw(voidEl('a:noFill', null, { openPrefix: ' ' })),\n\t\t\traw(dimmedTextLine(15000, 85000, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:effectLst', null, { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst defRPr = el(\n\t\t'a:defRPr',\n\t\t{\n\t\t\tsz: ptToHundredths(rel.opts.dataTableFontSize || DEF_FONT_SIZE),\n\t\t\tb: 0,\n\t\t\ti: 0,\n\t\t\tu: 'none',\n\t\t\tstrike: 'noStrike',\n\t\t\tkern: 1200,\n\t\t\tbaseline: 0,\n\t\t},\n\t\t[\n\t\t\traw(' ' + dimmedTextFill(65000, 35000)),\n\t\t\traw(voidEl('a:latin', { typeface: '+mn-lt' }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:ea', { typeface: '+mn-ea' }, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:cs', { typeface: '+mn-cs' }, { openPrefix: ' ' })),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\tconst txPr = el(\n\t\t'c:txPr',\n\t\tnull,\n\t\t[\n\t\t\traw(\n\t\t\t\tvoidEl(\n\t\t\t\t\t'a:bodyPr',\n\t\t\t\t\t{\n\t\t\t\t\t\trot: 0,\n\t\t\t\t\t\tspcFirstLastPara: 1,\n\t\t\t\t\t\tvertOverflow: 'ellipsis',\n\t\t\t\t\t\tvert: 'horz',\n\t\t\t\t\t\twrap: 'square',\n\t\t\t\t\t\tanchor: 'ctr',\n\t\t\t\t\t\tanchorCtr: 1,\n\t\t\t\t\t},\n\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:pPr', { rtl: 0 }, raw(defRPr), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t)\n\treturn el('c:dTable', null, [\n\t\traw(voidEl('c:showHorzBorder', { val: !rel.opts.showDataTableHorzBorder ? 0 : 1 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:showVertBorder', { val: !rel.opts.showDataTableVertBorder ? 0 : 1 }, { openPrefix: ' ' })),\n\t\t// These two `val` attributes were written padded into a column with the two above, and that\n\t\t// padding is emitted bytes. `el()` writes exactly one space before an attribute, by design,\n\t\t// so the aligned pair stays hand-written rather than bending the builder around a cosmetic\n\t\t// quirk. Removing the padding is an output change, not a cleanup; the ratchet header says why.\n\t\traw(` <c:showOutline val=\"${!rel.opts.showDataTableOutline ? 0 : 1}\"/>`),\n\t\traw(` <c:showKeys val=\"${!rel.opts.showDataTableKeys ? 0 : 1}\"/>`),\n\t\traw(spPr),\n\t\traw(txPr),\n\t])\n}\n\n/**\n * The `<c:legend>`: position, the entries a combo chart deletes, an optional manual placement,\n * and the text properties when any legend font option is set.\n */\nfunction makeLegendXml(rel: SlideRelChart): string {\n\t// For combo charts: suppress the series belonging to subcharts that set `showLegend: false`.\n\tlet entries = ''\n\tif (Array.isArray(rel.opts._type)) {\n\t\tlet seriesIdx = 0\n\t\tfor (const type of rel.opts._type) {\n\t\t\tif (type.options?.showLegend === false) {\n\t\t\t\tfor (let i = 0; i < type.data.length; i++) {\n\t\t\t\t\tentries += el('c:legendEntry', null, [\n\t\t\t\t\t\traw(voidEl('c:idx', { val: seriesIdx + i })),\n\t\t\t\t\t\traw(voidEl('c:delete', { val: 1 })),\n\t\t\t\t\t])\n\t\t\t\t}\n\t\t\t}\n\t\t\tseriesIdx += type.data.length\n\t\t}\n\t}\n\n\t// Manual legend placement. Each axis of CT_ManualLayout is independent: omitting xMode/x (or\n\t// yMode/y, etc.) leaves that axis on automatic layout. x/y use edge mode so they are absolute\n\t// fractions of the chart; w/h are fractions of the chart size. Schema order: xMode, yMode, x, y, w, h.\n\tconst legendLayout = rel.opts.legendLayout\n\tconst placed = (key: 'x' | 'y' | 'w' | 'h'): boolean => typeof legendLayout?.[key] === 'number'\n\tlet layout = ''\n\tif (placed('x') || placed('y') || placed('w') || placed('h')) {\n\t\tconst modes =\n\t\t\t(placed('x') ? voidEl('c:xMode', { val: 'edge' }) : '') + (placed('y') ? voidEl('c:yMode', { val: 'edge' }) : '')\n\t\tconst vals = (['x', 'y', 'w', 'h'] as const)\n\t\t\t.filter(placed)\n\t\t\t.map((key) => voidEl(`c:${key}`, { val: legendLayout?.[key] }))\n\t\t\t.join('')\n\t\tlayout = el('c:layout', null, raw(el('c:manualLayout', null, raw(modes + vals))))\n\t}\n\n\tlet txPr = ''\n\tif (rel.opts.legendFontFace || rel.opts.legendFontSize || rel.opts.legendColor) {\n\t\t// No `Number()` here, and none at the ten sibling font-size options either: the\n\t\t// option is typed `number`, and a caller from untyped JS who passes a string now\n\t\t// gets `coord/non-finite` from the converter rather than a silent coercion.\n\t\tconst defRPr = el(\n\t\t\t'a:defRPr',\n\t\t\t{ sz: rel.opts.legendFontSize ? ptToHundredths(rel.opts.legendFontSize) : undefined },\n\t\t\t[\n\t\t\t\traw(rel.opts.legendColor ? genXmlColorSelection(rel.opts.legendColor) : ''),\n\t\t\t\traw(rel.opts.legendFontFace ? createChartTextFonts(rel.opts.legendFontFace) : ''),\n\t\t\t],\n\t\t\t{ closePrefix: ' ' }\n\t\t)\n\t\ttxPr = el('c:txPr', null, [\n\t\t\traw(voidEl('a:bodyPr', null, { openPrefix: ' ' })),\n\t\t\traw(voidEl('a:lstStyle', null, { openPrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:p',\n\t\t\t\t\tnull,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('a:pPr', null, raw(defRPr), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' }, { openPrefix: ' ' })),\n\t\t\t\t\t],\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t])\n\t}\n\n\treturn el('c:legend', null, [\n\t\traw(voidEl('c:legendPos', { val: rel.opts.legendPos })),\n\t\traw(entries),\n\t\traw(layout),\n\t\traw(voidEl('c:overlay', { val: 0 })),\n\t\traw(txPr),\n\t])\n}\n\n/**\n * Main entry point method for create charts\n * @see: http://www.datypic.com/sc/ooxml/s-dml-chart.xsd.html\n * @param {SlideRelChart} rel - chart object\n * @return {string} XML\n */\nexport function makeXmlCharts(rel: SlideRelChart): string {\n\t// `chartArea`/`plotArea` are always populated by addChartDefinition() but stay optional on the type.\n\tconst chartArea = rel.opts.chartArea ?? {}\n\tconst plotAreaOpts = rel.opts.plotArea ?? {}\n\tlet usesSecondaryValAxis = false\n\tlet usesSecondaryCatAxis = false\n\t// Combo charts: a scatter/bubble subchart draws numbers on its category (X)\n\t// axis, so that axis must be emitted as a `<c:valAx>` rather than a `<c:catAx>`\n\t// or PowerPoint flags the file for repair. Track, per category axis,\n\t// the scatter/bubble subchart type that owns it (if any) and whether a\n\t// category-based subchart also references it (an unsatisfiable conflict).\n\tlet primaryCatAxisValType: ChartType | null = null\n\tlet secondaryCatAxisValType: ChartType | null = null\n\tlet primaryCatAxisHasCategoryChart = false\n\tlet secondaryCatAxisHasCategoryChart = false\n\n\t// STEP 1: the plot for every subchart's series and points.\n\tlet plots = ''\n\tif (Array.isArray(rel.opts._type)) {\n\t\tfor (const type of rel.opts._type) {\n\t\t\tconst options = { ...rel.opts, ...type.options }\n\t\t\tconst valAxisId = options.secondaryValAxis ? AXIS_ID_VALUE_SECONDARY : AXIS_ID_VALUE_PRIMARY\n\t\t\tconst catAxisId = options.secondaryCatAxis ? AXIS_ID_CATEGORY_SECONDARY : AXIS_ID_CATEGORY_PRIMARY\n\t\t\tusesSecondaryValAxis = usesSecondaryValAxis || (options.secondaryValAxis ?? false)\n\t\t\tusesSecondaryCatAxis = usesSecondaryCatAxis || (options.secondaryCatAxis ?? false)\n\t\t\tconst subType = asChartType(type.type)\n\t\t\t// Record whether this subchart needs a value-based X axis (scatter/bubble)\n\t\t\t// or a category-based X axis, keyed to the primary/secondary cat axis it uses.\n\t\t\tconst usesValueXAxis =\n\t\t\t\tsubType === ChartType.scatter || subType === ChartType.bubble || subType === ChartType.bubble3d\n\t\t\tif (options.secondaryCatAxis) {\n\t\t\t\tif (usesValueXAxis) secondaryCatAxisValType = subType\n\t\t\t\telse secondaryCatAxisHasCategoryChart = true\n\t\t\t} else {\n\t\t\t\tif (usesValueXAxis) primaryCatAxisValType = subType\n\t\t\t\telse primaryCatAxisHasCategoryChart = true\n\t\t\t}\n\t\t\tplots += makeChartType(subType, type.data as OptsChartDataInternal[], options, valAxisId, catAxisId)\n\t\t}\n\t} else if (rel.opts._type) {\n\t\tplots = makeChartType(rel.opts._type, rel.data, rel.opts, AXIS_ID_VALUE_PRIMARY, AXIS_ID_CATEGORY_PRIMARY)\n\t}\n\n\t// STEP 2: the axes the plots just referenced (the flags above decide how many).\n\tconst axes = makeChartAxesXml(\n\t\trel,\n\t\tusesSecondaryValAxis,\n\t\tusesSecondaryCatAxis,\n\t\tprimaryCatAxisValType,\n\t\tsecondaryCatAxisValType,\n\t\tprimaryCatAxisHasCategoryChart,\n\t\tsecondaryCatAxisHasCategoryChart\n\t)\n\n\t// STEP 3: the plot area, then the chart it sits in.\n\tconst plotArea = el('c:plotArea', null, [\n\t\traw(makePlotAreaLayoutXml(rel)),\n\t\traw(plots),\n\t\traw(axes),\n\t\t// NOTE: the data table goes between `</c:valAx>` and `<c:spPr>`.\n\t\trel.opts.showDataTable ? raw(makeDataTableXml(rel)) : null,\n\t\traw(chartShapeProps(plotAreaOpts.fill, plotAreaOpts.border, ' ', { openPrefix: ' ', closePrefix: ' ' })),\n\t])\n\tconst chart = el('c:chart', null, [\n\t\traw(makeChartHeaderXml(rel)),\n\t\traw(plotArea),\n\t\trel.opts.showLegend ? raw(makeLegendXml(rel)) : null,\n\t\traw(voidEl('c:plotVisOnly', { val: 1 }, { openPrefix: ' ' })),\n\t\traw(voidEl('c:dispBlanksAs', { val: rel.opts.displayBlanksAs }, { openPrefix: ' ' })),\n\t\trel.opts._type === ChartType.scatter ? raw(voidEl('c:showDLblsOverMax', { val: 1 })) : null,\n\t])\n\n\t// STEP 4: the chart space around it — shape props, the embedded workbook relationship, and\n\t// the metadata extension (CT_ChartSpace order: externalData → printSettings → userShapes → extLst).\n\treturn (\n\t\tXML_DECL +\n\t\tel('c:chartSpace', CHART_SPACE_NS, [\n\t\t\t// PowerPoint defaults to 1904 dates, Excel to 1900.\n\t\t\traw(voidEl('c:date1904', { val: 0 })),\n\t\t\traw(voidEl('c:roundedCorners', { val: chartArea.roundedCorners ? 1 : 0 })),\n\t\t\traw(chart),\n\t\t\traw(chartShapeProps(chartArea.fill, chartArea.border, ' ', {})),\n\t\t\traw(el('c:externalData', { 'r:id': 'rId1' }, raw(voidEl('c:autoUpdate', { val: 0 })))),\n\t\t\traw(genXmlChartMetadata(rel.opts.metadata)),\n\t\t])\n\t)\n}\n\n/**\n * Stable ts-pptx vendor GUID identifying the chart-metadata extension on `c:chartSpace/c:extLst`.\n * Custom data rides under this URI in a foreign namespace so PowerPoint preserves it (the extLst\n * mechanism) instead of stripping/repairing it as it would an unrecognised sibling element.\n */\nconst CHART_METADATA_EXT_URI = '{094A432E-1F6C-499B-95B8-B57DC9536949}'\n\n/** Foreign namespace for the chart-metadata extension payload. */\nconst CHART_METADATA_NS = 'http://ts-pptx.com/schema/chart/metadata'\n\n/**\n * Create the chart-space extension-list XML carrying custom `metadata` key/value annotations.\n * Emits nothing when metadata is absent or contains no valid entries. Keys must be non-empty\n * strings and values must be strings; invalid entries are dropped with a warning rather than\n * emitting degenerate XML (per the \"no silent coercion\" policy).\n * @param {Record<string, string>} [metadata] custom chart-level metadata\n * @return {string} `<c:extLst>…</c:extLst>` XML, or '' when there is nothing valid to emit\n */\nfunction genXmlChartMetadata(metadata?: Record<string, string>): string {\n\tif (metadata == null) return ''\n\tif (typeof metadata !== 'object' || Array.isArray(metadata)) {\n\t\twarn('chart/invalid-metadata', 'chart `metadata` must be a plain object of string key/value pairs; ignored.')\n\t\treturn ''\n\t}\n\n\tlet items = ''\n\tfor (const [key, value] of Object.entries(metadata)) {\n\t\tif (typeof key !== 'string' || key.length === 0) {\n\t\t\twarn(\n\t\t\t\t'chart/invalid-metadata-key',\n\t\t\t\t`chart metadata key \"${String(key)}\" is not a non-empty string; entry skipped.`\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\t\tif (typeof value !== 'string') {\n\t\t\twarn('chart/invalid-metadata-value', `chart metadata value for key \"${key}\" is not a string; entry skipped.`)\n\t\t\tcontinue\n\t\t}\n\t\titems += voidEl('pgm:item', { key, value })\n\t}\n\tif (items === '') return ''\n\n\treturn el(\n\t\t'c:extLst',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'c:ext',\n\t\t\t\t{ uri: CHART_METADATA_EXT_URI },\n\t\t\t\traw(el('pgm:metadata', { 'xmlns:pgm': CHART_METADATA_NS }, raw(items)))\n\t\t\t)\n\t\t)\n\t)\n}\n\n/**\n * Create XML string for any given chart type.\n * Dispatches to a per-family plot helper; resolves the effective value number format first.\n * @param {ChartType} chartType chart type name\n * @param {OptsChartDataInternal[]} data chart data\n * @param {ChartOptsInternal} opts chart options\n * @param {string} valAxisId chart val axis id\n * @param {string} catAxisId chart cat axis id\n * @example 'bubble' returns <c:bubbleChart></c>\n * @example '<c:lineChart>'\n * @return {string} XML chart\n */\n\nfunction makeChartType(\n\tchartType: ChartType,\n\tdata: OptsChartDataInternal[],\n\topts: ChartOptsInternal,\n\tvalAxisId: string,\n\tcatAxisId: string\n): string {\n\t// NOTE: \"Chart Range\" (as shown in \"select Chart Area dialog\") is calculated.\n\t// ....: Ensure each X/Y Axis/Col has same row height (esp. applicable to XY Scatter where X can often be larger than Y's)\n\t//\n\t// PowerPoint and Google Slides render values using the cached *source* number format carried in\n\t// each series' `<c:numCache><c:formatCode>` (mirroring the embedded workbook cell format), NOT the\n\t// `<c:dLbls><c:numFmt>` mask — so when the value cache is left as \"General\" those engines display\n\t// raw values (e.g. `0.1` instead of `10%`) even though LibreOffice honors the dLbls mask. Resolve a\n\t// single effective value format and stamp it onto every value cache below so all three engines agree.\n\t// Precedence keeps the historical `valLabelFormatCode` winner,\n\t// then the data-table format, and finally falls back to `dataLabelFormatCode` (the most common knob).\n\tconst valFmtCode = opts.valLabelFormatCode || opts.dataTableFormatCode || opts.dataLabelFormatCode || 'General'\n\n\tswitch (chartType) {\n\t\tcase ChartType.area:\n\t\tcase ChartType.bar:\n\t\tcase ChartType.bar3d:\n\t\tcase ChartType.line:\n\t\tcase ChartType.radar:\n\t\t\treturn makeCatAxisPlot(chartType, data, opts, valAxisId, catAxisId, valFmtCode)\n\t\tcase ChartType.scatter:\n\t\t\treturn makeScatterPlot(chartType, data, opts, valAxisId, catAxisId, valFmtCode)\n\t\tcase ChartType.bubble:\n\t\tcase ChartType.bubble3d:\n\t\t\treturn makeBubblePlot(chartType, data, opts, valAxisId, catAxisId, valFmtCode)\n\t\tcase ChartType.stock:\n\t\t\treturn makeStockPlot(chartType, data, opts, valAxisId, catAxisId, valFmtCode)\n\t\tcase ChartType.surface:\n\t\t\treturn makeSurfacePlot(chartType, data, opts, valAxisId, catAxisId, valFmtCode)\n\t\tcase ChartType.doughnut:\n\t\tcase ChartType.pie:\n\t\t\treturn makePiePlot(chartType, data, opts, valFmtCode)\n\t\tdefault:\n\t\t\t// The unmatched members are exactly the chartEx catalog (`CHARTEX_TYPES` in `enums.ts`),\n\t\t\t// which `chartExLayoutId` in `./chartex-xml` owns; callers pick between the two builders\n\t\t\t// with `isChartExType`, so arriving here means the chart was routed to the wrong emitter.\n\t\t\t// Returning `''` here used to hide that: it emitted a `<c:plotArea>` with axes and no plot\n\t\t\t// at all, i.e. a chart-shaped hole PowerPoint opens and shows empty.\n\t\t\tthrow new InternalError(\n\t\t\t\t'chart/type-not-routed',\n\t\t\t\t`makeChartType: \"${String(chartType)}\" has no <c:...Chart> plot — the chartEx catalog is built by makeXmlChartEx, and a newly added classic type needs an arm here`,\n\t\t\t\t{ detail: { chartType } }\n\t\t\t)\n\t}\n}\n","/**\n * ts-pptx: chartEx (`cx:`) Chart-Data Builder\n *\n * Builds the `<cx:chartData>` block of a chartEx chart part (waterfall, and the other\n * Office-2016 layouts as they land). This is the chartEx analogue of the `<c:cat>`/`<c:val>`\n * caches on the classic side: it names the embedded-workbook cells via `<cx:f>` formulas and\n * mirrors their values into `<cx:lvl>` string/number caches so PowerPoint can render without\n * opening the workbook. The category label levels occupy the leading columns (0 of them for a\n * category-less histogram, 1 for a flat chart, N for a hierarchical treemap/sunburst) and the one\n * value series sits in the next column — so the references here line up 1:1 with the workbook\n * written by {@link ./embed-xlsx}.\n */\n\nimport { ChartType } from '../../enums.js'\nimport type { SlideRelChart } from '../../types/internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { dataLabels, dataValues, firstLabelGroup, sheetCellRef, sheetRangeRef } from './data-refs.js'\n\n/**\n * The numeric-dimension tag PowerPoint expects varies by layout. The flat layouts (waterfall,\n * funnel, histogram, pareto, boxWhisker) use `type=\"val\"`; the hierarchical treemap/sunburst use\n * `type=\"size\"`; a `regionMap` uses `type=\"colorVal\"` (the value drives each region's fill color).\n * The value always comes from the series' `values`; only the dimension tag differs.\n */\nfunction valueDimType(type: ChartType): 'size' | 'val' | 'colorVal' {\n\tif (type === ChartType.treemap || type === ChartType.sunburst) return 'size'\n\tif (type === ChartType.regionMap) return 'colorVal'\n\treturn 'val'\n}\n\n/**\n * Build the `<cx:chartData>` for a single-series chartEx chart.\n *\n * `<cx:data id=\"0\">` carries a `<cx:strDim type=\"cat\">` (category labels) and a numeric dimension\n * (`type=\"val\"` for flat layouts, `type=\"size\"` for the hierarchical treemap/sunburst);\n * `<cx:externalData r:id=\"rId1\">` points at the embedded workbook (same `rId1` the chart part's\n * `.rels` maps to the `.xlsx`).\n *\n * Category labels are `string[][]` — one inner array per hierarchy level (leaf first). A flat chart\n * has a single level; treemap/sunburst carry several. Each level becomes one `<cx:lvl>`, emitted\n * leaf-first to match PowerPoint. The workbook ({@link ./embed-xlsx}) lays the levels out in\n * columns A..N (outermost in A, leaf in the last label column) with the value series in the next\n * column; the single `<cx:f>` range on each dimension spans exactly those columns.\n * @param {SlideRelChart} rel - the registered chart\n * @return {string} `<cx:chartData>…</cx:chartData>` XML\n */\nexport function makeChartExData(rel: SlideRelChart): string {\n\tconst series = rel.data[0]\n\tconst type = rel.opts._type as ChartType\n\tconst levels = dataLabels(series)\n\tconst totLvl = levels.length // 0 for a category-less layout (histogram), 1 flat, N hierarchical\n\tconst vals = dataValues(series)\n\t// Row span is driven by whichever dimension has more points; the workbook writes both to the same rows.\n\tconst ptCount = Math.max(firstLabelGroup(series).length, vals.length)\n\tconst lastRow = ptCount + 1\n\tconst valueCol = totLvl + 1 // value series sits in the column right after all label columns\n\n\t// Category (string) dimension — one <cx:lvl> per hierarchy level, leaf-first, over columns A..totLvl.\n\t// A category-less layout (histogram bins raw observations itself) emits no strDim at all.\n\tlet catDim = ''\n\tif (totLvl > 0) {\n\t\tconst catLvls = levels\n\t\t\t.map((group) => {\n\t\t\t\tconst pts = group.map((label, idx) => el('cx:pt', { idx }, label ?? '')).join('')\n\t\t\t\treturn el('cx:lvl', { ptCount: group.length }, raw(pts))\n\t\t\t})\n\t\t\t.join('')\n\t\tcatDim = el('cx:strDim', { type: 'cat' }, [\n\t\t\traw(el('cx:f', null, sheetRangeRef(1, 2, totLvl, lastRow))),\n\t\t\traw(catLvls),\n\t\t])\n\t}\n\n\t// Numeric dimension — the value column. Skip null/non-finite points (a valid sparse cache);\n\t// warn on non-finite, matching the classic side's `numCachePt` policy.\n\tlet valPts = ''\n\tvals.forEach((value, idx) => {\n\t\tif (value == null) return\n\t\tif (!Number.isFinite(value)) {\n\t\t\twarn(\n\t\t\t\t'chart/non-finite-value',\n\t\t\t\t`chartEx value \"${value}\" at index ${idx} is not a finite number; data point omitted.`\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t\tvalPts += el('cx:pt', { idx }, value)\n\t})\n\tconst valDim = el('cx:numDim', { type: valueDimType(type) }, [\n\t\traw(el('cx:f', null, sheetRangeRef(valueCol, 2, valueCol, lastRow))),\n\t\traw(el('cx:lvl', { ptCount, formatCode: 'General' }, raw(valPts))),\n\t])\n\n\tconst data = el('cx:data', { id: 0 }, [raw(catDim), raw(valDim)])\n\t// CT_ChartData order is externalData? → data+. externalData is a LEAF whose only attribute is\n\t// `id` (r:id → the embedded workbook); it carries no `autoUpdate` and no child elements.\n\tconst externalData = voidEl('cx:externalData', { 'r:id': 'rId1' })\n\treturn el('cx:chartData', null, [raw(externalData), raw(data)])\n}\n\n/**\n * The `Sheet1` cell holding the series name (the numeric dimension's header) — column immediately\n * after all label columns, row 1. A category-less histogram lands on `$A$1`; a flat chart on\n * `$B$1`; a 3-level treemap on `$D$1`.\n * @param {SlideRelChart} rel - the registered chart\n * @return {string} an absolute single-cell reference, e.g. `Sheet1!$B$1`\n */\nexport function chartExSeriesNameRef(rel: SlideRelChart): string {\n\treturn sheetCellRef(dataLabels(rel.data[0]).length + 1, 1)\n}\n","/**\n * ts-pptx: chartEx (`cx:`) Chart Assembly\n *\n * Builds a chartEx chart part `ppt/charts/chartEx{N}.xml` — the `<cx:chartSpace>` for the\n * Office-2016 chart family (currently `waterfall`, `funnel`, `treemap`, `sunburst`, `histogram`,\n * `pareto`, `boxWhisker`, `regionMap`).\n * This is the chartEx analogue of\n * {@link ./chart-xml} (`makeXmlCharts`): a pure string builder, no I/O, no model mutation.\n *\n * chartEx differs from the classic `<c:chartSpace>` in three ways the rest of the package must\n * account for (all handled at the call sites, not here):\n * - it is a **separate part** with content type `application/vnd.ms-office.chartex+xml`,\n * - it is referenced from the slide through `<mc:AlternateContent>` (see `gen/slide/objects/chart.ts`),\n * - it renders **only in PowerPoint 2016+/Microsoft 365**; other consumers show the fallback shape.\n *\n * The `<cx:f>` formulas point back at the same embedded workbook the classic charts use\n * ({@link ./embed-xlsx}); the cell mapping lives in {@link ./chartex-data} / {@link ./data-refs}.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { InternalError } from '../../errors.js'\nimport { DEF_FONT_COLOR, XML_DECL } from '../../constants-internal.js'\nimport type { ChartExBinning, ChartExGeography, ChartExStatistics } from '../../types/chart.js'\nimport type { SlideRelChart } from '../../types/internal.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { createChartTextFonts } from './chart-parts.js'\nimport { chartExSeriesNameRef, makeChartExData } from './chartex-data.js'\nimport { OOXML_NS } from '../../ooxml/namespaces.js'\n\n/**\n * Map a chartEx {@link ChartType} to its `<cx:series layoutId>` token (the CT_SeriesLayout value\n * PowerPoint keys the chart geometry on). Throws on anything it does not own — see the `default`\n * arm for which members those are and why reaching it is a routing bug.\n */\nfunction chartExLayoutId(type: ChartType): string {\n\tswitch (type) {\n\t\tcase ChartType.waterfall:\n\t\t\treturn 'waterfall'\n\t\tcase ChartType.funnel:\n\t\t\treturn 'funnel'\n\t\tcase ChartType.treemap:\n\t\t\treturn 'treemap'\n\t\tcase ChartType.sunburst:\n\t\t\treturn 'sunburst'\n\t\tcase ChartType.histogram:\n\t\t\t// A histogram is a clustered-column series whose bins PowerPoint computes from <cx:binning>.\n\t\t\treturn 'clusteredColumn'\n\t\tcase ChartType.boxWhisker:\n\t\t\treturn 'boxWhisker'\n\t\tcase ChartType.regionMap:\n\t\t\treturn 'regionMap'\n\t\tdefault:\n\t\t\t// The unmatched members are the classic 2007 catalog — owned by `makeChartType` in\n\t\t\t// `./chart-xml` — plus `pareto`, which is multi-series and is diverted to `makeParetoSeries`\n\t\t\t// before any single layoutId is asked for. Both are unreachable through `isChartExType`\n\t\t\t// routing; `''` here used to emit `<cx:series layoutId=\"\">`, which PowerPoint cannot render.\n\t\t\tthrow new InternalError(\n\t\t\t\t'chart/type-not-routed',\n\t\t\t\t`chartExLayoutId: \"${String(type)}\" has no <cx:series> layoutId — classic chart types belong to makeXmlCharts, pareto is built by makeParetoSeries, and a newly added chartEx type needs an arm here`,\n\t\t\t\t{ detail: { chartType: type } }\n\t\t\t)\n\t}\n}\n\n/**\n * A deterministic `uniqueId` GUID for a `<cx:series>`, derived from the chart's package-global id.\n * PowerPoint stamps a random GUID here; deriving it keeps output byte-stable (the project pins\n * chart determinism — the package-wide id this derives from is assigned at write time in\n * `package/assemble.ts`, STEP 2). `seriesIdx`\n * distinguishes multiple series within one chart (pareto emits two), varying the 4th GUID group so\n * every series still gets a distinct id.\n */\nfunction chartExUniqueId(globalId: number, seriesIdx = 0): string {\n\treturn `{00000000-0000-0000-${String(seriesIdx).padStart(4, '0')}-${String(globalId).padStart(12, '0')}}`\n}\n\n/** chartEx legend positions are `t|b|l|r`; clamp the classic `'tr'` (and anything else) to `'t'`. */\nfunction chartExLegendPos(pos: string | undefined): string {\n\treturn pos === 'b' || pos === 'l' || pos === 'r' ? pos : 't'\n}\n\n/**\n * The `<cx:axisId>` binding on a `<cx:series>` (which value/category axis the series plots against).\n *\n * NOTE — a schema-vs-PowerPoint divergence (the exact mirror of the histogram `binCount` gotcha):\n * the OpenXML SDK models `cx:axisId` as an `OpenXmlLeafTextElement`, so the OOXML validator only\n * accepts the text-content form `<cx:axisId>1</cx:axisId>` and flags the `val` attribute as\n * undeclared. But PowerPoint desktop REFUSES to open a deck using the text form (0x80070570) — it\n * writes and requires the ATTRIBUTE form `<cx:axisId val=\"1\"/>` (matching the classic `c:axId`).\n * PowerPoint is the authoritative oracle here, so the attribute form is emitted; the resulting\n * validator complaint on `cx:axisId/@val` is expected and whitelisted in the schema-case test.\n */\nfunction makeChartExAxisId(id: number): string {\n\treturn voidEl('cx:axisId', { val: id })\n}\n\n/**\n * Build the histogram `<cx:binning>` element from the caller's `binning` opt. PowerPoint bins the\n * raw observations automatically; the only control wired here is `intervalClosed` — whether each\n * bin interval is right-closed (`\"r\"`, PowerPoint's default) or left-closed (`\"l\"`).\n *\n * NOTE: explicit bin geometry (`binCount`/`binSize` child elements, `underflow`/`overflow`\n * attributes) is intentionally NOT emitted. Although `<cx:binCount>`/`<cx:binSize>` pass OOXML\n * schema validation (they are declared children of `cx:binning` in the OpenXML SDK), PowerPoint\n * desktop refuses to open a deck that contains them (0x80004005) — so shipping them would corrupt\n * the file. They stay deferred until their real requirements are pinned down against PowerPoint.\n */\nfunction makeChartExBinning(binning: ChartExBinning | undefined): string {\n\treturn voidEl('cx:binning', { intervalClosed: binning?.intervalClosed === 'l' ? 'l' : 'r' })\n}\n\n/**\n * Build the box-and-whisker `<cx:layoutPr>` body — a `<cx:visibility>` toggle set plus a\n * `<cx:statistics>` quartile-method choice, in that document order (what PowerPoint itself emits).\n * All flags default to PowerPoint's own defaults: exclusive quartiles, mean marker on, outlier\n * points on, the mean-line and the full non-outlier scatter off. Booleans map to the `0`/`1`\n * attribute form PowerPoint uses.\n */\nfunction makeBoxWhiskerLayoutPr(stats: ChartExStatistics | undefined): string {\n\tconst bit = (v: boolean | undefined, dflt: boolean): 0 | 1 => ((v ?? dflt) ? 1 : 0)\n\tconst visibility = voidEl('cx:visibility', {\n\t\tmeanLine: bit(stats?.meanLine, false),\n\t\tmeanMarker: bit(stats?.meanMarker, true),\n\t\tnonoutliers: bit(stats?.nonoutliers, false),\n\t\toutliers: bit(stats?.outliers, true),\n\t})\n\tconst statistics = voidEl('cx:statistics', {\n\t\tquartileMethod: stats?.quartileMethod === 'inclusive' ? 'inclusive' : 'exclusive',\n\t})\n\treturn el('cx:layoutPr', null, [raw(visibility), raw(statistics)])\n}\n\n/**\n * Build the region-map `<cx:layoutPr>` body — a single `<cx:geography>` hint telling PowerPoint how\n * to interpret the category labels as geographic region names. `cultureLanguage`/`cultureRegion`\n * (both schema-REQUIRED) resolve ambiguous names (e.g. \"Georgia\" the country vs. the US state);\n * `attribution` is Bing's fixed acknowledgement string.\n *\n * NOTE — PowerPoint itself also nests a `<cx:geoCache>` here holding a base64 binary blob: its\n * cached Bing geometry for the resolved regions. That blob is produced by an online Bing lookup and\n * cannot be reproduced offline, so it is intentionally OMITTED. PowerPoint re-resolves the geography\n * from the region names when the deck is opened (verified over COM: the deck opens and reads back as\n * a regionMap either way) — this is why a region map is documented as best-effort/write-only and\n * renders blank if the names don't match PowerPoint's geography database.\n */\nfunction makeGeographyLayoutPr(geo: ChartExGeography | undefined): string {\n\tconst geography = voidEl('cx:geography', {\n\t\tcultureLanguage: geo?.cultureLanguage || 'en-US',\n\t\tcultureRegion: geo?.cultureRegion || 'US',\n\t\tattribution: 'Powered by Bing',\n\t})\n\treturn el('cx:layoutPr', null, raw(geography))\n}\n\n/** The `<cx:tx>` series-name cell/value block (shared by every layout that names its series). */\nfunction makeChartExSeriesName(rel: SlideRelChart): string {\n\treturn el(\n\t\t'cx:tx',\n\t\tnull,\n\t\traw(\n\t\t\tel('cx:txData', null, [\n\t\t\t\traw(el('cx:f', null, chartExSeriesNameRef(rel))),\n\t\t\t\traw(el('cx:v', null, rel.data[0]?.name ?? '')),\n\t\t\t])\n\t\t)\n\t)\n}\n\n/**\n * Data labels: chartEx toggles each field via `<cx:visibility>`. Only emitted when the caller asked\n * to show values, matching the classic default of no data labels.\n */\nfunction makeChartExDataLabels(rel: SlideRelChart): string {\n\tconst showValue = !!(rel.opts.showValue || rel.opts.showLabel)\n\treturn showValue\n\t\t? el('cx:dataLabels', { pos: 'outEnd' }, raw(voidEl('cx:visibility', { seriesName: 0, categoryName: 0, value: 1 })))\n\t\t: ''\n}\n\n/**\n * Build the pareto `<cx:series>` PAIR — pareto is the first chartEx layout that emits more than one\n * series. Series 0 is a `clusteredColumn` bound to value axis 1 whose `<cx:aggregation/>` tells\n * PowerPoint to sum the values per category, sort the bars descending, and drive the cumulative\n * line. Series 1 is the `paretoLine` itself: it carries `ownerIdx=\"0\"` (it derives its data from\n * series 0, so it has NO `<cx:tx>` or `<cx:dataId>`) and binds to the secondary percentage axis 2.\n */\nfunction makeParetoSeries(rel: SlideRelChart): string {\n\tconst bar = el('cx:series', { layoutId: 'clusteredColumn', uniqueId: chartExUniqueId(rel.globalId, 0) }, [\n\t\traw(makeChartExSeriesName(rel)),\n\t\traw(makeChartExDataLabels(rel)),\n\t\traw(voidEl('cx:dataId', { val: 0 })),\n\t\traw(el('cx:layoutPr', null, raw(voidEl('cx:aggregation')))),\n\t\traw(makeChartExAxisId(1)),\n\t])\n\tconst line = el('cx:series', { layoutId: 'paretoLine', ownerIdx: 0, uniqueId: chartExUniqueId(rel.globalId, 1) }, [\n\t\traw(makeChartExAxisId(2)),\n\t])\n\treturn bar + line\n}\n\n/** Build the `<cx:series>` (title cell, data labels, dataId, and layout-specific `<cx:layoutPr>`). */\nfunction makeChartExSeries(rel: SlideRelChart): string {\n\tconst opts = rel.opts\n\tconst type = opts._type as ChartType\n\n\t// Pareto is multi-series (a column series + a cumulative line on a secondary axis).\n\tif (type === ChartType.pareto) return makeParetoSeries(rel)\n\n\t// Layout-specific series props.\n\tlet layoutPr = ''\n\tif (type === ChartType.waterfall && Array.isArray(opts.subtotals) && opts.subtotals.length > 0) {\n\t\t// waterfall: subtotal/total column indices.\n\t\tconst idxs = opts.subtotals.map((idx) => voidEl('cx:idx', { val: idx })).join('')\n\t\tlayoutPr = el('cx:layoutPr', null, raw(el('cx:subtotals', null, raw(idxs))))\n\t} else if (type === ChartType.treemap) {\n\t\t// treemap: how parent-category banners are placed (PowerPoint's default is `overlapping`).\n\t\tlayoutPr = el('cx:layoutPr', null, raw(voidEl('cx:parentLabelLayout', { val: 'overlapping' })))\n\t} else if (type === ChartType.histogram) {\n\t\t// histogram: how PowerPoint bins the raw observations. Default is auto binning with\n\t\t// right-closed intervals; the `binning` opt exposes explicit width/count/overflow control.\n\t\tlayoutPr = el('cx:layoutPr', null, raw(makeChartExBinning(opts.binning)))\n\t} else if (type === ChartType.boxWhisker) {\n\t\t// box-and-whisker: quartile method + which box adornments (mean line/marker, outliers) show.\n\t\tlayoutPr = makeBoxWhiskerLayoutPr(opts.statistics)\n\t} else if (type === ChartType.regionMap) {\n\t\t// region map: the <cx:geography> hint PowerPoint resolves the region names against.\n\t\tlayoutPr = makeGeographyLayoutPr(opts.geography)\n\t}\n\n\treturn el('cx:series', { layoutId: chartExLayoutId(type), uniqueId: chartExUniqueId(rel.globalId) }, [\n\t\traw(makeChartExSeriesName(rel)),\n\t\traw(makeChartExDataLabels(rel)),\n\t\traw(voidEl('cx:dataId', { val: 0 })),\n\t\traw(layoutPr),\n\t])\n}\n\n/**\n * Build the `<cx:axis>` list for a layout (matched to what PowerPoint itself emits for each):\n * - **waterfall** — a category (id 0) + value (id 1) axis.\n * - **funnel** — a SINGLE category axis, which PowerPoint numbers id 1, with no value axis and no\n * gridlines (the bars run horizontally off one category scale).\n * - **pareto** — like histogram (cat id0 gapWidth0 + val id1) PLUS a SECONDARY value axis id2\n * scaled 0..1 with `unit=\"percentage\"` that the cumulative `paretoLine` series binds to.\n * - **boxWhisker** — a category (id0, gapWidth 1) + value (id1, gridlines) axis, like waterfall\n * but with the wider default gap PowerPoint uses to separate the boxes.\n * Every other layout returns no axes — the hierarchical treemap/sunburst are genuinely axis-free\n * (categories are encoded by the nested tiles/rings, not an axis scale), and a `regionMap` plots on\n * geography rather than any Cartesian axis.\n */\nfunction makeChartExAxes(type: ChartType): string {\n\t// chartEx catScaling gapWidth is a fraction (1.0 = 100%), NOT the classic integer percent.\n\tif (type === ChartType.waterfall) {\n\t\tconst catAxis = el('cx:axis', { id: 0 }, [\n\t\t\traw(voidEl('cx:catScaling', { gapWidth: '0.5' })),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\tconst valAxis = el('cx:axis', { id: 1 }, [\n\t\t\traw(voidEl('cx:valScaling')),\n\t\t\traw(voidEl('cx:majorGridlines')),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\treturn catAxis + valAxis\n\t}\n\tif (type === ChartType.funnel) {\n\t\treturn el('cx:axis', { id: 1 }, [raw(voidEl('cx:catScaling', { gapWidth: '2.19' })), raw(voidEl('cx:tickLabels'))])\n\t}\n\tif (type === ChartType.histogram) {\n\t\t// Histogram bins abut, so the category axis uses gapWidth 0; the value axis carries gridlines.\n\t\tconst catAxis = el('cx:axis', { id: 0 }, [\n\t\t\traw(voidEl('cx:catScaling', { gapWidth: '0' })),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\tconst valAxis = el('cx:axis', { id: 1 }, [\n\t\t\traw(voidEl('cx:valScaling')),\n\t\t\traw(voidEl('cx:majorGridlines')),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\treturn catAxis + valAxis\n\t}\n\tif (type === ChartType.pareto) {\n\t\t// Aggregated column axes (like histogram: cat id0 gapWidth0 + val id1) …\n\t\tconst catAxis = el('cx:axis', { id: 0 }, [\n\t\t\traw(voidEl('cx:catScaling', { gapWidth: '0' })),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\tconst valAxis = el('cx:axis', { id: 1 }, [\n\t\t\traw(voidEl('cx:valScaling')),\n\t\t\traw(voidEl('cx:majorGridlines')),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\t// … plus the SECONDARY value axis (id2) the cumulative paretoLine plots against: a 0..1\n\t\t// percentage scale, no gridlines (the primary value axis already carries them).\n\t\tconst pctAxis = el('cx:axis', { id: 2 }, [\n\t\t\traw(voidEl('cx:valScaling', { max: '1', min: '0' })),\n\t\t\traw(voidEl('cx:units', { unit: 'percentage' })),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\treturn catAxis + valAxis + pctAxis\n\t}\n\tif (type === ChartType.boxWhisker) {\n\t\tconst catAxis = el('cx:axis', { id: 0 }, [\n\t\t\traw(voidEl('cx:catScaling', { gapWidth: '1' })),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\tconst valAxis = el('cx:axis', { id: 1 }, [\n\t\t\traw(voidEl('cx:valScaling')),\n\t\t\traw(voidEl('cx:majorGridlines')),\n\t\t\traw(voidEl('cx:tickLabels')),\n\t\t])\n\t\treturn catAxis + valAxis\n\t}\n\treturn ''\n}\n\n/** Build a minimal `<cx:title>` from the chart title options (only when `showTitle`). */\nfunction makeChartExTitle(rel: SlideRelChart): string {\n\tif (!rel.opts.showTitle) return ''\n\tconst color = rel.opts.titleColor || DEF_FONT_COLOR\n\tconst face = rel.opts.titleFontFace || 'Calibri'\n\tconst rPr = el('a:defRPr', null, [raw(genXmlColorSelection(color)), raw(createChartTextFonts(face))])\n\tconst rich = el('cx:rich', null, [\n\t\traw(voidEl('a:bodyPr')),\n\t\traw(voidEl('a:lstStyle')),\n\t\traw(\n\t\t\tel('a:p', null, [\n\t\t\t\traw(el('a:pPr', null, raw(rPr))),\n\t\t\t\traw(\n\t\t\t\t\tel('a:r', null, [\n\t\t\t\t\t\traw(voidEl('a:rPr', { lang: rel.opts.lang || 'en-US' })),\n\t\t\t\t\t\traw(el('a:t', null, rel.opts.title || 'Chart Title')),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n\treturn el('cx:title', { pos: 't', align: 'ctr', overlay: 0 }, raw(el('cx:tx', null, raw(rich))))\n}\n\n/**\n * Assemble the full `<cx:chartSpace>` for a chartEx chart part.\n * Document order (CT_ChartSpace): `chartData` → `chart`; the `<cx:chart>` holds\n * `title? → plotArea → legend?`.\n * @param {SlideRelChart} rel - the registered chartEx chart\n * @return {string} the `ppt/charts/chartEx{N}.xml` body\n */\nexport function makeXmlChartEx(rel: SlideRelChart): string {\n\tconst type = rel.opts._type as ChartType\n\n\tconst plotAreaRegion = el('cx:plotAreaRegion', null, raw(makeChartExSeries(rel)))\n\tconst plotArea = el('cx:plotArea', null, [raw(plotAreaRegion), raw(makeChartExAxes(type))])\n\tconst legend = rel.opts.showLegend\n\t\t? voidEl('cx:legend', { pos: chartExLegendPos(rel.opts.legendPos), align: 'ctr', overlay: 0 })\n\t\t: ''\n\tconst chart = el('cx:chart', null, [raw(makeChartExTitle(rel)), raw(plotArea), raw(legend)])\n\n\treturn (\n\t\tXML_DECL +\n\t\tel('cx:chartSpace', { 'xmlns:cx': OOXML_NS.cx, 'xmlns:a': OOXML_NS.a, 'xmlns:r': OOXML_NS.r }, [\n\t\t\traw(makeChartExData(rel)),\n\t\t\traw(chart),\n\t\t])\n\t)\n}\n","/**\n * ts-pptx: chartEx (cx:) Style + Color Parts\n *\n * Every chartEx chart part (`chartEx{N}.xml`) MUST be accompanied by a chart-style part\n * (`style{N}.xml`, `cs:chartStyle`) and a chart-color-style part (`colors{N}.xml`,\n * `cs:colorStyle`), linked from the chartEx part's `.rels` via the MS `chartStyle` /\n * `chartColorStyle` relationship types. This is NOT optional: PowerPoint reports a chartEx deck\n * that lacks them as corrupt (0x80070570) — a failure the OOXML schema validator does not catch,\n * found via the desktop COM smoke (`pnpm run test:com`).\n *\n * The two payloads below are PowerPoint's own generic, chart-type-agnostic defaults (the same\n * boilerplate Office writes for any new chartEx chart), captured verbatim and shipped as a static\n * template — analogous to the default theme/worksheet boilerplate the library already embeds. They\n * reference theme scheme colors, so they adapt to the deck theme without per-chart customization.\n */\n\nimport { XML_DECL } from '../../constants-internal.js'\n\n/**\n * The `cs:colorStyle` payload for a chartEx chart's `colors{N}.xml` part (theme-accent cycle).\n * @raw-xml-asset Captured verbatim from PowerPoint; not built here, so not a migration target.\n */\nconst CHARTEX_COLORS_BODY =\n\t'<cs:colorStyle xmlns:cs=\"http://schemas.microsoft.com/office/drawing/2012/chartStyle\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" meth=\"cycle\" id=\"10\"><a:schemeClr val=\"accent1\"/><a:schemeClr val=\"accent2\"/><a:schemeClr val=\"accent3\"/><a:schemeClr val=\"accent4\"/><a:schemeClr val=\"accent5\"/><a:schemeClr val=\"accent6\"/><cs:variation/><cs:variation><a:lumMod val=\"60000\"/></cs:variation><cs:variation><a:lumMod val=\"80000\"/><a:lumOff val=\"20000\"/></cs:variation><cs:variation><a:lumMod val=\"80000\"/></cs:variation><cs:variation><a:lumMod val=\"60000\"/><a:lumOff val=\"40000\"/></cs:variation><cs:variation><a:lumMod val=\"50000\"/></cs:variation><cs:variation><a:lumMod val=\"70000\"/><a:lumOff val=\"30000\"/></cs:variation><cs:variation><a:lumMod val=\"70000\"/></cs:variation><cs:variation><a:lumMod val=\"50000\"/><a:lumOff val=\"50000\"/></cs:variation></cs:colorStyle>'\n\n/**\n * The `cs:chartStyle` payload for a chartEx chart's `style{N}.xml` part (PowerPoint default).\n * @raw-xml-asset Captured verbatim from PowerPoint; not built here, so not a migration target.\n */\nconst CHARTEX_STYLE_BODY =\n\t'<cs:chartStyle xmlns:cs=\"http://schemas.microsoft.com/office/drawing/2012/chartStyle\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" id=\"395\"><cs:axisTitle><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1197\"/></cs:axisTitle><cs:categoryAxis><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz=\"1197\"/></cs:categoryAxis><cs:chartArea mods=\"allowNoFillOverride allowNoLineOverride\"><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"bg1\"/></a:solidFill><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz=\"1330\"/></cs:chartArea><cs:dataLabel><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1197\"/></cs:dataLabel><cs:dataLabelCallout><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"dk1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"lt1\"/></a:solidFill><a:ln><a:solidFill><a:schemeClr val=\"dk1\"><a:lumMod val=\"25000\"/><a:lumOff val=\"75000\"/></a:schemeClr></a:solidFill></a:ln></cs:spPr><cs:defRPr sz=\"1197\"/><cs:bodyPr rot=\"0\" spcFirstLastPara=\"1\" vertOverflow=\"clip\" horzOverflow=\"clip\" vert=\"horz\" wrap=\"square\" lIns=\"36576\" tIns=\"18288\" rIns=\"36576\" bIns=\"18288\" anchor=\"ctr\" anchorCtr=\"1\"><a:spAutoFit/></cs:bodyPr></cs:dataLabelCallout><cs:dataPoint><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:fillRef><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill></cs:spPr></cs:dataPoint><cs:dataPoint3D><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:fillRef><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill></cs:spPr></cs:dataPoint3D><cs:dataPointLine><cs:lnRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:lnRef><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"28575\" cap=\"rnd\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:dataPointLine><cs:dataPointMarker><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:fillRef><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:ln w=\"9525\"><a:solidFill><a:schemeClr val=\"lt1\"/></a:solidFill></a:ln></cs:spPr></cs:dataPointMarker><cs:dataPointMarkerLayout symbol=\"circle\" size=\"5\"/><cs:dataPointWireframe><cs:lnRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:lnRef><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"28575\" cap=\"rnd\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:dataPointWireframe><cs:dataTable><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w=\"9525\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill></a:ln></cs:spPr><cs:defRPr sz=\"1197\"/></cs:dataTable><cs:downBar><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"dk1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"dk1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></a:solidFill><a:ln w=\"9525\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></a:solidFill></a:ln></cs:spPr></cs:downBar><cs:dropLine><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"35000\"/><a:lumOff val=\"65000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:dropLine><cs:errorBar><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:errorBar><cs:floor><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef></cs:floor><cs:gridlineMajor><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:gridlineMajor><cs:gridlineMinor><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:gridlineMinor><cs:hiLoLine><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"75000\"/><a:lumOff val=\"25000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:hiLoLine><cs:leaderLine><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"35000\"/><a:lumOff val=\"65000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:leaderLine><cs:legend><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1197\"/></cs:legend><cs:plotArea mods=\"allowNoFillOverride allowNoLineOverride\"><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef></cs:plotArea><cs:plotArea3D mods=\"allowNoFillOverride allowNoLineOverride\"><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef></cs:plotArea3D><cs:seriesAxis><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz=\"1197\"/></cs:seriesAxis><cs:seriesLine><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"9525\" cap=\"flat\"><a:solidFill><a:srgbClr val=\"D9D9D9\"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:seriesLine><cs:title><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1862\"/></cs:title><cs:trendline><cs:lnRef idx=\"0\"><cs:styleClr val=\"auto\"/></cs:lnRef><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef><cs:spPr><a:ln w=\"19050\" cap=\"rnd\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"sysDash\"/></a:ln></cs:spPr></cs:trendline><cs:trendlineLabel><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1197\"/></cs:trendlineLabel><cs:upBar><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"dk1\"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val=\"lt1\"/></a:solidFill><a:ln w=\"9525\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill></a:ln></cs:spPr></cs:upBar><cs:valueAxis><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></cs:fontRef><cs:defRPr sz=\"1197\"/></cs:valueAxis><cs:wall><cs:lnRef idx=\"0\"/><cs:fillRef idx=\"0\"/><cs:effectRef idx=\"0\"/><cs:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></cs:fontRef></cs:wall></cs:chartStyle>'\n\n/** Build the `ppt/charts/colors{N}.xml` part body. */\nexport function makeChartExColorsXml(): string {\n\treturn XML_DECL + CHARTEX_COLORS_BODY\n}\n\n/** Build the `ppt/charts/style{N}.xml` part body. */\nexport function makeChartExStyleXml(): string {\n\treturn XML_DECL + CHARTEX_STYLE_BODY\n}\n","/**\n * ts-pptx: Chart Embedded-Workbook Generation\n *\n * Builds the embedded `.xlsx` workbook that backs a chart's cached data — the data\n * source PowerPoint opens when a user edits the chart. `createExcelWorksheet` writes\n * the workbook plus the chart part + its `.rels` into the presentation package;\n * `buildEmbeddedWorksheet` / `buildChartRelsXml` are also reused by the read-side\n * injection path (`TsPptx.extractSlides`). Everything here is a pure string/bytes\n * builder — no I/O beyond the passed-in ZipWriter, no mutation of the presentation model.\n *\n * The chart's `chart.xml` DrawingML lives in `./chart-xml.ts`; the series↔worksheet-cell\n * mapping the two sides share lives in `./data-refs.ts`.\n */\n\nimport { ChartType } from '../../enums.js'\nimport { XML_DECL } from '../../constants-internal.js'\nimport type { SlideRelChart, OptsChartDataInternal } from '../../types/internal.js'\nimport { ZipWriter } from '../../zip.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { OFFICE_REL, PACKAGE_REL_NS } from '../../ooxml/rel-types.js'\nimport { dataLabels, dataValues, dataSizes, firstLabelGroup, getExcelColName } from './data-refs.js'\nimport { makeXmlCharts } from './chart-xml.js'\nimport { makeXmlChartEx } from './chartex-xml.js'\nimport { makeChartExColorsXml, makeChartExStyleXml } from './chartex-style.js'\n\n/** MS chart-extension relationship types (chartEx style + color-style sidecar parts). */\nconst MS_CHART_REL = 'http://schemas.microsoft.com/office/2011/relationships/'\n\n/** The SpreadsheetML namespace every part of the embedded workbook is written in. */\nconst SML_NS = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'\n/** OPC content types, and the prefix the four SpreadsheetML part types share. */\nconst CT_NS = 'http://schemas.openxmlformats.org/package/2006/content-types'\nconst SML_CT = 'application/vnd.openxmlformats-officedocument.spreadsheetml.'\n\n/** One `<si>` shared string carrying literal text. */\nconst sharedString = (text: string): string => el('si', null, raw(el('t', null, text)))\n\nfunction relationship(id: string, type: string, target: string): string {\n\treturn voidEl('Relationship', { Id: id, Type: type, Target: target })\n}\n\n/** `<Relationships>` wrapper shared by the workbook's `.rels` parts (all flat, no indent). */\nfunction relationships(rels: string[]): string {\n\treturn el('Relationships', { xmlns: PACKAGE_REL_NS }, rels.map(raw))\n}\n\n/**\n * The embedded workbook's style sheet, captured verbatim from an Excel-authored chart workbook.\n * @raw-xml-asset\n */\nconst XLSX_STYLES_XML =\n\t'<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"><numFmts count=\"1\"><numFmt numFmtId=\"0\" formatCode=\"General\"/></numFmts><fonts count=\"4\"><font><sz val=\"9\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"9\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"10\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"18\"/><color indexed=\"8\"/>' +\n\t'<name val=\"Arial\"/></font></fonts><fills count=\"2\"><fill><patternFill patternType=\"none\"/></fill><fill><patternFill patternType=\"gray125\"/></fill></fills><borders count=\"1\"><border><left/><right/><top/><bottom/><diagonal/></border></borders><dxfs count=\"0\"/><tableStyles count=\"0\"/><colors><indexedColors><rgbColor rgb=\"ff000000\"/><rgbColor rgb=\"ffffffff\"/><rgbColor rgb=\"ffff0000\"/><rgbColor rgb=\"ff00ff00\"/><rgbColor rgb=\"ff0000ff\"/>' +\n\t'<rgbColor rgb=\"ffffff00\"/><rgbColor rgb=\"ffff00ff\"/><rgbColor rgb=\"ff00ffff\"/><rgbColor rgb=\"ff000000\"/><rgbColor rgb=\"ffffffff\"/><rgbColor rgb=\"ff878787\"/><rgbColor rgb=\"fff9f9f9\"/></indexedColors></colors></styleSheet>\\n'\n\n/**\n * The Office theme the embedded workbook ships, captured verbatim. PowerPoint reads it when a user\n * opens the chart's data, so it has to be exactly the bytes Office writes.\n * @raw-xml-asset\n */\nconst XLSX_THEME_XML =\n\t'<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"44546A\"/></a:dk2><a:lt2><a:srgbClr val=\"E7E6E6\"/></a:lt2><a:accent1><a:srgbClr val=\"4472C4\"/></a:accent1><a:accent2><a:srgbClr val=\"ED7D31\"/></a:accent2><a:accent3><a:srgbClr val=\"A5A5A5\"/></a:accent3><a:accent4><a:srgbClr val=\"FFC000\"/></a:accent4><a:accent5><a:srgbClr val=\"5B9BD5\"/></a:accent5><a:accent6><a:srgbClr val=\"70AD47\"/></a:accent6><a:hlink><a:srgbClr val=\"0563C1\"/></a:hlink><a:folHlink><a:srgbClr val=\"954F72\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Calibri Light\" panose=\"020F0302020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"Yu Gothic Light\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"DengXian Light\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"Yu Gothic\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"DengXian\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}\" vid=\"{4A3C46E8-61CC-4603-A589-7422A47A8E4A}\"/></a:ext></a:extLst></a:theme>'\n\n/**\n * Build the chart's embedded Excel workbook as a standalone OPC package and\n * return its bytes — the data source PowerPoint opens when a user edits the\n * chart's data. Pure (no zip side effects), so both the package write path\n * ({@link createExcelWorksheet}) and the read-side injection path\n * (`TsPptx.extractSlides`) can reuse it.\n * @param {SlideRelChart} chartObject - chart object\n * @return {Uint8Array} the embedded `.xlsx` package bytes\n */\n// ===== Embedded worksheet =====\n\nexport function buildEmbeddedWorksheet(chartObject: SlideRelChart): Uint8Array {\n\tconst data = chartObject.data\n\n\t{\n\t\t// The embedded workbook is its own OPC package: build it in a nested ZipWriter,\n\t\t// then embed its bytes (no folder scaffolding; fflate emits no directory entries).\n\t\tconst zipExcel = new ZipWriter()\n\t\tconst intBubbleCols = (data.length - 1) * 2 + 1 // 1 for \"X-Values\", then 2 for every Y-Axis\n\t\tconst IS_MULTI_CAT_AXES = (data[0]?.labels?.length ?? 0) > 1\n\n\t\t// B: Add core contents\n\t\t{\n\t\t\tconst override = (partName: string, contentType: string): string =>\n\t\t\t\tvoidEl('Override', { PartName: partName, ContentType: contentType }, { openPrefix: ' ' })\n\t\t\tzipExcel.add(\n\t\t\t\t'[Content_Types].xml',\n\t\t\t\tXML_DECL +\n\t\t\t\t\tel('Types', { xmlns: CT_NS }, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tvoidEl(\n\t\t\t\t\t\t\t\t'Default',\n\t\t\t\t\t\t\t\t{ Extension: 'rels', ContentType: 'application/vnd.openxmlformats-package.relationships+xml' },\n\t\t\t\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('Default', { Extension: 'xml', ContentType: 'application/xml' }, { openPrefix: ' ' })),\n\t\t\t\t\t\traw(override('/xl/workbook.xml', SML_CT + 'sheet.main+xml')),\n\t\t\t\t\t\traw(override('/xl/worksheets/sheet1.xml', SML_CT + 'worksheet+xml')),\n\t\t\t\t\t\traw(override('/xl/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml')),\n\t\t\t\t\t\traw(override('/xl/styles.xml', SML_CT + 'styles+xml')),\n\t\t\t\t\t\traw(override('/xl/sharedStrings.xml', SML_CT + 'sharedStrings+xml')),\n\t\t\t\t\t\traw(override('/xl/tables/table1.xml', SML_CT + 'table+xml')),\n\t\t\t\t\t\traw(override('/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml')),\n\t\t\t\t\t\traw(override('/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml')),\n\t\t\t\t\t]) +\n\t\t\t\t\t'\\n'\n\t\t\t)\n\t\t\tzipExcel.add(\n\t\t\t\t'_rels/.rels',\n\t\t\t\tXML_DECL +\n\t\t\t\t\trelationships([\n\t\t\t\t\t\trelationship('rId1', PACKAGE_REL_NS + '/metadata/core-properties', 'docProps/core.xml'),\n\t\t\t\t\t\trelationship('rId2', OFFICE_REL + 'extended-properties', 'docProps/app.xml'),\n\t\t\t\t\t\trelationship('rId3', OFFICE_REL + 'officeDocument', 'xl/workbook.xml'),\n\t\t\t\t\t]) +\n\t\t\t\t\t'\\n'\n\t\t\t)\n\t\t\tconst headingPairs = el('vt:vector', { size: 2, baseType: 'variant' }, [\n\t\t\t\traw(el('vt:variant', null, raw(el('vt:lpstr', null, 'Worksheets')))),\n\t\t\t\traw(el('vt:variant', null, raw(el('vt:i4', null, 1)))),\n\t\t\t])\n\t\t\tzipExcel.add(\n\t\t\t\t'docProps/app.xml',\n\t\t\t\tXML_DECL +\n\t\t\t\t\tel(\n\t\t\t\t\t\t'Properties',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txmlns: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',\n\t\t\t\t\t\t\t'xmlns:vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\traw(el('Application', null, 'Microsoft Macintosh Excel')),\n\t\t\t\t\t\t\traw(el('DocSecurity', null, 0)),\n\t\t\t\t\t\t\traw(el('ScaleCrop', null, 'false')),\n\t\t\t\t\t\t\traw(el('HeadingPairs', null, raw(headingPairs))),\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t'TitlesOfParts',\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\traw(el('vt:vector', { size: 1, baseType: 'lpstr' }, raw(el('vt:lpstr', null, 'Sheet1'))))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\traw(el('Company', null)),\n\t\t\t\t\t\t\traw(el('LinksUpToDate', null, 'false')),\n\t\t\t\t\t\t\traw(el('SharedDoc', null, 'false')),\n\t\t\t\t\t\t\traw(el('HyperlinksChanged', null, 'false')),\n\t\t\t\t\t\t\traw(el('AppVersion', null, '16.0300')),\n\t\t\t\t\t\t]\n\t\t\t\t\t) +\n\t\t\t\t\t'\\n'\n\t\t\t)\n\t\t\tzipExcel.add(\n\t\t\t\t'docProps/core.xml',\n\t\t\t\tXML_DECL +\n\t\t\t\t\tel(\n\t\t\t\t\t\t'cp:coreProperties',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'xmlns:cp': 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\t\t\t\t\t\t\t'xmlns:dc': 'http://purl.org/dc/elements/1.1/',\n\t\t\t\t\t\t\t'xmlns:dcterms': 'http://purl.org/dc/terms/',\n\t\t\t\t\t\t\t'xmlns:dcmitype': 'http://purl.org/dc/dcmitype/',\n\t\t\t\t\t\t\t'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\traw(el('dc:creator', null, 'TsPptx')),\n\t\t\t\t\t\t\traw(el('cp:lastModifiedBy', null, 'TsPptx')),\n\t\t\t\t\t\t\traw(el('dcterms:created', { 'xsi:type': 'dcterms:W3CDTF' }, new Date().toISOString())),\n\t\t\t\t\t\t\traw(el('dcterms:modified', { 'xsi:type': 'dcterms:W3CDTF' }, new Date().toISOString())),\n\t\t\t\t\t\t]\n\t\t\t\t\t)\n\t\t\t)\n\t\t\tzipExcel.add(\n\t\t\t\t'xl/_rels/workbook.xml.rels',\n\t\t\t\tXML_DECL +\n\t\t\t\t\t// Ids are deliberately out of order (3/2/1/4) — that is how this part has\n\t\t\t\t\t// always been emitted, and rel order is byte-significant.\n\t\t\t\t\trelationships([\n\t\t\t\t\t\trelationship('rId3', OFFICE_REL + 'styles', 'styles.xml'),\n\t\t\t\t\t\trelationship('rId2', OFFICE_REL + 'theme', 'theme/theme1.xml'),\n\t\t\t\t\t\trelationship('rId1', OFFICE_REL + 'worksheet', 'worksheets/sheet1.xml'),\n\t\t\t\t\t\trelationship('rId4', OFFICE_REL + 'sharedStrings', 'sharedStrings.xml'),\n\t\t\t\t\t])\n\t\t\t)\n\t\t\tzipExcel.add('xl/styles.xml', XML_DECL + XLSX_STYLES_XML)\n\t\t\tzipExcel.add('xl/theme/theme1.xml', XML_DECL + XLSX_THEME_XML)\n\t\t\tzipExcel.add(\n\t\t\t\t'xl/workbook.xml',\n\t\t\t\tXML_DECL +\n\t\t\t\t\tel(\n\t\t\t\t\t\t'workbook',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txmlns: SML_NS,\n\t\t\t\t\t\t\t'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n\t\t\t\t\t\t\t'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n\t\t\t\t\t\t\t'mc:Ignorable': 'x15',\n\t\t\t\t\t\t\t'xmlns:x15': 'http://schemas.microsoft.com/office/spreadsheetml/2010/11/main',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\traw(voidEl('fileVersion', { appName: 'xl', lastEdited: 7, lowestEdited: 6, rupBuild: 10507 })),\n\t\t\t\t\t\t\traw(voidEl('workbookPr')),\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t'bookViews',\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\tvoidEl('workbookView', {\n\t\t\t\t\t\t\t\t\t\t\txWindow: 0,\n\t\t\t\t\t\t\t\t\t\t\tyWindow: 500,\n\t\t\t\t\t\t\t\t\t\t\twindowWidth: 20960,\n\t\t\t\t\t\t\t\t\t\t\twindowHeight: 15960,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\traw(el('sheets', null, raw(voidEl('sheet', { name: 'Sheet1', sheetId: 1, 'r:id': 'rId1' })))),\n\t\t\t\t\t\t\traw(voidEl('calcPr', { calcId: 0, concurrentCalc: 0 })),\n\t\t\t\t\t\t]\n\t\t\t\t\t) +\n\t\t\t\t\t'\\n'\n\t\t\t)\n\t\t\tzipExcel.add(\n\t\t\t\t'xl/worksheets/_rels/sheet1.xml.rels',\n\t\t\t\tXML_DECL + relationships([relationship('rId1', OFFICE_REL + 'table', '../tables/table1.xml')]) + '\\n'\n\t\t\t)\n\t\t}\n\n\t\tzipExcel.add('xl/sharedStrings.xml', buildXlsxSharedStrings(chartObject, data, intBubbleCols, IS_MULTI_CAT_AXES))\n\t\tzipExcel.add('xl/tables/table1.xml', buildXlsxTable(chartObject, data, intBubbleCols))\n\t\tzipExcel.add('xl/worksheets/sheet1.xml', buildXlsxSheet(chartObject, data, intBubbleCols, IS_MULTI_CAT_AXES))\n\n\t\t// Done — return the embedded workbook bytes for the caller to place.\n\t\treturn zipExcel.toBytes()\n\t}\n}\n\n/**\n * Build the embedded workbook's `xl/sharedStrings.xml` (series names + category labels).\n */\nfunction buildXlsxSharedStrings(\n\tchartObject: SlideRelChart,\n\tdata: OptsChartDataInternal[],\n\tintBubbleCols: number,\n\tIS_MULTI_CAT_AXES: boolean\n): string {\n\tconst isBubble = chartObject.opts._type === ChartType.bubble || chartObject.opts._type === ChartType.bubble3d\n\tconst isScatter = chartObject.opts._type === ChartType.scatter\n\tlet count: number\n\tlet uniqueCount: number\n\t// The leading entry is the blank the header row's label columns point at. Its two spellings are\n\t// not interchangeable: `<t/>` is the empty string, `<t xml:space=\"preserve\"></t>` is a preserved\n\t// one, and next to character data that difference is content rather than layout.\n\tlet blank = ''\n\tif (isBubble) {\n\t\tcount = uniqueCount = intBubbleCols\n\t} else if (isScatter) {\n\t\tcount = uniqueCount = data.length\n\t} else if (IS_MULTI_CAT_AXES) {\n\t\tlet totCount = data.length + 1 // +1 for the blank entry at index 0\n\t\tdataLabels(data[0]).forEach((arrLabel) => (totCount += arrLabel.filter((label) => label && label !== '').length))\n\t\tcount = uniqueCount = totCount\n\t\tblank = el('si', null, raw(voidEl('t')))\n\t} else {\n\t\t// series names + all labels of one series + number of label groups (data.labels.length) of one\n\t\t// series (i.e. how many times the blank string is used)\n\t\tcount = data.length + dataLabels(data[0]).length * firstLabelGroup(data[0]).length + dataLabels(data[0]).length\n\t\t// series names + labels of one series + blank string (same for all label groups)\n\t\tuniqueCount = data.length + dataLabels(data[0]).length * firstLabelGroup(data[0]).length + 1\n\t\tblank = el('si', null, raw(el('t', { 'xml:space': 'preserve' })))\n\t}\n\n\t// Series names. A bubble series contributes both a name and a size column.\n\tconst names = isBubble\n\t\t? data\n\t\t\t\t.map((objData, idx) =>\n\t\t\t\t\tidx === 0 ? sharedString('X-Axis') : sharedString(objData.name || `Y-Axis${idx}`) + sharedString(`Size${idx}`)\n\t\t\t\t)\n\t\t\t\t.join('')\n\t\t: data.map((objData) => sharedString((objData.name || ' ').replace('X-Axis', 'X-Values'))).join('')\n\n\t// Category labels, outermost group first — the order the sheet's label columns index into.\n\t// Blank entries are skipped: they share the single blank string at index 0.\n\tconst labels =\n\t\tisBubble || isScatter\n\t\t\t? ''\n\t\t\t: dataLabels(data[0])\n\t\t\t\t\t.slice()\n\t\t\t\t\t.reverse()\n\t\t\t\t\t.map((labelsGroup) =>\n\t\t\t\t\t\tlabelsGroup\n\t\t\t\t\t\t\t.filter((label) => label && label !== '')\n\t\t\t\t\t\t\t.map((label) => sharedString(label))\n\t\t\t\t\t\t\t.join('')\n\t\t\t\t\t)\n\t\t\t\t\t.join('')\n\n\treturn XML_DECL + el('sst', { xmlns: SML_NS, count, uniqueCount }, [raw(blank), raw(names), raw(labels)]) + '\\n'\n}\n\n/**\n * Build the embedded workbook's `xl/tables/table1.xml` (the data table over the sheet range).\n */\nfunction buildXlsxTable(chartObject: SlideRelChart, data: OptsChartDataInternal[], intBubbleCols: number): string {\n\tconst labelCols = dataLabels(data[0]).length\n\tlet ref: string\n\tlet columns: string\n\tif (chartObject.opts._type === ChartType.bubble || chartObject.opts._type === ChartType.bubble3d) {\n\t\tref = `A1:${getExcelColName(intBubbleCols)}${intBubbleCols}`\n\t\tlet idxColLtr = 1\n\t\tcolumns = data\n\t\t\t.map((obj, idx) => {\n\t\t\t\tif (idx === 0) return voidEl('tableColumn', { id: idx + 1, name: 'X-Values' })\n\t\t\t\tconst nameCol = voidEl('tableColumn', { id: idx + idxColLtr, name: obj.name })\n\t\t\t\tidxColLtr++\n\t\t\t\treturn nameCol + voidEl('tableColumn', { id: idx + idxColLtr, name: `Size${idx}` })\n\t\t\t})\n\t\t\t.join('')\n\t} else if (chartObject.opts._type === ChartType.scatter) {\n\t\tref = `A1:${getExcelColName(data.length)}${dataValues(data[0]).length + 1}`\n\t\tcolumns = data\n\t\t\t.map((_obj, idx) => voidEl('tableColumn', { id: idx + 1, name: `${idx === 0 ? 'X-Values' : 'Y-Value '}${idx}` }))\n\t\t\t.join('')\n\t} else {\n\t\tref = `A1:${getExcelColName(data.length + labelCols)}${firstLabelGroup(data[0]).length + 1}`\n\t\t// The leading columns are the label groups; the series follow them.\n\t\tcolumns =\n\t\t\tdataLabels(data[0])\n\t\t\t\t.map((_labelsGroup, idx) => voidEl('tableColumn', { id: idx + 1, name: `Column${idx + 1}` }))\n\t\t\t\t.join('') +\n\t\t\tdata.map((obj, idx) => voidEl('tableColumn', { id: idx + labelCols + 1, name: obj.name ?? '' })).join('')\n\t}\n\tconst columnCount =\n\t\tchartObject.opts._type === ChartType.bubble || chartObject.opts._type === ChartType.bubble3d\n\t\t\t? intBubbleCols\n\t\t\t: chartObject.opts._type === ChartType.scatter\n\t\t\t\t? data.length\n\t\t\t\t: data.length + labelCols\n\treturn (\n\t\tXML_DECL +\n\t\tel('table', { xmlns: SML_NS, id: 1, name: 'Table1', displayName: 'Table1', ref, totalsRowShown: 0 }, [\n\t\t\traw(el('tableColumns', { count: columnCount }, raw(columns))),\n\t\t\traw(\n\t\t\t\tvoidEl('tableStyleInfo', {\n\t\t\t\t\tshowFirstColumn: 0,\n\t\t\t\t\tshowLastColumn: 0,\n\t\t\t\t\tshowRowStripes: 1,\n\t\t\t\t\tshowColumnStripes: 0,\n\t\t\t\t})\n\t\t\t),\n\t\t])\n\t)\n}\n\n/**\n * Build the embedded workbook's `xl/worksheets/sheet1.xml` (header row + per-series data rows).\n */\nfunction buildXlsxSheet(\n\tchartObject: SlideRelChart,\n\tdata: OptsChartDataInternal[],\n\tintBubbleCols: number,\n\tIS_MULTI_CAT_AXES: boolean\n): string {\n\tconst isBubble = chartObject.opts._type === ChartType.bubble || chartObject.opts._type === ChartType.bubble3d\n\tconst isScatter = chartObject.opts._type === ChartType.scatter\n\tconst labelCols = dataLabels(data[0]).length\n\t/** One cell. `t=\"s\"` marks a shared-string index; without it the value is a number. */\n\tconst cell = (col: number, row: number, value: string | number, shared = false): string =>\n\t\tel('c', { r: `${getExcelColName(col)}${row}`, t: shared ? 's' : undefined }, raw(el('v', null, value)))\n\t/** One row, spanning the sheet's full column count. */\n\tconst sheetRow = (row: number, span: number, cells: string): string =>\n\t\tel('row', { r: row, spans: `1:${span}` }, raw(cells))\n\n\tconst colCount = isBubble ? intBubbleCols : isScatter ? data.length : data.length + labelCols\n\tlet rows = ''\n\n\tif (isBubble) {\n\t\t/* EX: INPUT: `data`\n\t\t\t\t[\n\t\t\t\t\t{ name:'X-Axis' , values:[10,11,12,13,14,15,16,17,18,19,20] },\n\t\t\t\t\t{ name:'Y-Axis 1', values:[ 1, 6, 7, 8, 9], sizes:[ 4, 5, 6, 7, 8] },\n\t\t\t\t\t{ name:'Y-Axis 2', values:[33,32,42,53,63], sizes:[11,12,13,14,15] }\n\t\t\t\t];\n\t\t\t\t*/\n\t\t/* EX: OUTPUT: bubbleChart Worksheet:\n\t\t\t\t\t-|----A-----|------B-----|------C-----|------D-----|------E-----|\n\t\t\t\t\t1| X-Values | Y-Values 1 | Y-Sizes 1 | Y-Values 2 | Y-Sizes 2 |\n\t\t\t\t\t2| 11 | 22 | 4 | 33 | 8 |\n\t\t\t\t\t-|----------|------------|------------|------------|------------|\n\t\t\t\t*/\n\t\t// Header row. Every column is a shared-string index; column A is the 'X-Axis' name.\n\t\tlet header = ''\n\t\tfor (let idx = 0; idx < intBubbleCols; idx++) header += cell(idx + 1, 1, idx, true)\n\t\trows += sheetRow(1, intBubbleCols, header)\n\n\t\t// One row per X value; each series contributes a value column and a size column.\n\t\tdataValues(data[0]).forEach((val, idx) => {\n\t\t\tlet cells = cell(1, idx + 2, val)\n\t\t\tlet idxColLtr = 2\n\t\t\tfor (let idy = 1; idy < data.length; idy++) {\n\t\t\t\tcells += cell(idxColLtr++, idx + 2, dataValues(data[idy])[idx] ?? '')\n\t\t\t\tcells += cell(idxColLtr++, idx + 2, dataSizes(data[idy])[idx] ?? '')\n\t\t\t}\n\t\t\trows += sheetRow(idx + 2, intBubbleCols, cells)\n\t\t})\n\t} else if (isScatter) {\n\t\t/* EX: INPUT: `data`\n\t\t\t\t\t[\n\t\t\t\t\t\t{ name:'X-AxisA', values:[ 1, 2, 3, 4, 5] },\n\t\t\t\t\t\t{ name:'Y-AxisB', values:[ 2,22,42,52,62] },\n\t\t\t\t\t\t{ name:'Y-AxisC', values:[ 3,33,43,53,63] }\n\t\t\t\t\t];\n\t\t\t\t*/\n\t\t/* EX: OUTPUT: sheet1.xml:\n\t\t\t\t\t-|----A----|----B----|----C----|\n\t\t\t\t\t1| X-AxisA | Y-AxisB | Y-AxisC |\n\t\t\t\t\t2| 1 | 2 | 3 |\n\t\t\t\t\t-|---------|---------|---------|\n\t\t\t\t*/\n\t\tlet header = ''\n\t\tfor (let idx = 0; idx < data.length; idx++) header += cell(idx + 1, 1, idx, true)\n\t\trows += sheetRow(1, data.length, header)\n\n\t\tdataValues(data[0]).forEach((val, idx) => {\n\t\t\t// The leading column is the X value; the rest are one Y series each.\n\t\t\tlet cells = cell(1, idx + 2, val)\n\t\t\tfor (let idy = 1; idy < data.length; idy++) {\n\t\t\t\tconst yValue = dataValues(data[idy])[idx]\n\t\t\t\tcells += cell(idy + 1, idx + 2, yValue || yValue === 0 ? yValue : '')\n\t\t\t}\n\t\t\trows += sheetRow(idx + 2, data.length, cells)\n\t\t})\n\t} else if (!IS_MULTI_CAT_AXES) {\n\t\t/* EX: INPUT: `data`\n\t\t\t\t\t[\n\t\t\t\t\t\t{ name:'Red', labels:['Jan..May-17'], values:[11,13,14,15,16] },\n\t\t\t\t\t\t{ name:'Amb', labels:['Jan..May-17'], values:[22, 6, 7, 8, 9] },\n\t\t\t\t\t\t{ name:'Grn', labels:['Jan..May-17'], values:[33,32,42,53,63] }\n\t\t\t\t\t];\n\t\t\t\t*/\n\t\t/* EX: OUTPUT: lineChart Worksheet:\n\t\t\t\t\t-|---A---|--B--|--C--|--D--|\n\t\t\t\t\t1| | Red | Amb | Grn |\n\t\t\t\t\t2|Jan-17 | 11| 22| 33|\n\t\t\t\t\t3|Feb-17 | 55| 43| 70|\n\t\t\t\t\t4|Mar-17 | 56| 143| 99|\n\t\t\t\t\t5|Apr-17 | 65| 3| 120|\n\t\t\t\t\t6|May-17 | 75| 93| 170|\n\t\t\t\t\t-|-------|-----|-----|-----|\n\t\t\t\t*/\n\t\t// Header row: the label columns point at the blank shared string, then the series names.\n\t\tlet header = ''\n\t\tfor (let idx = 0; idx < labelCols; idx++) header += cell(idx + 1, 1, 0, true)\n\t\tfor (let idx = 0; idx < data.length; idx++) header += cell(idx + 1 + labelCols, 1, idx + 1, true)\n\t\trows += sheetRow(1, data.length + labelCols, header)\n\n\t\t// Normally one row per category; a category-less chartEx layout (a histogram feeds PowerPoint\n\t\t// raw observations with no labels) has no label groups, so the row count falls back to the\n\t\t// longest value series and the leading label columns are simply skipped — values land in A.\n\t\tconst rowCount = firstLabelGroup(data[0]).length || Math.max(0, ...data.map((series) => dataValues(series).length))\n\t\tfor (let idx = 0; idx < rowCount; idx++) {\n\t\t\tlet cells = ''\n\t\t\tfor (let idx2 = labelCols - 1; idx2 >= 0; idx2--)\n\t\t\t\tcells += cell(labelCols - idx2, idx + 2, data.length + idx + 1, true)\n\t\t\tfor (let idy = 0; idy < data.length; idy++) {\n\t\t\t\tcells += cell(labelCols + idy + 1, idx + 2, dataValues(data[idy])[idx] ?? '')\n\t\t\t}\n\t\t\trows += sheetRow(idx + 2, data.length + labelCols, cells)\n\t\t}\n\t} else {\n\t\tconst TOT_SER = data.length\n\t\tconst TOT_CAT = firstLabelGroup(data[0]).length\n\t\t// labels[0] is the leaf (inner) level; labels[TOT_LVL-1] is the outermost.\n\t\t// Reversed so that the outermost group occupies column A and the leaf occupies column TOT_LVL.\n\t\tconst revLabelGroups = dataLabels(data[0]).slice().reverse()\n\n\t\t// Pre-build a map from (revLevelIdx, rowIdx) -> shared-string index.\n\t\t// SST layout: 0=blank, 1..TOT_SER=series names, then non-empty labels per\n\t\t// reversed level in appearance order.\n\t\tconst ssLabelMap = new Map<string, number>()\n\t\tlet ssIdx = TOT_SER + 1\n\t\trevLabelGroups.forEach((labelsGroup, revLevelIdx) => {\n\t\t\tlabelsGroup.forEach((label, rowIdx) => {\n\t\t\t\tif (label && label !== '') ssLabelMap.set(`${revLevelIdx}:${rowIdx}`, ssIdx++)\n\t\t\t})\n\t\t})\n\n\t\t// Header row: label columns blank (index 0), series name columns use indices 1..TOT_SER\n\t\tlet header = ''\n\t\tfor (let col = 1; col <= labelCols; col++) header += cell(col, 1, 0, true)\n\t\tfor (let ser = 0; ser < TOT_SER; ser++) header += cell(labelCols + ser + 1, 1, ser + 1, true)\n\t\trows += sheetRow(1, TOT_SER + labelCols, header)\n\n\t\t// One data row per leaf category\n\t\tfor (let idx = 0; idx < TOT_CAT; idx++) {\n\t\t\t// Label columns: column idy+1 holds revLabelGroups[idy]; emit only non-empty cells\n\t\t\tlet cells = revLabelGroups\n\t\t\t\t.map((labelsGroup, idy) => {\n\t\t\t\t\tconst colLabel = labelsGroup[idx]\n\t\t\t\t\treturn colLabel && colLabel !== '' ? cell(idy + 1, idx + 2, ssLabelMap.get(`${idy}:${idx}`) ?? '', true) : ''\n\t\t\t\t})\n\t\t\t\t.join('')\n\t\t\tfor (let idy = 0; idy < TOT_SER; idy++) {\n\t\t\t\tcells += cell(labelCols + idy + 1, idx + 2, dataValues(data[idy])[idx] ?? '')\n\t\t\t}\n\t\t\trows += sheetRow(idx + 2, TOT_SER + labelCols, cells)\n\t\t}\n\t}\n\n\tconst sheetView = el(\n\t\t'sheetViews',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'sheetView',\n\t\t\t\t{ tabSelected: 1, workbookViewId: 0 },\n\t\t\t\traw(voidEl('selection', { activeCell: 'B1', sqref: 'B1' }))\n\t\t\t)\n\t\t)\n\t)\n\treturn (\n\t\tXML_DECL +\n\t\tel(\n\t\t\t'worksheet',\n\t\t\t{\n\t\t\t\txmlns: SML_NS,\n\t\t\t\t'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n\t\t\t\t'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n\t\t\t\t'mc:Ignorable': 'x14ac',\n\t\t\t\t'xmlns:x14ac': 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac',\n\t\t\t},\n\t\t\t[\n\t\t\t\traw(voidEl('dimension', { ref: `A1:${getExcelColName(colCount)}${dataValues(data[0]).length + 1}` })),\n\t\t\t\traw(sheetView),\n\t\t\t\traw(voidEl('sheetFormatPr', { baseColWidth: 10, defaultRowHeight: 16 })),\n\t\t\t\traw(el('sheetData', null, raw(rows))),\n\t\t\t\traw(voidEl('pageMargins', { left: 0.7, right: 0.7, top: 0.75, bottom: 0.75, header: 0.3, footer: 0.3 })),\n\t\t\t\t// NOTE: Intentionally no `<tableParts>`. A tablePart only works for scatter charts; every\n\t\t\t\t// other chart type reports a \"cannot find linked file\" error. The chart data can be\n\t\t\t\t// edited / range-selected without it, so it is deliberately never emitted.\n\t\t\t]\n\t\t) +\n\t\t'\\n'\n\t)\n}\n\n/**\n * Build the standalone `.rels` for a chart part: a single `rId1` relationship to\n * the chart's embedded workbook (`Target`). Shared by the package write path and\n * the read-side injection path, which pass different (relative) embedding targets.\n * @param {string} embeddingTarget - the workbook target, relative to the chart part\n * @return {string} the chart part's `.rels` XML\n */\nfunction buildChartRelsXml(embeddingTarget: string): string {\n\t// `voidEl` escapes the Target. The one in-tree caller passes an internally built\n\t// `../embeddings/Microsoft_Excel_WorksheetN.xlsx`, so that is a no-op on bytes;\n\t// it matters only for the read-side injection path, which supplies its own target.\n\treturn XML_DECL + relationships([relationship('rId1', OFFICE_REL + 'package', embeddingTarget)])\n}\n\n/**\n * Build the `.rels` for a chartEx chart part: the embedded workbook (rId1, via `<cx:externalData>`)\n * plus the mandatory color-style (rId2) and chart-style (rId3) sidecar parts. PowerPoint treats a\n * chartEx part without the style/color rels as corrupt, so these are not optional.\n * @param {string} embeddingTarget - workbook target, relative to the chart part\n * @param {string} colorsTarget - `colors{N}.xml`, relative to the chart part\n * @param {string} styleTarget - `style{N}.xml`, relative to the chart part\n */\nfunction buildChartExRelsXml(embeddingTarget: string, colorsTarget: string, styleTarget: string): string {\n\treturn (\n\t\tXML_DECL +\n\t\trelationships([\n\t\t\trelationship('rId1', OFFICE_REL + 'package', embeddingTarget),\n\t\t\trelationship('rId2', MS_CHART_REL + 'chartColorStyle', colorsTarget),\n\t\t\trelationship('rId3', MS_CHART_REL + 'chartStyle', styleTarget),\n\t\t])\n\t)\n}\n\n/**\n * Create the chart's embedded Excel worksheet and add the chart + workbook parts\n * to `zip` (package write path). The read-side injection path builds the same\n * parts itself from {@link buildEmbeddedWorksheet}, {@link buildChartRelsXml}, and\n * {@link makeXmlCharts}.\n * @param {SlideRelChart} chartObject - chart object\n * @param {ZipWriter} zip - zip writer the resulting XLSX (and chart parts) are added to\n * @return {Promise} promise of generating the XLSX file\n */\nexport async function createExcelWorksheet(chartObject: SlideRelChart, zip: ZipWriter): Promise<string> {\n\t// 1: Embed the workbook. The xlsx is itself a zip, so STORE it — re-DEFLATING\n\t// already-compressed bytes wastes CPU.\n\tzip.add(`ppt/embeddings/Microsoft_Excel_Worksheet${chartObject.globalId}.xlsx`, buildEmbeddedWorksheet(chartObject), {\n\t\tstore: true,\n\t})\n\n\t// 2: Create the chart part, its rels, and (for chartEx) the required style/color sidecar parts.\n\tconst embeddingTarget = `../embeddings/Microsoft_Excel_Worksheet${chartObject.globalId}.xlsx`\n\tif (chartObject.isChartEx) {\n\t\t// chartEx charts REQUIRE a chart-style + color-style part or PowerPoint reports the deck as\n\t\t// corrupt (schema-valid but unopenable) — see gen/chart/chartex-style.ts.\n\t\tconst colorsName = `colors${chartObject.globalId}.xml`\n\t\tconst styleName = `style${chartObject.globalId}.xml`\n\t\tzip.add(`ppt/charts/${colorsName}`, makeChartExColorsXml())\n\t\tzip.add(`ppt/charts/${styleName}`, makeChartExStyleXml())\n\t\tzip.add(\n\t\t\t'ppt/charts/_rels/' + chartObject.fileName + '.rels',\n\t\t\tbuildChartExRelsXml(embeddingTarget, colorsName, styleName)\n\t\t)\n\t\tzip.add(`ppt/charts/${chartObject.fileName}`, makeXmlChartEx(chartObject))\n\t} else {\n\t\tzip.add('ppt/charts/_rels/' + chartObject.fileName + '.rels', buildChartRelsXml(embeddingTarget))\n\t\tzip.add(`ppt/charts/${chartObject.fileName}`, makeXmlCharts(chartObject))\n\t}\n\n\treturn ''\n}\n","/**\n * ts-pptx: Slide-Master Definition\n *\n * `createSlideMaster` walks a `SlideMasterProps` definition onto a layout target: shared\n * chart / image / shape / text children via `addChildDefinition`, plus master-specific text\n * placeholders (which need the object index for `_placeholderIdx`).\n */\nimport type { ObjectOptions, SlideMasterProps, TextPropsOptions } from '../../types/index.js'\nimport type { PresSlideInternal, SlideLayoutInternal } from '../../types/internal.js'\nimport { addChildDefinition } from './group.js'\nimport { addTextDefinition } from './text.js'\n\n/**\n * Transforms a slide definition to a slide object that is then passed to the XML transformation process.\n * @param {SlideMasterProps} props - slide definition\n * @param {PresSlideInternal|SlideLayoutInternal} target - empty slide object that should be updated by the passed definition\n */\nexport function createSlideMaster(props: SlideMasterProps, target: SlideLayoutInternal): void {\n\t// STEP 1: Add all Slide Master objects in the order they were given\n\tif (props.objects && Array.isArray(props.objects) && props.objects.length > 0) {\n\t\tprops.objects.forEach((object, idx) => {\n\t\t\tconst tgt = target as PresSlideInternal\n\t\t\tif (addChildDefinition(tgt, object)) {\n\t\t\t\t// handled by the shared chart/image/shape/text dispatch\n\t\t\t} else if ('placeholder' in object) {\n\t\t\t\tconst placeholder = object.placeholder\n\t\t\t\tconst { name, type, ...rawPlaceholderOptions } = placeholder.options\n\t\t\t\tconst placeholderOptions = rawPlaceholderOptions as TextPropsOptions & ObjectOptions\n\t\t\t\tplaceholderOptions.placeholder = name\n\t\t\t\tplaceholderOptions._placeholderType = type\n\t\t\t\tplaceholderOptions._placeholderIdx = 100 + idx\n\t\t\t\taddTextDefinition(tgt, [{ text: placeholder.text }], placeholderOptions, true)\n\t\t\t\t// NOTE: only text placeholders are supported (image/other placeholder kinds are not emitted)\n\t\t\t}\n\t\t})\n\t}\n\n\t// STEP 2: Add Slide Numbers (NOTE: Do this last so numbers are not covered by objects!)\n\tif (props.slideNumber && typeof props.slideNumber === 'object') target._slideNumberProps = props.slideNumber\n}\n","/**\n * ts-pptx: Placeholder Definition\n *\n * `addPlaceholdersToSlideLayouts` seeds a slide with any layout placeholders it has not already\n * populated, so every inherited placeholder is present as an (empty) text object.\n */\nimport { SlideObjectType } from '../../enums.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { addTextDefinition } from './text.js'\n\n/**\n * Adds placeholder objects to slide\n * @param {PresSlideInternal} slide - slide object containing layouts\n */\nexport function addPlaceholdersToSlideLayouts(slide: PresSlideInternal): void {\n\tif (!slide._slideLayout) return // Add all placeholders on this Slide that dont already exist\n\t;(slide._slideLayout._slideObjects || []).forEach((slideLayoutObj) => {\n\t\tif (slideLayoutObj._type === SlideObjectType.placeholder) {\n\t\t\tconst slideLayoutOptions = slideLayoutObj.options || {}\n\t\t\t// A: Search for this placeholder on Slide before we add\n\t\t\t// NOTE: Check to ensure a placeholder does not already exist on the Slide\n\t\t\t// They are created when they have been populated with text (ex: `slide.addText('Hi', { placeholder:'title' });`)\n\t\t\tif (\n\t\t\t\t!slide._slideObjects.some(\n\t\t\t\t\t(slideObj) => slideObj.options && slideObj.options.placeholder === slideLayoutOptions.placeholder\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\taddTextDefinition(slide, [{ text: '' }], slideLayoutOptions, true)\n\t\t\t}\n\t\t}\n\t})\n}\n","/**\n * ts-pptx: Media Methods\n */\n\nimport { IMG_BROKEN } from '../media/placeholders.js'\nimport type { PresSlideInternal, SlideLayoutInternal, SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from '../runtime/types.js'\nimport { toMediaDataUri } from '../media/base64.js'\nimport { warn } from '../diagnostics.js'\nimport { MediaError } from '../errors.js'\n\ntype SlideMediaRelWithPath = SlideRelMedia & { path: string }\n\nfunction hasEncodingPath(rel: SlideRelMedia): rel is SlideMediaRelWithPath {\n\treturn typeof rel.path === 'string' && rel.path.length > 0 && !rel.path.includes('preencoded')\n}\n\n/**\n * Encode Image/Audio/Video into base64\n * @param {PresSlideInternal | SlideLayoutInternal} layout - slide layout\n * @param {RuntimeAdapter} runtime - runtime adapter (Node/browser media loader)\n * @param {'throw' | 'placeholder'} onMediaError - failure policy: reject the export (default) or substitute a placeholder and warn\n * @return {Promise} promise\n */\nexport function encodeSlideMediaRels(\n\tlayout: PresSlideInternal | SlideLayoutInternal,\n\truntime: RuntimeAdapter,\n\tonMediaError: 'throw' | 'placeholder' = 'throw'\n): Array<Promise<string>> {\n\tconst imageProms: Array<Promise<string>> = []\n\n\t// A: Capture all audio/image/video candidates for encoding (filtering online/pre-encoded)\n\tconst candidateRels = layout._relsMedia.filter(\n\t\t(rel): rel is SlideMediaRelWithPath => rel.type !== 'online' && !rel.data && hasEncodingPath(rel)\n\t)\n\n\t// B: PERF: Mark dupes (same `path`) to avoid loading the same media over-and-over!\n\tconst unqPaths: string[] = []\n\tcandidateRels.forEach((rel) => {\n\t\tif (!unqPaths.includes(rel.path)) {\n\t\t\trel.isDuplicate = false\n\t\t\tunqPaths.push(rel.path)\n\t\t} else {\n\t\t\trel.isDuplicate = true\n\t\t}\n\t})\n\n\t// STEP 4: Read/Encode each unique media item\n\tcandidateRels\n\t\t.filter((rel) => !rel.isDuplicate)\n\t\t.forEach((rel) => {\n\t\t\timageProms.push(\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trel.data = toMediaDataUri(await runtime.loadMedia(rel), rel.type)\n\t\t\t\t\t\tconst dupes = candidateRels.filter((dupe) => dupe.isDuplicate && dupe.path === rel.path)\n\t\t\t\t\t\tdupes.forEach((dupe) => (dupe.data = rel.data))\n\t\t\t\t\t\tif (rel.isSvgPng) await runtime.createSvgPngPreview(rel)\n\t\t\t\t\t\t// A path-deduped rel can itself be an SVG-PNG preview (the same SVG *file*\n\t\t\t\t\t\t// placed 2+ times on one slide: each placement pushes its own fallback rel).\n\t\t\t\t\t\t// Such dupes are skipped by STEP 5 — its `rel.data` filter runs synchronously,\n\t\t\t\t\t\t// before this async load populates `dupe.data` — so convert them here, or the\n\t\t\t\t\t\t// fallback keeps raw SVG bytes in a `.png` part and corrupts the deck.\n\t\t\t\t\t\tawait Promise.all(dupes.filter((dupe) => dupe.isSvgPng).map((dupe) => runtime.createSvgPngPreview(dupe)))\n\t\t\t\t\t\treturn 'done'\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tif (onMediaError === 'placeholder') {\n\t\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t\t'media/load-failed',\n\t\t\t\t\t\t\t\t`Failed to load media \"${rel.path}\"; embedding a broken-image placeholder. (${String(ex)})`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\trel.data = IMG_BROKEN\n\t\t\t\t\t\t\tcandidateRels\n\t\t\t\t\t\t\t\t.filter((dupe) => dupe.isDuplicate && dupe.path === rel.path)\n\t\t\t\t\t\t\t\t.forEach((dupe) => (dupe.data = rel.data))\n\t\t\t\t\t\t\treturn 'done'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Default: fail-fast with an actionable error that names the failing asset and\n\t\t\t\t\t\t// chains the original cause (the raw fs/network error alone does not say which\n\t\t\t\t\t\t// media path broke). Pass `onMediaError: 'placeholder'` to degrade gracefully.\n\t\t\t\t\t\tthrow new MediaError('media/load-failed', `Failed to load media \"${rel.path}\" during export.`, {\n\t\t\t\t\t\t\tcause: ex,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})()\n\t\t\t)\n\t\t})\n\n\t// STEP 5: SVG-PNG previews\n\t// ......: \"SVG:\" base64 data still requires a png to be generated\n\t// ......: (`isSvgPng` flag this as the preview image, not the SVG itself)\n\tlayout._relsMedia\n\t\t.filter((rel) => rel.isSvgPng && rel.data)\n\t\t.forEach((rel) => {\n\t\t\timageProms.push(runtime.createSvgPngPreview(rel))\n\t\t})\n\n\treturn imageProms\n}\n","/**\n * ts-pptx: the pre-serialization pass\n *\n * Everything that must happen to authored slide state *before* any XML is built. Two callers\n * reach serialization and both need it:\n *\n * - `package/assemble.ts` — the normal `write`/`stream`/`writeFile` path, building a\n * complete `.pptx`.\n * - `PresentationCore.extractSlides()` — serializes slide bodies only, for splicing into\n * an already-loaded deck via `Presentation.appendSlides()` (`ts-pptx/read`).\n *\n * The second used to reimplement the first inline, kept in step by a comment that said\n * \"exactly as ... does\". Nothing failed when they drifted: `extractSlides` would simply emit\n * slides that did not match what a normal write produces, and no test compares the two.\n *\n * Two primitives rather than one combined pass, because the package path has work of its own\n * that must land *between* them: it de-duplicates identical media across the deck (which\n * needs the encoded bytes {@link encodeMediaForTargets} produces) and assigns package-unique\n * chart part filenames, both before any slide content is baked. Exposing the halves lets\n * `assemble` keep its established order exactly while still sharing the code.\n *\n * The order across the two is load-bearing:\n *\n * 1. **Media first.** It is the only asynchronous step, and the sync XML pass reads the\n * `rel.data` it populates.\n * 2. **Backfill placeholders**, so a slide inherits its layout's placeholder objects before\n * anything measures or serializes them.\n * 3. **Bake measured fit last**, because it measures the text step 2 may have just added and\n * writes the `fontScale` the sync XML pass then reads.\n *\n * The two functions take different target sets on purpose: media lives on layouts and the\n * master as well as on slides, while placeholder backfill and measured fit apply only to\n * slides. `extractSlides` passes only its slides to both, because it emits no layout or\n * master parts.\n */\n\nimport { applyMeasuredFit } from '../measure/fit.js'\nimport type { FontMetricsRegistry } from '../measure/font-metrics.js'\nimport type { RuntimeAdapter } from '../runtime/types.js'\nimport type { PresSlideInternal, SlideLayoutInternal } from '../types/internal.js'\nimport { addPlaceholdersToSlideLayouts } from './define/placeholder.js'\nimport { encodeSlideMediaRels } from './media.js'\n\n/**\n * Step 1: load and base64-encode every media rel on the given targets, populating `rel.data`.\n * @param {ReadonlyArray<PresSlideInternal | SlideLayoutInternal>} targets - media-bearing targets (slides, layouts, master)\n * @param {RuntimeAdapter} runtime - runtime adapter used to load media\n * @param {'throw' | 'placeholder'} onMediaError - failure policy for unloadable media\n */\nexport async function encodeMediaForTargets(\n\ttargets: ReadonlyArray<PresSlideInternal | SlideLayoutInternal>,\n\truntime: RuntimeAdapter,\n\tonMediaError: 'throw' | 'placeholder'\n): Promise<void> {\n\tconst promises: Array<Promise<string>> = []\n\tfor (const target of targets) {\n\t\tpromises.push(...encodeSlideMediaRels(target, runtime, onMediaError))\n\t}\n\tawait Promise.all(promises)\n}\n\n/**\n * Steps 2 and 3: backfill inherited layout placeholders, then bake measured text fit.\n * @param {PresSlideInternal[]} slides - the slides to prepare\n * @param {FontMetricsRegistry} fontMetrics - registered font metrics; an empty registry skips the fit bake\n */\nexport function bakeSlideContent(slides: PresSlideInternal[], fontMetrics: FontMetricsRegistry): void {\n\tfor (const slide of slides) {\n\t\tif (slide._slideLayout) addPlaceholdersToSlideLayouts(slide)\n\t}\n\n\tapplyMeasuredFit(slides, fontMetrics)\n}\n","/**\n * ts-pptx: slide shape-id allocation\n *\n * Compute the `<p:cNvPr>` id every slide shape (including group children) is\n * rendered with, and resolve an `objectName` back to that id. References that\n * must name a shape before the render walk reaches it — a connector's\n * `<a:stCxn>`, an animation's `<p:spTgt spid>` — go through these helpers, so\n * they are shared by both the slide-object renderer and the animation builder.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport type { SlideObject } from '../../types/internal.js'\nimport { encodeXmlAttrValue } from '../utils.js'\n\n/**\n * Every object a slide renders, paired with the `<p:cNvPr>` id it is rendered with: top-level\n * objects first (`index + 2`, in add order), then group children, seeded past the last top-level id\n * and allocated pre-order (a nested group takes an id before its own children do).\n *\n * This **mirrors** the allocation in `slideObjectToXml`, which hands out ids as it walks the tree.\n * A reference that must name an id *before* the walk reaches it — a connector's `<a:stCxn>`, an\n * animation's `<p:spTgt spid>` — cannot wait for that, so it resolves through this map instead.\n * The two must stay in step: `test/regression/shape/group-shapes.test.js` parses the emitted `cNvPr` ids\n * back out and asserts each reference points at the shape it names, so drift fails there.\n * @param slideObjects - the slide's top-level objects\n * @returns each object's `<p:cNvPr>` id, keyed by object identity, in id order\n */\nexport function collectSlideShapeIds(slideObjects: SlideObject[]): Map<SlideObject, number> {\n\tconst shapeIds = new Map<SlideObject, number>()\n\tslideObjects.forEach((obj, idx) => shapeIds.set(obj, idx + 2))\n\n\tlet childIdxAlloc = slideObjects.length\n\tconst allocGroupChildren = (children: SlideObject[]): void => {\n\t\tchildren.forEach((child) => {\n\t\t\tshapeIds.set(child, childIdxAlloc++ + 2)\n\t\t\tif (child._type === SlideObjectType.group) allocGroupChildren(child._groupObjects || [])\n\t\t})\n\t}\n\tslideObjects.forEach((obj) => {\n\t\tif (obj._type === SlideObjectType.group) allocGroupChildren(obj._groupObjects || [])\n\t})\n\n\treturn shapeIds\n}\n\n/**\n * The `<p:cNvPr>` id of the object named `objectName`, or `null` when the slide has no such object.\n *\n * `objectName` is the **raw**, caller-supplied name — escaping is this helper's job. Every\n * `add*Definition` stores the name attribute-escaped (`encodeXmlAttrValue`) so `cNvPrOpen` can emit\n * it verbatim (see its comment in `gen/slide/objects/shared.ts`), which means the stored text is not the\n * caller's string: a shape added as `'Q&A'` is held as `Q&A`. Comparing here rather than at each\n * call site keeps that one rule in one place — re-deriving it per caller is exactly how the\n * animation lookup came to disagree with the connector one and drop every effect naming a shape\n * whose name contained `&`, `<`, `>`, `\"`, `'`, a tab or a newline.\n *\n * Group children are searched too: `buildGroupObject` splices them out of `_slideObjects` and into\n * their group's `_groupObjects`, but they are still `<p:cNvPr>`-named on this same slide and so are\n * legitimate targets for a connector binding or an animation. Searching only `_slideObjects` is what\n * silently dropped both.\n *\n * A top-level object wins over a group child of the same name (`slideObjectToXml` warns separately\n * about the duplicate), which leaves resolution unchanged for every deck without groups.\n * @param shapeIds - the slide's shape ids, from `collectSlideShapeIds` (iterated in id order)\n * @param objectName - the raw `objectName` to resolve, as the caller spelled it\n * @returns the object's `<p:cNvPr>` id, or `null` when unresolved\n */\nexport function resolveObjectNameToId(shapeIds: Map<SlideObject, number>, objectName: string): number | null {\n\tconst key = encodeXmlAttrValue(objectName)\n\tfor (const [obj, id] of shapeIds) {\n\t\tif (obj.options?.objectName === key) return id\n\t}\n\treturn null\n}\n","/**\n * ts-pptx: slide build animations\n *\n * Resolve preset build animations to their target shape ids and assemble the\n * `mainSeq` / `bldLst` trees that PowerPoint reads for click-triggered entrance,\n * emphasis and exit effects. Consumed by the slide `<p:timing>` builder.\n */\n\nimport type { AnimationProps } from '../../types/index.js'\nimport type { SlideObject } from '../../types/internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { resolveObjectNameToId } from '../slide/shape-ids.js'\n\n/**\n * Resolved animation target's shape id (`spid`), or `null` when it cannot be resolved — in which\n * case the effect is dropped, so every `null` warns rather than leaving the animation silently\n * missing from the deck.\n *\n * `objectName` resolves through `shapeIds`, which covers group children: they are `<p:cNvPr>`-named\n * on the slide and animate like any other shape, but are not in `_slideObjects`, so the old lookup\n * there dropped every animation targeting one. The name goes in raw — `resolveObjectNameToId` owns\n * matching it against the attribute-escaped form the slide object stores — so the warning below\n * quotes the same spelling the caller passed.\n *\n * `shapeIndex` is a 0-based index into the top-level objects only (its `spid = shapeIndex + 2`\n * mirrors the `idx + 2` top-level allocation in `collectSlideShapeIds`; group children take ids past\n * that range). An index outside `[0, topLevelCount)` would emit a `<p:spTgt spid>` naming no shape on\n * the slide — a dangling spid PowerPoint reports as a repair (0x80070570) — so it warns and drops,\n * exactly like an unresolvable `objectName` does.\n * @param shapeIds - the slide's shape ids, from `collectSlideShapeIds`\n * @param topLevelCount - number of top-level slide objects a `shapeIndex` may address\n * @param anim - the animation to resolve\n * @returns the target's `<p:cNvPr>` id, or `null`\n */\nexport function resolveAnimationSpid(\n\tshapeIds: Map<SlideObject, number>,\n\ttopLevelCount: number,\n\tanim: AnimationProps\n): number | null {\n\tif (typeof anim.shapeIndex === 'number') {\n\t\tif (anim.shapeIndex >= 0 && anim.shapeIndex < topLevelCount) return anim.shapeIndex + 2\n\t\twarn(\n\t\t\t'animation/target-index-out-of-range',\n\t\t\t`addAnimation: shapeIndex ${anim.shapeIndex} is out of range (slide has ${topLevelCount} top-level object(s)), so its \"${anim.preset}\" effect was dropped.`\n\t\t)\n\t\treturn null\n\t}\n\tif (anim.objectName) {\n\t\tconst id = resolveObjectNameToId(shapeIds, anim.objectName)\n\t\tif (id !== null) return id\n\t\twarn(\n\t\t\t'animation/target-not-found',\n\t\t\t`addAnimation: no object named \"${anim.objectName}\" on the slide, so its \"${anim.preset}\" effect was dropped.`\n\t\t)\n\t\treturn null\n\t}\n\twarn(\n\t\t'animation/target-missing',\n\t\t`addAnimation: the \"${anim.preset}\" effect names no target (pass shapeIndex or objectName), so it was dropped.`\n\t)\n\treturn null\n}\n\ninterface AnimPresetMeta {\n\tpresetID: number\n\tpresetClass: 'entr' | 'emph' | 'exit'\n\tpresetSubtype: number\n\tdefaultDurationMs: number\n\t/** Emit the effect's behavior nodes (each `<p:cTn>` consumes one id via `next`). */\n\tbehaviors: (spid: number, dur: number, next: () => number) => string\n}\n\nconst ANIM_SET_VISIBLE = (spid: number, next: () => number): string =>\n\tel('p:set', null, [\n\t\traw(\n\t\t\tel('p:cBhvr', null, [\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cTn',\n\t\t\t\t\t\t{ id: next(), dur: 1, fill: 'hold' },\n\t\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: 0 }))))\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\traw(el('p:attrNameLst', null, raw(el('p:attrName', null, 'style.visibility')))),\n\t\t\t])\n\t\t),\n\t\traw(el('p:to', null, raw(voidEl('p:strVal', { val: 'visible' })))),\n\t])\n\nconst ANIM_SET_HIDDEN = (spid: number, dur: number, next: () => number): string =>\n\tel('p:set', null, [\n\t\traw(\n\t\t\tel('p:cBhvr', null, [\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cTn',\n\t\t\t\t\t\t{ id: next(), dur: 1, fill: 'hold' },\n\t\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: Math.max(0, dur - 1) }))))\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\traw(el('p:attrNameLst', null, raw(el('p:attrName', null, 'style.visibility')))),\n\t\t\t])\n\t\t),\n\t\traw(el('p:to', null, raw(voidEl('p:strVal', { val: 'hidden' })))),\n\t])\n\n/** `p:animEffect` filter transition (fade/wipe(down)/…), shared by entrance and exit presets. */\nconst ANIM_EFFECT = (transition: 'in' | 'out', filter: string, spid: number, dur: number, next: () => number): string =>\n\tel(\n\t\t'p:animEffect',\n\t\t{ transition, filter },\n\t\traw(\n\t\t\tel('p:cBhvr', null, [\n\t\t\t\traw(voidEl('p:cTn', { id: next(), dur })),\n\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t])\n\t\t)\n\t)\n\nconst ANIM_FADE = (transition: 'in' | 'out', spid: number, dur: number, next: () => number): string =>\n\tANIM_EFFECT(transition, 'fade', spid, dur, next)\n\n/**\n * One `ppt_x`/`ppt_y` motion `<p:anim>` for Fly In (entrance) / Fly Out (exit).\n * PowerPoint authors the two directions differently (captured in\n * `slide-animation-presets.oracle.json`): the entrance form references the\n * hashed run-time variables (`#ppt_x`) and holds (`fill=\"hold\"`) starting\n * off-screen and ending in place; the exit form uses the bare variables\n * (`ppt_x`, no `#`), omits `fill=\"hold\"`, and ends off-screen.\n */\nconst ANIM_FLY_AXIS = (\n\tdirection: 'in' | 'out',\n\taxis: 'x' | 'y',\n\tspid: number,\n\tdur: number,\n\tnext: () => number\n): string => {\n\tconst h = direction === 'in' ? '#' : ''\n\tlet from: string\n\tlet to: string\n\tif (axis === 'x') {\n\t\tfrom = `${h}ppt_x`\n\t\tto = `${h}ppt_x`\n\t} else if (direction === 'in') {\n\t\tfrom = `1+${h}ppt_h/2`\n\t\tto = `${h}ppt_y`\n\t} else {\n\t\tfrom = `${h}ppt_y`\n\t\tto = `1+${h}ppt_h/2`\n\t}\n\tconst fill = direction === 'in' ? 'hold' : null\n\treturn el('p:anim', { calcmode: 'lin', valueType: 'num' }, [\n\t\traw(\n\t\t\tel('p:cBhvr', { additive: 'base' }, [\n\t\t\t\traw(voidEl('p:cTn', { id: next(), dur, fill })),\n\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\traw(el('p:attrNameLst', null, raw(el('p:attrName', null, `ppt_${axis}`)))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:tavLst', null, [\n\t\t\t\traw(el('p:tav', { tm: 0 }, raw(el('p:val', null, raw(voidEl('p:strVal', { val: from })))))),\n\t\t\t\traw(el('p:tav', { tm: 100000 }, raw(el('p:val', null, raw(voidEl('p:strVal', { val: to })))))),\n\t\t\t])\n\t\t),\n\t])\n}\n\nconst ANIM_PRESETS: Record<string, AnimPresetMeta> = {\n\tfadeIn: {\n\t\tpresetID: 10,\n\t\tpresetClass: 'entr',\n\t\tpresetSubtype: 0,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, dur, next) => ANIM_SET_VISIBLE(spid, next) + ANIM_FADE('in', spid, dur, next),\n\t},\n\tflyIn: {\n\t\tpresetID: 2,\n\t\tpresetClass: 'entr',\n\t\tpresetSubtype: 4,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, dur, next) =>\n\t\t\tANIM_SET_VISIBLE(spid, next) +\n\t\t\tANIM_FLY_AXIS('in', 'x', spid, dur, next) +\n\t\t\tANIM_FLY_AXIS('in', 'y', spid, dur, next),\n\t},\n\tappear: {\n\t\tpresetID: 1,\n\t\tpresetClass: 'entr',\n\t\tpresetSubtype: 0,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, _dur, next) => ANIM_SET_VISIBLE(spid, next),\n\t},\n\twipe: {\n\t\tpresetID: 22,\n\t\tpresetClass: 'entr',\n\t\tpresetSubtype: 4,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, dur, next) => ANIM_SET_VISIBLE(spid, next) + ANIM_EFFECT('in', 'wipe(down)', spid, dur, next),\n\t},\n\tgrow: {\n\t\tpresetID: 6,\n\t\tpresetClass: 'emph',\n\t\tpresetSubtype: 0,\n\t\tdefaultDurationMs: 2000,\n\t\tbehaviors: (spid, dur, next) =>\n\t\t\tel('p:animScale', null, [\n\t\t\t\traw(\n\t\t\t\t\tel('p:cBhvr', null, [\n\t\t\t\t\t\traw(voidEl('p:cTn', { id: next(), dur, fill: 'hold' })),\n\t\t\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:by', { x: 150000, y: 150000 })),\n\t\t\t]),\n\t},\n\tspin: {\n\t\tpresetID: 8,\n\t\tpresetClass: 'emph',\n\t\tpresetSubtype: 0,\n\t\tdefaultDurationMs: 2000,\n\t\tbehaviors: (spid, dur, next) =>\n\t\t\tel('p:animRot', { by: 21600000 }, [\n\t\t\t\traw(\n\t\t\t\t\tel('p:cBhvr', null, [\n\t\t\t\t\t\traw(voidEl('p:cTn', { id: next(), dur, fill: 'hold' })),\n\t\t\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\t\t\traw(el('p:attrNameLst', null, raw(el('p:attrName', null, 'r')))),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t]),\n\t},\n\tfadeOut: {\n\t\tpresetID: 10,\n\t\tpresetClass: 'exit',\n\t\tpresetSubtype: 0,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, dur, next) => ANIM_FADE('out', spid, dur, next) + ANIM_SET_HIDDEN(spid, dur, next),\n\t},\n\tflyOut: {\n\t\tpresetID: 2,\n\t\tpresetClass: 'exit',\n\t\tpresetSubtype: 4,\n\t\tdefaultDurationMs: 500,\n\t\tbehaviors: (spid, dur, next) =>\n\t\t\tANIM_FLY_AXIS('out', 'x', spid, dur, next) +\n\t\t\tANIM_FLY_AXIS('out', 'y', spid, dur, next) +\n\t\t\tANIM_SET_HIDDEN(spid, dur, next),\n\t},\n}\n\nconst ANIM_NODE_TYPE: Record<string, string> = {\n\tonClick: 'clickEffect',\n\twithPrevious: 'withEffect',\n\tafterPrevious: 'afterEffect',\n}\n\ntype ResolvedAnimation = { anim: AnimationProps; spid: number }\n\n/**\n * Assemble the `mainSeq` from preset effects. Effects are grouped into click\n * steps: an `onClick` effect opens a new click group; `afterPrevious` opens a new\n * sub-step (delayed by the previous effect's duration) within it; `withPrevious`\n * joins the current sub-step. This reproduces PowerPoint's interactive build tree.\n */\nexport function buildAnimationSeq(animations: ResolvedAnimation[], next: () => number): string {\n\tinterface SubGroup {\n\t\tdelay: number\n\t\teffects: ResolvedAnimation[]\n\t}\n\tinterface ClickGroup {\n\t\tsubs: SubGroup[]\n\t}\n\tconst groups: ClickGroup[] = []\n\tlet prevDuration = 0\n\tfor (const entry of animations) {\n\t\tconst meta = ANIM_PRESETS[entry.anim.preset]\n\t\tif (!meta) continue\n\t\tconst trigger = entry.anim.trigger ?? 'onClick'\n\t\tconst duration = typeof entry.anim.durationMs === 'number' ? entry.anim.durationMs : meta.defaultDurationMs\n\t\tif (trigger === 'onClick' || groups.length === 0) {\n\t\t\tgroups.push({ subs: [{ delay: 0, effects: [entry] }] })\n\t\t} else if (trigger === 'afterPrevious') {\n\t\t\tgroups[groups.length - 1]?.subs.push({ delay: prevDuration, effects: [entry] })\n\t\t} else {\n\t\t\t// withPrevious — join the current sub-step\n\t\t\tconst subs = groups[groups.length - 1]?.subs\n\t\t\tconst lastSub = subs?.[subs.length - 1]\n\t\t\tif (lastSub) lastSub.effects.push(entry)\n\t\t}\n\t\tprevDuration = duration\n\t}\n\n\tconst emitEffect = (entry: ResolvedAnimation): string => {\n\t\tconst meta = ANIM_PRESETS[entry.anim.preset]\n\t\tif (!meta) return ''\n\t\tconst nodeType = ANIM_NODE_TYPE[entry.anim.trigger ?? 'onClick']\n\t\tconst duration = typeof entry.anim.durationMs === 'number' ? entry.anim.durationMs : meta.defaultDurationMs\n\t\tconst effectId = next()\n\t\tconst behaviors = meta.behaviors(entry.spid, duration, next)\n\t\treturn el(\n\t\t\t'p:par',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:cTn',\n\t\t\t\t\t{\n\t\t\t\t\t\tid: effectId,\n\t\t\t\t\t\tpresetID: meta.presetID,\n\t\t\t\t\t\tpresetClass: meta.presetClass,\n\t\t\t\t\t\tpresetSubtype: meta.presetSubtype,\n\t\t\t\t\t\tfill: 'hold',\n\t\t\t\t\t\tgrpId: 0,\n\t\t\t\t\t\tnodeType,\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: 0 })))),\n\t\t\t\t\t\traw(el('p:childTnLst', null, raw(behaviors))),\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t}\n\n\tconst emitSub = (sub: SubGroup): string => {\n\t\tconst subId = next()\n\t\tconst effects = sub.effects.map(emitEffect).join('')\n\t\treturn el(\n\t\t\t'p:par',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel('p:cTn', { id: subId, fill: 'hold' }, [\n\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: sub.delay })))),\n\t\t\t\t\traw(el('p:childTnLst', null, raw(effects))),\n\t\t\t\t])\n\t\t\t)\n\t\t)\n\t}\n\n\tconst emitGroup = (group: ClickGroup): string => {\n\t\tconst groupId = next()\n\t\tconst subs = group.subs.map(emitSub).join('')\n\t\treturn el(\n\t\t\t'p:par',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel('p:cTn', { id: groupId, fill: 'hold' }, [\n\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: 'indefinite' })))),\n\t\t\t\t\traw(el('p:childTnLst', null, raw(subs))),\n\t\t\t\t])\n\t\t\t)\n\t\t)\n\t}\n\n\tconst clickGroups = groups.map(emitGroup).join('')\n\treturn el('p:seq', { concurrent: 1, nextAc: 'seek' }, [\n\t\traw(\n\t\t\tel('p:cTn', { id: 2, dur: 'indefinite', nodeType: 'mainSeq' }, raw(el('p:childTnLst', null, raw(clickGroups))))\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:prevCondLst',\n\t\t\t\tnull,\n\t\t\t\traw(el('p:cond', { evt: 'onPrev', delay: 0 }, raw(el('p:tgtEl', null, raw(voidEl('p:sldTgt'))))))\n\t\t\t)\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:nextCondLst',\n\t\t\t\tnull,\n\t\t\t\traw(el('p:cond', { evt: 'onNext', delay: 0 }, raw(el('p:tgtEl', null, raw(voidEl('p:sldTgt'))))))\n\t\t\t)\n\t\t),\n\t])\n}\n\n/** One `<p:bldP>` per animated shape, in order of first appearance. */\nexport function buildBldList(animations: ResolvedAnimation[]): string {\n\tconst seen = new Set<number>()\n\tconst bldPs: string[] = []\n\tfor (const { spid } of animations) {\n\t\tif (seen.has(spid)) continue\n\t\tseen.add(spid)\n\t\tbldPs.push(voidEl('p:bldP', { spid, grpId: 0 }))\n\t}\n\treturn el('p:bldLst', null, raw(bldPs.join('')))\n}\n","/**\n * ts-pptx: slide `<p:timing>` tree\n *\n * Build the slide-level timing tree that drives looping embedded media and the\n * preset build-animation `mainSeq`. A slide has at most one `<p:timing>`; all\n * looping media and animation effects share its `tmRoot` node.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport type { AnimationProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideObject } from '../../types/internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { collectSlideShapeIds } from '../slide/shape-ids.js'\nimport { buildAnimationSeq, buildBldList, resolveAnimationSpid } from './animation.js'\n\n/**\n * Build the slide-level `<p:timing>` tree that makes embedded media loop.\n * - PowerPoint stores playback looping as `repeatCount` on the media node's `<p:cTn>`\n * (`indefinite` for \"Loop until Stopped\", or `N*1000` for a finite N plays), inside\n * the slide timing tree rather than on the `<p:pic>` itself.\n * - A slide has at most one `<p:timing>`; all looping media share its `tmRoot` node.\n * - Audio loops via `<p:audio>`, video via `<p:video>` (both `CT_TLCommonMediaNodeData`).\n * - The media node targets the picture by `spid` (its `<p:cNvPr>` id = slide-object index + 2).\n * @param {PresSlideInternal} slide - the slide to inspect for looping media\n * @returns {string} the `<p:timing>` XML, or `''` when no media loops\n */\nexport function slideTimingToXml(slide: PresSlideInternal): string {\n\tconst loopMedia = slide._slideObjects.filter(\n\t\t(obj) =>\n\t\t\tobj._type === SlideObjectType.media &&\n\t\t\tobj.mtype !== 'online' &&\n\t\t\ttypeof obj.mediaRid === 'number' &&\n\t\t\t(obj.loop === true || (typeof obj.loopCount === 'number' && obj.loopCount > 0))\n\t)\n\n\t// Resolve preset build animations to their target shape ids. `collectSlideShapeIds` covers group\n\t// children as well as top-level objects, so `objectName` addresses any shape on the slide.\n\tconst shapeIds = collectSlideShapeIds(slide._slideObjects)\n\tconst animations = (slide._animations ?? [])\n\t\t.map((anim) => ({ anim, spid: resolveAnimationSpid(shapeIds, slide._slideObjects.length, anim) }))\n\t\t.filter((entry): entry is { anim: AnimationProps; spid: number } => entry.spid !== null)\n\n\tconst mediaNode = (obj: SlideObject, nodeId: number): string => {\n\t\t// spid must equal the picture's <p:cNvPr> id, which is the slide-object index + 2\n\t\t// (same basis as animation spids). Using mediaRid + 2 here desyncs from the shape id\n\t\t// and targets the wrong/nonexistent shape => PowerPoint reports the file corrupt.\n\t\tconst spid = slide._slideObjects.indexOf(obj) + 2\n\t\tconst repeatCount = obj.loop === true ? 'indefinite' : String(Math.round((obj.loopCount as number) * 1000))\n\t\t// EG_TimeNodeChoice: audio loops via <p:audio>, video via <p:video> (both CT_TLCommonMediaNodeData)\n\t\tconst mediaTag = obj.mtype === 'audio' ? 'p:audio' : 'p:video'\n\t\treturn el(\n\t\t\tmediaTag,\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel('p:cMediaNode', null, [\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'p:cTn',\n\t\t\t\t\t\t\t{ id: nodeId, repeatCount, fill: 'hold', display: 0 },\n\t\t\t\t\t\t\traw(el('p:stCondLst', null, raw(voidEl('p:cond', { delay: 'indefinite' }))))\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\traw(el('p:tgtEl', null, raw(voidEl('p:spTgt', { spid })))),\n\t\t\t\t])\n\t\t\t)\n\t\t)\n\t}\n\n\t// Media-only path: unchanged legacy output (`<p:cTn id=\"1\">` tmRoot, media nodes follow).\n\tif (animations.length === 0) {\n\t\tif (loopMedia.length === 0) return ''\n\t\tlet nodeId = 1\n\t\tconst mediaNodes = loopMedia.map((obj) => mediaNode(obj, (nodeId += 1))).join('')\n\t\treturn el(\n\t\t\t'p:timing',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:tnLst',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'p:par',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t'p:cTn',\n\t\t\t\t\t\t\t\t\t{ id: 1, dur: 'indefinite', restart: 'never', nodeType: 'tmRoot' },\n\t\t\t\t\t\t\t\t\traw(el('p:childTnLst', null, raw(mediaNodes)))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t}\n\n\t// Animation path: a `mainSeq` of preset effects (plus any looping media as sibling nodes).\n\t// A monotonically increasing id is assigned to every `<p:cTn>` in document order, matching\n\t// how PowerPoint numbers the tree (tmRoot=1, mainSeq=2, then wrappers/effects/behaviors).\n\tlet id = 2 // tmRoot=1, mainSeq=2 are fixed\n\tconst next = (): number => (id += 1)\n\n\tconst seq = buildAnimationSeq(animations, next)\n\tconst mediaNodes = loopMedia.map((obj) => mediaNode(obj, next())).join('')\n\tconst bldLst = buildBldList(animations)\n\n\treturn el('p:timing', null, [\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:tnLst',\n\t\t\t\tnull,\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:par',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t'p:cTn',\n\t\t\t\t\t\t\t\t{ id: 1, dur: 'indefinite', restart: 'never', nodeType: 'tmRoot' },\n\t\t\t\t\t\t\t\traw(el('p:childTnLst', null, raw(seq + mediaNodes)))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\traw(bldLst),\n\t])\n}\n","/**\n * ts-pptx: slide-show transitions\n *\n * Build the `<p:transition>` tree (positioned in CT_Slide between `p:clrMapOvr`\n * and `p:timing`): the transition-type element, its optional sound action, and\n * the `mc:AlternateContent` envelope that carries an exact `p14:dur`.\n */\n\nimport type { TransitionProps } from '../../types/index.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\n\n/** Map a `ST_TransitionSpeed`-less exact duration (ms) to PowerPoint's coarse `spd` bucket. */\nfunction transitionSpeedForDuration(durationMs: number): 'slow' | 'med' | 'fast' {\n\tif (durationMs <= 500) return 'fast'\n\tif (durationMs <= 1000) return 'med'\n\treturn 'slow'\n}\n\n/**\n * Build the slide-show transition tree (`p:transition`), positioned in `CT_Slide`\n * between `p:clrMapOvr` and `p:timing`. Emits PowerPoint's `mc:AlternateContent`\n * form (a `p14` Choice carrying the exact `p14:dur`, plus a base `mc:Fallback`)\n * when `durationMs` is set, and the bare `<p:transition>` otherwise. See\n * `docs/animations-and-transitions.md`.\n * @returns {string} the transition XML, or `''` when the slide has no transition\n */\n/**\n * Build the `p:sndAc` sound-action child of `p:transition` (positioned after the\n * transition-type element). A start sound is `<p:stSnd [loop=\"1\"]><p:snd r:embed\n * name/></p:stSnd>` referencing the embedded WAV by the relationship id stamped on\n * `transition._sndRId`; the stop-previous form is `<p:endSnd/>` (no rel). Returns\n * `''` when the transition has no sound.\n */\nfunction transitionSoundToXml(transition: TransitionProps): string {\n\tconst sound = transition.sound\n\tif (!sound) return ''\n\tif (sound.stopPrevious) return el('p:sndAc', null, raw(voidEl('p:endSnd')))\n\tif (typeof transition._sndRId !== 'number') return '' // no embedded part registered\n\treturn el(\n\t\t'p:sndAc',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:stSnd',\n\t\t\t\t{ loop: sound.loop ? '1' : null },\n\t\t\t\traw(voidEl('p:snd', { 'r:embed': `rId${transition._sndRId}`, name: sound.name || null }))\n\t\t\t)\n\t\t)\n\t)\n}\n\nexport function slideTransitionToXml(slide: PresSlideInternal): string {\n\tconst transition = slide.transition\n\tif (!transition?.type) return ''\n\n\tconst typeEl = voidEl(`p:${transition.type}`, transition.variant ?? null)\n\tconst sndAc = transitionSoundToXml(transition)\n\n\tconst hasDuration = typeof transition.durationMs === 'number' && isFinite(transition.durationMs)\n\tconst speed = transition.speed ?? (hasDuration ? transitionSpeedForDuration(transition.durationMs as number) : null)\n\tconst baseAttrs: XmlAttrs = {\n\t\tspd: speed || null,\n\t\tadvClick: transition.advanceOnClick === false ? '0' : null,\n\t\tadvTm: typeof transition.advanceAfterMs === 'number' ? Math.round(transition.advanceAfterMs) : null,\n\t}\n\n\tif (!hasDuration) return el('p:transition', baseAttrs, [raw(typeEl), raw(sndAc)])\n\n\tconst dur = Math.round(transition.durationMs as number)\n\treturn el('mc:AlternateContent', { 'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006' }, [\n\t\traw(\n\t\t\tel(\n\t\t\t\t'mc:Choice',\n\t\t\t\t{ 'xmlns:p14': 'http://schemas.microsoft.com/office/powerpoint/2010/main', Requires: 'p14' },\n\t\t\t\traw(el('p:transition', { ...baseAttrs, 'p14:dur': dur }, [raw(typeEl), raw(sndAc)]))\n\t\t\t)\n\t\t),\n\t\traw(el('mc:Fallback', null, raw(el('p:transition', baseAttrs, [raw(typeEl), raw(sndAc)])))),\n\t])\n}\n","/**\n * ts-pptx: DrawingML object-lock serialization\n *\n * Emit the `a:spLocks` / `a:picLocks` / `a:graphicFrameLocks` / group-shape lock\n * elements. Each locking element type supports a different set of flags; the\n * `*_LOCK_ATTRS` tables list the valid attribute names in ECMA-376 emit order.\n */\n\nimport type { ObjectLockProps } from '../../types/index.js'\nimport { voidEl } from '../oxml/el.js'\nimport { warn } from '../../diagnostics.js'\n\n// Object lock attributes valid for each DrawingML locking element, in emit order (ECMA-376 §20.1.2.2.x / §20.1.2.2.34).\n// Object keys in `ObjectLockProps` mirror these attribute names 1:1, so serialization is a filtered lookup.\nexport const SHAPE_LOCK_ATTRS = [\n\t'noGrp',\n\t'noSelect',\n\t'noRot',\n\t'noChangeAspect',\n\t'noMove',\n\t'noResize',\n\t'noEditPoints',\n\t'noAdjustHandles',\n\t'noChangeArrowheads',\n\t'noChangeShapeType',\n\t'noTextEdit',\n] as const\nexport const PICTURE_LOCK_ATTRS = [\n\t'noGrp',\n\t'noSelect',\n\t'noRot',\n\t'noChangeAspect',\n\t'noMove',\n\t'noResize',\n\t'noEditPoints',\n\t'noAdjustHandles',\n\t'noChangeArrowheads',\n\t'noChangeShapeType',\n\t'noCrop',\n] as const\nexport const GRAPHIC_FRAME_LOCK_ATTRS = [\n\t'noGrp',\n\t'noDrilldown',\n\t'noSelect',\n\t'noChangeAspect',\n\t'noMove',\n\t'noResize',\n] as const\nexport const GROUP_SHAPE_LOCK_ATTRS = ['noGrp', 'noSelect', 'noRot', 'noChangeAspect', 'noMove', 'noResize'] as const\n\n/**\n * Serialize an object-lock element (`a:spLocks` / `a:picLocks` / `a:graphicFrameLocks`).\n * Only flags set to `true` AND valid for this element type are emitted; a flag set on an\n * unsupported element type is dropped with a warning (silent coercion is a footgun).\n * @param tag - locking element tag, e.g. `'a:spLocks'`\n * @param allowed - attribute names this element type supports, in desired emit order\n * @param locks - merged lock flags (callers fold any hard-coded default in first)\n * @param objectName - for the warning message\n * @returns the locking element string, or `''` when no applicable flag is set\n */\nexport function genXmlObjectLock(\n\ttag: string,\n\tallowed: readonly string[],\n\tlocks: ObjectLockProps | undefined,\n\tobjectName?: string\n): string {\n\tif (!locks) return ''\n\tconst lockMap = locks as Record<string, boolean | undefined>\n\tfor (const key of Object.keys(lockMap)) {\n\t\tif (lockMap[key] && !allowed.includes(key)) {\n\t\t\twarn(\n\t\t\t\t'object-lock/unsupported-on-shape',\n\t\t\t\t`objectLock.${key} is not supported on <${tag}> (object \"${objectName ?? ''}\") and was ignored.`\n\t\t\t)\n\t\t}\n\t}\n\tconst set = allowed.filter((name) => lockMap[name] === true)\n\treturn set.length > 0 ? voidEl(tag, Object.fromEntries(set.map((name) => [name, '1']))) : ''\n}\n","/**\n * ts-pptx: helpers shared by more than one slide-object renderer\n *\n * The `<p:cNvPr>` open tag, its `<a:hlinkClick>` children and the `<a:ln>` outline are each\n * emitted by several shape kinds. They live here — rather than in the dispatch module — so a\n * renderer never has to import from its own caller.\n */\n\nimport type { HyperlinkProps, ShapeLineProps } from '../../../types/index.js'\nimport { encodeXmlAttrValue } from '../../utils.js'\nimport { createLineCap, genXmlLineFill } from '../../drawingml/line.js'\nimport { lineWidthToEmu } from '../../../units-internal.js'\nimport { el, raw, voidEl } from '../../oxml/el.js'\n\n/** PowerPoint 2010 (`p14`) namespace — carries `<p14:modId>` and `<p14:media>`. */\nexport const P14_NS = 'http://schemas.microsoft.com/office/powerpoint/2010/main'\n/** Markup-compatibility namespace, declared by every `<mc:AlternateContent>` this module's callers emit. */\nexport const MC_NS = 'http://schemas.openxmlformats.org/markup-compatibility/2006'\n\n/**\n * The `<p:cNvPr>` OPEN tag shared by every shape renderer. Callers append `/>` or\n * `>`+children+`</p:cNvPr>` — the element is self-closing for some shape kinds and paired\n * (hyperlink / media-action children) for others.\n *\n * NOT built with the element builder, deliberately. `descr` is escaped here but `name` is **not**,\n * and that asymmetry is intentional and load-bearing: `objectName` is caller-supplied free text,\n * but every `add*Definition` (text.ts, shape.ts, image.ts, chart.ts, media.ts, connector.ts,\n * group.ts, table.ts) already runs it through `encodeXmlAttrValue(validateObjectName(...))` once\n * before it reaches a slide object's `options`. Escaping it again here would double-encode it\n * (`'Q&A'` -> `Q&A` upstream -> `Q&amp;A` if escaped here too). This helper exists so that\n * single escape stays one line in one place instead of eight call sites re-deriving it.\n * @param id - the shape's `<p:cNvPr>` id, unique slide-wide\n * @param name - caller-supplied `objectName`, already escaped once upstream (emitted as-is)\n * @param descr - alt text (escaped)\n * @param openPrefix - byte-significant indentation before `<p:cNvPr`\n * @returns the open tag, without its closing delimiter\n */\nexport function cNvPrOpen(id: number, name: string | undefined, descr: string, openPrefix = ''): string {\n\treturn `${openPrefix}<p:cNvPr id=\"${id}\" name=\"${name}\" descr=\"${encodeXmlAttrValue(descr)}\"`\n}\n\n/**\n * The `<a:hlinkClick>` children of a shape's `<p:cNvPr>` — a URL link and/or a jump to another\n * slide. Shared by the text and image renderers, which emitted identical copies.\n *\n * NOTE: the tooltip is passed through UNESCAPED and escaped once by the element builder. Escaping\n * it here as well would emit `&amp;` for a tooltip containing `&`.\n * @param link - the shape's hyperlink, if any\n * @returns zero, one or two `<a:hlinkClick>` elements\n */\nexport function cNvPrHyperlink(link: HyperlinkProps | undefined): string {\n\tif (!link) return ''\n\tconst tooltip = link.tooltip ?? ''\n\treturn (\n\t\t(link.url ? voidEl('a:hlinkClick', { 'r:id': `rId${link._rId}`, tooltip }) : '') +\n\t\t(link.slide\n\t\t\t? voidEl('a:hlinkClick', { 'r:id': `rId${link._rId}`, tooltip, action: 'ppaction://hlinksldjump' })\n\t\t\t: '') +\n\t\t// Action buttons: a self-contained slide-show navigation action. No relationship, so `r:id`\n\t\t// is emitted empty (schema-optional on CT_Hyperlink; matches PowerPoint's own output).\n\t\t(link.action\n\t\t\t? voidEl('a:hlinkClick', { 'r:id': '', tooltip, action: `ppaction://hlinkshowjump?jump=${link.action}` })\n\t\t\t: '')\n\t)\n}\n\n/**\n * A shape outline: `<a:ln>` with its fill, dash pattern and arrow ends.\n *\n * The text, connector and image renderers each carried a byte-identical copy of this block; they\n * now share one. Attribute and child order are byte-significant and preserved as written.\n *\n * FUTURE: arrow-size support via the `w`/`len` attrs on headEnd/tailEnd\n * (e.g. `<a:headEnd type=\"arrow\" w=\"lg\" len=\"lg\"/>`; each is 'sm'|'med'|'lg', a 3x3 grid)\n * @param ln - the shape's line properties\n * @returns the `<a:ln>` element\n */\nexport function genXmlShapeLine(ln: ShapeLineProps): string {\n\treturn el('a:ln', { w: ln.width ? lineWidthToEmu(ln.width) : null, cap: ln.cap ? createLineCap(ln.cap) : null }, [\n\t\traw(genXmlLineFill(ln)),\n\t\tln.dashType ? raw(voidEl('a:prstDash', { val: ln.dashType })) : null,\n\t\tln.beginArrowType ? raw(voidEl('a:headEnd', { type: ln.beginArrowType })) : null,\n\t\tln.endArrowType ? raw(voidEl('a:tailEnd', { type: ln.endArrowType })) : null,\n\t])\n}\n","/**\n * ts-pptx: DrawingML text body\n *\n * The container layer over `text-run.ts`: body properties (`<a:bodyPr>`), the\n * full `<p:txBody>`/`<a:txBody>` builder (`genXmlTextBody`), the native-equation\n * predicate, and the placeholder `<p:ph>` element.\n */\n\nimport { PlaceholderType, SlideObjectType } from '../../enums.js'\nimport { CRLF } from '../../constants-internal.js'\nimport type { ObjectOptions, TableCell, TextProps } from '../../types/index.js'\nimport type { SlideObject } from '../../types/internal.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\nimport {\n\tgenXmlNormAutofit,\n\tgenXmlParagraphProperties,\n\tgroupRunsIntoLines,\n\trenderTextParagraphsXml,\n\ttype RunProps,\n} from './text-run.js'\n\nconst PLACEHOLDER_TYPE_MAP = PlaceholderType as Record<string, string>\n\n/**\n * Builds `<a:bodyPr></a:bodyPr>` tag for \"genXmlTextBody()\"\n * @param {SlideObject | TableCell} slideObject - various options\n * @return {string} XML string\n */\nfunction genXmlBodyProperties(slideObject: SlideObject | TableCell): string {\n\t// A table cell always emits bare body properties, whatever else is configured. (This used to be\n\t// a ternary on the return, which built the full element first and then threw it away.)\n\tif (slideObject._type === SlideObjectType.tablecell) return voidEl('a:bodyPr')\n\n\t// Placeholders (incl. master/layout placeholders) carry their margin/valign in `_bodyProp` just\n\t// like text boxes, so they must emit the same configured `<a:bodyPr>` — otherwise a placeholder\n\t// authored with insets or a vertical anchor silently degrades to the default.\n\t// `_bodyProp`/`options` are optional on the type but present on text/placeholder objects that reach\n\t// this branch; bind them once so the body reads a narrowed, non-undefined value.\n\tconst options = (slideObject as SlideObject).options\n\tconst bodyProp = options?._bodyProp\n\tif (\n\t\t!slideObject ||\n\t\t(slideObject._type !== SlideObjectType.text && slideObject._type !== SlideObjectType.placeholder) ||\n\t\t!bodyProp\n\t) {\n\t\t// DEFAULT: paired, not self-closing — `<a:bodyPr .../>` would be a byte change.\n\t\treturn el('a:bodyPr', { wrap: 'square', rtlCol: '0' })\n\t}\n\n\t// PPT-2019 EX: <a:bodyPr wrap=\"square\" lIns=\"1270\" tIns=\"1270\" rIns=\"1270\" bIns=\"1270\" rtlCol=\"0\" anchor=\"ctr\"/>\n\t// NOTE: attribute ORDER is byte-significant; `rtlCol` sits after the margins and columns but\n\t// before the anchor points, which is why this is one ordered literal rather than grouped writes.\n\tconst attrs: XmlAttrs = {\n\t\t// A: Enable or disable textwrapping none or square\n\t\twrap: bodyProp.wrap ? 'square' : 'none',\n\t\t// B: Textbox margins [padding] — an explicit zero is meaningful, so test for it separately\n\t\tlIns: bodyProp.lIns || bodyProp.lIns === 0 ? bodyProp.lIns : null,\n\t\ttIns: bodyProp.tIns || bodyProp.tIns === 0 ? bodyProp.tIns : null,\n\t\trIns: bodyProp.rIns || bodyProp.rIns === 0 ? bodyProp.rIns : null,\n\t\tbIns: bodyProp.bIns || bodyProp.bIns === 0 ? bodyProp.bIns : null,\n\t\t// C.1: Text columns (numCol/spcCol). Spacing is only meaningful when there is more than one column.\n\t\tnumCol: bodyProp.numCol ? bodyProp.numCol : null,\n\t\tspcCol: bodyProp.spcCol ? bodyProp.spcCol : null,\n\t\t// C: Add rtl after margins\n\t\trtlCol: '0',\n\t\t// D: Add anchorPoints\n\t\tanchor: bodyProp.anchor ? bodyProp.anchor : null, // VALS: [t,ctr,b]\n\t\tvert: bodyProp.vert ? bodyProp.vert : null, // VALS: [eaVert,horz,mongolianVert,vert,vert270,wordArtVert,wordArtVertRtl]\n\t}\n\n\tconst children: string[] = []\n\n\t// E.1: Preset text warp (`<a:prstTxWarp>`). Per CT_TextBodyProperties this child\n\t// comes before the autofit group, so emit it immediately after the attributes.\n\t// NOTE: this `<a:avLst/>` has NO space before the slash, unlike the one `custGeom` writes.\n\tif (bodyProp.prstTxWarp) {\n\t\tchildren.push(el('a:prstTxWarp', { prst: bodyProp.prstTxWarp }, raw(voidEl('a:avLst'))))\n\t}\n\n\t/**\n\t * F: Text Fit/AutoFit/Shrink option\n\t * @see: http://officeopenxml.com/drwSp-text-bodyPr-fit.php\n\t * @see: http://www.datypic.com/sc/ooxml/g-a_EG_TextAutofit.html\n\t */\n\tif (options?.fit) {\n\t\tconst fit = options.fit\n\t\t// NOTE: Use of '<a:noAutofit/>' instead of '' causes issues in PPT-2013! ('none' emits nothing.)\n\t\t// NOTE: Bare shrink does not work automatically - PowerPoint calculates fontScale/lnSpcReduction dynamically upon edit/resize.\n\t\t// The object form bakes explicit values into the file (MS-PPT > Format shape > Text Options: \"Shrink text on overflow\").\n\t\tif (fit === 'shrink') children.push(voidEl('a:normAutofit'))\n\t\telse if (fit === 'resize') children.push(voidEl('a:spAutoFit'))\n\t\telse if (typeof fit === 'object' && fit.type === 'shrink') children.push(genXmlNormAutofit(fit))\n\t}\n\n\treturn el('a:bodyPr', attrs, children.map(raw))\n}\n\n/** Whether a slide object carries a native equation (`math` raw OMML) on any of its text items. */\nexport function objectHasMath(slideObj: SlideObject): boolean {\n\tconst text = slideObj.text as TextProps | TextProps[] | string | number | undefined\n\tif (Array.isArray(text)) return text.some((item) => item && typeof item === 'object' && !!item.math)\n\tif (text && typeof text === 'object') return !!text.math\n\treturn false\n}\n\n/**\n * Generate the XML for text and its options (bold, bullet, etc) including text runs (word-level formatting)\n * @param {SlideObject|TableCell} slideObj - slideObj or tableCell\n * @note PPT text lines [lines followed by line-breaks] are created using <p>-aragraph's\n * @note Bullets are a paragragh-level formatting device\n * @template\n * <p:txBody>\n * <a:bodyPr wrap=\"square\" rtlCol=\"0\">\n * <a:spAutoFit/>\n * </a:bodyPr>\n * <a:lstStyle/>\n * <a:p>\n * <a:pPr algn=\"ctr\"/>\n * <a:r>\n * <a:rPr lang=\"en-US\" dirty=\"0\" err=\"1\"/>\n * <a:t>textbox text</a:t>\n * </a:r>\n * <a:endParaRPr lang=\"en-US\" dirty=\"0\"/>\n * </a:p>\n * </p:txBody>\n * @returns XML containing the param object's text and formatting\n */\nexport function genXmlTextBody(slideObj: SlideObject | TableCell): string {\n\tconst opts: ObjectOptions = slideObj.options || {}\n\tlet tmpTextObjects: TextProps[] = []\n\tconst arrTextObjects: RunProps[] = []\n\n\t// FIRST: Shapes without text reach this point with `slideObj.text` null/undefined.\n\t// We MUST still emit a `<p:txBody>` with at least an empty `<a:p>` paragraph;\n\t// the empty-txBody fallback below appends `<a:p><a:endParaRPr/></a:p>` when no\n\t// `<a:p>` was produced. Returning early here would emit `<p:sp>` without\n\t// `<p:txBody>`, which PowerPoint reports as a needs-repair error.\n\n\t// STEP 1: Accumulate the body's children; the `<p:txBody>`/`<a:txBody>` wrapper closes over\n\t// them in STEP 7.\n\tlet strSlideXml = ''\n\n\t// STEP 2: Add bodyProperties\n\t{\n\t\t// A: 'bodyPr'\n\t\tstrSlideXml += genXmlBodyProperties(slideObj)\n\n\t\t// B: 'lstStyle'\n\t\t// NOTE: shape type 'LINE' has different text align needs (a lstStyle.lvl1pPr between bodyPr and p)\n\t\t// KNOWN LIMITATION: horizontal align on a LINE does not work — text is always left-aligned inside the line.\n\t\tif (opts.h === 0 && opts.line && opts.align)\n\t\t\tstrSlideXml += el('a:lstStyle', null, raw(voidEl('a:lvl1pPr', { algn: 'l' })))\n\t\telse if (slideObj._type === SlideObjectType.placeholder)\n\t\t\tstrSlideXml += el('a:lstStyle', null, raw(genXmlParagraphProperties(slideObj, true)))\n\t\telse strSlideXml += voidEl('a:lstStyle')\n\t}\n\n\t/* STEP 3: Modify slideObj.text to array\n\t\tCASES:\n\t\taddText( 'string' ) // string\n\t\taddText( 'line1\\n line2' ) // string with lineBreak\n\t\taddText( {text:'word1'} ) // TextProps object\n\t\taddText( ['barry','allen'] ) // array of strings\n\t\taddText( [{text:'word1'}, {text:'word2'}] ) // TextProps object array\n\t\taddText( [{text:'line1\\n line2'}, {text:'end word'}] ) // TextProps object array with lineBreak\n\t*/\n\tif (typeof slideObj.text === 'string' || typeof slideObj.text === 'number') {\n\t\t// Handle cases 1,2\n\t\ttmpTextObjects.push({ text: slideObj.text.toString(), options: opts || {} })\n\t} else if (\n\t\tslideObj.text &&\n\t\t!Array.isArray(slideObj.text) &&\n\t\ttypeof slideObj.text === 'object' &&\n\t\tObject.keys(slideObj.text).includes('text')\n\t) {\n\t\t// Handle case 3\n\t\ttmpTextObjects.push({\n\t\t\ttext: slideObj.text || '',\n\t\t\toptions: slideObj.options || {},\n\t\t\tmath: (slideObj.text as TextProps).math,\n\t\t\tinline: (slideObj.text as TextProps).inline,\n\t\t})\n\t} else if (Array.isArray(slideObj.text)) {\n\t\t// Handle cases 4,5,6\n\t\t// NOTE: use cast as text is TextProps[]|TableCell[] and their `options` dont overlap (they share the same TextBaseProps though)\n\t\t// `math` carries raw OMML for native equation paragraphs — preserved here so STEP 5/6 can isolate it.\n\t\ttmpTextObjects = (slideObj.text as TextProps[]).map((item) => ({\n\t\t\ttext: item.text,\n\t\t\toptions: item.options,\n\t\t\tmath: item.math,\n\t\t\tinline: item.inline,\n\t\t}))\n\t}\n\n\t// STEP 4: Iterate over text objects, set text/options, break into pieces if '\\n'/breakLine found\n\ttmpTextObjects.forEach((itext, idx) => {\n\t\tif (!itext.text) itext.text = ''\n\n\t\t// A: Set options\n\t\titext.options = itext.options || opts || {}\n\t\tif (idx === 0 && itext.options && !itext.options.bullet && opts.bullet) itext.options.bullet = opts.bullet\n\n\t\t// B: Cast to text-object and fix line-breaks (if needed)\n\t\tif (typeof itext.text === 'string' || typeof itext.text === 'number') {\n\t\t\t// 1: Convert \"\\n\" or any variation into CRLF\n\t\t\titext.text = itext.text.toString().replace(/\\r*\\n/g, CRLF)\n\t\t}\n\n\t\t// C: If text string has line-breaks, then create a separate text-object for each (much easier than dealing with split inside a loop below)\n\t\t// NOTE: Filter for trailing lineBreak prevents the creation of an empty textObj as the last item\n\t\tif (itext.text.includes(CRLF) && itext.text.match(/\\n$/g) === null) {\n\t\t\tconst lines = itext.text.split(CRLF)\n\t\t\tlines.forEach((line, lineIdx) => {\n\t\t\t\tconst isLast = lineIdx === lines.length - 1\n\t\t\t\t// Non-last pieces need a paragraph break after them (the \\n implies it).\n\t\t\t\t// The last piece inherits the caller's breakLine intent — do not mutate the original options object.\n\t\t\t\tarrTextObjects.push({\n\t\t\t\t\ttext: line,\n\t\t\t\t\toptions: { ...itext.options, breakLine: isLast ? itext.options?.breakLine : true },\n\t\t\t\t})\n\t\t\t})\n\t\t} else {\n\t\t\tarrTextObjects.push({ ...itext, options: itext.options ?? {} })\n\t\t}\n\t})\n\n\t// STEP 5: Group textObj into lines by checking for lineBreak, bullets, alignment change, etc.\n\tconst arrLines = groupRunsIntoLines(arrTextObjects, opts)\n\n\t// STEP 6: Loop over each line and create paragraph props, text run, etc.\n\tstrSlideXml += renderTextParagraphsXml(arrLines, slideObj, opts)\n\n\t// IMPORTANT: An empty txBody will cause \"needs repair\" error! Add <p> content if missing.\n\t// This fixes an issue with table auto-paging where some cells would be empty on subsequent pages.\n\t/*\n\t\t<a:txBody>\n\t\t\t<a:bodyPr/>\n\t\t\t<a:lstStyle/>\n\t\t</a:txBody>\n\t*/\n\t// NOTE: this scans the accumulated CHILDREN, which no longer include the opening `<p:txBody>`.\n\t// That does not change the result: neither `<a:bodyPr>` nor `<a:lstStyle>` can contain the\n\t// exact substring `<a:p>` (`<a:pPr`/`<a:lvl1pPr` do not match), so only real paragraphs do.\n\tif (!strSlideXml.includes('<a:p>')) {\n\t\tstrSlideXml += el('a:p', null, raw(voidEl('a:endParaRPr')))\n\t}\n\n\t// STEP 7: Close the textBody\n\t// LAST: Return XML\n\treturn el(slideObj._type === SlideObjectType.tablecell ? 'a:txBody' : 'p:txBody', null, raw(strSlideXml))\n}\n\n/**\n * Generate an XML Placeholder\n * @param {SlideObject} placeholderObj\n * @returns XML\n */\nexport function genXmlPlaceholder(placeholderObj: SlideObject | null): string {\n\tif (!placeholderObj) return ''\n\n\tconst placeholderIdx = placeholderObj.options?._placeholderIdx ? placeholderObj.options._placeholderIdx : ''\n\tconst placeholderTyp = placeholderObj.options?._placeholderType ? placeholderObj.options._placeholderType : ''\n\t// Normalize to the OOXML ST_PlaceholderType value, accepting either a friendly PlaceholderType\n\t// key ('image', 'table') or the mapped value ('pic', 'tbl') - the latter is what `PLACEHOLDER_TYPE`\n\t// actually declares. Unknown strings emit no type rather than an invalid attribute.\n\tconst placeholderType = PLACEHOLDER_TYPE_MAP[placeholderTyp]\n\t\t? PLACEHOLDER_TYPE_MAP[placeholderTyp].toString()\n\t\t: (Object.values(PlaceholderType) as string[]).includes(placeholderTyp)\n\t\t\t? placeholderTyp\n\t\t\t: ''\n\n\t// `hasCustomPrompt` flags a placeholder *definition* (layout/master) that carries custom\n\t// prompt text; it must not be set on a populated slide-level text shape promoted to a\n\t// placeholder, or PowerPoint would treat the visible text as prompt text.\n\tconst isPlaceholderDef = placeholderObj._type === SlideObjectType.placeholder\n\n\t// NOTE: `placeholderType` is already the mapped OOXML value (e.g. 'pic', 'tbl') validated on\n\t// the line above; do NOT re-look it up in PLACEHOLDER_TYPE_MAP (its keys are the input names,\n\t// not the mapped values), or the type attribute is silently dropped for image/table placeholders.\n\t//\n\t// NOT built with the element builder, deliberately. This template's own source indentation\n\t// reaches the file: attributes are separated by a newline + two tabs, each carries an extra\n\t// leading space, and an ABSENT attribute still emits its separator — so the whitespace depends\n\t// on which attributes are missing. `voidEl` joins attributes with exactly one space and omits\n\t// absent ones entirely, so this layout is not expressible. 105 baseline parts carry `<p:ph`,\n\t// so tidying it is a visible byte change and belongs in its own fixture-gated commit.\n\treturn `<p:ph\n\t\t${placeholderIdx ? ' idx=\"' + placeholderIdx.toString() + '\"' : ''}\n\t\t${placeholderType ? ` type=\"${placeholderType}\"` : ''}\n\t\t${isPlaceholderDef && placeholderObj.text && placeholderObj.text.length > 0 ? ' hasCustomPrompt=\"1\"' : ''}\n\t\t/>`\n}\n","/**\n * ts-pptx: chart slide-object serialization\n *\n * Emits a `chart` slide object as the `<p:graphicFrame>` that references the chart part.\n * Classic charts emit that frame bare; chartEx charts wrap it in `<mc:AlternateContent>` with a\n * plain-shape `<mc:Fallback>` for consumers older than PowerPoint 2016.\n */\n\nimport { ChartType, isChartExType } from '../../../enums.js'\nimport type { ObjectOptions } from '../../../types/index.js'\nimport type { SlideObject } from '../../../types/internal.js'\nimport { genXmlPlaceholder } from '../../drawingml/text-body.js'\nimport { el, raw, voidEl } from '../../oxml/el.js'\nimport { cNvPrOpen, MC_NS } from './shared.js'\nimport { OOXML_NS } from '../../../ooxml/namespaces.js'\n\n/**\n * chartEx feature-version namespace declared on `<mc:Choice Requires>`. Each 2016 chart wave\n * introduced a feature level a consumer must \"understand\" to render the chart; a consumer that\n * doesn't falls through to `<mc:Fallback>`. Keyed by `ChartType`.\n */\nconst CHARTEX_FEATURE_NS: Partial<Record<ChartType, { prefix: string; uri: string }>> = {\n\t[ChartType.waterfall]: { prefix: 'cx1', uri: 'http://schemas.microsoft.com/office/drawing/2015/9/8/chartex' },\n\t[ChartType.funnel]: { prefix: 'cx2', uri: 'http://schemas.microsoft.com/office/drawing/2015/10/21/chartex' },\n\t[ChartType.regionMap]: { prefix: 'cx4', uri: 'http://schemas.microsoft.com/office/drawing/2016/5/10/chartex' },\n}\n\n/**\n * Render a `chart` slide object to its `<p:graphicFrame>` XML referencing the chart part.\n *\n * Classic charts emit a bare `<p:graphicFrame>` pointing at a `<c:chart>`. chartEx charts\n * (waterfall, …) instead wrap that graphicFrame in `<mc:AlternateContent>`: an `<mc:Choice>`\n * carrying the `<cx:chart>` reference (rendered by PowerPoint 2016+/Microsoft 365) and an\n * `<mc:Fallback>` placeholder shape shown by every other consumer.\n */\nexport function renderChartObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\tplaceholderObj: SlideObject | null,\n\titemOpts: ObjectOptions\n): string {\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\t// A chart's options are really `ChartOptsInternal`; `_type` is not on the broad `ObjectOptions`.\n\tconst chartType = (itemOpts as { _type?: ChartType })._type\n\tconst isChartEx = isChartExType(chartType)\n\n\tconst graphicDataUri = isChartEx ? OOXML_NS.cx : OOXML_NS.c\n\tconst chartChild = isChartEx\n\t\t? voidEl('cx:chart', { 'xmlns:cx': OOXML_NS.cx, 'r:id': `rId${slideItemObj.chartRid}` }, { openPrefix: ' ' })\n\t\t: voidEl('c:chart', { 'r:id': `rId${slideItemObj.chartRid}`, 'xmlns:c': OOXML_NS.c }, { openPrefix: ' ' })\n\n\tconst graphicFrame = el('p:graphicFrame', null, [\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:nvGraphicFramePr',\n\t\t\t\tnull,\n\t\t\t\t[\n\t\t\t\t\traw(cNvPrOpen(idx + 2, itemOpts.objectName, itemOpts.altText || '', ' ') + '/>'),\n\t\t\t\t\traw(voidEl('p:cNvGraphicFramePr', null, { openPrefix: ' ' })),\n\t\t\t\t\traw(el('p:nvPr', null, raw(genXmlPlaceholder(placeholderObj)), { openPrefix: ' ' })),\n\t\t\t\t],\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\traw(el('p:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))], { openPrefix: ' ' })),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'a:graphic',\n\t\t\t\t{ 'xmlns:a': OOXML_NS.a },\n\t\t\t\traw(el('a:graphicData', { uri: graphicDataUri }, raw(chartChild), { openPrefix: ' ', closePrefix: ' ' })),\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t])\n\n\tif (!isChartEx) return graphicFrame\n\n\t// chartEx: wrap the graphicFrame in <mc:AlternateContent>. The Choice declares the feature-level\n\t// namespace it Requires; the Fallback is a plain shape so non-2016 consumers show something.\n\tconst feature = (chartType && CHARTEX_FEATURE_NS[chartType]) ?? CHARTEX_FEATURE_NS[ChartType.waterfall]\n\tconst choice = el(\n\t\t'mc:Choice',\n\t\t{ [`xmlns:${feature?.prefix ?? 'cx1'}`]: feature?.uri, Requires: feature?.prefix ?? 'cx1' },\n\t\traw(graphicFrame)\n\t)\n\tconst fallback = el('mc:Fallback', null, raw(renderChartExFallback(idx, itemOpts, x, y, cx, cy)))\n\treturn el('mc:AlternateContent', { 'xmlns:mc': MC_NS }, [raw(choice), raw(fallback)])\n}\n\n/**\n * Build the `<mc:Fallback>` placeholder shape shown when a chartEx chart cannot be rendered\n * (any consumer older than PowerPoint 2016 / Microsoft 365). A light-grey rectangle at the chart's\n * position carrying a short explanatory note — enough that the slide reads sensibly rather than\n * showing a void where the chart would be.\n */\nfunction renderChartExFallback(\n\tidx: number,\n\titemOpts: ObjectOptions,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number\n): string {\n\treturn el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(cNvPrOpen(idx + 2, itemOpts.objectName, itemOpts.altText || '') + '/>'),\n\t\t\t\traw(voidEl('p:cNvSpPr')),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:spPr', null, [\n\t\t\t\traw(el('a:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:srgbClr', { val: 'F2F2F2' })))),\n\t\t\t\traw(el('a:ln', null, raw(el('a:solidFill', null, raw(voidEl('a:srgbClr', { val: 'BFBFBF' })))))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(voidEl('a:bodyPr')),\n\t\t\t\traw(voidEl('a:lstStyle')),\n\t\t\t\traw(\n\t\t\t\t\tel('a:p', null, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('a:r', null, [\n\t\t\t\t\t\t\t\traw(voidEl('a:rPr', { lang: 'en-US' })),\n\t\t\t\t\t\t\t\traw(el('a:t', null, 'This chart requires PowerPoint 2016 or newer to display.')),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n}\n","/**\n * ts-pptx: connector slide-object serialization\n *\n * Emits a `connector` slide object as a `<p:cxnSp>`. The start/end shape bindings resolve a\n * caller-supplied `objectName` to the target's slide-wide `<p:cNvPr>` id; an unresolved name\n * falls back to the static endpoint geometry rather than emitting a dangling id.\n */\n\nimport type { SlideObject } from '../../../types/internal.js'\nimport { warn } from '../../../diagnostics.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../../oxml/el.js'\nimport { resolveObjectNameToId } from '../shape-ids.js'\nimport { cNvPrOpen, genXmlShapeLine } from './shared.js'\nimport type { ObjectOptions } from '../../../types/index.js'\n\n/**\n * Render a `connector` slide object to its `<p:cxnSp>` XML (start/end shape bindings via shapeIds).\n */\nexport function renderConnectorObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\tlocationAttrs: XmlAttrs,\n\tshapeIds: Map<SlideObject, number>,\n\titemOpts: ObjectOptions\n): string {\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\tlet strSlideXml = ''\n\t// A connector is emitted as <p:cxnSp> (a connector shape) rather than <p:sp>, so\n\t// PowerPoint treats it as a connector. Geometry/flip come from the shared resolution\n\t// above; the preset (straightConnector1 / bentConnector3 / curvedConnector3) is on `shape`.\n\tstrSlideXml += '<p:cxnSp><p:nvCxnSpPr>'\n\tstrSlideXml += cNvPrOpen(idx + 2, itemOpts.objectName, itemOpts.altText || '') + '/>'\n\t{\n\t\t// Shape binding: resolve each bound target's objectName to its cNvPr id and emit\n\t\t// <a:stCxn>/<a:endCxn> in schema order. Resolution goes through `shapeIds`, so a shape\n\t\t// inside a group binds like any other (it is cNvPr-named on this slide); the old\n\t\t// `_slideObjects`-only lookup missed those and warned that the shape did not exist.\n\t\t// An unresolved name falls back to the static endpoint geometry (warn, don't corrupt)\n\t\t// rather than a dangling id.\n\t\tconst cxnTag = (binding: { name: string; idx: number } | undefined, tag: 'a:stCxn' | 'a:endCxn'): string => {\n\t\t\tif (!binding) return ''\n\t\t\tconst id = resolveObjectNameToId(shapeIds, binding.name)\n\t\t\tif (id === null) {\n\t\t\t\twarn(\n\t\t\t\t\t'connector/unresolved-binding',\n\t\t\t\t\t`addConnector could not bind to shape \"${binding.name}\" (no object with that objectName on the slide); using endpoint coordinates instead.`\n\t\t\t\t)\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn `<${tag} id=\"${id}\" idx=\"${binding.idx}\"/>`\n\t\t}\n\t\tconst cxnSpPr = cxnTag(itemOpts._startCxn, 'a:stCxn') + cxnTag(itemOpts._endCxn, 'a:endCxn')\n\t\tstrSlideXml += cxnSpPr ? `<p:cNvCxnSpPr>${cxnSpPr}</p:cNvCxnSpPr>` : '<p:cNvCxnSpPr/>'\n\t}\n\tstrSlideXml += '<p:nvPr/></p:nvCxnSpPr><p:spPr>'\n\tstrSlideXml += el('a:xfrm', locationAttrs, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])\n\t{\n\t\t// Bent/curved connectors carry adjustable jogs as `<a:gd name=\"adjN\" fmla=\"val …\"/>`\n\t\t// (1000ths-of-a-percent). With none, the empty `<a:avLst/>` leaves the preset default (50%).\n\t\tconst adj = itemOpts._connectorAdj || []\n\t\tconst avLst = adj.map((val, i) => voidEl('a:gd', { name: `adj${i + 1}`, fmla: `val ${val}` })).join('')\n\t\tstrSlideXml += el('a:prstGeom', { prst: slideItemObj.shape }, raw(el('a:avLst', null, raw(avLst))))\n\t}\n\tstrSlideXml += genXmlShapeLine(itemOpts.line || {})\n\tstrSlideXml += '</p:spPr></p:cxnSp>'\n\treturn strSlideXml\n}\n","/**\n * ts-pptx: DrawingML image sizing & cropping\n *\n * Build the `<a:srcRect>` (+ `<a:stretch>`) blipFill children for the image\n * sizing modes (`cover` / `contain` / `crop` / `stretch`), for the implicit\n * aspect-correct placement a vector source gets, and for explicit percentage crops.\n */\n\nimport { fitSrcRectPercents } from '../../media/image-size.js'\nimport { FIXED_PCT_PER_PERCENT } from '../../units.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/** Every `<a:srcRect>` below is followed by this same fill directive. */\nconst STRETCH = el('a:stretch', null, raw(voidEl('a:fillRect')))\n\n/** The `<a:srcRect>` fitting `imgSize` into `boxDim`, followed by the fill directive. */\nfunction fitSrcRect(\n\ttype: 'cover' | 'contain',\n\timgSize: { w: number; h: number },\n\tboxDim: { w: number; h: number }\n): string {\n\tconst { l, r, t, b } = fitSrcRectPercents(type, imgSize, boxDim)\n\treturn voidEl('a:srcRect', { l, r, t, b }) + STRETCH\n}\n\nexport const ImageSizingXml = {\n\tcover: function (imgSize: { w: number; h: number }, boxDim: { w: number; h: number; x: number; y: number }) {\n\t\treturn fitSrcRect('cover', imgSize, boxDim)\n\t},\n\tcontain: function (imgSize: { w: number; h: number }, boxDim: { w: number; h: number; x: number; y: number }) {\n\t\treturn fitSrcRect('contain', imgSize, boxDim)\n\t},\n\t/** No source rectangle at all: the image fills the box, aspect ratio be damned. */\n\tstretch: function () {\n\t\treturn STRETCH\n\t},\n\tcrop: function (imgSize: { w: number; h: number }, boxDim: { w: number; h: number; x: number; y: number }) {\n\t\tconst l = boxDim.x\n\t\tconst r = imgSize.w - (boxDim.x + boxDim.w)\n\t\tconst t = boxDim.y\n\t\tconst b = imgSize.h - (boxDim.y + boxDim.h)\n\t\tif (l < 0 || r < 0 || t < 0 || b < 0) {\n\t\t\tconst over = [\n\t\t\t\tl < 0 && `x (${l < 0 ? -l : 0} past left edge)`,\n\t\t\t\tr < 0 && `x+w (${-r} past right edge)`,\n\t\t\t\tt < 0 && `y (${-t} past top edge)`,\n\t\t\t\tb < 0 && `y+h (${-b} past bottom edge)`,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(', ')\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'image/crop-window-overflows',\n\t\t\t\t`addImage sizing.type 'crop': crop window overflows image bounds — ${over}. Ensure x≥0, y≥0, x+w≤w, y+h≤h.`\n\t\t\t)\n\t\t}\n\t\tconst lPerc = Math.round(1e5 * (l / imgSize.w))\n\t\tconst rPerc = Math.round(1e5 * (r / imgSize.w))\n\t\tconst tPerc = Math.round(1e5 * (t / imgSize.h))\n\t\tconst bPerc = Math.round(1e5 * (b / imgSize.h))\n\t\treturn voidEl('a:srcRect', { l: lPerc, r: rPerc, t: tPerc, b: bPerc }) + STRETCH\n\t},\n}\n\n/**\n * The blipFill children for a vector source the caller gave no `sizing` for: letterbox it to its\n * own aspect ratio inside its frame, the way `sizing: 'contain'` would — an SVG carries an\n * intrinsic ratio, and stretching a glyph into a box that disagrees with it is never the intent.\n *\n * Returns `null` when the two ratios already agree, which is the overwhelmingly common case (a\n * square icon in a square box). The caller then emits the plain `<a:stretch>` it always did, so\n * this default costs nothing — neither bytes nor a behaviour change — until it actually differs.\n * @param imgSize - the vector's intrinsic size (viewBox or width/height)\n * @param boxDim - the picture's displayed frame\n * @returns the `<a:srcRect>` + `<a:stretch>` children, or `null` if no letterboxing is needed\n */\nexport function genXmlVectorAspectFit(\n\timgSize: { w: number; h: number },\n\tboxDim: { w: number; h: number }\n): string | null {\n\tconst { l, r, t, b } = fitSrcRectPercents('contain', imgSize, boxDim)\n\tif (l === 0 && r === 0 && t === 0 && b === 0) return null\n\treturn fitSrcRect('contain', imgSize, boxDim)\n}\n\n/**\n * Build an explicit `<a:srcRect>` crop from percentage edge insets (0–100), emitted verbatim.\n * Each inset is the percent of the *source* image trimmed from that edge; values serialize in\n * 1000ths of a percent (DrawingML `ST_Percentage`, where 100% = 100000). Unlike `sizing: 'crop'`\n * — which derives the rect from displayed inches and the natural pixel size — this maps a\n * sub-region of the source directly, so it works for SVG and other unmeasurable formats.\n * @param crop - edge insets in percent; omitted edges default to 0\n * @param objectName - for error messages\n * @returns the `<a:srcRect>` + `<a:stretch>` blipFill children\n */\nexport function genXmlImageCrop(crop: { l?: number; t?: number; r?: number; b?: number }, objectName?: string): string {\n\tconst where = objectName ? ` for image \"${objectName}\"` : ''\n\tconst edges = { l: crop.l ?? 0, t: crop.t ?? 0, r: crop.r ?? 0, b: crop.b ?? 0 }\n\tfor (const [name, val] of Object.entries(edges)) {\n\t\tif (typeof val !== 'number' || !isFinite(val) || val < 0 || val > 100) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'image/crop-inset-out-of-range',\n\t\t\t\t`addImage crop.${name} must be a percentage between 0 and 100 (got ${String(val)})${where}.`\n\t\t\t)\n\t\t}\n\t}\n\tif (edges.l + edges.r >= 100)\n\t\tthrow new InvalidOptionError(\n\t\t\t'image/crop-insets-exceed-extent',\n\t\t\t`addImage crop: left+right insets (${edges.l}%+${edges.r}%) must be < 100%${where}.`\n\t\t)\n\tif (edges.t + edges.b >= 100)\n\t\tthrow new InvalidOptionError(\n\t\t\t'image/crop-insets-exceed-extent',\n\t\t\t`addImage crop: top+bottom insets (${edges.t}%+${edges.b}%) must be < 100%${where}.`\n\t\t)\n\tconst v = (perc: number): number => Math.round(perc * FIXED_PCT_PER_PERCENT)\n\t// NOTE: attribute order here is l/t/r/b, where the sizing modes above emit l/r/t/b. Attribute\n\t// order is byte-significant, so the two orderings are kept as they are rather than unified.\n\treturn voidEl('a:srcRect', { l: v(edges.l), t: v(edges.t), r: v(edges.r), b: v(edges.b) }) + STRETCH\n}\n","/**\n * ts-pptx: image slide-object serialization\n *\n * Emits an `image` slide object as a `<p:pic>`: the blip and its image effects (transparency,\n * duotone, colour change, grayscale, bi-level), the crop or `sizing` source rectangle, the\n * clipping geometry, outline and shadow. An omitted dimension is backfilled from the embedded\n * bytes' natural pixel ratio, which only becomes available once `_relsMedia` is populated.\n */\n\nimport type { ObjectOptions } from '../../../types/index.js'\nimport { DEF_TEXT_SHADOW } from '../../../constants-internal.js'\nimport type { PresSlideInternal, SlideLayoutInternal, SlideObject } from '../../../types/internal.js'\nimport { createColorElement } from '../../drawingml/color.js'\nimport { createShadowEffectLst } from '../../drawingml/effect.js'\nimport { genXmlCustGeom, genXmlPresetGeom } from '../../drawingml/geometry.js'\nimport { genXmlImageCrop, genXmlVectorAspectFit, ImageSizingXml } from '../../drawingml/image.js'\nimport { genXmlObjectLock, PICTURE_LOCK_ATTRS } from '../../drawingml/locks.js'\nimport { genXmlPlaceholder } from '../../drawingml/text-body.js'\nimport { getImageSizeFromBase64 } from '../../../media/image-size.js'\nimport { el, raw, voidEl, type XmlAttrs, type XmlChild } from '../../oxml/el.js'\nimport { getSmartParseNumber } from '../../../units-internal.js'\nimport { FIXED_PCT_PER_PERCENT, PERCENT_SCALE, pixelsToEmu } from '../../../units.js'\nimport { warn } from '../../../diagnostics.js'\nimport { cNvPrHyperlink, cNvPrOpen, genXmlShapeLine } from './shared.js'\n\n/**\n * Render an `image` slide object to its `<p:pic>` XML (sizing/crop, rounding, hyperlink, shadow).\n */\nexport function renderImageObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tslide: PresSlideInternal | SlideLayoutInternal,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\timgWidth: number,\n\timgHeight: number,\n\tplaceholderObj: SlideObject | null,\n\tlocationAttrs: XmlAttrs,\n\tsizing: ObjectOptions['sizing'],\n\trounding: ObjectOptions['rounding'],\n\titemOpts: ObjectOptions\n): string {\n\tlet strSlideXml = ''\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\t// The media bytes this picture points at. Not available synchronously in `addImage()`, but\n\t// populated by now — which is why every question that needs the image itself (its natural\n\t// size, whether it is a vector) is answered here rather than at definition time.\n\tconst mediaRel = (slide._relsMedia || []).find((rel) => rel.rId === slideItemObj.imageRid)\n\tconst relData = mediaRel?.data\n\tconst naturalSize = (): { w: number; h: number } | null =>\n\t\ttypeof relData === 'string' ? getImageSizeFromBase64(relData) : null\n\t// Backfill any omitted dimension of a path-based image from its natural pixel ratio.\n\t// PowerPoint inserts images at 96 DPI, so natural pixels / 96 * EMU == display EMU.\n\tif (itemOpts._szAuto) {\n\t\tconst szAuto = itemOpts._szAuto\n\t\tconst natural = naturalSize()\n\t\tif (natural) {\n\t\t\tif (szAuto.w && szAuto.h) {\n\t\t\t\tcx = pixelsToEmu(natural.w, 96)\n\t\t\t\tcy = pixelsToEmu(natural.h, 96)\n\t\t\t} else if (szAuto.h) {\n\t\t\t\t// Width supplied, derive height\n\t\t\t\tcy = Math.round(cx * (natural.h / natural.w))\n\t\t\t} else if (szAuto.w) {\n\t\t\t\t// Height supplied, derive width\n\t\t\t\tcx = Math.round(cy * (natural.w / natural.h))\n\t\t\t}\n\t\t\timgWidth = cx\n\t\t\timgHeight = cy\n\t\t}\n\t}\n\tconst imgOpts = itemOpts\n\tconst imgLink = slideItemObj.hyperlink\n\tstrSlideXml += '<p:pic>'\n\tstrSlideXml += ' <p:nvPicPr>'\n\tstrSlideXml +=\n\t\tcNvPrOpen(idx + 2, imgOpts.objectName, imgOpts.altText || slideItemObj.image || '') + '>' + cNvPrHyperlink(imgLink)\n\tstrSlideXml += ' </p:cNvPr>'\n\t// Default to locking aspect ratio (PowerPoint's own behavior); user `objectLock` overrides any flag, incl. noChangeAspect.\n\tstrSlideXml += el(\n\t\t'p:cNvPicPr',\n\t\tnull,\n\t\traw(\n\t\t\tgenXmlObjectLock(\n\t\t\t\t'a:picLocks',\n\t\t\t\tPICTURE_LOCK_ATTRS,\n\t\t\t\t{ noChangeAspect: true, ...imgOpts.objectLock },\n\t\t\t\timgOpts.objectName\n\t\t\t)\n\t\t),\n\t\t{ openPrefix: ' ' }\n\t)\n\tstrSlideXml += el('p:nvPr', null, raw(genXmlPlaceholder(placeholderObj)), { openPrefix: ' ' })\n\tstrSlideXml += ' </p:nvPicPr>'\n\n\t// The `<a:blip>` image-effect children (CT_Blip), shared by the SVG and raster branches:\n\t// transparency as `alphaModFix`, then duotone recolor (shadows→shadow, highlights→highlight),\n\t// both before any `extLst`.\n\t// NOTE: the SVG branch writes ` <a:alphaModFix` with a LEADING space and the raster branch\n\t// writes none. That space is byte-significant, so it is passed in rather than normalized away.\n\tconst blipEffects = (alphaPrefix: string): XmlChild[] => [\n\t\timgOpts.transparency\n\t\t\t? raw(\n\t\t\t\t\tvoidEl(\n\t\t\t\t\t\t'a:alphaModFix',\n\t\t\t\t\t\t{ amt: Math.round((100 - imgOpts.transparency) * FIXED_PCT_PER_PERCENT) },\n\t\t\t\t\t\t{ openPrefix: alphaPrefix }\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t: null,\n\t\timgOpts.duotone\n\t\t\t? raw(\n\t\t\t\t\tel('a:duotone', null, [\n\t\t\t\t\t\traw(createColorElement(imgOpts.duotone.shadow)),\n\t\t\t\t\t\traw(createColorElement(imgOpts.duotone.highlight)),\n\t\t\t\t\t])\n\t\t\t\t)\n\t\t\t: null,\n\t\timgOpts.clrChange\n\t\t\t? raw(\n\t\t\t\t\tel('a:clrChange', null, [\n\t\t\t\t\t\traw(el('a:clrFrom', null, raw(createColorElement(imgOpts.clrChange.from)))),\n\t\t\t\t\t\traw(el('a:clrTo', null, raw(createColorElement(imgOpts.clrChange.to)))),\n\t\t\t\t\t])\n\t\t\t\t)\n\t\t\t: null,\n\t\timgOpts.grayscale ? raw(voidEl('a:grayscl')) : null,\n\t\timgOpts.biLevel\n\t\t\t? raw(voidEl('a:biLevel', { thresh: Math.round(imgOpts.biLevel.threshold * PERCENT_SCALE) }))\n\t\t\t: null,\n\t]\n\n\tstrSlideXml += '<p:blipFill>'\n\t// NOTE: This works for both cases: either `path` or `data` contains the SVG\n\tconst isVector = mediaRel?.extn === 'svg'\n\tif (isVector) {\n\t\tstrSlideXml += el('a:blip', { 'r:embed': `rId${(slideItemObj.imageRid ?? 0) - 1}` }, [\n\t\t\t...blipEffects(' '),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:extLst',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'a:ext',\n\t\t\t\t\t\t\t{ uri: '{96DAC541-7B7A-43D3-8B79-37D633B846F1}' },\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tvoidEl(\n\t\t\t\t\t\t\t\t\t'asvg:svgBlip',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'xmlns:asvg': 'http://schemas.microsoft.com/office/drawing/2016/SVG/main',\n\t\t\t\t\t\t\t\t\t\t'r:embed': `rId${slideItemObj.imageRid}`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t])\n\t} else {\n\t\tstrSlideXml += el('a:blip', { 'r:embed': `rId${slideItemObj.imageRid}` }, blipEffects(''))\n\t}\n\tif (itemOpts.crop) {\n\t\t// Explicit OOXML srcRect (percentage edge insets), emitted verbatim. Crops the source\n\t\t// directly, so it wins over the inch-based `sizing` crop and works for SVG/unmeasurable\n\t\t// formats; the picture's normal w/h box stays the display extent.\n\t\tif (sizing?.type)\n\t\t\twarn(\n\t\t\t\t'image/crop-and-sizing-conflict',\n\t\t\t\t`addImage 'crop' and 'sizing' are mutually exclusive for image \"${itemOpts.objectName}\"; 'sizing' was ignored.`\n\t\t\t)\n\t\tstrSlideXml += genXmlImageCrop(itemOpts.crop, itemOpts.objectName)\n\t} else if (sizing?.type) {\n\t\tconst boxW = sizing.w ? getSmartParseNumber(sizing.w, 'X', slide._presLayout) : cx\n\t\tconst boxH = sizing.h ? getSmartParseNumber(sizing.h, 'Y', slide._presLayout) : cy\n\t\tconst boxX = getSmartParseNumber(sizing.x || 0, 'X', slide._presLayout)\n\t\tconst boxY = getSmartParseNumber(sizing.y || 0, 'Y', slide._presLayout)\n\n\t\t// `cover`/`contain` crop the *source* bitmap, so the srcRect must be derived from the\n\t\t// image's natural pixel ratio — not the displayed box (options.w/h). Measure it from the\n\t\t// embedded media bytes; if unmeasurable (SVG/unknown format) fall back to display dims + warn.\n\t\t// `crop` keeps display EMU: its contract treats the displayed extent as the crop frame.\n\t\tlet cropSize: { w: number; h: number } = { w: imgWidth, h: imgHeight }\n\t\tif (sizing.type === 'cover' || sizing.type === 'contain') {\n\t\t\tconst natural = naturalSize()\n\t\t\tif (natural) {\n\t\t\t\tcropSize = natural\n\t\t\t} else {\n\t\t\t\twarn(\n\t\t\t\t\t'image/unmeasurable-natural-size',\n\t\t\t\t\t`sizing '${sizing.type}' could not measure natural dimensions for image \"${itemOpts.objectName}\"; falling back to displayed aspect ratio (crop may be inexact). Provide a raster image (PNG/JPEG/GIF/BMP/WebP) or an SVG with width/height or a viewBox to enable an aspect-correct crop.`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tstrSlideXml += ImageSizingXml[sizing.type](cropSize, { w: boxW, h: boxH, x: boxX, y: boxY })\n\t\timgWidth = boxW\n\t\timgHeight = boxH\n\t} else {\n\t\t// No `sizing` at all. A raster fills its box — that box was chosen for it, and PowerPoint\n\t\t// does the same. A vector does not: an SVG states its own aspect ratio in a viewBox, and a\n\t\t// glyph squashed to a box that disagrees is a defect, not a layout choice. So a measurable\n\t\t// vector letterboxes here by default, and `sizing: { type: 'stretch' }` opts back out.\n\t\t// Unmeasurable vectors (no viewBox, no width/height) fall through silently: nothing was\n\t\t// asked for, so there is nothing to warn about.\n\t\tconst natural = isVector ? naturalSize() : null\n\t\tconst aspectFit = natural ? genXmlVectorAspectFit(natural, { w: imgWidth, h: imgHeight }) : null\n\t\tstrSlideXml += aspectFit ?? el('a:stretch', null, raw(voidEl('a:fillRect')), { openPrefix: ' ' })\n\t}\n\tstrSlideXml += '</p:blipFill>'\n\tstrSlideXml += '<p:spPr>'\n\tstrSlideXml += el(\n\t\t'a:xfrm',\n\t\tlocationAttrs,\n\t\t[raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx: imgWidth, cy: imgHeight }))],\n\t\t{ openPrefix: ' ', childPrefix: ' ', closePrefix: ' ' }\n\t)\n\t// Clip the picture to a geometry. `points` (freeform custGeom) takes precedence over `shape`/`rounding`;\n\t// otherwise `shape` wins over `rounding` (shorthand for an ellipse), falling back to a plain rectangle.\n\tif (itemOpts.points) {\n\t\tstrSlideXml += ' ' + genXmlCustGeom(itemOpts, imgWidth, imgHeight, slide._presLayout)\n\t} else {\n\t\tstrSlideXml +=\n\t\t\t' ' + genXmlPresetGeom(itemOpts.shape ?? (rounding ? 'ellipse' : 'rect'), itemOpts, imgWidth, imgHeight)\n\t}\n\n\t// BORDER: `<a:ln>` outline (must precede `<a:effectLst>` per CT_ShapeProperties order)\n\tif (itemOpts.line) strSlideXml += genXmlShapeLine(itemOpts.line)\n\n\t// EFFECTS > SHADOW: REF: @see http://officeopenxml.com/drwSp-effects.php\n\tif (itemOpts.shadow && itemOpts.shadow.type !== 'none') {\n\t\tstrSlideXml += createShadowEffectLst(itemOpts.shadow, DEF_TEXT_SHADOW)\n\t}\n\tstrSlideXml += '</p:spPr>'\n\tstrSlideXml += '</p:pic>'\n\treturn strSlideXml\n}\n","/**\n * ts-pptx: media (audio / video / online video) slide-object serialization\n *\n * Emits a `media` slide object as a `<p:pic>` carrying the required preview image. The online\n * and embedded forms differ in exactly two tokens — the EG_Media choice element and whether the\n * paired `<p14:media>` rel binds by `r:link` or `r:embed` — so they share one body.\n */\n\nimport type { SlideObject } from '../../../types/internal.js'\nimport { genXmlObjectLock, PICTURE_LOCK_ATTRS } from '../../drawingml/locks.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../../oxml/el.js'\nimport { cNvPrOpen, P14_NS } from './shared.js'\nimport type { ObjectOptions } from '../../../types/index.js'\n\n/**\n * Render a `media` (audio/video/online) slide object to its `<p:pic>` XML.\n */\nexport function renderMediaObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\tlocationAttrs: XmlAttrs,\n\titemOpts: ObjectOptions\n): string {\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\tconst mediaRid = slideItemObj.mediaRid ?? 0\n\n\t// The online (external-link) and embedded forms differ in exactly two tokens, so they share\n\t// one body rather than two near-identical branches:\n\t// - EG_Media choice: audio embeds use <a:audioFile>, video and online video <a:videoFile>;\n\t// - the paired <p14:media> rel is bound by r:link for an external link (no media binary\n\t// part, sharing the link Target with the ECMA rel) and by r:embed for an embedded file.\n\t// Note the ECMA media element itself is r:link in BOTH forms.\n\tconst mediaTag = slideItemObj.mtype === 'audio' ? 'a:audioFile' : 'a:videoFile'\n\tconst p14MediaAttr = slideItemObj.mtype === 'online' ? 'r:link' : 'r:embed'\n\n\treturn el('p:pic', null, [\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:nvPicPr',\n\t\t\t\tnull,\n\t\t\t\t[\n\t\t\t\t\t// cNvPr/@id must be unique across every shape on the slide, so it uses the slide-object\n\t\t\t\t\t// index (idx + 2) like all other shapes — NOT mediaRid, which lives in the relationship-id\n\t\t\t\t\t// space and collides with a sibling shape's idx (duplicate ids => PowerPoint reports the\n\t\t\t\t\t// file corrupt, 0x80070570). The preview image is still bound via <a:blip r:embed> below.\n\t\t\t\t\traw(\n\t\t\t\t\t\tcNvPrOpen(idx + 2, itemOpts.objectName, itemOpts.altText || '') +\n\t\t\t\t\t\t\t'>' +\n\t\t\t\t\t\t\tvoidEl('a:hlinkClick', { 'r:id': '', action: 'ppaction://media' }) +\n\t\t\t\t\t\t\t'</p:cNvPr>'\n\t\t\t\t\t),\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'p:cNvPicPr',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tgenXmlObjectLock(\n\t\t\t\t\t\t\t\t\t'a:picLocks',\n\t\t\t\t\t\t\t\t\tPICTURE_LOCK_ATTRS,\n\t\t\t\t\t\t\t\t\t{ noChangeAspect: true, ...itemOpts.objectLock },\n\t\t\t\t\t\t\t\t\titemOpts.objectName\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\traw(\n\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t'p:nvPr',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\traw(voidEl(mediaTag, { 'r:link': `rId${mediaRid}` }, { openPrefix: ' ' })),\n\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t'p:extLst',\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t\t\t'p:ext',\n\t\t\t\t\t\t\t\t\t\t\t\t{ uri: '{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}' },\n\t\t\t\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\t\t\t\tvoidEl(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'p14:media',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ 'xmlns:p14': P14_NS, [p14MediaAttr]: `rId${mediaRid + 1}` },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ openPrefix: ' ' }\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\t// NOTE: Preview image is required!\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:blipFill',\n\t\t\t\tnull,\n\t\t\t\t[\n\t\t\t\t\traw(voidEl('a:blip', { 'r:embed': `rId${mediaRid + 2}` })),\n\t\t\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t\t\t],\n\t\t\t\t{ openPrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:spPr',\n\t\t\t\tnull,\n\t\t\t\t[\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('a:xfrm', locationAttrs, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))], {\n\t\t\t\t\t\t\topenPrefix: ' ',\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')), { openPrefix: ' ' })),\n\t\t\t\t],\n\t\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t])\n}\n","/**\n * ts-pptx: 3D model (`am3d:model3d`) slide-object serialization\n *\n * Emits a `model3d` slide object as an `<mc:AlternateContent>`. The `mc:Choice` carries the real\n * `<p:graphicFrame>` in the 2017 `am3d` namespace, rendered live by PowerPoint 2019+; the\n * `mc:Fallback` carries a plain preview picture, which is what every other consumer — older\n * PowerPoint, thumbnails, PDF export — actually draws. See `gen/define/model3d.ts`.\n *\n * Every constant below is transcribed from a PowerPoint-authored deck\n * (`test/read/fixtures/model3d.pptx`, `Shapes.Add3DModel`), including the lighting rig, which came\n * out byte-identical for every probe model and is therefore emitted as a fixed studio setup rather\n * than derived from anything.\n */\n\nimport type { Model3dInternal, SlideObject } from '../../../types/internal.js'\nimport { el, raw, voidEl } from '../../oxml/el.js'\nimport { cNvPrOpen, MC_NS } from './shared.js'\nimport { GRAPHIC_FRAME_LOCK_ATTRS, PICTURE_LOCK_ATTRS, genXmlObjectLock } from '../../drawingml/locks.js'\n\n/** The `am3d` namespace, doubling as `a:graphicData@uri` and the `mc:Choice Requires` token's URI. */\nconst AM3D_NS = 'http://schemas.microsoft.com/office/drawing/2017/model3d'\n/** Denominator of every `am3d` rational element (`@n`/`@d`). */\nconst RATIO_DEN = 1000000\n/**\n * `am3d:raster@rName`/`@rVer` — the renderer that produced the cached preview. PowerPoint stamps\n * its own renderer here; ts-pptx did not rasterize anything, but the attributes are what PowerPoint\n * writes and the element is where the preview blip lives, so they are reproduced verbatim.\n */\nconst RASTER = { rName: 'Office3DRenderer', rVer: '16.0.8326' }\n/**\n * `am3d:objViewport@viewportSz`. Bounding-box derived in PowerPoint's output (a cube and a slab\n * gave different values); the cube's is emitted, matching the fixed default camera.\n */\nconst OBJ_VIEWPORT_SZ = 3338805\n\n/** One `am3d:ptLight` of the fixed studio rig: colour (scRGB, 1000ths of a percent), intensity, position. */\ninterface PtLight {\n\tclr: { r: number; g: number; b: number }\n\tintensityN: number\n\tpos: { x: number; y: number; z: number }\n}\n/** The three point lights PowerPoint writes for every inserted model — key, fill and rim. */\nconst PT_LIGHTS: readonly PtLight[] = [\n\t{ clr: { r: 100000, g: 75000, b: 50000 }, intensityN: 9765625, pos: { x: 21959998, y: 70920001, z: 16344003 } },\n\t{ clr: { r: 40000, g: 60000, b: 95000 }, intensityN: 12250000, pos: { x: -37964106, y: 51130435, z: 57631972 } },\n\t{ clr: { r: 86837, g: 72700, b: 100000 }, intensityN: 3125000, pos: { x: -37739122, y: 58056624, z: -34769649 } },\n]\n/** `am3d:ambientLight` — neutral 50% scRGB at half illuminance, constant like the point lights. */\nconst AMBIENT = { clr: { r: 50000, g: 50000, b: 50000 }, illuminanceN: 500000 }\n\n/** `<am3d:clr><a:scrgbClr …/></am3d:clr>` — the colour wrapper both light kinds share. */\nfunction lightColor(clr: { r: number; g: number; b: number }): string {\n\treturn el('am3d:clr', null, raw(voidEl('a:scrgbClr', clr)))\n}\n\n/** The `am3d:camera` block: eye position, up vector, aim point and perspective fov. */\nfunction cameraEl(model: Model3dInternal): string {\n\treturn el('am3d:camera', null, [\n\t\traw(voidEl('am3d:pos', model.pos)),\n\t\traw(voidEl('am3d:up', model.up)),\n\t\traw(voidEl('am3d:lookAt', model.lookAt)),\n\t\traw(voidEl('am3d:perspective', { fov: model.fov })),\n\t])\n}\n\n/**\n * The `am3d:trans` block: model-unit scale plus an identity placement. Only `meterPerModelUnit`\n * varies — `preTrans`/`scale`/`rot`/`postTrans` are the identity PowerPoint writes for a model\n * inserted without any subsequent 3D manipulation, and `am3d:rot` is emitted attribute-less.\n */\nfunction transEl(model: Model3dInternal): string {\n\tconst unit = { n: RATIO_DEN, d: RATIO_DEN }\n\treturn el('am3d:trans', null, [\n\t\traw(voidEl('am3d:meterPerModelUnit', { n: model.meterPerModelUnitN, d: RATIO_DEN })),\n\t\traw(voidEl('am3d:preTrans', { dx: 0, dy: 0, dz: 0 })),\n\t\traw(\n\t\t\tel('am3d:scale', null, [raw(voidEl('am3d:sx', unit)), raw(voidEl('am3d:sy', unit)), raw(voidEl('am3d:sz', unit))])\n\t\t),\n\t\traw(voidEl('am3d:rot')),\n\t\traw(voidEl('am3d:postTrans', { dx: 0, dy: 0, dz: 0 })),\n\t])\n}\n\n/** The fixed lighting rig: one ambient light and three point lights, in PowerPoint's order. */\nfunction lightsXml(): string {\n\treturn (\n\t\tel('am3d:ambientLight', null, [\n\t\t\traw(lightColor(AMBIENT.clr)),\n\t\t\traw(voidEl('am3d:illuminance', { n: AMBIENT.illuminanceN, d: RATIO_DEN })),\n\t\t]) +\n\t\tPT_LIGHTS.map((light) =>\n\t\t\tel('am3d:ptLight', { rad: 0 }, [\n\t\t\t\traw(lightColor(light.clr)),\n\t\t\t\traw(voidEl('am3d:intensity', { n: light.intensityN, d: RATIO_DEN })),\n\t\t\t\traw(voidEl('am3d:pos', light.pos)),\n\t\t\t])\n\t\t).join('')\n\t)\n}\n\n/** The `mc:Fallback` picture — the cached preview, drawn by everything that is not PowerPoint 2019+. */\nfunction fallbackPic(\n\tpicId: number,\n\tobjectName: string | undefined,\n\taltText: string,\n\tmodel: Model3dInternal,\n\txf: { x: number; y: number; cx: number; cy: number }\n): string {\n\treturn el('p:pic', null, [\n\t\traw(\n\t\t\tel('p:nvPicPr', null, [\n\t\t\t\traw(cNvPrOpen(picId, objectName, altText) + '/>'),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cNvPicPr',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t// PowerPoint's model-3d lock set: the zoom/picture set plus `noCrop` — a 3D model is\n\t\t\t\t\t\t\t// reframed by its camera, never by cropping the cached raster. Fixed even though\n\t\t\t\t\t\t\t// `Model3dProps` has an `objectLock`, for the reason the zoom emitter spells out:\n\t\t\t\t\t\t\t// this is the `mc:Fallback` picture, and `a:picLocks` takes a different flag set\n\t\t\t\t\t\t\t// from the `a:graphicFrameLocks` the caller's locks land on.\n\t\t\t\t\t\t\tgenXmlObjectLock('a:picLocks', PICTURE_LOCK_ATTRS, {\n\t\t\t\t\t\t\t\tnoGrp: true,\n\t\t\t\t\t\t\t\tnoRot: true,\n\t\t\t\t\t\t\t\tnoChangeAspect: true,\n\t\t\t\t\t\t\t\tnoMove: true,\n\t\t\t\t\t\t\t\tnoResize: true,\n\t\t\t\t\t\t\t\tnoEditPoints: true,\n\t\t\t\t\t\t\t\tnoAdjustHandles: true,\n\t\t\t\t\t\t\t\tnoChangeArrowheads: true,\n\t\t\t\t\t\t\t\tnoChangeShapeType: true,\n\t\t\t\t\t\t\t\tnoCrop: true,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:blipFill', null, [\n\t\t\t\traw(voidEl('a:blip', { 'r:embed': `rId${model.previewRid}` })),\n\t\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:spPr', null, [\n\t\t\t\traw(\n\t\t\t\t\tel('a:xfrm', null, [\n\t\t\t\t\t\traw(voidEl('a:off', { x: xf.x, y: xf.y })),\n\t\t\t\t\t\traw(voidEl('a:ext', { cx: xf.cx, cy: xf.cy })),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t\t\t])\n\t\t),\n\t])\n}\n\n/**\n * Render a `model3d` slide object to its `<mc:AlternateContent>` XML. The `mc:Choice` carries the\n * real `<p:graphicFrame>` (the `am3d:model3d` graphicData PowerPoint 2019+ renders live); the\n * `mc:Fallback` carries the cached preview picture. See `gen/define/model3d.ts`.\n */\nexport function renderModel3dObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number\n): string {\n\tconst model = slideItemObj.model3d\n\tif (!model) return ''\n\tconst opts = slideItemObj.options || {}\n\tconst altText = opts.altText || ''\n\n\t// `am3d:spPr`'s xfrm is FRAME-LOCAL: origin 0,0 with the graphic frame's own extent. The\n\t// slide-absolute position lives on `p:xfrm` below (and on the fallback picture's `p:spPr`).\n\tconst spPr = el('am3d:spPr', null, [\n\t\traw(el('a:xfrm', null, [raw(voidEl('a:off', { x: 0, y: 0 })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t])\n\n\tconst model3d = el('am3d:model3d', { 'r:embed': `rId${model.modelRid}` }, [\n\t\traw(spPr),\n\t\traw(cameraEl(model)),\n\t\traw(transEl(model)),\n\t\t// The raster's blip and the fallback picture share one image rel, as PowerPoint writes it.\n\t\traw(el('am3d:raster', RASTER, raw(voidEl('am3d:blip', { 'r:embed': `rId${model.previewRid}` })))),\n\t\traw(voidEl('am3d:objViewport', { viewportSz: OBJ_VIEWPORT_SZ })),\n\t\traw(lightsXml()),\n\t])\n\n\tconst graphicFrame = el('p:graphicFrame', null, [\n\t\traw(\n\t\t\tel('p:nvGraphicFramePr', null, [\n\t\t\t\traw(cNvPrOpen(idx + 2, opts.objectName, altText) + '/>'),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cNvGraphicFramePr',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t// PowerPoint writes an empty `<a:graphicFrameLocks/>` here — no flags, but the\n\t\t\t\t\t\t// element present — so that is what an unlocked model emits. `genXmlObjectLock`\n\t\t\t\t\t\t// returns `''` when nothing is set, hence the fallback.\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tgenXmlObjectLock('a:graphicFrameLocks', GRAPHIC_FRAME_LOCK_ATTRS, opts.objectLock, opts.objectName) ||\n\t\t\t\t\t\t\t\tvoidEl('a:graphicFrameLocks')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(el('p:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\traw(el('a:graphic', null, raw(el('a:graphicData', { uri: AM3D_NS }, raw(model3d))))),\n\t])\n\n\treturn el('mc:AlternateContent', { 'xmlns:mc': MC_NS }, [\n\t\traw(el('mc:Choice', { 'xmlns:am3d': AM3D_NS, Requires: 'am3d' }, raw(graphicFrame))),\n\t\traw(el('mc:Fallback', null, raw(fallbackPic(idx + 2, opts.objectName, altText, model, { x, y, cx, cy })))),\n\t])\n}\n","/**\n * ts-pptx: OLE-object slide-object serialization\n */\n\nimport type { SlideObject } from '../../../types/internal.js'\nimport { genXmlObjectLock, GRAPHIC_FRAME_LOCK_ATTRS } from '../../drawingml/locks.js'\nimport { el, raw, voidEl, type XmlAttrs, type XmlChild } from '../../oxml/el.js'\nimport { cNvPrOpen, MC_NS } from './shared.js'\n\n/** VML namespace — declared by an OLE object's `mc:Choice Requires=\"v\"` (no VML content is emitted). */\nconst VML_NS = 'urn:schemas-microsoft-com:vml'\n/** graphicData URI for an embedded OLE object (`<p:oleObj>`). */\nconst OLE_NS = 'http://schemas.openxmlformats.org/presentationml/2006/ole'\n\n/**\n * Render an `oleObject` slide object to its `<p:graphicFrame>` XML.\n *\n * Mirrors what PowerPoint authors for Insert ▸ Object: a graphicFrame in the `.../ole` graphicData\n * namespace holding an `<mc:AlternateContent>`. The `mc:Choice` carries the bare `<p:oleObj>` (which\n * PowerPoint renders by drawing the live embedded document); the `mc:Fallback` repeats it with a\n * `<p:pic>` preview so every other consumer shows the cached picture.\n *\n * Note `mc:Choice Requires=\"v\"` only *declares* the VML namespace — modern PowerPoint writes no\n * `spid` and no `vmlDrawing` part, so neither is emitted here.\n */\nexport function renderOleObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number\n): string {\n\tconst ole = slideItemObj.ole\n\tif (!ole) return ''\n\tconst opts = slideItemObj.options || {}\n\n\t// Shared by both branches; attribute order matches PowerPoint's.\n\tconst oleAttrs: XmlAttrs = {\n\t\tname: ole.name,\n\t\tshowAsIcon: ole.showAsIcon ? '1' : null,\n\t\t'r:id': `rId${ole.objectRid}`,\n\t\timgW: ole.imgW ?? cx,\n\t\timgH: ole.imgH ?? cy,\n\t\tprogId: ole.progId,\n\t}\n\tconst oleObj = (children: XmlChild[]): string => el('p:oleObj', oleAttrs, children)\n\n\t// The Fallback's cached picture. Its `cNvPr` is the id-less `0`/`\"\"` form PowerPoint writes:\n\t// the picture is an alternate rendering of the graphicFrame above, never a sibling shape, so it\n\t// takes no id from the slide's shape-id space.\n\tconst previewPic = el('p:pic', null, [\n\t\traw(\n\t\t\tel('p:nvPicPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 0, name: '' })),\n\t\t\t\traw(voidEl('p:cNvPicPr')),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:blipFill', null, [\n\t\t\t\traw(voidEl('a:blip', { 'r:embed': `rId${ole.previewRid}` })),\n\t\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:spPr', null, [\n\t\t\t\traw(el('a:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst alternateContent = el('mc:AlternateContent', { 'xmlns:mc': MC_NS }, [\n\t\traw(el('mc:Choice', { 'xmlns:v': VML_NS, Requires: 'v' }, raw(oleObj([raw(voidEl('p:embed'))])))),\n\t\traw(el('mc:Fallback', null, raw(oleObj([raw(voidEl('p:embed')), raw(previewPic)])))),\n\t])\n\n\treturn el('p:graphicFrame', null, [\n\t\traw(\n\t\t\tel('p:nvGraphicFramePr', null, [\n\t\t\t\traw(cNvPrOpen(idx + 2, opts.objectName, opts.altText || '') + '/>'),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cNvGraphicFramePr',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tgenXmlObjectLock(\n\t\t\t\t\t\t\t\t'a:graphicFrameLocks',\n\t\t\t\t\t\t\t\tGRAPHIC_FRAME_LOCK_ATTRS,\n\t\t\t\t\t\t\t\t{ noChangeAspect: true, ...opts.objectLock },\n\t\t\t\t\t\t\t\topts.objectName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(el('p:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\traw(el('a:graphic', null, raw(el('a:graphicData', { uri: OLE_NS }, raw(alternateContent))))),\n\t])\n}\n","/**\n * ts-pptx: DrawingML table-cell borders\n *\n * Emit the `<a:lnL>/<a:lnR>/<a:lnT>/<a:lnB>` border children of a table cell's\n * `<a:tcPr>`, in the LRTB document order PowerPoint requires, plus the two\n * optional diagonals (`<a:lnTlToBr>`/`<a:lnBlToTr>`) that follow them.\n */\n\nimport type { BorderProps, TableCellDiagonals } from '../../types/index.js'\nimport { genXmlColorSelection } from './fill.js'\nimport { createLineCap, resolveBorderDash, resolveBorderWidth } from './line.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\n\n/**\n * One `<a:lnX>` border element. Every side of a table cell — the four edges and the two\n * diagonals — is a `CT_LineProperties`, so they differ only in element name.\n * @param {string} name - the element's local name (`lnL`, `lnTlToBr`, …)\n * @param {BorderProps} border - the resolved border for that side\n * @return {string} the border element XML\n */\nfunction genBorderLine(name: string, border: BorderProps): string {\n\tconst cap = createLineCap(border.cap)\n\tif (border.type === 'none') return el(`a:${name}`, { w: 0, cap, cmpd: 'sng', algn: 'ctr' }, raw(voidEl('a:noFill')))\n\treturn el(\n\t\t`a:${name}`,\n\t\t{ w: ptsToEmuLenient(resolveBorderWidth(border, 1)), cap, cmpd: 'sng', algn: 'ctr' },\n\t\t[\n\t\t\tgenXmlColorSelection({ color: border.color ?? '363636', transparency: border.transparency }),\n\t\t\tvoidEl('a:prstDash', { val: resolveBorderDash(border) }),\n\t\t\tvoidEl('a:round'),\n\t\t\tvoidEl('a:headEnd', { type: 'none', w: 'med', len: 'med' }),\n\t\t\tvoidEl('a:tailEnd', { type: 'none', w: 'med', len: 'med' }),\n\t\t].map(raw)\n\t)\n}\n\n/**\n * Emit the border children of an `<a:tcPr>` for a table cell: the four edges, then the two\n * diagonals when the cell asks for them.\n *\n * The edges are shared by normal cells and the dummy span (`_hmerge`/`_vmerge`) cells so a\n * merged region's outer edges render with the same border as its origin cell. The diagonals\n * are **not**: a diagonal across a merged region is one stroke corner-to-corner, and\n * repeating it on each covered cell would draw a sawtooth instead. Only the span origin\n * carries them, which is also where PowerPoint puts them.\n *\n * A side may be missing, and missing is not the same as `{type:'none'}`: `none` writes an\n * explicit `w=\"0\"` rule, which is direct formatting and overrides whatever a built-in table\n * style would have drawn there, while an omitted side leaves that edge to the style. The\n * definition step sends every cell here dense; a caller reaching this directly may not.\n *\n * @param {BorderProps[]} cellBorder - up to a 4-tuple of border props in [top, right, bottom, left] order\n * @param {TableCellDiagonals} [diagonal] - the cell's optional corner-to-corner rules\n * @return {string} concatenated border element XML, in the document order PowerPoint expects\n */\nexport function genTableCellBorderXml(\n\tcellBorder: ReadonlyArray<BorderProps | undefined>,\n\tdiagonal?: TableCellDiagonals\n): string {\n\tlet strXml = ''\n\t// NOTE: *** IMPORTANT! *** LRTB order matters! (Reorder a line below to watch the borders go wonky in MS-PPT-2013!!)\n\t;(\n\t\t[\n\t\t\t{ idx: 3, name: 'lnL' },\n\t\t\t{ idx: 1, name: 'lnR' },\n\t\t\t{ idx: 0, name: 'lnT' },\n\t\t\t{ idx: 2, name: 'lnB' },\n\t\t] as const\n\t).forEach((obj) => {\n\t\tconst border = cellBorder[obj.idx]\n\t\tif (!border) return\n\t\tstrXml += genBorderLine(obj.name, border)\n\t})\n\t// CT_TableCellProperties declares the diagonals immediately after `lnB` and before\n\t// `cell3D`/the fill, so they append here rather than being emitted by the caller.\n\tif (diagonal?.tlToBr) strXml += genBorderLine('lnTlToBr', diagonal.tlToBr)\n\tif (diagonal?.blToTr) strXml += genBorderLine('lnBlToTr', diagonal.blToTr)\n\treturn strXml\n}\n","/**\n * ts-pptx: DrawingML table-cell 3-D bevel\n *\n * Emit the `<a:cell3D>` child of a table cell's `<a:tcPr>`. `CT_Cell3D` is a **required**\n * `a:bevel` plus an optional `a:lightRig`, which is why an empty `cell3D: {}` still produces\n * a bevel element (at the schema's own defaults) rather than an empty, invalid `a:cell3D`.\n *\n * The surface is deliberately minimal — preset, size, material and light rig. PowerPoint's\n * table UI exposes no control for any of it, so a cell3D reaches a deck from a theme or\n * another producer; this exists to author and reproduce one, not to model DrawingML 3-D.\n */\n\nimport type { TableCell3DProps } from '../../types/index.js'\nimport { warnOnce } from '../../diagnostics.js'\nimport { checkEnumOrWarn } from '../../ooxml/check-enum.js'\nimport { BEVEL_PRESETS, LIGHT_RIGS, LIGHT_RIG_DIRECTIONS, PRESET_MATERIALS } from '../../ooxml/st-enums.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\n\n/**\n * Vet one enumerated value before it reaches the XML, reporting and dropping anything outside\n * its `ST_` union. See `ooxml/check-enum.ts` for why the write path drops rather than throws.\n */\nfunction resolveEnum<T extends string>(value: string | undefined, valid: readonly T[], field: string): T | null {\n\treturn checkEnumOrWarn(value, valid, 'table/invalid-cell3d', `table cell: cell3D \\`${field}\\``, { field })\n}\n\n/**\n * A bevel dimension in EMU (`ST_PositiveCoordinate`), from a width in points.\n * A negative or non-finite value cannot be written, so it falls back to the attribute's\n * own default of 76200 EMU (6pt) rather than emitting something PowerPoint would reject.\n */\nfunction bevelSizeEmu(points: number | undefined, field: string): number | null {\n\tif (points === undefined || points === null) return null\n\tif (!Number.isFinite(points) || points < 0) {\n\t\twarnOnce(\n\t\t\t'table/invalid-cell3d',\n\t\t\t`table cell: cell3D \\`${field}\\` must be a non-negative number of points; \\`${String(points)}\\` is ignored.`,\n\t\t\t{ received: points, field }\n\t\t)\n\t\treturn null\n\t}\n\treturn ptsToEmuLenient(points)\n}\n\n/**\n * Emit a cell's `<a:cell3D>`, or `''` when it has none.\n * @param {TableCell3DProps} [cell3D] - the cell's 3-D options\n * @return {string} the `a:cell3D` element XML\n */\nexport function genTableCell3DXml(cell3D?: TableCell3DProps): string {\n\tif (!cell3D || typeof cell3D !== 'object') return ''\n\tconst bevel = voidEl('a:bevel', {\n\t\tw: bevelSizeEmu(cell3D.width, 'width'),\n\t\th: bevelSizeEmu(cell3D.height, 'height'),\n\t\tprst: resolveEnum(cell3D.preset, BEVEL_PRESETS, 'preset'),\n\t})\n\t// Both `rig` and `dir` are required on CT_LightRig, so a half-specified rig is dropped\n\t// whole — emitting one attribute would produce a part PowerPoint calls corrupt.\n\tconst rig = resolveEnum(cell3D.lightRig?.rig, LIGHT_RIGS, 'lightRig.rig')\n\tconst dir = resolveEnum(cell3D.lightRig?.dir, LIGHT_RIG_DIRECTIONS, 'lightRig.dir')\n\tconst lightRig = rig && dir ? voidEl('a:lightRig', { rig, dir }) : ''\n\tif (cell3D.lightRig && !lightRig) {\n\t\twarnOnce(\n\t\t\t'table/invalid-cell3d',\n\t\t\t'table cell: cell3D `lightRig` needs both `rig` and `dir` (both are required by CT_LightRig); ' +\n\t\t\t\t'the light rig is dropped and the bevel takes the renderer default.',\n\t\t\t{ received: cell3D.lightRig }\n\t\t)\n\t}\n\treturn el('a:cell3D', { prstMaterial: resolveEnum(cell3D.material, PRESET_MATERIALS, 'material') }, [\n\t\traw(bevel),\n\t\tlightRig ? raw(lightRig) : null,\n\t])\n}\n","/**\n * ts-pptx: table slide-object serialization\n *\n * Emits a `table` slide object as a `<p:graphicFrame>` wrapping `<a:tbl>`: the merge grid\n * (`_hmerge`/`_vmerge` dummy cells for col/rowspan), the column widths, and per-cell borders,\n * fill, margins and text body.\n */\n\nimport { SlideObjectType } from '../../../enums.js'\nimport { DEF_CELL_MARGIN_IN } from '../../../constants-internal.js'\nimport type { BorderProps, ObjectOptions, TableCell, TableCellProps } from '../../../types/index.js'\nimport type { SlideObject } from '../../../types/internal.js'\nimport { checkEnumOrWarn } from '../../../ooxml/check-enum.js'\nimport { TEXT_HORZ_OVERFLOW } from '../../../ooxml/st-enums.js'\nimport { genXmlColorSelection } from '../../drawingml/fill.js'\nimport { genXmlObjectLock, GRAPHIC_FRAME_LOCK_ATTRS } from '../../drawingml/locks.js'\nimport { genTableCellBorderXml } from '../../drawingml/table-border.js'\nimport { withCheckedSpans } from '../../table/spans.js'\nimport { genTableCell3DXml } from '../../drawingml/table-cell3d.js'\nimport { genXmlPlaceholder, genXmlTextBody } from '../../drawingml/text-body.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../../oxml/el.js'\nimport { inch2Emu, marginToEmu, resolveTableColWidthsEmu } from '../../../units-internal.js'\nimport { EMU_PER_INCH } from '../../../units.js'\nimport { cNvPrOpen, P14_NS } from './shared.js'\n\ntype TableInheritableOption =\n\t| 'align'\n\t| 'bold'\n\t| 'border'\n\t| 'color'\n\t| 'fill'\n\t| 'fontFace'\n\t| 'fontSize'\n\t| 'margin'\n\t| 'textDirection'\n\t| 'underline'\n\t| 'valign'\ntype TableInheritableValue = ObjectOptions[TableInheritableOption]\n\n/**\n * Validate a cell's `horzOverflow` before it reaches the XML, reporting and dropping anything\n * outside `ST_TextHorzOverflowType`. `undefined` (the common case) emits nothing.\n */\nfunction resolveHorzOverflow(value: TableCellProps['horzOverflow']): string | null {\n\treturn checkEnumOrWarn(value, TEXT_HORZ_OVERFLOW, 'table/invalid-horz-overflow', 'table cell: horzOverflow')\n}\n\n/** A cell's grid position, for deciding which of the table's outer edges it sits on. */\ninterface GridEdge {\n\trIdx: number\n\tcIdx: number\n\tlastRow: number\n\tlastCol: number\n}\n\n/**\n * Overlay `TableProps.outerBorder` onto one cell's own 4-side border tuple.\n *\n * The perimeter is decided per **grid position**, not per authored cell, which is what makes\n * merges work: a colspan's origin sits at the left of its span and its covered `_hmerge`\n * cells sit to the right, so a span straddling the last column gets that column's rule on the\n * covered cell — exactly where PowerPoint defines a merged region's outer edge. A cell in the\n * table's interior touches no edge and comes back untouched.\n *\n * Returns the input array (not a copy) when nothing applies, so the common no-perimeter path\n * allocates nothing and stays byte-identical. Never mutates: `arrTabRows` holds the caller's\n * own cell objects and repeated `write()` calls must not accumulate borders.\n *\n * @param base - the cell's resolved `[top, right, bottom, left]` borders, or `null` when it has none\n * @param outer - the normalized perimeter tuple, `undefined` for a side the caller left out\n * @param at - where this cell sits in the merge grid\n * @returns the borders to emit, or `null` when there are none and the perimeter adds none\n */\nfunction applyOuterBorder(\n\tbase: ReadonlyArray<BorderProps | undefined> | null,\n\touter: ReadonlyArray<BorderProps | undefined> | undefined,\n\tat: GridEdge\n): ReadonlyArray<BorderProps | undefined> | null {\n\tif (!outer) return base\n\t// TRBL, matching the public tuple order.\n\tconst onEdge = [at.rIdx === 0, at.cIdx === at.lastCol, at.rIdx === at.lastRow, at.cIdx === 0]\n\tconst applies = ([0, 1, 2, 3] as const).filter((idx) => onEdge[idx] && outer[idx])\n\tif (applies.length === 0) return base\n\t// A missing base is a cell the definition step left with no border tuple at all, which is\n\t// a styled table nobody authored a border on. Its other three sides stay holes so the\n\t// chosen table style keeps painting them: inventing `{type:'none'}` here would erase the\n\t// style's interior grid the moment an `outerBorder` was added (#23).\n\tconst merged: (BorderProps | undefined)[] = base ? [...base] : [undefined, undefined, undefined, undefined]\n\tfor (const idx of applies) {\n\t\tconst side = outer[idx]\n\t\tif (side) merged[idx] = side\n\t}\n\treturn merged\n}\n\n/**\n * Render a `table` slide object to its `<p:graphicFrame>` XML (merge-grid, row/col spans, per-cell styling).\n */\nexport function renderTableObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\tplaceholderObj: SlideObject | null,\n\titemOpts: ObjectOptions\n): string {\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\tlet strXml: string\n\tlet arrTabRows: TableCell[][] = []\n\tlet objTabOpts: ObjectOptions = {}\n\tlet intColCnt = 0\n\tlet tblInner = ''\n\tlet cellOpts: TableCellProps | null = null\n\t// Shallow-clone each row so splice() in the merge-grid builder does not mutate the stored\n\t// arrTabRows, which would corrupt output on repeated write()/writeFile() calls.\n\t// Checked again here, not only in `addTableDefinition`: this is where the merge grid allocates\n\t// from a span, and an emitter must not size an array from a number it has not seen. Rows that\n\t// came through the definer are already correct, so this warns about nothing and copies nothing.\n\tarrTabRows = withCheckedSpans((slideItemObj.arrTabRows ?? []).map((row) => [...row]))\n\tobjTabOpts = itemOpts\n\tintColCnt = 0\n\n\t// Calc number of columns\n\t// NOTE: Cells may have a colspan, so merely taking the length of the [0] (or any other) row is not\n\t// ....: sufficient to determine column count. Therefore, check each cell for a colspan and total cols as reqd\n\t;(arrTabRows[0] ?? []).forEach((cell) => {\n\t\tcellOpts = cell.options || null\n\t\tintColCnt += cellOpts?.colspan ? Number(cellOpts.colspan) : 1\n\t})\n\n\t// STEP 1: Start Table XML\n\t// NOTE: The cNvPr id must be unique among ALL shapes on the slide. A table is an\n\t// ordinary top-level slide object, so it uses the same `idx + 2` scheme as every other\n\t// object type below. The legacy `intTableNum * slide._slideNum + 1` formula could collide\n\t// with another shape's `idx + 2` on the same slide (e.g. a table plus enough sibling\n\t// shapes on slide 7), producing a duplicate id that makes PowerPoint report the file as\n\t// corrupt/unreadable (0x80070570) while LibreOffice silently tolerates it.\n\tstrXml =\n\t\t'<p:graphicFrame><p:nvGraphicFramePr>' + cNvPrOpen(idx + 2, itemOpts.objectName, itemOpts.altText || '') + '/>'\n\tstrXml +=\n\t\tel(\n\t\t\t'p:cNvGraphicFramePr',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tgenXmlObjectLock(\n\t\t\t\t\t'a:graphicFrameLocks',\n\t\t\t\t\tGRAPHIC_FRAME_LOCK_ATTRS,\n\t\t\t\t\t{ noGrp: true, ...itemOpts.objectLock },\n\t\t\t\t\titemOpts.objectName\n\t\t\t\t)\n\t\t\t)\n\t\t) +\n\t\t// A table bound to a layout placeholder emits that placeholder's <p:ph> (idx/type) so\n\t\t// PowerPoint treats the graphicFrame as filling the placeholder. The <p:ph>\n\t\t// precedes <p:extLst> per CT_ApplicationNonVisualDrawingProps document order.\n\t\tel(\n\t\t\t'p:nvPr',\n\t\t\tnull,\n\t\t\t[\n\t\t\t\traw(genXmlPlaceholder(placeholderObj)),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:extLst',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t'p:ext',\n\t\t\t\t\t\t\t\t{ uri: '{D42A27DB-BD31-4B8C-83A1-F6EECF244321}' },\n\t\t\t\t\t\t\t\traw(voidEl('p14:modId', { 'xmlns:p14': P14_NS, val: '1579011935' }))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t],\n\t\t\t{ openPrefix: ' ' }\n\t\t) +\n\t\t'</p:nvGraphicFramePr>'\n\tstrXml += el('p:xfrm', null, [\n\t\traw(voidEl('a:off', { x: x || (x === 0 ? 0 : EMU_PER_INCH), y: y || (y === 0 ? 0 : EMU_PER_INCH) })),\n\t\traw(voidEl('a:ext', { cx: cx || (cx === 0 ? 0 : EMU_PER_INCH), cy: cy || EMU_PER_INCH })),\n\t])\n\t{\n\t\t// NOTE: attribute ORDER is byte-significant. None of these flags appears in the byte-gate\n\t\t// baseline (zero parts each), so their emission is pinned by test/regression instead.\n\t\tconst tblPrAttrs: XmlAttrs = {\n\t\t\trtl: objTabOpts.rtl ? '1' : null,\n\t\t\tfirstRow: objTabOpts.hasHeader ? '1' : null,\n\t\t\tlastRow: objTabOpts.hasFooter ? '1' : null,\n\t\t\tbandRow: objTabOpts.hasBandedRows ? '1' : null,\n\t\t\tbandCol: objTabOpts.hasBandedColumns ? '1' : null,\n\t\t\tfirstCol: objTabOpts.hasFirstColumn ? '1' : null,\n\t\t\tlastCol: objTabOpts.hasLastColumn ? '1' : null,\n\t\t}\n\t\t// `CT_TableProperties` sequences its children as EG_FillProperties, EG_EffectProperties,\n\t\t// then the tableStyle/tableStyleId choice — so a table background precedes the style id.\n\t\t// (No effects surface: PowerPoint's UI exposes no table-level effect, so a source deck\n\t\t// will not contain one and there would be nothing to reproduce.)\n\t\tconst tableFillXml = objTabOpts.tableFill ? genXmlColorSelection(objTabOpts.tableFill) : ''\n\t\tconst tblPrChildren =\n\t\t\ttableFillXml + (objTabOpts.tableStyle ? el('a:tableStyleId', null, objTabOpts.tableStyle) : '')\n\t\t// Paired when it carries a fill or a style id, else self-closing — an arity difference.\n\t\tconst tblPr = tblPrChildren ? el('a:tblPr', tblPrAttrs, raw(tblPrChildren)) : voidEl('a:tblPr', tblPrAttrs)\n\t\t// The `<a:tbl>` children accumulate here and are wrapped once at STEP 5, so the byte-significant\n\t\t// (and non-depth-regular) indentation on the closing tags is described in one place.\n\t\ttblInner = tblPr\n\t}\n\n\t// `addTableDefinition` normalizes `outerBorder` to a TRBL tuple, but a table object built by\n\t// hand (or replayed from an older serialized form) can still carry the single-`BorderProps`\n\t// form, so broadcast that here rather than silently dropping the perimeter.\n\tconst outerBorder: ReadonlyArray<BorderProps | undefined> | undefined = !objTabOpts.outerBorder\n\t\t? undefined\n\t\t: Array.isArray(objTabOpts.outerBorder)\n\t\t\t? objTabOpts.outerBorder\n\t\t\t: [objTabOpts.outerBorder, objTabOpts.outerBorder, objTabOpts.outerBorder, objTabOpts.outerBorder]\n\n\t// STEP 2: Set column widths\n\t// Per-column inches from an explicit `colW` array, else split the table's\n\t// resolved EMU width (`cx`) evenly. `resolveTableColWidthsEmu` is the single\n\t// source of truth shared with the measured-fit pass. NOTE: divide the EMU\n\t// width, not the raw inches `options.w` — the latter collapsed auto-width\n\t// tables to ~0-EMU columns (e.g. `w=9` → `gridCol w=\"3\"`).\n\t{\n\t\tconst gridColsEmu = resolveTableColWidthsEmu(objTabOpts.colW, cx, intColCnt)\n\t\ttblInner += el(\n\t\t\t'a:tblGrid',\n\t\t\tnull,\n\t\t\tgridColsEmu.map((w) => raw(voidEl('a:gridCol', { w })))\n\t\t)\n\t}\n\n\t// STEP 3: Build our row arrays into an actual grid to match the XML we will be building next\n\t// Note row arrays can arrive \"lopsided\" as in row1:[1,2,3] row2:[3] when first two cols rowspan!,\n\t// so a simple loop below in XML building wont suffice to build table correctly.\n\t// We have to build an actual grid now\n\t/*\n\t\t\t\t\tEX: (A0:rowspan=3, B1:rowspan=2, C1:colspan=2)\n\n\t\t\t\t\t/------|------|------|------\\\n\t\t\t\t\t| A0 | B0 | C0 | D0 |\n\t\t\t\t\t| | B1 | C1 | |\n\t\t\t\t\t| | | C2 | D2 |\n\t\t\t\t\t\\------|------|------|------/\n\t\t\t\t*/\n\t// A: add _hmerge cell for colspan. should reserve rowspan\n\tarrTabRows.forEach((cells) => {\n\t\tfor (let cIdx = 0; cIdx < cells.length;) {\n\t\t\tconst cell = cells[cIdx]\n\t\t\tif (!cell) break\n\t\t\tconst colspan = cell.options?.colspan\n\t\t\tconst rowspan = cell.options?.rowspan\n\t\t\tif (colspan && colspan > 1) {\n\t\t\t\tconst vMergeCells = new Array(colspan - 1).fill(undefined).map(() => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\t\toptions: { rowspan },\n\t\t\t\t\t\t_hmerge: true,\n\t\t\t\t\t\t_spanOrigin: cell,\n\t\t\t\t\t} as const\n\t\t\t\t})\n\t\t\t\tcells.splice(cIdx + 1, 0, ...vMergeCells)\n\t\t\t\tcIdx += colspan\n\t\t\t} else {\n\t\t\t\tcIdx += 1\n\t\t\t}\n\t\t}\n\t})\n\t// B: add _vmerge cell for rowspan. should reserve colspan/_hmerge\n\tarrTabRows.forEach((cells, rIdx) => {\n\t\tconst nextRow = arrTabRows[rIdx + 1]\n\t\tif (!nextRow) return\n\t\tcells.forEach((cell, cIdx) => {\n\t\t\tconst rowspan = cell._rowContinue || cell.options?.rowspan\n\t\t\tconst colspan = cell.options?.colspan\n\t\t\tconst _hmerge = cell._hmerge\n\t\t\tif (rowspan && rowspan > 1) {\n\t\t\t\t// Point back to the true origin cell: when `cell` is itself an `_hmerge` dummy\n\t\t\t\t// (combined colspan+rowspan), use its origin rather than the dummy.\n\t\t\t\tconst _spanOrigin = cell._spanOrigin || cell\n\t\t\t\tconst hMergeCell = {\n\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\toptions: { colspan },\n\t\t\t\t\t_rowContinue: rowspan - 1,\n\t\t\t\t\t_vmerge: true,\n\t\t\t\t\t_hmerge,\n\t\t\t\t\t_spanOrigin,\n\t\t\t\t} as const\n\t\t\t\tnextRow.splice(cIdx, 0, hMergeCell)\n\t\t\t}\n\t\t})\n\t})\n\n\t// STEP 4: Build table rows/cells\n\tarrTabRows.forEach((cells, rIdx) => {\n\t\t// A: Table Height provided without rowH? Then distribute rows\n\t\tlet intRowH = 0 // IMPORTANT: Default must be zero for auto-sizing to work\n\t\tif (Array.isArray(objTabOpts.rowH) && objTabOpts.rowH[rIdx]) intRowH = inch2Emu(Number(objTabOpts.rowH[rIdx]))\n\t\telse if (objTabOpts.rowH && !isNaN(Number(objTabOpts.rowH))) intRowH = inch2Emu(Number(objTabOpts.rowH))\n\t\telse if (itemOpts.cy || itemOpts.h) {\n\t\t\t// `cy` already holds the table height resolved to EMU (line ~276), correctly handling\n\t\t\t// inches/percent/unit-string inputs — reuse it rather than re-parsing options.h.\n\t\t\tintRowH = Math.round((itemOpts.h ? cy : typeof itemOpts.cy === 'number' ? itemOpts.cy : 1) / arrTabRows.length)\n\t\t}\n\n\t\t// B: Start row — cells accumulate here and the row wraps them once, below.\n\t\tconst rowCells: string[] = []\n\n\t\t// C: Loop over each CELL\n\t\tcells.forEach((cellObj, cIdx) => {\n\t\t\tconst cell: TableCell = cellObj\n\t\t\t// The grid is rectangular by now (STEP 3 filled every span with a dummy cell), so a\n\t\t\t// cell's index in its row *is* its grid column and the perimeter can be decided here.\n\t\t\tconst at: GridEdge = { rIdx, cIdx, lastRow: arrTabRows.length - 1, lastCol: cells.length - 1 }\n\n\t\t\t// NOTE: attribute ORDER is byte-significant; `undefined` omits the attribute entirely,\n\t\t\t// which is what the old `.filter(([, v]) => !!v)` did.\n\t\t\tconst cellSpanAttrs: XmlAttrs = {\n\t\t\t\trowSpan: cell.options?.rowspan && cell.options.rowspan > 1 ? cell.options.rowspan : undefined,\n\t\t\t\tgridSpan: cell.options?.colspan && cell.options.colspan > 1 ? cell.options.colspan : undefined,\n\t\t\t\tvMerge: cell._vmerge ? 1 : undefined,\n\t\t\t\thMerge: cell._hmerge ? 1 : undefined,\n\t\t\t}\n\n\t\t\t// 1: COLSPAN/ROWSPAN: Emit the dummy covered cell for any active span. PowerPoint defines a\n\t\t\t// merged region's outer edges (e.g. the right border of a colspan, the bottom border of a\n\t\t\t// rowspan) on the *covered* cells, so inherit the origin cell's border + fill here instead of\n\t\t\t// emitting an empty `<a:tcPr/>` that drops those edges.\n\t\t\tif (cell._hmerge || cell._vmerge) {\n\t\t\t\tconst origin = cell._spanOrigin\n\t\t\t\tconst originOpts = origin?.options || {}\n\t\t\t\tlet spanPrXml = ''\n\t\t\t\t// Outside the `origin` guard below: a covered cell on the table's edge carries that\n\t\t\t\t// edge's rule whether or not its origin was resolvable.\n\t\t\t\t// A null tuple side means \"this edge is omitted\" (inherits) — normalize it to a\n\t\t\t\t// hole here, which `applyOuterBorder` already treats as \"leave the edge alone\".\n\t\t\t\tconst originBorder = applyOuterBorder(\n\t\t\t\t\tArray.isArray(originOpts.border) ? originOpts.border.map((side) => side ?? undefined) : null,\n\t\t\t\t\touterBorder,\n\t\t\t\t\tat\n\t\t\t\t)\n\t\t\t\tif (originBorder) spanPrXml += genTableCellBorderXml(originBorder)\n\t\t\t\tif (origin) {\n\t\t\t\t\t// Resolve the origin's fill with the same precedence the origin cell itself uses below,\n\t\t\t\t\t// so the whole merged region fills uniformly. This is the origin's fill *object*, so\n\t\t\t\t\t// an image fill arrives with its `_imgRid` already stashed and the covered cell emits\n\t\t\t\t\t// a `blipFill` against the same relationship.\n\t\t\t\t\t// NOTE: PowerPoint itself writes a bare `<a:tcPr/>` on a covered cell and repeats no\n\t\t\t\t\t// fill there (verified against `test/read/fixtures/table-cell-image-fill.pptx`). We\n\t\t\t\t\t// diverge deliberately: a covered cell is never rendered — the origin spans over it —\n\t\t\t\t\t// so copying the fill is invisible either way, and keeping it uniform with the solid\n\t\t\t\t\t// case avoids a branch that would change nothing on screen.\n\t\t\t\t\tconst spanFill = originOpts.fill || ''\n\t\t\t\t\tif (spanFill) spanPrXml += genXmlColorSelection(spanFill)\n\t\t\t\t}\n\t\t\t\t// NOTE: the covered cell is FLAT, unlike the real cell below, which carries indentation\n\t\t\t\t// before its `</a:tcPr>` and `</a:tc>`.\n\t\t\t\trowCells.push(el('a:tc', cellSpanAttrs, raw(el('a:tcPr', null, raw(spanPrXml)))))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// 2: OPTIONS: Build/set cell options\n\t\t\tconst cellOpts = cell.options || {}\n\t\t\tcell.options = cellOpts\n\n\t\t\t// B: Inherit some options from table when cell options dont exist\n\t\t\t// @see: http://officeopenxml.com/drwTableCellProperties-alignment.php\n\t\t\tconst inheritedCellOpts = cellOpts as Partial<Record<TableInheritableOption, TableInheritableValue>>\n\t\t\tconst inheritedTableOpts = objTabOpts as Partial<Record<TableInheritableOption, TableInheritableValue>>\n\t\t\t;(\n\t\t\t\t[\n\t\t\t\t\t'align',\n\t\t\t\t\t'bold',\n\t\t\t\t\t'border',\n\t\t\t\t\t'color',\n\t\t\t\t\t'fill',\n\t\t\t\t\t'fontFace',\n\t\t\t\t\t'fontSize',\n\t\t\t\t\t'margin',\n\t\t\t\t\t'textDirection',\n\t\t\t\t\t'underline',\n\t\t\t\t\t'valign',\n\t\t\t\t] as const\n\t\t\t).forEach((name) => {\n\t\t\t\tif (inheritedTableOpts[name] && !inheritedCellOpts[name] && inheritedCellOpts[name] !== 0)\n\t\t\t\t\tinheritedCellOpts[name] = inheritedTableOpts[name]\n\t\t\t})\n\n\t\t\tconst cellValign = cellOpts.valign\n\t\t\t\t? cellOpts.valign\n\t\t\t\t\t\t.replace(/^c$/i, 'ctr')\n\t\t\t\t\t\t.replace(/^m$/i, 'ctr')\n\t\t\t\t\t\t.replace('center', 'ctr')\n\t\t\t\t\t\t.replace('middle', 'ctr')\n\t\t\t\t\t\t.replace('top', 't')\n\t\t\t\t\t\t.replace('btm', 'b')\n\t\t\t\t\t\t.replace('bottom', 'b')\n\t\t\t\t: null\n\t\t\tconst cellTextDir = cellOpts.textDirection && cellOpts.textDirection !== 'horz' ? cellOpts.textDirection : null\n\n\t\t\tconst fillColor = cellOpts.fill || ''\n\t\t\tconst cellFill = fillColor ? genXmlColorSelection(fillColor) : ''\n\n\t\t\tlet cellMargin = cellOpts.margin === 0 || cellOpts.margin ? cellOpts.margin : DEF_CELL_MARGIN_IN\n\t\t\tif (!Array.isArray(cellMargin) && typeof cellMargin === 'number')\n\t\t\t\tcellMargin = [cellMargin, cellMargin, cellMargin, cellMargin]\n\t\t\t// defensive fallback - if `cellMargin` is not a 4-element array of finite numbers, use defaults (prevents NaN in marL/R/T/B)\n\t\t\tif (\n\t\t\t\t!Array.isArray(cellMargin) ||\n\t\t\t\tcellMargin.length !== 4 ||\n\t\t\t\tcellMargin.some((v) => typeof v !== 'number' || !isFinite(v))\n\t\t\t) {\n\t\t\t\tcellMargin = DEF_CELL_MARGIN_IN\n\t\t\t}\n\t\t\t// Cell text ALWAYS wraps — PowerPoint has no per-cell no-wrap, so there is nothing to emit\n\t\t\t// for one. `wrap=\"none\"` on a cell's `<a:bodyPr>` renders inert and is stripped on the next\n\t\t\t// save, and `TextFrame.WordWrap` is read-only on a cell over COM (it reports msoTrue whatever\n\t\t\t// the XML says). `horzOverflow` below is NOT that switch: per ECMA-376 §20.1.10.68 it decides\n\t\t\t// whether a single glyph too wide for the line is clipped or draws past the cell edge.\n\t\t\t// Probe for both: `test/read/fixtures/authoring/probe-table-cell-wrap.ps1`\n\t\t\tconst cellHorzOverflow = resolveHorzOverflow(cellOpts.horzOverflow)\n\n\t\t\t// Cell margins are inches (see `marginToEmu`); a `>= 1` value warns once as a likely legacy points value.\n\t\t\t// NOTE: attribute ORDER is byte-significant (margins, then anchor, then vert). `horzOverflow`\n\t\t\t// goes last, which is both where CT_TableCellProperties declares it and where PowerPoint\n\t\t\t// writes it, so an existing cell's bytes are unchanged while it stays unset. `anchorCtr`\n\t\t\t// follows `anchor`, matching the schema's own adjacency; that the emitter's `anchor`/`vert`\n\t\t\t// pair is inverted relative to CT_TableCellProperties is pre-existing and harmless — XML\n\t\t\t// attributes are unordered, so the order is only about keeping emitted bytes stable.\n\t\t\tconst tcPrAttrs: XmlAttrs = {\n\t\t\t\tmarL: marginToEmu(cellMargin[3]),\n\t\t\t\tmarR: marginToEmu(cellMargin[1]),\n\t\t\t\tmarT: marginToEmu(cellMargin[0]),\n\t\t\t\tmarB: marginToEmu(cellMargin[2]),\n\t\t\t\tanchor: cellValign,\n\t\t\t\t// `false` is the schema default, so only `true` is worth writing.\n\t\t\t\tanchorCtr: cellOpts.anchorCtr ? '1' : null,\n\t\t\t\tvert: cellTextDir,\n\t\t\t\thorzOverflow: cellHorzOverflow,\n\t\t\t}\n\n\t\t\t// 4: Set CELL content and properties; 5: borders; 6: fill ==============\n\t\t\t// The trailing indentation before `</a:tcPr>` and `</a:tc>` is byte-significant.\n\t\t\t// Child order is the CT_TableCellProperties sequence: the four edges, the two diagonals,\n\t\t\t// `cell3D`, then the fill. Unlike the edges, the diagonals are NOT copied onto a merged\n\t\t\t// region's covered cells (see `genTableCellBorderXml`).\n\t\t\t// A null tuple side is *omitted* (inherits) — normalize it to a hole, which\n\t\t\t// `applyOuterBorder` already treats as \"leave the edge alone\".\n\t\t\tconst cellBorder = applyOuterBorder(\n\t\t\t\tArray.isArray(cellOpts.border) ? cellOpts.border.map((side) => side ?? undefined) : null,\n\t\t\t\touterBorder,\n\t\t\t\tat\n\t\t\t)\n\t\t\tconst cellDiagonal = cellOpts.diagonal\n\t\t\tconst cellBorderXml = cellBorder || cellDiagonal ? genTableCellBorderXml(cellBorder ?? [], cellDiagonal) : ''\n\t\t\trowCells.push(\n\t\t\t\tel(\n\t\t\t\t\t'a:tc',\n\t\t\t\t\tcellSpanAttrs,\n\t\t\t\t\t[\n\t\t\t\t\t\traw(genXmlTextBody(cell)),\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('a:tcPr', tcPrAttrs, [raw(cellBorderXml), raw(genTableCell3DXml(cellOpts.cell3D)), raw(cellFill)], {\n\t\t\t\t\t\t\t\tclosePrefix: ' ',\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t\t{ closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t)\n\t\t})\n\n\t\t// D: Complete row\n\t\ttblInner += el('a:tr', { h: intRowH }, rowCells.map(raw))\n\t})\n\n\t// STEP 5: Complete table. NOTE: the closing tags carry indentation the opening tags do not,\n\t// so each `closePrefix` is stated explicitly rather than derived from depth.\n\tstrXml += el(\n\t\t'a:graphic',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'a:graphicData',\n\t\t\t\t{ uri: 'http://schemas.openxmlformats.org/drawingml/2006/table' },\n\t\t\t\traw(el('a:tbl', null, raw(tblInner), { closePrefix: ' ' })),\n\t\t\t\t{ closePrefix: ' ' }\n\t\t\t)\n\t\t),\n\t\t{ closePrefix: ' ' }\n\t)\n\tstrXml += '</p:graphicFrame>'\n\n\treturn strXml\n}\n","/**\n * ts-pptx: text / placeholder slide-object serialization\n *\n * Emits a `text` or `placeholder` slide object as a `<p:sp>`: body insets from the caller's\n * margin, the shape geometry (preset or custom), fill, outline and shadow, then the text body.\n * An equation-bearing shape is wrapped in the `a14` markup-compatibility envelope.\n */\n\nimport { SlideObjectType } from '../../../enums.js'\nimport { DEF_TEXT_SHADOW } from '../../../constants-internal.js'\nimport type { PresSlideInternal, SlideLayoutInternal, SlideObject } from '../../../types/internal.js'\nimport { createShadowEffectLst } from '../../drawingml/effect.js'\nimport { genXmlColorSelection } from '../../drawingml/fill.js'\nimport { genXmlCustGeom, genXmlPresetGeom } from '../../drawingml/geometry.js'\nimport { genXmlObjectLock, SHAPE_LOCK_ATTRS } from '../../drawingml/locks.js'\nimport { genXmlPlaceholder, genXmlTextBody, objectHasMath } from '../../drawingml/text-body.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../../oxml/el.js'\nimport { marginToEmu } from '../../../units-internal.js'\nimport { EMU_PER_INCH } from '../../../units.js'\nimport { cNvPrHyperlink, cNvPrOpen, genXmlShapeLine } from './shared.js'\nimport type { ObjectOptions } from '../../../types/index.js'\n\n/**\n * Render a `text` / `placeholder` slide object to its `<p:sp>` XML.\n */\nexport function renderTextObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tslide: PresSlideInternal | SlideLayoutInternal,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number,\n\tplaceholderObj: SlideObject | null,\n\tlocationAttrs: XmlAttrs,\n\titemOpts: ObjectOptions\n): string {\n\tlet strSlideXml = ''\n\t// `itemOpts` is the caller's already-normalized `itemOpts` (see the dispatch in\n\t// `slideObjectToXml`). Read it rather than re-narrowing the field: this function has exactly\n\t// one call site, and a contract stated there beats a defensive re-assignment here.\n\t// Lines can have zero cy, but text should not\n\tif (!itemOpts.line && cy === 0) cy = EMU_PER_INCH * 0.3\n\n\t// Margin/Padding/Inset for textboxes\n\tif (!itemOpts._bodyProp) itemOpts._bodyProp = {}\n\tif (itemOpts.margin && Array.isArray(itemOpts.margin)) {\n\t\t// Margin arrays are documented as [Top, Right, Bottom, Left] (CSS order) and table cells /\n\t\t// slide numbers already map them that way. Keep textboxes consistent: index 0=Top, 3=Left.\n\t\t// Margins are inches (see `marginToEmu`), matching cell margins and the PowerPoint dialog.\n\t\titemOpts._bodyProp.tIns = marginToEmu(itemOpts.margin[0] || 0)\n\t\titemOpts._bodyProp.rIns = marginToEmu(itemOpts.margin[1] || 0)\n\t\titemOpts._bodyProp.bIns = marginToEmu(itemOpts.margin[2] || 0)\n\t\titemOpts._bodyProp.lIns = marginToEmu(itemOpts.margin[3] || 0)\n\t} else if (typeof itemOpts.margin === 'number') {\n\t\titemOpts._bodyProp.lIns = marginToEmu(itemOpts.margin)\n\t\titemOpts._bodyProp.rIns = marginToEmu(itemOpts.margin)\n\t\titemOpts._bodyProp.bIns = marginToEmu(itemOpts.margin)\n\t\titemOpts._bodyProp.tIns = marginToEmu(itemOpts.margin)\n\t}\n\n\t// A: Start SHAPE =======================================================\n\t// A native equation uses the `a14` (drawing-2010) markup-compatibility extension.\n\t// PowerPoint wraps the whole shape in <mc:AlternateContent><mc:Choice Requires=\"a14\"> so\n\t// non-a14 consumers (and schema validators) treat the a14:m subtree as a known extension.\n\tif (objectHasMath(slideItemObj)) {\n\t\tstrSlideXml += '<mc:AlternateContent xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\">'\n\t\tstrSlideXml += '<mc:Choice xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" Requires=\"a14\">'\n\t}\n\tstrSlideXml += '<p:sp>'\n\n\t// B: The addition of the \"txBox\" attribute is the sole determiner of if an object is a shape or textbox\n\tconst txtOpts = itemOpts\n\tstrSlideXml +=\n\t\t'<p:nvSpPr>' +\n\t\tcNvPrOpen(idx + 2, txtOpts.objectName, txtOpts.altText || '') +\n\t\t'>' +\n\t\tcNvPrHyperlink(txtOpts.hyperlink) +\n\t\t'</p:cNvPr>'\n\t{\n\t\tconst spLockXml = genXmlObjectLock('a:spLocks', SHAPE_LOCK_ATTRS, txtOpts.objectLock, txtOpts.objectName)\n\t\t// NOTE: paired only when there are locks to carry; otherwise self-closing. That is an arity\n\t\t// difference, so it cannot be expressed as one `el()` call.\n\t\tconst cNvSpPrAttrs: XmlAttrs = { txBox: txtOpts?.isTextBox ? '1' : null }\n\t\tstrSlideXml += spLockXml ? el('p:cNvSpPr', cNvSpPrAttrs, raw(spLockXml)) : voidEl('p:cNvSpPr', cNvSpPrAttrs)\n\t}\n\t// Prefer the resolved slide-layout placeholder; otherwise fall back to the shape's own\n\t// placeholder type so a standalone title/body text box still emits a real <p:ph>.\n\tstrSlideXml += el(\n\t\t'p:nvPr',\n\t\tnull,\n\t\traw(\n\t\t\tgenXmlPlaceholder(\n\t\t\t\tslideItemObj._type === SlideObjectType.placeholder || (placeholderObj == null && itemOpts?._placeholderType)\n\t\t\t\t\t? slideItemObj\n\t\t\t\t\t: placeholderObj\n\t\t\t)\n\t\t)\n\t)\n\tstrSlideXml += '</p:nvSpPr><p:spPr>'\n\tstrSlideXml += el('a:xfrm', locationAttrs, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])\n\n\tif (slideItemObj.shape === 'custGeom') {\n\t\tstrSlideXml += genXmlCustGeom(itemOpts, cx, cy, slide._presLayout)\n\t} else {\n\t\tstrSlideXml += genXmlPresetGeom(slideItemObj.shape ?? '', itemOpts, cx, cy)\n\t}\n\n\t// Option: FILL\n\t// A missing `fill` defaults to `<a:noFill/>` here — an unfilled box is what a text box\n\t// should be, and every deck ever authored against this writer depends on it. That default\n\t// is also why omission cannot mean *inherit* on this path: `fill: { type: 'inherit' }` is\n\t// the spelling that emits no fill child and lets `p:style/a:fillRef` or the placeholder\n\t// paint the interior.\n\tstrSlideXml += itemOpts.fill ? genXmlColorSelection(itemOpts.fill) : '<a:noFill/>'\n\n\t// shape Type: LINE: line color\n\tif (itemOpts.line) strSlideXml += genXmlShapeLine(itemOpts.line)\n\n\t// EFFECTS > SHADOW: REF: @see http://officeopenxml.com/drwSp-effects.php\n\tif (itemOpts.shadow && itemOpts.shadow.type !== 'none') {\n\t\tstrSlideXml += createShadowEffectLst(itemOpts.shadow, DEF_TEXT_SHADOW)\n\t}\n\n\t// B: Close shape Properties\n\tstrSlideXml += '</p:spPr>'\n\n\t// C: Add formatted text (text body \"bodyPr\")\n\tstrSlideXml += genXmlTextBody(slideItemObj)\n\n\t// LAST: Close SHAPE =======================================================\n\tstrSlideXml += '</p:sp>'\n\n\t// Close the a14 markup-compatibility envelope for an equation-bearing shape.\n\tif (objectHasMath(slideItemObj)) strSlideXml += '</mc:Choice></mc:AlternateContent>'\n\treturn strSlideXml\n}\n","/**\n * ts-pptx: Zoom (Slide / Section / Summary) slide-object serialization\n *\n * Emits a `zoom` slide object as an `<mc:AlternateContent>`. The `mc:Choice` carries the real\n * `<p:graphicFrame>` in the 2016 zoom namespaces, read by PowerPoint 2016+; the `mc:Fallback`\n * carries a hyperlinked preview picture — or, for a Summary Zoom, a group of them — so older\n * consumers still get a clickable navigation thumbnail. See `gen/define/zoom.ts`.\n */\n\nimport type { SlideObject, ZoomInternal, ZoomTileInternal } from '../../../types/internal.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../../oxml/el.js'\nimport { cNvPrOpen, MC_NS } from './shared.js'\nimport { GRAPHIC_FRAME_LOCK_ATTRS, PICTURE_LOCK_ATTRS, genXmlObjectLock } from '../../drawingml/locks.js'\n\n/** Zoom (Slide/Section/Summary) graphicData URI + `mc:Choice Requires` prefix + element local-names, per variant. */\nconst ZOOM_VARIANTS = {\n\tslide: {\n\t\turi: 'http://schemas.microsoft.com/office/powerpoint/2016/slidezoom',\n\t\tprefix: 'pslz',\n\t\tzm: 'sldZm',\n\t\tobj: 'sldZmObj',\n\t},\n\tsection: {\n\t\turi: 'http://schemas.microsoft.com/office/powerpoint/2016/sectionzoom',\n\t\tprefix: 'psez',\n\t\tzm: 'sectionZm',\n\t\tobj: 'sectionZmObj',\n\t},\n\tsummary: {\n\t\turi: 'http://schemas.microsoft.com/office/powerpoint/2016/summaryzoom',\n\t\tprefix: 'psuz',\n\t\tzm: 'summaryZm',\n\t\tobj: 'summaryZmObj',\n\t},\n} as const\n/** Namespace of the zoom preview `blipFill`/`spPr` (children of `zmPr`). */\nconst P166_NS = 'http://schemas.microsoft.com/office/powerpoint/2016/6/main'\n\n/** The `p166:blipFill` + `p166:spPr` (preview image + framed tile) shared by a zoom tile's `zmPr`. */\nfunction zoomBlipSpPr(previewRid: number, xf: { x: number; y: number; cx: number; cy: number }): string {\n\treturn (\n\t\tel('p166:blipFill', { 'xmlns:p166': P166_NS }, [\n\t\t\traw(voidEl('a:blip', { 'r:embed': `rId${previewRid}` })),\n\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t]) +\n\t\tel('p166:spPr', { 'xmlns:p166': P166_NS }, [\n\t\t\traw(\n\t\t\t\tel('a:xfrm', null, [raw(voidEl('a:off', { x: xf.x, y: xf.y })), raw(voidEl('a:ext', { cx: xf.cx, cy: xf.cy }))])\n\t\t\t),\n\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t\t\traw(el('a:ln', { w: '3175' }, raw(el('a:solidFill', null, raw(voidEl('a:prstClr', { val: 'ltGray' })))))),\n\t\t])\n\t)\n}\n\n/** One `{prefix}:{obj}` targeting element (sldZmObj/sectionZmObj/summaryZmObj) with its nested `zmPr`. */\nfunction zoomObjEl(\n\tvariant: ZoomInternal['variant'],\n\ttile: ZoomTileInternal,\n\treturnToParent: boolean,\n\ttransitionDur: number,\n\tlocalXf: { x: number; y: number; cx: number; cy: number }\n): string {\n\tconst { prefix, obj } = ZOOM_VARIANTS[variant]\n\tconst objAttrs: XmlAttrs = variant === 'slide' ? { sldId: tile.sldId ?? null } : { sectionId: tile.sectionId ?? null }\n\t// zmPr attrs: id, (Slide Zoom only) returnToParent, transitionDur — matching PowerPoint's order.\n\tconst zmAttrs: XmlAttrs = { id: tile.zmPrId }\n\tif (variant === 'slide') zmAttrs['returnToParent'] = returnToParent ? '1' : '0'\n\tzmAttrs['transitionDur'] = transitionDur\n\treturn el(\n\t\t`${prefix}:${obj}`,\n\t\tobjAttrs,\n\t\traw(el(`${prefix}:zmPr`, zmAttrs, raw(zoomBlipSpPr(tile.previewRid, localXf))))\n\t)\n}\n\n/** The `mc:Fallback` picture (or grouped pictures) — a hyperlinked thumbnail for pre-2016 consumers. */\nfunction zoomFallbackPic(\n\tpicId: number,\n\tobjectName: string | undefined,\n\ttile: ZoomTileInternal,\n\tabsXf: { x: number; y: number; cx: number; cy: number }\n): string {\n\treturn el('p:pic', null, [\n\t\traw(\n\t\t\tel('p:nvPicPr', null, [\n\t\t\t\traw(\n\t\t\t\t\tcNvPrOpen(picId, objectName, '') +\n\t\t\t\t\t\t'>' +\n\t\t\t\t\t\tvoidEl('a:hlinkClick', { 'r:id': `rId${tile.fallbackSlideRid}`, action: 'ppaction://hlinksldjump' }) +\n\t\t\t\t\t\t'</p:cNvPr>'\n\t\t\t\t),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cNvPicPr',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t// PowerPoint's zoom-tile lock set, and fixed on purpose even though `ZoomBaseProps`\n\t\t\t\t\t\t// now has an `objectLock`: this is the `mc:Fallback` picture, which only a pre-2016\n\t\t\t\t\t\t// consumer draws, and `a:picLocks` and `a:graphicFrameLocks` accept different flags\n\t\t\t\t\t\t// — folding the caller's graphic-frame set onto it would warn about every flag the\n\t\t\t\t\t\t// two element types do not share. The caller's locks go on the `mc:Choice` frame\n\t\t\t\t\t\t// below, which is the object PowerPoint actually manipulates. Routed through\n\t\t\t\t\t\t// `genXmlObjectLock` so the attribute order is the table's rather than this\n\t\t\t\t\t\t// literal's, and a flag added to the set lands in the right place.\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tgenXmlObjectLock('a:picLocks', PICTURE_LOCK_ATTRS, {\n\t\t\t\t\t\t\t\tnoGrp: true,\n\t\t\t\t\t\t\t\tnoRot: true,\n\t\t\t\t\t\t\t\tnoChangeAspect: true,\n\t\t\t\t\t\t\t\tnoMove: true,\n\t\t\t\t\t\t\t\tnoResize: true,\n\t\t\t\t\t\t\t\tnoEditPoints: true,\n\t\t\t\t\t\t\t\tnoAdjustHandles: true,\n\t\t\t\t\t\t\t\tnoChangeArrowheads: true,\n\t\t\t\t\t\t\t\tnoChangeShapeType: true,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:blipFill', null, [\n\t\t\t\traw(voidEl('a:blip', { 'r:embed': `rId${tile.previewRid}` })),\n\t\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:spPr', null, [\n\t\t\t\traw(\n\t\t\t\t\tel('a:xfrm', null, [\n\t\t\t\t\t\traw(voidEl('a:off', { x: absXf.x, y: absXf.y })),\n\t\t\t\t\t\traw(voidEl('a:ext', { cx: absXf.cx, cy: absXf.cy })),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t\traw(el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))),\n\t\t\t\traw(el('a:ln', { w: '3175' }, raw(el('a:solidFill', null, raw(voidEl('a:prstClr', { val: 'ltGray' })))))),\n\t\t\t])\n\t\t),\n\t])\n}\n\n/**\n * Render a `zoom` slide object to its `<mc:AlternateContent>` XML. The `mc:Choice` carries the real\n * `<p:graphicFrame>` (Slide/Section/Summary Zoom in the 2016 zoom namespaces, read by PowerPoint\n * 2016+); the `mc:Fallback` carries a hyperlinked picture — or, for a Summary Zoom, a group of them —\n * so pre-2016 consumers still get a clickable navigation thumbnail. See `gen/define/zoom.ts`.\n */\nexport function renderZoomObject(\n\tslideItemObj: SlideObject,\n\tidx: number,\n\tx: number,\n\ty: number,\n\tcx: number,\n\tcy: number\n): string {\n\tconst zoom = slideItemObj.zoom\n\tif (!zoom) return ''\n\tconst opts = slideItemObj.options || {}\n\tconst objectName = opts.objectName\n\tconst { uri, prefix, zm } = ZOOM_VARIANTS[zoom.variant]\n\tconst firstTile = zoom.tiles[0]\n\tif (!firstTile) return '' // every zoom is registered with >= 1 tile; keeps this a total function\n\n\t// Choice: the zoom `graphicData` body. Single-tile (slide/section) uses a frame-local 0,0 xfrm;\n\t// summary lays each tile out at its precomputed grid cell (frame-local EMU).\n\tconst objectsXml =\n\t\tzoom.variant === 'summary'\n\t\t\t? zoom.tiles\n\t\t\t\t\t.map((t) =>\n\t\t\t\t\t\traw(zoomObjEl('summary', t, zoom.returnToParent, zoom.transitionDur, t.grid ?? { x: 0, y: 0, cx, cy }))\n\t\t\t\t\t)\n\t\t\t\t\t.concat(raw(voidEl(`${prefix}:gridLayout`)))\n\t\t\t: [raw(zoomObjEl(zoom.variant, firstTile, zoom.returnToParent, zoom.transitionDur, { x: 0, y: 0, cx, cy }))]\n\n\tconst graphicFrame = el('p:graphicFrame', null, [\n\t\traw(\n\t\t\tel('p:nvGraphicFramePr', null, [\n\t\t\t\traw(cNvPrOpen(idx + 2, objectName, '') + '/>'),\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p:cNvGraphicFramePr',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t// `noChangeAspect` is PowerPoint's own default for a zoom tile (it mirrors the\n\t\t\t\t\t\t// target slide's aspect); the caller's flags fold over it, so passing\n\t\t\t\t\t\t// `noChangeAspect: false` lifts it.\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tgenXmlObjectLock(\n\t\t\t\t\t\t\t\t'a:graphicFrameLocks',\n\t\t\t\t\t\t\t\tGRAPHIC_FRAME_LOCK_ATTRS,\n\t\t\t\t\t\t\t\t{ noChangeAspect: true, ...opts.objectLock },\n\t\t\t\t\t\t\t\tobjectName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(el('p:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])),\n\t\traw(el('a:graphic', null, raw(el('a:graphicData', { uri }, raw(el(`${prefix}:${zm}`, null, objectsXml)))))),\n\t])\n\tconst choice = el('mc:Choice', { [`xmlns:${prefix}`]: uri, Requires: prefix }, raw(graphicFrame))\n\n\t// Fallback: a hyperlinked picture per tile at its slide-absolute position.\n\tlet fallbackInner: string\n\tif (zoom.variant === 'summary') {\n\t\tconst pics = zoom.tiles.map((t, k) => {\n\t\t\tconst g = t.grid ?? { x: 0, y: 0, cx, cy }\n\t\t\treturn raw(zoomFallbackPic(idx + 3 + k, objectName, t, { x: x + g.x, y: y + g.y, cx: g.cx, cy: g.cy }))\n\t\t})\n\t\tfallbackInner = el('p:grpSp', null, [\n\t\t\traw(\n\t\t\t\tel('p:nvGrpSpPr', null, [\n\t\t\t\t\traw(cNvPrOpen(idx + 2, objectName, '') + '/>'),\n\t\t\t\t\traw(voidEl('p:cNvGrpSpPr')),\n\t\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t\t])\n\t\t\t),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:grpSpPr',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('a:xfrm', null, [\n\t\t\t\t\t\t\traw(voidEl('a:off', { x, y })),\n\t\t\t\t\t\t\traw(voidEl('a:ext', { cx, cy })),\n\t\t\t\t\t\t\traw(voidEl('a:chOff', { x, y })),\n\t\t\t\t\t\t\traw(voidEl('a:chExt', { cx, cy })),\n\t\t\t\t\t\t])\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t...pics,\n\t\t])\n\t} else {\n\t\tfallbackInner = zoomFallbackPic(idx + 2, objectName, firstTile, { x, y, cx, cy })\n\t}\n\n\treturn el('mc:AlternateContent', { 'xmlns:mc': MC_NS }, [\n\t\traw(choice),\n\t\traw(el('mc:Fallback', null, raw(fallbackInner))),\n\t])\n}\n","/**\n * ts-pptx: slide object serialization\n *\n * The per-shape `<p:spTree>` builder: `slideObjectToXml` walks a slide/layout's objects\n * (recursing into groups, allocating `<p:cNvPr>` ids as it goes) and dispatches each one to the\n * matching renderer under `objects/`. The group render and the slide-number placeholder stay\n * here because both consume the slide-wide child-id counter the walk maintains.\n * `slideObjectRelationsToXml` emits the matching `.rels` targets.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport { CRLF, DEF_PRES_LAYOUT_NAME, SLDNUM_PLACEHOLDER_TEXT, SLDNUMFLDID, XML_DECL } from '../../constants-internal.js'\nimport type { ObjectOptions, SlideNumberProps } from '../../types/index.js'\nimport type {\n\tPresSlideInternal,\n\tSlideLayoutInternal,\n\tSlideObject,\n\tSlideRel,\n\tSlideRelChart,\n\tSlideRelMedia,\n} from '../../types/internal.js'\nimport { encodeXmlAttrValue, getDuplicateObjectNames, isHyperlinkRel } from '../utils.js'\nimport { genXmlColorSelection } from '../drawingml/fill.js'\nimport { convertRotationDegrees, getSmartParseNumber, marginToEmu } from '../../units-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { clampFontSizeSz } from '../drawingml/clamp.js'\nimport { genXmlObjectLock, GROUP_SHAPE_LOCK_ATTRS } from '../drawingml/locks.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\nimport { cNvPrOpen } from './objects/shared.js'\nimport { renderChartObject } from './objects/chart.js'\nimport { renderConnectorObject } from './objects/connector.js'\nimport { renderImageObject } from './objects/image.js'\nimport { renderMediaObject } from './objects/media.js'\nimport { renderModel3dObject } from './objects/model3d.js'\nimport { renderOleObject } from './objects/ole.js'\nimport { renderTableObject } from './objects/table.js'\nimport { renderTextObject } from './objects/text.js'\nimport { renderZoomObject } from './objects/zoom.js'\nimport { collectSlideShapeIds } from './shape-ids.js'\nimport { OFFICE_REL, PACKAGE_REL_NS } from '../../ooxml/rel-types.js'\nimport { externalHyperlinkRel } from '../opc/rels.js'\n\n/** The MS-2007 `media` rel that pairs with an ECMA audio/video/online rel on the same Target. */\nconst MS_MEDIA_REL = 'http://schemas.microsoft.com/office/2007/relationships/media'\n/** Slide→chartEx-part relationship type (MS, not the ECMA `.../relationships/chart`). */\nconst CHARTEX_REL = 'http://schemas.microsoft.com/office/2014/relationships/chartEx'\n\n/** The four axes that make up an explicit group frame. All or nothing — see `givenGroupFrameAxes`. */\nconst GROUP_FRAME_AXES = ['x', 'y', 'w', 'h'] as const\n\n/**\n * Which of `x`/`y`/`w`/`h` a group's caller actually supplied.\n *\n * A group frame is explicit only when **all four** are given; anything less falls back to\n * auto-bounds on every axis. Partial frames used to be honoured per-axis, which let the unset ones\n * take the shared per-object defaults (`x=0`, `y=0`, `cx=75%` of the layout width, `cy=0`) — so\n * `addGroup([rect], { x: 5, y: 2 })` emitted a zero-height group whose width was a silent\n * slide-width fraction, and every child of it then re-read as `null` through the read path's\n * degenerate-`chExt` guard.\n *\n * Per-axis fallback was the other candidate, but it cannot mean what it reads like: the writer keeps\n * an identity child space (`chOff/chExt == off/ext`), so a group's frame never moves or scales its\n * children — it only places the selection handle and the rotate pivot. `{ x: 5 }` would leave the\n * children where they were and put the group's box somewhere they are not. Falling back whole, with\n * a warning, keeps the group box around its content and says so out loud.\n * @param options - the group object's options\n * @returns the supplied axis names, in `x`/`y`/`w`/`h` order\n */\nconst givenGroupFrameAxes = (options: ObjectOptions): Array<(typeof GROUP_FRAME_AXES)[number]> =>\n\tGROUP_FRAME_AXES.filter((axis) => typeof options[axis] !== 'undefined')\n\n/**\n * Whether a group's frame is fully explicit (all four of `x`/`y`/`w`/`h`), and so should be used\n * verbatim instead of the children's bounding box. See `givenGroupFrameAxes`.\n * @param options - the group object's options\n * @returns true when every axis is supplied\n */\nconst hasCompleteGroupFrame = (options: ObjectOptions): boolean =>\n\tgivenGroupFrameAxes(options).length === GROUP_FRAME_AXES.length\n\n/**\n * Normalize one axis of a placement box so its extent is never negative.\n *\n * `<a:ext cx>`/`<a:ext cy>` are `ST_PositiveCoordinate` (ECMA-376 Part 1, `CT_PositiveSize2D`), so a\n * negative extent is schema-invalid. PowerPoint rejects the *whole* presentation with \"The file or\n * directory is corrupted and unreadable\" (0x80070570) and names no shape, part, or slide, while\n * LibreOffice renders the same package happily — so the defect is invisible until the deck reaches\n * PowerPoint.\n *\n * A signed delta is the natural way to write \"draw from A to B\" (`{ x: x0, y: y0, w: x1 - x0, h: y1 - y0 }`),\n * and it goes negative the moment the line runs leftward or upward. The correct encoding is the\n * normalized bounding box plus a flip, which is what `addConnector` already derives from its own\n * endpoints (`src/gen/define/connector.ts`); this gives every other shape kind the same treatment at\n * the one point where every `Coord` form ('50%', '2in', a number) has been resolved to EMU.\n *\n * The caller composes `flip` onto any `flipH`/`flipV` the author set, so an explicit flip plus a\n * negative extent cancel out rather than double-applying.\n * @param off - the axis origin in EMU (`a:off` `x` or `y`)\n * @param ext - the axis extent in EMU (`a:ext` `cx` or `cy`), possibly negative\n * @returns the min-corner origin, the absolute extent, and whether the axis was mirrored\n */\nconst normalizeAxisExtent = (off: number, ext: number): { off: number; ext: number; flip: boolean } =>\n\text < 0 ? { off: off + ext, ext: -ext, flip: true } : { off, ext, flip: false }\n\n/**\n * Whether this part has a real slide number to cache in a `slidenum` field.\n *\n * Only a slide does. A master leaves `_slideNum` null and a layout carries the internal 1000+\n * counter that keeps layout media keys from colliding with slide media — neither is a page\n * number, and neither belongs in the field's cached text.\n */\nfunction hasRealSlideNumber(slide: PresSlideInternal | SlideLayoutInternal): boolean {\n\treturn slide._slideNum != null && slide._slideNum < 1000\n}\n\n/**\n * Warn about duplicate Selection Pane identities on this slide.\n *\n * Unique `objectName` values are what consumers (e.g. semantic manifests) rely on, so\n * collisions are flagged loudly. Groups are recursed into: a group's children are\n * `<p:cNvPr>`-named on this same slide, so a child colliding with a top-level object (or with a\n * child of another group) is a collision the Selection Pane shows, and checking only the top\n * level cannot see it.\n */\nfunction warnDuplicateObjectNames(slide: PresSlideInternal | SlideLayoutInternal): void {\n\tconst collectObjectNames = (objects: SlideObject[]): string[] =>\n\t\tobjects.flatMap((obj) => [\n\t\t\t...(typeof obj.options?.objectName === 'string' ? [obj.options.objectName] : []),\n\t\t\t...collectObjectNames(obj._groupObjects || []),\n\t\t])\n\tconst duplicateObjectNames = getDuplicateObjectNames(collectObjectNames(slide._slideObjects))\n\tif (duplicateObjectNames.length > 0) {\n\t\twarn(\n\t\t\t'object-name/duplicate',\n\t\t\t`duplicate objectName value(s) emitted on a single slide: ${duplicateObjectNames.join(', ')}. Selection Pane identities should be unique.`\n\t\t)\n\t}\n}\n\n/**\n * The slide's `<p:bg>`, or `''` when it has none.\n *\n * Exactly one of the three forms is emitted: an image background (a rel the media pass resolved),\n * a colour or gradient, or the white default that only the built-in layout gets. They are\n * mutually exclusive because a master carrying both a `color` and a `path` must still produce a\n * single `<p:bg>`.\n */\nfunction slideBackgroundXml(slide: PresSlideInternal | SlideLayoutInternal): string {\n\tlet strSlideXml = ''\n\tif (slide._bkgdImgRid) {\n\t\tstrSlideXml += el(\n\t\t\t'p:bg',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel('p:bgPr', null, [\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('a:blipFill', { dpi: '0', rotWithShape: '1' }, [\n\t\t\t\t\t\t\traw(el('a:blip', { 'r:embed': `rId${slide._bkgdImgRid}` }, raw(voidEl('a:lum')))),\n\t\t\t\t\t\t\traw(voidEl('a:srcRect')),\n\t\t\t\t\t\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t\t\t\t\t\t])\n\t\t\t\t\t),\n\t\t\t\t\traw(voidEl('a:effectLst')),\n\t\t\t\t])\n\t\t\t)\n\t\t)\n\t} else if (slide.background?.color || slide.background?.type === 'gradient') {\n\t\tstrSlideXml += el(\n\t\t\t'p:bg',\n\t\t\tnull,\n\t\t\traw(el('p:bgPr', null, [raw(genXmlColorSelection(slide.background)), raw(voidEl('a:effectLst'))]))\n\t\t)\n\t} else if (!slide.background && slide._name && slide._name === DEF_PRES_LAYOUT_NAME) {\n\t\t// NOTE: Default [white] background is needed on slideMaster1.xml to avoid gray background in Keynote (and Finder previews)\n\t\tstrSlideXml += el('p:bg', null, raw(el('p:bgRef', { idx: '1001' }, raw(voidEl('a:schemeClr', { val: 'bg1' })))))\n\t}\n\treturn strSlideXml\n}\n\n/**\n * The fixed opening of a slide's `<p:spTree>`.\n *\n * OOXML requires the shape tree to open with the implicit top-level group's non-visual props\n * (`<p:nvGrpSpPr>`, the reserved `cNvPr id=\"1\"`) and an identity group transform (off/ext and\n * chOff/chExt all zero) before any child shape. This is the slide's built-in root group, not a\n * user-authored `addGroup` — hence the zeroed frame, and hence taking no arguments: every slide,\n * layout and master opens its tree with exactly these bytes.\n */\nfunction spTreeOpenXml(): string {\n\tlet strSlideXml = ''\n\tstrSlideXml += '<p:spTree>'\n\tstrSlideXml += el('p:nvGrpSpPr', null, [\n\t\traw(voidEl('p:cNvPr', { id: '1', name: '' })),\n\t\traw(voidEl('p:cNvGrpSpPr')),\n\t\traw(voidEl('p:nvPr')),\n\t])\n\tstrSlideXml += el(\n\t\t'p:grpSpPr',\n\t\tnull,\n\t\traw(\n\t\t\tel('a:xfrm', null, [\n\t\t\t\traw(voidEl('a:off', { x: '0', y: '0' })),\n\t\t\t\traw(voidEl('a:ext', { cx: '0', cy: '0' })),\n\t\t\t\traw(voidEl('a:chOff', { x: '0', y: '0' })),\n\t\t\t\traw(voidEl('a:chExt', { cx: '0', cy: '0' })),\n\t\t\t])\n\t\t)\n\t)\n\treturn strSlideXml\n}\n\n/**\n * The slide-number placeholder shape.\n *\n * Emitted after every authored object, so its `<p:cNvPr>` id can come from the same monotonic\n * counter the walk has been advancing — the caller allocates it and passes it in.\n *\n * @param slide - the slide, layout or master being emitted\n * @param snProps - the part's slide-number properties; `align` is defaulted here, in place,\n * because the same object is read again downstream\n * @param slideNumberId - the `<p:cNvPr>` id to use, already allocated by the caller\n */\nfunction slideNumberPlaceholderXml(\n\tslide: PresSlideInternal | SlideLayoutInternal,\n\tsnProps: SlideNumberProps,\n\tslideNumberId: number\n): string {\n\t// Set some defaults (done here b/c SlideNumber canbe added to masters or slides and has numerous entry points)\n\tif (!snProps.align) snProps.align = 'left'\n\n\tlet strSlideXml = ''\n\tstrSlideXml += '<p:sp>'\n\tstrSlideXml += ' <p:nvSpPr>'\n\tstrSlideXml +=\n\t\tvoidEl('p:cNvPr', { id: slideNumberId, name: 'Slide Number Placeholder 0' }, { openPrefix: ' ' }) +\n\t\tel('p:cNvSpPr', null, raw(voidEl('a:spLocks', { noGrp: '1' })))\n\tstrSlideXml += el('p:nvPr', null, raw(voidEl('p:ph', { type: 'sldNum', sz: 'quarter', idx: '4294967295' })), {\n\t\topenPrefix: ' ',\n\t})\n\tstrSlideXml += ' </p:nvSpPr>'\n\tstrSlideXml += ' <p:spPr>'\n\tstrSlideXml +=\n\t\tel('a:xfrm', null, [\n\t\t\traw(\n\t\t\t\tvoidEl('a:off', {\n\t\t\t\t\tx: getSmartParseNumber(snProps.x, 'X', slide._presLayout),\n\t\t\t\t\ty: getSmartParseNumber(snProps.y, 'Y', slide._presLayout),\n\t\t\t\t})\n\t\t\t),\n\t\t\traw(\n\t\t\t\tvoidEl('a:ext', {\n\t\t\t\t\tcx: snProps.w ? getSmartParseNumber(snProps.w, 'X', slide._presLayout) : '800000',\n\t\t\t\t\tcy: snProps.h ? getSmartParseNumber(snProps.h, 'Y', slide._presLayout) : '300000',\n\t\t\t\t})\n\t\t\t),\n\t\t]) +\n\t\tel('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')), { openPrefix: ' ' }) +\n\t\tel(\n\t\t\t'a:extLst',\n\t\t\tnull,\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:ext',\n\t\t\t\t\t{ uri: '{C572A759-6A51-4108-AA02-DFA0A04FC94B}' },\n\t\t\t\t\traw(\n\t\t\t\t\t\tvoidEl('ma14:wrappingTextBoxFlag', {\n\t\t\t\t\t\t\tval: '0',\n\t\t\t\t\t\t\t'xmlns:ma14': 'http://schemas.microsoft.com/office/mac/drawingml/2011/main',\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t{ openPrefix: ' ' }\n\t\t) +\n\t\t'</p:spPr>'\n\tstrSlideXml += '<p:txBody>'\n\t// Margins are inches (see `marginToEmu`), matching text-box and cell margins.\n\t// NOTE: attribute ORDER is byte-significant, and note the margin order is lIns/tIns/rIns/bIns\n\t// while the source array is [Top, Right, Bottom, Left] — hence the 3/0/1/2 indexing.\n\tconst snMargin = snProps.margin\n\tconst snMarginAt = (arrIdx: number): number | null =>\n\t\tArray.isArray(snMargin)\n\t\t\t? marginToEmu(snMargin[arrIdx] || 0)\n\t\t\t: typeof snMargin === 'number'\n\t\t\t\t? marginToEmu(snMargin || 0)\n\t\t\t\t: null\n\tstrSlideXml += voidEl('a:bodyPr', {\n\t\tlIns: snMarginAt(3),\n\t\ttIns: snMarginAt(0),\n\t\trIns: snMarginAt(1),\n\t\tbIns: snMarginAt(2),\n\t\tanchor: snProps.valign ? snProps.valign.replace('top', 't').replace('middle', 'ctr').replace('bottom', 'b') : null,\n\t})\n\tlet defRPr = ''\n\tif (snProps.fontFace || snProps.fontSize || snProps.color) {\n\t\t// The typeface is caller-supplied via `slide.slideNumber({ fontFace })`; the element builder\n\t\t// escapes it, so a `\"`/`&` in the name cannot close the attribute early.\n\t\tconst face = snProps.fontFace\n\t\tdefRPr = el('a:defRPr', { sz: clampFontSizeSz(snProps.fontSize || 12) }, [\n\t\t\tsnProps.color ? raw(genXmlColorSelection(snProps.color)) : null,\n\t\t\tface ? raw(voidEl('a:latin', { typeface: face })) : null,\n\t\t\tface ? raw(voidEl('a:ea', { typeface: face })) : null,\n\t\t\tface ? raw(voidEl('a:cs', { typeface: face })) : null,\n\t\t])\n\t}\n\tstrSlideXml += el('a:lstStyle', null, raw(el('a:lvl1pPr', null, raw(defRPr))), { openPrefix: ' ' })\n\n\t// `align` is normalized to 'left' above when unset; anything not starting c/r falls back to 'l'.\n\t// `align` is defaulted to 'left' on the props object above; read it through a local so the\n\t// narrowing survives (the mutation is kept — other readers rely on it).\n\tconst snAlignRaw = snProps.align ?? 'left'\n\tconst snAlign = snAlignRaw.startsWith('c') ? 'ctr' : snAlignRaw.startsWith('r') ? 'r' : 'l'\n\tstrSlideXml += el('a:p', null, [\n\t\traw(voidEl('a:pPr', { algn: snAlign })),\n\t\traw(\n\t\t\tel('a:fld', { id: SLDNUMFLDID, type: 'slidenum' }, [\n\t\t\t\t// NOTE: `b` is emitted as \"0\" when unset, unlike the run properties elsewhere which omit it.\n\t\t\t\traw(voidEl('a:rPr', { b: snProps.bold ? 1 : 0, lang: 'en-US' })),\n\t\t\t\t// `<a:t>` inside an `a:fld` is the *cached* rendering of the field, so it is only a\n\t\t\t\t// slide number where there is a slide number to cache. A master has none\n\t\t\t\t// (`_slideNum` is null) and a layout carries the internal 1000+ counter, so this\n\t\t\t\t// used to ship `<a:t>null</a:t>` in every master and `<a:t>1004</a:t>` in a layout —\n\t\t\t\t// invisible in PowerPoint, which recomputes the field on open, but read straight\n\t\t\t\t// out by anything that takes the cache at face value (a text extractor, a search\n\t\t\t\t// indexer, this library's own read path). What PowerPoint itself caches on a master\n\t\t\t\t// or layout is the placeholder glyph, so emit that.\n\t\t\t\t//\n\t\t\t\t// The child must stay non-null: `el()` drops a null child entirely, and an `a:fld`\n\t\t\t\t// with no `a:t` is a different construct from one with placeholder text.\n\t\t\t\traw(el('a:t', null, hasRealSlideNumber(slide) ? String(slide._slideNum) : SLDNUM_PLACEHOLDER_TEXT)),\n\t\t\t])\n\t\t),\n\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' })),\n\t])\n\tstrSlideXml += '</p:txBody></p:sp>'\n\treturn strSlideXml\n}\n\n/**\n * Transforms a slide or slideLayout to resulting XML string - Creates `ppt/slide*.xml`\n * @param {PresSlideInternal|SlideLayoutInternal} slideObject - slide object created within createSlideObject\n * @return {string} XML string with <p:cSld> as the root\n */\nexport function slideObjectToXml(slide: PresSlideInternal | SlideLayoutInternal): string {\n\t// `_name` is escaped HERE, at emission, unlike `objectName`'s single-escape-upstream design\n\t// (see `cNvPrOpen`): `_name` doubles as the raw lookup key `addSlide({masterTitle})` matches\n\t// against the caller's `title` string (presentation.ts, `layout._name === masterTitle`), so it\n\t// must stay unescaped until the last possible moment or that match breaks for any title\n\t// containing `&`/`<`/`\"`. Plain slides' default `_name` (\"Slide N\", slide.ts) never contains\n\t// XML metacharacters, so escaping it here is a no-op for that path.\n\t// The element stays a template because it wraps the entire slide, built by append below.\n\tlet strSlideXml: string = slide._name ? '<p:cSld name=\"' + encodeXmlAttrValue(slide._name) + '\">' : '<p:cSld>'\n\n\twarnDuplicateObjectNames(slide)\n\n\t// STEP 1: Add the background, if this part defines one\n\tstrSlideXml += slideBackgroundXml(slide)\n\n\t// STEP 2: Continue slide by starting spTree node\n\tstrSlideXml += spTreeOpenXml()\n\n\t// Every object's <p:cNvPr> id, up front, for the references that cannot wait for the walk below\n\t// to reach their target (connector shape bindings, animation spids). `collectSlideShapeIds`\n\t// mirrors the allocation performed here — keep the two in step.\n\tconst shapeIds = collectSlideShapeIds(slide._slideObjects)\n\n\t// STEP 3: Loop over all Slide.data objects and add them to this slide.\n\t// Allocates <p:cNvPr id> values for group children, which are not in `slide._slideObjects`\n\t// and so cannot reuse the top-level `idx + 2` scheme without colliding. Seeded past the last\n\t// top-level object id so child ids stay unique slide-wide.\n\tlet childIdxAlloc = slide._slideObjects.length\n\n\t// Resolve an object's bounds in EMU. For an auto-sized group (a `group` object with no explicit\n\t// x/y/w/h) this recurses into `_groupObjects` and returns their bounding box — so a parent group\n\t// can size around a nested auto-sized child group. The group rendering below uses the same helper\n\t// for both a child's bounds and a group's own off/ext, keeping every level consistent.\n\tconst resolveObjBounds = (obj: SlideObject): { x: number; y: number; cx: number; cy: number } => {\n\t\tconst o = obj.options || {}\n\t\t// Shares `hasCompleteGroupFrame` with the group renderer below, so a partial frame resolves to\n\t\t// the same auto-bounds here (where a parent group sizes around this one) as it does there.\n\t\tif (obj._type === SlideObjectType.group && !hasCompleteGroupFrame(o)) {\n\t\t\tconst kids = (obj._groupObjects || []).map(resolveObjBounds)\n\t\t\tif (kids.length === 0) return { x: 0, y: 0, cx: 0, cy: 0 }\n\t\t\tconst minX = Math.min(...kids.map((b) => b.x))\n\t\t\tconst minY = Math.min(...kids.map((b) => b.y))\n\t\t\tconst maxX = Math.max(...kids.map((b) => b.x + b.cx))\n\t\t\tconst maxY = Math.max(...kids.map((b) => b.y + b.cy))\n\t\t\treturn { x: minX, y: minY, cx: maxX - minX, cy: maxY - minY }\n\t\t}\n\t\t// Normalized the same way the render path below normalizes its own box, so a child with a\n\t\t// negative extent contributes the box it will actually be emitted with — an un-normalized\n\t\t// `x + cx` would put the group's `maxX` *left* of its `minX` and size the group wrong.\n\t\tconst bx = normalizeAxisExtent(\n\t\t\ttypeof o.x !== 'undefined' ? getSmartParseNumber(o.x, 'X', slide._presLayout) : 0,\n\t\t\ttypeof o.w !== 'undefined' ? getSmartParseNumber(o.w, 'X', slide._presLayout) : 0\n\t\t)\n\t\tconst by = normalizeAxisExtent(\n\t\t\ttypeof o.y !== 'undefined' ? getSmartParseNumber(o.y, 'Y', slide._presLayout) : 0,\n\t\t\ttypeof o.h !== 'undefined' ? getSmartParseNumber(o.h, 'Y', slide._presLayout) : 0\n\t\t)\n\t\treturn { x: bx.off, y: by.off, cx: bx.ext, cy: by.ext }\n\t}\n\n\t// Render one slide object — and, for a group, its children recursively — to an XML fragment.\n\t// Closes over `slide` and `childIdxAlloc`. Uses a local\n\t// `strSlideXml` accumulator (shadowing the slide-level one) so the existing per-object\n\t// `strSlideXml +=` appends compose into the returned fragment unchanged.\n\tconst renderSlideObjectXml = (slideItemObj: SlideObject, idx: number): string => {\n\t\tlet strSlideXml = ''\n\t\tlet x = 0\n\t\tlet y = 0\n\t\t// Annotated `number` rather than inferring the branded `Emu` this initializer returns: `x`, `y`,\n\t\t// and `cy` are all plain numbers, every `render*Object` takes `number`, and normalization below\n\t\t// reassigns all four from one helper.\n\t\tlet cx: number = getSmartParseNumber('75%', 'X', slide._presLayout)\n\t\tlet cy = 0\n\t\tlet placeholderObj: SlideObject | null = null\n\t\tconst sizing: ObjectOptions['sizing'] = slideItemObj.options?.sizing\n\t\tconst rounding = slideItemObj.options?.rounding\n\n\t\tconst slideLayout = (slide as PresSlideInternal)._slideLayout\n\t\tconst wantedPlaceholder = slideItemObj.options?.placeholder\n\t\tif (slideLayout?._slideObjects !== undefined && wantedPlaceholder) {\n\t\t\tplaceholderObj =\n\t\t\t\tslideLayout._slideObjects.filter(\n\t\t\t\t\t(object: SlideObject) => object.options?.placeholder === wantedPlaceholder\n\t\t\t\t)[0] ?? null\n\t\t}\n\n\t\t// A: Set option vars\n\t\tslideItemObj.options = slideItemObj.options || {}\n\t\tconst itemOpts = slideItemObj.options\n\n\t\tif (typeof slideItemObj.options.x !== 'undefined')\n\t\t\tx = getSmartParseNumber(slideItemObj.options.x, 'X', slide._presLayout)\n\t\tif (typeof slideItemObj.options.y !== 'undefined')\n\t\t\ty = getSmartParseNumber(slideItemObj.options.y, 'Y', slide._presLayout)\n\t\tif (typeof slideItemObj.options.w !== 'undefined')\n\t\t\tcx = getSmartParseNumber(slideItemObj.options.w, 'X', slide._presLayout)\n\t\tif (typeof slideItemObj.options.h !== 'undefined')\n\t\t\tcy = getSmartParseNumber(slideItemObj.options.h, 'Y', slide._presLayout)\n\n\t\t// A negative `w`/`h` becomes a min-corner origin, an absolute extent, and a flip — never a\n\t\t// negative `<a:ext>`, which is out of range for `ST_PositiveCoordinate` and costs the whole\n\t\t// package (see `normalizeAxisExtent`). Done here, after every `Coord` form has resolved to EMU,\n\t\t// so `'-2in'` and `'-25%'` normalize alongside a plain negative number.\n\t\tconst normX = normalizeAxisExtent(x, cx)\n\t\tconst normY = normalizeAxisExtent(y, cy)\n\t\tx = normX.off\n\t\tcx = normX.ext\n\t\ty = normY.off\n\t\tcy = normY.ext\n\n\t\t// Set w/h now that smart parse is done\n\t\tconst imgWidth = cx\n\t\tconst imgHeight = cy\n\n\t\t// If using a placeholder then inherit it's position\n\t\tif (placeholderObj) {\n\t\t\tconst phOpts = placeholderObj.options ?? {}\n\t\t\tif (phOpts.x || phOpts.x === 0) x = getSmartParseNumber(phOpts.x, 'X', slide._presLayout)\n\t\t\tif (phOpts.y || phOpts.y === 0) y = getSmartParseNumber(phOpts.y, 'Y', slide._presLayout)\n\t\t\tif (phOpts.w || phOpts.w === 0) cx = getSmartParseNumber(phOpts.w, 'X', slide._presLayout)\n\t\t\tif (phOpts.h || phOpts.h === 0) cy = getSmartParseNumber(phOpts.h, 'Y', slide._presLayout)\n\t\t}\n\t\t// The `<a:xfrm>` placement attributes, shared by every shape kind that has a transform.\n\t\t// NOTE: order is byte-significant (flipH, flipV, rot), and `null` means omitted — `rotate: 0`\n\t\t// stays absent, matching the truthiness test this replaced.\n\t\t// A flip derived from a negative extent XORs with the author's own: `{ w: -2, flipH: true }`\n\t\t// is a box mirrored twice, i.e. not mirrored at all.\n\t\tconst locationAttrs: XmlAttrs = {\n\t\t\tflipH: Boolean(slideItemObj.options.flipH) !== normX.flip ? '1' : null,\n\t\t\tflipV: Boolean(slideItemObj.options.flipV) !== normY.flip ? '1' : null,\n\t\t\trot: slideItemObj.options.rotate ? convertRotationDegrees(slideItemObj.options.rotate) : null,\n\t\t}\n\n\t\t// B: Add OBJECT to the current Slide.\n\t\t// Each renderer below is called from here and nowhere else, so the options they need are\n\t\t// passed as `itemOpts` — already normalized, in step A above. Six of them used to take the\n\t\t// whole `slideItemObj` and re-run `options = options || {}` as their first statement, on an\n\t\t// argument their only caller had already fixed; that assignment existed to re-narrow the\n\t\t// type, and threading the narrowed value in does the same job without a mutation in the\n\t\t// middle of an emit pass. If one of them ever gains a second call site, normalizing is that\n\t\t// caller's job — a contract stated once at the boundary beats a defensive copy of it in\n\t\t// every callee. (`renderOleObject`, `renderZoomObject` and `renderModel3dObject` read no\n\t\t// options at all, which is why they take none.)\n\t\tswitch (slideItemObj._type) {\n\t\t\tcase SlideObjectType.table:\n\t\t\t\tstrSlideXml += renderTableObject(slideItemObj, idx, x, y, cx, cy, placeholderObj, itemOpts)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.text:\n\t\t\tcase SlideObjectType.placeholder:\n\t\t\t\tstrSlideXml += renderTextObject(slideItemObj, idx, slide, x, y, cx, cy, placeholderObj, locationAttrs, itemOpts)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.connector:\n\t\t\t\tstrSlideXml += renderConnectorObject(slideItemObj, idx, x, y, cx, cy, locationAttrs, shapeIds, itemOpts)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.image:\n\t\t\t\tstrSlideXml += renderImageObject(\n\t\t\t\t\tslideItemObj,\n\t\t\t\t\tidx,\n\t\t\t\t\tslide,\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\tcx,\n\t\t\t\t\tcy,\n\t\t\t\t\timgWidth,\n\t\t\t\t\timgHeight,\n\t\t\t\t\tplaceholderObj,\n\t\t\t\t\tlocationAttrs,\n\t\t\t\t\tsizing,\n\t\t\t\t\trounding,\n\t\t\t\t\titemOpts\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.media:\n\t\t\t\tstrSlideXml += renderMediaObject(slideItemObj, idx, x, y, cx, cy, locationAttrs, itemOpts)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.chart:\n\t\t\t\tstrSlideXml += renderChartObject(slideItemObj, idx, x, y, cx, cy, placeholderObj, itemOpts)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.oleObject:\n\t\t\t\tstrSlideXml += renderOleObject(slideItemObj, idx, x, y, cx, cy)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.zoom:\n\t\t\t\tstrSlideXml += renderZoomObject(slideItemObj, idx, x, y, cx, cy)\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.model3d:\n\t\t\t\tstrSlideXml += renderModel3dObject(slideItemObj, idx, x, y, cx, cy)\n\t\t\t\tbreak\n\n\t\t\tcase SlideObjectType.group: {\n\t\t\t\tconst groupChildren = slideItemObj._groupObjects || []\n\n\t\t\t\t// Render children (recursively for nested groups). Each child gets a unique id via\n\t\t\t\t// `childIdxAlloc` (children are not in `_slideObjects`); the shared counter keeps ids\n\t\t\t\t// collision-free across nesting depth.\n\t\t\t\tlet innerXml = ''\n\t\t\t\tgroupChildren.forEach((child) => {\n\t\t\t\t\tchild.options = child.options || {}\n\t\t\t\t\tinnerXml += renderSlideObjectXml(child, childIdxAlloc++)\n\t\t\t\t})\n\n\t\t\t\t// Identity child coordinate space (chOff/chExt == off/ext) at every depth, so children\n\t\t\t\t// keep their slide-absolute coordinates. Use explicit x/y/w/h when all four are given,\n\t\t\t\t// else the bounding box of the children (recursing into nested auto-sized groups).\n\t\t\t\t// A partial frame warns and falls back whole rather than letting the unset axes take the\n\t\t\t\t// per-object defaults above (`cy` = 0 among them) and emit a degenerate group.\n\t\t\t\tconst givenAxes = givenGroupFrameAxes(slideItemObj.options)\n\t\t\t\tif (givenAxes.length > 0 && givenAxes.length < GROUP_FRAME_AXES.length) {\n\t\t\t\t\tconst missingAxes = GROUP_FRAME_AXES.filter((axis) => !givenAxes.includes(axis))\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'group/partial-frame',\n\t\t\t\t\t\t`addGroup: group \"${slideItemObj.options.objectName ?? ''}\" has a partial frame (${givenAxes.join('/')} given, ${missingAxes.join('/')} missing); using auto-bounds (the bounding box of its children) instead. Pass all of x/y/w/h, or none.`\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst gb = hasCompleteGroupFrame(slideItemObj.options) ? { x, y, cx, cy } : resolveObjBounds(slideItemObj)\n\t\t\t\tconst gx: number = gb.x\n\t\t\t\tconst gy: number = gb.y\n\t\t\t\tconst gcx: number = gb.cx\n\t\t\t\tconst gcy: number = gb.cy\n\n\t\t\t\tconst grpLockXml = genXmlObjectLock(\n\t\t\t\t\t'a:grpSpLocks',\n\t\t\t\t\tGROUP_SHAPE_LOCK_ATTRS,\n\t\t\t\t\tslideItemObj.options.objectLock,\n\t\t\t\t\tslideItemObj.options.objectName\n\t\t\t\t)\n\t\t\t\tstrSlideXml += '<p:grpSp>'\n\t\t\t\tstrSlideXml += el('p:nvGrpSpPr', null, [\n\t\t\t\t\traw(cNvPrOpen(idx + 2, slideItemObj.options.objectName, slideItemObj.options.altText || '') + '/>'),\n\t\t\t\t\t// Paired only when there are locks to carry; otherwise self-closing.\n\t\t\t\t\traw(grpLockXml ? el('p:cNvGrpSpPr', null, raw(grpLockXml)) : voidEl('p:cNvGrpSpPr')),\n\t\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t\t])\n\t\t\t\tstrSlideXml += el(\n\t\t\t\t\t'p:grpSpPr',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('a:xfrm', locationAttrs, [\n\t\t\t\t\t\t\traw(voidEl('a:off', { x: gx, y: gy })),\n\t\t\t\t\t\t\traw(voidEl('a:ext', { cx: gcx, cy: gcy })),\n\t\t\t\t\t\t\traw(voidEl('a:chOff', { x: gx, y: gy })),\n\t\t\t\t\t\t\traw(voidEl('a:chExt', { cx: gcx, cy: gcy })),\n\t\t\t\t\t\t])\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\tstrSlideXml += innerXml\n\t\t\t\tstrSlideXml += '</p:grpSp>'\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// The four `SlideObjectType` members that are not slide shapes, spelled out so adding a\n\t\t\t// member to the enum fails to compile here rather than silently emitting nothing.\n\t\t\tcase SlideObjectType.notes:\n\t\t\t\t// Speaker notes live in `_slideObjects` but belong to the notes part, which\n\t\t\t\t// `gen/slide/notes.ts` builds from the same entry. Emitting nothing here is\n\t\t\t\t// load-bearing, not a gap.\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.tablecell:\n\t\t\t\t// Rendered by its owning table, through `renderTableObject` above.\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.hyperlink:\n\t\t\t\t// A relationship type, not a shape — it reaches the shape tree only as the `a:hlinkClick`\n\t\t\t\t// carried by whatever shape owns the link.\n\t\t\t\tbreak\n\t\t\tcase SlideObjectType.online:\n\t\t\t\t// Unused anywhere in `src/`; online video is `SlideObjectType.media` with `mtype: 'online'`.\n\t\t\t\tbreak\n\t\t\tdefault: {\n\t\t\t\t// Compile-time only: with every member routed above, this arm's type is `never`, so a new\n\t\t\t\t// `SlideObjectType` fails to typecheck here until it is either rendered or listed as one\n\t\t\t\t// of the non-shape members. Nothing is emitted, which is what the old bare default did.\n\t\t\t\tconst unrouted: never = slideItemObj._type\n\t\t\t\tvoid unrouted\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn strSlideXml\n\t}\n\n\tslide._slideObjects.forEach((slideItemObj: SlideObject, idx: number) => {\n\t\tstrSlideXml += renderSlideObjectXml(slideItemObj, idx)\n\t})\n\n\t// STEP 4: Add slide numbers (if any) last.\n\t// The id comes from the same monotonic counter as every other shape on the slide (top-level\n\t// objects took `idx + 2`; group children advanced `childIdxAlloc` past that). A hardcoded id\n\t// here (formerly 25) aliases a shape or group-child id once a slide holds enough objects — a\n\t// duplicate `<p:cNvPr>` id PowerPoint repairs — so take the next free slot instead. Allocated\n\t// here rather than inside the emitter so a part with no slide number does not consume an id.\n\tif (slide._slideNumberProps)\n\t\tstrSlideXml += slideNumberPlaceholderXml(slide, slide._slideNumberProps, childIdxAlloc++ + 2)\n\n\t// STEP 5: Close spTree and finalize slide XML\n\tstrSlideXml += '</p:spTree>'\n\tstrSlideXml += '</p:cSld>'\n\n\t// LAST: Return\n\treturn strSlideXml\n}\n\n/**\n * Transforms slide relations to XML string.\n * Extra relations that are not dynamic can be passed using the 2nd arg (e.g. theme relation in master file).\n * These relations use rId series that starts with 1-increased maximum of rIds used for dynamic relations.\n * @param {PresSlideInternal | SlideLayoutInternal} slide - slide object whose relations are being transformed\n * @param {{ target: string; type: string }[]} defaultRels - array of default relations\n * @return {string} XML\n */\nexport function slideObjectRelationsToXml(\n\tslide: PresSlideInternal | SlideLayoutInternal,\n\tdefaultRels: Array<{ target: string; type: string }>\n): string {\n\tlet lastRid = 0 // stores maximum rId used for dynamic relations\n\tconst rels: string[] = []\n\n\t/**\n\t * Has a rel with this Target already been emitted? Media items produce *TWO* rels\n\t * sharing one Target, and the second is told from the first by the Target already\n\t * being present. `target` must therefore be the ESCAPED form — what actually got\n\t * written — or an online-video link carrying `&` never matches its own first rel\n\t * and the pair is mistyped (media emitted as video). See `SlideRel.Target`.\n\t */\n\tconst hasTarget = (target: string): boolean => rels.some((xml) => xml.includes(` Target=\"${target}\"`))\n\n\t// STEP 1: Add all rels for this Slide\n\tslide._rels.forEach((rel: SlideRel) => {\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\tif (isHyperlinkRel(rel)) {\n\t\t\tif (rel.data === 'slide') {\n\t\t\t\trels.push(\n\t\t\t\t\tvoidEl('Relationship', { Id: `rId${rel.rId}`, Type: OFFICE_REL + 'slide', Target: `slide${rel.Target}.xml` })\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\trels.push(externalHyperlinkRel(rel.rId, rel.Target))\n\t\t\t}\n\t\t}\n\t\t// NOTE: there is no `else` here on purpose. `_rels` only ever holds hyperlinks —\n\t\t// it is initialized empty (`slide.ts`) and the three sites that append to it\n\t\t// (`define/hyperlinks.ts` ×2, `define/image.ts`) all push `SlideObjectType.hyperlink`.\n\t\t// The notesSlide rel every slide needs comes from `defaultRels` in `makeXmlSlideRel`.\n\t})\n\t;(slide._relsChart || []).forEach((rel: SlideRelChart) => {\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\t// chartEx parts use the MS chartEx rel type; classic charts use the ECMA `chart` rel.\n\t\trels.push(\n\t\t\tvoidEl('Relationship', {\n\t\t\t\tId: `rId${rel.rId}`,\n\t\t\t\tType: rel.isChartEx ? CHARTEX_REL : OFFICE_REL + 'chart',\n\t\t\t\tTarget: rel.Target,\n\t\t\t})\n\t\t)\n\t})\n\t;(slide._relsMedia || []).forEach((rel: SlideRelMedia) => {\n\t\tconst relType = rel.type.toLowerCase()\n\t\t// `voidEl` escapes the Target on the way out; the probe has to compare against\n\t\t// those emitted bytes, so it needs the escaped form computed separately here —\n\t\t// with the SAME escaper the builder uses, or the two drift apart.\n\t\tconst relTarget = encodeXmlAttrValue(rel.Target)\n\t\tconst media = (type: string, targetMode?: string): string =>\n\t\t\tvoidEl('Relationship', { Id: `rId${rel.rId}`, Type: type, Target: rel.Target, TargetMode: targetMode })\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\tif (rel.oleRelType) {\n\t\t\t// An OLE payload part carries its rel type verbatim (`.../package` or `.../oleObject`);\n\t\t\t// its `type` is the part's content type, which the sniffing below would misread.\n\t\t\trels.push(media(rel.oleRelType))\n\t\t} else if (rel.model3dRelType) {\n\t\t\t// Likewise a 3D model payload: its content type is `model/gltf.binary`, which matches none\n\t\t\t// of the sniffs below — and they have no `else`, so without this branch the rel would be\n\t\t\t// silently dropped and the slide would carry a dangling `r:embed`.\n\t\t\trels.push(media(rel.model3dRelType))\n\t\t} else if (relType.includes('image')) {\n\t\t\trels.push(media(OFFICE_REL + 'image'))\n\t\t} else if (relType.includes('audio')) {\n\t\t\trels.push(hasTarget(relTarget) ? media(MS_MEDIA_REL) : media(OFFICE_REL + 'audio'))\n\t\t} else if (relType.includes('video')) {\n\t\t\trels.push(hasTarget(relTarget) ? media(MS_MEDIA_REL) : media(OFFICE_REL + 'video'))\n\t\t} else if (relType.includes('online')) {\n\t\t\t// Online video has *TWO* external rels sharing the link Target: the ECMA video\n\t\t\t// rel (first) and the MS-2007 media rel (second). Both TargetMode=\"External\",\n\t\t\t// no media binary part.\n\t\t\trels.push(hasTarget(relTarget) ? media(MS_MEDIA_REL, 'External') : media(OFFICE_REL + 'video', 'External'))\n\t\t}\n\t})\n\n\t// STEP 2: Add default rels\n\tdefaultRels.forEach((rel, idx) => {\n\t\trels.push(voidEl('Relationship', { Id: `rId${lastRid + idx + 1}`, Type: rel.type, Target: rel.target }))\n\t})\n\n\treturn XML_DECL + CRLF + el('Relationships', { xmlns: PACKAGE_REL_NS }, rels.map(raw))\n}\n","/**\n * ts-pptx: slide part + slide/layout rels\n *\n * Emit a slide (`ppt/slides/slideN.xml`) and the relationship files for slides\n * and layouts (`slideN.xml.rels`, `slideLayoutN.xml.rels`).\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { PresSlideInternal, SlideLayoutInternal } from '../../types/internal.js'\nimport { slideTimingToXml } from '../anim/timing.js'\nimport { slideTransitionToXml } from '../anim/transition.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { slideObjectRelationsToXml, slideObjectToXml } from './object.js'\nimport { InternalError } from '../../errors.js'\nimport { PML_ROOT_NS } from '../../ooxml/namespaces.js'\n\n/**\n * Generates XML for the slide file (`ppt/slides/slide1.xml`)\n * @param {PresSlideInternal} slide - the slide object to transform into XML\n * @return {string} XML\n */\nexport function makeXmlSlide(slide: PresSlideInternal): string {\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:sld',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t\tshow: slide?.hidden ? '0' : null,\n\t\t\t},\n\t\t\t[\n\t\t\t\traw(slideObjectToXml(slide)),\n\t\t\t\traw(el('p:clrMapOvr', null, raw(voidEl('a:masterClrMapping')))),\n\t\t\t\traw(slideTransitionToXml(slide)),\n\t\t\t\traw(slideTimingToXml(slide)),\n\t\t\t]\n\t\t)\n\t)\n}\n\n/**\n * Generates XML string for a slide layout relation file\n * @param {number} layoutNumber - 1-indexed number of a layout that relations are generated for\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layouts\n * @return {string} XML\n */\nexport function makeXmlSlideLayoutRel(layoutNumber: number, slideLayouts: SlideLayoutInternal[]): string {\n\tconst slideLayout = slideLayouts[layoutNumber - 1]\n\tif (!slideLayout)\n\t\tthrow new InternalError(\n\t\t\t'slide/rel-index-out-of-range',\n\t\t\t`makeXmlSlideLayoutRel: no slide layout at index ${layoutNumber - 1}`\n\t\t)\n\treturn slideObjectRelationsToXml(slideLayout, [\n\t\t{\n\t\t\ttarget: '../slideMasters/slideMaster1.xml',\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster',\n\t\t},\n\t])\n}\n\n/**\n * Creates `ppt/_rels/slide*.xml.rels`\n * @param {PresSlideInternal[]} slides\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layout(s)\n * @param {number} `slideNumber` 1-indexed number of a layout that relations are generated for\n * @return {string} XML\n */\nexport function makeXmlSlideRel(\n\tslides: PresSlideInternal[],\n\tslideLayouts: SlideLayoutInternal[],\n\tslideNumber: number\n): string {\n\tconst slide = slides[slideNumber - 1]\n\tif (!slide)\n\t\tthrow new InternalError('slide/rel-index-out-of-range', `makeXmlSlideRel: no slide at index ${slideNumber - 1}`)\n\tconst defaultRels = [\n\t\t{\n\t\t\ttarget: `../slideLayouts/slideLayout${getLayoutIdxForSlide(slides, slideLayouts, slideNumber)}.xml`,\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout',\n\t\t},\n\t\t{\n\t\t\ttarget: `../notesSlides/notesSlide${slideNumber}.xml`,\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide',\n\t\t},\n\t]\n\t// Only emit the comments rel for slides that actually carry comments (the comment part\n\t// is likewise only written for those slides); the rId is assigned after slideLayout/notesSlide.\n\tif ((slide._comments || []).length > 0) {\n\t\tdefaultRels.push({\n\t\t\ttarget: `../comments/comment${slideNumber}.xml`,\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments',\n\t\t})\n\t}\n\treturn slideObjectRelationsToXml(slide, defaultRels)\n}\n\n/**\n * For the passed slide number, resolves name of a layout that is used for.\n * @param {PresSlideInternal[]} slides - srray of slides\n * @param {SlideLayoutInternal[]} slideLayouts - array of slideLayouts\n * @param {number} slideNumber\n * @return {number} slide number\n */\nfunction getLayoutIdxForSlide(\n\tslides: PresSlideInternal[],\n\tslideLayouts: SlideLayoutInternal[],\n\tslideNumber: number\n): number {\n\tfor (let i = 0; i < slideLayouts.length; i++) {\n\t\tif (slideLayouts[i]?._name === slides[slideNumber - 1]?._slideLayout?._name) {\n\t\t\treturn i + 1\n\t\t}\n\t}\n\n\t// IMPORTANT: Return 1 (for `slideLayout1.xml`) when no def is found\n\t// So all objects are in Layout1 and every slide that references it uses this layout.\n\treturn 1\n}\n","/**\n * ts-pptx: `ppt/theme/theme1.xml`\n *\n * Emit the Office theme: the `<a:clrScheme>` (with any caller color overrides\n * over the default Office scheme) plus the fixed font/format schemes.\n */\n\nimport { REGEX_HEX_COLOR, XML_DECL } from '../../constants-internal.js'\nimport type { ThemeColorScheme } from '../../types/index.js'\nimport type { PresentationPropsInternal } from '../../types/internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { el, raw, voidEl, type RawXml } from '../oxml/el.js'\nimport { OOXML_NS } from '../../ooxml/namespaces.js'\n\n/**\n * Theme `<a:clrScheme>` slots in OOXML document order, with their default Office color child.\n * `dk1`/`lt1` default to `sysClr` (windowText/window); the rest are `srgbClr`. A user override\n * for any slot is emitted as `<a:srgbClr>` (see `buildThemeClrScheme`).\n */\nconst THEME_CLR_SCHEME_DEFAULTS: ReadonlyArray<[keyof ThemeColorScheme, RawXml]> = [\n\t['dk1', raw(voidEl('a:sysClr', { val: 'windowText', lastClr: '000000' }))],\n\t['lt1', raw(voidEl('a:sysClr', { val: 'window', lastClr: 'FFFFFF' }))],\n\t['dk2', raw(voidEl('a:srgbClr', { val: '44546A' }))],\n\t['lt2', raw(voidEl('a:srgbClr', { val: 'E7E6E6' }))],\n\t['accent1', raw(voidEl('a:srgbClr', { val: '4472C4' }))],\n\t['accent2', raw(voidEl('a:srgbClr', { val: 'ED7D31' }))],\n\t['accent3', raw(voidEl('a:srgbClr', { val: 'A5A5A5' }))],\n\t['accent4', raw(voidEl('a:srgbClr', { val: 'FFC000' }))],\n\t['accent5', raw(voidEl('a:srgbClr', { val: '5B9BD5' }))],\n\t['accent6', raw(voidEl('a:srgbClr', { val: '70AD47' }))],\n\t['hlink', raw(voidEl('a:srgbClr', { val: '0563C1' }))],\n\t['folHlink', raw(voidEl('a:srgbClr', { val: '954F72' }))],\n]\n\n/**\n * Build the theme `<a:clrScheme>` block, applying any caller-supplied color overrides over the\n * default Office scheme. Invalid (non 6-digit-hex) overrides warn and keep the default rather\n * than emitting a degenerate color.\n * @param {ThemeColorScheme} [scheme] - per-slot hex overrides\n * @return {string} the `<a:clrScheme>...</a:clrScheme>` XML\n */\nfunction buildThemeClrScheme(scheme?: ThemeColorScheme): string {\n\treturn el(\n\t\t'a:clrScheme',\n\t\t{ name: 'Office' },\n\t\tTHEME_CLR_SCHEME_DEFAULTS.map(([slot, defaultChild]) => {\n\t\t\tconst override = scheme?.[slot]\n\t\t\tlet child = defaultChild\n\t\t\tif (typeof override === 'string' && override.length > 0) {\n\t\t\t\tconst hex = override.replace('#', '')\n\t\t\t\tif (REGEX_HEX_COLOR.test(hex)) child = raw(voidEl('a:srgbClr', { val: hex.toUpperCase() }))\n\t\t\t\telse\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'theme/invalid-color-override',\n\t\t\t\t\t\t`makeXmlTheme: colorScheme.${slot} \"${override}\" is not a 6-digit hex color; keeping the Office default.`\n\t\t\t\t\t)\n\t\t\t}\n\t\t\treturn raw(el(`a:${slot}`, null, child))\n\t\t})\n\t)\n}\n\n/**\n * The per-script theme font fallback table (`a:fontScheme`'s CT_TextFont lists), in OOXML\n * document order. Static Office defaults — no caller data, no escaping risk — unlike the\n * `<a:latin>`/`<a:ea>`/`<a:cs>` slots above.\n *\n * Forty-one of the forty-seven scripts take the same face in the major and minor lists, so the\n * shared table below is the whole thing and the two override maps hold the six-odd rows that\n * actually differ. Written out twice, ninety-four lines said less than these do, and one row\n * mistyped in one copy produces a theme that opens fine and paints a script in the wrong face —\n * a difference nobody reviewing a diff of two 47-row tables would see.\n */\nconst THEME_FONT_LIST: ReadonlyArray<readonly [string, string]> = [\n\t['Jpan', '游ゴシック'],\n\t['Hang', '맑은 고딕'],\n\t['Hans', '等线'],\n\t['Hant', '新細明體'],\n\t['Arab', 'Arial'],\n\t['Hebr', 'Arial'],\n\t['Thai', 'Cordia New'],\n\t['Ethi', 'Nyala'],\n\t['Beng', 'Vrinda'],\n\t['Gujr', 'Shruti'],\n\t['Khmr', 'DaunPenh'],\n\t['Knda', 'Tunga'],\n\t['Guru', 'Raavi'],\n\t['Cans', 'Euphemia'],\n\t['Cher', 'Plantagenet Cherokee'],\n\t['Yiii', 'Microsoft Yi Baiti'],\n\t['Tibt', 'Microsoft Himalaya'],\n\t['Thaa', 'MV Boli'],\n\t['Deva', 'Mangal'],\n\t['Telu', 'Gautami'],\n\t['Taml', 'Latha'],\n\t['Syrc', 'Estrangelo Edessa'],\n\t['Orya', 'Kalinga'],\n\t['Mlym', 'Kartika'],\n\t['Laoo', 'DokChampa'],\n\t['Sinh', 'Iskoola Pota'],\n\t['Mong', 'Mongolian Baiti'],\n\t['Viet', 'Arial'],\n\t['Uigh', 'Microsoft Uighur'],\n\t['Geor', 'Sylfaen'],\n\t['Armn', 'Arial'],\n\t['Bugi', 'Leelawadee UI'],\n\t['Bopo', 'Microsoft JhengHei'],\n\t['Java', 'Javanese Text'],\n\t['Lisu', 'Segoe UI'],\n\t['Mymr', 'Myanmar Text'],\n\t['Nkoo', 'Ebrima'],\n\t['Olck', 'Nirmala UI'],\n\t['Osma', 'Ebrima'],\n\t['Phag', 'Phagspa'],\n\t['Syrn', 'Estrangelo Edessa'],\n\t['Syrj', 'Estrangelo Edessa'],\n\t['Syre', 'Estrangelo Edessa'],\n\t['Sora', 'Nirmala UI'],\n\t['Tale', 'Microsoft Tai Le'],\n\t['Talu', 'Microsoft New Tai Lue'],\n\t['Tfng', 'Ebrima'],\n]\n\n/**\n * The seven scripts whose *heading* face differs from the body one. Latin and CJK headings take\n * the Light weight; the scripts with no Light cut take a serif (or, for Khmer, a different face\n * entirely) where the body takes a sans. Every other script in {@link THEME_FONT_LIST} uses one\n * face for both.\n */\nconst MAJOR_FONT_OVERRIDES: Readonly<Record<string, string>> = {\n\tJpan: '游ゴシック Light',\n\tHans: '等线 Light',\n\tArab: 'Times New Roman',\n\tHebr: 'Times New Roman',\n\tThai: 'Angsana New',\n\tKhmr: 'MoolBoran',\n\tViet: 'Times New Roman',\n}\n\n/** The major (heading) and minor (body) lists, both derived from the one table. */\nconst MAJOR_FONT_LIST: ReadonlyArray<readonly [string, string]> = THEME_FONT_LIST.map(\n\t([script, face]) => [script, MAJOR_FONT_OVERRIDES[script] ?? face] as const\n)\nconst MINOR_FONT_LIST = THEME_FONT_LIST\n\nfunction fontListChildren(scriptFaces: ReadonlyArray<readonly [string, string]>): RawXml[] {\n\treturn scriptFaces.map(([script, typeface]) => raw(voidEl('a:font', { script, typeface })))\n}\n\n// `<a:fmtScheme>` — fill/line/effect/background style matrices referenced by shape style indices\n// (`<p:style>`). Fixed Office boilerplate: no caller data reaches this block, so — unlike the\n// `<a:clrScheme>`/`<a:fontScheme>` blocks above — there is no escaping risk to centralize by\n// rebuilding it node-by-node. Kept as a raw literal (see app.ts for the same reasoning) rather than\n// hand-transcribed into ~90 nested el()/voidEl() calls purely for uniformity.\nconst FMT_SCHEME_XML =\n\t'<a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme>'\n\n/**\n * Creates `ppt/theme/theme1.xml`\n * @return {string} XML\n */\nexport function makeXmlTheme(pres: PresentationPropsInternal): string {\n\t// Theme font faces are caller-supplied strings (`ThemeProps`). el()'s attrs escape by\n\t// construction: an unescaped `\"` or `&` in a font name would close the attribute early and\n\t// emit non-parseable `theme1.xml`, which PowerPoint reports as a file needing repair.\n\tconst majorLatin = pres.theme?.headFontFace\n\t\t? raw(voidEl('a:latin', { typeface: pres.theme.headFontFace }))\n\t\t: raw(voidEl('a:latin', { typeface: 'Calibri Light', panose: '020F0302020204030204' }))\n\tconst minorLatin = pres.theme?.bodyFontFace\n\t\t? raw(voidEl('a:latin', { typeface: pres.theme.bodyFontFace }))\n\t\t: raw(voidEl('a:latin', { typeface: 'Calibri', panose: '020F0502020204030204' }))\n\t// East Asian (`<a:ea>`) and complex-script (`<a:cs>`) theme font slots. PowerPoint emits these\n\t// empty by default and resolves per-script via the `<a:font>` list that follows; setting them\n\t// lets CJK / complex-script runs fall back to a caller-chosen theme font.\n\tconst majorEa = raw(voidEl('a:ea', { typeface: pres.theme?.headFontFaceEA ?? '' }))\n\tconst minorEa = raw(voidEl('a:ea', { typeface: pres.theme?.bodyFontFaceEA ?? '' }))\n\tconst majorCs = raw(voidEl('a:cs', { typeface: pres.theme?.headFontFaceCS ?? '' }))\n\tconst minorCs = raw(voidEl('a:cs', { typeface: pres.theme?.bodyFontFaceCS ?? '' }))\n\n\tconst fontScheme = el('a:fontScheme', { name: 'Office' }, [\n\t\traw(el('a:majorFont', null, [majorLatin, majorEa, majorCs, ...fontListChildren(MAJOR_FONT_LIST)])),\n\t\traw(el('a:minorFont', null, [minorLatin, minorEa, minorCs, ...fontListChildren(MINOR_FONT_LIST)])),\n\t])\n\n\tconst themeElements = el('a:themeElements', null, [\n\t\traw(buildThemeClrScheme(pres.theme?.colorScheme)),\n\t\traw(fontScheme),\n\t\traw(FMT_SCHEME_XML),\n\t])\n\n\tconst extLst = el(\n\t\t'a:extLst',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'a:ext',\n\t\t\t\t{ uri: '{05A4C25C-085E-4340-85A3-A5531E510DB2}' },\n\t\t\t\traw(\n\t\t\t\t\tvoidEl('thm15:themeFamily', {\n\t\t\t\t\t\t'xmlns:thm15': 'http://schemas.microsoft.com/office/thememl/2012/main',\n\t\t\t\t\t\tname: 'Office Theme',\n\t\t\t\t\t\tid: '{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}',\n\t\t\t\t\t\tvid: '{4A3C46E8-61CC-4603-A589-7422A47A8E4A}',\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n\n\treturn (\n\t\tXML_DECL +\n\t\tel('a:theme', { 'xmlns:a': OOXML_NS.a, name: 'Office Theme' }, [\n\t\t\traw(themeElements),\n\t\t\traw(voidEl('a:objectDefaults')),\n\t\t\traw(voidEl('a:extraClrSchemeLst')),\n\t\t\traw(extLst),\n\t\t])\n\t)\n}\n","/**\n * ts-pptx: `docProps/app.xml`\n *\n * Emit the extended-properties part (application, slide/notes counts, heading\n * pairs, titles of parts, company).\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { el, raw } from '../oxml/el.js'\n\n/** This part is pretty-printed, one element per line, at three nesting depths. */\nconst INDENT_1 = '\\n\\t'\nconst INDENT_2 = '\\n\\t\\t'\nconst INDENT_3 = '\\n\\t\\t\\t'\nconst PROP = { openPrefix: INDENT_1 }\nconst VECTOR = { openPrefix: INDENT_2, closePrefix: INDENT_2 }\nconst ITEM = { openPrefix: INDENT_3 }\n\nconst NS = {\n\txmlns: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',\n\t'xmlns:vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n}\n\n/** One `<vt:variant>` of a heading pair: the section's name, then its count. */\nfunction headingPair(name: string, count: number): string[] {\n\treturn [\n\t\tel('vt:variant', null, raw(el('vt:lpstr', null, name)), ITEM),\n\t\tel('vt:variant', null, raw(el('vt:i4', null, count)), ITEM),\n\t]\n}\n\n/**\n * Creates `docProps/app.xml`\n * @param {PresSlideInternal[]} slides - Presenation Slides\n * @param {string} company - \"Company\" metadata\n * @returns XML\n */\nexport function makeXmlApp(slides: PresSlideInternal[], company: string): string {\n\tconst headingPairs = el(\n\t\t'vt:vector',\n\t\t{ size: 6, baseType: 'variant' },\n\t\t[...headingPair('Fonts Used', 2), ...headingPair('Theme', 1), ...headingPair('Slide Titles', slides.length)].map(\n\t\t\traw\n\t\t),\n\t\tVECTOR\n\t)\n\n\tconst titlesOfParts = el(\n\t\t'vt:vector',\n\t\t{ size: slides.length + 1 + 2, baseType: 'lpstr' },\n\t\t[\n\t\t\traw(el('vt:lpstr', null, 'Arial', ITEM)),\n\t\t\traw(el('vt:lpstr', null, 'Calibri', ITEM)),\n\t\t\traw(el('vt:lpstr', null, 'Office Theme', ITEM)),\n\t\t\t// The slide titles share one line, so the indent is emitted once — and it is\n\t\t\t// emitted whether or not there are any titles to follow it.\n\t\t\traw(INDENT_3),\n\t\t\t...slides.map((_slideObj, idx) => raw(el('vt:lpstr', null, `Slide ${idx + 1}`))),\n\t\t],\n\t\tVECTOR\n\t)\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'Properties',\n\t\t\tNS,\n\t\t\t[\n\t\t\t\traw(el('TotalTime', null, 0, PROP)),\n\t\t\t\traw(el('Words', null, 0, PROP)),\n\t\t\t\traw(el('Application', null, 'Microsoft Office PowerPoint', PROP)),\n\t\t\t\traw(el('PresentationFormat', null, 'On-screen Show (16:9)', PROP)),\n\t\t\t\traw(el('Paragraphs', null, 0, PROP)),\n\t\t\t\traw(el('Slides', null, slides.length, PROP)),\n\t\t\t\traw(el('Notes', null, slides.length, PROP)),\n\t\t\t\traw(el('HiddenSlides', null, 0, PROP)),\n\t\t\t\traw(el('MMClips', null, 0, PROP)),\n\t\t\t\traw(el('ScaleCrop', null, 'false', PROP)),\n\t\t\t\traw(el('HeadingPairs', null, raw(headingPairs), { ...PROP, closePrefix: INDENT_1 })),\n\t\t\t\traw(el('TitlesOfParts', null, raw(titlesOfParts), { ...PROP, closePrefix: INDENT_1 })),\n\t\t\t\traw(el('Company', null, company, PROP)),\n\t\t\t\traw(el('LinksUpToDate', null, 'false', PROP)),\n\t\t\t\traw(el('SharedDoc', null, 'false', PROP)),\n\t\t\t\traw(el('HyperlinksChanged', null, 'false', PROP)),\n\t\t\t\traw(el('AppVersion', null, '16.0000', PROP)),\n\t\t\t],\n\t\t\t{ closePrefix: INDENT_1 }\n\t\t)\n\t)\n}\n","/**\n * ts-pptx: `[Content_Types].xml`\n *\n * Emit the package content-types part: Default entries for the media extensions\n * actually used by the deck (plus xlsx/font defaults when present) and Override\n * entries for every written part.\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { PresSlideInternal, SlideLayoutInternal, SlideRelChart, SlideRelMedia } from '../../types/internal.js'\nimport { avContentType } from '../../media/content-type.js'\nimport { type EmbeddedFont, FONT_DATA_CONTENT_TYPE, FONT_DATA_EXTENSION } from '../../embedded-fonts.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\n\n/** Content-type prefixes; spelled out per part below so each entry stays greppable by its suffix. */\nconst OD = 'application/vnd.openxmlformats-officedocument.'\nconst PKG = 'application/vnd.openxmlformats-package.'\nconst CT_CHART = OD + 'drawingml.chart+xml'\n// chartEx (cx:) parts use Microsoft content types, NOT the `OD` (openxmlformats) prefix. Each\n// chartEx chart part also requires a chart-style + color-style sidecar part.\nconst CT_CHARTEX = 'application/vnd.ms-office.chartex+xml'\nconst CT_CHARTEX_STYLE = 'application/vnd.ms-office.chartstyle+xml'\nconst CT_CHARTEX_COLORS = 'application/vnd.ms-office.chartcolorstyle+xml'\nconst CT_THEME = OD + 'theme+xml'\n\n/**\n * Some Override entries have always been emitted with a leading space. It is insignificant\n * whitespace, but it is in the bytes this library has shipped for years, so it is reproduced\n * verbatim rather than normalized (see AGENTS.md \"Verification\": whitespace diffs are a STOP).\n */\nconst LEADING_SPACE = { openPrefix: ' ' }\n\nfunction contentDefault(extension: string, contentType: string): string {\n\treturn voidEl('Default', { Extension: extension, ContentType: contentType })\n}\n\nfunction override(partName: string, contentType: string, fmt?: { openPrefix: string }): string {\n\treturn voidEl('Override', { PartName: partName, ContentType: contentType }, fmt)\n}\n\n/**\n * Content-type Override(s) for a chart rel. A classic chart is one Override; a chartEx chart is\n * three: the `chartEx{N}.xml` part plus its mandatory `style{N}.xml` and `colors{N}.xml` sidecars\n * (keyed to the same `globalId`).\n */\nfunction chartOverrides(rel: SlideRelChart, fmt?: { openPrefix: string }): string[] {\n\tif (!rel.isChartEx) return [override(rel.Target, CT_CHART, fmt)]\n\treturn [\n\t\toverride(rel.Target, CT_CHARTEX, fmt),\n\t\toverride(`/ppt/charts/style${rel.globalId}.xml`, CT_CHARTEX_STYLE, fmt),\n\t\toverride(`/ppt/charts/colors${rel.globalId}.xml`, CT_CHARTEX_COLORS, fmt),\n\t]\n}\n\n/**\n * Generate XML ContentType\n * @param {PresSlideInternal[]} slides - slides\n * @param {SlideLayoutInternal[]} slideLayouts - slide layouts\n * @param {PresSlideInternal} masterSlide - master slide\n * @returns XML\n */\nexport function makeXmlContTypes(\n\tslides: PresSlideInternal[],\n\tslideLayouts: SlideLayoutInternal[],\n\tmasterSlide?: PresSlideInternal,\n\thasCustomProps?: boolean,\n\tembeddedFonts?: EmbeddedFont[]\n): string {\n\tconst parts: string[] = [contentDefault('xml', 'application/xml'), contentDefault('rels', PKG + 'relationships+xml')]\n\n\t// STEP 1 - Emit Default Extension entries only for media types actually used by the deck.\n\t// Walk slides + slideLayouts + masterSlide _relsMedia[] and dedupe by extension.\n\t// Skip 'online' rels (no part written) and rels missing extn/type.\n\tconst extnTypeMap = new Map<string, string>()\n\tconst ctTargets: Array<{ _relsMedia?: SlideRelMedia[]; _relsChart?: SlideRelChart[] }> = []\n\t;(slides || []).forEach((s) => ctTargets.push(s))\n\t;(slideLayouts || []).forEach((l) => ctTargets.push(l))\n\tif (masterSlide) ctTargets.push(masterSlide)\n\tlet ctHasChart = false\n\tctTargets.forEach((target) => {\n\t\t;(target._relsMedia || []).forEach((rel) => {\n\t\t\tif (rel.type === 'online' || !rel.extn || !rel.type) return\n\t\t\t// A/V rel `type` is `${mtype}/${extn}` (e.g. `audio/mp3`); resolve the part's\n\t\t\t// Default content type to what PowerPoint authors (`audio/mpeg`). Image rels\n\t\t\t// already carry their final content type (imageContentType).\n\t\t\tconst contentType = rel.type.startsWith('audio/')\n\t\t\t\t? avContentType(rel.extn, 'audio')\n\t\t\t\t: rel.type.startsWith('video/')\n\t\t\t\t\t? avContentType(rel.extn, 'video')\n\t\t\t\t\t: rel.type\n\t\t\tif (!extnTypeMap.has(rel.extn)) extnTypeMap.set(rel.extn, contentType)\n\t\t})\n\t\tif ((target._relsChart || []).length > 0) ctHasChart = true\n\t})\n\textnTypeMap.forEach((type, extn) => {\n\t\tparts.push(contentDefault(extn, type))\n\t})\n\t// Charts embed an xlsx workbook part; emit the Default only when at least one chart is present —\n\t// and only if an OLE object hasn't already contributed the same `xlsx` Default above (one\n\t// Extension may appear once).\n\tif (ctHasChart && !extnTypeMap.has('xlsx')) parts.push(contentDefault('xlsx', OD + 'spreadsheetml.sheet'))\n\t// Embedded fonts: one Default covers every `.fntdata` part (emitted only when fonts are embedded).\n\tif ((embeddedFonts || []).some((font) => font.faces.some((face) => face.bytes))) {\n\t\tparts.push(contentDefault(FONT_DATA_EXTENSION, FONT_DATA_CONTENT_TYPE))\n\t}\n\n\t// STEP 2: Add presentation and slide master(s)/slide(s)\n\tparts.push(override('/ppt/presentation.xml', OD + 'presentationml.presentation.main+xml'))\n\tparts.push(override('/ppt/notesMasters/notesMaster1.xml', OD + 'presentationml.notesMaster+xml'))\n\t// Only one slideMaster part (`slideMaster1.xml`) is written; emit a single matching Override\n\t// rather than one per slide (which would dangle, since `slideMaster2..N.xml` do not exist).\n\tparts.push(override('/ppt/slideMasters/slideMaster1.xml', OD + 'presentationml.slideMaster+xml'))\n\tslides.forEach((slide, idx) => {\n\t\tparts.push(override(`/ppt/slides/slide${idx + 1}.xml`, OD + 'presentationml.slide+xml'))\n\t\t// Add charts if any\n\t\tslide._relsChart.forEach((rel) => {\n\t\t\tparts.push(...chartOverrides(rel))\n\t\t})\n\t})\n\n\t// STEP 3: Core PPT\n\tparts.push(override('/ppt/presProps.xml', OD + 'presentationml.presProps+xml'))\n\tparts.push(override('/ppt/viewProps.xml', OD + 'presentationml.viewProps+xml'))\n\tparts.push(override('/ppt/theme/theme1.xml', CT_THEME))\n\t// notesMaster1.xml.rels references ../theme/theme2.xml; emit a matching Override so the part resolves\n\tparts.push(override('/ppt/theme/theme2.xml', CT_THEME))\n\tparts.push(override('/ppt/tableStyles.xml', OD + 'presentationml.tableStyles+xml'))\n\n\t// STEP 4: Add Slide Layouts\n\tslideLayouts.forEach((layout, idx) => {\n\t\tparts.push(override(`/ppt/slideLayouts/slideLayout${idx + 1}.xml`, OD + 'presentationml.slideLayout+xml'))\n\t\t;(layout._relsChart || []).forEach((rel) => {\n\t\t\tparts.push(...chartOverrides(rel, LEADING_SPACE))\n\t\t})\n\t})\n\n\t// STEP 5: Add notes slide(s)\n\tslides.forEach((_slide, idx) => {\n\t\tparts.push(override(`/ppt/notesSlides/notesSlide${idx + 1}.xml`, OD + 'presentationml.notesSlide+xml'))\n\t})\n\n\t// STEP 5b: Comments — per-slide comment part Override for slides that have comments, plus the\n\t// single presentation-level commentAuthors part Override when the deck has any comments.\n\tlet hasAnyComment = false\n\tslides.forEach((slide, idx) => {\n\t\tif ((slide._comments || []).length > 0) {\n\t\t\thasAnyComment = true\n\t\t\tparts.push(override(`/ppt/comments/comment${idx + 1}.xml`, OD + 'presentationml.comments+xml'))\n\t\t}\n\t})\n\tif (hasAnyComment) parts.push(override('/ppt/commentAuthors.xml', OD + 'presentationml.commentAuthors+xml'))\n\n\t// STEP 6: Add rels\n\tmasterSlide?._relsChart.forEach((rel) => {\n\t\tparts.push(...chartOverrides(rel, LEADING_SPACE))\n\t})\n\t// master _relsMedia extensions are already covered by the unified ctTargets walk above; no per-master Default block needed here.\n\n\t// LAST: Finish XML (Resume core)\n\tparts.push(override('/docProps/core.xml', PKG + 'core-properties+xml', LEADING_SPACE))\n\tparts.push(override('/docProps/app.xml', OD + 'extended-properties+xml', LEADING_SPACE))\n\tif (hasCustomProps) parts.push(override('/docProps/custom.xml', OD + 'custom-properties+xml', LEADING_SPACE))\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel('Types', { xmlns: 'http://schemas.openxmlformats.org/package/2006/content-types' }, parts.map(raw))\n\t)\n}\n","/**\n * ts-pptx: `docProps/core.xml`\n *\n * Emit the core-properties part (title/subject/creator/revision and the\n * created/modified timestamps).\n */\n\nimport { XML_DECL } from '../../constants-internal.js'\nimport { el, raw } from '../oxml/el.js'\n\n/** Each property sits on its own indented line; the parent supplies the closing indent. */\nconst PROP = { openPrefix: '\\n\\t\\t' }\n\nconst NS = {\n\t'xmlns:cp': 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\t'xmlns:dc': 'http://purl.org/dc/elements/1.1/',\n\t'xmlns:dcterms': 'http://purl.org/dc/terms/',\n\t'xmlns:dcmitype': 'http://purl.org/dc/dcmitype/',\n\t'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',\n}\n\nfunction timestamp(): string {\n\treturn new Date().toISOString().replace(/\\.\\d\\d\\dZ/, 'Z')\n}\n\n/**\n * Creates `docProps/core.xml`\n * @param {string} title - metadata data\n * @param {string} subject - metadata data\n * @param {string} author - metadata value\n * @param {string} revision - metadata value\n * @returns XML\n */\nexport function makeXmlCore(title: string, subject: string, author: string, revision: string): string {\n\tconst dcterms = { 'xsi:type': 'dcterms:W3CDTF' }\n\treturn (\n\t\tXML_DECL +\n\t\tel(\n\t\t\t'cp:coreProperties',\n\t\t\tNS,\n\t\t\t[\n\t\t\t\traw(el('dc:title', null, title, PROP)),\n\t\t\t\traw(el('dc:subject', null, subject, PROP)),\n\t\t\t\traw(el('dc:creator', null, author, PROP)),\n\t\t\t\traw(el('cp:lastModifiedBy', null, author, PROP)),\n\t\t\t\t// `revision` is interpolated unescaped today; raw() preserves that.\n\t\t\t\traw(el('cp:revision', null, raw(revision), PROP)),\n\t\t\t\traw(el('dcterms:created', dcterms, raw(timestamp()), PROP)),\n\t\t\t\traw(el('dcterms:modified', dcterms, raw(timestamp()), PROP)),\n\t\t\t],\n\t\t\t{ openPrefix: '\\n\\t', closePrefix: '\\n\\t' }\n\t\t)\n\t)\n}\n","/**\n * ts-pptx: `docProps/custom.xml`\n *\n * Emit the custom-properties part from caller-supplied name/value pairs (bool,\n * date, number and string value types).\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { CustomPropertyValue } from '../../types/index.js'\nimport { el, raw } from '../oxml/el.js'\n\nconst CUSTOM_PROPS_FMTID = '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'\n\nconst PROPS_NS = {\n\txmlns: 'http://schemas.openxmlformats.org/officeDocument/2006/custom-properties',\n\t'xmlns:vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n}\n\n/** Serialize one custom-property value to its typed `vt:` element. */\nfunction valueEl(value: CustomPropertyValue): string {\n\tif (typeof value === 'boolean') return el('vt:bool', null, String(value))\n\tif (value instanceof Date) return el('vt:filetime', null, value.toISOString().replace(/\\.\\d{3}Z$/, 'Z'))\n\tif (typeof value === 'number') return el(Number.isInteger(value) ? 'vt:i4' : 'vt:r8', null, value)\n\treturn el('vt:lpwstr', null, String(value))\n}\n\n/**\n * Creates `docProps/custom.xml`\n * @param props - custom property name/value pairs\n * @returns XML\n */\nexport function makeXmlCustomProperties(props: Array<{ name: string; value: CustomPropertyValue }>): string {\n\t// pid is 1-based with 1 reserved by the spec, so caller properties start at 2.\n\tconst properties = props.map(({ name, value }, idx) =>\n\t\traw(el('property', { fmtid: CUSTOM_PROPS_FMTID, pid: idx + 2, name }, raw(valueEl(value))))\n\t)\n\treturn XML_DECL + CRLF + el('Properties', PROPS_NS, properties)\n}\n","/**\n * ts-pptx: `_rels/.rels`\n *\n * Emit the package root relationships (app/core/presentation, plus custom-props\n * when present).\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { OFFICE_REL, PACKAGE_REL_NS } from '../../ooxml/rel-types.js'\n\nfunction relationship(id: string, type: string, target: string): string {\n\treturn voidEl('Relationship', { Id: id, Type: type, Target: target }, { openPrefix: '\\n\\t\\t' })\n}\n\n/**\n * Creates `_rels/.rels`\n * @returns XML\n */\nexport function makeXmlRootRels(hasCustomProps?: boolean): string {\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'Relationships',\n\t\t\t{ xmlns: PACKAGE_REL_NS },\n\t\t\t[\n\t\t\t\traw(relationship('rId1', OFFICE_REL + 'extended-properties', 'docProps/app.xml')),\n\t\t\t\traw(relationship('rId2', PACKAGE_REL_NS + '/metadata/core-properties', 'docProps/core.xml')),\n\t\t\t\traw(relationship('rId3', OFFICE_REL + 'officeDocument', 'ppt/presentation.xml')),\n\t\t\t\thasCustomProps ? raw(relationship('rId4', OFFICE_REL + 'custom-properties', 'docProps/custom.xml')) : null,\n\t\t\t],\n\t\t\t// The closing tag is indented to child depth, not parent depth. That is\n\t\t\t// how this part has always been emitted; kept verbatim for byte-identity.\n\t\t\t{ closePrefix: '\\n\\t\\t' }\n\t\t)\n\t)\n}\n","/**\n * ts-pptx: `ppt/_rels/presentation.xml.rels`\n *\n * Emit the presentation relationships (slideMaster, slides, notesMaster/\n * presProps/viewProps/theme/tableStyles, optional commentAuthors, embedded-font\n * faces). `presentationFontRelStart` is shared with the presentation-part writer\n * so the embeddedFontLst face `r:id`s match the rels that back them.\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { type EmbeddedFont, FONT_REL_TYPE, flattenEmbeddedFaces } from '../../embedded-fonts.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { OFFICE_REL, PACKAGE_REL_NS } from '../../ooxml/rel-types.js'\n\nfunction relationship(rId: number, type: string, target: string): string {\n\treturn voidEl('Relationship', { Id: `rId${rId}`, Type: type, Target: target })\n}\n\n/**\n * Creates `ppt/_rels/presentation.xml.rels`\n * @param {PresSlideInternal[]} slides - Presenation Slides\n * @returns XML\n */\n/**\n * The first relationship id free for embedded-font rels in `presentation.xml.rels`,\n * i.e. one past the last fixed rel {@link makeXmlPresentationRels} emits. Shared by\n * the rels writer and {@link makeXmlPresentation} so the `embeddedFontLst` face\n * `r:id`s match the relationships that back them.\n *\n * Layout: rId1 = slideMaster, rId2..(N+1) = N slides, then notesMaster/presProps/\n * viewProps/theme1/tableStyles (5), then commentAuthors (1, only with comments).\n */\nexport function presentationFontRelStart(slides: PresSlideInternal[]): number {\n\tconst hasComments = (slides || []).some((slide) => (slide._comments || []).length > 0)\n\treturn slides.length + 7 + (hasComments ? 1 : 0)\n}\n\nexport function makeXmlPresentationRels(slides: PresSlideInternal[], embeddedFonts?: EmbeddedFont[]): string {\n\tlet intRelNum = 1\n\tconst rels: string[] = [relationship(1, OFFICE_REL + 'slideMaster', 'slideMasters/slideMaster1.xml')]\n\tfor (let idx = 1; idx <= slides.length; idx++) {\n\t\trels.push(relationship(++intRelNum, OFFICE_REL + 'slide', `slides/slide${idx}.xml`))\n\t}\n\tintRelNum++\n\trels.push(\n\t\trelationship(intRelNum + 0, OFFICE_REL + 'notesMaster', 'notesMasters/notesMaster1.xml'),\n\t\trelationship(intRelNum + 1, OFFICE_REL + 'presProps', 'presProps.xml'),\n\t\trelationship(intRelNum + 2, OFFICE_REL + 'viewProps', 'viewProps.xml'),\n\t\trelationship(intRelNum + 3, OFFICE_REL + 'theme', 'theme/theme1.xml'),\n\t\trelationship(intRelNum + 4, OFFICE_REL + 'tableStyles', 'tableStyles.xml')\n\t)\n\t// The presentation-level commentAuthors part is shared by every slide's comments, so it is\n\t// related once from the presentation (only when the deck has at least one comment).\n\tif ((slides || []).some((slide) => (slide._comments || []).length > 0)) {\n\t\trels.push(relationship(intRelNum + 5, OFFICE_REL + 'commentAuthors', 'commentAuthors.xml'))\n\t}\n\t// Embedded fonts: one `font` rel per face, ids continuing past the fixed rels above.\n\tfor (const face of flattenEmbeddedFaces(embeddedFonts || [], presentationFontRelStart(slides))) {\n\t\trels.push(relationship(face.rId, FONT_REL_TYPE, `fonts/font${face.partIndex}.fntdata`))\n\t}\n\n\treturn XML_DECL + CRLF + el('Relationships', { xmlns: PACKAGE_REL_NS }, rels.map(raw))\n}\n","/**\n * ts-pptx: `ppt/presentation.xml` + presProps/viewProps\n *\n * Emit the presentation part (masters/notes/slide id lists, sizes, embedded-font\n * list, default text styles, sections) and the small presProps/viewProps parts.\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { PresentationPropsInternal, SectionInternalProps } from '../../types/internal.js'\nimport { flattenEmbeddedFaces, serializeEmbeddedFontLst } from '../../embedded-fonts.js'\nimport { presentationFontRelStart } from './presentation-rels.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { OOXML_NS, PML_ROOT_NS } from '../../ooxml/namespaces.js'\n\nfunction defaultTextStyleLevel(idy: number): string {\n\treturn el(\n\t\t`a:lvl${idy}pPr`,\n\t\t{ marL: (idy - 1) * 457200, algn: 'l', defTabSz: 914400, rtl: 0, eaLnBrk: 1, latinLnBrk: 0, hangingPunct: 1 },\n\t\traw(\n\t\t\tel('a:defRPr', { sz: 1800, kern: 1200 }, [\n\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:schemeClr', { val: 'tx1' })))),\n\t\t\t\traw(voidEl('a:latin', { typeface: '+mn-lt' })),\n\t\t\t\traw(voidEl('a:ea', { typeface: '+mn-ea' })),\n\t\t\t\traw(voidEl('a:cs', { typeface: '+mn-cs' })),\n\t\t\t])\n\t\t)\n\t)\n}\n\nfunction sectionsExtLst(sections: SectionInternalProps[]): string {\n\treturn el('p:extLst', null, [\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:ext',\n\t\t\t\t{ uri: '{521415D9-36F7-43E2-AB2F-B90AF26B5E84}' },\n\t\t\t\traw(\n\t\t\t\t\tel(\n\t\t\t\t\t\t'p14:sectionLst',\n\t\t\t\t\t\t{ 'xmlns:p14': 'http://schemas.microsoft.com/office/powerpoint/2010/main' },\n\t\t\t\t\t\tsections.map((sect) =>\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t'p14:section',\n\t\t\t\t\t\t\t\t\t{ name: sect.title, id: sect._id },\n\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t\t'p14:sldIdLst',\n\t\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t\tsect._slides.map((slide) => raw(voidEl('p14:sldId', { id: slide._slideId })))\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:ext',\n\t\t\t\t{ uri: '{EFAFB233-063F-42B5-8137-9DF3F51BA10A}' },\n\t\t\t\traw(voidEl('p15:sldGuideLst', { 'xmlns:p15': 'http://schemas.microsoft.com/office/powerpoint/2012/main' }))\n\t\t\t)\n\t\t),\n\t])\n}\n\n/**\n * Create presentation file (`ppt/presentation.xml`)\n * @see https://docs.microsoft.com/en-us/office/open-xml/structure-of-a-presentationml-document\n * @see http://www.datypic.com/sc/ooxml/t-p_CT_Presentation.html\n * @param {PresentationPropsInternal} pres - presentation\n * @return {string} XML\n */\nexport function makeXmlPresentation(pres: PresentationPropsInternal): string {\n\t// NOTE: the double space before saveSubsetFonts/embedTrueTypeFonts when\n\t// rtlMode is unset is a pre-existing template artifact (verified against\n\t// the byte-identity baseline) — the literal space around `${rtl}` survives\n\t// even when the interpolation is empty. el()'s attrs always normalize to\n\t// single-space separators, so this opening tag stays a raw template rather\n\t// than being forced through the builder.\n\tconst openTag =\n\t\t`<p:presentation xmlns:a=\"${OOXML_NS.a}\" xmlns:r=\"${OOXML_NS.r}\" ` +\n\t\t// When fonts are embedded we carry WHOLE faces, so `embedTrueTypeFonts=\"1\"` (so\n\t\t// PowerPoint honors the embed) and `saveSubsetFonts=\"0\"` (we did not subset).\n\t\t// With no embedded fonts, keep the historical inert `saveSubsetFonts=\"1\"`.\n\t\t`xmlns:p=\"${OOXML_NS.p}\" ${pres.rtlMode ? 'rtl=\"1\"' : ''} ${(pres.embeddedFonts || []).some((font) => font.faces.some((face) => face.bytes)) ? 'embedTrueTypeFonts=\"1\" saveSubsetFonts=\"0\"' : 'saveSubsetFonts=\"1\"'} autoCompressPictures=\"0\"${pres.firstSlideNum !== 1 ? ` firstSlideNum=\"${pres.firstSlideNum}\"` : ''}>`\n\n\t// SPEC (ECMA-376 Part 1 §19.2.1.26): sldMasterIdLst, then notesMasterIdLst\n\t// BEFORE sldIdLst — emitting notesMasterIdLst after sldIdLst (or after\n\t// sldSz/notesSz) violates the schema and is flagged by OpenXmlValidator as\n\t// Sch_UnexpectedElementContentExpectingComplex.\n\tconst sldMasterIdLst = el('p:sldMasterIdLst', null, raw(voidEl('p:sldMasterId', { id: 2147483648, 'r:id': 'rId1' })))\n\n\t// NOTE: length+2 is from `presentation.xml.rels` func (since we have to match this rId, we just use same logic)\n\tconst notesMasterIdLst = el(\n\t\t'p:notesMasterIdLst',\n\t\tnull,\n\t\traw(voidEl('p:notesMasterId', { 'r:id': `rId${pres.slides.length + 2}` }))\n\t)\n\n\tconst sldIdLst = el(\n\t\t'p:sldIdLst',\n\t\tnull,\n\t\tpres.slides.map((slide) => raw(voidEl('p:sldId', { id: slide._slideId, 'r:id': `rId${slide._rId}` })))\n\t)\n\n\tconst sldSz = voidEl('p:sldSz', { cx: pres.presLayout.width, cy: pres.presLayout.height })\n\tconst notesSz = voidEl('p:notesSz', { cx: pres.presLayout.height, cy: pres.presLayout.width })\n\n\t// Embedded fonts (CT_Presentation index 7 — after notesSz, before defaultTextStyle).\n\t// rIds continue past the fixed presentation rels and must match makeXmlPresentationRels.\n\tconst fonts = pres.embeddedFonts || []\n\tconst flat = flattenEmbeddedFaces(fonts, presentationFontRelStart(pres.slides))\n\tconst rIdOf = new Map(flat.map((face) => [`${face.fontIndex}:${face.slot}`, face.rId]))\n\tconst embeddedFontLst = serializeEmbeddedFontLst(fonts, (fontIndex, slot) => rIdOf.get(`${fontIndex}:${slot}`))\n\n\tconst defaultTextStyle = el(\n\t\t'p:defaultTextStyle',\n\t\tnull,\n\t\tArray.from({ length: 9 }, (_, i) => raw(defaultTextStyleLevel(i + 1)))\n\t)\n\n\tconst extLst = pres.sections && pres.sections.length > 0 ? sectionsExtLst(pres.sections) : ''\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\topenTag +\n\t\tsldMasterIdLst +\n\t\tnotesMasterIdLst +\n\t\tsldIdLst +\n\t\tsldSz +\n\t\tnotesSz +\n\t\tembeddedFontLst +\n\t\tdefaultTextStyle +\n\t\textLst +\n\t\t'</p:presentation>'\n\t)\n}\n\n/**\n * Create `ppt/presProps.xml`\n * @return {string} XML\n */\nexport function makeXmlPresProps(): string {\n\treturn XML_DECL + CRLF + voidEl('p:presentationPr', { ...PML_ROOT_NS })\n}\n\n/**\n * Creates `ppt/viewProps.xml`\n * @return {string} XML\n */\nexport function makeXmlViewProps(): string {\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel('p:viewPr', { ...PML_ROOT_NS }, [\n\t\t\traw(\n\t\t\t\tel('p:normalViewPr', { horzBarState: 'maximized' }, [\n\t\t\t\t\traw(voidEl('p:restoredLeft', { sz: 15611 })),\n\t\t\t\t\traw(voidEl('p:restoredTop', { sz: 94610 })),\n\t\t\t\t])\n\t\t\t),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:slideViewPr',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('p:cSldViewPr', { snapToGrid: 0, snapToObjects: 1 }, [\n\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\tel('p:cViewPr', { varScale: 1 }, [\n\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\tel('p:scale', null, [\n\t\t\t\t\t\t\t\t\t\t\traw(voidEl('a:sx', { n: 136, d: 100 })),\n\t\t\t\t\t\t\t\t\t\t\traw(voidEl('a:sy', { n: 136, d: 100 })),\n\t\t\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\traw(voidEl('p:origin', { x: 216, y: 312 })),\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\traw(voidEl('p:guideLst')),\n\t\t\t\t\t\t])\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:notesTextViewPr',\n\t\t\t\t\tnull,\n\t\t\t\t\traw(\n\t\t\t\t\t\tel('p:cViewPr', null, [\n\t\t\t\t\t\t\traw(el('p:scale', null, [raw(voidEl('a:sx', { n: 1, d: 1 })), raw(voidEl('a:sy', { n: 1, d: 1 }))])),\n\t\t\t\t\t\t\traw(voidEl('p:origin', { x: 0, y: 0 })),\n\t\t\t\t\t\t])\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\traw(voidEl('p:gridSpacing', { cx: 76200, cy: 76200 })),\n\t\t])\n\t)\n}\n","/**\n * ts-pptx: `ppt/tableStyles.xml`\n *\n * Emit the table-styles part. The part carries only the default style id: it defines no\n * styles of its own, because PowerPoint never reads one out of it.\n *\n * `<a:tableStyleId>` is resolved against PowerPoint's *own* table-style gallery, not against\n * this part. Verified by render (PowerPoint desktop 16.0): a deck pointed at a built-in GUID\n * this part does not define paints correctly, while a PowerPoint-authored deck whose style\n * GUID is rewritten to a novel value — in both this part and the slide, bytes otherwise\n * identical — loses its styling entirely and falls back to the black hairline grid. The same\n * holds for a definition placed inline in the slide's `<a:tblPr>` as `<a:tableStyle>`, and for\n * one nominated by this part's `def=`. So a custom `<a:tblStyle>` is unreachable markup in the\n * supported target, whatever it says and wherever it sits. Brand styling belongs in direct\n * cell formatting (`headerRow`, `columns[i]`, per-cell options); see `docs/tables.md`.\n *\n * The part itself still ships: PowerPoint expects the relationship and content-type override\n * to be present, and the read side (`src/read/api/ops/table-styles.ts`) merges real definitions out of\n * *imported* decks into it, which is a different thing from authoring one here.\n */\n\nimport { TableStyle } from '../../enums.js'\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport { voidEl } from '../oxml/el.js'\nimport { OOXML_NS } from '../../ooxml/namespaces.js'\n\n/**\n * Create `ppt/tableStyles.xml`\n * @see: http://openxmldeveloper.org/discussions/formats/f/13/p/2398/8107.aspx\n * @return {string} XML\n */\nexport function makeXmlTableStyles(): string {\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tvoidEl('a:tblStyleLst', {\n\t\t\t'xmlns:a': OOXML_NS.a,\n\t\t\tdef: TableStyle.MEDIUM_STYLE_2_ACCENT_1,\n\t\t})\n\t)\n}\n","/**\n * ts-pptx: comment parts\n *\n * Resolve every slide's comments into a deck-wide author registry with per-author\n * numbering, then emit the presentation-level `commentAuthors.xml` and each\n * slide's `comments/commentN.xml` part.\n */\n\nimport { CRLF, XML_DECL } from '../../constants-internal.js'\nimport type { ResolvedCommentAuthor, SlideComment } from '../../types/index.js'\nimport type { PresSlideInternal } from '../../types/internal.js'\nimport { inch2Emu } from '../../units-internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { PML_ROOT_NS } from '../../ooxml/namespaces.js'\n\n/** Result of resolving every slide's comments into a deck-wide author registry + per-comment numbering. */\ninterface ResolvedComments {\n\t/** Authors in first-appearance order, ready to serialize to `commentAuthors.xml`. */\n\tauthors: ResolvedCommentAuthor[]\n\t/** Per-comment `authorId`/`idx` keyed by the stored comment object. */\n\tmeta: Map<SlideComment, { authorId: number; idx: number }>\n}\n\n/**\n * Walk every slide's comments and build the deck-wide author registry + per-comment numbering.\n *\n * Legacy comments number each comment with a *per-author* 1-based `idx`; an author's `lastIdx` is the\n * highest `idx` it used. Authors are keyed by `name`+`initials` and assigned ids in first-appearance\n * order (slide order, then insertion order). `clrIdx` mirrors `id` (one colour slot per author).\n * @param {PresSlideInternal[]} slides - all presentation slides\n * @return {ResolvedComments} the author list and per-comment metadata\n */\nexport function resolveCommentAuthors(slides: PresSlideInternal[]): ResolvedComments {\n\tconst byKey = new Map<string, ResolvedCommentAuthor>()\n\tconst authors: ResolvedCommentAuthor[] = []\n\tconst perAuthorCount = new Map<number, number>()\n\tconst meta = new Map<SlideComment, { authorId: number; idx: number }>()\n\n\t;(slides || []).forEach((slide) => {\n\t\t;(slide._comments || []).forEach((comment) => {\n\t\t\tconst key = comment.author + '\\0' + comment.initials\n\t\t\tlet author = byKey.get(key)\n\t\t\tif (!author) {\n\t\t\t\tauthor = {\n\t\t\t\t\tid: authors.length,\n\t\t\t\t\tname: comment.author,\n\t\t\t\t\tinitials: comment.initials,\n\t\t\t\t\tlastIdx: 0,\n\t\t\t\t\tclrIdx: authors.length,\n\t\t\t\t}\n\t\t\t\tbyKey.set(key, author)\n\t\t\t\tauthors.push(author)\n\t\t\t\tperAuthorCount.set(author.id, 0)\n\t\t\t}\n\t\t\tconst idx = (perAuthorCount.get(author.id) ?? 0) + 1\n\t\t\tperAuthorCount.set(author.id, idx)\n\t\t\tauthor.lastIdx = idx\n\t\t\tmeta.set(comment, { authorId: author.id, idx })\n\t\t})\n\t})\n\n\treturn { authors, meta }\n}\n\n/**\n * Creates the presentation-level `ppt/commentAuthors.xml` part (`<p:cmAuthorLst>`).\n * @param {ResolvedCommentAuthor[]} authors - resolved deck-wide author registry\n * @return {string} XML\n */\nexport function makeXmlCommentAuthors(authors: ResolvedCommentAuthor[]): string {\n\tconst cmAuthors = authors\n\t\t.map((author) =>\n\t\t\tvoidEl('p:cmAuthor', {\n\t\t\t\tid: author.id,\n\t\t\t\tname: author.name,\n\t\t\t\tinitials: author.initials,\n\t\t\t\tlastIdx: author.lastIdx,\n\t\t\t\tclrIdx: author.clrIdx,\n\t\t\t})\n\t\t)\n\t\t.join('')\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:cmAuthorLst',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t},\n\t\t\traw(cmAuthors)\n\t\t)\n\t)\n}\n\n/**\n * Creates a per-slide comments part `ppt/comments/comment{N}.xml` (`<p:cmLst>`).\n * @param {PresSlideInternal} slide - the slide whose comments are serialized\n * @param {Map} meta - per-comment `authorId`/`idx` from {@link resolveCommentAuthors}\n * @return {string} XML\n */\nexport function makeXmlComments(\n\tslide: PresSlideInternal,\n\tmeta: Map<SlideComment, { authorId: number; idx: number }>\n): string {\n\tconst cms = (slide._comments || [])\n\t\t.map((comment) => {\n\t\t\tconst m = meta.get(comment)\n\t\t\tif (!m) return '' // defensive: comment must have been seen by resolveCommentAuthors\n\t\t\t// Child order is fixed by CT_Comment: <p:pos> then <p:text>. pos x/y are ST_Coordinate (EMU).\n\t\t\treturn el('p:cm', { authorId: m.authorId, dt: comment.date || null, idx: m.idx }, [\n\t\t\t\traw(voidEl('p:pos', { x: Math.round(inch2Emu(comment.x)), y: Math.round(inch2Emu(comment.y)) })),\n\t\t\t\traw(el('p:text', null, comment.text)),\n\t\t\t])\n\t\t})\n\t\t.join('')\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:cmLst',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t},\n\t\t\traw(cms)\n\t\t)\n\t)\n}\n","/**\n * ts-pptx: slide-layout part\n *\n * Emit a slide layout (`ppt/slideLayouts/slideLayoutN.xml`) from a layout object.\n */\n\nimport { XML_DECL } from '../../constants-internal.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { PML_ROOT_NS } from '../../ooxml/namespaces.js'\nimport { slideObjectToXml } from './object.js'\n\n/**\n * Generates the XML layout resource from a layout object\n * @param {SlideLayoutInternal} layout - slide layout (master)\n * @return {string} XML\n */\nexport function makeXmlLayout(layout: SlideLayoutInternal): string {\n\treturn (\n\t\tXML_DECL +\n\t\tel(\n\t\t\t'p:sldLayout',\n\t\t\t{ ...PML_ROOT_NS, preserve: '1' },\n\t\t\t[raw(slideObjectToXml(layout)), raw(el('p:clrMapOvr', null, raw(voidEl('a:masterClrMapping'))))],\n\t\t\t// The root and both children sit on their own two-tab line; the closing tag does not.\n\t\t\t{ openPrefix: '\\n\\t\\t', childPrefix: '\\n\\t\\t' }\n\t\t)\n\t)\n}\n","/**\n * ts-pptx: slide-master parts\n *\n * The slide master (`slideMaster1.xml`) and its `.rels`, plus the master text\n * styles (`<p:txStyles>`): per-level default values mirroring the built-in\n * Office master, with any `MasterTextStyleProps` overrides layered on top.\n */\n\nimport { CRLF, LAYOUT_IDX_SERIES_BASE, XML_DECL } from '../../constants-internal.js'\nimport type { MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideLayoutInternal } from '../../types/internal.js'\nimport { createColorElement } from '../drawingml/color.js'\nimport { inch2Emu } from '../../units-internal.js'\nimport { HUNDREDTHS_PER_POINT, ptToHundredths } from '../../units.js'\nimport { warn } from '../../diagnostics.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\nimport { slideObjectRelationsToXml, slideObjectToXml } from './object.js'\nimport { PML_ROOT_NS } from '../../ooxml/namespaces.js'\nimport { DEFAULT_COLOR_MAP } from '../../ooxml/st-enums.js'\n\n// Default per-level values mirroring the built-in Office master (used as the base that\n// `MasterTextStyleProps` overrides are layered onto). `bu` describes the level's default\n// bullet: 'none' -> <a:buNone/>, undefined -> no bullet element (otherStyle), or a glyph.\ninterface MasterLevelDefault {\n\tmarL: number // EMU\n\tindent?: number // EMU (omitted when undefined)\n\talgn: string // OOXML algn value\n\tspcBefPct?: number // <a:spcBef> percent (×1000); omitted when undefined\n\tbu?: 'none' | { char: string; font: string } // default bullet; undefined => emit no bullet element\n\tsz: number // <a:defRPr@sz>\n\tfont: 'mj' | 'mn' // major (heading) vs minor (body) theme font family\n}\nconst MASTER_TITLE_DEFAULT: MasterLevelDefault = {\n\tmarL: 0,\n\talgn: 'ctr',\n\tspcBefPct: 0,\n\tbu: 'none',\n\tsz: 4400,\n\tfont: 'mj',\n}\nconst MASTER_BODY_DEFAULTS: MasterLevelDefault[] = [\n\t{\n\t\tmarL: 342900,\n\t\tindent: -342900,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 3200,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 742950,\n\t\tindent: -285750,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '–', font: 'Arial' },\n\t\tsz: 2800,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 1143000,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 2400,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 1600200,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '–', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 2057400,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '»', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 2514600,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 2971800,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 3429000,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n\t{\n\t\tmarL: 3886200,\n\t\tindent: -228600,\n\t\talgn: 'l',\n\t\tspcBefPct: 20000,\n\t\tbu: { char: '•', font: 'Arial' },\n\t\tsz: 2000,\n\t\tfont: 'mn',\n\t},\n]\nconst MASTER_OTHER_DEFAULTS: MasterLevelDefault[] = [\n\t0, 457200, 914400, 1371600, 1828800, 2286000, 2743200, 3200400, 3657600,\n].map((marL) => ({ marL, algn: 'l', sz: 1800, font: 'mn' as const }))\n\nfunction masterAlignAttr(align: MasterTextStyleLevel['align']): string {\n\tswitch (align) {\n\t\tcase 'left':\n\t\t\treturn 'l'\n\t\tcase 'right':\n\t\t\treturn 'r'\n\t\tcase 'center':\n\t\t\treturn 'ctr'\n\t\tcase 'justify':\n\t\t\treturn 'just'\n\t\tcase undefined:\n\t\t\t// The only unmatched member: no `align` on the level. `''` omits `@algn` entirely so the\n\t\t\t// level inherits from the theme, which is NOT the same as pinning it to `l`.\n\t\t\treturn ''\n\t}\n}\n\n/** Build the bullet element for a master level: caller override wins over the level default. */\nfunction masterBulletXml(\n\tbulletOverride: boolean | MasterBulletProps | undefined,\n\tbase: MasterLevelDefault['bu']\n): string {\n\t// Explicit override\n\tif (bulletOverride === false) return voidEl('a:buNone')\n\tif (bulletOverride && typeof bulletOverride === 'object') {\n\t\tconst font = bulletOverride.fontFace ? voidEl('a:buFont', { typeface: bulletOverride.fontFace }) : ''\n\t\tif (bulletOverride.type === 'number') {\n\t\t\tconst type = bulletOverride.numberType || 'arabicPeriod'\n\t\t\tconst startAt = typeof bulletOverride.numberStartAt === 'number' ? Math.round(bulletOverride.numberStartAt) : null\n\t\t\treturn font + voidEl('a:buAutoNum', { type, startAt })\n\t\t}\n\t\t// character bullet (default). NOTE: `char` is a pre-escaped numeric char ref (e.g.\n\t\t// `▪` from `characterCode`) — the same quirk `<a:buChar>` carries in text-run.ts.\n\t\t// The builder would double-escape the `&`, so this one attribute stays a raw template;\n\t\t// see text-run.ts's `<a:buChar>` note for the fuller rationale.\n\t\tconst char = bulletOverride.characterCode ? `&#x${bulletOverride.characterCode};` : '•'\n\t\tconst buFont = bulletOverride.fontFace\n\t\t\t? font\n\t\t\t: voidEl('a:buFont', { typeface: 'Arial', pitchFamily: 34, charset: 0 })\n\t\treturn `${buFont}<a:buChar char=\"${char}\"/>`\n\t}\n\t// No override (undefined / true): keep the level's default bullet\n\tif (base === 'none') return voidEl('a:buNone')\n\tif (base && typeof base === 'object')\n\t\treturn voidEl('a:buFont', { typeface: base.font, pitchFamily: 34, charset: 0 }) + `<a:buChar char=\"${base.char}\"/>`\n\treturn '' // otherStyle: no bullet element by default\n}\n\n/** Serialize one `<a:lvlNpPr>` from its default, layering an optional caller override. */\nfunction masterLevelXml(levelNum: number, base: MasterLevelDefault, levelOverride: MasterTextStyleLevel = {}): string {\n\tconst marL =\n\t\ttypeof levelOverride.marginLeft === 'number' && !isNaN(levelOverride.marginLeft)\n\t\t\t? inch2Emu(levelOverride.marginLeft)\n\t\t\t: base.marL\n\tconst indentEmu =\n\t\ttypeof levelOverride.indent === 'number' && !isNaN(levelOverride.indent)\n\t\t\t? inch2Emu(levelOverride.indent)\n\t\t\t: base.indent\n\tconst algn = (levelOverride.align && masterAlignAttr(levelOverride.align)) || base.algn\n\n\tlet sz = base.sz\n\tif (typeof levelOverride.fontSize === 'number') {\n\t\tif (isNaN(levelOverride.fontSize) || levelOverride.fontSize <= 0)\n\t\t\twarn(\n\t\t\t\t'master/invalid-text-style-font-size',\n\t\t\t\t`master textStyles fontSize \"${levelOverride.fontSize}\" is invalid; keeping default ${base.sz / HUNDREDTHS_PER_POINT}pt.`\n\t\t\t)\n\t\telse sz = ptToHundredths(levelOverride.fontSize)\n\t}\n\tconst colorXml = levelOverride.color ? createColorElement(levelOverride.color) : voidEl('a:schemeClr', { val: 'tx1' })\n\tconst latinXml = levelOverride.fontFace\n\t\t? voidEl('a:latin', { typeface: levelOverride.fontFace })\n\t\t: voidEl('a:latin', { typeface: `+${base.font}-lt` })\n\n\treturn el(\n\t\t`a:lvl${levelNum}pPr`,\n\t\t{ marL, indent: indentEmu, algn, defTabSz: 914400, rtl: 0, eaLnBrk: 1, latinLnBrk: 0, hangingPunct: 1 },\n\t\t[\n\t\t\ttypeof base.spcBefPct === 'number'\n\t\t\t\t? raw(el('a:spcBef', null, raw(voidEl('a:spcPct', { val: base.spcBefPct }))))\n\t\t\t\t: null,\n\t\t\traw(masterBulletXml(levelOverride.bullet, base.bu)),\n\t\t\traw(\n\t\t\t\tel('a:defRPr', { sz, b: levelOverride.bold ? '1' : null, i: levelOverride.italic ? '1' : null, kern: 1200 }, [\n\t\t\t\t\traw(el('a:solidFill', null, raw(colorXml))),\n\t\t\t\t\traw(latinXml),\n\t\t\t\t\traw(voidEl('a:ea', { typeface: `+${base.font}-ea` })),\n\t\t\t\t\traw(voidEl('a:cs', { typeface: `+${base.font}-cs` })),\n\t\t\t\t])\n\t\t\t),\n\t\t]\n\t)\n}\n\n/** Clamp a caller-provided per-level override array to the 9 valid list levels, warning on overflow. */\nfunction masterLevelOverrides(levels: MasterTextStyleLevel[] | undefined, group: string): MasterTextStyleLevel[] {\n\tif (!Array.isArray(levels)) return []\n\tif (levels.length > 9)\n\t\twarn(\n\t\t\t'master/too-many-text-style-levels',\n\t\t\t`master textStyles.${group} has ${levels.length} levels; only the first 9 are used.`\n\t\t)\n\treturn levels.slice(0, 9)\n}\n\n/**\n * Build the `<p:txStyles>` block from caller overrides layered onto the Office master defaults.\n * Only invoked when `defineSlideMaster({ textStyles })` was set; the unconfigured deck keeps the\n * verbatim default literal in `makeXmlMaster` for byte-identical output.\n */\nfunction makeXmlMasterTxStyles(textStyles: MasterTextStyleProps): string {\n\tconst title = masterLevelXml(1, MASTER_TITLE_DEFAULT, textStyles.title)\n\tconst bodyOverrides = masterLevelOverrides(textStyles.body, 'body')\n\tconst body = MASTER_BODY_DEFAULTS.map((base, i) => masterLevelXml(i + 1, base, bodyOverrides[i])).join('')\n\tconst otherOverrides = masterLevelOverrides(textStyles.other, 'other')\n\tconst other = MASTER_OTHER_DEFAULTS.map((base, i) => masterLevelXml(i + 1, base, otherOverrides[i])).join('')\n\treturn el('p:txStyles', null, [\n\t\traw(el('p:titleStyle', null, raw(title))),\n\t\traw(el('p:bodyStyle', null, raw(body))),\n\t\traw(el('p:otherStyle', null, [raw(el('a:defPPr', null, raw(voidEl('a:defRPr', { lang: 'en-US' })))), raw(other)])),\n\t])\n}\n\n/**\n * The built-in Office master's `<p:txStyles>`, used verbatim when `defineSlideMaster({ textStyles })`\n * was never called. Deliberately NOT built via `masterLevelXml`: a configured title level always\n * carries `marL=\"0\"` (from `MASTER_TITLE_DEFAULT.marL`), but the true unconfigured default titleStyle\n * has no `marL`/`indent` attribute at all — a pre-existing asymmetry between the two paths, preserved\n * exactly rather than unified.\n */\nfunction makeXmlMasterDefaultTxStyles(): string {\n\tconst defaultLevel = (\n\t\tn: number,\n\t\tattrs: XmlAttrs,\n\t\tbullet: string,\n\t\tsz: number,\n\t\tfont: 'mj' | 'mn',\n\t\tspcBefPct?: number\n\t): string =>\n\t\tel(`a:lvl${n}pPr`, { ...attrs, defTabSz: 914400, rtl: 0, eaLnBrk: 1, latinLnBrk: 0, hangingPunct: 1 }, [\n\t\t\ttypeof spcBefPct === 'number' ? raw(el('a:spcBef', null, raw(voidEl('a:spcPct', { val: spcBefPct })))) : null,\n\t\t\traw(bullet),\n\t\t\traw(\n\t\t\t\tel('a:defRPr', { sz, kern: 1200 }, [\n\t\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:schemeClr', { val: 'tx1' })))),\n\t\t\t\t\traw(voidEl('a:latin', { typeface: `+${font}-lt` })),\n\t\t\t\t\traw(voidEl('a:ea', { typeface: `+${font}-ea` })),\n\t\t\t\t\traw(voidEl('a:cs', { typeface: `+${font}-cs` })),\n\t\t\t\t])\n\t\t\t),\n\t\t])\n\n\tconst title = defaultLevel(1, { algn: 'ctr' }, voidEl('a:buNone'), 4400, 'mj', 0)\n\n\tconst bodyLevels = MASTER_BODY_DEFAULTS.map((base, i) => {\n\t\tconst bu = base.bu as { char: string; font: string }\n\t\treturn defaultLevel(\n\t\t\ti + 1,\n\t\t\t{ marL: base.marL, indent: base.indent, algn: base.algn },\n\t\t\tvoidEl('a:buFont', { typeface: bu.font, pitchFamily: 34, charset: 0 }) + voidEl('a:buChar', { char: bu.char }),\n\t\t\tbase.sz,\n\t\t\t'mn',\n\t\t\tbase.spcBefPct\n\t\t)\n\t})\n\n\tconst otherLevels = MASTER_OTHER_DEFAULTS.map((base, i) =>\n\t\tdefaultLevel(i + 1, { marL: base.marL, algn: base.algn }, '', base.sz, 'mn')\n\t)\n\n\t// NOTE: the source template's own indentation reaches the file here — each style block's\n\t// children are preceded by two spaces and its own closing tag by one (see `fmt` below) —\n\t// same class of quirk as `genXmlPlaceholder` in text-body.ts. Preserved, not reformatted.\n\treturn el(\n\t\t'p:txStyles',\n\t\tnull,\n\t\t[\n\t\t\traw(el('p:titleStyle', null, raw(title), { childPrefix: ' ', closePrefix: ' ' })),\n\t\t\traw(el('p:bodyStyle', null, bodyLevels.map(raw), { childPrefix: ' ', closePrefix: ' ' })),\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'p:otherStyle',\n\t\t\t\t\tnull,\n\t\t\t\t\t[raw(el('a:defPPr', null, raw(voidEl('a:defRPr', { lang: 'en-US' })))), ...otherLevels.map(raw)],\n\t\t\t\t\t{ childPrefix: ' ', closePrefix: ' ' }\n\t\t\t\t)\n\t\t\t),\n\t\t],\n\t\t{ childPrefix: ' ' }\n\t)\n}\n\n/**\n * Creates Slide Master 1 (`ppt/slideMasters/slideMaster1.xml`)\n * @param {PresSlideInternal} slide - slide object that represents master slide layout\n * @param {SlideLayoutInternal[]} layouts - slide layouts\n * @return {string} XML\n */\nexport function makeXmlMaster(slide: PresSlideInternal, layouts: SlideLayoutInternal[]): string {\n\t// NOTE: Pass layouts as static rels because they are not referenced any time\n\tconst layoutDefs = layouts\n\t\t.map((_layoutDef, idx) =>\n\t\t\tvoidEl('p:sldLayoutId', { id: LAYOUT_IDX_SERIES_BASE + idx, 'r:id': `rId${slide._rels.length + idx + 1}` })\n\t\t)\n\t\t.join('')\n\n\tconst clrMap = voidEl('p:clrMap', DEFAULT_COLOR_MAP)\n\n\t// CT_HeaderFooter/@sldNum defaults to true (ECMA-376). When a slide-number placeholder is\n\t// defined on the master we must NOT disable it here, otherwise slides that PowerPoint inserts\n\t// from this master inherit sldNum=\"0\" and the master slide number disappears.\n\tconst hf = voidEl('p:hf', { sldNum: slide._slideNumberProps ? null : 0, hdr: 0, ftr: 0, dt: 0 })\n\n\tconst txStyles = slide._txStyles ? makeXmlMasterTxStyles(slide._txStyles) : makeXmlMasterDefaultTxStyles()\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:sldMaster',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t},\n\t\t\t[\n\t\t\t\traw(slideObjectToXml(slide)),\n\t\t\t\traw(clrMap),\n\t\t\t\traw(el('p:sldLayoutIdLst', null, raw(layoutDefs))),\n\t\t\t\traw(hf),\n\t\t\t\traw(txStyles),\n\t\t\t]\n\t\t)\n\t)\n}\n\n/**\n * Creates `ppt/slideMasters/_rels/slideMaster1.xml.rels`\n * @param {PresSlideInternal} masterSlide - Slide object\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layouts\n * @return {string} XML\n */\nexport function makeXmlMasterRel(masterSlide: PresSlideInternal, slideLayouts: SlideLayoutInternal[]): string {\n\tconst defaultRels = slideLayouts.map((_layoutDef, idx) => ({\n\t\ttarget: `../slideLayouts/slideLayout${idx + 1}.xml`,\n\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout',\n\t}))\n\tdefaultRels.push({\n\t\ttarget: '../theme/theme1.xml',\n\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',\n\t})\n\n\treturn slideObjectRelationsToXml(masterSlide, defaultRels)\n}\n","/**\n * Package assembly: turn an authored presentation's internal state into the full set of\n * OOXML package parts and hand the bytes to the ZIP writer. This is the write-side\n * \"packaging\" layer — `[Content_Types].xml`, the `_rels` graph, docProps, theme, the\n * per-slide/layout/master parts, comments, and chart/media rels — split out of the\n * authoring class (`TsPptx`) so that class stays a façade over slide authoring.\n *\n * The entry point `writePackage` takes a structural {@link PackageSource} that the\n * authoring class satisfies; it does not depend on the class itself, so the same pipeline\n * can be driven from any assembled deck state.\n */\nimport { ZipWriter } from '../zip.js'\nimport type { CustomPropertyValue, WriteProps } from '../types/index.js'\nimport type { PresentationPropsInternal, PresSlideInternal, SlideLayoutInternal } from '../types/internal.js'\nimport type { RuntimeAdapter } from '../runtime/types.js'\nimport type { FontMetricsRegistry } from '../measure/font-metrics.js'\nimport { flattenEmbeddedFaces } from '../embedded-fonts.js'\nimport { getNewRelId } from '../gen/utils.js'\nimport { decodeBase64ToBytes } from '../media/base64.js'\nimport { audioExtensionForSubtype } from '../media/content-type.js'\nimport { createExcelWorksheet } from '../gen/chart/embed-xlsx.js'\nimport { bakeSlideContent, encodeMediaForTargets } from '../gen/prepare.js'\nimport { makeXmlApp } from '../gen/opc/app.js'\nimport { makeXmlContTypes } from '../gen/opc/content-types.js'\nimport { makeXmlCore } from '../gen/opc/core.js'\nimport { makeXmlCustomProperties } from '../gen/opc/custom-props.js'\nimport { makeXmlRootRels } from '../gen/opc/root-rels.js'\nimport { makeXmlPresentationRels } from '../gen/pres/presentation-rels.js'\nimport { makeXmlPresentation, makeXmlPresProps, makeXmlViewProps } from '../gen/pres/presentation.js'\nimport { makeXmlTableStyles } from '../gen/pres/table-styles.js'\nimport { makeXmlTheme } from '../gen/pres/theme.js'\nimport { makeXmlCommentAuthors, makeXmlComments, resolveCommentAuthors } from '../gen/slide/comments.js'\nimport { makeXmlLayout } from '../gen/slide/layout.js'\nimport { makeXmlMaster, makeXmlMasterRel } from '../gen/slide/master.js'\nimport {\n\tmakeXmlNotesMaster,\n\tmakeXmlNotesMasterRel,\n\tmakeXmlNotesSlide,\n\tmakeXmlNotesSlideRel,\n} from '../gen/slide/notes.js'\nimport { makeXmlSlide, makeXmlSlideLayoutRel, makeXmlSlideRel } from '../gen/slide/slide.js'\n\n/**\n * The slice of an authored presentation the packager reads. The authoring class satisfies\n * this structurally: `presentation` is its internal props view (slides, layouts, master,\n * embedded fonts, and metadata), and the remaining fields are state the part builders need\n * that the props view does not carry.\n */\nexport interface PackageSource {\n\treadonly runtime: RuntimeAdapter\n\treadonly presentation: PresentationPropsInternal\n\treadonly customProperties: Array<{ name: string; value: CustomPropertyValue }>\n\treadonly fontMetrics: FontMetricsRegistry\n}\n\n/**\n * Media extensions whose bytes are already entropy-coded, so running the ZIP's\n * DEFLATE pass over them costs CPU for a negligible size gain. For these we set\n * the per-entry ZIP compression to STORE while leaving XML parts on DEFLATE.\n * In image/video-heavy decks media dominates the byte count, so this is the\n * dominant cost when writing large presentations.\n * Formats that genuinely benefit from DEFLATE (bmp, wav, tiff, emf, wmf, svg)\n * are deliberately excluded so they keep inheriting the global compression.\n */\nconst ALREADY_COMPRESSED_MEDIA_EXTN = new Set([\n\t'jpg',\n\t'jpeg',\n\t'png',\n\t'gif',\n\t'webp',\n\t'heic',\n\t'heif',\n\t'avif',\n\t'mp4',\n\t'm4v',\n\t'mov',\n\t'avi',\n\t'mpg',\n\t'mpeg',\n\t'wmv',\n\t'webm',\n\t'mkv',\n\t'mp3',\n\t'm4a',\n\t'aac',\n\t'ogg',\n\t'oga',\n])\n\n/**\n * Extensions whose payload is itself a ZIP archive — the embedded OPC packages an OLE object can\n * carry (`addOleObject`). Deflating a zip inside a zip buys nothing, so these are STOREd like the\n * already-compressed media above. No media/image rel ever uses one of these extensions, so decks\n * without an OLE object are unaffected.\n */\nconst ZIP_CONTAINER_EXTN = new Set(['xlsx', 'xlsm', 'docx', 'docm', 'pptx', 'pptm'])\n\n/**\n * Register an audio media part + relationship for each slide-transition start sound\n * (`transition.sound` with `data`/`path`), stamping the assigned relationship id onto\n * `transition._sndRId` for the `p:sndAc/p:snd r:embed`. Runs before media encoding so\n * the bytes are loaded; idempotent (skips a sound already registered) so re-export is\n * safe. The stop-previous form (`sound.stopPrevious`) needs no part and is skipped.\n */\nfunction registerTransitionSounds(slides: PresSlideInternal[]): void {\n\tslides.forEach((slide) => {\n\t\tconst transition = slide.transition\n\t\tconst sound = transition?.sound\n\t\tif (!sound || sound.stopPrevious || typeof transition._sndRId === 'number') return\n\t\tif (!sound.data && !sound.path) return\n\n\t\t// Derive the file extension from the data-URI mime, else the path, defaulting to wav.\n\t\t// The mime's subtype is not itself an extension for the spellings PowerPoint actually\n\t\t// uses (`audio/x-wav` for a transition sound), so it goes through the mapping rather\n\t\t// than into the filename raw — see `audioExtensionForSubtype`.\n\t\tconst dataMime = /audio\\/([\\w.-]+)[;,]/.exec(sound.data ?? '')\n\t\tconst pathFile = sound.path ? ((sound.path.split('/').pop() ?? '').split('?')[0] ?? '') : ''\n\t\tconst extn = dataMime\n\t\t\t? audioExtensionForSubtype(dataMime[1] ?? '')\n\t\t\t: (pathFile.split('.').pop() ?? 'wav').toLowerCase()\n\n\t\tconst rId = getNewRelId(slide)\n\t\tconst mediaSlideKey =\n\t\t\tslide._slideNum == null ? 'sm' : slide._slideNum >= 1000 ? `sl-${slide._slideNum}` : slide._slideNum\n\t\tslide._relsMedia.push({\n\t\t\tpath: sound.path ?? `preencoded.${extn}`,\n\t\t\ttype: `audio/${extn}`,\n\t\t\textn,\n\t\t\tdata: sound.data ?? '',\n\t\t\trId,\n\t\t\tTarget: `../media/audio-${mediaSlideKey}-${slide._relsMedia.length + 1}.${extn}`,\n\t\t})\n\t\ttransition._sndRId = rId\n\t})\n}\n\n/**\n * Create all chart and media rels for this Presentation\n * @param {PresSlideInternal | SlideLayoutInternal} slide - slide with rels\n * @param {ZipWriter} zip - zip writer\n * @param {Promise<string>[]} chartPromises - promise array\n */\nfunction createChartMediaRels(\n\tslide: PresSlideInternal | SlideLayoutInternal,\n\tzip: ZipWriter,\n\tchartPromises: Promise<string>[]\n): void {\n\tslide._relsChart.forEach((rel) => chartPromises.push(createExcelWorksheet(rel, zip)))\n\tslide._relsMedia.forEach((rel) => {\n\t\tif (rel.type !== 'online' && rel.type !== 'hyperlink') {\n\t\t\t// A: fflate needs decoded bytes (no base64 convenience), so decode the payload\n\t\t\t// here. `decodeBase64ToBytes` takes raw base64 and a `data:` URI alike, which is\n\t\t\t// every shape `rel.data` comes in: a loaded rel has been through `toMediaDataUri`,\n\t\t\t// and a caller-supplied `addImage({ data })` may be either. A prefix-correcting\n\t\t\t// block used to sit here and is gone -- it only ever prepended a label the decoder\n\t\t\t// then stripped, so it could not change a single byte of any payload.\n\t\t\tconst data: string = rel.data && typeof rel.data === 'string' ? rel.data : ''\n\n\t\t\t// B: Already-compressed formats (JPEG/PNG/video/…) gain ~nothing from DEFLATE, so\n\t\t\t// STORE them to avoid wasted compression CPU on large decks; other parts inherit\n\t\t\t// global compression.\n\t\t\tconst bytes = decodeBase64ToBytes(data)\n\t\t\tif (!bytes) return\n\t\t\tconst extn = (rel.extn || rel.Target.split('.').pop() || '').toLowerCase()\n\t\t\tzip.add(rel.Target.replace('..', 'ppt'), bytes, {\n\t\t\t\tstore: ALREADY_COMPRESSED_MEDIA_EXTN.has(extn) || ZIP_CONTAINER_EXTN.has(extn),\n\t\t\t})\n\t\t}\n\t})\n}\n\n/**\n * One emitted OOXML package part, before zipping: its slash-path, already-encoded bytes, and\n * whether it is added with `store` (DEFLATE skipped — already-compressed media/fonts). This is\n * the build-side seam {@link buildPackageParts} returns and {@link zipPackageParts} consumes;\n * the `store` hint is an fflate-era zip optimization kept internal so re-zipping stays\n * byte-identical. A public parts API exposes only `{ path, data }`.\n */\ninterface InternalPackagePart {\n\treadonly path: string\n\treadonly data: Uint8Array\n\treadonly store: boolean\n}\n\n/**\n * Assemble every package part for `source` and return them in emission order, without zipping.\n * This runs the transition-sound registration, media encode, cross-deck media de-dup,\n * chart-part-id assignment, placeholder backfill, and measured-fit passes before the synchronous\n * XML pass reads slide state. The bytes are the same the ZIP writer would compress; splitting the\n * assembly from the zip lets the byte-identity harness (and a future parts API) read parts\n * directly. Only `onMediaError` is meaningful here — compression/output shape are zip concerns\n * handled by {@link zipPackageParts}.\n */\nexport async function buildPackageParts(\n\tsource: PackageSource,\n\tprops: { onMediaError?: WriteProps['onMediaError'] }\n): Promise<InternalPackagePart[]> {\n\tconst pres = source.presentation\n\tconst arrChartPromises: Promise<string>[] = []\n\tconst zip = new ZipWriter()\n\n\t// STEP 0: Register transition-sound media parts/rels before encoding picks them up.\n\tregisterTransitionSounds(pres.slides)\n\n\t// STEP 1: Read/Encode all Media before zip as base64 content, etc. is required\n\tconst onMediaError = props.onMediaError ?? 'throw'\n\tconst mediaTargets = [...pres.slides, ...pres.slideLayouts, pres.masterSlide]\n\n\t// STEP 2: Wait for media (if any) then generate the PPTX file\n\treturn await encodeMediaForTargets(mediaTargets, source.runtime, onMediaError).then(async () => {\n\t\t// PERF: Collapse identical media to a single package part across the entire deck.\n\t\t// Each target (slide/layout/master) namespaces its media `Target` by slide, so the\n\t\t// same image used on multiple slides — or loaded from the same path — otherwise\n\t\t// embeds one copy per use. By now `encodeSlideMediaRels` has populated every\n\t\t// `rel.data`, so we can point later duplicates at the first occurrence's `Target`\n\t\t// (slide `.rels` reference media by rId, and sharing a part across slides is valid\n\t\t// OOXML). This subsumes the per-slide path/data de-dup for cross-slide reuse and\n\t\t// also covers background images.\n\t\tconst canonicalMediaTargets = new Map<string, string>()\n\t\tfor (const target of [...pres.slides, ...pres.slideLayouts, pres.masterSlide]) {\n\t\t\tfor (const rel of target._relsMedia || []) {\n\t\t\t\tif (rel.type === 'online' || rel.type === 'hyperlink' || typeof rel.data !== 'string' || !rel.data) continue\n\t\t\t\t// OLE payloads are exempt: PowerPoint gives every embedded object its own part, and\n\t\t\t\t// collapsing two identical ones would make editing either rewrite the other's source.\n\t\t\t\tif (rel.oleRelType) continue\n\t\t\t\t// Key on extension + bytes so identical content with differing part\n\t\t\t\t// extensions is never merged into one mistyped file.\n\t\t\t\tconst key = (rel.extn || '') + '\\0' + rel.data\n\t\t\t\tconst canonical = canonicalMediaTargets.get(key)\n\t\t\t\tif (canonical) rel.Target = canonical\n\t\t\t\telse canonicalMediaTargets.set(key, rel.Target)\n\t\t\t}\n\t\t}\n\n\t\t// DETERMINISM: Assign chart part filenames from a per-presentation counter here,\n\t\t// at write time, so two identical decks built in one process produce byte-identical\n\t\t// packages. Chart parts share one `ppt/charts/` namespace across slides, layouts, and\n\t\t// the master, so the id must be package-wide; `addChartDefinition` only sets a\n\t\t// target-local placeholder. This is the authoritative assignment consumed by content\n\t\t// types, slide rels, and the chart/embedding parts below — all emitted after this pass.\n\t\t// A never-reset module global in `gen/define/chart.ts` previously drove this — same\n\t\t// input, different bytes. `gen/chart/chartex-xml.ts` derives its series GUIDs from\n\t\t// the id assigned here, so both depend on this pass staying authoritative.\n\t\tlet chartPartIdx = 0\n\t\tfor (const target of [...pres.slides, ...pres.slideLayouts, pres.masterSlide]) {\n\t\t\tfor (const rel of target._relsChart || []) {\n\t\t\t\tconst chartId = ++chartPartIdx\n\t\t\t\trel.globalId = chartId\n\t\t\t\t// chartEx charts share the `ppt/charts/` namespace but use the `chartEx{N}.xml` name.\n\t\t\t\t// The single shared counter keeps every chart part name globally unique regardless of\n\t\t\t\t// prefix, so classic and chartEx parts never collide.\n\t\t\t\tconst chartBase = rel.isChartEx ? `chartEx${chartId}` : `chart${chartId}`\n\t\t\t\trel.fileName = `${chartBase}.xml`\n\t\t\t\trel.Target = `/ppt/charts/${chartBase}.xml`\n\t\t\t}\n\t\t}\n\n\t\t// A: Backfill inherited layout placeholders, then bake a real fontScale onto\n\t\t// `fit:'shrink'` text boxes when font metrics are registered — both before the\n\t\t// sync XML pass reads them. Shared with `extractSlides` (see `gen/prepare.ts`).\n\t\tbakeSlideContent(pres.slides, source.fontMetrics)\n\n\t\t// B: Add all required files. fflate keys on full slash-paths and emits no\n\t\t// directory entries, so there is no folder scaffolding to set up (and no\n\t\t// stray empty-directory entries to guard against on minimal decks).\n\t\tconst hasCustomProps = source.customProperties.length > 0\n\t\tzip.add(\n\t\t\t'[Content_Types].xml',\n\t\t\tmakeXmlContTypes(pres.slides, pres.slideLayouts, pres.masterSlide, hasCustomProps, pres.embeddedFonts)\n\t\t)\n\t\tzip.add('_rels/.rels', makeXmlRootRels(hasCustomProps))\n\t\tzip.add('docProps/app.xml', makeXmlApp(pres.slides, pres.company))\n\t\tzip.add('docProps/core.xml', makeXmlCore(pres.title, pres.subject, pres.author, pres.revision))\n\t\tif (hasCustomProps) {\n\t\t\tzip.add('docProps/custom.xml', makeXmlCustomProperties(source.customProperties))\n\t\t}\n\t\tzip.add('ppt/_rels/presentation.xml.rels', makeXmlPresentationRels(pres.slides, pres.embeddedFonts))\n\t\t// Embedded font parts (raw whole faces). Fonts are already compact binary, so STORE\n\t\t// (no DEFLATE) like already-compressed media. Part index matches the rels Target above.\n\t\tfor (const face of flattenEmbeddedFaces(pres.embeddedFonts, 1)) {\n\t\t\tzip.add(`ppt/fonts/font${face.partIndex}.fntdata`, face.bytes, { store: true })\n\t\t}\n\t\tzip.add('ppt/theme/theme1.xml', makeXmlTheme(pres))\n\t\t// emit a separate theme2.xml part so notesMaster1.xml.rels resolves\n\t\tzip.add('ppt/theme/theme2.xml', makeXmlTheme(pres))\n\t\tzip.add('ppt/presentation.xml', makeXmlPresentation(pres))\n\t\tzip.add('ppt/presProps.xml', makeXmlPresProps())\n\t\tzip.add('ppt/tableStyles.xml', makeXmlTableStyles())\n\t\tzip.add('ppt/viewProps.xml', makeXmlViewProps())\n\n\t\t// C: Create a Layout/Master/Rel/Slide file for each SlideLayout and Slide\n\t\tpres.slideLayouts.forEach((layout, idx) => {\n\t\t\tzip.add(`ppt/slideLayouts/slideLayout${idx + 1}.xml`, makeXmlLayout(layout))\n\t\t\tzip.add(\n\t\t\t\t`ppt/slideLayouts/_rels/slideLayout${idx + 1}.xml.rels`,\n\t\t\t\tmakeXmlSlideLayoutRel(idx + 1, pres.slideLayouts)\n\t\t\t)\n\t\t})\n\t\tpres.slides.forEach((slide, idx) => {\n\t\t\tzip.add(`ppt/slides/slide${idx + 1}.xml`, makeXmlSlide(slide))\n\t\t\tzip.add(`ppt/slides/_rels/slide${idx + 1}.xml.rels`, makeXmlSlideRel(pres.slides, pres.slideLayouts, idx + 1))\n\t\t\t// Create all slide notes related items. Notes of empty strings are created for slides which do not have notes specified, to keep track of _rels.\n\t\t\tzip.add(`ppt/notesSlides/notesSlide${idx + 1}.xml`, makeXmlNotesSlide(slide))\n\t\t\tzip.add(`ppt/notesSlides/_rels/notesSlide${idx + 1}.xml.rels`, makeXmlNotesSlideRel(slide, idx + 1))\n\t\t})\n\t\tzip.add('ppt/slideMasters/slideMaster1.xml', makeXmlMaster(pres.masterSlide, pres.slideLayouts))\n\t\tzip.add('ppt/slideMasters/_rels/slideMaster1.xml.rels', makeXmlMasterRel(pres.masterSlide, pres.slideLayouts))\n\t\tzip.add('ppt/notesMasters/notesMaster1.xml', makeXmlNotesMaster())\n\t\tzip.add('ppt/notesMasters/_rels/notesMaster1.xml.rels', makeXmlNotesMasterRel())\n\n\t\t// C.1: Comments — resolve the deck-wide author registry once, then emit the shared\n\t\t// commentAuthors part plus a per-slide comment part for each slide that has comments.\n\t\tconst resolvedComments = resolveCommentAuthors(pres.slides)\n\t\tif (resolvedComments.authors.length > 0) {\n\t\t\tzip.add('ppt/commentAuthors.xml', makeXmlCommentAuthors(resolvedComments.authors))\n\t\t\tpres.slides.forEach((slide, idx) => {\n\t\t\t\tif ((slide._comments || []).length > 0) {\n\t\t\t\t\tzip.add(`ppt/comments/comment${idx + 1}.xml`, makeXmlComments(slide, resolvedComments.meta))\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// D: Create all Rels (images, media, chart data)\n\t\tpres.slideLayouts.forEach((layout) => {\n\t\t\tcreateChartMediaRels(layout, zip, arrChartPromises)\n\t\t})\n\t\tpres.slides.forEach((slide) => {\n\t\t\tcreateChartMediaRels(slide, zip, arrChartPromises)\n\t\t})\n\t\tcreateChartMediaRels(pres.masterSlide, zip, arrChartPromises)\n\n\t\t// E: Wait for the chart-embed Promises (if any), then snapshot the accumulated\n\t\t// parts in emission order. Zipping is deferred to `zipPackageParts`.\n\t\treturn await Promise.all(arrChartPromises).then(() => zip.entries())\n\t})\n}\n\n/**\n * Zip an ordered list of package parts into the output shape `props.outputType` selects. Re-adds\n * each part to a fresh {@link ZipWriter} in order — preserving each part's `store` hint — so the\n * archive is byte-identical to assembling straight into one writer. Compression and output type\n * are the only zip-level knobs; part assembly happened in {@link buildPackageParts}.\n */\nasync function zipPackageParts(\n\tparts: InternalPackagePart[],\n\tprops: WriteProps\n): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\tconst zip = new ZipWriter()\n\tfor (const part of parts) zip.add(part.path, part.data, { store: part.store })\n\n\tconst compression = props.compression !== false\n\tif (props.outputType) {\n\t\t// A: Output type selected by the caller or runtime adapter.\n\t\treturn await zip.generate(props.outputType, { compression })\n\t} else {\n\t\t// B: Browser/neutral default: output a Blob as app/ms-pptx.\n\t\treturn await zip.generate('blob', { compression })\n\t}\n}\n\n/**\n * Assemble every package part for `source` and zip it into the output shape `props.outputType`\n * selects. Thin composition of {@link buildPackageParts} (the assembly pipeline) and\n * {@link zipPackageParts} (the zip pass), kept as the stable entry point the authoring class calls.\n */\nexport async function writePackage(\n\tsource: PackageSource,\n\tprops: WriteProps\n): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\treturn await zipPackageParts(await buildPackageParts(source, props), props)\n}\n","/**\n * ts-pptx: the presentation core\n *\n * Home of {@link PresentationCore}, the class every entry point subclasses with a runtime\n * adapter (`index.ts`, `node.ts`, `browser.ts`). See the class doc below for the layout of\n * its body and where package assembly actually happens.\n *\n * Units: this library takes user coordinates in inches and converts to EMU on output — see\n * `units.ts` for the conversions and `STANDARD_LAYOUTS` for the built-in slide sizes.\n *\n * Derived from PptxGenJS (C) 2015-present Brent Ely (MIT), which in turn took some code from\n * the OfficeGen project (Copyright 2013 Ziv Barber). This project is likewise MIT; the full\n * license text is in `LICENSE` at the repository root.\n */\n\nimport { warn } from './diagnostics.js'\nimport { InternalError, InvalidOptionError } from './errors.js'\nimport SlideBuilder from './slide.js'\nimport { SlideObjectType } from './enums.js'\nimport { DEF_PRES_LAYOUT, DEF_PRES_LAYOUT_NAME, DEF_SLIDE_MARGIN_IN } from './constants-internal.js'\nimport type {\n\tAddSlideProps,\n\tCustomPropertyValue,\n\tMeasureTextOptions,\n\tOverflowBoxOptions,\n\tPresLayout,\n\tSectionProps,\n\tSlideLayout,\n\tPackagePart,\n\tPartsProps,\n\tSlideMasterProps,\n\tSlideNumberProps,\n\tTableLayoutResult,\n\tTableProps,\n\tTableRow,\n\tTextMeasurement,\n\tTextProps,\n\tThemeProps,\n\tWriteBaseProps,\n\tWriteFileProps,\n\tWriteProps,\n} from './types/index.js'\nimport type {\n\tPresentationPropsInternal,\n\tPresSlideInternal,\n\tSectionInternalProps,\n\tSlideLayoutInternal,\n} from './types/internal.js'\nimport type { Slide } from './types/slide.js'\nimport type { RuntimeAdapter } from './runtime/types.js'\nimport { FontMetricsRegistry, parseFontMetrics } from './measure/font-metrics.js'\nimport { isFontCollection } from './measure/font-collection.js'\nimport { type EmbeddedFont, type EmbeddedFontSlot, EMBEDDED_FONT_SLOTS } from './embedded-fonts.js'\nimport { measureText } from './measure/fit.js'\nimport { computeTableLayout } from './measure/table-fit.js'\nimport { getUuid, isHyperlinkRel } from './gen/utils.js'\nimport { decodeBase64ToBytes } from './media/base64.js'\nimport { avContentType, imageContentType } from './media/content-type.js'\nimport { inchesToEmu, STANDARD_LAYOUTS, type StandardLayout } from './units.js'\nimport type { ExtractedSlide, ExtractedSlides } from './read/api/presentation-types.js'\n\nimport { makeXmlCharts } from './gen/chart/chart-xml.js'\nimport { makeXmlChartEx } from './gen/chart/chartex-xml.js'\nimport { makeChartExColorsXml, makeChartExStyleXml } from './gen/chart/chartex-style.js'\nimport { buildEmbeddedWorksheet } from './gen/chart/embed-xlsx.js'\nimport { addBackgroundDefinition } from './gen/define/background.js'\nimport { createSlideMaster } from './gen/define/master.js'\nimport { bakeSlideContent, encodeMediaForTargets } from './gen/prepare.js'\nimport { makeXmlSlide } from './gen/slide/slide.js'\nimport { buildNotesSlideRels, makeXmlNotesMaster, makeXmlNotesSlide } from './gen/slide/notes.js'\nimport { makeXmlTheme } from './gen/pres/theme.js'\nimport { buildPackageParts, writePackage, type PackageSource } from './package/assemble.js'\n\nconst VERSION = '3.7.0'\n\nfunction standardLayoutToPresLayout(layout: StandardLayout): PresLayout {\n\treturn {\n\t\tname: layout.name,\n\t\twidth: layout.widthEmu,\n\t\theight: layout.heightEmu,\n\t}\n}\n\n/**\n * Main presentation class and package export flow — the public entry point consumers\n * instantiate (`new TsPptx()`). Owns presentation-level state and metadata, collects\n * slides, and drives `write`/`writeFile`/`stream`. The actual OOXML string building is\n * delegated to the `gen-*` modules; runtime file/stream output goes through the injected\n * `RuntimeAdapter`. Enums (`AlignH`, `ChartType`, `ShapeType`, …) are imported from the\n * package entry, not read off the instance.\n *\n * Rough layout of the class body:\n * - Metadata accessors layout / author / company / title / theme / sections getters+setters\n * - Private slide helpers addNewSlide, getSlide, setSlideNumber\n * - Public export methods stream / write / writeFile — delegate packaging to `writePackage`\n * - Public authoring methods addSlide / defineLayout / defineSlideMaster / defineTableStyle\n *\n * Package assembly (`[Content_Types].xml`, the rels graph, per-part XML, the ZIP) lives in\n * `package/assemble.ts`; this class provides the deck state via {@link PresentationCore.packageSource}.\n * The live-DOM `tableToSlides()` is NOT here — it is added by the browser entry subclass\n * (`browser.ts`) so it stays out of the Node build and out of the core chunk.\n */\nexport default class PresentationCore {\n\t// Property getters/setters\n\n\t/**\n\t * Presentation layout name\n\t * Standard layouts:\n\t * - 'LAYOUT_4x3' (10\" x 7.5\")\n\t * - 'LAYOUT_16x9' (10\" x 5.625\")\n\t * - 'LAYOUT_16x10' (10\" x 6.25\")\n\t * - 'LAYOUT_WIDE' (13.333\" x 7.5\")\n\t * Custom layouts:\n\t * Use `pptx.defineLayout()` to create custom layouts (e.g.: 'A4')\n\t * @type {string}\n\t * @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e\n\t */\n\tprivate _layout: string = DEF_PRES_LAYOUT\n\tpublic set layout(value: string | StandardLayout) {\n\t\t// Accept either a layout key string or a STANDARD_LAYOUTS preset object directly.\n\t\tconst layoutKey = typeof value === 'string' ? value : value?.layout\n\t\tconst newLayout: PresLayout | undefined = layoutKey ? this.LAYOUTS[layoutKey] : undefined\n\n\t\tif (newLayout) {\n\t\t\tthis._layout = layoutKey\n\t\t\tthis._presLayout = newLayout\n\t\t} else {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'layout/unknown',\n\t\t\t\t`Unknown layout ${JSON.stringify(layoutKey)}; pass a registered layout name (see LAYOUTS) or a STANDARD_LAYOUTS preset`\n\t\t\t)\n\t\t}\n\t}\n\n\tpublic get layout(): string {\n\t\treturn this._layout\n\t}\n\n\t/**\n\t * ts-pptx Library Version\n\t */\n\tprivate readonly _version: string = VERSION\n\tpublic get version(): string {\n\t\treturn this._version\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _author: string\n\tpublic set author(value: string) {\n\t\tthis._author = value\n\t}\n\n\tpublic get author(): string {\n\t\treturn this._author\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _company: string\n\tpublic set company(value: string) {\n\t\tthis._company = value\n\t}\n\n\tpublic get company(): string {\n\t\treturn this._company\n\t}\n\n\t/**\n\t * @type {string}\n\t * @note the `revision` value must be a whole number only (without \".\" or \",\" - otherwise, PPT will throw errors upon opening!)\n\t */\n\tprivate _revision: string\n\tpublic set revision(value: string) {\n\t\tthis._revision = value\n\t}\n\n\tpublic get revision(): string {\n\t\treturn this._revision\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _subject: string\n\tpublic set subject(value: string) {\n\t\tthis._subject = value\n\t}\n\n\tpublic get subject(): string {\n\t\treturn this._subject\n\t}\n\n\t/**\n\t * @type {ThemeProps}\n\t */\n\tprivate _theme: ThemeProps = {}\n\tpublic set theme(value: ThemeProps) {\n\t\tthis._theme = value\n\t}\n\n\tpublic get theme(): ThemeProps {\n\t\treturn this._theme\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _title: string\n\tpublic set title(value: string) {\n\t\tthis._title = value\n\t}\n\n\tpublic get title(): string {\n\t\treturn this._title\n\t}\n\n\t/** Slide number shown on the first slide (maps to firstSlideNum in presentation.xml) */\n\tprivate _firstSlideNum: number\n\tpublic set firstSlideNum(value: number) {\n\t\tthis._firstSlideNum = value\n\t}\n\n\tpublic get firstSlideNum(): number {\n\t\treturn this._firstSlideNum\n\t}\n\n\t/**\n\t * Whether Right-to-Left (RTL) mode is enabled\n\t * @type {boolean}\n\t */\n\tprivate _rtlMode: boolean\n\tpublic set rtlMode(value: boolean) {\n\t\tthis._rtlMode = value\n\t}\n\n\tpublic get rtlMode(): boolean {\n\t\treturn this._rtlMode\n\t}\n\n\t/** master slide layout object */\n\tprivate readonly _masterSlide: PresSlideInternal\n\tpublic get masterSlide(): Slide {\n\t\treturn this._masterSlide\n\t}\n\n\t/** this Presentation's Slide objects */\n\tprivate readonly _slides: PresSlideInternal[]\n\tpublic get slides(): Slide[] {\n\t\treturn this._slides\n\t}\n\n\t/** this Presentation's sections */\n\tprivate readonly _sections: SectionInternalProps[]\n\tpublic get sections(): SectionProps[] {\n\t\treturn this._sections\n\t}\n\n\t/** custom document properties stored in docProps/custom.xml */\n\tprivate _customProperties: Array<{ name: string; value: CustomPropertyValue }>\n\n\t/**\n\t * slide layout definition objects, used for generating slide layout files.\n\t * `protected` (not `private`) so the browser entry subclass can resolve\n\t * `tableToSlides({ masterTitle })` against them — that method lives on the\n\t * browser build only (it reads a live DOM), see `browser.ts`.\n\t */\n\tprotected readonly _slideLayouts: SlideLayoutInternal[]\n\tpublic get slideLayouts(): SlideLayout[] {\n\t\treturn this._slideLayouts\n\t}\n\n\tprivate get internalPresentation(): PresentationPropsInternal {\n\t\treturn {\n\t\t\tauthor: this.author,\n\t\t\tcompany: this.company,\n\t\t\tfirstSlideNum: this.firstSlideNum,\n\t\t\tlayout: this.layout,\n\t\t\tmasterSlide: this._masterSlide,\n\t\t\tpresLayout: this.presLayout,\n\t\t\trevision: this.revision,\n\t\t\trtlMode: this.rtlMode,\n\t\t\tsections: this._sections,\n\t\t\tslideLayouts: this._slideLayouts,\n\t\t\tslides: this._slides,\n\t\t\tsubject: this.subject,\n\t\t\ttheme: this.theme,\n\t\t\ttitle: this.title,\n\t\t\tembeddedFonts: this._embeddedFonts,\n\t\t}\n\t}\n\n\tprivate LAYOUTS: { [key: string]: PresLayout }\n\n\tprivate _presLayout: PresLayout\n\tpublic get presLayout(): PresLayout {\n\t\treturn this._presLayout\n\t}\n\n\tprivate readonly _runtime: RuntimeAdapter\n\n\t/** Write-side font metrics for measured text fit (`fit:'shrink'`). @see registerFontMetrics */\n\tprivate readonly _fontMetrics = new FontMetricsRegistry()\n\n\t/** Author-side embedded font faces, accumulated by {@link embedFont} and emitted at write time. */\n\tprivate readonly _embeddedFonts: EmbeddedFont[] = []\n\n\tconstructor(runtime: RuntimeAdapter) {\n\t\tthis._runtime = runtime\n\t\t// Set available layouts\n\t\tthis.LAYOUTS = {\n\t\t\tLAYOUT_4x3: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_4x3),\n\t\t\tLAYOUT_16x9: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_16x9),\n\t\t\tLAYOUT_16x10: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_16x10),\n\t\t\tLAYOUT_WIDE: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_WIDE),\n\t\t}\n\n\t\t// Core\n\t\tthis._author = 'ts-pptx'\n\t\tthis._company = 'ts-pptx'\n\t\tthis._revision = '1' // Note: Must be a whole number\n\t\tthis._subject = 'ts-pptx Presentation'\n\t\tthis._title = 'ts-pptx Presentation'\n\t\t// ts-pptx props\n\t\tconst defLayout = this.LAYOUTS[DEF_PRES_LAYOUT]\n\t\tif (!defLayout)\n\t\t\tthrow new InternalError(\n\t\t\t\t'layout/default-not-registered',\n\t\t\t\t`Default presentation layout \"${DEF_PRES_LAYOUT}\" is not registered`\n\t\t\t)\n\t\tthis._presLayout = {\n\t\t\tname: defLayout.name,\n\t\t\t_sizeW: defLayout.width,\n\t\t\t_sizeH: defLayout.height,\n\t\t\twidth: defLayout.width,\n\t\t\theight: defLayout.height,\n\t\t}\n\t\tthis._firstSlideNum = 1\n\t\tthis._rtlMode = false\n\t\t//\n\t\tthis._slideLayouts = [\n\t\t\t{\n\t\t\t\t_margin: DEF_SLIDE_MARGIN_IN,\n\t\t\t\t_name: DEF_PRES_LAYOUT_NAME,\n\t\t\t\t_presLayout: this._presLayout,\n\t\t\t\t_rels: [],\n\t\t\t\t_relsChart: [],\n\t\t\t\t_relsMedia: [],\n\t\t\t\t_slide: null,\n\t\t\t\t_slideNum: 1000,\n\t\t\t\t_slideNumberProps: null,\n\t\t\t\t_slideObjects: [],\n\t\t\t},\n\t\t]\n\t\tthis._slides = []\n\t\tthis._sections = []\n\t\tthis._customProperties = []\n\t\tthis._masterSlide = {\n\t\t\taddChart: null,\n\t\t\taddComment: null,\n\t\t\taddConnector: null,\n\t\t\taddImage: null,\n\t\t\taddMedia: null,\n\t\t\taddNotes: null,\n\t\t\taddShape: null,\n\t\t\taddTable: null,\n\t\t\taddText: null,\n\t\t\taddAnimation: null,\n\t\t\t//\n\t\t\t_name: null,\n\t\t\t_animations: [],\n\t\t\t_presLayout: this._presLayout,\n\t\t\t_rId: null,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slideId: null,\n\t\t\t_slideLayout: null,\n\t\t\t_slideNum: null,\n\t\t\t_slideNumberProps: null,\n\t\t\t_slideObjects: [],\n\t\t\t// Deliberately-partial internal stub: the master slide carries only rels/objects,\n\t\t\t// so its authoring methods and ids are intentionally null (never invoked on the master).\n\t\t} as unknown as PresSlideInternal\n\t}\n\n\t/**\n\t * Provides an API for `addTableDefinition` to create slides as needed for auto-paging\n\t * @param {AddSlideProps} options - slide masterTitle and/or sectionTitle\n\t * @return {Slide} new Slide\n\t */\n\tprivate readonly addNewSlide = (options?: AddSlideProps): PresSlideInternal => {\n\t\tconst nextOptions = options || {}\n\t\t// Preserve the originating slide's section for all auto-paged continuation slides.\n\t\t// Search for the section that owns the current last slide rather than assuming it is\n\t\t// the last section — the originating slide may not be at the tail of the deck.\n\t\tconst lastSlide = this._slides[this._slides.length - 1]\n\t\tconst sourceSection = this._sections.find((sect) => sect._slides.some((s) => s._slideNum === lastSlide?._slideNum))\n\t\tnextOptions.sectionTitle = sourceSection?.title ?? undefined\n\n\t\treturn this.addSlide(nextOptions) as PresSlideInternal\n\t}\n\n\t/**\n\t * Provides an API for `addTableDefinition` to get slide reference by number\n\t * @param {number} slideNum - slide number\n\t * @return {Slide} Slide\n\t */\n\tprivate readonly getSlide = (slideNum: number): PresSlideInternal | undefined =>\n\t\tthis._slides.find((slide) => slide._slideNum === slideNum)\n\n\t/**\n\t * Provides the live section list to the `Slide` class so Section/Summary Zoom can resolve\n\t * a section title to its stable GUID and enumerate sections in order.\n\t * @return {SectionInternalProps[]} the presentation's sections\n\t */\n\tprivate readonly getSections = (): SectionInternalProps[] => this._sections\n\n\t/**\n\t * Enables the `Slide` class to set ts-pptx [Presentation] master/layout slidenumbers\n\t * @param {SlideNumberProps} slideNum - slide number config\n\t */\n\tprivate readonly setSlideNumber = (slideNum: SlideNumberProps): void => {\n\t\t// 1: Add slideNumber to slideMaster1.xml\n\t\tthis._masterSlide._slideNumberProps = slideNum\n\n\t\t// 2: Add slideNumber to DEF_PRES_LAYOUT_NAME layout\n\t\tconst defLayout = this._slideLayouts.find((layout) => layout._name === DEF_PRES_LAYOUT_NAME)\n\t\tif (defLayout) defLayout._slideNumberProps = slideNum\n\t}\n\n\t/**\n\t * Assemble the slice of internal state the packaging layer reads. `PresentationCore` owns the\n\t * authored deck; `writePackage` (in `package/assemble.ts`) turns it into OOXML parts.\n\t */\n\tprivate packageSource(): PackageSource {\n\t\treturn {\n\t\t\truntime: this._runtime,\n\t\t\tpresentation: this.internalPresentation,\n\t\t\tcustomProperties: this._customProperties,\n\t\t\tfontMetrics: this._fontMetrics,\n\t\t}\n\t}\n\n\t/**\n\t * Author + serialize this presentation's slides as injectable descriptors,\n\t * WITHOUT producing a `.pptx` package. Runs the same media-encode, placeholder\n\t * backfill, and measured-fit passes `write()` uses, then serializes each slide\n\t * body and resolves its image media to decoded bytes — so a loaded deck can\n\t * splice the slides in via `Presentation.appendSlides()` (see `ts-pptx/read`)\n\t * while keeping its own masters/layouts/theme byte-identical.\n\t *\n\t * Returns the deck's slide size (EMU, for the destination size check) and one\n\t * descriptor per authored slide. Charts, audio/video media, online media, and\n\t * internal slide-to-slide hyperlinks are surfaced as descriptors alongside the\n\t * serialized body — this method does not resolve them into a package; the append\n\t * path consumes each descriptor to reserve the parts and rebuild the rel graph.\n\t */\n\textractSlides = async (opts: { onMediaError?: 'throw' | 'placeholder' } = {}): Promise<ExtractedSlides> => {\n\t\tconst onMediaError = opts.onMediaError ?? 'throw'\n\n\t\t// STEP 1+2: The same pre-serialization pass `buildPackageParts` runs — encode media,\n\t\t// backfill placeholders, bake measured fit — so extracted bodies match a normal write\n\t\t// by construction rather than by keeping two copies in step. See `gen/prepare.ts`.\n\t\t// Only slides here: this method emits no layout or master parts.\n\t\tawait encodeMediaForTargets(this._slides, this._runtime, onMediaError)\n\t\tbakeSlideContent(this._slides, this._fontMetrics)\n\n\t\t// STEP 3: Serialize each slide body and resolve its image media to bytes.\n\t\tconst slides: ExtractedSlide[] = this._slides.map((slide) => {\n\t\t\tconst relByRid = new Map(slide._relsMedia.map((rel) => [rel.rId, rel] as const))\n\n\t\t\t// Embedded audio/video. addMedia (`gen/define/media.ts`) pushes three consecutive\n\t\t\t// _relsMedia entries per item off `mediaRid`: the ECMA audio/video rel\n\t\t\t// (rId=mediaRid), the MS-2007 `media` rel (mediaRid+1, sharing one Target),\n\t\t\t// and the preview image rel (mediaRid+2). The body references all three; we\n\t\t\t// surface the descriptor so appendSlides can reproduce the rel graph. Online\n\t\t\t// media (external link) is excluded — it has a different rel shape and no part.\n\t\t\tconst avPreviewRids = new Set<number>()\n\t\t\tconst avMedia = slide._slideObjects\n\t\t\t\t.filter(\n\t\t\t\t\t(obj) => obj._type === SlideObjectType.media && obj.mtype !== 'online' && typeof obj.mediaRid === 'number'\n\t\t\t\t)\n\t\t\t\t.map((obj) => {\n\t\t\t\t\tconst mtype: 'audio' | 'video' = obj.mtype === 'audio' ? 'audio' : 'video'\n\t\t\t\t\tconst mediaRid = obj.mediaRid as number\n\t\t\t\t\tconst mediaRel = relByRid.get(mediaRid)\n\t\t\t\t\tconst previewRel = relByRid.get(mediaRid + 2)\n\t\t\t\t\tif (!mediaRel || !previewRel) return null\n\t\t\t\t\tconst mediaBytes = decodeBase64ToBytes(typeof mediaRel.data === 'string' ? mediaRel.data : '')\n\t\t\t\t\tconst previewBytes = decodeBase64ToBytes(typeof previewRel.data === 'string' ? previewRel.data : '')\n\t\t\t\t\tif (!mediaBytes || !previewBytes) return null\n\t\t\t\t\tconst mediaExtn = (mediaRel.extn || mediaRel.Target.split('.').pop() || 'mp4').toLowerCase()\n\t\t\t\t\tconst previewExtn = (previewRel.extn || previewRel.Target.split('.').pop() || 'png').toLowerCase()\n\t\t\t\t\tavPreviewRids.add(mediaRid + 2)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmtype,\n\t\t\t\t\t\tmediaRid,\n\t\t\t\t\t\tmsMediaRid: mediaRid + 1,\n\t\t\t\t\t\tpreviewRid: mediaRid + 2,\n\t\t\t\t\t\tmediaBytes,\n\t\t\t\t\t\tmediaExtn,\n\t\t\t\t\t\tmediaContentType: avContentType(mediaExtn, mtype),\n\t\t\t\t\t\tpreviewBytes,\n\t\t\t\t\t\tpreviewExtn,\n\t\t\t\t\t\tpreviewContentType: imageContentType(previewExtn),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.filter((m): m is NonNullable<typeof m> => m !== null)\n\n\t\t\tconst media = slide._relsMedia\n\t\t\t\t// A/V preview images live in _relsMedia as image rels too; they are carried\n\t\t\t\t// by their A/V descriptor, so exclude them from the plain-image media list.\n\t\t\t\t.filter((rel) => rel.type.toLowerCase().includes('image') && !avPreviewRids.has(rel.rId))\n\t\t\t\t.map((rel) => {\n\t\t\t\t\t// Normalize the base64 payload's data-URI prefix, mirroring createChartMediaRels.\n\t\t\t\t\tlet data: string = rel.data && typeof rel.data === 'string' ? rel.data : ''\n\t\t\t\t\tif (!data.includes(',') && !data.includes(';')) data = 'image/png;base64,' + data\n\t\t\t\t\telse if (!data.includes(',')) data = 'image/png;base64,' + data\n\t\t\t\t\telse if (!data.includes(';')) data = 'image/png;' + data\n\t\t\t\t\tconst bytes = decodeBase64ToBytes(data)\n\t\t\t\t\tconst extn = (rel.extn || rel.Target.split('.').pop() || 'png').toLowerCase()\n\t\t\t\t\treturn bytes ? { rId: rel.rId, bytes, extn, contentType: imageContentType(extn) } : null\n\t\t\t\t})\n\t\t\t\t.filter((m): m is NonNullable<typeof m> => m !== null)\n\n\t\t\t// Online (external-link) video. addMedia type:'online' pushes three rels off\n\t\t\t// mediaRid: the ECMA video rel (mediaRid, External), the MS-2007 media rel\n\t\t\t// (mediaRid+1, External, sharing the link Target), and the poster image rel\n\t\t\t// (mediaRid+2, carried by `media` below as a normal image). No media binary\n\t\t\t// part exists; appendSlides reproduces only the two external rels + poster.\n\t\t\tconst onlineMedia = slide._slideObjects\n\t\t\t\t.filter(\n\t\t\t\t\t(obj) => obj._type === SlideObjectType.media && obj.mtype === 'online' && typeof obj.mediaRid === 'number'\n\t\t\t\t)\n\t\t\t\t.map((obj) => {\n\t\t\t\t\tconst mediaRid = obj.mediaRid as number\n\t\t\t\t\tconst videoRel = relByRid.get(mediaRid)\n\t\t\t\t\tif (!videoRel || typeof videoRel.Target !== 'string' || !videoRel.Target) return null\n\t\t\t\t\treturn { mediaRid, msMediaRid: mediaRid + 1, link: videoRel.Target }\n\t\t\t\t})\n\t\t\t\t.filter((m): m is NonNullable<typeof m> => m !== null)\n\n\t\t\tconst hyperlinks = slide._rels\n\t\t\t\t.filter((rel) => isHyperlinkRel(rel) && rel.data !== 'slide')\n\t\t\t\t.map((rel) => ({ rId: rel.rId, target: rel.Target }))\n\n\t\t\t// Internal slide-to-slide links: rel.data === 'slide', rel.Target is the\n\t\t\t// 1-based source slide number (see addText's hyperlink.slide handling).\n\t\t\tconst slideLinks = slide._rels\n\t\t\t\t.filter((rel) => isHyperlinkRel(rel) && rel.data === 'slide')\n\t\t\t\t.map((rel) => ({ rId: rel.rId, sourceSlideNumber: Number(rel.Target) }))\n\n\t\t\t// Charts: serialize the chart part XML + its embedded workbook bytes. The\n\t\t\t// chart part's own .rels (workbook reference) is rebuilt on injection.\n\t\t\tconst charts: ExtractedSlide['charts'] = (slide._relsChart || []).map((rel) => {\n\t\t\t\t// chartEx charts are a different part (`makeXmlChartEx`) behind a different rel type and\n\t\t\t\t// content type, and PowerPoint reports one as corrupt without its style/colors sidecars\n\t\t\t\t// (see gen/chart/chartex-style.ts). Both ride in the descriptor's `chartEx` slot, which\n\t\t\t\t// is what tells `appendSlides` the two shapes apart: it cannot be inferred from the XML,\n\t\t\t\t// and building one as a classic chart is what used to produce a `<c:chartSpace>` with\n\t\t\t\t// axes and no plot behind a slide still pointing at it through `<cx:chart>`.\n\t\t\t\tconst base = { rId: rel.rId, embeddingBytes: buildEmbeddedWorksheet(rel) }\n\t\t\t\treturn rel.isChartEx\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...base,\n\t\t\t\t\t\t\tchartXml: makeXmlChartEx(rel),\n\t\t\t\t\t\t\tchartEx: { styleXml: makeChartExStyleXml(), colorsXml: makeChartExColorsXml() },\n\t\t\t\t\t\t}\n\t\t\t\t\t: { ...base, chartXml: makeXmlCharts(rel) }\n\t\t\t})\n\n\t\t\t// Speaker notes. makeXmlNotesSlide calls buildNotesSlideRels itself (and caches\n\t\t\t// on the slide), so the rels are read back afterwards rather than rebuilt — the\n\t\t\t// body and the rels file must agree on every hyperlink rId. Notes rels reserve\n\t\t\t// rId1=notesMaster and rId2=slide, both of which appendSlides wires itself.\n\t\t\tconst hasNotes = slide._slideObjects.some((obj) => obj._type === SlideObjectType.notes)\n\t\t\tconst notes = hasNotes\n\t\t\t\t? {\n\t\t\t\t\t\txml: makeXmlNotesSlide(slide),\n\t\t\t\t\t\thyperlinks: buildNotesSlideRels(slide)\n\t\t\t\t\t\t\t.filter((rel) => typeof rel.Target === 'string' && rel.Target)\n\t\t\t\t\t\t\t.map((rel) => ({ rId: rel.rId, target: rel.Target })),\n\t\t\t\t\t}\n\t\t\t\t: undefined\n\n\t\t\treturn {\n\t\t\t\txml: makeXmlSlide(slide),\n\t\t\t\tmedia,\n\t\t\t\thyperlinks,\n\t\t\t\tcharts,\n\t\t\t\tslideLinks,\n\t\t\t\tavMedia,\n\t\t\t\tonlineMedia,\n\t\t\t\t...(notes ? { notes } : {}),\n\t\t\t}\n\t\t})\n\n\t\t// Presentation-level embedded fonts (pptx.embedFont) ride alongside the slides\n\t\t// so appendSlides can carry them into the destination deck; same model the\n\t\t// write path serializes (see src/embedded-fonts.ts), passed through unchanged.\n\t\t// A notes slide must bind to a notes master, and a destination template commonly has\n\t\t// none (a deck authored without notes carries no notesMaster part). Ship ours so the\n\t\t// append path can install one; it is discarded when the destination already has one.\n\t\t// theme2.xml is what notesMaster1.xml.rels resolves to on the normal write path.\n\t\tconst notesMaster = slides.some((s) => s.notes)\n\t\t\t? { xml: makeXmlNotesMaster(), themeXml: makeXmlTheme(this.internalPresentation) }\n\t\t\t: undefined\n\n\t\treturn {\n\t\t\twidthEmu: this.presLayout.width,\n\t\t\theightEmu: this.presLayout.height,\n\t\t\tslides,\n\t\t\tembeddedFonts: this._embeddedFonts,\n\t\t\t...(notesMaster ? { notesMaster } : {}),\n\t\t}\n\t}\n\n\t// FONT METRICS (measured text fit)\n\n\t/**\n\t * Register a font's metrics so `fit:'shrink'` text boxes are measured and a real\n\t * `fontScale` is baked at export time (text renders pre-shrunk in headless\n\t * renderers and on plain file-open, with no manual edit/resize).\n\t *\n\t * Without registered metrics, `fit:'shrink'` keeps its current behavior (a bare\n\t * `<a:normAutofit/>` that only PowerPoint recomputes on edit). Register the same\n\t * face once per weight/style you use; bold/italic advances differ.\n\t *\n\t * **Font collections** (`.ttc`/`.otc`, how MS Gothic, Yu Gothic, SimSun, Microsoft\n\t * YaHei and Cambria ship on Windows) hold several fonts in one file, so one has to be\n\t * chosen. With no `font` option, `face` is used as the selector, which is usually what\n\t * you meant; a `face` that names no font in the collection throws rather than falling\n\t * back to the first, since measuring the wrong member is invisible downstream. Pass\n\t * `font` when the deck-side name differs from the name inside the file, and use\n\t * `listFontFaces` from `ts-pptx/measure` to see what a file holds.\n\t * @param {string} face - font family name as used in `fontFace` (e.g. 'Aptos')\n\t * @param {string | Uint8Array | ArrayBuffer} source - font file path/URL (Node/web) or raw TTF/OTF/TTC bytes\n\t * @param {object} [opts] - variant flags (advances differ per weight/style) and collection selection\n\t * @param {boolean} [opts.bold] - these are the bold advances\n\t * @param {boolean} [opts.italic] - these are the italic advances\n\t * @param {number | string} [opts.font] - which font inside a collection: 0-based index, or a name\n\t * @example await pptx.registerFontMetrics('Aptos', '/usr/share/fonts/Aptos.ttf')\n\t * @example await pptx.registerFontMetrics('Aptos', aptosBoldBytes, { bold: true })\n\t * @example await pptx.registerFontMetrics('MS PGothic', 'C:/Windows/Fonts/msgothic.ttc')\n\t * @example await pptx.registerFontMetrics('Cambria Math', 'C:/Windows/Fonts/cambria.ttc', { font: 1 })\n\t */\n\tasync registerFontMetrics(\n\t\tface: string,\n\t\tsource: string | Uint8Array | ArrayBuffer,\n\t\topts?: { bold?: boolean; italic?: boolean; font?: number | string }\n\t): Promise<void> {\n\t\tlet bytes: Uint8Array\n\t\tif (typeof source === 'string') bytes = await this._runtime.loadFontData(source)\n\t\telse if (source instanceof Uint8Array) bytes = source\n\t\telse bytes = new Uint8Array(source)\n\t\t// Only a collection is name-selected. A plain TTF holds one font whose internal\n\t\t// name need not match the deck-side family (registering Silkscreen's bytes under\n\t\t// any `face` has always worked), so defaulting `font` there would break that.\n\t\tconst font = opts?.font ?? (isFontCollection(bytes) ? face : undefined)\n\t\tconst metrics = await parseFontMetrics(bytes, font === undefined ? undefined : { font })\n\t\tthis._fontMetrics.set(face, metrics, { bold: opts?.bold, italic: opts?.italic })\n\t}\n\n\t/**\n\t * Embed a font face so the deck renders with it even on machines that do not\n\t * have it installed. The **whole** face is embedded (not glyph-subset) under\n\t * `/ppt/fonts/` and wired into `presentation.xml` (`p:embeddedFontLst` +\n\t * `embedTrueTypeFonts=\"1\"`), exactly as PowerPoint's \"Embed fonts in the file\"\n\t * does. Call once per face/weight you use.\n\t *\n\t * The declared `typeface` MUST match the family name used in your run/`fontFace`\n\t * typefaces (e.g. `addText('hi', { fontFace: 'Silkscreen' })`) or PowerPoint\n\t * will not bind the embedded bytes to the text. Repeated calls with the same\n\t * `typeface` and different `style` accumulate into one `p:embeddedFont` entry.\n\t *\n\t * Font licensing is the caller's responsibility: the bytes are embedded as\n\t * handed over; `OS/2.fsType` embedding-permission bits are not enforced.\n\t * @param {object} opts - font source + identity\n\t * @param {string} [opts.path] - font file path (Node) or URL (web) to a `.ttf`/`.otf`\n\t * @param {ArrayBuffer | Uint8Array | string} [opts.data] - raw font bytes, or a base64 string, in lieu of `path`\n\t * @param {string} opts.typeface - family name as referenced by run/`fontFace` typefaces\n\t * @param {EmbeddedFontSlot} [opts.style] - face slot; defaults to `'regular'`\n\t * @example await pptx.embedFont({ path: '/fonts/Silkscreen-Regular.ttf', typeface: 'Silkscreen' })\n\t * @example await pptx.embedFont({ path: '/fonts/Silkscreen-Bold.ttf', typeface: 'Silkscreen', style: 'bold' })\n\t */\n\tasync embedFont(opts: {\n\t\tpath?: string\n\t\tdata?: ArrayBuffer | Uint8Array | string\n\t\ttypeface: string\n\t\tstyle?: EmbeddedFontSlot\n\t}): Promise<void> {\n\t\tif (!opts || typeof opts.typeface !== 'string' || opts.typeface.trim() === '') {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'font/missing-typeface',\n\t\t\t\t'embedFont: `typeface` is required (the family name your runs reference)'\n\t\t\t)\n\t\t}\n\t\tconst slot: EmbeddedFontSlot = opts.style ?? 'regular'\n\t\tif (!EMBEDDED_FONT_SLOTS.includes(slot)) {\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'font/invalid-style-slot',\n\t\t\t\t`embedFont: invalid style \"${slot}\"; expected one of ${EMBEDDED_FONT_SLOTS.join(', ')}`\n\t\t\t)\n\t\t}\n\n\t\t// Resolve bytes: a path/URL via the runtime loader, else in-memory data\n\t\t// (Uint8Array / ArrayBuffer / base64 string).\n\t\tlet bytes: Uint8Array\n\t\tif (typeof opts.path === 'string') {\n\t\t\tbytes = await this._runtime.loadFontData(opts.path)\n\t\t} else if (opts.data instanceof Uint8Array) {\n\t\t\tbytes = opts.data\n\t\t} else if (opts.data instanceof ArrayBuffer) {\n\t\t\tbytes = new Uint8Array(opts.data)\n\t\t} else if (typeof opts.data === 'string') {\n\t\t\tconst decoded = decodeBase64ToBytes(\n\t\t\t\topts.data.includes(',') ? opts.data : `application/x-fontdata;base64,${opts.data}`\n\t\t\t)\n\t\t\tif (!decoded) throw new InvalidOptionError('font/invalid-base64', 'embedFont: `data` string is not valid base64')\n\t\t\tbytes = decoded\n\t\t} else {\n\t\t\tthrow new InvalidOptionError('font/missing-source', 'embedFont: provide either `path` or `data`')\n\t\t}\n\n\t\t// Accumulate faces of one family under a single embeddedFont entry; a repeat\n\t\t// of the same typeface+style replaces the prior bytes (last call wins).\n\t\tlet font = this._embeddedFonts.find((f) => f.typeface === opts.typeface)\n\t\tif (!font) {\n\t\t\tfont = { typeface: opts.typeface, faces: [] }\n\t\t\tthis._embeddedFonts.push(font)\n\t\t}\n\t\tconst existing = font.faces.find((f) => f.slot === slot)\n\t\tif (existing) existing.bytes = bytes\n\t\telse font.faces.push({ slot, bytes })\n\t}\n\n\t/**\n\t * Measure how tall text wraps at a given width, using the **same** calibrated wrap\n\t * model the export-time autofit bake uses — so a layout-time prediction matches the\n\t * value `fit:'shrink'`/`'resize'` would bake. Synchronous: register the face's metrics\n\t * first with {@link TsPptx.registerFontMetrics} (lookup is sync).\n\t *\n\t * Lets a consumer size its own geometry before export — grow a card to fit its text,\n\t * reflow a grid, or detect overflow at layout time. Heights err **tall** (conservative),\n\t * so the returned height is ≥ what PowerPoint/LibreOffice render.\n\t * @param {string | TextProps[]} text - a string or run array (per-run options override the defaults in `opts`)\n\t * @param {MeasureTextOptions} opts - width (inches), font size/face (points), and spacing\n\t * @returns {TextMeasurement} laid-out height + line count + fit helpers\n\t * @example const m = pptx.measureText('Long heading…', { wIn: 3, fontSize: 18, fontFace: 'Aptos' })\n\t * @example if (pptx.measureText(runs, { wIn, fontSize, fontFace }).heightIn > cardHeightIn) growCard()\n\t */\n\tmeasureText(text: string | TextProps[], opts: MeasureTextOptions): TextMeasurement {\n\t\treturn measureText(this._fontMetrics, text, opts)\n\t}\n\n\t/**\n\t * Convenience overflow check: `true` if `text` does not fit a box of inner size\n\t * `wIn`×`hIn` (inches) at full size. Because the model errs tall, this is a\n\t * **conservative** (slightly over-reporting) check — appropriate for a build-time\n\t * warning, not a hard gate. An unmeasurable (unnamed theme-default) face reports\n\t * `false` (no overflow) so the linter does not false-positive on faces it cannot measure.\n\t * @param {string | TextProps[]} text - a string or run array\n\t * @param {OverflowBoxOptions} opts - {@link MeasureTextOptions} plus the box inner height `hIn`\n\t * @returns {boolean} true if the text overflows the box\n\t */\n\toverflowsBox(text: string | TextProps[], opts: OverflowBoxOptions): boolean {\n\t\tconst m = measureText(this._fontMetrics, text, opts)\n\t\treturn m.measurable && !m.fitsBox(opts.hIn)\n\t}\n\n\t/**\n\t * Compute the per-cell geometry of a table laid out at `opts.x`/`y`/`w`, without\n\t * adding it to a slide — so a consumer can place images or shapes precisely over\n\t * cells. Column widths (cell `x`/`w`) are exact, derived from the same logic the\n\t * writer uses. Row heights (`y`/`h`) are exact when pinned by `rowH` (array or\n\t * scalar) or table `h`; an auto-height row is estimated with the same conservative\n\t * (tall) text model as {@link TsPptx.measureText} and flagged `heightExact:false`\n\t * (register the cell font via {@link TsPptx.registerFontMetrics} for an exact\n\t * estimate). Geometry is for a single, un-paginated table — `autoPage` paging is\n\t * not modeled.\n\t * @param {TableRow[]} rows - the same `rows` passed to `slide.addTable`\n\t * @param {TableProps} opts - the same table options (`x`, `y`, `w`, `colW`, `rowH`, `h`, …)\n\t * @returns {TableLayoutResult} per-cell rectangles (inches) plus overall table bounds\n\t * @example\n\t * const g = pptx.tableLayout(rows, { x: 1, y: 1, w: 8, colW: [2, 3, 3] })\n\t * const c = g.cells.find(c => c.row === 0 && c.col === 2)\n\t * slide.addImage({ path: 'logo.png', x: c.xIn, y: c.yIn, w: c.wIn, h: c.hIn })\n\t */\n\ttableLayout(rows: TableRow[], opts: TableProps): TableLayoutResult {\n\t\treturn computeTableLayout(rows, opts, this._presLayout, this._fontMetrics)\n\t}\n\n\t// EXPORT METHODS\n\n\t/**\n\t * Export the current presentation as portable ZIP bytes. Unlike the former\n\t * `stream()` method, this does not imply incremental output or convert the\n\t * archive to a Node `Buffer`: package assembly is synchronous and the returned\n\t * `Uint8Array` works unchanged in Node, browsers, and workers.\n\t * @param {WriteBaseProps} props - output properties\n\t * @returns {Promise<Uint8Array>} complete `.pptx` archive bytes\n\t */\n\tasync toBytes(props?: WriteBaseProps): Promise<Uint8Array> {\n\t\treturn (await writePackage(this.packageSource(), {\n\t\t\tcompression: props?.compression,\n\t\t\toutputType: 'uint8array',\n\t\t\tonMediaError: props?.onMediaError,\n\t\t})) as Uint8Array\n\t}\n\n\t/**\n\t * Export the current Presentation as ZIP content with the selected type\n\t * @param {WriteProps} props output properties\n\t * @returns {Promise<string | ArrayBuffer | Blob | Uint8Array>} file content in selected type\n\t */\n\tasync write(props?: WriteProps): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\t\treturn await writePackage(this.packageSource(), {\n\t\t\tcompression: props?.compression,\n\t\t\toutputType: props?.outputType,\n\t\t\tonMediaError: props?.onMediaError,\n\t\t})\n\t}\n\n\t/**\n\t * Assemble the current Presentation into its OOXML package parts WITHOUT zipping — the raw\n\t * `path → bytes` contents `write()` would compress into the `.pptx`. Use this to stream parts\n\t * into a custom container, inspect individual parts, or feed a pipeline that does its own\n\t * archiving. To produce a real `.pptx` file, use {@link write} / {@link writeFile} instead.\n\t *\n\t * The returned parts are byte-identical, per part, to what `write()` emits for the same deck,\n\t * and their order is the package's emission order. Both are a stability-guaranteed observable\n\t * contract: adding a new part in a later release is backward-compatible as long as existing\n\t * part paths and their relative order do not shift; renaming or reordering an existing part is\n\t * a breaking change. Each call returns fresh `Uint8Array` views over per-call buffers (a new\n\t * assembly runs each time), so callers may retain or transfer them without defensive copying.\n\t * @param {PartsProps} props - assembly options (`onMediaError` only; compression/output shape\n\t * are zip concerns that do not apply to unzipped parts)\n\t * @returns {Promise<PackagePart[]>} the package parts in emission order\n\t */\n\tasync toParts(props?: PartsProps): Promise<PackagePart[]> {\n\t\tconst parts = await buildPackageParts(this.packageSource(), { onMediaError: props?.onMediaError })\n\t\t// Drop the internal `store` (DEFLATE) hint — an fflate-era zip optimization, not an OOXML fact.\n\t\treturn parts.map(({ path, data }) => ({ path, data }))\n\t}\n\n\t/**\n\t * Export the current Presentation.\n\t * Write the generated presentation to disk (Node) or trigger a download (browser).\n\t * @param {WriteFileProps} props - output file properties\n\t * @returns {Promise<string>} the presentation name\n\t */\n\tasync writeFile(props?: WriteFileProps): Promise<string> {\n\t\tconst { fileName: rawName = 'Presentation.pptx', compression, onMediaError } = props ?? {}\n\t\tconst fileName = rawName.toLowerCase().endsWith('.pptx') ? rawName : `${rawName}.pptx`\n\n\t\tconst data = await writePackage(this.packageSource(), {\n\t\t\tcompression,\n\t\t\toutputType: this._runtime.writeFileOutputType ?? undefined,\n\t\t\tonMediaError,\n\t\t})\n\t\treturn await this._runtime.writeFile(fileName, data)\n\t}\n\n\t// PRESENTATION METHODS\n\n\t/**\n\t * Set a custom document property stored in `docProps/custom.xml`.\n\t * Calling with the same name replaces the existing value.\n\t * @param name - property name\n\t * @param value - string, integer/float number, boolean, or Date\n\t */\n\tsetCustomProperty(name: string, value: CustomPropertyValue): void {\n\t\tthis._customProperties = this._customProperties.filter((p) => p.name !== name)\n\t\tthis._customProperties.push({ name, value })\n\t}\n\n\t/**\n\t * Add a new Section to Presentation\n\t * @param {SectionProps} section - section properties\n\t * @example pptx.addSection({ title:'Charts' });\n\t */\n\taddSection(section: SectionProps): void {\n\t\tif (!section) {\n\t\t\twarn('section/missing-argument', 'addSection requires an argument')\n\t\t\treturn\n\t\t} else if (!section.title) {\n\t\t\twarn('section/missing-title', 'addSection requires a title')\n\t\t\treturn\n\t\t} else if (this._sections.some((sect) => sect.title === section.title)) {\n\t\t\twarn(\n\t\t\t\t'section/duplicate-title',\n\t\t\t\t`addSection: a section titled \"${section.title}\" already exists; ignoring duplicate`\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tconst newSection: SectionInternalProps = {\n\t\t\t_type: 'user',\n\t\t\t_slides: [],\n\t\t\t_id: `{${getUuid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase()}}`,\n\t\t\ttitle: section.title,\n\t\t}\n\n\t\tif (section.order) this._sections.splice(section.order, 0, newSection)\n\t\telse this._sections.push(newSection)\n\t}\n\n\t/**\n\t * Add a new Slide to Presentation\n\t * @param {AddSlideProps} options - slide options\n\t * @returns {Slide} the new Slide\n\t */\n\taddSlide(options?: AddSlideProps): Slide {\n\t\tconst masterTitle = options?.masterTitle ?? ''\n\t\tconst defLayout = this.LAYOUTS[DEF_PRES_LAYOUT]\n\t\tif (!defLayout)\n\t\t\tthrow new InternalError(\n\t\t\t\t'layout/default-not-registered',\n\t\t\t\t`Default presentation layout \"${DEF_PRES_LAYOUT}\" is not registered`\n\t\t\t)\n\t\tlet slideLayout: SlideLayoutInternal = {\n\t\t\t_name: defLayout.name,\n\t\t\t_presLayout: this.presLayout,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slideNum: this._slides.length + 1,\n\t\t\t_slideObjects: [],\n\t\t}\n\n\t\tif (masterTitle) {\n\t\t\tconst tmpLayout = this._slideLayouts.find((layout) => layout._name === masterTitle)\n\t\t\tif (tmpLayout) slideLayout = tmpLayout\n\t\t}\n\n\t\tconst newSlide: PresSlideInternal = new SlideBuilder({\n\t\t\taddSlide: this.addNewSlide,\n\t\t\tgetSlide: this.getSlide,\n\t\t\tgetSections: this.getSections,\n\t\t\tpresLayout: this.presLayout,\n\t\t\tsetSlideNum: this.setSlideNumber,\n\t\t\tslideId: this._slides.length + 256,\n\t\t\tslideRId: this._slides.length + 2,\n\t\t\tslideNumber: this._slides.length + 1,\n\t\t\tslideLayout,\n\t\t})\n\n\t\t// A: Add slide to pres\n\t\tthis._slides.push(newSlide)\n\n\t\t// B: Sections\n\t\t// B-1: Add slide to section (if any provided)\n\t\t// B-2: Handle slides without a section when sections are already is use (\"loose\" slides arent allowed, they all need a section)\n\t\tif (options?.sectionTitle) {\n\t\t\tconst sect = this._sections.find((section) => section.title === options.sectionTitle)\n\t\t\tif (!sect)\n\t\t\t\twarn('slide/section-not-found', `addSlide: unable to find section with title: \"${options.sectionTitle}\"`)\n\t\t\telse sect._slides.push(newSlide)\n\t\t} else if (this._sections && this._sections.length > 0 && !options?.sectionTitle) {\n\t\t\tconst lastSect = this._sections[this._sections.length - 1]\n\n\t\t\t// CASE 1: The latest section is a default type - just add this one\n\t\t\tif (lastSect?._type === 'default') lastSect._slides.push(newSlide)\n\t\t\t// CASE 2: There latest section is NOT a default type - create the defualt, add this slide\n\t\t\telse {\n\t\t\t\tthis._sections.push({\n\t\t\t\t\ttitle: `Default-${this._sections.filter((sect) => sect._type === 'default').length + 1}`,\n\t\t\t\t\t_type: 'default',\n\t\t\t\t\t_id: `{${getUuid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase()}}`,\n\t\t\t\t\t_slides: [newSlide],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn newSlide\n\t}\n\n\t/**\n\t * Create a custom Slide Layout in any size\n\t * @param {PresLayout} layout - layout properties\n\t * @example pptx.defineLayout({ name:'A3', width:16.5, height:11.7 });\n\t */\n\tdefineLayout(layout: PresLayout): void {\n\t\t// @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e\n\t\tif (!layout) warn('layout/invalid-definition', 'defineLayout requires `{name, width, height}`')\n\t\telse if (!layout.name) warn('layout/invalid-definition', 'defineLayout requires `name`')\n\t\telse if (!layout.width) warn('layout/invalid-definition', 'defineLayout requires `width`')\n\t\telse if (!layout.height) warn('layout/invalid-definition', 'defineLayout requires `height`')\n\t\telse if (typeof layout.height !== 'number')\n\t\t\twarn('layout/invalid-definition', 'defineLayout `height` should be a number (inches)')\n\t\telse if (typeof layout.width !== 'number')\n\t\t\twarn('layout/invalid-definition', 'defineLayout `width` should be a number (inches)')\n\n\t\tthis.LAYOUTS[layout.name] = {\n\t\t\tname: layout.name,\n\t\t\t_sizeW: inchesToEmu(Number(layout.width)),\n\t\t\t_sizeH: inchesToEmu(Number(layout.height)),\n\t\t\twidth: inchesToEmu(Number(layout.width)),\n\t\t\theight: inchesToEmu(Number(layout.height)),\n\t\t}\n\t}\n\n\t/**\n\t * Create a new slide master [layout] for the Presentation\n\t * @param {SlideMasterProps} props - layout properties\n\t */\n\tdefineSlideMaster(props: SlideMasterProps): void {\n\t\t// deep clone the props object to avoid mutating the original object.\n\t\t// structuredClone preserves the `SlideMasterProps` type (unlike JSON round-tripping, which widens to `any`).\n\t\tconst propsClone = structuredClone(props)\n\t\tif (!propsClone.title)\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'master/missing-title',\n\t\t\t\t'defineSlideMaster() object argument requires a `title` value.'\n\t\t\t)\n\n\t\tconst newLayout: SlideLayoutInternal = {\n\t\t\t_margin: propsClone.margin || DEF_SLIDE_MARGIN_IN,\n\t\t\t// Kept RAW (unescaped) here, unlike `objectName`'s single-escape-upstream design: `_name`\n\t\t\t// doubles as the lookup key `addSlide({masterTitle})` matches against the caller's raw\n\t\t\t// `title` string (see the `layout._name === masterTitle` comparisons in this file).\n\t\t\t// Escaping it here would break that match for any title containing `&`/`<`/`\"`. It's\n\t\t\t// escaped once at emission instead -- see `slideObjectToXml` in gen/slide/object.ts.\n\t\t\t_name: propsClone.title,\n\t\t\t_presLayout: this.presLayout,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slide: null,\n\t\t\t_slideNum: 1000 + this._slideLayouts.length + 1,\n\t\t\t_slideNumberProps: propsClone.slideNumber || null,\n\t\t\t_slideObjects: [],\n\t\t\tbackground: propsClone.background,\n\t\t}\n\n\t\t// STEP 1: Create the Slide Master/Layout\n\t\tcreateSlideMaster(propsClone, newLayout)\n\n\t\t// STEP 1b: Master text styles (<p:txStyles>) live on the single shared slide master, not per-layout.\n\t\t// Merge each provided group (title/body/other) onto the master, last-call-wins (deck-wide).\n\t\tif (propsClone.textStyles && typeof propsClone.textStyles === 'object') {\n\t\t\tthis._masterSlide._txStyles = { ...this._masterSlide._txStyles, ...propsClone.textStyles }\n\t\t}\n\n\t\t// STEP 2: Add it to layout defs\n\t\tthis._slideLayouts.push(newLayout)\n\n\t\t// STEP 3: Add background (image data/path must be captured before the package is built)\n\t\tif (propsClone.background) addBackgroundDefinition(propsClone.background, newLayout)\n\n\t\t// STEP 4: Add slideNumber to master slide (if any)\n\t\tif (newLayout._slideNumberProps && !this._masterSlide._slideNumberProps)\n\t\t\tthis._masterSlide._slideNumberProps = newLayout._slideNumberProps\n\t}\n}\n","/**\n * The parts of a runtime adapter that are not runtime-specific.\n *\n * `fetch`, `btoa` and `TextEncoder` exist in Node, in every browser, and in the edge/worker\n * runtimes the neutral adapter serves, so the remote-load paths were the same code in all three\n * adapters — byte-identical in two of them and an inline branch in the third. What is genuinely\n * per-runtime stays in each adapter: `node:fs`, `FileReader`, the canvas rasterizer, the\n * `<a download>` writer.\n *\n * Nothing here touches a host global beyond `fetch`.\n */\n\nimport { IMG_SVG_PLACEHOLDER } from '../media/placeholders.js'\nimport { MediaError } from '../errors.js'\nimport { bytesToBase64 } from '../media/base64.js'\nimport type { SlideRelMedia } from '../types/internal.js'\n\n/**\n * Whether `source` names something to `fetch` rather than something to read from a filesystem.\n *\n * A real scheme test, not `source.startsWith('http')`. That prefix matched a *relative path* —\n * `httpdocs/logo.png`, `http-icons/x.svg` — and sent it to `fetch`, which then failed with a\n * fetch error naming a file that exists on disk. It was also case-sensitive, so\n * `HTTPS://example.com/f.ttf` missed and went to `fs.readFile`.\n *\n * Only `http:` and `https:` count. A `file:` or `data:` URL falls through to the adapter's\n * local branch, where it fails — the same as before this was tightened, and deliberately left\n * that way: making either work is a feature with its own decisions (what a `file:` URL means\n * off Node, whether a `data:` URL should bypass loading entirely), not a side effect of fixing\n * a prefix test.\n */\nexport function isRemote(source: string): boolean {\n\tconst scheme = /^([a-z][a-z0-9+.-]*):/i.exec(source)?.[1]?.toLowerCase()\n\treturn scheme === 'http' || scheme === 'https'\n}\n\n/** Fetch a font file into raw bytes for `registerFontMetrics`. */\nexport async function fetchFontBytes(source: string): Promise<Uint8Array> {\n\tconst response = await fetch(source)\n\tif (!response.ok) throw new MediaError('font/fetch-failed', `Unable to load font (fetch): ${source}`)\n\treturn new Uint8Array(await response.arrayBuffer())\n}\n\n/**\n * Fetch a media file as raw base64 (no `data:` prefix) — see {@link RuntimeAdapter.loadMedia}\n * for why both encodings are accepted.\n *\n * Encodes through `bytesToBase64` rather than `Buffer`, so the same function serves a runtime\n * that has no `Buffer`. The Node adapter still uses `Buffer` on its *filesystem* branch, where\n * it is both available and faster on a large payload.\n */\nexport async function fetchMediaBase64(path: string): Promise<string> {\n\tconst response = await fetch(path)\n\tif (!response.ok) throw new MediaError('media/fetch-failed', `Unable to load image (fetch): ${path}`)\n\treturn bytesToBase64(new Uint8Array(await response.arrayBuffer()))\n}\n\n/**\n * The SVG-preview fallback for a runtime with no canvas: stamp the placeholder PNG.\n *\n * An SVG placed on a slide needs a raster fallback beside it for viewers that will not render\n * the SVG. Rasterizing needs a canvas, which only the browser adapter has, so everywhere else\n * the fallback is a fixed placeholder image rather than a missing part.\n */\nexport async function placeholderSvgPreview(rel: SlideRelMedia): Promise<string> {\n\trel.data = IMG_SVG_PLACEHOLDER\n\treturn 'done'\n}\n","/**\n * ts-pptx: named clip silhouettes for images\n *\n * A `ClipShape` is declarative data — a named silhouette plus its options — and {@link clipPath}\n * resolves it to the freeform `points` path `addImage` emits as the `<a:custGeom>` clip mask on\n * the `<p:pic>`. Paired with `sizing: { type: 'cover' }` (an `<a:srcRect>` crop) it reproduces\n * what a PowerPoint *picture placeholder* does — a layout `custGeom` clipping an inherited\n * blipFill — but standalone, with no placeholder involved.\n *\n * These are silhouettes recurring often enough in real decks to be worth naming; hand-authored\n * `points` remain available for anything else. Nothing here is theme- or brand-aware: which\n * silhouette to use, and which edge it sits flush to, belongs to the caller.\n *\n * ## The coordinate trap\n *\n * Coordinates come back in the image box's OWN inch space (`0..w`, `0..h`), because `custGeom`\n * points expressed as `%` resolve against the SLIDE, not the box. A box-relative silhouette must\n * therefore be emitted in inches already scaled to the box, which is why {@link clipPath} takes\n * the box size: the fractions below are multiplied by `w` / `h` at build time, so one silhouette\n * scales with whatever region it is handed. Authoring the same shape as percentages would put\n * the clip in the wrong place on every box that is not the full slide.\n */\n\nimport type { GeometryPoint } from './types/index.js'\n\n/**\n * Which edge of the box is the half-disc's FLAT side; the arc bulges toward the opposite edge.\n * `'right'` = flat right edge, arc bulging left.\n */\nexport type FlatSide = 'left' | 'right'\n\n/**\n * Which half-disc proportion to trace. Both are flat-on-one-edge, bulging half-discs whose arc\n * reaches the opposite edge near mid-height; they differ only in how far the arc reaches.\n * - `'deep'` — the arc spans about 32% of the box width, symmetric about mid-height (the default).\n * - `'shallow'` — the arc spans about 13%, slightly asymmetric, with its apex just below mid-height.\n */\nexport type HalfDiscPreset = 'deep' | 'shallow'\n\n/** A named clip silhouette, resolved to a `points` path by {@link clipPath}. */\nexport type ClipShape =\n\t/**\n\t * A rectangle with one side replaced by an elliptical arc that bulges toward the opposite\n\t * edge, reaching it near mid-height — the \"D\" a picture placeholder cuts on a cover slide.\n\t */\n\t{ kind: 'half-disc'; flat: FlatSide; preset?: HalfDiscPreset }\n\n/**\n * A half-disc as box fractions, flat side on the RIGHT (`x = 1`), the arc bulging LEFT toward\n * `x = 0` near mid-height. Two cubic Béziers trace the half-ellipse: the path runs\n * top-flat-corner → top-right → bottom-right → bottom-flat-corner → bottom tip, cubic up to the\n * mid-left apex, cubic back to the top tip, then closes.\n *\n * Each preset spells out every fraction rather than sharing a mirrored `topEdgeX`, because the\n * presets are independent freeforms — the shallow one is asymmetric top-to-bottom, so a\n * symmetric parameterization could not express it without changing its shape.\n */\ninterface HalfDiscSpec {\n\t/** x where the TOP edge departs the flat side toward the arc. */\n\ttopEdgeX: number\n\t/** x where the BOTTOM edge departs the flat side (may differ from the top). */\n\tbotEdgeX: number\n\t/** x where the arc leaves the top edge. */\n\ttipTopX: number\n\t/** y where the arc leaves the top edge. */\n\ttipTopY: number\n\t/** x where the arc leaves the bottom edge. */\n\ttipBotX: number\n\t/** y where the arc leaves the bottom edge. */\n\ttipBotY: number\n\t/** y of the bulge apex (at `x = 0`). */\n\tapexY: number\n\t/** Bottom-segment controls: from the bottom tip, cubic to the apex. */\n\tc1b: { x: number; y: number }\n\tc2b: { x: number; y: number }\n\t/** Top-segment controls: from the apex, cubic back to the top tip. */\n\tc1t: { x: number; y: number }\n\tc2t: { x: number; y: number }\n}\n\n/** `deep` — symmetric top/bottom, apex at mid-height. */\nconst DEEP_DISC: HalfDiscSpec = {\n\ttopEdgeX: 0.31788,\n\tbotEdgeX: 0.31788,\n\ttipTopX: 0.30061,\n\ttipTopY: 0.01078,\n\ttipBotX: 0.30061,\n\ttipBotY: 0.98922,\n\tapexY: 0.5,\n\tc1b: { x: 0.11594, y: 0.86833 },\n\tc2b: { x: 0.0, y: 0.69392 },\n\tc1t: { x: 0.0, y: 0.30609 },\n\tc2t: { x: 0.11594, y: 0.13167 },\n}\n\n/** `shallow` — a slightly asymmetric top/bottom inset and an apex just below mid-height. */\nconst SHALLOW_DISC: HalfDiscSpec = {\n\ttopEdgeX: 0.12611,\n\tbotEdgeX: 0.11128,\n\ttipTopX: 0.09976,\n\ttipTopY: 0.05448,\n\ttipBotX: 0.09976,\n\ttipBotY: 0.97617,\n\tapexY: 0.51533,\n\tc1b: { x: 0.03522, y: 0.83247 },\n\tc2b: { x: 0.0, y: 0.67725 },\n\tc1t: { x: 0.0, y: 0.3534 },\n\tc2t: { x: 0.03522, y: 0.19818 },\n}\n\nconst HALF_DISC: Record<HalfDiscPreset, HalfDiscSpec> = { deep: DEEP_DISC, shallow: SHALLOW_DISC }\n\n/**\n * Half-disc clip path for a `w × h` box. Authored flat-right; `flat: 'left'` mirrors `x → 1 - x`.\n */\nfunction halfDisc(w: number, h: number, flat: FlatSide, preset: HalfDiscPreset): GeometryPoint[] {\n\tconst s = HALF_DISC[preset]\n\tconst fx = flat === 'left' ? (x: number): number => (1 - x) * w : (x: number): number => x * w\n\tconst fy = (y: number): number => y * h\n\treturn [\n\t\t{ x: fx(s.topEdgeX), y: fy(0), moveTo: true },\n\t\t{ x: fx(1), y: fy(0) },\n\t\t{ x: fx(1), y: fy(1) },\n\t\t{ x: fx(s.botEdgeX), y: fy(1) },\n\t\t{ x: fx(s.tipBotX), y: fy(s.tipBotY) },\n\t\t{\n\t\t\tx: fx(0),\n\t\t\ty: fy(s.apexY),\n\t\t\tcurve: { type: 'cubic', x1: fx(s.c1b.x), y1: fy(s.c1b.y), x2: fx(s.c2b.x), y2: fy(s.c2b.y) },\n\t\t},\n\t\t{\n\t\t\tx: fx(s.tipTopX),\n\t\t\ty: fy(s.tipTopY),\n\t\t\tcurve: { type: 'cubic', x1: fx(s.c1t.x), y1: fy(s.c1t.y), x2: fx(s.c2t.x), y2: fy(s.c2t.y) },\n\t\t},\n\t\t{ close: true },\n\t]\n}\n\n/**\n * Resolve a {@link ClipShape} to a freeform `points` path filling a `w × h` box, ready to hand\n * to `addImage({ points })`.\n *\n * `w`/`h` are the image box's size **in inches** and must match the `w`/`h` the picture is drawn\n * at — the path is emitted in the box's own coordinate space, not normalized (see the module\n * note above).\n * @param {ClipShape} shape - the named silhouette and its options\n * @param {number} w - image box width (inches)\n * @param {number} h - image box height (inches)\n * @returns {GeometryPoint[]} the freeform path, for `addImage({ points })`\n * @example\n * const w = 5.22, h = 7.5\n * slide.addImage({\n * path: 'cover.jpg', x: 0, y: 0, w, h,\n * points: clipPath({ kind: 'half-disc', flat: 'right' }, w, h),\n * sizing: { type: 'cover' }, // center-crop the photo into the \"D\"\n * })\n */\nexport function clipPath(shape: ClipShape, w: number, h: number): GeometryPoint[] {\n\tswitch (shape.kind) {\n\t\tcase 'half-disc':\n\t\t\treturn halfDisc(w, h, shape.flat, shape.preset ?? 'deep')\n\t}\n}\n","/**\n * Text types: the `TextBaseProps` paragraph/run contract shared by text, table cells and charts;\n * `TextPropsOptions`/`TextProps`; measurement and layout results; notes and comments.\n *\n * Re-exported by `./index.js`, which is the import site for the rest of `src/`.\n */\nimport type { AlignH, SHAPE_NAME, TextAnchor } from '../enums.js'\nimport type {\n\tColor,\n\tDataOrPathProps,\n\tGeometryPoint,\n\tHAlign,\n\tHexColor,\n\tMargin,\n\tPositionProps,\n\tTextVertType,\n\tVAlign,\n} from './core.js'\nimport type { ShapeAdjustValue } from './shape.js'\nimport type { ObjectNameProps } from './object.js'\nimport type { HyperlinkProps, ShadowProps, ShapeFillProps, ShapeLineProps } from './style.js'\n\n// used by: chart, slide, table, text\nexport interface TextBaseProps {\n\t/**\n\t * Horizontal alignment\n\t *\n\t * When a shape's text is an array of runs, set this on **every run** of a paragraph.\n\t * {@link breakLine} is not the only paragraph boundary: two adjacent runs whose `align`\n\t * differs start a new one, so stating it on the opening run alone splits the paragraph in\n\t * two. That is the mirror of {@link bullet}, {@link paraMarginLeft} and {@link paraIndent},\n\t * which are read from the opening run only. Neither mistake changes the run count — the\n\t * only symptom is a differently shaped paragraph, with no error.\n\t * @default 'left'\n\t */\n\talign?: HAlign\n\t/**\n\t * Bold style\n\t * @default false\n\t */\n\tbold?: boolean\n\t/**\n\t * Add a line-break\n\t * @default false\n\t */\n\tbreakLine?: boolean\n\t/**\n\t * Preset text warp / WordArt shape (`<a:bodyPr><a:prstTxWarp prst=\"..\">`), which\n\t * bends the text along a preset path (arch, circle, wave, …). The value is an\n\t * OOXML `ST_TextShapeType` preset name.\n\t * @example 'textArchUp' // bend text along an upward arch (e.g. a label following a ring/arc)\n\t * @example 'textCircle'\n\t */\n\ttextWarp?: string\n\t/**\n\t * Add standard or custom bullet\n\t * - use `true` for standard bullet\n\t * - pass object options for custom bullet\n\t * - `false` (and omitting the option) is the *explicit off*: it writes `<a:buNone/>`\n\t * plus `marL=\"0\" indent=\"0\"`, which overrides whatever bullet the layout's or\n\t * master's list style sets for this level\n\t * - `'inherit'` states nothing at all — no bullet child and no margin attributes — so\n\t * the list style keeps reaching the paragraph. This is the one state omission\n\t * cannot spell, because omitting the option means `false` here for compatibility\n\t *\n\t * The margins are only a *default* of the bullet state: {@link paraMarginLeft} and\n\t * {@link paraIndent} state `@marL`/`@indent` independently in any of the three, including\n\t * an inherited margin under a drawn bullet.\n\t *\n\t * When a shape's text is an array of runs, state this on the **opening run only**. A run\n\t * that draws a bullet starts a new paragraph by itself, so repeating it — the placement\n\t * that {@link align} requires — turns one three-run paragraph into three one-run\n\t * paragraphs. A paragraph takes its properties from its first run.\n\t * @default false\n\t */\n\tbullet?:\n\t\t| boolean\n\t\t| 'inherit'\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Bullet type\n\t\t\t\t * @default bullet\n\t\t\t\t */\n\t\t\t\ttype?: 'bullet' | 'number'\n\t\t\t\t/**\n\t\t\t\t * Bullet character code (unicode)\n\t\t\t\t * @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA)\n\t\t\t\t */\n\t\t\t\tcharacterCode?: string\n\t\t\t\t/**\n\t\t\t\t * Bullet glyph font typeface (`<a:buFont/>`), e.g. for symbol-font bullets\n\t\t\t\t * @example 'Wingdings' // render `characterCode` using the Wingdings font\n\t\t\t\t */\n\t\t\t\tfontFace?: string\n\t\t\t\t/**\n\t\t\t\t * Bullet glyph size as a percentage of the run's text size (25–400)\n\t\t\t\t * @default 100\n\t\t\t\t * @example 80 // bullet glyph is 80% of the text size\n\t\t\t\t */\n\t\t\t\tsize?: number\n\t\t\t\t/**\n\t\t\t\t * Indentation (space between bullet and text) (points)\n\t\t\t\t * @default 27 // DEF_BULLET_MARGIN\n\t\t\t\t * @example 10 // Indents text 10 points from bullet\n\t\t\t\t */\n\t\t\t\tindent?: number\n\t\t\t\t/**\n\t\t\t\t * Number type\n\t\t\t\t * @example 'romanLcParenR' // roman numerals lower-case with paranthesis right\n\t\t\t\t */\n\t\t\t\tnumberType?:\n\t\t\t\t\t| 'alphaLcParenBoth'\n\t\t\t\t\t| 'alphaLcParenR'\n\t\t\t\t\t| 'alphaLcPeriod'\n\t\t\t\t\t| 'alphaUcParenBoth'\n\t\t\t\t\t| 'alphaUcParenR'\n\t\t\t\t\t| 'alphaUcPeriod'\n\t\t\t\t\t| 'arabicParenBoth'\n\t\t\t\t\t| 'arabicParenR'\n\t\t\t\t\t| 'arabicPeriod'\n\t\t\t\t\t| 'arabicPlain'\n\t\t\t\t\t| 'romanLcParenBoth'\n\t\t\t\t\t| 'romanLcParenR'\n\t\t\t\t\t| 'romanLcPeriod'\n\t\t\t\t\t| 'romanUcParenBoth'\n\t\t\t\t\t| 'romanUcParenR'\n\t\t\t\t\t| 'romanUcPeriod'\n\t\t\t\t/**\n\t\t\t\t * Number bullets start at\n\t\t\t\t * @default 1\n\t\t\t\t * @example 10 // numbered bullets start with 10\n\t\t\t\t */\n\t\t\t\tnumberStartAt?: number\n\t\t\t\t/**\n\t\t\t\t * Image to use as the bullet glyph (\"picture bullet\", `<a:buBlip>`)\n\t\t\t\t * - supply an image `path` (filesystem/URL) or base64 `data` (same forms as `addImage()`)\n\t\t\t\t * - raster formats (PNG/JPG/GIF) and SVG are supported; use `size` to scale relative to the text height\n\t\t\t\t * - SVG bullets embed a PNG preview plus the SVG (the same dual-rel handling as `addImage()`)\n\t\t\t\t * - takes precedence over `type`/`characterCode` when set\n\t\t\t\t * @example image: { path: 'images/star.png' }\n\t\t\t\t * @example image: { data: 'image/png;base64,iVBOR...' }\n\t\t\t\t * @example image: { path: 'images/star.svg' }\n\t\t\t\t */\n\t\t\t\timage?: { path?: string; data?: string }\n\t\t\t\t/**\n\t\t\t\t * Relationship id assigned to a picture-bullet image (`<a:blip r:embed>`)\n\t\t\t\t * - for SVG bullets this is the PNG-preview rel; the SVG rel is `_rIdSvg`\n\t\t\t\t * @internal populated by `addText()`; do not set directly\n\t\t\t\t */\n\t\t\t\t_rId?: number\n\t\t\t\t/**\n\t\t\t\t * Relationship id of the SVG image for an SVG picture bullet (`<asvg:svgBlip r:embed>`)\n\t\t\t\t * @internal populated by `addText()`; do not set directly\n\t\t\t\t */\n\t\t\t\t_rIdSvg?: number\n\t\t\t\t/**\n\t\t\t\t * Bullet glyph color (separate from the text run color)\n\t\t\t\t * @example 'FF0000' // red bullet\n\t\t\t\t */\n\t\t\t\tcolor?: HexColor\n\t\t }\n\t/**\n\t * Text capitalization (`a:rPr/@cap`, `ST_TextCapsType`)\n\t * - `'all'` = ALL CAPS\n\t * - `'small'` = Small Caps\n\t * - `'none'` = the *explicit off*: it writes `cap=\"none\"`, which overrides a capitalization\n\t * the run would otherwise inherit. Omitting the option states nothing and lets that\n\t * inheritance stand\n\t * - PowerPoint: Font > Effects > All Caps / Small Caps\n\t * @default (unset) inherit\n\t */\n\tcaps?: 'none' | 'small' | 'all'\n\t/**\n\t * Text color\n\t * - `HexColor` or `ThemeColor`\n\t * - MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Color\n\t * @example 'FF0000' // hex color (red)\n\t * @example SchemeColor.text1 // Theme color (Text1)\n\t */\n\tcolor?: Color\n\t/**\n\t * Font face name\n\t *\n\t * Applied to the Latin (`<a:latin>`) and complex-script (`<a:cs>`) font slots, matching\n\t * how PowerPoint writes a font picked from the UI. The East Asian slot (`<a:ea>`) is left\n\t * to inherit from the theme unless `fontFaceEA` is set — forcing a Latin-only face into the\n\t * East Asian slot duplicates/ghosts text in Office 365.\n\t * @example 'Arial' // Arial font\n\t */\n\tfontFace?: string\n\t/**\n\t * East Asian font face name (`<a:ea>` slot), used to render CJK (Chinese/Japanese/Korean) glyphs\n\t *\n\t * Set this when the East Asian font differs from `fontFace`. When omitted, `<a:ea>` inherits the\n\t * theme East Asian font, which is what PowerPoint does for Latin fonts.\n\t * @example '微軟正黑體' // render East Asian glyphs with Microsoft JhengHei\n\t */\n\tfontFaceEA?: string\n\t/**\n\t * Font size\n\t * @example 12 // Font size 12\n\t */\n\tfontSize?: number\n\t/**\n\t * Text highlight color (hex format)\n\t * @example 'FFFF00' // yellow\n\t */\n\thighlight?: HexColor\n\t/**\n\t * italic style\n\t * @default false\n\t */\n\titalic?: boolean\n\t/**\n\t * language\n\t * - ISO 639-1 standard language code\n\t * @default 'en-US' // english US\n\t * @example 'fr-CA' // french Canadian\n\t */\n\tlang?: string\n\t/**\n\t * First-line indent (points) — `a:pPr/@indent`, the offset of the paragraph's FIRST line\n\t * from {@link paraMarginLeft}. Negative hangs the first line to the left of the body, which\n\t * is what a bulleted paragraph does; positive indents it to the right, the \"first line\n\t * indented\" prose form. PowerPoint: Paragraph > Indentation > Special.\n\t * - `'inherit'` writes no `@indent` at all, so the paragraph takes whatever its list style\n\t * (`a:lstStyle` → placeholder → layout → master) sets — the same third state\n\t * {@link bullet} spells, on the attribute beside it\n\t * - omitting the option keeps the bullet-derived default: a drawn bullet hangs the first\n\t * line by its margin, `bullet: false` writes `indent=\"0\"`, `bullet: 'inherit'` writes\n\t * nothing\n\t * - a value here overrides all of those, in every bullet state\n\t * @example -18 // hang the first line 18pt left of the body text\n\t * @example 18 // indent the first line 18pt, prose style\n\t * @example 'inherit' // keep the list style's indent, even on a bulleted paragraph\n\t * @remarks Read from the **opening run** of a paragraph, like {@link bullet} and unlike\n\t * {@link align}; a value on a continuation run is ignored.\n\t */\n\tparaIndent?: number | 'inherit'\n\t/**\n\t * Left margin of the paragraph (points) — `a:pPr/@marL`, where the paragraph's body text\n\t * starts. This is the paragraph's own margin, not the text frame's internal padding\n\t * (`margin`) and not the discrete outline level (`indentLevel`, which writes `a:p/@lvl`).\n\t * PowerPoint: Paragraph > Indentation > Before text.\n\t * - `'inherit'` writes no `@marL` at all, so the paragraph takes whatever its list style\n\t * (`a:lstStyle` → placeholder → layout → master) sets — the third state that omission\n\t * cannot spell, since omitting it writes the bullet-derived default\n\t * - omitting the option keeps that default: a drawn bullet writes its own margin (see\n\t * `bullet.indent`), `bullet: false` writes `marL=\"0\"`, `bullet: 'inherit'` writes nothing\n\t * - a value here overrides all of those, in every bullet state\n\t * @example 36 // body text starts 36pt (0.5in) from the frame's text edge\n\t * @example 'inherit' // keep the list style's margin, even on a bulleted paragraph\n\t * @remarks Read from the **opening run** of a paragraph, like {@link bullet} and unlike\n\t * {@link align}; a value on a continuation run is ignored.\n\t */\n\tparaMarginLeft?: number | 'inherit'\n\t/**\n\t * Add a soft line-break (shift+enter) before line text content\n\t * @default false\n\t */\n\tsoftBreakBefore?: boolean\n\t/**\n\t * tab stops\n\t * - PowerPoint: Paragraph > Tabs > Tab stop position\n\t * @example [{ position:1 }, { position:3 }] // Set first tab stop to 1 inch, set second tab stop to 3 inches\n\t */\n\ttabStops?: Array<{ position: number; alignment?: 'l' | 'r' | 'ctr' | 'dec' }>\n\t/**\n\t * text direction\n\t * `horz` = horizontal\n\t * `vert` = rotate 90^\n\t * `vert270` = rotate 270^\n\t * `wordArtVert` = stacked\n\t * @default 'horz'\n\t */\n\ttextDirection?: 'horz' | 'vert' | 'vert270' | 'wordArtVert'\n\t/**\n\t * Transparency (percent)\n\t * - MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Transparency\n\t * - range: 0-100\n\t * @default 0\n\t */\n\ttransparency?: number\n\t/**\n\t * underline properties\n\t * - PowerPoint: Font > Color & Underline > Underline Style/Underline Color\n\t * - `style` is the full `ST_TextUnderlineType` enumeration (ECMA-376 §20.1.10.81)\n\t * - `'none'` is the *explicit off*: it writes `a:rPr/@u=\"none\"`, which overrides an\n\t * underline the run would otherwise inherit from its list style, placeholder, layout or\n\t * master. Omitting the option instead states nothing and lets that inheritance stand —\n\t * the two are different facts, not two spellings of one.\n\t * @default (unset) inherit\n\t */\n\tunderline?: {\n\t\tstyle?:\n\t\t\t| 'dash'\n\t\t\t| 'dashHeavy'\n\t\t\t| 'dashLong'\n\t\t\t| 'dashLongHeavy'\n\t\t\t| 'dbl'\n\t\t\t| 'dotDash'\n\t\t\t| 'dotDashHeavy'\n\t\t\t| 'dotDotDash'\n\t\t\t| 'dotDotDashHeavy'\n\t\t\t| 'dotted'\n\t\t\t| 'dottedHeavy'\n\t\t\t| 'heavy'\n\t\t\t| 'none'\n\t\t\t| 'sng'\n\t\t\t| 'wavy'\n\t\t\t| 'wavyDbl'\n\t\t\t| 'wavyHeavy'\n\t\t\t| 'words'\n\t\tcolor?: Color\n\t}\n\t/**\n\t * vertical alignment\n\t * @default 'top'\n\t */\n\tvalign?: VAlign\n}\n\nexport interface TextGlowProps {\n\t/**\n\t * Border color (hex format)\n\t * @example 'FF3399'\n\t */\n\tcolor?: HexColor\n\t/**\n\t * opacity (0.0 - 1.0)\n\t * @example 0.5\n\t * 50% opaque\n\t */\n\topacity?: number\n\t/**\n\t * size (points)\n\t */\n\tsize: number\n}\n\nexport interface TextFitShrinkProps {\n\t/**\n\t * Shrink text on overflow (`<a:normAutofit>`)\n\t */\n\ttype: 'shrink'\n\t/**\n\t * Font scale as a percent (0-100), mapped to `<a:normAutofit fontScale=\"..\">`.\n\t *\n\t * PowerPoint normally calculates this dynamically when text overflows; set it\n\t * explicitly to bake the scale into the generated file.\n\t * @example 85 // render text at 85% of its nominal size\n\t * @default undefined // attribute omitted (PowerPoint defaults to 100%)\n\t */\n\tfontScale?: number\n\t/**\n\t * Line-space reduction as a percent (0-100), mapped to `<a:normAutofit lnSpcReduction=\"..\">`.\n\t * @example 20 // reduce line spacing by 20%\n\t * @default undefined // attribute omitted (PowerPoint defaults to 0%)\n\t */\n\tlnSpcReduction?: number\n}\n\nexport interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps, ObjectNameProps {\n\t/**\n\t * Preset-geometry start/end angles for text frames (`shape` + these build `<a:prstGeom>`\n\t * adjustment guides through the shared emitter — `genXmlPresetGeom` reads them whether\n\t * the object is a shape or a styled text frame).\n\t */\n\tangleRange?: [number, number]\n\t/** Preset-geometry block-arc thickness for text frames. */\n\tarcThicknessRatio?: number\n\t/** Custom geometry points when a text frame uses a custom geometry shape. */\n\tpoints?: GeometryPoint[]\n\t/** Preset-geometry adjustment guides for text frames. */\n\tshapeAdjust?: ShapeAdjustValue | ShapeAdjustValue[]\n\t_bodyProp?: {\n\t\t// Note: Many of these duplicated as user options are transformed to _bodyProp options for XML processing\n\t\talign?: AlignH\n\t\tanchor?: TextAnchor\n\t\tlIns?: number\n\t\trIns?: number\n\t\ttIns?: number\n\t\tbIns?: number\n\t\tnumCol?: number\n\t\tspcCol?: number\n\t\tvert?: TextVertType\n\t\twrap?: boolean\n\t\tprstTxWarp?: string\n\t}\n\t_lineIdx?: number\n\n\tbaseline?: number\n\t/**\n\t * Character spacing\n\t */\n\tcharSpacing?: number\n\t/**\n\t * Number of text columns in the text body\n\t * - PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Columns > \"Number\"\n\t * - range: 1-16\n\t * @default 1\n\t * @example 2 // flow text into two columns\n\t */\n\tcolumns?: number\n\t/**\n\t * Spacing between text columns (points)\n\t * - PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Columns > \"Spacing\"\n\t * - only applies when `columns` > 1\n\t * @default 0\n\t * @example 10 // 10pt gap between columns\n\t */\n\tcolumnSpacing?: number\n\t/**\n\t * Text fit options\n\t *\n\t * MS-PPT > Format Shape > Shape Options > Text Box > \"[unlabeled group]\": [3 options below]\n\t * - 'none' = Do not Autofit\n\t * - 'shrink' = Shrink text on overflow\n\t * - 'resize' = Resize shape to fit text\n\t *\n\t * **Measured fit:** if you register the box's font with\n\t * {@link TsPptx.registerFontMetrics}, both `'shrink'` and `'resize'` are\n\t * **measured at export time**, so the text renders correctly in headless renderers\n\t * and on plain file-open (no edit/resize needed):\n\t * - `'shrink'` computes the largest `fontScale` at which the wrapped text fits and\n\t * bakes `<a:normAutofit fontScale=…/>`.\n\t * - `'resize'` computes the height the text needs and bakes it into the shape's\n\t * `a:ext/@cy` (adjusting `a:off/@y` per vertical anchor), the marker being\n\t * `<a:spAutoFit/>`.\n\t * Without registered metrics they fall back to the bare flag (`<a:normAutofit/>` /\n\t * `<a:spAutoFit/>`, which only PowerPoint recomputes on edit) and warn once.\n\t *\n\t * **Note** Bare `'shrink'`/`'resize'` (no metrics) only take effect after editing\n\t * text / resizing the shape; PowerPoint calculates the result then. The object form\n\t * of `'shrink'` always bakes the explicit values you pass.\n\t * @example 'shrink' // measured when metrics are registered; else bare <a:normAutofit/>\n\t * @example 'resize' // measured when metrics are registered; else bare <a:spAutoFit/>\n\t * @example { type: 'shrink', fontScale: 85, lnSpcReduction: 20 } // pre-shrink with explicit values\n\t * @default \"none\"\n\t */\n\tfit?: 'none' | 'shrink' | 'resize' | TextFitShrinkProps\n\t/**\n\t * Shape fill\n\t * @example { color:'FF0000' } // hex color (red)\n\t * @example { color:'0088CC', transparency:50 } // hex color, 50% transparent\n\t * @example { color:SchemeColor.accent1 } // theme color Accent1\n\t */\n\tfill?: ShapeFillProps\n\t/**\n\t * Flip shape horizontally?\n\t * @default false\n\t */\n\tflipH?: boolean\n\t/**\n\t * Flip shape vertical?\n\t * @default false\n\t */\n\tflipV?: boolean\n\tglow?: TextGlowProps\n\thyperlink?: HyperlinkProps\n\tindentLevel?: number\n\tisTextBox?: boolean\n\tline?: ShapeLineProps\n\t/**\n\t * Line spacing (pt)\n\t * - PowerPoint: Paragraph > Indents and Spacing > Line Spacing: > \"Exactly\"\n\t * @example 28 // 28pt\n\t */\n\tlineSpacing?: number\n\t/**\n\t * line spacing multiple (percent)\n\t * - range: 0.0-9.99\n\t * - PowerPoint: Paragraph > Indents and Spacing > Line Spacing: > \"Multiple\"\n\t * @example 1.5 // 1.5X line spacing\n\t */\n\tlineSpacingMultiple?: number\n\t/**\n\t * Margin (inches) — the text-frame internal margin/padding\n\t * - PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Left/Right/Top/Bottom margin (shown in inches)\n\t * - array order is `[top, right, bottom, left]`\n\t * - a value `>= 1` is honored as inches but warns once (it is likely a legacy points value; divide by 72)\n\t * @default (unset) PowerPoint's \"Normal\" internal margin [0.05\", 0.1\", 0.05\", 0.1\"]\n\t * @example 0 // Top/Right/Bottom/Left margin 0\n\t * @example 0.1 // Top/Right/Bottom/Left margin 0.1 inch\n\t * @example [0.05, 0.1, 0.05, 0.1] // top 0.05\", right 0.1\", bottom 0.05\", left 0.1\"\n\t */\n\tmargin?: Margin\n\toutline?: { color: Color; size: number }\n\tparaSpaceAfter?: number\n\tparaSpaceBefore?: number\n\t/**\n\t * Placeholder type\n\t * - when the value matches a placeholder defined on the slide layout/master, this text\n\t * inherits that placeholder's position and formatting\n\t * - otherwise the text shape is promoted to a standalone placeholder of this type, emitting\n\t * a real `<p:ph type=\"...\">`. Use `placeholder: 'title'` to give a slide an accessible\n\t * title (PowerPoint's accessibility checker otherwise reports \"Missing Slide Title\")\n\t * - values: 'title' | 'body' | et. al.\n\t * @example 'title'\n\t * @see https://learn.microsoft.com/en-us/office/vba/api/powerpoint.ppplaceholdertype\n\t */\n\tplaceholder?: string\n\t/**\n\t * Rounded rectangle radius (only for ShapeType.roundRect)\n\t * - values: 0.0 to 1.0\n\t * @default 0\n\t */\n\trectRadius?: number\n\t/**\n\t * Rotation (degrees)\n\t * - range: -360 to 360\n\t * @default 0\n\t * @example 180 // rotate 180 degrees\n\t */\n\trotate?: number\n\t/**\n\t * Whether to enable right-to-left mode\n\t * @default false\n\t */\n\trtlMode?: boolean\n\tshadow?: ShadowProps\n\tshape?: SHAPE_NAME\n\t/**\n\t * Strikethrough (`a:rPr/@strike`, `ST_TextStrikeType` — ECMA-376 §20.1.10.78)\n\t * - `true` is `'sngStrike'`; `'dblStrike'` is the double rule\n\t * - `'noStrike'` is the *explicit off*: it writes `strike=\"noStrike\"`, which overrides a\n\t * strikethrough the run would otherwise inherit from its list style, placeholder, layout\n\t * or master\n\t * - `false`, like leaving the option out, writes no attribute at all and so states\n\t * *nothing* — the run keeps whatever it inherits. This matches `bold`/`italic`, whose\n\t * falsy arm is likewise an omission; reach for `'noStrike'` when the intent is \"not\n\t * struck\" rather than \"unspecified\"\n\t * @default (unset) inherit\n\t */\n\tstrike?: boolean | 'noStrike' | 'sngStrike' | 'dblStrike'\n\tsubscript?: boolean\n\tsuperscript?: boolean\n\t/**\n\t * Vertical alignment\n\t * @default middle\n\t */\n\tvalign?: VAlign\n\t/**\n\t * Advanced/legacy escape hatch for the full `ST_TextVerticalType` range (e.g. `eaVert`,\n\t * `mongolianVert`, `wordArtVert`). Prefer {@link TextBaseProps.textDirection} for the common\n\t * cases; both map to `a:bodyPr@vert`.\n\t */\n\tvert?: TextVertType\n\t/**\n\t * Text wrap\n\t * @default true\n\t */\n\twrap?: boolean\n}\nexport interface TextProps {\n\ttext?: string | number\n\toptions?: TextPropsOptions\n\t/**\n\t * Raw OMML (Office MathML) for a native, editable PowerPoint equation. By default it is emitted\n\t * as its own centered display-math paragraph (`<a14:m><m:oMathPara><m:oMath>…`) and `text` is\n\t * ignored; set `inline` to instead flow it as an equation run mid-paragraph. Accepts either the\n\t * inner OMML (children of `<m:oMath>`), a full `<m:oMath>…</m:oMath>`, or a full\n\t * `<m:oMathPara>…</m:oMathPara>`; the `m:` prefix is resolved by the wrapper, so the markup does\n\t * not need its own namespace declarations.\n\t * This is the raw-OMML entry point. To author from LaTeX or MathML, convert with\n\t * `latexToOmml()` / `mathmlToOmml()` from the `@shbernal/ts-pptx/math` subpath.\n\t * @example { math: '<m:r><m:t>x^2+1=y</m:t></m:r>' } // raw OMML\n\t * @example import { latexToOmml } from '@shbernal/ts-pptx/math'; ({ math: latexToOmml('x^2+1=y') })\n\t */\n\tmath?: string\n\t/**\n\t * Emit this item's `math` equation *inline* — an `<a14:m><m:oMath>` run flowing mid-paragraph\n\t * between the surrounding plain text runs — instead of as its own centered display-math\n\t * paragraph. Has no effect unless `math` is set. Pair with the bare-`<m:oMath>` inline form of\n\t * the equation: `latexToOmml(tex, { display: false })` or `mathmlToOmml(mathml)`.\n\t * @example addText([{ text: 'where ' }, { math: latexToOmml('x^2+1=y', { display: false }), inline: true }, { text: ' holds' }])\n\t */\n\tinline?: boolean\n}\n\n/**\n * Options for layout-time text measurement ({@link TsPptx.measureText}).\n * Inches for width, points for type/spacing — the consumer-facing units. The\n * measured face must have metrics registered via {@link TsPptx.registerFontMetrics}\n * (a named face without exact metrics uses a conservative heuristic; an unnamed\n * theme-default face is unmeasurable).\n */\nexport interface MeasureTextOptions {\n\t/** Available text width in inches (the box width minus L/R inset, unless `insetIn` is given). */\n\twIn: number\n\t/** Font size in points. */\n\tfontSize: number\n\t/** Font family name, as used in `fontFace`. Required for an exact measure; an unnamed face is unmeasurable. */\n\tfontFace?: string\n\tbold?: boolean\n\titalic?: boolean\n\t/** Character spacing in points. */\n\tcharSpacing?: number\n\t/** Exact line spacing in points (overrides `lineSpacingMultiple`). */\n\tlineSpacing?: number\n\t/** Line spacing as a multiple of single (e.g. `1.5`). */\n\tlineSpacingMultiple?: number\n\t/** Space before each paragraph, in points. */\n\tparaSpaceBefore?: number\n\t/** Space after each paragraph, in points. */\n\tparaSpaceAfter?: number\n\t/** L/R text inset in inches; when set, subtracted from `wIn` on both sides (pass a raw box width). */\n\tinsetIn?: number\n}\n\n/**\n * Result of {@link TsPptx.measureText}. Heights err **tall** (conservative) —\n * they match the value the export-time autofit bake uses, so the laid-out height is\n * ≥ what PowerPoint/LibreOffice render. Use it to grow a container; for an overflow\n * check it may slightly over-report (good for a warning, not a hard gate).\n */\nexport interface TextMeasurement {\n\t/** Laid-out height in inches at the given `fontSize` (conservative/tall). */\n\theightIn: number\n\t/** Number of wrapped lines (conservative — the model wraps marginally early). */\n\tlineCount: number\n\t/**\n\t * Width in inches of the widest laid-out line (conservative — the model wraps\n\t * marginally early, so this errs slightly wide). With an unconstrained `wIn` it\n\t * is the natural single-line width; constrained, it is the widest wrapped line.\n\t * A box set to this width will not re-wrap the text.\n\t */\n\twidestLineIn: number\n\t/** `false` only for an unnamed theme-default face that could not be measured. */\n\tmeasurable: boolean\n\t/**\n\t * The **named** faces laid out with the conservative average-advance heuristic\n\t * instead of their real metrics — i.e. faces with no registered metrics. Empty\n\t * when every run was measured exactly (and for an unmeasurable result, which\n\t * guessed nothing). The numbers stay conservative (they err tall/wide), but a\n\t * non-empty list means they are an approximation, not a measurement; register\n\t * the face via {@link TsPptx.registerFontMetrics} for an exact result.\n\t */\n\tapproximatedFaces: string[]\n\t/**\n\t * Code points in the measured text — sorted, deduplicated — whose run resolved to a\n\t * **registered** face that has no glyph for them. Empty for fully covered text.\n\t *\n\t * Unlike everything else here, a non-empty list means the numbers are **not reliably\n\t * conservative**. PowerPoint renders such a code point from a substituted face and\n\t * measures it in that face's advances; this model has no fallback and charges the\n\t * registered font's `.notdef` advance, which is unrelated to the glyph that paints. A\n\t * `.notdef` wider than the real glyph over-reports (harmless); a narrower one\n\t * under-reports the width and can drop a line, so `heightIn` may come back **short**\n\t * and the text overflow. Register a face that covers them (or set an explicit\n\t * `fontFace` on those runs) before trusting the height.\n\t *\n\t * Faces with no registered metrics are not audited — they measure through the\n\t * cmap-less heuristic and are reported in {@link approximatedFaces} instead.\n\t * `String.fromCodePoint(...uncoveredCodepoints)` renders the list.\n\t */\n\tuncoveredCodepoints: number[]\n\t/** True if the text fits a box of inner height `hIn` (inches) at full size. */\n\tfitsBox: (hIn: number) => boolean\n\t/** The `fontScale` (percent) that fits inner height `hIn`; `100` if it already fits, never below the shrink floor. */\n\tshrinkScaleFor: (hIn: number) => number\n}\n\n/** Options for {@link TsPptx.overflowsBox}: a measure plus the box inner height to test against. */\nexport interface OverflowBoxOptions extends MeasureTextOptions {\n\t/** Box inner height in inches to test for overflow. */\n\thIn: number\n}\n\n/**\n * One cell's computed rectangle from {@link TsPptx.tableLayout}. All values are\n * inches; `x`/`y` are absolute (offset from the table's `x`/`y`). For a merged cell,\n * `row`/`col` are the top-left origin and `wIn`/`hIn` cover the whole span; the\n * cells it covers are not emitted separately.\n */\nexport interface TableCellLayout {\n\t/** Zero-based grid row of the cell's top-left origin. */\n\trow: number\n\t/** Zero-based grid column of the cell's top-left origin. */\n\tcol: number\n\t/** Number of rows the cell spans (1 if not merged). */\n\trowSpan: number\n\t/** Number of columns the cell spans (1 if not merged). */\n\tcolSpan: number\n\t/** Left edge in inches (absolute). */\n\txIn: number\n\t/** Top edge in inches (absolute). */\n\tyIn: number\n\t/** Outer cell width in inches (sum of spanned column widths). */\n\twIn: number\n\t/** Outer cell height in inches (sum of spanned row heights). */\n\thIn: number\n\t/**\n\t * `true` when `hIn`/`yIn` are pinned by an explicit `rowH` (array or scalar) or\n\t * table `h`; `false` when the row is auto-height and the value is a conservative\n\t * (tall) estimate from the same text model as {@link TsPptx.measureText}.\n\t */\n\theightExact: boolean\n}\n\n/**\n * Result of {@link TsPptx.tableLayout}: per-cell geometry plus overall table\n * bounds, for placing images/shapes over a table without rendering it. Geometry is\n * for a single, un-paginated table laid out at `opts.x`/`y`/`w`; `autoPage` paging\n * is not modeled. Widths are exact; auto-height row heights are conservative\n * estimates (see {@link TableCellLayout.heightExact}).\n */\nexport interface TableLayoutResult {\n\t/** One entry per non-merged origin cell, in row-major order. */\n\tcells: TableCellLayout[]\n\t/** Overall table width in inches (sum of column widths). */\n\twidthIn: number\n\t/** Overall table height in inches (sum of row heights; may include estimates). */\n\theightIn: number\n\t/** `false` if any row height was estimated (the total errs tall, like `measureText`). */\n\theightExact: boolean\n}\n\n/**\n * Per-run options for a speaker-notes text run.\n * A focused subset of `TextPropsOptions`: inline formatting plus an (external URL) hyperlink.\n * Notes hyperlinks support `url` only; `slide` targets are not yet supported.\n */\nexport type NotesTextOptions = Pick<\n\tTextPropsOptions,\n\t'hyperlink' | 'bold' | 'italic' | 'underline' | 'color' | 'fontSize' | 'fontFace'\n>\n\n/** A single speaker-notes text run: text plus optional inline formatting / hyperlink. */\nexport interface NotesProps {\n\ttext: string\n\toptions?: NotesTextOptions\n}\n\n/**\n * A review comment attached to a slide (legacy ISO/IEC 29500 §13 comment).\n */\nexport interface CommentProps {\n\t/** Author display name (required). Comments sharing the same `author`+`initials` are grouped under one author entry. */\n\tauthor: string\n\t/** Author initials shown in the comment marker. Defaults to letters derived from `author`. */\n\tinitials?: string\n\t/** Comment body text (required). */\n\ttext: string\n\t/** Comment marker X position in inches. @default 0.5 */\n\tx?: number\n\t/** Comment marker Y position in inches. @default 0.5 */\n\ty?: number\n\t/** Authored date/time as a `Date` or ISO-8601 string. Omitted from the XML when not provided. */\n\tdate?: Date | string\n}\n\n/** Internal normalized comment stored on a slide (`_comments`). x/y are inches; `date` is ISO-8601 when present. */\nexport interface SlideComment {\n\tauthor: string\n\tinitials: string\n\ttext: string\n\tx: number\n\ty: number\n\tdate?: string\n}\n\n/** Resolved presentation-level comment author, emitted to `commentAuthors.xml`. */\nexport interface ResolvedCommentAuthor {\n\tid: number\n\tname: string\n\tinitials: string\n\tlastIdx: number\n\tclrIdx: number\n}\n\n/** Factory for a single inline text run. Prevents `as never` casts when building mixed-style run arrays. */\nexport function textRun(text: string | number, options?: TextPropsOptions): TextProps {\n\treturn options !== undefined ? { text, options } : { text }\n}\n\n/** Wraps a run array so TypeScript accepts it as `TextProps[]` without a cast. */\nexport function textRuns(runs: TextProps[]): TextProps[] {\n\treturn runs\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,iBAAiB,MAAsB;CACtD,SAAS,QAAQ,GAAA,CAAI,YAAY,GAAjC;EACC,KAAK,OACJ,OAAO;EACR,KAAK,OACJ,OAAO;EACR,KAAK,OACJ,OAAO;EACR,KAAK;EACL,KAAK,QACJ,OAAO;EACR,SACC,OAAO,YAAY,QAAQ,GAAA,CAAI,YAAY;CAC7C;AACD;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,wBAAwB,MAAc,MAAsB;CAE3E,MAAM,UAAU,QAAQ;CACxB,MAAM,UAAU,QAAQ;CAExB,MAAM,cADW,QAAQ,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,MA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