pptx-react-viewer 4.9.0 → 4.10.1

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 (93) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/{AiChatPanel-YRWC7C3B.mjs → AiChatPanel-AR2K2XN2.mjs} +3 -3
  3. package/dist/AiChatPanel-AR2K2XN2.mjs.br +0 -0
  4. package/dist/AiChatPanel-AR2K2XN2.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-WJ64Q6KO.js → AiChatPanel-X6E22UAR.js} +27 -27
  6. package/dist/AiChatPanel-X6E22UAR.js.br +0 -0
  7. package/dist/AiChatPanel-X6E22UAR.js.gz +0 -0
  8. package/dist/{Model3DScene-DS6AQWFV.mjs → Model3DScene-FF4RCG4O.mjs} +1 -1
  9. package/dist/Model3DScene-FF4RCG4O.mjs.br +0 -0
  10. package/dist/Model3DScene-FF4RCG4O.mjs.gz +0 -0
  11. package/dist/{Model3DScene-VHDYCHO5.js → Model3DScene-ZSCVKXZE.js} +2 -2
  12. package/dist/Model3DScene-ZSCVKXZE.js.br +0 -0
  13. package/dist/Model3DScene-ZSCVKXZE.js.gz +0 -0
  14. package/dist/{chunk-M6KW27TZ.mjs → chunk-22ODJ4CT.mjs} +17 -13
  15. package/dist/chunk-22ODJ4CT.mjs.br +0 -0
  16. package/dist/chunk-22ODJ4CT.mjs.gz +0 -0
  17. package/dist/{chunk-7NTNFOPT.js → chunk-7EP22XCS.js} +187 -187
  18. package/dist/chunk-7EP22XCS.js.br +0 -0
  19. package/dist/chunk-7EP22XCS.js.gz +0 -0
  20. package/dist/{chunk-NMXIX7E4.js → chunk-ICOJBMRC.js} +1179 -1179
  21. package/dist/chunk-ICOJBMRC.js.br +0 -0
  22. package/dist/chunk-ICOJBMRC.js.gz +0 -0
  23. package/dist/{chunk-YWAFJZ23.js → chunk-JJE4AACM.js} +861 -346
  24. package/dist/chunk-JJE4AACM.js.br +0 -0
  25. package/dist/chunk-JJE4AACM.js.gz +0 -0
  26. package/dist/{chunk-PJT2DTOS.mjs → chunk-LDRA5LJT.mjs} +861 -346
  27. package/dist/chunk-LDRA5LJT.mjs.br +0 -0
  28. package/dist/chunk-LDRA5LJT.mjs.gz +0 -0
  29. package/dist/{chunk-Y7RTQOD6.mjs → chunk-NE4USMMB.mjs} +1 -1
  30. package/dist/chunk-NE4USMMB.mjs.br +0 -0
  31. package/dist/chunk-NE4USMMB.mjs.gz +0 -0
  32. package/dist/{chunk-K5HZD63F.mjs → chunk-QPWNFTU5.mjs} +6 -6
  33. package/dist/chunk-QPWNFTU5.mjs.br +0 -0
  34. package/dist/chunk-QPWNFTU5.mjs.gz +0 -0
  35. package/dist/{chunk-ZZY24BB7.mjs → chunk-VOD4C7OS.mjs} +1 -1
  36. package/dist/chunk-VOD4C7OS.mjs.br +0 -0
  37. package/dist/chunk-VOD4C7OS.mjs.gz +0 -0
  38. package/dist/{chunk-ZZ6IPWOP.js → chunk-VYJFYRT4.js} +820 -816
  39. package/dist/chunk-VYJFYRT4.js.br +0 -0
  40. package/dist/chunk-VYJFYRT4.js.gz +0 -0
  41. package/dist/{chunk-PSJTZIIK.js → chunk-WLEFW2F4.js} +5 -5
  42. package/dist/chunk-WLEFW2F4.js.br +0 -0
  43. package/dist/chunk-WLEFW2F4.js.gz +0 -0
  44. package/dist/index.d.ts +20 -4
  45. package/dist/index.js +61 -61
  46. package/dist/index.js.br +0 -0
  47. package/dist/index.js.gz +0 -0
  48. package/dist/index.mjs +5 -5
  49. package/dist/index.mjs.br +0 -0
  50. package/dist/index.mjs.gz +0 -0
  51. package/dist/internals.d.ts +22 -6
  52. package/dist/internals.js +104 -104
  53. package/dist/internals.js.br +0 -0
  54. package/dist/internals.js.gz +0 -0
  55. package/dist/internals.mjs +3 -3
  56. package/dist/internals.mjs.br +0 -0
  57. package/dist/internals.mjs.gz +0 -0
  58. package/dist/viewer/index.d.ts +20 -4
  59. package/dist/viewer/index.js +26 -26
  60. package/dist/viewer/index.js.br +0 -0
  61. package/dist/viewer/index.js.gz +0 -0
  62. package/dist/viewer/index.mjs +5 -5
  63. package/dist/viewer/index.mjs.br +0 -0
  64. package/dist/viewer/index.mjs.gz +0 -0
  65. package/package.json +2 -2
  66. package/dist/AiChatPanel-WJ64Q6KO.js.br +0 -0
  67. package/dist/AiChatPanel-WJ64Q6KO.js.gz +0 -0
  68. package/dist/AiChatPanel-YRWC7C3B.mjs.br +0 -0
  69. package/dist/AiChatPanel-YRWC7C3B.mjs.gz +0 -0
  70. package/dist/Model3DScene-DS6AQWFV.mjs.br +0 -0
  71. package/dist/Model3DScene-DS6AQWFV.mjs.gz +0 -0
  72. package/dist/Model3DScene-VHDYCHO5.js.br +0 -0
  73. package/dist/Model3DScene-VHDYCHO5.js.gz +0 -0
  74. package/dist/chunk-7NTNFOPT.js.br +0 -0
  75. package/dist/chunk-7NTNFOPT.js.gz +0 -0
  76. package/dist/chunk-K5HZD63F.mjs.br +0 -0
  77. package/dist/chunk-K5HZD63F.mjs.gz +0 -0
  78. package/dist/chunk-M6KW27TZ.mjs.br +0 -0
  79. package/dist/chunk-M6KW27TZ.mjs.gz +0 -0
  80. package/dist/chunk-NMXIX7E4.js.br +0 -0
  81. package/dist/chunk-NMXIX7E4.js.gz +0 -0
  82. package/dist/chunk-PJT2DTOS.mjs.br +0 -0
  83. package/dist/chunk-PJT2DTOS.mjs.gz +0 -0
  84. package/dist/chunk-PSJTZIIK.js.br +0 -0
  85. package/dist/chunk-PSJTZIIK.js.gz +0 -0
  86. package/dist/chunk-Y7RTQOD6.mjs.br +0 -0
  87. package/dist/chunk-Y7RTQOD6.mjs.gz +0 -0
  88. package/dist/chunk-YWAFJZ23.js.br +0 -0
  89. package/dist/chunk-YWAFJZ23.js.gz +0 -0
  90. package/dist/chunk-ZZ6IPWOP.js.br +0 -0
  91. package/dist/chunk-ZZ6IPWOP.js.gz +0 -0
  92. package/dist/chunk-ZZY24BB7.mjs.br +0 -0
  93. package/dist/chunk-ZZY24BB7.mjs.gz +0 -0
@@ -11107,7 +11107,7 @@ function createChartElement(chartType, input, options) {
11107
11107
  const chartData = {
11108
11108
  chartType,
11109
11109
  categories: input.categories,
11110
- categoryLevels: input.categoryLevels?.map((level) => [...level]),
11110
+ categoryLevels: input.categoryLevels?.map((level2) => [...level2]),
11111
11111
  series,
11112
11112
  title: input.title,
11113
11113
  grouping: input.grouping,
@@ -35951,9 +35951,9 @@ function paragraphsAt(text22, sizePt) {
35951
35951
  const afterParent = (text22.spaceAfterParent ?? DEFAULT_SPACE_AFTER_PARENT) / 100;
35952
35952
  const afterChild = (text22.spaceAfterChild ?? DEFAULT_SPACE_AFTER_CHILD) / 100;
35953
35953
  const { secondary } = paragraphSizesPt(text22, sizePt);
35954
- const paragraph = (value, level) => {
35955
- const bullet = bulletLevel > 0 && level >= bulletLevel;
35956
- const size = bullet || level >= 2 ? secondary : sizePt;
35954
+ const paragraph = (value, level2) => {
35955
+ const bullet = bulletLevel > 0 && level2 >= bulletLevel;
35956
+ const size = bullet || level2 >= 2 ? secondary : sizePt;
35957
35957
  return {
35958
35958
  text: value,
35959
35959
  size,
@@ -36826,6 +36826,136 @@ var init_alg_hier = __esm({
36826
36826
  HIER_ALGS = /* @__PURE__ */ new Set(["hierRoot", "hierChild"]);
36827
36827
  }
36828
36828
  });
36829
+ function shapeTransform(node) {
36830
+ const box = node.box;
36831
+ if (!box) {
36832
+ return void 0;
36833
+ }
36834
+ const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
36835
+ const quarter = Math.round((node.shape?.rot ?? 0) / 90);
36836
+ if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
36837
+ const cx = box.x + box.w / 2;
36838
+ const cy = box.y + box.h / 2;
36839
+ return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
36840
+ }
36841
+ return { ...box, rotation };
36842
+ }
36843
+ var init_shape_transform = __esm({
36844
+ "src/core/utils/smartart-engine/shape-transform.ts"() {
36845
+ }
36846
+ });
36847
+ function depthOf(point) {
36848
+ let depth = 0;
36849
+ for (let current = point.parent; current; current = current.parent) {
36850
+ depth++;
36851
+ }
36852
+ return depth;
36853
+ }
36854
+ function level(depth) {
36855
+ return Math.max(0, Math.min(MAX_LEVEL, depth));
36856
+ }
36857
+ function connectorDim(node) {
36858
+ return node.alg.type === "conn" && node.alg.params.dim === "1D" ? "1D" : "2D";
36859
+ }
36860
+ function derivedStyleLabel(node) {
36861
+ if (!node.hasPresOf) {
36862
+ return void 0;
36863
+ }
36864
+ const point = node.presOf[0] ?? node.point;
36865
+ switch (point.type) {
36866
+ case "node":
36867
+ case "asst":
36868
+ return `node${level(depthOf(point))}`;
36869
+ case "sibTrans":
36870
+ return `sibTrans${connectorDim(node)}1`;
36871
+ case "parTrans":
36872
+ return `parChTrans${connectorDim(node)}${level(depthOf(point))}`;
36873
+ default:
36874
+ return void 0;
36875
+ }
36876
+ }
36877
+ function engineStyleLabel(node) {
36878
+ for (let current = node; current; current = current.parent) {
36879
+ if (current.styleLbl) {
36880
+ return current.styleLbl;
36881
+ }
36882
+ }
36883
+ return derivedStyleLabel(node);
36884
+ }
36885
+ var MAX_LEVEL;
36886
+ var init_style_label = __esm({
36887
+ "src/core/utils/smartart-engine/style-label.ts"() {
36888
+ MAX_LEVEL = 4;
36889
+ }
36890
+ });
36891
+ function connectorPreset(node) {
36892
+ const type = node.shape?.type;
36893
+ if (!type || type === "none" || node.shape?.hideGeom || !node.values.has("connDist")) {
36894
+ return void 0;
36895
+ }
36896
+ if (type !== "conn") {
36897
+ return type;
36898
+ }
36899
+ const params = node.alg.params;
36900
+ if ((params.dim ?? "2D") !== "2D" || (params.connRout ?? "stra") !== "stra") {
36901
+ return void 0;
36902
+ }
36903
+ const begin = (params.begSty ?? "noArr") === "arr";
36904
+ const end = (params.endSty ?? "arr") === "arr";
36905
+ if (begin && end) {
36906
+ return "leftRightArrow";
36907
+ }
36908
+ if (begin) {
36909
+ return "leftArrow";
36910
+ }
36911
+ return end ? "rightArrow" : "rect";
36912
+ }
36913
+ function buildConnectorNode(node, index, connectorIndex, palette, roleColors) {
36914
+ const preset22 = connectorPreset(node);
36915
+ const transform6 = preset22 ? shapeTransform(node) : void 0;
36916
+ if (!preset22 || !transform6 || !(transform6.w > 0) || !(transform6.h > 0)) {
36917
+ return void 0;
36918
+ }
36919
+ const styleLabel = engineStyleLabel(node);
36920
+ const fills = styleLabel ? roleColors?.[styleLabel]?.fill : void 0;
36921
+ const fill = fills && fills.length > 0 ? fills[connectorIndex % fills.length] : colour(index, palette);
36922
+ const x = transform6.x * PX_PER_PT3;
36923
+ const y = transform6.y * PX_PER_PT3;
36924
+ const width = transform6.w * PX_PER_PT3;
36925
+ const height = transform6.h * PX_PER_PT3;
36926
+ return {
36927
+ kind: "rect",
36928
+ key: `${node.name || "engine-conn"}-${index}`,
36929
+ x,
36930
+ y,
36931
+ width,
36932
+ height,
36933
+ rx: 0,
36934
+ fill,
36935
+ stroke: "none",
36936
+ strokeWidth: 0,
36937
+ opacity: 1,
36938
+ text: "",
36939
+ fontSize: 0,
36940
+ textX: x + width / 2,
36941
+ textY: y + height / 2,
36942
+ rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
36943
+ presetOverride: preset22,
36944
+ ...preset22 === "rect" ? {} : { shapeAdjustments: { ...ARROW_ADJUSTMENTS } },
36945
+ ...styleLabel ? { styleLabel } : {}
36946
+ };
36947
+ }
36948
+ var ARROW_ADJUSTMENTS;
36949
+ var PX_PER_PT3;
36950
+ var init_connector_shape = __esm({
36951
+ "src/core/utils/smartart-engine/connector-shape.ts"() {
36952
+ init_smartart_layout_style_helpers();
36953
+ init_shape_transform();
36954
+ init_style_label();
36955
+ ARROW_ADJUSTMENTS = { adj1: 6e4, adj2: 5e4 };
36956
+ PX_PER_PT3 = 96 / 72;
36957
+ }
36958
+ });
36829
36959
  function collectNodes(nodes, parentId, out) {
36830
36960
  for (const node of nodes) {
36831
36961
  out.push({ node, parentId: node.parentId ?? parentId });
@@ -37521,6 +37651,68 @@ var init_pres_tree = __esm({
37521
37651
  MAX_DEPTH = 96;
37522
37652
  }
37523
37653
  });
37654
+ function connectorThickness(node, fallback) {
37655
+ const parent = node.parent;
37656
+ let resized = false;
37657
+ for (const constraint of parent?.constraints ?? []) {
37658
+ if (!parent || !SIZE_TYPES2.has(constraint.type) || !SIZE_TYPES2.has(constraint.refType)) {
37659
+ continue;
37660
+ }
37661
+ if (constraint.refFor === "self" && !constraint.refForName) {
37662
+ continue;
37663
+ }
37664
+ const targets = relatedNodes(parent, constraint.for, constraint.forName, constraint.ptType);
37665
+ if (!targets.includes(node)) {
37666
+ continue;
37667
+ }
37668
+ const ref = relatedNodes(
37669
+ parent,
37670
+ constraint.refFor,
37671
+ constraint.refForName,
37672
+ constraint.refPtType
37673
+ )[0];
37674
+ const box = ref?.box;
37675
+ if (!box || ref.alg.type === "conn") {
37676
+ continue;
37677
+ }
37678
+ const base = constraint.refType === "w" ? box.w : box.h;
37679
+ if (base > 0) {
37680
+ node.values.set(constraint.type, base * constraint.fact);
37681
+ resized = true;
37682
+ }
37683
+ }
37684
+ if (resized) {
37685
+ for (let i2 = 0; i2 < node.constraints.length; i2++) {
37686
+ if (isSelfSizeConstraint(node, i2)) {
37687
+ applyConstraint(node, node.constraints[i2]);
37688
+ }
37689
+ }
37690
+ }
37691
+ const h2 = node.values.get("h");
37692
+ return resized && h2 !== void 0 && h2 > 0 ? h2 : fallback;
37693
+ }
37694
+ function edgeDistance(shape, box, dx, dy) {
37695
+ const halfW = box.w / 2;
37696
+ const halfH = box.h / 2;
37697
+ if (shape.shape?.type === "ellipse" && halfW > 0 && halfH > 0) {
37698
+ return halfW * halfH / Math.hypot(halfH * dx, halfW * dy);
37699
+ }
37700
+ const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
37701
+ const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
37702
+ return Math.min(tx, ty);
37703
+ }
37704
+ var SIZE_TYPES2;
37705
+ var DEFAULT_BEGIN_PAD;
37706
+ var DEFAULT_END_PAD;
37707
+ var init_connector_size = __esm({
37708
+ "src/core/utils/smartart-engine/connector-size.ts"() {
37709
+ init_constraint_eval();
37710
+ init_preferred_size();
37711
+ SIZE_TYPES2 = /* @__PURE__ */ new Set(["w", "h"]);
37712
+ DEFAULT_BEGIN_PAD = 0.22;
37713
+ DEFAULT_END_PAD = 0.25;
37714
+ }
37715
+ });
37524
37716
  function rootOf2(node) {
37525
37717
  let current = node;
37526
37718
  while (current.parent) {
@@ -37567,13 +37759,6 @@ function findShape(scope, point, name, skip) {
37567
37759
  visit(scope);
37568
37760
  return named ?? fallback;
37569
37761
  }
37570
- function edgeDistance(box, dx, dy) {
37571
- const halfW = box.w / 2;
37572
- const halfH = box.h / 2;
37573
- const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
37574
- const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
37575
- return Math.min(tx, ty);
37576
- }
37577
37762
  function arrangeConnector(node) {
37578
37763
  const box = node.box;
37579
37764
  if (!box) {
@@ -37592,8 +37777,8 @@ function arrangeConnector(node) {
37592
37777
  if (length > 0) {
37593
37778
  const dx = (ex - sx) / length;
37594
37779
  const dy = (ey - sy) / length;
37595
- const startGap = edgeDistance(src.box, dx, dy);
37596
- const endGap = edgeDistance(dst.box, dx, dy);
37780
+ const startGap = edgeDistance(src, src.box, dx, dy);
37781
+ const endGap = edgeDistance(dst, dst.box, dx, dy);
37597
37782
  const connDist = Math.max(0, length - startGap - endGap);
37598
37783
  node.values.set("connDist", connDist);
37599
37784
  for (const constraint of node.constraints) {
@@ -37601,13 +37786,13 @@ function arrangeConnector(node) {
37601
37786
  node.values.set(constraint.type, connDist * constraint.fact);
37602
37787
  }
37603
37788
  }
37604
- const begPad = node.values.get("begPad") ?? 0;
37605
- const endPad = node.values.get("endPad") ?? 0;
37789
+ const begPad = node.values.get("begPad") ?? connDist * DEFAULT_BEGIN_PAD;
37790
+ const endPad = node.values.get("endPad") ?? connDist * DEFAULT_END_PAD;
37606
37791
  const arrowLength = Math.max(0, connDist - begPad - endPad);
37607
37792
  const mid = startGap + begPad + arrowLength / 2;
37608
37793
  const cx = sx + dx * mid;
37609
37794
  const cy = sy + dy * mid;
37610
- const thickness = box.h;
37795
+ const thickness = connectorThickness(node, box.h);
37611
37796
  node.box = { x: cx - arrowLength / 2, y: cy - thickness / 2, w: arrowLength, h: thickness };
37612
37797
  node.rotation = normaliseAngle2(Math.atan2(dy, dx) * 180 / Math.PI);
37613
37798
  }
@@ -37623,6 +37808,7 @@ function normaliseAngle2(degrees) {
37623
37808
  }
37624
37809
  var init_alg_connector = __esm({
37625
37810
  "src/core/utils/smartart-engine/alg-connector.ts"() {
37811
+ init_connector_size();
37626
37812
  }
37627
37813
  });
37628
37814
  function groupContentChildren(node) {
@@ -38662,11 +38848,11 @@ function applyEngineFonts(collected, nodeById, fontName) {
38662
38848
  const pt2 = sizes.get(node) ?? 18;
38663
38849
  const text22 = texts.get(node);
38664
38850
  const { first, secondary } = text22 ? paragraphSizesPt(text22, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
38665
- rendered.fontSize = first * PX_PER_PT3;
38666
- rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT3 : void 0;
38851
+ rendered.fontSize = first * PX_PER_PT4;
38852
+ rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT4 : void 0;
38667
38853
  }
38668
38854
  }
38669
- var PX_PER_PT3;
38855
+ var PX_PER_PT4;
38670
38856
  var init_engine_fonts = __esm({
38671
38857
  "src/core/utils/smartart-engine/engine-fonts.ts"() {
38672
38858
  init_smartart_layout_item_font_size();
@@ -38674,7 +38860,7 @@ var init_engine_fonts = __esm({
38674
38860
  init_move_with_merge();
38675
38861
  init_node_text();
38676
38862
  init_text_measure();
38677
- PX_PER_PT3 = 96 / 72;
38863
+ PX_PER_PT4 = 96 / 72;
38678
38864
  }
38679
38865
  });
38680
38866
  function transitionLabelOf(node) {
@@ -38704,24 +38890,6 @@ var init_render_filter = __esm({
38704
38890
  "src/core/utils/smartart-engine/render-filter.ts"() {
38705
38891
  }
38706
38892
  });
38707
- function shapeTransform(node) {
38708
- const box = node.box;
38709
- if (!box) {
38710
- return void 0;
38711
- }
38712
- const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
38713
- const quarter = Math.round((node.shape?.rot ?? 0) / 90);
38714
- if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
38715
- const cx = box.x + box.w / 2;
38716
- const cy = box.y + box.h / 2;
38717
- return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
38718
- }
38719
- return { ...box, rotation };
38720
- }
38721
- var init_shape_transform = __esm({
38722
- "src/core/utils/smartart-engine/shape-transform.ts"() {
38723
- }
38724
- });
38725
38893
  function isFullySupported(root) {
38726
38894
  let ok = true;
38727
38895
  const visit = (node) => {
@@ -38748,10 +38916,10 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
38748
38916
  const hidden = Boolean(node.shape?.hideGeom);
38749
38917
  const text22 = primary?.text ?? literalText ?? "";
38750
38918
  const sw = hidden ? 0 : styleStroke(style);
38751
- const x = transform6.x * PX_PER_PT4;
38752
- const y = transform6.y * PX_PER_PT4;
38753
- const width = transform6.w * PX_PER_PT4;
38754
- const height = transform6.h * PX_PER_PT4;
38919
+ const x = transform6.x * PX_PER_PT5;
38920
+ const y = transform6.y * PX_PER_PT5;
38921
+ const width = transform6.w * PX_PER_PT5;
38922
+ const height = transform6.h * PX_PER_PT5;
38755
38923
  const foldedNodeIds = [
38756
38924
  ...sourceIds.slice(1),
38757
38925
  ...(mergedSourceIds ?? []).filter((id) => !sourceIds.includes(id))
@@ -38778,15 +38946,23 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
38778
38946
  rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
38779
38947
  presetOverride: node.shape?.type ?? "roundRect",
38780
38948
  foldedNodeIds: foldedNodeIds.length > 0 ? foldedNodeIds : void 0,
38781
- literalText
38949
+ literalText,
38950
+ styleLabel: engineStyleLabel(node)
38782
38951
  };
38783
38952
  }
38784
- function collectRenderedNodes(root, nodeById, palette, style) {
38953
+ function collectRenderedNodes(root, nodeById, palette, style, roleColors) {
38785
38954
  const out = [];
38955
+ const connectors2 = [];
38786
38956
  const visitSiblings = (siblings) => {
38787
38957
  const { extraIdsByTarget, suppressed, carrierByTarget } = computeMoveWithMerge(siblings);
38788
38958
  for (const node of siblings) {
38789
- if (node.alg.type !== "conn" && !suppressed.has(node)) {
38959
+ if (node.alg.type === "conn") {
38960
+ const index = out.length + connectors2.length;
38961
+ const arrow = buildConnectorNode(node, index, connectors2.length, palette, roleColors);
38962
+ if (arrow) {
38963
+ connectors2.push(arrow);
38964
+ }
38965
+ } else if (!suppressed.has(node)) {
38790
38966
  const mergedIds = extraIdsByTarget.get(node.name);
38791
38967
  const rendered = buildRenderedNode(node, out.length, nodeById, palette, style, mergedIds);
38792
38968
  if (rendered) {
@@ -38799,7 +38975,7 @@ function collectRenderedNodes(root, nodeById, palette, style) {
38799
38975
  }
38800
38976
  };
38801
38977
  visitSiblings([root]);
38802
- return out;
38978
+ return { collected: out, connectors: connectors2 };
38803
38979
  }
38804
38980
  function isFiniteGeometry(node) {
38805
38981
  return Number.isFinite(node.x) && Number.isFinite(node.y) && Number.isFinite(node.width) && Number.isFinite(node.height) && node.width > 0 && node.height > 0;
@@ -38827,9 +39003,15 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
38827
39003
  if (!run || !isFullySupported(run.root)) {
38828
39004
  return void 0;
38829
39005
  }
38830
- const collected = collectRenderedNodes(run.root, nodeById, palette, style);
39006
+ const { collected, connectors: connectors2 } = collectRenderedNodes(
39007
+ run.root,
39008
+ nodeById,
39009
+ palette,
39010
+ style,
39011
+ smartArtData.colorTransform?.roleColors
39012
+ );
38831
39013
  applyEngineFonts(collected, nodeById, smartArtData.themeMinorFont);
38832
- const rendered = collected.map((entry5) => entry5.rendered);
39014
+ const rendered = [...collected.map((entry5) => entry5.rendered), ...connectors2];
38833
39015
  if (rendered.length === 0 || !rendered.every(isFiniteGeometry)) {
38834
39016
  return void 0;
38835
39017
  }
@@ -38843,18 +39025,20 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
38843
39025
  }
38844
39026
  var SUPPORTED_ALGS;
38845
39027
  var PT_PER_PX;
38846
- var PX_PER_PT4;
39028
+ var PX_PER_PT5;
38847
39029
  var init_engine_to_result = __esm({
38848
39030
  "src/core/utils/smartart-engine/engine-to-result.ts"() {
38849
39031
  init_smartart_layout_item_font_size();
38850
39032
  init_smartart_layout_style_helpers();
38851
39033
  init_alg_hier();
39034
+ init_connector_shape();
38852
39035
  init_engine();
38853
39036
  init_engine_fonts();
38854
39037
  init_move_with_merge();
38855
39038
  init_node_text();
38856
39039
  init_render_filter();
38857
39040
  init_shape_transform();
39041
+ init_style_label();
38858
39042
  init_text_measure();
38859
39043
  SUPPORTED_ALGS = /* @__PURE__ */ new Set([
38860
39044
  "composite",
@@ -38869,7 +39053,22 @@ var init_engine_to_result = __esm({
38869
39053
  "tx"
38870
39054
  ]);
38871
39055
  PT_PER_PX = 72 / 96;
38872
- PX_PER_PT4 = 1 / PT_PER_PX;
39056
+ PX_PER_PT5 = 1 / PT_PER_PX;
39057
+ }
39058
+ });
39059
+ function tagSmartArtElementStyleLabel(element, label) {
39060
+ if (label) {
39061
+ styleLabels.set(element, label);
39062
+ }
39063
+ return element;
39064
+ }
39065
+ function smartArtElementStyleLabel(element) {
39066
+ return styleLabels.get(element);
39067
+ }
39068
+ var styleLabels;
39069
+ var init_smartart_element_style_label = __esm({
39070
+ "src/core/utils/smartart-element-style-label.ts"() {
39071
+ styleLabels = /* @__PURE__ */ new WeakMap();
38873
39072
  }
38874
39073
  });
38875
39074
  function accentColor(index, themeColorMap) {
@@ -39792,8 +39991,8 @@ function parseParagraphLevel(pPr) {
39792
39991
  if (!pPr) {
39793
39992
  return 0;
39794
39993
  }
39795
- const level = Number.parseInt(String(pPr["@_lvl"] || "0"), 10);
39796
- return Number.isFinite(level) ? Math.min(Math.max(level, 0), 8) : 0;
39994
+ const level2 = Number.parseInt(String(pPr["@_lvl"] || "0"), 10);
39995
+ return Number.isFinite(level2) ? Math.min(Math.max(level2, 0), 8) : 0;
39797
39996
  }
39798
39997
  function parseParagraphExtraAttributes(pPr) {
39799
39998
  const result = {};
@@ -40167,12 +40366,12 @@ function paragraphStyle(paragraph, fallback) {
40167
40366
  }
40168
40367
  function paragraphMetadata(paragraph, paragraphIndex, bulletEnabled) {
40169
40368
  const pPr = paragraph.pPr;
40170
- const level = parseParagraphLevel(pPr);
40369
+ const level2 = parseParagraphLevel(pPr);
40171
40370
  const explicitBullet = parseBulletInfo(pPr, paragraphIndex) ?? void 0;
40172
- const bulletInfo = explicitBullet ?? (bulletEnabled && (level ?? 0) >= 1 ? { char: AUTO_BULLET_CHAR } : void 0);
40371
+ const bulletInfo = explicitBullet ?? (bulletEnabled && (level2 ?? 0) >= 1 ? { char: AUTO_BULLET_CHAR } : void 0);
40173
40372
  return {
40174
40373
  ...bulletInfo ? { bulletInfo } : {},
40175
- paragraphLevel: level,
40374
+ paragraphLevel: level2,
40176
40375
  ...paragraph.endParaRPr ? { endParaRunProperties: paragraph.endParaRPr } : {}
40177
40376
  };
40178
40377
  }
@@ -40409,10 +40608,12 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40409
40608
  fontSize,
40410
40609
  fontColor: rendered.fontColor ?? "#FFFFFF",
40411
40610
  textSegments,
40412
- rotation: rendered.rotation
40611
+ rotation: rendered.rotation,
40612
+ ...rendered.shapeAdjustments ? { shapeAdjustments: rendered.shapeAdjustments } : {}
40413
40613
  };
40614
+ const push2 = (element) => elements2.push(tagSmartArtElementStyleLabel(element, rendered.styleLabel));
40414
40615
  if (rendered.kind === "rect") {
40415
- elements2.push(
40616
+ push2(
40416
40617
  makeShapeElement(
40417
40618
  id,
40418
40619
  containerBounds.x + rendered.x,
@@ -40433,7 +40634,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40433
40634
  } else if (rendered.kind === "circle") {
40434
40635
  const halfWidth = rendered.rx ?? rendered.r;
40435
40636
  const halfHeight = rendered.ry ?? rendered.r;
40436
- elements2.push(
40637
+ push2(
40437
40638
  makeShapeElement(
40438
40639
  id,
40439
40640
  containerBounds.x + rendered.cx - halfWidth,
@@ -40453,7 +40654,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40453
40654
  );
40454
40655
  } else {
40455
40656
  const bbox = polygonBoundingBox(rendered.points);
40456
- elements2.push(
40657
+ push2(
40457
40658
  makeShapeElement(
40458
40659
  id,
40459
40660
  containerBounds.x + bbox.x,
@@ -40472,6 +40673,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40472
40673
  }
40473
40674
  var init_smartart_interpreter_drawing_bridge = __esm({
40474
40675
  "src/core/utils/smartart-interpreter-drawing-bridge.ts"() {
40676
+ init_smartart_element_style_label();
40475
40677
  init_smartart_helpers();
40476
40678
  init_smartart_interpreter_fold_text();
40477
40679
  init_smartart_node_tree_axis();
@@ -41343,8 +41545,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41343
41545
  const proportional = proportionalMarginFraction(index, role);
41344
41546
  const lineSpacingFactor = SMARTART_LINE_SPACING_FACTOR;
41345
41547
  const fitsAtPoint = (rootPt2) => {
41346
- const rootPx = rootPt2 * PX_PER_PT5;
41347
- const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) * PX_PER_PT5;
41548
+ const rootPx = rootPt2 * PX_PER_PT6;
41549
+ const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) * PX_PER_PT6;
41348
41550
  const margins = proportional ? { horizontal: proportional.horizontal * rootPx, vertical: proportional.vertical * rootPx } : fixedMargins;
41349
41551
  for (const item3 of items) {
41350
41552
  const naturalHeight = typeof naturalAspect === "number" ? Math.min(item3.height, item3.width * naturalAspect) : item3.height;
@@ -41366,8 +41568,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41366
41568
  }
41367
41569
  return true;
41368
41570
  };
41369
- const ceilingPt = Math.max(1, Math.floor(ceilingPx / PX_PER_PT5 + 1e-9));
41370
- const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx / PX_PER_PT5 - 1e-9)));
41571
+ const ceilingPt = Math.max(1, Math.floor(ceilingPx / PX_PER_PT6 + 1e-9));
41572
+ const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx / PX_PER_PT6 - 1e-9)));
41371
41573
  let rootPt = floorPt;
41372
41574
  for (let candidate = ceilingPt; candidate > floorPt; candidate--) {
41373
41575
  if (fitsAtPoint(candidate)) {
@@ -41375,12 +41577,12 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41375
41577
  break;
41376
41578
  }
41377
41579
  }
41378
- const rootSizePx = rootPt * PX_PER_PT5;
41580
+ const rootSizePx = rootPt * PX_PER_PT6;
41379
41581
  const descendantSizePx = snapToWholePoint(rootSizePx * SMARTART_DESCENDANT_FONT_SCALE);
41380
41582
  return { rootSizePx, descendantSizePx };
41381
41583
  }
41382
41584
  var SMARTART_DESCENDANT_FONT_SCALE;
41383
- var PX_PER_PT5;
41585
+ var PX_PER_PT6;
41384
41586
  var init_smartart_layout_item_font_tier = __esm({
41385
41587
  "src/core/utils/smartart-layout-item-font-tier.ts"() {
41386
41588
  init_smartart_layout_item_font_role();
@@ -41388,7 +41590,7 @@ var init_smartart_layout_item_font_tier = __esm({
41388
41590
  init_smartart_layout_item_font_tier_fit();
41389
41591
  init_smartart_text_wrap_fit();
41390
41592
  SMARTART_DESCENDANT_FONT_SCALE = 0.78;
41391
- PX_PER_PT5 = 96 / 72;
41593
+ PX_PER_PT6 = 96 / 72;
41392
41594
  }
41393
41595
  });
41394
41596
  function resolveCycleFontFit(plan, index, ringNodes, hubNode, ringNodeWidth, ringNodeHeight, hubWidth, hubHeight, cornerInsetPx, childrenOf, fontName) {
@@ -42675,7 +42877,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42675
42877
  }
42676
42878
  }
42677
42879
  const roots = nodes.filter((n) => !childIds.has(n.id));
42678
- const depthOf = /* @__PURE__ */ new Map();
42880
+ const depthOf2 = /* @__PURE__ */ new Map();
42679
42881
  let maxDepth2 = 0;
42680
42882
  const depthStack = roots.map((r) => ({
42681
42883
  node: r,
@@ -42683,7 +42885,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42683
42885
  }));
42684
42886
  while (depthStack.length > 0) {
42685
42887
  const { node, depth } = depthStack.pop();
42686
- depthOf.set(node.id, depth);
42888
+ depthOf2.set(node.id, depth);
42687
42889
  maxDepth2 = Math.max(maxDepth2, depth);
42688
42890
  for (const c of childrenIn(node)) {
42689
42891
  depthStack.push({ node: c, depth: depth + 1 });
@@ -42740,7 +42942,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42740
42942
  ({ node, x, width }, i2) => presetBoxNode({
42741
42943
  key: `${elementId}-lintbl-${node.id}-${i2}`,
42742
42944
  x,
42743
- y: rowY(depthOf.get(node.id) ?? 0),
42945
+ y: rowY(depthOf2.get(node.id) ?? 0),
42744
42946
  width,
42745
42947
  height: rowHeight,
42746
42948
  node,
@@ -44992,18 +45194,18 @@ function fanContinues(t, perRow, orgChart, siblingCount2, normalCount) {
44992
45194
  const spanW = effectiveWidth(t, orgChart);
44993
45195
  return chPrefFanEligible || isSoloChainLink && normalCount > 1 && spanW === normalCount;
44994
45196
  }
44995
- function walk2(t, level, perRow, orgChart, siblingCount2) {
45197
+ function walk2(t, level2, perRow, orgChart, siblingCount2) {
44996
45198
  const { normal } = partitionChildren(t, orgChart);
44997
45199
  if (normal.length === 0) {
44998
- return { deepestFanLevel: level, maxHangDepth: 0, maxHangRows: 0, hangingColumns: 0 };
45200
+ return { deepestFanLevel: level2, maxHangDepth: 0, maxHangRows: 0, hangingColumns: 0 };
44999
45201
  }
45000
- if (level === 0) {
45001
- let deepestFan = level;
45202
+ if (level2 === 0) {
45203
+ let deepestFan = level2;
45002
45204
  let maxHang = 0;
45003
45205
  let maxRows = 0;
45004
45206
  let hangingColumns = 0;
45005
45207
  for (const child262 of normal) {
45006
- const r = walk2(child262, level + 1, perRow, orgChart, normal.length);
45208
+ const r = walk2(child262, level2 + 1, perRow, orgChart, normal.length);
45007
45209
  deepestFan = Math.max(deepestFan, r.deepestFanLevel);
45008
45210
  maxHang = Math.max(maxHang, r.maxHangDepth);
45009
45211
  maxRows = Math.max(maxRows, r.maxHangRows);
@@ -45017,12 +45219,12 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
45017
45219
  };
45018
45220
  }
45019
45221
  if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
45020
- let deepestFan = level + 1;
45222
+ let deepestFan = level2 + 1;
45021
45223
  let maxHang = 0;
45022
45224
  let maxRows = 0;
45023
45225
  let hangingColumns = 0;
45024
45226
  for (const child262 of normal) {
45025
- const r = walk2(child262, level + 1, perRow, orgChart, void 0);
45227
+ const r = walk2(child262, level2 + 1, perRow, orgChart, void 0);
45026
45228
  deepestFan = Math.max(deepestFan, r.deepestFanLevel);
45027
45229
  maxHang = Math.max(maxHang, r.maxHangDepth);
45028
45230
  maxRows = Math.max(maxRows, r.maxHangRows);
@@ -45036,7 +45238,7 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
45036
45238
  };
45037
45239
  }
45038
45240
  return {
45039
- deepestFanLevel: level,
45241
+ deepestFanLevel: level2,
45040
45242
  maxHangDepth: treeDepth(t) - 1,
45041
45243
  maxHangRows: countDescendants(t, orgChart),
45042
45244
  hangingColumns: 1
@@ -45079,20 +45281,20 @@ var init_smartart_hierarchy_hang_depth = __esm({
45079
45281
  init_smartart_hierarchy_orgchart_tree();
45080
45282
  }
45081
45283
  });
45082
- function widthWalk(t, level, perRow, orgChart, siblingCount2, map) {
45284
+ function widthWalk(t, level2, perRow, orgChart, siblingCount2, map) {
45083
45285
  const { normal } = partitionChildren(t, orgChart);
45084
45286
  let width;
45085
45287
  if (normal.length === 0) {
45086
45288
  width = 1;
45087
- } else if (level === 0) {
45289
+ } else if (level2 === 0) {
45088
45290
  width = 0;
45089
45291
  for (const child262 of normal) {
45090
- width += widthWalk(child262, level + 1, perRow, orgChart, normal.length, map);
45292
+ width += widthWalk(child262, level2 + 1, perRow, orgChart, normal.length, map);
45091
45293
  }
45092
45294
  } else if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
45093
45295
  width = 0;
45094
45296
  for (const child262 of normal) {
45095
- width += widthWalk(child262, level + 1, perRow, orgChart, void 0, map);
45297
+ width += widthWalk(child262, level2 + 1, perRow, orgChart, void 0, map);
45096
45298
  }
45097
45299
  } else {
45098
45300
  width = 1;
@@ -45334,7 +45536,7 @@ function placeAssistants(hc, x, parentBottom, assistants, options, cursor) {
45334
45536
  stubConnector(hc, assistant.node.id, x + hc.boxH / 2, parentBottom, x + width / 2, y);
45335
45537
  }
45336
45538
  }
45337
- function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45539
+ function placeHangingTree(hc, t, x, options, cursor, size, level2 = 0) {
45338
45540
  const y = cursor.y;
45339
45541
  const boxW = size?.w ?? hc.boxW;
45340
45542
  const boxH = size?.h ?? hc.boxH;
@@ -45347,7 +45549,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45347
45549
  if (normal.length === 0) {
45348
45550
  return;
45349
45551
  }
45350
- if (options.foldDeeperGenerations && level >= 1) {
45552
+ if (options.foldDeeperGenerations && level2 >= 1) {
45351
45553
  return;
45352
45554
  }
45353
45555
  const childX = align ? placeX : options.direction === "left" ? x - options.indent : x + options.indent;
@@ -45362,7 +45564,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45362
45564
  childY,
45363
45565
  child262.node.id
45364
45566
  );
45365
- placeHangingTree(hc, child262, childX, options, cursor, void 0, level + 1);
45567
+ placeHangingTree(hc, child262, childX, options, cursor, void 0, level2 + 1);
45366
45568
  }
45367
45569
  }
45368
45570
  function placeHangingForest(hc, roots, startX, startY, options, rootSize) {
@@ -45447,17 +45649,17 @@ var init_smartart_hierarchy_hanging_box = __esm({
45447
45649
  DEFAULT_HANGING_VGAP_RATIO = 0.55;
45448
45650
  }
45449
45651
  });
45450
- function countRows(t, level, orgChart, fold) {
45652
+ function countRows(t, level2, orgChart, fold) {
45451
45653
  const { assistants, normal } = partitionChildren(t, orgChart);
45452
45654
  let count = 1 + assistants.length;
45453
45655
  if (normal.length === 0) {
45454
45656
  return count;
45455
45657
  }
45456
- if (fold && level >= 1) {
45658
+ if (fold && level2 >= 1) {
45457
45659
  return count;
45458
45660
  }
45459
45661
  for (const child262 of normal) {
45460
- count += countRows(child262, level + 1, orgChart, fold);
45662
+ count += countRows(child262, level2 + 1, orgChart, fold);
45461
45663
  }
45462
45664
  return count;
45463
45665
  }
@@ -46093,8 +46295,8 @@ function planFan(childCount, perRow, siblingCxs) {
46093
46295
  }
46094
46296
  return { columns: siblingCxs, overflow: childCount - siblingCxs.length };
46095
46297
  }
46096
- function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, options, placeAtFn) {
46097
- const fanCy = (level + 1) * cellH + cellH / 2;
46298
+ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAtFn) {
46299
+ const fanCy = (level2 + 1) * cellH + cellH / 2;
46098
46300
  const fanned = normal.slice(0, plan.columns.length);
46099
46301
  for (let i2 = 0; i2 < fanned.length; i2++) {
46100
46302
  const child262 = fanned[i2];
@@ -46108,7 +46310,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
46108
46310
  fanCy - hc.boxH / 2,
46109
46311
  child262.node.id
46110
46312
  );
46111
- placeAtFn(hc, child262, childCx, fanCy, 0, 1, level + 1, cellW, cellH, options);
46313
+ placeAtFn(hc, child262, childCx, fanCy, 0, 1, level2 + 1, cellW, cellH, options);
46112
46314
  }
46113
46315
  if (plan.overflow <= 0 || !options.hangingPlacer) {
46114
46316
  return;
@@ -46116,7 +46318,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
46116
46318
  const remainder = normal.slice(plan.columns.length);
46117
46319
  const columnOffset = hc.boxW * HIER_TAIL_OFFSET_RATIO;
46118
46320
  const anchorX = plan.columns[0] - hc.boxW / 2 + columnOffset;
46119
- const anchorY = (level + 2) * cellH;
46321
+ const anchorY = (level2 + 2) * cellH;
46120
46322
  for (const child262 of remainder) {
46121
46323
  elbowConnector(
46122
46324
  hc,
@@ -46158,7 +46360,7 @@ function placeAssistantRow(hc, parentId, cx, cy, assistants) {
46158
46360
  x += assistW + ASSISTANT_GAP;
46159
46361
  }
46160
46362
  }
46161
- function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW, cellH, options, placeChild) {
46363
+ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options, placeChild) {
46162
46364
  const siblingCxs = [];
46163
46365
  {
46164
46366
  let offset = xOffset;
@@ -46168,12 +46370,12 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46168
46370
  offset += childW;
46169
46371
  }
46170
46372
  }
46171
- const cascadeShift = options.cascadeOffsetX && level + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46373
+ const cascadeShift = options.cascadeOffsetX && level2 + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46172
46374
  let childOffset = xOffset;
46173
46375
  for (const child262 of normal) {
46174
46376
  const childW = spanOf(child262, options);
46175
46377
  const childCx = (childOffset + childW / 2) * cellW + cascadeShift;
46176
- const childCy = (level + 1) * cellH + cellH / 2;
46378
+ const childCy = (level2 + 1) * cellH + cellH / 2;
46177
46379
  elbowConnector(
46178
46380
  hc,
46179
46381
  parentId,
@@ -46190,7 +46392,7 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46190
46392
  childCy,
46191
46393
  childOffset,
46192
46394
  childW,
46193
- level + 1,
46395
+ level2 + 1,
46194
46396
  cellW,
46195
46397
  cellH,
46196
46398
  options,
@@ -46222,13 +46424,13 @@ function wrappedGroupSlotCount(group2, orgChart) {
46222
46424
  }
46223
46425
  return group2.members.reduce((sum, m) => sum + effectiveWidth(m, orgChart), 0);
46224
46426
  }
46225
- function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, level, cellW, cellH, options, placeAtFn) {
46427
+ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options, placeAtFn) {
46226
46428
  const groups = planWrappedGroups(normal, options.perRow, options.orgChart);
46227
46429
  const totalSlots = groups.reduce((sum, g2) => sum + wrappedGroupSlotCount(g2, options.orgChart), 0);
46228
46430
  const totalW = spanW * cellW;
46229
46431
  const leftX = xOffset * cellW;
46230
46432
  const unitW = totalW / Math.max(1, totalSlots);
46231
- const rowCy = (level + 1) * cellH + cellH / 2;
46433
+ const rowCy = (level2 + 1) * cellH + cellH / 2;
46232
46434
  let slot = 0;
46233
46435
  for (const group2 of groups) {
46234
46436
  slot = group2.fansAsRow ? placeRowFanGroup(
@@ -46241,7 +46443,7 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
46241
46443
  unitW,
46242
46444
  slot,
46243
46445
  rowCy,
46244
- level,
46446
+ level2,
46245
46447
  cellW,
46246
46448
  cellH,
46247
46449
  options,
@@ -46258,25 +46460,25 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
46258
46460
  rowCy,
46259
46461
  cellW,
46260
46462
  cellH,
46261
- level,
46463
+ level2,
46262
46464
  options,
46263
46465
  placeAtFn
46264
46466
  );
46265
46467
  }
46266
46468
  }
46267
- function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, level, cellW, cellH, options, placeAtFn) {
46469
+ function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, level2, cellW, cellH, options, placeAtFn) {
46268
46470
  let cursor = slot;
46269
46471
  for (const child262 of group2.members) {
46270
46472
  const childW = effectiveWidth(child262, options.orgChart);
46271
46473
  const childCx = leftX + unitW * (cursor + childW / 2);
46272
46474
  elbowConnector(hc, parentId, cx, cy + hc.boxH / 2, childCx, rowCy - hc.boxH / 2, child262.node.id);
46273
46475
  const virtualOffset = childCx / cellW - childW / 2;
46274
- placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW, level + 1, cellW, cellH, options);
46476
+ placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
46275
46477
  cursor += childW;
46276
46478
  }
46277
46479
  return cursor;
46278
46480
  }
46279
- function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH, level, options, placeAtFn) {
46481
+ function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH, level2, options, placeAtFn) {
46280
46482
  const groupCx = leftX + unitW * (slot + 0.5);
46281
46483
  const subRowH = cellH / group2.members.length;
46282
46484
  let fromId = parentId;
@@ -46288,7 +46490,7 @@ function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowC
46288
46490
  elbowConnector(hc, fromId, fromX, fromY, groupCx, childCy - hc.boxH / 2, child262.node.id);
46289
46491
  const childW = effectiveWidth(child262, options.orgChart);
46290
46492
  const virtualOffset = groupCx / cellW - childW / 2;
46291
- placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW, level + 1, cellW, cellH, options);
46493
+ placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
46292
46494
  fromId = child262.node.id;
46293
46495
  fromX = groupCx;
46294
46496
  fromY = childCy + hc.boxH / 2;
@@ -46301,7 +46503,7 @@ var init_smartart_hierarchy_wrapped_groups = __esm({
46301
46503
  init_smartart_hierarchy_shared();
46302
46504
  }
46303
46505
  });
46304
- function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level, cellW, cellH, options) {
46506
+ function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options) {
46305
46507
  placeFlatChildren(
46306
46508
  hc,
46307
46509
  parentId,
@@ -46309,14 +46511,14 @@ function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46309
46511
  cx,
46310
46512
  cy,
46311
46513
  xOffset,
46312
- level,
46514
+ level2,
46313
46515
  cellW,
46314
46516
  cellH,
46315
46517
  options,
46316
46518
  placeAt
46317
46519
  );
46318
46520
  }
46319
- function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, level, cellW, cellH, options) {
46521
+ function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options) {
46320
46522
  placeWrappedChildren(
46321
46523
  hc,
46322
46524
  parentId,
@@ -46325,32 +46527,32 @@ function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, lev
46325
46527
  cy,
46326
46528
  xOffset,
46327
46529
  spanW,
46328
- level,
46530
+ level2,
46329
46531
  cellW,
46330
46532
  cellH,
46331
46533
  options,
46332
46534
  placeAt
46333
46535
  );
46334
46536
  }
46335
- function placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options, siblingCxs) {
46537
+ function placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options, siblingCxs) {
46336
46538
  pushNode(hc, t.node, cx - hc.boxW / 2, cy - hc.boxH / 2);
46337
46539
  const { assistants, normal } = partitionChildren(t, options.orgChart);
46338
46540
  placeAssistantRow(hc, t.node.id, cx, cy, assistants);
46339
46541
  if (normal.length === 0) {
46340
46542
  return;
46341
46543
  }
46342
- if (options.foldDeeperGenerations && level >= 1) {
46544
+ if (options.foldDeeperGenerations && level2 >= 1) {
46343
46545
  return;
46344
46546
  }
46345
- if (options.hangingPlacer && level >= 1) {
46547
+ if (options.hangingPlacer && level2 >= 1) {
46346
46548
  const plan = planFan(normal.length, options.perRow, siblingCxs);
46347
46549
  if (plan) {
46348
- placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, options, placeAt);
46550
+ placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAt);
46349
46551
  return;
46350
46552
  }
46351
46553
  const isSoloChainLink = !siblingCxs || siblingCxs.length === 1;
46352
46554
  if (isSoloChainLink && normal.length > 1 && spanW === normal.length) {
46353
- placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level, cellW, cellH, options);
46555
+ placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
46354
46556
  return;
46355
46557
  }
46356
46558
  const anchorY = cy + hc.boxH / 2 + (options.hangHeightRatio ?? HANG_HEIGHT_RATIO) * hc.boxH;
@@ -46378,21 +46580,21 @@ function placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options, si
46378
46580
  cy,
46379
46581
  xOffset,
46380
46582
  spanW,
46381
- level,
46583
+ level2,
46382
46584
  cellW,
46383
46585
  cellH,
46384
46586
  options
46385
46587
  );
46386
46588
  } else {
46387
- placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level, cellW, cellH, options);
46589
+ placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
46388
46590
  }
46389
46591
  }
46390
- function placeStandardTree(hc, t, xOffset, level, cellW, cellH, options) {
46592
+ function placeStandardTree(hc, t, xOffset, level2, cellW, cellH, options) {
46391
46593
  const spanW = spanOf(t, options);
46392
- const cascadeShift = options.cascadeOffsetX && level >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46594
+ const cascadeShift = options.cascadeOffsetX && level2 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46393
46595
  const cx = (xOffset + spanW / 2) * cellW + cascadeShift;
46394
- const cy = level * cellH + cellH / 2;
46395
- placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options);
46596
+ const cy = level2 * cellH + cellH / 2;
46597
+ placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options);
46396
46598
  }
46397
46599
  var init_smartart_hierarchy_standard = __esm({
46398
46600
  "src/core/utils/smartart-hierarchy-standard.ts"() {
@@ -48054,10 +48256,10 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48054
48256
  const boxH = Math.min(cellH * 0.35, 28);
48055
48257
  const elements2 = [];
48056
48258
  let colourIdx = 0;
48057
- function walk3(t, xOffset, level) {
48259
+ function walk3(t, xOffset, level2) {
48058
48260
  const w = treeWidth(t);
48059
48261
  const cx = bounds.x + padding + (xOffset + w / 2) * cellW;
48060
- const cy = bounds.y + padding + level * cellH + cellH / 2;
48262
+ const cy = bounds.y + padding + level2 * cellH + cellH / 2;
48061
48263
  const ci = colourIdx++;
48062
48264
  const fill = accentColor(ci, themeColorMap);
48063
48265
  elements2.push(
@@ -48080,7 +48282,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48080
48282
  for (const child262 of t.children) {
48081
48283
  const childW = treeWidth(child262);
48082
48284
  const childCx = bounds.x + padding + (childOffset + childW / 2) * cellW;
48083
- const childCy = bounds.y + padding + (level + 1) * cellH + cellH / 2;
48285
+ const childCy = bounds.y + padding + (level2 + 1) * cellH + cellH / 2;
48084
48286
  elements2.push(
48085
48287
  makeConnectorElement(
48086
48288
  nextId("sa-hier-conn"),
@@ -48091,7 +48293,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48091
48293
  lighten(fill, 0.5)
48092
48294
  )
48093
48295
  );
48094
- walk3(child262, childOffset, level + 1);
48296
+ walk3(child262, childOffset, level2 + 1);
48095
48297
  childOffset += childW;
48096
48298
  }
48097
48299
  return w;
@@ -49076,10 +49278,15 @@ function buildSmartArtColorRoleMap(styleLbls, deps) {
49076
49278
  const map = {};
49077
49279
  for (const lbl of styleLbls) {
49078
49280
  const parsed = parseLabel(lbl, deps);
49079
- if (!parsed.name || parsed.fill.length === 0 && parsed.line.length === 0) {
49281
+ const hasText = parsed.textFill.length > 0;
49282
+ if (!parsed.name || parsed.fill.length === 0 && parsed.line.length === 0 && !hasText) {
49080
49283
  continue;
49081
49284
  }
49082
- map[parsed.name] = { fill: parsed.fill, line: parsed.line };
49285
+ map[parsed.name] = {
49286
+ fill: parsed.fill,
49287
+ line: parsed.line,
49288
+ ...hasText ? { textFill: parsed.textFill } : {}
49289
+ };
49083
49290
  }
49084
49291
  return map;
49085
49292
  }
@@ -55174,10 +55381,10 @@ function parseCxRegionMapOptions(series, dataNode, xmlLookup, colorParser) {
55174
55381
  }
55175
55382
  function readIndexedDimension(dataNode, kind, type, xmlLookup) {
55176
55383
  const dimension = xmlLookup.getChildrenArrayByLocalName(dataNode, kind).find((candidate) => String(candidate["@_type"] ?? "") === type);
55177
- const level = xmlLookup.getChildByLocalName(dimension, "lvl");
55384
+ const level2 = xmlLookup.getChildByLocalName(dimension, "lvl");
55178
55385
  const values = [];
55179
55386
  const indices = [];
55180
- for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(level, "pt").entries()) {
55387
+ for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(level2, "pt").entries()) {
55181
55388
  const raw = xmlLookup.getScalarChildByLocalName(point, "v") ?? point["#text"];
55182
55389
  values.push(String(raw ?? "").trim());
55183
55390
  const parsed = Number.parseInt(String(point["@_idx"] ?? position2), 10);
@@ -55314,7 +55521,7 @@ function parseCxChartSeries(plotArea, xmlLookup, chartSpace, chartRoot, colorPar
55314
55521
  if (serIndex === 0) {
55315
55522
  const catDimLevels = strDims.get("cat") ?? strDims.values().next().value;
55316
55523
  if (catDimLevels) {
55317
- categoryLevels = catDimLevels.map((level) => [...level]);
55524
+ categoryLevels = catDimLevels.map((level2) => [...level2]);
55318
55525
  for (const val2 of catDimLevels[0] ?? []) {
55319
55526
  if (val2) {
55320
55527
  categories.push(val2);
@@ -63942,6 +64149,10 @@ function buildFabricatedDrawingXml(shapes, nodes, presentationGuidByNodeId) {
63942
64149
  return `${XML_PROLOG}\r
63943
64150
  <dsp:drawing ${DSP_XMLNS}><dsp:spTree><dsp:nvGrpSpPr><dsp:cNvPr id="0" name=""/><dsp:cNvGrpSpPr/></dsp:nvGrpSpPr><dsp:grpSpPr/>${body}</dsp:spTree></dsp:drawing>`;
63944
64151
  }
64152
+ function withStyleLabel(element) {
64153
+ const styleLabel = smartArtElementStyleLabel(element);
64154
+ return styleLabel ? { styleLabel } : {};
64155
+ }
63945
64156
  function smartArtElementsToDrawingShapes(elements2) {
63946
64157
  if (!elements2 || elements2.length === 0) {
63947
64158
  return [];
@@ -63984,7 +64195,8 @@ function smartArtElementsToDrawingShapes(elements2) {
63984
64195
  fontColor: shape.textStyle?.color,
63985
64196
  ...shape.shapeStyle?.scene3d ? { scene3d: shape.shapeStyle.scene3d } : {},
63986
64197
  ...shape.shapeStyle?.shape3d ? { shape3d: shape.shapeStyle.shape3d } : {},
63987
- ...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {}
64198
+ ...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {},
64199
+ ...withStyleLabel(el)
63988
64200
  });
63989
64201
  }
63990
64202
  return shapes;
@@ -63999,6 +64211,7 @@ var init_smartart_fabrication_drawing = __esm({
63999
64211
  init_constants();
64000
64212
  init_custom_geometry();
64001
64213
  init_custom_geometry_command_order();
64214
+ init_smartart_element_style_label();
64002
64215
  init_smartart_fabrication_3d();
64003
64216
  init_smartart_fabrication_data();
64004
64217
  init_smartart_fabrication_text();
@@ -64070,6 +64283,10 @@ function applySmartArtQuickStyle3d(shapes, data) {
64070
64283
  const nodeLabels = resolveNodeLabels(data.nodes);
64071
64284
  const fallback = labelsByName.get(PRIMARY_STYLE_LABEL) ?? labelsByName.get(nodeLabels.values().next().value ?? "");
64072
64285
  return shapes.map((shape) => {
64286
+ const own = shape.styleLabel ? labelsByName.get(shape.styleLabel) : void 0;
64287
+ if (own || shape.styleLabel) {
64288
+ return own ? withLabel3d(shape, own) : shape;
64289
+ }
64073
64290
  const nodeId = nodeIdForShape(shape.id, data.nodes);
64074
64291
  const labelName = nodeId ? nodeLabels.get(nodeId) : void 0;
64075
64292
  const label = (labelName ? labelsByName.get(labelName) : void 0) ?? fallback;
@@ -68722,17 +68939,17 @@ var init_placeholder_level_style_serializer = __esm({
68722
68939
  FILL_VARIANTS = ["a:noFill", "a:gradFill", "a:blipFill", "a:pattFill", "a:grpFill"];
68723
68940
  }
68724
68941
  });
68725
- function levelXmlKey(level) {
68726
- return level === -1 ? "a:defPPr" : `a:lvl${level + 1}pPr`;
68942
+ function levelXmlKey(level2) {
68943
+ return level2 === -1 ? "a:defPPr" : `a:lvl${level2 + 1}pPr`;
68727
68944
  }
68728
68945
  function serializeTextStyleLevels(levels, existing) {
68729
68946
  const childEdits = /* @__PURE__ */ new Map();
68730
68947
  for (const [key2, style] of Object.entries(levels)) {
68731
- const level = Number(key2);
68732
- if (!Number.isFinite(level)) {
68948
+ const level2 = Number(key2);
68949
+ if (!Number.isFinite(level2)) {
68733
68950
  continue;
68734
68951
  }
68735
- const xmlKey = levelXmlKey(level);
68952
+ const xmlKey = levelXmlKey(level2);
68736
68953
  childEdits.set(
68737
68954
  xmlKey,
68738
68955
  serializePlaceholderLevelStyle(style, existing?.[xmlKey])
@@ -78113,10 +78330,10 @@ function parseOleChartElement(shape) {
78113
78330
  if (!oleChartEl || oleChartEl["@_type"] === void 0) {
78114
78331
  return void 0;
78115
78332
  }
78116
- const level = oleChartEl["@_lvl"] !== void 0 ? Number(oleChartEl["@_lvl"]) : void 0;
78333
+ const level2 = oleChartEl["@_lvl"] !== void 0 ? Number(oleChartEl["@_lvl"]) : void 0;
78117
78334
  return {
78118
78335
  subelementType: String(oleChartEl["@_type"]),
78119
- ...level !== void 0 && !Number.isNaN(level) ? { level } : {}
78336
+ ...level2 !== void 0 && !Number.isNaN(level2) ? { level: level2 } : {}
78120
78337
  };
78121
78338
  }
78122
78339
  var init_animation_target_graphic_el = __esm({
@@ -78687,9 +78904,9 @@ function extractBldPTemplates(bldP) {
78687
78904
  continue;
78688
78905
  }
78689
78906
  const levelRaw = tmpl["@_lvl"];
78690
- const level = levelRaw !== void 0 ? Number.parseInt(String(levelRaw), 10) : 0;
78907
+ const level2 = levelRaw !== void 0 ? Number.parseInt(String(levelRaw), 10) : 0;
78691
78908
  result.push({
78692
- level: Number.isFinite(level) ? level : 0,
78909
+ level: Number.isFinite(level2) ? level2 : 0,
78693
78910
  timeNodeList: tnLst,
78694
78911
  rawXml: tmpl
78695
78912
  });
@@ -104466,6 +104683,113 @@ var init_chart_multi_level_category_parser = __esm({
104466
104683
  "src/core/utils/chart-multi-level-category-parser.ts"() {
104467
104684
  }
104468
104685
  });
104686
+ function prSetOf(pt2, localName292) {
104687
+ const key2 = Object.keys(pt2).find((candidate) => localName292(candidate) === "prSet");
104688
+ const value = key2 ? pt2[key2] : void 0;
104689
+ return Array.isArray(value) ? value[0] : value;
104690
+ }
104691
+ function readPresPoints(points4, localName292) {
104692
+ const byId = /* @__PURE__ */ new Map();
104693
+ for (const pt2 of points4) {
104694
+ if (!pt2 || typeof pt2 !== "object" || String(pt2["@_type"] ?? "").trim() !== "pres") {
104695
+ continue;
104696
+ }
104697
+ const id = String(pt2["@_modelId"] ?? "").trim();
104698
+ const prSet = prSetOf(pt2, localName292);
104699
+ if (!id || !prSet) {
104700
+ continue;
104701
+ }
104702
+ const styleIndex2 = Number(prSet["@_presStyleIdx"] ?? 0);
104703
+ byId.set(id, {
104704
+ id,
104705
+ name: String(prSet["@_presName"] ?? "").trim(),
104706
+ styleLabel: String(prSet["@_presStyleLbl"] ?? "").trim(),
104707
+ styleIndex: Number.isFinite(styleIndex2) && styleIndex2 > 0 ? Math.floor(styleIndex2) : 0,
104708
+ assocId: String(prSet["@_presAssocID"] ?? "").trim()
104709
+ });
104710
+ }
104711
+ return byId;
104712
+ }
104713
+ function algorithmByLayoutNodeName(root) {
104714
+ const byName = /* @__PURE__ */ new Map();
104715
+ const stack = root ? [root] : [];
104716
+ while (stack.length > 0) {
104717
+ const node = stack.pop();
104718
+ if (node.name && node.algorithm?.type && !byName.has(node.name)) {
104719
+ byName.set(node.name, node.algorithm.type);
104720
+ }
104721
+ stack.push(...node.children ?? []);
104722
+ }
104723
+ return byName;
104724
+ }
104725
+ function resolveSmartArtMergedTextLabels(points4, connections, layout, localName292) {
104726
+ const result = /* @__PURE__ */ new Map();
104727
+ const algorithms = algorithmByLayoutNodeName(layout?.rootNode);
104728
+ const presPoints = readPresPoints(points4, localName292);
104729
+ if (algorithms.size === 0 || presPoints.size === 0) {
104730
+ return result;
104731
+ }
104732
+ const presented = /* @__PURE__ */ new Set();
104733
+ const childrenByParent = /* @__PURE__ */ new Map();
104734
+ for (const connection of connections) {
104735
+ if (connection.type === "presOf") {
104736
+ presented.add(connection.destId);
104737
+ } else if (connection.type === "presParOf") {
104738
+ const siblings = childrenByParent.get(connection.sourceId) ?? [];
104739
+ siblings.push(connection.destId);
104740
+ childrenByParent.set(connection.sourceId, siblings);
104741
+ }
104742
+ }
104743
+ for (const siblingIds of childrenByParent.values()) {
104744
+ const siblings = siblingIds.map((id) => presPoints.get(id)).filter((pt2) => Boolean(pt2?.styleLabel && presented.has(pt2.id)));
104745
+ const texts = siblings.filter((pt2) => algorithms.get(pt2.name) === "tx");
104746
+ for (const shape of siblings) {
104747
+ if (algorithms.get(shape.name) === "tx" || result.has(shape.id)) {
104748
+ continue;
104749
+ }
104750
+ const text22 = texts.find(
104751
+ (pt2) => pt2.assocId === shape.assocId && pt2.styleLabel !== shape.styleLabel
104752
+ );
104753
+ if (text22) {
104754
+ result.set(shape.id, {
104755
+ styleLabel: text22.styleLabel,
104756
+ styleIndex: text22.styleIndex,
104757
+ textPointId: text22.id
104758
+ });
104759
+ }
104760
+ }
104761
+ }
104762
+ return result;
104763
+ }
104764
+ function smartArtMergedTextColor(label, textFillByLabel) {
104765
+ const list2 = textFillByLabel?.[label.styleLabel]?.textFill;
104766
+ if (!list2 || list2.length === 0) {
104767
+ return void 0;
104768
+ }
104769
+ return list2[label.styleIndex % list2.length];
104770
+ }
104771
+ function resolveSmartArtMergedTextColors(points4, connections, layout, textFillByLabel, localName292) {
104772
+ const colors = /* @__PURE__ */ new Map();
104773
+ if (!textFillByLabel) {
104774
+ return colors;
104775
+ }
104776
+ for (const [shapeId, label] of resolveSmartArtMergedTextLabels(
104777
+ points4,
104778
+ connections,
104779
+ layout,
104780
+ localName292
104781
+ )) {
104782
+ const color2 = smartArtMergedTextColor(label, textFillByLabel);
104783
+ if (color2) {
104784
+ colors.set(shapeId, color2);
104785
+ }
104786
+ }
104787
+ return colors;
104788
+ }
104789
+ var init_smartart_merged_text_label = __esm({
104790
+ "src/core/utils/smartart-merged-text-label.ts"() {
104791
+ }
104792
+ });
104469
104793
  function children12(node, name, localName292) {
104470
104794
  if (!node) {
104471
104795
  return [];
@@ -105965,21 +106289,21 @@ var init_text_body_has_content = __esm({
105965
106289
  function createAutoNumberSequence() {
105966
106290
  return { levels: /* @__PURE__ */ new Map() };
105967
106291
  }
105968
- function forgetFromLevel(sequence, level) {
106292
+ function forgetFromLevel(sequence, level2) {
105969
106293
  for (const recorded of sequence.levels.keys()) {
105970
- if (recorded >= level) {
106294
+ if (recorded >= level2) {
105971
106295
  sequence.levels.delete(recorded);
105972
106296
  }
105973
106297
  }
105974
106298
  }
105975
- function breakAutoNumberRun(sequence, level) {
105976
- forgetFromLevel(sequence, level);
106299
+ function breakAutoNumberRun(sequence, level2) {
106300
+ forgetFromLevel(sequence, level2);
105977
106301
  }
105978
- function nextAutoNumber(sequence, level, scheme, startAt) {
105979
- const running = sequence.levels.get(level);
106302
+ function nextAutoNumber(sequence, level2, scheme, startAt) {
106303
+ const running = sequence.levels.get(level2);
105980
106304
  const ordinal = running && running.scheme === scheme ? running.ordinal + 1 : startAt;
105981
- forgetFromLevel(sequence, level + 1);
105982
- sequence.levels.set(level, { scheme, ordinal });
106305
+ forgetFromLevel(sequence, level2 + 1);
106306
+ sequence.levels.set(level2, { scheme, ordinal });
105983
106307
  return ordinal;
105984
106308
  }
105985
106309
  var init_auto_number_sequence = __esm({
@@ -108690,7 +109014,7 @@ function masterStyleFonts(styles) {
108690
109014
  if (!styles) {
108691
109015
  return [];
108692
109016
  }
108693
- return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level) => level.run.fontName).filter((name) => Boolean(name));
109017
+ return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level2) => level2.run.fontName).filter((name) => Boolean(name));
108694
109018
  }
108695
109019
  var PPT_MASTER_LEVELS;
108696
109020
  var TITLE_LEVELS;
@@ -110376,8 +110700,8 @@ function textSpecInfo(count) {
110376
110700
  function promptText(textType, paragraphs2) {
110377
110701
  const text22 = paragraphs2.join("\r");
110378
110702
  const levels = new ByteWriter();
110379
- paragraphs2.forEach((para, level) => {
110380
- levels.u32(para.length + 1).u16(level);
110703
+ paragraphs2.forEach((para, level2) => {
110704
+ levels.u32(para.length + 1).u16(level2);
110381
110705
  });
110382
110706
  return new ByteWriter().bytes(textHeader(textType)).bytes(atom(RT.TextBytesAtom, new ByteWriter().ansi(text22).toBytes())).bytes(atom(RT.MasterTextPropAtom, levels.toBytes())).bytes(textSpecInfo(text22.length + 1)).toBytes();
110383
110707
  }
@@ -110543,9 +110867,9 @@ var init_master_placeholders_writer = __esm({
110543
110867
  });
110544
110868
  function buildMasterStyleAtom(recInstance, levels, fontIndex) {
110545
110869
  const w = new ByteWriter().u16(levels.length);
110546
- for (const level of levels) {
110547
- writePfException(w, level.paragraph);
110548
- writeCfException(w, level.run, fontIndex);
110870
+ for (const level2 of levels) {
110871
+ writePfException(w, level2.paragraph);
110872
+ writeCfException(w, level2.run, fontIndex);
110549
110873
  }
110550
110874
  return record(RT.TextMasterStyleAtom, w.toBytes(), recInstance, false, 0);
110551
110875
  }
@@ -111601,11 +111925,11 @@ function levelsFor(styles, textType) {
111601
111925
  return void 0;
111602
111926
  }
111603
111927
  }
111604
- function relativiseParagraph(para, level) {
111928
+ function relativiseParagraph(para, level2) {
111605
111929
  const runs = para.runs.map((run) => {
111606
111930
  const out = { ...run };
111607
111931
  for (const key2 of STYLE_KEYS) {
111608
- const inherited = level?.run[key2] ?? false;
111932
+ const inherited = level2?.run[key2] ?? false;
111609
111933
  if (out[key2] !== void 0 && out[key2] === inherited) {
111610
111934
  delete out[key2];
111611
111935
  }
@@ -112238,9 +112562,9 @@ function buildChartExData(chartData, series, id) {
112238
112562
  const stringDimensions = [
112239
112563
  {
112240
112564
  "@_type": "cat",
112241
- "cx:lvl": categoryLevels.map((level) => ({
112242
- "@_ptCount": String(level.length),
112243
- "cx:pt": chartData.chartType === "regionMap" && level === categoryLevels[0] ? indexedPoints(level, regionOptions?.categorySourceIndices) : points(level)
112565
+ "cx:lvl": categoryLevels.map((level2) => ({
112566
+ "@_ptCount": String(level2.length),
112567
+ "cx:pt": chartData.chartType === "regionMap" && level2 === categoryLevels[0] ? indexedPoints(level2, regionOptions?.categorySourceIndices) : points(level2)
112244
112568
  }))
112245
112569
  }
112246
112570
  ];
@@ -115833,10 +116157,10 @@ function replaceLevels(target, source, getLocalName2) {
115833
116157
  const targetKey = findKey26(target, "lvl", getLocalName2) ?? "cx:lvl";
115834
116158
  const sourceKey = findKey26(source, "lvl", getLocalName2);
115835
116159
  const oldLevels = asArray4(target[targetKey]);
115836
- const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level, index) => {
116160
+ const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level2, index) => {
115837
116161
  const old = oldLevels[index];
115838
116162
  if (!old) {
115839
- return level;
116163
+ return level2;
115840
116164
  }
115841
116165
  const merged = {};
115842
116166
  for (const key2 of Object.keys(old)) {
@@ -115844,7 +116168,7 @@ function replaceLevels(target, source, getLocalName2) {
115844
116168
  merged[key2] = old[key2];
115845
116169
  }
115846
116170
  }
115847
- return { ...level, ...merged };
116171
+ return { ...level2, ...merged };
115848
116172
  });
115849
116173
  target[targetKey] = newLevels.length === 1 ? newLevels[0] : newLevels;
115850
116174
  }
@@ -118025,18 +118349,18 @@ var init_uniform_segment_overrides = __esm({
118025
118349
  "src/core/core/runtime/uniform-segment-overrides.ts"() {
118026
118350
  }
118027
118351
  });
118028
- function authoredPropertyGate(authoredProperties, level) {
118352
+ function authoredPropertyGate(authoredProperties, level2) {
118029
118353
  if (authoredProperties) {
118030
118354
  return (key2) => authoredProperties[key2] !== void 0;
118031
118355
  }
118032
- const isNested = typeof level === "number" && Number.isFinite(level) && level > 0;
118356
+ const isNested = typeof level2 === "number" && Number.isFinite(level2) && level2 > 0;
118033
118357
  return () => !isNested;
118034
118358
  }
118035
- function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing, level, authoredProperties) {
118359
+ function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing, level2, authoredProperties) {
118036
118360
  const paragraphProps = {};
118037
- const owns = authoredPropertyGate(authoredProperties, level);
118038
- if (typeof level === "number" && Number.isFinite(level) && level >= 0) {
118039
- paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(level), 0), 8));
118361
+ const owns = authoredPropertyGate(authoredProperties, level2);
118362
+ if (typeof level2 === "number" && Number.isFinite(level2) && level2 >= 0) {
118363
+ paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(level2), 0), 8));
118040
118364
  }
118041
118365
  if (paragraphAlign && owns("align")) {
118042
118366
  paragraphProps["@_algn"] = paragraphAlign;
@@ -123346,7 +123670,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
123346
123670
  PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
123347
123671
  createParagraphsFromTextContent(text22, textStyle, textSegments, resolveHyperlinkRelationshipId) {
123348
123672
  const runScopedTextStyle = toRunScopedTextStyle(textStyle);
123349
- const createParagraph = (runs, bulletInfo, level, endParaRunProperties, paragraphProperties2, markup) => {
123673
+ const createParagraph = (runs, bulletInfo, level2, endParaRunProperties, paragraphProperties2, markup) => {
123350
123674
  const effectiveStyle = paragraphProperties2 ? { ...textStyle, ...paragraphProperties2 } : textStyle;
123351
123675
  const paragraphAlign = this.textAlignToDrawingValue(effectiveStyle?.align);
123352
123676
  const spacing = {
@@ -123360,7 +123684,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
123360
123684
  paragraphAlign,
123361
123685
  bulletInfo,
123362
123686
  spacing,
123363
- level,
123687
+ level2,
123364
123688
  paragraphProperties2
123365
123689
  );
123366
123690
  return assembleParagraphXml(runs, paragraphProps, endParaRunProperties, markup);
@@ -129211,20 +129535,20 @@ var init_smartart_colors_builder = __esm({
129211
129535
  ]);
129212
129536
  }
129213
129537
  });
129214
- function prSetOf(pt2) {
129538
+ function prSetOf2(pt2) {
129215
129539
  const prSet = pt2["dgm:prSet"];
129216
129540
  return prSet && typeof prSet === "object" && !Array.isArray(prSet) ? prSet : {};
129217
129541
  }
129218
129542
  function findPresPointForAssoc(pts, assocId) {
129219
129543
  return pts.find(
129220
- (pt2) => pt2["@_type"] === "pres" && String(prSetOf(pt2)["@_presAssocID"] || "") === assocId
129544
+ (pt2) => pt2["@_type"] === "pres" && String(prSetOf2(pt2)["@_presAssocID"] || "") === assocId
129221
129545
  );
129222
129546
  }
129223
129547
  function maxPresParOfOrd(cxns, srcId) {
129224
129548
  return cxns.filter((c) => c["@_type"] === "presParOf" && c["@_srcId"] === srcId).reduce((max, c) => Math.max(max, parseInt(String(c["@_srcOrd"] ?? ""), 10) || 0), -1);
129225
129549
  }
129226
129550
  function countNodePresPoints(pts) {
129227
- return pts.filter((pt2) => pt2["@_type"] === "pres" && prSetOf(pt2)["@_presName"] === "node").length;
129551
+ return pts.filter((pt2) => pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node").length;
129228
129552
  }
129229
129553
  function emptyTextBody() {
129230
129554
  return { "a:bodyPr": {}, "a:lstStyle": {}, "a:p": { "a:endParaRPr": { "@_lang": "en-US" } } };
@@ -129334,8 +129658,8 @@ function synthesizeNewSmartArtStructuralPoints(existingPts, existingCxns, nodes,
129334
129658
  pts.push(buildPresSibTransPoint(presSibTransId, sibTransId));
129335
129659
  const total = idx + 1;
129336
129660
  for (const pt2 of pts) {
129337
- if (pt2["@_type"] === "pres" && prSetOf(pt2)["@_presName"] === "node") {
129338
- prSetOf(pt2)["@_presStyleCnt"] = String(total);
129661
+ if (pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node") {
129662
+ prSetOf2(pt2)["@_presStyleCnt"] = String(total);
129339
129663
  }
129340
129664
  }
129341
129665
  const srcOrd = connectionByChildId.get(node.id)?.srcOrd ?? 0;
@@ -138255,8 +138579,8 @@ var init_PptxHandlerRuntimePlaceholderLookup = __esm({
138255
138579
  mergePlaceholderLevelStyles(base, override) {
138256
138580
  const merged = {};
138257
138581
  for (const key2 of /* @__PURE__ */ new Set([...Object.keys(base ?? {}), ...Object.keys(override ?? {})])) {
138258
- const level = Number.parseInt(key2, 10);
138259
- merged[level] = { ...base?.[level], ...override?.[level] };
138582
+ const level2 = Number.parseInt(key2, 10);
138583
+ merged[level2] = { ...base?.[level2], ...override?.[level2] };
138260
138584
  }
138261
138585
  return merged;
138262
138586
  }
@@ -139168,8 +139492,8 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
139168
139492
  ...paragraphProps?.["a:buSzTx"] !== void 0 ? { sizeInherit: true } : {}
139169
139493
  };
139170
139494
  }
139171
- const level = Number.parseInt(String(paragraphProps?.["@_lvl"] || "0"), 10);
139172
- const normalizedLevel = Number.isFinite(level) ? Math.min(Math.max(level + 1, 1), 9) : 1;
139495
+ const level2 = Number.parseInt(String(paragraphProps?.["@_lvl"] || "0"), 10);
139496
+ const normalizedLevel = Number.isFinite(level2) ? Math.min(Math.max(level2 + 1, 1), 9) : 1;
139173
139497
  const levelKey = `a:lvl${normalizedLevel}pPr`;
139174
139498
  const inheritedLevelProps = xmlChild(xmlChild(inheritedTxBody, "a:lstStyle"), levelKey);
139175
139499
  const bodyLevelProps = xmlChild(xmlChild(txBody, "a:lstStyle"), levelKey);
@@ -139730,8 +140054,8 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139730
140054
  p["a:pPr"]
139731
140055
  );
139732
140056
  const parsedLevel = Number.parseInt(String(directPPr?.["@_lvl"] ?? "0"), 10);
139733
- const level = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
139734
- const levelKey = `a:lvl${level + 1}pPr`;
140057
+ const level2 = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
140058
+ const levelKey = `a:lvl${level2 + 1}pPr`;
139735
140059
  const ownLstStyle = ctx.txBody?.["a:lstStyle"];
139736
140060
  const inheritedLstStyle = ctx.inheritedTxBody?.["a:lstStyle"];
139737
140061
  const lstStyleParagraphDefaults = this.mergeXmlObjects(
@@ -139749,7 +140073,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139749
140073
  if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
139750
140074
  textStyle.rtl = paragraphRtl;
139751
140075
  }
139752
- const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[level]?.alignment ?? ctx.effectiveLevelStyles?.[-1]?.alignment;
140076
+ const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[level2]?.alignment ?? ctx.effectiveLevelStyles?.[-1]?.alignment;
139753
140077
  const paraAlign = resolveParagraphAlignment(
139754
140078
  pPr?.["@_algn"],
139755
140079
  ownPlaceholderAlignment,
@@ -139877,7 +140201,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139877
140201
  mergedDefaultRunStyle.fontFamily = ctx.styleFontRefTypeface;
139878
140202
  }
139879
140203
  if (ctx.effectiveLevelStyles) {
139880
- const phLevel = ctx.effectiveLevelStyles[level];
140204
+ const phLevel = ctx.effectiveLevelStyles[level2];
139881
140205
  const phBase = ctx.effectiveLevelStyles[-1];
139882
140206
  const runOwnRtl = mergedDefaultRunStyle.rtl;
139883
140207
  if (phLevel) {
@@ -139897,7 +140221,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139897
140221
  let effectiveMarginLeft = parMarginLeft;
139898
140222
  let effectiveIndent = parIndent;
139899
140223
  if (ctx.effectiveLevelStyles) {
139900
- const phLevel = ctx.effectiveLevelStyles[level];
140224
+ const phLevel = ctx.effectiveLevelStyles[level2];
139901
140225
  const phBase = ctx.effectiveLevelStyles[-1];
139902
140226
  if (effectiveMarginLeft === void 0) {
139903
140227
  effectiveMarginLeft = phLevel?.marginLeft ?? phBase?.marginLeft;
@@ -143271,12 +143595,12 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
143271
143595
  return;
143272
143596
  }
143273
143597
  const levelStyles = {};
143274
- for (let level = 1; level <= 9; level++) {
143598
+ for (let level2 = 1; level2 <= 9; level2++) {
143275
143599
  const parsed = this.parsePlaceholderLevelStyle(
143276
- defaultTextStyle[`a:lvl${level}pPr`]
143600
+ defaultTextStyle[`a:lvl${level2}pPr`]
143277
143601
  );
143278
143602
  if (parsed) {
143279
- levelStyles[level - 1] = parsed;
143603
+ levelStyles[level2 - 1] = parsed;
143280
143604
  }
143281
143605
  }
143282
143606
  const defaultLevel = this.parsePlaceholderLevelStyle(
@@ -146319,7 +146643,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
146319
146643
  return [];
146320
146644
  }
146321
146645
  }
146322
- parseDrawingShape(sp, index, emuPerPx) {
146646
+ parseDrawingShape(sp, index, emuPerPx, mergedTextColor) {
146323
146647
  const spPr = this.xmlLookupService.getChildByLocalName(sp, "spPr");
146324
146648
  if (!spPr) {
146325
146649
  return null;
@@ -146380,7 +146704,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
146380
146704
  }
146381
146705
  const text22 = textValues2.join("").trim() || void 0;
146382
146706
  const textStyle = extractDrawingShapeTextStyle(txBody, this.drawingShapeStyleDeps(), emuPerPx);
146383
- textStyle.fontColor ??= extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
146707
+ textStyle.fontColor ??= mergedTextColor ?? extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
146384
146708
  const { fontSize, fontColor } = textStyle;
146385
146709
  const txXfrm = this.xmlLookupService.getChildByLocalName(sp, "txXfrm");
146386
146710
  const txOff = this.xmlLookupService.getChildByLocalName(txXfrm, "off");
@@ -146608,6 +146932,7 @@ var PptxHandlerRuntime89;
146608
146932
  var init_PptxHandlerRuntimeSmartArt = __esm({
146609
146933
  "src/core/core/runtime/PptxHandlerRuntimeSmartArt.ts"() {
146610
146934
  init_utils();
146935
+ init_smartart_merged_text_label();
146611
146936
  init_smartart_point_metadata();
146612
146937
  init_smartart_pres_layout_vars();
146613
146938
  init_smart_art_text_helpers();
@@ -146706,7 +147031,16 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
146706
147031
  diagramDataRelationshipId,
146707
147032
  drawingExtensionRelId
146708
147033
  );
146709
- const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(drawingResolution.path) : [];
147034
+ const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(
147035
+ drawingResolution.path,
147036
+ resolveSmartArtMergedTextColors(
147037
+ points4,
147038
+ parsedConnections,
147039
+ layoutDefinition,
147040
+ colorTransform?.roleColors,
147041
+ localName292
147042
+ )
147043
+ ) : [];
146710
147044
  const drawingRelationshipId = drawingResolution?.relId;
146711
147045
  const styleRelationshipId = parsedRelationshipIds?.styleRelId ?? "";
146712
147046
  const quickStyle = await this.parseSmartArtQuickStyle(slidePath, styleRelationshipId);
@@ -146813,17 +147147,22 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
146813
147147
  * resolves picture (blip) fills to data URLs via the drawing part's own
146814
147148
  * relationships. Delegates to a pure helper with an injected dep bundle.
146815
147149
  */
146816
- async parseSmartArtDrawingShapesFromPath(drawingPath) {
146817
- return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps());
147150
+ async parseSmartArtDrawingShapesFromPath(drawingPath, mergedTextColors) {
147151
+ return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps(mergedTextColors));
146818
147152
  }
146819
147153
  /** Bind runtime zip / parser / lookup / image helpers for the drawing parser. */
146820
- drawingBlipDeps() {
147154
+ drawingBlipDeps(mergedTextColors) {
146821
147155
  return {
146822
147156
  readText: (path) => this.zip.file(path)?.async("string") ?? Promise.resolve(void 0),
146823
147157
  parse: (xml) => this.parser.parse(xml),
146824
147158
  getChild: (node, local) => this.xmlLookupService.getChildByLocalName(node, local),
146825
147159
  getChildren: (node, local) => this.xmlLookupService.getChildrenArrayByLocalName(node, local),
146826
- parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(sp, index, emuPerPx),
147160
+ parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(
147161
+ sp,
147162
+ index,
147163
+ emuPerPx,
147164
+ mergedTextColors?.get(String(sp["@_modelId"] ?? ""))
147165
+ ),
146827
147166
  emuPerPx: _PptxHandlerRuntime.EMU_PER_PX,
146828
147167
  ensureArray: (value) => this.ensureArray(value),
146829
147168
  resolveImagePath: (base, target) => this.resolveImagePath(base, target),
@@ -149596,7 +149935,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
149596
149935
  },
149597
149936
  placeholderType: (element) => this.getElementPlaceholderInfo(element)?.type,
149598
149937
  applyBodyDefaults: (textStyle, defaults) => this.applyPlaceholderBodyDefaults(textStyle, defaults),
149599
- applyLevelDefaults: (textStyle, level) => this.applyPlaceholderLevelDefaults(textStyle, level)
149938
+ applyLevelDefaults: (textStyle, level2) => this.applyPlaceholderLevelDefaults(textStyle, level2)
149600
149939
  }
149601
149940
  );
149602
149941
  const sldLayout = layoutXml["p:sldLayout"];
@@ -151666,38 +152005,38 @@ function parseMasterStyleAtom(view, rec, scheme, fonts) {
151666
152005
  break;
151667
152006
  }
151668
152007
  pos2 = cf.next;
151669
- const level = {};
152008
+ const level2 = {};
151670
152009
  if (cf.props.sizePt !== void 0) {
151671
- level.sizePt = cf.props.sizePt;
152010
+ level2.sizePt = cf.props.sizePt;
151672
152011
  }
151673
152012
  if (cf.props.bold !== void 0) {
151674
- level.bold = cf.props.bold;
152013
+ level2.bold = cf.props.bold;
151675
152014
  }
151676
152015
  if (cf.props.colorRgb !== void 0) {
151677
- level.colorRgb = cf.props.colorRgb;
152016
+ level2.colorRgb = cf.props.colorRgb;
151678
152017
  }
151679
152018
  if (cf.props.fontRef !== void 0 && fonts[cf.props.fontRef]) {
151680
- level.fontName = fonts[cf.props.fontRef];
152019
+ level2.fontName = fonts[cf.props.fontRef];
151681
152020
  }
151682
152021
  if (pf.props.align !== void 0) {
151683
- level.align = pf.props.align;
152022
+ level2.align = pf.props.align;
151684
152023
  }
151685
152024
  if (pf.props.hasBullet !== void 0) {
151686
- level.hasBullet = pf.props.hasBullet;
152025
+ level2.hasBullet = pf.props.hasBullet;
151687
152026
  }
151688
152027
  if (pf.props.bulletChar !== void 0) {
151689
- level.bulletChar = pf.props.bulletChar;
152028
+ level2.bulletChar = pf.props.bulletChar;
151690
152029
  }
151691
152030
  if (pf.props.bulletFontRef !== void 0 && fonts[pf.props.bulletFontRef]) {
151692
- level.bulletFontName = fonts[pf.props.bulletFontRef];
152031
+ level2.bulletFontName = fonts[pf.props.bulletFontRef];
151693
152032
  }
151694
152033
  if (pf.props.leftMarginMu !== void 0) {
151695
- level.marginLeftEmu = masterToEmu(pf.props.leftMarginMu);
152034
+ level2.marginLeftEmu = masterToEmu(pf.props.leftMarginMu);
151696
152035
  }
151697
152036
  if (pf.props.indentMu !== void 0) {
151698
- level.indentEmu = masterToEmu(pf.props.indentMu);
152037
+ level2.indentEmu = masterToEmu(pf.props.indentMu);
151699
152038
  }
151700
- levels.push(level);
152039
+ levels.push(level2);
151701
152040
  }
151702
152041
  return levels;
151703
152042
  }
@@ -152277,28 +152616,28 @@ var init_shape_writer2 = __esm({
152277
152616
  init_xml_utils();
152278
152617
  }
152279
152618
  });
152280
- function levelXml(tag, level, fallbackSizePt) {
152619
+ function levelXml(tag, level2, fallbackSizePt) {
152281
152620
  const attrs3 = [];
152282
- if (level.marginLeftEmu !== void 0) {
152283
- attrs3.push(`marL="${emu(level.marginLeftEmu)}"`);
152621
+ if (level2.marginLeftEmu !== void 0) {
152622
+ attrs3.push(`marL="${emu(level2.marginLeftEmu)}"`);
152284
152623
  }
152285
- if (level.indentEmu !== void 0) {
152286
- attrs3.push(`indent="${-Math.abs(emu(level.indentEmu))}"`);
152624
+ if (level2.indentEmu !== void 0) {
152625
+ attrs3.push(`indent="${-Math.abs(emu(level2.indentEmu))}"`);
152287
152626
  }
152288
- attrs3.push(`algn="${level.align ?? "l"}"`);
152627
+ attrs3.push(`algn="${level2.align ?? "l"}"`);
152289
152628
  let bullet = "";
152290
- if (level.hasBullet === false) {
152629
+ if (level2.hasBullet === false) {
152291
152630
  bullet = "<a:buNone/>";
152292
- } else if (level.hasBullet === true || level.bulletChar !== void 0) {
152293
- if (level.bulletFontName !== void 0) {
152294
- bullet += `<a:buFont typeface="${esc(level.bulletFontName)}"/>`;
152631
+ } else if (level2.hasBullet === true || level2.bulletChar !== void 0) {
152632
+ if (level2.bulletFontName !== void 0) {
152633
+ bullet += `<a:buFont typeface="${esc(level2.bulletFontName)}"/>`;
152295
152634
  }
152296
- bullet += `<a:buChar char="${esc(level.bulletChar ?? "\u2022")}"/>`;
152635
+ bullet += `<a:buChar char="${esc(level2.bulletChar ?? "\u2022")}"/>`;
152297
152636
  }
152298
- const size = Math.round((level.sizePt ?? fallbackSizePt) * 100);
152299
- const bold = level.bold ? ' b="1"' : "";
152300
- const color2 = level.colorRgb !== void 0 ? solidFill(level.colorRgb) : '<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>';
152301
- const font = level.fontName !== void 0 ? `<a:latin typeface="${esc(level.fontName)}"/>` : '<a:latin typeface="+mn-lt"/>';
152637
+ const size = Math.round((level2.sizePt ?? fallbackSizePt) * 100);
152638
+ const bold = level2.bold ? ' b="1"' : "";
152639
+ const color2 = level2.colorRgb !== void 0 ? solidFill(level2.colorRgb) : '<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>';
152640
+ const font = level2.fontName !== void 0 ? `<a:latin typeface="${esc(level2.fontName)}"/>` : '<a:latin typeface="+mn-lt"/>';
152302
152641
  const defRPr = `<a:defRPr sz="${size}" kern="1200"${bold}>${color2}${font}</a:defRPr>`;
152303
152642
  return `<a:${tag} ${attrs3.join(" ")}>${bullet}${defRPr}</a:${tag}>`;
152304
152643
  }
@@ -164983,16 +165322,16 @@ var SmartArtElementProcessor = class {
164983
165322
  }
164984
165323
  return roots.length > 0 ? roots : [...nodeMap.values()];
164985
165324
  }
164986
- renderNestedList(nodes, level) {
165325
+ renderNestedList(nodes, level2) {
164987
165326
  const lines = [];
164988
- const indent = " ".repeat(level);
165327
+ const indent = " ".repeat(level2);
164989
165328
  for (const node of nodes) {
164990
165329
  const text22 = node.text.trim();
164991
165330
  if (text22) {
164992
165331
  lines.push(`${indent}- ${text22}`);
164993
165332
  }
164994
165333
  if (node.children && node.children.length > 0) {
164995
- lines.push(this.renderNestedList(node.children, level + 1));
165334
+ lines.push(this.renderNestedList(node.children, level2 + 1));
164996
165335
  }
164997
165336
  }
164998
165337
  return lines.join("\n");
@@ -166929,19 +167268,19 @@ var TextSegmentRenderer = class {
166929
167268
  if (!options.disableLists && !options.inlineMode) {
166930
167269
  const bullet = group2.segments.find((segment) => Boolean(segment.bulletInfo))?.bulletInfo;
166931
167270
  if (bullet && !bullet.none) {
166932
- const level = resolveListLevel(bullet, group2.index, options.paragraphIndents);
167271
+ const level2 = resolveListLevel(bullet, group2.index, options.paragraphIndents);
166933
167272
  const marker = resolveListMarker(bullet, group2.index);
166934
167273
  const alreadyNumbered = bullet.autoNumType && /^\d+[.)]\s/.test(rawText);
166935
167274
  const prefix = alreadyNumbered ? "" : `${marker} `;
166936
167275
  if (options.htmlFormatting) {
166937
- const pad23 = level * 1.5;
167276
+ const pad23 = level2 * 1.5;
166938
167277
  return {
166939
167278
  text: `<div style="padding-left:${pad23}em">${prefix}${rawText}</div>`,
166940
167279
  isListItem: true
166941
167280
  };
166942
167281
  }
166943
167282
  return {
166944
- text: `${" ".repeat(level)}${prefix}${rawText}`,
167283
+ text: `${" ".repeat(level2)}${prefix}${rawText}`,
166945
167284
  isListItem: true
166946
167285
  };
166947
167286
  }
@@ -169216,7 +169555,7 @@ function dataLabelBox(label) {
169216
169555
  const y = centred2 ? label.y - h2 / 2 : label.y - label.fontSize * ASCENT - DATA_LABEL_PAD_Y;
169217
169556
  return { x, y, w, h: h2 };
169218
169557
  }
169219
- var PX_PER_PT6;
169558
+ var PX_PER_PT7;
169220
169559
  var DATA_LABEL_PAD_X;
169221
169560
  var DATA_LABEL_PAD_Y;
169222
169561
  var DATA_LABEL_LINE_HEIGHT;
@@ -169224,9 +169563,9 @@ var ASCENT;
169224
169563
  var canvasContext;
169225
169564
  var init_chart_label_measure = __esm2({
169226
169565
  "src/render/chart-label-measure.ts"() {
169227
- PX_PER_PT6 = 4 / 3;
169228
- DATA_LABEL_PAD_X = 3 * PX_PER_PT6;
169229
- DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT6;
169566
+ PX_PER_PT7 = 4 / 3;
169567
+ DATA_LABEL_PAD_X = 3 * PX_PER_PT7;
169568
+ DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT7;
169230
169569
  DATA_LABEL_LINE_HEIGHT = 1.2207;
169231
169570
  ASCENT = 0.952;
169232
169571
  }
@@ -171221,8 +171560,8 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
171221
171560
  const fontPx = axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : DEFAULT_CHART_TEXT_PX;
171222
171561
  const bandHeight = Math.max(fontPx, 8) + 4;
171223
171562
  const baselineShift = labelsAbove ? -0.2 * fontPx : 0.8 * fontPx;
171224
- return levels.flatMap((level, levelIndex) => {
171225
- const values = sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "");
171563
+ return levels.flatMap((level2, levelIndex) => {
171564
+ const values = sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "");
171226
171565
  return groupedLabels(values).flatMap((group2) => {
171227
171566
  if (!group2.text || group2.start % skip !== 0) {
171228
171567
  return [];
@@ -171351,7 +171690,7 @@ function chartDataInCategoryOrder(chartData, sourceIndices2) {
171351
171690
  ...chartData,
171352
171691
  categories: sourceIndices2.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
171353
171692
  categoryLevels: chartData.categoryLevels?.map(
171354
- (level) => sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "")
171693
+ (level2) => sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "")
171355
171694
  ),
171356
171695
  series: chartData.series.map((series) => ({
171357
171696
  ...series,
@@ -175515,12 +175854,12 @@ function computeSunburstArcs(series, cx, cy, maxR, colorPalette) {
175515
175854
  }
175516
175855
  return out;
175517
175856
  }
175518
- function hierarchyKey(levels, level, index) {
175519
- return levels.slice(level).map((labels) => labels[index] ?? "").join("\0");
175857
+ function hierarchyKey(levels, level2, index) {
175858
+ return levels.slice(level2).map((labels) => labels[index] ?? "").join("\0");
175520
175859
  }
175521
175860
  function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, colorPalette) {
175522
- const levels = categoryLevels.filter((level) => level.length > 0);
175523
- const leafCount = Math.max(values.length, ...levels.map((level) => level.length), 0);
175861
+ const levels = categoryLevels.filter((level2) => level2.length > 0);
175862
+ const leafCount = Math.max(values.length, ...levels.map((level2) => level2.length), 0);
175524
175863
  if (levels.length === 0 || leafCount === 0) {
175525
175864
  return [];
175526
175865
  }
@@ -175535,15 +175874,15 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
175535
175874
  const rootLabels = levels[levels.length - 1] ?? [];
175536
175875
  const rootColors = /* @__PURE__ */ new Map();
175537
175876
  const out = [];
175538
- for (let level = levels.length - 1; level >= 0; level--) {
175539
- const ringIndex = levels.length - 1 - level;
175877
+ for (let level2 = levels.length - 1; level2 >= 0; level2--) {
175878
+ const ringIndex = levels.length - 1 - level2;
175540
175879
  const innerRadius = ringWidth * (ringIndex + 0.5);
175541
175880
  const outerRadius = ringWidth * (ringIndex + 1.5);
175542
175881
  let start = 0;
175543
175882
  while (start < leafCount) {
175544
- const key2 = hierarchyKey(levels, level, start);
175883
+ const key2 = hierarchyKey(levels, level2, start);
175545
175884
  let end = start + 1;
175546
- while (end < leafCount && hierarchyKey(levels, level, end) === key2) {
175885
+ while (end < leafCount && hierarchyKey(levels, level2, end) === key2) {
175547
175886
  end++;
175548
175887
  }
175549
175888
  const startAngle = -Math.PI / 2 + prefix[start] / total * Math.PI * 2;
@@ -175557,8 +175896,8 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
175557
175896
  fill: paletteColor2(rootColors.get(rootLabel) ?? start, colorPalette),
175558
175897
  opacity: Math.max(0.1, 0.9 - ringIndex * 0.1),
175559
175898
  level: ringIndex,
175560
- label: levels[level][start] ?? "",
175561
- ...level === 0 && end === start + 1 ? { pointIndex: start } : {},
175899
+ label: levels[level2][start] ?? "",
175900
+ ...level2 === 0 && end === start + 1 ? { pointIndex: start } : {},
175562
175901
  ...arcLabelPlacement(cx, cy, (innerRadius + outerRadius) / 2, startAngle, endAngle)
175563
175902
  });
175564
175903
  start = end;
@@ -176707,10 +177046,10 @@ var init_chart_treemap_squarify = __esm2({
176707
177046
  }
176708
177047
  });
176709
177048
  function normalizedLevels(levels, pointCount2) {
176710
- return levels.map((level) => {
177049
+ return levels.map((level2) => {
176711
177050
  let previous = "";
176712
177051
  return Array.from({ length: pointCount2 }, (_, index) => {
176713
- const label = level[index]?.trim() ?? "";
177052
+ const label = level2[index]?.trim() ?? "";
176714
177053
  if (label) {
176715
177054
  previous = label;
176716
177055
  }
@@ -180548,9 +180887,13 @@ function smartArt3DRigSpecularLights(rig, perspective2) {
180548
180887
  const own = perspective2 && rig ? SMARTART_RIG_SPECULAR_LIGHTS[rig] : void 0;
180549
180888
  return own ?? DEFAULT_HIGHLIGHT;
180550
180889
  }
180890
+ function smartArt3DRigKeyLight(rig, sceneCamera) {
180891
+ return sceneCamera && rig ? SMARTART_RIG_SCENE_KEY_LIGHTS[rig] : void 0;
180892
+ }
180551
180893
  var DEFAULT_HIGHLIGHT_ELEVATION_DEG;
180552
180894
  var DEFAULT_HIGHLIGHT;
180553
180895
  var SMARTART_RIG_SPECULAR_LIGHTS;
180896
+ var SMARTART_RIG_SCENE_KEY_LIGHTS;
180554
180897
  var init_smartart_3d_light_rig = __esm2({
180555
180898
  "src/render/smartart-3d-light-rig.ts"() {
180556
180899
  DEFAULT_HIGHLIGHT_ELEVATION_DEG = 60;
@@ -180560,6 +180903,12 @@ var init_smartart_3d_light_rig = __esm2({
180560
180903
  SMARTART_RIG_SPECULAR_LIGHTS = {
180561
180904
  threePt: [{ azimuthDeg: 64, elevationDeg: 44, intensity: 4.6, sharpness: 3 }]
180562
180905
  };
180906
+ SMARTART_RIG_SCENE_KEY_LIGHTS = {
180907
+ flat: { azimuthDeg: 0, elevationDeg: 40 },
180908
+ threePt: { azimuthDeg: 0, elevationDeg: 90 },
180909
+ morning: { azimuthDeg: 0, elevationDeg: 60 },
180910
+ soft: { azimuthDeg: 0, elevationDeg: 80 }
180911
+ };
180563
180912
  }
180564
180913
  });
180565
180914
  function srgbChannelToLinear(c) {
@@ -180580,7 +180929,7 @@ function normalize2(v) {
180580
180929
  const len = Math.hypot(v.x, v.y, v.z) || 1;
180581
180930
  return { x: v.x / len, y: v.y / len, z: v.z / len };
180582
180931
  }
180583
- function resolveSmartArt3DLightModel(lighting, material, perspective2 = false) {
180932
+ function resolveSmartArt3DLightModel(lighting, material, perspective2 = false, sceneCamera = perspective2) {
180584
180933
  const snap2 = getBevelHighlightDirection(lighting?.direction ?? "t");
180585
180934
  const rev = (lighting?.revDeg ?? 0) * Math.PI / 180;
180586
180935
  const ax = snap2.dx;
@@ -180601,8 +180950,9 @@ function resolveSmartArt3DLightModel(lighting, material, perspective2 = false) {
180601
180950
  };
180602
180951
  const response = getMaterialLighting(material);
180603
180952
  const specular = response.specularConstant * SPECULAR_GAIN;
180953
+ const key2 = smartArt3DRigKeyLight(lighting?.rig, sceneCamera);
180604
180954
  return {
180605
- light: toward(KEY_ELEVATION_DEG),
180955
+ light: key2 ? toward(key2.elevationDeg, key2.azimuthDeg) : toward(KEY_ELEVATION_DEG),
180606
180956
  highlights: smartArt3DRigSpecularLights(lighting?.rig, perspective2).map((rigLight) => ({
180607
180957
  direction: toward(rigLight.elevationDeg, rigLight.azimuthDeg),
180608
180958
  weight: specular * rigLight.intensity,
@@ -185446,6 +185796,75 @@ var init_chart_3d_view_scene = __esm2({
185446
185796
  init_surface_chart_3d_scene();
185447
185797
  }
185448
185798
  });
185799
+ function isSmartArt3DGlassMaterial(material) {
185800
+ return material === "clear";
185801
+ }
185802
+ function smartArt3DSurfaceAlpha(material, opacity2, facing) {
185803
+ if (!isSmartArt3DGlassMaterial(material)) {
185804
+ return opacity2;
185805
+ }
185806
+ const tilt = 1 - Math.max(0, Math.min(1, facing));
185807
+ const share = CLEAR_FACE_ALPHA + CLEAR_EDGE_GAIN * tilt ** CLEAR_EDGE_EXPONENT;
185808
+ return Math.max(0, Math.min(1, opacity2 * share));
185809
+ }
185810
+ function smartArt3DVertexAlphas(positions2, normals, material, opacity2, eye) {
185811
+ const out = new Float32Array(positions2.length / 3);
185812
+ for (let i2 = 0, v = 0; i2 < positions2.length; i2 += 3, v++) {
185813
+ let view = { x: 0, y: 0, z: 1 };
185814
+ if (eye) {
185815
+ const dx = eye.x - positions2[i2];
185816
+ const dy = eye.y - positions2[i2 + 1];
185817
+ const dz = eye.z - positions2[i2 + 2];
185818
+ const len = Math.hypot(dx, dy, dz) || 1;
185819
+ view = { x: dx / len, y: dy / len, z: dz / len };
185820
+ }
185821
+ const facing = normals[i2] * view.x + normals[i2 + 1] * view.y + normals[i2 + 2] * view.z;
185822
+ out[v] = smartArt3DSurfaceAlpha(material, opacity2, facing);
185823
+ }
185824
+ return out;
185825
+ }
185826
+ function orientSmartArt3DTriangles(triangles) {
185827
+ const { positions: p, normals: n } = triangles;
185828
+ for (let t = 0; t + 9 <= p.length; t += 9) {
185829
+ const ux = p[t + 3] - p[t];
185830
+ const uy = p[t + 4] - p[t + 1];
185831
+ const uz = p[t + 5] - p[t + 2];
185832
+ const vx = p[t + 6] - p[t];
185833
+ const vy = p[t + 7] - p[t + 1];
185834
+ const vz = p[t + 8] - p[t + 2];
185835
+ const cx = uy * vz - uz * vy;
185836
+ const cy = uz * vx - ux * vz;
185837
+ const cz = ux * vy - uy * vx;
185838
+ const nx = n[t] + n[t + 3] + n[t + 6];
185839
+ const ny = n[t + 1] + n[t + 4] + n[t + 7];
185840
+ const nz = n[t + 2] + n[t + 5] + n[t + 8];
185841
+ if (cx * nx + cy * ny + cz * nz < 0) {
185842
+ for (const arr of [p, n]) {
185843
+ for (let c = 0; c < 3; c++) {
185844
+ const b = arr[t + 3 + c];
185845
+ arr[t + 3 + c] = arr[t + 6 + c];
185846
+ arr[t + 6 + c] = b;
185847
+ }
185848
+ }
185849
+ }
185850
+ }
185851
+ }
185852
+ function isSmartArt3DTranslucentMesh(mesh) {
185853
+ return !mesh.fillNone && (mesh.opacity < 1 || isSmartArt3DGlassMaterial(mesh.solid?.material));
185854
+ }
185855
+ function smartArt3DGlassLightModel(model) {
185856
+ return { ...model, ambient: 1, diffuse: 0 };
185857
+ }
185858
+ var CLEAR_FACE_ALPHA;
185859
+ var CLEAR_EDGE_GAIN;
185860
+ var CLEAR_EDGE_EXPONENT;
185861
+ var init_smartart_3d_translucency = __esm2({
185862
+ "src/render/smartart-3d-translucency.ts"() {
185863
+ CLEAR_FACE_ALPHA = 0.2;
185864
+ CLEAR_EDGE_GAIN = 2;
185865
+ CLEAR_EDGE_EXPONENT = 1;
185866
+ }
185867
+ });
185449
185868
  function buildTextBlockTexture(three, block) {
185450
185869
  if (typeof document === "undefined" || block.lines.every((l) => l.text.length === 0)) {
185451
185870
  return null;
@@ -185957,19 +186376,45 @@ function buildGradientTexture(three, gradient) {
185957
186376
  texture.needsUpdate = true;
185958
186377
  return texture;
185959
186378
  }
186379
+ function withAlpha(rgb2, alpha) {
186380
+ const out = new Float32Array(alpha.length * 4);
186381
+ for (let v = 0; v < alpha.length; v++) {
186382
+ out.set(rgb2.subarray(v * 3, v * 3 + 3), v * 4);
186383
+ out[v * 4 + 3] = alpha[v];
186384
+ }
186385
+ return out;
186386
+ }
185960
186387
  function buildPart(three, part, light, eye, disposables) {
185961
- const { positions: positions2, normals } = part.triangles;
185962
- if (positions2.length === 0) {
186388
+ if (part.triangles.positions.length === 0) {
185963
186389
  return null;
185964
186390
  }
186391
+ const glass = isSmartArt3DGlassMaterial(part.material);
186392
+ const translucent = part.opacity < 1 || glass;
186393
+ if (translucent) {
186394
+ orientSmartArt3DTriangles(part.triangles);
186395
+ }
186396
+ const { positions: positions2, normals } = part.triangles;
185965
186397
  const gradient = part.gradient;
185966
186398
  const flatColor = hexToRgb7(part.color);
185967
186399
  const baseAt = (p) => gradient ? smartArt3DGradientColor(gradient, p) : flatColor;
185968
186400
  const geometry = new three.BufferGeometry();
185969
186401
  geometry.setAttribute("position", new three.Float32BufferAttribute(positions2, 3));
186402
+ const shading = shadeSmartArt3DVertices(
186403
+ positions2,
186404
+ normals,
186405
+ baseAt,
186406
+ glass ? smartArt3DGlassLightModel(light) : light,
186407
+ eye
186408
+ );
185970
186409
  geometry.setAttribute(
185971
186410
  "color",
185972
- new three.BufferAttribute(shadeSmartArt3DVertices(positions2, normals, baseAt, light, eye), 3)
186411
+ glass ? new three.BufferAttribute(
186412
+ withAlpha(
186413
+ shading,
186414
+ smartArt3DVertexAlphas(positions2, normals, part.material, part.opacity, eye)
186415
+ ),
186416
+ 4
186417
+ ) : new three.BufferAttribute(shading, 3)
185973
186418
  );
185974
186419
  const texture = gradient ? buildGradientTexture(three, gradient) : null;
185975
186420
  if (gradient && texture) {
@@ -185987,9 +186432,13 @@ function buildPart(three, part, light, eye, disposables) {
185987
186432
  color: texture ? "#ffffff" : part.color,
185988
186433
  map: texture,
185989
186434
  vertexColors: true,
185990
- side: three.DoubleSide,
185991
- transparent: part.opacity < 1,
185992
- opacity: part.opacity
186435
+ side: translucent ? three.FrontSide : three.DoubleSide,
186436
+ transparent: translucent,
186437
+ // A glass carries its alpha per vertex; the material then stays at 1.
186438
+ opacity: glass ? 1 : part.opacity,
186439
+ // Translucent solids are layered in paint order, like PowerPoint's
186440
+ // per-shape compositing, rather than hiding one another.
186441
+ depthWrite: !translucent
185993
186442
  });
185994
186443
  disposables.push(geometry, material);
185995
186444
  return new three.Mesh(geometry, material);
@@ -186016,12 +186465,20 @@ function buildLitMeshObject(three, mesh, light, eye) {
186016
186465
  for (const cap of geometry?.contourCaps ?? []) {
186017
186466
  appendCap(three, contour, cap);
186018
186467
  }
186468
+ const material = mesh.solid?.material;
186019
186469
  const parts = [
186020
- { triangles: body, color: mesh.fill, gradient: mesh.gradient, opacity: mesh.opacity },
186470
+ {
186471
+ triangles: body,
186472
+ color: mesh.fill,
186473
+ gradient: mesh.gradient,
186474
+ opacity: mesh.opacity,
186475
+ material
186476
+ },
186021
186477
  {
186022
186478
  triangles: sides,
186023
186479
  color: mesh.solid?.extrusionColor ?? mesh.fill,
186024
- opacity: mesh.opacity
186480
+ opacity: mesh.opacity,
186481
+ material
186025
186482
  },
186026
186483
  {
186027
186484
  triangles: contour,
@@ -186029,33 +186486,36 @@ function buildLitMeshObject(three, mesh, light, eye) {
186029
186486
  opacity: mesh.opacity
186030
186487
  }
186031
186488
  ];
186032
- for (const part of parts) {
186489
+ parts.forEach((part, order) => {
186033
186490
  const built = buildPart(three, part, light, localEye, disposables);
186034
186491
  if (built) {
186035
- if (mesh.opacity < 1) {
186036
- const material = built.material;
186037
- material.transparent = true;
186038
- material.opacity = mesh.opacity;
186039
- }
186492
+ built.renderOrder = order;
186040
186493
  group2.add(built);
186041
186494
  }
186042
- }
186495
+ });
186043
186496
  }
186044
186497
  for (const line4 of buildStrokeLines(three, mesh, disposables)) {
186045
186498
  group2.add(line4);
186046
186499
  }
186500
+ const labelsFrom = group2.children.length;
186047
186501
  buildLitTextObject(three, mesh, group2, light, disposables);
186502
+ for (const label of group2.children.slice(labelsFrom)) {
186503
+ label.renderOrder = LABEL_RENDER_ORDER;
186504
+ }
186048
186505
  return { group: group2, disposables };
186049
186506
  }
186507
+ var LABEL_RENDER_ORDER;
186050
186508
  var GRADIENT_TEXELS;
186051
186509
  var init_lit_mesh_object = __esm2({
186052
186510
  "src/smartart-3d/lit-mesh-object.ts"() {
186053
186511
  init_smartart_3d_drawing_solid();
186054
186512
  init_smartart_3d_ring();
186055
186513
  init_smartart_3d_solid_geometry();
186514
+ init_smartart_3d_translucency();
186056
186515
  init_smartart_3d_vertex_shading();
186057
186516
  init_flat_mesh_object();
186058
186517
  init_lit_text_object();
186518
+ LABEL_RENDER_ORDER = 3;
186059
186519
  GRADIENT_TEXELS = 256;
186060
186520
  }
186061
186521
  });
@@ -186273,16 +186733,24 @@ async function mountSmartArt3DView(model, ctx) {
186273
186733
  );
186274
186734
  }
186275
186735
  scene.add(root);
186276
- for (const mesh of model.meshes) {
186736
+ model.meshes.forEach((mesh, index) => {
186277
186737
  const built = lit ? buildLitMeshObject(
186278
186738
  three,
186279
186739
  mesh,
186280
- resolveSmartArt3DLightModel(model.lighting, mesh.solid?.material, eye !== void 0),
186740
+ resolveSmartArt3DLightModel(
186741
+ model.lighting,
186742
+ mesh.solid?.material,
186743
+ eye !== void 0,
186744
+ model.camera !== void 0
186745
+ ),
186281
186746
  eye
186282
186747
  ) : buildFlatMeshObject(three, mesh);
186748
+ if (lit && isSmartArt3DTranslucentMesh(mesh)) {
186749
+ built.group.renderOrder = index + 1;
186750
+ }
186283
186751
  root.add(built.group);
186284
186752
  disposables.push(...built.disposables);
186285
- }
186753
+ });
186286
186754
  const camera = buildSmartArtViewCamera(three, model.bounds, model.camera, ctx.size);
186287
186755
  let overflow = frameSmartArtOverflow(three, root, camera, ctx.size, Boolean(model.camera));
186288
186756
  return {
@@ -186307,6 +186775,7 @@ var init_view_scene = __esm2({
186307
186775
  "src/smartart-3d/view-scene.ts"() {
186308
186776
  init_smartart_3d_lighting();
186309
186777
  init_smartart_3d_scene_camera();
186778
+ init_smartart_3d_translucency();
186310
186779
  init_flat_mesh_object();
186311
186780
  init_lit_mesh_object();
186312
186781
  init_view_camera();
@@ -191499,7 +191968,7 @@ function pointInRing(p, ring) {
191499
191968
  }
191500
191969
  return inside;
191501
191970
  }
191502
- function contourRaster(values, w, h2, level) {
191971
+ function contourRaster(values, w, h2, level2) {
191503
191972
  const at = (x, y) => x < 0 || y < 0 || x >= w || y >= h2 ? 0 : values[y * w + x];
191504
191973
  const stride = w + 2;
191505
191974
  const hKey = (x, y) => ((y + 1) * stride + (x + 1)) * 2;
@@ -191509,7 +191978,7 @@ function contourRaster(values, w, h2, level) {
191509
191978
  if (!points4.has(key2)) {
191510
191979
  const a = at(x, y);
191511
191980
  const b = horizontal ? at(x + 1, y) : at(x, y + 1);
191512
- const t = b !== a ? (level - a) / (b - a) : 0.5;
191981
+ const t = b !== a ? (level2 - a) / (b - a) : 0.5;
191513
191982
  points4.set(key2, horizontal ? { x: x + t, y } : { x, y: y + t });
191514
191983
  }
191515
191984
  return key2;
@@ -191533,15 +192002,15 @@ function contourRaster(values, w, h2, level) {
191533
192002
  };
191534
192003
  for (let y = -1; y < h2; y++) {
191535
192004
  for (let x = -1; x < w; x++) {
191536
- const tl = at(x, y) >= level ? 1 : 0;
191537
- const tr = at(x + 1, y) >= level ? 1 : 0;
191538
- const br = at(x + 1, y + 1) >= level ? 1 : 0;
191539
- const bl = at(x, y + 1) >= level ? 1 : 0;
192005
+ const tl = at(x, y) >= level2 ? 1 : 0;
192006
+ const tr = at(x + 1, y) >= level2 ? 1 : 0;
192007
+ const br = at(x + 1, y + 1) >= level2 ? 1 : 0;
192008
+ const bl = at(x, y + 1) >= level2 ? 1 : 0;
191540
192009
  const code = tl * 8 + tr * 4 + br * 2 + bl;
191541
192010
  if (code === 0 || code === 15) {
191542
192011
  continue;
191543
192012
  }
191544
- const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >= level;
192013
+ const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >= level2;
191545
192014
  switch (code) {
191546
192015
  case 1:
191547
192016
  case 14:
@@ -199361,14 +199830,14 @@ function round2(value, precision) {
199361
199830
  function svgDataUri(svg, filterId) {
199362
199831
  return `url("data:image/svg+xml,${encodeURIComponent(svg)}#${filterId}")`;
199363
199832
  }
199364
- function pixelateFilterMarkup(level, filterId) {
199365
- const tile4 = round2(level, 4);
199366
- const dot2 = round2(level * DOT_RATIO, 4);
199833
+ function pixelateFilterMarkup(level2, filterId) {
199834
+ const tile4 = round2(level2, 4);
199835
+ const dot2 = round2(level2 * DOT_RATIO, 4);
199367
199836
  return `<svg xmlns="http://www.w3.org/2000/svg"><filter id="${filterId}" primitiveUnits="objectBoundingBox" x="-0.5" y="-0.5" width="2" height="2" color-interpolation-filters="sRGB"><feFlood x="0" y="0" width="${dot2}" height="${dot2}" result="dot"/><feComposite in="dot" width="${tile4}" height="${tile4}" result="tile"/><feTile in="tile" result="grid"/><feComposite in="SourceGraphic" in2="grid" operator="in"/></filter></svg>`;
199368
199837
  }
199369
- var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((level, index) => {
199838
+ var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((level2, index) => {
199370
199839
  const filterId = `pptx-pixelate-${index}`;
199371
- return svgDataUri(pixelateFilterMarkup(level, filterId), filterId);
199840
+ return svgDataUri(pixelateFilterMarkup(level2, filterId), filterId);
199372
199841
  });
199373
199842
  function buildSteppedKeyframes(name, order, opacityFrom, opacityTo) {
199374
199843
  const lastIndex = order.length - 1;
@@ -200677,7 +201146,7 @@ function revealedByLevel(nodes, progress) {
200677
201146
  return nodes.length;
200678
201147
  }
200679
201148
  const allowed = new Set(uniqueLevels.slice(0, shownLevels));
200680
- return levels.filter((level) => allowed.has(level)).length;
201149
+ return levels.filter((level2) => allowed.has(level2)).length;
200681
201150
  }
200682
201151
  function revealedByBranch(nodes, progress) {
200683
201152
  const roots = nodeBranchRoots(nodes);
@@ -202453,8 +202922,8 @@ var DEFAULT_BUILD_LEVEL = 1;
202453
202922
  function groupParagraphsByBuildLevel(levels, buildLevel = DEFAULT_BUILD_LEVEL) {
202454
202923
  const groups = [];
202455
202924
  for (let i2 = 0; i2 < levels.length; i2++) {
202456
- const level = levels[i2] ?? 0;
202457
- const opensGroup = groups.length === 0 || level < buildLevel;
202925
+ const level2 = levels[i2] ?? 0;
202926
+ const opensGroup = groups.length === 0 || level2 < buildLevel;
202458
202927
  if (opensGroup) {
202459
202928
  groups.push([i2]);
202460
202929
  } else {
@@ -215501,8 +215970,8 @@ function resolveParagraphBullet(firstSegment, baseFontSize = firstSegment?.style
215501
215970
  return void 0;
215502
215971
  }
215503
215972
  var INDENT_PX_PER_LEVEL = 18;
215504
- function bulletIndentPx(level) {
215505
- const lvl = typeof level === "number" && level > 0 ? level : 0;
215973
+ function bulletIndentPx(level2) {
215974
+ const lvl = typeof level2 === "number" && level2 > 0 ? level2 : 0;
215506
215975
  return lvl * INDENT_PX_PER_LEVEL;
215507
215976
  }
215508
215977
  function resolveParagraphIndent(paraIndent, paragraphLevel) {
@@ -215700,15 +216169,15 @@ function setElementBullets(element, kind, range) {
215700
216169
  }
215701
216170
  const first = segments[0] ?? paragraph.terminator;
215702
216171
  const info = first?.bulletInfo;
215703
- const level = first?.paragraphLevel ?? 0;
216172
+ const level2 = first?.paragraphLevel ?? 0;
215704
216173
  if (info?.autoNumType && paragraphBulletKind(segments) === "numbered") {
215705
216174
  const startAt = info.autoNumStartAt ?? 1;
215706
- const ordinal = nextAutoNumber(sequence, level, info.autoNumType, startAt) - startAt;
216175
+ const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, startAt) - startAt;
215707
216176
  if (info.paragraphIndex !== ordinal) {
215708
216177
  segments = toggleParagraphBullet(segments, "numbered", ordinal);
215709
216178
  }
215710
216179
  } else {
215711
- breakAutoNumberRun(sequence, level);
216180
+ breakAutoNumberRun(sequence, level2);
215712
216181
  }
215713
216182
  next.push(...segments);
215714
216183
  if (paragraph.terminator) {
@@ -219597,11 +220066,11 @@ function definedEntries(descriptor) {
219597
220066
  ([, value]) => value !== void 0
219598
220067
  );
219599
220068
  }
219600
- function resolveNotesLevelStyle(notesStyle, level = 0) {
220069
+ function resolveNotesLevelStyle(notesStyle, level2 = 0) {
219601
220070
  if (!notesStyle) {
219602
220071
  return {};
219603
220072
  }
219604
- const own = notesStyle[level];
220073
+ const own = notesStyle[level2];
219605
220074
  const fallback = notesStyle[-1];
219606
220075
  const descriptor = {
219607
220076
  fontFamily: own?.fontFamily ?? fallback?.fontFamily,
@@ -223426,12 +223895,12 @@ function renumberRemappedParagraphs(segments) {
223426
223895
  return segment;
223427
223896
  }
223428
223897
  const info = segment.bulletInfo;
223429
- const level = segment.paragraphLevel ?? 0;
223898
+ const level2 = segment.paragraphLevel ?? 0;
223430
223899
  if (!info?.autoNumType || !resolveParagraphBullet(segment)?.isNumbered) {
223431
- breakAutoNumberRun(sequence, level);
223900
+ breakAutoNumberRun(sequence, level2);
223432
223901
  return segment;
223433
223902
  }
223434
- const ordinal = nextAutoNumber(sequence, level, info.autoNumType, info.autoNumStartAt ?? 1) - (info.autoNumStartAt ?? 1);
223903
+ const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, info.autoNumStartAt ?? 1) - (info.autoNumStartAt ?? 1);
223435
223904
  if (info.paragraphIndex === void 0 || info.paragraphIndex === ordinal) {
223436
223905
  return segment;
223437
223906
  }
@@ -230361,17 +230830,17 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
230361
230830
  const renderedNodes = [];
230362
230831
  const connectors2 = [];
230363
230832
  let colourIdx = 0;
230364
- function renderTreeNode(t, xOffset, level) {
230833
+ function renderTreeNode(t, xOffset, level2) {
230365
230834
  const w = treeWidth(t);
230366
230835
  const nodeCx = (xOffset + w / 2) * cellW;
230367
- const nodeCy = level * cellH + cellH / 2;
230836
+ const nodeCy = level2 * cellH + cellH / 2;
230368
230837
  const ci = colourIdx++;
230369
230838
  const fontSize = fitFontSize(t.node.text, boxW * 0.9, boxH, 11);
230370
230839
  let childOffset = xOffset;
230371
230840
  for (const child27 of t.children) {
230372
230841
  const childW = treeWidth(child27);
230373
230842
  const childCx = (childOffset + childW / 2) * cellW;
230374
- const childCy = (level + 1) * cellH + cellH / 2;
230843
+ const childCy = (level2 + 1) * cellH + cellH / 2;
230375
230844
  const midY = nodeCy + boxH / 2 + (childCy - boxH / 2 - (nodeCy + boxH / 2)) / 2;
230376
230845
  connectors2.push({
230377
230846
  key: `${elementId}-hier-conn-${t.node.id}-${child27.node.id}`,
@@ -230400,7 +230869,7 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
230400
230869
  renderedNodes.push(nodeEntry);
230401
230870
  let co = xOffset;
230402
230871
  for (const child27 of t.children) {
230403
- renderTreeNode(child27, co, level + 1);
230872
+ renderTreeNode(child27, co, level2 + 1);
230404
230873
  co += treeWidth(child27);
230405
230874
  }
230406
230875
  }
@@ -235749,8 +236218,8 @@ function paragraphGroupText(group2) {
235749
236218
  }
235750
236219
  function paragraphGroupLevel(group2) {
235751
236220
  const first = group2.marker ?? group2.content[0];
235752
- const level = first?.paragraphLevel;
235753
- return typeof level === "number" && level > 0 ? Math.min(level, MAX_PARAGRAPH_LEVEL) : 0;
236221
+ const level2 = first?.paragraphLevel;
236222
+ return typeof level2 === "number" && level2 > 0 ? Math.min(level2, MAX_PARAGRAPH_LEVEL) : 0;
235754
236223
  }
235755
236224
  function readElementParagraphs(element) {
235756
236225
  const groups = groupElementParagraphs(element);
@@ -235880,14 +236349,14 @@ function mapOutlineKey(input, rowKey) {
235880
236349
  }
235881
236350
  return none;
235882
236351
  }
235883
- function withLevel(segments, level) {
236352
+ function withLevel(segments, level2) {
235884
236353
  return segments.map((segment, index) => {
235885
236354
  if (index > 0) {
235886
236355
  return segment;
235887
236356
  }
235888
236357
  const next = { ...segment };
235889
- if (level > 0) {
235890
- next.paragraphLevel = Math.min(level, MAX_PARAGRAPH_LEVEL);
236358
+ if (level2 > 0) {
236359
+ next.paragraphLevel = Math.min(level2, MAX_PARAGRAPH_LEVEL);
235891
236360
  } else {
235892
236361
  delete next.paragraphLevel;
235893
236362
  }
@@ -236026,12 +236495,12 @@ function applyIndent(slides, row, delta) {
236026
236495
  }
236027
236496
  const result = editParagraphs(slides, row, (paragraphs2) => {
236028
236497
  const current = paragraphs2[row.paragraphIndex];
236029
- const level = Math.min(Math.max(current.level + (delta > 0 ? 1 : -1), 0), MAX_PARAGRAPH_LEVEL);
236030
- if (level === current.level) {
236498
+ const level2 = Math.min(Math.max(current.level + (delta > 0 ? 1 : -1), 0), MAX_PARAGRAPH_LEVEL);
236499
+ if (level2 === current.level) {
236031
236500
  return null;
236032
236501
  }
236033
236502
  const next = [...paragraphs2];
236034
- next[row.paragraphIndex] = { ...current, level };
236503
+ next[row.paragraphIndex] = { ...current, level: level2 };
236035
236504
  return next;
236036
236505
  });
236037
236506
  return result ?? unchanged2([...slides], row);
@@ -236088,6 +236557,44 @@ function applyOutlineEdit(slides, edit, options = {}) {
236088
236557
  return unchanged2([...slides], row);
236089
236558
  }
236090
236559
  }
236560
+ var NUDGE_SMALL = 1;
236561
+ var NUDGE_LARGE = 10;
236562
+ function editorNudgeDelta(key2, large) {
236563
+ const step = large ? NUDGE_LARGE : NUDGE_SMALL;
236564
+ switch (key2) {
236565
+ case "ArrowLeft":
236566
+ return { dx: -step, dy: 0 };
236567
+ case "ArrowRight":
236568
+ return { dx: step, dy: 0 };
236569
+ case "ArrowUp":
236570
+ return { dx: 0, dy: -step };
236571
+ case "ArrowDown":
236572
+ return { dx: 0, dy: step };
236573
+ default:
236574
+ return null;
236575
+ }
236576
+ }
236577
+ function editorSlideStep(key2, hasSelection, withModifier) {
236578
+ if (withModifier) {
236579
+ return null;
236580
+ }
236581
+ if (key2 === "PageUp") {
236582
+ return "prevSlide";
236583
+ }
236584
+ if (key2 === "PageDown") {
236585
+ return "nextSlide";
236586
+ }
236587
+ if (hasSelection) {
236588
+ return null;
236589
+ }
236590
+ if (key2 === "ArrowLeft" || key2 === "ArrowUp") {
236591
+ return "prevSlide";
236592
+ }
236593
+ if (key2 === "ArrowRight" || key2 === "ArrowDown") {
236594
+ return "nextSlide";
236595
+ }
236596
+ return null;
236597
+ }
236091
236598
  function resolveChord(key2, shiftKey, hasSelection) {
236092
236599
  switch (key2.toLowerCase()) {
236093
236600
  case "z":
@@ -236229,8 +236736,6 @@ function isEditorControlTarget(target) {
236229
236736
  }
236230
236737
  return Boolean(element.closest(CONTROL_SELECTOR));
236231
236738
  }
236232
- var NUDGE_SMALL = 1;
236233
- var NUDGE_LARGE = 10;
236234
236739
  var GUARD_DEFAULTS = {
236235
236740
  canEdit: true,
236236
236741
  isPresenting: false,
@@ -236241,21 +236746,6 @@ var GUARD_DEFAULTS = {
236241
236746
  isTextInputTarget: false,
236242
236747
  isControlTarget: false
236243
236748
  };
236244
- function editorNudgeDelta(key2, large) {
236245
- const step = large ? NUDGE_LARGE : NUDGE_SMALL;
236246
- switch (key2) {
236247
- case "ArrowLeft":
236248
- return { dx: -step, dy: 0 };
236249
- case "ArrowRight":
236250
- return { dx: step, dy: 0 };
236251
- case "ArrowUp":
236252
- return { dx: 0, dy: -step };
236253
- case "ArrowDown":
236254
- return { dx: 0, dy: step };
236255
- default:
236256
- return null;
236257
- }
236258
- }
236259
236749
  var NO_ACTION = { action: null };
236260
236750
  function mapEditorKey(input, guard = {}) {
236261
236751
  const state = { ...GUARD_DEFAULTS, ...guard };
@@ -236308,18 +236798,13 @@ function mapEditorKey(input, guard = {}) {
236308
236798
  return chord2;
236309
236799
  }
236310
236800
  }
236801
+ const paging = editorSlideStep(key2, state.hasSelection, mod || alt);
236802
+ if (paging) {
236803
+ return { action: paging };
236804
+ }
236311
236805
  if (state.hasSelection) {
236312
236806
  const delta = editorNudgeDelta(key2, Boolean(input.shiftKey));
236313
- if (delta) {
236314
- return { action: "nudge", dx: delta.dx, dy: delta.dy };
236315
- }
236316
- return NO_ACTION;
236317
- }
236318
- if (key2 === "ArrowLeft") {
236319
- return { action: "prevSlide" };
236320
- }
236321
- if (key2 === "ArrowRight") {
236322
- return { action: "nextSlide" };
236807
+ return delta ? { action: "nudge", dx: delta.dx, dy: delta.dy } : NO_ACTION;
236323
236808
  }
236324
236809
  return NO_ACTION;
236325
236810
  }
@@ -242672,8 +243157,8 @@ var VIEWER_SHORTCUT_REFERENCE = [
242672
243157
  { actionKey: "pptx.ribbon.ungroup", shortcut: "Ctrl/Cmd+Shift+G" },
242673
243158
  { actionKey: "pptx.shortcuts.action.nudgeElement", shortcut: "Arrow keys" },
242674
243159
  { actionKey: "pptx.shortcuts.action.nudgeElementLarge", shortcut: "Shift+Arrow keys" },
242675
- { actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left arrow" },
242676
- { actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right arrow" },
243160
+ { actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left or Up arrow, Page Up" },
243161
+ { actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right or Down arrow, Page Down" },
242677
243162
  { actionKey: "pptx.shortcuts.action.zoomCanvas", shortcut: "Ctrl/Cmd+Mouse wheel" },
242678
243163
  { actionKey: "pptx.shortcuts.action.commitTextEdit", shortcut: "Ctrl/Cmd+Enter" },
242679
243164
  { actionKey: "pptx.shortcuts.action.cancelTextEdit", shortcut: "Escape" },
@@ -251195,6 +251680,7 @@ function createElementClass() {
251195
251680
  #resize = null;
251196
251681
  #intersect = null;
251197
251682
  #poll = null;
251683
+ #teardownPending = false;
251198
251684
  get spec() {
251199
251685
  return this.#spec;
251200
251686
  }
@@ -251203,9 +251689,7 @@ function createElementClass() {
251203
251689
  return;
251204
251690
  }
251205
251691
  this.#spec = value;
251206
- if (this.isConnected) {
251207
- void this.#controller?.setSpec(value);
251208
- }
251692
+ void this.#controller?.setSpec(value);
251209
251693
  }
251210
251694
  get interactive() {
251211
251695
  return this.hasAttribute("interactive");
@@ -251246,6 +251730,10 @@ function createElementClass() {
251246
251730
  }
251247
251731
  connectedCallback() {
251248
251732
  this.setAttribute(THREE_VIEW_MARKER_ATTR, "");
251733
+ if (this.#controller) {
251734
+ this.#teardownPending = false;
251735
+ return;
251736
+ }
251249
251737
  const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
251250
251738
  if (!this.#canvas) {
251251
251739
  root.innerHTML = `<style>${SHADOW_CSS}</style><div class="fallback" part="fallback"><slot></slot></div><div class="stage" part="stage"><canvas></canvas><div class="hit" part="hit"></div><div class="overlay" part="overlay"></div></div>`;
@@ -251273,6 +251761,15 @@ function createElementClass() {
251273
251761
  void this.#controller.setSpec(this.#spec);
251274
251762
  }
251275
251763
  disconnectedCallback() {
251764
+ this.#teardownPending = true;
251765
+ queueMicrotask(() => {
251766
+ if (this.#teardownPending && !this.isConnected) {
251767
+ this.#teardown();
251768
+ }
251769
+ });
251770
+ }
251771
+ #teardown() {
251772
+ this.#teardownPending = false;
251276
251773
  this.#resize?.disconnect();
251277
251774
  this.#intersect?.disconnect();
251278
251775
  if (this.#poll !== null) {
@@ -253969,24 +254466,42 @@ function isChart3DViewEnabled(flags, chartType) {
253969
254466
  }
253970
254467
  var chartSpecs = /* @__PURE__ */ new WeakMap();
253971
254468
  var smartArtSpecs = /* @__PURE__ */ new WeakMap();
253972
- function chartThreeViewSpec(element) {
253973
- if (chartSpecs.has(element)) {
253974
- return chartSpecs.get(element) ?? null;
254469
+ var lastByIdChart = /* @__PURE__ */ new Map();
254470
+ var lastByIdSmartArt = /* @__PURE__ */ new Map();
254471
+ var POSITION_KEYS = /* @__PURE__ */ new Set(["x", "y"]);
254472
+ function differsOnlyInPosition(a, b) {
254473
+ const ra = a;
254474
+ const rb = b;
254475
+ const keys = /* @__PURE__ */ new Set([...Object.keys(ra), ...Object.keys(rb)]);
254476
+ for (const key2 of keys) {
254477
+ if (!POSITION_KEYS.has(key2) && ra[key2] !== rb[key2]) {
254478
+ return false;
254479
+ }
253975
254480
  }
253976
- const spec2 = buildChart3DSpecForElement(element);
253977
- const view = spec2 ? { kind: "chart", spec: spec2 } : null;
253978
- chartSpecs.set(element, view);
253979
- return view;
254481
+ return true;
253980
254482
  }
253981
- function smartArtThreeViewSpec(element) {
253982
- if (smartArtSpecs.has(element)) {
253983
- return smartArtSpecs.get(element) ?? null;
254483
+ function memoised(element, byObject, byId, build7) {
254484
+ if (byObject.has(element)) {
254485
+ return byObject.get(element) ?? null;
253984
254486
  }
253985
- const spec2 = buildSmartArt3DSpecForElement(element);
253986
- const view = spec2 ? { kind: "smartart", spec: spec2 } : null;
253987
- smartArtSpecs.set(element, view);
254487
+ const last = byId.get(element.id);
254488
+ const view = last && differsOnlyInPosition(last.element, element) ? last.view : build7();
254489
+ byObject.set(element, view);
254490
+ byId.set(element.id, { element, view });
253988
254491
  return view;
253989
254492
  }
254493
+ function chartThreeViewSpec(element) {
254494
+ return memoised(element, chartSpecs, lastByIdChart, () => {
254495
+ const spec2 = buildChart3DSpecForElement(element);
254496
+ return spec2 ? { kind: "chart", spec: spec2 } : null;
254497
+ });
254498
+ }
254499
+ function smartArtThreeViewSpec(element) {
254500
+ return memoised(element, smartArtSpecs, lastByIdSmartArt, () => {
254501
+ const spec2 = buildSmartArt3DSpecForElement(element);
254502
+ return spec2 ? { kind: "smartart", spec: spec2 } : null;
254503
+ });
254504
+ }
253990
254505
  function resolveChartThreeViewSpec(element, flags) {
253991
254506
  if (element.type !== "chart" || !isChart3DViewEnabled(flags, element.chartData?.chartType)) {
253992
254507
  return null;