@bireturn/word-editor 1.0.11 → 1.0.12

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.
@@ -1,7 +1,7 @@
1
1
  var mn = Object.defineProperty;
2
2
  var yn = (t, e, n) => e in t ? mn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var N = (t, e, n) => yn(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { computed as de, ref as te, onMounted as _t, onUnmounted as rt, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as ne, Fragment as G, renderList as Q, normalizeClass as Pe, createBlock as Fe, resolveDynamicComponent as at, toDisplayString as Y, unref as K, createCommentVNode as ve, render as Ut, h as bn, defineComponent as _n, getCurrentInstance as xn, watch as Ke, nextTick as Se, createVNode as q, createTextVNode as Le, isVNode as kn, renderSlot as wn, resolveComponent as Cn, inject as mt, withCtx as qe, provide as yt, createSlots as Mn, reactive as qt } from "vue";
4
+ import { computed as de, ref as te, onMounted as _t, onUnmounted as rt, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as ne, Fragment as G, renderList as Q, normalizeClass as Pe, createBlock as Fe, resolveDynamicComponent as at, toDisplayString as Z, unref as K, createCommentVNode as ve, render as Ut, h as bn, defineComponent as _n, getCurrentInstance as xn, watch as Ue, nextTick as Se, createVNode as q, createTextVNode as Le, isVNode as kn, renderSlot as wn, resolveComponent as Cn, inject as mt, withCtx as We, provide as yt, createSlots as Mn, reactive as qt } from "vue";
5
5
  import { DynamicScroller as In, DynamicScrollerItem as En } from "vue-virtual-scroller";
6
6
  import { ChevronRight as Wt, MoreHorizontal as It, Download as ht, Upload as Sn, Save as Fn, RotateCcw as Tn, History as An, Settings as Pn, Info as $n, Globe as Ln, Lock as Rn, Share as Hn, ShieldCheck as On, Search as Bn, Filter as Dn, SortDesc as zn, SortAsc as Nn, Minus as Vn, Plus as Et, Eye as St, FileText as ft, Grid as jn, Type as Ft, FileDown as Tt, Layers as At, Edit as Kn, Move as Un, Copy as qn, Trash2 as Pt, Clipboard as $t, PlusCircle as Lt, ArrowDown as Rt, Navigation as Ht, ChevronDown as Wn, PanelLeftOpen as Gn, ListTree as Jn, PanelLeftClose as Xn } from "lucide-vue-next";
7
7
  const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" }, Zn = ["onMouseenter", "onMouseleave"], Qn = ["onClick"], ei = { class: "we-vt-context-menu--link-content menu-label" }, ti = {
@@ -31,38 +31,38 @@ const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
31
31
  emits: ["close", "menuClick"],
32
32
  setup(t, { emit: e }) {
33
33
  const n = e, l = t, o = de(() => {
34
- var D, T;
34
+ var D, A;
35
35
  return {
36
36
  left: `${(D = l.e) == null ? void 0 : D.pageX}px`,
37
- top: `${(T = l.e) == null ? void 0 : T.pageY}px`
37
+ top: `${(A = l.e) == null ? void 0 : A.pageY}px`
38
38
  };
39
39
  }), s = te([]), v = te(null);
40
40
  let m = null;
41
- const y = te(), r = (D, T, h) => {
41
+ const y = te(), r = (D, A, h) => {
42
42
  if (D.children && D.children.length > 0) {
43
- T && T.preventDefault() && T.stopPropagation();
43
+ A && A.preventDefault() && A.stopPropagation();
44
44
  return;
45
45
  }
46
- D.disabled || (h ? n("menuClick", { ...D, parent: h.code }, l.row) : n("menuClick", D, l.row)), T && T.preventDefault() && T.stopPropagation();
47
- }, M = (D) => {
48
- let T = D.target;
49
- for (; T && T != y.value; )
50
- T = T.parentNode;
51
- T != y.value && n("close");
52
- }, x = (D, T) => {
53
- D.currentTarget.classList.add("link--active"), m && (clearTimeout(m), m = null), T.children && T.children.length > 0 ? v.value = T.code : m = setTimeout(() => {
46
+ D.disabled || (h ? n("menuClick", { ...D, parent: h.code }, l.row) : n("menuClick", D, l.row)), A && A.preventDefault() && A.stopPropagation();
47
+ }, E = (D) => {
48
+ let A = D.target;
49
+ for (; A && A != y.value; )
50
+ A = A.parentNode;
51
+ A != y.value && n("close");
52
+ }, b = (D, A) => {
53
+ D.currentTarget.classList.add("link--active"), m && (clearTimeout(m), m = null), A.children && A.children.length > 0 ? v.value = A.code : m = setTimeout(() => {
54
54
  v.value = null;
55
55
  }, 100);
56
- }, $ = (D, T) => {
57
- D.currentTarget.classList.remove("link--active"), T.children && T.children.length > 0 && (m = setTimeout(() => {
58
- v.value === T.code && (v.value = null);
56
+ }, T = (D, A) => {
57
+ D.currentTarget.classList.remove("link--active"), A.children && A.children.length > 0 && (m = setTimeout(() => {
58
+ v.value === A.code && (v.value = null);
59
59
  }, 300));
60
60
  }, B = (D) => {
61
61
  m && (clearTimeout(m), m = null), D.currentTarget.classList.add("link--active");
62
62
  }, W = (D) => {
63
63
  D.currentTarget.classList.remove("link--active");
64
- }, I = (D) => {
65
- const T = D.code || "", h = (D.name || "").toLowerCase(), F = {
64
+ }, M = (D) => {
65
+ const A = D.code || "", h = (D.name || "").toLowerCase(), F = {
66
66
  // 添加操作 - 根据具体类型使用不同图标
67
67
  "add-current": Ht,
68
68
  // 添加(当前位置)
@@ -142,17 +142,17 @@ const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
142
142
  more: It
143
143
  // 更多
144
144
  };
145
- return F[T] ? F[T] : h.includes("添加") || h.includes("add") ? h.includes("当前") || h.includes("current") ? Ht : h.includes("下") || h.includes("next") ? Rt : h.includes("子") || h.includes("child") ? Lt : Et : h.includes("导出") || h.includes("export") ? h.includes("节") || h.includes("section") ? At : h.includes("章") || h.includes("chapter") ? Tt : ht : h.includes("粘贴") || h.includes("paste") ? $t : h.includes("删除") || h.includes("delete") ? Pt : h.includes("pdf") ? ft : h.includes("word") ? Ft : It;
145
+ return F[A] ? F[A] : h.includes("添加") || h.includes("add") ? h.includes("当前") || h.includes("current") ? Ht : h.includes("下") || h.includes("next") ? Rt : h.includes("子") || h.includes("child") ? Lt : Et : h.includes("导出") || h.includes("export") ? h.includes("节") || h.includes("section") ? At : h.includes("章") || h.includes("chapter") ? Tt : ht : h.includes("粘贴") || h.includes("paste") ? $t : h.includes("删除") || h.includes("delete") ? Pt : h.includes("pdf") ? ft : h.includes("word") ? Ft : It;
146
146
  };
147
147
  return _t(() => {
148
- var D, T, h, F, P, E, X;
149
- (D = l.menuConfig) != null && D.visibleMethod && typeof ((T = l.menuConfig) == null ? void 0 : T.visibleMethod) == "function" && ((P = l.menuConfig) == null || P.visibleMethod({
148
+ var D, A, h, F, $, I, Y;
149
+ (D = l.menuConfig) != null && D.visibleMethod && typeof ((A = l.menuConfig) == null ? void 0 : A.visibleMethod) == "function" && (($ = l.menuConfig) == null || $.visibleMethod({
150
150
  options: (F = (h = l.menuConfig) == null ? void 0 : h.body) == null ? void 0 : F.options,
151
151
  row: l.row
152
- })), s.value = (((X = (E = l.menuConfig) == null ? void 0 : E.body) == null ? void 0 : X.options) || []).flat(), document.addEventListener("click", M, !0);
152
+ })), s.value = (((Y = (I = l.menuConfig) == null ? void 0 : I.body) == null ? void 0 : Y.options) || []).flat(), document.addEventListener("click", E, !0);
153
153
  }), rt(() => {
154
- document.removeEventListener("click", M, !0);
155
- }), (D, T) => (u(), g("div", {
154
+ document.removeEventListener("click", E, !0);
155
+ }), (D, A) => (u(), g("div", {
156
156
  class: "we-vt-table--context-menu-wrapper virtual-table-menu modern-virtual-menu",
157
157
  ref_key: "contextMenuRef",
158
158
  ref: y,
@@ -166,18 +166,18 @@ const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
166
166
  "modern-menu-item": !0
167
167
  }),
168
168
  key: h.code,
169
- onMouseenter: (F) => x(F, h),
170
- onMouseleave: (F) => $(F, h)
169
+ onMouseenter: (F) => b(F, h),
170
+ onMouseleave: (F) => T(F, h)
171
171
  }, [
172
172
  ne("a", {
173
173
  class: "we-vt-context-menu--link modern-menu-link",
174
174
  onClick: (F) => r(h, F)
175
175
  }, [
176
- (u(), Fe(at(I(h)), {
176
+ (u(), Fe(at(M(h)), {
177
177
  size: 16,
178
178
  class: "menu-icon"
179
179
  })),
180
- ne("span", ei, Y(h.name), 1),
180
+ ne("span", ei, Z(h.name), 1),
181
181
  h.children && h.children.length > 0 ? (u(), Fe(K(Wt), {
182
182
  key: 0,
183
183
  size: 14,
@@ -196,13 +196,13 @@ const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
196
196
  }, [
197
197
  ne("a", {
198
198
  class: "we-vt-context-menu--link modern-submenu-link",
199
- onClick: (P) => r(F, P, h)
199
+ onClick: ($) => r(F, $, h)
200
200
  }, [
201
- (u(), Fe(at(I(F)), {
201
+ (u(), Fe(at(M(F)), {
202
202
  size: 14,
203
203
  class: "submenu-icon"
204
204
  })),
205
- ne("span", ii, Y(F.name), 1)
205
+ ne("span", ii, Z(F.name), 1)
206
206
  ], 8, ni)
207
207
  ], 34))), 128))
208
208
  ])) : ve("", !0)
@@ -234,36 +234,36 @@ function ci(t, e, n) {
234
234
  if (!(t != null && t.length))
235
235
  return t;
236
236
  const v = {};
237
- t.forEach((M) => {
238
- const x = M[o];
239
- v[x] || (v[x] = []), v[x].push(M);
237
+ t.forEach((E) => {
238
+ const b = E[o];
239
+ v[b] || (v[b] = []), v[b].push(E);
240
240
  });
241
- function m(M) {
242
- const x = v[M] || [];
243
- x.sort(
241
+ function m(E) {
242
+ const b = v[E] || [];
243
+ b.sort(
244
244
  (B, W) => B[s] && W[s] ? B[s] - W[s] : 0
245
245
  );
246
- const $ = [];
247
- return x.forEach((B) => {
248
- $.push(B), $.push(...m(B[l]));
249
- }), $;
246
+ const T = [];
247
+ return b.forEach((B) => {
248
+ T.push(B), T.push(...m(B[l]));
249
+ }), T;
250
250
  }
251
251
  let y = [];
252
252
  if (Array.isArray(e))
253
253
  y = e;
254
254
  else {
255
- const M = new Set(t.map((B) => B[l])), x = t.filter((B) => !M.has(B[o]));
256
- if (x.length === 0)
255
+ const E = new Set(t.map((B) => B[l])), b = t.filter((B) => !E.has(B[o]));
256
+ if (b.length === 0)
257
257
  throw new Error("无法确定根节点:可能存在循环引用或数据不完整");
258
- const $ = {};
259
- x.forEach((B) => {
258
+ const T = {};
259
+ b.forEach((B) => {
260
260
  const W = B[o];
261
- $[W] = ($[W] || 0) + 1;
262
- }), y = Object.entries($).map(([B]) => B);
261
+ T[W] = (T[W] || 0) + 1;
262
+ }), y = Object.entries(T).map(([B]) => B);
263
263
  }
264
264
  let r = [];
265
- return y.forEach((M) => {
266
- r = r.concat(m(M));
265
+ return y.forEach((E) => {
266
+ r = r.concat(m(E));
267
267
  }), r;
268
268
  }
269
269
  function Ot(t, e, n) {
@@ -362,24 +362,24 @@ const ui = /* @__PURE__ */ _n({
362
362
  }) {
363
363
  var Mt;
364
364
  const o = xn(), s = te(), v = te(!1), m = te(null), y = te(null), r = te([]);
365
- let M = /* @__PURE__ */ new Map();
366
- const x = /* @__PURE__ */ new Map();
365
+ let E = /* @__PURE__ */ new Map();
366
+ const b = /* @__PURE__ */ new Map();
367
367
  te(0);
368
- const $ = te([]);
368
+ const T = te([]);
369
369
  te([]);
370
- const B = te(/* @__PURE__ */ new Set()), W = te(/* @__PURE__ */ new Set()), I = te(null), D = 2, T = /* @__PURE__ */ new WeakMap(), h = te(null), F = te(""), P = /* @__PURE__ */ new Set(), E = de(() => {
370
+ const B = te(/* @__PURE__ */ new Set()), W = te(/* @__PURE__ */ new Set()), M = te(null), D = 2, A = /* @__PURE__ */ new WeakMap(), h = te(null), F = te(""), $ = /* @__PURE__ */ new Set(), I = de(() => {
371
371
  try {
372
372
  return Array.isArray(r.value) ? r.value : [];
373
373
  } catch {
374
374
  return [];
375
375
  }
376
- }), X = (i) => {
376
+ }), Y = (i) => {
377
377
  var p, d, f;
378
378
  if (!i) return 30;
379
379
  if (i.height) return i.height;
380
380
  const a = `${i.content_type}_${((p = i.content) == null ? void 0 : p.length) || 0}_${((d = i.title) == null ? void 0 : d.length) || 0}_${i._editing ? 1 : 0}`;
381
- if (T.has(i)) {
382
- const k = T.get(i);
381
+ if (A.has(i)) {
382
+ const k = A.get(i);
383
383
  if (k.key === a)
384
384
  return k.height;
385
385
  }
@@ -399,20 +399,20 @@ const ui = /* @__PURE__ */ _n({
399
399
  c = 200;
400
400
  break;
401
401
  default: {
402
- const b = (i.content || "").length, _ = (i.title || "").length, C = b + _, A = ((f = (i.content || "").match(/[\u4e00-\u9fa5]/g)) == null ? void 0 : f.length) || 0, R = C - A, S = A * 12 + R * 6, L = Math.max(1, Math.ceil(S / 760));
403
- c = Math.max(20, L * 18), i._editing && (c += 20);
402
+ const _ = (i.content || "").length, x = (i.title || "").length, C = _ + x, P = ((f = (i.content || "").match(/[一-龥]/g)) == null ? void 0 : f.length) || 0, L = ((i.content || "").match(/[A-Za-z0-9]/g) || []).length, S = C - P - L, R = P * 12 + L * 7 + S * 4, X = Math.max(1, Math.ceil(R / 760));
403
+ c = Math.max(20, X * 18), i._editing && (c += 20);
404
404
  break;
405
405
  }
406
406
  }
407
- return T.set(i, {
407
+ return A.set(i, {
408
408
  key: a,
409
409
  height: c
410
410
  }), c;
411
411
  }, ue = de(() => {
412
- if (E.value.length === 0) return 30;
413
- const i = E.value.slice(0, Math.min(100, E.value.length));
412
+ if (I.value.length === 0) return 30;
413
+ const i = I.value.slice(0, Math.min(100, I.value.length));
414
414
  if (i.length === 0) return 30;
415
- const a = i.reduce((p, d) => p + X(d), 0) / i.length, c = Math.max(20, Math.floor(a * 0.6));
415
+ const a = i.reduce((p, d) => p + Y(d), 0) / i.length, c = Math.max(20, Math.floor(a * 0.6));
416
416
  return Math.min(c, 60);
417
417
  });
418
418
  let z;
@@ -429,10 +429,10 @@ const ui = /* @__PURE__ */ _n({
429
429
  for (; a && (a != null && a.getAttribute) && !(a != null && a.getAttribute("data-id")) && a !== ((f = s.value) == null ? void 0 : f.$el); )
430
430
  a = a.parentNode;
431
431
  if ((k = a == null ? void 0 : a.getAttribute) != null && k.call(a, "data-id")) {
432
- const w = a.getAttribute("data-id"), b = Ae(w);
433
- b && (z = ri({
432
+ const w = a.getAttribute("data-id"), _ = Ae(w);
433
+ _ && (z = ri({
434
434
  e: i,
435
- row: b,
435
+ row: _,
436
436
  menuConfig: t.menuConfig,
437
437
  onMenuClick: ie
438
438
  }), i.preventDefault(), i.stopPropagation());
@@ -451,7 +451,7 @@ const ui = /* @__PURE__ */ _n({
451
451
  $table: o == null ? void 0 : o.exposed
452
452
  }), m.value = null);
453
453
  };
454
- ((Mt = t.editConfig) == null ? void 0 : Mt.trigger) === "dblclick" && Ke(() => m.value, (i) => {
454
+ ((Mt = t.editConfig) == null ? void 0 : Mt.trigger) === "dblclick" && Ue(() => m.value, (i) => {
455
455
  document.removeEventListener("click", Je, !0), i && setTimeout(() => {
456
456
  document.addEventListener("click", Je, !0);
457
457
  }, 200);
@@ -466,7 +466,7 @@ const ui = /* @__PURE__ */ _n({
466
466
  };
467
467
  })), he = () => {
468
468
  if (!t.pageConfig.enabled) {
469
- $.value = [{
469
+ T.value = [{
470
470
  items: r.value,
471
471
  startIndex: 0,
472
472
  endIndex: r.value.length
@@ -480,43 +480,43 @@ const ui = /* @__PURE__ */ _n({
480
480
  }), Object.keys(t.pageData).sort((d, f) => parseInt(d) - parseInt(f)).forEach((d) => {
481
481
  const f = t.pageData[d], k = [];
482
482
  f.forEach((w) => {
483
- const b = c.get(String(w));
484
- b && k.push(b);
483
+ const _ = c.get(String(w));
484
+ _ && k.push(_);
485
485
  }), k.length > 0 && i.push({
486
486
  items: k,
487
487
  pageNumber: parseInt(d),
488
- height: k.reduce((w, b) => w + X(b), 0)
488
+ height: k.reduce((w, _) => w + Y(_), 0)
489
489
  });
490
- }), $.value = i;
490
+ }), T.value = i;
491
491
  } else {
492
492
  const {
493
493
  pageHeight: i,
494
494
  margin: a,
495
495
  headerHeight: c = 0
496
496
  } = t.pageConfig, d = Math.max(100, i - a * 2 - c - 20), f = [];
497
- let k = [], w = 0, b = 0, _ = 1;
498
- r.value.forEach((C, A) => {
499
- const R = X(C);
497
+ let k = [], w = 0, _ = 0, x = 1;
498
+ r.value.forEach((C, P) => {
499
+ const L = Y(C);
500
500
  (C.layer || 0) <= 2 && k.length > 0 ? (f.push({
501
501
  items: [...k],
502
- startIndex: b,
503
- endIndex: A,
502
+ startIndex: _,
503
+ endIndex: P,
504
504
  height: w,
505
- pageNumber: _++
506
- }), k = [C], w = R, b = A) : w + R > d && k.length > 0 ? (f.push({
505
+ pageNumber: x++
506
+ }), k = [C], w = L, _ = P) : w + L > d && k.length > 0 ? (f.push({
507
507
  items: [...k],
508
- startIndex: b,
509
- endIndex: A,
508
+ startIndex: _,
509
+ endIndex: P,
510
510
  height: w,
511
- pageNumber: _++
512
- }), k = [C], w = Math.min(R, d), b = A) : (k.push(C), w += R);
511
+ pageNumber: x++
512
+ }), k = [C], w = Math.min(L, d), _ = P) : (k.push(C), w += L);
513
513
  }), k.length > 0 && f.push({
514
514
  items: k,
515
- startIndex: b,
515
+ startIndex: _,
516
516
  endIndex: r.value.length,
517
517
  height: w,
518
- pageNumber: _
519
- }), $.value = f;
518
+ pageNumber: x
519
+ }), T.value = f;
520
520
  }
521
521
  }, me = () => {
522
522
  try {
@@ -525,38 +525,38 @@ const ui = /* @__PURE__ */ _n({
525
525
  return;
526
526
  F.value = a;
527
527
  const p = (t.treeConfig ? ci(i, void 0, t.treeConfig) : i).map((f, k) => {
528
- const w = f[t.rowConfig.keyField], b = x.get(w);
529
- if (!b || b.content !== f.content || b.content_type !== f.content_type) {
530
- P.add(w);
531
- const _ = {
528
+ const w = f[t.rowConfig.keyField], _ = b.get(w);
529
+ if (!_ || _.content !== f.content || _.content_type !== f.content_type) {
530
+ $.add(w);
531
+ const x = {
532
532
  ...f,
533
533
  index: k,
534
534
  _editing: f._editing || !1,
535
- _original: (b == null ? void 0 : b._original) || {
535
+ _original: (_ == null ? void 0 : _._original) || {
536
536
  ...f
537
537
  }
538
538
  // 保留原始数据,避免重复深拷贝
539
539
  };
540
- return x.set(w, _), _;
540
+ return b.set(w, x), x;
541
541
  }
542
- return b.index = k, b;
542
+ return _.index = k, _;
543
543
  });
544
544
  r.value = p, he();
545
545
  const d = new Set(p.map((f) => f[t.rowConfig.keyField]));
546
- for (const [f] of x)
547
- d.has(f) || (x.delete(f), P.delete(f));
546
+ for (const [f] of b)
547
+ d.has(f) || (b.delete(f), $.delete(f));
548
548
  } catch {
549
- r.value = [], $.value = [], x.clear(), P.clear();
549
+ r.value = [], T.value = [], b.clear(), $.clear();
550
550
  }
551
551
  };
552
- Ke(() => t.data, (i, a) => {
552
+ Ue(() => t.data, (i, a) => {
553
553
  try {
554
554
  if (!Array.isArray(i))
555
555
  return;
556
556
  Se(() => {
557
557
  if (me(), t.pageConfig.enabled) {
558
558
  W.value.clear(), B.value.clear();
559
- for (let c = 0; c < Math.min(3, $.value.length); c++)
559
+ for (let c = 0; c < Math.min(3, T.value.length); c++)
560
560
  W.value.add(c);
561
561
  Se(() => {
562
562
  fe();
@@ -568,10 +568,10 @@ const ui = /* @__PURE__ */ _n({
568
568
  }, {
569
569
  deep: !1,
570
570
  immediate: !1
571
- }), Ke(() => t.pageData, () => {
571
+ }), Ue(() => t.pageData, () => {
572
572
  if (t.pageConfig.enabled) {
573
573
  he(), W.value.clear(), B.value.clear();
574
- for (let i = 0; i < Math.min(3, $.value.length); i++)
574
+ for (let i = 0; i < Math.min(3, T.value.length); i++)
575
575
  W.value.add(i);
576
576
  Se(() => {
577
577
  fe();
@@ -579,10 +579,10 @@ const ui = /* @__PURE__ */ _n({
579
579
  }
580
580
  }, {
581
581
  deep: !0
582
- }), Ke(() => t.pageConfig, () => {
582
+ }), Ue(() => t.pageConfig, () => {
583
583
  if (t.pageConfig.enabled) {
584
584
  he(), W.value.clear(), B.value.clear();
585
- for (let i = 0; i < Math.min(3, $.value.length); i++)
585
+ for (let i = 0; i < Math.min(3, T.value.length); i++)
586
586
  W.value.add(i);
587
587
  Se(() => {
588
588
  fe();
@@ -590,7 +590,7 @@ const ui = /* @__PURE__ */ _n({
590
590
  }
591
591
  }, {
592
592
  deep: !0
593
- }), Ke(y, () => e("current-change", {
593
+ }), Ue(y, () => e("current-change", {
594
594
  row: y.value
595
595
  }));
596
596
  let Me = null;
@@ -602,16 +602,16 @@ const ui = /* @__PURE__ */ _n({
602
602
  if (!d) continue;
603
603
  const f = Ae(d);
604
604
  if (!f) continue;
605
- const k = p.contentRect.height, w = ((c = T.get(f)) == null ? void 0 : c.height) || 0;
605
+ const k = p.contentRect.height, w = ((c = A.get(f)) == null ? void 0 : c.height) || 0;
606
606
  if (Math.abs(w - k) > 5) {
607
- const b = T.get(f) || {};
608
- T.set(f, {
609
- ...b,
607
+ const _ = A.get(f) || {};
608
+ A.set(f, {
609
+ ..._,
610
610
  height: k
611
611
  }), requestAnimationFrame(() => {
612
612
  var C;
613
- const _ = p.target.__vueParentComponent;
614
- (C = _ == null ? void 0 : _.proxy) != null && C.updateSize && _.proxy.updateSize();
613
+ const x = p.target.__vueParentComponent;
614
+ (C = x == null ? void 0 : x.proxy) != null && C.updateSize && x.proxy.updateSize();
615
615
  });
616
616
  }
617
617
  }
@@ -626,12 +626,12 @@ const ui = /* @__PURE__ */ _n({
626
626
  }, Ye = () => {
627
627
  h.value && (h.value.disconnect(), h.value = null), Me && (Me.disconnect(), Me = null);
628
628
  }, fe = () => {
629
- t.pageConfig.enabled && (I.value && I.value.disconnect(), I.value = new IntersectionObserver((i) => {
629
+ t.pageConfig.enabled && (M.value && M.value.disconnect(), M.value = new IntersectionObserver((i) => {
630
630
  i.forEach((a) => {
631
631
  const c = parseInt(a.target.dataset.pageIndex);
632
632
  if (a.isIntersecting) {
633
633
  B.value.add(c);
634
- for (let p = Math.max(0, c - D); p <= Math.min($.value.length - 1, c + D); p++)
634
+ for (let p = Math.max(0, c - D); p <= Math.min(T.value.length - 1, c + D); p++)
635
635
  W.value.add(p);
636
636
  } else
637
637
  B.value.delete(c), setTimeout(() => {
@@ -645,7 +645,7 @@ const ui = /* @__PURE__ */ _n({
645
645
  }), Se(() => {
646
646
  const i = document.querySelector(".a4-pages-container");
647
647
  i && i.querySelectorAll(".a4-page-placeholder").forEach((c) => {
648
- I.value.observe(c);
648
+ M.value.observe(c);
649
649
  });
650
650
  }));
651
651
  };
@@ -653,12 +653,12 @@ const ui = /* @__PURE__ */ _n({
653
653
  me(), Se(() => {
654
654
  var i;
655
655
  if (Xe(), se.setup(), fe(), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.addEventListener("selectionchange", re), document.addEventListener("mouseup", Te)), t.pageConfig.enabled)
656
- for (let a = 0; a < Math.min(3, $.value.length); a++)
656
+ for (let a = 0; a < Math.min(3, T.value.length); a++)
657
657
  W.value.add(a);
658
658
  }), v.value = !0;
659
659
  }), rt(() => {
660
660
  var i;
661
- Ye(), se.cleanup(), I.value && (I.value.disconnect(), I.value = null), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.removeEventListener("selectionchange", re), document.removeEventListener("mouseup", Te)), Ee && clearTimeout(Ee), M = /* @__PURE__ */ new Map(), x.clear(), W.value.clear(), B.value.clear();
661
+ Ye(), se.cleanup(), M.value && (M.value.disconnect(), M.value = null), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.removeEventListener("selectionchange", re), document.removeEventListener("mouseup", Te)), Ee && clearTimeout(Ee), E = /* @__PURE__ */ new Map(), b.clear(), W.value.clear(), B.value.clear();
662
662
  });
663
663
  const se = {
664
664
  handlers: /* @__PURE__ */ new Map(),
@@ -685,7 +685,7 @@ const ui = /* @__PURE__ */ _n({
685
685
  const a = i.target.closest("[data-id]");
686
686
  if (!a) return;
687
687
  const c = a.dataset.id, p = Ae(c);
688
- p && Ve(p);
688
+ p && je(p);
689
689
  },
690
690
  cleanup() {
691
691
  var a, c;
@@ -694,7 +694,7 @@ const ui = /* @__PURE__ */ _n({
694
694
  }
695
695
  }, ke = (i) => {
696
696
  Qe(i);
697
- }, Ie = (i) => Ve(i);
697
+ }, Ie = (i) => je(i);
698
698
  let we = null, le;
699
699
  const ge = ({
700
700
  row: i,
@@ -703,22 +703,22 @@ const ui = /* @__PURE__ */ _n({
703
703
  var k, w;
704
704
  const d = p || c.target, f = Ot(d, "virtual-table-cell", (k = s.value) == null ? void 0 : k.$el);
705
705
  we === f && le && (clearTimeout(le), we = null), ((w = m.value) == null ? void 0 : w[t.rowConfig.keyField]) != (i == null ? void 0 : i[t.rowConfig.keyField]) && setTimeout(() => {
706
- var _, C;
706
+ var x, C;
707
707
  m.value = i;
708
- let b = (_ = d == null ? void 0 : d.getAttribute) == null ? void 0 : _.call(d, "field");
709
- if (!b) {
708
+ let _ = (x = d == null ? void 0 : d.getAttribute) == null ? void 0 : x.call(d, "field");
709
+ if (!_) {
710
710
  try {
711
- const A = document.getSelection();
712
- let R = A == null ? void 0 : A.anchorNode;
713
- R && R.nodeType === 3 && (R = R.parentElement);
714
- const S = (C = R == null ? void 0 : R.closest) == null ? void 0 : C.call(R, "[field]");
715
- S && (b = S.getAttribute("field"));
711
+ const P = document.getSelection();
712
+ let L = P == null ? void 0 : P.anchorNode;
713
+ L && L.nodeType === 3 && (L = L.parentElement);
714
+ const S = (C = L == null ? void 0 : L.closest) == null ? void 0 : C.call(L, "[field]");
715
+ S && (_ = S.getAttribute("field"));
716
716
  } catch {
717
717
  }
718
- if (!b && (c != null && c.composedPath)) {
719
- for (const A of c.composedPath())
720
- if (A != null && A.getAttribute && A.getAttribute("field")) {
721
- b = A.getAttribute("field");
718
+ if (!_ && (c != null && c.composedPath)) {
719
+ for (const P of c.composedPath())
720
+ if (P != null && P.getAttribute && P.getAttribute("field")) {
721
+ _ = P.getAttribute("field");
722
722
  break;
723
723
  }
724
724
  }
@@ -727,7 +727,7 @@ const ui = /* @__PURE__ */ _n({
727
727
  row: i,
728
728
  column: {
729
729
  ...a,
730
- field: b
730
+ field: _
731
731
  },
732
732
  $table: o == null ? void 0 : o.exposed
733
733
  });
@@ -739,16 +739,16 @@ const ui = /* @__PURE__ */ _n({
739
739
  var f;
740
740
  const d = p || c.target;
741
741
  we = Ot(d, "virtual-table-cell", (f = s.value) == null ? void 0 : f.$el), le && clearTimeout(le), le = setTimeout(() => {
742
- var b, _, C, A, R;
742
+ var _, x, C, P, L;
743
743
  const k = i.content_type;
744
- let w = (b = d == null ? void 0 : d.getAttribute) == null ? void 0 : b.call(d, "field");
744
+ let w = (_ = d == null ? void 0 : d.getAttribute) == null ? void 0 : _.call(d, "field");
745
745
  if (!w) {
746
746
  try {
747
747
  const S = document.getSelection();
748
- let L = S == null ? void 0 : S.anchorNode;
749
- L && L.nodeType === 3 && (L = L.parentElement);
750
- const Z = (_ = L == null ? void 0 : L.closest) == null ? void 0 : _.call(L, "[field]");
751
- Z && (w = Z.getAttribute("field"));
748
+ let R = S == null ? void 0 : S.anchorNode;
749
+ R && R.nodeType === 3 && (R = R.parentElement);
750
+ const X = (x = R == null ? void 0 : R.closest) == null ? void 0 : x.call(R, "[field]");
751
+ X && (w = X.getAttribute("field"));
752
752
  } catch {
753
753
  }
754
754
  if (!w && (c != null && c.composedPath)) {
@@ -761,11 +761,11 @@ const ui = /* @__PURE__ */ _n({
761
761
  }
762
762
  if (k !== "table") {
763
763
  if (k === "text") {
764
- let S = null, L = null;
765
- if ((C = d == null ? void 0 : d.getAttribute) != null && C.call(d, "field") ? S = d : (A = d == null ? void 0 : d.closest) != null && A.call(d, "[field]") && (S = d.closest("[field]")), S && (L = S.textContent), w && L !== void 0 && L !== null) {
766
- L = L.trim();
767
- const Z = ((R = i[w]) == null ? void 0 : R.trim()) || "";
768
- L !== Z && (i[w] = L);
764
+ let S = null, R = null;
765
+ if ((C = d == null ? void 0 : d.getAttribute) != null && C.call(d, "field") ? S = d : (P = d == null ? void 0 : d.closest) != null && P.call(d, "[field]") && (S = d.closest("[field]")), S && (R = S.textContent), w && R !== void 0 && R !== null) {
766
+ R = R.trim();
767
+ const X = ((L = i[w]) == null ? void 0 : L.trim()) || "";
768
+ R !== X && (i[w] = R);
769
769
  }
770
770
  }
771
771
  }
@@ -796,36 +796,36 @@ const ui = /* @__PURE__ */ _n({
796
796
  }, ee = (i, a) => {
797
797
  var c, p, d, f, k, w;
798
798
  try {
799
- const b = document.getSelection();
800
- let _ = b == null ? void 0 : b.anchorNode;
801
- _ && _.nodeType === 3 && (_ = _.parentElement);
802
- const C = (c = _ == null ? void 0 : _.closest) == null ? void 0 : c.call(_, ".virtual-table-cell"), A = (p = _ == null ? void 0 : _.closest) == null ? void 0 : p.call(_, ".virtual-table-row");
803
- if (!C || !A) return;
804
- const R = A.getAttribute("data-id"), S = C.getAttribute("data-prop"), L = Ae(R), Z = Oe.value.find((ce) => `${ce.prop}` == `${S}`) || {}, j = ((d = _ == null ? void 0 : _.closest) == null ? void 0 : d.call(_, "[field]")) || null, U = ((f = j == null ? void 0 : j.getAttribute) == null ? void 0 : f.call(j, "field")) || void 0;
799
+ const _ = document.getSelection();
800
+ let x = _ == null ? void 0 : _.anchorNode;
801
+ x && x.nodeType === 3 && (x = x.parentElement);
802
+ const C = (c = x == null ? void 0 : x.closest) == null ? void 0 : c.call(x, ".virtual-table-cell"), P = (p = x == null ? void 0 : x.closest) == null ? void 0 : p.call(x, ".virtual-table-row");
803
+ if (!C || !P) return;
804
+ const L = P.getAttribute("data-id"), S = C.getAttribute("data-prop"), R = Ae(L), X = Oe.value.find((ce) => `${ce.prop}` == `${S}`) || {}, j = ((d = x == null ? void 0 : x.closest) == null ? void 0 : d.call(x, "[field]")) || null, U = ((f = j == null ? void 0 : j.getAttribute) == null ? void 0 : f.call(j, "field")) || void 0;
805
805
  i === "focusin" ? (O = {
806
- row: L,
807
- column: Z,
806
+ row: R,
807
+ column: X,
808
808
  cellEl: C,
809
- rowEl: A,
809
+ rowEl: P,
810
810
  fieldEl: j,
811
811
  field: U
812
812
  }, ge({
813
- row: L,
814
- column: Z
815
- }, a, j || ((k = _ == null ? void 0 : _.closest) == null ? void 0 : k.call(_, "[field]")))) : ye({
816
- row: L,
817
- column: Z
818
- }, a, j || ((w = _ == null ? void 0 : _.closest) == null ? void 0 : w.call(_, "[field]")));
813
+ row: R,
814
+ column: X
815
+ }, a, j || ((k = x == null ? void 0 : x.closest) == null ? void 0 : k.call(x, "[field]")))) : ye({
816
+ row: R,
817
+ column: X
818
+ }, a, j || ((w = x == null ? void 0 : x.closest) == null ? void 0 : w.call(x, "[field]")));
819
819
  } catch {
820
820
  }
821
821
  }, re = () => {
822
822
  var i;
823
823
  ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (Ee && clearTimeout(Ee), Ee = setTimeout(() => {
824
- var a, c, p, d, f, k, w, b, _, C, A, R, S, L;
824
+ var a, c, p, d, f, k, w, _, x, C, P, L, S, R;
825
825
  try {
826
- const Z = document.getSelection();
827
- if (Z.rangeCount === 0) return;
828
- const j = Z.getRangeAt(0);
826
+ const X = document.getSelection();
827
+ if (X.rangeCount === 0) return;
828
+ const j = X.getRangeAt(0);
829
829
  let U = j.startContainer;
830
830
  U.nodeType === 3 && (U = U.parentElement);
831
831
  const ce = (a = U == null ? void 0 : U.closest) == null ? void 0 : a.call(U, ".virtual-table-cell"), ae = (c = U == null ? void 0 : U.closest) == null ? void 0 : c.call(U, ".virtual-table-row");
@@ -834,7 +834,7 @@ const ui = /* @__PURE__ */ _n({
834
834
  if (!O || ((p = O.row) == null ? void 0 : p[t.rowConfig.keyField]) !== (xe == null ? void 0 : xe[t.rowConfig.keyField]) || ((d = O.column) == null ? void 0 : d.prop) !== (pe == null ? void 0 : pe.prop)) {
835
835
  if (O) {
836
836
  let J = O.fieldEl;
837
- !J && O.field && (J = (k = (f = O.cellEl) == null ? void 0 : f.querySelector) == null ? void 0 : k.call(f, `[field="${O.field}"]`)), J || (J = ((b = (w = O.cellEl) == null ? void 0 : w.querySelector) == null ? void 0 : b.call(w, "[field]")) || O.cellEl), ye(O, {
837
+ !J && O.field && (J = (k = (f = O.cellEl) == null ? void 0 : f.querySelector) == null ? void 0 : k.call(f, `[field="${O.field}"]`)), J || (J = ((_ = (w = O.cellEl) == null ? void 0 : w.querySelector) == null ? void 0 : _.call(w, "[field]")) || O.cellEl), ye(O, {
838
838
  target: J
839
839
  }, J);
840
840
  }
@@ -843,8 +843,8 @@ const ui = /* @__PURE__ */ _n({
843
843
  column: pe,
844
844
  cellEl: ce,
845
845
  rowEl: ae,
846
- fieldEl: ((_ = U == null ? void 0 : U.closest) == null ? void 0 : _.call(U, "[field]")) || null,
847
- field: ((R = (A = ((C = U == null ? void 0 : U.closest) == null ? void 0 : C.call(U, "[field]")) || null) == null ? void 0 : A.getAttribute) == null ? void 0 : R.call(A, "field")) || void 0
846
+ fieldEl: ((x = U == null ? void 0 : U.closest) == null ? void 0 : x.call(U, "[field]")) || null,
847
+ field: ((L = (P = ((C = U == null ? void 0 : U.closest) == null ? void 0 : C.call(U, "[field]")) || null) == null ? void 0 : P.getAttribute) == null ? void 0 : L.call(P, "field")) || void 0
848
848
  }, ge({
849
849
  row: xe,
850
850
  column: pe
@@ -852,8 +852,8 @@ const ui = /* @__PURE__ */ _n({
852
852
  target: ce
853
853
  }, ce);
854
854
  }
855
- if (Z.toString()) {
856
- const J = j.endContainer.nodeType === 3 ? j.endContainer.parentElement : j.endContainer, He = (S = J == null ? void 0 : J.closest) == null ? void 0 : S.call(J, ".virtual-table-cell"), it = (L = J == null ? void 0 : J.closest) == null ? void 0 : L.call(J, ".virtual-table-row");
855
+ if (X.toString()) {
856
+ const J = j.endContainer.nodeType === 3 ? j.endContainer.parentElement : j.endContainer, He = (S = J == null ? void 0 : J.closest) == null ? void 0 : S.call(J, ".virtual-table-cell"), it = (R = J == null ? void 0 : J.closest) == null ? void 0 : R.call(J, ".virtual-table-row");
857
857
  }
858
858
  } catch {
859
859
  }
@@ -867,22 +867,22 @@ const ui = /* @__PURE__ */ _n({
867
867
  const c = a.toString();
868
868
  if (c) {
869
869
  const w = a.rangeCount > 0 ? a.getRangeAt(0) : null;
870
- let b = null, _ = null;
870
+ let _ = null, x = null;
871
871
  try {
872
872
  if (w) {
873
873
  let C = w.startContainer;
874
874
  (C == null ? void 0 : C.nodeType) === 3 && (C = C.parentElement);
875
- const A = (p = C == null ? void 0 : C.closest) == null ? void 0 : p.call(C, ".virtual-table-cell"), R = (d = C == null ? void 0 : C.closest) == null ? void 0 : d.call(C, ".virtual-table-row");
876
- b = A && R ? {
877
- rowId: R.getAttribute("data-id"),
878
- prop: A.getAttribute("data-prop")
875
+ const P = (p = C == null ? void 0 : C.closest) == null ? void 0 : p.call(C, ".virtual-table-cell"), L = (d = C == null ? void 0 : C.closest) == null ? void 0 : d.call(C, ".virtual-table-row");
876
+ _ = P && L ? {
877
+ rowId: L.getAttribute("data-id"),
878
+ prop: P.getAttribute("data-prop")
879
879
  } : null;
880
880
  let S = w.endContainer;
881
881
  (S == null ? void 0 : S.nodeType) === 3 && (S = S.parentElement);
882
- const L = (f = S == null ? void 0 : S.closest) == null ? void 0 : f.call(S, ".virtual-table-cell"), Z = (k = S == null ? void 0 : S.closest) == null ? void 0 : k.call(S, ".virtual-table-row");
883
- _ = L && Z ? {
884
- rowId: Z.getAttribute("data-id"),
885
- prop: L.getAttribute("data-prop")
882
+ const R = (f = S == null ? void 0 : S.closest) == null ? void 0 : f.call(S, ".virtual-table-cell"), X = (k = S == null ? void 0 : S.closest) == null ? void 0 : k.call(S, ".virtual-table-row");
883
+ x = R && X ? {
884
+ rowId: X.getAttribute("data-id"),
885
+ prop: R.getAttribute("data-prop")
886
886
  } : null;
887
887
  }
888
888
  } catch {
@@ -891,12 +891,12 @@ const ui = /* @__PURE__ */ _n({
891
891
  text: c,
892
892
  selection: a,
893
893
  range: w,
894
- start: b,
895
- end: _
894
+ start: _,
895
+ end: x
896
896
  });
897
897
  }
898
898
  }, 10);
899
- }, Re = (i) => (i == null ? void 0 : i._editing) === !0, dt = (i) => i != null && i.parent_id ? M.get(i.parent_id) : null, Qt = (i) => {
899
+ }, Re = (i) => (i == null ? void 0 : i._editing) === !0, dt = (i) => i != null && i.parent_id ? E.get(i.parent_id) : null, Qt = (i) => {
900
900
  var c;
901
901
  const a = r.value.findIndex((p) => p[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
902
902
  return a < 1 ? null : ((c = r.value[a - 1]) == null ? void 0 : c.layer) === i.layer ? r.value[a - 1] : null;
@@ -905,8 +905,8 @@ const ui = /* @__PURE__ */ _n({
905
905
  return a >= r.value.length - 1 ? null : r.value[a + 1];
906
906
  }, Ae = (i) => {
907
907
  if (!i) return null;
908
- let a = x.get(i);
909
- return a || (typeof i == "number" ? x.get(`${i}`) : typeof i == "string" && /^\d+$/.test(i) ? x.get(Number(i)) : null);
908
+ let a = b.get(i);
909
+ return a || (typeof i == "number" ? b.get(`${i}`) : typeof i == "string" && /^\d+$/.test(i) ? b.get(Number(i)) : null);
910
910
  };
911
911
  let Ze = null;
912
912
  const tn = (i) => {
@@ -915,40 +915,40 @@ const ui = /* @__PURE__ */ _n({
915
915
  const a = t.rowConfig.keyField, c = i[a];
916
916
  if (t.pageConfig.enabled) {
917
917
  let d = -1;
918
- for (let f = 0; f < $.value.length; f++)
919
- if ($.value[f].items.some((b) => b[a] === c)) {
918
+ for (let f = 0; f < T.value.length; f++)
919
+ if (T.value[f].items.some((_) => _[a] === c)) {
920
920
  d = f;
921
921
  break;
922
922
  }
923
923
  if (d !== -1) {
924
- for (let f = Math.max(0, d - 1); f <= Math.min($.value.length - 1, d + 1); f++)
924
+ for (let f = Math.max(0, d - 1); f <= Math.min(T.value.length - 1, d + 1); f++)
925
925
  W.value.has(f) || W.value.add(f);
926
926
  Se(() => {
927
927
  const f = document.querySelector(".a4-pages-container");
928
928
  if (!f) return;
929
929
  const k = (w = 0) => {
930
- const b = f.querySelector(`[data-id="${c}"]`);
931
- if (b) {
932
- let _ = 0, C = b;
930
+ const _ = f.querySelector(`[data-id="${c}"]`);
931
+ if (_) {
932
+ let x = 0, C = _;
933
933
  for (; C && C !== f; )
934
- _ += C.offsetTop, C = C.offsetParent;
935
- const A = f.clientHeight;
936
- let R = _ - A * 0.3;
937
- R = Math.max(0, R);
938
- const S = f.scrollTop, L = Math.abs(R - S), Z = (j) => {
939
- const U = f.scrollTop, ce = j - U, ae = Math.min(800, Math.max(300, L * 0.5)), Be = performance.now(), De = (pe) => pe < 0.5 ? 4 * pe * pe * pe : 1 - Math.pow(-2 * pe + 2, 3) / 2, xe = (pe) => {
940
- const je = pe - Be, J = Math.min(je / ae, 1), He = De(J), it = U + ce * He;
934
+ x += C.offsetTop, C = C.offsetParent;
935
+ const P = f.clientHeight;
936
+ let L = x - P * 0.3;
937
+ L = Math.max(0, L);
938
+ const S = f.scrollTop, R = Math.abs(L - S), X = (j) => {
939
+ const U = f.scrollTop, ce = j - U, ae = Math.min(800, Math.max(300, R * 0.5)), Be = performance.now(), De = (pe) => pe < 0.5 ? 4 * pe * pe * pe : 1 - Math.pow(-2 * pe + 2, 3) / 2, xe = (pe) => {
940
+ const Ke = pe - Be, J = Math.min(Ke / ae, 1), He = De(J), it = U + ce * He;
941
941
  f.scrollTop = it, J < 1 ? requestAnimationFrame(xe) : setTimeout(() => {
942
942
  f.scrollTop = j;
943
943
  }, 50);
944
944
  };
945
945
  requestAnimationFrame(xe);
946
946
  };
947
- L > 3e3 ? f.scrollTo({
948
- top: R,
947
+ R > 3e3 ? f.scrollTo({
948
+ top: L,
949
949
  behavior: "instant"
950
- }) : Z(R), b.classList.add("row--highlight"), setTimeout(() => {
951
- b.classList.remove("row--highlight");
950
+ }) : X(L), _.classList.add("row--highlight"), setTimeout(() => {
951
+ _.classList.remove("row--highlight");
952
952
  }, 1500);
953
953
  } else w < 10 && setTimeout(() => k(w + 1), 150);
954
954
  };
@@ -971,13 +971,13 @@ const ui = /* @__PURE__ */ _n({
971
971
  m.value = null;
972
972
  }, 200));
973
973
  }
974
- }, Ve = (i, a) => new Promise((c) => {
974
+ }, je = (i, a) => new Promise((c) => {
975
975
  var p, d;
976
976
  if (!((p = t == null ? void 0 : t.editConfig) != null && p.beforeEditMethod && typeof ((d = t == null ? void 0 : t.editConfig) == null ? void 0 : d.beforeEditMethod) == "function" && !t.editConfig.beforeEditMethod({
977
977
  row: i
978
978
  }))) {
979
979
  if (!i || !v.value) {
980
- setTimeout(() => Ve(i), 200);
980
+ setTimeout(() => je(i), 200);
981
981
  return;
982
982
  }
983
983
  i !== m.value && (r.value.forEach((f) => {
@@ -998,15 +998,15 @@ const ui = /* @__PURE__ */ _n({
998
998
  }), c(!0);
999
999
  }));
1000
1000
  }
1001
- }), nn = (i) => Ve(i), ut = () => {
1001
+ }), nn = (i) => je(i), ut = () => {
1002
1002
  if (he(), t.pageConfig.enabled) {
1003
1003
  const i = Array.from(B.value);
1004
1004
  if (i.length > 0) {
1005
1005
  const a = Math.min(...i);
1006
- for (let c = Math.max(0, a - 1); c <= Math.min($.value.length - 1, a + 2); c++)
1006
+ for (let c = Math.max(0, a - 1); c <= Math.min(T.value.length - 1, a + 2); c++)
1007
1007
  W.value.add(c);
1008
1008
  } else
1009
- for (let a = 0; a < Math.min(3, $.value.length); a++)
1009
+ for (let a = 0; a < Math.min(3, T.value.length); a++)
1010
1010
  W.value.add(a);
1011
1011
  Se(() => {
1012
1012
  fe();
@@ -1023,19 +1023,19 @@ const ui = /* @__PURE__ */ _n({
1023
1023
  p += 1;
1024
1024
  } else
1025
1025
  p = r.value.findIndex((d) => d[t.rowConfig.keyField] == a[t.rowConfig.keyField]);
1026
- M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1026
+ E.set(i.node_id, i), b.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1027
1027
  row: i
1028
1028
  });
1029
1029
  }), on = (i, a) => new Promise((c) => {
1030
1030
  const p = r.value.findIndex((d) => d[t.rowConfig.keyField] == a[t.rowConfig.keyField]) + 1;
1031
- M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1031
+ E.set(i.node_id, i), b.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1032
1032
  row: i
1033
1033
  });
1034
1034
  }), xt = (i) => {
1035
1035
  const a = r.value.findIndex((c) => c[t.rowConfig.keyField] == i[t.rowConfig.keyField] || c === i);
1036
1036
  if (a > -1) {
1037
1037
  const c = i[t.rowConfig.keyField];
1038
- M.delete(i.node_id), x.delete(c), r.value.splice(a, 1), ut();
1038
+ E.delete(i.node_id), b.delete(c), r.value.splice(a, 1), ut();
1039
1039
  }
1040
1040
  }, an = (i, a) => {
1041
1041
  if (!i || !i[t.rowConfig.keyField]) return !1;
@@ -1060,12 +1060,12 @@ const ui = /* @__PURE__ */ _n({
1060
1060
  var c, p, d;
1061
1061
  let a = r.value.findIndex((f) => f[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
1062
1062
  if (a > -1 && t.treeConfig) {
1063
- const f = ((c = t.treeConfig) == null ? void 0 : c.keyField) || ((p = t.treeConfig) == null ? void 0 : p.rowField) || "node_id", k = ((d = t.treeConfig) == null ? void 0 : d.parentField) || "parent_id", w = [], b = /* @__PURE__ */ new Map();
1064
- b.set(i[f], !0);
1065
- for (let _ = a + 1; _ < r.value.length; _++) {
1066
- const C = r.value[_];
1067
- if (C && b.has(C[k]))
1068
- w.push(C), b.set(C[f]);
1063
+ const f = ((c = t.treeConfig) == null ? void 0 : c.keyField) || ((p = t.treeConfig) == null ? void 0 : p.rowField) || "node_id", k = ((d = t.treeConfig) == null ? void 0 : d.parentField) || "parent_id", w = [], _ = /* @__PURE__ */ new Map();
1064
+ _.set(i[f], !0);
1065
+ for (let x = a + 1; x < r.value.length; x++) {
1066
+ const C = r.value[x];
1067
+ if (C && _.has(C[k]))
1068
+ w.push(C), _.set(C[f]);
1069
1069
  else
1070
1070
  break;
1071
1071
  }
@@ -1081,7 +1081,7 @@ const ui = /* @__PURE__ */ _n({
1081
1081
  getRowById: Ae,
1082
1082
  scrollToRow: tn,
1083
1083
  setCurrentRow: Qe,
1084
- setEditRow: Ve,
1084
+ setEditRow: je,
1085
1085
  setEditCell: nn,
1086
1086
  insertAt: ln,
1087
1087
  insertNextAt: on,
@@ -1145,7 +1145,7 @@ const ui = /* @__PURE__ */ _n({
1145
1145
  }, nt = null;
1146
1146
  });
1147
1147
  }, gn = (i, a) => {
1148
- var S, L, Z;
1148
+ var S, R, X;
1149
1149
  const {
1150
1150
  pageHeight: c,
1151
1151
  margin: p,
@@ -1153,20 +1153,20 @@ const ui = /* @__PURE__ */ _n({
1153
1153
  pageBorderPadding: f,
1154
1154
  pageBorderStyle: k,
1155
1155
  showPageHeader: w,
1156
- headerHeight: b = 0,
1157
- footerHeight: _ = 0,
1156
+ headerHeight: _ = 0,
1157
+ footerHeight: x = 0,
1158
1158
  showPageNumber: C
1159
- } = t.pageConfig, A = i.pageNumber || a + 1, R = (S = i.items) == null ? void 0 : S.some((j) => j._isCover);
1160
- return W.value.has(a) ? q(G, null, [w !== !1 && (n["page-header"] || b > 0) && !R ? q("div", {
1159
+ } = t.pageConfig, P = i.pageNumber || a + 1, L = (S = i.items) == null ? void 0 : S.some((j) => j._isCover);
1160
+ return W.value.has(a) ? q(G, null, [w !== !1 && (n["page-header"] || _ > 0) && !L ? q("div", {
1161
1161
  class: "a4-page-header",
1162
1162
  style: {
1163
- minHeight: `${Math.max(b, 1)}px`
1163
+ minHeight: `${Math.max(_, 1)}px`
1164
1164
  }
1165
- }, [(L = n["page-header"]) == null ? void 0 : L.call(n, {
1166
- pageNumber: A,
1165
+ }, [(R = n["page-header"]) == null ? void 0 : R.call(n, {
1166
+ pageNumber: P,
1167
1167
  pageIndex: a,
1168
- totalPages: $.value.length,
1169
- isCoverPage: R
1168
+ totalPages: T.value.length,
1169
+ isCoverPage: L
1170
1170
  })]) : null, a === 0 && t.showHeader ? q("div", {
1171
1171
  class: "a4-table-header"
1172
1172
  }, [q("div", {
@@ -1206,7 +1206,7 @@ const ui = /* @__PURE__ */ _n({
1206
1206
  onClick: () => ke(j),
1207
1207
  onDblclick: () => Ie(j)
1208
1208
  }, [Oe.value.map((ae) => {
1209
- var Be, De, xe, pe, je, J, He;
1209
+ var Be, De, xe, pe, Ke, J, He;
1210
1210
  return q("div", {
1211
1211
  key: ae.prop,
1212
1212
  class: "virtual-table-cell we-vt-cell",
@@ -1215,24 +1215,24 @@ const ui = /* @__PURE__ */ _n({
1215
1215
  }, [j._editing && ((Be = t.editConfig) == null ? void 0 : Be.trigger) === "dblclick" ? ((De = ae.slots) == null ? void 0 : De.edit) && ((pe = (xe = ae.slots) == null ? void 0 : xe.edit) == null ? void 0 : pe.call(xe, {
1216
1216
  row: j,
1217
1217
  column: ae
1218
- })) : ((je = ae.slots) == null ? void 0 : je.default) && ((He = (J = ae.slots) == null ? void 0 : J.default) == null ? void 0 : He.call(J, {
1218
+ })) : ((Ke = ae.slots) == null ? void 0 : Ke.default) && ((He = (J = ae.slots) == null ? void 0 : J.default) == null ? void 0 : He.call(J, {
1219
1219
  row: j,
1220
1220
  column: ae
1221
1221
  }))]);
1222
1222
  })]);
1223
1223
  })]), n["page-footer"] ? q("div", {
1224
1224
  class: "a4-page-footer"
1225
- }, [(Z = n["page-footer"]) == null ? void 0 : Z.call(n, {
1226
- pageNumber: A,
1225
+ }, [(X = n["page-footer"]) == null ? void 0 : X.call(n, {
1226
+ pageNumber: P,
1227
1227
  pageIndex: a,
1228
- totalPages: $.value.length
1228
+ totalPages: T.value.length
1229
1229
  })]) : q("div", {
1230
1230
  class: "a4-page-footer",
1231
1231
  contenteditable: "false"
1232
1232
  }, [C !== !1 ? q("span", {
1233
1233
  class: "page-number",
1234
1234
  contenteditable: "false"
1235
- }, [Le("第"), A, Le("页 / 共"), $.value.length, Le("页")]) : null])]) : q("div", {
1235
+ }, [Le("第"), P, Le("页 / 共"), T.value.length, Le("页")]) : null])]) : q("div", {
1236
1236
  class: "a4-page-loading"
1237
1237
  }, [q("div", {
1238
1238
  class: "loading-spinner"
@@ -1257,22 +1257,22 @@ const ui = /* @__PURE__ */ _n({
1257
1257
  onContextmenu: Ce,
1258
1258
  onFocusin: be,
1259
1259
  onFocusout: oe
1260
- }, [$.value.map((w, b) => {
1261
- const _ = W.value.has(b);
1260
+ }, [T.value.map((w, _) => {
1261
+ const x = W.value.has(_);
1262
1262
  return q("div", {
1263
- key: `page-${b}`,
1264
- class: _ ? "a4-page" : "a4-page-placeholder",
1265
- "data-page-index": b,
1263
+ key: `page-${_}`,
1264
+ class: x ? "a4-page" : "a4-page-placeholder",
1265
+ "data-page-index": _,
1266
1266
  style: {
1267
1267
  width: `${a}px`,
1268
1268
  minHeight: `${i}px`,
1269
1269
  marginBottom: `${p}px`,
1270
- padding: _ ? `${d ? c - f : c}px` : "0",
1271
- paddingBottom: _ ? "12px" : "0",
1270
+ padding: x ? `${d ? c - f : c}px` : "0",
1271
+ paddingBottom: x ? "12px" : "0",
1272
1272
  boxSizing: "border-box",
1273
1273
  position: "relative"
1274
1274
  }
1275
- }, [gn(w, b)]);
1275
+ }, [gn(w, _)]);
1276
1276
  })])]);
1277
1277
  }, vn = () => {
1278
1278
  var i;
@@ -1295,7 +1295,7 @@ const ui = /* @__PURE__ */ _n({
1295
1295
  }, null)]);
1296
1296
  })]) : void 0, q(In, {
1297
1297
  ref: s,
1298
- items: E.value,
1298
+ items: I.value,
1299
1299
  minItemSize: ue.value,
1300
1300
  keyField: t.rowConfig.keyField,
1301
1301
  emitUpdate: !1,
@@ -1329,19 +1329,19 @@ const ui = /* @__PURE__ */ _n({
1329
1329
  "row--current": a[t.rowConfig.keyField] === ((k = y.value) == null ? void 0 : k[t.rowConfig.keyField]) || // 如果是树,并且配置了childCurrent高亮子节点
1330
1330
  ((w = t.treeConfig) == null ? void 0 : w.childCurrent) && wt.value.includes(a[t.rowConfig.keyField])
1331
1331
  }
1332
- }, di(d = Oe.value.map((b) => {
1333
- var _, C, A, R, S, L, Z;
1332
+ }, di(d = Oe.value.map((_) => {
1333
+ var x, C, P, L, S, R, X;
1334
1334
  return q("div", {
1335
- key: b.prop,
1335
+ key: _.prop,
1336
1336
  class: "virtual-table-cell we-vt-cell",
1337
- style: et(b.width),
1338
- "data-prop": b.prop
1339
- }, [a._editing && ((_ = t.editConfig) == null ? void 0 : _.trigger) === "dblclick" ? ((C = b.slots) == null ? void 0 : C.edit) && ((R = (A = b.slots) == null ? void 0 : A.edit) == null ? void 0 : R.call(A, {
1337
+ style: et(_.width),
1338
+ "data-prop": _.prop
1339
+ }, [a._editing && ((x = t.editConfig) == null ? void 0 : x.trigger) === "dblclick" ? ((C = _.slots) == null ? void 0 : C.edit) && ((L = (P = _.slots) == null ? void 0 : P.edit) == null ? void 0 : L.call(P, {
1340
1340
  row: a,
1341
- column: b
1342
- })) : ((S = b.slots) == null ? void 0 : S.default) && ((Z = (L = b.slots) == null ? void 0 : L.default) == null ? void 0 : Z.call(L, {
1341
+ column: _
1342
+ })) : ((S = _.slots) == null ? void 0 : S.default) && ((X = (R = _.slots) == null ? void 0 : R.default) == null ? void 0 : X.call(R, {
1343
1343
  row: a,
1344
- column: b
1344
+ column: _
1345
1345
  }))]);
1346
1346
  })) ? d : {
1347
1347
  default: () => [d]
@@ -1351,12 +1351,12 @@ const ui = /* @__PURE__ */ _n({
1351
1351
  };
1352
1352
  return () => t.pageConfig.enabled ? pn() : vn();
1353
1353
  }
1354
- }), Ne = (t, e) => {
1354
+ }), Ve = (t, e) => {
1355
1355
  const n = t.__vccOpts || t;
1356
1356
  for (const [l, o] of e)
1357
1357
  n[l] = o;
1358
1358
  return n;
1359
- }, hi = /* @__PURE__ */ Ne(ui, [["__scopeId", "data-v-6bbd7545"]]), fi = {
1359
+ }, hi = /* @__PURE__ */ Ve(ui, [["__scopeId", "data-v-885af7f2"]]), fi = {
1360
1360
  name: "VirtualTableColumn",
1361
1361
  props: {
1362
1362
  prop: String,
@@ -1367,7 +1367,7 @@ const ui = /* @__PURE__ */ _n({
1367
1367
  function gi(t, e, n, l, o, s) {
1368
1368
  return wn(t.$slots, "default");
1369
1369
  }
1370
- const pi = /* @__PURE__ */ Ne(fi, [["render", gi]]), vi = { class: "catalog-node" }, mi = ["title"], yi = { class: "catalog-node__text" }, bi = {
1370
+ const pi = /* @__PURE__ */ Ve(fi, [["render", gi]]), vi = { class: "catalog-node" }, mi = ["title"], yi = { class: "catalog-node__text" }, bi = {
1371
1371
  key: 0,
1372
1372
  class: "catalog-node__children"
1373
1373
  }, _i = {
@@ -1390,7 +1390,7 @@ const pi = /* @__PURE__ */ Ne(fi, [["render", gi]]), vi = { class: "catalog-node
1390
1390
  class: Pe(["catalog-node__label", { "is-active": t.activeId === t.item.nodeId }]),
1391
1391
  style: V({ paddingLeft: 10 + t.depth * 14 + "px" }),
1392
1392
  title: t.item.name,
1393
- onClick: y[0] || (y[0] = (M) => l("navigate", t.item))
1393
+ onClick: y[0] || (y[0] = (E) => l("navigate", t.item))
1394
1394
  }, [
1395
1395
  ne("span", {
1396
1396
  class: "catalog-node__toggle",
@@ -1401,21 +1401,21 @@ const pi = /* @__PURE__ */ Ne(fi, [["render", gi]]), vi = { class: "catalog-node
1401
1401
  size: 14
1402
1402
  })) : ve("", !0)
1403
1403
  ]),
1404
- ne("span", yi, Y(t.item.name || "(无标题)"), 1)
1404
+ ne("span", yi, Z(t.item.name || "(无标题)"), 1)
1405
1405
  ], 14, mi),
1406
1406
  s.value && o.value ? (u(), g("div", bi, [
1407
- (u(!0), g(G, null, Q(t.item.children, (M) => (u(), Fe(r, {
1408
- key: M.nodeId,
1409
- item: M,
1407
+ (u(!0), g(G, null, Q(t.item.children, (E) => (u(), Fe(r, {
1408
+ key: E.nodeId,
1409
+ item: E,
1410
1410
  depth: t.depth + 1,
1411
1411
  "active-id": t.activeId,
1412
- onNavigate: y[1] || (y[1] = (x) => l("navigate", x))
1412
+ onNavigate: y[1] || (y[1] = (b) => l("navigate", b))
1413
1413
  }, null, 8, ["item", "depth", "active-id"]))), 128))
1414
1414
  ])) : ve("", !0)
1415
1415
  ]);
1416
1416
  };
1417
1417
  }
1418
- }, xi = /* @__PURE__ */ Ne(_i, [["__scopeId", "data-v-ac882917"]]), ki = {
1418
+ }, xi = /* @__PURE__ */ Ve(_i, [["__scopeId", "data-v-ac882917"]]), ki = {
1419
1419
  key: 0,
1420
1420
  class: "catalog catalog--collapsed"
1421
1421
  }, wi = {
@@ -1468,7 +1468,7 @@ const pi = /* @__PURE__ */ Ne(fi, [["render", gi]]), vi = { class: "catalog-node
1468
1468
  ])
1469
1469
  ]));
1470
1470
  }
1471
- }, Fi = /* @__PURE__ */ Ne(Si, [["__scopeId", "data-v-8becafa1"]]), Ti = {
1471
+ }, Fi = /* @__PURE__ */ Ve(Si, [["__scopeId", "data-v-8becafa1"]]), Ti = {
1472
1472
  first: 1,
1473
1473
  second: 2,
1474
1474
  third: 3,
@@ -1554,7 +1554,7 @@ function Li() {
1554
1554
  }
1555
1555
  };
1556
1556
  }
1557
- const We = 14, Xt = 760, Ri = 756, Hi = {
1557
+ const ze = 14, Xt = 760, Ri = 756, Hi = {
1558
1558
  left: "left",
1559
1559
  center: "center",
1560
1560
  right: "right",
@@ -1614,11 +1614,11 @@ function Ge(t) {
1614
1614
  else if (y.type === "list") {
1615
1615
  m(), v();
1616
1616
  const r = [];
1617
- let M = [];
1618
- for (const x of y.valueList || [])
1619
- x.value === `
1620
- ` || x.value === "​" ? (r.push([...M]), M = []) : M.push(x);
1621
- (M.length || r.length === 0) && r.push([...M]), n.push({ type: "list", listType: y.listType || "ul", listStyle: y.listStyle || "disc", items: r });
1617
+ let E = [];
1618
+ for (const b of y.valueList || [])
1619
+ b.value === `
1620
+ ` || b.value === "​" ? (r.push([...E]), E = []) : E.push(b);
1621
+ (E.length || r.length === 0) && r.push([...E]), n.push({ type: "list", listType: y.listType || "ul", listStyle: y.listStyle || "disc", items: r });
1622
1622
  } else if (y.listId) {
1623
1623
  m(), v();
1624
1624
  const r = y.value === "​" || y.value === "" ? [] : [y];
@@ -1626,11 +1626,11 @@ function Ge(t) {
1626
1626
  } else y.value != null && /^[\n​]+$/.test(y.value) ? (o += y.value.length, y.rowFlex && (s = y.rowFlex)) : (m(), l.push(y));
1627
1627
  return m(), v(), n;
1628
1628
  }
1629
- function ze(t) {
1630
- const e = t.filter((r) => r.type === "image").reduce((r, M) => r + (M.height || M.width || 0), 0), n = t.filter((r) => r.type !== "image").map((r) => r.value || "").join("");
1629
+ function Ne(t) {
1630
+ const e = t.filter((b) => b.type === "image").reduce((b, T) => b + (T.height || T.width || 0), 0), n = t.filter((b) => b.type !== "image").map((b) => b.value || "").join("");
1631
1631
  if (!n) return e || 20;
1632
- const l = t.reduce((r, M) => Math.max(r, M.size || 0), 0) || 14, o = l + 6, s = (n.match(/[一-龥]/g) || []).length, v = n.length - s, m = s * l + v * (l * 0.5), y = Math.max(1, Math.ceil(m / Xt));
1633
- return e + Math.max(o, y * o);
1632
+ const l = t.reduce((b, T) => Math.max(b, T.size || 0), 0) || 14, o = l + 6, s = t.filter((b) => b.type === "tab").reduce((b, T) => b + (T.size || ze), 0), v = (n.match(/[一-龥]/g) || []).length, m = (n.match(/[A-Za-z0-9]/g) || []).length, y = n.length - v - m, r = v * l + m * (l * 0.55) + y * (l * 0.35) + s, E = Math.max(1, Math.ceil(r / Xt));
1633
+ return e + Math.max(o, E * o);
1634
1634
  }
1635
1635
  function Bi(t) {
1636
1636
  if (!t || !t.length) return [[]];
@@ -1649,8 +1649,8 @@ function Dt(t) {
1649
1649
  if (y > 1) {
1650
1650
  const r = Math.min(v + y - 1, t.length - 1);
1651
1651
  e[v] = Math.max(e[v], r);
1652
- for (let M = 1; M < y && v + M < t.length; M++)
1653
- e[v + M] = Math.max(e[v + M], r);
1652
+ for (let E = 1; E < y && v + E < t.length; E++)
1653
+ e[v + E] = Math.max(e[v + E], r);
1654
1654
  }
1655
1655
  });
1656
1656
  });
@@ -1684,7 +1684,7 @@ function Di(t) {
1684
1684
  }
1685
1685
  function _e(t) {
1686
1686
  const e = {};
1687
- t.font && (e.fontFamily = t.font), e.fontSize = (t.size || We) + "px", t.bold != null && (e.fontWeight = t.bold ? "bold" : "normal"), t.italic != null && (e.fontStyle = t.italic ? "italic" : "normal"), t.color && (e.color = t.color), t.highlight && t.highlight !== "rgb(255, 255, 255)" && t.highlight !== "#ffffff" && (e.backgroundColor = t.highlight);
1687
+ t.font && (e.fontFamily = t.font), e.fontSize = (t.size || ze) + "px", t.bold != null && (e.fontWeight = t.bold ? "bold" : "normal"), t.italic != null && (e.fontStyle = t.italic ? "italic" : "normal"), t.color && (e.color = t.color), t.highlight && t.highlight !== "rgb(255, 255, 255)" && t.highlight !== "#ffffff" && (e.backgroundColor = t.highlight);
1688
1688
  const n = [t.underline && "underline", t.strikeout && "line-through"].filter(Boolean).join(" ");
1689
1689
  return n && (e.textDecoration = n), t.letterSpacing && (e.letterSpacing = t.letterSpacing + "px"), e;
1690
1690
  }
@@ -1697,12 +1697,12 @@ function Nt(t, e = !1) {
1697
1697
  const v = ((l = s.el) == null ? void 0 : l.trList) || [];
1698
1698
  n += v.reduce((m, y) => m + (y.height || y.minHeight || 35), 0);
1699
1699
  } else if (s.type === "title")
1700
- n += ze(s.titleValueList || ((o = s.el) == null ? void 0 : o.valueList) || []);
1700
+ n += Ne(s.titleValueList || ((o = s.el) == null ? void 0 : o.valueList) || []);
1701
1701
  else if (s.type === "paragraph")
1702
- n += ze(s.elements || []);
1702
+ n += Ne(s.elements || []);
1703
1703
  else if (s.type === "list") {
1704
1704
  const v = Math.round(18), m = (s.items || []).reduce(
1705
- (y, r) => y + (r.length ? ze(r) : v),
1705
+ (y, r) => y + (r.length ? Ne(r) : v),
1706
1706
  0
1707
1707
  );
1708
1708
  n += Math.max(m, v);
@@ -1742,23 +1742,23 @@ const Ni = {
1742
1742
  class: Pe(["doc-title", `doc-title--${t.block.level}`]),
1743
1743
  style: V({ paddingLeft: s.value ? s.value + "px" : void 0 })
1744
1744
  }, [
1745
- (u(!0), g(G, null, Q(t.block.titleValueList || [], (r, M) => (u(), g("span", {
1746
- key: M,
1745
+ (u(!0), g(G, null, Q(t.block.titleValueList || [], (r, E) => (u(), g("span", {
1746
+ key: E,
1747
1747
  style: V(K(_e)(r))
1748
- }, Y(r.value), 5))), 128))
1748
+ }, Z(r.value), 5))), 128))
1749
1749
  ], 6)) : t.block.blockType === "paragraph" ? (u(), g("p", {
1750
1750
  key: 1,
1751
1751
  class: "doc-para",
1752
1752
  style: V({ ...K(zt)(t.block), paddingLeft: s.value ? s.value + "px" : void 0 })
1753
1753
  }, [
1754
1754
  t.block.elements.length ? ve("", !0) : (u(), g("span", Ni, " ")),
1755
- (u(!0), g(G, null, Q(t.block.elements, (r, M) => {
1756
- var x, $, B, W, I, D, T, h, F, P, E, X, ue;
1757
- return u(), g(G, { key: M }, [
1755
+ (u(!0), g(G, null, Q(t.block.elements, (r, E) => {
1756
+ var b, T, B, W, M, D, A, h, F, $, I, Y, ue;
1757
+ return u(), g(G, { key: E }, [
1758
1758
  !r.type || r.type === "text" ? (u(), g("span", {
1759
1759
  key: 0,
1760
1760
  style: V(K(_e)(r))
1761
- }, Y(r.value), 5)) : r.type === "hyperlink" ? (u(), g("a", {
1761
+ }, Z(r.value), 5)) : r.type === "hyperlink" ? (u(), g("a", {
1762
1762
  key: 1,
1763
1763
  href: r.url,
1764
1764
  class: "doc-link",
@@ -1768,7 +1768,7 @@ const Ni = {
1768
1768
  (u(!0), g(G, null, Q(r.valueList || [], (z, ie) => (u(), g("span", {
1769
1769
  key: ie,
1770
1770
  style: V(K(_e)(z))
1771
- }, Y(z.value), 5))), 128))
1771
+ }, Z(z.value), 5))), 128))
1772
1772
  ], 8, Vi)) : r.type === "image" ? (u(), g("img", {
1773
1773
  key: 2,
1774
1774
  src: o(r.value),
@@ -1778,15 +1778,15 @@ const Ni = {
1778
1778
  height: r.height ? r.height + "px" : "auto"
1779
1779
  })
1780
1780
  }, null, 12, ji)) : r.type === "control" ? (u(), g(G, { key: 3 }, [
1781
- ((x = r.control) == null ? void 0 : x.type) === "text" ? (u(), g("span", {
1781
+ ((b = r.control) == null ? void 0 : b.type) === "text" ? (u(), g("span", {
1782
1782
  key: 0,
1783
1783
  style: V({ fontSize: (r.control.size || 12) + "px" })
1784
1784
  }, [
1785
1785
  (u(!0), g(G, null, Q(r.control.value || [], (z, ie) => (u(), g("span", {
1786
1786
  key: ie,
1787
1787
  style: V(K(_e)(z))
1788
- }, Y(z.value), 5))), 128))
1789
- ], 4)) : (($ = r.control) == null ? void 0 : $.type) === "input" ? (u(), g("span", {
1788
+ }, Z(z.value), 5))), 128))
1789
+ ], 4)) : ((T = r.control) == null ? void 0 : T.type) === "input" ? (u(), g("span", {
1790
1790
  key: 1,
1791
1791
  class: "ctrl-input",
1792
1792
  style: V({
@@ -1794,11 +1794,11 @@ const Ni = {
1794
1794
  fontSize: (r.control.size || 12) + "px"
1795
1795
  })
1796
1796
  }, [
1797
- (u(!0), g(G, null, Q(r.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Y(z.value), 1))), 128))
1797
+ (u(!0), g(G, null, Q(r.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Z(z.value), 1))), 128))
1798
1798
  ], 4)) : ((B = r.control) == null ? void 0 : B.type) === "radio" ? (u(), g("span", {
1799
1799
  key: 2,
1800
- class: Pe(["ctrl-options", { "ctrl-options--vertical": ((I = (W = r.control.extension) == null ? void 0 : W.elementAttributes) == null ? void 0 : I.layout) === "vertical" }]),
1801
- style: V({ fontSize: (r.control.size || K(We)) + "px" })
1800
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((M = (W = r.control.extension) == null ? void 0 : W.elementAttributes) == null ? void 0 : M.layout) === "vertical" }]),
1801
+ style: V({ fontSize: (r.control.size || K(ze)) + "px" })
1802
1802
  }, [
1803
1803
  (u(!0), g(G, null, Q(r.control.valueSets || [], (z, ie) => (u(), g("label", {
1804
1804
  key: ie,
@@ -1809,12 +1809,12 @@ const Ni = {
1809
1809
  disabled: "",
1810
1810
  checked: r.control.code === z.code
1811
1811
  }, null, 8, Ki),
1812
- Le(" " + Y(z.value), 1)
1812
+ Le(" " + Z(z.value), 1)
1813
1813
  ]))), 128))
1814
1814
  ], 6)) : ((D = r.control) == null ? void 0 : D.type) === "checkbox" ? (u(), g("span", {
1815
1815
  key: 3,
1816
- class: Pe(["ctrl-options", { "ctrl-options--vertical": ((h = (T = r.control.extension) == null ? void 0 : T.elementAttributes) == null ? void 0 : h.layout) === "vertical" }]),
1817
- style: V({ fontSize: (r.control.size || K(We)) + "px" })
1816
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((h = (A = r.control.extension) == null ? void 0 : A.elementAttributes) == null ? void 0 : h.layout) === "vertical" }]),
1817
+ style: V({ fontSize: (r.control.size || K(ze)) + "px" })
1818
1818
  }, [
1819
1819
  (u(!0), g(G, null, Q(r.control.valueSets || [], (z, ie) => (u(), g("label", {
1820
1820
  key: ie,
@@ -1825,13 +1825,13 @@ const Ni = {
1825
1825
  disabled: "",
1826
1826
  checked: (r.control.code || "").split(",").includes(z.code)
1827
1827
  }, null, 8, Ui),
1828
- Le(" " + Y(z.value), 1)
1828
+ Le(" " + Z(z.value), 1)
1829
1829
  ]))), 128))
1830
- ], 6)) : ((F = r.control) == null ? void 0 : F.type) === "select" ? (u(), g("span", qi, Y(((E = (P = r.control.value) == null ? void 0 : P[0]) == null ? void 0 : E.value) || r.control.placeholder || ""), 1)) : ve("", !0)
1830
+ ], 6)) : ((F = r.control) == null ? void 0 : F.type) === "select" ? (u(), g("span", qi, Z(((I = ($ = r.control.value) == null ? void 0 : $[0]) == null ? void 0 : I.value) || r.control.placeholder || ""), 1)) : ve("", !0)
1831
1831
  ], 64)) : r.type === "checkbox" ? (u(), g("input", {
1832
1832
  key: 4,
1833
1833
  type: "checkbox",
1834
- checked: !!((X = r.checkbox) != null && X.value),
1834
+ checked: !!((Y = r.checkbox) != null && Y.value),
1835
1835
  disabled: "",
1836
1836
  class: "el-check"
1837
1837
  }, null, 8, Wi)) : r.type === "radio" ? (u(), g("input", {
@@ -1843,13 +1843,13 @@ const Ni = {
1843
1843
  }, null, 8, Gi)) : r.type === "superscript" ? (u(), g("sup", {
1844
1844
  key: 6,
1845
1845
  style: V(K(_e)(r))
1846
- }, Y(r.value), 5)) : r.type === "subscript" ? (u(), g("sub", {
1846
+ }, Z(r.value), 5)) : r.type === "subscript" ? (u(), g("sub", {
1847
1847
  key: 7,
1848
1848
  style: V(K(_e)(r))
1849
- }, Y(r.value), 5)) : r.type === "tab" ? (u(), g("span", {
1849
+ }, Z(r.value), 5)) : r.type === "tab" ? (u(), g("span", {
1850
1850
  key: 8,
1851
1851
  class: "doc-tab",
1852
- style: V({ width: (r.size || K(We)) + "px" })
1852
+ style: V({ width: (r.size || K(ze)) + "px" })
1853
1853
  }, null, 4)) : ve("", !0)
1854
1854
  ], 64);
1855
1855
  }), 128))
@@ -1858,22 +1858,22 @@ const Ni = {
1858
1858
  class: "doc-list",
1859
1859
  style: V({ listStyleType: t.block.listStyle === "decimal" ? "decimal" : t.block.listStyle === "lower-alpha" ? "lower-alpha" : "disc", paddingLeft: s.value ? s.value + 24 + "px" : void 0 })
1860
1860
  }, {
1861
- default: qe(() => [
1862
- (u(!0), g(G, null, Q(t.block.items, (r, M) => (u(), g("li", {
1863
- key: M,
1861
+ default: We(() => [
1862
+ (u(!0), g(G, null, Q(t.block.items, (r, E) => (u(), g("li", {
1863
+ key: E,
1864
1864
  class: "doc-list-item"
1865
1865
  }, [
1866
- (u(!0), g(G, null, Q(r, (x, $) => (u(), g(G, { key: $ }, [
1867
- !x.type || x.type === "text" ? (u(), g("span", {
1866
+ (u(!0), g(G, null, Q(r, (b, T) => (u(), g(G, { key: T }, [
1867
+ !b.type || b.type === "text" ? (u(), g("span", {
1868
1868
  key: 0,
1869
- style: V(K(_e)(x))
1870
- }, Y(x.value), 5)) : x.type === "superscript" ? (u(), g("sup", {
1869
+ style: V(K(_e)(b))
1870
+ }, Z(b.value), 5)) : b.type === "superscript" ? (u(), g("sup", {
1871
1871
  key: 1,
1872
- style: V(K(_e)(x))
1873
- }, Y(x.value), 5)) : x.type === "subscript" ? (u(), g("sub", {
1872
+ style: V(K(_e)(b))
1873
+ }, Z(b.value), 5)) : b.type === "subscript" ? (u(), g("sub", {
1874
1874
  key: 2,
1875
- style: V(K(_e)(x))
1876
- }, Y(x.value), 5)) : ve("", !0)
1875
+ style: V(K(_e)(b))
1876
+ }, Z(b.value), 5)) : ve("", !0)
1877
1877
  ], 64))), 128))
1878
1878
  ]))), 128))
1879
1879
  ]),
@@ -1903,111 +1903,111 @@ const Ni = {
1903
1903
  })
1904
1904
  }, [
1905
1905
  (y = t.block.tableEl.colgroup) != null && y.length ? (u(), g("colgroup", Ji, [
1906
- (u(!0), g(G, null, Q(t.block.tableEl.colgroup, (r, M) => (u(), g("col", {
1907
- key: M,
1906
+ (u(!0), g(G, null, Q(t.block.tableEl.colgroup, (r, E) => (u(), g("col", {
1907
+ key: E,
1908
1908
  style: V({ width: (t.isHeaderFooter ? r.width : r.width * K(gt)(t.block.tableEl, s.value)) + "px" })
1909
1909
  }, null, 4))), 128))
1910
1910
  ])) : ve("", !0),
1911
1911
  ne("tbody", null, [
1912
- (u(!0), g(G, null, Q(t.block.trGroup, (r, M) => (u(), g("tr", {
1913
- key: M,
1912
+ (u(!0), g(G, null, Q(t.block.trGroup, (r, E) => (u(), g("tr", {
1913
+ key: E,
1914
1914
  style: V({ height: (r.height || r.minHeight || 30) + "px" })
1915
1915
  }, [
1916
- (u(!0), g(G, null, Q(r.tdList || [], (x, $) => (u(), g("td", {
1917
- key: $,
1918
- colspan: x.colspan || 1,
1919
- rowspan: x.rowspan || 1,
1916
+ (u(!0), g(G, null, Q(r.tdList || [], (b, T) => (u(), g("td", {
1917
+ key: T,
1918
+ colspan: b.colspan || 1,
1919
+ rowspan: b.rowspan || 1,
1920
1920
  style: V({
1921
- backgroundColor: x.backgroundColor || void 0,
1922
- verticalAlign: K(Di)(x),
1923
- width: x.width ? x.width * K(gt)(t.block.tableEl, s.value) + "px" : void 0,
1924
- height: x.height ? x.height + "px" : void 0
1921
+ backgroundColor: b.backgroundColor || void 0,
1922
+ verticalAlign: K(Di)(b),
1923
+ width: b.width ? b.width * K(gt)(t.block.tableEl, s.value) + "px" : void 0,
1924
+ height: b.height ? b.height + "px" : void 0
1925
1925
  })
1926
1926
  }, [
1927
- (u(!0), g(G, null, Q(K(Ge)(x.value), (B, W) => (u(), g(G, { key: W }, [
1927
+ (u(!0), g(G, null, Q(K(Ge)(b.value), (B, W) => (u(), g(G, { key: W }, [
1928
1928
  B.type === "paragraph" ? (u(), g("p", {
1929
1929
  key: 0,
1930
1930
  class: "cell-para",
1931
1931
  style: V(K(zt)(B))
1932
1932
  }, [
1933
1933
  B.elements.length ? ve("", !0) : (u(), g("span", Yi, " ")),
1934
- (u(!0), g(G, null, Q(B.elements, (I, D) => {
1935
- var T, h, F, P, E, X, ue;
1934
+ (u(!0), g(G, null, Q(B.elements, (M, D) => {
1935
+ var A, h, F, $, I, Y, ue;
1936
1936
  return u(), g(G, { key: D }, [
1937
- !I.type || I.type === "text" ? (u(), g("span", {
1937
+ !M.type || M.type === "text" ? (u(), g("span", {
1938
1938
  key: 0,
1939
- style: V(K(_e)(I))
1940
- }, Y(I.value), 5)) : I.type === "image" ? (u(), g("img", {
1939
+ style: V(K(_e)(M))
1940
+ }, Z(M.value), 5)) : M.type === "image" ? (u(), g("img", {
1941
1941
  key: 1,
1942
- src: o(I.value),
1942
+ src: o(M.value),
1943
1943
  class: "doc-image",
1944
1944
  style: V({
1945
- width: I.width ? I.width + "px" : "auto",
1946
- height: I.height ? I.height + "px" : "auto"
1945
+ width: M.width ? M.width + "px" : "auto",
1946
+ height: M.height ? M.height + "px" : "auto"
1947
1947
  })
1948
- }, null, 12, Zi)) : I.type === "hyperlink" ? (u(), g("a", {
1948
+ }, null, 12, Zi)) : M.type === "hyperlink" ? (u(), g("a", {
1949
1949
  key: 2,
1950
- href: I.url,
1950
+ href: M.url,
1951
1951
  class: "doc-link",
1952
1952
  target: "_blank"
1953
1953
  }, [
1954
- (u(!0), g(G, null, Q(I.valueList || [], (z, ie) => (u(), g("span", {
1954
+ (u(!0), g(G, null, Q(M.valueList || [], (z, ie) => (u(), g("span", {
1955
1955
  key: ie,
1956
1956
  style: V(K(_e)(z))
1957
- }, Y(z.value), 5))), 128))
1958
- ], 8, Qi)) : I.type === "control" ? (u(), g(G, { key: 3 }, [
1959
- ((T = I.control) == null ? void 0 : T.type) === "text" ? (u(), g("span", {
1957
+ }, Z(z.value), 5))), 128))
1958
+ ], 8, Qi)) : M.type === "control" ? (u(), g(G, { key: 3 }, [
1959
+ ((A = M.control) == null ? void 0 : A.type) === "text" ? (u(), g("span", {
1960
1960
  key: 0,
1961
- style: V({ fontSize: (I.control.size || 12) + "px" })
1961
+ style: V({ fontSize: (M.control.size || 12) + "px" })
1962
1962
  }, [
1963
- (u(!0), g(G, null, Q(I.control.value || [], (z, ie) => (u(), g("span", {
1963
+ (u(!0), g(G, null, Q(M.control.value || [], (z, ie) => (u(), g("span", {
1964
1964
  key: ie,
1965
1965
  style: V(K(_e)(z))
1966
- }, Y(z.value), 5))), 128))
1967
- ], 4)) : ((h = I.control) == null ? void 0 : h.type) === "input" ? (u(), g("span", {
1966
+ }, Z(z.value), 5))), 128))
1967
+ ], 4)) : ((h = M.control) == null ? void 0 : h.type) === "input" ? (u(), g("span", {
1968
1968
  key: 1,
1969
1969
  class: "ctrl-input",
1970
- style: V({ fontSize: (I.control.size || 12) + "px" })
1970
+ style: V({ fontSize: (M.control.size || 12) + "px" })
1971
1971
  }, [
1972
- (u(!0), g(G, null, Q(I.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Y(z.value), 1))), 128))
1973
- ], 4)) : ((F = I.control) == null ? void 0 : F.type) === "radio" ? (u(), g("span", {
1972
+ (u(!0), g(G, null, Q(M.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Z(z.value), 1))), 128))
1973
+ ], 4)) : ((F = M.control) == null ? void 0 : F.type) === "radio" ? (u(), g("span", {
1974
1974
  key: 2,
1975
- class: Pe(["ctrl-options", { "ctrl-options--vertical": ((E = (P = I.control.extension) == null ? void 0 : P.elementAttributes) == null ? void 0 : E.layout) === "vertical" }])
1975
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((I = ($ = M.control.extension) == null ? void 0 : $.elementAttributes) == null ? void 0 : I.layout) === "vertical" }])
1976
1976
  }, [
1977
- (u(!0), g(G, null, Q(I.control.valueSets || [], (z, ie) => (u(), g("label", {
1977
+ (u(!0), g(G, null, Q(M.control.valueSets || [], (z, ie) => (u(), g("label", {
1978
1978
  key: ie,
1979
1979
  class: "ctrl-option"
1980
1980
  }, [
1981
1981
  ne("input", {
1982
1982
  type: "radio",
1983
1983
  disabled: "",
1984
- checked: I.control.code === z.code
1984
+ checked: M.control.code === z.code
1985
1985
  }, null, 8, el),
1986
- Le(Y(z.value), 1)
1986
+ Le(Z(z.value), 1)
1987
1987
  ]))), 128))
1988
1988
  ], 2)) : ve("", !0)
1989
- ], 64)) : I.type === "checkbox" ? (u(), g("input", {
1989
+ ], 64)) : M.type === "checkbox" ? (u(), g("input", {
1990
1990
  key: 4,
1991
1991
  type: "checkbox",
1992
- checked: !!((X = I.checkbox) != null && X.value),
1992
+ checked: !!((Y = M.checkbox) != null && Y.value),
1993
1993
  disabled: "",
1994
1994
  class: "el-check"
1995
- }, null, 8, tl)) : I.type === "radio" ? (u(), g("input", {
1995
+ }, null, 8, tl)) : M.type === "radio" ? (u(), g("input", {
1996
1996
  key: 5,
1997
1997
  type: "radio",
1998
- checked: !!((ue = I.radio) != null && ue.value),
1998
+ checked: !!((ue = M.radio) != null && ue.value),
1999
1999
  disabled: "",
2000
2000
  class: "el-check"
2001
- }, null, 8, nl)) : I.type === "superscript" ? (u(), g("sup", {
2001
+ }, null, 8, nl)) : M.type === "superscript" ? (u(), g("sup", {
2002
2002
  key: 6,
2003
- style: V(K(_e)(I))
2004
- }, Y(I.value), 5)) : I.type === "subscript" ? (u(), g("sub", {
2003
+ style: V(K(_e)(M))
2004
+ }, Z(M.value), 5)) : M.type === "subscript" ? (u(), g("sub", {
2005
2005
  key: 7,
2006
- style: V(K(_e)(I))
2007
- }, Y(I.value), 5)) : I.type === "tab" ? (u(), g("span", {
2006
+ style: V(K(_e)(M))
2007
+ }, Z(M.value), 5)) : M.type === "tab" ? (u(), g("span", {
2008
2008
  key: 8,
2009
2009
  class: "doc-tab",
2010
- style: V({ width: (I.size || K(We)) + "px" })
2010
+ style: V({ width: (M.size || K(ze)) + "px" })
2011
2011
  }, null, 4)) : ve("", !0)
2012
2012
  ], 64);
2013
2013
  }), 128))
@@ -2021,7 +2021,7 @@ const Ni = {
2021
2021
  ], 6)) : ve("", !0);
2022
2022
  };
2023
2023
  }
2024
- }, pt = /* @__PURE__ */ Ne(il, [["__scopeId", "data-v-b9e67b24"]]), ll = { class: "editor-layout word-editor-scope" }, ol = { class: "editor-container" }, al = {
2024
+ }, pt = /* @__PURE__ */ Ve(il, [["__scopeId", "data-v-b9e67b24"]]), ll = { class: "editor-layout word-editor-scope" }, ol = { class: "editor-container" }, al = {
2025
2025
  key: 0,
2026
2026
  class: "editor-loading"
2027
2027
  }, sl = {
@@ -2055,11 +2055,11 @@ const Ni = {
2055
2055
  _t(() => {
2056
2056
  s = new ResizeObserver((h) => {
2057
2057
  const F = {};
2058
- for (const P of h) {
2059
- const E = P.target._rowKey;
2060
- if (!E) continue;
2061
- const X = Math.round(P.contentRect.height);
2062
- X > (o.value[E] || 0) && (F[E] = X);
2058
+ for (const $ of h) {
2059
+ const I = $.target._rowKey;
2060
+ if (!I) continue;
2061
+ const Y = Math.round($.contentRect.height);
2062
+ Y > (o.value[I] || 0) && (F[I] = Y);
2063
2063
  }
2064
2064
  Object.keys(F).length && (o.value = { ...o.value, ...F });
2065
2065
  });
@@ -2071,12 +2071,12 @@ const Ni = {
2071
2071
  }
2072
2072
  yt("bindTableObserver", v), yt("resolveImageUrl", e.resolveImageUrl);
2073
2073
  const m = de(
2074
- () => Math.max(100, dl - ul * 2 - x.value - hl)
2074
+ () => Math.max(100, dl - ul * 2 - b.value - hl)
2075
2075
  ), y = de(() => {
2076
- const h = Ge(n.value), F = [], P = m.value;
2077
- let E = 0, X = !1;
2076
+ const h = Ge(n.value), F = [], $ = m.value;
2077
+ let I = 0, Y = !1;
2078
2078
  const ue = (H) => {
2079
- F.push({ ...H, _isCover: X });
2079
+ F.push({ ...H, _isCover: Y });
2080
2080
  }, z = Li(), ie = { first: 0, second: 1, third: 2, fourth: 3, fifth: 4, sixth: 5, seventh: 6, eighth: 7 };
2081
2081
  let Ce = -1;
2082
2082
  const Je = (H) => {
@@ -2086,7 +2086,7 @@ const Ni = {
2086
2086
  return h.forEach((H, he) => {
2087
2087
  var Me, ct, Xe, Ye;
2088
2088
  const me = Je(H);
2089
- if (me && (E = 0), X = !!H._isCover, H.type === "title") {
2089
+ if (me && (I = 0), Y = !!H._isCover, H.type === "title") {
2090
2090
  const fe = H.el.valueList || [], se = z.next(H.el.level, (Me = H.el.extension) == null ? void 0 : Me.startIndex), ke = fe.some((ge) => {
2091
2091
  var ye;
2092
2092
  return (ye = ge.extension) == null ? void 0 : ye.isIndex;
@@ -2107,8 +2107,8 @@ const Ni = {
2107
2107
  ...fe
2108
2108
  ];
2109
2109
  }
2110
- const we = Ie.map((ge) => ge.value || "").join(""), le = ze(Ie);
2111
- E = E + le > P && E > 0 ? le : E + le, Ce = ie[H.el.level] ?? 0, ue({
2110
+ const we = Ie.map((ge) => ge.value || "").join(""), le = Ne(Ie);
2111
+ I = I + le > $ && I > 0 ? le : I + le, Ce = ie[H.el.level] ?? 0, ue({
2112
2112
  node_id: `blk_${he}_0`,
2113
2113
  layer: me ? 1 : 100,
2114
2114
  blockType: "title",
@@ -2123,8 +2123,8 @@ const Ni = {
2123
2123
  } else if (H.type === "paragraph") {
2124
2124
  const fe = Bi(H.elements), se = Ce >= 0 ? (Ce + 1) * 20 : 0;
2125
2125
  fe.forEach((ke, Ie) => {
2126
- const we = ke.map((ge) => ge.value || "").join(""), le = ze(ke);
2127
- E = E + le > P && E > 0 ? le : E + le, ue({
2126
+ const we = ke.map((ge) => ge.value || "").join(""), le = Ne(ke);
2127
+ I = I + le > $ && I > 0 ? le : I + le, ue({
2128
2128
  node_id: `blk_${he}_${Ie}`,
2129
2129
  layer: me && Ie === 0 ? 1 : 100,
2130
2130
  blockType: "paragraph",
@@ -2143,11 +2143,11 @@ const Ni = {
2143
2143
  (oe, ee) => oe + (ee.height || ee.minHeight || 35),
2144
2144
  0
2145
2145
  ), Ee = `blk_${he}_0`, be = Math.max(O, o.value[Ee] || 0);
2146
- if (E > 0 && E + be > P && (E = 0), be > P) {
2147
- const oe = Math.ceil(be / P);
2146
+ if (I > 0 && I + be > $ && (I = 0), be > $) {
2147
+ const oe = Math.ceil(be / $);
2148
2148
  for (let ee = 0; ee < oe; ee++) {
2149
- const re = ee * P, Te = Math.min(P, be - re), Re = ee > 0 || E > 0;
2150
- E = Te, ue({
2149
+ const re = ee * $, Te = Math.min($, be - re), Re = ee > 0 || I > 0;
2150
+ I = Te, ue({
2151
2151
  node_id: `blk_${he}_0_s${ee}`,
2152
2152
  layer: me && ee === 0 ? 1 : 100,
2153
2153
  blockType: "table-row-group",
@@ -2167,8 +2167,8 @@ const Ni = {
2167
2167
  });
2168
2168
  }
2169
2169
  } else {
2170
- const oe = E > 0;
2171
- E = E + be > P ? be : E + be, ue({
2170
+ const oe = I > 0;
2171
+ I = I + be > $ ? be : I + be, ue({
2172
2172
  node_id: `blk_${he}_0`,
2173
2173
  layer: me ? 1 : 100,
2174
2174
  blockType: "table-row-group",
@@ -2189,11 +2189,11 @@ const Ni = {
2189
2189
  (ee, re) => ee + (re.height || re.minHeight || 35),
2190
2190
  0
2191
2191
  ), oe = Math.max(be, o.value[Ee] || 0);
2192
- if (oe > P) {
2193
- const ee = Math.ceil(oe / P);
2192
+ if (oe > $) {
2193
+ const ee = Math.ceil(oe / $);
2194
2194
  for (let re = 0; re < ee; re++) {
2195
- const Te = re * P, Re = Math.min(P, oe - Te), dt = re > 0 || E > 0;
2196
- E = Re, ue({
2195
+ const Te = re * $, Re = Math.min($, oe - Te), dt = re > 0 || I > 0;
2196
+ I = Re, ue({
2197
2197
  node_id: `blk_${he}_${O}_s${re}`,
2198
2198
  layer: me && O === 0 && re === 0 ? 1 : 100,
2199
2199
  blockType: "table-row-group",
@@ -2213,8 +2213,8 @@ const Ni = {
2213
2213
  });
2214
2214
  }
2215
2215
  } else {
2216
- const ee = O > 0 && E + oe > P;
2217
- E = E + oe > P ? oe : E + oe, ue({
2216
+ const ee = O > 0 && I + oe > $;
2217
+ I = I + oe > $ ? oe : I + oe, ue({
2218
2218
  node_id: `blk_${he}_${O}`,
2219
2219
  layer: me && O === 0 ? 1 : 100,
2220
2220
  blockType: "table-row-group",
@@ -2234,8 +2234,8 @@ const Ni = {
2234
2234
  const fe = Math.round(18);
2235
2235
  let se = 0;
2236
2236
  for (const ke of H.items)
2237
- se += ke.length ? ze(ke) : fe;
2238
- se = Math.max(se, fe), E = E + se > P && E > 0 ? se : E + se, ue({
2237
+ se += ke.length ? Ne(ke) : fe;
2238
+ se = Math.max(se, fe), I = I + se > $ && I > 0 ? se : I + se, ue({
2239
2239
  node_id: `blk_${he}_0`,
2240
2240
  layer: me ? 1 : 100,
2241
2241
  blockType: "list",
@@ -2251,20 +2251,20 @@ const Ni = {
2251
2251
  var F;
2252
2252
  const h = (F = e.data) == null ? void 0 : F.header;
2253
2253
  return h != null && h.length ? Ge(h) : [];
2254
- }), M = de(() => {
2254
+ }), E = de(() => {
2255
2255
  var F;
2256
2256
  const h = (F = e.data) == null ? void 0 : F.footer;
2257
2257
  return h != null && h.length ? Ge(h) : [];
2258
- }), x = de(() => Nt(r.value, !0)), $ = de(() => Nt(M.value, !0)), B = de(() => r.value.length > 0), W = de(() => M.value.length > 0);
2259
- function I(h) {
2260
- var P, E, X;
2258
+ }), b = de(() => Nt(r.value, !0)), T = de(() => Nt(E.value, !0)), B = de(() => r.value.length > 0), W = de(() => E.value.length > 0);
2259
+ function M(h) {
2260
+ var $, I, Y;
2261
2261
  const F = h.type === "table";
2262
2262
  return {
2263
2263
  blockType: F ? "table-row-group" : h.type,
2264
2264
  elements: h.elements,
2265
2265
  rowFlex: h.rowFlex,
2266
- level: (P = h.el) == null ? void 0 : P.level,
2267
- titleValueList: ((E = h.el) == null ? void 0 : E.valueList) || h.titleValueList,
2266
+ level: ($ = h.el) == null ? void 0 : $.level,
2267
+ titleValueList: ((I = h.el) == null ? void 0 : I.valueList) || h.titleValueList,
2268
2268
  listType: h.listType,
2269
2269
  listStyle: h.listStyle,
2270
2270
  items: h.items,
@@ -2273,18 +2273,18 @@ const Ni = {
2273
2273
  tableEl: F ? h.el : void 0,
2274
2274
  isFirst: !0,
2275
2275
  isLast: !0,
2276
- tableRowFlex: ((X = h.el) == null ? void 0 : X.rowFlex) || null
2276
+ tableRowFlex: ((Y = h.el) == null ? void 0 : Y.rowFlex) || null
2277
2277
  };
2278
2278
  }
2279
2279
  const D = de(() => Pi(y.value));
2280
- function T(h) {
2280
+ function A(h) {
2281
2281
  var F;
2282
2282
  (F = l.value) == null || F.scrollToRow({ node_id: h.nodeId });
2283
2283
  }
2284
2284
  return (h, F) => (u(), g("div", ll, [
2285
2285
  q(Fi, {
2286
2286
  items: D.value,
2287
- onNavigate: T
2287
+ onNavigate: A
2288
2288
  }, null, 8, ["items"]),
2289
2289
  ne("div", ol, [
2290
2290
  t.loading ? (u(), g("div", al, " 加载中… ")) : (u(), Fe(K(hi), {
@@ -2303,16 +2303,16 @@ const Ni = {
2303
2303
  showPageBorder: !0,
2304
2304
  pageBorderPadding: 5,
2305
2305
  pageBorderStyle: "1px solid #333",
2306
- headerHeight: x.value,
2307
- footerHeight: $.value,
2306
+ headerHeight: b.value,
2307
+ footerHeight: T.value,
2308
2308
  showPageNumber: !0
2309
2309
  },
2310
2310
  data: y.value
2311
2311
  }, Mn({
2312
- default: qe(() => [
2312
+ default: We(() => [
2313
2313
  q(K(pi), null, {
2314
- default: qe(({ row: P }) => [
2315
- q(pt, { block: P }, null, 8, ["block"])
2314
+ default: We(({ row: $ }) => [
2315
+ q(pt, { block: $ }, null, 8, ["block"])
2316
2316
  ]),
2317
2317
  _: 1
2318
2318
  })
@@ -2321,11 +2321,11 @@ const Ni = {
2321
2321
  }, [
2322
2322
  B.value ? {
2323
2323
  name: "page-header",
2324
- fn: qe(({ isCoverPage: P }) => [
2325
- P ? ve("", !0) : (u(), g("div", sl, [
2326
- (u(!0), g(G, null, Q(r.value, (E, X) => (u(), Fe(pt, {
2327
- key: X,
2328
- block: I(E),
2324
+ fn: We(({ isCoverPage: $ }) => [
2325
+ $ ? ve("", !0) : (u(), g("div", sl, [
2326
+ (u(!0), g(G, null, Q(r.value, (I, Y) => (u(), Fe(pt, {
2327
+ key: Y,
2328
+ block: M(I),
2329
2329
  "is-header-footer": !0
2330
2330
  }, null, 8, ["block"]))), 128))
2331
2331
  ]))
@@ -2334,14 +2334,14 @@ const Ni = {
2334
2334
  } : void 0,
2335
2335
  W.value ? {
2336
2336
  name: "page-footer",
2337
- fn: qe(({ pageNumber: P, totalPages: E }) => [
2337
+ fn: We(({ pageNumber: $, totalPages: I }) => [
2338
2338
  ne("div", rl, [
2339
- (u(!0), g(G, null, Q(M.value, (X, ue) => (u(), Fe(pt, {
2339
+ (u(!0), g(G, null, Q(E.value, (Y, ue) => (u(), Fe(pt, {
2340
2340
  key: ue,
2341
- block: I(X),
2341
+ block: M(Y),
2342
2342
  "is-header-footer": !0
2343
2343
  }, null, 8, ["block"]))), 128)),
2344
- ne("div", cl, " 第" + Y(P) + "页 / 共" + Y(E) + "页 ", 1)
2344
+ ne("div", cl, " 第" + Z($) + "页 / 共" + Z(I) + "页 ", 1)
2345
2345
  ])
2346
2346
  ]),
2347
2347
  key: "1"
@@ -2350,7 +2350,7 @@ const Ni = {
2350
2350
  ])
2351
2351
  ]));
2352
2352
  }
2353
- }, gl = /* @__PURE__ */ Ne(fl, [["__scopeId", "data-v-9ff2db2b"]]), Vt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2353
+ }, gl = /* @__PURE__ */ Ve(fl, [["__scopeId", "data-v-9ff2db2b"]]), Vt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2354
2354
  function ot(t = 10) {
2355
2355
  const e = crypto.getRandomValues(new Uint8Array(t));
2356
2356
  return Array.from(e).map((n) => Vt[n % Vt.length]).join("");
@@ -2469,16 +2469,16 @@ class st {
2469
2469
  const o = this.getAllParagraphs();
2470
2470
  let s = !1;
2471
2471
  for (const { paragraph: v, sectionIndex: m, paragraphIndex: y } of o) {
2472
- const r = m === e.sectionIndex && y === e.paragraphIndex, M = m === n.sectionIndex && y === n.paragraphIndex;
2472
+ const r = m === e.sectionIndex && y === e.paragraphIndex, E = m === n.sectionIndex && y === n.paragraphIndex;
2473
2473
  if (r && (s = !0), s)
2474
- for (let x = 0; x < v.children.length; x++) {
2475
- const $ = v.children[x];
2476
- if (!(r && x < e.elementIndex)) {
2477
- if (M && x > n.elementIndex) break;
2478
- $.format = { ...$.format, ...l };
2474
+ for (let b = 0; b < v.children.length; b++) {
2475
+ const T = v.children[b];
2476
+ if (!(r && b < e.elementIndex)) {
2477
+ if (E && b > n.elementIndex) break;
2478
+ T.format = { ...T.format, ...l };
2479
2479
  }
2480
2480
  }
2481
- if (M) break;
2481
+ if (E) break;
2482
2482
  }
2483
2483
  this.bumpVersion();
2484
2484
  }
@@ -2740,7 +2740,7 @@ class Kt {
2740
2740
  }
2741
2741
  }
2742
2742
  }
2743
- class Ue {
2743
+ class qe {
2744
2744
  constructor(e, n, l, o) {
2745
2745
  N(this, "name");
2746
2746
  N(this, "_prevFormat", {});
@@ -2805,8 +2805,8 @@ class bl {
2805
2805
  const { focus: l } = this.selectionManager.selection;
2806
2806
  return new ml(this.docModel, this.selectionManager, l, n);
2807
2807
  }), this.register("insertParagraph", () => new yl(this.docModel, this.selectionManager)), this.register("deleteBackward", () => new Kt(this.docModel, this.selectionManager, "backward")), this.register("deleteForward", () => new Kt(this.docModel, this.selectionManager, "forward")), this.register("undo", () => null), this.register("redo", () => null), ["bold", "italic", "underline", "strikethrough", "superscript", "subscript"].forEach((n) => {
2808
- this.register(n, () => new Ue(this.docModel, this.selectionManager, n));
2809
- }), this.register("fontSize", (n) => new Ue(this.docModel, this.selectionManager, "fontSize", n)), this.register("fontFamily", (n) => new Ue(this.docModel, this.selectionManager, "fontFamily", n)), this.register("color", (n) => new Ue(this.docModel, this.selectionManager, "color", n)), this.register("backgroundColor", (n) => new Ue(this.docModel, this.selectionManager, "backgroundColor", n)), this.register("textAlign", (n) => new vt(this.docModel, this.selectionManager, "textAlign", n)), this.register("lineHeight", (n) => new vt(this.docModel, this.selectionManager, "lineHeight", n)), this.register("heading", (n) => new vt(this.docModel, this.selectionManager, "heading", n)), this.register("selectAll", () => (this.selectionManager.selectAll(), null)), this.register("setSelection", (n) => {
2808
+ this.register(n, () => new qe(this.docModel, this.selectionManager, n));
2809
+ }), this.register("fontSize", (n) => new qe(this.docModel, this.selectionManager, "fontSize", n)), this.register("fontFamily", (n) => new qe(this.docModel, this.selectionManager, "fontFamily", n)), this.register("color", (n) => new qe(this.docModel, this.selectionManager, "color", n)), this.register("backgroundColor", (n) => new qe(this.docModel, this.selectionManager, "backgroundColor", n)), this.register("textAlign", (n) => new vt(this.docModel, this.selectionManager, "textAlign", n)), this.register("lineHeight", (n) => new vt(this.docModel, this.selectionManager, "lineHeight", n)), this.register("heading", (n) => new vt(this.docModel, this.selectionManager, "heading", n)), this.register("selectAll", () => (this.selectionManager.selectAll(), null)), this.register("setSelection", (n) => {
2810
2810
  if (n) {
2811
2811
  const l = n;
2812
2812
  this.selectionManager.setSelection(l.anchor, l.focus);