pptx-react-viewer 2.16.5 → 2.16.7

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 (109) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-6B26AZGA.mjs → AiChatPanel-2YYL6AKX.mjs} +3 -9
  3. package/dist/AiChatPanel-2YYL6AKX.mjs.br +0 -0
  4. package/dist/AiChatPanel-2YYL6AKX.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-FGEIZQCD.js → AiChatPanel-XSXMU2Q5.js} +23 -29
  6. package/dist/AiChatPanel-XSXMU2Q5.js.br +0 -0
  7. package/dist/AiChatPanel-XSXMU2Q5.js.gz +0 -0
  8. package/dist/{Model3DScene-2JX5CUPK.js → Model3DScene-36UJZLCO.js} +2 -2
  9. package/dist/Model3DScene-36UJZLCO.js.br +0 -0
  10. package/dist/Model3DScene-36UJZLCO.js.gz +0 -0
  11. package/dist/{Model3DScene-NKYNKUPP.mjs → Model3DScene-NVFP3JBJ.mjs} +1 -1
  12. package/dist/Model3DScene-NVFP3JBJ.mjs.br +0 -0
  13. package/dist/Model3DScene-NVFP3JBJ.mjs.gz +0 -0
  14. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +1 -1
  15. package/dist/{SurfaceChart3DScene-TTL2FTEG.mjs → SurfaceChart3DScene-BMFEDBLF.mjs} +1 -1
  16. package/dist/{SurfaceChart3DScene-TTL2FTEG.mjs.br → SurfaceChart3DScene-BMFEDBLF.mjs.br} +0 -0
  17. package/dist/SurfaceChart3DScene-BMFEDBLF.mjs.gz +0 -0
  18. package/dist/{SurfaceChart3DScene-AE5SKG7U.js → SurfaceChart3DScene-W6I255VU.js} +2 -2
  19. package/dist/SurfaceChart3DScene-W6I255VU.js.br +0 -0
  20. package/dist/SurfaceChart3DScene-W6I255VU.js.gz +0 -0
  21. package/dist/{chunk-LCWZ4TD4.js → chunk-77TMRPDU.js} +2144 -1527
  22. package/dist/chunk-77TMRPDU.js.br +0 -0
  23. package/dist/chunk-77TMRPDU.js.gz +0 -0
  24. package/dist/{chunk-247XH4EN.mjs → chunk-D5TAZ5NL.mjs} +1214 -53
  25. package/dist/chunk-D5TAZ5NL.mjs.br +0 -0
  26. package/dist/chunk-D5TAZ5NL.mjs.gz +0 -0
  27. package/dist/{chunk-EFZ4K6V5.mjs → chunk-J56KVWI5.mjs} +1132 -515
  28. package/dist/chunk-J56KVWI5.mjs.br +0 -0
  29. package/dist/chunk-J56KVWI5.mjs.gz +0 -0
  30. package/dist/{chunk-5YGTUHNO.mjs → chunk-J5V7UCD2.mjs} +15 -1403
  31. package/dist/chunk-J5V7UCD2.mjs.br +0 -0
  32. package/dist/chunk-J5V7UCD2.mjs.gz +0 -0
  33. package/dist/{chunk-VZI35LEF.js → chunk-JSJZWA43.js} +9 -3
  34. package/dist/chunk-JSJZWA43.js.br +0 -0
  35. package/dist/chunk-JSJZWA43.js.gz +0 -0
  36. package/dist/{chunk-Y6W5LGTR.mjs → chunk-KVNZGR3L.mjs} +14 -93
  37. package/dist/chunk-KVNZGR3L.mjs.br +0 -0
  38. package/dist/chunk-KVNZGR3L.mjs.gz +0 -0
  39. package/dist/{chunk-P65VL2I6.js → chunk-NFJLF7TX.js} +258 -1676
  40. package/dist/chunk-NFJLF7TX.js.br +0 -0
  41. package/dist/chunk-NFJLF7TX.js.gz +0 -0
  42. package/dist/{chunk-MZN2UIYT.mjs → chunk-QNKJUUKD.mjs} +7 -2
  43. package/dist/chunk-QNKJUUKD.mjs.br +0 -0
  44. package/dist/chunk-QNKJUUKD.mjs.gz +0 -0
  45. package/dist/{chunk-UNWU6D2M.js → chunk-S7HPAJRX.js} +350 -429
  46. package/dist/chunk-S7HPAJRX.js.br +0 -0
  47. package/dist/chunk-S7HPAJRX.js.gz +0 -0
  48. package/dist/{chunk-6QGTRYSC.js → chunk-USAJMMF2.js} +1248 -59
  49. package/dist/chunk-USAJMMF2.js.br +0 -0
  50. package/dist/chunk-USAJMMF2.js.gz +0 -0
  51. package/dist/index.d.ts +14 -0
  52. package/dist/index.js +39 -39
  53. package/dist/index.js.br +0 -0
  54. package/dist/index.js.gz +0 -0
  55. package/dist/index.mjs +5 -5
  56. package/dist/index.mjs.br +0 -0
  57. package/dist/index.mjs.gz +0 -0
  58. package/dist/internals.d.ts +37 -7
  59. package/dist/internals.d.ts.map +1 -1
  60. package/dist/internals.js +78 -78
  61. package/dist/internals.js.br +5 -4
  62. package/dist/internals.js.gz +0 -0
  63. package/dist/internals.mjs +3 -3
  64. package/dist/internals.mjs.br +0 -0
  65. package/dist/internals.mjs.gz +0 -0
  66. package/dist/pptx-viewer.css +1 -1
  67. package/dist/pptx-viewer.css.br +0 -0
  68. package/dist/pptx-viewer.css.gz +0 -0
  69. package/dist/{useViewerBuildingBlocks-CBZrHhxl.d.ts → useViewerBuildingBlocks-Xddn6SFj.d.ts} +15 -1
  70. package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +1 -0
  71. package/dist/viewer/index.js +26 -26
  72. package/dist/viewer/index.js.br +0 -0
  73. package/dist/viewer/index.js.gz +0 -0
  74. package/dist/viewer/index.mjs +5 -5
  75. package/dist/viewer/index.mjs.br +0 -0
  76. package/dist/viewer/index.mjs.gz +0 -0
  77. package/package.json +1 -1
  78. package/dist/AiChatPanel-6B26AZGA.mjs.br +0 -0
  79. package/dist/AiChatPanel-6B26AZGA.mjs.gz +0 -0
  80. package/dist/AiChatPanel-FGEIZQCD.js.br +0 -0
  81. package/dist/AiChatPanel-FGEIZQCD.js.gz +0 -0
  82. package/dist/Model3DScene-2JX5CUPK.js.br +0 -0
  83. package/dist/Model3DScene-2JX5CUPK.js.gz +0 -0
  84. package/dist/Model3DScene-NKYNKUPP.mjs.br +0 -0
  85. package/dist/Model3DScene-NKYNKUPP.mjs.gz +0 -0
  86. package/dist/SurfaceChart3DScene-AE5SKG7U.js.br +0 -0
  87. package/dist/SurfaceChart3DScene-AE5SKG7U.js.gz +0 -0
  88. package/dist/SurfaceChart3DScene-TTL2FTEG.mjs.gz +0 -0
  89. package/dist/chunk-247XH4EN.mjs.br +0 -0
  90. package/dist/chunk-247XH4EN.mjs.gz +0 -0
  91. package/dist/chunk-5YGTUHNO.mjs.br +0 -0
  92. package/dist/chunk-5YGTUHNO.mjs.gz +0 -0
  93. package/dist/chunk-6QGTRYSC.js.br +0 -0
  94. package/dist/chunk-6QGTRYSC.js.gz +0 -0
  95. package/dist/chunk-EFZ4K6V5.mjs.br +0 -0
  96. package/dist/chunk-EFZ4K6V5.mjs.gz +0 -0
  97. package/dist/chunk-LCWZ4TD4.js.br +0 -0
  98. package/dist/chunk-LCWZ4TD4.js.gz +0 -0
  99. package/dist/chunk-MZN2UIYT.mjs.br +0 -0
  100. package/dist/chunk-MZN2UIYT.mjs.gz +0 -0
  101. package/dist/chunk-P65VL2I6.js.br +0 -0
  102. package/dist/chunk-P65VL2I6.js.gz +0 -0
  103. package/dist/chunk-UNWU6D2M.js.br +0 -0
  104. package/dist/chunk-UNWU6D2M.js.gz +0 -0
  105. package/dist/chunk-VZI35LEF.js.br +0 -0
  106. package/dist/chunk-VZI35LEF.js.gz +0 -0
  107. package/dist/chunk-Y6W5LGTR.mjs.br +0 -0
  108. package/dist/chunk-Y6W5LGTR.mjs.gz +0 -0
  109. package/dist/useViewerBuildingBlocks-CBZrHhxl.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkP65VL2I6_js = require('./chunk-P65VL2I6.js');
3
+ var chunkNFJLF7TX_js = require('./chunk-NFJLF7TX.js');
4
4
  var chunkDVZF4ARG_js = require('./chunk-DVZF4ARG.js');
5
- var chunk6QGTRYSC_js = require('./chunk-6QGTRYSC.js');
5
+ var chunkUSAJMMF2_js = require('./chunk-USAJMMF2.js');
6
6
  var react = require('react');
7
7
  var JSZip = require('jszip');
8
8
  var reactI18next = require('react-i18next');
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
14
14
  function useVirtualizedSlides({
15
15
  totalItems,
16
16
  itemHeight,
17
- overscan = chunk6QGTRYSC_js.DEFAULT_VIRTUAL_OVERSCAN
17
+ overscan = chunkUSAJMMF2_js.DEFAULT_VIRTUAL_OVERSCAN
18
18
  }) {
19
19
  const scrollContainerRef = react.useRef(null);
20
20
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
44
44
  resizeObserver?.disconnect();
45
45
  };
46
46
  }, []);
47
- const range = chunk6QGTRYSC_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
47
+ const range = chunkUSAJMMF2_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
48
48
  const safeItemHeight = Math.max(itemHeight, 1);
49
49
  const scrollToIndex = react.useCallback(
50
50
  (index, behavior = "smooth") => {
@@ -85,7 +85,7 @@ function usePresenceTracking({
85
85
  }) {
86
86
  const [remoteUsers, setRemoteUsers] = react.useState([]);
87
87
  const projectorRef = react.useRef(null);
88
- projectorRef.current ??= chunk6QGTRYSC_js.createPresenceProjector();
88
+ projectorRef.current ??= chunkUSAJMMF2_js.createPresenceProjector();
89
89
  const projector = projectorRef.current;
90
90
  const lastBroadcastRef = react.useRef(0);
91
91
  const pendingBroadcastRef = react.useRef(null);
@@ -110,7 +110,7 @@ function usePresenceTracking({
110
110
  awareness.setLocalStateField("presence", state);
111
111
  lastBroadcastRef.current = Date.now();
112
112
  };
113
- if (elapsed >= chunk6QGTRYSC_js.BROADCAST_THROTTLE_MS) {
113
+ if (elapsed >= chunkUSAJMMF2_js.BROADCAST_THROTTLE_MS) {
114
114
  if (pendingBroadcastRef.current) {
115
115
  clearTimeout(pendingBroadcastRef.current);
116
116
  pendingBroadcastRef.current = null;
@@ -120,7 +120,7 @@ function usePresenceTracking({
120
120
  pendingBroadcastRef.current = setTimeout(() => {
121
121
  pendingBroadcastRef.current = null;
122
122
  flush();
123
- }, chunk6QGTRYSC_js.BROADCAST_THROTTLE_MS - elapsed);
123
+ }, chunkUSAJMMF2_js.BROADCAST_THROTTLE_MS - elapsed);
124
124
  }
125
125
  },
126
126
  [awareness, userName, userColor, userAvatar, role]
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
200
200
  const departureRef = react.useRef(null);
201
201
  const gateRef = react.useRef(null);
202
202
  if (!gateRef.current) {
203
- gateRef.current = chunk6QGTRYSC_js.createSyncGate(() => setSynced(true));
203
+ gateRef.current = chunkUSAJMMF2_js.createSyncGate(() => setSynced(true));
204
204
  }
205
205
  const teardown = react.useCallback(() => {
206
206
  if (timeoutRef.current) {
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
220
220
  const buildCleanup = react.useCallback(
221
221
  (provider, yDoc) => () => {
222
222
  announceDeparture();
223
- chunk6QGTRYSC_js.clearLocalAwareness(provider.awareness);
223
+ chunkUSAJMMF2_js.clearLocalAwareness(provider.awareness);
224
224
  provider.destroy();
225
225
  yDoc.destroy();
226
226
  setDoc(null);
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
245
245
  if (config.authToken) {
246
246
  opts.password = config.authToken;
247
247
  }
248
- const roomId = chunk6QGTRYSC_js.validateRoomId(config.roomId);
248
+ const roomId = chunkUSAJMMF2_js.validateRoomId(config.roomId);
249
249
  const provider = new WebrtcProvider(roomId, yDoc, opts);
250
- departureRef.current = chunk6QGTRYSC_js.createDepartureChannel(roomId, provider.awareness);
250
+ departureRef.current = chunkUSAJMMF2_js.createDepartureChannel(roomId, provider.awareness);
251
251
  setDoc(yDoc);
252
252
  setAwareness(provider.awareness);
253
253
  setClientId(provider.awareness.clientID);
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
289
289
  if (!config) {
290
290
  return;
291
291
  }
292
- const roomId = chunk6QGTRYSC_js.validateRoomId(config.roomId);
293
- const transport = config.transport ?? chunk6QGTRYSC_js.resolveTransportForServerUrl(config.serverUrl);
292
+ const roomId = chunkUSAJMMF2_js.validateRoomId(config.roomId);
293
+ const transport = config.transport ?? chunkUSAJMMF2_js.resolveTransportForServerUrl(config.serverUrl);
294
294
  if (transport === "webrtc") {
295
295
  await initWebrtc();
296
296
  return;
297
297
  }
298
- if (chunk6QGTRYSC_js.isMixedContentBlocked(config.serverUrl)) {
298
+ if (chunkUSAJMMF2_js.isMixedContentBlocked(config.serverUrl)) {
299
299
  console.warn(
300
300
  `[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
301
301
  );
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
309
309
  const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
310
310
  params: config.authToken ? { token: config.authToken } : void 0
311
311
  });
312
- departureRef.current = chunk6QGTRYSC_js.createDepartureChannel(roomId, provider.awareness);
312
+ departureRef.current = chunkUSAJMMF2_js.createDepartureChannel(roomId, provider.awareness);
313
313
  let connected = false;
314
314
  const handleStatus = (event) => {
315
315
  if (event.status === "connected") {
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
349
349
  provider.off("status", handleStatus);
350
350
  provider.off("sync", handleSynced);
351
351
  announceDeparture();
352
- chunk6QGTRYSC_js.clearLocalAwareness(provider.awareness);
352
+ chunkUSAJMMF2_js.clearLocalAwareness(provider.awareness);
353
353
  provider.destroy();
354
354
  yDoc.destroy();
355
355
  setDoc(null);
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
358
358
  cleanupRef.current = null;
359
359
  setStatus("error");
360
360
  }
361
- }, chunk6QGTRYSC_js.CONNECTION_TIMEOUT_MS);
361
+ }, chunkUSAJMMF2_js.CONNECTION_TIMEOUT_MS);
362
362
  }
363
363
  setDoc(yDoc);
364
364
  setAwareness(provider.awareness);
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
367
367
  provider.off("status", handleStatus);
368
368
  provider.off("sync", handleSynced);
369
369
  announceDeparture();
370
- chunk6QGTRYSC_js.clearLocalAwareness(provider.awareness);
370
+ chunkUSAJMMF2_js.clearLocalAwareness(provider.awareness);
371
371
  provider.destroy();
372
372
  yDoc.destroy();
373
373
  setDoc(null);
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
393
393
  ]);
394
394
  react.useEffect(() => {
395
395
  init();
396
- const disposeTeardown = chunk6QGTRYSC_js.registerCollaborationTeardown({
396
+ const disposeTeardown = chunkUSAJMMF2_js.registerCollaborationTeardown({
397
397
  leave: teardown,
398
398
  rejoin: init
399
399
  });
@@ -414,7 +414,7 @@ function useCollaborativeState({
414
414
  canvasWidth,
415
415
  canvasHeight
416
416
  }) {
417
- const userColor = chunk6QGTRYSC_js.sanitizeColor(config?.userColor, "#6366f1");
417
+ const userColor = chunkUSAJMMF2_js.sanitizeColor(config?.userColor, "#6366f1");
418
418
  const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
419
419
  const { remoteUsers, broadcastPresence } = usePresenceTracking({
420
420
  awareness,
@@ -523,8 +523,8 @@ function useEditorHistory(input) {
523
523
  width: canvasSize.width,
524
524
  height: canvasSize.height,
525
525
  activeSlideIndex,
526
- slides: slides.map(chunk6QGTRYSC_js.cloneSlide),
527
- templateElementsBySlideId: chunk6QGTRYSC_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
526
+ slides: slides.map(chunkUSAJMMF2_js.cloneSlide),
527
+ templateElementsBySlideId: chunkUSAJMMF2_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
528
528
  ...actionLabel ? { actionLabel } : {}
529
529
  };
530
530
  },
@@ -537,9 +537,9 @@ function useEditorHistory(input) {
537
537
  width: snapshot.width,
538
538
  height: snapshot.height
539
539
  });
540
- setSlides(snapshot.slides.map(chunk6QGTRYSC_js.cloneSlide));
540
+ setSlides(snapshot.slides.map(chunkUSAJMMF2_js.cloneSlide));
541
541
  setTemplateElementsBySlideId(
542
- chunk6QGTRYSC_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
542
+ chunkUSAJMMF2_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
543
543
  );
544
544
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
545
545
  setSelectedElementIds([]);
@@ -573,8 +573,8 @@ function useEditorHistory(input) {
573
573
  const currentSnapshot = buildHistorySnapshot();
574
574
  historyFutureRef.current.push(currentSnapshot);
575
575
  isApplyingHistoryRef.current = true;
576
- const nextSnapshot = chunkP65VL2I6_js.cloneHistorySnapshot(previousSnapshot);
577
- lastHistorySnapshotRef.current = chunkP65VL2I6_js.cloneHistorySnapshot(nextSnapshot);
576
+ const nextSnapshot = chunkNFJLF7TX_js.cloneHistorySnapshot(previousSnapshot);
577
+ lastHistorySnapshotRef.current = chunkNFJLF7TX_js.cloneHistorySnapshot(nextSnapshot);
578
578
  lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
579
579
  applyHistorySnapshot(nextSnapshot);
580
580
  updateHistoryAvailability();
@@ -595,8 +595,8 @@ function useEditorHistory(input) {
595
595
  const currentSnapshot = buildHistorySnapshot();
596
596
  historyPastRef.current.push(currentSnapshot);
597
597
  isApplyingHistoryRef.current = true;
598
- const targetSnapshot = chunkP65VL2I6_js.cloneHistorySnapshot(nextSnapshot);
599
- lastHistorySnapshotRef.current = chunkP65VL2I6_js.cloneHistorySnapshot(targetSnapshot);
598
+ const targetSnapshot = chunkNFJLF7TX_js.cloneHistorySnapshot(nextSnapshot);
599
+ lastHistorySnapshotRef.current = chunkNFJLF7TX_js.cloneHistorySnapshot(targetSnapshot);
600
600
  lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
601
601
  applyHistorySnapshot(targetSnapshot);
602
602
  updateHistoryAvailability();
@@ -614,7 +614,7 @@ function useEditorHistory(input) {
614
614
  historyPastRef.current = [];
615
615
  historyFutureRef.current = [];
616
616
  if (initialSnapshot) {
617
- const clonedInitial = chunkP65VL2I6_js.cloneHistorySnapshot(initialSnapshot);
617
+ const clonedInitial = chunkNFJLF7TX_js.cloneHistorySnapshot(initialSnapshot);
618
618
  lastHistorySnapshotRef.current = clonedInitial;
619
619
  lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
620
620
  } else {
@@ -655,18 +655,18 @@ function useEditorHistory(input) {
655
655
  }
656
656
  const previousSnapshot = lastHistorySnapshotRef.current;
657
657
  if (!previousSnapshot) {
658
- lastHistorySnapshotRef.current = chunkP65VL2I6_js.cloneHistorySnapshot(snapshot);
658
+ lastHistorySnapshotRef.current = chunkNFJLF7TX_js.cloneHistorySnapshot(snapshot);
659
659
  lastHistorySerializedRef.current = serialized;
660
660
  lastCheapHashRef.current = cheapHash;
661
661
  updateHistoryAvailability();
662
662
  return;
663
663
  }
664
- historyPastRef.current.push(chunkP65VL2I6_js.cloneHistorySnapshot(previousSnapshot));
664
+ historyPastRef.current.push(chunkNFJLF7TX_js.cloneHistorySnapshot(previousSnapshot));
665
665
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
666
666
  historyPastRef.current.shift();
667
667
  }
668
668
  historyFutureRef.current = [];
669
- lastHistorySnapshotRef.current = chunkP65VL2I6_js.cloneHistorySnapshot(snapshot);
669
+ lastHistorySnapshotRef.current = chunkNFJLF7TX_js.cloneHistorySnapshot(snapshot);
670
670
  lastHistorySerializedRef.current = serialized;
671
671
  lastCheapHashRef.current = cheapHash;
672
672
  updateHistoryAvailability();
@@ -726,9 +726,9 @@ function useZoomViewport({
726
726
  const canvasStageRef = react.useRef(null);
727
727
  const canvasViewportRef = react.useRef(null);
728
728
  const renderScaleRef = react.useRef(1);
729
- const wheelBufferRef = react.useRef(chunk6QGTRYSC_js.createWheelStepBuffer());
729
+ const wheelBufferRef = react.useRef(chunkUSAJMMF2_js.createWheelStepBuffer());
730
730
  const storeRef = react.useRef(null);
731
- storeRef.current ??= chunk6QGTRYSC_js.createViewerZoomStore();
731
+ storeRef.current ??= chunkUSAJMMF2_js.createViewerZoomStore();
732
732
  const store = storeRef.current;
733
733
  const scale = useViewerStore(store, selectZoom);
734
734
  const setScale = react.useCallback(
@@ -789,7 +789,7 @@ function useZoomViewport({
789
789
  if (!wrapper || !canvasViewport) {
790
790
  return;
791
791
  }
792
- const boundedScale = chunk6QGTRYSC_js.clampZoomScale(nextScale);
792
+ const boundedScale = chunkUSAJMMF2_js.clampZoomScale(nextScale);
793
793
  const nextEditorScale = fitScale * boundedScale;
794
794
  const centerX = (bounds.minX + bounds.maxX) / 2;
795
795
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -826,29 +826,29 @@ function useZoomViewport({
826
826
  selectedElements.forEach((element) => {
827
827
  minX = Math.min(minX, element.x);
828
828
  minY = Math.min(minY, element.y);
829
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunkP65VL2I6_js.MIN_ELEMENT_SIZE));
830
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunkP65VL2I6_js.MIN_ELEMENT_SIZE));
829
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE));
830
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE));
831
831
  });
832
832
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
833
833
  return;
834
834
  }
835
835
  const selectionBounds = { minX, minY, maxX, maxY };
836
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkP65VL2I6_js.MIN_ELEMENT_SIZE);
837
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkP65VL2I6_js.MIN_ELEMENT_SIZE);
836
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE);
837
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE);
838
838
  const availableWidth = Math.max(
839
- effectiveEditorDimensions.width - chunkP65VL2I6_js.ZOOM_TO_SELECTION_PADDING,
840
- chunkP65VL2I6_js.MIN_ELEMENT_SIZE
839
+ effectiveEditorDimensions.width - chunkNFJLF7TX_js.ZOOM_TO_SELECTION_PADDING,
840
+ chunkNFJLF7TX_js.MIN_ELEMENT_SIZE
841
841
  );
842
842
  const availableHeight = Math.max(
843
- effectiveEditorDimensions.height - chunkP65VL2I6_js.ZOOM_TO_SELECTION_PADDING,
844
- chunkP65VL2I6_js.MIN_ELEMENT_SIZE
843
+ effectiveEditorDimensions.height - chunkNFJLF7TX_js.ZOOM_TO_SELECTION_PADDING,
844
+ chunkNFJLF7TX_js.MIN_ELEMENT_SIZE
845
845
  );
846
846
  const targetEditorScale = Math.min(
847
847
  availableWidth / boundsWidth,
848
848
  availableHeight / boundsHeight
849
849
  );
850
850
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
851
- const nextScale = chunk6QGTRYSC_js.clampZoomScale(targetEditorScale / safeFitScale);
851
+ const nextScale = chunkUSAJMMF2_js.clampZoomScale(targetEditorScale / safeFitScale);
852
852
  setScale(nextScale);
853
853
  window.requestAnimationFrame(() => {
854
854
  window.requestAnimationFrame(() => {
@@ -865,14 +865,14 @@ function useZoomViewport({
865
865
  ]);
866
866
  const handleWheel = react.useCallback(
867
867
  (event) => {
868
- const mapped = chunk6QGTRYSC_js.mapEditingWheel(event, wheelBufferRef.current, true);
868
+ const mapped = chunkUSAJMMF2_js.mapEditingWheel(event, wheelBufferRef.current, true);
869
869
  if (mapped.intent !== "zoom") {
870
870
  return;
871
871
  }
872
872
  event.preventDefault();
873
873
  store.dispatch({
874
874
  type: "set-zoom",
875
- zoom: chunk6QGTRYSC_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
875
+ zoom: chunkUSAJMMF2_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
876
876
  });
877
877
  },
878
878
  [store]
@@ -960,7 +960,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
960
960
  const command = step.command;
961
961
  const timer = window.setTimeout(
962
962
  () => {
963
- chunkP65VL2I6_js.executeMediaCommand(command);
963
+ chunkNFJLF7TX_js.executeMediaCommand(command);
964
964
  },
965
965
  Math.max(0, step.delayMs)
966
966
  );
@@ -1097,7 +1097,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1097
1097
  }))
1098
1098
  );
1099
1099
  entranceAnimations.forEach((animation, animationIndex) => {
1100
- const delay = chunk6QGTRYSC_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1100
+ const delay = chunkUSAJMMF2_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1101
1101
  const timer = window.setTimeout(() => {
1102
1102
  setPresentationAnimations(
1103
1103
  (previousAnimations) => previousAnimations.map(
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
1129
1129
  (controller, group) => {
1130
1130
  driveBuildReveal(
1131
1131
  controller,
1132
- chunk6QGTRYSC_js.PresentationAnimationController.collectBuildStepIds(group),
1132
+ chunkUSAJMMF2_js.PresentationAnimationController.collectBuildStepIds(group),
1133
1133
  setPresentationElementStates,
1134
1134
  buildRafRef
1135
1135
  );
@@ -1192,7 +1192,7 @@ function useAnimationPlayback(input) {
1192
1192
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1193
1193
  return;
1194
1194
  }
1195
- const controller = chunk6QGTRYSC_js.PresentationAnimationController.fromSlide(slide);
1195
+ const controller = chunkUSAJMMF2_js.PresentationAnimationController.fromSlide(slide);
1196
1196
  controllerRef.current = controller;
1197
1197
  setPresentationKeyframesCss(controller.keyframesCss);
1198
1198
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1350,12 +1350,12 @@ function useAnimationPlayback(input) {
1350
1350
  presentationTimersRef
1351
1351
  };
1352
1352
  }
1353
- var PRESENTER_CHANNEL_NAME = chunk6QGTRYSC_js.PRESENTATION_CHANNEL_NAME;
1354
- var AUDIENCE_HASH = chunk6QGTRYSC_js.PRESENTATION_HASH;
1355
- var PRESENTER_MSG_ORIGIN = chunk6QGTRYSC_js.PRESENTATION_MESSAGE_ORIGIN;
1356
- var AUDIENCE_NONCE_KEY = chunk6QGTRYSC_js.PRESENTATION_NONCE_KEY;
1353
+ var PRESENTER_CHANNEL_NAME = chunkUSAJMMF2_js.PRESENTATION_CHANNEL_NAME;
1354
+ var AUDIENCE_HASH = chunkUSAJMMF2_js.PRESENTATION_HASH;
1355
+ var PRESENTER_MSG_ORIGIN = chunkUSAJMMF2_js.PRESENTATION_MESSAGE_ORIGIN;
1356
+ var AUDIENCE_NONCE_KEY = chunkUSAJMMF2_js.PRESENTATION_NONCE_KEY;
1357
1357
  function generateSessionId() {
1358
- return chunk6QGTRYSC_js.createPresentationSessionId();
1358
+ return chunkUSAJMMF2_js.createPresentationSessionId();
1359
1359
  }
1360
1360
  function parseAudienceNonce() {
1361
1361
  const hash = window.location.hash;
@@ -1391,7 +1391,7 @@ function usePresenterWindow(input) {
1391
1391
  }, []);
1392
1392
  const swapDisplays = react.useCallback(async () => {
1393
1393
  const audience = audienceWindowRef.current;
1394
- return audience && !audience.closed ? chunk6QGTRYSC_js.swapPresentationWindows(window, audience) : false;
1394
+ return audience && !audience.closed ? chunkUSAJMMF2_js.swapPresentationWindows(window, audience) : false;
1395
1395
  }, []);
1396
1396
  const syncSlideToAudience = react.useCallback(
1397
1397
  (slideIndex) => {
@@ -1455,7 +1455,7 @@ function usePresenterWindow(input) {
1455
1455
  pollTimerRef.current = null;
1456
1456
  }
1457
1457
  if (closingSessionId) {
1458
- void chunk6QGTRYSC_js.clearAudienceContent(closingSessionId);
1458
+ void chunkUSAJMMF2_js.clearAudienceContent(closingSessionId);
1459
1459
  }
1460
1460
  }, [getChannel]);
1461
1461
  const openAudienceWindow = react.useCallback(() => {
@@ -1473,10 +1473,10 @@ function usePresenterWindow(input) {
1473
1473
  audienceWindowRef.current = blankWin;
1474
1474
  const sessionId = generateSessionId();
1475
1475
  sessionIdRef.current = sessionId;
1476
- const audienceUrl = chunk6QGTRYSC_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1477
- void chunk6QGTRYSC_js.resolveAudienceScreenPlacement(window).then((placement) => {
1476
+ const audienceUrl = chunkUSAJMMF2_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1477
+ void chunkUSAJMMF2_js.resolveAudienceScreenPlacement(window).then((placement) => {
1478
1478
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1479
- chunk6QGTRYSC_js.placeAudienceWindow(blankWin, placement);
1479
+ chunkUSAJMMF2_js.placeAudienceWindow(blankWin, placement);
1480
1480
  }
1481
1481
  return void 0;
1482
1482
  });
@@ -1506,7 +1506,7 @@ function usePresenterWindow(input) {
1506
1506
  }
1507
1507
  };
1508
1508
  if (content) {
1509
- void chunk6QGTRYSC_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1509
+ void chunkUSAJMMF2_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1510
1510
  } else {
1511
1511
  navigateOrClose(true);
1512
1512
  }
@@ -1532,7 +1532,7 @@ function usePresenterWindow(input) {
1532
1532
  }
1533
1533
  const handleMessage = (event) => {
1534
1534
  const message = event.data;
1535
- if (chunk6QGTRYSC_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1535
+ if (chunkUSAJMMF2_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1536
1536
  syncStateToAudience(snapshotRef.current);
1537
1537
  }
1538
1538
  };
@@ -1561,7 +1561,7 @@ function usePresenterWindow(input) {
1561
1561
  react.useEffect(() => {
1562
1562
  const handleBeforeUnload = () => {
1563
1563
  if (sessionIdRef.current) {
1564
- void chunk6QGTRYSC_js.clearAudienceContent(sessionIdRef.current);
1564
+ void chunkUSAJMMF2_js.clearAudienceContent(sessionIdRef.current);
1565
1565
  }
1566
1566
  };
1567
1567
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1623,7 +1623,7 @@ function useAudienceMode(input) {
1623
1623
  }
1624
1624
  channel.onmessage = (event) => {
1625
1625
  const data = event.data;
1626
- if (!chunk6QGTRYSC_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1626
+ if (!chunkUSAJMMF2_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1627
1627
  return;
1628
1628
  }
1629
1629
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1639,16 +1639,16 @@ function useAudienceMode(input) {
1639
1639
  }
1640
1640
  if (data.type === "presenter-exit") {
1641
1641
  if (expectedSessionId) {
1642
- void chunk6QGTRYSC_js.clearAudienceContent(expectedSessionId);
1642
+ void chunkUSAJMMF2_js.clearAudienceContent(expectedSessionId);
1643
1643
  }
1644
- if (chunk6QGTRYSC_js.endAudienceDisplay(window)) {
1644
+ if (chunkUSAJMMF2_js.endAudienceDisplay(window)) {
1645
1645
  handlers.onPresenterEnded?.();
1646
1646
  }
1647
1647
  }
1648
1648
  };
1649
1649
  if (expectedSessionId) {
1650
1650
  channel.postMessage({
1651
- origin: chunk6QGTRYSC_js.PRESENTATION_MESSAGE_ORIGIN,
1651
+ origin: chunkUSAJMMF2_js.PRESENTATION_MESSAGE_ORIGIN,
1652
1652
  type: "audience-ready",
1653
1653
  sessionId: expectedSessionId
1654
1654
  });
@@ -1662,7 +1662,7 @@ function useAudienceMode(input) {
1662
1662
  }, []);
1663
1663
  }
1664
1664
  function usePresentationKeyboard(input) {
1665
- const wheelBufferRef = react.useRef(chunk6QGTRYSC_js.createWheelStepBuffer());
1665
+ const wheelBufferRef = react.useRef(chunkUSAJMMF2_js.createWheelStepBuffer());
1666
1666
  const {
1667
1667
  mode,
1668
1668
  movePresentationSlide,
@@ -1682,14 +1682,14 @@ function usePresentationKeyboard(input) {
1682
1682
  presentationSlideIndex,
1683
1683
  setShowRehearsalSummary
1684
1684
  } = input;
1685
- const keyBufferRef = react.useRef(chunk6QGTRYSC_js.createPresentationKeyBuffer());
1685
+ const keyBufferRef = react.useRef(chunkUSAJMMF2_js.createPresentationKeyBuffer());
1686
1686
  react.useEffect(() => {
1687
- if (mode !== "present" || !chunk6QGTRYSC_js.acceptsPresentationInput()) {
1688
- keyBufferRef.current = chunk6QGTRYSC_js.createPresentationKeyBuffer();
1687
+ if (mode !== "present" || !chunkUSAJMMF2_js.acceptsPresentationInput()) {
1688
+ keyBufferRef.current = chunkUSAJMMF2_js.createPresentationKeyBuffer();
1689
1689
  return;
1690
1690
  }
1691
1691
  const handleKeyDown = (event) => {
1692
- const mapped = chunk6QGTRYSC_js.mapPresentationKey(event, keyBufferRef.current);
1692
+ const mapped = chunkUSAJMMF2_js.mapPresentationKey(event, keyBufferRef.current);
1693
1693
  if (mapped.action === "none") {
1694
1694
  return;
1695
1695
  }
@@ -1709,12 +1709,12 @@ function usePresentationKeyboard(input) {
1709
1709
  movePresentationSlide(-1);
1710
1710
  return;
1711
1711
  case "first": {
1712
- const first = chunk6QGTRYSC_js.firstShowSlideIndex(showSlideIndexes);
1712
+ const first = chunkUSAJMMF2_js.firstShowSlideIndex(showSlideIndexes);
1713
1713
  navigateToSlide(first ?? 0);
1714
1714
  return;
1715
1715
  }
1716
1716
  case "last": {
1717
- const last = chunk6QGTRYSC_js.lastShowSlideIndex(showSlideIndexes);
1717
+ const last = chunkUSAJMMF2_js.lastShowSlideIndex(showSlideIndexes);
1718
1718
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1719
1719
  return;
1720
1720
  }
@@ -1749,10 +1749,10 @@ function usePresentationKeyboard(input) {
1749
1749
  }
1750
1750
  };
1751
1751
  const handleWheel = (event) => {
1752
- if (mode !== "present" || !chunk6QGTRYSC_js.acceptsPresentationInput()) {
1752
+ if (mode !== "present" || !chunkUSAJMMF2_js.acceptsPresentationInput()) {
1753
1753
  return;
1754
1754
  }
1755
- const mapped = chunk6QGTRYSC_js.mapPresentationWheel(event, wheelBufferRef.current);
1755
+ const mapped = chunkUSAJMMF2_js.mapPresentationWheel(event, wheelBufferRef.current);
1756
1756
  if (mapped.intent === "next-slide") {
1757
1757
  event.preventDefault();
1758
1758
  movePresentationSlide(1);
@@ -1884,7 +1884,7 @@ function useRehearsalTimings(input) {
1884
1884
 
1885
1885
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1886
1886
  function handlePresentationActionImpl(action, deps) {
1887
- chunk6QGTRYSC_js.runPresentationAction(
1887
+ chunkUSAJMMF2_js.runPresentationAction(
1888
1888
  action,
1889
1889
  { slideCount: deps.slidesLength },
1890
1890
  {
@@ -1906,7 +1906,7 @@ function handlePresentationActionImpl(action, deps) {
1906
1906
  function executeSlideTransition(nextSlideIndex, deps) {
1907
1907
  const incomingSlide = deps.slides[nextSlideIndex];
1908
1908
  const transition = incomingSlide?.transition;
1909
- const durationMs = deps.playTransition ? chunk6QGTRYSC_js.resolveTransitionDurationMs(transition) : 0;
1909
+ const durationMs = deps.playTransition ? chunkUSAJMMF2_js.resolveTransitionDurationMs(transition) : 0;
1910
1910
  deps.clearPresentationTimers();
1911
1911
  deps.setPresentationSlideIndex(nextSlideIndex);
1912
1912
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -1965,7 +1965,7 @@ function useSlideNavigation(input) {
1965
1965
  });
1966
1966
  const scheduleAutoAdvanceForSlide = react.useCallback(
1967
1967
  (slideIndex) => {
1968
- const delayMs = chunk6QGTRYSC_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1968
+ const delayMs = chunkUSAJMMF2_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1969
1969
  if (delayMs === void 0) {
1970
1970
  return;
1971
1971
  }
@@ -1988,7 +1988,7 @@ function useSlideNavigation(input) {
1988
1988
  if (availableSlideIndexes.length === 0) {
1989
1989
  return;
1990
1990
  }
1991
- const pastLastSlide = direction === 1 && !chunk6QGTRYSC_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1991
+ const pastLastSlide = direction === 1 && !chunkUSAJMMF2_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1992
1992
  if (rehearsing && pastLastSlide) {
1993
1993
  recordCurrentSlideTime(presentationSlideIndex);
1994
1994
  try {
@@ -2006,9 +2006,9 @@ function useSlideNavigation(input) {
2006
2006
  onAdvancePastLastSlide();
2007
2007
  return;
2008
2008
  }
2009
- const nextSlideIndex = direction === 1 ? chunk6QGTRYSC_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2009
+ const nextSlideIndex = direction === 1 ? chunkUSAJMMF2_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2010
2010
  loop: Boolean(loopContinuously) && !rehearsing
2011
- }) : chunk6QGTRYSC_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2011
+ }) : chunkUSAJMMF2_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2012
2012
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2013
2013
  return;
2014
2014
  }
@@ -2153,22 +2153,22 @@ function useZoomNavigation(input) {
2153
2153
  };
2154
2154
  }
2155
2155
  function usePresenterConsole(slideIndex, active) {
2156
- const timerRef = react.useRef(chunk6QGTRYSC_js.createPresenterTimer());
2157
- const [snapshot, setSnapshot] = react.useState(() => chunk6QGTRYSC_js.createInitialPresentationSnapshot(slideIndex));
2156
+ const timerRef = react.useRef(chunkUSAJMMF2_js.createPresenterTimer());
2157
+ const [snapshot, setSnapshot] = react.useState(() => chunkUSAJMMF2_js.createInitialPresentationSnapshot(slideIndex));
2158
2158
  const patch = react.useCallback((value) => {
2159
- setSnapshot((current) => chunk6QGTRYSC_js.mergePresentationSnapshot(current, value));
2159
+ setSnapshot((current) => chunkUSAJMMF2_js.mergePresentationSnapshot(current, value));
2160
2160
  }, []);
2161
2161
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2162
2162
  react.useEffect(() => {
2163
2163
  if (!active) {
2164
2164
  return;
2165
2165
  }
2166
- timerRef.current = chunk6QGTRYSC_js.resetPresenterTimer();
2166
+ timerRef.current = chunkUSAJMMF2_js.resetPresenterTimer();
2167
2167
  patch({ paused: false, elapsedMs: 0 });
2168
2168
  const timer = window.setInterval(() => {
2169
2169
  patch({
2170
2170
  paused: timerRef.current.paused,
2171
- elapsedMs: chunk6QGTRYSC_js.presenterElapsed(timerRef.current)
2171
+ elapsedMs: chunkUSAJMMF2_js.presenterElapsed(timerRef.current)
2172
2172
  });
2173
2173
  }, 1e3);
2174
2174
  return () => window.clearInterval(timer);
@@ -2178,19 +2178,19 @@ function usePresenterConsole(slideIndex, active) {
2178
2178
  applyAudienceSnapshot: setSnapshot,
2179
2179
  setBlackout: (blackout) => patch({ blackout }),
2180
2180
  toggleTimer: () => {
2181
- timerRef.current = chunk6QGTRYSC_js.togglePresenterTimer(timerRef.current);
2181
+ timerRef.current = chunkUSAJMMF2_js.togglePresenterTimer(timerRef.current);
2182
2182
  patch({
2183
2183
  paused: timerRef.current.paused,
2184
- elapsedMs: chunk6QGTRYSC_js.presenterElapsed(timerRef.current)
2184
+ elapsedMs: chunkUSAJMMF2_js.presenterElapsed(timerRef.current)
2185
2185
  });
2186
2186
  },
2187
2187
  resetTimer: () => {
2188
- timerRef.current = chunk6QGTRYSC_js.resetPresenterTimer();
2188
+ timerRef.current = chunkUSAJMMF2_js.resetPresenterTimer();
2189
2189
  patch({ paused: false, elapsedMs: 0 });
2190
2190
  },
2191
2191
  stepZoom: (direction) => setSnapshot(
2192
- (current) => chunk6QGTRYSC_js.mergePresentationSnapshot(current, {
2193
- zoom: chunk6QGTRYSC_js.stepPresenterZoom(
2192
+ (current) => chunkUSAJMMF2_js.mergePresentationSnapshot(current, {
2193
+ zoom: chunkUSAJMMF2_js.stepPresenterZoom(
2194
2194
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2195
2195
  direction
2196
2196
  )
@@ -2235,7 +2235,7 @@ function usePresentationMode(input) {
2235
2235
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2236
2236
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2237
2237
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2238
- const showGuard = react.useMemo(() => chunk6QGTRYSC_js.createPresenterShowGuard(), []);
2238
+ const showGuard = react.useMemo(() => chunkUSAJMMF2_js.createPresenterShowGuard(), []);
2239
2239
  const {
2240
2240
  presentationAnimations,
2241
2241
  presentationElementStates,
@@ -2314,7 +2314,7 @@ function usePresentationMode(input) {
2314
2314
  });
2315
2315
  const movePresentationSlide = react.useCallback(
2316
2316
  (direction, trigger = "explicit") => {
2317
- if (!chunk6QGTRYSC_js.acceptsPresentationInput()) {
2317
+ if (!chunkUSAJMMF2_js.acceptsPresentationInput()) {
2318
2318
  return;
2319
2319
  }
2320
2320
  if (endOfShowVisible) {
@@ -2451,7 +2451,7 @@ function usePresentationMode(input) {
2451
2451
  if (mode !== "present") {
2452
2452
  return;
2453
2453
  }
2454
- return chunk6QGTRYSC_js.attachPresentationVisibilityPause({
2454
+ return chunkUSAJMMF2_js.attachPresentationVisibilityPause({
2455
2455
  root: containerRef.current ?? void 0,
2456
2456
  onHidden: () => clearPresentationTimersRef.current(),
2457
2457
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2531,11 +2531,11 @@ function usePresentationMode(input) {
2531
2531
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2532
2532
  return void 0;
2533
2533
  }
2534
- return chunk6QGTRYSC_js.buildMorphTransitionPlan(
2534
+ return chunkUSAJMMF2_js.buildMorphTransitionPlan(
2535
2535
  slides[transitionOverlay.outgoingSlideIndex],
2536
2536
  slides[transitionOverlay.incomingSlideIndex],
2537
2537
  transitionOverlay.durationMs,
2538
- chunk6QGTRYSC_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2538
+ chunkUSAJMMF2_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2539
2539
  );
2540
2540
  }, [transitionOverlay, slides]);
2541
2541
  const morphedElementStates = react.useMemo(() => {
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
2556
2556
  if (!morphPlan) {
2557
2557
  return presentationKeyframesCss;
2558
2558
  }
2559
- const imageRules = chunk6QGTRYSC_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2559
+ const imageRules = chunkUSAJMMF2_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2560
2560
  return `${presentationKeyframesCss ?? ""}
2561
2561
  ${morphPlan.keyframesCss}
2562
2562
  ${imageRules}`;
@@ -2837,93 +2837,6 @@ function usePresentationAnnotations(input) {
2837
2837
  clearAllAnnotations
2838
2838
  };
2839
2839
  }
2840
- function findInSlides(slides, findQuery, findMatchCase) {
2841
- if (!findQuery) {
2842
- return [];
2843
- }
2844
- const results = [];
2845
- const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
2846
- slides.forEach((slide, slideIndex) => {
2847
- for (const element of slide.elements || []) {
2848
- if (!chunk6QGTRYSC_js.hasTextProperties(element)) {
2849
- continue;
2850
- }
2851
- const segments = element.textSegments ?? [];
2852
- segments.forEach((seg, segIndex) => {
2853
- const text = findMatchCase ? seg.text : (seg.text || "").toLowerCase();
2854
- let offset = 0;
2855
- while (offset < text.length) {
2856
- const pos = text.indexOf(normalised, offset);
2857
- if (pos === -1) {
2858
- break;
2859
- }
2860
- results.push({
2861
- slideIndex,
2862
- elementId: element.id,
2863
- segmentIndex: segIndex,
2864
- startOffset: pos,
2865
- length: findQuery.length
2866
- });
2867
- offset = pos + 1;
2868
- }
2869
- });
2870
- }
2871
- });
2872
- return results;
2873
- }
2874
- function applyFindReplacements(slides, toReplace, replaceQuery) {
2875
- if (toReplace.length === 0) {
2876
- return slides;
2877
- }
2878
- const nextSlides = [...slides];
2879
- const grouped = /* @__PURE__ */ new Map();
2880
- for (const match of toReplace) {
2881
- const key = `${match.slideIndex}::${match.elementId}::${match.segmentIndex}`;
2882
- if (!grouped.has(key)) {
2883
- grouped.set(key, []);
2884
- }
2885
- grouped.get(key).push(match);
2886
- }
2887
- for (const [, matches] of grouped) {
2888
- const sorted = [...matches].sort((a, b) => b.startOffset - a.startOffset);
2889
- for (const match of sorted) {
2890
- const slide = nextSlides[match.slideIndex];
2891
- if (!slide) {
2892
- continue;
2893
- }
2894
- const elIdx = (slide.elements || []).findIndex((e) => e.id === match.elementId);
2895
- if (elIdx === -1) {
2896
- continue;
2897
- }
2898
- const element = slide.elements[elIdx];
2899
- if (!chunk6QGTRYSC_js.hasTextProperties(element)) {
2900
- continue;
2901
- }
2902
- const segments = [...element.textSegments ?? []];
2903
- const seg = segments[match.segmentIndex];
2904
- if (!seg) {
2905
- continue;
2906
- }
2907
- const before = seg.text.slice(0, match.startOffset);
2908
- const after = seg.text.slice(match.startOffset + match.length);
2909
- segments[match.segmentIndex] = {
2910
- ...seg,
2911
- text: before + replaceQuery + after
2912
- };
2913
- const nextElements = [...slide.elements];
2914
- nextElements[elIdx] = {
2915
- ...element,
2916
- text: segments.map((s) => s.text).join(""),
2917
- textSegments: segments
2918
- };
2919
- nextSlides[match.slideIndex] = {
2920
- ...slide,
2921
- elements: nextElements
2922
- };
2923
- }
2924
- }
2925
- return nextSlides;
2926
- }
2927
2840
  function useFindReplace({
2928
2841
  slides,
2929
2842
  mode,
@@ -2939,7 +2852,7 @@ function useFindReplace({
2939
2852
  const [findResults, setFindResults] = react.useState([]);
2940
2853
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2941
2854
  const performFind = react.useCallback(() => {
2942
- const results = findInSlides(slides, findQuery, findMatchCase);
2855
+ const results = chunkUSAJMMF2_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2943
2856
  if (!findQuery) {
2944
2857
  setFindResults([]);
2945
2858
  setFindResultIndex(-1);
@@ -2972,7 +2885,9 @@ function useFindReplace({
2972
2885
  if (toReplace.length === 0) {
2973
2886
  return;
2974
2887
  }
2975
- onUpdateSlides((prevSlides) => applyFindReplacements(prevSlides, toReplace, replaceQuery));
2888
+ onUpdateSlides(
2889
+ (prevSlides) => chunkUSAJMMF2_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2890
+ );
2976
2891
  onMarkDirty();
2977
2892
  },
2978
2893
  [replaceQuery, onUpdateSlides, onMarkDirty]
@@ -3495,7 +3410,7 @@ function useViewerCoreState(_input) {
3495
3410
  const marqueeStateRef = react.useRef(null);
3496
3411
  const isDrawingRef = react.useRef(false);
3497
3412
  const justInteractedRef = react.useRef(false);
3498
- const livePatcher = react.useMemo(() => chunk6QGTRYSC_js.createCollaborationLivePatcher(), []);
3413
+ const livePatcher = react.useMemo(() => chunkUSAJMMF2_js.createCollaborationLivePatcher(), []);
3499
3414
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3500
3415
  const slidesRef = react.useRef([]);
3501
3416
  const [mode, setMode] = react.useState("edit");
@@ -3504,8 +3419,8 @@ function useViewerCoreState(_input) {
3504
3419
  const [slides, setSlides] = react.useState([]);
3505
3420
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3506
3421
  const [canvasSize, setCanvasSize] = react.useState({
3507
- width: chunkP65VL2I6_js.DEFAULT_CANVAS_WIDTH,
3508
- height: chunkP65VL2I6_js.DEFAULT_CANVAS_HEIGHT
3422
+ width: chunkNFJLF7TX_js.DEFAULT_CANVAS_WIDTH,
3423
+ height: chunkNFJLF7TX_js.DEFAULT_CANVAS_HEIGHT
3509
3424
  });
3510
3425
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
3511
3426
  const [selectedElementId, setSelectedElementId] = react.useState(null);
@@ -3525,7 +3440,7 @@ function useViewerCoreState(_input) {
3525
3440
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3526
3441
  inlineEditingTextRef.current = resolved;
3527
3442
  setInlineEditingTextBase(value);
3528
- chunk6QGTRYSC_js.publishLiveInlineText(
3443
+ chunkUSAJMMF2_js.publishLiveInlineText(
3529
3444
  livePatcher,
3530
3445
  slidesRef.current[activeSlideIndexRef.current],
3531
3446
  inlineEditingElementIdRef.current,
@@ -3860,7 +3775,7 @@ function useLoadContent({
3860
3775
  );
3861
3776
  }
3862
3777
  const previousHandler = handlerRef.current;
3863
- const handler = new chunk6QGTRYSC_js.PptxHandler();
3778
+ const handler = new chunkUSAJMMF2_js.PptxHandler();
3864
3779
  const parsed = await handler.load(buffer);
3865
3780
  if (cancelled || token !== renderTokenRef.current) {
3866
3781
  handler.dispose();
@@ -3872,7 +3787,7 @@ function useLoadContent({
3872
3787
  handlerRef.current = null;
3873
3788
  const mediaElements = [];
3874
3789
  for (const slide of parsed.slides) {
3875
- chunk6QGTRYSC_js.collectMediaElements(slide.elements, mediaElements);
3790
+ chunkUSAJMMF2_js.collectMediaElements(slide.elements, mediaElements);
3876
3791
  }
3877
3792
  for (const url of mediaDataUrls.values()) {
3878
3793
  if (url.startsWith("blob:")) {
@@ -3913,7 +3828,7 @@ function useLoadContent({
3913
3828
  }
3914
3829
  })
3915
3830
  );
3916
- const { paths: imagePaths, refs: imageRefs } = chunk6QGTRYSC_js.collectImagePaths(parsed.slides);
3831
+ const { paths: imagePaths, refs: imageRefs } = chunkUSAJMMF2_js.collectImagePaths(parsed.slides);
3917
3832
  let nextSlides = parsed.slides;
3918
3833
  if (imagePaths.size > 0) {
3919
3834
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3968,12 +3883,12 @@ function useLoadContent({
3968
3883
  }
3969
3884
  }
3970
3885
  handlerRef.current = handler;
3971
- const partition = chunkP65VL2I6_js.partitionTemplateElements(nextSlides);
3886
+ const partition = chunkUSAJMMF2_js.partitionTemplateElements(nextSlides);
3972
3887
  setSlides(partition.slides);
3973
3888
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
3974
3889
  setCanvasSize({
3975
- width: parsed.width ?? chunkP65VL2I6_js.DEFAULT_CANVAS_WIDTH,
3976
- height: parsed.height ?? chunkP65VL2I6_js.DEFAULT_CANVAS_HEIGHT
3890
+ width: parsed.width ?? chunkNFJLF7TX_js.DEFAULT_CANVAS_WIDTH,
3891
+ height: parsed.height ?? chunkNFJLF7TX_js.DEFAULT_CANVAS_HEIGHT
3977
3892
  });
3978
3893
  setHeaderFooter(parsed.headerFooter ?? {});
3979
3894
  setLayoutOptions(parsed.layoutOptions ?? []);
@@ -4002,7 +3917,7 @@ function useLoadContent({
4002
3917
  setHasMacros(parsed.hasMacros === true);
4003
3918
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
4004
3919
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
4005
- setGuides(chunk6QGTRYSC_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3920
+ setGuides(chunkUSAJMMF2_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
4006
3921
  setActiveSlideIndex(0);
4007
3922
  clearSelection();
4008
3923
  setIsDirty(false);
@@ -4010,7 +3925,7 @@ function useLoadContent({
4010
3925
  onContentApplied?.();
4011
3926
  } catch (err) {
4012
3927
  if (!cancelled && token === renderTokenRef.current) {
4013
- if (err instanceof chunk6QGTRYSC_js.EncryptedFileError) {
3928
+ if (err instanceof chunkUSAJMMF2_js.EncryptedFileError) {
4014
3929
  setIsEncrypted(true);
4015
3930
  } else {
4016
3931
  setError(err instanceof Error ? err.message : String(err));
@@ -4087,7 +4002,7 @@ function useAutosave(input) {
4087
4002
  isSavingRef.current = false;
4088
4003
  return;
4089
4004
  }
4090
- await chunk6QGTRYSC_js.saveAutosaveSnapshot(filePathRef.current, data);
4005
+ await chunkUSAJMMF2_js.saveAutosaveSnapshot(filePathRef.current, data);
4091
4006
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4092
4007
  } catch (err) {
4093
4008
  setAutosaveStatus({
@@ -4152,7 +4067,7 @@ function useElementOperations(input) {
4152
4067
  }, [applySelection, setInlineEditingElementId, setContextMenuState]);
4153
4068
  const updateElementById = react.useCallback(
4154
4069
  (elementId, updates) => {
4155
- if (chunk6QGTRYSC_js.isTemplateElementId(elementId)) {
4070
+ if (chunkUSAJMMF2_js.isTemplateElementId(elementId)) {
4156
4071
  const slideId = activeSlide?.id;
4157
4072
  if (slideId) {
4158
4073
  setTemplateElementsBySlideId((prev) => ({
@@ -4192,7 +4107,7 @@ function useElementOperations(input) {
4192
4107
  );
4193
4108
  const updateSelectedShapeStyle = react.useCallback(
4194
4109
  (updates) => {
4195
- if (!selectedElement || !chunk6QGTRYSC_js.hasShapeProperties(selectedElement)) {
4110
+ if (!selectedElement || !chunkUSAJMMF2_js.hasShapeProperties(selectedElement)) {
4196
4111
  return;
4197
4112
  }
4198
4113
  updateSelectedElement({
@@ -4203,17 +4118,17 @@ function useElementOperations(input) {
4203
4118
  );
4204
4119
  const updateSelectedTextStyle = react.useCallback(
4205
4120
  (updates) => {
4206
- if (!selectedElement || !chunk6QGTRYSC_js.hasTextProperties(selectedElement)) {
4121
+ if (!selectedElement || !chunkUSAJMMF2_js.hasTextProperties(selectedElement)) {
4207
4122
  return;
4208
4123
  }
4209
- const inlineSel = chunk6QGTRYSC_js.getInlineEditorSelection(selectedElement.textSegments);
4124
+ const inlineSel = chunkUSAJMMF2_js.getInlineEditorSelection(selectedElement.textSegments);
4210
4125
  if (inlineSel && selectedElement.textSegments) {
4211
- const { newSegments: newSegments2, newSelection } = chunk6QGTRYSC_js.applyStyleToSelectedSegments(
4126
+ const { newSegments: newSegments2, newSelection } = chunkUSAJMMF2_js.applyStyleToSelectedSegments(
4212
4127
  selectedElement.textSegments,
4213
4128
  inlineSel,
4214
4129
  updates
4215
4130
  );
4216
- chunk6QGTRYSC_js.setPendingSelectionRestore(newSelection);
4131
+ chunkUSAJMMF2_js.setPendingSelectionRestore(newSelection);
4217
4132
  updateSelectedElement({
4218
4133
  textSegments: newSegments2
4219
4134
  });
@@ -4233,12 +4148,12 @@ function useElementOperations(input) {
4233
4148
  );
4234
4149
  const updateSelectedTextCase = react.useCallback(
4235
4150
  (mode) => {
4236
- if (!selectedElement || !chunk6QGTRYSC_js.hasTextProperties(selectedElement)) {
4151
+ if (!selectedElement || !chunkUSAJMMF2_js.hasTextProperties(selectedElement)) {
4237
4152
  return;
4238
4153
  }
4239
- const inlineSel = chunk6QGTRYSC_js.getInlineEditorSelection(selectedElement.textSegments);
4154
+ const inlineSel = chunkUSAJMMF2_js.getInlineEditorSelection(selectedElement.textSegments);
4240
4155
  if (inlineSel && selectedElement.textSegments) {
4241
- const newSegments = chunk6QGTRYSC_js.applyCaseTransformToSegments(
4156
+ const newSegments = chunkUSAJMMF2_js.applyCaseTransformToSegments(
4242
4157
  selectedElement.textSegments,
4243
4158
  inlineSel,
4244
4159
  mode
@@ -4248,14 +4163,14 @@ function useElementOperations(input) {
4248
4163
  }
4249
4164
  const updates = {};
4250
4165
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4251
- updates.textSegments = chunk6QGTRYSC_js.applyCaseTransformToSegments(
4166
+ updates.textSegments = chunkUSAJMMF2_js.applyCaseTransformToSegments(
4252
4167
  selectedElement.textSegments,
4253
4168
  null,
4254
4169
  mode
4255
4170
  );
4256
4171
  }
4257
4172
  if (typeof selectedElement.text === "string") {
4258
- updates.text = chunk6QGTRYSC_js.transformTextCase(selectedElement.text, mode);
4173
+ updates.text = chunkUSAJMMF2_js.transformTextCase(selectedElement.text, mode);
4259
4174
  }
4260
4175
  updateSelectedElement(updates);
4261
4176
  },
@@ -4310,7 +4225,7 @@ function useSectionOperations(input) {
4310
4225
  const { sections, setSections, slides, setSlides, markDirty } = input;
4311
4226
  const addSection2 = react.useCallback(
4312
4227
  (name, afterSlideIndex) => {
4313
- const result = chunk6QGTRYSC_js.addSection(sections, slides, name, afterSlideIndex);
4228
+ const result = chunkUSAJMMF2_js.addSection(sections, slides, name, afterSlideIndex);
4314
4229
  setSlides(result.slides);
4315
4230
  setSections(result.sections);
4316
4231
  markDirty();
@@ -4319,7 +4234,7 @@ function useSectionOperations(input) {
4319
4234
  );
4320
4235
  const renameSection2 = react.useCallback(
4321
4236
  (sectionId, newName) => {
4322
- const result = chunk6QGTRYSC_js.renameSection(sections, slides, sectionId, newName);
4237
+ const result = chunkUSAJMMF2_js.renameSection(sections, slides, sectionId, newName);
4323
4238
  setSections(result.sections);
4324
4239
  setSlides(result.slides);
4325
4240
  markDirty();
@@ -4328,7 +4243,7 @@ function useSectionOperations(input) {
4328
4243
  );
4329
4244
  const deleteSection2 = react.useCallback(
4330
4245
  (sectionId) => {
4331
- const result = chunk6QGTRYSC_js.deleteSection(sections, slides, sectionId);
4246
+ const result = chunkUSAJMMF2_js.deleteSection(sections, slides, sectionId);
4332
4247
  setSections(result.sections);
4333
4248
  setSlides(result.slides);
4334
4249
  markDirty();
@@ -4337,21 +4252,21 @@ function useSectionOperations(input) {
4337
4252
  );
4338
4253
  const moveSectionUp2 = react.useCallback(
4339
4254
  (sectionId) => {
4340
- setSections(chunk6QGTRYSC_js.moveSectionUp(sections, sectionId));
4255
+ setSections(chunkUSAJMMF2_js.moveSectionUp(sections, sectionId));
4341
4256
  markDirty();
4342
4257
  },
4343
4258
  [sections, setSections, markDirty]
4344
4259
  );
4345
4260
  const moveSectionDown2 = react.useCallback(
4346
4261
  (sectionId) => {
4347
- setSections(chunk6QGTRYSC_js.moveSectionDown(sections, sectionId));
4262
+ setSections(chunkUSAJMMF2_js.moveSectionDown(sections, sectionId));
4348
4263
  markDirty();
4349
4264
  },
4350
4265
  [sections, setSections, markDirty]
4351
4266
  );
4352
4267
  const moveSlidesToSection2 = react.useCallback(
4353
4268
  (slideIndexes, targetSectionId) => {
4354
- const result = chunk6QGTRYSC_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4269
+ const result = chunkUSAJMMF2_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4355
4270
  setSlides(result.slides);
4356
4271
  setSections(result.sections);
4357
4272
  markDirty();
@@ -4370,19 +4285,19 @@ function useSectionOperations(input) {
4370
4285
 
4371
4286
  // src/viewer/hooks/pointer-move-handlers.ts
4372
4287
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4373
- const resized = chunk6QGTRYSC_js.applyResize(
4288
+ const resized = chunkUSAJMMF2_js.applyResize(
4374
4289
  { x: startX, y: startY, width: startWidth, height: startHeight },
4375
4290
  handle,
4376
4291
  dx,
4377
4292
  dy,
4378
4293
  1,
4379
- { minSize: chunkP65VL2I6_js.MIN_ELEMENT_SIZE }
4294
+ { minSize: chunkNFJLF7TX_js.MIN_ELEMENT_SIZE }
4380
4295
  );
4381
4296
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4382
4297
  if (!snapToGrid) {
4383
4298
  return box;
4384
4299
  }
4385
- return chunk6QGTRYSC_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkP65VL2I6_js.MIN_ELEMENT_SIZE);
4300
+ return chunkUSAJMMF2_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE);
4386
4301
  }
4387
4302
  function computeAdjustmentValue(startAdjustment, dx, startWidth) {
4388
4303
  const range = startWidth || 200;
@@ -4500,7 +4415,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4500
4415
  width: el.width,
4501
4416
  height: el.height
4502
4417
  }));
4503
- const snapResult = chunk6QGTRYSC_js.computeSnapToShape(
4418
+ const snapResult = chunkUSAJMMF2_js.computeSnapToShape(
4504
4419
  targetX,
4505
4420
  targetY,
4506
4421
  primaryEl.width,
@@ -4539,7 +4454,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4539
4454
  if (live) {
4540
4455
  for (const id of Object.keys(drag.startPositionsById)) {
4541
4456
  const start = drag.startPositionsById[id];
4542
- chunk6QGTRYSC_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4457
+ chunkUSAJMMF2_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4543
4458
  x: start.x + appliedDx,
4544
4459
  y: start.y + appliedDy
4545
4460
  });
@@ -4573,15 +4488,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4573
4488
  if (rs.domEl) {
4574
4489
  rs.domEl.style.left = `${geo.x}px`;
4575
4490
  rs.domEl.style.top = `${geo.y}px`;
4576
- rs.domEl.style.width = `${Math.max(geo.width, chunkP65VL2I6_js.MIN_ELEMENT_SIZE)}px`;
4577
- rs.domEl.style.height = `${Math.max(geo.height, chunkP65VL2I6_js.MIN_ELEMENT_SIZE)}px`;
4491
+ rs.domEl.style.width = `${Math.max(geo.width, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE)}px`;
4492
+ rs.domEl.style.height = `${Math.max(geo.height, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE)}px`;
4578
4493
  }
4579
4494
  if (live) {
4580
- chunk6QGTRYSC_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4495
+ chunkUSAJMMF2_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4581
4496
  x: geo.x,
4582
4497
  y: geo.y,
4583
- width: Math.max(geo.width, chunkP65VL2I6_js.MIN_ELEMENT_SIZE),
4584
- height: Math.max(geo.height, chunkP65VL2I6_js.MIN_ELEMENT_SIZE)
4498
+ width: Math.max(geo.width, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE),
4499
+ height: Math.max(geo.height, chunkNFJLF7TX_js.MIN_ELEMENT_SIZE)
4585
4500
  });
4586
4501
  }
4587
4502
  }
@@ -4662,13 +4577,13 @@ function processPointerUp(input) {
4662
4577
  if (i !== activeSlideIndex) {
4663
4578
  return s;
4664
4579
  }
4665
- const rerouted = chunk6QGTRYSC_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4580
+ const rerouted = chunkUSAJMMF2_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4666
4581
  if (rerouted.length === 0) {
4667
4582
  return s;
4668
4583
  }
4669
4584
  return {
4670
4585
  ...s,
4671
- elements: chunk6QGTRYSC_js.applyReroutedConnectors(s.elements, rerouted)
4586
+ elements: chunkUSAJMMF2_js.applyReroutedConnectors(s.elements, rerouted)
4672
4587
  };
4673
4588
  })
4674
4589
  );
@@ -4693,9 +4608,9 @@ function processPointerUp(input) {
4693
4608
  }
4694
4609
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4695
4610
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4696
- const hitIds = chunk6QGTRYSC_js.computeMarqueeHitIds(marquee, sourceElements);
4611
+ const hitIds = chunkUSAJMMF2_js.computeMarqueeHitIds(marquee, sourceElements);
4697
4612
  if (marquee.additive) {
4698
- const merged = chunk6QGTRYSC_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4613
+ const merged = chunkUSAJMMF2_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4699
4614
  if (merged.length > 0) {
4700
4615
  applySelection(merged[0], merged);
4701
4616
  } else {
@@ -4718,8 +4633,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4718
4633
  }
4719
4634
  return { ...el, x: start.x + dx, y: start.y + dy };
4720
4635
  });
4721
- const rerouted = chunk6QGTRYSC_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4722
- return chunk6QGTRYSC_js.applyReroutedConnectors(movedElements, rerouted);
4636
+ const rerouted = chunkUSAJMMF2_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4637
+ return chunkUSAJMMF2_js.applyReroutedConnectors(movedElements, rerouted);
4723
4638
  };
4724
4639
  if (editTemplateMode) {
4725
4640
  const slideId = activeSlide?.id;
@@ -4876,9 +4791,9 @@ function useCanvasInteractions(input) {
4876
4791
  return;
4877
4792
  }
4878
4793
  const el = elementLookup.get(editId);
4879
- if (el && chunk6QGTRYSC_js.hasTextProperties(el)) {
4794
+ if (el && chunkUSAJMMF2_js.hasTextProperties(el)) {
4880
4795
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
4881
- const newSegments = chunk6QGTRYSC_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4796
+ const newSegments = chunkUSAJMMF2_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4882
4797
  ops.updateElementById(editId, {
4883
4798
  text: committedText,
4884
4799
  textSegments: newSegments
@@ -4889,7 +4804,7 @@ function useCanvasInteractions(input) {
4889
4804
  setInlineEditingText("");
4890
4805
  };
4891
4806
  const openEquationEditorForElement = (el) => {
4892
- if (!chunk6QGTRYSC_js.hasTextProperties(el)) {
4807
+ if (!chunkUSAJMMF2_js.hasTextProperties(el)) {
4893
4808
  return false;
4894
4809
  }
4895
4810
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -4919,7 +4834,7 @@ function useCanvasInteractions(input) {
4919
4834
  justInteractedRef.current = false;
4920
4835
  } else {
4921
4836
  const el = elementLookup.get(elementId);
4922
- if (el && chunk6QGTRYSC_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
4837
+ if (el && chunkUSAJMMF2_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
4923
4838
  if (!openEquationEditorForElement(el)) {
4924
4839
  setInlineEditingElementId(elementId);
4925
4840
  setInlineEditingText(el.text ?? "");
@@ -4938,7 +4853,7 @@ function useCanvasInteractions(input) {
4938
4853
  if (openEquationEditorForElement(el)) {
4939
4854
  return;
4940
4855
  }
4941
- if (chunk6QGTRYSC_js.hasTextProperties(el)) {
4856
+ if (chunkUSAJMMF2_js.hasTextProperties(el)) {
4942
4857
  setInlineEditingElementId(elementId);
4943
4858
  setInlineEditingText(el.text ?? "");
4944
4859
  }
@@ -5131,7 +5046,7 @@ function createFileHandlers(deps) {
5131
5046
  h = Math.round(h * scale);
5132
5047
  }
5133
5048
  addElement({
5134
- id: chunk6QGTRYSC_js.generateElementId(),
5049
+ id: chunkUSAJMMF2_js.generateElementId(),
5135
5050
  type: "image",
5136
5051
  x: Math.round((canvasSize.width - w) / 2),
5137
5052
  y: Math.round((canvasSize.height - h) / 2),
@@ -5142,7 +5057,7 @@ function createFileHandlers(deps) {
5142
5057
  };
5143
5058
  img.onerror = () => {
5144
5059
  addElement({
5145
- id: chunk6QGTRYSC_js.generateElementId(),
5060
+ id: chunkUSAJMMF2_js.generateElementId(),
5146
5061
  type: "image",
5147
5062
  x: 100,
5148
5063
  y: 100,
@@ -5168,7 +5083,7 @@ function createFileHandlers(deps) {
5168
5083
  const elFilePath = file.path;
5169
5084
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5170
5085
  addElement({
5171
- id: chunk6QGTRYSC_js.generateElementId(),
5086
+ id: chunkUSAJMMF2_js.generateElementId(),
5172
5087
  type: "media",
5173
5088
  mediaType,
5174
5089
  mediaMimeType: file.type || void 0,
@@ -5343,13 +5258,13 @@ function createStructuredElementHandlers(deps) {
5343
5258
  return;
5344
5259
  }
5345
5260
  addElement({
5346
- id: chunk6QGTRYSC_js.generateElementId(),
5261
+ id: chunkUSAJMMF2_js.generateElementId(),
5347
5262
  type: "smartArt",
5348
5263
  x: 100,
5349
5264
  y: 120,
5350
5265
  width: 600,
5351
5266
  height: 340,
5352
- smartArtData: chunk6QGTRYSC_js.buildSmartArtPresetData(
5267
+ smartArtData: chunkUSAJMMF2_js.buildSmartArtPresetData(
5353
5268
  layout,
5354
5269
  defaultItems,
5355
5270
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5361,7 +5276,7 @@ function createStructuredElementHandlers(deps) {
5361
5276
  return;
5362
5277
  }
5363
5278
  addElement({
5364
- id: chunk6QGTRYSC_js.generateElementId(),
5279
+ id: chunkUSAJMMF2_js.generateElementId(),
5365
5280
  type: "shape",
5366
5281
  x: 120,
5367
5282
  y: 200,
@@ -5420,7 +5335,7 @@ function createStructuredElementHandlers(deps) {
5420
5335
  const displayText = value || fieldTexts[fieldType] || fieldType;
5421
5336
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5422
5337
  addElement({
5423
- id: chunk6QGTRYSC_js.generateElementId(),
5338
+ id: chunkUSAJMMF2_js.generateElementId(),
5424
5339
  type: "shape",
5425
5340
  x: 120,
5426
5341
  y: 200,
@@ -5442,11 +5357,11 @@ function createStructuredElementHandlers(deps) {
5442
5357
  if (!activeSlide) {
5443
5358
  return;
5444
5359
  }
5445
- const preset = chunk6QGTRYSC_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5360
+ const preset = chunkUSAJMMF2_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5446
5361
  if (!preset) {
5447
5362
  return;
5448
5363
  }
5449
- const defaultPptxAction = chunk6QGTRYSC_js.elementActionToPptxAction({
5364
+ const defaultPptxAction = chunkUSAJMMF2_js.elementActionToPptxAction({
5450
5365
  trigger: "click",
5451
5366
  type: preset.defaultAction
5452
5367
  });
@@ -5455,7 +5370,7 @@ function createStructuredElementHandlers(deps) {
5455
5370
  defaultPptxAction.highlightClick = true;
5456
5371
  }
5457
5372
  addElement({
5458
- id: chunk6QGTRYSC_js.generateElementId(),
5373
+ id: chunkUSAJMMF2_js.generateElementId(),
5459
5374
  type: "shape",
5460
5375
  x: 150,
5461
5376
  y: 150,
@@ -5522,14 +5437,14 @@ function useInsertElements(input) {
5522
5437
  return;
5523
5438
  }
5524
5439
  addElement({
5525
- id: chunk6QGTRYSC_js.generateElementId(),
5440
+ id: chunkUSAJMMF2_js.generateElementId(),
5526
5441
  type: "text",
5527
5442
  x: 100,
5528
5443
  y: 100,
5529
5444
  width: 300,
5530
5445
  height: 60,
5531
5446
  text: "",
5532
- textStyle: { fontSize: chunkP65VL2I6_js.DEFAULT_TEXT_FONT_SIZE }
5447
+ textStyle: { fontSize: chunkNFJLF7TX_js.DEFAULT_TEXT_FONT_SIZE }
5533
5448
  });
5534
5449
  };
5535
5450
  const handleAddShape = () => {
@@ -5537,7 +5452,7 @@ function useInsertElements(input) {
5537
5452
  return;
5538
5453
  }
5539
5454
  addElement({
5540
- id: chunk6QGTRYSC_js.generateElementId(),
5455
+ id: chunkUSAJMMF2_js.generateElementId(),
5541
5456
  type: "shape",
5542
5457
  x: 150,
5543
5458
  y: 150,
@@ -5556,15 +5471,15 @@ function useInsertElements(input) {
5556
5471
  return;
5557
5472
  }
5558
5473
  addElement({
5559
- ...chunk6QGTRYSC_js.newTableElement(chunkP65VL2I6_js.DEFAULT_TABLE_ROWS, chunkP65VL2I6_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5560
- id: chunk6QGTRYSC_js.generateElementId()
5474
+ ...chunkUSAJMMF2_js.newTableElement(chunkNFJLF7TX_js.DEFAULT_TABLE_ROWS, chunkNFJLF7TX_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5475
+ id: chunkUSAJMMF2_js.generateElementId()
5561
5476
  });
5562
5477
  };
5563
5478
  const handleAddChart = (chartKind) => {
5564
5479
  if (!activeSlide) {
5565
5480
  return;
5566
5481
  }
5567
- addElement(chunk6QGTRYSC_js.createDefaultChartElement(chartKind));
5482
+ addElement(chunkUSAJMMF2_js.createDefaultChartElement(chartKind));
5568
5483
  };
5569
5484
  const structured = createStructuredElementHandlers({
5570
5485
  activeSlide,
@@ -5634,7 +5549,7 @@ function useClipboardHandlers(input) {
5634
5549
  if (!selectedElement) {
5635
5550
  return;
5636
5551
  }
5637
- setClipboardPayload(chunk6QGTRYSC_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5552
+ setClipboardPayload(chunkUSAJMMF2_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5638
5553
  };
5639
5554
  const handleDelete = () => {
5640
5555
  const idsToDelete = effectiveSelectedIds;
@@ -5651,7 +5566,7 @@ function useClipboardHandlers(input) {
5651
5566
  handleDelete();
5652
5567
  };
5653
5568
  const insertClone = (source) => {
5654
- const clone = chunk6QGTRYSC_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5569
+ const clone = chunkUSAJMMF2_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5655
5570
  ops.updateActiveElements((els) => [...els, clone]);
5656
5571
  ops.applySelection(clone.id);
5657
5572
  history.markDirty();
@@ -5686,7 +5601,7 @@ function resolveShapePath(el) {
5686
5601
  return el.pathData;
5687
5602
  }
5688
5603
  if ("shapeType" in el && typeof el.shapeType === "string") {
5689
- const clipPath = chunk6QGTRYSC_js.getPresetShapeClipPath(el.shapeType);
5604
+ const clipPath = chunkUSAJMMF2_js.getPresetShapeClipPath(el.shapeType);
5690
5605
  if (clipPath) {
5691
5606
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5692
5607
  if (svgPath) {
@@ -5737,7 +5652,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5737
5652
  return parts.join(" ");
5738
5653
  }
5739
5654
  function transformPathToGlobal(pathData, el) {
5740
- const polys = chunk6QGTRYSC_js.svgPathToPolygons(pathData);
5655
+ const polys = chunkUSAJMMF2_js.svgPathToPolygons(pathData);
5741
5656
  if (polys.length === 0) {
5742
5657
  return pathData;
5743
5658
  }
@@ -5757,10 +5672,10 @@ function transformPathToGlobal(pathData, el) {
5757
5672
  y: pt.y * scaleY + el.y
5758
5673
  }))
5759
5674
  );
5760
- return chunk6QGTRYSC_js.polygonsToSvgPath(transformed);
5675
+ return chunkUSAJMMF2_js.polygonsToSvgPath(transformed);
5761
5676
  }
5762
5677
  function transformPathToLocal(pathData, x, y, _width, _height) {
5763
- const polys = chunk6QGTRYSC_js.svgPathToPolygons(pathData);
5678
+ const polys = chunkUSAJMMF2_js.svgPathToPolygons(pathData);
5764
5679
  if (polys.length === 0) {
5765
5680
  return pathData;
5766
5681
  }
@@ -5770,10 +5685,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5770
5685
  y: pt.y - y
5771
5686
  }))
5772
5687
  );
5773
- return chunk6QGTRYSC_js.polygonsToSvgPath(transformed);
5688
+ return chunkUSAJMMF2_js.polygonsToSvgPath(transformed);
5774
5689
  }
5775
5690
  function pathBounds(pathData) {
5776
- const polys = chunk6QGTRYSC_js.svgPathToPolygons(pathData);
5691
+ const polys = chunkUSAJMMF2_js.svgPathToPolygons(pathData);
5777
5692
  let minX = Infinity;
5778
5693
  let minY = Infinity;
5779
5694
  let maxX = -Infinity;
@@ -5832,7 +5747,7 @@ function useMergeShapesHandler(input) {
5832
5747
  let allFragments = [];
5833
5748
  let remaining = globalPaths[0];
5834
5749
  for (let i = 1; i < globalPaths.length; i++) {
5835
- const frags = chunk6QGTRYSC_js.mergeShapes("fragment", remaining, globalPaths[i]);
5750
+ const frags = chunkUSAJMMF2_js.mergeShapes("fragment", remaining, globalPaths[i]);
5836
5751
  if (Array.isArray(frags)) {
5837
5752
  allFragments = frags;
5838
5753
  }
@@ -5861,7 +5776,7 @@ function useMergeShapesHandler(input) {
5861
5776
  bounds.height
5862
5777
  );
5863
5778
  const newEl = {
5864
- id: chunk6QGTRYSC_js.generateElementId(),
5779
+ id: chunkUSAJMMF2_js.generateElementId(),
5865
5780
  type: "shape",
5866
5781
  x: bounds.x,
5867
5782
  y: bounds.y,
@@ -5899,7 +5814,7 @@ function useMergeShapesHandler(input) {
5899
5814
  } else {
5900
5815
  let resultPath = globalPaths[0];
5901
5816
  for (let i = 1; i < globalPaths.length; i++) {
5902
- const result = chunk6QGTRYSC_js.mergeShapes(operation, resultPath, globalPaths[i]);
5817
+ const result = chunkUSAJMMF2_js.mergeShapes(operation, resultPath, globalPaths[i]);
5903
5818
  if (typeof result === "string") {
5904
5819
  resultPath = result;
5905
5820
  }
@@ -5920,7 +5835,7 @@ function useMergeShapesHandler(input) {
5920
5835
  );
5921
5836
  const primary = targets[0];
5922
5837
  const newEl = {
5923
- id: chunk6QGTRYSC_js.generateElementId(),
5838
+ id: chunkUSAJMMF2_js.generateElementId(),
5924
5839
  type: "shape",
5925
5840
  x: bounds.x,
5926
5841
  y: bounds.y,
@@ -5983,7 +5898,7 @@ function useGroupAlignLayerHandlers(input) {
5983
5898
  if (ids.length < 2 || !activeSlide) {
5984
5899
  return;
5985
5900
  }
5986
- const { elements, groupId } = chunk6QGTRYSC_js.groupElements(ops.activeElements, ids, chunk6QGTRYSC_js.generateElementId());
5901
+ const { elements, groupId } = chunkUSAJMMF2_js.groupElements(ops.activeElements, ids, chunkUSAJMMF2_js.generateElementId());
5987
5902
  if (groupId === null) {
5988
5903
  return;
5989
5904
  }
@@ -5996,12 +5911,12 @@ function useGroupAlignLayerHandlers(input) {
5996
5911
  return;
5997
5912
  }
5998
5913
  const group = selectedElement;
5999
- const intoTemplate = chunk6QGTRYSC_js.isTemplateElementId(group.id);
5914
+ const intoTemplate = chunkUSAJMMF2_js.isTemplateElementId(group.id);
6000
5915
  const ungrouped = group.children.map((child) => ({
6001
5916
  ...structuredClone(child),
6002
5917
  // Keep child ids in the same store as the group so later edits route
6003
5918
  // correctly: template groups yield template-prefixed child ids.
6004
- id: intoTemplate ? chunk6QGTRYSC_js.makeCloneId(true, child.id || group.id) : child.id || chunk6QGTRYSC_js.generateElementId(),
5919
+ id: intoTemplate ? chunkUSAJMMF2_js.makeCloneId(true, child.id || group.id) : child.id || chunkUSAJMMF2_js.generateElementId(),
6005
5920
  x: child.x + group.x,
6006
5921
  y: child.y + group.y
6007
5922
  }));
@@ -6025,7 +5940,7 @@ function useGroupAlignLayerHandlers(input) {
6025
5940
  if (!edge) {
6026
5941
  return;
6027
5942
  }
6028
- const positions = chunk6QGTRYSC_js.alignElements(selectedElements, edge);
5943
+ const positions = chunkUSAJMMF2_js.alignElements(selectedElements, edge);
6029
5944
  for (const [id, pos] of positions) {
6030
5945
  const el = elementLookup.get(id);
6031
5946
  if (!el) {
@@ -6043,7 +5958,7 @@ function useGroupAlignLayerHandlers(input) {
6043
5958
  if (!distAxis) {
6044
5959
  return;
6045
5960
  }
6046
- const positions = chunk6QGTRYSC_js.distributeElements(selectedElements, distAxis);
5961
+ const positions = chunkUSAJMMF2_js.distributeElements(selectedElements, distAxis);
6047
5962
  for (const [id, pos] of positions) {
6048
5963
  const el = elementLookup.get(id);
6049
5964
  if (!el) {
@@ -6060,7 +5975,7 @@ function useGroupAlignLayerHandlers(input) {
6060
5975
  }
6061
5976
  const id = selectedElement.id;
6062
5977
  ops.updateActiveElements(
6063
- (els) => direction === "forward" ? chunk6QGTRYSC_js.bringForward(els, id) : direction === "backward" ? chunk6QGTRYSC_js.sendBackward(els, id) : els
5978
+ (els) => direction === "forward" ? chunkUSAJMMF2_js.bringForward(els, id) : direction === "backward" ? chunkUSAJMMF2_js.sendBackward(els, id) : els
6064
5979
  );
6065
5980
  history.markDirty();
6066
5981
  };
@@ -6070,7 +5985,7 @@ function useGroupAlignLayerHandlers(input) {
6070
5985
  }
6071
5986
  const id = selectedElement.id;
6072
5987
  ops.updateActiveElements(
6073
- (els) => direction === "front" ? chunk6QGTRYSC_js.bringToFront(els, id) : chunk6QGTRYSC_js.sendToBack(els, id)
5988
+ (els) => direction === "front" ? chunkUSAJMMF2_js.bringToFront(els, id) : chunkUSAJMMF2_js.sendToBack(els, id)
6074
5989
  );
6075
5990
  history.markDirty();
6076
5991
  };
@@ -6201,7 +6116,7 @@ function useSlideManagement(input) {
6201
6116
  theme
6202
6117
  } = input;
6203
6118
  const handleAddSlide = () => {
6204
- const newSlide = chunk6QGTRYSC_js.createBlankSlide(slides.length + 1);
6119
+ const newSlide = chunkUSAJMMF2_js.createBlankSlide(slides.length + 1);
6205
6120
  ops.updateSlides((prev) => {
6206
6121
  const next = [...prev];
6207
6122
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6264,7 +6179,7 @@ function useSlideManagement(input) {
6264
6179
  }
6265
6180
  const clone = {
6266
6181
  ...src,
6267
- id: chunk6QGTRYSC_js.makeSlideId(),
6182
+ id: chunkUSAJMMF2_js.makeSlideId(),
6268
6183
  elements: src.elements.map((el) => ({
6269
6184
  ...el,
6270
6185
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6296,7 +6211,7 @@ function useSlideManagement(input) {
6296
6211
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6297
6212
  const insertAt = activeSlideIndex + 1;
6298
6213
  const draft = {
6299
- ...chunk6QGTRYSC_js.createBlankSlide(slides.length + 1),
6214
+ ...chunkUSAJMMF2_js.createBlankSlide(slides.length + 1),
6300
6215
  layoutPath,
6301
6216
  ...layoutName ? { layoutName } : {}
6302
6217
  };
@@ -6329,9 +6244,9 @@ function useSlideManagement(input) {
6329
6244
  };
6330
6245
  const handleInsertSlideFromTemplate = (templateId) => {
6331
6246
  const insertAt = activeSlideIndex + 1;
6332
- const draft = chunk6QGTRYSC_js.buildSlideTemplateSlide(templateId, chunk6QGTRYSC_js.makeSlideId(), slides.length + 1, {
6247
+ const draft = chunkUSAJMMF2_js.buildSlideTemplateSlide(templateId, chunkUSAJMMF2_js.makeSlideId(), slides.length + 1, {
6333
6248
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6334
- scheme: chunk6QGTRYSC_js.templateSchemeFromTheme(theme?.colorScheme)
6249
+ scheme: chunkUSAJMMF2_js.templateSchemeFromTheme(theme?.colorScheme)
6335
6250
  });
6336
6251
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6337
6252
  setActiveSlideIndex(insertAt);
@@ -6368,7 +6283,7 @@ function createTableMergeHandlers(input) {
6368
6283
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6369
6284
  return;
6370
6285
  }
6371
- const newTableData = chunk6QGTRYSC_js.mergeCells(
6286
+ const newTableData = chunkUSAJMMF2_js.mergeCells(
6372
6287
  [
6373
6288
  { row: rowIndex, col: columnIndex },
6374
6289
  { row: rowIndex, col: nextColIdx }
@@ -6376,7 +6291,7 @@ function createTableMergeHandlers(input) {
6376
6291
  td
6377
6292
  );
6378
6293
  const updates = { tableData: newTableData };
6379
- const newRawXml = chunk6QGTRYSC_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6294
+ const newRawXml = chunkUSAJMMF2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6380
6295
  if (newRawXml) {
6381
6296
  updates.rawXml = newRawXml;
6382
6297
  }
@@ -6402,7 +6317,7 @@ function createTableMergeHandlers(input) {
6402
6317
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6403
6318
  return;
6404
6319
  }
6405
- const newTableData = chunk6QGTRYSC_js.mergeCells(
6320
+ const newTableData = chunkUSAJMMF2_js.mergeCells(
6406
6321
  [
6407
6322
  { row: rowIndex, col: columnIndex },
6408
6323
  { row: targetNextRowIdx, col: columnIndex }
@@ -6410,7 +6325,7 @@ function createTableMergeHandlers(input) {
6410
6325
  td
6411
6326
  );
6412
6327
  const updates = { tableData: newTableData };
6413
- const newRawXml = chunk6QGTRYSC_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6328
+ const newRawXml = chunkUSAJMMF2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6414
6329
  if (newRawXml) {
6415
6330
  updates.rawXml = newRawXml;
6416
6331
  }
@@ -6425,9 +6340,9 @@ function createTableMergeHandlers(input) {
6425
6340
  return;
6426
6341
  }
6427
6342
  const td = selectedElement.tableData;
6428
- const newTableData = chunk6QGTRYSC_js.mergeCells(ts.selectedCells, td);
6343
+ const newTableData = chunkUSAJMMF2_js.mergeCells(ts.selectedCells, td);
6429
6344
  const updates = { tableData: newTableData };
6430
- const newRawXml = chunk6QGTRYSC_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6345
+ const newRawXml = chunkUSAJMMF2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6431
6346
  if (newRawXml) {
6432
6347
  updates.rawXml = newRawXml;
6433
6348
  }
@@ -6444,9 +6359,9 @@ function createTableMergeHandlers(input) {
6444
6359
  }
6445
6360
  const { rowIndex, columnIndex } = ts;
6446
6361
  const td = selectedElement.tableData;
6447
- const newTableData = chunk6QGTRYSC_js.splitCell(rowIndex, columnIndex, td);
6362
+ const newTableData = chunkUSAJMMF2_js.splitCell(rowIndex, columnIndex, td);
6448
6363
  const updates = { tableData: newTableData };
6449
- const newRawXml = chunk6QGTRYSC_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6364
+ const newRawXml = chunkUSAJMMF2_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6450
6365
  if (newRawXml) {
6451
6366
  updates.rawXml = newRawXml;
6452
6367
  }
@@ -6490,7 +6405,7 @@ function createTableStructHandlers(input) {
6490
6405
  updates.tableData = { ...el.tableData, rows: newRows };
6491
6406
  }
6492
6407
  if (el.rawXml) {
6493
- const newRawXml = chunk6QGTRYSC_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6408
+ const newRawXml = chunkUSAJMMF2_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6494
6409
  if (newRawXml) {
6495
6410
  updates.rawXml = newRawXml;
6496
6411
  }
@@ -6514,7 +6429,7 @@ function createTableStructHandlers(input) {
6514
6429
  const { rowIndex, columnIndex: colIndex } = ts;
6515
6430
  const updates = {};
6516
6431
  if (selectedElement.rawXml) {
6517
- const newRawXml = chunk6QGTRYSC_js.updateCellTextStyleInRawXml(
6432
+ const newRawXml = chunkUSAJMMF2_js.updateCellTextStyleInRawXml(
6518
6433
  selectedElement,
6519
6434
  rowIndex,
6520
6435
  colIndex,
@@ -6578,9 +6493,9 @@ function createTableStructHandlers(input) {
6578
6493
  return;
6579
6494
  }
6580
6495
  const rowIdx = ts?.rowIndex ?? 0;
6581
- const newTableData = chunk6QGTRYSC_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6496
+ const newTableData = chunkUSAJMMF2_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6582
6497
  const updates = { tableData: newTableData };
6583
- const newRawXml = chunk6QGTRYSC_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6498
+ const newRawXml = chunkUSAJMMF2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6584
6499
  if (newRawXml) {
6585
6500
  updates.rawXml = newRawXml;
6586
6501
  }
@@ -6593,12 +6508,12 @@ function createTableStructHandlers(input) {
6593
6508
  }
6594
6509
  const td = selectedElement.tableData;
6595
6510
  const rowIdx = ts?.rowIndex ?? 0;
6596
- const newTableData = chunk6QGTRYSC_js.deleteTableRow(td, rowIdx);
6511
+ const newTableData = chunkUSAJMMF2_js.deleteTableRow(td, rowIdx);
6597
6512
  if (newTableData === td) {
6598
6513
  return;
6599
6514
  }
6600
6515
  const updates = { tableData: newTableData };
6601
- const newRawXml = chunk6QGTRYSC_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6516
+ const newRawXml = chunkUSAJMMF2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6602
6517
  if (newRawXml) {
6603
6518
  updates.rawXml = newRawXml;
6604
6519
  }
@@ -6610,9 +6525,9 @@ function createTableStructHandlers(input) {
6610
6525
  return;
6611
6526
  }
6612
6527
  const colIdx = ts?.columnIndex ?? 0;
6613
- const newTableData = chunk6QGTRYSC_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6528
+ const newTableData = chunkUSAJMMF2_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6614
6529
  const updates = { tableData: newTableData };
6615
- const newRawXml = chunk6QGTRYSC_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6530
+ const newRawXml = chunkUSAJMMF2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6616
6531
  if (newRawXml) {
6617
6532
  updates.rawXml = newRawXml;
6618
6533
  }
@@ -6625,12 +6540,12 @@ function createTableStructHandlers(input) {
6625
6540
  }
6626
6541
  const td = selectedElement.tableData;
6627
6542
  const colIdx = ts?.columnIndex ?? 0;
6628
- const newTableData = chunk6QGTRYSC_js.deleteTableColumn(td, colIdx);
6543
+ const newTableData = chunkUSAJMMF2_js.deleteTableColumn(td, colIdx);
6629
6544
  if (newTableData === td) {
6630
6545
  return;
6631
6546
  }
6632
6547
  const updates = { tableData: newTableData };
6633
- const newRawXml = chunk6QGTRYSC_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6548
+ const newRawXml = chunkUSAJMMF2_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6634
6549
  if (newRawXml) {
6635
6550
  updates.rawXml = newRawXml;
6636
6551
  }
@@ -6666,8 +6581,8 @@ async function renderToCanvas(element, options = {}) {
6666
6581
  return html2canvasPro(element, {
6667
6582
  ...options,
6668
6583
  onclone: async (doc, clonedEl) => {
6669
- await chunk6QGTRYSC_js.normalizeColorsForCapture(doc, clonedEl);
6670
- chunk6QGTRYSC_js.preprocessCssForCapture(clonedEl);
6584
+ await chunkUSAJMMF2_js.normalizeColorsForCapture(doc, clonedEl);
6585
+ chunkUSAJMMF2_js.preprocessCssForCapture(clonedEl);
6671
6586
  if (typeof userOnClone === "function") {
6672
6587
  userOnClone(doc, clonedEl);
6673
6588
  }
@@ -6723,7 +6638,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
6723
6638
  }
6724
6639
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
6725
6640
  const blob = await exportSlideToPngBlob(slideElement, options);
6726
- chunk6QGTRYSC_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6641
+ chunkUSAJMMF2_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6727
6642
  }
6728
6643
  async function copySlideToClipboard(slideElement, options = {}) {
6729
6644
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -6745,15 +6660,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
6745
6660
  continue;
6746
6661
  }
6747
6662
  const canvas = await renderElementToCanvas(stageEl, scale);
6748
- images.push(chunk6QGTRYSC_js.canvasToJpegData(canvas));
6663
+ images.push(chunkUSAJMMF2_js.canvasToJpegData(canvas));
6749
6664
  }
6750
6665
  onProgress?.(totalSlides, totalSlides);
6751
6666
  setActiveSlide(currentSlideIndex);
6752
6667
  if (images.length === 0) {
6753
6668
  throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6754
6669
  }
6755
- const pdfBlobUrl = chunkP65VL2I6_js.buildPdfFromImageData(images);
6756
- chunk6QGTRYSC_js.downloadDataUrl(pdfBlobUrl, filename);
6670
+ const pdfBlobUrl = chunkNFJLF7TX_js.buildPdfFromImageData(images);
6671
+ chunkUSAJMMF2_js.downloadDataUrl(pdfBlobUrl, filename);
6757
6672
  }
6758
6673
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
6759
6674
  const { scale = 2, onProgress } = options;
@@ -6801,8 +6716,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
6801
6716
  if (pages.length === 0) {
6802
6717
  throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6803
6718
  }
6804
- const pdfDataUrl = chunkP65VL2I6_js.buildNotesPdf(pages);
6805
- chunk6QGTRYSC_js.downloadDataUrl(pdfDataUrl, filename);
6719
+ const pdfDataUrl = chunkNFJLF7TX_js.buildNotesPdf(pages);
6720
+ chunkUSAJMMF2_js.downloadDataUrl(pdfDataUrl, filename);
6806
6721
  }
6807
6722
 
6808
6723
  // src/viewer/utils/export-video.ts
@@ -6846,7 +6761,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6846
6761
  const fps = 30;
6847
6762
  const stream = recordingCanvas.captureStream(fps);
6848
6763
  const recorder = new MediaRecorder(stream, {
6849
- mimeType: chunk6QGTRYSC_js.pickSupportedMimeType([...chunk6QGTRYSC_js.WEBM_MIME_CANDIDATES]),
6764
+ mimeType: chunkUSAJMMF2_js.pickSupportedMimeType([...chunkUSAJMMF2_js.WEBM_MIME_CANDIDATES]),
6850
6765
  videoBitsPerSecond: 5e6
6851
6766
  });
6852
6767
  const chunks = [];
@@ -6869,8 +6784,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6869
6784
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
6870
6785
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
6871
6786
  ctx.drawImage(slideCanvases[i], 0, 0);
6872
- const frameInterval = chunk6QGTRYSC_js.fpsToFrameIntervalMs(fps);
6873
- const framesNeeded = chunk6QGTRYSC_js.segmentFrameCount(duration, fps);
6787
+ const frameInterval = chunkUSAJMMF2_js.fpsToFrameIntervalMs(fps);
6788
+ const framesNeeded = chunkUSAJMMF2_js.segmentFrameCount(duration, fps);
6874
6789
  for (let f = 0; f < framesNeeded; f++) {
6875
6790
  if (signal?.aborted) {
6876
6791
  recorder.stop();
@@ -6919,7 +6834,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
6919
6834
  if (frames.length === 0) {
6920
6835
  throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6921
6836
  }
6922
- const gifBytes = chunk6QGTRYSC_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6837
+ const gifBytes = chunkUSAJMMF2_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6923
6838
  onProgress?.(totalSlides, totalSlides);
6924
6839
  const buf = new ArrayBuffer(gifBytes.length);
6925
6840
  new Uint8Array(buf).set(gifBytes);
@@ -6973,7 +6888,7 @@ function exportAllSlidesToSvg(data, options = {}) {
6973
6888
  continue;
6974
6889
  }
6975
6890
  onProgress?.(processedCount, data.slides.length);
6976
- let svg = chunk6QGTRYSC_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6891
+ let svg = chunkUSAJMMF2_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6977
6892
  if (embedFonts && fontFaces?.length) {
6978
6893
  svg = injectFontFaces(svg, fontFaces);
6979
6894
  }
@@ -7035,7 +6950,7 @@ function useExportSaveAs(input) {
7035
6950
  }
7036
6951
  setExportProgress(70);
7037
6952
  setExportStatusMessage("Writing README...");
7038
- const readme = chunk6QGTRYSC_js.generatePackageReadme(pptxFilename);
6953
+ const readme = chunkUSAJMMF2_js.generatePackageReadme(pptxFilename);
7039
6954
  pkgFolder.file("README.txt", readme);
7040
6955
  if (abortCtrl.signal.aborted) {
7041
6956
  throw new DOMException("Export cancelled", "AbortError");
@@ -7046,7 +6961,7 @@ function useExportSaveAs(input) {
7046
6961
  setExportProgress(95);
7047
6962
  setExportStatusMessage("Downloading...");
7048
6963
  const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
7049
- chunk6QGTRYSC_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
6964
+ chunkUSAJMMF2_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
7050
6965
  setExportProgress(100);
7051
6966
  } catch (err) {
7052
6967
  if (err.name !== "AbortError") {
@@ -7069,7 +6984,7 @@ function useExportSaveAs(input) {
7069
6984
  const blob = new Blob([data], {
7070
6985
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
7071
6986
  });
7072
- chunk6QGTRYSC_js.downloadBlob(blob, `${baseName}.${ext}`);
6987
+ chunkUSAJMMF2_js.downloadBlob(blob, `${baseName}.${ext}`);
7073
6988
  } catch (err) {
7074
6989
  console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
7075
6990
  }
@@ -7082,14 +6997,14 @@ function useExportSaveAs(input) {
7082
6997
  const pptxGuides = guides.map((g) => ({
7083
6998
  id: g.id,
7084
6999
  orientation: g.axis === "h" ? "horz" : "vert",
7085
- positionEmu: chunk6QGTRYSC_js.guidePxToEmu(g.position)
7000
+ positionEmu: chunkUSAJMMF2_js.guidePxToEmu(g.position)
7086
7001
  }));
7087
7002
  return {
7088
7003
  ...slide,
7089
7004
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
7090
7005
  };
7091
7006
  });
7092
- const slidesToSave = chunkP65VL2I6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7007
+ const slidesToSave = chunkUSAJMMF2_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7093
7008
  const saveOptions = {
7094
7009
  headerFooter,
7095
7010
  presentationProperties,
@@ -7115,11 +7030,11 @@ function useExportSaveAs(input) {
7115
7030
  const handleExportJson = () => {
7116
7031
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7117
7032
  const data = {
7118
- slides: chunkP65VL2I6_js.buildSaveSlides(slides, templateElementsBySlideId),
7033
+ slides: chunkUSAJMMF2_js.buildSaveSlides(slides, templateElementsBySlideId),
7119
7034
  width: canvasSize.width,
7120
7035
  height: canvasSize.height,
7121
- widthEmu: chunk6QGTRYSC_js.guidePxToEmu(canvasSize.width),
7122
- heightEmu: chunk6QGTRYSC_js.guidePxToEmu(canvasSize.height),
7036
+ widthEmu: chunkUSAJMMF2_js.guidePxToEmu(canvasSize.width),
7037
+ heightEmu: chunkUSAJMMF2_js.guidePxToEmu(canvasSize.height),
7123
7038
  theme,
7124
7039
  headerFooter,
7125
7040
  presentationProperties,
@@ -7133,7 +7048,7 @@ function useExportSaveAs(input) {
7133
7048
  handoutMaster
7134
7049
  };
7135
7050
  try {
7136
- chunk6QGTRYSC_js.exportDeckJson(data, sourceName);
7051
+ chunkUSAJMMF2_js.exportDeckJson(data, sourceName);
7137
7052
  } catch (err) {
7138
7053
  console.error("[PowerPointViewer] JSON export failed:", err);
7139
7054
  }
@@ -7173,7 +7088,7 @@ function safeConfirm(message) {
7173
7088
  }
7174
7089
  }
7175
7090
  function downloadBlob2(blob, filename) {
7176
- chunk6QGTRYSC_js.downloadBlob(blob, chunk6QGTRYSC_js.sanitizeDownloadFilename(filename));
7091
+ chunkUSAJMMF2_js.downloadBlob(blob, chunkUSAJMMF2_js.sanitizeDownloadFilename(filename));
7177
7092
  }
7178
7093
 
7179
7094
  // src/viewer/hooks/useExportHandlers.ts
@@ -7279,21 +7194,21 @@ function useExportHandlers(input) {
7279
7194
  {
7280
7195
  scale: 2,
7281
7196
  onProgress: (current, total) => {
7282
- setExportProgress(chunk6QGTRYSC_js.slideProgressPercent(current, total));
7283
- setExportStatusMessage(chunk6QGTRYSC_js.slideStatusLabel("Rendering", current, total));
7197
+ setExportProgress(chunkUSAJMMF2_js.slideProgressPercent(current, total));
7198
+ setExportStatusMessage(chunkUSAJMMF2_js.slideStatusLabel("Rendering", current, total));
7284
7199
  },
7285
7200
  signal: abortCtrl.signal
7286
7201
  }
7287
7202
  );
7288
- setExportProgress(chunk6QGTRYSC_js.EXPORT_ASSEMBLING_PERCENT);
7203
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_ASSEMBLING_PERCENT);
7289
7204
  setExportStatusMessage("Building PDF...");
7290
7205
  await new Promise((r) => {
7291
7206
  setTimeout(r, 100);
7292
7207
  });
7293
- setExportProgress(chunk6QGTRYSC_js.EXPORT_DONE_PERCENT);
7208
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_DONE_PERCENT);
7294
7209
  setExportStatusMessage("Done!");
7295
7210
  } catch (err) {
7296
- if (!chunk6QGTRYSC_js.isExportAbortError(err)) {
7211
+ if (!chunkUSAJMMF2_js.isExportAbortError(err)) {
7297
7212
  console.error("[PowerPointViewer] PDF export failed:", err);
7298
7213
  }
7299
7214
  } finally {
@@ -7323,21 +7238,21 @@ function useExportHandlers(input) {
7323
7238
  {
7324
7239
  scale: 2,
7325
7240
  onProgress: (current, total) => {
7326
- setExportProgress(chunk6QGTRYSC_js.slideProgressPercent(current, total));
7327
- setExportStatusMessage(chunk6QGTRYSC_js.slideStatusLabel("Rendering", current, total));
7241
+ setExportProgress(chunkUSAJMMF2_js.slideProgressPercent(current, total));
7242
+ setExportStatusMessage(chunkUSAJMMF2_js.slideStatusLabel("Rendering", current, total));
7328
7243
  },
7329
7244
  signal: abortCtrl.signal
7330
7245
  }
7331
7246
  );
7332
- setExportProgress(chunk6QGTRYSC_js.EXPORT_ASSEMBLING_PERCENT);
7247
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_ASSEMBLING_PERCENT);
7333
7248
  setExportStatusMessage("Building PDF...");
7334
7249
  await new Promise((r) => {
7335
7250
  setTimeout(r, 100);
7336
7251
  });
7337
- setExportProgress(chunk6QGTRYSC_js.EXPORT_DONE_PERCENT);
7252
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_DONE_PERCENT);
7338
7253
  setExportStatusMessage("Done!");
7339
7254
  } catch (err) {
7340
- if (!chunk6QGTRYSC_js.isExportAbortError(err)) {
7255
+ if (!chunkUSAJMMF2_js.isExportAbortError(err)) {
7341
7256
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7342
7257
  }
7343
7258
  } finally {
@@ -7378,22 +7293,22 @@ function useExportHandlers(input) {
7378
7293
  scale: 1,
7379
7294
  slideDurationMs: 3e3,
7380
7295
  onProgress: (current, total) => {
7381
- setExportProgress(chunk6QGTRYSC_js.slideProgressPercent(current, total, 45));
7382
- setExportStatusMessage(chunk6QGTRYSC_js.slideStatusLabel("Capturing", current, total));
7296
+ setExportProgress(chunkUSAJMMF2_js.slideProgressPercent(current, total, 45));
7297
+ setExportStatusMessage(chunkUSAJMMF2_js.slideStatusLabel("Capturing", current, total));
7383
7298
  },
7384
7299
  onRecordProgress: (current, total) => {
7385
- setExportProgress(chunk6QGTRYSC_js.recordProgressPercent(current, total));
7386
- setExportStatusMessage(chunk6QGTRYSC_js.slideStatusLabel("Recording", current, total));
7300
+ setExportProgress(chunkUSAJMMF2_js.recordProgressPercent(current, total));
7301
+ setExportStatusMessage(chunkUSAJMMF2_js.slideStatusLabel("Recording", current, total));
7387
7302
  },
7388
7303
  signal: abortCtrl.signal
7389
7304
  }
7390
7305
  );
7391
- setExportProgress(chunk6QGTRYSC_js.EXPORT_ASSEMBLING_PERCENT);
7306
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_ASSEMBLING_PERCENT);
7392
7307
  setExportStatusMessage("Saving file...");
7393
7308
  downloadBlob2(blob, "presentation.webm");
7394
- setExportProgress(chunk6QGTRYSC_js.EXPORT_DONE_PERCENT);
7309
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_DONE_PERCENT);
7395
7310
  } catch (err) {
7396
- if (!chunk6QGTRYSC_js.isExportAbortError(err)) {
7311
+ if (!chunkUSAJMMF2_js.isExportAbortError(err)) {
7397
7312
  console.error("[PowerPointViewer] Video export failed:", err);
7398
7313
  }
7399
7314
  } finally {
@@ -7421,18 +7336,18 @@ function useExportHandlers(input) {
7421
7336
  scale: 0.5,
7422
7337
  slideDurationMs: 2e3,
7423
7338
  onProgress: (current, total) => {
7424
- setExportProgress(chunk6QGTRYSC_js.slideProgressPercent(current, total));
7425
- setExportStatusMessage(chunk6QGTRYSC_js.slideStatusLabel("Encoding", current, total));
7339
+ setExportProgress(chunkUSAJMMF2_js.slideProgressPercent(current, total));
7340
+ setExportStatusMessage(chunkUSAJMMF2_js.slideStatusLabel("Encoding", current, total));
7426
7341
  },
7427
7342
  signal: abortCtrl.signal
7428
7343
  }
7429
7344
  );
7430
- setExportProgress(chunk6QGTRYSC_js.EXPORT_ASSEMBLING_PERCENT);
7345
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_ASSEMBLING_PERCENT);
7431
7346
  setExportStatusMessage("Saving file...");
7432
7347
  downloadBlob2(blob, "presentation.gif");
7433
- setExportProgress(chunk6QGTRYSC_js.EXPORT_DONE_PERCENT);
7348
+ setExportProgress(chunkUSAJMMF2_js.EXPORT_DONE_PERCENT);
7434
7349
  } catch (err) {
7435
- if (!chunk6QGTRYSC_js.isExportAbortError(err)) {
7350
+ if (!chunkUSAJMMF2_js.isExportAbortError(err)) {
7436
7351
  console.error("[PowerPointViewer] GIF export failed:", err);
7437
7352
  }
7438
7353
  } finally {
@@ -7473,7 +7388,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
7473
7388
  }
7474
7389
  printWindow.document.open();
7475
7390
  printWindow.document.write(
7476
- chunk6QGTRYSC_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7391
+ chunkUSAJMMF2_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7477
7392
  );
7478
7393
  printWindow.document.close();
7479
7394
  printWindow.focus();
@@ -7534,7 +7449,7 @@ function usePrintHandlers(input) {
7534
7449
  if (svgs.length === 0) {
7535
7450
  return;
7536
7451
  }
7537
- const printDoc = chunk6QGTRYSC_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7452
+ const printDoc = chunkUSAJMMF2_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7538
7453
  title: "Slides (Vector)",
7539
7454
  orientation: settings.orientation,
7540
7455
  colorFilter
@@ -7570,7 +7485,7 @@ function usePrintHandlers(input) {
7570
7485
  if (settings.printWhat === "outline") {
7571
7486
  openPrintWindow(
7572
7487
  "Outline",
7573
- `<div class="outline-page">${chunk6QGTRYSC_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7488
+ `<div class="outline-page">${chunkUSAJMMF2_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7574
7489
  settings.orientation,
7575
7490
  colorFilter,
7576
7491
  settings.frameSlides
@@ -7595,7 +7510,7 @@ function usePrintHandlers(input) {
7595
7510
  if (settings.printWhat === "slides") {
7596
7511
  openPrintWindow(
7597
7512
  "Slides",
7598
- chunk6QGTRYSC_js.buildSlidesHtml(slideImages, slideIndices),
7513
+ chunkUSAJMMF2_js.buildSlidesHtml(slideImages, slideIndices),
7599
7514
  settings.orientation,
7600
7515
  colorFilter,
7601
7516
  settings.frameSlides
@@ -7605,7 +7520,7 @@ function usePrintHandlers(input) {
7605
7520
  if (settings.printWhat === "notes") {
7606
7521
  openPrintWindow(
7607
7522
  "Notes Pages",
7608
- chunk6QGTRYSC_js.buildNotesHtml(slideImages, slideIndices, slides),
7523
+ chunkUSAJMMF2_js.buildNotesHtml(slideImages, slideIndices, slides),
7609
7524
  "portrait",
7610
7525
  colorFilter,
7611
7526
  settings.frameSlides
@@ -7616,7 +7531,7 @@ function usePrintHandlers(input) {
7616
7531
  const spp = settings.slidesPerPage;
7617
7532
  openPrintWindow(
7618
7533
  `Handout ${spp} per page`,
7619
- chunk6QGTRYSC_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7534
+ chunkUSAJMMF2_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7620
7535
  "portrait",
7621
7536
  colorFilter,
7622
7537
  settings.frameSlides
@@ -7680,8 +7595,8 @@ function useThemeHandlers(input) {
7680
7595
  return;
7681
7596
  }
7682
7597
  await handler.updateThemeColorScheme(colorScheme);
7683
- const previousMap = theme?.colorScheme ? chunk6QGTRYSC_js.buildThemeColorMap(theme.colorScheme) : {};
7684
- setSlides((prev) => chunk6QGTRYSC_js.reResolveSlideColors(prev, previousMap, colorScheme));
7598
+ const previousMap = theme?.colorScheme ? chunkUSAJMMF2_js.buildThemeColorMap(theme.colorScheme) : {};
7599
+ setSlides((prev) => chunkUSAJMMF2_js.reResolveSlideColors(prev, previousMap, colorScheme));
7685
7600
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7686
7601
  bumpHistory();
7687
7602
  history.markDirty();
@@ -7786,7 +7701,7 @@ function useThemeSwitching(input) {
7786
7701
  }
7787
7702
  try {
7788
7703
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7789
- const newData = chunk6QGTRYSC_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7704
+ const newData = chunkUSAJMMF2_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7790
7705
  onDataChange(newData);
7791
7706
  onThemeChanged?.(preset);
7792
7707
  } catch (error) {
@@ -7803,7 +7718,7 @@ function useThemeSwitching(input) {
7803
7718
  }
7804
7719
  try {
7805
7720
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7806
- const newData = chunk6QGTRYSC_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7721
+ const newData = chunkUSAJMMF2_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7807
7722
  onDataChange(newData);
7808
7723
  } catch (error) {
7809
7724
  console.error("Failed to switch to custom theme:", error);
@@ -7815,12 +7730,12 @@ function useThemeSwitching(input) {
7815
7730
  if (!data?.theme?.colorScheme) {
7816
7731
  return void 0;
7817
7732
  }
7818
- return chunk6QGTRYSC_js.THEME_PRESETS.find(
7819
- (p) => chunk6QGTRYSC_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7733
+ return chunkUSAJMMF2_js.THEME_PRESETS.find(
7734
+ (p) => chunkUSAJMMF2_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7820
7735
  );
7821
7736
  }, [data?.theme?.colorScheme]);
7822
7737
  return {
7823
- presets: chunk6QGTRYSC_js.THEME_PRESETS,
7738
+ presets: chunkUSAJMMF2_js.THEME_PRESETS,
7824
7739
  switchToPreset,
7825
7740
  switchToCustom,
7826
7741
  currentPreset
@@ -7895,7 +7810,7 @@ function usePropertyHandlers(input) {
7895
7810
  }
7896
7811
  try {
7897
7812
  const ab = await file.arrayBuffer();
7898
- const h = new chunk6QGTRYSC_js.PptxHandler();
7813
+ const h = new chunkUSAJMMF2_js.PptxHandler();
7899
7814
  const other = await h.load(ab);
7900
7815
  if (!other) {
7901
7816
  return;
@@ -7905,7 +7820,7 @@ function usePropertyHandlers(input) {
7905
7820
  width: canvasSize.width,
7906
7821
  height: canvasSize.height
7907
7822
  };
7908
- setCompareResult(chunk6QGTRYSC_js.comparePresentation(cur, other));
7823
+ setCompareResult(chunkUSAJMMF2_js.comparePresentation(cur, other));
7909
7824
  setIsComparePanelOpen(true);
7910
7825
  } catch (err) {
7911
7826
  console.warn("Compare failed:", err);
@@ -7922,7 +7837,7 @@ function usePropertyHandlers(input) {
7922
7837
  if (!diff || diff.status === "unchanged") {
7923
7838
  return;
7924
7839
  }
7925
- setSlides((prev) => chunk6QGTRYSC_js.applyAcceptSlide(prev, diff));
7840
+ setSlides((prev) => chunkUSAJMMF2_js.applyAcceptSlide(prev, diff));
7926
7841
  setIsDirty(true);
7927
7842
  },
7928
7843
  [compareResult, setSlides, setIsDirty]
@@ -7933,10 +7848,10 @@ function usePropertyHandlers(input) {
7933
7848
  if (!compareResult) {
7934
7849
  return;
7935
7850
  }
7936
- setSlides((prev) => chunk6QGTRYSC_js.applyAcceptAllSlides(prev, compareResult));
7851
+ setSlides((prev) => chunkUSAJMMF2_js.applyAcceptAllSlides(prev, compareResult));
7937
7852
  setIsDirty(true);
7938
7853
  }, [compareResult, setSlides, setIsDirty]);
7939
- const usedFontFamilies = react.useMemo(() => chunk6QGTRYSC_js.collectUsedFonts(slides), [slides]);
7854
+ const usedFontFamilies = react.useMemo(() => chunkUSAJMMF2_js.collectUsedFonts(slides), [slides]);
7940
7855
  return {
7941
7856
  handleUpdateNotes,
7942
7857
  handleUpdateSlide,
@@ -8055,7 +7970,7 @@ function useIsMobile(input) {
8055
7970
  const containerRef = input?.containerRef;
8056
7971
  const isTouchDevice = react.useSyncExternalStore(
8057
7972
  subscribeTouchCapability,
8058
- chunk6QGTRYSC_js.detectTouchDevice,
7973
+ chunkUSAJMMF2_js.detectTouchDevice,
8059
7974
  () => false
8060
7975
  // server snapshot
8061
7976
  );
@@ -8071,7 +7986,7 @@ function useIsMobile(input) {
8071
7986
  }
8072
7987
  return containerRef?.current?.clientHeight ?? window.innerHeight;
8073
7988
  });
8074
- const [orientation, setOrientation] = react.useState(chunk6QGTRYSC_js.detectOrientation);
7989
+ const [orientation, setOrientation] = react.useState(chunkUSAJMMF2_js.detectOrientation);
8075
7990
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
8076
7991
  const [initialViewportHeight] = react.useState(
8077
7992
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -8115,7 +8030,7 @@ function useIsMobile(input) {
8115
8030
  return;
8116
8031
  }
8117
8032
  const handleOrientationChange = () => {
8118
- setOrientation(chunk6QGTRYSC_js.detectOrientation());
8033
+ setOrientation(chunkUSAJMMF2_js.detectOrientation());
8119
8034
  };
8120
8035
  if (screen.orientation) {
8121
8036
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -8145,9 +8060,9 @@ function useIsMobile(input) {
8145
8060
  window.addEventListener("resize", handleResize);
8146
8061
  return () => window.removeEventListener("resize", handleResize);
8147
8062
  }, [isTouchDevice, initialViewportHeight]);
8148
- const isMobile = chunk6QGTRYSC_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8149
- const isTablet = !isMobile && containerWidth >= chunk6QGTRYSC_js.MOBILE_BREAKPOINT && containerWidth < chunk6QGTRYSC_js.TABLET_BREAKPOINT;
8150
- const isDesktop = !isMobile && containerWidth >= chunk6QGTRYSC_js.TABLET_BREAKPOINT;
8063
+ const isMobile = chunkUSAJMMF2_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8064
+ const isTablet = !isMobile && containerWidth >= chunkUSAJMMF2_js.MOBILE_BREAKPOINT && containerWidth < chunkUSAJMMF2_js.TABLET_BREAKPOINT;
8065
+ const isDesktop = !isMobile && containerWidth >= chunkUSAJMMF2_js.TABLET_BREAKPOINT;
8151
8066
  return {
8152
8067
  isMobile,
8153
8068
  isTablet,
@@ -8208,11 +8123,11 @@ function useViewerDialogs(input) {
8208
8123
  );
8209
8124
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
8210
8125
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8211
- () => typeof window !== "undefined" ? chunk6QGTRYSC_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8126
+ () => typeof window !== "undefined" ? chunkUSAJMMF2_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8212
8127
  );
8213
8128
  react.useEffect(() => {
8214
8129
  const handleWindow = () => setIsNarrowViewport(
8215
- chunk6QGTRYSC_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8130
+ chunkUSAJMMF2_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8216
8131
  );
8217
8132
  let observer = null;
8218
8133
  let raf = 0;
@@ -8226,12 +8141,12 @@ function useViewerDialogs(input) {
8226
8141
  const entry = entries[0];
8227
8142
  if (entry) {
8228
8143
  setIsNarrowViewport(
8229
- chunk6QGTRYSC_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8144
+ chunkUSAJMMF2_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8230
8145
  );
8231
8146
  }
8232
8147
  });
8233
8148
  observer.observe(el);
8234
- setIsNarrowViewport(chunk6QGTRYSC_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8149
+ setIsNarrowViewport(chunkUSAJMMF2_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8235
8150
  };
8236
8151
  attach();
8237
8152
  window.addEventListener("resize", handleWindow);
@@ -8389,20 +8304,20 @@ function useViewerDialogs(input) {
8389
8304
  }
8390
8305
  function computeGridSpacingPx(presentationGridSpacing) {
8391
8306
  if (presentationGridSpacing) {
8392
- const px = Math.round(presentationGridSpacing.cx / chunkP65VL2I6_js.EMU_PER_PX);
8307
+ const px = Math.round(presentationGridSpacing.cx / chunkNFJLF7TX_js.EMU_PER_PX);
8393
8308
  if (px > 0) {
8394
8309
  return px;
8395
8310
  }
8396
8311
  }
8397
- return chunkP65VL2I6_js.GRID_SIZE;
8312
+ return chunkNFJLF7TX_js.GRID_SIZE;
8398
8313
  }
8399
8314
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8400
8315
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8401
- return chunk6QGTRYSC_js.resolveShowSlideIndexes(slides, activeShow);
8316
+ return chunkUSAJMMF2_js.resolveShowSlideIndexes(slides, activeShow);
8402
8317
  }
8403
8318
  function computeSlideSectionGroups(slides, sections) {
8404
- return chunk6QGTRYSC_js.groupSlidesBySection(sections, slides).map((group) => ({
8405
- id: group.section?.id ?? (sections.length > 0 ? chunkP65VL2I6_js.UNGROUPED_SECTION_ID : "default"),
8319
+ return chunkUSAJMMF2_js.groupSlidesBySection(sections, slides).map((group) => ({
8320
+ id: group.section?.id ?? (sections.length > 0 ? chunkNFJLF7TX_js.UNGROUPED_SECTION_ID : "default"),
8406
8321
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8407
8322
  slideIndexes: group.slideIndexes,
8408
8323
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8457,7 +8372,7 @@ function useDerivedSlideState(input) {
8457
8372
  );
8458
8373
  const slideSectionGroups = react.useMemo(
8459
8374
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8460
- if (group.id === chunkP65VL2I6_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8375
+ if (group.id === chunkNFJLF7TX_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8461
8376
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8462
8377
  }
8463
8378
  if (group.id === "default" && group.label === "Slides") {
@@ -8560,13 +8475,13 @@ function useAnnotationHandlers(input) {
8560
8475
  }, [annotations, setMode, setSlides, history]);
8561
8476
  const handleSetMode = react.useCallback(
8562
8477
  (nextMode) => {
8563
- if (mode === "present" && nextMode !== "present" && !chunk6QGTRYSC_js.mayLeaveSlideShow()) {
8478
+ if (mode === "present" && nextMode !== "present" && !chunkUSAJMMF2_js.mayLeaveSlideShow()) {
8564
8479
  return;
8565
8480
  }
8566
8481
  if (nextMode === "present") {
8567
8482
  presentation.enterPresentMode();
8568
8483
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8569
- chunk6QGTRYSC_js.stopAllPersistentAudio();
8484
+ chunkUSAJMMF2_js.stopAllPersistentAudio();
8570
8485
  pendingModeAfterAnnotationsRef.current = nextMode;
8571
8486
  if (promptKeepInkAnnotations) {
8572
8487
  setShowKeepAnnotationsDialog(true);
@@ -8575,7 +8490,7 @@ function useAnnotationHandlers(input) {
8575
8490
  }
8576
8491
  } else {
8577
8492
  if (mode === "present") {
8578
- chunk6QGTRYSC_js.stopAllPersistentAudio();
8493
+ chunkUSAJMMF2_js.stopAllPersistentAudio();
8579
8494
  }
8580
8495
  setMode(nextMode);
8581
8496
  }
@@ -8641,13 +8556,13 @@ function useSerialize(input) {
8641
8556
  let processedSlide = slide;
8642
8557
  if (pendingEditId) {
8643
8558
  const updatedElements = slide.elements.map((el) => {
8644
- if (el.id !== pendingEditId || !chunk6QGTRYSC_js.hasTextProperties(el)) {
8559
+ if (el.id !== pendingEditId || !chunkUSAJMMF2_js.hasTextProperties(el)) {
8645
8560
  return el;
8646
8561
  }
8647
8562
  return {
8648
8563
  ...el,
8649
8564
  text: pendingEditText,
8650
- textSegments: chunk6QGTRYSC_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8565
+ textSegments: chunkUSAJMMF2_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8651
8566
  };
8652
8567
  });
8653
8568
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8660,14 +8575,14 @@ function useSerialize(input) {
8660
8575
  const pptxGuides = guides.map((g) => ({
8661
8576
  id: g.id,
8662
8577
  orientation: g.axis === "h" ? "horz" : "vert",
8663
- positionEmu: chunk6QGTRYSC_js.guidePxToEmu(g.position)
8578
+ positionEmu: chunkUSAJMMF2_js.guidePxToEmu(g.position)
8664
8579
  }));
8665
8580
  return {
8666
8581
  ...processedSlide,
8667
8582
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8668
8583
  };
8669
8584
  });
8670
- const slidesToSave = chunkP65VL2I6_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8585
+ const slidesToSave = chunkUSAJMMF2_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8671
8586
  const saveOptions = {
8672
8587
  headerFooter,
8673
8588
  presentationProperties,
@@ -8836,7 +8751,7 @@ function usePresentationSetup(input) {
8836
8751
  containerRef,
8837
8752
  content,
8838
8753
  onSetMode: (nextMode) => {
8839
- if (mode === "present" && nextMode !== "present" && !chunk6QGTRYSC_js.mayLeaveSlideShow()) {
8754
+ if (mode === "present" && nextMode !== "present" && !chunkUSAJMMF2_js.mayLeaveSlideShow()) {
8840
8755
  return;
8841
8756
  }
8842
8757
  if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
@@ -8844,7 +8759,7 @@ function usePresentationSetup(input) {
8844
8759
  setShowKeepAnnotationsDialog(true);
8845
8760
  } else {
8846
8761
  if (mode === "present" && nextMode !== "present") {
8847
- chunk6QGTRYSC_js.stopAllPersistentAudio();
8762
+ chunkUSAJMMF2_js.stopAllPersistentAudio();
8848
8763
  stopAnimationSound();
8849
8764
  }
8850
8765
  setMode(nextMode);
@@ -8898,10 +8813,10 @@ function usePresentationSetup(input) {
8898
8813
  onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
8899
8814
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8900
8815
  onSaveRehearsalTimings: (timings) => {
8901
- setSlides((prev) => chunk6QGTRYSC_js.applyRehearsalTimings(prev, timings));
8816
+ setSlides((prev) => chunkUSAJMMF2_js.applyRehearsalTimings(prev, timings));
8902
8817
  history.markDirty();
8903
8818
  },
8904
- loopContinuously: chunk6QGTRYSC_js.shouldLoopContinuously(presentationProperties),
8819
+ loopContinuously: chunkUSAJMMF2_js.shouldLoopContinuously(presentationProperties),
8905
8820
  showWithAnimation: presentationProperties.showWithAnimation,
8906
8821
  useTimings: presentationProperties.advanceMode !== "manual",
8907
8822
  endWithBlackSlide
@@ -9066,7 +8981,7 @@ function useEditorOperations(input) {
9066
8981
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9067
8982
  react.useEffect(() => {
9068
8983
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9069
- copiedFormatRef.current = chunk6QGTRYSC_js.copyFormatFromElement(selectedElement);
8984
+ copiedFormatRef.current = chunkUSAJMMF2_js.copyFormatFromElement(selectedElement);
9070
8985
  } else if (!formatPainterActive) {
9071
8986
  copiedFormatRef.current = null;
9072
8987
  }
@@ -9092,12 +9007,12 @@ function useEditorOperations(input) {
9092
9007
  e.stopPropagation();
9093
9008
  const element = elementLookup.get(elementId);
9094
9009
  if (element) {
9095
- const updated = chunk6QGTRYSC_js.applyFormatToElement(element, copiedFormatRef.current);
9010
+ const updated = chunkUSAJMMF2_js.applyFormatToElement(element, copiedFormatRef.current);
9096
9011
  const updates = {};
9097
- if (chunk6QGTRYSC_js.hasShapeProperties(updated)) {
9012
+ if (chunkUSAJMMF2_js.hasShapeProperties(updated)) {
9098
9013
  updates.shapeStyle = updated.shapeStyle;
9099
9014
  }
9100
- if (chunk6QGTRYSC_js.hasTextProperties(updated)) {
9015
+ if (chunkUSAJMMF2_js.hasTextProperties(updated)) {
9101
9016
  updates.textStyle = updated.textStyle;
9102
9017
  }
9103
9018
  ops.updateElementById(elementId, updates);
@@ -9246,7 +9161,7 @@ function collectReferencedFontFamilies(slides) {
9246
9161
  const families = /* @__PURE__ */ new Set();
9247
9162
  for (const slide of slides) {
9248
9163
  for (const el of slide.elements) {
9249
- if (chunk6QGTRYSC_js.hasTextProperties(el) && el.textSegments) {
9164
+ if (chunkUSAJMMF2_js.hasTextProperties(el) && el.textSegments) {
9250
9165
  for (const seg of el.textSegments) {
9251
9166
  if (seg.style.fontFamily) {
9252
9167
  families.add(seg.style.fontFamily);
@@ -9458,13 +9373,13 @@ function useKeyboardShortcuts(input) {
9458
9373
  inputRef.current = input;
9459
9374
  const handleKeyDown = react.useCallback((e) => {
9460
9375
  const current = inputRef.current;
9461
- const { action, dx, dy } = chunk6QGTRYSC_js.mapEditorKey(e, {
9376
+ const { action, dx, dy } = chunkUSAJMMF2_js.mapEditorKey(e, {
9462
9377
  canEdit: current.canEdit,
9463
9378
  isPresenting: current.mode !== "edit",
9464
9379
  hasSelection: current.hasSelection,
9465
9380
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9466
9381
  isDrawing: current.activeTool !== "select",
9467
- isTextInputTarget: chunk6QGTRYSC_js.isEditorTextInputTarget(e.target)
9382
+ isTextInputTarget: chunkUSAJMMF2_js.isEditorTextInputTarget(e.target)
9468
9383
  });
9469
9384
  if (action === null) {
9470
9385
  return;
@@ -9758,7 +9673,7 @@ function useViewerIntegration(input) {
9758
9673
  return zoom.scale;
9759
9674
  },
9760
9675
  setZoom(level) {
9761
- zoom.setScale(chunk6QGTRYSC_js.clampZoomScale(level));
9676
+ zoom.setScale(chunkUSAJMMF2_js.clampZoomScale(level));
9762
9677
  },
9763
9678
  zoomIn() {
9764
9679
  zoom.handleZoomIn();
@@ -9973,7 +9888,7 @@ function useReducedMotion() {
9973
9888
  }
9974
9889
  function useViewerOptions() {
9975
9890
  const storeRef = react.useRef(null);
9976
- storeRef.current ??= chunk6QGTRYSC_js.createViewerOptionsStore();
9891
+ storeRef.current ??= chunkUSAJMMF2_js.createViewerOptionsStore();
9977
9892
  const store = storeRef.current;
9978
9893
  const options = react.useSyncExternalStore(
9979
9894
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -9982,9 +9897,9 @@ function useViewerOptions() {
9982
9897
  );
9983
9898
  return { optionsStore: store, options };
9984
9899
  }
9985
- var KNOWN_TAB_IDS = new Set(chunk6QGTRYSC_js.TOOLBAR_TABS.map((tab) => tab.id));
9900
+ var KNOWN_TAB_IDS = new Set(chunkUSAJMMF2_js.TOOLBAR_TABS.map((tab) => tab.id));
9986
9901
  function computeToolbarVisibility(hiddenActions) {
9987
- const isHidden = (id) => chunk6QGTRYSC_js.isActionHidden(id, hiddenActions);
9902
+ const isHidden = (id) => chunkUSAJMMF2_js.isActionHidden(id, hiddenActions);
9988
9903
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
9989
9904
  return { isHidden, isTabVisible };
9990
9905
  }
@@ -10069,12 +9984,12 @@ function useYjsDocumentSync({
10069
9984
  return;
10070
9985
  }
10071
9986
  try {
10072
- const handler = new chunk6QGTRYSC_js.PptxHandler();
9987
+ const handler = new chunkUSAJMMF2_js.PptxHandler();
10073
9988
  await handler.load(sourceBytes.buffer);
10074
- const currentSlides = chunk6QGTRYSC_js.readSlidesFromYDoc(
9989
+ const currentSlides = chunkUSAJMMF2_js.readSlidesFromYDoc(
10075
9990
  doc
10076
9991
  );
10077
- const slidesToSave = chunkP65VL2I6_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
9992
+ const slidesToSave = chunkUSAJMMF2_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10078
9993
  const bytes = await handler.save(slidesToSave);
10079
9994
  config.onWriteBack(bytes);
10080
9995
  } catch {
@@ -10089,7 +10004,7 @@ function useYjsDocumentSync({
10089
10004
  if (!doc || !isConnected) {
10090
10005
  return;
10091
10006
  }
10092
- const docSlides = chunk6QGTRYSC_js.readSlidesFromYDoc(
10007
+ const docSlides = chunkUSAJMMF2_js.readSlidesFromYDoc(
10093
10008
  doc
10094
10009
  );
10095
10010
  if (docSlides.length === 0) {
@@ -10111,11 +10026,11 @@ function useYjsDocumentSync({
10111
10026
  lastSyncedRef.current = serialized;
10112
10027
  void (async () => {
10113
10028
  const factories = await getFactories();
10114
- chunk6QGTRYSC_js.reconcileSlidesInYDoc(
10029
+ chunkUSAJMMF2_js.reconcileSlidesInYDoc(
10115
10030
  slides,
10116
10031
  doc,
10117
10032
  factories,
10118
- chunk6QGTRYSC_js.LOCAL_SYNC_ORIGIN
10033
+ chunkUSAJMMF2_js.LOCAL_SYNC_ORIGIN
10119
10034
  );
10120
10035
  scheduleWriteBack();
10121
10036
  })();
@@ -10129,10 +10044,10 @@ function useYjsDocumentSync({
10129
10044
  return;
10130
10045
  }
10131
10046
  const handleChange = (_events, transaction) => {
10132
- if (transaction?.origin === chunk6QGTRYSC_js.LOCAL_SYNC_ORIGIN) {
10047
+ if (transaction?.origin === chunkUSAJMMF2_js.LOCAL_SYNC_ORIGIN) {
10133
10048
  return;
10134
10049
  }
10135
- const remoteSlides = chunk6QGTRYSC_js.readSlidesFromYDoc(
10050
+ const remoteSlides = chunkUSAJMMF2_js.readSlidesFromYDoc(
10136
10051
  doc
10137
10052
  );
10138
10053
  if (remoteSlides.length === 0) {
@@ -10148,7 +10063,7 @@ function useYjsDocumentSync({
10148
10063
  isApplyingRemoteRef.current = false;
10149
10064
  scheduleWriteBack();
10150
10065
  };
10151
- const unobserve = chunk6QGTRYSC_js.observeYDocSlides(
10066
+ const unobserve = chunkUSAJMMF2_js.observeYDocSlides(
10152
10067
  doc,
10153
10068
  handleChange
10154
10069
  );
@@ -10186,7 +10101,7 @@ function useBroadcastFollower({
10186
10101
  if (!broadcaster) {
10187
10102
  return;
10188
10103
  }
10189
- if (!chunk6QGTRYSC_js.shouldAutoFollowBroadcaster({
10104
+ if (!chunkUSAJMMF2_js.shouldAutoFollowBroadcaster({
10190
10105
  localRole: collab.config.role,
10191
10106
  broadcasterRole: broadcaster.role
10192
10107
  })) {
@@ -10276,7 +10191,7 @@ function useCollaborationLivePatch({
10276
10191
  }, [patcher, doc, isConnected, isSynced]);
10277
10192
  }
10278
10193
  function useLayoutSwitching(input) {
10279
- const { handler, slides, activeSlideIndex, ops, history } = input;
10194
+ const { handler, slides, activeSlideIndex, ops, history, onTemplateElementsChanged } = input;
10280
10195
  const [availableLayouts, setAvailableLayouts] = react.useState([]);
10281
10196
  const [isLoading, setIsLoading] = react.useState(false);
10282
10197
  const slidesRef = react.useRef(slides);
@@ -10314,12 +10229,18 @@ function useLayoutSwitching(input) {
10314
10229
  next[activeSlideIndex] = updated;
10315
10230
  return next;
10316
10231
  });
10232
+ if (onTemplateElementsChanged) {
10233
+ onTemplateElementsChanged(
10234
+ updated.id,
10235
+ await handler.getTemplateElementsForSlide(updated.id)
10236
+ );
10237
+ }
10317
10238
  history.markDirty();
10318
10239
  } finally {
10319
10240
  setIsLoading(false);
10320
10241
  }
10321
10242
  },
10322
- [handler, activeSlideIndex, ops, history]
10243
+ [handler, activeSlideIndex, ops, history, onTemplateElementsChanged]
10323
10244
  );
10324
10245
  return {
10325
10246
  availableLayouts,
@@ -10346,10 +10267,10 @@ function useTouchGestures(input) {
10346
10267
  if (!el || !enabled) {
10347
10268
  return;
10348
10269
  }
10349
- const recognizer = chunk6QGTRYSC_js.createTouchGestureRecognizer({
10270
+ const recognizer = chunkUSAJMMF2_js.createTouchGestureRecognizer({
10350
10271
  getScale: () => scaleRef.current,
10351
- minScale: chunk6QGTRYSC_js.MIN_ZOOM_SCALE,
10352
- maxScale: chunk6QGTRYSC_js.MAX_ZOOM_SCALE,
10272
+ minScale: chunkUSAJMMF2_js.MIN_ZOOM_SCALE,
10273
+ maxScale: chunkUSAJMMF2_js.MAX_ZOOM_SCALE,
10353
10274
  callbacks: {
10354
10275
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10355
10276
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10389,7 +10310,7 @@ function scrollFocusedIntoView(keyboardInset) {
10389
10310
  return;
10390
10311
  }
10391
10312
  const rect = active.getBoundingClientRect();
10392
- const delta = chunk6QGTRYSC_js.computeScrollDelta(
10313
+ const delta = chunkUSAJMMF2_js.computeScrollDelta(
10393
10314
  { top: rect.top, bottom: rect.bottom },
10394
10315
  window.innerHeight,
10395
10316
  keyboardInset
@@ -10409,8 +10330,8 @@ function useKeyboardInsets(enabled = true) {
10409
10330
  return;
10410
10331
  }
10411
10332
  const update = () => {
10412
- const metrics = chunk6QGTRYSC_js.readViewportMetrics(window);
10413
- const inset = metrics ? chunk6QGTRYSC_js.computeKeyboardInset(metrics) : 0;
10333
+ const metrics = chunkUSAJMMF2_js.readViewportMetrics(window);
10334
+ const inset = metrics ? chunkUSAJMMF2_js.computeKeyboardInset(metrics) : 0;
10414
10335
  setKeyboardInset(inset);
10415
10336
  if (inset > 0) {
10416
10337
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10421,8 +10342,8 @@ function useKeyboardInsets(enabled = true) {
10421
10342
  vv.addEventListener("scroll", update);
10422
10343
  const onFocusIn = () => {
10423
10344
  window.requestAnimationFrame(() => {
10424
- const metrics = chunk6QGTRYSC_js.readViewportMetrics(window);
10425
- const inset = metrics ? chunk6QGTRYSC_js.computeKeyboardInset(metrics) : 0;
10345
+ const metrics = chunkUSAJMMF2_js.readViewportMetrics(window);
10346
+ const inset = metrics ? chunkUSAJMMF2_js.computeKeyboardInset(metrics) : 0;
10426
10347
  if (inset > 0) {
10427
10348
  scrollFocusedIntoView(inset);
10428
10349
  }
@@ -10435,7 +10356,7 @@ function useKeyboardInsets(enabled = true) {
10435
10356
  document.removeEventListener("focusin", onFocusIn);
10436
10357
  };
10437
10358
  }, [enabled]);
10438
- return { keyboardInset, isKeyboardOpen: chunk6QGTRYSC_js.isKeyboardOpen(keyboardInset) };
10359
+ return { keyboardInset, isKeyboardOpen: chunkUSAJMMF2_js.isKeyboardOpen(keyboardInset) };
10439
10360
  }
10440
10361
 
10441
10362
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10462,7 +10383,7 @@ function buildCanvasProps(input) {
10462
10383
  } = input;
10463
10384
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10464
10385
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10465
- const fieldContext = chunk6QGTRYSC_js.buildFieldSubstitutionContext({
10386
+ const fieldContext = chunkUSAJMMF2_js.buildFieldSubstitutionContext({
10466
10387
  headerFooter: s.headerFooter,
10467
10388
  customProperties: s.customProperties,
10468
10389
  slide: activeSlide
@@ -10472,13 +10393,13 @@ function buildCanvasProps(input) {
10472
10393
  if (mode === "present") {
10473
10394
  presentation.handlePresentationAction(action);
10474
10395
  } else if (action.url) {
10475
- chunk6QGTRYSC_js.safeOpenUrl(action.url);
10396
+ chunkUSAJMMF2_js.safeOpenUrl(action.url);
10476
10397
  }
10477
10398
  };
10478
10399
  const handleHyperlinkClick = (url) => {
10479
- if (chunk6QGTRYSC_js.isPpactionUrl(url)) {
10400
+ if (chunkUSAJMMF2_js.isPpactionUrl(url)) {
10480
10401
  if (mode === "present") {
10481
- const parsed = chunk6QGTRYSC_js.parsePpactionUrl(url);
10402
+ const parsed = chunkUSAJMMF2_js.parsePpactionUrl(url);
10482
10403
  if (parsed) {
10483
10404
  presentation.handlePresentationAction({
10484
10405
  action: parsed.action,
@@ -10488,7 +10409,7 @@ function buildCanvasProps(input) {
10488
10409
  }
10489
10410
  return;
10490
10411
  }
10491
- chunk6QGTRYSC_js.safeOpenUrl(url);
10412
+ chunkUSAJMMF2_js.safeOpenUrl(url);
10492
10413
  };
10493
10414
  return {
10494
10415
  activeSlide: effectiveSlide,
@@ -10631,7 +10552,7 @@ function buildToolbarAnimationHandlers(input) {
10631
10552
  const current = activeSlide.animations ?? [];
10632
10553
  if (group === "motionPath") {
10633
10554
  propertyHandlers.handleUpdateSlide({
10634
- animations: chunk6QGTRYSC_js.applyMotionPathPreset(current, selectedElement.id, preset)
10555
+ animations: chunkUSAJMMF2_js.applyMotionPathPreset(current, selectedElement.id, preset)
10635
10556
  });
10636
10557
  return;
10637
10558
  }
@@ -10826,7 +10747,7 @@ function buildToolbarProps(input) {
10826
10747
  onOpenFile,
10827
10748
  onOpenRecentFile,
10828
10749
  onCreatePresentation: (templateId) => {
10829
- s.setSlides(chunk6QGTRYSC_js.createBackstagePresentation(templateId));
10750
+ s.setSlides(chunkUSAJMMF2_js.createBackstagePresentation(templateId));
10830
10751
  s.setActiveSlideIndex(0);
10831
10752
  s.setSelectedElementId(null);
10832
10753
  s.setSelectedElementIds([]);
@@ -10853,7 +10774,7 @@ function buildToolbarProps(input) {
10853
10774
  layoutOptions: scopedLayoutOptions,
10854
10775
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10855
10776
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10856
- templateScheme: chunk6QGTRYSC_js.templateSchemeFromTheme(s.theme?.colorScheme),
10777
+ templateScheme: chunkUSAJMMF2_js.templateSchemeFromTheme(s.theme?.colorScheme),
10857
10778
  customShows: s.customShows,
10858
10779
  activeCustomShowId: s.activeCustomShowId,
10859
10780
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10885,7 +10806,7 @@ function buildToolbarProps(input) {
10885
10806
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10886
10807
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10887
10808
  formatPainterActive: s.formatPainterActive,
10888
- canActivateFormatPainter: chunk6QGTRYSC_js.hasCopyableFormat(selectedElement),
10809
+ canActivateFormatPainter: chunkUSAJMMF2_js.hasCopyableFormat(selectedElement),
10889
10810
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10890
10811
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10891
10812
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -11154,7 +11075,7 @@ function useViewerBuildingBlocks(input) {
11154
11075
  }, [incomingContent]);
11155
11076
  const onOpenFile = react.useCallback(() => {
11156
11077
  void (async () => {
11157
- const picked = await chunk6QGTRYSC_js.openPptxFile();
11078
+ const picked = await chunkUSAJMMF2_js.openPptxFile();
11158
11079
  if (picked) {
11159
11080
  setContent(picked.buffer);
11160
11081
  }
@@ -11162,7 +11083,7 @@ function useViewerBuildingBlocks(input) {
11162
11083
  }, []);
11163
11084
  const onOpenRecentFile = react.useCallback((key) => {
11164
11085
  void (async () => {
11165
- const bytes = await chunk6QGTRYSC_js.readBackstageRecentFile(key);
11086
+ const bytes = await chunkUSAJMMF2_js.readBackstageRecentFile(key);
11166
11087
  if (bytes) {
11167
11088
  setContent(bytes);
11168
11089
  }