@eigenpal/docx-editor-vue 1.3.0 → 1.3.1

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