ooxml-core 1.38.0 → 1.39.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 (150) hide show
  1. package/dist/{PptxHandler-3T5DTNKA.mjs → PptxHandler-5V74C7YX.mjs} +2 -2
  2. package/dist/PptxHandler-JB5M4AMY.mjs +5 -0
  3. package/dist/PptxHandler-TKVOVKAA.cjs +14 -0
  4. package/dist/{PresentationBuilder-HCMXZQDK.cjs → PresentationBuilder-GT6TO6XV.cjs} +6 -6
  5. package/dist/{PresentationBuilder-XHKNDJMD.mjs → PresentationBuilder-YHK53TGI.mjs} +2 -2
  6. package/dist/{PresentationBuilder-D6ZICJWN.mjs → PresentationBuilder-ZJMNMZIO.mjs} +3 -3
  7. package/dist/automation/index.cjs +21 -10
  8. package/dist/automation/index.mjs +21 -10
  9. package/dist/{chunk-XBIZIBTJ.mjs → chunk-4K3V66WE.mjs} +151 -61
  10. package/dist/{chunk-H2Q42P6P.mjs → chunk-5BVSDSJZ.mjs} +1 -1
  11. package/dist/{chunk-2TQJHNVU.mjs → chunk-6XAAJTA3.mjs} +274 -184
  12. package/dist/{chunk-GZOYXHDF.cjs → chunk-CEUG6BAS.cjs} +1271 -1268
  13. package/dist/{chunk-AFALJ5TA.cjs → chunk-EXSPNK6W.cjs} +3 -3
  14. package/dist/{chunk-J43V3QOA.mjs → chunk-I6XNVY5K.mjs} +144 -65
  15. package/dist/{chunk-CNIKTXAV.mjs → chunk-IW4ZVLRG.mjs} +1 -1
  16. package/dist/{chunk-4YBSHQ76.mjs → chunk-JAJ4HFKO.mjs} +7 -4
  17. package/dist/{chunk-RHQQS6LJ.mjs → chunk-RZ2FENDK.mjs} +7 -4
  18. package/dist/{chunk-SNID2FDY.cjs → chunk-SEGPDD5W.cjs} +274 -184
  19. package/dist/{chunk-OEM2ECAJ.mjs → chunk-X6O3L76X.mjs} +1 -1
  20. package/dist/collab/index.cjs +99 -0
  21. package/dist/collab/index.d.ts +1 -0
  22. package/dist/collab/index.d.ts.map +1 -1
  23. package/dist/collab/index.mjs +90 -1
  24. package/dist/collab/share.d.ts +66 -0
  25. package/dist/collab/share.d.ts.map +1 -0
  26. package/dist/color/index.cjs +31 -0
  27. package/dist/color/index.d.ts +1 -0
  28. package/dist/color/index.d.ts.map +1 -1
  29. package/dist/color/index.mjs +31 -1
  30. package/dist/color/straight-alpha-stops.d.ts +23 -0
  31. package/dist/color/straight-alpha-stops.d.ts.map +1 -0
  32. package/dist/diagram/index.cjs +15 -9
  33. package/dist/diagram/index.mjs +15 -9
  34. package/dist/docx/embedded.cjs +15 -9
  35. package/dist/docx/embedded.mjs +15 -9
  36. package/dist/docx/index.cjs +39 -14
  37. package/dist/docx/index.mjs +39 -14
  38. package/dist/docx/layout/index.cjs +15 -9
  39. package/dist/docx/layout/index.mjs +15 -9
  40. package/dist/docx/load/index.cjs +15 -9
  41. package/dist/docx/load/index.mjs +15 -9
  42. package/dist/docx/ui/index.cjs +15 -9
  43. package/dist/docx/ui/index.mjs +15 -9
  44. package/dist/embedding/cloud-files.d.ts +97 -0
  45. package/dist/embedding/cloud-files.d.ts.map +1 -0
  46. package/dist/embedding/index.cjs +7 -0
  47. package/dist/embedding/index.d.ts +1 -0
  48. package/dist/embedding/index.d.ts.map +1 -1
  49. package/dist/embedding/index.mjs +7 -1
  50. package/dist/embedding/onedrive/browse.d.ts +15 -0
  51. package/dist/embedding/onedrive/browse.d.ts.map +1 -0
  52. package/dist/embedding/onedrive/client.d.ts.map +1 -1
  53. package/dist/embedding/onedrive/index.cjs +364 -95
  54. package/dist/embedding/onedrive/index.d.ts +4 -1
  55. package/dist/embedding/onedrive/index.d.ts.map +1 -1
  56. package/dist/embedding/onedrive/index.mjs +363 -96
  57. package/dist/embedding/onedrive/provider.d.ts +27 -0
  58. package/dist/embedding/onedrive/provider.d.ts.map +1 -0
  59. package/dist/embedding/onedrive/requests.d.ts +6 -2
  60. package/dist/embedding/onedrive/requests.d.ts.map +1 -1
  61. package/dist/embedding/onedrive/transport.d.ts +2 -0
  62. package/dist/embedding/onedrive/transport.d.ts.map +1 -1
  63. package/dist/embedding/onedrive/types.d.ts +26 -2
  64. package/dist/embedding/onedrive/types.d.ts.map +1 -1
  65. package/dist/embedding/onedrive/upload.d.ts.map +1 -1
  66. package/dist/embedding/storage.d.ts +2 -2
  67. package/dist/embedding/storage.d.ts.map +1 -1
  68. package/dist/geometry/index.cjs +15 -9
  69. package/dist/geometry/index.mjs +15 -9
  70. package/dist/geometry/preset-shape-definitions-table.d.ts.map +1 -1
  71. package/dist/index.cjs +110 -23
  72. package/dist/index.mjs +109 -22
  73. package/dist/opc/diff-packages.d.ts +16 -0
  74. package/dist/opc/diff-packages.d.ts.map +1 -0
  75. package/dist/opc/index.cjs +51 -8
  76. package/dist/opc/index.d.ts +1 -0
  77. package/dist/opc/index.d.ts.map +1 -1
  78. package/dist/opc/index.mjs +50 -8
  79. package/dist/opc/merge-snapshots.d.ts.map +1 -1
  80. package/dist/pptx/automation/index.cjs +177 -52
  81. package/dist/pptx/automation/index.d.ts +1 -1
  82. package/dist/pptx/automation/index.mjs +5 -5
  83. package/dist/pptx/chunks/index-B4ofjG6_.d.ts.map +1 -1
  84. package/dist/pptx/chunks/{index-bgj0Ztnq.d.ts → index-CYukxWbl.d.ts} +12 -10
  85. package/dist/pptx/chunks/index-CYukxWbl.d.ts.map +1 -0
  86. package/dist/pptx/cli/index.cjs +177 -52
  87. package/dist/pptx/cli/index.mjs +4 -4
  88. package/dist/pptx/converter/index.cjs +22 -9
  89. package/dist/pptx/converter/index.mjs +2 -2
  90. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  91. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  92. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  93. package/dist/pptx/editor/render/find-replace.d.ts +1 -1
  94. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  95. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  96. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  97. package/dist/pptx/index.cjs +4561 -4351
  98. package/dist/pptx/index.d.ts +1 -1
  99. package/dist/pptx/index.mjs +5 -5
  100. package/dist/teams/index.cjs +30 -12
  101. package/dist/teams/index.mjs +29 -11
  102. package/dist/visio/edit-shape-data-commands.d.ts.map +1 -1
  103. package/dist/visio/index.cjs +6 -1
  104. package/dist/visio/index.mjs +6 -1
  105. package/dist/visio/ui/contract.d.ts +9 -2
  106. package/dist/visio/ui/contract.d.ts.map +1 -1
  107. package/dist/visio/ui/index.cjs +11 -3
  108. package/dist/visio/ui/index.mjs +11 -3
  109. package/dist/visio/ui/text-dialog.d.ts.map +1 -1
  110. package/dist/xlsx/collab/index.cjs +39 -14
  111. package/dist/xlsx/collab/index.mjs +39 -14
  112. package/dist/xlsx/index.cjs +15 -9
  113. package/dist/xlsx/index.mjs +15 -9
  114. package/dist/xlsx/load/index.cjs +15 -9
  115. package/dist/xlsx/load/index.mjs +15 -9
  116. package/dist/xlsx/ui/index.cjs +240 -9
  117. package/dist/xlsx/ui/index.mjs +240 -9
  118. package/dist/xlsx/ui/locales/de/cloud.d.ts +2 -0
  119. package/dist/xlsx/ui/locales/de/cloud.d.ts.map +1 -0
  120. package/dist/xlsx/ui/locales/de/collab.d.ts.map +1 -1
  121. package/dist/xlsx/ui/locales/de/index.d.ts.map +1 -1
  122. package/dist/xlsx/ui/locales/de/shell.d.ts.map +1 -1
  123. package/dist/xlsx/ui/locales/en/cloud.d.ts +2 -0
  124. package/dist/xlsx/ui/locales/en/cloud.d.ts.map +1 -0
  125. package/dist/xlsx/ui/locales/en/collab.d.ts.map +1 -1
  126. package/dist/xlsx/ui/locales/en/index.d.ts.map +1 -1
  127. package/dist/xlsx/ui/locales/en/shell.d.ts.map +1 -1
  128. package/dist/xlsx/ui/locales/es/cloud.d.ts +2 -0
  129. package/dist/xlsx/ui/locales/es/cloud.d.ts.map +1 -0
  130. package/dist/xlsx/ui/locales/es/collab.d.ts.map +1 -1
  131. package/dist/xlsx/ui/locales/es/index.d.ts.map +1 -1
  132. package/dist/xlsx/ui/locales/es/shell.d.ts.map +1 -1
  133. package/dist/xlsx/ui/locales/fr/cloud.d.ts +2 -0
  134. package/dist/xlsx/ui/locales/fr/cloud.d.ts.map +1 -0
  135. package/dist/xlsx/ui/locales/fr/collab.d.ts.map +1 -1
  136. package/dist/xlsx/ui/locales/fr/index.d.ts.map +1 -1
  137. package/dist/xlsx/ui/locales/fr/shell.d.ts.map +1 -1
  138. package/dist/xlsx/ui/locales/zh-CN/cloud.d.ts +2 -0
  139. package/dist/xlsx/ui/locales/zh-CN/cloud.d.ts.map +1 -0
  140. package/dist/xlsx/ui/locales/zh-CN/collab.d.ts.map +1 -1
  141. package/dist/xlsx/ui/locales/zh-CN/index.d.ts.map +1 -1
  142. package/dist/xlsx/ui/locales/zh-CN/shell.d.ts.map +1 -1
  143. package/dist/xml/index.cjs +19 -3
  144. package/dist/xml/index.mjs +19 -3
  145. package/dist/xml/merge-three-way.d.ts +2 -0
  146. package/dist/xml/merge-three-way.d.ts.map +1 -1
  147. package/package.json +2 -2
  148. package/dist/PptxHandler-2JSQ22VD.cjs +0 -14
  149. package/dist/PptxHandler-7T7ZS7IK.mjs +0 -5
  150. package/dist/pptx/chunks/index-bgj0Ztnq.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
- export { PptxHandler } from './chunk-RHQQS6LJ.mjs';
2
- import './chunk-J43V3QOA.mjs';
1
+ export { PptxHandler } from './chunk-RZ2FENDK.mjs';
2
+ import './chunk-I6XNVY5K.mjs';
3
3
  import './chunk-EYCM7RVL.mjs';
4
4
  import './chunk-2N7RZQLC.mjs';
5
5
  import './chunk-VDUNZTJC.mjs';
@@ -0,0 +1,5 @@
1
+ export { PptxHandler } from './chunk-JAJ4HFKO.mjs';
2
+ import './chunk-5BVSDSJZ.mjs';
3
+ import './chunk-6XAAJTA3.mjs';
4
+ import './chunk-GXHKNSZX.mjs';
5
+ import './chunk-CA7KCNL3.mjs';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkCEUG6BAS_cjs = require('./chunk-CEUG6BAS.cjs');
4
+ require('./chunk-EXSPNK6W.cjs');
5
+ require('./chunk-SEGPDD5W.cjs');
6
+ require('./chunk-XZPZHXV4.cjs');
7
+ require('./chunk-5W2QL4SB.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "PptxHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunkCEUG6BAS_cjs.PptxHandler; }
14
+ });
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkGZOYXHDF_cjs = require('./chunk-GZOYXHDF.cjs');
4
- require('./chunk-AFALJ5TA.cjs');
5
- require('./chunk-SNID2FDY.cjs');
3
+ var chunkCEUG6BAS_cjs = require('./chunk-CEUG6BAS.cjs');
4
+ require('./chunk-EXSPNK6W.cjs');
5
+ require('./chunk-SEGPDD5W.cjs');
6
6
  require('./chunk-XZPZHXV4.cjs');
7
7
  require('./chunk-5W2QL4SB.cjs');
8
8
 
@@ -10,13 +10,13 @@ require('./chunk-5W2QL4SB.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "PresentationBuilder", {
12
12
  enumerable: true,
13
- get: function () { return chunkGZOYXHDF_cjs.PresentationBuilder; }
13
+ get: function () { return chunkCEUG6BAS_cjs.PresentationBuilder; }
14
14
  });
15
15
  Object.defineProperty(exports, "STANDARD_LAYOUTS", {
16
16
  enumerable: true,
17
- get: function () { return chunkGZOYXHDF_cjs.STANDARD_LAYOUTS; }
17
+ get: function () { return chunkCEUG6BAS_cjs.STANDARD_LAYOUTS; }
18
18
  });
19
19
  Object.defineProperty(exports, "buildBlankPresentationArchive", {
20
20
  enumerable: true,
21
- get: function () { return chunkGZOYXHDF_cjs.buildBlankPresentationArchive; }
21
+ get: function () { return chunkCEUG6BAS_cjs.buildBlankPresentationArchive; }
22
22
  });
@@ -1,5 +1,5 @@
1
- export { PresentationBuilder, STANDARD_LAYOUTS, buildBlankPresentationArchive } from './chunk-RHQQS6LJ.mjs';
2
- import './chunk-J43V3QOA.mjs';
1
+ export { PresentationBuilder, STANDARD_LAYOUTS, buildBlankPresentationArchive } from './chunk-RZ2FENDK.mjs';
2
+ import './chunk-I6XNVY5K.mjs';
3
3
  import './chunk-EYCM7RVL.mjs';
4
4
  import './chunk-2N7RZQLC.mjs';
5
5
  import './chunk-VDUNZTJC.mjs';
@@ -1,5 +1,5 @@
1
- export { PresentationBuilder, STANDARD_LAYOUTS, buildBlankPresentationArchive } from './chunk-4YBSHQ76.mjs';
2
- import './chunk-H2Q42P6P.mjs';
3
- import './chunk-2TQJHNVU.mjs';
1
+ export { PresentationBuilder, STANDARD_LAYOUTS, buildBlankPresentationArchive } from './chunk-JAJ4HFKO.mjs';
2
+ import './chunk-5BVSDSJZ.mjs';
3
+ import './chunk-6XAAJTA3.mjs';
4
4
  import './chunk-GXHKNSZX.mjs';
5
5
  import './chunk-CA7KCNL3.mjs';
@@ -15148,16 +15148,22 @@ var pentagon = {
15148
15148
  gd16("vf", "val 110557"),
15149
15149
  gd16("swd2", "*/ wd2 hf 100000"),
15150
15150
  gd16("shd2", "*/ hd2 vf 100000"),
15151
+ // The vertices sit on an ellipse centred `svc` (below `vc` by `vf`), as
15152
+ // ECMA-376 writes it: the side pair `sin(18deg) * shd2` above it, the
15153
+ // bottom pair `sin(54deg) * shd2` below (on `b`). The old guides put the
15154
+ // side pair BELOW `vc` (at 67% of the height where PowerPoint 16 paints
15155
+ // 38%), which squashed every pentagon into a house shape.
15156
+ gd16("svc", "*/ vc vf 100000"),
15151
15157
  gd16("dx1", "*/ swd2 95106 100000"),
15152
15158
  gd16("dx2", "*/ swd2 58779 100000"),
15153
- gd16("dy1", "*/ shd2 80902 100000"),
15154
- gd16("dy2", "*/ shd2 30902 100000"),
15159
+ gd16("dy1", "*/ shd2 30902 100000"),
15160
+ gd16("dy2", "*/ shd2 80902 100000"),
15155
15161
  gd16("x1", "+- hc 0 dx1"),
15156
15162
  gd16("x2", "+- hc 0 dx2"),
15157
15163
  gd16("x3", "+- hc dx2 0"),
15158
15164
  gd16("x4", "+- hc dx1 0"),
15159
- gd16("y1", "+- vc 0 dy1"),
15160
- gd16("y2", "+- vc dy2 0"),
15165
+ gd16("y1", "+- svc 0 dy1"),
15166
+ gd16("y2", "+- svc dy2 0"),
15161
15167
  // The old `ir`/`ib` ("*/ y2 dx1 dy1") evaluates to ~150 at 200x100 (over
15162
15168
  // the box height of 100), so `ib = b - ir` went NEGATIVE - the pentagon's
15163
15169
  // text rect was flipped inside-out. COM-measured at 200x100pt instead:
@@ -15174,11 +15180,11 @@ var pentagon = {
15174
15180
  pathLst: [
15175
15181
  {
15176
15182
  commands: [
15177
- { kind: "moveTo", x: "hc", y: "t" },
15178
- { kind: "lnTo", x: "x4", y: "y2" },
15179
- { kind: "lnTo", x: "x3", y: "b" },
15180
- { kind: "lnTo", x: "x2", y: "b" },
15181
- { kind: "lnTo", x: "x1", y: "y2" },
15183
+ { kind: "moveTo", x: "x1", y: "y1" },
15184
+ { kind: "lnTo", x: "hc", y: "t" },
15185
+ { kind: "lnTo", x: "x4", y: "y1" },
15186
+ { kind: "lnTo", x: "x3", y: "y2" },
15187
+ { kind: "lnTo", x: "x2", y: "y2" },
15182
15188
  { kind: "close" }
15183
15189
  ]
15184
15190
  }
@@ -103413,7 +103419,12 @@ function shapeDataRowName(value3) {
103413
103419
  }
103414
103420
  function visioShapeDataRowName(label2, taken = []) {
103415
103421
  const used = new Set([...taken].map((name4) => name4.toLowerCase()));
103416
- let base3 = label2.normalize("NFKD").replace(/[^\w]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 48);
103422
+ let base3 = label2.normalize("NFKD").replace(/[^\w]+/g, "_");
103423
+ let start = 0;
103424
+ let end = base3.length;
103425
+ while (start < end && base3[start] === "_") start++;
103426
+ while (end > start && base3[end - 1] === "_") end--;
103427
+ base3 = base3.slice(start, end).slice(0, 48);
103417
103428
  if (!base3) base3 = "Property";
103418
103429
  if (/^\d/.test(base3)) base3 = `_${base3}`;
103419
103430
  let name3 = base3;
@@ -15123,16 +15123,22 @@ var pentagon = {
15123
15123
  gd16("vf", "val 110557"),
15124
15124
  gd16("swd2", "*/ wd2 hf 100000"),
15125
15125
  gd16("shd2", "*/ hd2 vf 100000"),
15126
+ // The vertices sit on an ellipse centred `svc` (below `vc` by `vf`), as
15127
+ // ECMA-376 writes it: the side pair `sin(18deg) * shd2` above it, the
15128
+ // bottom pair `sin(54deg) * shd2` below (on `b`). The old guides put the
15129
+ // side pair BELOW `vc` (at 67% of the height where PowerPoint 16 paints
15130
+ // 38%), which squashed every pentagon into a house shape.
15131
+ gd16("svc", "*/ vc vf 100000"),
15126
15132
  gd16("dx1", "*/ swd2 95106 100000"),
15127
15133
  gd16("dx2", "*/ swd2 58779 100000"),
15128
- gd16("dy1", "*/ shd2 80902 100000"),
15129
- gd16("dy2", "*/ shd2 30902 100000"),
15134
+ gd16("dy1", "*/ shd2 30902 100000"),
15135
+ gd16("dy2", "*/ shd2 80902 100000"),
15130
15136
  gd16("x1", "+- hc 0 dx1"),
15131
15137
  gd16("x2", "+- hc 0 dx2"),
15132
15138
  gd16("x3", "+- hc dx2 0"),
15133
15139
  gd16("x4", "+- hc dx1 0"),
15134
- gd16("y1", "+- vc 0 dy1"),
15135
- gd16("y2", "+- vc dy2 0"),
15140
+ gd16("y1", "+- svc 0 dy1"),
15141
+ gd16("y2", "+- svc dy2 0"),
15136
15142
  // The old `ir`/`ib` ("*/ y2 dx1 dy1") evaluates to ~150 at 200x100 (over
15137
15143
  // the box height of 100), so `ib = b - ir` went NEGATIVE - the pentagon's
15138
15144
  // text rect was flipped inside-out. COM-measured at 200x100pt instead:
@@ -15149,11 +15155,11 @@ var pentagon = {
15149
15155
  pathLst: [
15150
15156
  {
15151
15157
  commands: [
15152
- { kind: "moveTo", x: "hc", y: "t" },
15153
- { kind: "lnTo", x: "x4", y: "y2" },
15154
- { kind: "lnTo", x: "x3", y: "b" },
15155
- { kind: "lnTo", x: "x2", y: "b" },
15156
- { kind: "lnTo", x: "x1", y: "y2" },
15158
+ { kind: "moveTo", x: "x1", y: "y1" },
15159
+ { kind: "lnTo", x: "hc", y: "t" },
15160
+ { kind: "lnTo", x: "x4", y: "y1" },
15161
+ { kind: "lnTo", x: "x3", y: "y2" },
15162
+ { kind: "lnTo", x: "x2", y: "y2" },
15157
15163
  { kind: "close" }
15158
15164
  ]
15159
15165
  }
@@ -103388,7 +103394,12 @@ function shapeDataRowName(value3) {
103388
103394
  }
103389
103395
  function visioShapeDataRowName(label2, taken = []) {
103390
103396
  const used = new Set([...taken].map((name4) => name4.toLowerCase()));
103391
- let base3 = label2.normalize("NFKD").replace(/[^\w]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 48);
103397
+ let base3 = label2.normalize("NFKD").replace(/[^\w]+/g, "_");
103398
+ let start = 0;
103399
+ let end = base3.length;
103400
+ while (start < end && base3[start] === "_") start++;
103401
+ while (end > start && base3[end - 1] === "_") end--;
103402
+ base3 = base3.slice(start, end).slice(0, 48);
103392
103403
  if (!base3) base3 = "Property";
103393
103404
  if (/^\d/.test(base3)) base3 = `_${base3}`;
103394
103405
  let name3 = base3;
@@ -1,6 +1,6 @@
1
- import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-OEM2ECAJ.mjs';
2
- import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, chartFormatTargetKey, readChartElementFormat, hasGradientField, applyGradient, mirrorFlatFields, mirrorTextColor, withSeries, applyChartGroupOptionsInput, countExistingLayouts, addLayoutToSlideMaster, addLayoutContentType, createLayout, STANDARD_LAYOUTS, generateLayoutXml, layoutRelsXml, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, clonePartGraph, buildBlankPresentationArchive, relativePartTarget, PptxXmlBuilder } from './chunk-RHQQS6LJ.mjs';
3
- import { EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, hasTextProperties, nextRelationshipId, escAttr, NS } from './chunk-J43V3QOA.mjs';
1
+ import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-X6O3L76X.mjs';
2
+ import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, chartFormatTargetKey, readChartElementFormat, hasGradientField, applyGradient, mirrorFlatFields, mirrorTextColor, withSeries, applyChartGroupOptionsInput, countExistingLayouts, addLayoutToSlideMaster, addLayoutContentType, createLayout, STANDARD_LAYOUTS, generateLayoutXml, layoutRelsXml, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, clonePartGraph, buildBlankPresentationArchive, FILL_CHOICE_ELEMENTS, relativePartTarget, PptxXmlBuilder } from './chunk-RZ2FENDK.mjs';
3
+ import { SP_PR_ORDER, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, LN_CHILD_ORDER, BLIP_FILL_ORDER, EFFECT_LST_ORDER, SHAPE_STYLE_ORDER, TC_PR_BORDERS_ORDER, hasTextProperties, nextRelationshipId, escAttr, NS } from './chunk-I6XNVY5K.mjs';
4
4
  import { openPptxZip, openZip } from './chunk-EYCM7RVL.mjs';
5
5
  import { cloneSlide, cloneElement } from './chunk-VDUNZTJC.mjs';
6
6
 
@@ -452,24 +452,34 @@ function childrenByKey(parent, options, repeated) {
452
452
  }
453
453
  return result;
454
454
  }
455
- function orderKeys(base, local, remote) {
455
+ function orderKeys(base, local, remote, isKeyed, childOrder) {
456
456
  const same = (a, b) => a.length === b.length && a.every((key, index) => key === b[index]);
457
457
  if (same(base, local)) return [...remote];
458
458
  if (same(base, remote) || same(local, remote)) return [...local];
459
459
  const keys = [.../* @__PURE__ */ new Set([...remote, ...local])].sort();
460
460
  const edges = new Map(keys.map((key) => [key, /* @__PURE__ */ new Set()]));
461
461
  const degree = new Map(keys.map((key) => [key, 0]));
462
- for (const sequence of [local, remote])
463
- for (let i = 1; i < sequence.length; i++) {
464
- const previous = sequence[i - 1], next = sequence[i];
462
+ const addSequence = (sequence2) => {
463
+ for (let i = 1; i < sequence2.length; i++) {
464
+ const previous = sequence2[i - 1], next = sequence2[i];
465
465
  if (!edges.get(previous).has(next)) {
466
466
  edges.get(previous).add(next);
467
467
  degree.set(next, degree.get(next) + 1);
468
468
  }
469
469
  }
470
+ };
471
+ for (const sequence2 of [local, remote]) addSequence(sequence2);
472
+ const ranked = keys.flatMap((key) => {
473
+ const rank = childOrder(key);
474
+ return rank === void 0 ? [] : [{ key, rank }];
475
+ });
476
+ if (ranked.some(({ rank }) => !Number.isFinite(rank)) || new Set(ranked.map(({ rank }) => rank)).size !== ranked.length)
477
+ return void 0;
478
+ addSequence(ranked.sort((a, b) => a.rank - b.rank).map(({ key }) => key));
470
479
  const out = [];
471
480
  const ready = keys.filter((key) => degree.get(key) === 0);
472
481
  while (ready.length) {
482
+ if (ready.length > 1 && ready.some((key) => !isKeyed(key))) return void 0;
473
483
  const next = ready.sort().shift();
474
484
  out.push(next);
475
485
  for (const key of edges.get(next)) {
@@ -547,15 +557,15 @@ function mergeXmlThreeWay(baseXml, localXml, remoteXml, options = {}) {
547
557
  const groups = lists.map((list) => {
548
558
  const grouped = /* @__PURE__ */ new Map();
549
559
  for (const child of list) {
550
- const name = tag(child), group = grouped.get(name) ?? [];
551
- group.push(child);
552
- grouped.set(name, group);
553
- if (group.length > 1) repeated.add(name);
560
+ const name = tag(child), group2 = grouped.get(name) ?? [];
561
+ group2.push(child);
562
+ grouped.set(name, group2);
563
+ if (group2.length > 1) repeated.add(name);
554
564
  }
555
565
  return grouped;
556
566
  });
557
567
  for (const name of repeated) {
558
- const rows = groups.map((group) => group.get(name) ?? []);
568
+ const rows = groups.map((group2) => group2.get(name) ?? []);
559
569
  if (rows.some((row) => row.some((child) => options.keyElement?.(child, b) !== void 0)))
560
570
  continue;
561
571
  if (rows.some((row) => row.length !== rows[0].length)) {
@@ -587,7 +597,13 @@ function mergeXmlThreeWay(baseXml, localXml, remoteXml, options = {}) {
587
597
  if (node) merged.set(key, node);
588
598
  }
589
599
  const surviving = (map) => [...map.keys()].filter((key) => merged.has(key));
590
- const order = orderKeys(surviving(bm), surviving(lm), surviving(rm));
600
+ const order = orderKeys(
601
+ surviving(bm),
602
+ surviving(lm),
603
+ surviving(rm),
604
+ (key) => Boolean(options.keyElement?.(merged.get(key), out)),
605
+ (key) => options.childOrder?.(merged.get(key), out)
606
+ );
591
607
  if (!order) {
592
608
  issues.push(`${path}: incompatible element order`);
593
609
  return void 0;
@@ -611,6 +627,7 @@ function mergeXmlThreeWay(baseXml, localXml, remoteXml, options = {}) {
611
627
 
612
628
  // opc/merge-snapshots.ts
613
629
  var equal = (a, b) => a === b || Boolean(a && b && a.length === b.length && a.every((value, index) => value === b[index]));
630
+ var CORE_PROPERTIES = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
614
631
  var decoder = new TextDecoder("utf-8", { fatal: true });
615
632
  var encoder = new TextEncoder();
616
633
  function mergeManifest(input) {
@@ -624,11 +641,13 @@ function mergeManifest(input) {
624
641
  decoder.decode(local),
625
642
  decoder.decode(remote),
626
643
  {
627
- keyElement: (element) => {
644
+ keyElement: (element, parent) => {
645
+ if (path === "docProps/core.xml" && parent.namespaceURI === CORE_PROPERTIES && parent.localName === "coreProperties")
646
+ return `${element.namespaceURI ?? ""}|${element.localName}`;
628
647
  const attribute = element.localName === "Relationship" ? "Id" : element.localName === "Override" ? "PartName" : element.localName === "Default" ? "Extension" : void 0;
629
648
  return attribute ? element.getAttribute(attribute) ?? void 0 : void 0;
630
649
  },
631
- resolveText: (_b, _l, r) => path === "docProps/core.xml" && (r.namespaceURI === "http://purl.org/dc/terms/" && r.localName === "modified" || r.namespaceURI === "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" && r.localName === "lastModifiedBy") ? r.textContent ?? "" : void 0
650
+ resolveText: (_b, _l, r) => path === "docProps/core.xml" && (r.namespaceURI === "http://purl.org/dc/terms/" && r.localName === "modified" || r.namespaceURI === CORE_PROPERTIES && r.localName === "lastModifiedBy") ? r.textContent ?? "" : void 0
632
651
  }
633
652
  );
634
653
  return result.status === "merged" ? { status: "merged", bytes: encoder.encode(result.xml) } : result;
@@ -1344,8 +1363,8 @@ function processElements(elements2, data) {
1344
1363
  const tableEl = element;
1345
1364
  if (tableEl.tableData?.rows) {
1346
1365
  for (const row of tableEl.tableData.rows) {
1347
- for (const cell of row.cells) {
1348
- cell.text = replaceTokensInString(cell.text, data);
1366
+ for (const cell2 of row.cells) {
1367
+ cell2.text = replaceTokensInString(cell2.text, data);
1349
1368
  }
1350
1369
  }
1351
1370
  }
@@ -1509,8 +1528,8 @@ function findPlaceholders(data) {
1509
1528
  const tableEl = element;
1510
1529
  if (tableEl.tableData?.rows) {
1511
1530
  for (const row of tableEl.tableData.rows) {
1512
- for (const cell of row.cells) {
1513
- extractPlaceholdersFromText(cell.text, found);
1531
+ for (const cell2 of row.cells) {
1532
+ extractPlaceholdersFromText(cell2.text, found);
1514
1533
  }
1515
1534
  }
1516
1535
  }
@@ -1928,10 +1947,10 @@ var Presentation = class _Presentation {
1928
1947
  };
1929
1948
 
1930
1949
  // pptx/core/builders/sdk/chart-formatting-operations.ts
1931
- function setChartDataPointStyle(element, seriesIndex, pointIndex, style) {
1950
+ function setChartDataPointStyle(element, seriesIndex, pointIndex, style2) {
1932
1951
  validateSeriesIndex(element, seriesIndex);
1933
1952
  const series = element.chartData.series[seriesIndex];
1934
- if (style === null) {
1953
+ if (style2 === null) {
1935
1954
  const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
1936
1955
  if (dp2) {
1937
1956
  dp2.spPr = void 0;
@@ -1941,20 +1960,20 @@ function setChartDataPointStyle(element, seriesIndex, pointIndex, style) {
1941
1960
  return;
1942
1961
  }
1943
1962
  const dp = ensureDataPoint(series, pointIndex);
1944
- dp.spPr = { ...dp.spPr ?? {}, ...style };
1945
- if (style.fillColor !== void 0) {
1963
+ dp.spPr = { ...dp.spPr ?? {}, ...style2 };
1964
+ if (style2.fillColor !== void 0) {
1946
1965
  delete dp.gradientFill;
1947
1966
  }
1948
1967
  }
1949
1968
  var HELPER_LINE_CHART_TYPES = /* @__PURE__ */ new Set(["line", "stock", "combo"]);
1950
- function setChartHelperLine(element, line, style) {
1969
+ function setChartHelperLine(element, line2, style2) {
1951
1970
  ensureChartData(element);
1952
1971
  if (!HELPER_LINE_CHART_TYPES.has(element.chartData.chartType)) {
1953
1972
  throw new Error(
1954
- `${line} is only valid on line, stock, or combo charts (got "${element.chartData.chartType}").`
1973
+ `${line2} is only valid on line, stock, or combo charts (got "${element.chartData.chartType}").`
1955
1974
  );
1956
1975
  }
1957
- element.chartData[line] = style;
1976
+ element.chartData[line2] = style2;
1958
1977
  }
1959
1978
  function setChartColorMapOverride(element, overrides28) {
1960
1979
  ensureChartData(element);
@@ -2051,13 +2070,13 @@ function withChartElementFormat(data, target, patch) {
2051
2070
  entry.fill = fill;
2052
2071
  }
2053
2072
  }
2054
- let line;
2073
+ let line2;
2055
2074
  if (patch.line) {
2056
- line = { ...view.line, ...patch.line };
2057
- if (line.kind !== "gradient") {
2058
- delete line.gradient;
2075
+ line2 = { ...view.line, ...patch.line };
2076
+ if (line2.kind !== "gradient") {
2077
+ delete line2.gradient;
2059
2078
  }
2060
- entry.line = line;
2079
+ entry.line = line2;
2061
2080
  }
2062
2081
  if (patch.effects) {
2063
2082
  entry.effects = { ...view.effects, ...patch.effects };
@@ -2079,7 +2098,7 @@ function withChartElementFormat(data, target, patch) {
2079
2098
  }
2080
2099
  entry.text = text;
2081
2100
  }
2082
- next = mirrorFlatFields(next, target, fill, line);
2101
+ next = mirrorFlatFields(next, target, fill, line2);
2083
2102
  if (patch.text?.fill && entry.text) {
2084
2103
  next = mirrorTextColor(next, target, entry.text);
2085
2104
  }
@@ -2091,11 +2110,11 @@ function resetChartElementFormat(data, target) {
2091
2110
  switch (target.kind) {
2092
2111
  case "chartArea":
2093
2112
  case "plotArea": {
2094
- const style = { ...data.style };
2095
- delete style[`${target.kind}Fill`];
2096
- delete style[`${target.kind}Gradient`];
2097
- delete style[`${target.kind}Border`];
2098
- next = { ...data, style };
2113
+ const style2 = { ...data.style };
2114
+ delete style2[`${target.kind}Fill`];
2115
+ delete style2[`${target.kind}Gradient`];
2116
+ delete style2[`${target.kind}Border`];
2117
+ next = { ...data, style: style2 };
2099
2118
  break;
2100
2119
  }
2101
2120
  case "title":
@@ -2210,27 +2229,27 @@ function withChartAxisOptions(data, axisIndex, edit) {
2210
2229
  return { ...data, axes };
2211
2230
  }
2212
2231
  function withChartLegendOptions(data, edit) {
2213
- const style = { ...data.style };
2232
+ const style2 = { ...data.style };
2214
2233
  if (edit.show !== void 0) {
2215
- style.hasLegend = edit.show;
2234
+ style2.hasLegend = edit.show;
2216
2235
  }
2217
2236
  if (edit.position !== void 0) {
2218
- style.legendPosition = edit.position;
2219
- style.hasLegend = style.hasLegend ?? true;
2237
+ style2.legendPosition = edit.position;
2238
+ style2.hasLegend = style2.hasLegend ?? true;
2220
2239
  }
2221
2240
  if (edit.overlay !== void 0) {
2222
- style.legendOverlay = edit.overlay;
2241
+ style2.legendOverlay = edit.overlay;
2223
2242
  }
2224
- return { ...data, style };
2243
+ return { ...data, style: style2 };
2225
2244
  }
2226
2245
  function withChartDataLabelOptions(data, edit, seriesIndex) {
2227
2246
  if (seriesIndex !== void 0) {
2228
2247
  return withSeriesDataLabelOptions(data, edit, seriesIndex);
2229
2248
  }
2230
- const style = { ...data.style };
2231
- const labels = { ...style.dataLabels };
2249
+ const style2 = { ...data.style };
2250
+ const labels = { ...style2.dataLabels };
2232
2251
  if (edit.show !== void 0) {
2233
- style.hasDataLabels = edit.show;
2252
+ style2.hasDataLabels = edit.show;
2234
2253
  }
2235
2254
  for (const key of [
2236
2255
  "showValue",
@@ -2241,7 +2260,7 @@ function withChartDataLabelOptions(data, edit, seriesIndex) {
2241
2260
  ]) {
2242
2261
  if (edit[key] !== void 0) {
2243
2262
  labels[key] = edit[key];
2244
- style.hasDataLabels = style.hasDataLabels ?? true;
2263
+ style2.hasDataLabels = style2.hasDataLabels ?? true;
2245
2264
  }
2246
2265
  }
2247
2266
  if (edit.position !== void 0) {
@@ -2251,8 +2270,8 @@ function withChartDataLabelOptions(data, edit, seriesIndex) {
2251
2270
  labels.position = edit.position;
2252
2271
  }
2253
2272
  }
2254
- style.dataLabels = labels;
2255
- return { ...data, style };
2273
+ style2.dataLabels = labels;
2274
+ return { ...data, style: style2 };
2256
2275
  }
2257
2276
  var LABEL_FLAGS = [
2258
2277
  "showValue",
@@ -2281,18 +2300,18 @@ function withSeriesDataLabelOptions(data, edit, seriesIndex) {
2281
2300
  labels.position = edit.position;
2282
2301
  }
2283
2302
  }
2284
- const style = { ...data.style };
2285
- if (style.hasDataLabels !== true && LABEL_FLAGS.some((key) => labels[key])) {
2286
- style.hasDataLabels = true;
2287
- const off = { ...style.dataLabels };
2303
+ const style2 = { ...data.style };
2304
+ if (style2.hasDataLabels !== true && LABEL_FLAGS.some((key) => labels[key])) {
2305
+ style2.hasDataLabels = true;
2306
+ const off = { ...style2.dataLabels };
2288
2307
  for (const key of LABEL_FLAGS) {
2289
2308
  off[key] ??= false;
2290
2309
  }
2291
- style.dataLabels = off;
2310
+ style2.dataLabels = off;
2292
2311
  }
2293
2312
  return {
2294
2313
  ...data,
2295
- style,
2314
+ style: style2,
2296
2315
  series: data.series.map((s, i) => i === seriesIndex ? { ...s, dataLabelOptions: labels } : s)
2297
2316
  };
2298
2317
  }
@@ -2485,16 +2504,16 @@ function validateShapeIndex(element, index) {
2485
2504
  function listChartUserShapes(element) {
2486
2505
  return element.chartData?.userShapes ?? [];
2487
2506
  }
2488
- function addChartUserShape(element, shape) {
2507
+ function addChartUserShape(element, shape2) {
2489
2508
  ensureChartData2(element);
2490
2509
  const existing = element.chartData.userShapes ?? [];
2491
- element.chartData.userShapes = [...existing, shape];
2510
+ element.chartData.userShapes = [...existing, shape2];
2492
2511
  }
2493
2512
  function updateChartUserShape(element, index, patch) {
2494
2513
  validateShapeIndex(element, index);
2495
2514
  const shapes = element.chartData.userShapes;
2496
2515
  element.chartData.userShapes = shapes.map(
2497
- (shape, i) => i === index ? { ...shape, ...patch } : shape
2516
+ (shape2, i) => i === index ? { ...shape2, ...patch } : shape2
2498
2517
  );
2499
2518
  }
2500
2519
  function removeChartUserShape(element, index) {
@@ -3621,8 +3640,8 @@ var ShapeBuilder = class _ShapeBuilder {
3621
3640
  *
3622
3641
  * @param style - A partial {@link TextStyleInput} for font, size, color, etc.
3623
3642
  */
3624
- textStyle(style) {
3625
- this._options.textStyle = style;
3643
+ textStyle(style2) {
3644
+ this._options.textStyle = style2;
3626
3645
  return this;
3627
3646
  }
3628
3647
  /**
@@ -14935,6 +14954,76 @@ function listUnassessedOpenXmlCoverage(vocabulary) {
14935
14954
  );
14936
14955
  }
14937
14956
 
14957
+ // pptx/merge-child-order.ts
14958
+ function sequence(order, choices = []) {
14959
+ const ranks = new Map(order.map((name, index) => [name, index]));
14960
+ for (const choice of choices) {
14961
+ const positions = choice.flatMap((name) => {
14962
+ const position2 = ranks.get(name);
14963
+ return position2 === void 0 ? [] : [position2];
14964
+ });
14965
+ if (!positions.length) continue;
14966
+ const position = Math.min(...positions);
14967
+ for (const name of choice) if (ranks.has(name)) ranks.set(name, position);
14968
+ }
14969
+ return ranks;
14970
+ }
14971
+ var shapeChoices = [
14972
+ ["a:custGeom", "a:prstGeom"],
14973
+ FILL_CHOICE_ELEMENTS,
14974
+ ["a:effectLst", "a:effectDag"]
14975
+ ];
14976
+ var shape = sequence(SP_PR_ORDER, shapeChoices);
14977
+ var group = sequence(
14978
+ SP_PR_ORDER.filter((name) => !["a:custGeom", "a:prstGeom", "a:ln", "a:sp3d"].includes(name)),
14979
+ shapeChoices
14980
+ );
14981
+ var line = sequence(LN_CHILD_ORDER, [
14982
+ FILL_CHOICE_ELEMENTS,
14983
+ ["a:prstDash", "a:custDash"],
14984
+ ["a:round", "a:bevel", "a:miter"]
14985
+ ]);
14986
+ var blip = sequence(BLIP_FILL_ORDER, [["a:tile", "a:stretch"]]);
14987
+ var effects = sequence(EFFECT_LST_ORDER);
14988
+ var style = sequence(SHAPE_STYLE_ORDER);
14989
+ var cell = sequence(TC_PR_BORDERS_ORDER, [FILL_CHOICE_ELEMENTS]);
14990
+ function pptxChildOrder(element, parent) {
14991
+ if (element.namespaceURI !== NS.a) return void 0;
14992
+ let ranks;
14993
+ if (parent.namespaceURI === NS.p) {
14994
+ switch (parent.localName) {
14995
+ case "spPr":
14996
+ ranks = shape;
14997
+ break;
14998
+ case "grpSpPr":
14999
+ ranks = group;
15000
+ break;
15001
+ case "blipFill":
15002
+ ranks = blip;
15003
+ break;
15004
+ case "style":
15005
+ ranks = style;
15006
+ break;
15007
+ }
15008
+ } else if (parent.namespaceURI === NS.a) {
15009
+ switch (parent.localName) {
15010
+ case "ln":
15011
+ ranks = line;
15012
+ break;
15013
+ case "blipFill":
15014
+ ranks = blip;
15015
+ break;
15016
+ case "effectLst":
15017
+ ranks = effects;
15018
+ break;
15019
+ case "tcPr":
15020
+ ranks = cell;
15021
+ break;
15022
+ }
15023
+ }
15024
+ return ranks?.get("a:" + element.localName);
15025
+ }
15026
+
14938
15027
  // pptx/merge-snapshots.ts
14939
15028
  var SLIDE_PART = /^ppt\/(?:slides\/slide\d+|notesSlides\/notesSlide\d+)\.xml$/u;
14940
15029
  var SHAPES = /* @__PURE__ */ new Set(["sp", "pic", "cxnSp", "graphicFrame", "grpSp"]);
@@ -14960,6 +15049,7 @@ function mergePptxSnapshots(base, local, remote) {
14960
15049
  decoder2.decode(input.remote),
14961
15050
  {
14962
15051
  keyElement,
15052
+ childOrder: pptxChildOrder,
14963
15053
  allowPositional: (parent) => (parent.namespaceURI === NS.a || parent.namespaceURI === NS.p) && POSITIONAL.has(parent.localName),
14964
15054
  allowText: (element) => element.namespaceURI === NS.a && element.localName === "t"
14965
15055
  }
@@ -15008,7 +15098,7 @@ async function setPresentationRunText(bytes, slideIndex, elementId, runIndex, te
15008
15098
  async function createPresentationFromOutline(slides, options = {}) {
15009
15099
  if (!(slides instanceof Array) || !slides.length || slides.length > 200)
15010
15100
  throw new Error("A presentation outline has 1 to 200 slides");
15011
- const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-XHKNDJMD.mjs');
15101
+ const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-YHK53TGI.mjs');
15012
15102
  const { handler, data, createSlide } = await PresentationBuilder2.create({
15013
15103
  ...options.title ? { title: options.title } : {}
15014
15104
  });
@@ -1,4 +1,4 @@
1
- import { xmlText } from './chunk-2TQJHNVU.mjs';
1
+ import { xmlText } from './chunk-6XAAJTA3.mjs';
2
2
  import { EMU_PER_PX } from './chunk-CA7KCNL3.mjs';
3
3
 
4
4
  // pptx/core/core/runtime/table-structural-helpers.ts