ooxml-core 1.9.0 → 1.11.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 (202) hide show
  1. package/dist/PptxHandler-DNZHAHUY.cjs +12 -0
  2. package/dist/PptxHandler-E44KDHMQ.mjs +3 -0
  3. package/dist/{PptxHandler-EX4WBIQQ.mjs → PptxHandler-NROFYT2N.mjs} +2 -2
  4. package/dist/automation/index.cjs +3236 -2258
  5. package/dist/automation/index.mjs +3236 -2258
  6. package/dist/{chunk-SWF7KVL5.cjs → chunk-2UVH6RHI.cjs} +1608 -1163
  7. package/dist/{chunk-M76PHYRR.mjs → chunk-7DSZI7S6.mjs} +1 -1
  8. package/dist/{chunk-AT66SA5M.cjs → chunk-7QZGRB3T.cjs} +28 -10
  9. package/dist/chunk-ANZ4Q6I3.cjs +21 -0
  10. package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
  11. package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
  12. package/dist/{chunk-FIELY5PI.mjs → chunk-EC2W2MDY.mjs} +30 -2
  13. package/dist/chunk-EGTRL3QJ.mjs +19 -0
  14. package/dist/chunk-GXHKNSZX.mjs +9 -0
  15. package/dist/{chunk-OXHMZS7B.mjs → chunk-HCXUI5UC.mjs} +943 -273
  16. package/dist/chunk-HDQXPSHY.cjs +17 -0
  17. package/dist/chunk-KTYBFGEY.mjs +14 -0
  18. package/dist/chunk-QOO36KG4.cjs +42 -0
  19. package/dist/chunk-R2KZXD6U.mjs +39 -0
  20. package/dist/{chunk-IGOA57LE.mjs → chunk-U2DF3EGK.mjs} +1 -1
  21. package/dist/{chunk-OB277ZGE.mjs → chunk-UAY26XOI.mjs} +27 -9
  22. package/dist/{chunk-WSO4T2LJ.mjs → chunk-W5ARCUJB.mjs} +26 -3
  23. package/dist/chunk-XZPZHXV4.cjs +12 -0
  24. package/dist/{chunk-LCS3J3QI.mjs → chunk-YB5SRNFS.mjs} +717 -272
  25. package/dist/docx/layout/adapt-table.d.ts +2 -2
  26. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  28. package/dist/docx/layout/index.cjs +554 -83
  29. package/dist/docx/layout/index.mjs +554 -84
  30. package/dist/docx/layout/nested-fragment-edges.d.ts +9 -0
  31. package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -0
  32. package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
  33. package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
  34. package/dist/docx/layout/page-cursor.d.ts +2 -0
  35. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  36. package/dist/docx/layout/result.d.ts +20 -0
  37. package/dist/docx/layout/result.d.ts.map +1 -1
  38. package/dist/docx/layout/table-border-layout.d.ts +16 -0
  39. package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
  40. package/dist/docx/layout/table-cell-layout.d.ts +3 -2
  41. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  42. package/dist/docx/layout/table-content.d.ts +4 -0
  43. package/dist/docx/layout/table-content.d.ts.map +1 -0
  44. package/dist/docx/layout/table-footnotes.d.ts +5 -0
  45. package/dist/docx/layout/table-footnotes.d.ts.map +1 -1
  46. package/dist/docx/layout/table-frames.d.ts +4 -0
  47. package/dist/docx/layout/table-frames.d.ts.map +1 -0
  48. package/dist/docx/layout/table-layout.d.ts +8 -3
  49. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  50. package/dist/docx/layout/table-note-completion.d.ts +5 -0
  51. package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
  52. package/dist/docx/layout/table-note-stories.d.ts +6 -0
  53. package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
  54. package/dist/pptx/automation/index.cjs +801 -296
  55. package/dist/pptx/automation/index.d.ts +5 -4
  56. package/dist/pptx/automation/index.d.ts.map +1 -1
  57. package/dist/pptx/automation/index.mjs +5 -5
  58. package/dist/pptx/chunks/{text-operations-BLodkuXE.d.ts → elements-DD3UGOMd.d.ts} +27 -3248
  59. package/dist/pptx/chunks/elements-DD3UGOMd.d.ts.map +1 -0
  60. package/dist/pptx/chunks/{index-B4cnSPNz.d.ts → index-BZrFyNtU.d.ts} +113 -5
  61. package/dist/pptx/chunks/index-BZrFyNtU.d.ts.map +1 -0
  62. package/dist/pptx/chunks/{index-BZh-IMkN.d.ts → index-DdX02BSm.d.ts} +19 -3
  63. package/dist/pptx/chunks/index-DdX02BSm.d.ts.map +1 -0
  64. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts +1512 -0
  65. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts.map +1 -0
  66. package/dist/pptx/chunks/text-D49FKllA.d.ts +1473 -0
  67. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +1 -0
  68. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts +3261 -0
  69. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts.map +1 -0
  70. package/dist/pptx/cli/index.cjs +801 -296
  71. package/dist/pptx/cli/index.d.ts +1 -1
  72. package/dist/pptx/cli/index.mjs +4 -4
  73. package/dist/pptx/converter/index.cjs +1 -0
  74. package/dist/pptx/converter/index.d.ts +1 -1
  75. package/dist/pptx/converter/index.mjs +2 -2
  76. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
  77. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
  78. package/dist/pptx/editor/render/find-replace.cjs +19 -18
  79. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  80. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  81. package/dist/pptx/editor/render/font-family-update.cjs +14 -0
  82. package/dist/pptx/editor/render/font-family-update.d.ts +17 -0
  83. package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -0
  84. package/dist/pptx/editor/render/font-family-update.mjs +1 -0
  85. package/dist/pptx/editor/render/paragraph-geometry-overrides.cjs +14 -0
  86. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +17 -0
  87. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -0
  88. package/dist/pptx/editor/render/paragraph-geometry-overrides.mjs +12 -0
  89. package/dist/pptx/editor/render/remap-text.cjs +2 -2
  90. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  91. package/dist/pptx/editor/render/remap-text.mjs +1 -1
  92. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  93. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  94. package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
  95. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  96. package/dist/pptx/editor/render/text-content-style.cjs +18 -0
  97. package/dist/pptx/editor/render/text-content-style.d.ts +9 -0
  98. package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -0
  99. package/dist/pptx/editor/render/text-content-style.mjs +5 -0
  100. package/dist/pptx/editor/render/text-runs-style-patch.cjs +17 -0
  101. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +7 -0
  102. package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -0
  103. package/dist/pptx/editor/render/text-runs-style-patch.mjs +15 -0
  104. package/dist/pptx/editor/render/text-style-scope.cjs +173 -0
  105. package/dist/pptx/editor/render/text-style-scope.d.ts +76 -0
  106. package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -0
  107. package/dist/pptx/editor/render/text-style-scope.mjs +164 -0
  108. package/dist/pptx/editor/render/theme-editor-model.cjs +1 -1
  109. package/dist/pptx/editor/render/theme-editor-model.mjs +1 -1
  110. package/dist/pptx/editor/render/update-text-segment-style.cjs +11 -0
  111. package/dist/pptx/editor/render/update-text-segment-style.d.ts +14 -0
  112. package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -0
  113. package/dist/pptx/editor/render/update-text-segment-style.mjs +2 -0
  114. package/dist/pptx/index.cjs +1091 -296
  115. package/dist/pptx/index.d.ts +7 -5
  116. package/dist/pptx/index.mjs +5 -5
  117. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  118. package/dist/teams/index.cjs +590 -122
  119. package/dist/teams/index.mjs +590 -122
  120. package/dist/visio/date-cache.d.ts +3 -0
  121. package/dist/visio/date-cache.d.ts.map +1 -0
  122. package/dist/visio/edit-commands.d.ts +3 -3
  123. package/dist/visio/edit-commands.d.ts.map +1 -1
  124. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  125. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  126. package/dist/visio/edit-text-field-commands.d.ts +15 -0
  127. package/dist/visio/edit-text-field-commands.d.ts.map +1 -1
  128. package/dist/visio/edit-text-field.d.ts +2 -2
  129. package/dist/visio/edit-text-field.d.ts.map +1 -1
  130. package/dist/visio/edit.d.ts +1 -1
  131. package/dist/visio/edit.d.ts.map +1 -1
  132. package/dist/visio/index.cjs +501 -220
  133. package/dist/visio/index.d.ts +1 -1
  134. package/dist/visio/index.d.ts.map +1 -1
  135. package/dist/visio/index.mjs +501 -220
  136. package/dist/visio/model.d.ts +6 -0
  137. package/dist/visio/model.d.ts.map +1 -1
  138. package/dist/visio/shape-metadata.d.ts.map +1 -1
  139. package/dist/visio/shapes.d.ts.map +1 -1
  140. package/dist/visio/style.d.ts +1 -1
  141. package/dist/visio/style.d.ts.map +1 -1
  142. package/dist/visio/text-field-display.d.ts +3 -0
  143. package/dist/visio/text-field-display.d.ts.map +1 -1
  144. package/dist/visio/text-field-editability.d.ts +6 -0
  145. package/dist/visio/text-field-editability.d.ts.map +1 -0
  146. package/dist/visio/text-field-fraction.d.ts +3 -0
  147. package/dist/visio/text-field-fraction.d.ts.map +1 -0
  148. package/dist/visio/text-field-independent.d.ts +4 -0
  149. package/dist/visio/text-field-independent.d.ts.map +1 -0
  150. package/dist/visio/text-field-numeric.d.ts +1 -1
  151. package/dist/visio/text-field-numeric.d.ts.map +1 -1
  152. package/dist/visio/text-field-source.d.ts +6 -0
  153. package/dist/visio/text-field-source.d.ts.map +1 -0
  154. package/dist/visio/text-field-system-date.d.ts +4 -0
  155. package/dist/visio/text-field-system-date.d.ts.map +1 -0
  156. package/dist/visio/text-fields.d.ts +1 -0
  157. package/dist/visio/text-fields.d.ts.map +1 -1
  158. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  159. package/dist/visio/ui/index.cjs +514 -221
  160. package/dist/visio/ui/index.mjs +514 -221
  161. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  162. package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
  163. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  164. package/dist/xlsx/index.cjs +1362 -659
  165. package/dist/xlsx/index.mjs +1361 -660
  166. package/dist/xlsx/load/index.cjs +1091 -430
  167. package/dist/xlsx/load/index.mjs +1091 -430
  168. package/dist/xlsx/model-pivots.d.ts +31 -2
  169. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  170. package/dist/xlsx/pivot/admission.d.ts.map +1 -1
  171. package/dist/xlsx/pivot/aggregate.d.ts +3 -1
  172. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  173. package/dist/xlsx/pivot/data.d.ts +2 -2
  174. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  175. package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
  176. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
  177. package/dist/xlsx/pivot/hierarchy.d.ts +2 -4
  178. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
  179. package/dist/xlsx/pivot/index.d.ts +2 -0
  180. package/dist/xlsx/pivot/index.d.ts.map +1 -1
  181. package/dist/xlsx/pivot/measures.d.ts +13 -0
  182. package/dist/xlsx/pivot/measures.d.ts.map +1 -0
  183. package/dist/xlsx/pivot/page-filter-admission.d.ts +5 -0
  184. package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -0
  185. package/dist/xlsx/pivot/page-filter.d.ts +11 -0
  186. package/dist/xlsx/pivot/page-filter.d.ts.map +1 -0
  187. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  188. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  189. package/dist/xlsx/pivot/values-axis.d.ts +12 -0
  190. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
  191. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  192. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  193. package/dist/xlsx/ui/index.cjs +640 -137
  194. package/dist/xlsx/ui/index.mjs +640 -137
  195. package/package.json +2 -2
  196. package/dist/PptxHandler-AT7FVG5Q.mjs +0 -2
  197. package/dist/PptxHandler-VFSCECPL.cjs +0 -11
  198. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +0 -1
  199. package/dist/pptx/chunks/index-BZh-IMkN.d.ts.map +0 -1
  200. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts +0 -2970
  201. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
  202. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +0 -1
@@ -10557,6 +10557,32 @@ function inheritCustomGeometryCommandOrder(target, ...sources) {
10557
10557
  }
10558
10558
  }
10559
10559
  }
10560
+ function pathListPaths(pathLst) {
10561
+ if (!pathLst || typeof pathLst !== "object") {
10562
+ return [];
10563
+ }
10564
+ return ensureArrayLocal(childByLocalName(pathLst, "path")).filter(
10565
+ (path3) => Boolean(path3) && typeof path3 === "object"
10566
+ );
10567
+ }
10568
+ function readPathListCommandOrder(pathLst) {
10569
+ const orders = pathListPaths(pathLst).map((path3) => [...commandOrder.get(path3) ?? []]);
10570
+ return orders.some((order) => order.length > 0) ? orders : void 0;
10571
+ }
10572
+ function restorePathListCommandOrder(pathLst, orders) {
10573
+ if (!orders || orders.length === 0) {
10574
+ return;
10575
+ }
10576
+ pathListPaths(pathLst).forEach((path3, index) => {
10577
+ const order = orders[index];
10578
+ if (!order || order.length === 0 || commandOrder.has(path3)) {
10579
+ return;
10580
+ }
10581
+ if (orderSignature([...order]) === pathSignature(path3)) {
10582
+ commandOrder.set(path3, [...order]);
10583
+ }
10584
+ });
10585
+ }
10560
10586
  function orderedXmlKey(baseName, order) {
10561
10587
  return `${baseName}${ORDER_SUFFIX}${order}`;
10562
10588
  }
@@ -50075,6 +50101,7 @@ var init_custom_geometry_parser = __esm({
50075
50101
  // pptx/core/geometry/custom-geometry-live-eval.ts
50076
50102
  function pathNodesOf(rawData) {
50077
50103
  const pathLst = rawData?.pathLstXml;
50104
+ restorePathListCommandOrder(pathLst, rawData?.pathCommandOrder);
50078
50105
  return ensureArrayValue(pathLst?.["a:path"]);
50079
50106
  }
50080
50107
  function evaluateCustomGeometryPaths(rawData, pathWidth, pathHeight, overrides) {
@@ -50114,6 +50141,7 @@ var init_custom_geometry_live_eval = __esm({
50114
50141
  "pptx/core/geometry/custom-geometry-live-eval.ts"() {
50115
50142
  init_utils();
50116
50143
  init_custom_geometry();
50144
+ init_custom_geometry_command_order();
50117
50145
  init_custom_geometry_guides();
50118
50146
  init_custom_geometry_parser();
50119
50147
  ensureArray7 = (value) => ensureArrayValue(value);
@@ -51288,6 +51316,7 @@ var init_presentation_field_keys = __esm({
51288
51316
  modernCommentAuthors: true,
51289
51317
  conformance: true,
51290
51318
  embedTrueTypeFonts: true,
51319
+ firstSlideNumber: true,
51291
51320
  defaultTextStyle: true
51292
51321
  };
51293
51322
  PRESENTATION_FIELD_NAMES = Object.keys(PRESENTATION_FIELD_KEYS);
@@ -52881,7 +52910,7 @@ function rootRelsXml() {
52881
52910
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
52882
52911
  </Relationships>`;
52883
52912
  }
52884
- function presentationXml(width, height, slideCount) {
52913
+ function presentationXml(width, height, slideCount, firstSlideNumber) {
52885
52914
  const slideIdBase = 256;
52886
52915
  const slideRIdBase = 6;
52887
52916
  const sldIdLst = slideCount > 0 ? ` <p:sldIdLst>
@@ -52890,6 +52919,7 @@ ${Array.from(
52890
52919
  (_, i2) => ` <p:sldId id="${slideIdBase + i2}" r:id="rId${slideRIdBase + i2}"/>`
52891
52920
  ).join("\n")}
52892
52921
  </p:sldIdLst>` : "";
52922
+ const firstSlideNum = firstSlideNumber === void 0 ? "" : ` firstSlideNum="${Math.trunc(firstSlideNumber)}"`;
52893
52923
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
52894
52924
  <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
52895
52925
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
@@ -52897,7 +52927,7 @@ ${Array.from(
52897
52927
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
52898
52928
  xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
52899
52929
  xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"
52900
- saveSubsetFonts="1">
52930
+ saveSubsetFonts="1"${firstSlideNum}>
52901
52931
  <p:sldMasterIdLst>
52902
52932
  <p:sldMasterId id="2147483648" r:id="rId1"/>
52903
52933
  </p:sldMasterIdLst>
@@ -53134,7 +53164,10 @@ async function buildBlankPresentationArchive(options) {
53134
53164
  const zip = new JSZip7__default.default();
53135
53165
  zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
53136
53166
  zip.file("_rels/.rels", rootRelsXml());
53137
- zip.file("ppt/presentation.xml", presentationXml(width, height, initialSlideCount));
53167
+ zip.file(
53168
+ "ppt/presentation.xml",
53169
+ presentationXml(width, height, initialSlideCount, options?.firstSlideNumber)
53170
+ );
53138
53171
  zip.file("ppt/_rels/presentation.xml.rels", presentationRelsXml(layoutCount, initialSlideCount));
53139
53172
  zip.file("ppt/slideMasters/slideMaster1.xml", slideMasterXml(layoutCount));
53140
53173
  zip.file("ppt/slideMasters/_rels/slideMaster1.xml.rels", slideMasterRelsXml(layoutCount));
@@ -60506,7 +60539,7 @@ function parseShapeLockNode(node, spec) {
60506
60539
  return void 0;
60507
60540
  }
60508
60541
  const locks = {};
60509
- let hasAny = false;
60542
+ let hasAny2 = false;
60510
60543
  for (const prop of spec.permitted) {
60511
60544
  const raw = node[LOCK_ATTRIBUTE[prop]];
60512
60545
  if (raw === void 0) {
@@ -60514,9 +60547,9 @@ function parseShapeLockNode(node, spec) {
60514
60547
  }
60515
60548
  const value = String(raw).trim().toLowerCase();
60516
60549
  locks[prop] = value === "1" || value === "true";
60517
- hasAny = true;
60550
+ hasAny2 = true;
60518
60551
  }
60519
- return hasAny ? locks : void 0;
60552
+ return hasAny2 ? locks : void 0;
60520
60553
  }
60521
60554
  var LOCK_ATTRIBUTE, MODELLED_ATTRIBUTES, CARRIED_WHEN_UNSET;
60522
60555
  var init_shape_lock_node = __esm({
@@ -61383,6 +61416,7 @@ var init_PptxLoadDataBuilder = __esm({
61383
61416
  modernCommentAuthors;
61384
61417
  conformance;
61385
61418
  embedTrueTypeFonts;
61419
+ firstSlideNumber;
61386
61420
  defaultTextStyle;
61387
61421
  withDimensions(width, height, widthEmu, heightEmu) {
61388
61422
  this.width = width;
@@ -61552,6 +61586,10 @@ var init_PptxLoadDataBuilder = __esm({
61552
61586
  this.embedTrueTypeFonts = embedTrueTypeFonts;
61553
61587
  return this;
61554
61588
  }
61589
+ withFirstSlideNumber(firstSlideNumber) {
61590
+ this.firstSlideNumber = firstSlideNumber;
61591
+ return this;
61592
+ }
61555
61593
  withDefaultTextStyle(defaultTextStyle) {
61556
61594
  this.defaultTextStyle = defaultTextStyle;
61557
61595
  return this;
@@ -61603,6 +61641,7 @@ var init_PptxLoadDataBuilder = __esm({
61603
61641
  modernCommentAuthors: this.modernCommentAuthors,
61604
61642
  conformance: this.conformance,
61605
61643
  embedTrueTypeFonts: this.embedTrueTypeFonts,
61644
+ firstSlideNumber: this.firstSlideNumber,
61606
61645
  defaultTextStyle: this.defaultTextStyle
61607
61646
  };
61608
61647
  }
@@ -65507,6 +65546,297 @@ var init_native_animation_media_duration = __esm({
65507
65546
  }
65508
65547
  });
65509
65548
 
65549
+ // pptx/core/services/editor-animation-entry.ts
65550
+ function hasAuthoredAnimationEffect(entry2) {
65551
+ return Boolean(
65552
+ [entry2.entrance, entry2.exit, entry2.emphasis].some((preset) => preset && preset !== "none") || entry2.motionPath
65553
+ );
65554
+ }
65555
+ function animationFor(slideAnimations, elementId) {
65556
+ return slideAnimations.find((a) => a.elementId === elementId);
65557
+ }
65558
+ var init_editor_animation_entry = __esm({
65559
+ "pptx/core/services/editor-animation-entry.ts"() {
65560
+ }
65561
+ });
65562
+
65563
+ // pptx/core/services/native-animation-after-effect.ts
65564
+ function hasAfterEffectFlag(cTn) {
65565
+ const raw = cTn?.["@_afterEffect"];
65566
+ return raw === "1" || raw === "true";
65567
+ }
65568
+ function extractSrgbHex(colorContainer) {
65569
+ const srgb = colorContainer?.["a:srgbClr"];
65570
+ const val = srgb?.["@_val"];
65571
+ return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
65572
+ }
65573
+ function findDimBehaviour(subTnLst) {
65574
+ for (const node of ensureArray10(subTnLst["p:animClr"])) {
65575
+ const cBhvr = node["p:cBhvr"];
65576
+ if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
65577
+ continue;
65578
+ }
65579
+ if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
65580
+ continue;
65581
+ }
65582
+ const toNode = node["p:to"];
65583
+ const color2 = extractSrgbHex(toNode);
65584
+ if (color2) {
65585
+ return { action: "dimToColor", color: color2 };
65586
+ }
65587
+ const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
65588
+ return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
65589
+ }
65590
+ return void 0;
65591
+ }
65592
+ function findHideBehaviour(subTnLst) {
65593
+ for (const node of ensureArray10(subTnLst["p:set"])) {
65594
+ const cBhvr = node["p:cBhvr"];
65595
+ if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
65596
+ continue;
65597
+ }
65598
+ const innerCTn = cBhvr?.["p:cTn"];
65599
+ if (!hasAfterEffectFlag(innerCTn)) {
65600
+ continue;
65601
+ }
65602
+ const toNode = node["p:to"];
65603
+ const strVal = toNode?.["p:strVal"]?.["@_val"];
65604
+ if (String(strVal ?? "").toLowerCase() !== "hidden") {
65605
+ continue;
65606
+ }
65607
+ const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
65608
+ return { action };
65609
+ }
65610
+ return void 0;
65611
+ }
65612
+ function extractAfterAnimationFromSubTnLst(cTn) {
65613
+ const subTnLst = cTn["p:subTnLst"];
65614
+ if (!subTnLst) {
65615
+ return void 0;
65616
+ }
65617
+ return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
65618
+ }
65619
+ var init_native_animation_after_effect = __esm({
65620
+ "pptx/core/services/native-animation-after-effect.ts"() {
65621
+ init_theme_color_ref();
65622
+ init_native_animation_attr_name();
65623
+ init_native_animation_helpers();
65624
+ }
65625
+ });
65626
+
65627
+ // pptx/core/services/animation-after-effect-write.ts
65628
+ function assertAfterAnimationClearSupported(effectCTn) {
65629
+ const shapeIds = /* @__PURE__ */ new Set();
65630
+ const checkTarget = (value) => {
65631
+ if (Array.isArray(value)) {
65632
+ value.forEach(checkTarget);
65633
+ return;
65634
+ }
65635
+ if (!isXmlObject5(value)) return;
65636
+ const shapeTarget = value["p:spTgt"];
65637
+ if (isXmlObject5(shapeTarget) && shapeTarget["@_spid"] !== void 0)
65638
+ shapeIds.add(String(shapeTarget["@_spid"]));
65639
+ if ([
65640
+ "p:bg",
65641
+ "p:txEl",
65642
+ "p:subSp",
65643
+ "p:graphicEl",
65644
+ "p:oleChartEl",
65645
+ "p:sndTgt",
65646
+ "p:inkTgt",
65647
+ "p:sldTgt"
65648
+ ].some((key2) => value[key2] !== void 0))
65649
+ throw new Error("Clearing after-animation supports whole-shape targets only");
65650
+ Object.values(value).forEach(checkTarget);
65651
+ };
65652
+ checkTarget(effectCTn["p:childTnLst"]);
65653
+ if (shapeIds.size > 1)
65654
+ throw new Error("Editing after-animation supports a single whole-shape target only");
65655
+ const sub = effectCTn["p:subTnLst"];
65656
+ if (!isXmlObject5(sub)) return;
65657
+ const countAfterFlags = (value) => {
65658
+ if (Array.isArray(value))
65659
+ return value.reduce((count, child30) => count + countAfterFlags(child30), 0);
65660
+ if (!isXmlObject5(value)) return 0;
65661
+ return Object.entries(value).reduce(
65662
+ (count, [key2, child30]) => count + (key2 === "@_afterEffect" && ["1", "true"].includes(String(child30)) ? 1 : countAfterFlags(child30)),
65663
+ 0
65664
+ );
65665
+ };
65666
+ for (const [key2, value] of Object.entries(sub)) {
65667
+ for (const node of ensureArray10(value)) {
65668
+ const flags = countAfterFlags(node);
65669
+ if (!flags) continue;
65670
+ if (flags !== 1 || !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } }))
65671
+ throw new Error("Cannot clear an unsupported native after-animation behavior");
65672
+ checkTarget(node);
65673
+ }
65674
+ }
65675
+ if (shapeIds.size > 1)
65676
+ throw new Error("Editing after-animation supports a single whole-shape target only");
65677
+ }
65678
+ function clearAfterAnimationBehavior(effectCTn) {
65679
+ const sub = effectCTn["p:subTnLst"];
65680
+ if (!isXmlObject5(sub)) return;
65681
+ for (const key2 of Object.keys(sub)) {
65682
+ const nodes = ensureArray10(sub[key2]);
65683
+ const remaining = nodes.filter(
65684
+ (node) => !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } })
65685
+ );
65686
+ if (remaining.length === nodes.length) continue;
65687
+ if (remaining.length === 0) delete sub[key2];
65688
+ else sub[key2] = remaining.length === 1 ? remaining[0] : remaining;
65689
+ }
65690
+ if (Object.keys(sub).length === 0) delete effectCTn["p:subTnLst"];
65691
+ }
65692
+ function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
65693
+ if (anim.afterAnimation === void 0) return;
65694
+ if (anim.afterAnimation === "none") {
65695
+ assertAfterAnimationClearSupported(effectCTn);
65696
+ clearAfterAnimationBehavior(effectCTn);
65697
+ return;
65698
+ }
65699
+ assertAfterAnimationClearSupported(effectCTn);
65700
+ clearAfterAnimationBehavior(effectCTn);
65701
+ delete effectCTn["@_afterEffect"];
65702
+ if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
65703
+ appendAfterAnimationBehavior(effectCTn, buildDimSubTnLst(shapeId, anim.afterAnimationColor));
65704
+ return;
65705
+ }
65706
+ if (anim.afterAnimation === "hideAfterAnimation") {
65707
+ const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
65708
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "sameClick", entranceId));
65709
+ return;
65710
+ }
65711
+ if (anim.afterAnimation === "hideOnNextClick") {
65712
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "nextClick"));
65713
+ }
65714
+ }
65715
+ function appendAfterAnimationBehavior(effect, addition) {
65716
+ const sub = isXmlObject5(effect["p:subTnLst"]) ? effect["p:subTnLst"] : {};
65717
+ for (const [key2, value] of Object.entries(addition)) {
65718
+ const nodes = [...ensureArray10(sub[key2]), ...ensureArray10(value)];
65719
+ sub[key2] = nodes.length === 1 ? nodes[0] : nodes;
65720
+ }
65721
+ effect["p:subTnLst"] = sub;
65722
+ }
65723
+ function buildDimSubTnLst(shapeId, colorHex) {
65724
+ const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
65725
+ return {
65726
+ "p:animClr": {
65727
+ "@_clrSpc": "rgb",
65728
+ "@_dir": "cw",
65729
+ "p:cBhvr": {
65730
+ "@_override": "childStyle",
65731
+ "p:cTn": {
65732
+ "@_dur": "1",
65733
+ "@_fill": "hold",
65734
+ "@_display": "0",
65735
+ "@_masterRel": "nextClick",
65736
+ "@_afterEffect": "1"
65737
+ },
65738
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
65739
+ "p:attrNameLst": { "p:attrName": "ppt_c" }
65740
+ },
65741
+ "p:to": { "a:srgbClr": { "@_val": hex3 } }
65742
+ }
65743
+ };
65744
+ }
65745
+ function buildHideSubTnLst(shapeId, masterRel, entranceId) {
65746
+ const cTn = {
65747
+ "@_dur": "1",
65748
+ "@_fill": "hold",
65749
+ "@_display": "0",
65750
+ "@_masterRel": masterRel,
65751
+ "@_afterEffect": "1"
65752
+ };
65753
+ if (masterRel === "sameClick") {
65754
+ cTn["p:stCondLst"] = {
65755
+ "p:cond": {
65756
+ "@_evt": "end",
65757
+ "@_delay": "0",
65758
+ "p:tn": { "@_val": entranceId ?? "0" }
65759
+ }
65760
+ };
65761
+ }
65762
+ return {
65763
+ "p:set": {
65764
+ "p:cBhvr": {
65765
+ "@_override": "childStyle",
65766
+ "p:cTn": cTn,
65767
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
65768
+ "p:attrNameLst": { "p:attrName": "style.visibility" }
65769
+ },
65770
+ "p:to": { "p:strVal": { "@_val": "hidden" } }
65771
+ }
65772
+ };
65773
+ }
65774
+ var init_animation_after_effect_write = __esm({
65775
+ "pptx/core/services/animation-after-effect-write.ts"() {
65776
+ init_native_animation_after_effect();
65777
+ init_native_animation_helpers();
65778
+ }
65779
+ });
65780
+
65781
+ // pptx/core/services/editor-animation-after-effect.ts
65782
+ function mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming) {
65783
+ for (const native of nativeAnimations ?? []) {
65784
+ const existing = native.targetId ? animationFor(animations, native.targetId) : void 0;
65785
+ const action = native.afterAnimationAction ?? (existing?.afterAnimation !== void 0 ? "none" : void 0);
65786
+ if ((nativeAnimations ?? []).filter(
65787
+ (other) => other.targetId === native.targetId && ["entr", "emph"].includes(other.presetClass ?? "")
65788
+ ).length !== 1)
65789
+ continue;
65790
+ if (!native.targetId || !action || !["entr", "emph"].includes(native.presetClass ?? "") || native.textTarget)
65791
+ continue;
65792
+ if (native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
65793
+ continue;
65794
+ try {
65795
+ if (rawTiming && native.target?.type === "shape" && indexEffectNodes(rawTiming).filter(
65796
+ (ref) => ref.spid === (native.target?.type === "shape" ? native.target.shapeId : void 0) && ["entr", "emph"].includes(ref.presetClass)
65797
+ ).length !== 1)
65798
+ continue;
65799
+ const effect = rawTiming ? indexEffectNodes(rawTiming).find(
65800
+ (ref) => String(ref.cTn["@_id"]) === String(native.nodeId) && native.target?.type === "shape" && ref.spid === native.target.shapeId
65801
+ ) : void 0;
65802
+ if (rawTiming && !effect) continue;
65803
+ assertAfterAnimationClearSupported(
65804
+ effect?.cTn ?? { "p:subTnLst": native.cTnAttributes?.["p:subTnLst"] }
65805
+ );
65806
+ } catch {
65807
+ continue;
65808
+ }
65809
+ let entry2 = animationFor(animations, native.targetId);
65810
+ if (!entry2) {
65811
+ entry2 = { elementId: native.targetId };
65812
+ animations.push(entry2);
65813
+ }
65814
+ if (entry2.nativeAfterAnimation !== void 0) continue;
65815
+ entry2.nativeAfterAnimation = action;
65816
+ entry2.nativeAfterAnimationColor = native.afterAnimationColor;
65817
+ }
65818
+ }
65819
+ function isNativeAfterAnimationFallback(entry2) {
65820
+ return entry2.nativeAfterAnimation !== void 0 && Object.entries(entry2).every(
65821
+ ([key2, value]) => value === void 0 || [
65822
+ "elementId",
65823
+ "nativeAfterAnimation",
65824
+ "nativeAfterAnimationColor",
65825
+ "soundRId",
65826
+ "soundPath",
65827
+ "soundName",
65828
+ "stopSound"
65829
+ ].includes(key2)
65830
+ );
65831
+ }
65832
+ var init_editor_animation_after_effect = __esm({
65833
+ "pptx/core/services/editor-animation-after-effect.ts"() {
65834
+ init_editor_animation_entry();
65835
+ init_animation_after_effect_write();
65836
+ init_animation_timing_tree();
65837
+ }
65838
+ });
65839
+
65510
65840
  // pptx/core/services/slide-name.ts
65511
65841
  function asNode3(value) {
65512
65842
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -65837,6 +66167,7 @@ var init_PptxSlideLoaderService = __esm({
65837
66167
  init_animation_target_reconcile();
65838
66168
  init_animation_timeline_anchors();
65839
66169
  init_native_animation_media_duration();
66170
+ init_editor_animation_after_effect();
65840
66171
  init_slide_name();
65841
66172
  init_slide_transition_envelope();
65842
66173
  PptxSlideLoaderService = class {
@@ -66048,6 +66379,8 @@ var init_PptxSlideLoaderService = __esm({
66048
66379
  }
66049
66380
  });
66050
66381
  reconcileAnimationTargets(elements2, nativeAnimations, animations, animationTimelineAnchors);
66382
+ animations ??= [];
66383
+ mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming);
66051
66384
  mergeNativeSoundIntoEditorAnimations(nativeAnimations, animations);
66052
66385
  mergeNativeBuildTemplatesIntoEditorAnimations(nativeAnimations, animations);
66053
66386
  applyHiddenFlagFromRawXml(elements2);
@@ -66390,6 +66723,7 @@ function sortOrder(animation) {
66390
66723
  var PptxEditorAnimationService;
66391
66724
  var init_PptxEditorAnimationService = __esm({
66392
66725
  "pptx/core/services/PptxEditorAnimationService.ts"() {
66726
+ init_editor_animation_after_effect();
66393
66727
  init_editor_animation_normalizers();
66394
66728
  init_editor_animation_trigger_meta();
66395
66729
  PptxEditorAnimationService = class {
@@ -66488,7 +66822,7 @@ var init_PptxEditorAnimationService = __esm({
66488
66822
  * @param animations - Editor animations to serialize.
66489
66823
  */
66490
66824
  applyEditorAnimations(slideNode, animations) {
66491
- const sequenced = [...animations].sort((left, right) => sortOrder(left) - sortOrder(right));
66825
+ const sequenced = animations.filter((entry2) => !isNativeAfterAnimationFallback(entry2)).sort((left, right) => sortOrder(left) - sortOrder(right));
66492
66826
  const sanitizedAnimations = sequenced.map((animation) => {
66493
66827
  const elementId = String(animation.elementId || "").trim();
66494
66828
  if (elementId.length === 0) {
@@ -66502,7 +66836,7 @@ var init_PptxEditorAnimationService = __esm({
66502
66836
  const orderIsTreeDerived = animation.orderFromTimeline !== void 0 && animation.order === animation.orderFromTimeline;
66503
66837
  const order = typeof animation.order === "number" && Number.isFinite(animation.order) && !orderIsTreeDerived ? Math.round(animation.order) : void 0;
66504
66838
  const repeatCount = typeof animation.repeatCount === "number" && Number.isFinite(animation.repeatCount) && animation.repeatCount > 0 ? animation.repeatCount : void 0;
66505
- if (!entrance && !exit2 && !emphasis && !animation.motionPath) {
66839
+ if (!entrance && !exit2 && !emphasis && !animation.motionPath && animation.afterAnimation === void 0) {
66506
66840
  return null;
66507
66841
  }
66508
66842
  return {
@@ -66936,121 +67270,6 @@ var init_native_animation_media_walk = __esm({
66936
67270
  }
66937
67271
  });
66938
67272
 
66939
- // pptx/core/services/animation-effect-filter-parsing.ts
66940
- function parseFilterToken(raw) {
66941
- const trimmed2 = raw.trim();
66942
- if (!trimmed2) {
66943
- return void 0;
66944
- }
66945
- const match = FILTER_TOKEN_RE.exec(trimmed2);
66946
- if (!match) {
66947
- return void 0;
66948
- }
66949
- const family = match[1].toLowerCase();
66950
- const subtypeToken = match[2];
66951
- const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
66952
- return { family, subtype };
66953
- }
66954
- function parseAnimEffectFilter(childTnList) {
66955
- if (!childTnList) {
66956
- return void 0;
66957
- }
66958
- const rawAnimEffect = childTnList["p:animEffect"];
66959
- const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
66960
- if (!animEffect || typeof animEffect !== "object") {
66961
- return void 0;
66962
- }
66963
- const node = animEffect;
66964
- const filterAttr = node["@_filter"];
66965
- if (filterAttr === void 0 || filterAttr === null) {
66966
- return void 0;
66967
- }
66968
- const raw = String(filterAttr);
66969
- const firstToken = raw.split(";")[0] ?? "";
66970
- const parsed = parseFilterToken(firstToken);
66971
- if (!parsed) {
66972
- return void 0;
66973
- }
66974
- const transitionAttr = node["@_transition"];
66975
- const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
66976
- return {
66977
- family: parsed.family,
66978
- subtype: parsed.subtype,
66979
- transition,
66980
- raw
66981
- };
66982
- }
66983
- var FILTER_TOKEN_RE;
66984
- var init_animation_effect_filter_parsing = __esm({
66985
- "pptx/core/services/animation-effect-filter-parsing.ts"() {
66986
- FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
66987
- }
66988
- });
66989
-
66990
- // pptx/core/services/native-animation-after-effect.ts
66991
- function hasAfterEffectFlag(cTn) {
66992
- const raw = cTn?.["@_afterEffect"];
66993
- return raw === "1" || raw === "true";
66994
- }
66995
- function extractSrgbHex(colorContainer) {
66996
- const srgb = colorContainer?.["a:srgbClr"];
66997
- const val = srgb?.["@_val"];
66998
- return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
66999
- }
67000
- function findDimBehaviour(subTnLst) {
67001
- for (const node of ensureArray10(subTnLst["p:animClr"])) {
67002
- const cBhvr = node["p:cBhvr"];
67003
- if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
67004
- continue;
67005
- }
67006
- if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
67007
- continue;
67008
- }
67009
- const toNode = node["p:to"];
67010
- const color2 = extractSrgbHex(toNode);
67011
- if (color2) {
67012
- return { action: "dimToColor", color: color2 };
67013
- }
67014
- const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
67015
- return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
67016
- }
67017
- return void 0;
67018
- }
67019
- function findHideBehaviour(subTnLst) {
67020
- for (const node of ensureArray10(subTnLst["p:set"])) {
67021
- const cBhvr = node["p:cBhvr"];
67022
- if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
67023
- continue;
67024
- }
67025
- const innerCTn = cBhvr?.["p:cTn"];
67026
- if (!hasAfterEffectFlag(innerCTn)) {
67027
- continue;
67028
- }
67029
- const toNode = node["p:to"];
67030
- const strVal = toNode?.["p:strVal"]?.["@_val"];
67031
- if (String(strVal ?? "").toLowerCase() !== "hidden") {
67032
- continue;
67033
- }
67034
- const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
67035
- return { action };
67036
- }
67037
- return void 0;
67038
- }
67039
- function extractAfterAnimationFromSubTnLst(cTn) {
67040
- const subTnLst = cTn["p:subTnLst"];
67041
- if (!subTnLst) {
67042
- return void 0;
67043
- }
67044
- return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
67045
- }
67046
- var init_native_animation_after_effect = __esm({
67047
- "pptx/core/services/native-animation-after-effect.ts"() {
67048
- init_theme_color_ref();
67049
- init_native_animation_attr_name();
67050
- init_native_animation_helpers();
67051
- }
67052
- });
67053
-
67054
67273
  // pptx/core/services/native-animation-cbhvr-attrs.ts
67055
67274
  function extractCBhvrAttrs(cBhvr) {
67056
67275
  if (!cBhvr) {
@@ -67127,59 +67346,6 @@ var init_native_animation_cbhvr_attrs = __esm({
67127
67346
  }
67128
67347
  });
67129
67348
 
67130
- // pptx/core/services/native-animation-attribute-components.ts
67131
- function extractBounceEndFraction(raw) {
67132
- if (raw === void 0) {
67133
- return void 0;
67134
- }
67135
- const parsed = Number(raw);
67136
- if (!Number.isFinite(parsed)) {
67137
- return void 0;
67138
- }
67139
- return Math.max(0, Math.min(1, parsed / 1e5));
67140
- }
67141
- function extractAttributeAnimations(childTnList) {
67142
- if (!childTnList) {
67143
- return void 0;
67144
- }
67145
- const components = [];
67146
- for (const node of ensureArray10(childTnList["p:anim"])) {
67147
- const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
67148
- const keyframes = extractKeyframes(node);
67149
- const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
67150
- const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
67151
- const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
67152
- const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
67153
- if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
67154
- continue;
67155
- }
67156
- const behavior = node["p:cBhvr"];
67157
- const cTn = behavior?.["p:cTn"];
67158
- const calcMode = normalizeCalcMode(node["@_calcmode"]);
67159
- const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
67160
- components.push({
67161
- attrName,
67162
- keyframes: keyframes ?? [],
67163
- durationMs: readTimingAttr(cTn?.["@_dur"]),
67164
- delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
67165
- ...calcMode ? { calcMode } : {},
67166
- ...from !== void 0 ? { from } : {},
67167
- ...to !== void 0 ? { to } : {},
67168
- ...by !== void 0 ? { by } : {},
67169
- ...bounceEnd !== void 0 ? { bounceEnd } : {}
67170
- });
67171
- }
67172
- return components.length > 0 ? components : void 0;
67173
- }
67174
- var init_native_animation_attribute_components = __esm({
67175
- "pptx/core/services/native-animation-attribute-components.ts"() {
67176
- init_native_animation_attr_name();
67177
- init_native_animation_cbhvr_attrs();
67178
- init_native_animation_extended_helpers();
67179
- init_native_animation_helpers();
67180
- }
67181
- });
67182
-
67183
67349
  // pptx/core/services/native-animation-behaviors.ts
67184
67350
  function attrText(raw) {
67185
67351
  if (raw === void 0 || raw === null) {
@@ -67199,6 +67365,16 @@ function readTiming(cTn) {
67199
67365
  return {};
67200
67366
  }
67201
67367
  const timing = {};
67368
+ const starts = ensureArray10(cTn["p:stCondLst"]?.["p:cond"]);
67369
+ if (starts.length > 1 || cTn["@_dur"] === "indefinite" || cTn["@_repeatCount"] === "indefinite" || cTn["@_repeatDur"] !== void 0 || cTn["p:endCondLst"] !== void 0 || cTn["p:endSync"] !== void 0 || starts.some(
67370
+ (condition) => condition === null || typeof condition !== "object" || condition["@_evt"] !== void 0 || condition["@_tn"] !== void 0 || condition["@_rtn"] !== void 0 || condition["p:tn"] !== void 0 || condition["p:rtn"] !== void 0 || condition["p:tgtEl"] !== void 0 || condition["@_delay"] !== void 0 && !/^\d+$/u.test(String(condition["@_delay"])) || condition["@_delay"] === "indefinite"
67371
+ )) {
67372
+ timing.unsupportedSetTiming = true;
67373
+ }
67374
+ const fill = cTn["@_fill"];
67375
+ if (fill === "remove" || fill === "freeze" || fill === "hold" || fill === "transition") {
67376
+ timing.fill = fill;
67377
+ }
67202
67378
  const durationMs = readTimingAttr(cTn["@_dur"]);
67203
67379
  if (durationMs !== void 0) {
67204
67380
  timing.durationMs = durationMs;
@@ -67371,6 +67547,210 @@ var init_native_animation_behaviors = __esm({
67371
67547
  }
67372
67548
  });
67373
67549
 
67550
+ // pptx/core/services/native-animation-visibility-timing.ts
67551
+ function hasNativeVisibilitySet(node) {
67552
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0") return false;
67553
+ const children15 = node["p:childTnLst"];
67554
+ if (!isXmlObject5(children15)) return false;
67555
+ return ensureArray10(children15["p:set"]).some((set2) => {
67556
+ const common = set2["p:cBhvr"];
67557
+ const list2 = isXmlObject5(common) ? common["p:attrNameLst"] : void 0;
67558
+ const names = isXmlObject5(list2) ? list2["p:attrName"] : void 0;
67559
+ return (Array.isArray(names) ? names : [names]).some(
67560
+ (name) => String(isXmlObject5(name) ? name["#text"] : name).trim().toLowerCase() === "style.visibility"
67561
+ );
67562
+ });
67563
+ }
67564
+ function simpleStarts(node, clickGate = false) {
67565
+ const list2 = node["p:stCondLst"];
67566
+ if (list2 === void 0) return true;
67567
+ if (!isXmlObject5(list2) || Object.keys(list2).some((key2) => key2 !== "p:cond")) return false;
67568
+ const conditions = ensureArray10(list2["p:cond"]);
67569
+ return conditions.length === 1 && conditions.every(
67570
+ (condition) => Object.keys(condition).every((key2) => key2 === "@_delay") && (condition["@_delay"] === void 0 || /^\d+$/u.test(String(condition["@_delay"])) && Number.isSafeInteger(Number(condition["@_delay"])) && Number(condition["@_delay"]) <= 2147483647 || clickGate && condition["@_delay"] === "indefinite")
67571
+ );
67572
+ }
67573
+ function unsupportedVisibilityContainerTiming(node) {
67574
+ if (node["@_presetClass"] !== void 0) return false;
67575
+ const structuralRoot = ["tmRoot", "mainSeq"].includes(String(node["@_nodeType"] ?? ""));
67576
+ return !neutralTiming(node) || !simpleStarts(node, true) || ensureArray10(isXmlObject5(node["p:stCondLst"]) ? node["p:stCondLst"]["p:cond"] : void 0).some(
67577
+ (condition) => /^\d+$/u.test(String(condition["@_delay"])) && Number(condition["@_delay"]) > 0
67578
+ ) || node["@_dur"] !== void 0 && !(structuralRoot && node["@_dur"] === "indefinite") || node["@_fill"] !== void 0 && node["@_fill"] !== "hold" || node["p:subTnLst"] !== void 0;
67579
+ }
67580
+ function extractVisibilitySetTiming(node) {
67581
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0" || String(node["@_presetSubtype"] ?? "0") !== "0" || node["@_dur"] !== void 0 || node["@_fill"] !== "hold" || !neutralTiming(node) || !simpleStarts(node))
67582
+ return void 0;
67583
+ const children15 = node["p:childTnLst"];
67584
+ if (!isXmlObject5(children15) || Object.keys(children15).length !== 1 || !children15["p:set"])
67585
+ return void 0;
67586
+ const sets = ensureArray10(children15["p:set"]);
67587
+ if (sets.length !== 1) return void 0;
67588
+ if (Object.keys(sets[0]).some((key2) => !["p:cBhvr", "p:to"].includes(key2))) return void 0;
67589
+ const to = sets[0]["p:to"];
67590
+ if (!isXmlObject5(to) || Object.keys(to).length !== 1 || !isXmlObject5(to["p:strVal"]) || Object.keys(to["p:strVal"]).some((key2) => key2 !== "@_val") || to["p:strVal"]["@_val"] !== "visible")
67591
+ return void 0;
67592
+ const common = sets[0]["p:cBhvr"];
67593
+ if (!isXmlObject5(common) || Object.keys(common).some(
67594
+ (key2) => !["p:cTn", "p:tgtEl", "p:attrNameLst", "@_additive"].includes(key2)
67595
+ ) || common["@_additive"] !== void 0 && !["base", "repl", "none"].includes(String(common["@_additive"])))
67596
+ return void 0;
67597
+ const target = common["p:tgtEl"];
67598
+ if (!isXmlObject5(target) || Object.keys(target).length !== 1 || !isXmlObject5(target["p:spTgt"]) || Object.keys(target["p:spTgt"]).some((key2) => key2 !== "@_spid") || !/^\d+$/u.test(String(target["p:spTgt"]["@_spid"])))
67599
+ return void 0;
67600
+ const child30 = common["p:cTn"];
67601
+ if (!isXmlObject5(child30) || !neutralTiming(child30) || !simpleStarts(child30) || String(child30["@_dur"]) !== "1" || child30["@_fill"] !== "hold")
67602
+ return void 0;
67603
+ const behavior = extractBehaviors(children15)?.[0];
67604
+ if (!behavior || behavior.kind !== "set" || behavior.value !== "visible" || behavior.attrNames.length !== 1 || behavior.attrNames[0] !== "style.visibility" || behavior.timing.unsupportedSetTiming)
67605
+ return void 0;
67606
+ try {
67607
+ assertAfterAnimationClearSupported(node);
67608
+ } catch {
67609
+ return void 0;
67610
+ }
67611
+ const sub = node["p:subTnLst"];
67612
+ if (sub !== void 0) {
67613
+ if (!isXmlObject5(sub)) return void 0;
67614
+ for (const [key2, raw] of Object.entries(sub)) {
67615
+ for (const value of ensureArray10(raw)) {
67616
+ if (!extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: value } }))
67617
+ return void 0;
67618
+ }
67619
+ }
67620
+ }
67621
+ const delayMs = behavior.timing.delayMs ?? 0;
67622
+ if (!Number.isSafeInteger(delayMs) || delayMs < 0 || delayMs >= 2147483647) return void 0;
67623
+ return { delayMs, durationMs: 1 };
67624
+ }
67625
+ var neutralTiming;
67626
+ var init_native_animation_visibility_timing = __esm({
67627
+ "pptx/core/services/native-animation-visibility-timing.ts"() {
67628
+ init_native_animation_behaviors();
67629
+ init_animation_after_effect_write();
67630
+ init_native_animation_after_effect();
67631
+ init_native_animation_helpers();
67632
+ neutralTiming = (node) => [
67633
+ "@_repeatDur",
67634
+ "@_tmFilter",
67635
+ "@_endSync",
67636
+ "@_evtFilter",
67637
+ "@_display",
67638
+ "@_masterRel",
67639
+ "@_syncBehavior",
67640
+ "@_nodePh",
67641
+ "@_progress",
67642
+ "@_p14:presetBounceEnd",
67643
+ "p:endCondLst",
67644
+ "p:endSync",
67645
+ "p:iterate"
67646
+ ].every((key2) => node[key2] === void 0) && (node["@_repeatCount"] === void 0 || String(node["@_repeatCount"]) === "1000") && (node["@_autoRev"] === void 0 || ["0", "false"].includes(String(node["@_autoRev"]))) && (node["@_spd"] === void 0 || String(node["@_spd"]) === "100000") && (node["@_accel"] === void 0 || String(node["@_accel"]) === "0") && (node["@_decel"] === void 0 || String(node["@_decel"]) === "0");
67647
+ }
67648
+ });
67649
+
67650
+ // pptx/core/services/animation-effect-filter-parsing.ts
67651
+ function parseFilterToken(raw) {
67652
+ const trimmed2 = raw.trim();
67653
+ if (!trimmed2) {
67654
+ return void 0;
67655
+ }
67656
+ const match = FILTER_TOKEN_RE.exec(trimmed2);
67657
+ if (!match) {
67658
+ return void 0;
67659
+ }
67660
+ const family = match[1].toLowerCase();
67661
+ const subtypeToken = match[2];
67662
+ const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
67663
+ return { family, subtype };
67664
+ }
67665
+ function parseAnimEffectFilter(childTnList) {
67666
+ if (!childTnList) {
67667
+ return void 0;
67668
+ }
67669
+ const rawAnimEffect = childTnList["p:animEffect"];
67670
+ const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
67671
+ if (!animEffect || typeof animEffect !== "object") {
67672
+ return void 0;
67673
+ }
67674
+ const node = animEffect;
67675
+ const filterAttr = node["@_filter"];
67676
+ if (filterAttr === void 0 || filterAttr === null) {
67677
+ return void 0;
67678
+ }
67679
+ const raw = String(filterAttr);
67680
+ const firstToken = raw.split(";")[0] ?? "";
67681
+ const parsed = parseFilterToken(firstToken);
67682
+ if (!parsed) {
67683
+ return void 0;
67684
+ }
67685
+ const transitionAttr = node["@_transition"];
67686
+ const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
67687
+ return {
67688
+ family: parsed.family,
67689
+ subtype: parsed.subtype,
67690
+ transition,
67691
+ raw
67692
+ };
67693
+ }
67694
+ var FILTER_TOKEN_RE;
67695
+ var init_animation_effect_filter_parsing = __esm({
67696
+ "pptx/core/services/animation-effect-filter-parsing.ts"() {
67697
+ FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
67698
+ }
67699
+ });
67700
+
67701
+ // pptx/core/services/native-animation-attribute-components.ts
67702
+ function extractBounceEndFraction(raw) {
67703
+ if (raw === void 0) {
67704
+ return void 0;
67705
+ }
67706
+ const parsed = Number(raw);
67707
+ if (!Number.isFinite(parsed)) {
67708
+ return void 0;
67709
+ }
67710
+ return Math.max(0, Math.min(1, parsed / 1e5));
67711
+ }
67712
+ function extractAttributeAnimations(childTnList) {
67713
+ if (!childTnList) {
67714
+ return void 0;
67715
+ }
67716
+ const components = [];
67717
+ for (const node of ensureArray10(childTnList["p:anim"])) {
67718
+ const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
67719
+ const keyframes = extractKeyframes(node);
67720
+ const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
67721
+ const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
67722
+ const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
67723
+ const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
67724
+ if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
67725
+ continue;
67726
+ }
67727
+ const behavior = node["p:cBhvr"];
67728
+ const cTn = behavior?.["p:cTn"];
67729
+ const calcMode = normalizeCalcMode(node["@_calcmode"]);
67730
+ const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
67731
+ components.push({
67732
+ attrName,
67733
+ keyframes: keyframes ?? [],
67734
+ durationMs: readTimingAttr(cTn?.["@_dur"]),
67735
+ delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
67736
+ ...calcMode ? { calcMode } : {},
67737
+ ...from !== void 0 ? { from } : {},
67738
+ ...to !== void 0 ? { to } : {},
67739
+ ...by !== void 0 ? { by } : {},
67740
+ ...bounceEnd !== void 0 ? { bounceEnd } : {}
67741
+ });
67742
+ }
67743
+ return components.length > 0 ? components : void 0;
67744
+ }
67745
+ var init_native_animation_attribute_components = __esm({
67746
+ "pptx/core/services/native-animation-attribute-components.ts"() {
67747
+ init_native_animation_attr_name();
67748
+ init_native_animation_cbhvr_attrs();
67749
+ init_native_animation_extended_helpers();
67750
+ init_native_animation_helpers();
67751
+ }
67752
+ });
67753
+
67374
67754
  // pptx/core/services/native-animation-child-timing.ts
67375
67755
  function isEnabled(value) {
67376
67756
  return value === true || value === 1 || value === "1" || value === "true";
@@ -67500,12 +67880,13 @@ function resolveNodeTrigger(cTn, currentTrigger) {
67500
67880
  }
67501
67881
  return trigger;
67502
67882
  }
67503
- function buildTimingNodeAnimation(cTn, trigger, group) {
67883
+ function buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor = false) {
67504
67884
  const presetClass = cTn["@_presetClass"];
67505
- const presetId = cTn["@_presetID"] ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
67885
+ const presetId = cTn["@_presetID"] !== void 0 ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
67506
67886
  const presetSubtype = cTn["@_presetSubtype"] !== void 0 ? Number.parseInt(String(cTn["@_presetSubtype"]), 10) : void 0;
67507
67887
  const childAutoReverseTiming = extractChildAutoReverseTiming(cTn, ensureArray10);
67508
- const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray10);
67888
+ const visibilitySetTiming = !unsupportedVisibilityAncestor && group.seqConcurrent === true && group.seqNextAction === "seek" && ["onClick", "withPrevious"].includes(trigger) ? extractVisibilitySetTiming(cTn) : void 0;
67889
+ const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray10) ?? (visibilitySetTiming ? visibilitySetTiming.delayMs + visibilitySetTiming.durationMs : void 0);
67509
67890
  const delayMs = readTimingAttr(cTn["@_delay"]) ?? extractStartConditionDelayMs(cTn);
67510
67891
  const accel = parseTimingPercentFraction(cTn["@_accel"]);
67511
67892
  const decel = parseTimingPercentFraction(cTn["@_decel"]);
@@ -67556,6 +67937,8 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
67556
67937
  presetId,
67557
67938
  presetSubtype,
67558
67939
  durationMs,
67940
+ visibilitySetTiming,
67941
+ unsupportedVisibilitySet: hasNativeVisibilitySet(cTn) && !visibilitySetTiming || void 0,
67559
67942
  delayMs,
67560
67943
  accel,
67561
67944
  decel,
@@ -67604,6 +67987,7 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
67604
67987
  commandString: cmdInfo2.commandString,
67605
67988
  textTarget: textTarget ?? void 0,
67606
67989
  cTnAttributes: roundTripAttrs,
67990
+ unsupportedOpacitySetTiming: cTn["@_dur"] === "indefinite" || cTn["p:endSync"] !== void 0 || void 0,
67607
67991
  afterEffect: afterEffectFlag,
67608
67992
  afterAnimationAction: parsedAfterAnimation?.action,
67609
67993
  afterAnimationColor: parsedAfterAnimation?.color,
@@ -67650,22 +68034,24 @@ var init_native_animation_timing_node_extract = __esm({
67650
68034
  init_native_animation_child_timing();
67651
68035
  init_native_animation_extended_helpers();
67652
68036
  init_native_animation_helpers();
68037
+ init_native_animation_visibility_timing();
67653
68038
  init_native_animation_set_components();
67654
68039
  }
67655
68040
  });
67656
68041
 
67657
68042
  // pptx/core/services/native-animation-timing-walk.ts
67658
- function walkTimingTree(node, animations, currentTrigger, group, ctx) {
68043
+ function walkTimingTree(node, animations, currentTrigger, group, ctx, unsupportedVisibilityAncestor = false) {
67659
68044
  if (!node) {
67660
68045
  return;
67661
68046
  }
67662
68047
  const cTn = node["p:cTn"];
67663
68048
  if (cTn) {
67664
68049
  const trigger = resolveNodeTrigger(cTn, currentTrigger);
67665
- const animation = buildTimingNodeAnimation(cTn, trigger, group);
68050
+ const animation = buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor);
67666
68051
  if (animation) {
67667
68052
  animations.push(animation);
67668
68053
  }
68054
+ const unsupportedChildVisibility = unsupportedVisibilityAncestor || unsupportedVisibilityContainerTiming(cTn);
67669
68055
  const childTnList = cTn["p:childTnLst"];
67670
68056
  if (childTnList) {
67671
68057
  const isClickLevel = isMainSequence(cTn);
@@ -67685,7 +68071,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
67685
68071
  id: String(mainSequenceId)
67686
68072
  } : void 0
67687
68073
  }),
67688
- ctx
68074
+ ctx,
68075
+ unsupportedChildVisibility
67689
68076
  );
67690
68077
  }
67691
68078
  for (const sequence of sequences) {
@@ -67693,11 +68080,18 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
67693
68080
  continue;
67694
68081
  }
67695
68082
  const seqAttrs = extractSeqAttrs(sequence);
67696
- walkTimingTree(sequence, animations, trigger, { ...group, ...seqAttrs }, ctx);
68083
+ walkTimingTree(
68084
+ sequence,
68085
+ animations,
68086
+ trigger,
68087
+ { ...group, ...seqAttrs },
68088
+ ctx,
68089
+ unsupportedChildVisibility
68090
+ );
67697
68091
  }
67698
68092
  for (const excl of exclusives) {
67699
68093
  const exclAnims = [];
67700
- walkTimingTree(excl, exclAnims, trigger, group, ctx);
68094
+ walkTimingTree(excl, exclAnims, trigger, group, ctx, true);
67701
68095
  const exclGroupId = ctx.allocateExclGroupId();
67702
68096
  for (const a of exclAnims) {
67703
68097
  a.exclusive = true;
@@ -67717,7 +68111,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
67717
68111
  childGroupContext(group, parallel["p:cTn"], {
67718
68112
  isClickLevelGroup: false
67719
68113
  }),
67720
- ctx
68114
+ ctx,
68115
+ unsupportedVisibilityAncestor
67721
68116
  );
67722
68117
  }
67723
68118
  for (const sequence of directSequences) {
@@ -67725,7 +68120,14 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
67725
68120
  continue;
67726
68121
  }
67727
68122
  const seqAttrs = extractSeqAttrs(sequence);
67728
- walkTimingTree(sequence, animations, currentTrigger, { ...group, ...seqAttrs }, ctx);
68123
+ walkTimingTree(
68124
+ sequence,
68125
+ animations,
68126
+ currentTrigger,
68127
+ { ...group, ...seqAttrs },
68128
+ ctx,
68129
+ unsupportedVisibilityAncestor
68130
+ );
67729
68131
  }
67730
68132
  }
67731
68133
  var init_native_animation_timing_walk = __esm({
@@ -67733,6 +68135,7 @@ var init_native_animation_timing_walk = __esm({
67733
68135
  init_animation_group_context();
67734
68136
  init_animation_timing_attrs();
67735
68137
  init_native_animation_helpers();
68138
+ init_native_animation_visibility_timing();
67736
68139
  init_native_animation_interactive_predicate();
67737
68140
  init_native_animation_timing_node_extract();
67738
68141
  }
@@ -68407,79 +68810,6 @@ var init_PptxSlideTransitionService = __esm({
68407
68810
  }
68408
68811
  });
68409
68812
 
68410
- // pptx/core/services/animation-after-effect-write.ts
68411
- function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
68412
- delete effectCTn["p:subTnLst"];
68413
- delete effectCTn["@_afterEffect"];
68414
- if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
68415
- effectCTn["p:subTnLst"] = buildDimSubTnLst(shapeId, anim.afterAnimationColor);
68416
- return;
68417
- }
68418
- if (anim.afterAnimation === "hideAfterAnimation") {
68419
- const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
68420
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "sameClick", entranceId);
68421
- return;
68422
- }
68423
- if (anim.afterAnimation === "hideOnNextClick") {
68424
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "nextClick");
68425
- }
68426
- }
68427
- function buildDimSubTnLst(shapeId, colorHex) {
68428
- const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
68429
- return {
68430
- "p:animClr": {
68431
- "@_clrSpc": "rgb",
68432
- "@_dir": "cw",
68433
- "p:cBhvr": {
68434
- "@_override": "childStyle",
68435
- "p:cTn": {
68436
- "@_dur": "1",
68437
- "@_fill": "hold",
68438
- "@_display": "0",
68439
- "@_masterRel": "nextClick",
68440
- "@_afterEffect": "1"
68441
- },
68442
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
68443
- "p:attrNameLst": { "p:attrName": "ppt_c" }
68444
- },
68445
- "p:to": { "a:srgbClr": { "@_val": hex3 } }
68446
- }
68447
- };
68448
- }
68449
- function buildHideSubTnLst(shapeId, masterRel, entranceId) {
68450
- const cTn = {
68451
- "@_dur": "1",
68452
- "@_fill": "hold",
68453
- "@_display": "0",
68454
- "@_masterRel": masterRel,
68455
- "@_afterEffect": "1"
68456
- };
68457
- if (masterRel === "sameClick") {
68458
- cTn["p:stCondLst"] = {
68459
- "p:cond": {
68460
- "@_evt": "end",
68461
- "@_delay": "0",
68462
- "p:tn": { "@_val": entranceId ?? "0" }
68463
- }
68464
- };
68465
- }
68466
- return {
68467
- "p:set": {
68468
- "p:cBhvr": {
68469
- "@_override": "childStyle",
68470
- "p:cTn": cTn,
68471
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
68472
- "p:attrNameLst": { "p:attrName": "style.visibility" }
68473
- },
68474
- "p:to": { "p:strVal": { "@_val": "hidden" } }
68475
- }
68476
- };
68477
- }
68478
- var init_animation_after_effect_write = __esm({
68479
- "pptx/core/services/animation-after-effect-write.ts"() {
68480
- }
68481
- });
68482
-
68483
68813
  // pptx/core/services/animation-behavior-captures.json
68484
68814
  var animation_behavior_captures_default;
68485
68815
  var init_animation_behavior_captures = __esm({
@@ -86694,6 +87024,33 @@ function updateEffectNodeAttributes(cTn, anim, presetClass, shapeId, allocateId)
86694
87024
  applySoundToEffectCTn(cTn, anim);
86695
87025
  }
86696
87026
  function surgicallyUpdateTimingTree(rawTiming, animations) {
87027
+ const sourceRefs = indexEffectNodes(rawTiming);
87028
+ for (const entry2 of animations.filter((animation) => animation.afterAnimation !== void 0)) {
87029
+ if (sourceRefs.filter(
87030
+ (ref) => ref.spid === entry2.elementId && ["entr", "emph"].includes(ref.presetClass)
87031
+ ).length > 1)
87032
+ throw new Error(
87033
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
87034
+ );
87035
+ }
87036
+ const explicitClears = new Map(
87037
+ animations.filter((a) => a.afterAnimation !== void 0 && !hasAuthoredAnimationEffect(a)).map((a) => [a.elementId, a])
87038
+ );
87039
+ const clearRefs = sourceRefs.filter(
87040
+ (ref) => ref.spid && explicitClears.has(ref.spid) && (ref.presetClass === "entr" || ref.presetClass === "emph")
87041
+ );
87042
+ for (const target of explicitClears.keys()) {
87043
+ if (!clearRefs.some((ref) => ref.spid === target))
87044
+ throw new Error("Cannot edit after-animation without a supported native effect");
87045
+ if (clearRefs.filter((ref) => ref.spid === target).length > 1)
87046
+ throw new Error(
87047
+ "Cannot clear an ambiguous native after-animation target with multiple effects"
87048
+ );
87049
+ }
87050
+ clearRefs.forEach((ref) => assertAfterAnimationClearSupported(ref.cTn));
87051
+ clearRefs.forEach(
87052
+ (ref) => applyAfterAnimationBehavior(ref.cTn, explicitClears.get(ref.spid), ref.spid)
87053
+ );
86697
87054
  const desired = collectDesiredEffects(animations);
86698
87055
  const previouslyOwned = readOwnedEffectKeys(rawTiming);
86699
87056
  if (desired.length === 0 && previouslyOwned.size === 0) {
@@ -86760,6 +87117,7 @@ function surgicallyUpdateTimingTree(rawTiming, animations) {
86760
87117
  }
86761
87118
  var init_animation_timing_surgical = __esm({
86762
87119
  "pptx/core/services/animation-timing-surgical.ts"() {
87120
+ init_editor_animation_entry();
86763
87121
  init_animation_after_effect_write();
86764
87122
  init_animation_behavior_captured();
86765
87123
  init_animation_timing_build_surgical();
@@ -86810,9 +87168,11 @@ var init_PptxAnimationWriteService = __esm({
86810
87168
  const validAnimations = animations.filter((a) => a.entrance || a.exit || a.emphasis || a.motionPath).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
86811
87169
  if (existingRawTiming) {
86812
87170
  const cloned = typeof structuredClone === "function" ? structuredClone(existingRawTiming) : JSON.parse(JSON.stringify(existingRawTiming));
86813
- return surgicallyUpdateTimingTree(cloned, validAnimations);
87171
+ return surgicallyUpdateTimingTree(cloned, animations);
86814
87172
  }
86815
87173
  if (validAnimations.length === 0) {
87174
+ if (animations.some((entry2) => entry2.afterAnimation !== void 0))
87175
+ throw new Error("Cannot edit after-animation without a supported native effect");
86816
87176
  return void 0;
86817
87177
  }
86818
87178
  this.nextId = 1;
@@ -102901,8 +103261,8 @@ function buildDefRPr(style, existing, resolveColor2) {
102901
103261
  return rPr;
102902
103262
  }
102903
103263
  function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveColor2) {
102904
- const hasAny = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
102905
- if (!hasAny) {
103264
+ const hasAny2 = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
103265
+ if (!hasAny2) {
102906
103266
  return;
102907
103267
  }
102908
103268
  const titleKey = findKey6(axisNode, "title", getLocalName2);
@@ -104756,8 +105116,8 @@ function applyRotationFlipToRawNode(node, rotation, flipH, flipV) {
104756
105116
  const spPrKey = findChildKey2(node, "spPr");
104757
105117
  const container2 = spPrKey ? node[spPrKey] ?? node : node;
104758
105118
  const xfrmKey = findChildKey2(container2, "xfrm");
104759
- const hasAny = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
104760
- if (!xfrmKey && !hasAny) {
105119
+ const hasAny2 = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
105120
+ if (!xfrmKey && !hasAny2) {
104761
105121
  return;
104762
105122
  }
104763
105123
  const xfrm = xfrmKey ? container2[xfrmKey] : {};
@@ -104792,24 +105152,24 @@ function hexVal(hex3) {
104792
105152
  }
104793
105153
  function buildRunProps(para) {
104794
105154
  const rPr = {};
104795
- let hasAny = false;
105155
+ let hasAny2 = false;
104796
105156
  if (para.fontSize !== void 0) {
104797
105157
  rPr["@_sz"] = String(Math.round(para.fontSize * 100));
104798
- hasAny = true;
105158
+ hasAny2 = true;
104799
105159
  }
104800
105160
  if (para.bold) {
104801
105161
  rPr["@_b"] = "1";
104802
- hasAny = true;
105162
+ hasAny2 = true;
104803
105163
  }
104804
105164
  if (para.italic) {
104805
105165
  rPr["@_i"] = "1";
104806
- hasAny = true;
105166
+ hasAny2 = true;
104807
105167
  }
104808
105168
  if (para.color) {
104809
105169
  rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hexVal(para.color) } };
104810
- hasAny = true;
105170
+ hasAny2 = true;
104811
105171
  }
104812
- return hasAny ? rPr : void 0;
105172
+ return hasAny2 ? rPr : void 0;
104813
105173
  }
104814
105174
  function buildParagraphNode(para) {
104815
105175
  const node = {};
@@ -106832,7 +107192,7 @@ var init_svg_stretch_fill = __esm({
106832
107192
 
106833
107193
  // pptx/core/core/runtime/image-a14-effects-model.ts
106834
107194
  function applyA14ExtensionToEffects(effects, a14) {
106835
- let hasAny = false;
107195
+ let hasAny2 = false;
106836
107196
  if (a14.artisticEffect !== void 0) {
106837
107197
  effects.artisticEffect = a14.artisticEffect;
106838
107198
  if (a14.originalImageRelId !== void 0) {
@@ -106844,15 +107204,15 @@ function applyA14ExtensionToEffects(effects, a14) {
106844
107204
  if (a14.artisticParams) {
106845
107205
  effects.artisticParams = a14.artisticParams;
106846
107206
  }
106847
- hasAny = true;
107207
+ hasAny2 = true;
106848
107208
  }
106849
107209
  if (a14.backgroundRemoval) {
106850
107210
  effects.backgroundRemoval = a14.backgroundRemoval;
106851
- hasAny = true;
107211
+ hasAny2 = true;
106852
107212
  }
106853
107213
  if (a14.originalImageRelId !== void 0) {
106854
107214
  effects.originalImageRelId = a14.originalImageRelId;
106855
- hasAny = true;
107215
+ hasAny2 = true;
106856
107216
  }
106857
107217
  const corrections = {};
106858
107218
  if (a14.sharpenSoften) {
@@ -106875,9 +107235,9 @@ function applyA14ExtensionToEffects(effects, a14) {
106875
107235
  if (a14.originalImageRelId !== void 0) {
106876
107236
  effects.prerenderedCorrections = corrections;
106877
107237
  }
106878
- hasAny = true;
107238
+ hasAny2 = true;
106879
107239
  }
106880
- return hasAny;
107240
+ return hasAny2;
106881
107241
  }
106882
107242
  var init_image_a14_effects_model = __esm({
106883
107243
  "pptx/core/core/runtime/image-a14-effects-model.ts"() {
@@ -108223,13 +108583,13 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108223
108583
  return null;
108224
108584
  }
108225
108585
  const effects = {};
108226
- let hasAny = false;
108586
+ let hasAny2 = false;
108227
108587
  const brightRaw = blip["@_bright"] ?? blip["@_brt"];
108228
108588
  if (brightRaw !== null) {
108229
108589
  const val = parseInt(String(brightRaw));
108230
108590
  if (Number.isFinite(val)) {
108231
108591
  effects.brightness = val / 1e3;
108232
- hasAny = true;
108592
+ hasAny2 = true;
108233
108593
  }
108234
108594
  }
108235
108595
  const contrastRaw = blip["@_contrast"] ?? blip["@_cont"];
@@ -108237,7 +108597,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108237
108597
  const val = parseInt(String(contrastRaw));
108238
108598
  if (Number.isFinite(val)) {
108239
108599
  effects.contrast = val / 1e3;
108240
- hasAny = true;
108600
+ hasAny2 = true;
108241
108601
  }
108242
108602
  }
108243
108603
  const colorEffects = parseImageColorEffects(
@@ -108247,12 +108607,12 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108247
108607
  );
108248
108608
  Object.assign(effects, colorEffects);
108249
108609
  if (Object.keys(colorEffects).length > 0) {
108250
- hasAny = true;
108610
+ hasAny2 = true;
108251
108611
  }
108252
108612
  const alphaEffects = parseImageAlphaEffects(blip, (node) => this.parseColor(node));
108253
108613
  Object.assign(effects, alphaEffects);
108254
108614
  if (Object.keys(alphaEffects).length > 0) {
108255
- hasAny = true;
108615
+ hasAny2 = true;
108256
108616
  }
108257
108617
  const lumNode = blip["a:lum"];
108258
108618
  if (lumNode) {
@@ -108272,7 +108632,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108272
108632
  }
108273
108633
  }
108274
108634
  effects.lum = lumEffect;
108275
- hasAny = true;
108635
+ hasAny2 = true;
108276
108636
  }
108277
108637
  const hslNode = blip["a:hsl"];
108278
108638
  if (hslNode) {
@@ -108299,7 +108659,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108299
108659
  }
108300
108660
  }
108301
108661
  effects.hsl = hslEffect;
108302
- hasAny = true;
108662
+ hasAny2 = true;
108303
108663
  }
108304
108664
  const tintNode = blip["a:tint"];
108305
108665
  if (tintNode) {
@@ -108319,7 +108679,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108319
108679
  }
108320
108680
  }
108321
108681
  effects.tint = tintEffect;
108322
- hasAny = true;
108682
+ hasAny2 = true;
108323
108683
  }
108324
108684
  const fillOverlay = blip["a:fillOverlay"];
108325
108685
  if (fillOverlay) {
@@ -108346,7 +108706,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108346
108706
  ...resolvedGradient ? { resolvedGradient } : {},
108347
108707
  ...resolvedPattern ? { resolvedPattern } : {}
108348
108708
  };
108349
- hasAny = true;
108709
+ hasAny2 = true;
108350
108710
  }
108351
108711
  const blurNode = blip["a:blur"];
108352
108712
  if (blurNode) {
@@ -108364,16 +108724,16 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
108364
108724
  blurEffect.grow = s === "1" || s === "true";
108365
108725
  }
108366
108726
  effects.blur = blurEffect;
108367
- hasAny = true;
108727
+ hasAny2 = true;
108368
108728
  }
108369
108729
  const extLst = xmlChild(blip, "a:extLst");
108370
108730
  if (extLst) {
108371
108731
  const a14 = parseA14ImageExtension(this.ensureArray(extLst["a:ext"]));
108372
108732
  if (a14 && applyA14ExtensionToEffects(effects, a14)) {
108373
- hasAny = true;
108733
+ hasAny2 = true;
108374
108734
  }
108375
108735
  }
108376
- return hasAny ? effects : null;
108736
+ return hasAny2 ? effects : null;
108377
108737
  }
108378
108738
  /**
108379
108739
  * Resolve a blip `a:fillOverlay/a:gradFill` to the structured gradient a
@@ -110026,8 +110386,8 @@ function buildTextRunEffectListXml(style, parseColor) {
110026
110386
  const hasTextHsl = typeof style.textHslHue === "number" || typeof style.textHslSaturation === "number" || typeof style.textHslLuminance === "number";
110027
110387
  const hasTextClrChange = Boolean(style.textClrChangeFrom) && Boolean(style.textClrChangeTo);
110028
110388
  const hasTextDuotone = Boolean(style.textDuotone);
110029
- const hasAny = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
110030
- if (!hasAny) {
110389
+ const hasAny2 = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
110390
+ if (!hasAny2) {
110031
110391
  return void 0;
110032
110392
  }
110033
110393
  const effectLst = {};
@@ -114340,6 +114700,87 @@ var init_table_column_width_save = __esm({
114340
114700
  }
114341
114701
  });
114342
114702
 
114703
+ // pptx/core/core/runtime/table-style-change-cell-clear.ts
114704
+ function normaliseStyleId(id) {
114705
+ const text2 = typeof id === "string" || typeof id === "number" ? String(id) : "";
114706
+ const trimmed2 = text2.trim().toUpperCase();
114707
+ if (!trimmed2) {
114708
+ return "";
114709
+ }
114710
+ return trimmed2.startsWith("{") ? trimmed2 : `{${trimmed2}}`;
114711
+ }
114712
+ function xmlTableStyleId(tblPr) {
114713
+ if (!tblPr || typeof tblPr !== "object") {
114714
+ return "";
114715
+ }
114716
+ const props = tblPr;
114717
+ const node = props["a:tableStyleId"];
114718
+ const spec = normaliseStyleId(
114719
+ node && typeof node === "object" ? node["#text"] : node
114720
+ );
114721
+ if (spec) {
114722
+ return spec;
114723
+ }
114724
+ const legacy = props["a:tblStyle"];
114725
+ return normaliseStyleId(legacy?.["@_val"] || props["@_tblStyle"]);
114726
+ }
114727
+ function tableStyleIdChanged(tblPr, nextStyleId) {
114728
+ if (nextStyleId === void 0) {
114729
+ return false;
114730
+ }
114731
+ return normaliseStyleId(nextStyleId) !== xmlTableStyleId(tblPr);
114732
+ }
114733
+ function clearCellFormattingForStyleChange(xmlCell, style) {
114734
+ const tcPr = xmlCell["a:tcPr"];
114735
+ if (!tcPr || typeof tcPr !== "object") {
114736
+ return;
114737
+ }
114738
+ const props = tcPr;
114739
+ if (!hasAny(style, FILL_FIELDS)) {
114740
+ for (const key2 of FILL_KEYS) {
114741
+ delete props[key2];
114742
+ }
114743
+ }
114744
+ for (const [key2, fields] of LINE_KEYS) {
114745
+ if (!hasAny(style, fields)) {
114746
+ delete props[key2];
114747
+ }
114748
+ }
114749
+ if (!style?.cell3D) {
114750
+ delete props["a:cell3D"];
114751
+ }
114752
+ }
114753
+ var FILL_KEYS, LINE_KEYS, FILL_FIELDS, hasAny;
114754
+ var init_table_style_change_cell_clear = __esm({
114755
+ "pptx/core/core/runtime/table-style-change-cell-clear.ts"() {
114756
+ FILL_KEYS = [
114757
+ "a:noFill",
114758
+ "a:solidFill",
114759
+ "a:gradFill",
114760
+ "a:blipFill",
114761
+ "a:pattFill",
114762
+ "a:grpFill"
114763
+ ];
114764
+ LINE_KEYS = [
114765
+ ["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
114766
+ ["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
114767
+ ["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
114768
+ ["a:lnB", ["borderBottomWidth", "borderBottomColor", "borderBottomDash"]],
114769
+ ["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
114770
+ ["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
114771
+ ];
114772
+ FILL_FIELDS = [
114773
+ "fillMode",
114774
+ "backgroundColor",
114775
+ "gradientFillStops",
114776
+ "patternFillPreset",
114777
+ "backgroundImageFillPath",
114778
+ "backgroundImageFillData"
114779
+ ];
114780
+ hasAny = (style, keys) => keys.some((key2) => style?.[key2] !== void 0);
114781
+ }
114782
+ });
114783
+
114343
114784
  // pptx/core/core/runtime/table-paragraph-save-order.ts
114344
114785
  function runTag(run) {
114345
114786
  return run.isLineBreak ? "a:br" : run.isField ? "a:fld" : "a:r";
@@ -114903,6 +115344,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
114903
115344
  init_PptxHandlerRuntimeChartUserShapes();
114904
115345
  init_save_table_merge_helpers();
114905
115346
  init_table_column_width_save();
115347
+ init_table_style_change_cell_clear();
114906
115348
  init_table_paragraph_save_order();
114907
115349
  init_table_structural_ops();
114908
115350
  init_table_tblpr_save();
@@ -114924,6 +115366,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
114924
115366
  if (!tbl) {
114925
115367
  return;
114926
115368
  }
115369
+ const styleChanged = tableData.clearDirectCellFormatting === true || tableStyleIdChanged(tbl["a:tblPr"], tableData.tableStyleId);
114927
115370
  serializeTablePropertyFlags(tbl, tableData);
114928
115371
  writeTablePropertiesOwnFillAndEffects(tbl["a:tblPr"], tableData);
114929
115372
  const xmlRows = this.ensureArray(tbl["a:tr"]);
@@ -114955,6 +115398,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
114955
115398
  if (cell.text !== void 0) {
114956
115399
  this.writeTableCellText(xmlCell, cell.text);
114957
115400
  }
115401
+ if (styleChanged) {
115402
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
115403
+ }
114958
115404
  if (cell.style) {
114959
115405
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
114960
115406
  }
@@ -114978,6 +115424,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
114978
115424
  if (cell.text !== void 0) {
114979
115425
  this.writeTableCellText(xmlCell, cell.text);
114980
115426
  }
115427
+ if (styleChanged) {
115428
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
115429
+ }
114981
115430
  if (cell.style) {
114982
115431
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
114983
115432
  }
@@ -125652,6 +126101,7 @@ var PptxHandlerRuntime60;
125652
126101
  var init_PptxHandlerRuntimeGeometryParsing = __esm({
125653
126102
  "pptx/core/core/runtime/PptxHandlerRuntimeGeometryParsing.ts"() {
125654
126103
  init_color_primitives();
126104
+ init_custom_geometry_command_order();
125655
126105
  init_custom_geometry_parser();
125656
126106
  init_guide_formula();
125657
126107
  init_PptxHandlerRuntimePlaceholderLookup();
@@ -125813,6 +126263,10 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
125813
126263
  const pathLst = custGeom["a:pathLst"];
125814
126264
  if (isNonEmpty(pathLst)) {
125815
126265
  result.pathLstXml = pathLst;
126266
+ const pathCommandOrder = readPathListCommandOrder(pathLst);
126267
+ if (pathCommandOrder) {
126268
+ result.pathCommandOrder = pathCommandOrder;
126269
+ }
125816
126270
  }
125817
126271
  return Object.keys(result).length > 0 ? result : void 0;
125818
126272
  }
@@ -126723,7 +127177,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
126723
127177
  return void 0;
126724
127178
  }
126725
127179
  const locks = {};
126726
- let hasAny = false;
127180
+ let hasAny2 = false;
126727
127181
  const boolAttr2 = (attr6) => {
126728
127182
  const raw = spLocks[attr6];
126729
127183
  if (raw === void 0) {
@@ -126736,7 +127190,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
126736
127190
  const val = boolAttr2(attr6);
126737
127191
  if (val !== void 0) {
126738
127192
  fn(val);
126739
- hasAny = true;
127193
+ hasAny2 = true;
126740
127194
  }
126741
127195
  };
126742
127196
  set2("@_noGrp", (v) => {
@@ -126775,7 +127229,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
126775
127229
  set2("@_noCrop", (v) => {
126776
127230
  locks.noCrop = v;
126777
127231
  });
126778
- return hasAny ? locks : void 0;
127232
+ return hasAny2 ? locks : void 0;
126779
127233
  }
126780
127234
  /**
126781
127235
  * Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
@@ -127064,6 +127518,36 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
127064
127518
  )
127065
127519
  );
127066
127520
  const pPr = this.mergeXmlObjects(lstStyleParagraphDefaults, directPPr);
127521
+ if (!textStyle.inheritedParagraphSpacing) {
127522
+ textStyle.inheritedParagraphSpacing = {};
127523
+ for (let spacingLevel = 0; spacingLevel < 9; spacingLevel++) {
127524
+ const key2 = `a:lvl${spacingLevel + 1}pPr`;
127525
+ const defaults = this.mergeXmlObjects(
127526
+ this.mergeXmlObjects(
127527
+ inheritedLstStyle?.["a:defPPr"],
127528
+ inheritedLstStyle?.[key2]
127529
+ ),
127530
+ this.mergeXmlObjects(
127531
+ ownLstStyle?.["a:defPPr"],
127532
+ ownLstStyle?.[key2]
127533
+ )
127534
+ );
127535
+ const inherited = this.mergeXmlObjects(
127536
+ defaults,
127537
+ inheritedParagraph?.["a:pPr"]
127538
+ );
127539
+ const spacing = this.extractParagraphOwnProperties({ "a:pPr": inherited }, textStyle.fontSize) ?? {};
127540
+ const phLevel = ctx.effectiveLevelStyles?.[spacingLevel];
127541
+ const phBase = ctx.effectiveLevelStyles?.[-1];
127542
+ if (phLevel) this.applyPlaceholderLevelDefaults(spacing, phLevel);
127543
+ if (phBase) this.applyPlaceholderLevelDefaults(spacing, phBase);
127544
+ textStyle.inheritedParagraphSpacing[spacingLevel] = {
127545
+ paragraphSpacingBefore: spacing.paragraphSpacingBefore ?? 0,
127546
+ paragraphSpacingAfter: spacing.paragraphSpacingAfter ?? 0,
127547
+ ...spacing.lineSpacingExactPt !== void 0 ? { lineSpacingExactPt: spacing.lineSpacingExactPt } : { lineSpacing: spacing.lineSpacing ?? 1 }
127548
+ };
127549
+ }
127550
+ }
127067
127551
  const paragraphRtl = this.parseOptionalBooleanAttr(pPr?.["@_rtl"]);
127068
127552
  if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
127069
127553
  textStyle.rtl = paragraphRtl;
@@ -135403,13 +135887,15 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
135403
135887
  });
135404
135888
 
135405
135889
  // pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
135406
- var PptxHandlerRuntime96;
135890
+ var XSD_INT_MIN, XSD_INT_MAX, PptxHandlerRuntime96;
135407
135891
  var init_PptxHandlerRuntimePresentationStructure = __esm({
135408
135892
  "pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts"() {
135409
135893
  init_kinsoku_parser();
135410
135894
  init_presentation_section_parser();
135411
135895
  init_header_footer_parts();
135412
135896
  init_PptxHandlerRuntimeChartParsing();
135897
+ XSD_INT_MIN = -2147483648;
135898
+ XSD_INT_MAX = 2147483647;
135413
135899
  PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
135414
135900
  parseEditorAnimations(slideXml3) {
135415
135901
  return this.editorAnimationService.parseEditorAnimations(slideXml3);
@@ -135592,6 +136078,22 @@ var init_PptxHandlerRuntimePresentationStructure = __esm({
135592
136078
  const lexical = String(raw).trim().toLowerCase();
135593
136079
  return lexical !== "0" && lexical !== "false";
135594
136080
  }
136081
+ /**
136082
+ * Extract `p:presentation/@firstSlideNum` (ECMA-376 §19.2.1.26, an
136083
+ * `xsd:int`). `undefined` when absent, not an integer, or outside the
136084
+ * `xsd:int` range (-2147483648 to 2147483647, which also rejects digit
136085
+ * strings too long to parse), so the spec default (`1`) is never forced
136086
+ * onto the typed model.
136087
+ */
136088
+ extractFirstSlideNumber() {
136089
+ const pres = this.presentationData?.["p:presentation"];
136090
+ const lexical = String(pres?.["@_firstSlideNum"] ?? "").trim();
136091
+ if (!/^[+-]?\d+$/.test(lexical)) {
136092
+ return void 0;
136093
+ }
136094
+ const value = Number(lexical);
136095
+ return value >= XSD_INT_MIN && value <= XSD_INT_MAX ? value : void 0;
136096
+ }
135595
136097
  };
135596
136098
  }
135597
136099
  });
@@ -136262,7 +136764,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
136262
136764
  this.commentAuthorDetails.size > 0 ? Array.from(this.commentAuthorDetails.values()) : void 0
136263
136765
  ).withModernCommentAuthors(
136264
136766
  this.modernCommentAuthors.size > 0 ? Array.from(this.modernCommentAuthors.values()) : void 0
136265
- ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withDefaultTextStyle(defaultTextStyle).build();
136767
+ ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withFirstSlideNumber(this.extractFirstSlideNumber()).withDefaultTextStyle(defaultTextStyle).build();
136266
136768
  }
136267
136769
  /**
136268
136770
  * Walk the raw XML of every slide to find the highest numeric `@_id`
@@ -140612,7 +141114,10 @@ var init_PptxHandler = __esm({
140612
141114
  const imported = deserializePptxFromJson(text2);
140613
141115
  const blankBytes = await buildBlankPresentationArchive({
140614
141116
  width: imported.widthEmu,
140615
- height: imported.heightEmu
141117
+ height: imported.heightEmu,
141118
+ // Saving writes presentation.xml from the loaded archive, not from
141119
+ // the overlaid model, so the archive must carry the value itself.
141120
+ firstSlideNumber: imported.firstSlideNumber
140616
141121
  });
140617
141122
  const base = await super.load(blankBytes, options);
140618
141123
  return applyImportedPptxData(base, imported);