pptx-react-viewer 1.25.3 → 1.25.4

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 (92) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{Model3DScene-IQLE5JLL.mjs → Model3DScene-DZFYJPUH.mjs} +2 -2
  3. package/dist/Model3DScene-DZFYJPUH.mjs.br +0 -0
  4. package/dist/Model3DScene-DZFYJPUH.mjs.gz +0 -0
  5. package/dist/{Model3DScene-F2GUSTZI.js → Model3DScene-SP6WOKSX.js} +3 -3
  6. package/dist/{Model3DScene-F2GUSTZI.js.br → Model3DScene-SP6WOKSX.js.br} +0 -0
  7. package/dist/Model3DScene-SP6WOKSX.js.gz +0 -0
  8. package/dist/{SurfaceChart3DScene-JG26PJ7O.mjs → SurfaceChart3DScene-54BRNPQ5.mjs} +2 -2
  9. package/dist/SurfaceChart3DScene-54BRNPQ5.mjs.br +0 -0
  10. package/dist/SurfaceChart3DScene-54BRNPQ5.mjs.gz +0 -0
  11. package/dist/{SurfaceChart3DScene-4OMD7LWR.js → SurfaceChart3DScene-GISPZ4C2.js} +3 -3
  12. package/dist/SurfaceChart3DScene-GISPZ4C2.js.br +0 -0
  13. package/dist/SurfaceChart3DScene-GISPZ4C2.js.gz +0 -0
  14. package/dist/{chunk-5G3SPYQE.js → chunk-5VYVKFMS.js} +848 -807
  15. package/dist/chunk-5VYVKFMS.js.br +0 -0
  16. package/dist/chunk-5VYVKFMS.js.gz +0 -0
  17. package/dist/{chunk-UXVFNGJH.js → chunk-6F4WVHS3.js} +97 -59
  18. package/dist/chunk-6F4WVHS3.js.br +0 -0
  19. package/dist/chunk-6F4WVHS3.js.gz +0 -0
  20. package/dist/{chunk-ZUJHFLOR.js → chunk-7FE27DDH.js} +464 -464
  21. package/dist/chunk-7FE27DDH.js.br +0 -0
  22. package/dist/chunk-7FE27DDH.js.gz +0 -0
  23. package/dist/{chunk-2V6BD4JQ.js → chunk-FWF2SP6N.js} +631 -141
  24. package/dist/chunk-FWF2SP6N.js.br +0 -0
  25. package/dist/chunk-FWF2SP6N.js.gz +0 -0
  26. package/dist/{chunk-NYBERTS7.mjs → chunk-P72VQ7WE.mjs} +4 -4
  27. package/dist/chunk-P72VQ7WE.mjs.br +0 -0
  28. package/dist/chunk-P72VQ7WE.mjs.gz +0 -0
  29. package/dist/{chunk-GNXWU7UG.mjs → chunk-TPG2WKHQ.mjs} +47 -6
  30. package/dist/chunk-TPG2WKHQ.mjs.br +0 -0
  31. package/dist/chunk-TPG2WKHQ.mjs.gz +0 -0
  32. package/dist/{chunk-DAI4KM5W.mjs → chunk-UYNOPUSG.mjs} +631 -141
  33. package/dist/chunk-UYNOPUSG.mjs.br +0 -0
  34. package/dist/chunk-UYNOPUSG.mjs.gz +0 -0
  35. package/dist/{chunk-DVM75RMN.mjs → chunk-VUC3UPLM.mjs} +64 -26
  36. package/dist/chunk-VUC3UPLM.mjs.br +0 -0
  37. package/dist/chunk-VUC3UPLM.mjs.gz +0 -0
  38. package/dist/{dist-E3IHM3OU.mjs → dist-QNYKM7YS.mjs} +1 -1
  39. package/dist/dist-QNYKM7YS.mjs.br +0 -0
  40. package/dist/dist-QNYKM7YS.mjs.gz +0 -0
  41. package/dist/{dist-ZA77P2O5.js → dist-QU6JIDAF.js} +562 -562
  42. package/dist/dist-QU6JIDAF.js.br +0 -0
  43. package/dist/dist-QU6JIDAF.js.gz +0 -0
  44. package/dist/hooks-unstable.d.ts +107 -1
  45. package/dist/hooks-unstable.js +78 -78
  46. package/dist/hooks-unstable.js.br +0 -0
  47. package/dist/hooks-unstable.js.gz +0 -0
  48. package/dist/hooks-unstable.mjs +3 -3
  49. package/dist/hooks-unstable.mjs.br +0 -0
  50. package/dist/hooks-unstable.mjs.gz +0 -0
  51. package/dist/index.d.ts +107 -1
  52. package/dist/index.js +33 -33
  53. package/dist/index.js.br +0 -0
  54. package/dist/index.js.gz +0 -0
  55. package/dist/index.mjs +4 -4
  56. package/dist/index.mjs.br +0 -0
  57. package/dist/index.mjs.gz +0 -0
  58. package/dist/viewer/index.d.ts +107 -1
  59. package/dist/viewer/index.js +20 -20
  60. package/dist/viewer/index.js.br +0 -0
  61. package/dist/viewer/index.js.gz +0 -0
  62. package/dist/viewer/index.mjs +4 -4
  63. package/dist/viewer/index.mjs.br +0 -0
  64. package/dist/viewer/index.mjs.gz +0 -0
  65. package/package.json +1 -1
  66. package/dist/Model3DScene-F2GUSTZI.js.gz +0 -0
  67. package/dist/Model3DScene-IQLE5JLL.mjs.br +0 -0
  68. package/dist/Model3DScene-IQLE5JLL.mjs.gz +0 -0
  69. package/dist/SurfaceChart3DScene-4OMD7LWR.js.br +0 -0
  70. package/dist/SurfaceChart3DScene-4OMD7LWR.js.gz +0 -0
  71. package/dist/SurfaceChart3DScene-JG26PJ7O.mjs.br +0 -0
  72. package/dist/SurfaceChart3DScene-JG26PJ7O.mjs.gz +0 -0
  73. package/dist/chunk-2V6BD4JQ.js.br +0 -0
  74. package/dist/chunk-2V6BD4JQ.js.gz +0 -0
  75. package/dist/chunk-5G3SPYQE.js.br +0 -0
  76. package/dist/chunk-5G3SPYQE.js.gz +0 -0
  77. package/dist/chunk-DAI4KM5W.mjs.br +0 -0
  78. package/dist/chunk-DAI4KM5W.mjs.gz +0 -0
  79. package/dist/chunk-DVM75RMN.mjs.br +0 -0
  80. package/dist/chunk-DVM75RMN.mjs.gz +0 -0
  81. package/dist/chunk-GNXWU7UG.mjs.br +0 -0
  82. package/dist/chunk-GNXWU7UG.mjs.gz +0 -0
  83. package/dist/chunk-NYBERTS7.mjs.br +0 -0
  84. package/dist/chunk-NYBERTS7.mjs.gz +0 -0
  85. package/dist/chunk-UXVFNGJH.js.br +0 -0
  86. package/dist/chunk-UXVFNGJH.js.gz +0 -0
  87. package/dist/chunk-ZUJHFLOR.js.br +0 -0
  88. package/dist/chunk-ZUJHFLOR.js.gz +0 -0
  89. package/dist/dist-E3IHM3OU.mjs.br +0 -0
  90. package/dist/dist-E3IHM3OU.mjs.gz +0 -0
  91. package/dist/dist-ZA77P2O5.js.br +0 -0
  92. package/dist/dist-ZA77P2O5.js.gz +0 -0
@@ -13597,26 +13597,49 @@ function applyScene3dStyle(shapeProps, style) {
13597
13597
  const camera = scene3dNode["a:camera"];
13598
13598
  const lightRig = scene3dNode["a:lightRig"];
13599
13599
  const cameraRot = camera?.["a:rot"];
13600
+ const lightRigRot = lightRig?.["a:rot"];
13600
13601
  style.scene3d = {
13601
13602
  cameraPreset: String(camera?.["@_prst"] || "").trim() || void 0,
13602
- cameraRotX: cameraRot?.["@_lat"] !== void 0 ? parseInt(String(cameraRot["@_lat"]), 10) : void 0,
13603
- cameraRotY: cameraRot?.["@_lon"] !== void 0 ? parseInt(String(cameraRot["@_lon"]), 10) : void 0,
13604
- cameraRotZ: cameraRot?.["@_rev"] !== void 0 ? parseInt(String(cameraRot["@_rev"]), 10) : void 0,
13603
+ cameraFieldOfView: intAttr(camera?.["@_fov"]),
13604
+ cameraZoom: floatAttr(camera?.["@_zoom"]),
13605
+ cameraRotX: intAttr(cameraRot?.["@_lat"]),
13606
+ cameraRotY: intAttr(cameraRot?.["@_lon"]),
13607
+ cameraRotZ: intAttr(cameraRot?.["@_rev"]),
13605
13608
  lightRigType: String(lightRig?.["@_rig"] || "").trim() || void 0,
13606
- lightRigDirection: String(lightRig?.["@_dir"] || "").trim() || void 0
13609
+ lightRigDirection: String(lightRig?.["@_dir"] || "").trim() || void 0,
13610
+ lightRigRotX: intAttr(lightRigRot?.["@_lat"]),
13611
+ lightRigRotY: intAttr(lightRigRot?.["@_lon"]),
13612
+ lightRigRotZ: intAttr(lightRigRot?.["@_rev"])
13607
13613
  };
13608
13614
  const backdrop = scene3dNode["a:backdrop"];
13609
13615
  if (backdrop) {
13610
13616
  style.scene3d.hasBackdrop = true;
13611
13617
  const anchor = backdrop["a:anchor"];
13612
- const anchorAttrs = anchor;
13613
- if (anchorAttrs) {
13614
- style.scene3d.backdropAnchorX = parseInt(String(anchorAttrs["@_x"] || "0"), 10);
13615
- style.scene3d.backdropAnchorY = parseInt(String(anchorAttrs["@_y"] || "0"), 10);
13616
- style.scene3d.backdropAnchorZ = parseInt(String(anchorAttrs["@_z"] || "0"), 10);
13618
+ if (anchor) {
13619
+ style.scene3d.backdropAnchorX = intAttr(anchor["@_x"]) ?? 0;
13620
+ style.scene3d.backdropAnchorY = intAttr(anchor["@_y"]) ?? 0;
13621
+ style.scene3d.backdropAnchorZ = intAttr(anchor["@_z"]) ?? 0;
13622
+ }
13623
+ const norm = backdrop["a:norm"];
13624
+ if (norm) {
13625
+ style.scene3d.backdropNormalX = intAttr(norm["@_dx"]) ?? 0;
13626
+ style.scene3d.backdropNormalY = intAttr(norm["@_dy"]) ?? 0;
13627
+ style.scene3d.backdropNormalZ = intAttr(norm["@_dz"]) ?? 0;
13628
+ }
13629
+ const up = backdrop["a:up"];
13630
+ if (up) {
13631
+ style.scene3d.backdropUpX = intAttr(up["@_dx"]) ?? 0;
13632
+ style.scene3d.backdropUpY = intAttr(up["@_dy"]) ?? 0;
13633
+ style.scene3d.backdropUpZ = intAttr(up["@_dz"]) ?? 0;
13617
13634
  }
13618
13635
  }
13619
13636
  }
13637
+ function intAttr(value) {
13638
+ return value !== void 0 ? parseInt(String(value), 10) : void 0;
13639
+ }
13640
+ function floatAttr(value) {
13641
+ return value !== void 0 ? parseFloat(String(value)) : void 0;
13642
+ }
13620
13643
  function applyShape3dStyle(shapeProps, style, context) {
13621
13644
  const shape3dNode = shapeProps["a:sp3d"];
13622
13645
  if (!shape3dNode) {
@@ -14486,7 +14509,7 @@ var MEDIA_REFERENCE_NAMES = [
14486
14509
  "videoFile",
14487
14510
  "quickTimeFile"
14488
14511
  ];
14489
- function parseDrawingMediaReference(container) {
14512
+ function parseDrawingMediaReference(container, externalRelIds) {
14490
14513
  if (!container) {
14491
14514
  return void 0;
14492
14515
  }
@@ -14495,11 +14518,17 @@ function parseDrawingMediaReference(container) {
14495
14518
  if (!node) {
14496
14519
  continue;
14497
14520
  }
14521
+ const linkId = String(attribute2(node, "link") ?? "").trim() || void 0;
14522
+ const embedId = String(attribute2(node, "embed") ?? "").trim() || void 0;
14498
14523
  return {
14499
14524
  kind,
14500
14525
  mediaType: kind === "videoFile" || kind === "quickTimeFile" ? "video" : "audio",
14501
- relationshipId: String(attribute2(node, "link") ?? attribute2(node, "embed") ?? "").trim() || void 0,
14502
- isLinked: attribute2(node, "link") !== void 0,
14526
+ relationshipId: linkId ?? embedId,
14527
+ // Embedded media legitimately uses r:link pointing at an INTERNAL
14528
+ // media part, so link presence alone does not imply a linked clip.
14529
+ // It is only truly linked when the referenced relationship is
14530
+ // external (TargetMode="External"), mirroring the OLE parser.
14531
+ isLinked: linkId !== void 0 && externalRelIds?.has(linkId) === true,
14503
14532
  name: kind === "wavAudioFile" ? String(attribute2(node, "name") ?? "") || void 0 : void 0,
14504
14533
  contentType: kind === "audioFile" ? String(attribute2(node, "contentType") ?? "") || void 0 : void 0,
14505
14534
  audioCdStart: kind === "audioCd" ? parseAudioCdPosition(child2(node, "st")) : void 0,
@@ -14628,7 +14657,10 @@ var PptxMediaDataParser = class {
14628
14657
  parseMediaData(graphicData, slidePath) {
14629
14658
  const result = {};
14630
14659
  try {
14631
- const reference = parseDrawingMediaReference(graphicData);
14660
+ const reference = parseDrawingMediaReference(
14661
+ graphicData,
14662
+ this.context.externalRelsMap.get(slidePath)
14663
+ );
14632
14664
  if (reference) {
14633
14665
  result.mediaType = reference.mediaType;
14634
14666
  result.mediaReferenceKind = reference.kind;
@@ -19513,6 +19545,7 @@ var PptxNativeAnimationService = class {
19513
19545
  const nodeType = String(cTn["@_nodeType"] || "");
19514
19546
  const presetClass = cTn["@_presetClass"];
19515
19547
  const presetId = cTn["@_presetID"] ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
19548
+ const presetSubtype = cTn["@_presetSubtype"] !== void 0 ? Number.parseInt(String(cTn["@_presetSubtype"]), 10) : void 0;
19516
19549
  const durationMs = cTn["@_dur"] ? Number.parseInt(String(cTn["@_dur"]), 10) : void 0;
19517
19550
  const delayMs = cTn["@_delay"] ? Number.parseInt(String(cTn["@_delay"]), 10) : void 0;
19518
19551
  let trigger = currentTrigger;
@@ -19564,6 +19597,7 @@ var PptxNativeAnimationService = class {
19564
19597
  trigger,
19565
19598
  presetClass: validPresetClass,
19566
19599
  presetId,
19600
+ presetSubtype,
19567
19601
  durationMs,
19568
19602
  delayMs,
19569
19603
  triggerDelayMs: trigger === "afterDelay" ? delayMs : void 0,
@@ -19871,6 +19905,72 @@ function buildP14ExtLst(transitionType, direction, orient, pattern, rawExtLst, x
19871
19905
  }
19872
19906
  return { "p:ext": transitionExt };
19873
19907
  }
19908
+ var P15_TRANSITION_PRESETS = /* @__PURE__ */ new Set([
19909
+ "fallOver",
19910
+ "drape",
19911
+ "curtains",
19912
+ "wind",
19913
+ "prestige",
19914
+ "fracture",
19915
+ "crush",
19916
+ "peelOff",
19917
+ "pageCurlDouble",
19918
+ "pageCurlSingle",
19919
+ "airplane",
19920
+ "origami"
19921
+ ]);
19922
+ var PRSTTRANS_EXT_URI = "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}";
19923
+ function optionalBoolean(value) {
19924
+ const valueToken = value === void 0 || value === null ? "" : String(value).trim().toLowerCase();
19925
+ if (valueToken === "1" || valueToken === "true") {
19926
+ return true;
19927
+ }
19928
+ if (valueToken === "0" || valueToken === "false") {
19929
+ return false;
19930
+ }
19931
+ return void 0;
19932
+ }
19933
+ function parseP15FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
19934
+ const extEntries = xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
19935
+ for (const ext of extEntries) {
19936
+ if (!ext) {
19937
+ continue;
19938
+ }
19939
+ for (const [key, value] of Object.entries(ext)) {
19940
+ if (key.startsWith("@_")) {
19941
+ continue;
19942
+ }
19943
+ if (getXmlLocalName(key) !== "prstTrans") {
19944
+ continue;
19945
+ }
19946
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
19947
+ continue;
19948
+ }
19949
+ const detail = value;
19950
+ const prst = String(detail["@_prst"] || "").trim();
19951
+ if (!P15_TRANSITION_PRESETS.has(prst)) {
19952
+ continue;
19953
+ }
19954
+ return {
19955
+ type: prst,
19956
+ invX: optionalBoolean(detail["@_invX"]),
19957
+ invY: optionalBoolean(detail["@_invY"])
19958
+ };
19959
+ }
19960
+ }
19961
+ return void 0;
19962
+ }
19963
+ function buildP15ExtLst(transitionType, invX, invY) {
19964
+ const prstTrans = {
19965
+ "@_xmlns:p15": "http://schemas.microsoft.com/office/powerpoint/2012/main",
19966
+ "@_prst": transitionType
19967
+ };
19968
+ const ext = {
19969
+ "@_uri": PRSTTRANS_EXT_URI,
19970
+ "p15:prstTrans": prstTrans
19971
+ };
19972
+ return { "p:ext": ext };
19973
+ }
19874
19974
  var STANDARD_TRANSITION_TYPES = /* @__PURE__ */ new Set([
19875
19975
  "fade",
19876
19976
  "push",
@@ -19935,7 +20035,7 @@ function parseTransitionDetails(node, localName22) {
19935
20035
  if (pattern) {
19936
20036
  result.pattern = pattern;
19937
20037
  }
19938
- const thruBlk = optionalBoolean(detail["@_thruBlk"]);
20038
+ const thruBlk = optionalBoolean2(detail["@_thruBlk"]);
19939
20039
  if (thruBlk !== void 0) {
19940
20040
  result.thruBlk = thruBlk;
19941
20041
  }
@@ -19946,7 +20046,7 @@ function parseTransitionAttributes(node) {
19946
20046
  const speedToken = token(node["@_spd"]);
19947
20047
  const speed = SPEEDS.has(speedToken) ? speedToken : void 0;
19948
20048
  const durationMs = unsignedInteger2(node["@_dur"] ?? node["@_p14:dur"], 1);
19949
- const advanceOnClick = optionalBoolean(node["@_advClick"]);
20049
+ const advanceOnClick = optionalBoolean2(node["@_advClick"]);
19950
20050
  const advanceAfterMs = unsignedInteger2(node["@_advTm"]);
19951
20051
  return { speed, durationMs, advanceOnClick, advanceAfterMs };
19952
20052
  }
@@ -19960,7 +20060,7 @@ function parseTransitionSound(raw, lookup, localName22) {
19960
20060
  return {
19961
20061
  soundRId: sound ? attributeByLocalName(sound, "embed", localName22) : void 0,
19962
20062
  soundName: sound ? attributeByLocalName(sound, "name", localName22) : void 0,
19963
- soundLoop: optionalBoolean(start["@_loop"])
20063
+ soundLoop: optionalBoolean2(start["@_loop"])
19964
20064
  };
19965
20065
  }
19966
20066
  const stopSound = Object.keys(raw).some(
@@ -20069,7 +20169,7 @@ function attributeByLocalName(node, name, localName22) {
20069
20169
  function token(value) {
20070
20170
  return value === void 0 || value === null ? "" : String(value).trim();
20071
20171
  }
20072
- function optionalBoolean(value) {
20172
+ function optionalBoolean2(value) {
20073
20173
  const valueToken = token(value).toLowerCase();
20074
20174
  if (!valueToken) {
20075
20175
  return void 0;
@@ -20113,6 +20213,7 @@ var PptxSlideTransitionService = class {
20113
20213
  const { spokes, thruBlk, rawSoundAction, rawExtLst } = details;
20114
20214
  if (rawExtLst && transitionType === "cut") {
20115
20215
  const p14Result = parseP14FromExtLst(rawExtLst, this.xmlLookupService, this.getXmlLocalName);
20216
+ const p15Result = p14Result ? void 0 : parseP15FromExtLst(rawExtLst, this.xmlLookupService, this.getXmlLocalName);
20116
20217
  if (p14Result) {
20117
20218
  transitionType = p14Result.type;
20118
20219
  if (p14Result.direction) {
@@ -20124,6 +20225,8 @@ var PptxSlideTransitionService = class {
20124
20225
  if (p14Result.pattern) {
20125
20226
  pattern = p14Result.pattern;
20126
20227
  }
20228
+ } else if (p15Result) {
20229
+ transitionType = p15Result.type;
20127
20230
  } else if (this.parseMorphFromExtLst(rawExtLst)) {
20128
20231
  transitionType = "morph";
20129
20232
  }
@@ -20205,6 +20308,7 @@ var PptxSlideTransitionService = class {
20205
20308
  }
20206
20309
  const transitionType = transition.type || "cut";
20207
20310
  const isP14Type = P14_TRANSITION_TYPES.has(transitionType);
20311
+ const isP15Type = P15_TRANSITION_PRESETS.has(transitionType);
20208
20312
  const isMorphType = transitionType === "morph";
20209
20313
  const node = createPreservedTransitionNode(transition.rawTransition, this.getXmlLocalName);
20210
20314
  if (isP14Type) {
@@ -20217,6 +20321,8 @@ var PptxSlideTransitionService = class {
20217
20321
  this.xmlLookupService,
20218
20322
  this.getXmlLocalName
20219
20323
  );
20324
+ } else if (isP15Type) {
20325
+ node["p:extLst"] = transition.rawExtLst ?? buildP15ExtLst(transitionType);
20220
20326
  } else if (isMorphType) {
20221
20327
  node["p:extLst"] = this.buildMorphExtLst(transition.rawExtLst);
20222
20328
  } else {
@@ -20227,7 +20333,7 @@ var PptxSlideTransitionService = class {
20227
20333
  if (soundAction) {
20228
20334
  node["p:sndAc"] = soundAction;
20229
20335
  }
20230
- if (transition.rawExtLst && !isP14Type && !isMorphType) {
20336
+ if (transition.rawExtLst && !isP14Type && !isP15Type && !isMorphType) {
20231
20337
  node["p:extLst"] = transition.rawExtLst;
20232
20338
  }
20233
20339
  return node;
@@ -36065,35 +36171,197 @@ async function fetchUrlToBytes(url, options = {}) {
36065
36171
  return null;
36066
36172
  }
36067
36173
  }
36174
+ function resolveChannelOrder(root) {
36175
+ const traceFormat = findFirstByLocalName(root, "traceFormat");
36176
+ if (!traceFormat) {
36177
+ return ["X", "Y"];
36178
+ }
36179
+ const channels = ensureArray5(nsGet(traceFormat, "channel"));
36180
+ const names = channels.map(
36181
+ (channel) => String(nsAttr(channel, "name") ?? "").trim().toUpperCase()
36182
+ ).filter((name) => name.length > 0);
36183
+ return names.length > 0 ? names : ["X", "Y"];
36184
+ }
36185
+ function decodeTracePoints(text2, channelOrder) {
36186
+ const points3 = [];
36187
+ const modes = channelOrder.map(() => "explicit");
36188
+ const lastValue = channelOrder.map(() => 0);
36189
+ const lastVelocity = channelOrder.map(() => 0);
36190
+ for (const rawPoint of text2.split(",")) {
36191
+ const tokens = rawPoint.trim().split(/\s+/u).filter((token2) => token2.length > 0);
36192
+ if (tokens.length === 0) {
36193
+ continue;
36194
+ }
36195
+ const decoded = [];
36196
+ for (let i = 0; i < tokens.length && i < channelOrder.length; i++) {
36197
+ const parsed = parseValueToken(tokens[i], modes[i]);
36198
+ if (parsed === void 0) {
36199
+ decoded.push(lastValue[i]);
36200
+ continue;
36201
+ }
36202
+ modes[i] = parsed.mode;
36203
+ const value = applyDiffMode(parsed, i, lastValue, lastVelocity);
36204
+ decoded.push(value);
36205
+ }
36206
+ if (decoded.length >= 2) {
36207
+ points3.push(decoded);
36208
+ }
36209
+ }
36210
+ return points3;
36211
+ }
36212
+ function parseValueToken(token2, currentMode) {
36213
+ let mode = currentMode;
36214
+ let body = token2;
36215
+ const prefix = token2[0];
36216
+ if (prefix === "!") {
36217
+ mode = "explicit";
36218
+ body = token2.slice(1);
36219
+ } else if (prefix === "'") {
36220
+ mode = "single";
36221
+ body = token2.slice(1);
36222
+ } else if (prefix === '"') {
36223
+ mode = "double";
36224
+ body = token2.slice(1);
36225
+ }
36226
+ if (body.length === 0) {
36227
+ return void 0;
36228
+ }
36229
+ const value = Number(body);
36230
+ return Number.isFinite(value) ? { value, mode } : void 0;
36231
+ }
36232
+ function applyDiffMode(parsed, index, lastValue, lastVelocity) {
36233
+ if (parsed.mode === "single") {
36234
+ lastVelocity[index] = parsed.value;
36235
+ lastValue[index] += parsed.value;
36236
+ } else if (parsed.mode === "double") {
36237
+ lastVelocity[index] += parsed.value;
36238
+ lastValue[index] += lastVelocity[index];
36239
+ } else {
36240
+ lastValue[index] = parsed.value;
36241
+ lastVelocity[index] = 0;
36242
+ }
36243
+ return lastValue[index];
36244
+ }
36245
+ function pointsToSvgPath(points3, channelOrder) {
36246
+ const xi = channelOrder.indexOf("X");
36247
+ const yi = channelOrder.indexOf("Y");
36248
+ const xIndex = xi >= 0 ? xi : 0;
36249
+ const yIndex = yi >= 0 ? yi : 1;
36250
+ const segments = [];
36251
+ for (const point of points3) {
36252
+ const x = point[xIndex];
36253
+ const y = point[yIndex];
36254
+ if (!Number.isFinite(x) || !Number.isFinite(y)) {
36255
+ continue;
36256
+ }
36257
+ segments.push(`${segments.length === 0 ? "M" : "L"} ${x} ${y}`);
36258
+ }
36259
+ return segments.join(" ");
36260
+ }
36261
+ function pointsToPressures(points3, channelOrder) {
36262
+ const fIndex = channelOrder.indexOf("F");
36263
+ if (fIndex < 0) {
36264
+ return [];
36265
+ }
36266
+ const pressures = [];
36267
+ for (const point of points3) {
36268
+ const raw = point[fIndex];
36269
+ if (Number.isFinite(raw)) {
36270
+ const normalised = raw > 1 ? raw / 32767 : raw;
36271
+ pressures.push(Math.max(0, Math.min(1, normalised)));
36272
+ }
36273
+ }
36274
+ return pressures;
36275
+ }
36276
+ function nsGet(obj, localName22) {
36277
+ if (localName22 in obj) {
36278
+ return obj[localName22];
36279
+ }
36280
+ for (const key of Object.keys(obj)) {
36281
+ if (localNameOf(key) === localName22 && !key.startsWith("@_")) {
36282
+ return obj[key];
36283
+ }
36284
+ }
36285
+ return void 0;
36286
+ }
36287
+ function nsAttr(obj, localName22) {
36288
+ const direct = obj[`@_${localName22}`];
36289
+ if (direct !== void 0) {
36290
+ return direct;
36291
+ }
36292
+ for (const key of Object.keys(obj)) {
36293
+ if (key.startsWith("@_") && localNameOf(key.slice(2)) === localName22) {
36294
+ return obj[key];
36295
+ }
36296
+ }
36297
+ return void 0;
36298
+ }
36299
+ function localNameOf(key) {
36300
+ const colon = key.indexOf(":");
36301
+ return colon >= 0 ? key.slice(colon + 1) : key;
36302
+ }
36303
+ function findFirstByLocalName(node, localName22) {
36304
+ const direct = nsGet(node, localName22);
36305
+ if (direct && typeof direct === "object") {
36306
+ return Array.isArray(direct) ? direct[0] : direct;
36307
+ }
36308
+ for (const key of Object.keys(node)) {
36309
+ if (key.startsWith("@_") || key === "#text") {
36310
+ continue;
36311
+ }
36312
+ for (const child20 of ensureArray5(node[key])) {
36313
+ if (typeof child20 !== "object") {
36314
+ continue;
36315
+ }
36316
+ const found = findFirstByLocalName(child20, localName22);
36317
+ if (found) {
36318
+ return found;
36319
+ }
36320
+ }
36321
+ }
36322
+ return void 0;
36323
+ }
36324
+ function ensureArray5(value) {
36325
+ if (value === void 0 || value === null) {
36326
+ return [];
36327
+ }
36328
+ return Array.isArray(value) ? value : [value];
36329
+ }
36068
36330
  var INKML_NAMESPACE = "http://www.w3.org/2003/InkML";
36069
36331
  var METADATA_NAMESPACE = "https://pptx-viewer.dev/inkml/metadata";
36070
36332
  function parseInkMlContent(data) {
36071
- const root = data["ink:ink"] ?? data["ink"];
36333
+ const root = nsGet(data, "ink") ?? data["ink"];
36072
36334
  if (!root) {
36073
36335
  return { strokes: [], rawXml: data };
36074
36336
  }
36075
36337
  const brushes = /* @__PURE__ */ new Map();
36076
- for (const brush of ensureArray5(root["ink:brush"] ?? root["brush"])) {
36077
- const properties = ensureArray5(brush["ink:brushProperty"] ?? brush["brushProperty"]);
36338
+ for (const brush of ensureArray5(nsGet(root, "brush"))) {
36339
+ const properties = ensureArray5(nsGet(brush, "brushProperty"));
36078
36340
  const valueByName = new Map(
36079
- properties.map((property) => [String(property["@_name"] ?? ""), property["@_value"]])
36341
+ properties.map((property) => [
36342
+ String(nsAttr(property, "name") ?? ""),
36343
+ nsAttr(property, "value")
36344
+ ])
36080
36345
  );
36081
- brushes.set(String(brush["@_id"] ?? ""), {
36346
+ brushes.set(String(nsAttr(brush, "id") ?? ""), {
36082
36347
  color: String(valueByName.get("color") ?? "#000000"),
36083
36348
  width: finiteNumber(valueByName.get("width"), 1),
36084
36349
  opacity: finiteNumber(valueByName.get("opacity"), 1)
36085
36350
  });
36086
36351
  }
36352
+ const channelOrder = resolveChannelOrder(root);
36087
36353
  const strokes = [];
36088
- for (const trace of ensureArray5(root["ink:trace"] ?? root["trace"])) {
36354
+ for (const trace of ensureArray5(nsGet(root, "trace"))) {
36089
36355
  const text2 = typeof trace === "string" ? trace : String(trace["#text"] ?? "").trim();
36090
- const path = typeof trace === "string" ? text2 : String(trace["@_pva:path"] ?? "").trim() || text2;
36356
+ const authored = typeof trace === "string" ? "" : String(nsAttr(trace, "path") ?? "").trim();
36357
+ const points3 = authored ? [] : decodeTracePoints(text2, channelOrder);
36358
+ const path = authored || pointsToSvgPath(points3, channelOrder);
36091
36359
  if (!path) {
36092
36360
  continue;
36093
36361
  }
36094
- const brushRef = typeof trace === "string" ? "" : String(trace["@_brushRef"] ?? "").replace("#", "");
36362
+ const brushRef = typeof trace === "string" ? "" : String(nsAttr(trace, "brushRef") ?? "").replace("#", "");
36095
36363
  const brush = brushes.get(brushRef) ?? { color: "#000000", width: 1, opacity: 1 };
36096
- const pressures = tracePressures(text2);
36364
+ const pressures = authored ? tracePressures(text2) : pointsToPressures(points3, channelOrder);
36097
36365
  strokes.push({ ...brush, path, ...pressures.length > 0 ? { pressures } : {} });
36098
36366
  }
36099
36367
  return { strokes, rawXml: data };
@@ -36152,12 +36420,6 @@ function finiteNumber(value, fallback) {
36152
36420
  const parsed = Number(value);
36153
36421
  return Number.isFinite(parsed) ? parsed : fallback;
36154
36422
  }
36155
- function ensureArray5(value) {
36156
- if (value === void 0 || value === null) {
36157
- return [];
36158
- }
36159
- return Array.isArray(value) ? value : [value];
36160
- }
36161
36423
  var DEFAULT_ACCENT_COLORS = [
36162
36424
  "#4472C4",
36163
36425
  "#ED7D31",
@@ -53356,6 +53618,91 @@ var PptxHandlerRuntime = class {
53356
53618
  }
53357
53619
  }
53358
53620
  };
53621
+ var EMU_PER_PIXEL = 9525;
53622
+ var BORDER_SIDES = [
53623
+ "left",
53624
+ "right",
53625
+ "top",
53626
+ "bottom",
53627
+ "insideH",
53628
+ "insideV",
53629
+ "tl2br",
53630
+ "bl2tr"
53631
+ ];
53632
+ function parseSolidFillStyle(solidFill2) {
53633
+ if (!solidFill2) {
53634
+ return void 0;
53635
+ }
53636
+ const schemeClr = solidFill2["a:schemeClr"];
53637
+ if (!schemeClr) {
53638
+ return void 0;
53639
+ }
53640
+ const schemeColor = String(schemeClr["@_val"] || "").trim() || void 0;
53641
+ if (!schemeColor) {
53642
+ return void 0;
53643
+ }
53644
+ const tintRaw = schemeClr["a:tint"];
53645
+ const tint = tintRaw ? parseInt(String(tintRaw["@_val"] || "0"), 10) || void 0 : void 0;
53646
+ const shadeRaw = schemeClr["a:shade"];
53647
+ const shade = shadeRaw ? parseInt(String(shadeRaw["@_val"] || "0"), 10) || void 0 : void 0;
53648
+ return { schemeColor, tint, shade };
53649
+ }
53650
+ function parseBorderSide(side) {
53651
+ if (!side) {
53652
+ return void 0;
53653
+ }
53654
+ const ln = side["a:ln"];
53655
+ if (!ln) {
53656
+ return void 0;
53657
+ }
53658
+ const border = {};
53659
+ let has = false;
53660
+ if (ln["a:noFill"] !== void 0) {
53661
+ border.noFill = true;
53662
+ has = true;
53663
+ }
53664
+ const widthEmu = parseInt(String(ln["@_w"] || "0"), 10);
53665
+ if (widthEmu > 0) {
53666
+ border.width = Math.max(1, Math.round(widthEmu / EMU_PER_PIXEL));
53667
+ has = true;
53668
+ }
53669
+ const prstDash = ln["a:prstDash"];
53670
+ const dashVal = prstDash ? String(prstDash["@_val"] || "").trim() : "";
53671
+ if (dashVal) {
53672
+ border.dash = dashVal;
53673
+ has = true;
53674
+ }
53675
+ const solidFill2 = ln["a:solidFill"];
53676
+ const fill = parseSolidFillStyle(solidFill2);
53677
+ if (fill) {
53678
+ border.fill = fill;
53679
+ has = true;
53680
+ } else {
53681
+ const srgb = solidFill2?.["a:srgbClr"];
53682
+ const hex10 = srgb ? String(srgb["@_val"] || "").trim() : "";
53683
+ if (hex10) {
53684
+ border.color = hex10.startsWith("#") ? hex10 : `#${hex10}`;
53685
+ has = true;
53686
+ }
53687
+ }
53688
+ return has ? border : void 0;
53689
+ }
53690
+ function parseTableStyleBorders(tcStyle) {
53691
+ const tcBdr = tcStyle?.["a:tcBdr"];
53692
+ if (!tcBdr) {
53693
+ return void 0;
53694
+ }
53695
+ const result = {};
53696
+ let has = false;
53697
+ for (const name of BORDER_SIDES) {
53698
+ const border = parseBorderSide(tcBdr[`a:${name}`]);
53699
+ if (border) {
53700
+ result[name] = border;
53701
+ has = true;
53702
+ }
53703
+ }
53704
+ return has ? result : void 0;
53705
+ }
53359
53706
  var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
53360
53707
  /**
53361
53708
  * Export slides to a raster/vector format.
@@ -53439,30 +53786,15 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
53439
53786
  return void 0;
53440
53787
  }
53441
53788
  const tcStyle = section["a:tcStyle"];
53442
- if (!tcStyle) {
53443
- return void 0;
53444
- }
53445
- const fill = tcStyle["a:fill"];
53446
- if (!fill) {
53447
- return void 0;
53448
- }
53449
- const solidFill2 = fill["a:solidFill"];
53450
- if (!solidFill2) {
53451
- return void 0;
53452
- }
53453
- const schemeClr = solidFill2["a:schemeClr"];
53454
- if (!schemeClr) {
53455
- return void 0;
53456
- }
53457
- const schemeColor = String(schemeClr["@_val"] || "").trim() || void 0;
53458
- if (!schemeColor) {
53459
- return void 0;
53460
- }
53461
- const tintRaw = schemeClr["a:tint"];
53462
- const tint = tintRaw ? parseInt(String(tintRaw["@_val"] || "0"), 10) || void 0 : void 0;
53463
- const shadeRaw = schemeClr["a:shade"];
53464
- const shade = shadeRaw ? parseInt(String(shadeRaw["@_val"] || "0"), 10) || void 0 : void 0;
53465
- return { schemeColor, tint, shade };
53789
+ const fill = tcStyle?.["a:fill"];
53790
+ return parseSolidFillStyle(fill?.["a:solidFill"]);
53791
+ }
53792
+ /**
53793
+ * Extract border styling from a table style section's
53794
+ * `a:tcStyle/a:tcBdr` (per-side line width, dash, and colour).
53795
+ */
53796
+ extractTableStyleSectionBorders(section) {
53797
+ return parseTableStyleBorders(section?.["a:tcStyle"]);
53466
53798
  }
53467
53799
  /**
53468
53800
  * Extract text properties from a:tcTxStyle in a table style section.
@@ -53609,6 +53941,15 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
53609
53941
  textProps[`${name}Text`] = text2;
53610
53942
  }
53611
53943
  }
53944
+ const borderProps = {};
53945
+ for (const name of sectionNames) {
53946
+ const borders = this.extractTableStyleSectionBorders(
53947
+ style[`a:${name}`]
53948
+ );
53949
+ if (borders) {
53950
+ borderProps[`${name}Borders`] = borders;
53951
+ }
53952
+ }
53612
53953
  const entry = {
53613
53954
  styleId,
53614
53955
  styleName,
@@ -53627,7 +53968,8 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
53627
53968
  ...swCellFill ? { swCellFill } : {},
53628
53969
  ...neCellFill ? { neCellFill } : {},
53629
53970
  ...nwCellFill ? { nwCellFill } : {},
53630
- ...textProps
53971
+ ...textProps,
53972
+ ...borderProps
53631
53973
  };
53632
53974
  map[styleId] = entry;
53633
53975
  }
@@ -55420,6 +55762,15 @@ var PptxHandlerRuntime11 = class extends PptxHandlerRuntime10 {
55420
55762
  if (align === "justify") {
55421
55763
  return "just";
55422
55764
  }
55765
+ if (align === "justLow") {
55766
+ return "justLow";
55767
+ }
55768
+ if (align === "dist") {
55769
+ return "dist";
55770
+ }
55771
+ if (align === "thaiDist") {
55772
+ return "thaiDist";
55773
+ }
55423
55774
  return void 0;
55424
55775
  }
55425
55776
  pixelsToPoints(px2) {
@@ -56464,6 +56815,16 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime3 extends PptxHandlerRuntime
56464
56815
  const chOffY = 0;
56465
56816
  const chExtCx = extCx;
56466
56817
  const chExtCy = extCy;
56818
+ const xfrmAttrs = {};
56819
+ if (typeof group.rotation === "number" && group.rotation !== 0) {
56820
+ xfrmAttrs["@_rot"] = String(Math.round(group.rotation * 6e4));
56821
+ }
56822
+ if (group.flipHorizontal) {
56823
+ xfrmAttrs["@_flipH"] = "1";
56824
+ }
56825
+ if (group.flipVertical) {
56826
+ xfrmAttrs["@_flipV"] = "1";
56827
+ }
56467
56828
  const grpXml = {
56468
56829
  "p:nvGrpSpPr": {
56469
56830
  "p:cNvPr": { "@_id": "0", "@_name": group.id },
@@ -56472,6 +56833,7 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime3 extends PptxHandlerRuntime
56472
56833
  },
56473
56834
  "p:grpSpPr": {
56474
56835
  "a:xfrm": {
56836
+ ...xfrmAttrs,
56475
56837
  "a:off": {
56476
56838
  "@_x": String(offX),
56477
56839
  "@_y": String(offY)
@@ -62596,45 +62958,18 @@ var PptxHandlerRuntime29 = class extends PptxHandlerRuntime28 {
62596
62958
  const s3d = shapeStyle.scene3d;
62597
62959
  const hasData = s3d.cameraPreset || s3d.lightRigType;
62598
62960
  if (hasData) {
62599
- const cameraObj = {};
62600
- if (s3d.cameraPreset) {
62601
- cameraObj["@_prst"] = s3d.cameraPreset;
62602
- }
62603
- if (s3d.cameraRotX !== void 0 || s3d.cameraRotY !== void 0 || s3d.cameraRotZ !== void 0) {
62604
- const rot = {};
62605
- if (s3d.cameraRotX !== void 0) {
62606
- rot["@_lat"] = String(s3d.cameraRotX);
62607
- }
62608
- if (s3d.cameraRotY !== void 0) {
62609
- rot["@_lon"] = String(s3d.cameraRotY);
62610
- }
62611
- if (s3d.cameraRotZ !== void 0) {
62612
- rot["@_rev"] = String(s3d.cameraRotZ);
62613
- }
62614
- cameraObj["a:rot"] = rot;
62615
- }
62616
- const lightRigObj = {};
62617
- if (s3d.lightRigType) {
62618
- lightRigObj["@_rig"] = s3d.lightRigType;
62619
- }
62620
- if (s3d.lightRigDirection) {
62621
- lightRigObj["@_dir"] = s3d.lightRigDirection;
62622
- }
62623
- const scene3dXml = {};
62624
- scene3dXml["a:camera"] = cameraObj;
62625
- if (Object.keys(lightRigObj).length > 0) {
62626
- scene3dXml["a:lightRig"] = lightRigObj;
62627
- }
62628
- if (s3d.hasBackdrop) {
62629
- const backdropObj = {};
62630
- if (s3d.backdropAnchorX !== void 0 || s3d.backdropAnchorY !== void 0 || s3d.backdropAnchorZ !== void 0) {
62631
- backdropObj["a:anchor"] = {
62632
- "@_x": String(s3d.backdropAnchorX ?? 0),
62633
- "@_y": String(s3d.backdropAnchorY ?? 0),
62634
- "@_z": String(s3d.backdropAnchorZ ?? 0)
62635
- };
62636
- }
62637
- scene3dXml["a:backdrop"] = backdropObj;
62961
+ const source = spPr["a:scene3d"] ?? {};
62962
+ const scene3dXml = { ...source };
62963
+ scene3dXml["a:camera"] = buildScene3dCamera(s3d, source);
62964
+ const lightRig = buildScene3dLightRig(s3d, source);
62965
+ if (lightRig) {
62966
+ scene3dXml["a:lightRig"] = lightRig;
62967
+ }
62968
+ const backdrop = buildScene3dBackdrop(s3d);
62969
+ if (backdrop) {
62970
+ scene3dXml["a:backdrop"] = backdrop;
62971
+ } else {
62972
+ delete scene3dXml["a:backdrop"];
62638
62973
  }
62639
62974
  spPr["a:scene3d"] = scene3dXml;
62640
62975
  } else {
@@ -62679,12 +63014,12 @@ var PptxHandlerRuntime29 = class extends PptxHandlerRuntime28 {
62679
63014
  }
62680
63015
  if (sh3d.extrusionColor) {
62681
63016
  sp3dXml["a:extrusionClr"] = {
62682
- "a:srgbClr": { "@_val": sh3d.extrusionColor }
63017
+ "a:srgbClr": { "@_val": sh3d.extrusionColor.replace("#", "") }
62683
63018
  };
62684
63019
  }
62685
63020
  if (sh3d.contourColor) {
62686
63021
  sp3dXml["a:contourClr"] = {
62687
- "a:srgbClr": { "@_val": sh3d.contourColor }
63022
+ "a:srgbClr": { "@_val": sh3d.contourColor.replace("#", "") }
62688
63023
  };
62689
63024
  }
62690
63025
  spPr["a:sp3d"] = sp3dXml;
@@ -62696,6 +63031,77 @@ var PptxHandlerRuntime29 = class extends PptxHandlerRuntime28 {
62696
63031
  }
62697
63032
  }
62698
63033
  };
63034
+ function buildSphereRot(lat, lon, rev) {
63035
+ if (lat === void 0 && lon === void 0 && rev === void 0) {
63036
+ return void 0;
63037
+ }
63038
+ const rot = {};
63039
+ if (lat !== void 0) {
63040
+ rot["@_lat"] = String(lat);
63041
+ }
63042
+ if (lon !== void 0) {
63043
+ rot["@_lon"] = String(lon);
63044
+ }
63045
+ if (rev !== void 0) {
63046
+ rot["@_rev"] = String(rev);
63047
+ }
63048
+ return rot;
63049
+ }
63050
+ function buildScene3dCamera(s3d, source) {
63051
+ const camera = { ...source["a:camera"] ?? {} };
63052
+ if (s3d.cameraPreset) {
63053
+ camera["@_prst"] = s3d.cameraPreset;
63054
+ }
63055
+ if (s3d.cameraFieldOfView !== void 0) {
63056
+ camera["@_fov"] = String(s3d.cameraFieldOfView);
63057
+ }
63058
+ if (s3d.cameraZoom !== void 0) {
63059
+ camera["@_zoom"] = String(s3d.cameraZoom);
63060
+ }
63061
+ const rot = buildSphereRot(s3d.cameraRotX, s3d.cameraRotY, s3d.cameraRotZ);
63062
+ if (rot) {
63063
+ camera["a:rot"] = rot;
63064
+ }
63065
+ return camera;
63066
+ }
63067
+ function buildScene3dLightRig(s3d, source) {
63068
+ const lightRig = { ...source["a:lightRig"] ?? {} };
63069
+ if (s3d.lightRigType) {
63070
+ lightRig["@_rig"] = s3d.lightRigType;
63071
+ }
63072
+ if (s3d.lightRigDirection) {
63073
+ lightRig["@_dir"] = s3d.lightRigDirection;
63074
+ }
63075
+ const rot = buildSphereRot(s3d.lightRigRotX, s3d.lightRigRotY, s3d.lightRigRotZ);
63076
+ if (rot) {
63077
+ lightRig["a:rot"] = rot;
63078
+ }
63079
+ return Object.keys(lightRig).length > 0 ? lightRig : void 0;
63080
+ }
63081
+ function buildScene3dBackdrop(s3d) {
63082
+ const hasNorm = s3d.backdropNormalX !== void 0 || s3d.backdropNormalY !== void 0 || s3d.backdropNormalZ !== void 0;
63083
+ const hasUp = s3d.backdropUpX !== void 0 || s3d.backdropUpY !== void 0 || s3d.backdropUpZ !== void 0;
63084
+ if (!s3d.hasBackdrop || !hasNorm || !hasUp) {
63085
+ return void 0;
63086
+ }
63087
+ return {
63088
+ "a:anchor": {
63089
+ "@_x": String(s3d.backdropAnchorX ?? 0),
63090
+ "@_y": String(s3d.backdropAnchorY ?? 0),
63091
+ "@_z": String(s3d.backdropAnchorZ ?? 0)
63092
+ },
63093
+ "a:norm": {
63094
+ "@_dx": String(s3d.backdropNormalX ?? 0),
63095
+ "@_dy": String(s3d.backdropNormalY ?? 0),
63096
+ "@_dz": String(s3d.backdropNormalZ ?? 0)
63097
+ },
63098
+ "a:up": {
63099
+ "@_dx": String(s3d.backdropUpX ?? 0),
63100
+ "@_dy": String(s3d.backdropUpY ?? 0),
63101
+ "@_dz": String(s3d.backdropUpZ ?? 0)
63102
+ }
63103
+ };
63104
+ }
62699
63105
  var PptxHandlerRuntime30 = class _PptxHandlerRuntime9 extends PptxHandlerRuntime29 {
62700
63106
  /**
62701
63107
  * Build and write the text body (`p:txBody`) for shapes, text boxes,
@@ -69051,7 +69457,7 @@ var PptxHandlerRuntime65 = class _PptxHandlerRuntime28 extends PptxHandlerRuntim
69051
69457
  const skewY = xfrm["@_skewY"] ? parseEmuInt(xfrm["@_skewY"]) / 6e4 : void 0;
69052
69458
  const { flipHorizontal, flipVertical } = this.readFlipState(xfrm);
69053
69459
  const nvPr = pic?.["p:nvPicPr"]?.["p:nvPr"];
69054
- const mediaReference = parseDrawingMediaReference(nvPr);
69460
+ const mediaReference = parseDrawingMediaReference(nvPr, this.externalRelsMap.get(slidePath));
69055
69461
  if (mediaReference) {
69056
69462
  this.compatibilityService.inspectMediaReferenceCompatibility(
69057
69463
  mediaReference.kind,
@@ -69815,6 +70221,9 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
69815
70221
  const grpSpPr = group["p:grpSpPr"];
69816
70222
  const xfrm = grpSpPr?.["a:xfrm"];
69817
70223
  let parentX = 0, parentY = 0, parentW = 0, parentH = 0;
70224
+ let groupRotation;
70225
+ let flipHorizontal = false;
70226
+ let flipVertical = false;
69818
70227
  if (xfrm) {
69819
70228
  const off = xfrm["a:off"];
69820
70229
  if (off) {
@@ -69826,6 +70235,12 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
69826
70235
  parentW = Math.round(parseEmuInt2(ext["@_cx"]) / _PptxHandlerRuntime30.EMU_PER_PX);
69827
70236
  parentH = Math.round(parseEmuInt2(ext["@_cy"]) / _PptxHandlerRuntime30.EMU_PER_PX);
69828
70237
  }
70238
+ if (xfrm["@_rot"] !== void 0 && xfrm["@_rot"] !== null) {
70239
+ const rot = parseInt(String(xfrm["@_rot"]), 10) / 6e4;
70240
+ groupRotation = Number.isFinite(rot) && rot !== 0 ? rot : void 0;
70241
+ }
70242
+ flipHorizontal = this.parseBooleanAttr(xfrm["@_flipH"]);
70243
+ flipVertical = this.parseBooleanAttr(xfrm["@_flipV"]);
69829
70244
  }
69830
70245
  const grpFillStyle = grpSpPr ? this.extractShapeStyle(grpSpPr) : void 0;
69831
70246
  const hasGroupFill = grpFillStyle && grpFillStyle.fillMode && grpFillStyle.fillMode !== "none";
@@ -69871,6 +70286,9 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
69871
70286
  y: parentY,
69872
70287
  width: parentW || Math.max(...children10.map((c) => c.x + c.width)),
69873
70288
  height: parentH || Math.max(...children10.map((c) => c.y + c.height)),
70289
+ rotation: groupRotation,
70290
+ flipHorizontal: flipHorizontal || void 0,
70291
+ flipVertical: flipVertical || void 0,
69874
70292
  children: children10,
69875
70293
  rawXml: group,
69876
70294
  actionClick: grpActionClick,
@@ -70877,9 +71295,9 @@ var PptxHandlerRuntime72 = class _PptxHandlerRuntime31 extends PptxHandlerRuntim
70877
71295
  }
70878
71296
  const buClr = levelProps["a:buClr"];
70879
71297
  if (buClr) {
70880
- const srgb = buClr["a:srgbClr"];
70881
- if (srgb?.["@_val"]) {
70882
- style.bulletColor = String(srgb["@_val"]);
71298
+ const bulletColor = this.parseColor(buClr);
71299
+ if (bulletColor) {
71300
+ style.bulletColor = bulletColor;
70883
71301
  }
70884
71302
  }
70885
71303
  const buSzPts = levelProps["a:buSzPts"];
@@ -73358,6 +73776,87 @@ var PptxHandlerRuntime83 = class extends PptxHandlerRuntime82 {
73358
73776
  return void 0;
73359
73777
  }
73360
73778
  };
73779
+ function extractDrawingShapeFill(spPr, deps) {
73780
+ const result = {};
73781
+ const solidFill2 = deps.getChild(spPr, "solidFill");
73782
+ if (solidFill2) {
73783
+ result.fillColor = deps.parseColor(solidFill2) ?? void 0;
73784
+ }
73785
+ const gradFill = !solidFill2 ? deps.getChild(spPr, "gradFill") : void 0;
73786
+ if (gradFill) {
73787
+ const stops = deps.extractGradientStops(gradFill).map((stop) => ({
73788
+ color: stop.color,
73789
+ position: stop.position,
73790
+ ...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
73791
+ }));
73792
+ if (stops.length > 0) {
73793
+ result.fillGradientStops = stops;
73794
+ result.fillGradientType = deps.extractGradientType(gradFill);
73795
+ result.fillGradientAngle = deps.extractGradientAngle(gradFill);
73796
+ result.fillColor ??= stops[Math.floor(stops.length / 2)]?.color;
73797
+ }
73798
+ }
73799
+ const pattFill = !solidFill2 && !gradFill ? deps.getChild(spPr, "pattFill") : void 0;
73800
+ if (pattFill) {
73801
+ const preset = String(pattFill["@_prst"] || "").trim();
73802
+ if (preset) {
73803
+ result.fillPatternPreset = preset;
73804
+ }
73805
+ const fg = deps.parseColor(deps.getChild(pattFill, "fgClr"));
73806
+ const bg = deps.parseColor(deps.getChild(pattFill, "bgClr"));
73807
+ if (fg) {
73808
+ result.fillPatternForegroundColor = fg;
73809
+ }
73810
+ if (bg) {
73811
+ result.fillPatternBackgroundColor = bg;
73812
+ }
73813
+ result.fillColor ??= fg ?? bg;
73814
+ }
73815
+ const blipFill = !solidFill2 && !gradFill && !pattFill ? deps.getChild(spPr, "blipFill") : void 0;
73816
+ if (blipFill) {
73817
+ const blip = deps.getChild(blipFill, "blip");
73818
+ const embed = String(
73819
+ blip?.["@_r:embed"] || blip?.["@_embed"] || blip?.["@_r:link"] || ""
73820
+ ).trim();
73821
+ if (embed) {
73822
+ result.fillBlipEmbedId = embed;
73823
+ }
73824
+ }
73825
+ const shadowColor = deps.extractShadowColor(spPr);
73826
+ if (shadowColor) {
73827
+ result.hasShadow = true;
73828
+ result.shadowColor = shadowColor;
73829
+ }
73830
+ return result;
73831
+ }
73832
+ function extractDrawingShapeTextStyle(txBody, deps) {
73833
+ let fontSize;
73834
+ let fontColor;
73835
+ if (!txBody) {
73836
+ return { fontSize, fontColor };
73837
+ }
73838
+ const paragraphs = deps.getChildren(txBody, "p");
73839
+ for (const p of paragraphs) {
73840
+ const runs = deps.getChildren(p, "r");
73841
+ for (const r of runs) {
73842
+ const rPr = deps.getChild(r, "rPr");
73843
+ if (rPr && !fontSize) {
73844
+ const szRaw = parseInt(String(rPr["@_sz"] || ""), 10);
73845
+ if (Number.isFinite(szRaw) && szRaw > 0) {
73846
+ fontSize = szRaw / 100;
73847
+ }
73848
+ fontColor = deps.parseColor(deps.getChild(rPr, "solidFill")) ?? void 0;
73849
+ }
73850
+ if (fontSize) {
73851
+ break;
73852
+ }
73853
+ }
73854
+ if (fontSize) {
73855
+ break;
73856
+ }
73857
+ }
73858
+ return { fontSize, fontColor };
73859
+ }
73361
73860
  function resolveSmartArtTextStyles(paragraphs, resolve) {
73362
73861
  for (const paragraph of paragraphs ?? []) {
73363
73862
  if (paragraph.endParaRPr) {
@@ -73530,8 +74029,7 @@ var PptxHandlerRuntime84 = class _PptxHandlerRuntime35 extends PptxHandlerRuntim
73530
74029
  };
73531
74030
  }
73532
74031
  }
73533
- const solidFill2 = this.xmlLookupService.getChildByLocalName(spPr, "solidFill");
73534
- const fillColor = this.parseColor(solidFill2);
74032
+ const fill = extractDrawingShapeFill(spPr, this.drawingShapeStyleDeps());
73535
74033
  const lnNode = this.xmlLookupService.getChildByLocalName(spPr, "ln");
73536
74034
  const lnFill = lnNode ? this.xmlLookupService.getChildByLocalName(lnNode, "solidFill") : void 0;
73537
74035
  const strokeColor = this.parseColor(lnFill);
@@ -73543,7 +74041,10 @@ var PptxHandlerRuntime84 = class _PptxHandlerRuntime35 extends PptxHandlerRuntim
73543
74041
  this.collectLocalTextValues(txBody, "t", textValues2);
73544
74042
  }
73545
74043
  const text2 = textValues2.join("").trim() || void 0;
73546
- const { fontSize, fontColor } = this.extractDrawingShapeTextStyle(txBody);
74044
+ const { fontSize, fontColor } = extractDrawingShapeTextStyle(
74045
+ txBody,
74046
+ this.drawingShapeStyleDeps()
74047
+ );
73547
74048
  const paragraphs = txBody ? resolveSmartArtTextStyles(
73548
74049
  parseSmartArtTextParagraphs({ "dgm:t": txBody }),
73549
74050
  (rPr) => this.extractTextRunStyle(rPr, void 0, void 0, false)
@@ -73569,7 +74070,8 @@ var PptxHandlerRuntime84 = class _PptxHandlerRuntime35 extends PptxHandlerRuntim
73569
74070
  rotation,
73570
74071
  skewX,
73571
74072
  skewY,
73572
- fillColor: fillColor ?? void 0,
74073
+ ...fill,
74074
+ fillColor: fill.fillColor ?? void 0,
73573
74075
  strokeColor: strokeColor ?? void 0,
73574
74076
  strokeWidth,
73575
74077
  text: structuredText,
@@ -73579,34 +74081,21 @@ var PptxHandlerRuntime84 = class _PptxHandlerRuntime35 extends PptxHandlerRuntim
73579
74081
  ...customGeometry
73580
74082
  };
73581
74083
  }
73582
- extractDrawingShapeTextStyle(txBody) {
73583
- let fontSize;
73584
- let fontColor;
73585
- if (!txBody) {
73586
- return { fontSize, fontColor };
73587
- }
73588
- const paragraphs = this.xmlLookupService.getChildrenArrayByLocalName(txBody, "p");
73589
- for (const p of paragraphs) {
73590
- const runs = this.xmlLookupService.getChildrenArrayByLocalName(p, "r");
73591
- for (const r of runs) {
73592
- const rPr = this.xmlLookupService.getChildByLocalName(r, "rPr");
73593
- if (rPr && !fontSize) {
73594
- const szRaw = parseInt(String(rPr["@_sz"] || ""), 10);
73595
- if (Number.isFinite(szRaw) && szRaw > 0) {
73596
- fontSize = szRaw / 100;
73597
- }
73598
- const rprFill = this.xmlLookupService.getChildByLocalName(rPr, "solidFill");
73599
- fontColor = this.parseColor(rprFill) ?? void 0;
73600
- }
73601
- if (fontSize) {
73602
- break;
73603
- }
73604
- }
73605
- if (fontSize) {
73606
- break;
73607
- }
73608
- }
73609
- return { fontSize, fontColor };
74084
+ /**
74085
+ * Build the injected accessor bundle used by the pure drawing-shape style
74086
+ * helpers, binding the shared XML-lookup / colour / gradient / shadow codec
74087
+ * methods so no new colour logic is duplicated here.
74088
+ */
74089
+ drawingShapeStyleDeps() {
74090
+ return {
74091
+ getChild: (node, local) => this.xmlLookupService.getChildByLocalName(node, local),
74092
+ getChildren: (node, local) => this.xmlLookupService.getChildrenArrayByLocalName(node, local),
74093
+ parseColor: (node) => this.parseColor(node),
74094
+ extractGradientStops: (gradFill) => this.extractGradientStops(gradFill),
74095
+ extractGradientType: (gradFill) => this.extractGradientType(gradFill),
74096
+ extractGradientAngle: (gradFill) => this.extractGradientAngle(gradFill),
74097
+ extractShadowColor: (spPr) => this.extractShadowStyle(spPr).shadowColor
74098
+ };
73610
74099
  }
73611
74100
  };
73612
74101
  var CATEGORY_FAMILY = {
@@ -76056,6 +76545,7 @@ var PptxHandlerRuntime95 = class _PptxHandlerRuntime38 extends PptxHandlerRuntim
76056
76545
  });
76057
76546
  this.mediaDataParser = new PptxMediaDataParser({
76058
76547
  slideRelsMap: this.slideRelsMap,
76548
+ externalRelsMap: this.externalRelsMap,
76059
76549
  resolvePath: (base, relative) => this.resolvePath(base, relative),
76060
76550
  getPathExtension: (pathValue) => this.getPathExtension(pathValue)
76061
76551
  });
@@ -78710,9 +79200,9 @@ function removeEmptyDataPoint(series, pointIndex) {
78710
79200
  }
78711
79201
  }
78712
79202
  }
78713
- var EMU_PER_PIXEL = 9525;
79203
+ var EMU_PER_PIXEL2 = 9525;
78714
79204
  function pxToEmu(px2) {
78715
- return Math.round(px2 * EMU_PER_PIXEL);
79205
+ return Math.round(px2 * EMU_PER_PIXEL2);
78716
79206
  }
78717
79207
  function placeholderSpXml(ph, shapeId) {
78718
79208
  const name = ph.name ?? `${ph.type.charAt(0).toUpperCase() + ph.type.slice(1)} Placeholder ${shapeId - 1}`;
@@ -80444,7 +80934,7 @@ var GroupBuilder = class _GroupBuilder {
80444
80934
  };
80445
80935
  var PPI = 96;
80446
80936
  var POINTS_PER_INCH = 72;
80447
- var EMU_PER_PIXEL2 = 9525;
80937
+ var EMU_PER_PIXEL3 = 9525;
80448
80938
  var EMU_PER_INCH = 914400;
80449
80939
  var EMU_PER_POINT = 12700;
80450
80940
  function inches(value) {
@@ -80460,10 +80950,10 @@ function pt(value) {
80460
80950
  return Math.round(value / POINTS_PER_INCH * PPI);
80461
80951
  }
80462
80952
  function emuToPixels(emu) {
80463
- return Math.round(emu / EMU_PER_PIXEL2);
80953
+ return Math.round(emu / EMU_PER_PIXEL3);
80464
80954
  }
80465
80955
  function pixelsToEmu(px2) {
80466
- return Math.round(px2 * EMU_PER_PIXEL2);
80956
+ return Math.round(px2 * EMU_PER_PIXEL3);
80467
80957
  }
80468
80958
  function inchesToEmu(value) {
80469
80959
  return Math.round(value * EMU_PER_INCH);
@@ -90719,7 +91209,7 @@ exports.EFFECT_LST_ORDER = EFFECT_LST_ORDER;
90719
91209
  exports.ELEMENT_FIELD_KIND = ELEMENT_FIELD_KIND;
90720
91210
  exports.EMPHASIS_PRESETS = EMPHASIS_PRESETS;
90721
91211
  exports.EMU_PER_INCH = EMU_PER_INCH;
90722
- exports.EMU_PER_PIXEL2 = EMU_PER_PIXEL2;
91212
+ exports.EMU_PER_PIXEL3 = EMU_PER_PIXEL3;
90723
91213
  exports.EMU_PER_POINT = EMU_PER_POINT;
90724
91214
  exports.EMU_PER_PX = EMU_PER_PX;
90725
91215
  exports.ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV = ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV;