pptx-react-viewer 1.1.1 → 1.1.3

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 (35) hide show
  1. package/dist/{PowerPointViewer-DtLlYf0r.d.mts → PowerPointViewer-CX0a7wz_.d.mts} +2 -0
  2. package/dist/{PowerPointViewer-DtLlYf0r.d.ts → PowerPointViewer-CX0a7wz_.d.ts} +2 -0
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +373 -64
  6. package/dist/index.mjs +373 -64
  7. package/dist/pptx-viewer.css +1 -1
  8. package/dist/viewer/index.d.mts +11 -3
  9. package/dist/viewer/index.d.ts +11 -3
  10. package/dist/viewer/index.js +373 -64
  11. package/dist/viewer/index.mjs +373 -64
  12. package/node_modules/emf-converter/package.json +1 -1
  13. package/node_modules/mtx-decompressor/dist/index.d.mts +2 -1
  14. package/node_modules/mtx-decompressor/dist/index.d.ts +2 -1
  15. package/node_modules/mtx-decompressor/dist/index.js +85 -93
  16. package/node_modules/mtx-decompressor/dist/index.mjs +85 -93
  17. package/node_modules/mtx-decompressor/package.json +1 -1
  18. package/node_modules/pptx-viewer-core/dist/{SvgExporter-CPr1npgo.d.ts → SvgExporter-BMjoxMDV.d.ts} +1 -1
  19. package/node_modules/pptx-viewer-core/dist/{SvgExporter-B4-1_Hjp.d.mts → SvgExporter-z6AbXRQg.d.mts} +1 -1
  20. package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
  21. package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
  22. package/node_modules/pptx-viewer-core/dist/cli/index.js +504 -253
  23. package/node_modules/pptx-viewer-core/dist/cli/index.mjs +504 -253
  24. package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
  25. package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
  26. package/node_modules/pptx-viewer-core/dist/index.d.mts +318 -6
  27. package/node_modules/pptx-viewer-core/dist/index.d.ts +318 -6
  28. package/node_modules/pptx-viewer-core/dist/index.js +1474 -253
  29. package/node_modules/pptx-viewer-core/dist/index.mjs +1450 -254
  30. package/node_modules/pptx-viewer-core/dist/{presentation-DgkIYhXo.d.mts → presentation-CchuDGfU.d.mts} +17 -1
  31. package/node_modules/pptx-viewer-core/dist/{presentation-DgkIYhXo.d.ts → presentation-CchuDGfU.d.ts} +17 -1
  32. package/node_modules/pptx-viewer-core/dist/{text-operations-dYKZp3zE.d.mts → text-operations-CeukUztU.d.mts} +1 -1
  33. package/node_modules/pptx-viewer-core/dist/{text-operations-B6U6XxWt.d.ts → text-operations-e7JxgI5l.d.ts} +1 -1
  34. package/node_modules/pptx-viewer-core/package.json +1 -1
  35. package/package.json +4 -4
@@ -1441,7 +1441,11 @@ function isoNow() {
1441
1441
  return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d+Z$/, "Z");
1442
1442
  }
1443
1443
  var STANDARD_LAYOUTS = [
1444
- { name: "Title Slide", type: "ctrTitle" },
1444
+ // `type` is ST_SlideLayoutType per ECMA-376 §19.7.15. The Title Slide
1445
+ // layout uses `title`; `ctrTitle` is a placeholder type (ST_PlaceholderType)
1446
+ // and is not valid here — PowerPoint's OPC loader rejects the package
1447
+ // with ERROR_FILE_CORRUPT (0x80070570) when it sees it.
1448
+ { name: "Title Slide", type: "title" },
1445
1449
  { name: "Title and Content", type: "obj" },
1446
1450
  { name: "Section Header", type: "secHead" },
1447
1451
  { name: "Two Content", type: "twoObj" },
@@ -1475,7 +1479,7 @@ ${slideOverrides}
1475
1479
  <Override PartName="/ppt/viewProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"/>
1476
1480
  <Override PartName="/ppt/tableStyles.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"/>
1477
1481
  <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
1478
- <Override PartName="/docProps/app.xml" ContentType="application/vnd.ms-officedocument.extended-properties+xml"/>
1482
+ <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
1479
1483
  </Types>`;
1480
1484
  }
1481
1485
  function rootRelsXml() {
@@ -2534,33 +2538,10 @@ var PptxPresentationSaveBuilder = class {
2534
2538
  init.presentationData["p:presentation"] = presentation;
2535
2539
  return init.presentationData;
2536
2540
  }
2537
- applyHeaderFooter(presentation, headerFooter) {
2538
- if (!headerFooter) {
2539
- return;
2540
- }
2541
- const hf = presentation["p:hf"] || {};
2542
- if (headerFooter.hasHeader !== void 0) {
2543
- hf["@_hdr"] = headerFooter.hasHeader ? "1" : "0";
2544
- }
2545
- if (headerFooter.hasFooter !== void 0) {
2546
- hf["@_ftr"] = headerFooter.hasFooter ? "1" : "0";
2547
- }
2548
- if (headerFooter.hasDateTime !== void 0) {
2549
- hf["@_dt"] = headerFooter.hasDateTime ? "1" : "0";
2550
- }
2551
- if (headerFooter.hasSlideNumber !== void 0) {
2552
- hf["@_sldNum"] = headerFooter.hasSlideNumber ? "1" : "0";
2541
+ applyHeaderFooter(presentation, _headerFooter) {
2542
+ if (presentation["p:hf"] !== void 0) {
2543
+ delete presentation["p:hf"];
2553
2544
  }
2554
- if (headerFooter.footerText !== void 0) {
2555
- hf["@_ftrText"] = headerFooter.footerText;
2556
- }
2557
- if (headerFooter.dateTimeText !== void 0) {
2558
- hf["@_dtText"] = headerFooter.dateTimeText;
2559
- }
2560
- if (headerFooter.dateFormat !== void 0) {
2561
- hf["@_dtFmt"] = headerFooter.dateFormat;
2562
- }
2563
- presentation["p:hf"] = hf;
2564
2545
  }
2565
2546
  applySlideDimensions(presentation, rawSlideWidthEmu, rawSlideHeightEmu, rawSlideSizeType) {
2566
2547
  const slideSize = presentation["p:sldSz"];
@@ -2824,9 +2805,40 @@ var PptxPresentationSlidesReconciler = class {
2824
2805
  "@_r:id": slide.rId
2825
2806
  };
2826
2807
  });
2827
- presentation["p:sldIdLst"] = slideIdList;
2828
- input.presentationData["p:presentation"] = presentation;
2808
+ input.presentationData["p:presentation"] = this.insertSlideIdListInOrder(
2809
+ presentation,
2810
+ slideIdList
2811
+ );
2812
+ }
2813
+ }
2814
+ /**
2815
+ * Return a new presentation XML object whose `p:sldIdLst` child sits in the
2816
+ * schema-mandated position (after `sldMasterIdLst` / `notesMasterIdLst` /
2817
+ * `handoutMasterIdLst`, before `sldSz`). Non-sldIdLst keys keep their
2818
+ * relative order; attribute keys (`@_...`) stay at the front.
2819
+ */
2820
+ insertSlideIdListInOrder(presentation, slideIdList) {
2821
+ const before = /* @__PURE__ */ new Set([
2822
+ "p:sldMasterIdLst",
2823
+ "p:notesMasterIdLst",
2824
+ "p:handoutMasterIdLst"
2825
+ ]);
2826
+ const rebuilt = {};
2827
+ let inserted = false;
2828
+ for (const key of Object.keys(presentation)) {
2829
+ if (key === "p:sldIdLst") {
2830
+ continue;
2831
+ }
2832
+ if (!inserted && !key.startsWith("@_") && !before.has(key)) {
2833
+ rebuilt["p:sldIdLst"] = slideIdList;
2834
+ inserted = true;
2835
+ }
2836
+ rebuilt[key] = presentation[key];
2829
2837
  }
2838
+ if (!inserted) {
2839
+ rebuilt["p:sldIdLst"] = slideIdList;
2840
+ }
2841
+ return rebuilt;
2830
2842
  }
2831
2843
  async attachNewSlide(init) {
2832
2844
  const sourceSlidePath = init.input.findSourceSlidePath(init.slide.sourceSlideId);
@@ -3236,7 +3248,9 @@ var PptxSlideNotesPartUpdater = class {
3236
3248
  var PptxSlideBackgroundBuilder = class {
3237
3249
  applyBackground(init) {
3238
3250
  const hasBackgroundColor = typeof init.slide.backgroundColor === "string" && init.slide.backgroundColor.length > 0 && init.slide.backgroundColor !== "transparent";
3239
- const hasBackgroundImage = typeof init.slide.backgroundImage === "string" && init.slide.backgroundImage.length > 0;
3251
+ const rawBackgroundImage = typeof init.slide.backgroundImage === "string" ? init.slide.backgroundImage : "";
3252
+ const hasBackgroundImage = rawBackgroundImage.length > 0;
3253
+ const hasDataUrlBackgroundImage = hasBackgroundImage && rawBackgroundImage.startsWith("data:");
3240
3254
  const hasBackgroundGradient = typeof init.slide.backgroundGradient === "string" && init.slide.backgroundGradient.length > 0;
3241
3255
  const cSld = init.slideNode["p:cSld"] || {};
3242
3256
  if (!(hasBackgroundColor || hasBackgroundImage || hasBackgroundGradient)) {
@@ -3244,9 +3258,17 @@ var PptxSlideBackgroundBuilder = class {
3244
3258
  init.slideNode["p:cSld"] = cSld;
3245
3259
  return;
3246
3260
  }
3261
+ const existingBg = cSld["p:bg"];
3262
+ const existingBgPr = existingBg?.["p:bgPr"];
3263
+ const existingHasBlipFill = existingBgPr?.["a:blipFill"] !== void 0;
3264
+ if (!hasDataUrlBackgroundImage && existingHasBlipFill) {
3265
+ this.reorderCSldBgFirst(cSld, existingBg);
3266
+ init.slideNode["p:cSld"] = cSld;
3267
+ return;
3268
+ }
3247
3269
  const backgroundProperties = {};
3248
- if (hasBackgroundImage && init.slide.backgroundImage) {
3249
- const parsedBackgroundImage = init.parseDataUrlToBytes(init.slide.backgroundImage);
3270
+ if (hasDataUrlBackgroundImage) {
3271
+ const parsedBackgroundImage = init.parseDataUrlToBytes(rawBackgroundImage);
3250
3272
  if (parsedBackgroundImage) {
3251
3273
  const backgroundImagePath = init.saveState.nextMediaPath(parsedBackgroundImage.extension);
3252
3274
  init.zip.file(backgroundImagePath, parsedBackgroundImage.bytes);
@@ -3269,9 +3291,42 @@ var PptxSlideBackgroundBuilder = class {
3269
3291
  }
3270
3292
  };
3271
3293
  }
3272
- backgroundProperties["a:effectLst"] = {};
3273
- cSld["p:bg"] = { "p:bgPr": backgroundProperties };
3274
- init.slideNode["p:cSld"] = cSld;
3294
+ const hasFillChild = backgroundProperties["a:blipFill"] !== void 0 || backgroundProperties["a:solidFill"] !== void 0 || backgroundProperties["a:gradFill"] !== void 0 || backgroundProperties["a:pattFill"] !== void 0 || backgroundProperties["a:noFill"] !== void 0 || backgroundProperties["a:grpFill"] !== void 0;
3295
+ if (hasFillChild) {
3296
+ backgroundProperties["a:effectLst"] = {};
3297
+ }
3298
+ if (!hasFillChild) {
3299
+ delete cSld["p:bg"];
3300
+ init.slideNode["p:cSld"] = cSld;
3301
+ return;
3302
+ }
3303
+ const rebuiltCSld = { "p:bg": { "p:bgPr": backgroundProperties } };
3304
+ for (const key of Object.keys(cSld)) {
3305
+ if (key === "p:bg") {
3306
+ continue;
3307
+ }
3308
+ rebuiltCSld[key] = cSld[key];
3309
+ }
3310
+ init.slideNode["p:cSld"] = rebuiltCSld;
3311
+ }
3312
+ reorderCSldBgFirst(cSld, bg) {
3313
+ const keys = Object.keys(cSld);
3314
+ if (keys.length > 0 && keys[0] === "p:bg") {
3315
+ return;
3316
+ }
3317
+ const reordered = { "p:bg": bg };
3318
+ for (const key of keys) {
3319
+ if (key === "p:bg") {
3320
+ continue;
3321
+ }
3322
+ reordered[key] = cSld[key];
3323
+ }
3324
+ for (const key of Object.keys(cSld)) {
3325
+ delete cSld[key];
3326
+ }
3327
+ for (const key of Object.keys(reordered)) {
3328
+ cSld[key] = reordered[key];
3329
+ }
3275
3330
  }
3276
3331
  };
3277
3332
 
@@ -6244,6 +6299,7 @@ var PptxConnectorParser = class {
6244
6299
  slideRelationships,
6245
6300
  this.context.getOrderedSlidePaths()
6246
6301
  );
6302
+ const connElementName = cNvPr?.["@_name"] ? String(cNvPr["@_name"]).trim() : void 0;
6247
6303
  const locks = this.context.parseShapeLocks(
6248
6304
  cNvConnectionShapeProperties?.["a:cxnSpLocks"] ?? cNvConnectionShapeProperties?.["a:spLocks"]
6249
6305
  );
@@ -6251,6 +6307,7 @@ var PptxConnectorParser = class {
6251
6307
  const textResult = this.context.parseConnectorTextBody?.(txBody, slidePath);
6252
6308
  return {
6253
6309
  id,
6310
+ name: connElementName || void 0,
6254
6311
  type: "connector",
6255
6312
  x: Math.round(parseInt(String(offset["@_x"] || "0"), 10) / this.context.emuPerPx),
6256
6313
  y: Math.round(parseInt(String(offset["@_y"] || "0"), 10) / this.context.emuPerPx),
@@ -9821,7 +9878,16 @@ var PptxRuntimeDependencyFactory = class {
9821
9878
  return new XMLParser({
9822
9879
  ignoreAttributes: false,
9823
9880
  attributeNamePrefix: "@_",
9824
- parseAttributeValue: false
9881
+ parseAttributeValue: false,
9882
+ // Keep element text as strings. When true (the fast-xml-parser
9883
+ // default), `<AppVersion>16.0000</AppVersion>` is coerced to the
9884
+ // JS number 16, losing the trailing zeros. On save we write back
9885
+ // "16", which fails PowerPoint's strict `[0-9]+\.[0-9]{4}` match
9886
+ // on AppVersion — the loader rejects the package with HRESULT
9887
+ // 0x80070570 (ERROR_FILE_CORRUPT) and shows the repair dialog.
9888
+ // More generally, OOXML element text is always an untyped string;
9889
+ // downstream callers coerce where needed.
9890
+ parseTagValue: false
9825
9891
  });
9826
9892
  }
9827
9893
  createBuilder() {
@@ -10689,7 +10755,7 @@ var TRIPLET_ENCODINGS = [
10689
10755
  { byteCount: 2, xBits: 4, yBits: 4, deltaX: 49, deltaY: 49, xSign: 1, ySign: -1 },
10690
10756
  { byteCount: 2, xBits: 4, yBits: 4, deltaX: 49, deltaY: 49, xSign: -1, ySign: 1 },
10691
10757
  { byteCount: 2, xBits: 4, yBits: 4, deltaX: 49, deltaY: 49, xSign: 1, ySign: 1 },
10692
- // Indices 84-107: 8-bit X + 8-bit Y (3 bytes total)
10758
+ // Indices 84-119: 8-bit X + 8-bit Y (3 bytes total)
10693
10759
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 1, deltaY: 1, xSign: -1, ySign: -1 },
10694
10760
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 1, deltaY: 1, xSign: 1, ySign: -1 },
10695
10761
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 1, deltaY: 1, xSign: -1, ySign: 1 },
@@ -10726,12 +10792,12 @@ var TRIPLET_ENCODINGS = [
10726
10792
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 513, deltaY: 513, xSign: 1, ySign: -1 },
10727
10793
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 513, deltaY: 513, xSign: -1, ySign: 1 },
10728
10794
  { byteCount: 3, xBits: 8, yBits: 8, deltaX: 513, deltaY: 513, xSign: 1, ySign: 1 },
10729
- // Indices 108-111: 12-bit X + 12-bit Y (4 bytes total)
10795
+ // Indices 120-123: 12-bit X + 12-bit Y (4 bytes total)
10730
10796
  { byteCount: 4, xBits: 12, yBits: 12, deltaX: 0, deltaY: 0, xSign: -1, ySign: -1 },
10731
10797
  { byteCount: 4, xBits: 12, yBits: 12, deltaX: 0, deltaY: 0, xSign: 1, ySign: -1 },
10732
10798
  { byteCount: 4, xBits: 12, yBits: 12, deltaX: 0, deltaY: 0, xSign: -1, ySign: 1 },
10733
10799
  { byteCount: 4, xBits: 12, yBits: 12, deltaX: 0, deltaY: 0, xSign: 1, ySign: 1 },
10734
- // Indices 112-115: 16-bit X + 16-bit Y (5 bytes total)
10800
+ // Indices 124-127: 16-bit X + 16-bit Y (5 bytes total)
10735
10801
  { byteCount: 5, xBits: 16, yBits: 16, deltaX: 0, deltaY: 0, xSign: -1, ySign: -1 },
10736
10802
  { byteCount: 5, xBits: 16, yBits: 16, deltaX: 0, deltaY: 0, xSign: 1, ySign: -1 },
10737
10803
  { byteCount: 5, xBits: 16, yBits: 16, deltaX: 0, deltaY: 0, xSign: -1, ySign: 1 },
@@ -10820,14 +10886,15 @@ function decodePushInstructions(sIn, sOut, pushCount) {
10820
10886
  if (pushCount === 0) {
10821
10887
  return;
10822
10888
  }
10823
- const values = [];
10824
- let isShort = false;
10889
+ const data = [];
10825
10890
  let remaining = pushCount;
10891
+ let isShort = false;
10892
+ const runValues = [];
10826
10893
  function flush() {
10827
- if (values.length === 0) {
10894
+ if (runValues.length === 0) {
10828
10895
  return;
10829
10896
  }
10830
- const count = values.length;
10897
+ const count = runValues.length;
10831
10898
  if (isShort) {
10832
10899
  if (count < 8) {
10833
10900
  sOut.writeU8(PUSHW + (count - 1));
@@ -10835,7 +10902,7 @@ function decodePushInstructions(sIn, sOut, pushCount) {
10835
10902
  sOut.writeU8(NPUSHW);
10836
10903
  sOut.writeU8(count);
10837
10904
  }
10838
- for (const v of values) {
10905
+ for (const v of runValues) {
10839
10906
  sOut.writeS16(v);
10840
10907
  }
10841
10908
  } else {
@@ -10845,54 +10912,50 @@ function decodePushInstructions(sIn, sOut, pushCount) {
10845
10912
  sOut.writeU8(NPUSHB);
10846
10913
  sOut.writeU8(count);
10847
10914
  }
10848
- for (const v of values) {
10915
+ for (const v of runValues) {
10849
10916
  sOut.writeU8(v & 255);
10850
10917
  }
10851
10918
  }
10852
- values.length = 0;
10919
+ runValues.length = 0;
10853
10920
  }
10854
- function addValue(v) {
10921
+ function put(v) {
10922
+ data.push(v);
10855
10923
  const needsShort = v < 0 || v > 255;
10856
- if (values.length > 0 && needsShort !== isShort) {
10924
+ if (runValues.length > 0 && needsShort !== isShort) {
10857
10925
  flush();
10858
10926
  }
10859
- if (values.length === 0) {
10927
+ if (runValues.length === 0) {
10860
10928
  isShort = needsShort;
10861
10929
  }
10862
- values.push(v);
10863
- if (values.length >= 255) {
10930
+ runValues.push(v);
10931
+ if (runValues.length >= 255) {
10864
10932
  flush();
10865
10933
  }
10866
10934
  }
10867
10935
  while (remaining > 0) {
10868
- const code = sIn.readU8();
10869
- if (code === 251 && remaining >= 4) {
10870
- const a = read255Short(sIn);
10871
- const b = read255Short(sIn);
10872
- const c = read255Short(sIn);
10873
- addValue(a);
10874
- addValue(b);
10875
- addValue(a);
10876
- addValue(c);
10877
- addValue(a);
10878
- remaining -= 5;
10879
- } else if (code === 252 && remaining >= 6) {
10880
- const a = read255Short(sIn);
10881
- const b = read255Short(sIn);
10936
+ const code = sIn.peekU8();
10937
+ if (code === 251 && remaining >= 3 && data.length >= 2) {
10938
+ sIn.readU8();
10939
+ const prev = data[data.length - 2];
10940
+ put(prev);
10941
+ const val = read255Short(sIn);
10942
+ put(val);
10943
+ put(prev);
10944
+ remaining -= 3;
10945
+ } else if (code === 252 && remaining >= 5 && data.length >= 2) {
10946
+ sIn.readU8();
10947
+ const prev = data[data.length - 2];
10948
+ put(prev);
10882
10949
  const c = read255Short(sIn);
10950
+ put(c);
10951
+ put(prev);
10883
10952
  const d = read255Short(sIn);
10884
- addValue(a);
10885
- addValue(b);
10886
- addValue(a);
10887
- addValue(c);
10888
- addValue(a);
10889
- addValue(d);
10890
- addValue(a);
10891
- remaining -= 7;
10953
+ put(d);
10954
+ put(prev);
10955
+ remaining -= 5;
10892
10956
  } else {
10893
- sIn.seekRelative(-1);
10894
10957
  const v = read255Short(sIn);
10895
- addValue(v);
10958
+ put(v);
10896
10959
  remaining -= 1;
10897
10960
  }
10898
10961
  }
@@ -10920,6 +10983,9 @@ function makeGlyphFlags(x, y, onCurve, firstTime) {
10920
10983
  return flags;
10921
10984
  }
10922
10985
  function decodeSimpleGlyph(numContours, streams, out, calcBBox, minX, minY, maxX, maxY) {
10986
+ if (numContours === 0) {
10987
+ return;
10988
+ }
10923
10989
  const sGlyph = streams[0];
10924
10990
  out.writeS16(numContours);
10925
10991
  const bboxPos = out.pos;
@@ -10940,13 +11006,12 @@ function decodeSimpleGlyph(numContours, streams, out, calcBBox, minX, minY, maxX
10940
11006
  }
10941
11007
  let totalPoints = 0;
10942
11008
  for (let c = 0; c < numContours; c++) {
10943
- const pointsInContour = read255UShort(sGlyph);
10944
- totalPoints += pointsInContour;
10945
11009
  if (c === 0) {
10946
- out.writeU16(pointsInContour - 1);
10947
- } else {
10948
- out.writeU16(totalPoints - 1);
11010
+ totalPoints = 1;
10949
11011
  }
11012
+ const pointsInContour = read255UShort(sGlyph);
11013
+ totalPoints += pointsInContour;
11014
+ out.writeU16(totalPoints - 1);
10950
11015
  }
10951
11016
  const flagBytes = new Uint8Array(totalPoints);
10952
11017
  for (let i = 0; i < totalPoints; i++) {
@@ -10959,7 +11024,7 @@ function decodeSimpleGlyph(numContours, streams, out, calcBBox, minX, minY, maxX
10959
11024
  let cumulativeY = 0;
10960
11025
  for (let i = 0; i < totalPoints; i++) {
10961
11026
  const flag = flagBytes[i];
10962
- onCurve[i] = flag >> 7;
11027
+ onCurve[i] = flag & 128 ? 0 : 1;
10963
11028
  const enc = TRIPLET_ENCODINGS[flag & 127];
10964
11029
  const extraBytes = enc.byteCount - 1;
10965
11030
  const subBuf = new Uint8Array(extraBytes);
@@ -11298,7 +11363,10 @@ var AHuff = class _AHuff {
11298
11363
  this.bio = bio;
11299
11364
  this.range = range;
11300
11365
  this.bitCount = bitsUsed(range - 1);
11301
- this.bitCount2 = this.bitCount > 8 ? this.bitCount - 8 : 0;
11366
+ this.bitCount2 = 0;
11367
+ if (range > 256 && range < 512) {
11368
+ this.bitCount2 = bitsUsed(range - 256 - 1) + 1;
11369
+ }
11302
11370
  const treeSize = 2 * range;
11303
11371
  this.tree = Array.from({ length: treeSize });
11304
11372
  for (let i = 0; i < treeSize; i++) {
@@ -11306,6 +11374,7 @@ var AHuff = class _AHuff {
11306
11374
  }
11307
11375
  for (let i = 2; i < treeSize; i++) {
11308
11376
  this.tree[i].up = i >> 1;
11377
+ this.tree[i].weight = 1;
11309
11378
  }
11310
11379
  for (let i = 1; i < range; i++) {
11311
11380
  this.tree[i].left = 2 * i;
@@ -11315,7 +11384,8 @@ var AHuff = class _AHuff {
11315
11384
  for (let i = 0; i < range; i++) {
11316
11385
  const leafIdx = range + i;
11317
11386
  this.tree[leafIdx].code = i;
11318
- this.tree[leafIdx].weight = 1;
11387
+ this.tree[leafIdx].left = -1;
11388
+ this.tree[leafIdx].right = -1;
11319
11389
  }
11320
11390
  this.symbolIndex = Array.from({ length: range });
11321
11391
  for (let i = 0; i < range; i++) {
@@ -11355,15 +11425,13 @@ var AHuff = class _AHuff {
11355
11425
  */
11356
11426
  readSymbol() {
11357
11427
  let a = _AHuff.ROOT;
11358
- while (this.tree[a].code < 0) {
11359
- if (this.bio.inputBit()) {
11360
- a = this.tree[a].right;
11361
- } else {
11362
- a = this.tree[a].left;
11363
- }
11364
- }
11428
+ let symbol;
11429
+ do {
11430
+ a = this.bio.inputBit() ? this.tree[a].right : this.tree[a].left;
11431
+ symbol = this.tree[a].code;
11432
+ } while (symbol < 0);
11365
11433
  this.updateWeight(a);
11366
- return this.tree[a].code;
11434
+ return symbol;
11367
11435
  }
11368
11436
  // --------------------------------------------------------------------
11369
11437
  // Private helpers
@@ -11387,17 +11455,19 @@ var AHuff = class _AHuff {
11387
11455
  updateWeight(a) {
11388
11456
  const tree = this.tree;
11389
11457
  for (; a !== _AHuff.ROOT; a = tree[a].up) {
11458
+ const weightA = tree[a].weight;
11390
11459
  let b = a - 1;
11391
- if (b > 0 && tree[b].weight === tree[a].weight) {
11392
- while (b > _AHuff.ROOT && tree[b - 1].weight === tree[a].weight) {
11460
+ if (tree[b].weight === weightA) {
11461
+ do {
11393
11462
  b--;
11394
- }
11395
- if (b > _AHuff.ROOT && b !== a) {
11463
+ } while (tree[b].weight === weightA);
11464
+ b++;
11465
+ if (b > _AHuff.ROOT) {
11396
11466
  this.swapNodes(a, b);
11397
11467
  a = b;
11398
11468
  }
11399
11469
  }
11400
- tree[a].weight++;
11470
+ tree[a].weight = weightA + 1;
11401
11471
  }
11402
11472
  tree[_AHuff.ROOT].weight++;
11403
11473
  }
@@ -11417,38 +11487,26 @@ var AHuff = class _AHuff {
11417
11487
  */
11418
11488
  swapNodes(a, b) {
11419
11489
  const tree = this.tree;
11420
- const na = tree[a];
11421
- const nb = tree[b];
11422
- let tmp;
11423
- tmp = na.left;
11424
- na.left = nb.left;
11425
- nb.left = tmp;
11426
- tmp = na.right;
11427
- na.right = nb.right;
11428
- nb.right = tmp;
11429
- tmp = na.code;
11430
- na.code = nb.code;
11431
- nb.code = tmp;
11432
- tmp = na.weight;
11433
- na.weight = nb.weight;
11434
- nb.weight = tmp;
11435
- if (na.left) {
11436
- tree[na.left].up = a;
11437
- }
11438
- if (na.right) {
11439
- tree[na.right].up = a;
11440
- }
11441
- if (nb.left) {
11442
- tree[nb.left].up = b;
11443
- }
11444
- if (nb.right) {
11445
- tree[nb.right].up = b;
11446
- }
11447
- if (na.code >= 0) {
11448
- this.symbolIndex[na.code] = a;
11490
+ const upa = tree[a].up;
11491
+ const upb = tree[b].up;
11492
+ const tmp = tree[a];
11493
+ tree[a] = tree[b];
11494
+ tree[b] = tmp;
11495
+ tree[a].up = upa;
11496
+ tree[b].up = upb;
11497
+ let code = tree[a].code;
11498
+ if (code < 0) {
11499
+ tree[tree[a].left].up = a;
11500
+ tree[tree[a].right].up = a;
11501
+ } else {
11502
+ this.symbolIndex[code] = a;
11449
11503
  }
11450
- if (nb.code >= 0) {
11451
- this.symbolIndex[nb.code] = b;
11504
+ code = tree[b].code;
11505
+ if (code < 0) {
11506
+ tree[tree[b].left].up = b;
11507
+ tree[tree[b].right].up = b;
11508
+ } else {
11509
+ this.symbolIndex[code] = b;
11452
11510
  }
11453
11511
  }
11454
11512
  /**
@@ -11827,12 +11885,12 @@ function unpackMtx(data, size) {
11827
11885
  const offset2 = data[4] << 16 | data[5] << 8 | data[6];
11828
11886
  const offset3 = data[7] << 16 | data[8] << 8 | data[9];
11829
11887
  const offsets = [10, offset2, offset3];
11830
- const sizes = [offset2 - 10, offset3 - offset2, size - offset3];
11888
+ const blockSizes = [offset2 - 10, offset3 - offset2, size - offset3];
11831
11889
  const streams = [];
11832
11890
  const decompressedSizes = [];
11833
11891
  for (let i = 0; i < 3; i++) {
11834
11892
  const block = data.subarray(offsets[i]);
11835
- const decompressed = lzcompDecompress(block, sizes[i], versionMagic);
11893
+ const decompressed = lzcompDecompress(block, blockSizes[i], versionMagic);
11836
11894
  streams.push(decompressed);
11837
11895
  decompressedSizes.push(decompressed.length);
11838
11896
  }
@@ -11924,6 +11982,15 @@ function parseEotHeader(data) {
11924
11982
  const fullName = readNameString();
11925
11983
  if (version >= 131074) {
11926
11984
  readNameString();
11985
+ offset += 8;
11986
+ if (offset + 4 <= data.length) {
11987
+ const signatureSize = readUint16LE(data, offset + 2);
11988
+ offset += 4 + signatureSize;
11989
+ }
11990
+ if (offset + 8 <= data.length) {
11991
+ const eudcFontSize = readUint32LE(data, offset + 4);
11992
+ offset += 8 + eudcFontSize;
11993
+ }
11927
11994
  }
11928
11995
  return {
11929
11996
  eotSize,
@@ -24478,6 +24545,943 @@ function applyThemeToData(data, newColorScheme, newFontScheme, themeName) {
24478
24545
  };
24479
24546
  }
24480
24547
 
24548
+ // src/core/utils/accessibility-checker.ts
24549
+ function parseHexColor(hex) {
24550
+ const cleaned = hex.replace(/^#/, "");
24551
+ if (!/^[\da-fA-F]+$/.test(cleaned)) {
24552
+ return null;
24553
+ }
24554
+ if (cleaned.length === 3) {
24555
+ const r = Number.parseInt(cleaned[0] + cleaned[0], 16);
24556
+ const g = Number.parseInt(cleaned[1] + cleaned[1], 16);
24557
+ const b = Number.parseInt(cleaned[2] + cleaned[2], 16);
24558
+ return [r, g, b];
24559
+ }
24560
+ if (cleaned.length === 6) {
24561
+ const r = Number.parseInt(cleaned.slice(0, 2), 16);
24562
+ const g = Number.parseInt(cleaned.slice(2, 4), 16);
24563
+ const b = Number.parseInt(cleaned.slice(4, 6), 16);
24564
+ return [r, g, b];
24565
+ }
24566
+ return null;
24567
+ }
24568
+ function relativeLuminance(r, g, b) {
24569
+ const [rs, gs, bs] = [r, g, b].map((c) => {
24570
+ const s = c / 255;
24571
+ return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
24572
+ });
24573
+ return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
24574
+ }
24575
+ function computeContrastRatio(fg, bg) {
24576
+ const fgRgb = parseHexColor(fg);
24577
+ const bgRgb = parseHexColor(bg);
24578
+ if (!fgRgb || !bgRgb) {
24579
+ return 21;
24580
+ }
24581
+ const l1 = relativeLuminance(...fgRgb);
24582
+ const l2 = relativeLuminance(...bgRgb);
24583
+ const lighter = Math.max(l1, l2);
24584
+ const darker = Math.min(l1, l2);
24585
+ return (lighter + 0.05) / (darker + 0.05);
24586
+ }
24587
+ var IMAGE_LIKE_TYPES = /* @__PURE__ */ new Set(["image", "picture"]);
24588
+ var VISUAL_CONTENT_TYPES = /* @__PURE__ */ new Set(["image", "picture", "chart", "smartArt", "media"]);
24589
+ function getElementText(el) {
24590
+ if ("text" in el && typeof el.text === "string") {
24591
+ return el.text;
24592
+ }
24593
+ if ("textSegments" in el && Array.isArray(el.textSegments)) {
24594
+ return el.textSegments.map((s) => s.text || "").join("");
24595
+ }
24596
+ return "";
24597
+ }
24598
+ function getAltText(el) {
24599
+ if ("altText" in el) {
24600
+ return el.altText;
24601
+ }
24602
+ return void 0;
24603
+ }
24604
+ function getTextColor(el) {
24605
+ if ("textStyle" in el && el.textStyle) {
24606
+ return el.textStyle.color;
24607
+ }
24608
+ if ("textSegments" in el && Array.isArray(el.textSegments) && el.textSegments.length > 0) {
24609
+ const firstStyle = el.textSegments[0]?.style;
24610
+ return firstStyle?.color;
24611
+ }
24612
+ return void 0;
24613
+ }
24614
+ function getBackgroundColor(el) {
24615
+ if ("shapeStyle" in el && el.shapeStyle) {
24616
+ return el.shapeStyle.fillColor;
24617
+ }
24618
+ return void 0;
24619
+ }
24620
+ function isTitleElement(el) {
24621
+ const id = el.id.toLowerCase();
24622
+ return id.includes("title") || id.startsWith("ctr") || id.includes("ctrtitle");
24623
+ }
24624
+ function isVisibleElement(el) {
24625
+ if ("hidden" in el && el.hidden) {
24626
+ return false;
24627
+ }
24628
+ if ("opacity" in el && typeof el.opacity === "number" && el.opacity <= 0) {
24629
+ return false;
24630
+ }
24631
+ return true;
24632
+ }
24633
+ function checkMissingAltText(slide, slideIndex) {
24634
+ const issues = [];
24635
+ for (const el of slide.elements) {
24636
+ if (!isVisibleElement(el)) {
24637
+ continue;
24638
+ }
24639
+ if (!VISUAL_CONTENT_TYPES.has(el.type)) {
24640
+ continue;
24641
+ }
24642
+ const alt = getAltText(el);
24643
+ if (!alt || alt.trim() === "") {
24644
+ const label = IMAGE_LIKE_TYPES.has(el.type) ? "Image" : el.type === "chart" ? "Chart" : el.type === "smartArt" ? "SmartArt" : "Media";
24645
+ issues.push({
24646
+ type: "missingAltText",
24647
+ severity: "error",
24648
+ slideIndex,
24649
+ elementId: el.id,
24650
+ message: `${label} is missing alternative text.`,
24651
+ suggestion: `Add a description to the ${label.toLowerCase()} so screen readers can describe it.`
24652
+ });
24653
+ }
24654
+ }
24655
+ return issues;
24656
+ }
24657
+ function checkMissingSlideTitle(slide, slideIndex) {
24658
+ const titleElement = slide.elements.find((el) => isTitleElement(el) && isVisibleElement(el));
24659
+ if (!titleElement) {
24660
+ return [
24661
+ {
24662
+ type: "missingSlideTitle",
24663
+ severity: "warning",
24664
+ slideIndex,
24665
+ message: "Slide is missing a title.",
24666
+ suggestion: "Add a title element so screen readers can navigate between slides."
24667
+ }
24668
+ ];
24669
+ }
24670
+ const text = getElementText(titleElement).trim();
24671
+ if (text === "") {
24672
+ return [
24673
+ {
24674
+ type: "missingSlideTitle",
24675
+ severity: "warning",
24676
+ slideIndex,
24677
+ elementId: titleElement.id,
24678
+ message: "Slide title is empty.",
24679
+ suggestion: "Add text to the title element."
24680
+ }
24681
+ ];
24682
+ }
24683
+ return [];
24684
+ }
24685
+ function checkLowContrast(slide, slideIndex, minRatio, slideBg) {
24686
+ const issues = [];
24687
+ const defaultBg = slideBg || "#FFFFFF";
24688
+ for (const el of slide.elements) {
24689
+ if (!isVisibleElement(el)) {
24690
+ continue;
24691
+ }
24692
+ const text = getElementText(el);
24693
+ if (!text.trim()) {
24694
+ continue;
24695
+ }
24696
+ const fg = getTextColor(el);
24697
+ if (!fg) {
24698
+ continue;
24699
+ }
24700
+ const bg = getBackgroundColor(el) || defaultBg;
24701
+ const ratio = computeContrastRatio(fg, bg);
24702
+ if (ratio < minRatio) {
24703
+ issues.push({
24704
+ type: "lowContrast",
24705
+ severity: "warning",
24706
+ slideIndex,
24707
+ elementId: el.id,
24708
+ message: `Text contrast ratio is ${ratio.toFixed(1)}:1 (minimum ${minRatio}:1).`,
24709
+ suggestion: "Increase contrast between text colour and background."
24710
+ });
24711
+ }
24712
+ }
24713
+ return issues;
24714
+ }
24715
+ function checkComplexTables(slide, slideIndex) {
24716
+ const issues = [];
24717
+ for (const el of slide.elements) {
24718
+ if (el.type !== "table") {
24719
+ continue;
24720
+ }
24721
+ const tableData = el.tableData;
24722
+ if (!tableData) {
24723
+ continue;
24724
+ }
24725
+ let mergeCount = 0;
24726
+ for (const row of tableData.rows) {
24727
+ for (const cell of row.cells) {
24728
+ if (cell.gridSpan && cell.gridSpan > 1 || cell.rowSpan && cell.rowSpan > 1) {
24729
+ mergeCount++;
24730
+ }
24731
+ }
24732
+ }
24733
+ if (mergeCount > 2) {
24734
+ issues.push({
24735
+ type: "complexTable",
24736
+ severity: "warning",
24737
+ slideIndex,
24738
+ elementId: el.id,
24739
+ message: `Table has ${mergeCount} merged cell regions, which can confuse screen readers.`,
24740
+ suggestion: "Simplify the table structure or split into multiple simpler tables."
24741
+ });
24742
+ }
24743
+ }
24744
+ return issues;
24745
+ }
24746
+ function checkDuplicateTitles(slides) {
24747
+ const issues = [];
24748
+ const titleMap = /* @__PURE__ */ new Map();
24749
+ for (let i = 0; i < slides.length; i++) {
24750
+ const slide = slides[i];
24751
+ const titleEl = slide.elements.find((el) => isTitleElement(el) && isVisibleElement(el));
24752
+ if (!titleEl) {
24753
+ continue;
24754
+ }
24755
+ const text = getElementText(titleEl).trim().toLowerCase();
24756
+ if (!text) {
24757
+ continue;
24758
+ }
24759
+ const existing = titleMap.get(text);
24760
+ if (existing) {
24761
+ existing.push(i);
24762
+ } else {
24763
+ titleMap.set(text, [i]);
24764
+ }
24765
+ }
24766
+ for (const [title, indices] of titleMap) {
24767
+ if (indices.length > 1) {
24768
+ for (const idx of indices) {
24769
+ issues.push({
24770
+ type: "duplicateTitle",
24771
+ severity: "tip",
24772
+ slideIndex: idx,
24773
+ message: `Slide title "${title}" is duplicated across ${indices.length} slides.`,
24774
+ suggestion: "Use unique titles to help screen reader users distinguish slides."
24775
+ });
24776
+ }
24777
+ }
24778
+ }
24779
+ return issues;
24780
+ }
24781
+ function checkBlankSlide(slide, slideIndex) {
24782
+ const hasVisibleContent = slide.elements.some((el) => {
24783
+ if (!isVisibleElement(el)) {
24784
+ return false;
24785
+ }
24786
+ if (el.type === "text" || el.type === "shape") {
24787
+ return getElementText(el).trim() !== "";
24788
+ }
24789
+ return true;
24790
+ });
24791
+ if (!hasVisibleContent) {
24792
+ return [
24793
+ {
24794
+ type: "blankSlide",
24795
+ severity: "tip",
24796
+ slideIndex,
24797
+ message: "Slide appears to have no visible content.",
24798
+ suggestion: "Add content or remove the blank slide."
24799
+ }
24800
+ ];
24801
+ }
24802
+ return [];
24803
+ }
24804
+ function checkPresentation(data, options = {}) {
24805
+ const { minContrastRatio = 4.5, skipContrast = false, skipBlankSlide = false } = options;
24806
+ const issues = [];
24807
+ for (let i = 0; i < data.slides.length; i++) {
24808
+ const slide = data.slides[i];
24809
+ issues.push(...checkMissingAltText(slide, i));
24810
+ issues.push(...checkMissingSlideTitle(slide, i));
24811
+ if (!skipContrast) {
24812
+ issues.push(...checkLowContrast(slide, i, minContrastRatio, slide.backgroundColor));
24813
+ }
24814
+ issues.push(...checkComplexTables(slide, i));
24815
+ if (!skipBlankSlide) {
24816
+ issues.push(...checkBlankSlide(slide, i));
24817
+ }
24818
+ }
24819
+ issues.push(...checkDuplicateTitles(data.slides));
24820
+ const severityOrder = { error: 0, warning: 1, tip: 2 };
24821
+ issues.sort(
24822
+ (a, b) => a.slideIndex - b.slideIndex || severityOrder[a.severity] - severityOrder[b.severity]
24823
+ );
24824
+ return issues;
24825
+ }
24826
+
24827
+ // src/core/utils/custom-show-utils.ts
24828
+ function findCustomShow(customShows, nameOrId) {
24829
+ if (!customShows || customShows.length === 0) {
24830
+ return void 0;
24831
+ }
24832
+ const lower = nameOrId.toLowerCase();
24833
+ return customShows.find((s) => s.id === nameOrId) || customShows.find((s) => s.name.toLowerCase() === lower);
24834
+ }
24835
+ function resolveCustomShowSlideIndices(customShow, slides) {
24836
+ const rIdToIndex = /* @__PURE__ */ new Map();
24837
+ for (let i = 0; i < slides.length; i++) {
24838
+ rIdToIndex.set(slides[i].rId, i);
24839
+ }
24840
+ const indices = [];
24841
+ for (const rId of customShow.slideRIds) {
24842
+ const idx = rIdToIndex.get(rId);
24843
+ if (idx !== void 0) {
24844
+ indices.push(idx);
24845
+ }
24846
+ }
24847
+ return indices;
24848
+ }
24849
+ function getCustomShowNames(customShows) {
24850
+ if (!customShows) {
24851
+ return [];
24852
+ }
24853
+ return customShows.map((s) => s.name);
24854
+ }
24855
+ function navigateCustomShow(currentSlideIndex, direction, filteredIndices, wrap = false) {
24856
+ if (filteredIndices.length === 0) {
24857
+ return currentSlideIndex;
24858
+ }
24859
+ const posInShow = filteredIndices.indexOf(currentSlideIndex);
24860
+ if (posInShow === -1) {
24861
+ return filteredIndices[0];
24862
+ }
24863
+ const nextPos = posInShow + direction;
24864
+ if (nextPos < 0) {
24865
+ return wrap ? filteredIndices[filteredIndices.length - 1] : currentSlideIndex;
24866
+ }
24867
+ if (nextPos >= filteredIndices.length) {
24868
+ return wrap ? filteredIndices[0] : currentSlideIndex;
24869
+ }
24870
+ return filteredIndices[nextPos];
24871
+ }
24872
+ function getCustomShowPositionLabel(currentSlideIndex, filteredIndices) {
24873
+ const pos2 = filteredIndices.indexOf(currentSlideIndex);
24874
+ if (pos2 === -1) {
24875
+ return "";
24876
+ }
24877
+ return `${pos2 + 1} of ${filteredIndices.length}`;
24878
+ }
24879
+
24880
+ // src/core/utils/table-style-resolver.ts
24881
+ function mergeBorder(base, override) {
24882
+ if (!base && !override) {
24883
+ return void 0;
24884
+ }
24885
+ if (!base) {
24886
+ return override;
24887
+ }
24888
+ if (!override) {
24889
+ return base;
24890
+ }
24891
+ return {
24892
+ width: override.width ?? base.width,
24893
+ color: override.color ?? base.color,
24894
+ dash: override.dash ?? base.dash
24895
+ };
24896
+ }
24897
+ function mergeStyleParts(base, override) {
24898
+ if (!base && !override) {
24899
+ return void 0;
24900
+ }
24901
+ if (!base) {
24902
+ return override;
24903
+ }
24904
+ if (!override) {
24905
+ return base;
24906
+ }
24907
+ const merged = {};
24908
+ if (override.fill || base.fill) {
24909
+ merged.fill = {
24910
+ color: override.fill?.color ?? base.fill?.color,
24911
+ gradient: override.fill?.gradient ?? base.fill?.gradient,
24912
+ pattern: override.fill?.pattern ?? base.fill?.pattern
24913
+ };
24914
+ }
24915
+ if (override.borders || base.borders) {
24916
+ merged.borders = {
24917
+ top: mergeBorder(base.borders?.top, override.borders?.top),
24918
+ bottom: mergeBorder(base.borders?.bottom, override.borders?.bottom),
24919
+ left: mergeBorder(base.borders?.left, override.borders?.left),
24920
+ right: mergeBorder(base.borders?.right, override.borders?.right)
24921
+ };
24922
+ }
24923
+ if (override.text || base.text) {
24924
+ merged.text = {
24925
+ bold: override.text?.bold ?? base.text?.bold,
24926
+ italic: override.text?.italic ?? base.text?.italic,
24927
+ color: override.text?.color ?? base.text?.color,
24928
+ fontSize: override.text?.fontSize ?? base.text?.fontSize
24929
+ };
24930
+ }
24931
+ return merged;
24932
+ }
24933
+ function resolveTableCellStyle(rowIndex, colIndex, totalRows, totalCols, flags, style) {
24934
+ let effective = style.wholeTbl ? { ...style.wholeTbl } : void 0;
24935
+ if (flags.bandedRows) {
24936
+ const cycle = flags.bandRowCycle ?? 1;
24937
+ const bandRow = flags.firstRow ? rowIndex - 1 : rowIndex;
24938
+ if (bandRow >= 0) {
24939
+ const bandIndex = Math.floor(bandRow / cycle) % 2;
24940
+ const bandPart = bandIndex === 0 ? style.band1H : style.band2H;
24941
+ if (bandPart) {
24942
+ effective = mergeStyleParts(effective, bandPart);
24943
+ }
24944
+ }
24945
+ }
24946
+ if (flags.bandedColumns) {
24947
+ const cycle = flags.bandColCycle ?? 1;
24948
+ const bandCol = flags.firstCol ? colIndex - 1 : colIndex;
24949
+ if (bandCol >= 0) {
24950
+ const bandIndex = Math.floor(bandCol / cycle) % 2;
24951
+ const bandPart = bandIndex === 0 ? style.band1V : style.band2V;
24952
+ if (bandPart) {
24953
+ effective = mergeStyleParts(effective, bandPart);
24954
+ }
24955
+ }
24956
+ }
24957
+ if (flags.lastRow && rowIndex === totalRows - 1 && style.lastRow) {
24958
+ effective = mergeStyleParts(effective, style.lastRow);
24959
+ }
24960
+ if (flags.firstRow && rowIndex === 0 && style.firstRow) {
24961
+ effective = mergeStyleParts(effective, style.firstRow);
24962
+ }
24963
+ if (flags.lastCol && colIndex === totalCols - 1 && style.lastCol) {
24964
+ effective = mergeStyleParts(effective, style.lastCol);
24965
+ }
24966
+ if (flags.firstCol && colIndex === 0 && style.firstCol) {
24967
+ effective = mergeStyleParts(effective, style.firstCol);
24968
+ }
24969
+ const isFirstRow = flags.firstRow && rowIndex === 0;
24970
+ const isLastRow = flags.lastRow && rowIndex === totalRows - 1;
24971
+ const isFirstCol = flags.firstCol && colIndex === 0;
24972
+ const isLastCol = flags.lastCol && colIndex === totalCols - 1;
24973
+ if (isLastRow && isLastCol && style.seCell) {
24974
+ effective = mergeStyleParts(effective, style.seCell);
24975
+ }
24976
+ if (isLastRow && isFirstCol && style.swCell) {
24977
+ effective = mergeStyleParts(effective, style.swCell);
24978
+ }
24979
+ if (isFirstRow && isLastCol && style.neCell) {
24980
+ effective = mergeStyleParts(effective, style.neCell);
24981
+ }
24982
+ if (isFirstRow && isFirstCol && style.nwCell) {
24983
+ effective = mergeStyleParts(effective, style.nwCell);
24984
+ }
24985
+ return partToCellStyle(effective);
24986
+ }
24987
+ function partToCellStyle(part) {
24988
+ if (!part) {
24989
+ return {};
24990
+ }
24991
+ const result = {};
24992
+ if (part.fill) {
24993
+ if (part.fill.color) {
24994
+ result.backgroundColor = part.fill.color;
24995
+ result.fillMode = "solid";
24996
+ }
24997
+ if (part.fill.gradient) {
24998
+ result.fillMode = "gradient";
24999
+ }
25000
+ if (part.fill.pattern) {
25001
+ result.fillMode = "pattern";
25002
+ }
25003
+ }
25004
+ if (part.borders) {
25005
+ if (part.borders.top) {
25006
+ if (part.borders.top.width !== void 0) {
25007
+ result.borderTopWidth = part.borders.top.width;
25008
+ }
25009
+ if (part.borders.top.color) {
25010
+ result.borderTopColor = part.borders.top.color;
25011
+ }
25012
+ if (part.borders.top.dash) {
25013
+ result.borderTopDash = part.borders.top.dash;
25014
+ }
25015
+ }
25016
+ if (part.borders.bottom) {
25017
+ if (part.borders.bottom.width !== void 0) {
25018
+ result.borderBottomWidth = part.borders.bottom.width;
25019
+ }
25020
+ if (part.borders.bottom.color) {
25021
+ result.borderBottomColor = part.borders.bottom.color;
25022
+ }
25023
+ if (part.borders.bottom.dash) {
25024
+ result.borderBottomDash = part.borders.bottom.dash;
25025
+ }
25026
+ }
25027
+ if (part.borders.left) {
25028
+ if (part.borders.left.width !== void 0) {
25029
+ result.borderLeftWidth = part.borders.left.width;
25030
+ }
25031
+ if (part.borders.left.color) {
25032
+ result.borderLeftColor = part.borders.left.color;
25033
+ }
25034
+ if (part.borders.left.dash) {
25035
+ result.borderLeftDash = part.borders.left.dash;
25036
+ }
25037
+ }
25038
+ if (part.borders.right) {
25039
+ if (part.borders.right.width !== void 0) {
25040
+ result.borderRightWidth = part.borders.right.width;
25041
+ }
25042
+ if (part.borders.right.color) {
25043
+ result.borderRightColor = part.borders.right.color;
25044
+ }
25045
+ if (part.borders.right.dash) {
25046
+ result.borderRightDash = part.borders.right.dash;
25047
+ }
25048
+ }
25049
+ }
25050
+ if (part.text) {
25051
+ if (part.text.bold !== void 0) {
25052
+ result.bold = part.text.bold;
25053
+ }
25054
+ if (part.text.italic !== void 0) {
25055
+ result.italic = part.text.italic;
25056
+ }
25057
+ if (part.text.color) {
25058
+ result.color = part.text.color;
25059
+ }
25060
+ if (part.text.fontSize !== void 0) {
25061
+ result.fontSize = part.text.fontSize;
25062
+ }
25063
+ }
25064
+ return result;
25065
+ }
25066
+
25067
+ // src/core/utils/animation-preset-catalog.ts
25068
+ var ENTRANCE_PRESETS = [
25069
+ {
25070
+ presetId: "entr.1",
25071
+ label: "Appear",
25072
+ category: "entrance",
25073
+ defaultDurationMs: 0,
25074
+ hasDirection: false,
25075
+ hasTextBuild: true
25076
+ },
25077
+ {
25078
+ presetId: "entr.10",
25079
+ label: "Fade",
25080
+ category: "entrance",
25081
+ defaultDurationMs: 500,
25082
+ hasDirection: false,
25083
+ hasTextBuild: true
25084
+ },
25085
+ {
25086
+ presetId: "entr.2",
25087
+ label: "Fly In",
25088
+ category: "entrance",
25089
+ defaultDurationMs: 500,
25090
+ hasDirection: true,
25091
+ directions: [
25092
+ "fromBottom",
25093
+ "fromLeft",
25094
+ "fromRight",
25095
+ "fromTop",
25096
+ "fromBottomLeft",
25097
+ "fromBottomRight",
25098
+ "fromTopLeft",
25099
+ "fromTopRight"
25100
+ ],
25101
+ hasTextBuild: true
25102
+ },
25103
+ {
25104
+ presetId: "entr.53",
25105
+ label: "Grow & Turn",
25106
+ category: "entrance",
25107
+ defaultDurationMs: 500,
25108
+ hasDirection: false,
25109
+ hasTextBuild: true
25110
+ },
25111
+ {
25112
+ presetId: "entr.23",
25113
+ label: "Zoom",
25114
+ category: "entrance",
25115
+ defaultDurationMs: 500,
25116
+ hasDirection: true,
25117
+ directions: ["inFromScreenCenter", "inSlightly", "objectCenter"],
25118
+ hasTextBuild: true
25119
+ },
25120
+ {
25121
+ presetId: "entr.14",
25122
+ label: "Bounce",
25123
+ category: "entrance",
25124
+ defaultDurationMs: 1e3,
25125
+ hasDirection: false,
25126
+ hasTextBuild: true
25127
+ },
25128
+ {
25129
+ presetId: "entr.22",
25130
+ label: "Wipe",
25131
+ category: "entrance",
25132
+ defaultDurationMs: 500,
25133
+ hasDirection: true,
25134
+ directions: ["fromBottom", "fromLeft", "fromRight", "fromTop"],
25135
+ hasTextBuild: true
25136
+ },
25137
+ {
25138
+ presetId: "entr.16",
25139
+ label: "Split",
25140
+ category: "entrance",
25141
+ defaultDurationMs: 500,
25142
+ hasDirection: true,
25143
+ directions: ["horizontalIn", "horizontalOut", "verticalIn", "verticalOut"],
25144
+ hasTextBuild: true
25145
+ },
25146
+ {
25147
+ presetId: "entr.9",
25148
+ label: "Dissolve In",
25149
+ category: "entrance",
25150
+ defaultDurationMs: 700,
25151
+ hasDirection: false,
25152
+ hasTextBuild: true
25153
+ },
25154
+ {
25155
+ presetId: "entr.21",
25156
+ label: "Wheel",
25157
+ category: "entrance",
25158
+ defaultDurationMs: 1e3,
25159
+ hasDirection: true,
25160
+ directions: ["1spoke", "2spoke", "3spoke", "4spoke", "8spoke"],
25161
+ hasTextBuild: true
25162
+ },
25163
+ {
25164
+ presetId: "entr.3",
25165
+ label: "Blinds",
25166
+ category: "entrance",
25167
+ defaultDurationMs: 500,
25168
+ hasDirection: true,
25169
+ directions: ["horizontal", "vertical"],
25170
+ hasTextBuild: true
25171
+ },
25172
+ {
25173
+ presetId: "entr.4",
25174
+ label: "Box",
25175
+ category: "entrance",
25176
+ defaultDurationMs: 500,
25177
+ hasDirection: true,
25178
+ directions: ["in", "out"],
25179
+ hasTextBuild: true
25180
+ },
25181
+ {
25182
+ presetId: "entr.12",
25183
+ label: "Float Up",
25184
+ category: "entrance",
25185
+ defaultDurationMs: 500,
25186
+ hasDirection: false,
25187
+ hasTextBuild: true
25188
+ },
25189
+ {
25190
+ presetId: "entr.42",
25191
+ label: "Rise Up",
25192
+ category: "entrance",
25193
+ defaultDurationMs: 500,
25194
+ hasDirection: false,
25195
+ hasTextBuild: true
25196
+ },
25197
+ {
25198
+ presetId: "entr.45",
25199
+ label: "Swivel",
25200
+ category: "entrance",
25201
+ defaultDurationMs: 500,
25202
+ hasDirection: true,
25203
+ directions: ["horizontal", "vertical"],
25204
+ hasTextBuild: true
25205
+ },
25206
+ {
25207
+ presetId: "entr.17",
25208
+ label: "Checkerboard",
25209
+ category: "entrance",
25210
+ defaultDurationMs: 500,
25211
+ hasDirection: true,
25212
+ directions: ["across", "down"],
25213
+ hasTextBuild: true
25214
+ },
25215
+ {
25216
+ presetId: "entr.18",
25217
+ label: "Flash Once",
25218
+ category: "entrance",
25219
+ defaultDurationMs: 300,
25220
+ hasDirection: false,
25221
+ hasTextBuild: false
25222
+ },
25223
+ {
25224
+ presetId: "entr.19",
25225
+ label: "Peek In",
25226
+ category: "entrance",
25227
+ defaultDurationMs: 500,
25228
+ hasDirection: true,
25229
+ directions: ["fromBottom", "fromLeft", "fromRight", "fromTop"],
25230
+ hasTextBuild: true
25231
+ },
25232
+ {
25233
+ presetId: "entr.20",
25234
+ label: "Random Bars",
25235
+ category: "entrance",
25236
+ defaultDurationMs: 500,
25237
+ hasDirection: true,
25238
+ directions: ["horizontal", "vertical"],
25239
+ hasTextBuild: true
25240
+ },
25241
+ {
25242
+ presetId: "entr.49",
25243
+ label: "Expand",
25244
+ category: "entrance",
25245
+ defaultDurationMs: 500,
25246
+ hasDirection: false,
25247
+ hasTextBuild: true
25248
+ }
25249
+ ];
25250
+ var EXIT_PRESETS = [
25251
+ {
25252
+ presetId: "exit.1",
25253
+ label: "Disappear",
25254
+ category: "exit",
25255
+ defaultDurationMs: 0,
25256
+ hasDirection: false,
25257
+ hasTextBuild: true
25258
+ },
25259
+ {
25260
+ presetId: "exit.10",
25261
+ label: "Fade",
25262
+ category: "exit",
25263
+ defaultDurationMs: 500,
25264
+ hasDirection: false,
25265
+ hasTextBuild: true
25266
+ },
25267
+ {
25268
+ presetId: "exit.2",
25269
+ label: "Fly Out",
25270
+ category: "exit",
25271
+ defaultDurationMs: 500,
25272
+ hasDirection: true,
25273
+ directions: ["toBottom", "toLeft", "toRight", "toTop"],
25274
+ hasTextBuild: true
25275
+ },
25276
+ {
25277
+ presetId: "exit.23",
25278
+ label: "Zoom",
25279
+ category: "exit",
25280
+ defaultDurationMs: 500,
25281
+ hasDirection: true,
25282
+ directions: ["outFromScreenCenter", "outSlightly", "objectCenter"],
25283
+ hasTextBuild: true
25284
+ },
25285
+ {
25286
+ presetId: "exit.14",
25287
+ label: "Bounce",
25288
+ category: "exit",
25289
+ defaultDurationMs: 1e3,
25290
+ hasDirection: false,
25291
+ hasTextBuild: true
25292
+ },
25293
+ {
25294
+ presetId: "exit.22",
25295
+ label: "Wipe",
25296
+ category: "exit",
25297
+ defaultDurationMs: 500,
25298
+ hasDirection: true,
25299
+ directions: ["fromBottom", "fromLeft", "fromRight", "fromTop"],
25300
+ hasTextBuild: true
25301
+ },
25302
+ {
25303
+ presetId: "exit.9",
25304
+ label: "Dissolve Out",
25305
+ category: "exit",
25306
+ defaultDurationMs: 700,
25307
+ hasDirection: false,
25308
+ hasTextBuild: true
25309
+ },
25310
+ {
25311
+ presetId: "exit.48",
25312
+ label: "Shrink & Turn",
25313
+ category: "exit",
25314
+ defaultDurationMs: 500,
25315
+ hasDirection: false,
25316
+ hasTextBuild: true
25317
+ }
25318
+ ];
25319
+ var EMPHASIS_PRESETS = [
25320
+ {
25321
+ presetId: "emph.32",
25322
+ label: "Pulse",
25323
+ category: "emphasis",
25324
+ defaultDurationMs: 1e3,
25325
+ hasDirection: false,
25326
+ hasTextBuild: false
25327
+ },
25328
+ {
25329
+ presetId: "emph.8",
25330
+ label: "Spin",
25331
+ category: "emphasis",
25332
+ defaultDurationMs: 1e3,
25333
+ hasDirection: true,
25334
+ directions: ["clockwise", "counterClockwise"],
25335
+ hasTextBuild: false
25336
+ },
25337
+ {
25338
+ presetId: "emph.6",
25339
+ label: "Grow/Shrink",
25340
+ category: "emphasis",
25341
+ defaultDurationMs: 500,
25342
+ hasDirection: false,
25343
+ hasTextBuild: false
25344
+ },
25345
+ {
25346
+ presetId: "emph.35",
25347
+ label: "Teeter",
25348
+ category: "emphasis",
25349
+ defaultDurationMs: 1e3,
25350
+ hasDirection: false,
25351
+ hasTextBuild: false
25352
+ },
25353
+ {
25354
+ presetId: "emph.9",
25355
+ label: "Transparency",
25356
+ category: "emphasis",
25357
+ defaultDurationMs: 500,
25358
+ hasDirection: false,
25359
+ hasTextBuild: false
25360
+ },
25361
+ {
25362
+ presetId: "emph.34",
25363
+ label: "Bold Flash",
25364
+ category: "emphasis",
25365
+ defaultDurationMs: 500,
25366
+ hasDirection: false,
25367
+ hasTextBuild: false
25368
+ },
25369
+ {
25370
+ presetId: "emph.36",
25371
+ label: "Wave",
25372
+ category: "emphasis",
25373
+ defaultDurationMs: 1e3,
25374
+ hasDirection: false,
25375
+ hasTextBuild: false
25376
+ }
25377
+ ];
25378
+ var MOTION_PATH_PRESETS = [
25379
+ {
25380
+ presetId: "path.line.down",
25381
+ label: "Lines: Down",
25382
+ category: "motionPath",
25383
+ defaultDurationMs: 2e3,
25384
+ hasDirection: false,
25385
+ hasTextBuild: false
25386
+ },
25387
+ {
25388
+ presetId: "path.line.left",
25389
+ label: "Lines: Left",
25390
+ category: "motionPath",
25391
+ defaultDurationMs: 2e3,
25392
+ hasDirection: false,
25393
+ hasTextBuild: false
25394
+ },
25395
+ {
25396
+ presetId: "path.line.right",
25397
+ label: "Lines: Right",
25398
+ category: "motionPath",
25399
+ defaultDurationMs: 2e3,
25400
+ hasDirection: false,
25401
+ hasTextBuild: false
25402
+ },
25403
+ {
25404
+ presetId: "path.line.up",
25405
+ label: "Lines: Up",
25406
+ category: "motionPath",
25407
+ defaultDurationMs: 2e3,
25408
+ hasDirection: false,
25409
+ hasTextBuild: false
25410
+ },
25411
+ {
25412
+ presetId: "path.arc.down",
25413
+ label: "Arcs: Down",
25414
+ category: "motionPath",
25415
+ defaultDurationMs: 2e3,
25416
+ hasDirection: false,
25417
+ hasTextBuild: false
25418
+ },
25419
+ {
25420
+ presetId: "path.circle",
25421
+ label: "Shapes: Circle",
25422
+ category: "motionPath",
25423
+ defaultDurationMs: 2e3,
25424
+ hasDirection: false,
25425
+ hasTextBuild: false
25426
+ },
25427
+ {
25428
+ presetId: "path.diamond",
25429
+ label: "Shapes: Diamond",
25430
+ category: "motionPath",
25431
+ defaultDurationMs: 2e3,
25432
+ hasDirection: false,
25433
+ hasTextBuild: false
25434
+ },
25435
+ {
25436
+ presetId: "path.custom",
25437
+ label: "Custom Path",
25438
+ category: "motionPath",
25439
+ defaultDurationMs: 2e3,
25440
+ hasDirection: false,
25441
+ hasTextBuild: false
25442
+ }
25443
+ ];
25444
+ var ALL_ANIMATION_PRESETS = [
25445
+ ...ENTRANCE_PRESETS,
25446
+ ...EXIT_PRESETS,
25447
+ ...EMPHASIS_PRESETS,
25448
+ ...MOTION_PATH_PRESETS
25449
+ ];
25450
+ function getAnimationPresetInfo(presetId) {
25451
+ return ALL_ANIMATION_PRESETS.find((p) => p.presetId === presetId);
25452
+ }
25453
+ function getPresetsByCategory(category) {
25454
+ switch (category) {
25455
+ case "entrance":
25456
+ return ENTRANCE_PRESETS;
25457
+ case "exit":
25458
+ return EXIT_PRESETS;
25459
+ case "emphasis":
25460
+ return EMPHASIS_PRESETS;
25461
+ case "motionPath":
25462
+ return MOTION_PATH_PRESETS;
25463
+ }
25464
+ }
25465
+
25466
+ // src/core/utils/smartart-relayout.ts
25467
+ function relayoutSmartArt(smartArtData, containerWidth, containerHeight) {
25468
+ if (!smartArtData.nodes || smartArtData.nodes.length === 0) {
25469
+ return [];
25470
+ }
25471
+ const bounds = {
25472
+ x: 0,
25473
+ y: 0,
25474
+ width: containerWidth,
25475
+ height: containerHeight
25476
+ };
25477
+ const engineShapes = computeSmartArtLayout(smartArtData, bounds);
25478
+ if (engineShapes && engineShapes.length > 0) {
25479
+ const layoutType = smartArtData.resolvedLayoutType ?? "list";
25480
+ return layoutEngineShapesToDrawingShapes(engineShapes, smartArtData.nodes, layoutType);
25481
+ }
25482
+ return smartArtData.drawingShapes ?? [];
25483
+ }
25484
+
24481
25485
  // src/core/core/runtime/PptxHandlerRuntimeSaveParagraphHelpers.ts
24482
25486
  var EMU_PER_PX5 = 9525;
24483
25487
  function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing) {
@@ -24488,12 +25492,6 @@ function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spac
24488
25492
  if (textStyle?.rtl !== void 0) {
24489
25493
  paragraphProps["@_rtl"] = textStyle.rtl ? "1" : "0";
24490
25494
  }
24491
- if (spacing.spacingBefore) {
24492
- paragraphProps["a:spcBef"] = spacing.spacingBefore;
24493
- }
24494
- if (spacing.spacingAfter) {
24495
- paragraphProps["a:spcAft"] = spacing.spacingAfter;
24496
- }
24497
25495
  if (spacing.lineSpacing) {
24498
25496
  paragraphProps["a:lnSpc"] = spacing.lineSpacing;
24499
25497
  } else if (typeof spacing.lineSpacingExactPt === "number" && Number.isFinite(spacing.lineSpacingExactPt)) {
@@ -24503,6 +25501,12 @@ function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spac
24503
25501
  }
24504
25502
  };
24505
25503
  }
25504
+ if (spacing.spacingBefore) {
25505
+ paragraphProps["a:spcBef"] = spacing.spacingBefore;
25506
+ }
25507
+ if (spacing.spacingAfter) {
25508
+ paragraphProps["a:spcAft"] = spacing.spacingAfter;
25509
+ }
24506
25510
  if (typeof textStyle?.paragraphMarginLeft === "number" && Number.isFinite(textStyle.paragraphMarginLeft)) {
24507
25511
  paragraphProps["@_marL"] = String(Math.round(textStyle.paragraphMarginLeft * EMU_PER_PX5));
24508
25512
  }
@@ -24553,9 +25557,10 @@ function applyBulletProperties(paragraphProps, bulletInfo) {
24553
25557
  paragraphProps["a:buNone"] = {};
24554
25558
  return;
24555
25559
  }
24556
- if (bulletInfo.fontFamily) {
24557
- paragraphProps["a:buFont"] = {
24558
- "@_typeface": bulletInfo.fontFamily
25560
+ if (bulletInfo.color) {
25561
+ const colorHex = bulletInfo.color.replace("#", "");
25562
+ paragraphProps["a:buClr"] = {
25563
+ "a:srgbClr": { "@_val": colorHex }
24559
25564
  };
24560
25565
  }
24561
25566
  if (bulletInfo.sizePercent !== void 0) {
@@ -24568,10 +25573,9 @@ function applyBulletProperties(paragraphProps, bulletInfo) {
24568
25573
  "@_val": String(Math.round(bulletInfo.sizePts * 100))
24569
25574
  };
24570
25575
  }
24571
- if (bulletInfo.color) {
24572
- const colorHex = bulletInfo.color.replace("#", "");
24573
- paragraphProps["a:buClr"] = {
24574
- "a:srgbClr": { "@_val": colorHex }
25576
+ if (bulletInfo.fontFamily) {
25577
+ paragraphProps["a:buFont"] = {
25578
+ "@_typeface": bulletInfo.fontFamily
24575
25579
  };
24576
25580
  }
24577
25581
  if (bulletInfo.char) {
@@ -24594,9 +25598,8 @@ function applyBulletProperties(paragraphProps, bulletInfo) {
24594
25598
  }
24595
25599
  function assembleParagraphXml(runs, paragraphProps) {
24596
25600
  const paragraph = {
24597
- "a:endParaRPr": { "@_lang": "en-US" }
25601
+ "a:pPr": paragraphProps
24598
25602
  };
24599
- paragraph["a:pPr"] = paragraphProps;
24600
25603
  const regularRuns = runs.filter((r) => !r.__isField);
24601
25604
  const fieldRuns = runs.filter((r) => r.__isField).map((r) => {
24602
25605
  const { __isField, ...rest } = r;
@@ -24615,6 +25618,7 @@ function assembleParagraphXml(runs, paragraphProps) {
24615
25618
  if (cleanRegularRuns.length === 0 && fieldRuns.length === 0) {
24616
25619
  paragraph["a:r"] = runs.length > 1 ? runs : runs[0];
24617
25620
  }
25621
+ paragraph["a:endParaRPr"] = { "@_lang": "en-US" };
24618
25622
  return paragraph;
24619
25623
  }
24620
25624
  function computeUniformSegmentOverrides(textStyle, textSegments) {
@@ -27453,9 +28457,6 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27453
28457
  if (style.textCaps && style.textCaps !== "none") {
27454
28458
  runProps["@_cap"] = style.textCaps;
27455
28459
  }
27456
- if (style.rtl !== void 0) {
27457
- runProps["@_rtl"] = style.rtl ? "1" : "0";
27458
- }
27459
28460
  if (style.kumimoji !== void 0) {
27460
28461
  runProps["@_kumimoji"] = style.kumimoji ? "1" : "0";
27461
28462
  }
@@ -27477,17 +28478,19 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27477
28478
  if (style.bookmark) {
27478
28479
  runProps["@_bmk"] = style.bookmark;
27479
28480
  }
27480
- if (style.fontFamily) {
27481
- runProps["a:latin"] = { "@_typeface": style.fontFamily };
27482
- runProps["a:ea"] = {
27483
- "@_typeface": style.eastAsiaFont || style.fontFamily
27484
- };
27485
- runProps["a:cs"] = {
27486
- "@_typeface": style.complexScriptFont || style.fontFamily
27487
- };
27488
- }
27489
- if (style.symbolFont) {
27490
- runProps["a:sym"] = { "@_typeface": style.symbolFont };
28481
+ if (style.textOutlineWidth || style.textOutlineColor) {
28482
+ const lnObj = {};
28483
+ if (typeof style.textOutlineWidth === "number" && style.textOutlineWidth > 0) {
28484
+ lnObj["@_w"] = String(Math.round(style.textOutlineWidth * _PptxHandlerRuntime.EMU_PER_PX));
28485
+ }
28486
+ if (style.textOutlineColor) {
28487
+ lnObj["a:solidFill"] = {
28488
+ "a:srgbClr": {
28489
+ "@_val": style.textOutlineColor.replace("#", "")
28490
+ }
28491
+ };
28492
+ }
28493
+ runProps["a:ln"] = lnObj;
27491
28494
  }
27492
28495
  if (style.color) {
27493
28496
  runProps["a:solidFill"] = {
@@ -27495,15 +28498,7 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27495
28498
  "@_val": style.color.replace("#", "")
27496
28499
  }
27497
28500
  };
27498
- }
27499
- if (style.highlightColor) {
27500
- runProps["a:highlight"] = {
27501
- "a:srgbClr": {
27502
- "@_val": style.highlightColor.replace("#", "")
27503
- }
27504
- };
27505
- }
27506
- if (style.textFillGradientStops && style.textFillGradientStops.length > 0) {
28501
+ } else if (style.textFillGradientStops && style.textFillGradientStops.length > 0) {
27507
28502
  const gradStops = style.textFillGradientStops.filter((stop) => Boolean(stop?.color)).map((stop) => {
27508
28503
  const rawPos = (stop.position ?? 0) / 100;
27509
28504
  const posVal = Math.round(Math.max(0, Math.min(1, rawPos)) * 1e5);
@@ -27536,8 +28531,7 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27536
28531
  }
27537
28532
  runProps["a:gradFill"] = gradFillXml;
27538
28533
  }
27539
- }
27540
- if (style.textFillPattern) {
28534
+ } else if (style.textFillPattern) {
27541
28535
  const pattFill = { "@_prst": style.textFillPattern };
27542
28536
  if (style.textFillPatternForeground) {
27543
28537
  pattFill["a:fgClr"] = {
@@ -27555,6 +28549,17 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27555
28549
  }
27556
28550
  runProps["a:pattFill"] = pattFill;
27557
28551
  }
28552
+ const textEffectLst = buildTextRunEffectListXml(style);
28553
+ if (textEffectLst) {
28554
+ runProps["a:effectLst"] = textEffectLst;
28555
+ }
28556
+ if (style.highlightColor) {
28557
+ runProps["a:highlight"] = {
28558
+ "a:srgbClr": {
28559
+ "@_val": style.highlightColor.replace("#", "")
28560
+ }
28561
+ };
28562
+ }
27558
28563
  if (style.underline && style.underlineColor) {
27559
28564
  runProps["a:uFill"] = {
27560
28565
  "a:solidFill": {
@@ -27564,23 +28569,17 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
27564
28569
  }
27565
28570
  };
27566
28571
  }
27567
- if (style.textOutlineWidth || style.textOutlineColor) {
27568
- const lnObj = {};
27569
- if (typeof style.textOutlineWidth === "number" && style.textOutlineWidth > 0) {
27570
- lnObj["@_w"] = String(Math.round(style.textOutlineWidth * _PptxHandlerRuntime.EMU_PER_PX));
27571
- }
27572
- if (style.textOutlineColor) {
27573
- lnObj["a:solidFill"] = {
27574
- "a:srgbClr": {
27575
- "@_val": style.textOutlineColor.replace("#", "")
27576
- }
27577
- };
27578
- }
27579
- runProps["a:ln"] = lnObj;
28572
+ if (style.fontFamily) {
28573
+ runProps["a:latin"] = { "@_typeface": style.fontFamily };
28574
+ runProps["a:ea"] = {
28575
+ "@_typeface": style.eastAsiaFont || style.fontFamily
28576
+ };
28577
+ runProps["a:cs"] = {
28578
+ "@_typeface": style.complexScriptFont || style.fontFamily
28579
+ };
27580
28580
  }
27581
- const textEffectLst = buildTextRunEffectListXml(style);
27582
- if (textEffectLst) {
27583
- runProps["a:effectLst"] = textEffectLst;
28581
+ if (style.symbolFont) {
28582
+ runProps["a:sym"] = { "@_typeface": style.symbolFont };
27584
28583
  }
27585
28584
  if (style.hyperlink && resolveHyperlinkRelationshipId) {
27586
28585
  const hyperlinkTarget = String(style.hyperlink).trim();
@@ -27828,6 +28827,55 @@ var PptxHandlerRuntime14 = class extends PptxHandlerRuntime13 {
27828
28827
 
27829
28828
  // src/core/core/runtime/PptxHandlerRuntimeSaveShapeXml.ts
27830
28829
  var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime14 {
28830
+ /**
28831
+ * Build a `p:graphicFrame` XML skeleton for an SDK-created table.
28832
+ *
28833
+ * Tables round-trip as `<p:graphicFrame>/<a:graphic>/<a:graphicData
28834
+ * uri=".../drawingml/2006/table">/<a:tbl>` inside `p:spTree`. When the
28835
+ * element was loaded from an existing file, `el.rawXml` already contains
28836
+ * this envelope and the downstream `serializeTableDataToXml` path
28837
+ * populates cells in place. When the element was created via the SDK
28838
+ * (`SlideBuilder.addTable`), there is no `rawXml`, so this method
28839
+ * fabricates a minimal envelope with an empty `a:tbl`. The element
28840
+ * writer then calls `serializeTableDataToXml`, which triggers
28841
+ * `rebuildTableXmlFromData` and fills in `a:tblGrid` / `a:tr` children.
28842
+ */
28843
+ createTableGraphicFrameXml(el) {
28844
+ const EMU = _PptxHandlerRuntime.EMU_PER_PX;
28845
+ const offX = String(Math.round(el.x * EMU));
28846
+ const offY = String(Math.round(el.y * EMU));
28847
+ const extCx = String(Math.round(Math.max(el.width, 1) * EMU));
28848
+ const extCy = String(Math.round(Math.max(el.height, 1) * EMU));
28849
+ const tblPr = {
28850
+ "@_firstRow": el.tableData?.firstRowHeader ? "1" : "0",
28851
+ "@_bandRow": el.tableData?.bandedRows ? "1" : "0"
28852
+ };
28853
+ if (el.tableData?.tableStyleId) {
28854
+ tblPr["a:tableStyleId"] = el.tableData.tableStyleId;
28855
+ }
28856
+ return {
28857
+ "p:nvGraphicFramePr": {
28858
+ "p:cNvPr": { "@_id": "0", "@_name": el.name || "Table" },
28859
+ "p:cNvGraphicFramePr": {
28860
+ "a:graphicFrameLocks": { "@_noGrp": "1" }
28861
+ },
28862
+ "p:nvPr": {}
28863
+ },
28864
+ "p:xfrm": {
28865
+ "a:off": { "@_x": offX, "@_y": offY },
28866
+ "a:ext": { "@_cx": extCx, "@_cy": extCy }
28867
+ },
28868
+ "a:graphic": {
28869
+ "a:graphicData": {
28870
+ "@_uri": "http://schemas.openxmlformats.org/drawingml/2006/table",
28871
+ "a:tbl": {
28872
+ "a:tblPr": tblPr,
28873
+ "a:tblGrid": {}
28874
+ }
28875
+ }
28876
+ }
28877
+ };
28878
+ }
27831
28879
  /**
27832
28880
  * Build a p:sp XML object for an ink annotation element.
27833
28881
  * Each ink path becomes a separate a:path within a:pathLst,
@@ -29309,14 +30357,15 @@ function writeCellTextFormatting(xmlCell, style, ensureArray6) {
29309
30357
  const paragraphs = ensureArray6(xmlCell["a:txBody"]?.["a:p"]);
29310
30358
  for (const paragraph of paragraphs) {
29311
30359
  const runs = ensureArray6(paragraph?.["a:r"]);
30360
+ const rebuiltRuns = [];
30361
+ let runsChanged = false;
29312
30362
  for (const run of runs) {
29313
30363
  if (!run) {
30364
+ rebuiltRuns.push(run);
29314
30365
  continue;
29315
30366
  }
29316
- if (!run["a:rPr"]) {
29317
- run["a:rPr"] = {};
29318
- }
29319
- const rPr = run["a:rPr"];
30367
+ const existingRPr = run["a:rPr"] ?? {};
30368
+ const rPr = { ...existingRPr };
29320
30369
  if (style.bold !== void 0) {
29321
30370
  rPr["@_b"] = style.bold ? "1" : "0";
29322
30371
  }
@@ -29336,6 +30385,18 @@ function writeCellTextFormatting(xmlCell, style, ensureArray6) {
29336
30385
  }
29337
30386
  };
29338
30387
  }
30388
+ const rebuilt = { "a:rPr": rPr };
30389
+ for (const key of Object.keys(run)) {
30390
+ if (key === "a:rPr") {
30391
+ continue;
30392
+ }
30393
+ rebuilt[key] = run[key];
30394
+ }
30395
+ rebuiltRuns.push(rebuilt);
30396
+ runsChanged = true;
30397
+ }
30398
+ if (runsChanged && rebuiltRuns.length > 0) {
30399
+ paragraph["a:r"] = rebuiltRuns.length === 1 ? rebuiltRuns[0] : rebuiltRuns;
29339
30400
  }
29340
30401
  }
29341
30402
  }
@@ -29357,6 +30418,9 @@ var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
29357
30418
  const existingParagraphs = this.ensureArray(txBody["a:p"]);
29358
30419
  const firstRPr = this.ensureArray(existingParagraphs[0]?.["a:r"])[0]?.["a:rPr"];
29359
30420
  const firstPPr = existingParagraphs[0]?.["a:pPr"];
30421
+ const firstEndParaRPr = existingParagraphs[0]?.["a:endParaRPr"];
30422
+ const rPrForRun = firstRPr ? { ...firstRPr } : { "@_lang": "en-US", "@_dirty": "0" };
30423
+ const endParaRPr = firstEndParaRPr ? { ...firstEndParaRPr } : { "@_lang": "en-US", "@_dirty": "0" };
29360
30424
  const lines = text.split("\n");
29361
30425
  const paragraphs = lines.map((line) => {
29362
30426
  const paragraph = {};
@@ -29364,9 +30428,10 @@ var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
29364
30428
  paragraph["a:pPr"] = firstPPr;
29365
30429
  }
29366
30430
  paragraph["a:r"] = {
29367
- ...firstRPr ? { "a:rPr": firstRPr } : {},
30431
+ "a:rPr": rPrForRun,
29368
30432
  "a:t": line
29369
30433
  };
30434
+ paragraph["a:endParaRPr"] = endParaRPr;
29370
30435
  return paragraph;
29371
30436
  });
29372
30437
  txBody["a:p"] = paragraphs.length === 1 ? paragraphs[0] : paragraphs;
@@ -29516,14 +30581,27 @@ function serializeCellMergeAttributes(xmlCell, cell) {
29516
30581
  delete xmlCell["@_vMerge"];
29517
30582
  }
29518
30583
  }
30584
+ var DEFAULT_POWERPOINT_TABLE_STYLE_ID = "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}";
29519
30585
  function serializeTablePropertyFlags(tbl, tableData) {
29520
30586
  const tblPr = tbl["a:tblPr"] ?? {};
29521
- tblPr["@_bandRow"] = tableData.bandedRows ? "1" : "0";
29522
- tblPr["@_bandCol"] = tableData.bandedColumns ? "1" : "0";
29523
- tblPr["@_firstRow"] = tableData.firstRowHeader ? "1" : "0";
29524
- tblPr["@_lastRow"] = tableData.lastRow ? "1" : "0";
29525
- tblPr["@_firstCol"] = tableData.firstCol ? "1" : "0";
29526
- tblPr["@_lastCol"] = tableData.lastCol ? "1" : "0";
30587
+ const setOrDelete = (key, truthy) => {
30588
+ if (truthy) {
30589
+ tblPr[key] = "1";
30590
+ } else {
30591
+ delete tblPr[key];
30592
+ }
30593
+ };
30594
+ setOrDelete("@_bandRow", tableData.bandedRows);
30595
+ setOrDelete("@_bandCol", tableData.bandedColumns);
30596
+ setOrDelete("@_firstRow", tableData.firstRowHeader);
30597
+ setOrDelete("@_lastRow", tableData.lastRow);
30598
+ setOrDelete("@_firstCol", tableData.firstCol);
30599
+ setOrDelete("@_lastCol", tableData.lastCol);
30600
+ if (tableData.tableStyleId) {
30601
+ tblPr["a:tableStyleId"] = tableData.tableStyleId;
30602
+ } else if (!tblPr["a:tableStyleId"]) {
30603
+ tblPr["a:tableStyleId"] = DEFAULT_POWERPOINT_TABLE_STYLE_ID;
30604
+ }
29527
30605
  tbl["a:tblPr"] = tblPr;
29528
30606
  }
29529
30607
  function replaceFirstTextValueInTree(node, localName, newValue, getXmlLocalName) {
@@ -29568,7 +30646,9 @@ function createDefaultXmlCell() {
29568
30646
  "a:bodyPr": {},
29569
30647
  "a:lstStyle": {},
29570
30648
  "a:p": {
29571
- "a:endParaRPr": { "@_lang": "en-US" }
30649
+ // Match PowerPoint's "Insert Table" default: every paragraph-end
30650
+ // run carries `lang="en-US" dirty="0"`.
30651
+ "a:endParaRPr": { "@_lang": "en-US", "@_dirty": "0" }
29572
30652
  }
29573
30653
  },
29574
30654
  "a:tcPr": {}
@@ -29576,6 +30656,11 @@ function createDefaultXmlCell() {
29576
30656
  }
29577
30657
 
29578
30658
  // src/core/core/runtime/table-xml-rebuild.ts
30659
+ var GRID_COL_ID_EXT_URI = "{9D8B030D-6E8A-4147-A177-3AD203B41FA5}";
30660
+ var A16_NAMESPACE = "http://schemas.microsoft.com/office/drawing/2014/main";
30661
+ function randomColumnId() {
30662
+ return String(Math.floor(Math.random() * 4294967295));
30663
+ }
29579
30664
  function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
29580
30665
  const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
29581
30666
  const existingGridCols = ensureArrayFn(
@@ -29584,8 +30669,31 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
29584
30669
  const totalWidthEmu = existingGridCols.reduce((sum, col) => {
29585
30670
  return sum + (parseInt(String(col?.["@_w"] || "0"), 10) || 0);
29586
30671
  }, 0) || 9144e3;
29587
- const newGridCols = tableData.columnWidths.map((w) => ({
29588
- "@_w": String(Math.round(w * totalWidthEmu))
30672
+ const existingColIds = existingGridCols.map((col) => {
30673
+ const extList = col?.["a:extLst"];
30674
+ const exts = Array.isArray(extList?.["a:ext"]) ? extList["a:ext"] : extList?.["a:ext"] ? [extList["a:ext"]] : [];
30675
+ for (const ext of exts) {
30676
+ if (ext?.["@_uri"] === GRID_COL_ID_EXT_URI) {
30677
+ const colId = ext["a16:colId"];
30678
+ const val = colId?.["@_val"];
30679
+ if (typeof val === "string" && val.length > 0) {
30680
+ return val;
30681
+ }
30682
+ }
30683
+ }
30684
+ return "";
30685
+ });
30686
+ const newGridCols = tableData.columnWidths.map((w, i) => ({
30687
+ "@_w": String(Math.round(w * totalWidthEmu)),
30688
+ "a:extLst": {
30689
+ "a:ext": {
30690
+ "@_uri": GRID_COL_ID_EXT_URI,
30691
+ "a16:colId": {
30692
+ "@_xmlns:a16": A16_NAMESPACE,
30693
+ "@_val": existingColIds[i] || randomColumnId()
30694
+ }
30695
+ }
30696
+ }
29589
30697
  }));
29590
30698
  if (!tbl["a:tblGrid"]) {
29591
30699
  tbl["a:tblGrid"] = {};
@@ -30501,32 +31609,58 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
30501
31609
  };
30502
31610
  for (const variant of variants) {
30503
31611
  const fontData = variant.rawFontData;
30504
- const guid = variant.fontGuid ?? generateFontGuid();
30505
- const fileName = `{${guid}}.fntdata`;
30506
- const fontPartPath = `ppt/fonts/${fileName}`;
30507
- const relativeTarget = `fonts/${fileName}`;
30508
- const obfuscated = obfuscateFont(fontData, guid);
30509
- this.zip.file(fontPartPath, obfuscated);
31612
+ const hasOriginal = Boolean(variant.originalRId && variant.partPath);
31613
+ const reuseObfuscation = hasOriginal && Boolean(variant.fontGuid);
31614
+ const reuseVerbatim = hasOriginal && !variant.fontGuid && Boolean(variant.originalPartBytes);
31615
+ let guid;
31616
+ let fontPartPath;
31617
+ let relativeTarget;
30510
31618
  let rId;
30511
- const existingRel = relationships.find(
30512
- (r) => String(r?.["@_Target"] || "") === relativeTarget
30513
- );
30514
- if (existingRel) {
30515
- rId = String(existingRel["@_Id"]);
31619
+ let bytesToWrite;
31620
+ let fontKeyForXml;
31621
+ if (reuseObfuscation) {
31622
+ guid = variant.fontGuid;
31623
+ fontPartPath = variant.partPath;
31624
+ relativeTarget = fontPartPath.startsWith("ppt/") ? fontPartPath.substring(4) : fontPartPath;
31625
+ rId = variant.originalRId;
31626
+ bytesToWrite = obfuscateFont(fontData, guid);
31627
+ fontKeyForXml = `{${guid}}`;
31628
+ } else if (reuseVerbatim) {
31629
+ guid = "";
31630
+ fontPartPath = variant.partPath;
31631
+ relativeTarget = fontPartPath.startsWith("ppt/") ? fontPartPath.substring(4) : fontPartPath;
31632
+ rId = variant.originalRId;
31633
+ bytesToWrite = variant.originalPartBytes;
31634
+ fontKeyForXml = void 0;
30516
31635
  } else {
30517
- maxId++;
30518
- rId = `rId${maxId}`;
30519
- relationships.push({
30520
- "@_Id": rId,
30521
- "@_Type": _PptxHandlerRuntime.FONT_REL_TYPE,
30522
- "@_Target": relativeTarget
30523
- });
31636
+ guid = variant.fontGuid ?? generateFontGuid();
31637
+ const fileName = `{${guid}}.fntdata`;
31638
+ fontPartPath = `ppt/fonts/${fileName}`;
31639
+ relativeTarget = `fonts/${fileName}`;
31640
+ bytesToWrite = obfuscateFont(fontData, guid);
31641
+ fontKeyForXml = `{${guid}}`;
31642
+ const existingRel = relationships.find(
31643
+ (r) => String(r?.["@_Target"] || "") === relativeTarget
31644
+ );
31645
+ if (existingRel) {
31646
+ rId = String(existingRel["@_Id"]);
31647
+ } else {
31648
+ maxId++;
31649
+ rId = `rId${maxId}`;
31650
+ relationships.push({
31651
+ "@_Id": rId,
31652
+ "@_Type": _PptxHandlerRuntime.FONT_REL_TYPE,
31653
+ "@_Target": relativeTarget
31654
+ });
31655
+ }
30524
31656
  }
31657
+ this.zip.file(fontPartPath, bytesToWrite);
30525
31658
  const variantKey = variant.bold && variant.italic ? "p:boldItalic" : variant.bold ? "p:bold" : variant.italic ? "p:italic" : "p:regular";
30526
- entry[variantKey] = {
30527
- "@_r:id": rId,
30528
- "@_fontKey": `{${guid}}`
30529
- };
31659
+ const variantEntry = { "@_r:id": rId };
31660
+ if (fontKeyForXml) {
31661
+ variantEntry["@_fontKey"] = fontKeyForXml;
31662
+ }
31663
+ entry[variantKey] = variantEntry;
30530
31664
  }
30531
31665
  embeddedFontEntries.push(entry);
30532
31666
  }
@@ -30670,54 +31804,59 @@ var PptxHandlerRuntime25 = class extends PptxHandlerRuntime24 {
30670
31804
  }
30671
31805
  };
30672
31806
  const root = propsData["p:presentationPr"] || {};
30673
- const showPr = root["p:showPr"] || {};
30674
- delete showPr["p:present"];
30675
- delete showPr["p:browse"];
30676
- delete showPr["p:kiosk"];
30677
- if (properties.showType === "browsed") {
30678
- showPr["p:browse"] = {};
30679
- } else if (properties.showType === "kiosk") {
30680
- const kioskNode = {};
30681
- if (properties.kioskRestartTime !== void 0 && properties.kioskRestartTime > 0) {
30682
- kioskNode["@_restart"] = String(properties.kioskRestartTime);
31807
+ const existingShowPr = root["p:showPr"] || {};
31808
+ const rebuiltShowPr = {};
31809
+ for (const key of Object.keys(existingShowPr)) {
31810
+ if (key.startsWith("@_")) {
31811
+ rebuiltShowPr[key] = existingShowPr[key];
30683
31812
  }
30684
- showPr["p:kiosk"] = kioskNode;
30685
- } else {
30686
- showPr["p:present"] = {};
30687
31813
  }
30688
31814
  if (properties.loopContinuously !== void 0) {
30689
- showPr["@_loop"] = properties.loopContinuously ? "1" : "0";
31815
+ rebuiltShowPr["@_loop"] = properties.loopContinuously ? "1" : "0";
30690
31816
  }
30691
31817
  if (properties.showWithNarration !== void 0) {
30692
- showPr["@_showNarration"] = properties.showWithNarration ? "1" : "0";
31818
+ rebuiltShowPr["@_showNarration"] = properties.showWithNarration ? "1" : "0";
30693
31819
  }
30694
31820
  if (properties.showWithAnimation !== void 0) {
30695
- showPr["@_showAnimation"] = properties.showWithAnimation ? "1" : "0";
31821
+ rebuiltShowPr["@_showAnimation"] = properties.showWithAnimation ? "1" : "0";
30696
31822
  }
30697
31823
  if (properties.advanceMode !== void 0) {
30698
- showPr["@_useTimings"] = properties.advanceMode === "useTimings" ? "1" : "0";
31824
+ rebuiltShowPr["@_useTimings"] = properties.advanceMode === "useTimings" ? "1" : "0";
30699
31825
  }
30700
- if (properties.penColor) {
30701
- showPr["p:penClr"] = {
30702
- "a:srgbClr": { "@_val": properties.penColor.replace("#", "") }
30703
- };
31826
+ if (properties.showType === "browsed") {
31827
+ rebuiltShowPr["p:browse"] = {};
31828
+ } else if (properties.showType === "kiosk") {
31829
+ const kioskNode = {};
31830
+ if (properties.kioskRestartTime !== void 0 && properties.kioskRestartTime > 0) {
31831
+ kioskNode["@_restart"] = String(properties.kioskRestartTime);
31832
+ }
31833
+ rebuiltShowPr["p:kiosk"] = kioskNode;
31834
+ } else {
31835
+ rebuiltShowPr["p:present"] = {};
30704
31836
  }
30705
- delete showPr["p:sldAll"];
30706
- delete showPr["p:sldRg"];
30707
- delete showPr["p:custShow"];
30708
31837
  if (properties.showSlidesMode === "range") {
30709
- showPr["p:sldRg"] = {
31838
+ rebuiltShowPr["p:sldRg"] = {
30710
31839
  "@_st": String(properties.showSlidesFrom ?? 1),
30711
31840
  "@_end": String(properties.showSlidesTo ?? 1)
30712
31841
  };
30713
31842
  } else if (properties.showSlidesMode === "customShow" && properties.showSlidesCustomShowId) {
30714
- showPr["p:custShow"] = {
31843
+ rebuiltShowPr["p:custShow"] = {
30715
31844
  "@_id": properties.showSlidesCustomShowId
30716
31845
  };
30717
31846
  } else {
30718
- showPr["p:sldAll"] = {};
31847
+ rebuiltShowPr["p:sldAll"] = {};
31848
+ }
31849
+ if (properties.penColor) {
31850
+ rebuiltShowPr["p:penClr"] = {
31851
+ "a:srgbClr": { "@_val": properties.penColor.replace("#", "") }
31852
+ };
31853
+ } else if (existingShowPr["p:penClr"] !== void 0) {
31854
+ rebuiltShowPr["p:penClr"] = existingShowPr["p:penClr"];
30719
31855
  }
30720
- root["p:showPr"] = showPr;
31856
+ if (existingShowPr["p:extLst"] !== void 0) {
31857
+ rebuiltShowPr["p:extLst"] = existingShowPr["p:extLst"];
31858
+ }
31859
+ root["p:showPr"] = rebuiltShowPr;
30721
31860
  if (properties.printFrameSlides !== void 0 || properties.printSlidesPerPage !== void 0 || properties.printColorMode !== void 0) {
30722
31861
  const prnPr = root["p:prnPr"] || {};
30723
31862
  if (properties.printFrameSlides !== void 0) {
@@ -31848,7 +32987,12 @@ var PptxHandlerRuntime31 = class extends PptxHandlerRuntime30 {
31848
32987
  shape = this.createPictureXml(el, relationshipId);
31849
32988
  }
31850
32989
  if (targetImagePath) {
31851
- this.zip.file(targetImagePath, parsedImage.bytes);
32990
+ const targetExt = targetImagePath.toLowerCase().match(/\.([^./\\]+)$/)?.[1];
32991
+ const parsedExt = parsedImage.extension.toLowerCase();
32992
+ const extensionMismatch = targetExt !== void 0 && targetExt !== parsedExt && !(targetExt === "jpg" && parsedExt === "jpeg") && !(targetExt === "jpeg" && parsedExt === "jpg");
32993
+ if (!extensionMismatch) {
32994
+ this.zip.file(targetImagePath, parsedImage.bytes);
32995
+ }
31852
32996
  }
31853
32997
  } else {
31854
32998
  this.compatibilityService.reportWarning({
@@ -31959,6 +33103,9 @@ var PptxHandlerRuntime32 = class _PptxHandlerRuntime extends PptxHandlerRuntime3
31959
33103
  if (!shape && el.type === "ink") {
31960
33104
  shape = this.createInkShapeXml(el);
31961
33105
  }
33106
+ if (!shape && el.type === "table") {
33107
+ shape = this.createTableGraphicFrameXml(el);
33108
+ }
31962
33109
  if (!shape) {
31963
33110
  this.compatibilityService.reportWarning({
31964
33111
  code: "SAVE_ELEMENT_SKIPPED",
@@ -32253,6 +33400,7 @@ var PptxHandlerRuntime34 = class _PptxHandlerRuntime extends PptxHandlerRuntime3
32253
33400
  );
32254
33401
  } else {
32255
33402
  this.zip.remove("ppt/commentAuthors.xml");
33403
+ await this.stripPresentationCommentAuthorsRelationship();
32256
33404
  }
32257
33405
  const contentTypesXmlAfterComments = await this.zip.file("[Content_Types].xml")?.async("string");
32258
33406
  if (contentTypesXmlAfterComments) {
@@ -32326,8 +33474,39 @@ var PptxHandlerRuntime34 = class _PptxHandlerRuntime extends PptxHandlerRuntime3
32326
33474
  if (effectiveConformance === "strict") {
32327
33475
  await this.convertZipToStrictConformance();
32328
33476
  }
33477
+ for (const name of Object.keys(this.zip.files)) {
33478
+ if (this.zip.files[name].dir) {
33479
+ delete this.zip.files[name];
33480
+ }
33481
+ }
32329
33482
  return await this.zip.generateAsync({ type: "uint8array" });
32330
33483
  }
33484
+ /**
33485
+ * Remove any Relationship in presentation.xml.rels whose Type matches either
33486
+ * the Transitional or Strict commentAuthors relationship URI.
33487
+ */
33488
+ async stripPresentationCommentAuthorsRelationship() {
33489
+ const relsPath = "ppt/_rels/presentation.xml.rels";
33490
+ const relsXml = await this.zip.file(relsPath)?.async("string");
33491
+ if (!relsXml) {
33492
+ return;
33493
+ }
33494
+ const relsData = this.parser.parse(relsXml);
33495
+ const root = relsData["Relationships"];
33496
+ if (!root) {
33497
+ return;
33498
+ }
33499
+ const relationships = this.ensureArray(root["Relationship"]);
33500
+ const filtered = relationships.filter((relationship) => {
33501
+ const type = String(relationship?.["@_Type"] ?? "");
33502
+ return type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors" && type !== "http://purl.oclc.org/ooxml/officeDocument/relationships/commentAuthors";
33503
+ });
33504
+ if (filtered.length === relationships.length) {
33505
+ return;
33506
+ }
33507
+ root["Relationship"] = filtered;
33508
+ this.zip.file(relsPath, this.builder.build(relsData));
33509
+ }
32331
33510
  };
32332
33511
 
32333
33512
  // src/core/core/runtime/PptxHandlerRuntimeElementParsing.ts
@@ -34312,7 +35491,7 @@ var PptxHandlerRuntime44 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
34312
35491
  }
34313
35492
  const shapeStyle = this.extractShapeStyle(effectiveSpPr, styleNode);
34314
35493
  const hasText = text.trim().length > 0;
34315
- const isPlainRect = !prstGeom || prstGeom === "rect";
35494
+ const isPlainRect = (!prstGeom || prstGeom === "rect") && !custGeom;
34316
35495
  const hasVisibleStyle = shapeStyle.fillColor && shapeStyle.fillColor !== "transparent" || (shapeStyle.strokeWidth || 0) > 0;
34317
35496
  let type = "shape";
34318
35497
  if (hasText && isPlainRect && !hasVisibleStyle) {
@@ -34324,6 +35503,7 @@ var PptxHandlerRuntime44 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
34324
35503
  slideRelationshipMap,
34325
35504
  this.orderedSlidePaths
34326
35505
  );
35506
+ const elementName = cNvPrForActions?.["@_name"] ? String(cNvPrForActions["@_name"]).trim() : void 0;
34327
35507
  const cNvSpPr = shape?.["p:nvSpPr"]?.["p:cNvSpPr"];
34328
35508
  const spLocksNode = cNvSpPr?.["a:spLocks"];
34329
35509
  const slideLocks = this.parseShapeLocks(spLocksNode);
@@ -34334,6 +35514,7 @@ var PptxHandlerRuntime44 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
34334
35514
  const promptText = !hasText && phDefaults?.promptText ? phDefaults.promptText : void 0;
34335
35515
  const commonProps = {
34336
35516
  id,
35517
+ name: elementName || void 0,
34337
35518
  x,
34338
35519
  y,
34339
35520
  width,
@@ -34570,12 +35751,14 @@ var PptxHandlerRuntime45 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
34570
35751
  picSlideRels,
34571
35752
  this.orderedSlidePaths
34572
35753
  );
35754
+ const picElementName = picCNvPr?.["@_name"] ? String(picCNvPr["@_name"]).trim() : void 0;
34573
35755
  const picCNvPicPr = pic?.["p:nvPicPr"]?.["p:cNvPicPr"];
34574
35756
  const picLocks = this.parseShapeLocks(
34575
35757
  picCNvPicPr?.["a:picLocks"] ?? picCNvPicPr?.["a:spLocks"]
34576
35758
  );
34577
35759
  return {
34578
35760
  id,
35761
+ name: picElementName || void 0,
34579
35762
  type: "picture",
34580
35763
  x,
34581
35764
  y,
@@ -35122,9 +36305,11 @@ var PptxHandlerRuntime47 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
35122
36305
  grpSlideRels,
35123
36306
  this.orderedSlidePaths
35124
36307
  );
36308
+ const grpElementName = grpCNvPr?.["@_name"] ? String(grpCNvPr["@_name"]).trim() : void 0;
35125
36309
  const groupElement = {
35126
36310
  type: "group",
35127
36311
  id: baseId,
36312
+ name: grpElementName || void 0,
35128
36313
  x: parentX,
35129
36314
  y: parentY,
35130
36315
  width: parentW || Math.max(...children.map((c) => c.x + c.width)),
@@ -39004,6 +40189,7 @@ var PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
39004
40189
  if (!fontBinary || fontBinary.length === 0) {
39005
40190
  return null;
39006
40191
  }
40192
+ const originalPartBytes = new Uint8Array(fontBinary);
39007
40193
  let fontData;
39008
40194
  let resolvedGuid;
39009
40195
  if (isEotFormat(fontBinary)) {
@@ -39057,7 +40243,9 @@ var PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
39057
40243
  format,
39058
40244
  rawFontData: fontData,
39059
40245
  partPath: fontPath,
39060
- fontGuid: resolvedGuid
40246
+ fontGuid: resolvedGuid,
40247
+ originalRId: rId,
40248
+ originalPartBytes
39061
40249
  };
39062
40250
  } catch {
39063
40251
  return null;
@@ -40668,6 +41856,14 @@ var EXTENDED_SHAPE_DEFINITIONS = [
40668
41856
  { name: "line", label: "Line", category: "other" },
40669
41857
  { name: "lineInv", label: "Line Inverse", category: "other" },
40670
41858
  { name: "straightConnector1", label: "Straight Connector", category: "other" },
41859
+ { name: "bentConnector2", label: "Elbow Connector (L)", category: "other" },
41860
+ { name: "bentConnector3", label: "Elbow Connector (Z)", category: "other" },
41861
+ { name: "bentConnector4", label: "Elbow Connector (3-Segment)", category: "other" },
41862
+ { name: "bentConnector5", label: "Elbow Connector (4-Segment)", category: "other" },
41863
+ { name: "curvedConnector2", label: "Curved Connector (L)", category: "other" },
41864
+ { name: "curvedConnector3", label: "Curved Connector (2-Segment)", category: "other" },
41865
+ { name: "curvedConnector4", label: "Curved Connector (3-Segment)", category: "other" },
41866
+ { name: "curvedConnector5", label: "Curved Connector (4-Segment)", category: "other" },
40671
41867
  // ── Arrows ────────────────────────────────────────────────────────────
40672
41868
  { name: "rightArrow", label: "Right Arrow", category: "arrows" },
40673
41869
  { name: "leftArrow", label: "Left Arrow", category: "arrows" },
@@ -49425,4 +50621,4 @@ var SvgExporter = class _SvgExporter {
49425
50621
  }
49426
50622
  };
49427
50623
 
49428
- export { COLOR_MAP_ALIAS_KEYS, CONNECTOR_ARROW_OPTIONS, CONNECTOR_GEOMETRY_OPTIONS, ChartBuilder, ConnectorBuilder, ConnectorXmlFactory, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_COLOR_MAP, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_SCHEME_COLOR_MAP, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, DataIntegrityError, DocumentConverter, EMU_PER_INCH, EMU_PER_PIXEL2 as EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_PX, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, EncryptedFileError, FONT_SUBSTITUTION_MAP, FreeformPathBuilder, GroupBuilder, ImageBuilder, IncorrectPasswordError, MIN_ELEMENT_SIZE, MediaBuilder, MediaContext, MediaGraphicFrameXmlFactory, OPC_RELATIONSHIP_TRANSFORM, Ole2ParseError, P14_GUIDE_URI, P15_GUIDE_URI, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, POWERPOINT_PRESENCE_KEY, PPTX_VIEWER_MANIFEST_NS, PRESET_COLOR_MAP, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime75 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMarkdownConverter, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState as PptxSaveSession, PptxSaveStateBuilder as PptxSaveSessionBuilder, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, Presentation, PresentationBuilder, SHAPE_TREE_ELEMENT_TAGS, STROKE_DASH_OPTIONS, SUPPORTED_XML_CANON_TRANSFORMS, SWITCHABLE_LAYOUT_TYPES, SYSTEM_COLOR_MAP, ShapeBuilder, SlideBuilder, SlideProcessor, SlideSizes, SvgExporter, THEME_COLOR_SCHEME_KEYS, THEME_PRESETS, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, TextShapeXmlFactory, ThemePresets, VML_SHAPE_TAGS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, addChartCategory, addChartSeries, addSection, addSmartArtNode, addSmartArtNodeAsChild, applyDrawingColorTransforms, applyKinsokuToXml, applyTemplate, applyThemeToData, areNamespacesSupported, buildCalloutLeaderLineSvgPath, buildClrMapOverrideXml, buildFontFamilyString, buildGuideListExtension, buildLinkedTextBoxChains, buildOle2, buildSingleEffectNode, buildThemeColorMap, catmullRomToBezier, chartDataAddCategory, chartDataAddSeries, chartDataChangeType, chartDataRemoveCategory, chartDataRemoveSeries, chartDataUpdatePoint, clampUnitInterval, classifyPanose, cloneElement, cloneShapeStyle, cloneSlide, cloneTemplateElementsBySlideId, cloneTextStyle, cloneXmlObject, cm, cmToEmu, colorWithOpacity, combineShapes, computeCycleLayout, computeDetailStatus, computeDigestBase64 as computeDigestBase64WebCrypto, computeHierarchyLayout, computeLinearLayout, computeMatrixLayout, computePyramidLayout, computeSmartArtLayout, computeSnakeLayout, computeVerificationStatus, convertEmfToDataUrl, convertWmfToDataUrl, convertXmlToStrict, createArrayBufferCopy, createBuiltinVariables, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createEditorId, createFreeformElement, createGroupElement, createImageElement, createLayout, createLayouts, createMediaElement, createModifyVerifier, createPptxSaveConstants, createShapeElement, createTableElement, createTemplateConnectorRawXml, createTemplateShapeRawXml, createTextElement, createUniformTextSegments, dataUrlToMediaBytes, decomposeSmartArt, decryptPptx, demoteSmartArtNode, deobfuscateFont, deriveOutputPath, detectDigitalSignatures, detectFileFormat, detectFontFormat, detectOleObjectType, detectStrictConformance, diffPresentations, diffSlides, distributeSegmentsAcrossChain, douglasPeucker, duplicateElement, duplicateSlide, elementActionToPptxAction, elementHasAction, emuToPixels, encryptPptx, ensureArrayValue, escapeXmlAttr, estimateTextBoxCapacity, evaluateGeometryPaths, evaluateGuides, extractAllTagText, extractFirstTagText, extractGuidFromPartName, extractModel3DTransform, extractTagAttribute, fetchUrlToBytes, findLayoutByName, findLayoutByType, findPlaceholders, findText, formatCommentTimestamp, fragmentShapes, generateFontGuid, generateLayoutXml, generateMediaFilename, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCommentMarkerPosition, getConnectorAdjustment, getConnectorPathGeometry, getCssBorderDashStyle, getDirectory, getElementLabel, getElementTextContent, getElementTransform, getImageMaskStyle, getLinkedTextBoxSegments, getOleObjectTypeLabel, getPanoseWeight, getPresetShapeClipPath, getRoundRectRadiusPx, getSectionForSlide, getSectionSlideRange, getShapeClipPath, getShapeType, getSignaturePathsToStrip, getSubstituteFontFamily, getSubstituteFonts, getSupportedNamespaces, getSvgStrokeDasharray, getTextCompensationTransform, getThemePreset, getZoomElements, getZoomTargetSlideIndexes, guidToKey, guideEmuToPx, guidePxToEmu, hasDirectSubstitution, hasNonTrivialOverride, hasShapeProperties, hasTextProperties, hexToRgbChannels, hslToRgb, inches, inchesToEmu, inferOleExtensionFromTarget, interpolateShapeGeometry, intersectPolygons, intersectShapes, intersectSvgPaths, isCalloutShape, isConnectorElement, isEditableTextElement, isImageLikeElement, isInkElement, isNamespaceSupported, isShapeElement, isStrictNamespaceUri, isSummaryZoomSlide, isSwitchableLayoutType, isTemplateElement, isTextElement, isTransitionalNamespaceUri, isZoomElement, isZoomElement2 as isZoomElementUtil, layoutEngineShapesToDrawingShapes, mailMerge, mergePresentation, mergeShapes, mergeThemeColorOverride, mm, moveSlidesToSection, normalizeHexColor, normalizeNamespaceUri, normalizePartPath, normalizePath, normalizeStrictXml, normalizeStrokeDashType, obfuscateFont, ooxmlArcToSvg, parseActiveXControlsFromSlide, parseAdjustmentValues, parseBodyPrBooleanAttrs, parseChart3DSurfaces, parseChartAxes, parseCondition, parseConditionList, parseCxChartSeries, parseDataTable, parseDataUrlToBytes, parseDrawingColor, parseDrawingColorChoice, parseDrawingColorOpacity, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingPercent, parseEmbeddedXlsx, parseGuideDefinitions, parseKinsoku, parseLayoutDefinition, parseLineStyle, parseMarker, parseOle2, parsePanoseBytes, parsePanoseString, parsePresentationDrawingGuides, parseSeriesDataLabels, parseSeriesDataPoints, parseSeriesErrBars, parseSeriesExplosion, parseSeriesTrendlines, parseShapeProps, parseSignatureXml, parseSlideDrawingGuides, parseSvgPath, parseVmlElement, parseVmlElements, pixelsToEmu, polygonsToSvgPath, pptxActionToElementAction, promoteSmartArtNode, pt, reResolveSlideColors, readFileAsDataUrl, reflowSmartArtLayout, removeChartCategory, removeChartSeries, removeSection, removeSmartArtNode, reorderSections, reorderSmartArtNode, reorderSmartArtNodeToIndex, repairPptx, replaceShapeGeometry, replaceText, replaceTextInSlide, replaceWithCustomGeometry, resetCloneIdCounter, resetDecomposeCounter, resetIdCounter, resetSectionIdCounter, resetSmartArtEditCounter, resolveCoordinate, resolveModel3DMimeType, resolveReferenceUriToPart, rgbToHsl, selectAlternateContentBranch, serializeCondition, serializeConditionList, serializeSvgPath, setChartCategories, setChartGrouping, setChartTitle, setChartType, shouldRenderFallbackLabel, shouldReturnToZoomSlide, subtractPolygons, subtractShapes, subtractSvgPaths, svgPathToPolygons, switchSmartArtLayout, toHex, toStrictNamespaceUri, unionPolygons, unionShapes, unionSvgPaths, unwrapAlternateContent, updateChartDataPoint, updateChartSeriesValues, updateSmartArtNodeText, validatePptx, verifyModifyPassword, verifyPassword, verifySignatureDigests, writeBodyPrBooleanAttrs };
50624
+ export { ALL_ANIMATION_PRESETS, COLOR_MAP_ALIAS_KEYS, CONNECTOR_ARROW_OPTIONS, CONNECTOR_GEOMETRY_OPTIONS, ChartBuilder, ConnectorBuilder, ConnectorXmlFactory, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_COLOR_MAP, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_SCHEME_COLOR_MAP, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, DataIntegrityError, DocumentConverter, EMPHASIS_PRESETS, EMU_PER_INCH, EMU_PER_PIXEL2 as EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_PX, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, ENTRANCE_PRESETS, EXIT_PRESETS, EncryptedFileError, FONT_SUBSTITUTION_MAP, FreeformPathBuilder, GroupBuilder, ImageBuilder, IncorrectPasswordError, MIN_ELEMENT_SIZE, MOTION_PATH_PRESETS, MediaBuilder, MediaContext, MediaGraphicFrameXmlFactory, OPC_RELATIONSHIP_TRANSFORM, Ole2ParseError, P14_GUIDE_URI, P15_GUIDE_URI, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, POWERPOINT_PRESENCE_KEY, PPTX_VIEWER_MANIFEST_NS, PRESET_COLOR_MAP, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime75 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMarkdownConverter, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState as PptxSaveSession, PptxSaveStateBuilder as PptxSaveSessionBuilder, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, Presentation, PresentationBuilder, SHAPE_TREE_ELEMENT_TAGS, STROKE_DASH_OPTIONS, SUPPORTED_XML_CANON_TRANSFORMS, SWITCHABLE_LAYOUT_TYPES, SYSTEM_COLOR_MAP, ShapeBuilder, SlideBuilder, SlideProcessor, SlideSizes, SvgExporter, THEME_COLOR_SCHEME_KEYS, THEME_PRESETS, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, TextShapeXmlFactory, ThemePresets, VML_SHAPE_TAGS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, addChartCategory, addChartSeries, addSection, addSmartArtNode, addSmartArtNodeAsChild, applyDrawingColorTransforms, applyKinsokuToXml, applyTemplate, applyThemeToData, areNamespacesSupported, buildCalloutLeaderLineSvgPath, buildClrMapOverrideXml, buildFontFamilyString, buildGuideListExtension, buildLinkedTextBoxChains, buildOle2, buildSingleEffectNode, buildThemeColorMap, catmullRomToBezier, chartDataAddCategory, chartDataAddSeries, chartDataChangeType, chartDataRemoveCategory, chartDataRemoveSeries, chartDataUpdatePoint, checkBlankSlide, checkComplexTables, checkDuplicateTitles, checkLowContrast, checkMissingAltText, checkMissingSlideTitle, checkPresentation, clampUnitInterval, classifyPanose, cloneElement, cloneShapeStyle, cloneSlide, cloneTemplateElementsBySlideId, cloneTextStyle, cloneXmlObject, cm, cmToEmu, colorWithOpacity, combineShapes, computeContrastRatio, computeCycleLayout, computeDetailStatus, computeDigestBase64 as computeDigestBase64WebCrypto, computeHierarchyLayout, computeLinearLayout, computeMatrixLayout, computePyramidLayout, computeSmartArtLayout, computeSnakeLayout, computeVerificationStatus, convertEmfToDataUrl, convertWmfToDataUrl, convertXmlToStrict, createArrayBufferCopy, createBuiltinVariables, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createEditorId, createFreeformElement, createGroupElement, createImageElement, createLayout, createLayouts, createMediaElement, createModifyVerifier, createPptxSaveConstants, createShapeElement, createTableElement, createTemplateConnectorRawXml, createTemplateShapeRawXml, createTextElement, createUniformTextSegments, dataUrlToMediaBytes, decomposeSmartArt, decryptPptx, demoteSmartArtNode, deobfuscateFont, deriveOutputPath, detectDigitalSignatures, detectFileFormat, detectFontFormat, detectOleObjectType, detectStrictConformance, diffPresentations, diffSlides, distributeSegmentsAcrossChain, douglasPeucker, duplicateElement, duplicateSlide, elementActionToPptxAction, elementHasAction, emuToPixels, encryptPptx, ensureArrayValue, escapeXmlAttr, estimateTextBoxCapacity, evaluateGeometryPaths, evaluateGuides, extractAllTagText, extractFirstTagText, extractGuidFromPartName, extractModel3DTransform, extractTagAttribute, fetchUrlToBytes, findCustomShow, findLayoutByName, findLayoutByType, findPlaceholders, findText, formatCommentTimestamp, fragmentShapes, generateFontGuid, generateLayoutXml, generateMediaFilename, getAnimationPresetInfo, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCommentMarkerPosition, getConnectorAdjustment, getConnectorPathGeometry, getCssBorderDashStyle, getCustomShowNames, getCustomShowPositionLabel, getDirectory, getElementLabel, getElementTextContent, getElementTransform, getImageMaskStyle, getLinkedTextBoxSegments, getOleObjectTypeLabel, getPanoseWeight, getPresetShapeClipPath, getPresetsByCategory, getRoundRectRadiusPx, getSectionForSlide, getSectionSlideRange, getShapeClipPath, getShapeType, getSignaturePathsToStrip, getSubstituteFontFamily, getSubstituteFonts, getSupportedNamespaces, getSvgStrokeDasharray, getTextCompensationTransform, getThemePreset, getZoomElements, getZoomTargetSlideIndexes, guidToKey, guideEmuToPx, guidePxToEmu, hasDirectSubstitution, hasNonTrivialOverride, hasShapeProperties, hasTextProperties, hexToRgbChannels, hslToRgb, inches, inchesToEmu, inferOleExtensionFromTarget, interpolateShapeGeometry, intersectPolygons, intersectShapes, intersectSvgPaths, isCalloutShape, isConnectorElement, isEditableTextElement, isImageLikeElement, isInkElement, isNamespaceSupported, isShapeElement, isStrictNamespaceUri, isSummaryZoomSlide, isSwitchableLayoutType, isTemplateElement, isTextElement, isTransitionalNamespaceUri, isZoomElement, isZoomElement2 as isZoomElementUtil, layoutEngineShapesToDrawingShapes, mailMerge, mergePresentation, mergeShapes, mergeStyleParts, mergeThemeColorOverride, mm, moveSlidesToSection, navigateCustomShow, normalizeHexColor, normalizeNamespaceUri, normalizePartPath, normalizePath, normalizeStrictXml, normalizeStrokeDashType, obfuscateFont, ooxmlArcToSvg, parseActiveXControlsFromSlide, parseAdjustmentValues, parseBodyPrBooleanAttrs, parseChart3DSurfaces, parseChartAxes, parseCondition, parseConditionList, parseCxChartSeries, parseDataTable, parseDataUrlToBytes, parseDrawingColor, parseDrawingColorChoice, parseDrawingColorOpacity, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingPercent, parseEmbeddedXlsx, parseGuideDefinitions, parseHexColor, parseKinsoku, parseLayoutDefinition, parseLineStyle, parseMarker, parseOle2, parsePanoseBytes, parsePanoseString, parsePresentationDrawingGuides, parseSeriesDataLabels, parseSeriesDataPoints, parseSeriesErrBars, parseSeriesExplosion, parseSeriesTrendlines, parseShapeProps, parseSignatureXml, parseSlideDrawingGuides, parseSvgPath, parseVmlElement, parseVmlElements, pixelsToEmu, polygonsToSvgPath, pptxActionToElementAction, promoteSmartArtNode, pt, reResolveSlideColors, readFileAsDataUrl, reflowSmartArtLayout, relativeLuminance, relayoutSmartArt, removeChartCategory, removeChartSeries, removeSection, removeSmartArtNode, reorderSections, reorderSmartArtNode, reorderSmartArtNodeToIndex, repairPptx, replaceShapeGeometry, replaceText, replaceTextInSlide, replaceWithCustomGeometry, resetCloneIdCounter, resetDecomposeCounter, resetIdCounter, resetSectionIdCounter, resetSmartArtEditCounter, resolveCoordinate, resolveCustomShowSlideIndices, resolveModel3DMimeType, resolveReferenceUriToPart, resolveTableCellStyle, rgbToHsl, selectAlternateContentBranch, serializeCondition, serializeConditionList, serializeSvgPath, setChartCategories, setChartGrouping, setChartTitle, setChartType, shouldRenderFallbackLabel, shouldReturnToZoomSlide, subtractPolygons, subtractShapes, subtractSvgPaths, svgPathToPolygons, switchSmartArtLayout, toHex, toStrictNamespaceUri, unionPolygons, unionShapes, unionSvgPaths, unwrapAlternateContent, updateChartDataPoint, updateChartSeriesValues, updateSmartArtNodeText, validatePptx, verifyModifyPassword, verifyPassword, verifySignatureDigests, writeBodyPrBooleanAttrs };