ooxml-core 1.9.0 → 1.10.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 (126) hide show
  1. package/dist/PptxHandler-5UURGJEV.mjs +2 -0
  2. package/dist/{PptxHandler-EX4WBIQQ.mjs → PptxHandler-ADEFY476.mjs} +2 -2
  3. package/dist/PptxHandler-U5XB2HUE.cjs +11 -0
  4. package/dist/automation/index.cjs +744 -192
  5. package/dist/automation/index.mjs +744 -192
  6. package/dist/{chunk-SWF7KVL5.cjs → chunk-3N6XMMTT.cjs} +1365 -1062
  7. package/dist/{chunk-FIELY5PI.mjs → chunk-5NVJN4E6.mjs} +30 -2
  8. package/dist/{chunk-IGOA57LE.mjs → chunk-A6P7G3UK.mjs} +1 -1
  9. package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
  10. package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
  11. package/dist/{chunk-OXHMZS7B.mjs → chunk-CCHYFCPD.mjs} +649 -172
  12. package/dist/{chunk-OB277ZGE.mjs → chunk-R6KSBNKX.mjs} +27 -1
  13. package/dist/{chunk-AT66SA5M.cjs → chunk-S6DOCMQC.cjs} +28 -0
  14. package/dist/{chunk-WSO4T2LJ.mjs → chunk-WUE5ZHU3.mjs} +26 -3
  15. package/dist/{chunk-LCS3J3QI.mjs → chunk-ZE53K7DH.mjs} +474 -171
  16. package/dist/{chunk-M76PHYRR.mjs → chunk-ZOUGMAZG.mjs} +1 -1
  17. package/dist/docx/layout/adapt-table.d.ts +2 -2
  18. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  19. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  20. package/dist/docx/layout/index.cjs +477 -75
  21. package/dist/docx/layout/index.mjs +477 -76
  22. package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
  23. package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
  24. package/dist/docx/layout/page-cursor.d.ts +2 -0
  25. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  26. package/dist/docx/layout/result.d.ts +13 -0
  27. package/dist/docx/layout/result.d.ts.map +1 -1
  28. package/dist/docx/layout/table-border-layout.d.ts +16 -0
  29. package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
  30. package/dist/docx/layout/table-cell-layout.d.ts +2 -1
  31. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  32. package/dist/docx/layout/table-content.d.ts +4 -0
  33. package/dist/docx/layout/table-content.d.ts.map +1 -0
  34. package/dist/docx/layout/table-footnotes.d.ts +5 -0
  35. package/dist/docx/layout/table-footnotes.d.ts.map +1 -1
  36. package/dist/docx/layout/table-frames.d.ts +4 -0
  37. package/dist/docx/layout/table-frames.d.ts.map +1 -0
  38. package/dist/docx/layout/table-layout.d.ts +8 -3
  39. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  40. package/dist/docx/layout/table-note-completion.d.ts +5 -0
  41. package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
  42. package/dist/docx/layout/table-note-stories.d.ts +6 -0
  43. package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
  44. package/dist/pptx/automation/index.cjs +535 -182
  45. package/dist/pptx/automation/index.d.ts +4 -4
  46. package/dist/pptx/automation/index.mjs +5 -5
  47. package/dist/pptx/chunks/{index-BZh-IMkN.d.ts → index-Cuxtr76Y.d.ts} +17 -3
  48. package/dist/pptx/chunks/index-Cuxtr76Y.d.ts.map +1 -0
  49. package/dist/pptx/chunks/{index-B4cnSPNz.d.ts → index-DUCGeZh7.d.ts} +65 -5
  50. package/dist/pptx/chunks/index-DUCGeZh7.d.ts.map +1 -0
  51. package/dist/pptx/chunks/{smart-art-Q2kZQtHh.d.ts → smart-art-D-sXa_Nb.d.ts} +11 -1
  52. package/dist/pptx/chunks/smart-art-D-sXa_Nb.d.ts.map +1 -0
  53. package/dist/pptx/chunks/{text-operations-BLodkuXE.d.ts → text-operations-BqHmLaLA.d.ts} +26 -2
  54. package/dist/pptx/chunks/text-operations-BqHmLaLA.d.ts.map +1 -0
  55. package/dist/pptx/cli/index.cjs +535 -182
  56. package/dist/pptx/cli/index.d.ts +1 -1
  57. package/dist/pptx/cli/index.mjs +4 -4
  58. package/dist/pptx/converter/index.cjs +1 -0
  59. package/dist/pptx/converter/index.d.ts +1 -1
  60. package/dist/pptx/converter/index.mjs +2 -2
  61. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
  62. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
  63. package/dist/pptx/editor/render/find-replace.cjs +18 -18
  64. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  65. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  66. package/dist/pptx/editor/render/remap-text.cjs +2 -2
  67. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  68. package/dist/pptx/editor/render/remap-text.mjs +1 -1
  69. package/dist/pptx/editor/render/slide-operations.cjs +8 -8
  70. package/dist/pptx/editor/render/slide-operations.mjs +2 -2
  71. package/dist/pptx/index.cjs +762 -182
  72. package/dist/pptx/index.d.ts +5 -5
  73. package/dist/pptx/index.mjs +5 -5
  74. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  75. package/dist/teams/index.cjs +486 -114
  76. package/dist/teams/index.mjs +486 -114
  77. package/dist/visio/date-cache.d.ts +3 -0
  78. package/dist/visio/date-cache.d.ts.map +1 -0
  79. package/dist/visio/edit-text-field.d.ts.map +1 -1
  80. package/dist/visio/index.cjs +131 -22
  81. package/dist/visio/index.mjs +131 -22
  82. package/dist/visio/shape-metadata.d.ts.map +1 -1
  83. package/dist/visio/text-field-display.d.ts.map +1 -1
  84. package/dist/visio/text-field-fraction.d.ts +3 -0
  85. package/dist/visio/text-field-fraction.d.ts.map +1 -0
  86. package/dist/visio/text-field-numeric.d.ts +1 -1
  87. package/dist/visio/text-field-numeric.d.ts.map +1 -1
  88. package/dist/visio/text-field-system-date.d.ts +4 -0
  89. package/dist/visio/text-field-system-date.d.ts.map +1 -0
  90. package/dist/visio/text-fields.d.ts +1 -0
  91. package/dist/visio/text-fields.d.ts.map +1 -1
  92. package/dist/visio/ui/index.cjs +132 -22
  93. package/dist/visio/ui/index.mjs +132 -22
  94. package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
  95. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  96. package/dist/xlsx/index.cjs +614 -170
  97. package/dist/xlsx/index.mjs +614 -170
  98. package/dist/xlsx/load/index.cjs +575 -163
  99. package/dist/xlsx/load/index.mjs +575 -163
  100. package/dist/xlsx/model-pivots.d.ts +23 -2
  101. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  102. package/dist/xlsx/pivot/admission.d.ts.map +1 -1
  103. package/dist/xlsx/pivot/aggregate.d.ts +3 -1
  104. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  105. package/dist/xlsx/pivot/data.d.ts +1 -1
  106. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  107. package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
  108. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
  109. package/dist/xlsx/pivot/hierarchy.d.ts +2 -4
  110. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
  111. package/dist/xlsx/pivot/measures.d.ts +13 -0
  112. package/dist/xlsx/pivot/measures.d.ts.map +1 -0
  113. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  114. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  115. package/dist/xlsx/pivot/values-axis.d.ts +9 -0
  116. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
  117. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  118. package/dist/xlsx/ui/index.cjs +547 -127
  119. package/dist/xlsx/ui/index.mjs +547 -127
  120. package/package.json +1 -1
  121. package/dist/PptxHandler-AT7FVG5Q.mjs +0 -2
  122. package/dist/PptxHandler-VFSCECPL.cjs +0 -11
  123. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +0 -1
  124. package/dist/pptx/chunks/index-BZh-IMkN.d.ts.map +0 -1
  125. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
  126. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +0 -1
@@ -1010,6 +1010,7 @@ var init_presentation_field_keys = __esm({
1010
1010
  modernCommentAuthors: true,
1011
1011
  conformance: true,
1012
1012
  embedTrueTypeFonts: true,
1013
+ firstSlideNumber: true,
1013
1014
  defaultTextStyle: true
1014
1015
  };
1015
1016
  exports.PRESENTATION_FIELD_NAMES = Object.keys(exports.PRESENTATION_FIELD_KEYS);
@@ -1537,6 +1538,32 @@ function inheritCustomGeometryCommandOrder(target, ...sources) {
1537
1538
  }
1538
1539
  }
1539
1540
  }
1541
+ function pathListPaths(pathLst) {
1542
+ if (!pathLst || typeof pathLst !== "object") {
1543
+ return [];
1544
+ }
1545
+ return ensureArrayLocal(childByLocalName(pathLst, "path")).filter(
1546
+ (path2) => Boolean(path2) && typeof path2 === "object"
1547
+ );
1548
+ }
1549
+ function readPathListCommandOrder(pathLst) {
1550
+ const orders = pathListPaths(pathLst).map((path2) => [...commandOrder.get(path2) ?? []]);
1551
+ return orders.some((order) => order.length > 0) ? orders : void 0;
1552
+ }
1553
+ function restorePathListCommandOrder(pathLst, orders) {
1554
+ if (!orders || orders.length === 0) {
1555
+ return;
1556
+ }
1557
+ pathListPaths(pathLst).forEach((path2, index) => {
1558
+ const order = orders[index];
1559
+ if (!order || order.length === 0 || commandOrder.has(path2)) {
1560
+ return;
1561
+ }
1562
+ if (orderSignature([...order]) === pathSignature(path2)) {
1563
+ commandOrder.set(path2, [...order]);
1564
+ }
1565
+ });
1566
+ }
1540
1567
  function orderedXmlKey(baseName, order) {
1541
1568
  return `${baseName}${ORDER_SUFFIX}${order}`;
1542
1569
  }
@@ -4928,7 +4955,7 @@ function rootRelsXml() {
4928
4955
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
4929
4956
  </Relationships>`;
4930
4957
  }
4931
- function presentationXml(width, height, slideCount) {
4958
+ function presentationXml(width, height, slideCount, firstSlideNumber) {
4932
4959
  const slideIdBase = 256;
4933
4960
  const slideRIdBase = 6;
4934
4961
  const sldIdLst = slideCount > 0 ? ` <p:sldIdLst>
@@ -4937,6 +4964,7 @@ ${Array.from(
4937
4964
  (_, i2) => ` <p:sldId id="${slideIdBase + i2}" r:id="rId${slideRIdBase + i2}"/>`
4938
4965
  ).join("\n")}
4939
4966
  </p:sldIdLst>` : "";
4967
+ const firstSlideNum = firstSlideNumber === void 0 ? "" : ` firstSlideNum="${Math.trunc(firstSlideNumber)}"`;
4940
4968
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4941
4969
  <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
4942
4970
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
@@ -4944,7 +4972,7 @@ ${Array.from(
4944
4972
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
4945
4973
  xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
4946
4974
  xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"
4947
- saveSubsetFonts="1">
4975
+ saveSubsetFonts="1"${firstSlideNum}>
4948
4976
  <p:sldMasterIdLst>
4949
4977
  <p:sldMasterId id="2147483648" r:id="rId1"/>
4950
4978
  </p:sldMasterIdLst>
@@ -5181,7 +5209,10 @@ async function buildBlankPresentationArchive(options) {
5181
5209
  const zip = new JSZip17__default.default();
5182
5210
  zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
5183
5211
  zip.file("_rels/.rels", rootRelsXml());
5184
- zip.file("ppt/presentation.xml", presentationXml(width, height, initialSlideCount));
5212
+ zip.file(
5213
+ "ppt/presentation.xml",
5214
+ presentationXml(width, height, initialSlideCount, options?.firstSlideNumber)
5215
+ );
5185
5216
  zip.file("ppt/_rels/presentation.xml.rels", presentationRelsXml(layoutCount, initialSlideCount));
5186
5217
  zip.file("ppt/slideMasters/slideMaster1.xml", slideMasterXml(layoutCount));
5187
5218
  zip.file("ppt/slideMasters/_rels/slideMaster1.xml.rels", slideMasterRelsXml(layoutCount));
@@ -69823,6 +69854,7 @@ var init_custom_geometry_parser = __esm({
69823
69854
  // pptx/core/geometry/custom-geometry-live-eval.ts
69824
69855
  function pathNodesOf(rawData) {
69825
69856
  const pathLst = rawData?.pathLstXml;
69857
+ restorePathListCommandOrder(pathLst, rawData?.pathCommandOrder);
69826
69858
  return ensureArrayValue(pathLst?.["a:path"]);
69827
69859
  }
69828
69860
  function evaluateCustomGeometryPathData(rawData, pathWidth, pathHeight, overrides28) {
@@ -69871,6 +69903,7 @@ var init_custom_geometry_live_eval = __esm({
69871
69903
  "pptx/core/geometry/custom-geometry-live-eval.ts"() {
69872
69904
  init_utils();
69873
69905
  init_custom_geometry();
69906
+ init_custom_geometry_command_order();
69874
69907
  init_custom_geometry_guides();
69875
69908
  init_custom_geometry_parser();
69876
69909
  init_guide_formula_paths();
@@ -78563,7 +78596,7 @@ function parseShapeLockNode(node, spec) {
78563
78596
  return void 0;
78564
78597
  }
78565
78598
  const locks = {};
78566
- let hasAny = false;
78599
+ let hasAny2 = false;
78567
78600
  for (const prop of spec.permitted) {
78568
78601
  const raw = node[LOCK_ATTRIBUTE[prop]];
78569
78602
  if (raw === void 0) {
@@ -78571,9 +78604,9 @@ function parseShapeLockNode(node, spec) {
78571
78604
  }
78572
78605
  const value = String(raw).trim().toLowerCase();
78573
78606
  locks[prop] = value === "1" || value === "true";
78574
- hasAny = true;
78607
+ hasAny2 = true;
78575
78608
  }
78576
- return hasAny ? locks : void 0;
78609
+ return hasAny2 ? locks : void 0;
78577
78610
  }
78578
78611
  var LOCK_ATTRIBUTE, MODELLED_ATTRIBUTES, CARRIED_WHEN_UNSET;
78579
78612
  var init_shape_lock_node = __esm({
@@ -79440,6 +79473,7 @@ var init_PptxLoadDataBuilder = __esm({
79440
79473
  modernCommentAuthors;
79441
79474
  conformance;
79442
79475
  embedTrueTypeFonts;
79476
+ firstSlideNumber;
79443
79477
  defaultTextStyle;
79444
79478
  withDimensions(width, height, widthEmu, heightEmu) {
79445
79479
  this.width = width;
@@ -79609,6 +79643,10 @@ var init_PptxLoadDataBuilder = __esm({
79609
79643
  this.embedTrueTypeFonts = embedTrueTypeFonts;
79610
79644
  return this;
79611
79645
  }
79646
+ withFirstSlideNumber(firstSlideNumber) {
79647
+ this.firstSlideNumber = firstSlideNumber;
79648
+ return this;
79649
+ }
79612
79650
  withDefaultTextStyle(defaultTextStyle) {
79613
79651
  this.defaultTextStyle = defaultTextStyle;
79614
79652
  return this;
@@ -79660,6 +79698,7 @@ var init_PptxLoadDataBuilder = __esm({
79660
79698
  modernCommentAuthors: this.modernCommentAuthors,
79661
79699
  conformance: this.conformance,
79662
79700
  embedTrueTypeFonts: this.embedTrueTypeFonts,
79701
+ firstSlideNumber: this.firstSlideNumber,
79663
79702
  defaultTextStyle: this.defaultTextStyle
79664
79703
  };
79665
79704
  }
@@ -83715,6 +83754,371 @@ var init_native_animation_media_duration = __esm({
83715
83754
  }
83716
83755
  });
83717
83756
 
83757
+ // pptx/core/services/editor-animation-entry.ts
83758
+ function hasAuthoredAnimationEffect(entry2) {
83759
+ return Boolean(
83760
+ [entry2.entrance, entry2.exit, entry2.emphasis].some((preset2) => preset2 && preset2 !== "none") || entry2.motionPath
83761
+ );
83762
+ }
83763
+ function hasAnimation(animations, elementId) {
83764
+ const entry2 = animationFor(animations, elementId);
83765
+ return Boolean(entry2 && (entry2.entrance || entry2.exit || entry2.emphasis || entry2.motionPath));
83766
+ }
83767
+ function animationFor(slideAnimations, elementId) {
83768
+ return slideAnimations.find((a) => a.elementId === elementId);
83769
+ }
83770
+ function upsert(anims, elementId, updater) {
83771
+ const idx = anims.findIndex((a) => a.elementId === elementId);
83772
+ if (idx >= 0) {
83773
+ const updated2 = updater({ ...anims[idx] });
83774
+ if (updated2 === null) {
83775
+ return anims.filter((a) => a.elementId !== elementId);
83776
+ }
83777
+ return anims.map((a, i2) => i2 === idx ? updated2 : a);
83778
+ }
83779
+ const created = {
83780
+ elementId,
83781
+ durationMs: exports.DEFAULT_ANIMATION_DURATION_MS,
83782
+ order: anims.length,
83783
+ trigger: exports.DEFAULT_ANIMATION_TRIGGER
83784
+ };
83785
+ const updated = updater(created);
83786
+ if (updated === null) {
83787
+ return [...anims];
83788
+ }
83789
+ return [...anims, updated];
83790
+ }
83791
+ exports.DEFAULT_ANIMATION_DURATION_MS = void 0; exports.DEFAULT_ANIMATION_TRIGGER = void 0;
83792
+ var init_editor_animation_entry = __esm({
83793
+ "pptx/core/services/editor-animation-entry.ts"() {
83794
+ exports.DEFAULT_ANIMATION_DURATION_MS = 500;
83795
+ exports.DEFAULT_ANIMATION_TRIGGER = "onClick";
83796
+ }
83797
+ });
83798
+
83799
+ // pptx/core/services/native-animation-after-effect.ts
83800
+ function hasAfterEffectFlag(cTn) {
83801
+ const raw = cTn?.["@_afterEffect"];
83802
+ return raw === "1" || raw === "true";
83803
+ }
83804
+ function extractSrgbHex(colorContainer) {
83805
+ const srgb = colorContainer?.["a:srgbClr"];
83806
+ const val = srgb?.["@_val"];
83807
+ return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
83808
+ }
83809
+ function findDimBehaviour(subTnLst) {
83810
+ for (const node of ensureArray11(subTnLst["p:animClr"])) {
83811
+ const cBhvr = node["p:cBhvr"];
83812
+ if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
83813
+ continue;
83814
+ }
83815
+ if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
83816
+ continue;
83817
+ }
83818
+ const toNode = node["p:to"];
83819
+ const color2 = extractSrgbHex(toNode);
83820
+ if (color2) {
83821
+ return { action: "dimToColor", color: color2 };
83822
+ }
83823
+ const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
83824
+ return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
83825
+ }
83826
+ return void 0;
83827
+ }
83828
+ function findHideBehaviour(subTnLst) {
83829
+ for (const node of ensureArray11(subTnLst["p:set"])) {
83830
+ const cBhvr = node["p:cBhvr"];
83831
+ if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
83832
+ continue;
83833
+ }
83834
+ const innerCTn = cBhvr?.["p:cTn"];
83835
+ if (!hasAfterEffectFlag(innerCTn)) {
83836
+ continue;
83837
+ }
83838
+ const toNode = node["p:to"];
83839
+ const strVal = toNode?.["p:strVal"]?.["@_val"];
83840
+ if (String(strVal ?? "").toLowerCase() !== "hidden") {
83841
+ continue;
83842
+ }
83843
+ const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
83844
+ return { action };
83845
+ }
83846
+ return void 0;
83847
+ }
83848
+ function extractAfterAnimationFromSubTnLst(cTn) {
83849
+ const subTnLst = cTn["p:subTnLst"];
83850
+ if (!subTnLst) {
83851
+ return void 0;
83852
+ }
83853
+ return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
83854
+ }
83855
+ var init_native_animation_after_effect = __esm({
83856
+ "pptx/core/services/native-animation-after-effect.ts"() {
83857
+ init_theme_color_ref();
83858
+ init_native_animation_attr_name();
83859
+ init_native_animation_helpers();
83860
+ }
83861
+ });
83862
+
83863
+ // pptx/core/services/animation-after-effect-write.ts
83864
+ function assertAfterAnimationClearSupported(effectCTn) {
83865
+ const shapeIds = /* @__PURE__ */ new Set();
83866
+ const checkTarget = (value) => {
83867
+ if (Array.isArray(value)) {
83868
+ value.forEach(checkTarget);
83869
+ return;
83870
+ }
83871
+ if (!isXmlObject5(value)) return;
83872
+ const shapeTarget = value["p:spTgt"];
83873
+ if (isXmlObject5(shapeTarget) && shapeTarget["@_spid"] !== void 0)
83874
+ shapeIds.add(String(shapeTarget["@_spid"]));
83875
+ if ([
83876
+ "p:bg",
83877
+ "p:txEl",
83878
+ "p:subSp",
83879
+ "p:graphicEl",
83880
+ "p:oleChartEl",
83881
+ "p:sndTgt",
83882
+ "p:inkTgt",
83883
+ "p:sldTgt"
83884
+ ].some((key2) => value[key2] !== void 0))
83885
+ throw new Error("Clearing after-animation supports whole-shape targets only");
83886
+ Object.values(value).forEach(checkTarget);
83887
+ };
83888
+ checkTarget(effectCTn["p:childTnLst"]);
83889
+ if (shapeIds.size > 1)
83890
+ throw new Error("Editing after-animation supports a single whole-shape target only");
83891
+ const sub = effectCTn["p:subTnLst"];
83892
+ if (!isXmlObject5(sub)) return;
83893
+ const countAfterFlags = (value) => {
83894
+ if (Array.isArray(value))
83895
+ return value.reduce((count, child30) => count + countAfterFlags(child30), 0);
83896
+ if (!isXmlObject5(value)) return 0;
83897
+ return Object.entries(value).reduce(
83898
+ (count, [key2, child30]) => count + (key2 === "@_afterEffect" && ["1", "true"].includes(String(child30)) ? 1 : countAfterFlags(child30)),
83899
+ 0
83900
+ );
83901
+ };
83902
+ for (const [key2, value] of Object.entries(sub)) {
83903
+ for (const node of ensureArray11(value)) {
83904
+ const flags = countAfterFlags(node);
83905
+ if (!flags) continue;
83906
+ if (flags !== 1 || !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } }))
83907
+ throw new Error("Cannot clear an unsupported native after-animation behavior");
83908
+ checkTarget(node);
83909
+ }
83910
+ }
83911
+ if (shapeIds.size > 1)
83912
+ throw new Error("Editing after-animation supports a single whole-shape target only");
83913
+ }
83914
+ function clearAfterAnimationBehavior(effectCTn) {
83915
+ const sub = effectCTn["p:subTnLst"];
83916
+ if (!isXmlObject5(sub)) return;
83917
+ for (const key2 of Object.keys(sub)) {
83918
+ const nodes = ensureArray11(sub[key2]);
83919
+ const remaining = nodes.filter(
83920
+ (node) => !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } })
83921
+ );
83922
+ if (remaining.length === nodes.length) continue;
83923
+ if (remaining.length === 0) delete sub[key2];
83924
+ else sub[key2] = remaining.length === 1 ? remaining[0] : remaining;
83925
+ }
83926
+ if (Object.keys(sub).length === 0) delete effectCTn["p:subTnLst"];
83927
+ }
83928
+ function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
83929
+ if (anim.afterAnimation === void 0) return;
83930
+ if (anim.afterAnimation === "none") {
83931
+ assertAfterAnimationClearSupported(effectCTn);
83932
+ clearAfterAnimationBehavior(effectCTn);
83933
+ return;
83934
+ }
83935
+ assertAfterAnimationClearSupported(effectCTn);
83936
+ clearAfterAnimationBehavior(effectCTn);
83937
+ delete effectCTn["@_afterEffect"];
83938
+ if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
83939
+ appendAfterAnimationBehavior(effectCTn, buildDimSubTnLst(shapeId, anim.afterAnimationColor));
83940
+ return;
83941
+ }
83942
+ if (anim.afterAnimation === "hideAfterAnimation") {
83943
+ const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
83944
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "sameClick", entranceId));
83945
+ return;
83946
+ }
83947
+ if (anim.afterAnimation === "hideOnNextClick") {
83948
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "nextClick"));
83949
+ }
83950
+ }
83951
+ function appendAfterAnimationBehavior(effect, addition) {
83952
+ const sub = isXmlObject5(effect["p:subTnLst"]) ? effect["p:subTnLst"] : {};
83953
+ for (const [key2, value] of Object.entries(addition)) {
83954
+ const nodes = [...ensureArray11(sub[key2]), ...ensureArray11(value)];
83955
+ sub[key2] = nodes.length === 1 ? nodes[0] : nodes;
83956
+ }
83957
+ effect["p:subTnLst"] = sub;
83958
+ }
83959
+ function buildDimSubTnLst(shapeId, colorHex) {
83960
+ const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
83961
+ return {
83962
+ "p:animClr": {
83963
+ "@_clrSpc": "rgb",
83964
+ "@_dir": "cw",
83965
+ "p:cBhvr": {
83966
+ "@_override": "childStyle",
83967
+ "p:cTn": {
83968
+ "@_dur": "1",
83969
+ "@_fill": "hold",
83970
+ "@_display": "0",
83971
+ "@_masterRel": "nextClick",
83972
+ "@_afterEffect": "1"
83973
+ },
83974
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
83975
+ "p:attrNameLst": { "p:attrName": "ppt_c" }
83976
+ },
83977
+ "p:to": { "a:srgbClr": { "@_val": hex3 } }
83978
+ }
83979
+ };
83980
+ }
83981
+ function buildHideSubTnLst(shapeId, masterRel, entranceId) {
83982
+ const cTn = {
83983
+ "@_dur": "1",
83984
+ "@_fill": "hold",
83985
+ "@_display": "0",
83986
+ "@_masterRel": masterRel,
83987
+ "@_afterEffect": "1"
83988
+ };
83989
+ if (masterRel === "sameClick") {
83990
+ cTn["p:stCondLst"] = {
83991
+ "p:cond": {
83992
+ "@_evt": "end",
83993
+ "@_delay": "0",
83994
+ "p:tn": { "@_val": entranceId ?? "0" }
83995
+ }
83996
+ };
83997
+ }
83998
+ return {
83999
+ "p:set": {
84000
+ "p:cBhvr": {
84001
+ "@_override": "childStyle",
84002
+ "p:cTn": cTn,
84003
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
84004
+ "p:attrNameLst": { "p:attrName": "style.visibility" }
84005
+ },
84006
+ "p:to": { "p:strVal": { "@_val": "hidden" } }
84007
+ }
84008
+ };
84009
+ }
84010
+ var init_animation_after_effect_write = __esm({
84011
+ "pptx/core/services/animation-after-effect-write.ts"() {
84012
+ init_native_animation_after_effect();
84013
+ init_native_animation_helpers();
84014
+ }
84015
+ });
84016
+
84017
+ // pptx/core/services/editor-animation-after-effect.ts
84018
+ function setAfterAnimation(anims, elementId, action) {
84019
+ return upsert(anims, elementId, (cur) => {
84020
+ const value = action;
84021
+ return {
84022
+ ...cur,
84023
+ afterAnimation: value,
84024
+ afterAnimationColor: value === "dimToColor" ? cur.afterAnimationColor ?? exports.DEFAULT_AFTER_ANIMATION_DIM_COLOR : void 0
84025
+ };
84026
+ });
84027
+ }
84028
+ function setAfterAnimationColor(anims, elementId, color2) {
84029
+ const entry2 = animationFor(anims, elementId);
84030
+ if (!entry2 || (entry2.afterAnimation ?? entry2.nativeAfterAnimation) !== "dimToColor") {
84031
+ return [...anims];
84032
+ }
84033
+ return upsert(anims, elementId, (cur) => ({
84034
+ ...cur,
84035
+ afterAnimation: "dimToColor",
84036
+ afterAnimationColor: color2
84037
+ }));
84038
+ }
84039
+ function getAfterAnimation(slideAnimations, elementId) {
84040
+ const entry2 = animationFor(slideAnimations, elementId);
84041
+ return entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
84042
+ }
84043
+ function getAfterAnimationState(entry2) {
84044
+ const action = entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
84045
+ return {
84046
+ action,
84047
+ color: action === "dimToColor" ? entry2?.afterAnimationColor ?? entry2?.nativeAfterAnimationColor : void 0,
84048
+ showColor: entry2?.afterAnimation !== void 0 || /^#[0-9a-f]{6}$/iu.test(entry2?.nativeAfterAnimationColor ?? "")
84049
+ };
84050
+ }
84051
+ function isNativeAfterAnimationOnly(entry2) {
84052
+ return Boolean(
84053
+ entry2?.nativeAfterAnimation && !entry2.entrance && !entry2.exit && !entry2.emphasis && !entry2.motionPath
84054
+ );
84055
+ }
84056
+ function mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming) {
84057
+ for (const native of nativeAnimations ?? []) {
84058
+ const existing = native.targetId ? animationFor(animations, native.targetId) : void 0;
84059
+ const action = native.afterAnimationAction ?? (existing?.afterAnimation !== void 0 ? "none" : void 0);
84060
+ if ((nativeAnimations ?? []).filter(
84061
+ (other) => other.targetId === native.targetId && ["entr", "emph"].includes(other.presetClass ?? "")
84062
+ ).length !== 1)
84063
+ continue;
84064
+ if (!native.targetId || !action || !["entr", "emph"].includes(native.presetClass ?? "") || native.textTarget)
84065
+ continue;
84066
+ if (native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
84067
+ continue;
84068
+ try {
84069
+ if (rawTiming && native.target?.type === "shape" && indexEffectNodes(rawTiming).filter(
84070
+ (ref) => ref.spid === (native.target?.type === "shape" ? native.target.shapeId : void 0) && ["entr", "emph"].includes(ref.presetClass)
84071
+ ).length !== 1)
84072
+ continue;
84073
+ const effect = rawTiming ? indexEffectNodes(rawTiming).find(
84074
+ (ref) => String(ref.cTn["@_id"]) === String(native.nodeId) && native.target?.type === "shape" && ref.spid === native.target.shapeId
84075
+ ) : void 0;
84076
+ if (rawTiming && !effect) continue;
84077
+ assertAfterAnimationClearSupported(
84078
+ effect?.cTn ?? { "p:subTnLst": native.cTnAttributes?.["p:subTnLst"] }
84079
+ );
84080
+ } catch {
84081
+ continue;
84082
+ }
84083
+ let entry2 = animationFor(animations, native.targetId);
84084
+ if (!entry2) {
84085
+ entry2 = { elementId: native.targetId };
84086
+ animations.push(entry2);
84087
+ }
84088
+ if (entry2.nativeAfterAnimation !== void 0) continue;
84089
+ entry2.nativeAfterAnimation = action;
84090
+ entry2.nativeAfterAnimationColor = native.afterAnimationColor;
84091
+ }
84092
+ }
84093
+ function isNativeAfterAnimationFallback(entry2) {
84094
+ return entry2.nativeAfterAnimation !== void 0 && Object.entries(entry2).every(
84095
+ ([key2, value]) => value === void 0 || [
84096
+ "elementId",
84097
+ "nativeAfterAnimation",
84098
+ "nativeAfterAnimationColor",
84099
+ "soundRId",
84100
+ "soundPath",
84101
+ "soundName",
84102
+ "stopSound"
84103
+ ].includes(key2)
84104
+ );
84105
+ }
84106
+ exports.AFTER_ANIMATION_VALUES = void 0; exports.DEFAULT_AFTER_ANIMATION_DIM_COLOR = void 0;
84107
+ var init_editor_animation_after_effect = __esm({
84108
+ "pptx/core/services/editor-animation-after-effect.ts"() {
84109
+ init_editor_animation_entry();
84110
+ init_animation_after_effect_write();
84111
+ init_animation_timing_tree();
84112
+ exports.AFTER_ANIMATION_VALUES = [
84113
+ "none",
84114
+ "dimToColor",
84115
+ "hideAfterAnimation",
84116
+ "hideOnNextClick"
84117
+ ];
84118
+ exports.DEFAULT_AFTER_ANIMATION_DIM_COLOR = "#808080";
84119
+ }
84120
+ });
84121
+
83718
84122
  // pptx/core/services/slide-name.ts
83719
84123
  function asNode3(value) {
83720
84124
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -84045,6 +84449,7 @@ var init_PptxSlideLoaderService = __esm({
84045
84449
  init_animation_target_reconcile();
84046
84450
  init_animation_timeline_anchors();
84047
84451
  init_native_animation_media_duration();
84452
+ init_editor_animation_after_effect();
84048
84453
  init_slide_name();
84049
84454
  init_slide_transition_envelope();
84050
84455
  exports.PptxSlideLoaderService = class {
@@ -84256,6 +84661,8 @@ var init_PptxSlideLoaderService = __esm({
84256
84661
  }
84257
84662
  });
84258
84663
  reconcileAnimationTargets(elements3, nativeAnimations, animations, animationTimelineAnchors);
84664
+ animations ??= [];
84665
+ mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming);
84259
84666
  mergeNativeSoundIntoEditorAnimations(nativeAnimations, animations);
84260
84667
  mergeNativeBuildTemplatesIntoEditorAnimations(nativeAnimations, animations);
84261
84668
  applyHiddenFlagFromRawXml(elements3);
@@ -84598,6 +85005,7 @@ function sortOrder(animation) {
84598
85005
  exports.PptxEditorAnimationService = void 0;
84599
85006
  var init_PptxEditorAnimationService = __esm({
84600
85007
  "pptx/core/services/PptxEditorAnimationService.ts"() {
85008
+ init_editor_animation_after_effect();
84601
85009
  init_editor_animation_normalizers();
84602
85010
  init_editor_animation_trigger_meta();
84603
85011
  exports.PptxEditorAnimationService = class {
@@ -84696,7 +85104,7 @@ var init_PptxEditorAnimationService = __esm({
84696
85104
  * @param animations - Editor animations to serialize.
84697
85105
  */
84698
85106
  applyEditorAnimations(slideNode, animations) {
84699
- const sequenced = [...animations].sort((left, right) => sortOrder(left) - sortOrder(right));
85107
+ const sequenced = animations.filter((entry2) => !isNativeAfterAnimationFallback(entry2)).sort((left, right) => sortOrder(left) - sortOrder(right));
84700
85108
  const sanitizedAnimations = sequenced.map((animation) => {
84701
85109
  const elementId = String(animation.elementId || "").trim();
84702
85110
  if (elementId.length === 0) {
@@ -84710,7 +85118,7 @@ var init_PptxEditorAnimationService = __esm({
84710
85118
  const orderIsTreeDerived = animation.orderFromTimeline !== void 0 && animation.order === animation.orderFromTimeline;
84711
85119
  const order = typeof animation.order === "number" && Number.isFinite(animation.order) && !orderIsTreeDerived ? Math.round(animation.order) : void 0;
84712
85120
  const repeatCount = typeof animation.repeatCount === "number" && Number.isFinite(animation.repeatCount) && animation.repeatCount > 0 ? animation.repeatCount : void 0;
84713
- if (!entrance && !exit3 && !emphasis && !animation.motionPath) {
85121
+ if (!entrance && !exit3 && !emphasis && !animation.motionPath && animation.afterAnimation === void 0) {
84714
85122
  return null;
84715
85123
  }
84716
85124
  return {
@@ -85195,70 +85603,6 @@ var init_animation_effect_filter_parsing = __esm({
85195
85603
  }
85196
85604
  });
85197
85605
 
85198
- // pptx/core/services/native-animation-after-effect.ts
85199
- function hasAfterEffectFlag(cTn) {
85200
- const raw = cTn?.["@_afterEffect"];
85201
- return raw === "1" || raw === "true";
85202
- }
85203
- function extractSrgbHex(colorContainer) {
85204
- const srgb = colorContainer?.["a:srgbClr"];
85205
- const val = srgb?.["@_val"];
85206
- return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
85207
- }
85208
- function findDimBehaviour(subTnLst) {
85209
- for (const node of ensureArray11(subTnLst["p:animClr"])) {
85210
- const cBhvr = node["p:cBhvr"];
85211
- if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
85212
- continue;
85213
- }
85214
- if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
85215
- continue;
85216
- }
85217
- const toNode = node["p:to"];
85218
- const color2 = extractSrgbHex(toNode);
85219
- if (color2) {
85220
- return { action: "dimToColor", color: color2 };
85221
- }
85222
- const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
85223
- return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
85224
- }
85225
- return void 0;
85226
- }
85227
- function findHideBehaviour(subTnLst) {
85228
- for (const node of ensureArray11(subTnLst["p:set"])) {
85229
- const cBhvr = node["p:cBhvr"];
85230
- if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
85231
- continue;
85232
- }
85233
- const innerCTn = cBhvr?.["p:cTn"];
85234
- if (!hasAfterEffectFlag(innerCTn)) {
85235
- continue;
85236
- }
85237
- const toNode = node["p:to"];
85238
- const strVal = toNode?.["p:strVal"]?.["@_val"];
85239
- if (String(strVal ?? "").toLowerCase() !== "hidden") {
85240
- continue;
85241
- }
85242
- const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
85243
- return { action };
85244
- }
85245
- return void 0;
85246
- }
85247
- function extractAfterAnimationFromSubTnLst(cTn) {
85248
- const subTnLst = cTn["p:subTnLst"];
85249
- if (!subTnLst) {
85250
- return void 0;
85251
- }
85252
- return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
85253
- }
85254
- var init_native_animation_after_effect = __esm({
85255
- "pptx/core/services/native-animation-after-effect.ts"() {
85256
- init_theme_color_ref();
85257
- init_native_animation_attr_name();
85258
- init_native_animation_helpers();
85259
- }
85260
- });
85261
-
85262
85606
  // pptx/core/services/native-animation-cbhvr-attrs.ts
85263
85607
  function extractCBhvrAttrs(cBhvr) {
85264
85608
  if (!cBhvr) {
@@ -85407,6 +85751,16 @@ function readTiming(cTn) {
85407
85751
  return {};
85408
85752
  }
85409
85753
  const timing = {};
85754
+ const starts = ensureArray11(cTn["p:stCondLst"]?.["p:cond"]);
85755
+ 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(
85756
+ (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"
85757
+ )) {
85758
+ timing.unsupportedSetTiming = true;
85759
+ }
85760
+ const fill = cTn["@_fill"];
85761
+ if (fill === "remove" || fill === "freeze" || fill === "hold" || fill === "transition") {
85762
+ timing.fill = fill;
85763
+ }
85410
85764
  const durationMs = readTimingAttr(cTn["@_dur"]);
85411
85765
  if (durationMs !== void 0) {
85412
85766
  timing.durationMs = durationMs;
@@ -85812,6 +86166,7 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
85812
86166
  commandString: cmdInfo.commandString,
85813
86167
  textTarget: textTarget ?? void 0,
85814
86168
  cTnAttributes: roundTripAttrs,
86169
+ unsupportedOpacitySetTiming: cTn["@_dur"] === "indefinite" || cTn["p:endSync"] !== void 0 || void 0,
85815
86170
  afterEffect: afterEffectFlag,
85816
86171
  afterAnimationAction: parsedAfterAnimation?.action,
85817
86172
  afterAnimationColor: parsedAfterAnimation?.color,
@@ -86615,79 +86970,6 @@ var init_PptxSlideTransitionService = __esm({
86615
86970
  }
86616
86971
  });
86617
86972
 
86618
- // pptx/core/services/animation-after-effect-write.ts
86619
- function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
86620
- delete effectCTn["p:subTnLst"];
86621
- delete effectCTn["@_afterEffect"];
86622
- if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
86623
- effectCTn["p:subTnLst"] = buildDimSubTnLst(shapeId, anim.afterAnimationColor);
86624
- return;
86625
- }
86626
- if (anim.afterAnimation === "hideAfterAnimation") {
86627
- const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
86628
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "sameClick", entranceId);
86629
- return;
86630
- }
86631
- if (anim.afterAnimation === "hideOnNextClick") {
86632
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "nextClick");
86633
- }
86634
- }
86635
- function buildDimSubTnLst(shapeId, colorHex) {
86636
- const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
86637
- return {
86638
- "p:animClr": {
86639
- "@_clrSpc": "rgb",
86640
- "@_dir": "cw",
86641
- "p:cBhvr": {
86642
- "@_override": "childStyle",
86643
- "p:cTn": {
86644
- "@_dur": "1",
86645
- "@_fill": "hold",
86646
- "@_display": "0",
86647
- "@_masterRel": "nextClick",
86648
- "@_afterEffect": "1"
86649
- },
86650
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
86651
- "p:attrNameLst": { "p:attrName": "ppt_c" }
86652
- },
86653
- "p:to": { "a:srgbClr": { "@_val": hex3 } }
86654
- }
86655
- };
86656
- }
86657
- function buildHideSubTnLst(shapeId, masterRel, entranceId) {
86658
- const cTn = {
86659
- "@_dur": "1",
86660
- "@_fill": "hold",
86661
- "@_display": "0",
86662
- "@_masterRel": masterRel,
86663
- "@_afterEffect": "1"
86664
- };
86665
- if (masterRel === "sameClick") {
86666
- cTn["p:stCondLst"] = {
86667
- "p:cond": {
86668
- "@_evt": "end",
86669
- "@_delay": "0",
86670
- "p:tn": { "@_val": entranceId ?? "0" }
86671
- }
86672
- };
86673
- }
86674
- return {
86675
- "p:set": {
86676
- "p:cBhvr": {
86677
- "@_override": "childStyle",
86678
- "p:cTn": cTn,
86679
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
86680
- "p:attrNameLst": { "p:attrName": "style.visibility" }
86681
- },
86682
- "p:to": { "p:strVal": { "@_val": "hidden" } }
86683
- }
86684
- };
86685
- }
86686
- var init_animation_after_effect_write = __esm({
86687
- "pptx/core/services/animation-after-effect-write.ts"() {
86688
- }
86689
- });
86690
-
86691
86973
  // pptx/core/services/animation-behavior-captures.json
86692
86974
  var animation_behavior_captures_default;
86693
86975
  var init_animation_behavior_captures = __esm({
@@ -104921,6 +105203,33 @@ function updateEffectNodeAttributes(cTn, anim, presetClass, shapeId, allocateId)
104921
105203
  applySoundToEffectCTn(cTn, anim);
104922
105204
  }
104923
105205
  function surgicallyUpdateTimingTree(rawTiming, animations) {
105206
+ const sourceRefs = indexEffectNodes(rawTiming);
105207
+ for (const entry2 of animations.filter((animation) => animation.afterAnimation !== void 0)) {
105208
+ if (sourceRefs.filter(
105209
+ (ref) => ref.spid === entry2.elementId && ["entr", "emph"].includes(ref.presetClass)
105210
+ ).length > 1)
105211
+ throw new Error(
105212
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
105213
+ );
105214
+ }
105215
+ const explicitClears = new Map(
105216
+ animations.filter((a) => a.afterAnimation !== void 0 && !hasAuthoredAnimationEffect(a)).map((a) => [a.elementId, a])
105217
+ );
105218
+ const clearRefs = sourceRefs.filter(
105219
+ (ref) => ref.spid && explicitClears.has(ref.spid) && (ref.presetClass === "entr" || ref.presetClass === "emph")
105220
+ );
105221
+ for (const target of explicitClears.keys()) {
105222
+ if (!clearRefs.some((ref) => ref.spid === target))
105223
+ throw new Error("Cannot edit after-animation without a supported native effect");
105224
+ if (clearRefs.filter((ref) => ref.spid === target).length > 1)
105225
+ throw new Error(
105226
+ "Cannot clear an ambiguous native after-animation target with multiple effects"
105227
+ );
105228
+ }
105229
+ clearRefs.forEach((ref) => assertAfterAnimationClearSupported(ref.cTn));
105230
+ clearRefs.forEach(
105231
+ (ref) => applyAfterAnimationBehavior(ref.cTn, explicitClears.get(ref.spid), ref.spid)
105232
+ );
104924
105233
  const desired = collectDesiredEffects(animations);
104925
105234
  const previouslyOwned = readOwnedEffectKeys(rawTiming);
104926
105235
  if (desired.length === 0 && previouslyOwned.size === 0) {
@@ -104987,6 +105296,7 @@ function surgicallyUpdateTimingTree(rawTiming, animations) {
104987
105296
  }
104988
105297
  var init_animation_timing_surgical = __esm({
104989
105298
  "pptx/core/services/animation-timing-surgical.ts"() {
105299
+ init_editor_animation_entry();
104990
105300
  init_animation_after_effect_write();
104991
105301
  init_animation_behavior_captured();
104992
105302
  init_animation_timing_build_surgical();
@@ -105037,9 +105347,11 @@ var init_PptxAnimationWriteService = __esm({
105037
105347
  const validAnimations = animations.filter((a) => a.entrance || a.exit || a.emphasis || a.motionPath).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
105038
105348
  if (existingRawTiming) {
105039
105349
  const cloned = typeof structuredClone === "function" ? structuredClone(existingRawTiming) : JSON.parse(JSON.stringify(existingRawTiming));
105040
- return surgicallyUpdateTimingTree(cloned, validAnimations);
105350
+ return surgicallyUpdateTimingTree(cloned, animations);
105041
105351
  }
105042
105352
  if (validAnimations.length === 0) {
105353
+ if (animations.some((entry2) => entry2.afterAnimation !== void 0))
105354
+ throw new Error("Cannot edit after-animation without a supported native effect");
105043
105355
  return void 0;
105044
105356
  }
105045
105357
  this.nextId = 1;
@@ -105225,6 +105537,121 @@ var init_animation_behavior_native = __esm({
105225
105537
  }
105226
105538
  });
105227
105539
 
105540
+ // pptx/core/services/editor-animation-after-effect-precedence.ts
105541
+ function applyAfterAnimationFromEditorList(nativeAnimations, editorAnimations) {
105542
+ if (!editorAnimations || editorAnimations.length === 0) {
105543
+ return [...nativeAnimations];
105544
+ }
105545
+ const byElement = /* @__PURE__ */ new Map();
105546
+ for (const ea of editorAnimations) {
105547
+ if (ea.afterAnimation !== void 0) {
105548
+ byElement.set(ea.elementId, ea);
105549
+ }
105550
+ }
105551
+ if (byElement.size === 0) {
105552
+ return [...nativeAnimations];
105553
+ }
105554
+ for (const [id, editor] of byElement) {
105555
+ const matches = nativeAnimations.filter(
105556
+ (native) => native.targetId === id && ["entr", "emph"].includes(native.presetClass ?? "")
105557
+ );
105558
+ if (matches.length > 1)
105559
+ throw new Error(
105560
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
105561
+ );
105562
+ if (matches.length === 0 && !hasAuthoredAnimationEffect(editor))
105563
+ throw new Error("Cannot edit after-animation without a supported native effect");
105564
+ for (const native of matches) {
105565
+ if (native.textTarget || native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
105566
+ throw new Error("Editing after-animation supports whole-shape targets only");
105567
+ assertAfterAnimationClearSupported({
105568
+ "p:subTnLst": native.cTnAttributes?.["p:subTnLst"]
105569
+ });
105570
+ }
105571
+ }
105572
+ return nativeAnimations.map((anim) => {
105573
+ if (!anim.targetId || !["entr", "emph"].includes(anim.presetClass ?? "")) {
105574
+ return anim;
105575
+ }
105576
+ const ea = byElement.get(anim.targetId);
105577
+ if (!ea) {
105578
+ return anim;
105579
+ }
105580
+ return {
105581
+ ...anim,
105582
+ afterAnimationAction: ea.afterAnimation === "none" ? void 0 : ea.afterAnimation,
105583
+ afterAnimationColor: ea.afterAnimationColor,
105584
+ // The editor's own model has no theme-colour-ref concept (it always
105585
+ // writes a concrete hex); clear a native scheme ref so a stale one
105586
+ // never survives an edit that overrides the colour.
105587
+ afterAnimationColorRef: void 0
105588
+ };
105589
+ });
105590
+ }
105591
+ var init_editor_animation_after_effect_precedence = __esm({
105592
+ "pptx/core/services/editor-animation-after-effect-precedence.ts"() {
105593
+ init_animation_after_effect_write();
105594
+ init_editor_animation_entry();
105595
+ }
105596
+ });
105597
+
105598
+ // pptx/core/services/animation-opacity-set.ts
105599
+ function resolveOpacitySet(anim) {
105600
+ if (anim.unsupportedOpacitySetTiming || anim.endConditions?.length || anim.rawEndCondLst !== void 0 || anim.cTnAttributes?.["@_tmFilter"] !== void 0 || anim.cTnAttributes?.["@_endSync"] !== void 0)
105601
+ return void 0;
105602
+ if (anim.afterAnimationAction !== void 0) return void 0;
105603
+ if (anim.target?.type === "shape" && (anim.target.backgroundOnly || anim.target.subShapeId || anim.target.graphicElement || anim.target.oleChartElement))
105604
+ return void 0;
105605
+ if (anim.textTarget || anim.target && anim.target.type !== "shape" || anim.trigger === "onHover")
105606
+ return void 0;
105607
+ if (anim.presetClass !== "emph" || anim.autoReverse || (anim.repeatCount ?? 1) !== 1 || anim.repeatDurMs !== void 0)
105608
+ return void 0;
105609
+ const behaviors = anim.behaviors;
105610
+ if (!behaviors?.length || behaviors.some(
105611
+ (b) => b.kind !== "set" && !(b.kind === "animEffect" && b.filter === "image" && (b.transition === void 0 || b.transition === "none"))
105612
+ ))
105613
+ return void 0;
105614
+ const sets = behaviors.filter((b) => b.kind === "set");
105615
+ if (sets.length !== 1) return void 0;
105616
+ const hints = behaviors.filter((b) => b.kind === "animEffect");
105617
+ if (hints.length > 1) return void 0;
105618
+ const hint = hints[0];
105619
+ if (hint && (hint.timing.unsupportedSetTiming || hint.timing.autoReverse || (hint.timing.repeatCount ?? 1) !== 1 || hint.timing.tmFilter !== void 0))
105620
+ return void 0;
105621
+ const set2 = sets[0];
105622
+ if (set2.attrNames.length !== 1 || set2.attrNames[0] !== "style.opacity" || set2.additive !== void 0 && !["base", "repl", "none"].includes(set2.additive))
105623
+ return void 0;
105624
+ const raw = set2.value;
105625
+ if (typeof raw !== "number" && (typeof raw !== "string" || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/u.test(raw.trim())))
105626
+ return void 0;
105627
+ const value = Number(raw);
105628
+ const { timing } = set2;
105629
+ if (timing.unsupportedSetTiming) return void 0;
105630
+ if (anim.fill === "transition" || timing.fill === "transition") return void 0;
105631
+ if (!Number.isFinite(value) || value < 0 || value > 1 || timing.autoReverse || (timing.repeatCount ?? 1) !== 1 || timing.tmFilter !== void 0)
105632
+ return void 0;
105633
+ const delayMs = timing.delayMs ?? 0;
105634
+ const durationMs = timing.durationMs;
105635
+ if (!Number.isFinite(delayMs) || delayMs < 0 || durationMs === void 0 || !Number.isFinite(durationMs) || durationMs < 0)
105636
+ return void 0;
105637
+ const effectDuration = anim.durationMs ?? delayMs + durationMs;
105638
+ if (!Number.isFinite(effectDuration) || effectDuration < delayMs || (anim.speedPct ?? 100) !== 100)
105639
+ return void 0;
105640
+ const holdEndState = holds(anim.fill) && holds(timing.fill);
105641
+ return {
105642
+ value,
105643
+ delayMs,
105644
+ durationMs: holds(timing.fill) ? effectDuration - delayMs : Math.min(durationMs, effectDuration - delayMs),
105645
+ holdEndState
105646
+ };
105647
+ }
105648
+ var holds;
105649
+ var init_animation_opacity_set = __esm({
105650
+ "pptx/core/services/animation-opacity-set.ts"() {
105651
+ holds = (fill) => fill === "hold" || fill === "freeze";
105652
+ }
105653
+ });
105654
+
105228
105655
  // pptx/core/services/index.ts
105229
105656
  var init_services = __esm({
105230
105657
  "pptx/core/services/index.ts"() {
@@ -105247,10 +105674,14 @@ var init_services = __esm({
105247
105674
  init_animation_behavior_native();
105248
105675
  init_animation_write_node_builders();
105249
105676
  init_animation_after_effect_write();
105677
+ init_editor_animation_entry();
105678
+ init_editor_animation_after_effect();
105679
+ init_editor_animation_after_effect_precedence();
105250
105680
  init_native_animation_after_effect();
105251
105681
  init_native_animation_helpers();
105252
105682
  init_animation_target_build_helpers();
105253
105683
  init_animation_effect_filter_parsing();
105684
+ init_animation_opacity_set();
105254
105685
  }
105255
105686
  });
105256
105687
 
@@ -121295,8 +121726,8 @@ function buildDefRPr(style, existing, resolveColor2) {
121295
121726
  return rPr;
121296
121727
  }
121297
121728
  function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveColor2) {
121298
- const hasAny = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
121299
- if (!hasAny) {
121729
+ const hasAny2 = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
121730
+ if (!hasAny2) {
121300
121731
  return;
121301
121732
  }
121302
121733
  const titleKey = findKey7(axisNode, "title", getLocalName2);
@@ -123150,8 +123581,8 @@ function applyRotationFlipToRawNode(node, rotation, flipH, flipV) {
123150
123581
  const spPrKey = findChildKey2(node, "spPr");
123151
123582
  const container2 = spPrKey ? node[spPrKey] ?? node : node;
123152
123583
  const xfrmKey = findChildKey2(container2, "xfrm");
123153
- const hasAny = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
123154
- if (!xfrmKey && !hasAny) {
123584
+ const hasAny2 = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
123585
+ if (!xfrmKey && !hasAny2) {
123155
123586
  return;
123156
123587
  }
123157
123588
  const xfrm = xfrmKey ? container2[xfrmKey] : {};
@@ -123186,24 +123617,24 @@ function hexVal(hex3) {
123186
123617
  }
123187
123618
  function buildRunProps(para) {
123188
123619
  const rPr = {};
123189
- let hasAny = false;
123620
+ let hasAny2 = false;
123190
123621
  if (para.fontSize !== void 0) {
123191
123622
  rPr["@_sz"] = String(Math.round(para.fontSize * 100));
123192
- hasAny = true;
123623
+ hasAny2 = true;
123193
123624
  }
123194
123625
  if (para.bold) {
123195
123626
  rPr["@_b"] = "1";
123196
- hasAny = true;
123627
+ hasAny2 = true;
123197
123628
  }
123198
123629
  if (para.italic) {
123199
123630
  rPr["@_i"] = "1";
123200
- hasAny = true;
123631
+ hasAny2 = true;
123201
123632
  }
123202
123633
  if (para.color) {
123203
123634
  rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hexVal(para.color) } };
123204
- hasAny = true;
123635
+ hasAny2 = true;
123205
123636
  }
123206
- return hasAny ? rPr : void 0;
123637
+ return hasAny2 ? rPr : void 0;
123207
123638
  }
123208
123639
  function buildParagraphNode(para) {
123209
123640
  const node = {};
@@ -125246,7 +125677,7 @@ var init_blob_url_to_data_url = __esm({
125246
125677
 
125247
125678
  // pptx/core/core/runtime/image-a14-effects-model.ts
125248
125679
  function applyA14ExtensionToEffects(effects, a14) {
125249
- let hasAny = false;
125680
+ let hasAny2 = false;
125250
125681
  if (a14.artisticEffect !== void 0) {
125251
125682
  effects.artisticEffect = a14.artisticEffect;
125252
125683
  if (a14.originalImageRelId !== void 0) {
@@ -125258,15 +125689,15 @@ function applyA14ExtensionToEffects(effects, a14) {
125258
125689
  if (a14.artisticParams) {
125259
125690
  effects.artisticParams = a14.artisticParams;
125260
125691
  }
125261
- hasAny = true;
125692
+ hasAny2 = true;
125262
125693
  }
125263
125694
  if (a14.backgroundRemoval) {
125264
125695
  effects.backgroundRemoval = a14.backgroundRemoval;
125265
- hasAny = true;
125696
+ hasAny2 = true;
125266
125697
  }
125267
125698
  if (a14.originalImageRelId !== void 0) {
125268
125699
  effects.originalImageRelId = a14.originalImageRelId;
125269
- hasAny = true;
125700
+ hasAny2 = true;
125270
125701
  }
125271
125702
  const corrections = {};
125272
125703
  if (a14.sharpenSoften) {
@@ -125289,9 +125720,9 @@ function applyA14ExtensionToEffects(effects, a14) {
125289
125720
  if (a14.originalImageRelId !== void 0) {
125290
125721
  effects.prerenderedCorrections = corrections;
125291
125722
  }
125292
- hasAny = true;
125723
+ hasAny2 = true;
125293
125724
  }
125294
- return hasAny;
125725
+ return hasAny2;
125295
125726
  }
125296
125727
  var init_image_a14_effects_model = __esm({
125297
125728
  "pptx/core/core/runtime/image-a14-effects-model.ts"() {
@@ -127562,13 +127993,13 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127562
127993
  return null;
127563
127994
  }
127564
127995
  const effects = {};
127565
- let hasAny = false;
127996
+ let hasAny2 = false;
127566
127997
  const brightRaw = blip["@_bright"] ?? blip["@_brt"];
127567
127998
  if (brightRaw !== null) {
127568
127999
  const val = parseInt(String(brightRaw));
127569
128000
  if (Number.isFinite(val)) {
127570
128001
  effects.brightness = val / 1e3;
127571
- hasAny = true;
128002
+ hasAny2 = true;
127572
128003
  }
127573
128004
  }
127574
128005
  const contrastRaw = blip["@_contrast"] ?? blip["@_cont"];
@@ -127576,7 +128007,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127576
128007
  const val = parseInt(String(contrastRaw));
127577
128008
  if (Number.isFinite(val)) {
127578
128009
  effects.contrast = val / 1e3;
127579
- hasAny = true;
128010
+ hasAny2 = true;
127580
128011
  }
127581
128012
  }
127582
128013
  const colorEffects = parseImageColorEffects(
@@ -127586,12 +128017,12 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127586
128017
  );
127587
128018
  Object.assign(effects, colorEffects);
127588
128019
  if (Object.keys(colorEffects).length > 0) {
127589
- hasAny = true;
128020
+ hasAny2 = true;
127590
128021
  }
127591
128022
  const alphaEffects = parseImageAlphaEffects(blip, (node) => this.parseColor(node));
127592
128023
  Object.assign(effects, alphaEffects);
127593
128024
  if (Object.keys(alphaEffects).length > 0) {
127594
- hasAny = true;
128025
+ hasAny2 = true;
127595
128026
  }
127596
128027
  const lumNode = blip["a:lum"];
127597
128028
  if (lumNode) {
@@ -127611,7 +128042,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127611
128042
  }
127612
128043
  }
127613
128044
  effects.lum = lumEffect;
127614
- hasAny = true;
128045
+ hasAny2 = true;
127615
128046
  }
127616
128047
  const hslNode = blip["a:hsl"];
127617
128048
  if (hslNode) {
@@ -127638,7 +128069,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127638
128069
  }
127639
128070
  }
127640
128071
  effects.hsl = hslEffect;
127641
- hasAny = true;
128072
+ hasAny2 = true;
127642
128073
  }
127643
128074
  const tintNode = blip["a:tint"];
127644
128075
  if (tintNode) {
@@ -127658,7 +128089,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127658
128089
  }
127659
128090
  }
127660
128091
  effects.tint = tintEffect;
127661
- hasAny = true;
128092
+ hasAny2 = true;
127662
128093
  }
127663
128094
  const fillOverlay = blip["a:fillOverlay"];
127664
128095
  if (fillOverlay) {
@@ -127685,7 +128116,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127685
128116
  ...resolvedGradient ? { resolvedGradient } : {},
127686
128117
  ...resolvedPattern ? { resolvedPattern } : {}
127687
128118
  };
127688
- hasAny = true;
128119
+ hasAny2 = true;
127689
128120
  }
127690
128121
  const blurNode = blip["a:blur"];
127691
128122
  if (blurNode) {
@@ -127703,16 +128134,16 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
127703
128134
  blurEffect.grow = s === "1" || s === "true";
127704
128135
  }
127705
128136
  effects.blur = blurEffect;
127706
- hasAny = true;
128137
+ hasAny2 = true;
127707
128138
  }
127708
128139
  const extLst = xmlChild(blip, "a:extLst");
127709
128140
  if (extLst) {
127710
128141
  const a14 = parseA14ImageExtension(this.ensureArray(extLst["a:ext"]));
127711
128142
  if (a14 && applyA14ExtensionToEffects(effects, a14)) {
127712
- hasAny = true;
128143
+ hasAny2 = true;
127713
128144
  }
127714
128145
  }
127715
- return hasAny ? effects : null;
128146
+ return hasAny2 ? effects : null;
127716
128147
  }
127717
128148
  /**
127718
128149
  * Resolve a blip `a:fillOverlay/a:gradFill` to the structured gradient a
@@ -129365,8 +129796,8 @@ function buildTextRunEffectListXml(style, parseColor) {
129365
129796
  const hasTextHsl = typeof style.textHslHue === "number" || typeof style.textHslSaturation === "number" || typeof style.textHslLuminance === "number";
129366
129797
  const hasTextClrChange = Boolean(style.textClrChangeFrom) && Boolean(style.textClrChangeTo);
129367
129798
  const hasTextDuotone = Boolean(style.textDuotone);
129368
- const hasAny = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
129369
- if (!hasAny) {
129799
+ const hasAny2 = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
129800
+ if (!hasAny2) {
129370
129801
  return void 0;
129371
129802
  }
129372
129803
  const effectLst = {};
@@ -133717,6 +134148,87 @@ var init_table_column_width_save = __esm({
133717
134148
  }
133718
134149
  });
133719
134150
 
134151
+ // pptx/core/core/runtime/table-style-change-cell-clear.ts
134152
+ function normaliseStyleId(id) {
134153
+ const text2 = typeof id === "string" || typeof id === "number" ? String(id) : "";
134154
+ const trimmed2 = text2.trim().toUpperCase();
134155
+ if (!trimmed2) {
134156
+ return "";
134157
+ }
134158
+ return trimmed2.startsWith("{") ? trimmed2 : `{${trimmed2}}`;
134159
+ }
134160
+ function xmlTableStyleId(tblPr) {
134161
+ if (!tblPr || typeof tblPr !== "object") {
134162
+ return "";
134163
+ }
134164
+ const props = tblPr;
134165
+ const node = props["a:tableStyleId"];
134166
+ const spec = normaliseStyleId(
134167
+ node && typeof node === "object" ? node["#text"] : node
134168
+ );
134169
+ if (spec) {
134170
+ return spec;
134171
+ }
134172
+ const legacy = props["a:tblStyle"];
134173
+ return normaliseStyleId(legacy?.["@_val"] || props["@_tblStyle"]);
134174
+ }
134175
+ function tableStyleIdChanged(tblPr, nextStyleId) {
134176
+ if (nextStyleId === void 0) {
134177
+ return false;
134178
+ }
134179
+ return normaliseStyleId(nextStyleId) !== xmlTableStyleId(tblPr);
134180
+ }
134181
+ function clearCellFormattingForStyleChange(xmlCell, style) {
134182
+ const tcPr = xmlCell["a:tcPr"];
134183
+ if (!tcPr || typeof tcPr !== "object") {
134184
+ return;
134185
+ }
134186
+ const props = tcPr;
134187
+ if (!hasAny(style, FILL_FIELDS)) {
134188
+ for (const key2 of FILL_KEYS) {
134189
+ delete props[key2];
134190
+ }
134191
+ }
134192
+ for (const [key2, fields] of LINE_KEYS) {
134193
+ if (!hasAny(style, fields)) {
134194
+ delete props[key2];
134195
+ }
134196
+ }
134197
+ if (!style?.cell3D) {
134198
+ delete props["a:cell3D"];
134199
+ }
134200
+ }
134201
+ var FILL_KEYS, LINE_KEYS, FILL_FIELDS, hasAny;
134202
+ var init_table_style_change_cell_clear = __esm({
134203
+ "pptx/core/core/runtime/table-style-change-cell-clear.ts"() {
134204
+ FILL_KEYS = [
134205
+ "a:noFill",
134206
+ "a:solidFill",
134207
+ "a:gradFill",
134208
+ "a:blipFill",
134209
+ "a:pattFill",
134210
+ "a:grpFill"
134211
+ ];
134212
+ LINE_KEYS = [
134213
+ ["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
134214
+ ["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
134215
+ ["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
134216
+ ["a:lnB", ["borderBottomWidth", "borderBottomColor", "borderBottomDash"]],
134217
+ ["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
134218
+ ["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
134219
+ ];
134220
+ FILL_FIELDS = [
134221
+ "fillMode",
134222
+ "backgroundColor",
134223
+ "gradientFillStops",
134224
+ "patternFillPreset",
134225
+ "backgroundImageFillPath",
134226
+ "backgroundImageFillData"
134227
+ ];
134228
+ hasAny = (style, keys) => keys.some((key2) => style?.[key2] !== void 0);
134229
+ }
134230
+ });
134231
+
133720
134232
  // pptx/core/core/runtime/table-paragraph-save-order.ts
133721
134233
  function runTag(run) {
133722
134234
  return run.isLineBreak ? "a:br" : run.isField ? "a:fld" : "a:r";
@@ -134755,6 +135267,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
134755
135267
  init_PptxHandlerRuntimeChartUserShapes();
134756
135268
  init_save_table_merge_helpers();
134757
135269
  init_table_column_width_save();
135270
+ init_table_style_change_cell_clear();
134758
135271
  init_table_paragraph_save_order();
134759
135272
  init_table_structural_ops();
134760
135273
  init_table_tblpr_save();
@@ -134776,6 +135289,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
134776
135289
  if (!tbl) {
134777
135290
  return;
134778
135291
  }
135292
+ const styleChanged = tableData.clearDirectCellFormatting === true || tableStyleIdChanged(tbl["a:tblPr"], tableData.tableStyleId);
134779
135293
  serializeTablePropertyFlags(tbl, tableData);
134780
135294
  writeTablePropertiesOwnFillAndEffects(tbl["a:tblPr"], tableData);
134781
135295
  const xmlRows = this.ensureArray(tbl["a:tr"]);
@@ -134807,6 +135321,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
134807
135321
  if (cell.text !== void 0) {
134808
135322
  this.writeTableCellText(xmlCell, cell.text);
134809
135323
  }
135324
+ if (styleChanged) {
135325
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
135326
+ }
134810
135327
  if (cell.style) {
134811
135328
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
134812
135329
  }
@@ -134830,6 +135347,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
134830
135347
  if (cell.text !== void 0) {
134831
135348
  this.writeTableCellText(xmlCell, cell.text);
134832
135349
  }
135350
+ if (styleChanged) {
135351
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
135352
+ }
134833
135353
  if (cell.style) {
134834
135354
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
134835
135355
  }
@@ -145504,6 +146024,7 @@ var PptxHandlerRuntime60;
145504
146024
  var init_PptxHandlerRuntimeGeometryParsing = __esm({
145505
146025
  "pptx/core/core/runtime/PptxHandlerRuntimeGeometryParsing.ts"() {
145506
146026
  init_color_primitives();
146027
+ init_custom_geometry_command_order();
145507
146028
  init_custom_geometry_parser();
145508
146029
  init_guide_formula();
145509
146030
  init_PptxHandlerRuntimePlaceholderLookup();
@@ -145665,6 +146186,10 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
145665
146186
  const pathLst = custGeom["a:pathLst"];
145666
146187
  if (isNonEmpty(pathLst)) {
145667
146188
  result.pathLstXml = pathLst;
146189
+ const pathCommandOrder = readPathListCommandOrder(pathLst);
146190
+ if (pathCommandOrder) {
146191
+ result.pathCommandOrder = pathCommandOrder;
146192
+ }
145668
146193
  }
145669
146194
  return Object.keys(result).length > 0 ? result : void 0;
145670
146195
  }
@@ -146575,7 +147100,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
146575
147100
  return void 0;
146576
147101
  }
146577
147102
  const locks = {};
146578
- let hasAny = false;
147103
+ let hasAny2 = false;
146579
147104
  const boolAttr2 = (attr6) => {
146580
147105
  const raw = spLocks[attr6];
146581
147106
  if (raw === void 0) {
@@ -146588,7 +147113,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
146588
147113
  const val = boolAttr2(attr6);
146589
147114
  if (val !== void 0) {
146590
147115
  fn(val);
146591
- hasAny = true;
147116
+ hasAny2 = true;
146592
147117
  }
146593
147118
  };
146594
147119
  set2("@_noGrp", (v) => {
@@ -146627,7 +147152,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
146627
147152
  set2("@_noCrop", (v) => {
146628
147153
  locks.noCrop = v;
146629
147154
  });
146630
- return hasAny ? locks : void 0;
147155
+ return hasAny2 ? locks : void 0;
146631
147156
  }
146632
147157
  /**
146633
147158
  * Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
@@ -155255,13 +155780,15 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
155255
155780
  });
155256
155781
 
155257
155782
  // pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
155258
- var PptxHandlerRuntime96;
155783
+ var XSD_INT_MIN, XSD_INT_MAX, PptxHandlerRuntime96;
155259
155784
  var init_PptxHandlerRuntimePresentationStructure = __esm({
155260
155785
  "pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts"() {
155261
155786
  init_kinsoku_parser();
155262
155787
  init_presentation_section_parser();
155263
155788
  init_header_footer_parts();
155264
155789
  init_PptxHandlerRuntimeChartParsing();
155790
+ XSD_INT_MIN = -2147483648;
155791
+ XSD_INT_MAX = 2147483647;
155265
155792
  PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
155266
155793
  parseEditorAnimations(slideXml3) {
155267
155794
  return this.editorAnimationService.parseEditorAnimations(slideXml3);
@@ -155444,6 +155971,22 @@ var init_PptxHandlerRuntimePresentationStructure = __esm({
155444
155971
  const lexical = String(raw).trim().toLowerCase();
155445
155972
  return lexical !== "0" && lexical !== "false";
155446
155973
  }
155974
+ /**
155975
+ * Extract `p:presentation/@firstSlideNum` (ECMA-376 §19.2.1.26, an
155976
+ * `xsd:int`). `undefined` when absent, not an integer, or outside the
155977
+ * `xsd:int` range (-2147483648 to 2147483647, which also rejects digit
155978
+ * strings too long to parse), so the spec default (`1`) is never forced
155979
+ * onto the typed model.
155980
+ */
155981
+ extractFirstSlideNumber() {
155982
+ const pres = this.presentationData?.["p:presentation"];
155983
+ const lexical = String(pres?.["@_firstSlideNum"] ?? "").trim();
155984
+ if (!/^[+-]?\d+$/.test(lexical)) {
155985
+ return void 0;
155986
+ }
155987
+ const value = Number(lexical);
155988
+ return value >= XSD_INT_MIN && value <= XSD_INT_MAX ? value : void 0;
155989
+ }
155447
155990
  };
155448
155991
  }
155449
155992
  });
@@ -156114,7 +156657,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
156114
156657
  this.commentAuthorDetails.size > 0 ? Array.from(this.commentAuthorDetails.values()) : void 0
156115
156658
  ).withModernCommentAuthors(
156116
156659
  this.modernCommentAuthors.size > 0 ? Array.from(this.modernCommentAuthors.values()) : void 0
156117
- ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withDefaultTextStyle(defaultTextStyle).build();
156660
+ ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withFirstSlideNumber(this.extractFirstSlideNumber()).withDefaultTextStyle(defaultTextStyle).build();
156118
156661
  }
156119
156662
  /**
156120
156663
  * Walk the raw XML of every slide to find the highest numeric `@_id`
@@ -160536,7 +161079,10 @@ var init_PptxHandler = __esm({
160536
161079
  const imported = deserializePptxFromJson(text2);
160537
161080
  const blankBytes = await buildBlankPresentationArchive({
160538
161081
  width: imported.widthEmu,
160539
- height: imported.heightEmu
161082
+ height: imported.heightEmu,
161083
+ // Saving writes presentation.xml from the loaded archive, not from
161084
+ // the overlaid model, so the archive must carry the value itself.
161085
+ firstSlideNumber: imported.firstSlideNumber
160540
161086
  });
160541
161087
  const base = await super.load(blankBytes, options);
160542
161088
  return applyImportedPptxData(base, imported);
@@ -169801,6 +170347,29 @@ assign26(["presentation:attribute:embedTrueTypeFonts"], {
169801
170347
  )
169802
170348
  ]
169803
170349
  });
170350
+ assign26(["presentation:attribute:firstSlideNum"], {
170351
+ parse: "native",
170352
+ preserve: "native",
170353
+ edit: "unassessed",
170354
+ serialize: "unassessed",
170355
+ note: "`p:presentation/@firstSlideNum` is parsed onto `PptxData.firstSlideNumber` (absent or non-integer stays `undefined`, spec default 1) and the shared field substitution shows `firstSlideNumber + index` for `slidenum` fields. A save keeps the attribute because the loaded presentation.xml object is rewritten in place; there is no save option to change it.",
170356
+ evidence: [
170357
+ testEvidence(
170358
+ "src/__tests__/integration/presentation-first-slide-number.test.ts",
170359
+ [
170360
+ "is undefined (spec default: 1) when the attribute is absent",
170361
+ "parses an explicit @firstSlideNum onto the typed model",
170362
+ "accepts zero and ignores a value that is not an integer"
170363
+ ],
170364
+ ["parse"]
170365
+ ),
170366
+ testEvidence(
170367
+ "src/__tests__/integration/presentation-first-slide-number.test.ts",
170368
+ ["survives a save that rewrites presentation.xml and reloads as the same value"],
170369
+ ["preserve"]
170370
+ )
170371
+ ]
170372
+ });
169804
170373
  assign26(["presentation:element:smartTags", "presentation:complexType:CT_SmartTags"], {
169805
170374
  parse: "native",
169806
170375
  preserve: "native",
@@ -178355,8 +178924,10 @@ exports.addSmartArtNodeAsChild = addSmartArtNodeAsChild;
178355
178924
  exports.addTableStyleToMap = addTableStyleToMap;
178356
178925
  exports.algorithmParam = algorithmParam;
178357
178926
  exports.alphaLabel = alphaLabel;
178927
+ exports.animationFor = animationFor;
178358
178928
  exports.applyActiveXControlsToSlide = applyActiveXControlsToSlide;
178359
178929
  exports.applyAfterAnimationBehavior = applyAfterAnimationBehavior;
178930
+ exports.applyAfterAnimationFromEditorList = applyAfterAnimationFromEditorList;
178360
178931
  exports.applyBubbleChartOptions = applyBubbleChartOptions;
178361
178932
  exports.applyChartLayouts = applyChartLayouts;
178362
178933
  exports.applyChartManualLayout = applyChartManualLayout;
@@ -178583,6 +179154,8 @@ exports.generateMediaFilename = generateMediaFilename;
178583
179154
  exports.generateTableStyleGuid = generateTableStyleGuid;
178584
179155
  exports.getAdjustmentAwareClipPath = getAdjustmentAwareClipPath;
178585
179156
  exports.getAdjustmentAwareShapeClipPath = getAdjustmentAwareShapeClipPath;
179157
+ exports.getAfterAnimation = getAfterAnimation;
179158
+ exports.getAfterAnimationState = getAfterAnimationState;
178586
179159
  exports.getAnimationPresetInfo = getAnimationPresetInfo;
178587
179160
  exports.getCalloutLeaderLineGeometry = getCalloutLeaderLineGeometry;
178588
179161
  exports.getCalloutTier = getCalloutTier;
@@ -178636,6 +179209,7 @@ exports.groupElements = groupElements;
178636
179209
  exports.guidToKey = guidToKey;
178637
179210
  exports.guideEmuToPx = guideEmuToPx;
178638
179211
  exports.guidePxToEmu = guidePxToEmu;
179212
+ exports.hasAnimation = hasAnimation;
178639
179213
  exports.hasDirectSubstitution = hasDirectSubstitution;
178640
179214
  exports.hasNonTrivialOverride = hasNonTrivialOverride;
178641
179215
  exports.hasReference = hasReference;
@@ -178674,6 +179248,7 @@ exports.isImageLikeElement = isImageLikeElement;
178674
179248
  exports.isInkElement = isInkElement;
178675
179249
  exports.isLegacyPpt = isLegacyPpt;
178676
179250
  exports.isNamespaceSupported = isNamespaceSupported;
179251
+ exports.isNativeAfterAnimationOnly = isNativeAfterAnimationOnly;
178677
179252
  exports.isOle2CompoundFile = isOle2CompoundFile;
178678
179253
  exports.isParetoChartData = isParetoChartData;
178679
179254
  exports.isPptxJsonText = isPptxJsonText;
@@ -178700,6 +179275,7 @@ exports.lookupPresetShape = lookupPresetShape;
178700
179275
  exports.lookupPresetTextRectOverride = lookupPresetTextRectOverride;
178701
179276
  exports.mailMerge = mailMerge;
178702
179277
  exports.makeStoreAwareId = makeStoreAwareId;
179278
+ exports.mergeNativeAfterAnimationIntoEditorAnimations = mergeNativeAfterAnimationIntoEditorAnimations;
178703
179279
  exports.mergeNativeSoundIntoEditorAnimations = mergeNativeSoundIntoEditorAnimations;
178704
179280
  exports.mergePresentation = mergePresentation;
178705
179281
  exports.mergeShapes = mergeShapes;
@@ -178878,6 +179454,7 @@ exports.resolveModel3DMimeType = resolveModel3DMimeType;
178878
179454
  exports.resolveModifyVerifierAlgorithmName = resolveModifyVerifierAlgorithmName;
178879
179455
  exports.resolveOleEditorKindFromPayload = resolveOleEditorKindFromPayload;
178880
179456
  exports.resolveOoxmlPresetMapping = resolveOoxmlPresetMapping;
179457
+ exports.resolveOpacitySet = resolveOpacitySet;
178881
179458
  exports.resolveRatioConstraint = resolveRatioConstraint;
178882
179459
  exports.resolveReferenceUriToPart = resolveReferenceUriToPart;
178883
179460
  exports.resolveSmartArtEffectIntensity = resolveSmartArtEffectIntensity;
@@ -178902,6 +179479,8 @@ exports.serializeSlidePackageClipboard = serializeSlidePackageClipboard;
178902
179479
  exports.serializeSmartArtDefinitionHeaderList = serializeSmartArtDefinitionHeaderList;
178903
179480
  exports.serializeSvgPath = serializeSvgPath;
178904
179481
  exports.serializeTimeTargetElement = serializeTimeTargetElement;
179482
+ exports.setAfterAnimation = setAfterAnimation;
179483
+ exports.setAfterAnimationColor = setAfterAnimationColor;
178905
179484
  exports.setChartAreaFormat = setChartAreaFormat;
178906
179485
  exports.setChartAxis = setChartAxis;
178907
179486
  exports.setChartAxisGridlineStyle = setChartAxisGridlineStyle;
@@ -178988,6 +179567,7 @@ exports.updateChartUserShape = updateChartUserShape;
178988
179567
  exports.updateChartUserShapeAtPath = updateChartUserShapeAtPath;
178989
179568
  exports.updateMergeAttrsInRawXml = updateMergeAttrsInRawXml;
178990
179569
  exports.updateSmartArtNodeText = updateSmartArtNodeText;
179570
+ exports.upsert = upsert;
178991
179571
  exports.validatePptx = validatePptx;
178992
179572
  exports.validateSmartArtColorStyleLabels = validateSmartArtColorStyleLabels;
178993
179573
  exports.validateSmartArtConstraintRules = validateSmartArtConstraintRules;