@eigenpal/docx-editor-vue 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,42 +1,42 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-00eb4Ova.js";
2
- import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-DeogoqFP.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-BbuDgglK.js";
2
+ import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-CbONA9-a.js";
3
3
  import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
- 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";
4
+ import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
+ import { t as C } from "./zIndex-CxELVe_L.js";
6
+ import { i as ee, n as te, r as ne, t as w } from "./useDragAutoScroll-DbxuTWI1.js";
7
+ import { Fragment as T, Teleport as E, computed as D, createApp as re, createBlock as ie, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ae, createStaticVNode as oe, createTextVNode as se, createVNode as j, defineComponent as M, h as ce, isRef as le, nextTick as ue, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as de, renderSlot as fe, resolveDynamicComponent as pe, shallowRef as z, toDisplayString as B, unref as V, vModelCheckbox as me, vModelSelect as he, vModelText as H, watch as U, withCtx as ge, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
8
+ import { NodeSelection as q, TextSelection as J } from "prosemirror-state";
9
+ import { applyCellSelectionHighlight as _e, clickToPositionDom as ve, computeHfCaretRectFromView as ye, computeHfSelectionRectsFromView as be, findBodyPmAnchor as Y, findBodyPmSpans as xe } from "@eigenpal/docx-editor-core/layout-bridge";
10
+ import { findInDocument as Se, getPageContent as Ce, getSelectionInfo as we } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
+ import { LayoutSelectionGate as Te, addRepeatingSectionItemTr as Ee, extractSelectionState as De, findContentControlPos as Oe, findContentControlsInPM as ke, removeContentControlTr as Ae, removeRepeatingSectionItemTr as je, schema as Me, setContentControlContentTr as Ne, setContentControlValueTr as X } from "@eigenpal/docx-editor-core/prosemirror";
12
+ import { SIDEBAR_DOCUMENT_SHIFT as Pe, findWordBoundaries as Fe, loadFontDefinitions as Ie, onFontError as Le, pixelsToEmu as Re, readDocxFileFromInput as ze, toArrayBuffer as Be } from "@eigenpal/docx-editor-core/utils";
13
+ import { extractSelectionContext as Ve } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
+ import { clearFormatting as He, findHyperlinkRangeAt as Ue } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
+ import { getTableContext as Z } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
+ import { clickToPositionDom as We, getCaretPositionFromDom as Ge, getSelectionRectsFromDom as Ke } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
+ import { commitImageFloatMove as qe, commitImageInlineMove as Je, commitImageResize as Ye, isFloatingImage as Xe } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
+ import { IMAGE_LAYOUT_OPTIONS as Ze, captureInlinePositionEmu as Qe, deriveLayoutChoice as $e, findImageElement as Q, isImageLayoutOptionEnabled as et, renderAllPagesNow as tt, toolbarValueToLayoutTarget as nt } from "@eigenpal/docx-editor-core/layout-painter";
19
+ import { proseDocToBlocks as rt } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
+ import { twipsToPixels as it } from "@eigenpal/docx-editor-core/utils/units";
21
+ import { pictureWatermarkDisplayEmu as at } from "@eigenpal/docx-editor-core/types/document";
22
+ import { makeRevisionInfo as ot } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
+ import { findPageIndexContainingPmPos as st } from "@eigenpal/docx-editor-core/layout-engine";
24
+ import { applyStyle as ct, removeTabStop as lt, setIndentFirstLine as ut, setIndentLeft as dt, setIndentRight as ft } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
25
+ import { createStyleResolver as pt } from "@eigenpal/docx-editor-core/prosemirror/styles";
26
+ import { insertPageBreak as mt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
27
+ import { applyFormatting as ht, setParagraphStyle as gt } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
28
+ import { acceptChange as _t, acceptChangeById as vt, getWatermarkFromState as yt, insertImageNode as bt, rejectChange as xt, rejectChangeById as St, setWatermark as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands";
29
+ import { collectHeadings as wt } from "@eigenpal/docx-editor-core/utils/headingCollector";
30
+ import { addCommentToRange as Tt, applyProposedChange as Et, createComment as Dt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
31
+ import { PENDING_COMMENT_ID as Ot, createCommentIdAllocator as kt, seedCommentAllocator as At } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
32
+ import { extractTrackedChanges as jt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
33
+ import { TABLE_INSERT_HIDE_DELAY_MS as Mt, detectTableInsertHover as Nt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
34
+ import { openReportIssue as Pt } from "@eigenpal/docx-editor-core/utils/reportIssue";
35
+ import { ContentControlNotFoundError as Ft } from "@eigenpal/docx-editor-core/agent";
36
+ import { findParaIdRange as It } from "@eigenpal/docx-editor-core/prosemirror/paraText";
37
+ import { createDocumentWithText as Lt, createEmptyDocument as Rt } from "@eigenpal/docx-editor-core";
38
38
  //#region src/utils/domQueries.ts
39
- function Rt(e) {
39
+ function zt(e) {
40
40
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
41
41
  if (t.length === 0) return null;
42
42
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -46,18 +46,18 @@ function Rt(e) {
46
46
  }
47
47
  return r;
48
48
  }
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);
49
+ function Bt(e, t, n) {
50
+ let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : xe(e);
51
51
  for (let e of r) {
52
52
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
53
53
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
54
54
  }
55
55
  return null;
56
56
  }
57
- function Bt(e, t, n) {
57
+ function Vt(e, t, n) {
58
58
  if (!e || !t) return;
59
59
  let r = null;
60
- for (let t of be(e)) {
60
+ for (let t of xe(e)) {
61
61
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
62
62
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
63
63
  r = t;
@@ -71,21 +71,21 @@ function Bt(e, t, n) {
71
71
  behavior: "smooth"
72
72
  });
73
73
  }
74
- function Vt(e, t, n, r) {
74
+ function Ht(e, t, n, r) {
75
75
  if (!e || !t) return null;
76
- let i = X(e, n, r, 1);
76
+ let i = ve(e, n, r, 1);
77
77
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
78
78
  }
79
- function Ht(e, t, n, r) {
79
+ function Ut(e, t, n, r) {
80
80
  if (!e) return;
81
- let i = zt(e, t, r);
81
+ let i = Bt(e, t, r);
82
82
  if (!i) return;
83
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Te(a, t - o), l = o + s, u = o + c;
83
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Fe(a, t - o), l = o + s, u = o + c;
84
84
  l < u && n(l, u);
85
85
  }
86
- function Ut(e, t, n, r) {
86
+ function Wt(e, t, n, r) {
87
87
  if (!e) return;
88
- let i = zt(e, t, r);
88
+ let i = Bt(e, t, r);
89
89
  if (!i) return;
90
90
  let a = i.closest(".layout-paragraph");
91
91
  if (!a) return;
@@ -94,7 +94,7 @@ function Ut(e, t, n, r) {
94
94
  }
95
95
  //#endregion
96
96
  //#region src/components/DecorationLayer.vue
97
- var Wt = /* @__PURE__ */ N({
97
+ var Gt = /* @__PURE__ */ M({
98
98
  __name: "DecorationLayer",
99
99
  props: {
100
100
  getView: { type: Function },
@@ -112,13 +112,13 @@ var Wt = /* @__PURE__ */ N({
112
112
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
113
113
  });
114
114
  }
115
- ue(() => {
115
+ I(() => {
116
116
  a = t.syncCoordinator.onRender(() => {
117
117
  r.value++;
118
118
  }), o();
119
- }), I(() => {
119
+ }), F(() => {
120
120
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
121
- }), G(() => [
121
+ }), U(() => [
122
122
  t.zoom,
123
123
  t.transactionVersion,
124
124
  r.value
@@ -129,7 +129,7 @@ var Wt = /* @__PURE__ */ N({
129
129
  n.firstChild && n.replaceChildren();
130
130
  return;
131
131
  }
132
- let a = ee(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
132
+ let a = S(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
133
133
  for (let { decoration: t, from: n, to: r } of i) {
134
134
  if (n === r) {
135
135
  let r = l(t, e);
@@ -186,13 +186,13 @@ var Wt = /* @__PURE__ */ N({
186
186
  "aria-hidden": "true"
187
187
  }, null, 512));
188
188
  }
189
- }), Gt = ["data-handle", "onMousedown"], Kt = ["title"], qt = {
189
+ }), Kt = ["data-handle", "onMousedown"], qt = ["title"], Jt = {
190
190
  key: 0,
191
191
  class: "image-overlay__dim"
192
- }, Jt = {
192
+ }, Yt = {
193
193
  key: 1,
194
194
  class: "image-overlay__dim image-overlay__dim--rotate"
195
- }, Yt = 4, Xt = 15, Zt = /* @__PURE__ */ x(/* @__PURE__ */ N({
195
+ }, Xt = 4, Zt = 15, Qt = /* @__PURE__ */ x(/* @__PURE__ */ M({
196
196
  __name: "ImageSelectionOverlay",
197
197
  props: {
198
198
  imageInfo: {},
@@ -206,8 +206,8 @@ var Wt = /* @__PURE__ */ N({
206
206
  "context-menu"
207
207
  ],
208
208
  setup(e, { emit: 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) {
209
+ let { t: r } = n(), i = e, a = t, o = R(null), s = R(!1), c = R(!1), l = R(!1), u = R(0), d = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
210
+ function ee(e, t) {
211
211
  if (!e) return null;
212
212
  try {
213
213
  let n = e.state.doc.nodeAt(t);
@@ -216,20 +216,20 @@ var Wt = /* @__PURE__ */ N({
216
216
  return null;
217
217
  }
218
218
  }
219
- function ne() {
219
+ function te() {
220
220
  return o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
221
221
  }
222
- function re() {
222
+ function ne() {
223
223
  let e = i.imageInfo;
224
224
  if (!e) return null;
225
225
  if (e.element.isConnected) return e.element;
226
- let t = ne();
226
+ let t = te();
227
227
  if (!t) return null;
228
- let n = ye(t, e.pmPos);
229
- return n ? Ue(n) : null;
228
+ let n = Y(t, e.pmPos);
229
+ return n ? Q(n) : null;
230
230
  }
231
- function C() {
232
- let e = re();
231
+ function w() {
232
+ let e = ne();
233
233
  if (!e || !o.value) {
234
234
  p.value = null;
235
235
  return;
@@ -247,26 +247,26 @@ var Wt = /* @__PURE__ */ N({
247
247
  height: r.height / a
248
248
  };
249
249
  }
250
- G(() => i.imageInfo, async () => {
251
- await ce(), C();
252
- }, { immediate: !0 }), G(() => i.zoom, (e, t, n) => {
250
+ U(() => i.imageInfo, async () => {
251
+ await ue(), w();
252
+ }, { immediate: !0 }), U(() => i.zoom, (e, t, n) => {
253
253
  if (!i.imageInfo) return;
254
254
  let r = 0, a = "", o = 0, s = 0, c = (e) => {
255
- C();
255
+ w();
256
256
  let t = p.value, n = t ? `${t.left}|${t.top}|${t.width}|${t.height}` : "";
257
257
  o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
258
258
  };
259
259
  r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
260
- }), G(() => i.imageInfo, (e, t, n) => {
260
+ }), U(() => i.imageInfo, (e, t, n) => {
261
261
  if (!i.imageInfo) return;
262
262
  let r = () => {
263
- b && cancelAnimationFrame(b), b = requestAnimationFrame(C);
263
+ b && cancelAnimationFrame(b), b = requestAnimationFrame(w);
264
264
  }, a = o.value?.closest(".docx-editor-vue__pages-viewport");
265
265
  a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
266
266
  a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
267
267
  });
268
268
  }, { immediate: !0 });
269
- let T = E(() => s.value ? u.value : p.value?.width || 0), ie = E(() => s.value ? d.value : p.value?.height || 0), D = E(() => {
269
+ let E = D(() => s.value ? u.value : p.value?.width || 0), re = D(() => s.value ? d.value : p.value?.height || 0), ie = D(() => {
270
270
  let e = p.value;
271
271
  if (!e) return {
272
272
  position: "absolute",
@@ -284,11 +284,11 @@ var Wt = /* @__PURE__ */ N({
284
284
  height: `${n}px`,
285
285
  transform: r === 1 ? void 0 : `scale(${r})`,
286
286
  transformOrigin: "top left",
287
- zIndex: S.imageOverlay,
287
+ zIndex: C.imageOverlay,
288
288
  pointerEvents: "auto"
289
289
  };
290
- }), ae = E(() => {
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";
290
+ }), ae = D(() => {
291
+ let e = E.value, t = re.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
292
292
  return [
293
293
  {
294
294
  pos: "nw",
@@ -356,7 +356,7 @@ var Wt = /* @__PURE__ */ N({
356
356
  }
357
357
  ];
358
358
  }), oe = (e) => e.length === 2;
359
- function j(e, t, n, r, i, a) {
359
+ function se(e, t, n, r, i, a) {
360
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;
361
361
  if (oe(e) && a) {
362
362
  let e = Math.max(c / r, l / i);
@@ -367,11 +367,11 @@ var Wt = /* @__PURE__ */ N({
367
367
  height: s === 0 ? i : Math.max(20, Math.min(2e3, l))
368
368
  };
369
369
  }
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));
370
+ function j(e, t) {
371
+ !i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", M), document.addEventListener("mouseup", ce));
372
372
  }
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);
373
+ function M(e) {
374
+ let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = se(m, n, r, _, v, a);
375
375
  u.value = Math.round(o.width), d.value = Math.round(o.height);
376
376
  let s = y;
377
377
  s && (p.value = {
@@ -381,81 +381,81 @@ var Wt = /* @__PURE__ */ N({
381
381
  height: s.height
382
382
  });
383
383
  }
384
- function P() {
385
- document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", P), s.value = !1, y = null, a("interact-end");
384
+ function ce() {
385
+ document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), s.value = !1, y = null, a("interact-end");
386
386
  let e = i.view, t = i.imageInfo;
387
387
  if (!e || !t) {
388
- C();
388
+ w();
389
389
  return;
390
390
  }
391
- let n = ze(e, t.pmPos, u.value, d.value);
392
- n !== null && _e(n), ce(() => C());
391
+ let n = Ye(e, t.pmPos, u.value, d.value);
392
+ n !== null && ye(n), ue(() => w());
393
393
  }
394
- let se = 0, le = 0, ue = 0, de = 0, fe = null, B = null;
395
- function pe(e) {
394
+ let le = 0, N = 0, I = 0, fe = 0, pe = null, z = null;
395
+ function me(e) {
396
396
  if (!e) return 0;
397
397
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
398
398
  return t ? parseFloat(t[1]) : 0;
399
399
  }
400
- function U(e, t) {
400
+ function he(e, t) {
401
401
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
402
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;
403
403
  }
404
- function W(e, t) {
405
- return Math.atan2(e - se, -(t - le)) * 180 / Math.PI;
404
+ function H(e, t) {
405
+ return Math.atan2(e - le, -(t - N)) * 180 / Math.PI;
406
406
  }
407
- function me(e) {
407
+ function ge(e) {
408
408
  if (!i.imageInfo) return;
409
409
  let t = i.imageInfo.element.getBoundingClientRect();
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);
410
+ le = t.left + t.width / 2, N = t.top + t.height / 2;
411
+ let n = ee(i.view, i.imageInfo.pmPos);
412
+ pe = n && n.attrs.transform || null, fe = me(pe), z = i.imageInfo.element.querySelector("img"), I = H(e.clientX, e.clientY), f.value = fe, l.value = !0, a("interact-start"), document.addEventListener("mousemove", W), document.addEventListener("mouseup", G);
413
413
  }
414
- function K(e) {
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) || "");
414
+ function W(e) {
415
+ let t = H(e.clientX, e.clientY) - I, n = fe + t;
416
+ e.shiftKey || (n = Math.round(n / Zt) * Zt), f.value = (n % 360 + 360) % 360, z && (z.style.transform = he(pe, f.value) || "");
417
417
  }
418
- function q() {
419
- document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", q), l.value = !1, a("interact-end");
418
+ function G() {
419
+ document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), l.value = !1, a("interact-end");
420
420
  let e = i.view, t = i.imageInfo;
421
421
  try {
422
- let n = e && t ? te(e, t.pmPos) : null;
422
+ let n = e && t ? ee(e, t.pmPos) : null;
423
423
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
424
424
  ...n.attrs,
425
- transform: U(n.attrs.transform, f.value)
426
- })), _e(t.pmPos));
425
+ transform: he(n.attrs.transform, f.value)
426
+ })), ye(t.pmPos));
427
427
  } catch {} finally {
428
- B && (B.style.transform = ""), B = null, fe = null;
428
+ z && (z.style.transform = ""), z = null, pe = null;
429
429
  }
430
- ce(() => C());
430
+ ue(() => w());
431
431
  }
432
- let Y = null;
433
- function ge(e) {
432
+ let J = null;
433
+ function _e(e) {
434
434
  if (!i.imageInfo || !p.value) return;
435
435
  let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
436
436
  let s = e.clientX - t, l = e.clientY - n;
437
- if (!(!o && Math.sqrt(s * s + l * l) < Yt)) {
437
+ if (!(!o && Math.sqrt(s * s + l * l) < Xt)) {
438
438
  if (!o) {
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);";
439
+ o = !0, c.value = !0, a("interact-start"), J = document.createElement("div"), J.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
440
440
  let e = i.zoom;
441
- Y.style.width = `${r.width * e}px`, Y.style.height = `${r.height * e}px`, document.body.appendChild(Y);
441
+ J.style.width = `${r.width * e}px`, J.style.height = `${r.height * e}px`, document.body.appendChild(J);
442
442
  }
443
- if (Y) {
443
+ if (J) {
444
444
  let t = i.zoom;
445
- Y.style.left = `${e.clientX - r.width * t / 2}px`, Y.style.top = `${e.clientY - r.height * t / 2}px`;
445
+ J.style.left = `${e.clientX - r.width * t / 2}px`, J.style.top = `${e.clientY - r.height * t / 2}px`;
446
446
  }
447
447
  }
448
448
  }, l = (e) => {
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));
449
+ document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, J &&= (J.remove(), null), c.value = !1, o && (a("interact-end"), ve(e.clientX, e.clientY));
450
450
  };
451
- x = s, ee = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
451
+ x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
452
452
  }
453
- function X(e, t) {
453
+ function ve(e, t) {
454
454
  let n = i.view, r = i.imageInfo;
455
455
  if (!n || !r) return;
456
- let a = te(n, r.pmPos);
456
+ let a = ee(n, r.pmPos);
457
457
  if (a) {
458
- if (Q(a)) {
458
+ if (Xe(a)) {
459
459
  let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
460
460
  if (!a || a.length === 0) return;
461
461
  let s = null;
@@ -467,65 +467,65 @@ var Wt = /* @__PURE__ */ N({
467
467
  }
468
468
  }
469
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);
470
+ let c = s.getBoundingClientRect(), l = i.zoom, u = Re((e - c.left) / l), d = Re((t - c.top) / l), f = qe(n, r.pmPos, u, d);
471
+ f !== null && ye(f);
472
472
  } else {
473
- let i = ne();
473
+ let i = te();
474
474
  if (!i) return;
475
- let a = Pe(i, e, t, 1);
475
+ let a = We(i, e, t, 1);
476
476
  if (a == null || a < 0) return;
477
- let o = Re(n, r.pmPos, a);
478
- o !== null && _e(o);
477
+ let o = Je(n, r.pmPos, a);
478
+ o !== null && ye(o);
479
479
  }
480
- ce(() => C());
480
+ ue(() => w());
481
481
  }
482
482
  }
483
- function _e(e) {
483
+ function ye(e) {
484
484
  let t = i.view;
485
485
  if (t) try {
486
- let n = he.create(t.state.doc, e);
486
+ let n = q.create(t.state.doc, e);
487
487
  t.dispatch(t.state.tr.setSelection(n));
488
488
  } catch {}
489
489
  }
490
- return I(() => {
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);
490
+ return F(() => {
491
+ document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), J &&= (J.remove(), null), b && cancelAnimationFrame(b);
492
492
  }), (t, n) => e.imageInfo ? (L(), k("div", {
493
493
  key: 0,
494
494
  ref_key: "overlayRootRef",
495
495
  ref: o,
496
496
  class: "image-overlay",
497
- style: F(D.value),
498
- onMousedown: n[3] ||= J(() => {}, ["stop"])
497
+ style: P(ie.value),
498
+ onMousedown: n[3] ||= K(() => {}, ["stop"])
499
499
  }, [
500
500
  n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
501
501
  A("div", {
502
502
  class: "image-overlay__body",
503
- style: F({ cursor: c.value ? "grabbing" : "grab" }),
504
- onMousedown: n[0] ||= J((e) => ge(e), ["prevent", "stop"]),
505
- onContextmenu: n[1] ||= J((e) => t.$emit("context-menu", e), ["prevent", "stop"])
503
+ style: P({ cursor: c.value ? "grabbing" : "grab" }),
504
+ onMousedown: n[0] ||= K((e) => _e(e), ["prevent", "stop"]),
505
+ onContextmenu: n[1] ||= K((e) => t.$emit("context-menu", e), ["prevent", "stop"])
506
506
  }, null, 36),
507
- (L(!0), k(w, null, z(ae.value, (e) => (L(), k("div", {
507
+ (L(!0), k(T, null, de(ae.value, (e) => (L(), k("div", {
508
508
  key: e.pos,
509
509
  class: "image-overlay__handle",
510
- style: F(e.style),
510
+ style: P(e.style),
511
511
  "data-handle": e.pos,
512
- onMousedown: J((t) => M(t, e.pos), ["prevent", "stop"])
513
- }, null, 44, Gt))), 128)),
512
+ onMousedown: K((t) => j(t, e.pos), ["prevent", "stop"])
513
+ }, null, 44, Kt))), 128)),
514
514
  n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
515
515
  A("div", {
516
516
  class: "image-overlay__rotate-handle",
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)
517
+ style: P({ left: `${E.value / 2 - 7}px` }),
518
+ title: V(r)("imageOverlay.rotate"),
519
+ onMousedown: n[2] ||= K((e) => ge(e), ["prevent", "stop"])
520
+ }, null, 44, qt),
521
+ s.value ? (L(), k("div", Jt, B(Math.round(u.value)) + " × " + B(Math.round(d.value)), 1)) : O("", !0),
522
+ l.value ? (L(), k("div", Yt, B(Math.round(f.value)) + "° ", 1)) : O("", !0)
523
523
  ], 36)) : O("", !0);
524
524
  }
525
- }), [["__scopeId", "data-v-df7c380c"]]), Qt = { class: "doc-outline__header" }, $t = { class: "doc-outline__body" }, en = {
525
+ }), [["__scopeId", "data-v-df7c380c"]]), $t = { class: "doc-outline__header" }, en = { class: "doc-outline__body" }, tn = {
526
526
  key: 0,
527
527
  class: "doc-outline__empty"
528
- }, tn = ["onMousedown"], nn = /* @__PURE__ */ x(/* @__PURE__ */ N({
528
+ }, nn = ["onMousedown"], rn = /* @__PURE__ */ x(/* @__PURE__ */ M({
529
529
  __name: "DocumentOutline",
530
530
  props: {
531
531
  isOpen: { type: Boolean },
@@ -538,23 +538,23 @@ var Wt = /* @__PURE__ */ N({
538
538
  class: "doc-outline",
539
539
  role: "navigation",
540
540
  "aria-label": "Document outline",
541
- onMousedown: n[1] ||= J(() => {}, ["stop"])
542
- }, [A("div", Qt, [A("button", {
541
+ onMousedown: n[1] ||= K(() => {}, ["stop"])
542
+ }, [A("div", $t, [A("button", {
543
543
  class: "doc-outline__back",
544
544
  title: "Close outline",
545
545
  "aria-label": "Close outline",
546
546
  onClick: n[0] ||= (e) => t.$emit("close")
547
- }, [M(c, {
547
+ }, [j(c, {
548
548
  name: "arrow_back",
549
549
  size: 20
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", {
550
+ })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", en, [e.headings.length === 0 ? (L(), k("div", tn, " No headings found ")) : O("", !0), (L(!0), k(T, null, de(e.headings, (e, n) => (L(), k("button", {
551
551
  key: n,
552
552
  class: "doc-outline__item",
553
- style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
554
- onMousedown: J((n) => t.$emit("navigate", e.pmPos), ["prevent"])
555
- }, V(e.text || "(untitled)"), 45, tn))), 128))])], 32)) : O("", !0);
553
+ style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
554
+ onMousedown: K((n) => t.$emit("navigate", e.pmPos), ["prevent"])
555
+ }, B(e.text || "(untitled)"), 45, nn))), 128))])], 32)) : O("", !0);
556
556
  }
557
- }), [["__scopeId", "data-v-cb2cdc39"]]), rn = /* @__PURE__ */ x(/* @__PURE__ */ N({
557
+ }), [["__scopeId", "data-v-cb2cdc39"]]), an = /* @__PURE__ */ x(/* @__PURE__ */ M({
558
558
  __name: "PageIndicator",
559
559
  props: {
560
560
  currentPage: {},
@@ -565,18 +565,18 @@ var Wt = /* @__PURE__ */ N({
565
565
  let { t } = n();
566
566
  return (n, r) => (L(), k("div", {
567
567
  class: "docx-editor-vue__page-indicator",
568
- style: F({ opacity: +!!e.visible }),
568
+ style: P({ opacity: +!!e.visible }),
569
569
  "aria-live": "polite",
570
570
  role: "status"
571
- }, V(H(t)("viewer.pageIndicator", {
571
+ }, B(V(t)("viewer.pageIndicator", {
572
572
  current: e.currentPage,
573
573
  total: e.totalPages
574
574
  })), 5));
575
575
  }
576
- }), [["__scopeId", "data-v-d117bf6e"]]), an = { class: "hf-editor__label" }, on = {
576
+ }), [["__scopeId", "data-v-d117bf6e"]]), on = { class: "hf-editor__label" }, sn = {
577
577
  class: "hf-editor__actions",
578
578
  style: { position: "relative" }
579
- }, sn = /* @__PURE__ */ x(/* @__PURE__ */ N({
579
+ }, cn = /* @__PURE__ */ x(/* @__PURE__ */ M({
580
580
  __name: "InlineHeaderFooterEditor",
581
581
  props: {
582
582
  isOpen: { type: Boolean },
@@ -594,7 +594,7 @@ var Wt = /* @__PURE__ */ N({
594
594
  function o(e) {
595
595
  let t = n.view;
596
596
  if (!t) return;
597
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = et.nodes.field.create({
597
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Me.nodes.field.create({
598
598
  fieldType: e,
599
599
  instruction: ` ${e} \\* MERGEFORMAT `,
600
600
  fieldKind: "simple",
@@ -614,34 +614,34 @@ var Wt = /* @__PURE__ */ N({
614
614
  pointerEvents: "none"
615
615
  });
616
616
  }
617
- G(() => n.isOpen, (e) => {
617
+ U(() => n.isOpen, (e) => {
618
618
  e && (s(), n.view?.focus());
619
- }), G(() => n.targetRect, () => {
619
+ }), U(() => n.targetRect, () => {
620
620
  n.isOpen && s();
621
621
  }, { deep: !0 });
622
622
  function c() {
623
- n.view && (r("save", qe(n.view.state.doc)), r("close"));
623
+ n.view && (r("save", rt(n.view.state.doc)), r("close"));
624
624
  }
625
625
  return (t, n) => e.isOpen ? (L(), k("div", {
626
626
  key: 0,
627
627
  class: "hf-editor",
628
- style: F(i.value)
628
+ style: P(i.value)
629
629
  }, [A("div", {
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, [
630
+ class: N(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
631
+ onMousedown: n[8] ||= K(() => {}, ["stop"]),
632
+ onContextmenu: n[9] ||= K(() => {}, ["stop"])
633
+ }, [A("span", on, B(e.position === "header" ? "Header" : "Footer"), 1), A("div", sn, [
634
634
  A("button", {
635
635
  class: "hf-editor__btn",
636
636
  title: "Options",
637
- onMousedown: n[0] ||= J(() => {}, ["prevent"]),
637
+ onMousedown: n[0] ||= K(() => {}, ["prevent"]),
638
638
  onClick: n[1] ||= (e) => a.value = !a.value
639
639
  }, " Options ▾ ", 32),
640
640
  a.value ? (L(), k("div", {
641
641
  key: 0,
642
642
  class: "hf-editor__dropdown",
643
- onMousedown: n[4] ||= J(() => {}, ["stop"]),
644
- onContextmenu: n[5] ||= J(() => {}, ["stop"])
643
+ onMousedown: n[4] ||= K(() => {}, ["stop"]),
644
+ onContextmenu: n[5] ||= K(() => {}, ["stop"])
645
645
  }, [A("button", {
646
646
  type: "button",
647
647
  class: "hf-editor__dropdown-item",
@@ -658,24 +658,24 @@ var Wt = /* @__PURE__ */ N({
658
658
  A("button", {
659
659
  class: "hf-editor__btn",
660
660
  title: "Remove",
661
- onMousedown: n[6] ||= J((e) => t.$emit("remove"), ["prevent"])
661
+ onMousedown: n[6] ||= K((e) => t.$emit("remove"), ["prevent"])
662
662
  }, " Remove ", 32),
663
663
  A("button", {
664
664
  class: "hf-editor__btn hf-editor__btn--primary",
665
665
  title: "Save",
666
- onMousedown: J(c, ["prevent"])
666
+ onMousedown: K(c, ["prevent"])
667
667
  }, " Save ", 32),
668
668
  A("button", {
669
669
  class: "hf-editor__btn",
670
670
  title: "Cancel",
671
- onMousedown: n[7] ||= J((e) => t.$emit("close"), ["prevent"])
671
+ onMousedown: n[7] ||= K((e) => t.$emit("close"), ["prevent"])
672
672
  }, " Cancel ", 32)
673
673
  ])], 34)], 4)) : O("", !0);
674
674
  }
675
- }), [["__scopeId", "data-v-e93a9f94"]]), cn = ["role"], ln = {
675
+ }), [["__scopeId", "data-v-e93a9f94"]]), ln = ["role"], un = {
676
676
  key: 0,
677
677
  class: "layout-sdt-widget-empty"
678
- }, un = ["aria-selected", "onClick"], dn = ["value"], fn = /* @__PURE__ */ N({
678
+ }, dn = ["aria-selected", "onClick"], fn = ["value"], pn = /* @__PURE__ */ M({
679
679
  __name: "ContentControlWidgets",
680
680
  props: {
681
681
  container: {},
@@ -690,14 +690,14 @@ var Wt = /* @__PURE__ */ N({
690
690
  function a(e, t) {
691
691
  let i = n.view;
692
692
  if (i) try {
693
- i.dispatch(nt(i.state, { tag: e }, t)), i.focus();
693
+ i.dispatch(X(i.state, { tag: e }, t)), i.focus();
694
694
  } catch {}
695
695
  r.value = null;
696
696
  }
697
697
  function o(e) {
698
698
  let r = n.view, i = t(e.dataset.sdtGroupId);
699
699
  if (!(!r || i == null)) try {
700
- let t = e.dataset.sdtRepeat === "add" ? Ye(r.state, i) : $e(r.state, i);
700
+ let t = e.dataset.sdtRepeat === "add" ? Ee(r.state, i) : je(r.state, i);
701
701
  r.dispatch(t), r.focus();
702
702
  } catch {}
703
703
  }
@@ -708,7 +708,7 @@ var Wt = /* @__PURE__ */ N({
708
708
  function c(e) {
709
709
  let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
710
710
  if (!t || !i || !o) return;
711
- let s = Ze(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
711
+ let s = ke(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
712
712
  o === "checkbox" ? a(i, {
713
713
  kind: "checkbox",
714
714
  checked: !s?.checked
@@ -748,10 +748,10 @@ var Wt = /* @__PURE__ */ N({
748
748
  e.key === "Escape" && (r.value = null);
749
749
  }
750
750
  let p = null;
751
- G(() => n.container, (e) => {
751
+ U(() => n.container, (e) => {
752
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));
753
- }, { immediate: !0 }), G(r, (e) => {
754
- e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ce(() => {
753
+ }, { immediate: !0 }), U(r, (e) => {
754
+ e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ue(() => {
755
755
  let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
756
756
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
757
757
  })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
@@ -764,7 +764,7 @@ var Wt = /* @__PURE__ */ N({
764
764
  let n = t.indexOf(document.activeElement);
765
765
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
766
766
  }
767
- I(() => {
767
+ F(() => {
768
768
  p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
769
769
  });
770
770
  function h(e) {
@@ -780,36 +780,36 @@ var Wt = /* @__PURE__ */ N({
780
780
  ref: i,
781
781
  class: "layout-sdt-widget-popup",
782
782
  role: r.value.kind === "dropdown" ? "listbox" : void 0,
783
- style: F({
783
+ style: P({
784
784
  position: "fixed",
785
785
  top: r.value.y + "px",
786
786
  left: r.value.x + "px",
787
787
  zIndex: 1e3
788
788
  }),
789
789
  onKeydown: m,
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", {
790
+ onMousedown: t[0] ||= K(() => {}, ["prevent"])
791
+ }, [r.value.kind === "dropdown" ? (L(), k(T, { key: 0 }, [r.value.items.length === 0 ? (L(), k("div", un, "No options")) : O("", !0), (L(!0), k(T, null, de(r.value.items, (e) => (L(), k("button", {
792
792
  key: e.value,
793
793
  type: "button",
794
794
  role: "option",
795
795
  "aria-selected": e.displayText === r.value.current,
796
- class: le(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
796
+ class: N(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
797
797
  onClick: (t) => a(r.value.tag, {
798
798
  kind: "dropdown",
799
799
  value: e.value
800
800
  })
801
- }, V(e.displayText), 11, un))), 128))], 64)) : (L(), k("input", {
801
+ }, B(e.displayText), 11, dn))), 128))], 64)) : (L(), k("input", {
802
802
  key: 1,
803
803
  type: "date",
804
804
  class: "layout-sdt-widget-date",
805
805
  value: r.value.current,
806
806
  onChange: h
807
- }, null, 40, dn))], 44, cn)) : O("", !0);
807
+ }, null, 40, fn))], 44, ln)) : O("", !0);
808
808
  }
809
- }), pn = {
809
+ }), mn = {
810
810
  key: 0,
811
811
  class: "docx-editor-vue__title-bar"
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({
812
+ }, hn = { class: "docx-editor-vue__title-bar-left" }, gn = { class: "docx-editor-vue__title-bar-center" }, _n = { class: "docx-editor-vue__title-bar-right" }, vn = /* @__PURE__ */ M({
813
813
  __name: "DocxEditorMenuBar",
814
814
  props: {
815
815
  showMenuBar: { type: Boolean },
@@ -828,38 +828,38 @@ var Wt = /* @__PURE__ */ N({
828
828
  ],
829
829
  setup(e, { emit: t }) {
830
830
  let n = t;
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, {
831
+ return (t, r) => e.showMenuBar ? (L(), k("div", mn, [
832
+ A("div", hn, [e.renderLogo ? (L(), ie(pe(e.renderLogo), { key: 0 })) : O("", !0), fe(t.$slots, "title-bar-left")]),
833
+ A("div", gn, [j(g, {
834
834
  "model-value": e.documentName,
835
835
  editable: e.documentNameEditable,
836
836
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
837
- }, null, 8, ["model-value", "editable"]), M(y, {
837
+ }, null, 8, ["model-value", "editable"]), j(y, {
838
838
  onAction: r[1] ||= (e) => n("menu-action", e),
839
839
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
840
840
  })]),
841
- A("div", gn, [de(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), D(fe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
841
+ A("div", _n, [fe(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), ie(pe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
842
842
  ])) : O("", !0);
843
843
  }
844
- }), vn = ["aria-label"], yn = { class: "wm-header" }, bn = { class: "wm-body" }, xn = { class: "wm-radio-row" }, Sn = ["checked"], Cn = {
844
+ }), yn = ["aria-label"], bn = { class: "wm-header" }, xn = { class: "wm-body" }, Sn = { class: "wm-radio-row" }, Cn = ["checked"], wn = {
845
845
  for: "wm-none",
846
846
  class: "wm-inline-label"
847
- }, wn = { class: "wm-radio-row" }, Tn = ["checked"], En = {
847
+ }, Tn = { class: "wm-radio-row" }, En = ["checked"], Dn = {
848
848
  for: "wm-picture",
849
849
  class: "wm-inline-label"
850
- }, Dn = {
850
+ }, On = {
851
851
  key: 0,
852
852
  class: "wm-subform"
853
- }, On = { class: "wm-row" }, $ = {
853
+ }, kn = { class: "wm-row" }, An = {
854
854
  key: 0,
855
855
  class: "wm-row"
856
- }, kn = ["src"], An = { class: "wm-row" }, jn = { class: "wm-label" }, Mn = { class: "wm-inline-label" }, Nn = { class: "wm-radio-row" }, Pn = ["checked"], Fn = {
856
+ }, jn = ["src"], Mn = { class: "wm-row" }, $ = { class: "wm-label" }, Nn = { class: "wm-inline-label" }, Pn = { class: "wm-radio-row" }, Fn = ["checked"], In = {
857
857
  for: "wm-text",
858
858
  class: "wm-inline-label"
859
- }, In = {
859
+ }, Ln = {
860
860
  key: 1,
861
861
  class: "wm-subform"
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({
862
+ }, Rn = { class: "wm-row" }, zn = { class: "wm-label" }, Bn = ["value"], Vn = ["value"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-row" }, Gn = { class: "wm-label" }, Kn = ["value"], qn = { class: "wm-row" }, Jn = { class: "wm-label" }, Yn = { class: "wm-inline-label" }, Xn = { class: "wm-row" }, Zn = { class: "wm-label" }, Qn = { class: "wm-row" }, $n = { class: "wm-label" }, er = { class: "wm-inline-label" }, tr = ["checked"], nr = { class: "wm-inline-label" }, rr = ["checked"], ir = { class: "wm-inline-label" }, ar = { class: "wm-footer" }, or = ["disabled"], sr = /* @__PURE__ */ x(/* @__PURE__ */ M({
863
863
  __name: "WatermarkDialog",
864
864
  props: {
865
865
  isOpen: { type: Boolean },
@@ -882,7 +882,7 @@ var Wt = /* @__PURE__ */ N({
882
882
  "Verdana",
883
883
  "Courier New"
884
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) => {
885
+ U(() => o.isOpen, (e) => {
886
886
  if (!e) return;
887
887
  let t = o.current;
888
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 ? {
@@ -890,12 +890,12 @@ var Wt = /* @__PURE__ */ N({
890
890
  heightEmu: t.heightEmu
891
891
  } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : c.value = "none";
892
892
  }, { immediate: !0 });
893
- let b = E(() => c.value === "picture" && !g.value);
893
+ let b = D(() => c.value === "picture" && !g.value);
894
894
  function x(e) {
895
895
  let t = e.target.value;
896
896
  t && (l.value = t);
897
897
  }
898
- function ee(e) {
898
+ function S(e) {
899
899
  let t = e.target.files?.[0];
900
900
  if (!t) return;
901
901
  let n = new FileReader();
@@ -904,14 +904,14 @@ var Wt = /* @__PURE__ */ N({
904
904
  if (g.value = e, _.value = void 0, !e) return;
905
905
  let t = new Image();
906
906
  t.onload = () => {
907
- _.value = it(t.naturalWidth, t.naturalHeight);
907
+ _.value = at(t.naturalWidth, t.naturalHeight);
908
908
  }, t.src = e;
909
909
  }, n.readAsDataURL(t);
910
910
  }
911
- function S() {
911
+ function C() {
912
912
  s("close");
913
913
  }
914
- function te() {
914
+ function ee() {
915
915
  if (c.value === "none") s("apply", null);
916
916
  else if (c.value === "text") s("apply", {
917
917
  kind: "text",
@@ -932,101 +932,101 @@ var Wt = /* @__PURE__ */ N({
932
932
  ..._.value ?? {}
933
933
  });
934
934
  }
935
- S();
935
+ C();
936
936
  }
937
- function ne(e) {
938
- e.key === "Escape" && S();
937
+ function te(e) {
938
+ e.key === "Escape" && C();
939
939
  }
940
940
  return (t, n) => e.isOpen ? (L(), k("div", {
941
941
  key: 0,
942
942
  class: "wm-overlay",
943
- onMousedown: J(S, ["self"]),
944
- onKeydown: ne
943
+ onMousedown: K(C, ["self"]),
944
+ onKeydown: te
945
945
  }, [A("div", {
946
946
  class: "wm-dialog",
947
947
  role: "dialog",
948
- "aria-label": H(a)("dialogs.watermark.title"),
949
- onMousedown: n[13] ||= J(() => {}, ["stop"])
948
+ "aria-label": V(a)("dialogs.watermark.title"),
949
+ onMousedown: n[13] ||= K(() => {}, ["stop"])
950
950
  }, [
951
- A("div", yn, V(H(a)("dialogs.watermark.title")), 1),
952
- A("div", bn, [
953
- A("div", xn, [A("input", {
951
+ A("div", bn, B(V(a)("dialogs.watermark.title")), 1),
952
+ A("div", xn, [
953
+ A("div", Sn, [A("input", {
954
954
  id: "wm-none",
955
955
  type: "radio",
956
956
  checked: c.value === "none",
957
957
  onChange: n[0] ||= (e) => c.value = "none"
958
- }, null, 40, Sn), A("label", Cn, V(H(a)("dialogs.watermark.noWatermark")), 1)]),
959
- A("div", wn, [A("input", {
958
+ }, null, 40, Cn), A("label", wn, B(V(a)("dialogs.watermark.noWatermark")), 1)]),
959
+ A("div", Tn, [A("input", {
960
960
  id: "wm-picture",
961
961
  type: "radio",
962
962
  checked: c.value === "picture",
963
963
  onChange: n[1] ||= (e) => c.value = "picture"
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", {
964
+ }, null, 40, En), A("label", Dn, B(V(a)("dialogs.watermark.picture")), 1)]),
965
+ c.value === "picture" ? (L(), k("div", On, [
966
+ A("div", kn, [A("input", {
967
967
  type: "file",
968
968
  accept: "image/*",
969
- onChange: ee
969
+ onChange: S
970
970
  }, null, 32)]),
971
- g.value ? (L(), k("div", $, [A("img", {
971
+ g.value ? (L(), k("div", An, [A("img", {
972
972
  src: g.value,
973
973
  alt: "",
974
974
  class: "wm-preview"
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", {
975
+ }, null, 8, jn)])) : O("", !0),
976
+ A("div", Mn, [
977
+ A("span", $, B(V(a)("dialogs.watermark.scale")), 1),
978
+ W(A("input", {
979
979
  class: "wm-input wm-input--narrow",
980
980
  type: "number",
981
981
  min: "10",
982
982
  max: "500",
983
983
  "onUpdate:modelValue": n[2] ||= (e) => v.value = e
984
984
  }, null, 512), [[
985
- W,
985
+ H,
986
986
  v.value,
987
987
  void 0,
988
988
  { number: !0 }
989
989
  ]]),
990
990
  n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
991
991
  ]),
992
- A("label", Mn, [K(A("input", {
992
+ A("label", Nn, [W(A("input", {
993
993
  type: "checkbox",
994
994
  "onUpdate:modelValue": n[3] ||= (e) => y.value = e
995
- }, null, 512), [[pe, y.value]]), j(" " + V(H(a)("dialogs.watermark.washout")), 1)])
995
+ }, null, 512), [[me, y.value]]), se(" " + B(V(a)("dialogs.watermark.washout")), 1)])
996
996
  ])) : O("", !0),
997
- A("div", Nn, [A("input", {
997
+ A("div", Pn, [A("input", {
998
998
  id: "wm-text",
999
999
  type: "radio",
1000
1000
  checked: c.value === "text",
1001
1001
  onChange: n[4] ||= (e) => c.value = "text"
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", {
1002
+ }, null, 40, Fn), A("label", In, B(V(a)("dialogs.watermark.text")), 1)]),
1003
+ c.value === "text" ? (L(), k("div", Ln, [
1004
+ A("div", Rn, [A("span", zn, B(V(a)("dialogs.watermark.presetLabel")), 1), A("select", {
1005
1005
  class: "wm-input",
1006
1006
  value: r.includes(l.value) ? l.value : "",
1007
1007
  onChange: x
1008
- }, [n[15] ||= A("option", { value: "" }, "—", -1), (L(), k(w, null, z(r, (e) => A("option", {
1008
+ }, [n[15] ||= A("option", { value: "" }, "—", -1), (L(), k(T, null, de(r, (e) => A("option", {
1009
1009
  key: e,
1010
1010
  value: e
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", {
1011
+ }, B(e), 9, Vn)), 64))], 40, Bn)]),
1012
+ A("div", Hn, [A("span", Un, B(V(a)("dialogs.watermark.textLabel")), 1), W(A("input", {
1013
1013
  class: "wm-input",
1014
1014
  "onUpdate:modelValue": n[5] ||= (e) => l.value = e
1015
- }, null, 512), [[W, l.value]])]),
1016
- A("div", Un, [A("span", Wn, V(H(a)("dialogs.watermark.fontLabel")), 1), K(A("select", {
1015
+ }, null, 512), [[H, l.value]])]),
1016
+ A("div", Wn, [A("span", Gn, B(V(a)("dialogs.watermark.fontLabel")), 1), W(A("select", {
1017
1017
  class: "wm-input",
1018
1018
  "onUpdate:modelValue": n[6] ||= (e) => u.value = e
1019
- }, [(L(), k(w, null, z(i, (e) => A("option", {
1019
+ }, [(L(), k(T, null, de(i, (e) => A("option", {
1020
1020
  key: e,
1021
1021
  value: e
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", {
1022
+ }, B(e), 9, Kn)), 64))], 512), [[he, u.value]])]),
1023
+ A("div", qn, [
1024
+ A("span", Jn, B(V(a)("dialogs.watermark.sizeLabel")), 1),
1025
+ A("label", Yn, [W(A("input", {
1026
1026
  type: "checkbox",
1027
1027
  "onUpdate:modelValue": n[7] ||= (e) => d.value = e
1028
- }, null, 512), [[pe, d.value]]), j(" " + V(H(a)("dialogs.watermark.sizeAuto")), 1)]),
1029
- d.value ? O("", !0) : K((L(), k("input", {
1028
+ }, null, 512), [[me, d.value]]), se(" " + B(V(a)("dialogs.watermark.sizeAuto")), 1)]),
1029
+ d.value ? O("", !0) : W((L(), k("input", {
1030
1030
  key: 0,
1031
1031
  class: "wm-input wm-input--narrow",
1032
1032
  type: "number",
@@ -1034,50 +1034,50 @@ var Wt = /* @__PURE__ */ N({
1034
1034
  max: "200",
1035
1035
  "onUpdate:modelValue": n[8] ||= (e) => f.value = e
1036
1036
  }, null, 512)), [[
1037
- W,
1037
+ H,
1038
1038
  f.value,
1039
1039
  void 0,
1040
1040
  { number: !0 }
1041
1041
  ]])
1042
1042
  ]),
1043
- A("div", Yn, [A("span", Xn, V(H(a)("dialogs.watermark.colorLabel")), 1), K(A("input", {
1043
+ A("div", Xn, [A("span", Zn, B(V(a)("dialogs.watermark.colorLabel")), 1), W(A("input", {
1044
1044
  type: "color",
1045
1045
  "onUpdate:modelValue": n[9] ||= (e) => p.value = e
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", {
1046
+ }, null, 512), [[H, p.value]])]),
1047
+ A("div", Qn, [
1048
+ A("span", $n, B(V(a)("dialogs.watermark.layoutLabel")), 1),
1049
+ A("label", er, [A("input", {
1050
1050
  type: "radio",
1051
1051
  name: "wm-layout",
1052
1052
  checked: m.value === "diagonal",
1053
1053
  onChange: n[10] ||= (e) => m.value = "diagonal"
1054
- }, null, 40, er), j(" " + V(H(a)("dialogs.watermark.diagonal")), 1)]),
1055
- A("label", tr, [A("input", {
1054
+ }, null, 40, tr), se(" " + B(V(a)("dialogs.watermark.diagonal")), 1)]),
1055
+ A("label", nr, [A("input", {
1056
1056
  type: "radio",
1057
1057
  name: "wm-layout",
1058
1058
  checked: m.value === "horizontal",
1059
1059
  onChange: n[11] ||= (e) => m.value = "horizontal"
1060
- }, null, 40, nr), j(" " + V(H(a)("dialogs.watermark.horizontal")), 1)])
1060
+ }, null, 40, rr), se(" " + B(V(a)("dialogs.watermark.horizontal")), 1)])
1061
1061
  ]),
1062
- A("label", rr, [K(A("input", {
1062
+ A("label", ir, [W(A("input", {
1063
1063
  type: "checkbox",
1064
1064
  "onUpdate:modelValue": n[12] ||= (e) => h.value = e
1065
- }, null, 512), [[pe, h.value]]), j(" " + V(H(a)("dialogs.watermark.semitransparent")), 1)])
1065
+ }, null, 512), [[me, h.value]]), se(" " + B(V(a)("dialogs.watermark.semitransparent")), 1)])
1066
1066
  ])) : O("", !0)
1067
1067
  ]),
1068
- A("div", ir, [A("button", {
1068
+ A("div", ar, [A("button", {
1069
1069
  type: "button",
1070
1070
  class: "wm-btn",
1071
- onClick: S
1072
- }, V(H(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1071
+ onClick: C
1072
+ }, B(V(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1073
1073
  type: "button",
1074
- class: le(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1074
+ class: N(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1075
1075
  disabled: b.value,
1076
- onClick: te
1077
- }, V(H(a)("dialogs.watermark.applyButton")), 11, ar)])
1078
- ], 40, vn)], 32)) : O("", !0);
1076
+ onClick: ee
1077
+ }, B(V(a)("dialogs.watermark.applyButton")), 11, or)])
1078
+ ], 40, yn)], 32)) : O("", !0);
1079
1079
  }
1080
- }), [["__scopeId", "data-v-5edfdc47"]]), sr = /* @__PURE__ */ N({
1080
+ }), [["__scopeId", "data-v-5edfdc47"]]), cr = /* @__PURE__ */ M({
1081
1081
  __name: "DocxEditorDialogs",
1082
1082
  props: {
1083
1083
  view: {},
@@ -1113,8 +1113,8 @@ var Wt = /* @__PURE__ */ N({
1113
1113
  ],
1114
1114
  setup(t, { emit: n }) {
1115
1115
  let r = n;
1116
- return (n, a) => (L(), k(w, null, [
1117
- M(u, {
1116
+ return (n, a) => (L(), k(T, null, [
1117
+ j(u, {
1118
1118
  "is-open": t.showFindReplace,
1119
1119
  view: t.view,
1120
1120
  "scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
@@ -1124,12 +1124,12 @@ var Wt = /* @__PURE__ */ N({
1124
1124
  "view",
1125
1125
  "scroll-visible-position-into-view"
1126
1126
  ]),
1127
- M(s, {
1127
+ j(s, {
1128
1128
  "is-open": t.showInsertImage,
1129
1129
  onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
1130
1130
  onInsert: a[2] ||= (e) => r("insert-image", e)
1131
1131
  }, null, 8, ["is-open"]),
1132
- M(e, {
1132
+ j(e, {
1133
1133
  "is-open": t.showHyperlink,
1134
1134
  view: t.view,
1135
1135
  bookmarks: t.bookmarks,
@@ -1141,12 +1141,12 @@ var Wt = /* @__PURE__ */ N({
1141
1141
  "view",
1142
1142
  "bookmarks"
1143
1143
  ]),
1144
- M(i, {
1144
+ j(i, {
1145
1145
  "is-open": t.showInsertSymbol,
1146
1146
  onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
1147
1147
  onInsert: a[7] ||= (e) => r("insert-symbol", e)
1148
1148
  }, null, 8, ["is-open"]),
1149
- M(l, {
1149
+ j(l, {
1150
1150
  "is-open": t.showImageProperties,
1151
1151
  view: t.view,
1152
1152
  "pm-pos": t.selectedImagePmPos,
@@ -1156,28 +1156,28 @@ var Wt = /* @__PURE__ */ N({
1156
1156
  "view",
1157
1157
  "pm-pos"
1158
1158
  ]),
1159
- M(o, {
1159
+ j(o, {
1160
1160
  "is-open": t.showPageSetup,
1161
1161
  "section-properties": t.sectionProperties,
1162
1162
  onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
1163
1163
  onApply: a[10] ||= (e) => r("page-setup-apply", e)
1164
1164
  }, null, 8, ["is-open", "section-properties"]),
1165
- M(or, {
1165
+ j(sr, {
1166
1166
  "is-open": t.showWatermark,
1167
1167
  current: t.currentWatermark,
1168
1168
  onClose: a[11] ||= (e) => r("update:showWatermark", !1),
1169
1169
  onApply: a[12] ||= (e) => r("watermark-apply", e)
1170
1170
  }, null, 8, ["is-open", "current"]),
1171
- M(d, {
1171
+ j(d, {
1172
1172
  "is-open": t.showKeyboardShortcuts,
1173
1173
  onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
1174
1174
  }, null, 8, ["is-open"])
1175
1175
  ], 64));
1176
1176
  }
1177
- }), cr = ["disabled", "onMousedown"], lr = { class: "ctx-menu__label" }, ur = {
1177
+ }), lr = ["disabled", "onMousedown"], ur = { class: "ctx-menu__label" }, dr = {
1178
1178
  key: 0,
1179
1179
  class: "ctx-menu__shortcut"
1180
- }, dr = 220, fr = 32, pr = 10, mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1180
+ }, fr = 220, pr = 32, mr = 10, hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1181
1181
  __name: "TextContextMenu",
1182
1182
  props: {
1183
1183
  isOpen: { type: Boolean },
@@ -1191,35 +1191,35 @@ var Wt = /* @__PURE__ */ N({
1191
1191
  },
1192
1192
  emits: ["close", "action"],
1193
1193
  setup(e, { emit: t }) {
1194
- let n = e, r = t, i = R(null), a = E(() => {
1194
+ let r = e, i = t, { t: a } = n(), o = R(null), s = D(() => {
1195
1195
  let e = [
1196
1196
  {
1197
1197
  id: "cut",
1198
- label: "Cut",
1198
+ label: a("contextMenu.cut"),
1199
1199
  action: "cut",
1200
- shortcut: "Ctrl+X",
1201
- disabled: !n.hasSelection || !n.isEditable
1200
+ shortcut: a("contextMenu.cutShortcut"),
1201
+ disabled: !r.hasSelection || !r.isEditable
1202
1202
  },
1203
1203
  {
1204
1204
  id: "copy",
1205
- label: "Copy",
1205
+ label: a("contextMenu.copy"),
1206
1206
  action: "copy",
1207
- shortcut: "Ctrl+C",
1208
- disabled: !n.hasSelection
1207
+ shortcut: a("contextMenu.copyShortcut"),
1208
+ disabled: !r.hasSelection
1209
1209
  },
1210
1210
  {
1211
1211
  id: "paste",
1212
- label: "Paste",
1212
+ label: a("contextMenu.paste"),
1213
1213
  action: "paste",
1214
- shortcut: "Ctrl+V",
1215
- disabled: !n.isEditable
1214
+ shortcut: a("contextMenu.pasteShortcut"),
1215
+ disabled: !r.isEditable
1216
1216
  },
1217
1217
  {
1218
1218
  id: "pasteAsPlainText",
1219
- label: "Paste as Plain Text",
1219
+ label: a("contextMenu.pastePlainText"),
1220
1220
  action: "pasteAsPlainText",
1221
- shortcut: "Ctrl+Shift+V",
1222
- disabled: !n.isEditable
1221
+ shortcut: a("contextMenu.pastePlainTextShortcut"),
1222
+ disabled: !r.isEditable
1223
1223
  },
1224
1224
  {
1225
1225
  id: "div1",
@@ -1229,52 +1229,52 @@ var Wt = /* @__PURE__ */ N({
1229
1229
  },
1230
1230
  {
1231
1231
  id: "delete",
1232
- label: "Delete",
1232
+ label: a("contextMenu.delete"),
1233
1233
  action: "delete",
1234
- shortcut: "Del",
1235
- disabled: !n.hasSelection || !n.isEditable
1234
+ shortcut: a("contextMenu.deleteShortcut"),
1235
+ disabled: !r.hasSelection || !r.isEditable
1236
1236
  },
1237
1237
  {
1238
1238
  id: "selectAll",
1239
- label: "Select All",
1239
+ label: a("contextMenu.selectAll"),
1240
1240
  action: "selectAll",
1241
- shortcut: "Ctrl+A"
1241
+ shortcut: a("contextMenu.selectAllShortcut")
1242
1242
  }
1243
1243
  ];
1244
- return n.onImage && n.isEditable && e.push({
1244
+ return r.onImage && r.isEditable && e.push({
1245
1245
  id: "div-img",
1246
1246
  label: "",
1247
1247
  action: "",
1248
1248
  divider: !0
1249
1249
  }, {
1250
1250
  id: "replaceImage",
1251
- label: "Replace image…",
1251
+ label: a("imageOverlay.replaceImage"),
1252
1252
  action: "replaceImage"
1253
1253
  }, {
1254
1254
  id: "imageProperties",
1255
- label: "Image properties…",
1255
+ label: a("imageWrap.menu.imageProperties"),
1256
1256
  action: "imageProperties"
1257
1257
  }, {
1258
1258
  id: "deleteImage",
1259
- label: "Delete image",
1259
+ label: a("imageOverlay.deleteImage"),
1260
1260
  action: "deleteImage",
1261
- shortcut: "Del"
1262
- }), n.inTable && n.isEditable && e.push({
1261
+ shortcut: a("contextMenu.deleteShortcut")
1262
+ }), r.inTable && r.isEditable && e.push({
1263
1263
  id: "div2",
1264
1264
  label: "",
1265
1265
  action: "",
1266
1266
  divider: !0
1267
1267
  }, {
1268
1268
  id: "addRowAbove",
1269
- label: "Insert row above",
1269
+ label: a("table.insertRowAbove"),
1270
1270
  action: "addRowAbove"
1271
1271
  }, {
1272
1272
  id: "addRowBelow",
1273
- label: "Insert row below",
1273
+ label: a("table.insertRowBelow"),
1274
1274
  action: "addRowBelow"
1275
1275
  }, {
1276
1276
  id: "deleteRow",
1277
- label: "Delete row",
1277
+ label: a("table.deleteRow"),
1278
1278
  action: "deleteRow"
1279
1279
  }, {
1280
1280
  id: "div3",
@@ -1283,15 +1283,15 @@ var Wt = /* @__PURE__ */ N({
1283
1283
  divider: !0
1284
1284
  }, {
1285
1285
  id: "addColLeft",
1286
- label: "Insert column left",
1286
+ label: a("table.insertColumnLeft"),
1287
1287
  action: "addColumnLeft"
1288
1288
  }, {
1289
1289
  id: "addColRight",
1290
- label: "Insert column right",
1290
+ label: a("table.insertColumnRight"),
1291
1291
  action: "addColumnRight"
1292
1292
  }, {
1293
1293
  id: "deleteCol",
1294
- label: "Delete column",
1294
+ label: a("table.deleteColumn"),
1295
1295
  action: "deleteColumn"
1296
1296
  }, {
1297
1297
  id: "div4",
@@ -1300,74 +1300,74 @@ var Wt = /* @__PURE__ */ N({
1300
1300
  divider: !0
1301
1301
  }, {
1302
1302
  id: "mergeCells",
1303
- label: "Merge cells",
1303
+ label: a("table.mergeCells"),
1304
1304
  action: "mergeCells",
1305
- disabled: !n.canMergeCells
1305
+ disabled: !r.canMergeCells
1306
1306
  }, {
1307
1307
  id: "splitCell",
1308
- label: "Split cell",
1308
+ label: a("table.splitCell"),
1309
1309
  action: "splitCell",
1310
- disabled: !n.canSplitCell
1310
+ disabled: !r.canSplitCell
1311
1311
  }), e;
1312
- }), o = E(() => {
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)), {
1312
+ }), c = D(() => {
1313
+ let e = r.position.x, t = r.position.y, n = s.value.filter((e) => !e.divider).length, i = s.value.filter((e) => e.divider).length, a = n * pr + i * 9;
1314
+ return typeof window < "u" && (e + fr + mr > window.innerWidth && (e = window.innerWidth - fr - mr), t + a + mr > window.innerHeight && (t = window.innerHeight - a - mr)), {
1315
1315
  position: "fixed",
1316
1316
  left: `${e}px`,
1317
1317
  top: `${t}px`,
1318
1318
  zIndex: 400
1319
1319
  };
1320
1320
  });
1321
- function s(e) {
1322
- e && (r("action", e), r("close"));
1321
+ function l(e) {
1322
+ e && (i("action", e), i("close"));
1323
1323
  }
1324
- function c(e) {
1325
- e.key === "Escape" && r("close");
1324
+ function u(e) {
1325
+ e.key === "Escape" && i("close");
1326
1326
  }
1327
- return G(() => n.isOpen, (e) => {
1328
- e && ce(() => i.value?.focus());
1329
- }), (t, n) => (L(), D(T, { to: "body" }, [e.isOpen ? (L(), k("div", {
1327
+ return U(() => r.isOpen, (e) => {
1328
+ e && ue(() => o.value?.focus());
1329
+ }), (t, n) => (L(), ie(E, { to: "body" }, [e.isOpen ? (L(), k("div", {
1330
1330
  key: 0,
1331
1331
  class: "ctx-menu-backdrop",
1332
1332
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1333
- onContextmenu: n[1] ||= J((e) => t.$emit("close"), ["prevent"])
1333
+ onContextmenu: n[1] ||= K((e) => t.$emit("close"), ["prevent"])
1334
1334
  }, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
1335
1335
  key: 1,
1336
1336
  ref_key: "menuRef",
1337
- ref: i,
1337
+ ref: o,
1338
1338
  class: "ctx-menu",
1339
- style: F(o.value),
1340
- onContextmenu: n[2] ||= J(() => {}, ["prevent"]),
1341
- onKeydown: c
1342
- }, [(L(!0), k(w, null, z(a.value, (e, t) => (L(), k("button", {
1339
+ style: P(c.value),
1340
+ onContextmenu: n[2] ||= K(() => {}, ["prevent"]),
1341
+ onKeydown: u
1342
+ }, [(L(!0), k(T, null, de(s.value, (e, t) => (L(), k("button", {
1343
1343
  key: e.id || t,
1344
- class: le(["ctx-menu__item", {
1344
+ class: N(["ctx-menu__item", {
1345
1345
  "ctx-menu__item--disabled": e.disabled,
1346
1346
  "ctx-menu__item--divider": e.divider
1347
1347
  }]),
1348
1348
  disabled: e.disabled,
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)]));
1349
+ onMousedown: K((t) => l(e.action), ["prevent"])
1350
+ }, [A("span", ur, B(e.label), 1), e.shortcut ? (L(), k("span", dr, B(e.shortcut), 1)) : O("", !0)], 42, lr))), 128))], 36)) : O("", !0)]));
1351
1351
  }
1352
- }), [["__scopeId", "data-v-741c4f71"]]), hr = ["aria-label"], gr = { class: "image-ctx-menu__icon" }, _r = { class: "image-ctx-menu__label" }, vr = {
1352
+ }), [["__scopeId", "data-v-b2122da6"]]), gr = ["aria-label"], _r = { class: "image-ctx-menu__icon" }, vr = { class: "image-ctx-menu__label" }, yr = {
1353
1353
  key: 1,
1354
1354
  class: "image-ctx-menu__divider",
1355
1355
  role: "separator"
1356
- }, yr = [
1356
+ }, br = [
1357
1357
  "data-wrap-type",
1358
1358
  "data-current",
1359
1359
  "data-disabled",
1360
1360
  "disabled",
1361
1361
  "title",
1362
1362
  "onClick"
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 = {
1363
+ ], xr = { class: "image-ctx-menu__icon" }, Sr = { class: "image-ctx-menu__label" }, Cr = ["aria-label"], wr = ["disabled", "onClick"], Tr = { class: "image-ctx-menu__label" }, Er = {
1364
1364
  key: 0,
1365
1365
  class: "image-ctx-menu__shortcut"
1366
- }, Er = {
1366
+ }, Dr = {
1367
1367
  key: 0,
1368
1368
  class: "image-ctx-menu__divider",
1369
1369
  role: "separator"
1370
- }, Dr = 18, Or = 260, kr = 10, Ar = /* @__PURE__ */ x(/* @__PURE__ */ N({
1370
+ }, Or = 18, kr = 260, Ar = 10, jr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1371
1371
  __name: "ImageContextMenu",
1372
1372
  props: {
1373
1373
  state: {},
@@ -1388,7 +1388,7 @@ var Wt = /* @__PURE__ */ N({
1388
1388
  function a() {
1389
1389
  i("open-properties"), i("close");
1390
1390
  }
1391
- let { t: o } = n(), s = R(null), l = Be, u = E(() => r.state ? He(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1391
+ let { t: o } = n(), s = R(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1392
1392
  inline: "wrap_text",
1393
1393
  squareLeft: "format_image_left",
1394
1394
  squareRight: "format_image_right",
@@ -1398,19 +1398,19 @@ var Wt = /* @__PURE__ */ N({
1398
1398
  function f(e) {
1399
1399
  return d[e];
1400
1400
  }
1401
- let p = E(() => {
1401
+ let p = D(() => {
1402
1402
  if (!r.state) return {};
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)), {
1403
+ let e = Ze.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1404
+ return typeof window < "u" && (t + kr > window.innerWidth && (t = window.innerWidth - kr - Ar), n + e > window.innerHeight && (n = window.innerHeight - e - Ar), t < Ar && (t = Ar), n < Ar && (n = Ar)), {
1405
1405
  position: "fixed",
1406
1406
  left: `${t}px`,
1407
1407
  top: `${n}px`,
1408
- minWidth: `${Or}px`,
1408
+ minWidth: `${kr}px`,
1409
1409
  zIndex: 400
1410
1410
  };
1411
1411
  });
1412
1412
  function m(e) {
1413
- return r.state ? We(e, r.state.currentWrapType) : !1;
1413
+ return r.state ? et(e, r.state.currentWrapType) : !1;
1414
1414
  }
1415
1415
  function h(e) {
1416
1416
  m(e) && (i("select", e.choice), i("close"));
@@ -1424,21 +1424,21 @@ var Wt = /* @__PURE__ */ N({
1424
1424
  function v(e) {
1425
1425
  e.key === "Escape" && (e.preventDefault(), i("close"));
1426
1426
  }
1427
- return (t, n) => (L(), D(T, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1427
+ return (t, n) => (L(), ie(E, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1428
1428
  key: 0,
1429
1429
  class: "image-ctx-menu-backdrop",
1430
1430
  onMousedown: _,
1431
- onContextmenu: n[0] ||= J((e) => t.$emit("close"), ["prevent"])
1431
+ onContextmenu: n[0] ||= K((e) => t.$emit("close"), ["prevent"])
1432
1432
  }, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
1433
1433
  key: 1,
1434
1434
  ref_key: "menuRef",
1435
1435
  ref: s,
1436
1436
  class: "image-ctx-menu",
1437
1437
  role: "menu",
1438
- "aria-label": H(o)("imageWrap.menu.ariaLabel"),
1438
+ "aria-label": V(o)("imageWrap.menu.ariaLabel"),
1439
1439
  "data-testid": "image-context-menu",
1440
- style: F(p.value),
1441
- onContextmenu: n[4] ||= J(() => {}, ["prevent"]),
1440
+ style: P(p.value),
1441
+ onContextmenu: n[4] ||= K(() => {}, ["prevent"]),
1442
1442
  onKeydown: v
1443
1443
  }, [
1444
1444
  e.canOpenProperties ? (L(), k("button", {
@@ -1447,51 +1447,51 @@ var Wt = /* @__PURE__ */ N({
1447
1447
  role: "menuitem",
1448
1448
  class: "image-ctx-menu__item",
1449
1449
  "data-action": "open-properties",
1450
- onMousedown: n[1] ||= J(() => {}, ["prevent"]),
1450
+ onMousedown: n[1] ||= K(() => {}, ["prevent"]),
1451
1451
  onClick: a
1452
- }, [A("span", gr, [M(c, {
1452
+ }, [A("span", _r, [j(c, {
1453
1453
  name: "settings",
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", {
1454
+ size: Or
1455
+ })]), A("span", vr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1456
+ e.canOpenProperties ? (L(), k("div", yr)) : O("", !0),
1457
+ (L(!0), k(T, null, de(V(l), (e) => (L(), k("button", {
1458
1458
  key: e.choice,
1459
1459
  type: "button",
1460
1460
  role: "menuitem",
1461
- class: le(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1461
+ class: N(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1462
1462
  "data-wrap-type": e.choice,
1463
1463
  "data-current": e.choice === u.value ? "true" : "false",
1464
1464
  "data-disabled": m(e) ? "false" : "true",
1465
1465
  disabled: !m(e),
1466
- title: H(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1467
- onMousedown: n[2] ||= J(() => {}, ["prevent"]),
1466
+ title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1467
+ onMousedown: n[2] ||= K(() => {}, ["prevent"]),
1468
1468
  onClick: (t) => h(e)
1469
1469
  }, [
1470
- A("span", br, [M(c, {
1470
+ A("span", xr, [j(c, {
1471
1471
  name: f(e.iconHint),
1472
- size: Dr
1472
+ size: Or
1473
1473
  }, null, 8, ["name"])]),
1474
- A("span", xr, V(H(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1474
+ A("span", Sr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1475
1475
  e.choice === u.value ? (L(), k("span", {
1476
1476
  key: 0,
1477
1477
  class: "image-ctx-menu__current-dot",
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", {
1478
+ "aria-label": V(o)("imageWrap.menu.ariaLabel")
1479
+ }, "●", 8, Cr)) : O("", !0)
1480
+ ], 42, br))), 128)),
1481
+ e.textActions && e.textActions.length > 0 ? (L(), k(T, { key: 2 }, [n[5] ||= A("div", {
1482
1482
  class: "image-ctx-menu__divider",
1483
1483
  role: "separator"
1484
- }, null, -1), (L(!0), k(w, null, z(e.textActions, (e, t) => (L(), k(w, { key: `${e.action}-${t}` }, [A("button", {
1484
+ }, null, -1), (L(!0), k(T, null, de(e.textActions, (e, t) => (L(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1485
1485
  type: "button",
1486
1486
  role: "menuitem",
1487
1487
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1488
1488
  disabled: e.disabled,
1489
- onMousedown: n[3] ||= J(() => {}, ["prevent"]),
1489
+ onMousedown: n[3] ||= K(() => {}, ["prevent"]),
1490
1490
  onClick: (t) => g(e)
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)]));
1491
+ }, [A("span", Tr, B(e.label), 1), e.shortcut ? (L(), k("span", Er, B(e.shortcut), 1)) : O("", !0)], 40, wr), e.dividerAfter ? (L(), k("div", Dr)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1492
+ ], 44, gr)) : O("", !0)]));
1493
1493
  }
1494
- }), [["__scopeId", "data-v-5c21ca8c"]]), jr = /* @__PURE__ */ N({
1494
+ }), [["__scopeId", "data-v-5c21ca8c"]]), Mr = /* @__PURE__ */ M({
1495
1495
  __name: "DocxEditorOverlays",
1496
1496
  props: {
1497
1497
  readOnly: { type: Boolean },
@@ -1509,7 +1509,7 @@ var Wt = /* @__PURE__ */ N({
1509
1509
  ],
1510
1510
  setup(e, { emit: t }) {
1511
1511
  let n = t;
1512
- return (t, r) => (L(), k(w, null, [M(mr, {
1512
+ return (t, r) => (L(), k(T, null, [j(hr, {
1513
1513
  "is-open": e.contextMenu.isOpen,
1514
1514
  position: e.contextMenu.position,
1515
1515
  "has-selection": e.contextMenu.hasSelection,
@@ -1529,7 +1529,7 @@ var Wt = /* @__PURE__ */ N({
1529
1529
  "on-image",
1530
1530
  "can-merge-cells",
1531
1531
  "can-split-cell"
1532
- ]), M(Ar, {
1532
+ ]), j(jr, {
1533
1533
  state: e.imageContextMenu,
1534
1534
  "text-actions": e.imageContextMenuTextActions,
1535
1535
  "can-open-properties": e.canOpenImageProperties,
@@ -1543,7 +1543,7 @@ var Wt = /* @__PURE__ */ N({
1543
1543
  "can-open-properties"
1544
1544
  ])], 64));
1545
1545
  }
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({
1546
+ }), Nr = ["href", "title"], Pr = ["title"], Fr = ["title"], Ir = ["title"], Lr = { class: "docx-hyperlink-popup__edit-row" }, Rr = ["placeholder", "onKeydown"], zr = { class: "docx-hyperlink-popup__edit-row" }, Br = ["onKeydown"], Vr = ["disabled"], Hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1547
1547
  __name: "HyperlinkPopup",
1548
1548
  props: {
1549
1549
  data: {},
@@ -1557,25 +1557,25 @@ var Wt = /* @__PURE__ */ N({
1557
1557
  "close"
1558
1558
  ],
1559
1559
  setup(e, { emit: t }) {
1560
- let { t: r } = n(), i = e, a = t, o = R(!1), s = R(""), c = R(""), l = R(null), u = E(() => ({
1560
+ let { t: r } = n(), i = e, a = t, o = R(!1), s = R(""), c = R(""), l = R(null), u = D(() => ({
1561
1561
  left: (i.data?.position.left ?? 0) + "px",
1562
1562
  top: (i.data?.position.top ?? 0) + "px"
1563
1563
  }));
1564
- G(() => i.data?.href, () => {
1564
+ U(() => i.data?.href, () => {
1565
1565
  o.value = !1;
1566
1566
  });
1567
1567
  let d = null, f = null;
1568
1568
  function p() {
1569
1569
  f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
1570
1570
  }
1571
- G(() => i.data, (e) => {
1571
+ U(() => i.data, (e) => {
1572
1572
  p(), e && (d = (e) => {
1573
1573
  let t = l.value;
1574
1574
  t && !t.contains(e.target) && a("close");
1575
1575
  }, f = setTimeout(() => {
1576
1576
  d && document.addEventListener("mousedown", d);
1577
1577
  }, 0));
1578
- }, { immediate: !0 }), I(p);
1578
+ }, { immediate: !0 }), F(p);
1579
1579
  function m() {
1580
1580
  i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
1581
1581
  }
@@ -1589,36 +1589,36 @@ var Wt = /* @__PURE__ */ N({
1589
1589
  key: 0,
1590
1590
  ref_key: "popupRef",
1591
1591
  ref: l,
1592
- class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1593
- style: F(u.value),
1594
- onMousedown: n[6] ||= J(() => {}, ["stop"])
1595
- }, [o.value ? (L(), k(w, { key: 1 }, [A("div", Ir, [K(A("input", {
1592
+ class: N(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1593
+ style: P(u.value),
1594
+ onMousedown: n[6] ||= K(() => {}, ["stop"])
1595
+ }, [o.value ? (L(), k(T, { key: 1 }, [A("div", Lr, [W(A("input", {
1596
1596
  class: "docx-hyperlink-popup__input",
1597
- placeholder: H(r)("hyperlinkPopup.displayTextPlaceholder"),
1597
+ placeholder: V(r)("hyperlinkPopup.displayTextPlaceholder"),
1598
1598
  "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
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", {
1599
+ onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[3] ||= G((e) => t.$emit("close"), ["esc"])]
1600
+ }, null, 40, Rr), [[H, s.value]])]), A("div", zr, [W(A("input", {
1601
1601
  class: "docx-hyperlink-popup__input",
1602
1602
  placeholder: "https://...",
1603
1603
  "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1604
- onKeydown: [q(J(h, ["prevent"]), ["enter"]), n[5] ||= q((e) => t.$emit("close"), ["esc"])]
1605
- }, null, 40, zr), [[W, c.value]]), A("button", {
1604
+ onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[5] ||= G((e) => t.$emit("close"), ["esc"])]
1605
+ }, null, 40, Br), [[H, c.value]]), A("button", {
1606
1606
  class: "docx-hyperlink-popup__apply",
1607
1607
  disabled: !c.value.trim(),
1608
- onClick: J(h, ["prevent"])
1609
- }, V(H(r)("common.apply")), 9, Br)])], 64)) : (L(), k(w, { key: 0 }, [
1608
+ onClick: K(h, ["prevent"])
1609
+ }, B(V(r)("common.apply")), 9, Vr)])], 64)) : (L(), k(T, { key: 0 }, [
1610
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),
1611
1611
  A("a", {
1612
1612
  class: "docx-hyperlink-popup__url",
1613
1613
  href: e.data.href,
1614
1614
  title: e.data.href,
1615
- onClick: n[0] ||= J((n) => t.$emit("navigate", e.data.href), ["prevent"])
1616
- }, V(e.data.href), 9, Mr),
1615
+ onClick: n[0] ||= K((n) => t.$emit("navigate", e.data.href), ["prevent"])
1616
+ }, B(e.data.href), 9, Nr),
1617
1617
  n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1618
1618
  A("button", {
1619
1619
  class: "docx-hyperlink-popup__btn",
1620
- title: H(r)("hyperlinkPopup.copyLink"),
1621
- onClick: J(g, ["prevent"])
1620
+ title: V(r)("hyperlinkPopup.copyLink"),
1621
+ onClick: K(g, ["prevent"])
1622
1622
  }, [...n[7] ||= [A("svg", {
1623
1623
  width: "18",
1624
1624
  height: "18",
@@ -1635,12 +1635,12 @@ var Wt = /* @__PURE__ */ N({
1635
1635
  height: "13",
1636
1636
  rx: "2",
1637
1637
  ry: "2"
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),
1638
+ }), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Pr),
1639
1639
  e.readOnly ? O("", !0) : (L(), k("button", {
1640
1640
  key: 0,
1641
1641
  class: "docx-hyperlink-popup__btn",
1642
- title: H(r)("hyperlinkPopup.editLink"),
1643
- onClick: J(m, ["prevent"])
1642
+ title: V(r)("hyperlinkPopup.editLink"),
1643
+ onClick: K(m, ["prevent"])
1644
1644
  }, [...n[8] ||= [A("svg", {
1645
1645
  width: "18",
1646
1646
  height: "18",
@@ -1650,26 +1650,26 @@ var Wt = /* @__PURE__ */ N({
1650
1650
  "stroke-width": "2",
1651
1651
  "stroke-linecap": "round",
1652
1652
  "stroke-linejoin": "round"
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)),
1653
+ }, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, Fr)),
1654
1654
  e.readOnly ? O("", !0) : (L(), k("button", {
1655
1655
  key: 1,
1656
1656
  class: "docx-hyperlink-popup__btn",
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))
1657
+ title: V(r)("hyperlinkPopup.removeLink"),
1658
+ onClick: n[1] ||= K((e) => t.$emit("remove"), ["prevent"])
1659
+ }, [...n[9] ||= [oe("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, Ir))
1660
1660
  ], 64))], 38)) : O("", !0);
1661
1661
  }
1662
1662
  }), [["__scopeId", "data-v-9d23bb12"]]);
1663
1663
  //#endregion
1664
1664
  //#region src/composables/useFileIO.ts
1665
- function Hr(e) {
1665
+ function Ur(e) {
1666
1666
  let t = R(null);
1667
1667
  async function n() {
1668
1668
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1669
1669
  }
1670
1670
  async function r(t) {
1671
1671
  try {
1672
- let r = await ke(t);
1672
+ let r = await ze(t);
1673
1673
  if (!r) return;
1674
1674
  await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1675
1675
  } catch (t) {
@@ -1708,7 +1708,7 @@ function Hr(e) {
1708
1708
  }
1709
1709
  //#endregion
1710
1710
  //#region src/composables/useHyperlinkManagement.ts
1711
- function Ur(e) {
1711
+ function Wr(e) {
1712
1712
  let t = R(null);
1713
1713
  function n(t) {
1714
1714
  let n = e.editorView.value;
@@ -1737,7 +1737,7 @@ function Ur(e) {
1737
1737
  function a(n, r) {
1738
1738
  let i = e.editorView.value;
1739
1739
  if (!i) return;
1740
- let a = Me(i.state);
1740
+ let a = Ue(i.state);
1741
1741
  if (!a) {
1742
1742
  t.value = null;
1743
1743
  return;
@@ -1751,7 +1751,7 @@ function Ur(e) {
1751
1751
  function o() {
1752
1752
  let n = e.editorView.value;
1753
1753
  if (!n) return;
1754
- let r = Me(n.state, t.value?.href);
1754
+ let r = Ue(n.state, t.value?.href);
1755
1755
  if (!r) {
1756
1756
  t.value = null;
1757
1757
  return;
@@ -1770,27 +1770,27 @@ function Ur(e) {
1770
1770
  }
1771
1771
  //#endregion
1772
1772
  //#region src/composables/useFormattingActions.ts
1773
- function Wr(e) {
1773
+ function Gr(e) {
1774
1774
  function t() {
1775
1775
  let t = e.editorView.value;
1776
- t && (Z(t.state, t.dispatch, t), t.focus());
1776
+ t && (He(t.state, t.dispatch, t), t.focus());
1777
1777
  }
1778
1778
  function n(t) {
1779
1779
  let n = e.editorView.value;
1780
1780
  if (!n) return;
1781
1781
  let r = e.getDocument()?.package?.styles;
1782
1782
  if (r) {
1783
- let e = ft(r).resolveParagraphStyle(t);
1784
- st(t, {
1783
+ let e = pt(r).resolveParagraphStyle(t);
1784
+ ct(t, {
1785
1785
  paragraphFormatting: e.paragraphFormatting,
1786
1786
  runFormatting: e.runFormatting
1787
1787
  })(n.state, (e) => n.dispatch(e));
1788
- } else st(t)(n.state, (e) => n.dispatch(e));
1788
+ } else ct(t)(n.state, (e) => n.dispatch(e));
1789
1789
  n.focus();
1790
1790
  }
1791
1791
  function r() {
1792
1792
  let t = e.editorView.value;
1793
- t && (pt(t.state, (e) => t.dispatch(e), t), t.focus());
1793
+ t && (mt(t.state, (e) => t.dispatch(e), t), t.focus());
1794
1794
  }
1795
1795
  function i(t) {
1796
1796
  let n = e.editorView.value;
@@ -1800,13 +1800,13 @@ function Wr(e) {
1800
1800
  }
1801
1801
  function a(t) {
1802
1802
  let n = e.editorView.value;
1803
- return n ? mt(n, t) : !1;
1803
+ return n ? ht(n, t) : !1;
1804
1804
  }
1805
1805
  function o(t) {
1806
1806
  let n = e.editorView.value;
1807
1807
  if (!n) return !1;
1808
1808
  let r = e.getDocument();
1809
- return ht(n, t, { styleResolver: r?.package?.styles ? ft(r.package.styles) : null });
1809
+ return gt(n, t, { styleResolver: r?.package?.styles ? pt(r.package.styles) : null });
1810
1810
  }
1811
1811
  return {
1812
1812
  handleClearFormatting: t,
@@ -1819,7 +1819,7 @@ function Wr(e) {
1819
1819
  }
1820
1820
  //#endregion
1821
1821
  //#region src/composables/usePageSetupControls.ts
1822
- function Gr(e) {
1822
+ function Kr(e) {
1823
1823
  function t(t) {
1824
1824
  let n = e.getDocument();
1825
1825
  if (!n?.package?.document) return;
@@ -1846,19 +1846,19 @@ function Gr(e) {
1846
1846
  }
1847
1847
  function s(t) {
1848
1848
  let n = e.editorView.value;
1849
- n && ut(t)(n.state, n.dispatch);
1849
+ n && dt(t)(n.state, n.dispatch);
1850
1850
  }
1851
1851
  function c(t) {
1852
1852
  let n = e.editorView.value;
1853
- n && dt(t)(n.state, n.dispatch);
1853
+ n && ft(t)(n.state, n.dispatch);
1854
1854
  }
1855
1855
  function l(t) {
1856
1856
  let n = e.editorView.value;
1857
- n && (t < 0 ? lt(-t, !0)(n.state, n.dispatch) : lt(t, !1)(n.state, n.dispatch));
1857
+ n && (t < 0 ? ut(-t, !0)(n.state, n.dispatch) : ut(t, !1)(n.state, n.dispatch));
1858
1858
  }
1859
1859
  function u(t) {
1860
1860
  let n = e.editorView.value;
1861
- n && ct(t)(n.state, n.dispatch);
1861
+ n && lt(t)(n.state, n.dispatch);
1862
1862
  }
1863
1863
  return {
1864
1864
  handlePageSetupApply: t,
@@ -1874,16 +1874,16 @@ function Gr(e) {
1874
1874
  }
1875
1875
  //#endregion
1876
1876
  //#region src/composables/useWatermarkControls.ts
1877
- function Kr(e) {
1878
- let t = R(!1), n = E(() => {
1877
+ function qr(e) {
1878
+ let t = R(!1), n = D(() => {
1879
1879
  e.stateTick.value;
1880
1880
  let t = e.editorView.value;
1881
- return t ? vt(t.state) ?? void 0 : void 0;
1881
+ return t ? yt(t.state) ?? void 0 : void 0;
1882
1882
  });
1883
1883
  function r(t) {
1884
1884
  if (e.readOnly.value) return;
1885
1885
  let n = e.editorView.value;
1886
- n && (St(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1886
+ n && (Ct(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1887
1887
  }
1888
1888
  return {
1889
1889
  showWatermark: t,
@@ -1893,18 +1893,18 @@ function Kr(e) {
1893
1893
  }
1894
1894
  //#endregion
1895
1895
  //#region src/composables/useOutlineSidebar.ts
1896
- function qr(e) {
1896
+ function Jr(e) {
1897
1897
  function t() {
1898
1898
  if (!e.showOutline.value) {
1899
1899
  let t = e.editorView.value;
1900
- t && (e.outlineHeadings.value = Ct(t.state.doc));
1900
+ t && (e.outlineHeadings.value = wt(t.state.doc));
1901
1901
  }
1902
1902
  e.showOutline.value = !e.showOutline.value;
1903
1903
  }
1904
1904
  function n(t) {
1905
1905
  let n = e.editorView.value;
1906
1906
  if (!n) return;
1907
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Y.near(r);
1907
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = J.near(r);
1908
1908
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
1909
1909
  }
1910
1910
  function r() {
@@ -1923,7 +1923,7 @@ function qr(e) {
1923
1923
  }
1924
1924
  //#endregion
1925
1925
  //#region src/composables/useKeyboardShortcuts.ts
1926
- function Jr(e) {
1926
+ function Yr(e) {
1927
1927
  function t(t) {
1928
1928
  if (t.key === "F1") {
1929
1929
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1931,111 +1931,136 @@ function Jr(e) {
1931
1931
  }
1932
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)));
1933
1933
  }
1934
- return ue(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1934
+ return I(() => window.addEventListener("keydown", t)), F(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1935
1935
  }
1936
1936
  //#endregion
1937
1937
  //#region src/composables/useCommentManagement.ts
1938
- function Yr(e) {
1939
- function t() {
1940
- kt(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1938
+ function Xr(e) {
1939
+ let t = () => V(e.author) ?? "User";
1940
+ function n(t) {
1941
+ e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
1941
1942
  }
1942
- function n(n, r, i) {
1943
- return t(), Et(e.commentIdAllocator, n, r, i);
1943
+ function r() {
1944
+ At(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1944
1945
  }
1945
- function r(n) {
1946
- let r = e.getDocument(), i = e.editorView.value;
1947
- if (!r?.package?.document || !i) return null;
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;
1951
- }
1952
- function i(t, r, i) {
1953
- let a = e.getDocument();
1954
- if (!a?.package?.document?.comments || !a.package.document.comments.some((e) => e.id === t)) return null;
1955
- let o = n(r, i, t);
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;
1946
+ function i(t, n, i) {
1947
+ return r(), Dt(e.commentIdAllocator, t, n, i);
1957
1948
  }
1958
1949
  function a(t) {
1959
- let n = e.getDocument();
1960
- if (!n?.package?.document?.comments) return;
1961
- let r = n.package.document.comments.find((e) => e.id === t);
1962
- r && (r.done = !0, e.comments.value = [...n.package.document.comments], e.emit("change", n), e.contentChangeSubscribers.forEach((e) => e(n)));
1950
+ let i = e.getDocument(), a = e.editorView.value;
1951
+ if (!i?.package?.document || !a) return null;
1952
+ i.package.document.comments || (i.package.document.comments = []), r();
1953
+ let o = Tt(a, t, e.commentIdAllocator);
1954
+ return o ? (i.package.document.comments.push(o), n([...i.package.document.comments]), e.showSidebar.value = !0, e.emit("change", i), e.contentChangeSubscribers.forEach((e) => e(i)), o.id) : null;
1963
1955
  }
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;
1956
+ function o(t, r, a) {
1957
+ let o = e.getDocument();
1958
+ if (!o?.package?.document?.comments || !o.package.document.comments.some((e) => e.id === t)) return null;
1959
+ let s = i(r, a, t);
1960
+ return o.package.document.comments.push(s), n([...o.package.document.comments]), e.emit("change", o), e.contentChangeSubscribers.forEach((e) => e(o)), s.id;
1970
1961
  }
1971
- function s(e, t) {
1972
- i(e, t, "User");
1962
+ function s(t) {
1963
+ let r = e.getDocument();
1964
+ if (!r?.package?.document?.comments) return;
1965
+ let i = r.package.document.comments.find((e) => e.id === t);
1966
+ i && (i.done = !0, n([...r.package.document.comments]), e.emit("change", r), e.contentChangeSubscribers.forEach((e) => e(r)));
1973
1967
  }
1974
1968
  function c(t) {
1975
- let n = e.getDocument();
1976
- if (!n?.package?.document?.comments) return;
1977
- let r = n.package.document.comments.find((e) => e.id === t);
1978
- r && (r.done = !1), e.comments.value = [...n.package.document.comments], e.emit("change", n);
1969
+ let n = e.editorView.value;
1970
+ if (!n) return !1;
1971
+ r();
1972
+ let i = Et(n, t, e.commentIdAllocator);
1973
+ return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
1979
1974
  }
1980
- function l(t) {
1981
- let n = e.getDocument();
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));
1975
+ function l(n, r) {
1976
+ let i = e.getDocument(), a = i?.package?.document?.comments?.find((e) => e.id === n), s = o(n, r, t());
1977
+ if (s == null || !a) return;
1978
+ let c = i?.package?.document?.comments?.find((e) => e.id === s);
1979
+ c && e.commentCallbacks?.onCommentReply?.(c, a);
1983
1980
  }
1984
- function u(t, n) {
1981
+ function u(t) {
1982
+ let n = e.getDocument()?.package?.document?.comments?.find((e) => e.id === t);
1983
+ s(t), n && e.commentCallbacks?.onCommentResolve?.({ ...n });
1984
+ }
1985
+ function d(t) {
1986
+ let r = e.getDocument();
1987
+ if (!r?.package?.document?.comments) return;
1988
+ let i = r.package.document.comments.find((e) => e.id === t);
1989
+ i && (i.done = !1), n([...r.package.document.comments]), e.emit("change", r);
1990
+ }
1991
+ function f(t) {
1992
+ let r = e.getDocument();
1993
+ if (!r?.package?.document?.comments) return;
1994
+ let i = r.package.document.comments.find((e) => e.id === t);
1995
+ r.package.document.comments = r.package.document.comments.filter((e) => e.id !== t && e.parentId !== t), n([...r.package.document.comments]), i && e.commentCallbacks?.onCommentDelete?.(i), e.emit("change", r);
1996
+ }
1997
+ function p(t, n) {
1985
1998
  let r = e.editorView.value;
1986
- r && (gt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1999
+ r && (_t(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1987
2000
  }
1988
- function d(t, n) {
2001
+ function m(t, n) {
1989
2002
  let r = e.editorView.value;
1990
- r && (bt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2003
+ r && (xt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1991
2004
  }
1992
- function f(t) {
2005
+ function h(t) {
1993
2006
  let n = e.editorView.value;
1994
- n && (_t(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2007
+ n && (vt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1995
2008
  }
1996
- function p(t) {
2009
+ function g(t) {
1997
2010
  let n = e.editorView.value;
1998
- n && (xt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2011
+ n && (St(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1999
2012
  }
2000
- function m(t, r) {
2001
- let i = e.getDocument(), a = e.editorView.value;
2002
- if (!i?.package?.document || !a) return;
2003
- i.package.document.comments || (i.package.document.comments = []);
2004
- let o = a.state.schema.marks.comment;
2005
- if (!o) return;
2006
- let s = null, c = a.state.schema.marks.insertion, l = a.state.schema.marks.deletion;
2007
- if (a.state.doc.descendants((e, n) => {
2008
- if (s !== null) return !1;
2009
- for (let r of e.marks) if ((r.type === c || r.type === l) && r.attrs.revisionId === t) return s = n, !1;
2013
+ function _(r, a) {
2014
+ let o = e.getDocument(), s = e.editorView.value;
2015
+ if (!o?.package?.document || !s) return;
2016
+ o.package.document.comments || (o.package.document.comments = []);
2017
+ let c = s.state.schema.marks.comment;
2018
+ if (!c) return;
2019
+ let l = null, u = s.state.schema.marks.insertion, d = s.state.schema.marks.deletion;
2020
+ if (s.state.doc.descendants((e, t) => {
2021
+ if (l !== null) return !1;
2022
+ for (let n of e.marks) if ((n.type === u || n.type === d) && n.attrs.revisionId === r) return l = t, !1;
2010
2023
  return !0;
2011
- }), s === null) return;
2012
- let u = n(r, "User");
2013
- i.package.document.comments.push(u), e.comments.value = [...i.package.document.comments];
2014
- let d = s, f = Math.min(d + 1, a.state.doc.content.size);
2015
- a.dispatch(a.state.tr.addMark(d, f, o.create({ commentId: u.id }))), e.emit("change", i);
2024
+ }), l === null) return;
2025
+ let f = i(a, t());
2026
+ o.package.document.comments.push(f), n([...o.package.document.comments]);
2027
+ let p = l, m = Math.min(p + 1, s.state.doc.content.size);
2028
+ s.dispatch(s.state.tr.addMark(p, m, c.create({ commentId: f.id }))), e.emit("change", o);
2016
2029
  }
2017
2030
  return {
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
2031
+ addComment: a,
2032
+ replyToComment: o,
2033
+ resolveComment: s,
2034
+ proposeChange: c,
2035
+ handleCommentReply: l,
2036
+ handleCommentResolve: u,
2037
+ handleCommentUnresolve: d,
2038
+ handleCommentDelete: f,
2039
+ handleAcceptChange: p,
2040
+ handleRejectChange: m,
2041
+ handleAcceptChangeById: h,
2042
+ handleRejectChangeById: g,
2043
+ handleTrackedChangeReply: _
2030
2044
  };
2031
2045
  }
2032
2046
  //#endregion
2047
+ //#region src/composables/useHostCallbacks.ts
2048
+ function Zr(e, t) {
2049
+ return U(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2050
+ onCommentAdd: (t) => e.onCommentAdd?.(t),
2051
+ onCommentResolve: (t) => e.onCommentResolve?.(t),
2052
+ onCommentDelete: (t) => e.onCommentDelete?.(t),
2053
+ onCommentReply: (t, n) => e.onCommentReply?.(t, n),
2054
+ onCommentsChange: (t) => e.onCommentsChange?.(t)
2055
+ } };
2056
+ }
2057
+ //#endregion
2033
2058
  //#region src/composables/useCommentLifecycle.ts
2034
- function Xr(e) {
2059
+ function Qr(e) {
2035
2060
  let t = R(null), n = R(null), r = R(null), i = R(!1);
2036
2061
  function a() {
2037
2062
  let t = e.getDocument(), n = e.editorView.value;
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));
2063
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = jt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2039
2064
  }
2040
2065
  function o() {
2041
2066
  e.stateTick.value;
@@ -2054,7 +2079,7 @@ function Xr(e) {
2054
2079
  t.value = null;
2055
2080
  return;
2056
2081
  }
2057
- let s = o.getBoundingClientRect(), c = zt(a, r);
2082
+ let s = o.getBoundingClientRect(), c = Bt(a, r);
2058
2083
  if (!c) {
2059
2084
  t.value = null;
2060
2085
  return;
@@ -2082,7 +2107,7 @@ function Xr(e) {
2082
2107
  for (let t of r) {
2083
2108
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2084
2109
  let n = t.attrs.commentId;
2085
- if (n === Dt || e.resolvedCommentIds.value.has(n)) continue;
2110
+ if (n === Ot || e.resolvedCommentIds.value.has(n)) continue;
2086
2111
  i = `comment-${n}`;
2087
2112
  break;
2088
2113
  }
@@ -2107,7 +2132,7 @@ function Xr(e) {
2107
2132
  }, r.value = t.value?.top ?? null;
2108
2133
  let s = i.state.schema.marks.comment;
2109
2134
  if (s) {
2110
- let e = i.state.tr.addMark(a, o, s.create({ commentId: Dt }));
2135
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: Ot }));
2111
2136
  i.dispatch(e);
2112
2137
  }
2113
2138
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2115,9 +2140,9 @@ function Xr(e) {
2115
2140
  function l(t) {
2116
2141
  let i = e.getDocument(), a = e.editorView.value;
2117
2142
  if (!i?.package) return;
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");
2120
- i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments];
2143
+ i.package.document.comments || (i.package.document.comments = []), At(e.commentIdAllocator, i.package.document.comments, a);
2144
+ let o = Dt(e.commentIdAllocator, t, V(e.author) ?? "User");
2145
+ i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2121
2146
  let s = n.value;
2122
2147
  if (a && s && s.from !== s.to) {
2123
2148
  let e = a.state.schema.marks.comment;
@@ -2139,15 +2164,15 @@ function Xr(e) {
2139
2164
  function d(t) {
2140
2165
  e.showSidebar.value = !0;
2141
2166
  }
2142
- G([
2167
+ U([
2143
2168
  e.stateTick,
2144
2169
  e.isAddingComment,
2145
2170
  e.zoom
2146
- ], () => o()), G(e.stateTick, () => s()), G(e.stateTick, () => a());
2171
+ ], () => o()), U(e.stateTick, () => s()), U(e.stateTick, () => a());
2147
2172
  let f = null;
2148
- return ue(() => {
2173
+ return I(() => {
2149
2174
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2150
- }), I(() => {
2175
+ }), F(() => {
2151
2176
  f?.disconnect(), window.removeEventListener("resize", o);
2152
2177
  }), {
2153
2178
  floatingCommentBtn: t,
@@ -2165,8 +2190,8 @@ function Xr(e) {
2165
2190
  }
2166
2191
  //#endregion
2167
2192
  //#region src/composables/useImageActions.ts
2168
- function Zr(e) {
2169
- let t = B(null), n = R(!1), r = E(() => {
2193
+ function $r(e) {
2194
+ let t = z(null), n = R(!1), r = D(() => {
2170
2195
  e.stateTick.value;
2171
2196
  let n = e.editorView.value, r = t.value;
2172
2197
  if (!n || !r) return null;
@@ -2188,14 +2213,14 @@ function Zr(e) {
2188
2213
  width: t.width,
2189
2214
  height: t.height
2190
2215
  });
2191
- yt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2216
+ bt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2192
2217
  }
2193
2218
  function a(n) {
2194
2219
  let r = e.editorView.value, i = t.value;
2195
2220
  if (!r || !i) return;
2196
- let a = Ke(n);
2221
+ let a = nt(n);
2197
2222
  if (!a) return;
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);
2223
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Qe(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2199
2224
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
2200
2225
  }
2201
2226
  function o(n) {
@@ -2224,8 +2249,8 @@ function Zr(e) {
2224
2249
  }
2225
2250
  //#endregion
2226
2251
  //#region src/utils/imageClipboard.ts
2227
- function Qr(e, t, n) {
2228
- let r = at(e.state), i = e.state.schema.marks.insertion;
2252
+ function ei(e, t, n) {
2253
+ let r = ot(e.state), i = e.state.schema.marks.insertion;
2229
2254
  if (!r || !i) return;
2230
2255
  let a = t.selection.from, o = a - n.nodeSize;
2231
2256
  o < 0 || t.addMark(o, a, i.create({
@@ -2234,10 +2259,10 @@ function Qr(e, t, n) {
2234
2259
  date: r.date
2235
2260
  }));
2236
2261
  }
2237
- function $r(e, t) {
2262
+ function ti(e, t) {
2238
2263
  return e.getBlob(t);
2239
2264
  }
2240
- function ei(e, t) {
2265
+ function ni(e, t) {
2241
2266
  let n = e.state.doc.nodeAt(t);
2242
2267
  if (!n || n.type.name !== "image") return;
2243
2268
  let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
@@ -2249,13 +2274,13 @@ function ei(e, t) {
2249
2274
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2250
2275
  });
2251
2276
  }
2252
- function ti(e) {
2277
+ function ri(e) {
2253
2278
  return new Promise((t, n) => {
2254
2279
  let r = new FileReader();
2255
2280
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2256
2281
  });
2257
2282
  }
2258
- function ni(e) {
2283
+ function ii(e) {
2259
2284
  return new Promise((t) => {
2260
2285
  let n = new Image();
2261
2286
  n.onload = () => t({
@@ -2267,13 +2292,13 @@ function ni(e) {
2267
2292
  }), n.src = e;
2268
2293
  });
2269
2294
  }
2270
- async function ri(e) {
2295
+ async function ai(e) {
2271
2296
  try {
2272
2297
  let t = await navigator.clipboard.read();
2273
2298
  for (let n of t) {
2274
2299
  let t = n.types.find((e) => e.startsWith("image/"));
2275
2300
  if (t) {
2276
- let r = await ti(await $r(n, t)), i = await ni(r), a = i.width, o = i.height;
2301
+ let r = await ri(await ti(n, t)), i = await ii(r), a = i.width, o = i.height;
2277
2302
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2278
2303
  let s = e.state.schema.nodes.image.create({
2279
2304
  src: r,
@@ -2283,11 +2308,11 @@ async function ri(e) {
2283
2308
  wrapType: "inline",
2284
2309
  displayMode: "inline"
2285
2310
  }), c = e.state.tr.replaceSelectionWith(s);
2286
- Qr(e, c, s), e.dispatch(c);
2311
+ ei(e, c, s), e.dispatch(c);
2287
2312
  return;
2288
2313
  }
2289
2314
  if (n.types.includes("text/html")) {
2290
- let t = await (await $r(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2315
+ let t = await (await ti(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2291
2316
  if (r && r[1]) {
2292
2317
  let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
2293
2318
  src: n,
@@ -2297,12 +2322,12 @@ async function ri(e) {
2297
2322
  wrapType: "inline",
2298
2323
  displayMode: "inline"
2299
2324
  }), l = e.state.tr.replaceSelectionWith(c);
2300
- Qr(e, l, c), e.dispatch(l);
2325
+ ei(e, l, c), e.dispatch(l);
2301
2326
  return;
2302
2327
  }
2303
2328
  }
2304
2329
  if (n.types.includes("text/plain")) {
2305
- let t = await (await $r(n, "text/plain")).text();
2330
+ let t = await (await ti(n, "text/plain")).text();
2306
2331
  if (t && t !== "[image]") {
2307
2332
  let { from: n } = e.state.selection;
2308
2333
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2318,14 +2343,14 @@ async function ri(e) {
2318
2343
  }
2319
2344
  }
2320
2345
  }
2321
- function ii(e, t) {
2346
+ function oi(e, t) {
2322
2347
  let n = e.state.doc.nodeAt(t);
2323
2348
  if (!n || n.type.name !== "image") return;
2324
2349
  let r = document.createElement("input");
2325
2350
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2326
2351
  let i = r.files?.[0];
2327
2352
  if (!i) return;
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);
2353
+ let a = await ri(i), o = await ii(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2329
2354
  try {
2330
2355
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2331
2356
  ...n.attrs,
@@ -2340,7 +2365,7 @@ function ii(e, t) {
2340
2365
  }
2341
2366
  //#endregion
2342
2367
  //#region src/composables/useContextMenus.ts
2343
- function ai(e) {
2368
+ function si(e) {
2344
2369
  let { t } = n(), r = R({
2345
2370
  isOpen: !1,
2346
2371
  position: {
@@ -2352,7 +2377,7 @@ function ai(e) {
2352
2377
  onImage: !1,
2353
2378
  canMergeCells: !1,
2354
2379
  canSplitCell: !1
2355
- }), i = R(null), a = E(() => [
2380
+ }), i = R(null), a = D(() => [
2356
2381
  {
2357
2382
  action: "cut",
2358
2383
  label: t("contextMenu.cut"),
@@ -2378,12 +2403,12 @@ function ai(e) {
2378
2403
  function o(t) {
2379
2404
  let n = e.editorView.value;
2380
2405
  if (!n) return;
2381
- let a = t.target, o = Ue(a);
2406
+ let a = t.target, o = Q(a);
2382
2407
  if (o) {
2383
2408
  let a = Number(o.dataset.pmStart);
2384
2409
  if (!isNaN(a)) {
2385
2410
  try {
2386
- let e = he.create(n.state.doc, a);
2411
+ let e = q.create(n.state.doc, a);
2387
2412
  n.dispatch(n.state.tr.setSelection(e));
2388
2413
  } catch {}
2389
2414
  e.selectedImage.value = {
@@ -2404,7 +2429,7 @@ function ai(e) {
2404
2429
  pmPos: a,
2405
2430
  currentWrapType: n,
2406
2431
  currentCssFloat: c ?? null,
2407
- inlinePositionEmu: n === "inline" ? Ve(o, e.zoom.value) : void 0
2432
+ inlinePositionEmu: n === "inline" ? Qe(o, e.zoom.value) : void 0
2408
2433
  }, r.value.isOpen = !1;
2409
2434
  return;
2410
2435
  }
@@ -2416,7 +2441,7 @@ function ai(e) {
2416
2441
  e.setPmSelection(a);
2417
2442
  } catch {}
2418
2443
  }
2419
- let s = Ne(n.state), { empty: c } = n.state.selection;
2444
+ let s = Z(n.state), { empty: c } = n.state.selection;
2420
2445
  i.value &&= null, r.value = {
2421
2446
  isOpen: !0,
2422
2447
  position: {
@@ -2445,7 +2470,7 @@ function ai(e) {
2445
2470
  pmPos: a.pmPos,
2446
2471
  currentWrapType: s,
2447
2472
  currentCssFloat: c ?? null,
2448
- inlinePositionEmu: s === "inline" ? Ve(a.element, e.zoom.value) : void 0
2473
+ inlinePositionEmu: s === "inline" ? Qe(a.element, e.zoom.value) : void 0
2449
2474
  }, r.value.isOpen = !1;
2450
2475
  }
2451
2476
  function c(t) {
@@ -2461,16 +2486,16 @@ function ai(e) {
2461
2486
  switch (t) {
2462
2487
  case "cut":
2463
2488
  if (e.selectedImage.value) {
2464
- ei(n, e.selectedImage.value.pmPos);
2489
+ ni(n, e.selectedImage.value.pmPos);
2465
2490
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2466
2491
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2467
2492
  } else document.execCommand("cut");
2468
2493
  break;
2469
2494
  case "copy":
2470
- e.selectedImage.value ? ei(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2495
+ e.selectedImage.value ? ni(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2471
2496
  break;
2472
2497
  case "paste":
2473
- ri(n);
2498
+ ai(n);
2474
2499
  break;
2475
2500
  case "pasteAsPlainText":
2476
2501
  navigator.clipboard.readText().then((e) => {
@@ -2483,7 +2508,7 @@ function ai(e) {
2483
2508
  break;
2484
2509
  }
2485
2510
  case "selectAll": {
2486
- let e = Y.create(n.state.doc, 0, n.state.doc.content.size);
2511
+ let e = J.create(n.state.doc, 0, n.state.doc.content.size);
2487
2512
  n.dispatch(n.state.tr.setSelection(e));
2488
2513
  break;
2489
2514
  }
@@ -2491,7 +2516,7 @@ function ai(e) {
2491
2516
  e.selectedImage.value && (e.showImageProperties.value = !0);
2492
2517
  break;
2493
2518
  case "replaceImage":
2494
- e.selectedImage.value && ii(n, e.selectedImage.value.pmPos);
2519
+ e.selectedImage.value && oi(n, e.selectedImage.value.pmPos);
2495
2520
  break;
2496
2521
  case "deleteImage":
2497
2522
  if (e.selectedImage.value) {
@@ -2526,13 +2551,13 @@ function ai(e) {
2526
2551
  }
2527
2552
  //#endregion
2528
2553
  //#region src/composables/usePagesPointer.ts
2529
- var oi = 500;
2530
- function si(e) {
2554
+ var ci = 500;
2555
+ function li(e) {
2531
2556
  let t = R(null), n = null;
2532
2557
  function r() {
2533
2558
  n !== null && (clearTimeout(n), n = null);
2534
2559
  }
2535
- let i = B(null), a = 0, o = null, s = 0, c = !1, l = null, u = C({
2560
+ let i = z(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2536
2561
  pagesContainer: e.pagesRef,
2537
2562
  onScrollExtendSelection: (e, t) => {
2538
2563
  if (!c || l === null) return;
@@ -2545,7 +2570,7 @@ function si(e) {
2545
2570
  visible: !1
2546
2571
  }), f = null;
2547
2572
  function p(t, n) {
2548
- return Vt(e.pagesRef.value, e.editorView.value, t, n);
2573
+ return Ht(e.pagesRef.value, e.editorView.value, t, n);
2549
2574
  }
2550
2575
  function m() {
2551
2576
  let t = i.value;
@@ -2558,18 +2583,18 @@ function si(e) {
2558
2583
  function h(e, t) {
2559
2584
  let n = m();
2560
2585
  if (n) try {
2561
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Y.between(r, i);
2586
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = J.between(r, i);
2562
2587
  n.dispatch(n.state.tr.setSelection(a));
2563
2588
  } catch {}
2564
2589
  }
2565
2590
  function g(t) {
2566
- Bt(e.pagesRef.value, e.pagesViewportRef.value, t);
2591
+ Vt(e.pagesRef.value, e.pagesViewportRef.value, t);
2567
2592
  }
2568
2593
  function _(t) {
2569
- Ht(e.pagesRef.value, t, h, i.value?.position);
2594
+ Ut(e.pagesRef.value, t, h, i.value?.position);
2570
2595
  }
2571
2596
  function v(t) {
2572
- Ut(e.pagesRef.value, t, h, i.value?.position);
2597
+ Wt(e.pagesRef.value, t, h, i.value?.position);
2573
2598
  }
2574
2599
  function y(t) {
2575
2600
  let n = e.editorView.value;
@@ -2590,7 +2615,7 @@ function si(e) {
2590
2615
  if (!o) return;
2591
2616
  let s = e.pagesViewportRef.value;
2592
2617
  if (!s) return;
2593
- let l = Mt({
2618
+ let l = Nt({
2594
2619
  mouseX: a.clientX,
2595
2620
  mouseY: a.clientY,
2596
2621
  pagesContainer: o,
@@ -2600,7 +2625,7 @@ function si(e) {
2600
2625
  if (!l) {
2601
2626
  n === null && (n = setTimeout(() => {
2602
2627
  t.value = null, n = null;
2603
- }, jt));
2628
+ }, Mt));
2604
2629
  return;
2605
2630
  }
2606
2631
  let u = s.getBoundingClientRect();
@@ -2615,12 +2640,12 @@ function si(e) {
2615
2640
  n.preventDefault(), n.stopPropagation();
2616
2641
  let r = t.value, i = e.editorView.value;
2617
2642
  if (!r || !i) return;
2618
- let a = i.state.tr.setSelection(Y.create(i.state.doc, r.cellPmPos + 1));
2643
+ let a = i.state.tr.setSelection(J.create(i.state.doc, r.cellPmPos + 1));
2619
2644
  i.dispatch(a);
2620
2645
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2621
2646
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
2622
2647
  }
2623
- function ee(t) {
2648
+ function S(t) {
2624
2649
  let n = t.target?.closest("a[href]");
2625
2650
  if (!n) return;
2626
2651
  t.preventDefault();
@@ -2645,7 +2670,7 @@ function si(e) {
2645
2670
  }
2646
2671
  };
2647
2672
  }
2648
- function S(t) {
2673
+ function C(t) {
2649
2674
  let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
2650
2675
  if (!o) return;
2651
2676
  let s = r ? "header" : "footer", c = e.getDocument();
@@ -2711,7 +2736,7 @@ function si(e) {
2711
2736
  }
2712
2737
  };
2713
2738
  }
2714
- function te(t) {
2739
+ function ee(t) {
2715
2740
  let n = e.getDocument(), r = i.value;
2716
2741
  if (!n?.package || !r) return;
2717
2742
  let a = r.position === "header" ? n.package.headers : n.package.footers;
@@ -2719,7 +2744,7 @@ function si(e) {
2719
2744
  let o = a.get(r.rId);
2720
2745
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2721
2746
  }
2722
- function ne() {
2747
+ function te() {
2723
2748
  let t = e.getDocument(), n = i.value;
2724
2749
  if (!t?.package || !n || !n.rId) {
2725
2750
  i.value = null;
@@ -2751,7 +2776,7 @@ function si(e) {
2751
2776
  };
2752
2777
  i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
2753
2778
  }
2754
- function re(t) {
2779
+ function ne(t) {
2755
2780
  if (t.button !== 0 || e.imageInteracting.value) return;
2756
2781
  let n = e.editorView.value;
2757
2782
  if (!n) return;
@@ -2759,13 +2784,13 @@ function si(e) {
2759
2784
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2760
2785
  let u = m() ?? n;
2761
2786
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2762
- let d = Ue(r);
2787
+ let d = Q(r);
2763
2788
  if (d) {
2764
2789
  t.preventDefault(), t.stopPropagation();
2765
2790
  let n = Number(d.dataset.pmStart);
2766
2791
  if (!isNaN(n)) {
2767
2792
  try {
2768
- u.dispatch(u.state.tr.setSelection(he.create(u.state.doc, n)));
2793
+ u.dispatch(u.state.tr.setSelection(q.create(u.state.doc, n)));
2769
2794
  } catch {}
2770
2795
  e.selectedImage.value = {
2771
2796
  element: d,
@@ -2784,7 +2809,7 @@ function si(e) {
2784
2809
  return;
2785
2810
  }
2786
2811
  let g = Date.now();
2787
- if (g - a < oi && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2812
+ if (g - a < ci && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2788
2813
  else if (s >= 3) v(f), s = 0;
2789
2814
  else {
2790
2815
  if (t.shiftKey) {
@@ -2795,15 +2820,15 @@ function si(e) {
2795
2820
  }
2796
2821
  u.focus();
2797
2822
  }
2798
- function w(e) {
2823
+ function T(e) {
2799
2824
  if (!c || l === null) return;
2800
2825
  let t = p(e.clientX, e.clientY);
2801
2826
  t !== null && t !== l && h(l, t), u.updateMousePosition(e.clientX, e.clientY);
2802
2827
  }
2803
- function T() {
2828
+ function E() {
2804
2829
  c = !1, u.stopAutoScroll();
2805
2830
  }
2806
- function E() {
2831
+ function D() {
2807
2832
  let t = e.pagesViewportRef.value, n = e.layout.value;
2808
2833
  if (!t || !n || n.pages.length === 0) return;
2809
2834
  let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
@@ -2826,10 +2851,10 @@ function si(e) {
2826
2851
  };
2827
2852
  }, 600);
2828
2853
  }
2829
- return ue(() => {
2830
- window.addEventListener("mousemove", w), window.addEventListener("mouseup", T), e.pagesViewportRef.value?.addEventListener("scroll", E, { passive: !0 });
2831
- }), I(() => {
2832
- r(), window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", T), e.pagesViewportRef.value?.removeEventListener("scroll", E), f && clearTimeout(f);
2854
+ return I(() => {
2855
+ window.addEventListener("mousemove", T), window.addEventListener("mouseup", E), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2856
+ }), F(() => {
2857
+ r(), window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", E), e.pagesViewportRef.value?.removeEventListener("scroll", D), f && clearTimeout(f);
2833
2858
  }), {
2834
2859
  tableInsertButton: t,
2835
2860
  hfEdit: i,
@@ -2838,19 +2863,19 @@ function si(e) {
2838
2863
  setPmSelection: h,
2839
2864
  scrollVisiblePositionIntoView: g,
2840
2865
  navigateToBookmark: y,
2841
- handlePagesMouseDown: re,
2866
+ handlePagesMouseDown: ne,
2842
2867
  handlePagesMouseMove: b,
2843
- handlePagesClick: ee,
2844
- handlePagesDoubleClick: S,
2868
+ handlePagesClick: S,
2869
+ handlePagesDoubleClick: C,
2845
2870
  handleTableInsertClick: x,
2846
2871
  clearTableInsertTimer: r,
2847
- handleHfSave: te,
2848
- handleHfRemove: ne
2872
+ handleHfSave: ee,
2873
+ handleHfRemove: te
2849
2874
  };
2850
2875
  }
2851
2876
  //#endregion
2852
2877
  //#region src/composables/useSelectionSync.ts
2853
- function ci(e) {
2878
+ function ui(e) {
2854
2879
  let t = null, n = null, r = null;
2855
2880
  function i() {
2856
2881
  let r = e.pagesRef.value;
@@ -2862,8 +2887,8 @@ function ci(e) {
2862
2887
  let t = e.pagesRef.value, n = e.editorView.value;
2863
2888
  if (!t || !n || e.isHfEditing?.value) return;
2864
2889
  let i = n.state.selection;
2865
- if (i instanceof he && i.node.type.name === "image") {
2866
- let n = ye(t, i.from), r = n ? Ue(n) : null;
2890
+ if (i instanceof q && i.node.type.name === "image") {
2891
+ let n = Y(t, i.from), r = n ? Q(n) : null;
2867
2892
  if (r) {
2868
2893
  let t = e.selectedImage.value;
2869
2894
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -2881,12 +2906,12 @@ function ci(e) {
2881
2906
  function o() {
2882
2907
  let r = e.pagesRef.value, o = e.editorView.value;
2883
2908
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
2884
- a(), ge(r, o.state);
2909
+ a(), _e(r, o.state);
2885
2910
  let s = o.state.selection;
2886
- if (s instanceof he && s.node.type.name === "image") return;
2911
+ if (s instanceof q && s.node.type.name === "image") return;
2887
2912
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
2888
2913
  if (u) {
2889
- let e = Fe(r, c, r.getBoundingClientRect());
2914
+ let e = Ge(r, c, r.getBoundingClientRect());
2890
2915
  if (e) {
2891
2916
  let i = document.createElement("div");
2892
2917
  i.className = "vue-caret", i.style.cssText = `
@@ -2897,7 +2922,7 @@ function ci(e) {
2897
2922
  height: ${e.height}px;
2898
2923
  background: #000;
2899
2924
  pointer-events: none;
2900
- z-index: ${S.selectionOverlay};
2925
+ z-index: ${C.selectionOverlay};
2901
2926
  `, r.appendChild(i), n = i;
2902
2927
  let a = !0;
2903
2928
  t = setInterval(() => {
@@ -2906,7 +2931,7 @@ function ci(e) {
2906
2931
  }
2907
2932
  return;
2908
2933
  }
2909
- let m = Ie(r, c, l, r.getBoundingClientRect());
2934
+ let m = Ke(r, c, l, r.getBoundingClientRect());
2910
2935
  for (let e of m) {
2911
2936
  let t = document.createElement("div");
2912
2937
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2917,11 +2942,11 @@ function ci(e) {
2917
2942
  height: ${e.height / p}px;
2918
2943
  background: rgba(66, 133, 244, 0.3);
2919
2944
  pointer-events: none;
2920
- z-index: ${S.selectionOverlay};
2945
+ z-index: ${C.selectionOverlay};
2921
2946
  `, r.appendChild(t);
2922
2947
  }
2923
2948
  }
2924
- return I(() => {
2949
+ return F(() => {
2925
2950
  r !== null && cancelAnimationFrame(r), i();
2926
2951
  }), {
2927
2952
  clearOverlay: i,
@@ -2930,7 +2955,7 @@ function ci(e) {
2930
2955
  }
2931
2956
  //#endregion
2932
2957
  //#region src/composables/useMenuActions.ts
2933
- function li(e) {
2958
+ function di(e) {
2934
2959
  function t(t) {
2935
2960
  let n = e.editorView.value;
2936
2961
  if (!n) return;
@@ -2985,7 +3010,7 @@ function li(e) {
2985
3010
  e.showKeyboardShortcuts.value = !0;
2986
3011
  break;
2987
3012
  case "reportIssue":
2988
- Nt();
3013
+ Pt();
2989
3014
  break;
2990
3015
  case "dirLTR":
2991
3016
  t("setLtr");
@@ -3003,29 +3028,29 @@ function li(e) {
3003
3028
  }
3004
3029
  //#endregion
3005
3030
  //#region src/composables/useDocumentLifecycle.ts
3006
- function ui(e) {
3031
+ function fi(e) {
3007
3032
  async function t(t) {
3008
3033
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3009
3034
  }
3010
3035
  function n(t) {
3011
3036
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3012
3037
  }
3013
- G(e.documentBuffer, (e) => {
3038
+ U(e.documentBuffer, (e) => {
3014
3039
  e && t(e);
3015
- }), G(e.document, (e) => {
3040
+ }), U(e.document, (e) => {
3016
3041
  e && n(e);
3017
- }), ue(async () => {
3018
- await ce();
3042
+ }), I(async () => {
3043
+ await ue();
3019
3044
  let r = e.documentBuffer(), i = e.document();
3020
3045
  r ? await t(r) : i && n(i);
3021
3046
  });
3022
3047
  }
3023
3048
  //#endregion
3024
3049
  //#region src/composables/useDocxEditorRefApi.ts
3025
- function di(e) {
3050
+ function pi(e) {
3026
3051
  function t() {
3027
3052
  let t = e.pagesRef.value;
3028
- t && Ge(t), e.onPrint?.(), window.print();
3053
+ t && tt(t), e.onPrint?.(), window.print();
3029
3054
  }
3030
3055
  function n() {
3031
3056
  t();
@@ -3059,41 +3084,41 @@ function di(e) {
3059
3084
  function c() {
3060
3085
  let t = e.layout.value, n = e.editorView.value;
3061
3086
  if (!t || !n) return 0;
3062
- let r = ot(t, n.state.selection.from);
3087
+ let r = st(t, n.state.selection.from);
3063
3088
  return r == null ? 0 : r + 1;
3064
3089
  }
3065
3090
  function l(t) {
3066
3091
  let n = e.editorView.value;
3067
3092
  if (!n) return !1;
3068
- let r = Ft(n.state.doc, t);
3093
+ let r = It(n.state.doc, t);
3069
3094
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3070
3095
  }
3071
3096
  function u(t, n) {
3072
- return xe(e.editorView.value, t, n);
3097
+ return Se(e.editorView.value, t, n);
3073
3098
  }
3074
3099
  function d() {
3075
- return Ce(e.editorView.value);
3100
+ return we(e.editorView.value);
3076
3101
  }
3077
3102
  function f() {
3078
3103
  return e.comments.value;
3079
3104
  }
3080
3105
  function p(t) {
3081
3106
  let n = e.editorView.value;
3082
- return n ? Ze(n.state.doc, t ?? {}) : [];
3107
+ return n ? ke(n.state.doc, t ?? {}) : [];
3083
3108
  }
3084
3109
  function m(t) {
3085
3110
  let n = e.editorView.value;
3086
3111
  if (!n) return !1;
3087
- let r = Xe(n.state.doc, t);
3112
+ let r = Oe(n.state.doc, t);
3088
3113
  return r == null ? !1 : (a(r), !0);
3089
3114
  }
3090
3115
  function h(t, n, r) {
3091
3116
  let i = e.editorView.value;
3092
3117
  if (!i) return !1;
3093
3118
  try {
3094
- return i.dispatch(tt(i.state, t, n, r)), !0;
3119
+ return i.dispatch(Ne(i.state, t, n, r)), !0;
3095
3120
  } catch (e) {
3096
- if (e instanceof Pt) return !1;
3121
+ if (e instanceof Ft) return !1;
3097
3122
  throw e;
3098
3123
  }
3099
3124
  }
@@ -3101,9 +3126,9 @@ function di(e) {
3101
3126
  let r = e.editorView.value;
3102
3127
  if (!r) return !1;
3103
3128
  try {
3104
- return r.dispatch(Qe(r.state, t, n)), !0;
3129
+ return r.dispatch(Ae(r.state, t, n)), !0;
3105
3130
  } catch (e) {
3106
- if (e instanceof Pt) return !1;
3131
+ if (e instanceof Ft) return !1;
3107
3132
  throw e;
3108
3133
  }
3109
3134
  }
@@ -3111,14 +3136,14 @@ function di(e) {
3111
3136
  let i = e.editorView.value;
3112
3137
  if (!i) return !1;
3113
3138
  try {
3114
- return i.dispatch(nt(i.state, t, n, r)), !0;
3139
+ return i.dispatch(X(i.state, t, n, r)), !0;
3115
3140
  } catch (e) {
3116
- if (e instanceof Pt) return !1;
3141
+ if (e instanceof Ft) return !1;
3117
3142
  throw e;
3118
3143
  }
3119
3144
  }
3120
3145
  function v(t) {
3121
- return Se(e.editorView.value, e.layout.value, t);
3146
+ return Ce(e.editorView.value, e.layout.value, t);
3122
3147
  }
3123
3148
  function y(t) {
3124
3149
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
@@ -3165,25 +3190,25 @@ function di(e) {
3165
3190
  }
3166
3191
  //#endregion
3167
3192
  //#region src/composables/useFontLifecycle.ts
3168
- function fi(e, t) {
3169
- G(e, (e) => {
3170
- Ee(e);
3193
+ function mi(e, t) {
3194
+ U(e, (e) => {
3195
+ Ie(e);
3171
3196
  }, { immediate: !0 });
3172
- let n = De(t);
3173
- I(() => n());
3197
+ let n = Le(t);
3198
+ F(() => n());
3174
3199
  }
3175
3200
  //#endregion
3176
3201
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3177
- var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3202
+ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3178
3203
  key: 0,
3179
3204
  class: "docx-editor-vue__error"
3180
- }, hi = {
3205
+ }, _i = {
3181
3206
  key: 1,
3182
3207
  class: "docx-editor-vue__loading"
3183
- }, gi = { class: "docx-editor-vue__editor-area" }, _i = {
3208
+ }, vi = { class: "docx-editor-vue__editor-area" }, yi = {
3184
3209
  key: 0,
3185
3210
  class: "docx-editor-vue__vertical-ruler"
3186
- }, vi = ["title"], yi = ["title", "aria-label"], bi = /* @__PURE__ */ N({
3211
+ }, bi = ["title"], xi = ["title", "aria-label"], Si = /* @__PURE__ */ M({
3187
3212
  __name: "DocxEditor",
3188
3213
  props: {
3189
3214
  documentBuffer: { default: null },
@@ -3205,6 +3230,7 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3205
3230
  type: Boolean,
3206
3231
  default: !1
3207
3232
  },
3233
+ author: { default: "User" },
3208
3234
  mode: { default: "editing" },
3209
3235
  onModeChange: {},
3210
3236
  i18n: { default: void 0 },
@@ -3263,7 +3289,16 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3263
3289
  renderTitleBarRight: {
3264
3290
  type: Function,
3265
3291
  default: void 0
3266
- }
3292
+ },
3293
+ onChange: {},
3294
+ onError: {},
3295
+ onSelectionChange: {},
3296
+ onEditorViewReady: {},
3297
+ onCommentAdd: {},
3298
+ onCommentResolve: {},
3299
+ onCommentDelete: {},
3300
+ onCommentReply: {},
3301
+ onCommentsChange: {}
3267
3302
  },
3268
3303
  emits: [
3269
3304
  "change",
@@ -3275,35 +3310,40 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3275
3310
  "mode-change"
3276
3311
  ],
3277
3312
  setup(e, { expose: n, emit: r }) {
3278
- let i = e, a = r, o = R(i.mode), s = E(() => i.readOnly || o.value === "viewing");
3279
- f(E(() => i.i18n));
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);
3281
- ke();
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({
3283
- hiddenContainer: u,
3284
- pagesContainer: d,
3313
+ let i = e, a = r, o = R(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3314
+ f(D(() => i.i18n));
3315
+ let { t: u } = t(D(() => i.i18n)), d = R(null), g = R(null), y = R(null), x = R(0), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), w = new Te(), E = R(!1), re = R(!1), oe = R(!1), se = R(!1), M = R(!1), ce = R(!1), me = R(i.showOutline), he = R(!1), H = R(!1), W = R(!1), G = R(null), q = z([]), _e = z([]), ve = z([]), { zoom: Y, zoomPercent: xe, isMinZoom: Se, isMaxZoom: Ce, setZoom: Ee, zoomIn: Oe, zoomOut: ke, handleWheel: Ae, handleKeyDown: je, installShortcuts: Me, ZOOM_PRESETS: Ne } = ne(i.initialZoom);
3316
+ Me();
3317
+ let { editorView: X, isReady: Fe, parseError: Ie, layout: Le, loadBuffer: Re, loadDocument: ze, save: Be, focus: He, destroy: Ue, getDocument: Z, getCommands: We, reLayout: Ge, getHfPmView: Ke, syncHfPMs: qe, setHfTransactionListener: Je, setDocument: Ye } = ee({
3318
+ hiddenContainer: d,
3319
+ pagesContainer: g,
3285
3320
  readOnly: s,
3286
3321
  externalPlugins: i.externalPlugins,
3287
- syncCoordinator: S,
3322
+ syncCoordinator: w,
3288
3323
  editorMode: o,
3324
+ author: l,
3289
3325
  onChange: (e) => {
3290
- a("change", e), a("update:document", e), x.forEach((t) => t(e));
3326
+ a("change", e), a("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3327
+ },
3328
+ onError: (e) => {
3329
+ a("error", e), i.onError?.(e);
3291
3330
  },
3292
- onError: (e) => a("error", e),
3293
3331
  onSelectionUpdate: () => {
3294
- y.value++, er();
3295
- let e = Ce(Z.value);
3296
- ee.forEach((t) => t(e));
3332
+ x.value++, ir();
3333
+ let e = X.value;
3334
+ i.onSelectionChange?.(e ? De(e.state) : null);
3335
+ let t = we(e);
3336
+ C.forEach((e) => e(t));
3297
3337
  }
3298
- }), Ke = E(() => {
3299
- y.value;
3300
- let e = Q();
3338
+ }), { commentCallbacks: Xe } = Zr(i, X), Ze = D(() => {
3339
+ x.value;
3340
+ let e = Z();
3301
3341
  if (!e?.package?.document) return null;
3302
3342
  let t = e.package.document;
3303
3343
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3304
- }), qe = E(() => {
3305
- y.value;
3306
- let e = Z.value, t = e ? je(e.state).paragraphFormatting : {};
3344
+ }), Qe = D(() => {
3345
+ x.value;
3346
+ let e = X.value, t = e ? Ve(e.state).paragraphFormatting : {};
3307
3347
  return {
3308
3348
  indentLeft: t.indentLeft ?? 0,
3309
3349
  indentRight: t.indentRight ?? 0,
@@ -3311,24 +3351,26 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3311
3351
  hangingIndent: t.hangingIndent ?? !1,
3312
3352
  tabStops: t.tabs ?? null
3313
3353
  };
3314
- }), Ye = E(() => (y.value, Q()?.package?.theme ?? i.theme ?? null)), Xe = R(null), Ze = R([]);
3315
- function Qe(e, t) {
3316
- Xe.value = _e(e, t), Ze.value = ve(e, t);
3354
+ }), $e = D(() => (x.value, Z()?.package?.theme ?? i.theme ?? null)), Q = R(null), et = R([]);
3355
+ function tt(e, t) {
3356
+ Q.value = ye(e, t), et.value = be(e, t);
3317
3357
  }
3318
- function $e() {
3319
- Xe.value = null, Ze.value = [];
3358
+ function nt() {
3359
+ Q.value = null, et.value = [];
3320
3360
  }
3321
- fi(() => i.fonts, (e) => a("error", e));
3322
- let et = E(() => $.value?.headerFooter ? He($.value.headerFooter) ?? null : null);
3323
- ue(() => {
3324
- We((e, t) => {
3361
+ mi(() => i.fonts, (e) => {
3362
+ a("error", e), i.onError?.(e);
3363
+ });
3364
+ let rt = D(() => $.value?.headerFooter ? Ke($.value.headerFooter) ?? null : null);
3365
+ I(() => {
3366
+ Je((e, t) => {
3325
3367
  requestAnimationFrame(() => {
3326
3368
  let e = $.value;
3327
3369
  if (!e) return;
3328
- Qe(t, e.position);
3329
- let n = Rt(e.position), r = g.value;
3370
+ tt(t, e.position);
3371
+ let n = zt(e.position), r = y.value;
3330
3372
  if (!n || !r) return;
3331
- let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3373
+ let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = Y.value || 1;
3332
3374
  $.value = {
3333
3375
  ...e,
3334
3376
  targetRect: {
@@ -3339,20 +3381,20 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3339
3381
  }
3340
3382
  };
3341
3383
  });
3342
- }), G(() => $.value, (e) => {
3384
+ }), U(() => $.value, (e) => {
3343
3385
  if (!e) {
3344
- $e();
3386
+ nt();
3345
3387
  return;
3346
3388
  }
3347
- let t = Z.value;
3389
+ let t = X.value;
3348
3390
  if (t) {
3349
3391
  try {
3350
- let e = t.state.tr.setSelection(Y.create(t.state.doc, 0));
3392
+ let e = t.state.tr.setSelection(J.create(t.state.doc, 0));
3351
3393
  t.dispatch(e);
3352
3394
  } catch {}
3353
3395
  t.dom.blur?.();
3354
3396
  }
3355
- tr.updateSelectionOverlay();
3397
+ ar.updateSelectionOverlay();
3356
3398
  });
3357
3399
  let e = 0;
3358
3400
  function t() {
@@ -3360,35 +3402,35 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3360
3402
  e = 0;
3361
3403
  let t = $.value;
3362
3404
  if (!t?.headerFooter) return;
3363
- let n = He(t.headerFooter);
3364
- n && Qe(n, t.position);
3405
+ let n = Ke(t.headerFooter);
3406
+ n && tt(n, t.position);
3365
3407
  }));
3366
3408
  }
3367
- window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3409
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
3368
3410
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3369
3411
  });
3370
3412
  });
3371
- let tt = E(() => {
3413
+ let at = D(() => {
3372
3414
  let e = [];
3373
- return U.value && e.push(`translateX(-${we}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3415
+ return H.value && e.push(`translateX(-${Pe}px)`), Y.value !== 1 && e.push(`scale(${Y.value})`), {
3374
3416
  transform: e.length > 0 ? e.join(" ") : void 0,
3375
3417
  transformOrigin: "top center",
3376
3418
  transition: "transform 0.2s ease"
3377
3419
  };
3378
- }), nt = E(() => ({
3420
+ }), ot = D(() => ({
3379
3421
  paddingLeft: "20px",
3380
- paddingRight: 20 + (U.value ? we * 2 : 0) + "px",
3422
+ paddingRight: 20 + (H.value ? Pe * 2 : 0) + "px",
3381
3423
  transition: "padding 0.2s ease"
3382
- })), it = E(() => {
3383
- let e = Ke.value;
3384
- return rt(e?.pageWidth ?? 12240) * X.value;
3385
- }), at = E(() => {
3424
+ })), st = D(() => {
3425
+ let e = Ze.value;
3426
+ return it(e?.pageWidth ?? 12240) * Y.value;
3427
+ }), ct = D(() => {
3386
3428
  let e = /* @__PURE__ */ new Set();
3387
3429
  for (let t of q.value) t.parentId == null && t.done && e.add(t.id);
3388
3430
  return e;
3389
- }), ot = E(() => {
3390
- y.value;
3391
- let e = Z.value;
3431
+ }), lt = D(() => {
3432
+ x.value;
3433
+ let e = X.value;
3392
3434
  if (!e) return [];
3393
3435
  let t = /* @__PURE__ */ new Set(), n = [];
3394
3436
  return e.state.doc.descendants((e) => {
@@ -3403,214 +3445,218 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3403
3445
  }
3404
3446
  return !0;
3405
3447
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3406
- }), st = Ot(), { floatingCommentBtn: ct, pendingCommentRange: lt, addCommentYPosition: ut, sidebarAutoOpenedRef: dt, extractCommentsAndChanges: ft, handleAddComment: pt, handleCancelAddComment: mt, handleStartAddComment: ht, handleMarkerClick: gt } = Xr({
3407
- editorView: Z,
3408
- getDocument: Q,
3448
+ }), ut = kt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = Qr({
3449
+ editorView: X,
3450
+ getDocument: Z,
3409
3451
  comments: q,
3410
- trackedChanges: he,
3411
- resolvedCommentIds: at,
3412
- activeSidebarItem: K,
3413
- showSidebar: U,
3452
+ trackedChanges: _e,
3453
+ resolvedCommentIds: ct,
3454
+ activeSidebarItem: G,
3455
+ showSidebar: H,
3414
3456
  isAddingComment: W,
3415
3457
  readOnly: s,
3416
- zoom: X,
3417
- stateTick: y,
3418
- pagesRef: d,
3419
- pagesViewportRef: g,
3458
+ zoom: Y,
3459
+ stateTick: x,
3460
+ pagesRef: g,
3461
+ pagesViewportRef: y,
3420
3462
  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,
3425
- getDocument: Q,
3426
- saveBlob: Le,
3427
- extractCommentsAndChanges: ft,
3463
+ commentIdAllocator: ut,
3464
+ author: l,
3465
+ commentCallbacks: Xe
3466
+ }), { docxInputRef: bt, handleDocxFileChange: xt, handleDocumentNameChange: St, downloadCurrentDocument: Ct, loadDocumentBuffer: wt, loadDocument: Tt, save: Et } = Ur({
3467
+ loadBuffer: Re,
3468
+ loadParsedDocument: ze,
3469
+ getDocument: Z,
3470
+ saveBlob: Be,
3471
+ extractCommentsAndChanges: ht,
3428
3472
  emit: a,
3429
3473
  documentName: () => i.documentName,
3430
3474
  onDocumentNameChange: i.onDocumentNameChange,
3431
- nextTick: ce
3432
- }), { hyperlinkPopupData: wt, handleHyperlinkSubmit: Tt, handleHyperlinkRemove: Et, handleHyperlinkPopupNavigate: Dt, handleHyperlinkPopupEdit: kt, handleHyperlinkPopupRemove: At } = Ur({
3433
- editorView: Z,
3434
- getCommands: Be
3435
- }), { handleClearFormatting: jt, handleApplyStyle: Mt, handleInsertPageBreak: Nt, handleInsertSymbol: Pt, applyFormatting: Ft, setParagraphStyle: It } = Wr({
3436
- editorView: Z,
3437
- getDocument: Q
3438
- }), { handlePageSetupApply: Lt, handleLeftMarginChange: zt, handleRightMarginChange: Bt, handleTopMarginChange: Vt, handleBottomMarginChange: Ht, handleIndentLeftChange: Ut, handleIndentRightChange: Gt, handleFirstLineIndentChange: Kt, handleTabStopRemove: qt } = Gr({
3439
- editorView: Z,
3440
- getDocument: Q,
3475
+ nextTick: ue
3476
+ }), { hyperlinkPopupData: Dt, handleHyperlinkSubmit: Ot, handleHyperlinkRemove: At, handleHyperlinkPopupNavigate: jt, handleHyperlinkPopupEdit: Mt, handleHyperlinkPopupRemove: Nt } = Wr({
3477
+ editorView: X,
3478
+ getCommands: We
3479
+ }), { handleClearFormatting: Pt, handleApplyStyle: Ft, handleInsertPageBreak: It, handleInsertSymbol: Lt, applyFormatting: Rt, setParagraphStyle: Bt } = Gr({
3480
+ editorView: X,
3481
+ getDocument: Z
3482
+ }), { handlePageSetupApply: Vt, handleLeftMarginChange: Ht, handleRightMarginChange: Ut, handleTopMarginChange: Wt, handleBottomMarginChange: Kt, handleIndentLeftChange: qt, handleIndentRightChange: Jt, handleFirstLineIndentChange: Yt, handleTabStopRemove: Xt } = Kr({
3483
+ editorView: X,
3484
+ getDocument: Z,
3441
3485
  readOnly: s,
3442
- stateTick: y,
3443
- reLayout: Ve,
3486
+ stateTick: x,
3487
+ reLayout: Ge,
3444
3488
  emit: a
3445
- }), { showWatermark: Jt, currentWatermark: Yt, handleWatermarkApply: Xt } = Kr({
3446
- editorView: Z,
3489
+ }), { showWatermark: Zt, currentWatermark: $t, handleWatermarkApply: en } = qr({
3490
+ editorView: X,
3447
3491
  readOnly: s,
3448
- stateTick: y
3449
- }), { handleToggleOutline: Qt, handleOutlineNavigate: $t, handleToggleSidebar: en, handleEditorScrollMouseDown: tn } = qr({
3450
- editorView: Z,
3451
- showOutline: P,
3452
- showSidebar: U,
3453
- outlineHeadings: ge,
3454
- activeSidebarItem: K,
3455
- extractCommentsAndChanges: ft
3492
+ stateTick: x
3493
+ }), { handleToggleOutline: tn, handleOutlineNavigate: nn, handleToggleSidebar: on, handleEditorScrollMouseDown: sn } = Jr({
3494
+ editorView: X,
3495
+ showOutline: me,
3496
+ showSidebar: H,
3497
+ outlineHeadings: ve,
3498
+ activeSidebarItem: G,
3499
+ extractCommentsAndChanges: ht
3456
3500
  });
3457
- Jr({
3458
- showKeyboardShortcuts: pe,
3459
- showFindReplace: C,
3460
- showHyperlink: ie,
3461
- handleZoomKeyDown: Oe,
3501
+ Yr({
3502
+ showKeyboardShortcuts: he,
3503
+ showFindReplace: E,
3504
+ showHyperlink: oe,
3505
+ handleZoomKeyDown: je,
3462
3506
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3463
3507
  });
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({
3465
- editorView: Z,
3466
- getDocument: Q,
3508
+ let { addComment: ln, replyToComment: un, resolveComment: dn, proposeChange: fn, handleCommentReply: mn, handleCommentResolve: hn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = Xr({
3509
+ editorView: X,
3510
+ getDocument: Z,
3467
3511
  comments: q,
3468
- trackedChanges: he,
3469
- showSidebar: U,
3512
+ trackedChanges: _e,
3513
+ showSidebar: H,
3470
3514
  isAddingComment: W,
3471
- pendingCommentRange: lt,
3472
- contentChangeSubscribers: x,
3473
- extractCommentsAndChanges: ft,
3515
+ pendingCommentRange: ft,
3516
+ contentChangeSubscribers: S,
3517
+ extractCommentsAndChanges: ht,
3474
3518
  emit: a,
3475
- commentIdAllocator: st
3476
- }), { selectedImage: bn, imageInteracting: xn, imageToolbarContext: Sn, handleInsertImage: Cn, handleToolbarImageWrap: wn, handleImageTransform: Tn } = Zr({
3477
- editorView: Z,
3478
- zoom: X,
3479
- stateTick: y,
3480
- getCommands: Be
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({
3482
- editorView: Z,
3483
- pagesRef: d,
3484
- pagesViewportRef: g,
3485
- selectedImage: bn,
3486
- imageInteracting: xn,
3487
- hyperlinkPopupData: wt,
3519
+ commentIdAllocator: ut,
3520
+ author: l,
3521
+ commentCallbacks: Xe
3522
+ }), { selectedImage: wn, imageInteracting: Tn, imageToolbarContext: En, handleInsertImage: Dn, handleToolbarImageWrap: On, handleImageTransform: kn } = $r({
3523
+ editorView: X,
3524
+ zoom: Y,
3525
+ stateTick: x,
3526
+ getCommands: We
3527
+ }), An = te(), jn = null, { tableInsertButton: Mn, hfEdit: $, scrollPageInfo: Nn, resolvePos: Pn, setPmSelection: Fn, scrollVisiblePositionIntoView: In, handlePagesMouseDown: Ln, handlePagesMouseMove: Rn, handlePagesClick: zn, handlePagesDoubleClick: Bn, handleTableInsertClick: Vn, clearTableInsertTimer: Hn, handleHfSave: Un, handleHfRemove: Wn } = li({
3528
+ editorView: X,
3529
+ pagesRef: g,
3530
+ pagesViewportRef: y,
3531
+ selectedImage: wn,
3532
+ imageInteracting: Tn,
3533
+ hyperlinkPopupData: Dt,
3488
3534
  readOnly: s,
3489
- zoom: X,
3490
- layout: Pe,
3491
- tableResize: En,
3492
- getCommands: Be,
3493
- getDocument: Q,
3494
- reLayout: Ve,
3535
+ zoom: Y,
3536
+ layout: Le,
3537
+ tableResize: An,
3538
+ getCommands: We,
3539
+ getDocument: Z,
3540
+ reLayout: Ge,
3495
3541
  emit: a,
3496
- clearOverlay: $n,
3497
- syncHfPMs: Ue,
3498
- getHfPmView: He,
3499
- setDocument: Ge
3500
- }), { contextMenu: Vn, imageContextMenu: Hn, imageContextMenuTextActions: Un, handleContextMenu: Wn, handleSelectedImageContextMenu: Gn, handleImageWrapSelect: Kn, handleContextMenuAction: qn } = ai({
3501
- editorView: Z,
3502
- selectedImage: bn,
3503
- zoom: X,
3504
- showImageProperties: j,
3505
- getCommands: Be,
3506
- clearOverlay: $n,
3507
- setPmSelection: jn,
3508
- resolvePos: An
3509
- }), { handleMenuAction: Jn, handleMenuTableInsert: Yn } = li({
3510
- editorView: Z,
3511
- getCommands: Be,
3512
- docxInputRef: _t,
3513
- showPageSetup: N,
3514
- showWatermark: Jt,
3515
- showInsertImage: T,
3516
- showHyperlink: ie,
3517
- showInsertSymbol: oe,
3518
- showKeyboardShortcuts: pe,
3519
- handleClearFormatting: jt,
3520
- handleInsertPageBreak: Nt,
3521
- handleToggleOutline: Qt,
3522
- handleToggleSidebar: en,
3523
- downloadCurrentDocument: bt,
3542
+ clearOverlay: rr,
3543
+ syncHfPMs: qe,
3544
+ getHfPmView: Ke,
3545
+ setDocument: Ye
3546
+ }), { contextMenu: Gn, imageContextMenu: Kn, imageContextMenuTextActions: qn, handleContextMenu: Jn, handleSelectedImageContextMenu: Yn, handleImageWrapSelect: Xn, handleContextMenuAction: Zn } = si({
3547
+ editorView: X,
3548
+ selectedImage: wn,
3549
+ zoom: Y,
3550
+ showImageProperties: M,
3551
+ getCommands: We,
3552
+ clearOverlay: rr,
3553
+ setPmSelection: Fn,
3554
+ resolvePos: Pn
3555
+ }), { handleMenuAction: Qn, handleMenuTableInsert: $n } = di({
3556
+ editorView: X,
3557
+ getCommands: We,
3558
+ docxInputRef: bt,
3559
+ showPageSetup: ce,
3560
+ showWatermark: Zt,
3561
+ showInsertImage: re,
3562
+ showHyperlink: oe,
3563
+ showInsertSymbol: se,
3564
+ showKeyboardShortcuts: he,
3565
+ handleClearFormatting: Pt,
3566
+ handleInsertPageBreak: It,
3567
+ handleToggleOutline: tn,
3568
+ handleToggleSidebar: on,
3569
+ downloadCurrentDocument: Ct,
3524
3570
  emit: a
3525
3571
  });
3526
- ui({
3572
+ fi({
3527
3573
  documentBuffer: () => i.documentBuffer,
3528
3574
  document: () => i.document,
3529
- loadDocumentBuffer: xt,
3530
- loadDocument: St,
3531
- sidebarAutoOpenedRef: dt
3575
+ loadDocumentBuffer: wt,
3576
+ loadDocument: Tt,
3577
+ sidebarAutoOpenedRef: mt
3532
3578
  });
3533
- let Xn = () => Z.value, Zn = () => d.value;
3534
- G(() => i.mode, (e) => {
3579
+ let er = () => X.value, tr = () => g.value;
3580
+ U(() => i.mode, (e) => {
3535
3581
  e && e !== o.value && (o.value = e);
3536
- }), G(() => i.showOutline, (e) => {
3537
- P.value = !!e;
3582
+ }), U(() => i.showOutline, (e) => {
3583
+ me.value = !!e;
3538
3584
  });
3539
- function Qn(e) {
3585
+ function nr(e) {
3540
3586
  o.value !== e && (o.value = e, a("mode-change", e));
3541
3587
  }
3542
- ue(() => {
3543
- Dn = En.install();
3544
- }), I(() => {
3545
- Dn?.();
3588
+ I(() => {
3589
+ jn = An.install();
3590
+ }), F(() => {
3591
+ jn?.();
3546
3592
  });
3547
- function $n() {
3548
- tr.clearOverlay();
3593
+ function rr() {
3594
+ ar.clearOverlay();
3549
3595
  }
3550
- function er() {
3551
- tr.updateSelectionOverlay();
3596
+ function ir() {
3597
+ ar.updateSelectionOverlay();
3552
3598
  }
3553
- let tr = ci({
3554
- editorView: Z,
3555
- pagesRef: d,
3556
- zoom: X,
3557
- selectedImage: bn,
3558
- isHfEditing: E(() => $.value !== null),
3559
- imageInteracting: xn
3599
+ let ar = ui({
3600
+ editorView: X,
3601
+ pagesRef: g,
3602
+ zoom: Y,
3603
+ selectedImage: wn,
3604
+ isHfEditing: D(() => $.value !== null),
3605
+ imageInteracting: Tn
3560
3606
  });
3561
- I(() => {
3562
- $n();
3607
+ F(() => {
3608
+ rr();
3563
3609
  });
3564
- let { exposed: nr } = di({
3565
- editorView: Z,
3566
- layout: Pe,
3567
- pagesRef: d,
3568
- pagesViewportRef: g,
3569
- zoom: X,
3610
+ let { exposed: or } = pi({
3611
+ editorView: X,
3612
+ layout: Le,
3613
+ pagesRef: g,
3614
+ pagesViewportRef: y,
3615
+ zoom: Y,
3570
3616
  comments: q,
3571
- focus: Re,
3572
- destroy: ze,
3573
- getDocument: Q,
3574
- setZoom: Se,
3575
- save: Ct,
3576
- loadDocument: St,
3577
- loadDocumentBuffer: xt,
3578
- addComment: an,
3579
- replyToComment: on,
3580
- resolveComment: cn,
3581
- proposeChange: ln,
3582
- applyFormatting: Ft,
3583
- setParagraphStyle: It,
3584
- scrollVisiblePositionIntoView: Mn,
3585
- contentChangeSubscribers: x,
3586
- selectionChangeSubscribers: ee,
3617
+ focus: He,
3618
+ destroy: Ue,
3619
+ getDocument: Z,
3620
+ setZoom: Ee,
3621
+ save: Et,
3622
+ loadDocument: Tt,
3623
+ loadDocumentBuffer: wt,
3624
+ addComment: ln,
3625
+ replyToComment: un,
3626
+ resolveComment: dn,
3627
+ proposeChange: fn,
3628
+ applyFormatting: Rt,
3629
+ setParagraphStyle: Bt,
3630
+ scrollVisiblePositionIntoView: In,
3631
+ contentChangeSubscribers: S,
3632
+ selectionChangeSubscribers: C,
3587
3633
  onPrint: i.onPrint
3588
3634
  });
3589
- return n(nr), (t, n) => (L(), k("div", {
3590
- class: le([
3635
+ return n(or), (t, n) => (L(), k("div", {
3636
+ class: N([
3591
3637
  "docx-editor-vue ep-root paged-editor",
3592
3638
  e.className,
3593
3639
  {
3594
3640
  "paged-editor--readonly": s.value,
3595
- "paged-editor--hf-editing": H($) !== null,
3596
- "paged-editor--editing-header": H($)?.position === "header",
3597
- "paged-editor--editing-footer": H($)?.position === "footer"
3641
+ "paged-editor--hf-editing": V($) !== null,
3642
+ "paged-editor--editing-header": V($)?.position === "header",
3643
+ "paged-editor--editing-footer": V($)?.position === "footer"
3598
3644
  }
3599
3645
  ]),
3600
- style: F(e.style)
3646
+ style: P(e.style)
3601
3647
  }, [
3602
- A("div", pi, [M(_n, {
3648
+ A("div", hi, [j(vn, {
3603
3649
  "show-menu-bar": e.showMenuBar,
3604
3650
  "document-name": e.documentName,
3605
3651
  "document-name-editable": e.documentNameEditable,
3606
3652
  "render-logo": e.renderLogo,
3607
3653
  "render-title-bar-right": e.renderTitleBarRight,
3608
- onRename: H(yt),
3609
- onMenuAction: H(Jn),
3610
- onInsertTable: H(Yn)
3654
+ onRename: V(St),
3655
+ onMenuAction: V(Qn),
3656
+ onInsertTable: V($n)
3611
3657
  }, {
3612
- "title-bar-left": me(() => [de(t.$slots, "title-bar-left")]),
3613
- "title-bar-right": me(() => [de(t.$slots, "title-bar-right")]),
3658
+ "title-bar-left": ge(() => [fe(t.$slots, "title-bar-left")]),
3659
+ "title-bar-right": ge(() => [fe(t.$slots, "title-bar-right")]),
3614
3660
  _: 3
3615
3661
  }, 8, [
3616
3662
  "show-menu-bar",
@@ -3621,37 +3667,37 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3621
3667
  "onRename",
3622
3668
  "onMenuAction",
3623
3669
  "onInsertTable"
3624
- ]), e.showToolbar ? (L(), D(b, {
3670
+ ]), e.showToolbar ? (L(), ie(b, {
3625
3671
  key: 0,
3626
- view: H(Z),
3627
- "get-commands": H(Be),
3628
- "state-tick": y.value,
3629
- "zoom-percent": H(ye),
3630
- "is-min-zoom": H(be),
3631
- "is-max-zoom": H(xe),
3632
- "zoom-presets": H(Ae),
3672
+ view: V(X),
3673
+ "get-commands": V(We),
3674
+ "state-tick": x.value,
3675
+ "zoom-percent": V(xe),
3676
+ "is-min-zoom": V(Se),
3677
+ "is-max-zoom": V(Ce),
3678
+ "zoom-presets": V(Ne),
3633
3679
  "show-zoom-control": e.showZoomControl,
3634
3680
  "editor-mode": o.value,
3635
- "comments-sidebar-open": U.value,
3636
- "image-context": H(Sn),
3637
- theme: Ye.value,
3681
+ "comments-sidebar-open": H.value,
3682
+ "image-context": V(En),
3683
+ theme: $e.value,
3638
3684
  "font-families": e.fontFamilies,
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)
3685
+ onInsertLink: n[0] ||= (e) => oe.value = !0,
3686
+ onApplyStyle: V(Ft),
3687
+ onZoomIn: V(Oe),
3688
+ onZoomOut: V(ke),
3689
+ onZoomSet: V(Ee),
3690
+ onToggleSidebar: V(on),
3691
+ onModeChange: nr,
3692
+ onImageWrapType: V(On),
3693
+ onImageProperties: n[1] ||= (e) => M.value = !0,
3694
+ onImageTransform: V(kn)
3649
3695
  }, ae({
3650
- "table-context": me(() => [M(h, {
3651
- view: H(Z),
3652
- "get-commands": H(Be),
3653
- "state-tick": y.value,
3654
- theme: Ye.value
3696
+ "table-context": ge(() => [j(h, {
3697
+ view: V(X),
3698
+ "get-commands": V(We),
3699
+ "state-tick": x.value,
3700
+ theme: $e.value
3655
3701
  }, null, 8, [
3656
3702
  "view",
3657
3703
  "get-commands",
@@ -3661,11 +3707,11 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3661
3707
  _: 2
3662
3708
  }, [e.toolbarExtra ? {
3663
3709
  name: "toolbar-extra",
3664
- fn: me(() => [(L(), D(fe(e.toolbarExtra)))]),
3710
+ fn: ge(() => [(L(), ie(pe(e.toolbarExtra)))]),
3665
3711
  key: "0"
3666
3712
  } : {
3667
3713
  name: "toolbar-extra",
3668
- fn: me(() => [de(t.$slots, "toolbar-extra")]),
3714
+ fn: ge(() => [fe(t.$slots, "toolbar-extra")]),
3669
3715
  key: "1"
3670
3716
  }]), 1032, [
3671
3717
  "view",
@@ -3689,35 +3735,35 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3689
3735
  "onImageWrapType",
3690
3736
  "onImageTransform"
3691
3737
  ])) : O("", !0)]),
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,
3707
- "show-keyboard-shortcuts": pe.value,
3708
- "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => pe.value = e,
3709
- view: H(Z),
3710
- bookmarks: ot.value,
3711
- "selected-image-pm-pos": H(bn)?.pmPos ?? null,
3712
- "section-properties": Ke.value,
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)
3738
+ j(cr, {
3739
+ "show-find-replace": E.value,
3740
+ "onUpdate:showFindReplace": n[2] ||= (e) => E.value = e,
3741
+ "show-insert-image": re.value,
3742
+ "onUpdate:showInsertImage": n[3] ||= (e) => re.value = e,
3743
+ "show-hyperlink": oe.value,
3744
+ "onUpdate:showHyperlink": n[4] ||= (e) => oe.value = e,
3745
+ "show-insert-symbol": se.value,
3746
+ "onUpdate:showInsertSymbol": n[5] ||= (e) => se.value = e,
3747
+ "show-image-properties": M.value,
3748
+ "onUpdate:showImageProperties": n[6] ||= (e) => M.value = e,
3749
+ "show-page-setup": ce.value,
3750
+ "onUpdate:showPageSetup": n[7] ||= (e) => ce.value = e,
3751
+ "show-watermark": V(Zt),
3752
+ "onUpdate:showWatermark": n[8] ||= (e) => le(Zt) ? Zt.value = e : null,
3753
+ "show-keyboard-shortcuts": he.value,
3754
+ "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => he.value = e,
3755
+ view: V(X),
3756
+ bookmarks: lt.value,
3757
+ "selected-image-pm-pos": V(wn)?.pmPos ?? null,
3758
+ "section-properties": Ze.value,
3759
+ "current-watermark": V($t),
3760
+ "scroll-visible-position-into-view": V(In),
3761
+ onInsertImage: V(Dn),
3762
+ onInsertSymbol: V(Lt),
3763
+ onHyperlinkSubmit: V(Ot),
3764
+ onHyperlinkRemove: V(At),
3765
+ onPageSetupApply: V(Vt),
3766
+ onWatermarkApply: V(en)
3721
3767
  }, null, 8, [
3722
3768
  "show-find-replace",
3723
3769
  "show-insert-image",
@@ -3740,35 +3786,35 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3740
3786
  "onPageSetupApply",
3741
3787
  "onWatermarkApply"
3742
3788
  ]),
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),
3789
+ V(Ie) ? (L(), k("div", gi, B(V(Ie)), 1)) : O("", !0),
3790
+ !V(Fe) && !V(Ie) ? (L(), k("div", _i, "Loading...")) : O("", !0),
3745
3791
  A("div", {
3746
3792
  ref_key: "hiddenPmRef",
3747
- ref: u,
3793
+ ref: d,
3748
3794
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3749
3795
  }, null, 512),
3750
3796
  A("div", {
3751
3797
  class: "docx-editor-vue__editor-scroll",
3752
- onMousedown: n[32] ||= (...e) => H(tn) && H(tn)(...e)
3753
- }, [e.showRuler && Ke.value ? (L(), k("div", {
3798
+ onMousedown: n[32] ||= (...e) => V(sn) && V(sn)(...e)
3799
+ }, [e.showRuler && Ze.value ? (L(), k("div", {
3754
3800
  key: 0,
3755
3801
  class: "docx-editor-vue__ruler-row",
3756
- style: F(nt.value)
3757
- }, [M(_, {
3758
- "section-props": Ke.value,
3759
- zoom: H(X),
3802
+ style: P(ot.value)
3803
+ }, [j(_, {
3804
+ "section-props": Ze.value,
3805
+ zoom: V(Y),
3760
3806
  editable: !s.value,
3761
- "indent-left": qe.value.indentLeft,
3762
- "indent-right": qe.value.indentRight,
3763
- "first-line-indent": qe.value.firstLineIndent,
3764
- "hanging-indent": qe.value.hangingIndent,
3765
- "tab-stops": qe.value.tabStops,
3766
- onLeftMarginChange: H(zt),
3767
- onRightMarginChange: H(Bt),
3768
- onIndentLeftChange: H(Ut),
3769
- onIndentRightChange: H(Gt),
3770
- onFirstLineIndentChange: H(Kt),
3771
- onTabStopRemove: H(qt)
3807
+ "indent-left": Qe.value.indentLeft,
3808
+ "indent-right": Qe.value.indentRight,
3809
+ "first-line-indent": Qe.value.firstLineIndent,
3810
+ "hanging-indent": Qe.value.hangingIndent,
3811
+ "tab-stops": Qe.value.tabStops,
3812
+ onLeftMarginChange: V(Ht),
3813
+ onRightMarginChange: V(Ut),
3814
+ onIndentLeftChange: V(qt),
3815
+ onIndentRightChange: V(Jt),
3816
+ onFirstLineIndentChange: V(Yt),
3817
+ onTabStopRemove: V(Xt)
3772
3818
  }, null, 8, [
3773
3819
  "section-props",
3774
3820
  "zoom",
@@ -3784,24 +3830,24 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3784
3830
  "onIndentRightChange",
3785
3831
  "onFirstLineIndentChange",
3786
3832
  "onTabStopRemove"
3787
- ])], 4)) : O("", !0), A("div", gi, [
3833
+ ])], 4)) : O("", !0), A("div", vi, [
3788
3834
  A("div", {
3789
3835
  ref_key: "pagesViewportRef",
3790
- ref: g,
3836
+ ref: y,
3791
3837
  class: "docx-editor-vue__pages-viewport",
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)
3838
+ onMousedown: n[23] ||= (...e) => V(Ln) && V(Ln)(...e),
3839
+ onMousemove: n[24] ||= (...e) => V(Rn) && V(Rn)(...e),
3840
+ onClick: n[25] ||= (...e) => V(zn) && V(zn)(...e),
3841
+ onDblclick: n[26] ||= (...e) => V(Bn) && V(Bn)(...e),
3842
+ onContextmenu: n[27] ||= K((...e) => V(Jn) && V(Jn)(...e), ["prevent"]),
3843
+ onWheel: n[28] ||= (...e) => V(Ae) && V(Ae)(...e)
3798
3844
  }, [
3799
- e.showRuler && Ke.value ? (L(), k("div", _i, [M(p, {
3800
- "section-props": Ke.value,
3801
- zoom: H(X),
3845
+ e.showRuler && Ze.value ? (L(), k("div", yi, [j(p, {
3846
+ "section-props": Ze.value,
3847
+ zoom: V(Y),
3802
3848
  editable: !s.value,
3803
- onTopMarginChange: H(Vt),
3804
- onBottomMarginChange: H(Ht)
3849
+ onTopMarginChange: V(Wt),
3850
+ onBottomMarginChange: V(Kt)
3805
3851
  }, null, 8, [
3806
3852
  "section-props",
3807
3853
  "zoom",
@@ -3811,23 +3857,23 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3811
3857
  ])])) : O("", !0),
3812
3858
  A("div", {
3813
3859
  ref_key: "pagesRef",
3814
- ref: d,
3860
+ ref: g,
3815
3861
  class: "docx-editor-vue__pages paged-editor__pages",
3816
- style: F(tt.value)
3862
+ style: P(at.value)
3817
3863
  }, null, 4),
3818
- s.value ? O("", !0) : (L(), D(fn, {
3864
+ s.value ? O("", !0) : (L(), ie(pn, {
3819
3865
  key: 1,
3820
- container: d.value,
3821
- view: H(Z)
3866
+ container: g.value,
3867
+ view: V(X)
3822
3868
  }, null, 8, ["container", "view"])),
3823
- M(sn, {
3824
- "is-open": H($) !== null,
3825
- position: H($)?.position ?? "header",
3826
- view: et.value,
3827
- "target-rect": H($)?.targetRect ?? null,
3828
- onSave: H(zn),
3869
+ j(cn, {
3870
+ "is-open": V($) !== null,
3871
+ position: V($)?.position ?? "header",
3872
+ view: rt.value,
3873
+ "target-rect": V($)?.targetRect ?? null,
3874
+ onSave: V(Un),
3829
3875
  onClose: n[10] ||= (e) => $.value = null,
3830
- onRemove: H(Bn)
3876
+ onRemove: V(Wn)
3831
3877
  }, null, 8, [
3832
3878
  "is-open",
3833
3879
  "position",
@@ -3836,11 +3882,11 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3836
3882
  "onSave",
3837
3883
  "onRemove"
3838
3884
  ]),
3839
- (L(!0), k(w, null, z(H($) ? Ze.value : [], (e, t) => (L(), k("div", {
3885
+ (L(!0), k(T, null, de(V($) ? et.value : [], (e, t) => (L(), k("div", {
3840
3886
  key: `hf-sel-${t}-${e.top}-${e.left}`,
3841
3887
  class: "vue-hf-sel-rect",
3842
3888
  "aria-hidden": "true",
3843
- style: F({
3889
+ style: P({
3844
3890
  position: "fixed",
3845
3891
  top: `${e.top}px`,
3846
3892
  left: `${e.left}px`,
@@ -3851,74 +3897,74 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3851
3897
  zIndex: 9998
3852
3898
  })
3853
3899
  }, null, 4))), 128)),
3854
- H($) && Xe.value ? (L(), k("div", {
3900
+ V($) && Q.value ? (L(), k("div", {
3855
3901
  key: 2,
3856
3902
  "aria-hidden": "true",
3857
- style: F({
3903
+ style: P({
3858
3904
  position: "fixed",
3859
- top: `${Xe.value.top}px`,
3860
- left: `${Xe.value.left}px`,
3905
+ top: `${Q.value.top}px`,
3906
+ left: `${Q.value.left}px`,
3861
3907
  width: "2px",
3862
- height: `${Xe.value.height}px`,
3908
+ height: `${Q.value.height}px`,
3863
3909
  background: "#4285f4",
3864
3910
  pointerEvents: "none",
3865
3911
  zIndex: 9999,
3866
3912
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3867
3913
  })
3868
3914
  }, null, 4)) : O("", !0),
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)
3915
+ j(Qt, {
3916
+ "image-info": V(wn),
3917
+ zoom: V(Y),
3918
+ view: V(X),
3919
+ onOpenProperties: n[11] ||= (e) => M.value = !0,
3920
+ onDeselect: n[12] ||= (e) => wn.value = null,
3921
+ onInteractStart: n[13] ||= (e) => Tn.value = !0,
3922
+ onInteractEnd: n[14] ||= (e) => Tn.value = !1,
3923
+ onContextMenu: V(Yn)
3878
3924
  }, null, 8, [
3879
3925
  "image-info",
3880
3926
  "zoom",
3881
3927
  "view",
3882
3928
  "onContextMenu"
3883
3929
  ]),
3884
- M(Wt, {
3885
- "get-view": Xn,
3886
- "get-pages-container": Zn,
3887
- zoom: H(X),
3888
- "transaction-version": y.value,
3889
- "sync-coordinator": H(S)
3930
+ j(Gt, {
3931
+ "get-view": er,
3932
+ "get-pages-container": tr,
3933
+ zoom: V(Y),
3934
+ "transaction-version": x.value,
3935
+ "sync-coordinator": V(w)
3890
3936
  }, null, 8, [
3891
3937
  "zoom",
3892
3938
  "transaction-version",
3893
3939
  "sync-coordinator"
3894
3940
  ]),
3895
- H(ct) && !W.value && !s.value ? (L(), k("button", {
3941
+ V(dt) && !W.value && !s.value ? (L(), k("button", {
3896
3942
  key: 3,
3897
3943
  type: "button",
3898
3944
  class: "docx-editor-vue__floating-comment",
3899
- style: F({
3900
- top: H(ct).top + "px",
3901
- left: H(ct).left + "px"
3945
+ style: P({
3946
+ top: V(dt).top + "px",
3947
+ left: V(dt).left + "px"
3902
3948
  }),
3903
- title: H(l)("comments.addComment"),
3904
- onMousedown: n[15] ||= J((...e) => H(ht) && H(ht)(...e), ["prevent", "stop"])
3905
- }, [M(c, {
3949
+ title: V(u)("comments.addComment"),
3950
+ onMousedown: n[15] ||= K((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
3951
+ }, [j(c, {
3906
3952
  name: "add_comment",
3907
3953
  size: 16
3908
- })], 44, vi)) : O("", !0),
3909
- H(On) && !s.value ? (L(), k("button", {
3954
+ })], 44, bi)) : O("", !0),
3955
+ V(Mn) && !s.value ? (L(), k("button", {
3910
3956
  key: 4,
3911
3957
  type: "button",
3912
3958
  class: "docx-editor-vue__table-insert-btn",
3913
- style: F({
3914
- left: H(On).x + "px",
3915
- top: H(On).y + "px"
3959
+ style: P({
3960
+ left: V(Mn).x + "px",
3961
+ top: V(Mn).y + "px"
3916
3962
  }),
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
3963
+ title: V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3964
+ "aria-label": V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3965
+ onMousedown: n[16] ||= (...e) => V(Vn) && V(Vn)(...e),
3966
+ onMouseenter: n[17] ||= (...e) => V(Hn) && V(Hn)(...e),
3967
+ onMouseleave: n[18] ||= (e) => Mn.value = null
3922
3968
  }, [...n[37] ||= [A("svg", {
3923
3969
  width: "12",
3924
3970
  height: "12",
@@ -3929,15 +3975,15 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3929
3975
  stroke: "currentColor",
3930
3976
  "stroke-width": "1.5",
3931
3977
  "stroke-linecap": "round"
3932
- })], -1)]], 44, yi)) : O("", !0),
3933
- M(v, {
3978
+ })], -1)]], 44, xi)) : O("", !0),
3979
+ j(v, {
3934
3980
  comments: q.value,
3935
- "pages-container": d.value,
3936
- zoom: H(X),
3937
- "page-width-px": it.value,
3938
- "sidebar-open": U.value,
3939
- "resolved-comment-ids": at.value,
3940
- onMarkerClick: H(gt)
3981
+ "pages-container": g.value,
3982
+ zoom: V(Y),
3983
+ "page-width-px": st.value,
3984
+ "sidebar-open": H.value,
3985
+ "resolved-comment-ids": ct.value,
3986
+ onMarkerClick: V(yt)
3941
3987
  }, null, 8, [
3942
3988
  "comments",
3943
3989
  "pages-container",
@@ -3947,30 +3993,30 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3947
3993
  "resolved-comment-ids",
3948
3994
  "onMarkerClick"
3949
3995
  ]),
3950
- M(m, {
3951
- "is-open": U.value,
3996
+ j(m, {
3997
+ "is-open": H.value,
3952
3998
  comments: q.value,
3953
- "tracked-changes": he.value,
3999
+ "tracked-changes": _e.value,
3954
4000
  "is-adding-comment": W.value,
3955
- "add-comment-y-position": H(ut),
4001
+ "add-comment-y-position": V(pt),
3956
4002
  "show-resolved": !0,
3957
- "pages-container": d.value,
3958
- "page-width-px": it.value,
3959
- zoom: H(X),
3960
- "active-item-id": K.value,
3961
- onClose: n[19] ||= (e) => U.value = !1,
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),
3973
- "onUpdate:activeItemId": n[20] ||= (e) => K.value = e
4003
+ "pages-container": g.value,
4004
+ "page-width-px": st.value,
4005
+ zoom: V(Y),
4006
+ "active-item-id": G.value,
4007
+ onClose: n[19] ||= (e) => H.value = !1,
4008
+ onAddComment: V(gt),
4009
+ onCancelAddComment: V(_t),
4010
+ onCommentReply: V(mn),
4011
+ onCommentResolve: V(hn),
4012
+ onCommentUnresolve: V(gn),
4013
+ onCommentDelete: V(_n),
4014
+ onAcceptChange: V(yn),
4015
+ onRejectChange: V(bn),
4016
+ onAcceptChangeById: V(xn),
4017
+ onRejectChangeById: V(Sn),
4018
+ onTrackedChangeReply: V(Cn),
4019
+ "onUpdate:activeItemId": n[20] ||= (e) => G.value = e
3974
4020
  }, null, 8, [
3975
4021
  "is-open",
3976
4022
  "comments",
@@ -3993,14 +4039,14 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
3993
4039
  "onRejectChangeById",
3994
4040
  "onTrackedChangeReply"
3995
4041
  ]),
3996
- M(Vr, {
3997
- data: H(wt),
4042
+ j(Hr, {
4043
+ data: V(Dt),
3998
4044
  "read-only": s.value,
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
4045
+ onNavigate: V(jt),
4046
+ onCopy: n[21] ||= (e) => Dt.value = null,
4047
+ onEdit: V(Mt),
4048
+ onRemove: V(Nt),
4049
+ onClose: n[22] ||= (e) => Dt.value = null
4004
4050
  }, null, 8, [
4005
4051
  "data",
4006
4052
  "read-only",
@@ -4009,32 +4055,32 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
4009
4055
  "onRemove"
4010
4056
  ])
4011
4057
  ], 544),
4012
- !P.value && e.showOutlineButton ? (L(), k("button", {
4058
+ !me.value && e.showOutlineButton ? (L(), k("button", {
4013
4059
  key: 0,
4014
4060
  type: "button",
4015
4061
  class: "docx-editor-vue__outline-toggle",
4016
4062
  title: "Show document outline",
4017
- onClick: n[29] ||= (...e) => H(Qt) && H(Qt)(...e),
4018
- onMousedown: n[30] ||= J(() => {}, ["stop"])
4019
- }, [M(c, {
4063
+ onClick: n[29] ||= (...e) => V(tn) && V(tn)(...e),
4064
+ onMousedown: n[30] ||= K(() => {}, ["stop"])
4065
+ }, [j(c, {
4020
4066
  name: "format_list_bulleted",
4021
4067
  size: 20
4022
4068
  })], 32)) : O("", !0),
4023
- H(kn).totalPages > 1 ? (L(), D(rn, {
4069
+ V(Nn).totalPages > 1 ? (L(), ie(an, {
4024
4070
  key: 1,
4025
- "current-page": H(kn).currentPage,
4026
- "total-pages": H(kn).totalPages,
4027
- visible: H(kn).visible
4071
+ "current-page": V(Nn).currentPage,
4072
+ "total-pages": V(Nn).totalPages,
4073
+ visible: V(Nn).visible
4028
4074
  }, null, 8, [
4029
4075
  "current-page",
4030
4076
  "total-pages",
4031
4077
  "visible"
4032
4078
  ])) : O("", !0),
4033
- M(nn, {
4034
- "is-open": P.value,
4035
- headings: ge.value,
4036
- onClose: n[31] ||= (e) => P.value = !1,
4037
- onNavigate: H($t)
4079
+ j(rn, {
4080
+ "is-open": me.value,
4081
+ headings: ve.value,
4082
+ onClose: n[31] ||= (e) => me.value = !1,
4083
+ onNavigate: V(nn)
4038
4084
  }, null, 8, [
4039
4085
  "is-open",
4040
4086
  "headings",
@@ -4043,23 +4089,23 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
4043
4089
  ])], 32),
4044
4090
  A("input", {
4045
4091
  ref_key: "docxInputRef",
4046
- ref: _t,
4092
+ ref: bt,
4047
4093
  type: "file",
4048
4094
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4049
4095
  style: { display: "none" },
4050
- onChange: n[33] ||= (...e) => H(vt) && H(vt)(...e)
4096
+ onChange: n[33] ||= (...e) => V(xt) && V(xt)(...e)
4051
4097
  }, null, 544),
4052
- M(jr, {
4098
+ j(Mr, {
4053
4099
  "read-only": s.value,
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
4100
+ "context-menu": V(Gn),
4101
+ "image-context-menu": V(Kn),
4102
+ "image-context-menu-text-actions": V(qn),
4103
+ "can-open-image-properties": !!V(wn),
4104
+ onContextMenuAction: V(Zn),
4105
+ onCloseContextMenu: n[34] ||= (e) => V(Gn).isOpen = !1,
4106
+ onImageWrapSelect: V(Xn),
4107
+ onCloseImageContextMenu: n[35] ||= (e) => Kn.value = null,
4108
+ onOpenImageProperties: n[36] ||= (e) => M.value = !0
4063
4109
  }, null, 8, [
4064
4110
  "read-only",
4065
4111
  "context-menu",
@@ -4074,8 +4120,8 @@ var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
4074
4120
  });
4075
4121
  //#endregion
4076
4122
  //#region src/renderAsync.ts
4077
- async function xi(e, t, n = {}) {
4078
- let r = e instanceof ArrayBuffer ? e : await Ae(e), i = null, a = null, o = !1, s = {
4123
+ async function Ci(e, t, n = {}) {
4124
+ let r = e instanceof ArrayBuffer ? e : await Be(e), i = null, a = null, o = !1, s = {
4079
4125
  save: async () => {
4080
4126
  let e = await (i?.save() ?? Promise.resolve(null));
4081
4127
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4096,8 +4142,8 @@ async function xi(e, t, n = {}) {
4096
4142
  }
4097
4143
  };
4098
4144
  return new Promise((e, c) => {
4099
- a = ie({ setup() {
4100
- return () => P(bi, {
4145
+ a = re({ setup() {
4146
+ return () => ce(Si, {
4101
4147
  ...n,
4102
4148
  documentBuffer: r,
4103
4149
  showToolbar: n.showToolbar ?? !0,
@@ -4121,6 +4167,6 @@ async function xi(e, t, n = {}) {
4121
4167
  }
4122
4168
  //#endregion
4123
4169
  //#region src/index.ts
4124
- var Si = "0.0.2";
4170
+ var wi = "0.0.2";
4125
4171
  //#endregion
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 };
4172
+ export { Si as DocxEditor, wi as VERSION, Lt as createDocumentWithText, Rt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, Ci as renderAsync, n as useTranslation };