@eigenpal/docx-editor-vue 1.3.0 → 1.3.2

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 (31) hide show
  1. package/dist/{KeyboardShortcutsDialog-00eb4Ova.js → KeyboardShortcutsDialog-BbuDgglK.js} +14 -4
  2. package/dist/KeyboardShortcutsDialog-Bct8AJ0i.cjs +1 -0
  3. package/dist/{MenuBar-DeogoqFP.js → MenuBar-CbONA9-a.js} +571 -522
  4. package/dist/MenuBar-m0JEaF1X.cjs +4 -0
  5. package/dist/{TablePropertiesDialog-CBTvM4Xy.js → TablePropertiesDialog-D5MIF3cj.js} +1 -1
  6. package/dist/{TablePropertiesDialog-BZLpFAkg.cjs → TablePropertiesDialog-JWT68zEO.cjs} +1 -1
  7. package/dist/components/DocxEditor/types.d.ts +23 -1
  8. package/dist/components/Toolbar/presets.d.ts +12 -33
  9. package/dist/composables/useCommentLifecycle.d.ts +9 -1
  10. package/dist/composables/useCommentManagement.d.ts +24 -1
  11. package/dist/composables/useFormattingActions.d.ts +2 -22
  12. package/dist/composables/useHostCallbacks.d.ts +7 -0
  13. package/dist/composables.cjs +1 -1
  14. package/dist/composables.js +85 -129
  15. package/dist/dialogs.cjs +1 -1
  16. package/dist/dialogs.js +2 -2
  17. package/dist/docx-editor-vue.css +1 -1
  18. package/dist/index.cjs +9 -10
  19. package/dist/index.js +1117 -1281
  20. package/dist/ui.cjs +1 -1
  21. package/dist/ui.js +141 -141
  22. package/dist/useDragAutoScroll-DNMi0p5G.cjs +1 -0
  23. package/dist/useDragAutoScroll-DbxuTWI1.js +493 -0
  24. package/dist/utils/refApiQueries.d.ts +8 -44
  25. package/package.json +4 -4
  26. package/dist/KeyboardShortcutsDialog-EW9K4wuO.cjs +0 -1
  27. package/dist/MenuBar-bU4-4dnA.cjs +0 -4
  28. package/dist/useTableResize-DBpEiuGQ.cjs +0 -1
  29. package/dist/useTableResize-uq2ksRDf.js +0 -587
  30. package/dist/utils/commentFactories.d.ts +0 -7
  31. package/dist/utils/paraTextHelpers.d.ts +0 -29
package/dist/index.js CHANGED
@@ -1,143 +1,42 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-00eb4Ova.js";
2
- import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-DeogoqFP.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, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-BbuDgglK.js";
2
+ import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-CbONA9-a.js";
3
3
  import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
4
  import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
5
  import { t as C } from "./zIndex-CxELVe_L.js";
6
- import { n as ee, r as te, t as ne } from "./useTableResize-uq2ksRDf.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 oe, isRef as se, nextTick as ce, normalizeClass as P, normalizeStyle as F, onBeforeUnmount as I, onMounted as L, openBlock as R, ref as z, renderList as le, 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 { clickToPositionDom as Y, computeHfCaretRectFromView as ge, computeHfSelectionRectsFromView as _e, findBodyPmAnchor as ve, findBodyPmSpans as X } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { SIDEBAR_DOCUMENT_SHIFT as ye, findWordBoundaries as be, loadFontDefinitions as xe, onFontError as Se, pixelsToEmu as Ce, readDocxFileFromInput as we, toArrayBuffer as Te } from "@eigenpal/docx-editor-core/utils";
11
- import { extractSelectionContext as Ee } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
12
- import { clearFormatting as De, findHyperlinkRangeAt as Oe } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
13
- import { getTableContext as ke } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
14
- import { clickToPositionDom as Ae, getCaretPositionFromDom as Z, getSelectionRectsFromDom as je } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
15
- import { IMAGE_LAYOUT_OPTIONS as Me, captureInlinePositionEmu as Ne, deriveLayoutChoice as Pe, findImageElement as Fe, isImageLayoutOptionEnabled as Ie, renderAllPagesNow as Le, toolbarValueToLayoutTarget as Re } from "@eigenpal/docx-editor-core/layout-painter";
16
- import { proseDocToBlocks as Q } from "@eigenpal/docx-editor-core/prosemirror/conversion";
17
- import { LayoutSelectionGate as ze, addRepeatingSectionItemTr as Be, findContentControlPos as Ve, findContentControlsInPM as He, removeContentControlTr as Ue, removeRepeatingSectionItemTr as We, schema as Ge, setContentControlContentTr as Ke, setContentControlValueTr as qe } from "@eigenpal/docx-editor-core/prosemirror";
18
- import { pointsToHalfPoints as Je, twipsToPixels as Ye } from "@eigenpal/docx-editor-core/utils/units";
19
- import { pictureWatermarkDisplayEmu as Xe } from "@eigenpal/docx-editor-core/types/document";
20
- import { makeRevisionInfo as Ze } from "@eigenpal/docx-editor-core/prosemirror/plugins";
21
- import { findPageIndexContainingPmPos as Qe } from "@eigenpal/docx-editor-core/layout-engine";
22
- import { applyStyle as $e, removeTabStop as et, setIndentFirstLine as tt, setIndentLeft as nt, setIndentRight as rt } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
23
- import { createStyleResolver as it } from "@eigenpal/docx-editor-core/prosemirror/styles";
24
- import { insertPageBreak as at } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
25
- import { mapHexToHighlightName as ot } from "@eigenpal/docx-editor-core/utils/highlightColors";
26
- import { acceptChange as st, acceptChangeById as ct, getWatermarkFromState as lt, insertImageNode as ut, rejectChange as dt, rejectChangeById as ft, setWatermark as pt } from "@eigenpal/docx-editor-core/prosemirror/commands";
27
- import { collectHeadings as mt } from "@eigenpal/docx-editor-core/utils/headingCollector";
28
- import { extractTrackedChanges as ht } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
29
- import { TABLE_INSERT_HIDE_DELAY_MS as gt, detectTableInsertHover as _t } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
30
- import { openReportIssue as vt } from "@eigenpal/docx-editor-core/utils/reportIssue";
31
- import { ContentControlNotFoundError as yt } from "@eigenpal/docx-editor-core/agent";
32
- import { createDocumentWithText as bt, createEmptyDocument as xt } from "@eigenpal/docx-editor-core";
33
- //#region src/utils/paraTextHelpers.ts
34
- function St(e, t) {
35
- if (!t.trim()) return null;
36
- let n = null;
37
- return e.descendants((e, r) => n ? !1 : e.isTextblock && e.attrs?.paraId === t ? (n = {
38
- from: r,
39
- to: r + e.nodeSize
40
- }, !1) : !0), n;
41
- }
42
- function Ct(e) {
43
- let t = [];
44
- return e.descendants((e) => !e.isText || !e.text ? !0 : e.marks.some((e) => e.type.name === "insertion") ? !1 : (t.push(e.text), !0)), t.join("");
45
- }
46
- function wt(e, t, n) {
47
- if (t >= n) return "";
48
- let r = [];
49
- return e.nodesBetween(t, n, (e, i) => {
50
- if (!e.isText || !e.text || e.marks.some((e) => e.type.name === "insertion")) return;
51
- let a = Math.max(t, i), o = Math.min(n, i + e.text.length);
52
- a < o && r.push(e.text.slice(a - i, o - i));
53
- }), r.join("");
54
- }
55
- function Tt(e, t, n, r) {
56
- if (!r) return null;
57
- let i = "", a = [];
58
- e.nodesBetween(t, n, (e, t) => {
59
- !e.isText || !e.text || e.marks.some((e) => e.type.name === "insertion") || (a.push({
60
- pos: t,
61
- len: e.text.length
62
- }), i += e.text);
63
- });
64
- let o = i.indexOf(r);
65
- if (o === -1 || i.indexOf(r, o + 1) !== -1) return null;
66
- let s = 0, c = t, l = t;
67
- for (let e of a) {
68
- let t = s + e.len;
69
- if (s <= o && o < t && (c = e.pos + (o - s)), s <= o + r.length && o + r.length <= t) {
70
- l = e.pos + (o + r.length - s);
71
- break;
72
- }
73
- s = t;
74
- }
75
- return {
76
- from: c,
77
- to: l
78
- };
79
- }
80
- //#endregion
81
- //#region src/utils/refApiQueries.ts
82
- function Et(e, t, n) {
83
- if (!e || !t) return [];
84
- let r = n?.caseSensitive ?? !1, i = n?.limit ?? 20, a = r ? t : t.toLowerCase(), o = [];
85
- return e.state.doc.descendants((e) => {
86
- if (o.length >= i) return !1;
87
- if (!e.isTextblock) return !0;
88
- let n = e.attrs?.paraId;
89
- if (!n) return !1;
90
- let s = Ct(e), c = r ? s : s.toLowerCase(), l = c.indexOf(a);
91
- return l === -1 || c.indexOf(a, l + 1) !== -1 || o.push({
92
- paraId: n,
93
- match: s.slice(l, l + t.length),
94
- before: s.slice(Math.max(0, l - 40), l),
95
- after: s.slice(l + t.length, l + t.length + 40)
96
- }), !1;
97
- }), o;
98
- }
99
- function Dt(e) {
100
- if (!e) return null;
101
- let { selection: t, doc: n } = e.state, r = t.$from, i = r.depth;
102
- for (; i > 0 && !r.node(i).isTextblock;) i--;
103
- let a = i > 0 ? r.node(i) : null;
104
- if (!a) return null;
105
- let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l = wt(n, s, t.from), u = wt(n, t.from, t.to), d = wt(n, t.to, c);
106
- return {
107
- paraId: o,
108
- selectedText: u,
109
- paragraphText: l + u + d,
110
- before: l,
111
- after: d
112
- };
113
- }
114
- function Ot(e, t, n) {
115
- if (!t || !e) return null;
116
- let r = t.pages[n - 1];
117
- if (!r) return null;
118
- let i = /* @__PURE__ */ new Set(), a = [];
119
- for (let t of r.fragments) {
120
- if (t.kind !== "paragraph") continue;
121
- let n = t.pmStart;
122
- if (n == null) continue;
123
- let r = e.state.doc.nodeAt(n);
124
- if (!r || !r.isTextblock) continue;
125
- let o = r.attrs?.paraId;
126
- !o || i.has(o) || (i.add(o), a.push({
127
- paraId: o,
128
- text: Ct(r),
129
- styleId: r.attrs?.styleId ?? void 0
130
- }));
131
- }
132
- return {
133
- pageNumber: n,
134
- text: a.map((e) => `[${e.paraId}] ${e.text}`).join("\n"),
135
- paragraphs: a
136
- };
137
- }
138
- //#endregion
6
+ import { i as ee, n as te, r as ne, t as w } from "./useDragAutoScroll-DbxuTWI1.js";
7
+ import { Fragment as T, Teleport as E, computed as D, createApp as re, createBlock as ie, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ae, createStaticVNode as oe, createTextVNode as se, createVNode as j, defineComponent as M, h as ce, isRef as le, nextTick as ue, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as de, renderSlot as fe, resolveDynamicComponent as pe, shallowRef as z, toDisplayString as B, unref as V, vModelCheckbox as me, vModelSelect as he, vModelText as H, watch as U, withCtx as ge, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
8
+ import { NodeSelection as q, TextSelection as J } from "prosemirror-state";
9
+ import { applyCellSelectionHighlight as _e, clickToPositionDom as ve, computeHfCaretRectFromView as ye, computeHfSelectionRectsFromView as be, findBodyPmAnchor as Y, findBodyPmSpans as xe } from "@eigenpal/docx-editor-core/layout-bridge";
10
+ import { findInDocument as Se, getPageContent as Ce, getSelectionInfo as we } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
+ import { LayoutSelectionGate as Te, addRepeatingSectionItemTr as Ee, extractSelectionState as De, findContentControlPos as Oe, findContentControlsInPM as ke, removeContentControlTr as Ae, removeRepeatingSectionItemTr as je, schema as Me, setContentControlContentTr as Ne, setContentControlValueTr as X } from "@eigenpal/docx-editor-core/prosemirror";
12
+ import { SIDEBAR_DOCUMENT_SHIFT as Pe, findWordBoundaries as Fe, loadFontDefinitions as Ie, onFontError as Le, pixelsToEmu as Re, readDocxFileFromInput as ze, toArrayBuffer as Be } from "@eigenpal/docx-editor-core/utils";
13
+ import { extractSelectionContext as Ve } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
+ import { clearFormatting as He, findHyperlinkRangeAt as Ue } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
+ import { getTableContext as Z } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
+ import { clickToPositionDom as We, getCaretPositionFromDom as Ge, getSelectionRectsFromDom as Ke } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
+ import { commitImageFloatMove as qe, commitImageInlineMove as Je, commitImageResize as Ye, isFloatingImage as Xe } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
+ import { IMAGE_LAYOUT_OPTIONS as Ze, captureInlinePositionEmu as Qe, deriveLayoutChoice as $e, findImageElement as Q, isImageLayoutOptionEnabled as et, renderAllPagesNow as tt, toolbarValueToLayoutTarget as nt } from "@eigenpal/docx-editor-core/layout-painter";
19
+ import { proseDocToBlocks as rt } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
+ import { twipsToPixels as it } from "@eigenpal/docx-editor-core/utils/units";
21
+ import { pictureWatermarkDisplayEmu as at } from "@eigenpal/docx-editor-core/types/document";
22
+ import { makeRevisionInfo as ot } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
+ import { findPageIndexContainingPmPos as st } from "@eigenpal/docx-editor-core/layout-engine";
24
+ import { applyStyle as ct, removeTabStop as lt, setIndentFirstLine as ut, setIndentLeft as dt, setIndentRight as ft } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
25
+ import { createStyleResolver as pt } from "@eigenpal/docx-editor-core/prosemirror/styles";
26
+ import { insertPageBreak as mt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
27
+ import { applyFormatting as ht, setParagraphStyle as gt } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
28
+ import { acceptChange as _t, acceptChangeById as vt, getWatermarkFromState as yt, insertImageNode as bt, rejectChange as xt, rejectChangeById as St, setWatermark as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands";
29
+ import { collectHeadings as wt } from "@eigenpal/docx-editor-core/utils/headingCollector";
30
+ import { addCommentToRange as Tt, applyProposedChange as Et, createComment as Dt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
31
+ import { PENDING_COMMENT_ID as Ot, createCommentIdAllocator as kt, seedCommentAllocator as At } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
32
+ import { extractTrackedChanges as jt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
33
+ import { TABLE_INSERT_HIDE_DELAY_MS as Mt, detectTableInsertHover as Nt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
34
+ import { openReportIssue as Pt } from "@eigenpal/docx-editor-core/utils/reportIssue";
35
+ import { ContentControlNotFoundError as Ft } from "@eigenpal/docx-editor-core/agent";
36
+ import { findParaIdRange as It } from "@eigenpal/docx-editor-core/prosemirror/paraText";
37
+ import { createDocumentWithText as Lt, createEmptyDocument as Rt } from "@eigenpal/docx-editor-core";
139
38
  //#region src/utils/domQueries.ts
140
- function kt(e) {
39
+ function zt(e) {
141
40
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
142
41
  if (t.length === 0) return null;
143
42
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -147,18 +46,18 @@ function kt(e) {
147
46
  }
148
47
  return r;
149
48
  }
150
- function At(e, t, n) {
151
- let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : X(e);
49
+ function Bt(e, t, n) {
50
+ let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : xe(e);
152
51
  for (let e of r) {
153
52
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
154
53
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
155
54
  }
156
55
  return null;
157
56
  }
158
- function jt(e, t, n) {
57
+ function Vt(e, t, n) {
159
58
  if (!e || !t) return;
160
59
  let r = null;
161
- for (let t of X(e)) {
60
+ for (let t of xe(e)) {
162
61
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
163
62
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
164
63
  r = t;
@@ -172,21 +71,21 @@ function jt(e, t, n) {
172
71
  behavior: "smooth"
173
72
  });
174
73
  }
175
- function Mt(e, t, n, r) {
74
+ function Ht(e, t, n, r) {
176
75
  if (!e || !t) return null;
177
- let i = Y(e, n, r, 1);
76
+ let i = ve(e, n, r, 1);
178
77
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
179
78
  }
180
- function Nt(e, t, n, r) {
79
+ function Ut(e, t, n, r) {
181
80
  if (!e) return;
182
- let i = At(e, t, r);
81
+ let i = Bt(e, t, r);
183
82
  if (!i) return;
184
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = be(a, t - o), l = o + s, u = o + c;
83
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Fe(a, t - o), l = o + s, u = o + c;
185
84
  l < u && n(l, u);
186
85
  }
187
- function Pt(e, t, n, r) {
86
+ function Wt(e, t, n, r) {
188
87
  if (!e) return;
189
- let i = At(e, t, r);
88
+ let i = Bt(e, t, r);
190
89
  if (!i) return;
191
90
  let a = i.closest(".layout-paragraph");
192
91
  if (!a) return;
@@ -195,7 +94,7 @@ function Pt(e, t, n, r) {
195
94
  }
196
95
  //#endregion
197
96
  //#region src/components/DecorationLayer.vue
198
- var Ft = /* @__PURE__ */ N({
97
+ var Gt = /* @__PURE__ */ M({
199
98
  __name: "DecorationLayer",
200
99
  props: {
201
100
  getView: { type: Function },
@@ -205,7 +104,7 @@ var Ft = /* @__PURE__ */ N({
205
104
  syncCoordinator: {}
206
105
  },
207
106
  setup(e) {
208
- let t = e, n = z(null), r = z(0), i = null, a = null;
107
+ let t = e, n = R(null), r = R(0), i = null, a = null;
209
108
  function o() {
210
109
  i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
211
110
  i = null;
@@ -213,13 +112,13 @@ var Ft = /* @__PURE__ */ N({
213
112
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
214
113
  });
215
114
  }
216
- L(() => {
115
+ I(() => {
217
116
  a = t.syncCoordinator.onRender(() => {
218
117
  r.value++;
219
118
  }), o();
220
- }), I(() => {
119
+ }), F(() => {
221
120
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
222
- }), W(() => [
121
+ }), U(() => [
223
122
  t.zoom,
224
123
  t.transactionVersion,
225
124
  r.value
@@ -280,20 +179,20 @@ var Ft = /* @__PURE__ */ N({
280
179
  function u(e) {
281
180
  return e.type?.attrs ?? null;
282
181
  }
283
- return (e, t) => (R(), k("div", {
182
+ return (e, t) => (L(), k("div", {
284
183
  ref_key: "overlayRef",
285
184
  ref: n,
286
185
  class: "paged-editor__decoration-overlay",
287
186
  "aria-hidden": "true"
288
187
  }, null, 512));
289
188
  }
290
- }), It = ["data-handle", "onMousedown"], Lt = ["title"], Rt = {
189
+ }), Kt = ["data-handle", "onMousedown"], qt = ["title"], Jt = {
291
190
  key: 0,
292
191
  class: "image-overlay__dim"
293
- }, zt = {
192
+ }, Yt = {
294
193
  key: 1,
295
194
  class: "image-overlay__dim image-overlay__dim--rotate"
296
- }, Bt = 4, Vt = 15, Ht = /* @__PURE__ */ x(/* @__PURE__ */ N({
195
+ }, Xt = 4, Zt = 15, Qt = /* @__PURE__ */ x(/* @__PURE__ */ M({
297
196
  __name: "ImageSelectionOverlay",
298
197
  props: {
299
198
  imageInfo: {},
@@ -307,7 +206,7 @@ var Ft = /* @__PURE__ */ N({
307
206
  "context-menu"
308
207
  ],
309
208
  setup(e, { emit: t }) {
310
- let { t: r } = n(), i = e, a = t, o = z(null), s = z(!1), c = z(!1), l = z(!1), u = z(0), d = z(0), f = z(0), p = z(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
209
+ let { t: r } = n(), i = e, a = t, o = R(null), s = R(!1), c = R(!1), l = R(!1), u = R(0), d = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
311
210
  function ee(e, t) {
312
211
  if (!e) return null;
313
212
  try {
@@ -326,10 +225,10 @@ var Ft = /* @__PURE__ */ N({
326
225
  if (e.element.isConnected) return e.element;
327
226
  let t = te();
328
227
  if (!t) return null;
329
- let n = ve(t, e.pmPos);
330
- return n ? Fe(n) : null;
228
+ let n = Y(t, e.pmPos);
229
+ return n ? Q(n) : null;
331
230
  }
332
- function T() {
231
+ function w() {
333
232
  let e = ne();
334
233
  if (!e || !o.value) {
335
234
  p.value = null;
@@ -348,26 +247,26 @@ var Ft = /* @__PURE__ */ N({
348
247
  height: r.height / a
349
248
  };
350
249
  }
351
- W(() => i.imageInfo, async () => {
352
- await ce(), T();
353
- }, { immediate: !0 }), W(() => i.zoom, (e, t, n) => {
250
+ U(() => i.imageInfo, async () => {
251
+ await ue(), w();
252
+ }, { immediate: !0 }), U(() => i.zoom, (e, t, n) => {
354
253
  if (!i.imageInfo) return;
355
254
  let r = 0, a = "", o = 0, s = 0, c = (e) => {
356
- T();
255
+ w();
357
256
  let t = p.value, n = t ? `${t.left}|${t.top}|${t.width}|${t.height}` : "";
358
257
  o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
359
258
  };
360
259
  r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
361
- }), W(() => i.imageInfo, (e, t, n) => {
260
+ }), U(() => i.imageInfo, (e, t, n) => {
362
261
  if (!i.imageInfo) return;
363
262
  let r = () => {
364
- b && cancelAnimationFrame(b), b = requestAnimationFrame(T);
263
+ b && cancelAnimationFrame(b), b = requestAnimationFrame(w);
365
264
  }, a = o.value?.closest(".docx-editor-vue__pages-viewport");
366
265
  a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
367
266
  a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
368
267
  });
369
268
  }, { immediate: !0 });
370
- let re = E(() => s.value ? u.value : p.value?.width || 0), D = E(() => s.value ? d.value : p.value?.height || 0), ie = E(() => {
269
+ let E = D(() => s.value ? u.value : p.value?.width || 0), re = D(() => s.value ? d.value : p.value?.height || 0), ie = D(() => {
371
270
  let e = p.value;
372
271
  if (!e) return {
373
272
  position: "absolute",
@@ -388,8 +287,8 @@ var Ft = /* @__PURE__ */ N({
388
287
  zIndex: C.imageOverlay,
389
288
  pointerEvents: "auto"
390
289
  };
391
- }), ae = E(() => {
392
- let e = re.value, t = D.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
290
+ }), ae = D(() => {
291
+ let e = E.value, t = re.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
393
292
  return [
394
293
  {
395
294
  pos: "nw",
@@ -456,10 +355,10 @@ var Ft = /* @__PURE__ */ N({
456
355
  }
457
356
  }
458
357
  ];
459
- }), j = (e) => e.length === 2;
460
- function M(e, t, n, r, i, a) {
358
+ }), oe = (e) => e.length === 2;
359
+ function se(e, t, n, r, i, a) {
461
360
  let o = e.includes("w") ? -1 : +!!e.includes("e"), s = e.includes("n") ? -1 : +!!e.includes("s"), c = r + t * o, l = i + n * s;
462
- if (j(e) && a) {
361
+ if (oe(e) && a) {
463
362
  let e = Math.max(c / r, l / i);
464
363
  c = r * e, l = i * e;
465
364
  }
@@ -468,11 +367,11 @@ var Ft = /* @__PURE__ */ N({
468
367
  height: s === 0 ? i : Math.max(20, Math.min(2e3, l))
469
368
  };
470
369
  }
471
- function N(e, t) {
472
- !i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", oe), document.addEventListener("mouseup", se));
370
+ function j(e, t) {
371
+ !i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", M), document.addEventListener("mouseup", ce));
473
372
  }
474
- function oe(e) {
475
- let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = M(m, n, r, _, v, a);
373
+ function M(e) {
374
+ let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = se(m, n, r, _, v, a);
476
375
  u.value = Math.round(o.width), d.value = Math.round(o.height);
477
376
  let s = y;
478
377
  s && (p.value = {
@@ -482,181 +381,151 @@ var Ft = /* @__PURE__ */ N({
482
381
  height: s.height
483
382
  });
484
383
  }
485
- function se() {
486
- document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), s.value = !1, y = null, a("interact-end");
384
+ function ce() {
385
+ document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), s.value = !1, y = null, a("interact-end");
487
386
  let e = i.view, t = i.imageInfo;
488
387
  if (!e || !t) {
489
- T();
388
+ w();
490
389
  return;
491
390
  }
492
- let n = ee(e, t.pmPos);
493
- if (n) try {
494
- e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
495
- ...n.attrs,
496
- width: u.value,
497
- height: d.value
498
- })), X(t.pmPos);
499
- } catch {}
500
- ce(() => T());
391
+ let n = Ye(e, t.pmPos, u.value, d.value);
392
+ n !== null && ye(n), ue(() => w());
501
393
  }
502
- let P = 0, L = 0, ue = 0, de = 0, fe = null, H = null;
503
- function pe(e) {
394
+ let le = 0, N = 0, I = 0, fe = 0, pe = null, z = null;
395
+ function me(e) {
504
396
  if (!e) return 0;
505
397
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
506
398
  return t ? parseFloat(t[1]) : 0;
507
399
  }
508
- function U(e, t) {
400
+ function he(e, t) {
509
401
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
510
402
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
511
403
  }
512
- function me(e, t) {
513
- return Math.atan2(e - P, -(t - L)) * 180 / Math.PI;
404
+ function H(e, t) {
405
+ return Math.atan2(e - le, -(t - N)) * 180 / Math.PI;
514
406
  }
515
- function G(e) {
407
+ function ge(e) {
516
408
  if (!i.imageInfo) return;
517
409
  let t = i.imageInfo.element.getBoundingClientRect();
518
- P = t.left + t.width / 2, L = t.top + t.height / 2;
410
+ le = t.left + t.width / 2, N = t.top + t.height / 2;
519
411
  let n = ee(i.view, i.imageInfo.pmPos);
520
- fe = n && n.attrs.transform || null, de = pe(fe), H = i.imageInfo.element.querySelector("img"), ue = me(e.clientX, e.clientY), f.value = de, l.value = !0, a("interact-start"), document.addEventListener("mousemove", K), document.addEventListener("mouseup", he);
412
+ pe = n && n.attrs.transform || null, fe = me(pe), z = i.imageInfo.element.querySelector("img"), I = H(e.clientX, e.clientY), f.value = fe, l.value = !0, a("interact-start"), document.addEventListener("mousemove", W), document.addEventListener("mouseup", G);
521
413
  }
522
- function K(e) {
523
- let t = me(e.clientX, e.clientY) - ue, n = de + t;
524
- e.shiftKey || (n = Math.round(n / Vt) * Vt), f.value = (n % 360 + 360) % 360, H && (H.style.transform = U(fe, f.value) || "");
414
+ function W(e) {
415
+ let t = H(e.clientX, e.clientY) - I, n = fe + t;
416
+ e.shiftKey || (n = Math.round(n / Zt) * Zt), f.value = (n % 360 + 360) % 360, z && (z.style.transform = he(pe, f.value) || "");
525
417
  }
526
- function he() {
527
- document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), l.value = !1, a("interact-end");
418
+ function G() {
419
+ document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), l.value = !1, a("interact-end");
528
420
  let e = i.view, t = i.imageInfo;
529
421
  try {
530
422
  let n = e && t ? ee(e, t.pmPos) : null;
531
423
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
532
424
  ...n.attrs,
533
- transform: U(n.attrs.transform, f.value)
534
- })), X(t.pmPos));
425
+ transform: he(n.attrs.transform, f.value)
426
+ })), ye(t.pmPos));
535
427
  } catch {} finally {
536
- H && (H.style.transform = ""), H = null, fe = null;
428
+ z && (z.style.transform = ""), z = null, pe = null;
537
429
  }
538
- ce(() => T());
430
+ ue(() => w());
539
431
  }
540
- let Y = null;
541
- function ge(e) {
432
+ let J = null;
433
+ function _e(e) {
542
434
  if (!i.imageInfo || !p.value) return;
543
435
  let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
544
436
  let s = e.clientX - t, l = e.clientY - n;
545
- if (!(!o && Math.sqrt(s * s + l * l) < Bt)) {
437
+ if (!(!o && Math.sqrt(s * s + l * l) < Xt)) {
546
438
  if (!o) {
547
- o = !0, c.value = !0, a("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);";
439
+ o = !0, c.value = !0, a("interact-start"), J = document.createElement("div"), J.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);";
548
440
  let e = i.zoom;
549
- Y.style.width = `${r.width * e}px`, Y.style.height = `${r.height * e}px`, document.body.appendChild(Y);
441
+ J.style.width = `${r.width * e}px`, J.style.height = `${r.height * e}px`, document.body.appendChild(J);
550
442
  }
551
- if (Y) {
443
+ if (J) {
552
444
  let t = i.zoom;
553
- Y.style.left = `${e.clientX - r.width * t / 2}px`, Y.style.top = `${e.clientY - r.height * t / 2}px`;
445
+ J.style.left = `${e.clientX - r.width * t / 2}px`, J.style.top = `${e.clientY - r.height * t / 2}px`;
554
446
  }
555
447
  }
556
448
  }, l = (e) => {
557
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, Y &&= (Y.remove(), null), c.value = !1, o && (a("interact-end"), _e(e.clientX, e.clientY));
449
+ document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, J &&= (J.remove(), null), c.value = !1, o && (a("interact-end"), ve(e.clientX, e.clientY));
558
450
  };
559
451
  x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
560
452
  }
561
- function _e(e, t) {
453
+ function ve(e, t) {
562
454
  let n = i.view, r = i.imageInfo;
563
455
  if (!n || !r) return;
564
456
  let a = ee(n, r.pmPos);
565
- if (!a) return;
566
- let s = a.attrs.wrapType, c = a.attrs.displayMode === "float" || (s ? [
567
- "square",
568
- "tight",
569
- "through"
570
- ].includes(s) : !1);
571
- try {
572
- if (c) {
573
- let s = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
574
- if (!s || s.length === 0) return;
575
- let c = null;
576
- for (let e of s) {
457
+ if (a) {
458
+ if (Xe(a)) {
459
+ let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
460
+ if (!a || a.length === 0) return;
461
+ let s = null;
462
+ for (let e of a) {
577
463
  let n = e.getBoundingClientRect();
578
464
  if (t >= n.top && t <= n.bottom) {
579
- c = e.querySelector(".layout-page-content");
465
+ s = e.querySelector(".layout-page-content");
580
466
  break;
581
467
  }
582
468
  }
583
- if (c ||= s[s.length - 1].querySelector(".layout-page-content"), !c) return;
584
- let l = c.getBoundingClientRect(), u = i.zoom, d = (e - l.left) / u, f = (t - l.top) / u, p = {
585
- horizontal: {
586
- posOffset: Ce(d),
587
- relativeTo: "margin"
588
- },
589
- vertical: {
590
- posOffset: Ce(f),
591
- relativeTo: "margin"
592
- }
593
- }, m = n.state.tr.setNodeMarkup(r.pmPos, void 0, {
594
- ...a.attrs,
595
- position: p
596
- });
597
- n.dispatch(m), X(r.pmPos);
469
+ if (s ||= a[a.length - 1].querySelector(".layout-page-content"), !s) return;
470
+ let c = s.getBoundingClientRect(), l = i.zoom, u = Re((e - c.left) / l), d = Re((t - c.top) / l), f = qe(n, r.pmPos, u, d);
471
+ f !== null && ye(f);
598
472
  } else {
599
473
  let i = te();
600
474
  if (!i) return;
601
- let o = Ae(i, e, t, 1);
602
- if (o == null || o < 0 || o === r.pmPos || o === r.pmPos + 1) return;
603
- let s = n.state.tr, c = a.nodeSize;
604
- if (o <= r.pmPos) s = s.delete(r.pmPos, r.pmPos + c), s = s.insert(o, a), n.dispatch(s), X(o);
605
- else {
606
- s = s.delete(r.pmPos, r.pmPos + c);
607
- let e = Math.min(o - c, s.doc.content.size);
608
- s = s.insert(e, a), n.dispatch(s), X(Math.min(e, n.state.doc.content.size - 1));
609
- }
475
+ let a = We(i, e, t, 1);
476
+ if (a == null || a < 0) return;
477
+ let o = Je(n, r.pmPos, a);
478
+ o !== null && ye(o);
610
479
  }
611
- } catch {}
612
- ce(() => T());
480
+ ue(() => w());
481
+ }
613
482
  }
614
- function X(e) {
483
+ function ye(e) {
615
484
  let t = i.view;
616
485
  if (t) try {
617
- let n = J.create(t.state.doc, e);
486
+ let n = q.create(t.state.doc, e);
618
487
  t.dispatch(t.state.tr.setSelection(n));
619
488
  } catch {}
620
489
  }
621
- return I(() => {
622
- document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b);
623
- }), (t, n) => e.imageInfo ? (R(), k("div", {
490
+ return F(() => {
491
+ document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), J &&= (J.remove(), null), b && cancelAnimationFrame(b);
492
+ }), (t, n) => e.imageInfo ? (L(), k("div", {
624
493
  key: 0,
625
494
  ref_key: "overlayRootRef",
626
495
  ref: o,
627
496
  class: "image-overlay",
628
- style: F(ie.value),
629
- onMousedown: n[3] ||= q(() => {}, ["stop"])
497
+ style: P(ie.value),
498
+ onMousedown: n[3] ||= K(() => {}, ["stop"])
630
499
  }, [
631
500
  n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
632
501
  A("div", {
633
502
  class: "image-overlay__body",
634
- style: F({ cursor: c.value ? "grabbing" : "grab" }),
635
- onMousedown: n[0] ||= q((e) => ge(e), ["prevent", "stop"]),
636
- onContextmenu: n[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
503
+ style: P({ cursor: c.value ? "grabbing" : "grab" }),
504
+ onMousedown: n[0] ||= K((e) => _e(e), ["prevent", "stop"]),
505
+ onContextmenu: n[1] ||= K((e) => t.$emit("context-menu", e), ["prevent", "stop"])
637
506
  }, null, 36),
638
- (R(!0), k(w, null, le(ae.value, (e) => (R(), k("div", {
507
+ (L(!0), k(T, null, de(ae.value, (e) => (L(), k("div", {
639
508
  key: e.pos,
640
509
  class: "image-overlay__handle",
641
- style: F(e.style),
510
+ style: P(e.style),
642
511
  "data-handle": e.pos,
643
- onMousedown: q((t) => N(t, e.pos), ["prevent", "stop"])
644
- }, null, 44, It))), 128)),
512
+ onMousedown: K((t) => j(t, e.pos), ["prevent", "stop"])
513
+ }, null, 44, Kt))), 128)),
645
514
  n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
646
515
  A("div", {
647
516
  class: "image-overlay__rotate-handle",
648
- style: F({ left: `${re.value / 2 - 7}px` }),
517
+ style: P({ left: `${E.value / 2 - 7}px` }),
649
518
  title: V(r)("imageOverlay.rotate"),
650
- onMousedown: n[2] ||= q((e) => G(e), ["prevent", "stop"])
651
- }, null, 44, Lt),
652
- s.value ? (R(), k("div", Rt, B(Math.round(u.value)) + " × " + B(Math.round(d.value)), 1)) : O("", !0),
653
- l.value ? (R(), k("div", zt, B(Math.round(f.value)) + "° ", 1)) : O("", !0)
519
+ onMousedown: n[2] ||= K((e) => ge(e), ["prevent", "stop"])
520
+ }, null, 44, qt),
521
+ s.value ? (L(), k("div", Jt, B(Math.round(u.value)) + " × " + B(Math.round(d.value)), 1)) : O("", !0),
522
+ l.value ? (L(), k("div", Yt, B(Math.round(f.value)) + "° ", 1)) : O("", !0)
654
523
  ], 36)) : O("", !0);
655
524
  }
656
- }), [["__scopeId", "data-v-d6768d58"]]), Ut = { class: "doc-outline__header" }, Wt = { class: "doc-outline__body" }, Gt = {
525
+ }), [["__scopeId", "data-v-df7c380c"]]), $t = { class: "doc-outline__header" }, en = { class: "doc-outline__body" }, tn = {
657
526
  key: 0,
658
527
  class: "doc-outline__empty"
659
- }, Kt = ["onMousedown"], qt = /* @__PURE__ */ x(/* @__PURE__ */ N({
528
+ }, nn = ["onMousedown"], rn = /* @__PURE__ */ x(/* @__PURE__ */ M({
660
529
  __name: "DocumentOutline",
661
530
  props: {
662
531
  isOpen: { type: Boolean },
@@ -664,28 +533,28 @@ var Ft = /* @__PURE__ */ N({
664
533
  },
665
534
  emits: ["close", "navigate"],
666
535
  setup(e) {
667
- return (t, n) => e.isOpen ? (R(), k("nav", {
536
+ return (t, n) => e.isOpen ? (L(), k("nav", {
668
537
  key: 0,
669
538
  class: "doc-outline",
670
539
  role: "navigation",
671
540
  "aria-label": "Document outline",
672
- onMousedown: n[1] ||= q(() => {}, ["stop"])
673
- }, [A("div", Ut, [A("button", {
541
+ onMousedown: n[1] ||= K(() => {}, ["stop"])
542
+ }, [A("div", $t, [A("button", {
674
543
  class: "doc-outline__back",
675
544
  title: "Close outline",
676
545
  "aria-label": "Close outline",
677
546
  onClick: n[0] ||= (e) => t.$emit("close")
678
- }, [M(c, {
547
+ }, [j(c, {
679
548
  name: "arrow_back",
680
549
  size: 20
681
- })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", Wt, [e.headings.length === 0 ? (R(), k("div", Gt, " No headings found ")) : O("", !0), (R(!0), k(w, null, le(e.headings, (e, n) => (R(), k("button", {
550
+ })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", en, [e.headings.length === 0 ? (L(), k("div", tn, " No headings found ")) : O("", !0), (L(!0), k(T, null, de(e.headings, (e, n) => (L(), k("button", {
682
551
  key: n,
683
552
  class: "doc-outline__item",
684
- style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
685
- onMousedown: q((n) => t.$emit("navigate", e.pmPos), ["prevent"])
686
- }, B(e.text || "(untitled)"), 45, Kt))), 128))])], 32)) : O("", !0);
553
+ style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
554
+ onMousedown: K((n) => t.$emit("navigate", e.pmPos), ["prevent"])
555
+ }, B(e.text || "(untitled)"), 45, nn))), 128))])], 32)) : O("", !0);
687
556
  }
688
- }), [["__scopeId", "data-v-cb2cdc39"]]), Jt = /* @__PURE__ */ x(/* @__PURE__ */ N({
557
+ }), [["__scopeId", "data-v-cb2cdc39"]]), an = /* @__PURE__ */ x(/* @__PURE__ */ M({
689
558
  __name: "PageIndicator",
690
559
  props: {
691
560
  currentPage: {},
@@ -694,9 +563,9 @@ var Ft = /* @__PURE__ */ N({
694
563
  },
695
564
  setup(e) {
696
565
  let { t } = n();
697
- return (n, r) => (R(), k("div", {
566
+ return (n, r) => (L(), k("div", {
698
567
  class: "docx-editor-vue__page-indicator",
699
- style: F({ opacity: +!!e.visible }),
568
+ style: P({ opacity: +!!e.visible }),
700
569
  "aria-live": "polite",
701
570
  role: "status"
702
571
  }, B(V(t)("viewer.pageIndicator", {
@@ -704,10 +573,10 @@ var Ft = /* @__PURE__ */ N({
704
573
  total: e.totalPages
705
574
  })), 5));
706
575
  }
707
- }), [["__scopeId", "data-v-d117bf6e"]]), Yt = { class: "hf-editor__label" }, Xt = {
576
+ }), [["__scopeId", "data-v-d117bf6e"]]), on = { class: "hf-editor__label" }, sn = {
708
577
  class: "hf-editor__actions",
709
578
  style: { position: "relative" }
710
- }, Zt = /* @__PURE__ */ x(/* @__PURE__ */ N({
579
+ }, cn = /* @__PURE__ */ x(/* @__PURE__ */ M({
711
580
  __name: "InlineHeaderFooterEditor",
712
581
  props: {
713
582
  isOpen: { type: Boolean },
@@ -721,11 +590,11 @@ var Ft = /* @__PURE__ */ N({
721
590
  "remove"
722
591
  ],
723
592
  setup(e, { emit: t }) {
724
- let n = e, r = t, i = z({}), a = z(!1);
593
+ let n = e, r = t, i = R({}), a = R(!1);
725
594
  function o(e) {
726
595
  let t = n.view;
727
596
  if (!t) return;
728
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Ge.nodes.field.create({
597
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Me.nodes.field.create({
729
598
  fieldType: e,
730
599
  instruction: ` ${e} \\* MERGEFORMAT `,
731
600
  fieldKind: "simple",
@@ -745,34 +614,34 @@ var Ft = /* @__PURE__ */ N({
745
614
  pointerEvents: "none"
746
615
  });
747
616
  }
748
- W(() => n.isOpen, (e) => {
617
+ U(() => n.isOpen, (e) => {
749
618
  e && (s(), n.view?.focus());
750
- }), W(() => n.targetRect, () => {
619
+ }), U(() => n.targetRect, () => {
751
620
  n.isOpen && s();
752
621
  }, { deep: !0 });
753
622
  function c() {
754
- n.view && (r("save", Q(n.view.state.doc)), r("close"));
623
+ n.view && (r("save", rt(n.view.state.doc)), r("close"));
755
624
  }
756
- return (t, n) => e.isOpen ? (R(), k("div", {
625
+ return (t, n) => e.isOpen ? (L(), k("div", {
757
626
  key: 0,
758
627
  class: "hf-editor",
759
- style: F(i.value)
628
+ style: P(i.value)
760
629
  }, [A("div", {
761
- class: P(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
762
- onMousedown: n[8] ||= q(() => {}, ["stop"]),
763
- onContextmenu: n[9] ||= q(() => {}, ["stop"])
764
- }, [A("span", Yt, B(e.position === "header" ? "Header" : "Footer"), 1), A("div", Xt, [
630
+ class: N(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
631
+ onMousedown: n[8] ||= K(() => {}, ["stop"]),
632
+ onContextmenu: n[9] ||= K(() => {}, ["stop"])
633
+ }, [A("span", on, B(e.position === "header" ? "Header" : "Footer"), 1), A("div", sn, [
765
634
  A("button", {
766
635
  class: "hf-editor__btn",
767
636
  title: "Options",
768
- onMousedown: n[0] ||= q(() => {}, ["prevent"]),
637
+ onMousedown: n[0] ||= K(() => {}, ["prevent"]),
769
638
  onClick: n[1] ||= (e) => a.value = !a.value
770
639
  }, " Options ▾ ", 32),
771
- a.value ? (R(), k("div", {
640
+ a.value ? (L(), k("div", {
772
641
  key: 0,
773
642
  class: "hf-editor__dropdown",
774
- onMousedown: n[4] ||= q(() => {}, ["stop"]),
775
- onContextmenu: n[5] ||= q(() => {}, ["stop"])
643
+ onMousedown: n[4] ||= K(() => {}, ["stop"]),
644
+ onContextmenu: n[5] ||= K(() => {}, ["stop"])
776
645
  }, [A("button", {
777
646
  type: "button",
778
647
  class: "hf-editor__dropdown-item",
@@ -789,24 +658,24 @@ var Ft = /* @__PURE__ */ N({
789
658
  A("button", {
790
659
  class: "hf-editor__btn",
791
660
  title: "Remove",
792
- onMousedown: n[6] ||= q((e) => t.$emit("remove"), ["prevent"])
661
+ onMousedown: n[6] ||= K((e) => t.$emit("remove"), ["prevent"])
793
662
  }, " Remove ", 32),
794
663
  A("button", {
795
664
  class: "hf-editor__btn hf-editor__btn--primary",
796
665
  title: "Save",
797
- onMousedown: q(c, ["prevent"])
666
+ onMousedown: K(c, ["prevent"])
798
667
  }, " Save ", 32),
799
668
  A("button", {
800
669
  class: "hf-editor__btn",
801
670
  title: "Cancel",
802
- onMousedown: n[7] ||= q((e) => t.$emit("close"), ["prevent"])
671
+ onMousedown: n[7] ||= K((e) => t.$emit("close"), ["prevent"])
803
672
  }, " Cancel ", 32)
804
673
  ])], 34)], 4)) : O("", !0);
805
674
  }
806
- }), [["__scopeId", "data-v-e93a9f94"]]), Qt = ["role"], $t = {
675
+ }), [["__scopeId", "data-v-e93a9f94"]]), ln = ["role"], un = {
807
676
  key: 0,
808
677
  class: "layout-sdt-widget-empty"
809
- }, en = ["aria-selected", "onClick"], tn = ["value"], nn = /* @__PURE__ */ N({
678
+ }, dn = ["aria-selected", "onClick"], fn = ["value"], pn = /* @__PURE__ */ M({
810
679
  __name: "ContentControlWidgets",
811
680
  props: {
812
681
  container: {},
@@ -817,18 +686,18 @@ var Ft = /* @__PURE__ */ N({
817
686
  let t = /^sdt@(\d+)$/.exec(e ?? "");
818
687
  return t ? Number(t[1]) : null;
819
688
  }
820
- let n = e, r = z(null), i = z(null);
689
+ let n = e, r = R(null), i = R(null);
821
690
  function a(e, t) {
822
691
  let i = n.view;
823
692
  if (i) try {
824
- i.dispatch(qe(i.state, { tag: e }, t)), i.focus();
693
+ i.dispatch(X(i.state, { tag: e }, t)), i.focus();
825
694
  } catch {}
826
695
  r.value = null;
827
696
  }
828
697
  function o(e) {
829
698
  let r = n.view, i = t(e.dataset.sdtGroupId);
830
699
  if (!(!r || i == null)) try {
831
- let t = e.dataset.sdtRepeat === "add" ? Be(r.state, i) : We(r.state, i);
700
+ let t = e.dataset.sdtRepeat === "add" ? Ee(r.state, i) : je(r.state, i);
832
701
  r.dispatch(t), r.focus();
833
702
  } catch {}
834
703
  }
@@ -839,7 +708,7 @@ var Ft = /* @__PURE__ */ N({
839
708
  function c(e) {
840
709
  let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
841
710
  if (!t || !i || !o) return;
842
- let s = He(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
711
+ let s = ke(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
843
712
  o === "checkbox" ? a(i, {
844
713
  kind: "checkbox",
845
714
  checked: !s?.checked
@@ -879,10 +748,10 @@ var Ft = /* @__PURE__ */ N({
879
748
  e.key === "Escape" && (r.value = null);
880
749
  }
881
750
  let p = null;
882
- W(() => n.container, (e) => {
751
+ U(() => n.container, (e) => {
883
752
  p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), p = e ?? null, p && (p.addEventListener("mousedown", s), p.addEventListener("click", l), p.addEventListener("keydown", u));
884
- }, { immediate: !0 }), W(r, (e) => {
885
- e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ce(() => {
753
+ }, { immediate: !0 }), U(r, (e) => {
754
+ e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ue(() => {
886
755
  let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
887
756
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
888
757
  })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
@@ -895,7 +764,7 @@ var Ft = /* @__PURE__ */ N({
895
764
  let n = t.indexOf(document.activeElement);
896
765
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
897
766
  }
898
- I(() => {
767
+ F(() => {
899
768
  p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
900
769
  });
901
770
  function h(e) {
@@ -905,42 +774,42 @@ var Ft = /* @__PURE__ */ N({
905
774
  date: t
906
775
  });
907
776
  }
908
- return (e, t) => r.value ? (R(), k("div", {
777
+ return (e, t) => r.value ? (L(), k("div", {
909
778
  key: 0,
910
779
  ref_key: "popupEl",
911
780
  ref: i,
912
781
  class: "layout-sdt-widget-popup",
913
782
  role: r.value.kind === "dropdown" ? "listbox" : void 0,
914
- style: F({
783
+ style: P({
915
784
  position: "fixed",
916
785
  top: r.value.y + "px",
917
786
  left: r.value.x + "px",
918
787
  zIndex: 1e3
919
788
  }),
920
789
  onKeydown: m,
921
- onMousedown: t[0] ||= q(() => {}, ["prevent"])
922
- }, [r.value.kind === "dropdown" ? (R(), k(w, { key: 0 }, [r.value.items.length === 0 ? (R(), k("div", $t, "No options")) : O("", !0), (R(!0), k(w, null, le(r.value.items, (e) => (R(), k("button", {
790
+ onMousedown: t[0] ||= K(() => {}, ["prevent"])
791
+ }, [r.value.kind === "dropdown" ? (L(), k(T, { key: 0 }, [r.value.items.length === 0 ? (L(), k("div", un, "No options")) : O("", !0), (L(!0), k(T, null, de(r.value.items, (e) => (L(), k("button", {
923
792
  key: e.value,
924
793
  type: "button",
925
794
  role: "option",
926
795
  "aria-selected": e.displayText === r.value.current,
927
- class: P(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
796
+ class: N(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
928
797
  onClick: (t) => a(r.value.tag, {
929
798
  kind: "dropdown",
930
799
  value: e.value
931
800
  })
932
- }, B(e.displayText), 11, en))), 128))], 64)) : (R(), k("input", {
801
+ }, B(e.displayText), 11, dn))), 128))], 64)) : (L(), k("input", {
933
802
  key: 1,
934
803
  type: "date",
935
804
  class: "layout-sdt-widget-date",
936
805
  value: r.value.current,
937
806
  onChange: h
938
- }, null, 40, tn))], 44, Qt)) : O("", !0);
807
+ }, null, 40, fn))], 44, ln)) : O("", !0);
939
808
  }
940
- }), rn = {
809
+ }), mn = {
941
810
  key: 0,
942
811
  class: "docx-editor-vue__title-bar"
943
- }, an = { class: "docx-editor-vue__title-bar-left" }, on = { class: "docx-editor-vue__title-bar-center" }, sn = { class: "docx-editor-vue__title-bar-right" }, cn = /* @__PURE__ */ N({
812
+ }, hn = { class: "docx-editor-vue__title-bar-left" }, gn = { class: "docx-editor-vue__title-bar-center" }, _n = { class: "docx-editor-vue__title-bar-right" }, vn = /* @__PURE__ */ M({
944
813
  __name: "DocxEditorMenuBar",
945
814
  props: {
946
815
  showMenuBar: { type: Boolean },
@@ -959,38 +828,38 @@ var Ft = /* @__PURE__ */ N({
959
828
  ],
960
829
  setup(e, { emit: t }) {
961
830
  let n = t;
962
- return (t, r) => e.showMenuBar ? (R(), k("div", rn, [
963
- A("div", an, [e.renderLogo ? (R(), D(de(e.renderLogo), { key: 0 })) : O("", !0), ue(t.$slots, "title-bar-left")]),
964
- A("div", on, [M(g, {
831
+ return (t, r) => e.showMenuBar ? (L(), k("div", mn, [
832
+ A("div", hn, [e.renderLogo ? (L(), ie(pe(e.renderLogo), { key: 0 })) : O("", !0), fe(t.$slots, "title-bar-left")]),
833
+ A("div", gn, [j(g, {
965
834
  "model-value": e.documentName,
966
835
  editable: e.documentNameEditable,
967
836
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
968
- }, null, 8, ["model-value", "editable"]), M(y, {
837
+ }, null, 8, ["model-value", "editable"]), j(y, {
969
838
  onAction: r[1] ||= (e) => n("menu-action", e),
970
839
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
971
840
  })]),
972
- A("div", sn, [ue(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (R(), D(de(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
841
+ A("div", _n, [fe(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), ie(pe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
973
842
  ])) : O("", !0);
974
843
  }
975
- }), ln = ["aria-label"], un = { class: "wm-header" }, dn = { class: "wm-body" }, fn = { class: "wm-radio-row" }, pn = ["checked"], mn = {
844
+ }), yn = ["aria-label"], bn = { class: "wm-header" }, xn = { class: "wm-body" }, Sn = { class: "wm-radio-row" }, Cn = ["checked"], wn = {
976
845
  for: "wm-none",
977
846
  class: "wm-inline-label"
978
- }, hn = { class: "wm-radio-row" }, gn = ["checked"], _n = {
847
+ }, Tn = { class: "wm-radio-row" }, En = ["checked"], Dn = {
979
848
  for: "wm-picture",
980
849
  class: "wm-inline-label"
981
- }, vn = {
850
+ }, On = {
982
851
  key: 0,
983
852
  class: "wm-subform"
984
- }, yn = { class: "wm-row" }, bn = {
853
+ }, kn = { class: "wm-row" }, An = {
985
854
  key: 0,
986
855
  class: "wm-row"
987
- }, xn = ["src"], Sn = { class: "wm-row" }, Cn = { class: "wm-label" }, wn = { class: "wm-inline-label" }, Tn = { class: "wm-radio-row" }, En = ["checked"], $ = {
856
+ }, jn = ["src"], Mn = { class: "wm-row" }, $ = { class: "wm-label" }, Nn = { class: "wm-inline-label" }, Pn = { class: "wm-radio-row" }, Fn = ["checked"], In = {
988
857
  for: "wm-text",
989
858
  class: "wm-inline-label"
990
- }, Dn = {
859
+ }, Ln = {
991
860
  key: 1,
992
861
  class: "wm-subform"
993
- }, On = { class: "wm-row" }, kn = { class: "wm-label" }, An = ["value"], jn = ["value"], Mn = { class: "wm-row" }, Nn = { class: "wm-label" }, Pn = { class: "wm-row" }, Fn = { class: "wm-label" }, In = ["value"], Ln = { class: "wm-row" }, Rn = { class: "wm-label" }, zn = { class: "wm-inline-label" }, Bn = { class: "wm-row" }, Vn = { class: "wm-label" }, Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-inline-label" }, Gn = ["checked"], Kn = { class: "wm-inline-label" }, qn = ["checked"], Jn = { class: "wm-inline-label" }, Yn = { class: "wm-footer" }, Xn = ["disabled"], Zn = /* @__PURE__ */ x(/* @__PURE__ */ N({
862
+ }, Rn = { class: "wm-row" }, zn = { class: "wm-label" }, Bn = ["value"], Vn = ["value"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-row" }, Gn = { class: "wm-label" }, Kn = ["value"], qn = { class: "wm-row" }, Jn = { class: "wm-label" }, Yn = { class: "wm-inline-label" }, Xn = { class: "wm-row" }, Zn = { class: "wm-label" }, Qn = { class: "wm-row" }, $n = { class: "wm-label" }, er = { class: "wm-inline-label" }, tr = ["checked"], nr = { class: "wm-inline-label" }, rr = ["checked"], ir = { class: "wm-inline-label" }, ar = { class: "wm-footer" }, or = ["disabled"], sr = /* @__PURE__ */ x(/* @__PURE__ */ M({
994
863
  __name: "WatermarkDialog",
995
864
  props: {
996
865
  isOpen: { type: Boolean },
@@ -1012,8 +881,8 @@ var Ft = /* @__PURE__ */ N({
1012
881
  "Georgia",
1013
882
  "Verdana",
1014
883
  "Courier New"
1015
- ], { t: a } = n(), o = e, s = t, c = z("none"), l = z("CONFIDENTIAL"), u = z("Calibri"), d = z(!0), f = z(54), p = z("#C0C0C0"), m = z("diagonal"), h = z(!0), g = z(void 0), _ = z(void 0), v = z(100), y = z(!0);
1016
- W(() => o.isOpen, (e) => {
884
+ ], { t: a } = n(), o = e, s = t, c = R("none"), l = R("CONFIDENTIAL"), u = R("Calibri"), d = 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);
885
+ U(() => o.isOpen, (e) => {
1017
886
  if (!e) return;
1018
887
  let t = o.current;
1019
888
  t?.kind === "text" ? (c.value = "text", l.value = t.text, u.value = t.font || "Calibri", d.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" ? (c.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
@@ -1021,7 +890,7 @@ var Ft = /* @__PURE__ */ N({
1021
890
  heightEmu: t.heightEmu
1022
891
  } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : c.value = "none";
1023
892
  }, { immediate: !0 });
1024
- let b = E(() => c.value === "picture" && !g.value);
893
+ let b = D(() => c.value === "picture" && !g.value);
1025
894
  function x(e) {
1026
895
  let t = e.target.value;
1027
896
  t && (l.value = t);
@@ -1035,7 +904,7 @@ var Ft = /* @__PURE__ */ N({
1035
904
  if (g.value = e, _.value = void 0, !e) return;
1036
905
  let t = new Image();
1037
906
  t.onload = () => {
1038
- _.value = Xe(t.naturalWidth, t.naturalHeight);
907
+ _.value = at(t.naturalWidth, t.naturalHeight);
1039
908
  }, t.src = e;
1040
909
  }, n.readAsDataURL(t);
1041
910
  }
@@ -1068,96 +937,96 @@ var Ft = /* @__PURE__ */ N({
1068
937
  function te(e) {
1069
938
  e.key === "Escape" && C();
1070
939
  }
1071
- return (t, n) => e.isOpen ? (R(), k("div", {
940
+ return (t, n) => e.isOpen ? (L(), k("div", {
1072
941
  key: 0,
1073
942
  class: "wm-overlay",
1074
- onMousedown: q(C, ["self"]),
943
+ onMousedown: K(C, ["self"]),
1075
944
  onKeydown: te
1076
945
  }, [A("div", {
1077
946
  class: "wm-dialog",
1078
947
  role: "dialog",
1079
948
  "aria-label": V(a)("dialogs.watermark.title"),
1080
- onMousedown: n[13] ||= q(() => {}, ["stop"])
949
+ onMousedown: n[13] ||= K(() => {}, ["stop"])
1081
950
  }, [
1082
- A("div", un, B(V(a)("dialogs.watermark.title")), 1),
1083
- A("div", dn, [
1084
- A("div", fn, [A("input", {
951
+ A("div", bn, B(V(a)("dialogs.watermark.title")), 1),
952
+ A("div", xn, [
953
+ A("div", Sn, [A("input", {
1085
954
  id: "wm-none",
1086
955
  type: "radio",
1087
956
  checked: c.value === "none",
1088
957
  onChange: n[0] ||= (e) => c.value = "none"
1089
- }, null, 40, pn), A("label", mn, B(V(a)("dialogs.watermark.noWatermark")), 1)]),
1090
- A("div", hn, [A("input", {
958
+ }, null, 40, Cn), A("label", wn, B(V(a)("dialogs.watermark.noWatermark")), 1)]),
959
+ A("div", Tn, [A("input", {
1091
960
  id: "wm-picture",
1092
961
  type: "radio",
1093
962
  checked: c.value === "picture",
1094
963
  onChange: n[1] ||= (e) => c.value = "picture"
1095
- }, null, 40, gn), A("label", _n, B(V(a)("dialogs.watermark.picture")), 1)]),
1096
- c.value === "picture" ? (R(), k("div", vn, [
1097
- A("div", yn, [A("input", {
964
+ }, null, 40, En), A("label", Dn, B(V(a)("dialogs.watermark.picture")), 1)]),
965
+ c.value === "picture" ? (L(), k("div", On, [
966
+ A("div", kn, [A("input", {
1098
967
  type: "file",
1099
968
  accept: "image/*",
1100
969
  onChange: S
1101
970
  }, null, 32)]),
1102
- g.value ? (R(), k("div", bn, [A("img", {
971
+ g.value ? (L(), k("div", An, [A("img", {
1103
972
  src: g.value,
1104
973
  alt: "",
1105
974
  class: "wm-preview"
1106
- }, null, 8, xn)])) : O("", !0),
1107
- A("div", Sn, [
1108
- A("span", Cn, B(V(a)("dialogs.watermark.scale")), 1),
1109
- G(A("input", {
975
+ }, null, 8, jn)])) : O("", !0),
976
+ A("div", Mn, [
977
+ A("span", $, B(V(a)("dialogs.watermark.scale")), 1),
978
+ W(A("input", {
1110
979
  class: "wm-input wm-input--narrow",
1111
980
  type: "number",
1112
981
  min: "10",
1113
982
  max: "500",
1114
983
  "onUpdate:modelValue": n[2] ||= (e) => v.value = e
1115
984
  }, null, 512), [[
1116
- U,
985
+ H,
1117
986
  v.value,
1118
987
  void 0,
1119
988
  { number: !0 }
1120
989
  ]]),
1121
990
  n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
1122
991
  ]),
1123
- A("label", wn, [G(A("input", {
992
+ A("label", Nn, [W(A("input", {
1124
993
  type: "checkbox",
1125
994
  "onUpdate:modelValue": n[3] ||= (e) => y.value = e
1126
- }, null, 512), [[H, y.value]]), j(" " + B(V(a)("dialogs.watermark.washout")), 1)])
995
+ }, null, 512), [[me, y.value]]), se(" " + B(V(a)("dialogs.watermark.washout")), 1)])
1127
996
  ])) : O("", !0),
1128
- A("div", Tn, [A("input", {
997
+ A("div", Pn, [A("input", {
1129
998
  id: "wm-text",
1130
999
  type: "radio",
1131
1000
  checked: c.value === "text",
1132
1001
  onChange: n[4] ||= (e) => c.value = "text"
1133
- }, null, 40, En), A("label", $, B(V(a)("dialogs.watermark.text")), 1)]),
1134
- c.value === "text" ? (R(), k("div", Dn, [
1135
- A("div", On, [A("span", kn, B(V(a)("dialogs.watermark.presetLabel")), 1), A("select", {
1002
+ }, null, 40, Fn), A("label", In, B(V(a)("dialogs.watermark.text")), 1)]),
1003
+ c.value === "text" ? (L(), k("div", Ln, [
1004
+ A("div", Rn, [A("span", zn, B(V(a)("dialogs.watermark.presetLabel")), 1), A("select", {
1136
1005
  class: "wm-input",
1137
1006
  value: r.includes(l.value) ? l.value : "",
1138
1007
  onChange: x
1139
- }, [n[15] ||= A("option", { value: "" }, "—", -1), (R(), k(w, null, le(r, (e) => A("option", {
1008
+ }, [n[15] ||= A("option", { value: "" }, "—", -1), (L(), k(T, null, de(r, (e) => A("option", {
1140
1009
  key: e,
1141
1010
  value: e
1142
- }, B(e), 9, jn)), 64))], 40, An)]),
1143
- A("div", Mn, [A("span", Nn, B(V(a)("dialogs.watermark.textLabel")), 1), G(A("input", {
1011
+ }, B(e), 9, Vn)), 64))], 40, Bn)]),
1012
+ A("div", Hn, [A("span", Un, B(V(a)("dialogs.watermark.textLabel")), 1), W(A("input", {
1144
1013
  class: "wm-input",
1145
1014
  "onUpdate:modelValue": n[5] ||= (e) => l.value = e
1146
- }, null, 512), [[U, l.value]])]),
1147
- A("div", Pn, [A("span", Fn, B(V(a)("dialogs.watermark.fontLabel")), 1), G(A("select", {
1015
+ }, null, 512), [[H, l.value]])]),
1016
+ A("div", Wn, [A("span", Gn, B(V(a)("dialogs.watermark.fontLabel")), 1), W(A("select", {
1148
1017
  class: "wm-input",
1149
1018
  "onUpdate:modelValue": n[6] ||= (e) => u.value = e
1150
- }, [(R(), k(w, null, le(i, (e) => A("option", {
1019
+ }, [(L(), k(T, null, de(i, (e) => A("option", {
1151
1020
  key: e,
1152
1021
  value: e
1153
- }, B(e), 9, In)), 64))], 512), [[pe, u.value]])]),
1154
- A("div", Ln, [
1155
- A("span", Rn, B(V(a)("dialogs.watermark.sizeLabel")), 1),
1156
- A("label", zn, [G(A("input", {
1022
+ }, B(e), 9, Kn)), 64))], 512), [[he, u.value]])]),
1023
+ A("div", qn, [
1024
+ A("span", Jn, B(V(a)("dialogs.watermark.sizeLabel")), 1),
1025
+ A("label", Yn, [W(A("input", {
1157
1026
  type: "checkbox",
1158
1027
  "onUpdate:modelValue": n[7] ||= (e) => d.value = e
1159
- }, null, 512), [[H, d.value]]), j(" " + B(V(a)("dialogs.watermark.sizeAuto")), 1)]),
1160
- d.value ? O("", !0) : G((R(), k("input", {
1028
+ }, null, 512), [[me, d.value]]), se(" " + B(V(a)("dialogs.watermark.sizeAuto")), 1)]),
1029
+ d.value ? O("", !0) : W((L(), k("input", {
1161
1030
  key: 0,
1162
1031
  class: "wm-input wm-input--narrow",
1163
1032
  type: "number",
@@ -1165,50 +1034,50 @@ var Ft = /* @__PURE__ */ N({
1165
1034
  max: "200",
1166
1035
  "onUpdate:modelValue": n[8] ||= (e) => f.value = e
1167
1036
  }, null, 512)), [[
1168
- U,
1037
+ H,
1169
1038
  f.value,
1170
1039
  void 0,
1171
1040
  { number: !0 }
1172
1041
  ]])
1173
1042
  ]),
1174
- A("div", Bn, [A("span", Vn, B(V(a)("dialogs.watermark.colorLabel")), 1), G(A("input", {
1043
+ A("div", Xn, [A("span", Zn, B(V(a)("dialogs.watermark.colorLabel")), 1), W(A("input", {
1175
1044
  type: "color",
1176
1045
  "onUpdate:modelValue": n[9] ||= (e) => p.value = e
1177
- }, null, 512), [[U, p.value]])]),
1178
- A("div", Hn, [
1179
- A("span", Un, B(V(a)("dialogs.watermark.layoutLabel")), 1),
1180
- A("label", Wn, [A("input", {
1046
+ }, null, 512), [[H, p.value]])]),
1047
+ A("div", Qn, [
1048
+ A("span", $n, B(V(a)("dialogs.watermark.layoutLabel")), 1),
1049
+ A("label", er, [A("input", {
1181
1050
  type: "radio",
1182
1051
  name: "wm-layout",
1183
1052
  checked: m.value === "diagonal",
1184
1053
  onChange: n[10] ||= (e) => m.value = "diagonal"
1185
- }, null, 40, Gn), j(" " + B(V(a)("dialogs.watermark.diagonal")), 1)]),
1186
- A("label", Kn, [A("input", {
1054
+ }, null, 40, tr), se(" " + B(V(a)("dialogs.watermark.diagonal")), 1)]),
1055
+ A("label", nr, [A("input", {
1187
1056
  type: "radio",
1188
1057
  name: "wm-layout",
1189
1058
  checked: m.value === "horizontal",
1190
1059
  onChange: n[11] ||= (e) => m.value = "horizontal"
1191
- }, null, 40, qn), j(" " + B(V(a)("dialogs.watermark.horizontal")), 1)])
1060
+ }, null, 40, rr), se(" " + B(V(a)("dialogs.watermark.horizontal")), 1)])
1192
1061
  ]),
1193
- A("label", Jn, [G(A("input", {
1062
+ A("label", ir, [W(A("input", {
1194
1063
  type: "checkbox",
1195
1064
  "onUpdate:modelValue": n[12] ||= (e) => h.value = e
1196
- }, null, 512), [[H, h.value]]), j(" " + B(V(a)("dialogs.watermark.semitransparent")), 1)])
1065
+ }, null, 512), [[me, h.value]]), se(" " + B(V(a)("dialogs.watermark.semitransparent")), 1)])
1197
1066
  ])) : O("", !0)
1198
1067
  ]),
1199
- A("div", Yn, [A("button", {
1068
+ A("div", ar, [A("button", {
1200
1069
  type: "button",
1201
1070
  class: "wm-btn",
1202
1071
  onClick: C
1203
1072
  }, B(V(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1204
1073
  type: "button",
1205
- class: P(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1074
+ class: N(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1206
1075
  disabled: b.value,
1207
1076
  onClick: ee
1208
- }, B(V(a)("dialogs.watermark.applyButton")), 11, Xn)])
1209
- ], 40, ln)], 32)) : O("", !0);
1077
+ }, B(V(a)("dialogs.watermark.applyButton")), 11, or)])
1078
+ ], 40, yn)], 32)) : O("", !0);
1210
1079
  }
1211
- }), [["__scopeId", "data-v-5edfdc47"]]), Qn = /* @__PURE__ */ N({
1080
+ }), [["__scopeId", "data-v-5edfdc47"]]), cr = /* @__PURE__ */ M({
1212
1081
  __name: "DocxEditorDialogs",
1213
1082
  props: {
1214
1083
  view: {},
@@ -1244,8 +1113,8 @@ var Ft = /* @__PURE__ */ N({
1244
1113
  ],
1245
1114
  setup(t, { emit: n }) {
1246
1115
  let r = n;
1247
- return (n, a) => (R(), k(w, null, [
1248
- M(u, {
1116
+ return (n, a) => (L(), k(T, null, [
1117
+ j(u, {
1249
1118
  "is-open": t.showFindReplace,
1250
1119
  view: t.view,
1251
1120
  "scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
@@ -1255,12 +1124,12 @@ var Ft = /* @__PURE__ */ N({
1255
1124
  "view",
1256
1125
  "scroll-visible-position-into-view"
1257
1126
  ]),
1258
- M(s, {
1127
+ j(s, {
1259
1128
  "is-open": t.showInsertImage,
1260
1129
  onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
1261
1130
  onInsert: a[2] ||= (e) => r("insert-image", e)
1262
1131
  }, null, 8, ["is-open"]),
1263
- M(e, {
1132
+ j(e, {
1264
1133
  "is-open": t.showHyperlink,
1265
1134
  view: t.view,
1266
1135
  bookmarks: t.bookmarks,
@@ -1272,12 +1141,12 @@ var Ft = /* @__PURE__ */ N({
1272
1141
  "view",
1273
1142
  "bookmarks"
1274
1143
  ]),
1275
- M(i, {
1144
+ j(i, {
1276
1145
  "is-open": t.showInsertSymbol,
1277
1146
  onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
1278
1147
  onInsert: a[7] ||= (e) => r("insert-symbol", e)
1279
1148
  }, null, 8, ["is-open"]),
1280
- M(l, {
1149
+ j(l, {
1281
1150
  "is-open": t.showImageProperties,
1282
1151
  view: t.view,
1283
1152
  "pm-pos": t.selectedImagePmPos,
@@ -1287,28 +1156,28 @@ var Ft = /* @__PURE__ */ N({
1287
1156
  "view",
1288
1157
  "pm-pos"
1289
1158
  ]),
1290
- M(o, {
1159
+ j(o, {
1291
1160
  "is-open": t.showPageSetup,
1292
1161
  "section-properties": t.sectionProperties,
1293
1162
  onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
1294
1163
  onApply: a[10] ||= (e) => r("page-setup-apply", e)
1295
1164
  }, null, 8, ["is-open", "section-properties"]),
1296
- M(Zn, {
1165
+ j(sr, {
1297
1166
  "is-open": t.showWatermark,
1298
1167
  current: t.currentWatermark,
1299
1168
  onClose: a[11] ||= (e) => r("update:showWatermark", !1),
1300
1169
  onApply: a[12] ||= (e) => r("watermark-apply", e)
1301
1170
  }, null, 8, ["is-open", "current"]),
1302
- M(d, {
1171
+ j(d, {
1303
1172
  "is-open": t.showKeyboardShortcuts,
1304
1173
  onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
1305
1174
  }, null, 8, ["is-open"])
1306
1175
  ], 64));
1307
1176
  }
1308
- }), $n = ["disabled", "onMousedown"], er = { class: "ctx-menu__label" }, tr = {
1177
+ }), lr = ["disabled", "onMousedown"], ur = { class: "ctx-menu__label" }, dr = {
1309
1178
  key: 0,
1310
1179
  class: "ctx-menu__shortcut"
1311
- }, nr = 220, rr = 32, ir = 10, ar = /* @__PURE__ */ x(/* @__PURE__ */ N({
1180
+ }, fr = 220, pr = 32, mr = 10, hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1312
1181
  __name: "TextContextMenu",
1313
1182
  props: {
1314
1183
  isOpen: { type: Boolean },
@@ -1322,35 +1191,35 @@ var Ft = /* @__PURE__ */ N({
1322
1191
  },
1323
1192
  emits: ["close", "action"],
1324
1193
  setup(e, { emit: t }) {
1325
- let n = e, r = t, i = z(null), a = E(() => {
1194
+ let r = e, i = t, { t: a } = n(), o = R(null), s = D(() => {
1326
1195
  let e = [
1327
1196
  {
1328
1197
  id: "cut",
1329
- label: "Cut",
1198
+ label: a("contextMenu.cut"),
1330
1199
  action: "cut",
1331
- shortcut: "Ctrl+X",
1332
- disabled: !n.hasSelection || !n.isEditable
1200
+ shortcut: a("contextMenu.cutShortcut"),
1201
+ disabled: !r.hasSelection || !r.isEditable
1333
1202
  },
1334
1203
  {
1335
1204
  id: "copy",
1336
- label: "Copy",
1205
+ label: a("contextMenu.copy"),
1337
1206
  action: "copy",
1338
- shortcut: "Ctrl+C",
1339
- disabled: !n.hasSelection
1207
+ shortcut: a("contextMenu.copyShortcut"),
1208
+ disabled: !r.hasSelection
1340
1209
  },
1341
1210
  {
1342
1211
  id: "paste",
1343
- label: "Paste",
1212
+ label: a("contextMenu.paste"),
1344
1213
  action: "paste",
1345
- shortcut: "Ctrl+V",
1346
- disabled: !n.isEditable
1214
+ shortcut: a("contextMenu.pasteShortcut"),
1215
+ disabled: !r.isEditable
1347
1216
  },
1348
1217
  {
1349
1218
  id: "pasteAsPlainText",
1350
- label: "Paste as Plain Text",
1219
+ label: a("contextMenu.pastePlainText"),
1351
1220
  action: "pasteAsPlainText",
1352
- shortcut: "Ctrl+Shift+V",
1353
- disabled: !n.isEditable
1221
+ shortcut: a("contextMenu.pastePlainTextShortcut"),
1222
+ disabled: !r.isEditable
1354
1223
  },
1355
1224
  {
1356
1225
  id: "div1",
@@ -1360,52 +1229,52 @@ var Ft = /* @__PURE__ */ N({
1360
1229
  },
1361
1230
  {
1362
1231
  id: "delete",
1363
- label: "Delete",
1232
+ label: a("contextMenu.delete"),
1364
1233
  action: "delete",
1365
- shortcut: "Del",
1366
- disabled: !n.hasSelection || !n.isEditable
1234
+ shortcut: a("contextMenu.deleteShortcut"),
1235
+ disabled: !r.hasSelection || !r.isEditable
1367
1236
  },
1368
1237
  {
1369
1238
  id: "selectAll",
1370
- label: "Select All",
1239
+ label: a("contextMenu.selectAll"),
1371
1240
  action: "selectAll",
1372
- shortcut: "Ctrl+A"
1241
+ shortcut: a("contextMenu.selectAllShortcut")
1373
1242
  }
1374
1243
  ];
1375
- return n.onImage && n.isEditable && e.push({
1244
+ return r.onImage && r.isEditable && e.push({
1376
1245
  id: "div-img",
1377
1246
  label: "",
1378
1247
  action: "",
1379
1248
  divider: !0
1380
1249
  }, {
1381
1250
  id: "replaceImage",
1382
- label: "Replace image…",
1251
+ label: a("imageOverlay.replaceImage"),
1383
1252
  action: "replaceImage"
1384
1253
  }, {
1385
1254
  id: "imageProperties",
1386
- label: "Image properties…",
1255
+ label: a("imageWrap.menu.imageProperties"),
1387
1256
  action: "imageProperties"
1388
1257
  }, {
1389
1258
  id: "deleteImage",
1390
- label: "Delete image",
1259
+ label: a("imageOverlay.deleteImage"),
1391
1260
  action: "deleteImage",
1392
- shortcut: "Del"
1393
- }), n.inTable && n.isEditable && e.push({
1261
+ shortcut: a("contextMenu.deleteShortcut")
1262
+ }), r.inTable && r.isEditable && e.push({
1394
1263
  id: "div2",
1395
1264
  label: "",
1396
1265
  action: "",
1397
1266
  divider: !0
1398
1267
  }, {
1399
1268
  id: "addRowAbove",
1400
- label: "Insert row above",
1269
+ label: a("table.insertRowAbove"),
1401
1270
  action: "addRowAbove"
1402
1271
  }, {
1403
1272
  id: "addRowBelow",
1404
- label: "Insert row below",
1273
+ label: a("table.insertRowBelow"),
1405
1274
  action: "addRowBelow"
1406
1275
  }, {
1407
1276
  id: "deleteRow",
1408
- label: "Delete row",
1277
+ label: a("table.deleteRow"),
1409
1278
  action: "deleteRow"
1410
1279
  }, {
1411
1280
  id: "div3",
@@ -1414,15 +1283,15 @@ var Ft = /* @__PURE__ */ N({
1414
1283
  divider: !0
1415
1284
  }, {
1416
1285
  id: "addColLeft",
1417
- label: "Insert column left",
1286
+ label: a("table.insertColumnLeft"),
1418
1287
  action: "addColumnLeft"
1419
1288
  }, {
1420
1289
  id: "addColRight",
1421
- label: "Insert column right",
1290
+ label: a("table.insertColumnRight"),
1422
1291
  action: "addColumnRight"
1423
1292
  }, {
1424
1293
  id: "deleteCol",
1425
- label: "Delete column",
1294
+ label: a("table.deleteColumn"),
1426
1295
  action: "deleteColumn"
1427
1296
  }, {
1428
1297
  id: "div4",
@@ -1431,74 +1300,74 @@ var Ft = /* @__PURE__ */ N({
1431
1300
  divider: !0
1432
1301
  }, {
1433
1302
  id: "mergeCells",
1434
- label: "Merge cells",
1303
+ label: a("table.mergeCells"),
1435
1304
  action: "mergeCells",
1436
- disabled: !n.canMergeCells
1305
+ disabled: !r.canMergeCells
1437
1306
  }, {
1438
1307
  id: "splitCell",
1439
- label: "Split cell",
1308
+ label: a("table.splitCell"),
1440
1309
  action: "splitCell",
1441
- disabled: !n.canSplitCell
1310
+ disabled: !r.canSplitCell
1442
1311
  }), e;
1443
- }), o = E(() => {
1444
- let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r * rr + i * 9;
1445
- return typeof window < "u" && (e + nr + ir > window.innerWidth && (e = window.innerWidth - nr - ir), t + o + ir > window.innerHeight && (t = window.innerHeight - o - ir)), {
1312
+ }), c = D(() => {
1313
+ let e = r.position.x, t = r.position.y, n = s.value.filter((e) => !e.divider).length, i = s.value.filter((e) => e.divider).length, a = n * pr + i * 9;
1314
+ return typeof window < "u" && (e + fr + mr > window.innerWidth && (e = window.innerWidth - fr - mr), t + a + mr > window.innerHeight && (t = window.innerHeight - a - mr)), {
1446
1315
  position: "fixed",
1447
1316
  left: `${e}px`,
1448
1317
  top: `${t}px`,
1449
1318
  zIndex: 400
1450
1319
  };
1451
1320
  });
1452
- function s(e) {
1453
- e && (r("action", e), r("close"));
1321
+ function l(e) {
1322
+ e && (i("action", e), i("close"));
1454
1323
  }
1455
- function c(e) {
1456
- e.key === "Escape" && r("close");
1324
+ function u(e) {
1325
+ e.key === "Escape" && i("close");
1457
1326
  }
1458
- return W(() => n.isOpen, (e) => {
1459
- e && ce(() => i.value?.focus());
1460
- }), (t, n) => (R(), D(T, { to: "body" }, [e.isOpen ? (R(), k("div", {
1327
+ return U(() => r.isOpen, (e) => {
1328
+ e && ue(() => o.value?.focus());
1329
+ }), (t, n) => (L(), ie(E, { to: "body" }, [e.isOpen ? (L(), k("div", {
1461
1330
  key: 0,
1462
1331
  class: "ctx-menu-backdrop",
1463
1332
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1464
- onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
1465
- }, null, 32)) : O("", !0), e.isOpen ? (R(), k("div", {
1333
+ onContextmenu: n[1] ||= K((e) => t.$emit("close"), ["prevent"])
1334
+ }, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
1466
1335
  key: 1,
1467
1336
  ref_key: "menuRef",
1468
- ref: i,
1337
+ ref: o,
1469
1338
  class: "ctx-menu",
1470
- style: F(o.value),
1471
- onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
1472
- onKeydown: c
1473
- }, [(R(!0), k(w, null, le(a.value, (e, t) => (R(), k("button", {
1339
+ style: P(c.value),
1340
+ onContextmenu: n[2] ||= K(() => {}, ["prevent"]),
1341
+ onKeydown: u
1342
+ }, [(L(!0), k(T, null, de(s.value, (e, t) => (L(), k("button", {
1474
1343
  key: e.id || t,
1475
- class: P(["ctx-menu__item", {
1344
+ class: N(["ctx-menu__item", {
1476
1345
  "ctx-menu__item--disabled": e.disabled,
1477
1346
  "ctx-menu__item--divider": e.divider
1478
1347
  }]),
1479
1348
  disabled: e.disabled,
1480
- onMousedown: q((t) => s(e.action), ["prevent"])
1481
- }, [A("span", er, B(e.label), 1), e.shortcut ? (R(), k("span", tr, B(e.shortcut), 1)) : O("", !0)], 42, $n))), 128))], 36)) : O("", !0)]));
1349
+ onMousedown: K((t) => l(e.action), ["prevent"])
1350
+ }, [A("span", ur, B(e.label), 1), e.shortcut ? (L(), k("span", dr, B(e.shortcut), 1)) : O("", !0)], 42, lr))), 128))], 36)) : O("", !0)]));
1482
1351
  }
1483
- }), [["__scopeId", "data-v-741c4f71"]]), or = ["aria-label"], sr = { class: "image-ctx-menu__icon" }, cr = { class: "image-ctx-menu__label" }, lr = {
1352
+ }), [["__scopeId", "data-v-b2122da6"]]), gr = ["aria-label"], _r = { class: "image-ctx-menu__icon" }, vr = { class: "image-ctx-menu__label" }, yr = {
1484
1353
  key: 1,
1485
1354
  class: "image-ctx-menu__divider",
1486
1355
  role: "separator"
1487
- }, ur = [
1356
+ }, br = [
1488
1357
  "data-wrap-type",
1489
1358
  "data-current",
1490
1359
  "data-disabled",
1491
1360
  "disabled",
1492
1361
  "title",
1493
1362
  "onClick"
1494
- ], dr = { class: "image-ctx-menu__icon" }, fr = { class: "image-ctx-menu__label" }, pr = ["aria-label"], mr = ["disabled", "onClick"], hr = { class: "image-ctx-menu__label" }, gr = {
1363
+ ], xr = { class: "image-ctx-menu__icon" }, Sr = { class: "image-ctx-menu__label" }, Cr = ["aria-label"], wr = ["disabled", "onClick"], Tr = { class: "image-ctx-menu__label" }, Er = {
1495
1364
  key: 0,
1496
1365
  class: "image-ctx-menu__shortcut"
1497
- }, _r = {
1366
+ }, Dr = {
1498
1367
  key: 0,
1499
1368
  class: "image-ctx-menu__divider",
1500
1369
  role: "separator"
1501
- }, vr = 18, yr = 260, br = 10, xr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1370
+ }, Or = 18, kr = 260, Ar = 10, jr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1502
1371
  __name: "ImageContextMenu",
1503
1372
  props: {
1504
1373
  state: {},
@@ -1519,7 +1388,7 @@ var Ft = /* @__PURE__ */ N({
1519
1388
  function a() {
1520
1389
  i("open-properties"), i("close");
1521
1390
  }
1522
- let { t: o } = n(), s = z(null), l = Me, u = E(() => r.state ? Pe(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1391
+ let { t: o } = n(), s = R(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1523
1392
  inline: "wrap_text",
1524
1393
  squareLeft: "format_image_left",
1525
1394
  squareRight: "format_image_right",
@@ -1529,19 +1398,19 @@ var Ft = /* @__PURE__ */ N({
1529
1398
  function f(e) {
1530
1399
  return d[e];
1531
1400
  }
1532
- let p = E(() => {
1401
+ let p = D(() => {
1533
1402
  if (!r.state) return {};
1534
- let e = Me.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1535
- return typeof window < "u" && (t + yr > window.innerWidth && (t = window.innerWidth - yr - br), n + e > window.innerHeight && (n = window.innerHeight - e - br), t < br && (t = br), n < br && (n = br)), {
1403
+ let e = Ze.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1404
+ return typeof window < "u" && (t + kr > window.innerWidth && (t = window.innerWidth - kr - Ar), n + e > window.innerHeight && (n = window.innerHeight - e - Ar), t < Ar && (t = Ar), n < Ar && (n = Ar)), {
1536
1405
  position: "fixed",
1537
1406
  left: `${t}px`,
1538
1407
  top: `${n}px`,
1539
- minWidth: `${yr}px`,
1408
+ minWidth: `${kr}px`,
1540
1409
  zIndex: 400
1541
1410
  };
1542
1411
  });
1543
1412
  function m(e) {
1544
- return r.state ? Ie(e, r.state.currentWrapType) : !1;
1413
+ return r.state ? et(e, r.state.currentWrapType) : !1;
1545
1414
  }
1546
1415
  function h(e) {
1547
1416
  m(e) && (i("select", e.choice), i("close"));
@@ -1555,12 +1424,12 @@ var Ft = /* @__PURE__ */ N({
1555
1424
  function v(e) {
1556
1425
  e.key === "Escape" && (e.preventDefault(), i("close"));
1557
1426
  }
1558
- return (t, n) => (R(), D(T, { to: "body" }, [e.state && e.state.open ? (R(), k("div", {
1427
+ return (t, n) => (L(), ie(E, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1559
1428
  key: 0,
1560
1429
  class: "image-ctx-menu-backdrop",
1561
1430
  onMousedown: _,
1562
- onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
1563
- }, null, 32)) : O("", !0), e.state && e.state.open ? (R(), k("div", {
1431
+ onContextmenu: n[0] ||= K((e) => t.$emit("close"), ["prevent"])
1432
+ }, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
1564
1433
  key: 1,
1565
1434
  ref_key: "menuRef",
1566
1435
  ref: s,
@@ -1568,61 +1437,61 @@ var Ft = /* @__PURE__ */ N({
1568
1437
  role: "menu",
1569
1438
  "aria-label": V(o)("imageWrap.menu.ariaLabel"),
1570
1439
  "data-testid": "image-context-menu",
1571
- style: F(p.value),
1572
- onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
1440
+ style: P(p.value),
1441
+ onContextmenu: n[4] ||= K(() => {}, ["prevent"]),
1573
1442
  onKeydown: v
1574
1443
  }, [
1575
- e.canOpenProperties ? (R(), k("button", {
1444
+ e.canOpenProperties ? (L(), k("button", {
1576
1445
  key: 0,
1577
1446
  type: "button",
1578
1447
  role: "menuitem",
1579
1448
  class: "image-ctx-menu__item",
1580
1449
  "data-action": "open-properties",
1581
- onMousedown: n[1] ||= q(() => {}, ["prevent"]),
1450
+ onMousedown: n[1] ||= K(() => {}, ["prevent"]),
1582
1451
  onClick: a
1583
- }, [A("span", sr, [M(c, {
1452
+ }, [A("span", _r, [j(c, {
1584
1453
  name: "settings",
1585
- size: vr
1586
- })]), A("span", cr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1587
- e.canOpenProperties ? (R(), k("div", lr)) : O("", !0),
1588
- (R(!0), k(w, null, le(V(l), (e) => (R(), k("button", {
1454
+ size: Or
1455
+ })]), A("span", vr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1456
+ e.canOpenProperties ? (L(), k("div", yr)) : O("", !0),
1457
+ (L(!0), k(T, null, de(V(l), (e) => (L(), k("button", {
1589
1458
  key: e.choice,
1590
1459
  type: "button",
1591
1460
  role: "menuitem",
1592
- class: P(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1461
+ class: N(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1593
1462
  "data-wrap-type": e.choice,
1594
1463
  "data-current": e.choice === u.value ? "true" : "false",
1595
1464
  "data-disabled": m(e) ? "false" : "true",
1596
1465
  disabled: !m(e),
1597
1466
  title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1598
- onMousedown: n[2] ||= q(() => {}, ["prevent"]),
1467
+ onMousedown: n[2] ||= K(() => {}, ["prevent"]),
1599
1468
  onClick: (t) => h(e)
1600
1469
  }, [
1601
- A("span", dr, [M(c, {
1470
+ A("span", xr, [j(c, {
1602
1471
  name: f(e.iconHint),
1603
- size: vr
1472
+ size: Or
1604
1473
  }, null, 8, ["name"])]),
1605
- A("span", fr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1606
- e.choice === u.value ? (R(), k("span", {
1474
+ A("span", Sr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1475
+ e.choice === u.value ? (L(), k("span", {
1607
1476
  key: 0,
1608
1477
  class: "image-ctx-menu__current-dot",
1609
1478
  "aria-label": V(o)("imageWrap.menu.ariaLabel")
1610
- }, "●", 8, pr)) : O("", !0)
1611
- ], 42, ur))), 128)),
1612
- e.textActions && e.textActions.length > 0 ? (R(), k(w, { key: 2 }, [n[5] ||= A("div", {
1479
+ }, "●", 8, Cr)) : O("", !0)
1480
+ ], 42, br))), 128)),
1481
+ e.textActions && e.textActions.length > 0 ? (L(), k(T, { key: 2 }, [n[5] ||= A("div", {
1613
1482
  class: "image-ctx-menu__divider",
1614
1483
  role: "separator"
1615
- }, null, -1), (R(!0), k(w, null, le(e.textActions, (e, t) => (R(), k(w, { key: `${e.action}-${t}` }, [A("button", {
1484
+ }, null, -1), (L(!0), k(T, null, de(e.textActions, (e, t) => (L(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1616
1485
  type: "button",
1617
1486
  role: "menuitem",
1618
1487
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1619
1488
  disabled: e.disabled,
1620
- onMousedown: n[3] ||= q(() => {}, ["prevent"]),
1489
+ onMousedown: n[3] ||= K(() => {}, ["prevent"]),
1621
1490
  onClick: (t) => g(e)
1622
- }, [A("span", hr, B(e.label), 1), e.shortcut ? (R(), k("span", gr, B(e.shortcut), 1)) : O("", !0)], 40, mr), e.dividerAfter ? (R(), k("div", _r)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1623
- ], 44, or)) : O("", !0)]));
1491
+ }, [A("span", Tr, B(e.label), 1), e.shortcut ? (L(), k("span", Er, B(e.shortcut), 1)) : O("", !0)], 40, wr), e.dividerAfter ? (L(), k("div", Dr)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1492
+ ], 44, gr)) : O("", !0)]));
1624
1493
  }
1625
- }), [["__scopeId", "data-v-5c21ca8c"]]), Sr = /* @__PURE__ */ N({
1494
+ }), [["__scopeId", "data-v-5c21ca8c"]]), Mr = /* @__PURE__ */ M({
1626
1495
  __name: "DocxEditorOverlays",
1627
1496
  props: {
1628
1497
  readOnly: { type: Boolean },
@@ -1640,7 +1509,7 @@ var Ft = /* @__PURE__ */ N({
1640
1509
  ],
1641
1510
  setup(e, { emit: t }) {
1642
1511
  let n = t;
1643
- return (t, r) => (R(), k(w, null, [M(ar, {
1512
+ return (t, r) => (L(), k(T, null, [j(hr, {
1644
1513
  "is-open": e.contextMenu.isOpen,
1645
1514
  position: e.contextMenu.position,
1646
1515
  "has-selection": e.contextMenu.hasSelection,
@@ -1660,7 +1529,7 @@ var Ft = /* @__PURE__ */ N({
1660
1529
  "on-image",
1661
1530
  "can-merge-cells",
1662
1531
  "can-split-cell"
1663
- ]), M(xr, {
1532
+ ]), j(jr, {
1664
1533
  state: e.imageContextMenu,
1665
1534
  "text-actions": e.imageContextMenuTextActions,
1666
1535
  "can-open-properties": e.canOpenImageProperties,
@@ -1674,7 +1543,7 @@ var Ft = /* @__PURE__ */ N({
1674
1543
  "can-open-properties"
1675
1544
  ])], 64));
1676
1545
  }
1677
- }), Cr = ["href", "title"], wr = ["title"], Tr = ["title"], Er = ["title"], Dr = { class: "docx-hyperlink-popup__edit-row" }, Or = ["placeholder", "onKeydown"], kr = { class: "docx-hyperlink-popup__edit-row" }, Ar = ["onKeydown"], jr = ["disabled"], Mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1546
+ }), Nr = ["href", "title"], Pr = ["title"], Fr = ["title"], Ir = ["title"], Lr = { class: "docx-hyperlink-popup__edit-row" }, Rr = ["placeholder", "onKeydown"], zr = { class: "docx-hyperlink-popup__edit-row" }, Br = ["onKeydown"], Vr = ["disabled"], Hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1678
1547
  __name: "HyperlinkPopup",
1679
1548
  props: {
1680
1549
  data: {},
@@ -1688,25 +1557,25 @@ var Ft = /* @__PURE__ */ N({
1688
1557
  "close"
1689
1558
  ],
1690
1559
  setup(e, { emit: t }) {
1691
- let { t: r } = n(), i = e, a = t, o = z(!1), s = z(""), c = z(""), l = z(null), u = E(() => ({
1560
+ let { t: r } = n(), i = e, a = t, o = R(!1), s = R(""), c = R(""), l = R(null), u = D(() => ({
1692
1561
  left: (i.data?.position.left ?? 0) + "px",
1693
1562
  top: (i.data?.position.top ?? 0) + "px"
1694
1563
  }));
1695
- W(() => i.data?.href, () => {
1564
+ U(() => i.data?.href, () => {
1696
1565
  o.value = !1;
1697
1566
  });
1698
1567
  let d = null, f = null;
1699
1568
  function p() {
1700
1569
  f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
1701
1570
  }
1702
- W(() => i.data, (e) => {
1571
+ U(() => i.data, (e) => {
1703
1572
  p(), e && (d = (e) => {
1704
1573
  let t = l.value;
1705
1574
  t && !t.contains(e.target) && a("close");
1706
1575
  }, f = setTimeout(() => {
1707
1576
  d && document.addEventListener("mousedown", d);
1708
1577
  }, 0));
1709
- }, { immediate: !0 }), I(p);
1578
+ }, { immediate: !0 }), F(p);
1710
1579
  function m() {
1711
1580
  i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
1712
1581
  }
@@ -1716,40 +1585,40 @@ var Ft = /* @__PURE__ */ N({
1716
1585
  function g() {
1717
1586
  i.data && (a("copy", i.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(i.data.href).catch(() => {}));
1718
1587
  }
1719
- return (t, n) => e.data ? (R(), k("div", {
1588
+ return (t, n) => e.data ? (L(), k("div", {
1720
1589
  key: 0,
1721
1590
  ref_key: "popupRef",
1722
1591
  ref: l,
1723
- class: P(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1724
- style: F(u.value),
1725
- onMousedown: n[6] ||= q(() => {}, ["stop"])
1726
- }, [o.value ? (R(), k(w, { key: 1 }, [A("div", Dr, [G(A("input", {
1592
+ class: N(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1593
+ style: P(u.value),
1594
+ onMousedown: n[6] ||= K(() => {}, ["stop"])
1595
+ }, [o.value ? (L(), k(T, { key: 1 }, [A("div", Lr, [W(A("input", {
1727
1596
  class: "docx-hyperlink-popup__input",
1728
1597
  placeholder: V(r)("hyperlinkPopup.displayTextPlaceholder"),
1729
1598
  "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
1730
- onKeydown: [K(q(h, ["prevent"]), ["enter"]), n[3] ||= K((e) => t.$emit("close"), ["esc"])]
1731
- }, null, 40, Or), [[U, s.value]])]), A("div", kr, [G(A("input", {
1599
+ onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[3] ||= G((e) => t.$emit("close"), ["esc"])]
1600
+ }, null, 40, Rr), [[H, s.value]])]), A("div", zr, [W(A("input", {
1732
1601
  class: "docx-hyperlink-popup__input",
1733
1602
  placeholder: "https://...",
1734
1603
  "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1735
- onKeydown: [K(q(h, ["prevent"]), ["enter"]), n[5] ||= K((e) => t.$emit("close"), ["esc"])]
1736
- }, null, 40, Ar), [[U, c.value]]), A("button", {
1604
+ onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[5] ||= G((e) => t.$emit("close"), ["esc"])]
1605
+ }, null, 40, Br), [[H, c.value]]), A("button", {
1737
1606
  class: "docx-hyperlink-popup__apply",
1738
1607
  disabled: !c.value.trim(),
1739
- onClick: q(h, ["prevent"])
1740
- }, B(V(r)("common.apply")), 9, jr)])], 64)) : (R(), k(w, { key: 0 }, [
1741
- n[10] ||= ae("<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),
1608
+ onClick: K(h, ["prevent"])
1609
+ }, B(V(r)("common.apply")), 9, Vr)])], 64)) : (L(), k(T, { key: 0 }, [
1610
+ n[10] ||= oe("<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),
1742
1611
  A("a", {
1743
1612
  class: "docx-hyperlink-popup__url",
1744
1613
  href: e.data.href,
1745
1614
  title: e.data.href,
1746
- onClick: n[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
1747
- }, B(e.data.href), 9, Cr),
1615
+ onClick: n[0] ||= K((n) => t.$emit("navigate", e.data.href), ["prevent"])
1616
+ }, B(e.data.href), 9, Nr),
1748
1617
  n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1749
1618
  A("button", {
1750
1619
  class: "docx-hyperlink-popup__btn",
1751
1620
  title: V(r)("hyperlinkPopup.copyLink"),
1752
- onClick: q(g, ["prevent"])
1621
+ onClick: K(g, ["prevent"])
1753
1622
  }, [...n[7] ||= [A("svg", {
1754
1623
  width: "18",
1755
1624
  height: "18",
@@ -1766,12 +1635,12 @@ var Ft = /* @__PURE__ */ N({
1766
1635
  height: "13",
1767
1636
  rx: "2",
1768
1637
  ry: "2"
1769
- }), 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, wr),
1770
- e.readOnly ? O("", !0) : (R(), k("button", {
1638
+ }), 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, Pr),
1639
+ e.readOnly ? O("", !0) : (L(), k("button", {
1771
1640
  key: 0,
1772
1641
  class: "docx-hyperlink-popup__btn",
1773
1642
  title: V(r)("hyperlinkPopup.editLink"),
1774
- onClick: q(m, ["prevent"])
1643
+ onClick: K(m, ["prevent"])
1775
1644
  }, [...n[8] ||= [A("svg", {
1776
1645
  width: "18",
1777
1646
  height: "18",
@@ -1781,26 +1650,26 @@ var Ft = /* @__PURE__ */ N({
1781
1650
  "stroke-width": "2",
1782
1651
  "stroke-linecap": "round",
1783
1652
  "stroke-linejoin": "round"
1784
- }, [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, Tr)),
1785
- e.readOnly ? O("", !0) : (R(), k("button", {
1653
+ }, [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, Fr)),
1654
+ e.readOnly ? O("", !0) : (L(), k("button", {
1786
1655
  key: 1,
1787
1656
  class: "docx-hyperlink-popup__btn",
1788
1657
  title: V(r)("hyperlinkPopup.removeLink"),
1789
- onClick: n[1] ||= q((e) => t.$emit("remove"), ["prevent"])
1790
- }, [...n[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-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, Er))
1658
+ onClick: n[1] ||= K((e) => t.$emit("remove"), ["prevent"])
1659
+ }, [...n[9] ||= [oe("<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, Ir))
1791
1660
  ], 64))], 38)) : O("", !0);
1792
1661
  }
1793
1662
  }), [["__scopeId", "data-v-9d23bb12"]]);
1794
1663
  //#endregion
1795
1664
  //#region src/composables/useFileIO.ts
1796
- function Nr(e) {
1797
- let t = z(null);
1665
+ function Ur(e) {
1666
+ let t = R(null);
1798
1667
  async function n() {
1799
1668
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1800
1669
  }
1801
1670
  async function r(t) {
1802
1671
  try {
1803
- let r = await we(t);
1672
+ let r = await ze(t);
1804
1673
  if (!r) return;
1805
1674
  await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1806
1675
  } catch (t) {
@@ -1839,8 +1708,8 @@ function Nr(e) {
1839
1708
  }
1840
1709
  //#endregion
1841
1710
  //#region src/composables/useHyperlinkManagement.ts
1842
- function Pr(e) {
1843
- let t = z(null);
1711
+ function Wr(e) {
1712
+ let t = R(null);
1844
1713
  function n(t) {
1845
1714
  let n = e.editorView.value;
1846
1715
  if (!n) return;
@@ -1868,7 +1737,7 @@ function Pr(e) {
1868
1737
  function a(n, r) {
1869
1738
  let i = e.editorView.value;
1870
1739
  if (!i) return;
1871
- let a = Oe(i.state);
1740
+ let a = Ue(i.state);
1872
1741
  if (!a) {
1873
1742
  t.value = null;
1874
1743
  return;
@@ -1882,7 +1751,7 @@ function Pr(e) {
1882
1751
  function o() {
1883
1752
  let n = e.editorView.value;
1884
1753
  if (!n) return;
1885
- let r = Oe(n.state, t.value?.href);
1754
+ let r = Ue(n.state, t.value?.href);
1886
1755
  if (!r) {
1887
1756
  t.value = null;
1888
1757
  return;
@@ -1901,27 +1770,27 @@ function Pr(e) {
1901
1770
  }
1902
1771
  //#endregion
1903
1772
  //#region src/composables/useFormattingActions.ts
1904
- function Fr(e) {
1773
+ function Gr(e) {
1905
1774
  function t() {
1906
1775
  let t = e.editorView.value;
1907
- t && (De(t.state, t.dispatch, t), t.focus());
1776
+ t && (He(t.state, t.dispatch, t), t.focus());
1908
1777
  }
1909
1778
  function n(t) {
1910
1779
  let n = e.editorView.value;
1911
1780
  if (!n) return;
1912
1781
  let r = e.getDocument()?.package?.styles;
1913
1782
  if (r) {
1914
- let e = it(r).resolveParagraphStyle(t);
1915
- $e(t, {
1783
+ let e = pt(r).resolveParagraphStyle(t);
1784
+ ct(t, {
1916
1785
  paragraphFormatting: e.paragraphFormatting,
1917
1786
  runFormatting: e.runFormatting
1918
1787
  })(n.state, (e) => n.dispatch(e));
1919
- } else $e(t)(n.state, (e) => n.dispatch(e));
1788
+ } else ct(t)(n.state, (e) => n.dispatch(e));
1920
1789
  n.focus();
1921
1790
  }
1922
1791
  function r() {
1923
1792
  let t = e.editorView.value;
1924
- t && (at(t.state, (e) => t.dispatch(e), t), t.focus());
1793
+ t && (mt(t.state, (e) => t.dispatch(e), t), t.focus());
1925
1794
  }
1926
1795
  function i(t) {
1927
1796
  let n = e.editorView.value;
@@ -1931,46 +1800,13 @@ function Fr(e) {
1931
1800
  }
1932
1801
  function a(t) {
1933
1802
  let n = e.editorView.value;
1934
- if (!n) return !1;
1935
- let r = St(n.state.doc, t.paraId);
1936
- if (!r) return !1;
1937
- let i = r.from + 1, a = r.to - 1;
1938
- if (t.search) {
1939
- let e = Tt(n.state.doc, r.from, r.to, t.search);
1940
- if (!e) return !1;
1941
- i = e.from, a = e.to;
1942
- }
1943
- if (i >= a) return !0;
1944
- let { schema: o } = n.state, s = t.marks, c = n.state.tr;
1945
- if (s.bold !== void 0 && o.marks.bold && (c = s.bold ? c.addMark(i, a, o.marks.bold.create()) : c.removeMark(i, a, o.marks.bold)), s.italic !== void 0 && o.marks.italic && (c = s.italic ? c.addMark(i, a, o.marks.italic.create()) : c.removeMark(i, a, o.marks.italic)), s.underline !== void 0 && o.marks.underline) if (s.underline) {
1946
- let e = typeof s.underline == "object" ? s.underline.style : void 0;
1947
- c = c.addMark(i, a, o.marks.underline.create({ style: e ?? "single" }));
1948
- } else c = c.removeMark(i, a, o.marks.underline);
1949
- return s.strike !== void 0 && o.marks.strike && (c = s.strike ? c.addMark(i, a, o.marks.strike.create()) : c.removeMark(i, a, o.marks.strike)), s.color !== void 0 && o.marks.textColor && (c = s.color && (s.color.rgb || s.color.themeColor) ? c.addMark(i, a, o.marks.textColor.create({
1950
- rgb: s.color.rgb ?? null,
1951
- themeColor: s.color.themeColor ?? null
1952
- })) : c.removeMark(i, a, o.marks.textColor)), s.highlight !== void 0 && o.marks.highlight && (c = s.highlight ? c.addMark(i, a, o.marks.highlight.create({ color: ot(s.highlight) || s.highlight })) : c.removeMark(i, a, o.marks.highlight)), s.fontSize !== void 0 && o.marks.fontSize && (c = s.fontSize > 0 ? c.addMark(i, a, o.marks.fontSize.create({ size: Je(s.fontSize) })) : c.removeMark(i, a, o.marks.fontSize)), s.fontFamily !== void 0 && o.marks.fontFamily && (c = s.fontFamily && (s.fontFamily.ascii || s.fontFamily.hAnsi) ? c.addMark(i, a, o.marks.fontFamily.create({
1953
- ascii: s.fontFamily.ascii ?? null,
1954
- hAnsi: s.fontFamily.hAnsi ?? s.fontFamily.ascii ?? null
1955
- })) : c.removeMark(i, a, o.marks.fontFamily)), n.dispatch(c), !0;
1803
+ return n ? ht(n, t) : !1;
1956
1804
  }
1957
1805
  function o(t) {
1958
1806
  let n = e.editorView.value;
1959
1807
  if (!n) return !1;
1960
- let r = St(n.state.doc, t.paraId);
1961
- if (!r) return !1;
1962
- let i = e.getDocument(), a = i?.package?.styles ? it(i.package.styles) : null;
1963
- if (a && !a.hasParagraphStyle(t.styleId)) return !1;
1964
- let o = n.state.doc.resolve(r.from + 1), s = n.state.doc.resolve(r.to - 1), c = n.state.apply(n.state.tr.setSelection(he.between(o, s))), l = a ? (() => {
1965
- let e = a.resolveParagraphStyle(t.styleId);
1966
- return $e(t.styleId, {
1967
- paragraphFormatting: e.paragraphFormatting,
1968
- runFormatting: e.runFormatting
1969
- });
1970
- })() : $e(t.styleId), u = !1;
1971
- return l(c, (e) => {
1972
- u = !0, e.setSelection(n.state.selection.map(e.doc, e.mapping)), n.dispatch(e);
1973
- }), u;
1808
+ let r = e.getDocument();
1809
+ return gt(n, t, { styleResolver: r?.package?.styles ? pt(r.package.styles) : null });
1974
1810
  }
1975
1811
  return {
1976
1812
  handleClearFormatting: t,
@@ -1983,7 +1819,7 @@ function Fr(e) {
1983
1819
  }
1984
1820
  //#endregion
1985
1821
  //#region src/composables/usePageSetupControls.ts
1986
- function Ir(e) {
1822
+ function Kr(e) {
1987
1823
  function t(t) {
1988
1824
  let n = e.getDocument();
1989
1825
  if (!n?.package?.document) return;
@@ -2010,19 +1846,19 @@ function Ir(e) {
2010
1846
  }
2011
1847
  function s(t) {
2012
1848
  let n = e.editorView.value;
2013
- n && nt(t)(n.state, n.dispatch);
1849
+ n && dt(t)(n.state, n.dispatch);
2014
1850
  }
2015
1851
  function c(t) {
2016
1852
  let n = e.editorView.value;
2017
- n && rt(t)(n.state, n.dispatch);
1853
+ n && ft(t)(n.state, n.dispatch);
2018
1854
  }
2019
1855
  function l(t) {
2020
1856
  let n = e.editorView.value;
2021
- n && (t < 0 ? tt(-t, !0)(n.state, n.dispatch) : tt(t, !1)(n.state, n.dispatch));
1857
+ n && (t < 0 ? ut(-t, !0)(n.state, n.dispatch) : ut(t, !1)(n.state, n.dispatch));
2022
1858
  }
2023
1859
  function u(t) {
2024
1860
  let n = e.editorView.value;
2025
- n && et(t)(n.state, n.dispatch);
1861
+ n && lt(t)(n.state, n.dispatch);
2026
1862
  }
2027
1863
  return {
2028
1864
  handlePageSetupApply: t,
@@ -2038,16 +1874,16 @@ function Ir(e) {
2038
1874
  }
2039
1875
  //#endregion
2040
1876
  //#region src/composables/useWatermarkControls.ts
2041
- function Lr(e) {
2042
- let t = z(!1), n = E(() => {
1877
+ function qr(e) {
1878
+ let t = R(!1), n = D(() => {
2043
1879
  e.stateTick.value;
2044
1880
  let t = e.editorView.value;
2045
- return t ? lt(t.state) ?? void 0 : void 0;
1881
+ return t ? yt(t.state) ?? void 0 : void 0;
2046
1882
  });
2047
1883
  function r(t) {
2048
1884
  if (e.readOnly.value) return;
2049
1885
  let n = e.editorView.value;
2050
- n && (pt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1886
+ n && (Ct(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
2051
1887
  }
2052
1888
  return {
2053
1889
  showWatermark: t,
@@ -2057,18 +1893,18 @@ function Lr(e) {
2057
1893
  }
2058
1894
  //#endregion
2059
1895
  //#region src/composables/useOutlineSidebar.ts
2060
- function Rr(e) {
1896
+ function Jr(e) {
2061
1897
  function t() {
2062
1898
  if (!e.showOutline.value) {
2063
1899
  let t = e.editorView.value;
2064
- t && (e.outlineHeadings.value = mt(t.state.doc));
1900
+ t && (e.outlineHeadings.value = wt(t.state.doc));
2065
1901
  }
2066
1902
  e.showOutline.value = !e.showOutline.value;
2067
1903
  }
2068
1904
  function n(t) {
2069
1905
  let n = e.editorView.value;
2070
1906
  if (!n) return;
2071
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = he.near(r);
1907
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = J.near(r);
2072
1908
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
2073
1909
  }
2074
1910
  function r() {
@@ -2087,7 +1923,7 @@ function Rr(e) {
2087
1923
  }
2088
1924
  //#endregion
2089
1925
  //#region src/composables/useKeyboardShortcuts.ts
2090
- function zr(e) {
1926
+ function Yr(e) {
2091
1927
  function t(t) {
2092
1928
  if (t.key === "F1") {
2093
1929
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -2095,166 +1931,136 @@ function zr(e) {
2095
1931
  }
2096
1932
  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)));
2097
1933
  }
2098
- return L(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2099
- }
2100
- //#endregion
2101
- //#region src/utils/commentFactories.ts
2102
- function Br(e, t, n, r) {
2103
- return {
2104
- id: e.reduce((e, t) => Math.max(e, t.id), 0) + 1,
2105
- author: n,
2106
- date: (/* @__PURE__ */ new Date()).toISOString(),
2107
- content: [{
2108
- type: "paragraph",
2109
- properties: {},
2110
- content: [{
2111
- type: "run",
2112
- properties: {},
2113
- content: [{
2114
- type: "text",
2115
- text: t
2116
- }]
2117
- }]
2118
- }],
2119
- ...r == null ? {} : { parentId: r }
2120
- };
1934
+ return I(() => window.addEventListener("keydown", t)), F(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2121
1935
  }
2122
1936
  //#endregion
2123
1937
  //#region src/composables/useCommentManagement.ts
2124
- function Vr(e) {
2125
- function t(t, n, r) {
2126
- return Br(e.getDocument()?.package?.document?.comments ?? [], t, n, r);
2127
- }
2128
- function n(n) {
2129
- let r = e.getDocument(), i = e.editorView.value;
2130
- if (!r?.package?.document || !i) return null;
2131
- r.package.document.comments || (r.package.document.comments = []);
2132
- let a = i.state.schema.marks.comment;
2133
- if (!a) return null;
2134
- let o = St(i.state.doc, n.paraId);
2135
- if (!o) return null;
2136
- let s = o.from + 1, c = o.to - 1;
2137
- if (n.search) {
2138
- let e = Tt(i.state.doc, o.from, o.to, n.search);
2139
- if (!e) return null;
2140
- s = e.from, c = e.to;
2141
- }
2142
- if (s >= c) return null;
2143
- let l = t(n.text, n.author);
2144
- return r.package.document.comments.push(l), e.comments.value = [...r.package.document.comments], i.dispatch(i.state.tr.addMark(s, c, a.create({ commentId: l.id }))), e.showSidebar.value = !0, e.emit("change", r), e.contentChangeSubscribers.forEach((e) => e(r)), l.id;
1938
+ function Xr(e) {
1939
+ let t = () => V(e.author) ?? "User";
1940
+ function n(t) {
1941
+ e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
2145
1942
  }
2146
- function r(n, r, i) {
2147
- let a = e.getDocument();
2148
- if (!a?.package?.document?.comments || !a.package.document.comments.some((e) => e.id === n)) return null;
2149
- let o = t(r, i, n);
2150
- return a.package.document.comments.push(o), e.comments.value = [...a.package.document.comments], e.emit("change", a), e.contentChangeSubscribers.forEach((e) => e(a)), o.id;
1943
+ function r() {
1944
+ At(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
2151
1945
  }
2152
- function i(t) {
2153
- let n = e.getDocument();
2154
- if (!n?.package?.document?.comments) return;
2155
- let r = n.package.document.comments.find((e) => e.id === t);
2156
- r && (r.done = !0, e.comments.value = [...n.package.document.comments], e.emit("change", n), e.contentChangeSubscribers.forEach((e) => e(n)));
1946
+ function i(t, n, i) {
1947
+ return r(), Dt(e.commentIdAllocator, t, n, i);
2157
1948
  }
2158
1949
  function a(t) {
2159
- let n = e.editorView.value;
2160
- if (!n) return !1;
2161
- let { schema: r } = n.state;
2162
- if (!r.marks.deletion || !r.marks.insertion) return !1;
2163
- let i = St(n.state.doc, t.paraId);
2164
- if (!i) return !1;
2165
- let a = t.search === "", o = t.replaceWith === "";
2166
- if (a && o) return !1;
2167
- let s, c;
2168
- if (a) s = i.to - 1, c = i.to - 1;
2169
- else {
2170
- let e = Tt(n.state.doc, i.from, i.to, t.search);
2171
- if (!e) return !1;
2172
- s = e.from, c = e.to;
2173
- }
2174
- let l = !1;
2175
- if (s < c && n.state.doc.nodesBetween(s, c, (e) => {
2176
- for (let t of e.marks) if (t.type === r.marks.insertion || t.type === r.marks.deletion) return l = !0, !1;
2177
- return !0;
2178
- }), l) return !1;
2179
- let u = Math.max(0, ...e.trackedChanges.value.map((e) => e.revisionId)) + 1, d = (/* @__PURE__ */ new Date()).toISOString(), f = r.marks.deletion.create({
2180
- revisionId: u,
2181
- author: t.author,
2182
- date: d
2183
- }), p = r.marks.insertion.create({
2184
- revisionId: u,
2185
- author: t.author,
2186
- date: d
2187
- }), m = n.state.tr;
2188
- return a || (m = m.addMark(s, c, f)), o || (m = m.insert(c, r.text(t.replaceWith, [p]))), n.dispatch(m), e.extractCommentsAndChanges(), e.showSidebar.value = !0, !0;
2189
- }
2190
- function o(e, t) {
2191
- r(e, t, "User");
1950
+ let i = e.getDocument(), a = e.editorView.value;
1951
+ if (!i?.package?.document || !a) return null;
1952
+ i.package.document.comments || (i.package.document.comments = []), r();
1953
+ let o = Tt(a, t, e.commentIdAllocator);
1954
+ 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;
1955
+ }
1956
+ function o(t, r, a) {
1957
+ let o = e.getDocument();
1958
+ if (!o?.package?.document?.comments || !o.package.document.comments.some((e) => e.id === t)) return null;
1959
+ let s = i(r, a, t);
1960
+ return o.package.document.comments.push(s), n([...o.package.document.comments]), e.emit("change", o), e.contentChangeSubscribers.forEach((e) => e(o)), s.id;
2192
1961
  }
2193
1962
  function s(t) {
2194
- let n = e.getDocument();
2195
- if (!n?.package?.document?.comments) return;
2196
- let r = n.package.document.comments.find((e) => e.id === t);
2197
- r && (r.done = !1), e.comments.value = [...n.package.document.comments], e.emit("change", n);
1963
+ let r = e.getDocument();
1964
+ if (!r?.package?.document?.comments) return;
1965
+ let i = r.package.document.comments.find((e) => e.id === t);
1966
+ i && (i.done = !0, n([...r.package.document.comments]), e.emit("change", r), e.contentChangeSubscribers.forEach((e) => e(r)));
2198
1967
  }
2199
1968
  function c(t) {
2200
- let n = e.getDocument();
2201
- n?.package?.document?.comments && (n.package.document.comments = n.package.document.comments.filter((e) => e.id !== t && e.parentId !== t), e.comments.value = [...n.package.document.comments], e.emit("change", n));
1969
+ let n = e.editorView.value;
1970
+ if (!n) return !1;
1971
+ r();
1972
+ let i = Et(n, t, e.commentIdAllocator);
1973
+ return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
1974
+ }
1975
+ function l(n, r) {
1976
+ let i = e.getDocument(), a = i?.package?.document?.comments?.find((e) => e.id === n), s = o(n, r, t());
1977
+ if (s == null || !a) return;
1978
+ let c = i?.package?.document?.comments?.find((e) => e.id === s);
1979
+ c && e.commentCallbacks?.onCommentReply?.(c, a);
2202
1980
  }
2203
- function l(t, n) {
1981
+ function u(t) {
1982
+ let n = e.getDocument()?.package?.document?.comments?.find((e) => e.id === t);
1983
+ s(t), n && e.commentCallbacks?.onCommentResolve?.({ ...n });
1984
+ }
1985
+ function d(t) {
1986
+ let r = e.getDocument();
1987
+ if (!r?.package?.document?.comments) return;
1988
+ let i = r.package.document.comments.find((e) => e.id === t);
1989
+ i && (i.done = !1), n([...r.package.document.comments]), e.emit("change", r);
1990
+ }
1991
+ function f(t) {
1992
+ let r = e.getDocument();
1993
+ if (!r?.package?.document?.comments) return;
1994
+ let i = r.package.document.comments.find((e) => e.id === t);
1995
+ r.package.document.comments = r.package.document.comments.filter((e) => e.id !== t && e.parentId !== t), n([...r.package.document.comments]), i && e.commentCallbacks?.onCommentDelete?.(i), e.emit("change", r);
1996
+ }
1997
+ function p(t, n) {
2204
1998
  let r = e.editorView.value;
2205
- r && (st(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1999
+ r && (_t(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2206
2000
  }
2207
- function u(t, n) {
2001
+ function m(t, n) {
2208
2002
  let r = e.editorView.value;
2209
- r && (dt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2003
+ r && (xt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2210
2004
  }
2211
- function d(t) {
2005
+ function h(t) {
2212
2006
  let n = e.editorView.value;
2213
- n && (ct(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2007
+ n && (vt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2214
2008
  }
2215
- function f(t) {
2009
+ function g(t) {
2216
2010
  let n = e.editorView.value;
2217
- n && (ft(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2011
+ n && (St(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2218
2012
  }
2219
- function p(n, r) {
2220
- let i = e.getDocument(), a = e.editorView.value;
2221
- if (!i?.package?.document || !a) return;
2222
- i.package.document.comments || (i.package.document.comments = []);
2223
- let o = a.state.schema.marks.comment;
2224
- if (!o) return;
2225
- let s = null, c = a.state.schema.marks.insertion, l = a.state.schema.marks.deletion;
2226
- if (a.state.doc.descendants((e, t) => {
2227
- if (s !== null) return !1;
2228
- for (let r of e.marks) if ((r.type === c || r.type === l) && r.attrs.revisionId === n) return s = t, !1;
2013
+ function _(r, a) {
2014
+ let o = e.getDocument(), s = e.editorView.value;
2015
+ if (!o?.package?.document || !s) return;
2016
+ o.package.document.comments || (o.package.document.comments = []);
2017
+ let c = s.state.schema.marks.comment;
2018
+ if (!c) return;
2019
+ let l = null, u = s.state.schema.marks.insertion, d = s.state.schema.marks.deletion;
2020
+ if (s.state.doc.descendants((e, t) => {
2021
+ if (l !== null) return !1;
2022
+ for (let n of e.marks) if ((n.type === u || n.type === d) && n.attrs.revisionId === r) return l = t, !1;
2229
2023
  return !0;
2230
- }), s === null) return;
2231
- let u = t(r, "User");
2232
- i.package.document.comments.push(u), e.comments.value = [...i.package.document.comments];
2233
- let d = s, f = Math.min(d + 1, a.state.doc.content.size);
2234
- a.dispatch(a.state.tr.addMark(d, f, o.create({ commentId: u.id }))), e.emit("change", i);
2024
+ }), l === null) return;
2025
+ let f = i(a, t());
2026
+ o.package.document.comments.push(f), n([...o.package.document.comments]);
2027
+ let p = l, m = Math.min(p + 1, s.state.doc.content.size);
2028
+ s.dispatch(s.state.tr.addMark(p, m, c.create({ commentId: f.id }))), e.emit("change", o);
2235
2029
  }
2236
2030
  return {
2237
- addComment: n,
2238
- replyToComment: r,
2239
- resolveComment: i,
2240
- proposeChange: a,
2241
- handleCommentReply: o,
2242
- handleCommentUnresolve: s,
2243
- handleCommentDelete: c,
2244
- handleAcceptChange: l,
2245
- handleRejectChange: u,
2246
- handleAcceptChangeById: d,
2247
- handleRejectChangeById: f,
2248
- handleTrackedChangeReply: p
2031
+ addComment: a,
2032
+ replyToComment: o,
2033
+ resolveComment: s,
2034
+ proposeChange: c,
2035
+ handleCommentReply: l,
2036
+ handleCommentResolve: u,
2037
+ handleCommentUnresolve: d,
2038
+ handleCommentDelete: f,
2039
+ handleAcceptChange: p,
2040
+ handleRejectChange: m,
2041
+ handleAcceptChangeById: h,
2042
+ handleRejectChangeById: g,
2043
+ handleTrackedChangeReply: _
2249
2044
  };
2250
2045
  }
2251
2046
  //#endregion
2047
+ //#region src/composables/useHostCallbacks.ts
2048
+ function Zr(e, t) {
2049
+ return U(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2050
+ onCommentAdd: (t) => e.onCommentAdd?.(t),
2051
+ onCommentResolve: (t) => e.onCommentResolve?.(t),
2052
+ onCommentDelete: (t) => e.onCommentDelete?.(t),
2053
+ onCommentReply: (t, n) => e.onCommentReply?.(t, n),
2054
+ onCommentsChange: (t) => e.onCommentsChange?.(t)
2055
+ } };
2056
+ }
2057
+ //#endregion
2252
2058
  //#region src/composables/useCommentLifecycle.ts
2253
- function Hr(e) {
2254
- let t = z(null), n = z(null), r = z(null), i = z(!1);
2059
+ function Qr(e) {
2060
+ let t = R(null), n = R(null), r = R(null), i = R(!1);
2255
2061
  function a() {
2256
2062
  let t = e.getDocument(), n = e.editorView.value;
2257
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = ht(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2063
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = jt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2258
2064
  }
2259
2065
  function o() {
2260
2066
  e.stateTick.value;
@@ -2273,7 +2079,7 @@ function Hr(e) {
2273
2079
  t.value = null;
2274
2080
  return;
2275
2081
  }
2276
- let s = o.getBoundingClientRect(), c = At(a, r);
2082
+ let s = o.getBoundingClientRect(), c = Bt(a, r);
2277
2083
  if (!c) {
2278
2084
  t.value = null;
2279
2085
  return;
@@ -2301,7 +2107,7 @@ function Hr(e) {
2301
2107
  for (let t of r) {
2302
2108
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2303
2109
  let n = t.attrs.commentId;
2304
- if (n === -1 || e.resolvedCommentIds.value.has(n)) continue;
2110
+ if (n === Ot || e.resolvedCommentIds.value.has(n)) continue;
2305
2111
  i = `comment-${n}`;
2306
2112
  break;
2307
2113
  }
@@ -2326,7 +2132,7 @@ function Hr(e) {
2326
2132
  }, r.value = t.value?.top ?? null;
2327
2133
  let s = i.state.schema.marks.comment;
2328
2134
  if (s) {
2329
- let e = i.state.tr.addMark(a, o, s.create({ commentId: -1 }));
2135
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: Ot }));
2330
2136
  i.dispatch(e);
2331
2137
  }
2332
2138
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2334,9 +2140,9 @@ function Hr(e) {
2334
2140
  function l(t) {
2335
2141
  let i = e.getDocument(), a = e.editorView.value;
2336
2142
  if (!i?.package) return;
2337
- i.package.document.comments || (i.package.document.comments = []);
2338
- let o = Br(i.package.document.comments, t, "User");
2339
- i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments];
2143
+ i.package.document.comments || (i.package.document.comments = []), At(e.commentIdAllocator, i.package.document.comments, a);
2144
+ let o = Dt(e.commentIdAllocator, t, V(e.author) ?? "User");
2145
+ i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2340
2146
  let s = n.value;
2341
2147
  if (a && s && s.from !== s.to) {
2342
2148
  let e = a.state.schema.marks.comment;
@@ -2358,15 +2164,15 @@ function Hr(e) {
2358
2164
  function d(t) {
2359
2165
  e.showSidebar.value = !0;
2360
2166
  }
2361
- W([
2167
+ U([
2362
2168
  e.stateTick,
2363
2169
  e.isAddingComment,
2364
2170
  e.zoom
2365
- ], () => o()), W(e.stateTick, () => s()), W(e.stateTick, () => a());
2171
+ ], () => o()), U(e.stateTick, () => s()), U(e.stateTick, () => a());
2366
2172
  let f = null;
2367
- return L(() => {
2173
+ return I(() => {
2368
2174
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2369
- }), I(() => {
2175
+ }), F(() => {
2370
2176
  f?.disconnect(), window.removeEventListener("resize", o);
2371
2177
  }), {
2372
2178
  floatingCommentBtn: t,
@@ -2384,8 +2190,8 @@ function Hr(e) {
2384
2190
  }
2385
2191
  //#endregion
2386
2192
  //#region src/composables/useImageActions.ts
2387
- function Ur(e) {
2388
- let t = fe(null), n = z(!1), r = E(() => {
2193
+ function $r(e) {
2194
+ let t = z(null), n = R(!1), r = D(() => {
2389
2195
  e.stateTick.value;
2390
2196
  let n = e.editorView.value, r = t.value;
2391
2197
  if (!n || !r) return null;
@@ -2407,14 +2213,14 @@ function Ur(e) {
2407
2213
  width: t.width,
2408
2214
  height: t.height
2409
2215
  });
2410
- ut(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2216
+ bt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2411
2217
  }
2412
2218
  function a(n) {
2413
2219
  let r = e.editorView.value, i = t.value;
2414
2220
  if (!r || !i) return;
2415
- let a = Re(n);
2221
+ let a = nt(n);
2416
2222
  if (!a) return;
2417
- let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Ne(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2223
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Qe(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2418
2224
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
2419
2225
  }
2420
2226
  function o(n) {
@@ -2443,8 +2249,8 @@ function Ur(e) {
2443
2249
  }
2444
2250
  //#endregion
2445
2251
  //#region src/utils/imageClipboard.ts
2446
- function Wr(e, t, n) {
2447
- let r = Ze(e.state), i = e.state.schema.marks.insertion;
2252
+ function ei(e, t, n) {
2253
+ let r = ot(e.state), i = e.state.schema.marks.insertion;
2448
2254
  if (!r || !i) return;
2449
2255
  let a = t.selection.from, o = a - n.nodeSize;
2450
2256
  o < 0 || t.addMark(o, a, i.create({
@@ -2453,10 +2259,10 @@ function Wr(e, t, n) {
2453
2259
  date: r.date
2454
2260
  }));
2455
2261
  }
2456
- function Gr(e, t) {
2262
+ function ti(e, t) {
2457
2263
  return e.getBlob(t);
2458
2264
  }
2459
- function Kr(e, t) {
2265
+ function ni(e, t) {
2460
2266
  let n = e.state.doc.nodeAt(t);
2461
2267
  if (!n || n.type.name !== "image") return;
2462
2268
  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({
@@ -2468,13 +2274,13 @@ function Kr(e, t) {
2468
2274
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2469
2275
  });
2470
2276
  }
2471
- function qr(e) {
2277
+ function ri(e) {
2472
2278
  return new Promise((t, n) => {
2473
2279
  let r = new FileReader();
2474
2280
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2475
2281
  });
2476
2282
  }
2477
- function Jr(e) {
2283
+ function ii(e) {
2478
2284
  return new Promise((t) => {
2479
2285
  let n = new Image();
2480
2286
  n.onload = () => t({
@@ -2486,13 +2292,13 @@ function Jr(e) {
2486
2292
  }), n.src = e;
2487
2293
  });
2488
2294
  }
2489
- async function Yr(e) {
2295
+ async function ai(e) {
2490
2296
  try {
2491
2297
  let t = await navigator.clipboard.read();
2492
2298
  for (let n of t) {
2493
2299
  let t = n.types.find((e) => e.startsWith("image/"));
2494
2300
  if (t) {
2495
- let r = await qr(await Gr(n, t)), i = await Jr(r), a = i.width, o = i.height;
2301
+ let r = await ri(await ti(n, t)), i = await ii(r), a = i.width, o = i.height;
2496
2302
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2497
2303
  let s = e.state.schema.nodes.image.create({
2498
2304
  src: r,
@@ -2502,11 +2308,11 @@ async function Yr(e) {
2502
2308
  wrapType: "inline",
2503
2309
  displayMode: "inline"
2504
2310
  }), c = e.state.tr.replaceSelectionWith(s);
2505
- Wr(e, c, s), e.dispatch(c);
2311
+ ei(e, c, s), e.dispatch(c);
2506
2312
  return;
2507
2313
  }
2508
2314
  if (n.types.includes("text/html")) {
2509
- let t = await (await Gr(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2315
+ let t = await (await ti(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2510
2316
  if (r && r[1]) {
2511
2317
  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({
2512
2318
  src: n,
@@ -2516,12 +2322,12 @@ async function Yr(e) {
2516
2322
  wrapType: "inline",
2517
2323
  displayMode: "inline"
2518
2324
  }), l = e.state.tr.replaceSelectionWith(c);
2519
- Wr(e, l, c), e.dispatch(l);
2325
+ ei(e, l, c), e.dispatch(l);
2520
2326
  return;
2521
2327
  }
2522
2328
  }
2523
2329
  if (n.types.includes("text/plain")) {
2524
- let t = await (await Gr(n, "text/plain")).text();
2330
+ let t = await (await ti(n, "text/plain")).text();
2525
2331
  if (t && t !== "[image]") {
2526
2332
  let { from: n } = e.state.selection;
2527
2333
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2537,14 +2343,14 @@ async function Yr(e) {
2537
2343
  }
2538
2344
  }
2539
2345
  }
2540
- function Xr(e, t) {
2346
+ function oi(e, t) {
2541
2347
  let n = e.state.doc.nodeAt(t);
2542
2348
  if (!n || n.type.name !== "image") return;
2543
2349
  let r = document.createElement("input");
2544
2350
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2545
2351
  let i = r.files?.[0];
2546
2352
  if (!i) return;
2547
- let a = await qr(i), o = await Jr(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);
2353
+ let a = await ri(i), o = await ii(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);
2548
2354
  try {
2549
2355
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2550
2356
  ...n.attrs,
@@ -2559,8 +2365,8 @@ function Xr(e, t) {
2559
2365
  }
2560
2366
  //#endregion
2561
2367
  //#region src/composables/useContextMenus.ts
2562
- function Zr(e) {
2563
- let { t } = n(), r = z({
2368
+ function si(e) {
2369
+ let { t } = n(), r = R({
2564
2370
  isOpen: !1,
2565
2371
  position: {
2566
2372
  x: 0,
@@ -2571,7 +2377,7 @@ function Zr(e) {
2571
2377
  onImage: !1,
2572
2378
  canMergeCells: !1,
2573
2379
  canSplitCell: !1
2574
- }), i = z(null), a = E(() => [
2380
+ }), i = R(null), a = D(() => [
2575
2381
  {
2576
2382
  action: "cut",
2577
2383
  label: t("contextMenu.cut"),
@@ -2597,12 +2403,12 @@ function Zr(e) {
2597
2403
  function o(t) {
2598
2404
  let n = e.editorView.value;
2599
2405
  if (!n) return;
2600
- let a = t.target, o = Fe(a);
2406
+ let a = t.target, o = Q(a);
2601
2407
  if (o) {
2602
2408
  let a = Number(o.dataset.pmStart);
2603
2409
  if (!isNaN(a)) {
2604
2410
  try {
2605
- let e = J.create(n.state.doc, a);
2411
+ let e = q.create(n.state.doc, a);
2606
2412
  n.dispatch(n.state.tr.setSelection(e));
2607
2413
  } catch {}
2608
2414
  e.selectedImage.value = {
@@ -2623,7 +2429,7 @@ function Zr(e) {
2623
2429
  pmPos: a,
2624
2430
  currentWrapType: n,
2625
2431
  currentCssFloat: c ?? null,
2626
- inlinePositionEmu: n === "inline" ? Ne(o, e.zoom.value) : void 0
2432
+ inlinePositionEmu: n === "inline" ? Qe(o, e.zoom.value) : void 0
2627
2433
  }, r.value.isOpen = !1;
2628
2434
  return;
2629
2435
  }
@@ -2635,7 +2441,7 @@ function Zr(e) {
2635
2441
  e.setPmSelection(a);
2636
2442
  } catch {}
2637
2443
  }
2638
- let s = ke(n.state), { empty: c } = n.state.selection;
2444
+ let s = Z(n.state), { empty: c } = n.state.selection;
2639
2445
  i.value &&= null, r.value = {
2640
2446
  isOpen: !0,
2641
2447
  position: {
@@ -2664,7 +2470,7 @@ function Zr(e) {
2664
2470
  pmPos: a.pmPos,
2665
2471
  currentWrapType: s,
2666
2472
  currentCssFloat: c ?? null,
2667
- inlinePositionEmu: s === "inline" ? Ne(a.element, e.zoom.value) : void 0
2473
+ inlinePositionEmu: s === "inline" ? Qe(a.element, e.zoom.value) : void 0
2668
2474
  }, r.value.isOpen = !1;
2669
2475
  }
2670
2476
  function c(t) {
@@ -2680,16 +2486,16 @@ function Zr(e) {
2680
2486
  switch (t) {
2681
2487
  case "cut":
2682
2488
  if (e.selectedImage.value) {
2683
- Kr(n, e.selectedImage.value.pmPos);
2489
+ ni(n, e.selectedImage.value.pmPos);
2684
2490
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2685
2491
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2686
2492
  } else document.execCommand("cut");
2687
2493
  break;
2688
2494
  case "copy":
2689
- e.selectedImage.value ? Kr(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2495
+ e.selectedImage.value ? ni(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2690
2496
  break;
2691
2497
  case "paste":
2692
- Yr(n);
2498
+ ai(n);
2693
2499
  break;
2694
2500
  case "pasteAsPlainText":
2695
2501
  navigator.clipboard.readText().then((e) => {
@@ -2702,7 +2508,7 @@ function Zr(e) {
2702
2508
  break;
2703
2509
  }
2704
2510
  case "selectAll": {
2705
- let e = he.create(n.state.doc, 0, n.state.doc.content.size);
2511
+ let e = J.create(n.state.doc, 0, n.state.doc.content.size);
2706
2512
  n.dispatch(n.state.tr.setSelection(e));
2707
2513
  break;
2708
2514
  }
@@ -2710,7 +2516,7 @@ function Zr(e) {
2710
2516
  e.selectedImage.value && (e.showImageProperties.value = !0);
2711
2517
  break;
2712
2518
  case "replaceImage":
2713
- e.selectedImage.value && Xr(n, e.selectedImage.value.pmPos);
2519
+ e.selectedImage.value && oi(n, e.selectedImage.value.pmPos);
2714
2520
  break;
2715
2521
  case "deleteImage":
2716
2522
  if (e.selectedImage.value) {
@@ -2745,21 +2551,28 @@ function Zr(e) {
2745
2551
  }
2746
2552
  //#endregion
2747
2553
  //#region src/composables/usePagesPointer.ts
2748
- var Qr = 500;
2749
- function $r(e) {
2750
- let t = z(null), n = null;
2554
+ var ci = 500;
2555
+ function li(e) {
2556
+ let t = R(null), n = null;
2751
2557
  function r() {
2752
2558
  n !== null && (clearTimeout(n), n = null);
2753
2559
  }
2754
- let i = fe(null), a = 0, o = null, s = 0, c = !1, l = null, u = z({
2560
+ let i = z(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2561
+ pagesContainer: e.pagesRef,
2562
+ onScrollExtendSelection: (e, t) => {
2563
+ if (!c || l === null) return;
2564
+ let n = p(e, t);
2565
+ n !== null && n !== l && h(l, n);
2566
+ }
2567
+ }), d = R({
2755
2568
  currentPage: 1,
2756
2569
  totalPages: 1,
2757
2570
  visible: !1
2758
- }), d = null;
2759
- function f(t, n) {
2760
- return Mt(e.pagesRef.value, e.editorView.value, t, n);
2571
+ }), f = null;
2572
+ function p(t, n) {
2573
+ return Ht(e.pagesRef.value, e.editorView.value, t, n);
2761
2574
  }
2762
- function p() {
2575
+ function m() {
2763
2576
  let t = i.value;
2764
2577
  if (t?.headerFooter && e.getHfPmView) {
2765
2578
  let n = e.getHfPmView(t.headerFooter);
@@ -2767,42 +2580,42 @@ function $r(e) {
2767
2580
  }
2768
2581
  return e.editorView.value;
2769
2582
  }
2770
- function m(e, t) {
2771
- let n = p();
2583
+ function h(e, t) {
2584
+ let n = m();
2772
2585
  if (n) try {
2773
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
2586
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = J.between(r, i);
2774
2587
  n.dispatch(n.state.tr.setSelection(a));
2775
2588
  } catch {}
2776
2589
  }
2777
- function h(t) {
2778
- jt(e.pagesRef.value, e.pagesViewportRef.value, t);
2779
- }
2780
2590
  function g(t) {
2781
- Nt(e.pagesRef.value, t, m, i.value?.position);
2591
+ Vt(e.pagesRef.value, e.pagesViewportRef.value, t);
2782
2592
  }
2783
2593
  function _(t) {
2784
- Pt(e.pagesRef.value, t, m, i.value?.position);
2594
+ Ut(e.pagesRef.value, t, h, i.value?.position);
2785
2595
  }
2786
2596
  function v(t) {
2597
+ Wt(e.pagesRef.value, t, h, i.value?.position);
2598
+ }
2599
+ function y(t) {
2787
2600
  let n = e.editorView.value;
2788
2601
  if (!n) return;
2789
2602
  let r = null;
2790
2603
  if (n.state.doc.descendants((e, n) => r === null ? (e.attrs?.bookmarks)?.some((e) => e.name === t) ? (r = n, !1) : !0 : !1), r !== null) {
2791
- h(r);
2604
+ g(r);
2792
2605
  try {
2793
- m(Math.min(r + 1, n.state.doc.content.size));
2606
+ h(Math.min(r + 1, n.state.doc.content.size));
2794
2607
  } catch {
2795
- m(r);
2608
+ h(r);
2796
2609
  }
2797
2610
  }
2798
2611
  }
2799
- function y(a) {
2612
+ function b(a) {
2800
2613
  if (e.readOnly.value || c) return;
2801
2614
  let o = e.pagesRef.value;
2802
2615
  if (!o) return;
2803
2616
  let s = e.pagesViewportRef.value;
2804
2617
  if (!s) return;
2805
- let l = _t({
2618
+ let l = Nt({
2806
2619
  mouseX: a.clientX,
2807
2620
  mouseY: a.clientY,
2808
2621
  pagesContainer: o,
@@ -2812,7 +2625,7 @@ function $r(e) {
2812
2625
  if (!l) {
2813
2626
  n === null && (n = setTimeout(() => {
2814
2627
  t.value = null, n = null;
2815
- }, gt));
2628
+ }, Mt));
2816
2629
  return;
2817
2630
  }
2818
2631
  let u = s.getBoundingClientRect();
@@ -2823,26 +2636,26 @@ function $r(e) {
2823
2636
  cellPmPos: l.cellPmPos
2824
2637
  }, r();
2825
2638
  }
2826
- function b(n) {
2639
+ function x(n) {
2827
2640
  n.preventDefault(), n.stopPropagation();
2828
2641
  let r = t.value, i = e.editorView.value;
2829
2642
  if (!r || !i) return;
2830
- let a = i.state.tr.setSelection(he.create(i.state.doc, r.cellPmPos + 1));
2643
+ let a = i.state.tr.setSelection(J.create(i.state.doc, r.cellPmPos + 1));
2831
2644
  i.dispatch(a);
2832
2645
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2833
2646
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
2834
2647
  }
2835
- function x(t) {
2648
+ function S(t) {
2836
2649
  let n = t.target?.closest("a[href]");
2837
2650
  if (!n) return;
2838
2651
  t.preventDefault();
2839
2652
  let r = n.getAttribute("href") || "";
2840
2653
  if (r.startsWith("#")) {
2841
2654
  let e = r.slice(1);
2842
- e && v(e);
2655
+ e && y(e);
2843
2656
  return;
2844
2657
  }
2845
- let i = p();
2658
+ let i = m();
2846
2659
  if (i && i.state.selection.from !== i.state.selection.to) return;
2847
2660
  let a = e.pagesViewportRef.value;
2848
2661
  if (!a) return;
@@ -2857,7 +2670,7 @@ function $r(e) {
2857
2670
  }
2858
2671
  };
2859
2672
  }
2860
- function S(t) {
2673
+ function C(t) {
2861
2674
  let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
2862
2675
  if (!o) return;
2863
2676
  let s = r ? "header" : "footer", c = e.getDocument();
@@ -2923,7 +2736,7 @@ function $r(e) {
2923
2736
  }
2924
2737
  };
2925
2738
  }
2926
- function C(t) {
2739
+ function ee(t) {
2927
2740
  let n = e.getDocument(), r = i.value;
2928
2741
  if (!n?.package || !r) return;
2929
2742
  let a = r.position === "header" ? n.package.headers : n.package.footers;
@@ -2931,7 +2744,7 @@ function $r(e) {
2931
2744
  let o = a.get(r.rId);
2932
2745
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2933
2746
  }
2934
- function ee() {
2747
+ function te() {
2935
2748
  let t = e.getDocument(), n = i.value;
2936
2749
  if (!t?.package || !n || !n.rId) {
2937
2750
  i.value = null;
@@ -2963,21 +2776,21 @@ function $r(e) {
2963
2776
  };
2964
2777
  i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
2965
2778
  }
2966
- function te(t) {
2779
+ function ne(t) {
2967
2780
  if (t.button !== 0 || e.imageInteracting.value) return;
2968
2781
  let n = e.editorView.value;
2969
2782
  if (!n) return;
2970
2783
  let r = t.target;
2971
2784
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2972
- let u = p() ?? n;
2785
+ let u = m() ?? n;
2973
2786
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2974
- let d = Fe(r);
2787
+ let d = Q(r);
2975
2788
  if (d) {
2976
2789
  t.preventDefault(), t.stopPropagation();
2977
2790
  let n = Number(d.dataset.pmStart);
2978
2791
  if (!isNaN(n)) {
2979
2792
  try {
2980
- u.dispatch(u.state.tr.setSelection(J.create(u.state.doc, n)));
2793
+ u.dispatch(u.state.tr.setSelection(q.create(u.state.doc, n)));
2981
2794
  } catch {}
2982
2795
  e.selectedImage.value = {
2983
2796
  element: d,
@@ -2990,32 +2803,32 @@ function $r(e) {
2990
2803
  return;
2991
2804
  }
2992
2805
  e.selectedImage.value = null, t.preventDefault();
2993
- let h = f(t.clientX, t.clientY);
2994
- if (h === null) {
2806
+ let f = p(t.clientX, t.clientY);
2807
+ if (f === null) {
2995
2808
  u.focus();
2996
2809
  return;
2997
2810
  }
2998
- let v = Date.now();
2999
- if (v - a < Qr && o === h ? s++ : s = 1, a = v, o = h, s === 2) g(h);
3000
- else if (s >= 3) _(h), s = 0;
2811
+ let g = Date.now();
2812
+ if (g - a < ci && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2813
+ else if (s >= 3) v(f), s = 0;
3001
2814
  else {
3002
2815
  if (t.shiftKey) {
3003
2816
  let { from: e } = u.state.selection;
3004
- m(e, h);
3005
- } else m(h);
3006
- l = h, c = !0;
2817
+ h(e, f);
2818
+ } else h(f);
2819
+ l = f, c = !0;
3007
2820
  }
3008
2821
  u.focus();
3009
2822
  }
3010
- function ne(e) {
2823
+ function T(e) {
3011
2824
  if (!c || l === null) return;
3012
- let t = f(e.clientX, e.clientY);
3013
- t !== null && t !== l && m(l, t);
2825
+ let t = p(e.clientX, e.clientY);
2826
+ t !== null && t !== l && h(l, t), u.updateMousePosition(e.clientX, e.clientY);
3014
2827
  }
3015
- function w() {
3016
- c = !1;
2828
+ function E() {
2829
+ c = !1, u.stopAutoScroll();
3017
2830
  }
3018
- function T() {
2831
+ function D() {
3019
2832
  let t = e.pagesViewportRef.value, n = e.layout.value;
3020
2833
  if (!t || !n || n.pages.length === 0) return;
3021
2834
  let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
@@ -3027,42 +2840,42 @@ function $r(e) {
3027
2840
  }
3028
2841
  o = r + 24, s = e + 2;
3029
2842
  }
3030
- s = Math.min(s, i), u.value = {
2843
+ s = Math.min(s, i), d.value = {
3031
2844
  currentPage: s,
3032
2845
  totalPages: i,
3033
2846
  visible: !0
3034
- }, d && clearTimeout(d), d = setTimeout(() => {
3035
- u.value = {
3036
- ...u.value,
2847
+ }, f && clearTimeout(f), f = setTimeout(() => {
2848
+ d.value = {
2849
+ ...d.value,
3037
2850
  visible: !1
3038
2851
  };
3039
2852
  }, 600);
3040
2853
  }
3041
- return L(() => {
3042
- window.addEventListener("mousemove", ne), window.addEventListener("mouseup", w), e.pagesViewportRef.value?.addEventListener("scroll", T, { passive: !0 });
3043
- }), I(() => {
3044
- r(), window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", w), e.pagesViewportRef.value?.removeEventListener("scroll", T), d && clearTimeout(d);
2854
+ return I(() => {
2855
+ window.addEventListener("mousemove", T), window.addEventListener("mouseup", E), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2856
+ }), F(() => {
2857
+ r(), window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", E), e.pagesViewportRef.value?.removeEventListener("scroll", D), f && clearTimeout(f);
3045
2858
  }), {
3046
2859
  tableInsertButton: t,
3047
2860
  hfEdit: i,
3048
- scrollPageInfo: u,
3049
- resolvePos: f,
3050
- setPmSelection: m,
3051
- scrollVisiblePositionIntoView: h,
3052
- navigateToBookmark: v,
3053
- handlePagesMouseDown: te,
3054
- handlePagesMouseMove: y,
3055
- handlePagesClick: x,
3056
- handlePagesDoubleClick: S,
3057
- handleTableInsertClick: b,
2861
+ scrollPageInfo: d,
2862
+ resolvePos: p,
2863
+ setPmSelection: h,
2864
+ scrollVisiblePositionIntoView: g,
2865
+ navigateToBookmark: y,
2866
+ handlePagesMouseDown: ne,
2867
+ handlePagesMouseMove: b,
2868
+ handlePagesClick: S,
2869
+ handlePagesDoubleClick: C,
2870
+ handleTableInsertClick: x,
3058
2871
  clearTableInsertTimer: r,
3059
- handleHfSave: C,
3060
- handleHfRemove: ee
2872
+ handleHfSave: ee,
2873
+ handleHfRemove: te
3061
2874
  };
3062
2875
  }
3063
2876
  //#endregion
3064
2877
  //#region src/composables/useSelectionSync.ts
3065
- function ei(e) {
2878
+ function ui(e) {
3066
2879
  let t = null, n = null, r = null;
3067
2880
  function i() {
3068
2881
  let r = e.pagesRef.value;
@@ -3074,8 +2887,8 @@ function ei(e) {
3074
2887
  let t = e.pagesRef.value, n = e.editorView.value;
3075
2888
  if (!t || !n || e.isHfEditing?.value) return;
3076
2889
  let i = n.state.selection;
3077
- if (i instanceof J && i.node.type.name === "image") {
3078
- let n = ve(t, i.from), r = n ? Fe(n) : null;
2890
+ if (i instanceof q && i.node.type.name === "image") {
2891
+ let n = Y(t, i.from), r = n ? Q(n) : null;
3079
2892
  if (r) {
3080
2893
  let t = e.selectedImage.value;
3081
2894
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -3093,12 +2906,12 @@ function ei(e) {
3093
2906
  function o() {
3094
2907
  let r = e.pagesRef.value, o = e.editorView.value;
3095
2908
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
3096
- a();
2909
+ a(), _e(r, o.state);
3097
2910
  let s = o.state.selection;
3098
- if (s instanceof J && s.node.type.name === "image") return;
2911
+ if (s instanceof q && s.node.type.name === "image") return;
3099
2912
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
3100
2913
  if (u) {
3101
- let e = Z(r, c, r.getBoundingClientRect());
2914
+ let e = Ge(r, c, r.getBoundingClientRect());
3102
2915
  if (e) {
3103
2916
  let i = document.createElement("div");
3104
2917
  i.className = "vue-caret", i.style.cssText = `
@@ -3118,7 +2931,7 @@ function ei(e) {
3118
2931
  }
3119
2932
  return;
3120
2933
  }
3121
- let m = je(r, c, l, r.getBoundingClientRect());
2934
+ let m = Ke(r, c, l, r.getBoundingClientRect());
3122
2935
  for (let e of m) {
3123
2936
  let t = document.createElement("div");
3124
2937
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -3133,7 +2946,7 @@ function ei(e) {
3133
2946
  `, r.appendChild(t);
3134
2947
  }
3135
2948
  }
3136
- return I(() => {
2949
+ return F(() => {
3137
2950
  r !== null && cancelAnimationFrame(r), i();
3138
2951
  }), {
3139
2952
  clearOverlay: i,
@@ -3142,7 +2955,7 @@ function ei(e) {
3142
2955
  }
3143
2956
  //#endregion
3144
2957
  //#region src/composables/useMenuActions.ts
3145
- function ti(e) {
2958
+ function di(e) {
3146
2959
  function t(t) {
3147
2960
  let n = e.editorView.value;
3148
2961
  if (!n) return;
@@ -3197,7 +3010,7 @@ function ti(e) {
3197
3010
  e.showKeyboardShortcuts.value = !0;
3198
3011
  break;
3199
3012
  case "reportIssue":
3200
- vt();
3013
+ Pt();
3201
3014
  break;
3202
3015
  case "dirLTR":
3203
3016
  t("setLtr");
@@ -3215,29 +3028,29 @@ function ti(e) {
3215
3028
  }
3216
3029
  //#endregion
3217
3030
  //#region src/composables/useDocumentLifecycle.ts
3218
- function ni(e) {
3031
+ function fi(e) {
3219
3032
  async function t(t) {
3220
3033
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3221
3034
  }
3222
3035
  function n(t) {
3223
3036
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3224
3037
  }
3225
- W(e.documentBuffer, (e) => {
3038
+ U(e.documentBuffer, (e) => {
3226
3039
  e && t(e);
3227
- }), W(e.document, (e) => {
3040
+ }), U(e.document, (e) => {
3228
3041
  e && n(e);
3229
- }), L(async () => {
3230
- await ce();
3042
+ }), I(async () => {
3043
+ await ue();
3231
3044
  let r = e.documentBuffer(), i = e.document();
3232
3045
  r ? await t(r) : i && n(i);
3233
3046
  });
3234
3047
  }
3235
3048
  //#endregion
3236
3049
  //#region src/composables/useDocxEditorRefApi.ts
3237
- function ri(e) {
3050
+ function pi(e) {
3238
3051
  function t() {
3239
3052
  let t = e.pagesRef.value;
3240
- t && Le(t), e.onPrint?.(), window.print();
3053
+ t && tt(t), e.onPrint?.(), window.print();
3241
3054
  }
3242
3055
  function n() {
3243
3056
  t();
@@ -3271,41 +3084,41 @@ function ri(e) {
3271
3084
  function c() {
3272
3085
  let t = e.layout.value, n = e.editorView.value;
3273
3086
  if (!t || !n) return 0;
3274
- let r = Qe(t, n.state.selection.from);
3087
+ let r = st(t, n.state.selection.from);
3275
3088
  return r == null ? 0 : r + 1;
3276
3089
  }
3277
3090
  function l(t) {
3278
3091
  let n = e.editorView.value;
3279
3092
  if (!n) return !1;
3280
- let r = St(n.state.doc, t);
3093
+ let r = It(n.state.doc, t);
3281
3094
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3282
3095
  }
3283
3096
  function u(t, n) {
3284
- return Et(e.editorView.value, t, n);
3097
+ return Se(e.editorView.value, t, n);
3285
3098
  }
3286
3099
  function d() {
3287
- return Dt(e.editorView.value);
3100
+ return we(e.editorView.value);
3288
3101
  }
3289
3102
  function f() {
3290
3103
  return e.comments.value;
3291
3104
  }
3292
3105
  function p(t) {
3293
3106
  let n = e.editorView.value;
3294
- return n ? He(n.state.doc, t ?? {}) : [];
3107
+ return n ? ke(n.state.doc, t ?? {}) : [];
3295
3108
  }
3296
3109
  function m(t) {
3297
3110
  let n = e.editorView.value;
3298
3111
  if (!n) return !1;
3299
- let r = Ve(n.state.doc, t);
3112
+ let r = Oe(n.state.doc, t);
3300
3113
  return r == null ? !1 : (a(r), !0);
3301
3114
  }
3302
3115
  function h(t, n, r) {
3303
3116
  let i = e.editorView.value;
3304
3117
  if (!i) return !1;
3305
3118
  try {
3306
- return i.dispatch(Ke(i.state, t, n, r)), !0;
3119
+ return i.dispatch(Ne(i.state, t, n, r)), !0;
3307
3120
  } catch (e) {
3308
- if (e instanceof yt) return !1;
3121
+ if (e instanceof Ft) return !1;
3309
3122
  throw e;
3310
3123
  }
3311
3124
  }
@@ -3313,9 +3126,9 @@ function ri(e) {
3313
3126
  let r = e.editorView.value;
3314
3127
  if (!r) return !1;
3315
3128
  try {
3316
- return r.dispatch(Ue(r.state, t, n)), !0;
3129
+ return r.dispatch(Ae(r.state, t, n)), !0;
3317
3130
  } catch (e) {
3318
- if (e instanceof yt) return !1;
3131
+ if (e instanceof Ft) return !1;
3319
3132
  throw e;
3320
3133
  }
3321
3134
  }
@@ -3323,14 +3136,14 @@ function ri(e) {
3323
3136
  let i = e.editorView.value;
3324
3137
  if (!i) return !1;
3325
3138
  try {
3326
- return i.dispatch(qe(i.state, t, n, r)), !0;
3139
+ return i.dispatch(X(i.state, t, n, r)), !0;
3327
3140
  } catch (e) {
3328
- if (e instanceof yt) return !1;
3141
+ if (e instanceof Ft) return !1;
3329
3142
  throw e;
3330
3143
  }
3331
3144
  }
3332
3145
  function v(t) {
3333
- return Ot(e.editorView.value, e.layout.value, t);
3146
+ return Ce(e.editorView.value, e.layout.value, t);
3334
3147
  }
3335
3148
  function y(t) {
3336
3149
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
@@ -3377,25 +3190,25 @@ function ri(e) {
3377
3190
  }
3378
3191
  //#endregion
3379
3192
  //#region src/composables/useFontLifecycle.ts
3380
- function ii(e, t) {
3381
- W(e, (e) => {
3382
- xe(e);
3193
+ function mi(e, t) {
3194
+ U(e, (e) => {
3195
+ Ie(e);
3383
3196
  }, { immediate: !0 });
3384
- let n = Se(t);
3385
- I(() => n());
3197
+ let n = Le(t);
3198
+ F(() => n());
3386
3199
  }
3387
3200
  //#endregion
3388
3201
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3389
- var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3202
+ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3390
3203
  key: 0,
3391
3204
  class: "docx-editor-vue__error"
3392
- }, si = {
3205
+ }, _i = {
3393
3206
  key: 1,
3394
3207
  class: "docx-editor-vue__loading"
3395
- }, ci = { class: "docx-editor-vue__editor-area" }, li = {
3208
+ }, vi = { class: "docx-editor-vue__editor-area" }, yi = {
3396
3209
  key: 0,
3397
3210
  class: "docx-editor-vue__vertical-ruler"
3398
- }, ui = ["title"], di = ["title", "aria-label"], fi = /* @__PURE__ */ N({
3211
+ }, bi = ["title"], xi = ["title", "aria-label"], Si = /* @__PURE__ */ M({
3399
3212
  __name: "DocxEditor",
3400
3213
  props: {
3401
3214
  documentBuffer: { default: null },
@@ -3417,6 +3230,7 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3417
3230
  type: Boolean,
3418
3231
  default: !1
3419
3232
  },
3233
+ author: { default: "User" },
3420
3234
  mode: { default: "editing" },
3421
3235
  onModeChange: {},
3422
3236
  i18n: { default: void 0 },
@@ -3475,7 +3289,16 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3475
3289
  renderTitleBarRight: {
3476
3290
  type: Function,
3477
3291
  default: void 0
3478
- }
3292
+ },
3293
+ onChange: {},
3294
+ onError: {},
3295
+ onSelectionChange: {},
3296
+ onEditorViewReady: {},
3297
+ onCommentAdd: {},
3298
+ onCommentResolve: {},
3299
+ onCommentDelete: {},
3300
+ onCommentReply: {},
3301
+ onCommentsChange: {}
3479
3302
  },
3480
3303
  emits: [
3481
3304
  "change",
@@ -3487,35 +3310,40 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3487
3310
  "mode-change"
3488
3311
  ],
3489
3312
  setup(e, { expose: n, emit: r }) {
3490
- let i = e, a = r, o = z(i.mode), s = E(() => i.readOnly || o.value === "viewing");
3491
- f(E(() => i.i18n));
3492
- let { t: l } = t(E(() => i.i18n)), u = z(null), d = z(null), g = z(null), y = z(0), x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), C = new ze(), T = z(!1), re = z(!1), ae = z(!1), j = z(!1), N = z(!1), oe = z(!1), H = z(i.showOutline), pe = z(!1), U = z(!1), G = z(!1), K = z(null), J = fe([]), Y = fe([]), ve = fe([]), { zoom: X, zoomPercent: be, isMinZoom: xe, isMaxZoom: Se, setZoom: Ce, zoomIn: we, zoomOut: Te, handleWheel: De, handleKeyDown: Oe, installShortcuts: ke, ZOOM_PRESETS: Ae } = ee(i.initialZoom);
3493
- ke();
3494
- let { editorView: Z, isReady: je, parseError: Me, layout: Ne, loadBuffer: Pe, loadDocument: Fe, save: Ie, focus: Le, destroy: Re, getDocument: Q, getCommands: Be, reLayout: Ve, getHfPmView: He, syncHfPMs: Ue, setHfTransactionListener: We, setDocument: Ge } = te({
3495
- hiddenContainer: u,
3496
- pagesContainer: d,
3313
+ let i = e, a = r, o = R(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3314
+ f(D(() => i.i18n));
3315
+ let { t: u } = t(D(() => i.i18n)), d = R(null), g = R(null), y = R(null), x = R(0), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), w = new Te(), E = R(!1), re = R(!1), oe = R(!1), se = R(!1), M = R(!1), ce = R(!1), me = R(i.showOutline), he = R(!1), H = R(!1), W = R(!1), G = R(null), q = z([]), _e = z([]), ve = z([]), { zoom: Y, zoomPercent: xe, isMinZoom: Se, isMaxZoom: Ce, setZoom: Ee, zoomIn: Oe, zoomOut: ke, handleWheel: Ae, handleKeyDown: je, installShortcuts: Me, ZOOM_PRESETS: Ne } = ne(i.initialZoom);
3316
+ Me();
3317
+ let { editorView: X, isReady: Fe, parseError: Ie, layout: Le, loadBuffer: Re, loadDocument: ze, save: Be, focus: He, destroy: Ue, getDocument: Z, getCommands: We, reLayout: Ge, getHfPmView: Ke, syncHfPMs: qe, setHfTransactionListener: Je, setDocument: Ye } = ee({
3318
+ hiddenContainer: d,
3319
+ pagesContainer: g,
3497
3320
  readOnly: s,
3498
3321
  externalPlugins: i.externalPlugins,
3499
- syncCoordinator: C,
3322
+ syncCoordinator: w,
3500
3323
  editorMode: o,
3324
+ author: l,
3501
3325
  onChange: (e) => {
3502
- a("change", e), a("update:document", e), x.forEach((t) => t(e));
3326
+ a("change", e), a("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3327
+ },
3328
+ onError: (e) => {
3329
+ a("error", e), i.onError?.(e);
3503
3330
  },
3504
- onError: (e) => a("error", e),
3505
3331
  onSelectionUpdate: () => {
3506
- y.value++, $n();
3507
- let e = Dt(Z.value);
3508
- S.forEach((t) => t(e));
3332
+ x.value++, ir();
3333
+ let e = X.value;
3334
+ i.onSelectionChange?.(e ? De(e.state) : null);
3335
+ let t = we(e);
3336
+ C.forEach((e) => e(t));
3509
3337
  }
3510
- }), Ke = E(() => {
3511
- y.value;
3512
- let e = Q();
3338
+ }), { commentCallbacks: Xe } = Zr(i, X), Ze = D(() => {
3339
+ x.value;
3340
+ let e = Z();
3513
3341
  if (!e?.package?.document) return null;
3514
3342
  let t = e.package.document;
3515
3343
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3516
- }), qe = E(() => {
3517
- y.value;
3518
- let e = Z.value, t = e ? Ee(e.state).paragraphFormatting : {};
3344
+ }), Qe = D(() => {
3345
+ x.value;
3346
+ let e = X.value, t = e ? Ve(e.state).paragraphFormatting : {};
3519
3347
  return {
3520
3348
  indentLeft: t.indentLeft ?? 0,
3521
3349
  indentRight: t.indentRight ?? 0,
@@ -3523,24 +3351,26 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3523
3351
  hangingIndent: t.hangingIndent ?? !1,
3524
3352
  tabStops: t.tabs ?? null
3525
3353
  };
3526
- }), Je = E(() => (y.value, Q()?.package?.theme ?? i.theme ?? null)), Xe = z(null), Ze = z([]);
3527
- function Qe(e, t) {
3528
- Xe.value = ge(e, t), Ze.value = _e(e, t);
3354
+ }), $e = D(() => (x.value, Z()?.package?.theme ?? i.theme ?? null)), Q = R(null), et = R([]);
3355
+ function tt(e, t) {
3356
+ Q.value = ye(e, t), et.value = be(e, t);
3529
3357
  }
3530
- function $e() {
3531
- Xe.value = null, Ze.value = [];
3358
+ function nt() {
3359
+ Q.value = null, et.value = [];
3532
3360
  }
3533
- ii(() => i.fonts, (e) => a("error", e));
3534
- let et = E(() => $.value?.headerFooter ? He($.value.headerFooter) ?? null : null);
3535
- L(() => {
3536
- We((e, t) => {
3361
+ mi(() => i.fonts, (e) => {
3362
+ a("error", e), i.onError?.(e);
3363
+ });
3364
+ let rt = D(() => $.value?.headerFooter ? Ke($.value.headerFooter) ?? null : null);
3365
+ I(() => {
3366
+ Je((e, t) => {
3537
3367
  requestAnimationFrame(() => {
3538
3368
  let e = $.value;
3539
3369
  if (!e) return;
3540
- Qe(t, e.position);
3541
- let n = kt(e.position), r = g.value;
3370
+ tt(t, e.position);
3371
+ let n = zt(e.position), r = y.value;
3542
3372
  if (!n || !r) return;
3543
- let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3373
+ let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = Y.value || 1;
3544
3374
  $.value = {
3545
3375
  ...e,
3546
3376
  targetRect: {
@@ -3551,20 +3381,20 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3551
3381
  }
3552
3382
  };
3553
3383
  });
3554
- }), W(() => $.value, (e) => {
3384
+ }), U(() => $.value, (e) => {
3555
3385
  if (!e) {
3556
- $e();
3386
+ nt();
3557
3387
  return;
3558
3388
  }
3559
- let t = Z.value;
3389
+ let t = X.value;
3560
3390
  if (t) {
3561
3391
  try {
3562
- let e = t.state.tr.setSelection(he.create(t.state.doc, 0));
3392
+ let e = t.state.tr.setSelection(J.create(t.state.doc, 0));
3563
3393
  t.dispatch(e);
3564
3394
  } catch {}
3565
3395
  t.dom.blur?.();
3566
3396
  }
3567
- er.updateSelectionOverlay();
3397
+ ar.updateSelectionOverlay();
3568
3398
  });
3569
3399
  let e = 0;
3570
3400
  function t() {
@@ -3572,35 +3402,35 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3572
3402
  e = 0;
3573
3403
  let t = $.value;
3574
3404
  if (!t?.headerFooter) return;
3575
- let n = He(t.headerFooter);
3576
- n && Qe(n, t.position);
3405
+ let n = Ke(t.headerFooter);
3406
+ n && tt(n, t.position);
3577
3407
  }));
3578
3408
  }
3579
- window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3409
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
3580
3410
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3581
3411
  });
3582
3412
  });
3583
- let tt = E(() => {
3413
+ let at = D(() => {
3584
3414
  let e = [];
3585
- return U.value && e.push(`translateX(-${ye}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3415
+ return H.value && e.push(`translateX(-${Pe}px)`), Y.value !== 1 && e.push(`scale(${Y.value})`), {
3586
3416
  transform: e.length > 0 ? e.join(" ") : void 0,
3587
3417
  transformOrigin: "top center",
3588
3418
  transition: "transform 0.2s ease"
3589
3419
  };
3590
- }), nt = E(() => ({
3420
+ }), ot = D(() => ({
3591
3421
  paddingLeft: "20px",
3592
- paddingRight: 20 + (U.value ? ye * 2 : 0) + "px",
3422
+ paddingRight: 20 + (H.value ? Pe * 2 : 0) + "px",
3593
3423
  transition: "padding 0.2s ease"
3594
- })), rt = E(() => {
3595
- let e = Ke.value;
3596
- return Ye(e?.pageWidth ?? 12240) * X.value;
3597
- }), it = E(() => {
3424
+ })), st = D(() => {
3425
+ let e = Ze.value;
3426
+ return it(e?.pageWidth ?? 12240) * Y.value;
3427
+ }), ct = D(() => {
3598
3428
  let e = /* @__PURE__ */ new Set();
3599
- for (let t of J.value) t.parentId == null && t.done && e.add(t.id);
3429
+ for (let t of q.value) t.parentId == null && t.done && e.add(t.id);
3600
3430
  return e;
3601
- }), at = E(() => {
3602
- y.value;
3603
- let e = Z.value;
3431
+ }), lt = D(() => {
3432
+ x.value;
3433
+ let e = X.value;
3604
3434
  if (!e) return [];
3605
3435
  let t = /* @__PURE__ */ new Set(), n = [];
3606
3436
  return e.state.doc.descendants((e) => {
@@ -3615,189 +3445,195 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3615
3445
  }
3616
3446
  return !0;
3617
3447
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3618
- }), { floatingCommentBtn: ot, pendingCommentRange: st, addCommentYPosition: ct, sidebarAutoOpenedRef: lt, extractCommentsAndChanges: ut, handleAddComment: dt, handleCancelAddComment: ft, handleStartAddComment: pt, handleMarkerClick: mt } = Hr({
3619
- editorView: Z,
3620
- getDocument: Q,
3621
- comments: J,
3622
- trackedChanges: Y,
3623
- resolvedCommentIds: it,
3624
- activeSidebarItem: K,
3625
- showSidebar: U,
3626
- isAddingComment: G,
3448
+ }), ut = kt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = Qr({
3449
+ editorView: X,
3450
+ getDocument: Z,
3451
+ comments: q,
3452
+ trackedChanges: _e,
3453
+ resolvedCommentIds: ct,
3454
+ activeSidebarItem: G,
3455
+ showSidebar: H,
3456
+ isAddingComment: W,
3627
3457
  readOnly: s,
3628
- zoom: X,
3629
- stateTick: y,
3630
- pagesRef: d,
3631
- pagesViewportRef: g,
3632
- emit: a
3633
- }), { docxInputRef: ht, handleDocxFileChange: gt, handleDocumentNameChange: _t, downloadCurrentDocument: vt, loadDocumentBuffer: yt, loadDocument: bt, save: xt } = Nr({
3634
- loadBuffer: Pe,
3635
- loadParsedDocument: Fe,
3636
- getDocument: Q,
3637
- saveBlob: Ie,
3638
- extractCommentsAndChanges: ut,
3458
+ zoom: Y,
3459
+ stateTick: x,
3460
+ pagesRef: g,
3461
+ pagesViewportRef: y,
3462
+ emit: a,
3463
+ commentIdAllocator: ut,
3464
+ author: l,
3465
+ commentCallbacks: Xe
3466
+ }), { docxInputRef: bt, handleDocxFileChange: xt, handleDocumentNameChange: St, downloadCurrentDocument: Ct, loadDocumentBuffer: wt, loadDocument: Tt, save: Et } = Ur({
3467
+ loadBuffer: Re,
3468
+ loadParsedDocument: ze,
3469
+ getDocument: Z,
3470
+ saveBlob: Be,
3471
+ extractCommentsAndChanges: ht,
3639
3472
  emit: a,
3640
3473
  documentName: () => i.documentName,
3641
3474
  onDocumentNameChange: i.onDocumentNameChange,
3642
- nextTick: ce
3643
- }), { hyperlinkPopupData: St, handleHyperlinkSubmit: Ct, handleHyperlinkRemove: wt, handleHyperlinkPopupNavigate: Tt, handleHyperlinkPopupEdit: Et, handleHyperlinkPopupRemove: Ot } = Pr({
3644
- editorView: Z,
3645
- getCommands: Be
3646
- }), { handleClearFormatting: At, handleApplyStyle: jt, handleInsertPageBreak: Mt, handleInsertSymbol: Nt, applyFormatting: Pt, setParagraphStyle: It } = Fr({
3647
- editorView: Z,
3648
- getDocument: Q
3649
- }), { handlePageSetupApply: Lt, handleLeftMarginChange: Rt, handleRightMarginChange: zt, handleTopMarginChange: Bt, handleBottomMarginChange: Vt, handleIndentLeftChange: Ut, handleIndentRightChange: Wt, handleFirstLineIndentChange: Gt, handleTabStopRemove: Kt } = Ir({
3650
- editorView: Z,
3651
- getDocument: Q,
3475
+ nextTick: ue
3476
+ }), { hyperlinkPopupData: Dt, handleHyperlinkSubmit: Ot, handleHyperlinkRemove: At, handleHyperlinkPopupNavigate: jt, handleHyperlinkPopupEdit: Mt, handleHyperlinkPopupRemove: Nt } = Wr({
3477
+ editorView: X,
3478
+ getCommands: We
3479
+ }), { handleClearFormatting: Pt, handleApplyStyle: Ft, handleInsertPageBreak: It, handleInsertSymbol: Lt, applyFormatting: Rt, setParagraphStyle: Bt } = Gr({
3480
+ editorView: X,
3481
+ getDocument: Z
3482
+ }), { handlePageSetupApply: Vt, handleLeftMarginChange: Ht, handleRightMarginChange: Ut, handleTopMarginChange: Wt, handleBottomMarginChange: Kt, handleIndentLeftChange: qt, handleIndentRightChange: Jt, handleFirstLineIndentChange: Yt, handleTabStopRemove: Xt } = Kr({
3483
+ editorView: X,
3484
+ getDocument: Z,
3652
3485
  readOnly: s,
3653
- stateTick: y,
3654
- reLayout: Ve,
3486
+ stateTick: x,
3487
+ reLayout: Ge,
3655
3488
  emit: a
3656
- }), { showWatermark: Yt, currentWatermark: Xt, handleWatermarkApply: Qt } = Lr({
3657
- editorView: Z,
3489
+ }), { showWatermark: Zt, currentWatermark: $t, handleWatermarkApply: en } = qr({
3490
+ editorView: X,
3658
3491
  readOnly: s,
3659
- stateTick: y
3660
- }), { handleToggleOutline: $t, handleOutlineNavigate: en, handleToggleSidebar: tn, handleEditorScrollMouseDown: rn } = Rr({
3661
- editorView: Z,
3662
- showOutline: H,
3663
- showSidebar: U,
3492
+ stateTick: x
3493
+ }), { handleToggleOutline: tn, handleOutlineNavigate: nn, handleToggleSidebar: on, handleEditorScrollMouseDown: sn } = Jr({
3494
+ editorView: X,
3495
+ showOutline: me,
3496
+ showSidebar: H,
3664
3497
  outlineHeadings: ve,
3665
- activeSidebarItem: K,
3666
- extractCommentsAndChanges: ut
3498
+ activeSidebarItem: G,
3499
+ extractCommentsAndChanges: ht
3667
3500
  });
3668
- zr({
3669
- showKeyboardShortcuts: pe,
3670
- showFindReplace: T,
3671
- showHyperlink: ae,
3672
- handleZoomKeyDown: Oe,
3501
+ Yr({
3502
+ showKeyboardShortcuts: he,
3503
+ showFindReplace: E,
3504
+ showHyperlink: oe,
3505
+ handleZoomKeyDown: je,
3673
3506
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3674
3507
  });
3675
- let { addComment: an, replyToComment: on, resolveComment: sn, proposeChange: ln, handleCommentReply: un, handleCommentUnresolve: dn, handleCommentDelete: fn, handleAcceptChange: pn, handleRejectChange: mn, handleAcceptChangeById: hn, handleRejectChangeById: gn, handleTrackedChangeReply: _n } = Vr({
3676
- editorView: Z,
3677
- getDocument: Q,
3678
- comments: J,
3679
- trackedChanges: Y,
3680
- showSidebar: U,
3681
- isAddingComment: G,
3682
- pendingCommentRange: st,
3683
- contentChangeSubscribers: x,
3684
- extractCommentsAndChanges: ut,
3685
- emit: a
3686
- }), { selectedImage: vn, imageInteracting: yn, imageToolbarContext: bn, handleInsertImage: xn, handleToolbarImageWrap: Sn, handleImageTransform: Cn } = Ur({
3687
- editorView: Z,
3688
- zoom: X,
3689
- stateTick: y,
3690
- getCommands: Be
3691
- }), wn = ne(), Tn = null, { tableInsertButton: En, hfEdit: $, scrollPageInfo: Dn, resolvePos: On, setPmSelection: kn, scrollVisiblePositionIntoView: An, handlePagesMouseDown: jn, handlePagesMouseMove: Mn, handlePagesClick: Nn, handlePagesDoubleClick: Pn, handleTableInsertClick: Fn, clearTableInsertTimer: In, handleHfSave: Ln, handleHfRemove: Rn } = $r({
3692
- editorView: Z,
3693
- pagesRef: d,
3694
- pagesViewportRef: g,
3695
- selectedImage: vn,
3696
- imageInteracting: yn,
3697
- hyperlinkPopupData: St,
3508
+ let { addComment: ln, replyToComment: un, resolveComment: dn, proposeChange: fn, handleCommentReply: mn, handleCommentResolve: hn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = Xr({
3509
+ editorView: X,
3510
+ getDocument: Z,
3511
+ comments: q,
3512
+ trackedChanges: _e,
3513
+ showSidebar: H,
3514
+ isAddingComment: W,
3515
+ pendingCommentRange: ft,
3516
+ contentChangeSubscribers: S,
3517
+ extractCommentsAndChanges: ht,
3518
+ emit: a,
3519
+ commentIdAllocator: ut,
3520
+ author: l,
3521
+ commentCallbacks: Xe
3522
+ }), { selectedImage: wn, imageInteracting: Tn, imageToolbarContext: En, handleInsertImage: Dn, handleToolbarImageWrap: On, handleImageTransform: kn } = $r({
3523
+ editorView: X,
3524
+ zoom: Y,
3525
+ stateTick: x,
3526
+ getCommands: We
3527
+ }), An = te(), jn = null, { tableInsertButton: Mn, hfEdit: $, scrollPageInfo: Nn, resolvePos: Pn, setPmSelection: Fn, scrollVisiblePositionIntoView: In, handlePagesMouseDown: Ln, handlePagesMouseMove: Rn, handlePagesClick: zn, handlePagesDoubleClick: Bn, handleTableInsertClick: Vn, clearTableInsertTimer: Hn, handleHfSave: Un, handleHfRemove: Wn } = li({
3528
+ editorView: X,
3529
+ pagesRef: g,
3530
+ pagesViewportRef: y,
3531
+ selectedImage: wn,
3532
+ imageInteracting: Tn,
3533
+ hyperlinkPopupData: Dt,
3698
3534
  readOnly: s,
3699
- zoom: X,
3700
- layout: Ne,
3701
- tableResize: wn,
3702
- getCommands: Be,
3703
- getDocument: Q,
3704
- reLayout: Ve,
3535
+ zoom: Y,
3536
+ layout: Le,
3537
+ tableResize: An,
3538
+ getCommands: We,
3539
+ getDocument: Z,
3540
+ reLayout: Ge,
3705
3541
  emit: a,
3706
- clearOverlay: Zn,
3707
- syncHfPMs: Ue,
3708
- getHfPmView: He,
3709
- setDocument: Ge
3710
- }), { contextMenu: zn, imageContextMenu: Bn, imageContextMenuTextActions: Vn, handleContextMenu: Hn, handleSelectedImageContextMenu: Un, handleImageWrapSelect: Wn, handleContextMenuAction: Gn } = Zr({
3711
- editorView: Z,
3712
- selectedImage: vn,
3713
- zoom: X,
3714
- showImageProperties: N,
3715
- getCommands: Be,
3716
- clearOverlay: Zn,
3717
- setPmSelection: kn,
3718
- resolvePos: On
3719
- }), { handleMenuAction: Kn, handleMenuTableInsert: qn } = ti({
3720
- editorView: Z,
3721
- getCommands: Be,
3722
- docxInputRef: ht,
3723
- showPageSetup: oe,
3724
- showWatermark: Yt,
3542
+ clearOverlay: rr,
3543
+ syncHfPMs: qe,
3544
+ getHfPmView: Ke,
3545
+ setDocument: Ye
3546
+ }), { contextMenu: Gn, imageContextMenu: Kn, imageContextMenuTextActions: qn, handleContextMenu: Jn, handleSelectedImageContextMenu: Yn, handleImageWrapSelect: Xn, handleContextMenuAction: Zn } = si({
3547
+ editorView: X,
3548
+ selectedImage: wn,
3549
+ zoom: Y,
3550
+ showImageProperties: M,
3551
+ getCommands: We,
3552
+ clearOverlay: rr,
3553
+ setPmSelection: Fn,
3554
+ resolvePos: Pn
3555
+ }), { handleMenuAction: Qn, handleMenuTableInsert: $n } = di({
3556
+ editorView: X,
3557
+ getCommands: We,
3558
+ docxInputRef: bt,
3559
+ showPageSetup: ce,
3560
+ showWatermark: Zt,
3725
3561
  showInsertImage: re,
3726
- showHyperlink: ae,
3727
- showInsertSymbol: j,
3728
- showKeyboardShortcuts: pe,
3729
- handleClearFormatting: At,
3730
- handleInsertPageBreak: Mt,
3731
- handleToggleOutline: $t,
3732
- handleToggleSidebar: tn,
3733
- downloadCurrentDocument: vt,
3562
+ showHyperlink: oe,
3563
+ showInsertSymbol: se,
3564
+ showKeyboardShortcuts: he,
3565
+ handleClearFormatting: Pt,
3566
+ handleInsertPageBreak: It,
3567
+ handleToggleOutline: tn,
3568
+ handleToggleSidebar: on,
3569
+ downloadCurrentDocument: Ct,
3734
3570
  emit: a
3735
3571
  });
3736
- ni({
3572
+ fi({
3737
3573
  documentBuffer: () => i.documentBuffer,
3738
3574
  document: () => i.document,
3739
- loadDocumentBuffer: yt,
3740
- loadDocument: bt,
3741
- sidebarAutoOpenedRef: lt
3575
+ loadDocumentBuffer: wt,
3576
+ loadDocument: Tt,
3577
+ sidebarAutoOpenedRef: mt
3742
3578
  });
3743
- let Jn = () => Z.value, Yn = () => d.value;
3744
- W(() => i.mode, (e) => {
3579
+ let er = () => X.value, tr = () => g.value;
3580
+ U(() => i.mode, (e) => {
3745
3581
  e && e !== o.value && (o.value = e);
3746
- }), W(() => i.showOutline, (e) => {
3747
- H.value = !!e;
3582
+ }), U(() => i.showOutline, (e) => {
3583
+ me.value = !!e;
3748
3584
  });
3749
- function Xn(e) {
3585
+ function nr(e) {
3750
3586
  o.value !== e && (o.value = e, a("mode-change", e));
3751
3587
  }
3752
- L(() => {
3753
- Tn = wn.install();
3754
- }), I(() => {
3755
- Tn?.();
3588
+ I(() => {
3589
+ jn = An.install();
3590
+ }), F(() => {
3591
+ jn?.();
3756
3592
  });
3757
- function Zn() {
3758
- er.clearOverlay();
3593
+ function rr() {
3594
+ ar.clearOverlay();
3759
3595
  }
3760
- function $n() {
3761
- er.updateSelectionOverlay();
3596
+ function ir() {
3597
+ ar.updateSelectionOverlay();
3762
3598
  }
3763
- let er = ei({
3764
- editorView: Z,
3765
- pagesRef: d,
3766
- zoom: X,
3767
- selectedImage: vn,
3768
- isHfEditing: E(() => $.value !== null),
3769
- imageInteracting: yn
3599
+ let ar = ui({
3600
+ editorView: X,
3601
+ pagesRef: g,
3602
+ zoom: Y,
3603
+ selectedImage: wn,
3604
+ isHfEditing: D(() => $.value !== null),
3605
+ imageInteracting: Tn
3770
3606
  });
3771
- I(() => {
3772
- Zn();
3607
+ F(() => {
3608
+ rr();
3773
3609
  });
3774
- let { exposed: tr } = ri({
3775
- editorView: Z,
3776
- layout: Ne,
3777
- pagesRef: d,
3778
- pagesViewportRef: g,
3779
- zoom: X,
3780
- comments: J,
3781
- focus: Le,
3782
- destroy: Re,
3783
- getDocument: Q,
3784
- setZoom: Ce,
3785
- save: xt,
3786
- loadDocument: bt,
3787
- loadDocumentBuffer: yt,
3788
- addComment: an,
3789
- replyToComment: on,
3790
- resolveComment: sn,
3791
- proposeChange: ln,
3792
- applyFormatting: Pt,
3793
- setParagraphStyle: It,
3794
- scrollVisiblePositionIntoView: An,
3795
- contentChangeSubscribers: x,
3796
- selectionChangeSubscribers: S,
3610
+ let { exposed: or } = pi({
3611
+ editorView: X,
3612
+ layout: Le,
3613
+ pagesRef: g,
3614
+ pagesViewportRef: y,
3615
+ zoom: Y,
3616
+ comments: q,
3617
+ focus: He,
3618
+ destroy: Ue,
3619
+ getDocument: Z,
3620
+ setZoom: Ee,
3621
+ save: Et,
3622
+ loadDocument: Tt,
3623
+ loadDocumentBuffer: wt,
3624
+ addComment: ln,
3625
+ replyToComment: un,
3626
+ resolveComment: dn,
3627
+ proposeChange: fn,
3628
+ applyFormatting: Rt,
3629
+ setParagraphStyle: Bt,
3630
+ scrollVisiblePositionIntoView: In,
3631
+ contentChangeSubscribers: S,
3632
+ selectionChangeSubscribers: C,
3797
3633
  onPrint: i.onPrint
3798
3634
  });
3799
- return n(tr), (t, n) => (R(), k("div", {
3800
- class: P([
3635
+ return n(or), (t, n) => (L(), k("div", {
3636
+ class: N([
3801
3637
  "docx-editor-vue ep-root paged-editor",
3802
3638
  e.className,
3803
3639
  {
@@ -3807,20 +3643,20 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3807
3643
  "paged-editor--editing-footer": V($)?.position === "footer"
3808
3644
  }
3809
3645
  ]),
3810
- style: F(e.style)
3646
+ style: P(e.style)
3811
3647
  }, [
3812
- A("div", ai, [M(cn, {
3648
+ A("div", hi, [j(vn, {
3813
3649
  "show-menu-bar": e.showMenuBar,
3814
3650
  "document-name": e.documentName,
3815
3651
  "document-name-editable": e.documentNameEditable,
3816
3652
  "render-logo": e.renderLogo,
3817
3653
  "render-title-bar-right": e.renderTitleBarRight,
3818
- onRename: V(_t),
3819
- onMenuAction: V(Kn),
3820
- onInsertTable: V(qn)
3654
+ onRename: V(St),
3655
+ onMenuAction: V(Qn),
3656
+ onInsertTable: V($n)
3821
3657
  }, {
3822
- "title-bar-left": me(() => [ue(t.$slots, "title-bar-left")]),
3823
- "title-bar-right": me(() => [ue(t.$slots, "title-bar-right")]),
3658
+ "title-bar-left": ge(() => [fe(t.$slots, "title-bar-left")]),
3659
+ "title-bar-right": ge(() => [fe(t.$slots, "title-bar-right")]),
3824
3660
  _: 3
3825
3661
  }, 8, [
3826
3662
  "show-menu-bar",
@@ -3831,37 +3667,37 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3831
3667
  "onRename",
3832
3668
  "onMenuAction",
3833
3669
  "onInsertTable"
3834
- ]), e.showToolbar ? (R(), D(b, {
3670
+ ]), e.showToolbar ? (L(), ie(b, {
3835
3671
  key: 0,
3836
- view: V(Z),
3837
- "get-commands": V(Be),
3838
- "state-tick": y.value,
3839
- "zoom-percent": V(be),
3840
- "is-min-zoom": V(xe),
3841
- "is-max-zoom": V(Se),
3842
- "zoom-presets": V(Ae),
3672
+ view: V(X),
3673
+ "get-commands": V(We),
3674
+ "state-tick": x.value,
3675
+ "zoom-percent": V(xe),
3676
+ "is-min-zoom": V(Se),
3677
+ "is-max-zoom": V(Ce),
3678
+ "zoom-presets": V(Ne),
3843
3679
  "show-zoom-control": e.showZoomControl,
3844
3680
  "editor-mode": o.value,
3845
- "comments-sidebar-open": U.value,
3846
- "image-context": V(bn),
3847
- theme: Je.value,
3681
+ "comments-sidebar-open": H.value,
3682
+ "image-context": V(En),
3683
+ theme: $e.value,
3848
3684
  "font-families": e.fontFamilies,
3849
- onInsertLink: n[0] ||= (e) => ae.value = !0,
3850
- onApplyStyle: V(jt),
3851
- onZoomIn: V(we),
3852
- onZoomOut: V(Te),
3853
- onZoomSet: V(Ce),
3854
- onToggleSidebar: V(tn),
3855
- onModeChange: Xn,
3856
- onImageWrapType: V(Sn),
3857
- onImageProperties: n[1] ||= (e) => N.value = !0,
3858
- onImageTransform: V(Cn)
3859
- }, ie({
3860
- "table-context": me(() => [M(h, {
3861
- view: V(Z),
3862
- "get-commands": V(Be),
3863
- "state-tick": y.value,
3864
- theme: Je.value
3685
+ onInsertLink: n[0] ||= (e) => oe.value = !0,
3686
+ onApplyStyle: V(Ft),
3687
+ onZoomIn: V(Oe),
3688
+ onZoomOut: V(ke),
3689
+ onZoomSet: V(Ee),
3690
+ onToggleSidebar: V(on),
3691
+ onModeChange: nr,
3692
+ onImageWrapType: V(On),
3693
+ onImageProperties: n[1] ||= (e) => M.value = !0,
3694
+ onImageTransform: V(kn)
3695
+ }, ae({
3696
+ "table-context": ge(() => [j(h, {
3697
+ view: V(X),
3698
+ "get-commands": V(We),
3699
+ "state-tick": x.value,
3700
+ theme: $e.value
3865
3701
  }, null, 8, [
3866
3702
  "view",
3867
3703
  "get-commands",
@@ -3871,11 +3707,11 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3871
3707
  _: 2
3872
3708
  }, [e.toolbarExtra ? {
3873
3709
  name: "toolbar-extra",
3874
- fn: me(() => [(R(), D(de(e.toolbarExtra)))]),
3710
+ fn: ge(() => [(L(), ie(pe(e.toolbarExtra)))]),
3875
3711
  key: "0"
3876
3712
  } : {
3877
3713
  name: "toolbar-extra",
3878
- fn: me(() => [ue(t.$slots, "toolbar-extra")]),
3714
+ fn: ge(() => [fe(t.$slots, "toolbar-extra")]),
3879
3715
  key: "1"
3880
3716
  }]), 1032, [
3881
3717
  "view",
@@ -3899,35 +3735,35 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3899
3735
  "onImageWrapType",
3900
3736
  "onImageTransform"
3901
3737
  ])) : O("", !0)]),
3902
- M(Qn, {
3903
- "show-find-replace": T.value,
3904
- "onUpdate:showFindReplace": n[2] ||= (e) => T.value = e,
3738
+ j(cr, {
3739
+ "show-find-replace": E.value,
3740
+ "onUpdate:showFindReplace": n[2] ||= (e) => E.value = e,
3905
3741
  "show-insert-image": re.value,
3906
3742
  "onUpdate:showInsertImage": n[3] ||= (e) => re.value = e,
3907
- "show-hyperlink": ae.value,
3908
- "onUpdate:showHyperlink": n[4] ||= (e) => ae.value = e,
3909
- "show-insert-symbol": j.value,
3910
- "onUpdate:showInsertSymbol": n[5] ||= (e) => j.value = e,
3911
- "show-image-properties": N.value,
3912
- "onUpdate:showImageProperties": n[6] ||= (e) => N.value = e,
3913
- "show-page-setup": oe.value,
3914
- "onUpdate:showPageSetup": n[7] ||= (e) => oe.value = e,
3915
- "show-watermark": V(Yt),
3916
- "onUpdate:showWatermark": n[8] ||= (e) => se(Yt) ? Yt.value = e : null,
3917
- "show-keyboard-shortcuts": pe.value,
3918
- "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => pe.value = e,
3919
- view: V(Z),
3920
- bookmarks: at.value,
3921
- "selected-image-pm-pos": V(vn)?.pmPos ?? null,
3922
- "section-properties": Ke.value,
3923
- "current-watermark": V(Xt),
3924
- "scroll-visible-position-into-view": V(An),
3925
- onInsertImage: V(xn),
3926
- onInsertSymbol: V(Nt),
3927
- onHyperlinkSubmit: V(Ct),
3928
- onHyperlinkRemove: V(wt),
3929
- onPageSetupApply: V(Lt),
3930
- onWatermarkApply: V(Qt)
3743
+ "show-hyperlink": oe.value,
3744
+ "onUpdate:showHyperlink": n[4] ||= (e) => oe.value = e,
3745
+ "show-insert-symbol": se.value,
3746
+ "onUpdate:showInsertSymbol": n[5] ||= (e) => se.value = e,
3747
+ "show-image-properties": M.value,
3748
+ "onUpdate:showImageProperties": n[6] ||= (e) => M.value = e,
3749
+ "show-page-setup": ce.value,
3750
+ "onUpdate:showPageSetup": n[7] ||= (e) => ce.value = e,
3751
+ "show-watermark": V(Zt),
3752
+ "onUpdate:showWatermark": n[8] ||= (e) => le(Zt) ? Zt.value = e : null,
3753
+ "show-keyboard-shortcuts": he.value,
3754
+ "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => he.value = e,
3755
+ view: V(X),
3756
+ bookmarks: lt.value,
3757
+ "selected-image-pm-pos": V(wn)?.pmPos ?? null,
3758
+ "section-properties": Ze.value,
3759
+ "current-watermark": V($t),
3760
+ "scroll-visible-position-into-view": V(In),
3761
+ onInsertImage: V(Dn),
3762
+ onInsertSymbol: V(Lt),
3763
+ onHyperlinkSubmit: V(Ot),
3764
+ onHyperlinkRemove: V(At),
3765
+ onPageSetupApply: V(Vt),
3766
+ onWatermarkApply: V(en)
3931
3767
  }, null, 8, [
3932
3768
  "show-find-replace",
3933
3769
  "show-insert-image",
@@ -3950,35 +3786,35 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3950
3786
  "onPageSetupApply",
3951
3787
  "onWatermarkApply"
3952
3788
  ]),
3953
- V(Me) ? (R(), k("div", oi, B(V(Me)), 1)) : O("", !0),
3954
- !V(je) && !V(Me) ? (R(), k("div", si, "Loading...")) : O("", !0),
3789
+ V(Ie) ? (L(), k("div", gi, B(V(Ie)), 1)) : O("", !0),
3790
+ !V(Fe) && !V(Ie) ? (L(), k("div", _i, "Loading...")) : O("", !0),
3955
3791
  A("div", {
3956
3792
  ref_key: "hiddenPmRef",
3957
- ref: u,
3793
+ ref: d,
3958
3794
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3959
3795
  }, null, 512),
3960
3796
  A("div", {
3961
3797
  class: "docx-editor-vue__editor-scroll",
3962
- onMousedown: n[32] ||= (...e) => V(rn) && V(rn)(...e)
3963
- }, [e.showRuler && Ke.value ? (R(), k("div", {
3798
+ onMousedown: n[32] ||= (...e) => V(sn) && V(sn)(...e)
3799
+ }, [e.showRuler && Ze.value ? (L(), k("div", {
3964
3800
  key: 0,
3965
3801
  class: "docx-editor-vue__ruler-row",
3966
- style: F(nt.value)
3967
- }, [M(_, {
3968
- "section-props": Ke.value,
3969
- zoom: V(X),
3802
+ style: P(ot.value)
3803
+ }, [j(_, {
3804
+ "section-props": Ze.value,
3805
+ zoom: V(Y),
3970
3806
  editable: !s.value,
3971
- "indent-left": qe.value.indentLeft,
3972
- "indent-right": qe.value.indentRight,
3973
- "first-line-indent": qe.value.firstLineIndent,
3974
- "hanging-indent": qe.value.hangingIndent,
3975
- "tab-stops": qe.value.tabStops,
3976
- onLeftMarginChange: V(Rt),
3977
- onRightMarginChange: V(zt),
3978
- onIndentLeftChange: V(Ut),
3979
- onIndentRightChange: V(Wt),
3980
- onFirstLineIndentChange: V(Gt),
3981
- onTabStopRemove: V(Kt)
3807
+ "indent-left": Qe.value.indentLeft,
3808
+ "indent-right": Qe.value.indentRight,
3809
+ "first-line-indent": Qe.value.firstLineIndent,
3810
+ "hanging-indent": Qe.value.hangingIndent,
3811
+ "tab-stops": Qe.value.tabStops,
3812
+ onLeftMarginChange: V(Ht),
3813
+ onRightMarginChange: V(Ut),
3814
+ onIndentLeftChange: V(qt),
3815
+ onIndentRightChange: V(Jt),
3816
+ onFirstLineIndentChange: V(Yt),
3817
+ onTabStopRemove: V(Xt)
3982
3818
  }, null, 8, [
3983
3819
  "section-props",
3984
3820
  "zoom",
@@ -3994,24 +3830,24 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
3994
3830
  "onIndentRightChange",
3995
3831
  "onFirstLineIndentChange",
3996
3832
  "onTabStopRemove"
3997
- ])], 4)) : O("", !0), A("div", ci, [
3833
+ ])], 4)) : O("", !0), A("div", vi, [
3998
3834
  A("div", {
3999
3835
  ref_key: "pagesViewportRef",
4000
- ref: g,
3836
+ ref: y,
4001
3837
  class: "docx-editor-vue__pages-viewport",
4002
- onMousedown: n[23] ||= (...e) => V(jn) && V(jn)(...e),
4003
- onMousemove: n[24] ||= (...e) => V(Mn) && V(Mn)(...e),
4004
- onClick: n[25] ||= (...e) => V(Nn) && V(Nn)(...e),
4005
- onDblclick: n[26] ||= (...e) => V(Pn) && V(Pn)(...e),
4006
- onContextmenu: n[27] ||= q((...e) => V(Hn) && V(Hn)(...e), ["prevent"]),
4007
- onWheel: n[28] ||= (...e) => V(De) && V(De)(...e)
3838
+ onMousedown: n[23] ||= (...e) => V(Ln) && V(Ln)(...e),
3839
+ onMousemove: n[24] ||= (...e) => V(Rn) && V(Rn)(...e),
3840
+ onClick: n[25] ||= (...e) => V(zn) && V(zn)(...e),
3841
+ onDblclick: n[26] ||= (...e) => V(Bn) && V(Bn)(...e),
3842
+ onContextmenu: n[27] ||= K((...e) => V(Jn) && V(Jn)(...e), ["prevent"]),
3843
+ onWheel: n[28] ||= (...e) => V(Ae) && V(Ae)(...e)
4008
3844
  }, [
4009
- e.showRuler && Ke.value ? (R(), k("div", li, [M(p, {
4010
- "section-props": Ke.value,
4011
- zoom: V(X),
3845
+ e.showRuler && Ze.value ? (L(), k("div", yi, [j(p, {
3846
+ "section-props": Ze.value,
3847
+ zoom: V(Y),
4012
3848
  editable: !s.value,
4013
- onTopMarginChange: V(Bt),
4014
- onBottomMarginChange: V(Vt)
3849
+ onTopMarginChange: V(Wt),
3850
+ onBottomMarginChange: V(Kt)
4015
3851
  }, null, 8, [
4016
3852
  "section-props",
4017
3853
  "zoom",
@@ -4021,23 +3857,23 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4021
3857
  ])])) : O("", !0),
4022
3858
  A("div", {
4023
3859
  ref_key: "pagesRef",
4024
- ref: d,
3860
+ ref: g,
4025
3861
  class: "docx-editor-vue__pages paged-editor__pages",
4026
- style: F(tt.value)
3862
+ style: P(at.value)
4027
3863
  }, null, 4),
4028
- s.value ? O("", !0) : (R(), D(nn, {
3864
+ s.value ? O("", !0) : (L(), ie(pn, {
4029
3865
  key: 1,
4030
- container: d.value,
4031
- view: V(Z)
3866
+ container: g.value,
3867
+ view: V(X)
4032
3868
  }, null, 8, ["container", "view"])),
4033
- M(Zt, {
3869
+ j(cn, {
4034
3870
  "is-open": V($) !== null,
4035
3871
  position: V($)?.position ?? "header",
4036
- view: et.value,
3872
+ view: rt.value,
4037
3873
  "target-rect": V($)?.targetRect ?? null,
4038
- onSave: V(Ln),
3874
+ onSave: V(Un),
4039
3875
  onClose: n[10] ||= (e) => $.value = null,
4040
- onRemove: V(Rn)
3876
+ onRemove: V(Wn)
4041
3877
  }, null, 8, [
4042
3878
  "is-open",
4043
3879
  "position",
@@ -4046,11 +3882,11 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4046
3882
  "onSave",
4047
3883
  "onRemove"
4048
3884
  ]),
4049
- (R(!0), k(w, null, le(V($) ? Ze.value : [], (e, t) => (R(), k("div", {
3885
+ (L(!0), k(T, null, de(V($) ? et.value : [], (e, t) => (L(), k("div", {
4050
3886
  key: `hf-sel-${t}-${e.top}-${e.left}`,
4051
3887
  class: "vue-hf-sel-rect",
4052
3888
  "aria-hidden": "true",
4053
- style: F({
3889
+ style: P({
4054
3890
  position: "fixed",
4055
3891
  top: `${e.top}px`,
4056
3892
  left: `${e.left}px`,
@@ -4061,74 +3897,74 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4061
3897
  zIndex: 9998
4062
3898
  })
4063
3899
  }, null, 4))), 128)),
4064
- V($) && Xe.value ? (R(), k("div", {
3900
+ V($) && Q.value ? (L(), k("div", {
4065
3901
  key: 2,
4066
3902
  "aria-hidden": "true",
4067
- style: F({
3903
+ style: P({
4068
3904
  position: "fixed",
4069
- top: `${Xe.value.top}px`,
4070
- left: `${Xe.value.left}px`,
3905
+ top: `${Q.value.top}px`,
3906
+ left: `${Q.value.left}px`,
4071
3907
  width: "2px",
4072
- height: `${Xe.value.height}px`,
3908
+ height: `${Q.value.height}px`,
4073
3909
  background: "#4285f4",
4074
3910
  pointerEvents: "none",
4075
3911
  zIndex: 9999,
4076
3912
  animation: "hf-caret-blink 1.06s steps(1) infinite"
4077
3913
  })
4078
3914
  }, null, 4)) : O("", !0),
4079
- M(Ht, {
4080
- "image-info": V(vn),
4081
- zoom: V(X),
4082
- view: V(Z),
4083
- onOpenProperties: n[11] ||= (e) => N.value = !0,
4084
- onDeselect: n[12] ||= (e) => vn.value = null,
4085
- onInteractStart: n[13] ||= (e) => yn.value = !0,
4086
- onInteractEnd: n[14] ||= (e) => yn.value = !1,
4087
- onContextMenu: V(Un)
3915
+ j(Qt, {
3916
+ "image-info": V(wn),
3917
+ zoom: V(Y),
3918
+ view: V(X),
3919
+ onOpenProperties: n[11] ||= (e) => M.value = !0,
3920
+ onDeselect: n[12] ||= (e) => wn.value = null,
3921
+ onInteractStart: n[13] ||= (e) => Tn.value = !0,
3922
+ onInteractEnd: n[14] ||= (e) => Tn.value = !1,
3923
+ onContextMenu: V(Yn)
4088
3924
  }, null, 8, [
4089
3925
  "image-info",
4090
3926
  "zoom",
4091
3927
  "view",
4092
3928
  "onContextMenu"
4093
3929
  ]),
4094
- M(Ft, {
4095
- "get-view": Jn,
4096
- "get-pages-container": Yn,
4097
- zoom: V(X),
4098
- "transaction-version": y.value,
4099
- "sync-coordinator": V(C)
3930
+ j(Gt, {
3931
+ "get-view": er,
3932
+ "get-pages-container": tr,
3933
+ zoom: V(Y),
3934
+ "transaction-version": x.value,
3935
+ "sync-coordinator": V(w)
4100
3936
  }, null, 8, [
4101
3937
  "zoom",
4102
3938
  "transaction-version",
4103
3939
  "sync-coordinator"
4104
3940
  ]),
4105
- V(ot) && !G.value && !s.value ? (R(), k("button", {
3941
+ V(dt) && !W.value && !s.value ? (L(), k("button", {
4106
3942
  key: 3,
4107
3943
  type: "button",
4108
3944
  class: "docx-editor-vue__floating-comment",
4109
- style: F({
4110
- top: V(ot).top + "px",
4111
- left: V(ot).left + "px"
3945
+ style: P({
3946
+ top: V(dt).top + "px",
3947
+ left: V(dt).left + "px"
4112
3948
  }),
4113
- title: V(l)("comments.addComment"),
4114
- onMousedown: n[15] ||= q((...e) => V(pt) && V(pt)(...e), ["prevent", "stop"])
4115
- }, [M(c, {
3949
+ title: V(u)("comments.addComment"),
3950
+ onMousedown: n[15] ||= K((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
3951
+ }, [j(c, {
4116
3952
  name: "add_comment",
4117
3953
  size: 16
4118
- })], 44, ui)) : O("", !0),
4119
- V(En) && !s.value ? (R(), k("button", {
3954
+ })], 44, bi)) : O("", !0),
3955
+ V(Mn) && !s.value ? (L(), k("button", {
4120
3956
  key: 4,
4121
3957
  type: "button",
4122
3958
  class: "docx-editor-vue__table-insert-btn",
4123
- style: F({
4124
- left: V(En).x + "px",
4125
- top: V(En).y + "px"
3959
+ style: P({
3960
+ left: V(Mn).x + "px",
3961
+ top: V(Mn).y + "px"
4126
3962
  }),
4127
- title: V(En).type === "row" ? "Insert row below" : "Insert column to the right",
4128
- "aria-label": V(En).type === "row" ? "Insert row below" : "Insert column to the right",
4129
- onMousedown: n[16] ||= (...e) => V(Fn) && V(Fn)(...e),
4130
- onMouseenter: n[17] ||= (...e) => V(In) && V(In)(...e),
4131
- onMouseleave: n[18] ||= (e) => En.value = null
3963
+ title: V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3964
+ "aria-label": V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3965
+ onMousedown: n[16] ||= (...e) => V(Vn) && V(Vn)(...e),
3966
+ onMouseenter: n[17] ||= (...e) => V(Hn) && V(Hn)(...e),
3967
+ onMouseleave: n[18] ||= (e) => Mn.value = null
4132
3968
  }, [...n[37] ||= [A("svg", {
4133
3969
  width: "12",
4134
3970
  height: "12",
@@ -4139,15 +3975,15 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4139
3975
  stroke: "currentColor",
4140
3976
  "stroke-width": "1.5",
4141
3977
  "stroke-linecap": "round"
4142
- })], -1)]], 44, di)) : O("", !0),
4143
- M(v, {
4144
- comments: J.value,
4145
- "pages-container": d.value,
4146
- zoom: V(X),
4147
- "page-width-px": rt.value,
4148
- "sidebar-open": U.value,
4149
- "resolved-comment-ids": it.value,
4150
- onMarkerClick: V(mt)
3978
+ })], -1)]], 44, xi)) : O("", !0),
3979
+ j(v, {
3980
+ comments: q.value,
3981
+ "pages-container": g.value,
3982
+ zoom: V(Y),
3983
+ "page-width-px": st.value,
3984
+ "sidebar-open": H.value,
3985
+ "resolved-comment-ids": ct.value,
3986
+ onMarkerClick: V(yt)
4151
3987
  }, null, 8, [
4152
3988
  "comments",
4153
3989
  "pages-container",
@@ -4157,30 +3993,30 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4157
3993
  "resolved-comment-ids",
4158
3994
  "onMarkerClick"
4159
3995
  ]),
4160
- M(m, {
4161
- "is-open": U.value,
4162
- comments: J.value,
4163
- "tracked-changes": Y.value,
4164
- "is-adding-comment": G.value,
4165
- "add-comment-y-position": V(ct),
3996
+ j(m, {
3997
+ "is-open": H.value,
3998
+ comments: q.value,
3999
+ "tracked-changes": _e.value,
4000
+ "is-adding-comment": W.value,
4001
+ "add-comment-y-position": V(pt),
4166
4002
  "show-resolved": !0,
4167
- "pages-container": d.value,
4168
- "page-width-px": rt.value,
4169
- zoom: V(X),
4170
- "active-item-id": K.value,
4171
- onClose: n[19] ||= (e) => U.value = !1,
4172
- onAddComment: V(dt),
4173
- onCancelAddComment: V(ft),
4174
- onCommentReply: V(un),
4175
- onCommentResolve: V(sn),
4176
- onCommentUnresolve: V(dn),
4177
- onCommentDelete: V(fn),
4178
- onAcceptChange: V(pn),
4179
- onRejectChange: V(mn),
4180
- onAcceptChangeById: V(hn),
4181
- onRejectChangeById: V(gn),
4182
- onTrackedChangeReply: V(_n),
4183
- "onUpdate:activeItemId": n[20] ||= (e) => K.value = e
4003
+ "pages-container": g.value,
4004
+ "page-width-px": st.value,
4005
+ zoom: V(Y),
4006
+ "active-item-id": G.value,
4007
+ onClose: n[19] ||= (e) => H.value = !1,
4008
+ onAddComment: V(gt),
4009
+ onCancelAddComment: V(_t),
4010
+ onCommentReply: V(mn),
4011
+ onCommentResolve: V(hn),
4012
+ onCommentUnresolve: V(gn),
4013
+ onCommentDelete: V(_n),
4014
+ onAcceptChange: V(yn),
4015
+ onRejectChange: V(bn),
4016
+ onAcceptChangeById: V(xn),
4017
+ onRejectChangeById: V(Sn),
4018
+ onTrackedChangeReply: V(Cn),
4019
+ "onUpdate:activeItemId": n[20] ||= (e) => G.value = e
4184
4020
  }, null, 8, [
4185
4021
  "is-open",
4186
4022
  "comments",
@@ -4203,14 +4039,14 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4203
4039
  "onRejectChangeById",
4204
4040
  "onTrackedChangeReply"
4205
4041
  ]),
4206
- M(Mr, {
4207
- data: V(St),
4042
+ j(Hr, {
4043
+ data: V(Dt),
4208
4044
  "read-only": s.value,
4209
- onNavigate: V(Tt),
4210
- onCopy: n[21] ||= (e) => St.value = null,
4211
- onEdit: V(Et),
4212
- onRemove: V(Ot),
4213
- onClose: n[22] ||= (e) => St.value = null
4045
+ onNavigate: V(jt),
4046
+ onCopy: n[21] ||= (e) => Dt.value = null,
4047
+ onEdit: V(Mt),
4048
+ onRemove: V(Nt),
4049
+ onClose: n[22] ||= (e) => Dt.value = null
4214
4050
  }, null, 8, [
4215
4051
  "data",
4216
4052
  "read-only",
@@ -4219,32 +4055,32 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4219
4055
  "onRemove"
4220
4056
  ])
4221
4057
  ], 544),
4222
- !H.value && e.showOutlineButton ? (R(), k("button", {
4058
+ !me.value && e.showOutlineButton ? (L(), k("button", {
4223
4059
  key: 0,
4224
4060
  type: "button",
4225
4061
  class: "docx-editor-vue__outline-toggle",
4226
4062
  title: "Show document outline",
4227
- onClick: n[29] ||= (...e) => V($t) && V($t)(...e),
4228
- onMousedown: n[30] ||= q(() => {}, ["stop"])
4229
- }, [M(c, {
4063
+ onClick: n[29] ||= (...e) => V(tn) && V(tn)(...e),
4064
+ onMousedown: n[30] ||= K(() => {}, ["stop"])
4065
+ }, [j(c, {
4230
4066
  name: "format_list_bulleted",
4231
4067
  size: 20
4232
4068
  })], 32)) : O("", !0),
4233
- V(Dn).totalPages > 1 ? (R(), D(Jt, {
4069
+ V(Nn).totalPages > 1 ? (L(), ie(an, {
4234
4070
  key: 1,
4235
- "current-page": V(Dn).currentPage,
4236
- "total-pages": V(Dn).totalPages,
4237
- visible: V(Dn).visible
4071
+ "current-page": V(Nn).currentPage,
4072
+ "total-pages": V(Nn).totalPages,
4073
+ visible: V(Nn).visible
4238
4074
  }, null, 8, [
4239
4075
  "current-page",
4240
4076
  "total-pages",
4241
4077
  "visible"
4242
4078
  ])) : O("", !0),
4243
- M(qt, {
4244
- "is-open": H.value,
4079
+ j(rn, {
4080
+ "is-open": me.value,
4245
4081
  headings: ve.value,
4246
- onClose: n[31] ||= (e) => H.value = !1,
4247
- onNavigate: V(en)
4082
+ onClose: n[31] ||= (e) => me.value = !1,
4083
+ onNavigate: V(nn)
4248
4084
  }, null, 8, [
4249
4085
  "is-open",
4250
4086
  "headings",
@@ -4253,23 +4089,23 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4253
4089
  ])], 32),
4254
4090
  A("input", {
4255
4091
  ref_key: "docxInputRef",
4256
- ref: ht,
4092
+ ref: bt,
4257
4093
  type: "file",
4258
4094
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4259
4095
  style: { display: "none" },
4260
- onChange: n[33] ||= (...e) => V(gt) && V(gt)(...e)
4096
+ onChange: n[33] ||= (...e) => V(xt) && V(xt)(...e)
4261
4097
  }, null, 544),
4262
- M(Sr, {
4098
+ j(Mr, {
4263
4099
  "read-only": s.value,
4264
- "context-menu": V(zn),
4265
- "image-context-menu": V(Bn),
4266
- "image-context-menu-text-actions": V(Vn),
4267
- "can-open-image-properties": !!V(vn),
4268
- onContextMenuAction: V(Gn),
4269
- onCloseContextMenu: n[34] ||= (e) => V(zn).isOpen = !1,
4270
- onImageWrapSelect: V(Wn),
4271
- onCloseImageContextMenu: n[35] ||= (e) => Bn.value = null,
4272
- onOpenImageProperties: n[36] ||= (e) => N.value = !0
4100
+ "context-menu": V(Gn),
4101
+ "image-context-menu": V(Kn),
4102
+ "image-context-menu-text-actions": V(qn),
4103
+ "can-open-image-properties": !!V(wn),
4104
+ onContextMenuAction: V(Zn),
4105
+ onCloseContextMenu: n[34] ||= (e) => V(Gn).isOpen = !1,
4106
+ onImageWrapSelect: V(Xn),
4107
+ onCloseImageContextMenu: n[35] ||= (e) => Kn.value = null,
4108
+ onOpenImageProperties: n[36] ||= (e) => M.value = !0
4273
4109
  }, null, 8, [
4274
4110
  "read-only",
4275
4111
  "context-menu",
@@ -4284,8 +4120,8 @@ var ai = { class: "docx-editor-vue__toolbar-shell" }, oi = {
4284
4120
  });
4285
4121
  //#endregion
4286
4122
  //#region src/renderAsync.ts
4287
- async function pi(e, t, n = {}) {
4288
- let r = e instanceof ArrayBuffer ? e : await Te(e), i = null, a = null, o = !1, s = {
4123
+ async function Ci(e, t, n = {}) {
4124
+ let r = e instanceof ArrayBuffer ? e : await Be(e), i = null, a = null, o = !1, s = {
4289
4125
  save: async () => {
4290
4126
  let e = await (i?.save() ?? Promise.resolve(null));
4291
4127
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4307,7 +4143,7 @@ async function pi(e, t, n = {}) {
4307
4143
  };
4308
4144
  return new Promise((e, c) => {
4309
4145
  a = re({ setup() {
4310
- return () => oe(fi, {
4146
+ return () => ce(Si, {
4311
4147
  ...n,
4312
4148
  documentBuffer: r,
4313
4149
  showToolbar: n.showToolbar ?? !0,
@@ -4331,6 +4167,6 @@ async function pi(e, t, n = {}) {
4331
4167
  }
4332
4168
  //#endregion
4333
4169
  //#region src/index.ts
4334
- var mi = "0.0.2";
4170
+ var wi = "0.0.2";
4335
4171
  //#endregion
4336
- export { fi as DocxEditor, mi as VERSION, bt as createDocumentWithText, xt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, pi as renderAsync, n as useTranslation };
4172
+ export { Si as DocxEditor, wi as VERSION, Lt as createDocumentWithText, Rt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, Ci as renderAsync, n as useTranslation };