pptx-ts 4.0.1 → 4.1.0

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.
Files changed (95) hide show
  1. package/README.md +147 -114
  2. package/dist/{autopage-odPz7zZO.js → autopage-D4kyVp11.js} +5 -5
  3. package/dist/{autopage-odPz7zZO.js.map → autopage-D4kyVp11.js.map} +1 -1
  4. package/dist/{body-insets-Dw_BeWD_.js → body-insets-kVHmjGc6.js} +2 -2
  5. package/dist/{body-insets-Dw_BeWD_.js.map → body-insets-kVHmjGc6.js.map} +1 -1
  6. package/dist/browser.d.ts +7 -7
  7. package/dist/browser.js +5 -5
  8. package/dist/{clip-Bl01BPcN.d.ts → clip-DHDlnHUq.d.ts} +2 -2
  9. package/dist/{clip-Bl01BPcN.d.ts.map → clip-DHDlnHUq.d.ts.map} +1 -1
  10. package/dist/{diagnostics-D8ot4Ei7.d.ts → diagnostics-DiMmBU8P.d.ts} +6 -6
  11. package/dist/{diagnostics-D8ot4Ei7.d.ts.map → diagnostics-DiMmBU8P.d.ts.map} +1 -1
  12. package/dist/{embedded-fonts-DarT9aoa.d.ts → embedded-fonts-CI_YGW2d.d.ts} +2 -2
  13. package/dist/{embedded-fonts-DarT9aoa.d.ts.map → embedded-fonts-CI_YGW2d.d.ts.map} +1 -1
  14. package/dist/{entry-compose-DCnvBZz2.d.ts → entry-compose-6hF9aTmT.d.ts} +19 -17
  15. package/dist/{entry-compose-DCnvBZz2.d.ts.map → entry-compose-6hF9aTmT.d.ts.map} +1 -1
  16. package/dist/{enums-BUKTUB6V.d.ts → enums-DQRpVOLh.d.ts} +3 -3
  17. package/dist/{enums-BUKTUB6V.d.ts.map → enums-DQRpVOLh.d.ts.map} +1 -1
  18. package/dist/{errors-C4oENPcu.js → errors-Da2nXCJm.js} +6 -6
  19. package/dist/{errors-C4oENPcu.js.map → errors-Da2nXCJm.js.map} +1 -1
  20. package/dist/families.d.ts +6 -6
  21. package/dist/families.js +2 -2
  22. package/dist/{fit-Cb7naFj6.js → fit-CcXbg__l.js} +10 -10
  23. package/dist/{fit-Cb7naFj6.js.map → fit-CcXbg__l.js.map} +1 -1
  24. package/dist/{font-metrics-v5fn7s7e.d.ts → font-metrics-CBGmhLo0.d.ts} +6 -6
  25. package/dist/{font-metrics-v5fn7s7e.d.ts.map → font-metrics-CBGmhLo0.d.ts.map} +1 -1
  26. package/dist/{grid-DikTjFey.js → grid-9B2w5EaY.js} +2 -2
  27. package/dist/{grid-DikTjFey.js.map → grid-9B2w5EaY.js.map} +1 -1
  28. package/dist/{html-dom-Iuog2wdK.js → html-dom-DvJmuHt2.js} +10 -10
  29. package/dist/html-dom-DvJmuHt2.js.map +1 -0
  30. package/dist/html.d.ts +3 -3
  31. package/dist/html.js +2 -2
  32. package/dist/{image-size-CvN2iCA4.js → image-size-DwDbakcl.js} +64 -5
  33. package/dist/image-size-DwDbakcl.js.map +1 -0
  34. package/dist/index.d.ts +7 -7
  35. package/dist/index.js +3 -3
  36. package/dist/inspect.d.ts +4 -4
  37. package/dist/inspect.js +4 -4
  38. package/dist/inspect.js.map +1 -1
  39. package/dist/math.d.ts +1 -1
  40. package/dist/math.js +1 -1
  41. package/dist/measure.d.ts +3 -3
  42. package/dist/measure.js +2 -2
  43. package/dist/node.d.ts +7 -7
  44. package/dist/node.js +3 -3
  45. package/dist/{notes-Dh12JAbn.js → notes-BcT571R4.js} +19 -18
  46. package/dist/notes-BcT571R4.js.map +1 -0
  47. package/dist/options-internal-WqgMf720.js.map +1 -1
  48. package/dist/{package-J49Ck6S2.d.ts → package-KoEgVwII.d.ts} +6 -2
  49. package/dist/{package-J49Ck6S2.d.ts.map → package-KoEgVwII.d.ts.map} +1 -1
  50. package/dist/{pres-C6qgOFAa.d.ts → pres-BA9_lJbY.d.ts} +32 -12
  51. package/dist/pres-BA9_lJbY.d.ts.map +1 -0
  52. package/dist/{presentation-DGYlAWhl.js → presentation-Cyl74rq2.js} +70 -35
  53. package/dist/presentation-Cyl74rq2.js.map +1 -0
  54. package/dist/{presentation-types-8jLQHI4M.d.ts → presentation-types-B3VQH4Bz.d.ts} +19 -15
  55. package/dist/presentation-types-B3VQH4Bz.d.ts.map +1 -0
  56. package/dist/read.d.ts +6 -6
  57. package/dist/read.js +3 -3
  58. package/dist/script.d.ts +2 -2
  59. package/dist/script.d.ts.map +1 -1
  60. package/dist/script.js +11 -11
  61. package/dist/script.js.map +1 -1
  62. package/dist/{shapes-re0KyQk_.js → shapes-BcyFdZpp.js} +14 -10
  63. package/dist/shapes-BcyFdZpp.js.map +1 -0
  64. package/dist/{slide-Dx2ZeVZ6.d.ts → slide-BqPtyKmb.d.ts} +12 -7
  65. package/dist/slide-BqPtyKmb.d.ts.map +1 -0
  66. package/dist/{table-cell-margins-EVg0EwxT.js → table-cell-margins-PDshga8T.js} +4 -4
  67. package/dist/{table-cell-margins-EVg0EwxT.js.map → table-cell-margins-PDshga8T.js.map} +1 -1
  68. package/dist/{table-dom-BTDP3lEP.js → table-dom-CVbvUfgh.js} +3 -3
  69. package/dist/{table-dom-BTDP3lEP.js.map → table-dom-CVbvUfgh.js.map} +1 -1
  70. package/dist/{text-sN64Otf_.js → text-BvFFMMFQ.js} +38 -36
  71. package/dist/{text-sN64Otf_.js.map → text-BvFFMMFQ.js.map} +1 -1
  72. package/dist/{text-anchor-CrYXAfUu.js → text-anchor-BgLPbwbL.js} +2 -2
  73. package/dist/{text-anchor-CrYXAfUu.js.map → text-anchor-BgLPbwbL.js.map} +1 -1
  74. package/dist/{units-internal-XJlf-hOl.js → units-internal-DFcUYjh3.js} +11 -6
  75. package/dist/units-internal-DFcUYjh3.js.map +1 -0
  76. package/dist/{zip-C0leZZMj.d.ts → zip-CTll_dr0.d.ts} +2 -2
  77. package/dist/{zip-C0leZZMj.d.ts.map → zip-CTll_dr0.d.ts.map} +1 -1
  78. package/dist/{zip-CKd8ihcf.js → zip-CYZ0F6BV.js} +2 -2
  79. package/dist/{zip-CKd8ihcf.js.map → zip-CYZ0F6BV.js.map} +1 -1
  80. package/dist/zip.d.ts +2 -2
  81. package/dist/zip.js +2 -2
  82. package/dist/{zoom-DPUHh85d.js → zoom-BoNyOlPm.js} +65 -51
  83. package/dist/zoom-BoNyOlPm.js.map +1 -0
  84. package/package.json +39 -31
  85. package/skills/ts-pptx-upstream/SKILL.md +18 -18
  86. package/dist/html-dom-Iuog2wdK.js.map +0 -1
  87. package/dist/image-size-CvN2iCA4.js.map +0 -1
  88. package/dist/notes-Dh12JAbn.js.map +0 -1
  89. package/dist/pres-C6qgOFAa.d.ts.map +0 -1
  90. package/dist/presentation-DGYlAWhl.js.map +0 -1
  91. package/dist/presentation-types-8jLQHI4M.d.ts.map +0 -1
  92. package/dist/shapes-re0KyQk_.js.map +0 -1
  93. package/dist/slide-Dx2ZeVZ6.d.ts.map +0 -1
  94. package/dist/units-internal-XJlf-hOl.js.map +0 -1
  95. package/dist/zoom-DPUHh85d.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-size-DwDbakcl.js","names":[],"sources":["../src/media/image-formats.ts","../src/media/base64.ts","../src/ooxml/namespaces.ts","../src/ooxml/rel-types.ts","../src/ooxml/st-enums.ts","../src/hex-color.ts","../src/ooxml/xsd-boolean.ts","../src/ooxml/check-enum.ts","../src/ooxml/line-cap.ts","../src/ooxml/text-align.ts","../src/media/image-size.ts"],"sourcesContent":["/**\n * The image formats this library recognises, one row each.\n *\n * Four tables used to answer overlapping questions about the same nine formats in three\n * directions — extension → content type on the write path, content type → extension on the read\n * and script paths, magic bytes → both in the sniffer — and a fifth partial re-derived the same\n * signatures to read pixel dimensions. They had already drifted: `image/jpeg` resolved to `jpeg`\n * in one and `jpg` in another, `image/tiff` to `tiff` and `tif`, and the GIF signature was four\n * bytes in one place and three in another, so a file could be measured but not sniffed.\n *\n * A row states every spelling once, so the directions cannot disagree. Where two spellings are\n * both wanted they are separate *columns* with separate reasons ({@link ImageFormat.ext} vs\n * {@link ImageFormat.filenameExt}), never separate tables.\n *\n * Content types are what PowerPoint authors, not what IANA prefers: EMF and WMF keep the `x-`\n * prefix and SVG is `image/svg+xml`. A package that disagrees is the kind of thing PowerPoint\n * offers to repair.\n */\n\n/** One image format, in every spelling the library needs it in. */\ninterface ImageFormat {\n\t/**\n\t * The extension a *media part* carries (`/ppt/media/image1.<ext>`), and the canonical answer\n\t * when a content type is turned back into an extension. Changing one of these changes emitted\n\t * package bytes.\n\t */\n\treadonly ext: string\n\t/** The OPC content type, as PowerPoint authors it. */\n\treadonly contentType: string\n\t/** Other extensions a caller may spell the format with; each resolves to {@link contentType}. */\n\treadonly altExts: readonly string[]\n\t/**\n\t * The extension for a *file on disk* — the asset a printed script writes beside itself. It\n\t * differs from {@link ext} for two formats (`jpg`, `tif`) because those are the spellings\n\t * desktop viewers and file managers recognise, and an asset directory is read by people. It\n\t * names no part and is in no package, so it is free to differ.\n\t */\n\treadonly filenameExt: string\n\t/**\n\t * Whether these leading bytes are this format's signature, or `null` for a format with no\n\t * usable one (SVG is text; EMF and WMF are not sniffed).\n\t */\n\treadonly magic: ((b: Uint8Array) => boolean) | null\n}\n\n/**\n * Every recognised format, keyed by its canonical extension. Iteration order is sniffing order;\n * no two signatures overlap, so it only has to be stable, not carefully chosen.\n */\nexport const IMAGE_FORMATS = Object.freeze({\n\tpng: {\n\t\text: 'png',\n\t\tcontentType: 'image/png',\n\t\taltExts: [],\n\t\tfilenameExt: 'png',\n\t\tmagic: (b) => b.length >= 8 && b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47,\n\t},\n\tjpeg: {\n\t\text: 'jpeg',\n\t\tcontentType: 'image/jpeg',\n\t\taltExts: ['jpg'],\n\t\tfilenameExt: 'jpg',\n\t\tmagic: (b) => b.length >= 3 && b[0] === 0xff && b[1] === 0xd8 && b[2] === 0xff,\n\t},\n\tgif: {\n\t\text: 'gif',\n\t\tcontentType: 'image/gif',\n\t\taltExts: [],\n\t\tfilenameExt: 'gif',\n\t\t// `GIF8`, not `GIF`: both released versions are GIF87a and GIF89a, and the fourth byte is\n\t\t// what tells a header apart from a file that merely starts with those three letters.\n\t\tmagic: (b) => b.length >= 4 && b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x38,\n\t},\n\tbmp: {\n\t\text: 'bmp',\n\t\tcontentType: 'image/bmp',\n\t\taltExts: [],\n\t\tfilenameExt: 'bmp',\n\t\tmagic: (b) => b.length >= 2 && b[0] === 0x42 && b[1] === 0x4d,\n\t},\n\ttiff: {\n\t\text: 'tiff',\n\t\tcontentType: 'image/tiff',\n\t\taltExts: ['tif'],\n\t\tfilenameExt: 'tif',\n\t\t// Both byte orders: `II*\\0` little-endian, `MM\\0*` big-endian.\n\t\tmagic: (b) =>\n\t\t\tb.length >= 4 &&\n\t\t\t((b[0] === 0x49 && b[1] === 0x49 && b[2] === 0x2a && b[3] === 0x00) ||\n\t\t\t\t(b[0] === 0x4d && b[1] === 0x4d && b[2] === 0x00 && b[3] === 0x2a)),\n\t},\n\twebp: {\n\t\text: 'webp',\n\t\tcontentType: 'image/webp',\n\t\taltExts: [],\n\t\tfilenameExt: 'webp',\n\t\t// `RIFF` then `WEBP` at offset 8; the chunk fourCC after it is the codec, not the format.\n\t\tmagic: (b) =>\n\t\t\tb.length >= 12 &&\n\t\t\tb[0] === 0x52 &&\n\t\t\tb[1] === 0x49 &&\n\t\t\tb[2] === 0x46 &&\n\t\t\tb[3] === 0x46 &&\n\t\t\tb[8] === 0x57 &&\n\t\t\tb[9] === 0x45 &&\n\t\t\tb[10] === 0x42 &&\n\t\t\tb[11] === 0x50,\n\t},\n\tsvg: { ext: 'svg', contentType: 'image/svg+xml', altExts: [], filenameExt: 'svg', magic: null },\n\temf: { ext: 'emf', contentType: 'image/x-emf', altExts: [], filenameExt: 'emf', magic: null },\n\twmf: { ext: 'wmf', contentType: 'image/x-wmf', altExts: [], filenameExt: 'wmf', magic: null },\n}) satisfies Readonly<Record<string, ImageFormat>>\n\nconst BY_EXTENSION: ReadonlyMap<string, ImageFormat> = new Map(\n\tObject.values(IMAGE_FORMATS).flatMap((f) => [f.ext, ...f.altExts].map((e) => [e, f] as const))\n)\n\nconst BY_CONTENT_TYPE: ReadonlyMap<string, ImageFormat> = new Map(\n\tObject.values(IMAGE_FORMATS).map((f) => [f.contentType, f] as const)\n)\n\n/** The format a caller's file extension names, or `null` for one the registry does not carry. */\nexport function imageFormatForExtension(extn: string): ImageFormat | null {\n\treturn BY_EXTENSION.get((extn || '').toLowerCase()) ?? null\n}\n\n/** The format a content type names, or `null` for one the registry does not carry. */\nexport function imageFormatForContentType(contentType: string): ImageFormat | null {\n\treturn BY_CONTENT_TYPE.get((contentType || '').toLowerCase()) ?? null\n}\n\n/** The format these leading bytes are the header of, or `null` when nothing matches. */\nexport function imageFormatForBytes(bytes: Uint8Array): ImageFormat | null {\n\tif (!bytes) return null\n\tfor (const format of Object.values(IMAGE_FORMATS)) {\n\t\tif (format.magic?.(bytes)) return format\n\t}\n\treturn null\n}\n","/**\n * Base64 payload handling for media parts — isomorphic across Node and browsers\n * (`TextEncoder`/`atob`/`btoa` only, no `Buffer`).\n */\n\n/**\n * Encode raw SVG markup as a base64 `image/svg+xml` data URI.\n * - lets callers pass inline SVG to `addImage({ svg })` without hand-rolling base64\n * - isomorphic and UTF-8 safe: uses the global `TextEncoder`/`btoa` (Node and browsers)\n * @param {string} svg - SVG markup, e.g. `'<svg ...>...</svg>'`\n * @returns {string} a `data:image/svg+xml;base64,...` URI\n */\nimport { bytesToBinaryString } from './binary-string.js'\n\nexport function svgMarkupToDataUri(svg: string): string {\n\treturn `data:image/svg+xml;base64,${bytesToBase64(new TextEncoder().encode(svg))}`\n}\n\n/**\n * Encode raw bytes as base64 (no `data:` prefix) using only `btoa`, so the result is the same\n * on Node, in a browser, and in a runtime that has neither `Buffer` nor `FileReader`.\n * @param {Uint8Array} bytes - the payload\n * @returns {string} base64 text\n */\nexport function bytesToBase64(bytes: Uint8Array): string {\n\treturn btoa(bytesToBinaryString(bytes))\n}\n\n/**\n * Present a freshly loaded media payload as a `data:` URI.\n *\n * A {@link RuntimeAdapter.loadMedia} implementation returns whichever encoding its host\n * makes cheap — the browser adapter a full URI, because `FileReader.readAsDataURL` is what\n * decodes a blob without blocking; Node and the neutral adapter raw base64, because neither\n * has a `FileReader`. This is where the two become one, so nothing downstream of the load\n * has to ask which it got.\n *\n * The mime label is documentary: {@link decodeBase64ToBytes} ignores it, and the one consumer\n * that needs a real URI (`image.src`, in the browser adapter's SVG preview) is handed the\n * adapter's own. It is taken from the rel anyway rather than hard-coded, so an already-correct\n * label is not overwritten with a wrong one.\n * @param {string} payload - what the adapter returned: raw base64, or an already-formed URI\n * @param {string} contentType - the rel's content type, e.g. `image/png`\n * @returns {string} a `data:` URI\n */\nexport function toMediaDataUri(payload: string, contentType: string): string {\n\treturn payload.startsWith('data:') ? payload : `data:${contentType};base64,${payload}`\n}\n\n/**\n * Where the payload begins in an inline `data:` URI, or `-1` when the value carries no\n * `base64,` header and is therefore raw base64 already.\n *\n * The one reading of that header, because the two functions below used to spell it separately and\n * disagree: {@link hasBase64Header} lower-cased before looking, {@link decodeBase64ToBytes} did\n * not. RFC 2397 does not case the `;base64` token, so `data:image/png;BASE64,…` passed every\n * definer's check and then decoded from index 0, which `atob` rejects. The media part was written\n * empty, with nothing said. One search means the two can no longer answer differently.\n *\n * Matched with a regular expression rather than by lower-casing and indexing, because\n * `toLowerCase` is not length-preserving for every code point and a shifted index would slice the\n * payload apart.\n */\nfunction base64PayloadStart(data: string): number {\n\tconst match = /base64,/i.exec(data)\n\treturn match ? match.index + match[0].length : -1\n}\n\n/**\n * Decode a base64 image payload (raw base64 or a `data:` URI) to bytes.\n * - tolerant of the `data:[mime];base64,` prefix and of whitespace in the payload\n * @param {string} b64 - base64 string or data URI\n * @returns {Uint8Array | null} decoded bytes, or `null` when the payload is empty/undecodable\n */\nexport function decodeBase64ToBytes(b64: string): Uint8Array | null {\n\tif (!b64) return null\n\t// Strip any `data:...;base64,` prefix and surrounding whitespace\n\tconst start = base64PayloadStart(b64)\n\tconst payload = (start >= 0 ? b64.slice(start) : b64).replace(/\\s/g, '')\n\tif (!payload) return null\n\ttry {\n\t\tconst binary = atob(payload)\n\t\tconst bytes = new Uint8Array(binary.length)\n\t\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i)\n\t\treturn bytes\n\t} catch {\n\t\treturn null\n\t}\n}\n\n/**\n * Whether an inline payload carries the `base64,` header the definers ask image and media bytes\n * to arrive with. A value that is not a string has none.\n * @param data - the caller's `data`\n */\nexport function hasBase64Header(data: unknown): boolean {\n\treturn typeof data === 'string' && base64PayloadStart(data) >= 0\n}\n","/**\n * OOXML namespace URIs, by their canonical prefix.\n *\n * A namespace URI is a fact about the format, not about reading or writing one, so it belongs\n * here rather than on either side — the same reasoning `rel-types.ts` states at length, and for\n * the same failure mode: these are long, near-identical strings, and a typo does not throw. It\n * silently matches nothing on the read side and produces a part PowerPoint ignores on the write\n * side.\n *\n * The table lived in `read/oxml/dom.ts` and could not be reached from `gen/`, because that\n * module imports `@xmldom/xmldom` at module scope and pulling an XML DOM into the write-only\n * bundle is a real cost. So the write side hand-wrote the URIs instead: three separate `A_NS`\n * constants and seven copies of the same `xmlns:a`/`xmlns:r`/`xmlns:p` triple. This module has\n * **no runtime imports**, and no module beside it imports from `gen/` or `read/`, so both sides can\n * reach it and neither pays for the other's dependencies. The two that fail loudly reach outside\n * `ooxml/` for that alone: `sequence.ts` for `errors.ts`, and `check-enum.ts` for `errors.ts` and\n * `diagnostics.ts`. `read/oxml/dom.ts` re-exports it, so no read-side import path changed.\n */\n\n/** Canonical OOXML prefix → namespace URI registry. */\nexport const OOXML_NS = Object.freeze({\n\ta: 'http://schemas.openxmlformats.org/drawingml/2006/main',\n\ta14: 'http://schemas.microsoft.com/office/drawing/2010/main',\n\tasvg: 'http://schemas.microsoft.com/office/drawing/2016/SVG/main',\n\tc: 'http://schemas.openxmlformats.org/drawingml/2006/chart',\n\tc15: 'http://schemas.microsoft.com/office/drawing/2012/chart',\n\tcp: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\tct: 'http://schemas.openxmlformats.org/package/2006/content-types',\n\tcx: 'http://schemas.microsoft.com/office/drawing/2014/chartex',\n\tdc: 'http://purl.org/dc/elements/1.1/',\n\tdcterms: 'http://purl.org/dc/terms/',\n\tdgm: 'http://schemas.openxmlformats.org/drawingml/2006/diagram',\n\tdsp: 'http://schemas.microsoft.com/office/drawing/2008/diagram',\n\tep: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',\n\tm: 'http://schemas.openxmlformats.org/officeDocument/2006/math',\n\tmc: 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n\tp: 'http://schemas.openxmlformats.org/presentationml/2006/main',\n\tp14: 'http://schemas.microsoft.com/office/powerpoint/2010/main',\n\tp15: 'http://schemas.microsoft.com/office/powerpoint/2012/main',\n\tp159: 'http://schemas.microsoft.com/office/powerpoint/2015/9/main',\n\tp188: 'http://schemas.microsoft.com/office/powerpoint/2018/8/main',\n\tpr: 'http://schemas.openxmlformats.org/package/2006/relationships',\n\tr: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n\tvt: 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n})\n\n/**\n * `a:graphicData/@uri` for a DrawingML table.\n *\n * The other three payloads a `p:graphicFrame` can hold name a URI that is also a namespace, so\n * they read it off {@link OOXML_NS} (`c`, `cx`, `dgm`). A table's does not: nothing binds a\n * prefix to it, and the table elements themselves are in the `a` namespace. So it lives beside\n * the registry rather than in it, which keeps every entry there a prefix a document can declare.\n */\nexport const TABLE_GRAPHIC_DATA_URI = 'http://schemas.openxmlformats.org/drawingml/2006/table'\n\n/**\n * The `xmlns` declarations every PresentationML part root carries, in the order the emitters\n * have always written them.\n *\n * Spread this **first** in a root element's attribute map: `el()` serializes attributes in\n * object-key order, so the three keys have to keep the positions the literals occupied or the\n * emitted bytes move. A root with extra attributes (`show` on `p:sld`, `def` on `a:tblStyleLst`)\n * lists them after the spread, which is where they already were.\n */\nexport const PML_ROOT_NS = Object.freeze({\n\t'xmlns:a': OOXML_NS.a,\n\t'xmlns:r': OOXML_NS.r,\n\t'xmlns:p': OOXML_NS.p,\n})\n","/**\n * OPC relationship type URIs and part content types, and the schema-URI bases they are built from.\n *\n * These are long, near-identical strings that differ in one path segment, which makes a typo\n * both easy to write and invisible on review — a wrong URI does not throw, it silently matches\n * nothing on the read side and produces a part PowerPoint ignores or rejects on the write side.\n *\n * **Why this module is neither `gen/` nor `read/`.** Both halves need the same URIs, and for a\n * while each kept its own copy (`gen/oxml/schema-uris.ts`, `read/api/rel-types.ts`), with a note\n * in both saying a shared home was \"a separate decision\". It is this module: a rel type is a fact\n * about the OOXML package format, not about writing or reading one, so neither side should own it.\n * A divergence between the two copies would mean the writer emitting a rel the reader cannot find\n * — a round-trip bug with no compile-time signal.\n *\n * Only types used by more than one module live here. A rel type exactly one module cares about\n * (`tags`, `oleObject`, the modern comments part, …) stays declared next to the code that reads or\n * emits it — hoisting those would trade a definition you can see for one you have to go and find,\n * and buy nothing. A writer and a reader of the same part count as two modules even when each\n * names the string once: that pair is exactly the divergence this module exists to prevent.\n *\n * The same reasoning covers **part content types**, which are the same kind of fact and fail the\n * same silent way, including every entry the writer's `[Content_Types].xml` declares.\n */\n\nimport { OOXML_NS } from './namespaces.js'\n\n/** Root of every ECMA-376 schema URI. Private: callers want one of the prefixes below. */\nconst SCHEMA_BASE = 'http://schemas.openxmlformats.org/'\n\n/**\n * Prefix for `.rels` `Type` URIs — append the type name (`slide`, `image`, `theme`, …).\n * Exported for the write side, which builds one-off rel types at their call sites.\n */\nexport const OFFICE_REL = SCHEMA_BASE + 'officeDocument/2006/relationships/'\n\n/** `xmlns` of every `<Relationships>` part. Also the prefix of the package-scoped rel types. */\nexport const PACKAGE_REL_NS = OOXML_NS.pr\n\n/**\n * Prefix for the Microsoft rel types this library emits and reads. Exported for the same reason\n * as {@link OFFICE_REL}: a rel type only one module names is built from it at that module's call site.\n */\nexport const MS_REL = 'http://schemas.microsoft.com/office/'\n\n/** `p:sldIdLst` → a slide part. */\nexport const SLIDE_REL = OFFICE_REL + 'slide'\n/** A slide → its layout; a master → each of its layouts. */\nexport const SLIDE_LAYOUT_REL = OFFICE_REL + 'slideLayout'\n/** A layout → its master; the presentation → each master. */\nexport const SLIDE_MASTER_REL = OFFICE_REL + 'slideMaster'\n/** A slide → its notes slide. */\nexport const NOTES_SLIDE_REL = OFFICE_REL + 'notesSlide'\n/** A notes slide → the notes master; the presentation → the notes master. */\nexport const NOTES_MASTER_REL = OFFICE_REL + 'notesMaster'\n/** A master or notes master → its theme. Layouts and slides inherit it rather than holding one. */\nexport const THEME_REL = OFFICE_REL + 'theme'\n/** The package root → `ppt/presentation.xml`. The entry point to everything above. */\nexport const OFFICE_DOCUMENT_REL = OFFICE_REL + 'officeDocument'\n/** Any part → an image in `ppt/media/`. */\nexport const IMAGE_REL = OFFICE_REL + 'image'\n/** Any part → an external or internal jump target. External ones carry `TargetMode=\"External\"`. */\nexport const HYPERLINK_REL = OFFICE_REL + 'hyperlink'\n/** The presentation → `ppt/tableStyles.xml`. */\nexport const TABLE_STYLES_REL = OFFICE_REL + 'tableStyles'\n/** The package root → `docProps/core.xml`. Package-scoped, so not under {@link OFFICE_REL}. */\nexport const CORE_PROPS_REL = PACKAGE_REL_NS + '/metadata/core-properties'\n/** The package root → `docProps/app.xml`. */\nexport const EXTENDED_PROPS_REL = OFFICE_REL + 'extended-properties'\n/** The package root → `docProps/custom.xml`. */\nexport const CUSTOM_PROPS_REL = OFFICE_REL + 'custom-properties'\n/** A slide → its legacy comments part (`ppt/comments/commentN.xml`). */\nexport const COMMENTS_REL = OFFICE_REL + 'comments'\n/** The presentation → the deck-wide legacy comment-author registry (`ppt/commentAuthors.xml`). */\nexport const COMMENT_AUTHORS_REL = OFFICE_REL + 'commentAuthors'\n/** The presentation → the 2018 comment-author registry (`ppt/authors.xml`), a Microsoft rel type. */\nexport const MODERN_COMMENT_AUTHORS_REL = MS_REL + '2018/10/relationships/authors'\n/** The presentation → `ppt/presProps.xml`. */\nexport const PRES_PROPS_REL = OFFICE_REL + 'presProps'\n/** The presentation → `ppt/viewProps.xml`. */\nexport const VIEW_PROPS_REL = OFFICE_REL + 'viewProps'\n/** The presentation → the handout master. */\nexport const HANDOUT_MASTER_REL = OFFICE_REL + 'handoutMaster'\n/** A part → a theme override, which replaces the deck theme for that part alone. */\nexport const THEME_OVERRIDE_REL = OFFICE_REL + 'themeOverride'\n/** The presentation → an embedded font part, one per face. */\nexport const FONT_REL = OFFICE_REL + 'font'\n\n// --- Media -----------------------------------------------------------------\n\n/** A slide → an audio blob in `ppt/media/`. Paired with {@link MS_MEDIA_REL} on the same target. */\nexport const AUDIO_REL = OFFICE_REL + 'audio'\n/** A slide → a video blob in `ppt/media/`, or an online-video placeholder. Paired with {@link MS_MEDIA_REL}. */\nexport const VIDEO_REL = OFFICE_REL + 'video'\n/**\n * The MS-2007 `media` rel every audio/video shape carries alongside the ECMA one, pointing at the\n * same target. It is what `<p14:media r:embed>` resolves, so a media shape needs both.\n */\nexport const MS_MEDIA_REL = MS_REL + '2007/relationships/media'\n/** A slide → an embedded 3D model (`.glb`). Note `2017/06`, not the `2017` of the model3d namespace. */\nexport const MODEL3D_REL = MS_REL + '2017/06/relationships/model3d'\n\n// --- Charts and embeddings -------------------------------------------------\n\n/** A slide → a classic (`c:`) chart part. */\nexport const CHART_REL = OFFICE_REL + 'chart'\n/** A slide → a chartEx (`cx:`, Office 2016) chart part — an MS rel, not the ECMA `chart` one. */\nexport const CHARTEX_REL = MS_REL + '2014/relationships/chartEx'\n/** A chart part → its mandatory style sidecar. */\nexport const CHART_STYLE_REL = MS_REL + '2011/relationships/chartStyle'\n/** A chart part → its mandatory colour-style sidecar. */\nexport const CHART_COLOR_STYLE_REL = MS_REL + '2011/relationships/chartColorStyle'\n/** Any part → an embedded OPC package (an Office file, itself a zip): a chart's workbook, an OLE payload. */\nexport const PACKAGE_REL = OFFICE_REL + 'package'\n\n// --- Part content types ----------------------------------------------------\n\n/**\n * Root of the ECMA-376 content types. Exported for a content type only one module names, which is\n * built from it at that module's call site; a shared one is a constant below.\n */\nexport const OD_CONTENT = 'application/vnd.openxmlformats-officedocument.'\n/** Root of the OPC package-level content types. Private: callers want one of the constants below. */\nconst PACKAGE_CONTENT = 'application/vnd.openxmlformats-package.'\n/** Root of the Microsoft Office content types the chartEx family uses. Private. */\nconst MS_OFFICE_CONTENT = 'application/vnd.ms-office.'\n/** Root of the PowerPoint-specific Microsoft content types. Exported for the same reason as {@link OD_CONTENT}. */\nexport const MS_POWERPOINT_CONTENT = 'application/vnd.ms-powerpoint.'\n\n/** `ppt/slides/slideN.xml`. */\nexport const SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.slide+xml'\n\n/** `ppt/slideMasters/slideMasterN.xml`. */\nexport const SLIDE_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideMaster+xml'\n/** `ppt/slideLayouts/slideLayoutN.xml`. */\nexport const SLIDE_LAYOUT_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideLayout+xml'\n/** `ppt/notesSlides/notesSlideN.xml`. */\nexport const NOTES_SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesSlide+xml'\n/** `ppt/notesMasters/notesMasterN.xml`. */\nexport const NOTES_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesMaster+xml'\n/** `ppt/theme/themeN.xml`. Not `presentationml.`: a theme is a DrawingML part. */\nexport const THEME_CONTENT_TYPE = OD_CONTENT + 'theme+xml'\n/** `ppt/tableStyles.xml`. */\nexport const TABLE_STYLES_CONTENT_TYPE = OD_CONTENT + 'presentationml.tableStyles+xml'\n/** `ppt/presentation.xml` in an editable `.pptx`. A `.potx` template's main part is a different one. */\nexport const PRESENTATION_MAIN_CONTENT_TYPE = OD_CONTENT + 'presentationml.presentation.main+xml'\n/** Every `.rels` part. Declared once as a `Default` for the `rels` extension, never as an Override. */\nexport const RELATIONSHIPS_CONTENT_TYPE = PACKAGE_CONTENT + 'relationships+xml'\n/** `ppt/presProps.xml`. */\nexport const PRES_PROPS_CONTENT_TYPE = OD_CONTENT + 'presentationml.presProps+xml'\n/** `ppt/viewProps.xml`. */\nexport const VIEW_PROPS_CONTENT_TYPE = OD_CONTENT + 'presentationml.viewProps+xml'\n/** `ppt/comments/commentN.xml`, a legacy comments part. */\nexport const COMMENTS_CONTENT_TYPE = OD_CONTENT + 'presentationml.comments+xml'\n/** `ppt/commentAuthors.xml`. */\nexport const COMMENT_AUTHORS_CONTENT_TYPE = OD_CONTENT + 'presentationml.commentAuthors+xml'\n/** `docProps/core.xml`. Package-scoped, so not under the officedocument prefix. */\nexport const CORE_PROPS_CONTENT_TYPE = PACKAGE_CONTENT + 'core-properties+xml'\n/** `docProps/app.xml`. */\nexport const EXTENDED_PROPS_CONTENT_TYPE = OD_CONTENT + 'extended-properties+xml'\n/** `docProps/custom.xml`. */\nexport const CUSTOM_PROPS_CONTENT_TYPE = OD_CONTENT + 'custom-properties+xml'\n/** `ppt/charts/chartN.xml`, a classic (`c:`) chart. */\nexport const CHART_CONTENT_TYPE = OD_CONTENT + 'drawingml.chart+xml'\n/** `ppt/charts/chartExN.xml`. A chartEx part carries a Microsoft content type, not an `openxmlformats` one. */\nexport const CHARTEX_CONTENT_TYPE = MS_OFFICE_CONTENT + 'chartex+xml'\n/** A chart's mandatory `style{N}.xml` sidecar. */\nexport const CHART_STYLE_CONTENT_TYPE = MS_OFFICE_CONTENT + 'chartstyle+xml'\n/** A chart's mandatory `colors{N}.xml` sidecar. */\nexport const CHART_COLOR_STYLE_CONTENT_TYPE = MS_OFFICE_CONTENT + 'chartcolorstyle+xml'\n/** An embedded `.xlsx` workbook: a chart's data, or an OLE payload. */\nexport const XLSX_CONTENT_TYPE = OD_CONTENT + 'spreadsheetml.sheet'\n/**\n * A whole `.pptx` package: the MIME type of a written deck, and of one embedded as an OLE payload.\n * Declared in `pptx-content-type.ts`, so the `zip` entry can import it without this table.\n */\nexport { PPTX_CONTENT_TYPE } from './pptx-content-type.js'\n/** The handout master part. */\nexport const HANDOUT_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.handoutMaster+xml'\n/** A theme override part. Not `presentationml.`: like a theme, it is a DrawingML part. */\nexport const THEME_OVERRIDE_CONTENT_TYPE = OD_CONTENT + 'themeOverride+xml'\n/** The 2018 comment-author registry. A PowerPoint content type, not an `openxmlformats` one. */\nexport const MODERN_COMMENT_AUTHORS_CONTENT_TYPE = MS_POWERPOINT_CONTENT + 'authors+xml'\n\n// --- Parts a page points at without owning ---------------------------------\n\n/**\n * How far a shared part's ownership reaches.\n *\n * - `deck`: chrome the whole deck owns — masters, layouts, themes, the property parts, the author\n * registries. A page points at it and never owns it, and it is not an orphan just because the\n * slide that last reached it is gone.\n * - `media`: a blob PowerPoint stores once and points every shape that shows it at. Page copies\n * share it, but one that nothing references any more is an orphan.\n * - `page`: another page, or an external link. A page copy points at whichever copy of the target\n * the import chose.\n */\nexport type SharedPartScope = 'deck' | 'media' | 'page'\n\n/** One kind of part a page may point at without owning it. */\nexport interface SharedPartKind {\n\t/** The relationship type a page reaches it by. */\n\treadonly relType: string\n\t/** Its content type, or `null` where nothing matches a part of this kind by content type. */\n\treadonly contentType: string | null\n\treadonly scope: SharedPartScope\n}\n\n/**\n * Every kind of part a page points at without owning it.\n *\n * Two questions read this table, under different keys. Copying a page asks whether a relationship's\n * target may be shared by the copies rather than copied (every row, by `relType`). Pruning after a\n * slide is removed asks whether a part is deck chrome that stays even while nothing reaches it (the\n * `deck` rows, by `contentType`). They were two hand-kept lists, and the two author registries were\n * on the first and missing from the second.\n */\nexport const SHARED_PARTS: readonly SharedPartKind[] = [\n\t{ relType: SLIDE_LAYOUT_REL, contentType: SLIDE_LAYOUT_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: SLIDE_MASTER_REL, contentType: SLIDE_MASTER_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: NOTES_MASTER_REL, contentType: NOTES_MASTER_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: THEME_REL, contentType: THEME_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: THEME_OVERRIDE_REL, contentType: THEME_OVERRIDE_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: HANDOUT_MASTER_REL, contentType: HANDOUT_MASTER_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: PRES_PROPS_REL, contentType: PRES_PROPS_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: VIEW_PROPS_REL, contentType: VIEW_PROPS_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: TABLE_STYLES_REL, contentType: TABLE_STYLES_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: OFFICE_DOCUMENT_REL, contentType: PRESENTATION_MAIN_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: COMMENT_AUTHORS_REL, contentType: COMMENT_AUTHORS_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: MODERN_COMMENT_AUTHORS_REL, contentType: MODERN_COMMENT_AUTHORS_CONTENT_TYPE, scope: 'deck' },\n\t{ relType: IMAGE_REL, contentType: null, scope: 'media' },\n\t{ relType: AUDIO_REL, contentType: null, scope: 'media' },\n\t{ relType: VIDEO_REL, contentType: null, scope: 'media' },\n\t{ relType: MS_MEDIA_REL, contentType: null, scope: 'media' },\n\t{ relType: MODEL3D_REL, contentType: null, scope: 'media' },\n\t{ relType: FONT_REL, contentType: null, scope: 'media' },\n\t{ relType: SLIDE_REL, contentType: null, scope: 'page' },\n\t{ relType: HYPERLINK_REL, contentType: null, scope: 'page' },\n]\n","/**\n * `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the\n * TypeScript union a caller is checked against and the runtime list a value is validated against.\n *\n * **The problem this solves.** Each of these used to exist twice: a hand-written string union in\n * `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`\n * (what the validator checks at run time). Nothing tied the two together, so adding a member to\n * one and not the other produced either a value TypeScript accepts and the validator drops, or a\n * value the validator passes and the type rejects. Two of them had already diverged in *order*,\n * which is harmless, but nothing would have caught a divergence in *content*.\n *\n * **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via\n * `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.\n * This is the idiom `EXTRA_SHAPE_PRESETS` already used; this module brings the stragglers onto it,\n * and holds a few closed schema lists that are not `ST_` types, such as `EMBEDDED_FONT_SLOTS`.\n *\n * **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public\n * write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs\n * them to vet a value before writing it into a loaded part. It is a fact about the schema, so it\n * belongs to none of the three.\n *\n * Values are listed in **schema declaration order**, which is the order the diagnostics print\n * when they tell a caller what is legal.\n *\n * **The chart option bag reads its enumerations from here**: `BarDirection`, `BarGrouping`,\n * `Bar3DShape`, `LegendPosition`, `DisplayBlanksAs`, `DataLabelPosition` and `LineDataSymbol`\n * first, then the axis and error-bar ones. They were the half of this consolidation that went\n * unfinished for a while. `src/types/chart.ts`\n * hand-wrote four of those unions beside the option that takes them and typed the other three as\n * bare `string`, so `barDir` carried no compile-time check at all, and `dataLabelPosition`'s\n * hand-written union was missing `inBase` — a value the validator accepts on a stacked bar, so\n * the two spellings had already diverged in content. Both are gone: for every option here, the\n * type a caller is checked against and the tuple the validator checks are one declaration.\n */\n\n/** `ST_TextAutonumberScheme` — the numbering an auto-numbered bullet counts in (`a:buAutoNum/@type`). */\nexport const TEXT_AUTONUM_SCHEMES = [\n\t'alphaLcParenBoth',\n\t'alphaUcParenBoth',\n\t'alphaLcParenR',\n\t'alphaUcParenR',\n\t'alphaLcPeriod',\n\t'alphaUcPeriod',\n\t'arabicParenBoth',\n\t'arabicParenR',\n\t'arabicPeriod',\n\t'arabicPlain',\n\t'romanLcParenBoth',\n\t'romanUcParenBoth',\n\t'romanLcParenR',\n\t'romanUcParenR',\n\t'romanLcPeriod',\n\t'romanUcPeriod',\n\t'circleNumDbPlain',\n\t'circleNumWdBlackPlain',\n\t'circleNumWdWhitePlain',\n\t'arabicDbPeriod',\n\t'arabicDbPlain',\n\t'ea1ChsPeriod',\n\t'ea1ChsPlain',\n\t'ea1ChtPeriod',\n\t'ea1ChtPlain',\n\t'ea1JpnChsDbPeriod',\n\t'ea1JpnKorPlain',\n\t'ea1JpnKorPeriod',\n\t'arabic1Minus',\n\t'arabic2Minus',\n\t'hebrew2Minus',\n\t'thaiAlphaPeriod',\n\t'thaiAlphaParenR',\n\t'thaiAlphaParenBoth',\n\t'thaiNumPeriod',\n\t'thaiNumParenR',\n\t'thaiNumParenBoth',\n\t'hindiAlphaPeriod',\n\t'hindiNumPeriod',\n\t'hindiNumParenR',\n\t'hindiAlpha1Period',\n] as const\n\n/** `ST_TextStrikeType` — a run's strikethrough (`a:rPr/@strike`). */\nexport const TEXT_STRIKE_TYPES = ['noStrike', 'sngStrike', 'dblStrike'] as const\n\n/** `ST_TextCapsType` — a run's capitalization (`a:rPr/@cap`). */\nexport const TEXT_CAPS_TYPES = ['none', 'small', 'all'] as const\n\n/** `ST_TextUnderlineType` — a run's underline (`a:rPr/@u`). */\nexport const TEXT_UNDERLINE_TYPES = [\n\t'none',\n\t'words',\n\t'sng',\n\t'dbl',\n\t'heavy',\n\t'dotted',\n\t'dottedHeavy',\n\t'dash',\n\t'dashHeavy',\n\t'dashLong',\n\t'dashLongHeavy',\n\t'dotDash',\n\t'dotDashHeavy',\n\t'dotDotDash',\n\t'dotDotDashHeavy',\n\t'wavy',\n\t'wavyHeavy',\n\t'wavyDbl',\n] as const\n\n/** `ST_TextTabAlignType` — a tab stop's alignment (`a:tab/@algn`). */\nexport const TEXT_TAB_ALIGN_TYPES = ['l', 'ctr', 'r', 'dec'] as const\n\n/**\n * `ST_SchemeColorVal` — a theme colour reference (`a:schemeClr/@val`). Wider than\n * {@link THEME_COLOR_SLOTS}: it adds the `bg1`/`tx1`/`bg2`/`tx2` aliases the colour map resolves,\n * and `phClr`, the colour a theme style-matrix entry is applied in.\n */\nexport const SCHEME_COLOR_VALUES = [\n\t'bg1',\n\t'tx1',\n\t'bg2',\n\t'tx2',\n\t'accent1',\n\t'accent2',\n\t'accent3',\n\t'accent4',\n\t'accent5',\n\t'accent6',\n\t'hlink',\n\t'folHlink',\n\t'phClr',\n\t'dk1',\n\t'lt1',\n\t'dk2',\n\t'lt2',\n] as const\n\n/** `ST_TransitionSpeed` — a transition's coarse speed bucket (`p:transition/@spd`). */\nexport const TRANSITION_SPEEDS = ['slow', 'med', 'fast'] as const\n\n/**\n * The base slide transitions: the `p:` type elements of `CT_SlideTransition`'s choice, in its\n * declaration order. The writer emits the type as `<p:TYPE/>`, so this is also the list a type is\n * checked against before it becomes an element name, and the list the script converter uses to\n * decide which read transitions the write API can express. PowerPoint's modern transitions live in\n * other namespaces and are not here.\n */\nexport const TRANSITION_TYPES = [\n\t'blinds',\n\t'checker',\n\t'circle',\n\t'dissolve',\n\t'comb',\n\t'cover',\n\t'cut',\n\t'diamond',\n\t'fade',\n\t'newsflash',\n\t'plus',\n\t'pull',\n\t'push',\n\t'random',\n\t'randomBar',\n\t'split',\n\t'strips',\n\t'wedge',\n\t'wheel',\n\t'wipe',\n\t'zoom',\n] as const\n\n/**\n * The attributes each of {@link TRANSITION_TYPES} declares, which is every key a transition's\n * `variant` can write. Seven are `CT_Empty` and take none.\n */\nexport const TRANSITION_VARIANT_ATTRIBUTES: Readonly<Record<(typeof TRANSITION_TYPES)[number], readonly string[]>> = {\n\tblinds: ['dir'],\n\tchecker: ['dir'],\n\tcircle: [],\n\tdissolve: [],\n\tcomb: ['dir'],\n\tcover: ['dir'],\n\tcut: ['thruBlk'],\n\tdiamond: [],\n\tfade: ['thruBlk'],\n\tnewsflash: [],\n\tplus: [],\n\tpull: ['dir'],\n\tpush: ['dir'],\n\trandom: [],\n\trandomBar: ['dir'],\n\tsplit: ['orient', 'dir'],\n\tstrips: ['dir'],\n\twedge: [],\n\twheel: ['spokes'],\n\twipe: ['dir'],\n\tzoom: ['dir'],\n}\n\n/**\n * `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.\n * @see ECMA-376 Part 1 §20.1.10.9\n */\nexport const BEVEL_PRESETS = [\n\t'relaxedInset',\n\t'circle',\n\t'slope',\n\t'cross',\n\t'angle',\n\t'softRound',\n\t'convex',\n\t'coolSlant',\n\t'divot',\n\t'riblet',\n\t'hardEdge',\n\t'artDeco',\n] as const\nexport type BevelPresetType = (typeof BEVEL_PRESETS)[number]\n\n/**\n * `ST_PresetMaterialType` — how a 3-D surface responds to light.\n * @see ECMA-376 Part 1 §20.1.10.50\n */\nexport const PRESET_MATERIALS = [\n\t'legacyMatte',\n\t'legacyPlastic',\n\t'legacyMetal',\n\t'legacyWireframe',\n\t'matte',\n\t'plastic',\n\t'metal',\n\t'warmMatte',\n\t'translucentPowder',\n\t'powder',\n\t'dkEdge',\n\t'softEdge',\n\t'clear',\n\t'flat',\n\t'softmetal',\n] as const\nexport type PresetMaterialType = (typeof PRESET_MATERIALS)[number]\n\n/**\n * `ST_LightRigType` — the preset lighting scene.\n * @see ECMA-376 Part 1 §20.1.10.35\n */\nexport const LIGHT_RIGS = [\n\t'legacyFlat1',\n\t'legacyFlat2',\n\t'legacyFlat3',\n\t'legacyFlat4',\n\t'legacyNormal1',\n\t'legacyNormal2',\n\t'legacyNormal3',\n\t'legacyNormal4',\n\t'legacyHarsh1',\n\t'legacyHarsh2',\n\t'legacyHarsh3',\n\t'legacyHarsh4',\n\t'threePt',\n\t'balanced',\n\t'soft',\n\t'harsh',\n\t'flood',\n\t'contrasting',\n\t'morning',\n\t'sunrise',\n\t'sunset',\n\t'chilly',\n\t'freezing',\n\t'flat',\n\t'twoPt',\n\t'glow',\n\t'brightRoom',\n] as const\nexport type LightRigType = (typeof LIGHT_RIGS)[number]\n\n/**\n * `ST_LightRigDirection` — where the light rig sits relative to the scene.\n * @see ECMA-376 Part 1 §20.1.10.33\n */\nexport const LIGHT_RIG_DIRECTIONS = ['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br'] as const\nexport type LightRigDirection = (typeof LIGHT_RIG_DIRECTIONS)[number]\n\n/**\n * `ST_TextHorzOverflowType` — `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.\n * @see ECMA-376 Part 1 §20.1.10.68\n */\nexport const TEXT_HORZ_OVERFLOW = ['clip', 'overflow'] as const\nexport type TextHorzOverflowType = (typeof TEXT_HORZ_OVERFLOW)[number]\n\n/**\n * `ST_TextAnchoringType` — `a:bodyPr/@anchor` and `a:tcPr/@anchor`.\n * @see ECMA-376 Part 1 §20.1.10.60\n */\nexport const TEXT_ANCHORS = ['t', 'ctr', 'b', 'just', 'dist'] as const\n\n/** `ST_TextAlignType` — `a:pPr/@algn` and `a:lvlNpPr/@algn`. */\nexport const TEXT_ALIGN_TYPES = ['l', 'ctr', 'r', 'just', 'justLow', 'dist', 'thaiDist'] as const\n\n/**\n * `ST_PresetPatternVal` — `a:pattFill/@prst`, the hatch a pattern fill draws.\n */\nexport const PATTERN_PRESETS = [\n\t'pct5',\n\t'pct10',\n\t'pct20',\n\t'pct25',\n\t'pct30',\n\t'pct40',\n\t'pct50',\n\t'pct60',\n\t'pct70',\n\t'pct75',\n\t'pct80',\n\t'pct90',\n\t'horz',\n\t'vert',\n\t'ltHorz',\n\t'ltVert',\n\t'dkHorz',\n\t'dkVert',\n\t'narHorz',\n\t'narVert',\n\t'dashHorz',\n\t'dashVert',\n\t'cross',\n\t'dnDiag',\n\t'upDiag',\n\t'ltDnDiag',\n\t'ltUpDiag',\n\t'dkDnDiag',\n\t'dkUpDiag',\n\t'wdDnDiag',\n\t'wdUpDiag',\n\t'dashDnDiag',\n\t'dashUpDiag',\n\t'diagCross',\n\t'smCheck',\n\t'lgCheck',\n\t'smGrid',\n\t'lgGrid',\n\t'dotGrid',\n\t'smConfetti',\n\t'lgConfetti',\n\t'horzBrick',\n\t'diagBrick',\n\t'solidDmnd',\n\t'openDmnd',\n\t'dotDmnd',\n\t'plaid',\n\t'sphere',\n\t'weave',\n\t'divot',\n\t'shingle',\n\t'wave',\n\t'trellis',\n\t'zigZag',\n] as const\n\n/**\n * `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.\n * @see ECMA-376 Part 1 §20.1.10.83\n */\nexport const TEXT_VERTICAL = [\n\t'horz',\n\t'vert',\n\t'vert270',\n\t'wordArtVert',\n\t'eaVert',\n\t'mongolianVert',\n\t'wordArtVertRtl',\n] as const\nexport type TextVerticalType = (typeof TEXT_VERTICAL)[number]\n\n/**\n * `ST_LineEndType` — the arrowhead at either end of a stroke (`a:headEnd/@type`,\n * `a:tailEnd/@type`).\n * @see ECMA-376 Part 1 §20.1.10.33\n */\nexport const LINE_END_TYPES = ['none', 'triangle', 'stealth', 'diamond', 'oval', 'arrow'] as const\n\n/** `ST_LineCap` — how a stroke's ends are drawn (`a:ln/@cap`). */\nexport const LINE_CAPS = ['rnd', 'sq', 'flat'] as const\n\n/**\n * The four face slots of `CT_EmbeddedFontListEntry`, in schema child order (`p:font` first, then\n * these). Not an `ST_` type, but a closed, ordered set the schema declares, like\n * {@link THEME_COLOR_SLOTS}. The read and write sides iterate it so their emitters agree on\n * element order, and `sequence.ts` derives `EMBEDDED_FONT_ENTRY_SEQUENCE` from it, so the order\n * the serializer writes and the order the insertion points are computed from are one fact.\n * `embedded-fonts.ts` re-exports it.\n */\nexport const EMBEDDED_FONT_SLOTS = ['regular', 'bold', 'italic', 'boldItalic'] as const\nexport type LineEndType = (typeof LINE_END_TYPES)[number]\n\n/**\n * `ST_TextShapeType` — the preset path text is bent along (`a:prstTxWarp/@prst`), which\n * PowerPoint calls WordArt.\n *\n * `textNoShape` is the identity member: it is legal, and it warps nothing. The library does not\n * narrow this set — every member is a shape PowerPoint draws.\n * @see ECMA-376 Part 1 §20.1.10.76\n */\nexport const TEXT_SHAPE_TYPES = [\n\t'textNoShape',\n\t'textPlain',\n\t'textStop',\n\t'textTriangle',\n\t'textTriangleInverted',\n\t'textChevron',\n\t'textChevronInverted',\n\t'textRingInside',\n\t'textRingOutside',\n\t'textArchUp',\n\t'textArchDown',\n\t'textCircle',\n\t'textButton',\n\t'textArchUpPour',\n\t'textArchDownPour',\n\t'textCirclePour',\n\t'textButtonPour',\n\t'textCurveUp',\n\t'textCurveDown',\n\t'textCanUp',\n\t'textCanDown',\n\t'textWave1',\n\t'textWave2',\n\t'textDoubleWave1',\n\t'textWave4',\n\t'textInflate',\n\t'textDeflate',\n\t'textInflateBottom',\n\t'textDeflateBottom',\n\t'textInflateTop',\n\t'textDeflateTop',\n\t'textDeflateInflate',\n\t'textDeflateInflateDeflate',\n\t'textFadeRight',\n\t'textFadeLeft',\n\t'textFadeUp',\n\t'textFadeDown',\n\t'textSlantUp',\n\t'textSlantDown',\n\t'textCascadeUp',\n\t'textCascadeDown',\n] as const\nexport type TextShapeType = (typeof TEXT_SHAPE_TYPES)[number]\n\n/**\n * `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).\n *\n * The `sys*` members are the \"system\" dashes whose exact dot/gap ratio the renderer picks; the\n * rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept\n * this whole set, so a caller who knows one knows the other.\n * @see ECMA-376 Part 1 §20.1.10.49\n */\nexport const PRESET_LINE_DASHES = [\n\t'solid',\n\t'dot',\n\t'dash',\n\t'lgDash',\n\t'dashDot',\n\t'lgDashDot',\n\t'lgDashDotDot',\n\t'sysDash',\n\t'sysDot',\n\t'sysDashDot',\n\t'sysDashDotDot',\n] as const\nexport type PresetLineDashVal = (typeof PRESET_LINE_DASHES)[number]\n\n/**\n * `ST_BarDir` — whether a bar/column plot runs horizontally or vertically (`c:barDir/@val`).\n * @see ECMA-376 Part 1 §21.2.3.3\n */\nexport const BAR_DIRECTIONS = ['bar', 'col'] as const\nexport type BarDirection = (typeof BAR_DIRECTIONS)[number]\n\n/**\n * `ST_BarGrouping` — how a bar/column plot stacks its series (`c:grouping/@val` inside\n * `c:barChart`/`c:bar3DChart`).\n * @see ECMA-376 Part 1 §21.2.3.4\n */\nexport const BAR_GROUPINGS = ['percentStacked', 'clustered', 'standard', 'stacked'] as const\nexport type BarGrouping = (typeof BAR_GROUPINGS)[number]\n\n/**\n * `ST_Grouping` — the same decision for the plots that have no clustered form\n * (`c:areaChart`, `c:lineChart`).\n * @see ECMA-376 Part 1 §21.2.3.17\n */\nexport const GROUPINGS = ['percentStacked', 'standard', 'stacked'] as const\n\n/**\n * `ST_Shape` — the solid a 3-D bar is drawn as (`c:shape/@val`).\n * @see ECMA-376 Part 1 §21.2.3.35\n */\nexport const BAR_3D_SHAPES = ['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'] as const\nexport type Bar3DShape = (typeof BAR_3D_SHAPES)[number]\n\n/**\n * `ST_RadarStyle` — how a radar plot is drawn (`c:radarStyle/@val`).\n * @see ECMA-376 Part 1 §21.2.3.33\n */\nexport const RADAR_STYLES = ['standard', 'marker', 'filled'] as const\nexport type RadarStyle = (typeof RADAR_STYLES)[number]\n\n/**\n * This library's own names for two of the three radar styles, mapped to the wire spelling each\n * one means. They are the PowerPoint UI's words (\"Radar\", \"Radar with Markers\"), which is why\n * they were chosen; `filled` needed no rename and is already the schema's own spelling, which is\n * what made the other two read as typos rather than as a second vocabulary.\n *\n * Both spellings are accepted on the public option and normalized to the wire one at definition\n * time. Before that, `radarStyle: 'marker'` — the schema's word, and the obvious guess for anyone\n * reading a chart part — failed the enum check and silently fell back to `standard`, so a caller\n * asking for markers got a plain radar.\n */\nexport const RADAR_STYLE_ALIASES = { radar: 'standard', markers: 'marker' } as const\nexport type RadarStyleAlias = keyof typeof RADAR_STYLE_ALIASES\n/**\n * The alias spellings alone, for the definer's enum check. Derived from the map rather than\n * written out again — the whole point of this module is that the list a value is validated\n * against and the union it is typed against cannot drift apart.\n */\nexport const RADAR_STYLE_ALIAS_NAMES = Object.keys(RADAR_STYLE_ALIASES) as readonly RadarStyleAlias[]\n\n/**\n * `ST_LegendPos` — where the legend sits relative to the plot area (`c:legendPos/@val`).\n * @see ECMA-376 Part 1 §21.2.3.24\n */\nexport const LEGEND_POSITIONS = ['b', 'tr', 'l', 'r', 't'] as const\nexport type LegendPosition = (typeof LEGEND_POSITIONS)[number]\n\n/**\n * `ST_DispBlanksAs` — what a plot draws where a value is missing (`c:dispBlanksAs/@val`).\n * @see ECMA-376 Part 1 §21.2.3.10\n */\nexport const DISPLAY_BLANKS_AS = ['span', 'gap', 'zero'] as const\nexport type DisplayBlanksAs = (typeof DISPLAY_BLANKS_AS)[number]\n\n/**\n * `ST_DLblPos` — where a data label sits relative to its point (`c:dLblPos/@val`).\n *\n * The whole set is legal on the attribute, but only a subset of it is legal *per plot type* —\n * PowerPoint offers a pie chart `bestFit`/`ctr`/`inEnd`/`outEnd` and nothing else. Those subsets\n * are a fact about the chart types rather than about the attribute, so they live beside the\n * chart definer that applies them; this is the value space they are drawn from.\n * @see ECMA-376 Part 1 §21.2.3.13\n */\nexport const DATA_LABEL_POSITIONS = ['bestFit', 'b', 'ctr', 'inBase', 'inEnd', 'l', 'outEnd', 'r', 't'] as const\nexport type DataLabelPosition = (typeof DATA_LABEL_POSITIONS)[number]\n\n/**\n * `ST_MarkerStyle`, **narrowed** to what the library authors (`c:symbol/@val`).\n *\n * The schema also has `plus`, `star`, `x`, `picture` and `auto`. Neither PowerPoint 2013 nor\n * PowerPoint Online draws the first three, `picture` needs a `c:spPr` blip this API has no\n * spelling for, and `auto` is what leaving the option off already means — so the accepted set is\n * deliberately smaller than the type. Widen it only with evidence that the member renders.\n * @see ECMA-376 Part 1 §21.2.3.27\n */\nexport const LINE_DATA_SYMBOLS = ['circle', 'dash', 'diamond', 'dot', 'none', 'square', 'triangle'] as const\nexport type LineDataSymbol = (typeof LINE_DATA_SYMBOLS)[number]\n\n/** `ST_TickLblPos` — where an axis draws its tick labels (`c:tickLblPos/@val`). */\nexport const TICK_LABEL_POSITIONS = ['high', 'low', 'nextTo', 'none'] as const\nexport type TickLabelPosition = (typeof TICK_LABEL_POSITIONS)[number]\n\n/** `ST_Orientation` — which way an axis runs (`c:orientation/@val`). */\nexport const AXIS_ORIENTATIONS = ['maxMin', 'minMax'] as const\nexport type AxisOrientation = (typeof AXIS_ORIENTATIONS)[number]\n\n/** `ST_TickMark` — an axis' major or minor tick marks (`c:majorTickMark/@val`, `c:minorTickMark/@val`). */\nexport const TICK_MARKS = ['cross', 'in', 'none', 'out'] as const\nexport type TickMark = (typeof TICK_MARKS)[number]\n\n/** `ST_CrossBetween` — whether a value axis crosses its category axis between or on categories (`c:crossBetween/@val`). */\nexport const CROSS_BETWEEN = ['between', 'midCat'] as const\nexport type CrossBetween = (typeof CROSS_BETWEEN)[number]\n\n/** `ST_BuiltInUnit` — the unit a value axis displays its labels in (`c:builtInUnit/@val`). */\nexport const BUILT_IN_UNITS = [\n\t'hundreds',\n\t'thousands',\n\t'tenThousands',\n\t'hundredThousands',\n\t'millions',\n\t'tenMillions',\n\t'hundredMillions',\n\t'billions',\n\t'trillions',\n] as const\nexport type BuiltInUnit = (typeof BUILT_IN_UNITS)[number]\n\n/** `ST_TimeUnit` — a date axis' base, major or minor time unit (`c:baseTimeUnit/@val` and its two siblings). */\nexport const TIME_UNITS = ['days', 'months', 'years'] as const\nexport type TimeUnit = (typeof TIME_UNITS)[number]\n\n/** `ST_ErrDir` — the axis an error bar measures along (`c:errDir/@val`). */\nexport const ERROR_BAR_DIRECTIONS = ['x', 'y'] as const\nexport type ErrorBarDirection = (typeof ERROR_BAR_DIRECTIONS)[number]\n\n/** `ST_ErrBarType` — which sides of a point draw an error bar (`c:errBarType/@val`). */\nexport const ERROR_BAR_TYPES = ['both', 'minus', 'plus'] as const\nexport type ErrorBarType = (typeof ERROR_BAR_TYPES)[number]\n\n/** `ST_ErrValType` — how an error bar's amount is read (`c:errValType/@val`). */\nexport const ERROR_BAR_VALUE_TYPES = ['cust', 'fixedVal', 'percentage', 'stdDev', 'stdErr'] as const\nexport type ErrorBarValueType = (typeof ERROR_BAR_VALUE_TYPES)[number]\n\n/**\n * The twelve theme colour slots (`a:clrScheme` children) a `p:clrMap` token can point at.\n *\n * Not an `ST_` type — these are element names inside `a:CT_ColorScheme`, which the schema\n * declares as a fixed sequence rather than an enumeration. The effect is the same: a closed,\n * ordered set of twelve names, in the order the scheme declares them.\n * @see ECMA-376 Part 1 §20.1.6.2\n */\nexport const THEME_COLOR_SLOTS = [\n\t'dk1',\n\t'lt1',\n\t'dk2',\n\t'lt2',\n\t'accent1',\n\t'accent2',\n\t'accent3',\n\t'accent4',\n\t'accent5',\n\t'accent6',\n\t'hlink',\n\t'folHlink',\n] as const\nexport type ThemeColorSlot = (typeof THEME_COLOR_SLOTS)[number]\n\n/**\n * The twelve colour-map tokens (`p:clrMap` attributes), in schema attribute order.\n *\n * A slide's `schemeClr val=\"tx1\"` names a *token*, not a slot: the master's `p:clrMap` is the\n * indirection that sends it to a {@link ThemeColorSlot}. Which is why the two lists look alike\n * and are not the same list — `bg1`/`tx1` are tokens, `lt1`/`dk1` are slots.\n * @see ECMA-376 Part 1 §19.3.1.6\n */\nexport const COLOR_MAP_TOKENS = [\n\t'bg1',\n\t'tx1',\n\t'bg2',\n\t'tx2',\n\t'accent1',\n\t'accent2',\n\t'accent3',\n\t'accent4',\n\t'accent5',\n\t'accent6',\n\t'hlink',\n\t'folHlink',\n] as const\nexport type ColorMapToken = (typeof COLOR_MAP_TOKENS)[number]\n\n/**\n * The identity colour map: the `p:clrMap` this library emits on every master and notes master,\n * and the one the script printer recognises so it can skip printing a map that is the default.\n *\n * \"Identity\" up to the light/dark naming: each token points at the slot of the same name, with\n * `bg`/`tx` reading as light/dark. A deck that maps them anywhere else — swapping the light and\n * dark slots is the usual case — resolves every `schemeClr` in the deck differently.\n *\n * Typed `Record<ColorMapToken, ThemeColorSlot>` so a token added to {@link COLOR_MAP_TOKENS}\n * without a mapping, or a slot misspelled, is a compile error rather than a theme that opens\n * fine and paints one script in the wrong colour. Declared in the same order as the tokens,\n * because it is emitted by iterating this object and the attribute order is part of the bytes.\n */\nexport const DEFAULT_COLOR_MAP: Readonly<Record<ColorMapToken, ThemeColorSlot>> = {\n\tbg1: 'lt1',\n\ttx1: 'dk1',\n\tbg2: 'lt2',\n\ttx2: 'dk2',\n\taccent1: 'accent1',\n\taccent2: 'accent2',\n\taccent3: 'accent3',\n\taccent4: 'accent4',\n\taccent5: 'accent5',\n\taccent6: 'accent6',\n\thlink: 'hlink',\n\tfolHlink: 'folHlink',\n}\n","/**\n * pptx-ts: hex colour text, in the one spelling both halves use.\n *\n * A caller may write a colour with or without a leading `#`, and the library accepts both\n * everywhere — which means every site that validates or parses one strips it first. Those\n * strips had drifted into three spellings across six sites, and one of them was not\n * anchored: `.replace('#', '')` takes the `#` out of `'FF00#0'` and hands `'FF000'` on, which\n * then fails the six-digit test and takes a different branch than the anchored forms would.\n * No caller is known to reach that, which is exactly why it wants one spelling rather than a\n * test at each site.\n *\n * This lives at the root rather than under `gen/` or `read/` because both halves need it:\n * the emitters strip on the way in, the readers strip on the way back out — and for the same\n * reason the *validation* belongs here too. `REGEX_HEX_COLOR` used to live in\n * `constants-internal.ts`, which is a write-side module the read path cannot import, so the read\n * path re-spelled the regex; so did one write-side site. Six sites, three spellings of one fact.\n */\n\n/**\n * A colour written as six hex digits, `#` already stripped.\n *\n * Not exported: {@link isHexColor} is the whole of what the call sites want, and a shared mutable\n * `RegExp` object is a worse export than a predicate.\n */\nconst REGEX_HEX_COLOR = /^[0-9a-fA-F]{6}$/\n\n/** An 8-hex RGBA colour, `#` already stripped — {@link splitRgbaHex}'s test. */\nconst REGEX_ARGB_HEX = /^[0-9a-fA-F]{8}$/\n\n/** Strip a single leading `#` from a colour, leaving any other character alone. */\nexport function stripHash(value: string): string {\n\treturn value.startsWith('#') ? value.slice(1) : value\n}\n\n/**\n * Is `value` a 6-hex RGB colour? A leading `#` is stripped first, so both spellings agree.\n *\n * This is the *shape* test only. Whether the caller may also name a scheme colour there is the\n * call site's question, and each still asks it: `createColorElement` falls back to the default\n * font colour, `makeXmlTheme` keeps the Office default and warns, `normalizeHex` throws.\n * @param value - the caller's colour, with or without a leading `#`\n */\nexport function isHexColor(value: string): boolean {\n\treturn REGEX_HEX_COLOR.test(stripHash(value))\n}\n\n/**\n * Is `value` an 8-hex RGBA colour? A leading `#` is stripped first.\n *\n * The 8-digit form is RGB followed by one alpha byte; {@link splitRgbaHex} is what takes it apart.\n * @param value - the caller's colour, with or without a leading `#`\n */\nfunction isArgbHex(value: string): boolean {\n\treturn REGEX_ARGB_HEX.test(stripHash(value))\n}\n\n/**\n * Split an 8-hex RGBA colour into its 6-hex RGB and a 0–1 alpha; anything else passes through\n * unchanged with no alpha.\n *\n * `#` is stripped first, so both spellings reach the same answer. Two sites parsed this by\n * hand — `createColorElement`, which turns the alpha into an `<a:alpha>` sibling, and\n * `normalizeShadowOptions`, which turns it into a shadow's `_alpha` — and they divided by 255 at\n * different points in their arithmetic.\n * @param value - the caller's colour, with or without a leading `#`\n */\nexport function splitRgbaHex(value: string): { rgb: string; alpha?: number } {\n\tconst hex = stripHash(value)\n\tif (!isArgbHex(hex)) return { rgb: hex }\n\treturn { rgb: hex.slice(0, 6), alpha: parseInt(hex.slice(6, 8), 16) / 255 }\n}\n","/**\n * Parsing an `xsd:boolean` attribute value.\n *\n * **Why a function at all.** `xsd:boolean` has four lexical forms — `1`, `0`, `true`, `false` —\n * and OOXML attributes typed with it accept every one of them. PowerPoint writes only `1` and\n * `0`, so a hand-rolled `=== '1'` test passes against every deck this library produces and\n * against every deck PowerPoint produces, and silently misreads the other producers. That is the\n * worst shape a bug can have: invisible to the fixtures, visible only on a customer's file.\n *\n * **Why this module is neither `gen/` nor `read/`.** The lexical space of a schema type is a fact\n * about the schema, like `sequence.ts`'s document order and `body-insets.ts`'s defaults. The\n * parser lived in `read/oxml/dom.ts` because reading is where most of the demand is, and three\n * private copies had collapsed into it — but `read/oxml/dom.ts` imports `@xmldom/xmldom`, so\n * anything outside `read/` that wants this five-line function has to take a DOM dependency to get\n * it, or write a fourth copy. `script/from-read/detect.ts` hit exactly that and wrote the copy.\n *\n * The DOM-typed convenience wrapper stays behind in `read/oxml/dom.ts` as `boolAttr`, because\n * *that* one really is about reading an element.\n *\n * **The write direction is here too**, and it is where the interesting distinction lives: an\n * emitter writing a boolean has THREE useful shapes, not one — see {@link xsdBool} and\n * {@link xsdBoolIfTrue}. Sixty-odd inline ternaries spelled them in three ways with nothing\n * naming which was which.\n */\n\n/**\n * Parse an `xsd:boolean` OOXML attribute (`1`/`0`/`true`/`false`); else `null`.\n *\n * `null` for an absent *or* unparseable value is deliberate and load-bearing at the call sites:\n * several attributes have a schema default of `true`, so they test `!== false` rather than\n * `=== true` and an unset attribute has to be distinguishable from an explicit `0`.\n */\nexport function boolValue(value: string | null | undefined): boolean | null {\n\tif (value === '1' || value === 'true') return true\n\tif (value === '0' || value === 'false') return false\n\treturn null\n}\n\n/**\n * The lexical form this library writes for an `xsd:boolean`.\n *\n * A string rather than `0 | 1`: the attribute builder stringifies either, but naming one form\n * is what stops a helper's signature and its callers spelling the same value two ways.\n */\nexport type XsdBool = '1' | '0'\n\n/**\n * A boolean as the `1`/`0` an `xsd:boolean` attribute takes.\n *\n * Writes the attribute either way, so `false` is *stated*. Use this wherever the schema\n * default is `true`, or wherever the absence of the attribute would mean something other\n * than `false` — a value inherited from a list style, a layout or the theme.\n * @param value - the resolved boolean\n */\nexport function xsdBool(value: boolean | undefined | null): XsdBool {\n\treturn value ? '1' : '0'\n}\n\n/**\n * A boolean as `1`, or `null` so the attribute is left out entirely.\n *\n * **Correct only where the schema default is `false`.** It collapses \"false\" and \"unset\" into\n * one output, which is the two-spellings-for-three-states shape the API policy warns about: the\n * next attribute with a `true` default written this way reads as correct and is wrong. Every\n * current caller is on a `false`-defaulting attribute, so the collapse costs nothing today —\n * naming it is what makes the next one visible.\n * @param value - the resolved boolean\n */\nexport function xsdBoolIfTrue(value: boolean | undefined | null): '1' | null {\n\treturn value ? '1' : null\n}\n","/**\n * Validating a value against an `ST_` enumeration, under the two policies the library uses.\n *\n * **Why validate at all.** A value outside its `ST_` union makes the containing part\n * schema-invalid, and PowerPoint reports that as a *corrupt file* rather than as a mis-set\n * option — so the cost of letting one through is a deck that will not open, attributed to\n * nothing in particular. Both halves therefore check before a value reaches the XML.\n *\n * **Why two policies.** They differ deliberately, and the difference is about where the value\n * came from:\n *\n * - {@link checkEnumOrWarn} (write path) reports and **drops** the attribute, leaving the\n * renderer on the schema default. An option here comes from a deck being built, and losing one\n * attribute is better than failing an entire build over it.\n * - {@link checkEnumOrThrow} (read/edit path) **throws**. A value here comes from a caller\n * editing one attribute of a loaded deck, so silently doing nothing would leave them looking at\n * an unchanged file with no explanation.\n *\n * Before this module the two policies were spread across three near-identical private validators\n * (two in `gen/`, one in `read/`), each with its own wording; adding an enum meant writing a\n * fourth. The policy split is worth keeping — the triplication was not.\n */\n\nimport type { DiagnosticCode, InvalidOptionErrorCode } from '../codes.js'\nimport { warnOnce } from '../diagnostics.js'\nimport { InvalidOptionError } from '../errors.js'\n\n/**\n * Check a value against its `ST_` union, reporting and dropping it when outside (the write-path\n * policy — see the module note).\n *\n * `undefined`/`null` returns `null` without reporting: an unset option is not an invalid one, and\n * it is by far the common case.\n *\n * The offending value is interpolated into the message deliberately. {@link warnOnce} dedups on\n * code **and** message, so keeping the value in the text is what lets a second, *different* bad\n * value under the same code still get reported.\n * @param value - the value the caller supplied, if any\n * @param valid - the enum's members\n * @param code - the condition to report\n * @param label - how to name the offending option in the message, e.g. ``'table cell: cell3D `preset`'``\n * @param detail - extra structured context to merge into the diagnostic's `detail`\n * @returns the value when legal, else `null`\n */\nexport function checkEnumOrWarn<T extends string>(\n\tvalue: string | undefined | null,\n\tvalid: readonly T[],\n\tcode: DiagnosticCode,\n\tlabel: string,\n\tdetail?: Readonly<Record<string, unknown>>\n): T | null {\n\tif (value === undefined || value === null) return null\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\twarnOnce(code, `${label} value \\`${String(value)}\\` is not valid and is ignored — use one of ${valid.join(', ')}.`, {\n\t\treceived: value,\n\t\tvalid,\n\t\t...detail,\n\t})\n\treturn null\n}\n\n/**\n * Check a value against its `ST_` union, throwing when outside (the read/edit-path policy — see\n * the module note).\n * @param value - the value the caller asked for\n * @param valid - the enum's members\n * @param attribute - the attribute's name, for the message\n * @param code - the condition to report\n * @returns `value`, when it is legal\n */\nexport function checkEnumOrThrow<T extends string>(\n\tvalue: string,\n\tvalid: readonly T[],\n\tattribute: string,\n\tcode: InvalidOptionErrorCode\n): T {\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\tthrow new InvalidOptionError(\n\t\tcode,\n\t\t`Invalid ${attribute}: ${JSON.stringify(value)}. Expected one of: ${valid.join(', ')}.`\n\t)\n}\n","/**\n * `a:ln/@cap`, and the write API's `cap` on the other side of it.\n *\n * `createLineCap` in `gen/drawingml/line.ts` and its inverse `CAP_TOKENS` in\n * `script/from-read/shape-paint.ts` stated the same three pairs in opposite directions. One table\n * here, both directions derived from it, as `ooxml/text-anchor.ts` does for `valign`.\n *\n * This module keeps `ooxml/`'s no-runtime-imports property: both references below are type-only.\n */\n\nimport type { LineCap } from '../types/chart.js'\nimport type { LINE_CAPS } from './st-enums.js'\n\n/** An `ST_LineCap` token. */\nexport type LineCapToken = (typeof LINE_CAPS)[number]\n\n/**\n * Every `cap` the write API names and the token it writes. `satisfies` over `Record<LineCap, …>`\n * makes a member added to `LineCap` without a token a compile error, and `ST_LineCap` has exactly\n * these three members, so the inverse covers every token too.\n */\nconst TOKEN_BY_LINE_CAP = {\n\tflat: 'flat',\n\tsquare: 'sq',\n\tround: 'rnd',\n} as const satisfies Record<LineCap, LineCapToken>\n\n/** The `cap` token a `LineCap` writes, or `undefined` for a value the write API does not name. */\nexport function lineCapToken(cap: string): LineCapToken | undefined {\n\treturn Object.hasOwn(TOKEN_BY_LINE_CAP, cap) ? TOKEN_BY_LINE_CAP[cap as LineCap] : undefined\n}\n\n/** A `cap` token back to the `LineCap` that authors it. */\nexport const LINE_CAP_BY_TOKEN: Readonly<Record<string, LineCap>> = Object.fromEntries(\n\tObject.entries(TOKEN_BY_LINE_CAP).map(([cap, token]) => [token, cap as LineCap])\n)\n","/**\n * `a:pPr/@algn` and `a:lvlNpPr/@algn`, and the write API's `align` on the other side of it.\n *\n * Three places stated the same correspondence: the paragraph emitter's switch in\n * `gen/drawingml/text-run.ts`, `masterAlignAttr` in `gen/slide/master.ts`, and the script\n * converter's inverse in `script/from-read/text.ts`, which cannot import `gen/`. One table here,\n * both directions derived from it, as `ooxml/text-anchor.ts` does for `valign`.\n *\n * This module keeps `ooxml/`'s no-runtime-imports property: {@link TEXT_ALIGN_TYPES} comes from a\n * module with none, and the {@link HAlign} reference is type-only, so it is erased.\n */\n\nimport type { HAlign } from '../types/core.js'\nimport type { TEXT_ALIGN_TYPES } from './st-enums.js'\n\n/** An `ST_TextAlignType` token. */\nexport type TextAlignToken = (typeof TEXT_ALIGN_TYPES)[number]\n\n/**\n * Every `align` the write API names and the token it writes. `satisfies` over `Record<HAlign, …>`\n * makes a member added to `HAlign` without a token a compile error. `justLow`, `dist` and\n * `thaiDist` have no `align` spelling.\n */\nconst ALGN_BY_ALIGN = {\n\tleft: 'l',\n\tcenter: 'ctr',\n\tright: 'r',\n\tjustify: 'just',\n} as const satisfies Record<HAlign, TextAlignToken>\n\n/** The `algn` token an `align` value writes, or `undefined` for a value the write API does not name. */\nexport function textAlignToken(align: string): TextAlignToken | undefined {\n\treturn Object.hasOwn(ALGN_BY_ALIGN, align) ? ALGN_BY_ALIGN[align as HAlign] : undefined\n}\n\n/** An `algn` token back to the `align` a generated script writes. */\nexport const HALIGN_BY_TEXT_ALIGN: Readonly<Record<string, HAlign>> = Object.fromEntries(\n\tObject.entries(ALGN_BY_ALIGN).map(([align, token]) => [token, align as HAlign])\n)\n","/**\n * Intrinsic image geometry: reading a natural pixel size out of header bytes, and the\n * `<a:srcRect>` crop math that fits that natural size into a display box.\n *\n * Shared by both sides of the library — the write path (`addImage({ sizing })`) and the read\n * API's `Picture.setImage({ fit })` — which is why it lives outside `gen/` and `read/`.\n * Everything here is synchronous and pure: headers only, never pixel decoding.\n */\n\nimport { decodeBase64ToBytes } from './base64.js'\nimport { PERCENT_SCALE } from '../units.js'\nimport { IMAGE_FORMATS } from './image-formats.js'\n\n/**\n * Read the intrinsic dimensions of an image from its header bytes.\n * - synchronous: parses only file-format headers, never decodes pixels\n * - raster: PNG, JPEG, GIF, BMP, TIFF, and WebP (VP8 / VP8L / VP8X) — natural pixels\n * - vector: SVG — intrinsic size from the root `<svg>` width/height or viewBox\n * - unrecognized formats return `null` (no measurable intrinsic size)\n *\n * Used by image `sizing: 'cover' | 'contain'` to compute an aspect-correct\n * `<a:srcRect>` crop from the *natural* image ratio rather than the displayed box.\n * @param {string} dataB64 - base64 image payload or `data:` URI\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBase64(dataB64: string): { w: number; h: number } | null {\n\tconst b = decodeBase64ToBytes(dataB64)\n\treturn b ? getImageSizeFromBytes(b) : null\n}\n\n/**\n * Read the intrinsic dimensions of an image from raw header bytes — the\n * byte-level core shared by {@link getImageSizeFromBase64} and the read API's\n * `Picture.setImage({ fit })`, which already holds the media bytes.\n * @param {Uint8Array} b - image bytes\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBytes(b: Uint8Array): { w: number; h: number } | null {\n\tif (!b || b.length < 24) return null\n\n\t// A byte read that turns an index past the end into 0 rather than `undefined`. That keeps the\n\t// arithmetic below defined, but a zero is not a real field: each format checks the length its own\n\t// fields need before it trusts a value, and the 24-byte floor above covers only the shortest.\n\tconst u = (n: number): number => b[n] ?? 0\n\n\t// PNG: 8-byte signature, then IHDR with width@16 / height@20 (big-endian uint32)\n\tif (IMAGE_FORMATS.png.magic?.(b)) {\n\t\tconst w = (u(16) << 24) | (u(17) << 16) | (u(18) << 8) | u(19)\n\t\tconst h = (u(20) << 24) | (u(21) << 16) | (u(22) << 8) | u(23)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// GIF: \"GIF87a\"/\"GIF89a\", width@6 / height@8 (little-endian uint16)\n\tif (IMAGE_FORMATS.gif.magic?.(b)) {\n\t\tconst w = u(6) | (u(7) << 8)\n\t\tconst h = u(8) | (u(9) << 8)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// BMP: \"BM\", then a DIB header whose size at offset 14 says which layout the dimensions use.\n\tif (IMAGE_FORMATS.bmp.magic?.(b)) {\n\t\tconst dibHeaderSize = u(14) | (u(15) << 8) | (u(16) << 16) | (u(17) << 24)\n\t\t// An OS/2 BITMAPCOREHEADER (12 bytes) stores width@18 / height@20 as unsigned 16-bit values.\n\t\t// Read as 32-bit, the width swallowed the height's bytes and the height ran into the planes and\n\t\t// bit-count fields, so the image measured tens of thousands of pixels wide.\n\t\tif (dibHeaderSize === 12) {\n\t\t\tconst w = u(18) | (u(19) << 8)\n\t\t\tconst h = u(20) | (u(21) << 8)\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\t// Every later header: width@18 / height@22 as little-endian int32, the height negative for a\n\t\t// top-down bitmap. The height ends at byte 25, past the 24-byte floor, so it is checked here.\n\t\tif (b.length < 26) return null\n\t\tconst w = u(18) | (u(19) << 8) | (u(20) << 16) | (u(21) << 24)\n\t\tconst h = u(22) | (u(23) << 8) | (u(24) << 16) | (u(25) << 24)\n\t\tconst aw = Math.abs(w)\n\t\tconst ah = Math.abs(h)\n\t\treturn aw > 0 && ah > 0 ? { w: aw, h: ah } : null\n\t}\n\n\t// WebP: \"RIFF\"....\"WEBP\" then a VP8 / VP8L / VP8X chunk\n\tif (IMAGE_FORMATS.webp.magic?.(b)) {\n\t\tconst fourCC = String.fromCharCode(u(12), u(13), u(14), u(15))\n\t\tif (fourCC === 'VP8 ' && b.length >= 30) {\n\t\t\t// Lossy: 14-bit width/height at offset 26/28 (little-endian, mask off scale bits)\n\t\t\tconst w = (u(26) | (u(27) << 8)) & 0x3fff\n\t\t\tconst h = (u(28) | (u(29) << 8)) & 0x3fff\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8L' && b.length >= 25) {\n\t\t\t// Lossless: 14-bit width/height packed starting at bit 0 of offset 21\n\t\t\tconst bits = u(21) | (u(22) << 8) | (u(23) << 16) | (u(24) << 24)\n\t\t\tconst w = (bits & 0x3fff) + 1\n\t\t\tconst h = ((bits >> 14) & 0x3fff) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8X' && b.length >= 30) {\n\t\t\t// Extended: 24-bit canvas width/height minus one at offset 24/27 (little-endian)\n\t\t\tconst w = (u(24) | (u(25) << 8) | (u(26) << 16)) + 1\n\t\t\tconst h = (u(27) | (u(28) << 8) | (u(29) << 16)) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\treturn null\n\t}\n\n\t// JPEG: \"FFD8FF\", scan segment markers for a Start-Of-Frame (SOFn) and read height@5 / width@7\n\tif (IMAGE_FORMATS.jpeg.magic?.(b)) {\n\t\tlet i = 2\n\t\twhile (i + 9 < b.length) {\n\t\t\tif (b[i] !== 0xff) {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst marker = u(i + 1)\n\t\t\t// Any marker may be preceded by 0xFF fill bytes. Taken as a marker of its own, the next two\n\t\t\t// bytes read as a segment length and the walk jumped clean past the frame header.\n\t\t\tif (marker === 0xff) {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// SOF0..SOF15 carry frame dimensions, excluding DHT(C4)/JPG(C8)/DAC(CC)\n\t\t\tif (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {\n\t\t\t\tconst h = (u(i + 5) << 8) | u(i + 6)\n\t\t\t\tconst w = (u(i + 7) << 8) | u(i + 8)\n\t\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t\t}\n\t\t\t// Standalone markers (RSTn / SOI / EOI / TEM) have no length payload\n\t\t\tif ((marker >= 0xd0 && marker <= 0xd9) || marker === 0x01) {\n\t\t\t\ti += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Otherwise skip this segment using its 2-byte big-endian length\n\t\t\tconst segLen = (u(i + 2) << 8) | u(i + 3)\n\t\t\tif (segLen < 2) break\n\t\t\ti += 2 + segLen\n\t\t}\n\t\treturn null\n\t}\n\n\t// TIFF: an 8-byte header pointing at the first IFD, whose entries carry ImageWidth (0x0100)\n\t// and ImageLength (0x0101). Every other format above reads its size from a fixed offset; this\n\t// one has to walk, because a TIFF states where its directory is rather than where its pixels\n\t// are. Added because the sniffer already recognised TIFF and this did not, so a `.tif` got a\n\t// content type and then silently no intrinsic size.\n\tif (IMAGE_FORMATS.tiff.magic(b)) {\n\t\tconst little = b[0] === 0x49\n\t\tconst u16 = (n: number): number => (little ? u(n) | (u(n + 1) << 8) : (u(n) << 8) | u(n + 1))\n\t\tconst u32 = (n: number): number =>\n\t\t\tlittle\n\t\t\t\t? (u(n) | (u(n + 1) << 8) | (u(n + 2) << 16) | (u(n + 3) << 24)) >>> 0\n\t\t\t\t: ((u(n) << 24) | (u(n + 1) << 16) | (u(n + 2) << 8) | u(n + 3)) >>> 0\n\n\t\tconst ifd = u32(4)\n\t\tif (ifd + 2 > b.length) return null\n\t\tconst entries = u16(ifd)\n\t\tlet w = 0\n\t\tlet h = 0\n\t\tfor (let i = 0; i < entries; i++) {\n\t\t\tconst entry = ifd + 2 + i * 12\n\t\t\tif (entry + 12 > b.length) return null\n\t\t\tconst tag = u16(entry)\n\t\t\tif (tag !== 0x0100 && tag !== 0x0101) continue\n\t\t\t// The value sits inline in the last four bytes. A SHORT (type 3) occupies the first two\n\t\t\t// of them, which on a big-endian file is not where a LONG (type 4) starts.\n\t\t\tconst value = u16(entry + 2) === 3 ? u16(entry + 8) : u32(entry + 8)\n\t\t\tif (tag === 0x0100) w = value\n\t\t\telse h = value\n\t\t}\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// SVG: text-based vector with no binary signature. When the payload is an\n\t// `<svg>` document, read its intrinsic size from the root element so that\n\t// `sizing: 'cover' | 'contain'` is aspect-correct for SVG, not just rasters.\n\tconst text = utf8Decode(b)\n\tif (/<svg[\\s>]/i.test(text)) return getSvgSizeFromMarkup(text)\n\n\treturn null\n}\n\n/**\n * Compute the `<a:srcRect>` crop percentages (each in 1/1000 of a percent, the\n * OOXML unit) for fitting an image of natural size `img` into a display `box`,\n * assuming the cropped region is then stretched to fill the box (`<a:stretch>`).\n *\n * - `cover`: fill the box, cropping the overflowing axis (positive l/r or t/b)\n * - `contain`: fit inside the box, letterboxing the short axis (negative l/r or t/b)\n *\n * Single source of truth for the crop math shared by the write side\n * (`ImageSizingXml`) and the read API's `Picture.setImage({ fit })`. `l`/`r` and\n * `t`/`b` are symmetric (centered crop).\n *\n * There is no fit for a side that is not greater than zero: a zero-size box gave every percentage\n * as `NaN`, and a zero-width one gave `-Infinity`, both written straight into the part.\n * @param {'cover' | 'contain'} type - fit mode\n * @param {{ w: number, h: number }} img - natural image pixel size\n * @param {{ w: number, h: number }} box - displayed frame size (any consistent unit)\n * @returns {{ l: number, r: number, t: number, b: number } | null} srcRect percentages, or `null`\n * when any of the four sizes is not greater than zero\n */\nexport function fitSrcRectPercents(\n\ttype: 'cover' | 'contain',\n\timg: { w: number; h: number },\n\tbox: { w: number; h: number }\n): { l: number; r: number; t: number; b: number } | null {\n\tif (!(img.w > 0 && img.h > 0 && box.w > 0 && box.h > 0)) return null\n\tconst imgRatio = img.h / img.w\n\tconst boxRatio = box.h / box.w\n\tlet width: number\n\tlet height: number\n\tif (type === 'cover') {\n\t\tconst isBoxBased = boxRatio > imgRatio\n\t\twidth = isBoxBased ? box.h / imgRatio : box.w\n\t\theight = isBoxBased ? box.h : box.w * imgRatio\n\t} else {\n\t\tconst widthBased = boxRatio > imgRatio\n\t\twidth = widthBased ? box.w : box.h / imgRatio\n\t\theight = widthBased ? box.w * imgRatio : box.h\n\t}\n\tconst hz = Math.round(PERCENT_SCALE * 0.5 * (1 - box.w / width))\n\tconst vz = Math.round(PERCENT_SCALE * 0.5 * (1 - box.h / height))\n\treturn { l: hz, r: hz, t: vz, b: vz }\n}\n\n/**\n * Read the intrinsic size of an SVG document from its root `<svg>` element.\n * Follows the SVG sizing model: an explicit absolute `width`/`height` pair wins;\n * otherwise the `viewBox` width/height defines the size (and thus aspect ratio).\n * Percentage or missing `width`/`height` fall through to `viewBox`.\n * @param {string} svg - SVG markup\n * @returns {{ w: number, h: number } | null} intrinsic size, or `null` when undeterminable\n */\nfunction getSvgSizeFromMarkup(svg: string): { w: number; h: number } | null {\n\tconst openTag = /<svg\\b[^>]*>/i.exec(svg)?.[0]\n\tif (!openTag) return null\n\t// Anchored on the whitespace before the name. A word boundary also matched inside a longer name,\n\t// between its `-` and the rest, so `stroke-width=\"2\"` was read as the width and `data-height` as\n\t// the height whenever it came first.\n\tconst attr = (name: string): string | null =>\n\t\tnew RegExp(`(?:^|\\\\s)${name}\\\\s*=\\\\s*([\"'])(.*?)\\\\1`, 'i').exec(openTag)?.[2] ?? null\n\t// Leading number with an optional absolute unit; a percentage is not an intrinsic length.\n\tconst absLength = (val: string | null): number => {\n\t\tif (val == null || /%\\s*$/.test(val)) return NaN\n\t\tconst m = /^\\s*\\+?(\\d*\\.?\\d+)/.exec(val)\n\t\treturn m ? parseFloat(m[1] ?? '') : NaN\n\t}\n\tlet w = absLength(attr('width'))\n\tlet h = absLength(attr('height'))\n\tif (!(w > 0 && h > 0)) {\n\t\tconst vb = attr('viewBox')\n\t\tconst p = vb\n\t\t\t? vb\n\t\t\t\t\t.trim()\n\t\t\t\t\t.split(/[\\s,]+/)\n\t\t\t\t\t.map(Number)\n\t\t\t: []\n\t\tconst vw = p[2]\n\t\tconst vh = p[3]\n\t\tif (p.length === 4 && vw != null && vh != null && vw > 0 && vh > 0) {\n\t\t\tw = vw\n\t\t\th = vh\n\t\t}\n\t}\n\treturn w > 0 && h > 0 ? { w, h } : null\n}\n\n/** Decode UTF-8 bytes to a string, isomorphic across Node and browsers. */\nfunction utf8Decode(bytes: Uint8Array): string {\n\treturn new TextDecoder().decode(bytes)\n}\n"],"mappings":";;;;;;;;AAiDA,MAAa,gBAAgB,OAAO,OAAO;CAC1C,KAAK;EACJ,KAAK;EACL,aAAa;EACb,SAAS,CAAC;EACV,aAAa;EACb,QAAQ,MAAM,EAAE,UAAU,KAAK,EAAE,OAAO,OAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO;CAC5F;CACA,MAAM;EACL,KAAK;EACL,aAAa;EACb,SAAS,CAAC,KAAK;EACf,aAAa;EACb,QAAQ,MAAM,EAAE,UAAU,KAAK,EAAE,OAAO,OAAQ,EAAE,OAAO,OAAQ,EAAE,OAAO;CAC3E;CACA,KAAK;EACJ,KAAK;EACL,aAAa;EACb,SAAS,CAAC;EACV,aAAa;EAGb,QAAQ,MAAM,EAAE,UAAU,KAAK,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO;CAC5F;CACA,KAAK;EACJ,KAAK;EACL,aAAa;EACb,SAAS,CAAC;EACV,aAAa;EACb,QAAQ,MAAM,EAAE,UAAU,KAAK,EAAE,OAAO,MAAQ,EAAE,OAAO;CAC1D;CACA,MAAM;EACL,KAAK;EACL,aAAa;EACb,SAAS,CAAC,KAAK;EACf,aAAa;EAEb,QAAQ,MACP,EAAE,UAAU,MACV,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO,KAC5D,EAAE,OAAO,MAAQ,EAAE,OAAO,MAAQ,EAAE,OAAO,KAAQ,EAAE,OAAO;CAChE;CACA,MAAM;EACL,KAAK;EACL,aAAa;EACb,SAAS,CAAC;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;CACX,MAAM,CAAC,KAAK;CACZ,OAAO,CAAC,KAAK;CACb,KAAK,CAAC,SAAS;CACf,SAAS,CAAC;CACV,MAAM,CAAC,SAAS;CAChB,WAAW,CAAC;CACZ,MAAM,CAAC;CACP,MAAM,CAAC,KAAK;CACZ,MAAM,CAAC,KAAK;CACZ,QAAQ,CAAC;CACT,WAAW,CAAC,KAAK;CACjB,OAAO,CAAC,UAAU,KAAK;CACvB,QAAQ,CAAC,KAAK;CACd,OAAO,CAAC;CACR,OAAO,CAAC,QAAQ;CAChB,MAAM,CAAC,KAAK;CACZ,MAAM,CAAC,KAAK;AACb;;;;;AAMA,MAAa,gBAAgB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAOA,MAAa,mBAAmB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAOA,MAAa,aAAa;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAOA,MAAa,uBAAuB;CAAC;CAAM;CAAK;CAAM;CAAK;CAAK;CAAM;CAAK;AAAI;;;;;AAO/E,MAAa,qBAAqB,CAAC,QAAQ,UAAU;;;;;AAOrD,MAAa,eAAe;CAAC;CAAK;CAAO;CAAK;CAAQ;AAAM;;;;AAQ5D,MAAa,kBAAkB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAMA,MA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CAAC,OAAO,KAAK;AACtC"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as isChartType, S as isChartExType, _ as VALID_SHAPE_PRESETS, a as CONNECTOR_PRESET_NAME, b as asChartType, c as PLACEHOLDER_TYPE, d as SHAPE_NAME, f as SchemeColor, g as TextAnchor, h as TableStyle, i as CHART_NAME, l as PlaceholderType, m as SlideObjectType, n as AlignV, o as ChartType, p as ShapeType, r as BulletType, s as OutputType, t as AlignH, u as SCHEME_COLORS, v as WRITE_OUTPUT_TYPE, x as connectorPresetFor, y as ZIP_OUTPUT_TYPE } from "./enums-BUKTUB6V.js";
2
- import { $ as ChartPropsAxisCat, $t as ShapeAdjustValue, A as TextVertType, At as NotesTextOptions, B as ShapeFillProps, Bt as TextMeasurement, C as ImageFillProps, Cn as TimeUnit, Ct as CommonObjectDescriptor, D as PatternPreset, Dt as CommentProps, E as PatternFillProps, Et as PlaceholderProps, F as ConnectorType, Ft as TableLayoutResult, G as ChartDataPointStyle, Gt as ImageBaseProps, H as StrokeProps, Ht as TextPropsOptions, I as FillOption, It as TextBaseProps, J as ChartExGeography, Jt as MediaType, K as ChartErrorBarOptions, Kt as ImageProps, L as HyperlinkActionJump, Lt as TextBulletProps, M as VAlign, Mt as ResolvedCommentAuthor, N as BorderProps, Nt as SlideComment, O as PositionProps, Ot as MeasureTextOptions, P as ConnectorProps, Pt as TableCellLayout, Q as ChartOpts, Qt as ShapeAdjustHandleXY, R as HyperlinkProps, Rt as TextFitShrinkProps, S as HexColor, St as OptsChartGridLine, T as Margin, Tt as ObjectNameProps, U as ChartAreaProps, Ut as textRun, V as ShapeLineProps, Vt as TextProps, W as ChartAxisTickMark, Wt as textRuns, X as ChartLineDash, Xt as ShapeAdjustHandle, Y as ChartExStatistics, Yt as OleObjectProps, Z as ChartMulti, Zt as ShapeAdjustHandlePolar, _ as DataOrPathRequiredProps, _n as RadarStyleAlias, _t as ChartPropsLegend, a as PresentationProps, an as BarGrouping, at as ChartPropsChartDoughnut, b as GradientStopProps, bt as LineCap, c as WriteFileProps, cn as DataLabelPosition, ct as ChartPropsChartPie, d as ThemeProps, dn as LegendPosition, dt as ChartPropsChartStock, en as ShapeConnectionSite, et as ChartPropsAxisSer, f as BackgroundOption, fn as LightRigDirection, ft as ChartPropsChartSurface, g as DataOrPathProps, gn as RadarStyle, gt as ChartPropsFillLine, h as Coord, hn as PresetMaterialType, ht as ChartPropsDataTable, i as PresLayout, in as BarDirection, it as ChartPropsChartBoxWhisker, j as ThemeColor, jt as OverflowBoxOptions, k as RadialGradientFillProps, kt as NotesProps, l as WriteProps, ln as DisplayBlanksAs, lt as ChartPropsChartRadar, m as Color, mn as LineDataSymbol, mt as ChartPropsDataLabel, n as PackagePart, nn as ShapeProps, nt as ChartPropsBase, o as SectionProps, on as BevelPresetType, ot as ChartPropsChartHistogram, p as BackgroundProps, pn as LightRigType, pt as ChartPropsChartWaterfall, q as ChartExBinning, qt as MediaProps, r as PartsProps, rn as Bar3DShape, rt as ChartPropsChartBar, s as WriteBaseProps, st as ChartPropsChartLine, t as CustomPropertyValue, tn as ShapeGuide, tt as ChartPropsAxisVal, u as ThemeColorScheme, ut as ChartPropsChartRegionMap, v as GeometryPoint, vt as ChartPropsTitle, w as LinearGradientFillProps, wt as ObjectLockProps, x as HAlign, xt as OptsChartData, y as GradientFillProps, yt as ChartSeriesOpts, z as ShadowProps, zt as TextGlowProps } from "./pres-C6qgOFAa.js";
3
- import { A as TableCellDiagonals, C as AnimationTrigger, D as TransitionType, E as TransitionSoundProps, F as TableToSlidesDocument, I as TableToSlidesElement, L as TableToSlidesProps, M as TableProps, N as TableRow, O as TableCell, P as TableRowSlide, S as AnimationProps, T as TransitionProps, _ as MasterTextStyleProps, a as Slide, b as SlideMasterProps, c as SectionZoomProps, d as ZoomBaseProps, f as Model3dCameraProps, g as MasterTextStyleLevel, h as MasterBulletProps, i as ObjectOptions, j as TableCellProps, k as TableCell3DProps, l as SlideZoomProps, m as Model3dProps, n as GroupChildProps, o as SlideLayout, p as Model3dPoint, r as GroupProps, s as SlideObjectInfo, t as AddSlideProps, u as SummaryZoomProps, v as SlideMasterChartProps, w as PresetEffect, x as SlideNumberProps, y as SlideMasterObject } from "./slide-Dx2ZeVZ6.js";
4
- import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-D8ot4Ei7.js";
5
- import { A as pixelsToEmu, C as StandardLayoutName, D as emuToPoints, E as emuToPixels, M as ptToHundredths, O as inchesToEmu, S as StandardLayout, T as emuToInches, _ as HUNDREDTHS_PER_POINT, b as PERCENT_SCALE, c as ConstructFamily, g as FIXED_PCT_PER_PERCENT, h as Emu, i as ComposedSlide, j as pointsToEmu, k as percentToEmu, m as DEFAULT_PX_PER_INCH, n as Composed, p as ANGLE_UNITS_PER_DEGREE, r as ComposedPresentation, s as PresentationCore, t as ComposeOptions, v as MAX_COORDINATE_EMU, w as coordToEmu, x as STANDARD_LAYOUTS, y as MIN_COORDINATE_EMU } from "./entry-compose-DCnvBZz2.js";
6
- import { a as EMU_PER_INCH, i as clipPath, n as FlatSide, o as EMU_PER_POINT, r as HalfDiscPreset, s as POINTS_PER_INCH, t as ClipShape } from "./clip-Bl01BPcN.js";
1
+ import { C as isChartType, S as isChartExType, _ as VALID_SHAPE_PRESETS, a as CONNECTOR_PRESET_NAME, b as asChartType, c as PLACEHOLDER_TYPE, d as SHAPE_NAME, f as SchemeColor, g as TextAnchor, h as TableStyle, i as CHART_NAME, l as PlaceholderType, m as SlideObjectType, n as AlignV, o as ChartType, p as ShapeType, r as BulletType, s as OutputType, t as AlignH, u as SCHEME_COLORS, v as WRITE_OUTPUT_TYPE, x as connectorPresetFor, y as ZIP_OUTPUT_TYPE } from "./enums-DQRpVOLh.js";
2
+ import { $ as ChartOpts, $t as ShapeAdjustHandleXY, A as RadialGradientFillProps, At as NotesProps, B as ShadowProps, Bt as TextGlowProps, C as HexColor, Ct as OptsChartGridLine, D as PatternFillProps, Dt as PlaceholderProps, E as Margin, Et as ObjectNameProps, F as ConnectorProps, Ft as TableCellLayout, G as ChartAxisTickMark, Gt as textRuns, H as ShapeLineProps, Ht as TextProps, I as ConnectorType, It as TableLayoutResult, J as ChartExBinning, Jt as MediaProps, K as ChartDataPointStyle, Kt as ImageBaseProps, L as FillOption, Lt as TextBaseProps, M as ThemeColor, Mt as OverflowBoxOptions, N as VAlign, Nt as ResolvedCommentAuthor, O as PatternPreset, Ot as CommentProps, P as BorderProps, Pt as SlideComment, Q as ChartMulti, Qt as ShapeAdjustHandlePolar, R as HyperlinkActionJump, Rt as TextBulletProps, S as HAlign, St as OptsChartData, T as LinearGradientFillProps, Tt as ObjectLockProps, U as StrokeProps, Ut as TextPropsOptions, V as ShapeFillProps, Vt as TextMeasurement, W as ChartAreaProps, Wt as textRun, X as ChartExStatistics, Xt as OleObjectProps, Y as ChartExGeography, Yt as MediaType, Z as ChartLineDash, Zt as ShapeAdjustHandle, _ as DataOrPathProps, _n as RadarStyle, _t as ChartPropsFillLine, a as PresentationProps, an as BarDirection, at as ChartPropsChartBoxWhisker, b as GradientFillProps, bt as ChartSeriesOpts, c as WriteFileProps, ct as ChartPropsChartLine, d as ThemeColorScheme, dt as ChartPropsChartRegionMap, en as ShapeAdjustValue, et as ChartPropsAxisCat, f as ThemeProps, fn as LegendPosition, ft as ChartPropsChartStock, g as Coord, gn as PresetMaterialType, gt as ChartPropsDataTable, h as Color, hn as LineDataSymbol, ht as ChartPropsDataLabel, i as PresLayout, in as Bar3DShape, it as ChartPropsChartBar, j as TextVertType, jt as NotesTextOptions, k as PositionProps, kt as MeasureTextOptions, l as WriteOutputMap, ln as DataLabelPosition, lt as ChartPropsChartPie, m as BackgroundProps, mn as LightRigType, mt as ChartPropsChartWaterfall, n as PackagePart, nn as ShapeGuide, nt as ChartPropsAxisVal, o as SectionProps, on as BarGrouping, ot as ChartPropsChartDoughnut, p as BackgroundOption, pn as LightRigDirection, pt as ChartPropsChartSurface, q as ChartErrorBarOptions, qt as ImageProps, r as PartsProps, rn as ShapeProps, rt as ChartPropsBase, s as WriteBaseProps, sn as BevelPresetType, st as ChartPropsChartHistogram, t as CustomPropertyValue, tn as ShapeConnectionSite, tt as ChartPropsAxisSer, u as WriteProps, un as DisplayBlanksAs, ut as ChartPropsChartRadar, v as DataOrPathRequiredProps, vn as RadarStyleAlias, vt as ChartPropsLegend, w as ImageFillProps, wn as TimeUnit, wt as CommonObjectDescriptor, x as GradientStopProps, xt as LineCap, y as GeometryPoint, yt as ChartPropsTitle, z as HyperlinkProps, zt as TextFitShrinkProps } from "./pres-BA9_lJbY.js";
3
+ import { A as TableCellDiagonals, C as AnimationTrigger, D as TransitionType, E as TransitionSoundProps, F as TableToSlidesDocument, I as TableToSlidesElement, L as TableToSlidesProps, M as TableProps, N as TableRow, O as TableCell, P as TableRowSlide, S as AnimationProps, T as TransitionProps, _ as MasterTextStyleProps, a as Slide, b as SlideMasterProps, c as SectionZoomProps, d as ZoomBaseProps, f as Model3dCameraProps, g as MasterTextStyleLevel, h as MasterBulletProps, i as ObjectOptions, j as TableCellProps, k as TableCell3DProps, l as SlideZoomProps, m as Model3dProps, n as GroupChildProps, o as SlideLayout, p as Model3dPoint, r as GroupProps, s as SlideObjectInfo, t as AddSlideProps, u as SummaryZoomProps, v as SlideMasterChartProps, w as PresetEffect, x as SlideNumberProps, y as SlideMasterObject } from "./slide-BqPtyKmb.js";
4
+ import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-DiMmBU8P.js";
5
+ import { A as pixelsToEmu, C as StandardLayoutName, D as emuToPoints, E as emuToPixels, M as ptToHundredths, O as inchesToEmu, S as StandardLayout, T as emuToInches, _ as HUNDREDTHS_PER_POINT, b as PERCENT_SCALE, c as ConstructFamily, g as FIXED_PCT_PER_PERCENT, h as Emu, i as ComposedSlide, j as pointsToEmu, k as percentToEmu, m as DEFAULT_PX_PER_INCH, n as Composed, p as ANGLE_UNITS_PER_DEGREE, r as ComposedPresentation, s as PresentationCore, t as ComposeOptions, v as MAX_COORDINATE_EMU, w as coordToEmu, x as STANDARD_LAYOUTS, y as MIN_COORDINATE_EMU } from "./entry-compose-6hF9aTmT.js";
6
+ import { a as EMU_PER_INCH, i as clipPath, n as FlatSide, o as EMU_PER_POINT, r as HalfDiscPreset, s as POINTS_PER_INCH, t as ClipShape } from "./clip-DHDlnHUq.js";
7
7
  //#region src/index.d.ts
8
8
  /**
9
9
  * The runtime-agnostic entry: what a consumer gets from the bare `pptx-ts` specifier
@@ -34,5 +34,5 @@ export declare class TsPptx extends PresentationCore {
34
34
  */
35
35
  export declare function createPresentation<const Fs extends readonly ConstructFamily[] = []>(opts?: ComposeOptions<Fs>): Composed<Fs>;
36
36
  //#endregion
37
- export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundOption, BackgroundProps, type Bar3DShape, type BarDirection, type BarGrouping, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, CommonObjectDescriptor, type ComposeOptions, type Composed, type ComposedPresentation, type ComposedSlide, ConnectorProps, ConnectorType, type ConstructFamily, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, type DataLabelPosition, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, type DisplayBlanksAs, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FillOption, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LegendPosition, type LightRigDirection, type LightRigType, LineCap, type LineDataSymbol, LinearGradientFillProps, MAX_COORDINATE_EMU, MIN_COORDINATE_EMU, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderProps, PlaceholderType, PositionProps, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, type RadarStyle, type RadarStyleAlias, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectInfo, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, StrokeProps, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextBulletProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, type TimeUnit, TransitionProps, TransitionSoundProps, TransitionType, TsPptx as default, type TsPptxCode, TsPptxError, type TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
37
+ export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundOption, BackgroundProps, type Bar3DShape, type BarDirection, type BarGrouping, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, CommonObjectDescriptor, type ComposeOptions, type Composed, type ComposedPresentation, type ComposedSlide, ConnectorProps, ConnectorType, type ConstructFamily, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, type DataLabelPosition, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, type DisplayBlanksAs, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FillOption, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LegendPosition, type LightRigDirection, type LightRigType, LineCap, type LineDataSymbol, LinearGradientFillProps, MAX_COORDINATE_EMU, MIN_COORDINATE_EMU, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderProps, PlaceholderType, PositionProps, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, type RadarStyle, type RadarStyleAlias, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectInfo, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, StrokeProps, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextBulletProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, type TimeUnit, TransitionProps, TransitionSoundProps, TransitionType, TsPptx as default, type TsPptxCode, TsPptxError, type TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteOutputMap, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
38
38
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-C4oENPcu.js";
2
- import { A as inchesToEmu, C as MIN_COORDINATE_EMU, D as emuToInches, E as coordToEmu, F as EMU_PER_INCH, I as EMU_PER_POINT, L as POINTS_PER_INCH, M as pixelsToEmu, N as pointsToEmu, O as emuToPixels, P as ptToHundredths, S as MAX_COORDINATE_EMU, T as STANDARD_LAYOUTS, _ as isChartType, a as ChartType, b as FIXED_PCT_PER_PERCENT, c as SchemeColor, d as TableStyle, f as TextAnchor, g as isChartExType, h as connectorPresetFor, i as BulletType, j as percentToEmu, k as emuToPoints, l as ShapeType, m as asChartType, n as AlignH, o as OutputType, p as VALID_SHAPE_PRESETS, r as AlignV, s as PlaceholderType, u as SlideObjectType, v as ANGLE_UNITS_PER_DEGREE, w as PERCENT_SCALE, x as HUNDREDTHS_PER_POINT, y as DEFAULT_PX_PER_INCH } from "./table-cell-margins-EVg0EwxT.js";
3
- import { a as fetchMediaBase64, c as ALL_CONSTRUCT_FAMILIES, i as fetchFontBytes, l as composePresentation, n as textRuns, r as clipPath, s as placeholderSvgPreview, t as textRun, u as PresentationCore } from "./text-sN64Otf_.js";
1
+ import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-Da2nXCJm.js";
2
+ import { A as inchesToEmu, C as MIN_COORDINATE_EMU, D as emuToInches, E as coordToEmu, F as EMU_PER_INCH, I as EMU_PER_POINT, L as POINTS_PER_INCH, M as pixelsToEmu, N as pointsToEmu, O as emuToPixels, P as ptToHundredths, S as MAX_COORDINATE_EMU, T as STANDARD_LAYOUTS, _ as isChartType, a as ChartType, b as FIXED_PCT_PER_PERCENT, c as SchemeColor, d as TableStyle, f as TextAnchor, g as isChartExType, h as connectorPresetFor, i as BulletType, j as percentToEmu, k as emuToPoints, l as ShapeType, m as asChartType, n as AlignH, o as OutputType, p as VALID_SHAPE_PRESETS, r as AlignV, s as PlaceholderType, u as SlideObjectType, v as ANGLE_UNITS_PER_DEGREE, w as PERCENT_SCALE, x as HUNDREDTHS_PER_POINT, y as DEFAULT_PX_PER_INCH } from "./table-cell-margins-PDshga8T.js";
3
+ import { a as fetchMediaBase64, c as ALL_CONSTRUCT_FAMILIES, i as fetchFontBytes, l as composePresentation, n as textRuns, r as clipPath, s as placeholderSvgPreview, t as textRun, u as PresentationCore } from "./text-BvFFMMFQ.js";
4
4
  //#region src/runtime/neutral.ts
5
5
  /**
6
6
  * The adapter for a runtime that is neither Node nor a browser — Deno, Bun, an edge worker,
package/dist/inspect.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-D8ot4Ei7.js";
2
- import { n as OpcPackage } from "./package-J49Ck6S2.js";
1
+ import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-DiMmBU8P.js";
2
+ import { n as OpcPackage } from "./package-KoEgVwII.js";
3
3
  //#region src/inspect.d.ts
4
4
  /**
5
5
  * Input to the inspect surface. A `string` is a **filesystem path** (Node) read
@@ -65,9 +65,9 @@ export type PptxGraphicKind = 'table' | 'chart' | 'chartEx' | 'diagram' | 'other
65
65
  * Vertical-autofit mode of a text frame, read from the `a:bodyPr` child element:
66
66
  * - `'none'`: no autofit (`a:noAutofit`, or no autofit child at all). The box has a
67
67
  * fixed height the text must fit inside — a genuine overflow candidate.
68
- * - `'normAutofit'`: shrink text to fit (`a:normAutofit`, ts-pptx `fit: 'shrink'`).
68
+ * - `'normAutofit'`: shrink text to fit (`a:normAutofit`, pptx-ts `fit: 'shrink'`).
69
69
  * Text is downscaled rather than overflowing.
70
- * - `'spAutoFit'`: resize shape to fit text (`a:spAutoFit`, ts-pptx `fit: 'resize'`).
70
+ * - `'spAutoFit'`: resize shape to fit text (`a:spAutoFit`, pptx-ts `fit: 'resize'`).
71
71
  * The authored height is an output, not a constraint, so the box cannot overflow.
72
72
  */
73
73
  export type PptxAutofitMode = 'none' | 'normAutofit' | 'spAutoFit';
package/dist/inspect.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, l as warn, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-C4oENPcu.js";
2
- import { D as emuToInches } from "./table-cell-margins-EVg0EwxT.js";
3
- import { r as BODY_INSET_DEFAULTS_PT } from "./body-insets-Dw_BeWD_.js";
1
+ import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, l as warn, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-Da2nXCJm.js";
2
+ import { D as emuToInches } from "./table-cell-margins-PDshga8T.js";
3
+ import { r as BODY_INSET_DEFAULTS_PT } from "./body-insets-kVHmjGc6.js";
4
4
  import { t as ABSENT_SLIDE_SIZE_EMU } from "./slide-size-BalTjFuv.js";
5
- import { p as OpcPackage, t as Presentation } from "./presentation-DGYlAWhl.js";
5
+ import { p as OpcPackage, t as Presentation } from "./presentation-Cyl74rq2.js";
6
6
  //#region src/inspect.ts
7
7
  /**
8
8
  * A cheap, flat snapshot of what a `.pptx` contains: every element on every
@@ -1 +1 @@
1
- {"version":3,"file":"inspect.js","names":[],"sources":["../src/inspect.ts"],"sourcesContent":["/**\n * A cheap, flat snapshot of what a `.pptx` contains: every element on every\n * slide, with its slide-absolute box and the handful of text/fill properties a\n * layout audit asks about.\n *\n * It is a **projection over `pptx-ts/read`**, not a second reader. `read` gives a\n * navigable, mutable model of a package and answers questions in the shape of the\n * OOXML tree; this answers one flat question — \"what is on the slides, and where\"\n * — in the shape a linter, an overlap check, or a diffing tool wants. The two used\n * to be independent implementations over two different XML parsers, which meant\n * every read-side fix had to be made twice and a divergence between them was\n * invisible to every test. Now the model below is the only reader, and this file\n * is the flattening.\n *\n * What it deliberately does NOT do, and why the projection is not just\n * `Presentation` re-exported:\n * - **Only geometry a shape carries itself.** A placeholder that inherits its box\n * from the layout is omitted rather than resolved (`absoluteFrame`, not\n * `resolvedFrame`) — the snapshot reports what the slide states.\n * - **A `p:graphicFrame` is a box, not its contents.** A table, chart or SmartArt\n * graphic is reported as one element with its box, its kind, and the text a\n * reader sees on the slide, but its structure is not flattened: no per-run\n * formatting, no cells, no series. Walk `pptx-ts/read` for what is inside one.\n *\n * @module\n */\nimport { warn } from './diagnostics.js'\nimport { OpcPackage } from './read/opc/package.js'\nimport { Presentation } from './read/api/presentation.js'\nimport type { AnyShape } from './read/api/shapes.js'\nimport type { GraphicFrame } from './read/api/shapes/graphic-frame.js'\nimport type { Run, TextFrame } from './read/api/text.js'\nimport { POINTS_PER_INCH, emuToInches } from './units.js'\nimport { BODY_INSET_DEFAULTS_PT } from './ooxml/body-insets.js'\nimport { ABSENT_SLIDE_SIZE_EMU } from './ooxml/slide-size.js'\n\n/**\n * Input to the inspect surface. A `string` is a **filesystem path** (Node) read\n * from disk; pass `Uint8Array`/`ArrayBuffer`/`Blob`/`number[]` for an in-memory\n * archive. (A string is a path, not JSZip's latin1 binary content — see\n * `ZipInput`.)\n */\nexport type PptxInspectInputValue = string | number[] | Uint8Array | ArrayBuffer | Blob\n\nexport type PptxInspectInput = PptxInspectInputValue | Promise<PptxInspectInputValue>\n\nexport interface PptxSlideSize {\n\twidthIn: number\n\theightIn: number\n}\n\nexport interface PptxBox {\n\tx: number\n\ty: number\n\tw: number\n\th: number\n}\n\nexport interface PptxTextRun {\n\ttext: string\n\tfontSizePt: number | null\n\tcolor: string | null\n\t/** Run font face (`a:rPr > a:latin@typeface`), or null when it inherits from the theme/placeholder. */\n\tfontFace: string | null\n\t/** Bold (`a:rPr@b`). */\n\tbold: boolean\n\t/** Italic (`a:rPr@i`). */\n\titalic: boolean\n\t/** Strikethrough token (`a:rPr@strike`: `noStrike`/`sngStrike`/`dblStrike`), or null when unset. */\n\tstrike: string | null\n\t/** Highlight colour hex (`a:rPr > a:highlight`), or null when unset. A theme token is resolved against the slide's theme. */\n\thighlight: string | null\n\t/** Character spacing in points (`a:rPr@spc`, authored in hundredths of a point), or null when unset. */\n\tcharSpacingPt: number | null\n}\n\n/**\n * One paragraph (`a:p`): its runs in document order. Preserves the paragraph/line\n * boundaries that the flat {@link PptxSlideElement.textRuns} list discards — needed\n * to measure a `wrap=\"none\"` frame line-by-line (each paragraph is one unwrapped line).\n */\nexport interface PptxParagraph {\n\truns: PptxTextRun[]\n}\n\n/**\n * What an element is. `'group'` is a `p:grpSp` container: it has its own identity,\n * box, and fill, but no text of its own — its content is the elements that name it\n * in {@link PptxSlideElement.parentZIndex}. `'graphicFrame'` is a `p:graphicFrame`\n * hosting a table, a chart or a SmartArt graphic; {@link PptxSlideElement.graphicKind}\n * says which, and it keeps that kind even when it carries text (a `'text'` element is\n * always a `p:sp`).\n */\nexport type PptxSlideElementKind = 'text' | 'image' | 'shape' | 'group' | 'graphicFrame'\n\n/**\n * What a `'graphicFrame'` element hosts, read from its `a:graphicData/@uri`:\n * a table (`a:tbl`), a classic chart (`c:chart`), a 2016-family chart\n * (`cx:chartSpace`: waterfall/funnel/treemap/…), or a SmartArt diagram. `'other'`\n * is a frame whose URI matches none of those — an OLE object, an ink part, a 3D\n * model — reported as a box so it is not silently missing from the slide.\n */\nexport type PptxGraphicKind = 'table' | 'chart' | 'chartEx' | 'diagram' | 'other'\n\n/**\n * Vertical-autofit mode of a text frame, read from the `a:bodyPr` child element:\n * - `'none'`: no autofit (`a:noAutofit`, or no autofit child at all). The box has a\n * fixed height the text must fit inside — a genuine overflow candidate.\n * - `'normAutofit'`: shrink text to fit (`a:normAutofit`, ts-pptx `fit: 'shrink'`).\n * Text is downscaled rather than overflowing.\n * - `'spAutoFit'`: resize shape to fit text (`a:spAutoFit`, ts-pptx `fit: 'resize'`).\n * The authored height is an output, not a constraint, so the box cannot overflow.\n */\nexport type PptxAutofitMode = 'none' | 'normAutofit' | 'spAutoFit'\n\n/**\n * Text-frame body insets in inches (`a:bodyPr` `lIns`/`tIns`/`rIns`/`bIns`), with\n * PowerPoint defaults applied when an attribute is absent (0.1in left/right,\n * 0.05in top/bottom). Subtract these from {@link PptxBox} to get the inner text box.\n */\nexport interface PptxBodyInsets {\n\tleft: number\n\ttop: number\n\tright: number\n\tbottom: number\n}\n\nexport interface PptxSlideElement {\n\t/** `p:cNvPr/@id`, or `zIndex + 1` when the attribute is missing. */\n\tid: number\n\tname: string\n\tkind: PptxSlideElementKind\n\t/**\n\t * What a `'graphicFrame'` element hosts, or `null` for every other kind. See\n\t * {@link PptxGraphicKind}.\n\t */\n\tgraphicKind: PptxGraphicKind | null\n\t/**\n\t * Paint order on the slide, `0`-based: the element's position in a depth-first\n\t * walk of `p:spTree` in document order. A group is immediately followed by its\n\t * own children, which is also the order PowerPoint paints them, so a higher\n\t * `zIndex` draws on top. Unique within a slide, which is what\n\t * {@link parentZIndex} / {@link childZIndices} key on.\n\t */\n\tzIndex: number\n\t/**\n\t * Position and size in **slide-absolute** inches, composing every enclosing\n\t * group transform — directly comparable across elements whether or not they are\n\t * grouped. For a rotated element this is the unrotated placement box (the box\n\t * PowerPoint writes after Ungroup); see {@link rotation}.\n\t */\n\tbox: PptxBox\n\t/**\n\t * Effective clockwise rotation in degrees, normalised to `[0, 360)`, after\n\t * composing the element's own `a:xfrm@rot` with every enclosing group rotation.\n\t */\n\trotation: number\n\t/** Effective horizontal flip, XOR-composing the element's own `@flipH` with enclosing group flips. */\n\tflipH: boolean\n\t/** Effective vertical flip, XOR-composing the element's own `@flipV` with enclosing group flips. */\n\tflipV: boolean\n\t/** {@link zIndex} of the enclosing `'group'` element, or `null` when the element sits at slide level. */\n\tparentZIndex: number | null\n\t/** {@link zIndex} of each direct child, in document order. Empty unless {@link kind} is `'group'`. */\n\tchildZIndices: number[]\n\t/**\n\t * The element's text, whitespace-collapsed to one line. For a `'graphicFrame'`\n\t * this is the text the structure puts on the slide (table cells in row order,\n\t * SmartArt node text), which is what {@link PptxSlideInspection.text} and\n\t * `wordCount` then count; a chart contributes nothing, matching `Slide.text` on\n\t * the read model. That text has no {@link textRuns} or {@link paragraphs} here —\n\t * per-run formatting inside a structure is what this surface does not flatten.\n\t */\n\ttext: string\n\ttextWrap: string | null\n\tautofit: PptxAutofitMode | null\n\t/**\n\t * Baked shrink scale from `<a:normAutofit@fontScale>` as a percent (62.5 = 62.5%),\n\t * or null when the frame has no `normAutofit` or bakes no scale (a bare\n\t * `<a:normAutofit/>`, which PowerPoint draws at 100% until edited).\n\t */\n\tautofitFontScale: number | null\n\tbodyInsets: PptxBodyInsets | null\n\ttextRuns: PptxTextRun[]\n\t/** Runs grouped by their source paragraph (`a:p`), in document order. */\n\tparagraphs: PptxParagraph[]\n\tfontSizes: number[]\n\tcolors: string[]\n\tfill: string | null\n\tline: string | null\n\tshapeType: string | null\n}\n\nexport interface PptxSlideInspection {\n\tindex: number\n\tname: string\n\tpath: string\n\tsize: PptxSlideSize\n\telements: PptxSlideElement[]\n\ttext: string\n\twordCount: number\n}\n\nexport interface PptxInspection {\n\tslideSize: PptxSlideSize\n\tslides: PptxSlideInspection[]\n}\n\nexport type PptxBoxAxis = 'x' | 'y'\nexport type PptxBoxAnchor = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom'\n\n/**\n * The size reported for a deck that declares no `p:sldSz`: the 10in × 7.5in PowerPoint opens such\n * a deck at, which is also what the script converter assumes. It was the widescreen size, so the\n * two readers disagreed about the same deck. See `ABSENT_SLIDE_SIZE_EMU`.\n */\nexport const DEFAULT_INSPECT_SLIDE_SIZE: PptxSlideSize = Object.freeze({\n\twidthIn: round(emuToInches(ABSENT_SLIDE_SIZE_EMU.widthEmu), 3),\n\theightIn: round(emuToInches(ABSENT_SLIDE_SIZE_EMU.heightEmu), 3),\n})\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Package layer\n *\n * Thin conveniences over `OpcPackage`, kept because this surface speaks zip\n * paths (`ppt/slides/slide1.xml`) while OPC speaks partnames (`/ppt/...`), and\n * because reaching a part's bytes is the one thing a caller of a *flat* surface\n * still routinely needs.\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/**\n * Load a `.pptx` as an {@link OpcPackage} — the same package model `pptx-ts/read`\n * uses, so a caller that starts here can hand the result straight to\n * `Presentation.fromPackage()` without re-reading the bytes.\n *\n * The input must be a real OPC package: a zip that merely contains some slide XML\n * but no `[Content_Types].xml` is rejected with a `PackageReadError`.\n */\nexport async function loadPptxPackage(input: PptxInspectInput): Promise<OpcPackage> {\n\treturn OpcPackage.load(await input)\n}\n\n/** Every part in the package, as zip paths (`ppt/slides/slide1.xml`), sorted. */\nexport function listPptxParts(pptxPackage: OpcPackage): string[] {\n\treturn [...pptxPackage.parts.keys()].map(zipPathOf).sort()\n}\n\n/** Read a package part as UTF-8 text, or `null` when the part is absent. */\nexport async function readPptxTextPart(pptxPackage: OpcPackage, path: string): Promise<string | null> {\n\tconst bytes = await readPptxBinaryPart(pptxPackage, path)\n\treturn bytes ? textDecoder.decode(bytes) : null\n}\n\n/**\n * Read a package part as raw bytes — the binary sibling of {@link readPptxTextPart}\n * for embedded media (SVG/PNG/EMF blobs, fonts, …) that must not be UTF-8 decoded.\n * Returns `null` when the part is absent. The `Uint8Array` is browser-isomorphic;\n * Node consumers can wrap it with `Buffer.from(...)` if they need Buffer methods.\n *\n * The part's current body, so a package also opened as a `Presentation` and edited\n * reads back with its edits.\n */\nexport async function readPptxBinaryPart(pptxPackage: OpcPackage, path: string): Promise<Uint8Array | null> {\n\treturn pptxPackage.part(partNameOf(path))?.serialize() ?? null\n}\n\nconst textDecoder = new TextDecoder('utf-8')\n\n/** OPC partnames are absolute (`/ppt/…`); this surface speaks zip paths (`ppt/…`). */\nfunction zipPathOf(partName: string): string {\n\treturn partName.startsWith('/') ? partName.slice(1) : partName\n}\n\nfunction partNameOf(zipPath: string): string {\n\treturn zipPath.startsWith('/') ? zipPath : `/${zipPath}`\n}\n\n/* ────────────────────────────────────────────────────────────────────────────\n * The surface\n * ──────────────────────────────────────────────────────────────────────────── */\n\nexport async function inspectPptx(input: PptxInspectInput): Promise<PptxInspection> {\n\tconst pptxPackage = await loadPptxPackage(input)\n\tconst slideSize = await readPresentationSize(pptxPackage)\n\tconst slides = await extractSlides(pptxPackage, slideSize)\n\treturn { slideSize, slides }\n}\n\nexport async function readPresentationSize(\n\tpptxPackage: OpcPackage,\n\tfallback: PptxSlideSize = DEFAULT_INSPECT_SLIDE_SIZE\n): Promise<PptxSlideSize> {\n\tconst size = presentationOf(pptxPackage)?.slideSize\n\tif (!size) return fallback\n\treturn { widthIn: round(size.widthIn, 3), heightIn: round(size.heightIn, 3) }\n}\n\n/**\n * Every slide in the deck, in **presentation order** (`p:sldIdLst`) — the order\n * PowerPoint shows them in, which is not the order their parts are named once a\n * deck has been reordered.\n */\nexport async function extractSlides(pptxPackage: OpcPackage, size?: PptxSlideSize): Promise<PptxSlideInspection[]> {\n\tconst slideSize = size || (await readPresentationSize(pptxPackage))\n\tconst presentation = presentationOf(pptxPackage)\n\tif (!presentation) return []\n\n\treturn presentation.slides.map((slide, index) => {\n\t\tconst path = zipPathOf(slide.partName)\n\t\tconst harvested: HarvestedShape[] = []\n\t\tharvest(slide.shapes, null, harvested) // slide level: no enclosing group\n\t\tconst elements = flatten(harvested, path)\n\t\tconst text = elements\n\t\t\t.map((el) => el.text)\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ')\n\n\t\treturn {\n\t\t\tindex,\n\t\t\tname: slide.name || `Slide ${index + 1}`,\n\t\t\tpath,\n\t\t\tsize: slideSize,\n\t\t\telements,\n\t\t\ttext,\n\t\t\twordCount: countWords(text),\n\t\t}\n\t})\n}\n\n/**\n * The deck's `Presentation`, or `null` when the package holds no readable\n * `presentation.xml`. Callers here are auditing files they did not author, so a\n * package that is a valid OPC container but not a presentation reports an empty\n * deck rather than throwing. `presentationPart` is the throw site: it rejects a\n * package with no — or more than one — office-document relationship.\n */\nfunction presentationOf(pptxPackage: OpcPackage): Presentation | null {\n\tconst presentation = Presentation.fromPackage(pptxPackage)\n\ttry {\n\t\treturn presentation.presentationPart.isXmlPart ? presentation : null\n\t} catch {\n\t\treturn null\n\t}\n}\n\nexport function overlapArea(a: PptxBox, b: PptxBox): number {\n\tconst x = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x))\n\tconst y = Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y))\n\treturn x * y\n}\n\nexport function boxAnchor(box: PptxBox, anchor: PptxBoxAnchor, axis: PptxBoxAxis): number {\n\tif (axis === 'x') {\n\t\tif (anchor === 'left') return box.x\n\t\tif (anchor === 'right') return box.x + box.w\n\t\treturn box.x + box.w / 2\n\t}\n\tif (anchor === 'top') return box.y\n\tif (anchor === 'bottom') return box.y + box.h\n\treturn box.y + box.h / 2\n}\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Shape-tree harvest\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/** One harvested shape, before it is flattened into a {@link PptxSlideElement}. */\ninterface HarvestedShape {\n\tshape: AnyShape\n\tparentZIndex: number | null\n\tchildZIndices: number[]\n}\n\n/**\n * Flatten a shape list depth-first in document order: each shape is followed by\n * its descendants, which is both paint order and the order the\n * {@link PptxSlideElement.zIndex} contract promises. Every entry's index in `out`\n * is its zIndex. Returns the zIndices assigned at this level, which is what the\n * enclosing group records as its {@link PptxSlideElement.childZIndices}.\n */\nfunction harvest(shapes: AnyShape[], parentZIndex: number | null, out: HarvestedShape[]): number[] {\n\tconst zIndices: number[] = []\n\tfor (const shape of shapes) {\n\t\tconst entry: HarvestedShape = { shape, parentZIndex, childZIndices: [] }\n\t\tconst zIndex = out.push(entry) - 1\n\t\tzIndices.push(zIndex)\n\t\tif (shape.shapeType === 'group') entry.childZIndices = harvest(shape.shapes, zIndex, out)\n\t}\n\treturn zIndices\n}\n\n/**\n * Turn harvested shapes into elements, dropping the ones with no resolvable slide\n * position. A dropped shape keeps its zIndex — the numbers are positions in the\n * shape tree, and renumbering them would silently repoint every `parentZIndex`.\n */\nfunction flatten(harvested: HarvestedShape[], slidePath: string): PptxSlideElement[] {\n\treturn harvested\n\t\t.map((entry, zIndex) => toElement(entry, zIndex, slidePath))\n\t\t.filter((element): element is PptxSlideElement => Boolean(element))\n}\n\nfunction toElement(entry: HarvestedShape, zIndex: number, slidePath: string): PptxSlideElement | null {\n\tconst { shape } = entry\n\tconst frame = shape.absoluteFrame\n\tif (!frame) {\n\t\treportUnresolvable(shape, zIndex, slidePath)\n\t\treturn null\n\t}\n\n\t// Only `p:sp` holds a text body, so every other kind projects as an empty frame.\n\tconst textFrame = shape.textFrame\n\tconst paragraphs = textFrame ? textFrame.paragraphs.map((p) => ({ runs: p.runs.map(toRun) })) : []\n\tconst textRuns = paragraphs.flatMap((paragraph) => paragraph.runs)\n\t// A graphic frame has no text body of its own; its text comes from the structure\n\t// it hosts, and arrives as a plain string with no runs behind it.\n\t// Paragraphs are joined by a line break, so the last word of one and the first of the next stay\n\t// two words once the whitespace collapses below.\n\tconst runText = paragraphs.map((paragraph) => paragraph.runs.map((run) => run.text).join('')).join('\\n')\n\tconst raw = shape.shapeType === 'graphicFrame' ? graphicFrameText(shape) : runText\n\t// Deliberately not `TextFrame.text`: this is one whitespace-collapsed line for\n\t// matching and word-counting, not the frame's text with its line structure.\n\tconst text = raw.replace(/\\s+/g, ' ').trim()\n\tconst kind: PptxSlideElementKind =\n\t\tshape.shapeType === 'group'\n\t\t\t? 'group'\n\t\t\t: shape.shapeType === 'graphicFrame'\n\t\t\t\t? 'graphicFrame'\n\t\t\t\t: text\n\t\t\t\t\t? 'text'\n\t\t\t\t\t: shape.shapeType === 'picture'\n\t\t\t\t\t\t? 'image'\n\t\t\t\t\t\t: 'shape'\n\n\treturn {\n\t\tid: shape.id ?? zIndex + 1,\n\t\tname: shape.name || `${kind} ${zIndex + 1}`,\n\t\tkind,\n\t\tgraphicKind: shape.shapeType === 'graphicFrame' ? graphicKindOf(shape) : null,\n\t\tzIndex,\n\t\tbox: {\n\t\t\tx: emuToInches(frame.left),\n\t\t\ty: emuToInches(frame.top),\n\t\t\tw: emuToInches(frame.width),\n\t\t\th: emuToInches(frame.height),\n\t\t},\n\t\trotation: frame.rotation,\n\t\tflipH: frame.flipH,\n\t\tflipV: frame.flipV,\n\t\tparentZIndex: entry.parentZIndex,\n\t\tchildZIndices: entry.childZIndices,\n\t\ttext,\n\t\ttextWrap: textFrame?.bodyProperties?.wrap ?? null,\n\t\tautofit: textFrame?.autofit ?? null,\n\t\tautofitFontScale: textFrame?.autofitFontScale ?? null,\n\t\tbodyInsets: readBodyInsets(textFrame),\n\t\ttextRuns,\n\t\tparagraphs,\n\t\tfontSizes: [...new Set(textRuns.map((run) => run.fontSizePt).filter((size): size is number => size !== null))],\n\t\tcolors: [...new Set(textRuns.map((run) => run.color).filter((color): color is string => Boolean(color)))],\n\t\tfill: shape.fillColor,\n\t\tline: shape.lineColor,\n\t\tshapeType: shape.presetGeometry,\n\t}\n}\n\n/**\n * What a graphic frame hosts, from the same `a:graphicData/@uri` the read model's\n * `has*` predicates compare against. A frame that answers none of them is `'other'`\n * rather than dropped: a box the deck's author placed is on the slide whether or not\n * this library models its payload, and an overlap or coverage check that skipped it\n * would report a gap where a 3D model or an OLE object sits.\n */\nfunction graphicKindOf(frame: GraphicFrame): PptxGraphicKind {\n\tif (frame.hasTable) return 'table'\n\tif (frame.hasChart) return 'chart'\n\tif (frame.hasChartEx) return 'chartEx'\n\tif (frame.hasDiagram) return 'diagram'\n\treturn 'other'\n}\n\n/**\n * The text a graphic frame puts on the slide: table cells in row order, or SmartArt\n * node text. Charts contribute nothing, matching `Slide.text` on the read model — a\n * chart's strings are data labels and axis titles that PowerPoint itself does not\n * treat as slide body text.\n *\n * Separators are single spaces rather than the read model's `\t`/`\n`, because the\n * caller collapses whitespace anyway; the point here is only that cells do not run\n * together into one word.\n */\nfunction graphicFrameText(frame: GraphicFrame): string {\n\tconst table = frame.table\n\tif (table) return table.rows.map((row) => row.cells.map((cell) => cell.text).join(' ')).join(' ')\n\treturn frame.diagram?.text ?? ''\n}\n\n/** Project one read-model {@link Run} onto the flat run shape. */\nfunction toRun(run: Run): PptxTextRun {\n\treturn {\n\t\ttext: run.text,\n\t\tfontSizePt: run.fontSizePt,\n\t\tcolor: run.color,\n\t\tfontFace: run.fontName,\n\t\t// The read model distinguishes \"explicitly not bold\" from \"unset, inherits\";\n\t\t// this surface reports what renders, so an unset flag is `false`.\n\t\tbold: run.bold ?? false,\n\t\titalic: run.italic ?? false,\n\t\tstrike: run.strike,\n\t\thighlight: run.highlight?.hex ?? null,\n\t\tcharSpacingPt: run.charSpacingPt,\n\t}\n}\n\nfunction readBodyInsets(textFrame: TextFrame | null): PptxBodyInsets | null {\n\tconst insets = textFrame?.bodyProperties?.insetsPt\n\tif (!insets) return null\n\t// The read model reports only the explicitly-set sides; an omitted one takes PowerPoint's\n\t// own default rather than zero.\n\tconst inches = (pt: number | undefined, fallbackPt: number): number =>\n\t\t(pt === undefined ? fallbackPt : pt) / POINTS_PER_INCH\n\treturn {\n\t\tleft: inches(insets.left, BODY_INSET_DEFAULTS_PT.left),\n\t\ttop: inches(insets.top, BODY_INSET_DEFAULTS_PT.top),\n\t\tright: inches(insets.right, BODY_INSET_DEFAULTS_PT.right),\n\t\tbottom: inches(insets.bottom, BODY_INSET_DEFAULTS_PT.bottom),\n\t}\n}\n\n/**\n * Warn about a shape whose slide position cannot be resolved, unless it never\n * claimed one.\n *\n * `absoluteFrame` is `null` for three different situations and only two of them\n * are worth telling the caller about; `absoluteFrameFailure` is the read model\n * naming which, so this surface does not walk the ancestry a second time to\n * re-derive it.\n */\nfunction reportUnresolvable(shape: AnyShape, zIndex: number, slidePath: string): void {\n\tconst failure = shape.absoluteFrameFailure\n\t// No own `a:xfrm` at all: the shape inherits its geometry from a layout\n\t// placeholder, which this surface deliberately does not resolve. Nothing is\n\t// wrong with the deck, so nothing is reported. (`null` cannot reach here — the\n\t// caller only calls this for a shape whose frame did not resolve.)\n\tif (failure === null || failure === 'no-own-transform') return\n\n\tconst who = shape.name ? `\"${shape.name}\"` : `the element at zIndex ${zIndex}`\n\tif (failure === 'group-transform-missing') {\n\t\twarn(\n\t\t\t'inspect/group-transform-missing',\n\t\t\t`inspect: skipped ${who} on ${slidePath} — an enclosing group has no usable a:xfrm, so its slide position cannot be resolved.`\n\t\t)\n\t\treturn\n\t}\n\twarn(\n\t\t'inspect/group-transform-degenerate',\n\t\t`inspect: skipped ${who} on ${slidePath} — an enclosing group has a degenerate transform (zero a:chExt), so its slide position cannot be resolved.`\n\t)\n}\n\nfunction countWords(text: string): number {\n\treturn text.split(/\\s+/).filter(Boolean).length\n}\n\nfunction round(value: number, digits: number): number {\n\tconst factor = 10 ** digits\n\treturn Math.round(value * factor) / factor\n}\n\n// Error taxonomy — see `entry-errors.ts`. Re-exported from every entry so `instanceof`\n// works whichever subpath a consumer imports.\nexport * from './entry-errors.js'\n\n// Diagnostics — see `entry-diagnostics.ts`. Re-exported from every entry so a consumer of any\n// subpath can install a handler for the warnings that subpath emits.\nexport * from './entry-diagnostics.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwNA,MAAa,6BAA4C,OAAO,OAAO;CACtE,SAAS,MAAM,YAAY,sBAAsB,QAAQ,GAAG,CAAC;CAC7D,UAAU,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,OAAO,IAAI;EACX,UAAU,IAAI;EAGd,MAAM,IAAI,QAAQ;EAClB,QAAQ,IAAI,UAAU;EACtB,QAAQ,IAAI;EACZ,WAAW,IAAI,WAAW,OAAO;EACjC,eAAe,IAAI;CACpB;AACD;AAEA,SAAS,eAAe,WAAoD;CAC3E,MAAM,SAAS,WAAW,gBAAgB;CAC1C,IAAI,CAAC,QAAQ,OAAO;CAGpB,MAAM,UAAU,IAAwB,gBACtC,OAAO,KAAA,IAAY,aAAa,MAAA;CAClC,OAAO;EACN,MAAM,OAAO,OAAO,MAAM,uBAAuB,IAAI;EACrD,KAAK,OAAO,OAAO,KAAK,uBAAuB,GAAG;EAClD,OAAO,OAAO,OAAO,OAAO,uBAAuB,KAAK;EACxD,QAAQ,OAAO,OAAO,QAAQ,uBAAuB,MAAM;CAC5D;AACD;;;;;;;;;;AAWA,SAAS,mBAAmB,OAAiB,QAAgB,WAAyB;CACrF,MAAM,UAAU,MAAM;CAKtB,IAAI,YAAY,QAAQ,YAAY,oBAAoB;CAExD,MAAM,MAAM,MAAM,OAAO,IAAI,MAAM,KAAK,KAAK,yBAAyB;CACtE,IAAI,YAAY,2BAA2B;EAC1C,KACC,mCACA,oBAAoB,IAAI,MAAM,UAAU,sFACzC;EACA;CACD;CACA,KACC,sCACA,oBAAoB,IAAI,MAAM,UAAU,2GACzC;AACD;AAEA,SAAS,WAAW,MAAsB;CACzC,OAAO,KAAK,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C;AAEA,SAAS,MAAM,OAAe,QAAwB;CACrD,MAAM,SAAS,MAAM;CACrB,OAAO,KAAK,MAAM,QAAQ,MAAM,IAAI;AACrC"}
1
+ {"version":3,"file":"inspect.js","names":[],"sources":["../src/inspect.ts"],"sourcesContent":["/**\n * A cheap, flat snapshot of what a `.pptx` contains: every element on every\n * slide, with its slide-absolute box and the handful of text/fill properties a\n * layout audit asks about.\n *\n * It is a **projection over `pptx-ts/read`**, not a second reader. `read` gives a\n * navigable, mutable model of a package and answers questions in the shape of the\n * OOXML tree; this answers one flat question — \"what is on the slides, and where\"\n * — in the shape a linter, an overlap check, or a diffing tool wants. The two used\n * to be independent implementations over two different XML parsers, which meant\n * every read-side fix had to be made twice and a divergence between them was\n * invisible to every test. Now the model below is the only reader, and this file\n * is the flattening.\n *\n * What it deliberately does NOT do, and why the projection is not just\n * `Presentation` re-exported:\n * - **Only geometry a shape carries itself.** A placeholder that inherits its box\n * from the layout is omitted rather than resolved (`absoluteFrame`, not\n * `resolvedFrame`) — the snapshot reports what the slide states.\n * - **A `p:graphicFrame` is a box, not its contents.** A table, chart or SmartArt\n * graphic is reported as one element with its box, its kind, and the text a\n * reader sees on the slide, but its structure is not flattened: no per-run\n * formatting, no cells, no series. Walk `pptx-ts/read` for what is inside one.\n *\n * @module\n */\nimport { warn } from './diagnostics.js'\nimport { OpcPackage } from './read/opc/package.js'\nimport { Presentation } from './read/api/presentation.js'\nimport type { AnyShape } from './read/api/shapes.js'\nimport type { GraphicFrame } from './read/api/shapes/graphic-frame.js'\nimport type { Run, TextFrame } from './read/api/text.js'\nimport { POINTS_PER_INCH, emuToInches } from './units.js'\nimport { BODY_INSET_DEFAULTS_PT } from './ooxml/body-insets.js'\nimport { ABSENT_SLIDE_SIZE_EMU } from './ooxml/slide-size.js'\n\n/**\n * Input to the inspect surface. A `string` is a **filesystem path** (Node) read\n * from disk; pass `Uint8Array`/`ArrayBuffer`/`Blob`/`number[]` for an in-memory\n * archive. (A string is a path, not JSZip's latin1 binary content — see\n * `ZipInput`.)\n */\nexport type PptxInspectInputValue = string | number[] | Uint8Array | ArrayBuffer | Blob\n\nexport type PptxInspectInput = PptxInspectInputValue | Promise<PptxInspectInputValue>\n\nexport interface PptxSlideSize {\n\twidthIn: number\n\theightIn: number\n}\n\nexport interface PptxBox {\n\tx: number\n\ty: number\n\tw: number\n\th: number\n}\n\nexport interface PptxTextRun {\n\ttext: string\n\tfontSizePt: number | null\n\tcolor: string | null\n\t/** Run font face (`a:rPr > a:latin@typeface`), or null when it inherits from the theme/placeholder. */\n\tfontFace: string | null\n\t/** Bold (`a:rPr@b`). */\n\tbold: boolean\n\t/** Italic (`a:rPr@i`). */\n\titalic: boolean\n\t/** Strikethrough token (`a:rPr@strike`: `noStrike`/`sngStrike`/`dblStrike`), or null when unset. */\n\tstrike: string | null\n\t/** Highlight colour hex (`a:rPr > a:highlight`), or null when unset. A theme token is resolved against the slide's theme. */\n\thighlight: string | null\n\t/** Character spacing in points (`a:rPr@spc`, authored in hundredths of a point), or null when unset. */\n\tcharSpacingPt: number | null\n}\n\n/**\n * One paragraph (`a:p`): its runs in document order. Preserves the paragraph/line\n * boundaries that the flat {@link PptxSlideElement.textRuns} list discards — needed\n * to measure a `wrap=\"none\"` frame line-by-line (each paragraph is one unwrapped line).\n */\nexport interface PptxParagraph {\n\truns: PptxTextRun[]\n}\n\n/**\n * What an element is. `'group'` is a `p:grpSp` container: it has its own identity,\n * box, and fill, but no text of its own — its content is the elements that name it\n * in {@link PptxSlideElement.parentZIndex}. `'graphicFrame'` is a `p:graphicFrame`\n * hosting a table, a chart or a SmartArt graphic; {@link PptxSlideElement.graphicKind}\n * says which, and it keeps that kind even when it carries text (a `'text'` element is\n * always a `p:sp`).\n */\nexport type PptxSlideElementKind = 'text' | 'image' | 'shape' | 'group' | 'graphicFrame'\n\n/**\n * What a `'graphicFrame'` element hosts, read from its `a:graphicData/@uri`:\n * a table (`a:tbl`), a classic chart (`c:chart`), a 2016-family chart\n * (`cx:chartSpace`: waterfall/funnel/treemap/…), or a SmartArt diagram. `'other'`\n * is a frame whose URI matches none of those — an OLE object, an ink part, a 3D\n * model — reported as a box so it is not silently missing from the slide.\n */\nexport type PptxGraphicKind = 'table' | 'chart' | 'chartEx' | 'diagram' | 'other'\n\n/**\n * Vertical-autofit mode of a text frame, read from the `a:bodyPr` child element:\n * - `'none'`: no autofit (`a:noAutofit`, or no autofit child at all). The box has a\n * fixed height the text must fit inside — a genuine overflow candidate.\n * - `'normAutofit'`: shrink text to fit (`a:normAutofit`, pptx-ts `fit: 'shrink'`).\n * Text is downscaled rather than overflowing.\n * - `'spAutoFit'`: resize shape to fit text (`a:spAutoFit`, pptx-ts `fit: 'resize'`).\n * The authored height is an output, not a constraint, so the box cannot overflow.\n */\nexport type PptxAutofitMode = 'none' | 'normAutofit' | 'spAutoFit'\n\n/**\n * Text-frame body insets in inches (`a:bodyPr` `lIns`/`tIns`/`rIns`/`bIns`), with\n * PowerPoint defaults applied when an attribute is absent (0.1in left/right,\n * 0.05in top/bottom). Subtract these from {@link PptxBox} to get the inner text box.\n */\nexport interface PptxBodyInsets {\n\tleft: number\n\ttop: number\n\tright: number\n\tbottom: number\n}\n\nexport interface PptxSlideElement {\n\t/** `p:cNvPr/@id`, or `zIndex + 1` when the attribute is missing. */\n\tid: number\n\tname: string\n\tkind: PptxSlideElementKind\n\t/**\n\t * What a `'graphicFrame'` element hosts, or `null` for every other kind. See\n\t * {@link PptxGraphicKind}.\n\t */\n\tgraphicKind: PptxGraphicKind | null\n\t/**\n\t * Paint order on the slide, `0`-based: the element's position in a depth-first\n\t * walk of `p:spTree` in document order. A group is immediately followed by its\n\t * own children, which is also the order PowerPoint paints them, so a higher\n\t * `zIndex` draws on top. Unique within a slide, which is what\n\t * {@link parentZIndex} / {@link childZIndices} key on.\n\t */\n\tzIndex: number\n\t/**\n\t * Position and size in **slide-absolute** inches, composing every enclosing\n\t * group transform — directly comparable across elements whether or not they are\n\t * grouped. For a rotated element this is the unrotated placement box (the box\n\t * PowerPoint writes after Ungroup); see {@link rotation}.\n\t */\n\tbox: PptxBox\n\t/**\n\t * Effective clockwise rotation in degrees, normalised to `[0, 360)`, after\n\t * composing the element's own `a:xfrm@rot` with every enclosing group rotation.\n\t */\n\trotation: number\n\t/** Effective horizontal flip, XOR-composing the element's own `@flipH` with enclosing group flips. */\n\tflipH: boolean\n\t/** Effective vertical flip, XOR-composing the element's own `@flipV` with enclosing group flips. */\n\tflipV: boolean\n\t/** {@link zIndex} of the enclosing `'group'` element, or `null` when the element sits at slide level. */\n\tparentZIndex: number | null\n\t/** {@link zIndex} of each direct child, in document order. Empty unless {@link kind} is `'group'`. */\n\tchildZIndices: number[]\n\t/**\n\t * The element's text, whitespace-collapsed to one line. For a `'graphicFrame'`\n\t * this is the text the structure puts on the slide (table cells in row order,\n\t * SmartArt node text), which is what {@link PptxSlideInspection.text} and\n\t * `wordCount` then count; a chart contributes nothing, matching `Slide.text` on\n\t * the read model. That text has no {@link textRuns} or {@link paragraphs} here —\n\t * per-run formatting inside a structure is what this surface does not flatten.\n\t */\n\ttext: string\n\ttextWrap: string | null\n\tautofit: PptxAutofitMode | null\n\t/**\n\t * Baked shrink scale from `<a:normAutofit@fontScale>` as a percent (62.5 = 62.5%),\n\t * or null when the frame has no `normAutofit` or bakes no scale (a bare\n\t * `<a:normAutofit/>`, which PowerPoint draws at 100% until edited).\n\t */\n\tautofitFontScale: number | null\n\tbodyInsets: PptxBodyInsets | null\n\ttextRuns: PptxTextRun[]\n\t/** Runs grouped by their source paragraph (`a:p`), in document order. */\n\tparagraphs: PptxParagraph[]\n\tfontSizes: number[]\n\tcolors: string[]\n\tfill: string | null\n\tline: string | null\n\tshapeType: string | null\n}\n\nexport interface PptxSlideInspection {\n\tindex: number\n\tname: string\n\tpath: string\n\tsize: PptxSlideSize\n\telements: PptxSlideElement[]\n\ttext: string\n\twordCount: number\n}\n\nexport interface PptxInspection {\n\tslideSize: PptxSlideSize\n\tslides: PptxSlideInspection[]\n}\n\nexport type PptxBoxAxis = 'x' | 'y'\nexport type PptxBoxAnchor = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom'\n\n/**\n * The size reported for a deck that declares no `p:sldSz`: the 10in × 7.5in PowerPoint opens such\n * a deck at, which is also what the script converter assumes. It was the widescreen size, so the\n * two readers disagreed about the same deck. See `ABSENT_SLIDE_SIZE_EMU`.\n */\nexport const DEFAULT_INSPECT_SLIDE_SIZE: PptxSlideSize = Object.freeze({\n\twidthIn: round(emuToInches(ABSENT_SLIDE_SIZE_EMU.widthEmu), 3),\n\theightIn: round(emuToInches(ABSENT_SLIDE_SIZE_EMU.heightEmu), 3),\n})\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Package layer\n *\n * Thin conveniences over `OpcPackage`, kept because this surface speaks zip\n * paths (`ppt/slides/slide1.xml`) while OPC speaks partnames (`/ppt/...`), and\n * because reaching a part's bytes is the one thing a caller of a *flat* surface\n * still routinely needs.\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/**\n * Load a `.pptx` as an {@link OpcPackage} — the same package model `pptx-ts/read`\n * uses, so a caller that starts here can hand the result straight to\n * `Presentation.fromPackage()` without re-reading the bytes.\n *\n * The input must be a real OPC package: a zip that merely contains some slide XML\n * but no `[Content_Types].xml` is rejected with a `PackageReadError`.\n */\nexport async function loadPptxPackage(input: PptxInspectInput): Promise<OpcPackage> {\n\treturn OpcPackage.load(await input)\n}\n\n/** Every part in the package, as zip paths (`ppt/slides/slide1.xml`), sorted. */\nexport function listPptxParts(pptxPackage: OpcPackage): string[] {\n\treturn [...pptxPackage.parts.keys()].map(zipPathOf).sort()\n}\n\n/** Read a package part as UTF-8 text, or `null` when the part is absent. */\nexport async function readPptxTextPart(pptxPackage: OpcPackage, path: string): Promise<string | null> {\n\tconst bytes = await readPptxBinaryPart(pptxPackage, path)\n\treturn bytes ? textDecoder.decode(bytes) : null\n}\n\n/**\n * Read a package part as raw bytes — the binary sibling of {@link readPptxTextPart}\n * for embedded media (SVG/PNG/EMF blobs, fonts, …) that must not be UTF-8 decoded.\n * Returns `null` when the part is absent. The `Uint8Array` is browser-isomorphic;\n * Node consumers can wrap it with `Buffer.from(...)` if they need Buffer methods.\n *\n * The part's current body, so a package also opened as a `Presentation` and edited\n * reads back with its edits.\n */\nexport async function readPptxBinaryPart(pptxPackage: OpcPackage, path: string): Promise<Uint8Array | null> {\n\treturn pptxPackage.part(partNameOf(path))?.serialize() ?? null\n}\n\nconst textDecoder = new TextDecoder('utf-8')\n\n/** OPC partnames are absolute (`/ppt/…`); this surface speaks zip paths (`ppt/…`). */\nfunction zipPathOf(partName: string): string {\n\treturn partName.startsWith('/') ? partName.slice(1) : partName\n}\n\nfunction partNameOf(zipPath: string): string {\n\treturn zipPath.startsWith('/') ? zipPath : `/${zipPath}`\n}\n\n/* ────────────────────────────────────────────────────────────────────────────\n * The surface\n * ──────────────────────────────────────────────────────────────────────────── */\n\nexport async function inspectPptx(input: PptxInspectInput): Promise<PptxInspection> {\n\tconst pptxPackage = await loadPptxPackage(input)\n\tconst slideSize = await readPresentationSize(pptxPackage)\n\tconst slides = await extractSlides(pptxPackage, slideSize)\n\treturn { slideSize, slides }\n}\n\nexport async function readPresentationSize(\n\tpptxPackage: OpcPackage,\n\tfallback: PptxSlideSize = DEFAULT_INSPECT_SLIDE_SIZE\n): Promise<PptxSlideSize> {\n\tconst size = presentationOf(pptxPackage)?.slideSize\n\tif (!size) return fallback\n\treturn { widthIn: round(size.widthIn, 3), heightIn: round(size.heightIn, 3) }\n}\n\n/**\n * Every slide in the deck, in **presentation order** (`p:sldIdLst`) — the order\n * PowerPoint shows them in, which is not the order their parts are named once a\n * deck has been reordered.\n */\nexport async function extractSlides(pptxPackage: OpcPackage, size?: PptxSlideSize): Promise<PptxSlideInspection[]> {\n\tconst slideSize = size || (await readPresentationSize(pptxPackage))\n\tconst presentation = presentationOf(pptxPackage)\n\tif (!presentation) return []\n\n\treturn presentation.slides.map((slide, index) => {\n\t\tconst path = zipPathOf(slide.partName)\n\t\tconst harvested: HarvestedShape[] = []\n\t\tharvest(slide.shapes, null, harvested) // slide level: no enclosing group\n\t\tconst elements = flatten(harvested, path)\n\t\tconst text = elements\n\t\t\t.map((el) => el.text)\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ')\n\n\t\treturn {\n\t\t\tindex,\n\t\t\tname: slide.name || `Slide ${index + 1}`,\n\t\t\tpath,\n\t\t\tsize: slideSize,\n\t\t\telements,\n\t\t\ttext,\n\t\t\twordCount: countWords(text),\n\t\t}\n\t})\n}\n\n/**\n * The deck's `Presentation`, or `null` when the package holds no readable\n * `presentation.xml`. Callers here are auditing files they did not author, so a\n * package that is a valid OPC container but not a presentation reports an empty\n * deck rather than throwing. `presentationPart` is the throw site: it rejects a\n * package with no — or more than one — office-document relationship.\n */\nfunction presentationOf(pptxPackage: OpcPackage): Presentation | null {\n\tconst presentation = Presentation.fromPackage(pptxPackage)\n\ttry {\n\t\treturn presentation.presentationPart.isXmlPart ? presentation : null\n\t} catch {\n\t\treturn null\n\t}\n}\n\nexport function overlapArea(a: PptxBox, b: PptxBox): number {\n\tconst x = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x))\n\tconst y = Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y))\n\treturn x * y\n}\n\nexport function boxAnchor(box: PptxBox, anchor: PptxBoxAnchor, axis: PptxBoxAxis): number {\n\tif (axis === 'x') {\n\t\tif (anchor === 'left') return box.x\n\t\tif (anchor === 'right') return box.x + box.w\n\t\treturn box.x + box.w / 2\n\t}\n\tif (anchor === 'top') return box.y\n\tif (anchor === 'bottom') return box.y + box.h\n\treturn box.y + box.h / 2\n}\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Shape-tree harvest\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/** One harvested shape, before it is flattened into a {@link PptxSlideElement}. */\ninterface HarvestedShape {\n\tshape: AnyShape\n\tparentZIndex: number | null\n\tchildZIndices: number[]\n}\n\n/**\n * Flatten a shape list depth-first in document order: each shape is followed by\n * its descendants, which is both paint order and the order the\n * {@link PptxSlideElement.zIndex} contract promises. Every entry's index in `out`\n * is its zIndex. Returns the zIndices assigned at this level, which is what the\n * enclosing group records as its {@link PptxSlideElement.childZIndices}.\n */\nfunction harvest(shapes: AnyShape[], parentZIndex: number | null, out: HarvestedShape[]): number[] {\n\tconst zIndices: number[] = []\n\tfor (const shape of shapes) {\n\t\tconst entry: HarvestedShape = { shape, parentZIndex, childZIndices: [] }\n\t\tconst zIndex = out.push(entry) - 1\n\t\tzIndices.push(zIndex)\n\t\tif (shape.shapeType === 'group') entry.childZIndices = harvest(shape.shapes, zIndex, out)\n\t}\n\treturn zIndices\n}\n\n/**\n * Turn harvested shapes into elements, dropping the ones with no resolvable slide\n * position. A dropped shape keeps its zIndex — the numbers are positions in the\n * shape tree, and renumbering them would silently repoint every `parentZIndex`.\n */\nfunction flatten(harvested: HarvestedShape[], slidePath: string): PptxSlideElement[] {\n\treturn harvested\n\t\t.map((entry, zIndex) => toElement(entry, zIndex, slidePath))\n\t\t.filter((element): element is PptxSlideElement => Boolean(element))\n}\n\nfunction toElement(entry: HarvestedShape, zIndex: number, slidePath: string): PptxSlideElement | null {\n\tconst { shape } = entry\n\tconst frame = shape.absoluteFrame\n\tif (!frame) {\n\t\treportUnresolvable(shape, zIndex, slidePath)\n\t\treturn null\n\t}\n\n\t// Only `p:sp` holds a text body, so every other kind projects as an empty frame.\n\tconst textFrame = shape.textFrame\n\tconst paragraphs = textFrame ? textFrame.paragraphs.map((p) => ({ runs: p.runs.map(toRun) })) : []\n\tconst textRuns = paragraphs.flatMap((paragraph) => paragraph.runs)\n\t// A graphic frame has no text body of its own; its text comes from the structure\n\t// it hosts, and arrives as a plain string with no runs behind it.\n\t// Paragraphs are joined by a line break, so the last word of one and the first of the next stay\n\t// two words once the whitespace collapses below.\n\tconst runText = paragraphs.map((paragraph) => paragraph.runs.map((run) => run.text).join('')).join('\\n')\n\tconst raw = shape.shapeType === 'graphicFrame' ? graphicFrameText(shape) : runText\n\t// Deliberately not `TextFrame.text`: this is one whitespace-collapsed line for\n\t// matching and word-counting, not the frame's text with its line structure.\n\tconst text = raw.replace(/\\s+/g, ' ').trim()\n\tconst kind: PptxSlideElementKind =\n\t\tshape.shapeType === 'group'\n\t\t\t? 'group'\n\t\t\t: shape.shapeType === 'graphicFrame'\n\t\t\t\t? 'graphicFrame'\n\t\t\t\t: text\n\t\t\t\t\t? 'text'\n\t\t\t\t\t: shape.shapeType === 'picture'\n\t\t\t\t\t\t? 'image'\n\t\t\t\t\t\t: 'shape'\n\n\treturn {\n\t\tid: shape.id ?? zIndex + 1,\n\t\tname: shape.name || `${kind} ${zIndex + 1}`,\n\t\tkind,\n\t\tgraphicKind: shape.shapeType === 'graphicFrame' ? graphicKindOf(shape) : null,\n\t\tzIndex,\n\t\tbox: {\n\t\t\tx: emuToInches(frame.left),\n\t\t\ty: emuToInches(frame.top),\n\t\t\tw: emuToInches(frame.width),\n\t\t\th: emuToInches(frame.height),\n\t\t},\n\t\trotation: frame.rotation,\n\t\tflipH: frame.flipH,\n\t\tflipV: frame.flipV,\n\t\tparentZIndex: entry.parentZIndex,\n\t\tchildZIndices: entry.childZIndices,\n\t\ttext,\n\t\ttextWrap: textFrame?.bodyProperties?.wrap ?? null,\n\t\tautofit: textFrame?.autofit ?? null,\n\t\tautofitFontScale: textFrame?.autofitFontScale ?? null,\n\t\tbodyInsets: readBodyInsets(textFrame),\n\t\ttextRuns,\n\t\tparagraphs,\n\t\tfontSizes: [...new Set(textRuns.map((run) => run.fontSizePt).filter((size): size is number => size !== null))],\n\t\tcolors: [...new Set(textRuns.map((run) => run.color).filter((color): color is string => Boolean(color)))],\n\t\tfill: shape.fillColor,\n\t\tline: shape.lineColor,\n\t\tshapeType: shape.presetGeometry,\n\t}\n}\n\n/**\n * What a graphic frame hosts, from the same `a:graphicData/@uri` the read model's\n * `has*` predicates compare against. A frame that answers none of them is `'other'`\n * rather than dropped: a box the deck's author placed is on the slide whether or not\n * this library models its payload, and an overlap or coverage check that skipped it\n * would report a gap where a 3D model or an OLE object sits.\n */\nfunction graphicKindOf(frame: GraphicFrame): PptxGraphicKind {\n\tif (frame.hasTable) return 'table'\n\tif (frame.hasChart) return 'chart'\n\tif (frame.hasChartEx) return 'chartEx'\n\tif (frame.hasDiagram) return 'diagram'\n\treturn 'other'\n}\n\n/**\n * The text a graphic frame puts on the slide: table cells in row order, or SmartArt\n * node text. Charts contribute nothing, matching `Slide.text` on the read model — a\n * chart's strings are data labels and axis titles that PowerPoint itself does not\n * treat as slide body text.\n *\n * Separators are single spaces rather than the read model's `\t`/`\n`, because the\n * caller collapses whitespace anyway; the point here is only that cells do not run\n * together into one word.\n */\nfunction graphicFrameText(frame: GraphicFrame): string {\n\tconst table = frame.table\n\tif (table) return table.rows.map((row) => row.cells.map((cell) => cell.text).join(' ')).join(' ')\n\treturn frame.diagram?.text ?? ''\n}\n\n/** Project one read-model {@link Run} onto the flat run shape. */\nfunction toRun(run: Run): PptxTextRun {\n\treturn {\n\t\ttext: run.text,\n\t\tfontSizePt: run.fontSizePt,\n\t\tcolor: run.color,\n\t\tfontFace: run.fontName,\n\t\t// The read model distinguishes \"explicitly not bold\" from \"unset, inherits\";\n\t\t// this surface reports what renders, so an unset flag is `false`.\n\t\tbold: run.bold ?? false,\n\t\titalic: run.italic ?? false,\n\t\tstrike: run.strike,\n\t\thighlight: run.highlight?.hex ?? null,\n\t\tcharSpacingPt: run.charSpacingPt,\n\t}\n}\n\nfunction readBodyInsets(textFrame: TextFrame | null): PptxBodyInsets | null {\n\tconst insets = textFrame?.bodyProperties?.insetsPt\n\tif (!insets) return null\n\t// The read model reports only the explicitly-set sides; an omitted one takes PowerPoint's\n\t// own default rather than zero.\n\tconst inches = (pt: number | undefined, fallbackPt: number): number =>\n\t\t(pt === undefined ? fallbackPt : pt) / POINTS_PER_INCH\n\treturn {\n\t\tleft: inches(insets.left, BODY_INSET_DEFAULTS_PT.left),\n\t\ttop: inches(insets.top, BODY_INSET_DEFAULTS_PT.top),\n\t\tright: inches(insets.right, BODY_INSET_DEFAULTS_PT.right),\n\t\tbottom: inches(insets.bottom, BODY_INSET_DEFAULTS_PT.bottom),\n\t}\n}\n\n/**\n * Warn about a shape whose slide position cannot be resolved, unless it never\n * claimed one.\n *\n * `absoluteFrame` is `null` for three different situations and only two of them\n * are worth telling the caller about; `absoluteFrameFailure` is the read model\n * naming which, so this surface does not walk the ancestry a second time to\n * re-derive it.\n */\nfunction reportUnresolvable(shape: AnyShape, zIndex: number, slidePath: string): void {\n\tconst failure = shape.absoluteFrameFailure\n\t// No own `a:xfrm` at all: the shape inherits its geometry from a layout\n\t// placeholder, which this surface deliberately does not resolve. Nothing is\n\t// wrong with the deck, so nothing is reported. (`null` cannot reach here — the\n\t// caller only calls this for a shape whose frame did not resolve.)\n\tif (failure === null || failure === 'no-own-transform') return\n\n\tconst who = shape.name ? `\"${shape.name}\"` : `the element at zIndex ${zIndex}`\n\tif (failure === 'group-transform-missing') {\n\t\twarn(\n\t\t\t'inspect/group-transform-missing',\n\t\t\t`inspect: skipped ${who} on ${slidePath} — an enclosing group has no usable a:xfrm, so its slide position cannot be resolved.`\n\t\t)\n\t\treturn\n\t}\n\twarn(\n\t\t'inspect/group-transform-degenerate',\n\t\t`inspect: skipped ${who} on ${slidePath} — an enclosing group has a degenerate transform (zero a:chExt), so its slide position cannot be resolved.`\n\t)\n}\n\nfunction countWords(text: string): number {\n\treturn text.split(/\\s+/).filter(Boolean).length\n}\n\nfunction round(value: number, digits: number): number {\n\tconst factor = 10 ** digits\n\treturn Math.round(value * factor) / factor\n}\n\n// Error taxonomy — see `entry-errors.ts`. Re-exported from every entry so `instanceof`\n// works whichever subpath a consumer imports.\nexport * from './entry-errors.js'\n\n// Diagnostics — see `entry-diagnostics.ts`. Re-exported from every entry so a consumer of any\n// subpath can install a handler for the warnings that subpath emits.\nexport * from './entry-diagnostics.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwNA,MAAa,6BAA4C,OAAO,OAAO;CACtE,SAAS,MAAM,YAAY,sBAAsB,QAAQ,GAAG,CAAC;CAC7D,UAAU,MAAM,YAAY,sBAAsB,SAAS,GAAG,CAAC;AAChE,CAAC;;;;;;;;;AAmBD,eAAsB,gBAAgB,OAA8C;CACnF,OAAO,WAAW,KAAK,MAAM,KAAK;AACnC;;AAGA,SAAgB,cAAc,aAAmC;CAChE,OAAO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eAAe,WAAoD;CAC3E,MAAM,SAAS,WAAW,gBAAgB;CAC1C,IAAI,CAAC,QAAQ,OAAO;CAGpB,MAAM,UAAU,IAAwB,gBACtC,OAAO,KAAA,IAAY,aAAa,MAAA;CAClC,OAAO;EACN,MAAM,OAAO,OAAO,MAAM,uBAAuB,IAAI;EACrD,KAAK,OAAO,OAAO,KAAK,uBAAuB,GAAG;EAClD,OAAO,OAAO,OAAO,OAAO,uBAAuB,KAAK;EACxD,QAAQ,OAAO,OAAO,QAAQ,uBAAuB,MAAM;CAC5D;AACD;;;;;;;;;;AAWA,SAAS,mBAAmB,OAAiB,QAAgB,WAAyB;CACrF,MAAM,UAAU,MAAM;CAKtB,IAAI,YAAY,QAAQ,YAAY,oBAAoB;CAExD,MAAM,MAAM,MAAM,OAAO,IAAI,MAAM,KAAK,KAAK,yBAAyB;CACtE,IAAI,YAAY,2BAA2B;EAC1C,KACC,mCACA,oBAAoB,IAAI,MAAM,UAAU,sFACzC;EACA;CACD;CACA,KACC,sCACA,oBAAoB,IAAI,MAAM,UAAU,2GACzC;AACD;AAEA,SAAS,WAAW,MAAsB;CACzC,OAAO,KAAK,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C;AAEA,SAAS,MAAM,OAAe,QAAwB;CACrD,MAAM,SAAS,MAAM;CACrB,OAAO,KAAK,MAAM,QAAQ,MAAM,IAAI;AACrC"}
package/dist/math.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-D8ot4Ei7.js";
1
+ import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-DiMmBU8P.js";
2
2
  //#region src/math.d.ts
3
3
  /**
4
4
  * Convert a MathML string to OMML for the `math:` option on `addText`.
package/dist/math.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-C4oENPcu.js";
1
+ import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-Da2nXCJm.js";
2
2
  import { createRequire } from "node:module";
3
3
  //#region src/math.ts
4
4
  /**
package/dist/measure.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Bt as TextMeasurement, Ht as TextPropsOptions, Ot as MeasureTextOptions, Vt as TextProps, jt as OverflowBoxOptions } from "./pres-C6qgOFAa.js";
2
- import { C as solveShrink, S as solveResize, _ as ShrinkOutcome, a as makeRegistryResolver, b as measureHeightPt, c as FitBox, d as HEIGHT_SAFETY_FACTOR, f as LayoutResult, g as SINGLE_LINE_PITCH, h as ResizeOutcome, i as getHeuristicFontMetrics, l as FitParagraph, m as MetricsResolver, n as FontMetricsRegistry, o as parseFontMetrics, p as MIN_FONT_SCALE_PCT, r as ParseFontMetricsOptions, s as FONT_SCALE_STEP_PCT, t as FontMetrics, u as FitRun, v as ShrinkResult, w as ObjectOptionsInternal, x as measureLayout, y as WIDTH_SAFETY_FACTOR } from "./font-metrics-v5fn7s7e.js";
3
- import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-D8ot4Ei7.js";
1
+ import { Ht as TextProps, Mt as OverflowBoxOptions, Ut as TextPropsOptions, Vt as TextMeasurement, kt as MeasureTextOptions } from "./pres-BA9_lJbY.js";
2
+ import { C as solveShrink, S as solveResize, _ as ShrinkOutcome, a as makeRegistryResolver, b as measureHeightPt, c as FitBox, d as HEIGHT_SAFETY_FACTOR, f as LayoutResult, g as SINGLE_LINE_PITCH, h as ResizeOutcome, i as getHeuristicFontMetrics, l as FitParagraph, m as MetricsResolver, n as FontMetricsRegistry, o as parseFontMetrics, p as MIN_FONT_SCALE_PCT, r as ParseFontMetricsOptions, s as FONT_SCALE_STEP_PCT, t as FontMetrics, u as FitRun, v as ShrinkResult, w as ObjectOptionsInternal, x as measureLayout, y as WIDTH_SAFETY_FACTOR } from "./font-metrics-CBGmhLo0.js";
3
+ import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-DiMmBU8P.js";
4
4
  //#region src/measure/font-collection.d.ts
5
5
  /**
6
6
  * Font **collection** (`.ttc` / `.otc`) support for the write-side metrics.
package/dist/measure.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-C4oENPcu.js";
2
- import { _ as getHeuristicFontMetrics, b as isFontCollection, c as HEIGHT_SAFETY_FACTOR, d as WIDTH_SAFETY_FACTOR, f as measureHeightPt, g as FontMetricsRegistry, h as solveShrink, l as MIN_FONT_SCALE_PCT, m as solveResize, n as measureText, o as buildFitParagraphs, p as measureLayout, s as FONT_SCALE_STEP_PCT, u as SINGLE_LINE_PITCH, v as makeRegistryResolver, x as listFontFaces, y as parseFontMetrics } from "./fit-Cb7naFj6.js";
1
+ import { a as TsPptxError, c as setDiagnosticHandler, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, s as resetDiagnosticState, t as InternalError } from "./errors-Da2nXCJm.js";
2
+ import { _ as getHeuristicFontMetrics, b as isFontCollection, c as HEIGHT_SAFETY_FACTOR, d as WIDTH_SAFETY_FACTOR, f as measureHeightPt, g as FontMetricsRegistry, h as solveShrink, l as MIN_FONT_SCALE_PCT, m as solveResize, n as measureText, o as buildFitParagraphs, p as measureLayout, s as FONT_SCALE_STEP_PCT, u as SINGLE_LINE_PITCH, v as makeRegistryResolver, x as listFontFaces, y as parseFontMetrics } from "./fit-CcXbg__l.js";
3
3
  export { FONT_SCALE_STEP_PCT, FontMetricsRegistry, HEIGHT_SAFETY_FACTOR, InternalError, InvalidOptionError, MIN_FONT_SCALE_PCT, MediaError, PackageReadError, SINGLE_LINE_PITCH, TsPptxError, UnsupportedFeatureError, WIDTH_SAFETY_FACTOR, buildFitParagraphs, getHeuristicFontMetrics, isFontCollection, listFontFaces, makeRegistryResolver, measureHeightPt, measureLayout, measureText, parseFontMetrics, resetDiagnosticState, setDiagnosticHandler, solveResize, solveShrink };