@eigenpal/docx-editor-vue 1.2.1 → 1.3.0

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