pptx-react-viewer 4.75.0 → 4.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/{chunk-DE4Y5F4T.mjs → chunk-OC4RP2CB.mjs} +552 -350
  3. package/dist/chunk-OC4RP2CB.mjs.br +0 -0
  4. package/dist/chunk-OC4RP2CB.mjs.gz +0 -0
  5. package/dist/{chunk-AZLOOFU2.mjs → chunk-PPOGAZ53.mjs} +645 -262
  6. package/dist/chunk-PPOGAZ53.mjs.br +0 -0
  7. package/dist/chunk-PPOGAZ53.mjs.gz +0 -0
  8. package/dist/{chunk-3AZ6ESJU.js → chunk-SEIVQGH5.js} +1429 -1037
  9. package/dist/chunk-SEIVQGH5.js.br +0 -0
  10. package/dist/chunk-SEIVQGH5.js.gz +0 -0
  11. package/dist/{chunk-RJRDE3C2.js → chunk-XTYBIJ2S.js} +666 -464
  12. package/dist/chunk-XTYBIJ2S.js.br +0 -0
  13. package/dist/chunk-XTYBIJ2S.js.gz +0 -0
  14. package/dist/i18n/de.cjs +5 -0
  15. package/dist/i18n/de.cjs.br +0 -0
  16. package/dist/i18n/de.cjs.gz +0 -0
  17. package/dist/i18n/de.mjs +5 -0
  18. package/dist/i18n/de.mjs.br +0 -0
  19. package/dist/i18n/de.mjs.gz +0 -0
  20. package/dist/i18n/es.cjs +5 -0
  21. package/dist/i18n/es.cjs.br +0 -0
  22. package/dist/i18n/es.cjs.gz +0 -0
  23. package/dist/i18n/es.mjs +5 -0
  24. package/dist/i18n/es.mjs.br +0 -0
  25. package/dist/i18n/es.mjs.gz +0 -0
  26. package/dist/i18n/fr.cjs +5 -0
  27. package/dist/i18n/fr.cjs.br +0 -0
  28. package/dist/i18n/fr.cjs.gz +0 -0
  29. package/dist/i18n/fr.mjs +5 -0
  30. package/dist/i18n/fr.mjs.br +0 -0
  31. package/dist/i18n/fr.mjs.gz +0 -0
  32. package/dist/i18n/zh-CN.cjs +5 -0
  33. package/dist/i18n/zh-CN.cjs.br +0 -0
  34. package/dist/i18n/zh-CN.cjs.gz +0 -0
  35. package/dist/i18n/zh-CN.mjs +5 -0
  36. package/dist/i18n/zh-CN.mjs.br +0 -0
  37. package/dist/i18n/zh-CN.mjs.gz +0 -0
  38. package/dist/index.d.ts +53 -9
  39. package/dist/index.js +24 -24
  40. package/dist/index.js.br +0 -0
  41. package/dist/index.js.gz +0 -0
  42. package/dist/index.mjs +2 -2
  43. package/dist/index.mjs.br +0 -0
  44. package/dist/index.mjs.gz +0 -0
  45. package/dist/internals.d.ts +52 -24
  46. package/dist/internals.js +80 -80
  47. package/dist/internals.js.br +0 -0
  48. package/dist/internals.js.gz +0 -0
  49. package/dist/internals.mjs +1 -1
  50. package/dist/internals.mjs.br +0 -0
  51. package/dist/internals.mjs.gz +0 -0
  52. package/dist/no-i18next.d.ts +53 -9
  53. package/dist/no-i18next.js +24 -24
  54. package/dist/no-i18next.js.br +0 -0
  55. package/dist/no-i18next.js.gz +0 -0
  56. package/dist/no-i18next.mjs +2 -2
  57. package/dist/no-i18next.mjs.br +0 -0
  58. package/dist/no-i18next.mjs.gz +0 -0
  59. package/dist/pptx-viewer.css +1 -1
  60. package/dist/pptx-viewer.css.br +0 -0
  61. package/dist/pptx-viewer.css.gz +0 -0
  62. package/dist/viewer/index.d.ts +13 -0
  63. package/dist/viewer/index.js +17 -17
  64. package/dist/viewer/index.js.br +0 -0
  65. package/dist/viewer/index.js.gz +0 -0
  66. package/dist/viewer/index.mjs +2 -2
  67. package/dist/viewer/index.mjs.br +0 -0
  68. package/dist/viewer/index.mjs.gz +0 -0
  69. package/package.json +3 -3
  70. package/dist/chunk-3AZ6ESJU.js.br +0 -0
  71. package/dist/chunk-3AZ6ESJU.js.gz +0 -0
  72. package/dist/chunk-AZLOOFU2.mjs.br +0 -0
  73. package/dist/chunk-AZLOOFU2.mjs.gz +0 -0
  74. package/dist/chunk-DE4Y5F4T.mjs.br +0 -0
  75. package/dist/chunk-DE4Y5F4T.mjs.gz +0 -0
  76. package/dist/chunk-RJRDE3C2.js.br +0 -0
  77. package/dist/chunk-RJRDE3C2.js.gz +0 -0
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkMU3BIZ2U_js = require('./chunk-MU3BIZ2U.js');
4
- var chunk3AZ6ESJU_js = require('./chunk-3AZ6ESJU.js');
4
+ var chunkSEIVQGH5_js = require('./chunk-SEIVQGH5.js');
5
5
  var chunk6GFSF2ML_js = require('./chunk-6GFSF2ML.js');
6
6
  var pptx = require('ooxml-ui/pptx');
7
7
  var React108 = require('react');
@@ -51,7 +51,8 @@ function SlideThumbnailImpl({
51
51
  canvasSize,
52
52
  previewWidth,
53
53
  fieldContext,
54
- tableStyleContext
54
+ tableStyleContext,
55
+ onElementRenderError
55
56
  }) {
56
57
  const safeCanvasWidth = Math.max(canvasSize.width, 1);
57
58
  const safeCanvasHeight = Math.max(canvasSize.height, 1);
@@ -89,16 +90,17 @@ function SlideThumbnailImpl({
89
90
  ...pptx.deviceStrokeStageStyle(scale)
90
91
  },
91
92
  children: [
92
- /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.SlideBackgroundImageLayer, { slide }),
93
+ /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.SlideBackgroundImageLayer, { slide }),
93
94
  previewElements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
94
- chunk3AZ6ESJU_js.StaticElementRenderer,
95
+ chunkSEIVQGH5_js.StaticElementRenderer,
95
96
  {
96
97
  element,
97
98
  activeSlide: slide,
98
99
  allSlides: [slide],
99
100
  zIndex: index,
100
101
  fieldContext: slideFieldContext,
101
- tableStyleContext
102
+ tableStyleContext,
103
+ onElementRenderError
102
104
  },
103
105
  element.id
104
106
  ))
@@ -119,6 +121,9 @@ function SlideThumbnailImpl({
119
121
  );
120
122
  }
121
123
  function slideThumbnailPropsEqual(prev, next) {
124
+ if (prev.onElementRenderError !== next.onElementRenderError) {
125
+ return false;
126
+ }
122
127
  if (prev.previewWidth !== next.previewWidth) {
123
128
  return false;
124
129
  }
@@ -991,7 +996,14 @@ function useSlidePaneCallbacks(onMoveSlide, onRenameSection, onToggleSectionColl
991
996
  }
992
997
  var EMPTY_TEMPLATE_ELEMENTS = [];
993
998
  var VIRTUALIZATION_THRESHOLD = pptx.SLIDE_VIRTUALIZATION_THRESHOLD;
994
- function SlidesPaneSidebar({
999
+ function SlidesPaneSidebar(props) {
1000
+ const errorReporting = React108.useMemo(
1001
+ () => ({ onElementRenderError: props.onElementRenderError }),
1002
+ [props.onElementRenderError]
1003
+ );
1004
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ElementRenderErrorReportingContext.Provider, { value: errorReporting, children: /* @__PURE__ */ jsxRuntime.jsx(SlidesPaneSidebarContent, { ...props }) });
1005
+ }
1006
+ function SlidesPaneSidebarContent({
995
1007
  slides,
996
1008
  templateElementsBySlideId,
997
1009
  activeSlideIndex,
@@ -1021,7 +1033,7 @@ function SlidesPaneSidebar({
1021
1033
  tableStyleContext
1022
1034
  }) {
1023
1035
  const { t } = chunk6GFSF2ML_js.useTranslation();
1024
- const collab = chunk3AZ6ESJU_js.useCollaboration();
1036
+ const collab = chunkSEIVQGH5_js.useCollaboration();
1025
1037
  const slideRefs = React108.useRef(/* @__PURE__ */ new Map());
1026
1038
  const renameInputRef = React108.useRef(null);
1027
1039
  const slidePresenceMap = React108.useMemo(() => {
@@ -1116,7 +1128,7 @@ function SlidesPaneSidebar({
1116
1128
  [sectionGroups, showSectionHeaders, effectiveCollapsed]
1117
1129
  );
1118
1130
  const shouldVirtualize = slides.length >= VIRTUALIZATION_THRESHOLD;
1119
- const { startIndex, endIndex, totalHeight, offsetY, scrollContainerRef, scrollToIndex } = chunk3AZ6ESJU_js.useVirtualizedSlides({
1131
+ const { startIndex, endIndex, totalHeight, offsetY, scrollContainerRef, scrollToIndex } = chunkSEIVQGH5_js.useVirtualizedSlides({
1120
1132
  totalItems: shouldVirtualize ? flatItems.length : 0,
1121
1133
  itemHeight: estimatedItemHeight
1122
1134
  });
@@ -1361,7 +1373,8 @@ var PREVIEW_SCALE = PREVIEW_TILE_WIDTH / PREVIEW_CANVAS_WIDTH;
1361
1373
  var PREVIEW_TILE_HEIGHT = Math.round(PREVIEW_CANVAS_HEIGHT * PREVIEW_SCALE);
1362
1374
  function SlideTemplatePreview({
1363
1375
  templateId,
1364
- scheme
1376
+ scheme,
1377
+ onElementRenderError
1365
1378
  }) {
1366
1379
  const previewSlide = React108.useMemo(() => {
1367
1380
  const content = pptx.buildSlideTemplateContent(templateId, {
@@ -1400,12 +1413,13 @@ function SlideTemplatePreview({
1400
1413
  transformOrigin: "top left"
1401
1414
  },
1402
1415
  children: previewSlide.elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
1403
- chunk3AZ6ESJU_js.StaticElementRenderer,
1416
+ chunkSEIVQGH5_js.StaticElementRenderer,
1404
1417
  {
1405
1418
  element,
1406
1419
  activeSlide: previewSlide,
1407
1420
  allSlides: [previewSlide],
1408
- zIndex: index
1421
+ zIndex: index,
1422
+ onElementRenderError
1409
1423
  },
1410
1424
  element.id
1411
1425
  ))
@@ -1469,7 +1483,7 @@ function SlideTemplateGalleryDialog({
1469
1483
  scheme
1470
1484
  }) {
1471
1485
  const { t } = chunk6GFSF2ML_js.useTranslation();
1472
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onClose);
1486
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onClose);
1473
1487
  const [selected, setSelected] = React108.useState(null);
1474
1488
  const dialogRef = React108.useRef(null);
1475
1489
  useModalFocus(isOpen, dialogRef, onClose);
@@ -1589,6 +1603,60 @@ function SlideTemplateGalleryDialog({
1589
1603
  )
1590
1604
  ] });
1591
1605
  }
1606
+ var RIBBON_SURFACE = '[data-pptx-chrome="ribbon"], [data-pptx-chrome="ribbon-reveal"]';
1607
+ var RIBBON_MENU_SURFACE = '[data-pptx-chrome="ribbon-display-options"], [data-pptx-chrome="ribbon-display-menu"]';
1608
+ function useRibbonDisplayController(input) {
1609
+ const { ribbonDisplay, collapseRibbonAutomatically, rootRef } = input;
1610
+ const onChangeRef = React108.useRef(input.onRibbonDisplayChange);
1611
+ onChangeRef.current = input.onRibbonDisplayChange;
1612
+ const [controller] = React108.useState(
1613
+ () => pptx.createRibbonDisplayController({
1614
+ initial: ribbonDisplay,
1615
+ onChange: (mode) => onChangeRef.current?.(mode)
1616
+ })
1617
+ );
1618
+ React108.useEffect(() => {
1619
+ controller.setMode(ribbonDisplay);
1620
+ }, [controller, ribbonDisplay]);
1621
+ React108.useEffect(() => {
1622
+ controller.setAutoCollapse(collapseRibbonAutomatically);
1623
+ }, [controller, collapseRibbonAutomatically]);
1624
+ React108.useEffect(() => {
1625
+ const query = globalThis.matchMedia?.(pptx.RIBBON_AUTO_COLLAPSE_MEDIA);
1626
+ const sync = () => controller.setShortViewport(query?.matches ?? false);
1627
+ sync();
1628
+ query?.addEventListener("change", sync);
1629
+ return () => query?.removeEventListener("change", sync);
1630
+ }, [controller]);
1631
+ React108.useEffect(() => {
1632
+ const onPointerDown = (event) => {
1633
+ const target = event.target instanceof Element ? event.target : null;
1634
+ if (!target?.closest(RIBBON_SURFACE)) {
1635
+ controller.dismiss();
1636
+ } else if (!target.closest(RIBBON_MENU_SURFACE)) {
1637
+ controller.setMenuOpen(false);
1638
+ }
1639
+ };
1640
+ const onKeyDown = (event) => {
1641
+ const target = event.target;
1642
+ const root = rootRef.current;
1643
+ if (target === document.body || root && target instanceof Node && root.contains(target)) {
1644
+ controller.handleKeydown(event);
1645
+ }
1646
+ };
1647
+ document.addEventListener("pointerdown", onPointerDown);
1648
+ document.addEventListener("keydown", onKeyDown);
1649
+ return () => {
1650
+ document.removeEventListener("pointerdown", onPointerDown);
1651
+ document.removeEventListener("keydown", onKeyDown);
1652
+ };
1653
+ }, [controller, rootRef]);
1654
+ return controller;
1655
+ }
1656
+ function useRibbonDisplayFallback(controller) {
1657
+ const [own] = React108.useState(() => pptx.createRibbonDisplayController());
1658
+ return controller ?? own;
1659
+ }
1592
1660
  function useHostEvent(ref, type, handler) {
1593
1661
  React108.useEffect(() => {
1594
1662
  const host = ref.current;
@@ -2020,7 +2088,7 @@ function MobileSheet({
2020
2088
  }) {
2021
2089
  const sheetRef = React108.useRef(null);
2022
2090
  const { t } = chunk6GFSF2ML_js.useTranslation();
2023
- const { dragY, dragging, handlers } = chunk3AZ6ESJU_js.useSheetDismissDrag(onClose);
2091
+ const { dragY, dragging, handlers } = chunkSEIVQGH5_js.useSheetDismissDrag(onClose);
2024
2092
  useModalFocus(open, sheetRef, onClose);
2025
2093
  if (!open) {
2026
2094
  return null;
@@ -2289,7 +2357,7 @@ function WebHomeControls({
2289
2357
  function ShapeArrangeExtras(p) {
2290
2358
  const commands = useShapeFormatContext();
2291
2359
  const crop = commands?.crop;
2292
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(p.hiddenActions);
2360
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(p.hiddenActions);
2293
2361
  const { onGroupElements, onUngroupElement, onUpdateElementStyle } = p;
2294
2362
  const controls = React108.useMemo(
2295
2363
  () => pptx.arrangeShapeHomeControls({
@@ -2624,7 +2692,7 @@ function TransitionsSection(p) {
2624
2692
  case "soundPreview": {
2625
2693
  const url = pptx.ribbonTransitionStockSoundUrl(transition);
2626
2694
  if (url) {
2627
- chunk3AZ6ESJU_js.playAnimationSound(url);
2695
+ chunkSEIVQGH5_js.playAnimationSound(url);
2628
2696
  }
2629
2697
  break;
2630
2698
  }
@@ -2832,7 +2900,7 @@ function AccountPage() {
2832
2900
  refreshUsage();
2833
2901
  setTimeout(() => setCleared(false), 4e3);
2834
2902
  };
2835
- const version = "4.75.0" ;
2903
+ const version = "4.76.0" ;
2836
2904
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
2837
2905
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cardClass, children: [
2838
2906
  /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
@@ -3097,7 +3165,7 @@ function FileSection(p) {
3097
3165
  const page = offered(requestedPage) ? requestedPage : offered("home") ? "home" : nav.find((item) => item.id !== "save" && item.id !== "close")?.id ?? "home";
3098
3166
  const [query, setQuery] = React108.useState("");
3099
3167
  const [recent, setRecent] = React108.useState([]);
3100
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(p.hiddenActions);
3168
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(p.hiddenActions);
3101
3169
  const exportHidden = isHidden("export");
3102
3170
  const storage = useViewerStorage();
3103
3171
  const cloud = useViewerCloudFiles();
@@ -3466,7 +3534,7 @@ function LayoutArtwork({
3466
3534
  backgroundColor
3467
3535
  };
3468
3536
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: (preview?.elements ?? []).slice(0, MAX_PREVIEW_ELEMENTS).map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
3469
- chunk3AZ6ESJU_js.StaticElementRenderer,
3537
+ chunkSEIVQGH5_js.StaticElementRenderer,
3470
3538
  {
3471
3539
  element,
3472
3540
  activeSlide: slide,
@@ -3821,7 +3889,7 @@ function SlideShowOptions({
3821
3889
  }
3822
3890
  function SubtitleSettingsControl() {
3823
3891
  const { t } = chunk6GFSF2ML_js.useTranslation();
3824
- const supplied = React108.useContext(chunk3AZ6ESJU_js.ViewerOptionsStoreContext);
3892
+ const supplied = React108.useContext(chunkSEIVQGH5_js.ViewerOptionsStoreContext);
3825
3893
  const fallback = React108.useRef(null);
3826
3894
  if (!supplied) {
3827
3895
  fallback.current ??= pptx.createViewerOptionsStore({ persist: false });
@@ -3855,7 +3923,7 @@ function SubtitleSettingsControl() {
3855
3923
  }
3856
3924
  function SlideShowSection(p) {
3857
3925
  const { t } = chunk6GFSF2ML_js.useTranslation();
3858
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(p.hiddenActions);
3926
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(p.hiddenActions);
3859
3927
  const actions = {
3860
3928
  "slideShow.startSlideShow.fromBeginning": p.onPresentFromBeginning ?? (() => p.onSetMode("present")),
3861
3929
  "slideShow.startSlideShow.fromCurrent": p.onPresent,
@@ -4375,7 +4443,7 @@ function MobileMenuSheet(props) {
4375
4443
  const { t } = chunk6GFSF2ML_js.useTranslation();
4376
4444
  const { open, onClose } = props;
4377
4445
  const [active, setActive] = React108.useState("home");
4378
- const { isTabVisible } = chunk3AZ6ESJU_js.useToolbarVisibility(props.hiddenActions);
4446
+ const { isTabVisible } = chunkSEIVQGH5_js.useToolbarVisibility(props.hiddenActions);
4379
4447
  return /* @__PURE__ */ jsxRuntime.jsx(
4380
4448
  MobileSheet,
4381
4449
  {
@@ -4667,7 +4735,7 @@ function MobileToolbar(props) {
4667
4735
  const { t } = chunk6GFSF2ML_js.useTranslation();
4668
4736
  const { mode, canUndo, canRedo, onUndo, onRedo, onSetMode, onSaveAsPptx } = props;
4669
4737
  const [menuOpen, setMenuOpen] = React108.useState(false);
4670
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(props.hiddenActions);
4738
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(props.hiddenActions);
4671
4739
  const showEdit = mode === "edit" || mode === "master";
4672
4740
  const hidden = [];
4673
4741
  if (isHidden("undo")) {
@@ -4714,7 +4782,7 @@ function MobileToolbar(props) {
4714
4782
  }
4715
4783
  function ChartSelectionStrip() {
4716
4784
  const { t } = chunk6GFSF2ML_js.useTranslation();
4717
- const commands = chunk3AZ6ESJU_js.useChartFormatContext();
4785
+ const commands = chunkSEIVQGH5_js.useChartFormatContext();
4718
4786
  const chart = commands?.chart;
4719
4787
  const chartData = chart?.type === "chart" ? chart.chartData : void 0;
4720
4788
  const controls = React108.useMemo(
@@ -4745,7 +4813,7 @@ function PictureSizeStrip({
4745
4813
  hiddenActions
4746
4814
  }) {
4747
4815
  const crop = useShapeFormatContext()?.crop;
4748
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(hiddenActions);
4816
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(hiddenActions);
4749
4817
  const controls = React108.useMemo(
4750
4818
  () => pptx.pictureSizeHomeControls({
4751
4819
  editable: Boolean(crop),
@@ -4914,11 +4982,116 @@ function RibbonAddInSection({ tab }) {
4914
4982
  }, [tab]);
4915
4983
  return /* @__PURE__ */ jsxRuntime.jsx("pptx-ui-ribbon-add-in", { ref });
4916
4984
  }
4985
+ var RIBBON_PEEK_ROOT_CLASS = 'absolute inset-x-0 top-0 z-[35] border-b border-border bg-background shadow-[0_8px_20px_rgb(0_0_0/0.2)] before:absolute before:inset-0 before:-z-10 before:bg-card before:content-[""]';
4986
+ var RIBBON_OVERLAY_CLASS = 'absolute inset-x-0 top-full z-[35] border-b border-border bg-background shadow-[0_8px_20px_rgb(0_0_0/0.2)] before:absolute before:inset-0 before:-z-10 before:bg-card before:content-[""]';
4987
+ function RibbonRevealStrip({
4988
+ ribbon
4989
+ }) {
4990
+ const { t } = chunk6GFSF2ML_js.useTranslation();
4991
+ const label = t(pptx.RIBBON_DISPLAY_REVEAL_LABEL_KEY);
4992
+ return /* @__PURE__ */ jsxRuntime.jsx(
4993
+ "button",
4994
+ {
4995
+ type: "button",
4996
+ "data-pptx-chrome": "ribbon-reveal",
4997
+ "aria-label": label,
4998
+ title: label,
4999
+ onClick: () => ribbon.reveal(),
5000
+ className: "flex h-[14px] w-full shrink-0 items-center justify-center border-b border-border bg-card text-[14px] leading-none tracking-[2px] text-muted-foreground hover:bg-accent hover:text-foreground",
5001
+ children: "\xB7\xB7\xB7"
5002
+ }
5003
+ );
5004
+ }
5005
+ function RibbonDisplayButton({
5006
+ ribbon,
5007
+ state
5008
+ }) {
5009
+ const { t } = chunk6GFSF2ML_js.useTranslation();
5010
+ const label = t(pptx.RIBBON_DISPLAY_OPTIONS_LABEL_KEY);
5011
+ return /* @__PURE__ */ jsxRuntime.jsx(
5012
+ "button",
5013
+ {
5014
+ type: "button",
5015
+ "aria-haspopup": "menu",
5016
+ "aria-expanded": state.menuOpen,
5017
+ "aria-label": label,
5018
+ title: label,
5019
+ "data-pptx-chrome": "ribbon-display-options",
5020
+ onClick: () => ribbon.toggleMenu(),
5021
+ className: chunk6GFSF2ML_js.cn(
5022
+ "mx-1 inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground",
5023
+ state.menuOpen && "bg-accent text-foreground"
5024
+ ),
5025
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5026
+ "svg",
5027
+ {
5028
+ viewBox: "0 0 16 16",
5029
+ width: "12",
5030
+ height: "12",
5031
+ fill: "none",
5032
+ stroke: "currentColor",
5033
+ strokeWidth: 1.5,
5034
+ strokeLinecap: "round",
5035
+ strokeLinejoin: "round",
5036
+ "aria-hidden": "true",
5037
+ className: chunk6GFSF2ML_js.cn(state.effectiveMode === "tabs" && "rotate-180"),
5038
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4 6 4 4 4-4" })
5039
+ }
5040
+ )
5041
+ }
5042
+ );
5043
+ }
5044
+ function RibbonDisplayMenu({
5045
+ ribbon,
5046
+ state
5047
+ }) {
5048
+ const { t } = chunk6GFSF2ML_js.useTranslation();
5049
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-0", children: /* @__PURE__ */ jsxRuntime.jsx(
5050
+ "div",
5051
+ {
5052
+ role: "menu",
5053
+ "aria-label": t(pptx.RIBBON_DISPLAY_OPTIONS_LABEL_KEY),
5054
+ "data-pptx-chrome": "ribbon-display-menu",
5055
+ className: "absolute right-1.5 top-0.5 z-50 flex min-w-[200px] flex-col gap-0.5 rounded-md border border-border bg-popover p-1 text-[12px] shadow-lg",
5056
+ children: state.menu.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
5057
+ "button",
5058
+ {
5059
+ type: "button",
5060
+ role: "menuitemradio",
5061
+ "aria-checked": item.checked,
5062
+ "data-ribbon-display": item.mode,
5063
+ onClick: () => ribbon.choose(item.mode),
5064
+ className: "flex w-full items-center gap-2 whitespace-nowrap rounded-sm px-2 py-1.5 text-left text-foreground hover:bg-accent/30",
5065
+ children: [
5066
+ /* @__PURE__ */ jsxRuntime.jsx(
5067
+ "svg",
5068
+ {
5069
+ viewBox: "0 0 16 16",
5070
+ width: "12",
5071
+ height: "12",
5072
+ fill: "none",
5073
+ stroke: "currentColor",
5074
+ strokeWidth: 1.5,
5075
+ strokeLinecap: "round",
5076
+ strokeLinejoin: "round",
5077
+ "aria-hidden": "true",
5078
+ className: chunk6GFSF2ML_js.cn("shrink-0", !item.checked && "invisible"),
5079
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 8.5 3 3 7-7" })
5080
+ }
5081
+ ),
5082
+ t(item.labelKey)
5083
+ ]
5084
+ },
5085
+ item.mode
5086
+ ))
5087
+ }
5088
+ ) });
5089
+ }
4917
5090
  var TAB_BASE = "relative px-3.5 py-2 text-[12px] font-medium whitespace-nowrap transition-colors max-md:min-h-[36px] max-md:px-3";
4918
5091
  var TAB_UNDERLINE = "after:absolute after:-bottom-px after:left-0 after:right-0 after:h-[2.5px] after:bg-primary";
4919
5092
  function RibbonTabBar(p) {
4920
5093
  const { t } = chunk6GFSF2ML_js.useTranslation();
4921
- const viewerOptions = chunk3AZ6ESJU_js.useViewerOptionsContext();
5094
+ const viewerOptions = chunkSEIVQGH5_js.useViewerOptionsContext();
4922
5095
  return /* @__PURE__ */ jsxRuntime.jsxs(
4923
5096
  "div",
4924
5097
  {
@@ -4936,6 +5109,7 @@ function RibbonTabBar(p) {
4936
5109
  "aria-selected": selected,
4937
5110
  title: pptx.resolveScreenTip(viewerOptions, t(s.labelKey)),
4938
5111
  onClick: () => p.onSelectSection(s.id),
5112
+ onDoubleClick: s.id === "file" ? void 0 : () => p.onToggleCollapsed?.(),
4939
5113
  className: chunk6GFSF2ML_js.cn(
4940
5114
  TAB_BASE,
4941
5115
  selected ? s.id === "file" ? "text-white bg-primary/80 rounded-sm" : `text-foreground ${TAB_UNDERLINE}` : s.id === "file" ? "text-primary hover:bg-primary/15 rounded-sm" : "text-muted-foreground hover:text-foreground hover:bg-accent/30"
@@ -4956,6 +5130,7 @@ function RibbonTabBar(p) {
4956
5130
  ...{ [pptx.RIBBON_ADD_IN_TAB_ATTR]: tab.id },
4957
5131
  title: pptx.resolveScreenTip(viewerOptions, tab.label),
4958
5132
  onClick: () => p.onSelectAddIn?.(tab.id),
5133
+ onDoubleClick: () => p.onToggleCollapsed?.(),
4959
5134
  className: chunk6GFSF2ML_js.cn(
4960
5135
  TAB_BASE,
4961
5136
  selected ? `text-foreground ${TAB_UNDERLINE}` : "text-muted-foreground hover:text-foreground hover:bg-accent/30"
@@ -4977,6 +5152,7 @@ function RibbonTabBar(p) {
4977
5152
  ...{ [pptx.RIBBON_CONTEXTUAL_TAB_ATTR]: id },
4978
5153
  title: pptx.resolveScreenTip(viewerOptions, label),
4979
5154
  onClick: () => p.onSelectContextual(id),
5155
+ onDoubleClick: () => p.onToggleCollapsed?.(),
4980
5156
  className: chunk6GFSF2ML_js.cn(
4981
5157
  TAB_BASE,
4982
5158
  "text-primary",
@@ -4995,9 +5171,9 @@ function RibbonTabBar(p) {
4995
5171
  }
4996
5172
  function TabRowActions(p) {
4997
5173
  const { t } = chunk6GFSF2ML_js.useTranslation();
4998
- const collab = chunk3AZ6ESJU_js.useCollaboration();
5174
+ const collab = chunkSEIVQGH5_js.useCollaboration();
4999
5175
  const isCollaborating = Boolean(collab && collab.status === "connected");
5000
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(p.hiddenActions);
5176
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(p.hiddenActions);
5001
5177
  const customization = useViewerCustomizationContext();
5002
5178
  const ref = React108.useRef(null);
5003
5179
  const handlers = React108.useRef(p);
@@ -5052,7 +5228,7 @@ function TabRowActions(p) {
5052
5228
  }
5053
5229
  function TitleBarElement(p) {
5054
5230
  const { t } = chunk6GFSF2ML_js.useTranslation();
5055
- const options = chunk3AZ6ESJU_js.useViewerOptionsContext();
5231
+ const options = chunkSEIVQGH5_js.useViewerOptionsContext();
5056
5232
  const customization = useViewerCustomizationContext();
5057
5233
  const ref = React108.useRef(null);
5058
5234
  const stripVisible = options.quickAccess.visible && pptx.isPanelVisible(customization, "quickAccessToolbar");
@@ -5483,7 +5659,7 @@ function ToolbarPrimaryRow(p) {
5483
5659
  onToggleSidebar,
5484
5660
  onToggleInspector
5485
5661
  } = p;
5486
- const collab = chunk3AZ6ESJU_js.useCollaboration();
5662
+ const collab = chunkSEIVQGH5_js.useCollaboration();
5487
5663
  const customization = useViewerCustomizationContext();
5488
5664
  const showSlidesToggle = pptx.isPanelVisible(customization, "slidesPane");
5489
5665
  const showInspectorToggle = pptx.isPanelVisible(customization, "inspector");
@@ -5784,8 +5960,8 @@ function ToolbarLateTabs({
5784
5960
  function Toolbar(p) {
5785
5961
  const { mode, isNarrowViewport, isCompactToolbarOpen, toolbarSection, onSetToolbarSection } = p;
5786
5962
  const { t } = chunk6GFSF2ML_js.useTranslation();
5787
- const { isTabVisible } = chunk3AZ6ESJU_js.useToolbarVisibility(p.hiddenActions);
5788
- const viewerOptions = chunk3AZ6ESJU_js.useViewerOptionsContext();
5963
+ const { isTabVisible } = chunkSEIVQGH5_js.useToolbarVisibility(p.hiddenActions);
5964
+ const viewerOptions = chunkSEIVQGH5_js.useViewerOptionsContext();
5789
5965
  const customization = useViewerCustomizationContext();
5790
5966
  const belowInput = React108.useMemo(
5791
5967
  () => ({
@@ -5800,6 +5976,9 @@ function Toolbar(p) {
5800
5976
  const fallBackHome = React108.useCallback(() => onSetToolbarSection("home"), [onSetToolbarSection]);
5801
5977
  const contextual = useContextualRibbonTab(p.selectedElement, customization, fallBackHome);
5802
5978
  const addIns = useRibbonAddInTabs(fallBackHome);
5979
+ const ribbon = useRibbonDisplayFallback(p.ribbonDisplay);
5980
+ const ribbonState = chunkSEIVQGH5_js.useController(ribbon);
5981
+ const { layout, effectiveMode, peek } = ribbonState;
5803
5982
  const detachOverflow = React108.useRef(null);
5804
5983
  const inspector = React108.useRef({ open: p.isInspectorPaneOpen, toggle: p.onToggleInspector });
5805
5984
  inspector.current = { open: p.isInspectorPaneOpen, toggle: p.onToggleInspector };
@@ -5834,269 +6013,294 @@ function Toolbar(p) {
5834
6013
  const sDrw = section === "draw";
5835
6014
  const sDes = section === "design";
5836
6015
  const showRibbon = mode === "edit" || mode === "master";
5837
- return /* @__PURE__ */ jsxRuntime.jsxs(
5838
- "div",
5839
- {
5840
- role: "toolbar",
5841
- "data-pptx-scope": "",
5842
- "data-pptx-chrome": "ribbon",
5843
- "aria-label": t("pptx.toolbar.presentationToolbarAria"),
5844
- className: "relative z-20 border-b border-border bg-secondary/50 overflow-visible",
5845
- children: [
5846
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarPrimaryRow, { ...p }),
5847
- showRibbon && /* @__PURE__ */ jsxRuntime.jsxs(
5848
- RibbonTabBar,
5849
- {
5850
- isTabVisible,
5851
- activeSection: extraTab ? null : section,
5852
- contextualTabs: contextual.visible,
5853
- activeContextual: addIns.active ? null : contextual.active,
5854
- onSelectSection: (id) => {
5855
- contextual.select(null);
5856
- addIns.select(null);
5857
- onSetToolbarSection(id);
5858
- },
5859
- onSelectContextual: (id) => {
5860
- addIns.select(null);
5861
- contextual.select(id);
5862
- },
5863
- addInTabs: addIns.visible,
5864
- activeAddIn: addIns.active?.id ?? null,
5865
- onSelectAddIn: (id) => {
5866
- contextual.select(null);
5867
- addIns.select(id);
5868
- },
5869
- children: [
5870
- /* @__PURE__ */ jsxRuntime.jsx(
5871
- TabRowActions,
5872
- {
5873
- onEnterRehearsalMode: p.canEdit ? p.onEnterRehearsalMode : void 0,
5874
- onOpenShareDialog: p.onOpenShareDialog,
5875
- onToggleComments: p.onToggleComments,
5876
- isCommentsPanelOpen: p.isCommentsPanelOpen,
5877
- slideCommentCount: p.slideCommentCount,
5878
- hiddenActions: p.hiddenActions
5879
- }
5880
- ),
5881
- isNarrowViewport && /* @__PURE__ */ jsxRuntime.jsx(
5882
- "button",
5883
- {
5884
- type: "button",
5885
- onClick: p.onToggleCompactToolbar,
5886
- className: chunk6GFSF2ML_js.cn(
5887
- "px-2 py-1 rounded text-[11px] transition-colors mr-1",
5888
- isCompactToolbarOpen ? "bg-primary/80 text-white" : "text-muted-foreground hover:text-foreground"
5889
- ),
5890
- title: t(
5891
- isCompactToolbarOpen ? "pptx.ribbon.collapseRibbon" : "pptx.ribbon.expandRibbon"
5892
- ),
5893
- children: t(isCompactToolbarOpen ? "pptx.ribbon.collapseRibbon" : "pptx.ribbon.expandRibbon")
5894
- }
5895
- )
5896
- ]
5897
- }
5898
- ),
5899
- showRibbon && viewerOptions.quickAccess.position === "below" && pptx.isPanelVisible(customization, "quickAccessToolbar") && /* @__PURE__ */ jsxRuntime.jsx(
5900
- TitleBarElement,
5901
- {
5902
- placement: "belowRibbon",
5903
- input: belowInput,
5904
- onQuickCommand: p.onQuickCommand
5905
- }
6016
+ const commandsShown = sFil ? layout.tabs : layout.commands !== "hidden";
6017
+ const commandsOverlaid = commandsShown && layout.commands === "overlay" && !sFil;
6018
+ const rootShown = layout.tabs || commandsShown;
6019
+ const peekedFullScreen = effectiveMode === "fullScreen" && peek;
6020
+ const showStrip = layout.reveal || effectiveMode === "fullScreen";
6021
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
6022
+ showStrip && /* @__PURE__ */ jsxRuntime.jsx(RibbonRevealStrip, { ribbon }),
6023
+ /* @__PURE__ */ jsxRuntime.jsxs(
6024
+ "div",
6025
+ {
6026
+ role: "toolbar",
6027
+ "data-pptx-scope": "",
6028
+ "data-pptx-chrome": "ribbon",
6029
+ "data-ribbon-display": effectiveMode,
6030
+ "data-ribbon-peek": peek ? "" : void 0,
6031
+ "aria-label": t("pptx.toolbar.presentationToolbarAria"),
6032
+ className: chunk6GFSF2ML_js.cn(
6033
+ peekedFullScreen ? RIBBON_PEEK_ROOT_CLASS : "relative z-20 border-b border-border bg-secondary/50 overflow-visible",
6034
+ !rootShown && "hidden"
5906
6035
  ),
5907
- showRibbon && /* @__PURE__ */ jsxRuntime.jsxs(
5908
- "div",
5909
- {
5910
- ref: attachOverflow,
5911
- "data-pptx-chrome": "ribbon-content",
5912
- className: chunk6GFSF2ML_js.cn(
5913
- // Plain controls stay compact; labelled RibbonGroups opt into stretching.
5914
- // `RibbonGroupScope` wraps controls in a `display: contents` div, so its
5915
- // children are this row's flex items too and must not shrink (a shrunk
5916
- // "Text Box" pill wraps its caption onto two lines).
5917
- "flex min-h-[82px] items-center gap-0 overflow-x-auto px-1 py-0.5 max-md:min-h-0 max-md:px-1 max-md:py-0.5 flex-nowrap [&>*]:shrink-0 [&>.contents>*]:shrink-0",
5918
- isNarrowViewport && !isCompactToolbarOpen && "hidden"
6036
+ children: [
6037
+ layout.tabs && /* @__PURE__ */ jsxRuntime.jsx(ToolbarPrimaryRow, { ...p }),
6038
+ showRibbon && layout.tabs && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6039
+ /* @__PURE__ */ jsxRuntime.jsxs(
6040
+ RibbonTabBar,
6041
+ {
6042
+ onToggleCollapsed: () => ribbon.toggleCollapsed(),
6043
+ isTabVisible,
6044
+ activeSection: extraTab ? null : section,
6045
+ contextualTabs: contextual.visible,
6046
+ activeContextual: addIns.active ? null : contextual.active,
6047
+ onSelectSection: (id) => {
6048
+ contextual.select(null);
6049
+ addIns.select(null);
6050
+ onSetToolbarSection(id);
6051
+ ribbon.tabChosen(id);
6052
+ },
6053
+ onSelectContextual: (id) => {
6054
+ addIns.select(null);
6055
+ contextual.select(id);
6056
+ ribbon.tabChosen(id);
6057
+ },
6058
+ addInTabs: addIns.visible,
6059
+ activeAddIn: addIns.active?.id ?? null,
6060
+ onSelectAddIn: (id) => {
6061
+ contextual.select(null);
6062
+ addIns.select(id);
6063
+ ribbon.tabChosen(id);
6064
+ },
6065
+ children: [
6066
+ /* @__PURE__ */ jsxRuntime.jsx(
6067
+ TabRowActions,
6068
+ {
6069
+ onEnterRehearsalMode: p.canEdit ? p.onEnterRehearsalMode : void 0,
6070
+ onOpenShareDialog: p.onOpenShareDialog,
6071
+ onToggleComments: p.onToggleComments,
6072
+ isCommentsPanelOpen: p.isCommentsPanelOpen,
6073
+ slideCommentCount: p.slideCommentCount,
6074
+ hiddenActions: p.hiddenActions
6075
+ }
6076
+ ),
6077
+ /* @__PURE__ */ jsxRuntime.jsx(RibbonDisplayButton, { ribbon, state: ribbonState }),
6078
+ isNarrowViewport && /* @__PURE__ */ jsxRuntime.jsx(
6079
+ "button",
6080
+ {
6081
+ type: "button",
6082
+ onClick: p.onToggleCompactToolbar,
6083
+ className: chunk6GFSF2ML_js.cn(
6084
+ "px-2 py-1 rounded text-[11px] transition-colors mr-1",
6085
+ isCompactToolbarOpen ? "bg-primary/80 text-white" : "text-muted-foreground hover:text-foreground"
6086
+ ),
6087
+ title: t(
6088
+ isCompactToolbarOpen ? "pptx.ribbon.collapseRibbon" : "pptx.ribbon.expandRibbon"
6089
+ ),
6090
+ children: t(
6091
+ isCompactToolbarOpen ? "pptx.ribbon.collapseRibbon" : "pptx.ribbon.expandRibbon"
6092
+ )
6093
+ }
6094
+ )
6095
+ ]
6096
+ }
5919
6097
  ),
5920
- children: [
5921
- sFil && /* @__PURE__ */ jsxRuntime.jsx(
5922
- FileSection,
5923
- {
5924
- fileName: p.fileName,
5925
- onClose: () => p.onSetToolbarSection("home"),
5926
- onCreatePresentation: p.onCreatePresentation,
5927
- onOpenFile: p.onOpenFile,
5928
- onOpenRecentFile: p.onOpenRecentFile,
5929
- onExportPng: p.onExportPng,
5930
- onExportPdf: p.onExportPdf,
5931
- onExportVideo: p.onExportVideo,
5932
- onExportGif: p.onExportGif,
5933
- onExportJson: p.onExportJson,
5934
- onSave: p.onSave,
5935
- onSaveAsPptx: p.onSaveAsPptx,
5936
- onSaveAsPpsx: p.onSaveAsPpsx,
5937
- onSaveAsPptm: p.onSaveAsPptm,
5938
- onSaveAsPpt: p.onSaveAsPpt,
5939
- hasMacros: p.hasMacros,
5940
- onCopySlideAsImage: p.onCopySlideAsImage,
5941
- onPrint: p.onPrint,
5942
- onOpenSettings: p.onOpenSettings,
5943
- onOpenShareDialog: p.onOpenShareDialog,
5944
- onOpenDocumentProperties: p.onOpenDocumentProperties,
5945
- onOpenPasswordProtection: p.onOpenPasswordProtection,
5946
- onOpenFontEmbedding: p.onOpenFontEmbedding,
5947
- onOpenDigitalSignatures: p.onOpenDigitalSignatures,
5948
- onOpenVersionHistory: p.onToggleVersionHistory,
5949
- hiddenActions: p.hiddenActions,
5950
- recentPresentationsCount: p.recentPresentationsCount
5951
- }
5952
- ),
5953
- sHome && /* @__PURE__ */ jsxRuntime.jsx(
5954
- HomeSection,
5955
- {
5956
- canEdit: p.canEdit,
5957
- clipboardPayload: p.clipboardPayload,
5958
- formatPainterActive: p.formatPainterActive,
5959
- canActivateFormatPainter: p.canActivateFormatPainter,
5960
- onCopy: p.onCopy,
5961
- onCut: p.onCut,
5962
- onPaste: p.onPaste,
5963
- onToggleFormatPainter: p.onToggleFormatPainter,
5964
- layoutOptions: p.layoutOptions,
5965
- currentLayoutPath: p.currentLayoutPath,
5966
- loadLayoutPreviews: p.loadLayoutPreviews,
5967
- onInsertSlideFromLayout: p.onInsertSlideFromLayout,
5968
- onApplyLayout: p.onApplyLayout,
5969
- onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
5970
- templateScheme: p.templateScheme,
5971
- selectedElement: p.selectedElement,
5972
- onResetSlide: p.onResetSlide,
5973
- onAddSection: p.onAddSection
5974
- }
5975
- ),
5976
- sIns && /* @__PURE__ */ jsxRuntime.jsx(
5977
- InsertSection,
5978
- {
5979
- canEdit: p.canEdit,
5980
- onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
5981
- templateScheme: p.templateScheme,
5982
- newShapeType: p.newShapeType,
5983
- onSetNewShapeType: p.onSetNewShapeType,
5984
- activeFreeformTool: p.activeFreeformTool,
5985
- onArmFreeformTool: p.onArmFreeformTool,
5986
- onAddTextBox: p.onAddTextBox,
5987
- onAddShape: p.onAddShape,
5988
- onAddTable: p.onAddTable,
5989
- onAddChart: p.onAddChart,
5990
- onOpenChartDialog: p.onOpenChartDialog,
5991
- onAddSmartArt: p.onAddSmartArt,
5992
- onAddEquation: p.onAddEquation,
5993
- onAddActionButton: p.onAddActionButton,
5994
- onInsertField: p.onInsertField,
5995
- onOpenHeaderFooter: p.onOpenHeaderFooter,
5996
- onOpenImagePicker: p.onOpenImagePicker,
5997
- onOpenMediaPicker: p.onOpenMediaPicker,
5998
- hasSelection: Boolean(p.selectedElement),
5999
- onOpenHyperlinkDialog: p.onOpenHyperlinkDialog,
6000
- layoutOptions: p.layoutOptions,
6001
- currentLayoutPath: p.currentLayoutPath,
6002
- onInsertSlideFromLayout: p.onInsertSlideFromLayout,
6003
- onToggleComments: p.onToggleComments,
6004
- isCommentsPanelOpen: p.isCommentsPanelOpen
6005
- }
6006
- ),
6007
- sTxt && /* @__PURE__ */ jsxRuntime.jsx(
6008
- TextSection,
6009
- {
6010
- canEdit: p.canEdit,
6011
- selectedElement: p.selectedElement,
6012
- tableEditorState: p.tableEditorState,
6013
- onUpdateTextStyle: p.onUpdateTextStyle,
6014
- onToggleBullets: p.onToggleBullets,
6015
- onTransformTextCase: p.onTransformTextCase,
6016
- themeFonts: p.themeFonts,
6017
- embeddedFontFamilies: p.embeddedFontFamilies,
6018
- customFontFamilies: p.customFontFamilies
6019
- }
6020
- ),
6021
- sHome && /* @__PURE__ */ jsxRuntime.jsx(
6022
- DrawingGroup,
6023
- {
6024
- canEdit: p.canEdit,
6025
- selectedElement: p.selectedElement,
6026
- newShapeType: p.newShapeType,
6027
- onSetNewShapeType: p.onSetNewShapeType,
6028
- onAddShape: p.onAddShape,
6029
- onMoveLayer: p.onMoveLayer,
6030
- onMoveLayerToEdge: p.onMoveLayerToEdge,
6031
- onUpdateElementStyle: p.onUpdateElementStyle
6032
- }
6033
- ),
6034
- sHome && /* @__PURE__ */ jsxRuntime.jsx(
6035
- EditingSection,
6036
- {
6037
- onToggleFindReplace: p.onToggleFindReplace,
6038
- onSelectAll: p.onSelectAll
6039
- }
6040
- ),
6041
- sDrw && /* @__PURE__ */ jsxRuntime.jsx(
6042
- DrawSection,
6043
- {
6044
- canEdit: p.canEdit,
6045
- activeTool: p.activeTool,
6046
- drawingColor: p.drawingColor,
6047
- drawingWidth: p.drawingWidth,
6048
- onSetActiveTool: p.onSetActiveTool,
6049
- onSetDrawingColor: p.onSetDrawingColor,
6050
- onSetDrawingWidth: p.onSetDrawingWidth
6051
- }
6052
- ),
6053
- sArr && /* @__PURE__ */ jsxRuntime.jsx(
6054
- ArrangeSection,
6055
- {
6056
- canEdit: p.canEdit,
6057
- selectedElement: p.selectedElement,
6058
- selectedCount: p.selectedCount,
6059
- selectionGroupable: p.selectionGroupable,
6060
- onAlignElements: p.onAlignElements,
6061
- onDistributeElements: p.onDistributeElements,
6062
- canDistribute: p.canDistribute,
6063
- onFlip: p.onFlip,
6064
- onMoveLayer: p.onMoveLayer,
6065
- onMoveLayerToEdge: p.onMoveLayerToEdge,
6066
- onGroupElements: p.onGroupElements,
6067
- onUngroupElement: p.onUngroupElement,
6068
- onUpdateElementStyle: p.onUpdateElementStyle,
6069
- onDuplicate: p.onDuplicate,
6070
- onDelete: p.onDelete,
6071
- formatPainterActive: p.formatPainterActive,
6072
- onToggleFormatPainter: p.onToggleFormatPainter,
6073
- canActivateFormatPainter: p.canActivateFormatPainter,
6074
- hiddenActions: p.hiddenActions
6075
- }
6076
- ),
6077
- sDes && /* @__PURE__ */ jsxRuntime.jsx(
6078
- DesignSection,
6079
- {
6080
- canEdit: p.canEdit,
6081
- onToggleThemeGallery: p.onToggleThemeGallery,
6082
- isThemeGalleryOpen: p.isThemeGalleryOpen,
6083
- onToggleThemeEditor: p.onToggleThemeEditor,
6084
- isThemeEditorOpen: p.isThemeEditorOpen,
6085
- onOpenDocumentProperties: p.onOpenDocumentProperties,
6086
- onOpenSlideSize: p.onOpenSlideSize,
6087
- onToggleInspector: p.onToggleInspector,
6088
- isInspectorPaneOpen: p.isInspectorPaneOpen
6089
- }
6098
+ ribbonState.menuOpen && /* @__PURE__ */ jsxRuntime.jsx(RibbonDisplayMenu, { ribbon, state: ribbonState })
6099
+ ] }),
6100
+ showRibbon && viewerOptions.quickAccess.position === "below" && pptx.isPanelVisible(customization, "quickAccessToolbar") && /* @__PURE__ */ jsxRuntime.jsx(
6101
+ TitleBarElement,
6102
+ {
6103
+ placement: "belowRibbon",
6104
+ input: belowInput,
6105
+ onQuickCommand: p.onQuickCommand
6106
+ }
6107
+ ),
6108
+ showRibbon && /* @__PURE__ */ jsxRuntime.jsxs(
6109
+ "div",
6110
+ {
6111
+ ref: attachOverflow,
6112
+ "data-pptx-chrome": "ribbon-content",
6113
+ className: chunk6GFSF2ML_js.cn(
6114
+ // Plain controls stay compact; labelled RibbonGroups opt into stretching.
6115
+ // `RibbonGroupScope` wraps controls in a `display: contents` div, so its
6116
+ // children are this row's flex items too and must not shrink (a shrunk
6117
+ // "Text Box" pill wraps its caption onto two lines).
6118
+ "flex min-h-[82px] items-center gap-0 overflow-x-auto px-1 py-0.5 max-md:min-h-0 max-md:px-1 max-md:py-0.5 flex-nowrap [&>*]:shrink-0 [&>.contents>*]:shrink-0",
6119
+ isNarrowViewport && !isCompactToolbarOpen && "hidden",
6120
+ !commandsShown && "hidden",
6121
+ commandsOverlaid && RIBBON_OVERLAY_CLASS
6090
6122
  ),
6091
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarLateTabs, { p, section }),
6092
- contextual.active && !addIns.active && /* @__PURE__ */ jsxRuntime.jsx(ContextualTabSection, { tab: contextual.active, hiddenActions: p.hiddenActions }),
6093
- addIns.active && /* @__PURE__ */ jsxRuntime.jsx(RibbonAddInSection, { tab: addIns.active })
6094
- ]
6095
- }
6096
- )
6097
- ]
6098
- }
6099
- );
6123
+ children: [
6124
+ sFil && /* @__PURE__ */ jsxRuntime.jsx(
6125
+ FileSection,
6126
+ {
6127
+ fileName: p.fileName,
6128
+ onClose: () => p.onSetToolbarSection("home"),
6129
+ onCreatePresentation: p.onCreatePresentation,
6130
+ onOpenFile: p.onOpenFile,
6131
+ onOpenRecentFile: p.onOpenRecentFile,
6132
+ onExportPng: p.onExportPng,
6133
+ onExportPdf: p.onExportPdf,
6134
+ onExportVideo: p.onExportVideo,
6135
+ onExportGif: p.onExportGif,
6136
+ onExportJson: p.onExportJson,
6137
+ onSave: p.onSave,
6138
+ onSaveAsPptx: p.onSaveAsPptx,
6139
+ onSaveAsPpsx: p.onSaveAsPpsx,
6140
+ onSaveAsPptm: p.onSaveAsPptm,
6141
+ onSaveAsPpt: p.onSaveAsPpt,
6142
+ hasMacros: p.hasMacros,
6143
+ onCopySlideAsImage: p.onCopySlideAsImage,
6144
+ onPrint: p.onPrint,
6145
+ onOpenSettings: p.onOpenSettings,
6146
+ onOpenShareDialog: p.onOpenShareDialog,
6147
+ onOpenDocumentProperties: p.onOpenDocumentProperties,
6148
+ onOpenPasswordProtection: p.onOpenPasswordProtection,
6149
+ onOpenFontEmbedding: p.onOpenFontEmbedding,
6150
+ onOpenDigitalSignatures: p.onOpenDigitalSignatures,
6151
+ onOpenVersionHistory: p.onToggleVersionHistory,
6152
+ hiddenActions: p.hiddenActions,
6153
+ recentPresentationsCount: p.recentPresentationsCount
6154
+ }
6155
+ ),
6156
+ sHome && /* @__PURE__ */ jsxRuntime.jsx(
6157
+ HomeSection,
6158
+ {
6159
+ canEdit: p.canEdit,
6160
+ clipboardPayload: p.clipboardPayload,
6161
+ formatPainterActive: p.formatPainterActive,
6162
+ canActivateFormatPainter: p.canActivateFormatPainter,
6163
+ onCopy: p.onCopy,
6164
+ onCut: p.onCut,
6165
+ onPaste: p.onPaste,
6166
+ onToggleFormatPainter: p.onToggleFormatPainter,
6167
+ layoutOptions: p.layoutOptions,
6168
+ currentLayoutPath: p.currentLayoutPath,
6169
+ loadLayoutPreviews: p.loadLayoutPreviews,
6170
+ onInsertSlideFromLayout: p.onInsertSlideFromLayout,
6171
+ onApplyLayout: p.onApplyLayout,
6172
+ onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
6173
+ templateScheme: p.templateScheme,
6174
+ selectedElement: p.selectedElement,
6175
+ onResetSlide: p.onResetSlide,
6176
+ onAddSection: p.onAddSection
6177
+ }
6178
+ ),
6179
+ sIns && /* @__PURE__ */ jsxRuntime.jsx(
6180
+ InsertSection,
6181
+ {
6182
+ canEdit: p.canEdit,
6183
+ onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
6184
+ templateScheme: p.templateScheme,
6185
+ newShapeType: p.newShapeType,
6186
+ onSetNewShapeType: p.onSetNewShapeType,
6187
+ activeFreeformTool: p.activeFreeformTool,
6188
+ onArmFreeformTool: p.onArmFreeformTool,
6189
+ onAddTextBox: p.onAddTextBox,
6190
+ onAddShape: p.onAddShape,
6191
+ onAddTable: p.onAddTable,
6192
+ onAddChart: p.onAddChart,
6193
+ onOpenChartDialog: p.onOpenChartDialog,
6194
+ onAddSmartArt: p.onAddSmartArt,
6195
+ onAddEquation: p.onAddEquation,
6196
+ onAddActionButton: p.onAddActionButton,
6197
+ onInsertField: p.onInsertField,
6198
+ onOpenHeaderFooter: p.onOpenHeaderFooter,
6199
+ onOpenImagePicker: p.onOpenImagePicker,
6200
+ onOpenMediaPicker: p.onOpenMediaPicker,
6201
+ hasSelection: Boolean(p.selectedElement),
6202
+ onOpenHyperlinkDialog: p.onOpenHyperlinkDialog,
6203
+ layoutOptions: p.layoutOptions,
6204
+ currentLayoutPath: p.currentLayoutPath,
6205
+ onInsertSlideFromLayout: p.onInsertSlideFromLayout,
6206
+ onToggleComments: p.onToggleComments,
6207
+ isCommentsPanelOpen: p.isCommentsPanelOpen
6208
+ }
6209
+ ),
6210
+ sTxt && /* @__PURE__ */ jsxRuntime.jsx(
6211
+ TextSection,
6212
+ {
6213
+ canEdit: p.canEdit,
6214
+ selectedElement: p.selectedElement,
6215
+ tableEditorState: p.tableEditorState,
6216
+ onUpdateTextStyle: p.onUpdateTextStyle,
6217
+ onToggleBullets: p.onToggleBullets,
6218
+ onTransformTextCase: p.onTransformTextCase,
6219
+ themeFonts: p.themeFonts,
6220
+ embeddedFontFamilies: p.embeddedFontFamilies,
6221
+ customFontFamilies: p.customFontFamilies
6222
+ }
6223
+ ),
6224
+ sHome && /* @__PURE__ */ jsxRuntime.jsx(
6225
+ DrawingGroup,
6226
+ {
6227
+ canEdit: p.canEdit,
6228
+ selectedElement: p.selectedElement,
6229
+ newShapeType: p.newShapeType,
6230
+ onSetNewShapeType: p.onSetNewShapeType,
6231
+ onAddShape: p.onAddShape,
6232
+ onMoveLayer: p.onMoveLayer,
6233
+ onMoveLayerToEdge: p.onMoveLayerToEdge,
6234
+ onUpdateElementStyle: p.onUpdateElementStyle
6235
+ }
6236
+ ),
6237
+ sHome && /* @__PURE__ */ jsxRuntime.jsx(
6238
+ EditingSection,
6239
+ {
6240
+ onToggleFindReplace: p.onToggleFindReplace,
6241
+ onSelectAll: p.onSelectAll
6242
+ }
6243
+ ),
6244
+ sDrw && /* @__PURE__ */ jsxRuntime.jsx(
6245
+ DrawSection,
6246
+ {
6247
+ canEdit: p.canEdit,
6248
+ activeTool: p.activeTool,
6249
+ drawingColor: p.drawingColor,
6250
+ drawingWidth: p.drawingWidth,
6251
+ onSetActiveTool: p.onSetActiveTool,
6252
+ onSetDrawingColor: p.onSetDrawingColor,
6253
+ onSetDrawingWidth: p.onSetDrawingWidth
6254
+ }
6255
+ ),
6256
+ sArr && /* @__PURE__ */ jsxRuntime.jsx(
6257
+ ArrangeSection,
6258
+ {
6259
+ canEdit: p.canEdit,
6260
+ selectedElement: p.selectedElement,
6261
+ selectedCount: p.selectedCount,
6262
+ selectionGroupable: p.selectionGroupable,
6263
+ onAlignElements: p.onAlignElements,
6264
+ onDistributeElements: p.onDistributeElements,
6265
+ canDistribute: p.canDistribute,
6266
+ onFlip: p.onFlip,
6267
+ onMoveLayer: p.onMoveLayer,
6268
+ onMoveLayerToEdge: p.onMoveLayerToEdge,
6269
+ onGroupElements: p.onGroupElements,
6270
+ onUngroupElement: p.onUngroupElement,
6271
+ onUpdateElementStyle: p.onUpdateElementStyle,
6272
+ onDuplicate: p.onDuplicate,
6273
+ onDelete: p.onDelete,
6274
+ formatPainterActive: p.formatPainterActive,
6275
+ onToggleFormatPainter: p.onToggleFormatPainter,
6276
+ canActivateFormatPainter: p.canActivateFormatPainter,
6277
+ hiddenActions: p.hiddenActions
6278
+ }
6279
+ ),
6280
+ sDes && /* @__PURE__ */ jsxRuntime.jsx(
6281
+ DesignSection,
6282
+ {
6283
+ canEdit: p.canEdit,
6284
+ onToggleThemeGallery: p.onToggleThemeGallery,
6285
+ isThemeGalleryOpen: p.isThemeGalleryOpen,
6286
+ onToggleThemeEditor: p.onToggleThemeEditor,
6287
+ isThemeEditorOpen: p.isThemeEditorOpen,
6288
+ onOpenDocumentProperties: p.onOpenDocumentProperties,
6289
+ onOpenSlideSize: p.onOpenSlideSize,
6290
+ onToggleInspector: p.onToggleInspector,
6291
+ isInspectorPaneOpen: p.isInspectorPaneOpen
6292
+ }
6293
+ ),
6294
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarLateTabs, { p, section }),
6295
+ contextual.active && !addIns.active && /* @__PURE__ */ jsxRuntime.jsx(ContextualTabSection, { tab: contextual.active, hiddenActions: p.hiddenActions }),
6296
+ addIns.active && /* @__PURE__ */ jsxRuntime.jsx(RibbonAddInSection, { tab: addIns.active })
6297
+ ]
6298
+ }
6299
+ )
6300
+ ]
6301
+ }
6302
+ )
6303
+ ] });
6100
6304
  }
6101
6305
  function CanvasGuides({ guides, onDeleteGuide, onStartGuideDrag }) {
6102
6306
  const { t } = chunk6GFSF2ML_js.useTranslation();
@@ -6762,7 +6966,7 @@ function DrawingOverlaySvg({
6762
6966
  onPointerDown,
6763
6967
  onPointerMove,
6764
6968
  onPointerUp,
6765
- children: isStrokeActive && liveStrokeView ? chunk3AZ6ESJU_js.renderStrokeView(liveStrokeView, true, void 0, "ink-live-preview") : isStrokeActive && liveStrokeD && /* @__PURE__ */ jsxRuntime.jsx(
6969
+ children: isStrokeActive && liveStrokeView ? chunkSEIVQGH5_js.renderStrokeView(liveStrokeView, true, void 0, "ink-live-preview") : isStrokeActive && liveStrokeD && /* @__PURE__ */ jsxRuntime.jsx(
6766
6970
  "path",
6767
6971
  {
6768
6972
  d: liveStrokeD,
@@ -7312,7 +7516,7 @@ function PictureCropOverlay({
7312
7516
  };
7313
7517
  };
7314
7518
  const { ghost, frame, handles } = overlay;
7315
- const src = chunk3AZ6ESJU_js.imgSrc(element);
7519
+ const src = chunkSEIVQGH5_js.imgSrc(element);
7316
7520
  return /* @__PURE__ */ jsxRuntime.jsxs(
7317
7521
  "div",
7318
7522
  {
@@ -7488,7 +7692,7 @@ function HorizontalRulerView({ ticks, widthPx, highlight }) {
7488
7692
  }
7489
7693
  );
7490
7694
  }
7491
- var HorizontalRuler = /* @__PURE__ */ chunk3AZ6ESJU_js.withDisplayName(
7695
+ var HorizontalRuler = /* @__PURE__ */ chunkSEIVQGH5_js.withDisplayName(
7492
7696
  /* @__PURE__ */ React108__default.default.memo(HorizontalRulerView),
7493
7697
  "HorizontalRuler"
7494
7698
  );
@@ -7562,7 +7766,7 @@ function VerticalRulerView({ ticks, heightPx, highlight }) {
7562
7766
  }
7563
7767
  );
7564
7768
  }
7565
- var VerticalRuler = /* @__PURE__ */ chunk3AZ6ESJU_js.withDisplayName(
7769
+ var VerticalRuler = /* @__PURE__ */ chunkSEIVQGH5_js.withDisplayName(
7566
7770
  /* @__PURE__ */ React108__default.default.memo(VerticalRulerView),
7567
7771
  "VerticalRuler"
7568
7772
  );
@@ -7756,7 +7960,7 @@ function SelectionHandleOverlay({
7756
7960
  onDoubleClick: (e) => onDoubleClick(element.id, e),
7757
7961
  onContextMenu: (e) => onContextMenu(element.id, e),
7758
7962
  children: /* @__PURE__ */ jsxRuntime.jsx(
7759
- chunk3AZ6ESJU_js.ResizeHandles,
7963
+ chunkSEIVQGH5_js.ResizeHandles,
7760
7964
  {
7761
7965
  elementId: element.id,
7762
7966
  adjustmentHandles,
@@ -8467,7 +8671,11 @@ function SlideCanvas(props) {
8467
8671
  props.registerInlineEditReader
8468
8672
  ]
8469
8673
  );
8470
- return /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.InlineCollaborationContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(SlideCanvasContent, { ...props }) });
8674
+ const errorReporting = React108.useMemo(
8675
+ () => ({ onElementRenderError: props.onElementRenderError }),
8676
+ [props.onElementRenderError]
8677
+ );
8678
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ElementRenderErrorReportingContext.Provider, { value: errorReporting, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.InlineCollaborationContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(SlideCanvasContent, { ...props }) }) });
8471
8679
  }
8472
8680
  function SlideCanvasContent({
8473
8681
  imagePaste,
@@ -8740,7 +8948,7 @@ function SlideCanvasContent({
8740
8948
  onPointerMove: handleStagePointerMove,
8741
8949
  onPointerUp: handleStagePointerUp,
8742
8950
  children: [
8743
- /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.SlideBackgroundImageLayer, { slide: activeSlide }),
8951
+ /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.SlideBackgroundImageLayer, { slide: activeSlide }),
8744
8952
  presentationKeyframesCss && /* @__PURE__ */ jsxRuntime.jsx("style", { children: presentationKeyframesCss }),
8745
8953
  /* @__PURE__ */ jsxRuntime.jsx(GridOverlay, { canvasSize, gridSpacingPx, visible: showGrid }),
8746
8954
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8752,7 +8960,7 @@ function SlideCanvasContent({
8752
8960
  }
8753
8961
  ),
8754
8962
  templateElements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
8755
- chunk3AZ6ESJU_js.ElementRenderer,
8963
+ chunkSEIVQGH5_js.ElementRenderer,
8756
8964
  {
8757
8965
  element,
8758
8966
  activeSlide,
@@ -8797,7 +9005,7 @@ function SlideCanvasContent({
8797
9005
  `tpl-${element.id}`
8798
9006
  )),
8799
9007
  activeSlide?.elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
8800
- chunk3AZ6ESJU_js.ElementRenderer,
9008
+ chunkSEIVQGH5_js.ElementRenderer,
8801
9009
  {
8802
9010
  element,
8803
9011
  activeSlide,
@@ -8864,7 +9072,7 @@ function SlideCanvasContent({
8864
9072
  editingMember && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8865
9073
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: `[data-element-id="${cssAttr(editingMember.parentId)}"] [data-element-id="${cssAttr(editingMember.member.id)}"]{visibility:hidden}` }),
8866
9074
  /* @__PURE__ */ jsxRuntime.jsx(
8867
- chunk3AZ6ESJU_js.ElementRenderer,
9075
+ chunkSEIVQGH5_js.ElementRenderer,
8868
9076
  {
8869
9077
  element: editingMember.member,
8870
9078
  activeSlide,
@@ -9381,7 +9589,7 @@ function ContextMenu(props) {
9381
9589
  const { t } = chunk6GFSF2ML_js.useTranslation();
9382
9590
  const customization = useViewerCustomizationContext();
9383
9591
  const shapeFormat = useShapeFormatContext();
9384
- const chartFormat = chunk3AZ6ESJU_js.useChartFormatContext();
9592
+ const chartFormat = chunkSEIVQGH5_js.useChartFormatContext();
9385
9593
  const open = Boolean(contextMenuState) && mode === "edit";
9386
9594
  const handlers = {
9387
9595
  ...contextMenuHandlers(props, shapeFormat),
@@ -11302,7 +11510,8 @@ function ReadingViewStage({
11302
11510
  slide,
11303
11511
  templateElements,
11304
11512
  canvasSize,
11305
- scale
11513
+ scale,
11514
+ onElementRenderError
11306
11515
  }) {
11307
11516
  if (scale <= 0) {
11308
11517
  return null;
@@ -11341,12 +11550,13 @@ function ReadingViewStage({
11341
11550
  className: "absolute left-0 top-0 origin-top-left",
11342
11551
  style: { width, height, transform: `scale(${scale})`, ...pptx.deviceStrokeStageStyle(scale) },
11343
11552
  children: elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
11344
- chunk3AZ6ESJU_js.StaticElementRenderer,
11553
+ chunkSEIVQGH5_js.StaticElementRenderer,
11345
11554
  {
11346
11555
  element,
11347
11556
  activeSlide: slide,
11348
11557
  allSlides: [slide],
11349
- zIndex: index
11558
+ zIndex: index,
11559
+ onElementRenderError
11350
11560
  },
11351
11561
  element.id
11352
11562
  ))
@@ -11996,7 +12206,7 @@ function SlideNotesPanel({
11996
12206
  });
11997
12207
  const hasNotes = draft.trim().length > 0;
11998
12208
  const slideLabel = activeSlide ? t("pptx.notes.slideN", { n: activeSlide.slideNumber }) : t("pptx.notes.noSlide");
11999
- const { dragY, handlers: dragHandlers } = chunk3AZ6ESJU_js.useSheetDismissDrag(onToggle);
12209
+ const { dragY, handlers: dragHandlers } = chunkSEIVQGH5_js.useSheetDismissDrag(onToggle);
12000
12210
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12001
12211
  isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
12002
12212
  "button",
@@ -12588,28 +12798,11 @@ function ComparePanel({
12588
12798
  )) })
12589
12799
  ] });
12590
12800
  }
12591
- function getPasswordStrength(password) {
12592
- if (!password) {
12593
- return 0;
12594
- }
12595
- let score = 0;
12596
- if (password.length >= 8) {
12597
- score++;
12598
- }
12599
- if (password.length >= 12) {
12600
- score++;
12601
- }
12602
- if (/[A-Z]/u.test(password) && /[a-z]/u.test(password)) {
12603
- score++;
12604
- }
12605
- if (/\d/u.test(password)) {
12606
- score++;
12607
- }
12608
- if (/[^A-Za-z0-9]/u.test(password)) {
12609
- score++;
12610
- }
12611
- return Math.min(score, 4);
12612
- }
12801
+ var PASSWORD_ERROR_KEYS = {
12802
+ required: "pptx.security.errorPasswordRequired",
12803
+ mismatch: "pptx.security.errorPasswordMismatch",
12804
+ tooShort: "pptx.security.errorPasswordTooShort"
12805
+ };
12613
12806
  var STRENGTH_COLORS = [
12614
12807
  "bg-red-500",
12615
12808
  "bg-orange-500",
@@ -12631,7 +12824,7 @@ function PasswordProtectionDialog({
12631
12824
  const [error, setError] = React108.useState("");
12632
12825
  const dialogRef = React108.useRef(null);
12633
12826
  const passwordRef = React108.useRef(null);
12634
- const strength = React108.useMemo(() => getPasswordStrength(password), [password]);
12827
+ const strength = React108.useMemo(() => pptx.getPasswordStrength(password), [password]);
12635
12828
  const strengthLabel = React108.useMemo(() => {
12636
12829
  const labels = [
12637
12830
  t("pptx.security.strengthVeryWeak"),
@@ -12644,16 +12837,9 @@ function PasswordProtectionDialog({
12644
12837
  }, [strength, password, t]);
12645
12838
  const handleSubmit = React108.useCallback(() => {
12646
12839
  setError("");
12647
- if (!password) {
12648
- setError(t("pptx.security.errorPasswordRequired"));
12649
- return;
12650
- }
12651
- if (password !== confirmPassword) {
12652
- setError(t("pptx.security.errorPasswordMismatch"));
12653
- return;
12654
- }
12655
- if (password.length < 4) {
12656
- setError(t("pptx.security.errorPasswordTooShort"));
12840
+ const invalid = pptx.validatePasswordPair(password, confirmPassword);
12841
+ if (invalid) {
12842
+ setError(t(PASSWORD_ERROR_KEYS[invalid]));
12657
12843
  return;
12658
12844
  }
12659
12845
  onSetPassword(password);
@@ -13103,37 +13289,25 @@ function DocumentPropertiesDialog({
13103
13289
  const handleCoreFieldChange = React108.useCallback((key, value) => {
13104
13290
  setDraftCore((prev) => ({ ...prev, [key]: value }));
13105
13291
  }, []);
13106
- const isDirty = React108.useMemo(() => {
13107
- const coreChanged = SUMMARY_FIELDS.some(
13108
- ({ key }) => (draftCore[key] ?? "") !== (coreProperties[key] ?? "")
13109
- );
13110
- if (coreChanged) {
13111
- return true;
13112
- }
13113
- const appCompanyChanged = (draftApp.company ?? "") !== (appProperties?.company ?? "");
13114
- const appManagerChanged = (draftApp.manager ?? "") !== (appProperties?.manager ?? "");
13115
- if (appCompanyChanged || appManagerChanged) {
13116
- return true;
13117
- }
13118
- if (draftCustom.length !== customProperties.length) {
13119
- return true;
13120
- }
13121
- return draftCustom.some(
13122
- (p, i) => p.name !== customProperties[i]?.name || p.value !== customProperties[i]?.value || p.type !== customProperties[i]?.type
13123
- );
13124
- }, [draftCore, draftCustom, draftApp, coreProperties, customProperties, appProperties]);
13292
+ const isDirty = React108.useMemo(
13293
+ () => pptx.documentPropertiesChanged(
13294
+ { core: coreProperties, custom: customProperties, app: appProperties },
13295
+ { core: draftCore, custom: draftCustom, app: draftApp }
13296
+ ),
13297
+ [draftCore, draftCustom, draftApp, coreProperties, customProperties, appProperties]
13298
+ );
13125
13299
  const handleUpdateDraftApp = React108.useCallback((updates) => {
13126
13300
  setDraftApp((prev) => ({ ...prev, ...updates }));
13127
13301
  }, []);
13128
13302
  const handleSave = React108.useCallback(() => {
13129
- const appChanged = (draftApp.company ?? "") !== (appProperties?.company ?? "") || (draftApp.manager ?? "") !== (appProperties?.manager ?? "");
13303
+ const appChanged = pptx.appPropertiesChanged(appProperties, draftApp);
13130
13304
  onSave(draftCore, draftCustom, appChanged ? draftApp : void 0);
13131
13305
  onClose();
13132
13306
  }, [draftCore, draftCustom, draftApp, appProperties, onSave, onClose]);
13133
13307
  const handleClose = React108.useCallback(() => {
13134
13308
  onClose();
13135
13309
  }, [onClose]);
13136
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(handleClose);
13310
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(handleClose);
13137
13311
  if (!isOpen) {
13138
13312
  return null;
13139
13313
  }
@@ -13730,7 +13904,7 @@ function PresentationSubtitleBar({
13730
13904
  }) {
13731
13905
  const { t } = chunk6GFSF2ML_js.useTranslation();
13732
13906
  const language = pptx.subtitleRecognitionLanguage(
13733
- pptx.subtitleSettingsFromOptions(chunk3AZ6ESJU_js.useViewerOptionsContext()),
13907
+ pptx.subtitleSettingsFromOptions(chunkSEIVQGH5_js.useViewerOptionsContext()),
13734
13908
  typeof navigator === "undefined" ? "en-US" : navigator.language
13735
13909
  );
13736
13910
  const [captionText, setCaptionText] = React108.useState("");
@@ -13860,7 +14034,8 @@ function ScaledSlidePreviewImpl({
13860
14034
  slide,
13861
14035
  templateElements,
13862
14036
  canvasSize,
13863
- className
14037
+ className,
14038
+ onElementRenderError
13864
14039
  }) {
13865
14040
  const containerRef = React108.useRef(null);
13866
14041
  const [containerWidth, setContainerWidth] = React108.useState(0);
@@ -13924,12 +14099,13 @@ function ScaledSlidePreviewImpl({
13924
14099
  ...pptx.deviceStrokeStageStyle(scale)
13925
14100
  },
13926
14101
  children: previewElements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
13927
- chunk3AZ6ESJU_js.StaticElementRenderer,
14102
+ chunkSEIVQGH5_js.StaticElementRenderer,
13928
14103
  {
13929
14104
  element,
13930
14105
  activeSlide: slide,
13931
14106
  allSlides: [slide],
13932
- zIndex: index
14107
+ zIndex: index,
14108
+ onElementRenderError
13933
14109
  },
13934
14110
  element.id
13935
14111
  ))
@@ -13940,6 +14116,9 @@ function ScaledSlidePreviewImpl({
13940
14116
  );
13941
14117
  }
13942
14118
  function scaledSlidePreviewPropsEqual(prev, next) {
14119
+ if (prev.onElementRenderError !== next.onElementRenderError) {
14120
+ return false;
14121
+ }
13943
14122
  if (prev.slide !== next.slide) {
13944
14123
  return false;
13945
14124
  }
@@ -15237,7 +15416,7 @@ function EffectSoundRow({
15237
15416
  }
15238
15417
  const asset = pptx.getEffectSoundAsset(soundState.catalogueId);
15239
15418
  if (asset) {
15240
- chunk3AZ6ESJU_js.playAnimationSound(asset.dataUrl);
15419
+ chunkSEIVQGH5_js.playAnimationSound(asset.dataUrl);
15241
15420
  }
15242
15421
  };
15243
15422
  return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex flex-col gap-1", children: [
@@ -15749,7 +15928,7 @@ function AnimationPanel({
15749
15928
  onUpdateSlide
15750
15929
  }) {
15751
15930
  const { t } = chunk6GFSF2ML_js.useTranslation();
15752
- const { viewportWidth } = chunk3AZ6ESJU_js.useIsMobile();
15931
+ const { viewportWidth } = chunkSEIVQGH5_js.useIsMobile();
15753
15932
  const directionBtnPx = Math.max(28, pptx.getDensePanelTouchTargetPx(viewportWidth));
15754
15933
  const fieldStyle = { minHeight: pptx.getDensePanelTouchTargetPx(viewportWidth) };
15755
15934
  const handlers = useAnimationHandlers({
@@ -17874,8 +18053,8 @@ function ChartUserShapeOptions({
17874
18053
  }
17875
18054
  function ChartDataPanel({ selectedElement, canEdit, onUpdateElement }) {
17876
18055
  const chartData = selectedElement.chartData;
17877
- const followDataPoint = chunk3AZ6ESJU_js.useViewerOptionsContext().advanced.chartPropertiesFollowDataPoint;
17878
- const { selection: partSelection } = chunk3AZ6ESJU_js.useChartPartSelection();
18056
+ const followDataPoint = chunkSEIVQGH5_js.useViewerOptionsContext().advanced.chartPropertiesFollowDataPoint;
18057
+ const { selection: partSelection } = chunkSEIVQGH5_js.useChartPartSelection();
17879
18058
  const canvasPart = partSelection?.elementId === selectedElement.id ? partSelection.part : null;
17880
18059
  const title = chartData?.title;
17881
18060
  const chartType = chartData?.chartType;
@@ -19071,7 +19250,7 @@ function DuotonePanel({
19071
19250
  ] }),
19072
19251
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
19073
19252
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground text-[10px]", children: t("pptx.image.duotonePresets") }),
19074
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-1", children: chunk3AZ6ESJU_js.DUOTONE_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsxs(
19253
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-1", children: chunkSEIVQGH5_js.DUOTONE_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsxs(
19075
19254
  "button",
19076
19255
  {
19077
19256
  type: "button",
@@ -22329,7 +22508,7 @@ function SmartArtPropertiesPanel({
22329
22508
  const reflowed = box ? pptx.rebuildDrawingShapesIfCleared(
22330
22509
  newData,
22331
22510
  newData.layout,
22332
- chunk3AZ6ESJU_js.resolveSmartArtDataPalette(newData),
22511
+ chunkSEIVQGH5_js.resolveSmartArtDataPalette(newData),
22333
22512
  newData.style ?? "flat",
22334
22513
  "inspector",
22335
22514
  box
@@ -22402,7 +22581,7 @@ function TableDataGrid({
22402
22581
  }) {
22403
22582
  const { t } = chunk6GFSF2ML_js.useTranslation();
22404
22583
  const grid = pptx.buildTableDataGrid(tableElement);
22405
- const { viewportWidth } = chunk3AZ6ESJU_js.useIsMobile();
22584
+ const { viewportWidth } = chunkSEIVQGH5_js.useIsMobile();
22406
22585
  const gridPlan = pptx.getDenseGridLayoutPlan(viewportWidth);
22407
22586
  const touchTargetPx = pptx.getDensePanelTouchTargetPx(viewportWidth);
22408
22587
  const stickyGutterClass = gridPlan.stickyFirstColumn ? "sticky left-0 z-10" : "";
@@ -24251,7 +24430,7 @@ function InspectorPaneHeader({
24251
24430
  onClose
24252
24431
  }) {
24253
24432
  const { t } = chunk6GFSF2ML_js.useTranslation();
24254
- const { viewportWidth } = chunk3AZ6ESJU_js.useIsMobile();
24433
+ const { viewportWidth } = chunkSEIVQGH5_js.useIsMobile();
24255
24434
  const touchTargetPx = pptx.getDensePanelTouchTargetPx(viewportWidth);
24256
24435
  const touchBtnStyle = { minWidth: touchTargetPx, minHeight: touchTargetPx };
24257
24436
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -24952,7 +25131,7 @@ function TransitionPreview({
24952
25131
  const { t } = chunk6GFSF2ML_js.useTranslation();
24953
25132
  const durationMs = transition.durationMs ?? 500;
24954
25133
  const animations = React108.useMemo(
24955
- () => chunk3AZ6ESJU_js.getSlideTransitionAnimations(
25134
+ () => chunkSEIVQGH5_js.getSlideTransitionAnimations(
24956
25135
  transition.type,
24957
25136
  durationMs,
24958
25137
  transition.direction,
@@ -25021,7 +25200,7 @@ function TransitionPreview({
25021
25200
  ]
25022
25201
  }
25023
25202
  ),
25024
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunk3AZ6ESJU_js.SLIDE_TRANSITION_KEYFRAMES })
25203
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkSEIVQGH5_js.SLIDE_TRANSITION_KEYFRAMES })
25025
25204
  ] });
25026
25205
  }
25027
25206
  var DEFAULT_DURATION_MS = 320;
@@ -25684,7 +25863,7 @@ function InspectorPane(props) {
25684
25863
  } = props;
25685
25864
  const hasSelection = selectedElement !== null;
25686
25865
  const { t } = chunk6GFSF2ML_js.useTranslation();
25687
- const { dragY, handlers: dragHandlers } = chunk3AZ6ESJU_js.useSheetDismissDrag(onClose);
25866
+ const { dragY, handlers: dragHandlers } = chunkSEIVQGH5_js.useSheetDismissDrag(onClose);
25688
25867
  const {
25689
25868
  animationPanelHeight,
25690
25869
  effectiveThemeOptions,
@@ -26097,7 +26276,7 @@ function PresentationTouchControls({
26097
26276
  hideNavigation = false
26098
26277
  }) {
26099
26278
  const { t } = chunk6GFSF2ML_js.useTranslation();
26100
- const { isTouchDevice } = chunk3AZ6ESJU_js.useIsMobile();
26279
+ const { isTouchDevice } = chunkSEIVQGH5_js.useIsMobile();
26101
26280
  if (!isTouchDevice) {
26102
26281
  return null;
26103
26282
  }
@@ -26744,11 +26923,11 @@ function PrintDialog({
26744
26923
  }) {
26745
26924
  const { t } = chunk6GFSF2ML_js.useTranslation();
26746
26925
  const regionRenderer = useRegionRenderer("dialog.print");
26747
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onClose);
26748
- const { viewportWidth } = chunk3AZ6ESJU_js.useIsMobile();
26926
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onClose);
26927
+ const { viewportWidth } = chunkSEIVQGH5_js.useIsMobile();
26749
26928
  const touchTargetPx = pptx.getDensePanelTouchTargetPx(viewportWidth);
26750
26929
  const closeBtnStyle = { minWidth: touchTargetPx, minHeight: touchTargetPx };
26751
- const printOptionDefaults = pptx.resolveDefaultPrintSettings(chunk3AZ6ESJU_js.useViewerOptionsContext());
26930
+ const printOptionDefaults = pptx.resolveDefaultPrintSettings(chunkSEIVQGH5_js.useViewerOptionsContext());
26752
26931
  const [printWhat, setPrintWhat] = React108.useState(printOptionDefaults?.printWhat ?? "slides");
26753
26932
  const [orientation, setOrientation] = React108.useState("landscape");
26754
26933
  const [colorMode, setColorMode] = React108.useState(
@@ -27013,11 +27192,7 @@ function ShowSlidesFieldset({
27013
27192
  name: "showSlides",
27014
27193
  value: "range",
27015
27194
  checked: showSlidesMode === "range",
27016
- onChange: () => update({
27017
- showSlidesMode: "range",
27018
- showSlidesFrom: draft.showSlidesFrom ?? 1,
27019
- showSlidesTo: draft.showSlidesTo ?? slideCount
27020
- }),
27195
+ onChange: () => update({ showSlidesMode: "range" }),
27021
27196
  className: "accent-primary"
27022
27197
  }
27023
27198
  ),
@@ -27068,10 +27243,7 @@ function ShowSlidesFieldset({
27068
27243
  name: "showSlides",
27069
27244
  value: "customShow",
27070
27245
  checked: showSlidesMode === "customShow",
27071
- onChange: () => update({
27072
- showSlidesMode: "customShow",
27073
- showSlidesCustomShowId: draft.showSlidesCustomShowId ?? customShows[0]?.id
27074
- }),
27246
+ onChange: () => update({ showSlidesMode: "customShow" }),
27075
27247
  className: "accent-primary"
27076
27248
  }
27077
27249
  ),
@@ -27104,9 +27276,12 @@ function SetUpSlideShowDialog({
27104
27276
  const [draft, setDraft] = React108.useState({
27105
27277
  ...properties
27106
27278
  });
27107
- const update = React108.useCallback((patch) => {
27108
- setDraft((prev) => ({ ...prev, ...patch }));
27109
- }, []);
27279
+ const update = React108.useCallback(
27280
+ (patch) => {
27281
+ setDraft((prev) => pptx.applySlideShowSettingsPatch(prev, patch, { slideCount, customShows }));
27282
+ },
27283
+ [slideCount, customShows]
27284
+ );
27110
27285
  const handleSave = React108.useCallback(() => {
27111
27286
  onSave(draft);
27112
27287
  onClose();
@@ -27160,10 +27335,7 @@ function SetUpSlideShowDialog({
27160
27335
  name: "showType",
27161
27336
  value,
27162
27337
  checked: showType === value,
27163
- onChange: () => update({
27164
- showType: value,
27165
- ...value === "kiosk" ? { loopContinuously: true } : {}
27166
- }),
27338
+ onChange: () => update({ showType: value }),
27167
27339
  className: "accent-primary"
27168
27340
  }
27169
27341
  ),
@@ -27238,14 +27410,14 @@ function BroadcastDialog({
27238
27410
  }) {
27239
27411
  const { t } = chunk6GFSF2ML_js.useTranslation();
27240
27412
  const regionRenderer = useRegionRenderer("dialog.broadcast");
27241
- const collab = chunk3AZ6ESJU_js.useCollaboration();
27413
+ const collab = chunkSEIVQGH5_js.useCollaboration();
27242
27414
  const isBroadcasting = collab !== null && collab.status !== "disconnected" && collab.status !== "error" && collab.config.role === "owner";
27243
27415
  const [roomId, setRoomId] = React108.useState("");
27244
27416
  const [userName, setUserName] = React108.useState("");
27245
27417
  const [serverUrl, setServerUrl] = React108.useState("");
27246
27418
  const [copied, setCopied] = React108.useState(false);
27247
27419
  const dialogRef = React108.useRef(null);
27248
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onClose);
27420
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onClose);
27249
27421
  useModalFocus(open, dialogRef, onClose);
27250
27422
  React108.useEffect(() => {
27251
27423
  if (open && !isBroadcasting) {
@@ -27561,7 +27733,7 @@ function ActiveSessionView({
27561
27733
  onCopyRoomId,
27562
27734
  onStopCollaboration
27563
27735
  }) {
27564
- const { t } = chunk6GFSF2ML_js.useTranslation(), viewerOptions = chunk3AZ6ESJU_js.useViewerOptionsContext(), statusColor = collab.status === "connected" ? "text-green-400" : collab.status === "connecting" ? "text-yellow-400" : "text-red-400", statusIcon = collab.status === "connected" || collab.status === "connecting" ? /* @__PURE__ */ jsxRuntime.jsx(lu.LuWifi, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lu.LuWifiOff, { className: "w-4 h-4" }), sessionUsers = pptx.buildActiveSessionUsers({
27736
+ const { t } = chunk6GFSF2ML_js.useTranslation(), viewerOptions = chunkSEIVQGH5_js.useViewerOptionsContext(), statusColor = collab.status === "connected" ? "text-green-400" : collab.status === "connecting" ? "text-yellow-400" : "text-red-400", statusIcon = collab.status === "connected" || collab.status === "connecting" ? /* @__PURE__ */ jsxRuntime.jsx(lu.LuWifi, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lu.LuWifiOff, { className: "w-4 h-4" }), sessionUsers = pptx.buildActiveSessionUsers({
27565
27737
  localUserName: activeCollaboration?.userName ?? collab.config.userName,
27566
27738
  localUserInitials: viewerOptions.general.userInitials,
27567
27739
  localUserColor: collab.config.userColor,
@@ -27660,7 +27832,7 @@ function StartSessionForm({
27660
27832
  onRetry
27661
27833
  }) {
27662
27834
  const { t } = chunk6GFSF2ML_js.useTranslation();
27663
- const { viewportWidth } = chunk3AZ6ESJU_js.useIsMobile();
27835
+ const { viewportWidth } = chunkSEIVQGH5_js.useIsMobile();
27664
27836
  const tabBtnStyle = { minHeight: pptx.getDensePanelTouchTargetPx(viewportWidth) };
27665
27837
  const inputReadOnlyClass = preconfigured ? " opacity-70 cursor-not-allowed" : "";
27666
27838
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
@@ -27794,7 +27966,7 @@ function ShareDialog({
27794
27966
  defaultUserName,
27795
27967
  defaultServerUrl
27796
27968
  }) {
27797
- const collab = chunk3AZ6ESJU_js.useCollaboration();
27969
+ const collab = chunkSEIVQGH5_js.useCollaboration();
27798
27970
  const isActive = collab !== null && collab.status !== "disconnected" && collab.status !== "error";
27799
27971
  const { t } = chunk6GFSF2ML_js.useTranslation();
27800
27972
  const regionRenderer = useRegionRenderer("dialog.share");
@@ -27805,9 +27977,9 @@ function ShareDialog({
27805
27977
  const [invitation, setInvitation] = React108.useState("");
27806
27978
  const [copied, setCopied] = React108.useState(false);
27807
27979
  const dialogRef = React108.useRef(null);
27808
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onClose);
27980
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onClose);
27809
27981
  useModalFocus(open, dialogRef, onClose);
27810
- const { viewportWidth, viewportHeight } = chunk3AZ6ESJU_js.useIsMobile();
27982
+ const { viewportWidth, viewportHeight } = chunkSEIVQGH5_js.useIsMobile();
27811
27983
  const touchTargetPx = pptx.getDensePanelTouchTargetPx(viewportWidth);
27812
27984
  const touchBtnStyle = { minWidth: touchTargetPx, minHeight: touchTargetPx };
27813
27985
  const stickyFooterClass = pptx.shouldStickyActionRow(viewportWidth, viewportHeight) ? "sticky bottom-0 bg-popover" : "";
@@ -28106,12 +28278,12 @@ function HyperlinkEditDialog({
28106
28278
  onCancel
28107
28279
  }) {
28108
28280
  const { t } = chunk6GFSF2ML_js.useTranslation();
28109
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onCancel);
28281
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onCancel);
28110
28282
  const inputRef = React108.useRef(null);
28111
- const detectedType = chunk3AZ6ESJU_js.detectTargetType(initialUrl, initialAction);
28112
- const emailParts = chunk3AZ6ESJU_js.parseEmailUrl(initialUrl || "");
28113
- const detectedSlide = chunk3AZ6ESJU_js.parseSlideFromUrl(initialUrl, initialAction);
28114
- const detectedVerb = initialAction ? chunk3AZ6ESJU_js.ACTION_VERB_MAP[initialAction.toLowerCase()] || "nextSlide" : "nextSlide";
28283
+ const detectedType = chunkSEIVQGH5_js.detectHyperlinkTargetType(initialUrl, initialAction);
28284
+ const emailParts = chunkSEIVQGH5_js.parseHyperlinkEmailUrl(initialUrl || "");
28285
+ const detectedSlide = chunkSEIVQGH5_js.parseHyperlinkSlideNumber(initialUrl, initialAction);
28286
+ const detectedVerb = initialAction ? pptx.HYPERLINK_ACTION_VERB_MAP[initialAction.toLowerCase()] || "nextSlide" : "nextSlide";
28115
28287
  const [targetType, setTargetType] = React108.useState(detectedType);
28116
28288
  const [url, setUrl] = React108.useState(
28117
28289
  detectedType === "email" || detectedType === "slide" || detectedType === "action" ? "" : initialUrl || ""
@@ -28390,7 +28562,7 @@ function ViewerBottomPanels({
28390
28562
  notesStyle,
28391
28563
  onNotesHeightChange
28392
28564
  }) {
28393
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(hiddenActions);
28565
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(hiddenActions);
28394
28566
  const customization = useViewerCustomizationContext();
28395
28567
  const showNotes = pptx.isPanelVisible(customization, "notes");
28396
28568
  const notesRenderer = useRegionRenderer("notes");
@@ -28734,10 +28906,13 @@ function ViewerToolbarSection(props) {
28734
28906
  onEnableEditing,
28735
28907
  onSetSnapToGrid,
28736
28908
  onSetSnapToShape,
28737
- onSetShowGuides
28909
+ onSetShowGuides,
28910
+ ribbonDisplay
28738
28911
  } = props;
28739
28912
  const { t } = chunk6GFSF2ML_js.useTranslation();
28740
28913
  const customization = useViewerCustomizationContext();
28914
+ const ribbon = useRibbonDisplayFallback(ribbonDisplay);
28915
+ const ribbonLayout = chunkSEIVQGH5_js.useController(ribbon).layout;
28741
28916
  const handleAddAnimation = React108.useCallback(
28742
28917
  (preset, group) => {
28743
28918
  if (!selectedElement || !activeSlide) {
@@ -28789,7 +28964,7 @@ function ViewerToolbarSection(props) {
28789
28964
  [activeSlide, propertyHandlers]
28790
28965
  );
28791
28966
  const scopedLayoutOptions = React108__default.default.useMemo(
28792
- () => chunk3AZ6ESJU_js.scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide),
28967
+ () => chunkSEIVQGH5_js.scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide),
28793
28968
  [s.layoutOptions, activeSlide]
28794
28969
  );
28795
28970
  const handleResetSlide = React108.useCallback(() => {
@@ -28983,7 +29158,7 @@ function ViewerToolbarSection(props) {
28983
29158
  [onSetMode, onPresentFromBeginning, printHandlers, exportHandlers, slideOps, s, zoom]
28984
29159
  );
28985
29160
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
28986
- !dialogs.isNarrowViewport && pptx.isPanelVisible(customization, "titleBar") && /* @__PURE__ */ jsxRuntime.jsx(
29161
+ !dialogs.isNarrowViewport && pptx.isPanelVisible(customization, "titleBar") && ribbonLayout.titleBar && /* @__PURE__ */ jsxRuntime.jsx(
28987
29162
  TitleBar,
28988
29163
  {
28989
29164
  mode,
@@ -29017,6 +29192,7 @@ function ViewerToolbarSection(props) {
29017
29192
  canEdit,
29018
29193
  isProtectedView,
29019
29194
  onEnableEditing,
29195
+ ribbonDisplay: ribbon,
29020
29196
  onQuickCommand: handleQuickAccessCommand,
29021
29197
  hiddenActions,
29022
29198
  recentPresentationsCount,
@@ -29196,7 +29372,7 @@ function ViewerToolbarSection(props) {
29196
29372
  isMobileInsertOpen: s.isMobileInsertOpen,
29197
29373
  onCloseMobileInsert: () => s.setIsMobileInsertOpen(false),
29198
29374
  slideCommentCount: activeSlide?.comments?.length ?? 0,
29199
- reviewComments: chunk3AZ6ESJU_js.createReviewCommentsHost({
29375
+ reviewComments: chunkSEIVQGH5_js.createReviewCommentsHost({
29200
29376
  state: s,
29201
29377
  activeSlideIndex,
29202
29378
  updateSlides: ops.updateSlides,
@@ -29319,7 +29495,7 @@ function CustomShowsDialog({
29319
29495
  // eslint-disable-next-line react-hooks/exhaustive-deps
29320
29496
  []
29321
29497
  );
29322
- chunk3AZ6ESJU_js.useController(controller);
29498
+ chunkSEIVQGH5_js.useController(controller);
29323
29499
  const view = controller.view(slides);
29324
29500
  const [active, setActive] = React108.useState(activeCustomShowId ?? "");
29325
29501
  const pickerValue = view.shows.some(({ id }) => id === active) ? active : "";
@@ -29599,7 +29775,7 @@ function EquationEditorDialog({
29599
29775
  existingOmml
29600
29776
  }) {
29601
29777
  const { t } = chunk6GFSF2ML_js.useTranslation();
29602
- const { panelStyle, handlers: dragHandlers } = chunk3AZ6ESJU_js.useModalDismissDrag(onClose);
29778
+ const { panelStyle, handlers: dragHandlers } = chunkSEIVQGH5_js.useModalDismissDrag(onClose);
29603
29779
  const initialLatex = React108.useMemo(() => {
29604
29780
  if (!existingOmml) {
29605
29781
  return "";
@@ -30207,7 +30383,13 @@ function useStageAnimationTriggers(root, slide, triggers, onStageClick) {
30207
30383
  }
30208
30384
  };
30209
30385
  }
30210
- function PresentationStage({
30386
+ function PresentationStage(props) {
30387
+ const inherited = React108.useContext(chunkSEIVQGH5_js.ElementRenderErrorReportingContext);
30388
+ const reporter = props.onElementRenderError ?? inherited?.onElementRenderError;
30389
+ const errorReporting = React108.useMemo(() => ({ onElementRenderError: reporter }), [reporter]);
30390
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ElementRenderErrorReportingContext.Provider, { value: errorReporting, children: /* @__PURE__ */ jsxRuntime.jsx(PresentationStageContent, { ...props }) });
30391
+ }
30392
+ function PresentationStageContent({
30211
30393
  activeSlide,
30212
30394
  templateElements,
30213
30395
  canvasSize,
@@ -30317,11 +30499,11 @@ function PresentationStage({
30317
30499
  })
30318
30500
  },
30319
30501
  children: [
30320
- /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.SlideBackgroundImageLayer, { slide: activeSlide }),
30502
+ /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.SlideBackgroundImageLayer, { slide: activeSlide }),
30321
30503
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: pptx.PRESENTATION_HIT_TEST_CSS }),
30322
30504
  presentationKeyframesCss && /* @__PURE__ */ jsxRuntime.jsx("style", { children: presentationKeyframesCss }),
30323
30505
  templateElements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
30324
- chunk3AZ6ESJU_js.ElementRenderer,
30506
+ chunkSEIVQGH5_js.ElementRenderer,
30325
30507
  {
30326
30508
  element,
30327
30509
  activeSlide,
@@ -30359,7 +30541,7 @@ function PresentationStage({
30359
30541
  `tpl-${element.id}`
30360
30542
  )),
30361
30543
  activeSlide?.elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(
30362
- chunk3AZ6ESJU_js.ElementRenderer,
30544
+ chunkSEIVQGH5_js.ElementRenderer,
30363
30545
  {
30364
30546
  element,
30365
30547
  activeSlide,
@@ -30471,7 +30653,7 @@ function PresentationTransitionMount({
30471
30653
  templateElementsBySlideId
30472
30654
  );
30473
30655
  return /* @__PURE__ */ jsxRuntime.jsx(
30474
- chunk3AZ6ESJU_js.PresentationTransitionOverlay,
30656
+ chunkSEIVQGH5_js.PresentationTransitionOverlay,
30475
30657
  {
30476
30658
  outgoingSlide,
30477
30659
  templateElements: templates.outgoing,
@@ -30517,8 +30699,8 @@ function ViewerCanvasArea(props) {
30517
30699
  aiCanvasActive = false
30518
30700
  } = props;
30519
30701
  const { t } = chunk6GFSF2ML_js.useTranslation();
30520
- const { isHidden } = chunk3AZ6ESJU_js.useToolbarVisibility(hiddenActions);
30521
- const viewerOptions = chunk3AZ6ESJU_js.useViewerOptionsContext();
30702
+ const { isHidden } = chunkSEIVQGH5_js.useToolbarVisibility(hiddenActions);
30703
+ const viewerOptions = chunkSEIVQGH5_js.useViewerOptionsContext();
30522
30704
  const outlineAuthoring = useOutlineAuthoring({
30523
30705
  state: s,
30524
30706
  updateElement: canvasHandlers.handleUpdateSmartArtElement,
@@ -30651,7 +30833,7 @@ function ViewerCanvasArea(props) {
30651
30833
  s.setActiveSlideIndex((i) => Math.max(0, i - 1));
30652
30834
  }
30653
30835
  }, [mode, presentation, s]);
30654
- const swipe = chunk3AZ6ESJU_js.useSwipeNavigation({
30836
+ const swipe = chunkSEIVQGH5_js.useSwipeNavigation({
30655
30837
  enabled: swipeEnabled,
30656
30838
  onNext: handleSwipeNext,
30657
30839
  onPrev: handleSwipePrev
@@ -30837,14 +31019,14 @@ function ViewerCanvasArea(props) {
30837
31019
  outlineAuthoring,
30838
31020
  collaborationOverlay: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30839
31021
  /* @__PURE__ */ jsxRuntime.jsx(
30840
- chunk3AZ6ESJU_js.RemoteSelectionOverlay,
31022
+ chunkSEIVQGH5_js.RemoteSelectionOverlay,
30841
31023
  {
30842
31024
  elements: effectiveSlide?.elements ?? [],
30843
31025
  activeSlideIndex
30844
31026
  }
30845
31027
  ),
30846
31028
  /* @__PURE__ */ jsxRuntime.jsx(
30847
- chunk3AZ6ESJU_js.CollaborationCursorOverlay,
31029
+ chunkSEIVQGH5_js.CollaborationCursorOverlay,
30848
31030
  {
30849
31031
  activeSlideIndex,
30850
31032
  canvasWidth: canvasSize.width,
@@ -31082,7 +31264,7 @@ function AiChangeOverlay({ batch, activeSlideIndex }) {
31082
31264
  }
31083
31265
  function ChartFormatPanel() {
31084
31266
  const { t } = chunk6GFSF2ML_js.useTranslation();
31085
- const commands = chunk3AZ6ESJU_js.useChartFormatContext();
31267
+ const commands = chunkSEIVQGH5_js.useChartFormatContext();
31086
31268
  const ref = React108.useRef(null);
31087
31269
  const chart = commands?.chart;
31088
31270
  const chartData = chart?.type === "chart" ? chart.chartData : void 0;
@@ -31155,7 +31337,7 @@ function MobileDismissSheet({
31155
31337
  children
31156
31338
  }) {
31157
31339
  const { t } = chunk6GFSF2ML_js.useTranslation();
31158
- const { dragY, handlers } = chunk3AZ6ESJU_js.useSheetDismissDrag(onClose);
31340
+ const { dragY, handlers } = chunkSEIVQGH5_js.useSheetDismissDrag(onClose);
31159
31341
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
31160
31342
  /* @__PURE__ */ jsxRuntime.jsx(
31161
31343
  "button",
@@ -31899,7 +32081,7 @@ function ViewerMainContent(props) {
31899
32081
  );
31900
32082
  const layoutGalleryAnchorRef = React108.useRef(null);
31901
32083
  const layoutGalleryPreviews = useLayoutPreviews(loadLayoutPreviews, layoutGalleryAnchor !== null);
31902
- return /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.ChartPartSelectionProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-pptx-chrome": "body", className: "relative z-10 flex flex-1 min-h-0", children: [
32084
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ChartPartSelectionProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-pptx-chrome": "body", className: "relative z-10 flex flex-1 min-h-0", children: [
31903
32085
  showSlidesPane && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
31904
32086
  slidesPaneRenderer ? (
31905
32087
  // The rail's slot (width, collapse, resize handle) stays the viewer's.
@@ -32404,7 +32586,7 @@ function MobileChromeOverlay(props) {
32404
32586
  slideSectionGroups,
32405
32587
  canEdit,
32406
32588
  commentCount
32407
- } = props, { keyboardInset, isKeyboardOpen } = chunk3AZ6ESJU_js.useKeyboardInsets(), activeSheet = s.isMobileInsertOpen ? "insert" : s.isSlidesPaneOpen ? "slides" : s.isInspectorPaneOpen ? s.sidebarPanelMode === "comments" ? "comments" : "inspector" : !s.isSlideNotesCollapsed ? "notes" : null, closeAllSheets = () => {
32589
+ } = props, { keyboardInset, isKeyboardOpen } = chunkSEIVQGH5_js.useKeyboardInsets(), activeSheet = s.isMobileInsertOpen ? "insert" : s.isSlidesPaneOpen ? "slides" : s.isInspectorPaneOpen ? s.sidebarPanelMode === "comments" ? "comments" : "inspector" : !s.isSlideNotesCollapsed ? "notes" : null, closeAllSheets = () => {
32408
32590
  s.setIsSlidesPaneOpen(false);
32409
32591
  s.setIsMobileInsertOpen(false);
32410
32592
  s.setIsInspectorPaneOpen(false);
@@ -32881,7 +33063,7 @@ async function exportAiChatLogs(options) {
32881
33063
  chats,
32882
33064
  { format: options?.format, detailed: options?.detailed, now: options?.now },
32883
33065
  (filename, content, mime) => {
32884
- chunk3AZ6ESJU_js.downloadBlob(new Blob([content], { type: mime }), filename);
33066
+ chunkSEIVQGH5_js.downloadBlob(new Blob([content], { type: mime }), filename);
32885
33067
  }
32886
33068
  );
32887
33069
  }
@@ -33234,7 +33416,7 @@ function ViewerOptionsProvider({
33234
33416
  store,
33235
33417
  children
33236
33418
  }) {
33237
- return /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.ViewerOptionsStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.ViewerOptionsContext.Provider, { value: options, children }) });
33419
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ViewerOptionsStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ViewerOptionsContext.Provider, { value: options, children }) });
33238
33420
  }
33239
33421
  function useAiBridge(input) {
33240
33422
  const ref = React108.useRef(input);
@@ -33317,7 +33499,7 @@ function useAiPanelController(input) {
33317
33499
  getSelectedElement: () => inputRef.current.selectedElement
33318
33500
  })
33319
33501
  );
33320
- const state = chunk3AZ6ESJU_js.useController(controller);
33502
+ const state = chunkSEIVQGH5_js.useController(controller);
33321
33503
  React108.useEffect(() => () => controller.dispose(), [controller]);
33322
33504
  const liveFocusTargets = React108.useMemo(
33323
33505
  () => host.computeFocusTargets({ activeSlideIndex, selectedElementIds, selectedElementId }),
@@ -34061,6 +34243,8 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34061
34243
  const {
34062
34244
  content: incomingContent,
34063
34245
  fonts = [],
34246
+ ribbonDisplay,
34247
+ onRibbonDisplayChange,
34064
34248
  filePath: hostFilePath,
34065
34249
  fileName: hostFileName,
34066
34250
  canEdit: canEditProp = false,
@@ -34116,7 +34300,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34116
34300
  limits
34117
34301
  } = props;
34118
34302
  const cloudDocument = React108.useMemo(() => pptx.createCloudDocumentController(), []);
34119
- const cloudFile = chunk3AZ6ESJU_js.useController(cloudDocument).file;
34303
+ const cloudFile = chunkSEIVQGH5_js.useController(cloudDocument).file;
34120
34304
  const {
34121
34305
  storage: viewerStorage,
34122
34306
  fileName,
@@ -34130,7 +34314,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34130
34314
  filePath: hostFilePath
34131
34315
  });
34132
34316
  const saveProgress = React108.useMemo(() => pptx.createSaveProgressController(), []);
34133
- const saveProgressState = chunk3AZ6ESJU_js.useController(saveProgress);
34317
+ const saveProgressState = chunkSEIVQGH5_js.useController(saveProgress);
34134
34318
  const storage = React108.useMemo(
34135
34319
  () => viewerStorage ? saveProgress.wrap(viewerStorage) : viewerStorage,
34136
34320
  [viewerStorage, saveProgress]
@@ -34229,7 +34413,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34229
34413
  },
34230
34414
  [hostStorage, cloudDocument]
34231
34415
  );
34232
- const { optionsStore, options: viewerOptions } = chunk3AZ6ESJU_js.useViewerOptions();
34416
+ const { optionsStore, options: viewerOptions } = chunkSEIVQGH5_js.useViewerOptions();
34233
34417
  const custom = useViewerCustomization(
34234
34418
  customization,
34235
34419
  legacyHiddenActions,
@@ -34249,8 +34433,8 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34249
34433
  const handleEnableEditing = React108.useCallback(() => {
34250
34434
  setProtectedViewOverridden(true);
34251
34435
  }, []);
34252
- const readOnlyRec = chunk3AZ6ESJU_js.useReadOnlyRecommendationState(content);
34253
- const compatToastsState = chunk3AZ6ESJU_js.useCompatibilityToastsState();
34436
+ const readOnlyRec = chunkSEIVQGH5_js.useReadOnlyRecommendationState(content);
34437
+ const compatToastsState = chunkSEIVQGH5_js.useCompatibilityToastsState();
34254
34438
  const [notesBarHeight, setNotesBarHeight] = React108.useState(0);
34255
34439
  const runProgramNoticesState = useRunProgramNoticesState();
34256
34440
  const [collaborationReadOnly, setCollaborationReadOnly] = React108.useState(Boolean(collaboration));
@@ -34273,8 +34457,8 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34273
34457
  filePath
34274
34458
  });
34275
34459
  const [isShareDialogOpen, setIsShareDialogOpen] = React108.useState(false);
34276
- const { reducedMotion, toggleReducedMotion } = chunk3AZ6ESJU_js.useReducedMotion();
34277
- const state = chunk3AZ6ESJU_js.useViewerState({
34460
+ const { reducedMotion, toggleReducedMotion } = chunkSEIVQGH5_js.useReducedMotion();
34461
+ const state = chunkSEIVQGH5_js.useViewerState({
34278
34462
  content,
34279
34463
  canEdit,
34280
34464
  inspectorInitiallyOpen: props.inspectorInitiallyOpen
@@ -34294,6 +34478,12 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34294
34478
  activeSlide,
34295
34479
  selectedElement
34296
34480
  } = state;
34481
+ const ribbonDisplayController = useRibbonDisplayController({
34482
+ ribbonDisplay,
34483
+ onRibbonDisplayChange,
34484
+ collapseRibbonAutomatically: viewerOptions.general.collapseRibbonAutomatically,
34485
+ rootRef: containerRef
34486
+ });
34297
34487
  useLoadNotifications({
34298
34488
  loading,
34299
34489
  error,
@@ -34401,16 +34591,16 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34401
34591
  }
34402
34592
  }, [settings, optionsStore]);
34403
34593
  const handleClearOptionsCache = useAutosaveCacheMaintenance(viewerOptions, storage);
34404
- const mobile = chunk3AZ6ESJU_js.useIsMobile();
34594
+ const mobile = chunkSEIVQGH5_js.useIsMobile();
34405
34595
  const { isMobile, isTouchDevice, isVirtualKeyboardOpen } = mobile;
34406
- const resizablePanels = chunk3AZ6ESJU_js.useResizablePanels();
34596
+ const resizablePanels = chunkSEIVQGH5_js.useResizablePanels();
34407
34597
  const {
34408
34598
  gridSpacingPx,
34409
34599
  visibleSlideIndexes,
34410
34600
  slideSectionGroups,
34411
34601
  masterPseudoSlide,
34412
34602
  authoredRange
34413
- } = chunk3AZ6ESJU_js.useDerivedSlideState({
34603
+ } = chunkSEIVQGH5_js.useDerivedSlideState({
34414
34604
  slides,
34415
34605
  sections: state.sections,
34416
34606
  customShows: state.customShows,
@@ -34435,11 +34625,14 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34435
34625
  state.cropSessionRef
34436
34626
  ]
34437
34627
  );
34438
- const zoom = chunk3AZ6ESJU_js.useZoomViewport({
34628
+ const zoom = chunkSEIVQGH5_js.useZoomViewport({
34439
34629
  canvasSize,
34440
34630
  selectedElements: state.selectedElements,
34441
34631
  fitPadding: props.fitPadding,
34442
- maxFitScale: props.maxFitScale
34632
+ maxFitScale: props.maxFitScale,
34633
+ // Nothing to select in a read-only view, so a plain drag pans instead.
34634
+ dragPans: mode === "preview",
34635
+ activeSlideId: activeSlide?.id
34443
34636
  });
34444
34637
  const { setIsDirty } = state;
34445
34638
  const onChangeCallback = React108.useRef(onChange);
@@ -34451,7 +34644,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34451
34644
  onChangeCallback.current?.();
34452
34645
  }, [setIsDirty]);
34453
34646
  const restoreHistoryThemeRef = React108.useRef(void 0);
34454
- const history = chunk3AZ6ESJU_js.useEditorHistory({
34647
+ const history = chunkSEIVQGH5_js.useEditorHistory({
34455
34648
  slides,
34456
34649
  canvasSize,
34457
34650
  activeSlideIndex,
@@ -34480,7 +34673,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34480
34673
  setEditTemplateMode: state.setEditTemplateMode,
34481
34674
  setHeaderFooter: state.setHeaderFooter
34482
34675
  });
34483
- const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = chunk3AZ6ESJU_js.usePresentationSetup({
34676
+ const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = chunkSEIVQGH5_js.usePresentationSetup({
34484
34677
  mode,
34485
34678
  slides,
34486
34679
  visibleSlideIndexes,
@@ -34559,7 +34752,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34559
34752
  loading,
34560
34753
  error
34561
34754
  ]);
34562
- chunk3AZ6ESJU_js.useTouchGestures({
34755
+ chunkSEIVQGH5_js.useTouchGestures({
34563
34756
  targetRef: zoom.canvasViewportRef,
34564
34757
  currentScale: zoom.scale,
34565
34758
  callbacks: {
@@ -34581,7 +34774,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34581
34774
  },
34582
34775
  enabled: isTouchDevice
34583
34776
  });
34584
- const dialogs = chunk3AZ6ESJU_js.useViewerDialogs({
34777
+ const dialogs = chunkSEIVQGH5_js.useViewerDialogs({
34585
34778
  mode,
34586
34779
  slides,
34587
34780
  activeSlide,
@@ -34609,7 +34802,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34609
34802
  history,
34610
34803
  embeddedFontFamilies: state.embeddedFonts.map((font) => font.name)
34611
34804
  });
34612
- chunk3AZ6ESJU_js.useClearSelectionOnSlideChange(state, activeSlideIndex);
34805
+ chunkSEIVQGH5_js.useClearSelectionOnSlideChange(state, activeSlideIndex);
34613
34806
  const zoomBeforePresentRef = React108.useRef(null);
34614
34807
  React108.useEffect(() => {
34615
34808
  if (mode !== "present") {
@@ -34627,7 +34820,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34627
34820
  zoom.handleZoomToFit();
34628
34821
  zoom.canvasViewportRef.current?.scrollTo({ left: 0, top: 0 });
34629
34822
  }, [mode]);
34630
- const editorOps = chunk3AZ6ESJU_js.useEditorOperations({
34823
+ const editorOps = chunkSEIVQGH5_js.useEditorOperations({
34631
34824
  state,
34632
34825
  history,
34633
34826
  zoom,
@@ -34672,7 +34865,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34672
34865
  handlerRef,
34673
34866
  viewerApi,
34674
34867
  loadVersion
34675
- } = chunk3AZ6ESJU_js.useViewerIntegration({
34868
+ } = chunkSEIVQGH5_js.useViewerIntegration({
34676
34869
  transformCommittedText: (text, previous) => pptx.applyAutoCorrectToEdit(text, previous, viewerOptions.proofing),
34677
34870
  state,
34678
34871
  zoom,
@@ -34687,6 +34880,14 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34687
34880
  filePath,
34688
34881
  fileName,
34689
34882
  storage,
34883
+ // The host persisted the current revision: its work is in the file, so the recovery
34884
+ // copy goes unless Options > Save asks to keep the last AutoRecover version.
34885
+ discardRecoveryOnHostSave: () => {
34886
+ if (filePath && pptx.shouldDiscardAutosaveOnSuccessfulSave(viewerOptions)) {
34887
+ void pptx.deleteAutosaveSnapshot(filePath, storage).catch(() => {
34888
+ });
34889
+ }
34890
+ },
34690
34891
  // A failed Save / Save As: the host's `onError`, and the save-failed notice for the user.
34691
34892
  onSaveError: (saveError) => {
34692
34893
  onError?.(pptx.saveFailureMessage(saveError));
@@ -34817,7 +35018,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34817
35018
  updateElementById: editorOps.ops.updateElementById
34818
35019
  });
34819
35020
  const ribbonScope = useRibbonScopeToken();
34820
- const viewPreferencesSync = chunk3AZ6ESJU_js.useViewPreferencesSync({
35021
+ const viewPreferencesSync = chunkSEIVQGH5_js.useViewPreferencesSync({
34821
35022
  loadVersion,
34822
35023
  viewProperties: state.viewProperties,
34823
35024
  setViewProperties: state.setViewProperties,
@@ -34868,7 +35069,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
34868
35069
  },
34869
35070
  [state]
34870
35071
  );
34871
- const layoutSwitching = chunk3AZ6ESJU_js.useLayoutSwitching({
35072
+ const layoutSwitching = chunkSEIVQGH5_js.useLayoutSwitching({
34872
35073
  handler: handlerRef.current,
34873
35074
  slides,
34874
35075
  activeSlideIndex,
@@ -35051,6 +35252,7 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
35051
35252
  onToggleAiPanel: aiPanel.toggle,
35052
35253
  isProtectedView,
35053
35254
  onEnableEditing: hostCanEdit && pptx.isEditingAllowed(customizationResolved) ? handleEnableEditing : void 0,
35255
+ ribbonDisplay: ribbonDisplayController,
35054
35256
  onSetSnapToGrid: viewPreferencesSync.handleSetSnapToGrid,
35055
35257
  onSetSnapToShape: viewPreferencesSync.handleSetSnapToShape,
35056
35258
  onSetShowGuides: viewPreferencesSync.handleSetShowGuides
@@ -35389,8 +35591,8 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
35389
35591
  // Nothing previously provided it, so every one of those consumers was
35390
35592
  // silently reading `DEFAULT_VIEWER_OPTIONS` forever, no matter what
35391
35593
  // the user changed in the Options dialog.
35392
- /* @__PURE__ */ jsxRuntime.jsx(ViewerOptionsProvider, { options: viewerOptions, store: optionsStore, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerCustomizationContext.Provider, { value: customizationResolved, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerStorageContext.Provider, { value: hostStorage, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerCloudFilesContext.Provider, { value: cloudFiles, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerRegionBaseContext.Provider, { value: regionBase, children: /* @__PURE__ */ jsxRuntime.jsx(RibbonAddInsContext.Provider, { value: ribbonAddIns ?? NO_RIBBON_ADD_INS, children: /* @__PURE__ */ jsxRuntime.jsx(AccountAuthContext.Provider, { value: accountAuth, children: /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.Rendering3DFlagsContext.Provider, { value: effective3D, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerThemeProvider, { theme: effectiveTheme, children: /* @__PURE__ */ jsxRuntime.jsxs(
35393
- chunk3AZ6ESJU_js.CollaborationProvider,
35594
+ /* @__PURE__ */ jsxRuntime.jsx(ViewerOptionsProvider, { options: viewerOptions, store: optionsStore, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerCustomizationContext.Provider, { value: customizationResolved, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerStorageContext.Provider, { value: hostStorage, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerCloudFilesContext.Provider, { value: cloudFiles, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerRegionBaseContext.Provider, { value: regionBase, children: /* @__PURE__ */ jsxRuntime.jsx(RibbonAddInsContext.Provider, { value: ribbonAddIns ?? NO_RIBBON_ADD_INS, children: /* @__PURE__ */ jsxRuntime.jsx(AccountAuthContext.Provider, { value: accountAuth, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.Rendering3DFlagsContext.Provider, { value: effective3D, children: /* @__PURE__ */ jsxRuntime.jsx(ViewerThemeProvider, { theme: effectiveTheme, children: /* @__PURE__ */ jsxRuntime.jsxs(
35595
+ chunkSEIVQGH5_js.CollaborationProvider,
35394
35596
  {
35395
35597
  config: collaboration,
35396
35598
  canvasWidth: canvasSize.width,
@@ -35447,19 +35649,19 @@ var PowerPointViewerBody = /* @__PURE__ */ React108.forwardRef(
35447
35649
  slideCount: slides.length
35448
35650
  }
35449
35651
  ),
35450
- /* @__PURE__ */ jsxRuntime.jsx(ShapeFormatContext.Provider, { value: shapeFormat, children: /* @__PURE__ */ jsxRuntime.jsx(RibbonGalleryCommandsContext.Provider, { value: ribbonGalleries, children: /* @__PURE__ */ jsxRuntime.jsx(chunk3AZ6ESJU_js.ChartFormatContext.Provider, { value: chartFormat, children: viewerContent }) }) })
35652
+ /* @__PURE__ */ jsxRuntime.jsx(ShapeFormatContext.Provider, { value: shapeFormat, children: /* @__PURE__ */ jsxRuntime.jsx(RibbonGalleryCommandsContext.Provider, { value: ribbonGalleries, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSEIVQGH5_js.ChartFormatContext.Provider, { value: chartFormat, children: viewerContent }) }) })
35451
35653
  ]
35452
35654
  }
35453
35655
  ) }) }) }) }) }) }) }) }) })
35454
35656
  );
35455
35657
  }
35456
35658
  );
35457
- var PowerPointViewer2 = /* @__PURE__ */ chunk3AZ6ESJU_js.withDisplayName(
35659
+ var PowerPointViewer2 = /* @__PURE__ */ chunkSEIVQGH5_js.withDisplayName(
35458
35660
  PowerPointViewerComponent,
35459
35661
  "PowerPointViewer"
35460
35662
  );
35461
35663
  function CollaborationStatusStrip() {
35462
- const collab = chunk3AZ6ESJU_js.useCollaboration();
35664
+ const collab = chunkSEIVQGH5_js.useCollaboration();
35463
35665
  if (!collab) {
35464
35666
  return null;
35465
35667
  }
@@ -35476,9 +35678,9 @@ function CollaborationStateReporter({
35476
35678
  onChange,
35477
35679
  onStatus
35478
35680
  }) {
35479
- const collab = chunk3AZ6ESJU_js.useCollaboration();
35681
+ const collab = chunkSEIVQGH5_js.useCollaboration();
35480
35682
  useCollaborationStateReport(collab, onChange);
35481
- chunk3AZ6ESJU_js.useReportOnChange(collab?.status ?? "disconnected", onStatus, "disconnected");
35683
+ chunkSEIVQGH5_js.useReportOnChange(collab?.status ?? "disconnected", onStatus, "disconnected");
35482
35684
  return null;
35483
35685
  }
35484
35686
  function CollaborationDocumentSync({
@@ -35493,8 +35695,8 @@ function CollaborationDocumentSync({
35493
35695
  onReadOnlyChange,
35494
35696
  history
35495
35697
  }) {
35496
- const collab = chunk3AZ6ESJU_js.useCollaboration();
35497
- chunk3AZ6ESJU_js.useCollaborationDocumentSync({
35698
+ const collab = chunkSEIVQGH5_js.useCollaboration();
35699
+ chunkSEIVQGH5_js.useCollaborationDocumentSync({
35498
35700
  collaboration: collab,
35499
35701
  history,
35500
35702
  slides,
@@ -35514,14 +35716,14 @@ function CollaborationFollowLayer({
35514
35716
  setActiveSlideIndex,
35515
35717
  slideCount
35516
35718
  }) {
35517
- const collab = chunk3AZ6ESJU_js.useCollaboration();
35518
- const { followedClientId, followUser } = chunk3AZ6ESJU_js.useFollowMode({
35719
+ const collab = chunkSEIVQGH5_js.useCollaboration();
35720
+ const { followedClientId, followUser } = chunkSEIVQGH5_js.useFollowMode({
35519
35721
  collab,
35520
35722
  activeSlideIndex,
35521
35723
  setActiveSlideIndex,
35522
35724
  slideCount
35523
35725
  });
35524
- chunk3AZ6ESJU_js.useBroadcastFollower({
35726
+ chunkSEIVQGH5_js.useBroadcastFollower({
35525
35727
  collab,
35526
35728
  activeSlideIndex,
35527
35729
  setActiveSlideIndex,