pptx-react-viewer 3.13.0 → 3.15.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 (146) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{AiChatPanel-E53JJRZX.js → AiChatPanel-7CWOJ3PS.js} +32 -32
  3. package/dist/AiChatPanel-7CWOJ3PS.js.br +0 -0
  4. package/dist/AiChatPanel-7CWOJ3PS.js.gz +0 -0
  5. package/dist/{AiChatPanel-JTXC5WWH.mjs → AiChatPanel-TBIAQSZ7.mjs} +11 -11
  6. package/dist/AiChatPanel-TBIAQSZ7.mjs.br +0 -0
  7. package/dist/AiChatPanel-TBIAQSZ7.mjs.gz +0 -0
  8. package/dist/{Area3DChartScene-JQ2VU73H.mjs → Area3DChartScene-6FFBYPHF.mjs} +1 -1
  9. package/dist/Area3DChartScene-6FFBYPHF.mjs.br +0 -0
  10. package/dist/Area3DChartScene-6FFBYPHF.mjs.gz +0 -0
  11. package/dist/{Area3DChartScene-J7G54OH4.js → Area3DChartScene-ZJYR6K66.js} +2 -2
  12. package/dist/Area3DChartScene-ZJYR6K66.js.br +0 -0
  13. package/dist/Area3DChartScene-ZJYR6K66.js.gz +0 -0
  14. package/dist/{Bar3DChartScene-5HC7LYBH.mjs → Bar3DChartScene-42MWINQX.mjs} +1 -1
  15. package/dist/Bar3DChartScene-42MWINQX.mjs.br +0 -0
  16. package/dist/Bar3DChartScene-42MWINQX.mjs.gz +0 -0
  17. package/dist/{Bar3DChartScene-JV3A2P6O.js → Bar3DChartScene-JP3BXEZW.js} +2 -2
  18. package/dist/Bar3DChartScene-JP3BXEZW.js.br +0 -0
  19. package/dist/Bar3DChartScene-JP3BXEZW.js.gz +0 -0
  20. package/dist/{Line3DChartScene-7SN7TVKQ.js → Line3DChartScene-JK3AELXZ.js} +2 -2
  21. package/dist/Line3DChartScene-JK3AELXZ.js.br +0 -0
  22. package/dist/Line3DChartScene-JK3AELXZ.js.gz +0 -0
  23. package/dist/{Line3DChartScene-4ZAOOU7U.mjs → Line3DChartScene-YVCSJMWK.mjs} +1 -1
  24. package/dist/Line3DChartScene-YVCSJMWK.mjs.br +0 -0
  25. package/dist/Line3DChartScene-YVCSJMWK.mjs.gz +0 -0
  26. package/dist/{Model3DScene-GQANXXQD.js → Model3DScene-N6UIMN7T.js} +2 -2
  27. package/dist/Model3DScene-N6UIMN7T.js.br +0 -0
  28. package/dist/Model3DScene-N6UIMN7T.js.gz +0 -0
  29. package/dist/{Model3DScene-GWIBUQ2U.mjs → Model3DScene-OXWSYHHK.mjs} +1 -1
  30. package/dist/{Model3DScene-GWIBUQ2U.mjs.br → Model3DScene-OXWSYHHK.mjs.br} +0 -0
  31. package/dist/Model3DScene-OXWSYHHK.mjs.gz +0 -0
  32. package/dist/{PieChart3DScene-QPFDRMEA.js → PieChart3DScene-Q2Z3ECL4.js} +2 -2
  33. package/dist/PieChart3DScene-Q2Z3ECL4.js.br +0 -0
  34. package/dist/PieChart3DScene-Q2Z3ECL4.js.gz +0 -0
  35. package/dist/{PieChart3DScene-RDTOLFTD.mjs → PieChart3DScene-XK4ETZJC.mjs} +1 -1
  36. package/dist/PieChart3DScene-XK4ETZJC.mjs.br +0 -0
  37. package/dist/PieChart3DScene-XK4ETZJC.mjs.gz +0 -0
  38. package/dist/{SurfaceChart3DScene-5JQCRWA5.mjs → SurfaceChart3DScene-KNWMKMOL.mjs} +1 -1
  39. package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.br +0 -0
  40. package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.gz +0 -0
  41. package/dist/{SurfaceChart3DScene-JLYGC7QU.js → SurfaceChart3DScene-ULBUIF7T.js} +2 -2
  42. package/dist/SurfaceChart3DScene-ULBUIF7T.js.br +0 -0
  43. package/dist/SurfaceChart3DScene-ULBUIF7T.js.gz +0 -0
  44. package/dist/{chunk-TWUAZRCG.js → chunk-5KAMDV37.js} +143233 -141589
  45. package/dist/chunk-5KAMDV37.js.br +0 -0
  46. package/dist/chunk-5KAMDV37.js.gz +0 -0
  47. package/dist/{chunk-PKHTTHA2.mjs → chunk-6547ZWC7.mjs} +323 -171
  48. package/dist/chunk-6547ZWC7.mjs.br +0 -0
  49. package/dist/chunk-6547ZWC7.mjs.gz +0 -0
  50. package/dist/{chunk-HB7DJENT.mjs → chunk-AT4BJKON.mjs} +1 -1
  51. package/dist/chunk-AT4BJKON.mjs.br +0 -0
  52. package/dist/chunk-AT4BJKON.mjs.gz +0 -0
  53. package/dist/{chunk-M7SNS3DQ.mjs → chunk-C4Q4WYAJ.mjs} +275 -127
  54. package/dist/chunk-C4Q4WYAJ.mjs.br +0 -0
  55. package/dist/chunk-C4Q4WYAJ.mjs.gz +0 -0
  56. package/dist/{chunk-IVCYND7A.js → chunk-GLY4OPMY.js} +167 -167
  57. package/dist/chunk-GLY4OPMY.js.br +0 -0
  58. package/dist/chunk-GLY4OPMY.js.gz +0 -0
  59. package/dist/{chunk-Y3SA5H5H.mjs → chunk-J7Q7AGN7.mjs} +1 -1
  60. package/dist/chunk-J7Q7AGN7.mjs.br +0 -0
  61. package/dist/chunk-J7Q7AGN7.mjs.gz +0 -0
  62. package/dist/{chunk-H3GHGSGW.js → chunk-LAB7WX2N.js} +700 -551
  63. package/dist/chunk-LAB7WX2N.js.br +0 -0
  64. package/dist/chunk-LAB7WX2N.js.gz +0 -0
  65. package/dist/{chunk-UGVPKJSU.js → chunk-Q6CSZ7VM.js} +1568 -1416
  66. package/dist/chunk-Q6CSZ7VM.js.br +0 -0
  67. package/dist/chunk-Q6CSZ7VM.js.gz +0 -0
  68. package/dist/{chunk-G2Z7QULX.js → chunk-VVJTEFGP.js} +5 -5
  69. package/dist/chunk-VVJTEFGP.js.br +0 -0
  70. package/dist/chunk-VVJTEFGP.js.gz +0 -0
  71. package/dist/{chunk-TS2DHMBS.mjs → chunk-YNTZCMRI.mjs} +143222 -141589
  72. package/dist/chunk-YNTZCMRI.mjs.br +0 -0
  73. package/dist/chunk-YNTZCMRI.mjs.gz +0 -0
  74. package/dist/index.d.ts +54 -1
  75. package/dist/index.js +45 -45
  76. package/dist/index.js.br +0 -0
  77. package/dist/index.js.gz +0 -0
  78. package/dist/index.mjs +5 -5
  79. package/dist/index.mjs.br +0 -0
  80. package/dist/index.mjs.gz +0 -0
  81. package/dist/internals.d.ts +88 -2
  82. package/dist/internals.d.ts.map +1 -1
  83. package/dist/internals.js +78 -78
  84. package/dist/internals.js.br +0 -0
  85. package/dist/internals.js.gz +0 -0
  86. package/dist/internals.mjs +3 -3
  87. package/dist/internals.mjs.br +0 -0
  88. package/dist/internals.mjs.gz +0 -0
  89. package/dist/pptx-viewer.css +1 -1
  90. package/dist/pptx-viewer.css.br +0 -0
  91. package/dist/pptx-viewer.css.gz +0 -0
  92. package/dist/viewer/index.d.ts +54 -1
  93. package/dist/viewer/index.js +26 -26
  94. package/dist/viewer/index.js.br +0 -0
  95. package/dist/viewer/index.js.gz +0 -0
  96. package/dist/viewer/index.mjs +5 -5
  97. package/dist/viewer/index.mjs.br +0 -0
  98. package/dist/viewer/index.mjs.gz +0 -0
  99. package/package.json +3 -1
  100. package/dist/AiChatPanel-E53JJRZX.js.br +0 -0
  101. package/dist/AiChatPanel-E53JJRZX.js.gz +0 -0
  102. package/dist/AiChatPanel-JTXC5WWH.mjs.br +0 -0
  103. package/dist/AiChatPanel-JTXC5WWH.mjs.gz +0 -0
  104. package/dist/Area3DChartScene-J7G54OH4.js.br +0 -0
  105. package/dist/Area3DChartScene-J7G54OH4.js.gz +0 -0
  106. package/dist/Area3DChartScene-JQ2VU73H.mjs.br +0 -0
  107. package/dist/Area3DChartScene-JQ2VU73H.mjs.gz +0 -0
  108. package/dist/Bar3DChartScene-5HC7LYBH.mjs.br +0 -0
  109. package/dist/Bar3DChartScene-5HC7LYBH.mjs.gz +0 -0
  110. package/dist/Bar3DChartScene-JV3A2P6O.js.br +0 -0
  111. package/dist/Bar3DChartScene-JV3A2P6O.js.gz +0 -0
  112. package/dist/Line3DChartScene-4ZAOOU7U.mjs.br +0 -0
  113. package/dist/Line3DChartScene-4ZAOOU7U.mjs.gz +0 -0
  114. package/dist/Line3DChartScene-7SN7TVKQ.js.br +0 -0
  115. package/dist/Line3DChartScene-7SN7TVKQ.js.gz +0 -0
  116. package/dist/Model3DScene-GQANXXQD.js.br +0 -0
  117. package/dist/Model3DScene-GQANXXQD.js.gz +0 -0
  118. package/dist/Model3DScene-GWIBUQ2U.mjs.gz +0 -0
  119. package/dist/PieChart3DScene-QPFDRMEA.js.br +0 -0
  120. package/dist/PieChart3DScene-QPFDRMEA.js.gz +0 -0
  121. package/dist/PieChart3DScene-RDTOLFTD.mjs.br +0 -0
  122. package/dist/PieChart3DScene-RDTOLFTD.mjs.gz +0 -0
  123. package/dist/SurfaceChart3DScene-5JQCRWA5.mjs.br +0 -0
  124. package/dist/SurfaceChart3DScene-5JQCRWA5.mjs.gz +0 -0
  125. package/dist/SurfaceChart3DScene-JLYGC7QU.js.br +0 -0
  126. package/dist/SurfaceChart3DScene-JLYGC7QU.js.gz +0 -0
  127. package/dist/chunk-G2Z7QULX.js.br +0 -0
  128. package/dist/chunk-G2Z7QULX.js.gz +0 -0
  129. package/dist/chunk-H3GHGSGW.js.br +0 -0
  130. package/dist/chunk-H3GHGSGW.js.gz +0 -0
  131. package/dist/chunk-HB7DJENT.mjs.br +0 -0
  132. package/dist/chunk-HB7DJENT.mjs.gz +0 -0
  133. package/dist/chunk-IVCYND7A.js.br +0 -0
  134. package/dist/chunk-IVCYND7A.js.gz +0 -0
  135. package/dist/chunk-M7SNS3DQ.mjs.br +0 -0
  136. package/dist/chunk-M7SNS3DQ.mjs.gz +0 -0
  137. package/dist/chunk-PKHTTHA2.mjs.br +0 -0
  138. package/dist/chunk-PKHTTHA2.mjs.gz +0 -0
  139. package/dist/chunk-TS2DHMBS.mjs.br +0 -0
  140. package/dist/chunk-TS2DHMBS.mjs.gz +0 -0
  141. package/dist/chunk-TWUAZRCG.js.br +0 -0
  142. package/dist/chunk-TWUAZRCG.js.gz +0 -0
  143. package/dist/chunk-UGVPKJSU.js.br +0 -0
  144. package/dist/chunk-UGVPKJSU.js.gz +0 -0
  145. package/dist/chunk-Y3SA5H5H.mjs.br +0 -0
  146. package/dist/chunk-Y3SA5H5H.mjs.gz +0 -0
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkIVCYND7A_js = require('./chunk-IVCYND7A.js');
4
- var chunkTWUAZRCG_js = require('./chunk-TWUAZRCG.js');
3
+ var chunkGLY4OPMY_js = require('./chunk-GLY4OPMY.js');
4
+ var chunk5KAMDV37_js = require('./chunk-5KAMDV37.js');
5
5
  var chunk3AJ54EAB_js = require('./chunk-3AJ54EAB.js');
6
6
  var react = require('react');
7
7
  var reactI18next = require('react-i18next');
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
9
9
  function useVirtualizedSlides({
10
10
  totalItems,
11
11
  itemHeight,
12
- overscan = chunkTWUAZRCG_js.DEFAULT_VIRTUAL_OVERSCAN
12
+ overscan = chunk5KAMDV37_js.DEFAULT_VIRTUAL_OVERSCAN
13
13
  }) {
14
14
  const scrollContainerRef = react.useRef(null);
15
15
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -39,7 +39,7 @@ function useVirtualizedSlides({
39
39
  resizeObserver?.disconnect();
40
40
  };
41
41
  }, []);
42
- const range = chunkTWUAZRCG_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
42
+ const range = chunk5KAMDV37_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
43
43
  const safeItemHeight = Math.max(itemHeight, 1);
44
44
  const scrollToIndex = react.useCallback(
45
45
  (index, behavior = "smooth") => {
@@ -80,7 +80,7 @@ function usePresenceTracking({
80
80
  }) {
81
81
  const [remoteUsers, setRemoteUsers] = react.useState([]);
82
82
  const projectorRef = react.useRef(null);
83
- projectorRef.current ??= chunkTWUAZRCG_js.createPresenceProjector();
83
+ projectorRef.current ??= chunk5KAMDV37_js.createPresenceProjector();
84
84
  const projector = projectorRef.current;
85
85
  const lastBroadcastRef = react.useRef(0);
86
86
  const pendingBroadcastRef = react.useRef(null);
@@ -105,7 +105,7 @@ function usePresenceTracking({
105
105
  awareness.setLocalStateField("presence", state);
106
106
  lastBroadcastRef.current = Date.now();
107
107
  };
108
- if (elapsed >= chunkTWUAZRCG_js.BROADCAST_THROTTLE_MS) {
108
+ if (elapsed >= chunk5KAMDV37_js.BROADCAST_THROTTLE_MS) {
109
109
  if (pendingBroadcastRef.current) {
110
110
  clearTimeout(pendingBroadcastRef.current);
111
111
  pendingBroadcastRef.current = null;
@@ -115,7 +115,7 @@ function usePresenceTracking({
115
115
  pendingBroadcastRef.current = setTimeout(() => {
116
116
  pendingBroadcastRef.current = null;
117
117
  flush();
118
- }, chunkTWUAZRCG_js.BROADCAST_THROTTLE_MS - elapsed);
118
+ }, chunk5KAMDV37_js.BROADCAST_THROTTLE_MS - elapsed);
119
119
  }
120
120
  },
121
121
  [awareness, userName, userColor, userAvatar, role]
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
195
195
  const departureRef = react.useRef(null);
196
196
  const gateRef = react.useRef(null);
197
197
  if (!gateRef.current) {
198
- gateRef.current = chunkTWUAZRCG_js.createSyncGate(() => setSynced(true));
198
+ gateRef.current = chunk5KAMDV37_js.createSyncGate(() => setSynced(true));
199
199
  }
200
200
  const teardown = react.useCallback(() => {
201
201
  if (timeoutRef.current) {
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
215
215
  const buildCleanup = react.useCallback(
216
216
  (provider, yDoc) => () => {
217
217
  announceDeparture();
218
- chunkTWUAZRCG_js.clearLocalAwareness(provider.awareness);
218
+ chunk5KAMDV37_js.clearLocalAwareness(provider.awareness);
219
219
  provider.destroy();
220
220
  yDoc.destroy();
221
221
  setDoc(null);
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
240
240
  if (config.authToken) {
241
241
  opts.password = config.authToken;
242
242
  }
243
- const roomId = chunkTWUAZRCG_js.validateRoomId(config.roomId);
243
+ const roomId = chunk5KAMDV37_js.validateRoomId(config.roomId);
244
244
  const provider = new WebrtcProvider(roomId, yDoc, opts);
245
- departureRef.current = chunkTWUAZRCG_js.createDepartureChannel(roomId, provider.awareness);
245
+ departureRef.current = chunk5KAMDV37_js.createDepartureChannel(roomId, provider.awareness);
246
246
  setDoc(yDoc);
247
247
  setAwareness(provider.awareness);
248
248
  setClientId(provider.awareness.clientID);
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
284
284
  if (!config) {
285
285
  return;
286
286
  }
287
- const roomId = chunkTWUAZRCG_js.validateRoomId(config.roomId);
288
- const transport = config.transport ?? chunkTWUAZRCG_js.resolveTransportForServerUrl(config.serverUrl);
287
+ const roomId = chunk5KAMDV37_js.validateRoomId(config.roomId);
288
+ const transport = config.transport ?? chunk5KAMDV37_js.resolveTransportForServerUrl(config.serverUrl);
289
289
  if (transport === "webrtc") {
290
290
  await initWebrtc();
291
291
  return;
292
292
  }
293
- if (chunkTWUAZRCG_js.isMixedContentBlocked(config.serverUrl)) {
293
+ if (chunk5KAMDV37_js.isMixedContentBlocked(config.serverUrl)) {
294
294
  console.warn(
295
295
  `[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
296
296
  );
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
304
304
  const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
305
305
  params: config.authToken ? { token: config.authToken } : void 0
306
306
  });
307
- departureRef.current = chunkTWUAZRCG_js.createDepartureChannel(roomId, provider.awareness);
307
+ departureRef.current = chunk5KAMDV37_js.createDepartureChannel(roomId, provider.awareness);
308
308
  let connected = false;
309
309
  const handleStatus = (event) => {
310
310
  if (event.status === "connected") {
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
344
344
  provider.off("status", handleStatus);
345
345
  provider.off("sync", handleSynced);
346
346
  announceDeparture();
347
- chunkTWUAZRCG_js.clearLocalAwareness(provider.awareness);
347
+ chunk5KAMDV37_js.clearLocalAwareness(provider.awareness);
348
348
  provider.destroy();
349
349
  yDoc.destroy();
350
350
  setDoc(null);
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
353
353
  cleanupRef.current = null;
354
354
  setStatus("error");
355
355
  }
356
- }, chunkTWUAZRCG_js.CONNECTION_TIMEOUT_MS);
356
+ }, chunk5KAMDV37_js.CONNECTION_TIMEOUT_MS);
357
357
  }
358
358
  setDoc(yDoc);
359
359
  setAwareness(provider.awareness);
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
362
362
  provider.off("status", handleStatus);
363
363
  provider.off("sync", handleSynced);
364
364
  announceDeparture();
365
- chunkTWUAZRCG_js.clearLocalAwareness(provider.awareness);
365
+ chunk5KAMDV37_js.clearLocalAwareness(provider.awareness);
366
366
  provider.destroy();
367
367
  yDoc.destroy();
368
368
  setDoc(null);
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
388
388
  ]);
389
389
  react.useEffect(() => {
390
390
  init();
391
- const disposeTeardown = chunkTWUAZRCG_js.registerCollaborationTeardown({
391
+ const disposeTeardown = chunk5KAMDV37_js.registerCollaborationTeardown({
392
392
  leave: teardown,
393
393
  rejoin: init
394
394
  });
@@ -409,7 +409,7 @@ function useCollaborativeState({
409
409
  canvasWidth,
410
410
  canvasHeight
411
411
  }) {
412
- const userColor = chunkTWUAZRCG_js.sanitizeColor(config?.userColor, "#6366f1");
412
+ const userColor = chunk5KAMDV37_js.sanitizeColor(config?.userColor, "#6366f1");
413
413
  const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
414
414
  const { remoteUsers, broadcastPresence } = usePresenceTracking({
415
415
  awareness,
@@ -527,8 +527,8 @@ function useEditorHistory(input) {
527
527
  width: canvasSize.width,
528
528
  height: canvasSize.height,
529
529
  activeSlideIndex,
530
- slides: slides.map(chunkTWUAZRCG_js.cloneSlide),
531
- templateElementsBySlideId: chunkTWUAZRCG_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
530
+ slides: slides.map(chunk5KAMDV37_js.cloneSlide),
531
+ templateElementsBySlideId: chunk5KAMDV37_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
532
532
  ...actionLabel ? { actionLabel } : {}
533
533
  };
534
534
  },
@@ -541,9 +541,9 @@ function useEditorHistory(input) {
541
541
  width: snapshot.width,
542
542
  height: snapshot.height
543
543
  });
544
- setSlides(snapshot.slides.map(chunkTWUAZRCG_js.cloneSlide));
544
+ setSlides(snapshot.slides.map(chunk5KAMDV37_js.cloneSlide));
545
545
  setTemplateElementsBySlideId(
546
- chunkTWUAZRCG_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
546
+ chunk5KAMDV37_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
547
547
  );
548
548
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
549
549
  setSelectedElementIds([]);
@@ -582,8 +582,8 @@ function useEditorHistory(input) {
582
582
  const currentSnapshot = buildHistorySnapshot();
583
583
  historyFutureRef.current.push(currentSnapshot);
584
584
  isApplyingHistoryRef.current = true;
585
- const nextSnapshot = chunkIVCYND7A_js.cloneHistorySnapshot(previousSnapshot);
586
- lastHistorySnapshotRef.current = chunkIVCYND7A_js.cloneHistorySnapshot(nextSnapshot);
585
+ const nextSnapshot = chunkGLY4OPMY_js.cloneHistorySnapshot(previousSnapshot);
586
+ lastHistorySnapshotRef.current = chunkGLY4OPMY_js.cloneHistorySnapshot(nextSnapshot);
587
587
  lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
588
588
  applyHistorySnapshot(nextSnapshot);
589
589
  updateHistoryAvailability();
@@ -604,8 +604,8 @@ function useEditorHistory(input) {
604
604
  const currentSnapshot = buildHistorySnapshot();
605
605
  historyPastRef.current.push(currentSnapshot);
606
606
  isApplyingHistoryRef.current = true;
607
- const targetSnapshot = chunkIVCYND7A_js.cloneHistorySnapshot(nextSnapshot);
608
- lastHistorySnapshotRef.current = chunkIVCYND7A_js.cloneHistorySnapshot(targetSnapshot);
607
+ const targetSnapshot = chunkGLY4OPMY_js.cloneHistorySnapshot(nextSnapshot);
608
+ lastHistorySnapshotRef.current = chunkGLY4OPMY_js.cloneHistorySnapshot(targetSnapshot);
609
609
  lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
610
610
  applyHistorySnapshot(targetSnapshot);
611
611
  updateHistoryAvailability();
@@ -623,7 +623,7 @@ function useEditorHistory(input) {
623
623
  historyPastRef.current = [];
624
624
  historyFutureRef.current = [];
625
625
  if (initialSnapshot) {
626
- const clonedInitial = chunkIVCYND7A_js.cloneHistorySnapshot(initialSnapshot);
626
+ const clonedInitial = chunkGLY4OPMY_js.cloneHistorySnapshot(initialSnapshot);
627
627
  lastHistorySnapshotRef.current = clonedInitial;
628
628
  lastHistorySerializedRef.current = serializeDocument(clonedInitial);
629
629
  } else {
@@ -671,19 +671,19 @@ function useEditorHistory(input) {
671
671
  }
672
672
  const previousSnapshot = lastHistorySnapshotRef.current;
673
673
  if (!previousSnapshot) {
674
- lastHistorySnapshotRef.current = chunkIVCYND7A_js.cloneHistorySnapshot(snapshot);
674
+ lastHistorySnapshotRef.current = chunkGLY4OPMY_js.cloneHistorySnapshot(snapshot);
675
675
  lastHistorySerializedRef.current = serialized;
676
676
  lastCheapHashRef.current = cheapHash;
677
677
  updateHistoryAvailability();
678
678
  return;
679
679
  }
680
680
  onDirtyRef.current?.();
681
- historyPastRef.current.push(chunkIVCYND7A_js.cloneHistorySnapshot(previousSnapshot));
681
+ historyPastRef.current.push(chunkGLY4OPMY_js.cloneHistorySnapshot(previousSnapshot));
682
682
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
683
683
  historyPastRef.current.shift();
684
684
  }
685
685
  historyFutureRef.current = [];
686
- lastHistorySnapshotRef.current = chunkIVCYND7A_js.cloneHistorySnapshot(snapshot);
686
+ lastHistorySnapshotRef.current = chunkGLY4OPMY_js.cloneHistorySnapshot(snapshot);
687
687
  lastHistorySerializedRef.current = serialized;
688
688
  lastCheapHashRef.current = cheapHash;
689
689
  updateHistoryAvailability();
@@ -743,9 +743,9 @@ function useZoomViewport({
743
743
  const canvasStageRef = react.useRef(null);
744
744
  const canvasViewportRef = react.useRef(null);
745
745
  const renderScaleRef = react.useRef(1);
746
- const wheelBufferRef = react.useRef(chunkTWUAZRCG_js.createWheelStepBuffer());
746
+ const wheelBufferRef = react.useRef(chunk5KAMDV37_js.createWheelStepBuffer());
747
747
  const storeRef = react.useRef(null);
748
- storeRef.current ??= chunkTWUAZRCG_js.createViewerZoomStore();
748
+ storeRef.current ??= chunk5KAMDV37_js.createViewerZoomStore();
749
749
  const store = storeRef.current;
750
750
  const scale = useViewerStore(store, selectZoom);
751
751
  const setScale = react.useCallback(
@@ -806,7 +806,7 @@ function useZoomViewport({
806
806
  if (!wrapper || !canvasViewport) {
807
807
  return;
808
808
  }
809
- const boundedScale = chunkTWUAZRCG_js.clampZoomScale(nextScale);
809
+ const boundedScale = chunk5KAMDV37_js.clampZoomScale(nextScale);
810
810
  const nextEditorScale = fitScale * boundedScale;
811
811
  const centerX = (bounds.minX + bounds.maxX) / 2;
812
812
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -843,29 +843,29 @@ function useZoomViewport({
843
843
  selectedElements.forEach((element) => {
844
844
  minX = Math.min(minX, element.x);
845
845
  minY = Math.min(minY, element.y);
846
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunkIVCYND7A_js.MIN_ELEMENT_SIZE));
847
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunkIVCYND7A_js.MIN_ELEMENT_SIZE));
846
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE));
847
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE));
848
848
  });
849
849
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
850
850
  return;
851
851
  }
852
852
  const selectionBounds = { minX, minY, maxX, maxY };
853
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
854
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
853
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
854
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
855
855
  const availableWidth = Math.max(
856
- effectiveEditorDimensions.width - chunkIVCYND7A_js.ZOOM_TO_SELECTION_PADDING,
857
- chunkIVCYND7A_js.MIN_ELEMENT_SIZE
856
+ effectiveEditorDimensions.width - chunkGLY4OPMY_js.ZOOM_TO_SELECTION_PADDING,
857
+ chunkGLY4OPMY_js.MIN_ELEMENT_SIZE
858
858
  );
859
859
  const availableHeight = Math.max(
860
- effectiveEditorDimensions.height - chunkIVCYND7A_js.ZOOM_TO_SELECTION_PADDING,
861
- chunkIVCYND7A_js.MIN_ELEMENT_SIZE
860
+ effectiveEditorDimensions.height - chunkGLY4OPMY_js.ZOOM_TO_SELECTION_PADDING,
861
+ chunkGLY4OPMY_js.MIN_ELEMENT_SIZE
862
862
  );
863
863
  const targetEditorScale = Math.min(
864
864
  availableWidth / boundsWidth,
865
865
  availableHeight / boundsHeight
866
866
  );
867
867
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
868
- const nextScale = chunkTWUAZRCG_js.clampZoomScale(targetEditorScale / safeFitScale);
868
+ const nextScale = chunk5KAMDV37_js.clampZoomScale(targetEditorScale / safeFitScale);
869
869
  setScale(nextScale);
870
870
  window.requestAnimationFrame(() => {
871
871
  window.requestAnimationFrame(() => {
@@ -882,14 +882,14 @@ function useZoomViewport({
882
882
  ]);
883
883
  const handleWheel = react.useCallback(
884
884
  (event) => {
885
- const mapped = chunkTWUAZRCG_js.mapEditingWheel(event, wheelBufferRef.current, true);
885
+ const mapped = chunk5KAMDV37_js.mapEditingWheel(event, wheelBufferRef.current, true);
886
886
  if (mapped.intent !== "zoom") {
887
887
  return;
888
888
  }
889
889
  event.preventDefault();
890
890
  store.dispatch({
891
891
  type: "set-zoom",
892
- zoom: chunkTWUAZRCG_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
892
+ zoom: chunk5KAMDV37_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
893
893
  });
894
894
  },
895
895
  [store]
@@ -984,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
984
984
  if (!group) {
985
985
  return;
986
986
  }
987
- chunkTWUAZRCG_js.playGroup(controller, group, ctx);
988
- chunkTWUAZRCG_js.scheduleAutoAdvanceChain(controller, ctx);
987
+ chunk5KAMDV37_js.playGroup(controller, group, ctx);
988
+ chunk5KAMDV37_js.scheduleAutoAdvanceChain(controller, ctx);
989
989
  }, firstGroup.autoAdvanceDelayMs ?? 0);
990
990
  ctx.timers.push(timer);
991
991
  }
@@ -1004,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1004
1004
  }))
1005
1005
  );
1006
1006
  entranceAnimations.forEach((animation, animationIndex) => {
1007
- const delay = chunkTWUAZRCG_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1007
+ const delay = chunk5KAMDV37_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1008
1008
  const timer = window.setTimeout(() => {
1009
1009
  setPresentationAnimations(
1010
1010
  (previousAnimations) => previousAnimations.map(
@@ -1037,7 +1037,7 @@ function useAnimationPlayback(input) {
1037
1037
  const presentationTimersRef = react.useRef([]);
1038
1038
  const controllerRef = react.useRef(null);
1039
1039
  const buildRafRef = react.useRef(null);
1040
- const activeAnimationGroupRef = react.useRef(chunkTWUAZRCG_js.createActiveAnimationGroup());
1040
+ const activeAnimationGroupRef = react.useRef(chunk5KAMDV37_js.createActiveAnimationGroup());
1041
1041
  const seededCompletedRef = react.useRef(false);
1042
1042
  const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
1043
1043
  const lastSeedCompletedRef = react.useRef(false);
@@ -1054,15 +1054,15 @@ function useAnimationPlayback(input) {
1054
1054
  }, [onPlayActionSound]);
1055
1055
  react.useEffect(() => {
1056
1056
  return () => {
1057
- chunkTWUAZRCG_js.cancelBuildReveal(buildRafRef);
1057
+ chunk5KAMDV37_js.cancelBuildReveal(buildRafRef);
1058
1058
  };
1059
1059
  }, []);
1060
1060
  const clearPresentationTimers = react.useCallback(() => {
1061
- chunkTWUAZRCG_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
1061
+ chunk5KAMDV37_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
1062
1062
  }, [buildPlaybackContext]);
1063
1063
  const resetSlideTimeline = react.useCallback(
1064
1064
  (slideIndex) => {
1065
- chunkTWUAZRCG_js.cancelBuildReveal(buildRafRef);
1065
+ chunk5KAMDV37_js.cancelBuildReveal(buildRafRef);
1066
1066
  const slide = slides[slideIndex];
1067
1067
  if (!slide) {
1068
1068
  controllerRef.current = null;
@@ -1073,14 +1073,14 @@ function useAnimationPlayback(input) {
1073
1073
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1074
1074
  return;
1075
1075
  }
1076
- const controller = chunkTWUAZRCG_js.PresentationAnimationController.fromSlide(slide, {
1076
+ const controller = chunk5KAMDV37_js.PresentationAnimationController.fromSlide(slide, {
1077
1077
  slideHeightPx: canvasSize?.height,
1078
1078
  slideWidthPx: canvasSize?.width,
1079
1079
  themeColorMap,
1080
1080
  pixelateMosaic: pixelateMosaicAnimation
1081
1081
  });
1082
1082
  controllerRef.current = controller;
1083
- mediaTimeNodeElementIdsRef.current = chunkTWUAZRCG_js.resolveMediaTimeNodeElementIds(
1083
+ mediaTimeNodeElementIdsRef.current = chunk5KAMDV37_js.resolveMediaTimeNodeElementIds(
1084
1084
  slide.nativeAnimations ?? []
1085
1085
  );
1086
1086
  setPresentationKeyframesCss(controller.keyframesCss);
@@ -1094,7 +1094,7 @@ function useAnimationPlayback(input) {
1094
1094
  if (!animationsEnabled) {
1095
1095
  return false;
1096
1096
  }
1097
- return chunkTWUAZRCG_js.advanceMainSequence(
1097
+ return chunk5KAMDV37_js.advanceMainSequence(
1098
1098
  controllerRef.current,
1099
1099
  buildPlaybackContext(),
1100
1100
  activeAnimationGroupRef.current
@@ -1110,7 +1110,7 @@ function useAnimationPlayback(input) {
1110
1110
  if (!group) {
1111
1111
  return false;
1112
1112
  }
1113
- chunkTWUAZRCG_js.playGroup(controller, group, buildPlaybackContext());
1113
+ chunk5KAMDV37_js.playGroup(controller, group, buildPlaybackContext());
1114
1114
  return true;
1115
1115
  },
1116
1116
  [buildPlaybackContext]
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
1129
1129
  if (!group) {
1130
1130
  return false;
1131
1131
  }
1132
- chunkTWUAZRCG_js.playGroup(controller, group, buildPlaybackContext());
1132
+ chunk5KAMDV37_js.playGroup(controller, group, buildPlaybackContext());
1133
1133
  return true;
1134
1134
  },
1135
1135
  [animationsEnabled, buildPlaybackContext]
@@ -1210,12 +1210,12 @@ function useAnimationPlayback(input) {
1210
1210
  presentationTimersRef
1211
1211
  };
1212
1212
  }
1213
- var PRESENTER_CHANNEL_NAME = chunkTWUAZRCG_js.PRESENTATION_CHANNEL_NAME;
1214
- var AUDIENCE_HASH = chunkTWUAZRCG_js.PRESENTATION_HASH;
1215
- var PRESENTER_MSG_ORIGIN = chunkTWUAZRCG_js.PRESENTATION_MESSAGE_ORIGIN;
1216
- var AUDIENCE_NONCE_KEY = chunkTWUAZRCG_js.PRESENTATION_NONCE_KEY;
1213
+ var PRESENTER_CHANNEL_NAME = chunk5KAMDV37_js.PRESENTATION_CHANNEL_NAME;
1214
+ var AUDIENCE_HASH = chunk5KAMDV37_js.PRESENTATION_HASH;
1215
+ var PRESENTER_MSG_ORIGIN = chunk5KAMDV37_js.PRESENTATION_MESSAGE_ORIGIN;
1216
+ var AUDIENCE_NONCE_KEY = chunk5KAMDV37_js.PRESENTATION_NONCE_KEY;
1217
1217
  function generateSessionId() {
1218
- return chunkTWUAZRCG_js.createPresentationSessionId();
1218
+ return chunk5KAMDV37_js.createPresentationSessionId();
1219
1219
  }
1220
1220
  function parseAudienceNonce() {
1221
1221
  const hash = window.location.hash;
@@ -1251,7 +1251,7 @@ function usePresenterWindow(input) {
1251
1251
  }, []);
1252
1252
  const swapDisplays = react.useCallback(async () => {
1253
1253
  const audience = audienceWindowRef.current;
1254
- return audience && !audience.closed ? chunkTWUAZRCG_js.swapPresentationWindows(window, audience) : false;
1254
+ return audience && !audience.closed ? chunk5KAMDV37_js.swapPresentationWindows(window, audience) : false;
1255
1255
  }, []);
1256
1256
  const syncSlideToAudience = react.useCallback(
1257
1257
  (slideIndex) => {
@@ -1315,7 +1315,7 @@ function usePresenterWindow(input) {
1315
1315
  pollTimerRef.current = null;
1316
1316
  }
1317
1317
  if (closingSessionId) {
1318
- void chunkTWUAZRCG_js.clearAudienceContent(closingSessionId);
1318
+ void chunk5KAMDV37_js.clearAudienceContent(closingSessionId);
1319
1319
  }
1320
1320
  }, [getChannel]);
1321
1321
  const openAudienceWindow = react.useCallback(() => {
@@ -1333,10 +1333,10 @@ function usePresenterWindow(input) {
1333
1333
  audienceWindowRef.current = blankWin;
1334
1334
  const sessionId = generateSessionId();
1335
1335
  sessionIdRef.current = sessionId;
1336
- const audienceUrl = chunkTWUAZRCG_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1337
- void chunkTWUAZRCG_js.resolveAudienceScreenPlacement(window).then((placement) => {
1336
+ const audienceUrl = chunk5KAMDV37_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1337
+ void chunk5KAMDV37_js.resolveAudienceScreenPlacement(window).then((placement) => {
1338
1338
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1339
- chunkTWUAZRCG_js.placeAudienceWindow(blankWin, placement);
1339
+ chunk5KAMDV37_js.placeAudienceWindow(blankWin, placement);
1340
1340
  }
1341
1341
  return void 0;
1342
1342
  });
@@ -1366,7 +1366,7 @@ function usePresenterWindow(input) {
1366
1366
  }
1367
1367
  };
1368
1368
  if (content) {
1369
- void chunkTWUAZRCG_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1369
+ void chunk5KAMDV37_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1370
1370
  } else {
1371
1371
  navigateOrClose(true);
1372
1372
  }
@@ -1392,7 +1392,7 @@ function usePresenterWindow(input) {
1392
1392
  }
1393
1393
  const handleMessage = (event) => {
1394
1394
  const message = event.data;
1395
- if (chunkTWUAZRCG_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1395
+ if (chunk5KAMDV37_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1396
1396
  syncStateToAudience(snapshotRef.current);
1397
1397
  }
1398
1398
  };
@@ -1421,7 +1421,7 @@ function usePresenterWindow(input) {
1421
1421
  react.useEffect(() => {
1422
1422
  const handleBeforeUnload = () => {
1423
1423
  if (sessionIdRef.current) {
1424
- void chunkTWUAZRCG_js.clearAudienceContent(sessionIdRef.current);
1424
+ void chunk5KAMDV37_js.clearAudienceContent(sessionIdRef.current);
1425
1425
  }
1426
1426
  };
1427
1427
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1483,7 +1483,7 @@ function useAudienceMode(input) {
1483
1483
  }
1484
1484
  channel.onmessage = (event) => {
1485
1485
  const data = event.data;
1486
- if (!chunkTWUAZRCG_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1486
+ if (!chunk5KAMDV37_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1487
1487
  return;
1488
1488
  }
1489
1489
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1499,16 +1499,16 @@ function useAudienceMode(input) {
1499
1499
  }
1500
1500
  if (data.type === "presenter-exit") {
1501
1501
  if (expectedSessionId) {
1502
- void chunkTWUAZRCG_js.clearAudienceContent(expectedSessionId);
1502
+ void chunk5KAMDV37_js.clearAudienceContent(expectedSessionId);
1503
1503
  }
1504
- if (chunkTWUAZRCG_js.endAudienceDisplay(window)) {
1504
+ if (chunk5KAMDV37_js.endAudienceDisplay(window)) {
1505
1505
  handlers.onPresenterEnded?.();
1506
1506
  }
1507
1507
  }
1508
1508
  };
1509
1509
  if (expectedSessionId) {
1510
1510
  channel.postMessage({
1511
- origin: chunkTWUAZRCG_js.PRESENTATION_MESSAGE_ORIGIN,
1511
+ origin: chunk5KAMDV37_js.PRESENTATION_MESSAGE_ORIGIN,
1512
1512
  type: "audience-ready",
1513
1513
  sessionId: expectedSessionId
1514
1514
  });
@@ -1522,7 +1522,7 @@ function useAudienceMode(input) {
1522
1522
  }, []);
1523
1523
  }
1524
1524
  function usePresentationKeyboard(input) {
1525
- const wheelBufferRef = react.useRef(chunkTWUAZRCG_js.createWheelStepBuffer());
1525
+ const wheelBufferRef = react.useRef(chunk5KAMDV37_js.createWheelStepBuffer());
1526
1526
  const {
1527
1527
  mode,
1528
1528
  movePresentationSlide,
@@ -1543,14 +1543,14 @@ function usePresentationKeyboard(input) {
1543
1543
  presentationSlideIndex,
1544
1544
  setShowRehearsalSummary
1545
1545
  } = input;
1546
- const keyBufferRef = react.useRef(chunkTWUAZRCG_js.createPresentationKeyBuffer());
1546
+ const keyBufferRef = react.useRef(chunk5KAMDV37_js.createPresentationKeyBuffer());
1547
1547
  react.useEffect(() => {
1548
- if (mode !== "present" || !chunkTWUAZRCG_js.acceptsPresentationInput()) {
1549
- keyBufferRef.current = chunkTWUAZRCG_js.createPresentationKeyBuffer();
1548
+ if (mode !== "present" || !chunk5KAMDV37_js.acceptsPresentationInput()) {
1549
+ keyBufferRef.current = chunk5KAMDV37_js.createPresentationKeyBuffer();
1550
1550
  return;
1551
1551
  }
1552
1552
  const handleKeyDown = (event) => {
1553
- const mapped = chunkTWUAZRCG_js.mapPresentationKey(event, keyBufferRef.current);
1553
+ const mapped = chunk5KAMDV37_js.mapPresentationKey(event, keyBufferRef.current);
1554
1554
  if (mapped.action === "none") {
1555
1555
  return;
1556
1556
  }
@@ -1570,12 +1570,12 @@ function usePresentationKeyboard(input) {
1570
1570
  movePresentationSlide(-1);
1571
1571
  return;
1572
1572
  case "first": {
1573
- const first = chunkTWUAZRCG_js.firstShowSlideIndex(showSlideIndexes);
1573
+ const first = chunk5KAMDV37_js.firstShowSlideIndex(showSlideIndexes);
1574
1574
  navigateToSlide(first ?? 0);
1575
1575
  return;
1576
1576
  }
1577
1577
  case "last": {
1578
- const last = chunkTWUAZRCG_js.lastShowSlideIndex(showSlideIndexes);
1578
+ const last = chunk5KAMDV37_js.lastShowSlideIndex(showSlideIndexes);
1579
1579
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1580
1580
  return;
1581
1581
  }
@@ -1613,10 +1613,10 @@ function usePresentationKeyboard(input) {
1613
1613
  }
1614
1614
  };
1615
1615
  const handleWheel = (event) => {
1616
- if (mode !== "present" || !chunkTWUAZRCG_js.acceptsPresentationInput()) {
1616
+ if (mode !== "present" || !chunk5KAMDV37_js.acceptsPresentationInput()) {
1617
1617
  return;
1618
1618
  }
1619
- const mapped = chunkTWUAZRCG_js.mapPresentationWheel(event, wheelBufferRef.current);
1619
+ const mapped = chunk5KAMDV37_js.mapPresentationWheel(event, wheelBufferRef.current);
1620
1620
  if (mapped.intent === "next-slide") {
1621
1621
  event.preventDefault();
1622
1622
  movePresentationSlide(1);
@@ -1749,7 +1749,7 @@ function useRehearsalTimings(input) {
1749
1749
 
1750
1750
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1751
1751
  function handlePresentationActionImpl(action, deps) {
1752
- chunkTWUAZRCG_js.runPresentationAction(
1752
+ chunk5KAMDV37_js.runPresentationAction(
1753
1753
  action,
1754
1754
  { slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
1755
1755
  {
@@ -1778,13 +1778,13 @@ function handlePresentationActionImpl(action, deps) {
1778
1778
  function executeSlideTransition(nextSlideIndex, deps) {
1779
1779
  const incomingSlide = deps.slides[nextSlideIndex];
1780
1780
  const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
1781
- const durationMs = deps.playTransition ? chunkTWUAZRCG_js.resolveTransitionDurationMs(transition) : 0;
1781
+ const durationMs = deps.playTransition ? chunk5KAMDV37_js.resolveTransitionDurationMs(transition) : 0;
1782
1782
  deps.clearPresentationTimers();
1783
1783
  deps.setPresentationSlideIndex(nextSlideIndex);
1784
1784
  deps.onSetActiveSlideIndex(nextSlideIndex);
1785
1785
  deps.setPresentationSlideVisible(true);
1786
1786
  deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
1787
- const soundAction = chunkTWUAZRCG_js.resolveTransitionSoundAction(transition);
1787
+ const soundAction = chunk5KAMDV37_js.resolveTransitionSoundAction(transition);
1788
1788
  if (soundAction.kind === "play" && deps.onPlayActionSound) {
1789
1789
  deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
1790
1790
  } else if (soundAction.kind === "stop" && deps.onStopActionSound) {
@@ -1848,7 +1848,7 @@ function useSlideNavigation(input) {
1848
1848
  });
1849
1849
  const scheduleAutoAdvanceForSlide = react.useCallback(
1850
1850
  (slideIndex) => {
1851
- const delayMs = chunkTWUAZRCG_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1851
+ const delayMs = chunk5KAMDV37_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1852
1852
  if (delayMs === void 0) {
1853
1853
  return;
1854
1854
  }
@@ -1871,7 +1871,7 @@ function useSlideNavigation(input) {
1871
1871
  if (availableSlideIndexes.length === 0) {
1872
1872
  return;
1873
1873
  }
1874
- const pastLastSlide = direction === 1 && !chunkTWUAZRCG_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1874
+ const pastLastSlide = direction === 1 && !chunk5KAMDV37_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1875
1875
  if (rehearsing && pastLastSlide) {
1876
1876
  recordCurrentSlideTime(presentationSlideIndex);
1877
1877
  try {
@@ -1889,9 +1889,9 @@ function useSlideNavigation(input) {
1889
1889
  onAdvancePastLastSlide();
1890
1890
  return;
1891
1891
  }
1892
- const nextSlideIndex = direction === 1 ? chunkTWUAZRCG_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
1892
+ const nextSlideIndex = direction === 1 ? chunk5KAMDV37_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
1893
1893
  loop: Boolean(loopContinuously) && !rehearsing
1894
- }) : chunkTWUAZRCG_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
1894
+ }) : chunk5KAMDV37_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
1895
1895
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
1896
1896
  return;
1897
1897
  }
@@ -2072,7 +2072,7 @@ function createCustomShowRunner(deps) {
2072
2072
  return;
2073
2073
  }
2074
2074
  origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
2075
- const first = chunkTWUAZRCG_js.firstShowSlideIndex(chunkTWUAZRCG_js.resolveShowSlideIndexes(deps.getSlides(), target));
2075
+ const first = chunk5KAMDV37_js.firstShowSlideIndex(chunk5KAMDV37_js.resolveShowSlideIndexes(deps.getSlides(), target));
2076
2076
  deps.setActiveCustomShowId(customShowId);
2077
2077
  if (first !== void 0) {
2078
2078
  deps.navigateToSlide(first);
@@ -2150,33 +2150,33 @@ function usePresentationActionExtensions(input) {
2150
2150
  }
2151
2151
  }, [navigateToSlideViaRef]);
2152
2152
  const onOpenFile = react.useCallback((target) => {
2153
- chunkTWUAZRCG_js.safeOpenUrl(target);
2153
+ chunk5KAMDV37_js.safeOpenUrl(target);
2154
2154
  }, []);
2155
2155
  const onOpenPresentation = react.useCallback((target) => {
2156
- chunkTWUAZRCG_js.safeOpenUrl(target);
2156
+ chunk5KAMDV37_js.safeOpenUrl(target);
2157
2157
  }, []);
2158
2158
  const onRunProgram = react.useCallback(
2159
2159
  (target) => {
2160
- onAddRunProgramNotice?.(chunkTWUAZRCG_js.buildRunProgramNotice(target));
2160
+ onAddRunProgramNotice?.(chunk5KAMDV37_js.buildRunProgramNotice(target));
2161
2161
  },
2162
2162
  [onAddRunProgramNotice]
2163
2163
  );
2164
2164
  const onPlayMedia = react.useCallback(
2165
2165
  (elementId) => {
2166
- chunkTWUAZRCG_js.toggleStageElementMedia(containerRef.current, elementId);
2166
+ chunk5KAMDV37_js.toggleStageElementMedia(containerRef.current, elementId);
2167
2167
  },
2168
2168
  [containerRef]
2169
2169
  );
2170
2170
  const onOleVerb = react.useCallback(
2171
2171
  (verb, elementId) => {
2172
- const target = chunkTWUAZRCG_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
2172
+ const target = chunk5KAMDV37_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
2173
2173
  if (!target) {
2174
2174
  return;
2175
2175
  }
2176
2176
  if (target.action === "download") {
2177
- chunkTWUAZRCG_js.downloadDataUrl(target.url, target.fileName ?? "download");
2177
+ chunk5KAMDV37_js.downloadDataUrl(target.url, target.fileName ?? "download");
2178
2178
  } else {
2179
- chunkTWUAZRCG_js.openUrlInNewTab(target.url);
2179
+ chunk5KAMDV37_js.openUrlInNewTab(target.url);
2180
2180
  }
2181
2181
  },
2182
2182
  [slides, presentationSlideIndex]
@@ -2207,22 +2207,22 @@ function usePresentationActionExtensions(input) {
2207
2207
  };
2208
2208
  }
2209
2209
  function usePresenterConsole(slideIndex, active) {
2210
- const timerRef = react.useRef(chunkTWUAZRCG_js.createPresenterTimer());
2211
- const [snapshot, setSnapshot] = react.useState(() => chunkTWUAZRCG_js.createInitialPresentationSnapshot(slideIndex));
2210
+ const timerRef = react.useRef(chunk5KAMDV37_js.createPresenterTimer());
2211
+ const [snapshot, setSnapshot] = react.useState(() => chunk5KAMDV37_js.createInitialPresentationSnapshot(slideIndex));
2212
2212
  const patch = react.useCallback((value) => {
2213
- setSnapshot((current) => chunkTWUAZRCG_js.mergePresentationSnapshot(current, value));
2213
+ setSnapshot((current) => chunk5KAMDV37_js.mergePresentationSnapshot(current, value));
2214
2214
  }, []);
2215
2215
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2216
2216
  react.useEffect(() => {
2217
2217
  if (!active) {
2218
2218
  return;
2219
2219
  }
2220
- timerRef.current = chunkTWUAZRCG_js.resetPresenterTimer();
2220
+ timerRef.current = chunk5KAMDV37_js.resetPresenterTimer();
2221
2221
  patch({ paused: false, elapsedMs: 0 });
2222
2222
  const timer = window.setInterval(() => {
2223
2223
  patch({
2224
2224
  paused: timerRef.current.paused,
2225
- elapsedMs: chunkTWUAZRCG_js.presenterElapsed(timerRef.current)
2225
+ elapsedMs: chunk5KAMDV37_js.presenterElapsed(timerRef.current)
2226
2226
  });
2227
2227
  }, 1e3);
2228
2228
  return () => window.clearInterval(timer);
@@ -2232,19 +2232,19 @@ function usePresenterConsole(slideIndex, active) {
2232
2232
  applyAudienceSnapshot: setSnapshot,
2233
2233
  setBlackout: (blackout) => patch({ blackout }),
2234
2234
  toggleTimer: () => {
2235
- timerRef.current = chunkTWUAZRCG_js.togglePresenterTimer(timerRef.current);
2235
+ timerRef.current = chunk5KAMDV37_js.togglePresenterTimer(timerRef.current);
2236
2236
  patch({
2237
2237
  paused: timerRef.current.paused,
2238
- elapsedMs: chunkTWUAZRCG_js.presenterElapsed(timerRef.current)
2238
+ elapsedMs: chunk5KAMDV37_js.presenterElapsed(timerRef.current)
2239
2239
  });
2240
2240
  },
2241
2241
  resetTimer: () => {
2242
- timerRef.current = chunkTWUAZRCG_js.resetPresenterTimer();
2242
+ timerRef.current = chunk5KAMDV37_js.resetPresenterTimer();
2243
2243
  patch({ paused: false, elapsedMs: 0 });
2244
2244
  },
2245
2245
  stepZoom: (direction) => setSnapshot(
2246
- (current) => chunkTWUAZRCG_js.mergePresentationSnapshot(current, {
2247
- zoom: chunkTWUAZRCG_js.stepPresenterZoom(
2246
+ (current) => chunk5KAMDV37_js.mergePresentationSnapshot(current, {
2247
+ zoom: chunk5KAMDV37_js.stepPresenterZoom(
2248
2248
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2249
2249
  direction
2250
2250
  )
@@ -2299,7 +2299,7 @@ function usePresentationMode(input) {
2299
2299
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2300
2300
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2301
2301
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2302
- const showGuard = react.useMemo(() => chunkTWUAZRCG_js.createPresenterShowGuard(), []);
2302
+ const showGuard = react.useMemo(() => chunk5KAMDV37_js.createPresenterShowGuard(), []);
2303
2303
  const {
2304
2304
  presentationAnimations,
2305
2305
  presentationElementStates,
@@ -2399,7 +2399,7 @@ function usePresentationMode(input) {
2399
2399
  actionExtensions.bindNavigateToSlide(navigateToSlide);
2400
2400
  const movePresentationSlide = react.useCallback(
2401
2401
  (direction, trigger = "explicit") => {
2402
- if (!chunkTWUAZRCG_js.acceptsPresentationInput()) {
2402
+ if (!chunk5KAMDV37_js.acceptsPresentationInput()) {
2403
2403
  return;
2404
2404
  }
2405
2405
  if (endOfShowVisible) {
@@ -2468,7 +2468,7 @@ function usePresentationMode(input) {
2468
2468
  onSetMode("present");
2469
2469
  }, [containerRef, onSetMode, setRehearsing]);
2470
2470
  const enterPresentModeFromBeginning = react.useCallback(() => {
2471
- const first = chunkTWUAZRCG_js.firstShowSlideIndex(visibleSlideIndexes);
2471
+ const first = chunk5KAMDV37_js.firstShowSlideIndex(visibleSlideIndexes);
2472
2472
  if (first !== void 0) {
2473
2473
  onSetActiveSlideIndex(first);
2474
2474
  }
@@ -2548,7 +2548,7 @@ function usePresentationMode(input) {
2548
2548
  if (mode !== "present") {
2549
2549
  return;
2550
2550
  }
2551
- return chunkTWUAZRCG_js.attachPresentationVisibilityPause({
2551
+ return chunk5KAMDV37_js.attachPresentationVisibilityPause({
2552
2552
  root: containerRef.current ?? void 0,
2553
2553
  onHidden: () => clearPresentationTimersRef.current(),
2554
2554
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
2556
2556
  }, [mode, containerRef]);
2557
2557
  react.useLayoutEffect(() => {
2558
2558
  if (mode === "present") {
2559
- const idx = chunkTWUAZRCG_js.presentationEntrySlideIndex(
2559
+ const idx = chunk5KAMDV37_js.presentationEntrySlideIndex(
2560
2560
  activeSlideIndexRef.current,
2561
2561
  visibleSlideIndexesRef.current
2562
2562
  );
@@ -2635,11 +2635,11 @@ function usePresentationMode(input) {
2635
2635
  return void 0;
2636
2636
  }
2637
2637
  const incoming = slides[transitionOverlay.incomingSlideIndex];
2638
- return chunkTWUAZRCG_js.buildMorphTransitionPlan(
2638
+ return chunk5KAMDV37_js.buildMorphTransitionPlan(
2639
2639
  slides[transitionOverlay.outgoingSlideIndex],
2640
2640
  incoming,
2641
2641
  transitionOverlay.durationMs,
2642
- chunkTWUAZRCG_js.morphOptionToMode(transitionOverlay.transition.morphOption),
2642
+ chunk5KAMDV37_js.morphOptionToMode(transitionOverlay.transition.morphOption),
2643
2643
  // `PresentationStage` stacks the incoming slide's elements above its
2644
2644
  // template shapes (`zIndex = templateElements.length + index`), so a
2645
2645
  // z-index journey has to start counting where the stage does.
@@ -2664,7 +2664,7 @@ function usePresentationMode(input) {
2664
2664
  if (!morphPlan) {
2665
2665
  return presentationKeyframesCss;
2666
2666
  }
2667
- const imageRules = chunkTWUAZRCG_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2667
+ const imageRules = chunk5KAMDV37_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2668
2668
  return `${presentationKeyframesCss ?? ""}
2669
2669
  ${morphPlan.keyframesCss}
2670
2670
  ${imageRules}`;
@@ -2961,7 +2961,7 @@ function useFindReplace({
2961
2961
  const [findResults, setFindResults] = react.useState([]);
2962
2962
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2963
2963
  const performFind = react.useCallback(() => {
2964
- const results = chunkTWUAZRCG_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2964
+ const results = chunk5KAMDV37_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2965
2965
  if (!findQuery) {
2966
2966
  setFindResults([]);
2967
2967
  setFindResultIndex(-1);
@@ -2995,7 +2995,7 @@ function useFindReplace({
2995
2995
  return;
2996
2996
  }
2997
2997
  onUpdateSlides(
2998
- (prevSlides) => chunkTWUAZRCG_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2998
+ (prevSlides) => chunk5KAMDV37_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2999
2999
  );
3000
3000
  onMarkDirty();
3001
3001
  },
@@ -3017,9 +3017,9 @@ function useFindReplace({
3017
3017
  }, [findResults, applyReplacements, performFind]);
3018
3018
  react.useEffect(() => {
3019
3019
  const handler = (event) => {
3020
- const { action } = chunkTWUAZRCG_js.mapEditorKey(event, {
3020
+ const { action } = chunk5KAMDV37_js.mapEditorKey(event, {
3021
3021
  canEdit: mode === "edit",
3022
- isTextInputTarget: chunkTWUAZRCG_js.isEditorTextInputTarget(event.target)
3022
+ isTextInputTarget: chunk5KAMDV37_js.isEditorTextInputTarget(event.target)
3023
3023
  });
3024
3024
  if (action !== "find") {
3025
3025
  return;
@@ -3130,7 +3130,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
3130
3130
  if (!slide) {
3131
3131
  return { slides, didAdd: false };
3132
3132
  }
3133
- const next = chunkTWUAZRCG_js.addCommentToList(
3133
+ const next = chunk5KAMDV37_js.addCommentToList(
3134
3134
  slide.comments || [],
3135
3135
  text,
3136
3136
  authorName,
@@ -3151,7 +3151,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
3151
3151
  if (!slide) {
3152
3152
  return { slides, didDelete: false };
3153
3153
  }
3154
- const next = chunkTWUAZRCG_js.removeCommentFromList(slide.comments || [], commentId);
3154
+ const next = chunk5KAMDV37_js.removeCommentFromList(slide.comments || [], commentId);
3155
3155
  if (!next) {
3156
3156
  return { slides, didDelete: false };
3157
3157
  }
@@ -3162,7 +3162,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
3162
3162
  if (!slide) {
3163
3163
  return { slides, didUpdate: false };
3164
3164
  }
3165
- const next = chunkTWUAZRCG_js.editCommentInList(slide.comments || [], commentId, newText);
3165
+ const next = chunk5KAMDV37_js.editCommentInList(slide.comments || [], commentId, newText);
3166
3166
  if (!next) {
3167
3167
  return { slides, didUpdate: false };
3168
3168
  }
@@ -3173,7 +3173,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
3173
3173
  if (!slide) {
3174
3174
  return { slides, didUpdate: false };
3175
3175
  }
3176
- const next = chunkTWUAZRCG_js.toggleCommentResolvedInList(slide.comments || [], commentId);
3176
+ const next = chunk5KAMDV37_js.toggleCommentResolvedInList(slide.comments || [], commentId);
3177
3177
  if (!next) {
3178
3178
  return { slides, didUpdate: false };
3179
3179
  }
@@ -3184,7 +3184,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
3184
3184
  if (!slide) {
3185
3185
  return { slides, didAdd: false };
3186
3186
  }
3187
- const next = chunkTWUAZRCG_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
3187
+ const next = chunk5KAMDV37_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
3188
3188
  if (!next) {
3189
3189
  return { slides, didAdd: false };
3190
3190
  }
@@ -3571,7 +3571,7 @@ function useDerivedElementState(input) {
3571
3571
  return [];
3572
3572
  }
3573
3573
  return [
3574
- ...chunkTWUAZRCG_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
3574
+ ...chunk5KAMDV37_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
3575
3575
  ];
3576
3576
  }, [activeSlide, templateElementsBySlideId]);
3577
3577
  const activeMaster = slideMasters[activeMasterIndex];
@@ -3638,7 +3638,7 @@ function useViewerCoreState(_input) {
3638
3638
  const marqueeStateRef = react.useRef(null);
3639
3639
  const isDrawingRef = react.useRef(false);
3640
3640
  const justInteractedRef = react.useRef(false);
3641
- const livePatcher = react.useMemo(() => chunkTWUAZRCG_js.createCollaborationLivePatcher(), []);
3641
+ const livePatcher = react.useMemo(() => chunk5KAMDV37_js.createCollaborationLivePatcher(), []);
3642
3642
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3643
3643
  const slidesRef = react.useRef([]);
3644
3644
  const [mode, setMode] = react.useState("edit");
@@ -3647,8 +3647,8 @@ function useViewerCoreState(_input) {
3647
3647
  const [slides, setSlides] = react.useState([]);
3648
3648
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3649
3649
  const [canvasSize, setCanvasSize] = react.useState({
3650
- width: chunkIVCYND7A_js.DEFAULT_CANVAS_WIDTH,
3651
- height: chunkIVCYND7A_js.DEFAULT_CANVAS_HEIGHT
3650
+ width: chunkGLY4OPMY_js.DEFAULT_CANVAS_WIDTH,
3651
+ height: chunkGLY4OPMY_js.DEFAULT_CANVAS_HEIGHT
3652
3652
  });
3653
3653
  const [slideSizeEmu, setSlideSizeEmu] = react.useState();
3654
3654
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
@@ -3669,7 +3669,7 @@ function useViewerCoreState(_input) {
3669
3669
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3670
3670
  inlineEditingTextRef.current = resolved;
3671
3671
  setInlineEditingTextBase(value);
3672
- chunkTWUAZRCG_js.publishLiveInlineText(
3672
+ chunk5KAMDV37_js.publishLiveInlineText(
3673
3673
  livePatcher,
3674
3674
  slidesRef.current[activeSlideIndexRef.current],
3675
3675
  inlineEditingElementIdRef.current,
@@ -3962,6 +3962,12 @@ function useViewerState(input) {
3962
3962
  const ui = useViewerUIState();
3963
3963
  return { ...core, ...ui };
3964
3964
  }
3965
+
3966
+ // src/viewer/utils/glyph-outline-cache.ts
3967
+ var glyphOutlineFontCache = new chunk5KAMDV37_js.GlyphOutlineFontCache();
3968
+ var getGlyphOutline = chunk5KAMDV37_js.createGlyphOutlineLookup(glyphOutlineFontCache);
3969
+
3970
+ // src/viewer/hooks/useLoadContent.ts
3965
3971
  function useLoadContent({
3966
3972
  content,
3967
3973
  clearSelection,
@@ -4032,7 +4038,7 @@ function useLoadContent({
4032
4038
  );
4033
4039
  }
4034
4040
  const previousHandler = handlerRef.current;
4035
- const handler = new chunkTWUAZRCG_js.PptxHandler();
4041
+ const handler = new chunk5KAMDV37_js.PptxHandler();
4036
4042
  const parsed = await handler.load(buffer, { allowExternalImages });
4037
4043
  if (cancelled || token !== renderTokenRef.current) {
4038
4044
  handler.dispose();
@@ -4044,7 +4050,7 @@ function useLoadContent({
4044
4050
  handlerRef.current = null;
4045
4051
  const mediaElements = [];
4046
4052
  for (const slide of parsed.slides) {
4047
- chunkTWUAZRCG_js.collectMediaElements(slide.elements, mediaElements);
4053
+ chunk5KAMDV37_js.collectMediaElements(slide.elements, mediaElements);
4048
4054
  }
4049
4055
  for (const url of mediaDataUrls.values()) {
4050
4056
  if (url.startsWith("blob:")) {
@@ -4054,7 +4060,7 @@ function useLoadContent({
4054
4060
  mediaDataUrls.clear();
4055
4061
  await Promise.all(
4056
4062
  mediaElements.map(async (mediaElement) => {
4057
- const resolved = await chunkTWUAZRCG_js.resolveMediaElementSource(mediaElement, handler);
4063
+ const resolved = await chunk5KAMDV37_js.resolveMediaElementSource(mediaElement, handler);
4058
4064
  if (resolved.missing || !resolved.mediaPath || !resolved.url) {
4059
4065
  mediaElement.mediaMissing = true;
4060
4066
  return;
@@ -4065,7 +4071,7 @@ function useLoadContent({
4065
4071
  }
4066
4072
  })
4067
4073
  );
4068
- const { paths: imagePaths, refs: imageRefs } = chunkTWUAZRCG_js.collectImagePaths(parsed.slides);
4074
+ const { paths: imagePaths, refs: imageRefs } = chunk5KAMDV37_js.collectImagePaths(parsed.slides);
4069
4075
  let nextSlides = parsed.slides;
4070
4076
  if (imagePaths.size > 0) {
4071
4077
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -4081,25 +4087,25 @@ function useLoadContent({
4081
4087
  })
4082
4088
  );
4083
4089
  nextSlides = parsed.slides.map((s) => {
4084
- const newElements = chunkTWUAZRCG_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
4090
+ const newElements = chunk5KAMDV37_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
4085
4091
  return newElements === s.elements ? s : { ...s, elements: newElements };
4086
4092
  });
4087
4093
  }
4088
- nextSlides = await chunkTWUAZRCG_js.resolveTableCellImageUrls(
4094
+ nextSlides = await chunk5KAMDV37_js.resolveTableCellImageUrls(
4089
4095
  nextSlides,
4090
4096
  (path) => handler.getImageData(path)
4091
4097
  );
4092
- const nextTableStyleMap = await chunkTWUAZRCG_js.resolveTableStyleImageUrls(
4098
+ const nextTableStyleMap = await chunk5KAMDV37_js.resolveTableStyleImageUrls(
4093
4099
  parsed.tableStyleMap,
4094
4100
  (path) => handler.getImageData(path)
4095
4101
  );
4096
4102
  handlerRef.current = handler;
4097
- const partition = chunkTWUAZRCG_js.partitionTemplateElements(nextSlides);
4103
+ const partition = chunk5KAMDV37_js.partitionTemplateElements(nextSlides);
4098
4104
  setSlides(partition.slides);
4099
4105
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
4100
4106
  setCanvasSize({
4101
- width: parsed.width ?? chunkIVCYND7A_js.DEFAULT_CANVAS_WIDTH,
4102
- height: parsed.height ?? chunkIVCYND7A_js.DEFAULT_CANVAS_HEIGHT
4107
+ width: parsed.width ?? chunkGLY4OPMY_js.DEFAULT_CANVAS_WIDTH,
4108
+ height: parsed.height ?? chunkGLY4OPMY_js.DEFAULT_CANVAS_HEIGHT
4103
4109
  });
4104
4110
  setSlideSizeEmu(
4105
4111
  typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
@@ -4112,7 +4118,7 @@ function useLoadContent({
4112
4118
  setLayoutOptions(parsed.layoutOptions ?? []);
4113
4119
  setSlideMasters(parsed.slideMasters ?? []);
4114
4120
  setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
4115
- setRecentColors(chunkTWUAZRCG_js.seedRecentColors({ mruColors: parsed.mruColors }));
4121
+ setRecentColors(chunk5KAMDV37_js.seedRecentColors({ mruColors: parsed.mruColors }));
4116
4122
  setTheme(parsed.theme);
4117
4123
  setTableStyleMap(nextTableStyleMap);
4118
4124
  setTableStylesDefaultId(parsed.tableStylesDefaultId);
@@ -4120,7 +4126,7 @@ function useLoadContent({
4120
4126
  setThemeOptions(parsed.themeOptions ?? []);
4121
4127
  setCustomShows(parsed.customShows ?? []);
4122
4128
  setActiveCustomShowId(
4123
- chunkTWUAZRCG_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
4129
+ chunk5KAMDV37_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
4124
4130
  );
4125
4131
  setSections(parsed.sections ?? []);
4126
4132
  setPresentationProperties(parsed.presentationProperties ?? {});
@@ -4140,14 +4146,15 @@ function useLoadContent({
4140
4146
  setCoreProperties(parsed.coreProperties);
4141
4147
  setAppProperties(parsed.appProperties);
4142
4148
  setEmbeddedFonts(parsed.embeddedFonts ?? []);
4149
+ glyphOutlineFontCache.registerEmbeddedFonts(parsed.embeddedFonts ?? []);
4143
4150
  setHasMacros(parsed.hasMacros === true);
4144
4151
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
4145
4152
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
4146
- setGuides(chunkTWUAZRCG_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
4147
- setReadOnlyRecommendation(chunkTWUAZRCG_js.readOnlyRecommendation(parsed));
4153
+ setGuides(chunk5KAMDV37_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
4154
+ setReadOnlyRecommendation(chunk5KAMDV37_js.readOnlyRecommendation(parsed));
4148
4155
  setModifyVerifier(parsed.modifyVerifier ?? void 0);
4149
4156
  setCompatToasts(
4150
- chunkTWUAZRCG_js.compatibilityWarningToasts([
4157
+ chunk5KAMDV37_js.compatibilityWarningToasts([
4151
4158
  ...parsed.warnings ?? [],
4152
4159
  ...parsed.slides.flatMap((slide) => slide.warnings ?? [])
4153
4160
  ])
@@ -4159,7 +4166,7 @@ function useLoadContent({
4159
4166
  onContentApplied?.();
4160
4167
  } catch (err) {
4161
4168
  if (!cancelled && token === renderTokenRef.current) {
4162
- if (err instanceof chunkTWUAZRCG_js.EncryptedFileError) {
4169
+ if (err instanceof chunk5KAMDV37_js.EncryptedFileError) {
4163
4170
  setIsEncrypted(true);
4164
4171
  } else {
4165
4172
  console.error("[pptx] Failed to load presentation content:", err);
@@ -4187,7 +4194,7 @@ function useLoadContent({
4187
4194
  }
4188
4195
  function useAutosave(input) {
4189
4196
  const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
4190
- const intervalMs = chunkTWUAZRCG_js.resolveAutosaveIntervalMs({
4197
+ const intervalMs = chunk5KAMDV37_js.resolveAutosaveIntervalMs({
4191
4198
  hostIntervalMs: input.intervalMs,
4192
4199
  optionsIntervalSeconds: input.intervalSeconds
4193
4200
  });
@@ -4218,7 +4225,7 @@ function useAutosave(input) {
4218
4225
  return;
4219
4226
  }
4220
4227
  const sources = changeSourcesRef.current?.() ?? [];
4221
- if (!chunkTWUAZRCG_js.shouldWriteAutosaveSnapshot({
4228
+ if (!chunk5KAMDV37_js.shouldWriteAutosaveSnapshot({
4222
4229
  filePath: path,
4223
4230
  isDirty: isDirtyRef.current,
4224
4231
  saving: isSavingRef.current,
@@ -4236,8 +4243,8 @@ function useAutosave(input) {
4236
4243
  isSavingRef.current = false;
4237
4244
  return;
4238
4245
  }
4239
- await chunkTWUAZRCG_js.saveAutosaveSnapshot(path, data);
4240
- lastSnapshotRef.current = chunkTWUAZRCG_js.autosaveSnapshotMark(path, sources);
4246
+ await chunk5KAMDV37_js.saveAutosaveSnapshot(path, data);
4247
+ lastSnapshotRef.current = chunk5KAMDV37_js.autosaveSnapshotMark(path, sources);
4241
4248
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4242
4249
  } catch (err) {
4243
4250
  setAutosaveStatus({
@@ -4291,13 +4298,13 @@ function useElementOperations(input) {
4291
4298
  inlineEditingText
4292
4299
  } = input;
4293
4300
  const liveTextSegments = react.useCallback(() => {
4294
- if (!selectedElement || !chunkTWUAZRCG_js.hasTextProperties(selectedElement)) {
4301
+ if (!selectedElement || !chunk5KAMDV37_js.hasTextProperties(selectedElement)) {
4295
4302
  return void 0;
4296
4303
  }
4297
4304
  if (selectedElement.id !== inlineEditingElementId) {
4298
4305
  return selectedElement.textSegments;
4299
4306
  }
4300
- return chunkTWUAZRCG_js.remapTextToSegments(
4307
+ return chunk5KAMDV37_js.remapTextToSegments(
4301
4308
  inlineEditingText,
4302
4309
  selectedElement.textSegments,
4303
4310
  selectedElement.textStyle
@@ -4338,11 +4345,11 @@ function useElementOperations(input) {
4338
4345
  (elementId, updates) => {
4339
4346
  if (masterView?.target) {
4340
4347
  applyMasterViewWrite(
4341
- chunkTWUAZRCG_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4348
+ chunk5KAMDV37_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4342
4349
  );
4343
4350
  return;
4344
4351
  }
4345
- if (chunkTWUAZRCG_js.isTemplateElementId(elementId)) {
4352
+ if (chunk5KAMDV37_js.isTemplateElementId(elementId)) {
4346
4353
  const slideId = activeSlide?.id;
4347
4354
  if (slideId) {
4348
4355
  setTemplateElementsBySlideId((prev) => ({
@@ -4353,7 +4360,7 @@ function useElementOperations(input) {
4353
4360
  }));
4354
4361
  }
4355
4362
  } else {
4356
- setSlides((prev) => chunkTWUAZRCG_js.updateElement(prev, activeSlideIndex, elementId, updates));
4363
+ setSlides((prev) => chunk5KAMDV37_js.updateElement(prev, activeSlideIndex, elementId, updates));
4357
4364
  }
4358
4365
  history.markDirty();
4359
4366
  },
@@ -4378,7 +4385,7 @@ function useElementOperations(input) {
4378
4385
  );
4379
4386
  const updateSelectedShapeStyle = react.useCallback(
4380
4387
  (updates) => {
4381
- if (!selectedElement || !chunkTWUAZRCG_js.hasShapeProperties(selectedElement)) {
4388
+ if (!selectedElement || !chunk5KAMDV37_js.hasShapeProperties(selectedElement)) {
4382
4389
  return;
4383
4390
  }
4384
4391
  updateSelectedElement({
@@ -4389,19 +4396,19 @@ function useElementOperations(input) {
4389
4396
  );
4390
4397
  const updateSelectedTextStyle = react.useCallback(
4391
4398
  (updates) => {
4392
- if (!selectedElement || !chunkTWUAZRCG_js.hasTextProperties(selectedElement)) {
4399
+ if (!selectedElement || !chunk5KAMDV37_js.hasTextProperties(selectedElement)) {
4393
4400
  return;
4394
4401
  }
4395
4402
  const isLiveEditing = selectedElement.id === inlineEditingElementId;
4396
4403
  const currentSegments = liveTextSegments();
4397
- const inlineSel = chunkTWUAZRCG_js.getInlineEditorSelection(currentSegments);
4404
+ const inlineSel = chunk5KAMDV37_js.getInlineEditorSelection(currentSegments);
4398
4405
  if (inlineSel && currentSegments) {
4399
- const { newSegments: newSegments2, newSelection } = chunkTWUAZRCG_js.applyStyleToSelectedSegments(
4406
+ const { newSegments: newSegments2, newSelection } = chunk5KAMDV37_js.applyStyleToSelectedSegments(
4400
4407
  currentSegments,
4401
4408
  inlineSel,
4402
4409
  updates
4403
4410
  );
4404
- chunkTWUAZRCG_js.setPendingSelectionRestore(newSelection);
4411
+ chunk5KAMDV37_js.setPendingSelectionRestore(newSelection);
4405
4412
  updateSelectedElement({
4406
4413
  textSegments: newSegments2,
4407
4414
  ...isLiveEditing ? { text: inlineEditingText } : {}
@@ -4429,14 +4436,14 @@ function useElementOperations(input) {
4429
4436
  );
4430
4437
  const updateSelectedTextCase = react.useCallback(
4431
4438
  (mode) => {
4432
- if (!selectedElement || !chunkTWUAZRCG_js.hasTextProperties(selectedElement)) {
4439
+ if (!selectedElement || !chunk5KAMDV37_js.hasTextProperties(selectedElement)) {
4433
4440
  return;
4434
4441
  }
4435
4442
  const isLiveEditing = selectedElement.id === inlineEditingElementId;
4436
4443
  const currentSegments = liveTextSegments();
4437
- const inlineSel = chunkTWUAZRCG_js.getInlineEditorSelection(currentSegments);
4444
+ const inlineSel = chunk5KAMDV37_js.getInlineEditorSelection(currentSegments);
4438
4445
  if (inlineSel && currentSegments) {
4439
- const newSegments = chunkTWUAZRCG_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
4446
+ const newSegments = chunk5KAMDV37_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
4440
4447
  updateSelectedElement({
4441
4448
  textSegments: newSegments,
4442
4449
  ...isLiveEditing ? { text: inlineEditingText } : {}
@@ -4445,7 +4452,7 @@ function useElementOperations(input) {
4445
4452
  }
4446
4453
  const updates = {};
4447
4454
  if (currentSegments && currentSegments.length > 0) {
4448
- updates.textSegments = chunkTWUAZRCG_js.applyCaseTransformToSegments(
4455
+ updates.textSegments = chunk5KAMDV37_js.applyCaseTransformToSegments(
4449
4456
  currentSegments,
4450
4457
  null,
4451
4458
  mode
@@ -4453,7 +4460,7 @@ function useElementOperations(input) {
4453
4460
  }
4454
4461
  const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
4455
4462
  if (typeof baseText === "string") {
4456
- updates.text = chunkTWUAZRCG_js.transformTextCase(baseText, mode);
4463
+ updates.text = chunk5KAMDV37_js.transformTextCase(baseText, mode);
4457
4464
  }
4458
4465
  updateSelectedElement(updates);
4459
4466
  },
@@ -4472,15 +4479,15 @@ function useElementOperations(input) {
4472
4479
  [setSlides]
4473
4480
  );
4474
4481
  const masterViewTarget = masterView?.target ?? null;
4475
- const activeElements = masterViewTarget ? chunkTWUAZRCG_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4482
+ const activeElements = masterViewTarget ? chunk5KAMDV37_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4476
4483
  const updateActiveElements = react.useCallback(
4477
4484
  (updater) => {
4478
4485
  if (masterView?.target) {
4479
4486
  applyMasterViewWrite(
4480
- chunkTWUAZRCG_js.replaceMasterViewElements(
4487
+ chunk5KAMDV37_js.replaceMasterViewElements(
4481
4488
  masterView,
4482
4489
  masterView.target,
4483
- updater(chunkTWUAZRCG_js.masterViewElements(masterView, masterView.target))
4490
+ updater(chunk5KAMDV37_js.masterViewElements(masterView, masterView.target))
4484
4491
  )
4485
4492
  );
4486
4493
  return;
@@ -4533,7 +4540,7 @@ function useSectionOperations(input) {
4533
4540
  const { sections, setSections, slides, setSlides, markDirty } = input;
4534
4541
  const addSection2 = react.useCallback(
4535
4542
  (name, afterSlideIndex) => {
4536
- const result = chunkTWUAZRCG_js.addSection(sections, slides, name, afterSlideIndex);
4543
+ const result = chunk5KAMDV37_js.addSection(sections, slides, name, afterSlideIndex);
4537
4544
  setSlides(result.slides);
4538
4545
  setSections(result.sections);
4539
4546
  markDirty();
@@ -4542,7 +4549,7 @@ function useSectionOperations(input) {
4542
4549
  );
4543
4550
  const renameSection2 = react.useCallback(
4544
4551
  (sectionId, newName) => {
4545
- const result = chunkTWUAZRCG_js.renameSection(sections, slides, sectionId, newName);
4552
+ const result = chunk5KAMDV37_js.renameSection(sections, slides, sectionId, newName);
4546
4553
  setSections(result.sections);
4547
4554
  setSlides(result.slides);
4548
4555
  markDirty();
@@ -4551,7 +4558,7 @@ function useSectionOperations(input) {
4551
4558
  );
4552
4559
  const deleteSection2 = react.useCallback(
4553
4560
  (sectionId) => {
4554
- const result = chunkTWUAZRCG_js.deleteSection(sections, slides, sectionId);
4561
+ const result = chunk5KAMDV37_js.deleteSection(sections, slides, sectionId);
4555
4562
  setSections(result.sections);
4556
4563
  setSlides(result.slides);
4557
4564
  markDirty();
@@ -4560,21 +4567,21 @@ function useSectionOperations(input) {
4560
4567
  );
4561
4568
  const moveSectionUp2 = react.useCallback(
4562
4569
  (sectionId) => {
4563
- setSections(chunkTWUAZRCG_js.moveSectionUp(sections, sectionId));
4570
+ setSections(chunk5KAMDV37_js.moveSectionUp(sections, sectionId));
4564
4571
  markDirty();
4565
4572
  },
4566
4573
  [sections, setSections, markDirty]
4567
4574
  );
4568
4575
  const moveSectionDown2 = react.useCallback(
4569
4576
  (sectionId) => {
4570
- setSections(chunkTWUAZRCG_js.moveSectionDown(sections, sectionId));
4577
+ setSections(chunk5KAMDV37_js.moveSectionDown(sections, sectionId));
4571
4578
  markDirty();
4572
4579
  },
4573
4580
  [sections, setSections, markDirty]
4574
4581
  );
4575
4582
  const moveSlidesToSection2 = react.useCallback(
4576
4583
  (slideIndexes, targetSectionId) => {
4577
- const result = chunkTWUAZRCG_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4584
+ const result = chunk5KAMDV37_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4578
4585
  setSlides(result.slides);
4579
4586
  setSections(result.sections);
4580
4587
  markDirty();
@@ -4640,15 +4647,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
4640
4647
  // src/viewer/hooks/pointer-move-handlers.ts
4641
4648
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
4642
4649
  const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
4643
- let resized = chunkTWUAZRCG_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkIVCYND7A_js.MIN_ELEMENT_SIZE });
4650
+ let resized = chunk5KAMDV37_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkGLY4OPMY_js.MIN_ELEMENT_SIZE });
4644
4651
  if (lockAspect) {
4645
- resized = chunkTWUAZRCG_js.lockResizeAspect(resized, startBox, handle, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
4652
+ resized = chunk5KAMDV37_js.lockResizeAspect(resized, startBox, handle, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
4646
4653
  }
4647
4654
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4648
4655
  if (!snapToGrid) {
4649
4656
  return box;
4650
4657
  }
4651
- return chunkTWUAZRCG_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
4658
+ return chunk5KAMDV37_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
4652
4659
  }
4653
4660
  function resolveLiveTarget(input) {
4654
4661
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4761,7 +4768,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4761
4768
  width: el.width,
4762
4769
  height: el.height
4763
4770
  }));
4764
- const snapResult = chunkTWUAZRCG_js.computeSnapToShape(
4771
+ const snapResult = chunk5KAMDV37_js.computeSnapToShape(
4765
4772
  targetX,
4766
4773
  targetY,
4767
4774
  primaryEl.width,
@@ -4803,7 +4810,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4803
4810
  if (live) {
4804
4811
  for (const id of Object.keys(drag.startPositionsById)) {
4805
4812
  const start = drag.startPositionsById[id];
4806
- chunkTWUAZRCG_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4813
+ chunk5KAMDV37_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4807
4814
  x: start.x + appliedDx,
4808
4815
  y: start.y + appliedDy
4809
4816
  });
@@ -4835,8 +4842,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4835
4842
  rs.lastY = geo.y;
4836
4843
  rs.lastWidth = geo.width;
4837
4844
  rs.lastHeight = geo.height;
4838
- const width = Math.max(geo.width, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
4839
- const height = Math.max(geo.height, chunkIVCYND7A_js.MIN_ELEMENT_SIZE);
4845
+ const width = Math.max(geo.width, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
4846
+ const height = Math.max(geo.height, chunkGLY4OPMY_js.MIN_ELEMENT_SIZE);
4840
4847
  if (rs.domEl) {
4841
4848
  rs.domEl.style.left = `${geo.x}px`;
4842
4849
  rs.domEl.style.top = `${geo.y}px`;
@@ -4845,7 +4852,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4845
4852
  syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
4846
4853
  }
4847
4854
  if (live) {
4848
- chunkTWUAZRCG_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4855
+ chunk5KAMDV37_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4849
4856
  x: geo.x,
4850
4857
  y: geo.y,
4851
4858
  width,
@@ -4856,7 +4863,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4856
4863
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4857
4864
  const dx = (e.clientX - adj.startClientX) / editorScale;
4858
4865
  const dy = (e.clientY - adj.startClientY) / editorScale;
4859
- const adjustments = chunkTWUAZRCG_js.getDraggedShapeAdjustments(adj, dx, dy);
4866
+ const adjustments = chunk5KAMDV37_js.getDraggedShapeAdjustments(adj, dx, dy);
4860
4867
  if (!adj.moved && Math.hypot(dx, dy) > 2) {
4861
4868
  adj.moved = true;
4862
4869
  }
@@ -4931,13 +4938,13 @@ function processPointerUp(input) {
4931
4938
  if (i !== activeSlideIndex) {
4932
4939
  return s;
4933
4940
  }
4934
- const rerouted = chunkTWUAZRCG_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4941
+ const rerouted = chunk5KAMDV37_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4935
4942
  if (rerouted.length === 0) {
4936
4943
  return s;
4937
4944
  }
4938
4945
  return {
4939
4946
  ...s,
4940
- elements: chunkTWUAZRCG_js.applyReroutedConnectors(s.elements, rerouted)
4947
+ elements: chunk5KAMDV37_js.applyReroutedConnectors(s.elements, rerouted)
4941
4948
  };
4942
4949
  })
4943
4950
  );
@@ -4962,9 +4969,9 @@ function processPointerUp(input) {
4962
4969
  }
4963
4970
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4964
4971
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4965
- const hitIds = chunkTWUAZRCG_js.computeMarqueeHitIds(marquee, sourceElements);
4972
+ const hitIds = chunk5KAMDV37_js.computeMarqueeHitIds(marquee, sourceElements);
4966
4973
  if (marquee.additive) {
4967
- const merged = chunkTWUAZRCG_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4974
+ const merged = chunk5KAMDV37_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4968
4975
  if (merged.length > 0) {
4969
4976
  applySelection(merged[0], merged);
4970
4977
  } else {
@@ -4987,8 +4994,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4987
4994
  }
4988
4995
  return { ...el, x: start.x + dx, y: start.y + dy };
4989
4996
  });
4990
- const rerouted = chunkTWUAZRCG_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4991
- return chunkTWUAZRCG_js.applyReroutedConnectors(movedElements, rerouted);
4997
+ const rerouted = chunk5KAMDV37_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4998
+ return chunk5KAMDV37_js.applyReroutedConnectors(movedElements, rerouted);
4992
4999
  };
4993
5000
  if (editTemplateMode) {
4994
5001
  const slideId = activeSlide?.id;
@@ -5144,17 +5151,17 @@ function useCanvasInteractions(input) {
5144
5151
  return;
5145
5152
  }
5146
5153
  const el = elementLookup.get(editId);
5147
- if (el && chunkTWUAZRCG_js.hasTextProperties(el)) {
5154
+ if (el && chunk5KAMDV37_js.hasTextProperties(el)) {
5148
5155
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
5149
- const textPatch = chunkTWUAZRCG_js.buildInlineTextCommitPatch(el, committedText);
5156
+ const textPatch = chunk5KAMDV37_js.buildInlineTextCommitPatch(el, committedText);
5150
5157
  if (!textPatch) {
5151
5158
  setInlineEditingElementId(null);
5152
5159
  setInlineEditingText("");
5153
5160
  return;
5154
5161
  }
5155
5162
  const editorEl = document.querySelector("[data-inline-editor]");
5156
- const newHeight = chunkTWUAZRCG_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
5157
- const shrink = chunkTWUAZRCG_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
5163
+ const newHeight = chunk5KAMDV37_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
5164
+ const shrink = chunk5KAMDV37_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
5158
5165
  ops.updateElementById(editId, {
5159
5166
  ...textPatch,
5160
5167
  ...newHeight !== void 0 ? { height: newHeight } : {},
@@ -5172,7 +5179,7 @@ function useCanvasInteractions(input) {
5172
5179
  setInlineEditingText("");
5173
5180
  };
5174
5181
  const openEquationEditorForElement = (el) => {
5175
- if (!chunkTWUAZRCG_js.hasTextProperties(el)) {
5182
+ if (!chunk5KAMDV37_js.hasTextProperties(el)) {
5176
5183
  return false;
5177
5184
  }
5178
5185
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -5202,7 +5209,7 @@ function useCanvasInteractions(input) {
5202
5209
  justInteractedRef.current = false;
5203
5210
  } else {
5204
5211
  const el = elementLookup.get(elementId);
5205
- if (el && chunkTWUAZRCG_js.hasTextProperties(el) && chunkTWUAZRCG_js.canInteractWithElement(el, "textEdit")) {
5212
+ if (el && chunk5KAMDV37_js.hasTextProperties(el) && chunk5KAMDV37_js.canInteractWithElement(el, "textEdit")) {
5206
5213
  if (!openEquationEditorForElement(el)) {
5207
5214
  setInlineEditingElementId(elementId);
5208
5215
  setInlineEditingText(el.text ?? "");
@@ -5221,7 +5228,7 @@ function useCanvasInteractions(input) {
5221
5228
  if (openEquationEditorForElement(el)) {
5222
5229
  return;
5223
5230
  }
5224
- if (chunkTWUAZRCG_js.hasTextProperties(el) && chunkTWUAZRCG_js.canInteractWithElement(el, "textEdit")) {
5231
+ if (chunk5KAMDV37_js.hasTextProperties(el) && chunk5KAMDV37_js.canInteractWithElement(el, "textEdit")) {
5225
5232
  setInlineEditingElementId(elementId);
5226
5233
  setInlineEditingText(el.text ?? "");
5227
5234
  }
@@ -5244,7 +5251,7 @@ function useCanvasInteractions(input) {
5244
5251
  justSelectedRef.current = false;
5245
5252
  }
5246
5253
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
5247
- const movableIds = chunkTWUAZRCG_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
5254
+ const movableIds = chunk5KAMDV37_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
5248
5255
  if (movableIds.length === 0) {
5249
5256
  return;
5250
5257
  }
@@ -5314,7 +5321,7 @@ function useCanvasInteractions(input) {
5314
5321
  const handleResizePointerDown = (elementId, e, handle) => {
5315
5322
  e.stopPropagation();
5316
5323
  const el = elementLookup.get(elementId);
5317
- if (!el || !chunkTWUAZRCG_js.canInteractWithElement(el, "resize")) {
5324
+ if (!el || !chunk5KAMDV37_js.canInteractWithElement(el, "resize")) {
5318
5325
  return;
5319
5326
  }
5320
5327
  resizeStateRef.current = {
@@ -5336,7 +5343,7 @@ function useCanvasInteractions(input) {
5336
5343
  };
5337
5344
  const handleRotate = (elementId, rotationDeg) => {
5338
5345
  const el = elementLookup.get(elementId);
5339
- if (!el || !chunkTWUAZRCG_js.canInteractWithElement(el, "rotate")) {
5346
+ if (!el || !chunk5KAMDV37_js.canInteractWithElement(el, "rotate")) {
5340
5347
  return;
5341
5348
  }
5342
5349
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -5356,10 +5363,10 @@ function useCanvasInteractions(input) {
5356
5363
  const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
5357
5364
  e.stopPropagation();
5358
5365
  const el = elementLookup.get(elementId);
5359
- if (!el || !chunkTWUAZRCG_js.canInteractWithElement(el, "adjustHandle")) {
5366
+ if (!el || !chunk5KAMDV37_js.canInteractWithElement(el, "adjustHandle")) {
5360
5367
  return;
5361
5368
  }
5362
- shapeAdjustmentDragStateRef.current = chunkTWUAZRCG_js.beginShapeAdjustment(
5369
+ shapeAdjustmentDragStateRef.current = chunk5KAMDV37_js.beginShapeAdjustment(
5363
5370
  el,
5364
5371
  descriptor,
5365
5372
  e.clientX,
@@ -5406,7 +5413,7 @@ function createFileHandlers(deps) {
5406
5413
  h = Math.round(h * scale);
5407
5414
  }
5408
5415
  addElement({
5409
- id: chunkTWUAZRCG_js.generateElementId(),
5416
+ id: chunk5KAMDV37_js.generateElementId(),
5410
5417
  type: "image",
5411
5418
  x: Math.round((canvasSize.width - w) / 2),
5412
5419
  y: Math.round((canvasSize.height - h) / 2),
@@ -5417,7 +5424,7 @@ function createFileHandlers(deps) {
5417
5424
  };
5418
5425
  img.onerror = () => {
5419
5426
  addElement({
5420
- id: chunkTWUAZRCG_js.generateElementId(),
5427
+ id: chunk5KAMDV37_js.generateElementId(),
5421
5428
  type: "image",
5422
5429
  x: 100,
5423
5430
  y: 100,
@@ -5436,14 +5443,14 @@ function createFileHandlers(deps) {
5436
5443
  return;
5437
5444
  }
5438
5445
  e.target.value = "";
5439
- const mediaType = chunkTWUAZRCG_js.classifyMediaType(file.type);
5446
+ const mediaType = chunk5KAMDV37_js.classifyMediaType(file.type);
5440
5447
  if (!mediaType) {
5441
5448
  return;
5442
5449
  }
5443
5450
  const elFilePath = file.path;
5444
5451
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5445
5452
  addElement({
5446
- id: chunkTWUAZRCG_js.generateElementId(),
5453
+ id: chunk5KAMDV37_js.generateElementId(),
5447
5454
  type: "media",
5448
5455
  mediaType,
5449
5456
  mediaMimeType: file.type || void 0,
@@ -5618,13 +5625,13 @@ function createStructuredElementHandlers(deps) {
5618
5625
  return;
5619
5626
  }
5620
5627
  addElement({
5621
- id: chunkTWUAZRCG_js.generateElementId(),
5628
+ id: chunk5KAMDV37_js.generateElementId(),
5622
5629
  type: "smartArt",
5623
5630
  x: 100,
5624
5631
  y: 120,
5625
5632
  width: 600,
5626
5633
  height: 340,
5627
- smartArtData: chunkTWUAZRCG_js.buildSmartArtPresetData(
5634
+ smartArtData: chunk5KAMDV37_js.buildSmartArtPresetData(
5628
5635
  layout,
5629
5636
  defaultItems,
5630
5637
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5636,7 +5643,7 @@ function createStructuredElementHandlers(deps) {
5636
5643
  return;
5637
5644
  }
5638
5645
  addElement({
5639
- id: chunkTWUAZRCG_js.generateElementId(),
5646
+ id: chunk5KAMDV37_js.generateElementId(),
5640
5647
  type: "shape",
5641
5648
  x: 120,
5642
5649
  y: 200,
@@ -5674,7 +5681,7 @@ function createStructuredElementHandlers(deps) {
5674
5681
  return;
5675
5682
  }
5676
5683
  const resolved = resolveHyperlinkEditResult(data);
5677
- if (resolved.url && !chunkTWUAZRCG_js.isUrlSafe(resolved.url)) {
5684
+ if (resolved.url && !chunk5KAMDV37_js.isUrlSafe(resolved.url)) {
5678
5685
  return;
5679
5686
  }
5680
5687
  const actionClick = {
@@ -5698,7 +5705,7 @@ function createStructuredElementHandlers(deps) {
5698
5705
  const displayText = value || fieldTexts[fieldType] || fieldType;
5699
5706
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5700
5707
  addElement({
5701
- id: chunkTWUAZRCG_js.generateElementId(),
5708
+ id: chunk5KAMDV37_js.generateElementId(),
5702
5709
  type: "shape",
5703
5710
  x: 120,
5704
5711
  y: 200,
@@ -5720,11 +5727,11 @@ function createStructuredElementHandlers(deps) {
5720
5727
  if (!activeSlide) {
5721
5728
  return;
5722
5729
  }
5723
- const preset = chunkTWUAZRCG_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5730
+ const preset = chunk5KAMDV37_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5724
5731
  if (!preset) {
5725
5732
  return;
5726
5733
  }
5727
- const defaultPptxAction = chunkTWUAZRCG_js.elementActionToPptxAction({
5734
+ const defaultPptxAction = chunk5KAMDV37_js.elementActionToPptxAction({
5728
5735
  trigger: "click",
5729
5736
  type: preset.defaultAction
5730
5737
  });
@@ -5733,7 +5740,7 @@ function createStructuredElementHandlers(deps) {
5733
5740
  defaultPptxAction.highlightClick = true;
5734
5741
  }
5735
5742
  addElement({
5736
- id: chunkTWUAZRCG_js.generateElementId(),
5743
+ id: chunk5KAMDV37_js.generateElementId(),
5737
5744
  type: "shape",
5738
5745
  x: 150,
5739
5746
  y: 150,
@@ -5800,14 +5807,14 @@ function useInsertElements(input) {
5800
5807
  return;
5801
5808
  }
5802
5809
  addElement({
5803
- id: chunkTWUAZRCG_js.generateElementId(),
5810
+ id: chunk5KAMDV37_js.generateElementId(),
5804
5811
  type: "text",
5805
5812
  x: 100,
5806
5813
  y: 100,
5807
5814
  width: 300,
5808
5815
  height: 60,
5809
5816
  text: "",
5810
- textStyle: { fontSize: chunkIVCYND7A_js.DEFAULT_TEXT_FONT_SIZE }
5817
+ textStyle: { fontSize: chunkGLY4OPMY_js.DEFAULT_TEXT_FONT_SIZE }
5811
5818
  });
5812
5819
  };
5813
5820
  const handleAddShape = () => {
@@ -5815,7 +5822,7 @@ function useInsertElements(input) {
5815
5822
  return;
5816
5823
  }
5817
5824
  addElement({
5818
- id: chunkTWUAZRCG_js.generateElementId(),
5825
+ id: chunk5KAMDV37_js.generateElementId(),
5819
5826
  type: "shape",
5820
5827
  x: 150,
5821
5828
  y: 150,
@@ -5834,15 +5841,15 @@ function useInsertElements(input) {
5834
5841
  return;
5835
5842
  }
5836
5843
  addElement({
5837
- ...chunkTWUAZRCG_js.newTableElement(chunkIVCYND7A_js.DEFAULT_TABLE_ROWS, chunkIVCYND7A_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5838
- id: chunkTWUAZRCG_js.generateElementId()
5844
+ ...chunk5KAMDV37_js.newTableElement(chunkGLY4OPMY_js.DEFAULT_TABLE_ROWS, chunkGLY4OPMY_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5845
+ id: chunk5KAMDV37_js.generateElementId()
5839
5846
  });
5840
5847
  };
5841
5848
  const handleAddChart = (chartKind) => {
5842
5849
  if (!activeSlide) {
5843
5850
  return;
5844
5851
  }
5845
- addElement(chunkTWUAZRCG_js.createDefaultChartElement(chartKind));
5852
+ addElement(chunk5KAMDV37_js.createDefaultChartElement(chartKind));
5846
5853
  };
5847
5854
  const structured = createStructuredElementHandlers({
5848
5855
  activeSlide,
@@ -5912,7 +5919,7 @@ function useClipboardHandlers(input) {
5912
5919
  if (!selectedElement) {
5913
5920
  return;
5914
5921
  }
5915
- setClipboardPayload(chunkTWUAZRCG_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5922
+ setClipboardPayload(chunk5KAMDV37_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5916
5923
  };
5917
5924
  const handleDelete = () => {
5918
5925
  const idsToDelete = effectiveSelectedIds;
@@ -5929,7 +5936,7 @@ function useClipboardHandlers(input) {
5929
5936
  handleDelete();
5930
5937
  };
5931
5938
  const insertClone = (source) => {
5932
- const clone = chunkTWUAZRCG_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5939
+ const clone = chunk5KAMDV37_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5933
5940
  ops.updateActiveElements((els) => [...els, clone]);
5934
5941
  ops.applySelection(clone.id);
5935
5942
  history.markDirty();
@@ -5964,7 +5971,7 @@ function resolveShapePath(el) {
5964
5971
  return el.pathData;
5965
5972
  }
5966
5973
  if ("shapeType" in el && typeof el.shapeType === "string") {
5967
- const clipPath = chunkTWUAZRCG_js.getPresetShapeClipPath(el.shapeType);
5974
+ const clipPath = chunk5KAMDV37_js.getPresetShapeClipPath(el.shapeType);
5968
5975
  if (clipPath) {
5969
5976
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5970
5977
  if (svgPath) {
@@ -6015,7 +6022,7 @@ function clipPathToSvgPath(clipPath, width, height) {
6015
6022
  return parts.join(" ");
6016
6023
  }
6017
6024
  function transformPathToGlobal(pathData, el) {
6018
- const polys = chunkTWUAZRCG_js.svgPathToPolygons(pathData);
6025
+ const polys = chunk5KAMDV37_js.svgPathToPolygons(pathData);
6019
6026
  if (polys.length === 0) {
6020
6027
  return pathData;
6021
6028
  }
@@ -6035,10 +6042,10 @@ function transformPathToGlobal(pathData, el) {
6035
6042
  y: pt.y * scaleY + el.y
6036
6043
  }))
6037
6044
  );
6038
- return chunkTWUAZRCG_js.polygonsToSvgPath(transformed);
6045
+ return chunk5KAMDV37_js.polygonsToSvgPath(transformed);
6039
6046
  }
6040
6047
  function transformPathToLocal(pathData, x, y, _width, _height) {
6041
- const polys = chunkTWUAZRCG_js.svgPathToPolygons(pathData);
6048
+ const polys = chunk5KAMDV37_js.svgPathToPolygons(pathData);
6042
6049
  if (polys.length === 0) {
6043
6050
  return pathData;
6044
6051
  }
@@ -6048,10 +6055,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
6048
6055
  y: pt.y - y
6049
6056
  }))
6050
6057
  );
6051
- return chunkTWUAZRCG_js.polygonsToSvgPath(transformed);
6058
+ return chunk5KAMDV37_js.polygonsToSvgPath(transformed);
6052
6059
  }
6053
6060
  function pathBounds(pathData) {
6054
- const polys = chunkTWUAZRCG_js.svgPathToPolygons(pathData);
6061
+ const polys = chunk5KAMDV37_js.svgPathToPolygons(pathData);
6055
6062
  let minX = Infinity;
6056
6063
  let minY = Infinity;
6057
6064
  let maxX = -Infinity;
@@ -6110,7 +6117,7 @@ function useMergeShapesHandler(input) {
6110
6117
  let allFragments = [];
6111
6118
  let remaining = globalPaths[0];
6112
6119
  for (let i = 1; i < globalPaths.length; i++) {
6113
- const frags = chunkTWUAZRCG_js.mergeShapes("fragment", remaining, globalPaths[i]);
6120
+ const frags = chunk5KAMDV37_js.mergeShapes("fragment", remaining, globalPaths[i]);
6114
6121
  if (Array.isArray(frags)) {
6115
6122
  allFragments = frags;
6116
6123
  }
@@ -6139,7 +6146,7 @@ function useMergeShapesHandler(input) {
6139
6146
  bounds.height
6140
6147
  );
6141
6148
  const newEl = {
6142
- id: chunkTWUAZRCG_js.generateElementId(),
6149
+ id: chunk5KAMDV37_js.generateElementId(),
6143
6150
  type: "shape",
6144
6151
  x: bounds.x,
6145
6152
  y: bounds.y,
@@ -6177,7 +6184,7 @@ function useMergeShapesHandler(input) {
6177
6184
  } else {
6178
6185
  let resultPath = globalPaths[0];
6179
6186
  for (let i = 1; i < globalPaths.length; i++) {
6180
- const result = chunkTWUAZRCG_js.mergeShapes(operation, resultPath, globalPaths[i]);
6187
+ const result = chunk5KAMDV37_js.mergeShapes(operation, resultPath, globalPaths[i]);
6181
6188
  if (typeof result === "string") {
6182
6189
  resultPath = result;
6183
6190
  }
@@ -6198,7 +6205,7 @@ function useMergeShapesHandler(input) {
6198
6205
  );
6199
6206
  const primary = targets[0];
6200
6207
  const newEl = {
6201
- id: chunkTWUAZRCG_js.generateElementId(),
6208
+ id: chunk5KAMDV37_js.generateElementId(),
6202
6209
  type: "shape",
6203
6210
  x: bounds.x,
6204
6211
  y: bounds.y,
@@ -6261,10 +6268,10 @@ function useGroupAlignLayerHandlers(input) {
6261
6268
  if (ids.length < 2 || !activeSlide) {
6262
6269
  return;
6263
6270
  }
6264
- if (!selectedElements.every((el) => chunkTWUAZRCG_js.canInteractWithElement(el, "group"))) {
6271
+ if (!selectedElements.every((el) => chunk5KAMDV37_js.canInteractWithElement(el, "group"))) {
6265
6272
  return;
6266
6273
  }
6267
- const { elements, groupId } = chunkTWUAZRCG_js.groupElements(ops.activeElements, ids, chunkTWUAZRCG_js.generateElementId());
6274
+ const { elements, groupId } = chunk5KAMDV37_js.groupElements(ops.activeElements, ids, chunk5KAMDV37_js.generateElementId());
6268
6275
  if (groupId === null) {
6269
6276
  return;
6270
6277
  }
@@ -6276,15 +6283,15 @@ function useGroupAlignLayerHandlers(input) {
6276
6283
  if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
6277
6284
  return;
6278
6285
  }
6279
- if (!chunkTWUAZRCG_js.canInteractWithElement(selectedElement, "group")) {
6286
+ if (!chunk5KAMDV37_js.canInteractWithElement(selectedElement, "group")) {
6280
6287
  return;
6281
6288
  }
6282
6289
  const group = selectedElement;
6283
- const intoTemplate = chunkTWUAZRCG_js.isTemplateElementId(group.id);
6290
+ const intoTemplate = chunk5KAMDV37_js.isTemplateElementId(group.id);
6284
6291
  const childIds = group.children.map(
6285
- (child) => intoTemplate ? chunkTWUAZRCG_js.makeCloneId(true, child.id || group.id) : child.id || chunkTWUAZRCG_js.generateElementId()
6292
+ (child) => intoTemplate ? chunk5KAMDV37_js.makeCloneId(true, child.id || group.id) : child.id || chunk5KAMDV37_js.generateElementId()
6286
6293
  );
6287
- const { elements, childIds: usedIds } = chunkTWUAZRCG_js.ungroupElements(
6294
+ const { elements, childIds: usedIds } = chunk5KAMDV37_js.ungroupElements(
6288
6295
  ops.activeElements,
6289
6296
  group.id,
6290
6297
  childIds,
@@ -6313,7 +6320,7 @@ function useGroupAlignLayerHandlers(input) {
6313
6320
  if (!edge) {
6314
6321
  return;
6315
6322
  }
6316
- const positions = chunkTWUAZRCG_js.alignElements(selectedElements, edge);
6323
+ const positions = chunk5KAMDV37_js.alignElements(selectedElements, edge);
6317
6324
  for (const [id, pos] of positions) {
6318
6325
  const el = elementLookup.get(id);
6319
6326
  if (!el) {
@@ -6331,7 +6338,7 @@ function useGroupAlignLayerHandlers(input) {
6331
6338
  if (!distAxis) {
6332
6339
  return;
6333
6340
  }
6334
- const positions = chunkTWUAZRCG_js.distributeElements(selectedElements, distAxis);
6341
+ const positions = chunk5KAMDV37_js.distributeElements(selectedElements, distAxis);
6335
6342
  for (const [id, pos] of positions) {
6336
6343
  const el = elementLookup.get(id);
6337
6344
  if (!el) {
@@ -6342,14 +6349,14 @@ function useGroupAlignLayerHandlers(input) {
6342
6349
  history.markDirty();
6343
6350
  };
6344
6351
  const canDistribute = selectedElements.length >= 3;
6345
- const selectionGroupable = selectedElements.every((el) => chunkTWUAZRCG_js.canInteractWithElement(el, "group"));
6352
+ const selectionGroupable = selectedElements.every((el) => chunk5KAMDV37_js.canInteractWithElement(el, "group"));
6346
6353
  const handleMoveLayer = (direction) => {
6347
6354
  if (!selectedElement || !activeSlide) {
6348
6355
  return;
6349
6356
  }
6350
6357
  const id = selectedElement.id;
6351
6358
  ops.updateActiveElements(
6352
- (els) => direction === "forward" ? chunkTWUAZRCG_js.bringForward(els, id) : direction === "backward" ? chunkTWUAZRCG_js.sendBackward(els, id) : els
6359
+ (els) => direction === "forward" ? chunk5KAMDV37_js.bringForward(els, id) : direction === "backward" ? chunk5KAMDV37_js.sendBackward(els, id) : els
6353
6360
  );
6354
6361
  history.markDirty();
6355
6362
  };
@@ -6359,7 +6366,7 @@ function useGroupAlignLayerHandlers(input) {
6359
6366
  }
6360
6367
  const id = selectedElement.id;
6361
6368
  ops.updateActiveElements(
6362
- (els) => direction === "front" ? chunkTWUAZRCG_js.bringToFront(els, id) : chunkTWUAZRCG_js.sendToBack(els, id)
6369
+ (els) => direction === "front" ? chunk5KAMDV37_js.bringToFront(els, id) : chunk5KAMDV37_js.sendToBack(els, id)
6363
6370
  );
6364
6371
  history.markDirty();
6365
6372
  };
@@ -6492,16 +6499,18 @@ function useSlideManagement(input) {
6492
6499
  canvasSize,
6493
6500
  theme
6494
6501
  } = input;
6495
- const handleAddSlide = () => {
6496
- const newSlide = chunkTWUAZRCG_js.createBlankSlide(slides.length + 1);
6502
+ const handleAddSlideAfter = (afterIndex) => {
6503
+ const insertAt = Math.max(0, Math.min(afterIndex + 1, slides.length));
6504
+ const newSlide = chunk5KAMDV37_js.createBlankSlide(slides.length + 1);
6497
6505
  ops.updateSlides((prev) => {
6498
6506
  const next = [...prev];
6499
- next.splice(activeSlideIndex + 1, 0, newSlide);
6507
+ next.splice(insertAt, 0, newSlide);
6500
6508
  return next;
6501
6509
  });
6502
- setActiveSlideIndex(activeSlideIndex + 1);
6510
+ setActiveSlideIndex(insertAt);
6503
6511
  history.markDirty();
6504
6512
  };
6513
+ const handleAddSlide = () => handleAddSlideAfter(activeSlideIndex);
6505
6514
  const handleMoveSlide = (fromIndex, toIndex) => {
6506
6515
  if (fromIndex === toIndex) {
6507
6516
  return;
@@ -6556,7 +6565,7 @@ function useSlideManagement(input) {
6556
6565
  }
6557
6566
  const clone = {
6558
6567
  ...src,
6559
- id: chunkTWUAZRCG_js.makeSlideId(),
6568
+ id: chunk5KAMDV37_js.makeSlideId(),
6560
6569
  elements: src.elements.map((el) => ({
6561
6570
  ...el,
6562
6571
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6588,7 +6597,7 @@ function useSlideManagement(input) {
6588
6597
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6589
6598
  const insertAt = activeSlideIndex + 1;
6590
6599
  const draft = {
6591
- ...chunkTWUAZRCG_js.createBlankSlide(slides.length + 1),
6600
+ ...chunk5KAMDV37_js.createBlankSlide(slides.length + 1),
6592
6601
  layoutPath,
6593
6602
  ...layoutName ? { layoutName } : {}
6594
6603
  };
@@ -6621,9 +6630,9 @@ function useSlideManagement(input) {
6621
6630
  };
6622
6631
  const handleInsertSlideFromTemplate = (templateId) => {
6623
6632
  const insertAt = activeSlideIndex + 1;
6624
- const draft = chunkTWUAZRCG_js.buildSlideTemplateSlide(templateId, chunkTWUAZRCG_js.makeSlideId(), slides.length + 1, {
6633
+ const draft = chunk5KAMDV37_js.buildSlideTemplateSlide(templateId, chunk5KAMDV37_js.makeSlideId(), slides.length + 1, {
6625
6634
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6626
- scheme: chunkTWUAZRCG_js.templateSchemeFromTheme(theme?.colorScheme)
6635
+ scheme: chunk5KAMDV37_js.templateSchemeFromTheme(theme?.colorScheme)
6627
6636
  });
6628
6637
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6629
6638
  setActiveSlideIndex(insertAt);
@@ -6631,6 +6640,7 @@ function useSlideManagement(input) {
6631
6640
  };
6632
6641
  return {
6633
6642
  handleAddSlide,
6643
+ handleAddSlideAfter,
6634
6644
  handleMoveSlide,
6635
6645
  handleSlideContextMenu,
6636
6646
  handleDeleteSlides,
@@ -6660,7 +6670,7 @@ function createTableMergeHandlers(input) {
6660
6670
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6661
6671
  return;
6662
6672
  }
6663
- const newTableData = chunkTWUAZRCG_js.mergeCells(
6673
+ const newTableData = chunk5KAMDV37_js.mergeCells(
6664
6674
  [
6665
6675
  { row: rowIndex, col: columnIndex },
6666
6676
  { row: rowIndex, col: nextColIdx }
@@ -6668,7 +6678,7 @@ function createTableMergeHandlers(input) {
6668
6678
  td
6669
6679
  );
6670
6680
  const updates = { tableData: newTableData };
6671
- const newRawXml = chunkTWUAZRCG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6681
+ const newRawXml = chunk5KAMDV37_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6672
6682
  if (newRawXml) {
6673
6683
  updates.rawXml = newRawXml;
6674
6684
  }
@@ -6694,7 +6704,7 @@ function createTableMergeHandlers(input) {
6694
6704
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6695
6705
  return;
6696
6706
  }
6697
- const newTableData = chunkTWUAZRCG_js.mergeCells(
6707
+ const newTableData = chunk5KAMDV37_js.mergeCells(
6698
6708
  [
6699
6709
  { row: rowIndex, col: columnIndex },
6700
6710
  { row: targetNextRowIdx, col: columnIndex }
@@ -6702,7 +6712,7 @@ function createTableMergeHandlers(input) {
6702
6712
  td
6703
6713
  );
6704
6714
  const updates = { tableData: newTableData };
6705
- const newRawXml = chunkTWUAZRCG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6715
+ const newRawXml = chunk5KAMDV37_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6706
6716
  if (newRawXml) {
6707
6717
  updates.rawXml = newRawXml;
6708
6718
  }
@@ -6717,9 +6727,9 @@ function createTableMergeHandlers(input) {
6717
6727
  return;
6718
6728
  }
6719
6729
  const td = selectedElement.tableData;
6720
- const newTableData = chunkTWUAZRCG_js.mergeCells(ts.selectedCells, td);
6730
+ const newTableData = chunk5KAMDV37_js.mergeCells(ts.selectedCells, td);
6721
6731
  const updates = { tableData: newTableData };
6722
- const newRawXml = chunkTWUAZRCG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6732
+ const newRawXml = chunk5KAMDV37_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6723
6733
  if (newRawXml) {
6724
6734
  updates.rawXml = newRawXml;
6725
6735
  }
@@ -6736,9 +6746,9 @@ function createTableMergeHandlers(input) {
6736
6746
  }
6737
6747
  const { rowIndex, columnIndex } = ts;
6738
6748
  const td = selectedElement.tableData;
6739
- const newTableData = chunkTWUAZRCG_js.splitCell(rowIndex, columnIndex, td);
6749
+ const newTableData = chunk5KAMDV37_js.splitCell(rowIndex, columnIndex, td);
6740
6750
  const updates = { tableData: newTableData };
6741
- const newRawXml = chunkTWUAZRCG_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6751
+ const newRawXml = chunk5KAMDV37_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6742
6752
  if (newRawXml) {
6743
6753
  updates.rawXml = newRawXml;
6744
6754
  }
@@ -6772,10 +6782,10 @@ function createTableStructHandlers(input) {
6772
6782
  const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
6773
6783
  const updates = {};
6774
6784
  if (el.tableData) {
6775
- updates.tableData = chunkTWUAZRCG_js.setCellText(el, rowIndex, colIndex, text).tableData;
6785
+ updates.tableData = chunk5KAMDV37_js.setCellText(el, rowIndex, colIndex, text).tableData;
6776
6786
  }
6777
6787
  if (el.rawXml) {
6778
- const newRawXml = chunkTWUAZRCG_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6788
+ const newRawXml = chunk5KAMDV37_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6779
6789
  if (newRawXml) {
6780
6790
  updates.rawXml = newRawXml;
6781
6791
  }
@@ -6799,7 +6809,7 @@ function createTableStructHandlers(input) {
6799
6809
  const { rowIndex, columnIndex: colIndex } = ts;
6800
6810
  const updates = {};
6801
6811
  if (selectedElement.rawXml) {
6802
- const newRawXml = chunkTWUAZRCG_js.updateCellTextStyleInRawXml(
6812
+ const newRawXml = chunk5KAMDV37_js.updateCellTextStyleInRawXml(
6803
6813
  selectedElement,
6804
6814
  rowIndex,
6805
6815
  colIndex,
@@ -6863,9 +6873,9 @@ function createTableStructHandlers(input) {
6863
6873
  return;
6864
6874
  }
6865
6875
  const rowIdx = ts?.rowIndex ?? 0;
6866
- const newTableData = chunkTWUAZRCG_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6876
+ const newTableData = chunk5KAMDV37_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6867
6877
  const updates = { tableData: newTableData };
6868
- const newRawXml = chunkTWUAZRCG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6878
+ const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6869
6879
  if (newRawXml) {
6870
6880
  updates.rawXml = newRawXml;
6871
6881
  }
@@ -6878,12 +6888,12 @@ function createTableStructHandlers(input) {
6878
6888
  }
6879
6889
  const td = selectedElement.tableData;
6880
6890
  const rowIdx = ts?.rowIndex ?? 0;
6881
- const newTableData = chunkTWUAZRCG_js.deleteTableRow(td, rowIdx);
6891
+ const newTableData = chunk5KAMDV37_js.deleteTableRow(td, rowIdx);
6882
6892
  if (newTableData === td) {
6883
6893
  return;
6884
6894
  }
6885
6895
  const updates = { tableData: newTableData };
6886
- const newRawXml = chunkTWUAZRCG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6896
+ const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6887
6897
  if (newRawXml) {
6888
6898
  updates.rawXml = newRawXml;
6889
6899
  }
@@ -6895,9 +6905,9 @@ function createTableStructHandlers(input) {
6895
6905
  return;
6896
6906
  }
6897
6907
  const colIdx = ts?.columnIndex ?? 0;
6898
- const newTableData = chunkTWUAZRCG_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6908
+ const newTableData = chunk5KAMDV37_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6899
6909
  const updates = { tableData: newTableData };
6900
- const newRawXml = chunkTWUAZRCG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6910
+ const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6901
6911
  if (newRawXml) {
6902
6912
  updates.rawXml = newRawXml;
6903
6913
  }
@@ -6910,12 +6920,12 @@ function createTableStructHandlers(input) {
6910
6920
  }
6911
6921
  const td = selectedElement.tableData;
6912
6922
  const colIdx = ts?.columnIndex ?? 0;
6913
- const newTableData = chunkTWUAZRCG_js.deleteTableColumn(td, colIdx);
6923
+ const newTableData = chunk5KAMDV37_js.deleteTableColumn(td, colIdx);
6914
6924
  if (newTableData === td) {
6915
6925
  return;
6916
6926
  }
6917
6927
  const updates = { tableData: newTableData };
6918
- const newRawXml = chunkTWUAZRCG_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6928
+ const newRawXml = chunk5KAMDV37_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6919
6929
  if (newRawXml) {
6920
6930
  updates.rawXml = newRawXml;
6921
6931
  }
@@ -6951,8 +6961,8 @@ async function renderToCanvas(element, options = {}) {
6951
6961
  return html2canvasPro(element, {
6952
6962
  ...options,
6953
6963
  onclone: async (doc, clonedEl) => {
6954
- await chunkTWUAZRCG_js.normalizeColorsForCapture(doc, clonedEl);
6955
- chunkTWUAZRCG_js.preprocessCssForCapture(clonedEl);
6964
+ await chunk5KAMDV37_js.normalizeColorsForCapture(doc, clonedEl);
6965
+ chunk5KAMDV37_js.preprocessCssForCapture(clonedEl);
6956
6966
  if (typeof userOnClone === "function") {
6957
6967
  userOnClone(doc, clonedEl);
6958
6968
  }
@@ -6982,7 +6992,7 @@ function useExportSaveAs(input) {
6982
6992
  slideSizeEmu
6983
6993
  } = input;
6984
6994
  const handleSaveAsFormat = async (format) => {
6985
- const downloadName = chunkTWUAZRCG_js.savedPresentationFileName(filePath, format);
6995
+ const downloadName = chunk5KAMDV37_js.savedPresentationFileName(filePath, format);
6986
6996
  try {
6987
6997
  const data = await serializeSlides(format);
6988
6998
  if (!data) {
@@ -6990,16 +7000,16 @@ function useExportSaveAs(input) {
6990
7000
  }
6991
7001
  const mimeType = format === "ppt" ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation";
6992
7002
  const blob = new Blob([data], { type: mimeType });
6993
- chunkTWUAZRCG_js.downloadBlob(blob, downloadName);
7003
+ chunk5KAMDV37_js.downloadBlob(blob, downloadName);
6994
7004
  } catch (err) {
6995
7005
  console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
6996
7006
  }
6997
7007
  };
6998
7008
  const handleExportJson = () => {
6999
7009
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7000
- const slideSize = chunkTWUAZRCG_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7010
+ const slideSize = chunk5KAMDV37_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7001
7011
  const data = {
7002
- slides: chunkTWUAZRCG_js.buildSaveSlides(slides, templateElementsBySlideId),
7012
+ slides: chunk5KAMDV37_js.buildSaveSlides(slides, templateElementsBySlideId),
7003
7013
  width: canvasSize.width,
7004
7014
  height: canvasSize.height,
7005
7015
  widthEmu: slideSize.widthEmu,
@@ -7018,7 +7028,7 @@ function useExportSaveAs(input) {
7018
7028
  handoutMaster
7019
7029
  };
7020
7030
  try {
7021
- chunkTWUAZRCG_js.exportDeckJson(data, sourceName);
7031
+ chunk5KAMDV37_js.exportDeckJson(data, sourceName);
7022
7032
  } catch (err) {
7023
7033
  console.error("[PowerPointViewer] JSON export failed:", err);
7024
7034
  }
@@ -7045,22 +7055,6 @@ function useExportSaveAs(input) {
7045
7055
  };
7046
7056
  }
7047
7057
 
7048
- // src/viewer/utils/dom-helpers.ts
7049
- function safePrompt(message, defaultValue) {
7050
- try {
7051
- return window.prompt(message, defaultValue);
7052
- } catch {
7053
- return null;
7054
- }
7055
- }
7056
- function safeConfirm(message) {
7057
- try {
7058
- return window.confirm(message);
7059
- } catch {
7060
- return false;
7061
- }
7062
- }
7063
-
7064
7058
  // src/viewer/utils/export-helpers.ts
7065
7059
  function ignoreExportOverlayElements(el) {
7066
7060
  const htmlEl = el;
@@ -7099,7 +7093,7 @@ function buildRasterOptions(element, scale, backgroundColor, mode) {
7099
7093
  }
7100
7094
  async function renderElementToRaster(element, scale = 2, backgroundColor, mode = "auto") {
7101
7095
  const { width, height } = measureNaturalSize(element);
7102
- return chunkTWUAZRCG_js.rasterizeElement(
7096
+ return chunk5KAMDV37_js.rasterizeElement(
7103
7097
  element,
7104
7098
  width,
7105
7099
  height,
@@ -7109,7 +7103,7 @@ async function renderElementToRaster(element, scale = 2, backgroundColor, mode =
7109
7103
  }
7110
7104
  async function renderElementToTiles(element, scale = 2, backgroundColor, mode = "auto") {
7111
7105
  const { width, height } = measureNaturalSize(element);
7112
- return chunkTWUAZRCG_js.rasterizeElementTiles(
7106
+ return chunk5KAMDV37_js.rasterizeElementTiles(
7113
7107
  element,
7114
7108
  width,
7115
7109
  height,
@@ -7117,9 +7111,9 @@ async function renderElementToTiles(element, scale = 2, backgroundColor, mode =
7117
7111
  buildRasterOptions(element, scale, backgroundColor, mode)
7118
7112
  );
7119
7113
  }
7120
- async function renderElementToClampedCanvas(element, scale = 2, backgroundColor, mode = "auto") {
7114
+ async function renderElementToTiledCanvas(element, scale = 2, backgroundColor, mode = "auto") {
7121
7115
  const { width, height } = measureNaturalSize(element);
7122
- return chunkTWUAZRCG_js.rasterizeElementClampedToCanvas(
7116
+ return chunk5KAMDV37_js.rasterizeElementTiledToCanvas(
7123
7117
  element,
7124
7118
  width,
7125
7119
  height,
@@ -7141,11 +7135,11 @@ function waitForRender(ms = 100) {
7141
7135
  async function exportSlideToPngBlob(slideElement, options = {}) {
7142
7136
  const { scale = 2, backgroundColor } = options;
7143
7137
  const result = await renderElementToRaster(slideElement, scale, backgroundColor);
7144
- return chunkTWUAZRCG_js.rasterResultToPngBlob(result);
7138
+ return chunk5KAMDV37_js.rasterResultToPngBlob(result);
7145
7139
  }
7146
7140
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
7147
7141
  const blob = await exportSlideToPngBlob(slideElement, options);
7148
- chunkTWUAZRCG_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
7142
+ chunk5KAMDV37_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
7149
7143
  }
7150
7144
  async function copySlideToClipboard(slideElement, options = {}) {
7151
7145
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -7163,7 +7157,7 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
7163
7157
  console.warn(`[export] Could not find slide stage element for slide ${i}`);
7164
7158
  continue;
7165
7159
  }
7166
- const { canvas } = await renderElementToClampedCanvas(stageEl, scale);
7160
+ const { canvas } = await renderElementToTiledCanvas(stageEl, scale);
7167
7161
  dataUrls.push(canvas.toDataURL("image/png"));
7168
7162
  }
7169
7163
  onProgress?.(totalSlides, totalSlides);
@@ -7174,13 +7168,13 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
7174
7168
  // src/viewer/utils/export-pdf.ts
7175
7169
  function tilesToPdfPage(tilesResult) {
7176
7170
  return tilesResult.tiles.map((tile) => ({
7177
- image: chunkTWUAZRCG_js.canvasToJpegData(tile.canvas),
7178
- placement: chunkTWUAZRCG_js.placeTileOnPage(
7171
+ image: chunk5KAMDV37_js.canvasToJpegData(tile.canvas),
7172
+ placement: chunk5KAMDV37_js.placeTileOnPage(
7179
7173
  tile,
7180
7174
  tilesResult.fullWidth,
7181
7175
  tilesResult.fullHeight,
7182
- chunkTWUAZRCG_js.PDF_SLIDES_PAGE_WIDTH_PT,
7183
- chunkTWUAZRCG_js.PDF_SLIDES_PAGE_HEIGHT_PT
7176
+ chunk5KAMDV37_js.PDF_SLIDES_PAGE_WIDTH_PT,
7177
+ chunk5KAMDV37_js.PDF_SLIDES_PAGE_HEIGHT_PT
7184
7178
  )
7185
7179
  }));
7186
7180
  }
@@ -7207,8 +7201,8 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
7207
7201
  if (pages.length === 0) {
7208
7202
  throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
7209
7203
  }
7210
- const pdfBlobUrl = chunkIVCYND7A_js.buildPdfFromTiledImageData(pages);
7211
- chunkTWUAZRCG_js.downloadDataUrl(pdfBlobUrl, filename);
7204
+ const pdfBlobUrl = chunkGLY4OPMY_js.buildPdfFromTiledImageData(pages);
7205
+ chunk5KAMDV37_js.downloadDataUrl(pdfBlobUrl, filename);
7212
7206
  }
7213
7207
  async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
7214
7208
  const { scale = 2, onProgress, signal } = options;
@@ -7225,7 +7219,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
7225
7219
  console.warn(`[export] Could not find slide stage element for slide ${i}`);
7226
7220
  continue;
7227
7221
  }
7228
- const { canvas } = await renderElementToClampedCanvas(stageEl, scale);
7222
+ const { canvas } = await renderElementToTiledCanvas(stageEl, scale);
7229
7223
  pages.push({
7230
7224
  canvas,
7231
7225
  notes: slideNotes[i],
@@ -7237,8 +7231,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
7237
7231
  if (pages.length === 0) {
7238
7232
  throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
7239
7233
  }
7240
- const pdfDataUrl = chunkIVCYND7A_js.buildNotesPdf(pages);
7241
- chunkTWUAZRCG_js.downloadDataUrl(pdfDataUrl, filename);
7234
+ const pdfDataUrl = chunkGLY4OPMY_js.buildNotesPdf(pages);
7235
+ chunk5KAMDV37_js.downloadDataUrl(pdfDataUrl, filename);
7242
7236
  }
7243
7237
 
7244
7238
  // src/viewer/utils/export-video.ts
@@ -7264,7 +7258,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7264
7258
  console.warn(`[export] Could not find slide stage element for slide ${i}`);
7265
7259
  continue;
7266
7260
  }
7267
- const { canvas } = await renderElementToClampedCanvas(stageEl, scale);
7261
+ const { canvas } = await renderElementToTiledCanvas(stageEl, scale);
7268
7262
  slideCanvases.push(canvas);
7269
7263
  }
7270
7264
  setActiveSlide(currentSlideIndex);
@@ -7282,7 +7276,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7282
7276
  const fps = 30;
7283
7277
  const stream = recordingCanvas.captureStream(fps);
7284
7278
  const recorder = new MediaRecorder(stream, {
7285
- mimeType: chunkTWUAZRCG_js.pickSupportedMimeType([...chunkTWUAZRCG_js.WEBM_MIME_CANDIDATES]),
7279
+ mimeType: chunk5KAMDV37_js.pickSupportedMimeType([...chunk5KAMDV37_js.WEBM_MIME_CANDIDATES]),
7286
7280
  videoBitsPerSecond: 5e6
7287
7281
  });
7288
7282
  const chunks = [];
@@ -7305,8 +7299,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7305
7299
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
7306
7300
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
7307
7301
  ctx.drawImage(slideCanvases[i], 0, 0);
7308
- const frameInterval = chunkTWUAZRCG_js.fpsToFrameIntervalMs(fps);
7309
- const framesNeeded = chunkTWUAZRCG_js.segmentFrameCount(duration, fps);
7302
+ const frameInterval = chunk5KAMDV37_js.fpsToFrameIntervalMs(fps);
7303
+ const framesNeeded = chunk5KAMDV37_js.segmentFrameCount(duration, fps);
7310
7304
  for (let f = 0; f < framesNeeded; f++) {
7311
7305
  if (signal?.aborted) {
7312
7306
  recorder.stop();
@@ -7325,8 +7319,34 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7325
7319
  }
7326
7320
 
7327
7321
  // src/viewer/utils/export-gif.ts
7322
+ function frameFromCanvas(canvas, maxSide) {
7323
+ const { width, height } = chunk5KAMDV37_js.clampGifDimensions(canvas.width, canvas.height, maxSide);
7324
+ let source = canvas;
7325
+ if (width !== canvas.width || height !== canvas.height) {
7326
+ const scaled = canvas.ownerDocument.createElement("canvas");
7327
+ scaled.width = width;
7328
+ scaled.height = height;
7329
+ const scaledCtx = scaled.getContext("2d");
7330
+ if (!scaledCtx) {
7331
+ return void 0;
7332
+ }
7333
+ scaledCtx.drawImage(canvas, 0, 0, width, height);
7334
+ source = scaled;
7335
+ }
7336
+ const ctx = source.getContext("2d");
7337
+ if (!ctx) {
7338
+ return void 0;
7339
+ }
7340
+ return { imageData: ctx.getImageData(0, 0, width, height), width, height };
7341
+ }
7328
7342
  async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
7329
- const { scale = 0.5, slideDurationMs = 2e3, onProgress, signal } = options;
7343
+ const {
7344
+ scale = 0.5,
7345
+ slideDurationMs = 2e3,
7346
+ maxSide = chunk5KAMDV37_js.GIF_POST_CAPTURE_MAX_SIDE,
7347
+ onProgress,
7348
+ signal
7349
+ } = options;
7330
7350
  const frames = [];
7331
7351
  for (let i = 0; i < totalSlides; i++) {
7332
7352
  if (signal?.aborted) {
@@ -7339,23 +7359,18 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
7339
7359
  if (!stageEl) {
7340
7360
  continue;
7341
7361
  }
7342
- const { canvas } = await renderElementToClampedCanvas(stageEl, scale);
7343
- const ctx = canvas.getContext("2d");
7344
- if (!ctx) {
7362
+ const { canvas } = await renderElementToTiledCanvas(stageEl, scale);
7363
+ const frame = frameFromCanvas(canvas, maxSide);
7364
+ if (!frame) {
7345
7365
  continue;
7346
7366
  }
7347
- const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
7348
- frames.push({
7349
- imageData,
7350
- width: canvas.width,
7351
- height: canvas.height
7352
- });
7367
+ frames.push(frame);
7353
7368
  }
7354
7369
  setActiveSlide(currentSlideIndex);
7355
7370
  if (frames.length === 0) {
7356
7371
  throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
7357
7372
  }
7358
- const gifBytes = chunkTWUAZRCG_js.encodeGif(frames, Math.round(slideDurationMs / 10));
7373
+ const gifBytes = chunk5KAMDV37_js.encodeGif(frames, Math.round(slideDurationMs / 10));
7359
7374
  onProgress?.(totalSlides, totalSlides);
7360
7375
  const buf = new ArrayBuffer(gifBytes.length);
7361
7376
  new Uint8Array(buf).set(gifBytes);
@@ -7409,7 +7424,7 @@ function exportAllSlidesToSvg(data, options = {}) {
7409
7424
  continue;
7410
7425
  }
7411
7426
  onProgress?.(processedCount, data.slides.length);
7412
- let svg = chunkTWUAZRCG_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
7427
+ let svg = chunk5KAMDV37_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
7413
7428
  if (embedFonts && fontFaces?.length) {
7414
7429
  svg = injectFontFaces(svg, fontFaces);
7415
7430
  }
@@ -7420,6 +7435,149 @@ function exportAllSlidesToSvg(data, options = {}) {
7420
7435
  return results;
7421
7436
  }
7422
7437
 
7438
+ // src/viewer/utils/dom-helpers.ts
7439
+ function safePrompt(message, defaultValue) {
7440
+ try {
7441
+ return window.prompt(message, defaultValue);
7442
+ } catch {
7443
+ return null;
7444
+ }
7445
+ }
7446
+ function safeConfirm(message) {
7447
+ try {
7448
+ return window.confirm(message);
7449
+ } catch {
7450
+ return false;
7451
+ }
7452
+ }
7453
+
7454
+ // src/viewer/hooks/useExportMediaHandlers.ts
7455
+ function useExportMediaHandlers(input) {
7456
+ const {
7457
+ slides,
7458
+ activeSlideIndex,
7459
+ canvasStageRef,
7460
+ setActiveSlideIndex,
7461
+ imageResolutionScale = 1,
7462
+ exportAbortRef,
7463
+ setExportModalOpen,
7464
+ setExportModalTitle,
7465
+ setExportProgress,
7466
+ setExportStatusMessage
7467
+ } = input;
7468
+ const handleExportVideo = react.useCallback(async () => {
7469
+ if (!canvasStageRef.current) {
7470
+ return;
7471
+ }
7472
+ const abortCtrl = new AbortController();
7473
+ exportAbortRef.current = abortCtrl;
7474
+ setExportModalTitle("Export as Video");
7475
+ setExportStatusMessage("Capturing slides...");
7476
+ setExportProgress(0);
7477
+ setExportModalOpen(true);
7478
+ try {
7479
+ const { scale } = chunk5KAMDV37_js.resolveExportCaptureDecision(imageResolutionScale, "video");
7480
+ const blob = await exportAllSlidesAsVideo(
7481
+ canvasStageRef,
7482
+ slides.length,
7483
+ setActiveSlideIndex,
7484
+ activeSlideIndex,
7485
+ {
7486
+ scale,
7487
+ slideDurationMs: 3e3,
7488
+ onProgress: (current, total) => {
7489
+ setExportProgress(chunk5KAMDV37_js.slideProgressPercent(current, total, 45));
7490
+ setExportStatusMessage(chunk5KAMDV37_js.slideStatusLabel("Capturing", current, total));
7491
+ },
7492
+ onRecordProgress: (current, total) => {
7493
+ setExportProgress(chunk5KAMDV37_js.recordProgressPercent(current, total));
7494
+ setExportStatusMessage(chunk5KAMDV37_js.slideStatusLabel("Recording", current, total));
7495
+ },
7496
+ signal: abortCtrl.signal
7497
+ }
7498
+ );
7499
+ setExportProgress(chunk5KAMDV37_js.EXPORT_ASSEMBLING_PERCENT);
7500
+ setExportStatusMessage("Saving file...");
7501
+ chunk5KAMDV37_js.downloadBlob(blob, "presentation.webm");
7502
+ setExportProgress(chunk5KAMDV37_js.EXPORT_DONE_PERCENT);
7503
+ } catch (err) {
7504
+ if (!chunk5KAMDV37_js.isExportAbortError(err)) {
7505
+ console.error("[PowerPointViewer] Video export failed:", err);
7506
+ }
7507
+ } finally {
7508
+ exportAbortRef.current = null;
7509
+ setExportModalOpen(false);
7510
+ }
7511
+ }, [
7512
+ canvasStageRef,
7513
+ slides.length,
7514
+ setActiveSlideIndex,
7515
+ activeSlideIndex,
7516
+ imageResolutionScale,
7517
+ exportAbortRef,
7518
+ setExportModalOpen,
7519
+ setExportModalTitle,
7520
+ setExportProgress,
7521
+ setExportStatusMessage
7522
+ ]);
7523
+ const handleExportGif = react.useCallback(async () => {
7524
+ if (!canvasStageRef.current) {
7525
+ return;
7526
+ }
7527
+ const abortCtrl = new AbortController();
7528
+ exportAbortRef.current = abortCtrl;
7529
+ setExportModalTitle("Export as GIF");
7530
+ setExportStatusMessage("Capturing slides...");
7531
+ setExportProgress(0);
7532
+ setExportModalOpen(true);
7533
+ try {
7534
+ const { scale, postCaptureMaxSide } = chunk5KAMDV37_js.resolveExportCaptureDecision(
7535
+ imageResolutionScale,
7536
+ "gif"
7537
+ );
7538
+ const blob = await exportAllSlidesAsGif(
7539
+ canvasStageRef,
7540
+ slides.length,
7541
+ setActiveSlideIndex,
7542
+ activeSlideIndex,
7543
+ {
7544
+ scale,
7545
+ maxSide: postCaptureMaxSide,
7546
+ slideDurationMs: 2e3,
7547
+ onProgress: (current, total) => {
7548
+ setExportProgress(chunk5KAMDV37_js.slideProgressPercent(current, total));
7549
+ setExportStatusMessage(chunk5KAMDV37_js.slideStatusLabel("Encoding", current, total));
7550
+ },
7551
+ signal: abortCtrl.signal
7552
+ }
7553
+ );
7554
+ setExportProgress(chunk5KAMDV37_js.EXPORT_ASSEMBLING_PERCENT);
7555
+ setExportStatusMessage("Saving file...");
7556
+ chunk5KAMDV37_js.downloadBlob(blob, "presentation.gif");
7557
+ setExportProgress(chunk5KAMDV37_js.EXPORT_DONE_PERCENT);
7558
+ } catch (err) {
7559
+ if (!chunk5KAMDV37_js.isExportAbortError(err)) {
7560
+ console.error("[PowerPointViewer] GIF export failed:", err);
7561
+ }
7562
+ } finally {
7563
+ exportAbortRef.current = null;
7564
+ setExportModalOpen(false);
7565
+ }
7566
+ }, [
7567
+ canvasStageRef,
7568
+ slides.length,
7569
+ setActiveSlideIndex,
7570
+ activeSlideIndex,
7571
+ imageResolutionScale,
7572
+ exportAbortRef,
7573
+ setExportModalOpen,
7574
+ setExportModalTitle,
7575
+ setExportProgress,
7576
+ setExportStatusMessage
7577
+ ]);
7578
+ return { handleExportVideo, handleExportGif };
7579
+ }
7580
+
7423
7581
  // src/viewer/hooks/useExportHandlers.ts
7424
7582
  function useExportHandlers(input) {
7425
7583
  const {
@@ -7444,13 +7602,26 @@ function useExportHandlers(input) {
7444
7602
  theme,
7445
7603
  canvasSize,
7446
7604
  slideSizeEmu,
7447
- imageExportScale
7605
+ imageExportScale,
7606
+ imageResolutionScale
7448
7607
  } = input;
7449
7608
  const [exportModalOpen, setExportModalOpen] = react.useState(false);
7450
7609
  const [exportModalTitle, setExportModalTitle] = react.useState("");
7451
7610
  const [exportProgress, setExportProgress] = react.useState(0);
7452
7611
  const [exportStatusMessage, setExportStatusMessage] = react.useState("");
7453
7612
  const exportAbortRef = react.useRef(null);
7613
+ const { handleExportVideo, handleExportGif } = useExportMediaHandlers({
7614
+ slides,
7615
+ activeSlideIndex,
7616
+ canvasStageRef,
7617
+ setActiveSlideIndex,
7618
+ imageResolutionScale,
7619
+ exportAbortRef,
7620
+ setExportModalOpen,
7621
+ setExportModalTitle,
7622
+ setExportProgress,
7623
+ setExportStatusMessage
7624
+ });
7454
7625
  const {
7455
7626
  handleExportJson,
7456
7627
  handleSaveAsFormat,
@@ -7511,21 +7682,21 @@ function useExportHandlers(input) {
7511
7682
  {
7512
7683
  scale: imageExportScale,
7513
7684
  onProgress: (current, total) => {
7514
- setExportProgress(chunkTWUAZRCG_js.slideProgressPercent(current, total));
7515
- setExportStatusMessage(chunkTWUAZRCG_js.slideStatusLabel("Rendering", current, total));
7685
+ setExportProgress(chunk5KAMDV37_js.slideProgressPercent(current, total));
7686
+ setExportStatusMessage(chunk5KAMDV37_js.slideStatusLabel("Rendering", current, total));
7516
7687
  },
7517
7688
  signal: abortCtrl.signal
7518
7689
  }
7519
7690
  );
7520
- setExportProgress(chunkTWUAZRCG_js.EXPORT_ASSEMBLING_PERCENT);
7691
+ setExportProgress(chunk5KAMDV37_js.EXPORT_ASSEMBLING_PERCENT);
7521
7692
  setExportStatusMessage("Building PDF...");
7522
7693
  await new Promise((r) => {
7523
7694
  setTimeout(r, 100);
7524
7695
  });
7525
- setExportProgress(chunkTWUAZRCG_js.EXPORT_DONE_PERCENT);
7696
+ setExportProgress(chunk5KAMDV37_js.EXPORT_DONE_PERCENT);
7526
7697
  setExportStatusMessage("Done!");
7527
7698
  } catch (err) {
7528
- if (!chunkTWUAZRCG_js.isExportAbortError(err)) {
7699
+ if (!chunk5KAMDV37_js.isExportAbortError(err)) {
7529
7700
  console.error("[PowerPointViewer] PDF export failed:", err);
7530
7701
  }
7531
7702
  } finally {
@@ -7555,21 +7726,21 @@ function useExportHandlers(input) {
7555
7726
  {
7556
7727
  scale: imageExportScale,
7557
7728
  onProgress: (current, total) => {
7558
- setExportProgress(chunkTWUAZRCG_js.slideProgressPercent(current, total));
7559
- setExportStatusMessage(chunkTWUAZRCG_js.slideStatusLabel("Rendering", current, total));
7729
+ setExportProgress(chunk5KAMDV37_js.slideProgressPercent(current, total));
7730
+ setExportStatusMessage(chunk5KAMDV37_js.slideStatusLabel("Rendering", current, total));
7560
7731
  },
7561
7732
  signal: abortCtrl.signal
7562
7733
  }
7563
7734
  );
7564
- setExportProgress(chunkTWUAZRCG_js.EXPORT_ASSEMBLING_PERCENT);
7735
+ setExportProgress(chunk5KAMDV37_js.EXPORT_ASSEMBLING_PERCENT);
7565
7736
  setExportStatusMessage("Building PDF...");
7566
7737
  await new Promise((r) => {
7567
7738
  setTimeout(r, 100);
7568
7739
  });
7569
- setExportProgress(chunkTWUAZRCG_js.EXPORT_DONE_PERCENT);
7740
+ setExportProgress(chunk5KAMDV37_js.EXPORT_DONE_PERCENT);
7570
7741
  setExportStatusMessage("Done!");
7571
7742
  } catch (err) {
7572
- if (!chunkTWUAZRCG_js.isExportAbortError(err)) {
7743
+ if (!chunk5KAMDV37_js.isExportAbortError(err)) {
7573
7744
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7574
7745
  }
7575
7746
  } finally {
@@ -7591,88 +7762,6 @@ function useExportHandlers(input) {
7591
7762
  console.error("[PowerPointViewer] Copy slide as image failed:", err);
7592
7763
  }
7593
7764
  }, [canvasStageRef, activeSlide?.backgroundColor, imageExportScale]);
7594
- const handleExportVideo = react.useCallback(async () => {
7595
- if (!canvasStageRef.current) {
7596
- return;
7597
- }
7598
- const abortCtrl = new AbortController();
7599
- exportAbortRef.current = abortCtrl;
7600
- setExportModalTitle("Export as Video");
7601
- setExportStatusMessage("Capturing slides...");
7602
- setExportProgress(0);
7603
- setExportModalOpen(true);
7604
- try {
7605
- const blob = await exportAllSlidesAsVideo(
7606
- canvasStageRef,
7607
- slides.length,
7608
- setActiveSlideIndex,
7609
- activeSlideIndex,
7610
- {
7611
- scale: 1,
7612
- slideDurationMs: 3e3,
7613
- onProgress: (current, total) => {
7614
- setExportProgress(chunkTWUAZRCG_js.slideProgressPercent(current, total, 45));
7615
- setExportStatusMessage(chunkTWUAZRCG_js.slideStatusLabel("Capturing", current, total));
7616
- },
7617
- onRecordProgress: (current, total) => {
7618
- setExportProgress(chunkTWUAZRCG_js.recordProgressPercent(current, total));
7619
- setExportStatusMessage(chunkTWUAZRCG_js.slideStatusLabel("Recording", current, total));
7620
- },
7621
- signal: abortCtrl.signal
7622
- }
7623
- );
7624
- setExportProgress(chunkTWUAZRCG_js.EXPORT_ASSEMBLING_PERCENT);
7625
- setExportStatusMessage("Saving file...");
7626
- chunkTWUAZRCG_js.downloadBlob(blob, "presentation.webm");
7627
- setExportProgress(chunkTWUAZRCG_js.EXPORT_DONE_PERCENT);
7628
- } catch (err) {
7629
- if (!chunkTWUAZRCG_js.isExportAbortError(err)) {
7630
- console.error("[PowerPointViewer] Video export failed:", err);
7631
- }
7632
- } finally {
7633
- exportAbortRef.current = null;
7634
- setExportModalOpen(false);
7635
- }
7636
- }, [canvasStageRef, slides.length, setActiveSlideIndex, activeSlideIndex]);
7637
- const handleExportGif = react.useCallback(async () => {
7638
- if (!canvasStageRef.current) {
7639
- return;
7640
- }
7641
- const abortCtrl = new AbortController();
7642
- exportAbortRef.current = abortCtrl;
7643
- setExportModalTitle("Export as GIF");
7644
- setExportStatusMessage("Capturing slides...");
7645
- setExportProgress(0);
7646
- setExportModalOpen(true);
7647
- try {
7648
- const blob = await exportAllSlidesAsGif(
7649
- canvasStageRef,
7650
- slides.length,
7651
- setActiveSlideIndex,
7652
- activeSlideIndex,
7653
- {
7654
- scale: 0.5,
7655
- slideDurationMs: 2e3,
7656
- onProgress: (current, total) => {
7657
- setExportProgress(chunkTWUAZRCG_js.slideProgressPercent(current, total));
7658
- setExportStatusMessage(chunkTWUAZRCG_js.slideStatusLabel("Encoding", current, total));
7659
- },
7660
- signal: abortCtrl.signal
7661
- }
7662
- );
7663
- setExportProgress(chunkTWUAZRCG_js.EXPORT_ASSEMBLING_PERCENT);
7664
- setExportStatusMessage("Saving file...");
7665
- chunkTWUAZRCG_js.downloadBlob(blob, "presentation.gif");
7666
- setExportProgress(chunkTWUAZRCG_js.EXPORT_DONE_PERCENT);
7667
- } catch (err) {
7668
- if (!chunkTWUAZRCG_js.isExportAbortError(err)) {
7669
- console.error("[PowerPointViewer] GIF export failed:", err);
7670
- }
7671
- } finally {
7672
- exportAbortRef.current = null;
7673
- setExportModalOpen(false);
7674
- }
7675
- }, [canvasStageRef, slides.length, setActiveSlideIndex, activeSlideIndex]);
7676
7765
  const handleCancelExport = react.useCallback(() => {
7677
7766
  exportAbortRef.current?.abort();
7678
7767
  exportAbortRef.current = null;
@@ -7699,7 +7788,7 @@ function useExportHandlers(input) {
7699
7788
  exportStatusMessage
7700
7789
  };
7701
7790
  }
7702
- var ViewerOptionsContext = react.createContext(chunkTWUAZRCG_js.DEFAULT_VIEWER_OPTIONS);
7791
+ var ViewerOptionsContext = react.createContext(chunk5KAMDV37_js.DEFAULT_VIEWER_OPTIONS);
7703
7792
  function useViewerOptionsContext() {
7704
7793
  return react.useContext(ViewerOptionsContext);
7705
7794
  }
@@ -7711,13 +7800,13 @@ function usePrintHandlers(input) {
7711
7800
  const { t } = reactI18next.useTranslation();
7712
7801
  const viewerOptions = useViewerOptionsContext();
7713
7802
  const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
7714
- const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkTWUAZRCG_js.resolveImageResolutionScale(viewerOptions);
7803
+ const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunk5KAMDV37_js.resolveImageResolutionScale(viewerOptions);
7715
7804
  const handlePrint = () => {
7716
7805
  setIsPrintDialogOpen(true);
7717
7806
  };
7718
7807
  const handlePrintSvg = async (settings) => {
7719
7808
  setIsPrintDialogOpen(false);
7720
- const printWindow = chunkTWUAZRCG_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7809
+ const printWindow = chunk5KAMDV37_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7721
7810
  if (!printWindow) {
7722
7811
  console.warn(
7723
7812
  "[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
@@ -7727,9 +7816,9 @@ function usePrintHandlers(input) {
7727
7816
  if (!pptxData || settings.printWhat !== "slides") {
7728
7817
  return runRasterPrint(printWindow, settings);
7729
7818
  }
7730
- const colorFilter = chunkTWUAZRCG_js.computeColorFilter(settings.colorMode);
7731
- const slideIndices = chunkTWUAZRCG_js.filterHiddenSlideIndices(
7732
- chunkTWUAZRCG_js.computeSlideIndices(
7819
+ const colorFilter = chunk5KAMDV37_js.computeColorFilter(settings.colorMode);
7820
+ const slideIndices = chunk5KAMDV37_js.filterHiddenSlideIndices(
7821
+ chunk5KAMDV37_js.computeSlideIndices(
7733
7822
  settings.slideRange,
7734
7823
  activeSlideIndex,
7735
7824
  slides.length,
@@ -7747,22 +7836,22 @@ function usePrintHandlers(input) {
7747
7836
  printWindow.close();
7748
7837
  return;
7749
7838
  }
7750
- const printDoc = chunkTWUAZRCG_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7839
+ const printDoc = chunk5KAMDV37_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7751
7840
  title: "Slides (Vector)",
7752
7841
  orientation: settings.orientation,
7753
7842
  colorFilter,
7754
7843
  scaleToFit: settings.scaleToFit
7755
7844
  });
7756
- chunkTWUAZRCG_js.finishPrintWindow(printWindow, printDoc);
7845
+ chunk5KAMDV37_js.finishPrintWindow(printWindow, printDoc);
7757
7846
  } catch (err) {
7758
7847
  console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
7759
7848
  return runRasterPrint(printWindow, settings);
7760
7849
  }
7761
7850
  };
7762
7851
  const runRasterPrint = async (printWindow, settings) => {
7763
- const colorFilter = chunkTWUAZRCG_js.computeColorFilter(settings.colorMode);
7764
- const slideIndices = chunkTWUAZRCG_js.filterHiddenSlideIndices(
7765
- chunkTWUAZRCG_js.computeSlideIndices(
7852
+ const colorFilter = chunk5KAMDV37_js.computeColorFilter(settings.colorMode);
7853
+ const slideIndices = chunk5KAMDV37_js.filterHiddenSlideIndices(
7854
+ chunk5KAMDV37_js.computeSlideIndices(
7766
7855
  settings.slideRange,
7767
7856
  activeSlideIndex,
7768
7857
  slides.length,
@@ -7773,11 +7862,11 @@ function usePrintHandlers(input) {
7773
7862
  includeHiddenSlides
7774
7863
  );
7775
7864
  if (settings.printWhat === "outline") {
7776
- chunkTWUAZRCG_js.finishPrintWindow(
7865
+ chunk5KAMDV37_js.finishPrintWindow(
7777
7866
  printWindow,
7778
- chunkTWUAZRCG_js.buildPrintHtmlDocument({
7867
+ chunk5KAMDV37_js.buildPrintHtmlDocument({
7779
7868
  title: "Outline",
7780
- bodyHtml: `<div class="outline-page">${chunkTWUAZRCG_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7869
+ bodyHtml: `<div class="outline-page">${chunk5KAMDV37_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7781
7870
  orientation: settings.orientation,
7782
7871
  colorFilter,
7783
7872
  frameSlides: settings.frameSlides,
@@ -7804,11 +7893,11 @@ function usePrintHandlers(input) {
7804
7893
  }
7805
7894
  const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
7806
7895
  if (settings.printWhat === "slides") {
7807
- chunkTWUAZRCG_js.finishPrintWindow(
7896
+ chunk5KAMDV37_js.finishPrintWindow(
7808
7897
  printWindow,
7809
- chunkTWUAZRCG_js.buildPrintHtmlDocument({
7898
+ chunk5KAMDV37_js.buildPrintHtmlDocument({
7810
7899
  title: "Slides",
7811
- bodyHtml: chunkTWUAZRCG_js.buildSlidesHtml(slideImages, slideIndices),
7900
+ bodyHtml: chunk5KAMDV37_js.buildSlidesHtml(slideImages, slideIndices),
7812
7901
  orientation: settings.orientation,
7813
7902
  colorFilter,
7814
7903
  frameSlides: settings.frameSlides,
@@ -7818,11 +7907,11 @@ function usePrintHandlers(input) {
7818
7907
  return;
7819
7908
  }
7820
7909
  if (settings.printWhat === "notes") {
7821
- chunkTWUAZRCG_js.finishPrintWindow(
7910
+ chunk5KAMDV37_js.finishPrintWindow(
7822
7911
  printWindow,
7823
- chunkTWUAZRCG_js.buildPrintHtmlDocument({
7912
+ chunk5KAMDV37_js.buildPrintHtmlDocument({
7824
7913
  title: "Notes Pages",
7825
- bodyHtml: chunkTWUAZRCG_js.buildNotesHtml(slideImages, slideIndices, slides),
7914
+ bodyHtml: chunk5KAMDV37_js.buildNotesHtml(slideImages, slideIndices, slides),
7826
7915
  orientation: "portrait",
7827
7916
  colorFilter,
7828
7917
  frameSlides: settings.frameSlides,
@@ -7833,11 +7922,11 @@ function usePrintHandlers(input) {
7833
7922
  }
7834
7923
  if (settings.printWhat === "handouts") {
7835
7924
  const spp = settings.slidesPerPage;
7836
- chunkTWUAZRCG_js.finishPrintWindow(
7925
+ chunk5KAMDV37_js.finishPrintWindow(
7837
7926
  printWindow,
7838
- chunkTWUAZRCG_js.buildPrintHtmlDocument({
7927
+ chunk5KAMDV37_js.buildPrintHtmlDocument({
7839
7928
  title: `Handout ${spp} per page`,
7840
- bodyHtml: chunkTWUAZRCG_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
7929
+ bodyHtml: chunk5KAMDV37_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
7841
7930
  orientation: "portrait",
7842
7931
  colorFilter,
7843
7932
  frameSlides: settings.frameSlides,
@@ -7851,7 +7940,7 @@ function usePrintHandlers(input) {
7851
7940
  };
7852
7941
  const handlePrintWithSettings = async (settings) => {
7853
7942
  setIsPrintDialogOpen(false);
7854
- const printWindow = chunkTWUAZRCG_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7943
+ const printWindow = chunk5KAMDV37_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7855
7944
  if (!printWindow) {
7856
7945
  console.warn(
7857
7946
  "[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
@@ -7916,13 +8005,13 @@ function useThemeHandlers(input) {
7916
8005
  return;
7917
8006
  }
7918
8007
  await handler.updateThemeColorScheme(colorScheme);
7919
- const previousMap = theme?.colorScheme ? chunkTWUAZRCG_js.buildThemeColorMap(theme.colorScheme) : {};
7920
- setSlides((prev) => chunkTWUAZRCG_js.reResolveSlideColors(prev, previousMap, colorScheme));
8008
+ const previousMap = theme?.colorScheme ? chunk5KAMDV37_js.buildThemeColorMap(theme.colorScheme) : {};
8009
+ setSlides((prev) => chunk5KAMDV37_js.reResolveSlideColors(prev, previousMap, colorScheme));
7921
8010
  if (Object.keys(templateElementsBySlideId).length > 0) {
7922
8011
  setTemplateElementsBySlideId((prev) => {
7923
8012
  const next = {};
7924
8013
  for (const [slideId, elements] of Object.entries(prev)) {
7925
- next[slideId] = chunkTWUAZRCG_js.reResolveElementColors(elements, previousMap, colorScheme);
8014
+ next[slideId] = chunk5KAMDV37_js.reResolveElementColors(elements, previousMap, colorScheme);
7926
8015
  }
7927
8016
  return next;
7928
8017
  });
@@ -8031,7 +8120,7 @@ function useThemeSwitching(input) {
8031
8120
  }
8032
8121
  try {
8033
8122
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
8034
- const newData = chunkTWUAZRCG_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
8123
+ const newData = chunk5KAMDV37_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
8035
8124
  onDataChange(newData);
8036
8125
  onThemeChanged?.(preset);
8037
8126
  } catch (error) {
@@ -8048,7 +8137,7 @@ function useThemeSwitching(input) {
8048
8137
  }
8049
8138
  try {
8050
8139
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
8051
- const newData = chunkTWUAZRCG_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
8140
+ const newData = chunk5KAMDV37_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
8052
8141
  onDataChange(newData);
8053
8142
  } catch (error) {
8054
8143
  console.error("Failed to switch to custom theme:", error);
@@ -8060,12 +8149,12 @@ function useThemeSwitching(input) {
8060
8149
  if (!data?.theme?.colorScheme) {
8061
8150
  return void 0;
8062
8151
  }
8063
- return chunkTWUAZRCG_js.THEME_PRESETS.find(
8064
- (p) => chunkTWUAZRCG_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
8152
+ return chunk5KAMDV37_js.THEME_PRESETS.find(
8153
+ (p) => chunk5KAMDV37_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
8065
8154
  );
8066
8155
  }, [data?.theme?.colorScheme]);
8067
8156
  return {
8068
- presets: chunkTWUAZRCG_js.THEME_PRESETS,
8157
+ presets: chunk5KAMDV37_js.THEME_PRESETS,
8069
8158
  switchToPreset,
8070
8159
  switchToCustom,
8071
8160
  currentPreset
@@ -8140,7 +8229,7 @@ function usePropertyHandlers(input) {
8140
8229
  }
8141
8230
  try {
8142
8231
  const ab = await file.arrayBuffer();
8143
- const h = new chunkTWUAZRCG_js.PptxHandler();
8232
+ const h = new chunk5KAMDV37_js.PptxHandler();
8144
8233
  const other = await h.load(ab);
8145
8234
  if (!other) {
8146
8235
  return;
@@ -8150,7 +8239,7 @@ function usePropertyHandlers(input) {
8150
8239
  width: canvasSize.width,
8151
8240
  height: canvasSize.height
8152
8241
  };
8153
- setCompareResult(chunkTWUAZRCG_js.comparePresentation(cur, other));
8242
+ setCompareResult(chunk5KAMDV37_js.comparePresentation(cur, other));
8154
8243
  setIsComparePanelOpen(true);
8155
8244
  } catch (err) {
8156
8245
  console.warn("Compare failed:", err);
@@ -8167,7 +8256,7 @@ function usePropertyHandlers(input) {
8167
8256
  if (!diff || diff.status === "unchanged") {
8168
8257
  return;
8169
8258
  }
8170
- setSlides((prev) => chunkTWUAZRCG_js.applyAcceptSlide(prev, diff));
8259
+ setSlides((prev) => chunk5KAMDV37_js.applyAcceptSlide(prev, diff));
8171
8260
  setIsDirty(true);
8172
8261
  },
8173
8262
  [compareResult, setSlides, setIsDirty]
@@ -8178,10 +8267,10 @@ function usePropertyHandlers(input) {
8178
8267
  if (!compareResult) {
8179
8268
  return;
8180
8269
  }
8181
- setSlides((prev) => chunkTWUAZRCG_js.applyAcceptAllSlides(prev, compareResult));
8270
+ setSlides((prev) => chunk5KAMDV37_js.applyAcceptAllSlides(prev, compareResult));
8182
8271
  setIsDirty(true);
8183
8272
  }, [compareResult, setSlides, setIsDirty]);
8184
- const usedFontFamilies = react.useMemo(() => chunkTWUAZRCG_js.collectUsedFonts(slides), [slides]);
8273
+ const usedFontFamilies = react.useMemo(() => chunk5KAMDV37_js.collectUsedFonts(slides), [slides]);
8185
8274
  return {
8186
8275
  handleUpdateNotes,
8187
8276
  handleUpdateSlide,
@@ -8336,7 +8425,7 @@ function useViewerDialogs(input) {
8336
8425
  );
8337
8426
  const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8338
8427
  const fontEmbedding = react.useMemo(
8339
- () => chunkTWUAZRCG_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8428
+ () => chunk5KAMDV37_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8340
8429
  [embeddedFontKey]
8341
8430
  );
8342
8431
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
@@ -8346,11 +8435,11 @@ function useViewerDialogs(input) {
8346
8435
  setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8347
8436
  }
8348
8437
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8349
- () => typeof window !== "undefined" ? chunkTWUAZRCG_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8438
+ () => typeof window !== "undefined" ? chunk5KAMDV37_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8350
8439
  );
8351
8440
  react.useEffect(() => {
8352
8441
  const handleWindow = () => setIsNarrowViewport(
8353
- chunkTWUAZRCG_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8442
+ chunk5KAMDV37_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8354
8443
  );
8355
8444
  window.addEventListener("resize", handleWindow);
8356
8445
  return () => window.removeEventListener("resize", handleWindow);
@@ -8503,16 +8592,16 @@ function useViewerDialogs(input) {
8503
8592
  };
8504
8593
  }
8505
8594
  function computeGridSpacingPx2(documentGridSpacing) {
8506
- return chunkTWUAZRCG_js.computeGridSpacingPx(documentGridSpacing, chunkIVCYND7A_js.GRID_SIZE);
8595
+ return chunk5KAMDV37_js.computeGridSpacingPx(documentGridSpacing, chunkGLY4OPMY_js.GRID_SIZE);
8507
8596
  }
8508
8597
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
8509
8598
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8510
- const authoredRange = chunkTWUAZRCG_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
8511
- return chunkTWUAZRCG_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
8599
+ const authoredRange = chunk5KAMDV37_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
8600
+ return chunk5KAMDV37_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
8512
8601
  }
8513
8602
  function computeSlideSectionGroups(slides, sections) {
8514
- return chunkTWUAZRCG_js.groupSlidesBySection(sections, slides).map((group) => ({
8515
- id: group.section?.id ?? (sections.length > 0 ? chunkIVCYND7A_js.UNGROUPED_SECTION_ID : chunkIVCYND7A_js.DEFAULT_SECTION_GROUP_ID),
8603
+ return chunk5KAMDV37_js.groupSlidesBySection(sections, slides).map((group) => ({
8604
+ id: group.section?.id ?? (sections.length > 0 ? chunkGLY4OPMY_js.UNGROUPED_SECTION_ID : chunkGLY4OPMY_js.DEFAULT_SECTION_GROUP_ID),
8516
8605
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8517
8606
  slideIndexes: group.slideIndexes,
8518
8607
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8524,7 +8613,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8524
8613
  return void 0;
8525
8614
  }
8526
8615
  const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8527
- return chunkTWUAZRCG_js.masterViewPseudoSlide(document2, {
8616
+ return chunk5KAMDV37_js.masterViewPseudoSlide(document2, {
8528
8617
  tab: "slides",
8529
8618
  masterIndex: 0,
8530
8619
  layoutIndex: activeLayout ? 0 : null
@@ -8552,15 +8641,15 @@ function useDerivedSlideState(input) {
8552
8641
  [slides, activeCustomShowId, customShows, presentationProperties]
8553
8642
  );
8554
8643
  const authoredRange = react.useMemo(
8555
- () => chunkTWUAZRCG_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
8644
+ () => chunk5KAMDV37_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
8556
8645
  [presentationProperties, slides.length]
8557
8646
  );
8558
8647
  const slideSectionGroups = react.useMemo(
8559
8648
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8560
- if (group.id === chunkIVCYND7A_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8649
+ if (group.id === chunkGLY4OPMY_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8561
8650
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8562
8651
  }
8563
- if (group.id === chunkIVCYND7A_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8652
+ if (group.id === chunkGLY4OPMY_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8564
8653
  return { ...group, label: t("pptx.sections.slides") };
8565
8654
  }
8566
8655
  return group;
@@ -8661,13 +8750,13 @@ function useAnnotationHandlers(input) {
8661
8750
  }, [annotations, setMode, setSlides, history]);
8662
8751
  const handleSetMode = react.useCallback(
8663
8752
  (nextMode) => {
8664
- if (mode === "present" && nextMode !== "present" && !chunkTWUAZRCG_js.mayLeaveSlideShow()) {
8753
+ if (mode === "present" && nextMode !== "present" && !chunk5KAMDV37_js.mayLeaveSlideShow()) {
8665
8754
  return;
8666
8755
  }
8667
8756
  if (nextMode === "present") {
8668
8757
  presentation.enterPresentMode();
8669
8758
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8670
- chunkTWUAZRCG_js.stopAllPersistentAudio();
8759
+ chunk5KAMDV37_js.stopAllPersistentAudio();
8671
8760
  if (promptKeepInkAnnotations) {
8672
8761
  pendingModeAfterAnnotationsRef.current = nextMode;
8673
8762
  setShowKeepAnnotationsDialog(true);
@@ -8677,7 +8766,7 @@ function useAnnotationHandlers(input) {
8677
8766
  }
8678
8767
  } else {
8679
8768
  if (mode === "present") {
8680
- chunkTWUAZRCG_js.stopAllPersistentAudio();
8769
+ chunk5KAMDV37_js.stopAllPersistentAudio();
8681
8770
  }
8682
8771
  setMode(nextMode);
8683
8772
  }
@@ -8746,13 +8835,13 @@ function useSerialize(input) {
8746
8835
  let processedSlide = slide;
8747
8836
  if (pendingEditId) {
8748
8837
  const updatedElements = slide.elements.map((el) => {
8749
- if (el.id !== pendingEditId || !chunkTWUAZRCG_js.hasTextProperties(el)) {
8838
+ if (el.id !== pendingEditId || !chunk5KAMDV37_js.hasTextProperties(el)) {
8750
8839
  return el;
8751
8840
  }
8752
8841
  return {
8753
8842
  ...el,
8754
8843
  text: pendingEditText,
8755
- textSegments: chunkTWUAZRCG_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8844
+ textSegments: chunk5KAMDV37_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8756
8845
  };
8757
8846
  });
8758
8847
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8765,19 +8854,19 @@ function useSerialize(input) {
8765
8854
  const pptxGuides = guides.map((g) => ({
8766
8855
  id: g.id,
8767
8856
  orientation: g.axis === "h" ? "horz" : "vert",
8768
- positionEmu: chunkTWUAZRCG_js.guidePxToEmu(g.position)
8857
+ positionEmu: chunk5KAMDV37_js.guidePxToEmu(g.position)
8769
8858
  }));
8770
8859
  return {
8771
8860
  ...processedSlide,
8772
8861
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8773
8862
  };
8774
8863
  });
8775
- const slidesToSave = chunkTWUAZRCG_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8776
- const saveOptions = chunkTWUAZRCG_js.buildDeckSaveOptions({
8864
+ const slidesToSave = chunk5KAMDV37_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8865
+ const saveOptions = chunk5KAMDV37_js.buildDeckSaveOptions({
8777
8866
  // Without this the Slide Size card edited a viewer-only pixel value and
8778
8867
  // the saved `p:sldSz` never moved: passing `slideSize` is the only way a
8779
8868
  // slide-size edit reaches the file.
8780
- slideSize: chunkTWUAZRCG_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8869
+ slideSize: chunk5KAMDV37_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8781
8870
  headerFooter,
8782
8871
  presentationProperties,
8783
8872
  viewProperties,
@@ -8796,7 +8885,7 @@ function useSerialize(input) {
8796
8885
  embedFonts,
8797
8886
  outputFormat: format
8798
8887
  });
8799
- return chunkTWUAZRCG_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8888
+ return chunk5KAMDV37_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8800
8889
  },
8801
8890
  [
8802
8891
  slides,
@@ -8837,7 +8926,7 @@ function useRecoveryDetection(input) {
8837
8926
  const onRestore = input.onRestore;
8838
8927
  const openVersionHistory = input.openVersionHistory;
8839
8928
  react.useEffect(() => {
8840
- if (!chunkTWUAZRCG_js.shouldProbeAutosaveRecovery({
8929
+ if (!chunk5KAMDV37_js.shouldProbeAutosaveRecovery({
8841
8930
  alreadyChecked: recoveryCheckedRef.current,
8842
8931
  filePath,
8843
8932
  loading,
@@ -8849,7 +8938,7 @@ function useRecoveryDetection(input) {
8849
8938
  }
8850
8939
  recoveryCheckedRef.current = true;
8851
8940
  void (async () => {
8852
- const offer = await chunkTWUAZRCG_js.probeAutosaveRecovery(filePath);
8941
+ const offer = await chunk5KAMDV37_js.probeAutosaveRecovery(filePath);
8853
8942
  if (!offer) {
8854
8943
  return;
8855
8944
  }
@@ -8862,7 +8951,7 @@ function useRecoveryDetection(input) {
8862
8951
  const record = recordRef.current;
8863
8952
  setPrompt(null);
8864
8953
  if (record && onRestore) {
8865
- onRestore(chunkTWUAZRCG_js.acceptAutosaveRecovery(record));
8954
+ onRestore(chunk5KAMDV37_js.acceptAutosaveRecovery(record));
8866
8955
  }
8867
8956
  recordRef.current = null;
8868
8957
  }, [onRestore]);
@@ -8871,7 +8960,7 @@ function useRecoveryDetection(input) {
8871
8960
  setPrompt(null);
8872
8961
  recordRef.current = null;
8873
8962
  if (record) {
8874
- void chunkTWUAZRCG_js.discardAutosaveRecovery(record);
8963
+ void chunk5KAMDV37_js.discardAutosaveRecovery(record);
8875
8964
  }
8876
8965
  }, []);
8877
8966
  return { prompt, restore, discard };
@@ -8922,11 +9011,11 @@ function usePresentationSetup(input) {
8922
9011
  containerRef,
8923
9012
  content,
8924
9013
  onSetMode: (nextMode) => {
8925
- if (mode === "present" && nextMode !== "present" && !chunkTWUAZRCG_js.mayLeaveSlideShow()) {
9014
+ if (mode === "present" && nextMode !== "present" && !chunk5KAMDV37_js.mayLeaveSlideShow()) {
8926
9015
  return;
8927
9016
  }
8928
9017
  if (mode === "present" && nextMode !== "present") {
8929
- chunkTWUAZRCG_js.stopAllPersistentAudio();
9018
+ chunk5KAMDV37_js.stopAllPersistentAudio();
8930
9019
  stopAnimationSound();
8931
9020
  const exitHandler = exitModeHandlerRef.current;
8932
9021
  if (exitHandler) {
@@ -8994,10 +9083,10 @@ function usePresentationSetup(input) {
8994
9083
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8995
9084
  onToggleSubtitles,
8996
9085
  onSaveRehearsalTimings: (timings) => {
8997
- setSlides((prev) => chunkTWUAZRCG_js.applyRehearsalTimings(prev, timings));
9086
+ setSlides((prev) => chunk5KAMDV37_js.applyRehearsalTimings(prev, timings));
8998
9087
  history.markDirty();
8999
9088
  },
9000
- loopContinuously: chunkTWUAZRCG_js.shouldLoopContinuously(presentationProperties),
9089
+ loopContinuously: chunk5KAMDV37_js.shouldLoopContinuously(presentationProperties),
9001
9090
  showWithAnimation: presentationProperties.showWithAnimation,
9002
9091
  useTimings: presentationProperties.advanceMode !== "manual",
9003
9092
  endWithBlackSlide,
@@ -9204,7 +9293,7 @@ function useEditorOperations(input) {
9204
9293
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9205
9294
  react.useEffect(() => {
9206
9295
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9207
- copiedFormatRef.current = chunkTWUAZRCG_js.copyFormatFromElement(selectedElement);
9296
+ copiedFormatRef.current = chunk5KAMDV37_js.copyFormatFromElement(selectedElement);
9208
9297
  } else if (!formatPainterActive) {
9209
9298
  copiedFormatRef.current = null;
9210
9299
  }
@@ -9230,12 +9319,12 @@ function useEditorOperations(input) {
9230
9319
  e.stopPropagation();
9231
9320
  const element = elementLookup.get(elementId);
9232
9321
  if (element) {
9233
- const updated = chunkTWUAZRCG_js.applyFormatToElement(element, copiedFormatRef.current);
9322
+ const updated = chunk5KAMDV37_js.applyFormatToElement(element, copiedFormatRef.current);
9234
9323
  const updates = {};
9235
- if (chunkTWUAZRCG_js.hasShapeProperties(updated)) {
9324
+ if (chunk5KAMDV37_js.hasShapeProperties(updated)) {
9236
9325
  updates.shapeStyle = updated.shapeStyle;
9237
9326
  }
9238
- if (chunkTWUAZRCG_js.hasTextProperties(updated)) {
9327
+ if (chunk5KAMDV37_js.hasTextProperties(updated)) {
9239
9328
  updates.textStyle = updated.textStyle;
9240
9329
  }
9241
9330
  ops.updateElementById(elementId, updates);
@@ -9286,7 +9375,8 @@ function useIOHandlers(input) {
9286
9375
  serializeForRecovery,
9287
9376
  setContent,
9288
9377
  onContentChange,
9289
- imageExportScale
9378
+ imageExportScale,
9379
+ imageResolutionScale
9290
9380
  } = input;
9291
9381
  const exportHandlers = useExportHandlers({
9292
9382
  slides,
@@ -9310,7 +9400,8 @@ function useIOHandlers(input) {
9310
9400
  theme: state.theme,
9311
9401
  canvasSize,
9312
9402
  slideSizeEmu: state.slideSizeEmu,
9313
- imageExportScale
9403
+ imageExportScale,
9404
+ imageResolutionScale
9314
9405
  });
9315
9406
  const printHandlers = usePrintHandlers({
9316
9407
  slides,
@@ -9419,10 +9510,10 @@ function useFontInjection({ embeddedFonts, slides }) {
9419
9510
  }
9420
9511
  };
9421
9512
  }, [embeddedFonts]);
9422
- const referencedFamilies = react.useMemo(() => chunkTWUAZRCG_js.collectReferencedFontFamilies(slides), [slides]);
9513
+ const referencedFamilies = react.useMemo(() => chunk5KAMDV37_js.collectReferencedFontFamilies(slides), [slides]);
9423
9514
  react.useEffect(() => {
9424
9515
  let cancelled = false;
9425
- void chunkTWUAZRCG_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
9516
+ void chunk5KAMDV37_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
9426
9517
  if (cancelled) {
9427
9518
  return null;
9428
9519
  }
@@ -9444,6 +9535,52 @@ function useFontInjection({ embeddedFonts, slides }) {
9444
9535
  }
9445
9536
  };
9446
9537
  }, [embeddedFonts, slides]);
9538
+ const [, setOutlineFontsTick] = react.useState(0);
9539
+ react.useEffect(() => {
9540
+ let cancelled = false;
9541
+ const referenced = chunk5KAMDV37_js.collectReferencedFontFamilies(slides);
9542
+ const candidates = chunk5KAMDV37_js.selectGoogleWebfontFamilies(
9543
+ referenced,
9544
+ embeddedFonts.map((font) => font.name)
9545
+ );
9546
+ if (candidates.length === 0) {
9547
+ return;
9548
+ }
9549
+ void chunk5KAMDV37_js.resolveGoogleWebfontHref(slides, embeddedFonts).then(async (href) => {
9550
+ if (cancelled || !href) {
9551
+ return;
9552
+ }
9553
+ const boldItalicVariants = [
9554
+ { bold: false, italic: false },
9555
+ { bold: true, italic: false }
9556
+ ];
9557
+ let registeredAny = false;
9558
+ for (const family of candidates) {
9559
+ for (const variant of boldItalicVariants) {
9560
+ if (cancelled) {
9561
+ return;
9562
+ }
9563
+ const bytes = await chunk5KAMDV37_js.fetchGoogleWebfontOutlineBytes(
9564
+ href,
9565
+ family,
9566
+ variant.bold,
9567
+ variant.italic,
9568
+ fetch
9569
+ );
9570
+ if (bytes && glyphOutlineFontCache.registerFontBytes(family, variant.bold, variant.italic, bytes)) {
9571
+ registeredAny = true;
9572
+ }
9573
+ }
9574
+ }
9575
+ if (registeredAny && !cancelled) {
9576
+ setOutlineFontsTick((tick) => tick + 1);
9577
+ }
9578
+ return void 0;
9579
+ });
9580
+ return () => {
9581
+ cancelled = true;
9582
+ };
9583
+ }, [embeddedFonts, slides]);
9447
9584
  react.useEffect(() => {
9448
9585
  const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
9449
9586
  if (neededSymbolFonts.length === 0) {
@@ -9612,7 +9749,7 @@ function useKeyboardShortcuts(input) {
9612
9749
  inputRef.current = input;
9613
9750
  const handleKeyDown = react.useCallback((e) => {
9614
9751
  const current = inputRef.current;
9615
- const startAction = chunkTWUAZRCG_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
9752
+ const startAction = chunk5KAMDV37_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
9616
9753
  if (startAction !== null) {
9617
9754
  e.preventDefault();
9618
9755
  if (startAction === "fromBeginning") {
@@ -9622,7 +9759,7 @@ function useKeyboardShortcuts(input) {
9622
9759
  }
9623
9760
  return;
9624
9761
  }
9625
- const { action, dx, dy } = chunkTWUAZRCG_js.mapEditorKey(e, {
9762
+ const { action, dx, dy } = chunk5KAMDV37_js.mapEditorKey(e, {
9626
9763
  canEdit: current.canEdit,
9627
9764
  // The Slide Master view is an editing surface, not a viewing one.
9628
9765
  // Gating on `mode !== 'edit'` alone made `mapEditorKey` return
@@ -9635,7 +9772,7 @@ function useKeyboardShortcuts(input) {
9635
9772
  hasSelection: current.hasSelection,
9636
9773
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9637
9774
  isDrawing: current.activeTool !== "select",
9638
- isTextInputTarget: chunkTWUAZRCG_js.isEditorTextInputTarget(e.target)
9775
+ isTextInputTarget: chunk5KAMDV37_js.isEditorTextInputTarget(e.target)
9639
9776
  });
9640
9777
  if (action === null) {
9641
9778
  return;
@@ -9811,6 +9948,7 @@ function useViewerIntegration(input) {
9811
9948
  canEdit,
9812
9949
  promptKeepInkAnnotations,
9813
9950
  imageExportScale,
9951
+ imageResolutionScale,
9814
9952
  mode,
9815
9953
  slides,
9816
9954
  activeSlide,
@@ -9896,7 +10034,8 @@ function useViewerIntegration(input) {
9896
10034
  serializeForRecovery,
9897
10035
  setContent,
9898
10036
  onContentChange,
9899
- imageExportScale
10037
+ imageExportScale,
10038
+ imageResolutionScale
9900
10039
  });
9901
10040
  const {
9902
10041
  showKeepAnnotationsDialog,
@@ -9965,7 +10104,7 @@ function useViewerIntegration(input) {
9965
10104
  return zoom.scale;
9966
10105
  },
9967
10106
  setZoom(level) {
9968
- zoom.setScale(chunkTWUAZRCG_js.clampZoomScale(level));
10107
+ zoom.setScale(chunk5KAMDV37_js.clampZoomScale(level));
9969
10108
  },
9970
10109
  zoomIn() {
9971
10110
  zoom.handleZoomIn();
@@ -10019,8 +10158,12 @@ function useViewerIntegration(input) {
10019
10158
  return slides[activeSlideIndex];
10020
10159
  },
10021
10160
  // -- Slide manipulation --
10022
- addSlide(_afterIndex) {
10023
- editorOps.slideOps.handleAddSlide();
10161
+ addSlide(afterIndex) {
10162
+ if (afterIndex === void 0) {
10163
+ editorOps.slideOps.handleAddSlide();
10164
+ } else {
10165
+ editorOps.slideOps.handleAddSlideAfter(afterIndex);
10166
+ }
10024
10167
  },
10025
10168
  deleteSlides(indexes) {
10026
10169
  editorOps.slideOps.handleDeleteSlides(indexes);
@@ -10183,7 +10326,7 @@ function useReducedMotion() {
10183
10326
  }
10184
10327
  function useViewerOptions() {
10185
10328
  const storeRef = react.useRef(null);
10186
- storeRef.current ??= chunkTWUAZRCG_js.createViewerOptionsStore();
10329
+ storeRef.current ??= chunk5KAMDV37_js.createViewerOptionsStore();
10187
10330
  const store = storeRef.current;
10188
10331
  const options = react.useSyncExternalStore(
10189
10332
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -10192,9 +10335,9 @@ function useViewerOptions() {
10192
10335
  );
10193
10336
  return { optionsStore: store, options };
10194
10337
  }
10195
- var KNOWN_TAB_IDS = new Set(chunkTWUAZRCG_js.TOOLBAR_TABS.map((tab) => tab.id));
10338
+ var KNOWN_TAB_IDS = new Set(chunk5KAMDV37_js.TOOLBAR_TABS.map((tab) => tab.id));
10196
10339
  function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
10197
- const isHidden = (id) => chunkTWUAZRCG_js.isActionHidden(id, hiddenActions);
10340
+ const isHidden = (id) => chunk5KAMDV37_js.isActionHidden(id, hiddenActions);
10198
10341
  const userHidden = new Set(hiddenTabIds);
10199
10342
  userHidden.delete("file");
10200
10343
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
@@ -10287,12 +10430,12 @@ function useYjsDocumentSync({
10287
10430
  return;
10288
10431
  }
10289
10432
  try {
10290
- const handler = new chunkTWUAZRCG_js.PptxHandler();
10433
+ const handler = new chunk5KAMDV37_js.PptxHandler();
10291
10434
  await handler.load(sourceBytes.buffer);
10292
- const currentSlides = chunkTWUAZRCG_js.readSlidesFromYDoc(
10435
+ const currentSlides = chunk5KAMDV37_js.readSlidesFromYDoc(
10293
10436
  doc
10294
10437
  );
10295
- const slidesToSave = chunkTWUAZRCG_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10438
+ const slidesToSave = chunk5KAMDV37_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10296
10439
  const bytes = await handler.save(slidesToSave, getSaveOptions?.());
10297
10440
  config.onWriteBack(bytes);
10298
10441
  } catch {
@@ -10307,10 +10450,10 @@ function useYjsDocumentSync({
10307
10450
  if (!doc || !isConnected) {
10308
10451
  return;
10309
10452
  }
10310
- const docSlides = chunkTWUAZRCG_js.readSlidesFromYDoc(
10453
+ const docSlides = chunk5KAMDV37_js.readSlidesFromYDoc(
10311
10454
  doc
10312
10455
  );
10313
- if (!chunkTWUAZRCG_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
10456
+ if (!chunk5KAMDV37_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
10314
10457
  return;
10315
10458
  }
10316
10459
  lastSyncedRef.current = JSON.stringify(docSlides);
@@ -10329,11 +10472,11 @@ function useYjsDocumentSync({
10329
10472
  lastSyncedRef.current = serialized;
10330
10473
  void (async () => {
10331
10474
  const factories = await getFactories();
10332
- chunkTWUAZRCG_js.reconcileSlidesInYDoc(
10475
+ chunk5KAMDV37_js.reconcileSlidesInYDoc(
10333
10476
  slides,
10334
10477
  doc,
10335
10478
  factories,
10336
- chunkTWUAZRCG_js.LOCAL_SYNC_ORIGIN
10479
+ chunk5KAMDV37_js.LOCAL_SYNC_ORIGIN
10337
10480
  );
10338
10481
  scheduleWriteBack();
10339
10482
  })();
@@ -10347,10 +10490,10 @@ function useYjsDocumentSync({
10347
10490
  return;
10348
10491
  }
10349
10492
  const handleChange = (_events, transaction) => {
10350
- if (transaction?.origin === chunkTWUAZRCG_js.LOCAL_SYNC_ORIGIN) {
10493
+ if (transaction?.origin === chunk5KAMDV37_js.LOCAL_SYNC_ORIGIN) {
10351
10494
  return;
10352
10495
  }
10353
- const remoteSlides = chunkTWUAZRCG_js.readSlidesFromYDoc(
10496
+ const remoteSlides = chunk5KAMDV37_js.readSlidesFromYDoc(
10354
10497
  doc
10355
10498
  );
10356
10499
  if (remoteSlides.length === 0) {
@@ -10366,7 +10509,7 @@ function useYjsDocumentSync({
10366
10509
  isApplyingRemoteRef.current = false;
10367
10510
  scheduleWriteBack();
10368
10511
  };
10369
- const unobserve = chunkTWUAZRCG_js.observeYDocSlides(
10512
+ const unobserve = chunk5KAMDV37_js.observeYDocSlides(
10370
10513
  doc,
10371
10514
  handleChange
10372
10515
  );
@@ -10404,7 +10547,7 @@ function useBroadcastFollower({
10404
10547
  if (!broadcaster) {
10405
10548
  return;
10406
10549
  }
10407
- if (!chunkTWUAZRCG_js.shouldAutoFollowBroadcaster({
10550
+ if (!chunk5KAMDV37_js.shouldAutoFollowBroadcaster({
10408
10551
  localRole: collab.config.role,
10409
10552
  broadcasterRole: broadcaster.role
10410
10553
  })) {
@@ -10562,7 +10705,7 @@ function useLayoutSwitching(input) {
10562
10705
  currentLayoutPath
10563
10706
  };
10564
10707
  }
10565
- var MIN_TOUCH_TARGET = 44;
10708
+ var MIN_TOUCH_TARGET = chunk5KAMDV37_js.MIN_TOUCH_TARGET_PX;
10566
10709
  function subscribeTouchCapability(callback) {
10567
10710
  if (typeof window === "undefined") {
10568
10711
  return () => {
@@ -10575,7 +10718,7 @@ function subscribeTouchCapability(callback) {
10575
10718
  function useIsMobile() {
10576
10719
  const isTouchDevice = react.useSyncExternalStore(
10577
10720
  subscribeTouchCapability,
10578
- chunkTWUAZRCG_js.detectTouchDevice,
10721
+ chunk5KAMDV37_js.detectTouchDevice,
10579
10722
  () => false
10580
10723
  // server snapshot
10581
10724
  );
@@ -10585,7 +10728,7 @@ function useIsMobile() {
10585
10728
  const [viewportHeight, setViewportHeight] = react.useState(
10586
10729
  () => typeof window === "undefined" ? 768 : window.innerHeight
10587
10730
  );
10588
- const [orientation, setOrientation] = react.useState(chunkTWUAZRCG_js.detectOrientation);
10731
+ const [orientation, setOrientation] = react.useState(chunk5KAMDV37_js.detectOrientation);
10589
10732
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
10590
10733
  const [initialViewportHeight] = react.useState(
10591
10734
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -10606,7 +10749,7 @@ function useIsMobile() {
10606
10749
  return;
10607
10750
  }
10608
10751
  const handleOrientationChange = () => {
10609
- setOrientation(chunkTWUAZRCG_js.detectOrientation());
10752
+ setOrientation(chunk5KAMDV37_js.detectOrientation());
10610
10753
  };
10611
10754
  if (screen.orientation) {
10612
10755
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -10636,7 +10779,7 @@ function useIsMobile() {
10636
10779
  window.addEventListener("resize", handleResize);
10637
10780
  return () => window.removeEventListener("resize", handleResize);
10638
10781
  }, [isTouchDevice, initialViewportHeight]);
10639
- const { isMobile, isTablet, isDesktop } = chunkTWUAZRCG_js.deriveViewportBreakpoints(
10782
+ const { isMobile, isTablet, isDesktop } = chunk5KAMDV37_js.deriveViewportBreakpoints(
10640
10783
  viewportWidth,
10641
10784
  viewportHeight,
10642
10785
  isTouchDevice
@@ -10647,7 +10790,9 @@ function useIsMobile() {
10647
10790
  isDesktop,
10648
10791
  isTouchDevice,
10649
10792
  orientation,
10650
- isVirtualKeyboardOpen
10793
+ isVirtualKeyboardOpen,
10794
+ viewportWidth,
10795
+ viewportHeight
10651
10796
  };
10652
10797
  }
10653
10798
  function useTouchGestures(input) {
@@ -10667,10 +10812,10 @@ function useTouchGestures(input) {
10667
10812
  if (!el || !enabled) {
10668
10813
  return;
10669
10814
  }
10670
- const recognizer = chunkTWUAZRCG_js.createTouchGestureRecognizer({
10815
+ const recognizer = chunk5KAMDV37_js.createTouchGestureRecognizer({
10671
10816
  getScale: () => scaleRef.current,
10672
- minScale: chunkTWUAZRCG_js.MIN_ZOOM_SCALE,
10673
- maxScale: chunkTWUAZRCG_js.MAX_ZOOM_SCALE,
10817
+ minScale: chunk5KAMDV37_js.MIN_ZOOM_SCALE,
10818
+ maxScale: chunk5KAMDV37_js.MAX_ZOOM_SCALE,
10674
10819
  callbacks: {
10675
10820
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10676
10821
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10710,7 +10855,7 @@ function scrollFocusedIntoView(keyboardInset) {
10710
10855
  return;
10711
10856
  }
10712
10857
  const rect = active.getBoundingClientRect();
10713
- const delta = chunkTWUAZRCG_js.computeScrollDelta(
10858
+ const delta = chunk5KAMDV37_js.computeScrollDelta(
10714
10859
  { top: rect.top, bottom: rect.bottom },
10715
10860
  window.innerHeight,
10716
10861
  keyboardInset
@@ -10730,8 +10875,8 @@ function useKeyboardInsets(enabled = true) {
10730
10875
  return;
10731
10876
  }
10732
10877
  const update = () => {
10733
- const metrics = chunkTWUAZRCG_js.readViewportMetrics(window);
10734
- const inset = metrics ? chunkTWUAZRCG_js.computeKeyboardInset(metrics) : 0;
10878
+ const metrics = chunk5KAMDV37_js.readViewportMetrics(window);
10879
+ const inset = metrics ? chunk5KAMDV37_js.computeKeyboardInset(metrics) : 0;
10735
10880
  setKeyboardInset(inset);
10736
10881
  if (inset > 0) {
10737
10882
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10742,8 +10887,8 @@ function useKeyboardInsets(enabled = true) {
10742
10887
  vv.addEventListener("scroll", update);
10743
10888
  const onFocusIn = () => {
10744
10889
  window.requestAnimationFrame(() => {
10745
- const metrics = chunkTWUAZRCG_js.readViewportMetrics(window);
10746
- const inset = metrics ? chunkTWUAZRCG_js.computeKeyboardInset(metrics) : 0;
10890
+ const metrics = chunk5KAMDV37_js.readViewportMetrics(window);
10891
+ const inset = metrics ? chunk5KAMDV37_js.computeKeyboardInset(metrics) : 0;
10747
10892
  if (inset > 0) {
10748
10893
  scrollFocusedIntoView(inset);
10749
10894
  }
@@ -10756,7 +10901,7 @@ function useKeyboardInsets(enabled = true) {
10756
10901
  document.removeEventListener("focusin", onFocusIn);
10757
10902
  };
10758
10903
  }, [enabled]);
10759
- return { keyboardInset, isKeyboardOpen: chunkTWUAZRCG_js.isKeyboardOpen(keyboardInset) };
10904
+ return { keyboardInset, isKeyboardOpen: chunk5KAMDV37_js.isKeyboardOpen(keyboardInset) };
10760
10905
  }
10761
10906
 
10762
10907
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10785,21 +10930,21 @@ function buildCanvasProps(input) {
10785
10930
  } = input;
10786
10931
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10787
10932
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10788
- const fieldContext = chunkTWUAZRCG_js.buildFieldSubstitutionContext({
10933
+ const fieldContext = chunk5KAMDV37_js.buildFieldSubstitutionContext({
10789
10934
  headerFooter: s.headerFooter,
10790
10935
  customProperties: s.customProperties,
10791
10936
  slide: activeSlide
10792
10937
  });
10793
10938
  const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
10794
10939
  const openExternalUrl = (url, target) => {
10795
- if (chunkTWUAZRCG_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
10940
+ if (chunk5KAMDV37_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
10796
10941
  return;
10797
10942
  }
10798
- chunkTWUAZRCG_js.safeOpenUrl(url, target);
10943
+ chunk5KAMDV37_js.safeOpenUrl(url, target);
10799
10944
  };
10800
10945
  const handleActionClick = (elementId, action) => {
10801
10946
  if (mode === "present") {
10802
- const resolved = chunkTWUAZRCG_js.resolvePresentationAction(action, { slideCount: slides.length });
10947
+ const resolved = chunk5KAMDV37_js.resolvePresentationAction(action, { slideCount: slides.length });
10803
10948
  if (resolved.intent.kind === "openUrl") {
10804
10949
  openExternalUrl(resolved.intent.url);
10805
10950
  return;
@@ -10810,9 +10955,9 @@ function buildCanvasProps(input) {
10810
10955
  }
10811
10956
  };
10812
10957
  const handleHyperlinkClick = (url, target) => {
10813
- if (chunkTWUAZRCG_js.isPpactionUrl(url)) {
10958
+ if (chunk5KAMDV37_js.isPpactionUrl(url)) {
10814
10959
  if (mode === "present") {
10815
- const parsed = chunkTWUAZRCG_js.parsePpactionUrl(url);
10960
+ const parsed = chunk5KAMDV37_js.parsePpactionUrl(url);
10816
10961
  if (parsed) {
10817
10962
  presentation.handlePresentationAction({
10818
10963
  action: parsed.action,
@@ -10918,7 +11063,7 @@ function buildCanvasProps(input) {
10918
11063
 
10919
11064
  // src/viewer/hooks/useScopedLayoutOptions.ts
10920
11065
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10921
- return chunkTWUAZRCG_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
11066
+ return chunk5KAMDV37_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10922
11067
  }
10923
11068
 
10924
11069
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10931,7 +11076,7 @@ function buildToolbarAnimationHandlers(input) {
10931
11076
  const current = activeSlide.animations ?? [];
10932
11077
  if (group === "motionPath") {
10933
11078
  propertyHandlers.handleUpdateSlide({
10934
- animations: chunkTWUAZRCG_js.applyMotionPathPreset(current, selectedElement.id, preset)
11079
+ animations: chunk5KAMDV37_js.applyMotionPathPreset(current, selectedElement.id, preset)
10935
11080
  });
10936
11081
  return;
10937
11082
  }
@@ -11127,7 +11272,7 @@ function buildToolbarProps(input) {
11127
11272
  onOpenFile,
11128
11273
  onOpenRecentFile,
11129
11274
  onCreatePresentation: (templateId) => {
11130
- s.setSlides(chunkTWUAZRCG_js.createBackstagePresentation(templateId));
11275
+ s.setSlides(chunk5KAMDV37_js.createBackstagePresentation(templateId));
11131
11276
  s.setActiveSlideIndex(0);
11132
11277
  s.setSelectedElementId(null);
11133
11278
  s.setSelectedElementIds([]);
@@ -11157,7 +11302,7 @@ function buildToolbarProps(input) {
11157
11302
  loadLayoutPreviews: input.loadLayoutPreviews,
11158
11303
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
11159
11304
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
11160
- templateScheme: chunkTWUAZRCG_js.templateSchemeFromTheme(s.theme?.colorScheme),
11305
+ templateScheme: chunk5KAMDV37_js.templateSchemeFromTheme(s.theme?.colorScheme),
11161
11306
  customShows: s.customShows,
11162
11307
  activeCustomShowId: s.activeCustomShowId,
11163
11308
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -11198,7 +11343,7 @@ function buildToolbarProps(input) {
11198
11343
  isCommentsPanelOpen: s.isInspectorPaneOpen,
11199
11344
  slideCommentCount: activeSlide?.comments?.length ?? 0,
11200
11345
  formatPainterActive: s.formatPainterActive,
11201
- canActivateFormatPainter: chunkTWUAZRCG_js.hasCopyableFormat(selectedElement),
11346
+ canActivateFormatPainter: chunk5KAMDV37_js.hasCopyableFormat(selectedElement),
11202
11347
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
11203
11348
  isSelectionPaneOpen: s.isSelectionPaneOpen,
11204
11349
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -11276,7 +11421,7 @@ function useViewerBuildingBlocksCore(input) {
11276
11421
  headerFooter: state.headerFooter,
11277
11422
  loading,
11278
11423
  error,
11279
- maxHistoryEntries: chunkTWUAZRCG_js.resolveHistoryDepth(viewerOptions),
11424
+ maxHistoryEntries: chunk5KAMDV37_js.resolveHistoryDepth(viewerOptions),
11280
11425
  hasActivePointerInteraction,
11281
11426
  pointerCommitNonce: state.pointerCommitNonce,
11282
11427
  onDirty: markDocumentDirty,
@@ -11301,7 +11446,7 @@ function useViewerBuildingBlocksCore(input) {
11301
11446
  documentGridSpacing: state.viewProperties?.gridSpacing
11302
11447
  });
11303
11448
  const themeColorMap = react.useMemo(
11304
- () => state.theme?.colorScheme ? chunkTWUAZRCG_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
11449
+ () => state.theme?.colorScheme ? chunk5KAMDV37_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
11305
11450
  [state.theme?.colorScheme]
11306
11451
  );
11307
11452
  const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
@@ -11350,7 +11495,8 @@ function useViewerBuildingBlocksCore(input) {
11350
11495
  gridSpacingPx,
11351
11496
  // Multiplied against the pre-existing 2x baseline; see the matching
11352
11497
  // comment in `PowerPointViewer.tsx`.
11353
- imageExportScale: 2 * chunkTWUAZRCG_js.resolveImageResolutionScale(viewerOptions),
11498
+ imageExportScale: 2 * chunk5KAMDV37_js.resolveImageResolutionScale(viewerOptions),
11499
+ imageResolutionScale: chunk5KAMDV37_js.resolveImageResolutionScale(viewerOptions),
11354
11500
  viewerOptions
11355
11501
  };
11356
11502
  }
@@ -11366,7 +11512,7 @@ function useCompatibilityToastsState() {
11366
11512
  }
11367
11513
  function useReadOnlyRecommendationState(content) {
11368
11514
  const [recommendation, setRecommendation] = react.useState(
11369
- () => chunkTWUAZRCG_js.readOnlyRecommendation(void 0)
11515
+ () => chunk5KAMDV37_js.readOnlyRecommendation(void 0)
11370
11516
  );
11371
11517
  const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
11372
11518
  const [bannerHidden, setBannerHidden] = react.useState(false);
@@ -11406,7 +11552,7 @@ function useReadOnlyRecommendationState(content) {
11406
11552
  async (password) => {
11407
11553
  setCheckingPassword(true);
11408
11554
  try {
11409
- const result = await chunkTWUAZRCG_js.checkModifyPassword(modifyVerifier, password);
11555
+ const result = await chunk5KAMDV37_js.checkModifyPassword(modifyVerifier, password);
11410
11556
  if (result.ok) {
11411
11557
  unlock();
11412
11558
  } else {
@@ -11451,9 +11597,9 @@ function useViewPreferencesSync(input) {
11451
11597
  setShowGuides
11452
11598
  } = input;
11453
11599
  react.useEffect(() => {
11454
- const seeded = chunkTWUAZRCG_js.viewerPreferencesFromViewProperties(
11600
+ const seeded = chunk5KAMDV37_js.viewerPreferencesFromViewProperties(
11455
11601
  { viewProperties },
11456
- { ...chunkTWUAZRCG_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
11602
+ { ...chunk5KAMDV37_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
11457
11603
  );
11458
11604
  setSnapToGrid(seeded.snapToGrid);
11459
11605
  setSnapToShape(seeded.snapToObjects ?? snapToShape);
@@ -11463,7 +11609,7 @@ function useViewPreferencesSync(input) {
11463
11609
  (prefsOverride) => {
11464
11610
  setViewProperties((prev) => {
11465
11611
  const merged = {
11466
- ...chunkTWUAZRCG_js.DEFAULT_VIEWER_PREFERENCES,
11612
+ ...chunk5KAMDV37_js.DEFAULT_VIEWER_PREFERENCES,
11467
11613
  snapToGrid,
11468
11614
  snapToObjects: snapToShape,
11469
11615
  showGuides,
@@ -11471,7 +11617,7 @@ function useViewPreferencesSync(input) {
11471
11617
  gridSpacingCy: prev?.gridSpacing?.cy,
11472
11618
  ...prefsOverride
11473
11619
  };
11474
- const patch = chunkTWUAZRCG_js.viewPropertiesPatchFromPreferences(merged);
11620
+ const patch = chunk5KAMDV37_js.viewPropertiesPatchFromPreferences(merged);
11475
11621
  return {
11476
11622
  ...prev,
11477
11623
  slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
@@ -11533,6 +11679,7 @@ function useViewerBuildingBlocksState(input) {
11533
11679
  actionSoundHandlerRef,
11534
11680
  gridSpacingPx,
11535
11681
  imageExportScale,
11682
+ imageResolutionScale,
11536
11683
  setExitModeHandler,
11537
11684
  viewerOptions
11538
11685
  } = core;
@@ -11618,6 +11765,7 @@ function useViewerBuildingBlocksState(input) {
11618
11765
  canEdit,
11619
11766
  promptKeepInkAnnotations: viewerOptions.advanced.slideShowPromptKeepInkAnnotations,
11620
11767
  imageExportScale,
11768
+ imageResolutionScale,
11621
11769
  mode,
11622
11770
  slides,
11623
11771
  activeSlide,
@@ -11690,7 +11838,7 @@ function useViewerBuildingBlocks(input) {
11690
11838
  }, [incomingContent]);
11691
11839
  const onOpenFile = react.useCallback(() => {
11692
11840
  void (async () => {
11693
- const picked = await chunkTWUAZRCG_js.openPptxFile();
11841
+ const picked = await chunk5KAMDV37_js.openPptxFile();
11694
11842
  if (picked) {
11695
11843
  setContent(picked.buffer);
11696
11844
  }
@@ -11698,7 +11846,7 @@ function useViewerBuildingBlocks(input) {
11698
11846
  }, []);
11699
11847
  const onOpenRecentFile = react.useCallback((key) => {
11700
11848
  void (async () => {
11701
- const bytes = await chunkTWUAZRCG_js.readBackstageRecentFile(key);
11849
+ const bytes = await chunk5KAMDV37_js.readBackstageRecentFile(key);
11702
11850
  if (bytes) {
11703
11851
  setContent(bytes);
11704
11852
  }
@@ -11880,6 +12028,7 @@ exports.MIN_TOUCH_TARGET = MIN_TOUCH_TARGET;
11880
12028
  exports.ViewerOptionsContext = ViewerOptionsContext;
11881
12029
  exports.computeToolbarVisibility = computeToolbarVisibility;
11882
12030
  exports.detectTargetType = detectTargetType;
12031
+ exports.getGlyphOutline = getGlyphOutline;
11883
12032
  exports.isAudienceTab = isAudienceTab;
11884
12033
  exports.parseAudienceNonce = parseAudienceNonce;
11885
12034
  exports.parseEmailUrl = parseEmailUrl;