ooxml-core 1.45.0 → 1.46.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 (82) hide show
  1. package/dist/PptxHandler-FZ43IJFP.mjs +5 -0
  2. package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-HWEOIHEA.mjs} +2 -2
  3. package/dist/PptxHandler-XAUKKK36.cjs +14 -0
  4. package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-2BCCMZW7.cjs} +6 -6
  5. package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-66RV4F45.mjs} +2 -2
  6. package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-AFD72LIG.mjs} +3 -3
  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-3J6VIKLP.cjs → chunk-5TOVSCVT.cjs} +3 -3
  22. package/dist/{chunk-U5BXJQZG.mjs → chunk-E2TTMUKU.mjs} +225 -38
  23. package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
  24. package/dist/{chunk-VKFKEVHK.mjs → chunk-EI6555OK.mjs} +1 -1
  25. package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
  26. package/dist/{chunk-GGJUWJXB.mjs → chunk-G6LEU3Y5.mjs} +1 -1
  27. package/dist/{chunk-RVYGAYCP.mjs → chunk-H43QQVJU.mjs} +1 -1
  28. package/dist/{chunk-CVJX6NNO.mjs → chunk-HH3AYM63.mjs} +227 -39
  29. package/dist/{chunk-YBSNMVSN.cjs → chunk-IBRV3AK3.cjs} +1497 -1309
  30. package/dist/{chunk-LCXBTJXE.mjs → chunk-L6MJGE3Q.mjs} +4 -4
  31. package/dist/{chunk-IPV3J3I5.mjs → chunk-LXVE2VKR.mjs} +4 -1
  32. package/dist/{chunk-QZPOPUI5.cjs → chunk-QUAFASFC.cjs} +4 -0
  33. package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
  34. package/dist/{chunk-GXYK3H4O.mjs → chunk-X2DC7XRL.mjs} +17 -16
  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 +350 -143
  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-BPGaFlm5.d.ts} +4 -4
  44. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index-BPGaFlm5.d.ts.map} +1 -1
  45. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-D4-WJQ1r.d.ts} +3 -3
  46. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-D4-WJQ1r.d.ts.map} +1 -1
  47. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-DtFoPmk7.d.ts} +49 -6
  48. package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +1 -0
  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 +307 -100
  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 +351 -147
  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
  82. package/dist/pptx/chunks/index-DGKI80Hj.d.ts.map +0 -1
@@ -793,6 +793,7 @@ var init_collaboration_field_schema = __esm({
793
793
  backgroundImage: "scalar",
794
794
  backgroundImageProperties: "complex",
795
795
  backgroundGradient: "scalar",
796
+ backgroundGradientFill: "complex",
796
797
  backgroundStyleRef: "complex",
797
798
  backgroundPattern: "complex",
798
799
  backgroundShadeToTitle: "scalar",
@@ -1444,6 +1445,150 @@ var init_xml_utils = __esm({
1444
1445
  }
1445
1446
  });
1446
1447
 
1448
+ // pptx/core/utils/gradient-angle.ts
1449
+ function normalizeDegrees(deg) {
1450
+ if (!Number.isFinite(deg)) {
1451
+ return 0;
1452
+ }
1453
+ return (deg % 360 + 360) % 360;
1454
+ }
1455
+ function ooxmlGradientAngleToCssDegrees(angleDegrees) {
1456
+ return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
1457
+ }
1458
+ function cssDegreesToOoxmlGradientAngle(cssDegrees) {
1459
+ return normalizeDegrees(cssDegrees - OOXML_TO_CSS_OFFSET_DEG);
1460
+ }
1461
+ var OOXML_TO_CSS_OFFSET_DEG;
1462
+ var init_gradient_angle = __esm({
1463
+ "pptx/core/utils/gradient-angle.ts"() {
1464
+ OOXML_TO_CSS_OFFSET_DEG = 90;
1465
+ }
1466
+ });
1467
+
1468
+ // pptx/core/utils/slide-background-gradient.ts
1469
+ function cssColor(color3, opacity2) {
1470
+ if (opacity2 === void 0 || opacity2 >= 1) {
1471
+ return color3;
1472
+ }
1473
+ const hex3 = color3.replace("#", "");
1474
+ const channel = (index) => Number.parseInt(hex3.slice(index, index + 2), 16);
1475
+ return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num(opacity2)})`;
1476
+ }
1477
+ function slideBackgroundGradientCss(gradient) {
1478
+ const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num(stop.position)}%`).join(", ");
1479
+ if (gradient.fillGradientType !== "radial") {
1480
+ const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
1481
+ return `linear-gradient(${num(angle)}deg, ${stops})`;
1482
+ }
1483
+ const focus = gradient.fillGradientFillToRect;
1484
+ const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
1485
+ const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
1486
+ const at2 = `at ${num(cx)}% ${num(cy)}%`;
1487
+ switch (gradient.fillGradientPathType) {
1488
+ case "rect":
1489
+ return `radial-gradient(${num(Math.max(cx, 100 - cx))}% ${num(Math.max(cy, 100 - cy))}% ${at2}, ${stops})`;
1490
+ case "shape":
1491
+ return `radial-gradient(farthest-side ${at2}, ${stops})`;
1492
+ default:
1493
+ return `radial-gradient(circle ${at2}, ${stops})`;
1494
+ }
1495
+ }
1496
+ function slideBackgroundGradientToWrite(slide) {
1497
+ const gradient = slide.backgroundGradientFill;
1498
+ if (!gradient || !slide.backgroundGradient) {
1499
+ return void 0;
1500
+ }
1501
+ return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
1502
+ }
1503
+ var num;
1504
+ var init_slide_background_gradient = __esm({
1505
+ "pptx/core/utils/slide-background-gradient.ts"() {
1506
+ init_gradient_angle();
1507
+ num = (value) => String(Number(value.toFixed(3)));
1508
+ }
1509
+ });
1510
+
1511
+ // pptx/core/builders/sdk/background-gradient-input.ts
1512
+ function finite(name, value, min, max) {
1513
+ if (typeof value !== "number" || !Number.isFinite(value)) {
1514
+ throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
1515
+ }
1516
+ if (min !== void 0 && value < min || max !== void 0 && value > max) {
1517
+ throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
1518
+ }
1519
+ return value;
1520
+ }
1521
+ function stopsOf(input) {
1522
+ if (!Array.isArray(input.stops) || input.stops.length < 2) {
1523
+ throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
1524
+ }
1525
+ return input.stops.map((stop, index) => {
1526
+ if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
1527
+ throw new RangeError(
1528
+ `${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
1529
+ );
1530
+ }
1531
+ const position4 = finite(`stops[${index}].position`, stop.position, 0, 1);
1532
+ const opacity2 = stop.opacity === void 0 ? void 0 : finite(`stops[${index}].opacity`, stop.opacity, 0, 1);
1533
+ return {
1534
+ color: `#${stop.color.replace("#", "").toUpperCase()}`,
1535
+ // The shape gradient model keeps positions in percent.
1536
+ position: position4 * 100,
1537
+ ...opacity2 !== void 0 ? { opacity: opacity2 } : {}
1538
+ };
1539
+ });
1540
+ }
1541
+ function mapBackgroundGradientInput(input) {
1542
+ const fillGradientStops = stopsOf(input);
1543
+ let gradient;
1544
+ if (input.path !== void 0) {
1545
+ if (!PATHS.has(input.path)) {
1546
+ throw new RangeError(
1547
+ `${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
1548
+ );
1549
+ }
1550
+ if (input.angle !== void 0) {
1551
+ throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
1552
+ }
1553
+ const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
1554
+ gradient = {
1555
+ fillGradientType: "radial",
1556
+ fillGradientPathType: input.path,
1557
+ fillGradientStops,
1558
+ fillGradientFillToRect: {
1559
+ l: finite("focus.l", focus.l),
1560
+ t: finite("focus.t", focus.t),
1561
+ r: finite("focus.r", focus.r),
1562
+ b: finite("focus.b", focus.b)
1563
+ }
1564
+ };
1565
+ } else {
1566
+ if (input.focus !== void 0) {
1567
+ throw new RangeError(`${WHERE}.focus needs a path gradient`);
1568
+ }
1569
+ const cssAngle = finite("angle", input.angle ?? 180);
1570
+ gradient = {
1571
+ fillGradientType: "linear",
1572
+ fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
1573
+ fillGradientStops
1574
+ };
1575
+ }
1576
+ return {
1577
+ backgroundGradient: slideBackgroundGradientCss(gradient),
1578
+ backgroundGradientFill: gradient
1579
+ };
1580
+ }
1581
+ var HEX, PATHS, WHERE;
1582
+ var init_background_gradient_input = __esm({
1583
+ "pptx/core/builders/sdk/background-gradient-input.ts"() {
1584
+ init_gradient_angle();
1585
+ init_slide_background_gradient();
1586
+ HEX = /^#?[0-9a-f]{6}$/iu;
1587
+ PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
1588
+ WHERE = "BackgroundInput";
1589
+ }
1590
+ });
1591
+
1447
1592
  // pptx/core/core/runtime/table-style-defaults.ts
1448
1593
  exports.DEFAULT_POWERPOINT_TABLE_STYLE_ID = void 0;
1449
1594
  var init_table_style_defaults = __esm({
@@ -1653,9 +1798,9 @@ function parseFormula(fmla) {
1653
1798
  return { op: op2, args };
1654
1799
  }
1655
1800
  function resolveOperand(token3, variables) {
1656
- const num4 = Number(token3);
1657
- if (Number.isFinite(num4)) {
1658
- return num4;
1801
+ const num5 = Number(token3);
1802
+ if (Number.isFinite(num5)) {
1803
+ return num5;
1659
1804
  }
1660
1805
  const value = variables.get(token3);
1661
1806
  if (value !== void 0) {
@@ -3644,8 +3789,8 @@ function authoredValue(node) {
3644
3789
  return void 0;
3645
3790
  }
3646
3791
  const raw2 = node["@_val"];
3647
- const num4 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
3648
- return Number.isFinite(num4) ? num4 : void 0;
3792
+ const num5 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
3793
+ return Number.isFinite(num5) ? num5 : void 0;
3649
3794
  }
3650
3795
  function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
3651
3796
  let changed = false;
@@ -5196,6 +5341,7 @@ var init_ElementFactory = __esm({
5196
5341
  exports.SlideBuilder = void 0;
5197
5342
  var init_SlideBuilder = __esm({
5198
5343
  "pptx/core/builders/sdk/SlideBuilder.ts"() {
5344
+ init_background_gradient_input();
5199
5345
  init_ElementFactory();
5200
5346
  exports.SlideBuilder = class {
5201
5347
  /**
@@ -5306,12 +5452,12 @@ var init_SlideBuilder = __esm({
5306
5452
  switch (bg.type) {
5307
5453
  case "solid":
5308
5454
  this.slide.backgroundColor = bg.color;
5455
+ delete this.slide.backgroundGradient;
5456
+ delete this.slide.backgroundGradientFill;
5309
5457
  break;
5310
- case "gradient": {
5311
- const stops = bg.stops.map((s) => `${s.color} ${Math.round(s.position * 100)}%`).join(", ");
5312
- this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
5458
+ case "gradient":
5459
+ Object.assign(this.slide, mapBackgroundGradientInput(bg));
5313
5460
  break;
5314
- }
5315
5461
  case "image":
5316
5462
  this.slide.backgroundImage = bg.source;
5317
5463
  break;
@@ -7745,9 +7891,9 @@ function resolveCoordinate(value, variables) {
7745
7891
  return value;
7746
7892
  }
7747
7893
  const trimmed2 = String(value).trim();
7748
- const num4 = Number(trimmed2);
7749
- if (Number.isFinite(num4)) {
7750
- return num4;
7894
+ const num5 = Number(trimmed2);
7895
+ if (Number.isFinite(num5)) {
7896
+ return num5;
7751
7897
  }
7752
7898
  return resolveOperand(trimmed2, variables);
7753
7899
  }
@@ -18976,9 +19122,9 @@ function resolveToken(token3, vars) {
18976
19122
  if (trimmed2 === "") {
18977
19123
  return 0;
18978
19124
  }
18979
- const num4 = Number(trimmed2);
18980
- if (Number.isFinite(num4)) {
18981
- return num4;
19125
+ const num5 = Number(trimmed2);
19126
+ if (Number.isFinite(num5)) {
19127
+ return num5;
18982
19128
  }
18983
19129
  return resolveOperand(trimmed2, vars);
18984
19130
  }
@@ -24205,26 +24351,6 @@ var init_element_actions = __esm({
24205
24351
  }
24206
24352
  });
24207
24353
 
24208
- // pptx/core/utils/gradient-angle.ts
24209
- function normalizeDegrees(deg) {
24210
- if (!Number.isFinite(deg)) {
24211
- return 0;
24212
- }
24213
- return (deg % 360 + 360) % 360;
24214
- }
24215
- function ooxmlGradientAngleToCssDegrees(angleDegrees) {
24216
- return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
24217
- }
24218
- function cssDegreesToOoxmlGradientAngle(cssDegrees) {
24219
- return normalizeDegrees(cssDegrees - OOXML_TO_CSS_OFFSET_DEG);
24220
- }
24221
- var OOXML_TO_CSS_OFFSET_DEG;
24222
- var init_gradient_angle = __esm({
24223
- "pptx/core/utils/gradient-angle.ts"() {
24224
- OOXML_TO_CSS_OFFSET_DEG = 90;
24225
- }
24226
- });
24227
-
24228
24354
  // pptx/core/utils/positive-fixed-angle.ts
24229
24355
  function normalizePositiveFixedAngleDegrees(degrees) {
24230
24356
  if (!Number.isFinite(degrees)) {
@@ -35381,7 +35507,7 @@ function boolean(value, fallback) {
35381
35507
  }
35382
35508
  return value === "1" || value === "true";
35383
35509
  }
35384
- function num(value, fallback) {
35510
+ function num2(value, fallback) {
35385
35511
  if (value === void 0 || value === "") {
35386
35512
  return fallback;
35387
35513
  }
@@ -35433,8 +35559,8 @@ function parseShape(element2) {
35433
35559
  const type = element2.attrs.type;
35434
35560
  return {
35435
35561
  type: type && type !== "none" ? type : void 0,
35436
- rot: num(element2.attrs.rot, 0),
35437
- zOrderOff: num(element2.attrs.zOrderOff, 0),
35562
+ rot: num2(element2.attrs.rot, 0),
35563
+ zOrderOff: num2(element2.attrs.zOrderOff, 0),
35438
35564
  hideGeom: boolean(element2.attrs.hideGeom, false),
35439
35565
  lkTxEntry: boolean(element2.attrs.lkTxEntry, false),
35440
35566
  blipPhldr: boolean(element2.attrs.blipPhldr, false),
@@ -35453,9 +35579,9 @@ function parseConstraint(attrs4) {
35453
35579
  refForName: attrs4.refForName || void 0,
35454
35580
  refPtType: attrs4.refPtType ?? "all",
35455
35581
  op: op2 === "equ" || op2 === "gte" || op2 === "lte" ? op2 : "none",
35456
- val: num(attrs4.val, 0),
35582
+ val: num2(attrs4.val, 0),
35457
35583
  hasVal: attrs4.val !== void 0,
35458
- fact: num(attrs4.fact, 1)
35584
+ fact: num2(attrs4.fact, 1)
35459
35585
  };
35460
35586
  }
35461
35587
  function parseRule(attrs4) {
@@ -39207,22 +39333,22 @@ var init_smartart_constraint_branch_index = __esm({
39207
39333
  });
39208
39334
 
39209
39335
  // diagram/layout/smartart-constraint-resolve.ts
39210
- function finite(value) {
39336
+ function finite2(value) {
39211
39337
  return typeof value === "number" && Number.isFinite(value);
39212
39338
  }
39213
39339
  function literalValue(constraint) {
39214
- if (finite(constraint.factor)) {
39340
+ if (finite2(constraint.factor)) {
39215
39341
  return constraint.factor;
39216
39342
  }
39217
- if (finite(constraint.value)) {
39343
+ if (finite2(constraint.value)) {
39218
39344
  return constraint.value;
39219
39345
  }
39220
39346
  return void 0;
39221
39347
  }
39222
39348
  function combine(constraint, referenced) {
39223
- const factor = finite(constraint.factor) ? constraint.factor : 1;
39349
+ const factor = finite2(constraint.factor) ? constraint.factor : 1;
39224
39350
  let result = referenced * factor;
39225
- if (finite(constraint.value)) {
39351
+ if (finite2(constraint.value)) {
39226
39352
  if (constraint.operator === "gte") {
39227
39353
  result = Math.max(result, constraint.value);
39228
39354
  } else if (constraint.operator === "lte") {
@@ -39260,7 +39386,7 @@ function resolveEntry(index, entry2, visiting) {
39260
39386
  );
39261
39387
  const referenced = resolveInternal(index, refRole, refType, visiting);
39262
39388
  if (referenced === void 0) {
39263
- return finite(constraint.value) ? constraint.value : void 0;
39389
+ return finite2(constraint.value) ? constraint.value : void 0;
39264
39390
  }
39265
39391
  return combine(constraint, referenced);
39266
39392
  }
@@ -47110,18 +47236,18 @@ function collectNamedRules(definition) {
47110
47236
  walk3(definition.rootNode);
47111
47237
  return out;
47112
47238
  }
47113
- function finite2(value) {
47239
+ function finite3(value) {
47114
47240
  return typeof value === "number" && Number.isFinite(value);
47115
47241
  }
47116
47242
  function ruleValue(rule) {
47117
- let value = finite2(rule.value) ? rule.value : rule.max;
47118
- if (!finite2(value)) {
47243
+ let value = finite3(rule.value) ? rule.value : rule.max;
47244
+ if (!finite3(value)) {
47119
47245
  return void 0;
47120
47246
  }
47121
- if (finite2(rule.factor)) {
47247
+ if (finite3(rule.factor)) {
47122
47248
  value *= rule.factor;
47123
47249
  }
47124
- if (finite2(rule.max)) {
47250
+ if (finite3(rule.max)) {
47125
47251
  value = Math.min(value, rule.max);
47126
47252
  }
47127
47253
  return Number.isFinite(value) ? value : void 0;
@@ -56537,18 +56663,18 @@ function groupTransform(group2, parent) {
56537
56663
  const ext = first(xfrm, "ext", NS.a);
56538
56664
  const chOff = first(xfrm, "chOff", NS.a);
56539
56665
  const chExt = first(xfrm, "chExt", NS.a);
56540
- const num4 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
56541
- const cx = num4(ext, "cx");
56542
- const cy = num4(ext, "cy");
56543
- const chCx = num4(chExt, "cx");
56544
- const chCy = num4(chExt, "cy");
56666
+ const num5 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
56667
+ const cx = num5(ext, "cx");
56668
+ const cy = num5(ext, "cy");
56669
+ const chCx = num5(chExt, "cx");
56670
+ const chCy = num5(chExt, "cy");
56545
56671
  if (!off || ![cx, cy, chCx, chCy].every(Number.isFinite) || chCx === 0 || chCy === 0)
56546
56672
  return parent;
56547
56673
  const scaleX = cx / chCx;
56548
56674
  const scaleY = cy / chCy;
56549
56675
  const local = {
56550
- offsetX: num4(off, "x") - (num4(chOff, "x") || 0) * scaleX,
56551
- offsetY: num4(off, "y") - (num4(chOff, "y") || 0) * scaleY,
56676
+ offsetX: num5(off, "x") - (num5(chOff, "x") || 0) * scaleX,
56677
+ offsetY: num5(off, "y") - (num5(chOff, "y") || 0) * scaleY,
56552
56678
  scaleX,
56553
56679
  scaleY
56554
56680
  };
@@ -64144,9 +64270,9 @@ function parseValueColorPositions(node, xmlLookup) {
64144
64270
  const entry2 = { kind };
64145
64271
  const rawVal = posNode["@_val"];
64146
64272
  if (rawVal !== void 0) {
64147
- const num4 = Number.parseFloat(String(rawVal));
64148
- if (Number.isFinite(num4)) {
64149
- entry2.value = num4;
64273
+ const num5 = Number.parseFloat(String(rawVal));
64274
+ if (Number.isFinite(num5)) {
64275
+ entry2.value = num5;
64150
64276
  }
64151
64277
  }
64152
64278
  positions2.push(entry2);
@@ -64508,8 +64634,8 @@ var init_chart_cx_parser = __esm({
64508
64634
  // pptx/core/utils/chart-user-shapes-parser.ts
64509
64635
  function markerFraction(marker2, axis, xml2) {
64510
64636
  const raw2 = xml2.getScalarChildByLocalName(marker2, axis);
64511
- const num4 = Number.parseFloat(String(raw2 ?? ""));
64512
- return Number.isFinite(num4) ? num4 : 0;
64637
+ const num5 = Number.parseFloat(String(raw2 ?? ""));
64638
+ return Number.isFinite(num5) ? num5 : 0;
64513
64639
  }
64514
64640
  function parseShapeParagraphs(shape3, xml2, colors) {
64515
64641
  const txBody = xml2.getChildByLocalName(shape3, "txBody");
@@ -64632,13 +64758,13 @@ function buildUserShape(shape3, kind, base, xml2, colors) {
64632
64758
  };
64633
64759
  }
64634
64760
  function parseOffExt(offNode, extNode) {
64635
- const num4 = (node, attr6) => {
64761
+ const num5 = (node, attr6) => {
64636
64762
  const raw2 = Number.parseFloat(String(node?.[attr6] ?? ""));
64637
64763
  return Number.isFinite(raw2) ? raw2 : 0;
64638
64764
  };
64639
64765
  return {
64640
- off: { x: num4(offNode, "@_x"), y: num4(offNode, "@_y") },
64641
- ext: { cx: num4(extNode, "@_cx"), cy: num4(extNode, "@_cy") }
64766
+ off: { x: num5(offNode, "@_x"), y: num5(offNode, "@_y") },
64767
+ ext: { cx: num5(extNode, "@_cx"), cy: num5(extNode, "@_cy") }
64642
64768
  };
64643
64769
  }
64644
64770
  function parseGroupTransform(group2, xml2) {
@@ -64788,7 +64914,7 @@ function parseChartUserShapesDrawing(drawingRoot, xml2, colors) {
64788
64914
  return shapes.length > 0 ? shapes : void 0;
64789
64915
  }
64790
64916
  function childFraction(childOff, childExt, chOff, chExt) {
64791
- const safeDiv = (num4, den) => den !== 0 ? num4 / den : 0;
64917
+ const safeDiv = (num5, den) => den !== 0 ? num5 / den : 0;
64792
64918
  return {
64793
64919
  x: safeDiv(childOff.x - chOff.x, chExt.cx),
64794
64920
  y: safeDiv(childOff.y - chOff.y, chExt.cy),
@@ -65113,8 +65239,8 @@ function resolveCellValue(cell3, sharedStrings) {
65113
65239
  case "inlineStr":
65114
65240
  return cell3.value;
65115
65241
  default: {
65116
- const num4 = Number.parseFloat(cell3.value);
65117
- return Number.isFinite(num4) ? num4 : cell3.value;
65242
+ const num5 = Number.parseFloat(cell3.value);
65243
+ return Number.isFinite(num5) ? num5 : cell3.value;
65118
65244
  }
65119
65245
  }
65120
65246
  }
@@ -65199,8 +65325,8 @@ async function parseEmbeddedXlsx(xlsxData) {
65199
65325
  } else if (typeof cellVal === "number") {
65200
65326
  values.push(cellVal);
65201
65327
  } else {
65202
- const num4 = Number.parseFloat(String(cellVal));
65203
- values.push(Number.isFinite(num4) ? num4 : 0);
65328
+ const num5 = Number.parseFloat(String(cellVal));
65329
+ values.push(Number.isFinite(num5) ? num5 : 0);
65204
65330
  }
65205
65331
  }
65206
65332
  series.push({ name, values });
@@ -65913,8 +66039,8 @@ function parseVmlOpacity(value) {
65913
66039
  const pct = parseFloat(trimmed2.slice(0, -1));
65914
66040
  return Number.isFinite(pct) ? pct / 100 : void 0;
65915
66041
  }
65916
- const num4 = parseFloat(trimmed2);
65917
- return Number.isFinite(num4) ? Math.min(1, Math.max(0, num4)) : void 0;
66042
+ const num5 = parseFloat(trimmed2);
66043
+ return Number.isFinite(num5) ? Math.min(1, Math.max(0, num5)) : void 0;
65918
66044
  }
65919
66045
  var NAMED_COLORS;
65920
66046
  var init_vml_color_parser = __esm({
@@ -65957,29 +66083,29 @@ function parseCssDimension(value, containerPx) {
65957
66083
  if (trimmed2.length === 0) {
65958
66084
  return 0;
65959
66085
  }
65960
- const num4 = parseFloat(trimmed2);
65961
- if (!Number.isFinite(num4)) {
66086
+ const num5 = parseFloat(trimmed2);
66087
+ if (!Number.isFinite(num5)) {
65962
66088
  return 0;
65963
66089
  }
65964
66090
  if (trimmed2.endsWith("pt")) {
65965
- return num4 / PT_PER_PX2;
66091
+ return num5 / PT_PER_PX2;
65966
66092
  }
65967
66093
  if (trimmed2.endsWith("in")) {
65968
- return num4 * 96;
66094
+ return num5 * 96;
65969
66095
  }
65970
66096
  if (trimmed2.endsWith("cm")) {
65971
- return num4 * (96 / 2.54);
66097
+ return num5 * (96 / 2.54);
65972
66098
  }
65973
66099
  if (trimmed2.endsWith("mm")) {
65974
- return num4 * (96 / 25.4);
66100
+ return num5 * (96 / 25.4);
65975
66101
  }
65976
66102
  if (trimmed2.endsWith("emu")) {
65977
- return num4 / EMU_PER_PX6;
66103
+ return num5 / EMU_PER_PX6;
65978
66104
  }
65979
66105
  if (trimmed2.endsWith("%")) {
65980
- return containerPx ? num4 / 100 * containerPx : 0;
66106
+ return containerPx ? num5 / 100 * containerPx : 0;
65981
66107
  }
65982
- return num4;
66108
+ return num5;
65983
66109
  }
65984
66110
  function parseVmlStyle(styleAttr) {
65985
66111
  const result = {};
@@ -66898,7 +67024,7 @@ function children3(node, name) {
66898
67024
  (v) => typeof v === "object" && v !== null ? v : {}
66899
67025
  );
66900
67026
  }
66901
- function num2(node, attr6) {
67027
+ function num3(node, attr6) {
66902
67028
  const raw2 = node?.[`@_${attr6}`];
66903
67029
  if (raw2 === void 0 || raw2 === "") {
66904
67030
  return void 0;
@@ -66913,15 +67039,15 @@ function vec(node, keys) {
66913
67039
  if (!node) {
66914
67040
  return void 0;
66915
67041
  }
66916
- const [x, y, z] = keys.map((k) => num2(node, k));
67042
+ const [x, y, z] = keys.map((k) => num3(node, k));
66917
67043
  if (x === void 0 && y === void 0 && z === void 0) {
66918
67044
  return void 0;
66919
67045
  }
66920
67046
  return { x: x ?? 0, y: y ?? 0, z: z ?? 0 };
66921
67047
  }
66922
67048
  function ratio(node) {
66923
- const n = num2(node, "n");
66924
- const d = num2(node, "d");
67049
+ const n = num3(node, "n");
67050
+ const d = num3(node, "d");
66925
67051
  if (n === void 0 || d === void 0 || d === 0) {
66926
67052
  return void 0;
66927
67053
  }
@@ -66937,7 +67063,7 @@ function colour2(node) {
66937
67063
  const scrgb = child10(clr, "a:scrgbClr");
66938
67064
  if (scrgb) {
66939
67065
  const chan = (a) => {
66940
- const pct = Math.min(1e5, Math.max(0, num2(scrgb, a) ?? 0)) / 1e5;
67066
+ const pct = Math.min(1e5, Math.max(0, num3(scrgb, a) ?? 0)) / 1e5;
66941
67067
  return Math.round(pct * 255).toString(16).padStart(2, "0");
66942
67068
  };
66943
67069
  return `#${chan("r")}${chan("g")}${chan("b")}`;
@@ -66950,14 +67076,14 @@ function parseCamera(node) {
66950
67076
  }
66951
67077
  const ortho = am(node, "orthographic");
66952
67078
  const persp = am(node, "perspective");
66953
- const fov = num2(persp, "fov");
67079
+ const fov = num3(persp, "fov");
66954
67080
  return {
66955
67081
  position: point(am(node, "pos")),
66956
67082
  up: delta(am(node, "up")),
66957
67083
  lookAt: point(am(node, "lookAt")),
66958
67084
  projection: ortho && !persp ? "orthographic" : "perspective",
66959
67085
  ...fov !== void 0 ? { fovDeg: fov / ANGLE_UNIT } : {},
66960
- ...ortho ? { orthoScale: num2(ortho, "sx") ?? num2(ortho, "scale") } : {}
67086
+ ...ortho ? { orthoScale: num3(ortho, "sx") ?? num3(ortho, "scale") } : {}
66961
67087
  };
66962
67088
  }
66963
67089
  function parseTransform2(node) {
@@ -66969,7 +67095,7 @@ function parseTransform2(node) {
66969
67095
  const sx = ratio(am(scaleNode, "sx"));
66970
67096
  const sy = ratio(am(scaleNode, "sy"));
66971
67097
  const sz = ratio(am(scaleNode, "sz"));
66972
- const angle = (a) => (num2(rot, a) ?? 0) / ANGLE_UNIT;
67098
+ const angle = (a) => (num3(rot, a) ?? 0) / ANGLE_UNIT;
66973
67099
  return {
66974
67100
  meterPerModelUnit: ratio(am(node, "meterPerModelUnit")),
66975
67101
  preTranslate: delta(am(node, "preTrans")),
@@ -66982,7 +67108,7 @@ function parseLights(model3d) {
66982
67108
  const lights = [];
66983
67109
  for (const [tag2, kind] of LIGHT_TAGS) {
66984
67110
  for (const node of [...children3(model3d, `am3d:${tag2}`), ...children3(model3d, tag2)]) {
66985
- const spot = num2(am(node, "spotAngle"), "angle") ?? num2(node, "angle") ?? num2(node, "spotAngle");
67111
+ const spot = num3(am(node, "spotAngle"), "angle") ?? num3(node, "angle") ?? num3(node, "spotAngle");
66986
67112
  lights.push({
66987
67113
  kind,
66988
67114
  color: colour2(node),
@@ -66999,7 +67125,7 @@ function parseModel3DScene(model3d) {
66999
67125
  const camera = parseCamera(am(model3d, "camera"));
67000
67126
  const transform7 = parseTransform2(am(model3d, "trans"));
67001
67127
  const lights = parseLights(model3d);
67002
- const viewportSizeEmu = num2(am(model3d, "objViewport"), "viewportSz");
67128
+ const viewportSizeEmu = num3(am(model3d, "objViewport"), "viewportSz");
67003
67129
  if (!camera && !transform7 && lights.length === 0) {
67004
67130
  return void 0;
67005
67131
  }
@@ -85331,7 +85457,15 @@ var init_PptxSlideBackgroundBuilder = __esm({
85331
85457
  init.reportUnsupportedBackground?.(rawBackgroundImage);
85332
85458
  }
85333
85459
  }
85334
- if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
85460
+ if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
85461
+ const gradFill2 = init.buildBackgroundGradientFill?.();
85462
+ if (gradFill2) {
85463
+ backgroundProperties["a:gradFill"] = gradFill2;
85464
+ } else if (!hasBackgroundColor && !hasBackgroundImage) {
85465
+ init.reportUnsupportedGradient?.();
85466
+ }
85467
+ }
85468
+ if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
85335
85469
  backgroundProperties["a:solidFill"] = {
85336
85470
  "a:srgbClr": {
85337
85471
  "@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
@@ -90224,8 +90358,8 @@ function decodeAinkInk(inkRoot) {
90224
90358
  if (raw2.length === 0) {
90225
90359
  return 2;
90226
90360
  }
90227
- const num4 = Number(raw2);
90228
- return Number.isFinite(num4) && num4 > 0 ? num4 : 2;
90361
+ const num5 = Number(raw2);
90362
+ return Number.isFinite(num5) && num5 > 0 ? num5 : 2;
90229
90363
  })();
90230
90364
  const traces = ensureArrayLike3(inkRoot["aink:trace"]);
90231
90365
  for (const trace of traces) {
@@ -92390,9 +92524,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
92390
92524
  let maxId = 0;
92391
92525
  for (const rel of rels) {
92392
92526
  const id = String(rel?.["@_Id"] || "");
92393
- const num4 = Number.parseInt(id.replace(/^rId/, ""), 10);
92394
- if (Number.isFinite(num4) && num4 > maxId) {
92395
- maxId = num4;
92527
+ const num5 = Number.parseInt(id.replace(/^rId/, ""), 10);
92528
+ if (Number.isFinite(num5) && num5 > maxId) {
92529
+ maxId = num5;
92396
92530
  }
92397
92531
  }
92398
92532
  rels.push({
@@ -92477,11 +92611,11 @@ var init_PptxDocumentPropertiesUpdater = __esm({
92477
92611
  this.context = context;
92478
92612
  }
92479
92613
  async updateOnSave(slides, options2) {
92480
- await this.updateCoreProperties(options2?.coreProperties);
92614
+ await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
92481
92615
  await this.updateAppProperties(slides, options2?.appProperties);
92482
92616
  await this.updateCustomProperties(options2?.customProperties);
92483
92617
  }
92484
- async updateCoreProperties(overrides28) {
92618
+ async updateCoreProperties(overrides28, fixedDate) {
92485
92619
  const coreFile = this.context.zip.file("docProps/core.xml");
92486
92620
  if (!coreFile) {
92487
92621
  return;
@@ -92490,7 +92624,12 @@ var init_PptxDocumentPropertiesUpdater = __esm({
92490
92624
  const coreXml = await coreFile.async("string");
92491
92625
  const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides28);
92492
92626
  const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
92493
- const next = {
92627
+ const next = fixedDate ? {
92628
+ ...core,
92629
+ revision: overrides28?.revision ?? "1",
92630
+ created: overrides28?.created ?? formatW3cdtf(fixedDate),
92631
+ modified: overrides28?.modified ?? formatW3cdtf(fixedDate)
92632
+ } : {
92494
92633
  ...core,
92495
92634
  revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
92496
92635
  modified: formatW3cdtf(/* @__PURE__ */ new Date())
@@ -125324,7 +125463,7 @@ var init_type_axes = __esm({
125324
125463
  });
125325
125464
 
125326
125465
  // chart/edit/type.ts
125327
- function elementFor(kind, is3D) {
125466
+ function chartGroupElement(kind, is3D) {
125328
125467
  const match = Object.entries(CHART_GROUP_ELEMENTS).find(
125329
125468
  ([, value]) => value.kind === kind && value.is3D === is3D
125330
125469
  );
@@ -125339,7 +125478,7 @@ function groupingFor(element2, grouping) {
125339
125478
  }
125340
125479
  function newGroup(base, target, series) {
125341
125480
  const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
125342
- const element2 = elementFor(target.kind, is3D);
125481
+ const element2 = chartGroupElement(target.kind, is3D);
125343
125482
  const group2 = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
125344
125483
  const allowed = GROUP_FIELDS[element2] ?? [];
125345
125484
  for (const key2 of allowed)
@@ -125548,6 +125687,11 @@ var init_target = __esm({
125548
125687
  });
125549
125688
 
125550
125689
  // chart/edit/group-options.ts
125690
+ function assertChartGroupOption(key2, value) {
125691
+ const [min, max] = RANGES[key2];
125692
+ if (!Number.isInteger(value) || value < min || value > max)
125693
+ throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
125694
+ }
125551
125695
  function setChartGroupOptions2(space, seriesIndex, edit) {
125552
125696
  return editChartSpace(space, (draft) => {
125553
125697
  const { group: group2 } = chartSeriesEntryAt(draft, seriesIndex);
@@ -125560,9 +125704,7 @@ function setChartGroupOptions2(space, seriesIndex, edit) {
125560
125704
  delete group2[key2];
125561
125705
  continue;
125562
125706
  }
125563
- const [min, max] = RANGES[key2];
125564
- if (!Number.isInteger(value) || value < min || value > max)
125565
- throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
125707
+ assertChartGroupOption(key2, value);
125566
125708
  group2[key2] = value;
125567
125709
  }
125568
125710
  });
@@ -127271,8 +127413,8 @@ function titleText(title) {
127271
127413
  }
127272
127414
  function scalingFromNeutral(axis, out) {
127273
127415
  const { scaling } = axis;
127274
- setOrRemove(out, "min", finite3(scaling.min));
127275
- setOrRemove(out, "max", finite3(scaling.max));
127416
+ setOrRemove(out, "min", finite4(scaling.min));
127417
+ setOrRemove(out, "max", finite4(scaling.max));
127276
127418
  const logBase = scaling.logBase !== void 0 && scaling.logBase > 0 ? scaling.logBase : void 0;
127277
127419
  setOrRemove(out, "logBase", logBase);
127278
127420
  setOrRemove(out, "logScale", logBase !== void 0 ? true : void 0);
@@ -127284,7 +127426,7 @@ function labelsFromNeutral(axis, out) {
127284
127426
  setOrRemove(out, "minorTickMark", oneOf(TICK_MARKS2, axis.minorTickMark));
127285
127427
  setOrRemove(out, "tickLblPos", oneOf(["high", "low", "nextTo", "none"], axis.tickLabelPosition));
127286
127428
  setOrRemove(out, "crosses", oneOf(["autoZero", "min", "max"], axis.crosses));
127287
- setOrRemove(out, "crossesAt", finite3(axis.crossesAt));
127429
+ setOrRemove(out, "crossesAt", finite4(axis.crossesAt));
127288
127430
  const valueAxis = type === "valAx";
127289
127431
  const categoryOrDate = type === "catAx" || type === "dateAx";
127290
127432
  const skips = type === "catAx" || type === "serAx";
@@ -127338,8 +127480,8 @@ function axisFromNeutral(axis, out) {
127338
127480
  setOrRemove(out, "displayUnits", custom ? "custom" : builtIn);
127339
127481
  setOrRemove(out, "displayUnitsValue", custom || void 0);
127340
127482
  }
127341
- setOrRemove(out, "majorUnit", finite3(axis.majorUnit));
127342
- setOrRemove(out, "minorUnit", finite3(axis.minorUnit));
127483
+ setOrRemove(out, "majorUnit", finite4(axis.majorUnit));
127484
+ setOrRemove(out, "minorUnit", finite4(axis.minorUnit));
127343
127485
  setOrRemove(
127344
127486
  out,
127345
127487
  "baseTimeUnit",
@@ -127360,12 +127502,12 @@ function axesFromNeutral(axes, styled) {
127360
127502
  );
127361
127503
  });
127362
127504
  }
127363
- var oneOf, finite3, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
127505
+ var oneOf, finite4, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
127364
127506
  var init_chart_from_neutral_axes = __esm({
127365
127507
  "pptx/core/utils/chart-from-neutral-axes.ts"() {
127366
127508
  init_chart_from_neutral_labels();
127367
127509
  oneOf = (values, value) => value !== void 0 && values.includes(value) ? value : void 0;
127368
- finite3 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
127510
+ finite4 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
127369
127511
  positiveInteger = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : void 0;
127370
127512
  TICK_MARKS2 = ["cross", "in", "none", "out"];
127371
127513
  TIME_UNITS2 = ["days", "months", "years"];
@@ -138100,7 +138242,7 @@ async function readSlideMasterPaths(zip) {
138100
138242
  }
138101
138243
  return paths;
138102
138244
  }
138103
- function num3(xml2, pattern) {
138245
+ function num4(xml2, pattern) {
138104
138246
  const value = pattern.exec(xml2)?.[1];
138105
138247
  return value === void 0 ? void 0 : Number(value);
138106
138248
  }
@@ -138112,14 +138254,14 @@ function readPlaceholders(masterXml) {
138112
138254
  continue;
138113
138255
  }
138114
138256
  const kind = PLACEHOLDER_KINDS[/\btype="([^"]+)"/u.exec(phType)?.[1] ?? "body"];
138115
- const x = num3(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
138116
- const y = num3(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
138117
- const w = num3(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
138118
- const h2 = num3(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
138257
+ const x = num4(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
138258
+ const y = num4(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
138259
+ const w = num4(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
138260
+ const h2 = num4(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
138119
138261
  if (!kind || x === void 0 || y === void 0 || !w || !h2 || out.some((p2) => p2.kind === kind)) {
138120
138262
  continue;
138121
138263
  }
138122
- const size = num3(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
138264
+ const size = num4(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
138123
138265
  out.push({ kind, rect: { x, y, w, h: h2 }, ...size ? { sizePt: size / 100 } : {} });
138124
138266
  }
138125
138267
  return out;
@@ -146627,26 +146769,26 @@ function buildImgEffects(effects3) {
146627
146769
  if (effects3.backgroundRemoval) {
146628
146770
  out.push({ "a14:backgroundRemoval": buildBackgroundRemovalNode(effects3.backgroundRemoval) });
146629
146771
  }
146630
- if (finite4(effects3.sharpenSoften?.amount)) {
146772
+ if (finite5(effects3.sharpenSoften?.amount)) {
146631
146773
  out.push({ "a14:sharpenSoften": { "@_amount": round4(effects3.sharpenSoften.amount) } });
146632
146774
  }
146633
146775
  const bc = effects3.brightnessContrast;
146634
- if (bc && (finite4(bc.bright) || finite4(bc.contrast))) {
146776
+ if (bc && (finite5(bc.bright) || finite5(bc.contrast))) {
146635
146777
  const node = {};
146636
- if (finite4(bc.bright)) {
146778
+ if (finite5(bc.bright)) {
146637
146779
  node["@_bright"] = round4(bc.bright);
146638
146780
  }
146639
- if (finite4(bc.contrast)) {
146781
+ if (finite5(bc.contrast)) {
146640
146782
  node["@_contrast"] = round4(bc.contrast);
146641
146783
  }
146642
146784
  out.push({ "a14:brightnessContrast": node });
146643
146785
  }
146644
- if (finite4(effects3.colorTemperature?.colorTemp)) {
146786
+ if (finite5(effects3.colorTemperature?.colorTemp)) {
146645
146787
  out.push({
146646
146788
  "a14:colorTemperature": { "@_colorTemp": round4(effects3.colorTemperature.colorTemp) }
146647
146789
  });
146648
146790
  }
146649
- if (finite4(effects3.colorSaturation?.sat)) {
146791
+ if (finite5(effects3.colorSaturation?.sat)) {
146650
146792
  out.push({ "a14:saturation": { "@_sat": round4(effects3.colorSaturation.sat) } });
146651
146793
  }
146652
146794
  const artistic = a14ArtisticElementName(effects3.artisticEffect);
@@ -146696,7 +146838,7 @@ function applyA14ImageExtension(blip2, effects3) {
146696
146838
  extLst[extKey] = entries.length === 1 ? entries[0] : entries;
146697
146839
  blip2[extLstKey] = extLst;
146698
146840
  }
146699
- var GALLERY_TO_A14, round4, finite4;
146841
+ var GALLERY_TO_A14, round4, finite5;
146700
146842
  var init_image_a14_effects_writer = __esm({
146701
146843
  "pptx/core/core/runtime/image-a14-effects-writer.ts"() {
146702
146844
  init_image_a14_effects();
@@ -146729,7 +146871,7 @@ var init_image_a14_effects_writer = __esm({
146729
146871
  watercolorSponge: "artisticWatercolorSponge"
146730
146872
  };
146731
146873
  round4 = (value) => String(Math.round(value));
146732
- finite4 = (value) => typeof value === "number" && Number.isFinite(value);
146874
+ finite5 = (value) => typeof value === "number" && Number.isFinite(value);
146733
146875
  }
146734
146876
  });
146735
146877
 
@@ -153773,11 +153915,31 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
153773
153915
  * default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
153774
153916
  * module doc for why a nested group must not re-derive this itself.
153775
153917
  */
153918
+ /**
153919
+ * `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
153920
+ * mints reproducible ids and names (new table columns' `a16:colId`, the
153921
+ * fallback name of a new group) instead of random or time-based ones.
153922
+ */
153923
+ saveFixedDate;
153924
+ /**
153925
+ * The `p:cNvPr/@name` of a group with neither a name nor one from its
153926
+ * file: its element id, or for a reproducible save (`fixedDate`), which
153927
+ * must not depend on the time-based ids of elements made in code,
153928
+ * `Group <shape id>` as PowerPoint names groups.
153929
+ */
153930
+ groupFallbackName(group2) {
153931
+ return this.saveFixedDate ? `Group ${group2.shapeId ?? ""}`.trim() : group2.id;
153932
+ }
153776
153933
  buildGroupShapeXml(group2, ctx, ownEmuOverride) {
153777
153934
  if (group2.rawXml && group2.children.length === 0) {
153778
153935
  return {
153779
153936
  ...group2.rawXml,
153780
- "p:nvGrpSpPr": buildGroupNonVisualXml(group2.rawXml, group2.name, group2.id, group2.shapeId)
153937
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
153938
+ group2.rawXml,
153939
+ group2.name,
153940
+ this.groupFallbackName(group2),
153941
+ group2.shapeId
153942
+ )
153781
153943
  };
153782
153944
  }
153783
153945
  const EMU = _PptxHandlerRuntime.EMU_PER_PX;
@@ -153786,7 +153948,12 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
153786
153948
  const xfrm = buildGroupTransformXml(group2, EMU, ownEmuOverride, rewrap);
153787
153949
  const childSpace = group2;
153788
153950
  const grpXml2 = {
153789
- "p:nvGrpSpPr": buildGroupNonVisualXml(rawGroupXml, group2.name, group2.id, group2.shapeId),
153951
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
153952
+ rawGroupXml,
153953
+ group2.name,
153954
+ this.groupFallbackName(group2),
153955
+ group2.shapeId
153956
+ ),
153790
153957
  "p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
153791
153958
  };
153792
153959
  const rawExtLst = rawGroupXml?.["p:extLst"];
@@ -156806,7 +156973,15 @@ function slideContainsA16Element(node) {
156806
156973
  function randomColumnId() {
156807
156974
  return String(Math.floor(Math.random() * 4294967295));
156808
156975
  }
156809
- function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
156976
+ function deterministicColumnId(index) {
156977
+ let hash2 = 2166136261;
156978
+ for (const ch of `a16:colId:${index}`) {
156979
+ hash2 ^= ch.charCodeAt(0);
156980
+ hash2 = Math.imul(hash2, 16777619) >>> 0;
156981
+ }
156982
+ return String(hash2);
156983
+ }
156984
+ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
156810
156985
  const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
156811
156986
  const existingGridCols = ensureArrayFn(
156812
156987
  tbl["a:tblGrid"]?.["a:gridCol"]
@@ -156837,7 +157012,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
156837
157012
  // `ensureA16NamespaceOnSlideRoot`; emitting it here too is
156838
157013
  // schema-redundant and PowerPoint flags it.
156839
157014
  "a16:colId": {
156840
- "@_val": existingColIds[i2] || randomColumnId()
157015
+ "@_val": existingColIds[i2] || newColumnId(i2)
156841
157016
  }
156842
157017
  }
156843
157018
  }
@@ -157625,6 +157800,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
157625
157800
  init_table_style_change_cell_clear();
157626
157801
  init_table_paragraph_save_order();
157627
157802
  init_table_structural_ops();
157803
+ init_table_xml_rebuild();
157628
157804
  init_table_tblpr_save();
157629
157805
  CHART_DATA_DISPLAY_OPTIONS_EXT_URI = "{56B9EC1D-385E-4148-901F-78D8002777C0}";
157630
157806
  PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime23 {
@@ -157661,7 +157837,8 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
157661
157837
  tbl,
157662
157838
  tableData,
157663
157839
  _PptxHandlerRuntime.EMU_PER_PX,
157664
- this.ensureArray.bind(this)
157840
+ this.ensureArray.bind(this),
157841
+ this.saveFixedDate ? deterministicColumnId : void 0
157665
157842
  );
157666
157843
  const rebuiltRows = this.ensureArray(tbl["a:tr"]);
157667
157844
  for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
@@ -160270,9 +160447,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
160270
160447
  let maxId = 0;
160271
160448
  for (const rel of relationships3) {
160272
160449
  const id = String(rel?.["@_Id"] || "");
160273
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
160274
- if (Number.isFinite(num4) && num4 > maxId) {
160275
- maxId = num4;
160450
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
160451
+ if (Number.isFinite(num5) && num5 > maxId) {
160452
+ maxId = num5;
160276
160453
  }
160277
160454
  }
160278
160455
  const existingFontTargets = /* @__PURE__ */ new Set();
@@ -160415,9 +160592,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
160415
160592
  let maxId = 0;
160416
160593
  for (const rel of relationships3) {
160417
160594
  const id = String(rel?.["@_Id"] || "");
160418
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
160419
- if (Number.isFinite(num4) && num4 > maxId) {
160420
- maxId = num4;
160595
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
160596
+ if (Number.isFinite(num5) && num5 > maxId) {
160597
+ maxId = num5;
160421
160598
  }
160422
160599
  }
160423
160600
  relationships3.push({
@@ -164772,6 +164949,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
164772
164949
  init_slide_name();
164773
164950
  init_utils();
164774
164951
  init_modern_comment_package();
164952
+ init_slide_background_gradient();
164775
164953
  init_slide_synchronization();
164776
164954
  init_theme_override_utils();
164777
164955
  init_builders();
@@ -165029,6 +165207,16 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
165029
165207
  message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
165030
165208
  scope: "save",
165031
165209
  slideId: slide.id
165210
+ }),
165211
+ buildBackgroundGradientFill: () => {
165212
+ const gradient = slideBackgroundGradientToWrite(slide);
165213
+ return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
165214
+ },
165215
+ reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
165216
+ code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
165217
+ 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.",
165218
+ scope: "save",
165219
+ slideId: slide.id
165032
165220
  })
165033
165221
  });
165034
165222
  this.slideCommentPartWriter.writeComments({
@@ -167380,6 +167568,15 @@ var init_PptxHandlerRuntimeSaveStructuralIds = __esm({
167380
167568
  });
167381
167569
 
167382
167570
  // pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts
167571
+ function validFixedDate(date) {
167572
+ if (date === void 0) {
167573
+ return void 0;
167574
+ }
167575
+ if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
167576
+ throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
167577
+ }
167578
+ return date;
167579
+ }
167383
167580
  var PptxHandlerRuntime54;
167384
167581
  var init_PptxHandlerRuntimeSavePipeline = __esm({
167385
167582
  "pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts"() {
@@ -167425,6 +167622,7 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
167425
167622
  /** One save, with the package to itself; callers go through {@link save}. */
167426
167623
  async saveNow(slides, options2) {
167427
167624
  validateSlideGeometry(slides);
167625
+ this.saveFixedDate = validFixedDate(options2?.fixedDate);
167428
167626
  const templates = [
167429
167627
  ...options2?.slideMasters ?? [],
167430
167628
  ...options2?.slideLayouts ?? [],
@@ -167615,7 +167813,8 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
167615
167813
  await this.documentPropertiesUpdater.updateOnSave(slides, {
167616
167814
  coreProperties: options2?.coreProperties,
167617
167815
  appProperties: options2?.appProperties,
167618
- customProperties: options2?.customProperties
167816
+ customProperties: options2?.customProperties,
167817
+ fixedDate: this.saveFixedDate
167619
167818
  });
167620
167819
  await this.applyTagCollectionChanges(options2?.tags);
167621
167820
  await this.applyNotesMasterChanges(options2?.notesMaster);
@@ -167659,6 +167858,11 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
167659
167858
  delete this.zip.files[name];
167660
167859
  }
167661
167860
  }
167861
+ if (this.saveFixedDate) {
167862
+ for (const file of Object.values(this.zip.files)) {
167863
+ file.date = this.saveFixedDate;
167864
+ }
167865
+ }
167662
167866
  return await this.zip.generateAsync({
167663
167867
  type: "uint8array",
167664
167868
  compression: "DEFLATE",
@@ -177623,8 +177827,8 @@ function parseNumberVal(node) {
177623
177827
  if (raw2 === void 0 || raw2 === null || raw2 === "") {
177624
177828
  return void 0;
177625
177829
  }
177626
- const num4 = Number.parseFloat(String(raw2));
177627
- return Number.isFinite(num4) ? num4 : void 0;
177830
+ const num5 = Number.parseFloat(String(raw2));
177831
+ return Number.isFinite(num5) ? num5 : void 0;
177628
177832
  }
177629
177833
  var CHART_DATA_DISPLAY_OPTIONS_EXT_URI2, PptxHandlerRuntime93;
177630
177834
  var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
@@ -180217,12 +180421,12 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
180217
180421
  * in-memory format schemes of the masters on those parts and, when the deck's part is among
180218
180422
  * them, the deck's.
180219
180423
  */
180220
- async writeFormatScheme(elementFor2, themePaths) {
180424
+ async writeFormatScheme(elementFor, themePaths) {
180221
180425
  const deckBefore = this.getThemeFormatScheme();
180222
180426
  const replaced = /* @__PURE__ */ new Map();
180223
180427
  const schemes = /* @__PURE__ */ new Map();
180224
180428
  const written = await this.rewriteThemeParts(themePaths, (data, path3) => {
180225
- const element2 = elementFor2(path3);
180429
+ const element2 = elementFor(path3);
180226
180430
  const elements3 = data["a:theme"]?.["a:themeElements"];
180227
180431
  if (!element2 || !elements3) {
180228
180432
  return false;
@@ -180260,7 +180464,7 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
180260
180464
  this.themeFormatScheme = deck;
180261
180465
  this.heldFormatSchemes.holdParts(
180262
180466
  deck,
180263
- new Map(written.map((path3) => [path3, elementFor2(path3)]))
180467
+ new Map(written.map((path3) => [path3, elementFor(path3)]))
180264
180468
  );
180265
180469
  }
180266
180470
  return this.getThemeFormatScheme();
@@ -202272,12 +202476,12 @@ var OmmlLatexConverter = class {
202272
202476
  if (!f6) {
202273
202477
  return null;
202274
202478
  }
202275
- const num4 = this.renderNode(f6["m:num"]).trim();
202479
+ const num5 = this.renderNode(f6["m:num"]).trim();
202276
202480
  const den = this.renderNode(f6["m:den"]).trim();
202277
- if (!num4 && !den) {
202481
+ if (!num5 && !den) {
202278
202482
  return null;
202279
202483
  }
202280
- return `\\frac{${num4 || " "}}{${den || " "}}`;
202484
+ return `\\frac{${num5 || " "}}{${den || " "}}`;
202281
202485
  }
202282
202486
  trySuperscript(node) {
202283
202487
  const value = node["m:sSup"];