ooxml-core 1.45.0 → 1.47.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 (81) hide show
  1. package/dist/PptxHandler-JX62VKU4.cjs +14 -0
  2. package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-NXHZ6ITL.mjs} +2 -2
  3. package/dist/PptxHandler-SUGLNSZI.mjs +5 -0
  4. package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-IK6NIK6T.cjs} +6 -6
  5. package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-LHQ333UL.mjs} +3 -3
  6. package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-URSPID7L.mjs} +2 -2
  7. package/dist/automation/index.cjs +12 -7
  8. package/dist/automation/index.mjs +12 -7
  9. package/dist/chart/edit/group-options.d.ts +4 -0
  10. package/dist/chart/edit/group-options.d.ts.map +1 -1
  11. package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
  12. package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
  13. package/dist/chart/edit/new-chart.d.ts +34 -1
  14. package/dist/chart/edit/new-chart.d.ts.map +1 -1
  15. package/dist/chart/edit/secondary-axis.d.ts +8 -1
  16. package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
  17. package/dist/chart/edit/type.d.ts +2 -0
  18. package/dist/chart/edit/type.d.ts.map +1 -1
  19. package/dist/chart/index.cjs +414 -263
  20. package/dist/chart/index.mjs +412 -264
  21. package/dist/{chunk-YBSNMVSN.cjs → chunk-4GPLQEEC.cjs} +1604 -1324
  22. package/dist/{chunk-U5BXJQZG.mjs → chunk-553WFEHD.mjs} +332 -53
  23. package/dist/{chunk-RVYGAYCP.mjs → chunk-5HNRZOBX.mjs} +1 -1
  24. package/dist/{chunk-VKFKEVHK.mjs → chunk-6MU4WKHS.mjs} +1 -1
  25. package/dist/{chunk-GXYK3H4O.mjs → chunk-7L6ZAA5Y.mjs} +82 -17
  26. package/dist/{chunk-3J6VIKLP.cjs → chunk-APCA7N6Q.cjs} +3 -3
  27. package/dist/{chunk-IPV3J3I5.mjs → chunk-DEDK2J57.mjs} +68 -1
  28. package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
  29. package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
  30. package/dist/{chunk-GGJUWJXB.mjs → chunk-QHR726W3.mjs} +1 -1
  31. package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
  32. package/dist/{chunk-QZPOPUI5.cjs → chunk-WFN6ZU7N.cjs} +69 -0
  33. package/dist/{chunk-LCXBTJXE.mjs → chunk-XVEJS7HN.mjs} +5 -5
  34. package/dist/{chunk-CVJX6NNO.mjs → chunk-Z734BYYR.mjs} +334 -54
  35. package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
  36. package/dist/docx/index.cjs +300 -144
  37. package/dist/docx/index.mjs +300 -144
  38. package/dist/index.cjs +484 -333
  39. package/dist/index.mjs +484 -333
  40. package/dist/pptx/automation/index.cjs +2207 -1825
  41. package/dist/pptx/automation/index.d.ts +4 -4
  42. package/dist/pptx/automation/index.mjs +5 -5
  43. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts → index--HBUyILF.d.ts} +5 -5
  44. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index--HBUyILF.d.ts.map} +1 -1
  45. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-BDVzSboe.d.ts} +71 -7
  46. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts.map → index-BDVzSboe.d.ts.map} +1 -1
  47. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-Dr3iIPt9.d.ts} +3 -3
  48. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-Dr3iIPt9.d.ts.map} +1 -1
  49. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts → text-operations-CVHXOSit.d.ts} +18 -3
  50. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
  51. package/dist/pptx/cli/index.cjs +608 -226
  52. package/dist/pptx/cli/index.d.ts +1 -1
  53. package/dist/pptx/cli/index.mjs +4 -4
  54. package/dist/pptx/converter/index.cjs +1 -0
  55. package/dist/pptx/converter/index.d.ts +1 -1
  56. package/dist/pptx/converter/index.mjs +2 -2
  57. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
  58. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
  59. package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
  60. package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
  61. package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
  62. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  63. package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
  64. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  65. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  66. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  67. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  68. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  69. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  70. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  71. package/dist/pptx/index.cjs +2605 -2226
  72. package/dist/pptx/index.d.ts +5 -5
  73. package/dist/pptx/index.mjs +5 -5
  74. package/dist/pptx/node/index.d.ts +1 -1
  75. package/dist/xlsx/index.cjs +12 -7
  76. package/dist/xlsx/index.mjs +12 -7
  77. package/dist/xlsx/ui/index.cjs +12 -7
  78. package/dist/xlsx/ui/index.mjs +12 -7
  79. package/package.json +1 -1
  80. package/dist/PptxHandler-3RDVJFQV.cjs +0 -14
  81. package/dist/PptxHandler-EI6DMHPM.mjs +0 -5
@@ -408,9 +408,9 @@ function parseFormula(fmla) {
408
408
  return { op: op2, args };
409
409
  }
410
410
  function resolveOperand(token3, variables) {
411
- const num4 = Number(token3);
412
- if (Number.isFinite(num4)) {
413
- return num4;
411
+ const num5 = Number(token3);
412
+ if (Number.isFinite(num5)) {
413
+ return num5;
414
414
  }
415
415
  const value = variables.get(token3);
416
416
  if (value !== void 0) {
@@ -636,9 +636,9 @@ function resolveCoordinate(value, variables) {
636
636
  return value;
637
637
  }
638
638
  const trimmed2 = String(value).trim();
639
- const num4 = Number(trimmed2);
640
- if (Number.isFinite(num4)) {
641
- return num4;
639
+ const num5 = Number(trimmed2);
640
+ if (Number.isFinite(num5)) {
641
+ return num5;
642
642
  }
643
643
  return resolveOperand(trimmed2, variables);
644
644
  }
@@ -11918,9 +11918,9 @@ function resolveToken(token3, vars) {
11918
11918
  if (trimmed2 === "") {
11919
11919
  return 0;
11920
11920
  }
11921
- const num4 = Number(trimmed2);
11922
- if (Number.isFinite(num4)) {
11923
- return num4;
11921
+ const num5 = Number(trimmed2);
11922
+ if (Number.isFinite(num5)) {
11923
+ return num5;
11924
11924
  }
11925
11925
  return resolveOperand(trimmed2, vars);
11926
11926
  }
@@ -13464,6 +13464,7 @@ var init_collaboration_field_schema = __esm({
13464
13464
  backgroundImage: "scalar",
13465
13465
  backgroundImageProperties: "complex",
13466
13466
  backgroundGradient: "scalar",
13467
+ backgroundGradientFill: "complex",
13467
13468
  backgroundStyleRef: "complex",
13468
13469
  backgroundPattern: "complex",
13469
13470
  backgroundShadeToTitle: "scalar",
@@ -14751,6 +14752,9 @@ function normalizeDegrees(deg) {
14751
14752
  function ooxmlGradientAngleToCssDegrees(angleDegrees) {
14752
14753
  return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
14753
14754
  }
14755
+ function cssDegreesToOoxmlGradientAngle(cssDegrees) {
14756
+ return normalizeDegrees(cssDegrees - OOXML_TO_CSS_OFFSET_DEG);
14757
+ }
14754
14758
  var OOXML_TO_CSS_OFFSET_DEG;
14755
14759
  var init_gradient_angle = __esm({
14756
14760
  "pptx/core/utils/gradient-angle.ts"() {
@@ -35865,6 +35869,70 @@ function applyPictureEffects(blip, effects2) {
35865
35869
  for (const node of elements(blip)) blip.removeChild(node);
35866
35870
  for (const node of nodes) blip.appendChild(node);
35867
35871
  }
35872
+ function patchPictureEffects(source2, patch) {
35873
+ const result = structuredClone(source2);
35874
+ const upsert2 = (kind, update) => {
35875
+ const matches = result.flatMap((effect, index2) => effect.kind === kind ? [index2] : []);
35876
+ if (matches.length > 1) throw new Error(`Ambiguous duplicate picture effect: ${kind}`);
35877
+ const index = matches[0];
35878
+ const value = update(index === void 0 ? void 0 : result[index]);
35879
+ if (index !== void 0) {
35880
+ if (value) result[index] = value;
35881
+ else result.splice(index, 1);
35882
+ } else if (value) {
35883
+ const ext = result.findIndex(
35884
+ (effect) => effect.kind === "unsupported" && effect.name === "extLst"
35885
+ );
35886
+ result.splice(ext < 0 ? result.length : ext, 0, value);
35887
+ }
35888
+ };
35889
+ for (const key2 of ["brightness", "contrast", "alpha"])
35890
+ if (patch[key2] !== void 0 && !Number.isFinite(patch[key2]))
35891
+ throw new RangeError("Picture effect must be finite");
35892
+ if ([patch.brightness, patch.contrast].some((value) => value !== void 0 && Math.abs(value) > 1))
35893
+ throw new RangeError("Picture luminance must be between -1 and 1");
35894
+ if (patch.alpha !== void 0 && patch.alpha < 0)
35895
+ throw new RangeError("Picture alpha must be nonnegative");
35896
+ if (patch.grayscale !== void 0)
35897
+ upsert2(
35898
+ "grayscale",
35899
+ (effect) => patch.grayscale ? effect ?? { kind: "grayscale" } : void 0
35900
+ );
35901
+ if (patch.brightness !== void 0 || patch.contrast !== void 0)
35902
+ upsert2("luminance", (effect) => ({
35903
+ ...effect?.kind === "luminance" ? effect : { kind: "luminance" },
35904
+ ...patch.brightness !== void 0 ? { brightness: patch.brightness } : {},
35905
+ ...patch.contrast !== void 0 ? { contrast: patch.contrast } : {}
35906
+ }));
35907
+ if (patch.alpha !== void 0)
35908
+ upsert2("alphaModFix", (effect) => ({
35909
+ ...effect?.kind === "alphaModFix" ? effect : { kind: "alphaModFix" },
35910
+ amount: patch.alpha
35911
+ }));
35912
+ if (patch.standard) {
35913
+ const target = patch.standard;
35914
+ const matches = result.flatMap(
35915
+ (effect, index2) => effect.kind === "standard" && effect.name === target.name || effect.kind === "unsupported" && effect.name === target.name ? [index2] : []
35916
+ );
35917
+ if (matches.length > 1 || matches.some((index2) => result[index2]?.kind === "unsupported"))
35918
+ throw new Error(`Ambiguous or unreadable picture effect: ${target.name}`);
35919
+ const index = matches[0], before = index === void 0 ? void 0 : result[index];
35920
+ const next = {
35921
+ ...before?.kind === "standard" ? before : {},
35922
+ ...target,
35923
+ kind: "standard"
35924
+ };
35925
+ const doc = parseXml(next.sourceXml ?? `<a:${next.name} xmlns:a="${NS.a}"/>`);
35926
+ applyStandardPictureEffect(doc.documentElement, next);
35927
+ if (index === void 0) {
35928
+ const ext = result.findIndex(
35929
+ (effect) => effect.kind === "artistic" || effect.kind === "unsupported" && effect.name === "extLst"
35930
+ );
35931
+ result.splice(ext < 0 ? result.length : ext, 0, next);
35932
+ } else result[index] = next;
35933
+ }
35934
+ return result;
35935
+ }
35868
35936
  var init_picture_effects = __esm({
35869
35937
  "drawingml/picture-effects.ts"() {
35870
35938
  init_picture_artistic();
@@ -41694,18 +41762,18 @@ function groupTransform(group, parent) {
41694
41762
  const ext = first(xfrm, "ext", NS.a);
41695
41763
  const chOff = first(xfrm, "chOff", NS.a);
41696
41764
  const chExt = first(xfrm, "chExt", NS.a);
41697
- const num4 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
41698
- const cx = num4(ext, "cx");
41699
- const cy = num4(ext, "cy");
41700
- const chCx = num4(chExt, "cx");
41701
- const chCy = num4(chExt, "cy");
41765
+ const num5 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
41766
+ const cx = num5(ext, "cx");
41767
+ const cy = num5(ext, "cy");
41768
+ const chCx = num5(chExt, "cx");
41769
+ const chCy = num5(chExt, "cy");
41702
41770
  if (!off || ![cx, cy, chCx, chCy].every(Number.isFinite) || chCx === 0 || chCy === 0)
41703
41771
  return parent;
41704
41772
  const scaleX = cx / chCx;
41705
41773
  const scaleY = cy / chCy;
41706
41774
  const local = {
41707
- offsetX: num4(off, "x") - (num4(chOff, "x") || 0) * scaleX,
41708
- offsetY: num4(off, "y") - (num4(chOff, "y") || 0) * scaleY,
41775
+ offsetX: num5(off, "x") - (num5(chOff, "x") || 0) * scaleX,
41776
+ offsetY: num5(off, "y") - (num5(chOff, "y") || 0) * scaleY,
41709
41777
  scaleX,
41710
41778
  scaleY
41711
41779
  };
@@ -48738,9 +48806,9 @@ function parseValueColorPositions(node, xmlLookup) {
48738
48806
  const entry2 = { kind };
48739
48807
  const rawVal = posNode["@_val"];
48740
48808
  if (rawVal !== void 0) {
48741
- const num4 = Number.parseFloat(String(rawVal));
48742
- if (Number.isFinite(num4)) {
48743
- entry2.value = num4;
48809
+ const num5 = Number.parseFloat(String(rawVal));
48810
+ if (Number.isFinite(num5)) {
48811
+ entry2.value = num5;
48744
48812
  }
48745
48813
  }
48746
48814
  positions2.push(entry2);
@@ -49102,8 +49170,8 @@ var init_chart_cx_parser = __esm({
49102
49170
  // pptx/core/utils/chart-user-shapes-parser.ts
49103
49171
  function markerFraction(marker2, axis, xml) {
49104
49172
  const raw2 = xml.getScalarChildByLocalName(marker2, axis);
49105
- const num4 = Number.parseFloat(String(raw2 ?? ""));
49106
- return Number.isFinite(num4) ? num4 : 0;
49173
+ const num5 = Number.parseFloat(String(raw2 ?? ""));
49174
+ return Number.isFinite(num5) ? num5 : 0;
49107
49175
  }
49108
49176
  function parseShapeParagraphs(shape2, xml, colors) {
49109
49177
  const txBody = xml.getChildByLocalName(shape2, "txBody");
@@ -49226,13 +49294,13 @@ function buildUserShape(shape2, kind, base, xml, colors) {
49226
49294
  };
49227
49295
  }
49228
49296
  function parseOffExt(offNode, extNode) {
49229
- const num4 = (node, attr6) => {
49297
+ const num5 = (node, attr6) => {
49230
49298
  const raw2 = Number.parseFloat(String(node?.[attr6] ?? ""));
49231
49299
  return Number.isFinite(raw2) ? raw2 : 0;
49232
49300
  };
49233
49301
  return {
49234
- off: { x: num4(offNode, "@_x"), y: num4(offNode, "@_y") },
49235
- ext: { cx: num4(extNode, "@_cx"), cy: num4(extNode, "@_cy") }
49302
+ off: { x: num5(offNode, "@_x"), y: num5(offNode, "@_y") },
49303
+ ext: { cx: num5(extNode, "@_cx"), cy: num5(extNode, "@_cy") }
49236
49304
  };
49237
49305
  }
49238
49306
  function parseGroupTransform(group, xml) {
@@ -49528,8 +49596,8 @@ function resolveCellValue(cell2, sharedStrings) {
49528
49596
  case "inlineStr":
49529
49597
  return cell2.value;
49530
49598
  default: {
49531
- const num4 = Number.parseFloat(cell2.value);
49532
- return Number.isFinite(num4) ? num4 : cell2.value;
49599
+ const num5 = Number.parseFloat(cell2.value);
49600
+ return Number.isFinite(num5) ? num5 : cell2.value;
49533
49601
  }
49534
49602
  }
49535
49603
  }
@@ -49614,8 +49682,8 @@ async function parseEmbeddedXlsx(xlsxData) {
49614
49682
  } else if (typeof cellVal === "number") {
49615
49683
  values.push(cellVal);
49616
49684
  } else {
49617
- const num4 = Number.parseFloat(String(cellVal));
49618
- values.push(Number.isFinite(num4) ? num4 : 0);
49685
+ const num5 = Number.parseFloat(String(cellVal));
49686
+ values.push(Number.isFinite(num5) ? num5 : 0);
49619
49687
  }
49620
49688
  }
49621
49689
  series.push({ name, values });
@@ -50129,8 +50197,8 @@ function parseVmlOpacity(value) {
50129
50197
  const pct = parseFloat(trimmed2.slice(0, -1));
50130
50198
  return Number.isFinite(pct) ? pct / 100 : void 0;
50131
50199
  }
50132
- const num4 = parseFloat(trimmed2);
50133
- return Number.isFinite(num4) ? Math.min(1, Math.max(0, num4)) : void 0;
50200
+ const num5 = parseFloat(trimmed2);
50201
+ return Number.isFinite(num5) ? Math.min(1, Math.max(0, num5)) : void 0;
50134
50202
  }
50135
50203
  var NAMED_COLORS;
50136
50204
  var init_vml_color_parser = __esm({
@@ -50173,29 +50241,29 @@ function parseCssDimension(value, containerPx) {
50173
50241
  if (trimmed2.length === 0) {
50174
50242
  return 0;
50175
50243
  }
50176
- const num4 = parseFloat(trimmed2);
50177
- if (!Number.isFinite(num4)) {
50244
+ const num5 = parseFloat(trimmed2);
50245
+ if (!Number.isFinite(num5)) {
50178
50246
  return 0;
50179
50247
  }
50180
50248
  if (trimmed2.endsWith("pt")) {
50181
- return num4 / PT_PER_PX2;
50249
+ return num5 / PT_PER_PX2;
50182
50250
  }
50183
50251
  if (trimmed2.endsWith("in")) {
50184
- return num4 * 96;
50252
+ return num5 * 96;
50185
50253
  }
50186
50254
  if (trimmed2.endsWith("cm")) {
50187
- return num4 * (96 / 2.54);
50255
+ return num5 * (96 / 2.54);
50188
50256
  }
50189
50257
  if (trimmed2.endsWith("mm")) {
50190
- return num4 * (96 / 25.4);
50258
+ return num5 * (96 / 25.4);
50191
50259
  }
50192
50260
  if (trimmed2.endsWith("emu")) {
50193
- return num4 / EMU_PER_PX6;
50261
+ return num5 / EMU_PER_PX6;
50194
50262
  }
50195
50263
  if (trimmed2.endsWith("%")) {
50196
- return containerPx ? num4 / 100 * containerPx : 0;
50264
+ return containerPx ? num5 / 100 * containerPx : 0;
50197
50265
  }
50198
- return num4;
50266
+ return num5;
50199
50267
  }
50200
50268
  function parseVmlStyle(styleAttr) {
50201
50269
  const result = {};
@@ -60435,6 +60503,130 @@ var init_json = __esm({
60435
60503
  }
60436
60504
  });
60437
60505
 
60506
+ // pptx/core/utils/slide-background-gradient.ts
60507
+ function cssColor(color3, opacity2) {
60508
+ if (opacity2 === void 0 || opacity2 >= 1) {
60509
+ return color3;
60510
+ }
60511
+ const hex3 = color3.replace("#", "");
60512
+ const channel = (index) => Number.parseInt(hex3.slice(index, index + 2), 16);
60513
+ return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num3(opacity2)})`;
60514
+ }
60515
+ function slideBackgroundGradientCss(gradient) {
60516
+ const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num3(stop.position)}%`).join(", ");
60517
+ if (gradient.fillGradientType !== "radial") {
60518
+ const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
60519
+ return `linear-gradient(${num3(angle)}deg, ${stops})`;
60520
+ }
60521
+ const focus = gradient.fillGradientFillToRect;
60522
+ const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
60523
+ const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
60524
+ const at2 = `at ${num3(cx)}% ${num3(cy)}%`;
60525
+ switch (gradient.fillGradientPathType) {
60526
+ case "rect":
60527
+ return `radial-gradient(${num3(Math.max(cx, 100 - cx))}% ${num3(Math.max(cy, 100 - cy))}% ${at2}, ${stops})`;
60528
+ case "shape":
60529
+ return `radial-gradient(farthest-side ${at2}, ${stops})`;
60530
+ default:
60531
+ return `radial-gradient(circle ${at2}, ${stops})`;
60532
+ }
60533
+ }
60534
+ function slideBackgroundGradientToWrite(slide) {
60535
+ const gradient = slide.backgroundGradientFill;
60536
+ if (!gradient || !slide.backgroundGradient) {
60537
+ return void 0;
60538
+ }
60539
+ return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
60540
+ }
60541
+ var num3;
60542
+ var init_slide_background_gradient = __esm({
60543
+ "pptx/core/utils/slide-background-gradient.ts"() {
60544
+ init_gradient_angle();
60545
+ num3 = (value) => String(Number(value.toFixed(3)));
60546
+ }
60547
+ });
60548
+
60549
+ // pptx/core/builders/sdk/background-gradient-input.ts
60550
+ function finite3(name, value, min, max) {
60551
+ if (typeof value !== "number" || !Number.isFinite(value)) {
60552
+ throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
60553
+ }
60554
+ if (min !== void 0 && value < min || max !== void 0 && value > max) {
60555
+ throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
60556
+ }
60557
+ return value;
60558
+ }
60559
+ function stopsOf(input) {
60560
+ if (!Array.isArray(input.stops) || input.stops.length < 2) {
60561
+ throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
60562
+ }
60563
+ return input.stops.map((stop, index) => {
60564
+ if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
60565
+ throw new RangeError(
60566
+ `${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
60567
+ );
60568
+ }
60569
+ const position4 = finite3(`stops[${index}].position`, stop.position, 0, 1);
60570
+ const opacity2 = stop.opacity === void 0 ? void 0 : finite3(`stops[${index}].opacity`, stop.opacity, 0, 1);
60571
+ return {
60572
+ color: `#${stop.color.replace("#", "").toUpperCase()}`,
60573
+ // The shape gradient model keeps positions in percent.
60574
+ position: position4 * 100,
60575
+ ...opacity2 !== void 0 ? { opacity: opacity2 } : {}
60576
+ };
60577
+ });
60578
+ }
60579
+ function mapBackgroundGradientInput(input) {
60580
+ const fillGradientStops = stopsOf(input);
60581
+ let gradient;
60582
+ if (input.path !== void 0) {
60583
+ if (!PATHS.has(input.path)) {
60584
+ throw new RangeError(
60585
+ `${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
60586
+ );
60587
+ }
60588
+ if (input.angle !== void 0) {
60589
+ throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
60590
+ }
60591
+ const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
60592
+ gradient = {
60593
+ fillGradientType: "radial",
60594
+ fillGradientPathType: input.path,
60595
+ fillGradientStops,
60596
+ fillGradientFillToRect: {
60597
+ l: finite3("focus.l", focus.l),
60598
+ t: finite3("focus.t", focus.t),
60599
+ r: finite3("focus.r", focus.r),
60600
+ b: finite3("focus.b", focus.b)
60601
+ }
60602
+ };
60603
+ } else {
60604
+ if (input.focus !== void 0) {
60605
+ throw new RangeError(`${WHERE}.focus needs a path gradient`);
60606
+ }
60607
+ const cssAngle = finite3("angle", input.angle ?? 180);
60608
+ gradient = {
60609
+ fillGradientType: "linear",
60610
+ fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
60611
+ fillGradientStops
60612
+ };
60613
+ }
60614
+ return {
60615
+ backgroundGradient: slideBackgroundGradientCss(gradient),
60616
+ backgroundGradientFill: gradient
60617
+ };
60618
+ }
60619
+ var HEX, PATHS, WHERE;
60620
+ var init_background_gradient_input = __esm({
60621
+ "pptx/core/builders/sdk/background-gradient-input.ts"() {
60622
+ init_gradient_angle();
60623
+ init_slide_background_gradient();
60624
+ HEX = /^#?[0-9a-f]{6}$/iu;
60625
+ PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
60626
+ WHERE = "BackgroundInput";
60627
+ }
60628
+ });
60629
+
60438
60630
  // pptx/core/core/runtime/table-style-defaults.ts
60439
60631
  var DEFAULT_POWERPOINT_TABLE_STYLE_ID;
60440
60632
  var init_table_style_defaults = __esm({
@@ -60810,8 +61002,8 @@ function authoredValue(node) {
60810
61002
  return void 0;
60811
61003
  }
60812
61004
  const raw2 = node["@_val"];
60813
- const num4 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
60814
- return Number.isFinite(num4) ? num4 : void 0;
61005
+ const num5 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
61006
+ return Number.isFinite(num5) ? num5 : void 0;
60815
61007
  }
60816
61008
  function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
60817
61009
  let changed = false;
@@ -61140,6 +61332,53 @@ var init_chart_layout_operations = __esm({
61140
61332
  }
61141
61333
  });
61142
61334
 
61335
+ // pptx/core/builders/sdk/picture-effects-input.ts
61336
+ function pictureEffectsFromInput(options2) {
61337
+ const { opacity: opacity2, brightness, contrast } = options2 ?? {};
61338
+ if (opacity2 !== void 0 && !(opacity2 >= 0 && opacity2 <= 1)) {
61339
+ throw new RangeError(`ImageOptions.opacity must be between 0 and 1, got ${opacity2}`);
61340
+ }
61341
+ const patch = {};
61342
+ if (opacity2 !== void 0 && opacity2 < 1) {
61343
+ patch.alpha = opacity2;
61344
+ }
61345
+ if (brightness !== void 0) {
61346
+ patch.brightness = brightness / 100;
61347
+ }
61348
+ if (contrast !== void 0) {
61349
+ patch.contrast = contrast / 100;
61350
+ }
61351
+ if (Object.keys(patch).length === 0) {
61352
+ return void 0;
61353
+ }
61354
+ let patched;
61355
+ try {
61356
+ patched = patchPictureEffects([], patch);
61357
+ } catch (error) {
61358
+ throw new RangeError(
61359
+ `ImageOptions.brightness and contrast must be finite percentages from -100 to 100 (${String(error)})`
61360
+ );
61361
+ }
61362
+ let effects2;
61363
+ for (const effect of patched) {
61364
+ effects2 ??= {};
61365
+ if (effect.kind === "alphaModFix") {
61366
+ effects2.alphaModFix = effect.amount * 100;
61367
+ } else if (effect.kind === "luminance") {
61368
+ effects2.lum = {
61369
+ ...effect.brightness !== void 0 ? { bright: effect.brightness * 100 } : {},
61370
+ ...effect.contrast !== void 0 ? { contrast: effect.contrast * 100 } : {}
61371
+ };
61372
+ }
61373
+ }
61374
+ return effects2;
61375
+ }
61376
+ var init_picture_effects_input = __esm({
61377
+ "pptx/core/builders/sdk/picture-effects-input.ts"() {
61378
+ init_picture_effects();
61379
+ }
61380
+ });
61381
+
61143
61382
  // pptx/core/builders/sdk/shape-style-input.ts
61144
61383
  function mapFillToShapeStyle(fill3) {
61145
61384
  if (!fill3) {
@@ -61780,12 +62019,13 @@ function createConnectorElement(options2) {
61780
62019
  function createImageElement(source2, options2) {
61781
62020
  const p2 = pos("image", options2);
61782
62021
  const isDataUrl = source2.startsWith("data:");
62022
+ const imageEffects = pictureEffectsFromInput(options2);
61783
62023
  return {
61784
62024
  type: "image",
61785
62025
  id: generateId("img"),
61786
62026
  ...p2,
61787
62027
  rotation: options2?.rotation,
61788
- opacity: options2?.opacity,
62028
+ ...imageEffects ? { imageEffects } : {},
61789
62029
  imagePath: isDataUrl ? void 0 : source2,
61790
62030
  imageData: isDataUrl ? source2 : void 0,
61791
62031
  altText: options2?.altText,
@@ -61953,6 +62193,7 @@ var init_ElementFactory = __esm({
61953
62193
  init_custom_geometry();
61954
62194
  init_chart_gradient_input();
61955
62195
  init_chart_layout_operations();
62196
+ init_picture_effects_input();
61956
62197
  init_table_cell_input();
61957
62198
  init_table_merge_input();
61958
62199
  init_text_segment_style();
@@ -61975,6 +62216,7 @@ var init_ElementFactory = __esm({
61975
62216
  var SlideBuilder;
61976
62217
  var init_SlideBuilder = __esm({
61977
62218
  "pptx/core/builders/sdk/SlideBuilder.ts"() {
62219
+ init_background_gradient_input();
61978
62220
  init_ElementFactory();
61979
62221
  SlideBuilder = class {
61980
62222
  /**
@@ -62085,12 +62327,12 @@ var init_SlideBuilder = __esm({
62085
62327
  switch (bg.type) {
62086
62328
  case "solid":
62087
62329
  this.slide.backgroundColor = bg.color;
62330
+ delete this.slide.backgroundGradient;
62331
+ delete this.slide.backgroundGradientFill;
62088
62332
  break;
62089
- case "gradient": {
62090
- const stops = bg.stops.map((s) => `${s.color} ${Math.round(s.position * 100)}%`).join(", ");
62091
- this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
62333
+ case "gradient":
62334
+ Object.assign(this.slide, mapBackgroundGradientInput(bg));
62092
62335
  break;
62093
- }
62094
62336
  case "image":
62095
62337
  this.slide.backgroundImage = bg.source;
62096
62338
  break;
@@ -62353,6 +62595,174 @@ var init_layout_operations = __esm({
62353
62595
  }
62354
62596
  });
62355
62597
 
62598
+ // pptx/core/utils/document-properties-model.ts
62599
+ function toPptxCoreProperties(core) {
62600
+ const result = {};
62601
+ for (const field of CORE_FIELDS) result[field] = trimmed(core[field]);
62602
+ return anyDefined(result) ? result : void 0;
62603
+ }
62604
+ function toPptxAppProperties(app) {
62605
+ const result = {
62606
+ application: trimmed(app.application),
62607
+ appVersion: trimmed(app.appVersion),
62608
+ presentationFormat: trimmed(app.presentationFormat),
62609
+ slides: app.slides,
62610
+ hiddenSlides: app.hiddenSlides,
62611
+ notes: app.notes,
62612
+ totalTime: app.totalTime,
62613
+ words: app.words,
62614
+ paragraphs: app.paragraphs,
62615
+ company: trimmed(app.company),
62616
+ manager: trimmed(app.manager),
62617
+ template: trimmed(app.template),
62618
+ hyperlinkBase: trimmed(app.hyperlinkBase),
62619
+ docSecurity: app.docSecurity,
62620
+ mmClips: app.mmClips,
62621
+ scaleCrop: app.scaleCrop,
62622
+ linksUpToDate: app.linksUpToDate,
62623
+ sharedDoc: app.sharedDoc,
62624
+ hyperlinksChanged: app.hyperlinksChanged
62625
+ };
62626
+ return anyDefined(result) ? result : void 0;
62627
+ }
62628
+ function toPptxCustomProperties(texts) {
62629
+ return texts.flatMap((entry2) => {
62630
+ const name = entry2.name.trim();
62631
+ if (!name) return [];
62632
+ const known = CUSTOM_TYPES.has(entry2.type);
62633
+ return [{ name, value: known ? entry2.text : "", type: known ? entry2.type : "unknown" }];
62634
+ });
62635
+ }
62636
+ function applyCoreOverrides(core, overrides) {
62637
+ const next = { ...core };
62638
+ for (const field of CORE_FIELDS) {
62639
+ const value = overrides?.[field];
62640
+ if (value === void 0) continue;
62641
+ const text2 = String(value).trim();
62642
+ if (text2) next[field] = text2;
62643
+ else delete next[field];
62644
+ }
62645
+ return next;
62646
+ }
62647
+ function applyAppOverrides(app, overrides) {
62648
+ const next = { ...app };
62649
+ for (const field of APP_TEXT_OVERRIDES) {
62650
+ const value = overrides?.[field];
62651
+ if (value === void 0) continue;
62652
+ const text2 = String(value).trim();
62653
+ if (text2) next[field] = text2;
62654
+ else delete next[field];
62655
+ }
62656
+ for (const field of APP_NUMBER_OVERRIDES) {
62657
+ const value = Number(overrides?.[field]);
62658
+ if (overrides?.[field] !== void 0 && Number.isFinite(value)) next[field] = Math.trunc(value);
62659
+ }
62660
+ return next;
62661
+ }
62662
+ function toCustomProperty(entry2) {
62663
+ const type = String(entry2.type || "lpwstr").trim().toLowerCase();
62664
+ return customPropertyFromText(
62665
+ entry2.name,
62666
+ CUSTOM_TYPES.has(type) ? type : "lpwstr",
62667
+ String(entry2.value ?? "")
62668
+ );
62669
+ }
62670
+ var CORE_FIELDS, APP_TEXT_OVERRIDES, APP_NUMBER_OVERRIDES, trimmed, anyDefined, CUSTOM_TYPES;
62671
+ var init_document_properties_model = __esm({
62672
+ "pptx/core/utils/document-properties-model.ts"() {
62673
+ init_properties();
62674
+ CORE_FIELDS = [
62675
+ "title",
62676
+ "subject",
62677
+ "creator",
62678
+ "keywords",
62679
+ "description",
62680
+ "lastModifiedBy",
62681
+ "revision",
62682
+ "created",
62683
+ "modified",
62684
+ "category",
62685
+ "contentStatus"
62686
+ ];
62687
+ APP_TEXT_OVERRIDES = [
62688
+ "application",
62689
+ "appVersion",
62690
+ "presentationFormat",
62691
+ "company",
62692
+ "manager",
62693
+ "template"
62694
+ ];
62695
+ APP_NUMBER_OVERRIDES = [
62696
+ "slides",
62697
+ "hiddenSlides",
62698
+ "notes",
62699
+ "totalTime",
62700
+ "words",
62701
+ "paragraphs"
62702
+ ];
62703
+ trimmed = (value) => value?.trim() || void 0;
62704
+ anyDefined = (record2) => Object.values(record2).some((value) => value !== void 0);
62705
+ CUSTOM_TYPES = /* @__PURE__ */ new Set(["lpwstr", "i4", "bool", "filetime", "r8", "i2", "ui4", "lpstr"]);
62706
+ }
62707
+ });
62708
+
62709
+ // pptx/core/builders/sdk/presentation-app-properties.ts
62710
+ function blankAppXml(slideCount) {
62711
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
62712
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
62713
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
62714
+ <Application>pptx-viewer-sdk</Application>
62715
+ <Slides>${slideCount}</Slides>
62716
+ <ScaleCrop>false</ScaleCrop>
62717
+ <LinksUpToDate>false</LinksUpToDate>
62718
+ <SharedDoc>false</SharedDoc>
62719
+ <HyperlinksChanged>false</HyperlinksChanged>
62720
+ <AppVersion>1.0000</AppVersion>
62721
+ </Properties>`;
62722
+ }
62723
+ function validate(input) {
62724
+ for (const [field, value] of Object.entries(input)) {
62725
+ if (!INPUT_FIELDS.has(field)) {
62726
+ throw new RangeError(
62727
+ `appProperties.${field} cannot be set when a presentation is created; it takes ${[...INPUT_FIELDS].join(", ")} (counts are computed on save)`
62728
+ );
62729
+ }
62730
+ if (value !== void 0 && typeof value !== "string") {
62731
+ throw new RangeError(`appProperties.${field} must be a string`);
62732
+ }
62733
+ }
62734
+ const version = input.appVersion?.trim();
62735
+ if (version && !APP_VERSION.test(version)) {
62736
+ throw new RangeError(
62737
+ `appProperties.appVersion must be digits, a dot and four digits (e.g. "16.0000"), got "${input.appVersion}"`
62738
+ );
62739
+ }
62740
+ }
62741
+ function newPresentationAppXml(slideCount, input) {
62742
+ const xml = blankAppXml(slideCount);
62743
+ if (input === void 0) {
62744
+ return xml;
62745
+ }
62746
+ validate(input);
62747
+ return writeAppProperties(applyAppOverrides(parseAppProperties(xml), input), xml);
62748
+ }
62749
+ var INPUT_FIELDS, APP_VERSION;
62750
+ var init_presentation_app_properties = __esm({
62751
+ "pptx/core/builders/sdk/presentation-app-properties.ts"() {
62752
+ init_properties();
62753
+ init_document_properties_model();
62754
+ INPUT_FIELDS = /* @__PURE__ */ new Set([
62755
+ "application",
62756
+ "appVersion",
62757
+ "presentationFormat",
62758
+ "company",
62759
+ "manager",
62760
+ "template"
62761
+ ]);
62762
+ APP_VERSION = /^\d+\.\d{4}$/u;
62763
+ }
62764
+ });
62765
+
62356
62766
  // pptx/core/builders/sdk/standard-layout-placeholders.ts
62357
62767
  function standardLayoutPlaceholders(type, width, height) {
62358
62768
  if (type === "blank") return [];
@@ -62677,19 +63087,6 @@ function corePropsXml(title, creator) {
62677
63087
  <dcterms:modified xsi:type="dcterms:W3CDTF">${now}</dcterms:modified>
62678
63088
  </cp:coreProperties>`;
62679
63089
  }
62680
- function appPropsXml(slideCount) {
62681
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
62682
- <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
62683
- xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
62684
- <Application>pptx-viewer-sdk</Application>
62685
- <Slides>${slideCount}</Slides>
62686
- <ScaleCrop>false</ScaleCrop>
62687
- <LinksUpToDate>false</LinksUpToDate>
62688
- <SharedDoc>false</SharedDoc>
62689
- <HyperlinksChanged>false</HyperlinksChanged>
62690
- <AppVersion>1.0000</AppVersion>
62691
- </Properties>`;
62692
- }
62693
63090
  async function buildBlankPresentationArchive(options2) {
62694
63091
  const width = options2?.width ?? DEFAULT_WIDTH;
62695
63092
  const height = options2?.height ?? DEFAULT_HEIGHT;
@@ -62731,7 +63128,7 @@ async function buildBlankPresentationArchive(options2) {
62731
63128
  zip.file("ppt/viewProps.xml", viewPropsXml());
62732
63129
  zip.file("ppt/tableStyles.xml", tableStylesXml());
62733
63130
  zip.file("docProps/core.xml", corePropsXml(options2?.title, options2?.creator));
62734
- zip.file("docProps/app.xml", appPropsXml(initialSlideCount));
63131
+ zip.file("docProps/app.xml", newPresentationAppXml(initialSlideCount, options2?.appProperties));
62735
63132
  return zip.generateAsync({ type: "arraybuffer" });
62736
63133
  }
62737
63134
  var DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_COLORS2, DEFAULT_MAJOR_FONT, DEFAULT_MINOR_FONT, STANDARD_LAYOUTS, PresentationBuilder;
@@ -62741,6 +63138,7 @@ var init_PresentationBuilder = __esm({
62741
63138
  init_PptxHandler();
62742
63139
  init_SlideBuilder();
62743
63140
  init_layout_operations();
63141
+ init_presentation_app_properties();
62744
63142
  init_standard_layout_placeholders();
62745
63143
  DEFAULT_WIDTH = 12192e3;
62746
63144
  DEFAULT_HEIGHT = 6858e3;
@@ -65993,7 +66391,15 @@ var init_PptxSlideBackgroundBuilder = __esm({
65993
66391
  init.reportUnsupportedBackground?.(rawBackgroundImage);
65994
66392
  }
65995
66393
  }
65996
- if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
66394
+ if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
66395
+ const gradFill2 = init.buildBackgroundGradientFill?.();
66396
+ if (gradFill2) {
66397
+ backgroundProperties["a:gradFill"] = gradFill2;
66398
+ } else if (!hasBackgroundColor && !hasBackgroundImage) {
66399
+ init.reportUnsupportedGradient?.();
66400
+ }
66401
+ }
66402
+ if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
65997
66403
  backgroundProperties["a:solidFill"] = {
65998
66404
  "a:srgbClr": {
65999
66405
  "@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
@@ -70886,8 +71292,8 @@ function decodeAinkInk(inkRoot) {
70886
71292
  if (raw2.length === 0) {
70887
71293
  return 2;
70888
71294
  }
70889
- const num4 = Number(raw2);
70890
- return Number.isFinite(num4) && num4 > 0 ? num4 : 2;
71295
+ const num5 = Number(raw2);
71296
+ return Number.isFinite(num5) && num5 > 0 ? num5 : 2;
70891
71297
  })();
70892
71298
  const traces = ensureArrayLike3(inkRoot["aink:trace"]);
70893
71299
  for (const trace of traces) {
@@ -72896,117 +73302,6 @@ var init_app_properties_text_stats = __esm({
72896
73302
  }
72897
73303
  });
72898
73304
 
72899
- // pptx/core/utils/document-properties-model.ts
72900
- function toPptxCoreProperties(core) {
72901
- const result = {};
72902
- for (const field of CORE_FIELDS) result[field] = trimmed(core[field]);
72903
- return anyDefined(result) ? result : void 0;
72904
- }
72905
- function toPptxAppProperties(app) {
72906
- const result = {
72907
- application: trimmed(app.application),
72908
- appVersion: trimmed(app.appVersion),
72909
- presentationFormat: trimmed(app.presentationFormat),
72910
- slides: app.slides,
72911
- hiddenSlides: app.hiddenSlides,
72912
- notes: app.notes,
72913
- totalTime: app.totalTime,
72914
- words: app.words,
72915
- paragraphs: app.paragraphs,
72916
- company: trimmed(app.company),
72917
- manager: trimmed(app.manager),
72918
- template: trimmed(app.template),
72919
- hyperlinkBase: trimmed(app.hyperlinkBase),
72920
- docSecurity: app.docSecurity,
72921
- mmClips: app.mmClips,
72922
- scaleCrop: app.scaleCrop,
72923
- linksUpToDate: app.linksUpToDate,
72924
- sharedDoc: app.sharedDoc,
72925
- hyperlinksChanged: app.hyperlinksChanged
72926
- };
72927
- return anyDefined(result) ? result : void 0;
72928
- }
72929
- function toPptxCustomProperties(texts) {
72930
- return texts.flatMap((entry2) => {
72931
- const name = entry2.name.trim();
72932
- if (!name) return [];
72933
- const known = CUSTOM_TYPES.has(entry2.type);
72934
- return [{ name, value: known ? entry2.text : "", type: known ? entry2.type : "unknown" }];
72935
- });
72936
- }
72937
- function applyCoreOverrides(core, overrides) {
72938
- const next = { ...core };
72939
- for (const field of CORE_FIELDS) {
72940
- const value = overrides?.[field];
72941
- if (value === void 0) continue;
72942
- const text2 = String(value).trim();
72943
- if (text2) next[field] = text2;
72944
- else delete next[field];
72945
- }
72946
- return next;
72947
- }
72948
- function applyAppOverrides(app, overrides) {
72949
- const next = { ...app };
72950
- for (const field of APP_TEXT_OVERRIDES) {
72951
- const value = overrides?.[field];
72952
- if (value === void 0) continue;
72953
- const text2 = String(value).trim();
72954
- if (text2) next[field] = text2;
72955
- else delete next[field];
72956
- }
72957
- for (const field of APP_NUMBER_OVERRIDES) {
72958
- const value = Number(overrides?.[field]);
72959
- if (overrides?.[field] !== void 0 && Number.isFinite(value)) next[field] = Math.trunc(value);
72960
- }
72961
- return next;
72962
- }
72963
- function toCustomProperty(entry2) {
72964
- const type = String(entry2.type || "lpwstr").trim().toLowerCase();
72965
- return customPropertyFromText(
72966
- entry2.name,
72967
- CUSTOM_TYPES.has(type) ? type : "lpwstr",
72968
- String(entry2.value ?? "")
72969
- );
72970
- }
72971
- var CORE_FIELDS, APP_TEXT_OVERRIDES, APP_NUMBER_OVERRIDES, trimmed, anyDefined, CUSTOM_TYPES;
72972
- var init_document_properties_model = __esm({
72973
- "pptx/core/utils/document-properties-model.ts"() {
72974
- init_properties();
72975
- CORE_FIELDS = [
72976
- "title",
72977
- "subject",
72978
- "creator",
72979
- "keywords",
72980
- "description",
72981
- "lastModifiedBy",
72982
- "revision",
72983
- "created",
72984
- "modified",
72985
- "category",
72986
- "contentStatus"
72987
- ];
72988
- APP_TEXT_OVERRIDES = [
72989
- "application",
72990
- "appVersion",
72991
- "presentationFormat",
72992
- "company",
72993
- "manager",
72994
- "template"
72995
- ];
72996
- APP_NUMBER_OVERRIDES = [
72997
- "slides",
72998
- "hiddenSlides",
72999
- "notes",
73000
- "totalTime",
73001
- "words",
73002
- "paragraphs"
73003
- ];
73004
- trimmed = (value) => value?.trim() || void 0;
73005
- anyDefined = (record2) => Object.values(record2).some((value) => value !== void 0);
73006
- CUSTOM_TYPES = /* @__PURE__ */ new Set(["lpwstr", "i4", "bool", "filetime", "r8", "i2", "ui4", "lpstr"]);
73007
- }
73008
- });
73009
-
73010
73305
  // pptx/core/services/custom-properties-package.ts
73011
73306
  async function ensureCustomPropertiesPackagingArtifacts(context) {
73012
73307
  const ctFile = context.zip.file("[Content_Types].xml");
@@ -73048,9 +73343,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
73048
73343
  let maxId = 0;
73049
73344
  for (const rel of rels) {
73050
73345
  const id = String(rel?.["@_Id"] || "");
73051
- const num4 = Number.parseInt(id.replace(/^rId/, ""), 10);
73052
- if (Number.isFinite(num4) && num4 > maxId) {
73053
- maxId = num4;
73346
+ const num5 = Number.parseInt(id.replace(/^rId/, ""), 10);
73347
+ if (Number.isFinite(num5) && num5 > maxId) {
73348
+ maxId = num5;
73054
73349
  }
73055
73350
  }
73056
73351
  rels.push({
@@ -73135,11 +73430,11 @@ var init_PptxDocumentPropertiesUpdater = __esm({
73135
73430
  this.context = context;
73136
73431
  }
73137
73432
  async updateOnSave(slides, options2) {
73138
- await this.updateCoreProperties(options2?.coreProperties);
73433
+ await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
73139
73434
  await this.updateAppProperties(slides, options2?.appProperties);
73140
73435
  await this.updateCustomProperties(options2?.customProperties);
73141
73436
  }
73142
- async updateCoreProperties(overrides) {
73437
+ async updateCoreProperties(overrides, fixedDate) {
73143
73438
  const coreFile = this.context.zip.file("docProps/core.xml");
73144
73439
  if (!coreFile) {
73145
73440
  return;
@@ -73148,7 +73443,12 @@ var init_PptxDocumentPropertiesUpdater = __esm({
73148
73443
  const coreXml = await coreFile.async("string");
73149
73444
  const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
73150
73445
  const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
73151
- const next = {
73446
+ const next = fixedDate ? {
73447
+ ...core,
73448
+ revision: overrides?.revision ?? "1",
73449
+ created: overrides?.created ?? formatW3cdtf(fixedDate),
73450
+ modified: overrides?.modified ?? formatW3cdtf(fixedDate)
73451
+ } : {
73152
73452
  ...core,
73153
73453
  revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
73154
73454
  modified: formatW3cdtf(/* @__PURE__ */ new Date())
@@ -105397,7 +105697,7 @@ var init_type_axes = __esm({
105397
105697
  });
105398
105698
 
105399
105699
  // chart/edit/type.ts
105400
- function elementFor(kind, is3D) {
105700
+ function chartGroupElement(kind, is3D) {
105401
105701
  const match = Object.entries(CHART_GROUP_ELEMENTS).find(
105402
105702
  ([, value]) => value.kind === kind && value.is3D === is3D
105403
105703
  );
@@ -105412,7 +105712,7 @@ function groupingFor(element2, grouping) {
105412
105712
  }
105413
105713
  function newGroup(base, target, series) {
105414
105714
  const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
105415
- const element2 = elementFor(target.kind, is3D);
105715
+ const element2 = chartGroupElement(target.kind, is3D);
105416
105716
  const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
105417
105717
  const allowed = GROUP_FIELDS[element2] ?? [];
105418
105718
  for (const key2 of allowed)
@@ -105621,6 +105921,11 @@ var init_target = __esm({
105621
105921
  });
105622
105922
 
105623
105923
  // chart/edit/group-options.ts
105924
+ function assertChartGroupOption(key2, value) {
105925
+ const [min, max] = RANGES[key2];
105926
+ if (!Number.isInteger(value) || value < min || value > max)
105927
+ throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
105928
+ }
105624
105929
  function setChartGroupOptions2(space, seriesIndex, edit) {
105625
105930
  return editChartSpace(space, (draft) => {
105626
105931
  const { group } = chartSeriesEntryAt(draft, seriesIndex);
@@ -105633,9 +105938,7 @@ function setChartGroupOptions2(space, seriesIndex, edit) {
105633
105938
  delete group[key2];
105634
105939
  continue;
105635
105940
  }
105636
- const [min, max] = RANGES[key2];
105637
- if (!Number.isInteger(value) || value < min || value > max)
105638
- throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
105941
+ assertChartGroupOption(key2, value);
105639
105942
  group[key2] = value;
105640
105943
  }
105641
105944
  });
@@ -107344,8 +107647,8 @@ function titleText(title) {
107344
107647
  }
107345
107648
  function scalingFromNeutral(axis, out) {
107346
107649
  const { scaling } = axis;
107347
- setOrRemove(out, "min", finite3(scaling.min));
107348
- setOrRemove(out, "max", finite3(scaling.max));
107650
+ setOrRemove(out, "min", finite4(scaling.min));
107651
+ setOrRemove(out, "max", finite4(scaling.max));
107349
107652
  const logBase = scaling.logBase !== void 0 && scaling.logBase > 0 ? scaling.logBase : void 0;
107350
107653
  setOrRemove(out, "logBase", logBase);
107351
107654
  setOrRemove(out, "logScale", logBase !== void 0 ? true : void 0);
@@ -107357,7 +107660,7 @@ function labelsFromNeutral(axis, out) {
107357
107660
  setOrRemove(out, "minorTickMark", oneOf(TICK_MARKS2, axis.minorTickMark));
107358
107661
  setOrRemove(out, "tickLblPos", oneOf(["high", "low", "nextTo", "none"], axis.tickLabelPosition));
107359
107662
  setOrRemove(out, "crosses", oneOf(["autoZero", "min", "max"], axis.crosses));
107360
- setOrRemove(out, "crossesAt", finite3(axis.crossesAt));
107663
+ setOrRemove(out, "crossesAt", finite4(axis.crossesAt));
107361
107664
  const valueAxis = type === "valAx";
107362
107665
  const categoryOrDate = type === "catAx" || type === "dateAx";
107363
107666
  const skips = type === "catAx" || type === "serAx";
@@ -107411,8 +107714,8 @@ function axisFromNeutral(axis, out) {
107411
107714
  setOrRemove(out, "displayUnits", custom ? "custom" : builtIn);
107412
107715
  setOrRemove(out, "displayUnitsValue", custom || void 0);
107413
107716
  }
107414
- setOrRemove(out, "majorUnit", finite3(axis.majorUnit));
107415
- setOrRemove(out, "minorUnit", finite3(axis.minorUnit));
107717
+ setOrRemove(out, "majorUnit", finite4(axis.majorUnit));
107718
+ setOrRemove(out, "minorUnit", finite4(axis.minorUnit));
107416
107719
  setOrRemove(
107417
107720
  out,
107418
107721
  "baseTimeUnit",
@@ -107433,12 +107736,12 @@ function axesFromNeutral(axes, styled) {
107433
107736
  );
107434
107737
  });
107435
107738
  }
107436
- var oneOf, finite3, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
107739
+ var oneOf, finite4, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
107437
107740
  var init_chart_from_neutral_axes = __esm({
107438
107741
  "pptx/core/utils/chart-from-neutral-axes.ts"() {
107439
107742
  init_chart_from_neutral_labels();
107440
107743
  oneOf = (values, value) => value !== void 0 && values.includes(value) ? value : void 0;
107441
- finite3 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
107744
+ finite4 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
107442
107745
  positiveInteger = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : void 0;
107443
107746
  TICK_MARKS2 = ["cross", "in", "none", "out"];
107444
107747
  TIME_UNITS2 = ["days", "months", "years"];
@@ -118173,7 +118476,7 @@ async function readSlideMasterPaths(zip) {
118173
118476
  }
118174
118477
  return paths;
118175
118478
  }
118176
- function num3(xml, pattern) {
118479
+ function num4(xml, pattern) {
118177
118480
  const value = pattern.exec(xml)?.[1];
118178
118481
  return value === void 0 ? void 0 : Number(value);
118179
118482
  }
@@ -118185,14 +118488,14 @@ function readPlaceholders(masterXml) {
118185
118488
  continue;
118186
118489
  }
118187
118490
  const kind = PLACEHOLDER_KINDS[/\btype="([^"]+)"/u.exec(phType)?.[1] ?? "body"];
118188
- const x = num3(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
118189
- const y = num3(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
118190
- const w = num3(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
118191
- const h2 = num3(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
118491
+ const x = num4(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
118492
+ const y = num4(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
118493
+ const w = num4(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
118494
+ const h2 = num4(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
118192
118495
  if (!kind || x === void 0 || y === void 0 || !w || !h2 || out.some((p2) => p2.kind === kind)) {
118193
118496
  continue;
118194
118497
  }
118195
- const size = num3(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
118498
+ const size = num4(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
118196
118499
  out.push({ kind, rect: { x, y, w, h: h2 }, ...size ? { sizePt: size / 100 } : {} });
118197
118500
  }
118198
118501
  return out;
@@ -126682,26 +126985,26 @@ function buildImgEffects(effects2) {
126682
126985
  if (effects2.backgroundRemoval) {
126683
126986
  out.push({ "a14:backgroundRemoval": buildBackgroundRemovalNode(effects2.backgroundRemoval) });
126684
126987
  }
126685
- if (finite4(effects2.sharpenSoften?.amount)) {
126988
+ if (finite5(effects2.sharpenSoften?.amount)) {
126686
126989
  out.push({ "a14:sharpenSoften": { "@_amount": round4(effects2.sharpenSoften.amount) } });
126687
126990
  }
126688
126991
  const bc = effects2.brightnessContrast;
126689
- if (bc && (finite4(bc.bright) || finite4(bc.contrast))) {
126992
+ if (bc && (finite5(bc.bright) || finite5(bc.contrast))) {
126690
126993
  const node = {};
126691
- if (finite4(bc.bright)) {
126994
+ if (finite5(bc.bright)) {
126692
126995
  node["@_bright"] = round4(bc.bright);
126693
126996
  }
126694
- if (finite4(bc.contrast)) {
126997
+ if (finite5(bc.contrast)) {
126695
126998
  node["@_contrast"] = round4(bc.contrast);
126696
126999
  }
126697
127000
  out.push({ "a14:brightnessContrast": node });
126698
127001
  }
126699
- if (finite4(effects2.colorTemperature?.colorTemp)) {
127002
+ if (finite5(effects2.colorTemperature?.colorTemp)) {
126700
127003
  out.push({
126701
127004
  "a14:colorTemperature": { "@_colorTemp": round4(effects2.colorTemperature.colorTemp) }
126702
127005
  });
126703
127006
  }
126704
- if (finite4(effects2.colorSaturation?.sat)) {
127007
+ if (finite5(effects2.colorSaturation?.sat)) {
126705
127008
  out.push({ "a14:saturation": { "@_sat": round4(effects2.colorSaturation.sat) } });
126706
127009
  }
126707
127010
  const artistic = a14ArtisticElementName(effects2.artisticEffect);
@@ -126751,7 +127054,7 @@ function applyA14ImageExtension(blip, effects2) {
126751
127054
  extLst[extKey] = entries.length === 1 ? entries[0] : entries;
126752
127055
  blip[extLstKey] = extLst;
126753
127056
  }
126754
- var GALLERY_TO_A14, round4, finite4;
127057
+ var GALLERY_TO_A14, round4, finite5;
126755
127058
  var init_image_a14_effects_writer = __esm({
126756
127059
  "pptx/core/core/runtime/image-a14-effects-writer.ts"() {
126757
127060
  init_image_a14_effects();
@@ -126784,7 +127087,7 @@ var init_image_a14_effects_writer = __esm({
126784
127087
  watercolorSponge: "artisticWatercolorSponge"
126785
127088
  };
126786
127089
  round4 = (value) => String(Math.round(value));
126787
- finite4 = (value) => typeof value === "number" && Number.isFinite(value);
127090
+ finite5 = (value) => typeof value === "number" && Number.isFinite(value);
126788
127091
  }
126789
127092
  });
126790
127093
 
@@ -126964,6 +127267,21 @@ var init_image_alpha_effects = __esm({
126964
127267
  }
126965
127268
  });
126966
127269
 
127270
+ // pptx/core/core/runtime/blip-extension-order.ts
127271
+ function keepExtensionListLast(blip) {
127272
+ const key2 = Object.keys(blip).find((candidate) => candidate.split(":").at(-1) === "extLst");
127273
+ if (key2 === void 0) {
127274
+ return;
127275
+ }
127276
+ const value = blip[key2];
127277
+ delete blip[key2];
127278
+ blip[key2] = value;
127279
+ }
127280
+ var init_blip_extension_order = __esm({
127281
+ "pptx/core/core/runtime/blip-extension-order.ts"() {
127282
+ }
127283
+ });
127284
+
126967
127285
  // pptx/core/core/runtime/image-color-effects.ts
126968
127286
  function child32(parent, name) {
126969
127287
  if (!parent) {
@@ -132861,11 +133179,31 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
132861
133179
  * default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
132862
133180
  * module doc for why a nested group must not re-derive this itself.
132863
133181
  */
133182
+ /**
133183
+ * `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
133184
+ * mints reproducible ids and names (new table columns' `a16:colId`, the
133185
+ * fallback name of a new group) instead of random or time-based ones.
133186
+ */
133187
+ saveFixedDate;
133188
+ /**
133189
+ * The `p:cNvPr/@name` of a group with neither a name nor one from its
133190
+ * file: its element id, or for a reproducible save (`fixedDate`), which
133191
+ * must not depend on the time-based ids of elements made in code,
133192
+ * `Group <shape id>` as PowerPoint names groups.
133193
+ */
133194
+ groupFallbackName(group) {
133195
+ return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
133196
+ }
132864
133197
  buildGroupShapeXml(group, ctx, ownEmuOverride) {
132865
133198
  if (group.rawXml && group.children.length === 0) {
132866
133199
  return {
132867
133200
  ...group.rawXml,
132868
- "p:nvGrpSpPr": buildGroupNonVisualXml(group.rawXml, group.name, group.id, group.shapeId)
133201
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
133202
+ group.rawXml,
133203
+ group.name,
133204
+ this.groupFallbackName(group),
133205
+ group.shapeId
133206
+ )
132869
133207
  };
132870
133208
  }
132871
133209
  const EMU = _PptxHandlerRuntime.EMU_PER_PX;
@@ -132874,7 +133212,12 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
132874
133212
  const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
132875
133213
  const childSpace = group;
132876
133214
  const grpXml2 = {
132877
- "p:nvGrpSpPr": buildGroupNonVisualXml(rawGroupXml, group.name, group.id, group.shapeId),
133215
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
133216
+ rawGroupXml,
133217
+ group.name,
133218
+ this.groupFallbackName(group),
133219
+ group.shapeId
133220
+ ),
132878
133221
  "p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
132879
133222
  };
132880
133223
  const rawExtLst = rawGroupXml?.["p:extLst"];
@@ -132978,6 +133321,7 @@ var init_PptxHandlerRuntimeSaveImageEffects = __esm({
132978
133321
  init_crop_shape_geometry();
132979
133322
  init_image_a14_effects_writer();
132980
133323
  init_image_alpha_effects();
133324
+ init_blip_extension_order();
132981
133325
  init_image_color_effects();
132982
133326
  init_image_crop_save();
132983
133327
  init_PptxHandlerRuntimeSaveShapeXml();
@@ -133095,6 +133439,7 @@ var init_PptxHandlerRuntimeSaveImageEffects = __esm({
133095
133439
  delete blip["a:blur"];
133096
133440
  }
133097
133441
  applyA14ImageExtension(blip, nextEffects);
133442
+ keepExtensionListLast(blip);
133098
133443
  }
133099
133444
  normalizePresetGeometry(shapeType) {
133100
133445
  return this.elementXmlBuilder.normalizePresetGeometry(shapeType);
@@ -135856,7 +136201,15 @@ function slideContainsA16Element(node) {
135856
136201
  function randomColumnId() {
135857
136202
  return String(Math.floor(Math.random() * 4294967295));
135858
136203
  }
135859
- function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
136204
+ function deterministicColumnId(index) {
136205
+ let hash2 = 2166136261;
136206
+ for (const ch of `a16:colId:${index}`) {
136207
+ hash2 ^= ch.charCodeAt(0);
136208
+ hash2 = Math.imul(hash2, 16777619) >>> 0;
136209
+ }
136210
+ return String(hash2);
136211
+ }
136212
+ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
135860
136213
  const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
135861
136214
  const existingGridCols = ensureArrayFn(
135862
136215
  tbl["a:tblGrid"]?.["a:gridCol"]
@@ -135887,7 +136240,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
135887
136240
  // `ensureA16NamespaceOnSlideRoot`; emitting it here too is
135888
136241
  // schema-redundant and PowerPoint flags it.
135889
136242
  "a16:colId": {
135890
- "@_val": existingColIds[i2] || randomColumnId()
136243
+ "@_val": existingColIds[i2] || newColumnId(i2)
135891
136244
  }
135892
136245
  }
135893
136246
  }
@@ -136201,6 +136554,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
136201
136554
  init_table_style_change_cell_clear();
136202
136555
  init_table_paragraph_save_order();
136203
136556
  init_table_structural_ops();
136557
+ init_table_xml_rebuild();
136204
136558
  init_table_tblpr_save();
136205
136559
  CHART_DATA_DISPLAY_OPTIONS_EXT_URI = "{56B9EC1D-385E-4148-901F-78D8002777C0}";
136206
136560
  PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime23 {
@@ -136237,7 +136591,8 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
136237
136591
  tbl,
136238
136592
  tableData,
136239
136593
  _PptxHandlerRuntime.EMU_PER_PX,
136240
- this.ensureArray.bind(this)
136594
+ this.ensureArray.bind(this),
136595
+ this.saveFixedDate ? deterministicColumnId : void 0
136241
136596
  );
136242
136597
  const rebuiltRows = this.ensureArray(tbl["a:tr"]);
136243
136598
  for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
@@ -138846,9 +139201,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
138846
139201
  let maxId = 0;
138847
139202
  for (const rel of relationships3) {
138848
139203
  const id = String(rel?.["@_Id"] || "");
138849
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
138850
- if (Number.isFinite(num4) && num4 > maxId) {
138851
- maxId = num4;
139204
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
139205
+ if (Number.isFinite(num5) && num5 > maxId) {
139206
+ maxId = num5;
138852
139207
  }
138853
139208
  }
138854
139209
  const existingFontTargets = /* @__PURE__ */ new Set();
@@ -138991,9 +139346,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
138991
139346
  let maxId = 0;
138992
139347
  for (const rel of relationships3) {
138993
139348
  const id = String(rel?.["@_Id"] || "");
138994
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
138995
- if (Number.isFinite(num4) && num4 > maxId) {
138996
- maxId = num4;
139349
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
139350
+ if (Number.isFinite(num5) && num5 > maxId) {
139351
+ maxId = num5;
138997
139352
  }
138998
139353
  }
138999
139354
  relationships3.push({
@@ -143348,6 +143703,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
143348
143703
  init_slide_name();
143349
143704
  init_utils();
143350
143705
  init_modern_comment_package();
143706
+ init_slide_background_gradient();
143351
143707
  init_slide_synchronization();
143352
143708
  init_theme_override_utils();
143353
143709
  init_builders();
@@ -143605,6 +143961,16 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
143605
143961
  message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
143606
143962
  scope: "save",
143607
143963
  slideId: slide.id
143964
+ }),
143965
+ buildBackgroundGradientFill: () => {
143966
+ const gradient = slideBackgroundGradientToWrite(slide);
143967
+ return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
143968
+ },
143969
+ reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
143970
+ code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
143971
+ message: "Slide background gradient has no structured form (backgroundGradientFill) matching its CSS gradient and could not be written; the slide was saved without a background of its own.",
143972
+ scope: "save",
143973
+ slideId: slide.id
143608
143974
  })
143609
143975
  });
143610
143976
  this.slideCommentPartWriter.writeComments({
@@ -145956,6 +146322,15 @@ var init_PptxHandlerRuntimeSaveStructuralIds = __esm({
145956
146322
  });
145957
146323
 
145958
146324
  // pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts
146325
+ function validFixedDate(date) {
146326
+ if (date === void 0) {
146327
+ return void 0;
146328
+ }
146329
+ if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
146330
+ throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
146331
+ }
146332
+ return date;
146333
+ }
145959
146334
  var PptxHandlerRuntime54;
145960
146335
  var init_PptxHandlerRuntimeSavePipeline = __esm({
145961
146336
  "pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts"() {
@@ -146001,6 +146376,7 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
146001
146376
  /** One save, with the package to itself; callers go through {@link save}. */
146002
146377
  async saveNow(slides, options2) {
146003
146378
  validateSlideGeometry(slides);
146379
+ this.saveFixedDate = validFixedDate(options2?.fixedDate);
146004
146380
  const templates = [
146005
146381
  ...options2?.slideMasters ?? [],
146006
146382
  ...options2?.slideLayouts ?? [],
@@ -146191,7 +146567,8 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
146191
146567
  await this.documentPropertiesUpdater.updateOnSave(slides, {
146192
146568
  coreProperties: options2?.coreProperties,
146193
146569
  appProperties: options2?.appProperties,
146194
- customProperties: options2?.customProperties
146570
+ customProperties: options2?.customProperties,
146571
+ fixedDate: this.saveFixedDate
146195
146572
  });
146196
146573
  await this.applyTagCollectionChanges(options2?.tags);
146197
146574
  await this.applyNotesMasterChanges(options2?.notesMaster);
@@ -146235,6 +146612,11 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
146235
146612
  delete this.zip.files[name];
146236
146613
  }
146237
146614
  }
146615
+ if (this.saveFixedDate) {
146616
+ for (const file of Object.values(this.zip.files)) {
146617
+ file.date = this.saveFixedDate;
146618
+ }
146619
+ }
146238
146620
  return await this.zip.generateAsync({
146239
146621
  type: "uint8array",
146240
146622
  compression: "DEFLATE",
@@ -156199,8 +156581,8 @@ function parseNumberVal(node) {
156199
156581
  if (raw2 === void 0 || raw2 === null || raw2 === "") {
156200
156582
  return void 0;
156201
156583
  }
156202
- const num4 = Number.parseFloat(String(raw2));
156203
- return Number.isFinite(num4) ? num4 : void 0;
156584
+ const num5 = Number.parseFloat(String(raw2));
156585
+ return Number.isFinite(num5) ? num5 : void 0;
156204
156586
  }
156205
156587
  var CHART_DATA_DISPLAY_OPTIONS_EXT_URI2, PptxHandlerRuntime93;
156206
156588
  var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
@@ -158793,12 +159175,12 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
158793
159175
  * in-memory format schemes of the masters on those parts and, when the deck's part is among
158794
159176
  * them, the deck's.
158795
159177
  */
158796
- async writeFormatScheme(elementFor2, themePaths) {
159178
+ async writeFormatScheme(elementFor, themePaths) {
158797
159179
  const deckBefore = this.getThemeFormatScheme();
158798
159180
  const replaced = /* @__PURE__ */ new Map();
158799
159181
  const schemes = /* @__PURE__ */ new Map();
158800
159182
  const written = await this.rewriteThemeParts(themePaths, (data, path4) => {
158801
- const element2 = elementFor2(path4);
159183
+ const element2 = elementFor(path4);
158802
159184
  const elements2 = data["a:theme"]?.["a:themeElements"];
158803
159185
  if (!element2 || !elements2) {
158804
159186
  return false;
@@ -158836,7 +159218,7 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
158836
159218
  this.themeFormatScheme = deck;
158837
159219
  this.heldFormatSchemes.holdParts(
158838
159220
  deck,
158839
- new Map(written.map((path4) => [path4, elementFor2(path4)]))
159221
+ new Map(written.map((path4) => [path4, elementFor(path4)]))
158840
159222
  );
158841
159223
  }
158842
159224
  return this.getThemeFormatScheme();
@@ -165729,12 +166111,12 @@ var OmmlLatexConverter = class {
165729
166111
  if (!f6) {
165730
166112
  return null;
165731
166113
  }
165732
- const num4 = this.renderNode(f6["m:num"]).trim();
166114
+ const num5 = this.renderNode(f6["m:num"]).trim();
165733
166115
  const den = this.renderNode(f6["m:den"]).trim();
165734
- if (!num4 && !den) {
166116
+ if (!num5 && !den) {
165735
166117
  return null;
165736
166118
  }
165737
- return `\\frac{${num4 || " "}}{${den || " "}}`;
166119
+ return `\\frac{${num5 || " "}}{${den || " "}}`;
165738
166120
  }
165739
166121
  trySuperscript(node) {
165740
166122
  const value = node["m:sSup"];