pptx-react-viewer 4.16.0 → 4.16.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 (133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{AiChatPanel-DHLJ6LKF.js → AiChatPanel-DFZSMXJB.js} +28 -28
  3. package/dist/AiChatPanel-DFZSMXJB.js.br +0 -0
  4. package/dist/AiChatPanel-DFZSMXJB.js.gz +0 -0
  5. package/dist/{AiChatPanel-5Z4BYP7S.mjs → AiChatPanel-K3PL6O3M.mjs} +4 -4
  6. package/dist/AiChatPanel-K3PL6O3M.mjs.br +0 -0
  7. package/dist/AiChatPanel-K3PL6O3M.mjs.gz +0 -0
  8. package/dist/{Model3DScene-N36X5Z2Z.mjs → Model3DScene-EOKTWVG7.mjs} +1 -1
  9. package/dist/Model3DScene-EOKTWVG7.mjs.br +0 -0
  10. package/dist/Model3DScene-EOKTWVG7.mjs.gz +0 -0
  11. package/dist/{Model3DScene-AXT5KCUX.js → Model3DScene-ZYC5U7NY.js} +2 -2
  12. package/dist/Model3DScene-ZYC5U7NY.js.br +0 -0
  13. package/dist/Model3DScene-ZYC5U7NY.js.gz +0 -0
  14. package/dist/{chunk-CJSIEITL.mjs → chunk-33XJSD62.mjs} +3 -0
  15. package/dist/chunk-33XJSD62.mjs.br +0 -0
  16. package/dist/{chunk-CJSIEITL.mjs.gz → chunk-33XJSD62.mjs.gz} +0 -0
  17. package/dist/{chunk-XZUIS3VB.js → chunk-4VV5HJXQ.js} +2683 -952
  18. package/dist/chunk-4VV5HJXQ.js.br +0 -0
  19. package/dist/chunk-4VV5HJXQ.js.gz +0 -0
  20. package/dist/{chunk-BTTAYCGK.mjs → chunk-6PWT46Y4.mjs} +256 -559
  21. package/dist/chunk-6PWT46Y4.mjs.br +0 -0
  22. package/dist/chunk-6PWT46Y4.mjs.gz +0 -0
  23. package/dist/{chunk-FVLBN45Z.js → chunk-CWVPHCMJ.js} +5 -5
  24. package/dist/chunk-CWVPHCMJ.js.br +0 -0
  25. package/dist/chunk-CWVPHCMJ.js.gz +0 -0
  26. package/dist/{chunk-MFGRRONU.mjs → chunk-KK2CFTKC.mjs} +2 -2
  27. package/dist/chunk-KK2CFTKC.mjs.br +0 -0
  28. package/dist/chunk-KK2CFTKC.mjs.gz +0 -0
  29. package/dist/{chunk-XEYB25ZT.js → chunk-LJEI7O6S.js} +3 -0
  30. package/dist/chunk-LJEI7O6S.js.br +0 -0
  31. package/dist/{chunk-XEYB25ZT.js.gz → chunk-LJEI7O6S.js.gz} +0 -0
  32. package/dist/{chunk-WRQ7K3DG.mjs → chunk-QZSA3E4L.mjs} +1 -1
  33. package/dist/chunk-QZSA3E4L.mjs.br +0 -0
  34. package/dist/{chunk-WRQ7K3DG.mjs.gz → chunk-QZSA3E4L.mjs.gz} +0 -0
  35. package/dist/{chunk-QAVJDYB2.js → chunk-RE6NDQH7.js} +197 -197
  36. package/dist/chunk-RE6NDQH7.js.br +0 -0
  37. package/dist/chunk-RE6NDQH7.js.gz +0 -0
  38. package/dist/{chunk-QLUA63T3.mjs → chunk-VUI3VE7K.mjs} +4 -4
  39. package/dist/chunk-VUI3VE7K.mjs.br +0 -0
  40. package/dist/chunk-VUI3VE7K.mjs.gz +0 -0
  41. package/dist/{chunk-MJ6LTUJ3.mjs → chunk-VUNRFZRR.mjs} +2679 -947
  42. package/dist/chunk-VUNRFZRR.mjs.br +0 -0
  43. package/dist/chunk-VUNRFZRR.mjs.gz +0 -0
  44. package/dist/{chunk-UVK2WBCU.js → chunk-VVGYZBF5.js} +2270 -2573
  45. package/dist/chunk-VVGYZBF5.js.br +0 -0
  46. package/dist/chunk-VVGYZBF5.js.gz +0 -0
  47. package/dist/{chunk-BZNYI5U6.js → chunk-XVJSAY7C.js} +821 -821
  48. package/dist/chunk-XVJSAY7C.js.br +0 -0
  49. package/dist/chunk-XVJSAY7C.js.gz +0 -0
  50. package/dist/i18n/de.cjs +3 -0
  51. package/dist/i18n/de.cjs.br +0 -0
  52. package/dist/i18n/de.cjs.gz +0 -0
  53. package/dist/i18n/de.mjs +3 -0
  54. package/dist/i18n/de.mjs.br +0 -0
  55. package/dist/i18n/de.mjs.gz +0 -0
  56. package/dist/i18n/es.cjs +3 -0
  57. package/dist/i18n/es.cjs.br +0 -0
  58. package/dist/i18n/es.cjs.gz +0 -0
  59. package/dist/i18n/es.mjs +3 -0
  60. package/dist/i18n/es.mjs.br +0 -0
  61. package/dist/i18n/es.mjs.gz +0 -0
  62. package/dist/i18n/fr.cjs +3 -0
  63. package/dist/i18n/fr.cjs.br +0 -0
  64. package/dist/i18n/fr.cjs.gz +0 -0
  65. package/dist/i18n/fr.mjs +3 -0
  66. package/dist/i18n/fr.mjs.br +0 -0
  67. package/dist/i18n/fr.mjs.gz +0 -0
  68. package/dist/i18n/zh-CN.cjs +3 -0
  69. package/dist/i18n/zh-CN.cjs.br +0 -0
  70. package/dist/i18n/zh-CN.cjs.gz +0 -0
  71. package/dist/i18n/zh-CN.mjs +3 -0
  72. package/dist/i18n/zh-CN.mjs.br +0 -0
  73. package/dist/i18n/zh-CN.mjs.gz +0 -0
  74. package/dist/i18n.js +4 -4
  75. package/dist/i18n.js.br +0 -0
  76. package/dist/i18n.js.gz +0 -0
  77. package/dist/i18n.mjs +1 -1
  78. package/dist/i18n.mjs.br +0 -0
  79. package/dist/i18n.mjs.gz +0 -0
  80. package/dist/index.d.ts +102 -0
  81. package/dist/index.js +63 -63
  82. package/dist/index.js.br +0 -0
  83. package/dist/index.js.gz +0 -0
  84. package/dist/index.mjs +6 -6
  85. package/dist/index.mjs.br +0 -0
  86. package/dist/index.mjs.gz +0 -0
  87. package/dist/internals.d.ts +102 -0
  88. package/dist/internals.js +105 -105
  89. package/dist/internals.js.br +0 -0
  90. package/dist/internals.js.gz +0 -0
  91. package/dist/internals.mjs +4 -4
  92. package/dist/internals.mjs.br +0 -0
  93. package/dist/internals.mjs.gz +0 -0
  94. package/dist/pptx-viewer.css +1 -1
  95. package/dist/pptx-viewer.css.br +0 -0
  96. package/dist/pptx-viewer.css.gz +0 -0
  97. package/dist/viewer/index.d.ts +102 -0
  98. package/dist/viewer/index.js +27 -27
  99. package/dist/viewer/index.js.br +0 -0
  100. package/dist/viewer/index.js.gz +0 -0
  101. package/dist/viewer/index.mjs +6 -6
  102. package/dist/viewer/index.mjs.br +0 -0
  103. package/dist/viewer/index.mjs.gz +0 -0
  104. package/package.json +1 -1
  105. package/dist/AiChatPanel-5Z4BYP7S.mjs.br +0 -0
  106. package/dist/AiChatPanel-5Z4BYP7S.mjs.gz +0 -0
  107. package/dist/AiChatPanel-DHLJ6LKF.js.br +0 -0
  108. package/dist/AiChatPanel-DHLJ6LKF.js.gz +0 -0
  109. package/dist/Model3DScene-AXT5KCUX.js.br +0 -0
  110. package/dist/Model3DScene-AXT5KCUX.js.gz +0 -0
  111. package/dist/Model3DScene-N36X5Z2Z.mjs.br +0 -0
  112. package/dist/Model3DScene-N36X5Z2Z.mjs.gz +0 -0
  113. package/dist/chunk-BTTAYCGK.mjs.br +0 -0
  114. package/dist/chunk-BTTAYCGK.mjs.gz +0 -0
  115. package/dist/chunk-BZNYI5U6.js.br +0 -0
  116. package/dist/chunk-BZNYI5U6.js.gz +0 -0
  117. package/dist/chunk-CJSIEITL.mjs.br +0 -0
  118. package/dist/chunk-FVLBN45Z.js.br +0 -0
  119. package/dist/chunk-FVLBN45Z.js.gz +0 -0
  120. package/dist/chunk-MFGRRONU.mjs.br +0 -0
  121. package/dist/chunk-MFGRRONU.mjs.gz +0 -0
  122. package/dist/chunk-MJ6LTUJ3.mjs.br +0 -0
  123. package/dist/chunk-MJ6LTUJ3.mjs.gz +0 -0
  124. package/dist/chunk-QAVJDYB2.js.br +0 -0
  125. package/dist/chunk-QAVJDYB2.js.gz +0 -0
  126. package/dist/chunk-QLUA63T3.mjs.br +0 -0
  127. package/dist/chunk-QLUA63T3.mjs.gz +0 -0
  128. package/dist/chunk-UVK2WBCU.js.br +0 -0
  129. package/dist/chunk-UVK2WBCU.js.gz +0 -0
  130. package/dist/chunk-WRQ7K3DG.mjs.br +0 -0
  131. package/dist/chunk-XEYB25ZT.js.br +0 -0
  132. package/dist/chunk-XZUIS3VB.js.br +0 -0
  133. package/dist/chunk-XZUIS3VB.js.gz +0 -0
@@ -106980,7 +106980,7 @@ function applyGroupFillInheritance(children15, fill) {
106980
106980
  }
106981
106981
  }
106982
106982
  }
106983
- async function resolveGroupFillImagePure(host, blipFill, slidePath) {
106983
+ async function resolveGroupFillImagePure(host2, blipFill, slidePath) {
106984
106984
  const blip = blipFill?.["a:blip"];
106985
106985
  const rEmbed = blip?.["@_r:embed"] ? String(blip["@_r:embed"]) : void 0;
106986
106986
  const rLink = blip?.["@_r:link"] ? String(blip["@_r:link"]) : void 0;
@@ -106988,23 +106988,23 @@ async function resolveGroupFillImagePure(host, blipFill, slidePath) {
106988
106988
  if (!relId) {
106989
106989
  return void 0;
106990
106990
  }
106991
- const target = host.slideRelsMap.get(slidePath)?.get(relId);
106991
+ const target = host2.slideRelsMap.get(slidePath)?.get(relId);
106992
106992
  if (!target) {
106993
106993
  return void 0;
106994
106994
  }
106995
106995
  const fillImageMode = blipFill?.["a:tile"] !== void 0 ? "tile" : "stretch";
106996
106996
  if (target.startsWith("http://") || target.startsWith("https://")) {
106997
- return host.allowExternalImages === true ? { fillImageUrl: target, fillImageMode } : void 0;
106997
+ return host2.allowExternalImages === true ? { fillImageUrl: target, fillImageMode } : void 0;
106998
106998
  }
106999
106999
  if (target.startsWith("data:")) {
107000
107000
  return { fillImageUrl: target, fillImageMode };
107001
107001
  }
107002
- const imagePath = host.resolveImagePath(slidePath, target);
107002
+ const imagePath = host2.resolveImagePath(slidePath, target);
107003
107003
  if (!imagePath) {
107004
107004
  return void 0;
107005
107005
  }
107006
- if (host.eagerDecodeImages) {
107007
- const imageData = await host.getImageData(imagePath);
107006
+ if (host2.eagerDecodeImages) {
107007
+ const imageData = await host2.getImageData(imagePath);
107008
107008
  if (imageData) {
107009
107009
  return { fillImageUrl: imageData, fillImageMode };
107010
107010
  }
@@ -130481,17 +130481,64 @@ var init_smartart_node_synthesis = __esm({
130481
130481
  init_smartart_xml_builders();
130482
130482
  }
130483
130483
  });
130484
- function applySmartArtQuickStyle(styleDef, quickStyle, localName292) {
130484
+ function objectChild(node, name, localName292) {
130485
+ const key2 = Object.keys(node).find((candidate) => localName292(candidate) === name);
130486
+ const value = key2 ? node[key2] : void 0;
130487
+ return value && typeof value === "object" ? value : {};
130488
+ }
130489
+ function applySmartArtStyleIntensity(definition, intensity, localName292) {
130490
+ if (!intensity) {
130491
+ return false;
130492
+ }
130493
+ const key2 = Object.keys(definition).find((candidate) => localName292(candidate) === "styleLbl");
130494
+ const value = key2 ? definition[key2] : void 0;
130495
+ const labels = Array.isArray(value) ? value : value ? [value] : [];
130496
+ let changed = false;
130497
+ for (const label of labels) {
130498
+ if (!/^node\d+$/u.test(String(label["@_name"] ?? ""))) {
130499
+ continue;
130500
+ }
130501
+ const styleKey = Object.keys(label).find((candidate) => localName292(candidate) === "style") ?? "dgm:style";
130502
+ const style = objectChild(label, "style", localName292);
130503
+ for (const [name, idx] of [
130504
+ ["fillRef", intensity === "flat" ? 1 : intensity === "moderate" ? 2 : 3],
130505
+ ["effectRef", intensity === "flat" ? 0 : intensity === "moderate" ? 1 : 2]
130506
+ ]) {
130507
+ const refKey = Object.keys(style).find((candidate) => localName292(candidate) === name) ?? `a:${name}`;
130508
+ const ref = objectChild(style, name, localName292);
130509
+ style[refKey] = {
130510
+ ...Object.keys(ref).length ? ref : { "a:schemeClr": { "@_val": "phClr" } },
130511
+ "@_idx": String(idx)
130512
+ };
130513
+ }
130514
+ label[styleKey] = style;
130515
+ if (intensity !== "intense") {
130516
+ const shape3dKey = Object.keys(label).find((candidate) => localName292(candidate) === "sp3d");
130517
+ if (shape3dKey) {
130518
+ label[shape3dKey] = {};
130519
+ }
130520
+ }
130521
+ changed = true;
130522
+ }
130523
+ return changed;
130524
+ }
130525
+ var init_smartart_style_intensity_builder = __esm({
130526
+ "src/core/core/runtime/smartart-style-intensity-builder.ts"() {
130527
+ }
130528
+ });
130529
+ function applySmartArtQuickStyle(styleDef, quickStyle, localName292, intensity) {
130485
130530
  if (!quickStyle) {
130486
130531
  return false;
130487
130532
  }
130488
130533
  let changed = applySmartArtDefinitionMetadata(styleDef, quickStyle, localName292);
130489
130534
  changed = applySmartArtQuickStyleLabels(styleDef, quickStyle.labels, localName292) || changed;
130535
+ changed = applySmartArtStyleIntensity(styleDef, intensity, localName292) || changed;
130490
130536
  return changed;
130491
130537
  }
130492
130538
  var init_smartart_quick_style_builder = __esm({
130493
130539
  "src/core/core/runtime/smartart-quick-style-builder.ts"() {
130494
130540
  init_smartart_definition_builder();
130541
+ init_smartart_style_intensity_builder();
130495
130542
  }
130496
130543
  });
130497
130544
  function asObject2(value) {
@@ -130965,7 +131012,8 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
130965
131012
  (styleDef) => applySmartArtQuickStyle(
130966
131013
  styleDef,
130967
131014
  quickStyle,
130968
- (key2) => this.compatibilityService.getXmlLocalName(key2)
131015
+ (key2) => this.compatibilityService.getXmlLocalName(key2),
131016
+ smartArtData.style
130969
131017
  )
130970
131018
  );
130971
131019
  }
@@ -132918,14 +132966,15 @@ function fabricatedColorsUniqueId(scheme) {
132918
132966
  function fabricatedColorsCategory(scheme) {
132919
132967
  return scheme?.startsWith("monochromatic") ? "accent1" : "colorful";
132920
132968
  }
132921
- function quickStyleLabelXml(name) {
132969
+ function quickStyleLabelXml(name, style = "flat") {
132922
132970
  const isConnector = name === "parChTrans1D2";
132923
- return `<dgm:styleLbl name="${name}"><dgm:scene3d><a:camera prst="orthographicFront"/><a:lightRig rig="threePt" dir="t"/></dgm:scene3d><dgm:sp3d/><dgm:txPr/><dgm:style><a:lnRef idx="${isConnector ? "1" : "2"}"><a:scrgbClr r="0" g="0" b="0"/></a:lnRef><a:fillRef idx="1"><a:scrgbClr r="0" g="0" b="0"/></a:fillRef><a:effectRef idx="0"><a:scrgbClr r="0" g="0" b="0"/></a:effectRef><a:fontRef idx="minor"/></dgm:style></dgm:styleLbl>`;
132971
+ const effectIndex = name.startsWith("node") ? style === "intense" ? 2 : style === "moderate" ? 1 : 0 : 0;
132972
+ return `<dgm:styleLbl name="${name}"><dgm:scene3d><a:camera prst="orthographicFront"/><a:lightRig rig="threePt" dir="t"/></dgm:scene3d><dgm:sp3d/><dgm:txPr/><dgm:style><a:lnRef idx="${isConnector ? "1" : "2"}"><a:scrgbClr r="0" g="0" b="0"/></a:lnRef><a:fillRef idx="${effectIndex + 1}"><a:scrgbClr r="0" g="0" b="0"/></a:fillRef><a:effectRef idx="${effectIndex}"><a:scrgbClr r="0" g="0" b="0"/></a:effectRef><a:fontRef idx="minor"/></dgm:style></dgm:styleLbl>`;
132924
132973
  }
132925
- function buildFabricatedQuickStyleXml() {
132974
+ function buildFabricatedQuickStyleXml(style) {
132926
132975
  return `${XML_PROLOG}\r
132927
132976
  <dgm:styleDef ${DGM_XMLNS} uniqueId="${FABRICATED_QUICKSTYLE_UNIQUE_ID}"><dgm:title val="Simple"/><dgm:desc val=""/><dgm:catLst><dgm:cat type="simple" pri="10100"/></dgm:catLst><dgm:scene3d><a:camera prst="orthographicFront"/><a:lightRig rig="threePt" dir="t"/></dgm:scene3d>${STYLE_LABEL_NAMES.map(
132928
- quickStyleLabelXml
132977
+ (name) => quickStyleLabelXml(name, style)
132929
132978
  ).join("")}</dgm:styleDef>`;
132930
132979
  }
132931
132980
  function schemeClrListXml(accents) {
@@ -133064,7 +133113,7 @@ var init_PptxHandlerRuntimeSaveSmartArtFabrication = __esm({
133064
133113
  { guidByNodeId, presentationGuidByNodeId, drawingRelId }
133065
133114
  ),
133066
133115
  layout: buildFabricatedLayoutDefXml(family2, layoutIdentity),
133067
- quickStyle: buildFabricatedQuickStyleXml(),
133116
+ quickStyle: buildFabricatedQuickStyleXml(data.style),
133068
133117
  colors: buildFabricatedColorsXml(data.colorScheme)
133069
133118
  };
133070
133119
  const relIds = {
@@ -147707,6 +147756,65 @@ var init_smartart_drawing_blip = __esm({
147707
147756
  "src/core/core/runtime/smartart-drawing-blip.ts"() {
147708
147757
  }
147709
147758
  });
147759
+ async function resolveSmartArtDrawingPart(slidePath, diagramDataRelationshipId, drawingExtensionRelId, deps) {
147760
+ if (diagramDataRelationshipId.length === 0) {
147761
+ return void 0;
147762
+ }
147763
+ const slideRels = deps.slideRelationships(slidePath);
147764
+ const slideDrawingTarget = drawingExtensionRelId ? slideRels?.get(drawingExtensionRelId) : void 0;
147765
+ if (slideDrawingTarget) {
147766
+ return {
147767
+ relId: drawingExtensionRelId,
147768
+ path: deps.resolvePath(slidePath, slideDrawingTarget)
147769
+ };
147770
+ }
147771
+ const inferredSlideDrawing = [...slideRels?.entries() ?? []].find(
147772
+ ([, target]) => /(?:^|\/)diagrams\/drawing\d+\.xml$/u.test(target.replaceAll("\\", "/"))
147773
+ );
147774
+ if (inferredSlideDrawing) {
147775
+ return {
147776
+ relId: inferredSlideDrawing[0],
147777
+ path: deps.resolvePath(slidePath, inferredSlideDrawing[1])
147778
+ };
147779
+ }
147780
+ const dataTarget = slideRels?.get(diagramDataRelationshipId);
147781
+ if (!dataTarget) {
147782
+ return void 0;
147783
+ }
147784
+ const dataPath = deps.resolvePath(slidePath, dataTarget);
147785
+ const dataDir = dataPath.replace(/\/[^/]+$/u, "");
147786
+ const dataFile = dataPath.split("/").pop() ?? "";
147787
+ const dataRelsPath = `${dataDir}/_rels/${dataFile}.rels`;
147788
+ const relsXml = await deps.readText(dataRelsPath);
147789
+ if (!relsXml) {
147790
+ return void 0;
147791
+ }
147792
+ try {
147793
+ const parsed = deps.parse(relsXml);
147794
+ const relsRoot = parsed["Relationships"];
147795
+ if (!relsRoot) {
147796
+ return void 0;
147797
+ }
147798
+ const rels = deps.ensureArray(relsRoot["Relationship"]);
147799
+ const drawingRel = rels.find((rel) => {
147800
+ const id2 = String(rel?.["@_Id"] || "").trim();
147801
+ return (!drawingExtensionRelId || id2 === drawingExtensionRelId) && String(rel?.["@_Type"] || "").endsWith("/diagramDrawing");
147802
+ });
147803
+ const id = String(drawingRel?.["@_Id"] || "").trim();
147804
+ const target = String(drawingRel?.["@_Target"] || "").trim();
147805
+ if (id.length === 0 || target.length === 0) {
147806
+ return void 0;
147807
+ }
147808
+ const drawingPath = deps.resolvePath(dataPath, target);
147809
+ return { relId: id, path: drawingPath };
147810
+ } catch {
147811
+ return void 0;
147812
+ }
147813
+ }
147814
+ var init_smartart_drawing_part = __esm({
147815
+ "src/core/core/runtime/smartart-drawing-part.ts"() {
147816
+ }
147817
+ });
147710
147818
  function resolveSmartArtLayoutCategory(uniqueId, categories) {
147711
147819
  for (const category of categories) {
147712
147820
  const family2 = CATEGORY_FAMILY[category.trim().toLowerCase()];
@@ -147762,6 +147870,7 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
147762
147870
  init_smart_art_text_helpers();
147763
147871
  init_PptxHandlerRuntimeSmartArtParsing();
147764
147872
  init_smartart_drawing_blip();
147873
+ init_smartart_drawing_part();
147765
147874
  init_smartart_layout_category();
147766
147875
  init_smartart_text_paragraphs();
147767
147876
  init_smartart_text_style_resolution();
@@ -147879,6 +147988,7 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
147879
147988
  chrome,
147880
147989
  colorTransform,
147881
147990
  quickStyle,
147991
+ style: quickStyle?.effectIntensity === "moderate" || quickStyle?.effectIntensity === "intense" ? quickStyle.effectIntensity : void 0,
147882
147992
  // The theme's own minor-Latin font: what SmartArt text actually
147883
147993
  // renders in absent a per-run `a:latin` override (confirmed: every
147884
147994
  // text-bearing shape across the whole 227-fixture gallery corpus
@@ -147898,71 +148008,14 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
147898
148008
  styleRelId: styleRelationshipId.length > 0 ? styleRelationshipId : void 0
147899
148009
  };
147900
148010
  }
147901
- /**
147902
- * Resolve the SmartArt drawing-shapes part path + relationship id.
147903
- *
147904
- * Strategy:
147905
- * 1. Resolve `dsp:dataModelExt/@relId` in the owning slide's relationship
147906
- * scope, which is where PowerPoint writes diagramDrawing relationships.
147907
- * 2. Fall back to the data part's rels file for compatibility with files
147908
- * emitted by older pptx-viewer versions.
147909
- * 3. Return the matched part path (so the caller can load it
147910
- * directly) and the relationship id (for round-trip preservation).
147911
- */
147912
- async resolveSmartArtDrawingPart(slidePath, diagramDataRelationshipId, drawingExtensionRelId) {
147913
- if (diagramDataRelationshipId.length === 0) {
147914
- return void 0;
147915
- }
147916
- const slideRels = this.slideRelsMap.get(slidePath);
147917
- const slideDrawingTarget = drawingExtensionRelId ? slideRels?.get(drawingExtensionRelId) : void 0;
147918
- if (slideDrawingTarget) {
147919
- return {
147920
- relId: drawingExtensionRelId,
147921
- path: this.resolveImagePath(slidePath, slideDrawingTarget)
147922
- };
147923
- }
147924
- const inferredSlideDrawing = [...slideRels?.entries() ?? []].find(
147925
- ([, target]) => /(?:^|\/)diagrams\/drawing\d+\.xml$/u.test(target.replaceAll("\\", "/"))
147926
- );
147927
- if (inferredSlideDrawing) {
147928
- return {
147929
- relId: inferredSlideDrawing[0],
147930
- path: this.resolveImagePath(slidePath, inferredSlideDrawing[1])
147931
- };
147932
- }
147933
- const dataTarget = slideRels?.get(diagramDataRelationshipId);
147934
- if (!dataTarget) {
147935
- return void 0;
147936
- }
147937
- const dataPath = this.resolveImagePath(slidePath, dataTarget);
147938
- const dataDir = dataPath.replace(/\/[^/]+$/u, "");
147939
- const dataFile = dataPath.split("/").pop() ?? "";
147940
- const dataRelsPath = `${dataDir}/_rels/${dataFile}.rels`;
147941
- const relsXml = await this.zip.file(dataRelsPath)?.async("string");
147942
- if (!relsXml) {
147943
- return void 0;
147944
- }
147945
- try {
147946
- const parsed = this.parser.parse(relsXml);
147947
- const relsRoot = parsed["Relationships"];
147948
- if (!relsRoot) {
147949
- return void 0;
147950
- }
147951
- const rels = this.ensureArray(relsRoot["Relationship"]);
147952
- const drawingRel = rels.find((rel) => {
147953
- const id2 = String(rel?.["@_Id"] || "").trim();
147954
- return (!drawingExtensionRelId || id2 === drawingExtensionRelId) && String(rel?.["@_Type"] || "").endsWith("/diagramDrawing");
147955
- });
147956
- const id = String(drawingRel?.["@_Id"] || "").trim();
147957
- const target = String(drawingRel?.["@_Target"] || "").trim();
147958
- if (id.length === 0 || target.length === 0) {
147959
- return void 0;
147960
- }
147961
- const drawingPath = this.resolveImagePath(dataPath, target);
147962
- return { relId: id, path: drawingPath };
147963
- } catch {
147964
- return void 0;
147965
- }
148011
+ resolveSmartArtDrawingPart(slidePath, diagramDataRelationshipId, drawingExtensionRelId) {
148012
+ return resolveSmartArtDrawingPart(slidePath, diagramDataRelationshipId, drawingExtensionRelId, {
148013
+ slideRelationships: (path) => this.slideRelsMap.get(path),
148014
+ resolvePath: (base, target) => this.resolveImagePath(base, target),
148015
+ readText: (path) => this.zip.file(path)?.async("string") ?? Promise.resolve(void 0),
148016
+ parse: (xml) => this.parser.parse(xml),
148017
+ ensureArray: (value) => this.ensureArray(value)
148018
+ });
147966
148019
  }
147967
148020
  /**
147968
148021
  * Parse cached SmartArt drawing shapes from an absolute part path.
@@ -182638,7 +182691,7 @@ function getThreeRendererHost(three) {
182638
182691
  bufferHeight: 0
182639
182692
  };
182640
182693
  state.renderer = createRenderer(three, state);
182641
- const host = {
182694
+ const host2 = {
182642
182695
  available: state.renderer !== null,
182643
182696
  register(view) {
182644
182697
  state.views.add(view);
@@ -182674,8 +182727,8 @@ function getThreeRendererHost(three) {
182674
182727
  }
182675
182728
  }
182676
182729
  };
182677
- sharedHost = host;
182678
- return host;
182730
+ sharedHost = host2;
182731
+ return host2;
182679
182732
  }
182680
182733
  var MAX_VIEW_PIXELS;
182681
182734
  var sharedHost;
@@ -185642,8 +185695,11 @@ function markWebControlContract(ctor) {
185642
185695
  }
185643
185696
  var RIBBON_COMMAND_STYLES = `
185644
185697
  :host { display: inline-flex; flex: none; }
185698
+ :host([hidden]) { display: none !important; }
185699
+ .badge { position:absolute; top:0; right:0; border-radius:99px; padding:0 3px; background:var(--pptx-primary,#6366f1); color:var(--pptx-primary-foreground,#fff); font-size:9px; }
185700
+ .badge[hidden] { display:none; }
185645
185701
  button {
185646
- box-sizing: border-box; display: inline-flex; flex-direction: column; align-items: center;
185702
+ box-sizing: border-box; position:relative; display: inline-flex; flex-direction: column; align-items: center;
185647
185703
  justify-content: flex-start; gap: 2px; min-width: 54px; max-width: 78px; height: 58px;
185648
185704
  padding: 4px; border: 0; border-radius: 4px; background: transparent;
185649
185705
  color: var(--pptx-foreground, #f9fafb); cursor: pointer; font: inherit;
@@ -185667,6 +185723,24 @@ button:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-off
185667
185723
  }
185668
185724
  `;
185669
185725
  var RIBBON_ICON_PATHS = {
185726
+ spelling: "M2 14 6 5l4 9M3.4 11.4h5.2M12 13.5l2 2 4-4.5",
185727
+ book: "M3 4h5a2 2 0 0 1 2 2v10a2 2 0 0 0-2-2H3zM17 4h-5a2 2 0 0 0-2 2v10a2 2 0 0 1 2-2h5z",
185728
+ shield: "M10 3 4 5.4v4.1c0 3.3 2.5 6 6 7.1 3.5-1.1 6-3.8 6-7.1V5.4zM7 10l2 2 4-4",
185729
+ globe: "M3 10a7 7 0 1 0 14 0 7 7 0 1 0-14 0M3 10h14M10 3c-4 4-4 10 0 14 4-4 4-10 0-14",
185730
+ languages: "M2 5h9M6 3v2M4 5c0 5 5 7 7 8M9 5c0 5-5 7-7 8M11 17l4-9 4 9M12.5 14h5",
185731
+ copy: "M7 7h10v10H7ZM3 13V3h10",
185732
+ compare: "M5 3v11M15 6v11M5 5h7l3 3M15 15H8l-3-3M3 14h4M13 6h4",
185733
+ message: "M3 4h14v9H8l-5 4z",
185734
+ messagePlus: "M3 4h14v9H8l-5 4zM10 6v5M7.5 8.5h5",
185735
+ trash: "M4 6h12M8 6V4h4v2M6 6l.8 10h6.4L14 6",
185736
+ chevronLeft: "m12 4-6 6 6 6",
185737
+ chevronRight: "m8 4 6 6-6 6",
185738
+ lock: "M4 9h12v8H4ZM7 9V6.5a3 3 0 0 1 6 0V9",
185739
+ eyeOff: "M2.5 10S5.5 5 10 5s7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5zM4 4l12 12",
185740
+ palette: "M10 2a8 8 0 1 0 0 16h1a2 2 0 0 0 1-3.7 1.5 1.5 0 0 1 1-2.3h2a3 3 0 0 0 3-3c0-4-4-7-8-7M6 6h.1M10 5h.1M14 7h.1M5 10h.1",
185741
+ pencil: "M12 3l5 5M3 17l1-5L13 3l4 4-9 9Z",
185742
+ monitor: "M2 3h16v11H2ZM7 18h6M10 14v4",
185743
+ paint: "M3 9l6-6 8 8-6 6ZM4 4l8 8M3 18h12M17 13s-2 3-2 4a2 2 0 0 0 4 0c0-1-2-4-2-4",
185670
185744
  camera: "M2 6h4l2-3h4l2 3h4v11H2ZM7 11a3 3 0 1 0 6 0 3 3 0 1 0-6 0",
185671
185745
  eraser: "M3 12l8-8 6 6-7 7H7ZM3 17h14M7 8l6 6",
185672
185746
  reset: "M4 10a6 6 0 1 1 1.8 4.2M4 6v4h4",
@@ -185699,11 +185773,13 @@ function definePptxRibbonCommand(registry) {
185699
185773
  "pressed",
185700
185774
  "expanded",
185701
185775
  "title",
185702
- "data-ribbon-control"
185776
+ "data-ribbon-control",
185777
+ "badge"
185703
185778
  ];
185704
185779
  button;
185705
185780
  text;
185706
185781
  path;
185782
+ badge;
185707
185783
  constructor() {
185708
185784
  super();
185709
185785
  const root = this.attachShadow({ mode: "open" });
@@ -185718,6 +185794,10 @@ function definePptxRibbonCommand(registry) {
185718
185794
  svg.append(this.path);
185719
185795
  this.text = document.createElement("span");
185720
185796
  this.button.append(svg, this.text);
185797
+ this.badge = document.createElement("span");
185798
+ this.badge.className = "badge";
185799
+ this.badge.setAttribute("aria-hidden", "true");
185800
+ this.button.append(this.badge);
185721
185801
  root.append(this.button);
185722
185802
  this.button.addEventListener("keydown", (event) => {
185723
185803
  if ((event.key === " " || event.key === "Enter") && !event.ctrlKey && !event.metaKey && !event.altKey) {
@@ -185741,6 +185821,8 @@ function definePptxRibbonCommand(registry) {
185741
185821
  }
185742
185822
  sync() {
185743
185823
  this.text.textContent = this.getAttribute("label") ?? "";
185824
+ this.badge.textContent = this.getAttribute("badge") ?? "";
185825
+ this.badge.hidden = !this.badge.textContent;
185744
185826
  this.button.title = this.getAttribute("title") ?? this.text.textContent;
185745
185827
  this.button.disabled = this.hasAttribute("disabled");
185746
185828
  this.path.setAttribute("d", RIBBON_ICON_PATHS[this.getAttribute("icon") ?? ""] ?? "");
@@ -185756,834 +185838,6 @@ function definePptxRibbonCommand(registry) {
185756
185838
  }
185757
185839
  registry.define("pptx-ui-ribbon-command", RibbonCommand);
185758
185840
  }
185759
- var STYLES = `
185760
- :host { display: inline-flex; flex: none; align-self: stretch; }
185761
- .group { box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
185762
- min-height: 78px; padding: 4px 8px 2px; border-right: 1px solid color-mix(in srgb, var(--pptx-border, #33334d) 60%, transparent); }
185763
- :host(:last-child) .group { border-right: 0; }
185764
- .row { display: flex; align-items: flex-start; gap: 4px; }
185765
- ::slotted(*) { flex-shrink: 0; }
185766
- .caption { padding-top: 2px; color: var(--pptx-muted-foreground, #94a3b8); font: inherit;
185767
- font-size: 9px; line-height: 12px; text-align: center; white-space: nowrap; }
185768
- `;
185769
- function definePptxRibbonGroup(registry) {
185770
- if (registry.get("pptx-ui-ribbon-group")) {
185771
- return;
185772
- }
185773
- class RibbonGroup extends HTMLElement {
185774
- static observedAttributes = ["label"];
185775
- caption;
185776
- constructor() {
185777
- super();
185778
- const root = this.attachShadow({ mode: "open" });
185779
- attachControlStyles(root, STYLES);
185780
- const group2 = document.createElement("div");
185781
- group2.className = "group";
185782
- const row = document.createElement("div");
185783
- row.className = "row";
185784
- row.append(document.createElement("slot"));
185785
- this.caption = document.createElement("span");
185786
- this.caption.className = "caption";
185787
- group2.append(row, this.caption);
185788
- root.append(group2);
185789
- }
185790
- connectedCallback() {
185791
- this.setAttribute("role", "group");
185792
- this.sync();
185793
- }
185794
- attributeChangedCallback() {
185795
- this.sync();
185796
- }
185797
- sync() {
185798
- const label = this.getAttribute("label") ?? "";
185799
- this.caption.textContent = label;
185800
- this.setAttribute("aria-label", label);
185801
- }
185802
- }
185803
- registry.define("pptx-ui-ribbon-group", RibbonGroup);
185804
- }
185805
- function definePptxRibbonToggle(registry) {
185806
- if (registry.get("pptx-ui-ribbon-toggle")) {
185807
- return;
185808
- }
185809
- class RibbonToggle extends HTMLElement {
185810
- static observedAttributes = ["label", "checked", "disabled", "title"];
185811
- checkbox;
185812
- text;
185813
- constructor() {
185814
- super();
185815
- const root = this.attachShadow({ mode: "open" });
185816
- attachControlStyles(
185817
- root,
185818
- `
185819
- :host { display: block; }
185820
- label { display: flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 4px;
185821
- color: var(--pptx-foreground, #f9fafb); font: inherit; font-size: 10px; white-space: nowrap; cursor: pointer; }
185822
- :host([disabled]) label { color: var(--pptx-muted-foreground, #9ca3af); cursor: not-allowed; }
185823
- @media (pointer: coarse), (max-width: 767px) { label { min-height: 44px; font-size: 12px; } }
185824
- `
185825
- );
185826
- const label = document.createElement("label");
185827
- this.checkbox = document.createElement("pptx-ui-checkbox");
185828
- this.text = document.createTextNode("");
185829
- label.append(this.checkbox, this.text);
185830
- label.addEventListener("click", (event) => {
185831
- event.preventDefault();
185832
- if (event.target !== this.checkbox) {
185833
- this.checkbox.click();
185834
- }
185835
- });
185836
- this.checkbox.addEventListener("input", (event) => event.stopPropagation());
185837
- this.checkbox.addEventListener("change", (event) => {
185838
- event.stopPropagation();
185839
- const checked = this.checkbox.checked;
185840
- this.sync();
185841
- const id = this.getAttribute("data-ribbon-control");
185842
- if (!this.hasAttribute("disabled") && id) {
185843
- this.dispatchEvent(
185844
- new CustomEvent("toggle-request", {
185845
- detail: { id, checked },
185846
- bubbles: true,
185847
- composed: true
185848
- })
185849
- );
185850
- }
185851
- });
185852
- root.append(label);
185853
- }
185854
- connectedCallback() {
185855
- this.sync();
185856
- }
185857
- attributeChangedCallback() {
185858
- this.sync();
185859
- }
185860
- sync() {
185861
- const label = this.getAttribute("label") ?? "";
185862
- this.text.textContent = label;
185863
- this.checkbox.setAttribute("aria-label", label);
185864
- this.checkbox.title = this.getAttribute("title") ?? label;
185865
- this.checkbox.checked = this.hasAttribute("checked");
185866
- this.checkbox.disabled = this.hasAttribute("disabled");
185867
- }
185868
- }
185869
- registry.define("pptx-ui-ribbon-toggle", RibbonToggle);
185870
- }
185871
- var SEARCH_STYLES = `
185872
- :host {
185873
- display: flex;
185874
- align-items: center;
185875
- gap: 8px;
185876
- box-sizing: border-box;
185877
- width: 100%;
185878
- height: 40px;
185879
- padding: 0 12px;
185880
- border: 1px solid var(--pptx-input, #374151);
185881
- background: var(--pptx-card, #111827);
185882
- color: var(--pptx-muted-foreground, #9ca3af);
185883
- font: inherit;
185884
- }
185885
- :host(:focus-within) { border-color: var(--pptx-ring, #6366f1); }
185886
- :host([variant="titlebar"]) {
185887
- height: 28px;
185888
- gap: 7px;
185889
- padding-inline: 14px;
185890
- border-color: var(--pptx-border, #374151);
185891
- border-radius: 6px;
185892
- background: var(--pptx-background, #030712);
185893
- }
185894
- :host([variant="titlebar"]:focus-within) {
185895
- border-color: var(--pptx-ring, #6366f1);
185896
- color: var(--pptx-foreground, #f3f4f6);
185897
- }
185898
- :host([disabled]) { opacity: .5; cursor: not-allowed; }
185899
- svg { width: 16px; height: 16px; flex: none; }
185900
- :host([variant="titlebar"]) svg { width: 14px; height: 14px; }
185901
- input {
185902
- min-width: 0;
185903
- width: 100%;
185904
- height: 100%;
185905
- flex: 1;
185906
- padding: 0;
185907
- border: 0;
185908
- outline: 0;
185909
- background: transparent;
185910
- color: var(--pptx-card-foreground, #f3f4f6);
185911
- font: inherit;
185912
- font-size: 13px;
185913
- }
185914
- :host([variant="titlebar"]) input {
185915
- font-size: 11px;
185916
- color: var(--pptx-foreground, #f3f4f6);
185917
- }
185918
- input::placeholder {
185919
- color: var(--pptx-muted-foreground, #9ca3af);
185920
- opacity: .8;
185921
- }
185922
- input::-webkit-search-cancel-button { display: none; }
185923
- @media (forced-colors: active) {
185924
- :host {
185925
- border-color: CanvasText;
185926
- background: Canvas;
185927
- color: CanvasText;
185928
- }
185929
- :host(:focus-within) {
185930
- outline: 2px solid Highlight;
185931
- outline-offset: 2px;
185932
- }
185933
- input { color: CanvasText; }
185934
- }
185935
- `;
185936
- var SEARCH_ICON = `<svg part="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>`;
185937
- function definePptxSearchField(registry) {
185938
- if (registry.get("pptx-ui-search")) {
185939
- return;
185940
- }
185941
- class PptxSearchField extends HTMLElement {
185942
- static observedAttributes = ["placeholder", "aria-label", "disabled", "value"];
185943
- input;
185944
- currentValue = "";
185945
- constructor() {
185946
- super();
185947
- const root = this.attachShadow({ mode: "open", delegatesFocus: true });
185948
- attachControlStyles(root, SEARCH_STYLES);
185949
- const icon = document.createElement("template");
185950
- icon.innerHTML = SEARCH_ICON;
185951
- root.append(icon.content.cloneNode(true));
185952
- this.input = document.createElement("input");
185953
- this.input.type = "search";
185954
- this.input.setAttribute("part", "input");
185955
- this.input.addEventListener("input", (event) => {
185956
- event.stopPropagation();
185957
- this.currentValue = this.input.value;
185958
- this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
185959
- });
185960
- this.input.addEventListener("change", (event) => {
185961
- event.stopPropagation();
185962
- this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
185963
- });
185964
- root.append(this.input);
185965
- }
185966
- connectedCallback() {
185967
- this.sync();
185968
- if (this.hasAttribute("value")) {
185969
- this.value = this.getAttribute("value") ?? "";
185970
- }
185971
- }
185972
- attributeChangedCallback(name) {
185973
- if (name === "value") {
185974
- this.value = this.getAttribute("value") ?? "";
185975
- } else {
185976
- this.sync();
185977
- }
185978
- }
185979
- get value() {
185980
- return this.currentValue;
185981
- }
185982
- set value(next) {
185983
- this.currentValue = String(next ?? "");
185984
- if (this.input.value !== this.currentValue) {
185985
- this.input.value = this.currentValue;
185986
- }
185987
- }
185988
- get disabled() {
185989
- return this.hasAttribute("disabled");
185990
- }
185991
- set disabled(next) {
185992
- this.toggleAttribute("disabled", Boolean(next));
185993
- }
185994
- focus(options) {
185995
- this.input.focus(options);
185996
- }
185997
- select() {
185998
- this.input.select();
185999
- }
186000
- sync() {
186001
- this.input.placeholder = this.getAttribute("placeholder") ?? "";
186002
- this.input.setAttribute(
186003
- "aria-label",
186004
- this.getAttribute("aria-label") ?? this.input.placeholder
186005
- );
186006
- this.input.disabled = this.hasAttribute("disabled");
186007
- }
186008
- }
186009
- registry.define("pptx-ui-search", PptxSearchField);
186010
- }
186011
- var SELECT_OPTION_ATTRIBUTES = [
186012
- "value",
186013
- "disabled",
186014
- "label",
186015
- "selected",
186016
- "hidden",
186017
- "data-display-label",
186018
- "data-description",
186019
- "style"
186020
- ];
186021
- function collectSelectChoices(options) {
186022
- return options.map((option) => {
186023
- const group2 = option.parentElement instanceof HTMLOptGroupElement ? option.parentElement : null;
186024
- return {
186025
- value: option.value,
186026
- label: option.label || option.textContent?.trim() || "",
186027
- disabled: option.disabled || Boolean(group2?.disabled),
186028
- hidden: Boolean(option.hidden) || Boolean(group2?.hidden),
186029
- group: group2?.label ?? "",
186030
- ...option.dataset.displayLabel ? { displayLabel: option.dataset.displayLabel } : {},
186031
- ...option.dataset.description ? { description: option.dataset.description } : {},
186032
- ...option.style.fontFamily ? { fontFamily: option.style.fontFamily } : {}
186033
- };
186034
- });
186035
- }
186036
- function renderSelectMenu(menu, choices2, value) {
186037
- const menuItems = [];
186038
- let previousGroup = "";
186039
- choices2.forEach((choice, index) => {
186040
- if (choice.hidden) {
186041
- return;
186042
- }
186043
- if (choice.group && choice.group !== previousGroup) {
186044
- const heading = document.createElement("div");
186045
- heading.className = "group";
186046
- heading.setAttribute("role", "presentation");
186047
- heading.textContent = choice.group;
186048
- menuItems.push(heading);
186049
- }
186050
- previousGroup = choice.group;
186051
- const item3 = document.createElement("div");
186052
- item3.className = "option";
186053
- item3.setAttribute("role", "option");
186054
- item3.setAttribute("aria-selected", String(choice.value === value));
186055
- item3.setAttribute("aria-disabled", String(choice.disabled));
186056
- item3.id = `${menu.id}-${index}`;
186057
- item3.dataset.index = String(index);
186058
- item3.textContent = choice.displayLabel ?? choice.label;
186059
- if (choice.fontFamily) {
186060
- item3.style.fontFamily = choice.fontFamily;
186061
- }
186062
- if (choice.description) {
186063
- const description = document.createElement("span");
186064
- description.className = "description";
186065
- description.textContent = choice.description;
186066
- item3.append(description);
186067
- }
186068
- menuItems.push(item3);
186069
- });
186070
- menu.replaceChildren(...menuItems);
186071
- }
186072
- function positionSelectMenu(menu, trigger) {
186073
- const rect22 = trigger.getBoundingClientRect();
186074
- const margin = 8;
186075
- const gap = 4;
186076
- const width = Math.max(0, window.innerWidth - margin * 2);
186077
- const below = Math.max(0, window.innerHeight - rect22.bottom - gap - margin);
186078
- const above = Math.max(0, rect22.top - gap - margin);
186079
- menu.style.minWidth = `${Math.min(rect22.width, width)}px`;
186080
- menu.style.maxWidth = `${width}px`;
186081
- const heightCap = trigger.getRootNode() instanceof ShadowRoot && trigger.getRootNode().host.getAttribute("data-font-picker") === "family" ? 320 : 240;
186082
- menu.style.maxHeight = `${heightCap}px`;
186083
- const preferredHeight = menu.getBoundingClientRect().height;
186084
- const flip = below < preferredHeight && above > below;
186085
- menu.style.maxHeight = `${Math.min(heightCap, flip ? above : below)}px`;
186086
- const { height, width: menuWidth } = menu.getBoundingClientRect();
186087
- menu.style.top = `${Math.max(margin, flip ? rect22.top - gap - height : rect22.bottom + gap)}px`;
186088
- menu.style.left = `${Math.max(margin, Math.min(rect22.left, window.innerWidth - menuWidth - margin))}px`;
186089
- }
186090
- function markSelectActive(menu, trigger, active2, open) {
186091
- for (const item3 of menu.querySelectorAll("[data-index]")) {
186092
- item3.toggleAttribute("data-active", Number(item3.dataset.index) === active2 && open);
186093
- }
186094
- if (open && active2 >= 0) {
186095
- trigger.setAttribute("aria-activedescendant", `${menu.id}-${active2}`);
186096
- }
186097
- menu.querySelector("[data-active]")?.scrollIntoView?.({ block: "nearest" });
186098
- }
186099
- function nextSelectActive(choices2, active2, step) {
186100
- for (let index = 0; index < choices2.length; index++) {
186101
- active2 = (active2 + step + choices2.length) % choices2.length;
186102
- if (!choices2[active2].disabled && !choices2[active2].hidden) {
186103
- return active2;
186104
- }
186105
- }
186106
- return active2;
186107
- }
186108
- var SELECT_RIBBON_STYLES = `
186109
- :host([variant^="ribbon-"][disabled]) { opacity: .4; }
186110
- :host([variant^="ribbon-"]) button {
186111
- height: 28px; min-height: 28px; padding: 4px 8px; gap: 4px;
186112
- border: 1px solid color-mix(in oklab, var(--pptx-border) 60%, transparent);
186113
- border-radius: 3px; font-size: 12px; line-height: 18px;
186114
- background: color-mix(in oklab, var(--pptx-background) 60%, transparent);
186115
- color: var(--pptx-foreground);
186116
- }
186117
- :host([variant^="ribbon-"]) .value { flex: 1; min-width: 0; }
186118
- :host([variant^="ribbon-"]) .chevron {
186119
- width: 16px; height: 16px; margin: 0; border: 0; transform: none;
186120
- }
186121
- :host([variant^="ribbon-"]) .chevron svg { display: block; width: 16px; height: 16px; }
186122
- :host([variant="ribbon-font"]) .chevron { color: var(--pptx-muted-foreground); }
186123
- :host([variant="ribbon-font"][data-font-picker="size"]) button { padding-inline: 6px; }
186124
- :host([variant="ribbon-icon"]) button {
186125
- width: 36px; gap: 6px; padding: 6px 10px; border: 0; font-size: 12px; line-height: 16px;
186126
- background: var(--pptx-muted); justify-content: center;
186127
- }
186128
- :host([variant="ribbon-icon"]) :is(.value, .chevron) { display: none; }
186129
- ::slotted(svg[slot="icon"]) { display: block; width: 16px; height: 16px; flex: none; }
186130
- :host([variant^="ribbon-"]) button:hover:not(:disabled) { background: var(--pptx-accent); }
186131
- :host([variant^="ribbon-"]) .menu {
186132
- width: 192px; padding: 4px 0; border-radius: 8px; font-size: 12px; line-height: 16px;
186133
- }
186134
- :host([data-font-picker="family"]) .menu { width: 256px; }
186135
- :host([variant^="ribbon-"]) .option {
186136
- display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 0;
186137
- }
186138
- :host([variant^="ribbon-"]) .option[aria-selected="true"] {
186139
- background: transparent; color: var(--pptx-foreground);
186140
- }
186141
- :host([variant^="ribbon-"]) .option:hover,
186142
- :host([variant^="ribbon-"]) .option[data-active] { background: var(--pptx-muted); filter: none; }
186143
- :host([variant^="ribbon-"]) .group {
186144
- padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: .25px;
186145
- font-size: 10px; line-height: 15px;
186146
- }
186147
- @media (max-width: 767px) {
186148
- :host([variant^="ribbon-"]) button { height: 44px; min-height: 44px; }
186149
- }
186150
- .description { flex: none; color: var(--pptx-muted-foreground); font-size: 10px; line-height: 15px; }
186151
- `;
186152
- var SELECT_STYLES = `
186153
- :host {
186154
- display: inline-block;
186155
- box-sizing: border-box;
186156
- min-width: 0;
186157
- max-width: 100%;
186158
- border: 0 !important;
186159
- padding: 0 !important;
186160
- background: transparent !important;
186161
- box-shadow: none !important;
186162
- color: var(--pptx-foreground, #e2e8f0);
186163
- font: inherit;
186164
- font-size: 12px;
186165
- vertical-align: middle;
186166
- }
186167
- :host([disabled]) { opacity: .5; cursor: not-allowed; }
186168
- button {
186169
- box-sizing: border-box;
186170
- width: 100%;
186171
- min-height: 28px;
186172
- display: flex;
186173
- align-items: center;
186174
- justify-content: space-between;
186175
- gap: 10px;
186176
- padding: 4px 7px;
186177
- border: 1px solid var(--pptx-border, #3f3f52);
186178
- border-radius: 5px;
186179
- background: var(--pptx-select-control-bg, var(--pptx-background, #11111b));
186180
- color: inherit;
186181
- font: inherit;
186182
- font-size: inherit;
186183
- text-align: left;
186184
- cursor: pointer;
186185
- }
186186
- :host(.bg-muted) button { background: var(--pptx-muted, #1f2937); }
186187
- :host(.bg-popover) button { background: var(--pptx-popover, #111827); }
186188
- button:focus-visible {
186189
- outline: 2px solid var(--pptx-ring, #6366f1);
186190
- outline-offset: 2px;
186191
- }
186192
- button:disabled { cursor: not-allowed; }
186193
- @media (pointer: coarse), (max-width: 767px) {
186194
- button { min-height: 44px; }
186195
- }
186196
- .value {
186197
- overflow: hidden;
186198
- text-overflow: ellipsis;
186199
- white-space: nowrap;
186200
- }
186201
- .chevron svg { display: none; }
186202
- .chevron {
186203
- flex: none;
186204
- width: 6px;
186205
- height: 6px;
186206
- margin: 0 2px 3px 0;
186207
- border-right: 1.5px solid currentColor;
186208
- border-bottom: 1.5px solid currentColor;
186209
- transform: rotate(45deg);
186210
- }
186211
- :host([open]) .chevron {
186212
- margin: 3px 2px 0 0;
186213
- transform: rotate(225deg);
186214
- }
186215
- .menu {
186216
- box-sizing: border-box;
186217
- position: fixed;
186218
- margin: 0;
186219
- padding: 4px;
186220
- min-width: 90px;
186221
- max-height: min(240px, 50vh);
186222
- overflow: auto;
186223
- border: 1px solid var(--pptx-border, #3f3f52);
186224
- border-radius: 5px;
186225
- background: var(--pptx-popover, var(--pptx-background, #11111b));
186226
- color: var(--pptx-popover-foreground, var(--pptx-foreground, #e2e8f0));
186227
- box-shadow: 0 8px 20px #0004;
186228
- font: inherit;
186229
- font-size: inherit;
186230
- }
186231
- .menu:not(:popover-open):not([data-fallback-open]) { display: none; }
186232
- .option {
186233
- display: block;
186234
- box-sizing: border-box;
186235
- width: 100%;
186236
- padding: 6px 8px;
186237
- border-radius: 3px;
186238
- cursor: pointer;
186239
- white-space: nowrap;
186240
- }
186241
- .group {
186242
- padding: 7px 8px 3px;
186243
- color: var(--pptx-muted-foreground, #9ca3af);
186244
- font-size: .9em;
186245
- font-weight: 600;
186246
- }
186247
- .option:not([aria-disabled="true"]):hover,
186248
- .option[data-active]:not([aria-selected="true"]) {
186249
- background: color-mix(in srgb, var(--pptx-primary, #e86a40) 20%, var(--pptx-popover, #11111b));
186250
- }
186251
- .option[aria-selected="true"] {
186252
- background: var(--pptx-primary, #e86a40);
186253
- color: var(--pptx-primary-foreground, #fff);
186254
- }
186255
- .option[aria-selected="true"]:hover { filter: brightness(1.08); }
186256
- .option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
186257
- @media (forced-colors: active) {
186258
- button, .menu {
186259
- border-color: CanvasText;
186260
- background: Canvas;
186261
- color: CanvasText;
186262
- }
186263
- .option[aria-selected="true"],
186264
- .option[data-active],
186265
- .option:not([aria-disabled="true"]):hover {
186266
- background: Highlight;
186267
- color: HighlightText;
186268
- }
186269
- }
186270
- ${SELECT_RIBBON_STYLES}
186271
- `;
186272
- function createSelectTrigger() {
186273
- const trigger = document.createElement("button");
186274
- trigger.type = "button";
186275
- trigger.setAttribute("part", "trigger");
186276
- trigger.setAttribute("role", "combobox");
186277
- trigger.setAttribute("aria-haspopup", "listbox");
186278
- trigger.setAttribute("aria-expanded", "false");
186279
- const icon = document.createElement("slot");
186280
- icon.name = "icon";
186281
- const text22 = document.createElement("span");
186282
- text22.className = "value";
186283
- text22.setAttribute("part", "value");
186284
- const chevron2 = document.createElement("span");
186285
- chevron2.className = "chevron";
186286
- chevron2.setAttribute("part", "indicator");
186287
- chevron2.setAttribute("aria-hidden", "true");
186288
- const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
186289
- svg.setAttribute("viewBox", "0 0 24 24");
186290
- svg.setAttribute("fill", "none");
186291
- svg.setAttribute("stroke", "currentColor");
186292
- svg.setAttribute("stroke-width", "2");
186293
- svg.setAttribute("stroke-linecap", "round");
186294
- svg.setAttribute("stroke-linejoin", "round");
186295
- const path = document.createElementNS(svg.namespaceURI, "path");
186296
- path.setAttribute("d", "m6 9 6 6 6-6");
186297
- svg.append(path);
186298
- chevron2.append(svg);
186299
- trigger.append(icon, text22, chevron2);
186300
- return { trigger, text: text22 };
186301
- }
186302
- function prependSelectCustomSlot(host, menu) {
186303
- if (host.querySelector('[slot="custom"]')) {
186304
- const custom = document.createElement("slot");
186305
- custom.name = "custom";
186306
- menu.prepend(custom);
186307
- }
186308
- }
186309
- function createSelectValueElement() {
186310
- class SelectValueElement extends HTMLElement {
186311
- get value() {
186312
- const requested = this.getAttribute("value");
186313
- const options = this.options;
186314
- if (this.getAttribute("variant") === "ribbon-font" && requested !== null) {
186315
- return requested;
186316
- }
186317
- if (requested !== null && (!options.length || options.some((option) => option.value === requested))) {
186318
- return requested;
186319
- }
186320
- return options.find((option) => option.selected)?.value ?? options.find(
186321
- (option) => !option.disabled && !option.closest("optgroup[disabled]") && !option.hidden
186322
- )?.value ?? options[0]?.value ?? requested ?? "";
186323
- }
186324
- set value(next) {
186325
- this.setAttribute("value", String(next ?? ""));
186326
- }
186327
- get options() {
186328
- return [...this.querySelectorAll("option")];
186329
- }
186330
- get selectedIndex() {
186331
- return this.options.findIndex((option) => option.value === this.value);
186332
- }
186333
- set selectedIndex(index) {
186334
- this.value = this.options[index]?.value ?? "";
186335
- }
186336
- }
186337
- return SelectValueElement;
186338
- }
186339
- var nextSelectId = 0;
186340
- function definePptxSelect(registry) {
186341
- if (registry.get("pptx-ui-select")) {
186342
- return;
186343
- }
186344
- class PptxSelect extends createSelectValueElement() {
186345
- static formAssociated = true;
186346
- static observedAttributes = ["value", "disabled", "aria-label"];
186347
- internals;
186348
- trigger;
186349
- text;
186350
- menu;
186351
- observer;
186352
- refreshFrame = 0;
186353
- choices = [];
186354
- active = -1;
186355
- open = false;
186356
- search = "";
186357
- searchTimer = 0;
186358
- defaultValue = "";
186359
- constructor() {
186360
- super();
186361
- try {
186362
- this.internals = this.attachInternals();
186363
- } catch {
186364
- this.internals = void 0;
186365
- }
186366
- const root = this.attachShadow({ mode: "open", delegatesFocus: true });
186367
- attachControlStyles(root, SELECT_STYLES);
186368
- ({ trigger: this.trigger, text: this.text } = createSelectTrigger());
186369
- this.menu = document.createElement("div");
186370
- this.menu.className = "menu";
186371
- this.menu.id = `pptx-ui-select-options-${++nextSelectId}`;
186372
- this.menu.setAttribute("role", "listbox");
186373
- this.menu.setAttribute("popover", "manual");
186374
- this.menu.setAttribute("part", "popup");
186375
- this.trigger.setAttribute("aria-controls", this.menu.id);
186376
- root.append(this.trigger, this.menu);
186377
- this.trigger.addEventListener("click", () => this.open ? this.close() : this.show());
186378
- this.trigger.addEventListener("keydown", (event) => this.onKeyDown(event));
186379
- this.menu.addEventListener("pointerdown", (event) => {
186380
- if (event.target.closest("[data-index]")) {
186381
- event.preventDefault();
186382
- }
186383
- });
186384
- this.menu.addEventListener("click", (event) => {
186385
- const target = event.target.closest("[data-index]");
186386
- if (target) {
186387
- this.commit(Number(target.dataset.index));
186388
- }
186389
- });
186390
- this.observer = new MutationObserver(() => {
186391
- if (!this.refreshFrame) {
186392
- this.refreshFrame = requestAnimationFrame(() => {
186393
- this.refreshFrame = 0;
186394
- this.refresh();
186395
- });
186396
- }
186397
- });
186398
- }
186399
- connectedCallback() {
186400
- this.defaultValue = this.getAttribute("value") ?? "";
186401
- this.observer.observe(this, {
186402
- childList: true,
186403
- subtree: true,
186404
- attributes: true,
186405
- characterData: true,
186406
- attributeFilter: SELECT_OPTION_ATTRIBUTES
186407
- });
186408
- this.refresh();
186409
- }
186410
- disconnectedCallback() {
186411
- this.close();
186412
- window.clearTimeout(this.searchTimer);
186413
- this.searchTimer = 0;
186414
- this.search = "";
186415
- this.observer.disconnect();
186416
- cancelAnimationFrame(this.refreshFrame);
186417
- this.refreshFrame = 0;
186418
- }
186419
- attributeChangedCallback() {
186420
- this.refresh();
186421
- }
186422
- get disabled() {
186423
- return this.hasAttribute("disabled");
186424
- }
186425
- set disabled(next) {
186426
- this.toggleAttribute("disabled", Boolean(next));
186427
- }
186428
- focus(options) {
186429
- this.trigger.focus(options);
186430
- }
186431
- formResetCallback() {
186432
- this.value = this.defaultValue;
186433
- }
186434
- formDisabledCallback(disabled) {
186435
- this.disabled = disabled;
186436
- }
186437
- refresh() {
186438
- if (!this.trigger) {
186439
- return;
186440
- }
186441
- const options = [...this.querySelectorAll("option")];
186442
- this.choices = collectSelectChoices(options);
186443
- if (!this.hasAttribute("value") && this.choices.length) {
186444
- this.value = options.find((option) => option.selected)?.value ?? this.choices.find((choice) => !choice.disabled && !choice.hidden)?.value ?? this.choices[0].value;
186445
- }
186446
- this.text.textContent = this.choices.find((choice) => choice.value === this.value)?.displayLabel ?? this.choices.find((choice) => choice.value === this.value)?.label ?? this.value;
186447
- this.trigger.disabled = this.disabled;
186448
- if (this.disabled) {
186449
- this.close();
186450
- }
186451
- this.trigger.setAttribute("aria-label", this.getAttribute("aria-label") ?? "");
186452
- this.internals?.setFormValue?.(this.disabled ? null : this.value);
186453
- if (this.open || this.menu.childElementCount) {
186454
- this.renderMenu();
186455
- }
186456
- }
186457
- renderMenu() {
186458
- renderSelectMenu(this.menu, this.choices, this.value);
186459
- prependSelectCustomSlot(this, this.menu);
186460
- markSelectActive(this.menu, this.trigger, this.active, this.open);
186461
- }
186462
- show() {
186463
- if (this.disabled || !this.choices.some((choice) => !choice.disabled && !choice.hidden) || this.open) {
186464
- return;
186465
- }
186466
- this.open = true;
186467
- this.setAttribute("open", "");
186468
- const selected = this.choices.findIndex(
186469
- (choice) => choice.value === this.value && !choice.disabled && !choice.hidden
186470
- );
186471
- this.active = selected >= 0 ? selected : this.choices.findIndex((choice) => !choice.disabled && !choice.hidden);
186472
- this.renderMenu();
186473
- if (typeof this.menu.showPopover === "function") {
186474
- this.menu.showPopover();
186475
- } else {
186476
- this.menu.dataset.fallbackOpen = "";
186477
- }
186478
- this.trigger.setAttribute("aria-expanded", "true");
186479
- this.position();
186480
- markSelectActive(this.menu, this.trigger, this.active, this.open);
186481
- document.addEventListener("pointerdown", this.onOutside, true);
186482
- window.addEventListener("resize", this.position);
186483
- window.addEventListener("scroll", this.position, true);
186484
- }
186485
- close() {
186486
- if (!this.open) {
186487
- return;
186488
- }
186489
- this.open = false;
186490
- window.clearTimeout(this.searchTimer);
186491
- this.search = "";
186492
- this.removeAttribute("open");
186493
- if (this.menu.matches(":popover-open")) {
186494
- this.menu.hidePopover();
186495
- }
186496
- delete this.menu.dataset.fallbackOpen;
186497
- this.trigger.setAttribute("aria-expanded", "false");
186498
- this.trigger.removeAttribute("aria-activedescendant");
186499
- document.removeEventListener("pointerdown", this.onOutside, true);
186500
- window.removeEventListener("resize", this.position);
186501
- window.removeEventListener("scroll", this.position, true);
186502
- }
186503
- onOutside = (event) => {
186504
- if (!event.composedPath().includes(this)) {
186505
- this.close();
186506
- }
186507
- };
186508
- position = () => {
186509
- if (!this.open) {
186510
- return;
186511
- }
186512
- positionSelectMenu(this.menu, this.trigger);
186513
- };
186514
- move(step) {
186515
- if (!this.open) {
186516
- this.show();
186517
- }
186518
- if (!this.open) {
186519
- return;
186520
- }
186521
- this.active = nextSelectActive(this.choices, this.active, step);
186522
- markSelectActive(this.menu, this.trigger, this.active, this.open);
186523
- }
186524
- commit(index) {
186525
- const choice = this.choices[index];
186526
- if (!choice || choice.disabled || choice.hidden) {
186527
- return;
186528
- }
186529
- const changed = this.value !== choice.value;
186530
- this.value = choice.value;
186531
- this.close();
186532
- this.trigger.focus();
186533
- if (changed) {
186534
- this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
186535
- this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
186536
- }
186537
- }
186538
- onKeyDown(event) {
186539
- if (this.disabled) {
186540
- return;
186541
- }
186542
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
186543
- event.preventDefault();
186544
- event.stopPropagation();
186545
- this.move(event.key === "ArrowDown" ? 1 : -1);
186546
- } else if (event.key === "Home" || event.key === "End") {
186547
- event.preventDefault();
186548
- event.stopPropagation();
186549
- this.show();
186550
- this.active = event.key === "Home" ? nextSelectActive(this.choices, -1, 1) : nextSelectActive(this.choices, 0, -1);
186551
- markSelectActive(this.menu, this.trigger, this.active, this.open);
186552
- } else if (event.key === "Enter" || event.key === " ") {
186553
- event.preventDefault();
186554
- event.stopPropagation();
186555
- if (this.open) {
186556
- this.commit(this.active);
186557
- } else {
186558
- this.show();
186559
- }
186560
- } else if (event.key === "Escape" && this.open) {
186561
- event.preventDefault();
186562
- event.stopPropagation();
186563
- this.close();
186564
- this.trigger.focus();
186565
- } else if (event.key === "Tab") {
186566
- this.close();
186567
- } else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
186568
- event.stopPropagation();
186569
- this.search += event.key.toLocaleLowerCase();
186570
- window.clearTimeout(this.searchTimer);
186571
- this.searchTimer = window.setTimeout(() => {
186572
- this.search = "";
186573
- }, 700);
186574
- this.show();
186575
- const index = this.choices.findIndex(
186576
- (choice) => !choice.disabled && !choice.hidden && choice.label.toLocaleLowerCase().startsWith(this.search)
186577
- );
186578
- if (index >= 0) {
186579
- this.active = index;
186580
- markSelectActive(this.menu, this.trigger, this.active, this.open);
186581
- }
186582
- }
186583
- }
186584
- }
186585
- registry.define("pptx-ui-select", PptxSelect);
186586
- }
186587
185841
  function resolveLiveCustomGeometryPath(element) {
186588
185842
  const el = element;
186589
185843
  if (!el.pathData || !el.pathWidth || !el.pathHeight) {
@@ -195140,7 +194394,9 @@ function buildChartStylePresets(chartData) {
195140
194394
  id,
195141
194395
  labelKey,
195142
194396
  colors,
195143
- applied: paletteEquals(colors, chartData.colorPalette)
194397
+ applied: paletteEquals(colors, chartData.colorPalette) || !chartData.colorPalette && Boolean(chartData.series?.length) && chartData.series.every(
194398
+ (series, index) => series.color?.toLowerCase() === colors[index % colors.length]?.toLowerCase()
194399
+ )
195144
194400
  };
195145
194401
  });
195146
194402
  }
@@ -211916,6 +211172,8 @@ var translationsEn = {
211916
211172
  "pptx.ribbon.width": "Width",
211917
211173
  "pptx.ribbon.strokeWidth": "Stroke width",
211918
211174
  "pptx.ribbon.browseThemes": "Browse Themes",
211175
+ "pptx.ribbon.groupThemes": "Themes",
211176
+ "pptx.ribbon.groupCustomize": "Customize",
211919
211177
  "pptx.ribbon.browseThemesTitle": "Browse and apply built-in themes",
211920
211178
  "pptx.ribbon.theme.default": "Default",
211921
211179
  "pptx.ribbon.theme.light": "Light (Vermilion)",
@@ -213161,6 +212419,7 @@ var translationsEn = {
213161
212419
  "pptx.review.hideInk": "Hide Ink",
213162
212420
  "pptx.review.markAllRead": "Mark All as Read",
213163
212421
  "pptx.review.proofing": "Proofing",
212422
+ "pptx.review.ink": "Ink",
213164
212423
  "pptx.review.protect": "Protect",
213165
212424
  "pptx.review.readOnly": "Always Open Read-Only",
213166
212425
  "pptx.review.restrictPermission": "Restrict Permission",
@@ -223545,22 +222804,22 @@ function observeExternalCollaborationSession(session, onSnapshot) {
223545
222804
  }
223546
222805
  return dispose;
223547
222806
  }
223548
- function borrowExternalCollaborationAwareness(host) {
222807
+ function borrowExternalCollaborationAwareness(host2) {
223549
222808
  let disposed = false;
223550
222809
  let ownsPresence = false;
223551
222810
  let hadPresence = false;
223552
222811
  let previousPresence;
223553
222812
  let lastPresence;
223554
222813
  const awareness = {
223555
- clientID: host.clientID,
223556
- getStates: () => host.getStates(),
223557
- on: (event, callback) => host.on(event, callback),
223558
- off: (event, callback) => host.off(event, callback),
222814
+ clientID: host2.clientID,
222815
+ getStates: () => host2.getStates(),
222816
+ on: (event, callback) => host2.on(event, callback),
222817
+ off: (event, callback) => host2.off(event, callback),
223559
222818
  setLocalStateField: (field, value) => {
223560
222819
  if (disposed) {
223561
222820
  return;
223562
222821
  }
223563
- const state = host.getLocalState();
222822
+ const state = host2.getLocalState();
223564
222823
  if (state === null) {
223565
222824
  return;
223566
222825
  }
@@ -223572,7 +222831,7 @@ function borrowExternalCollaborationAwareness(host) {
223572
222831
  lastPresence = value;
223573
222832
  ownsPresence = true;
223574
222833
  }
223575
- host.setLocalStateField(field, value);
222834
+ host2.setLocalStateField(field, value);
223576
222835
  }
223577
222836
  };
223578
222837
  return {
@@ -223582,7 +222841,7 @@ function borrowExternalCollaborationAwareness(host) {
223582
222841
  return;
223583
222842
  }
223584
222843
  disposed = true;
223585
- const current = host.getLocalState();
222844
+ const current = host2.getLocalState();
223586
222845
  if (!ownsPresence || current === null || current.presence !== lastPresence) {
223587
222846
  return;
223588
222847
  }
@@ -223592,7 +222851,7 @@ function borrowExternalCollaborationAwareness(host) {
223592
222851
  } else {
223593
222852
  delete restored.presence;
223594
222853
  }
223595
- host.setLocalState(restored);
222854
+ host2.setLocalState(restored);
223596
222855
  }
223597
222856
  };
223598
222857
  }
@@ -229135,6 +228394,151 @@ var HELP_RIBBON_COMMANDS = [
229135
228394
  icon: "accessibility"
229136
228395
  }
229137
228396
  ];
228397
+ var DESIGN_RIBBON_GROUPS = [
228398
+ { id: "design.themes", labelKey: "pptx.ribbon.groupThemes" },
228399
+ { id: "design.variants", labelKey: "pptx.ribbon.groupVariants" },
228400
+ { id: "design.customize", labelKey: "pptx.ribbon.groupCustomize" }
228401
+ ];
228402
+ function designCommandState(id, state) {
228403
+ const slideSize = id === "design.customize.slideSize";
228404
+ const background = id === "design.customize.formatBackground";
228405
+ const active2 = id === "design.themes.browseThemes" ? state.galleryOpen : id === "design.themes.editTheme" ? state.editorOpen : background ? state.backgroundOpen : false;
228406
+ return {
228407
+ disabled: !slideSize && !state.editable,
228408
+ active: Boolean(active2),
228409
+ expanded: slideSize ? void 0 : Boolean(active2),
228410
+ hidden: slideSize && state.hasSlideSize === false || background && state.hasBackground === false
228411
+ };
228412
+ }
228413
+ var DESIGN_RIBBON_COMMANDS = [
228414
+ {
228415
+ id: "design.themes.browseThemes",
228416
+ labelKey: "pptx.ribbon.browseThemes",
228417
+ titleKey: "pptx.ribbon.browseThemesTitle",
228418
+ icon: "palette"
228419
+ },
228420
+ {
228421
+ id: "design.themes.editTheme",
228422
+ labelKey: "pptx.ribbon.editTheme",
228423
+ titleKey: "pptx.design.editThemeTooltip",
228424
+ icon: "pencil"
228425
+ },
228426
+ {
228427
+ id: "design.customize.slideSize",
228428
+ labelKey: "pptx.ribbon.slideSize",
228429
+ titleKey: "pptx.ribbon.slideSizeTitle",
228430
+ icon: "monitor"
228431
+ },
228432
+ {
228433
+ id: "design.customize.formatBackground",
228434
+ labelKey: "pptx.ribbon.formatBackground",
228435
+ titleKey: "pptx.ribbon.formatBackgroundTitle",
228436
+ icon: "paint"
228437
+ }
228438
+ ];
228439
+ function buildReviewRibbon(t, state) {
228440
+ const label = (key2, fallback) => {
228441
+ const value = t(key2);
228442
+ return value && value !== key2 ? value : fallback;
228443
+ };
228444
+ const command = (id, key2, fallback, icon, options = {}) => ({ id, label: label(key2, fallback), icon, ...options });
228445
+ const group2 = (id, key2, fallback, commands) => ({ id, label: label(key2, fallback), commands });
228446
+ return [
228447
+ group2("review.proofing", "pptx.review.proofing", "Proofing", [
228448
+ command("review.proofing.spelling", "pptx.review.spelling", "Spelling", "spelling", {
228449
+ active: state.spellCheck,
228450
+ pressed: state.spellCheck,
228451
+ disabled: state.canSpellCheck === false,
228452
+ title: label("pptx.review.toggleSpellCheck", "Toggle spell check")
228453
+ }),
228454
+ command("review.proofing.thesaurus", "pptx.review.thesaurus", "Thesaurus", "book", {
228455
+ disabled: true
228456
+ })
228457
+ ]),
228458
+ group2("review.accessibility", "pptx.review.accessibility", "Accessibility", [
228459
+ command(
228460
+ "review.accessibility.check",
228461
+ "pptx.review.accessibilityCheck",
228462
+ "Check Accessibility",
228463
+ "shield",
228464
+ { disabled: state.canAccessibility === false, active: state.accessibilityOpen }
228465
+ )
228466
+ ]),
228467
+ group2("review.language", "pptx.review.language", "Language", [
228468
+ command("review.language.translate", "pptx.review.translate", "Translate", "languages", {
228469
+ disabled: true
228470
+ }),
228471
+ command("review.language.language", "pptx.review.language", "Language", "globe", {
228472
+ disabled: !state.canLanguage,
228473
+ hidden: state.languageHidden
228474
+ })
228475
+ ]),
228476
+ group2("review.compare", "pptx.review.changes", "Changes", [
228477
+ command("review.compare.markAllRead", "pptx.review.markAllRead", "Mark All as Read", "copy", {
228478
+ disabled: true
228479
+ }),
228480
+ command("review.compare.compare", "pptx.ribbon.compare", "Compare", "compare", {
228481
+ disabled: !state.editable || !state.canCompare,
228482
+ hidden: !state.canCompare,
228483
+ title: label("pptx.ribbon.compareTitle", "Compare presentations")
228484
+ })
228485
+ ]),
228486
+ group2("review.comments", "pptx.toolbar.comments", "Comments", [
228487
+ command("review.comments.newComment", "pptx.toolbar.comments", "Comments", "messagePlus", {
228488
+ disabled: !state.canComments,
228489
+ active: state.commentsOpen,
228490
+ expanded: state.commentsOpen,
228491
+ badge: state.commentCount,
228492
+ title: label("pptx.review.toggleComments", "Toggle comments")
228493
+ }),
228494
+ command("review.comments.delete", "pptx.common.delete", "Delete", "trash", {
228495
+ disabled: true,
228496
+ compact: true,
228497
+ column: 1
228498
+ }),
228499
+ command("review.comments.previous", "pptx.common.previous", "Previous", "chevronLeft", {
228500
+ disabled: true,
228501
+ compact: true,
228502
+ column: 1
228503
+ }),
228504
+ command("review.comments.next", "pptx.common.next", "Next", "chevronRight", {
228505
+ disabled: true,
228506
+ compact: true,
228507
+ column: 2
228508
+ }),
228509
+ command(
228510
+ "review.comments.showComments",
228511
+ "pptx.review.showComments",
228512
+ "Show Comments",
228513
+ "message",
228514
+ {
228515
+ disabled: !state.canComments,
228516
+ active: state.commentsOpen,
228517
+ expanded: state.commentsOpen,
228518
+ compact: true,
228519
+ column: 2
228520
+ }
228521
+ )
228522
+ ]),
228523
+ group2("review.protect", "pptx.review.protect", "Protect", [
228524
+ command("review.protect.readOnly", "pptx.review.readOnly", "Always Open Read-only", "lock", {
228525
+ disabled: true
228526
+ }),
228527
+ command(
228528
+ "review.protect.restrictPermission",
228529
+ "pptx.review.restrictPermission",
228530
+ "Restrict Permission",
228531
+ "shield",
228532
+ { disabled: true }
228533
+ )
228534
+ ]),
228535
+ group2("review.ink", "pptx.review.ink", "Ink", [
228536
+ command("review.ink.hideInk", "pptx.review.hideInk", "Hide Ink", "eyeOff", {
228537
+ disabled: true
228538
+ })
228539
+ ])
228540
+ ];
228541
+ }
229138
228542
  function resetSlideLayoutPath(slide) {
229139
228543
  const path = slide?.layoutPath;
229140
228544
  return typeof path === "string" && path !== "" ? path : void 0;
@@ -238566,12 +237970,12 @@ function shouldShowMediaFullscreenStopButton(input) {
238566
237970
  var ONLINE_VIDEO_IFRAME_ALLOW = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen";
238567
237971
  var ONLINE_VIDEO_IFRAME_SANDBOX = "allow-scripts allow-same-origin allow-popups allow-presentation";
238568
237972
  function youtubeVideoId(url) {
238569
- const host = url.hostname.replace(/^www\./, "").toLowerCase();
238570
- if (host === "youtu.be") {
237973
+ const host2 = url.hostname.replace(/^www\./, "").toLowerCase();
237974
+ if (host2 === "youtu.be") {
238571
237975
  const id = url.pathname.split("/").filter(Boolean)[0];
238572
237976
  return id || void 0;
238573
237977
  }
238574
- if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtube-nocookie.com") {
237978
+ if (host2 !== "youtube.com" && host2 !== "m.youtube.com" && host2 !== "youtube-nocookie.com") {
238575
237979
  return void 0;
238576
237980
  }
238577
237981
  if (url.pathname.startsWith("/embed/")) {
@@ -238588,12 +237992,12 @@ function youtubeVideoId(url) {
238588
237992
  return void 0;
238589
237993
  }
238590
237994
  function vimeoVideoId(url) {
238591
- const host = url.hostname.replace(/^www\./, "").toLowerCase();
238592
- if (host === "player.vimeo.com") {
237995
+ const host2 = url.hostname.replace(/^www\./, "").toLowerCase();
237996
+ if (host2 === "player.vimeo.com") {
238593
237997
  const match2 = /^\/video\/(\d+)/.exec(url.pathname);
238594
237998
  return match2?.[1];
238595
237999
  }
238596
- if (host !== "vimeo.com") {
238000
+ if (host2 !== "vimeo.com") {
238597
238001
  return void 0;
238598
238002
  }
238599
238003
  const match = /^\/(?:channels\/[^/]+\/|groups\/[^/]+\/videos\/)?(\d+)/.exec(url.pathname);
@@ -240764,9 +240168,9 @@ function resolveAutosaveActivation(input) {
240764
240168
  var AUTOSAVE_DEFAULT_INTERVAL_MS = AUTOSAVE_DEFAULT_INTERVAL_SECONDS * 1e3;
240765
240169
  var HOST_INTERVAL_FLOOR_MS = 50;
240766
240170
  function resolveAutosaveIntervalMs(input) {
240767
- const host = input.hostIntervalMs;
240768
- if (typeof host === "number" && Number.isFinite(host)) {
240769
- return Math.max(HOST_INTERVAL_FLOOR_MS, host);
240171
+ const host2 = input.hostIntervalMs;
240172
+ if (typeof host2 === "number" && Number.isFinite(host2)) {
240173
+ return Math.max(HOST_INTERVAL_FLOOR_MS, host2);
240770
240174
  }
240771
240175
  const seconds = input.optionsIntervalSeconds;
240772
240176
  if (typeof seconds === "number" && Number.isFinite(seconds)) {
@@ -243671,7 +243075,7 @@ var RIBBON_CATALOG_TAIL_TABS = {
243671
243075
  review: {
243672
243076
  proofing: { label: "Proofing", controls: { spelling: "Spelling", thesaurus: "Thesaurus" } },
243673
243077
  accessibility: { label: "Accessibility", controls: { check: "Check Accessibility" } },
243674
- language: { label: "Language", controls: { translate: "Translate" } },
243078
+ language: { label: "Language", controls: { translate: "Translate", language: "Language" } },
243675
243079
  comments: {
243676
243080
  label: "Comments",
243677
243081
  controls: {
@@ -247330,8 +246734,57 @@ function applyShapeStylesItem(itemId, ctx) {
247330
246734
  }
247331
246735
  };
247332
246736
  }
246737
+ function smartArtColorPatch(data, fillColors) {
246738
+ const original = data.colorTransform;
246739
+ const roles = original?.roleColors ?? Object.fromEntries(
246740
+ (original?.labels ?? [{ name: "node0" }, { name: "node1" }]).map((label) => [
246741
+ label.name,
246742
+ { fill: [], line: [] }
246743
+ ])
246744
+ );
246745
+ const roleColors = Object.fromEntries(
246746
+ Object.entries(roles).map(([name, colors]) => [
246747
+ name,
246748
+ /^node\d+$/u.test(name) ? { ...colors, fill: [...fillColors] } : colors
246749
+ ])
246750
+ );
246751
+ const flat = flattenNodes(data.nodes);
246752
+ const shapes = data.drawingShapes;
246753
+ return {
246754
+ colorTransformDirty: true,
246755
+ colorTransform: {
246756
+ ...original,
246757
+ fillColors: [...fillColors],
246758
+ lineColors: original?.lineColors ?? [],
246759
+ roleColors,
246760
+ fillInterpolation: { method: "cycle" },
246761
+ labels: original?.labels?.map(
246762
+ (label) => /^node\d+$/u.test(label.name) ? { ...label, fill: { ...label.fill, method: "cycle" } } : label
246763
+ )
246764
+ },
246765
+ drawingDirty: Boolean(shapes?.length),
246766
+ drawingShapes: shapes?.map((shape, index) => {
246767
+ const nodeId = resolveDrawingShapeNodeId(shape, index, shapes, data.nodes);
246768
+ const nodeIndex = flat.findIndex((node) => node.id === nodeId);
246769
+ return nodeIndex < 0 ? shape : {
246770
+ ...shape,
246771
+ fillColor: fillColors[nodeIndex % fillColors.length],
246772
+ fillGradientStops: void 0,
246773
+ fillGradientType: void 0,
246774
+ fillGradientAngle: void 0
246775
+ };
246776
+ })
246777
+ };
246778
+ }
247333
246779
  function applySmartArtDataPatch(data, patch, box, elementId = "inspector") {
247334
246780
  const next = { ...data, ...patch };
246781
+ if (patch.style !== void 0) {
246782
+ next.quickStyleDirty = true;
246783
+ next.quickStyle = {
246784
+ ...next.quickStyle,
246785
+ effectIntensity: patch.style === "flat" ? "subtle" : patch.style
246786
+ };
246787
+ }
247335
246788
  return box ? rebuildDrawingShapesIfCleared(
247336
246789
  next,
247337
246790
  next.layout,
@@ -247449,8 +246902,14 @@ var SMARTART_COLORS_GALLERY = {
247449
246902
  build(ctx) {
247450
246903
  const element = ctx.element;
247451
246904
  const data = element?.type === "smartArt" ? element.smartArtData : void 0;
247452
- const current = data ? data.colorScheme ?? "colorful1" : void 0;
247453
246905
  const scheme = galleryColorScheme(ctx);
246906
+ const fills = data?.colorTransform?.fillColors;
246907
+ const matched = fills?.length ? SMARTART_COLOR_ENTRIES.find(
246908
+ (entry5) => entry5.accents.length === fills.length && entry5.accents.every(
246909
+ (accent, index) => scheme[accent].toLowerCase() === fills[index].toLowerCase()
246910
+ )
246911
+ )?.id : void 0;
246912
+ const current = data ? data.colorScheme ?? matched ?? (fills?.length ? void 0 : "colorful1") : void 0;
247454
246913
  const sections3 = SECTIONS.map((section) => ({
247455
246914
  id: section.id,
247456
246915
  titleKey: `pptx.gallery.smartArtColors.section.${section.id}`,
@@ -247485,7 +246944,15 @@ var SMARTART_COLORS_GALLERY = {
247485
246944
  },
247486
246945
  apply(itemId, ctx) {
247487
246946
  const entry5 = SMARTART_COLOR_ENTRIES.find((candidate) => candidate.id === itemId);
247488
- const patch = entry5 ? smartArtElementPatch(ctx.element, { colorScheme: entry5.id }) : null;
246947
+ const data = ctx.element?.type === "smartArt" ? ctx.element.smartArtData : void 0;
246948
+ const scheme = galleryColorScheme(ctx);
246949
+ const patch = entry5 && data ? smartArtElementPatch(ctx.element, {
246950
+ colorScheme: entry5.id,
246951
+ ...smartArtColorPatch(
246952
+ data,
246953
+ entry5.accents.map((accent) => scheme[accent])
246954
+ )
246955
+ }) : null;
247489
246956
  return patch ? { kind: "element", ...patch } : null;
247490
246957
  }
247491
246958
  };
@@ -247494,7 +246961,8 @@ var SMARTART_STYLES_GALLERY = {
247494
246961
  build(ctx) {
247495
246962
  const element = ctx.element;
247496
246963
  const data = element?.type === "smartArt" ? element.smartArtData : void 0;
247497
- const current = data ? data.style ?? "flat" : void 0;
246964
+ const intensity = data?.quickStyle?.effectIntensity;
246965
+ const current = data ? data.style ?? (intensity === "moderate" || intensity === "intense" ? intensity : "flat") : void 0;
247498
246966
  const accent1 = galleryColorScheme(ctx).accent1;
247499
246967
  return {
247500
246968
  id: "smartArtStyles",
@@ -248964,9 +248432,6 @@ function resolveActiveRibbonTab(active2, visibleContextual, fallback) {
248964
248432
  }
248965
248433
  return active2;
248966
248434
  }
248967
- var RIBBON_GALLERY_ATTR = "data-ribbon-gallery";
248968
- var RIBBON_GALLERY_POPUP_ATTR = "data-ribbon-gallery-popup";
248969
- var RIBBON_GALLERY_ITEM_ATTR = "data-gallery-item";
248970
248435
  var RIBBON_CONTEXTUAL_TAB_ATTR = "data-ribbon-contextual-tab";
248971
248436
  var INLINE_GALLERY_TILE_COUNT = 6;
248972
248437
  function inlineGalleryItems(descriptor, count = INLINE_GALLERY_TILE_COUNT) {
@@ -248979,6 +248444,13 @@ function galleryItemLabel(item3, translate) {
248979
248444
  const translated = translate(item3.labelKey, item3.labelParams);
248980
248445
  return translated && translated !== item3.labelKey ? translated : item3.label;
248981
248446
  }
248447
+ function galleryTextLabel(translate, key2, fallback) {
248448
+ if (!key2) {
248449
+ return fallback;
248450
+ }
248451
+ const translated = translate(key2);
248452
+ return translated && translated !== key2 ? translated : fallback;
248453
+ }
248982
248454
  function registerCrossSlideAudio(element, src) {
248983
248455
  if (element.playAcrossSlides !== true || element.mediaType !== "audio" || !src) {
248984
248456
  return false;
@@ -250511,13 +249983,13 @@ var ThreeViewController = class {
250511
249983
  if (token2 !== this.token) {
250512
249984
  return;
250513
249985
  }
250514
- const host = three ? getThreeRendererHost(three) : null;
250515
- if (!three || !host || !host.available) {
249986
+ const host2 = three ? getThreeRendererHost(three) : null;
249987
+ if (!three || !host2 || !host2.available) {
250516
249988
  this.unmount();
250517
249989
  this.opts.onState("unavailable");
250518
249990
  return;
250519
249991
  }
250520
- this.host = host;
249992
+ this.host = host2;
250521
249993
  const factory = await loadThreeViewScene(spec2.kind);
250522
249994
  if (token2 !== this.token) {
250523
249995
  return;
@@ -250537,7 +250009,7 @@ var ThreeViewController = class {
250537
250009
  interactive: this.interactive,
250538
250010
  requestRender: () => {
250539
250011
  if (view) {
250540
- host.requestRender(view);
250012
+ host2.requestRender(view);
250541
250013
  }
250542
250014
  },
250543
250015
  emit: (event) => {
@@ -250566,7 +250038,7 @@ var ThreeViewController = class {
250566
250038
  if (this.textStyle) {
250567
250039
  scene.setTextStyle?.(this.textStyle);
250568
250040
  }
250569
- host.register(view);
250041
+ host2.register(view);
250570
250042
  this.opts.onState("ready");
250571
250043
  } catch (error) {
250572
250044
  if (token2 !== this.token) {
@@ -254032,6 +253504,986 @@ var EDITOR_THUMBNAIL_CSS = `
254032
253504
  }
254033
253505
  `;
254034
253506
  var EDITOR_CHROME_CSS = EDITOR_LAYOUT_CSS + EDITOR_THUMBNAIL_CSS + EDITOR_RIBBON_CSS + EDITOR_INSPECTOR_CSS + EDITOR_CONTROLS_CSS + EDITOR_FONT_PICKER_CSS + EDITOR_HOME_LAYOUT_CSS + EDITOR_ARRANGE_CSS + EDITOR_CLUSTER_CSS;
253507
+ var ARRANGE_ALIGNMENT_ICONS = {
253508
+ "home.arrange.align.left": {
253509
+ attrs: {
253510
+ stroke: "currentColor",
253511
+ fill: "none",
253512
+ "stroke-width": "2",
253513
+ viewBox: "0 0 24 24",
253514
+ "stroke-linecap": "round",
253515
+ "stroke-linejoin": "round"
253516
+ },
253517
+ children: [
253518
+ { tag: "path", attrs: { d: "M15 12H3" } },
253519
+ { tag: "path", attrs: { d: "M17 18H3" } },
253520
+ { tag: "path", attrs: { d: "M21 6H3" } }
253521
+ ]
253522
+ },
253523
+ "home.arrange.align.center": {
253524
+ attrs: {
253525
+ stroke: "currentColor",
253526
+ fill: "none",
253527
+ "stroke-width": "2",
253528
+ viewBox: "0 0 24 24",
253529
+ "stroke-linecap": "round",
253530
+ "stroke-linejoin": "round"
253531
+ },
253532
+ children: [
253533
+ { tag: "path", attrs: { d: "M17 12H7" } },
253534
+ { tag: "path", attrs: { d: "M19 18H5" } },
253535
+ { tag: "path", attrs: { d: "M21 6H3" } }
253536
+ ]
253537
+ },
253538
+ "home.arrange.align.right": {
253539
+ attrs: {
253540
+ stroke: "currentColor",
253541
+ fill: "none",
253542
+ "stroke-width": "2",
253543
+ viewBox: "0 0 24 24",
253544
+ "stroke-linecap": "round",
253545
+ "stroke-linejoin": "round"
253546
+ },
253547
+ children: [
253548
+ { tag: "path", attrs: { d: "M21 12H9" } },
253549
+ { tag: "path", attrs: { d: "M21 18H7" } },
253550
+ { tag: "path", attrs: { d: "M21 6H3" } }
253551
+ ]
253552
+ },
253553
+ "home.arrange.align.top": {
253554
+ attrs: {
253555
+ stroke: "currentColor",
253556
+ fill: "none",
253557
+ "stroke-width": "2",
253558
+ viewBox: "0 0 24 24",
253559
+ "stroke-linecap": "round",
253560
+ "stroke-linejoin": "round"
253561
+ },
253562
+ children: [{ tag: "path", attrs: { d: "m18 15-6-6-6 6" } }]
253563
+ },
253564
+ "home.arrange.align.middle": {
253565
+ attrs: {
253566
+ style: "rotate: 90deg; transform-origin: center;",
253567
+ stroke: "currentColor",
253568
+ fill: "none",
253569
+ "stroke-width": "2",
253570
+ viewBox: "0 0 24 24",
253571
+ "stroke-linecap": "round",
253572
+ "stroke-linejoin": "round"
253573
+ },
253574
+ children: [
253575
+ { tag: "path", attrs: { d: "M17 12H7" } },
253576
+ { tag: "path", attrs: { d: "M19 18H5" } },
253577
+ { tag: "path", attrs: { d: "M21 6H3" } }
253578
+ ]
253579
+ },
253580
+ "home.arrange.align.bottom": {
253581
+ attrs: {
253582
+ stroke: "currentColor",
253583
+ fill: "none",
253584
+ "stroke-width": "2",
253585
+ viewBox: "0 0 24 24",
253586
+ "stroke-linecap": "round",
253587
+ "stroke-linejoin": "round"
253588
+ },
253589
+ children: [{ tag: "path", attrs: { d: "m6 9 6 6 6-6" } }]
253590
+ },
253591
+ "home.arrange.distribute.horizontal": {
253592
+ attrs: {
253593
+ stroke: "currentColor",
253594
+ fill: "none",
253595
+ "stroke-width": "2",
253596
+ viewBox: "0 0 24 24",
253597
+ "stroke-linecap": "round",
253598
+ "stroke-linejoin": "round"
253599
+ },
253600
+ children: [
253601
+ { tag: "rect", attrs: { width: "6", height: "10", x: "9", y: "7", rx: "2" } },
253602
+ { tag: "path", attrs: { d: "M4 22V2" } },
253603
+ { tag: "path", attrs: { d: "M20 22V2" } }
253604
+ ]
253605
+ },
253606
+ "home.arrange.distribute.vertical": {
253607
+ attrs: {
253608
+ stroke: "currentColor",
253609
+ fill: "none",
253610
+ "stroke-width": "2",
253611
+ viewBox: "0 0 24 24",
253612
+ "stroke-linecap": "round",
253613
+ "stroke-linejoin": "round"
253614
+ },
253615
+ children: [
253616
+ { tag: "rect", attrs: { width: "10", height: "6", x: "7", y: "9", rx: "2" } },
253617
+ { tag: "path", attrs: { d: "M22 20H2" } },
253618
+ { tag: "path", attrs: { d: "M22 4H2" } }
253619
+ ]
253620
+ }
253621
+ };
253622
+ var ARRANGE_OPERATIONS_ICONS = {
253623
+ "home.arrange.group": {
253624
+ attrs: {
253625
+ stroke: "currentColor",
253626
+ fill: "none",
253627
+ "stroke-width": "2",
253628
+ viewBox: "0 0 24 24",
253629
+ "stroke-linecap": "round",
253630
+ "stroke-linejoin": "round"
253631
+ },
253632
+ children: [
253633
+ { tag: "path", attrs: { d: "M3 7V5c0-1.1.9-2 2-2h2" } },
253634
+ { tag: "path", attrs: { d: "M17 3h2c1.1 0 2 .9 2 2v2" } },
253635
+ { tag: "path", attrs: { d: "M21 17v2c0 1.1-.9 2-2 2h-2" } },
253636
+ { tag: "path", attrs: { d: "M7 21H5c-1.1 0-2-.9-2-2v-2" } },
253637
+ { tag: "rect", attrs: { width: "7", height: "5", x: "7", y: "7", rx: "1" } },
253638
+ { tag: "rect", attrs: { width: "7", height: "5", x: "10", y: "12", rx: "1" } }
253639
+ ]
253640
+ },
253641
+ "home.arrange.ungroup": {
253642
+ attrs: {
253643
+ stroke: "currentColor",
253644
+ fill: "none",
253645
+ "stroke-width": "2",
253646
+ viewBox: "0 0 24 24",
253647
+ "stroke-linecap": "round",
253648
+ "stroke-linejoin": "round"
253649
+ },
253650
+ children: [
253651
+ { tag: "rect", attrs: { width: "8", height: "6", x: "5", y: "4", rx: "1" } },
253652
+ { tag: "rect", attrs: { width: "8", height: "6", x: "11", y: "14", rx: "1" } }
253653
+ ]
253654
+ },
253655
+ "home.arrange.mergeShapes": {
253656
+ attrs: {
253657
+ stroke: "currentColor",
253658
+ fill: "none",
253659
+ "stroke-width": "2",
253660
+ viewBox: "0 0 24 24",
253661
+ "stroke-linecap": "round",
253662
+ "stroke-linejoin": "round"
253663
+ },
253664
+ children: [
253665
+ { tag: "path", attrs: { d: "M10 18H5a3 3 0 0 1-3-3v-1" } },
253666
+ { tag: "path", attrs: { d: "M14 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" } },
253667
+ { tag: "path", attrs: { d: "M20 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" } },
253668
+ { tag: "path", attrs: { d: "m7 21 3-3-3-3" } },
253669
+ { tag: "rect", attrs: { x: "14", y: "14", width: "8", height: "8", rx: "2" } },
253670
+ { tag: "rect", attrs: { x: "2", y: "2", width: "8", height: "8", rx: "2" } }
253671
+ ]
253672
+ },
253673
+ "home.arrange.crop": {
253674
+ attrs: {
253675
+ stroke: "currentColor",
253676
+ fill: "none",
253677
+ "stroke-width": "2",
253678
+ viewBox: "0 0 24 24",
253679
+ "stroke-linecap": "round",
253680
+ "stroke-linejoin": "round"
253681
+ },
253682
+ children: [
253683
+ { tag: "path", attrs: { d: "M6 2v14a2 2 0 0 0 2 2h14" } },
253684
+ { tag: "path", attrs: { d: "M18 22V8a2 2 0 0 0-2-2H2" } }
253685
+ ]
253686
+ },
253687
+ "home.arrange.sendBackward": {
253688
+ attrs: {
253689
+ stroke: "currentColor",
253690
+ fill: "none",
253691
+ "stroke-width": "2",
253692
+ viewBox: "0 0 24 24",
253693
+ "stroke-linecap": "round",
253694
+ "stroke-linejoin": "round"
253695
+ },
253696
+ children: [{ tag: "path", attrs: { d: "m6 9 6 6 6-6" } }]
253697
+ },
253698
+ "home.arrange.bringForward": {
253699
+ attrs: {
253700
+ stroke: "currentColor",
253701
+ fill: "none",
253702
+ "stroke-width": "2",
253703
+ viewBox: "0 0 24 24",
253704
+ "stroke-linecap": "round",
253705
+ "stroke-linejoin": "round"
253706
+ },
253707
+ children: [{ tag: "path", attrs: { d: "m18 15-6-6-6 6" } }]
253708
+ },
253709
+ "home.arrange.duplicate": {
253710
+ attrs: {
253711
+ stroke: "currentColor",
253712
+ fill: "none",
253713
+ "stroke-width": "2",
253714
+ viewBox: "0 0 24 24",
253715
+ "stroke-linecap": "round",
253716
+ "stroke-linejoin": "round"
253717
+ },
253718
+ children: [
253719
+ { tag: "rect", attrs: { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" } },
253720
+ { tag: "path", attrs: { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" } }
253721
+ ]
253722
+ },
253723
+ "home.arrange.delete": {
253724
+ attrs: {
253725
+ stroke: "currentColor",
253726
+ fill: "none",
253727
+ "stroke-width": "2",
253728
+ viewBox: "0 0 24 24",
253729
+ "stroke-linecap": "round",
253730
+ "stroke-linejoin": "round"
253731
+ },
253732
+ children: [
253733
+ { tag: "path", attrs: { d: "M3 6h18" } },
253734
+ { tag: "path", attrs: { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" } },
253735
+ { tag: "path", attrs: { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" } },
253736
+ { tag: "line", attrs: { x1: "10", x2: "10", y1: "11", y2: "17" } },
253737
+ { tag: "line", attrs: { x1: "14", x2: "14", y1: "11", y2: "17" } }
253738
+ ]
253739
+ }
253740
+ };
253741
+ var CLIPBOARD_ICONS = {
253742
+ "home.clipboard.paste": {
253743
+ attrs: {
253744
+ stroke: "currentColor",
253745
+ fill: "none",
253746
+ "stroke-width": "2",
253747
+ viewBox: "0 0 24 24",
253748
+ "stroke-linecap": "round",
253749
+ "stroke-linejoin": "round"
253750
+ },
253751
+ children: [
253752
+ {
253753
+ tag: "path",
253754
+ attrs: { d: "M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z" }
253755
+ },
253756
+ {
253757
+ tag: "path",
253758
+ attrs: {
253759
+ d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"
253760
+ }
253761
+ },
253762
+ { tag: "path", attrs: { d: "m17 10 4 4-4 4" } }
253763
+ ]
253764
+ },
253765
+ "home.clipboard.cut": {
253766
+ attrs: {
253767
+ stroke: "currentColor",
253768
+ fill: "none",
253769
+ "stroke-width": "2",
253770
+ viewBox: "0 0 24 24",
253771
+ "stroke-linecap": "round",
253772
+ "stroke-linejoin": "round"
253773
+ },
253774
+ children: [
253775
+ { tag: "circle", attrs: { cx: "6", cy: "6", r: "3" } },
253776
+ { tag: "path", attrs: { d: "M8.12 8.12 12 12" } },
253777
+ { tag: "path", attrs: { d: "M20 4 8.12 15.88" } },
253778
+ { tag: "circle", attrs: { cx: "6", cy: "18", r: "3" } },
253779
+ { tag: "path", attrs: { d: "M14.8 14.8 20 20" } }
253780
+ ]
253781
+ },
253782
+ "home.clipboard.copy": {
253783
+ attrs: {
253784
+ stroke: "currentColor",
253785
+ fill: "none",
253786
+ "stroke-width": "2",
253787
+ viewBox: "0 0 24 24",
253788
+ "stroke-linecap": "round",
253789
+ "stroke-linejoin": "round"
253790
+ },
253791
+ children: [
253792
+ { tag: "rect", attrs: { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" } },
253793
+ { tag: "path", attrs: { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" } }
253794
+ ]
253795
+ },
253796
+ "home.clipboard.formatPainter": {
253797
+ attrs: {
253798
+ stroke: "currentColor",
253799
+ fill: "none",
253800
+ "stroke-width": "2",
253801
+ viewBox: "0 0 24 24",
253802
+ "stroke-linecap": "round",
253803
+ "stroke-linejoin": "round"
253804
+ },
253805
+ children: [
253806
+ { tag: "path", attrs: { d: "m14.622 17.897-10.68-2.913" } },
253807
+ {
253808
+ tag: "path",
253809
+ attrs: {
253810
+ d: "M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z"
253811
+ }
253812
+ },
253813
+ {
253814
+ tag: "path",
253815
+ attrs: {
253816
+ d: "M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15"
253817
+ }
253818
+ }
253819
+ ]
253820
+ }
253821
+ };
253822
+ var DRAWING_ICONS = {
253823
+ "home.drawing.shapes": {
253824
+ attrs: {
253825
+ stroke: "currentColor",
253826
+ fill: "none",
253827
+ "stroke-width": "2",
253828
+ viewBox: "0 0 24 24",
253829
+ "stroke-linecap": "round",
253830
+ "stroke-linejoin": "round"
253831
+ },
253832
+ children: [
253833
+ {
253834
+ tag: "path",
253835
+ attrs: {
253836
+ d: "M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z"
253837
+ }
253838
+ },
253839
+ { tag: "rect", attrs: { x: "3", y: "14", width: "7", height: "7", rx: "1" } },
253840
+ { tag: "circle", attrs: { cx: "17.5", cy: "17.5", r: "3.5" } }
253841
+ ]
253842
+ },
253843
+ "home.drawing.arrange": {
253844
+ attrs: {
253845
+ stroke: "currentColor",
253846
+ fill: "none",
253847
+ "stroke-width": "2",
253848
+ viewBox: "0 0 24 24",
253849
+ "stroke-linecap": "round",
253850
+ "stroke-linejoin": "round"
253851
+ },
253852
+ children: [
253853
+ {
253854
+ tag: "path",
253855
+ attrs: {
253856
+ d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"
253857
+ }
253858
+ },
253859
+ { tag: "path", attrs: { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" } },
253860
+ { tag: "path", attrs: { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" } }
253861
+ ]
253862
+ },
253863
+ "home.drawing.shapeFill": {
253864
+ attrs: {
253865
+ stroke: "currentColor",
253866
+ fill: "none",
253867
+ "stroke-width": "2",
253868
+ viewBox: "0 0 24 24",
253869
+ "stroke-linecap": "round",
253870
+ "stroke-linejoin": "round"
253871
+ },
253872
+ children: [
253873
+ {
253874
+ tag: "path",
253875
+ attrs: { d: "m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z" }
253876
+ },
253877
+ { tag: "path", attrs: { d: "m5 2 5 5" } },
253878
+ { tag: "path", attrs: { d: "M2 13h15" } },
253879
+ { tag: "path", attrs: { d: "M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z" } }
253880
+ ]
253881
+ },
253882
+ "home.drawing.shapeOutline": {
253883
+ attrs: {
253884
+ stroke: "currentColor",
253885
+ fill: "none",
253886
+ "stroke-width": "2",
253887
+ viewBox: "0 0 24 24",
253888
+ "stroke-linecap": "round",
253889
+ "stroke-linejoin": "round"
253890
+ },
253891
+ children: [
253892
+ { tag: "path", attrs: { d: "M12 20h9" } },
253893
+ {
253894
+ tag: "path",
253895
+ attrs: {
253896
+ d: "M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z"
253897
+ }
253898
+ }
253899
+ ]
253900
+ },
253901
+ "home.drawing.quickStyles": {
253902
+ attrs: {
253903
+ stroke: "currentColor",
253904
+ fill: "none",
253905
+ "stroke-width": "2",
253906
+ viewBox: "0 0 24 24",
253907
+ "stroke-linecap": "round",
253908
+ "stroke-linejoin": "round"
253909
+ },
253910
+ children: [
253911
+ { tag: "circle", attrs: { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" } },
253912
+ { tag: "circle", attrs: { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" } },
253913
+ { tag: "circle", attrs: { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" } },
253914
+ { tag: "circle", attrs: { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" } },
253915
+ {
253916
+ tag: "path",
253917
+ attrs: {
253918
+ d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"
253919
+ }
253920
+ }
253921
+ ]
253922
+ },
253923
+ "home.drawing.shapeEffects": {
253924
+ attrs: {
253925
+ stroke: "currentColor",
253926
+ fill: "none",
253927
+ "stroke-width": "2",
253928
+ viewBox: "0 0 24 24",
253929
+ "stroke-linecap": "round",
253930
+ "stroke-linejoin": "round"
253931
+ },
253932
+ children: [
253933
+ {
253934
+ tag: "path",
253935
+ attrs: {
253936
+ d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"
253937
+ }
253938
+ },
253939
+ { tag: "path", attrs: { d: "M20 3v4" } },
253940
+ { tag: "path", attrs: { d: "M22 5h-4" } },
253941
+ { tag: "path", attrs: { d: "M4 17v2" } },
253942
+ { tag: "path", attrs: { d: "M5 18H3" } }
253943
+ ]
253944
+ }
253945
+ };
253946
+ var EDITING_ICONS = {
253947
+ "home.editing.find": {
253948
+ attrs: {
253949
+ stroke: "currentColor",
253950
+ fill: "none",
253951
+ "stroke-width": "2",
253952
+ viewBox: "0 0 24 24",
253953
+ "stroke-linecap": "round",
253954
+ "stroke-linejoin": "round"
253955
+ },
253956
+ children: [
253957
+ { tag: "circle", attrs: { cx: "11", cy: "11", r: "8" } },
253958
+ { tag: "path", attrs: { d: "m21 21-4.3-4.3" } }
253959
+ ]
253960
+ },
253961
+ "home.editing.replace": {
253962
+ attrs: {
253963
+ stroke: "currentColor",
253964
+ fill: "none",
253965
+ "stroke-width": "2",
253966
+ viewBox: "0 0 24 24",
253967
+ "stroke-linecap": "round",
253968
+ "stroke-linejoin": "round"
253969
+ },
253970
+ children: [
253971
+ { tag: "path", attrs: { d: "M14 4a2 2 0 0 1 2-2" } },
253972
+ { tag: "path", attrs: { d: "M16 10a2 2 0 0 1-2-2" } },
253973
+ { tag: "path", attrs: { d: "M20 2a2 2 0 0 1 2 2" } },
253974
+ { tag: "path", attrs: { d: "M22 8a2 2 0 0 1-2 2" } },
253975
+ { tag: "path", attrs: { d: "m3 7 3 3 3-3" } },
253976
+ { tag: "path", attrs: { d: "M6 10V5a3 3 0 0 1 3-3h1" } },
253977
+ { tag: "rect", attrs: { x: "2", y: "14", width: "8", height: "8", rx: "2" } }
253978
+ ]
253979
+ },
253980
+ "home.editing.select": {
253981
+ attrs: {
253982
+ stroke: "currentColor",
253983
+ fill: "none",
253984
+ "stroke-width": "2",
253985
+ viewBox: "0 0 24 24",
253986
+ "stroke-linecap": "round",
253987
+ "stroke-linejoin": "round"
253988
+ },
253989
+ children: [
253990
+ {
253991
+ tag: "path",
253992
+ attrs: {
253993
+ d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"
253994
+ }
253995
+ }
253996
+ ]
253997
+ }
253998
+ };
253999
+ var FONT_ICONS = {
254000
+ "home.font.bold": {
254001
+ attrs: {
254002
+ stroke: "currentColor",
254003
+ fill: "none",
254004
+ "stroke-width": "2",
254005
+ viewBox: "0 0 24 24",
254006
+ "stroke-linecap": "round",
254007
+ "stroke-linejoin": "round"
254008
+ },
254009
+ children: [
254010
+ {
254011
+ tag: "path",
254012
+ attrs: { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }
254013
+ }
254014
+ ]
254015
+ },
254016
+ "home.font.italic": {
254017
+ attrs: {
254018
+ stroke: "currentColor",
254019
+ fill: "none",
254020
+ "stroke-width": "2",
254021
+ viewBox: "0 0 24 24",
254022
+ "stroke-linecap": "round",
254023
+ "stroke-linejoin": "round"
254024
+ },
254025
+ children: [
254026
+ { tag: "line", attrs: { x1: "19", x2: "10", y1: "4", y2: "4" } },
254027
+ { tag: "line", attrs: { x1: "14", x2: "5", y1: "20", y2: "20" } },
254028
+ { tag: "line", attrs: { x1: "15", x2: "9", y1: "4", y2: "20" } }
254029
+ ]
254030
+ },
254031
+ "home.font.underline": {
254032
+ attrs: {
254033
+ stroke: "currentColor",
254034
+ fill: "none",
254035
+ "stroke-width": "2",
254036
+ viewBox: "0 0 24 24",
254037
+ "stroke-linecap": "round",
254038
+ "stroke-linejoin": "round"
254039
+ },
254040
+ children: [
254041
+ { tag: "path", attrs: { d: "M6 4v6a6 6 0 0 0 12 0V4" } },
254042
+ { tag: "line", attrs: { x1: "4", x2: "20", y1: "20", y2: "20" } }
254043
+ ]
254044
+ },
254045
+ "home.font.strikethrough": {
254046
+ attrs: {
254047
+ stroke: "currentColor",
254048
+ fill: "none",
254049
+ "stroke-width": "2",
254050
+ viewBox: "0 0 24 24",
254051
+ "stroke-linecap": "round",
254052
+ "stroke-linejoin": "round"
254053
+ },
254054
+ children: [
254055
+ { tag: "path", attrs: { d: "M16 4H9a3 3 0 0 0-2.83 4" } },
254056
+ { tag: "path", attrs: { d: "M14 12a4 4 0 0 1 0 8H6" } },
254057
+ { tag: "line", attrs: { x1: "4", x2: "20", y1: "12", y2: "12" } }
254058
+ ]
254059
+ },
254060
+ "home.font.shadow": {
254061
+ attrs: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" },
254062
+ children: [
254063
+ {
254064
+ tag: "text",
254065
+ attrs: {
254066
+ x: "6",
254067
+ y: "17",
254068
+ "font-size": "16",
254069
+ "font-weight": "bold",
254070
+ fill: "currentColor",
254071
+ stroke: "none"
254072
+ },
254073
+ text: "S"
254074
+ },
254075
+ {
254076
+ tag: "text",
254077
+ attrs: {
254078
+ x: "7.5",
254079
+ y: "18.5",
254080
+ "font-size": "16",
254081
+ "font-weight": "bold",
254082
+ fill: "none",
254083
+ stroke: "currentColor",
254084
+ "stroke-width": "0.5",
254085
+ opacity: "0.4"
254086
+ },
254087
+ text: "S"
254088
+ }
254089
+ ]
254090
+ },
254091
+ "home.font.increaseFontSize": {
254092
+ attrs: {
254093
+ stroke: "currentColor",
254094
+ fill: "none",
254095
+ "stroke-width": "2",
254096
+ viewBox: "0 0 24 24",
254097
+ "stroke-linecap": "round",
254098
+ "stroke-linejoin": "round"
254099
+ },
254100
+ children: [
254101
+ { tag: "path", attrs: { d: "M3.5 13h6" } },
254102
+ { tag: "path", attrs: { d: "m2 16 4.5-9 4.5 9" } },
254103
+ { tag: "path", attrs: { d: "M18 16V7" } },
254104
+ { tag: "path", attrs: { d: "m14 11 4-4 4 4" } }
254105
+ ]
254106
+ },
254107
+ "home.font.decreaseFontSize": {
254108
+ attrs: {
254109
+ stroke: "currentColor",
254110
+ fill: "none",
254111
+ "stroke-width": "2",
254112
+ viewBox: "0 0 24 24",
254113
+ "stroke-linecap": "round",
254114
+ "stroke-linejoin": "round"
254115
+ },
254116
+ children: [
254117
+ { tag: "path", attrs: { d: "M3.5 13h6" } },
254118
+ { tag: "path", attrs: { d: "m2 16 4.5-9 4.5 9" } },
254119
+ { tag: "path", attrs: { d: "M18 7v9" } },
254120
+ { tag: "path", attrs: { d: "m14 12 4 4 4-4" } }
254121
+ ]
254122
+ },
254123
+ "home.font.clearFormatting": {
254124
+ attrs: {
254125
+ stroke: "currentColor",
254126
+ fill: "none",
254127
+ "stroke-width": "2",
254128
+ viewBox: "0 0 24 24",
254129
+ "stroke-linecap": "round",
254130
+ "stroke-linejoin": "round"
254131
+ },
254132
+ children: [
254133
+ { tag: "path", attrs: { d: "M4 7V4h16v3" } },
254134
+ { tag: "path", attrs: { d: "M5 20h6" } },
254135
+ { tag: "path", attrs: { d: "M13 4 8 20" } },
254136
+ { tag: "path", attrs: { d: "m15 15 5 5" } },
254137
+ { tag: "path", attrs: { d: "m20 15-5 5" } }
254138
+ ]
254139
+ },
254140
+ "home.font.characterSpacing": {
254141
+ attrs: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" },
254142
+ children: [
254143
+ {
254144
+ tag: "text",
254145
+ attrs: {
254146
+ x: "4",
254147
+ y: "16",
254148
+ "font-size": "11",
254149
+ "font-weight": "bold",
254150
+ fill: "currentColor",
254151
+ stroke: "none"
254152
+ },
254153
+ text: "AV"
254154
+ },
254155
+ { tag: "path", attrs: { d: "M3 20 L1 20 M3 20 L5 20", "stroke-width": "1.5" } },
254156
+ { tag: "path", attrs: { d: "M21 20 L19 20 M21 20 L23 20", "stroke-width": "1.5" } }
254157
+ ]
254158
+ },
254159
+ "home.font.changeCase": {
254160
+ attrs: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" },
254161
+ children: [
254162
+ {
254163
+ tag: "text",
254164
+ attrs: {
254165
+ x: "2",
254166
+ y: "16",
254167
+ "font-size": "13",
254168
+ "font-weight": "bold",
254169
+ fill: "currentColor",
254170
+ stroke: "none"
254171
+ },
254172
+ text: "Aa"
254173
+ }
254174
+ ]
254175
+ },
254176
+ "home.font.fontColor": {
254177
+ attrs: {
254178
+ viewBox: "0 0 24 24",
254179
+ fill: "none",
254180
+ stroke: "currentColor",
254181
+ "stroke-width": "2",
254182
+ "stroke-linecap": "round",
254183
+ "stroke-linejoin": "round"
254184
+ },
254185
+ children: [{ tag: "path", attrs: { d: "M6 20h12M9.5 4h5L18 16H6L9.5 4z" } }]
254186
+ },
254187
+ "home.font.highlightColor": {
254188
+ attrs: {
254189
+ stroke: "currentColor",
254190
+ fill: "none",
254191
+ "stroke-width": "2",
254192
+ viewBox: "0 0 24 24",
254193
+ "stroke-linecap": "round",
254194
+ "stroke-linejoin": "round"
254195
+ },
254196
+ children: [
254197
+ { tag: "path", attrs: { d: "m9 11-6 6v3h9l3-3" } },
254198
+ { tag: "path", attrs: { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4" } }
254199
+ ]
254200
+ }
254201
+ };
254202
+ var PARAGRAPH_ICONS = {
254203
+ "home.paragraph.bullets": {
254204
+ attrs: {
254205
+ stroke: "currentColor",
254206
+ fill: "none",
254207
+ "stroke-width": "2",
254208
+ viewBox: "0 0 24 24",
254209
+ "stroke-linecap": "round",
254210
+ "stroke-linejoin": "round"
254211
+ },
254212
+ children: [
254213
+ { tag: "path", attrs: { d: "M3 12h.01" } },
254214
+ { tag: "path", attrs: { d: "M3 18h.01" } },
254215
+ { tag: "path", attrs: { d: "M3 6h.01" } },
254216
+ { tag: "path", attrs: { d: "M8 12h13" } },
254217
+ { tag: "path", attrs: { d: "M8 18h13" } },
254218
+ { tag: "path", attrs: { d: "M8 6h13" } }
254219
+ ]
254220
+ },
254221
+ "home.paragraph.numbering": {
254222
+ attrs: {
254223
+ stroke: "currentColor",
254224
+ fill: "none",
254225
+ "stroke-width": "2",
254226
+ viewBox: "0 0 24 24",
254227
+ "stroke-linecap": "round",
254228
+ "stroke-linejoin": "round"
254229
+ },
254230
+ children: [
254231
+ { tag: "path", attrs: { d: "M10 12h11" } },
254232
+ { tag: "path", attrs: { d: "M10 18h11" } },
254233
+ { tag: "path", attrs: { d: "M10 6h11" } },
254234
+ { tag: "path", attrs: { d: "M4 10h2" } },
254235
+ { tag: "path", attrs: { d: "M4 6h1v4" } },
254236
+ { tag: "path", attrs: { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1" } }
254237
+ ]
254238
+ },
254239
+ "home.paragraph.decreaseIndent": {
254240
+ attrs: {
254241
+ stroke: "currentColor",
254242
+ fill: "none",
254243
+ "stroke-width": "2",
254244
+ viewBox: "0 0 24 24",
254245
+ "stroke-linecap": "round",
254246
+ "stroke-linejoin": "round"
254247
+ },
254248
+ children: [
254249
+ { tag: "path", attrs: { d: "M21 12H11" } },
254250
+ { tag: "path", attrs: { d: "M21 18H11" } },
254251
+ { tag: "path", attrs: { d: "M21 6H11" } },
254252
+ { tag: "path", attrs: { d: "m7 8-4 4 4 4" } }
254253
+ ]
254254
+ },
254255
+ "home.paragraph.increaseIndent": {
254256
+ attrs: {
254257
+ stroke: "currentColor",
254258
+ fill: "none",
254259
+ "stroke-width": "2",
254260
+ viewBox: "0 0 24 24",
254261
+ "stroke-linecap": "round",
254262
+ "stroke-linejoin": "round"
254263
+ },
254264
+ children: [
254265
+ { tag: "path", attrs: { d: "M21 12H11" } },
254266
+ { tag: "path", attrs: { d: "M21 18H11" } },
254267
+ { tag: "path", attrs: { d: "M21 6H11" } },
254268
+ { tag: "path", attrs: { d: "m3 8 4 4-4 4" } }
254269
+ ]
254270
+ },
254271
+ "home.paragraph.alignLeft": {
254272
+ attrs: {
254273
+ stroke: "currentColor",
254274
+ fill: "none",
254275
+ "stroke-width": "2",
254276
+ viewBox: "0 0 24 24",
254277
+ "stroke-linecap": "round",
254278
+ "stroke-linejoin": "round"
254279
+ },
254280
+ children: [
254281
+ { tag: "path", attrs: { d: "M15 12H3" } },
254282
+ { tag: "path", attrs: { d: "M17 18H3" } },
254283
+ { tag: "path", attrs: { d: "M21 6H3" } }
254284
+ ]
254285
+ },
254286
+ "home.paragraph.alignCenter": {
254287
+ attrs: {
254288
+ stroke: "currentColor",
254289
+ fill: "none",
254290
+ "stroke-width": "2",
254291
+ viewBox: "0 0 24 24",
254292
+ "stroke-linecap": "round",
254293
+ "stroke-linejoin": "round"
254294
+ },
254295
+ children: [
254296
+ { tag: "path", attrs: { d: "M17 12H7" } },
254297
+ { tag: "path", attrs: { d: "M19 18H5" } },
254298
+ { tag: "path", attrs: { d: "M21 6H3" } }
254299
+ ]
254300
+ },
254301
+ "home.paragraph.alignRight": {
254302
+ attrs: {
254303
+ stroke: "currentColor",
254304
+ fill: "none",
254305
+ "stroke-width": "2",
254306
+ viewBox: "0 0 24 24",
254307
+ "stroke-linecap": "round",
254308
+ "stroke-linejoin": "round"
254309
+ },
254310
+ children: [
254311
+ { tag: "path", attrs: { d: "M21 12H9" } },
254312
+ { tag: "path", attrs: { d: "M21 18H7" } },
254313
+ { tag: "path", attrs: { d: "M21 6H3" } }
254314
+ ]
254315
+ },
254316
+ "home.paragraph.justify": {
254317
+ attrs: {
254318
+ stroke: "currentColor",
254319
+ fill: "none",
254320
+ "stroke-width": "2",
254321
+ viewBox: "0 0 24 24",
254322
+ "stroke-linecap": "round",
254323
+ "stroke-linejoin": "round"
254324
+ },
254325
+ children: [
254326
+ { tag: "path", attrs: { d: "M3 12h18" } },
254327
+ { tag: "path", attrs: { d: "M3 18h18" } },
254328
+ { tag: "path", attrs: { d: "M3 6h18" } }
254329
+ ]
254330
+ },
254331
+ "home.paragraph.lineSpacing": {
254332
+ attrs: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" },
254333
+ children: [
254334
+ { tag: "line", attrs: { x1: "5", y1: "5", x2: "19", y2: "5" } },
254335
+ { tag: "line", attrs: { x1: "5", y1: "12", x2: "19", y2: "12" } },
254336
+ { tag: "line", attrs: { x1: "5", y1: "19", x2: "19", y2: "19" } },
254337
+ { tag: "path", attrs: { d: "M2 8 L2 3 M2 3 L3.5 4.5 M2 3 L0.5 4.5" } },
254338
+ { tag: "path", attrs: { d: "M2 16 L2 21 M2 21 L3.5 19.5 M2 21 L0.5 19.5" } }
254339
+ ]
254340
+ },
254341
+ "home.paragraph.textDirection": {
254342
+ attrs: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" },
254343
+ children: [
254344
+ {
254345
+ tag: "text",
254346
+ attrs: { x: "3", y: "16", "font-size": "12", fill: "currentColor", stroke: "none" },
254347
+ text: "A"
254348
+ },
254349
+ { tag: "path", attrs: { d: "M18 6 C21 6 21 10 18 10" } },
254350
+ { tag: "path", attrs: { d: "M18 10 L19.5 8.5 M18 10 L16.5 8.5" } }
254351
+ ]
254352
+ },
254353
+ "home.paragraph.columns": {
254354
+ attrs: {
254355
+ stroke: "currentColor",
254356
+ fill: "none",
254357
+ "stroke-width": "2",
254358
+ viewBox: "0 0 24 24",
254359
+ "stroke-linecap": "round",
254360
+ "stroke-linejoin": "round"
254361
+ },
254362
+ children: [
254363
+ { tag: "rect", attrs: { width: "18", height: "18", x: "3", y: "3", rx: "2" } },
254364
+ { tag: "path", attrs: { d: "M9 3v18" } },
254365
+ { tag: "path", attrs: { d: "M15 3v18" } }
254366
+ ]
254367
+ }
254368
+ };
254369
+ var SLIDES_ICONS = {
254370
+ "home.slides.newSlide": {
254371
+ attrs: {
254372
+ stroke: "currentColor",
254373
+ fill: "none",
254374
+ "stroke-width": "2",
254375
+ viewBox: "0 0 24 24",
254376
+ "stroke-linecap": "round",
254377
+ "stroke-linejoin": "round"
254378
+ },
254379
+ children: [
254380
+ { tag: "path", attrs: { d: "M5 12h14" } },
254381
+ { tag: "path", attrs: { d: "M12 5v14" } }
254382
+ ]
254383
+ },
254384
+ "home.slides.slideTemplates": {
254385
+ attrs: {
254386
+ stroke: "currentColor",
254387
+ fill: "none",
254388
+ "stroke-width": "2",
254389
+ viewBox: "0 0 24 24",
254390
+ "stroke-linecap": "round",
254391
+ "stroke-linejoin": "round"
254392
+ },
254393
+ children: [
254394
+ { tag: "rect", attrs: { width: "18", height: "7", x: "3", y: "3", rx: "1" } },
254395
+ { tag: "rect", attrs: { width: "9", height: "7", x: "3", y: "14", rx: "1" } },
254396
+ { tag: "rect", attrs: { width: "5", height: "7", x: "16", y: "14", rx: "1" } }
254397
+ ]
254398
+ },
254399
+ "home.slides.layout": {
254400
+ attrs: {
254401
+ stroke: "currentColor",
254402
+ fill: "none",
254403
+ "stroke-width": "2",
254404
+ viewBox: "0 0 24 24",
254405
+ "stroke-linecap": "round",
254406
+ "stroke-linejoin": "round"
254407
+ },
254408
+ children: [
254409
+ { tag: "rect", attrs: { width: "7", height: "7", x: "3", y: "3", rx: "1" } },
254410
+ { tag: "rect", attrs: { width: "7", height: "7", x: "14", y: "3", rx: "1" } },
254411
+ { tag: "rect", attrs: { width: "7", height: "7", x: "14", y: "14", rx: "1" } },
254412
+ { tag: "rect", attrs: { width: "7", height: "7", x: "3", y: "14", rx: "1" } }
254413
+ ]
254414
+ },
254415
+ "home.slides.reset": {
254416
+ attrs: {
254417
+ stroke: "currentColor",
254418
+ fill: "none",
254419
+ "stroke-width": "2",
254420
+ viewBox: "0 0 24 24",
254421
+ "stroke-linecap": "round",
254422
+ "stroke-linejoin": "round"
254423
+ },
254424
+ children: [
254425
+ { tag: "path", attrs: { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" } },
254426
+ { tag: "path", attrs: { d: "M3 3v5h5" } }
254427
+ ]
254428
+ },
254429
+ "home.slides.section": {
254430
+ attrs: {
254431
+ stroke: "currentColor",
254432
+ fill: "none",
254433
+ "stroke-width": "2",
254434
+ viewBox: "0 0 24 24",
254435
+ "stroke-linecap": "round",
254436
+ "stroke-linejoin": "round"
254437
+ },
254438
+ children: [
254439
+ { tag: "path", attrs: { d: "M12 10v6" } },
254440
+ { tag: "path", attrs: { d: "M9 13h6" } },
254441
+ {
254442
+ tag: "path",
254443
+ attrs: {
254444
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
254445
+ }
254446
+ }
254447
+ ]
254448
+ }
254449
+ };
254450
+ var RIBBON_CONTROL_ICONS = {
254451
+ ...CLIPBOARD_ICONS,
254452
+ ...SLIDES_ICONS,
254453
+ ...FONT_ICONS,
254454
+ ...PARAGRAPH_ICONS,
254455
+ ...EDITING_ICONS,
254456
+ ...DRAWING_ICONS,
254457
+ ...ARRANGE_ALIGNMENT_ICONS,
254458
+ ...ARRANGE_OPERATIONS_ICONS
254459
+ };
254460
+ function createRibbonControlIcon(doc, name) {
254461
+ const artwork = RIBBON_CONTROL_ICONS[name];
254462
+ if (!artwork) {
254463
+ throw new Error(`Unknown ribbon icon: ${name}`);
254464
+ }
254465
+ const svg = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
254466
+ for (const [key2, value] of Object.entries(artwork.attrs)) {
254467
+ svg.setAttribute(key2, value);
254468
+ }
254469
+ function append2(parent, nodes) {
254470
+ for (const node of nodes) {
254471
+ const element = doc.createElementNS(svg.namespaceURI, node.tag);
254472
+ for (const [key2, value] of Object.entries(node.attrs)) {
254473
+ element.setAttribute(key2, value);
254474
+ }
254475
+ if (node.text) {
254476
+ element.textContent = node.text;
254477
+ }
254478
+ if (node.children) {
254479
+ append2(element, node.children);
254480
+ }
254481
+ parent.append(element);
254482
+ }
254483
+ }
254484
+ append2(svg, artwork.children);
254485
+ return svg;
254486
+ }
254035
254487
  var THEME_EDITOR_LABEL_KEYS = [
254036
254488
  "title",
254037
254489
  "close",
@@ -254088,6 +254540,1284 @@ function themeEditorHex(value) {
254088
254540
  const hex22 = value?.startsWith("#") ? value : `#${value ?? ""}`;
254089
254541
  return /^#[\da-f]{6}$/iu.test(hex22) ? hex22 : "#000000";
254090
254542
  }
254543
+ var host = "pptx-ui-ribbon-gallery";
254544
+ var CSS2 = `
254545
+ ${host} { display:inline-flex; position:relative; flex:none; color:var(--pptx-foreground,#f9fafb); }
254546
+ ${host} .gallery-view { display:contents; }
254547
+ ${host} button { box-sizing:border-box; font:inherit; color:inherit; cursor:pointer; border:1px solid var(--pptx-border,#374151); border-radius:4px; background:var(--pptx-background,#111827); }
254548
+ ${host} button:hover:not(:disabled) { background:var(--pptx-accent,#33334d); }
254549
+ ${host} button:disabled { opacity:.4; cursor:not-allowed; }
254550
+ ${host} button:focus-visible { outline:2px solid var(--pptx-ring,#6366f1); outline-offset:2px; }
254551
+ ${host} .trigger { display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:4px 8px; font-size:11px; white-space:nowrap; }
254552
+ ${host} .trigger svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
254553
+ ${host}[mode=inline] .trigger, ${host}[chevron-only] .trigger { align-self:stretch; padding:0 4px; }
254554
+ ${host} .strip { display:flex; gap:2px; padding:2px; align-items:center; }
254555
+ ${host} .tile { display:inline-flex; align-items:center; justify-content:center; flex:none; padding:2px; }
254556
+ ${host} .tile[aria-pressed=true] { border:2px solid var(--pptx-primary,#6366f1); background:color-mix(in srgb,var(--pptx-primary,#6366f1) 15%,var(--pptx-background,#111827)); }
254557
+ ${host} .tile svg { max-width:100%; max-height:100%; }
254558
+ ${host} .popup { box-sizing:border-box; position:fixed; z-index:1200; max-width:calc(100vw - 16px); max-height:65vh; overflow:auto; padding:8px; border:1px solid var(--pptx-border,#374151); border-radius:6px; background:var(--pptx-popover,#111827); color:var(--pptx-popover-foreground,#f9fafb); box-shadow:0 8px 24px #0006; }
254559
+ ${host} .popup[hidden] { display:none; }
254560
+ ${host} .grid { display:grid; gap:4px; width:max-content; max-width:100%; }
254561
+ ${host} .heading { margin:4px 0 6px; font-size:11px; font-weight:600; }
254562
+ ${host} .section + .section { margin-top:10px; }
254563
+ @media (pointer:coarse), (max-width:1023px) {
254564
+ ${host} .trigger, ${host} .tile { min-height:44px; min-width:44px; }
254565
+ ${host} .popup { max-height:60vh; }
254566
+ }
254567
+ @media (forced-colors:active) {
254568
+ ${host} button, ${host} .popup { color:ButtonText; background:Canvas; border-color:ButtonText; }
254569
+ ${host} button:disabled { color:GrayText; opacity:1; }
254570
+ ${host} button:focus-visible, ${host} .tile[aria-pressed=true] { outline:2px solid Highlight; border-color:Highlight; }
254571
+ }
254572
+ `;
254573
+ function attachRibbonGalleryStyles(doc) {
254574
+ if (!doc.getElementById("pptx-ui-gallery-styles")) {
254575
+ const style = doc.createElement("style");
254576
+ style.id = "pptx-ui-gallery-styles";
254577
+ style.textContent = CSS2;
254578
+ doc.head.append(style);
254579
+ }
254580
+ }
254581
+ function createRibbonGalleryView(doc, pick, toggle2) {
254582
+ const root = doc.createElement("span");
254583
+ root.className = "gallery-view";
254584
+ const strip3 = doc.createElement("div");
254585
+ strip3.className = "strip";
254586
+ const trigger = doc.createElement("button");
254587
+ trigger.type = "button";
254588
+ trigger.className = "trigger";
254589
+ trigger.setAttribute("data-pptx-compact", "");
254590
+ trigger.setAttribute("aria-haspopup", "dialog");
254591
+ trigger.addEventListener("click", toggle2);
254592
+ const popup = doc.createElement("div");
254593
+ popup.className = "popup";
254594
+ popup.hidden = true;
254595
+ popup.setAttribute("role", "dialog");
254596
+ root.append(strip3, trigger);
254597
+ const caption = (t, key2, fallback) => {
254598
+ const translated = t(key2);
254599
+ return translated && translated !== key2 ? translated : fallback;
254600
+ };
254601
+ const tile4 = (item3, width, height, disabled, t) => {
254602
+ const button = doc.createElement("button");
254603
+ button.type = "button";
254604
+ button.className = "tile";
254605
+ button.setAttribute("data-pptx-compact", "");
254606
+ button.dataset.galleryItem = item3.id;
254607
+ button.disabled = disabled;
254608
+ button.setAttribute("aria-pressed", String(item3.applied));
254609
+ button.setAttribute("aria-label", galleryItemLabel(item3, t));
254610
+ button.title = galleryItemLabel(item3, t);
254611
+ button.style.width = `${width + 6}px`;
254612
+ button.style.height = `${height + 6}px`;
254613
+ button.innerHTML = item3.previewSvg;
254614
+ button.addEventListener("click", () => pick(item3.id));
254615
+ return button;
254616
+ };
254617
+ return {
254618
+ root,
254619
+ trigger,
254620
+ popup,
254621
+ clear() {
254622
+ strip3.replaceChildren();
254623
+ popup.replaceChildren();
254624
+ trigger.removeAttribute("data-ribbon-gallery");
254625
+ trigger.removeAttribute("aria-label");
254626
+ trigger.textContent = "";
254627
+ },
254628
+ setOpen(open) {
254629
+ popup.hidden = !open;
254630
+ if (open) {
254631
+ root.append(popup);
254632
+ } else {
254633
+ popup.remove();
254634
+ }
254635
+ },
254636
+ paint(descriptor, t, disabled, inline, chevronOnly, icon, open, controlId) {
254637
+ const title = caption(t, descriptor.labelKey, descriptor.label);
254638
+ trigger.dataset.ribbonGallery = descriptor.id;
254639
+ popup.dataset.ribbonGalleryPopup = descriptor.id;
254640
+ const more = t("pptx.gallery.more", { name: title });
254641
+ trigger.title = inline ? more === "pptx.gallery.more" ? `More ${title}` : more : title;
254642
+ trigger.setAttribute("aria-label", trigger.title);
254643
+ trigger.disabled = disabled;
254644
+ trigger.replaceChildren();
254645
+ if (!inline && !chevronOnly) {
254646
+ const svg = controlId && RIBBON_CONTROL_ICONS[controlId] ? createRibbonControlIcon(doc, controlId) : doc.createElementNS("http://www.w3.org/2000/svg", "svg");
254647
+ if (!svg.hasAttribute("viewBox")) {
254648
+ svg.setAttribute("viewBox", "0 0 20 20");
254649
+ }
254650
+ svg.setAttribute("aria-hidden", "true");
254651
+ const path = doc.createElementNS(svg.namespaceURI, "path");
254652
+ path.setAttribute("d", RIBBON_ICON_PATHS[icon] ?? RIBBON_ICON_PATHS.palette);
254653
+ if (!svg.childElementCount) {
254654
+ svg.append(path);
254655
+ }
254656
+ const label = doc.createElement("span");
254657
+ label.textContent = title;
254658
+ trigger.append(svg, label);
254659
+ }
254660
+ const chevron2 = doc.createElement("span");
254661
+ chevron2.textContent = "\u2304";
254662
+ chevron2.setAttribute("aria-hidden", "true");
254663
+ trigger.append(chevron2);
254664
+ strip3.hidden = !inline;
254665
+ strip3.style.display = inline ? "" : "none";
254666
+ strip3.replaceChildren(
254667
+ ...inline ? inlineGalleryItems(descriptor).map(
254668
+ (item3) => tile4(
254669
+ item3,
254670
+ descriptor.sections[0]?.tileWidth ?? 40,
254671
+ descriptor.sections[0]?.tileHeight ?? 30,
254672
+ disabled,
254673
+ t
254674
+ )
254675
+ ) : []
254676
+ );
254677
+ popup.setAttribute("aria-label", title);
254678
+ popup.replaceChildren(
254679
+ ...(open ? descriptor.sections : []).map((section) => {
254680
+ const container = doc.createElement("section");
254681
+ container.className = "section";
254682
+ if (section.titleKey || section.title) {
254683
+ const heading = doc.createElement("div");
254684
+ heading.className = "heading";
254685
+ heading.textContent = section.titleKey ? caption(t, section.titleKey, section.title ?? "") : section.title ?? "";
254686
+ container.append(heading);
254687
+ }
254688
+ const grid = doc.createElement("div");
254689
+ grid.className = "grid";
254690
+ grid.style.gridTemplateColumns = `repeat(${section.columns}, minmax(0, 1fr))`;
254691
+ grid.append(
254692
+ ...section.items.map(
254693
+ (item3) => tile4(item3, section.tileWidth, section.tileHeight, disabled, t)
254694
+ )
254695
+ );
254696
+ container.append(grid);
254697
+ return container;
254698
+ })
254699
+ );
254700
+ }
254701
+ };
254702
+ }
254703
+ function definePptxRibbonGallery(registry) {
254704
+ if (registry.get("pptx-ui-ribbon-gallery")) {
254705
+ return;
254706
+ }
254707
+ class RibbonGallery extends HTMLElement {
254708
+ static observedAttributes = ["mode", "chevron-only", "icon", "data-ribbon-control"];
254709
+ value;
254710
+ t = (key2) => key2;
254711
+ locked = false;
254712
+ opened = false;
254713
+ view;
254714
+ constructor() {
254715
+ super();
254716
+ this.view = createRibbonGalleryView(
254717
+ this.ownerDocument,
254718
+ (itemId) => this.pick(itemId),
254719
+ () => {
254720
+ this.open = !this.open;
254721
+ }
254722
+ );
254723
+ this.view.root.addEventListener("keydown", (event) => {
254724
+ if (event.key === "Escape" && this.open) {
254725
+ event.stopPropagation();
254726
+ event.preventDefault();
254727
+ this.close();
254728
+ this.view.trigger.focus();
254729
+ }
254730
+ if (event.key === "ArrowDown" && event.target === this.view.trigger) {
254731
+ event.stopPropagation();
254732
+ event.preventDefault();
254733
+ this.open = true;
254734
+ this.view.popup.querySelector("button:not(:disabled)")?.focus();
254735
+ }
254736
+ if (event.key === "Enter" || event.key === " ") {
254737
+ event.stopPropagation();
254738
+ }
254739
+ });
254740
+ }
254741
+ get descriptor() {
254742
+ return this.value;
254743
+ }
254744
+ set descriptor(value) {
254745
+ this.value = value;
254746
+ this.paint();
254747
+ }
254748
+ get trigger() {
254749
+ return this.view.trigger;
254750
+ }
254751
+ get popup() {
254752
+ return this.view.popup;
254753
+ }
254754
+ get translateLabel() {
254755
+ return this.t;
254756
+ }
254757
+ set translateLabel(value) {
254758
+ this.t = value;
254759
+ this.paint();
254760
+ }
254761
+ get disabled() {
254762
+ return this.locked;
254763
+ }
254764
+ set disabled(value) {
254765
+ this.locked = Boolean(value);
254766
+ this.paint();
254767
+ }
254768
+ get open() {
254769
+ return this.opened;
254770
+ }
254771
+ set open(value) {
254772
+ const next = Boolean(value) && !this.unavailable();
254773
+ if (next === this.opened) {
254774
+ return;
254775
+ }
254776
+ this.opened = next;
254777
+ this.view.setOpen(next);
254778
+ this.paint();
254779
+ this.view.trigger.setAttribute("aria-expanded", String(next));
254780
+ this.cleanup();
254781
+ if (next && this.isConnected) {
254782
+ this.ownerDocument.addEventListener("pointerdown", this.outside, true);
254783
+ this.ownerDocument.addEventListener("keydown", this.escape);
254784
+ this.ownerDocument.defaultView?.addEventListener("resize", this.position);
254785
+ this.ownerDocument.addEventListener("scroll", this.position, true);
254786
+ this.position();
254787
+ }
254788
+ }
254789
+ close() {
254790
+ this.open = false;
254791
+ }
254792
+ connectedCallback() {
254793
+ attachRibbonGalleryStyles(this.ownerDocument);
254794
+ this.append(this.view.root);
254795
+ this.paint();
254796
+ }
254797
+ disconnectedCallback() {
254798
+ this.close();
254799
+ this.cleanup();
254800
+ }
254801
+ attributeChangedCallback() {
254802
+ this.paint();
254803
+ }
254804
+ unavailable() {
254805
+ return this.locked || !this.value || this.value.disabled || !galleryHasItems(this.value);
254806
+ }
254807
+ paint() {
254808
+ if (!this.value) {
254809
+ this.close();
254810
+ this.view.clear();
254811
+ this.view.trigger.disabled = true;
254812
+ return;
254813
+ }
254814
+ const hadFocus = this.contains(this.ownerDocument.activeElement);
254815
+ if (this.view.root.parentElement !== this) {
254816
+ this.append(this.view.root);
254817
+ }
254818
+ const focusedId = this.ownerDocument.activeElement?.getAttribute("data-gallery-item");
254819
+ const focusInPopup = this.view.popup.contains(this.ownerDocument.activeElement);
254820
+ this.view.paint(
254821
+ this.value,
254822
+ this.t,
254823
+ this.unavailable(),
254824
+ this.getAttribute("mode") === "inline" && !this.hasAttribute("chevron-only"),
254825
+ this.hasAttribute("chevron-only"),
254826
+ this.getAttribute("icon") ?? "palette",
254827
+ this.open,
254828
+ this.getAttribute("data-ribbon-control") ?? void 0
254829
+ );
254830
+ this.view.trigger.setAttribute("aria-expanded", String(this.open));
254831
+ if (this.unavailable()) {
254832
+ this.close();
254833
+ }
254834
+ if (this.open) {
254835
+ this.position();
254836
+ }
254837
+ if (focusedId && hadFocus) {
254838
+ (focusInPopup ? this.view.popup : this).querySelector(`[data-gallery-item="${CSS.escape(focusedId)}"]`)?.focus();
254839
+ }
254840
+ }
254841
+ pick(itemId) {
254842
+ if (this.unavailable() || !this.value?.sections.some((section) => section.items.some((item3) => item3.id === itemId))) {
254843
+ return;
254844
+ }
254845
+ this.close();
254846
+ this.view.trigger.focus();
254847
+ this.dispatchEvent(
254848
+ new CustomEvent("gallery-pick", {
254849
+ detail: { gallery: this.value.id, itemId },
254850
+ bubbles: true,
254851
+ composed: true
254852
+ })
254853
+ );
254854
+ }
254855
+ outside = (event) => {
254856
+ if (!event.composedPath().includes(this)) {
254857
+ this.close();
254858
+ }
254859
+ };
254860
+ escape = (event) => {
254861
+ if (event.key === "Escape") {
254862
+ event.stopPropagation();
254863
+ this.close();
254864
+ this.view.trigger.focus();
254865
+ }
254866
+ };
254867
+ position = () => {
254868
+ const window2 = this.ownerDocument.defaultView;
254869
+ if (!window2) {
254870
+ return;
254871
+ }
254872
+ const anchor = this.view.trigger.getBoundingClientRect();
254873
+ const width = this.view.popup.getBoundingClientRect().width;
254874
+ this.view.popup.style.left = `${Math.max(8, Math.min(anchor.left, window2.innerWidth - width - 8))}px`;
254875
+ this.view.popup.style.top = `${Math.max(8, Math.min(anchor.bottom + 4, window2.innerHeight - this.view.popup.getBoundingClientRect().height - 8))}px`;
254876
+ };
254877
+ cleanup() {
254878
+ this.ownerDocument.removeEventListener("pointerdown", this.outside, true);
254879
+ this.ownerDocument.removeEventListener("keydown", this.escape);
254880
+ this.ownerDocument.defaultView?.removeEventListener("resize", this.position);
254881
+ this.ownerDocument.removeEventListener("scroll", this.position, true);
254882
+ }
254883
+ }
254884
+ registry.define("pptx-ui-ribbon-gallery", RibbonGallery);
254885
+ }
254886
+ var STYLES = `
254887
+ :host { display: inline-flex; flex: none; align-self: stretch; }
254888
+ .group { box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
254889
+ min-height: 78px; padding: 4px 8px 2px; border-right: 1px solid color-mix(in srgb, var(--pptx-border, #33334d) 60%, transparent); }
254890
+ :host(:last-child) .group { border-right: 0; }
254891
+ .row { display: flex; align-items: flex-start; gap: 4px; }
254892
+ ::slotted(*) { flex-shrink: 0; }
254893
+ .caption { padding-top: 2px; color: var(--pptx-muted-foreground, #94a3b8); font: inherit;
254894
+ font-size: 9px; line-height: 12px; text-align: center; white-space: nowrap; }
254895
+ `;
254896
+ function definePptxRibbonGroup(registry) {
254897
+ if (registry.get("pptx-ui-ribbon-group")) {
254898
+ return;
254899
+ }
254900
+ class RibbonGroup extends HTMLElement {
254901
+ static observedAttributes = ["label"];
254902
+ caption;
254903
+ constructor() {
254904
+ super();
254905
+ const root = this.attachShadow({ mode: "open" });
254906
+ attachControlStyles(root, STYLES);
254907
+ const group2 = document.createElement("div");
254908
+ group2.className = "group";
254909
+ const row = document.createElement("div");
254910
+ row.className = "row";
254911
+ row.append(document.createElement("slot"));
254912
+ this.caption = document.createElement("span");
254913
+ this.caption.className = "caption";
254914
+ group2.append(row, this.caption);
254915
+ root.append(group2);
254916
+ }
254917
+ connectedCallback() {
254918
+ this.setAttribute("role", "group");
254919
+ this.sync();
254920
+ }
254921
+ attributeChangedCallback() {
254922
+ this.sync();
254923
+ }
254924
+ sync() {
254925
+ const label = this.getAttribute("label") ?? "";
254926
+ this.caption.textContent = label;
254927
+ this.setAttribute("aria-label", label);
254928
+ }
254929
+ }
254930
+ registry.define("pptx-ui-ribbon-group", RibbonGroup);
254931
+ }
254932
+ function setBoolean2(el, name, value) {
254933
+ el.toggleAttribute(name, Boolean(value));
254934
+ }
254935
+ function setOptionalBoolean(el, name, value) {
254936
+ if (value === void 0) {
254937
+ el.removeAttribute(name);
254938
+ } else {
254939
+ el.setAttribute(name, String(value));
254940
+ }
254941
+ }
254942
+ function syncCommand(el, command) {
254943
+ el.setAttribute("data-ribbon-control", command.id);
254944
+ el.setAttribute("label", command.label);
254945
+ el.setAttribute("title", command.title ?? command.label);
254946
+ el.setAttribute("icon", command.icon);
254947
+ if (command.badge) {
254948
+ el.setAttribute("badge", String(command.badge));
254949
+ } else {
254950
+ el.removeAttribute("badge");
254951
+ }
254952
+ for (const attr22 of ["disabled", "active", "compact", "hidden"]) {
254953
+ setBoolean2(el, attr22, command[attr22]);
254954
+ }
254955
+ setOptionalBoolean(el, "pressed", command.pressed);
254956
+ setOptionalBoolean(el, "expanded", command.expanded);
254957
+ }
254958
+ function createRibbonSectionView(root) {
254959
+ const groups = /* @__PURE__ */ new Map();
254960
+ const commands = /* @__PURE__ */ new Map();
254961
+ return (model) => {
254962
+ const wantedGroups = new Set(model.map((group2) => group2.id));
254963
+ const wantedCommands = new Set(
254964
+ model.flatMap((group2) => group2.commands.map((command) => command.id))
254965
+ );
254966
+ for (const [id, el] of commands) {
254967
+ if (!wantedCommands.has(id)) {
254968
+ el.remove();
254969
+ commands.delete(id);
254970
+ }
254971
+ }
254972
+ for (const [id, group2] of groups) {
254973
+ if (!wantedGroups.has(id)) {
254974
+ group2.el.remove();
254975
+ groups.delete(id);
254976
+ }
254977
+ }
254978
+ for (const [index, group2] of model.entries()) {
254979
+ let node = groups.get(group2.id);
254980
+ if (!node) {
254981
+ node = { el: root.ownerDocument.createElement("pptx-ui-ribbon-group"), columns: /* @__PURE__ */ new Map() };
254982
+ groups.set(group2.id, node);
254983
+ }
254984
+ node.el.setAttribute("data-ribbon-group", group2.id);
254985
+ node.el.setAttribute("label", group2.label);
254986
+ if (root.children[index] !== node.el) {
254987
+ root.insertBefore(node.el, root.children[index] ?? null);
254988
+ }
254989
+ const offsets2 = /* @__PURE__ */ new Map();
254990
+ for (const command of group2.commands) {
254991
+ let parent = node.el;
254992
+ if (command.column !== void 0) {
254993
+ let column = node.columns.get(command.column);
254994
+ if (!column) {
254995
+ column = root.ownerDocument.createElement("div");
254996
+ Object.assign(column.style, { display: "flex", flexDirection: "column", gap: "2px" });
254997
+ node.columns.set(command.column, column);
254998
+ node.el.append(column);
254999
+ }
255000
+ parent = column;
255001
+ }
255002
+ let el = commands.get(command.id);
255003
+ if (!el) {
255004
+ el = root.ownerDocument.createElement("pptx-ui-ribbon-command");
255005
+ commands.set(command.id, el);
255006
+ }
255007
+ syncCommand(el, command);
255008
+ const offset = offsets2.get(parent) ?? 0;
255009
+ if (parent.children[offset] !== el) {
255010
+ parent.insertBefore(el, parent.children[offset] ?? null);
255011
+ }
255012
+ offsets2.set(parent, offset + 1);
255013
+ }
255014
+ }
255015
+ };
255016
+ }
255017
+ function definePptxRibbonSection(registry) {
255018
+ if (registry.get("pptx-ui-ribbon-section")) {
255019
+ return;
255020
+ }
255021
+ class RibbonSection extends HTMLElement {
255022
+ model = [];
255023
+ render = createRibbonSectionView(this);
255024
+ get groups() {
255025
+ return this.model;
255026
+ }
255027
+ set groups(value) {
255028
+ this.model = value;
255029
+ this.render(value);
255030
+ }
255031
+ connectedCallback() {
255032
+ this.style.display = "inline-flex";
255033
+ this.style.alignItems = "stretch";
255034
+ this.render(this.model);
255035
+ }
255036
+ }
255037
+ registry.define("pptx-ui-ribbon-section", RibbonSection);
255038
+ }
255039
+ function definePptxRibbonToggle(registry) {
255040
+ if (registry.get("pptx-ui-ribbon-toggle")) {
255041
+ return;
255042
+ }
255043
+ class RibbonToggle extends HTMLElement {
255044
+ static observedAttributes = ["label", "checked", "disabled", "title"];
255045
+ checkbox;
255046
+ text;
255047
+ constructor() {
255048
+ super();
255049
+ const root = this.attachShadow({ mode: "open" });
255050
+ attachControlStyles(
255051
+ root,
255052
+ `
255053
+ :host { display: block; }
255054
+ label { display: flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 4px;
255055
+ color: var(--pptx-foreground, #f9fafb); font: inherit; font-size: 10px; white-space: nowrap; cursor: pointer; }
255056
+ :host([disabled]) label { color: var(--pptx-muted-foreground, #9ca3af); cursor: not-allowed; }
255057
+ @media (pointer: coarse), (max-width: 767px) { label { min-height: 44px; font-size: 12px; } }
255058
+ `
255059
+ );
255060
+ const label = document.createElement("label");
255061
+ this.checkbox = document.createElement("pptx-ui-checkbox");
255062
+ this.text = document.createTextNode("");
255063
+ label.append(this.checkbox, this.text);
255064
+ label.addEventListener("click", (event) => {
255065
+ event.preventDefault();
255066
+ if (event.target !== this.checkbox) {
255067
+ this.checkbox.click();
255068
+ }
255069
+ });
255070
+ this.checkbox.addEventListener("input", (event) => event.stopPropagation());
255071
+ this.checkbox.addEventListener("change", (event) => {
255072
+ event.stopPropagation();
255073
+ const checked = this.checkbox.checked;
255074
+ this.sync();
255075
+ const id = this.getAttribute("data-ribbon-control");
255076
+ if (!this.hasAttribute("disabled") && id) {
255077
+ this.dispatchEvent(
255078
+ new CustomEvent("toggle-request", {
255079
+ detail: { id, checked },
255080
+ bubbles: true,
255081
+ composed: true
255082
+ })
255083
+ );
255084
+ }
255085
+ });
255086
+ root.append(label);
255087
+ }
255088
+ connectedCallback() {
255089
+ this.sync();
255090
+ }
255091
+ attributeChangedCallback() {
255092
+ this.sync();
255093
+ }
255094
+ sync() {
255095
+ const label = this.getAttribute("label") ?? "";
255096
+ this.text.textContent = label;
255097
+ this.checkbox.setAttribute("aria-label", label);
255098
+ this.checkbox.title = this.getAttribute("title") ?? label;
255099
+ this.checkbox.checked = this.hasAttribute("checked");
255100
+ this.checkbox.disabled = this.hasAttribute("disabled");
255101
+ }
255102
+ }
255103
+ registry.define("pptx-ui-ribbon-toggle", RibbonToggle);
255104
+ }
255105
+ var SEARCH_STYLES = `
255106
+ :host {
255107
+ display: flex;
255108
+ align-items: center;
255109
+ gap: 8px;
255110
+ box-sizing: border-box;
255111
+ width: 100%;
255112
+ height: 40px;
255113
+ padding: 0 12px;
255114
+ border: 1px solid var(--pptx-input, #374151);
255115
+ background: var(--pptx-card, #111827);
255116
+ color: var(--pptx-muted-foreground, #9ca3af);
255117
+ font: inherit;
255118
+ }
255119
+ :host(:focus-within) { border-color: var(--pptx-ring, #6366f1); }
255120
+ :host([variant="titlebar"]) {
255121
+ height: 28px;
255122
+ gap: 7px;
255123
+ padding-inline: 14px;
255124
+ border-color: var(--pptx-border, #374151);
255125
+ border-radius: 6px;
255126
+ background: var(--pptx-background, #030712);
255127
+ }
255128
+ :host([variant="titlebar"]:focus-within) {
255129
+ border-color: var(--pptx-ring, #6366f1);
255130
+ color: var(--pptx-foreground, #f3f4f6);
255131
+ }
255132
+ :host([disabled]) { opacity: .5; cursor: not-allowed; }
255133
+ svg { width: 16px; height: 16px; flex: none; }
255134
+ :host([variant="titlebar"]) svg { width: 14px; height: 14px; }
255135
+ input {
255136
+ min-width: 0;
255137
+ width: 100%;
255138
+ height: 100%;
255139
+ flex: 1;
255140
+ padding: 0;
255141
+ border: 0;
255142
+ outline: 0;
255143
+ background: transparent;
255144
+ color: var(--pptx-card-foreground, #f3f4f6);
255145
+ font: inherit;
255146
+ font-size: 13px;
255147
+ }
255148
+ :host([variant="titlebar"]) input {
255149
+ font-size: 11px;
255150
+ color: var(--pptx-foreground, #f3f4f6);
255151
+ }
255152
+ input::placeholder {
255153
+ color: var(--pptx-muted-foreground, #9ca3af);
255154
+ opacity: .8;
255155
+ }
255156
+ input::-webkit-search-cancel-button { display: none; }
255157
+ @media (forced-colors: active) {
255158
+ :host {
255159
+ border-color: CanvasText;
255160
+ background: Canvas;
255161
+ color: CanvasText;
255162
+ }
255163
+ :host(:focus-within) {
255164
+ outline: 2px solid Highlight;
255165
+ outline-offset: 2px;
255166
+ }
255167
+ input { color: CanvasText; }
255168
+ }
255169
+ `;
255170
+ var SEARCH_ICON = `<svg part="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>`;
255171
+ function definePptxSearchField(registry) {
255172
+ if (registry.get("pptx-ui-search")) {
255173
+ return;
255174
+ }
255175
+ class PptxSearchField extends HTMLElement {
255176
+ static observedAttributes = ["placeholder", "aria-label", "disabled", "value"];
255177
+ input;
255178
+ currentValue = "";
255179
+ constructor() {
255180
+ super();
255181
+ const root = this.attachShadow({ mode: "open", delegatesFocus: true });
255182
+ attachControlStyles(root, SEARCH_STYLES);
255183
+ const icon = document.createElement("template");
255184
+ icon.innerHTML = SEARCH_ICON;
255185
+ root.append(icon.content.cloneNode(true));
255186
+ this.input = document.createElement("input");
255187
+ this.input.type = "search";
255188
+ this.input.setAttribute("part", "input");
255189
+ this.input.addEventListener("input", (event) => {
255190
+ event.stopPropagation();
255191
+ this.currentValue = this.input.value;
255192
+ this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
255193
+ });
255194
+ this.input.addEventListener("change", (event) => {
255195
+ event.stopPropagation();
255196
+ this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
255197
+ });
255198
+ root.append(this.input);
255199
+ }
255200
+ connectedCallback() {
255201
+ this.sync();
255202
+ if (this.hasAttribute("value")) {
255203
+ this.value = this.getAttribute("value") ?? "";
255204
+ }
255205
+ }
255206
+ attributeChangedCallback(name) {
255207
+ if (name === "value") {
255208
+ this.value = this.getAttribute("value") ?? "";
255209
+ } else {
255210
+ this.sync();
255211
+ }
255212
+ }
255213
+ get value() {
255214
+ return this.currentValue;
255215
+ }
255216
+ set value(next) {
255217
+ this.currentValue = String(next ?? "");
255218
+ if (this.input.value !== this.currentValue) {
255219
+ this.input.value = this.currentValue;
255220
+ }
255221
+ }
255222
+ get disabled() {
255223
+ return this.hasAttribute("disabled");
255224
+ }
255225
+ set disabled(next) {
255226
+ this.toggleAttribute("disabled", Boolean(next));
255227
+ }
255228
+ focus(options) {
255229
+ this.input.focus(options);
255230
+ }
255231
+ select() {
255232
+ this.input.select();
255233
+ }
255234
+ sync() {
255235
+ this.input.placeholder = this.getAttribute("placeholder") ?? "";
255236
+ this.input.setAttribute(
255237
+ "aria-label",
255238
+ this.getAttribute("aria-label") ?? this.input.placeholder
255239
+ );
255240
+ this.input.disabled = this.hasAttribute("disabled");
255241
+ }
255242
+ }
255243
+ registry.define("pptx-ui-search", PptxSearchField);
255244
+ }
255245
+ var SELECT_OPTION_ATTRIBUTES = [
255246
+ "value",
255247
+ "disabled",
255248
+ "label",
255249
+ "selected",
255250
+ "hidden",
255251
+ "data-display-label",
255252
+ "data-description",
255253
+ "style"
255254
+ ];
255255
+ function collectSelectChoices(options) {
255256
+ return options.map((option) => {
255257
+ const group2 = option.parentElement instanceof HTMLOptGroupElement ? option.parentElement : null;
255258
+ return {
255259
+ value: option.value,
255260
+ label: option.label || option.textContent?.trim() || "",
255261
+ disabled: option.disabled || Boolean(group2?.disabled),
255262
+ hidden: Boolean(option.hidden) || Boolean(group2?.hidden),
255263
+ group: group2?.label ?? "",
255264
+ ...option.dataset.displayLabel ? { displayLabel: option.dataset.displayLabel } : {},
255265
+ ...option.dataset.description ? { description: option.dataset.description } : {},
255266
+ ...option.style.fontFamily ? { fontFamily: option.style.fontFamily } : {}
255267
+ };
255268
+ });
255269
+ }
255270
+ function renderSelectMenu(menu, choices2, value) {
255271
+ const menuItems = [];
255272
+ let previousGroup = "";
255273
+ choices2.forEach((choice, index) => {
255274
+ if (choice.hidden) {
255275
+ return;
255276
+ }
255277
+ if (choice.group && choice.group !== previousGroup) {
255278
+ const heading = document.createElement("div");
255279
+ heading.className = "group";
255280
+ heading.setAttribute("role", "presentation");
255281
+ heading.textContent = choice.group;
255282
+ menuItems.push(heading);
255283
+ }
255284
+ previousGroup = choice.group;
255285
+ const item3 = document.createElement("div");
255286
+ item3.className = "option";
255287
+ item3.setAttribute("role", "option");
255288
+ item3.setAttribute("aria-selected", String(choice.value === value));
255289
+ item3.setAttribute("aria-disabled", String(choice.disabled));
255290
+ item3.id = `${menu.id}-${index}`;
255291
+ item3.dataset.index = String(index);
255292
+ item3.textContent = choice.displayLabel ?? choice.label;
255293
+ if (choice.fontFamily) {
255294
+ item3.style.fontFamily = choice.fontFamily;
255295
+ }
255296
+ if (choice.description) {
255297
+ const description = document.createElement("span");
255298
+ description.className = "description";
255299
+ description.textContent = choice.description;
255300
+ item3.append(description);
255301
+ }
255302
+ menuItems.push(item3);
255303
+ });
255304
+ menu.replaceChildren(...menuItems);
255305
+ }
255306
+ function positionSelectMenu(menu, trigger) {
255307
+ const rect22 = trigger.getBoundingClientRect();
255308
+ const margin = 8;
255309
+ const gap = 4;
255310
+ const width = Math.max(0, window.innerWidth - margin * 2);
255311
+ const below = Math.max(0, window.innerHeight - rect22.bottom - gap - margin);
255312
+ const above = Math.max(0, rect22.top - gap - margin);
255313
+ menu.style.minWidth = `${Math.min(rect22.width, width)}px`;
255314
+ menu.style.maxWidth = `${width}px`;
255315
+ const heightCap = trigger.getRootNode() instanceof ShadowRoot && trigger.getRootNode().host.getAttribute("data-font-picker") === "family" ? 320 : 240;
255316
+ menu.style.maxHeight = `${heightCap}px`;
255317
+ const preferredHeight = menu.getBoundingClientRect().height;
255318
+ const flip = below < preferredHeight && above > below;
255319
+ menu.style.maxHeight = `${Math.min(heightCap, flip ? above : below)}px`;
255320
+ const { height, width: menuWidth } = menu.getBoundingClientRect();
255321
+ menu.style.top = `${Math.max(margin, flip ? rect22.top - gap - height : rect22.bottom + gap)}px`;
255322
+ menu.style.left = `${Math.max(margin, Math.min(rect22.left, window.innerWidth - menuWidth - margin))}px`;
255323
+ }
255324
+ function markSelectActive(menu, trigger, active2, open) {
255325
+ for (const item3 of menu.querySelectorAll("[data-index]")) {
255326
+ item3.toggleAttribute("data-active", Number(item3.dataset.index) === active2 && open);
255327
+ }
255328
+ if (open && active2 >= 0) {
255329
+ trigger.setAttribute("aria-activedescendant", `${menu.id}-${active2}`);
255330
+ }
255331
+ menu.querySelector("[data-active]")?.scrollIntoView?.({ block: "nearest" });
255332
+ }
255333
+ function nextSelectActive(choices2, active2, step) {
255334
+ for (let index = 0; index < choices2.length; index++) {
255335
+ active2 = (active2 + step + choices2.length) % choices2.length;
255336
+ if (!choices2[active2].disabled && !choices2[active2].hidden) {
255337
+ return active2;
255338
+ }
255339
+ }
255340
+ return active2;
255341
+ }
255342
+ var SELECT_RIBBON_STYLES = `
255343
+ :host([variant^="ribbon-"][disabled]) { opacity: .4; }
255344
+ :host([variant^="ribbon-"]) button {
255345
+ height: 28px; min-height: 28px; padding: 4px 8px; gap: 4px;
255346
+ border: 1px solid color-mix(in oklab, var(--pptx-border) 60%, transparent);
255347
+ border-radius: 3px; font-size: 12px; line-height: 18px;
255348
+ background: color-mix(in oklab, var(--pptx-background) 60%, transparent);
255349
+ color: var(--pptx-foreground);
255350
+ }
255351
+ :host([variant^="ribbon-"]) .value { flex: 1; min-width: 0; }
255352
+ :host([variant^="ribbon-"]) .chevron {
255353
+ width: 16px; height: 16px; margin: 0; border: 0; transform: none;
255354
+ }
255355
+ :host([variant^="ribbon-"]) .chevron svg { display: block; width: 16px; height: 16px; }
255356
+ :host([variant="ribbon-font"]) .chevron { color: var(--pptx-muted-foreground); }
255357
+ :host([variant="ribbon-font"][data-font-picker="size"]) button { padding-inline: 6px; }
255358
+ :host([variant="ribbon-icon"]) button {
255359
+ width: 36px; gap: 6px; padding: 6px 10px; border: 0; font-size: 12px; line-height: 16px;
255360
+ background: var(--pptx-muted); justify-content: center;
255361
+ }
255362
+ :host([variant="ribbon-icon"]) :is(.value, .chevron) { display: none; }
255363
+ ::slotted(svg[slot="icon"]) { display: block; width: 16px; height: 16px; flex: none; }
255364
+ :host([variant^="ribbon-"]) button:hover:not(:disabled) { background: var(--pptx-accent); }
255365
+ :host([variant^="ribbon-"]) .menu {
255366
+ width: 192px; padding: 4px 0; border-radius: 8px; font-size: 12px; line-height: 16px;
255367
+ }
255368
+ :host([data-font-picker="family"]) .menu { width: 256px; }
255369
+ :host([variant^="ribbon-"]) .option {
255370
+ display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 0;
255371
+ }
255372
+ :host([variant^="ribbon-"]) .option[aria-selected="true"] {
255373
+ background: transparent; color: var(--pptx-foreground);
255374
+ }
255375
+ :host([variant^="ribbon-"]) .option:hover,
255376
+ :host([variant^="ribbon-"]) .option[data-active] { background: var(--pptx-muted); filter: none; }
255377
+ :host([variant^="ribbon-"]) .group {
255378
+ padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: .25px;
255379
+ font-size: 10px; line-height: 15px;
255380
+ }
255381
+ @media (max-width: 767px) {
255382
+ :host([variant^="ribbon-"]) button { height: 44px; min-height: 44px; }
255383
+ }
255384
+ .description { flex: none; color: var(--pptx-muted-foreground); font-size: 10px; line-height: 15px; }
255385
+ `;
255386
+ var SELECT_STYLES = `
255387
+ :host {
255388
+ display: inline-block;
255389
+ box-sizing: border-box;
255390
+ min-width: 0;
255391
+ max-width: 100%;
255392
+ border: 0 !important;
255393
+ padding: 0 !important;
255394
+ background: transparent !important;
255395
+ box-shadow: none !important;
255396
+ color: var(--pptx-foreground, #e2e8f0);
255397
+ font: inherit;
255398
+ font-size: 12px;
255399
+ vertical-align: middle;
255400
+ }
255401
+ :host([disabled]) { opacity: .5; cursor: not-allowed; }
255402
+ button {
255403
+ box-sizing: border-box;
255404
+ width: 100%;
255405
+ min-height: 28px;
255406
+ display: flex;
255407
+ align-items: center;
255408
+ justify-content: space-between;
255409
+ gap: 10px;
255410
+ padding: 4px 7px;
255411
+ border: 1px solid var(--pptx-border, #3f3f52);
255412
+ border-radius: 5px;
255413
+ background: var(--pptx-select-control-bg, var(--pptx-background, #11111b));
255414
+ color: inherit;
255415
+ font: inherit;
255416
+ font-size: inherit;
255417
+ text-align: left;
255418
+ cursor: pointer;
255419
+ }
255420
+ :host(.bg-muted) button { background: var(--pptx-muted, #1f2937); }
255421
+ :host(.bg-popover) button { background: var(--pptx-popover, #111827); }
255422
+ button:focus-visible {
255423
+ outline: 2px solid var(--pptx-ring, #6366f1);
255424
+ outline-offset: 2px;
255425
+ }
255426
+ button:disabled { cursor: not-allowed; }
255427
+ @media (pointer: coarse), (max-width: 767px) {
255428
+ button { min-height: 44px; }
255429
+ }
255430
+ .value {
255431
+ overflow: hidden;
255432
+ text-overflow: ellipsis;
255433
+ white-space: nowrap;
255434
+ }
255435
+ .chevron svg { display: none; }
255436
+ .chevron {
255437
+ flex: none;
255438
+ width: 6px;
255439
+ height: 6px;
255440
+ margin: 0 2px 3px 0;
255441
+ border-right: 1.5px solid currentColor;
255442
+ border-bottom: 1.5px solid currentColor;
255443
+ transform: rotate(45deg);
255444
+ }
255445
+ :host([open]) .chevron {
255446
+ margin: 3px 2px 0 0;
255447
+ transform: rotate(225deg);
255448
+ }
255449
+ .menu {
255450
+ box-sizing: border-box;
255451
+ position: fixed;
255452
+ margin: 0;
255453
+ padding: 4px;
255454
+ min-width: 90px;
255455
+ max-height: min(240px, 50vh);
255456
+ overflow: auto;
255457
+ border: 1px solid var(--pptx-border, #3f3f52);
255458
+ border-radius: 5px;
255459
+ background: var(--pptx-popover, var(--pptx-background, #11111b));
255460
+ color: var(--pptx-popover-foreground, var(--pptx-foreground, #e2e8f0));
255461
+ box-shadow: 0 8px 20px #0004;
255462
+ font: inherit;
255463
+ font-size: inherit;
255464
+ }
255465
+ .menu:not(:popover-open):not([data-fallback-open]) { display: none; }
255466
+ .option {
255467
+ display: block;
255468
+ box-sizing: border-box;
255469
+ width: 100%;
255470
+ padding: 6px 8px;
255471
+ border-radius: 3px;
255472
+ cursor: pointer;
255473
+ white-space: nowrap;
255474
+ }
255475
+ .group {
255476
+ padding: 7px 8px 3px;
255477
+ color: var(--pptx-muted-foreground, #9ca3af);
255478
+ font-size: .9em;
255479
+ font-weight: 600;
255480
+ }
255481
+ .option:not([aria-disabled="true"]):hover,
255482
+ .option[data-active]:not([aria-selected="true"]) {
255483
+ background: color-mix(in srgb, var(--pptx-primary, #e86a40) 20%, var(--pptx-popover, #11111b));
255484
+ }
255485
+ .option[aria-selected="true"] {
255486
+ background: var(--pptx-primary, #e86a40);
255487
+ color: var(--pptx-primary-foreground, #fff);
255488
+ }
255489
+ .option[aria-selected="true"]:hover { filter: brightness(1.08); }
255490
+ .option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
255491
+ @media (forced-colors: active) {
255492
+ button, .menu {
255493
+ border-color: CanvasText;
255494
+ background: Canvas;
255495
+ color: CanvasText;
255496
+ }
255497
+ .option[aria-selected="true"],
255498
+ .option[data-active],
255499
+ .option:not([aria-disabled="true"]):hover {
255500
+ background: Highlight;
255501
+ color: HighlightText;
255502
+ }
255503
+ }
255504
+ ${SELECT_RIBBON_STYLES}
255505
+ `;
255506
+ function createSelectTrigger() {
255507
+ const trigger = document.createElement("button");
255508
+ trigger.type = "button";
255509
+ trigger.setAttribute("part", "trigger");
255510
+ trigger.setAttribute("role", "combobox");
255511
+ trigger.setAttribute("aria-haspopup", "listbox");
255512
+ trigger.setAttribute("aria-expanded", "false");
255513
+ const icon = document.createElement("slot");
255514
+ icon.name = "icon";
255515
+ const text22 = document.createElement("span");
255516
+ text22.className = "value";
255517
+ text22.setAttribute("part", "value");
255518
+ const chevron2 = document.createElement("span");
255519
+ chevron2.className = "chevron";
255520
+ chevron2.setAttribute("part", "indicator");
255521
+ chevron2.setAttribute("aria-hidden", "true");
255522
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
255523
+ svg.setAttribute("viewBox", "0 0 24 24");
255524
+ svg.setAttribute("fill", "none");
255525
+ svg.setAttribute("stroke", "currentColor");
255526
+ svg.setAttribute("stroke-width", "2");
255527
+ svg.setAttribute("stroke-linecap", "round");
255528
+ svg.setAttribute("stroke-linejoin", "round");
255529
+ const path = document.createElementNS(svg.namespaceURI, "path");
255530
+ path.setAttribute("d", "m6 9 6 6 6-6");
255531
+ svg.append(path);
255532
+ chevron2.append(svg);
255533
+ trigger.append(icon, text22, chevron2);
255534
+ return { trigger, text: text22 };
255535
+ }
255536
+ function prependSelectCustomSlot(host2, menu) {
255537
+ if (host2.querySelector('[slot="custom"]')) {
255538
+ const custom = document.createElement("slot");
255539
+ custom.name = "custom";
255540
+ menu.prepend(custom);
255541
+ }
255542
+ }
255543
+ function createSelectValueElement() {
255544
+ class SelectValueElement extends HTMLElement {
255545
+ get value() {
255546
+ const requested = this.getAttribute("value");
255547
+ const options = this.options;
255548
+ if (this.getAttribute("variant") === "ribbon-font" && requested !== null) {
255549
+ return requested;
255550
+ }
255551
+ if (requested !== null && (!options.length || options.some((option) => option.value === requested))) {
255552
+ return requested;
255553
+ }
255554
+ return options.find((option) => option.selected)?.value ?? options.find(
255555
+ (option) => !option.disabled && !option.closest("optgroup[disabled]") && !option.hidden
255556
+ )?.value ?? options[0]?.value ?? requested ?? "";
255557
+ }
255558
+ set value(next) {
255559
+ this.setAttribute("value", String(next ?? ""));
255560
+ }
255561
+ get options() {
255562
+ return [...this.querySelectorAll("option")];
255563
+ }
255564
+ get selectedIndex() {
255565
+ return this.options.findIndex((option) => option.value === this.value);
255566
+ }
255567
+ set selectedIndex(index) {
255568
+ this.value = this.options[index]?.value ?? "";
255569
+ }
255570
+ }
255571
+ return SelectValueElement;
255572
+ }
255573
+ var nextSelectId = 0;
255574
+ function definePptxSelect(registry) {
255575
+ if (registry.get("pptx-ui-select")) {
255576
+ return;
255577
+ }
255578
+ class PptxSelect extends createSelectValueElement() {
255579
+ static formAssociated = true;
255580
+ static observedAttributes = ["value", "disabled", "aria-label"];
255581
+ internals;
255582
+ trigger;
255583
+ text;
255584
+ menu;
255585
+ observer;
255586
+ refreshFrame = 0;
255587
+ choices = [];
255588
+ active = -1;
255589
+ open = false;
255590
+ search = "";
255591
+ searchTimer = 0;
255592
+ defaultValue = "";
255593
+ constructor() {
255594
+ super();
255595
+ try {
255596
+ this.internals = this.attachInternals();
255597
+ } catch {
255598
+ this.internals = void 0;
255599
+ }
255600
+ const root = this.attachShadow({ mode: "open", delegatesFocus: true });
255601
+ attachControlStyles(root, SELECT_STYLES);
255602
+ ({ trigger: this.trigger, text: this.text } = createSelectTrigger());
255603
+ this.menu = document.createElement("div");
255604
+ this.menu.className = "menu";
255605
+ this.menu.id = `pptx-ui-select-options-${++nextSelectId}`;
255606
+ this.menu.setAttribute("role", "listbox");
255607
+ this.menu.setAttribute("popover", "manual");
255608
+ this.menu.setAttribute("part", "popup");
255609
+ this.trigger.setAttribute("aria-controls", this.menu.id);
255610
+ root.append(this.trigger, this.menu);
255611
+ this.trigger.addEventListener("click", () => this.open ? this.close() : this.show());
255612
+ this.trigger.addEventListener("keydown", (event) => this.onKeyDown(event));
255613
+ this.menu.addEventListener("pointerdown", (event) => {
255614
+ if (event.target.closest("[data-index]")) {
255615
+ event.preventDefault();
255616
+ }
255617
+ });
255618
+ this.menu.addEventListener("click", (event) => {
255619
+ const target = event.target.closest("[data-index]");
255620
+ if (target) {
255621
+ this.commit(Number(target.dataset.index));
255622
+ }
255623
+ });
255624
+ this.observer = new MutationObserver(() => {
255625
+ if (!this.refreshFrame) {
255626
+ this.refreshFrame = requestAnimationFrame(() => {
255627
+ this.refreshFrame = 0;
255628
+ this.refresh();
255629
+ });
255630
+ }
255631
+ });
255632
+ }
255633
+ connectedCallback() {
255634
+ this.defaultValue = this.getAttribute("value") ?? "";
255635
+ this.observer.observe(this, {
255636
+ childList: true,
255637
+ subtree: true,
255638
+ attributes: true,
255639
+ characterData: true,
255640
+ attributeFilter: SELECT_OPTION_ATTRIBUTES
255641
+ });
255642
+ this.refresh();
255643
+ }
255644
+ disconnectedCallback() {
255645
+ this.close();
255646
+ window.clearTimeout(this.searchTimer);
255647
+ this.searchTimer = 0;
255648
+ this.search = "";
255649
+ this.observer.disconnect();
255650
+ cancelAnimationFrame(this.refreshFrame);
255651
+ this.refreshFrame = 0;
255652
+ }
255653
+ attributeChangedCallback() {
255654
+ this.refresh();
255655
+ }
255656
+ get disabled() {
255657
+ return this.hasAttribute("disabled");
255658
+ }
255659
+ set disabled(next) {
255660
+ this.toggleAttribute("disabled", Boolean(next));
255661
+ }
255662
+ focus(options) {
255663
+ this.trigger.focus(options);
255664
+ }
255665
+ formResetCallback() {
255666
+ this.value = this.defaultValue;
255667
+ }
255668
+ formDisabledCallback(disabled) {
255669
+ this.disabled = disabled;
255670
+ }
255671
+ refresh() {
255672
+ if (!this.trigger) {
255673
+ return;
255674
+ }
255675
+ const options = [...this.querySelectorAll("option")];
255676
+ this.choices = collectSelectChoices(options);
255677
+ if (!this.hasAttribute("value") && this.choices.length) {
255678
+ this.value = options.find((option) => option.selected)?.value ?? this.choices.find((choice) => !choice.disabled && !choice.hidden)?.value ?? this.choices[0].value;
255679
+ }
255680
+ this.text.textContent = this.choices.find((choice) => choice.value === this.value)?.displayLabel ?? this.choices.find((choice) => choice.value === this.value)?.label ?? this.value;
255681
+ this.trigger.disabled = this.disabled;
255682
+ if (this.disabled) {
255683
+ this.close();
255684
+ }
255685
+ this.trigger.setAttribute("aria-label", this.getAttribute("aria-label") ?? "");
255686
+ this.internals?.setFormValue?.(this.disabled ? null : this.value);
255687
+ if (this.open || this.menu.childElementCount) {
255688
+ this.renderMenu();
255689
+ }
255690
+ }
255691
+ renderMenu() {
255692
+ renderSelectMenu(this.menu, this.choices, this.value);
255693
+ prependSelectCustomSlot(this, this.menu);
255694
+ markSelectActive(this.menu, this.trigger, this.active, this.open);
255695
+ }
255696
+ show() {
255697
+ if (this.disabled || !this.choices.some((choice) => !choice.disabled && !choice.hidden) || this.open) {
255698
+ return;
255699
+ }
255700
+ this.open = true;
255701
+ this.setAttribute("open", "");
255702
+ const selected = this.choices.findIndex(
255703
+ (choice) => choice.value === this.value && !choice.disabled && !choice.hidden
255704
+ );
255705
+ this.active = selected >= 0 ? selected : this.choices.findIndex((choice) => !choice.disabled && !choice.hidden);
255706
+ this.renderMenu();
255707
+ if (typeof this.menu.showPopover === "function") {
255708
+ this.menu.showPopover();
255709
+ } else {
255710
+ this.menu.dataset.fallbackOpen = "";
255711
+ }
255712
+ this.trigger.setAttribute("aria-expanded", "true");
255713
+ this.position();
255714
+ markSelectActive(this.menu, this.trigger, this.active, this.open);
255715
+ document.addEventListener("pointerdown", this.onOutside, true);
255716
+ window.addEventListener("resize", this.position);
255717
+ window.addEventListener("scroll", this.position, true);
255718
+ }
255719
+ close() {
255720
+ if (!this.open) {
255721
+ return;
255722
+ }
255723
+ this.open = false;
255724
+ window.clearTimeout(this.searchTimer);
255725
+ this.search = "";
255726
+ this.removeAttribute("open");
255727
+ if (this.menu.matches(":popover-open")) {
255728
+ this.menu.hidePopover();
255729
+ }
255730
+ delete this.menu.dataset.fallbackOpen;
255731
+ this.trigger.setAttribute("aria-expanded", "false");
255732
+ this.trigger.removeAttribute("aria-activedescendant");
255733
+ document.removeEventListener("pointerdown", this.onOutside, true);
255734
+ window.removeEventListener("resize", this.position);
255735
+ window.removeEventListener("scroll", this.position, true);
255736
+ }
255737
+ onOutside = (event) => {
255738
+ if (!event.composedPath().includes(this)) {
255739
+ this.close();
255740
+ }
255741
+ };
255742
+ position = () => {
255743
+ if (!this.open) {
255744
+ return;
255745
+ }
255746
+ positionSelectMenu(this.menu, this.trigger);
255747
+ };
255748
+ move(step) {
255749
+ if (!this.open) {
255750
+ this.show();
255751
+ }
255752
+ if (!this.open) {
255753
+ return;
255754
+ }
255755
+ this.active = nextSelectActive(this.choices, this.active, step);
255756
+ markSelectActive(this.menu, this.trigger, this.active, this.open);
255757
+ }
255758
+ commit(index) {
255759
+ const choice = this.choices[index];
255760
+ if (!choice || choice.disabled || choice.hidden) {
255761
+ return;
255762
+ }
255763
+ const changed = this.value !== choice.value;
255764
+ this.value = choice.value;
255765
+ this.close();
255766
+ this.trigger.focus();
255767
+ if (changed) {
255768
+ this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
255769
+ this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
255770
+ }
255771
+ }
255772
+ onKeyDown(event) {
255773
+ if (this.disabled) {
255774
+ return;
255775
+ }
255776
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
255777
+ event.preventDefault();
255778
+ event.stopPropagation();
255779
+ this.move(event.key === "ArrowDown" ? 1 : -1);
255780
+ } else if (event.key === "Home" || event.key === "End") {
255781
+ event.preventDefault();
255782
+ event.stopPropagation();
255783
+ this.show();
255784
+ this.active = event.key === "Home" ? nextSelectActive(this.choices, -1, 1) : nextSelectActive(this.choices, 0, -1);
255785
+ markSelectActive(this.menu, this.trigger, this.active, this.open);
255786
+ } else if (event.key === "Enter" || event.key === " ") {
255787
+ event.preventDefault();
255788
+ event.stopPropagation();
255789
+ if (this.open) {
255790
+ this.commit(this.active);
255791
+ } else {
255792
+ this.show();
255793
+ }
255794
+ } else if (event.key === "Escape" && this.open) {
255795
+ event.preventDefault();
255796
+ event.stopPropagation();
255797
+ this.close();
255798
+ this.trigger.focus();
255799
+ } else if (event.key === "Tab") {
255800
+ this.close();
255801
+ } else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
255802
+ event.stopPropagation();
255803
+ this.search += event.key.toLocaleLowerCase();
255804
+ window.clearTimeout(this.searchTimer);
255805
+ this.searchTimer = window.setTimeout(() => {
255806
+ this.search = "";
255807
+ }, 700);
255808
+ this.show();
255809
+ const index = this.choices.findIndex(
255810
+ (choice) => !choice.disabled && !choice.hidden && choice.label.toLocaleLowerCase().startsWith(this.search)
255811
+ );
255812
+ if (index >= 0) {
255813
+ this.active = index;
255814
+ markSelectActive(this.menu, this.trigger, this.active, this.open);
255815
+ }
255816
+ }
255817
+ }
255818
+ }
255819
+ registry.define("pptx-ui-select", PptxSelect);
255820
+ }
254091
255821
  var SLIDE_SHOW_OPTIONS_STYLES = `
254092
255822
  :host {
254093
255823
  display: inline-flex;
@@ -254360,12 +256090,12 @@ function definePptxSubtitleSettings(registry) {
254360
256090
  }
254361
256091
  registry.define("pptx-ui-subtitle-settings", SubtitleSettingsElement);
254362
256092
  }
254363
- function attachThemeEditorDock(host) {
254364
- if (host.hasAttribute("inline")) {
256093
+ function attachThemeEditorDock(host2) {
256094
+ if (host2.hasAttribute("inline")) {
254365
256095
  return () => {
254366
256096
  };
254367
256097
  }
254368
- const body = host.closest("[data-pptx-editor-chrome]")?.querySelector('[data-pptx-chrome="body"]');
256098
+ const body = host2.closest("[data-pptx-editor-chrome]")?.querySelector('[data-pptx-chrome="body"]');
254369
256099
  const position2 = () => {
254370
256100
  const rect22 = body?.getBoundingClientRect();
254371
256101
  const top = Math.max(0, rect22?.top ?? 0);
@@ -254375,7 +256105,7 @@ function attachThemeEditorDock(host) {
254375
256105
  const narrow = right - left < 768;
254376
256106
  const width = narrow ? right - left : Math.min(288, right - left);
254377
256107
  const height = Math.max(0, bottom - top) * (narrow ? 0.6 : 1);
254378
- Object.assign(host.style, {
256108
+ Object.assign(host2.style, {
254379
256109
  left: `${right - width}px`,
254380
256110
  top: `${bottom - height}px`,
254381
256111
  width: `${width}px`,
@@ -254762,6 +256492,8 @@ var controls = [
254762
256492
  ["pptx-ui-slide-show-options", definePptxSlideShowOptions],
254763
256493
  ["pptx-ui-ribbon-command", definePptxRibbonCommand],
254764
256494
  ["pptx-ui-ribbon-group", definePptxRibbonGroup],
256495
+ ["pptx-ui-ribbon-section", definePptxRibbonSection],
256496
+ ["pptx-ui-ribbon-gallery", definePptxRibbonGallery],
254765
256497
  ["pptx-ui-ribbon-toggle", definePptxRibbonToggle],
254766
256498
  ["pptx-ui-subtitle-settings", definePptxSubtitleSettings],
254767
256499
  ["pptx-ui-theme-editor", definePptxThemeEditor]
@@ -258143,6 +259875,8 @@ exports.DEFAULT_VIEWER_OPTIONS = DEFAULT_VIEWER_OPTIONS;
258143
259875
  exports.DEFAULT_VIEWER_PREFERENCES = DEFAULT_VIEWER_PREFERENCES;
258144
259876
  exports.DEFAULT_VIEWER_PROFILE = DEFAULT_VIEWER_PROFILE;
258145
259877
  exports.DEFAULT_VIRTUAL_OVERSCAN = DEFAULT_VIRTUAL_OVERSCAN;
259878
+ exports.DESIGN_RIBBON_COMMANDS = DESIGN_RIBBON_COMMANDS;
259879
+ exports.DESIGN_RIBBON_GROUPS = DESIGN_RIBBON_GROUPS;
258146
259880
  exports.DUOTONE_PRESETS = DUOTONE_PRESETS;
258147
259881
  exports.EASE = EASE;
258148
259882
  exports.EDITOR_CHROME_CSS = EDITOR_CHROME_CSS;
@@ -258253,9 +259987,6 @@ exports.READING_VIEW_STAGE_ATTR = READING_VIEW_STAGE_ATTR;
258253
259987
  exports.RECORD_COMMAND_GROUPS = RECORD_COMMAND_GROUPS;
258254
259988
  exports.RIBBON_CONTEXTUAL_TAB_ATTR = RIBBON_CONTEXTUAL_TAB_ATTR;
258255
259989
  exports.RIBBON_CONTROL_ATTR = RIBBON_CONTROL_ATTR;
258256
- exports.RIBBON_GALLERY_ATTR = RIBBON_GALLERY_ATTR;
258257
- exports.RIBBON_GALLERY_ITEM_ATTR = RIBBON_GALLERY_ITEM_ATTR;
258258
- exports.RIBBON_GALLERY_POPUP_ATTR = RIBBON_GALLERY_POPUP_ATTR;
258259
259990
  exports.RIBBON_GROUP_ATTR = RIBBON_GROUP_ATTR;
258260
259991
  exports.RIBBON_SCOPE_ATTR = RIBBON_SCOPE_ATTR;
258261
259992
  exports.RIBBON_SHAPE_SWATCHES = RIBBON_SHAPE_SWATCHES;
@@ -258464,6 +260195,7 @@ exports.buildPrintDocument = buildPrintDocument;
258464
260195
  exports.buildPrintHtmlDocument = buildPrintHtmlDocument;
258465
260196
  exports.buildRasterPictureElement = buildRasterPictureElement;
258466
260197
  exports.buildRectPathGradient = buildRectPathGradient;
260198
+ exports.buildReviewRibbon = buildReviewRibbon;
258467
260199
  exports.buildRibbonGallery = buildRibbonGallery;
258468
260200
  exports.buildRunProgramNotice = buildRunProgramNotice;
258469
260201
  exports.buildRunTabLines = buildRunTabLines;
@@ -258646,6 +260378,7 @@ exports.describeCollaborationShellState = describeCollaborationShellState;
258646
260378
  exports.describeFontEmbedding = describeFontEmbedding;
258647
260379
  exports.describeSmartArtBounds = describeSmartArtBounds;
258648
260380
  exports.describeTableStyleEditor = describeTableStyleEditor;
260381
+ exports.designCommandState = designCommandState;
258649
260382
  exports.detectOrientation = detectOrientation;
258650
260383
  exports.detectTouchDevice = detectTouchDevice;
258651
260384
  exports.directionValuesFor = directionValuesFor;
@@ -258705,8 +260438,7 @@ exports.formatSlideCounter = formatSlideCounter;
258705
260438
  exports.formatTime = formatTime;
258706
260439
  exports.formatVersionTimestamp = formatVersionTimestamp;
258707
260440
  exports.fpsToFrameIntervalMs = fpsToFrameIntervalMs;
258708
- exports.galleryHasItems = galleryHasItems;
258709
- exports.galleryItemLabel = galleryItemLabel;
260441
+ exports.galleryTextLabel = galleryTextLabel;
258710
260442
  exports.generateBroadcastRoomId = generateBroadcastRoomId;
258711
260443
  exports.generateElementId = generateElementId;
258712
260444
  exports.generateNoteLineCount = generateNoteLineCount;
@@ -258813,7 +260545,6 @@ exports.hiddenSlideCue = hiddenSlideCue;
258813
260545
  exports.hideChartSeries = hideChartSeries;
258814
260546
  exports.hollowTextFillStyle = hollowTextFillStyle;
258815
260547
  exports.inlineElementPointerEvents = inlineElementPointerEvents;
258816
- exports.inlineGalleryItems = inlineGalleryItems;
258817
260548
  exports.inlineListBodyText = inlineListBodyText;
258818
260549
  exports.insertCommentMention = insertCommentMention;
258819
260550
  exports.insertTableElementColumn = insertTableElementColumn;