@eigenpal/docx-editor-vue 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,34 +1,35 @@
1
1
  import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-5ZsgieYf.js";
2
2
  import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-DLXxthZk.js";
3
3
  import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
- import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
- import { t as ee } from "./zIndex-CxELVe_L.js";
6
- import { n as te, r as ne, t as C } from "./useTableResize-BbyKMoa9.js";
7
- import { Fragment as w, Teleport as T, computed as E, createApp as re, createBlock as ie, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as ae, createStaticVNode as oe, createVNode as A, defineComponent as j, h as se, nextTick as ce, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as P, onMounted as F, openBlock as I, ref as L, renderList as R, renderSlot as le, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as z, unref as B, vModelText as V, watch as H, withCtx as U, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
8
- import { NodeSelection as q, TextSelection as fe } from "prosemirror-state";
9
- import { clickToPositionDom as pe, computeHfCaretRectFromView as me, findBodyPmSpans as he } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { clearFormatting as J, findHyperlinkRangeAt as Y } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
11
- import { SIDEBAR_DOCUMENT_SHIFT as ge, findWordBoundaries as _e, loadFontDefinitions as ve, onFontError as ye, pixelsToEmu as be, readDocxFileFromInput as xe, toArrayBuffer as Se } from "@eigenpal/docx-editor-core/utils";
12
- import { getTableContext as Ce } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
13
- import { clickToPositionDom as we, getCaretPositionFromDom as Te, getSelectionRectsFromDom as Ee } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
14
- import { IMAGE_LAYOUT_OPTIONS as X, captureInlinePositionEmu as De, deriveLayoutChoice as Oe, findImageElement as ke, isImageLayoutOptionEnabled as Ae, toolbarValueToLayoutTarget as je } from "@eigenpal/docx-editor-core/layout-painter";
15
- import { proseDocToBlocks as Me } from "@eigenpal/docx-editor-core/prosemirror/conversion";
16
- import { LayoutSelectionGate as Ne, schema as Pe } from "@eigenpal/docx-editor-core/prosemirror";
17
- import { pointsToHalfPoints as Fe, twipsToPixels as Ie } from "@eigenpal/docx-editor-core/utils/units";
18
- import { makeRevisionInfo as Z } from "@eigenpal/docx-editor-core/prosemirror/plugins";
19
- import { findPageIndexContainingPmPos as Le } from "@eigenpal/docx-editor-core/layout-engine";
20
- import { applyStyle as Re, removeTabStop as ze, setIndentFirstLine as Be, setIndentLeft as Ve, setIndentRight as He } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
21
- import { createStyleResolver as Ue } from "@eigenpal/docx-editor-core/prosemirror/styles";
22
- import { insertPageBreak as We } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
23
- import { mapHexToHighlightName as Ge } from "@eigenpal/docx-editor-core/utils/highlightColors";
24
- import { collectHeadings as Ke } from "@eigenpal/docx-editor-core/utils/headingCollector";
25
- import { acceptChange as qe, acceptChangeById as Je, insertImageNode as Ye, rejectChange as Xe, rejectChangeById as Ze } from "@eigenpal/docx-editor-core/prosemirror/commands";
26
- import { extractTrackedChanges as Qe } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
27
- import { TABLE_INSERT_HIDE_DELAY_MS as $e, detectTableInsertHover as et } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
28
- import { openReportIssue as tt } from "@eigenpal/docx-editor-core/utils/reportIssue";
29
- import { createDocumentWithText as nt, createEmptyDocument as rt } from "@eigenpal/docx-editor-core";
4
+ import { n as ee } from "./RenderedDomContext-CHc18N_2.js";
5
+ import { t as te } from "./zIndex-CxELVe_L.js";
6
+ import { n as ne, r as re, t as S } from "./useTableResize-BcBdSaOE.js";
7
+ import { Fragment as C, Teleport as w, computed as T, createApp as ie, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as ae, createStaticVNode as oe, createVNode as A, defineComponent as j, h as se, nextTick as ce, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as P, onMounted as F, openBlock as I, ref as L, renderList as R, renderSlot as le, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as z, unref as B, vModelText as V, watch as H, withCtx as U, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
8
+ import { NodeSelection as fe, TextSelection as pe } from "prosemirror-state";
9
+ import { clickToPositionDom as me, computeHfCaretRectFromView as he, findBodyPmSpans as ge } from "@eigenpal/docx-editor-core/layout-bridge";
10
+ import { clearFormatting as q, findHyperlinkRangeAt as J } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
11
+ import { SIDEBAR_DOCUMENT_SHIFT as _e, findWordBoundaries as ve, loadFontDefinitions as ye, onFontError as be, pixelsToEmu as xe, readDocxFileFromInput as Se, toArrayBuffer as Ce } from "@eigenpal/docx-editor-core/utils";
12
+ import { getTableContext as we } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
13
+ import { clickToPositionDom as Te, getCaretPositionFromDom as Ee, getSelectionRectsFromDom as De } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
14
+ import { IMAGE_LAYOUT_OPTIONS as Y, captureInlinePositionEmu as Oe, deriveLayoutChoice as ke, findImageElement as Ae, isImageLayoutOptionEnabled as je, renderAllPagesNow as Me, toolbarValueToLayoutTarget as Ne } from "@eigenpal/docx-editor-core/layout-painter";
15
+ import { proseDocToBlocks as Pe } from "@eigenpal/docx-editor-core/prosemirror/conversion";
16
+ import { LayoutSelectionGate as Fe, addRepeatingSectionItemTr as Ie, findContentControlPos as X, findContentControlsInPM as Z, removeContentControlTr as Le, removeRepeatingSectionItemTr as Re, schema as ze, setContentControlContentTr as Be, setContentControlValueTr as Ve } from "@eigenpal/docx-editor-core/prosemirror";
17
+ import { pointsToHalfPoints as He, twipsToPixels as Ue } from "@eigenpal/docx-editor-core/utils/units";
18
+ import { makeRevisionInfo as We } from "@eigenpal/docx-editor-core/prosemirror/plugins";
19
+ import { findPageIndexContainingPmPos as Ge } from "@eigenpal/docx-editor-core/layout-engine";
20
+ import { applyStyle as Ke, removeTabStop as qe, setIndentFirstLine as Je, setIndentLeft as Ye, setIndentRight as Xe } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
21
+ import { createStyleResolver as Ze } from "@eigenpal/docx-editor-core/prosemirror/styles";
22
+ import { insertPageBreak as Qe } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
23
+ import { mapHexToHighlightName as $e } from "@eigenpal/docx-editor-core/utils/highlightColors";
24
+ import { collectHeadings as et } from "@eigenpal/docx-editor-core/utils/headingCollector";
25
+ import { acceptChange as tt, acceptChangeById as nt, insertImageNode as rt, rejectChange as it, rejectChangeById as at } from "@eigenpal/docx-editor-core/prosemirror/commands";
26
+ import { extractTrackedChanges as ot } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
27
+ import { TABLE_INSERT_HIDE_DELAY_MS as st, detectTableInsertHover as ct } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
28
+ import { openReportIssue as lt } from "@eigenpal/docx-editor-core/utils/reportIssue";
29
+ import { ContentControlNotFoundError as ut } from "@eigenpal/docx-editor-core/agent";
30
+ import { createDocumentWithText as dt, createEmptyDocument as ft } from "@eigenpal/docx-editor-core";
30
31
  //#region src/utils/paraTextHelpers.ts
31
- function it(e, t) {
32
+ function pt(e, t) {
32
33
  if (!t.trim()) return null;
33
34
  let n = null;
34
35
  return e.descendants((e, r) => n ? !1 : e.isTextblock && e.attrs?.paraId === t ? (n = {
@@ -36,11 +37,11 @@ function it(e, t) {
36
37
  to: r + e.nodeSize
37
38
  }, !1) : !0), n;
38
39
  }
39
- function at(e) {
40
+ function mt(e) {
40
41
  let t = [];
41
42
  return e.descendants((e) => !e.isText || !e.text ? !0 : e.marks.some((e) => e.type.name === "insertion") ? !1 : (t.push(e.text), !0)), t.join("");
42
43
  }
43
- function ot(e, t, n) {
44
+ function ht(e, t, n) {
44
45
  if (t >= n) return "";
45
46
  let r = [];
46
47
  return e.nodesBetween(t, n, (e, i) => {
@@ -49,7 +50,7 @@ function ot(e, t, n) {
49
50
  a < o && r.push(e.text.slice(a - i, o - i));
50
51
  }), r.join("");
51
52
  }
52
- function st(e, t, n, r) {
53
+ function gt(e, t, n, r) {
53
54
  if (!r) return null;
54
55
  let i = "", a = [];
55
56
  e.nodesBetween(t, n, (e, t) => {
@@ -76,7 +77,7 @@ function st(e, t, n, r) {
76
77
  }
77
78
  //#endregion
78
79
  //#region src/utils/refApiQueries.ts
79
- function ct(e, t, n) {
80
+ function _t(e, t, n) {
80
81
  if (!e || !t) return [];
81
82
  let r = n?.caseSensitive ?? !1, i = n?.limit ?? 20, a = r ? t : t.toLowerCase(), o = [];
82
83
  return e.state.doc.descendants((e) => {
@@ -84,7 +85,7 @@ function ct(e, t, n) {
84
85
  if (!e.isTextblock) return !0;
85
86
  let n = e.attrs?.paraId;
86
87
  if (!n) return !1;
87
- let s = at(e), c = r ? s : s.toLowerCase(), l = c.indexOf(a);
88
+ let s = mt(e), c = r ? s : s.toLowerCase(), l = c.indexOf(a);
88
89
  return l === -1 || c.indexOf(a, l + 1) !== -1 || o.push({
89
90
  paraId: n,
90
91
  match: s.slice(l, l + t.length),
@@ -93,13 +94,13 @@ function ct(e, t, n) {
93
94
  }), !1;
94
95
  }), o;
95
96
  }
96
- function lt(e) {
97
+ function vt(e) {
97
98
  if (!e) return null;
98
99
  let { selection: t, doc: n } = e.state, r = t.$from, i = r.depth;
99
100
  for (; i > 0 && !r.node(i).isTextblock;) i--;
100
101
  let a = i > 0 ? r.node(i) : null;
101
102
  if (!a) return null;
102
- let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l = ot(n, s, t.from), u = ot(n, t.from, t.to), d = ot(n, t.to, c);
103
+ let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l = ht(n, s, t.from), u = ht(n, t.from, t.to), d = ht(n, t.to, c);
103
104
  return {
104
105
  paraId: o,
105
106
  selectedText: u,
@@ -108,7 +109,7 @@ function lt(e) {
108
109
  after: d
109
110
  };
110
111
  }
111
- function ut(e, t, n) {
112
+ function yt(e, t, n) {
112
113
  if (!t || !e) return null;
113
114
  let r = t.pages[n - 1];
114
115
  if (!r) return null;
@@ -122,7 +123,7 @@ function ut(e, t, n) {
122
123
  let o = r.attrs?.paraId;
123
124
  !o || i.has(o) || (i.add(o), a.push({
124
125
  paraId: o,
125
- text: at(r),
126
+ text: mt(r),
126
127
  styleId: r.attrs?.styleId ?? void 0
127
128
  }));
128
129
  }
@@ -134,7 +135,7 @@ function ut(e, t, n) {
134
135
  }
135
136
  //#endregion
136
137
  //#region src/components/DecorationLayer.vue
137
- var dt = /* @__PURE__ */ j({
138
+ var bt = /* @__PURE__ */ j({
138
139
  __name: "DecorationLayer",
139
140
  props: {
140
141
  getView: { type: Function },
@@ -169,7 +170,7 @@ var dt = /* @__PURE__ */ j({
169
170
  n.firstChild && n.replaceChildren();
170
171
  return;
171
172
  }
172
- let a = S(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
173
+ let a = ee(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
173
174
  for (let { decoration: t, from: n, to: r } of i) {
174
175
  if (n === r) {
175
176
  let r = l(t, e);
@@ -226,13 +227,13 @@ var dt = /* @__PURE__ */ j({
226
227
  "aria-hidden": "true"
227
228
  }, null, 512));
228
229
  }
229
- }), ft = ["data-handle", "onMousedown"], pt = ["title"], mt = {
230
+ }), xt = ["data-handle", "onMousedown"], St = ["title"], Ct = {
230
231
  key: 0,
231
232
  class: "image-overlay__dim"
232
- }, ht = {
233
+ }, wt = {
233
234
  key: 1,
234
235
  class: "image-overlay__dim image-overlay__dim--rotate"
235
- }, gt = 4, _t = 15, vt = /* @__PURE__ */ x(/* @__PURE__ */ j({
236
+ }, Tt = 4, Et = 15, Dt = /* @__PURE__ */ x(/* @__PURE__ */ j({
236
237
  __name: "ImageSelectionOverlay",
237
238
  props: {
238
239
  imageInfo: {},
@@ -246,8 +247,8 @@ var dt = /* @__PURE__ */ j({
246
247
  "context-menu"
247
248
  ],
248
249
  setup(e, { emit: t }) {
249
- let { t: r } = n(), i = e, a = t, o = L(null), s = L(!1), c = L(!1), l = L(!1), u = L(0), d = L(0), f = L(0), p = L(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
250
- function te(e, t) {
250
+ let { t: r } = n(), i = e, a = t, o = L(null), s = L(!1), c = L(!1), l = L(!1), u = L(0), d = L(0), f = L(0), p = L(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, ee = null;
251
+ function ne(e, t) {
251
252
  if (!e) return null;
252
253
  try {
253
254
  let n = e.state.doc.nodeAt(t);
@@ -256,20 +257,20 @@ var dt = /* @__PURE__ */ j({
256
257
  return null;
257
258
  }
258
259
  }
259
- function ne() {
260
+ function re() {
260
261
  let e = i.imageInfo;
261
262
  if (!e) return null;
262
263
  if (e.element.isConnected) return e.element;
263
264
  let t = o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages");
264
265
  if (!t) return null;
265
266
  for (let n of t.querySelectorAll(`[data-pm-start="${e.pmPos}"]`)) {
266
- let e = ke(n);
267
+ let e = Ae(n);
267
268
  if (e) return e;
268
269
  }
269
270
  return null;
270
271
  }
271
- function C() {
272
- let e = ne();
272
+ function S() {
273
+ let e = re();
273
274
  if (!e || !o.value) {
274
275
  p.value = null;
275
276
  return;
@@ -288,17 +289,17 @@ var dt = /* @__PURE__ */ j({
288
289
  };
289
290
  }
290
291
  H(() => i.imageInfo, async () => {
291
- await ce(), C();
292
+ await ce(), S();
292
293
  }, { immediate: !0 }), H(() => i.imageInfo, (e, t, n) => {
293
294
  if (!i.imageInfo) return;
294
295
  let r = () => {
295
- b && cancelAnimationFrame(b), b = requestAnimationFrame(C);
296
+ b && cancelAnimationFrame(b), b = requestAnimationFrame(S);
296
297
  }, a = o.value?.closest(".docx-editor-vue__pages-viewport")?.parentElement;
297
298
  a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
298
299
  a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
299
300
  });
300
301
  }, { immediate: !0 });
301
- let T = E(() => s.value ? u.value : p.value?.width || 0), re = E(() => s.value ? d.value : p.value?.height || 0), ie = E(() => {
302
+ let w = T(() => s.value ? u.value : p.value?.width || 0), ie = T(() => s.value ? d.value : p.value?.height || 0), E = T(() => {
302
303
  let e = p.value;
303
304
  if (!e) return {
304
305
  position: "absolute",
@@ -314,11 +315,11 @@ var dt = /* @__PURE__ */ j({
314
315
  top: `${e.top}px`,
315
316
  width: `${t}px`,
316
317
  height: `${n}px`,
317
- zIndex: ee.imageOverlay,
318
+ zIndex: te.imageOverlay,
318
319
  pointerEvents: "auto"
319
320
  };
320
- }), ae = E(() => {
321
- let e = T.value, t = re.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
321
+ }), ae = T(() => {
322
+ let e = w.value, t = ie.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
322
323
  return [
323
324
  {
324
325
  pos: "nw",
@@ -415,10 +416,10 @@ var dt = /* @__PURE__ */ j({
415
416
  document.removeEventListener("mousemove", se), document.removeEventListener("mouseup", M), s.value = !1, y = null, a("interact-end");
416
417
  let e = i.view, t = i.imageInfo;
417
418
  if (!e || !t) {
418
- C();
419
+ S();
419
420
  return;
420
421
  }
421
- let n = te(e, t.pmPos);
422
+ let n = ne(e, t.pmPos);
422
423
  if (n) try {
423
424
  e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
424
425
  ...n.attrs,
@@ -426,7 +427,7 @@ var dt = /* @__PURE__ */ j({
426
427
  height: d.value
427
428
  }));
428
429
  } catch {}
429
- ce(() => C());
430
+ ce(() => S());
430
431
  }
431
432
  let F = 0, le = 0, ue = 0, de = 0, V = null, U = null;
432
433
  function W(e) {
@@ -438,25 +439,25 @@ var dt = /* @__PURE__ */ j({
438
439
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
439
440
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
440
441
  }
441
- function fe(e, t) {
442
+ function pe(e, t) {
442
443
  return Math.atan2(e - F, -(t - le)) * 180 / Math.PI;
443
444
  }
444
- function pe(e) {
445
+ function me(e) {
445
446
  if (!i.imageInfo) return;
446
447
  let t = i.imageInfo.element.getBoundingClientRect();
447
448
  F = t.left + t.width / 2, le = t.top + t.height / 2;
448
- let n = te(i.view, i.imageInfo.pmPos);
449
- V = n && n.attrs.transform || null, de = W(V), U = i.imageInfo.element.querySelector("img"), ue = fe(e.clientX, e.clientY), f.value = de, l.value = !0, a("interact-start"), document.addEventListener("mousemove", me), document.addEventListener("mouseup", he);
449
+ let n = ne(i.view, i.imageInfo.pmPos);
450
+ V = n && n.attrs.transform || null, de = W(V), U = i.imageInfo.element.querySelector("img"), ue = pe(e.clientX, e.clientY), f.value = de, l.value = !0, a("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
450
451
  }
451
- function me(e) {
452
- let t = fe(e.clientX, e.clientY) - ue, n = de + t;
453
- e.shiftKey || (n = Math.round(n / _t) * _t), f.value = (n % 360 + 360) % 360, U && (U.style.transform = G(V, f.value) || "");
452
+ function he(e) {
453
+ let t = pe(e.clientX, e.clientY) - ue, n = de + t;
454
+ e.shiftKey || (n = Math.round(n / Et) * Et), f.value = (n % 360 + 360) % 360, U && (U.style.transform = G(V, f.value) || "");
454
455
  }
455
- function he() {
456
- document.removeEventListener("mousemove", me), document.removeEventListener("mouseup", he), l.value = !1, a("interact-end");
456
+ function ge() {
457
+ document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), l.value = !1, a("interact-end");
457
458
  let e = i.view, t = i.imageInfo;
458
459
  try {
459
- let n = e && t ? te(e, t.pmPos) : null;
460
+ let n = e && t ? ne(e, t.pmPos) : null;
460
461
  e && t && n && e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
461
462
  ...n.attrs,
462
463
  transform: G(n.attrs.transform, f.value)
@@ -464,33 +465,33 @@ var dt = /* @__PURE__ */ j({
464
465
  } catch {} finally {
465
466
  U && (U.style.transform = ""), U = null, V = null;
466
467
  }
467
- ce(() => C());
468
+ ce(() => S());
468
469
  }
469
- let J = null;
470
- function Y(e) {
470
+ let q = null;
471
+ function J(e) {
471
472
  if (!i.imageInfo || !p.value) return;
472
473
  let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
473
474
  let s = e.clientX - t, l = e.clientY - n;
474
- if (!(!o && Math.sqrt(s * s + l * l) < gt)) {
475
+ if (!(!o && Math.sqrt(s * s + l * l) < Tt)) {
475
476
  if (!o) {
476
- 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);";
477
+ o = !0, c.value = !0, a("interact-start"), q = document.createElement("div"), q.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
477
478
  let e = i.zoom;
478
- J.style.width = `${r.width * e}px`, J.style.height = `${r.height * e}px`, document.body.appendChild(J);
479
+ q.style.width = `${r.width * e}px`, q.style.height = `${r.height * e}px`, document.body.appendChild(q);
479
480
  }
480
- if (J) {
481
+ if (q) {
481
482
  let t = i.zoom;
482
- J.style.left = `${e.clientX - r.width * t / 2}px`, J.style.top = `${e.clientY - r.height * t / 2}px`;
483
+ q.style.left = `${e.clientX - r.width * t / 2}px`, q.style.top = `${e.clientY - r.height * t / 2}px`;
483
484
  }
484
485
  }
485
486
  }, l = (e) => {
486
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, J &&= (J.remove(), null), c.value = !1, o && (a("interact-end"), ge(e.clientX, e.clientY));
487
+ document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, ee = null, q &&= (q.remove(), null), c.value = !1, o && (a("interact-end"), _e(e.clientX, e.clientY));
487
488
  };
488
- x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
489
+ x = s, ee = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
489
490
  }
490
- function ge(e, t) {
491
+ function _e(e, t) {
491
492
  let n = i.view, r = i.imageInfo;
492
493
  if (!n || !r) return;
493
- let a = te(n, r.pmPos);
494
+ let a = ne(n, r.pmPos);
494
495
  if (!a) return;
495
496
  let s = a.attrs.wrapType, c = a.attrs.displayMode === "float" || (s ? [
496
497
  "square",
@@ -512,80 +513,80 @@ var dt = /* @__PURE__ */ j({
512
513
  if (c ||= s[s.length - 1].querySelector(".layout-page-content"), !c) return;
513
514
  let l = c.getBoundingClientRect(), u = i.zoom, d = (e - l.left) / u, f = (t - l.top) / u, p = {
514
515
  horizontal: {
515
- posOffset: be(d),
516
+ posOffset: xe(d),
516
517
  relativeTo: "margin"
517
518
  },
518
519
  vertical: {
519
- posOffset: be(f),
520
+ posOffset: xe(f),
520
521
  relativeTo: "margin"
521
522
  }
522
523
  }, m = n.state.tr.setNodeMarkup(r.pmPos, void 0, {
523
524
  ...a.attrs,
524
525
  position: p
525
526
  });
526
- n.dispatch(m), _e(r.pmPos);
527
+ n.dispatch(m), ve(r.pmPos);
527
528
  } else {
528
529
  let i = o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages");
529
530
  if (!i) return;
530
- let s = we(i, e, t, 1);
531
+ let s = Te(i, e, t, 1);
531
532
  if (s == null || s < 0 || s === r.pmPos || s === r.pmPos + 1) return;
532
533
  let c = n.state.tr, l = a.nodeSize;
533
- if (s <= r.pmPos) c = c.delete(r.pmPos, r.pmPos + l), c = c.insert(s, a), n.dispatch(c), _e(s);
534
+ if (s <= r.pmPos) c = c.delete(r.pmPos, r.pmPos + l), c = c.insert(s, a), n.dispatch(c), ve(s);
534
535
  else {
535
536
  c = c.delete(r.pmPos, r.pmPos + l);
536
537
  let e = Math.min(s - l, c.doc.content.size);
537
- c = c.insert(e, a), n.dispatch(c), _e(Math.min(e, n.state.doc.content.size - 1));
538
+ c = c.insert(e, a), n.dispatch(c), ve(Math.min(e, n.state.doc.content.size - 1));
538
539
  }
539
540
  }
540
541
  } catch {}
541
- ce(() => C());
542
+ ce(() => S());
542
543
  }
543
- function _e(e) {
544
+ function ve(e) {
544
545
  let t = i.view;
545
546
  if (t) try {
546
- let n = q.create(t.state.doc, e);
547
+ let n = fe.create(t.state.doc, e);
547
548
  t.dispatch(t.state.tr.setSelection(n));
548
549
  } catch {}
549
550
  }
550
551
  return P(() => {
551
- document.removeEventListener("mousemove", se), document.removeEventListener("mouseup", M), document.removeEventListener("mousemove", me), document.removeEventListener("mouseup", he), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), J &&= (J.remove(), null), b && cancelAnimationFrame(b);
552
+ document.removeEventListener("mousemove", se), document.removeEventListener("mouseup", M), document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), q &&= (q.remove(), null), b && cancelAnimationFrame(b);
552
553
  }), (t, n) => e.imageInfo ? (I(), O("div", {
553
554
  key: 0,
554
555
  ref_key: "overlayRootRef",
555
556
  ref: o,
556
557
  class: "image-overlay",
557
- style: N(ie.value),
558
+ style: N(E.value),
558
559
  onMousedown: n[3] ||= K(() => {}, ["stop"])
559
560
  }, [
560
561
  n[4] ||= k("div", { class: "image-overlay__border" }, null, -1),
561
562
  k("div", {
562
563
  class: "image-overlay__body",
563
564
  style: N({ cursor: c.value ? "grabbing" : "grab" }),
564
- onMousedown: n[0] ||= K((e) => Y(e), ["prevent", "stop"]),
565
+ onMousedown: n[0] ||= K((e) => J(e), ["prevent", "stop"]),
565
566
  onContextmenu: n[1] ||= K((e) => t.$emit("context-menu", e), ["prevent", "stop"])
566
567
  }, null, 36),
567
- (I(!0), O(w, null, R(ae.value, (e) => (I(), O("div", {
568
+ (I(!0), O(C, null, R(ae.value, (e) => (I(), O("div", {
568
569
  key: e.pos,
569
570
  class: "image-overlay__handle",
570
571
  style: N(e.style),
571
572
  "data-handle": e.pos,
572
573
  onMousedown: K((t) => j(t, e.pos), ["prevent", "stop"])
573
- }, null, 44, ft))), 128)),
574
+ }, null, 44, xt))), 128)),
574
575
  n[5] ||= k("div", { class: "image-overlay__rotate-line" }, null, -1),
575
576
  k("div", {
576
577
  class: "image-overlay__rotate-handle",
577
- style: N({ left: `${T.value / 2 - 7}px` }),
578
+ style: N({ left: `${w.value / 2 - 7}px` }),
578
579
  title: B(r)("imageOverlay.rotate"),
579
- onMousedown: n[2] ||= K((e) => pe(e), ["prevent", "stop"])
580
- }, null, 44, pt),
581
- s.value ? (I(), O("div", mt, z(Math.round(u.value)) + " × " + z(Math.round(d.value)), 1)) : D("", !0),
582
- l.value ? (I(), O("div", ht, z(Math.round(f.value)) + "° ", 1)) : D("", !0)
580
+ onMousedown: n[2] ||= K((e) => me(e), ["prevent", "stop"])
581
+ }, null, 44, St),
582
+ s.value ? (I(), O("div", Ct, z(Math.round(u.value)) + " × " + z(Math.round(d.value)), 1)) : D("", !0),
583
+ l.value ? (I(), O("div", wt, z(Math.round(f.value)) + "° ", 1)) : D("", !0)
583
584
  ], 36)) : D("", !0);
584
585
  }
585
- }), [["__scopeId", "data-v-a6f20ec2"]]), yt = { class: "doc-outline__header" }, bt = { class: "doc-outline__body" }, xt = {
586
+ }), [["__scopeId", "data-v-a6f20ec2"]]), Ot = { class: "doc-outline__header" }, kt = { class: "doc-outline__body" }, At = {
586
587
  key: 0,
587
588
  class: "doc-outline__empty"
588
- }, St = ["onMousedown"], Ct = /* @__PURE__ */ x(/* @__PURE__ */ j({
589
+ }, jt = ["onMousedown"], Mt = /* @__PURE__ */ x(/* @__PURE__ */ j({
589
590
  __name: "DocumentOutline",
590
591
  props: {
591
592
  isOpen: { type: Boolean },
@@ -599,7 +600,7 @@ var dt = /* @__PURE__ */ j({
599
600
  role: "navigation",
600
601
  "aria-label": "Document outline",
601
602
  onMousedown: n[1] ||= K(() => {}, ["stop"])
602
- }, [k("div", yt, [k("button", {
603
+ }, [k("div", Ot, [k("button", {
603
604
  class: "doc-outline__back",
604
605
  title: "Close outline",
605
606
  "aria-label": "Close outline",
@@ -607,14 +608,14 @@ var dt = /* @__PURE__ */ j({
607
608
  }, [A(c, {
608
609
  name: "arrow_back",
609
610
  size: 20
610
- })]), n[2] ||= k("span", { class: "doc-outline__title" }, "Document Outline", -1)]), k("div", bt, [e.headings.length === 0 ? (I(), O("div", xt, " No headings found ")) : D("", !0), (I(!0), O(w, null, R(e.headings, (e, n) => (I(), O("button", {
611
+ })]), n[2] ||= k("span", { class: "doc-outline__title" }, "Document Outline", -1)]), k("div", kt, [e.headings.length === 0 ? (I(), O("div", At, " No headings found ")) : D("", !0), (I(!0), O(C, null, R(e.headings, (e, n) => (I(), O("button", {
611
612
  key: n,
612
613
  class: "doc-outline__item",
613
614
  style: N({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
614
615
  onMousedown: K((n) => t.$emit("navigate", e.pmPos), ["prevent"])
615
- }, z(e.text || "(untitled)"), 45, St))), 128))])], 32)) : D("", !0);
616
+ }, z(e.text || "(untitled)"), 45, jt))), 128))])], 32)) : D("", !0);
616
617
  }
617
- }), [["__scopeId", "data-v-cb2cdc39"]]), wt = /* @__PURE__ */ x(/* @__PURE__ */ j({
618
+ }), [["__scopeId", "data-v-cb2cdc39"]]), Nt = /* @__PURE__ */ x(/* @__PURE__ */ j({
618
619
  __name: "PageIndicator",
619
620
  props: {
620
621
  currentPage: {},
@@ -633,10 +634,10 @@ var dt = /* @__PURE__ */ j({
633
634
  total: e.totalPages
634
635
  })), 5));
635
636
  }
636
- }), [["__scopeId", "data-v-d117bf6e"]]), Tt = { class: "hf-editor__label" }, Et = {
637
+ }), [["__scopeId", "data-v-d117bf6e"]]), Pt = { class: "hf-editor__label" }, Ft = {
637
638
  class: "hf-editor__actions",
638
639
  style: { position: "relative" }
639
- }, Dt = /* @__PURE__ */ x(/* @__PURE__ */ j({
640
+ }, It = /* @__PURE__ */ x(/* @__PURE__ */ j({
640
641
  __name: "InlineHeaderFooterEditor",
641
642
  props: {
642
643
  isOpen: { type: Boolean },
@@ -654,7 +655,7 @@ var dt = /* @__PURE__ */ j({
654
655
  function o(e) {
655
656
  let t = n.view;
656
657
  if (!t) return;
657
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Pe.nodes.field.create({
658
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = ze.nodes.field.create({
658
659
  fieldType: e,
659
660
  instruction: ` ${e} \\* MERGEFORMAT `,
660
661
  fieldKind: "simple",
@@ -680,7 +681,7 @@ var dt = /* @__PURE__ */ j({
680
681
  n.isOpen && s();
681
682
  }, { deep: !0 });
682
683
  function c() {
683
- n.view && (r("save", Me(n.view.state.doc)), r("close"));
684
+ n.view && (r("save", Pe(n.view.state.doc)), r("close"));
684
685
  }
685
686
  return (t, n) => e.isOpen ? (I(), O("div", {
686
687
  key: 0,
@@ -690,7 +691,7 @@ var dt = /* @__PURE__ */ j({
690
691
  class: M(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
691
692
  onMousedown: n[8] ||= K(() => {}, ["stop"]),
692
693
  onContextmenu: n[9] ||= K(() => {}, ["stop"])
693
- }, [k("span", Tt, z(e.position === "header" ? "Header" : "Footer"), 1), k("div", Et, [
694
+ }, [k("span", Pt, z(e.position === "header" ? "Header" : "Footer"), 1), k("div", Ft, [
694
695
  k("button", {
695
696
  class: "hf-editor__btn",
696
697
  title: "Options",
@@ -732,10 +733,144 @@ var dt = /* @__PURE__ */ j({
732
733
  }, " Cancel ", 32)
733
734
  ])], 34)], 4)) : D("", !0);
734
735
  }
735
- }), [["__scopeId", "data-v-e93a9f94"]]), Ot = {
736
+ }), [["__scopeId", "data-v-e93a9f94"]]), Lt = ["role"], Rt = {
737
+ key: 0,
738
+ class: "layout-sdt-widget-empty"
739
+ }, zt = ["aria-selected", "onClick"], Bt = ["value"], Vt = /* @__PURE__ */ j({
740
+ __name: "ContentControlWidgets",
741
+ props: {
742
+ container: {},
743
+ view: {}
744
+ },
745
+ setup(e) {
746
+ function t(e) {
747
+ let t = /^sdt@(\d+)$/.exec(e ?? "");
748
+ return t ? Number(t[1]) : null;
749
+ }
750
+ let n = e, r = L(null), i = L(null);
751
+ function a(e, t) {
752
+ let i = n.view;
753
+ if (i) try {
754
+ i.dispatch(Ve(i.state, { tag: e }, t)), i.focus();
755
+ } catch {}
756
+ r.value = null;
757
+ }
758
+ function o(e) {
759
+ let r = n.view, i = t(e.dataset.sdtGroupId);
760
+ if (!(!r || i == null)) try {
761
+ let t = e.dataset.sdtRepeat === "add" ? Ie(r.state, i) : Re(r.state, i);
762
+ r.dispatch(t), r.focus();
763
+ } catch {}
764
+ }
765
+ function s(e) {
766
+ let t = e.target;
767
+ (t?.closest?.(".layout-sdt-widget") || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
768
+ }
769
+ function c(e) {
770
+ let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
771
+ if (!t || !i || !o) return;
772
+ let s = Z(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
773
+ o === "checkbox" ? a(i, {
774
+ kind: "checkbox",
775
+ checked: !s?.checked
776
+ }) : o === "dropdown" ? r.value = {
777
+ kind: "dropdown",
778
+ tag: i,
779
+ items: s?.listItems ?? [],
780
+ current: s?.text ?? "",
781
+ x: c.left,
782
+ y: c.bottom + 2
783
+ } : o === "date" && (r.value = {
784
+ kind: "date",
785
+ tag: i,
786
+ current: s?.dateValue ?? "",
787
+ x: c.left,
788
+ y: c.bottom + 2
789
+ });
790
+ }
791
+ function l(e) {
792
+ let t = e.target?.closest?.(".layout-sdt-repeat-btn");
793
+ if (t) {
794
+ e.preventDefault(), e.stopPropagation(), o(t);
795
+ return;
796
+ }
797
+ let n = e.target?.closest?.(".layout-sdt-widget");
798
+ n && (e.preventDefault(), e.stopPropagation(), c(n));
799
+ }
800
+ function u(e) {
801
+ if (e.key !== "Enter" && e.key !== " ") return;
802
+ let t = e.target?.closest?.(".layout-sdt-widget");
803
+ t && (e.preventDefault(), c(t));
804
+ }
805
+ function d(e) {
806
+ r.value && !i.value?.contains(e.target) && (r.value = null);
807
+ }
808
+ function f(e) {
809
+ e.key === "Escape" && (r.value = null);
810
+ }
811
+ let p = null;
812
+ H(() => n.container, (e) => {
813
+ p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), p = e ?? null, p && (p.addEventListener("mousedown", s), p.addEventListener("click", l), p.addEventListener("keydown", u));
814
+ }, { immediate: !0 }), H(r, (e) => {
815
+ e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ce(() => {
816
+ let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
817
+ e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
818
+ })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
819
+ });
820
+ function m(e) {
821
+ if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
822
+ let t = [...i.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
823
+ if (!t.length) return;
824
+ e.preventDefault();
825
+ let n = t.indexOf(document.activeElement);
826
+ t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
827
+ }
828
+ P(() => {
829
+ p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
830
+ });
831
+ function h(e) {
832
+ let t = e.target.value;
833
+ t && r.value && a(r.value.tag, {
834
+ kind: "date",
835
+ date: t
836
+ });
837
+ }
838
+ return (e, t) => r.value ? (I(), O("div", {
839
+ key: 0,
840
+ ref_key: "popupEl",
841
+ ref: i,
842
+ class: "layout-sdt-widget-popup",
843
+ role: r.value.kind === "dropdown" ? "listbox" : void 0,
844
+ style: N({
845
+ position: "fixed",
846
+ top: r.value.y + "px",
847
+ left: r.value.x + "px",
848
+ zIndex: 1e3
849
+ }),
850
+ onKeydown: m,
851
+ onMousedown: t[0] ||= K(() => {}, ["prevent"])
852
+ }, [r.value.kind === "dropdown" ? (I(), O(C, { key: 0 }, [r.value.items.length === 0 ? (I(), O("div", Rt, "No options")) : D("", !0), (I(!0), O(C, null, R(r.value.items, (e) => (I(), O("button", {
853
+ key: e.value,
854
+ type: "button",
855
+ role: "option",
856
+ "aria-selected": e.displayText === r.value.current,
857
+ class: M(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
858
+ onClick: (t) => a(r.value.tag, {
859
+ kind: "dropdown",
860
+ value: e.value
861
+ })
862
+ }, z(e.displayText), 11, zt))), 128))], 64)) : (I(), O("input", {
863
+ key: 1,
864
+ type: "date",
865
+ class: "layout-sdt-widget-date",
866
+ value: r.value.current,
867
+ onChange: h
868
+ }, null, 40, Bt))], 44, Lt)) : D("", !0);
869
+ }
870
+ }), Ht = {
736
871
  key: 0,
737
872
  class: "docx-editor-vue__title-bar"
738
- }, kt = { class: "docx-editor-vue__title-bar-left" }, At = { class: "docx-editor-vue__title-bar-center" }, jt = { class: "docx-editor-vue__title-bar-right" }, Mt = /* @__PURE__ */ j({
873
+ }, Ut = { class: "docx-editor-vue__title-bar-left" }, Wt = { class: "docx-editor-vue__title-bar-center" }, Gt = { class: "docx-editor-vue__title-bar-right" }, Kt = /* @__PURE__ */ j({
739
874
  __name: "DocxEditorMenuBar",
740
875
  props: {
741
876
  showMenuBar: { type: Boolean },
@@ -754,9 +889,9 @@ var dt = /* @__PURE__ */ j({
754
889
  ],
755
890
  setup(e, { emit: t }) {
756
891
  let n = t;
757
- return (t, r) => e.showMenuBar ? (I(), O("div", Ot, [
758
- k("div", kt, [e.renderLogo ? (I(), ie(ue(e.renderLogo), { key: 0 })) : D("", !0), le(t.$slots, "title-bar-left")]),
759
- k("div", At, [A(g, {
892
+ return (t, r) => e.showMenuBar ? (I(), O("div", Ht, [
893
+ k("div", Ut, [e.renderLogo ? (I(), E(ue(e.renderLogo), { key: 0 })) : D("", !0), le(t.$slots, "title-bar-left")]),
894
+ k("div", Wt, [A(g, {
760
895
  "model-value": e.documentName,
761
896
  editable: e.documentNameEditable,
762
897
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
@@ -764,10 +899,10 @@ var dt = /* @__PURE__ */ j({
764
899
  onAction: r[1] ||= (e) => n("menu-action", e),
765
900
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
766
901
  })]),
767
- k("div", jt, [le(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (I(), ie(ue(e.renderTitleBarRight), { key: 0 })) : D("", !0)])
902
+ k("div", Gt, [le(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (I(), E(ue(e.renderTitleBarRight), { key: 0 })) : D("", !0)])
768
903
  ])) : D("", !0);
769
904
  }
770
- }), Nt = /* @__PURE__ */ j({
905
+ }), qt = /* @__PURE__ */ j({
771
906
  __name: "DocxEditorDialogs",
772
907
  props: {
773
908
  view: {},
@@ -799,7 +934,7 @@ var dt = /* @__PURE__ */ j({
799
934
  ],
800
935
  setup(t, { emit: n }) {
801
936
  let r = n;
802
- return (n, a) => (I(), O(w, null, [
937
+ return (n, a) => (I(), O(C, null, [
803
938
  A(u, {
804
939
  "is-open": t.showFindReplace,
805
940
  view: t.view,
@@ -854,10 +989,10 @@ var dt = /* @__PURE__ */ j({
854
989
  }, null, 8, ["is-open"])
855
990
  ], 64));
856
991
  }
857
- }), Pt = ["disabled", "onMousedown"], Ft = { class: "ctx-menu__label" }, It = {
992
+ }), Jt = ["disabled", "onMousedown"], Yt = { class: "ctx-menu__label" }, Xt = {
858
993
  key: 0,
859
994
  class: "ctx-menu__shortcut"
860
- }, Lt = 220, Rt = 32, zt = 10, Bt = /* @__PURE__ */ x(/* @__PURE__ */ j({
995
+ }, Zt = 220, Qt = 32, $t = 10, en = /* @__PURE__ */ x(/* @__PURE__ */ j({
861
996
  __name: "TextContextMenu",
862
997
  props: {
863
998
  isOpen: { type: Boolean },
@@ -871,7 +1006,7 @@ var dt = /* @__PURE__ */ j({
871
1006
  },
872
1007
  emits: ["close", "action"],
873
1008
  setup(e, { emit: t }) {
874
- let n = e, r = t, i = L(null), a = E(() => {
1009
+ let n = e, r = t, i = L(null), a = T(() => {
875
1010
  let e = [
876
1011
  {
877
1012
  id: "cut",
@@ -989,9 +1124,9 @@ var dt = /* @__PURE__ */ j({
989
1124
  action: "splitCell",
990
1125
  disabled: !n.canSplitCell
991
1126
  }), e;
992
- }), o = E(() => {
993
- 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 * Rt + i * 9;
994
- return typeof window < "u" && (e + Lt + zt > window.innerWidth && (e = window.innerWidth - Lt - zt), t + o + zt > window.innerHeight && (t = window.innerHeight - o - zt)), {
1127
+ }), o = T(() => {
1128
+ let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r * Qt + i * 9;
1129
+ return typeof window < "u" && (e + Zt + $t > window.innerWidth && (e = window.innerWidth - Zt - $t), t + o + $t > window.innerHeight && (t = window.innerHeight - o - $t)), {
995
1130
  position: "fixed",
996
1131
  left: `${e}px`,
997
1132
  top: `${t}px`,
@@ -1006,7 +1141,7 @@ var dt = /* @__PURE__ */ j({
1006
1141
  }
1007
1142
  return H(() => n.isOpen, (e) => {
1008
1143
  e && ce(() => i.value?.focus());
1009
- }), (t, n) => (I(), ie(T, { to: "body" }, [e.isOpen ? (I(), O("div", {
1144
+ }), (t, n) => (I(), E(w, { to: "body" }, [e.isOpen ? (I(), O("div", {
1010
1145
  key: 0,
1011
1146
  class: "ctx-menu-backdrop",
1012
1147
  onMousedown: n[0] ||= (e) => t.$emit("close"),
@@ -1019,7 +1154,7 @@ var dt = /* @__PURE__ */ j({
1019
1154
  style: N(o.value),
1020
1155
  onContextmenu: n[2] ||= K(() => {}, ["prevent"]),
1021
1156
  onKeydown: c
1022
- }, [(I(!0), O(w, null, R(a.value, (e, t) => (I(), O("button", {
1157
+ }, [(I(!0), O(C, null, R(a.value, (e, t) => (I(), O("button", {
1023
1158
  key: e.id || t,
1024
1159
  class: M(["ctx-menu__item", {
1025
1160
  "ctx-menu__item--disabled": e.disabled,
@@ -1027,27 +1162,27 @@ var dt = /* @__PURE__ */ j({
1027
1162
  }]),
1028
1163
  disabled: e.disabled,
1029
1164
  onMousedown: K((t) => s(e.action), ["prevent"])
1030
- }, [k("span", Ft, z(e.label), 1), e.shortcut ? (I(), O("span", It, z(e.shortcut), 1)) : D("", !0)], 42, Pt))), 128))], 36)) : D("", !0)]));
1165
+ }, [k("span", Yt, z(e.label), 1), e.shortcut ? (I(), O("span", Xt, z(e.shortcut), 1)) : D("", !0)], 42, Jt))), 128))], 36)) : D("", !0)]));
1031
1166
  }
1032
- }), [["__scopeId", "data-v-741c4f71"]]), Vt = ["aria-label"], Ht = { class: "image-ctx-menu__icon" }, Ut = { class: "image-ctx-menu__label" }, Wt = {
1167
+ }), [["__scopeId", "data-v-741c4f71"]]), tn = ["aria-label"], nn = { class: "image-ctx-menu__icon" }, rn = { class: "image-ctx-menu__label" }, an = {
1033
1168
  key: 1,
1034
1169
  class: "image-ctx-menu__divider",
1035
1170
  role: "separator"
1036
- }, Gt = [
1171
+ }, on = [
1037
1172
  "data-wrap-type",
1038
1173
  "data-current",
1039
1174
  "data-disabled",
1040
1175
  "disabled",
1041
1176
  "title",
1042
1177
  "onClick"
1043
- ], Kt = { class: "image-ctx-menu__icon" }, qt = { class: "image-ctx-menu__label" }, Jt = ["aria-label"], Yt = ["disabled", "onClick"], Xt = { class: "image-ctx-menu__label" }, Zt = {
1178
+ ], sn = { class: "image-ctx-menu__icon" }, cn = { class: "image-ctx-menu__label" }, ln = ["aria-label"], un = ["disabled", "onClick"], dn = { class: "image-ctx-menu__label" }, fn = {
1044
1179
  key: 0,
1045
1180
  class: "image-ctx-menu__shortcut"
1046
- }, Qt = {
1181
+ }, pn = {
1047
1182
  key: 0,
1048
1183
  class: "image-ctx-menu__divider",
1049
1184
  role: "separator"
1050
- }, $t = 18, en = 260, tn = 10, nn = /* @__PURE__ */ x(/* @__PURE__ */ j({
1185
+ }, mn = 18, Q = 260, $ = 10, hn = /* @__PURE__ */ x(/* @__PURE__ */ j({
1051
1186
  __name: "ImageContextMenu",
1052
1187
  props: {
1053
1188
  state: {},
@@ -1068,7 +1203,7 @@ var dt = /* @__PURE__ */ j({
1068
1203
  function a() {
1069
1204
  i("open-properties"), i("close");
1070
1205
  }
1071
- let { t: o } = n(), s = L(null), l = X, u = E(() => r.state ? Oe(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1206
+ let { t: o } = n(), s = L(null), l = Y, u = T(() => r.state ? ke(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1072
1207
  inline: "wrap_text",
1073
1208
  squareLeft: "format_image_left",
1074
1209
  squareRight: "format_image_right",
@@ -1078,19 +1213,19 @@ var dt = /* @__PURE__ */ j({
1078
1213
  function f(e) {
1079
1214
  return d[e];
1080
1215
  }
1081
- let p = E(() => {
1216
+ let p = T(() => {
1082
1217
  if (!r.state) return {};
1083
- let e = X.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1084
- return typeof window < "u" && (t + en > window.innerWidth && (t = window.innerWidth - en - tn), n + e > window.innerHeight && (n = window.innerHeight - e - tn), t < tn && (t = tn), n < tn && (n = tn)), {
1218
+ let e = Y.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1219
+ return typeof window < "u" && (t + Q > window.innerWidth && (t = window.innerWidth - Q - $), n + e > window.innerHeight && (n = window.innerHeight - e - $), t < $ && (t = $), n < $ && (n = $)), {
1085
1220
  position: "fixed",
1086
1221
  left: `${t}px`,
1087
1222
  top: `${n}px`,
1088
- minWidth: `${en}px`,
1223
+ minWidth: `${Q}px`,
1089
1224
  zIndex: 400
1090
1225
  };
1091
1226
  });
1092
1227
  function m(e) {
1093
- return r.state ? Ae(e, r.state.currentWrapType) : !1;
1228
+ return r.state ? je(e, r.state.currentWrapType) : !1;
1094
1229
  }
1095
1230
  function h(e) {
1096
1231
  m(e) && (i("select", e.choice), i("close"));
@@ -1104,7 +1239,7 @@ var dt = /* @__PURE__ */ j({
1104
1239
  function v(e) {
1105
1240
  e.key === "Escape" && (e.preventDefault(), i("close"));
1106
1241
  }
1107
- return (t, n) => (I(), ie(T, { to: "body" }, [e.state && e.state.open ? (I(), O("div", {
1242
+ return (t, n) => (I(), E(w, { to: "body" }, [e.state && e.state.open ? (I(), O("div", {
1108
1243
  key: 0,
1109
1244
  class: "image-ctx-menu-backdrop",
1110
1245
  onMousedown: _,
@@ -1129,12 +1264,12 @@ var dt = /* @__PURE__ */ j({
1129
1264
  "data-action": "open-properties",
1130
1265
  onMousedown: n[1] ||= K(() => {}, ["prevent"]),
1131
1266
  onClick: a
1132
- }, [k("span", Ht, [A(c, {
1267
+ }, [k("span", nn, [A(c, {
1133
1268
  name: "settings",
1134
- size: $t
1135
- })]), k("span", Ut, z(B(o)("imageWrap.menu.imageProperties")), 1)], 32)) : D("", !0),
1136
- e.canOpenProperties ? (I(), O("div", Wt)) : D("", !0),
1137
- (I(!0), O(w, null, R(B(l), (e) => (I(), O("button", {
1269
+ size: mn
1270
+ })]), k("span", rn, z(B(o)("imageWrap.menu.imageProperties")), 1)], 32)) : D("", !0),
1271
+ e.canOpenProperties ? (I(), O("div", an)) : D("", !0),
1272
+ (I(!0), O(C, null, R(B(l), (e) => (I(), O("button", {
1138
1273
  key: e.choice,
1139
1274
  type: "button",
1140
1275
  role: "menuitem",
@@ -1147,31 +1282,31 @@ var dt = /* @__PURE__ */ j({
1147
1282
  onMousedown: n[2] ||= K(() => {}, ["prevent"]),
1148
1283
  onClick: (t) => h(e)
1149
1284
  }, [
1150
- k("span", Kt, [A(c, {
1285
+ k("span", sn, [A(c, {
1151
1286
  name: f(e.iconHint),
1152
- size: $t
1287
+ size: mn
1153
1288
  }, null, 8, ["name"])]),
1154
- k("span", qt, z(B(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1289
+ k("span", cn, z(B(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1155
1290
  e.choice === u.value ? (I(), O("span", {
1156
1291
  key: 0,
1157
1292
  class: "image-ctx-menu__current-dot",
1158
1293
  "aria-label": B(o)("imageWrap.menu.ariaLabel")
1159
- }, "●", 8, Jt)) : D("", !0)
1160
- ], 42, Gt))), 128)),
1161
- e.textActions && e.textActions.length > 0 ? (I(), O(w, { key: 2 }, [n[5] ||= k("div", {
1294
+ }, "●", 8, ln)) : D("", !0)
1295
+ ], 42, on))), 128)),
1296
+ e.textActions && e.textActions.length > 0 ? (I(), O(C, { key: 2 }, [n[5] ||= k("div", {
1162
1297
  class: "image-ctx-menu__divider",
1163
1298
  role: "separator"
1164
- }, null, -1), (I(!0), O(w, null, R(e.textActions, (e, t) => (I(), O(w, { key: `${e.action}-${t}` }, [k("button", {
1299
+ }, null, -1), (I(!0), O(C, null, R(e.textActions, (e, t) => (I(), O(C, { key: `${e.action}-${t}` }, [k("button", {
1165
1300
  type: "button",
1166
1301
  role: "menuitem",
1167
1302
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1168
1303
  disabled: e.disabled,
1169
1304
  onMousedown: n[3] ||= K(() => {}, ["prevent"]),
1170
1305
  onClick: (t) => g(e)
1171
- }, [k("span", Xt, z(e.label), 1), e.shortcut ? (I(), O("span", Zt, z(e.shortcut), 1)) : D("", !0)], 40, Yt), e.dividerAfter ? (I(), O("div", Qt)) : D("", !0)], 64))), 128))], 64)) : D("", !0)
1172
- ], 44, Vt)) : D("", !0)]));
1306
+ }, [k("span", dn, z(e.label), 1), e.shortcut ? (I(), O("span", fn, z(e.shortcut), 1)) : D("", !0)], 40, un), e.dividerAfter ? (I(), O("div", pn)) : D("", !0)], 64))), 128))], 64)) : D("", !0)
1307
+ ], 44, tn)) : D("", !0)]));
1173
1308
  }
1174
- }), [["__scopeId", "data-v-5c21ca8c"]]), rn = /* @__PURE__ */ j({
1309
+ }), [["__scopeId", "data-v-5c21ca8c"]]), gn = /* @__PURE__ */ j({
1175
1310
  __name: "DocxEditorOverlays",
1176
1311
  props: {
1177
1312
  readOnly: { type: Boolean },
@@ -1189,7 +1324,7 @@ var dt = /* @__PURE__ */ j({
1189
1324
  ],
1190
1325
  setup(e, { emit: t }) {
1191
1326
  let n = t;
1192
- return (t, r) => (I(), O(w, null, [A(Bt, {
1327
+ return (t, r) => (I(), O(C, null, [A(en, {
1193
1328
  "is-open": e.contextMenu.isOpen,
1194
1329
  position: e.contextMenu.position,
1195
1330
  "has-selection": e.contextMenu.hasSelection,
@@ -1209,7 +1344,7 @@ var dt = /* @__PURE__ */ j({
1209
1344
  "on-image",
1210
1345
  "can-merge-cells",
1211
1346
  "can-split-cell"
1212
- ]), A(nn, {
1347
+ ]), A(hn, {
1213
1348
  state: e.imageContextMenu,
1214
1349
  "text-actions": e.imageContextMenuTextActions,
1215
1350
  "can-open-properties": e.canOpenImageProperties,
@@ -1223,7 +1358,7 @@ var dt = /* @__PURE__ */ j({
1223
1358
  "can-open-properties"
1224
1359
  ])], 64));
1225
1360
  }
1226
- }), an = ["href", "title"], on = ["title"], sn = ["title"], cn = ["title"], ln = { class: "docx-hyperlink-popup__edit-row" }, un = ["placeholder", "onKeydown"], dn = { class: "docx-hyperlink-popup__edit-row" }, fn = ["onKeydown"], pn = ["disabled"], mn = /* @__PURE__ */ x(/* @__PURE__ */ j({
1361
+ }), _n = ["href", "title"], vn = ["title"], yn = ["title"], bn = ["title"], xn = { class: "docx-hyperlink-popup__edit-row" }, Sn = ["placeholder", "onKeydown"], Cn = { class: "docx-hyperlink-popup__edit-row" }, wn = ["onKeydown"], Tn = ["disabled"], En = /* @__PURE__ */ x(/* @__PURE__ */ j({
1227
1362
  __name: "HyperlinkPopup",
1228
1363
  props: {
1229
1364
  data: {},
@@ -1237,7 +1372,7 @@ var dt = /* @__PURE__ */ j({
1237
1372
  "close"
1238
1373
  ],
1239
1374
  setup(e, { emit: t }) {
1240
- let { t: r } = n(), i = e, a = t, o = L(!1), s = L(""), c = L(""), l = L(null), u = E(() => ({
1375
+ let { t: r } = n(), i = e, a = t, o = L(!1), s = L(""), c = L(""), l = L(null), u = T(() => ({
1241
1376
  left: (i.data?.position.left ?? 0) + "px",
1242
1377
  top: (i.data?.position.top ?? 0) + "px"
1243
1378
  }));
@@ -1272,28 +1407,28 @@ var dt = /* @__PURE__ */ j({
1272
1407
  class: M(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1273
1408
  style: N(u.value),
1274
1409
  onMousedown: n[6] ||= K(() => {}, ["stop"])
1275
- }, [o.value ? (I(), O(w, { key: 1 }, [k("div", ln, [W(k("input", {
1410
+ }, [o.value ? (I(), O(C, { key: 1 }, [k("div", xn, [W(k("input", {
1276
1411
  class: "docx-hyperlink-popup__input",
1277
1412
  placeholder: B(r)("hyperlinkPopup.displayTextPlaceholder"),
1278
1413
  "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
1279
1414
  onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[3] ||= G((e) => t.$emit("close"), ["esc"])]
1280
- }, null, 40, un), [[V, s.value]])]), k("div", dn, [W(k("input", {
1415
+ }, null, 40, Sn), [[V, s.value]])]), k("div", Cn, [W(k("input", {
1281
1416
  class: "docx-hyperlink-popup__input",
1282
1417
  placeholder: "https://...",
1283
1418
  "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1284
1419
  onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[5] ||= G((e) => t.$emit("close"), ["esc"])]
1285
- }, null, 40, fn), [[V, c.value]]), k("button", {
1420
+ }, null, 40, wn), [[V, c.value]]), k("button", {
1286
1421
  class: "docx-hyperlink-popup__apply",
1287
1422
  disabled: !c.value.trim(),
1288
1423
  onClick: K(h, ["prevent"])
1289
- }, z(B(r)("common.apply")), 9, pn)])], 64)) : (I(), O(w, { key: 0 }, [
1424
+ }, z(B(r)("common.apply")), 9, Tn)])], 64)) : (I(), O(C, { key: 0 }, [
1290
1425
  n[10] ||= oe("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-9d23bb12></path></svg></span>", 1),
1291
1426
  k("a", {
1292
1427
  class: "docx-hyperlink-popup__url",
1293
1428
  href: e.data.href,
1294
1429
  title: e.data.href,
1295
1430
  onClick: n[0] ||= K((n) => t.$emit("navigate", e.data.href), ["prevent"])
1296
- }, z(e.data.href), 9, an),
1431
+ }, z(e.data.href), 9, _n),
1297
1432
  n[11] ||= k("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1298
1433
  k("button", {
1299
1434
  class: "docx-hyperlink-popup__btn",
@@ -1315,7 +1450,7 @@ var dt = /* @__PURE__ */ j({
1315
1450
  height: "13",
1316
1451
  rx: "2",
1317
1452
  ry: "2"
1318
- }), k("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, on),
1453
+ }), k("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, vn),
1319
1454
  e.readOnly ? D("", !0) : (I(), O("button", {
1320
1455
  key: 0,
1321
1456
  class: "docx-hyperlink-popup__btn",
@@ -1330,26 +1465,26 @@ var dt = /* @__PURE__ */ j({
1330
1465
  "stroke-width": "2",
1331
1466
  "stroke-linecap": "round",
1332
1467
  "stroke-linejoin": "round"
1333
- }, [k("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), k("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, sn)),
1468
+ }, [k("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), k("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, yn)),
1334
1469
  e.readOnly ? D("", !0) : (I(), O("button", {
1335
1470
  key: 1,
1336
1471
  class: "docx-hyperlink-popup__btn",
1337
1472
  title: B(r)("hyperlinkPopup.removeLink"),
1338
1473
  onClick: n[1] ||= K((e) => t.$emit("remove"), ["prevent"])
1339
- }, [...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, cn))
1474
+ }, [...n[9] ||= [oe("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, bn))
1340
1475
  ], 64))], 38)) : D("", !0);
1341
1476
  }
1342
1477
  }), [["__scopeId", "data-v-9d23bb12"]]);
1343
1478
  //#endregion
1344
1479
  //#region src/composables/useFileIO.ts
1345
- function hn(e) {
1480
+ function Dn(e) {
1346
1481
  let t = L(null);
1347
1482
  async function n() {
1348
1483
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1349
1484
  }
1350
1485
  async function r(t) {
1351
1486
  try {
1352
- let r = await xe(t);
1487
+ let r = await Se(t);
1353
1488
  if (!r) return;
1354
1489
  await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1355
1490
  } catch (t) {
@@ -1388,7 +1523,7 @@ function hn(e) {
1388
1523
  }
1389
1524
  //#endregion
1390
1525
  //#region src/composables/useHyperlinkManagement.ts
1391
- function gn(e) {
1526
+ function On(e) {
1392
1527
  let t = L(null);
1393
1528
  function n(t) {
1394
1529
  let n = e.editorView.value;
@@ -1417,7 +1552,7 @@ function gn(e) {
1417
1552
  function a(n, r) {
1418
1553
  let i = e.editorView.value;
1419
1554
  if (!i) return;
1420
- let a = Y(i.state);
1555
+ let a = J(i.state);
1421
1556
  if (!a) {
1422
1557
  t.value = null;
1423
1558
  return;
@@ -1431,7 +1566,7 @@ function gn(e) {
1431
1566
  function o() {
1432
1567
  let n = e.editorView.value;
1433
1568
  if (!n) return;
1434
- let r = Y(n.state, t.value?.href);
1569
+ let r = J(n.state, t.value?.href);
1435
1570
  if (!r) {
1436
1571
  t.value = null;
1437
1572
  return;
@@ -1450,27 +1585,27 @@ function gn(e) {
1450
1585
  }
1451
1586
  //#endregion
1452
1587
  //#region src/composables/useFormattingActions.ts
1453
- function _n(e) {
1588
+ function kn(e) {
1454
1589
  function t() {
1455
1590
  let t = e.editorView.value;
1456
- t && (J(t.state, t.dispatch, t), t.focus());
1591
+ t && (q(t.state, t.dispatch, t), t.focus());
1457
1592
  }
1458
1593
  function n(t) {
1459
1594
  let n = e.editorView.value;
1460
1595
  if (!n) return;
1461
1596
  let r = e.getDocument()?.package?.styles;
1462
1597
  if (r) {
1463
- let e = Ue(r).resolveParagraphStyle(t);
1464
- Re(t, {
1598
+ let e = Ze(r).resolveParagraphStyle(t);
1599
+ Ke(t, {
1465
1600
  paragraphFormatting: e.paragraphFormatting,
1466
1601
  runFormatting: e.runFormatting
1467
1602
  })(n.state, (e) => n.dispatch(e));
1468
- } else Re(t)(n.state, (e) => n.dispatch(e));
1603
+ } else Ke(t)(n.state, (e) => n.dispatch(e));
1469
1604
  n.focus();
1470
1605
  }
1471
1606
  function r() {
1472
1607
  let t = e.editorView.value;
1473
- t && (We(t.state, (e) => t.dispatch(e), t), t.focus());
1608
+ t && (Qe(t.state, (e) => t.dispatch(e), t), t.focus());
1474
1609
  }
1475
1610
  function i(t) {
1476
1611
  let n = e.editorView.value;
@@ -1481,11 +1616,11 @@ function _n(e) {
1481
1616
  function a(t) {
1482
1617
  let n = e.editorView.value;
1483
1618
  if (!n) return !1;
1484
- let r = it(n.state.doc, t.paraId);
1619
+ let r = pt(n.state.doc, t.paraId);
1485
1620
  if (!r) return !1;
1486
1621
  let i = r.from + 1, a = r.to - 1;
1487
1622
  if (t.search) {
1488
- let e = st(n.state.doc, r.from, r.to, t.search);
1623
+ let e = gt(n.state.doc, r.from, r.to, t.search);
1489
1624
  if (!e) return !1;
1490
1625
  i = e.from, a = e.to;
1491
1626
  }
@@ -1498,7 +1633,7 @@ function _n(e) {
1498
1633
  return s.strike !== void 0 && o.marks.strike && (c = s.strike ? c.addMark(i, a, o.marks.strike.create()) : c.removeMark(i, a, o.marks.strike)), s.color !== void 0 && o.marks.textColor && (c = s.color && (s.color.rgb || s.color.themeColor) ? c.addMark(i, a, o.marks.textColor.create({
1499
1634
  rgb: s.color.rgb ?? null,
1500
1635
  themeColor: s.color.themeColor ?? null
1501
- })) : c.removeMark(i, a, o.marks.textColor)), s.highlight !== void 0 && o.marks.highlight && (c = s.highlight ? c.addMark(i, a, o.marks.highlight.create({ color: Ge(s.highlight) || s.highlight })) : c.removeMark(i, a, o.marks.highlight)), s.fontSize !== void 0 && o.marks.fontSize && (c = s.fontSize > 0 ? c.addMark(i, a, o.marks.fontSize.create({ size: Fe(s.fontSize) })) : c.removeMark(i, a, o.marks.fontSize)), s.fontFamily !== void 0 && o.marks.fontFamily && (c = s.fontFamily && (s.fontFamily.ascii || s.fontFamily.hAnsi) ? c.addMark(i, a, o.marks.fontFamily.create({
1636
+ })) : c.removeMark(i, a, o.marks.textColor)), s.highlight !== void 0 && o.marks.highlight && (c = s.highlight ? c.addMark(i, a, o.marks.highlight.create({ color: $e(s.highlight) || s.highlight })) : c.removeMark(i, a, o.marks.highlight)), s.fontSize !== void 0 && o.marks.fontSize && (c = s.fontSize > 0 ? c.addMark(i, a, o.marks.fontSize.create({ size: He(s.fontSize) })) : c.removeMark(i, a, o.marks.fontSize)), s.fontFamily !== void 0 && o.marks.fontFamily && (c = s.fontFamily && (s.fontFamily.ascii || s.fontFamily.hAnsi) ? c.addMark(i, a, o.marks.fontFamily.create({
1502
1637
  ascii: s.fontFamily.ascii ?? null,
1503
1638
  hAnsi: s.fontFamily.hAnsi ?? s.fontFamily.ascii ?? null
1504
1639
  })) : c.removeMark(i, a, o.marks.fontFamily)), n.dispatch(c), !0;
@@ -1506,17 +1641,17 @@ function _n(e) {
1506
1641
  function o(t) {
1507
1642
  let n = e.editorView.value;
1508
1643
  if (!n) return !1;
1509
- let r = it(n.state.doc, t.paraId);
1644
+ let r = pt(n.state.doc, t.paraId);
1510
1645
  if (!r) return !1;
1511
- let i = e.getDocument(), a = i?.package?.styles ? Ue(i.package.styles) : null;
1646
+ let i = e.getDocument(), a = i?.package?.styles ? Ze(i.package.styles) : null;
1512
1647
  if (a && !a.hasParagraphStyle(t.styleId)) return !1;
1513
- let o = n.state.doc.resolve(r.from + 1), s = n.state.doc.resolve(r.to - 1), c = n.state.apply(n.state.tr.setSelection(fe.between(o, s))), l = a ? (() => {
1648
+ let o = n.state.doc.resolve(r.from + 1), s = n.state.doc.resolve(r.to - 1), c = n.state.apply(n.state.tr.setSelection(pe.between(o, s))), l = a ? (() => {
1514
1649
  let e = a.resolveParagraphStyle(t.styleId);
1515
- return Re(t.styleId, {
1650
+ return Ke(t.styleId, {
1516
1651
  paragraphFormatting: e.paragraphFormatting,
1517
1652
  runFormatting: e.runFormatting
1518
1653
  });
1519
- })() : Re(t.styleId), u = !1;
1654
+ })() : Ke(t.styleId), u = !1;
1520
1655
  return l(c, (e) => {
1521
1656
  u = !0, e.setSelection(n.state.selection.map(e.doc, e.mapping)), n.dispatch(e);
1522
1657
  }), u;
@@ -1532,7 +1667,7 @@ function _n(e) {
1532
1667
  }
1533
1668
  //#endregion
1534
1669
  //#region src/composables/usePageSetupControls.ts
1535
- function vn(e) {
1670
+ function An(e) {
1536
1671
  function t(t) {
1537
1672
  let n = e.getDocument();
1538
1673
  if (!n?.package?.document) return;
@@ -1559,19 +1694,19 @@ function vn(e) {
1559
1694
  }
1560
1695
  function s(t) {
1561
1696
  let n = e.editorView.value;
1562
- n && Ve(t)(n.state, n.dispatch);
1697
+ n && Ye(t)(n.state, n.dispatch);
1563
1698
  }
1564
1699
  function c(t) {
1565
1700
  let n = e.editorView.value;
1566
- n && He(t)(n.state, n.dispatch);
1701
+ n && Xe(t)(n.state, n.dispatch);
1567
1702
  }
1568
1703
  function l(t) {
1569
1704
  let n = e.editorView.value;
1570
- n && (t < 0 ? Be(-t, !0)(n.state, n.dispatch) : Be(t, !1)(n.state, n.dispatch));
1705
+ n && (t < 0 ? Je(-t, !0)(n.state, n.dispatch) : Je(t, !1)(n.state, n.dispatch));
1571
1706
  }
1572
1707
  function u(t) {
1573
1708
  let n = e.editorView.value;
1574
- n && ze(t)(n.state, n.dispatch);
1709
+ n && qe(t)(n.state, n.dispatch);
1575
1710
  }
1576
1711
  return {
1577
1712
  handlePageSetupApply: t,
@@ -1587,18 +1722,18 @@ function vn(e) {
1587
1722
  }
1588
1723
  //#endregion
1589
1724
  //#region src/composables/useOutlineSidebar.ts
1590
- function yn(e) {
1725
+ function jn(e) {
1591
1726
  function t() {
1592
1727
  if (!e.showOutline.value) {
1593
1728
  let t = e.editorView.value;
1594
- t && (e.outlineHeadings.value = Ke(t.state.doc));
1729
+ t && (e.outlineHeadings.value = et(t.state.doc));
1595
1730
  }
1596
1731
  e.showOutline.value = !e.showOutline.value;
1597
1732
  }
1598
1733
  function n(t) {
1599
1734
  let n = e.editorView.value;
1600
1735
  if (!n) return;
1601
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = fe.near(r);
1736
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = pe.near(r);
1602
1737
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
1603
1738
  }
1604
1739
  function r() {
@@ -1617,7 +1752,7 @@ function yn(e) {
1617
1752
  }
1618
1753
  //#endregion
1619
1754
  //#region src/composables/useKeyboardShortcuts.ts
1620
- function bn(e) {
1755
+ function Mn(e) {
1621
1756
  function t(t) {
1622
1757
  if (t.key === "F1") {
1623
1758
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1629,7 +1764,7 @@ function bn(e) {
1629
1764
  }
1630
1765
  //#endregion
1631
1766
  //#region src/utils/commentFactories.ts
1632
- function xn(e, t, n, r) {
1767
+ function Nn(e, t, n, r) {
1633
1768
  return {
1634
1769
  id: e.reduce((e, t) => Math.max(e, t.id), 0) + 1,
1635
1770
  author: n,
@@ -1651,9 +1786,9 @@ function xn(e, t, n, r) {
1651
1786
  }
1652
1787
  //#endregion
1653
1788
  //#region src/composables/useCommentManagement.ts
1654
- function Sn(e) {
1789
+ function Pn(e) {
1655
1790
  function t(t, n, r) {
1656
- return xn(e.getDocument()?.package?.document?.comments ?? [], t, n, r);
1791
+ return Nn(e.getDocument()?.package?.document?.comments ?? [], t, n, r);
1657
1792
  }
1658
1793
  function n(n) {
1659
1794
  let r = e.getDocument(), i = e.editorView.value;
@@ -1661,11 +1796,11 @@ function Sn(e) {
1661
1796
  r.package.document.comments || (r.package.document.comments = []);
1662
1797
  let a = i.state.schema.marks.comment;
1663
1798
  if (!a) return null;
1664
- let o = it(i.state.doc, n.paraId);
1799
+ let o = pt(i.state.doc, n.paraId);
1665
1800
  if (!o) return null;
1666
1801
  let s = o.from + 1, c = o.to - 1;
1667
1802
  if (n.search) {
1668
- let e = st(i.state.doc, o.from, o.to, n.search);
1803
+ let e = gt(i.state.doc, o.from, o.to, n.search);
1669
1804
  if (!e) return null;
1670
1805
  s = e.from, c = e.to;
1671
1806
  }
@@ -1690,14 +1825,14 @@ function Sn(e) {
1690
1825
  if (!n) return !1;
1691
1826
  let { schema: r } = n.state;
1692
1827
  if (!r.marks.deletion || !r.marks.insertion) return !1;
1693
- let i = it(n.state.doc, t.paraId);
1828
+ let i = pt(n.state.doc, t.paraId);
1694
1829
  if (!i) return !1;
1695
1830
  let a = t.search === "", o = t.replaceWith === "";
1696
1831
  if (a && o) return !1;
1697
1832
  let s, c;
1698
1833
  if (a) s = i.to - 1, c = i.to - 1;
1699
1834
  else {
1700
- let e = st(n.state.doc, i.from, i.to, t.search);
1835
+ let e = gt(n.state.doc, i.from, i.to, t.search);
1701
1836
  if (!e) return !1;
1702
1837
  s = e.from, c = e.to;
1703
1838
  }
@@ -1732,19 +1867,19 @@ function Sn(e) {
1732
1867
  }
1733
1868
  function l(t, n) {
1734
1869
  let r = e.editorView.value;
1735
- r && (qe(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1870
+ r && (tt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1736
1871
  }
1737
1872
  function u(t, n) {
1738
1873
  let r = e.editorView.value;
1739
- r && (Xe(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1874
+ r && (it(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1740
1875
  }
1741
1876
  function d(t) {
1742
1877
  let n = e.editorView.value;
1743
- n && (Je(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1878
+ n && (nt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1744
1879
  }
1745
1880
  function f(t) {
1746
1881
  let n = e.editorView.value;
1747
- n && (Ze(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1882
+ n && (at(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1748
1883
  }
1749
1884
  function p(n, r) {
1750
1885
  let i = e.getDocument(), a = e.editorView.value;
@@ -1780,18 +1915,18 @@ function Sn(e) {
1780
1915
  }
1781
1916
  //#endregion
1782
1917
  //#region src/utils/domQueries.ts
1783
- function Q(e, t) {
1784
- let n = he(e);
1918
+ function Fn(e, t) {
1919
+ let n = ge(e);
1785
1920
  for (let e of n) {
1786
1921
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
1787
1922
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
1788
1923
  }
1789
1924
  return null;
1790
1925
  }
1791
- function $(e, t, n) {
1926
+ function In(e, t, n) {
1792
1927
  if (!e || !t) return;
1793
1928
  let r = null;
1794
- for (let t of he(e)) {
1929
+ for (let t of ge(e)) {
1795
1930
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
1796
1931
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
1797
1932
  r = t;
@@ -1805,21 +1940,21 @@ function $(e, t, n) {
1805
1940
  behavior: "smooth"
1806
1941
  });
1807
1942
  }
1808
- function Cn(e, t, n, r) {
1943
+ function Ln(e, t, n, r) {
1809
1944
  if (!e || !t) return null;
1810
- let i = pe(e, n, r, 1);
1945
+ let i = me(e, n, r, 1);
1811
1946
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
1812
1947
  }
1813
- function wn(e, t, n) {
1948
+ function Rn(e, t, n) {
1814
1949
  if (!e) return;
1815
- let r = Q(e, t);
1950
+ let r = Fn(e, t);
1816
1951
  if (!r) return;
1817
- let i = r.textContent || "", a = Number(r.dataset.pmStart) || 0, [o, s] = _e(i, t - a), c = a + o, l = a + s;
1952
+ let i = r.textContent || "", a = Number(r.dataset.pmStart) || 0, [o, s] = ve(i, t - a), c = a + o, l = a + s;
1818
1953
  c < l && n(c, l);
1819
1954
  }
1820
- function Tn(e, t, n) {
1955
+ function zn(e, t, n) {
1821
1956
  if (!e) return;
1822
- let r = Q(e, t);
1957
+ let r = Fn(e, t);
1823
1958
  if (!r) return;
1824
1959
  let i = r.closest(".layout-paragraph");
1825
1960
  if (!i) return;
@@ -1828,11 +1963,11 @@ function Tn(e, t, n) {
1828
1963
  }
1829
1964
  //#endregion
1830
1965
  //#region src/composables/useCommentLifecycle.ts
1831
- function En(e) {
1966
+ function Bn(e) {
1832
1967
  let t = L(null), n = L(null), r = L(null), i = L(!1);
1833
1968
  function a() {
1834
1969
  let t = e.getDocument(), n = e.editorView.value;
1835
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = Qe(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
1970
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = ot(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
1836
1971
  }
1837
1972
  function o() {
1838
1973
  e.stateTick.value;
@@ -1851,7 +1986,7 @@ function En(e) {
1851
1986
  t.value = null;
1852
1987
  return;
1853
1988
  }
1854
- let s = o.getBoundingClientRect(), c = Q(a, r);
1989
+ let s = o.getBoundingClientRect(), c = Fn(a, r);
1855
1990
  if (!c) {
1856
1991
  t.value = null;
1857
1992
  return;
@@ -1913,7 +2048,7 @@ function En(e) {
1913
2048
  let i = e.getDocument(), a = e.editorView.value;
1914
2049
  if (!i?.package) return;
1915
2050
  i.package.document.comments || (i.package.document.comments = []);
1916
- let o = xn(i.package.document.comments, t, "User");
2051
+ let o = Nn(i.package.document.comments, t, "User");
1917
2052
  i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments];
1918
2053
  let s = n.value;
1919
2054
  if (a && s && s.from !== s.to) {
@@ -1962,8 +2097,8 @@ function En(e) {
1962
2097
  }
1963
2098
  //#endregion
1964
2099
  //#region src/composables/useImageActions.ts
1965
- function Dn(e) {
1966
- let t = de(null), n = L(!1), r = E(() => {
2100
+ function Vn(e) {
2101
+ let t = de(null), n = L(!1), r = T(() => {
1967
2102
  e.stateTick.value;
1968
2103
  let n = e.editorView.value, r = t.value;
1969
2104
  if (!n || !r) return null;
@@ -1985,14 +2120,14 @@ function Dn(e) {
1985
2120
  width: t.width,
1986
2121
  height: t.height
1987
2122
  });
1988
- Ye(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2123
+ rt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
1989
2124
  }
1990
2125
  function a(n) {
1991
2126
  let r = e.editorView.value, i = t.value;
1992
2127
  if (!r || !i) return;
1993
- let a = je(n);
2128
+ let a = Ne(n);
1994
2129
  if (!a) return;
1995
- let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: De(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2130
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Oe(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
1996
2131
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
1997
2132
  }
1998
2133
  function o(n) {
@@ -2021,8 +2156,8 @@ function Dn(e) {
2021
2156
  }
2022
2157
  //#endregion
2023
2158
  //#region src/utils/imageClipboard.ts
2024
- function On(e, t, n) {
2025
- let r = Z(e.state), i = e.state.schema.marks.insertion;
2159
+ function Hn(e, t, n) {
2160
+ let r = We(e.state), i = e.state.schema.marks.insertion;
2026
2161
  if (!r || !i) return;
2027
2162
  let a = t.selection.from, o = a - n.nodeSize;
2028
2163
  o < 0 || t.addMark(o, a, i.create({
@@ -2031,10 +2166,10 @@ function On(e, t, n) {
2031
2166
  date: r.date
2032
2167
  }));
2033
2168
  }
2034
- function kn(e, t) {
2169
+ function Un(e, t) {
2035
2170
  return e.getBlob(t);
2036
2171
  }
2037
- function An(e, t) {
2172
+ function Wn(e, t) {
2038
2173
  let n = e.state.doc.nodeAt(t);
2039
2174
  if (!n || n.type.name !== "image") return;
2040
2175
  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({
@@ -2046,13 +2181,13 @@ function An(e, t) {
2046
2181
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2047
2182
  });
2048
2183
  }
2049
- function jn(e) {
2184
+ function Gn(e) {
2050
2185
  return new Promise((t, n) => {
2051
2186
  let r = new FileReader();
2052
2187
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2053
2188
  });
2054
2189
  }
2055
- function Mn(e) {
2190
+ function Kn(e) {
2056
2191
  return new Promise((t) => {
2057
2192
  let n = new Image();
2058
2193
  n.onload = () => t({
@@ -2064,13 +2199,13 @@ function Mn(e) {
2064
2199
  }), n.src = e;
2065
2200
  });
2066
2201
  }
2067
- async function Nn(e) {
2202
+ async function qn(e) {
2068
2203
  try {
2069
2204
  let t = await navigator.clipboard.read();
2070
2205
  for (let n of t) {
2071
2206
  let t = n.types.find((e) => e.startsWith("image/"));
2072
2207
  if (t) {
2073
- let r = await jn(await kn(n, t)), i = await Mn(r), a = i.width, o = i.height;
2208
+ let r = await Gn(await Un(n, t)), i = await Kn(r), a = i.width, o = i.height;
2074
2209
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2075
2210
  let s = e.state.schema.nodes.image.create({
2076
2211
  src: r,
@@ -2080,11 +2215,11 @@ async function Nn(e) {
2080
2215
  wrapType: "inline",
2081
2216
  displayMode: "inline"
2082
2217
  }), c = e.state.tr.replaceSelectionWith(s);
2083
- On(e, c, s), e.dispatch(c);
2218
+ Hn(e, c, s), e.dispatch(c);
2084
2219
  return;
2085
2220
  }
2086
2221
  if (n.types.includes("text/html")) {
2087
- let t = await (await kn(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2222
+ let t = await (await Un(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2088
2223
  if (r && r[1]) {
2089
2224
  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({
2090
2225
  src: n,
@@ -2094,12 +2229,12 @@ async function Nn(e) {
2094
2229
  wrapType: "inline",
2095
2230
  displayMode: "inline"
2096
2231
  }), l = e.state.tr.replaceSelectionWith(c);
2097
- On(e, l, c), e.dispatch(l);
2232
+ Hn(e, l, c), e.dispatch(l);
2098
2233
  return;
2099
2234
  }
2100
2235
  }
2101
2236
  if (n.types.includes("text/plain")) {
2102
- let t = await (await kn(n, "text/plain")).text();
2237
+ let t = await (await Un(n, "text/plain")).text();
2103
2238
  if (t && t !== "[image]") {
2104
2239
  let { from: n } = e.state.selection;
2105
2240
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2115,14 +2250,14 @@ async function Nn(e) {
2115
2250
  }
2116
2251
  }
2117
2252
  }
2118
- function Pn(e, t) {
2253
+ function Jn(e, t) {
2119
2254
  let n = e.state.doc.nodeAt(t);
2120
2255
  if (!n || n.type.name !== "image") return;
2121
2256
  let r = document.createElement("input");
2122
2257
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2123
2258
  let i = r.files?.[0];
2124
2259
  if (!i) return;
2125
- let a = await jn(i), o = await Mn(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);
2260
+ let a = await Gn(i), o = await Kn(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2126
2261
  try {
2127
2262
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2128
2263
  ...n.attrs,
@@ -2137,7 +2272,7 @@ function Pn(e, t) {
2137
2272
  }
2138
2273
  //#endregion
2139
2274
  //#region src/composables/useContextMenus.ts
2140
- function Fn(e) {
2275
+ function Yn(e) {
2141
2276
  let { t } = n(), r = L({
2142
2277
  isOpen: !1,
2143
2278
  position: {
@@ -2149,7 +2284,7 @@ function Fn(e) {
2149
2284
  onImage: !1,
2150
2285
  canMergeCells: !1,
2151
2286
  canSplitCell: !1
2152
- }), i = L(null), a = E(() => [
2287
+ }), i = L(null), a = T(() => [
2153
2288
  {
2154
2289
  action: "cut",
2155
2290
  label: t("contextMenu.cut"),
@@ -2175,12 +2310,12 @@ function Fn(e) {
2175
2310
  function o(t) {
2176
2311
  let n = e.editorView.value;
2177
2312
  if (!n) return;
2178
- let a = t.target, o = ke(a);
2313
+ let a = t.target, o = Ae(a);
2179
2314
  if (o) {
2180
2315
  let a = Number(o.dataset.pmStart);
2181
2316
  if (!isNaN(a)) {
2182
2317
  try {
2183
- let e = q.create(n.state.doc, a);
2318
+ let e = fe.create(n.state.doc, a);
2184
2319
  n.dispatch(n.state.tr.setSelection(e));
2185
2320
  } catch {}
2186
2321
  e.selectedImage.value = {
@@ -2201,7 +2336,7 @@ function Fn(e) {
2201
2336
  pmPos: a,
2202
2337
  currentWrapType: n,
2203
2338
  currentCssFloat: c ?? null,
2204
- inlinePositionEmu: n === "inline" ? De(o, e.zoom.value) : void 0
2339
+ inlinePositionEmu: n === "inline" ? Oe(o, e.zoom.value) : void 0
2205
2340
  }, r.value.isOpen = !1;
2206
2341
  return;
2207
2342
  }
@@ -2213,7 +2348,7 @@ function Fn(e) {
2213
2348
  e.setPmSelection(a);
2214
2349
  } catch {}
2215
2350
  }
2216
- let s = Ce(n.state), { empty: c } = n.state.selection;
2351
+ let s = we(n.state), { empty: c } = n.state.selection;
2217
2352
  i.value &&= null, r.value = {
2218
2353
  isOpen: !0,
2219
2354
  position: {
@@ -2242,7 +2377,7 @@ function Fn(e) {
2242
2377
  pmPos: a.pmPos,
2243
2378
  currentWrapType: s,
2244
2379
  currentCssFloat: c ?? null,
2245
- inlinePositionEmu: s === "inline" ? De(a.element, e.zoom.value) : void 0
2380
+ inlinePositionEmu: s === "inline" ? Oe(a.element, e.zoom.value) : void 0
2246
2381
  }, r.value.isOpen = !1;
2247
2382
  }
2248
2383
  function c(t) {
@@ -2258,16 +2393,16 @@ function Fn(e) {
2258
2393
  switch (t) {
2259
2394
  case "cut":
2260
2395
  if (e.selectedImage.value) {
2261
- An(n, e.selectedImage.value.pmPos);
2396
+ Wn(n, e.selectedImage.value.pmPos);
2262
2397
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2263
2398
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2264
2399
  } else document.execCommand("cut");
2265
2400
  break;
2266
2401
  case "copy":
2267
- e.selectedImage.value ? An(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2402
+ e.selectedImage.value ? Wn(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2268
2403
  break;
2269
2404
  case "paste":
2270
- Nn(n);
2405
+ qn(n);
2271
2406
  break;
2272
2407
  case "pasteAsPlainText":
2273
2408
  navigator.clipboard.readText().then((e) => {
@@ -2280,7 +2415,7 @@ function Fn(e) {
2280
2415
  break;
2281
2416
  }
2282
2417
  case "selectAll": {
2283
- let e = fe.create(n.state.doc, 0, n.state.doc.content.size);
2418
+ let e = pe.create(n.state.doc, 0, n.state.doc.content.size);
2284
2419
  n.dispatch(n.state.tr.setSelection(e));
2285
2420
  break;
2286
2421
  }
@@ -2288,7 +2423,7 @@ function Fn(e) {
2288
2423
  e.selectedImage.value && (e.showImageProperties.value = !0);
2289
2424
  break;
2290
2425
  case "replaceImage":
2291
- e.selectedImage.value && Pn(n, e.selectedImage.value.pmPos);
2426
+ e.selectedImage.value && Jn(n, e.selectedImage.value.pmPos);
2292
2427
  break;
2293
2428
  case "deleteImage":
2294
2429
  if (e.selectedImage.value) {
@@ -2323,8 +2458,8 @@ function Fn(e) {
2323
2458
  }
2324
2459
  //#endregion
2325
2460
  //#region src/composables/usePagesPointer.ts
2326
- var In = 500;
2327
- function Ln(e) {
2461
+ var Xn = 500;
2462
+ function Zn(e) {
2328
2463
  let t = L(null), n = null;
2329
2464
  function r() {
2330
2465
  n !== null && (clearTimeout(n), n = null);
@@ -2335,7 +2470,7 @@ function Ln(e) {
2335
2470
  visible: !1
2336
2471
  }), d = null;
2337
2472
  function f(t, n) {
2338
- return Cn(e.pagesRef.value, e.editorView.value, t, n);
2473
+ return Ln(e.pagesRef.value, e.editorView.value, t, n);
2339
2474
  }
2340
2475
  function p() {
2341
2476
  let t = i.value;
@@ -2348,18 +2483,18 @@ function Ln(e) {
2348
2483
  function m(e, t) {
2349
2484
  let n = p();
2350
2485
  if (n) try {
2351
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = fe.between(r, i);
2486
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = pe.between(r, i);
2352
2487
  n.dispatch(n.state.tr.setSelection(a));
2353
2488
  } catch {}
2354
2489
  }
2355
2490
  function h(t) {
2356
- $(e.pagesRef.value, e.pagesViewportRef.value, t);
2491
+ In(e.pagesRef.value, e.pagesViewportRef.value, t);
2357
2492
  }
2358
2493
  function g(t) {
2359
- wn(e.pagesRef.value, t, m);
2494
+ Rn(e.pagesRef.value, t, m);
2360
2495
  }
2361
2496
  function _(t) {
2362
- Tn(e.pagesRef.value, t, m);
2497
+ zn(e.pagesRef.value, t, m);
2363
2498
  }
2364
2499
  function v(t) {
2365
2500
  let n = e.editorView.value;
@@ -2380,7 +2515,7 @@ function Ln(e) {
2380
2515
  if (!o) return;
2381
2516
  let s = e.pagesViewportRef.value;
2382
2517
  if (!s) return;
2383
- let l = et({
2518
+ let l = ct({
2384
2519
  mouseX: a.clientX,
2385
2520
  mouseY: a.clientY,
2386
2521
  pagesContainer: o,
@@ -2390,7 +2525,7 @@ function Ln(e) {
2390
2525
  if (!l) {
2391
2526
  n === null && (n = setTimeout(() => {
2392
2527
  t.value = null, n = null;
2393
- }, $e));
2528
+ }, st));
2394
2529
  return;
2395
2530
  }
2396
2531
  let u = s.getBoundingClientRect();
@@ -2405,7 +2540,7 @@ function Ln(e) {
2405
2540
  n.preventDefault(), n.stopPropagation();
2406
2541
  let r = t.value, i = e.editorView.value;
2407
2542
  if (!r || !i) return;
2408
- let a = i.state.tr.setSelection(fe.create(i.state.doc, r.cellPmPos + 1));
2543
+ let a = i.state.tr.setSelection(pe.create(i.state.doc, r.cellPmPos + 1));
2409
2544
  i.dispatch(a);
2410
2545
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2411
2546
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
@@ -2436,7 +2571,7 @@ function Ln(e) {
2436
2571
  }
2437
2572
  };
2438
2573
  }
2439
- function S(t) {
2574
+ function ee(t) {
2440
2575
  let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
2441
2576
  if (!o) return;
2442
2577
  let s = r ? "header" : "footer", c = e.getDocument();
@@ -2502,7 +2637,7 @@ function Ln(e) {
2502
2637
  }
2503
2638
  };
2504
2639
  }
2505
- function ee(t) {
2640
+ function te(t) {
2506
2641
  let n = e.getDocument(), r = i.value;
2507
2642
  if (!n?.package || !r) return;
2508
2643
  let a = r.position === "header" ? n.package.headers : n.package.footers;
@@ -2510,13 +2645,13 @@ function Ln(e) {
2510
2645
  let o = a.get(r.rId);
2511
2646
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2512
2647
  }
2513
- function te() {
2648
+ function ne() {
2514
2649
  let t = e.getDocument(), n = i.value;
2515
2650
  if (!t?.package || !n || !n.rId) return;
2516
2651
  let r = (n.position === "header" ? t.package.headers : t.package.footers)?.get(n.rId);
2517
2652
  r && (r.content = []), i.value = null, e.syncHfPMs?.(), e.reLayout(), e.emit("change", t);
2518
2653
  }
2519
- function ne(t) {
2654
+ function re(t) {
2520
2655
  if (t.button !== 0 || e.imageInteracting.value) return;
2521
2656
  let n = e.editorView.value;
2522
2657
  if (!n) return;
@@ -2524,13 +2659,13 @@ function Ln(e) {
2524
2659
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2525
2660
  let u = p() ?? n;
2526
2661
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2527
- let d = ke(r);
2662
+ let d = Ae(r);
2528
2663
  if (d) {
2529
2664
  t.preventDefault(), t.stopPropagation();
2530
2665
  let n = Number(d.dataset.pmStart);
2531
2666
  if (!isNaN(n)) {
2532
2667
  try {
2533
- u.dispatch(u.state.tr.setSelection(q.create(u.state.doc, n)));
2668
+ u.dispatch(u.state.tr.setSelection(fe.create(u.state.doc, n)));
2534
2669
  } catch {}
2535
2670
  e.selectedImage.value = {
2536
2671
  element: d,
@@ -2549,7 +2684,7 @@ function Ln(e) {
2549
2684
  return;
2550
2685
  }
2551
2686
  let v = Date.now();
2552
- if (v - a < In && o === h ? s++ : s = 1, a = v, o = h, s === 2) g(h);
2687
+ if (v - a < Xn && o === h ? s++ : s = 1, a = v, o = h, s === 2) g(h);
2553
2688
  else if (s >= 3) _(h), s = 0;
2554
2689
  else {
2555
2690
  if (t.shiftKey) {
@@ -2560,15 +2695,15 @@ function Ln(e) {
2560
2695
  }
2561
2696
  u.focus();
2562
2697
  }
2563
- function C(e) {
2698
+ function S(e) {
2564
2699
  if (!c || l === null) return;
2565
2700
  let t = f(e.clientX, e.clientY);
2566
2701
  t !== null && t !== l && m(l, t);
2567
2702
  }
2568
- function w() {
2703
+ function C() {
2569
2704
  c = !1;
2570
2705
  }
2571
- function T() {
2706
+ function w() {
2572
2707
  let t = e.pagesViewportRef.value, n = e.layout.value;
2573
2708
  if (!t || !n || n.pages.length === 0) return;
2574
2709
  let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
@@ -2592,9 +2727,9 @@ function Ln(e) {
2592
2727
  }, 600);
2593
2728
  }
2594
2729
  return F(() => {
2595
- window.addEventListener("mousemove", C), window.addEventListener("mouseup", w), e.pagesViewportRef.value?.addEventListener("scroll", T, { passive: !0 });
2730
+ window.addEventListener("mousemove", S), window.addEventListener("mouseup", C), e.pagesViewportRef.value?.addEventListener("scroll", w, { passive: !0 });
2596
2731
  }), P(() => {
2597
- r(), window.removeEventListener("mousemove", C), window.removeEventListener("mouseup", w), e.pagesViewportRef.value?.removeEventListener("scroll", T), d && clearTimeout(d);
2732
+ r(), window.removeEventListener("mousemove", S), window.removeEventListener("mouseup", C), e.pagesViewportRef.value?.removeEventListener("scroll", w), d && clearTimeout(d);
2598
2733
  }), {
2599
2734
  tableInsertButton: t,
2600
2735
  hfEdit: i,
@@ -2603,19 +2738,19 @@ function Ln(e) {
2603
2738
  setPmSelection: m,
2604
2739
  scrollVisiblePositionIntoView: h,
2605
2740
  navigateToBookmark: v,
2606
- handlePagesMouseDown: ne,
2741
+ handlePagesMouseDown: re,
2607
2742
  handlePagesMouseMove: y,
2608
2743
  handlePagesClick: x,
2609
- handlePagesDoubleClick: S,
2744
+ handlePagesDoubleClick: ee,
2610
2745
  handleTableInsertClick: b,
2611
2746
  clearTableInsertTimer: r,
2612
- handleHfSave: ee,
2613
- handleHfRemove: te
2747
+ handleHfSave: te,
2748
+ handleHfRemove: ne
2614
2749
  };
2615
2750
  }
2616
2751
  //#endregion
2617
2752
  //#region src/composables/useSelectionSync.ts
2618
- function Rn(e) {
2753
+ function Qn(e) {
2619
2754
  let t = null, n = null;
2620
2755
  function r() {
2621
2756
  let r = e.pagesRef.value;
@@ -2625,10 +2760,10 @@ function Rn(e) {
2625
2760
  let i = e.pagesRef.value, a = e.editorView.value;
2626
2761
  if (!i || !a || (r(), e.isHfEditing?.value)) return;
2627
2762
  let o = a.state.selection;
2628
- if (o instanceof q && o.node.type.name === "image") {
2763
+ if (o instanceof fe && o.node.type.name === "image") {
2629
2764
  let t = null;
2630
2765
  for (let e of i.querySelectorAll(`[data-pm-start="${o.from}"]`)) {
2631
- let n = ke(e);
2766
+ let n = Ae(e);
2632
2767
  if (n) {
2633
2768
  t = n;
2634
2769
  break;
@@ -2648,7 +2783,7 @@ function Rn(e) {
2648
2783
  if (e.selectedImage.value) return;
2649
2784
  let { from: s, to: c, empty: l } = a.state.selection, u = i.scrollTop, d = i.scrollLeft;
2650
2785
  if (l) {
2651
- let e = Te(i, s, i.getBoundingClientRect());
2786
+ let e = Ee(i, s, i.getBoundingClientRect());
2652
2787
  if (e) {
2653
2788
  let r = document.createElement("div");
2654
2789
  r.className = "vue-caret", r.style.cssText = `
@@ -2659,7 +2794,7 @@ function Rn(e) {
2659
2794
  height: ${e.height}px;
2660
2795
  background: #000;
2661
2796
  pointer-events: none;
2662
- z-index: ${ee.selectionOverlay};
2797
+ z-index: ${te.selectionOverlay};
2663
2798
  `, i.appendChild(r), n = r;
2664
2799
  let a = !0;
2665
2800
  t = setInterval(() => {
@@ -2668,7 +2803,7 @@ function Rn(e) {
2668
2803
  }
2669
2804
  return;
2670
2805
  }
2671
- let f = Ee(i, s, c, i.getBoundingClientRect());
2806
+ let f = De(i, s, c, i.getBoundingClientRect());
2672
2807
  for (let e of f) {
2673
2808
  let t = document.createElement("div");
2674
2809
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2679,7 +2814,7 @@ function Rn(e) {
2679
2814
  height: ${e.height}px;
2680
2815
  background: rgba(66, 133, 244, 0.3);
2681
2816
  pointer-events: none;
2682
- z-index: ${ee.selectionOverlay};
2817
+ z-index: ${te.selectionOverlay};
2683
2818
  `, i.appendChild(t);
2684
2819
  }
2685
2820
  }
@@ -2692,7 +2827,7 @@ function Rn(e) {
2692
2827
  }
2693
2828
  //#endregion
2694
2829
  //#region src/composables/useMenuActions.ts
2695
- function zn(e) {
2830
+ function $n(e) {
2696
2831
  function t(t) {
2697
2832
  let n = e.editorView.value;
2698
2833
  if (!n) return;
@@ -2744,7 +2879,7 @@ function zn(e) {
2744
2879
  e.showKeyboardShortcuts.value = !0;
2745
2880
  break;
2746
2881
  case "reportIssue":
2747
- tt();
2882
+ lt();
2748
2883
  break;
2749
2884
  case "dirLTR":
2750
2885
  t("setLtr");
@@ -2762,7 +2897,7 @@ function zn(e) {
2762
2897
  }
2763
2898
  //#endregion
2764
2899
  //#region src/composables/useDocumentLifecycle.ts
2765
- function Bn(e) {
2900
+ function er(e) {
2766
2901
  async function t(t) {
2767
2902
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
2768
2903
  }
@@ -2781,9 +2916,10 @@ function Bn(e) {
2781
2916
  }
2782
2917
  //#endregion
2783
2918
  //#region src/composables/useDocxEditorRefApi.ts
2784
- function Vn(e) {
2919
+ function tr(e) {
2785
2920
  function t() {
2786
- e.onPrint?.(), window.print();
2921
+ let t = e.pagesRef.value;
2922
+ t && Me(t), e.onPrint?.(), window.print();
2787
2923
  }
2788
2924
  function n() {
2789
2925
  t();
@@ -2817,31 +2953,71 @@ function Vn(e) {
2817
2953
  function c() {
2818
2954
  let t = e.layout.value, n = e.editorView.value;
2819
2955
  if (!t || !n) return 0;
2820
- let r = Le(t, n.state.selection.from);
2956
+ let r = Ge(t, n.state.selection.from);
2821
2957
  return r == null ? 0 : r + 1;
2822
2958
  }
2823
2959
  function l(t) {
2824
2960
  let n = e.editorView.value;
2825
2961
  if (!n) return !1;
2826
- let r = it(n.state.doc, t);
2962
+ let r = pt(n.state.doc, t);
2827
2963
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
2828
2964
  }
2829
2965
  function u(t, n) {
2830
- return ct(e.editorView.value, t, n);
2966
+ return _t(e.editorView.value, t, n);
2831
2967
  }
2832
2968
  function d() {
2833
- return lt(e.editorView.value);
2969
+ return vt(e.editorView.value);
2834
2970
  }
2835
2971
  function f() {
2836
2972
  return e.comments.value;
2837
2973
  }
2838
2974
  function p(t) {
2839
- return ut(e.editorView.value, e.layout.value, t);
2975
+ let n = e.editorView.value;
2976
+ return n ? Z(n.state.doc, t ?? {}) : [];
2840
2977
  }
2841
2978
  function m(t) {
2979
+ let n = e.editorView.value;
2980
+ if (!n) return !1;
2981
+ let r = X(n.state.doc, t);
2982
+ return r == null ? !1 : (a(r), !0);
2983
+ }
2984
+ function h(t, n, r) {
2985
+ let i = e.editorView.value;
2986
+ if (!i) return !1;
2987
+ try {
2988
+ return i.dispatch(Be(i.state, t, n, r)), !0;
2989
+ } catch (e) {
2990
+ if (e instanceof ut) return !1;
2991
+ throw e;
2992
+ }
2993
+ }
2994
+ function g(t, n) {
2995
+ let r = e.editorView.value;
2996
+ if (!r) return !1;
2997
+ try {
2998
+ return r.dispatch(Le(r.state, t, n)), !0;
2999
+ } catch (e) {
3000
+ if (e instanceof ut) return !1;
3001
+ throw e;
3002
+ }
3003
+ }
3004
+ function _(t, n, r) {
3005
+ let i = e.editorView.value;
3006
+ if (!i) return !1;
3007
+ try {
3008
+ return i.dispatch(Ve(i.state, t, n, r)), !0;
3009
+ } catch (e) {
3010
+ if (e instanceof ut) return !1;
3011
+ throw e;
3012
+ }
3013
+ }
3014
+ function v(t) {
3015
+ return yt(e.editorView.value, e.layout.value, t);
3016
+ }
3017
+ function y(t) {
2842
3018
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
2843
3019
  }
2844
- function h(t) {
3020
+ function b(t) {
2845
3021
  return e.selectionChangeSubscribers.add(t), () => e.selectionChangeSubscribers.delete(t);
2846
3022
  }
2847
3023
  return { exposed: {
@@ -2867,36 +3043,41 @@ function Vn(e) {
2867
3043
  findInDocument: u,
2868
3044
  getSelectionInfo: d,
2869
3045
  getComments: f,
3046
+ getContentControls: p,
3047
+ scrollToContentControl: m,
3048
+ setContentControlContent: h,
3049
+ removeContentControl: g,
3050
+ setContentControlValue: _,
2870
3051
  applyFormatting: e.applyFormatting,
2871
3052
  setParagraphStyle: e.setParagraphStyle,
2872
- getPageContent: p,
3053
+ getPageContent: v,
2873
3054
  getTotalPages: s,
2874
3055
  getCurrentPage: c,
2875
- onContentChange: m,
2876
- onSelectionChange: h
3056
+ onContentChange: y,
3057
+ onSelectionChange: b
2877
3058
  } };
2878
3059
  }
2879
3060
  //#endregion
2880
3061
  //#region src/composables/useFontLifecycle.ts
2881
- function Hn(e, t) {
3062
+ function nr(e, t) {
2882
3063
  H(e, (e) => {
2883
- ve(e);
3064
+ ye(e);
2884
3065
  }, { immediate: !0 });
2885
- let n = ye(t);
3066
+ let n = be(t);
2886
3067
  P(() => n());
2887
3068
  }
2888
3069
  //#endregion
2889
3070
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
2890
- var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3071
+ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
2891
3072
  key: 0,
2892
3073
  class: "docx-editor-vue__error"
2893
- }, Gn = {
3074
+ }, ar = {
2894
3075
  key: 1,
2895
3076
  class: "docx-editor-vue__loading"
2896
- }, Kn = { class: "docx-editor-vue__editor-area" }, qn = {
3077
+ }, or = { class: "docx-editor-vue__editor-area" }, sr = {
2897
3078
  key: 0,
2898
3079
  class: "docx-editor-vue__vertical-ruler"
2899
- }, Jn = ["title"], Yn = ["title", "aria-label"], Xn = /* @__PURE__ */ j({
3080
+ }, cr = ["title"], lr = ["title", "aria-label"], ur = /* @__PURE__ */ j({
2900
3081
  __name: "DocxEditor",
2901
3082
  props: {
2902
3083
  documentBuffer: { default: null },
@@ -2988,44 +3169,44 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
2988
3169
  "mode-change"
2989
3170
  ],
2990
3171
  setup(e, { expose: n, emit: r }) {
2991
- let i = e, a = r, o = L(i.mode), s = E(() => i.readOnly || o.value === "viewing");
2992
- f(E(() => i.i18n));
2993
- let { t: l } = t(E(() => i.i18n)), u = L(null), d = L(null), g = L(null), y = L(0), x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), ee = new Ne(), w = L(!1), T = L(!1), re = L(!1), oe = L(!1), j = L(!1), se = L(!1), R = L(i.showOutline), V = L(!1), W = L(!1), G = L(!1), q = L(null), pe = de([]), he = de([]), J = de([]), { zoom: Y, zoomPercent: _e, isMinZoom: ve, isMaxZoom: ye, setZoom: be, zoomIn: xe, zoomOut: Se, handleWheel: Ce, handleKeyDown: we, installShortcuts: Te, ZOOM_PRESETS: Ee } = te(i.initialZoom);
2994
- Te();
2995
- let { editorView: X, isReady: De, parseError: Oe, layout: ke, loadBuffer: Ae, loadDocument: je, save: Me, focus: Pe, destroy: Fe, getDocument: Z, getCommands: Le, reLayout: Re, getHfPmView: ze, syncHfPMs: Be, setHfTransactionListener: Ve, setDocument: He } = ne({
3172
+ let i = e, a = r, o = L(i.mode), s = T(() => i.readOnly || o.value === "viewing");
3173
+ f(T(() => i.i18n));
3174
+ let { t: l } = t(T(() => i.i18n)), u = L(null), d = L(null), g = L(null), y = L(0), x = /* @__PURE__ */ new Set(), ee = /* @__PURE__ */ new Set(), te = new Fe(), C = L(!1), w = L(!1), ie = L(!1), oe = L(!1), j = L(!1), se = L(!1), R = L(i.showOutline), V = L(!1), W = L(!1), G = L(!1), fe = L(null), me = de([]), ge = de([]), q = de([]), { zoom: J, zoomPercent: ve, isMinZoom: ye, isMaxZoom: be, setZoom: xe, zoomIn: Se, zoomOut: Ce, handleWheel: we, handleKeyDown: Te, installShortcuts: Ee, ZOOM_PRESETS: De } = ne(i.initialZoom);
3175
+ Ee();
3176
+ let { editorView: Y, isReady: Oe, parseError: ke, layout: Ae, loadBuffer: je, loadDocument: Me, save: Ne, focus: Pe, destroy: Ie, getDocument: X, getCommands: Z, reLayout: Le, getHfPmView: Re, syncHfPMs: ze, setHfTransactionListener: Be, setDocument: Ve } = re({
2996
3177
  hiddenContainer: u,
2997
3178
  pagesContainer: d,
2998
3179
  readOnly: s,
2999
3180
  externalPlugins: i.externalPlugins,
3000
- syncCoordinator: ee,
3181
+ syncCoordinator: te,
3001
3182
  editorMode: o,
3002
3183
  onChange: (e) => {
3003
3184
  a("change", e), a("update:document", e), x.forEach((t) => t(e));
3004
3185
  },
3005
3186
  onError: (e) => a("error", e),
3006
3187
  onSelectionUpdate: () => {
3007
- y.value++, ur();
3008
- let e = lt(X.value);
3009
- S.forEach((t) => t(e));
3188
+ y.value++, dr();
3189
+ let e = vt(Y.value);
3190
+ ee.forEach((t) => t(e));
3010
3191
  }
3011
- }), Ue = E(() => {
3192
+ }), He = T(() => {
3012
3193
  y.value;
3013
- let e = Z();
3194
+ let e = X();
3014
3195
  if (!e?.package?.document) return null;
3015
3196
  let t = e.package.document;
3016
3197
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3017
- }), We = E(() => (y.value, Z()?.package?.theme ?? i.theme ?? null)), Ge = L(null);
3018
- Hn(() => i.fonts, (e) => a("error", e));
3019
- let Ke = E(() => $.value?.headerFooter ? ze($.value.headerFooter) ?? null : null);
3198
+ }), We = T(() => (y.value, X()?.package?.theme ?? i.theme ?? null)), Ge = L(null);
3199
+ nr(() => i.fonts, (e) => a("error", e));
3200
+ let Ke = T(() => $.value?.headerFooter ? Re($.value.headerFooter) ?? null : null);
3020
3201
  F(() => {
3021
- Ve((e, t) => {
3202
+ Be((e, t) => {
3022
3203
  requestAnimationFrame(() => {
3023
- Ge.value = me(t);
3204
+ Ge.value = he(t);
3024
3205
  let e = $.value;
3025
3206
  if (!e) return;
3026
3207
  let n = window.document.querySelector(e.position === "header" ? ".layout-page-header" : ".layout-page-footer"), r = g.value;
3027
3208
  if (!n || !r) return;
3028
- let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = Y.value || 1;
3209
+ let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = J.value || 1;
3029
3210
  $.value = {
3030
3211
  ...e,
3031
3212
  targetRect: {
@@ -3041,15 +3222,15 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3041
3222
  Ge.value = null;
3042
3223
  return;
3043
3224
  }
3044
- let t = X.value;
3225
+ let t = Y.value;
3045
3226
  if (t) {
3046
3227
  try {
3047
- let e = t.state.tr.setSelection(fe.create(t.state.doc, 0));
3228
+ let e = t.state.tr.setSelection(pe.create(t.state.doc, 0));
3048
3229
  t.dispatch(e);
3049
3230
  } catch {}
3050
3231
  t.dom.blur?.();
3051
3232
  }
3052
- dr.updateSelectionOverlay();
3233
+ fr.updateSelectionOverlay();
3053
3234
  });
3054
3235
  let e = 0;
3055
3236
  function t() {
@@ -3057,35 +3238,35 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3057
3238
  e = 0;
3058
3239
  let t = $.value;
3059
3240
  if (!t?.headerFooter) return;
3060
- let n = ze(t.headerFooter);
3061
- n && (Ge.value = me(n));
3241
+ let n = Re(t.headerFooter);
3242
+ n && (Ge.value = he(n));
3062
3243
  }));
3063
3244
  }
3064
3245
  window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), P(() => {
3065
3246
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3066
3247
  });
3067
3248
  });
3068
- let qe = E(() => {
3249
+ let qe = T(() => {
3069
3250
  let e = [];
3070
- return W.value && e.push(`translateX(-${ge}px)`), Y.value !== 1 && e.push(`scale(${Y.value})`), {
3251
+ return W.value && e.push(`translateX(-${_e}px)`), J.value !== 1 && e.push(`scale(${J.value})`), {
3071
3252
  transform: e.length > 0 ? e.join(" ") : void 0,
3072
3253
  transformOrigin: "top center",
3073
3254
  transition: "transform 0.2s ease"
3074
3255
  };
3075
- }), Je = E(() => ({
3256
+ }), Je = T(() => ({
3076
3257
  paddingLeft: "20px",
3077
- paddingRight: 20 + (W.value ? ge * 2 : 0) + "px",
3258
+ paddingRight: 20 + (W.value ? _e * 2 : 0) + "px",
3078
3259
  transition: "padding 0.2s ease"
3079
- })), Ye = E(() => {
3080
- let e = Ue.value;
3081
- return Ie(e?.pageWidth ?? 12240) * Y.value;
3082
- }), Xe = E(() => {
3260
+ })), Ye = T(() => {
3261
+ let e = He.value;
3262
+ return Ue(e?.pageWidth ?? 12240) * J.value;
3263
+ }), Xe = T(() => {
3083
3264
  let e = /* @__PURE__ */ new Set();
3084
- for (let t of pe.value) t.parentId == null && t.done && e.add(t.id);
3265
+ for (let t of me.value) t.parentId == null && t.done && e.add(t.id);
3085
3266
  return e;
3086
- }), Ze = E(() => {
3267
+ }), Ze = T(() => {
3087
3268
  y.value;
3088
- let e = X.value;
3269
+ let e = Y.value;
3089
3270
  if (!e) return [];
3090
3271
  let t = /* @__PURE__ */ new Set(), n = [];
3091
3272
  return e.state.doc.descendants((e) => {
@@ -3100,181 +3281,181 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3100
3281
  }
3101
3282
  return !0;
3102
3283
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3103
- }), { floatingCommentBtn: Qe, pendingCommentRange: $e, addCommentYPosition: et, sidebarAutoOpenedRef: tt, extractCommentsAndChanges: nt, handleAddComment: rt, handleCancelAddComment: it, handleStartAddComment: at, handleMarkerClick: ot } = En({
3104
- editorView: X,
3105
- getDocument: Z,
3106
- comments: pe,
3107
- trackedChanges: he,
3284
+ }), { floatingCommentBtn: Qe, pendingCommentRange: $e, addCommentYPosition: et, sidebarAutoOpenedRef: tt, extractCommentsAndChanges: nt, handleAddComment: rt, handleCancelAddComment: it, handleStartAddComment: at, handleMarkerClick: ot } = Bn({
3285
+ editorView: Y,
3286
+ getDocument: X,
3287
+ comments: me,
3288
+ trackedChanges: ge,
3108
3289
  resolvedCommentIds: Xe,
3109
- activeSidebarItem: q,
3290
+ activeSidebarItem: fe,
3110
3291
  showSidebar: W,
3111
3292
  isAddingComment: G,
3112
3293
  readOnly: s,
3113
- zoom: Y,
3294
+ zoom: J,
3114
3295
  stateTick: y,
3115
3296
  pagesRef: d,
3116
3297
  pagesViewportRef: g,
3117
3298
  emit: a
3118
- }), { docxInputRef: st, handleDocxFileChange: ct, handleDocumentNameChange: ut, downloadCurrentDocument: ft, loadDocumentBuffer: pt, loadDocument: mt, save: ht } = hn({
3119
- loadBuffer: Ae,
3120
- loadParsedDocument: je,
3121
- getDocument: Z,
3122
- saveBlob: Me,
3299
+ }), { docxInputRef: st, handleDocxFileChange: ct, handleDocumentNameChange: lt, downloadCurrentDocument: ut, loadDocumentBuffer: dt, loadDocument: ft, save: pt } = Dn({
3300
+ loadBuffer: je,
3301
+ loadParsedDocument: Me,
3302
+ getDocument: X,
3303
+ saveBlob: Ne,
3123
3304
  extractCommentsAndChanges: nt,
3124
3305
  emit: a,
3125
3306
  documentName: () => i.documentName,
3126
3307
  onDocumentNameChange: i.onDocumentNameChange,
3127
3308
  nextTick: ce
3128
- }), { hyperlinkPopupData: gt, handleHyperlinkSubmit: _t, handleHyperlinkRemove: yt, handleHyperlinkPopupNavigate: bt, handleHyperlinkPopupEdit: xt, handleHyperlinkPopupRemove: St } = gn({
3129
- editorView: X,
3130
- getCommands: Le
3131
- }), { handleClearFormatting: Tt, handleApplyStyle: Et, handleInsertPageBreak: Ot, handleInsertSymbol: kt, applyFormatting: At, setParagraphStyle: jt } = _n({
3132
- editorView: X,
3133
- getDocument: Z
3134
- }), { handlePageSetupApply: Pt, handleLeftMarginChange: Ft, handleRightMarginChange: It, handleTopMarginChange: Lt, handleBottomMarginChange: Rt, handleIndentLeftChange: zt, handleIndentRightChange: Bt, handleFirstLineIndentChange: Vt, handleTabStopRemove: Ht } = vn({
3135
- editorView: X,
3136
- getDocument: Z,
3309
+ }), { hyperlinkPopupData: mt, handleHyperlinkSubmit: ht, handleHyperlinkRemove: gt, handleHyperlinkPopupNavigate: _t, handleHyperlinkPopupEdit: yt, handleHyperlinkPopupRemove: xt } = On({
3310
+ editorView: Y,
3311
+ getCommands: Z
3312
+ }), { handleClearFormatting: St, handleApplyStyle: Ct, handleInsertPageBreak: wt, handleInsertSymbol: Tt, applyFormatting: Et, setParagraphStyle: Ot } = kn({
3313
+ editorView: Y,
3314
+ getDocument: X
3315
+ }), { handlePageSetupApply: kt, handleLeftMarginChange: At, handleRightMarginChange: jt, handleTopMarginChange: Pt, handleBottomMarginChange: Ft, handleIndentLeftChange: Lt, handleIndentRightChange: Rt, handleFirstLineIndentChange: zt, handleTabStopRemove: Bt } = An({
3316
+ editorView: Y,
3317
+ getDocument: X,
3137
3318
  readOnly: s,
3138
3319
  stateTick: y,
3139
- reLayout: Re,
3320
+ reLayout: Le,
3140
3321
  emit: a
3141
- }), { handleToggleOutline: Ut, handleOutlineNavigate: Wt, handleToggleSidebar: Gt, handleEditorScrollMouseDown: Kt } = yn({
3142
- editorView: X,
3322
+ }), { handleToggleOutline: Ht, handleOutlineNavigate: Ut, handleToggleSidebar: Wt, handleEditorScrollMouseDown: Gt } = jn({
3323
+ editorView: Y,
3143
3324
  showOutline: R,
3144
3325
  showSidebar: W,
3145
- outlineHeadings: J,
3146
- activeSidebarItem: q,
3326
+ outlineHeadings: q,
3327
+ activeSidebarItem: fe,
3147
3328
  extractCommentsAndChanges: nt
3148
3329
  });
3149
- bn({
3330
+ Mn({
3150
3331
  showKeyboardShortcuts: V,
3151
- showFindReplace: w,
3152
- showHyperlink: re,
3153
- handleZoomKeyDown: we,
3332
+ showFindReplace: C,
3333
+ showHyperlink: ie,
3334
+ handleZoomKeyDown: Te,
3154
3335
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3155
3336
  });
3156
- let { addComment: qt, replyToComment: Jt, resolveComment: Yt, proposeChange: Xt, handleCommentReply: Zt, handleCommentUnresolve: Qt, handleCommentDelete: $t, handleAcceptChange: en, handleRejectChange: tn, handleAcceptChangeById: nn, handleRejectChangeById: an, handleTrackedChangeReply: on } = Sn({
3157
- editorView: X,
3158
- getDocument: Z,
3159
- comments: pe,
3160
- trackedChanges: he,
3337
+ let { addComment: Jt, replyToComment: Yt, resolveComment: Xt, proposeChange: Zt, handleCommentReply: Qt, handleCommentUnresolve: $t, handleCommentDelete: en, handleAcceptChange: tn, handleRejectChange: nn, handleAcceptChangeById: rn, handleRejectChangeById: an, handleTrackedChangeReply: on } = Pn({
3338
+ editorView: Y,
3339
+ getDocument: X,
3340
+ comments: me,
3341
+ trackedChanges: ge,
3161
3342
  showSidebar: W,
3162
3343
  isAddingComment: G,
3163
3344
  pendingCommentRange: $e,
3164
3345
  contentChangeSubscribers: x,
3165
3346
  extractCommentsAndChanges: nt,
3166
3347
  emit: a
3167
- }), { selectedImage: sn, imageInteracting: cn, imageToolbarContext: ln, handleInsertImage: un, handleToolbarImageWrap: dn, handleImageTransform: fn } = Dn({
3168
- editorView: X,
3169
- zoom: Y,
3348
+ }), { selectedImage: sn, imageInteracting: cn, imageToolbarContext: ln, handleInsertImage: un, handleToolbarImageWrap: dn, handleImageTransform: fn } = Vn({
3349
+ editorView: Y,
3350
+ zoom: J,
3170
3351
  stateTick: y,
3171
- getCommands: Le
3172
- }), pn = C(), xn = null, { tableInsertButton: Q, hfEdit: $, scrollPageInfo: Cn, resolvePos: wn, setPmSelection: Tn, scrollVisiblePositionIntoView: On, handlePagesMouseDown: kn, handlePagesMouseMove: An, handlePagesClick: jn, handlePagesDoubleClick: Mn, handleTableInsertClick: Nn, clearTableInsertTimer: Pn, handleHfSave: In, handleHfRemove: Xn } = Ln({
3173
- editorView: X,
3352
+ getCommands: Z
3353
+ }), pn = S(), mn = null, { tableInsertButton: Q, hfEdit: $, scrollPageInfo: hn, resolvePos: _n, setPmSelection: vn, scrollVisiblePositionIntoView: yn, handlePagesMouseDown: bn, handlePagesMouseMove: xn, handlePagesClick: Sn, handlePagesDoubleClick: Cn, handleTableInsertClick: wn, clearTableInsertTimer: Tn, handleHfSave: Nn, handleHfRemove: Fn } = Zn({
3354
+ editorView: Y,
3174
3355
  pagesRef: d,
3175
3356
  pagesViewportRef: g,
3176
3357
  selectedImage: sn,
3177
3358
  imageInteracting: cn,
3178
- hyperlinkPopupData: gt,
3359
+ hyperlinkPopupData: mt,
3179
3360
  readOnly: s,
3180
- zoom: Y,
3181
- layout: ke,
3361
+ zoom: J,
3362
+ layout: Ae,
3182
3363
  tableResize: pn,
3183
- getCommands: Le,
3184
- getDocument: Z,
3185
- reLayout: Re,
3364
+ getCommands: Z,
3365
+ getDocument: X,
3366
+ reLayout: Le,
3186
3367
  emit: a,
3187
- clearOverlay: lr,
3188
- syncHfPMs: Be,
3189
- getHfPmView: ze,
3190
- setDocument: He
3191
- }), { contextMenu: Zn, imageContextMenu: Qn, imageContextMenuTextActions: $n, handleContextMenu: er, handleSelectedImageContextMenu: tr, handleImageWrapSelect: nr, handleContextMenuAction: rr } = Fn({
3192
- editorView: X,
3368
+ clearOverlay: ur,
3369
+ syncHfPMs: ze,
3370
+ getHfPmView: Re,
3371
+ setDocument: Ve
3372
+ }), { contextMenu: In, imageContextMenu: Ln, imageContextMenuTextActions: Rn, handleContextMenu: zn, handleSelectedImageContextMenu: Hn, handleImageWrapSelect: Un, handleContextMenuAction: Wn } = Yn({
3373
+ editorView: Y,
3193
3374
  selectedImage: sn,
3194
- zoom: Y,
3375
+ zoom: J,
3195
3376
  showImageProperties: j,
3196
- getCommands: Le,
3197
- clearOverlay: lr,
3198
- setPmSelection: Tn,
3199
- resolvePos: wn
3200
- }), { handleMenuAction: ir, handleMenuTableInsert: ar } = zn({
3201
- editorView: X,
3202
- getCommands: Le,
3377
+ getCommands: Z,
3378
+ clearOverlay: ur,
3379
+ setPmSelection: vn,
3380
+ resolvePos: _n
3381
+ }), { handleMenuAction: Gn, handleMenuTableInsert: Kn } = $n({
3382
+ editorView: Y,
3383
+ getCommands: Z,
3203
3384
  docxInputRef: st,
3204
3385
  showPageSetup: se,
3205
- showInsertImage: T,
3206
- showHyperlink: re,
3386
+ showInsertImage: w,
3387
+ showHyperlink: ie,
3207
3388
  showInsertSymbol: oe,
3208
3389
  showKeyboardShortcuts: V,
3209
- handleClearFormatting: Tt,
3210
- handleInsertPageBreak: Ot,
3211
- handleToggleOutline: Ut,
3212
- handleToggleSidebar: Gt,
3213
- downloadCurrentDocument: ft,
3390
+ handleClearFormatting: St,
3391
+ handleInsertPageBreak: wt,
3392
+ handleToggleOutline: Ht,
3393
+ handleToggleSidebar: Wt,
3394
+ downloadCurrentDocument: ut,
3214
3395
  emit: a
3215
3396
  });
3216
- Bn({
3397
+ er({
3217
3398
  documentBuffer: () => i.documentBuffer,
3218
3399
  document: () => i.document,
3219
- loadDocumentBuffer: pt,
3220
- loadDocument: mt,
3400
+ loadDocumentBuffer: dt,
3401
+ loadDocument: ft,
3221
3402
  sidebarAutoOpenedRef: tt
3222
3403
  });
3223
- let or = () => X.value, sr = () => d.value;
3404
+ let qn = () => Y.value, Jn = () => d.value;
3224
3405
  H(() => i.mode, (e) => {
3225
3406
  e && e !== o.value && (o.value = e);
3226
3407
  }), H(() => i.showOutline, (e) => {
3227
3408
  R.value = !!e;
3228
3409
  });
3229
- function cr(e) {
3410
+ function Xn(e) {
3230
3411
  o.value !== e && (o.value = e, a("mode-change", e));
3231
3412
  }
3232
3413
  F(() => {
3233
- xn = pn.install();
3414
+ mn = pn.install();
3234
3415
  }), P(() => {
3235
- xn?.();
3416
+ mn?.();
3236
3417
  });
3237
- function lr() {
3238
- dr.clearOverlay();
3239
- }
3240
3418
  function ur() {
3241
- dr.updateSelectionOverlay();
3419
+ fr.clearOverlay();
3420
+ }
3421
+ function dr() {
3422
+ fr.updateSelectionOverlay();
3242
3423
  }
3243
- let dr = Rn({
3244
- editorView: X,
3424
+ let fr = Qn({
3425
+ editorView: Y,
3245
3426
  pagesRef: d,
3246
3427
  selectedImage: sn,
3247
- isHfEditing: E(() => $.value !== null)
3428
+ isHfEditing: T(() => $.value !== null)
3248
3429
  });
3249
3430
  P(() => {
3250
- lr();
3431
+ ur();
3251
3432
  });
3252
- let { exposed: fr } = Vn({
3253
- editorView: X,
3254
- layout: ke,
3433
+ let { exposed: pr } = tr({
3434
+ editorView: Y,
3435
+ layout: Ae,
3255
3436
  pagesRef: d,
3256
3437
  pagesViewportRef: g,
3257
- zoom: Y,
3258
- comments: pe,
3438
+ zoom: J,
3439
+ comments: me,
3259
3440
  focus: Pe,
3260
- destroy: Fe,
3261
- getDocument: Z,
3262
- setZoom: be,
3263
- save: ht,
3264
- loadDocument: mt,
3265
- loadDocumentBuffer: pt,
3266
- addComment: qt,
3267
- replyToComment: Jt,
3268
- resolveComment: Yt,
3269
- proposeChange: Xt,
3270
- applyFormatting: At,
3271
- setParagraphStyle: jt,
3272
- scrollVisiblePositionIntoView: On,
3441
+ destroy: Ie,
3442
+ getDocument: X,
3443
+ setZoom: xe,
3444
+ save: pt,
3445
+ loadDocument: ft,
3446
+ loadDocumentBuffer: dt,
3447
+ addComment: Jt,
3448
+ replyToComment: Yt,
3449
+ resolveComment: Xt,
3450
+ proposeChange: Zt,
3451
+ applyFormatting: Et,
3452
+ setParagraphStyle: Ot,
3453
+ scrollVisiblePositionIntoView: yn,
3273
3454
  contentChangeSubscribers: x,
3274
- selectionChangeSubscribers: S,
3455
+ selectionChangeSubscribers: ee,
3275
3456
  onPrint: i.onPrint
3276
3457
  });
3277
- return n(fr), (t, n) => (I(), O("div", {
3458
+ return n(pr), (t, n) => (I(), O("div", {
3278
3459
  class: M([
3279
3460
  "docx-editor-vue ep-root paged-editor",
3280
3461
  e.className,
@@ -3287,15 +3468,15 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3287
3468
  ]),
3288
3469
  style: N(e.style)
3289
3470
  }, [
3290
- k("div", Un, [A(Mt, {
3471
+ k("div", rr, [A(Kt, {
3291
3472
  "show-menu-bar": e.showMenuBar,
3292
3473
  "document-name": e.documentName,
3293
3474
  "document-name-editable": e.documentNameEditable,
3294
3475
  "render-logo": e.renderLogo,
3295
3476
  "render-title-bar-right": e.renderTitleBarRight,
3296
- onRename: B(ut),
3297
- onMenuAction: B(ir),
3298
- onInsertTable: B(ar)
3477
+ onRename: B(lt),
3478
+ onMenuAction: B(Gn),
3479
+ onInsertTable: B(Kn)
3299
3480
  }, {
3300
3481
  "title-bar-left": U(() => [le(t.$slots, "title-bar-left")]),
3301
3482
  "title-bar-right": U(() => [le(t.$slots, "title-bar-right")]),
@@ -3309,35 +3490,35 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3309
3490
  "onRename",
3310
3491
  "onMenuAction",
3311
3492
  "onInsertTable"
3312
- ]), e.showToolbar ? (I(), ie(b, {
3493
+ ]), e.showToolbar ? (I(), E(b, {
3313
3494
  key: 0,
3314
- view: B(X),
3315
- "get-commands": B(Le),
3495
+ view: B(Y),
3496
+ "get-commands": B(Z),
3316
3497
  "state-tick": y.value,
3317
- "zoom-percent": B(_e),
3318
- "is-min-zoom": B(ve),
3319
- "is-max-zoom": B(ye),
3320
- "zoom-presets": B(Ee),
3498
+ "zoom-percent": B(ve),
3499
+ "is-min-zoom": B(ye),
3500
+ "is-max-zoom": B(be),
3501
+ "zoom-presets": B(De),
3321
3502
  "show-zoom-control": e.showZoomControl,
3322
3503
  "editor-mode": o.value,
3323
3504
  "comments-sidebar-open": W.value,
3324
3505
  "image-context": B(ln),
3325
3506
  theme: We.value,
3326
3507
  "font-families": e.fontFamilies,
3327
- onInsertLink: n[0] ||= (e) => re.value = !0,
3328
- onApplyStyle: B(Et),
3329
- onZoomIn: B(xe),
3330
- onZoomOut: B(Se),
3331
- onZoomSet: B(be),
3332
- onToggleSidebar: B(Gt),
3333
- onModeChange: cr,
3508
+ onInsertLink: n[0] ||= (e) => ie.value = !0,
3509
+ onApplyStyle: B(Ct),
3510
+ onZoomIn: B(Se),
3511
+ onZoomOut: B(Ce),
3512
+ onZoomSet: B(xe),
3513
+ onToggleSidebar: B(Wt),
3514
+ onModeChange: Xn,
3334
3515
  onImageWrapType: B(dn),
3335
3516
  onImageProperties: n[1] ||= (e) => j.value = !0,
3336
3517
  onImageTransform: B(fn)
3337
3518
  }, ae({
3338
3519
  "table-context": U(() => [A(h, {
3339
- view: B(X),
3340
- "get-commands": B(Le),
3520
+ view: B(Y),
3521
+ "get-commands": B(Z),
3341
3522
  "state-tick": y.value,
3342
3523
  theme: We.value
3343
3524
  }, null, 8, [
@@ -3349,7 +3530,7 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3349
3530
  _: 2
3350
3531
  }, [e.toolbarExtra ? {
3351
3532
  name: "toolbar-extra",
3352
- fn: U(() => [(I(), ie(ue(e.toolbarExtra)))]),
3533
+ fn: U(() => [(I(), E(ue(e.toolbarExtra)))]),
3353
3534
  key: "0"
3354
3535
  } : {
3355
3536
  name: "toolbar-extra",
@@ -3377,13 +3558,13 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3377
3558
  "onImageWrapType",
3378
3559
  "onImageTransform"
3379
3560
  ])) : D("", !0)]),
3380
- A(Nt, {
3381
- "show-find-replace": w.value,
3382
- "onUpdate:showFindReplace": n[2] ||= (e) => w.value = e,
3383
- "show-insert-image": T.value,
3384
- "onUpdate:showInsertImage": n[3] ||= (e) => T.value = e,
3385
- "show-hyperlink": re.value,
3386
- "onUpdate:showHyperlink": n[4] ||= (e) => re.value = e,
3561
+ A(qt, {
3562
+ "show-find-replace": C.value,
3563
+ "onUpdate:showFindReplace": n[2] ||= (e) => C.value = e,
3564
+ "show-insert-image": w.value,
3565
+ "onUpdate:showInsertImage": n[3] ||= (e) => w.value = e,
3566
+ "show-hyperlink": ie.value,
3567
+ "onUpdate:showHyperlink": n[4] ||= (e) => ie.value = e,
3387
3568
  "show-insert-symbol": oe.value,
3388
3569
  "onUpdate:showInsertSymbol": n[5] ||= (e) => oe.value = e,
3389
3570
  "show-image-properties": j.value,
@@ -3392,16 +3573,16 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3392
3573
  "onUpdate:showPageSetup": n[7] ||= (e) => se.value = e,
3393
3574
  "show-keyboard-shortcuts": V.value,
3394
3575
  "onUpdate:showKeyboardShortcuts": n[8] ||= (e) => V.value = e,
3395
- view: B(X),
3576
+ view: B(Y),
3396
3577
  bookmarks: Ze.value,
3397
3578
  "selected-image-pm-pos": B(sn)?.pmPos ?? null,
3398
- "section-properties": Ue.value,
3399
- "scroll-visible-position-into-view": B(On),
3579
+ "section-properties": He.value,
3580
+ "scroll-visible-position-into-view": B(yn),
3400
3581
  onInsertImage: B(un),
3401
- onInsertSymbol: B(kt),
3402
- onHyperlinkSubmit: B(_t),
3403
- onHyperlinkRemove: B(yt),
3404
- onPageSetupApply: B(Pt)
3582
+ onInsertSymbol: B(Tt),
3583
+ onHyperlinkSubmit: B(ht),
3584
+ onHyperlinkRemove: B(gt),
3585
+ onPageSetupApply: B(kt)
3405
3586
  }, null, 8, [
3406
3587
  "show-find-replace",
3407
3588
  "show-insert-image",
@@ -3421,8 +3602,8 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3421
3602
  "onHyperlinkRemove",
3422
3603
  "onPageSetupApply"
3423
3604
  ]),
3424
- B(Oe) ? (I(), O("div", Wn, z(B(Oe)), 1)) : D("", !0),
3425
- !B(De) && !B(Oe) ? (I(), O("div", Gn, "Loading...")) : D("", !0),
3605
+ B(ke) ? (I(), O("div", ir, z(B(ke)), 1)) : D("", !0),
3606
+ !B(Oe) && !B(ke) ? (I(), O("div", ar, "Loading...")) : D("", !0),
3426
3607
  k("div", {
3427
3608
  ref_key: "hiddenPmRef",
3428
3609
  ref: u,
@@ -3430,21 +3611,21 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3430
3611
  }, null, 512),
3431
3612
  k("div", {
3432
3613
  class: "docx-editor-vue__editor-scroll",
3433
- onMousedown: n[31] ||= (...e) => B(Kt) && B(Kt)(...e)
3434
- }, [e.showRuler && Ue.value ? (I(), O("div", {
3614
+ onMousedown: n[31] ||= (...e) => B(Gt) && B(Gt)(...e)
3615
+ }, [e.showRuler && He.value ? (I(), O("div", {
3435
3616
  key: 0,
3436
3617
  class: "docx-editor-vue__ruler-row",
3437
3618
  style: N(Je.value)
3438
3619
  }, [A(_, {
3439
- "section-props": Ue.value,
3440
- zoom: B(Y),
3620
+ "section-props": He.value,
3621
+ zoom: B(J),
3441
3622
  editable: !s.value,
3442
- onLeftMarginChange: B(Ft),
3443
- onRightMarginChange: B(It),
3444
- onIndentLeftChange: B(zt),
3445
- onIndentRightChange: B(Bt),
3446
- onFirstLineIndentChange: B(Vt),
3447
- onTabStopRemove: B(Ht)
3623
+ onLeftMarginChange: B(At),
3624
+ onRightMarginChange: B(jt),
3625
+ onIndentLeftChange: B(Lt),
3626
+ onIndentRightChange: B(Rt),
3627
+ onFirstLineIndentChange: B(zt),
3628
+ onTabStopRemove: B(Bt)
3448
3629
  }, null, 8, [
3449
3630
  "section-props",
3450
3631
  "zoom",
@@ -3455,24 +3636,24 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3455
3636
  "onIndentRightChange",
3456
3637
  "onFirstLineIndentChange",
3457
3638
  "onTabStopRemove"
3458
- ])], 4)) : D("", !0), k("div", Kn, [
3639
+ ])], 4)) : D("", !0), k("div", or, [
3459
3640
  k("div", {
3460
3641
  ref_key: "pagesViewportRef",
3461
3642
  ref: g,
3462
3643
  class: "docx-editor-vue__pages-viewport",
3463
- onMousedown: n[22] ||= (...e) => B(kn) && B(kn)(...e),
3464
- onMousemove: n[23] ||= (...e) => B(An) && B(An)(...e),
3465
- onClick: n[24] ||= (...e) => B(jn) && B(jn)(...e),
3466
- onDblclick: n[25] ||= (...e) => B(Mn) && B(Mn)(...e),
3467
- onContextmenu: n[26] ||= K((...e) => B(er) && B(er)(...e), ["prevent"]),
3468
- onWheel: n[27] ||= (...e) => B(Ce) && B(Ce)(...e)
3644
+ onMousedown: n[22] ||= (...e) => B(bn) && B(bn)(...e),
3645
+ onMousemove: n[23] ||= (...e) => B(xn) && B(xn)(...e),
3646
+ onClick: n[24] ||= (...e) => B(Sn) && B(Sn)(...e),
3647
+ onDblclick: n[25] ||= (...e) => B(Cn) && B(Cn)(...e),
3648
+ onContextmenu: n[26] ||= K((...e) => B(zn) && B(zn)(...e), ["prevent"]),
3649
+ onWheel: n[27] ||= (...e) => B(we) && B(we)(...e)
3469
3650
  }, [
3470
- e.showRuler && Ue.value ? (I(), O("div", qn, [A(p, {
3471
- "section-props": Ue.value,
3472
- zoom: B(Y),
3651
+ e.showRuler && He.value ? (I(), O("div", sr, [A(p, {
3652
+ "section-props": He.value,
3653
+ zoom: B(J),
3473
3654
  editable: !s.value,
3474
- onTopMarginChange: B(Lt),
3475
- onBottomMarginChange: B(Rt)
3655
+ onTopMarginChange: B(Pt),
3656
+ onBottomMarginChange: B(Ft)
3476
3657
  }, null, 8, [
3477
3658
  "section-props",
3478
3659
  "zoom",
@@ -3486,14 +3667,19 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3486
3667
  class: "docx-editor-vue__pages paged-editor__pages",
3487
3668
  style: N(qe.value)
3488
3669
  }, null, 4),
3489
- A(Dt, {
3670
+ s.value ? D("", !0) : (I(), E(Vt, {
3671
+ key: 1,
3672
+ container: d.value,
3673
+ view: B(Y)
3674
+ }, null, 8, ["container", "view"])),
3675
+ A(It, {
3490
3676
  "is-open": B($) !== null,
3491
3677
  position: B($)?.position ?? "header",
3492
3678
  view: Ke.value,
3493
3679
  "target-rect": B($)?.targetRect ?? null,
3494
- onSave: B(In),
3680
+ onSave: B(Nn),
3495
3681
  onClose: n[9] ||= (e) => $.value = null,
3496
- onRemove: B(Xn)
3682
+ onRemove: B(Fn)
3497
3683
  }, null, 8, [
3498
3684
  "is-open",
3499
3685
  "position",
@@ -3503,7 +3689,7 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3503
3689
  "onRemove"
3504
3690
  ]),
3505
3691
  B($) && Ge.value ? (I(), O("div", {
3506
- key: 1,
3692
+ key: 2,
3507
3693
  "aria-hidden": "true",
3508
3694
  style: N({
3509
3695
  position: "fixed",
@@ -3517,34 +3703,34 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3517
3703
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3518
3704
  })
3519
3705
  }, null, 4)) : D("", !0),
3520
- A(vt, {
3706
+ A(Dt, {
3521
3707
  "image-info": B(sn),
3522
- zoom: B(Y),
3523
- view: B(X),
3708
+ zoom: B(J),
3709
+ view: B(Y),
3524
3710
  onOpenProperties: n[10] ||= (e) => j.value = !0,
3525
3711
  onDeselect: n[11] ||= (e) => sn.value = null,
3526
3712
  onInteractStart: n[12] ||= (e) => cn.value = !0,
3527
3713
  onInteractEnd: n[13] ||= (e) => cn.value = !1,
3528
- onContextMenu: B(tr)
3714
+ onContextMenu: B(Hn)
3529
3715
  }, null, 8, [
3530
3716
  "image-info",
3531
3717
  "zoom",
3532
3718
  "view",
3533
3719
  "onContextMenu"
3534
3720
  ]),
3535
- A(dt, {
3536
- "get-view": or,
3537
- "get-pages-container": sr,
3538
- zoom: B(Y),
3721
+ A(bt, {
3722
+ "get-view": qn,
3723
+ "get-pages-container": Jn,
3724
+ zoom: B(J),
3539
3725
  "transaction-version": y.value,
3540
- "sync-coordinator": B(ee)
3726
+ "sync-coordinator": B(te)
3541
3727
  }, null, 8, [
3542
3728
  "zoom",
3543
3729
  "transaction-version",
3544
3730
  "sync-coordinator"
3545
3731
  ]),
3546
3732
  B(Qe) && !G.value && !s.value ? (I(), O("button", {
3547
- key: 2,
3733
+ key: 3,
3548
3734
  type: "button",
3549
3735
  class: "docx-editor-vue__floating-comment",
3550
3736
  style: N({
@@ -3556,9 +3742,9 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3556
3742
  }, [A(c, {
3557
3743
  name: "add_comment",
3558
3744
  size: 16
3559
- })], 44, Jn)) : D("", !0),
3745
+ })], 44, cr)) : D("", !0),
3560
3746
  B(Q) && !s.value ? (I(), O("button", {
3561
- key: 3,
3747
+ key: 4,
3562
3748
  type: "button",
3563
3749
  class: "docx-editor-vue__table-insert-btn",
3564
3750
  style: N({
@@ -3567,8 +3753,8 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3567
3753
  }),
3568
3754
  title: B(Q).type === "row" ? "Insert row below" : "Insert column to the right",
3569
3755
  "aria-label": B(Q).type === "row" ? "Insert row below" : "Insert column to the right",
3570
- onMousedown: n[15] ||= (...e) => B(Nn) && B(Nn)(...e),
3571
- onMouseenter: n[16] ||= (...e) => B(Pn) && B(Pn)(...e),
3756
+ onMousedown: n[15] ||= (...e) => B(wn) && B(wn)(...e),
3757
+ onMouseenter: n[16] ||= (...e) => B(Tn) && B(Tn)(...e),
3572
3758
  onMouseleave: n[17] ||= (e) => Q.value = null
3573
3759
  }, [...n[36] ||= [k("svg", {
3574
3760
  width: "12",
@@ -3580,11 +3766,11 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3580
3766
  stroke: "currentColor",
3581
3767
  "stroke-width": "1.5",
3582
3768
  "stroke-linecap": "round"
3583
- })], -1)]], 44, Yn)) : D("", !0),
3769
+ })], -1)]], 44, lr)) : D("", !0),
3584
3770
  A(v, {
3585
- comments: pe.value,
3771
+ comments: me.value,
3586
3772
  "pages-container": d.value,
3587
- zoom: B(Y),
3773
+ zoom: B(J),
3588
3774
  "page-width-px": Ye.value,
3589
3775
  "sidebar-open": W.value,
3590
3776
  "resolved-comment-ids": Xe.value,
@@ -3600,28 +3786,28 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3600
3786
  ]),
3601
3787
  A(m, {
3602
3788
  "is-open": W.value,
3603
- comments: pe.value,
3604
- "tracked-changes": he.value,
3789
+ comments: me.value,
3790
+ "tracked-changes": ge.value,
3605
3791
  "is-adding-comment": G.value,
3606
3792
  "add-comment-y-position": B(et),
3607
3793
  "show-resolved": !0,
3608
3794
  "pages-container": d.value,
3609
3795
  "page-width-px": Ye.value,
3610
- zoom: B(Y),
3611
- "active-item-id": q.value,
3796
+ zoom: B(J),
3797
+ "active-item-id": fe.value,
3612
3798
  onClose: n[18] ||= (e) => W.value = !1,
3613
3799
  onAddComment: B(rt),
3614
3800
  onCancelAddComment: B(it),
3615
- onCommentReply: B(Zt),
3616
- onCommentResolve: B(Yt),
3617
- onCommentUnresolve: B(Qt),
3618
- onCommentDelete: B($t),
3619
- onAcceptChange: B(en),
3620
- onRejectChange: B(tn),
3621
- onAcceptChangeById: B(nn),
3801
+ onCommentReply: B(Qt),
3802
+ onCommentResolve: B(Xt),
3803
+ onCommentUnresolve: B($t),
3804
+ onCommentDelete: B(en),
3805
+ onAcceptChange: B(tn),
3806
+ onRejectChange: B(nn),
3807
+ onAcceptChangeById: B(rn),
3622
3808
  onRejectChangeById: B(an),
3623
3809
  onTrackedChangeReply: B(on),
3624
- "onUpdate:activeItemId": n[19] ||= (e) => q.value = e
3810
+ "onUpdate:activeItemId": n[19] ||= (e) => fe.value = e
3625
3811
  }, null, 8, [
3626
3812
  "is-open",
3627
3813
  "comments",
@@ -3644,14 +3830,14 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3644
3830
  "onRejectChangeById",
3645
3831
  "onTrackedChangeReply"
3646
3832
  ]),
3647
- A(mn, {
3648
- data: B(gt),
3833
+ A(En, {
3834
+ data: B(mt),
3649
3835
  "read-only": s.value,
3650
- onNavigate: B(bt),
3651
- onCopy: n[20] ||= (e) => gt.value = null,
3652
- onEdit: B(xt),
3653
- onRemove: B(St),
3654
- onClose: n[21] ||= (e) => gt.value = null
3836
+ onNavigate: B(_t),
3837
+ onCopy: n[20] ||= (e) => mt.value = null,
3838
+ onEdit: B(yt),
3839
+ onRemove: B(xt),
3840
+ onClose: n[21] ||= (e) => mt.value = null
3655
3841
  }, null, 8, [
3656
3842
  "data",
3657
3843
  "read-only",
@@ -3665,27 +3851,27 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3665
3851
  type: "button",
3666
3852
  class: "docx-editor-vue__outline-toggle",
3667
3853
  title: "Show document outline",
3668
- onClick: n[28] ||= (...e) => B(Ut) && B(Ut)(...e),
3854
+ onClick: n[28] ||= (...e) => B(Ht) && B(Ht)(...e),
3669
3855
  onMousedown: n[29] ||= K(() => {}, ["stop"])
3670
3856
  }, [A(c, {
3671
3857
  name: "format_list_bulleted",
3672
3858
  size: 20
3673
3859
  })], 32)) : D("", !0),
3674
- B(Cn).totalPages > 1 ? (I(), ie(wt, {
3860
+ B(hn).totalPages > 1 ? (I(), E(Nt, {
3675
3861
  key: 1,
3676
- "current-page": B(Cn).currentPage,
3677
- "total-pages": B(Cn).totalPages,
3678
- visible: B(Cn).visible
3862
+ "current-page": B(hn).currentPage,
3863
+ "total-pages": B(hn).totalPages,
3864
+ visible: B(hn).visible
3679
3865
  }, null, 8, [
3680
3866
  "current-page",
3681
3867
  "total-pages",
3682
3868
  "visible"
3683
3869
  ])) : D("", !0),
3684
- A(Ct, {
3870
+ A(Mt, {
3685
3871
  "is-open": R.value,
3686
- headings: J.value,
3872
+ headings: q.value,
3687
3873
  onClose: n[30] ||= (e) => R.value = !1,
3688
- onNavigate: B(Wt)
3874
+ onNavigate: B(Ut)
3689
3875
  }, null, 8, [
3690
3876
  "is-open",
3691
3877
  "headings",
@@ -3700,16 +3886,16 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3700
3886
  style: { display: "none" },
3701
3887
  onChange: n[32] ||= (...e) => B(ct) && B(ct)(...e)
3702
3888
  }, null, 544),
3703
- A(rn, {
3889
+ A(gn, {
3704
3890
  "read-only": s.value,
3705
- "context-menu": B(Zn),
3706
- "image-context-menu": B(Qn),
3707
- "image-context-menu-text-actions": B($n),
3891
+ "context-menu": B(In),
3892
+ "image-context-menu": B(Ln),
3893
+ "image-context-menu-text-actions": B(Rn),
3708
3894
  "can-open-image-properties": !!B(sn),
3709
- onContextMenuAction: B(rr),
3710
- onCloseContextMenu: n[33] ||= (e) => B(Zn).isOpen = !1,
3711
- onImageWrapSelect: B(nr),
3712
- onCloseImageContextMenu: n[34] ||= (e) => Qn.value = null,
3895
+ onContextMenuAction: B(Wn),
3896
+ onCloseContextMenu: n[33] ||= (e) => B(In).isOpen = !1,
3897
+ onImageWrapSelect: B(Un),
3898
+ onCloseImageContextMenu: n[34] ||= (e) => Ln.value = null,
3713
3899
  onOpenImageProperties: n[35] ||= (e) => j.value = !0
3714
3900
  }, null, 8, [
3715
3901
  "read-only",
@@ -3725,8 +3911,8 @@ var Un = { class: "docx-editor-vue__toolbar-shell" }, Wn = {
3725
3911
  });
3726
3912
  //#endregion
3727
3913
  //#region src/renderAsync.ts
3728
- async function Zn(e, t, n = {}) {
3729
- let r = e instanceof ArrayBuffer ? e : await Se(e), i = null, a = null, o = !1, s = {
3914
+ async function dr(e, t, n = {}) {
3915
+ let r = e instanceof ArrayBuffer ? e : await Ce(e), i = null, a = null, o = !1, s = {
3730
3916
  save: async () => {
3731
3917
  let e = await (i?.save() ?? Promise.resolve(null));
3732
3918
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -3747,8 +3933,8 @@ async function Zn(e, t, n = {}) {
3747
3933
  }
3748
3934
  };
3749
3935
  return new Promise((e, c) => {
3750
- a = re({ setup() {
3751
- return () => se(Xn, {
3936
+ a = ie({ setup() {
3937
+ return () => se(ur, {
3752
3938
  ...n,
3753
3939
  documentBuffer: r,
3754
3940
  showToolbar: n.showToolbar ?? !0,
@@ -3772,6 +3958,6 @@ async function Zn(e, t, n = {}) {
3772
3958
  }
3773
3959
  //#endregion
3774
3960
  //#region src/index.ts
3775
- var Qn = "0.0.2";
3961
+ var fr = "0.0.2";
3776
3962
  //#endregion
3777
- export { Xn as DocxEditor, Qn as VERSION, nt as createDocumentWithText, rt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, Zn as renderAsync, n as useTranslation };
3963
+ export { ur as DocxEditor, fr as VERSION, dt as createDocumentWithText, ft as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, dr as renderAsync, n as useTranslation };