pptx-react-viewer 2.18.0 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +701 -0
  2. package/dist/{AiChatPanel-UN5DHPZY.js → AiChatPanel-2GBJETOY.js} +24 -24
  3. package/dist/AiChatPanel-2GBJETOY.js.br +0 -0
  4. package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
  5. package/dist/{AiChatPanel-SSSBERWJ.mjs → AiChatPanel-FZUKTQPQ.mjs} +4 -4
  6. package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
  7. package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
  8. package/dist/{Model3DScene-4RPYKC2I.js → Model3DScene-JHTI2AQ6.js} +2 -2
  9. package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
  10. package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
  11. package/dist/{Model3DScene-LYEESYAI.mjs → Model3DScene-WRRQSYAZ.mjs} +1 -1
  12. package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
  13. package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
  14. package/dist/{PowerPointViewer-Cf4YHjdF.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
  15. package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
  16. package/dist/{audience-content-store-CyS0oP6t.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
  17. package/dist/{audience-content-store-CyS0oP6t.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
  18. package/dist/{chunk-WVDM36ZM.js → chunk-7ARD2J6Y.js} +1096 -1033
  19. package/dist/chunk-7ARD2J6Y.js.br +0 -0
  20. package/dist/chunk-7ARD2J6Y.js.gz +0 -0
  21. package/dist/{chunk-QUB5OSKY.mjs → chunk-BO373PYH.mjs} +70 -115
  22. package/dist/chunk-BO373PYH.mjs.br +0 -0
  23. package/dist/chunk-BO373PYH.mjs.gz +0 -0
  24. package/dist/{chunk-ASKYZ5ZY.js → chunk-IRLOXBO7.js} +439 -484
  25. package/dist/chunk-IRLOXBO7.js.br +0 -0
  26. package/dist/chunk-IRLOXBO7.js.gz +0 -0
  27. package/dist/{chunk-RTUGI4HQ.js → chunk-MVKRI3CZ.js} +9 -0
  28. package/dist/chunk-MVKRI3CZ.js.br +0 -0
  29. package/dist/chunk-MVKRI3CZ.js.gz +0 -0
  30. package/dist/{chunk-BZOL6FXF.mjs → chunk-MWEBCWVD.mjs} +16 -2270
  31. package/dist/chunk-MWEBCWVD.mjs.br +0 -0
  32. package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
  33. package/dist/{chunk-ICZDMFF2.js → chunk-NFFV3RDS.js} +1219 -1101
  34. package/dist/chunk-NFFV3RDS.js.br +0 -0
  35. package/dist/chunk-NFFV3RDS.js.gz +0 -0
  36. package/dist/{chunk-4LWGAVAP.js → chunk-OVPJT4EQ.js} +162 -2416
  37. package/dist/chunk-OVPJT4EQ.js.br +0 -0
  38. package/dist/chunk-OVPJT4EQ.js.gz +0 -0
  39. package/dist/{chunk-MAVLV56S.js → chunk-RPJ2BIQ7.js} +3 -3
  40. package/dist/chunk-RPJ2BIQ7.js.br +0 -0
  41. package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
  42. package/dist/{chunk-SNL6LBRX.mjs → chunk-SQJBFMEX.mjs} +9 -0
  43. package/dist/chunk-SQJBFMEX.mjs.br +0 -0
  44. package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
  45. package/dist/{chunk-GODW6RNR.mjs → chunk-XF3EOHY2.mjs} +1087 -1017
  46. package/dist/chunk-XF3EOHY2.mjs.br +0 -0
  47. package/dist/chunk-XF3EOHY2.mjs.gz +0 -0
  48. package/dist/{chunk-O7FTUUXP.mjs → chunk-YWJBD7KV.mjs} +210 -92
  49. package/dist/chunk-YWJBD7KV.mjs.br +0 -0
  50. package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
  51. package/dist/{chunk-7XF6S4AM.mjs → chunk-ZMEYXAC6.mjs} +1 -1
  52. package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
  53. package/dist/{chunk-7XF6S4AM.mjs.gz → chunk-ZMEYXAC6.mjs.gz} +0 -0
  54. package/dist/i18n.js +4 -4
  55. package/dist/i18n.js.br +0 -0
  56. package/dist/i18n.js.gz +0 -0
  57. package/dist/i18n.mjs +1 -1
  58. package/dist/i18n.mjs.br +0 -0
  59. package/dist/i18n.mjs.gz +0 -0
  60. package/dist/index.d.ts +38 -1
  61. package/dist/index.js +47 -47
  62. package/dist/index.js.br +0 -0
  63. package/dist/index.js.gz +0 -0
  64. package/dist/index.mjs +6 -6
  65. package/dist/index.mjs.br +0 -0
  66. package/dist/index.mjs.gz +0 -0
  67. package/dist/internals.d.ts +102 -15
  68. package/dist/internals.d.ts.map +1 -1
  69. package/dist/internals.js +79 -79
  70. package/dist/internals.js.br +0 -0
  71. package/dist/internals.js.gz +0 -0
  72. package/dist/internals.mjs +4 -4
  73. package/dist/internals.mjs.br +0 -0
  74. package/dist/internals.mjs.gz +0 -0
  75. package/dist/{types-C_CTI-QE.d.ts → types-TCH6icpi.d.ts} +23 -1
  76. package/dist/{types-C_CTI-QE.d.ts.map → types-TCH6icpi.d.ts.map} +1 -1
  77. package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +20 -4
  78. package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts.map → useViewerBuildingBlocks-BKb0qs1j.d.ts.map} +1 -1
  79. package/dist/viewer/index.d.ts +38 -1
  80. package/dist/viewer/index.js +27 -27
  81. package/dist/viewer/index.js.br +0 -0
  82. package/dist/viewer/index.js.gz +0 -0
  83. package/dist/viewer/index.mjs +6 -6
  84. package/dist/viewer/index.mjs.br +0 -0
  85. package/dist/viewer/index.mjs.gz +0 -0
  86. package/package.json +1 -1
  87. package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
  88. package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
  89. package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
  90. package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
  91. package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
  92. package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
  93. package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
  94. package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
  95. package/dist/PowerPointViewer-Cf4YHjdF.d.ts.map +0 -1
  96. package/dist/SurfaceChart3DScene-ACPKCWLJ.js +0 -78
  97. package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
  98. package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
  99. package/dist/SurfaceChart3DScene-JR62SOYO.mjs +0 -76
  100. package/dist/SurfaceChart3DScene-JR62SOYO.mjs.br +0 -0
  101. package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
  102. package/dist/chunk-4LWGAVAP.js.br +0 -0
  103. package/dist/chunk-4LWGAVAP.js.gz +0 -0
  104. package/dist/chunk-7XF6S4AM.mjs.br +0 -0
  105. package/dist/chunk-ASKYZ5ZY.js.br +0 -0
  106. package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
  107. package/dist/chunk-BZOL6FXF.mjs.br +0 -0
  108. package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
  109. package/dist/chunk-GODW6RNR.mjs.br +0 -0
  110. package/dist/chunk-GODW6RNR.mjs.gz +0 -0
  111. package/dist/chunk-ICZDMFF2.js.br +0 -0
  112. package/dist/chunk-ICZDMFF2.js.gz +0 -0
  113. package/dist/chunk-MAVLV56S.js.br +0 -0
  114. package/dist/chunk-MAVLV56S.js.gz +0 -0
  115. package/dist/chunk-O7FTUUXP.mjs.br +0 -0
  116. package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
  117. package/dist/chunk-QUB5OSKY.mjs.br +0 -0
  118. package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
  119. package/dist/chunk-RTUGI4HQ.js.br +0 -0
  120. package/dist/chunk-RTUGI4HQ.js.gz +0 -0
  121. package/dist/chunk-SNL6LBRX.mjs.br +0 -0
  122. package/dist/chunk-SNL6LBRX.mjs.gz +0 -0
  123. package/dist/chunk-WVDM36ZM.js.br +0 -0
  124. package/dist/chunk-WVDM36ZM.js.gz +0 -0
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk4LWGAVAP_js = require('./chunk-4LWGAVAP.js');
4
- var chunkRTUGI4HQ_js = require('./chunk-RTUGI4HQ.js');
5
- var chunkWVDM36ZM_js = require('./chunk-WVDM36ZM.js');
3
+ var chunkOVPJT4EQ_js = require('./chunk-OVPJT4EQ.js');
4
+ var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
5
+ var chunk7ARD2J6Y_js = require('./chunk-7ARD2J6Y.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 = chunkWVDM36ZM_js.DEFAULT_VIRTUAL_OVERSCAN
17
+ overscan = chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
47
+ const range = chunk7ARD2J6Y_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 ??= chunkWVDM36ZM_js.createPresenceProjector();
88
+ projectorRef.current ??= chunk7ARD2J6Y_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 >= chunkWVDM36ZM_js.BROADCAST_THROTTLE_MS) {
113
+ if (elapsed >= chunk7ARD2J6Y_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
- }, chunkWVDM36ZM_js.BROADCAST_THROTTLE_MS - elapsed);
123
+ }, chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.createSyncGate(() => setSynced(true));
203
+ gateRef.current = chunk7ARD2J6Y_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
- chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
223
+ chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.validateRoomId(config.roomId);
248
+ const roomId = chunk7ARD2J6Y_js.validateRoomId(config.roomId);
249
249
  const provider = new WebrtcProvider(roomId, yDoc, opts);
250
- departureRef.current = chunkWVDM36ZM_js.createDepartureChannel(roomId, provider.awareness);
250
+ departureRef.current = chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.validateRoomId(config.roomId);
293
- const transport = config.transport ?? chunkWVDM36ZM_js.resolveTransportForServerUrl(config.serverUrl);
292
+ const roomId = chunk7ARD2J6Y_js.validateRoomId(config.roomId);
293
+ const transport = config.transport ?? chunk7ARD2J6Y_js.resolveTransportForServerUrl(config.serverUrl);
294
294
  if (transport === "webrtc") {
295
295
  await initWebrtc();
296
296
  return;
297
297
  }
298
- if (chunkWVDM36ZM_js.isMixedContentBlocked(config.serverUrl)) {
298
+ if (chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.createDepartureChannel(roomId, provider.awareness);
312
+ departureRef.current = chunk7ARD2J6Y_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
- chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
352
+ chunk7ARD2J6Y_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
- }, chunkWVDM36ZM_js.CONNECTION_TIMEOUT_MS);
361
+ }, chunk7ARD2J6Y_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
- chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
370
+ chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.registerCollaborationTeardown({
396
+ const disposeTeardown = chunk7ARD2J6Y_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 = chunkWVDM36ZM_js.sanitizeColor(config?.userColor, "#6366f1");
417
+ const userColor = chunk7ARD2J6Y_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,
@@ -479,6 +479,14 @@ function useSheetDismissDrag(onClose, threshold = 120) {
479
479
  };
480
480
  }
481
481
  var DEFAULT_MAX_HISTORY_ENTRIES = 120;
482
+ function serializeDocument(snapshot) {
483
+ return JSON.stringify({
484
+ width: snapshot.width,
485
+ height: snapshot.height,
486
+ slides: snapshot.slides,
487
+ templateElementsBySlideId: snapshot.templateElementsBySlideId
488
+ });
489
+ }
482
490
  function useEditorHistory(input) {
483
491
  const {
484
492
  slides,
@@ -524,8 +532,8 @@ function useEditorHistory(input) {
524
532
  width: canvasSize.width,
525
533
  height: canvasSize.height,
526
534
  activeSlideIndex,
527
- slides: slides.map(chunkWVDM36ZM_js.cloneSlide),
528
- templateElementsBySlideId: chunkWVDM36ZM_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
535
+ slides: slides.map(chunk7ARD2J6Y_js.cloneSlide),
536
+ templateElementsBySlideId: chunk7ARD2J6Y_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
529
537
  ...actionLabel ? { actionLabel } : {}
530
538
  };
531
539
  },
@@ -538,9 +546,9 @@ function useEditorHistory(input) {
538
546
  width: snapshot.width,
539
547
  height: snapshot.height
540
548
  });
541
- setSlides(snapshot.slides.map(chunkWVDM36ZM_js.cloneSlide));
549
+ setSlides(snapshot.slides.map(chunk7ARD2J6Y_js.cloneSlide));
542
550
  setTemplateElementsBySlideId(
543
- chunkWVDM36ZM_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
551
+ chunk7ARD2J6Y_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
544
552
  );
545
553
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
546
554
  setSelectedElementIds([]);
@@ -579,9 +587,9 @@ function useEditorHistory(input) {
579
587
  const currentSnapshot = buildHistorySnapshot();
580
588
  historyFutureRef.current.push(currentSnapshot);
581
589
  isApplyingHistoryRef.current = true;
582
- const nextSnapshot = chunk4LWGAVAP_js.cloneHistorySnapshot(previousSnapshot);
583
- lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(nextSnapshot);
584
- lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
590
+ const nextSnapshot = chunkOVPJT4EQ_js.cloneHistorySnapshot(previousSnapshot);
591
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(nextSnapshot);
592
+ lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
585
593
  applyHistorySnapshot(nextSnapshot);
586
594
  updateHistoryAvailability();
587
595
  unlockHistoryTracking();
@@ -601,9 +609,9 @@ function useEditorHistory(input) {
601
609
  const currentSnapshot = buildHistorySnapshot();
602
610
  historyPastRef.current.push(currentSnapshot);
603
611
  isApplyingHistoryRef.current = true;
604
- const targetSnapshot = chunk4LWGAVAP_js.cloneHistorySnapshot(nextSnapshot);
605
- lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(targetSnapshot);
606
- lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
612
+ const targetSnapshot = chunkOVPJT4EQ_js.cloneHistorySnapshot(nextSnapshot);
613
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(targetSnapshot);
614
+ lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
607
615
  applyHistorySnapshot(targetSnapshot);
608
616
  updateHistoryAvailability();
609
617
  unlockHistoryTracking();
@@ -620,9 +628,9 @@ function useEditorHistory(input) {
620
628
  historyPastRef.current = [];
621
629
  historyFutureRef.current = [];
622
630
  if (initialSnapshot) {
623
- const clonedInitial = chunk4LWGAVAP_js.cloneHistorySnapshot(initialSnapshot);
631
+ const clonedInitial = chunkOVPJT4EQ_js.cloneHistorySnapshot(initialSnapshot);
624
632
  lastHistorySnapshotRef.current = clonedInitial;
625
- lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
633
+ lastHistorySerializedRef.current = serializeDocument(clonedInitial);
626
634
  } else {
627
635
  lastHistorySnapshotRef.current = null;
628
636
  lastHistorySerializedRef.current = "";
@@ -654,26 +662,33 @@ function useEditorHistory(input) {
654
662
  return;
655
663
  }
656
664
  const snapshot = buildHistorySnapshot();
657
- const serialized = JSON.stringify(snapshot);
665
+ const serialized = serializeDocument(snapshot);
658
666
  if (serialized === lastHistorySerializedRef.current) {
667
+ const previous = lastHistorySnapshotRef.current;
668
+ if (previous && previous.activeSlideIndex !== snapshot.activeSlideIndex) {
669
+ lastHistorySnapshotRef.current = {
670
+ ...previous,
671
+ activeSlideIndex: snapshot.activeSlideIndex
672
+ };
673
+ }
659
674
  lastCheapHashRef.current = cheapHash;
660
675
  return;
661
676
  }
662
677
  const previousSnapshot = lastHistorySnapshotRef.current;
663
678
  if (!previousSnapshot) {
664
- lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(snapshot);
679
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(snapshot);
665
680
  lastHistorySerializedRef.current = serialized;
666
681
  lastCheapHashRef.current = cheapHash;
667
682
  updateHistoryAvailability();
668
683
  return;
669
684
  }
670
685
  onDirtyRef.current?.();
671
- historyPastRef.current.push(chunk4LWGAVAP_js.cloneHistorySnapshot(previousSnapshot));
686
+ historyPastRef.current.push(chunkOVPJT4EQ_js.cloneHistorySnapshot(previousSnapshot));
672
687
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
673
688
  historyPastRef.current.shift();
674
689
  }
675
690
  historyFutureRef.current = [];
676
- lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(snapshot);
691
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(snapshot);
677
692
  lastHistorySerializedRef.current = serialized;
678
693
  lastCheapHashRef.current = cheapHash;
679
694
  updateHistoryAvailability();
@@ -733,9 +748,9 @@ function useZoomViewport({
733
748
  const canvasStageRef = react.useRef(null);
734
749
  const canvasViewportRef = react.useRef(null);
735
750
  const renderScaleRef = react.useRef(1);
736
- const wheelBufferRef = react.useRef(chunkWVDM36ZM_js.createWheelStepBuffer());
751
+ const wheelBufferRef = react.useRef(chunk7ARD2J6Y_js.createWheelStepBuffer());
737
752
  const storeRef = react.useRef(null);
738
- storeRef.current ??= chunkWVDM36ZM_js.createViewerZoomStore();
753
+ storeRef.current ??= chunk7ARD2J6Y_js.createViewerZoomStore();
739
754
  const store = storeRef.current;
740
755
  const scale = useViewerStore(store, selectZoom);
741
756
  const setScale = react.useCallback(
@@ -796,7 +811,7 @@ function useZoomViewport({
796
811
  if (!wrapper || !canvasViewport) {
797
812
  return;
798
813
  }
799
- const boundedScale = chunkWVDM36ZM_js.clampZoomScale(nextScale);
814
+ const boundedScale = chunk7ARD2J6Y_js.clampZoomScale(nextScale);
800
815
  const nextEditorScale = fitScale * boundedScale;
801
816
  const centerX = (bounds.minX + bounds.maxX) / 2;
802
817
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -833,29 +848,29 @@ function useZoomViewport({
833
848
  selectedElements.forEach((element) => {
834
849
  minX = Math.min(minX, element.x);
835
850
  minY = Math.min(minY, element.y);
836
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE));
837
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE));
851
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE));
852
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE));
838
853
  });
839
854
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
840
855
  return;
841
856
  }
842
857
  const selectionBounds = { minX, minY, maxX, maxY };
843
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
844
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
858
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
859
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
845
860
  const availableWidth = Math.max(
846
- effectiveEditorDimensions.width - chunk4LWGAVAP_js.ZOOM_TO_SELECTION_PADDING,
847
- chunk4LWGAVAP_js.MIN_ELEMENT_SIZE
861
+ effectiveEditorDimensions.width - chunkOVPJT4EQ_js.ZOOM_TO_SELECTION_PADDING,
862
+ chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE
848
863
  );
849
864
  const availableHeight = Math.max(
850
- effectiveEditorDimensions.height - chunk4LWGAVAP_js.ZOOM_TO_SELECTION_PADDING,
851
- chunk4LWGAVAP_js.MIN_ELEMENT_SIZE
865
+ effectiveEditorDimensions.height - chunkOVPJT4EQ_js.ZOOM_TO_SELECTION_PADDING,
866
+ chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE
852
867
  );
853
868
  const targetEditorScale = Math.min(
854
869
  availableWidth / boundsWidth,
855
870
  availableHeight / boundsHeight
856
871
  );
857
872
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
858
- const nextScale = chunkWVDM36ZM_js.clampZoomScale(targetEditorScale / safeFitScale);
873
+ const nextScale = chunk7ARD2J6Y_js.clampZoomScale(targetEditorScale / safeFitScale);
859
874
  setScale(nextScale);
860
875
  window.requestAnimationFrame(() => {
861
876
  window.requestAnimationFrame(() => {
@@ -872,14 +887,14 @@ function useZoomViewport({
872
887
  ]);
873
888
  const handleWheel = react.useCallback(
874
889
  (event) => {
875
- const mapped = chunkWVDM36ZM_js.mapEditingWheel(event, wheelBufferRef.current, true);
890
+ const mapped = chunk7ARD2J6Y_js.mapEditingWheel(event, wheelBufferRef.current, true);
876
891
  if (mapped.intent !== "zoom") {
877
892
  return;
878
893
  }
879
894
  event.preventDefault();
880
895
  store.dispatch({
881
896
  type: "set-zoom",
882
- zoom: chunkWVDM36ZM_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
897
+ zoom: chunk7ARD2J6Y_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
883
898
  });
884
899
  },
885
900
  [store]
@@ -967,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
967
982
  const command = step.command;
968
983
  const timer = window.setTimeout(
969
984
  () => {
970
- chunk4LWGAVAP_js.executeMediaCommand(command);
985
+ chunkOVPJT4EQ_js.executeMediaCommand(command);
971
986
  },
972
987
  Math.max(0, step.delayMs)
973
988
  );
@@ -1104,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1104
1119
  }))
1105
1120
  );
1106
1121
  entranceAnimations.forEach((animation, animationIndex) => {
1107
- const delay = chunkWVDM36ZM_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1122
+ const delay = chunk7ARD2J6Y_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1108
1123
  const timer = window.setTimeout(() => {
1109
1124
  setPresentationAnimations(
1110
1125
  (previousAnimations) => previousAnimations.map(
@@ -1136,7 +1151,7 @@ function useAnimationPlayback(input) {
1136
1151
  (controller, group) => {
1137
1152
  driveBuildReveal(
1138
1153
  controller,
1139
- chunkWVDM36ZM_js.PresentationAnimationController.collectBuildStepIds(group),
1154
+ chunk7ARD2J6Y_js.PresentationAnimationController.collectBuildStepIds(group),
1140
1155
  setPresentationElementStates,
1141
1156
  buildRafRef
1142
1157
  );
@@ -1199,7 +1214,7 @@ function useAnimationPlayback(input) {
1199
1214
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1200
1215
  return;
1201
1216
  }
1202
- const controller = chunkWVDM36ZM_js.PresentationAnimationController.fromSlide(slide);
1217
+ const controller = chunk7ARD2J6Y_js.PresentationAnimationController.fromSlide(slide);
1203
1218
  controllerRef.current = controller;
1204
1219
  setPresentationKeyframesCss(controller.keyframesCss);
1205
1220
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1357,12 +1372,12 @@ function useAnimationPlayback(input) {
1357
1372
  presentationTimersRef
1358
1373
  };
1359
1374
  }
1360
- var PRESENTER_CHANNEL_NAME = chunkWVDM36ZM_js.PRESENTATION_CHANNEL_NAME;
1361
- var AUDIENCE_HASH = chunkWVDM36ZM_js.PRESENTATION_HASH;
1362
- var PRESENTER_MSG_ORIGIN = chunkWVDM36ZM_js.PRESENTATION_MESSAGE_ORIGIN;
1363
- var AUDIENCE_NONCE_KEY = chunkWVDM36ZM_js.PRESENTATION_NONCE_KEY;
1375
+ var PRESENTER_CHANNEL_NAME = chunk7ARD2J6Y_js.PRESENTATION_CHANNEL_NAME;
1376
+ var AUDIENCE_HASH = chunk7ARD2J6Y_js.PRESENTATION_HASH;
1377
+ var PRESENTER_MSG_ORIGIN = chunk7ARD2J6Y_js.PRESENTATION_MESSAGE_ORIGIN;
1378
+ var AUDIENCE_NONCE_KEY = chunk7ARD2J6Y_js.PRESENTATION_NONCE_KEY;
1364
1379
  function generateSessionId() {
1365
- return chunkWVDM36ZM_js.createPresentationSessionId();
1380
+ return chunk7ARD2J6Y_js.createPresentationSessionId();
1366
1381
  }
1367
1382
  function parseAudienceNonce() {
1368
1383
  const hash = window.location.hash;
@@ -1398,7 +1413,7 @@ function usePresenterWindow(input) {
1398
1413
  }, []);
1399
1414
  const swapDisplays = react.useCallback(async () => {
1400
1415
  const audience = audienceWindowRef.current;
1401
- return audience && !audience.closed ? chunkWVDM36ZM_js.swapPresentationWindows(window, audience) : false;
1416
+ return audience && !audience.closed ? chunk7ARD2J6Y_js.swapPresentationWindows(window, audience) : false;
1402
1417
  }, []);
1403
1418
  const syncSlideToAudience = react.useCallback(
1404
1419
  (slideIndex) => {
@@ -1462,7 +1477,7 @@ function usePresenterWindow(input) {
1462
1477
  pollTimerRef.current = null;
1463
1478
  }
1464
1479
  if (closingSessionId) {
1465
- void chunkWVDM36ZM_js.clearAudienceContent(closingSessionId);
1480
+ void chunk7ARD2J6Y_js.clearAudienceContent(closingSessionId);
1466
1481
  }
1467
1482
  }, [getChannel]);
1468
1483
  const openAudienceWindow = react.useCallback(() => {
@@ -1480,10 +1495,10 @@ function usePresenterWindow(input) {
1480
1495
  audienceWindowRef.current = blankWin;
1481
1496
  const sessionId = generateSessionId();
1482
1497
  sessionIdRef.current = sessionId;
1483
- const audienceUrl = chunkWVDM36ZM_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1484
- void chunkWVDM36ZM_js.resolveAudienceScreenPlacement(window).then((placement) => {
1498
+ const audienceUrl = chunk7ARD2J6Y_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1499
+ void chunk7ARD2J6Y_js.resolveAudienceScreenPlacement(window).then((placement) => {
1485
1500
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1486
- chunkWVDM36ZM_js.placeAudienceWindow(blankWin, placement);
1501
+ chunk7ARD2J6Y_js.placeAudienceWindow(blankWin, placement);
1487
1502
  }
1488
1503
  return void 0;
1489
1504
  });
@@ -1513,7 +1528,7 @@ function usePresenterWindow(input) {
1513
1528
  }
1514
1529
  };
1515
1530
  if (content) {
1516
- void chunkWVDM36ZM_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1531
+ void chunk7ARD2J6Y_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1517
1532
  } else {
1518
1533
  navigateOrClose(true);
1519
1534
  }
@@ -1539,7 +1554,7 @@ function usePresenterWindow(input) {
1539
1554
  }
1540
1555
  const handleMessage = (event) => {
1541
1556
  const message = event.data;
1542
- if (chunkWVDM36ZM_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1557
+ if (chunk7ARD2J6Y_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1543
1558
  syncStateToAudience(snapshotRef.current);
1544
1559
  }
1545
1560
  };
@@ -1568,7 +1583,7 @@ function usePresenterWindow(input) {
1568
1583
  react.useEffect(() => {
1569
1584
  const handleBeforeUnload = () => {
1570
1585
  if (sessionIdRef.current) {
1571
- void chunkWVDM36ZM_js.clearAudienceContent(sessionIdRef.current);
1586
+ void chunk7ARD2J6Y_js.clearAudienceContent(sessionIdRef.current);
1572
1587
  }
1573
1588
  };
1574
1589
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1630,7 +1645,7 @@ function useAudienceMode(input) {
1630
1645
  }
1631
1646
  channel.onmessage = (event) => {
1632
1647
  const data = event.data;
1633
- if (!chunkWVDM36ZM_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1648
+ if (!chunk7ARD2J6Y_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1634
1649
  return;
1635
1650
  }
1636
1651
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1646,16 +1661,16 @@ function useAudienceMode(input) {
1646
1661
  }
1647
1662
  if (data.type === "presenter-exit") {
1648
1663
  if (expectedSessionId) {
1649
- void chunkWVDM36ZM_js.clearAudienceContent(expectedSessionId);
1664
+ void chunk7ARD2J6Y_js.clearAudienceContent(expectedSessionId);
1650
1665
  }
1651
- if (chunkWVDM36ZM_js.endAudienceDisplay(window)) {
1666
+ if (chunk7ARD2J6Y_js.endAudienceDisplay(window)) {
1652
1667
  handlers.onPresenterEnded?.();
1653
1668
  }
1654
1669
  }
1655
1670
  };
1656
1671
  if (expectedSessionId) {
1657
1672
  channel.postMessage({
1658
- origin: chunkWVDM36ZM_js.PRESENTATION_MESSAGE_ORIGIN,
1673
+ origin: chunk7ARD2J6Y_js.PRESENTATION_MESSAGE_ORIGIN,
1659
1674
  type: "audience-ready",
1660
1675
  sessionId: expectedSessionId
1661
1676
  });
@@ -1669,7 +1684,7 @@ function useAudienceMode(input) {
1669
1684
  }, []);
1670
1685
  }
1671
1686
  function usePresentationKeyboard(input) {
1672
- const wheelBufferRef = react.useRef(chunkWVDM36ZM_js.createWheelStepBuffer());
1687
+ const wheelBufferRef = react.useRef(chunk7ARD2J6Y_js.createWheelStepBuffer());
1673
1688
  const {
1674
1689
  mode,
1675
1690
  movePresentationSlide,
@@ -1690,14 +1705,14 @@ function usePresentationKeyboard(input) {
1690
1705
  presentationSlideIndex,
1691
1706
  setShowRehearsalSummary
1692
1707
  } = input;
1693
- const keyBufferRef = react.useRef(chunkWVDM36ZM_js.createPresentationKeyBuffer());
1708
+ const keyBufferRef = react.useRef(chunk7ARD2J6Y_js.createPresentationKeyBuffer());
1694
1709
  react.useEffect(() => {
1695
- if (mode !== "present" || !chunkWVDM36ZM_js.acceptsPresentationInput()) {
1696
- keyBufferRef.current = chunkWVDM36ZM_js.createPresentationKeyBuffer();
1710
+ if (mode !== "present" || !chunk7ARD2J6Y_js.acceptsPresentationInput()) {
1711
+ keyBufferRef.current = chunk7ARD2J6Y_js.createPresentationKeyBuffer();
1697
1712
  return;
1698
1713
  }
1699
1714
  const handleKeyDown = (event) => {
1700
- const mapped = chunkWVDM36ZM_js.mapPresentationKey(event, keyBufferRef.current);
1715
+ const mapped = chunk7ARD2J6Y_js.mapPresentationKey(event, keyBufferRef.current);
1701
1716
  if (mapped.action === "none") {
1702
1717
  return;
1703
1718
  }
@@ -1717,12 +1732,12 @@ function usePresentationKeyboard(input) {
1717
1732
  movePresentationSlide(-1);
1718
1733
  return;
1719
1734
  case "first": {
1720
- const first = chunkWVDM36ZM_js.firstShowSlideIndex(showSlideIndexes);
1735
+ const first = chunk7ARD2J6Y_js.firstShowSlideIndex(showSlideIndexes);
1721
1736
  navigateToSlide(first ?? 0);
1722
1737
  return;
1723
1738
  }
1724
1739
  case "last": {
1725
- const last = chunkWVDM36ZM_js.lastShowSlideIndex(showSlideIndexes);
1740
+ const last = chunk7ARD2J6Y_js.lastShowSlideIndex(showSlideIndexes);
1726
1741
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1727
1742
  return;
1728
1743
  }
@@ -1760,10 +1775,10 @@ function usePresentationKeyboard(input) {
1760
1775
  }
1761
1776
  };
1762
1777
  const handleWheel = (event) => {
1763
- if (mode !== "present" || !chunkWVDM36ZM_js.acceptsPresentationInput()) {
1778
+ if (mode !== "present" || !chunk7ARD2J6Y_js.acceptsPresentationInput()) {
1764
1779
  return;
1765
1780
  }
1766
- const mapped = chunkWVDM36ZM_js.mapPresentationWheel(event, wheelBufferRef.current);
1781
+ const mapped = chunk7ARD2J6Y_js.mapPresentationWheel(event, wheelBufferRef.current);
1767
1782
  if (mapped.intent === "next-slide") {
1768
1783
  event.preventDefault();
1769
1784
  movePresentationSlide(1);
@@ -1896,7 +1911,7 @@ function useRehearsalTimings(input) {
1896
1911
 
1897
1912
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1898
1913
  function handlePresentationActionImpl(action, deps) {
1899
- chunkWVDM36ZM_js.runPresentationAction(
1914
+ chunk7ARD2J6Y_js.runPresentationAction(
1900
1915
  action,
1901
1916
  { slideCount: deps.slidesLength },
1902
1917
  {
@@ -1918,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
1918
1933
  function executeSlideTransition(nextSlideIndex, deps) {
1919
1934
  const incomingSlide = deps.slides[nextSlideIndex];
1920
1935
  const transition = incomingSlide?.transition;
1921
- const durationMs = deps.playTransition ? chunkWVDM36ZM_js.resolveTransitionDurationMs(transition) : 0;
1936
+ const durationMs = deps.playTransition ? chunk7ARD2J6Y_js.resolveTransitionDurationMs(transition) : 0;
1922
1937
  deps.clearPresentationTimers();
1923
1938
  deps.setPresentationSlideIndex(nextSlideIndex);
1924
1939
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -1977,7 +1992,7 @@ function useSlideNavigation(input) {
1977
1992
  });
1978
1993
  const scheduleAutoAdvanceForSlide = react.useCallback(
1979
1994
  (slideIndex) => {
1980
- const delayMs = chunkWVDM36ZM_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1995
+ const delayMs = chunk7ARD2J6Y_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1981
1996
  if (delayMs === void 0) {
1982
1997
  return;
1983
1998
  }
@@ -2000,7 +2015,7 @@ function useSlideNavigation(input) {
2000
2015
  if (availableSlideIndexes.length === 0) {
2001
2016
  return;
2002
2017
  }
2003
- const pastLastSlide = direction === 1 && !chunkWVDM36ZM_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2018
+ const pastLastSlide = direction === 1 && !chunk7ARD2J6Y_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2004
2019
  if (rehearsing && pastLastSlide) {
2005
2020
  recordCurrentSlideTime(presentationSlideIndex);
2006
2021
  try {
@@ -2018,9 +2033,9 @@ function useSlideNavigation(input) {
2018
2033
  onAdvancePastLastSlide();
2019
2034
  return;
2020
2035
  }
2021
- const nextSlideIndex = direction === 1 ? chunkWVDM36ZM_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2036
+ const nextSlideIndex = direction === 1 ? chunk7ARD2J6Y_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2022
2037
  loop: Boolean(loopContinuously) && !rehearsing
2023
- }) : chunkWVDM36ZM_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2038
+ }) : chunk7ARD2J6Y_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2024
2039
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2025
2040
  return;
2026
2041
  }
@@ -2165,22 +2180,22 @@ function useZoomNavigation(input) {
2165
2180
  };
2166
2181
  }
2167
2182
  function usePresenterConsole(slideIndex, active) {
2168
- const timerRef = react.useRef(chunkWVDM36ZM_js.createPresenterTimer());
2169
- const [snapshot, setSnapshot] = react.useState(() => chunkWVDM36ZM_js.createInitialPresentationSnapshot(slideIndex));
2183
+ const timerRef = react.useRef(chunk7ARD2J6Y_js.createPresenterTimer());
2184
+ const [snapshot, setSnapshot] = react.useState(() => chunk7ARD2J6Y_js.createInitialPresentationSnapshot(slideIndex));
2170
2185
  const patch = react.useCallback((value) => {
2171
- setSnapshot((current) => chunkWVDM36ZM_js.mergePresentationSnapshot(current, value));
2186
+ setSnapshot((current) => chunk7ARD2J6Y_js.mergePresentationSnapshot(current, value));
2172
2187
  }, []);
2173
2188
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2174
2189
  react.useEffect(() => {
2175
2190
  if (!active) {
2176
2191
  return;
2177
2192
  }
2178
- timerRef.current = chunkWVDM36ZM_js.resetPresenterTimer();
2193
+ timerRef.current = chunk7ARD2J6Y_js.resetPresenterTimer();
2179
2194
  patch({ paused: false, elapsedMs: 0 });
2180
2195
  const timer = window.setInterval(() => {
2181
2196
  patch({
2182
2197
  paused: timerRef.current.paused,
2183
- elapsedMs: chunkWVDM36ZM_js.presenterElapsed(timerRef.current)
2198
+ elapsedMs: chunk7ARD2J6Y_js.presenterElapsed(timerRef.current)
2184
2199
  });
2185
2200
  }, 1e3);
2186
2201
  return () => window.clearInterval(timer);
@@ -2190,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
2190
2205
  applyAudienceSnapshot: setSnapshot,
2191
2206
  setBlackout: (blackout) => patch({ blackout }),
2192
2207
  toggleTimer: () => {
2193
- timerRef.current = chunkWVDM36ZM_js.togglePresenterTimer(timerRef.current);
2208
+ timerRef.current = chunk7ARD2J6Y_js.togglePresenterTimer(timerRef.current);
2194
2209
  patch({
2195
2210
  paused: timerRef.current.paused,
2196
- elapsedMs: chunkWVDM36ZM_js.presenterElapsed(timerRef.current)
2211
+ elapsedMs: chunk7ARD2J6Y_js.presenterElapsed(timerRef.current)
2197
2212
  });
2198
2213
  },
2199
2214
  resetTimer: () => {
2200
- timerRef.current = chunkWVDM36ZM_js.resetPresenterTimer();
2215
+ timerRef.current = chunk7ARD2J6Y_js.resetPresenterTimer();
2201
2216
  patch({ paused: false, elapsedMs: 0 });
2202
2217
  },
2203
2218
  stepZoom: (direction) => setSnapshot(
2204
- (current) => chunkWVDM36ZM_js.mergePresentationSnapshot(current, {
2205
- zoom: chunkWVDM36ZM_js.stepPresenterZoom(
2219
+ (current) => chunk7ARD2J6Y_js.mergePresentationSnapshot(current, {
2220
+ zoom: chunk7ARD2J6Y_js.stepPresenterZoom(
2206
2221
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2207
2222
  direction
2208
2223
  )
@@ -2248,7 +2263,7 @@ function usePresentationMode(input) {
2248
2263
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2249
2264
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2250
2265
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2251
- const showGuard = react.useMemo(() => chunkWVDM36ZM_js.createPresenterShowGuard(), []);
2266
+ const showGuard = react.useMemo(() => chunk7ARD2J6Y_js.createPresenterShowGuard(), []);
2252
2267
  const {
2253
2268
  presentationAnimations,
2254
2269
  presentationElementStates,
@@ -2327,7 +2342,7 @@ function usePresentationMode(input) {
2327
2342
  });
2328
2343
  const movePresentationSlide = react.useCallback(
2329
2344
  (direction, trigger = "explicit") => {
2330
- if (!chunkWVDM36ZM_js.acceptsPresentationInput()) {
2345
+ if (!chunk7ARD2J6Y_js.acceptsPresentationInput()) {
2331
2346
  return;
2332
2347
  }
2333
2348
  if (endOfShowVisible) {
@@ -2465,7 +2480,7 @@ function usePresentationMode(input) {
2465
2480
  if (mode !== "present") {
2466
2481
  return;
2467
2482
  }
2468
- return chunkWVDM36ZM_js.attachPresentationVisibilityPause({
2483
+ return chunk7ARD2J6Y_js.attachPresentationVisibilityPause({
2469
2484
  root: containerRef.current ?? void 0,
2470
2485
  onHidden: () => clearPresentationTimersRef.current(),
2471
2486
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2545,11 +2560,11 @@ function usePresentationMode(input) {
2545
2560
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2546
2561
  return void 0;
2547
2562
  }
2548
- return chunkWVDM36ZM_js.buildMorphTransitionPlan(
2563
+ return chunk7ARD2J6Y_js.buildMorphTransitionPlan(
2549
2564
  slides[transitionOverlay.outgoingSlideIndex],
2550
2565
  slides[transitionOverlay.incomingSlideIndex],
2551
2566
  transitionOverlay.durationMs,
2552
- chunkWVDM36ZM_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2567
+ chunk7ARD2J6Y_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2553
2568
  );
2554
2569
  }, [transitionOverlay, slides]);
2555
2570
  const morphedElementStates = react.useMemo(() => {
@@ -2570,7 +2585,7 @@ function usePresentationMode(input) {
2570
2585
  if (!morphPlan) {
2571
2586
  return presentationKeyframesCss;
2572
2587
  }
2573
- const imageRules = chunkWVDM36ZM_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2588
+ const imageRules = chunk7ARD2J6Y_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2574
2589
  return `${presentationKeyframesCss ?? ""}
2575
2590
  ${morphPlan.keyframesCss}
2576
2591
  ${imageRules}`;
@@ -2866,7 +2881,7 @@ function useFindReplace({
2866
2881
  const [findResults, setFindResults] = react.useState([]);
2867
2882
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2868
2883
  const performFind = react.useCallback(() => {
2869
- const results = chunkWVDM36ZM_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2884
+ const results = chunk7ARD2J6Y_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2870
2885
  if (!findQuery) {
2871
2886
  setFindResults([]);
2872
2887
  setFindResultIndex(-1);
@@ -2900,7 +2915,7 @@ function useFindReplace({
2900
2915
  return;
2901
2916
  }
2902
2917
  onUpdateSlides(
2903
- (prevSlides) => chunkWVDM36ZM_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2918
+ (prevSlides) => chunk7ARD2J6Y_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2904
2919
  );
2905
2920
  onMarkDirty();
2906
2921
  },
@@ -2922,9 +2937,9 @@ function useFindReplace({
2922
2937
  }, [findResults, applyReplacements, performFind]);
2923
2938
  react.useEffect(() => {
2924
2939
  const handler = (event) => {
2925
- const { action } = chunkWVDM36ZM_js.mapEditorKey(event, {
2940
+ const { action } = chunk7ARD2J6Y_js.mapEditorKey(event, {
2926
2941
  canEdit: mode === "edit",
2927
- isTextInputTarget: chunkWVDM36ZM_js.isEditorTextInputTarget(event.target)
2942
+ isTextInputTarget: chunk7ARD2J6Y_js.isEditorTextInputTarget(event.target)
2928
2943
  });
2929
2944
  if (action !== "find") {
2930
2945
  return;
@@ -3434,7 +3449,7 @@ function useViewerCoreState(_input) {
3434
3449
  const marqueeStateRef = react.useRef(null);
3435
3450
  const isDrawingRef = react.useRef(false);
3436
3451
  const justInteractedRef = react.useRef(false);
3437
- const livePatcher = react.useMemo(() => chunkWVDM36ZM_js.createCollaborationLivePatcher(), []);
3452
+ const livePatcher = react.useMemo(() => chunk7ARD2J6Y_js.createCollaborationLivePatcher(), []);
3438
3453
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3439
3454
  const slidesRef = react.useRef([]);
3440
3455
  const [mode, setMode] = react.useState("edit");
@@ -3443,8 +3458,8 @@ function useViewerCoreState(_input) {
3443
3458
  const [slides, setSlides] = react.useState([]);
3444
3459
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3445
3460
  const [canvasSize, setCanvasSize] = react.useState({
3446
- width: chunk4LWGAVAP_js.DEFAULT_CANVAS_WIDTH,
3447
- height: chunk4LWGAVAP_js.DEFAULT_CANVAS_HEIGHT
3461
+ width: chunkOVPJT4EQ_js.DEFAULT_CANVAS_WIDTH,
3462
+ height: chunkOVPJT4EQ_js.DEFAULT_CANVAS_HEIGHT
3448
3463
  });
3449
3464
  const [slideSizeEmu, setSlideSizeEmu] = react.useState();
3450
3465
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
@@ -3465,7 +3480,7 @@ function useViewerCoreState(_input) {
3465
3480
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3466
3481
  inlineEditingTextRef.current = resolved;
3467
3482
  setInlineEditingTextBase(value);
3468
- chunkWVDM36ZM_js.publishLiveInlineText(
3483
+ chunk7ARD2J6Y_js.publishLiveInlineText(
3469
3484
  livePatcher,
3470
3485
  slidesRef.current[activeSlideIndexRef.current],
3471
3486
  inlineEditingElementIdRef.current,
@@ -3804,7 +3819,7 @@ function useLoadContent({
3804
3819
  );
3805
3820
  }
3806
3821
  const previousHandler = handlerRef.current;
3807
- const handler = new chunkWVDM36ZM_js.PptxHandler();
3822
+ const handler = new chunk7ARD2J6Y_js.PptxHandler();
3808
3823
  const parsed = await handler.load(buffer);
3809
3824
  if (cancelled || token !== renderTokenRef.current) {
3810
3825
  handler.dispose();
@@ -3816,7 +3831,7 @@ function useLoadContent({
3816
3831
  handlerRef.current = null;
3817
3832
  const mediaElements = [];
3818
3833
  for (const slide of parsed.slides) {
3819
- chunkWVDM36ZM_js.collectMediaElements(slide.elements, mediaElements);
3834
+ chunk7ARD2J6Y_js.collectMediaElements(slide.elements, mediaElements);
3820
3835
  }
3821
3836
  for (const url of mediaDataUrls.values()) {
3822
3837
  if (url.startsWith("blob:")) {
@@ -3857,7 +3872,7 @@ function useLoadContent({
3857
3872
  }
3858
3873
  })
3859
3874
  );
3860
- const { paths: imagePaths, refs: imageRefs } = chunkWVDM36ZM_js.collectImagePaths(parsed.slides);
3875
+ const { paths: imagePaths, refs: imageRefs } = chunk7ARD2J6Y_js.collectImagePaths(parsed.slides);
3861
3876
  let nextSlides = parsed.slides;
3862
3877
  if (imagePaths.size > 0) {
3863
3878
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3912,12 +3927,12 @@ function useLoadContent({
3912
3927
  }
3913
3928
  }
3914
3929
  handlerRef.current = handler;
3915
- const partition = chunkWVDM36ZM_js.partitionTemplateElements(nextSlides);
3930
+ const partition = chunk7ARD2J6Y_js.partitionTemplateElements(nextSlides);
3916
3931
  setSlides(partition.slides);
3917
3932
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
3918
3933
  setCanvasSize({
3919
- width: parsed.width ?? chunk4LWGAVAP_js.DEFAULT_CANVAS_WIDTH,
3920
- height: parsed.height ?? chunk4LWGAVAP_js.DEFAULT_CANVAS_HEIGHT
3934
+ width: parsed.width ?? chunkOVPJT4EQ_js.DEFAULT_CANVAS_WIDTH,
3935
+ height: parsed.height ?? chunkOVPJT4EQ_js.DEFAULT_CANVAS_HEIGHT
3921
3936
  });
3922
3937
  setSlideSizeEmu(
3923
3938
  typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
@@ -3934,7 +3949,7 @@ function useLoadContent({
3934
3949
  setThemeOptions(parsed.themeOptions ?? []);
3935
3950
  setCustomShows(parsed.customShows ?? []);
3936
3951
  setActiveCustomShowId(
3937
- chunkWVDM36ZM_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3952
+ chunk7ARD2J6Y_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3938
3953
  );
3939
3954
  setSections(parsed.sections ?? []);
3940
3955
  setPresentationProperties(parsed.presentationProperties ?? {});
@@ -3956,7 +3971,7 @@ function useLoadContent({
3956
3971
  setHasMacros(parsed.hasMacros === true);
3957
3972
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
3958
3973
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
3959
- setGuides(chunkWVDM36ZM_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3974
+ setGuides(chunk7ARD2J6Y_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3960
3975
  setActiveSlideIndex(0);
3961
3976
  clearSelection();
3962
3977
  setIsDirty(false);
@@ -3964,7 +3979,7 @@ function useLoadContent({
3964
3979
  onContentApplied?.();
3965
3980
  } catch (err) {
3966
3981
  if (!cancelled && token === renderTokenRef.current) {
3967
- if (err instanceof chunkWVDM36ZM_js.EncryptedFileError) {
3982
+ if (err instanceof chunk7ARD2J6Y_js.EncryptedFileError) {
3968
3983
  setIsEncrypted(true);
3969
3984
  } else {
3970
3985
  setError(err instanceof Error ? err.message : String(err));
@@ -3989,24 +4004,12 @@ function useLoadContent({
3989
4004
  }, [content]);
3990
4005
  return { handlerRef };
3991
4006
  }
3992
-
3993
- // src/viewer/hooks/useAutosave-helpers.ts
3994
- var DEFAULT_AUTOSAVE_INTERVAL_SECONDS = 120;
3995
- var MIN_AUTOSAVE_INTERVAL_SECONDS = 10;
3996
- function computeAutosaveIntervalMs(intervalSeconds) {
3997
- return Math.max(intervalSeconds, MIN_AUTOSAVE_INTERVAL_SECONDS) * 1e3;
3998
- }
3999
-
4000
- // src/viewer/hooks/useAutosave.ts
4001
4007
  function useAutosave(input) {
4002
- const {
4003
- isDirty,
4004
- filePath,
4005
- serializeSlides,
4006
- intervalSeconds = DEFAULT_AUTOSAVE_INTERVAL_SECONDS,
4007
- enabled = true,
4008
- getChangeSources
4009
- } = input;
4008
+ const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
4009
+ const intervalMs = chunk7ARD2J6Y_js.resolveAutosaveIntervalMs({
4010
+ hostIntervalMs: input.intervalMs,
4011
+ optionsIntervalSeconds: input.intervalSeconds
4012
+ });
4010
4013
  const [autosaveStatus, setAutosaveStatus] = react.useState({
4011
4014
  state: "idle"
4012
4015
  });
@@ -4034,7 +4037,7 @@ function useAutosave(input) {
4034
4037
  return;
4035
4038
  }
4036
4039
  const sources = changeSourcesRef.current?.() ?? [];
4037
- if (!chunkWVDM36ZM_js.shouldWriteAutosaveSnapshot({
4040
+ if (!chunk7ARD2J6Y_js.shouldWriteAutosaveSnapshot({
4038
4041
  filePath: path,
4039
4042
  isDirty: isDirtyRef.current,
4040
4043
  saving: isSavingRef.current,
@@ -4052,8 +4055,8 @@ function useAutosave(input) {
4052
4055
  isSavingRef.current = false;
4053
4056
  return;
4054
4057
  }
4055
- await chunkWVDM36ZM_js.saveAutosaveSnapshot(path, data);
4056
- lastSnapshotRef.current = chunkWVDM36ZM_js.autosaveSnapshotMark(path, sources);
4058
+ await chunk7ARD2J6Y_js.saveAutosaveSnapshot(path, data);
4059
+ lastSnapshotRef.current = chunk7ARD2J6Y_js.autosaveSnapshotMark(path, sources);
4057
4060
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4058
4061
  } catch (err) {
4059
4062
  setAutosaveStatus({
@@ -4077,12 +4080,11 @@ function useAutosave(input) {
4077
4080
  return;
4078
4081
  }
4079
4082
  setAutosaveStatus((prev) => prev.state === "disabled" ? { state: "idle" } : prev);
4080
- const ms = computeAutosaveIntervalMs(intervalSeconds);
4081
4083
  const id = setInterval(() => {
4082
4084
  void doAutosave({ polled: true });
4083
- }, ms);
4085
+ }, intervalMs);
4084
4086
  return () => clearInterval(id);
4085
- }, [enabled, filePath, intervalSeconds, doAutosave]);
4087
+ }, [enabled, filePath, intervalMs, doAutosave]);
4086
4088
  return {
4087
4089
  autosaveStatus,
4088
4090
  triggerAutosave: () => doAutosave()
@@ -4140,11 +4142,11 @@ function useElementOperations(input) {
4140
4142
  (elementId, updates) => {
4141
4143
  if (masterView?.target) {
4142
4144
  applyMasterViewWrite(
4143
- chunkWVDM36ZM_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4145
+ chunk7ARD2J6Y_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4144
4146
  );
4145
4147
  return;
4146
4148
  }
4147
- if (chunkWVDM36ZM_js.isTemplateElementId(elementId)) {
4149
+ if (chunk7ARD2J6Y_js.isTemplateElementId(elementId)) {
4148
4150
  const slideId = activeSlide?.id;
4149
4151
  if (slideId) {
4150
4152
  setTemplateElementsBySlideId((prev) => ({
@@ -4192,7 +4194,7 @@ function useElementOperations(input) {
4192
4194
  );
4193
4195
  const updateSelectedShapeStyle = react.useCallback(
4194
4196
  (updates) => {
4195
- if (!selectedElement || !chunkWVDM36ZM_js.hasShapeProperties(selectedElement)) {
4197
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasShapeProperties(selectedElement)) {
4196
4198
  return;
4197
4199
  }
4198
4200
  updateSelectedElement({
@@ -4203,17 +4205,17 @@ function useElementOperations(input) {
4203
4205
  );
4204
4206
  const updateSelectedTextStyle = react.useCallback(
4205
4207
  (updates) => {
4206
- if (!selectedElement || !chunkWVDM36ZM_js.hasTextProperties(selectedElement)) {
4208
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasTextProperties(selectedElement)) {
4207
4209
  return;
4208
4210
  }
4209
- const inlineSel = chunkWVDM36ZM_js.getInlineEditorSelection(selectedElement.textSegments);
4211
+ const inlineSel = chunk7ARD2J6Y_js.getInlineEditorSelection(selectedElement.textSegments);
4210
4212
  if (inlineSel && selectedElement.textSegments) {
4211
- const { newSegments: newSegments2, newSelection } = chunkWVDM36ZM_js.applyStyleToSelectedSegments(
4213
+ const { newSegments: newSegments2, newSelection } = chunk7ARD2J6Y_js.applyStyleToSelectedSegments(
4212
4214
  selectedElement.textSegments,
4213
4215
  inlineSel,
4214
4216
  updates
4215
4217
  );
4216
- chunkWVDM36ZM_js.setPendingSelectionRestore(newSelection);
4218
+ chunk7ARD2J6Y_js.setPendingSelectionRestore(newSelection);
4217
4219
  updateSelectedElement({
4218
4220
  textSegments: newSegments2
4219
4221
  });
@@ -4233,12 +4235,12 @@ function useElementOperations(input) {
4233
4235
  );
4234
4236
  const updateSelectedTextCase = react.useCallback(
4235
4237
  (mode) => {
4236
- if (!selectedElement || !chunkWVDM36ZM_js.hasTextProperties(selectedElement)) {
4238
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasTextProperties(selectedElement)) {
4237
4239
  return;
4238
4240
  }
4239
- const inlineSel = chunkWVDM36ZM_js.getInlineEditorSelection(selectedElement.textSegments);
4241
+ const inlineSel = chunk7ARD2J6Y_js.getInlineEditorSelection(selectedElement.textSegments);
4240
4242
  if (inlineSel && selectedElement.textSegments) {
4241
- const newSegments = chunkWVDM36ZM_js.applyCaseTransformToSegments(
4243
+ const newSegments = chunk7ARD2J6Y_js.applyCaseTransformToSegments(
4242
4244
  selectedElement.textSegments,
4243
4245
  inlineSel,
4244
4246
  mode
@@ -4248,14 +4250,14 @@ function useElementOperations(input) {
4248
4250
  }
4249
4251
  const updates = {};
4250
4252
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4251
- updates.textSegments = chunkWVDM36ZM_js.applyCaseTransformToSegments(
4253
+ updates.textSegments = chunk7ARD2J6Y_js.applyCaseTransformToSegments(
4252
4254
  selectedElement.textSegments,
4253
4255
  null,
4254
4256
  mode
4255
4257
  );
4256
4258
  }
4257
4259
  if (typeof selectedElement.text === "string") {
4258
- updates.text = chunkWVDM36ZM_js.transformTextCase(selectedElement.text, mode);
4260
+ updates.text = chunk7ARD2J6Y_js.transformTextCase(selectedElement.text, mode);
4259
4261
  }
4260
4262
  updateSelectedElement(updates);
4261
4263
  },
@@ -4268,15 +4270,15 @@ function useElementOperations(input) {
4268
4270
  [setSlides]
4269
4271
  );
4270
4272
  const masterViewTarget = masterView?.target ?? null;
4271
- const activeElements = masterViewTarget ? chunkWVDM36ZM_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4273
+ const activeElements = masterViewTarget ? chunk7ARD2J6Y_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4272
4274
  const updateActiveElements = react.useCallback(
4273
4275
  (updater) => {
4274
4276
  if (masterView?.target) {
4275
4277
  applyMasterViewWrite(
4276
- chunkWVDM36ZM_js.replaceMasterViewElements(
4278
+ chunk7ARD2J6Y_js.replaceMasterViewElements(
4277
4279
  masterView,
4278
4280
  masterView.target,
4279
- updater(chunkWVDM36ZM_js.masterViewElements(masterView, masterView.target))
4281
+ updater(chunk7ARD2J6Y_js.masterViewElements(masterView, masterView.target))
4280
4282
  )
4281
4283
  );
4282
4284
  return;
@@ -4329,7 +4331,7 @@ function useSectionOperations(input) {
4329
4331
  const { sections, setSections, slides, setSlides, markDirty } = input;
4330
4332
  const addSection2 = react.useCallback(
4331
4333
  (name, afterSlideIndex) => {
4332
- const result = chunkWVDM36ZM_js.addSection(sections, slides, name, afterSlideIndex);
4334
+ const result = chunk7ARD2J6Y_js.addSection(sections, slides, name, afterSlideIndex);
4333
4335
  setSlides(result.slides);
4334
4336
  setSections(result.sections);
4335
4337
  markDirty();
@@ -4338,7 +4340,7 @@ function useSectionOperations(input) {
4338
4340
  );
4339
4341
  const renameSection2 = react.useCallback(
4340
4342
  (sectionId, newName) => {
4341
- const result = chunkWVDM36ZM_js.renameSection(sections, slides, sectionId, newName);
4343
+ const result = chunk7ARD2J6Y_js.renameSection(sections, slides, sectionId, newName);
4342
4344
  setSections(result.sections);
4343
4345
  setSlides(result.slides);
4344
4346
  markDirty();
@@ -4347,7 +4349,7 @@ function useSectionOperations(input) {
4347
4349
  );
4348
4350
  const deleteSection2 = react.useCallback(
4349
4351
  (sectionId) => {
4350
- const result = chunkWVDM36ZM_js.deleteSection(sections, slides, sectionId);
4352
+ const result = chunk7ARD2J6Y_js.deleteSection(sections, slides, sectionId);
4351
4353
  setSections(result.sections);
4352
4354
  setSlides(result.slides);
4353
4355
  markDirty();
@@ -4356,21 +4358,21 @@ function useSectionOperations(input) {
4356
4358
  );
4357
4359
  const moveSectionUp2 = react.useCallback(
4358
4360
  (sectionId) => {
4359
- setSections(chunkWVDM36ZM_js.moveSectionUp(sections, sectionId));
4361
+ setSections(chunk7ARD2J6Y_js.moveSectionUp(sections, sectionId));
4360
4362
  markDirty();
4361
4363
  },
4362
4364
  [sections, setSections, markDirty]
4363
4365
  );
4364
4366
  const moveSectionDown2 = react.useCallback(
4365
4367
  (sectionId) => {
4366
- setSections(chunkWVDM36ZM_js.moveSectionDown(sections, sectionId));
4368
+ setSections(chunk7ARD2J6Y_js.moveSectionDown(sections, sectionId));
4367
4369
  markDirty();
4368
4370
  },
4369
4371
  [sections, setSections, markDirty]
4370
4372
  );
4371
4373
  const moveSlidesToSection2 = react.useCallback(
4372
4374
  (slideIndexes, targetSectionId) => {
4373
- const result = chunkWVDM36ZM_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4375
+ const result = chunk7ARD2J6Y_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4374
4376
  setSlides(result.slides);
4375
4377
  setSections(result.sections);
4376
4378
  markDirty();
@@ -4399,19 +4401,19 @@ function useSectionOperations(input) {
4399
4401
 
4400
4402
  // src/viewer/hooks/pointer-move-handlers.ts
4401
4403
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4402
- const resized = chunkWVDM36ZM_js.applyResize(
4404
+ const resized = chunk7ARD2J6Y_js.applyResize(
4403
4405
  { x: startX, y: startY, width: startWidth, height: startHeight },
4404
4406
  handle,
4405
4407
  dx,
4406
4408
  dy,
4407
4409
  1,
4408
- { minSize: chunk4LWGAVAP_js.MIN_ELEMENT_SIZE }
4410
+ { minSize: chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE }
4409
4411
  );
4410
4412
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4411
4413
  if (!snapToGrid) {
4412
4414
  return box;
4413
4415
  }
4414
- return chunkWVDM36ZM_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
4416
+ return chunk7ARD2J6Y_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
4415
4417
  }
4416
4418
  function resolveLiveTarget(input) {
4417
4419
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4524,7 +4526,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4524
4526
  width: el.width,
4525
4527
  height: el.height
4526
4528
  }));
4527
- const snapResult = chunkWVDM36ZM_js.computeSnapToShape(
4529
+ const snapResult = chunk7ARD2J6Y_js.computeSnapToShape(
4528
4530
  targetX,
4529
4531
  targetY,
4530
4532
  primaryEl.width,
@@ -4563,7 +4565,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4563
4565
  if (live) {
4564
4566
  for (const id of Object.keys(drag.startPositionsById)) {
4565
4567
  const start = drag.startPositionsById[id];
4566
- chunkWVDM36ZM_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4568
+ chunk7ARD2J6Y_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4567
4569
  x: start.x + appliedDx,
4568
4570
  y: start.y + appliedDy
4569
4571
  });
@@ -4597,22 +4599,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4597
4599
  if (rs.domEl) {
4598
4600
  rs.domEl.style.left = `${geo.x}px`;
4599
4601
  rs.domEl.style.top = `${geo.y}px`;
4600
- rs.domEl.style.width = `${Math.max(geo.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)}px`;
4601
- rs.domEl.style.height = `${Math.max(geo.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)}px`;
4602
+ rs.domEl.style.width = `${Math.max(geo.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)}px`;
4603
+ rs.domEl.style.height = `${Math.max(geo.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)}px`;
4602
4604
  }
4603
4605
  if (live) {
4604
- chunkWVDM36ZM_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4606
+ chunk7ARD2J6Y_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4605
4607
  x: geo.x,
4606
4608
  y: geo.y,
4607
- width: Math.max(geo.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE),
4608
- height: Math.max(geo.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)
4609
+ width: Math.max(geo.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE),
4610
+ height: Math.max(geo.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)
4609
4611
  });
4610
4612
  }
4611
4613
  }
4612
4614
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4613
4615
  const dx = (e.clientX - adj.startClientX) / editorScale;
4614
4616
  const dy = (e.clientY - adj.startClientY) / editorScale;
4615
- const adjustments = chunkWVDM36ZM_js.getDraggedShapeAdjustments(adj, dx, dy);
4617
+ const adjustments = chunk7ARD2J6Y_js.getDraggedShapeAdjustments(adj, dx, dy);
4616
4618
  if (!adj.moved && Math.hypot(dx, dy) > 2) {
4617
4619
  adj.moved = true;
4618
4620
  }
@@ -4687,13 +4689,13 @@ function processPointerUp(input) {
4687
4689
  if (i !== activeSlideIndex) {
4688
4690
  return s;
4689
4691
  }
4690
- const rerouted = chunkWVDM36ZM_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4692
+ const rerouted = chunk7ARD2J6Y_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4691
4693
  if (rerouted.length === 0) {
4692
4694
  return s;
4693
4695
  }
4694
4696
  return {
4695
4697
  ...s,
4696
- elements: chunkWVDM36ZM_js.applyReroutedConnectors(s.elements, rerouted)
4698
+ elements: chunk7ARD2J6Y_js.applyReroutedConnectors(s.elements, rerouted)
4697
4699
  };
4698
4700
  })
4699
4701
  );
@@ -4718,9 +4720,9 @@ function processPointerUp(input) {
4718
4720
  }
4719
4721
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4720
4722
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4721
- const hitIds = chunkWVDM36ZM_js.computeMarqueeHitIds(marquee, sourceElements);
4723
+ const hitIds = chunk7ARD2J6Y_js.computeMarqueeHitIds(marquee, sourceElements);
4722
4724
  if (marquee.additive) {
4723
- const merged = chunkWVDM36ZM_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4725
+ const merged = chunk7ARD2J6Y_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4724
4726
  if (merged.length > 0) {
4725
4727
  applySelection(merged[0], merged);
4726
4728
  } else {
@@ -4743,8 +4745,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4743
4745
  }
4744
4746
  return { ...el, x: start.x + dx, y: start.y + dy };
4745
4747
  });
4746
- const rerouted = chunkWVDM36ZM_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4747
- return chunkWVDM36ZM_js.applyReroutedConnectors(movedElements, rerouted);
4748
+ const rerouted = chunk7ARD2J6Y_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4749
+ return chunk7ARD2J6Y_js.applyReroutedConnectors(movedElements, rerouted);
4748
4750
  };
4749
4751
  if (editTemplateMode) {
4750
4752
  const slideId = activeSlide?.id;
@@ -4901,9 +4903,9 @@ function useCanvasInteractions(input) {
4901
4903
  return;
4902
4904
  }
4903
4905
  const el = elementLookup.get(editId);
4904
- if (el && chunkWVDM36ZM_js.hasTextProperties(el)) {
4906
+ if (el && chunk7ARD2J6Y_js.hasTextProperties(el)) {
4905
4907
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
4906
- const newSegments = chunkWVDM36ZM_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4908
+ const newSegments = chunk7ARD2J6Y_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4907
4909
  ops.updateElementById(editId, {
4908
4910
  text: committedText,
4909
4911
  textSegments: newSegments
@@ -4914,7 +4916,7 @@ function useCanvasInteractions(input) {
4914
4916
  setInlineEditingText("");
4915
4917
  };
4916
4918
  const openEquationEditorForElement = (el) => {
4917
- if (!chunkWVDM36ZM_js.hasTextProperties(el)) {
4919
+ if (!chunk7ARD2J6Y_js.hasTextProperties(el)) {
4918
4920
  return false;
4919
4921
  }
4920
4922
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -4944,7 +4946,7 @@ function useCanvasInteractions(input) {
4944
4946
  justInteractedRef.current = false;
4945
4947
  } else {
4946
4948
  const el = elementLookup.get(elementId);
4947
- if (el && chunkWVDM36ZM_js.hasTextProperties(el) && chunkWVDM36ZM_js.canInteractWithElement(el, "textEdit")) {
4949
+ if (el && chunk7ARD2J6Y_js.hasTextProperties(el) && chunk7ARD2J6Y_js.canInteractWithElement(el, "textEdit")) {
4948
4950
  if (!openEquationEditorForElement(el)) {
4949
4951
  setInlineEditingElementId(elementId);
4950
4952
  setInlineEditingText(el.text ?? "");
@@ -4963,7 +4965,7 @@ function useCanvasInteractions(input) {
4963
4965
  if (openEquationEditorForElement(el)) {
4964
4966
  return;
4965
4967
  }
4966
- if (chunkWVDM36ZM_js.hasTextProperties(el) && chunkWVDM36ZM_js.canInteractWithElement(el, "textEdit")) {
4968
+ if (chunk7ARD2J6Y_js.hasTextProperties(el) && chunk7ARD2J6Y_js.canInteractWithElement(el, "textEdit")) {
4967
4969
  setInlineEditingElementId(elementId);
4968
4970
  setInlineEditingText(el.text ?? "");
4969
4971
  }
@@ -4986,7 +4988,7 @@ function useCanvasInteractions(input) {
4986
4988
  justSelectedRef.current = false;
4987
4989
  }
4988
4990
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
4989
- const movableIds = chunkWVDM36ZM_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4991
+ const movableIds = chunk7ARD2J6Y_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4990
4992
  if (movableIds.length === 0) {
4991
4993
  return;
4992
4994
  }
@@ -5056,7 +5058,7 @@ function useCanvasInteractions(input) {
5056
5058
  const handleResizePointerDown = (elementId, e, handle) => {
5057
5059
  e.stopPropagation();
5058
5060
  const el = elementLookup.get(elementId);
5059
- if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "resize")) {
5061
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "resize")) {
5060
5062
  return;
5061
5063
  }
5062
5064
  resizeStateRef.current = {
@@ -5078,7 +5080,7 @@ function useCanvasInteractions(input) {
5078
5080
  };
5079
5081
  const handleRotate = (elementId, rotationDeg) => {
5080
5082
  const el = elementLookup.get(elementId);
5081
- if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "rotate")) {
5083
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "rotate")) {
5082
5084
  return;
5083
5085
  }
5084
5086
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -5098,10 +5100,10 @@ function useCanvasInteractions(input) {
5098
5100
  const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
5099
5101
  e.stopPropagation();
5100
5102
  const el = elementLookup.get(elementId);
5101
- if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "adjustHandle")) {
5103
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "adjustHandle")) {
5102
5104
  return;
5103
5105
  }
5104
- shapeAdjustmentDragStateRef.current = chunkWVDM36ZM_js.beginShapeAdjustment(
5106
+ shapeAdjustmentDragStateRef.current = chunk7ARD2J6Y_js.beginShapeAdjustment(
5105
5107
  el,
5106
5108
  descriptor,
5107
5109
  e.clientX,
@@ -5148,7 +5150,7 @@ function createFileHandlers(deps) {
5148
5150
  h = Math.round(h * scale);
5149
5151
  }
5150
5152
  addElement({
5151
- id: chunkWVDM36ZM_js.generateElementId(),
5153
+ id: chunk7ARD2J6Y_js.generateElementId(),
5152
5154
  type: "image",
5153
5155
  x: Math.round((canvasSize.width - w) / 2),
5154
5156
  y: Math.round((canvasSize.height - h) / 2),
@@ -5159,7 +5161,7 @@ function createFileHandlers(deps) {
5159
5161
  };
5160
5162
  img.onerror = () => {
5161
5163
  addElement({
5162
- id: chunkWVDM36ZM_js.generateElementId(),
5164
+ id: chunk7ARD2J6Y_js.generateElementId(),
5163
5165
  type: "image",
5164
5166
  x: 100,
5165
5167
  y: 100,
@@ -5185,7 +5187,7 @@ function createFileHandlers(deps) {
5185
5187
  const elFilePath = file.path;
5186
5188
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5187
5189
  addElement({
5188
- id: chunkWVDM36ZM_js.generateElementId(),
5190
+ id: chunk7ARD2J6Y_js.generateElementId(),
5189
5191
  type: "media",
5190
5192
  mediaType,
5191
5193
  mediaMimeType: file.type || void 0,
@@ -5360,13 +5362,13 @@ function createStructuredElementHandlers(deps) {
5360
5362
  return;
5361
5363
  }
5362
5364
  addElement({
5363
- id: chunkWVDM36ZM_js.generateElementId(),
5365
+ id: chunk7ARD2J6Y_js.generateElementId(),
5364
5366
  type: "smartArt",
5365
5367
  x: 100,
5366
5368
  y: 120,
5367
5369
  width: 600,
5368
5370
  height: 340,
5369
- smartArtData: chunkWVDM36ZM_js.buildSmartArtPresetData(
5371
+ smartArtData: chunk7ARD2J6Y_js.buildSmartArtPresetData(
5370
5372
  layout,
5371
5373
  defaultItems,
5372
5374
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5378,7 +5380,7 @@ function createStructuredElementHandlers(deps) {
5378
5380
  return;
5379
5381
  }
5380
5382
  addElement({
5381
- id: chunkWVDM36ZM_js.generateElementId(),
5383
+ id: chunk7ARD2J6Y_js.generateElementId(),
5382
5384
  type: "shape",
5383
5385
  x: 120,
5384
5386
  y: 200,
@@ -5437,7 +5439,7 @@ function createStructuredElementHandlers(deps) {
5437
5439
  const displayText = value || fieldTexts[fieldType] || fieldType;
5438
5440
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5439
5441
  addElement({
5440
- id: chunkWVDM36ZM_js.generateElementId(),
5442
+ id: chunk7ARD2J6Y_js.generateElementId(),
5441
5443
  type: "shape",
5442
5444
  x: 120,
5443
5445
  y: 200,
@@ -5459,11 +5461,11 @@ function createStructuredElementHandlers(deps) {
5459
5461
  if (!activeSlide) {
5460
5462
  return;
5461
5463
  }
5462
- const preset = chunkWVDM36ZM_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5464
+ const preset = chunk7ARD2J6Y_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5463
5465
  if (!preset) {
5464
5466
  return;
5465
5467
  }
5466
- const defaultPptxAction = chunkWVDM36ZM_js.elementActionToPptxAction({
5468
+ const defaultPptxAction = chunk7ARD2J6Y_js.elementActionToPptxAction({
5467
5469
  trigger: "click",
5468
5470
  type: preset.defaultAction
5469
5471
  });
@@ -5472,7 +5474,7 @@ function createStructuredElementHandlers(deps) {
5472
5474
  defaultPptxAction.highlightClick = true;
5473
5475
  }
5474
5476
  addElement({
5475
- id: chunkWVDM36ZM_js.generateElementId(),
5477
+ id: chunk7ARD2J6Y_js.generateElementId(),
5476
5478
  type: "shape",
5477
5479
  x: 150,
5478
5480
  y: 150,
@@ -5539,14 +5541,14 @@ function useInsertElements(input) {
5539
5541
  return;
5540
5542
  }
5541
5543
  addElement({
5542
- id: chunkWVDM36ZM_js.generateElementId(),
5544
+ id: chunk7ARD2J6Y_js.generateElementId(),
5543
5545
  type: "text",
5544
5546
  x: 100,
5545
5547
  y: 100,
5546
5548
  width: 300,
5547
5549
  height: 60,
5548
5550
  text: "",
5549
- textStyle: { fontSize: chunk4LWGAVAP_js.DEFAULT_TEXT_FONT_SIZE }
5551
+ textStyle: { fontSize: chunkOVPJT4EQ_js.DEFAULT_TEXT_FONT_SIZE }
5550
5552
  });
5551
5553
  };
5552
5554
  const handleAddShape = () => {
@@ -5554,7 +5556,7 @@ function useInsertElements(input) {
5554
5556
  return;
5555
5557
  }
5556
5558
  addElement({
5557
- id: chunkWVDM36ZM_js.generateElementId(),
5559
+ id: chunk7ARD2J6Y_js.generateElementId(),
5558
5560
  type: "shape",
5559
5561
  x: 150,
5560
5562
  y: 150,
@@ -5573,15 +5575,15 @@ function useInsertElements(input) {
5573
5575
  return;
5574
5576
  }
5575
5577
  addElement({
5576
- ...chunkWVDM36ZM_js.newTableElement(chunk4LWGAVAP_js.DEFAULT_TABLE_ROWS, chunk4LWGAVAP_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5577
- id: chunkWVDM36ZM_js.generateElementId()
5578
+ ...chunk7ARD2J6Y_js.newTableElement(chunkOVPJT4EQ_js.DEFAULT_TABLE_ROWS, chunkOVPJT4EQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5579
+ id: chunk7ARD2J6Y_js.generateElementId()
5578
5580
  });
5579
5581
  };
5580
5582
  const handleAddChart = (chartKind) => {
5581
5583
  if (!activeSlide) {
5582
5584
  return;
5583
5585
  }
5584
- addElement(chunkWVDM36ZM_js.createDefaultChartElement(chartKind));
5586
+ addElement(chunk7ARD2J6Y_js.createDefaultChartElement(chartKind));
5585
5587
  };
5586
5588
  const structured = createStructuredElementHandlers({
5587
5589
  activeSlide,
@@ -5651,7 +5653,7 @@ function useClipboardHandlers(input) {
5651
5653
  if (!selectedElement) {
5652
5654
  return;
5653
5655
  }
5654
- setClipboardPayload(chunkWVDM36ZM_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5656
+ setClipboardPayload(chunk7ARD2J6Y_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5655
5657
  };
5656
5658
  const handleDelete = () => {
5657
5659
  const idsToDelete = effectiveSelectedIds;
@@ -5668,7 +5670,7 @@ function useClipboardHandlers(input) {
5668
5670
  handleDelete();
5669
5671
  };
5670
5672
  const insertClone = (source) => {
5671
- const clone = chunkWVDM36ZM_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5673
+ const clone = chunk7ARD2J6Y_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5672
5674
  ops.updateActiveElements((els) => [...els, clone]);
5673
5675
  ops.applySelection(clone.id);
5674
5676
  history.markDirty();
@@ -5703,7 +5705,7 @@ function resolveShapePath(el) {
5703
5705
  return el.pathData;
5704
5706
  }
5705
5707
  if ("shapeType" in el && typeof el.shapeType === "string") {
5706
- const clipPath = chunkWVDM36ZM_js.getPresetShapeClipPath(el.shapeType);
5708
+ const clipPath = chunk7ARD2J6Y_js.getPresetShapeClipPath(el.shapeType);
5707
5709
  if (clipPath) {
5708
5710
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5709
5711
  if (svgPath) {
@@ -5754,7 +5756,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5754
5756
  return parts.join(" ");
5755
5757
  }
5756
5758
  function transformPathToGlobal(pathData, el) {
5757
- const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
5759
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5758
5760
  if (polys.length === 0) {
5759
5761
  return pathData;
5760
5762
  }
@@ -5774,10 +5776,10 @@ function transformPathToGlobal(pathData, el) {
5774
5776
  y: pt.y * scaleY + el.y
5775
5777
  }))
5776
5778
  );
5777
- return chunkWVDM36ZM_js.polygonsToSvgPath(transformed);
5779
+ return chunk7ARD2J6Y_js.polygonsToSvgPath(transformed);
5778
5780
  }
5779
5781
  function transformPathToLocal(pathData, x, y, _width, _height) {
5780
- const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
5782
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5781
5783
  if (polys.length === 0) {
5782
5784
  return pathData;
5783
5785
  }
@@ -5787,10 +5789,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5787
5789
  y: pt.y - y
5788
5790
  }))
5789
5791
  );
5790
- return chunkWVDM36ZM_js.polygonsToSvgPath(transformed);
5792
+ return chunk7ARD2J6Y_js.polygonsToSvgPath(transformed);
5791
5793
  }
5792
5794
  function pathBounds(pathData) {
5793
- const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
5795
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5794
5796
  let minX = Infinity;
5795
5797
  let minY = Infinity;
5796
5798
  let maxX = -Infinity;
@@ -5849,7 +5851,7 @@ function useMergeShapesHandler(input) {
5849
5851
  let allFragments = [];
5850
5852
  let remaining = globalPaths[0];
5851
5853
  for (let i = 1; i < globalPaths.length; i++) {
5852
- const frags = chunkWVDM36ZM_js.mergeShapes("fragment", remaining, globalPaths[i]);
5854
+ const frags = chunk7ARD2J6Y_js.mergeShapes("fragment", remaining, globalPaths[i]);
5853
5855
  if (Array.isArray(frags)) {
5854
5856
  allFragments = frags;
5855
5857
  }
@@ -5878,7 +5880,7 @@ function useMergeShapesHandler(input) {
5878
5880
  bounds.height
5879
5881
  );
5880
5882
  const newEl = {
5881
- id: chunkWVDM36ZM_js.generateElementId(),
5883
+ id: chunk7ARD2J6Y_js.generateElementId(),
5882
5884
  type: "shape",
5883
5885
  x: bounds.x,
5884
5886
  y: bounds.y,
@@ -5916,7 +5918,7 @@ function useMergeShapesHandler(input) {
5916
5918
  } else {
5917
5919
  let resultPath = globalPaths[0];
5918
5920
  for (let i = 1; i < globalPaths.length; i++) {
5919
- const result = chunkWVDM36ZM_js.mergeShapes(operation, resultPath, globalPaths[i]);
5921
+ const result = chunk7ARD2J6Y_js.mergeShapes(operation, resultPath, globalPaths[i]);
5920
5922
  if (typeof result === "string") {
5921
5923
  resultPath = result;
5922
5924
  }
@@ -5937,7 +5939,7 @@ function useMergeShapesHandler(input) {
5937
5939
  );
5938
5940
  const primary = targets[0];
5939
5941
  const newEl = {
5940
- id: chunkWVDM36ZM_js.generateElementId(),
5942
+ id: chunk7ARD2J6Y_js.generateElementId(),
5941
5943
  type: "shape",
5942
5944
  x: bounds.x,
5943
5945
  y: bounds.y,
@@ -6000,7 +6002,7 @@ function useGroupAlignLayerHandlers(input) {
6000
6002
  if (ids.length < 2 || !activeSlide) {
6001
6003
  return;
6002
6004
  }
6003
- const { elements, groupId } = chunkWVDM36ZM_js.groupElements(ops.activeElements, ids, chunkWVDM36ZM_js.generateElementId());
6005
+ const { elements, groupId } = chunk7ARD2J6Y_js.groupElements(ops.activeElements, ids, chunk7ARD2J6Y_js.generateElementId());
6004
6006
  if (groupId === null) {
6005
6007
  return;
6006
6008
  }
@@ -6013,11 +6015,11 @@ function useGroupAlignLayerHandlers(input) {
6013
6015
  return;
6014
6016
  }
6015
6017
  const group = selectedElement;
6016
- const intoTemplate = chunkWVDM36ZM_js.isTemplateElementId(group.id);
6018
+ const intoTemplate = chunk7ARD2J6Y_js.isTemplateElementId(group.id);
6017
6019
  const childIds = group.children.map(
6018
- (child) => intoTemplate ? chunkWVDM36ZM_js.makeCloneId(true, child.id || group.id) : child.id || chunkWVDM36ZM_js.generateElementId()
6020
+ (child) => intoTemplate ? chunk7ARD2J6Y_js.makeCloneId(true, child.id || group.id) : child.id || chunk7ARD2J6Y_js.generateElementId()
6019
6021
  );
6020
- const { elements, childIds: usedIds } = chunkWVDM36ZM_js.ungroupElements(
6022
+ const { elements, childIds: usedIds } = chunk7ARD2J6Y_js.ungroupElements(
6021
6023
  ops.activeElements,
6022
6024
  group.id,
6023
6025
  childIds,
@@ -6046,7 +6048,7 @@ function useGroupAlignLayerHandlers(input) {
6046
6048
  if (!edge) {
6047
6049
  return;
6048
6050
  }
6049
- const positions = chunkWVDM36ZM_js.alignElements(selectedElements, edge);
6051
+ const positions = chunk7ARD2J6Y_js.alignElements(selectedElements, edge);
6050
6052
  for (const [id, pos] of positions) {
6051
6053
  const el = elementLookup.get(id);
6052
6054
  if (!el) {
@@ -6064,7 +6066,7 @@ function useGroupAlignLayerHandlers(input) {
6064
6066
  if (!distAxis) {
6065
6067
  return;
6066
6068
  }
6067
- const positions = chunkWVDM36ZM_js.distributeElements(selectedElements, distAxis);
6069
+ const positions = chunk7ARD2J6Y_js.distributeElements(selectedElements, distAxis);
6068
6070
  for (const [id, pos] of positions) {
6069
6071
  const el = elementLookup.get(id);
6070
6072
  if (!el) {
@@ -6081,7 +6083,7 @@ function useGroupAlignLayerHandlers(input) {
6081
6083
  }
6082
6084
  const id = selectedElement.id;
6083
6085
  ops.updateActiveElements(
6084
- (els) => direction === "forward" ? chunkWVDM36ZM_js.bringForward(els, id) : direction === "backward" ? chunkWVDM36ZM_js.sendBackward(els, id) : els
6086
+ (els) => direction === "forward" ? chunk7ARD2J6Y_js.bringForward(els, id) : direction === "backward" ? chunk7ARD2J6Y_js.sendBackward(els, id) : els
6085
6087
  );
6086
6088
  history.markDirty();
6087
6089
  };
@@ -6091,7 +6093,7 @@ function useGroupAlignLayerHandlers(input) {
6091
6093
  }
6092
6094
  const id = selectedElement.id;
6093
6095
  ops.updateActiveElements(
6094
- (els) => direction === "front" ? chunkWVDM36ZM_js.bringToFront(els, id) : chunkWVDM36ZM_js.sendToBack(els, id)
6096
+ (els) => direction === "front" ? chunk7ARD2J6Y_js.bringToFront(els, id) : chunk7ARD2J6Y_js.sendToBack(els, id)
6095
6097
  );
6096
6098
  history.markDirty();
6097
6099
  };
@@ -6222,7 +6224,7 @@ function useSlideManagement(input) {
6222
6224
  theme
6223
6225
  } = input;
6224
6226
  const handleAddSlide = () => {
6225
- const newSlide = chunkWVDM36ZM_js.createBlankSlide(slides.length + 1);
6227
+ const newSlide = chunk7ARD2J6Y_js.createBlankSlide(slides.length + 1);
6226
6228
  ops.updateSlides((prev) => {
6227
6229
  const next = [...prev];
6228
6230
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6285,7 +6287,7 @@ function useSlideManagement(input) {
6285
6287
  }
6286
6288
  const clone = {
6287
6289
  ...src,
6288
- id: chunkWVDM36ZM_js.makeSlideId(),
6290
+ id: chunk7ARD2J6Y_js.makeSlideId(),
6289
6291
  elements: src.elements.map((el) => ({
6290
6292
  ...el,
6291
6293
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6317,7 +6319,7 @@ function useSlideManagement(input) {
6317
6319
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6318
6320
  const insertAt = activeSlideIndex + 1;
6319
6321
  const draft = {
6320
- ...chunkWVDM36ZM_js.createBlankSlide(slides.length + 1),
6322
+ ...chunk7ARD2J6Y_js.createBlankSlide(slides.length + 1),
6321
6323
  layoutPath,
6322
6324
  ...layoutName ? { layoutName } : {}
6323
6325
  };
@@ -6350,9 +6352,9 @@ function useSlideManagement(input) {
6350
6352
  };
6351
6353
  const handleInsertSlideFromTemplate = (templateId) => {
6352
6354
  const insertAt = activeSlideIndex + 1;
6353
- const draft = chunkWVDM36ZM_js.buildSlideTemplateSlide(templateId, chunkWVDM36ZM_js.makeSlideId(), slides.length + 1, {
6355
+ const draft = chunk7ARD2J6Y_js.buildSlideTemplateSlide(templateId, chunk7ARD2J6Y_js.makeSlideId(), slides.length + 1, {
6354
6356
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6355
- scheme: chunkWVDM36ZM_js.templateSchemeFromTheme(theme?.colorScheme)
6357
+ scheme: chunk7ARD2J6Y_js.templateSchemeFromTheme(theme?.colorScheme)
6356
6358
  });
6357
6359
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6358
6360
  setActiveSlideIndex(insertAt);
@@ -6389,7 +6391,7 @@ function createTableMergeHandlers(input) {
6389
6391
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6390
6392
  return;
6391
6393
  }
6392
- const newTableData = chunkWVDM36ZM_js.mergeCells(
6394
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(
6393
6395
  [
6394
6396
  { row: rowIndex, col: columnIndex },
6395
6397
  { row: rowIndex, col: nextColIdx }
@@ -6397,7 +6399,7 @@ function createTableMergeHandlers(input) {
6397
6399
  td
6398
6400
  );
6399
6401
  const updates = { tableData: newTableData };
6400
- const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6402
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6401
6403
  if (newRawXml) {
6402
6404
  updates.rawXml = newRawXml;
6403
6405
  }
@@ -6423,7 +6425,7 @@ function createTableMergeHandlers(input) {
6423
6425
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6424
6426
  return;
6425
6427
  }
6426
- const newTableData = chunkWVDM36ZM_js.mergeCells(
6428
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(
6427
6429
  [
6428
6430
  { row: rowIndex, col: columnIndex },
6429
6431
  { row: targetNextRowIdx, col: columnIndex }
@@ -6431,7 +6433,7 @@ function createTableMergeHandlers(input) {
6431
6433
  td
6432
6434
  );
6433
6435
  const updates = { tableData: newTableData };
6434
- const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6436
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6435
6437
  if (newRawXml) {
6436
6438
  updates.rawXml = newRawXml;
6437
6439
  }
@@ -6446,9 +6448,9 @@ function createTableMergeHandlers(input) {
6446
6448
  return;
6447
6449
  }
6448
6450
  const td = selectedElement.tableData;
6449
- const newTableData = chunkWVDM36ZM_js.mergeCells(ts.selectedCells, td);
6451
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(ts.selectedCells, td);
6450
6452
  const updates = { tableData: newTableData };
6451
- const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6453
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6452
6454
  if (newRawXml) {
6453
6455
  updates.rawXml = newRawXml;
6454
6456
  }
@@ -6465,9 +6467,9 @@ function createTableMergeHandlers(input) {
6465
6467
  }
6466
6468
  const { rowIndex, columnIndex } = ts;
6467
6469
  const td = selectedElement.tableData;
6468
- const newTableData = chunkWVDM36ZM_js.splitCell(rowIndex, columnIndex, td);
6470
+ const newTableData = chunk7ARD2J6Y_js.splitCell(rowIndex, columnIndex, td);
6469
6471
  const updates = { tableData: newTableData };
6470
- const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6472
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6471
6473
  if (newRawXml) {
6472
6474
  updates.rawXml = newRawXml;
6473
6475
  }
@@ -6511,7 +6513,7 @@ function createTableStructHandlers(input) {
6511
6513
  updates.tableData = { ...el.tableData, rows: newRows };
6512
6514
  }
6513
6515
  if (el.rawXml) {
6514
- const newRawXml = chunkWVDM36ZM_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6516
+ const newRawXml = chunk7ARD2J6Y_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6515
6517
  if (newRawXml) {
6516
6518
  updates.rawXml = newRawXml;
6517
6519
  }
@@ -6535,7 +6537,7 @@ function createTableStructHandlers(input) {
6535
6537
  const { rowIndex, columnIndex: colIndex } = ts;
6536
6538
  const updates = {};
6537
6539
  if (selectedElement.rawXml) {
6538
- const newRawXml = chunkWVDM36ZM_js.updateCellTextStyleInRawXml(
6540
+ const newRawXml = chunk7ARD2J6Y_js.updateCellTextStyleInRawXml(
6539
6541
  selectedElement,
6540
6542
  rowIndex,
6541
6543
  colIndex,
@@ -6599,9 +6601,9 @@ function createTableStructHandlers(input) {
6599
6601
  return;
6600
6602
  }
6601
6603
  const rowIdx = ts?.rowIndex ?? 0;
6602
- const newTableData = chunkWVDM36ZM_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6604
+ const newTableData = chunk7ARD2J6Y_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6603
6605
  const updates = { tableData: newTableData };
6604
- const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6606
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6605
6607
  if (newRawXml) {
6606
6608
  updates.rawXml = newRawXml;
6607
6609
  }
@@ -6614,12 +6616,12 @@ function createTableStructHandlers(input) {
6614
6616
  }
6615
6617
  const td = selectedElement.tableData;
6616
6618
  const rowIdx = ts?.rowIndex ?? 0;
6617
- const newTableData = chunkWVDM36ZM_js.deleteTableRow(td, rowIdx);
6619
+ const newTableData = chunk7ARD2J6Y_js.deleteTableRow(td, rowIdx);
6618
6620
  if (newTableData === td) {
6619
6621
  return;
6620
6622
  }
6621
6623
  const updates = { tableData: newTableData };
6622
- const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6624
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6623
6625
  if (newRawXml) {
6624
6626
  updates.rawXml = newRawXml;
6625
6627
  }
@@ -6631,9 +6633,9 @@ function createTableStructHandlers(input) {
6631
6633
  return;
6632
6634
  }
6633
6635
  const colIdx = ts?.columnIndex ?? 0;
6634
- const newTableData = chunkWVDM36ZM_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6636
+ const newTableData = chunk7ARD2J6Y_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6635
6637
  const updates = { tableData: newTableData };
6636
- const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6638
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6637
6639
  if (newRawXml) {
6638
6640
  updates.rawXml = newRawXml;
6639
6641
  }
@@ -6646,12 +6648,12 @@ function createTableStructHandlers(input) {
6646
6648
  }
6647
6649
  const td = selectedElement.tableData;
6648
6650
  const colIdx = ts?.columnIndex ?? 0;
6649
- const newTableData = chunkWVDM36ZM_js.deleteTableColumn(td, colIdx);
6651
+ const newTableData = chunk7ARD2J6Y_js.deleteTableColumn(td, colIdx);
6650
6652
  if (newTableData === td) {
6651
6653
  return;
6652
6654
  }
6653
6655
  const updates = { tableData: newTableData };
6654
- const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6656
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6655
6657
  if (newRawXml) {
6656
6658
  updates.rawXml = newRawXml;
6657
6659
  }
@@ -6687,8 +6689,8 @@ async function renderToCanvas(element, options = {}) {
6687
6689
  return html2canvasPro(element, {
6688
6690
  ...options,
6689
6691
  onclone: async (doc, clonedEl) => {
6690
- await chunkWVDM36ZM_js.normalizeColorsForCapture(doc, clonedEl);
6691
- chunkWVDM36ZM_js.preprocessCssForCapture(clonedEl);
6692
+ await chunk7ARD2J6Y_js.normalizeColorsForCapture(doc, clonedEl);
6693
+ chunk7ARD2J6Y_js.preprocessCssForCapture(clonedEl);
6692
6694
  if (typeof userOnClone === "function") {
6693
6695
  userOnClone(doc, clonedEl);
6694
6696
  }
@@ -6744,7 +6746,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
6744
6746
  }
6745
6747
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
6746
6748
  const blob = await exportSlideToPngBlob(slideElement, options);
6747
- chunkWVDM36ZM_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6749
+ chunk7ARD2J6Y_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6748
6750
  }
6749
6751
  async function copySlideToClipboard(slideElement, options = {}) {
6750
6752
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -6766,15 +6768,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
6766
6768
  continue;
6767
6769
  }
6768
6770
  const canvas = await renderElementToCanvas(stageEl, scale);
6769
- images.push(chunkWVDM36ZM_js.canvasToJpegData(canvas));
6771
+ images.push(chunk7ARD2J6Y_js.canvasToJpegData(canvas));
6770
6772
  }
6771
6773
  onProgress?.(totalSlides, totalSlides);
6772
6774
  setActiveSlide(currentSlideIndex);
6773
6775
  if (images.length === 0) {
6774
- throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6776
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6775
6777
  }
6776
- const pdfBlobUrl = chunk4LWGAVAP_js.buildPdfFromImageData(images);
6777
- chunkWVDM36ZM_js.downloadDataUrl(pdfBlobUrl, filename);
6778
+ const pdfBlobUrl = chunkOVPJT4EQ_js.buildPdfFromImageData(images);
6779
+ chunk7ARD2J6Y_js.downloadDataUrl(pdfBlobUrl, filename);
6778
6780
  }
6779
6781
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
6780
6782
  const { scale = 2, onProgress } = options;
@@ -6820,10 +6822,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
6820
6822
  onProgress?.(totalSlides, totalSlides);
6821
6823
  setActiveSlide(currentSlideIndex);
6822
6824
  if (pages.length === 0) {
6823
- throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6825
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6824
6826
  }
6825
- const pdfDataUrl = chunk4LWGAVAP_js.buildNotesPdf(pages);
6826
- chunkWVDM36ZM_js.downloadDataUrl(pdfDataUrl, filename);
6827
+ const pdfDataUrl = chunkOVPJT4EQ_js.buildNotesPdf(pages);
6828
+ chunk7ARD2J6Y_js.downloadDataUrl(pdfDataUrl, filename);
6827
6829
  }
6828
6830
 
6829
6831
  // src/viewer/utils/export-video.ts
@@ -6854,7 +6856,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6854
6856
  }
6855
6857
  setActiveSlide(currentSlideIndex);
6856
6858
  if (slideCanvases.length === 0) {
6857
- throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6859
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6858
6860
  }
6859
6861
  const firstCanvas = slideCanvases[0];
6860
6862
  const recordingCanvas = document.createElement("canvas");
@@ -6862,12 +6864,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6862
6864
  recordingCanvas.height = firstCanvas.height;
6863
6865
  const ctx = recordingCanvas.getContext("2d");
6864
6866
  if (!ctx) {
6865
- throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNo2dContext"]);
6867
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNo2dContext"]);
6866
6868
  }
6867
6869
  const fps = 30;
6868
6870
  const stream = recordingCanvas.captureStream(fps);
6869
6871
  const recorder = new MediaRecorder(stream, {
6870
- mimeType: chunkWVDM36ZM_js.pickSupportedMimeType([...chunkWVDM36ZM_js.WEBM_MIME_CANDIDATES]),
6872
+ mimeType: chunk7ARD2J6Y_js.pickSupportedMimeType([...chunk7ARD2J6Y_js.WEBM_MIME_CANDIDATES]),
6871
6873
  videoBitsPerSecond: 5e6
6872
6874
  });
6873
6875
  const chunks = [];
@@ -6890,8 +6892,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6890
6892
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
6891
6893
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
6892
6894
  ctx.drawImage(slideCanvases[i], 0, 0);
6893
- const frameInterval = chunkWVDM36ZM_js.fpsToFrameIntervalMs(fps);
6894
- const framesNeeded = chunkWVDM36ZM_js.segmentFrameCount(duration, fps);
6895
+ const frameInterval = chunk7ARD2J6Y_js.fpsToFrameIntervalMs(fps);
6896
+ const framesNeeded = chunk7ARD2J6Y_js.segmentFrameCount(duration, fps);
6895
6897
  for (let f = 0; f < framesNeeded; f++) {
6896
6898
  if (signal?.aborted) {
6897
6899
  recorder.stop();
@@ -6938,9 +6940,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
6938
6940
  }
6939
6941
  setActiveSlide(currentSlideIndex);
6940
6942
  if (frames.length === 0) {
6941
- throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6943
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6942
6944
  }
6943
- const gifBytes = chunkWVDM36ZM_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6945
+ const gifBytes = chunk7ARD2J6Y_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6944
6946
  onProgress?.(totalSlides, totalSlides);
6945
6947
  const buf = new ArrayBuffer(gifBytes.length);
6946
6948
  new Uint8Array(buf).set(gifBytes);
@@ -6994,7 +6996,7 @@ function exportAllSlidesToSvg(data, options = {}) {
6994
6996
  continue;
6995
6997
  }
6996
6998
  onProgress?.(processedCount, data.slides.length);
6997
- let svg = chunkWVDM36ZM_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6999
+ let svg = chunk7ARD2J6Y_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6998
7000
  if (embedFonts && fontFaces?.length) {
6999
7001
  svg = injectFontFaces(svg, fontFaces);
7000
7002
  }
@@ -7052,13 +7054,13 @@ function useExportSaveAs(input) {
7052
7054
  setExportProgress(10);
7053
7055
  setExportStatusMessage("Adding presentation...");
7054
7056
  const pptxData = await serializeSlides();
7055
- const pptxFilename = chunkWVDM36ZM_js.savedPresentationFileName(filePath);
7057
+ const pptxFilename = chunk7ARD2J6Y_js.savedPresentationFileName(filePath);
7056
7058
  if (pptxData) {
7057
7059
  pkgFolder.file(pptxFilename, pptxData);
7058
7060
  }
7059
7061
  setExportProgress(70);
7060
7062
  setExportStatusMessage("Writing README...");
7061
- const readme = chunkWVDM36ZM_js.generatePackageReadme(pptxFilename);
7063
+ const readme = chunk7ARD2J6Y_js.generatePackageReadme(pptxFilename);
7062
7064
  pkgFolder.file("README.txt", readme);
7063
7065
  if (abortCtrl.signal.aborted) {
7064
7066
  throw new DOMException("Export cancelled", "AbortError");
@@ -7068,7 +7070,7 @@ function useExportSaveAs(input) {
7068
7070
  const zipBlob = await zip.generateAsync({ type: "blob" });
7069
7071
  setExportProgress(95);
7070
7072
  setExportStatusMessage("Downloading...");
7071
- chunkWVDM36ZM_js.downloadBlob(zipBlob, `${chunkWVDM36ZM_js.presentationBaseName(pptxFilename)}-package.zip`);
7073
+ chunk7ARD2J6Y_js.downloadBlob(zipBlob, `${chunk7ARD2J6Y_js.presentationBaseName(pptxFilename)}-package.zip`);
7072
7074
  setExportProgress(100);
7073
7075
  } catch (err) {
7074
7076
  if (err.name !== "AbortError") {
@@ -7084,13 +7086,13 @@ function useExportSaveAs(input) {
7084
7086
  if (!handler) {
7085
7087
  return;
7086
7088
  }
7087
- const downloadName = chunkWVDM36ZM_js.savedPresentationFileName(filePath, format);
7089
+ const downloadName = chunk7ARD2J6Y_js.savedPresentationFileName(filePath, format);
7088
7090
  try {
7089
7091
  const data = await buildSaveAsData(handler, format);
7090
7092
  const blob = new Blob([data], {
7091
7093
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
7092
7094
  });
7093
- chunkWVDM36ZM_js.downloadBlob(blob, downloadName);
7095
+ chunk7ARD2J6Y_js.downloadBlob(blob, downloadName);
7094
7096
  } catch (err) {
7095
7097
  console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
7096
7098
  }
@@ -7103,18 +7105,18 @@ function useExportSaveAs(input) {
7103
7105
  const pptxGuides = guides.map((g) => ({
7104
7106
  id: g.id,
7105
7107
  orientation: g.axis === "h" ? "horz" : "vert",
7106
- positionEmu: chunkWVDM36ZM_js.guidePxToEmu(g.position)
7108
+ positionEmu: chunk7ARD2J6Y_js.guidePxToEmu(g.position)
7107
7109
  }));
7108
7110
  return {
7109
7111
  ...slide,
7110
7112
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
7111
7113
  };
7112
7114
  });
7113
- const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7115
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7114
7116
  const saveOptions = {
7115
7117
  // Save As shares Save's slide-size decision; leaving it out here is how
7116
7118
  // a preset picked in the inspector reached one save path and not the other.
7117
- slideSize: chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
7119
+ slideSize: chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
7118
7120
  headerFooter,
7119
7121
  presentationProperties,
7120
7122
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -7128,13 +7130,13 @@ function useExportSaveAs(input) {
7128
7130
  handoutMaster,
7129
7131
  outputFormat: format
7130
7132
  };
7131
- return chunkWVDM36ZM_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7133
+ return chunk7ARD2J6Y_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7132
7134
  };
7133
7135
  const handleExportJson = () => {
7134
7136
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7135
- const slideSize = chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7137
+ const slideSize = chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7136
7138
  const data = {
7137
- slides: chunkWVDM36ZM_js.buildSaveSlides(slides, templateElementsBySlideId),
7139
+ slides: chunk7ARD2J6Y_js.buildSaveSlides(slides, templateElementsBySlideId),
7138
7140
  width: canvasSize.width,
7139
7141
  height: canvasSize.height,
7140
7142
  widthEmu: slideSize.widthEmu,
@@ -7153,7 +7155,7 @@ function useExportSaveAs(input) {
7153
7155
  handoutMaster
7154
7156
  };
7155
7157
  try {
7156
- chunkWVDM36ZM_js.exportDeckJson(data, sourceName);
7158
+ chunk7ARD2J6Y_js.exportDeckJson(data, sourceName);
7157
7159
  } catch (err) {
7158
7160
  console.error("[PowerPointViewer] JSON export failed:", err);
7159
7161
  }
@@ -7193,7 +7195,7 @@ function safeConfirm(message) {
7193
7195
  }
7194
7196
  }
7195
7197
  function downloadBlob2(blob, filename) {
7196
- chunkWVDM36ZM_js.downloadBlob(blob, chunkWVDM36ZM_js.sanitizeDownloadFilename(filename));
7198
+ chunk7ARD2J6Y_js.downloadBlob(blob, chunk7ARD2J6Y_js.sanitizeDownloadFilename(filename));
7197
7199
  }
7198
7200
 
7199
7201
  // src/viewer/hooks/useExportHandlers.ts
@@ -7303,21 +7305,21 @@ function useExportHandlers(input) {
7303
7305
  {
7304
7306
  scale: 2,
7305
7307
  onProgress: (current, total) => {
7306
- setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
7307
- setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Rendering", current, total));
7308
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7309
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Rendering", current, total));
7308
7310
  },
7309
7311
  signal: abortCtrl.signal
7310
7312
  }
7311
7313
  );
7312
- setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
7314
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7313
7315
  setExportStatusMessage("Building PDF...");
7314
7316
  await new Promise((r) => {
7315
7317
  setTimeout(r, 100);
7316
7318
  });
7317
- setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
7319
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7318
7320
  setExportStatusMessage("Done!");
7319
7321
  } catch (err) {
7320
- if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
7322
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7321
7323
  console.error("[PowerPointViewer] PDF export failed:", err);
7322
7324
  }
7323
7325
  } finally {
@@ -7347,21 +7349,21 @@ function useExportHandlers(input) {
7347
7349
  {
7348
7350
  scale: 2,
7349
7351
  onProgress: (current, total) => {
7350
- setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
7351
- setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Rendering", current, total));
7352
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7353
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Rendering", current, total));
7352
7354
  },
7353
7355
  signal: abortCtrl.signal
7354
7356
  }
7355
7357
  );
7356
- setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
7358
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7357
7359
  setExportStatusMessage("Building PDF...");
7358
7360
  await new Promise((r) => {
7359
7361
  setTimeout(r, 100);
7360
7362
  });
7361
- setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
7363
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7362
7364
  setExportStatusMessage("Done!");
7363
7365
  } catch (err) {
7364
- if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
7366
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7365
7367
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7366
7368
  }
7367
7369
  } finally {
@@ -7402,22 +7404,22 @@ function useExportHandlers(input) {
7402
7404
  scale: 1,
7403
7405
  slideDurationMs: 3e3,
7404
7406
  onProgress: (current, total) => {
7405
- setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total, 45));
7406
- setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Capturing", current, total));
7407
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total, 45));
7408
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Capturing", current, total));
7407
7409
  },
7408
7410
  onRecordProgress: (current, total) => {
7409
- setExportProgress(chunkWVDM36ZM_js.recordProgressPercent(current, total));
7410
- setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Recording", current, total));
7411
+ setExportProgress(chunk7ARD2J6Y_js.recordProgressPercent(current, total));
7412
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Recording", current, total));
7411
7413
  },
7412
7414
  signal: abortCtrl.signal
7413
7415
  }
7414
7416
  );
7415
- setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
7417
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7416
7418
  setExportStatusMessage("Saving file...");
7417
7419
  downloadBlob2(blob, "presentation.webm");
7418
- setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
7420
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7419
7421
  } catch (err) {
7420
- if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
7422
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7421
7423
  console.error("[PowerPointViewer] Video export failed:", err);
7422
7424
  }
7423
7425
  } finally {
@@ -7445,18 +7447,18 @@ function useExportHandlers(input) {
7445
7447
  scale: 0.5,
7446
7448
  slideDurationMs: 2e3,
7447
7449
  onProgress: (current, total) => {
7448
- setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
7449
- setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Encoding", current, total));
7450
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7451
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Encoding", current, total));
7450
7452
  },
7451
7453
  signal: abortCtrl.signal
7452
7454
  }
7453
7455
  );
7454
- setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
7456
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7455
7457
  setExportStatusMessage("Saving file...");
7456
7458
  downloadBlob2(blob, "presentation.gif");
7457
- setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
7459
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7458
7460
  } catch (err) {
7459
- if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
7461
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7460
7462
  console.error("[PowerPointViewer] GIF export failed:", err);
7461
7463
  }
7462
7464
  } finally {
@@ -7497,7 +7499,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
7497
7499
  }
7498
7500
  printWindow.document.open();
7499
7501
  printWindow.document.write(
7500
- chunkWVDM36ZM_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7502
+ chunk7ARD2J6Y_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7501
7503
  );
7502
7504
  printWindow.document.close();
7503
7505
  printWindow.focus();
@@ -7558,7 +7560,7 @@ function usePrintHandlers(input) {
7558
7560
  if (svgs.length === 0) {
7559
7561
  return;
7560
7562
  }
7561
- const printDoc = chunkWVDM36ZM_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7563
+ const printDoc = chunk7ARD2J6Y_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7562
7564
  title: "Slides (Vector)",
7563
7565
  orientation: settings.orientation,
7564
7566
  colorFilter
@@ -7594,7 +7596,7 @@ function usePrintHandlers(input) {
7594
7596
  if (settings.printWhat === "outline") {
7595
7597
  openPrintWindow(
7596
7598
  "Outline",
7597
- `<div class="outline-page">${chunkWVDM36ZM_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7599
+ `<div class="outline-page">${chunk7ARD2J6Y_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7598
7600
  settings.orientation,
7599
7601
  colorFilter,
7600
7602
  settings.frameSlides
@@ -7619,7 +7621,7 @@ function usePrintHandlers(input) {
7619
7621
  if (settings.printWhat === "slides") {
7620
7622
  openPrintWindow(
7621
7623
  "Slides",
7622
- chunkWVDM36ZM_js.buildSlidesHtml(slideImages, slideIndices),
7624
+ chunk7ARD2J6Y_js.buildSlidesHtml(slideImages, slideIndices),
7623
7625
  settings.orientation,
7624
7626
  colorFilter,
7625
7627
  settings.frameSlides
@@ -7629,7 +7631,7 @@ function usePrintHandlers(input) {
7629
7631
  if (settings.printWhat === "notes") {
7630
7632
  openPrintWindow(
7631
7633
  "Notes Pages",
7632
- chunkWVDM36ZM_js.buildNotesHtml(slideImages, slideIndices, slides),
7634
+ chunk7ARD2J6Y_js.buildNotesHtml(slideImages, slideIndices, slides),
7633
7635
  "portrait",
7634
7636
  colorFilter,
7635
7637
  settings.frameSlides
@@ -7640,7 +7642,7 @@ function usePrintHandlers(input) {
7640
7642
  const spp = settings.slidesPerPage;
7641
7643
  openPrintWindow(
7642
7644
  `Handout ${spp} per page`,
7643
- chunkWVDM36ZM_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7645
+ chunk7ARD2J6Y_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7644
7646
  "portrait",
7645
7647
  colorFilter,
7646
7648
  settings.frameSlides
@@ -7704,8 +7706,8 @@ function useThemeHandlers(input) {
7704
7706
  return;
7705
7707
  }
7706
7708
  await handler.updateThemeColorScheme(colorScheme);
7707
- const previousMap = theme?.colorScheme ? chunkWVDM36ZM_js.buildThemeColorMap(theme.colorScheme) : {};
7708
- setSlides((prev) => chunkWVDM36ZM_js.reResolveSlideColors(prev, previousMap, colorScheme));
7709
+ const previousMap = theme?.colorScheme ? chunk7ARD2J6Y_js.buildThemeColorMap(theme.colorScheme) : {};
7710
+ setSlides((prev) => chunk7ARD2J6Y_js.reResolveSlideColors(prev, previousMap, colorScheme));
7709
7711
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7710
7712
  bumpHistory();
7711
7713
  history.markDirty();
@@ -7810,7 +7812,7 @@ function useThemeSwitching(input) {
7810
7812
  }
7811
7813
  try {
7812
7814
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7813
- const newData = chunkWVDM36ZM_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7815
+ const newData = chunk7ARD2J6Y_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7814
7816
  onDataChange(newData);
7815
7817
  onThemeChanged?.(preset);
7816
7818
  } catch (error) {
@@ -7827,7 +7829,7 @@ function useThemeSwitching(input) {
7827
7829
  }
7828
7830
  try {
7829
7831
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7830
- const newData = chunkWVDM36ZM_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7832
+ const newData = chunk7ARD2J6Y_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7831
7833
  onDataChange(newData);
7832
7834
  } catch (error) {
7833
7835
  console.error("Failed to switch to custom theme:", error);
@@ -7839,12 +7841,12 @@ function useThemeSwitching(input) {
7839
7841
  if (!data?.theme?.colorScheme) {
7840
7842
  return void 0;
7841
7843
  }
7842
- return chunkWVDM36ZM_js.THEME_PRESETS.find(
7843
- (p) => chunkWVDM36ZM_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7844
+ return chunk7ARD2J6Y_js.THEME_PRESETS.find(
7845
+ (p) => chunk7ARD2J6Y_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7844
7846
  );
7845
7847
  }, [data?.theme?.colorScheme]);
7846
7848
  return {
7847
- presets: chunkWVDM36ZM_js.THEME_PRESETS,
7849
+ presets: chunk7ARD2J6Y_js.THEME_PRESETS,
7848
7850
  switchToPreset,
7849
7851
  switchToCustom,
7850
7852
  currentPreset
@@ -7919,7 +7921,7 @@ function usePropertyHandlers(input) {
7919
7921
  }
7920
7922
  try {
7921
7923
  const ab = await file.arrayBuffer();
7922
- const h = new chunkWVDM36ZM_js.PptxHandler();
7924
+ const h = new chunk7ARD2J6Y_js.PptxHandler();
7923
7925
  const other = await h.load(ab);
7924
7926
  if (!other) {
7925
7927
  return;
@@ -7929,7 +7931,7 @@ function usePropertyHandlers(input) {
7929
7931
  width: canvasSize.width,
7930
7932
  height: canvasSize.height
7931
7933
  };
7932
- setCompareResult(chunkWVDM36ZM_js.comparePresentation(cur, other));
7934
+ setCompareResult(chunk7ARD2J6Y_js.comparePresentation(cur, other));
7933
7935
  setIsComparePanelOpen(true);
7934
7936
  } catch (err) {
7935
7937
  console.warn("Compare failed:", err);
@@ -7946,7 +7948,7 @@ function usePropertyHandlers(input) {
7946
7948
  if (!diff || diff.status === "unchanged") {
7947
7949
  return;
7948
7950
  }
7949
- setSlides((prev) => chunkWVDM36ZM_js.applyAcceptSlide(prev, diff));
7951
+ setSlides((prev) => chunk7ARD2J6Y_js.applyAcceptSlide(prev, diff));
7950
7952
  setIsDirty(true);
7951
7953
  },
7952
7954
  [compareResult, setSlides, setIsDirty]
@@ -7957,10 +7959,10 @@ function usePropertyHandlers(input) {
7957
7959
  if (!compareResult) {
7958
7960
  return;
7959
7961
  }
7960
- setSlides((prev) => chunkWVDM36ZM_js.applyAcceptAllSlides(prev, compareResult));
7962
+ setSlides((prev) => chunk7ARD2J6Y_js.applyAcceptAllSlides(prev, compareResult));
7961
7963
  setIsDirty(true);
7962
7964
  }, [compareResult, setSlides, setIsDirty]);
7963
- const usedFontFamilies = react.useMemo(() => chunkWVDM36ZM_js.collectUsedFonts(slides), [slides]);
7965
+ const usedFontFamilies = react.useMemo(() => chunk7ARD2J6Y_js.collectUsedFonts(slides), [slides]);
7964
7966
  return {
7965
7967
  handleUpdateNotes,
7966
7968
  handleUpdateSlide,
@@ -8079,7 +8081,7 @@ function useIsMobile(input) {
8079
8081
  const containerRef = input?.containerRef;
8080
8082
  const isTouchDevice = react.useSyncExternalStore(
8081
8083
  subscribeTouchCapability,
8082
- chunkWVDM36ZM_js.detectTouchDevice,
8084
+ chunk7ARD2J6Y_js.detectTouchDevice,
8083
8085
  () => false
8084
8086
  // server snapshot
8085
8087
  );
@@ -8095,7 +8097,7 @@ function useIsMobile(input) {
8095
8097
  }
8096
8098
  return containerRef?.current?.clientHeight ?? window.innerHeight;
8097
8099
  });
8098
- const [orientation, setOrientation] = react.useState(chunkWVDM36ZM_js.detectOrientation);
8100
+ const [orientation, setOrientation] = react.useState(chunk7ARD2J6Y_js.detectOrientation);
8099
8101
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
8100
8102
  const [initialViewportHeight] = react.useState(
8101
8103
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -8139,7 +8141,7 @@ function useIsMobile(input) {
8139
8141
  return;
8140
8142
  }
8141
8143
  const handleOrientationChange = () => {
8142
- setOrientation(chunkWVDM36ZM_js.detectOrientation());
8144
+ setOrientation(chunk7ARD2J6Y_js.detectOrientation());
8143
8145
  };
8144
8146
  if (screen.orientation) {
8145
8147
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -8169,9 +8171,9 @@ function useIsMobile(input) {
8169
8171
  window.addEventListener("resize", handleResize);
8170
8172
  return () => window.removeEventListener("resize", handleResize);
8171
8173
  }, [isTouchDevice, initialViewportHeight]);
8172
- const isMobile = chunkWVDM36ZM_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8173
- const isTablet = !isMobile && containerWidth >= chunkWVDM36ZM_js.MOBILE_BREAKPOINT && containerWidth < chunkWVDM36ZM_js.TABLET_BREAKPOINT;
8174
- const isDesktop = !isMobile && containerWidth >= chunkWVDM36ZM_js.TABLET_BREAKPOINT;
8174
+ const isMobile = chunk7ARD2J6Y_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8175
+ const isTablet = !isMobile && containerWidth >= chunk7ARD2J6Y_js.MOBILE_BREAKPOINT && containerWidth < chunk7ARD2J6Y_js.TABLET_BREAKPOINT;
8176
+ const isDesktop = !isMobile && containerWidth >= chunk7ARD2J6Y_js.TABLET_BREAKPOINT;
8175
8177
  return {
8176
8178
  isMobile,
8177
8179
  isTablet,
@@ -8233,7 +8235,7 @@ function useViewerDialogs(input) {
8233
8235
  );
8234
8236
  const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8235
8237
  const fontEmbedding = react.useMemo(
8236
- () => chunkWVDM36ZM_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8238
+ () => chunk7ARD2J6Y_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8237
8239
  [embeddedFontKey]
8238
8240
  );
8239
8241
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
@@ -8241,11 +8243,11 @@ function useViewerDialogs(input) {
8241
8243
  setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8242
8244
  }, [fontEmbedding]);
8243
8245
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8244
- () => typeof window !== "undefined" ? chunkWVDM36ZM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8246
+ () => typeof window !== "undefined" ? chunk7ARD2J6Y_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8245
8247
  );
8246
8248
  react.useEffect(() => {
8247
8249
  const handleWindow = () => setIsNarrowViewport(
8248
- chunkWVDM36ZM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8250
+ chunk7ARD2J6Y_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8249
8251
  );
8250
8252
  let observer = null;
8251
8253
  let raf = 0;
@@ -8259,12 +8261,12 @@ function useViewerDialogs(input) {
8259
8261
  const entry = entries[0];
8260
8262
  if (entry) {
8261
8263
  setIsNarrowViewport(
8262
- chunkWVDM36ZM_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8264
+ chunk7ARD2J6Y_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8263
8265
  );
8264
8266
  }
8265
8267
  });
8266
8268
  observer.observe(el);
8267
- setIsNarrowViewport(chunkWVDM36ZM_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8269
+ setIsNarrowViewport(chunk7ARD2J6Y_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8268
8270
  };
8269
8271
  attach();
8270
8272
  window.addEventListener("resize", handleWindow);
@@ -8423,20 +8425,20 @@ function useViewerDialogs(input) {
8423
8425
  }
8424
8426
  function computeGridSpacingPx(presentationGridSpacing) {
8425
8427
  if (presentationGridSpacing) {
8426
- const px = Math.round(presentationGridSpacing.cx / chunk4LWGAVAP_js.EMU_PER_PX);
8428
+ const px = Math.round(presentationGridSpacing.cx / chunkOVPJT4EQ_js.EMU_PER_PX);
8427
8429
  if (px > 0) {
8428
8430
  return px;
8429
8431
  }
8430
8432
  }
8431
- return chunk4LWGAVAP_js.GRID_SIZE;
8433
+ return chunkOVPJT4EQ_js.GRID_SIZE;
8432
8434
  }
8433
8435
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8434
8436
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8435
- return chunkWVDM36ZM_js.resolveShowSlideIndexes(slides, activeShow);
8437
+ return chunk7ARD2J6Y_js.resolveShowSlideIndexes(slides, activeShow);
8436
8438
  }
8437
8439
  function computeSlideSectionGroups(slides, sections) {
8438
- return chunkWVDM36ZM_js.groupSlidesBySection(sections, slides).map((group) => ({
8439
- id: group.section?.id ?? (sections.length > 0 ? chunk4LWGAVAP_js.UNGROUPED_SECTION_ID : chunk4LWGAVAP_js.DEFAULT_SECTION_GROUP_ID),
8440
+ return chunk7ARD2J6Y_js.groupSlidesBySection(sections, slides).map((group) => ({
8441
+ id: group.section?.id ?? (sections.length > 0 ? chunkOVPJT4EQ_js.UNGROUPED_SECTION_ID : chunkOVPJT4EQ_js.DEFAULT_SECTION_GROUP_ID),
8440
8442
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8441
8443
  slideIndexes: group.slideIndexes,
8442
8444
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8448,7 +8450,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8448
8450
  return void 0;
8449
8451
  }
8450
8452
  const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8451
- return chunkWVDM36ZM_js.masterViewPseudoSlide(document2, {
8453
+ return chunk7ARD2J6Y_js.masterViewPseudoSlide(document2, {
8452
8454
  tab: "slides",
8453
8455
  masterIndex: 0,
8454
8456
  layoutIndex: activeLayout ? 0 : null
@@ -8476,10 +8478,10 @@ function useDerivedSlideState(input) {
8476
8478
  );
8477
8479
  const slideSectionGroups = react.useMemo(
8478
8480
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8479
- if (group.id === chunk4LWGAVAP_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8481
+ if (group.id === chunkOVPJT4EQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8480
8482
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8481
8483
  }
8482
- if (group.id === chunk4LWGAVAP_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8484
+ if (group.id === chunkOVPJT4EQ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8483
8485
  return { ...group, label: t("pptx.sections.slides") };
8484
8486
  }
8485
8487
  return group;
@@ -8579,13 +8581,13 @@ function useAnnotationHandlers(input) {
8579
8581
  }, [annotations, setMode, setSlides, history]);
8580
8582
  const handleSetMode = react.useCallback(
8581
8583
  (nextMode) => {
8582
- if (mode === "present" && nextMode !== "present" && !chunkWVDM36ZM_js.mayLeaveSlideShow()) {
8584
+ if (mode === "present" && nextMode !== "present" && !chunk7ARD2J6Y_js.mayLeaveSlideShow()) {
8583
8585
  return;
8584
8586
  }
8585
8587
  if (nextMode === "present") {
8586
8588
  presentation.enterPresentMode();
8587
8589
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8588
- chunkWVDM36ZM_js.stopAllPersistentAudio();
8590
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8589
8591
  pendingModeAfterAnnotationsRef.current = nextMode;
8590
8592
  if (promptKeepInkAnnotations) {
8591
8593
  setShowKeepAnnotationsDialog(true);
@@ -8594,7 +8596,7 @@ function useAnnotationHandlers(input) {
8594
8596
  }
8595
8597
  } else {
8596
8598
  if (mode === "present") {
8597
- chunkWVDM36ZM_js.stopAllPersistentAudio();
8599
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8598
8600
  }
8599
8601
  setMode(nextMode);
8600
8602
  }
@@ -8665,13 +8667,13 @@ function useSerialize(input) {
8665
8667
  let processedSlide = slide;
8666
8668
  if (pendingEditId) {
8667
8669
  const updatedElements = slide.elements.map((el) => {
8668
- if (el.id !== pendingEditId || !chunkWVDM36ZM_js.hasTextProperties(el)) {
8670
+ if (el.id !== pendingEditId || !chunk7ARD2J6Y_js.hasTextProperties(el)) {
8669
8671
  return el;
8670
8672
  }
8671
8673
  return {
8672
8674
  ...el,
8673
8675
  text: pendingEditText,
8674
- textSegments: chunkWVDM36ZM_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8676
+ textSegments: chunk7ARD2J6Y_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8675
8677
  };
8676
8678
  });
8677
8679
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8684,19 +8686,19 @@ function useSerialize(input) {
8684
8686
  const pptxGuides = guides.map((g) => ({
8685
8687
  id: g.id,
8686
8688
  orientation: g.axis === "h" ? "horz" : "vert",
8687
- positionEmu: chunkWVDM36ZM_js.guidePxToEmu(g.position)
8689
+ positionEmu: chunk7ARD2J6Y_js.guidePxToEmu(g.position)
8688
8690
  }));
8689
8691
  return {
8690
8692
  ...processedSlide,
8691
8693
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8692
8694
  };
8693
8695
  });
8694
- const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8696
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8695
8697
  const saveOptions = {
8696
8698
  // Without this the Slide Size card edited a viewer-only pixel value and
8697
8699
  // the saved `p:sldSz` never moved: passing `slideSize` is the only way a
8698
8700
  // slide-size edit reaches the file.
8699
- slideSize: chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8701
+ slideSize: chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8700
8702
  headerFooter,
8701
8703
  presentationProperties,
8702
8704
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -8708,9 +8710,9 @@ function useSerialize(input) {
8708
8710
  slideMasters,
8709
8711
  notesMaster,
8710
8712
  handoutMaster,
8711
- ...chunkWVDM36ZM_js.embeddedFontSaveOptions(embedFonts)
8713
+ ...chunk7ARD2J6Y_js.embeddedFontSaveOptions(embedFonts)
8712
8714
  };
8713
- return chunkWVDM36ZM_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8715
+ return chunk7ARD2J6Y_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8714
8716
  }, [
8715
8717
  slides,
8716
8718
  templateElementsBySlideId,
@@ -8737,102 +8739,52 @@ function useSerialize(input) {
8737
8739
  purpose
8738
8740
  ]);
8739
8741
  }
8740
-
8741
- // src/viewer/hooks/useRecoveryDetection-helpers.ts
8742
- function shouldCheckRecovery(input) {
8743
- const { alreadyChecked, filePath, loading, error, slideCount } = input;
8744
- if (alreadyChecked) {
8745
- return false;
8746
- }
8747
- if (!filePath) {
8748
- return false;
8749
- }
8750
- if (loading) {
8751
- return false;
8752
- }
8753
- if (error) {
8754
- return false;
8755
- }
8756
- if (slideCount === 0) {
8757
- return false;
8758
- }
8759
- return true;
8760
- }
8761
- var RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
8762
- function isRecentRecovery(timestamp, now) {
8763
- return now - timestamp < RECOVERY_WINDOW_MS;
8764
- }
8765
- function hasRecentRecoveryVersion(versions, now) {
8766
- if (versions.length === 0) {
8767
- return false;
8768
- }
8769
- return isRecentRecovery(versions[0].timestamp, now);
8770
- }
8771
-
8772
- // src/viewer/hooks/useRecoveryDetection.ts
8773
- var DB_NAME = "pptx-viewer-autosave";
8774
- var DB_VERSION = 1;
8775
- var STORE_NAME = "recoveryVersions";
8776
- function openAutosaveDb() {
8777
- return new Promise((resolve, reject) => {
8778
- const req = indexedDB.open(DB_NAME, DB_VERSION);
8779
- req.onupgradeneeded = () => {
8780
- const db = req.result;
8781
- if (!db.objectStoreNames.contains(STORE_NAME)) {
8782
- db.createObjectStore(STORE_NAME, { keyPath: "key" });
8783
- }
8784
- };
8785
- req.onsuccess = () => resolve(req.result);
8786
- req.onerror = () => reject(req.error);
8787
- });
8788
- }
8789
- async function getRecoveryVersion(filePath) {
8790
- try {
8791
- const db = await openAutosaveDb();
8792
- return new Promise((resolve) => {
8793
- const tx = db.transaction(STORE_NAME, "readonly");
8794
- const store = tx.objectStore(STORE_NAME);
8795
- const req = store.get(filePath);
8796
- req.onsuccess = () => {
8797
- db.close();
8798
- resolve(req.result);
8799
- };
8800
- req.onerror = () => {
8801
- db.close();
8802
- resolve(void 0);
8803
- };
8804
- });
8805
- } catch {
8806
- return void 0;
8807
- }
8808
- }
8809
8742
  function useRecoveryDetection(input) {
8810
- const { filePath, loading, error, slideCount, openVersionHistory } = input;
8743
+ const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
8811
8744
  const recoveryCheckedRef = react.useRef(false);
8745
+ const recordRef = react.useRef(null);
8746
+ const [prompt, setPrompt] = react.useState(null);
8747
+ const onRestore = input.onRestore;
8748
+ const openVersionHistory = input.openVersionHistory;
8812
8749
  react.useEffect(() => {
8813
- if (!shouldCheckRecovery({
8750
+ if (!chunk7ARD2J6Y_js.shouldProbeAutosaveRecovery({
8814
8751
  alreadyChecked: recoveryCheckedRef.current,
8815
8752
  filePath,
8816
8753
  loading,
8817
8754
  error,
8818
- slideCount
8755
+ slideCount,
8756
+ autosaveAllowed
8819
8757
  })) {
8820
8758
  return;
8821
8759
  }
8822
8760
  recoveryCheckedRef.current = true;
8823
- if (typeof indexedDB === "undefined") {
8824
- return;
8825
- }
8826
8761
  void (async () => {
8827
- try {
8828
- const version = await getRecoveryVersion(filePath);
8829
- if (version && hasRecentRecoveryVersion([version], Date.now())) {
8830
- openVersionHistory();
8831
- }
8832
- } catch {
8762
+ const offer = await chunk7ARD2J6Y_js.probeAutosaveRecovery(filePath);
8763
+ if (!offer) {
8764
+ return;
8833
8765
  }
8766
+ recordRef.current = offer.record;
8767
+ setPrompt(offer.prompt);
8768
+ openVersionHistory?.();
8834
8769
  })();
8835
- }, [filePath, loading, error, slideCount, openVersionHistory]);
8770
+ }, [filePath, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
8771
+ const restore = react.useCallback(() => {
8772
+ const record = recordRef.current;
8773
+ setPrompt(null);
8774
+ if (record && onRestore) {
8775
+ onRestore(chunk7ARD2J6Y_js.acceptAutosaveRecovery(record));
8776
+ }
8777
+ recordRef.current = null;
8778
+ }, [onRestore]);
8779
+ const discard = react.useCallback(() => {
8780
+ const record = recordRef.current;
8781
+ setPrompt(null);
8782
+ recordRef.current = null;
8783
+ if (record) {
8784
+ void chunk7ARD2J6Y_js.discardAutosaveRecovery(record);
8785
+ }
8786
+ }, []);
8787
+ return { prompt, restore, discard };
8836
8788
  }
8837
8789
  function usePresentationSetup(input) {
8838
8790
  const {
@@ -8869,7 +8821,7 @@ function usePresentationSetup(input) {
8869
8821
  containerRef,
8870
8822
  content,
8871
8823
  onSetMode: (nextMode) => {
8872
- if (mode === "present" && nextMode !== "present" && !chunkWVDM36ZM_js.mayLeaveSlideShow()) {
8824
+ if (mode === "present" && nextMode !== "present" && !chunk7ARD2J6Y_js.mayLeaveSlideShow()) {
8873
8825
  return;
8874
8826
  }
8875
8827
  if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
@@ -8877,7 +8829,7 @@ function usePresentationSetup(input) {
8877
8829
  setShowKeepAnnotationsDialog(true);
8878
8830
  } else {
8879
8831
  if (mode === "present" && nextMode !== "present") {
8880
- chunkWVDM36ZM_js.stopAllPersistentAudio();
8832
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8881
8833
  stopAnimationSound();
8882
8834
  }
8883
8835
  setMode(nextMode);
@@ -8932,10 +8884,10 @@ function usePresentationSetup(input) {
8932
8884
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8933
8885
  onToggleSubtitles,
8934
8886
  onSaveRehearsalTimings: (timings) => {
8935
- setSlides((prev) => chunkWVDM36ZM_js.applyRehearsalTimings(prev, timings));
8887
+ setSlides((prev) => chunk7ARD2J6Y_js.applyRehearsalTimings(prev, timings));
8936
8888
  history.markDirty();
8937
8889
  },
8938
- loopContinuously: chunkWVDM36ZM_js.shouldLoopContinuously(presentationProperties),
8890
+ loopContinuously: chunk7ARD2J6Y_js.shouldLoopContinuously(presentationProperties),
8939
8891
  showWithAnimation: presentationProperties.showWithAnimation,
8940
8892
  useTimings: presentationProperties.advanceMode !== "manual",
8941
8893
  endWithBlackSlide
@@ -9128,7 +9080,7 @@ function useEditorOperations(input) {
9128
9080
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9129
9081
  react.useEffect(() => {
9130
9082
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9131
- copiedFormatRef.current = chunkWVDM36ZM_js.copyFormatFromElement(selectedElement);
9083
+ copiedFormatRef.current = chunk7ARD2J6Y_js.copyFormatFromElement(selectedElement);
9132
9084
  } else if (!formatPainterActive) {
9133
9085
  copiedFormatRef.current = null;
9134
9086
  }
@@ -9154,12 +9106,12 @@ function useEditorOperations(input) {
9154
9106
  e.stopPropagation();
9155
9107
  const element = elementLookup.get(elementId);
9156
9108
  if (element) {
9157
- const updated = chunkWVDM36ZM_js.applyFormatToElement(element, copiedFormatRef.current);
9109
+ const updated = chunk7ARD2J6Y_js.applyFormatToElement(element, copiedFormatRef.current);
9158
9110
  const updates = {};
9159
- if (chunkWVDM36ZM_js.hasShapeProperties(updated)) {
9111
+ if (chunk7ARD2J6Y_js.hasShapeProperties(updated)) {
9160
9112
  updates.shapeStyle = updated.shapeStyle;
9161
9113
  }
9162
- if (chunkWVDM36ZM_js.hasTextProperties(updated)) {
9114
+ if (chunk7ARD2J6Y_js.hasTextProperties(updated)) {
9163
9115
  updates.textStyle = updated.textStyle;
9164
9116
  }
9165
9117
  ops.updateElementById(elementId, updates);
@@ -9313,7 +9265,7 @@ function collectReferencedFontFamilies(slides) {
9313
9265
  const families = /* @__PURE__ */ new Set();
9314
9266
  for (const slide of slides) {
9315
9267
  for (const el of slide.elements) {
9316
- if (chunkWVDM36ZM_js.hasTextProperties(el) && el.textSegments) {
9268
+ if (chunk7ARD2J6Y_js.hasTextProperties(el) && el.textSegments) {
9317
9269
  for (const seg of el.textSegments) {
9318
9270
  if (seg.style.fontFamily) {
9319
9271
  families.add(seg.style.fontFamily);
@@ -9443,7 +9395,7 @@ function useContentLifecycle(input) {
9443
9395
  content,
9444
9396
  filePath,
9445
9397
  autosaveEnabled = true,
9446
- autosaveIntervalSeconds,
9398
+ autosaveIntervalMs,
9447
9399
  embedFonts = true,
9448
9400
  slides,
9449
9401
  state,
@@ -9527,7 +9479,7 @@ function useContentLifecycle(input) {
9527
9479
  filePath,
9528
9480
  serializeSlides: serializeForRecovery,
9529
9481
  enabled: autosaveEnabled,
9530
- ...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds },
9482
+ ...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
9531
9483
  // Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
9532
9484
  // so a poll that finds all of them unchanged can skip re-serializing a
9533
9485
  // deck it has already snapshotted. The two refs are read by `.current`
@@ -9560,7 +9512,7 @@ function useKeyboardShortcuts(input) {
9560
9512
  inputRef.current = input;
9561
9513
  const handleKeyDown = react.useCallback((e) => {
9562
9514
  const current = inputRef.current;
9563
- const { action, dx, dy } = chunkWVDM36ZM_js.mapEditorKey(e, {
9515
+ const { action, dx, dy } = chunk7ARD2J6Y_js.mapEditorKey(e, {
9564
9516
  canEdit: current.canEdit,
9565
9517
  // The Slide Master view is an editing surface, not a viewing one.
9566
9518
  // Gating on `mode !== 'edit'` alone made `mapEditorKey` return
@@ -9573,7 +9525,7 @@ function useKeyboardShortcuts(input) {
9573
9525
  hasSelection: current.hasSelection,
9574
9526
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9575
9527
  isDrawing: current.activeTool !== "select",
9576
- isTextInputTarget: chunkWVDM36ZM_js.isEditorTextInputTarget(e.target)
9528
+ isTextInputTarget: chunk7ARD2J6Y_js.isEditorTextInputTarget(e.target)
9577
9529
  });
9578
9530
  if (action === null) {
9579
9531
  return;
@@ -9727,7 +9679,8 @@ function useViewerIntegration(input) {
9727
9679
  content,
9728
9680
  filePath,
9729
9681
  autosaveEnabled,
9730
- autosaveIntervalSeconds,
9682
+ autosaveAllowed = true,
9683
+ autosaveIntervalMs,
9731
9684
  canEdit,
9732
9685
  mode,
9733
9686
  slides,
@@ -9783,7 +9736,7 @@ function useViewerIntegration(input) {
9783
9736
  content,
9784
9737
  filePath,
9785
9738
  autosaveEnabled,
9786
- autosaveIntervalSeconds,
9739
+ autosaveIntervalMs,
9787
9740
  // The File > Fonts toggle, finally reaching a save call.
9788
9741
  embedFonts: dialogs.embedFontsEnabled,
9789
9742
  slides,
@@ -9827,12 +9780,13 @@ function useViewerIntegration(input) {
9827
9780
  setMode: state.setMode,
9828
9781
  setSlides: state.setSlides
9829
9782
  });
9830
- useRecoveryDetection({
9783
+ const recovery = useRecoveryDetection({
9831
9784
  filePath,
9832
9785
  loading,
9833
9786
  error,
9834
9787
  slideCount: slides.length,
9835
- openVersionHistory: () => propertyHandlers.setIsVersionHistoryOpen(true)
9788
+ autosaveAllowed,
9789
+ onRestore: setContent
9836
9790
  });
9837
9791
  react.useImperativeHandle(
9838
9792
  ref,
@@ -9877,7 +9831,7 @@ function useViewerIntegration(input) {
9877
9831
  return zoom.scale;
9878
9832
  },
9879
9833
  setZoom(level) {
9880
- zoom.setScale(chunkWVDM36ZM_js.clampZoomScale(level));
9834
+ zoom.setScale(chunk7ARD2J6Y_js.clampZoomScale(level));
9881
9835
  },
9882
9836
  zoomIn() {
9883
9837
  zoom.handleZoomIn();
@@ -10040,6 +9994,7 @@ function useViewerIntegration(input) {
10040
9994
  handleEnterPresenterView,
10041
9995
  handleEnterRehearsalMode,
10042
9996
  autosaveStatus,
9997
+ recovery,
10043
9998
  isEncryptedDialogOpen,
10044
9999
  setIsEncryptedDialogOpen,
10045
10000
  handlerRef,
@@ -10092,7 +10047,7 @@ function useReducedMotion() {
10092
10047
  }
10093
10048
  function useViewerOptions() {
10094
10049
  const storeRef = react.useRef(null);
10095
- storeRef.current ??= chunkWVDM36ZM_js.createViewerOptionsStore();
10050
+ storeRef.current ??= chunk7ARD2J6Y_js.createViewerOptionsStore();
10096
10051
  const store = storeRef.current;
10097
10052
  const options = react.useSyncExternalStore(
10098
10053
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -10101,9 +10056,9 @@ function useViewerOptions() {
10101
10056
  );
10102
10057
  return { optionsStore: store, options };
10103
10058
  }
10104
- var KNOWN_TAB_IDS = new Set(chunkWVDM36ZM_js.TOOLBAR_TABS.map((tab) => tab.id));
10059
+ var KNOWN_TAB_IDS = new Set(chunk7ARD2J6Y_js.TOOLBAR_TABS.map((tab) => tab.id));
10105
10060
  function computeToolbarVisibility(hiddenActions) {
10106
- const isHidden = (id) => chunkWVDM36ZM_js.isActionHidden(id, hiddenActions);
10061
+ const isHidden = (id) => chunk7ARD2J6Y_js.isActionHidden(id, hiddenActions);
10107
10062
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
10108
10063
  return { isHidden, isTabVisible };
10109
10064
  }
@@ -10188,12 +10143,12 @@ function useYjsDocumentSync({
10188
10143
  return;
10189
10144
  }
10190
10145
  try {
10191
- const handler = new chunkWVDM36ZM_js.PptxHandler();
10146
+ const handler = new chunk7ARD2J6Y_js.PptxHandler();
10192
10147
  await handler.load(sourceBytes.buffer);
10193
- const currentSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
10148
+ const currentSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10194
10149
  doc
10195
10150
  );
10196
- const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10151
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10197
10152
  const bytes = await handler.save(slidesToSave);
10198
10153
  config.onWriteBack(bytes);
10199
10154
  } catch {
@@ -10208,7 +10163,7 @@ function useYjsDocumentSync({
10208
10163
  if (!doc || !isConnected) {
10209
10164
  return;
10210
10165
  }
10211
- const docSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
10166
+ const docSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10212
10167
  doc
10213
10168
  );
10214
10169
  if (docSlides.length === 0) {
@@ -10230,11 +10185,11 @@ function useYjsDocumentSync({
10230
10185
  lastSyncedRef.current = serialized;
10231
10186
  void (async () => {
10232
10187
  const factories = await getFactories();
10233
- chunkWVDM36ZM_js.reconcileSlidesInYDoc(
10188
+ chunk7ARD2J6Y_js.reconcileSlidesInYDoc(
10234
10189
  slides,
10235
10190
  doc,
10236
10191
  factories,
10237
- chunkWVDM36ZM_js.LOCAL_SYNC_ORIGIN
10192
+ chunk7ARD2J6Y_js.LOCAL_SYNC_ORIGIN
10238
10193
  );
10239
10194
  scheduleWriteBack();
10240
10195
  })();
@@ -10248,10 +10203,10 @@ function useYjsDocumentSync({
10248
10203
  return;
10249
10204
  }
10250
10205
  const handleChange = (_events, transaction) => {
10251
- if (transaction?.origin === chunkWVDM36ZM_js.LOCAL_SYNC_ORIGIN) {
10206
+ if (transaction?.origin === chunk7ARD2J6Y_js.LOCAL_SYNC_ORIGIN) {
10252
10207
  return;
10253
10208
  }
10254
- const remoteSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
10209
+ const remoteSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10255
10210
  doc
10256
10211
  );
10257
10212
  if (remoteSlides.length === 0) {
@@ -10267,7 +10222,7 @@ function useYjsDocumentSync({
10267
10222
  isApplyingRemoteRef.current = false;
10268
10223
  scheduleWriteBack();
10269
10224
  };
10270
- const unobserve = chunkWVDM36ZM_js.observeYDocSlides(
10225
+ const unobserve = chunk7ARD2J6Y_js.observeYDocSlides(
10271
10226
  doc,
10272
10227
  handleChange
10273
10228
  );
@@ -10305,7 +10260,7 @@ function useBroadcastFollower({
10305
10260
  if (!broadcaster) {
10306
10261
  return;
10307
10262
  }
10308
- if (!chunkWVDM36ZM_js.shouldAutoFollowBroadcaster({
10263
+ if (!chunk7ARD2J6Y_js.shouldAutoFollowBroadcaster({
10309
10264
  localRole: collab.config.role,
10310
10265
  broadcasterRole: broadcaster.role
10311
10266
  })) {
@@ -10476,10 +10431,10 @@ function useTouchGestures(input) {
10476
10431
  if (!el || !enabled) {
10477
10432
  return;
10478
10433
  }
10479
- const recognizer = chunkWVDM36ZM_js.createTouchGestureRecognizer({
10434
+ const recognizer = chunk7ARD2J6Y_js.createTouchGestureRecognizer({
10480
10435
  getScale: () => scaleRef.current,
10481
- minScale: chunkWVDM36ZM_js.MIN_ZOOM_SCALE,
10482
- maxScale: chunkWVDM36ZM_js.MAX_ZOOM_SCALE,
10436
+ minScale: chunk7ARD2J6Y_js.MIN_ZOOM_SCALE,
10437
+ maxScale: chunk7ARD2J6Y_js.MAX_ZOOM_SCALE,
10483
10438
  callbacks: {
10484
10439
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10485
10440
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10519,7 +10474,7 @@ function scrollFocusedIntoView(keyboardInset) {
10519
10474
  return;
10520
10475
  }
10521
10476
  const rect = active.getBoundingClientRect();
10522
- const delta = chunkWVDM36ZM_js.computeScrollDelta(
10477
+ const delta = chunk7ARD2J6Y_js.computeScrollDelta(
10523
10478
  { top: rect.top, bottom: rect.bottom },
10524
10479
  window.innerHeight,
10525
10480
  keyboardInset
@@ -10539,8 +10494,8 @@ function useKeyboardInsets(enabled = true) {
10539
10494
  return;
10540
10495
  }
10541
10496
  const update = () => {
10542
- const metrics = chunkWVDM36ZM_js.readViewportMetrics(window);
10543
- const inset = metrics ? chunkWVDM36ZM_js.computeKeyboardInset(metrics) : 0;
10497
+ const metrics = chunk7ARD2J6Y_js.readViewportMetrics(window);
10498
+ const inset = metrics ? chunk7ARD2J6Y_js.computeKeyboardInset(metrics) : 0;
10544
10499
  setKeyboardInset(inset);
10545
10500
  if (inset > 0) {
10546
10501
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10551,8 +10506,8 @@ function useKeyboardInsets(enabled = true) {
10551
10506
  vv.addEventListener("scroll", update);
10552
10507
  const onFocusIn = () => {
10553
10508
  window.requestAnimationFrame(() => {
10554
- const metrics = chunkWVDM36ZM_js.readViewportMetrics(window);
10555
- const inset = metrics ? chunkWVDM36ZM_js.computeKeyboardInset(metrics) : 0;
10509
+ const metrics = chunk7ARD2J6Y_js.readViewportMetrics(window);
10510
+ const inset = metrics ? chunk7ARD2J6Y_js.computeKeyboardInset(metrics) : 0;
10556
10511
  if (inset > 0) {
10557
10512
  scrollFocusedIntoView(inset);
10558
10513
  }
@@ -10565,7 +10520,7 @@ function useKeyboardInsets(enabled = true) {
10565
10520
  document.removeEventListener("focusin", onFocusIn);
10566
10521
  };
10567
10522
  }, [enabled]);
10568
- return { keyboardInset, isKeyboardOpen: chunkWVDM36ZM_js.isKeyboardOpen(keyboardInset) };
10523
+ return { keyboardInset, isKeyboardOpen: chunk7ARD2J6Y_js.isKeyboardOpen(keyboardInset) };
10569
10524
  }
10570
10525
 
10571
10526
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10592,7 +10547,7 @@ function buildCanvasProps(input) {
10592
10547
  } = input;
10593
10548
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10594
10549
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10595
- const fieldContext = chunkWVDM36ZM_js.buildFieldSubstitutionContext({
10550
+ const fieldContext = chunk7ARD2J6Y_js.buildFieldSubstitutionContext({
10596
10551
  headerFooter: s.headerFooter,
10597
10552
  customProperties: s.customProperties,
10598
10553
  slide: activeSlide
@@ -10602,13 +10557,13 @@ function buildCanvasProps(input) {
10602
10557
  if (mode === "present") {
10603
10558
  presentation.handlePresentationAction(action);
10604
10559
  } else if (action.url) {
10605
- chunkWVDM36ZM_js.safeOpenUrl(action.url);
10560
+ chunk7ARD2J6Y_js.safeOpenUrl(action.url);
10606
10561
  }
10607
10562
  };
10608
10563
  const handleHyperlinkClick = (url) => {
10609
- if (chunkWVDM36ZM_js.isPpactionUrl(url)) {
10564
+ if (chunk7ARD2J6Y_js.isPpactionUrl(url)) {
10610
10565
  if (mode === "present") {
10611
- const parsed = chunkWVDM36ZM_js.parsePpactionUrl(url);
10566
+ const parsed = chunk7ARD2J6Y_js.parsePpactionUrl(url);
10612
10567
  if (parsed) {
10613
10568
  presentation.handlePresentationAction({
10614
10569
  action: parsed.action,
@@ -10618,7 +10573,7 @@ function buildCanvasProps(input) {
10618
10573
  }
10619
10574
  return;
10620
10575
  }
10621
- chunkWVDM36ZM_js.safeOpenUrl(url);
10576
+ chunk7ARD2J6Y_js.safeOpenUrl(url);
10622
10577
  };
10623
10578
  return {
10624
10579
  activeSlide: effectiveSlide,
@@ -10714,7 +10669,7 @@ function buildCanvasProps(input) {
10714
10669
 
10715
10670
  // src/viewer/hooks/useScopedLayoutOptions.ts
10716
10671
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10717
- return chunkWVDM36ZM_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10672
+ return chunk7ARD2J6Y_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10718
10673
  }
10719
10674
 
10720
10675
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10727,7 +10682,7 @@ function buildToolbarAnimationHandlers(input) {
10727
10682
  const current = activeSlide.animations ?? [];
10728
10683
  if (group === "motionPath") {
10729
10684
  propertyHandlers.handleUpdateSlide({
10730
- animations: chunkWVDM36ZM_js.applyMotionPathPreset(current, selectedElement.id, preset)
10685
+ animations: chunk7ARD2J6Y_js.applyMotionPathPreset(current, selectedElement.id, preset)
10731
10686
  });
10732
10687
  return;
10733
10688
  }
@@ -10922,7 +10877,7 @@ function buildToolbarProps(input) {
10922
10877
  onOpenFile,
10923
10878
  onOpenRecentFile,
10924
10879
  onCreatePresentation: (templateId) => {
10925
- s.setSlides(chunkWVDM36ZM_js.createBackstagePresentation(templateId));
10880
+ s.setSlides(chunk7ARD2J6Y_js.createBackstagePresentation(templateId));
10926
10881
  s.setActiveSlideIndex(0);
10927
10882
  s.setSelectedElementId(null);
10928
10883
  s.setSelectedElementIds([]);
@@ -10951,7 +10906,7 @@ function buildToolbarProps(input) {
10951
10906
  loadLayoutPreviews: input.loadLayoutPreviews,
10952
10907
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10953
10908
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10954
- templateScheme: chunkWVDM36ZM_js.templateSchemeFromTheme(s.theme?.colorScheme),
10909
+ templateScheme: chunk7ARD2J6Y_js.templateSchemeFromTheme(s.theme?.colorScheme),
10955
10910
  customShows: s.customShows,
10956
10911
  activeCustomShowId: s.activeCustomShowId,
10957
10912
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10992,7 +10947,7 @@ function buildToolbarProps(input) {
10992
10947
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10993
10948
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10994
10949
  formatPainterActive: s.formatPainterActive,
10995
- canActivateFormatPainter: chunkWVDM36ZM_js.hasCopyableFormat(selectedElement),
10950
+ canActivateFormatPainter: chunk7ARD2J6Y_js.hasCopyableFormat(selectedElement),
10996
10951
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10997
10952
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10998
10953
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -11280,7 +11235,7 @@ function useViewerBuildingBlocks(input) {
11280
11235
  }, [incomingContent]);
11281
11236
  const onOpenFile = react.useCallback(() => {
11282
11237
  void (async () => {
11283
- const picked = await chunkWVDM36ZM_js.openPptxFile();
11238
+ const picked = await chunk7ARD2J6Y_js.openPptxFile();
11284
11239
  if (picked) {
11285
11240
  setContent(picked.buffer);
11286
11241
  }
@@ -11288,7 +11243,7 @@ function useViewerBuildingBlocks(input) {
11288
11243
  }, []);
11289
11244
  const onOpenRecentFile = react.useCallback((key) => {
11290
11245
  void (async () => {
11291
- const bytes = await chunkWVDM36ZM_js.readBackstageRecentFile(key);
11246
+ const bytes = await chunk7ARD2J6Y_js.readBackstageRecentFile(key);
11292
11247
  if (bytes) {
11293
11248
  setContent(bytes);
11294
11249
  }