@eigenpal/docx-editor-vue 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/KeyboardShortcutsDialog-Dohz9D39.cjs +1 -0
  2. package/dist/{KeyboardShortcutsDialog-DtuQzPxi.js → KeyboardShortcutsDialog-OPAV0oVm.js} +9 -6
  3. package/dist/{MenuBar-DfQrRpyI.js → MenuBar-BLKoZqG3.js} +644 -540
  4. package/dist/MenuBar-BP-XM0MI.cjs +4 -0
  5. package/dist/{TablePropertiesDialog-BVlqA7s3.cjs → TablePropertiesDialog-B-FVOqkH.cjs} +1 -1
  6. package/dist/{TablePropertiesDialog-D4xs_Xif.js → TablePropertiesDialog-B3oZIIjw.js} +9 -9
  7. package/dist/components/DocxEditor/types.d.ts +8 -0
  8. package/dist/components/Toolbar/presets.d.ts +0 -1
  9. package/dist/components/ui/fontPickerValue.d.ts +1 -0
  10. package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
  11. package/dist/composables/useColorMode.d.ts +8 -0
  12. package/dist/composables/useDocxEditorRefApi.d.ts +4 -0
  13. package/dist/composables/useFormattingActions.d.ts +5 -2
  14. package/dist/composables/useMenuActions.d.ts +2 -0
  15. package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
  16. package/dist/composables/useToolbarDropdowns.d.ts +1 -0
  17. package/dist/composables/useToolbarFontSize.d.ts +15 -0
  18. package/dist/composables.cjs +1 -1
  19. package/dist/composables.js +4 -3
  20. package/dist/dialogs.cjs +1 -1
  21. package/dist/dialogs.js +2 -2
  22. package/dist/docx-editor-vue.css +1 -1
  23. package/dist/index.cjs +3 -3
  24. package/dist/index.js +952 -906
  25. package/dist/plugin-api.cjs +1 -1
  26. package/dist/plugin-api.js +1 -1
  27. package/dist/ui.cjs +2 -2
  28. package/dist/ui.js +220 -197
  29. package/dist/{useDragAutoScroll-BNPB-6SM.js → useDragAutoScroll-B21Ec-Zy.js} +6 -7
  30. package/dist/useDragAutoScroll-BPnc7LEO.cjs +1 -0
  31. package/package.json +4 -4
  32. package/dist/KeyboardShortcutsDialog-DyfvEiK5.cjs +0 -1
  33. package/dist/MenuBar-p9bqtbLg.cjs +0 -4
  34. package/dist/useDragAutoScroll-DCUotwOX.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,44 +1,45 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./KeyboardShortcutsDialog-DtuQzPxi.js";
2
- import { a as f, c as p, h as m, i as h, o as g, s as _, t as v, x as y } from "./MenuBar-DfQrRpyI.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./KeyboardShortcutsDialog-OPAV0oVm.js";
2
+ import { a as f, c as p, h as m, i as h, o as g, s as _, t as v, x as y } from "./MenuBar-BLKoZqG3.js";
3
3
  import { t as b } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
4
  import { n as x } from "./RenderedDomContext-CHc18N_2.js";
5
5
  import { t as S } from "./zIndex-CxELVe_L.js";
6
- import { i as C, n as ee, r as te, t as ne } from "./useDragAutoScroll-BNPB-6SM.js";
7
- import { Fragment as w, Teleport as T, computed as E, createApp as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createSlots as re, createStaticVNode as ie, createTextVNode as ae, createVNode as M, defineComponent as N, h as oe, isRef as se, nextTick as ce, normalizeClass as le, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as z, renderSlot as ue, resolveDynamicComponent as de, shallowRef as fe, toDisplayString as B, unref as V, vModelCheckbox as H, vModelSelect as pe, vModelText as U, watch as W, withCtx as me, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
8
- import { NodeSelection as J, TextSelection as he } from "prosemirror-state";
9
- import { applyCellSelectionHighlight as Y, clickToPositionDom as ge, computeHfCaretRectFromView as _e, computeHfSelectionRectsFromView as ve, findBodyPmAnchor as X, findBodyPmSpans as ye } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { clampRangeToDoc as be, findChangeRange as xe, findCommentRange as Se, findInDocument as Ce, getPageContent as we, getSelectionInfo as Te } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
- import { LayoutSelectionGate as Ee, addRepeatingSectionItemTr as De, extractSelectionState as Oe, findContentControlPos as ke, findContentControlsInPM as Ae, removeContentControlTr as je, removeRepeatingSectionItemTr as Z, schema as Me, setContentControlContentTr as Ne, setContentControlValueAtPosTr as Pe, setContentControlValueTr as Fe } from "@eigenpal/docx-editor-core/prosemirror";
12
- import { SIDEBAR_DOCUMENT_SHIFT as Ie, findWordBoundaries as Le, loadFontDefinitions as Re, onFontError as ze, pixelsToEmu as Be, readDocxFileFromInput as Q, toArrayBuffer as Ve } from "@eigenpal/docx-editor-core/utils";
13
- import { extractSelectionContext as He } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
- import { clearFormatting as Ue, findHyperlinkRangeAt as We } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
- import { getTableContext as Ge } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
- import { clickToPositionDom as Ke, getCaretPositionFromDom as qe, getSelectionRectsFromDom as Je } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
- import { calculateResizedImageDimensions as Ye, commitImageFloatMove as Xe, commitImageInlineMove as Ze, commitImageResize as Qe, isFloatingImage as $e } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
- import { IMAGE_LAYOUT_OPTIONS as et, captureInlinePositionEmu as tt, deriveLayoutChoice as nt, findImageElement as rt, isImageLayoutOptionEnabled as it, renderAllPagesNow as at, toolbarValueToLayoutTarget as ot } from "@eigenpal/docx-editor-core/layout-painter";
19
- import { proseDocToBlocks as st } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
- import { twipsToPixels as ct } from "@eigenpal/docx-editor-core/utils/units";
21
- import { pictureWatermarkDisplayEmu as lt } from "@eigenpal/docx-editor-core/types/document";
22
- import { makeRevisionInfo as ut } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
- import { findPageIndexContainingPmPos as dt } from "@eigenpal/docx-editor-core/layout-engine";
24
- import { acceptChange as ft, acceptChangeById as pt, getWatermarkFromState as mt, insertImageFromFile as ht, rejectChange as gt, rejectChangeById as _t, setWatermark as vt } from "@eigenpal/docx-editor-core/prosemirror/commands";
25
- import { applyStyle as yt, removeTabStop as bt, setIndentFirstLine as xt, setIndentLeft as St, setIndentRight as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
26
- import { createStyleResolver as wt } from "@eigenpal/docx-editor-core/prosemirror/styles";
27
- import { getCachedNumberingMap as Tt } from "@eigenpal/docx-editor-core/docx";
28
- import { insertPageBreak as Et } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
29
- import { applyFormatting as Dt, setParagraphStyle as Ot } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
30
- import { collectHeadings as kt } from "@eigenpal/docx-editor-core/utils/headingCollector";
31
- import { addCommentToRange as At, applyProposedChange as jt, createComment as Mt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
32
- import { PENDING_COMMENT_ID as Nt, createCommentIdAllocator as Pt, seedCommentAllocator as Ft } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
33
- import { extractTrackedChanges as It } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
34
- import { TABLE_INSERT_HIDE_DELAY_MS as Lt, detectTableInsertHover as Rt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
35
- import { createCellDragTracker as zt, findCellPosFromPmPos as Bt } from "@eigenpal/docx-editor-core/prosemirror/cellDragSelection";
36
- import { openReportIssue as Vt } from "@eigenpal/docx-editor-core/utils/reportIssue";
37
- import { ContentControlNotFoundError as Ht } from "@eigenpal/docx-editor-core/agent";
38
- import { findParaIdRange as Ut } from "@eigenpal/docx-editor-core/prosemirror/paraText";
39
- import { createDocumentWithText as Wt, createEmptyDocument as Gt } from "@eigenpal/docx-editor-core";
6
+ import { i as C, n as ee, r as te, t as ne } from "./useDragAutoScroll-B21Ec-Zy.js";
7
+ import { Fragment as w, Teleport as T, computed as E, createApp as re, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ie, createStaticVNode as ae, createTextVNode as j, createVNode as M, defineComponent as N, h as P, isRef as oe, nextTick as se, normalizeClass as ce, normalizeStyle as F, onBeforeUnmount as I, onMounted as le, openBlock as L, ref as R, renderList as ue, renderSlot as de, resolveDynamicComponent as fe, shallowRef as pe, toDisplayString as z, unref as B, vModelCheckbox as V, vModelSelect as me, vModelText as H, watch as U, watchEffect as W, withCtx as he, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
8
+ import { NodeSelection as J, TextSelection as Y } from "prosemirror-state";
9
+ import { applyCellSelectionHighlight as ge, clickToPositionDom as _e, computeHfCaretRectFromView as ve, computeHfSelectionRectsFromView as ye, findBodyPmAnchor as X, findBodyPmSpans as be } from "@eigenpal/docx-editor-core/layout-bridge";
10
+ import { clampRangeToDoc as xe, findChangeRange as Se, findCommentRange as Ce, findInDocument as we, getPageContent as Te, getSelectionInfo as Ee } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
+ import { LayoutSelectionGate as De, addRepeatingSectionItemTr as Oe, extractSelectionState as ke, findContentControlPos as Ae, findContentControlsInPM as je, removeContentControlTr as Me, removeRepeatingSectionItemTr as Z, schema as Ne, setContentControlContentTr as Pe, setContentControlValueAtPosTr as Fe, setContentControlValueTr as Ie } from "@eigenpal/docx-editor-core/prosemirror";
12
+ import { SIDEBAR_DOCUMENT_SHIFT as Le, findWordBoundaries as Re, loadFontDefinitions as ze, onFontError as Be, pixelsToEmu as Ve, prefersColorSchemeDark as Q, readDocxFileFromInput as He, resolveIsDark as Ue, subscribeSystemDark as We, toArrayBuffer as Ge } from "@eigenpal/docx-editor-core/utils";
13
+ import { extractSelectionContext as Ke } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
+ import { clearFormatting as qe, findHyperlinkRangeAt as Je } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
+ import { getTableContext as Ye } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
+ import { clickToPositionDom as Xe, getCaretPositionFromDom as Ze, getSelectionRectsFromDom as Qe } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
+ import { calculateResizedImageDimensions as $e, commitImageFloatMove as et, commitImageInlineMove as tt, commitImageResize as nt, isFloatingImage as rt } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
+ import { IMAGE_LAYOUT_OPTIONS as it, captureInlinePositionEmu as at, deriveLayoutChoice as ot, findImageElement as st, isImageLayoutOptionEnabled as ct, renderAllPagesNow as lt, toolbarValueToLayoutTarget as ut } from "@eigenpal/docx-editor-core/layout-painter";
19
+ import { proseDocToBlocks as dt } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
+ import { twipsToPixels as ft } from "@eigenpal/docx-editor-core/utils/units";
21
+ import { DEFAULT_WATERMARK_PRESETS as pt, pictureWatermarkDisplayEmu as mt } from "@eigenpal/docx-editor-core/types/document";
22
+ import { makeRevisionInfo as ht } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
+ import { findPageIndexContainingPmPos as gt } from "@eigenpal/docx-editor-core/layout-engine";
24
+ import { acceptChange as _t, acceptChangeById as vt, getWatermarkFromState as yt, insertImageFromFile as bt, rejectChange as xt, rejectChangeById as St, setWatermark as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands";
25
+ import { applyStyle as wt, removeTabStop as Tt, setIndentFirstLine as Et, setIndentLeft as Dt, setIndentRight as Ot } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
26
+ import { createStyleResolver as kt } from "@eigenpal/docx-editor-core/prosemirror/styles";
27
+ import { getCachedNumberingMap as At } from "@eigenpal/docx-editor-core/docx";
28
+ import { insertPageBreak as jt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
29
+ import { insertSectionBreakContinuous as Mt, insertSectionBreakNextPage as Nt } from "@eigenpal/docx-editor-core/prosemirror/commands/sectionBreak";
30
+ import { applyFormatting as Pt, insertBreak as Ft, setParagraphStyle as It } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
31
+ import { collectHeadings as Lt } from "@eigenpal/docx-editor-core/utils/headingCollector";
32
+ import { addCommentToRange as Rt, applyProposedChange as zt, createComment as Bt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
33
+ import { PENDING_COMMENT_ID as Vt, createCommentIdAllocator as Ht, seedCommentAllocator as Ut } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
34
+ import { extractTrackedChanges as Wt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
35
+ import { TABLE_INSERT_HIDE_DELAY_MS as Gt, detectTableInsertHover as Kt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
36
+ import { createCellDragTracker as qt, findCellPosFromPmPos as Jt } from "@eigenpal/docx-editor-core/prosemirror/cellDragSelection";
37
+ import { openReportIssue as Yt } from "@eigenpal/docx-editor-core/utils/reportIssue";
38
+ import { ContentControlNotFoundError as Xt } from "@eigenpal/docx-editor-core/agent";
39
+ import { findParaIdRange as Zt } from "@eigenpal/docx-editor-core/prosemirror/paraText";
40
+ import { createDocumentWithText as Qt, createEmptyDocument as $t } from "@eigenpal/docx-editor-core";
40
41
  //#region src/utils/domQueries.ts
41
- function Kt(e) {
42
+ function en(e) {
42
43
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
43
44
  if (t.length === 0) return null;
44
45
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -48,18 +49,18 @@ function Kt(e) {
48
49
  }
49
50
  return r;
50
51
  }
51
- function qt(e, t, n) {
52
- let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : ye(e);
52
+ function tn(e, t, n) {
53
+ let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : be(e);
53
54
  for (let e of r) {
54
55
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
55
56
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
56
57
  }
57
58
  return null;
58
59
  }
59
- function Jt(e, t, n) {
60
+ function nn(e, t, n) {
60
61
  if (!e || !t) return;
61
62
  let r = null;
62
- for (let t of ye(e)) {
63
+ for (let t of be(e)) {
63
64
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
64
65
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
65
66
  r = t;
@@ -73,21 +74,21 @@ function Jt(e, t, n) {
73
74
  behavior: "smooth"
74
75
  });
75
76
  }
76
- function Yt(e, t, n, r) {
77
+ function rn(e, t, n, r) {
77
78
  if (!e || !t) return null;
78
- let i = ge(e, n, r, 1);
79
+ let i = _e(e, n, r, 1);
79
80
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
80
81
  }
81
- function Xt(e, t, n, r) {
82
+ function an(e, t, n, r) {
82
83
  if (!e) return;
83
- let i = qt(e, t, r);
84
+ let i = tn(e, t, r);
84
85
  if (!i) return;
85
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Le(a, t - o), l = o + s, u = o + c;
86
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Re(a, t - o), l = o + s, u = o + c;
86
87
  l < u && n(l, u);
87
88
  }
88
- function Zt(e, t, n, r) {
89
+ function on(e, t, n, r) {
89
90
  if (!e) return;
90
- let i = qt(e, t, r);
91
+ let i = tn(e, t, r);
91
92
  if (!i) return;
92
93
  let a = i.closest(".layout-paragraph");
93
94
  if (!a) return;
@@ -96,7 +97,7 @@ function Zt(e, t, n, r) {
96
97
  }
97
98
  //#endregion
98
99
  //#region src/components/DecorationLayer.vue
99
- var Qt = /* @__PURE__ */ N({
100
+ var sn = /* @__PURE__ */ N({
100
101
  __name: "DecorationLayer",
101
102
  props: {
102
103
  getView: { type: Function },
@@ -114,13 +115,13 @@ var Qt = /* @__PURE__ */ N({
114
115
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
115
116
  });
116
117
  }
117
- I(() => {
118
+ le(() => {
118
119
  a = t.syncCoordinator.onRender(() => {
119
120
  r.value++;
120
121
  }), o();
121
- }), F(() => {
122
+ }), I(() => {
122
123
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
123
- }), W(() => [
124
+ }), U(() => [
124
125
  t.zoom,
125
126
  t.transactionVersion,
126
127
  r.value
@@ -181,7 +182,7 @@ var Qt = /* @__PURE__ */ N({
181
182
  function u(e) {
182
183
  return e.type?.attrs ?? null;
183
184
  }
184
- return (e, t) => (L(), A("div", {
185
+ return (e, t) => (L(), k("div", {
185
186
  ref_key: "overlayRef",
186
187
  ref: n,
187
188
  class: "paged-editor__decoration-overlay",
@@ -191,7 +192,7 @@ var Qt = /* @__PURE__ */ N({
191
192
  });
192
193
  //#endregion
193
194
  //#region src/composables/imageOverlayRect.ts
194
- function $t(e) {
195
+ function cn(e) {
195
196
  let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
196
197
  return {
197
198
  left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
@@ -202,13 +203,13 @@ function $t(e) {
202
203
  }
203
204
  //#endregion
204
205
  //#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
205
- var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
206
+ var ln = ["data-handle", "onMousedown"], un = ["title"], dn = {
206
207
  key: 0,
207
208
  class: "image-overlay__dim"
208
- }, rn = {
209
+ }, fn = {
209
210
  key: 1,
210
211
  class: "image-overlay__dim image-overlay__dim--rotate"
211
- }, an = 4, on = 15, sn = 250, cn = 700, ln = /* @__PURE__ */ b(/* @__PURE__ */ N({
212
+ }, pn = 4, mn = 15, hn = 250, gn = 700, _n = /* @__PURE__ */ b(/* @__PURE__ */ N({
212
213
  __name: "ImageSelectionOverlay",
213
214
  props: {
214
215
  imageInfo: {},
@@ -242,7 +243,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
242
243
  let t = te();
243
244
  if (!t) return null;
244
245
  let n = X(t, e.pmPos);
245
- return n ? rt(n) : null;
246
+ return n ? st(n) : null;
246
247
  }
247
248
  function T() {
248
249
  let e = ne();
@@ -256,7 +257,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
256
257
  return;
257
258
  }
258
259
  let n = t.getBoundingClientRect();
259
- p.value = $t({
260
+ p.value = cn({
260
261
  imageRect: e.getBoundingClientRect(),
261
262
  parentRect: n,
262
263
  scrollLeft: t.scrollLeft,
@@ -266,41 +267,41 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
266
267
  zoom: r.zoom
267
268
  });
268
269
  }
269
- let D = null;
270
- function O() {
271
- D?.();
270
+ let re = null;
271
+ function D() {
272
+ re?.();
272
273
  let e = 0, t = "", n = 0, r = 0, i = (a) => {
273
274
  r === 0 && (r = a);
274
275
  let o = a - r;
275
276
  T();
276
277
  let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
277
- n = c === t ? n + 1 : 0, t = c, !(o >= sn && n >= 2) && o < cn && (e = requestAnimationFrame(i));
278
+ n = c === t ? n + 1 : 0, t = c, !(o >= hn && n >= 2) && o < gn && (e = requestAnimationFrame(i));
278
279
  };
279
280
  e = requestAnimationFrame(i);
280
- let a = setTimeout(T, sn);
281
- D = () => {
281
+ let a = setTimeout(T, hn);
282
+ re = () => {
282
283
  cancelAnimationFrame(e), clearTimeout(a);
283
284
  };
284
285
  }
285
- W(() => r.imageInfo, (e, t, n) => {
286
+ U(() => r.imageInfo, (e, t, n) => {
286
287
  if (!r.imageInfo) {
287
288
  p.value = null;
288
289
  return;
289
290
  }
290
- O(), n(() => D?.());
291
- }, { immediate: !0 }), W(() => r.zoom, () => {
292
- r.imageInfo && O();
293
- }), W(() => r.imageInfo, (e, t, n) => {
291
+ D(), n(() => re?.());
292
+ }, { immediate: !0 }), U(() => r.zoom, () => {
293
+ r.imageInfo && D();
294
+ }), U(() => r.imageInfo, (e, t, n) => {
294
295
  if (!r.imageInfo) return;
295
296
  let i = () => {
296
297
  b && cancelAnimationFrame(b), b = requestAnimationFrame(T);
297
298
  }, o = a.value?.closest(".docx-editor-vue__pages-viewport");
298
299
  o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
299
300
  let s = null, c = !1;
300
- ce(() => {
301
+ se(() => {
301
302
  if (c || !r.imageInfo) return;
302
303
  let e = te();
303
- e && (s = new MutationObserver(() => O()), s.observe(e, {
304
+ e && (s = new MutationObserver(() => D()), s.observe(e, {
304
305
  attributes: !0,
305
306
  attributeFilter: ["style"]
306
307
  }));
@@ -308,7 +309,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
308
309
  c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
309
310
  });
310
311
  }, { immediate: !0 });
311
- let re = E(() => o.value ? l.value : p.value?.width || 0), ie = E(() => o.value ? u.value : p.value?.height || 0), ae = E(() => {
312
+ let ie = E(() => o.value ? l.value : p.value?.width || 0), ae = E(() => o.value ? u.value : p.value?.height || 0), j = E(() => {
312
313
  let e = p.value;
313
314
  if (!e) return {
314
315
  position: "absolute",
@@ -330,7 +331,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
330
331
  pointerEvents: "auto"
331
332
  };
332
333
  }), M = E(() => {
333
- let e = re.value, t = ie.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
334
+ let e = ie.value, t = ae.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
334
335
  return [
335
336
  {
336
337
  pos: "nw",
@@ -399,10 +400,10 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
399
400
  ];
400
401
  });
401
402
  function N(e, t) {
402
- !r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, l.value = Math.round(_), u.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", oe), document.addEventListener("mouseup", se));
403
+ !r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, l.value = Math.round(_), u.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", P), document.addEventListener("mouseup", oe));
403
404
  }
404
- function oe(e) {
405
- let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = Ye(m, n, i, _, v, a);
405
+ function P(e) {
406
+ let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = $e(m, n, i, _, v, a);
406
407
  l.value = Math.round(o.width), u.value = Math.round(o.height);
407
408
  let s = y;
408
409
  s && (p.value = {
@@ -412,60 +413,60 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
412
413
  height: s.height
413
414
  });
414
415
  }
415
- function se() {
416
- document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), o.value = !1, y = null, i("interact-end");
416
+ function oe() {
417
+ document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", oe), o.value = !1, y = null, i("interact-end");
417
418
  let e = r.view, t = r.imageInfo;
418
419
  if (!e || !t) {
419
420
  T();
420
421
  return;
421
422
  }
422
- let n = Qe(e, t.pmPos, l.value, u.value);
423
- n !== null && ve(n), ce(() => T());
423
+ let n = nt(e, t.pmPos, l.value, u.value);
424
+ n !== null && ve(n), se(() => T());
424
425
  }
425
- let le = 0, I = 0, ue = 0, de = 0, fe = null, H = null;
426
- function pe(e) {
426
+ let ce = 0, le = 0, de = 0, fe = 0, pe = null, V = null;
427
+ function me(e) {
427
428
  if (!e) return 0;
428
429
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
429
430
  return t ? parseFloat(t[1]) : 0;
430
431
  }
431
- function U(e, t) {
432
+ function H(e, t) {
432
433
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
433
434
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
434
435
  }
435
- function me(e, t) {
436
- return Math.atan2(e - le, -(t - I)) * 180 / Math.PI;
436
+ function W(e, t) {
437
+ return Math.atan2(e - ce, -(t - le)) * 180 / Math.PI;
437
438
  }
438
- function G(e) {
439
+ function he(e) {
439
440
  if (!r.imageInfo) return;
440
441
  let t = r.imageInfo.element.getBoundingClientRect();
441
- le = t.left + t.width / 2, I = t.top + t.height / 2;
442
+ ce = t.left + t.width / 2, le = t.top + t.height / 2;
442
443
  let n = ee(r.view, r.imageInfo.pmPos);
443
- fe = n && n.attrs.transform || null, de = pe(fe), H = r.imageInfo.element.querySelector("img"), ue = me(e.clientX, e.clientY), f.value = de, c.value = !0, i("interact-start"), document.addEventListener("mousemove", K), document.addEventListener("mouseup", he);
444
+ pe = n && n.attrs.transform || null, fe = me(pe), V = r.imageInfo.element.querySelector("img"), de = W(e.clientX, e.clientY), f.value = fe, c.value = !0, i("interact-start"), document.addEventListener("mousemove", G), document.addEventListener("mouseup", K);
444
445
  }
445
- function K(e) {
446
- let t = me(e.clientX, e.clientY) - ue, n = de + t;
447
- e.shiftKey || (n = Math.round(n / on) * on), f.value = (n % 360 + 360) % 360, H && (H.style.transform = U(fe, f.value) || "");
446
+ function G(e) {
447
+ let t = W(e.clientX, e.clientY) - de, n = fe + t;
448
+ e.shiftKey || (n = Math.round(n / mn) * mn), f.value = (n % 360 + 360) % 360, V && (V.style.transform = H(pe, f.value) || "");
448
449
  }
449
- function he() {
450
- document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), c.value = !1, i("interact-end");
450
+ function K() {
451
+ document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", K), c.value = !1, i("interact-end");
451
452
  let e = r.view, t = r.imageInfo;
452
453
  try {
453
454
  let n = e && t ? ee(e, t.pmPos) : null;
454
455
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
455
456
  ...n.attrs,
456
- transform: U(n.attrs.transform, f.value)
457
+ transform: H(n.attrs.transform, f.value)
457
458
  })), ve(t.pmPos));
458
459
  } catch {} finally {
459
- H && (H.style.transform = ""), H = null, fe = null;
460
+ V && (V.style.transform = ""), V = null, pe = null;
460
461
  }
461
- ce(() => T());
462
+ se(() => T());
462
463
  }
463
464
  let Y = null;
464
465
  function ge(e) {
465
466
  if (!r.imageInfo || !p.value) return;
466
467
  let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
467
468
  let c = e.clientX - t, l = e.clientY - n;
468
- if (!(!o && Math.sqrt(c * c + l * l) < an)) {
469
+ if (!(!o && Math.sqrt(c * c + l * l) < pn)) {
469
470
  if (!o) {
470
471
  o = !0, s.value = !0, i("interact-start"), Y = document.createElement("div"), Y.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
471
472
  let e = r.zoom;
@@ -486,7 +487,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
486
487
  if (!n || !i) return;
487
488
  let o = ee(n, i.pmPos);
488
489
  if (o) {
489
- if ($e(o)) {
490
+ if (rt(o)) {
490
491
  let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
491
492
  if (!o || o.length === 0) return;
492
493
  let s = null;
@@ -498,17 +499,17 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
498
499
  }
499
500
  }
500
501
  if (s ||= o[o.length - 1].querySelector(".layout-page-content"), !s) return;
501
- let c = s.getBoundingClientRect(), l = r.zoom, u = Be((e - c.left) / l), d = Be((t - c.top) / l), f = Xe(n, i.pmPos, u, d);
502
+ let c = s.getBoundingClientRect(), l = r.zoom, u = Ve((e - c.left) / l), d = Ve((t - c.top) / l), f = et(n, i.pmPos, u, d);
502
503
  f !== null && ve(f);
503
504
  } else {
504
505
  let r = te();
505
506
  if (!r) return;
506
- let a = Ke(r, e, t, 1);
507
+ let a = Xe(r, e, t, 1);
507
508
  if (a == null || a < 0) return;
508
- let o = Ze(n, i.pmPos, a);
509
+ let o = tt(n, i.pmPos, a);
509
510
  o !== null && ve(o);
510
511
  }
511
- ce(() => T());
512
+ se(() => T());
512
513
  }
513
514
  }
514
515
  function ve(e) {
@@ -518,45 +519,45 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
518
519
  t.dispatch(t.state.tr.setSelection(n));
519
520
  } catch {}
520
521
  }
521
- return F(() => {
522
- document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), x && document.removeEventListener("mousemove", x), C && document.removeEventListener("mouseup", C), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b), D?.();
523
- }), (t, r) => e.imageInfo ? (L(), A("div", {
522
+ return I(() => {
523
+ document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", oe), document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", K), x && document.removeEventListener("mousemove", x), C && document.removeEventListener("mouseup", C), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b), re?.();
524
+ }), (t, r) => e.imageInfo ? (L(), k("div", {
524
525
  key: 0,
525
526
  ref_key: "overlayRootRef",
526
527
  ref: a,
527
528
  class: "image-overlay",
528
- style: P(ae.value),
529
+ style: F(j.value),
529
530
  onMousedown: r[3] ||= q(() => {}, ["stop"])
530
531
  }, [
531
- r[4] ||= j("div", { class: "image-overlay__border" }, null, -1),
532
- j("div", {
532
+ r[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
533
+ A("div", {
533
534
  class: "image-overlay__body",
534
- style: P({ cursor: s.value ? "grabbing" : "grab" }),
535
+ style: F({ cursor: s.value ? "grabbing" : "grab" }),
535
536
  onMousedown: r[0] ||= q((e) => ge(e), ["prevent", "stop"]),
536
537
  onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
537
538
  }, null, 36),
538
- (L(!0), A(w, null, z(M.value, (e) => (L(), A("div", {
539
+ (L(!0), k(w, null, ue(M.value, (e) => (L(), k("div", {
539
540
  key: e.pos,
540
541
  class: "image-overlay__handle",
541
- style: P(e.style),
542
+ style: F(e.style),
542
543
  "data-handle": e.pos,
543
544
  onMousedown: q((t) => N(t, e.pos), ["prevent", "stop"])
544
- }, null, 44, en))), 128)),
545
- r[5] ||= j("div", { class: "image-overlay__rotate-line" }, null, -1),
546
- j("div", {
545
+ }, null, 44, ln))), 128)),
546
+ r[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
547
+ A("div", {
547
548
  class: "image-overlay__rotate-handle",
548
- style: P({ left: `${re.value / 2 - 7}px` }),
549
- title: V(n)("imageOverlay.rotate"),
550
- onMousedown: r[2] ||= q((e) => G(e), ["prevent", "stop"])
551
- }, null, 44, tn),
552
- o.value ? (L(), A("div", nn, B(Math.round(l.value)) + " × " + B(Math.round(u.value)), 1)) : k("", !0),
553
- c.value ? (L(), A("div", rn, B(Math.round(f.value)) + "° ", 1)) : k("", !0)
554
- ], 36)) : k("", !0);
555
- }
556
- }), [["__scopeId", "data-v-2c4a2064"]]), un = { class: "doc-outline__header" }, dn = { class: "doc-outline__body" }, fn = {
549
+ style: F({ left: `${ie.value / 2 - 7}px` }),
550
+ title: B(n)("imageOverlay.rotate"),
551
+ onMousedown: r[2] ||= q((e) => he(e), ["prevent", "stop"])
552
+ }, null, 44, un),
553
+ o.value ? (L(), k("div", dn, z(Math.round(l.value)) + " × " + z(Math.round(u.value)), 1)) : O("", !0),
554
+ c.value ? (L(), k("div", fn, z(Math.round(f.value)) + "° ", 1)) : O("", !0)
555
+ ], 36)) : O("", !0);
556
+ }
557
+ }), [["__scopeId", "data-v-a3e3aca1"]]), vn = { class: "doc-outline__header" }, yn = { class: "doc-outline__body" }, bn = {
557
558
  key: 0,
558
559
  class: "doc-outline__empty"
559
- }, pn = ["onMousedown"], mn = /* @__PURE__ */ b(/* @__PURE__ */ N({
560
+ }, xn = ["onMousedown"], Sn = /* @__PURE__ */ b(/* @__PURE__ */ N({
560
561
  __name: "DocumentOutline",
561
562
  props: {
562
563
  isOpen: { type: Boolean },
@@ -564,13 +565,13 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
564
565
  },
565
566
  emits: ["close", "navigate"],
566
567
  setup(e) {
567
- return (t, n) => e.isOpen ? (L(), A("nav", {
568
+ return (t, n) => e.isOpen ? (L(), k("nav", {
568
569
  key: 0,
569
570
  class: "doc-outline",
570
571
  role: "navigation",
571
572
  "aria-label": "Document outline",
572
573
  onMousedown: n[1] ||= q(() => {}, ["stop"])
573
- }, [j("div", un, [j("button", {
574
+ }, [A("div", vn, [A("button", {
574
575
  class: "doc-outline__back",
575
576
  title: "Close outline",
576
577
  "aria-label": "Close outline",
@@ -578,14 +579,14 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
578
579
  }, [M(r, {
579
580
  name: "arrow_back",
580
581
  size: 20
581
- })]), n[2] ||= j("span", { class: "doc-outline__title" }, "Document Outline", -1)]), j("div", dn, [e.headings.length === 0 ? (L(), A("div", fn, " No headings found ")) : k("", !0), (L(!0), A(w, null, z(e.headings, (e, n) => (L(), A("button", {
582
+ })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", yn, [e.headings.length === 0 ? (L(), k("div", bn, " No headings found ")) : O("", !0), (L(!0), k(w, null, ue(e.headings, (e, n) => (L(), k("button", {
582
583
  key: n,
583
584
  class: "doc-outline__item",
584
- style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
585
+ style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
585
586
  onMousedown: q((n) => t.$emit("navigate", e.pmPos), ["prevent"])
586
- }, B(e.text || "(untitled)"), 45, pn))), 128))])], 32)) : k("", !0);
587
+ }, z(e.text || "(untitled)"), 45, xn))), 128))])], 32)) : O("", !0);
587
588
  }
588
- }), [["__scopeId", "data-v-cb2cdc39"]]), hn = /* @__PURE__ */ b(/* @__PURE__ */ N({
589
+ }), [["__scopeId", "data-v-d3dae0f1"]]), Cn = /* @__PURE__ */ b(/* @__PURE__ */ N({
589
590
  __name: "PageIndicator",
590
591
  props: {
591
592
  currentPage: {},
@@ -594,20 +595,20 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
594
595
  },
595
596
  setup(e) {
596
597
  let { t } = d();
597
- return (n, r) => (L(), A("div", {
598
+ return (n, r) => (L(), k("div", {
598
599
  class: "docx-editor-vue__page-indicator",
599
- style: P({ opacity: +!!e.visible }),
600
+ style: F({ opacity: +!!e.visible }),
600
601
  "aria-live": "polite",
601
602
  role: "status"
602
- }, B(V(t)("viewer.pageIndicator", {
603
+ }, z(B(t)("viewer.pageIndicator", {
603
604
  current: e.currentPage,
604
605
  total: e.totalPages
605
606
  })), 5));
606
607
  }
607
- }), [["__scopeId", "data-v-d117bf6e"]]), gn = { class: "hf-editor__label" }, _n = {
608
+ }), [["__scopeId", "data-v-877b9ee2"]]), wn = { class: "hf-editor__label" }, Tn = {
608
609
  class: "hf-editor__actions",
609
610
  style: { position: "relative" }
610
- }, vn = /* @__PURE__ */ b(/* @__PURE__ */ N({
611
+ }, En = /* @__PURE__ */ b(/* @__PURE__ */ N({
611
612
  __name: "InlineHeaderFooterEditor",
612
613
  props: {
613
614
  isOpen: { type: Boolean },
@@ -625,7 +626,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
625
626
  function o(e) {
626
627
  let t = n.view;
627
628
  if (!t) return;
628
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Me.nodes.field.create({
629
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Ne.nodes.field.create({
629
630
  fieldType: e,
630
631
  instruction: ` ${e} \\* MERGEFORMAT `,
631
632
  fieldKind: "simple",
@@ -645,68 +646,68 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
645
646
  pointerEvents: "none"
646
647
  });
647
648
  }
648
- W(() => n.isOpen, (e) => {
649
+ U(() => n.isOpen, (e) => {
649
650
  e && (s(), n.view?.focus());
650
- }), W(() => n.targetRect, () => {
651
+ }), U(() => n.targetRect, () => {
651
652
  n.isOpen && s();
652
653
  }, { deep: !0 });
653
654
  function c() {
654
- n.view && (r("save", st(n.view.state.doc)), r("close"));
655
+ n.view && (r("save", dt(n.view.state.doc)), r("close"));
655
656
  }
656
- return (t, n) => e.isOpen ? (L(), A("div", {
657
+ return (t, n) => e.isOpen ? (L(), k("div", {
657
658
  key: 0,
658
659
  class: "hf-editor",
659
- style: P(i.value)
660
- }, [j("div", {
661
- class: le(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
660
+ style: F(i.value)
661
+ }, [A("div", {
662
+ class: ce(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
662
663
  onMousedown: n[8] ||= q(() => {}, ["stop"]),
663
664
  onContextmenu: n[9] ||= q(() => {}, ["stop"])
664
- }, [j("span", gn, B(e.position === "header" ? "Header" : "Footer"), 1), j("div", _n, [
665
- j("button", {
665
+ }, [A("span", wn, z(e.position === "header" ? "Header" : "Footer"), 1), A("div", Tn, [
666
+ A("button", {
666
667
  class: "hf-editor__btn",
667
668
  title: "Options",
668
669
  onMousedown: n[0] ||= q(() => {}, ["prevent"]),
669
670
  onClick: n[1] ||= (e) => a.value = !a.value
670
671
  }, " Options ▾ ", 32),
671
- a.value ? (L(), A("div", {
672
+ a.value ? (L(), k("div", {
672
673
  key: 0,
673
674
  class: "hf-editor__dropdown",
674
675
  onMousedown: n[4] ||= q(() => {}, ["stop"]),
675
676
  onContextmenu: n[5] ||= q(() => {}, ["stop"])
676
- }, [j("button", {
677
+ }, [A("button", {
677
678
  type: "button",
678
679
  class: "hf-editor__dropdown-item",
679
680
  onClick: n[2] ||= (e) => {
680
681
  a.value = !1, o("PAGE");
681
682
  }
682
- }, " Insert current page number "), j("button", {
683
+ }, " Insert current page number "), A("button", {
683
684
  type: "button",
684
685
  class: "hf-editor__dropdown-item",
685
686
  onClick: n[3] ||= (e) => {
686
687
  a.value = !1, o("NUMPAGES");
687
688
  }
688
- }, " Insert total page count ")], 32)) : k("", !0),
689
- j("button", {
689
+ }, " Insert total page count ")], 32)) : O("", !0),
690
+ A("button", {
690
691
  class: "hf-editor__btn",
691
692
  title: "Remove",
692
693
  onMousedown: n[6] ||= q((e) => t.$emit("remove"), ["prevent"])
693
694
  }, " Remove ", 32),
694
- j("button", {
695
+ A("button", {
695
696
  class: "hf-editor__btn hf-editor__btn--primary",
696
697
  title: "Save",
697
698
  onMousedown: q(c, ["prevent"])
698
699
  }, " Save ", 32),
699
- j("button", {
700
+ A("button", {
700
701
  class: "hf-editor__btn",
701
702
  title: "Cancel",
702
703
  onMousedown: n[7] ||= q((e) => t.$emit("close"), ["prevent"])
703
704
  }, " Cancel ", 32)
704
- ])], 34)], 4)) : k("", !0);
705
+ ])], 34)], 4)) : O("", !0);
705
706
  }
706
- }), [["__scopeId", "data-v-e93a9f94"]]), yn = ["role"], bn = {
707
+ }), [["__scopeId", "data-v-81468575"]]), Dn = ["role"], On = {
707
708
  key: 0,
708
709
  class: "layout-sdt-widget-empty"
709
- }, xn = ["aria-selected", "onClick"], Sn = ["value"], Cn = ".layout-sdt-widget, .layout-inline-sdt-widget", wn = /* @__PURE__ */ N({
710
+ }, kn = ["aria-selected", "onClick"], An = ["value"], jn = ".layout-sdt-widget, .layout-inline-sdt-widget", Mn = /* @__PURE__ */ N({
710
711
  __name: "ContentControlWidgets",
711
712
  props: {
712
713
  container: {},
@@ -733,7 +734,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
733
734
  function s(e, t) {
734
735
  let n = i.view;
735
736
  if (n) try {
736
- let r = e.pos == null ? e.tag ? Fe(n.state, { tag: e.tag }, t) : null : Pe(n.state, e.pos, t);
737
+ let r = e.pos == null ? e.tag ? Ie(n.state, { tag: e.tag }, t) : null : Fe(n.state, e.pos, t);
737
738
  if (!r) return;
738
739
  n.dispatch(r), n.focus();
739
740
  } catch {}
@@ -742,18 +743,18 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
742
743
  function c(e) {
743
744
  let n = i.view, r = t(e.dataset.sdtGroupId);
744
745
  if (!(!n || r == null)) try {
745
- let t = e.dataset.sdtRepeat === "add" ? De(n.state, r) : Z(n.state, r);
746
+ let t = e.dataset.sdtRepeat === "add" ? Oe(n.state, r) : Z(n.state, r);
746
747
  n.dispatch(t), n.focus();
747
748
  } catch {}
748
749
  }
749
750
  function l(e) {
750
751
  let t = e.target;
751
- (t?.closest?.(Cn) || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
752
+ (t?.closest?.(jn) || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
752
753
  }
753
754
  function u(e) {
754
755
  let t = i.view, n = e.dataset.sdtWidget, o = r(e);
755
756
  if (!t || !n || !o) return;
756
- let c = o.pos == null ? o.tag ? Ae(t.state.doc, { tag: o.tag })[0] : void 0 : Ae(t.state.doc).find((e) => e.pos === o.pos), l = e.getBoundingClientRect();
757
+ let c = o.pos == null ? o.tag ? je(t.state.doc, { tag: o.tag })[0] : void 0 : je(t.state.doc).find((e) => e.pos === o.pos), l = e.getBoundingClientRect();
757
758
  n === "checkbox" ? s(o, {
758
759
  kind: "checkbox",
759
760
  checked: !c?.checked
@@ -778,12 +779,12 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
778
779
  e.preventDefault(), e.stopPropagation(), c(t);
779
780
  return;
780
781
  }
781
- let n = e.target?.closest?.(Cn);
782
+ let n = e.target?.closest?.(jn);
782
783
  n && (e.preventDefault(), e.stopPropagation(), u(n));
783
784
  }
784
785
  function f(e) {
785
786
  if (e.key !== "Enter" && e.key !== " ") return;
786
- let t = e.target?.closest?.(Cn);
787
+ let t = e.target?.closest?.(jn);
787
788
  t && (e.preventDefault(), u(t));
788
789
  }
789
790
  function p(e) {
@@ -793,10 +794,10 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
793
794
  e.key === "Escape" && (a.value = null);
794
795
  }
795
796
  let h = null;
796
- W(() => i.container, (e) => {
797
+ U(() => i.container, (e) => {
797
798
  h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), h = e ?? null, h && (h.addEventListener("mousedown", l), h.addEventListener("click", d), h.addEventListener("keydown", f));
798
- }, { immediate: !0 }), W(a, (e) => {
799
- e ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", m), e.kind === "dropdown" && ce(() => {
799
+ }, { immediate: !0 }), U(a, (e) => {
800
+ e ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", m), e.kind === "dropdown" && se(() => {
800
801
  let e = o.value?.querySelectorAll(".layout-sdt-widget-option");
801
802
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
802
803
  })) : (document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m));
@@ -809,7 +810,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
809
810
  let n = t.indexOf(document.activeElement);
810
811
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
811
812
  }
812
- F(() => {
813
+ I(() => {
813
814
  h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m);
814
815
  });
815
816
  function _(e) {
@@ -819,13 +820,13 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
819
820
  date: t
820
821
  });
821
822
  }
822
- return (e, t) => a.value ? (L(), A("div", {
823
+ return (e, t) => a.value ? (L(), k("div", {
823
824
  key: 0,
824
825
  ref_key: "popupEl",
825
826
  ref: o,
826
827
  class: "layout-sdt-widget-popup",
827
828
  role: a.value.kind === "dropdown" ? "listbox" : void 0,
828
- style: P({
829
+ style: F({
829
830
  position: "fixed",
830
831
  top: a.value.y + "px",
831
832
  left: a.value.x + "px",
@@ -833,28 +834,28 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
833
834
  }),
834
835
  onKeydown: g,
835
836
  onMousedown: t[0] ||= q(() => {}, ["prevent"])
836
- }, [a.value.kind === "dropdown" ? (L(), A(w, { key: 0 }, [a.value.items.length === 0 ? (L(), A("div", bn, "No options")) : k("", !0), (L(!0), A(w, null, z(a.value.items, (e) => (L(), A("button", {
837
+ }, [a.value.kind === "dropdown" ? (L(), k(w, { key: 0 }, [a.value.items.length === 0 ? (L(), k("div", On, "No options")) : O("", !0), (L(!0), k(w, null, ue(a.value.items, (e) => (L(), k("button", {
837
838
  key: e.value,
838
839
  type: "button",
839
840
  role: "option",
840
841
  "aria-selected": e.displayText === a.value.current,
841
- class: le(["layout-sdt-widget-option", { "is-selected": e.displayText === a.value.current }]),
842
+ class: ce(["layout-sdt-widget-option", { "is-selected": e.displayText === a.value.current }]),
842
843
  onClick: (t) => s(a.value.target, {
843
844
  kind: "dropdown",
844
845
  value: e.value
845
846
  })
846
- }, B(e.displayText), 11, xn))), 128))], 64)) : (L(), A("input", {
847
+ }, z(e.displayText), 11, kn))), 128))], 64)) : (L(), k("input", {
847
848
  key: 1,
848
849
  type: "date",
849
850
  class: "layout-sdt-widget-date",
850
851
  value: a.value.current,
851
852
  onChange: _
852
- }, null, 40, Sn))], 44, yn)) : k("", !0);
853
+ }, null, 40, An))], 44, Dn)) : O("", !0);
853
854
  }
854
- }), Tn = {
855
+ }), Nn = {
855
856
  key: 0,
856
857
  class: "docx-editor-vue__title-bar"
857
- }, En = { class: "docx-editor-vue__title-bar-left" }, Dn = { class: "docx-editor-vue__title-bar-center" }, On = { class: "docx-editor-vue__title-bar-right" }, kn = /* @__PURE__ */ N({
858
+ }, Pn = { class: "docx-editor-vue__title-bar-left" }, Fn = { class: "docx-editor-vue__title-bar-center" }, In = { class: "docx-editor-vue__title-bar-right" }, Ln = /* @__PURE__ */ N({
858
859
  __name: "DocxEditorMenuBar",
859
860
  props: {
860
861
  showMenuBar: { type: Boolean },
@@ -873,9 +874,9 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
873
874
  ],
874
875
  setup(e, { emit: t }) {
875
876
  let n = t;
876
- return (t, r) => e.showMenuBar ? (L(), A("div", Tn, [
877
- j("div", En, [e.renderLogo ? (L(), O(de(e.renderLogo), { key: 0 })) : k("", !0), ue(t.$slots, "title-bar-left")]),
878
- j("div", Dn, [M(h, {
877
+ return (t, r) => e.showMenuBar ? (L(), k("div", Nn, [
878
+ A("div", Pn, [e.renderLogo ? (L(), D(fe(e.renderLogo), { key: 0 })) : O("", !0), de(t.$slots, "title-bar-left")]),
879
+ A("div", Fn, [M(h, {
879
880
  "model-value": e.documentName,
880
881
  editable: e.documentNameEditable,
881
882
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
@@ -883,53 +884,50 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
883
884
  onAction: r[1] ||= (e) => n("menu-action", e),
884
885
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
885
886
  })]),
886
- j("div", On, [ue(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), O(de(e.renderTitleBarRight), { key: 0 })) : k("", !0)])
887
- ])) : k("", !0);
887
+ A("div", In, [de(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), D(fe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
888
+ ])) : O("", !0);
888
889
  }
889
- }), An = ["aria-label"], jn = { class: "wm-header" }, Mn = { class: "wm-body" }, Nn = { class: "wm-radio-row" }, $ = ["checked"], Pn = {
890
+ }), Rn = ["aria-label"], $ = { class: "wm-header" }, zn = { class: "wm-body" }, Bn = { class: "wm-radio-row" }, Vn = ["checked"], Hn = {
890
891
  for: "wm-none",
891
892
  class: "wm-inline-label"
892
- }, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
893
+ }, Un = { class: "wm-radio-row" }, Wn = ["checked"], Gn = {
893
894
  for: "wm-picture",
894
895
  class: "wm-inline-label"
895
- }, Rn = {
896
+ }, Kn = {
896
897
  key: 0,
897
898
  class: "wm-subform"
898
- }, zn = { class: "wm-row" }, Bn = {
899
+ }, qn = { class: "wm-row" }, Jn = {
899
900
  key: 0,
900
901
  class: "wm-row"
901
- }, Vn = ["src"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-inline-label" }, Gn = { class: "wm-radio-row" }, Kn = ["checked"], qn = {
902
+ }, Yn = ["src"], Xn = { class: "wm-row" }, Zn = { class: "wm-label" }, Qn = { class: "wm-inline-label" }, $n = { class: "wm-radio-row" }, er = ["checked"], tr = {
902
903
  for: "wm-text",
903
904
  class: "wm-inline-label"
904
- }, Jn = {
905
+ }, nr = {
905
906
  key: 1,
906
907
  class: "wm-subform"
907
- }, Yn = { class: "wm-row" }, Xn = { class: "wm-label" }, Zn = ["value"], Qn = ["value"], $n = { class: "wm-row" }, er = { class: "wm-label" }, tr = { class: "wm-row" }, nr = { class: "wm-label" }, rr = ["value"], ir = { class: "wm-row" }, ar = { class: "wm-label" }, or = { class: "wm-inline-label" }, sr = { class: "wm-row" }, cr = { class: "wm-label" }, lr = { class: "wm-row" }, ur = { class: "wm-label" }, dr = { class: "wm-inline-label" }, fr = ["checked"], pr = { class: "wm-inline-label" }, mr = ["checked"], hr = { class: "wm-inline-label" }, gr = { class: "wm-footer" }, _r = ["disabled"], vr = /* @__PURE__ */ b(/* @__PURE__ */ N({
908
+ }, rr = {
909
+ key: 0,
910
+ class: "wm-row"
911
+ }, ir = { class: "wm-label" }, ar = ["value"], or = ["value"], sr = { class: "wm-row" }, cr = { class: "wm-label" }, lr = { class: "wm-row" }, ur = { class: "wm-label" }, dr = ["value"], fr = { class: "wm-row" }, pr = { class: "wm-label" }, mr = { class: "wm-inline-label" }, hr = { class: "wm-row" }, gr = { class: "wm-label" }, _r = { class: "wm-row" }, vr = { class: "wm-label" }, yr = { class: "wm-inline-label" }, br = ["checked"], xr = { class: "wm-inline-label" }, Sr = ["checked"], Cr = { class: "wm-inline-label" }, wr = { class: "wm-footer" }, Tr = ["disabled"], Er = /* @__PURE__ */ b(/* @__PURE__ */ N({
908
912
  __name: "WatermarkDialog",
909
913
  props: {
910
914
  isOpen: { type: Boolean },
911
- current: {}
915
+ current: {},
916
+ presets: { default: () => pt }
912
917
  },
913
918
  emits: ["close", "apply"],
914
919
  setup(e, { emit: t }) {
915
920
  let n = [
916
- "CONFIDENTIAL",
917
- "DRAFT",
918
- "DO NOT COPY",
919
- "SAMPLE",
920
- "URGENT",
921
- "ASAP"
922
- ], r = [
923
921
  "Calibri",
924
922
  "Arial",
925
923
  "Times New Roman",
926
924
  "Georgia",
927
925
  "Verdana",
928
926
  "Courier New"
929
- ], { t: i } = d(), a = e, o = t, s = R("none"), c = R("CONFIDENTIAL"), l = R("Calibri"), u = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
930
- W(() => a.isOpen, (e) => {
927
+ ], { t: r } = d(), i = e, a = E(() => i.presets), o = t, s = R("none"), c = R(i.presets[0] ?? "CONFIDENTIAL"), l = R("Calibri"), u = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
928
+ U(() => i.isOpen, (e) => {
931
929
  if (!e) return;
932
- let t = a.current;
930
+ let t = i.current;
933
931
  t?.kind === "text" ? (s.value = "text", c.value = t.text, l.value = t.font || "Calibri", u.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (s.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
934
932
  widthEmu: t.widthEmu,
935
933
  heightEmu: t.heightEmu
@@ -949,7 +947,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
949
947
  if (g.value = e, _.value = void 0, !e) return;
950
948
  let t = new Image();
951
949
  t.onload = () => {
952
- _.value = lt(t.naturalWidth, t.naturalHeight);
950
+ _.value = mt(t.naturalWidth, t.naturalHeight);
953
951
  }, t.src = e;
954
952
  }, n.readAsDataURL(t);
955
953
  }
@@ -982,147 +980,147 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
982
980
  function te(e) {
983
981
  e.key === "Escape" && C();
984
982
  }
985
- return (t, a) => e.isOpen ? (L(), A("div", {
983
+ return (t, i) => e.isOpen ? (L(), k("div", {
986
984
  key: 0,
987
985
  class: "wm-overlay",
988
986
  onMousedown: q(C, ["self"]),
989
987
  onKeydown: te
990
- }, [j("div", {
988
+ }, [A("div", {
991
989
  class: "wm-dialog",
992
990
  role: "dialog",
993
- "aria-label": V(i)("dialogs.watermark.title"),
994
- onMousedown: a[13] ||= q(() => {}, ["stop"])
991
+ "aria-label": B(r)("dialogs.watermark.title"),
992
+ onMousedown: i[13] ||= q(() => {}, ["stop"])
995
993
  }, [
996
- j("div", jn, B(V(i)("dialogs.watermark.title")), 1),
997
- j("div", Mn, [
998
- j("div", Nn, [j("input", {
994
+ A("div", $, z(B(r)("dialogs.watermark.title")), 1),
995
+ A("div", zn, [
996
+ A("div", Bn, [A("input", {
999
997
  id: "wm-none",
1000
998
  type: "radio",
1001
999
  checked: s.value === "none",
1002
- onChange: a[0] ||= (e) => s.value = "none"
1003
- }, null, 40, $), j("label", Pn, B(V(i)("dialogs.watermark.noWatermark")), 1)]),
1004
- j("div", Fn, [j("input", {
1000
+ onChange: i[0] ||= (e) => s.value = "none"
1001
+ }, null, 40, Vn), A("label", Hn, z(B(r)("dialogs.watermark.noWatermark")), 1)]),
1002
+ A("div", Un, [A("input", {
1005
1003
  id: "wm-picture",
1006
1004
  type: "radio",
1007
1005
  checked: s.value === "picture",
1008
- onChange: a[1] ||= (e) => s.value = "picture"
1009
- }, null, 40, In), j("label", Ln, B(V(i)("dialogs.watermark.picture")), 1)]),
1010
- s.value === "picture" ? (L(), A("div", Rn, [
1011
- j("div", zn, [j("input", {
1006
+ onChange: i[1] ||= (e) => s.value = "picture"
1007
+ }, null, 40, Wn), A("label", Gn, z(B(r)("dialogs.watermark.picture")), 1)]),
1008
+ s.value === "picture" ? (L(), k("div", Kn, [
1009
+ A("div", qn, [A("input", {
1012
1010
  type: "file",
1013
1011
  accept: "image/*",
1014
1012
  onChange: S
1015
1013
  }, null, 32)]),
1016
- g.value ? (L(), A("div", Bn, [j("img", {
1014
+ g.value ? (L(), k("div", Jn, [A("img", {
1017
1015
  src: g.value,
1018
1016
  alt: "",
1019
1017
  class: "wm-preview"
1020
- }, null, 8, Vn)])) : k("", !0),
1021
- j("div", Hn, [
1022
- j("span", Un, B(V(i)("dialogs.watermark.scale")), 1),
1023
- G(j("input", {
1018
+ }, null, 8, Yn)])) : O("", !0),
1019
+ A("div", Xn, [
1020
+ A("span", Zn, z(B(r)("dialogs.watermark.scale")), 1),
1021
+ G(A("input", {
1024
1022
  class: "wm-input wm-input--narrow",
1025
1023
  type: "number",
1026
1024
  min: "10",
1027
1025
  max: "500",
1028
- "onUpdate:modelValue": a[2] ||= (e) => v.value = e
1026
+ "onUpdate:modelValue": i[2] ||= (e) => v.value = e
1029
1027
  }, null, 512), [[
1030
- U,
1028
+ H,
1031
1029
  v.value,
1032
1030
  void 0,
1033
1031
  { number: !0 }
1034
1032
  ]]),
1035
- a[14] ||= j("span", { class: "wm-unit" }, "%", -1)
1033
+ i[14] ||= A("span", { class: "wm-unit" }, "%", -1)
1036
1034
  ]),
1037
- j("label", Wn, [G(j("input", {
1035
+ A("label", Qn, [G(A("input", {
1038
1036
  type: "checkbox",
1039
- "onUpdate:modelValue": a[3] ||= (e) => y.value = e
1040
- }, null, 512), [[H, y.value]]), ae(" " + B(V(i)("dialogs.watermark.washout")), 1)])
1041
- ])) : k("", !0),
1042
- j("div", Gn, [j("input", {
1037
+ "onUpdate:modelValue": i[3] ||= (e) => y.value = e
1038
+ }, null, 512), [[V, y.value]]), j(" " + z(B(r)("dialogs.watermark.washout")), 1)])
1039
+ ])) : O("", !0),
1040
+ A("div", $n, [A("input", {
1043
1041
  id: "wm-text",
1044
1042
  type: "radio",
1045
1043
  checked: s.value === "text",
1046
- onChange: a[4] ||= (e) => s.value = "text"
1047
- }, null, 40, Kn), j("label", qn, B(V(i)("dialogs.watermark.text")), 1)]),
1048
- s.value === "text" ? (L(), A("div", Jn, [
1049
- j("div", Yn, [j("span", Xn, B(V(i)("dialogs.watermark.presetLabel")), 1), j("select", {
1044
+ onChange: i[4] ||= (e) => s.value = "text"
1045
+ }, null, 40, er), A("label", tr, z(B(r)("dialogs.watermark.text")), 1)]),
1046
+ s.value === "text" ? (L(), k("div", nr, [
1047
+ a.value.length > 0 ? (L(), k("div", rr, [A("span", ir, z(B(r)("dialogs.watermark.presetLabel")), 1), A("select", {
1050
1048
  class: "wm-input",
1051
- value: n.includes(c.value) ? c.value : "",
1049
+ value: a.value.includes(c.value) ? c.value : "",
1052
1050
  onChange: x
1053
- }, [a[15] ||= j("option", { value: "" }, "—", -1), (L(), A(w, null, z(n, (e) => j("option", {
1051
+ }, [i[15] ||= A("option", { value: "" }, "—", -1), (L(!0), k(w, null, ue(a.value, (e) => (L(), k("option", {
1054
1052
  key: e,
1055
1053
  value: e
1056
- }, B(e), 9, Qn)), 64))], 40, Zn)]),
1057
- j("div", $n, [j("span", er, B(V(i)("dialogs.watermark.textLabel")), 1), G(j("input", {
1054
+ }, z(e), 9, or))), 128))], 40, ar)])) : O("", !0),
1055
+ A("div", sr, [A("span", cr, z(B(r)("dialogs.watermark.textLabel")), 1), G(A("input", {
1058
1056
  class: "wm-input",
1059
- "onUpdate:modelValue": a[5] ||= (e) => c.value = e
1060
- }, null, 512), [[U, c.value]])]),
1061
- j("div", tr, [j("span", nr, B(V(i)("dialogs.watermark.fontLabel")), 1), G(j("select", {
1057
+ "onUpdate:modelValue": i[5] ||= (e) => c.value = e
1058
+ }, null, 512), [[H, c.value]])]),
1059
+ A("div", lr, [A("span", ur, z(B(r)("dialogs.watermark.fontLabel")), 1), G(A("select", {
1062
1060
  class: "wm-input",
1063
- "onUpdate:modelValue": a[6] ||= (e) => l.value = e
1064
- }, [(L(), A(w, null, z(r, (e) => j("option", {
1061
+ "onUpdate:modelValue": i[6] ||= (e) => l.value = e
1062
+ }, [(L(), k(w, null, ue(n, (e) => A("option", {
1065
1063
  key: e,
1066
1064
  value: e
1067
- }, B(e), 9, rr)), 64))], 512), [[pe, l.value]])]),
1068
- j("div", ir, [
1069
- j("span", ar, B(V(i)("dialogs.watermark.sizeLabel")), 1),
1070
- j("label", or, [G(j("input", {
1065
+ }, z(e), 9, dr)), 64))], 512), [[me, l.value]])]),
1066
+ A("div", fr, [
1067
+ A("span", pr, z(B(r)("dialogs.watermark.sizeLabel")), 1),
1068
+ A("label", mr, [G(A("input", {
1071
1069
  type: "checkbox",
1072
- "onUpdate:modelValue": a[7] ||= (e) => u.value = e
1073
- }, null, 512), [[H, u.value]]), ae(" " + B(V(i)("dialogs.watermark.sizeAuto")), 1)]),
1074
- u.value ? k("", !0) : G((L(), A("input", {
1070
+ "onUpdate:modelValue": i[7] ||= (e) => u.value = e
1071
+ }, null, 512), [[V, u.value]]), j(" " + z(B(r)("dialogs.watermark.sizeAuto")), 1)]),
1072
+ u.value ? O("", !0) : G((L(), k("input", {
1075
1073
  key: 0,
1076
1074
  class: "wm-input wm-input--narrow",
1077
1075
  type: "number",
1078
1076
  min: "8",
1079
1077
  max: "200",
1080
- "onUpdate:modelValue": a[8] ||= (e) => f.value = e
1078
+ "onUpdate:modelValue": i[8] ||= (e) => f.value = e
1081
1079
  }, null, 512)), [[
1082
- U,
1080
+ H,
1083
1081
  f.value,
1084
1082
  void 0,
1085
1083
  { number: !0 }
1086
1084
  ]])
1087
1085
  ]),
1088
- j("div", sr, [j("span", cr, B(V(i)("dialogs.watermark.colorLabel")), 1), G(j("input", {
1086
+ A("div", hr, [A("span", gr, z(B(r)("dialogs.watermark.colorLabel")), 1), G(A("input", {
1089
1087
  type: "color",
1090
- "onUpdate:modelValue": a[9] ||= (e) => p.value = e
1091
- }, null, 512), [[U, p.value]])]),
1092
- j("div", lr, [
1093
- j("span", ur, B(V(i)("dialogs.watermark.layoutLabel")), 1),
1094
- j("label", dr, [j("input", {
1088
+ "onUpdate:modelValue": i[9] ||= (e) => p.value = e
1089
+ }, null, 512), [[H, p.value]])]),
1090
+ A("div", _r, [
1091
+ A("span", vr, z(B(r)("dialogs.watermark.layoutLabel")), 1),
1092
+ A("label", yr, [A("input", {
1095
1093
  type: "radio",
1096
1094
  name: "wm-layout",
1097
1095
  checked: m.value === "diagonal",
1098
- onChange: a[10] ||= (e) => m.value = "diagonal"
1099
- }, null, 40, fr), ae(" " + B(V(i)("dialogs.watermark.diagonal")), 1)]),
1100
- j("label", pr, [j("input", {
1096
+ onChange: i[10] ||= (e) => m.value = "diagonal"
1097
+ }, null, 40, br), j(" " + z(B(r)("dialogs.watermark.diagonal")), 1)]),
1098
+ A("label", xr, [A("input", {
1101
1099
  type: "radio",
1102
1100
  name: "wm-layout",
1103
1101
  checked: m.value === "horizontal",
1104
- onChange: a[11] ||= (e) => m.value = "horizontal"
1105
- }, null, 40, mr), ae(" " + B(V(i)("dialogs.watermark.horizontal")), 1)])
1102
+ onChange: i[11] ||= (e) => m.value = "horizontal"
1103
+ }, null, 40, Sr), j(" " + z(B(r)("dialogs.watermark.horizontal")), 1)])
1106
1104
  ]),
1107
- j("label", hr, [G(j("input", {
1105
+ A("label", Cr, [G(A("input", {
1108
1106
  type: "checkbox",
1109
- "onUpdate:modelValue": a[12] ||= (e) => h.value = e
1110
- }, null, 512), [[H, h.value]]), ae(" " + B(V(i)("dialogs.watermark.semitransparent")), 1)])
1111
- ])) : k("", !0)
1107
+ "onUpdate:modelValue": i[12] ||= (e) => h.value = e
1108
+ }, null, 512), [[V, h.value]]), j(" " + z(B(r)("dialogs.watermark.semitransparent")), 1)])
1109
+ ])) : O("", !0)
1112
1110
  ]),
1113
- j("div", gr, [j("button", {
1111
+ A("div", wr, [A("button", {
1114
1112
  type: "button",
1115
1113
  class: "wm-btn",
1116
1114
  onClick: C
1117
- }, B(V(i)("dialogs.watermark.cancelButton")), 1), j("button", {
1115
+ }, z(B(r)("dialogs.watermark.cancelButton")), 1), A("button", {
1118
1116
  type: "button",
1119
- class: le(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1117
+ class: ce(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1120
1118
  disabled: b.value,
1121
1119
  onClick: ee
1122
- }, B(V(i)("dialogs.watermark.applyButton")), 11, _r)])
1123
- ], 40, An)], 32)) : k("", !0);
1120
+ }, z(B(r)("dialogs.watermark.applyButton")), 11, Tr)])
1121
+ ], 40, Rn)], 32)) : O("", !0);
1124
1122
  }
1125
- }), [["__scopeId", "data-v-5edfdc47"]]), yr = /* @__PURE__ */ N({
1123
+ }), [["__scopeId", "data-v-cf7e36c1"]]), Dr = /* @__PURE__ */ N({
1126
1124
  __name: "DocxEditorDialogs",
1127
1125
  props: {
1128
1126
  view: {},
@@ -1137,6 +1135,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1137
1135
  showPageSetup: { type: Boolean },
1138
1136
  showWatermark: { type: Boolean },
1139
1137
  currentWatermark: {},
1138
+ watermarkPresets: {},
1140
1139
  showKeyboardShortcuts: { type: Boolean }
1141
1140
  },
1142
1141
  emits: [
@@ -1155,7 +1154,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1155
1154
  ],
1156
1155
  setup(t, { emit: n }) {
1157
1156
  let r = n;
1158
- return (n, a) => (L(), A(w, null, [
1157
+ return (n, a) => (L(), k(w, null, [
1159
1158
  M(s, {
1160
1159
  "is-open": t.showFindReplace,
1161
1160
  view: t.view,
@@ -1199,22 +1198,27 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1199
1198
  onClose: a[7] ||= (e) => r("update:showPageSetup", !1),
1200
1199
  onApply: a[8] ||= (e) => r("page-setup-apply", e)
1201
1200
  }, null, 8, ["is-open", "section-properties"]),
1202
- M(vr, {
1201
+ M(Er, {
1203
1202
  "is-open": t.showWatermark,
1204
1203
  current: t.currentWatermark,
1204
+ presets: t.watermarkPresets,
1205
1205
  onClose: a[9] ||= (e) => r("update:showWatermark", !1),
1206
1206
  onApply: a[10] ||= (e) => r("watermark-apply", e)
1207
- }, null, 8, ["is-open", "current"]),
1207
+ }, null, 8, [
1208
+ "is-open",
1209
+ "current",
1210
+ "presets"
1211
+ ]),
1208
1212
  M(u, {
1209
1213
  "is-open": t.showKeyboardShortcuts,
1210
1214
  onClose: a[11] ||= (e) => r("update:showKeyboardShortcuts", !1)
1211
1215
  }, null, 8, ["is-open"])
1212
1216
  ], 64));
1213
1217
  }
1214
- }), br = ["disabled", "onMousedown"], xr = { class: "ctx-menu__label" }, Sr = {
1218
+ }), Or = ["disabled", "onMousedown"], kr = { class: "ctx-menu__label" }, Ar = {
1215
1219
  key: 0,
1216
1220
  class: "ctx-menu__shortcut"
1217
- }, Cr = 220, wr = 32, Tr = 10, Er = /* @__PURE__ */ b(/* @__PURE__ */ N({
1221
+ }, jr = 220, Mr = 32, Nr = 10, Pr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1218
1222
  __name: "TextContextMenu",
1219
1223
  props: {
1220
1224
  isOpen: { type: Boolean },
@@ -1347,8 +1351,8 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1347
1351
  disabled: !n.canSplitCell
1348
1352
  }), e;
1349
1353
  }), s = E(() => {
1350
- let e = n.position.x, t = n.position.y, r = o.value.filter((e) => !e.divider).length, i = o.value.filter((e) => e.divider).length, a = r * wr + i * 9;
1351
- return typeof window < "u" && (e + Cr + Tr > window.innerWidth && (e = window.innerWidth - Cr - Tr), t + a + Tr > window.innerHeight && (t = window.innerHeight - a - Tr)), {
1354
+ let e = n.position.x, t = n.position.y, r = o.value.filter((e) => !e.divider).length, i = o.value.filter((e) => e.divider).length, a = r * Mr + i * 9;
1355
+ return typeof window < "u" && (e + jr + Nr > window.innerWidth && (e = window.innerWidth - jr - Nr), t + a + Nr > window.innerHeight && (t = window.innerHeight - a - Nr)), {
1352
1356
  position: "fixed",
1353
1357
  left: `${e}px`,
1354
1358
  top: `${t}px`,
@@ -1361,50 +1365,50 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1361
1365
  function l(e) {
1362
1366
  e.key === "Escape" && r("close");
1363
1367
  }
1364
- return W(() => n.isOpen, (e) => {
1365
- e && ce(() => a.value?.focus());
1366
- }), (t, n) => (L(), O(T, { to: "body" }, [e.isOpen ? (L(), A("div", {
1368
+ return U(() => n.isOpen, (e) => {
1369
+ e && se(() => a.value?.focus());
1370
+ }), (t, n) => (L(), D(T, { to: "body" }, [e.isOpen ? (L(), k("div", {
1367
1371
  key: 0,
1368
1372
  class: "ctx-menu-backdrop",
1369
1373
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1370
1374
  onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
1371
- }, null, 32)) : k("", !0), e.isOpen ? (L(), A("div", {
1375
+ }, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
1372
1376
  key: 1,
1373
1377
  ref_key: "menuRef",
1374
1378
  ref: a,
1375
1379
  class: "ctx-menu",
1376
- style: P(s.value),
1380
+ style: F(s.value),
1377
1381
  onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
1378
1382
  onKeydown: l
1379
- }, [(L(!0), A(w, null, z(o.value, (e, t) => (L(), A("button", {
1383
+ }, [(L(!0), k(w, null, ue(o.value, (e, t) => (L(), k("button", {
1380
1384
  key: e.id || t,
1381
- class: le(["ctx-menu__item", {
1385
+ class: ce(["ctx-menu__item", {
1382
1386
  "ctx-menu__item--disabled": e.disabled,
1383
1387
  "ctx-menu__item--divider": e.divider
1384
1388
  }]),
1385
1389
  disabled: e.disabled,
1386
1390
  onMousedown: q((t) => c(e.action), ["prevent"])
1387
- }, [j("span", xr, B(e.label), 1), e.shortcut ? (L(), A("span", Sr, B(e.shortcut), 1)) : k("", !0)], 42, br))), 128))], 36)) : k("", !0)]));
1391
+ }, [A("span", kr, z(e.label), 1), e.shortcut ? (L(), k("span", Ar, z(e.shortcut), 1)) : O("", !0)], 42, Or))), 128))], 36)) : O("", !0)]));
1388
1392
  }
1389
- }), [["__scopeId", "data-v-b2122da6"]]), Dr = ["aria-label"], Or = { class: "image-ctx-menu__icon" }, kr = { class: "image-ctx-menu__label" }, Ar = {
1393
+ }), [["__scopeId", "data-v-852b8986"]]), Fr = ["aria-label"], Ir = { class: "image-ctx-menu__icon" }, Lr = { class: "image-ctx-menu__label" }, Rr = {
1390
1394
  key: 1,
1391
1395
  class: "image-ctx-menu__divider",
1392
1396
  role: "separator"
1393
- }, jr = [
1397
+ }, zr = [
1394
1398
  "data-wrap-type",
1395
1399
  "data-current",
1396
1400
  "data-disabled",
1397
1401
  "disabled",
1398
1402
  "title",
1399
1403
  "onClick"
1400
- ], Mr = { class: "image-ctx-menu__icon" }, Nr = { class: "image-ctx-menu__label" }, Pr = ["aria-label"], Fr = ["disabled", "onClick"], Ir = { class: "image-ctx-menu__label" }, Lr = {
1404
+ ], Br = { class: "image-ctx-menu__icon" }, Vr = { class: "image-ctx-menu__label" }, Hr = ["aria-label"], Ur = ["disabled", "onClick"], Wr = { class: "image-ctx-menu__label" }, Gr = {
1401
1405
  key: 0,
1402
1406
  class: "image-ctx-menu__shortcut"
1403
- }, Rr = {
1407
+ }, Kr = {
1404
1408
  key: 0,
1405
1409
  class: "image-ctx-menu__divider",
1406
1410
  role: "separator"
1407
- }, zr = 18, Br = 260, Vr = 10, Hr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1411
+ }, qr = 18, Jr = 260, Yr = 10, Xr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1408
1412
  __name: "ImageContextMenu",
1409
1413
  props: {
1410
1414
  state: {},
@@ -1425,7 +1429,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1425
1429
  function a() {
1426
1430
  i("open-properties"), i("close");
1427
1431
  }
1428
- let { t: o } = d(), s = R(null), c = et, l = E(() => n.state ? nt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), u = {
1432
+ let { t: o } = d(), s = R(null), c = it, l = E(() => n.state ? ot(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), u = {
1429
1433
  inline: "wrap_text",
1430
1434
  squareLeft: "format_image_left",
1431
1435
  squareRight: "format_image_right",
@@ -1437,17 +1441,17 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1437
1441
  }
1438
1442
  let p = E(() => {
1439
1443
  if (!n.state) return {};
1440
- let e = et.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
1441
- return typeof window < "u" && (t + Br > window.innerWidth && (t = window.innerWidth - Br - Vr), r + e > window.innerHeight && (r = window.innerHeight - e - Vr), t < Vr && (t = Vr), r < Vr && (r = Vr)), {
1444
+ let e = it.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
1445
+ return typeof window < "u" && (t + Jr > window.innerWidth && (t = window.innerWidth - Jr - Yr), r + e > window.innerHeight && (r = window.innerHeight - e - Yr), t < Yr && (t = Yr), r < Yr && (r = Yr)), {
1442
1446
  position: "fixed",
1443
1447
  left: `${t}px`,
1444
1448
  top: `${r}px`,
1445
- minWidth: `${Br}px`,
1449
+ minWidth: `${Jr}px`,
1446
1450
  zIndex: 400
1447
1451
  };
1448
1452
  });
1449
1453
  function m(e) {
1450
- return n.state ? it(e, n.state.currentWrapType) : !1;
1454
+ return n.state ? ct(e, n.state.currentWrapType) : !1;
1451
1455
  }
1452
1456
  function h(e) {
1453
1457
  m(e) && (i("select", e.choice), i("close"));
@@ -1461,24 +1465,24 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1461
1465
  function v(e) {
1462
1466
  e.key === "Escape" && (e.preventDefault(), i("close"));
1463
1467
  }
1464
- return (t, n) => (L(), O(T, { to: "body" }, [e.state && e.state.open ? (L(), A("div", {
1468
+ return (t, n) => (L(), D(T, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1465
1469
  key: 0,
1466
1470
  class: "image-ctx-menu-backdrop",
1467
1471
  onMousedown: _,
1468
1472
  onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
1469
- }, null, 32)) : k("", !0), e.state && e.state.open ? (L(), A("div", {
1473
+ }, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
1470
1474
  key: 1,
1471
1475
  ref_key: "menuRef",
1472
1476
  ref: s,
1473
1477
  class: "image-ctx-menu",
1474
1478
  role: "menu",
1475
- "aria-label": V(o)("imageWrap.menu.ariaLabel"),
1479
+ "aria-label": B(o)("imageWrap.menu.ariaLabel"),
1476
1480
  "data-testid": "image-context-menu",
1477
- style: P(p.value),
1481
+ style: F(p.value),
1478
1482
  onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
1479
1483
  onKeydown: v
1480
1484
  }, [
1481
- e.canOpenProperties ? (L(), A("button", {
1485
+ e.canOpenProperties ? (L(), k("button", {
1482
1486
  key: 0,
1483
1487
  type: "button",
1484
1488
  role: "menuitem",
@@ -1486,49 +1490,49 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1486
1490
  "data-action": "open-properties",
1487
1491
  onMousedown: n[1] ||= q(() => {}, ["prevent"]),
1488
1492
  onClick: a
1489
- }, [j("span", Or, [M(r, {
1493
+ }, [A("span", Ir, [M(r, {
1490
1494
  name: "settings",
1491
- size: zr
1492
- })]), j("span", kr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : k("", !0),
1493
- e.canOpenProperties ? (L(), A("div", Ar)) : k("", !0),
1494
- (L(!0), A(w, null, z(V(c), (e) => (L(), A("button", {
1495
+ size: qr
1496
+ })]), A("span", Lr, z(B(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1497
+ e.canOpenProperties ? (L(), k("div", Rr)) : O("", !0),
1498
+ (L(!0), k(w, null, ue(B(c), (e) => (L(), k("button", {
1495
1499
  key: e.choice,
1496
1500
  type: "button",
1497
1501
  role: "menuitem",
1498
- class: le(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === l.value }]),
1502
+ class: ce(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === l.value }]),
1499
1503
  "data-wrap-type": e.choice,
1500
1504
  "data-current": e.choice === l.value ? "true" : "false",
1501
1505
  "data-disabled": m(e) ? "false" : "true",
1502
1506
  disabled: !m(e),
1503
- title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1507
+ title: B(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1504
1508
  onMousedown: n[2] ||= q(() => {}, ["prevent"]),
1505
1509
  onClick: (t) => h(e)
1506
1510
  }, [
1507
- j("span", Mr, [M(r, {
1511
+ A("span", Br, [M(r, {
1508
1512
  name: f(e.iconHint),
1509
- size: zr
1513
+ size: qr
1510
1514
  }, null, 8, ["name"])]),
1511
- j("span", Nr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1512
- e.choice === l.value ? (L(), A("span", {
1515
+ A("span", Vr, z(B(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1516
+ e.choice === l.value ? (L(), k("span", {
1513
1517
  key: 0,
1514
1518
  class: "image-ctx-menu__current-dot",
1515
- "aria-label": V(o)("imageWrap.menu.ariaLabel")
1516
- }, "●", 8, Pr)) : k("", !0)
1517
- ], 42, jr))), 128)),
1518
- e.textActions && e.textActions.length > 0 ? (L(), A(w, { key: 2 }, [n[5] ||= j("div", {
1519
+ "aria-label": B(o)("imageWrap.menu.ariaLabel")
1520
+ }, "●", 8, Hr)) : O("", !0)
1521
+ ], 42, zr))), 128)),
1522
+ e.textActions && e.textActions.length > 0 ? (L(), k(w, { key: 2 }, [n[5] ||= A("div", {
1519
1523
  class: "image-ctx-menu__divider",
1520
1524
  role: "separator"
1521
- }, null, -1), (L(!0), A(w, null, z(e.textActions, (e, t) => (L(), A(w, { key: `${e.action}-${t}` }, [j("button", {
1525
+ }, null, -1), (L(!0), k(w, null, ue(e.textActions, (e, t) => (L(), k(w, { key: `${e.action}-${t}` }, [A("button", {
1522
1526
  type: "button",
1523
1527
  role: "menuitem",
1524
1528
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1525
1529
  disabled: e.disabled,
1526
1530
  onMousedown: n[3] ||= q(() => {}, ["prevent"]),
1527
1531
  onClick: (t) => g(e)
1528
- }, [j("span", Ir, B(e.label), 1), e.shortcut ? (L(), A("span", Lr, B(e.shortcut), 1)) : k("", !0)], 40, Fr), e.dividerAfter ? (L(), A("div", Rr)) : k("", !0)], 64))), 128))], 64)) : k("", !0)
1529
- ], 44, Dr)) : k("", !0)]));
1532
+ }, [A("span", Wr, z(e.label), 1), e.shortcut ? (L(), k("span", Gr, z(e.shortcut), 1)) : O("", !0)], 40, Ur), e.dividerAfter ? (L(), k("div", Kr)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1533
+ ], 44, Fr)) : O("", !0)]));
1530
1534
  }
1531
- }), [["__scopeId", "data-v-5c21ca8c"]]), Ur = /* @__PURE__ */ N({
1535
+ }), [["__scopeId", "data-v-de904a04"]]), Zr = /* @__PURE__ */ N({
1532
1536
  __name: "DocxEditorOverlays",
1533
1537
  props: {
1534
1538
  readOnly: { type: Boolean },
@@ -1546,7 +1550,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1546
1550
  ],
1547
1551
  setup(e, { emit: t }) {
1548
1552
  let n = t;
1549
- return (t, r) => (L(), A(w, null, [M(Er, {
1553
+ return (t, r) => (L(), k(w, null, [M(Pr, {
1550
1554
  "is-open": e.contextMenu.isOpen,
1551
1555
  position: e.contextMenu.position,
1552
1556
  "has-selection": e.contextMenu.hasSelection,
@@ -1566,7 +1570,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1566
1570
  "on-image",
1567
1571
  "can-merge-cells",
1568
1572
  "can-split-cell"
1569
- ]), M(Hr, {
1573
+ ]), M(Xr, {
1570
1574
  state: e.imageContextMenu,
1571
1575
  "text-actions": e.imageContextMenuTextActions,
1572
1576
  "can-open-properties": e.canOpenImageProperties,
@@ -1580,7 +1584,7 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1580
1584
  "can-open-properties"
1581
1585
  ])], 64));
1582
1586
  }
1583
- }), Wr = ["href", "title"], Gr = ["title"], Kr = ["title"], qr = ["title"], Jr = { class: "docx-hyperlink-popup__edit-row" }, Yr = ["placeholder", "onKeydown"], Xr = { class: "docx-hyperlink-popup__edit-row" }, Zr = ["onKeydown"], Qr = ["disabled"], $r = /* @__PURE__ */ b(/* @__PURE__ */ N({
1587
+ }), Qr = ["href", "title"], $r = ["title"], ei = ["title"], ti = ["title"], ni = { class: "docx-hyperlink-popup__edit-row" }, ri = ["placeholder", "onKeydown"], ii = { class: "docx-hyperlink-popup__edit-row" }, ai = ["onKeydown"], oi = ["disabled"], si = /* @__PURE__ */ b(/* @__PURE__ */ N({
1584
1588
  __name: "HyperlinkPopup",
1585
1589
  props: {
1586
1590
  data: {},
@@ -1598,21 +1602,21 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1598
1602
  left: (r.data?.position.left ?? 0) + "px",
1599
1603
  top: (r.data?.position.top ?? 0) + "px"
1600
1604
  }));
1601
- W(() => r.data?.href, () => {
1605
+ U(() => r.data?.href, () => {
1602
1606
  a.value = !1;
1603
1607
  });
1604
1608
  let u = null, f = null;
1605
1609
  function p() {
1606
1610
  f &&= (clearTimeout(f), null), u &&= (document.removeEventListener("mousedown", u), null);
1607
1611
  }
1608
- W(() => r.data, (e) => {
1612
+ U(() => r.data, (e) => {
1609
1613
  p(), e && (u = (e) => {
1610
1614
  let t = c.value;
1611
1615
  t && !t.contains(e.target) && i("close");
1612
1616
  }, f = setTimeout(() => {
1613
1617
  u && document.addEventListener("mousedown", u);
1614
1618
  }, 0));
1615
- }, { immediate: !0 }), F(p);
1619
+ }, { immediate: !0 }), I(p);
1616
1620
  function m() {
1617
1621
  r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
1618
1622
  }
@@ -1622,41 +1626,41 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1622
1626
  function g() {
1623
1627
  r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
1624
1628
  }
1625
- return (t, r) => e.data ? (L(), A("div", {
1629
+ return (t, r) => e.data ? (L(), k("div", {
1626
1630
  key: 0,
1627
1631
  ref_key: "popupRef",
1628
1632
  ref: c,
1629
- class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
1630
- style: P(l.value),
1633
+ class: ce(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
1634
+ style: F(l.value),
1631
1635
  onMousedown: r[6] ||= q(() => {}, ["stop"])
1632
- }, [a.value ? (L(), A(w, { key: 1 }, [j("div", Jr, [G(j("input", {
1636
+ }, [a.value ? (L(), k(w, { key: 1 }, [A("div", ni, [G(A("input", {
1633
1637
  class: "docx-hyperlink-popup__input",
1634
- placeholder: V(n)("hyperlinkPopup.displayTextPlaceholder"),
1638
+ placeholder: B(n)("hyperlinkPopup.displayTextPlaceholder"),
1635
1639
  "onUpdate:modelValue": r[2] ||= (e) => o.value = e,
1636
1640
  onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[3] ||= K((e) => t.$emit("close"), ["esc"])]
1637
- }, null, 40, Yr), [[U, o.value]])]), j("div", Xr, [G(j("input", {
1641
+ }, null, 40, ri), [[H, o.value]])]), A("div", ii, [G(A("input", {
1638
1642
  class: "docx-hyperlink-popup__input",
1639
1643
  placeholder: "https://...",
1640
1644
  "onUpdate:modelValue": r[4] ||= (e) => s.value = e,
1641
1645
  onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[5] ||= K((e) => t.$emit("close"), ["esc"])]
1642
- }, null, 40, Zr), [[U, s.value]]), j("button", {
1646
+ }, null, 40, ai), [[H, s.value]]), A("button", {
1643
1647
  class: "docx-hyperlink-popup__apply",
1644
1648
  disabled: !s.value.trim(),
1645
1649
  onClick: q(h, ["prevent"])
1646
- }, B(V(n)("common.apply")), 9, Qr)])], 64)) : (L(), A(w, { key: 0 }, [
1647
- r[10] ||= ie("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-9d23bb12></path></svg></span>", 1),
1648
- j("a", {
1650
+ }, z(B(n)("common.apply")), 9, oi)])], 64)) : (L(), k(w, { key: 0 }, [
1651
+ r[10] ||= ae("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-084b4288><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-084b4288><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-084b4288></circle><path d=\"M2 12h20\" data-v-084b4288></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-084b4288></path></svg></span>", 1),
1652
+ A("a", {
1649
1653
  class: "docx-hyperlink-popup__url",
1650
1654
  href: e.data.href,
1651
1655
  title: e.data.href,
1652
1656
  onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
1653
- }, B(e.data.href), 9, Wr),
1654
- r[11] ||= j("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1655
- j("button", {
1657
+ }, z(e.data.href), 9, Qr),
1658
+ r[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1659
+ A("button", {
1656
1660
  class: "docx-hyperlink-popup__btn",
1657
- title: V(n)("hyperlinkPopup.copyLink"),
1661
+ title: B(n)("hyperlinkPopup.copyLink"),
1658
1662
  onClick: q(g, ["prevent"])
1659
- }, [...r[7] ||= [j("svg", {
1663
+ }, [...r[7] ||= [A("svg", {
1660
1664
  width: "18",
1661
1665
  height: "18",
1662
1666
  viewBox: "0 0 24 24",
@@ -1665,20 +1669,20 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1665
1669
  "stroke-width": "2",
1666
1670
  "stroke-linecap": "round",
1667
1671
  "stroke-linejoin": "round"
1668
- }, [j("rect", {
1672
+ }, [A("rect", {
1669
1673
  x: "9",
1670
1674
  y: "9",
1671
1675
  width: "13",
1672
1676
  height: "13",
1673
1677
  rx: "2",
1674
1678
  ry: "2"
1675
- }), j("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Gr),
1676
- e.readOnly ? k("", !0) : (L(), A("button", {
1679
+ }), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, $r),
1680
+ e.readOnly ? O("", !0) : (L(), k("button", {
1677
1681
  key: 0,
1678
1682
  class: "docx-hyperlink-popup__btn",
1679
- title: V(n)("hyperlinkPopup.editLink"),
1683
+ title: B(n)("hyperlinkPopup.editLink"),
1680
1684
  onClick: q(m, ["prevent"])
1681
- }, [...r[8] ||= [j("svg", {
1685
+ }, [...r[8] ||= [A("svg", {
1682
1686
  width: "18",
1683
1687
  height: "18",
1684
1688
  viewBox: "0 0 24 24",
@@ -1687,30 +1691,30 @@ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
1687
1691
  "stroke-width": "2",
1688
1692
  "stroke-linecap": "round",
1689
1693
  "stroke-linejoin": "round"
1690
- }, [j("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), j("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, Kr)),
1691
- e.readOnly ? k("", !0) : (L(), A("button", {
1694
+ }, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, ei)),
1695
+ e.readOnly ? O("", !0) : (L(), k("button", {
1692
1696
  key: 1,
1693
1697
  class: "docx-hyperlink-popup__btn",
1694
- title: V(n)("hyperlinkPopup.removeLink"),
1698
+ title: B(n)("hyperlinkPopup.removeLink"),
1695
1699
  onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
1696
- }, [...r[9] ||= [ie("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, qr))
1697
- ], 64))], 38)) : k("", !0);
1700
+ }, [...r[9] ||= [ae("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-084b4288><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-084b4288></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-084b4288></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-084b4288></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-084b4288></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-084b4288></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-084b4288></line></svg>", 1)]], 8, ti))
1701
+ ], 64))], 38)) : O("", !0);
1698
1702
  }
1699
- }), [["__scopeId", "data-v-9d23bb12"]]);
1703
+ }), [["__scopeId", "data-v-084b4288"]]);
1700
1704
  //#endregion
1701
1705
  //#region src/composables/useFileIO.ts
1702
- function ei(e) {
1706
+ function ci(e) {
1703
1707
  let t = R(null), n = R(null);
1704
1708
  function r(t) {
1705
1709
  let n = t.target, r = n.files?.[0], i = e.getActiveView();
1706
- r && i && ht(i, r, { onError: (t) => e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to insert image")) }), n.value = "";
1710
+ r && i && bt(i, r, { onError: (t) => e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to insert image")) }), n.value = "";
1707
1711
  }
1708
1712
  async function i() {
1709
1713
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1710
1714
  }
1711
1715
  async function a(t) {
1712
1716
  try {
1713
- let n = await Q(t);
1717
+ let n = await He(t);
1714
1718
  if (!n) return;
1715
1719
  await e.loadBuffer(n.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", n.name), await i();
1716
1720
  } catch (t) {
@@ -1751,7 +1755,7 @@ function ei(e) {
1751
1755
  }
1752
1756
  //#endregion
1753
1757
  //#region src/composables/useHyperlinkManagement.ts
1754
- function ti(e) {
1758
+ function li(e) {
1755
1759
  let t = R(null);
1756
1760
  function n(t) {
1757
1761
  let n = e.editorView.value;
@@ -1780,7 +1784,7 @@ function ti(e) {
1780
1784
  function a(n, r) {
1781
1785
  let i = e.editorView.value;
1782
1786
  if (!i) return;
1783
- let a = We(i.state);
1787
+ let a = Je(i.state);
1784
1788
  if (!a) {
1785
1789
  t.value = null;
1786
1790
  return;
@@ -1794,7 +1798,7 @@ function ti(e) {
1794
1798
  function o() {
1795
1799
  let n = e.editorView.value;
1796
1800
  if (!n) return;
1797
- let r = We(n.state, t.value?.href);
1801
+ let r = Je(n.state, t.value?.href);
1798
1802
  if (!r) {
1799
1803
  t.value = null;
1800
1804
  return;
@@ -1813,61 +1817,76 @@ function ti(e) {
1813
1817
  }
1814
1818
  //#endregion
1815
1819
  //#region src/composables/useFormattingActions.ts
1816
- function ni(e) {
1820
+ function ui(e) {
1817
1821
  let t = () => e.activeView?.value ?? e.editorView.value;
1818
1822
  function n() {
1819
1823
  let e = t();
1820
- e && (Ue(e.state, e.dispatch, e), e.focus());
1824
+ e && (qe(e.state, e.dispatch, e), e.focus());
1821
1825
  }
1822
1826
  function r(n) {
1823
1827
  let r = t();
1824
1828
  if (!r) return;
1825
1829
  let i = e.getDocument(), a = i?.package?.styles;
1826
1830
  if (a) {
1827
- let e = wt(a).resolveParagraphStyle(n);
1828
- yt(n, {
1831
+ let e = kt(a).resolveParagraphStyle(n);
1832
+ wt(n, {
1829
1833
  paragraphFormatting: e.paragraphFormatting,
1830
1834
  runFormatting: e.runFormatting,
1831
- numbering: i?.package?.numbering ? Tt(i.package.numbering) : null
1835
+ numbering: i?.package?.numbering ? At(i.package.numbering) : null
1832
1836
  })(r.state, (e) => r.dispatch(e));
1833
- } else yt(n)(r.state, (e) => r.dispatch(e));
1837
+ } else wt(n)(r.state, (e) => r.dispatch(e));
1834
1838
  r.focus();
1835
1839
  }
1836
1840
  function i() {
1837
1841
  let t = e.editorView.value;
1838
- t && (Et(t.state, (e) => t.dispatch(e), t), t.focus());
1842
+ t && (jt(t.state, (e) => t.dispatch(e), t), t.focus());
1839
1843
  }
1840
- function a(e) {
1844
+ function a() {
1845
+ let t = e.editorView.value;
1846
+ t && (Nt(t.state, (e) => t.dispatch(e), t), t.focus());
1847
+ }
1848
+ function o() {
1849
+ let t = e.editorView.value;
1850
+ t && (Mt(t.state, (e) => t.dispatch(e), t), t.focus());
1851
+ }
1852
+ function s(e) {
1841
1853
  let n = t();
1842
1854
  if (!n) return;
1843
1855
  let { from: r } = n.state.selection, i = n.state.tr.insertText(e, r);
1844
1856
  n.dispatch(i.scrollIntoView()), n.focus();
1845
1857
  }
1846
- function o(t) {
1858
+ function c(t) {
1847
1859
  let n = e.editorView.value;
1848
- return n ? Dt(n, t) : !1;
1860
+ return n ? Pt(n, t) : !1;
1849
1861
  }
1850
- function s(t) {
1862
+ function l(t) {
1851
1863
  let n = e.editorView.value;
1852
1864
  if (!n) return !1;
1853
1865
  let r = e.getDocument();
1854
- return Ot(n, t, {
1855
- styleResolver: r?.package?.styles ? wt(r.package.styles) : null,
1856
- numbering: r?.package?.numbering ? Tt(r.package.numbering) : null
1866
+ return It(n, t, {
1867
+ styleResolver: r?.package?.styles ? kt(r.package.styles) : null,
1868
+ numbering: r?.package?.numbering ? At(r.package.numbering) : null
1857
1869
  });
1858
1870
  }
1871
+ function u(t) {
1872
+ let n = e.editorView.value;
1873
+ return n ? Ft(n, t) : !1;
1874
+ }
1859
1875
  return {
1860
1876
  handleClearFormatting: n,
1861
1877
  handleApplyStyle: r,
1862
1878
  handleInsertPageBreak: i,
1863
- handleInsertSymbol: a,
1864
- applyFormatting: o,
1865
- setParagraphStyle: s
1879
+ handleInsertSectionBreakNextPage: a,
1880
+ handleInsertSectionBreakContinuous: o,
1881
+ handleInsertSymbol: s,
1882
+ applyFormatting: c,
1883
+ setParagraphStyle: l,
1884
+ insertBreak: u
1866
1885
  };
1867
1886
  }
1868
1887
  //#endregion
1869
1888
  //#region src/composables/usePageSetupControls.ts
1870
- function ri(e) {
1889
+ function di(e) {
1871
1890
  function t(t) {
1872
1891
  let n = e.getDocument();
1873
1892
  if (!n?.package?.document) return;
@@ -1894,19 +1913,19 @@ function ri(e) {
1894
1913
  }
1895
1914
  function s(t) {
1896
1915
  let n = e.editorView.value;
1897
- n && St(t)(n.state, n.dispatch);
1916
+ n && Dt(t)(n.state, n.dispatch);
1898
1917
  }
1899
1918
  function c(t) {
1900
1919
  let n = e.editorView.value;
1901
- n && Ct(t)(n.state, n.dispatch);
1920
+ n && Ot(t)(n.state, n.dispatch);
1902
1921
  }
1903
1922
  function l(t) {
1904
1923
  let n = e.editorView.value;
1905
- n && (t < 0 ? xt(-t, !0)(n.state, n.dispatch) : xt(t, !1)(n.state, n.dispatch));
1924
+ n && (t < 0 ? Et(-t, !0)(n.state, n.dispatch) : Et(t, !1)(n.state, n.dispatch));
1906
1925
  }
1907
1926
  function u(t) {
1908
1927
  let n = e.editorView.value;
1909
- n && bt(t)(n.state, n.dispatch);
1928
+ n && Tt(t)(n.state, n.dispatch);
1910
1929
  }
1911
1930
  return {
1912
1931
  handlePageSetupApply: t,
@@ -1922,16 +1941,16 @@ function ri(e) {
1922
1941
  }
1923
1942
  //#endregion
1924
1943
  //#region src/composables/useWatermarkControls.ts
1925
- function ii(e) {
1944
+ function fi(e) {
1926
1945
  let t = R(!1), n = E(() => {
1927
1946
  e.stateTick.value;
1928
1947
  let t = e.editorView.value;
1929
- return t ? mt(t.state) ?? void 0 : void 0;
1948
+ return t ? yt(t.state) ?? void 0 : void 0;
1930
1949
  });
1931
1950
  function r(t) {
1932
1951
  if (e.readOnly.value) return;
1933
1952
  let n = e.editorView.value;
1934
- n && (vt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1953
+ n && (Ct(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1935
1954
  }
1936
1955
  return {
1937
1956
  showWatermark: t,
@@ -1941,18 +1960,18 @@ function ii(e) {
1941
1960
  }
1942
1961
  //#endregion
1943
1962
  //#region src/composables/useOutlineSidebar.ts
1944
- function ai(e) {
1963
+ function pi(e) {
1945
1964
  function t() {
1946
1965
  if (!e.showOutline.value) {
1947
1966
  let t = e.editorView.value;
1948
- t && (e.outlineHeadings.value = kt(t.state.doc));
1967
+ t && (e.outlineHeadings.value = Lt(t.state.doc));
1949
1968
  }
1950
1969
  e.showOutline.value = !e.showOutline.value;
1951
1970
  }
1952
1971
  function n(t) {
1953
1972
  let n = e.editorView.value;
1954
1973
  if (!n) return;
1955
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = he.near(r);
1974
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Y.near(r);
1956
1975
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
1957
1976
  }
1958
1977
  function r() {
@@ -1971,7 +1990,7 @@ function ai(e) {
1971
1990
  }
1972
1991
  //#endregion
1973
1992
  //#region src/composables/useKeyboardShortcuts.ts
1974
- function oi(e) {
1993
+ function mi(e) {
1975
1994
  function t(t) {
1976
1995
  if (t.key === "F1") {
1977
1996
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1979,26 +1998,26 @@ function oi(e) {
1979
1998
  }
1980
1999
  e.handleZoomKeyDown(t), (t.ctrlKey || t.metaKey) && (e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value)));
1981
2000
  }
1982
- return I(() => window.addEventListener("keydown", t)), F(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2001
+ return le(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1983
2002
  }
1984
2003
  //#endregion
1985
2004
  //#region src/composables/useCommentManagement.ts
1986
- function si(e) {
1987
- let t = () => V(e.author) ?? "User";
2005
+ function hi(e) {
2006
+ let t = () => B(e.author) ?? "User";
1988
2007
  function n(t) {
1989
2008
  e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
1990
2009
  }
1991
2010
  function r() {
1992
- Ft(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
2011
+ Ut(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1993
2012
  }
1994
2013
  function i(t, n, i) {
1995
- return r(), Mt(e.commentIdAllocator, t, n, i);
2014
+ return r(), Bt(e.commentIdAllocator, t, n, i);
1996
2015
  }
1997
2016
  function a(t) {
1998
2017
  let i = e.getDocument(), a = e.editorView.value;
1999
2018
  if (!i?.package?.document || !a) return null;
2000
2019
  i.package.document.comments || (i.package.document.comments = []), r();
2001
- let o = At(a, t, e.commentIdAllocator);
2020
+ let o = Rt(a, t, e.commentIdAllocator);
2002
2021
  return o ? (i.package.document.comments.push(o), n([...i.package.document.comments]), e.showSidebar.value = !0, e.emit("change", i), e.contentChangeSubscribers.forEach((e) => e(i)), o.id) : null;
2003
2022
  }
2004
2023
  function o(t, r, a) {
@@ -2017,7 +2036,7 @@ function si(e) {
2017
2036
  let n = e.editorView.value;
2018
2037
  if (!n) return !1;
2019
2038
  r();
2020
- let i = jt(n, t, e.commentIdAllocator);
2039
+ let i = zt(n, t, e.commentIdAllocator);
2021
2040
  return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
2022
2041
  }
2023
2042
  function l(n, r) {
@@ -2044,19 +2063,19 @@ function si(e) {
2044
2063
  }
2045
2064
  function p(t, n) {
2046
2065
  let r = e.editorView.value;
2047
- r && (ft(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2066
+ r && (_t(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2048
2067
  }
2049
2068
  function m(t, n) {
2050
2069
  let r = e.editorView.value;
2051
- r && (gt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2070
+ r && (xt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2052
2071
  }
2053
2072
  function h(t) {
2054
2073
  let n = e.editorView.value;
2055
- n && (pt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2074
+ n && (vt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2056
2075
  }
2057
2076
  function g(t) {
2058
2077
  let n = e.editorView.value;
2059
- n && (_t(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2078
+ n && (St(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2060
2079
  }
2061
2080
  function _(r, a) {
2062
2081
  let o = e.getDocument();
@@ -2083,8 +2102,8 @@ function si(e) {
2083
2102
  }
2084
2103
  //#endregion
2085
2104
  //#region src/composables/useHostCallbacks.ts
2086
- function ci(e, t) {
2087
- return W(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2105
+ function gi(e, t) {
2106
+ return U(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2088
2107
  onCommentAdd: (t) => e.onCommentAdd?.(t),
2089
2108
  onCommentResolve: (t) => e.onCommentResolve?.(t),
2090
2109
  onCommentDelete: (t) => e.onCommentDelete?.(t),
@@ -2094,11 +2113,11 @@ function ci(e, t) {
2094
2113
  }
2095
2114
  //#endregion
2096
2115
  //#region src/composables/useCommentLifecycle.ts
2097
- function li(e) {
2116
+ function _i(e) {
2098
2117
  let t = R(null), n = R(null), r = R(null), i = R(!1);
2099
2118
  function a() {
2100
2119
  let t = e.getDocument(), n = e.editorView.value;
2101
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = It(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2120
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = Wt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2102
2121
  }
2103
2122
  function o() {
2104
2123
  e.stateTick.value;
@@ -2117,7 +2136,7 @@ function li(e) {
2117
2136
  t.value = null;
2118
2137
  return;
2119
2138
  }
2120
- let s = o.getBoundingClientRect(), c = qt(a, r);
2139
+ let s = o.getBoundingClientRect(), c = tn(a, r);
2121
2140
  if (!c) {
2122
2141
  t.value = null;
2123
2142
  return;
@@ -2145,7 +2164,7 @@ function li(e) {
2145
2164
  for (let t of r) {
2146
2165
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2147
2166
  let n = t.attrs.commentId;
2148
- if (n === Nt || e.resolvedCommentIds.value.has(n)) continue;
2167
+ if (n === Vt || e.resolvedCommentIds.value.has(n)) continue;
2149
2168
  i = `comment-${n}`;
2150
2169
  break;
2151
2170
  }
@@ -2170,7 +2189,7 @@ function li(e) {
2170
2189
  }, r.value = t.value?.top ?? null;
2171
2190
  let s = i.state.schema.marks.comment;
2172
2191
  if (s) {
2173
- let e = i.state.tr.addMark(a, o, s.create({ commentId: Nt }));
2192
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: Vt }));
2174
2193
  i.dispatch(e);
2175
2194
  }
2176
2195
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2178,8 +2197,8 @@ function li(e) {
2178
2197
  function l(t) {
2179
2198
  let i = e.getDocument(), a = e.editorView.value;
2180
2199
  if (!i?.package) return;
2181
- i.package.document.comments || (i.package.document.comments = []), Ft(e.commentIdAllocator, i.package.document.comments, a);
2182
- let o = Mt(e.commentIdAllocator, t, V(e.author) ?? "User");
2200
+ i.package.document.comments || (i.package.document.comments = []), Ut(e.commentIdAllocator, i.package.document.comments, a);
2201
+ let o = Bt(e.commentIdAllocator, t, B(e.author) ?? "User");
2183
2202
  i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2184
2203
  let s = n.value;
2185
2204
  if (a && s && s.from !== s.to) {
@@ -2202,15 +2221,15 @@ function li(e) {
2202
2221
  function d(t) {
2203
2222
  e.showSidebar.value = !0;
2204
2223
  }
2205
- W([
2224
+ U([
2206
2225
  e.stateTick,
2207
2226
  e.isAddingComment,
2208
2227
  e.zoom
2209
- ], () => o()), W(e.stateTick, () => s()), W(e.stateTick, () => a());
2228
+ ], () => o()), U(e.stateTick, () => s()), U(e.stateTick, () => a());
2210
2229
  let f = null;
2211
- return I(() => {
2230
+ return le(() => {
2212
2231
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2213
- }), F(() => {
2232
+ }), I(() => {
2214
2233
  f?.disconnect(), window.removeEventListener("resize", o);
2215
2234
  }), {
2216
2235
  floatingCommentBtn: t,
@@ -2228,8 +2247,8 @@ function li(e) {
2228
2247
  }
2229
2248
  //#endregion
2230
2249
  //#region src/composables/useImageActions.ts
2231
- function ui(e) {
2232
- let t = fe(null), n = R(!1), r = E(() => {
2250
+ function vi(e) {
2251
+ let t = pe(null), n = R(!1), r = E(() => {
2233
2252
  e.stateTick.value;
2234
2253
  let n = e.editorView.value, r = t.value;
2235
2254
  if (!n || !r) return null;
@@ -2243,9 +2262,9 @@ function ui(e) {
2243
2262
  function i(n) {
2244
2263
  let r = e.editorView.value, i = t.value;
2245
2264
  if (!r || !i) return;
2246
- let a = ot(n);
2265
+ let a = ut(n);
2247
2266
  if (!a) return;
2248
- let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: tt(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2267
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: at(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2249
2268
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
2250
2269
  }
2251
2270
  function a(n) {
@@ -2273,8 +2292,8 @@ function ui(e) {
2273
2292
  }
2274
2293
  //#endregion
2275
2294
  //#region src/utils/imageClipboard.ts
2276
- function di(e, t, n) {
2277
- let r = ut(e.state), i = e.state.schema.marks.insertion;
2295
+ function yi(e, t, n) {
2296
+ let r = ht(e.state), i = e.state.schema.marks.insertion;
2278
2297
  if (!r || !i) return;
2279
2298
  let a = t.selection.from, o = a - n.nodeSize;
2280
2299
  o < 0 || t.addMark(o, a, i.create({
@@ -2283,10 +2302,10 @@ function di(e, t, n) {
2283
2302
  date: r.date
2284
2303
  }));
2285
2304
  }
2286
- function fi(e, t) {
2305
+ function bi(e, t) {
2287
2306
  return e.getBlob(t);
2288
2307
  }
2289
- function pi(e, t) {
2308
+ function xi(e, t) {
2290
2309
  let n = e.state.doc.nodeAt(t);
2291
2310
  if (!n || n.type.name !== "image") return;
2292
2311
  let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
@@ -2298,13 +2317,13 @@ function pi(e, t) {
2298
2317
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2299
2318
  });
2300
2319
  }
2301
- function mi(e) {
2320
+ function Si(e) {
2302
2321
  return new Promise((t, n) => {
2303
2322
  let r = new FileReader();
2304
2323
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2305
2324
  });
2306
2325
  }
2307
- function hi(e) {
2326
+ function Ci(e) {
2308
2327
  return new Promise((t) => {
2309
2328
  let n = new Image();
2310
2329
  n.onload = () => t({
@@ -2316,13 +2335,13 @@ function hi(e) {
2316
2335
  }), n.src = e;
2317
2336
  });
2318
2337
  }
2319
- async function gi(e) {
2338
+ async function wi(e) {
2320
2339
  try {
2321
2340
  let t = await navigator.clipboard.read();
2322
2341
  for (let n of t) {
2323
2342
  let t = n.types.find((e) => e.startsWith("image/"));
2324
2343
  if (t) {
2325
- let r = await mi(await fi(n, t)), i = await hi(r), a = i.width, o = i.height;
2344
+ let r = await Si(await bi(n, t)), i = await Ci(r), a = i.width, o = i.height;
2326
2345
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2327
2346
  let s = e.state.schema.nodes.image.create({
2328
2347
  src: r,
@@ -2332,11 +2351,11 @@ async function gi(e) {
2332
2351
  wrapType: "inline",
2333
2352
  displayMode: "inline"
2334
2353
  }), c = e.state.tr.replaceSelectionWith(s);
2335
- di(e, c, s), e.dispatch(c);
2354
+ yi(e, c, s), e.dispatch(c);
2336
2355
  return;
2337
2356
  }
2338
2357
  if (n.types.includes("text/html")) {
2339
- let t = await (await fi(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2358
+ let t = await (await bi(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2340
2359
  if (r && r[1]) {
2341
2360
  let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
2342
2361
  src: n,
@@ -2346,12 +2365,12 @@ async function gi(e) {
2346
2365
  wrapType: "inline",
2347
2366
  displayMode: "inline"
2348
2367
  }), l = e.state.tr.replaceSelectionWith(c);
2349
- di(e, l, c), e.dispatch(l);
2368
+ yi(e, l, c), e.dispatch(l);
2350
2369
  return;
2351
2370
  }
2352
2371
  }
2353
2372
  if (n.types.includes("text/plain")) {
2354
- let t = await (await fi(n, "text/plain")).text();
2373
+ let t = await (await bi(n, "text/plain")).text();
2355
2374
  if (t && t !== "[image]") {
2356
2375
  let { from: n } = e.state.selection;
2357
2376
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2367,14 +2386,14 @@ async function gi(e) {
2367
2386
  }
2368
2387
  }
2369
2388
  }
2370
- function _i(e, t) {
2389
+ function Ti(e, t) {
2371
2390
  let n = e.state.doc.nodeAt(t);
2372
2391
  if (!n || n.type.name !== "image") return;
2373
2392
  let r = document.createElement("input");
2374
2393
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2375
2394
  let i = r.files?.[0];
2376
2395
  if (!i) return;
2377
- let a = await mi(i), o = await hi(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2396
+ let a = await Si(i), o = await Ci(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2378
2397
  try {
2379
2398
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2380
2399
  ...n.attrs,
@@ -2389,7 +2408,7 @@ function _i(e, t) {
2389
2408
  }
2390
2409
  //#endregion
2391
2410
  //#region src/composables/useContextMenus.ts
2392
- function vi(e) {
2411
+ function Ei(e) {
2393
2412
  let { t } = d(), n = R({
2394
2413
  isOpen: !1,
2395
2414
  position: {
@@ -2427,7 +2446,7 @@ function vi(e) {
2427
2446
  function a(t) {
2428
2447
  let i = e.editorView.value;
2429
2448
  if (!i) return;
2430
- let a = t.target, o = rt(a);
2449
+ let a = t.target, o = st(a);
2431
2450
  if (o) {
2432
2451
  let a = Number(o.dataset.pmStart);
2433
2452
  if (!isNaN(a)) {
@@ -2453,7 +2472,7 @@ function vi(e) {
2453
2472
  pmPos: a,
2454
2473
  currentWrapType: i,
2455
2474
  currentCssFloat: c ?? null,
2456
- inlinePositionEmu: i === "inline" ? tt(o, e.zoom.value) : void 0
2475
+ inlinePositionEmu: i === "inline" ? at(o, e.zoom.value) : void 0
2457
2476
  }, n.value.isOpen = !1;
2458
2477
  return;
2459
2478
  }
@@ -2465,7 +2484,7 @@ function vi(e) {
2465
2484
  e.setPmSelection(a);
2466
2485
  } catch {}
2467
2486
  }
2468
- let s = Ge(i.state), { empty: c } = i.state.selection;
2487
+ let s = Ye(i.state), { empty: c } = i.state.selection;
2469
2488
  r.value &&= null, n.value = {
2470
2489
  isOpen: !0,
2471
2490
  position: {
@@ -2494,7 +2513,7 @@ function vi(e) {
2494
2513
  pmPos: a.pmPos,
2495
2514
  currentWrapType: s,
2496
2515
  currentCssFloat: c ?? null,
2497
- inlinePositionEmu: s === "inline" ? tt(a.element, e.zoom.value) : void 0
2516
+ inlinePositionEmu: s === "inline" ? at(a.element, e.zoom.value) : void 0
2498
2517
  }, n.value.isOpen = !1;
2499
2518
  }
2500
2519
  function s(t) {
@@ -2510,16 +2529,16 @@ function vi(e) {
2510
2529
  switch (t) {
2511
2530
  case "cut":
2512
2531
  if (e.selectedImage.value) {
2513
- pi(n, e.selectedImage.value.pmPos);
2532
+ xi(n, e.selectedImage.value.pmPos);
2514
2533
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2515
2534
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2516
2535
  } else document.execCommand("cut");
2517
2536
  break;
2518
2537
  case "copy":
2519
- e.selectedImage.value ? pi(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2538
+ e.selectedImage.value ? xi(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2520
2539
  break;
2521
2540
  case "paste":
2522
- gi(n);
2541
+ wi(n);
2523
2542
  break;
2524
2543
  case "pasteAsPlainText":
2525
2544
  navigator.clipboard.readText().then((e) => {
@@ -2532,7 +2551,7 @@ function vi(e) {
2532
2551
  break;
2533
2552
  }
2534
2553
  case "selectAll": {
2535
- let e = he.create(n.state.doc, 0, n.state.doc.content.size);
2554
+ let e = Y.create(n.state.doc, 0, n.state.doc.content.size);
2536
2555
  n.dispatch(n.state.tr.setSelection(e));
2537
2556
  break;
2538
2557
  }
@@ -2540,7 +2559,7 @@ function vi(e) {
2540
2559
  e.selectedImage.value && (e.showImageProperties.value = !0);
2541
2560
  break;
2542
2561
  case "replaceImage":
2543
- e.selectedImage.value && _i(n, e.selectedImage.value.pmPos);
2562
+ e.selectedImage.value && Ti(n, e.selectedImage.value.pmPos);
2544
2563
  break;
2545
2564
  case "deleteImage":
2546
2565
  if (e.selectedImage.value) {
@@ -2575,13 +2594,13 @@ function vi(e) {
2575
2594
  }
2576
2595
  //#endregion
2577
2596
  //#region src/composables/usePagesPointer.ts
2578
- var yi = 500;
2579
- function bi(e) {
2597
+ var Di = 500;
2598
+ function Oi(e) {
2580
2599
  let t = R(null), n = null;
2581
2600
  function r() {
2582
2601
  n !== null && (clearTimeout(n), n = null);
2583
2602
  }
2584
- let i = fe(null), a = 0, o = null, s = 0, c = !1, l = null, u = zt(), d = ne({
2603
+ let i = pe(null), a = 0, o = null, s = 0, c = !1, l = null, u = qt(), d = ne({
2585
2604
  pagesContainer: e.pagesRef,
2586
2605
  onScrollExtendSelection: (e, t) => {
2587
2606
  if (!c || l === null) return;
@@ -2594,7 +2613,7 @@ function bi(e) {
2594
2613
  visible: !1
2595
2614
  }), p = null;
2596
2615
  function m(t, n) {
2597
- return Yt(e.pagesRef.value, e.editorView.value, t, n);
2616
+ return rn(e.pagesRef.value, e.editorView.value, t, n);
2598
2617
  }
2599
2618
  function h() {
2600
2619
  let t = i.value;
@@ -2607,18 +2626,18 @@ function bi(e) {
2607
2626
  function g(e, t) {
2608
2627
  let n = h();
2609
2628
  if (n) try {
2610
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
2629
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Y.between(r, i);
2611
2630
  n.dispatch(n.state.tr.setSelection(a));
2612
2631
  } catch {}
2613
2632
  }
2614
2633
  function _(t) {
2615
- Jt(e.pagesRef.value, e.pagesViewportRef.value, t);
2634
+ nn(e.pagesRef.value, e.pagesViewportRef.value, t);
2616
2635
  }
2617
2636
  function v(t) {
2618
- Xt(e.pagesRef.value, t, g, i.value?.position);
2637
+ an(e.pagesRef.value, t, g, i.value?.position);
2619
2638
  }
2620
2639
  function y(t) {
2621
- Zt(e.pagesRef.value, t, g, i.value?.position);
2640
+ on(e.pagesRef.value, t, g, i.value?.position);
2622
2641
  }
2623
2642
  function b(t) {
2624
2643
  let n = e.editorView.value;
@@ -2639,7 +2658,7 @@ function bi(e) {
2639
2658
  if (!o) return;
2640
2659
  let s = e.pagesViewportRef.value;
2641
2660
  if (!s) return;
2642
- let l = Rt({
2661
+ let l = Kt({
2643
2662
  mouseX: a.clientX,
2644
2663
  mouseY: a.clientY,
2645
2664
  pagesContainer: o,
@@ -2649,7 +2668,7 @@ function bi(e) {
2649
2668
  if (!l) {
2650
2669
  n === null && (n = setTimeout(() => {
2651
2670
  t.value = null, n = null;
2652
- }, Lt));
2671
+ }, Gt));
2653
2672
  return;
2654
2673
  }
2655
2674
  let u = s.getBoundingClientRect();
@@ -2664,7 +2683,7 @@ function bi(e) {
2664
2683
  n.preventDefault(), n.stopPropagation();
2665
2684
  let r = t.value, i = e.editorView.value;
2666
2685
  if (!r || !i) return;
2667
- let a = i.state.tr.setSelection(he.create(i.state.doc, r.cellPmPos + 1));
2686
+ let a = i.state.tr.setSelection(Y.create(i.state.doc, r.cellPmPos + 1));
2668
2687
  i.dispatch(a);
2669
2688
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2670
2689
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
@@ -2808,7 +2827,7 @@ function bi(e) {
2808
2827
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2809
2828
  let d = h() ?? n;
2810
2829
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, d)) return;
2811
- let f = rt(r);
2830
+ let f = st(r);
2812
2831
  if (f) {
2813
2832
  t.preventDefault(), t.stopPropagation();
2814
2833
  let n = Number(f.dataset.pmStart);
@@ -2833,14 +2852,14 @@ function bi(e) {
2833
2852
  return;
2834
2853
  }
2835
2854
  let _ = Date.now();
2836
- if (_ - a < yi && o === p ? s++ : s = 1, a = _, o = p, s === 2) v(p);
2855
+ if (_ - a < Di && o === p ? s++ : s = 1, a = _, o = p, s === 2) v(p);
2837
2856
  else if (s >= 3) y(p), s = 0;
2838
2857
  else {
2839
2858
  if (t.shiftKey) {
2840
2859
  let { from: e } = d.state.selection;
2841
2860
  g(e, p);
2842
2861
  } else g(p);
2843
- l = p, c = !0, u.begin(Bt(d, p));
2862
+ l = p, c = !0, u.begin(Jt(d, p));
2844
2863
  }
2845
2864
  d.focus();
2846
2865
  }
@@ -2857,10 +2876,10 @@ function bi(e) {
2857
2876
  }
2858
2877
  d.updateMousePosition(e.clientX, e.clientY);
2859
2878
  }
2860
- function D() {
2879
+ function re() {
2861
2880
  c = !1, u.end(), d.stopAutoScroll();
2862
2881
  }
2863
- function O() {
2882
+ function D() {
2864
2883
  let t = e.pagesViewportRef.value, n = e.layout.value;
2865
2884
  if (!t || !n || n.pages.length === 0) return;
2866
2885
  let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
@@ -2883,10 +2902,10 @@ function bi(e) {
2883
2902
  };
2884
2903
  }, 600);
2885
2904
  }
2886
- return I(() => {
2887
- window.addEventListener("mousemove", E), window.addEventListener("mouseup", D), e.pagesViewportRef.value?.addEventListener("scroll", O, { passive: !0 });
2888
- }), F(() => {
2889
- r(), window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", D), e.pagesViewportRef.value?.removeEventListener("scroll", O), p && clearTimeout(p);
2905
+ return le(() => {
2906
+ window.addEventListener("mousemove", E), window.addEventListener("mouseup", re), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2907
+ }), I(() => {
2908
+ r(), window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", re), e.pagesViewportRef.value?.removeEventListener("scroll", D), p && clearTimeout(p);
2890
2909
  }), {
2891
2910
  tableInsertButton: t,
2892
2911
  hfEdit: i,
@@ -2907,7 +2926,7 @@ function bi(e) {
2907
2926
  }
2908
2927
  //#endregion
2909
2928
  //#region src/composables/useSelectionSync.ts
2910
- function xi(e) {
2929
+ function ki(e) {
2911
2930
  let t = null, n = null, r = null;
2912
2931
  function i() {
2913
2932
  let r = e.pagesRef.value;
@@ -2920,7 +2939,7 @@ function xi(e) {
2920
2939
  if (!t || !n || e.isHfEditing?.value) return;
2921
2940
  let i = n.state.selection;
2922
2941
  if (i instanceof J && i.node.type.name === "image") {
2923
- let n = X(t, i.from), r = n ? rt(n) : null;
2942
+ let n = X(t, i.from), r = n ? st(n) : null;
2924
2943
  if (r) {
2925
2944
  let t = e.selectedImage.value;
2926
2945
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -2938,12 +2957,12 @@ function xi(e) {
2938
2957
  function o() {
2939
2958
  let r = e.pagesRef.value, o = e.editorView.value;
2940
2959
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
2941
- a(), Y(r, o.state);
2960
+ a(), ge(r, o.state);
2942
2961
  let s = o.state.selection;
2943
2962
  if (s instanceof J && s.node.type.name === "image") return;
2944
2963
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
2945
2964
  if (u) {
2946
- let e = qe(r, c, r.getBoundingClientRect());
2965
+ let e = Ze(r, c, r.getBoundingClientRect());
2947
2966
  if (e) {
2948
2967
  let i = document.createElement("div");
2949
2968
  i.className = "vue-caret", i.style.cssText = `
@@ -2952,7 +2971,7 @@ function xi(e) {
2952
2971
  top: ${e.y / p + d}px;
2953
2972
  width: 2px;
2954
2973
  height: ${e.height}px;
2955
- background: #000;
2974
+ background: var(--doc-caret, #000);
2956
2975
  pointer-events: none;
2957
2976
  z-index: ${S.selectionOverlay};
2958
2977
  `, r.appendChild(i), n = i;
@@ -2963,7 +2982,7 @@ function xi(e) {
2963
2982
  }
2964
2983
  return;
2965
2984
  }
2966
- let m = Je(r, c, l, r.getBoundingClientRect());
2985
+ let m = Qe(r, c, l, r.getBoundingClientRect());
2967
2986
  for (let e of m) {
2968
2987
  let t = document.createElement("div");
2969
2988
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2978,7 +2997,7 @@ function xi(e) {
2978
2997
  `, r.appendChild(t);
2979
2998
  }
2980
2999
  }
2981
- return F(() => {
3000
+ return I(() => {
2982
3001
  r !== null && cancelAnimationFrame(r), i();
2983
3002
  }), {
2984
3003
  clearOverlay: i,
@@ -2987,7 +3006,7 @@ function xi(e) {
2987
3006
  }
2988
3007
  //#endregion
2989
3008
  //#region src/composables/useMenuActions.ts
2990
- function Si(e) {
3009
+ function Ai(e) {
2991
3010
  function t(t) {
2992
3011
  let n = e.editorView.value;
2993
3012
  if (!n) return;
@@ -3029,6 +3048,12 @@ function Si(e) {
3029
3048
  case "insertPageBreak":
3030
3049
  e.handleInsertPageBreak();
3031
3050
  break;
3051
+ case "insertSectionBreakNextPage":
3052
+ e.handleInsertSectionBreakNextPage();
3053
+ break;
3054
+ case "insertSectionBreakContinuous":
3055
+ e.handleInsertSectionBreakContinuous();
3056
+ break;
3032
3057
  case "insertTOC":
3033
3058
  t("generateTOC");
3034
3059
  break;
@@ -3042,7 +3067,7 @@ function Si(e) {
3042
3067
  e.showKeyboardShortcuts.value = !0;
3043
3068
  break;
3044
3069
  case "reportIssue":
3045
- Vt();
3070
+ Yt();
3046
3071
  break;
3047
3072
  case "dirLTR":
3048
3073
  t("setLtr");
@@ -3060,29 +3085,29 @@ function Si(e) {
3060
3085
  }
3061
3086
  //#endregion
3062
3087
  //#region src/composables/useDocumentLifecycle.ts
3063
- function Ci(e) {
3088
+ function ji(e) {
3064
3089
  async function t(t) {
3065
3090
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3066
3091
  }
3067
3092
  function n(t) {
3068
3093
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3069
3094
  }
3070
- W(e.documentBuffer, (e) => {
3095
+ U(e.documentBuffer, (e) => {
3071
3096
  e && t(e);
3072
- }), W(e.document, (e) => {
3097
+ }), U(e.document, (e) => {
3073
3098
  e && n(e);
3074
- }), I(async () => {
3075
- await ce();
3099
+ }), le(async () => {
3100
+ await se();
3076
3101
  let r = e.documentBuffer(), i = e.document();
3077
3102
  r ? await t(r) : i && n(i);
3078
3103
  });
3079
3104
  }
3080
3105
  //#endregion
3081
3106
  //#region src/composables/useDocxEditorRefApi.ts
3082
- function wi(e) {
3107
+ function Mi(e) {
3083
3108
  function t() {
3084
3109
  let t = e.pagesRef.value;
3085
- t && at(t), e.onPrint?.(), window.print();
3110
+ t && lt(t), e.onPrint?.(), window.print();
3086
3111
  }
3087
3112
  function n() {
3088
3113
  t();
@@ -3116,63 +3141,63 @@ function wi(e) {
3116
3141
  function c() {
3117
3142
  let t = e.layout.value, n = e.editorView.value;
3118
3143
  if (!t || !n) return 0;
3119
- let r = dt(t, n.state.selection.from);
3144
+ let r = gt(t, n.state.selection.from);
3120
3145
  return r == null ? 0 : r + 1;
3121
3146
  }
3122
3147
  function l(t) {
3123
3148
  let n = e.editorView.value;
3124
3149
  if (!n) return !1;
3125
- let r = Ut(n.state.doc, t);
3150
+ let r = Zt(n.state.doc, t);
3126
3151
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3127
3152
  }
3128
3153
  function u(t, n) {
3129
- return Ce(e.editorView.value, t, n);
3154
+ return we(e.editorView.value, t, n);
3130
3155
  }
3131
3156
  function d() {
3132
- return Te(e.editorView.value);
3157
+ return Ee(e.editorView.value);
3133
3158
  }
3134
3159
  function f() {
3135
3160
  return e.comments.value;
3136
3161
  }
3137
3162
  function p(t) {
3138
3163
  let n = e.editorView.value;
3139
- return n ? Ae(n.state.doc, t ?? {}) : [];
3164
+ return n ? je(n.state.doc, t ?? {}) : [];
3140
3165
  }
3141
3166
  function m(t) {
3142
3167
  let n = e.editorView.value;
3143
3168
  if (!n) return !1;
3144
- let r = ke(n.state.doc, t);
3169
+ let r = Ae(n.state.doc, t);
3145
3170
  return r == null ? !1 : (a(r), !0);
3146
3171
  }
3147
3172
  function h(t, n, r) {
3148
- let i = he.between(t.state.doc.resolve(n), t.state.doc.resolve(r));
3173
+ let i = Y.between(t.state.doc.resolve(n), t.state.doc.resolve(r));
3149
3174
  t.dispatch(t.state.tr.setSelection(i)), e.scrollVisiblePositionIntoView(n);
3150
3175
  }
3151
3176
  function g(t, n) {
3152
3177
  let r = e.editorView.value;
3153
3178
  if (!r) return;
3154
- let i = be(r.state.doc, t, n);
3179
+ let i = xe(r.state.doc, t, n);
3155
3180
  i && h(r, i.from, i.to);
3156
3181
  }
3157
3182
  function _(t) {
3158
3183
  let n = e.editorView.value;
3159
3184
  if (!n) return !1;
3160
- let r = Se(n, t);
3185
+ let r = Ce(n, t);
3161
3186
  return r ? (h(n, r.from, r.to), !0) : !1;
3162
3187
  }
3163
3188
  function v(t) {
3164
3189
  let n = e.editorView.value;
3165
3190
  if (!n) return !1;
3166
- let r = xe(n, t);
3191
+ let r = Se(n, t);
3167
3192
  return r ? (h(n, r.from, r.to), !0) : !1;
3168
3193
  }
3169
3194
  function y(t, n, r) {
3170
3195
  let i = e.editorView.value;
3171
3196
  if (!i) return !1;
3172
3197
  try {
3173
- return i.dispatch(Ne(i.state, t, n, r)), !0;
3198
+ return i.dispatch(Pe(i.state, t, n, r)), !0;
3174
3199
  } catch (e) {
3175
- if (e instanceof Ht) return !1;
3200
+ if (e instanceof Xt) return !1;
3176
3201
  throw e;
3177
3202
  }
3178
3203
  }
@@ -3180,9 +3205,9 @@ function wi(e) {
3180
3205
  let r = e.editorView.value;
3181
3206
  if (!r) return !1;
3182
3207
  try {
3183
- return r.dispatch(je(r.state, t, n)), !0;
3208
+ return r.dispatch(Me(r.state, t, n)), !0;
3184
3209
  } catch (e) {
3185
- if (e instanceof Ht) return !1;
3210
+ if (e instanceof Xt) return !1;
3186
3211
  throw e;
3187
3212
  }
3188
3213
  }
@@ -3190,14 +3215,14 @@ function wi(e) {
3190
3215
  let i = e.editorView.value;
3191
3216
  if (!i) return !1;
3192
3217
  try {
3193
- return i.dispatch(Fe(i.state, t, n, r)), !0;
3218
+ return i.dispatch(Ie(i.state, t, n, r)), !0;
3194
3219
  } catch (e) {
3195
- if (e instanceof Ht) return !1;
3220
+ if (e instanceof Xt) return !1;
3196
3221
  throw e;
3197
3222
  }
3198
3223
  }
3199
3224
  function S(t) {
3200
- return we(e.editorView.value, e.layout.value, t);
3225
+ return Te(e.editorView.value, e.layout.value, t);
3201
3226
  }
3202
3227
  function C(t) {
3203
3228
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
@@ -3238,6 +3263,7 @@ function wi(e) {
3238
3263
  setContentControlValue: x,
3239
3264
  applyFormatting: e.applyFormatting,
3240
3265
  setParagraphStyle: e.setParagraphStyle,
3266
+ insertBreak: e.insertBreak,
3241
3267
  getPageContent: S,
3242
3268
  getTotalPages: s,
3243
3269
  getCurrentPage: c,
@@ -3246,26 +3272,36 @@ function wi(e) {
3246
3272
  } };
3247
3273
  }
3248
3274
  //#endregion
3275
+ //#region src/composables/useColorMode.ts
3276
+ function Ni(e) {
3277
+ let t = R(Q());
3278
+ return W((n) => {
3279
+ e() === "system" && n(We((e) => {
3280
+ t.value = e;
3281
+ }));
3282
+ }), E(() => Ue(e(), t.value));
3283
+ }
3284
+ //#endregion
3249
3285
  //#region src/composables/useFontLifecycle.ts
3250
- function Ti(e, t) {
3251
- W(e, (e) => {
3252
- Re(e);
3286
+ function Pi(e, t) {
3287
+ U(e, (e) => {
3288
+ ze(e);
3253
3289
  }, { immediate: !0 });
3254
- let n = ze(t);
3255
- F(() => n());
3290
+ let n = Be(t);
3291
+ I(() => n());
3256
3292
  }
3257
3293
  //#endregion
3258
3294
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3259
- var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3295
+ var Fi = { class: "docx-editor-vue__toolbar-shell" }, Ii = {
3260
3296
  key: 0,
3261
3297
  class: "docx-editor-vue__error"
3262
- }, Oi = {
3298
+ }, Li = {
3263
3299
  key: 1,
3264
3300
  class: "docx-editor-vue__loading"
3265
- }, ki = { class: "docx-editor-vue__editor-area" }, Ai = {
3301
+ }, Ri = { class: "docx-editor-vue__editor-area" }, zi = {
3266
3302
  key: 0,
3267
3303
  class: "docx-editor-vue__vertical-ruler"
3268
- }, ji = ["title"], Mi = ["title", "aria-label"], Ni = /* @__PURE__ */ N({
3304
+ }, Bi = ["title"], Vi = ["title", "aria-label"], Hi = /* @__PURE__ */ N({
3269
3305
  __name: "DocxEditor",
3270
3306
  props: {
3271
3307
  documentBuffer: { default: null },
@@ -3292,6 +3328,7 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3292
3328
  onModeChange: {},
3293
3329
  i18n: { default: void 0 },
3294
3330
  theme: { default: null },
3331
+ colorMode: { default: "light" },
3295
3332
  externalPlugins: { default: () => [] },
3296
3333
  showZoomControl: {
3297
3334
  type: Boolean,
@@ -3323,6 +3360,7 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3323
3360
  },
3324
3361
  fontFamilies: { default: void 0 },
3325
3362
  fonts: {},
3363
+ watermarkPresets: { default: void 0 },
3326
3364
  onPrint: {
3327
3365
  type: Function,
3328
3366
  default: void 0
@@ -3367,40 +3405,40 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3367
3405
  "mode-change"
3368
3406
  ],
3369
3407
  setup(e, { expose: t, emit: n }) {
3370
- let i = e, o = n, s = R(i.mode), c = E(() => i.readOnly || s.value === "viewing"), u = E(() => i.author);
3408
+ let i = e, o = n, s = Ni(() => i.colorMode), c = R(i.mode), u = E(() => i.readOnly || c.value === "viewing"), d = E(() => i.author);
3371
3409
  a(E(() => i.i18n));
3372
- let { t: d } = l(E(() => i.i18n)), h = R(null), v = R(null), b = R(null), x = R(0), S = /* @__PURE__ */ new Set(), ne = /* @__PURE__ */ new Set(), T = new Ee(), D = R(!1), ie = R(!1), ae = R(!1), N = R(!1), oe = R(!1), H = R(i.showOutline), pe = R(!1), U = R(!1), G = R(!1), K = R(null), J = fe([]), Y = fe([]), ge = fe([]), { zoom: X, zoomPercent: ye, isMinZoom: be, isMaxZoom: xe, setZoom: Se, zoomIn: Ce, zoomOut: we, handleWheel: De, handleKeyDown: ke, installShortcuts: Ae, ZOOM_PRESETS: je } = te(i.initialZoom);
3373
- Ae();
3374
- let { editorView: Z, isReady: Me, parseError: Ne, layout: Pe, loadBuffer: Fe, loadDocument: Le, save: Re, focus: ze, destroy: Be, getDocument: Q, getCommands: Ve, reLayout: Ue, getHfPmView: We, syncHfPMs: Ge, setHfTransactionListener: Ke, setDocument: qe } = C({
3375
- hiddenContainer: h,
3376
- pagesContainer: v,
3377
- readOnly: c,
3410
+ let { t: h } = l(E(() => i.i18n)), v = R(null), b = R(null), x = R(null), S = R(0), ne = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), re = new De(), ae = R(!1), j = R(!1), N = R(!1), P = R(!1), V = R(!1), me = R(i.showOutline), H = R(!1), W = R(!1), G = R(!1), K = R(null), J = pe([]), ge = pe([]), _e = pe([]), { zoom: X, zoomPercent: be, isMinZoom: xe, isMaxZoom: Se, setZoom: Ce, zoomIn: we, zoomOut: Te, handleWheel: Oe, handleKeyDown: Ae, installShortcuts: je, ZOOM_PRESETS: Me } = te(i.initialZoom);
3411
+ je();
3412
+ let { editorView: Z, isReady: Ne, parseError: Pe, layout: Fe, loadBuffer: Ie, loadDocument: Re, save: ze, focus: Be, destroy: Ve, getDocument: Q, getCommands: He, reLayout: Ue, getHfPmView: We, syncHfPMs: Ge, setHfTransactionListener: qe, setDocument: Je } = C({
3413
+ hiddenContainer: v,
3414
+ pagesContainer: b,
3415
+ readOnly: u,
3378
3416
  externalPlugins: i.externalPlugins,
3379
- syncCoordinator: T,
3380
- editorMode: s,
3381
- author: u,
3417
+ syncCoordinator: re,
3418
+ editorMode: c,
3419
+ author: d,
3382
3420
  onChange: (e) => {
3383
- o("change", e), o("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3421
+ o("change", e), o("update:document", e), i.onChange?.(e), ne.forEach((t) => t(e));
3384
3422
  },
3385
3423
  onError: (e) => {
3386
3424
  o("error", e), i.onError?.(e);
3387
3425
  },
3388
3426
  onSelectionUpdate: () => {
3389
- x.value++;
3427
+ S.value++;
3390
3428
  let e = Z.value;
3391
- i.onSelectionChange?.(e ? Oe(e.state) : null);
3392
- let t = Te(e);
3393
- ne.forEach((e) => e(t));
3429
+ i.onSelectionChange?.(e ? ke(e.state) : null);
3430
+ let t = Ee(e);
3431
+ T.forEach((e) => e(t));
3394
3432
  }
3395
- }), { commentCallbacks: Je } = ci(i, Z), Ye = E(() => {
3396
- x.value;
3433
+ }), { commentCallbacks: Ye } = gi(i, Z), Xe = E(() => {
3434
+ S.value;
3397
3435
  let e = Q();
3398
3436
  if (!e?.package?.document) return null;
3399
3437
  let t = e.package.document;
3400
3438
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3401
- }), Xe = E(() => {
3402
- x.value;
3403
- let e = Z.value, t = e ? He(e.state).paragraphFormatting : {};
3439
+ }), Ze = E(() => {
3440
+ S.value;
3441
+ let e = Z.value, t = e ? Ke(e.state).paragraphFormatting : {};
3404
3442
  return {
3405
3443
  indentLeft: t.indentLeft ?? 0,
3406
3444
  indentRight: t.indentRight ?? 0,
@@ -3408,24 +3446,24 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3408
3446
  hangingIndent: t.hangingIndent ?? !1,
3409
3447
  tabStops: t.tabs ?? null
3410
3448
  };
3411
- }), Ze = E(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), Qe = R(null), $e = R([]);
3412
- function et(e, t) {
3413
- Qe.value = _e(e, t), $e.value = ve(e, t);
3449
+ }), Qe = E(() => (S.value, Q()?.package?.theme ?? i.theme ?? null)), $e = E(() => (S.value, Q()?.package?.styles?.styles ?? void 0)), et = R(null), tt = R([]);
3450
+ function nt(e, t) {
3451
+ et.value = ve(e, t), tt.value = ye(e, t);
3414
3452
  }
3415
- function tt() {
3416
- Qe.value = null, $e.value = [];
3453
+ function rt() {
3454
+ et.value = null, tt.value = [];
3417
3455
  }
3418
- Ti(() => i.fonts, (e) => {
3456
+ Pi(() => i.fonts, (e) => {
3419
3457
  o("error", e), i.onError?.(e);
3420
3458
  });
3421
- let nt = E(() => $.value?.headerFooter ? We($.value.headerFooter) ?? null : null), rt = E(() => nt.value ?? Z.value);
3422
- I(() => {
3423
- Ke((e, t) => {
3424
- x.value++, requestAnimationFrame(() => {
3459
+ let it = E(() => $.value?.headerFooter ? We($.value.headerFooter) ?? null : null), at = E(() => it.value ?? Z.value);
3460
+ le(() => {
3461
+ qe((e, t) => {
3462
+ S.value++, requestAnimationFrame(() => {
3425
3463
  let e = $.value;
3426
3464
  if (!e) return;
3427
- et(t, e.position);
3428
- let n = Kt(e.position), r = b.value;
3465
+ nt(t, e.position);
3466
+ let n = en(e.position), r = x.value;
3429
3467
  if (!n || !r) return;
3430
3468
  let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3431
3469
  $.value = {
@@ -3438,20 +3476,20 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3438
3476
  }
3439
3477
  };
3440
3478
  });
3441
- }), W(() => $.value, (e) => {
3479
+ }), U(() => $.value, (e) => {
3442
3480
  if (!e) {
3443
- tt();
3481
+ rt();
3444
3482
  return;
3445
3483
  }
3446
3484
  let t = Z.value;
3447
3485
  if (t) {
3448
3486
  try {
3449
- let e = t.state.tr.setSelection(he.create(t.state.doc, 0));
3487
+ let e = t.state.tr.setSelection(Y.create(t.state.doc, 0));
3450
3488
  t.dispatch(e);
3451
3489
  } catch {}
3452
3490
  t.dom.blur?.();
3453
3491
  }
3454
- or.updateSelectionOverlay();
3492
+ dr.updateSelectionOverlay();
3455
3493
  });
3456
3494
  let e = 0;
3457
3495
  function t() {
@@ -3460,33 +3498,33 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3460
3498
  let t = $.value;
3461
3499
  if (!t?.headerFooter) return;
3462
3500
  let n = We(t.headerFooter);
3463
- n && et(n, t.position);
3501
+ n && nt(n, t.position);
3464
3502
  }));
3465
3503
  }
3466
- window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
3504
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3467
3505
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3468
3506
  });
3469
3507
  });
3470
- let it = E(() => {
3508
+ let ot = E(() => {
3471
3509
  let e = [];
3472
- return U.value && e.push(`translateX(-${Ie}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3510
+ return W.value && e.push(`translateX(-${Le}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3473
3511
  transform: e.length > 0 ? e.join(" ") : void 0,
3474
3512
  transformOrigin: "top center",
3475
3513
  transition: "transform 0.2s ease"
3476
3514
  };
3477
- }), at = E(() => ({
3515
+ }), st = E(() => ({
3478
3516
  paddingLeft: "20px",
3479
- paddingRight: 20 + (U.value ? Ie * 2 : 0) + "px",
3517
+ paddingRight: 20 + (W.value ? Le * 2 : 0) + "px",
3480
3518
  transition: "padding 0.2s ease"
3481
- })), ot = E(() => {
3482
- let e = Ye.value;
3483
- return ct(e?.pageWidth ?? 12240) * X.value;
3484
- }), st = E(() => {
3519
+ })), ct = E(() => {
3520
+ let e = Xe.value;
3521
+ return ft(e?.pageWidth ?? 12240) * X.value;
3522
+ }), lt = E(() => {
3485
3523
  let e = /* @__PURE__ */ new Set();
3486
3524
  for (let t of J.value) t.parentId == null && t.done && e.add(t.id);
3487
3525
  return e;
3488
- }), lt = E(() => {
3489
- x.value;
3526
+ }), ut = E(() => {
3527
+ S.value;
3490
3528
  let e = Z.value;
3491
3529
  if (!e) return [];
3492
3530
  let t = /* @__PURE__ */ new Set(), n = [];
@@ -3502,220 +3540,224 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3502
3540
  }
3503
3541
  return !0;
3504
3542
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3505
- }), ut = Pt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = li({
3543
+ }), dt = Ht(), { floatingCommentBtn: pt, pendingCommentRange: mt, addCommentYPosition: ht, sidebarAutoOpenedRef: gt, extractCommentsAndChanges: _t, handleAddComment: vt, handleCancelAddComment: yt, handleStartAddComment: bt, handleMarkerClick: xt } = _i({
3506
3544
  editorView: Z,
3507
3545
  getDocument: Q,
3508
3546
  comments: J,
3509
- trackedChanges: Y,
3510
- resolvedCommentIds: st,
3547
+ trackedChanges: ge,
3548
+ resolvedCommentIds: lt,
3511
3549
  activeSidebarItem: K,
3512
- showSidebar: U,
3550
+ showSidebar: W,
3513
3551
  isAddingComment: G,
3514
- readOnly: c,
3552
+ readOnly: u,
3515
3553
  zoom: X,
3516
- stateTick: x,
3517
- pagesRef: v,
3518
- pagesViewportRef: b,
3554
+ stateTick: S,
3555
+ pagesRef: b,
3556
+ pagesViewportRef: x,
3519
3557
  emit: o,
3520
- commentIdAllocator: ut,
3521
- author: u,
3522
- commentCallbacks: Je
3523
- }), { docxInputRef: bt, imageInputRef: xt, handleImageFileChange: St, handleDocxFileChange: Ct, handleDocumentNameChange: wt, downloadCurrentDocument: Tt, loadDocumentBuffer: Et, loadDocument: Dt, save: Ot } = ei({
3524
- loadBuffer: Fe,
3525
- loadParsedDocument: Le,
3558
+ commentIdAllocator: dt,
3559
+ author: d,
3560
+ commentCallbacks: Ye
3561
+ }), { docxInputRef: St, imageInputRef: Ct, handleImageFileChange: wt, handleDocxFileChange: Tt, handleDocumentNameChange: Et, downloadCurrentDocument: Dt, loadDocumentBuffer: Ot, loadDocument: kt, save: At } = ci({
3562
+ loadBuffer: Ie,
3563
+ loadParsedDocument: Re,
3526
3564
  getDocument: Q,
3527
- saveBlob: Re,
3528
- extractCommentsAndChanges: ht,
3565
+ saveBlob: ze,
3566
+ extractCommentsAndChanges: _t,
3529
3567
  emit: o,
3530
3568
  documentName: () => i.documentName,
3531
3569
  onDocumentNameChange: i.onDocumentNameChange,
3532
- getActiveView: () => rt.value,
3533
- nextTick: ce
3534
- }), { hyperlinkPopupData: kt, handleHyperlinkSubmit: At, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Ft } = ti({
3570
+ getActiveView: () => at.value,
3571
+ nextTick: se
3572
+ }), { hyperlinkPopupData: jt, handleHyperlinkSubmit: Mt, handleHyperlinkRemove: Nt, handleHyperlinkPopupNavigate: Pt, handleHyperlinkPopupEdit: Ft, handleHyperlinkPopupRemove: It } = li({
3535
3573
  editorView: Z,
3536
- getCommands: Ve
3537
- }), { handleClearFormatting: It, handleApplyStyle: Lt, handleInsertPageBreak: Rt, handleInsertSymbol: zt, applyFormatting: Bt, setParagraphStyle: Vt } = ni({
3574
+ getCommands: He
3575
+ }), { handleClearFormatting: Lt, handleApplyStyle: Rt, handleInsertPageBreak: zt, handleInsertSectionBreakNextPage: Bt, handleInsertSectionBreakContinuous: Vt, handleInsertSymbol: Ut, applyFormatting: Wt, setParagraphStyle: Gt, insertBreak: Kt } = ui({
3538
3576
  editorView: Z,
3539
- activeView: rt,
3577
+ activeView: at,
3540
3578
  getDocument: Q
3541
- }), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = ri({
3579
+ }), { handlePageSetupApply: qt, handleLeftMarginChange: Jt, handleRightMarginChange: Yt, handleTopMarginChange: Xt, handleBottomMarginChange: Zt, handleIndentLeftChange: Qt, handleIndentRightChange: $t, handleFirstLineIndentChange: tn, handleTabStopRemove: nn } = di({
3542
3580
  editorView: Z,
3543
3581
  getDocument: Q,
3544
- readOnly: c,
3545
- stateTick: x,
3582
+ readOnly: u,
3583
+ stateTick: S,
3546
3584
  reLayout: Ue,
3547
3585
  emit: o
3548
- }), { showWatermark: $t, currentWatermark: en, handleWatermarkApply: tn } = ii({
3586
+ }), { showWatermark: rn, currentWatermark: an, handleWatermarkApply: on } = fi({
3549
3587
  editorView: Z,
3550
- readOnly: c,
3551
- stateTick: x
3552
- }), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: an, handleEditorScrollMouseDown: on } = ai({
3588
+ readOnly: u,
3589
+ stateTick: S
3590
+ }), { handleToggleOutline: cn, handleOutlineNavigate: ln, handleToggleSidebar: un, handleEditorScrollMouseDown: dn } = pi({
3553
3591
  editorView: Z,
3554
- showOutline: H,
3555
- showSidebar: U,
3556
- outlineHeadings: ge,
3592
+ showOutline: me,
3593
+ showSidebar: W,
3594
+ outlineHeadings: _e,
3557
3595
  activeSidebarItem: K,
3558
- extractCommentsAndChanges: ht
3596
+ extractCommentsAndChanges: _t
3559
3597
  });
3560
- oi({
3561
- showKeyboardShortcuts: pe,
3562
- showFindReplace: D,
3563
- showHyperlink: ie,
3564
- handleZoomKeyDown: ke,
3598
+ mi({
3599
+ showKeyboardShortcuts: H,
3600
+ showFindReplace: ae,
3601
+ showHyperlink: j,
3602
+ handleZoomKeyDown: Ae,
3565
3603
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3566
3604
  });
3567
- let { addComment: sn, replyToComment: cn, resolveComment: un, proposeChange: dn, handleCommentReply: fn, handleCommentResolve: pn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = si({
3605
+ let { addComment: fn, replyToComment: pn, resolveComment: mn, proposeChange: hn, handleCommentReply: gn, handleCommentResolve: vn, handleCommentUnresolve: yn, handleCommentDelete: bn, handleAcceptChange: xn, handleRejectChange: wn, handleAcceptChangeById: Tn, handleRejectChangeById: Dn, handleTrackedChangeReply: On } = hi({
3568
3606
  editorView: Z,
3569
3607
  getDocument: Q,
3570
3608
  comments: J,
3571
- trackedChanges: Y,
3572
- showSidebar: U,
3609
+ trackedChanges: ge,
3610
+ showSidebar: W,
3573
3611
  isAddingComment: G,
3574
- pendingCommentRange: ft,
3575
- contentChangeSubscribers: S,
3576
- extractCommentsAndChanges: ht,
3612
+ pendingCommentRange: mt,
3613
+ contentChangeSubscribers: ne,
3614
+ extractCommentsAndChanges: _t,
3577
3615
  emit: o,
3578
- commentIdAllocator: ut,
3579
- author: u,
3580
- commentCallbacks: Je
3581
- }), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleToolbarImageWrap: On, handleImageTransform: An } = ui({
3616
+ commentIdAllocator: dt,
3617
+ author: d,
3618
+ commentCallbacks: Ye
3619
+ }), { selectedImage: kn, imageInteracting: An, imageToolbarContext: jn, handleToolbarImageWrap: Nn, handleImageTransform: Pn } = vi({
3582
3620
  editorView: Z,
3583
3621
  zoom: X,
3584
- stateTick: x,
3585
- getCommands: Ve
3586
- }), jn = ee(), Mn = null, { tableInsertButton: Nn, hfEdit: $, scrollPageInfo: Pn, resolvePos: Fn, setPmSelection: In, scrollVisiblePositionIntoView: Ln, handlePagesMouseDown: Rn, handlePagesMouseMove: zn, handlePagesClick: Bn, handlePagesDoubleClick: Vn, handleTableInsertClick: Hn, clearTableInsertTimer: Un, handleHfSave: Wn, handleHfRemove: Gn } = bi({
3622
+ stateTick: S,
3623
+ getCommands: He
3624
+ }), Fn = ee(), In = null, { tableInsertButton: Rn, hfEdit: $, scrollPageInfo: zn, resolvePos: Bn, setPmSelection: Vn, scrollVisiblePositionIntoView: Hn, handlePagesMouseDown: Un, handlePagesMouseMove: Wn, handlePagesClick: Gn, handlePagesDoubleClick: Kn, handleTableInsertClick: qn, clearTableInsertTimer: Jn, handleHfSave: Yn, handleHfRemove: Xn } = Oi({
3587
3625
  editorView: Z,
3588
- pagesRef: v,
3589
- pagesViewportRef: b,
3590
- selectedImage: Tn,
3591
- imageInteracting: En,
3592
- hyperlinkPopupData: kt,
3593
- readOnly: c,
3626
+ pagesRef: b,
3627
+ pagesViewportRef: x,
3628
+ selectedImage: kn,
3629
+ imageInteracting: An,
3630
+ hyperlinkPopupData: jt,
3631
+ readOnly: u,
3594
3632
  zoom: X,
3595
- layout: Pe,
3596
- tableResize: jn,
3597
- getCommands: Ve,
3633
+ layout: Fe,
3634
+ tableResize: Fn,
3635
+ getCommands: He,
3598
3636
  getDocument: Q,
3599
3637
  reLayout: Ue,
3600
3638
  emit: o,
3601
- clearOverlay: ir,
3639
+ clearOverlay: lr,
3602
3640
  syncHfPMs: Ge,
3603
3641
  getHfPmView: We,
3604
- setDocument: qe
3605
- }), { contextMenu: Kn, imageContextMenu: qn, imageContextMenuTextActions: Jn, handleContextMenu: Yn, handleSelectedImageContextMenu: Xn, handleImageWrapSelect: Zn, handleContextMenuAction: Qn } = vi({
3642
+ setDocument: Je
3643
+ }), { contextMenu: Zn, imageContextMenu: Qn, imageContextMenuTextActions: $n, handleContextMenu: er, handleSelectedImageContextMenu: tr, handleImageWrapSelect: nr, handleContextMenuAction: rr } = Ei({
3606
3644
  editorView: Z,
3607
- selectedImage: Tn,
3645
+ selectedImage: kn,
3608
3646
  zoom: X,
3609
- showImageProperties: N,
3610
- getCommands: Ve,
3611
- clearOverlay: ir,
3612
- setPmSelection: In,
3613
- resolvePos: Fn
3614
- }), { handleMenuAction: $n, handleMenuTableInsert: er } = Si({
3647
+ showImageProperties: P,
3648
+ getCommands: He,
3649
+ clearOverlay: lr,
3650
+ setPmSelection: Vn,
3651
+ resolvePos: Bn
3652
+ }), { handleMenuAction: ir, handleMenuTableInsert: ar } = Ai({
3615
3653
  editorView: Z,
3616
- getCommands: Ve,
3617
- docxInputRef: bt,
3618
- imageInputRef: xt,
3619
- showPageSetup: oe,
3620
- showWatermark: $t,
3621
- showHyperlink: ie,
3622
- showInsertSymbol: ae,
3623
- showKeyboardShortcuts: pe,
3624
- handleClearFormatting: It,
3625
- handleInsertPageBreak: Rt,
3626
- handleToggleOutline: nn,
3627
- handleToggleSidebar: an,
3628
- downloadCurrentDocument: Tt,
3654
+ getCommands: He,
3655
+ docxInputRef: St,
3656
+ imageInputRef: Ct,
3657
+ showPageSetup: V,
3658
+ showWatermark: rn,
3659
+ showHyperlink: j,
3660
+ showInsertSymbol: N,
3661
+ showKeyboardShortcuts: H,
3662
+ handleClearFormatting: Lt,
3663
+ handleInsertPageBreak: zt,
3664
+ handleInsertSectionBreakNextPage: Bt,
3665
+ handleInsertSectionBreakContinuous: Vt,
3666
+ handleToggleOutline: cn,
3667
+ handleToggleSidebar: un,
3668
+ downloadCurrentDocument: Dt,
3629
3669
  emit: o
3630
3670
  });
3631
- Ci({
3671
+ ji({
3632
3672
  documentBuffer: () => i.documentBuffer,
3633
3673
  document: () => i.document,
3634
- loadDocumentBuffer: Et,
3635
- loadDocument: Dt,
3636
- sidebarAutoOpenedRef: mt
3674
+ loadDocumentBuffer: Ot,
3675
+ loadDocument: kt,
3676
+ sidebarAutoOpenedRef: gt
3637
3677
  });
3638
- let tr = () => Z.value, nr = () => v.value;
3639
- W(() => i.mode, (e) => {
3640
- e && e !== s.value && (s.value = e);
3641
- }), W(() => i.showOutline, (e) => {
3642
- H.value = !!e;
3678
+ let or = () => Z.value, sr = () => b.value;
3679
+ U(() => i.mode, (e) => {
3680
+ e && e !== c.value && (c.value = e);
3681
+ }), U(() => i.showOutline, (e) => {
3682
+ me.value = !!e;
3643
3683
  });
3644
- function rr(e) {
3645
- s.value !== e && (s.value = e, o("mode-change", e));
3684
+ function cr(e) {
3685
+ c.value !== e && (c.value = e, o("mode-change", e));
3646
3686
  }
3647
- I(() => {
3648
- Mn = jn.install();
3649
- }), F(() => {
3650
- Mn?.();
3687
+ le(() => {
3688
+ In = Fn.install();
3689
+ }), I(() => {
3690
+ In?.();
3651
3691
  });
3652
- function ir() {
3653
- or.clearOverlay();
3692
+ function lr() {
3693
+ dr.clearOverlay();
3654
3694
  }
3655
- function ar() {
3656
- or.updateSelectionOverlay();
3695
+ function ur() {
3696
+ dr.updateSelectionOverlay();
3657
3697
  }
3658
- let or = xi({
3698
+ let dr = ki({
3659
3699
  editorView: Z,
3660
- pagesRef: v,
3700
+ pagesRef: b,
3661
3701
  zoom: X,
3662
- selectedImage: Tn,
3702
+ selectedImage: kn,
3663
3703
  isHfEditing: E(() => $.value !== null),
3664
- imageInteracting: En
3665
- }), sr = T.onRender(() => ar());
3666
- ar(), F(() => {
3667
- sr(), ir();
3704
+ imageInteracting: An
3705
+ }), fr = re.onRender(() => ur());
3706
+ ur(), I(() => {
3707
+ fr(), lr();
3668
3708
  });
3669
- let { exposed: cr } = wi({
3709
+ let { exposed: pr } = Mi({
3670
3710
  editorView: Z,
3671
- layout: Pe,
3672
- pagesRef: v,
3673
- pagesViewportRef: b,
3711
+ layout: Fe,
3712
+ pagesRef: b,
3713
+ pagesViewportRef: x,
3674
3714
  zoom: X,
3675
3715
  comments: J,
3676
- focus: ze,
3677
- destroy: Be,
3716
+ focus: Be,
3717
+ destroy: Ve,
3678
3718
  getDocument: Q,
3679
- setZoom: Se,
3680
- save: Ot,
3681
- loadDocument: Dt,
3682
- loadDocumentBuffer: Et,
3683
- addComment: sn,
3684
- replyToComment: cn,
3685
- resolveComment: un,
3686
- proposeChange: dn,
3687
- applyFormatting: Bt,
3688
- setParagraphStyle: Vt,
3689
- scrollVisiblePositionIntoView: Ln,
3690
- contentChangeSubscribers: S,
3691
- selectionChangeSubscribers: ne,
3719
+ setZoom: Ce,
3720
+ save: At,
3721
+ loadDocument: kt,
3722
+ loadDocumentBuffer: Ot,
3723
+ addComment: fn,
3724
+ replyToComment: pn,
3725
+ resolveComment: mn,
3726
+ proposeChange: hn,
3727
+ applyFormatting: Wt,
3728
+ setParagraphStyle: Gt,
3729
+ insertBreak: Kt,
3730
+ scrollVisiblePositionIntoView: Hn,
3731
+ contentChangeSubscribers: ne,
3732
+ selectionChangeSubscribers: T,
3692
3733
  onPrint: i.onPrint
3693
3734
  });
3694
- return t(cr), (t, n) => (L(), A("div", {
3695
- class: le([
3735
+ return t(pr), (t, n) => (L(), k("div", {
3736
+ class: ce([
3696
3737
  "docx-editor-vue ep-root paged-editor",
3738
+ B(s) ? "dark" : "",
3697
3739
  e.className,
3698
3740
  {
3699
- "paged-editor--readonly": c.value,
3700
- "paged-editor--hf-editing": V($) !== null,
3701
- "paged-editor--editing-header": V($)?.position === "header",
3702
- "paged-editor--editing-footer": V($)?.position === "footer"
3741
+ "paged-editor--readonly": u.value,
3742
+ "paged-editor--hf-editing": B($) !== null,
3743
+ "paged-editor--editing-header": B($)?.position === "header",
3744
+ "paged-editor--editing-footer": B($)?.position === "footer"
3703
3745
  }
3704
3746
  ]),
3705
- style: P(e.style)
3747
+ style: F(e.style)
3706
3748
  }, [
3707
- j("div", Ei, [M(kn, {
3749
+ A("div", Fi, [M(Ln, {
3708
3750
  "show-menu-bar": e.showMenuBar,
3709
3751
  "document-name": e.documentName,
3710
3752
  "document-name-editable": e.documentNameEditable,
3711
3753
  "render-logo": e.renderLogo,
3712
3754
  "render-title-bar-right": e.renderTitleBarRight,
3713
- onRename: V(wt),
3714
- onMenuAction: V($n),
3715
- onInsertTable: V(er)
3755
+ onRename: B(Et),
3756
+ onMenuAction: B(ir),
3757
+ onInsertTable: B(ar)
3716
3758
  }, {
3717
- "title-bar-left": me(() => [ue(t.$slots, "title-bar-left")]),
3718
- "title-bar-right": me(() => [ue(t.$slots, "title-bar-right")]),
3759
+ "title-bar-left": he(() => [de(t.$slots, "title-bar-left")]),
3760
+ "title-bar-right": he(() => [de(t.$slots, "title-bar-right")]),
3719
3761
  _: 3
3720
3762
  }, 8, [
3721
3763
  "show-menu-bar",
@@ -3726,37 +3768,38 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3726
3768
  "onRename",
3727
3769
  "onMenuAction",
3728
3770
  "onInsertTable"
3729
- ]), e.showToolbar ? (L(), O(y, {
3771
+ ]), e.showToolbar ? (L(), D(y, {
3730
3772
  key: 0,
3731
- view: rt.value,
3732
- "get-commands": V(Ve),
3733
- "state-tick": x.value,
3734
- "zoom-percent": V(ye),
3735
- "is-min-zoom": V(be),
3736
- "is-max-zoom": V(xe),
3737
- "zoom-presets": V(je),
3773
+ view: at.value,
3774
+ "get-commands": B(He),
3775
+ "state-tick": S.value,
3776
+ "zoom-percent": B(be),
3777
+ "is-min-zoom": B(xe),
3778
+ "is-max-zoom": B(Se),
3779
+ "zoom-presets": B(Me),
3738
3780
  "show-zoom-control": e.showZoomControl,
3739
- "editor-mode": s.value,
3740
- "comments-sidebar-open": U.value,
3741
- "image-context": V(Dn),
3742
- theme: Ze.value,
3781
+ "editor-mode": c.value,
3782
+ "comments-sidebar-open": W.value,
3783
+ "image-context": B(jn),
3784
+ theme: Qe.value,
3743
3785
  "font-families": e.fontFamilies,
3744
- onInsertLink: n[0] ||= (e) => ie.value = !0,
3745
- onApplyStyle: V(Lt),
3746
- onZoomIn: V(Ce),
3747
- onZoomOut: V(we),
3748
- onZoomSet: V(Se),
3749
- onToggleSidebar: V(an),
3750
- onModeChange: rr,
3751
- onImageWrapType: V(On),
3752
- onImageProperties: n[1] ||= (e) => N.value = !0,
3753
- onImageTransform: V(An)
3754
- }, re({
3755
- "table-context": me(() => [M(m, {
3756
- view: rt.value,
3757
- "get-commands": V(Ve),
3758
- "state-tick": x.value,
3759
- theme: Ze.value
3786
+ "document-styles": $e.value,
3787
+ onInsertLink: n[0] ||= (e) => j.value = !0,
3788
+ onApplyStyle: B(Rt),
3789
+ onZoomIn: B(we),
3790
+ onZoomOut: B(Te),
3791
+ onZoomSet: B(Ce),
3792
+ onToggleSidebar: B(un),
3793
+ onModeChange: cr,
3794
+ onImageWrapType: B(Nn),
3795
+ onImageProperties: n[1] ||= (e) => P.value = !0,
3796
+ onImageTransform: B(Pn)
3797
+ }, ie({
3798
+ "table-context": he(() => [M(m, {
3799
+ view: at.value,
3800
+ "get-commands": B(He),
3801
+ "state-tick": S.value,
3802
+ theme: Qe.value
3760
3803
  }, null, 8, [
3761
3804
  "view",
3762
3805
  "get-commands",
@@ -3766,11 +3809,11 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3766
3809
  _: 2
3767
3810
  }, [e.toolbarExtra ? {
3768
3811
  name: "toolbar-extra",
3769
- fn: me(() => [(L(), O(de(e.toolbarExtra)))]),
3812
+ fn: he(() => [(L(), D(fe(e.toolbarExtra)))]),
3770
3813
  key: "0"
3771
3814
  } : {
3772
3815
  name: "toolbar-extra",
3773
- fn: me(() => [ue(t.$slots, "toolbar-extra")]),
3816
+ fn: he(() => [de(t.$slots, "toolbar-extra")]),
3774
3817
  key: "1"
3775
3818
  }]), 1032, [
3776
3819
  "view",
@@ -3786,6 +3829,7 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3786
3829
  "image-context",
3787
3830
  "theme",
3788
3831
  "font-families",
3832
+ "document-styles",
3789
3833
  "onApplyStyle",
3790
3834
  "onZoomIn",
3791
3835
  "onZoomOut",
@@ -3793,33 +3837,34 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3793
3837
  "onToggleSidebar",
3794
3838
  "onImageWrapType",
3795
3839
  "onImageTransform"
3796
- ])) : k("", !0)]),
3797
- M(yr, {
3798
- "show-find-replace": D.value,
3799
- "onUpdate:showFindReplace": n[2] ||= (e) => D.value = e,
3800
- "show-hyperlink": ie.value,
3801
- "onUpdate:showHyperlink": n[3] ||= (e) => ie.value = e,
3802
- "show-insert-symbol": ae.value,
3803
- "onUpdate:showInsertSymbol": n[4] ||= (e) => ae.value = e,
3804
- "show-image-properties": N.value,
3805
- "onUpdate:showImageProperties": n[5] ||= (e) => N.value = e,
3806
- "show-page-setup": oe.value,
3807
- "onUpdate:showPageSetup": n[6] ||= (e) => oe.value = e,
3808
- "show-watermark": V($t),
3809
- "onUpdate:showWatermark": n[7] ||= (e) => se($t) ? $t.value = e : null,
3810
- "show-keyboard-shortcuts": pe.value,
3811
- "onUpdate:showKeyboardShortcuts": n[8] ||= (e) => pe.value = e,
3812
- view: V(Z),
3813
- bookmarks: lt.value,
3814
- "selected-image-pm-pos": V(Tn)?.pmPos ?? null,
3815
- "section-properties": Ye.value,
3816
- "current-watermark": V(en),
3817
- "scroll-visible-position-into-view": V(Ln),
3818
- onInsertSymbol: V(zt),
3819
- onHyperlinkSubmit: V(At),
3820
- onHyperlinkRemove: V(jt),
3821
- onPageSetupApply: V(Ht),
3822
- onWatermarkApply: V(tn)
3840
+ ])) : O("", !0)]),
3841
+ M(Dr, {
3842
+ "show-find-replace": ae.value,
3843
+ "onUpdate:showFindReplace": n[2] ||= (e) => ae.value = e,
3844
+ "show-hyperlink": j.value,
3845
+ "onUpdate:showHyperlink": n[3] ||= (e) => j.value = e,
3846
+ "show-insert-symbol": N.value,
3847
+ "onUpdate:showInsertSymbol": n[4] ||= (e) => N.value = e,
3848
+ "show-image-properties": P.value,
3849
+ "onUpdate:showImageProperties": n[5] ||= (e) => P.value = e,
3850
+ "show-page-setup": V.value,
3851
+ "onUpdate:showPageSetup": n[6] ||= (e) => V.value = e,
3852
+ "show-watermark": B(rn),
3853
+ "onUpdate:showWatermark": n[7] ||= (e) => oe(rn) ? rn.value = e : null,
3854
+ "show-keyboard-shortcuts": H.value,
3855
+ "onUpdate:showKeyboardShortcuts": n[8] ||= (e) => H.value = e,
3856
+ view: B(Z),
3857
+ bookmarks: ut.value,
3858
+ "selected-image-pm-pos": B(kn)?.pmPos ?? null,
3859
+ "section-properties": Xe.value,
3860
+ "current-watermark": B(an),
3861
+ "watermark-presets": e.watermarkPresets,
3862
+ "scroll-visible-position-into-view": B(Hn),
3863
+ onInsertSymbol: B(Ut),
3864
+ onHyperlinkSubmit: B(Mt),
3865
+ onHyperlinkRemove: B(Nt),
3866
+ onPageSetupApply: B(qt),
3867
+ onWatermarkApply: B(on)
3823
3868
  }, null, 8, [
3824
3869
  "show-find-replace",
3825
3870
  "show-hyperlink",
@@ -3833,6 +3878,7 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3833
3878
  "selected-image-pm-pos",
3834
3879
  "section-properties",
3835
3880
  "current-watermark",
3881
+ "watermark-presets",
3836
3882
  "scroll-visible-position-into-view",
3837
3883
  "onInsertSymbol",
3838
3884
  "onHyperlinkSubmit",
@@ -3840,35 +3886,35 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3840
3886
  "onPageSetupApply",
3841
3887
  "onWatermarkApply"
3842
3888
  ]),
3843
- V(Ne) ? (L(), A("div", Di, B(V(Ne)), 1)) : k("", !0),
3844
- !V(Me) && !V(Ne) ? (L(), A("div", Oi, "Loading...")) : k("", !0),
3845
- j("div", {
3889
+ B(Pe) ? (L(), k("div", Ii, z(B(Pe)), 1)) : O("", !0),
3890
+ !B(Ne) && !B(Pe) ? (L(), k("div", Li, "Loading...")) : O("", !0),
3891
+ A("div", {
3846
3892
  ref_key: "hiddenPmRef",
3847
- ref: h,
3893
+ ref: v,
3848
3894
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3849
3895
  }, null, 512),
3850
- j("div", {
3896
+ A("div", {
3851
3897
  class: "docx-editor-vue__editor-scroll",
3852
- onMousedown: n[31] ||= (...e) => V(on) && V(on)(...e)
3853
- }, [e.showRuler && Ye.value ? (L(), A("div", {
3898
+ onMousedown: n[31] ||= (...e) => B(dn) && B(dn)(...e)
3899
+ }, [e.showRuler && Xe.value ? (L(), k("div", {
3854
3900
  key: 0,
3855
3901
  class: "docx-editor-vue__ruler-row",
3856
- style: P(at.value)
3902
+ style: F(st.value)
3857
3903
  }, [M(g, {
3858
- "section-props": Ye.value,
3859
- zoom: V(X),
3860
- editable: !c.value,
3861
- "indent-left": Xe.value.indentLeft,
3862
- "indent-right": Xe.value.indentRight,
3863
- "first-line-indent": Xe.value.firstLineIndent,
3864
- "hanging-indent": Xe.value.hangingIndent,
3865
- "tab-stops": Xe.value.tabStops,
3866
- onLeftMarginChange: V(Ut),
3867
- onRightMarginChange: V(Wt),
3868
- onIndentLeftChange: V(Jt),
3869
- onIndentRightChange: V(Yt),
3870
- onFirstLineIndentChange: V(Xt),
3871
- onTabStopRemove: V(Zt)
3904
+ "section-props": Xe.value,
3905
+ zoom: B(X),
3906
+ editable: !u.value,
3907
+ "indent-left": Ze.value.indentLeft,
3908
+ "indent-right": Ze.value.indentRight,
3909
+ "first-line-indent": Ze.value.firstLineIndent,
3910
+ "hanging-indent": Ze.value.hangingIndent,
3911
+ "tab-stops": Ze.value.tabStops,
3912
+ onLeftMarginChange: B(Jt),
3913
+ onRightMarginChange: B(Yt),
3914
+ onIndentLeftChange: B(Qt),
3915
+ onIndentRightChange: B($t),
3916
+ onFirstLineIndentChange: B(tn),
3917
+ onTabStopRemove: B(nn)
3872
3918
  }, null, 8, [
3873
3919
  "section-props",
3874
3920
  "zoom",
@@ -3884,50 +3930,50 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3884
3930
  "onIndentRightChange",
3885
3931
  "onFirstLineIndentChange",
3886
3932
  "onTabStopRemove"
3887
- ])], 4)) : k("", !0), j("div", ki, [
3888
- j("div", {
3933
+ ])], 4)) : O("", !0), A("div", Ri, [
3934
+ A("div", {
3889
3935
  ref_key: "pagesViewportRef",
3890
- ref: b,
3936
+ ref: x,
3891
3937
  class: "docx-editor-vue__pages-viewport",
3892
- onMousedown: n[22] ||= (...e) => V(Rn) && V(Rn)(...e),
3893
- onMousemove: n[23] ||= (...e) => V(zn) && V(zn)(...e),
3894
- onClick: n[24] ||= (...e) => V(Bn) && V(Bn)(...e),
3895
- onDblclick: n[25] ||= (...e) => V(Vn) && V(Vn)(...e),
3896
- onContextmenu: n[26] ||= q((...e) => V(Yn) && V(Yn)(...e), ["prevent"]),
3897
- onWheel: n[27] ||= (...e) => V(De) && V(De)(...e)
3938
+ onMousedown: n[22] ||= (...e) => B(Un) && B(Un)(...e),
3939
+ onMousemove: n[23] ||= (...e) => B(Wn) && B(Wn)(...e),
3940
+ onClick: n[24] ||= (...e) => B(Gn) && B(Gn)(...e),
3941
+ onDblclick: n[25] ||= (...e) => B(Kn) && B(Kn)(...e),
3942
+ onContextmenu: n[26] ||= q((...e) => B(er) && B(er)(...e), ["prevent"]),
3943
+ onWheel: n[27] ||= (...e) => B(Oe) && B(Oe)(...e)
3898
3944
  }, [
3899
- e.showRuler && Ye.value ? (L(), A("div", Ai, [M(f, {
3900
- "section-props": Ye.value,
3901
- zoom: V(X),
3902
- editable: !c.value,
3903
- onTopMarginChange: V(Gt),
3904
- onBottomMarginChange: V(qt)
3945
+ e.showRuler && Xe.value ? (L(), k("div", zi, [M(f, {
3946
+ "section-props": Xe.value,
3947
+ zoom: B(X),
3948
+ editable: !u.value,
3949
+ onTopMarginChange: B(Xt),
3950
+ onBottomMarginChange: B(Zt)
3905
3951
  }, null, 8, [
3906
3952
  "section-props",
3907
3953
  "zoom",
3908
3954
  "editable",
3909
3955
  "onTopMarginChange",
3910
3956
  "onBottomMarginChange"
3911
- ])])) : k("", !0),
3912
- j("div", {
3957
+ ])])) : O("", !0),
3958
+ A("div", {
3913
3959
  ref_key: "pagesRef",
3914
- ref: v,
3960
+ ref: b,
3915
3961
  class: "docx-editor-vue__pages paged-editor__pages",
3916
- style: P(it.value)
3962
+ style: F(ot.value)
3917
3963
  }, null, 4),
3918
- c.value ? k("", !0) : (L(), O(wn, {
3964
+ u.value ? O("", !0) : (L(), D(Mn, {
3919
3965
  key: 1,
3920
- container: v.value,
3921
- view: V(Z)
3966
+ container: b.value,
3967
+ view: B(Z)
3922
3968
  }, null, 8, ["container", "view"])),
3923
- M(vn, {
3924
- "is-open": V($) !== null,
3925
- position: V($)?.position ?? "header",
3926
- view: nt.value,
3927
- "target-rect": V($)?.targetRect ?? null,
3928
- onSave: V(Wn),
3969
+ M(En, {
3970
+ "is-open": B($) !== null,
3971
+ position: B($)?.position ?? "header",
3972
+ view: it.value,
3973
+ "target-rect": B($)?.targetRect ?? null,
3974
+ onSave: B(Yn),
3929
3975
  onClose: n[9] ||= (e) => $.value = null,
3930
- onRemove: V(Gn)
3976
+ onRemove: B(Xn)
3931
3977
  }, null, 8, [
3932
3978
  "is-open",
3933
3979
  "position",
@@ -3936,108 +3982,108 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3936
3982
  "onSave",
3937
3983
  "onRemove"
3938
3984
  ]),
3939
- (L(!0), A(w, null, z(V($) ? $e.value : [], (e, t) => (L(), A("div", {
3985
+ (L(!0), k(w, null, ue(B($) ? tt.value : [], (e, t) => (L(), k("div", {
3940
3986
  key: `hf-sel-${t}-${e.top}-${e.left}`,
3941
3987
  class: "vue-hf-sel-rect",
3942
3988
  "aria-hidden": "true",
3943
- style: P({
3989
+ style: F({
3944
3990
  position: "fixed",
3945
3991
  top: `${e.top}px`,
3946
3992
  left: `${e.left}px`,
3947
3993
  width: `${e.width}px`,
3948
3994
  height: `${e.height}px`,
3949
- background: "rgba(66, 133, 244, 0.25)",
3995
+ background: "var(--doc-selection)",
3950
3996
  pointerEvents: "none",
3951
3997
  zIndex: 9998
3952
3998
  })
3953
3999
  }, null, 4))), 128)),
3954
- V($) && Qe.value ? (L(), A("div", {
4000
+ B($) && et.value ? (L(), k("div", {
3955
4001
  key: 2,
3956
4002
  "aria-hidden": "true",
3957
- style: P({
4003
+ style: F({
3958
4004
  position: "fixed",
3959
- top: `${Qe.value.top}px`,
3960
- left: `${Qe.value.left}px`,
4005
+ top: `${et.value.top}px`,
4006
+ left: `${et.value.left}px`,
3961
4007
  width: "2px",
3962
- height: `${Qe.value.height}px`,
4008
+ height: `${et.value.height}px`,
3963
4009
  background: "#4285f4",
3964
4010
  pointerEvents: "none",
3965
4011
  zIndex: 9999,
3966
4012
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3967
4013
  })
3968
- }, null, 4)) : k("", !0),
3969
- M(ln, {
3970
- "image-info": V(Tn),
3971
- zoom: V(X),
3972
- view: V(Z),
3973
- onOpenProperties: n[10] ||= (e) => N.value = !0,
3974
- onDeselect: n[11] ||= (e) => Tn.value = null,
3975
- onInteractStart: n[12] ||= (e) => En.value = !0,
3976
- onInteractEnd: n[13] ||= (e) => En.value = !1,
3977
- onContextMenu: V(Xn)
4014
+ }, null, 4)) : O("", !0),
4015
+ M(_n, {
4016
+ "image-info": B(kn),
4017
+ zoom: B(X),
4018
+ view: B(Z),
4019
+ onOpenProperties: n[10] ||= (e) => P.value = !0,
4020
+ onDeselect: n[11] ||= (e) => kn.value = null,
4021
+ onInteractStart: n[12] ||= (e) => An.value = !0,
4022
+ onInteractEnd: n[13] ||= (e) => An.value = !1,
4023
+ onContextMenu: B(tr)
3978
4024
  }, null, 8, [
3979
4025
  "image-info",
3980
4026
  "zoom",
3981
4027
  "view",
3982
4028
  "onContextMenu"
3983
4029
  ]),
3984
- M(Qt, {
3985
- "get-view": tr,
3986
- "get-pages-container": nr,
3987
- zoom: V(X),
3988
- "transaction-version": x.value,
3989
- "sync-coordinator": V(T)
4030
+ M(sn, {
4031
+ "get-view": or,
4032
+ "get-pages-container": sr,
4033
+ zoom: B(X),
4034
+ "transaction-version": S.value,
4035
+ "sync-coordinator": B(re)
3990
4036
  }, null, 8, [
3991
4037
  "zoom",
3992
4038
  "transaction-version",
3993
4039
  "sync-coordinator"
3994
4040
  ]),
3995
- V(dt) && !G.value && !c.value ? (L(), A("button", {
4041
+ B(pt) && !G.value && !u.value ? (L(), k("button", {
3996
4042
  key: 3,
3997
4043
  type: "button",
3998
4044
  class: "docx-editor-vue__floating-comment",
3999
- style: P({
4000
- top: V(dt).top + "px",
4001
- left: V(dt).left + "px"
4045
+ style: F({
4046
+ top: B(pt).top + "px",
4047
+ left: B(pt).left + "px"
4002
4048
  }),
4003
- title: V(d)("comments.addComment"),
4004
- onMousedown: n[14] ||= q((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
4049
+ title: B(h)("comments.addComment"),
4050
+ onMousedown: n[14] ||= q((...e) => B(bt) && B(bt)(...e), ["prevent", "stop"])
4005
4051
  }, [M(r, {
4006
4052
  name: "add_comment",
4007
4053
  size: 16
4008
- })], 44, ji)) : k("", !0),
4009
- V(Nn) && !c.value ? (L(), A("button", {
4054
+ })], 44, Bi)) : O("", !0),
4055
+ B(Rn) && !u.value ? (L(), k("button", {
4010
4056
  key: 4,
4011
4057
  type: "button",
4012
4058
  class: "docx-editor-vue__table-insert-btn",
4013
- style: P({
4014
- left: V(Nn).x + "px",
4015
- top: V(Nn).y + "px"
4059
+ style: F({
4060
+ left: B(Rn).x + "px",
4061
+ top: B(Rn).y + "px"
4016
4062
  }),
4017
- title: V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
4018
- "aria-label": V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
4019
- onMousedown: n[15] ||= (...e) => V(Hn) && V(Hn)(...e),
4020
- onMouseenter: n[16] ||= (...e) => V(Un) && V(Un)(...e),
4021
- onMouseleave: n[17] ||= (e) => Nn.value = null
4022
- }, [...n[37] ||= [j("svg", {
4063
+ title: B(Rn).type === "row" ? "Insert row below" : "Insert column to the right",
4064
+ "aria-label": B(Rn).type === "row" ? "Insert row below" : "Insert column to the right",
4065
+ onMousedown: n[15] ||= (...e) => B(qn) && B(qn)(...e),
4066
+ onMouseenter: n[16] ||= (...e) => B(Jn) && B(Jn)(...e),
4067
+ onMouseleave: n[17] ||= (e) => Rn.value = null
4068
+ }, [...n[37] ||= [A("svg", {
4023
4069
  width: "12",
4024
4070
  height: "12",
4025
4071
  viewBox: "0 0 12 12",
4026
4072
  fill: "none"
4027
- }, [j("path", {
4073
+ }, [A("path", {
4028
4074
  d: "M6 1v10M1 6h10",
4029
4075
  stroke: "currentColor",
4030
4076
  "stroke-width": "1.5",
4031
4077
  "stroke-linecap": "round"
4032
- })], -1)]], 44, Mi)) : k("", !0),
4078
+ })], -1)]], 44, Vi)) : O("", !0),
4033
4079
  M(_, {
4034
4080
  comments: J.value,
4035
- "pages-container": v.value,
4036
- zoom: V(X),
4037
- "page-width-px": ot.value,
4038
- "sidebar-open": U.value,
4039
- "resolved-comment-ids": st.value,
4040
- onMarkerClick: V(yt)
4081
+ "pages-container": b.value,
4082
+ zoom: B(X),
4083
+ "page-width-px": ct.value,
4084
+ "sidebar-open": W.value,
4085
+ "resolved-comment-ids": lt.value,
4086
+ onMarkerClick: B(xt)
4041
4087
  }, null, 8, [
4042
4088
  "comments",
4043
4089
  "pages-container",
@@ -4048,28 +4094,28 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
4048
4094
  "onMarkerClick"
4049
4095
  ]),
4050
4096
  M(p, {
4051
- "is-open": U.value,
4097
+ "is-open": W.value,
4052
4098
  comments: J.value,
4053
- "tracked-changes": Y.value,
4099
+ "tracked-changes": ge.value,
4054
4100
  "is-adding-comment": G.value,
4055
- "add-comment-y-position": V(pt),
4101
+ "add-comment-y-position": B(ht),
4056
4102
  "show-resolved": !0,
4057
- "pages-container": v.value,
4058
- "page-width-px": ot.value,
4059
- zoom: V(X),
4103
+ "pages-container": b.value,
4104
+ "page-width-px": ct.value,
4105
+ zoom: B(X),
4060
4106
  "active-item-id": K.value,
4061
- onClose: n[18] ||= (e) => U.value = !1,
4062
- onAddComment: V(gt),
4063
- onCancelAddComment: V(_t),
4064
- onCommentReply: V(fn),
4065
- onCommentResolve: V(pn),
4066
- onCommentUnresolve: V(gn),
4067
- onCommentDelete: V(_n),
4068
- onAcceptChange: V(yn),
4069
- onRejectChange: V(bn),
4070
- onAcceptChangeById: V(xn),
4071
- onRejectChangeById: V(Sn),
4072
- onTrackedChangeReply: V(Cn),
4107
+ onClose: n[18] ||= (e) => W.value = !1,
4108
+ onAddComment: B(vt),
4109
+ onCancelAddComment: B(yt),
4110
+ onCommentReply: B(gn),
4111
+ onCommentResolve: B(vn),
4112
+ onCommentUnresolve: B(yn),
4113
+ onCommentDelete: B(bn),
4114
+ onAcceptChange: B(xn),
4115
+ onRejectChange: B(wn),
4116
+ onAcceptChangeById: B(Tn),
4117
+ onRejectChangeById: B(Dn),
4118
+ onTrackedChangeReply: B(On),
4073
4119
  "onUpdate:activeItemId": n[19] ||= (e) => K.value = e
4074
4120
  }, null, 8, [
4075
4121
  "is-open",
@@ -4093,14 +4139,14 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
4093
4139
  "onRejectChangeById",
4094
4140
  "onTrackedChangeReply"
4095
4141
  ]),
4096
- M($r, {
4097
- data: V(kt),
4098
- "read-only": c.value,
4099
- onNavigate: V(Mt),
4100
- onCopy: n[20] ||= (e) => kt.value = null,
4101
- onEdit: V(Nt),
4102
- onRemove: V(Ft),
4103
- onClose: n[21] ||= (e) => kt.value = null
4142
+ M(si, {
4143
+ data: B(jt),
4144
+ "read-only": u.value,
4145
+ onNavigate: B(Pt),
4146
+ onCopy: n[20] ||= (e) => jt.value = null,
4147
+ onEdit: B(Ft),
4148
+ onRemove: B(It),
4149
+ onClose: n[21] ||= (e) => jt.value = null
4104
4150
  }, null, 8, [
4105
4151
  "data",
4106
4152
  "read-only",
@@ -4109,65 +4155,65 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
4109
4155
  "onRemove"
4110
4156
  ])
4111
4157
  ], 544),
4112
- !H.value && e.showOutlineButton ? (L(), A("button", {
4158
+ !me.value && e.showOutlineButton ? (L(), k("button", {
4113
4159
  key: 0,
4114
4160
  type: "button",
4115
4161
  class: "docx-editor-vue__outline-toggle",
4116
4162
  title: "Show document outline",
4117
- onClick: n[28] ||= (...e) => V(nn) && V(nn)(...e),
4163
+ onClick: n[28] ||= (...e) => B(cn) && B(cn)(...e),
4118
4164
  onMousedown: n[29] ||= q(() => {}, ["stop"])
4119
4165
  }, [M(r, {
4120
4166
  name: "format_list_bulleted",
4121
4167
  size: 20
4122
- })], 32)) : k("", !0),
4123
- V(Pn).totalPages > 1 ? (L(), O(hn, {
4168
+ })], 32)) : O("", !0),
4169
+ B(zn).totalPages > 1 ? (L(), D(Cn, {
4124
4170
  key: 1,
4125
- "current-page": V(Pn).currentPage,
4126
- "total-pages": V(Pn).totalPages,
4127
- visible: V(Pn).visible
4171
+ "current-page": B(zn).currentPage,
4172
+ "total-pages": B(zn).totalPages,
4173
+ visible: B(zn).visible
4128
4174
  }, null, 8, [
4129
4175
  "current-page",
4130
4176
  "total-pages",
4131
4177
  "visible"
4132
- ])) : k("", !0),
4133
- M(mn, {
4134
- "is-open": H.value,
4135
- headings: ge.value,
4136
- onClose: n[30] ||= (e) => H.value = !1,
4137
- onNavigate: V(rn)
4178
+ ])) : O("", !0),
4179
+ M(Sn, {
4180
+ "is-open": me.value,
4181
+ headings: _e.value,
4182
+ onClose: n[30] ||= (e) => me.value = !1,
4183
+ onNavigate: B(ln)
4138
4184
  }, null, 8, [
4139
4185
  "is-open",
4140
4186
  "headings",
4141
4187
  "onNavigate"
4142
4188
  ])
4143
4189
  ])], 32),
4144
- j("input", {
4190
+ A("input", {
4145
4191
  ref_key: "docxInputRef",
4146
- ref: bt,
4192
+ ref: St,
4147
4193
  type: "file",
4148
4194
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4149
4195
  style: { display: "none" },
4150
- onChange: n[32] ||= (...e) => V(Ct) && V(Ct)(...e)
4196
+ onChange: n[32] ||= (...e) => B(Tt) && B(Tt)(...e)
4151
4197
  }, null, 544),
4152
- j("input", {
4198
+ A("input", {
4153
4199
  ref_key: "imageInputRef",
4154
- ref: xt,
4200
+ ref: Ct,
4155
4201
  type: "file",
4156
4202
  accept: "image/*",
4157
4203
  style: { display: "none" },
4158
- onChange: n[33] ||= (...e) => V(St) && V(St)(...e)
4204
+ onChange: n[33] ||= (...e) => B(wt) && B(wt)(...e)
4159
4205
  }, null, 544),
4160
- M(Ur, {
4161
- "read-only": c.value,
4162
- "context-menu": V(Kn),
4163
- "image-context-menu": V(qn),
4164
- "image-context-menu-text-actions": V(Jn),
4165
- "can-open-image-properties": !!V(Tn),
4166
- onContextMenuAction: V(Qn),
4167
- onCloseContextMenu: n[34] ||= (e) => V(Kn).isOpen = !1,
4168
- onImageWrapSelect: V(Zn),
4169
- onCloseImageContextMenu: n[35] ||= (e) => qn.value = null,
4170
- onOpenImageProperties: n[36] ||= (e) => N.value = !0
4206
+ M(Zr, {
4207
+ "read-only": u.value,
4208
+ "context-menu": B(Zn),
4209
+ "image-context-menu": B(Qn),
4210
+ "image-context-menu-text-actions": B($n),
4211
+ "can-open-image-properties": !!B(kn),
4212
+ onContextMenuAction: B(rr),
4213
+ onCloseContextMenu: n[34] ||= (e) => B(Zn).isOpen = !1,
4214
+ onImageWrapSelect: B(nr),
4215
+ onCloseImageContextMenu: n[35] ||= (e) => Qn.value = null,
4216
+ onOpenImageProperties: n[36] ||= (e) => P.value = !0
4171
4217
  }, null, 8, [
4172
4218
  "read-only",
4173
4219
  "context-menu",
@@ -4182,8 +4228,8 @@ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
4182
4228
  });
4183
4229
  //#endregion
4184
4230
  //#region src/renderAsync.ts
4185
- async function Pi(e, t, n = {}) {
4186
- let r = e instanceof ArrayBuffer ? e : await Ve(e), i = null, a = null, o = !1, s = {
4231
+ async function Ui(e, t, n = {}) {
4232
+ let r = e instanceof ArrayBuffer ? e : await Ge(e), i = null, a = null, o = !1, s = {
4187
4233
  save: async () => {
4188
4234
  let e = await (i?.save() ?? Promise.resolve(null));
4189
4235
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4204,8 +4250,8 @@ async function Pi(e, t, n = {}) {
4204
4250
  }
4205
4251
  };
4206
4252
  return new Promise((e, c) => {
4207
- a = D({ setup() {
4208
- return () => oe(Ni, {
4253
+ a = re({ setup() {
4254
+ return () => P(Hi, {
4209
4255
  ...n,
4210
4256
  documentBuffer: r,
4211
4257
  showToolbar: n.showToolbar ?? !0,
@@ -4229,6 +4275,6 @@ async function Pi(e, t, n = {}) {
4229
4275
  }
4230
4276
  //#endregion
4231
4277
  //#region src/index.ts
4232
- var Fi = "0.0.2";
4278
+ var Wi = "0.0.2";
4233
4279
  //#endregion
4234
- export { Ni as DocxEditor, Fi as VERSION, Wt as createDocumentWithText, Gt as createEmptyDocument, n as defaultLocale, t as i18nPlugin, a as provideLocale, Pi as renderAsync, d as useTranslation };
4280
+ export { Hi as DocxEditor, Wi as VERSION, Qt as createDocumentWithText, $t as createEmptyDocument, n as defaultLocale, t as i18nPlugin, a as provideLocale, Ui as renderAsync, d as useTranslation };