gbrichtext 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- import { getCurrentInstance as wi, getCurrentScope as xi, onScopeDispose as Li, computed as j, openBlock as N, createElementBlock as D, createBlock as J, unref as q, normalizeProps as ro, guardReactiveProps as io, ref as S, reactive as Mi, watch as Ie, onBeforeUnmount as Rt, shallowRef as Ni, onMounted as ir, normalizeStyle as Z, normalizeClass as be, renderSlot as de, createElementVNode as I, createCommentVNode as U, withModifiers as te, toDisplayString as pe, createVNode as B, Fragment as nt, renderList as xt, nextTick as rt, withCtx as re, withDirectives as lr, withKeys as et, vModelText as sr, createTextVNode as wo, Teleport as Ri, Transition as Oi, markRaw as Bi, h as Ii, defineAsyncComponent as Hi, createSlots as zi } from "vue";
2
- import { gbToast as Kt, FONT_SIZES as Je, GbImageViewer as Di, GbPopover as $i, RECENT_STYLE_LIMIT as _i, FONT_FAMILIES as xo, GbAppearancePanel as ar, ALIGN_OPTIONS as Pi, GbTableSizePicker as Fi, GbButton as Lo, GbContextMenu as qi, TEXT_COLORS as Ui, GbFindBar as Vi } from "guabiui";
1
+ import { getCurrentInstance as xi, getCurrentScope as Li, onScopeDispose as Mi, computed as j, openBlock as N, createElementBlock as D, createBlock as Q, unref as U, normalizeProps as ro, guardReactiveProps as io, ref as S, reactive as Ni, watch as Ie, onBeforeUnmount as Rt, shallowRef as Ri, onMounted as lr, normalizeStyle as J, normalizeClass as be, renderSlot as de, createElementVNode as I, createCommentVNode as F, withModifiers as te, toDisplayString as pe, createVNode as B, Fragment as Ue, renderList as xt, nextTick as rt, withCtx as re, withDirectives as sr, withKeys as tt, vModelText as ar, createTextVNode as wo, Teleport as Oi, Transition as Bi, markRaw as Ii, h as Hi, defineAsyncComponent as zi, createSlots as Di } from "vue";
2
+ import { gbToast as Kt, FONT_SIZES as et, GbImageViewer as $i, GbPopover as _i, RECENT_STYLE_LIMIT as Pi, FONT_FAMILIES as xo, GbAppearancePanel as cr, ALIGN_OPTIONS as Fi, GbTableSizePicker as qi, GbButton as Lo, GbContextMenu as Ui, TEXT_COLORS as Vi, GbFindBar as Gi } from "guabiui";
3
3
  const ge = {
4
4
  info: (e, t) => Kt.info(e, t),
5
5
  success: (e, t) => Kt.success(e, t),
6
6
  warning: (e, t) => Kt.warning(e, t),
7
7
  error: (e, t) => Kt.error(e, t)
8
- }, Mo = 50 * 1024 * 1024, Gi = (e) => {
8
+ }, Mo = 50 * 1024 * 1024, Ki = (e) => {
9
9
  if (!e || !/<img\s/i.test(e)) return e || "";
10
10
  const t = new DOMParser().parseFromString(e, "text/html");
11
11
  return t.querySelectorAll("img:not([loading])").forEach((n) => n.setAttribute("loading", "lazy")), t.body.innerHTML;
12
- }, Ki = (e) => new Promise((t, n) => {
12
+ }, Xi = (e) => new Promise((t, n) => {
13
13
  const o = new FileReader();
14
14
  o.onload = (r) => t(r.target.result), o.onerror = (r) => n(r), o.readAsDataURL(e);
15
- }), cr = (e) => {
15
+ }), ur = (e) => {
16
16
  const t = [];
17
17
  if (!e) return t;
18
18
  if (e.items?.length) {
@@ -24,7 +24,7 @@ const ge = {
24
24
  } else e.files?.length && t.push(...Array.from(e.files).filter((n) => n.type.startsWith("image/")));
25
25
  return t;
26
26
  };
27
- async function Xi(e) {
27
+ async function ji(e) {
28
28
  const t = [];
29
29
  for (const n of e || []) {
30
30
  if (n.size > Mo) {
@@ -32,15 +32,15 @@ async function Xi(e) {
32
32
  continue;
33
33
  }
34
34
  try {
35
- t.push({ file: n, src: await Ki(n) });
35
+ t.push({ file: n, src: await Xi(n) });
36
36
  } catch {
37
37
  ge.error("图片读取失败");
38
38
  }
39
39
  }
40
40
  return t;
41
41
  }
42
- const ji = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "TD", "TH"]), Wi = /* @__PURE__ */ new Set(["BLOCKQUOTE", "UL", "OL", "PRE", "TABLE", "HR", "IMG", "LI"]), Yi = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "TD", "TH", "LI", "BLOCKQUOTE"]), He = "data-callout", fe = "data-super", ye = "data-col", Ot = (e) => !!e && e.nodeType === Node.ELEMENT_NODE && (e.hasAttribute(He) || e.hasAttribute(fe)), mn = (e) => !!e && e.nodeType === Node.ELEMENT_NODE && e.hasAttribute(ye), Fn = "is-selected-node", At = "is-block-dragging", ur = "re-cell-dragging", Qi = "is-catalog-hit", Tt = "is-block-selected", qn = "is-block-hover", tn = [Fn, At, ur, Qi, Tt, qn], Zi = ["data-attach", "data-ref-doc"], Ji = "[data-attach],[data-ref-doc]", nn = ".wd-page-gap, .wd-col-sep", el = ".wd-col", Zt = "data-wd-split", it = (e) => e?.nodeType === Node.ELEMENT_NODE && (e.matches(nn) || e.hasAttribute(Zt));
43
- function dr(e) {
42
+ const Wi = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "TD", "TH"]), Yi = /* @__PURE__ */ new Set(["BLOCKQUOTE", "UL", "OL", "PRE", "TABLE", "HR", "IMG", "LI"]), Qi = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "TD", "TH", "LI", "BLOCKQUOTE"]), He = "data-callout", fe = "data-super", ye = "data-col", Ot = (e) => !!e && e.nodeType === Node.ELEMENT_NODE && (e.hasAttribute(He) || e.hasAttribute(fe)), mn = (e) => !!e && e.nodeType === Node.ELEMENT_NODE && e.hasAttribute(ye), Fn = "is-selected-node", At = "is-block-dragging", dr = "re-cell-dragging", Zi = "is-catalog-hit", Tt = "is-block-selected", qn = "is-block-hover", tn = [Fn, At, dr, Zi, Tt, qn], Ji = ["data-attach", "data-ref-doc"], el = "[data-attach],[data-ref-doc]", nn = ".wd-page-gap, .wd-col-sep", tl = ".wd-col", Zt = "data-wd-split", it = (e) => e?.nodeType === Node.ELEMENT_NODE && (e.matches(nn) || e.hasAttribute(Zt));
43
+ function fr(e) {
44
44
  if (!e?.querySelector) return;
45
45
  const t = /* @__PURE__ */ new Map();
46
46
  e.querySelectorAll(`[${Zt}]`).forEach((n) => {
@@ -56,26 +56,26 @@ function dr(e) {
56
56
  }
57
57
  Ce(r, o), r.remove();
58
58
  }), o.removeAttribute(Zt);
59
- }), e.querySelectorAll(el).forEach((n) => Ht(n)), e.querySelectorAll(nn).forEach((n) => n.remove());
59
+ }), e.querySelectorAll(tl).forEach((n) => Ht(n)), e.querySelectorAll(nn).forEach((n) => n.remove());
60
60
  }
61
- const tl = tn.map((e) => `.${e}`).join(",");
61
+ const nl = tn.map((e) => `.${e}`).join(",");
62
62
  function pn(e) {
63
63
  if (!e?.classList?.length || !tn.some((n) => e.classList.contains(n))) return;
64
64
  const t = Array.from(e.classList).filter((n) => !tn.includes(n));
65
65
  t.length ? e.setAttribute("class", t.join(" ")) : e.removeAttribute("class");
66
66
  }
67
- const we = (e) => !!e && e.tagName === "LI" && e.hasAttribute("data-checked"), lo = (e) => !!e && e.tagName === "DIV" && we(e.parentElement), fr = (e) => !!e && e.tagName === "CODE" && e.parentElement?.tagName === "PRE";
68
- function hr(e) {
69
- return !e || e.nodeType !== Node.ELEMENT_NODE ? !1 : ji.has(e.tagName) ? !0 : e.tagName === "LI" ? !we(e) : lo(e) || fr(e);
67
+ const we = (e) => !!e && e.tagName === "LI" && e.hasAttribute("data-checked"), lo = (e) => !!e && e.tagName === "DIV" && we(e.parentElement), hr = (e) => !!e && e.tagName === "CODE" && e.parentElement?.tagName === "PRE";
68
+ function mr(e) {
69
+ return !e || e.nodeType !== Node.ELEMENT_NODE ? !1 : Wi.has(e.tagName) ? !0 : e.tagName === "LI" ? !we(e) : lo(e) || hr(e);
70
70
  }
71
71
  function Re(e, t) {
72
- return hr(e) && !!t && e !== t && t.contains(e);
72
+ return mr(e) && !!t && e !== t && t.contains(e);
73
73
  }
74
- function nl(e, t) {
75
- return !e || e === t || !t.contains(e) ? !1 : Wi.has(e.tagName) || Re(e, t) || Ot(e) || mn(e);
74
+ function ol(e, t) {
75
+ return !e || e === t || !t.contains(e) ? !1 : Yi.has(e.tagName) || Re(e, t) || Ot(e) || mn(e);
76
76
  }
77
77
  function on(e) {
78
- return !!e && (Yi.has(e.tagName) || hr(e) && e.tagName !== "CODE");
78
+ return !!e && (Qi.has(e.tagName) || mr(e) && e.tagName !== "CODE");
79
79
  }
80
80
  function X(e, t) {
81
81
  let n = e?.nodeType === Node.TEXT_NODE ? e.parentElement : e;
@@ -85,15 +85,15 @@ function X(e, t) {
85
85
  }
86
86
  return null;
87
87
  }
88
- function mr(e, t, n) {
88
+ function pr(e, t, n) {
89
89
  const o = [];
90
90
  let r = e?.nodeType === Node.TEXT_NODE ? e.parentElement : e;
91
91
  for (; r && r !== t; )
92
92
  o.unshift(r), r = r.parentElement;
93
93
  return o.find(n) || null;
94
94
  }
95
- const Ke = (e, t) => mr(e, t, (n) => nl(n, t)), ol = (e, t) => mr(e, t, (n) => on(n) || lo(n));
96
- function rl(e) {
95
+ const Xe = (e, t) => pr(e, t, (n) => ol(n, t)), rl = (e, t) => pr(e, t, (n) => on(n) || lo(n));
96
+ function il(e) {
97
97
  return lo(e) ? e.parentElement : e;
98
98
  }
99
99
  function Bt(e) {
@@ -107,7 +107,7 @@ function It(e) {
107
107
  for (const n of Array.from(e.childNodes)) t += It(n);
108
108
  return t;
109
109
  }
110
- function il(e, t) {
110
+ function ll(e, t) {
111
111
  let n = 0;
112
112
  const o = (i) => i.tagName === "BR" || i.tagName === "IMG" || i.getAttribute("contenteditable") === "false" || !i.childNodes.length, r = (i) => {
113
113
  for (const l of Array.from(i.childNodes)) {
@@ -125,7 +125,7 @@ function il(e, t) {
125
125
  function ae(e, t, n) {
126
126
  if (!e || !t) return 0;
127
127
  if (t === e) return No(e, n);
128
- const o = il(e, (r) => r === t);
128
+ const o = ll(e, (r) => r === t);
129
129
  return o < 0 ? Ae(e) : t.nodeType === Node.TEXT_NODE ? o + Math.min(n, t.data.length) : o + No(t, n);
130
130
  }
131
131
  function No(e, t) {
@@ -144,11 +144,11 @@ function so(e) {
144
144
  let t = "";
145
145
  const n = (o) => {
146
146
  for (const r of Array.from(o.childNodes))
147
- r.nodeType === Node.TEXT_NODE ? t += r.data : r.tagName === "IMG" || r.nodeType === Node.ELEMENT_NODE && Zi.some((i) => r.hasAttribute(i)) ? t += "" : Bt(r) && n(r);
147
+ r.nodeType === Node.TEXT_NODE ? t += r.data : r.tagName === "IMG" || r.nodeType === Node.ELEMENT_NODE && Ji.some((i) => r.hasAttribute(i)) ? t += "" : Bt(r) && n(r);
148
148
  };
149
149
  return e && n(e), t;
150
150
  }
151
- function Ve(e, t) {
151
+ function Ge(e, t) {
152
152
  let n = 0, o = null;
153
153
  const r = (i) => {
154
154
  if (o) return;
@@ -192,14 +192,14 @@ function ao(e, t) {
192
192
  const n = V(e);
193
193
  if (!n) return [];
194
194
  const o = X(n.commonAncestorContainer, e), r = (l, s) => l === s || s.contains(l), i = [];
195
- for (const l of pr(e)) {
195
+ for (const l of gr(e)) {
196
196
  if (l !== o && !n.intersectsNode(l)) continue;
197
197
  const s = Ae(l), a = r(n.startContainer, l) ? ae(l, n.startContainer, n.startOffset) : 0, c = r(n.endContainer, l) ? ae(l, n.endContainer, n.endOffset) : s;
198
198
  c < a || c === a && l !== X(n.startContainer, e) || i.push({ block: l, start: Math.min(Math.max(a, 0), s), end: Math.min(Math.max(c, 0), s) });
199
199
  }
200
200
  return i;
201
201
  }
202
- function pr(e) {
202
+ function gr(e) {
203
203
  const t = [], n = (o) => {
204
204
  for (const r of Array.from(o.children))
205
205
  if (Bt(r)) {
@@ -214,7 +214,7 @@ function pr(e) {
214
214
  }
215
215
  function gn(e, t, n) {
216
216
  if (!t?.block?.isConnected || !e.contains(t.block)) return;
217
- const o = Ve(t.block, t.offset ?? 0), r = n?.block?.isConnected && e.contains(n.block) ? Ve(n.block, n.offset ?? 0) : o, i = document.createRange();
217
+ const o = Ge(t.block, t.offset ?? 0), r = n?.block?.isConnected && e.contains(n.block) ? Ge(n.block, n.offset ?? 0) : o, i = document.createRange();
218
218
  try {
219
219
  i.setStart(o.node, o.offset), i.setEnd(r.node, r.offset);
220
220
  } catch {
@@ -249,20 +249,20 @@ function Xt(e) {
249
249
  function Ce(e, t) {
250
250
  for (; e.firstChild; ) t.appendChild(e.firstChild);
251
251
  }
252
- function gr(e) {
252
+ function vr(e) {
253
253
  const t = e?.parentNode;
254
254
  if (t)
255
255
  for (; e.firstChild; ) t.insertBefore(e.firstChild, e);
256
256
  }
257
257
  function Ht(e) {
258
- e?.parentNode && (gr(e), e.remove());
258
+ e?.parentNode && (vr(e), e.remove());
259
259
  }
260
260
  function Te(e, t) {
261
261
  if (e.tagName.toLowerCase() === t) return e;
262
262
  const n = document.createElement(t);
263
- return ll(e, n), Ce(e, n), e.replaceWith(n), n;
263
+ return sl(e, n), Ce(e, n), e.replaceWith(n), n;
264
264
  }
265
- function ll(e, t) {
265
+ function sl(e, t) {
266
266
  for (const n of Array.from(e.attributes))
267
267
  n.name !== "contenteditable" && t.setAttribute(n.name, n.value);
268
268
  pn(t);
@@ -274,12 +274,12 @@ function co(e, t) {
274
274
  return t;
275
275
  }
276
276
  function ze(e) {
277
- return e ? e.querySelector("img") || e.querySelector(Ji) ? !1 : !so(e).replace(/[\n]/g, "").length : !0;
277
+ return e ? e.querySelector("img") || e.querySelector(el) ? !1 : !so(e).replace(/[\n]/g, "").length : !0;
278
278
  }
279
279
  function Lt(e) {
280
280
  return !!e && (!!e.textContent?.trim() || !!e.querySelector("img,input,br,[data-attach],[data-ref-doc]"));
281
281
  }
282
- function vr(e, t, n) {
282
+ function br(e, t, n) {
283
283
  const o = e.ownerDocument, r = o.caretPositionFromPoint?.(t, n) || null;
284
284
  if (r && e.contains(r.offsetNode)) return { node: r.offsetNode, offset: r.offset };
285
285
  const i = o.caretRangeFromPoint?.(t, n) || null;
@@ -287,15 +287,15 @@ function vr(e, t, n) {
287
287
  const l = o.elementFromPoint(t, n);
288
288
  return l && e.contains(l) ? { node: l, offset: 0 } : null;
289
289
  }
290
- function sl(e, t, n) {
291
- const o = vr(e, t, n);
290
+ function al(e, t, n) {
291
+ const o = br(e, t, n);
292
292
  if (!o) return null;
293
293
  const r = o.node.nodeType === Node.TEXT_NODE ? o.node.parentElement : o.node;
294
294
  if ($e(r, e)) return null;
295
- const l = Ke(r, e) || br(e, n);
295
+ const l = Xe(r, e) || yr(e, n);
296
296
  return it(l) ? null : l;
297
297
  }
298
- function br(e, t) {
298
+ function yr(e, t) {
299
299
  let n = null, o = 1 / 0;
300
300
  for (const r of Array.from(e.children)) {
301
301
  const i = r.getBoundingClientRect();
@@ -305,7 +305,7 @@ function br(e, t) {
305
305
  }
306
306
  return o <= 48 ? n : null;
307
307
  }
308
- function Xe(e, t, n) {
308
+ function je(e, t, n) {
309
309
  let o = e?.nodeType === Node.TEXT_NODE ? e.parentElement : e;
310
310
  for (; o && o !== n && n.contains(o); ) {
311
311
  if (t(o)) return o;
@@ -313,8 +313,8 @@ function Xe(e, t, n) {
313
313
  }
314
314
  return null;
315
315
  }
316
- const zt = (e) => !!e && (e.tagName === "TD" || e.tagName === "TH"), De = (e, t) => Xe(e, zt, t), $e = (e, t) => Xe(e, (n) => n.tagName === "TABLE", t);
317
- function al(e) {
316
+ const zt = (e) => !!e && (e.tagName === "TD" || e.tagName === "TH"), De = (e, t) => je(e, zt, t), $e = (e, t) => je(e, (n) => n.tagName === "TABLE", t);
317
+ function cl(e) {
318
318
  if (!e) return null;
319
319
  const t = e.getBoundingClientRect();
320
320
  if (t.height) return t;
@@ -327,8 +327,8 @@ function ke(e, t) {
327
327
  function Mt(e, t, n) {
328
328
  e && (n == null || n === "" ? e.style.removeProperty(t) : e.style.setProperty(t, String(n)), e.getAttribute("style") === "" && e.removeAttribute("style"));
329
329
  }
330
- function yr(e, t, n) {
331
- const o = Ve(e, t), r = Ve(e, n), i = document.createRange();
330
+ function kr(e, t, n) {
331
+ const o = Ge(e, t), r = Ge(e, n), i = document.createRange();
332
332
  return i.setStart(o.node, o.offset), i.setEnd(r.node, r.offset), i;
333
333
  }
334
334
  function he(e, t) {
@@ -342,14 +342,14 @@ function he(e, t) {
342
342
  }
343
343
  return null;
344
344
  }
345
- function cl(e, t) {
345
+ function ul(e, t) {
346
346
  const n = [];
347
347
  let o = e;
348
348
  for (; o && o !== t && o.parentElement; )
349
349
  n.unshift(Array.prototype.indexOf.call(o.parentElement.childNodes, o)), o = o.parentElement;
350
350
  return o === t ? n : null;
351
351
  }
352
- function ul(e, t) {
352
+ function dl(e, t) {
353
353
  if (!t?.length) return null;
354
354
  let n = e;
355
355
  for (const o of t)
@@ -357,16 +357,16 @@ function ul(e, t) {
357
357
  return n.nodeType === Node.ELEMENT_NODE ? n : null;
358
358
  }
359
359
  const zn = "richtext-search", Dn = "richtext-search-current", Oo = () => typeof Highlight < "u" && typeof CSS < "u" && CSS.highlights;
360
- function dl(e) {
360
+ function fl(e) {
361
361
  let t = "", n = !1, o = -1, r = [];
362
362
  const i = () => {
363
363
  if (r = [], !t) return;
364
364
  const h = n ? t : t.toLowerCase();
365
- for (const g of pr(e)) {
365
+ for (const g of gr(e)) {
366
366
  const A = so(g), M = n ? A : A.toLowerCase();
367
367
  let L = M.indexOf(h);
368
368
  for (; L !== -1; )
369
- r.push(yr(g, L, L + h.length)), L = M.indexOf(h, L + h.length);
369
+ r.push(kr(g, L, L + h.length)), L = M.indexOf(h, L + h.length);
370
370
  }
371
371
  o = r.length ? Math.min(Math.max(o, 0), r.length - 1) : -1;
372
372
  }, l = () => {
@@ -392,10 +392,10 @@ function dl(e) {
392
392
  }
393
393
  return { refresh: s, setKeyword: a, clear: c, snapshot: u, next: () => f(1), prev: () => f(-1), replaceCurrent: y, replaceAll: E, scrollToActive: m };
394
394
  }
395
- const fl = /^(?:https?:|mailto:|tel:|ftp:|#|\/)/i, kr = /^(?:https?:|data:image\/|blob:|\/)/i, Cr = (e) => {
395
+ const hl = /^(?:https?:|mailto:|tel:|ftp:|#|\/)/i, Cr = /^(?:https?:|data:image\/|blob:|\/)/i, Er = (e) => {
396
396
  const t = String(e ?? "").replace(/[\t\n\r]/g, "").trim();
397
- return t === "" ? !1 : /^[a-z][a-z0-9+.-]*:/i.test(t) ? fl.test(t) : !0;
398
- }, uo = (e) => String(e ?? "").replace(/[\u0000-\u001f\u007f;{}()\\'"!<>]/g, "").replace(/\s+/g, " ").trim().slice(0, 120), hl = /* @__PURE__ */ new Set(["script", "style", "link", "meta", "title", "head", "iframe", "object", "embed", "form", "button", "select", "textarea"]), H = {
397
+ return t === "" ? !1 : /^[a-z][a-z0-9+.-]*:/i.test(t) ? hl.test(t) : !0;
398
+ }, uo = (e) => String(e ?? "").replace(/[\u0000-\u001f\u007f;{}()\\'"!<>]/g, "").replace(/\s+/g, " ").trim().slice(0, 120), ml = /* @__PURE__ */ new Set(["script", "style", "link", "meta", "title", "head", "iframe", "object", "embed", "form", "button", "select", "textarea"]), H = {
399
399
  INS: "doc-ins",
400
400
  DEL: "doc-del",
401
401
  COMMENT: "doc-comment",
@@ -408,14 +408,14 @@ const fl = /^(?:https?:|mailto:|tel:|ftp:|#|\/)/i, kr = /^(?:https?:|data:image\
408
408
  ATTACH: "doc-attach",
409
409
  REF: "doc-ref",
410
410
  EMBED: "doc-embed"
411
- }, fo = "data-cmt", vn = "data-fn", lt = "data-attach", le = "data-ref-doc", Ge = "data-ref-block", Dt = "data-ref-sub", Er = "data-color-theme", Ar = "data-color-theme-tint", Tr = "data-color-theme-shade", Sr = ["data-re-runtime", "spellcheck", "autocorrect"], ml = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"];
411
+ }, fo = "data-cmt", vn = "data-fn", lt = "data-attach", le = "data-ref-doc", Ke = "data-ref-block", Dt = "data-ref-sub", Ar = "data-color-theme", Tr = "data-color-theme-tint", Sr = "data-color-theme-shade", wr = ["data-re-runtime", "spellcheck", "autocorrect"], pl = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"];
412
412
  function bn(e, { editable: t = !1 } = {}) {
413
- if (dr(e), gl(e), pl(e), Cl(e), yl(e), El(e), Al(e), Tl(e), wl(e), xl(e), Ll(e), Ml(e), Nl(e), Sl(e), t && !e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table,hr,img")) {
413
+ if (fr(e), vl(e), gl(e), El(e), kl(e), Al(e), Tl(e), Sl(e), xl(e), Ll(e), Ml(e), Nl(e), Rl(e), wl(e), t && !e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table,hr,img")) {
414
414
  const n = document.createElement("p");
415
415
  n.appendChild(document.createElement("br")), e.appendChild(n);
416
416
  }
417
417
  }
418
- function pl(e) {
418
+ function gl(e) {
419
419
  for (let t = 0; t < 12; t += 1) {
420
420
  const n = Array.from(e.querySelectorAll("span")).filter((o) => !o.hasAttributes());
421
421
  if (!n.length) return;
@@ -423,43 +423,43 @@ function pl(e) {
423
423
  Ht(o);
424
424
  }
425
425
  }
426
- function gl(e) {
426
+ function vl(e) {
427
427
  const t = document.createTreeWalker(e, NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT), n = [];
428
428
  let o = t.currentNode;
429
429
  for (o.nodeType === Node.COMMENT_NODE && n.push(o); t.nextNode(); ) {
430
430
  const r = t.currentNode;
431
- (r.nodeType === Node.COMMENT_NODE || hl.has(r.tagName.toLowerCase())) && n.push(r);
431
+ (r.nodeType === Node.COMMENT_NODE || ml.has(r.tagName.toLowerCase())) && n.push(r);
432
432
  }
433
433
  n.forEach((r) => r.remove());
434
434
  for (const r of Array.from(e.querySelectorAll("*")))
435
435
  if (r.nodeType === Node.ELEMENT_NODE) {
436
- for (const i of Sr) r.removeAttribute(i);
437
- pn(r), r.getAttribute("contenteditable") === "false" && r.tagName !== "INPUT" && r.removeAttribute("contenteditable"), vl(r), bl(r);
436
+ for (const i of wr) r.removeAttribute(i);
437
+ pn(r), r.getAttribute("contenteditable") === "false" && r.tagName !== "INPUT" && r.removeAttribute("contenteditable"), bl(r), yl(r);
438
438
  }
439
439
  }
440
- function vl(e) {
440
+ function bl(e) {
441
441
  if (e.tagName === "A") {
442
442
  const t = e.getAttribute("href") || "";
443
- Cr(t) ? (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer nofollow")) : e.removeAttribute("href");
443
+ Er(t) ? (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer nofollow")) : e.removeAttribute("href");
444
444
  }
445
445
  if (e.tagName === "IMG") {
446
446
  const t = (e.getAttribute("src") || "").trim();
447
447
  if (!t) return;
448
- kr.test(t) || e.remove();
448
+ Cr.test(t) || e.remove();
449
449
  }
450
450
  }
451
- function bl(e) {
451
+ function yl(e) {
452
452
  if (e.tagName !== "FONT") return;
453
453
  const t = [];
454
454
  e.getAttribute("color") && t.push(`color: ${e.getAttribute("color")}`);
455
455
  const n = uo(e.getAttribute("face"));
456
456
  n && t.push(`font-family: ${n}`);
457
457
  const o = Number(e.getAttribute("size"));
458
- o && t.push(`font-size: ${ml[Math.min(Math.max(o, 1), 7) - 1]}`);
458
+ o && t.push(`font-size: ${pl[Math.min(Math.max(o, 1), 7) - 1]}`);
459
459
  const r = document.createElement("span");
460
460
  t.length && r.setAttribute("style", t.join("; ")), Ce(e, r), e.replaceWith(r);
461
461
  }
462
- function yl(e) {
462
+ function kl(e) {
463
463
  const t = [e, ...Array.from(e.querySelectorAll("blockquote, [data-callout], [data-super], [data-col]"))];
464
464
  for (const n of t) {
465
465
  let o = null;
@@ -468,7 +468,7 @@ function yl(e) {
468
468
  r.remove();
469
469
  continue;
470
470
  }
471
- if (!(r.nodeType === Node.TEXT_NODE || r.nodeType === Node.ELEMENT_NODE && !kl(r))) {
471
+ if (!(r.nodeType === Node.TEXT_NODE || r.nodeType === Node.ELEMENT_NODE && !Cl(r))) {
472
472
  o = null;
473
473
  continue;
474
474
  }
@@ -476,14 +476,14 @@ function yl(e) {
476
476
  }
477
477
  }
478
478
  }
479
- function kl(e) {
479
+ function Cl(e) {
480
480
  return /^(P|H[1-6]|UL|OL|BLOCKQUOTE|PRE|TABLE|HR|DIV|LI|TBODY|THEAD|TFOOT|TR|TD|TH|COLGROUP|CAPTION|IMG)$/.test(e.tagName);
481
481
  }
482
- function Cl(e) {
482
+ function El(e) {
483
483
  for (const t of Array.from(e.querySelectorAll("div")))
484
484
  we(t.parentElement) || zt(t.parentElement) || t.classList.contains(H.PAGEBREAK) || t.classList.contains(H.SECTIONBREAK) || t.classList.contains(H.TOC) || t.hasAttribute(le) || Ot(t) || mn(t) || t.replaceWith(Te(t, "p"));
485
485
  }
486
- function El(e) {
486
+ function Al(e) {
487
487
  const t = Array.from(e.querySelectorAll("li,td,th"));
488
488
  for (const n of t) {
489
489
  const o = Array.from(n.children).filter((i) => /^(P|H[1-6])$/.test(i.tagName));
@@ -494,7 +494,7 @@ function El(e) {
494
494
  }), o[0].before(r), o.forEach((i) => i.remove()), we(n.parentElement) && n.parentElement.replaceWith(n);
495
495
  }
496
496
  }
497
- function Al(e) {
497
+ function Tl(e) {
498
498
  for (const t of Array.from(e.querySelectorAll('ul[data-type="taskList"], ol[data-type="taskList"]')))
499
499
  for (const n of Array.from(t.children)) {
500
500
  const o = n.tagName === "LI" ? n : null;
@@ -525,10 +525,10 @@ function Al(e) {
525
525
  if (t.parentElement?.getAttribute("data-type") === "taskList") continue;
526
526
  t.removeAttribute("data-checked");
527
527
  const n = t.querySelector(":scope > label"), o = t.querySelector(":scope > div");
528
- n?.remove(), o && gr(o);
528
+ n?.remove(), o && vr(o);
529
529
  }
530
530
  }
531
- function Tl(e) {
531
+ function Sl(e) {
532
532
  for (const t of Array.from(e.querySelectorAll("pre"))) {
533
533
  const o = (t.querySelector("code") || t).textContent || "";
534
534
  t.replaceChildren();
@@ -536,41 +536,41 @@ function Tl(e) {
536
536
  r.textContent = o, t.appendChild(r);
537
537
  }
538
538
  }
539
- function Sl(e) {
539
+ function wl(e) {
540
540
  for (const t of Array.from(e.querySelectorAll("p,h1,h2,h3,h4,h5,h6,li,td,th,div")))
541
541
  we(t) || t.classList.contains(H.PAGEBREAK) || t.classList.contains(H.SECTIONBREAK) || t.classList.contains(H.TOC) || t.hasAttribute(le) || Ot(t) || mn(t) || Lt(t) || t.replaceChildren(document.createElement("br"));
542
542
  }
543
- function wl(e) {
543
+ function xl(e) {
544
544
  for (const t of Array.from(e.querySelectorAll(`.${H.PAGEBREAK}`))) {
545
545
  const n = t.tagName === "DIV" ? t : Te(t, "div");
546
546
  n.replaceChildren(), n.setAttribute("contenteditable", "false");
547
547
  }
548
548
  }
549
- function xl(e) {
549
+ function Ll(e) {
550
550
  for (const t of Array.from(e.querySelectorAll(`.${H.SECTIONBREAK}`))) {
551
551
  const n = t.tagName === "DIV" ? t : Te(t, "div");
552
552
  n.replaceChildren(), n.setAttribute("contenteditable", "false");
553
553
  }
554
554
  }
555
- function Ll(e) {
555
+ function Ml(e) {
556
556
  for (const t of Array.from(e.querySelectorAll(`.${H.TOC}`)))
557
557
  (t.tagName === "DIV" ? t : Te(t, "div")).setAttribute("contenteditable", "false");
558
558
  }
559
- function Ml(e) {
559
+ function Nl(e) {
560
560
  for (const t of Array.from(e.querySelectorAll("span")))
561
561
  t.hasAttribute(lt) ? (t.classList.add(H.ATTACH), t.setAttribute("contenteditable", "false")) : t.hasAttribute(le) && (t.classList.add(H.REF), t.setAttribute("contenteditable", "false"));
562
562
  }
563
- function Nl(e) {
563
+ function Rl(e) {
564
564
  for (const t of Array.from(e.querySelectorAll("[data-ref-doc]")))
565
565
  t.tagName === "DIV" && (t.classList.add(H.EMBED), t.setAttribute("contenteditable", "false"));
566
566
  }
567
- function Rl(e) {
567
+ function Ol(e) {
568
568
  const t = e.cloneNode(!0);
569
- return dr(t), t.querySelectorAll(tl).forEach((n) => pn(n)), t.querySelectorAll('input[type="checkbox"]').forEach((n) => {
569
+ return fr(t), t.querySelectorAll(nl).forEach((n) => pn(n)), t.querySelectorAll('input[type="checkbox"]').forEach((n) => {
570
570
  n.checked ? n.setAttribute("checked", "") : n.removeAttribute("checked");
571
571
  }), t.querySelectorAll("[contenteditable]").forEach((n) => n.removeAttribute("contenteditable")), t.innerHTML;
572
572
  }
573
- function wr(e) {
573
+ function xr(e) {
574
574
  const t = document.createElement("template");
575
575
  return t.innerHTML = String(e || ""), bn(t.content), t.content;
576
576
  }
@@ -578,27 +578,27 @@ function ho(e) {
578
578
  return typeof e?.key == "string" ? e.key.toLowerCase() : "";
579
579
  }
580
580
  const Un = "data-key-scope", Bo = "data-key-active";
581
- function xr(e) {
581
+ function Lr(e) {
582
582
  return e?.closest?.(`[${Un}]`) ?? null;
583
583
  }
584
- let tt = null;
585
- const Lr = (e) => {
586
- tt = e.target instanceof Element ? e.target : null;
584
+ let nt = null;
585
+ const Mr = (e) => {
586
+ nt = e.target instanceof Element ? e.target : null;
587
587
  };
588
- function Ol() {
589
- document.addEventListener("pointerdown", Lr, !0);
590
- }
591
588
  function Bl() {
592
- document.removeEventListener("pointerdown", Lr, !0), tt = null;
589
+ document.addEventListener("pointerdown", Mr, !0);
590
+ }
591
+ function Il() {
592
+ document.removeEventListener("pointerdown", Mr, !0), nt = null;
593
593
  }
594
- const Il = (e) => !e || e === document || e === document.documentElement || e === document.body;
595
- function Hl(e) {
594
+ const Hl = (e) => !e || e === document || e === document.documentElement || e === document.body;
595
+ function zl(e) {
596
596
  const t = e?.target;
597
- return Il(t) ? (tt && !tt.isConnected && (tt = null), tt) : t;
597
+ return Hl(t) ? (nt && !nt.isConnected && (nt = null), nt) : t;
598
598
  }
599
- function zl(e, t) {
599
+ function Dl(e, t) {
600
600
  if (!t) return !0;
601
- const n = t.getAttribute(Un), o = t.getAttribute(Bo) === "true", r = Hl(e), i = xr(r);
601
+ const n = t.getAttribute(Un), o = t.getAttribute(Bo) === "true", r = zl(e), i = Lr(r);
602
602
  return i ? i.getAttribute(Un) === n ? !0 : o && i.getAttribute(Bo) !== "true" : r ? !1 : o;
603
603
  }
604
604
  const yn = {
@@ -612,7 +612,7 @@ const yn = {
612
612
  keydown: { capture: [], bubble: [] },
613
613
  keyup: { capture: [], bubble: [] }
614
614
  }, Nt = /* @__PURE__ */ new Set();
615
- function Mr(e) {
615
+ function Nr(e) {
616
616
  for (const t of [...Nt])
617
617
  if (Nt.has(t))
618
618
  try {
@@ -621,90 +621,90 @@ function Mr(e) {
621
621
  console.error("[KeyboardBus] release failed:", n);
622
622
  }
623
623
  }
624
- const mo = () => Mr(null), Nr = () => {
624
+ const mo = () => Nr(null), Rr = () => {
625
625
  document.hidden && mo();
626
626
  };
627
- function Dl(e) {
627
+ function $l(e) {
628
628
  return typeof e != "function" ? () => {
629
629
  } : (Nt.add(e), ln(), () => {
630
630
  Nt.delete(e), ln();
631
631
  });
632
632
  }
633
- let po = !0, rn = !1, $l = 0;
634
- function _l() {
633
+ let po = !0, rn = !1, _l = 0;
634
+ function Pl() {
635
635
  for (const e of ["keydown", "keyup"])
636
636
  for (const t of ["capture", "bubble"])
637
637
  qe[e][t].sort((n, o) => o.priority - n.priority || n.seq - o.seq);
638
638
  po = !0;
639
639
  }
640
- const Rr = (e) => kn("keydown", "capture", e), Or = (e) => kn("keydown", "bubble", e), Br = (e) => {
641
- ho(e) && (Mr(e), kn("keyup", "capture", e));
642
- }, Ir = (e) => kn("keyup", "bubble", e);
640
+ const Or = (e) => kn("keydown", "capture", e), Br = (e) => kn("keydown", "bubble", e), Ir = (e) => {
641
+ ho(e) && (Nr(e), kn("keyup", "capture", e));
642
+ }, Hr = (e) => kn("keyup", "bubble", e);
643
643
  function kn(e, t, n) {
644
644
  const o = qe[e][t];
645
645
  if (o.length && ho(n)) {
646
- po || _l();
646
+ po || Pl();
647
647
  for (const r of o.slice()) {
648
648
  if (r.active && !r.active(n)) continue;
649
649
  if (r.handler(n) === !0 || n.cancelBubble === !0) return;
650
650
  }
651
651
  }
652
652
  }
653
- function Pl() {
654
- document.addEventListener("keydown", Rr, !0), document.addEventListener("keydown", Or), document.addEventListener("keyup", Br, !0), document.addEventListener("keyup", Ir), window.addEventListener("blur", mo), document.addEventListener("visibilitychange", Nr), Ol(), rn = !0;
655
- }
656
653
  function Fl() {
657
- document.removeEventListener("keydown", Rr, !0), document.removeEventListener("keydown", Or), document.removeEventListener("keyup", Br, !0), document.removeEventListener("keyup", Ir), window.removeEventListener("blur", mo), document.removeEventListener("visibilitychange", Nr), Bl(), rn = !1;
654
+ document.addEventListener("keydown", Or, !0), document.addEventListener("keydown", Br), document.addEventListener("keyup", Ir, !0), document.addEventListener("keyup", Hr), window.addEventListener("blur", mo), document.addEventListener("visibilitychange", Rr), Bl(), rn = !0;
655
+ }
656
+ function ql() {
657
+ document.removeEventListener("keydown", Or, !0), document.removeEventListener("keydown", Br), document.removeEventListener("keyup", Ir, !0), document.removeEventListener("keyup", Hr), window.removeEventListener("blur", mo), document.removeEventListener("visibilitychange", Rr), Il(), rn = !1;
658
658
  }
659
659
  function ln() {
660
660
  const e = qe.keydown.capture.length || qe.keydown.bubble.length || qe.keyup.capture.length || qe.keyup.bubble.length || Nt.size;
661
- e && !rn ? Pl() : !e && rn && Fl();
662
- }
663
- function ql(e, t) {
664
- return Hr("keydown", e, t);
661
+ e && !rn ? Fl() : !e && rn && ql();
665
662
  }
666
663
  function Ul(e, t) {
667
- return Hr("keyup", e, t);
664
+ return zr("keydown", e, t);
665
+ }
666
+ function Vl(e, t) {
667
+ return zr("keyup", e, t);
668
668
  }
669
- function Hr(e, t, { priority: n = yn.GLOBAL, phase: o = "capture", active: r } = {}) {
669
+ function zr(e, t, { priority: n = yn.GLOBAL, phase: o = "capture", active: r } = {}) {
670
670
  if (typeof t != "function") return () => {
671
671
  };
672
- const i = { seq: ++$l, priority: n, active: r, handler: t }, l = qe[e][o === "bubble" ? "bubble" : "capture"];
672
+ const i = { seq: ++_l, priority: n, active: r, handler: t }, l = qe[e][o === "bubble" ? "bubble" : "capture"];
673
673
  return l.push(i), po = !1, ln(), () => {
674
674
  const s = l.indexOf(i);
675
675
  s >= 0 && l.splice(s, 1), ln();
676
676
  };
677
677
  }
678
678
  function go(e, t = {}) {
679
- const n = wi(), o = (s) => {
679
+ const n = xi(), o = (s) => {
680
680
  let a = n?.proxy?.$el ?? n?.vnode?.el ?? null;
681
681
  for (; a && a.nodeType !== 1; ) a = a.parentElement;
682
- return a?.closest?.("[inert]") || !zl(s, xr(a)) ? !1 : !t.active || t.active();
682
+ return a?.closest?.("[inert]") || !Dl(s, Lr(a)) ? !1 : !t.active || t.active();
683
683
  }, r = [], i = { ...t, active: o };
684
- typeof e?.keydown == "function" && r.push(ql(e.keydown, i)), typeof e?.keyup == "function" && r.push(Ul(e.keyup, i)), typeof e?.release == "function" && r.push(Dl(e.release));
684
+ typeof e?.keydown == "function" && r.push(Ul(e.keydown, i)), typeof e?.keyup == "function" && r.push(Vl(e.keyup, i)), typeof e?.release == "function" && r.push($l(e.release));
685
685
  const l = () => {
686
686
  for (; r.length; ) r.pop()();
687
687
  };
688
- return xi() && Li(l), l;
688
+ return Li() && Mi(l), l;
689
689
  }
690
- function Vl() {
690
+ function Gl() {
691
691
  return typeof navigator > "u" ? !1 : /Mac|iP(hone|ad|od)/.test(`${navigator.userAgent || ""} ${navigator.platform || ""}`);
692
692
  }
693
- const Gl = (e) => {
694
- const t = Xl(e?.code);
693
+ const Kl = (e) => {
694
+ const t = jl(e?.code);
695
695
  return /^digit\d$/.test(t) ? t.slice(5) : ho(e) || (t.length === 1 ? t : "");
696
696
  };
697
- function Kl(e) {
698
- const t = Gl(e);
697
+ function Xl(e) {
698
+ const t = Kl(e);
699
699
  if (!t) return "";
700
700
  const n = [];
701
- return (Vl() ? e?.metaKey : e?.ctrlKey) && n.push("Mod"), e?.altKey && n.push("Alt"), e?.shiftKey && n.push("Shift"), n.push(t), n.join("-");
701
+ return (Gl() ? e?.metaKey : e?.ctrlKey) && n.push("Mod"), e?.altKey && n.push("Alt"), e?.shiftKey && n.push("Shift"), n.push(t), n.join("-");
702
702
  }
703
- function Xl(e) {
703
+ function jl(e) {
704
704
  const t = String(e || "");
705
705
  return /^Digit[0-9]$/.test(t) ? `digit${t.slice(5)}` : /^Numpad[0-9]$/.test(t) ? t.toLowerCase() : /^Key[A-Z]$/.test(t) ? t.slice(3).toLowerCase() : t.toLowerCase();
706
706
  }
707
- const Vn = ["0.25", "0.5", "0.75", "1", "1.15", "1.25", "1.5", "2", "2.5", "3"], Cn = 8, Gn = 2, jl = /* @__PURE__ */ new Set(["style", "script", "meta", "link", "title", "base", "xml"]), Wl = /* @__PURE__ */ new Set([
707
+ const Vn = ["0.25", "0.5", "0.75", "1", "1.15", "1.25", "1.5", "2", "2.5", "3"], Cn = 8, Gn = 2, Wl = /* @__PURE__ */ new Set(["style", "script", "meta", "link", "title", "base", "xml"]), Yl = /* @__PURE__ */ new Set([
708
708
  "text-align",
709
709
  "font-weight",
710
710
  "font-style",
@@ -716,16 +716,16 @@ const Vn = ["0.25", "0.5", "0.75", "1", "1.15", "1.25", "1.5", "2", "2.5", "3"],
716
716
  "line-height",
717
717
  "width",
718
718
  "min-width"
719
- ]), Yl = /<o:p|mso-|urn:schemas-microsoft-com|<!--\[if/i, Ql = 1, Zl = 4;
720
- function Jl(e) {
719
+ ]), Ql = /<o:p|mso-|urn:schemas-microsoft-com|<!--\[if/i, Zl = 1, Jl = 4;
720
+ function es(e) {
721
721
  const t = String(e).trim().match(/^([\d.]+)\s*(pt|px)$/i);
722
722
  if (!t) return "";
723
723
  const n = Number(t[1]);
724
724
  if (!Number.isFinite(n)) return "";
725
725
  const o = Math.round(t[2].toLowerCase() === "pt" ? n * (4 / 3) : n);
726
- return o < Je[0] || o > Je[Je.length - 1] ? "" : `${Je.reduce((r, i) => Math.abs(i - o) < Math.abs(r - o) ? i : r, Je[0])}px`;
726
+ return o < et[0] || o > et[et.length - 1] ? "" : `${et.reduce((r, i) => Math.abs(i - o) < Math.abs(r - o) ? i : r, et[0])}px`;
727
727
  }
728
- function es(e) {
728
+ function ts(e) {
729
729
  const t = String(e).trim();
730
730
  let n = null;
731
731
  const o = t.match(/^([\d.]+)%$/);
@@ -734,27 +734,27 @@ function es(e) {
734
734
  const r = t.match(/^([\d.]+)$/);
735
735
  r && (n = Number(r[1]));
736
736
  }
737
- return !n || !Number.isFinite(n) || n < Ql || n > Zl ? "" : Vn.reduce(
737
+ return !n || !Number.isFinite(n) || n < Zl || n > Jl ? "" : Vn.reduce(
738
738
  (r, i) => Math.abs(Number(i) - n) < Math.abs(Number(r) - n) ? i : r,
739
739
  Vn[0]
740
740
  );
741
741
  }
742
- function ts(e, t) {
742
+ function ns(e, t) {
743
743
  const n = [];
744
744
  return String(e).split(";").forEach((o) => {
745
745
  const r = o.indexOf(":");
746
746
  if (r < 0) return;
747
747
  const i = o.slice(0, r).trim().toLowerCase();
748
748
  let l = o.slice(r + 1).trim();
749
- !i || !l || !Wl.has(i) || t && (i === "font-family" || (i === "font-size" && (l = Jl(l)), i === "line-height" && (l = es(l)), !l)) || n.push(`${i}: ${l}`);
749
+ !i || !l || !Yl.has(i) || t && (i === "font-family" || (i === "font-size" && (l = es(l)), i === "line-height" && (l = ts(l)), !l)) || n.push(`${i}: ${l}`);
750
750
  }), n.join("; ");
751
751
  }
752
- function ns(e) {
752
+ function os(e) {
753
753
  const t = document.createTreeWalker(e, NodeFilter.SHOW_COMMENT), n = [];
754
754
  for (; t.nextNode(); ) n.push(t.currentNode);
755
755
  n.forEach((o) => o.remove());
756
756
  }
757
- const os = (e) => {
757
+ const rs = (e) => {
758
758
  for (const t of String(e).split(";")) {
759
759
  const n = t.indexOf(":");
760
760
  if (n < 0 || t.slice(0, n).trim().toLowerCase() !== "vertical-align") continue;
@@ -764,17 +764,17 @@ const os = (e) => {
764
764
  }
765
765
  return "";
766
766
  };
767
- function zr(e) {
767
+ function Dr(e) {
768
768
  if (!e || typeof e != "string" || typeof DOMParser > "u") return e;
769
- const t = Yl.test(e), o = new DOMParser().parseFromString(e, "text/html").body;
769
+ const t = Ql.test(e), o = new DOMParser().parseFromString(e, "text/html").body;
770
770
  return o.querySelectorAll("*").forEach((r) => {
771
771
  const i = r.tagName.toLowerCase();
772
- if (jl.has(i) || i.includes(":")) {
772
+ if (Wl.has(i) || i.includes(":")) {
773
773
  r.remove();
774
774
  return;
775
775
  }
776
776
  if (r.removeAttribute("class"), r.removeAttribute("id"), r.removeAttribute("dir"), r.removeAttribute("lang"), r.removeAttribute("align"), r.hasAttribute("style")) {
777
- const l = r.getAttribute("style"), s = os(l), a = ts(l, t);
777
+ const l = r.getAttribute("style"), s = rs(l), a = ns(l, t);
778
778
  if (a ? r.setAttribute("style", a) : r.removeAttribute("style"), s && i === "span") {
779
779
  const c = document.createElement(s === "super" ? "sup" : "sub");
780
780
  r.hasAttribute("style") ? (r.replaceWith(c), c.appendChild(r)) : (Ce(r, c), r.replaceWith(c));
@@ -782,18 +782,18 @@ function zr(e) {
782
782
  }
783
783
  if (i === "img") {
784
784
  const l = r.getAttribute("src") || "";
785
- (!l || !kr.test(l)) && r.remove();
785
+ (!l || !Cr.test(l)) && r.remove();
786
786
  }
787
- }), ns(o), o.innerHTML;
787
+ }), os(o), o.innerHTML;
788
788
  }
789
- const rs = `.${H.INS}, .${H.DEL}`;
789
+ const is = `.${H.INS}, .${H.DEL}`;
790
790
  function Kn(e) {
791
791
  const t = document.createRange();
792
792
  t.setStartAfter(e), t.collapse(!0);
793
793
  const n = window.getSelection();
794
794
  n.removeAllRanges(), n.addRange(t);
795
795
  }
796
- function is(e, t) {
796
+ function ls(e, t) {
797
797
  let n = e.startContainer;
798
798
  if (n.nodeType === Node.TEXT_NODE) {
799
799
  if (e.startOffset !== 0) return null;
@@ -811,13 +811,13 @@ function Xn(e, t) {
811
811
  const r = t.extractContents(), i = document.createElement("del");
812
812
  i.className = H.DEL, i.appendChild(r), t.insertNode(i), Kn(i);
813
813
  }
814
- function ls(e, t) {
814
+ function ss(e, t) {
815
815
  const n = window.getSelection();
816
816
  if (!n?.rangeCount || !e) return !1;
817
817
  let o = n.getRangeAt(0);
818
818
  if (!e.contains(o.startContainer)) return !1;
819
819
  o.collapsed || (Xn(e, o), o = n.getRangeAt(0));
820
- const r = is(o, H.INS);
820
+ const r = ls(o, H.INS);
821
821
  if (r)
822
822
  return r.appendChild(document.createTextNode(t)), Kn(r.lastChild), !0;
823
823
  const i = document.createElement("ins");
@@ -837,18 +837,18 @@ function Io(e, t) {
837
837
  const s = o.cloneRange();
838
838
  return s.setStart(r, Math.min(i, l)), s.setEnd(r, Math.max(i, l)), Xn(e, s), !0;
839
839
  }
840
- function ss(e, t) {
841
- return t.inputType === "insertText" && t.data ? ls(e, t.data) : t.inputType === "deleteContentBackward" ? Io(e, !1) : t.inputType === "deleteContentForward" ? Io(e, !0) : !1;
842
- }
843
840
  function as(e, t) {
841
+ return t.inputType === "insertText" && t.data ? ss(e, t.data) : t.inputType === "deleteContentBackward" ? Io(e, !1) : t.inputType === "deleteContentForward" ? Io(e, !0) : !1;
842
+ }
843
+ function cs(e, t) {
844
844
  let n = 0;
845
- for (const o of Array.from(e?.querySelectorAll(rs) || [])) {
845
+ for (const o of Array.from(e?.querySelectorAll(is) || [])) {
846
846
  if (!o.isConnected) continue;
847
847
  o.classList.contains(H.INS) === !!t && Ht(o), o.remove(), n += 1;
848
848
  }
849
849
  return e?.normalize(), n;
850
850
  }
851
- function cs(e, t) {
851
+ function us(e, t) {
852
852
  return e?.isConnected ? (e.classList.contains(H.INS) === !!t && Ht(e), e.remove(), e.parentElement?.normalize(), !0) : !1;
853
853
  }
854
854
  function St(e) {
@@ -859,13 +859,13 @@ function St(e) {
859
859
  const o = n[1];
860
860
  return `#${(o.length === 3 ? o.split("").map((i) => i + i).join("") : o).toUpperCase()}`;
861
861
  }
862
- function us(e) {
862
+ function ds(e) {
863
863
  const t = String(e ?? "").trim();
864
864
  if (!t) return "";
865
865
  const n = t.match(/^rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
866
866
  return n ? `#${[1, 2, 3].map((o) => Number(n[o]).toString(16).padStart(2, "0")).join("").toUpperCase()}` : St(t) || t;
867
867
  }
868
- const ds = {
868
+ const fs = {
869
869
  STRONG: "bold",
870
870
  B: "bold",
871
871
  EM: "italic",
@@ -877,14 +877,14 @@ const ds = {
877
877
  TT: "code",
878
878
  SUP: "superscript",
879
879
  SUB: "subscript"
880
- }, fs = { INS: "ins", DEL: "del" }, hs = { bold: "strong", italic: "em", underline: "u", strike: "s", code: "code", superscript: "sup", subscript: "sub" }, ms = [
880
+ }, hs = { INS: "ins", DEL: "del" }, ms = { bold: "strong", italic: "em", underline: "u", strike: "s", code: "code", superscript: "sup", subscript: "sub" }, ps = [
881
881
  ["color", "color"],
882
882
  ["background-color", "backgroundColor"],
883
883
  ["font-size", "fontSize"],
884
884
  ["font-family", "fontFamily"],
885
885
  ["-webkit-text-stroke", "textStroke"],
886
886
  ["text-shadow", "textShadow"]
887
- ], ps = { color: "color", backgroundColor: "background-color", fontSize: "font-size", fontFamily: "font-family", textStroke: "-webkit-text-stroke", textShadow: "text-shadow" }, $t = ["color", "backgroundColor", "fontSize", "fontFamily", "textStroke", "textShadow"], gs = /* @__PURE__ */ new Set(["color", "backgroundColor"]), En = ["bold", "italic", "underline", "strike", "code", "superscript", "subscript"];
887
+ ], gs = { color: "color", backgroundColor: "background-color", fontSize: "font-size", fontFamily: "font-family", textStroke: "-webkit-text-stroke", textShadow: "text-shadow" }, $t = ["color", "backgroundColor", "fontSize", "fontFamily", "textStroke", "textShadow"], vs = /* @__PURE__ */ new Set(["color", "backgroundColor"]), En = ["bold", "italic", "underline", "strike", "code", "superscript", "subscript"];
888
888
  function sn() {
889
889
  return {
890
890
  bold: !1,
@@ -908,7 +908,7 @@ function sn() {
908
908
  textShadow: ""
909
909
  };
910
910
  }
911
- function Dr(e, t) {
911
+ function $r(e, t) {
912
912
  return En.every((n) => !!e[n] == !!t[n]) && $t.every((n) => jt(e[n]) === jt(t[n])) && jt(e.link) === jt(t.link) && e.rev === t.rev && e.cmt === t.cmt && e.colorTheme === t.colorTheme && e.colorThemeTint === t.colorThemeTint && e.colorThemeShade === t.colorThemeShade;
913
913
  }
914
914
  function jt(e) {
@@ -961,7 +961,7 @@ function Wn(e, t, n) {
961
961
  n.push({
962
962
  ref: {
963
963
  docId: o.getAttribute(le) || "",
964
- blockId: o.getAttribute(Ge) || "",
964
+ blockId: o.getAttribute(Ke) || "",
965
965
  sub: o.getAttribute(Dt) || "d",
966
966
  text: o.textContent || ""
967
967
  },
@@ -970,21 +970,21 @@ function Wn(e, t, n) {
970
970
  continue;
971
971
  }
972
972
  let r = t;
973
- const i = ds[o.tagName];
973
+ const i = fs[o.tagName];
974
974
  i && (r = { ...r, [i]: !0 });
975
- const l = fs[o.tagName];
975
+ const l = hs[o.tagName];
976
976
  l && (r = { ...r, rev: l }), o.tagName === "SPAN" && o.classList?.contains(H.COMMENT) && (r = { ...r, cmt: o.getAttribute(fo) || "" });
977
- for (const [a, c] of ms) {
977
+ for (const [a, c] of ps) {
978
978
  const f = o.style?.getPropertyValue(a)?.trim();
979
- f && (r = { ...r, [c]: gs.has(c) ? us(f) : f });
979
+ f && (r = { ...r, [c]: vs.has(c) ? ds(f) : f });
980
980
  }
981
981
  o.tagName === "A" && (r = { ...r, link: o.getAttribute("href") || "" });
982
- const s = o.getAttribute(Er);
982
+ const s = o.getAttribute(Ar);
983
983
  s && (r = {
984
984
  ...r,
985
985
  colorTheme: s,
986
- colorThemeTint: o.getAttribute(Ar) || "",
987
- colorThemeShade: o.getAttribute(Tr) || ""
986
+ colorThemeTint: o.getAttribute(Tr) || "",
987
+ colorThemeShade: o.getAttribute(Sr) || ""
988
988
  }), Wn(o, r, n);
989
989
  }
990
990
  }
@@ -992,33 +992,33 @@ function vo(e) {
992
992
  const t = [];
993
993
  return e && Wn(e, sn(), t), t;
994
994
  }
995
- function vs(e) {
995
+ function bs(e) {
996
996
  if (e.text) return document.createTextNode(e.text);
997
997
  if (e.br) return document.createElement("br");
998
998
  if (e.note) {
999
999
  const n = document.createElement("sup");
1000
1000
  return n.className = e.note.end ? H.ENDNOTE : H.FOOTNOTE, n.setAttribute(vn, e.note.id), n.textContent = e.note.ord || "", n;
1001
1001
  }
1002
- if (e.attach || e.ref) return bs(e);
1002
+ if (e.attach || e.ref) return ys(e);
1003
1003
  const t = document.createElement("img");
1004
1004
  e.img.src && t.setAttribute("src", e.img.src), t.setAttribute("alt", e.img.alt || "");
1005
1005
  for (const n of ["width", "height"]) e.img[n] && t.setAttribute(n, e.img[n]);
1006
1006
  return t;
1007
1007
  }
1008
- function bs(e) {
1008
+ function ys(e) {
1009
1009
  const t = document.createElement("span");
1010
- return e.attach ? (t.className = H.ATTACH, t.setAttribute(lt, e.attach.id), t.textContent = e.attach.name || "") : (t.className = H.REF, t.setAttribute(le, e.ref.docId), e.ref.blockId && t.setAttribute(Ge, e.ref.blockId), t.setAttribute(Dt, e.ref.sub === "s" ? "s" : "d"), t.textContent = e.ref.text || ""), t.setAttribute("contenteditable", "false"), t;
1010
+ return e.attach ? (t.className = H.ATTACH, t.setAttribute(lt, e.attach.id), t.textContent = e.attach.name || "") : (t.className = H.REF, t.setAttribute(le, e.ref.docId), e.ref.blockId && t.setAttribute(Ke, e.ref.blockId), t.setAttribute(Dt, e.ref.sub === "s" ? "s" : "d"), t.textContent = e.ref.text || ""), t.setAttribute("contenteditable", "false"), t;
1011
1011
  }
1012
- function ys(e, t) {
1012
+ function ks(e, t) {
1013
1013
  for (const o of ["code", "strike", "underline", "italic", "superscript", "subscript", "bold"]) {
1014
1014
  if (!e[o]) continue;
1015
- const r = document.createElement(hs[o]);
1015
+ const r = document.createElement(ms[o]);
1016
1016
  r.appendChild(t), t = r;
1017
1017
  }
1018
- const n = $t.filter((o) => e[o]).map((o) => `${ps[o]}: ${e[o]}`);
1018
+ const n = $t.filter((o) => e[o]).map((o) => `${gs[o]}: ${e[o]}`);
1019
1019
  if (n.length || e.colorTheme) {
1020
1020
  const o = document.createElement("span");
1021
- n.length && o.setAttribute("style", n.join("; ")), e.colorTheme && (o.setAttribute(Er, e.colorTheme), e.colorThemeTint && o.setAttribute(Ar, e.colorThemeTint), e.colorThemeShade && o.setAttribute(Tr, e.colorThemeShade)), o.appendChild(t), t = o;
1021
+ n.length && o.setAttribute("style", n.join("; ")), e.colorTheme && (o.setAttribute(Ar, e.colorTheme), e.colorThemeTint && o.setAttribute(Tr, e.colorThemeTint), e.colorThemeShade && o.setAttribute(Sr, e.colorThemeShade)), o.appendChild(t), t = o;
1022
1022
  }
1023
1023
  if (e.rev) {
1024
1024
  const o = document.createElement(e.rev === "del" ? "del" : "ins");
@@ -1034,17 +1034,17 @@ function ys(e, t) {
1034
1034
  }
1035
1035
  return t;
1036
1036
  }
1037
- function $r(e) {
1037
+ function _r(e) {
1038
1038
  const t = document.createDocumentFragment();
1039
1039
  let n = [], o = null;
1040
1040
  const r = () => {
1041
1041
  if (!n.length) return;
1042
1042
  const i = document.createDocumentFragment();
1043
- for (const l of n) i.appendChild(vs(l));
1044
- t.appendChild(ys(o, i)), n = [], o = null;
1043
+ for (const l of n) i.appendChild(bs(l));
1044
+ t.appendChild(ks(o, i)), n = [], o = null;
1045
1045
  };
1046
1046
  for (const i of e) {
1047
- if (o && Dr(o, i.m)) {
1047
+ if (o && $r(o, i.m)) {
1048
1048
  n.push(i);
1049
1049
  continue;
1050
1050
  }
@@ -1052,7 +1052,7 @@ function $r(e) {
1052
1052
  }
1053
1053
  return r(), t;
1054
1054
  }
1055
- function ks(e, t, n) {
1055
+ function Cs(e, t, n) {
1056
1056
  const o = [], r = [], i = [];
1057
1057
  let l = 0;
1058
1058
  for (const s of e) {
@@ -1074,8 +1074,8 @@ function ks(e, t, n) {
1074
1074
  }
1075
1075
  return { before: o, inside: r, after: i };
1076
1076
  }
1077
- function _r(e, t, n, o) {
1078
- const r = vo(e), { before: i, inside: l, after: s } = ks(r, t, n);
1077
+ function Pr(e, t, n, o) {
1078
+ const r = vo(e), { before: i, inside: l, after: s } = Cs(r, t, n);
1079
1079
  if (!l.length) return !1;
1080
1080
  const a = l.map((c) => {
1081
1081
  const f = { ...c.m };
@@ -1084,15 +1084,15 @@ function _r(e, t, n, o) {
1084
1084
  for (const [u, p] of Object.entries(o.style || {})) f[u] = p || "";
1085
1085
  return o.link !== void 0 && (f.link = o.link || ""), { ...c, m: f };
1086
1086
  });
1087
- return a.some((c, f) => !Dr(c.m, l[f].m)) ? (e.replaceChildren($r([...i, ...a, ...s])), !0) : !1;
1087
+ return a.some((c, f) => !$r(c.m, l[f].m)) ? (e.replaceChildren(_r([...i, ...a, ...s])), !0) : !1;
1088
1088
  }
1089
- function Cs(e) {
1090
- e?.isConnected && e.replaceChildren($r(vo(e)));
1089
+ function Es(e) {
1090
+ e?.isConnected && e.replaceChildren(_r(vo(e)));
1091
1091
  }
1092
1092
  function ct(e, t, n) {
1093
1093
  let o = !1;
1094
1094
  for (const { block: r, start: i, end: l } of t)
1095
- _r(r, i, l, n) && (o = !0);
1095
+ Pr(r, i, l, n) && (o = !0);
1096
1096
  return o;
1097
1097
  }
1098
1098
  function Pe(e, t) {
@@ -1103,7 +1103,7 @@ function ce(e, t, n) {
1103
1103
  const o = t === "fontFamily" ? uo(n) : n || "", r = t === "color" ? { color: o, colorTheme: "", colorThemeTint: "", colorThemeShade: "" } : { [t]: o };
1104
1104
  return e.pending ? (Object.assign(e.pending, r), !0) : ct(e.root, e.ranges, { style: r });
1105
1105
  }
1106
- function Es(e, t) {
1106
+ function As(e, t) {
1107
1107
  const n = {};
1108
1108
  for (const [o, r] of Object.entries(t || {}))
1109
1109
  n[o] = o === "fontFamily" ? uo(r) : r || "";
@@ -1111,26 +1111,26 @@ function Es(e, t) {
1111
1111
  }
1112
1112
  function Ho(e, t) {
1113
1113
  const n = String(t || "").trim();
1114
- return n !== "" && !Cr(n) ? !1 : e.pending ? (e.pending.link = n, !0) : ct(e.root, e.ranges, { link: n || null });
1114
+ return n !== "" && !Er(n) ? !1 : e.pending ? (e.pending.link = n, !0) : ct(e.root, e.ranges, { link: n || null });
1115
1115
  }
1116
- function As(e, t) {
1116
+ function Ts(e, t) {
1117
1117
  const n = String(t || "");
1118
1118
  return e.pending ? (e.pending.cmt = n, !0) : ct(e.root, e.ranges, { style: { cmt: n } });
1119
1119
  }
1120
- function Ts(e, t) {
1120
+ function Ss(e, t) {
1121
1121
  const n = String(t || "");
1122
1122
  let o = 0;
1123
1123
  for (const r of Array.from(e?.querySelectorAll(`.${H.COMMENT}`) || []))
1124
1124
  r.getAttribute(fo) === n && (Ht(r), o += 1);
1125
1125
  return o && e.normalize(), o;
1126
1126
  }
1127
- function Ss(e, t) {
1127
+ function ws(e, t) {
1128
1128
  const n = V(e);
1129
1129
  if (!n || !n.collapsed) return !1;
1130
1130
  const o = document.createElement("sup");
1131
1131
  return o.className = t?.end ? H.ENDNOTE : H.FOOTNOTE, o.setAttribute(vn, String(t?.id ?? "")), o.textContent = String(t?.ord ?? ""), n.insertNode(o), !0;
1132
1132
  }
1133
- function ws(e, t) {
1133
+ function xs(e, t) {
1134
1134
  const n = String(t ?? "");
1135
1135
  let o = 0;
1136
1136
  for (const r of Array.from(e?.querySelectorAll(`sup.${H.FOOTNOTE}, sup.${H.ENDNOTE}`) || []))
@@ -1141,13 +1141,13 @@ function zo(e, t, n) {
1141
1141
  const o = V(e);
1142
1142
  if (!o || !o.collapsed) return !1;
1143
1143
  const r = document.createElement("span");
1144
- t === "attach" ? (r.className = H.ATTACH, r.setAttribute(lt, String(n?.id ?? "")), r.textContent = String(n?.name ?? "")) : (r.className = H.REF, r.setAttribute(le, String(n?.docId ?? "")), n?.blockId && r.setAttribute(Ge, String(n.blockId)), r.setAttribute(Dt, n?.sub === "s" ? "s" : "d"), r.textContent = String(n?.text ?? "")), r.setAttribute("contenteditable", "false"), o.insertNode(r);
1144
+ t === "attach" ? (r.className = H.ATTACH, r.setAttribute(lt, String(n?.id ?? "")), r.textContent = String(n?.name ?? "")) : (r.className = H.REF, r.setAttribute(le, String(n?.docId ?? "")), n?.blockId && r.setAttribute(Ke, String(n.blockId)), r.setAttribute(Dt, n?.sub === "s" ? "s" : "d"), r.textContent = String(n?.text ?? "")), r.setAttribute("contenteditable", "false"), o.insertNode(r);
1145
1145
  const i = document.createRange();
1146
1146
  i.setStartAfter(r), i.collapse(!0);
1147
1147
  const l = window.getSelection();
1148
1148
  return l.removeAllRanges(), l.addRange(i), !0;
1149
1149
  }
1150
- function xs(e, t, n) {
1150
+ function Ls(e, t, n) {
1151
1151
  const o = String(t), r = String(n ?? "");
1152
1152
  if (!o) return !1;
1153
1153
  let i = 0;
@@ -1155,40 +1155,40 @@ function xs(e, t, n) {
1155
1155
  l.getAttribute(o) === r && (l.remove(), i += 1);
1156
1156
  return i > 0;
1157
1157
  }
1158
- function Ls(e, t) {
1158
+ function Ms(e, t) {
1159
1159
  let n = t;
1160
1160
  for (; n && n.parentElement && n.parentElement !== e; ) n = n.parentElement;
1161
1161
  return n && n.parentElement === e ? n : null;
1162
1162
  }
1163
- function Ms(e, t, n = "") {
1163
+ function Ns(e, t, n = "") {
1164
1164
  if (!t || !t.hasAttribute(le) || !t.isConnected) return !1;
1165
- const o = t.getAttribute(le) || "", r = t.getAttribute(Ge) || "", i = Ls(e, t);
1165
+ const o = t.getAttribute(le) || "", r = t.getAttribute(Ke) || "", i = Ms(e, t);
1166
1166
  t.remove();
1167
1167
  const l = document.createElement("div");
1168
- return l.className = H.EMBED, l.setAttribute(le, o), r && l.setAttribute(Ge, r), l.setAttribute("contenteditable", "false"), n && (l.innerHTML = n), i ? i.after(l) : e.appendChild(l), !0;
1168
+ return l.className = H.EMBED, l.setAttribute(le, o), r && l.setAttribute(Ke, r), l.setAttribute("contenteditable", "false"), n && (l.innerHTML = n), i ? i.after(l) : e.appendChild(l), !0;
1169
1169
  }
1170
- function Ns(e) {
1170
+ function Rs(e) {
1171
1171
  if (!e || e.tagName !== "DIV" || !e.hasAttribute(le) || !e.isConnected) return !1;
1172
1172
  const t = document.createElement("p"), n = document.createElement("span");
1173
1173
  n.className = H.REF, n.setAttribute(le, e.getAttribute(le) || "");
1174
- const o = e.getAttribute(Ge) || "";
1175
- return o && n.setAttribute(Ge, o), n.setAttribute(Dt, "d"), n.setAttribute("contenteditable", "false"), t.appendChild(n), t.appendChild(document.createElement("br")), e.replaceWith(t), !0;
1174
+ const o = e.getAttribute(Ke) || "";
1175
+ return o && n.setAttribute(Ke, o), n.setAttribute(Dt, "d"), n.setAttribute("contenteditable", "false"), t.appendChild(n), t.appendChild(document.createElement("br")), e.replaceWith(t), !0;
1176
1176
  }
1177
- function Rs(e, t) {
1177
+ function Os(e, t) {
1178
1178
  return !e || !e.hasAttribute(le) ? !1 : (e.setAttribute(Dt, t === "s" ? "s" : "d"), !0);
1179
1179
  }
1180
- function Os(e) {
1180
+ function Bs(e) {
1181
1181
  return !e || !e.isConnected ? !1 : (e.remove(), !0);
1182
1182
  }
1183
- function Bs(e) {
1183
+ function Is(e) {
1184
1184
  return e.ranges.length ? ct(e.root, e.ranges, { clear: !0 }) : !1;
1185
1185
  }
1186
1186
  function bo(e, t, n, o, r) {
1187
1187
  if (!t?.isConnected) return !1;
1188
1188
  const i = {};
1189
- return r.rev && (i.rev = r.rev), r.cmt && (i.cmt = r.cmt), _r(t, n, o, { set: Is(r), style: { ...Hs(r), ...i }, link: r.link || void 0 });
1189
+ return r.rev && (i.rev = r.rev), r.cmt && (i.cmt = r.cmt), Pr(t, n, o, { set: Hs(r), style: { ...zs(r), ...i }, link: r.link || void 0 });
1190
1190
  }
1191
- const Is = (e) => Object.fromEntries(En.filter((t) => e[t]).map((t) => [t, !0])), Hs = (e) => Object.fromEntries($t.filter((t) => e[t]).map((t) => [t, e[t]]));
1191
+ const Hs = (e) => Object.fromEntries(En.filter((t) => e[t]).map((t) => [t, !0])), zs = (e) => Object.fromEntries($t.filter((t) => e[t]).map((t) => [t, e[t]]));
1192
1192
  function Yn(e, t) {
1193
1193
  const n = [];
1194
1194
  for (const { block: i, start: l, end: s } of t) {
@@ -1225,27 +1225,27 @@ function _t(e) {
1225
1225
  }
1226
1226
  function An(e) {
1227
1227
  const t = X(V(e)?.startContainer || e, e);
1228
- return t ? Ke(t, e) || t : e.lastElementChild || _t(e);
1228
+ return t ? Xe(t, e) || t : e.lastElementChild || _t(e);
1229
1229
  }
1230
- function Pr(e) {
1230
+ function Fr(e) {
1231
1231
  const t = An(e), n = document.createElement("hr");
1232
1232
  t.after(n);
1233
1233
  const o = document.createElement("p");
1234
1234
  return o.appendChild(document.createElement("br")), n.after(o), P(o, 0), !0;
1235
1235
  }
1236
- function zs(e) {
1236
+ function Ds(e) {
1237
1237
  const t = An(e), n = document.createElement("div");
1238
1238
  n.className = H.PAGEBREAK, n.setAttribute("contenteditable", "false"), t.after(n);
1239
1239
  const o = document.createElement("p");
1240
1240
  return o.appendChild(document.createElement("br")), n.after(o), P(o, 0), !0;
1241
1241
  }
1242
- function Ds(e, t = "info") {
1242
+ function $s(e, t = "info") {
1243
1243
  const n = An(e), o = document.createElement("div");
1244
1244
  o.setAttribute(He, t);
1245
1245
  const r = ut();
1246
1246
  return o.appendChild(r), n.after(o), P(r, 0), !0;
1247
1247
  }
1248
- function $s(e, t = 2) {
1248
+ function _s(e, t = 2) {
1249
1249
  const n = An(e), o = document.createElement("div");
1250
1250
  o.setAttribute(fe, "");
1251
1251
  let r = null;
@@ -1258,27 +1258,27 @@ function $s(e, t = 2) {
1258
1258
  }
1259
1259
  return n.after(o), P(r, 0), !0;
1260
1260
  }
1261
- function Fr(e, t) {
1261
+ function qr(e, t) {
1262
1262
  const n = Oe(e, t);
1263
1263
  return n ? n.hasAttribute(fe) ? n : n.hasAttribute(ye) && n.parentElement?.hasAttribute(fe) ? n.parentElement : null : null;
1264
1264
  }
1265
- function _s(e, t) {
1266
- const n = Fr(e, t);
1265
+ function Ps(e, t) {
1266
+ const n = qr(e, t);
1267
1267
  if (!n) return !1;
1268
1268
  const o = document.createElement("div");
1269
1269
  o.setAttribute(ye, "");
1270
1270
  const r = ut();
1271
1271
  return o.appendChild(r), n.appendChild(o), P(r, 0), !0;
1272
1272
  }
1273
- function Ps(e, t) {
1274
- const n = Fr(e, t);
1273
+ function Fs(e, t) {
1274
+ const n = qr(e, t);
1275
1275
  if (!n) return !1;
1276
1276
  const o = Array.from(n.children).filter((i) => i.hasAttribute(ye));
1277
1277
  if (o.length <= 1) return !1;
1278
1278
  const r = he(o[o.length - 2], e) || he(n, e);
1279
1279
  return o[o.length - 1].remove(), r?.isConnected && P(r, 0), !0;
1280
1280
  }
1281
- function Fs(e, t, n, o) {
1281
+ function qs(e, t, n, o) {
1282
1282
  const r = Oe(e, t), i = Oe(e, n);
1283
1283
  if (!r || !i || r === i || r.contains(i) || i.contains(r) || r.parentElement !== i.parentElement) return !1;
1284
1284
  const l = o === "right" ? i : r, s = o === "right" ? r : i, a = document.createElement("div");
@@ -1289,7 +1289,7 @@ function Fs(e, t, n, o) {
1289
1289
  }
1290
1290
  return !0;
1291
1291
  }
1292
- function qs(e, t) {
1292
+ function Us(e, t) {
1293
1293
  const n = String(t ?? "");
1294
1294
  if (!n) return !1;
1295
1295
  const o = V(e), r = o && X(o.startContainer, e) || _t(e);
@@ -1305,7 +1305,7 @@ function qs(e, t) {
1305
1305
  r.appendChild(document.createTextNode(n));
1306
1306
  return !0;
1307
1307
  }
1308
- function Us(e, { src: t, alt: n = "" }) {
1308
+ function Vs(e, { src: t, alt: n = "" }) {
1309
1309
  const o = V(e), r = o && X(o.startContainer, e) || _t(e), i = document.createElement("img");
1310
1310
  if (i.setAttribute("src", t), i.setAttribute("alt", n), o && o.collapsed && r.contains(o.startContainer)) {
1311
1311
  o.insertNode(i);
@@ -1315,7 +1315,7 @@ function Us(e, { src: t, alt: n = "" }) {
1315
1315
  r.appendChild(i);
1316
1316
  return !0;
1317
1317
  }
1318
- function Vs(e, { id: t, src: n = "", alt: o = "" }) {
1318
+ function Gs(e, { id: t, src: n = "", alt: o = "" }) {
1319
1319
  const r = V(e), i = r && X(r.startContainer, e) || _t(e), l = document.createElement("img");
1320
1320
  if (t && l.setAttribute("data-gbBlk-asset", String(t)), n && l.setAttribute("src", n), o && l.setAttribute("alt", o), r && r.collapsed && i.contains(r.startContainer)) {
1321
1321
  r.insertNode(l);
@@ -1325,7 +1325,7 @@ function Vs(e, { id: t, src: n = "", alt: o = "" }) {
1325
1325
  i.appendChild(l);
1326
1326
  return !0;
1327
1327
  }
1328
- function Gs(e) {
1328
+ function Ks(e) {
1329
1329
  const t = document.createElement("li");
1330
1330
  if (Ft(e) !== "taskList")
1331
1331
  return t.appendChild(document.createElement("br")), { el: t, caret: t };
@@ -1333,12 +1333,12 @@ function Gs(e) {
1333
1333
  const { label: n } = Co(), o = document.createElement("div");
1334
1334
  return o.appendChild(document.createElement("br")), t.append(n, o), { el: t, caret: o };
1335
1335
  }
1336
- function Ks(e, t, n = null) {
1336
+ function Xs(e, t, n = null) {
1337
1337
  const o = n && Oe(e, n) || X(V(e)?.startContainer || e, e);
1338
1338
  if (!o) return !1;
1339
- const r = Ke(o, e) || o, i = t === "after";
1339
+ const r = Xe(o, e) || o, i = t === "after";
1340
1340
  if (r.tagName === "UL" || r.tagName === "OL") {
1341
- const { el: s, caret: a } = Gs(r);
1341
+ const { el: s, caret: a } = Ks(r);
1342
1342
  return i ? r.appendChild(s) : r.insertBefore(s, r.firstElementChild), P(a, 0), !0;
1343
1343
  }
1344
1344
  const l = ut();
@@ -1352,7 +1352,7 @@ function Do(e) {
1352
1352
  const o = window.getSelection(), r = document.createRange();
1353
1353
  return r.setStart(n, 0), r.collapse(!0), o.removeAllRanges(), o.addRange(r), !0;
1354
1354
  }
1355
- function Xs(e, t) {
1355
+ function js(e, t) {
1356
1356
  const n = t.startContainer;
1357
1357
  if (n.nodeType !== Node.TEXT_NODE) {
1358
1358
  e.appendChild(document.createTextNode(`
@@ -1366,7 +1366,7 @@ function Xs(e, t) {
1366
1366
  const r = window.getSelection(), i = document.createRange();
1367
1367
  return i.setStart(o, 0), i.collapse(!0), r.removeAllRanges(), r.addRange(i), !0;
1368
1368
  }
1369
- function js(e, t) {
1369
+ function Ws(e, t) {
1370
1370
  if (zt(e)) return null;
1371
1371
  const n = e.previousElementSibling;
1372
1372
  if (!n) return null;
@@ -1382,7 +1382,7 @@ function js(e, t) {
1382
1382
  e.remove(), P(o, 0);
1383
1383
  } : null;
1384
1384
  }
1385
- function Ws(e) {
1385
+ function Ys(e) {
1386
1386
  const t = V(e);
1387
1387
  if (!t || !t.collapsed) return null;
1388
1388
  const n = X(t.startContainer, e);
@@ -1392,21 +1392,21 @@ function Ws(e) {
1392
1392
  const l = Zn(n, e);
1393
1393
  return ze(n) ? () => {
1394
1394
  const s = ft(o);
1395
- l && Ue(l), P(s, 0);
1395
+ l && Ve(l), P(s, 0);
1396
1396
  } : o.parentElement?.parentElement?.tagName === "LI" ? () => {
1397
- qr(o), P(n, 0);
1397
+ Ur(o), P(n, 0);
1398
1398
  } : null;
1399
1399
  }
1400
- const r = Gr(n, e);
1400
+ const r = Kr(n, e);
1401
1401
  if (r) return () => {
1402
- un(r, n), Ue(r), P(n, 0);
1402
+ un(r, n), Ve(r), P(n, 0);
1403
1403
  };
1404
1404
  const i = Zn(n, e);
1405
1405
  return i ? () => {
1406
- un(i, n), Ue(i), P(n, 0);
1407
- } : js(n, e);
1406
+ un(i, n), Ve(i), P(n, 0);
1407
+ } : Ws(n, e);
1408
1408
  }
1409
- function Ys(e, t) {
1409
+ function Qs(e, t) {
1410
1410
  const n = Oe(e, t) || xn(e)[0];
1411
1411
  if (!n) return !1;
1412
1412
  const o = n.cloneNode(!0);
@@ -1414,7 +1414,7 @@ function Ys(e, t) {
1414
1414
  r.checked ? r.setAttribute("checked", "") : r.removeAttribute("checked");
1415
1415
  }), n.after(o), !0;
1416
1416
  }
1417
- function Qs(e, t) {
1417
+ function Zs(e, t) {
1418
1418
  const n = Oe(e, t) || xn(e)[0];
1419
1419
  if (!n) return !1;
1420
1420
  if (e.children.length <= 1) {
@@ -1434,16 +1434,16 @@ function $o(e, t, n) {
1434
1434
  const r = Array.from(o.parentElement.children).filter((l) => !it(l)), i = r[r.indexOf(o) + n];
1435
1435
  return i ? (n < 0 ? i.before(o) : i.after(o), !0) : !1;
1436
1436
  }
1437
- function Zs(e, t, n) {
1437
+ function Js(e, t, n) {
1438
1438
  return !e || !t || e === t || e.contains(t) || t.contains(e) ? !1 : (n ? t.before(e) : t.after(e), !0);
1439
1439
  }
1440
- function Js(e) {
1440
+ function ea(e) {
1441
1441
  const t = e.parentElement, n = e.previousElementSibling;
1442
1442
  if (!t || !n) return !1;
1443
1443
  let o = Array.from(n.children).find((r) => r.tagName === t.tagName && r.getAttribute("data-type") === t.getAttribute("data-type"));
1444
1444
  return o || (o = document.createElement(t.tagName), t.hasAttribute("data-type") && o.setAttribute("data-type", t.getAttribute("data-type")), (we(n) ? ko(n) : n).appendChild(o)), o.appendChild(e), !0;
1445
1445
  }
1446
- function qr(e) {
1446
+ function Ur(e) {
1447
1447
  const t = e.parentElement;
1448
1448
  if (!t || t.tagName !== "UL" && t.tagName !== "OL") return !1;
1449
1449
  const n = t.parentElement;
@@ -1454,32 +1454,32 @@ function qr(e) {
1454
1454
  Ce(i, r), o && r.setAttribute("style", o), e.remove(), n.after(r);
1455
1455
  } else
1456
1456
  n.after(e);
1457
- return Ue(t), !0;
1457
+ return Ve(t), !0;
1458
1458
  }
1459
- function ea(e, t = !1) {
1459
+ function ta(e, t = !1) {
1460
1460
  const n = V(e);
1461
1461
  if (!n || !n.collapsed) return !1;
1462
1462
  const o = X(n.startContainer, e);
1463
1463
  if (!o) return !1;
1464
1464
  if (t) return Do(n);
1465
- if (fr(o)) return Xs(o, n);
1465
+ if (hr(o)) return js(o, n);
1466
1466
  if (zt(o)) return Do(n);
1467
1467
  const r = yo(o, e);
1468
1468
  if (r && ze(o))
1469
1469
  return ft(r), P(r.nextElementSibling || r, 0), !0;
1470
- const i = Gr(o, e);
1470
+ const i = Kr(o, e);
1471
1471
  if (i && ze(o))
1472
- return un(i, o), Ue(i), P(o, 0), !0;
1472
+ return un(i, o), Ve(i), P(o, 0), !0;
1473
1473
  const l = Zn(o, e);
1474
1474
  if (l && ze(o))
1475
- return un(l, o), Ue(l), P(o, 0), !0;
1476
- if (l && o === ga(l) && ae(o, n.startContainer, n.startOffset) >= Ae(o)) {
1475
+ return un(l, o), Ve(l), P(o, 0), !0;
1476
+ if (l && o === va(l) && ae(o, n.startContainer, n.startOffset) >= Ae(o)) {
1477
1477
  const u = document.createElement("p");
1478
1478
  return u.appendChild(document.createElement("br")), l.after(u), P(u, 0), !0;
1479
1479
  }
1480
1480
  const s = document.createRange();
1481
1481
  s.setStart(n.startContainer, n.startOffset);
1482
- const a = Ve(o, Ae(o));
1482
+ const a = Ge(o, Ae(o));
1483
1483
  s.setEnd(a.node, a.offset);
1484
1484
  const c = s.extractContents();
1485
1485
  if (r) {
@@ -1502,13 +1502,13 @@ function wt(e) {
1502
1502
  Lt(e) || e.replaceChildren(document.createElement("br"));
1503
1503
  }
1504
1504
  }
1505
- const Tn = "line-height", Sn = "text-align", wn = "padding-left", an = "text-indent", ta = "margin-top", na = "margin-bottom", Ur = [Tn, Sn, wn, an, ta, na], Jt = "data-battrs", _o = (e) => Math.min(Math.max(Math.round(Number(e) || 0), 0), Cn);
1505
+ const Tn = "line-height", Sn = "text-align", wn = "padding-left", an = "text-indent", na = "margin-top", oa = "margin-bottom", Vr = [Tn, Sn, wn, an, na, oa], Jt = "data-battrs", _o = (e) => Math.min(Math.max(Math.round(Number(e) || 0), 0), Cn);
1506
1506
  function dt(e, t = null, n = null) {
1507
1507
  const o = [], r = (n || (t || ao(e)).map((i) => i.block)).filter((i) => i?.isConnected);
1508
1508
  for (const i of r) {
1509
- const l = ol(i, e);
1509
+ const l = rl(i, e);
1510
1510
  if (!l) continue;
1511
- const s = rl(l);
1511
+ const s = il(l);
1512
1512
  s && !o.includes(s) && o.push(s);
1513
1513
  }
1514
1514
  return o;
@@ -1519,7 +1519,7 @@ function Oe(e, t) {
1519
1519
  function xn(e, t = null, n = null) {
1520
1520
  const o = [], r = (n || (t || ao(e)).map((i) => i.block)).filter((i) => i?.isConnected);
1521
1521
  for (const i of r) {
1522
- const l = Ke(i, e) || i;
1522
+ const l = Xe(i, e) || i;
1523
1523
  o.includes(l) || o.push(l);
1524
1524
  }
1525
1525
  return o;
@@ -1530,7 +1530,7 @@ function cn(e) {
1530
1530
  const n = Number.parseFloat(t);
1531
1531
  return Number.isNaN(n) || n <= 0 ? 0 : t.endsWith("em") ? _o(n / Gn) : _o(n / (Gn * 16));
1532
1532
  }
1533
- function oa(e) {
1533
+ function ra(e) {
1534
1534
  return {
1535
1535
  lineHeight: ke(e, Tn),
1536
1536
  textAlign: ke(e, Sn) || null,
@@ -1548,27 +1548,27 @@ function Pt(e, t) {
1548
1548
  }
1549
1549
  return n;
1550
1550
  }
1551
- const ra = (e) => e > 0 ? `${e * Gn}em` : "", ia = (e, t, n) => Pt(dt(e, n), () => ({ [Tn]: t || "" })), la = (e, t, n) => Pt(dt(e, n), () => ({ [Sn]: t || "" }));
1551
+ const ia = (e) => e > 0 ? `${e * Gn}em` : "", la = (e, t, n) => Pt(dt(e, n), () => ({ [Tn]: t || "" })), sa = (e, t, n) => Pt(dt(e, n), () => ({ [Sn]: t || "" }));
1552
1552
  function Po(e, t, n) {
1553
1553
  return Pt(dt(e, n), (o) => {
1554
1554
  const r = cn(o), i = t > 0 ? r >= Cn ? null : r + 1 : r > 0 ? r - 1 : null;
1555
- return i === null ? null : { [wn]: ra(i) };
1555
+ return i === null ? null : { [wn]: ia(i) };
1556
1556
  });
1557
1557
  }
1558
- function sa(e, t) {
1558
+ function aa(e, t) {
1559
1559
  return Pt(dt(e, t), (n) => ({
1560
1560
  [an]: ke(n, an) ? "" : "2em"
1561
1561
  }));
1562
1562
  }
1563
- function aa(e, t) {
1564
- return Pt(dt(e, t), (n) => Ur.some((r) => ke(n, r)) ? { [Tn]: "", [Sn]: "", [wn]: "" } : null);
1563
+ function ca(e, t) {
1564
+ return Pt(dt(e, t), (n) => Vr.some((r) => ke(n, r)) ? { [Tn]: "", [Sn]: "", [wn]: "" } : null);
1565
1565
  }
1566
1566
  function Ft(e) {
1567
1567
  if (!e) return "";
1568
1568
  const t = e.tagName;
1569
1569
  return t === "H1" && e.classList.contains(H.TITLE) ? "title" : /^H[1-6]$/.test(t) ? `heading${t[1]}` : t === "P" ? "paragraph" : t === "BLOCKQUOTE" ? "blockquote" : t === "PRE" ? "codeBlock" : t === "HR" ? "divider" : t === "IMG" ? "image" : t === "TABLE" ? "table" : t === "UL" ? e.getAttribute("data-type") === "taskList" ? "taskList" : "bulletList" : t === "OL" ? "orderedList" : t === "LI" ? we(e) ? "taskItem" : "listItem" : e.hasAttribute(He) ? "callout" : e.hasAttribute(fe) ? "superBlock" : e.hasAttribute(ye) ? "column" : "";
1570
1570
  }
1571
- const Vr = (e, t) => Ft(ca(e, t));
1571
+ const Gr = (e, t) => Ft(ua(e, t));
1572
1572
  function qt(e, t) {
1573
1573
  !e || !t?.contains(e) || t.before(e);
1574
1574
  }
@@ -1585,14 +1585,14 @@ function un(e, t) {
1585
1585
  o.forEach((i) => r.appendChild(i)), e.after(t, r);
1586
1586
  }
1587
1587
  }
1588
- function Ue(e) {
1588
+ function Ve(e) {
1589
1589
  let t = e;
1590
1590
  for (; t && t.tagName && t.nodeType === Node.ELEMENT_NODE && !(!(t.tagName === "UL" || t.tagName === "OL" || t.tagName === "BLOCKQUOTE" || t.tagName === "PRE" || t.tagName === "LI" || Ot(t) || mn(t)) || Lt(t)); ) {
1591
1591
  const o = t.parentElement;
1592
1592
  t.remove(), t = o;
1593
1593
  }
1594
1594
  }
1595
- const yo = (e, t) => Xe(e, (n) => n.tagName === "LI", t), ca = (e, t) => Xe(e, (n) => n.tagName === "UL" || n.tagName === "OL", t), Gr = (e, t) => Xe(e, (n) => n.tagName === "BLOCKQUOTE", t);
1595
+ const yo = (e, t) => je(e, (n) => n.tagName === "LI", t), ua = (e, t) => je(e, (n) => n.tagName === "UL" || n.tagName === "OL", t), Kr = (e, t) => je(e, (n) => n.tagName === "BLOCKQUOTE", t);
1596
1596
  function ko(e) {
1597
1597
  let t = Array.from(e.children).find((n) => n.tagName === "DIV");
1598
1598
  if (!t) {
@@ -1610,14 +1610,14 @@ function Co() {
1610
1610
  return t.type = "checkbox", e.appendChild(t), { label: e, input: t };
1611
1611
  }
1612
1612
  function dn(e, t) {
1613
- for (const n of Ur) {
1613
+ for (const n of Vr) {
1614
1614
  const o = ke(e, n);
1615
1615
  o && Mt(t, n, o);
1616
1616
  }
1617
1617
  for (const n of Array.from(e.attributes))
1618
- n.name.startsWith("data-") && !Sr.includes(n.name) && t.setAttribute(n.name, n.value);
1618
+ n.name.startsWith("data-") && !wr.includes(n.name) && t.setAttribute(n.name, n.value);
1619
1619
  }
1620
- function ua(e, t) {
1620
+ function da(e, t) {
1621
1621
  const n = document.createElement("li");
1622
1622
  dn(e, n);
1623
1623
  const o = document.createDocumentFragment();
@@ -1629,18 +1629,18 @@ function ua(e, t) {
1629
1629
  n.appendChild(o);
1630
1630
  return n;
1631
1631
  }
1632
- function da(e, t) {
1632
+ function fa(e, t) {
1633
1633
  const n = document.createElement(t === "orderedList" ? "ol" : "ul");
1634
1634
  t === "taskList" && n.setAttribute("data-type", "taskList"), co(e, n);
1635
1635
  for (const o of e)
1636
- n.appendChild(ua(o, t)), o.remove();
1636
+ n.appendChild(da(o, t)), o.remove();
1637
1637
  return n;
1638
1638
  }
1639
1639
  function ft(e) {
1640
1640
  const t = e.parentElement, n = document.createElement("p");
1641
1641
  dn(e, n);
1642
1642
  const o = we(e) ? ko(e) : e;
1643
- return Ce(o, n), t && (t.tagName === "UL" || t.tagName === "OL") ? (t.before(n), e.remove(), Ue(t)) : e.replaceWith(n), n;
1643
+ return Ce(o, n), t && (t.tagName === "UL" || t.tagName === "OL") ? (t.before(n), e.remove(), Ve(t)) : e.replaceWith(n), n;
1644
1644
  }
1645
1645
  function Qn(e) {
1646
1646
  return Array.from(e.children).filter((t) => t.tagName === "LI").map((t) => ft(t));
@@ -1660,17 +1660,17 @@ function Ne(e, t, n = null) {
1660
1660
  if (t === "title" || t === "paragraph" || r) {
1661
1661
  const i = t === "title" ? "H1" : r ? `H${r[1]}` : "P", l = t === "title";
1662
1662
  let s = !1;
1663
- for (const a of [...o]) s = fa(a, i, l) || s;
1663
+ for (const a of [...o]) s = ha(a, i, l) || s;
1664
1664
  return s;
1665
1665
  }
1666
- return t === "blockquote" ? ha(e, o) : t === "codeBlock" ? ma(e, o) : t === "bulletList" || t === "orderedList" || t === "taskList" ? pa(e, o, t) : t === "callout" ? va(o) : t === "superBlock" ? ba(o) : !1;
1666
+ return t === "blockquote" ? ma(e, o) : t === "codeBlock" ? pa(e, o) : t === "bulletList" || t === "orderedList" || t === "taskList" ? ga(e, o, t) : t === "callout" ? ba(o) : t === "superBlock" ? ya(o) : !1;
1667
1667
  }
1668
1668
  function Fo(e, t) {
1669
1669
  if (!e || t === null) return !1;
1670
1670
  const n = e.classList.contains(H.TITLE);
1671
1671
  return t === n ? !1 : (t ? e.classList.add(H.TITLE) : e.classList.remove(H.TITLE), !0);
1672
1672
  }
1673
- function fa(e, t, n = null) {
1673
+ function ha(e, t, n = null) {
1674
1674
  if (!e.isConnected || e.tagName === "HR" || e.tagName === "IMG" || e.tagName === "TABLE") return !1;
1675
1675
  let o = null;
1676
1676
  if (e.tagName === "PRE") {
@@ -1696,7 +1696,7 @@ function fa(e, t, n = null) {
1696
1696
  }
1697
1697
  return o && Fo(o, n), !0;
1698
1698
  }
1699
- function ha(e, t) {
1699
+ function ma(e, t) {
1700
1700
  if (t.every((r) => r.tagName === "BLOCKQUOTE")) {
1701
1701
  for (const r of t)
1702
1702
  Array.from(r.children).forEach((i) => qt(i, r)), r.remove();
@@ -1709,7 +1709,7 @@ function ha(e, t) {
1709
1709
  const o = document.createElement("blockquote");
1710
1710
  return co(n, o), !0;
1711
1711
  }
1712
- function ma(e, t) {
1712
+ function pa(e, t) {
1713
1713
  const n = t.filter((l) => l.tagName === "PRE");
1714
1714
  if (n.length)
1715
1715
  return n.forEach(Ln), !0;
@@ -1717,7 +1717,7 @@ function ma(e, t) {
1717
1717
  return i.textContent = o.join(`
1718
1718
  `), r.appendChild(i), t[0].before(r), t.forEach((l) => l.remove()), !0;
1719
1719
  }
1720
- function pa(e, t, n) {
1720
+ function ga(e, t, n) {
1721
1721
  const o = /* @__PURE__ */ new Set(), r = [];
1722
1722
  for (const c of t)
1723
1723
  c.tagName === "UL" || c.tagName === "OL" ? o.add(c) : c.tagName === "LI" ? o.add(c.parentElement) : r.push(c);
@@ -1735,7 +1735,7 @@ function pa(e, t, n) {
1735
1735
  if (!l.length) return !1;
1736
1736
  let s = [];
1737
1737
  const a = () => {
1738
- s.length && da(s, n), s = [];
1738
+ s.length && fa(s, n), s = [];
1739
1739
  };
1740
1740
  for (const c of l)
1741
1741
  s.length && c.previousElementSibling !== s[s.length - 1] && a(), s.push(c);
@@ -1747,7 +1747,7 @@ function Zn(e, t) {
1747
1747
  Ot(o) && (n = o), o = o.parentElement;
1748
1748
  return n;
1749
1749
  }
1750
- function ga(e) {
1750
+ function va(e) {
1751
1751
  if (!e) return null;
1752
1752
  if (e.hasAttribute(fe)) {
1753
1753
  const t = e.lastElementChild;
@@ -1755,7 +1755,7 @@ function ga(e) {
1755
1755
  }
1756
1756
  return e.lastElementChild;
1757
1757
  }
1758
- function va(e) {
1758
+ function ba(e) {
1759
1759
  if (e.every((o) => o.hasAttribute(He))) {
1760
1760
  for (const o of e)
1761
1761
  Array.from(o.children).forEach((r) => qt(r, o)), o.remove();
@@ -1766,7 +1766,7 @@ function va(e) {
1766
1766
  const n = document.createElement("div");
1767
1767
  return n.setAttribute(He, "info"), co(t, n), !0;
1768
1768
  }
1769
- function ba(e) {
1769
+ function ya(e) {
1770
1770
  if (e.every((o) => o.hasAttribute(fe))) {
1771
1771
  for (const o of e) {
1772
1772
  for (const r of Array.from(o.children))
@@ -1788,7 +1788,7 @@ function ba(e) {
1788
1788
  }
1789
1789
  return !0;
1790
1790
  }
1791
- function ya(e) {
1791
+ function ka(e) {
1792
1792
  const t = e?.getAttribute?.(Jt);
1793
1793
  if (!t) return {};
1794
1794
  try {
@@ -1798,7 +1798,7 @@ function ya(e) {
1798
1798
  return {};
1799
1799
  }
1800
1800
  }
1801
- function ka(e, t) {
1801
+ function Ca(e, t) {
1802
1802
  if (!e?.setAttribute) return !1;
1803
1803
  const n = {};
1804
1804
  for (const [l, s] of Object.entries(t || {})) {
@@ -1808,13 +1808,13 @@ function ka(e, t) {
1808
1808
  const o = Object.keys(n).sort(), r = o.length ? JSON.stringify(n, o) : "", i = e.getAttribute(Jt) || "";
1809
1809
  return r === i ? !1 : (r ? e.setAttribute(Jt, r) : e.removeAttribute(Jt), !0);
1810
1810
  }
1811
- function Kr(e) {
1811
+ function Xr(e) {
1812
1812
  const t = V(e);
1813
1813
  if (!t) return null;
1814
1814
  const n = X(t.startContainer, e);
1815
- return n ? Ke(n, e) || n : null;
1815
+ return n ? Xe(n, e) || n : null;
1816
1816
  }
1817
- const Ca = [
1817
+ const Ea = [
1818
1818
  { re: /^#\s$/, kind: "heading1" },
1819
1819
  { re: /^##\s$/, kind: "heading2" },
1820
1820
  { re: /^###\s$/, kind: "heading3" },
@@ -1827,12 +1827,12 @@ const Ca = [
1827
1827
  { re: /^(?:\[[ xX]?\]|\(\s?\))\s$/, kind: "taskList" },
1828
1828
  { re: /^```$/, kind: "codeBlock" },
1829
1829
  { re: /^---$/, kind: "divider" }
1830
- ], Ea = [
1830
+ ], Aa = [
1831
1831
  { re: /\*\*([^*]+)\*\*$/, key: "bold", open: 2, close: 2 },
1832
1832
  { re: /(?:^|\s)\*([^*\s][^*]*)\*$/, key: "italic", open: 1, close: 1 },
1833
1833
  { re: /~~([^~]+)~~$/, key: "strike", open: 2, close: 2 },
1834
1834
  { re: /`([^`]+)`$/, key: "code", open: 1, close: 1 }
1835
- ], Aa = {
1835
+ ], Ta = {
1836
1836
  "Mod-z": ["undo"],
1837
1837
  "Mod-Shift-z": ["redo"],
1838
1838
  "Mod-y": ["redo"],
@@ -1860,21 +1860,21 @@ const Ca = [
1860
1860
  "Mod-Shift-b": ["insertBlockNear", null, "before"],
1861
1861
  "Mod-Shift-a": ["insertBlockNear", null, "after"]
1862
1862
  };
1863
- function Ta(e, t) {
1863
+ function Sa(e, t) {
1864
1864
  const n = V(e), o = n && De(n.startContainer, e);
1865
1865
  if (!o) return !1;
1866
1866
  const r = $e(o, e), i = Array.from(r.querySelectorAll("td,th")), l = i[i.indexOf(o) + (t ? -1 : 1)];
1867
1867
  if (l)
1868
1868
  return P(he(l, e) || l, 0), !0;
1869
1869
  if (t) return !0;
1870
- const s = Xe(o, (c) => c.tagName === "TR", e), a = document.createElement("tr");
1870
+ const s = je(o, (c) => c.tagName === "TR", e), a = document.createElement("tr");
1871
1871
  for (const c of Array.from(s.children)) {
1872
1872
  const f = document.createElement(c.tagName.toLowerCase());
1873
1873
  f.appendChild(document.createElement("br")), a.appendChild(f);
1874
1874
  }
1875
1875
  return s.after(a), P(he(a.firstElementChild, e) || a.firstElementChild, 0), !0;
1876
1876
  }
1877
- function Sa(e) {
1877
+ function wa(e) {
1878
1878
  const t = e.parentElement;
1879
1879
  return { parent: t, index: Array.from(t.children).indexOf(e) };
1880
1880
  }
@@ -1883,24 +1883,24 @@ function qo(e) {
1883
1883
  if (!n || !n.collapsed) return !1;
1884
1884
  const o = X(n.startContainer, t);
1885
1885
  if (!o) return !1;
1886
- const r = Ca.find((i) => i.re.test(o.textContent || ""));
1886
+ const r = Ea.find((i) => i.re.test(o.textContent || ""));
1887
1887
  return r ? (e.run(() => {
1888
1888
  if (r.kind === "divider") {
1889
- Pr(t);
1889
+ Fr(t);
1890
1890
  return;
1891
1891
  }
1892
- const i = Sa(o);
1892
+ const i = wa(o);
1893
1893
  Ne(t, r.kind, [o]);
1894
1894
  const l = i.parent?.children[i.index] || o, s = he(l, t) || l;
1895
1895
  s.textContent = "", s.appendChild(document.createElement("br")), P(s, 0);
1896
1896
  }, { merge: !0 }), !0) : !1;
1897
1897
  }
1898
- function wa(e) {
1898
+ function xa(e) {
1899
1899
  const t = e.root, n = V(t);
1900
1900
  if (!n || !n.collapsed) return !1;
1901
1901
  const o = X(n.startContainer, t);
1902
1902
  if (!o) return !1;
1903
- const r = ae(o, n.startContainer, n.startOffset), i = (o.textContent || "").slice(0, r), l = Ea.map((p) => ({ rule: p, match: i.match(p.re) })).find((p) => p.match);
1903
+ const r = ae(o, n.startContainer, n.startOffset), i = (o.textContent || "").slice(0, r), l = Aa.map((p) => ({ rule: p, match: i.match(p.re) })).find((p) => p.match);
1904
1904
  if (!l) return !1;
1905
1905
  const { rule: s, match: a } = l, c = r - a[0].length, f = c + s.open, u = f + a[1].length;
1906
1906
  return e.run(() => {
@@ -1947,7 +1947,7 @@ function Eo(e, t) {
1947
1947
  o.collapsed || o.deleteContents();
1948
1948
  const i = o.startContainer;
1949
1949
  if (i.nodeType !== Node.TEXT_NODE && /^(BR|IMG|INPUT)$/.test(i.tagName || "")) {
1950
- const m = Ve(r, ae(r, i, o.startOffset)), h = document.createRange();
1950
+ const m = Ge(r, ae(r, i, o.startOffset)), h = document.createRange();
1951
1951
  h.setStart(m.node, m.offset), h.collapse(!0), o = h;
1952
1952
  }
1953
1953
  const l = Array.from(t.children), s = l.length === 1 && /^(SPAN|STRONG|EM|U|S|CODE|A|B|I|FONT)$/.test(l[0].tagName);
@@ -1983,18 +1983,18 @@ function Eo(e, t) {
1983
1983
  }
1984
1984
  const c = document.createRange();
1985
1985
  c.setStart(o.startContainer, o.startOffset);
1986
- const f = Ve(r, Ae(r));
1986
+ const f = Ge(r, Ae(r));
1987
1987
  c.setEnd(f.node, f.offset);
1988
1988
  const u = c.extractContents(), p = document.createElement("p");
1989
1989
  p.appendChild(u), r.after(p);
1990
1990
  for (const m of l) p.before(m);
1991
1991
  r !== p && ze(r) && r.remove();
1992
- for (const m of l) Re(m, n) && Cs(m);
1992
+ for (const m of l) Re(m, n) && Es(m);
1993
1993
  Wt(p);
1994
1994
  const y = p.previousElementSibling, E = he(y, n) || y || r;
1995
1995
  P(E, Ae(E));
1996
1996
  }
1997
- function xa(e, t) {
1997
+ function La(e, t) {
1998
1998
  const n = String(t).split(/\r?\n/);
1999
1999
  if (n.length === 1) {
2000
2000
  e.run(() => {
@@ -2016,28 +2016,28 @@ function xa(e, t) {
2016
2016
  }
2017
2017
  e.run(() => Eo(e, o));
2018
2018
  }
2019
- const La = (e, t) => /<table[\s>]/i.test(t || "") || /\t/.test(e || "");
2020
- function Ma(e, t) {
2019
+ const Ma = (e, t) => /<table[\s>]/i.test(t || "") || /\t/.test(e || "");
2020
+ function Na(e, t) {
2021
2021
  const n = t.clipboardData;
2022
2022
  if (!n) return;
2023
- const o = cr(n);
2023
+ const o = ur(n);
2024
2024
  if (o.length) {
2025
2025
  t.preventDefault(), e.insertImageFiles(o);
2026
2026
  return;
2027
2027
  }
2028
2028
  const r = n.getData("text/html"), i = n.getData("text/plain"), l = V(e.root);
2029
- if (La(i, r) && l && De(l.startContainer, e.root)) {
2029
+ if (Ma(i, r) && l && De(l.startContainer, e.root)) {
2030
2030
  t.preventDefault(), e.pasteTableData({ text: i, html: r });
2031
2031
  return;
2032
2032
  }
2033
2033
  if (r) {
2034
- t.preventDefault(), e.run(() => Eo(e, wr(zr(r))));
2034
+ t.preventDefault(), e.run(() => Eo(e, xr(Dr(r))));
2035
2035
  return;
2036
2036
  }
2037
- i && (t.preventDefault(), xa(e, i));
2037
+ i && (t.preventDefault(), La(e, i));
2038
2038
  }
2039
- function Na(e, t) {
2040
- const n = cr(t.dataTransfer);
2039
+ function Ra(e, t) {
2040
+ const n = ur(t.dataTransfer);
2041
2041
  if (!n.length) return;
2042
2042
  t.preventDefault();
2043
2043
  const o = e.root.ownerDocument.caretRangeFromPoint?.(t.clientX, t.clientY);
@@ -2047,28 +2047,28 @@ function Na(e, t) {
2047
2047
  }
2048
2048
  e.insertImageFiles(n);
2049
2049
  }
2050
- function Ra(e) {
2050
+ function Oa(e) {
2051
2051
  if (!e.hasPendingMarks()) return;
2052
2052
  const t = e.root, n = V(t), o = n && X(n.startContainer, t);
2053
2053
  if (!o) return;
2054
2054
  const r = ae(o, n.startContainer, n.startOffset), i = e.pending;
2055
2055
  e.run(() => bo(t, o, 0, r, i));
2056
2056
  }
2057
- function Oa(e) {
2057
+ function Ba(e) {
2058
2058
  const t = e.root, o = go({ keydown: (u) => {
2059
2059
  if (!e.isFocused() || u.defaultPrevented) return !1;
2060
- const p = Aa[Kl(u) || ""];
2060
+ const p = Ta[Xl(u) || ""];
2061
2061
  if (p)
2062
2062
  return u.preventDefault(), u.stopPropagation(), p[0] === "requestLink" ? e.emit("request-link") : p[0] === "requestFind" ? e.emit("open-find") : e.exec(p[0], ...p.slice(1)), !0;
2063
2063
  if (u.key === "Enter")
2064
- return e.isMenuOpen() ? !1 : (u.preventDefault(), u.stopPropagation(), e.run(() => ea(t, u.shiftKey)), !0);
2064
+ return e.isMenuOpen() ? !1 : (u.preventDefault(), u.stopPropagation(), e.run(() => ta(t, u.shiftKey)), !0);
2065
2065
  if (u.key === "Backspace") {
2066
- const y = Ws(t);
2066
+ const y = Ys(t);
2067
2067
  return y ? (u.preventDefault(), u.stopPropagation(), e.run(y), !0) : !1;
2068
2068
  }
2069
- return u.key === "Tab" || u.key === "Shift-Tab" ? (u.preventDefault(), u.stopPropagation(), e.run(() => Ba(e, u.shiftKey)), !0) : !1;
2069
+ return u.key === "Tab" || u.key === "Shift-Tab" ? (u.preventDefault(), u.stopPropagation(), e.run(() => Ia(e, u.shiftKey)), !0) : !1;
2070
2070
  } }, { priority: yn.APPLET, active: () => e.isFocused() }), r = (u) => {
2071
- if (e.suggesting && ss(t, u)) {
2071
+ if (e.suggesting && as(t, u)) {
2072
2072
  u.preventDefault();
2073
2073
  return;
2074
2074
  }
@@ -2090,7 +2090,7 @@ function Oa(e) {
2090
2090
  });
2091
2091
  }, i = (u) => {
2092
2092
  if ((u.inputType === "deleteContentBackward" || u.inputType === "deleteContentForward") && e.clearPendingMarks(), u.inputType === "insertText" || u.inputType === "insertCompositionText") {
2093
- if (wa(e)) return;
2093
+ if (xa(e)) return;
2094
2094
  qo(e);
2095
2095
  return;
2096
2096
  }
@@ -2098,26 +2098,26 @@ function Oa(e) {
2098
2098
  }, l = () => {
2099
2099
  e.composing = !0;
2100
2100
  }, s = () => {
2101
- e.composing = !1, Ra(e), e.emit("update");
2102
- }, a = (u) => Ma(e, u), c = (u) => Na(e, u), f = (u) => {
2101
+ e.composing = !1, Oa(e), e.emit("update");
2102
+ }, a = (u) => Na(e, u), c = (u) => Ra(e, u), f = (u) => {
2103
2103
  u.dataTransfer?.types?.includes("Files") && u.preventDefault();
2104
2104
  };
2105
2105
  return t.addEventListener("beforeinput", r), t.addEventListener("input", i), t.addEventListener("compositionstart", l), t.addEventListener("compositionend", s), t.addEventListener("paste", a), t.addEventListener("drop", c), t.addEventListener("dragover", f), () => {
2106
2106
  o(), t.removeEventListener("beforeinput", r), t.removeEventListener("input", i), t.removeEventListener("compositionstart", l), t.removeEventListener("compositionend", s), t.removeEventListener("paste", a), t.removeEventListener("drop", c), t.removeEventListener("dragover", f);
2107
2107
  };
2108
2108
  }
2109
- function Ba(e, t) {
2109
+ function Ia(e, t) {
2110
2110
  const n = e.root;
2111
- if (Ta(n, t)) return;
2111
+ if (Sa(n, t)) return;
2112
2112
  const o = V(n), r = o && X(o.startContainer, n), i = r ? yo(r, n) : null;
2113
2113
  if (i) {
2114
2114
  if (t) {
2115
- if (qr(i)) return;
2116
- } else if (Js(i)) return;
2115
+ if (Ur(i)) return;
2116
+ } else if (ea(i)) return;
2117
2117
  }
2118
2118
  e.exec(t ? "decreaseBlockIndent" : "increaseBlockIndent");
2119
2119
  }
2120
- function Ia(e, t, n) {
2120
+ function Ha(e, t, n) {
2121
2121
  if (!t || !n) return null;
2122
2122
  let o = Math.min(t.r, n.r), r = Math.max(t.r + t.rowspan - 1, n.r + n.rowspan - 1), i = Math.min(t.c, n.c), l = Math.max(t.c + t.colspan - 1, n.c + n.colspan - 1), s = !0;
2123
2123
  for (; s; ) {
@@ -2127,14 +2127,14 @@ function Ia(e, t, n) {
2127
2127
  }
2128
2128
  return { r1: o, c1: i, r2: r, c2: l };
2129
2129
  }
2130
- function Ha(e) {
2130
+ function za(e) {
2131
2131
  for (const t of e) {
2132
2132
  const n = t.c, o = t.r, r = t.colspan, i = t.rowspan;
2133
2133
  t.r = n, t.c = o, t.rowspan = r, t.colspan = i;
2134
2134
  }
2135
2135
  return e;
2136
2136
  }
2137
- const Ao = 50, en = "data-pin-head", ot = (e, t) => `${e},${t}`, Xr = (e) => !e.textContent?.trim() && !e.querySelector("img");
2137
+ const Ao = 50, en = "data-pin-head", ot = (e, t) => `${e},${t}`, jr = (e) => !e.textContent?.trim() && !e.querySelector("img");
2138
2138
  function ue(e) {
2139
2139
  const t = [], n = /* @__PURE__ */ new Map();
2140
2140
  let o = 0;
@@ -2188,28 +2188,28 @@ function Mn(e) {
2188
2188
  const t = document.createElement(e ? "th" : "td");
2189
2189
  return t.appendChild(document.createElement("br")), t;
2190
2190
  }
2191
- function za(e) {
2191
+ function Da(e) {
2192
2192
  const t = e.matrix[0];
2193
2193
  return !!t && t.every((n) => n && n.el.tagName === "TH");
2194
2194
  }
2195
- function Da(e) {
2195
+ function $a(e) {
2196
2196
  const t = e.cells.filter((n) => n.c === 0);
2197
2197
  return !!t.length && t.every((n) => n.el.tagName === "TH");
2198
2198
  }
2199
- function jr(e, t, n) {
2200
- return !!(t === 0 && za(e) || n === 0 && Da(e));
2199
+ function Wr(e, t, n) {
2200
+ return !!(t === 0 && Da(e) || n === 0 && $a(e));
2201
2201
  }
2202
2202
  function st(e, t) {
2203
2203
  return e.cells.find((n) => n.el === t) || null;
2204
2204
  }
2205
- function $a(e, t, n) {
2205
+ function _a(e, t, n) {
2206
2206
  const o = document.elementFromPoint(t, n);
2207
2207
  if (!o || !e.contains(o)) return null;
2208
2208
  const r = De(o, e);
2209
2209
  return r && $e(r, e) ? r : null;
2210
2210
  }
2211
- function _a(e, t = null, n = null) {
2212
- const o = t || Pa(e), r = o ? $e(o, e) : null;
2211
+ function Pa(e, t = null, n = null) {
2212
+ const o = t || Fa(e), r = o ? $e(o, e) : null;
2213
2213
  if (!r) return null;
2214
2214
  const i = ue(r);
2215
2215
  if (!i.height || !i.width) return null;
@@ -2225,7 +2225,7 @@ function _a(e, t = null, n = null) {
2225
2225
  rect: s
2226
2226
  };
2227
2227
  }
2228
- function Pa(e) {
2228
+ function Fa(e) {
2229
2229
  const t = window.getSelection();
2230
2230
  if (!t || !t.rangeCount) return null;
2231
2231
  const n = t.getRangeAt(0);
@@ -2240,12 +2240,12 @@ function eo(e, t, n) {
2240
2240
  l.r + l.rowspan > i && l.r <= i - 1 ? l.rowspan += 1 : l.r >= i && (l.r += 1);
2241
2241
  }), me(o);
2242
2242
  for (let l = 0; l < o.width; l += 1)
2243
- o.matrix[i]?.[l] || o.cells.push({ el: Mn(jr(o, i, l)), r: i, c: l, rowspan: 1, colspan: 1 });
2243
+ o.matrix[i]?.[l] || o.cells.push({ el: Mn(Wr(o, i, l)), r: i, c: l, rowspan: 1, colspan: 1 });
2244
2244
  me(o), t = i;
2245
2245
  }
2246
2246
  return Se(o), !0;
2247
2247
  }
2248
- function Fa(e, t, n) {
2248
+ function qa(e, t, n) {
2249
2249
  const { grid: o } = e;
2250
2250
  for (let r = t; r <= n; r += 1)
2251
2251
  o.cells.forEach((i) => {
@@ -2261,12 +2261,12 @@ function to(e, t, n) {
2261
2261
  l.c + l.colspan > i && l.c <= i - 1 ? l.colspan += 1 : l.c >= i && (l.c += 1);
2262
2262
  }), me(o);
2263
2263
  for (let l = 0; l < o.height; l += 1)
2264
- o.matrix[l]?.[i] || o.matrix[l]?.[i - 1] && o.matrix[l][i - 1].c === i - 1 && o.matrix[l][i - 1].c + o.matrix[l][i - 1].colspan > i || o.cells.push({ el: Mn(jr(o, l, i)), r: l, c: i, rowspan: 1, colspan: 1 });
2264
+ o.matrix[l]?.[i] || o.matrix[l]?.[i - 1] && o.matrix[l][i - 1].c === i - 1 && o.matrix[l][i - 1].c + o.matrix[l][i - 1].colspan > i || o.cells.push({ el: Mn(Wr(o, l, i)), r: l, c: i, rowspan: 1, colspan: 1 });
2265
2265
  me(o), t = i;
2266
2266
  }
2267
2267
  return Se(o), ht(o), !0;
2268
2268
  }
2269
- function qa(e, t, n) {
2269
+ function Ua(e, t, n) {
2270
2270
  const { grid: o } = e;
2271
2271
  for (let r = t; r <= n; r += 1)
2272
2272
  o.cells.forEach((i) => {
@@ -2274,15 +2274,15 @@ function qa(e, t, n) {
2274
2274
  }), o.cells = o.cells.filter((i) => i.el.isConnected), me(o);
2275
2275
  return o.cells.length ? (Se(o), ht(o), !0) : (e.table.remove(), !0);
2276
2276
  }
2277
- function Wr(e, t) {
2277
+ function Yr(e, t) {
2278
2278
  return e.cells.some(
2279
- (n) => n.r >= t.r1 && n.r + n.rowspan - 1 <= t.r2 && n.c >= t.c1 && n.c + n.colspan - 1 <= t.c2 ? !1 : Ua(n, t)
2279
+ (n) => n.r >= t.r1 && n.r + n.rowspan - 1 <= t.r2 && n.c >= t.c1 && n.c + n.colspan - 1 <= t.c2 ? !1 : Va(n, t)
2280
2280
  );
2281
2281
  }
2282
- function Ua(e, t) {
2282
+ function Va(e, t) {
2283
2283
  return e.r <= t.r2 && e.r + e.rowspan - 1 >= t.r1 && e.c <= t.c2 && e.c + e.colspan - 1 >= t.c1 ? !(e.r >= t.r1 && e.c >= t.c1 && e.r + e.rowspan - 1 <= t.r2 && e.c + e.colspan - 1 <= t.c2) : !1;
2284
2284
  }
2285
- function Va(e) {
2285
+ function Ga(e) {
2286
2286
  const { grid: t, rect: n } = e, o = t.matrix[n.r1]?.[n.c1];
2287
2287
  if (!o) return !1;
2288
2288
  if (o.rowspan > 1 || o.colspan > 1) {
@@ -2296,7 +2296,7 @@ function Va(e) {
2296
2296
  }
2297
2297
  return me(t), Se(t), !0;
2298
2298
  }
2299
- if (n.r1 === n.r2 && n.c1 === n.c2 || Wr(t, n)) return !1;
2299
+ if (n.r1 === n.r2 && n.c1 === n.c2 || Yr(t, n)) return !1;
2300
2300
  const i = t.cells.filter((s) => s.r >= n.r1 && s.c >= n.c1 && s.r + s.rowspan - 1 <= n.r2 && s.c + s.colspan - 1 <= n.c2), l = o.el;
2301
2301
  return i.filter((s) => s !== o).forEach((s) => {
2302
2302
  const a = (s.el.textContent || "").trim();
@@ -2324,7 +2324,7 @@ function Ko(e, t) {
2324
2324
  r.c === e.colIndex ? r.c = o : r.c === o && (r.c = e.colIndex);
2325
2325
  }), Se(me(n)), ht(n), !0);
2326
2326
  }
2327
- const Xo = 4, Ga = 60;
2327
+ const Xo = 4, Ka = 60;
2328
2328
  function fn(e) {
2329
2329
  return Array.from(e.children).find((t) => t.tagName === "COLGROUP") || null;
2330
2330
  }
@@ -2344,7 +2344,7 @@ function ht(e) {
2344
2344
  return l.style.width = `${Math.round((i || 0) / o * 1e3) / 10}%`, l;
2345
2345
  }));
2346
2346
  }
2347
- function Ka(e, t, n) {
2347
+ function Xa(e, t, n) {
2348
2348
  const o = ue(e);
2349
2349
  if (t < 0 || t >= o.width - 1) return !1;
2350
2350
  const r = Math.round(e.getBoundingClientRect().width);
@@ -2352,52 +2352,52 @@ function Ka(e, t, n) {
2352
2352
  const i = To(o), l = i[t] + i[t + 1], s = i[t] + n / r * 100;
2353
2353
  return i[t] = Math.max(Xo, Math.min(s, l - Xo)), i[t + 1] = l - i[t], o._widths = i, ht(o), !0;
2354
2354
  }
2355
- function Xa(e, t) {
2355
+ function ja(e, t) {
2356
2356
  const n = e.getBoundingClientRect().width;
2357
2357
  if (!(n > 0)) return null;
2358
2358
  const o = parseFloat(getComputedStyle(e).width) || n, r = To(ue(e));
2359
2359
  return { colIndex: t, widths: r.map((i) => i / 100 * o), total: o, scale: o / n };
2360
2360
  }
2361
- function ja(e, t, n) {
2361
+ function Wa(e, t, n) {
2362
2362
  if (!t) return !1;
2363
2363
  const o = ue(e), { colIndex: r, widths: i, total: l, scale: s } = t;
2364
2364
  if (r !== o.width - 1 || i.length !== o.width) return !1;
2365
2365
  const a = i[r], c = a + n * s;
2366
- if (!Number.isFinite(c) || c < Math.min(Ga, a)) return !1;
2366
+ if (!Number.isFinite(c) || c < Math.min(Ka, a)) return !1;
2367
2367
  const f = l + (c - a);
2368
2368
  return o._widths = i.map((u, p) => (p === r ? c : u) / f * 100), e.style.width = `${Math.round(f * 100) / 100}px`, ht(o), !0;
2369
2369
  }
2370
- function Wa(e) {
2370
+ function Ya(e) {
2371
2371
  const { table: t, grid: n } = e, o = fn(t);
2372
2372
  return !o && !n.cells.some((r) => r.el.style.width) ? !1 : (o?.remove(), n.cells.forEach((r) => Mt(r.el, "width", "")), Mt(t, "width", "100%"), n._widths = null, !0);
2373
2373
  }
2374
- function Yr(e) {
2374
+ function Qr(e) {
2375
2375
  const { grid: t, rect: n } = e;
2376
2376
  return t.cells.filter((o) => o.r <= n.r2 && o.r + o.rowspan - 1 >= n.r1 && o.c <= n.c2 && o.c + o.colspan - 1 >= n.c1);
2377
2377
  }
2378
2378
  function Me(e, t, n) {
2379
- const o = Yr(e);
2379
+ const o = Qr(e);
2380
2380
  if (!o.length) return !1;
2381
2381
  let r = !1;
2382
2382
  for (const i of o)
2383
2383
  ke(i.el, t) !== (n || "") && (Mt(i.el, t, n || ""), r = !0);
2384
2384
  return r;
2385
2385
  }
2386
- function Ya(e) {
2386
+ function Qa(e) {
2387
2387
  let t = !1;
2388
- for (const n of Yr(e))
2389
- Xr(n.el) || (n.el.replaceChildren(document.createElement("br")), t = !0);
2388
+ for (const n of Qr(e))
2389
+ jr(n.el) || (n.el.replaceChildren(document.createElement("br")), t = !0);
2390
2390
  return t;
2391
2391
  }
2392
- function Qa(e) {
2392
+ function Za(e) {
2393
2393
  const { grid: t } = e;
2394
- return t.cells.length ? (Ha(t.cells), Se(me(t)), ht(t), !0) : !1;
2394
+ return t.cells.length ? (za(t.cells), Se(me(t)), ht(t), !0) : !1;
2395
2395
  }
2396
- function Za(e, t, n) {
2396
+ function Ja(e, t, n) {
2397
2397
  const { grid: o, rect: r } = e, i = r.r1 + t - o.height, l = r.c1 + n - o.width;
2398
2398
  return i > 0 && eo(e, o.height - 1, i), l > 0 && to(e, o.width - 1, l), i > 0 || l > 0;
2399
2399
  }
2400
- function Ja(e, { rows: t = 2, cols: n = 2, headerRow: o = !0 } = {}, r = null) {
2400
+ function ec(e, { rows: t = 2, cols: n = 2, headerRow: o = !0 } = {}, r = null) {
2401
2401
  const i = document.createElement("table");
2402
2402
  i.style.width = "100%";
2403
2403
  const l = document.createElement("tbody");
@@ -2412,19 +2412,19 @@ function Ja(e, { rows: t = 2, cols: n = 2, headerRow: o = !0 } = {}, r = null) {
2412
2412
  const a = l.querySelector("td,th");
2413
2413
  return a && P(a, 0), i;
2414
2414
  }
2415
- const ec = {
2415
+ const tc = {
2416
2416
  selectAll: (e) => (e.rect = { r1: 0, c1: 0, r2: e.grid.height - 1, c2: e.grid.width - 1 }, !0),
2417
2417
  insertRowBefore: (e, t) => eo(e, e.rect.r1 - 1, Yt(t.rows)),
2418
2418
  insertRowAfter: (e, t) => eo(e, e.rect.r2, Yt(t.rows)),
2419
2419
  insertColumnBefore: (e, t) => to(e, e.rect.c1 - 1, Yt(t.cols)),
2420
2420
  insertColumnAfter: (e, t) => to(e, e.rect.c2, Yt(t.cols)),
2421
- deleteRow: (e) => Fa(e, e.rect.r1, e.rect.r2),
2422
- deleteColumn: (e) => qa(e, e.rect.c1, e.rect.c2),
2423
- mergeOrSplit: (e) => Va(e),
2421
+ deleteRow: (e) => qa(e, e.rect.r1, e.rect.r2),
2422
+ deleteColumn: (e) => Ua(e, e.rect.c1, e.rect.c2),
2423
+ mergeOrSplit: (e) => Ga(e),
2424
2424
  toggleHeaderRow: (e) => Vo(e, "row"),
2425
2425
  toggleHeaderColumn: (e) => Vo(e, "column"),
2426
2426
  pinHeader: (e) => (e.table.hasAttribute(en) ? e.table.removeAttribute(en) : e.table.setAttribute(en, "true"), !0),
2427
- resetColumnWidth: (e) => Wa(e),
2427
+ resetColumnWidth: (e) => Ya(e),
2428
2428
  cellShade: (e, t) => Me(e, "background-color", t.value || ""),
2429
2429
  alignLeft: (e) => Me(e, "text-align", "left"),
2430
2430
  alignCenter: (e) => Me(e, "text-align", "center"),
@@ -2434,19 +2434,19 @@ const ec = {
2434
2434
  valignMiddle: (e) => Me(e, "vertical-align", "middle"),
2435
2435
  valignBottom: (e) => Me(e, "vertical-align", "bottom"),
2436
2436
  valignDefault: (e) => Me(e, "vertical-align", ""),
2437
- clearCell: (e) => Ya(e),
2438
- transpose: (e) => Qa(e),
2437
+ clearCell: (e) => Qa(e),
2438
+ transpose: (e) => Za(e),
2439
2439
  moveRowUp: (e) => Go(e, -1),
2440
2440
  moveRowDown: (e) => Go(e, 1),
2441
2441
  moveColumnLeft: (e) => Ko(e, -1),
2442
2442
  moveColumnRight: (e) => Ko(e, 1),
2443
2443
  deleteTable: (e) => (e.table.remove(), !0)
2444
- }, tc = {
2444
+ }, nc = {
2445
2445
  deleteRow: (e) => e.grid.height > e.rect.r2 - e.rect.r1 + 1,
2446
2446
  deleteColumn: (e) => e.grid.width > e.rect.c2 - e.rect.c1 + 1,
2447
2447
  mergeOrSplit: (e) => {
2448
2448
  const t = e.grid.matrix[e.rect.r1]?.[e.rect.c1];
2449
- return t ? t.rowspan > 1 || t.colspan > 1 ? !0 : !(e.rect.r1 === e.rect.r2 && e.rect.c1 === e.rect.c2) && !Wr(e.grid, e.rect) : !1;
2449
+ return t ? t.rowspan > 1 || t.colspan > 1 ? !0 : !(e.rect.r1 === e.rect.r2 && e.rect.c1 === e.rect.c2) && !Yr(e.grid, e.rect) : !1;
2450
2450
  },
2451
2451
  resetColumnWidth: (e) => !!e.table.querySelector("colgroup") || e.grid.cells.some((t) => t.el.style.width),
2452
2452
  pinHeader: (e) => e.grid.height > 1,
@@ -2456,9 +2456,9 @@ const ec = {
2456
2456
  moveColumnRight: (e) => e.colIndex < e.grid.width - 1 && !oo(e.grid),
2457
2457
  toggleHeaderColumn: (e) => e.grid.width > 1
2458
2458
  };
2459
- function nc(e, t) {
2459
+ function oc(e, t) {
2460
2460
  if (!e) return !1;
2461
- const n = tc[t];
2461
+ const n = nc[t];
2462
2462
  if (!n) return !0;
2463
2463
  try {
2464
2464
  return !!n(e);
@@ -2466,7 +2466,7 @@ function nc(e, t) {
2466
2466
  return !1;
2467
2467
  }
2468
2468
  }
2469
- function oc(e, t) {
2469
+ function rc(e, t) {
2470
2470
  if (!e) return !1;
2471
2471
  const n = e.grid.cells.filter((l) => l.r === 0), o = e.grid.cells.filter((l) => l.c === 0);
2472
2472
  if (t === "toggleHeaderRow") return n.length > 0 && n.every((l) => l.el.tagName === "TH");
@@ -2480,8 +2480,8 @@ function oc(e, t) {
2480
2480
  const i = e.cell ? ke(e.cell, "vertical-align") : "";
2481
2481
  return t === "valignTop" ? i === "top" : t === "valignMiddle" ? i === "middle" : t === "valignBottom" ? i === "bottom" : t === "valignDefault" ? !i : !1;
2482
2482
  }
2483
- function Qr(e, t, n = { rows: 1, cols: 1 }) {
2484
- const o = ec[t];
2483
+ function Zr(e, t, n = { rows: 1, cols: 1 }) {
2484
+ const o = tc[t];
2485
2485
  if (!e || !o) return !1;
2486
2486
  try {
2487
2487
  return !!o(e, n);
@@ -2489,7 +2489,7 @@ function Qr(e, t, n = { rows: 1, cols: 1 }) {
2489
2489
  return !1;
2490
2490
  }
2491
2491
  }
2492
- function rc(e, t) {
2492
+ function ic(e, t) {
2493
2493
  if (!e?.isConnected || !t) return null;
2494
2494
  const n = ue(e);
2495
2495
  let o = 1 / 0, r = 1 / 0, i = -1 / 0, l = -1 / 0;
@@ -2500,8 +2500,8 @@ function rc(e, t) {
2500
2500
  }
2501
2501
  return o === 1 / 0 ? null : { left: o, top: r, right: i, bottom: l, width: i - o, height: l - r };
2502
2502
  }
2503
- function ic(e, t, n) {
2504
- return Ia(e.cells, st(e, t), st(e, n));
2503
+ function lc(e, t, n) {
2504
+ return Ha(e.cells, st(e, t), st(e, n));
2505
2505
  }
2506
2506
  const jo = {
2507
2507
  // [坑] 撤销/重做自带历史栈,不能再被 exec 的 run() 包一层入栈(否则 undo 会弹到自己刚推进去的那条)
@@ -2529,13 +2529,13 @@ const jo = {
2529
2529
  unsetTextShadow: { run: (e) => ce(G(e), "textShadow", "") },
2530
2530
  // 组合色(前景 + 背景一体):一次落两个标记(拆两次会因块 DOM 重建丢选区,见 setStyleMarks 的 [坑])
2531
2531
  setComboStyle: {
2532
- run: (e, t, n) => Es(G(e), { color: St(t), backgroundColor: St(n) })
2532
+ run: (e, t, n) => As(G(e), { color: St(t), backgroundColor: St(n) })
2533
2533
  },
2534
2534
  setLink: { run: (e, t) => Ho(G(e), t) },
2535
2535
  unsetLink: { run: (e) => Ho(G(e), "") },
2536
2536
  clearFormat: {
2537
2537
  run: (e) => {
2538
- const t = G(e), n = Bs(t), o = aa(e.root, t.ranges);
2538
+ const t = G(e), n = Is(t), o = ca(e.root, t.ranges);
2539
2539
  return n || o;
2540
2540
  }
2541
2541
  },
@@ -2546,63 +2546,63 @@ const jo = {
2546
2546
  toggleBulletList: { run: (e) => Ne(e.root, "bulletList") },
2547
2547
  toggleOrderedList: { run: (e) => Ne(e.root, "orderedList") },
2548
2548
  toggleTaskList: { run: (e) => Ne(e.root, "taskList") },
2549
- setHorizontalRule: { run: (e) => Pr(e.root) },
2550
- insertPageBreak: { run: (e) => zs(e.root) },
2551
- insertCallout: { run: (e, t) => Ds(e.root, t) },
2552
- insertSuperBlock: { run: (e, t) => $s(e.root, t) },
2549
+ setHorizontalRule: { run: (e) => Fr(e.root) },
2550
+ insertPageBreak: { run: (e) => Ds(e.root) },
2551
+ insertCallout: { run: (e, t) => $s(e.root, t) },
2552
+ insertSuperBlock: { run: (e, t) => _s(e.root, t) },
2553
2553
  // 超级块列增删(el 可为超级块或其内的列;block 档块菜单消费)
2554
- addColumn: { run: (e, t) => _s(e.root, t) },
2555
- removeColumn: { run: (e, t) => Ps(e.root, t) },
2554
+ addColumn: { run: (e, t) => Ps(e.root, t) },
2555
+ removeColumn: { run: (e, t) => Fs(e.root, t) },
2556
2556
  // 拖块并排:把拖拽块与目标块合成 2 列超级块(块标拖拽到目标左/右边缘放下)
2557
- wrapInSuper: { run: (e, t, n, o) => Fs(e.root, t, n, o) },
2558
- insertImage: { run: (e, t) => Us(e.root, t) },
2557
+ wrapInSuper: { run: (e, t, n, o) => qs(e.root, t, n, o) },
2558
+ insertImage: { run: (e, t) => Vs(e.root, t) },
2559
2559
  // 笔记资产图片(<img data-gbBlk-asset> + 直链 src;与 .gbRtx 的 insertImage 各归各)
2560
- insertAssetImage: { run: (e, t) => Vs(e.root, t) },
2561
- insertText: { run: (e, t) => qs(e.root, t) },
2560
+ insertAssetImage: { run: (e, t) => Gs(e.root, t) },
2561
+ insertText: { run: (e, t) => Us(e.root, t) },
2562
2562
  // 受控 HTML 片段插入(宿主生成的复杂块,如 docx 目录块)
2563
2563
  // [约束] 只允许应用代码生成的受控 HTML:不走粘贴清洗(它面向外来内容,会剥 class 等编解码标记)
2564
2564
  insertHtml: {
2565
2565
  run: (e, t) => {
2566
- const n = wr(String(t || ""));
2566
+ const n = xr(String(t || ""));
2567
2567
  return n.childNodes.length ? (Eo(e, n), !0) : !1;
2568
2568
  }
2569
2569
  },
2570
2570
  // 批注锚点(span.doc-comment):选区打键 / 按宿主数据删除某键的全部锚点
2571
- setComment: { run: (e, t) => As(G(e), t) },
2572
- removeComment: { run: (e, t) => Ts(e.root, t) > 0 },
2571
+ setComment: { run: (e, t) => Ts(G(e), t) },
2572
+ removeComment: { run: (e, t) => Ss(e.root, t) > 0 },
2573
2573
  // 脚注/尾注锚点(sup.doc-footnote/endnote[data-fn];Word 应用消费)
2574
- insertNote: { run: (e, t) => Ss(e.root, t) },
2575
- removeNote: { run: (e, t) => ws(e.root, t) },
2574
+ insertNote: { run: (e, t) => ws(e.root, t) },
2575
+ removeNote: { run: (e, t) => xs(e.root, t) },
2576
2576
  // 笔记行内锚(span.doc-attach 附件引用 / span.doc-ref 块·文档引用;笔记域专用,.gbRtx 侧不产生)
2577
2577
  insertAttach: { run: (e, t) => zo(e.root, "attach", t) },
2578
- removeAttach: { run: (e, t) => xs(e.root, lt, t) },
2578
+ removeAttach: { run: (e, t) => Ls(e.root, lt, t) },
2579
2579
  insertRef: { run: (e, t) => zo(e.root, "ref", t) },
2580
2580
  // 笔记引用节点转换(宿主右键菜单入口):行内引用 ↔ 嵌入块 / 锚文本类型 / 删除
2581
- convertRefToEmbed: { run: (e, t, n) => Ms(e.root, t, n) },
2582
- convertEmbedToRef: { run: (e, t) => Ns(t) },
2583
- setRefSub: { run: (e, t, n) => Rs(t, n) },
2584
- removeAnchor: { run: (e, t) => Os(t) },
2581
+ convertRefToEmbed: { run: (e, t, n) => Ns(e.root, t, n) },
2582
+ convertEmbedToRef: { run: (e, t) => Rs(t) },
2583
+ setRefSub: { run: (e, t, n) => Os(t, n) },
2584
+ removeAnchor: { run: (e, t) => Bs(t) },
2585
2585
  // 修订接受/拒绝(Word 应用;普通富文本不暴露入口)
2586
- resolveRevisions: { run: (e, t) => as(e.root, t) > 0 },
2587
- resolveRevisionAt: { run: (e, t, n) => cs(t, n) },
2586
+ resolveRevisions: { run: (e, t) => cs(e.root, t) > 0 },
2587
+ resolveRevisionAt: { run: (e, t, n) => us(t, n) },
2588
2588
  increaseBlockIndent: { run: (e) => Po(e.root, 1), can: (e) => e.state().canIndent },
2589
2589
  decreaseBlockIndent: { run: (e) => Po(e.root, -1), can: (e) => e.state().canOutdent },
2590
- toggleFirstLineIndent: { run: (e) => sa(e.root) },
2591
- setBlockLineHeight: { run: (e, t) => ia(e.root, t) },
2592
- setBlockAlign: { run: (e, t) => la(e.root, t) },
2593
- duplicateBlock: { run: (e, t) => Ys(e.root, t) },
2594
- deleteBlock: { run: (e, t) => Qs(e.root, t) },
2595
- insertBlockNear: { run: (e, t, n) => Ks(e.root, n, t) },
2590
+ toggleFirstLineIndent: { run: (e) => aa(e.root) },
2591
+ setBlockLineHeight: { run: (e, t) => la(e.root, t) },
2592
+ setBlockAlign: { run: (e, t) => sa(e.root, t) },
2593
+ duplicateBlock: { run: (e, t) => Qs(e.root, t) },
2594
+ deleteBlock: { run: (e, t) => Zs(e.root, t) },
2595
+ insertBlockNear: { run: (e, t, n) => Xs(e.root, n, t) },
2596
2596
  moveBlockUp: { run: (e, t) => $o(e.root, t, -1) },
2597
2597
  moveBlockDown: { run: (e, t) => $o(e.root, t, 1) },
2598
- moveBlockTo: { run: (e, t, n, o) => Zs(t, n, o) },
2598
+ moveBlockTo: { run: (e, t, n, o) => Js(t, n, o) },
2599
2599
  deleteRange: {
2600
- run: (e, { block: t, from: n, to: o }) => t?.isConnected ? (yr(t, n, o).deleteContents(), gn(e.root, { block: t, offset: n }, { block: t, offset: n }), !0) : !1
2600
+ run: (e, { block: t, from: n, to: o }) => t?.isConnected ? (kr(t, n, o).deleteContents(), gn(e.root, { block: t, offset: n }, { block: t, offset: n }), !0) : !1
2601
2601
  },
2602
2602
  insertTable: {
2603
2603
  run: (e, { rows: t = 2, cols: n = 2, withHeaderRow: o = !0 } = {}) => {
2604
- const i = e.selectionRanges()[0]?.block, l = i ? Ke(i, e.root) : e.root.lastElementChild;
2605
- return !!Ja(e.root, { rows: t, cols: n, headerRow: o }, l);
2604
+ const i = e.selectionRanges()[0]?.block, l = i ? Xe(i, e.root) : e.root.lastElementChild;
2605
+ return !!ec(e.root, { rows: t, cols: n, headerRow: o }, l);
2606
2606
  }
2607
2607
  },
2608
2608
  tableAction: { run: (e, t, n) => e.runTableAction(t, n) },
@@ -2611,8 +2611,8 @@ const jo = {
2611
2611
  // [坑] 显式给了 el 就必须写它:元素已失效(不在编辑面内)时返回 false,禁退回「光标所在块」——
2612
2612
  // 否则「给这个块加属性」会静默写到另一个块上,用户看到的是属性跑到了别处
2613
2613
  setBlockAttrs: { run: (e, t, n = null) => {
2614
- const o = n ? Oe(e.root, n) : Kr(e.root);
2615
- return o ? ka(o, t) : !1;
2614
+ const o = n ? Oe(e.root, n) : Xr(e.root);
2615
+ return o ? Ca(o, t) : !1;
2616
2616
  } },
2617
2617
  focusBlock: {
2618
2618
  run: (e, t) => {
@@ -2625,9 +2625,9 @@ function G(e) {
2625
2625
  const t = e.selectionRanges(), n = Yn(e.root, t).marks, o = t.length > 0 && t.every((r) => r.end <= r.start);
2626
2626
  return { root: e.root, ranges: t, marks: n, pending: o ? e.pending ||= { ...n } : null };
2627
2627
  }
2628
- const lc = {
2628
+ const sc = {
2629
2629
  getHTML() {
2630
- return Rl(this.root);
2630
+ return Ol(this.root);
2631
2631
  },
2632
2632
  /** 程序化装载(切档 / 外部写入):重置历史与选区 */
2633
2633
  setHTML(e) {
@@ -2657,7 +2657,7 @@ const lc = {
2657
2657
  return !e || !this.root.contains(e) ? null : X(e, this.root) || this.textBlockAt(e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement);
2658
2658
  },
2659
2659
  pathBlock(e) {
2660
- return this.textBlockAt(ul(this.root, e));
2660
+ return this.textBlockAt(dl(this.root, e));
2661
2661
  },
2662
2662
  offsetIn(e, t, n, o) {
2663
2663
  return t && this.root.contains(t) && (e === t || e.contains(t)) ? ae(e, t, n) : o ?? 0;
@@ -2699,16 +2699,16 @@ const lc = {
2699
2699
  };
2700
2700
  function Wo(e, t, n) {
2701
2701
  const o = X(t, e);
2702
- return o ? { path: cl(o, e), offset: ae(o, t, n) } : null;
2702
+ return o ? { path: ul(o, e), offset: ae(o, t, n) } : null;
2703
2703
  }
2704
- const sc = 120, ac = 600, cc = {
2704
+ const ac = 120, cc = 600, uc = {
2705
2705
  snapshot() {
2706
2706
  return { html: this.root.innerHTML, sel: this.captureSelection() };
2707
2707
  },
2708
2708
  pushHistory() {
2709
2709
  if (!this.baseline) return;
2710
2710
  const e = this.undoStack[this.undoStack.length - 1];
2711
- e && e.html === this.baseline.html || (this.undoStack.push(this.baseline), this.undoStack.length > sc && this.undoStack.shift(), this.redoStack = []);
2711
+ e && e.html === this.baseline.html || (this.undoStack.push(this.baseline), this.undoStack.length > ac && this.undoStack.shift(), this.redoStack = []);
2712
2712
  },
2713
2713
  /**
2714
2714
  * 执行一次 DOM 改写:入历史 + 上报变更
@@ -2761,7 +2761,7 @@ const sc = 120, ac = 600, cc = {
2761
2761
  onDomMutated() {
2762
2762
  this.applying || this.destroyed || (this.typing || (this.pushHistory(), this.typing = !0), clearTimeout(this.idleTimer), this.idleTimer = setTimeout(() => {
2763
2763
  this.typing = !1, this.baseline = this.snapshot(), this.afterChange();
2764
- }, ac), this.emit("update"), this.syncState());
2764
+ }, cc), this.emit("update"), this.syncState());
2765
2765
  },
2766
2766
  undo() {
2767
2767
  return this.undoStack.length ? (this.typing && (this.typing = !1, clearTimeout(this.idleTimer)), this.redoStack.push(this.snapshot()), this.restore(this.undoStack.pop()), !0) : !1;
@@ -2779,7 +2779,7 @@ const sc = 120, ac = 600, cc = {
2779
2779
  afterChange() {
2780
2780
  this.search.refresh(), this.emit("update"), this.emit("transaction"), this.syncState();
2781
2781
  }
2782
- }, uc = ["onFocus", "onBlur", "onSelectionChange", "onPointerState", "onClick", "onCheckboxChange"], dc = {
2782
+ }, dc = ["onFocus", "onBlur", "onSelectionChange", "onPointerState", "onClick", "onCheckboxChange"], fc = {
2783
2783
  onFocus() {
2784
2784
  this.emit("focus");
2785
2785
  },
@@ -2842,7 +2842,7 @@ const sc = 120, ac = 600, cc = {
2842
2842
  e.preventDefault();
2843
2843
  return;
2844
2844
  }
2845
- const n = fc(this.root, t);
2845
+ const n = hc(this.root, t);
2846
2846
  n && this.isEditable() ? this.selectAtom(n) : this.clearAtom();
2847
2847
  },
2848
2848
  /** 待办条目复选框:change 同步 data-checked(序列化口径) */
@@ -2862,12 +2862,12 @@ const sc = 120, ac = 600, cc = {
2862
2862
  this.selectedAtom && this.selectedAtom.classList.remove(Fn), this.selectedAtom = null, this.emit("atom", null);
2863
2863
  }
2864
2864
  };
2865
- function fc(e, t) {
2865
+ function hc(e, t) {
2866
2866
  if (!t) return null;
2867
2867
  const n = t.nodeType === Node.TEXT_NODE ? t.parentElement : t;
2868
- return Xe(n, (o) => o.tagName === "IMG" || o.tagName === "HR", e);
2868
+ return je(n, (o) => o.tagName === "IMG" || o.tagName === "HR", e);
2869
2869
  }
2870
- const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], mc = {
2870
+ const Yo = 6, Qo = dr, mc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], pc = {
2871
2871
  /**
2872
2872
  * 拖列边设列宽:落点在「格右边界 ± COL_RESIZE_HIT/2」的命中带内即接管
2873
2873
  * 中间列的右边界 = 与右邻列的共享线(两列守恒转移,表宽不变);最后一列的右边界 = 表右边界
@@ -2885,13 +2885,13 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
2885
2885
  this.root.classList.add("resize-cursor"), this.colResizing = !0, this.hoverColumn = { table: n, colIndex: i.c }, this.emit("column-hover"), this.pushHistory();
2886
2886
  const s = e.clientX;
2887
2887
  let a = 0;
2888
- const c = l ? Xa(n, i.c) : null, f = (y) => {
2888
+ const c = l ? ja(n, i.c) : null, f = (y) => {
2889
2889
  Xt();
2890
2890
  const E = y.clientX - s;
2891
2891
  if (E === a) return;
2892
2892
  const m = E - a;
2893
2893
  a = E, this.run(
2894
- () => c ? ja(n, c, E) : Ka(n, i.c, m),
2894
+ () => c ? Wa(n, c, E) : Xa(n, i.c, m),
2895
2895
  { coalesce: !0 }
2896
2896
  ), this.emit("column-hover");
2897
2897
  }, u = () => {
@@ -2932,7 +2932,7 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
2932
2932
  colIndex: -1,
2933
2933
  rect: g ? { r1: m - 1, c1: 0, r2: m - 1, c2: E.width - 1 } : { r1: m + h, c1: 0, r2: m - 1, c2: E.width - 1 }
2934
2934
  }, M = g ? o ? "insertColumnAfter" : "insertRowAfter" : o ? "deleteColumn" : "deleteRow";
2935
- this.run(() => Qr(A, M, { rows: Math.abs(h), cols: Math.abs(h) }), { coalesce: !0 });
2935
+ this.run(() => Zr(A, M, { rows: Math.abs(h), cols: Math.abs(h) }), { coalesce: !0 });
2936
2936
  };
2937
2937
  c(i + 1);
2938
2938
  const f = (y) => {
@@ -2981,7 +2981,7 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
2981
2981
  */
2982
2982
  cellSelectionBox() {
2983
2983
  const e = this.cellRect;
2984
- return e?.table?.isConnected ? rc(e.table, e.rect) : null;
2984
+ return e?.table?.isConnected ? ic(e.table, e.rect) : null;
2985
2985
  },
2986
2986
  /**
2987
2987
  * 取「表 → 逻辑网格」的短期缓存
@@ -3052,7 +3052,7 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
3052
3052
  l = 0;
3053
3053
  const y = i;
3054
3054
  if (i = null, !y || !y.isConnected) return;
3055
- const E = ue(n), m = ic(E, o, y);
3055
+ const E = ue(n), m = lc(E, o, y);
3056
3056
  if (!m) return;
3057
3057
  const h = this.cellRect?.rect;
3058
3058
  this.cellRect?.table === n && h && h.r1 === m.r1 && h.c1 === m.c1 && h.r2 === m.r2 && h.c2 === m.c2 || (this.cellRect = { table: n, rect: m }, this.notifyCellSelection());
@@ -3073,14 +3073,14 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
3073
3073
  clearCellSelection() {
3074
3074
  this.cellRect && (this.cellRect = null, this.notifyCellSelection());
3075
3075
  }
3076
- }, pc = {
3076
+ }, gc = {
3077
3077
  inlineSnapshot() {
3078
3078
  const e = this.selectionRanges();
3079
3079
  return Yn(this.root, e).marks;
3080
3080
  },
3081
3081
  /** 工具栏 / 气泡菜单 / 块菜单共用的状态快照(单一口径) */
3082
3082
  state() {
3083
- const e = this.root, t = this.selectionRanges(), n = t.length && this.pending || Yn(e, t).marks, r = dt(e, t)[0] || null, i = r ? oa(r) : { lineHeight: "", textAlign: null, indentLevel: 0, firstLineIndent: !1 }, l = t[0]?.block || null, s = l ? Ke(l, e) : null, a = Ft(s), c = l ? Vr(l, e) : "", f = !!$e(l || e, e), u = Number(/^heading([1-6])$/.exec(a)?.[1]) || 0, p = e.textContent.replace(/[\n]/g, "");
3083
+ const e = this.root, t = this.selectionRanges(), n = t.length && this.pending || Yn(e, t).marks, r = dt(e, t)[0] || null, i = r ? ra(r) : { lineHeight: "", textAlign: null, indentLevel: 0, firstLineIndent: !1 }, l = t[0]?.block || null, s = l ? Xe(l, e) : null, a = Ft(s), c = l ? Gr(l, e) : "", f = !!$e(l || e, e), u = Number(/^heading([1-6])$/.exec(a)?.[1]) || 0, p = e.textContent.replace(/[\n]/g, "");
3084
3084
  return {
3085
3085
  ready: !0,
3086
3086
  canUndo: this.undoStack.length > 0,
@@ -3156,22 +3156,22 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
3156
3156
  },
3157
3157
  /** 块自定义属性(el 缺省=光标所在最外层结构块,与 setBlockAttrs 命令同口径;元素已不在编辑面内返回 null) */
3158
3158
  blockAttrsOf(e = null) {
3159
- const t = e && Oe(this.root, e) || Kr(this.root);
3160
- return t ? ya(t) : null;
3159
+ const t = e && Oe(this.root, e) || Xr(this.root);
3160
+ return t ? ka(t) : null;
3161
3161
  }
3162
- }, gc = {
3162
+ }, vc = {
3163
3163
  blockAt(e, t) {
3164
- return sl(this.root, e, t);
3164
+ return al(this.root, e, t);
3165
3165
  },
3166
3166
  /** 点到留白:把光标落到该坐标最近的可编辑位置 */
3167
3167
  focusAt(e, t) {
3168
- const n = vr(this.root, e, t);
3168
+ const n = br(this.root, e, t);
3169
3169
  if (this.root.focus({ preventScroll: !0 }), n) {
3170
3170
  const i = X(n.node, this.root);
3171
3171
  if (i)
3172
3172
  return gn(this.root, { block: i, offset: ae(i, n.node, n.offset) }, { block: i, offset: ae(i, n.node, n.offset) }), !0;
3173
3173
  }
3174
- const o = br(this.root, t), r = o ? he(o, this.root) || o : _t(this.root);
3174
+ const o = yr(this.root, t), r = o ? he(o, this.root) || o : _t(this.root);
3175
3175
  return P(r, 0), !0;
3176
3176
  },
3177
3177
  /** 当前选区(或光标)的可视矩形:斜杠菜单/气泡菜单定位基准 */
@@ -3182,23 +3182,23 @@ const Yo = 6, Qo = ur, hc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], m
3182
3182
  if (o && (o.height || o.width)) return o;
3183
3183
  }
3184
3184
  const t = this.selectionRanges()[0]?.block;
3185
- return al(t);
3185
+ return cl(t);
3186
3186
  }
3187
3187
  };
3188
- async function vc(e, t = "已复制", n = ge) {
3188
+ async function bc(e, t = "已复制", n = ge) {
3189
3189
  if (!e)
3190
3190
  return n.error("没有可复制的内容"), !1;
3191
3191
  try {
3192
- return await Zr(e), n.success(t), !0;
3192
+ return await Jr(e), n.success(t), !0;
3193
3193
  } catch (o) {
3194
3194
  return n.error(`复制失败:${o?.message || o}`), !1;
3195
3195
  }
3196
3196
  }
3197
- async function bc() {
3197
+ async function yc() {
3198
3198
  if (!navigator.clipboard?.readText) throw new Error("当前访问方式不支持读取剪贴板,请手动粘贴");
3199
3199
  return navigator.clipboard.readText();
3200
3200
  }
3201
- async function yc(e, t, n = "已复制", o = ge) {
3201
+ async function kc(e, t, n = "已复制", o = ge) {
3202
3202
  if (!e && !t)
3203
3203
  return o.error("没有可复制的内容"), !1;
3204
3204
  try {
@@ -3210,13 +3210,13 @@ async function yc(e, t, n = "已复制", o = ge) {
3210
3210
  ]), o.success(n), !0;
3211
3211
  } catch {
3212
3212
  try {
3213
- return await Zr(e || ""), o.success(n), !0;
3213
+ return await Jr(e || ""), o.success(n), !0;
3214
3214
  } catch (r) {
3215
3215
  return o.error(`复制失败:${r?.message || r}`), !1;
3216
3216
  }
3217
3217
  }
3218
3218
  }
3219
- async function kc() {
3219
+ async function Cc() {
3220
3220
  if (!navigator.clipboard?.read) throw new Error("当前访问方式不支持读取剪贴板,请手动粘贴");
3221
3221
  const e = await navigator.clipboard.read();
3222
3222
  let t = "", n = "";
@@ -3225,14 +3225,14 @@ async function kc() {
3225
3225
  if (!t && !n) throw new Error("剪贴板没有可粘贴的内容");
3226
3226
  return { text: t, html: n };
3227
3227
  }
3228
- async function Zr(e) {
3228
+ async function Jr(e) {
3229
3229
  if (navigator.clipboard?.writeText) return navigator.clipboard.writeText(e);
3230
3230
  const t = document.createElement("textarea");
3231
3231
  t.value = e, t.readOnly = !0, t.style.cssText = "position:fixed;top:0;left:0;opacity:0", document.body.appendChild(t), t.select();
3232
3232
  const n = document.execCommand("copy");
3233
3233
  if (t.remove(), !n) throw new Error("当前浏览器不支持自动复制,请手动选取复制");
3234
3234
  }
3235
- function Cc(e) {
3235
+ function Ec(e) {
3236
3236
  let t = "";
3237
3237
  const n = (o) => {
3238
3238
  for (const r of Array.from(o.childNodes))
@@ -3241,17 +3241,17 @@ function Cc(e) {
3241
3241
  };
3242
3242
  return n(e), t;
3243
3243
  }
3244
- function Ec(e) {
3244
+ function Ac(e) {
3245
3245
  const t = document.createElement("span");
3246
3246
  return t.textContent = e, t.innerHTML;
3247
3247
  }
3248
- function Ac(e) {
3248
+ function Tc(e) {
3249
3249
  const { grid: t, rect: n } = e, o = n.r2 - n.r1 + 1, r = n.c2 - n.c1 + 1, i = Array.from({ length: o }, () => new Array(r).fill(null));
3250
3250
  for (const a of t.cells) {
3251
3251
  const c = Math.max(a.r, n.r1), f = Math.min(a.r + a.rowspan - 1, n.r2), u = Math.max(a.c, n.c1), p = Math.min(a.c + a.colspan - 1, n.c2);
3252
3252
  c > f || u > p || (i[c - n.r1][u - n.c1] = { el: a.el, rowspan: f - c + 1, colspan: p - u + 1 });
3253
3253
  }
3254
- const l = i.map((a) => a.map((c) => c ? Cc(c.el) : "").join(" ")).join(`
3254
+ const l = i.map((a) => a.map((c) => c ? Ec(c.el) : "").join(" ")).join(`
3255
3255
  `), s = document.createElement("table");
3256
3256
  for (let a = 0; a < o; a += 1) {
3257
3257
  const c = document.createElement("tr");
@@ -3265,7 +3265,7 @@ function Ac(e) {
3265
3265
  }
3266
3266
  return { text: l, html: s.outerHTML };
3267
3267
  }
3268
- function Tc(e) {
3268
+ function Sc(e) {
3269
3269
  const t = [], n = (o) => (t[o] || (t[o] = []), t[o]);
3270
3270
  return Array.from(e.querySelectorAll("tr")).forEach((o, r) => {
3271
3271
  const i = n(r);
@@ -3280,24 +3280,24 @@ function Tc(e) {
3280
3280
  });
3281
3281
  }), t.map((o) => (o || []).map((r) => r ?? ""));
3282
3282
  }
3283
- function Sc(e = {}) {
3283
+ function wc(e = {}) {
3284
3284
  const t = String(e.html || ""), n = String(e.text || "");
3285
3285
  if (t) {
3286
3286
  const o = document.createElement("div");
3287
3287
  o.innerHTML = t;
3288
3288
  const r = o.querySelector("table");
3289
- if (r) return Tc(r);
3289
+ if (r) return Sc(r);
3290
3290
  }
3291
3291
  return n ? n.replace(/\r\n?/g, `
3292
3292
  `).replace(/\n$/, "").split(`
3293
- `).map((o) => (o.includes(" ") ? o.split(" ") : [o]).map(Ec)) : null;
3293
+ `).map((o) => (o.includes(" ") ? o.split(" ") : [o]).map(Ac)) : null;
3294
3294
  }
3295
- function wc(e, t) {
3295
+ function xc(e, t) {
3296
3296
  if (!e || !t?.length) return !1;
3297
3297
  const n = t.reduce((s, a) => Math.max(s, a.length), 0);
3298
3298
  if (!n) return !1;
3299
3299
  const { table: o, rect: r } = e;
3300
- Za(e, t.length, n);
3300
+ Ja(e, t.length, n);
3301
3301
  const i = ue(o);
3302
3302
  let l = !1;
3303
3303
  for (let s = 0; s < t.length; s += 1)
@@ -3309,9 +3309,9 @@ function wc(e, t) {
3309
3309
  }
3310
3310
  return l;
3311
3311
  }
3312
- const xc = {
3312
+ const Lc = {
3313
3313
  cellAt(e, t) {
3314
- const n = $a(this.root, e, t);
3314
+ const n = _a(this.root, e, t);
3315
3315
  return this.contextCell = n, n;
3316
3316
  },
3317
3317
  /** 右键落在表格里 */
@@ -3321,13 +3321,13 @@ const xc = {
3321
3321
  /** 表格动作上下文:框选区域优先,其次右键命中的单元格,最后光标 */
3322
3322
  tableContext() {
3323
3323
  const e = this.cellRect?.rect || null;
3324
- return _a(this.root, this.contextCell, e);
3324
+ return Pa(this.root, this.contextCell, e);
3325
3325
  },
3326
3326
  canTableAction(e) {
3327
- return nc(this.tableContext(), e);
3327
+ return oc(this.tableContext(), e);
3328
3328
  },
3329
3329
  isTableActionActive(e) {
3330
- return oc(this.tableContext(), e);
3330
+ return rc(this.tableContext(), e);
3331
3331
  },
3332
3332
  /**
3333
3333
  * 表格动作:DOM 改动即命令本体,历史与上报由 exec 统一负责
@@ -3337,7 +3337,7 @@ const xc = {
3337
3337
  runTableAction(e, t) {
3338
3338
  const n = this.tableContext();
3339
3339
  if (!n) return !1;
3340
- const o = Qr(n, e, t);
3340
+ const o = Zr(n, e, t);
3341
3341
  return o && this.repaintCellSelection(), o;
3342
3342
  },
3343
3343
  /**
@@ -3378,7 +3378,7 @@ const xc = {
3378
3378
  /** 命中格 / 框选区的复制数据(TSV 文本 + `<table>` HTML);不在表格内返回 null */
3379
3379
  tableClipData() {
3380
3380
  const e = this.tableContext();
3381
- return e ? Ac(e) : null;
3381
+ return e ? Tc(e) : null;
3382
3382
  },
3383
3383
  /**
3384
3384
  * 复制(kind:copy=格内文字选区优先、否则整片区域 / copyRich=区域富文本 / copyText=区域纯文本)
@@ -3396,7 +3396,7 @@ const xc = {
3396
3396
  }
3397
3397
  }
3398
3398
  const t = this.tableClipData();
3399
- return t ? e === "copyText" ? vc(t.text) : yc(t.text, t.html) : !1;
3399
+ return t ? e === "copyText" ? bc(t.text) : kc(t.text, t.html) : !1;
3400
3400
  },
3401
3401
  /** 剪切 = 复制 + 清空选区(清空走 exec 提交一次可撤销历史) */
3402
3402
  async cutTable() {
@@ -3412,7 +3412,7 @@ const xc = {
3412
3412
  if (!this.tableContext()) return !1;
3413
3413
  let t;
3414
3414
  try {
3415
- t = e === "pasteText" ? { text: await bc() } : await kc();
3415
+ t = e === "pasteText" ? { text: await yc() } : await Cc();
3416
3416
  } catch (n) {
3417
3417
  return ge.error(n?.message || "无法读取剪贴板"), !1;
3418
3418
  }
@@ -3422,9 +3422,9 @@ const xc = {
3422
3422
  pasteTableData(e, t = "paste") {
3423
3423
  const n = this.tableContext();
3424
3424
  if (!n) return !1;
3425
- const o = t === "pasteKeepFormat" ? e?.html : zr(e?.html || ""), r = Sc({ text: e?.text || "", html: o || "" });
3425
+ const o = t === "pasteKeepFormat" ? e?.html : Dr(e?.html || ""), r = wc({ text: e?.text || "", html: o || "" });
3426
3426
  if (!r?.length) return !1;
3427
- const i = this.run(() => wc(n, r));
3427
+ const i = this.run(() => xc(n, r));
3428
3428
  return i && this.repaintCellSelection(), i;
3429
3429
  },
3430
3430
  /**
@@ -3435,10 +3435,10 @@ const xc = {
3435
3435
  notifyCellSelection() {
3436
3436
  this.emit("cell-selection");
3437
3437
  }
3438
- }, Lc = [...uc, ...hc];
3439
- class Jr {
3438
+ }, Mc = [...dc, ...mc];
3439
+ class ei {
3440
3440
  constructor(t = {}) {
3441
- this.root = t.root, this.placeholder = t.placeholder || "", this.handlers = t.handlers || {}, this.undoStack = [], this.redoStack = [], this.pending = null, this.savedRange = null, this.cellRect = null, this.contextCell = null, this.selectedAtom = null, this.cellDragFrom = null, this.colResizing = !1, this.hoverColumn = null, this._gridCache = null, this._gridCachePending = !1, this.dragCleanups = /* @__PURE__ */ new Set(), this.modal = !1, this.applying = !1, this.typing = !1, this.blockMarqueeActive = !1, this.composing = !1, this.destroyed = !1, this.suggesting = !1, this.listeners = /* @__PURE__ */ new Map(), this.search = dl(this.root), this.unbindInput = null, this.observer = null, this.idleTimer = 0, Lc.forEach((n) => {
3441
+ this.root = t.root, this.placeholder = t.placeholder || "", this.handlers = t.handlers || {}, this.undoStack = [], this.redoStack = [], this.pending = null, this.savedRange = null, this.cellRect = null, this.contextCell = null, this.selectedAtom = null, this.cellDragFrom = null, this.colResizing = !1, this.hoverColumn = null, this._gridCache = null, this._gridCachePending = !1, this.dragCleanups = /* @__PURE__ */ new Set(), this.modal = !1, this.applying = !1, this.typing = !1, this.blockMarqueeActive = !1, this.composing = !1, this.destroyed = !1, this.suggesting = !1, this.listeners = /* @__PURE__ */ new Map(), this.search = fl(this.root), this.unbindInput = null, this.observer = null, this.idleTimer = 0, Mc.forEach((n) => {
3442
3442
  this[n] = this[n].bind(this);
3443
3443
  });
3444
3444
  }
@@ -3451,7 +3451,7 @@ class Jr {
3451
3451
  const t = this.root;
3452
3452
  this.observer = new MutationObserver((n) => {
3453
3453
  n.every((r) => r.target instanceof Element && r.target.matches?.(nn) ? !0 : [...r.addedNodes, ...r.removedNodes].every((i) => i.nodeType === Node.ELEMENT_NODE && i.matches?.(nn))) || this.onDomMutated();
3454
- }), this.observer.observe(t, { childList: !0, subtree: !0, characterData: !0 }), t.addEventListener("focus", this.onFocus), t.addEventListener("blur", this.onBlur), t.addEventListener("mousedown", this.onMouseDown), t.addEventListener("mousemove", this.onHoverColumn), t.addEventListener("mouseleave", this.onLeaveColumn), t.addEventListener("click", this.onClick), t.addEventListener("change", this.onCheckboxChange), t.addEventListener("keyup", this.onPointerState), t.addEventListener("mouseup", this.onPointerState), document.addEventListener("selectionchange", this.onSelectionChange), this.unbindInput = Oa(this);
3454
+ }), this.observer.observe(t, { childList: !0, subtree: !0, characterData: !0 }), t.addEventListener("focus", this.onFocus), t.addEventListener("blur", this.onBlur), t.addEventListener("mousedown", this.onMouseDown), t.addEventListener("mousemove", this.onHoverColumn), t.addEventListener("mouseleave", this.onLeaveColumn), t.addEventListener("click", this.onClick), t.addEventListener("change", this.onCheckboxChange), t.addEventListener("keyup", this.onPointerState), t.addEventListener("mouseup", this.onPointerState), document.addEventListener("selectionchange", this.onSelectionChange), this.unbindInput = Ba(this);
3455
3455
  }
3456
3456
  destroy() {
3457
3457
  if (this.destroyed) return;
@@ -3488,7 +3488,7 @@ class Jr {
3488
3488
  /* ===================== 图片 ===================== */
3489
3489
  /** 图片转 base64 后按当前光标处逐张内嵌 */
3490
3490
  async insertImageFiles(t) {
3491
- for (const { file: n, src: o } of await Xi(t))
3491
+ for (const { file: n, src: o } of await ji(t))
3492
3492
  this.exec("insertImage", { src: o, alt: n.name || "image" });
3493
3493
  }
3494
3494
  isMenuOpen() {
@@ -3496,16 +3496,16 @@ class Jr {
3496
3496
  }
3497
3497
  }
3498
3498
  Object.assign(
3499
- Jr.prototype,
3500
- lc,
3501
- cc,
3502
- dc,
3503
- mc,
3499
+ ei.prototype,
3500
+ sc,
3501
+ uc,
3502
+ fc,
3504
3503
  pc,
3505
3504
  gc,
3506
- xc
3505
+ vc,
3506
+ Lc
3507
3507
  );
3508
- const Mc = {
3508
+ const Zo = {
3509
3509
  "rte-undo": '<path d="M10 5.4 4.4 11l5.6 5.6 1.5-1.5-3-3H14a4.6 4.6 0 0 1 0 9.2h-1.4V23H14a6.6 6.6 0 0 0 0-13.2h-5.5l3-3L10 5.4z"/>',
3510
3510
  "rte-redo": '<path d="M14 5.4 19.6 11 14 16.6l-1.5-1.5 3-3H10a4.6 4.6 0 0 0 0 9.2h1.4V23H10a6.6 6.6 0 0 1 0-13.2h5.5l-3-3L14 5.4z"/>',
3511
3511
  "rte-text": '<path d="M4 5h16v2.2H4zM4 10.9h16v2.2H4zM4 16.8h9v2.2H4z"/>',
@@ -3600,8 +3600,11 @@ const Mc = {
3600
3600
  strokeLinejoin: { type: String, default: "round" }
3601
3601
  },
3602
3602
  setup(e) {
3603
- const t = e, n = j(() => Mc[t.name] || "");
3604
- return (o, r) => (N(), D("svg", {
3603
+ const t = e, n = (r) => {
3604
+ const i = r.indexOf("-");
3605
+ return i < 0 ? r : r.slice(0, i + 1) + r.slice(i + 1).replace(/-([a-z0-9])/g, (l, s) => s.toUpperCase());
3606
+ }, o = j(() => Zo[t.name] || Zo[n(t.name)] || "");
3607
+ return (r, i) => (N(), D("svg", {
3605
3608
  width: e.size,
3606
3609
  height: e.size,
3607
3610
  viewBox: `0 0 ${e.viewBox || 24} ${e.viewBox || 24}`,
@@ -3610,16 +3613,16 @@ const Mc = {
3610
3613
  "stroke-width": e.strokeWidth,
3611
3614
  "stroke-linecap": e.strokeLinecap,
3612
3615
  "stroke-linejoin": e.strokeLinejoin,
3613
- innerHTML: n.value
3616
+ innerHTML: o.value
3614
3617
  }, null, 8, Nc));
3615
3618
  }
3616
- }, ei = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
3619
+ }, ti = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
3617
3620
  __name: "ImageViewer",
3618
3621
  setup(e) {
3619
- return (t, n) => (N(), J(q(Di), ro(io(t.$attrs)), null, 16));
3622
+ return (t, n) => (N(), Q(U($i), ro(io(t.$attrs)), null, 16));
3620
3623
  }
3621
3624
  });
3622
- function ti() {
3625
+ function ni() {
3623
3626
  const e = S([]), t = S(0), n = (i, l = 0) => {
3624
3627
  e.value = i.filter(Boolean), t.value = l;
3625
3628
  };
@@ -3630,12 +3633,12 @@ function ti() {
3630
3633
  e.value = [];
3631
3634
  } };
3632
3635
  }
3633
- const ni = 100;
3636
+ const oi = 100;
3634
3637
  function Fe(e) {
3635
3638
  const t = e?.getBoundingClientRect?.();
3636
- return t ? { x: t.left, y: t.top, z: t.width > 0 ? t.width / ni : 1 } : { x: 0, y: 0, z: 1 };
3639
+ return t ? { x: t.left, y: t.top, z: t.width > 0 ? t.width / oi : 1 } : { x: 0, y: 0, z: 1 };
3637
3640
  }
3638
- const Zo = {
3641
+ const Jo = {
3639
3642
  ready: !1,
3640
3643
  canUndo: !1,
3641
3644
  canRedo: !1,
@@ -3677,17 +3680,17 @@ const Zo = {
3677
3680
  isEmpty: !0
3678
3681
  };
3679
3682
  function Rc(e) {
3680
- const t = Mi({ ...Zo }), n = S(null), o = () => {
3683
+ const t = Ni({ ...Jo }), n = S(null), o = () => {
3681
3684
  const l = n.value;
3682
3685
  !l || l.destroyed || Object.assign(t, l.state());
3683
3686
  }, r = () => {
3684
- n.value && (n.value.off("state", o), n.value.off("selection", o), n.value = null, Object.assign(t, Zo));
3687
+ n.value && (n.value.off("state", o), n.value.off("selection", o), n.value = null, Object.assign(t, Jo));
3685
3688
  };
3686
3689
  return Ie(e, (l) => {
3687
3690
  r(), l && (n.value = l, l.on("state", o), l.on("selection", o), o());
3688
3691
  }, { immediate: !0 }), Rt(r), t;
3689
3692
  }
3690
- const je = (e, t) => {
3693
+ const We = (e, t) => {
3691
3694
  const n = e.__vccOpts || e;
3692
3695
  for (const [o, r] of t)
3693
3696
  n[o] = r;
@@ -3718,7 +3721,7 @@ const je = (e, t) => {
3718
3721
  },
3719
3722
  emits: ["update:modelValue"],
3720
3723
  setup(e, { expose: t, emit: n }) {
3721
- const o = e, r = n, i = S(null), l = S(null), s = S(null), a = Ni(null), c = Rc(a), f = S(null), u = ["top-left", "top-right", "bottom-left", "bottom-right"], p = S(null), y = j(() => p.value ? { left: `${p.value.left}px`, top: `${p.value.top}px`, width: `${p.value.width}px`, height: `${p.value.height}px` } : {});
3724
+ const o = e, r = n, i = S(null), l = S(null), s = S(null), a = Ri(null), c = Rc(a), f = S(null), u = ["top-left", "top-right", "bottom-left", "bottom-right"], p = S(null), y = j(() => p.value ? { left: `${p.value.left}px`, top: `${p.value.top}px`, width: `${p.value.width}px`, height: `${p.value.height}px` } : {});
3722
3725
  let E = null, m = !1;
3723
3726
  const h = S(null), g = j(
3724
3727
  () => h.value ? { left: `${h.value.left}px`, top: `${h.value.top}px`, width: `${h.value.width}px`, height: `${h.value.height}px` } : {}
@@ -3753,7 +3756,7 @@ const je = (e, t) => {
3753
3756
  let C = 0;
3754
3757
  function d() {
3755
3758
  C || (C = requestAnimationFrame(() => {
3756
- C = 0, W(), b.value && O(), We(), mt();
3759
+ C = 0, W(), b.value && O(), Ye(), mt();
3757
3760
  }));
3758
3761
  }
3759
3762
  const b = S(null), T = S(null);
@@ -3788,7 +3791,7 @@ const je = (e, t) => {
3788
3791
  !x || !ie || !ie.isConnected || (x.root.focus({ preventScroll: !0 }), x.beginEdgeGesture(k, ie, v));
3789
3792
  }
3790
3793
  const ne = S(null);
3791
- function We() {
3794
+ function Ye() {
3792
3795
  const v = a.value, k = v && !v.destroyed ? v.columnBoundaryBox() : null;
3793
3796
  if (!k) {
3794
3797
  ne.value = null;
@@ -3801,15 +3804,15 @@ const je = (e, t) => {
3801
3804
  height: `${Math.round(k.height / x.z)}px`
3802
3805
  };
3803
3806
  }
3804
- const Ye = S(null);
3807
+ const Qe = S(null);
3805
3808
  function mt() {
3806
3809
  const v = a.value, k = v && !v.destroyed ? v.cellSelectionBox() : null;
3807
3810
  if (!k) {
3808
- Ye.value = null;
3811
+ Qe.value = null;
3809
3812
  return;
3810
3813
  }
3811
3814
  const x = Fe(s.value);
3812
- Ye.value = {
3815
+ Qe.value = {
3813
3816
  left: `${Math.round((k.left - x.x) / x.z)}px`,
3814
3817
  top: `${Math.round((k.top - x.y) / x.z)}px`,
3815
3818
  width: `${Math.round(k.width / x.z)}px`,
@@ -3819,15 +3822,15 @@ const je = (e, t) => {
3819
3822
  function Nn(v, k) {
3820
3823
  const x = f.value, ie = a.value;
3821
3824
  if (!x || !ie) return;
3822
- const oe = x.getBoundingClientRect(), Le = oe.width / Math.max(1, oe.height), Be = Fe(s.value).z, Qe = { x: k.clientX, y: k.clientY, width: oe.width }, Ct = v.endsWith("left") ? -1 : 1, Et = (se) => {
3823
- const Ze = Math.max(zc, Math.round((Qe.width + (se.clientX - Qe.x) * Ct) / Be)), Hn = Math.max(Dc, Math.round(Ze / Le));
3825
+ const oe = x.getBoundingClientRect(), Le = oe.width / Math.max(1, oe.height), Be = Fe(s.value).z, Ze = { x: k.clientX, y: k.clientY, width: oe.width }, Ct = v.endsWith("left") ? -1 : 1, Et = (se) => {
3826
+ const Je = Math.max(zc, Math.round((Ze.width + (se.clientX - Ze.x) * Ct) / Be)), Hn = Math.max(Dc, Math.round(Je / Le));
3824
3827
  ie.run(() => {
3825
- x.setAttribute("width", String(Ze)), x.setAttribute("height", String(Hn));
3828
+ x.setAttribute("width", String(Je)), x.setAttribute("height", String(Hn));
3826
3829
  }), d();
3827
- }, Q = () => {
3828
- document.removeEventListener("mousemove", Et), document.removeEventListener("mouseup", Q);
3830
+ }, Z = () => {
3831
+ document.removeEventListener("mousemove", Et), document.removeEventListener("mouseup", Z);
3829
3832
  };
3830
- document.addEventListener("mousemove", Et), document.addEventListener("mouseup", Q);
3833
+ document.addEventListener("mousemove", Et), document.addEventListener("mouseup", Z);
3831
3834
  }
3832
3835
  Ie(f, () => d());
3833
3836
  const {
@@ -3835,7 +3838,7 @@ const je = (e, t) => {
3835
3838
  index: Ut,
3836
3839
  openAt: gt,
3837
3840
  close: Rn
3838
- } = ti(), vt = (v) => v.target.closest?.("img"), On = () => {
3841
+ } = ni(), vt = (v) => v.target.closest?.("img"), On = () => {
3839
3842
  f.value && gt(l.value, f.value);
3840
3843
  };
3841
3844
  function Bn(v) {
@@ -3858,7 +3861,7 @@ const je = (e, t) => {
3858
3861
  }
3859
3862
  );
3860
3863
  function Gt() {
3861
- const v = o.handlers || {}, k = new Jr({
3864
+ const v = o.handlers || {}, k = new ei({
3862
3865
  root: l.value,
3863
3866
  placeholder: o.placeholder,
3864
3867
  handlers: {
@@ -3924,10 +3927,10 @@ const je = (e, t) => {
3924
3927
  const k = a.value;
3925
3928
  k && v !== L && v !== k.getHTML() && (A && (clearTimeout(A), A = 0), M = !1, k.setHTML(v || ""), L = k.getHTML());
3926
3929
  }
3927
- ), ir(() => {
3928
- Gt(), a.value?.on("column-hover", We), a.value?.on("cell-selection", mt), i.value?.addEventListener("scroll", d), i.value?.addEventListener("mousemove", Ee), i.value?.addEventListener("mouseleave", Y), i.value?.addEventListener("mousedown", kt, !0), window.addEventListener("resize", d);
3930
+ ), lr(() => {
3931
+ Gt(), a.value?.on("column-hover", Ye), a.value?.on("cell-selection", mt), i.value?.addEventListener("scroll", d), i.value?.addEventListener("mousemove", Ee), i.value?.addEventListener("mouseleave", Y), i.value?.addEventListener("mousedown", kt, !0), window.addEventListener("resize", d);
3929
3932
  }), Rt(() => {
3930
- R(), a.value?.off("column-hover", We), a.value?.off("cell-selection", mt), i.value?.removeEventListener("scroll", d), i.value?.removeEventListener("mousemove", Ee), i.value?.removeEventListener("mouseleave", Y), i.value?.removeEventListener("mousedown", kt, !0), document.removeEventListener("mousemove", _e), document.removeEventListener("mouseup", yt), a.value?.blockMarqueeActive && (a.value.blockMarqueeActive = !1, a.value.clearBlockSelection()), window.removeEventListener("resize", d), C && cancelAnimationFrame(C), a.value?.destroy(), a.value = null;
3933
+ R(), a.value?.off("column-hover", Ye), a.value?.off("cell-selection", mt), i.value?.removeEventListener("scroll", d), i.value?.removeEventListener("mousemove", Ee), i.value?.removeEventListener("mouseleave", Y), i.value?.removeEventListener("mousedown", kt, !0), document.removeEventListener("mousemove", _e), document.removeEventListener("mouseup", yt), a.value?.blockMarqueeActive && (a.value.blockMarqueeActive = !1, a.value.clearBlockSelection()), window.removeEventListener("resize", d), C && cancelAnimationFrame(C), a.value?.destroy(), a.value = null;
3931
3934
  }), t({
3932
3935
  /** 内核实例(浮层菜单等外围件取它执行命令) */
3933
3936
  editor: a,
@@ -3945,11 +3948,11 @@ const je = (e, t) => {
3945
3948
  }
3946
3949
  }), (v, k) => (N(), D("div", {
3947
3950
  class: be(["rich-edit-surface", { "is-fill": $.value }]),
3948
- style: Z(ee.value)
3951
+ style: J(ee.value)
3949
3952
  }, [
3950
3953
  de(v.$slots, "toolbar", {
3951
3954
  editor: a.value,
3952
- state: q(c)
3955
+ state: U(c)
3953
3956
  }, void 0, !0),
3954
3957
  I("div", {
3955
3958
  ref_key: "scrollRef",
@@ -3964,7 +3967,7 @@ const je = (e, t) => {
3964
3967
  ref_key: "probeRef",
3965
3968
  ref: s,
3966
3969
  class: "re-overlay-probe",
3967
- style: Z({ width: `${q(ni)}px` }),
3970
+ style: J({ width: `${U(oi)}px` }),
3968
3971
  "aria-hidden": "true"
3969
3972
  }, null, 4),
3970
3973
  I("div", {
@@ -3978,16 +3981,16 @@ const je = (e, t) => {
3978
3981
  probe: s.value
3979
3982
  }, void 0, !0),
3980
3983
  e.editable ? (N(), D("div", Oc, [
3981
- Ye.value ? (N(), D("span", {
3984
+ Qe.value ? (N(), D("span", {
3982
3985
  key: 0,
3983
3986
  class: "re-table-select",
3984
- style: Z(Ye.value)
3985
- }, null, 4)) : U("", !0),
3987
+ style: J(Qe.value)
3988
+ }, null, 4)) : F("", !0),
3986
3989
  T.value ? (N(), D("div", Bc, [
3987
3990
  I("button", {
3988
3991
  type: "button",
3989
3992
  class: "re-table-handle is-column",
3990
- style: Z(T.value.column),
3993
+ style: J(T.value.column),
3991
3994
  title: "点击在右侧插入一列 / 拖拽插入或删除多列",
3992
3995
  "aria-label": "在右侧插入一列",
3993
3996
  onMousedown: k[0] || (k[0] = te((x) => xe("column", x), ["prevent"]))
@@ -3995,28 +3998,28 @@ const je = (e, t) => {
3995
3998
  I("button", {
3996
3999
  type: "button",
3997
4000
  class: "re-table-handle is-row",
3998
- style: Z(T.value.row),
4001
+ style: J(T.value.row),
3999
4002
  title: "点击在下方插入一行 / 拖拽插入或删除多行",
4000
4003
  "aria-label": "在下方插入一行",
4001
4004
  onMousedown: k[1] || (k[1] = te((x) => xe("row", x), ["prevent"]))
4002
4005
  }, "+", 36)
4003
- ])) : U("", !0),
4006
+ ])) : F("", !0),
4004
4007
  ne.value ? (N(), D("span", {
4005
4008
  key: 2,
4006
4009
  class: "re-col-line",
4007
- style: Z(ne.value)
4008
- }, null, 4)) : U("", !0)
4009
- ])) : U("", !0),
4010
+ style: J(ne.value)
4011
+ }, null, 4)) : F("", !0)
4012
+ ])) : F("", !0),
4010
4013
  h.value ? (N(), D("div", {
4011
4014
  key: 1,
4012
4015
  class: "re-marquee",
4013
- style: Z(g.value)
4014
- }, null, 4)) : U("", !0),
4015
- q(c).isEmpty && e.placeholder ? (N(), D("div", Ic, pe(e.placeholder), 1)) : U("", !0),
4016
+ style: J(g.value)
4017
+ }, null, 4)) : F("", !0),
4018
+ U(c).isEmpty && e.placeholder ? (N(), D("div", Ic, pe(e.placeholder), 1)) : F("", !0),
4016
4019
  p.value && e.editable ? (N(), D("div", {
4017
4020
  key: 3,
4018
4021
  class: "re-resize-box",
4019
- style: Z(y.value)
4022
+ style: J(y.value)
4020
4023
  }, [
4021
4024
  I("button", {
4022
4025
  type: "button",
@@ -4032,27 +4035,27 @@ const je = (e, t) => {
4032
4035
  size: 13
4033
4036
  })
4034
4037
  ], 32),
4035
- (N(), D(nt, null, xt(u, (x) => I("span", {
4038
+ (N(), D(Ue, null, xt(u, (x) => I("span", {
4036
4039
  key: x,
4037
4040
  class: be(["re-resize-handle", `is-${x}`]),
4038
4041
  onMousedown: te((ie) => Nn(x, ie), ["prevent"])
4039
4042
  }, null, 42, Hc)), 64))
4040
- ], 4)) : U("", !0)
4043
+ ], 4)) : F("", !0)
4041
4044
  ], 34),
4042
4045
  de(v.$slots, "floaters", {
4043
4046
  editor: a.value,
4044
- state: q(c)
4047
+ state: U(c)
4045
4048
  }, void 0, !0),
4046
- q(pt).length ? (N(), J(ei, {
4049
+ U(pt).length ? (N(), Q(ti, {
4047
4050
  key: 0,
4048
- images: q(pt),
4049
- "initial-index": q(Ut),
4051
+ images: U(pt),
4052
+ "initial-index": U(Ut),
4050
4053
  onSwitch: k[3] || (k[3] = (x) => Ut.value = x),
4051
4054
  onClose: In
4052
- }, null, 8, ["images", "initial-index"])) : U("", !0)
4055
+ }, null, 8, ["images", "initial-index"])) : F("", !0)
4053
4056
  ], 6));
4054
4057
  }
4055
- }, Fc = /* @__PURE__ */ je(Pc, [["__scopeId", "data-v-ea6f6b3c"]]), qc = ["title", "disabled"], Uc = {
4058
+ }, Fc = /* @__PURE__ */ We(Pc, [["__scopeId", "data-v-ea6f6b3c"]]), qc = ["title", "disabled"], Uc = {
4056
4059
  __name: "ToolButton",
4057
4060
  props: {
4058
4061
  icon: { type: String, default: "text" },
@@ -4082,7 +4085,7 @@ const je = (e, t) => {
4082
4085
  ], !0)
4083
4086
  ], 42, qc));
4084
4087
  }
4085
- }, K = /* @__PURE__ */ je(Uc, [["__scopeId", "data-v-7af2498b"]]), So = {
4088
+ }, K = /* @__PURE__ */ We(Uc, [["__scopeId", "data-v-7af2498b"]]), So = {
4086
4089
  __name: "BasePopover",
4087
4090
  setup(e, { expose: t }) {
4088
4091
  const n = S(null);
@@ -4091,7 +4094,7 @@ const je = (e, t) => {
4091
4094
  openAt: (o) => n.value?.openAt?.(o),
4092
4095
  close: () => n.value?.close?.(),
4093
4096
  isOpen: () => !!n.value?.isOpen?.()
4094
- }), (o, r) => (N(), J(q($i), {
4097
+ }), (o, r) => (N(), Q(U(_i), {
4095
4098
  ref_key: "inner",
4096
4099
  ref: n
4097
4100
  }, {
@@ -4160,14 +4163,14 @@ const je = (e, t) => {
4160
4163
  const M = u.value[f.value];
4161
4164
  M && h(M);
4162
4165
  }
4163
- return t({ close: m }), (M, L) => (N(), J(So, {
4166
+ return t({ close: m }), (M, L) => (N(), Q(So, {
4164
4167
  ref_key: "popRef",
4165
4168
  ref: i,
4166
4169
  trigger: "click",
4167
4170
  placement: `bottom-${e.align}`,
4168
4171
  "show-arrow": !1,
4169
4172
  "float-class": "rt-panel",
4170
- "z-index": q(at).RICHTEXT_FLOAT,
4173
+ "z-index": U(at).RICHTEXT_FLOAT,
4171
4174
  onOpen: y,
4172
4175
  onClose: E
4173
4176
  }, {
@@ -4183,7 +4186,7 @@ const je = (e, t) => {
4183
4186
  size: 13,
4184
4187
  "aria-hidden": "true"
4185
4188
  }),
4186
- lr(I("input", {
4189
+ sr(I("input", {
4187
4190
  ref_key: "searchRef",
4188
4191
  ref: s,
4189
4192
  "onUpdate:modelValue": L[1] || (L[1] = (R) => c.value = R),
@@ -4192,21 +4195,21 @@ const je = (e, t) => {
4192
4195
  autocomplete: "off",
4193
4196
  spellcheck: "false",
4194
4197
  onKeydown: [
4195
- L[2] || (L[2] = et(te((R) => g(1), ["prevent"]), ["down"])),
4196
- L[3] || (L[3] = et(te((R) => g(-1), ["prevent"]), ["up"])),
4197
- et(te(A, ["prevent"]), ["enter"]),
4198
- et(te(m, ["stop", "prevent"]), ["esc"])
4198
+ L[2] || (L[2] = tt(te((R) => g(1), ["prevent"]), ["down"])),
4199
+ L[3] || (L[3] = tt(te((R) => g(-1), ["prevent"]), ["up"])),
4200
+ tt(te(A, ["prevent"]), ["enter"]),
4201
+ tt(te(m, ["stop", "prevent"]), ["esc"])
4199
4202
  ]
4200
4203
  }, null, 40, Xc), [
4201
- [sr, c.value]
4204
+ [ar, c.value]
4202
4205
  ])
4203
- ])) : U("", !0),
4206
+ ])) : F("", !0),
4204
4207
  I("div", {
4205
4208
  ref_key: "listRef",
4206
4209
  ref: l,
4207
4210
  class: "re-dd-list"
4208
4211
  }, [
4209
- (N(!0), D(nt, null, xt(u.value, (R, z) => (N(), D("div", {
4212
+ (N(!0), D(Ue, null, xt(u.value, (R, z) => (N(), D("div", {
4210
4213
  key: String(R.value),
4211
4214
  class: be(["re-dd-option", { "is-highlight": z === f.value, "is-selected": p(R) }]),
4212
4215
  onMouseenter: ($) => f.value = z,
@@ -4218,21 +4221,21 @@ const je = (e, t) => {
4218
4221
  size: 15,
4219
4222
  "aria-hidden": "true"
4220
4223
  }, null, 8, ["name"])
4221
- ])) : U("", !0),
4224
+ ])) : F("", !0),
4222
4225
  I("span", {
4223
4226
  class: "re-dd-opt-label",
4224
- style: Z(R.style)
4227
+ style: J(R.style)
4225
4228
  }, pe(R.label), 5),
4226
- R.hint ? (N(), D("span", Yc, pe(R.hint), 1)) : U("", !0),
4227
- p(R) ? (N(), J(ve, {
4229
+ R.hint ? (N(), D("span", Yc, pe(R.hint), 1)) : F("", !0),
4230
+ p(R) ? (N(), Q(ve, {
4228
4231
  key: 2,
4229
4232
  name: "rte-check",
4230
4233
  size: 13,
4231
4234
  class: "re-dd-check",
4232
4235
  "aria-hidden": "true"
4233
- })) : U("", !0)
4236
+ })) : F("", !0)
4234
4237
  ], 42, jc))), 128)),
4235
- u.value.length ? U("", !0) : (N(), D("div", Qc, "无匹配项"))
4238
+ u.value.length ? F("", !0) : (N(), D("div", Qc, "无匹配项"))
4236
4239
  ], 512)
4237
4240
  ], 32)
4238
4241
  ]),
@@ -4241,7 +4244,7 @@ const je = (e, t) => {
4241
4244
  type: "button",
4242
4245
  class: be(["re-dd-trigger", { "is-open": a.value }]),
4243
4246
  title: e.label,
4244
- style: Z({ minWidth: e.minWidth }),
4247
+ style: J({ minWidth: e.minWidth }),
4245
4248
  onMousedown: L[0] || (L[0] = te(() => {
4246
4249
  }, ["prevent"]))
4247
4250
  }, [
@@ -4257,7 +4260,7 @@ const je = (e, t) => {
4257
4260
  _: 1
4258
4261
  }, 8, ["placement", "z-index"]));
4259
4262
  }
4260
- }, Qt = /* @__PURE__ */ je(Zc, [["__scopeId", "data-v-b00865fb"]]), oi = [
4263
+ }, Qt = /* @__PURE__ */ We(Zc, [["__scopeId", "data-v-b00865fb"]]), ri = [
4261
4264
  { key: "paragraph", title: "正文", icon: "text", shortcut: "Ctrl/Cmd + Alt + 0" },
4262
4265
  { key: "heading1", title: "标题 1", icon: "h1", shortcut: "Ctrl/Cmd + Alt + 1" },
4263
4266
  { key: "heading2", title: "标题 2", icon: "h2", shortcut: "Ctrl/Cmd + Alt + 2" },
@@ -4265,8 +4268,8 @@ const je = (e, t) => {
4265
4268
  { key: "heading4", title: "标题 4", icon: "h4", shortcut: "Ctrl/Cmd + Alt + 4" },
4266
4269
  { key: "heading5", title: "标题 5", icon: "h5", shortcut: "Ctrl/Cmd + Alt + 5" },
4267
4270
  { key: "heading6", title: "标题 6", icon: "h6", shortcut: "Ctrl/Cmd + Alt + 6" }
4268
- ], ri = [
4269
- ...oi,
4271
+ ], ii = [
4272
+ ...ri,
4270
4273
  { key: "blockquote", title: "引用", icon: "quote" },
4271
4274
  { key: "codeBlock", title: "代码块", icon: "code" },
4272
4275
  { key: "bulletList", title: "无序列表", icon: "bullet", shortcut: "Ctrl/Cmd + Shift + 7" },
@@ -4340,7 +4343,7 @@ const je = (e, t) => {
4340
4343
  { key: "increaseIndent", title: "增加缩进", icon: "indentAdd", shortcut: "Tab" },
4341
4344
  { key: "decreaseIndent", title: "减少缩进", icon: "indentReduce", shortcut: "Shift + Tab" }
4342
4345
  ]
4343
- ], Jo = {
4346
+ ], er = {
4344
4347
  title: { icon: "h1", name: "标题" },
4345
4348
  heading1: { icon: "h1", name: "一级标题" },
4346
4349
  heading2: { icon: "h2", name: "二级标题" },
@@ -4362,7 +4365,7 @@ const je = (e, t) => {
4362
4365
  };
4363
4366
  function tu(e, t) {
4364
4367
  let n = Ft(e);
4365
- return (n === "listItem" || n === "taskItem") && (n = Vr(e, t) || "bulletList"), Jo[n] || Jo.paragraph;
4368
+ return (n === "listItem" || n === "taskItem") && (n = Gr(e, t) || "bulletList"), er[n] || er.paragraph;
4366
4369
  }
4367
4370
  const nu = /(?:^|\s)([/、])([^\s/、]*)$/;
4368
4371
  function ou(e) {
@@ -4419,7 +4422,7 @@ function ru(e, t, n = {}) {
4419
4422
  return !1;
4420
4423
  }
4421
4424
  }
4422
- function ii(e, t, n = null) {
4425
+ function li(e, t, n = null) {
4423
4426
  if (!e) return !1;
4424
4427
  const o = t.startsWith("heading") ? Number(t.slice(7)) : 0, i = o ? `heading${o}` : {
4425
4428
  paragraph: "paragraph",
@@ -4450,10 +4453,10 @@ function lu(e, t) {
4450
4453
  const n = String(t || "").trim();
4451
4454
  return e ? e.exec(n ? "setLink" : "unsetLink", n) : !1;
4452
4455
  }
4453
- const li = "gbrichtext:recent-styles", hn = "​";
4454
- function si() {
4456
+ const si = "gbrichtext:recent-styles", hn = "​";
4457
+ function ai() {
4455
4458
  try {
4456
- const e = JSON.parse(localStorage.getItem(li) || "[]");
4459
+ const e = JSON.parse(localStorage.getItem(si) || "[]");
4457
4460
  return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
4458
4461
  } catch {
4459
4462
  return [];
@@ -4461,27 +4464,27 @@ function si() {
4461
4464
  }
4462
4465
  function su(e) {
4463
4466
  try {
4464
- localStorage.setItem(li, JSON.stringify(e));
4467
+ localStorage.setItem(si, JSON.stringify(e));
4465
4468
  } catch {
4466
4469
  }
4467
4470
  }
4468
- function er(e) {
4471
+ function tr(e) {
4469
4472
  return `${e.kind}${hn}${e.value}`;
4470
4473
  }
4471
- function ai(e) {
4474
+ function ci(e) {
4472
4475
  if (typeof e != "string" || !e) return null;
4473
4476
  const [t, ...n] = e.split(hn);
4474
4477
  return t ? { kind: t, value: n.join(hn) } : null;
4475
4478
  }
4476
- function ci() {
4477
- return si().map(ai).filter(Boolean);
4479
+ function ui() {
4480
+ return ai().map(ci).filter(Boolean);
4478
4481
  }
4479
- function ui(e, t) {
4480
- const n = { kind: e, value: String(t ?? "") }, o = er(n), r = si().filter((i) => {
4481
- const l = ai(i);
4482
- return l && er(l) !== o;
4482
+ function di(e, t) {
4483
+ const n = { kind: e, value: String(t ?? "") }, o = tr(n), r = ai().filter((i) => {
4484
+ const l = ci(i);
4485
+ return l && tr(l) !== o;
4483
4486
  });
4484
- su([`${n.kind}${hn}${n.value}`, ...r].slice(0, _i));
4487
+ su([`${n.kind}${hn}${n.value}`, ...r].slice(0, Pi));
4485
4488
  }
4486
4489
  const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "re-group" }, du = { class: "re-group" }, fu = { class: "re-group" }, hu = { class: "re-group" }, mu = { class: "re-group" }, pu = {
4487
4490
  __name: "FormatToolbar",
@@ -4491,14 +4494,14 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4491
4494
  state: { type: Object, required: !0 }
4492
4495
  },
4493
4496
  setup(e) {
4494
- const t = e, n = S(""), o = S(null), r = S(0), i = j(() => (r.value, ci()));
4497
+ const t = e, n = S(""), o = S(null), r = S(0), i = j(() => (r.value, ui()));
4495
4498
  function l(C, d) {
4496
- ui(C, d), r.value += 1;
4499
+ di(C, d), r.value += 1;
4497
4500
  }
4498
4501
  function s(C, ...d) {
4499
4502
  t.editor && (t.editor.focus(), t.editor.exec(C, ...d));
4500
4503
  }
4501
- const a = oi.map((C) => ({ value: C.key, label: C.title, icon: C.icon, hint: C.shortcut })), c = j(() => ri.find((C) => C.key === t.state.blockType)?.title || "正文"), f = (C) => ii(t.editor, C), u = { value: "", label: "默认", clear: !0 }, p = [u, ...Je.map((C) => ({ value: `${C}px`, label: `${C}px` }))], y = j(() => t.state.fontSize || "字号"), E = (C) => s(C ? "setFontSize" : "unsetFontSize", C), m = j(() => [
4504
+ const a = ri.map((C) => ({ value: C.key, label: C.title, icon: C.icon, hint: C.shortcut })), c = j(() => ii.find((C) => C.key === t.state.blockType)?.title || "正文"), f = (C) => li(t.editor, C), u = { value: "", label: "默认", clear: !0 }, p = [u, ...et.map((C) => ({ value: `${C}px`, label: `${C}px` }))], y = j(() => t.state.fontSize || "字号"), E = (C) => s(C ? "setFontSize" : "unsetFontSize", C), m = j(() => [
4502
4505
  u,
4503
4506
  ...xo.map((C) => ({ value: C.value, label: C.label, style: { fontFamily: C.value } }))
4504
4507
  ]), h = j(() => t.state.fontFamily ? xo.find((d) => d.value === t.state.fontFamily)?.label || t.state.fontFamily.split(",")[0].replace(/"/g, "") : "字体"), g = (C) => s(C ? "setFontFamily" : "unsetFontFamily", C), A = [u, ...Vn.map((C) => ({ value: C, label: C }))], M = j(() => t.state.lineHeight || "行高"), L = (C) => s("setBlockLineHeight", C || null);
@@ -4553,7 +4556,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4553
4556
  B(Qt, {
4554
4557
  label: "块类型",
4555
4558
  display: c.value,
4556
- options: q(a),
4559
+ options: U(a),
4557
4560
  "model-value": e.state.blockType,
4558
4561
  "min-width": "76px",
4559
4562
  onSelect: f
@@ -4626,22 +4629,22 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4626
4629
  e.state.color ? (N(), D("i", {
4627
4630
  key: 0,
4628
4631
  class: "re-color-bar",
4629
- style: Z({ background: e.state.color })
4630
- }, null, 4)) : U("", !0)
4632
+ style: J({ background: e.state.color })
4633
+ }, null, 4)) : F("", !0)
4631
4634
  ], 512)
4632
4635
  ]),
4633
- n.value === "appearance" ? (N(), J(q(ar), {
4636
+ n.value === "appearance" ? (N(), Q(U(cr), {
4634
4637
  key: 0,
4635
4638
  anchor: o.value,
4636
4639
  state: e.state,
4637
4640
  "recent-styles": i.value,
4638
- "z-index": q(at).RICHTEXT_FLOAT,
4641
+ "z-index": U(at).RICHTEXT_FLOAT,
4639
4642
  onSelect: z,
4640
4643
  onClose: d[6] || (d[6] = (b) => n.value = "")
4641
- }, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : U("", !0),
4644
+ }, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : F("", !0),
4642
4645
  d[18] || (d[18] = I("span", { class: "re-sep" }, null, -1)),
4643
4646
  I("div", fu, [
4644
- (N(!0), D(nt, null, xt(q(Pi), (b) => (N(), J(K, {
4647
+ (N(!0), D(Ue, null, xt(U(Fi), (b) => (N(), Q(K, {
4645
4648
  key: b.value,
4646
4649
  icon: b.icon,
4647
4650
  title: b.title,
@@ -4698,8 +4701,8 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4698
4701
  }, null, 8, ["active"])
4699
4702
  ]),
4700
4703
  d[21] || (d[21] = I("span", { class: "re-sep" }, null, -1)),
4701
- B(q(Fi), {
4702
- "z-index": q(at).RICHTEXT_FLOAT,
4704
+ B(U(qi), {
4705
+ "z-index": U(at).RICHTEXT_FLOAT,
4703
4706
  onSelect: ee
4704
4707
  }, {
4705
4708
  default: re(() => [
@@ -4719,7 +4722,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4719
4722
  })
4720
4723
  ]));
4721
4724
  }
4722
- }, gu = /* @__PURE__ */ je(pu, [["__scopeId", "data-v-c830d1e7"]]), vu = { class: "re-slash-head" }, bu = { class: "re-slash-query" }, yu = { class: "re-slash-group" }, ku = ["onMouseenter", "onClick"], Cu = { class: "re-slash-icon" }, Eu = { class: "re-slash-title" }, Au = {
4725
+ }, gu = /* @__PURE__ */ We(pu, [["__scopeId", "data-v-c830d1e7"]]), vu = { class: "re-slash-head" }, bu = { class: "re-slash-query" }, yu = { class: "re-slash-group" }, ku = ["onMouseenter", "onClick"], Cu = { class: "re-slash-icon" }, Eu = { class: "re-slash-title" }, Au = {
4723
4726
  key: 0,
4724
4727
  class: "re-slash-tip"
4725
4728
  }, Tu = {
@@ -4820,7 +4823,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4820
4823
  { immediate: !0 }
4821
4824
  ), go({ keydown: z }, { priority: yn.FLOAT }), Rt(() => {
4822
4825
  W(n.editor);
4823
- }), t({ close: g, refresh: L }), (d, b) => (N(), J(So, {
4826
+ }), t({ close: g, refresh: L }), (d, b) => (N(), Q(So, {
4824
4827
  ref_key: "popRef",
4825
4828
  ref: o,
4826
4829
  trigger: "manual",
@@ -4828,7 +4831,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4828
4831
  width: 316,
4829
4832
  "show-arrow": !1,
4830
4833
  "float-class": "rt-panel",
4831
- "z-index": q(at).RICHTEXT_FLOAT,
4834
+ "z-index": U(at).RICHTEXT_FLOAT,
4832
4835
  onOpen: A,
4833
4836
  onClose: M
4834
4837
  }, {
@@ -4852,11 +4855,11 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4852
4855
  ref: a,
4853
4856
  class: "re-slash-list"
4854
4857
  }, [
4855
- (N(!0), D(nt, null, xt(y.value, (T) => (N(), D(nt, {
4858
+ (N(!0), D(Ue, null, xt(y.value, (T) => (N(), D(Ue, {
4856
4859
  key: T.title
4857
4860
  }, [
4858
4861
  I("div", yu, pe(T.title), 1),
4859
- (N(!0), D(nt, null, xt(T.items, (O) => (N(), D("div", {
4862
+ (N(!0), D(Ue, null, xt(T.items, (O) => (N(), D("div", {
4860
4863
  key: O.key,
4861
4864
  class: be(["re-slash-item", { "is-active": O === m.value }]),
4862
4865
  onMouseenter: (Y) => s.value = O.key,
@@ -4870,10 +4873,10 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4870
4873
  }, null, 8, ["name"])
4871
4874
  ]),
4872
4875
  I("span", Eu, pe(O.title), 1),
4873
- O.hint ? (N(), D("span", Au, pe(O.hint), 1)) : U("", !0)
4876
+ O.hint ? (N(), D("span", Au, pe(O.hint), 1)) : F("", !0)
4874
4877
  ], 42, ku))), 128))
4875
4878
  ], 64))), 128)),
4876
- y.value.length ? U("", !0) : (N(), D("div", Tu, pe(f.value && i.value.trim() ? "正在加载拼音匹配…" : "无匹配命令"), 1))
4879
+ y.value.length ? F("", !0) : (N(), D("div", Tu, pe(f.value && i.value.trim() ? "正在加载拼音匹配…" : "无匹配命令"), 1))
4877
4880
  ], 512)
4878
4881
  ], 32)
4879
4882
  ]),
@@ -4919,7 +4922,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4919
4922
  f.value = !1;
4920
4923
  }
4921
4924
  }
4922
- return t({ openAt: E, close: () => n.value?.close() }), (h, g) => (N(), J(So, {
4925
+ return t({ openAt: E, close: () => n.value?.close() }), (h, g) => (N(), Q(So, {
4923
4926
  ref_key: "popRef",
4924
4927
  ref: n,
4925
4928
  trigger: "manual",
@@ -4930,8 +4933,8 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4930
4933
  }, {
4931
4934
  content: re(({ close: A }) => [
4932
4935
  I("div", wu, [
4933
- r.value ? (N(), D("div", xu, pe(r.value), 1)) : U("", !0),
4934
- lr(I("input", {
4936
+ r.value ? (N(), D("div", xu, pe(r.value), 1)) : F("", !0),
4937
+ sr(I("input", {
4935
4938
  ref_key: "inputRef",
4936
4939
  ref: o,
4937
4940
  "onUpdate:modelValue": g[0] || (g[0] = (M) => l.value = M),
@@ -4942,14 +4945,14 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4942
4945
  autocomplete: "off",
4943
4946
  spellcheck: "false",
4944
4947
  onKeydown: [
4945
- et(te((M) => m(A), ["prevent"]), ["enter"]),
4946
- et(te(A, ["prevent"]), ["esc"])
4948
+ tt(te((M) => m(A), ["prevent"]), ["enter"]),
4949
+ tt(te(A, ["prevent"]), ["esc"])
4947
4950
  ]
4948
4951
  }, null, 40, Lu), [
4949
- [sr, l.value]
4952
+ [ar, l.value]
4950
4953
  ]),
4951
4954
  I("div", Mu, [
4952
- B(q(Lo), {
4955
+ B(U(Lo), {
4953
4956
  size: "small",
4954
4957
  onClick: A
4955
4958
  }, {
@@ -4958,7 +4961,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4958
4961
  ])]),
4959
4962
  _: 1
4960
4963
  }, 8, ["onClick"]),
4961
- B(q(Lo), {
4964
+ B(U(Lo), {
4962
4965
  size: "small",
4963
4966
  type: "primary",
4964
4967
  loading: f.value,
@@ -4975,7 +4978,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
4975
4978
  _: 1
4976
4979
  }, 8, ["z-index"]));
4977
4980
  }
4978
- }, Ru = /* @__PURE__ */ je(Nu, [["__scopeId", "data-v-a7d17bc1"]]);
4981
+ }, Ru = /* @__PURE__ */ We(Nu, [["__scopeId", "data-v-a7d17bc1"]]);
4979
4982
  function Ou(e) {
4980
4983
  const t = e.split("-"), n = t[0], o = t[1] || "center";
4981
4984
  return { side: n, crossAlign: o };
@@ -5033,7 +5036,7 @@ function $u(e, t, n = {}) {
5033
5036
  });
5034
5037
  return { left: Math.round(i), top: Math.round(l), maxHeight: Math.round(s) };
5035
5038
  }
5036
- function tr(e) {
5039
+ function nr(e) {
5037
5040
  return !e || typeof e.getBoundingClientRect != "function" ? null : e.getBoundingClientRect();
5038
5041
  }
5039
5042
  function _u(e, t = {}) {
@@ -5052,9 +5055,9 @@ const Pu = {
5052
5055
  state: { type: Object, required: !0 }
5053
5056
  },
5054
5057
  setup(e, { expose: t }) {
5055
- const n = e, o = S(!1), r = S(""), i = S(null), l = S(null), s = S(null), a = S(null), c = S({ left: 0, top: 0 }), f = S(0), u = j(() => (f.value, ci()));
5058
+ const n = e, o = S(!1), r = S(""), i = S(null), l = S(null), s = S(null), a = S(null), c = S({ left: 0, top: 0 }), f = S(0), u = j(() => (f.value, ui()));
5056
5059
  function p(C, d) {
5057
- ui(C, d), f.value += 1;
5060
+ di(C, d), f.value += 1;
5058
5061
  }
5059
5062
  const y = j(() => _u(c.value));
5060
5063
  function E(C, ...d) {
@@ -5074,7 +5077,7 @@ const Pu = {
5074
5077
  }
5075
5078
  async function h() {
5076
5079
  await rt();
5077
- const C = m(), d = tr(i.value);
5080
+ const C = m(), d = nr(i.value);
5078
5081
  !C || !d || (c.value = $u(C, d, { placement: "top", gap: 8 }));
5079
5082
  }
5080
5083
  function g() {
@@ -5090,7 +5093,7 @@ const Pu = {
5090
5093
  }
5091
5094
  function L() {
5092
5095
  const C = n.editor;
5093
- C && (C.focus(), l.value?.openAt(tr(a.value), {
5096
+ C && (C.focus(), l.value?.openAt(nr(a.value), {
5094
5097
  title: "链接地址",
5095
5098
  placeholder: "https://…(留空取消链接)",
5096
5099
  initial: n.state.linkHref || "",
@@ -5135,19 +5138,19 @@ const Pu = {
5135
5138
  d && d !== C && (d.off("selectionUpdate", g), d.off("transaction", g), d.off("focus", g), d.off("blur", A)), ee(C);
5136
5139
  },
5137
5140
  { immediate: !0 }
5138
- ), ir(() => {
5141
+ ), lr(() => {
5139
5142
  window.addEventListener("scroll", $, !0), window.addEventListener("resize", $);
5140
5143
  }), Rt(() => {
5141
5144
  W(), window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
5142
- }), t({ refresh: g, openLink: L }), (C, d) => (N(), J(Ri, { to: "body" }, [
5143
- B(Oi, { name: "re-bubble" }, {
5145
+ }), t({ refresh: g, openLink: L }), (C, d) => (N(), Q(Oi, { to: "body" }, [
5146
+ B(Bi, { name: "re-bubble" }, {
5144
5147
  default: re(() => [
5145
5148
  o.value ? (N(), D("div", {
5146
5149
  key: 0,
5147
5150
  ref_key: "panelRef",
5148
5151
  ref: i,
5149
5152
  class: "re-bubble",
5150
- style: Z(y.value),
5153
+ style: J(y.value),
5151
5154
  onMousedown: d[6] || (d[6] = te(() => {
5152
5155
  }, ["prevent"]))
5153
5156
  }, [
@@ -5190,8 +5193,8 @@ const Pu = {
5190
5193
  e.state.color ? (N(), D("i", {
5191
5194
  key: 0,
5192
5195
  class: "re-bubble-bar",
5193
- style: Z({ background: e.state.color })
5194
- }, null, 4)) : U("", !0)
5196
+ style: J({ background: e.state.color })
5197
+ }, null, 4)) : F("", !0)
5195
5198
  ], 512),
5196
5199
  d[8] || (d[8] = I("span", { class: "re-bubble-sep" }, null, -1)),
5197
5200
  I("span", {
@@ -5210,24 +5213,24 @@ const Pu = {
5210
5213
  ref_key: "linkPromptRef",
5211
5214
  ref: l,
5212
5215
  trigger: "manual",
5213
- "z-index": q(at).RICHTEXT_FLOAT
5216
+ "z-index": U(at).RICHTEXT_FLOAT
5214
5217
  }, null, 8, ["z-index"]),
5215
- r.value === "appearance" ? (N(), J(q(ar), {
5218
+ r.value === "appearance" ? (N(), Q(U(cr), {
5216
5219
  key: 0,
5217
5220
  anchor: s.value,
5218
5221
  state: e.state,
5219
5222
  "recent-styles": u.value,
5220
- "z-index": q(at).RICHTEXT_FLOAT,
5223
+ "z-index": U(at).RICHTEXT_FLOAT,
5221
5224
  onSelect: R,
5222
5225
  onClose: d[5] || (d[5] = (b) => r.value = "")
5223
- }, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : U("", !0)
5224
- ], 36)) : U("", !0)
5226
+ }, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : F("", !0)
5227
+ ], 36)) : F("", !0)
5225
5228
  ]),
5226
5229
  _: 1
5227
5230
  })
5228
5231
  ]));
5229
5232
  }
5230
- }, Fu = { class: "re-gutter" }, qu = ["title"], Uu = ["title", "aria-label"], $n = 22, _n = 24, Vu = 4, nr = 10, Pn = 16, Gu = 22, Ku = 4, or = 48, rr = 10, Xu = 16, ju = {
5233
+ }, Fu = { class: "re-gutter" }, qu = ["title"], Uu = ["title", "aria-label"], $n = 22, _n = 24, Vu = 4, or = 10, Pn = 16, Gu = 22, Ku = 4, rr = 48, ir = 10, Xu = 16, ju = {
5231
5234
  __name: "BlockHandle",
5232
5235
  props: {
5233
5236
  editor: { type: Object, default: null },
@@ -5246,9 +5249,9 @@ const Pu = {
5246
5249
  return Fe(n.probe);
5247
5250
  }
5248
5251
  const C = (w) => ({
5249
- left: `${l.value.left + ($n - nr) / 2}px`,
5252
+ left: `${l.value.left + ($n - or) / 2}px`,
5250
5253
  top: `${Math.max(0, l.value.top + (w === "before" ? -4 : _n + 2))}px`,
5251
- width: `${nr}px`
5254
+ width: `${or}px`
5252
5255
  }), d = j(() => ({
5253
5256
  left: `${l.value.left + ($n - Pn) / 2}px`,
5254
5257
  top: `${Math.max(0, l.value.top + (f.value === "before" ? -12 : _n - 4))}px`,
@@ -5306,12 +5309,12 @@ const Pu = {
5306
5309
  function ne() {
5307
5310
  i.value = !1, c.value = !1, f.value = "", m = null, T(null);
5308
5311
  }
5309
- function We() {
5312
+ function Ye() {
5310
5313
  E || u.value || (Y(), ee = window.setTimeout(() => {
5311
5314
  !E && !u.value && ne();
5312
5315
  }, 160));
5313
5316
  }
5314
- function Ye() {
5317
+ function Qe() {
5315
5318
  const w = n.editor, _ = m, v = f.value;
5316
5319
  !w || !_ || !v || (ne(), w.focus(), w.exec("insertBlockNear", _, v));
5317
5320
  }
@@ -5354,7 +5357,7 @@ const Pu = {
5354
5357
  const w = n.scrollEl;
5355
5358
  if (!w) return;
5356
5359
  const _ = w.getBoundingClientRect();
5357
- y.y < _.top + or ? w.scrollTop -= rr : y.y > _.bottom - or && (w.scrollTop += rr);
5360
+ y.y < _.top + rr ? w.scrollTop -= ir : y.y > _.bottom - rr && (w.scrollTop += ir);
5358
5361
  }
5359
5362
  function Bn() {
5360
5363
  const w = n.scrollEl;
@@ -5366,31 +5369,31 @@ const Pu = {
5366
5369
  }
5367
5370
  const k = W(), x = n.domain === "block" ? n.editor?.blockAt(y.x, y.y) : null;
5368
5371
  if (x && x !== g && x.parentElement === g.parentElement && !x.contains(g) && !g.contains(x)) {
5369
- const Q = x.getBoundingClientRect();
5370
- if (Q.height > 0 && Q.width > 0) {
5371
- const se = Math.min(Q.width * 0.28, 72), Ze = y.x <= Q.left + se, Hn = y.x >= Q.right - se;
5372
- if (Ze || Hn) {
5373
- A = { mode: "super", ref: x, side: Ze ? "left" : "right" }, p.value = {
5372
+ const Z = x.getBoundingClientRect();
5373
+ if (Z.height > 0 && Z.width > 0) {
5374
+ const se = Math.min(Z.width * 0.28, 72), Je = y.x <= Z.left + se, Hn = y.x >= Z.right - se;
5375
+ if (Je || Hn) {
5376
+ A = { mode: "super", ref: x, side: Je ? "left" : "right" }, p.value = {
5374
5377
  visible: !0,
5375
5378
  vertical: !0,
5376
- left: ((Ze ? Q.left : Q.right) - k.x) / k.z - 1,
5377
- top: (Q.top - k.y) / k.z,
5379
+ left: ((Je ? Z.left : Z.right) - k.x) / k.z - 1,
5380
+ top: (Z.top - k.y) / k.z,
5378
5381
  width: 2,
5379
- height: Q.height / k.z
5382
+ height: Z.height / k.z
5380
5383
  };
5381
5384
  return;
5382
5385
  }
5383
5386
  }
5384
5387
  }
5385
- const ie = Array.from(g.parentElement.children).filter((Q) => Q !== g && !it(Q));
5386
- let oe = null, Le = !0, Be = 0, Qe = 0, Ct = 0;
5387
- for (const Q of ie) {
5388
- const se = Q.getBoundingClientRect();
5388
+ const ie = Array.from(g.parentElement.children).filter((Z) => Z !== g && !it(Z));
5389
+ let oe = null, Le = !0, Be = 0, Ze = 0, Ct = 0;
5390
+ for (const Z of ie) {
5391
+ const se = Z.getBoundingClientRect();
5389
5392
  if (y.y < (se.top + se.bottom) / 2) {
5390
- oe = Q, Le = !0, Be = se.top, Qe = se.left, Ct = se.width;
5393
+ oe = Z, Le = !0, Be = se.top, Ze = se.left, Ct = se.width;
5391
5394
  break;
5392
5395
  }
5393
- oe = Q, Le = !1, Be = se.bottom, Qe = se.left, Ct = se.width;
5396
+ oe = Z, Le = !1, Be = se.bottom, Ze = se.left, Ct = se.width;
5394
5397
  }
5395
5398
  if (!oe) {
5396
5399
  O(), A = null;
@@ -5400,7 +5403,7 @@ const Pu = {
5400
5403
  A = Et ? null : { mode: "move", ref: oe, before: Le }, p.value = {
5401
5404
  visible: !Et,
5402
5405
  vertical: !1,
5403
- left: (Qe - k.x) / k.z - 2,
5406
+ left: (Ze - k.x) / k.z - 2,
5404
5407
  top: (Be - k.y) / k.z - 1,
5405
5408
  width: Ct / k.z + 4,
5406
5409
  height: 2
@@ -5425,10 +5428,10 @@ const Pu = {
5425
5428
  window.removeEventListener("mousemove", pt), window.removeEventListener("mouseup", Vt), bt?.(), bt = null;
5426
5429
  }
5427
5430
  function yt(w) {
5428
- w && (w.addEventListener("mousemove", Ee), w.addEventListener("mouseleave", We));
5431
+ w && (w.addEventListener("mousemove", Ee), w.addEventListener("mouseleave", Ye));
5429
5432
  }
5430
5433
  function kt(w) {
5431
- w && (w.removeEventListener("mousemove", Ee), w.removeEventListener("mouseleave", We));
5434
+ w && (w.removeEventListener("mousemove", Ee), w.removeEventListener("mouseleave", Ye));
5432
5435
  }
5433
5436
  return Ie(
5434
5437
  () => n.scrollEl,
@@ -5444,7 +5447,7 @@ const Pu = {
5444
5447
  ref_key: "iconRef",
5445
5448
  ref: r,
5446
5449
  class: "re-gutter__icon",
5447
- style: Z({ left: `${l.value.left}px`, top: `${l.value.top}px` }),
5450
+ style: J({ left: `${l.value.left}px`, top: `${l.value.top}px` }),
5448
5451
  title: a.value,
5449
5452
  onMousedown: Nn,
5450
5453
  onContextmenu: te(mt, ["prevent"])
@@ -5453,48 +5456,48 @@ const Pu = {
5453
5456
  name: s.value,
5454
5457
  size: 16
5455
5458
  }, null, 8, ["name"])
5456
- ], 44, qu)) : U("", !0),
5459
+ ], 44, qu)) : F("", !0),
5457
5460
  c.value && !u.value ? (N(), D("span", {
5458
5461
  key: 1,
5459
5462
  class: be(["re-gutter__line", { "is-hidden": f.value }]),
5460
- style: Z(C("before")),
5463
+ style: J(C("before")),
5461
5464
  "data-side": "before"
5462
- }, null, 6)) : U("", !0),
5465
+ }, null, 6)) : F("", !0),
5463
5466
  c.value && !u.value ? (N(), D("span", {
5464
5467
  key: 2,
5465
5468
  class: be(["re-gutter__line", { "is-hidden": f.value }]),
5466
- style: Z(C("after")),
5469
+ style: J(C("after")),
5467
5470
  "data-side": "after"
5468
- }, null, 6)) : U("", !0),
5471
+ }, null, 6)) : F("", !0),
5469
5472
  f.value && !u.value ? (N(), D("button", {
5470
5473
  key: f.value,
5471
5474
  type: "button",
5472
5475
  class: "re-gutter__plus",
5473
- style: Z(d.value),
5476
+ style: J(d.value),
5474
5477
  title: f.value === "before" ? "上方插入块" : "下方插入块",
5475
5478
  "aria-label": f.value === "before" ? "上方插入块" : "下方插入块",
5476
5479
  onMousedown: _[0] || (_[0] = te(() => {
5477
5480
  }, ["prevent"])),
5478
- onClick: Ye
5481
+ onClick: Qe
5479
5482
  }, [
5480
5483
  B(ve, {
5481
5484
  name: "plus",
5482
5485
  size: 16
5483
5486
  })
5484
- ], 44, Uu)) : U("", !0),
5487
+ ], 44, Uu)) : F("", !0),
5485
5488
  p.value.visible ? (N(), D("div", {
5486
5489
  key: 4,
5487
5490
  class: be(["re-gutter__indicator", { "is-vertical": p.value.vertical }]),
5488
- style: Z(b.value)
5489
- }, null, 6)) : U("", !0)
5491
+ style: J(b.value)
5492
+ }, null, 6)) : F("", !0)
5490
5493
  ]));
5491
5494
  }
5492
- }, Wu = /* @__PURE__ */ je(ju, [["__scopeId", "data-v-002b9bfb"]]), di = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
5495
+ }, Wu = /* @__PURE__ */ We(ju, [["__scopeId", "data-v-002b9bfb"]]), fi = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
5493
5496
  __name: "ContextMenu",
5494
5497
  setup(e) {
5495
- return (t, n) => (N(), J(q(qi), ro(io(t.$attrs)), null, 16));
5498
+ return (t, n) => (N(), Q(U(Ui), ro(io(t.$attrs)), null, 16));
5496
5499
  }
5497
- }), F = (e) => Bi(() => Ii(ve, { name: e, size: 15 })), Yu = {
5500
+ }), q = (e) => Ii(() => Hi(ve, { name: e, size: 15 })), Yu = {
5498
5501
  __name: "BlockMenu",
5499
5502
  props: {
5500
5503
  editor: { type: Object, default: null },
@@ -5526,7 +5529,7 @@ const Pu = {
5526
5529
  M && g.exec(M, A);
5527
5530
  }
5528
5531
  function E(h) {
5529
- o.editor && ii(o.editor, h, a.value);
5532
+ o.editor && li(o.editor, h, a.value);
5530
5533
  }
5531
5534
  function m({ x: h, y: g, block: A }) {
5532
5535
  if (!A) return;
@@ -5534,7 +5537,7 @@ const Pu = {
5534
5537
  const M = eu.flatMap((L, R) => {
5535
5538
  const z = L.map(($) => ({
5536
5539
  label: $.title,
5537
- icon: F(`rte-${$.icon}`),
5540
+ icon: q(`rte-${$.icon}`),
5538
5541
  shortcut: $.shortcut,
5539
5542
  danger: $.danger,
5540
5543
  disabled: !u($.key),
@@ -5546,9 +5549,9 @@ const Pu = {
5546
5549
  {
5547
5550
  label: "转换为",
5548
5551
  // blockOnly 项(高亮块/超级块)只在 block 档出现:Word/docx 等 basic 档不暴露
5549
- children: ri.filter((L) => !L.blockOnly || o.domain === "block").map((L) => ({
5552
+ children: ii.filter((L) => !L.blockOnly || o.domain === "block").map((L) => ({
5550
5553
  label: L.title,
5551
- icon: F(`rte-${L.icon}`),
5554
+ icon: q(`rte-${L.icon}`),
5552
5555
  shortcut: L.shortcut,
5553
5556
  checked: iu(o.editor, L.key, A) || void 0,
5554
5557
  onClick: () => E(L.key)
@@ -5557,18 +5560,18 @@ const Pu = {
5557
5560
  { divided: !0 },
5558
5561
  // 超级块列操作(block 档专属):目标为超级块时给出 加列/删列
5559
5562
  ...o.domain === "block" && A.hasAttribute(fe) ? [
5560
- { label: "添加一列", icon: F("rte-colRight"), onClick: () => o.editor?.exec("addColumn", A) },
5561
- { label: "删除一列", icon: F("rte-colDelete"), onClick: () => o.editor?.exec("removeColumn", A) },
5563
+ { label: "添加一列", icon: q("rte-colRight"), onClick: () => o.editor?.exec("addColumn", A) },
5564
+ { label: "删除一列", icon: q("rte-colDelete"), onClick: () => o.editor?.exec("removeColumn", A) },
5562
5565
  { divided: !0 }
5563
5566
  ] : [],
5564
5567
  ...M,
5565
5568
  // 属性(block 档专属):块自定义属性走通用 AttrDialog 查看/设置,条目只把目标块交回宿主
5566
- ...o.domain === "block" ? [{ divided: !0 }, { label: "属性", icon: F("rte-shape"), onClick: () => r("attr", A) }] : []
5569
+ ...o.domain === "block" ? [{ divided: !0 }, { label: "属性", icon: q("rte-shape"), onClick: () => r("attr", A) }] : []
5567
5570
  ], i.value = !0;
5568
5571
  }
5569
5572
  return t({ open: m, close: () => {
5570
5573
  i.value = !1;
5571
- } }), (h, g) => (N(), J(di, {
5574
+ } }), (h, g) => (N(), Q(fi, {
5572
5575
  visible: i.value,
5573
5576
  position: l.value,
5574
5577
  items: s.value,
@@ -5602,17 +5605,17 @@ const Pu = {
5602
5605
  { op: "table", key: "valignBottom", title: "底部对齐", group: 2 },
5603
5606
  { op: "table", key: "valignDefault", title: "使用默认垂直对齐", group: 2 }
5604
5607
  ], ed = [
5605
- { op: "inline", command: "toggleBold", title: "加粗", toggle: !0, icon: F("rte-bold"), group: 0 },
5606
- { op: "inline", command: "toggleItalic", title: "斜体", toggle: !0, icon: F("rte-italic"), group: 0 },
5607
- { op: "inline", command: "toggleUnderline", title: "下划线", toggle: !0, icon: F("rte-underline"), group: 0 },
5608
- { op: "inline", command: "toggleStrike", title: "删除线", toggle: !0, icon: F("rte-strike"), group: 0 },
5609
- { op: "inline", command: "toggleCode", title: "行内代码", toggle: !0, icon: F("rte-code"), group: 0 },
5610
- { op: "inline", command: "toggleSuperscript", title: "上标", toggle: !0, icon: F("rte-superscript"), group: 1 },
5611
- { op: "inline", command: "toggleSubscript", title: "下标", toggle: !0, icon: F("rte-subscript"), group: 1 },
5608
+ { op: "inline", command: "toggleBold", title: "加粗", toggle: !0, icon: q("rte-bold"), group: 0 },
5609
+ { op: "inline", command: "toggleItalic", title: "斜体", toggle: !0, icon: q("rte-italic"), group: 0 },
5610
+ { op: "inline", command: "toggleUnderline", title: "下划线", toggle: !0, icon: q("rte-underline"), group: 0 },
5611
+ { op: "inline", command: "toggleStrike", title: "删除线", toggle: !0, icon: q("rte-strike"), group: 0 },
5612
+ { op: "inline", command: "toggleCode", title: "行内代码", toggle: !0, icon: q("rte-code"), group: 0 },
5613
+ { op: "inline", command: "toggleSuperscript", title: "上标", toggle: !0, icon: q("rte-superscript"), group: 1 },
5614
+ { op: "inline", command: "toggleSubscript", title: "下标", toggle: !0, icon: q("rte-subscript"), group: 1 },
5612
5615
  { divided: !0, group: 2 },
5613
5616
  { op: "inline", command: "unsetColor", title: "默认颜色", group: 2 },
5614
5617
  // [设计] 调色板取 core/constants/textStyles 的唯一一张表,不在表格域另建第二份
5615
- ...Ui.map((e) => ({ op: "inline", command: "setColor", args: [e], title: e, colorDot: e, group: 2 }))
5618
+ ...Vi.map((e) => ({ op: "inline", command: "setColor", args: [e], title: e, colorDot: e, group: 2 }))
5616
5619
  ], td = Qu.map((e, t) => ({
5617
5620
  op: "table",
5618
5621
  key: "cellShade",
@@ -5621,31 +5624,31 @@ const Pu = {
5621
5624
  colorDot: e.value || void 0,
5622
5625
  group: t
5623
5626
  })), nd = [
5624
- { op: "table", key: "resetColumnWidth", title: "使用默认列宽", group: 0, icon: F("rte-resetWidth") },
5625
- { op: "table", key: "pinHeader", title: "固定表头", group: 1, toggle: !0, icon: F("rte-pinHead") },
5626
- { op: "table", key: "toggleHeaderRow", title: "标题行", group: 1, toggle: !0, icon: F("rte-table") },
5627
- { op: "table", key: "toggleHeaderColumn", title: "标题列", group: 1, toggle: !0, icon: F("rte-column") },
5628
- { op: "table", key: "transpose", title: "行列转置", group: 2, icon: F("rte-transpose") },
5627
+ { op: "table", key: "resetColumnWidth", title: "使用默认列宽", group: 0, icon: q("rte-resetWidth") },
5628
+ { op: "table", key: "pinHeader", title: "固定表头", group: 1, toggle: !0, icon: q("rte-pinHead") },
5629
+ { op: "table", key: "toggleHeaderRow", title: "标题行", group: 1, toggle: !0, icon: q("rte-table") },
5630
+ { op: "table", key: "toggleHeaderColumn", title: "标题列", group: 1, toggle: !0, icon: q("rte-column") },
5631
+ { op: "table", key: "transpose", title: "行列转置", group: 2, icon: q("rte-transpose") },
5629
5632
  { op: "table", key: "moveRowUp", title: "向上移", group: 3, icon: "ArrowUp" },
5630
5633
  { op: "table", key: "moveRowDown", title: "向下移", group: 3, icon: "ArrowDown" },
5631
5634
  { op: "table", key: "moveColumnLeft", title: "向左移", group: 3, icon: "ArrowLeft" },
5632
5635
  { op: "table", key: "moveColumnRight", title: "向右移", group: 3, icon: "ArrowRight" },
5633
5636
  // [设计] 合并/拆分只在「更多」里出现(对应思源把 cancelMerged 收进 otherMenus):单格态没有框选,
5634
5637
  // 顶层挂一个合并项多半是禁用死项,收进「更多」既保留「拆分已合并格」能力又不占主面。
5635
- { op: "table", key: "mergeOrSplit", title: "合并 / 拆分单元格", group: 4, icon: F("rte-mergeCells") }
5636
- ], fi = (e) => ({ op: "menu", title: "字体效果", group: e, children: ed, icon: F("rte-colorIcon") }), hi = (e) => ({ op: "menu", title: "背景颜色", group: e, children: td, icon: F("rte-bgIcon") }), mi = (e) => ({ op: "menu", title: "对齐方式", group: e, children: Ju, icon: F("rte-alignLeft") }), pi = (e) => ({ op: "menu", title: "更多", group: e, children: nd, icon: "MoreFilled" }), gi = (e) => [
5637
- { op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: e, icon: F("rte-copy") },
5638
+ { op: "table", key: "mergeOrSplit", title: "合并 / 拆分单元格", group: 4, icon: q("rte-mergeCells") }
5639
+ ], hi = (e) => ({ op: "menu", title: "字体效果", group: e, children: ed, icon: q("rte-colorIcon") }), mi = (e) => ({ op: "menu", title: "背景颜色", group: e, children: td, icon: q("rte-bgIcon") }), pi = (e) => ({ op: "menu", title: "对齐方式", group: e, children: Ju, icon: q("rte-alignLeft") }), gi = (e) => ({ op: "menu", title: "更多", group: e, children: nd, icon: "MoreFilled" }), vi = (e) => [
5640
+ { op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: e, icon: q("rte-copy") },
5638
5641
  { op: "clip", key: "pasteKeepFormat", title: "粘贴并保留源格式", group: e },
5639
5642
  { op: "clip", key: "pasteText", title: "粘贴为纯文本", shortcut: "Ctrl+Shift+V", group: e }
5640
- ], vi = (e) => ({ op: "table", key: "selectAll", title: "全选", shortcut: "Ctrl+A", group: e, icon: F("rte-table") }), bi = (e) => [
5641
- { op: "table", key: "insertRowBefore", title: "在上方插入", unit: "行", input: "rows", group: e, icon: F("rte-rowAbove") },
5642
- { op: "table", key: "insertRowAfter", title: "在下方插入", unit: "行", input: "rows", group: e, icon: F("rte-rowBelow") },
5643
- { op: "table", key: "insertColumnBefore", title: "在左侧插入", unit: "列", input: "cols", group: e, icon: F("rte-colLeft") },
5644
- { op: "table", key: "insertColumnAfter", title: "在右侧插入", unit: "列", input: "cols", group: e, icon: F("rte-colRight") }
5645
- ], yi = (e) => [
5643
+ ], bi = (e) => ({ op: "table", key: "selectAll", title: "全选", shortcut: "Ctrl+A", group: e, icon: q("rte-table") }), yi = (e) => [
5644
+ { op: "table", key: "insertRowBefore", title: "在上方插入", unit: "行", input: "rows", group: e, icon: q("rte-rowAbove") },
5645
+ { op: "table", key: "insertRowAfter", title: "在下方插入", unit: "行", input: "rows", group: e, icon: q("rte-rowBelow") },
5646
+ { op: "table", key: "insertColumnBefore", title: "在左侧插入", unit: "列", input: "cols", group: e, icon: q("rte-colLeft") },
5647
+ { op: "table", key: "insertColumnAfter", title: "在右侧插入", unit: "列", input: "cols", group: e, icon: q("rte-colRight") }
5648
+ ], ki = (e) => [
5646
5649
  { op: "table", key: "deleteRow", title: "删除行", shortcut: "Ctrl+-", group: e, icon: "Delete" },
5647
5650
  { op: "table", key: "deleteColumn", title: "删除列", shortcut: "Ctrl+Shift+-", group: e, icon: "Delete" }
5648
- ], ki = (e) => ({ op: "table", key: "deleteTable", title: "删除表格", group: e, danger: !0, icon: "DeleteFilled" });
5651
+ ], Ci = (e) => ({ op: "table", key: "deleteTable", title: "删除表格", group: e, danger: !0, icon: "DeleteFilled" });
5649
5652
  function od(e) {
5650
5653
  return e ? rd(e.rect) ? sd() : ad(e) ? ld() : id() : [];
5651
5654
  }
@@ -5654,56 +5657,56 @@ function rd(e) {
5654
5657
  }
5655
5658
  function id() {
5656
5659
  return [
5657
- ...gi(0),
5658
- vi(1),
5659
- ...bi(2),
5660
- ...yi(3),
5661
- pi(4),
5662
- ki(5)
5660
+ ...vi(0),
5661
+ bi(1),
5662
+ ...yi(2),
5663
+ ...ki(3),
5664
+ gi(4),
5665
+ Ci(5)
5663
5666
  ];
5664
5667
  }
5665
5668
  function ld() {
5666
5669
  return [
5667
- Ci(0),
5668
5670
  Ei(0),
5669
5671
  Ai(0),
5672
+ Ti(0),
5670
5673
  { op: "clip", key: "cut", title: "剪切", shortcut: "Ctrl+X", group: 0 },
5671
- { op: "table", key: "clearCell", title: "删除", group: 0, icon: F("rte-clear") },
5672
- ...gi(1),
5673
- vi(2),
5674
- fi(3),
5674
+ { op: "table", key: "clearCell", title: "删除", group: 0, icon: q("rte-clear") },
5675
+ ...vi(1),
5676
+ bi(2),
5675
5677
  hi(3),
5676
- mi(4),
5677
- ...bi(5),
5678
- ...yi(6),
5679
- pi(7),
5680
- ki(8)
5678
+ mi(3),
5679
+ pi(4),
5680
+ ...yi(5),
5681
+ ...ki(6),
5682
+ gi(7),
5683
+ Ci(8)
5681
5684
  ];
5682
5685
  }
5683
5686
  function sd() {
5684
5687
  return [
5685
- Ci(0),
5686
5688
  Ei(0),
5687
5689
  Ai(0),
5690
+ Ti(0),
5688
5691
  { op: "clip", key: "cut", title: "剪切", shortcut: "Ctrl+X", group: 0 },
5689
5692
  { op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: 0 },
5690
- { op: "table", key: "clearCell", title: "清空", group: 0, danger: !0, icon: F("rte-clear") },
5691
- fi(1),
5693
+ { op: "table", key: "clearCell", title: "清空", group: 0, danger: !0, icon: q("rte-clear") },
5692
5694
  hi(1),
5693
- mi(2),
5695
+ mi(1),
5696
+ pi(2),
5694
5697
  { op: "table", key: "deleteRow", title: "删除行", group: 3, icon: "Delete" },
5695
5698
  { op: "table", key: "deleteColumn", title: "删除列", group: 3, icon: "Delete" },
5696
- { op: "table", key: "mergeOrSplit", title: "合并单元格", group: 4, icon: F("rte-mergeCells") }
5699
+ { op: "table", key: "mergeOrSplit", title: "合并单元格", group: 4, icon: q("rte-mergeCells") }
5697
5700
  ];
5698
5701
  }
5699
- const Ci = (e) => ({ op: "clip", key: "copy", title: "复制", shortcut: "Ctrl+C", group: e, icon: F("rte-copy") }), Ei = (e) => ({ op: "clip", key: "copyRich", title: "复制富文本/HTML", group: e }), Ai = (e) => ({ op: "clip", key: "copyText", title: "复制纯文本", group: e });
5702
+ const Ei = (e) => ({ op: "clip", key: "copy", title: "复制", shortcut: "Ctrl+C", group: e, icon: q("rte-copy") }), Ai = (e) => ({ op: "clip", key: "copyRich", title: "复制富文本/HTML", group: e }), Ti = (e) => ({ op: "clip", key: "copyText", title: "复制纯文本", group: e });
5700
5703
  function ad(e) {
5701
5704
  const { rect: t, grid: n } = e;
5702
5705
  if (t.r1 !== t.r2 || t.c1 !== t.c2) return !0;
5703
5706
  const o = e.cell || n.matrix[t.r1]?.[t.c1]?.el;
5704
- return !!o && !Xr(o);
5707
+ return !!o && !jr(o);
5705
5708
  }
5706
- function Ti(e, t = {}) {
5709
+ function Si(e, t = {}) {
5707
5710
  const { state: n = null, can: o = () => !0, active: r = () => !1, run: i = () => {
5708
5711
  } } = t, l = [];
5709
5712
  let s = null;
@@ -5713,7 +5716,7 @@ function Ti(e, t = {}) {
5713
5716
  continue;
5714
5717
  }
5715
5718
  const c = { label: a.title, danger: a.danger || void 0, disabled: !o(a) };
5716
- a.icon && (c.icon = a.icon), a.colorDot && (c.colorDot = a.colorDot), a.shortcut && (c.shortcut = a.shortcut), s !== null && a.group !== s && (c.divided = !0), s = a.group, a.children ? c.children = Ti(a.children, t) : (a.input ? c.input = { min: 1, max: Ao, defaultValue: 1, unit: a.unit || "" } : a.toggle && (c.checked = a.command ? !!n?.[Zu[a.command]] : r(a)), c.onClick = (f, u) => i(a, c, u)), l.push(c);
5719
+ a.icon && (c.icon = a.icon), a.colorDot && (c.colorDot = a.colorDot), a.shortcut && (c.shortcut = a.shortcut), s !== null && a.group !== s && (c.divided = !0), s = a.group, a.children ? c.children = Si(a.children, t) : (a.input ? c.input = { min: 1, max: Ao, defaultValue: 1, unit: a.unit || "" } : a.toggle && (c.checked = a.command ? !!n?.[Zu[a.command]] : r(a)), c.onClick = (f, u) => i(a, c, u)), l.push(c);
5717
5720
  }
5718
5721
  return l;
5719
5722
  }
@@ -5736,7 +5739,7 @@ const cd = {
5736
5739
  }
5737
5740
  function c({ x: f, y: u, cell: p = null }) {
5738
5741
  const y = n.editor;
5739
- y && (p && !y.cellRect && y.exec("focusBlock", p), y.contextCell = p, i.value = Ti(od(y.tableContext()), {
5742
+ y && (p && !y.cellRect && y.exec("focusBlock", p), y.contextCell = p, i.value = Si(od(y.tableContext()), {
5740
5743
  state: y.state(),
5741
5744
  can: l,
5742
5745
  active: s,
@@ -5745,7 +5748,7 @@ const cd = {
5745
5748
  }
5746
5749
  return t({ open: c, close: () => {
5747
5750
  o.value = !1;
5748
- } }), (f, u) => (N(), J(di, {
5751
+ } }), (f, u) => (N(), Q(fi, {
5749
5752
  visible: o.value,
5750
5753
  position: r.value,
5751
5754
  items: i.value,
@@ -5753,7 +5756,7 @@ const cd = {
5753
5756
  "onUpdate:visible": u[0] || (u[0] = (p) => o.value = p)
5754
5757
  }, null, 8, ["visible", "position", "items"]));
5755
5758
  }
5756
- }, Si = {
5759
+ }, wi = {
5757
5760
  __name: "RichEditorCore",
5758
5761
  props: {
5759
5762
  /** HTML 正文(v-model) */
@@ -5824,7 +5827,7 @@ const cd = {
5824
5827
  return g ? (g.on(m, h), () => g.off(m, h)) : () => {
5825
5828
  };
5826
5829
  }
5827
- }), (m, h) => (N(), J(Fc, {
5830
+ }), (m, h) => (N(), Q(Fc, {
5828
5831
  ref_key: "surfaceRef",
5829
5832
  ref: r,
5830
5833
  "model-value": e.modelValue,
@@ -5838,7 +5841,8 @@ const cd = {
5838
5841
  onContextmenu: E
5839
5842
  }, {
5840
5843
  toolbar: re(({ editor: g, state: A }) => [
5841
- B(gu, {
5844
+ e.readOnly ? F("", !0) : (N(), Q(gu, {
5845
+ key: 0,
5842
5846
  editor: g,
5843
5847
  state: A
5844
5848
  }, {
@@ -5860,46 +5864,49 @@ const cd = {
5860
5864
  de(m.$slots, "toolbar-extra")
5861
5865
  ]),
5862
5866
  _: 3
5863
- }, 8, ["editor", "state"])
5867
+ }, 8, ["editor", "state"]))
5864
5868
  ]),
5865
5869
  gutter: re(({ editor: g, scrollEl: A, probe: M }) => [
5866
- B(Wu, {
5870
+ e.readOnly ? F("", !0) : (N(), Q(Wu, {
5871
+ key: 0,
5867
5872
  editor: g,
5868
5873
  "scroll-el": A,
5869
5874
  probe: M,
5870
5875
  domain: e.domain,
5871
5876
  onMenu: y
5872
- }, null, 8, ["editor", "scroll-el", "probe", "domain"])
5877
+ }, null, 8, ["editor", "scroll-el", "probe", "domain"]))
5873
5878
  ]),
5874
5879
  floaters: re(({ editor: g, state: A }) => [
5875
- B(q(Vi), {
5880
+ B(U(Gi), {
5876
5881
  ref_key: "findBarRef",
5877
5882
  ref: s,
5878
5883
  engine: g
5879
5884
  }, null, 8, ["engine"]),
5880
- B(Su, {
5881
- editor: g,
5882
- "open-image": p,
5883
- domain: e.domain
5884
- }, null, 8, ["editor", "domain"]),
5885
- B(Pu, {
5886
- ref_key: "bubbleRef",
5887
- ref: a,
5888
- editor: g,
5889
- state: A
5890
- }, null, 8, ["editor", "state"]),
5891
- B(Yu, {
5892
- ref_key: "blockMenuRef",
5893
- ref: i,
5894
- editor: g,
5895
- domain: e.domain,
5896
- onAttr: h[1] || (h[1] = (M) => o("block-attr", M))
5897
- }, null, 8, ["editor", "domain"]),
5898
- B(cd, {
5899
- ref_key: "tableMenuRef",
5900
- ref: l,
5901
- editor: g
5902
- }, null, 8, ["editor"]),
5885
+ e.readOnly ? F("", !0) : (N(), D(Ue, { key: 0 }, [
5886
+ B(Su, {
5887
+ editor: g,
5888
+ "open-image": p,
5889
+ domain: e.domain
5890
+ }, null, 8, ["editor", "domain"]),
5891
+ B(Pu, {
5892
+ ref_key: "bubbleRef",
5893
+ ref: a,
5894
+ editor: g,
5895
+ state: A
5896
+ }, null, 8, ["editor", "state"]),
5897
+ B(Yu, {
5898
+ ref_key: "blockMenuRef",
5899
+ ref: i,
5900
+ editor: g,
5901
+ domain: e.domain,
5902
+ onAttr: h[1] || (h[1] = (M) => o("block-attr", M))
5903
+ }, null, 8, ["editor", "domain"]),
5904
+ B(cd, {
5905
+ ref_key: "tableMenuRef",
5906
+ ref: l,
5907
+ editor: g
5908
+ }, null, 8, ["editor"])
5909
+ ], 64)),
5903
5910
  de(m.$slots, "floaters-extra", {
5904
5911
  editor: g,
5905
5912
  state: A
@@ -5923,7 +5930,7 @@ const cd = {
5923
5930
  },
5924
5931
  emits: ["update:modelValue"],
5925
5932
  setup(e, { expose: t, emit: n }) {
5926
- const o = Hi(() => import("./AttrDialog-sJCC1PIK.js")), r = e, i = n, l = S(null), s = S(null), a = j(() => r.height ? `${r.height}px` : "100%"), c = j(() => Gi(r.modelValue || "")), { images: f, index: u, openAt: p, close: y } = ti(), E = (b) => {
5933
+ const o = zi(() => import("./AttrDialog-B9-e8HIE.js")), r = e, i = n, l = S(null), s = S(null), a = j(() => r.height ? `${r.height}px` : "100%"), c = j(() => Ki(r.modelValue || "")), { images: f, index: u, openAt: p, close: y } = ni(), E = (b) => {
5927
5934
  const T = b.target.closest?.("img");
5928
5935
  T && p(s.value, T);
5929
5936
  }, m = S(!1), h = S({}), g = S("");
@@ -5964,7 +5971,7 @@ const cd = {
5964
5971
  }), (b, T) => (N(), D("div", {
5965
5972
  class: be(["gb-rte", { "is-fill": !e.height }])
5966
5973
  }, [
5967
- e.mode === "edit" ? (N(), J(Si, {
5974
+ e.mode === "edit" ? (N(), Q(wi, {
5968
5975
  key: 0,
5969
5976
  ref_key: "coreRef",
5970
5977
  ref: l,
@@ -5975,7 +5982,7 @@ const cd = {
5975
5982
  domain: e.domain,
5976
5983
  "onUpdate:modelValue": T[0] || (T[0] = (O) => i("update:modelValue", O)),
5977
5984
  onBlockAttr: M
5978
- }, zi({ _: 2 }, [
5985
+ }, Di({ _: 2 }, [
5979
5986
  b.$slots["toolbar-extra"] ? {
5980
5987
  name: "toolbar-extra",
5981
5988
  fn: re(() => [
@@ -5998,18 +6005,18 @@ const cd = {
5998
6005
  ref_key: "viewRef",
5999
6006
  ref: s,
6000
6007
  class: "gb-rte__view rich-text-content gb-scroll-thin",
6001
- style: Z(e.height ? { maxHeight: `${e.height}px` } : void 0),
6008
+ style: J(e.height ? { maxHeight: `${e.height}px` } : void 0),
6002
6009
  innerHTML: c.value,
6003
6010
  onClick: E
6004
6011
  }, null, 12, ud)),
6005
- q(f).length ? (N(), J(ei, {
6012
+ U(f).length ? (N(), Q(ti, {
6006
6013
  key: 2,
6007
- images: q(f),
6008
- "initial-index": q(u),
6014
+ images: U(f),
6015
+ "initial-index": U(u),
6009
6016
  onSwitch: T[1] || (T[1] = (O) => u.value = O),
6010
- onClose: q(y)
6011
- }, null, 8, ["images", "initial-index", "onClose"])) : U("", !0),
6012
- m.value && e.mode === "edit" ? (N(), J(q(o), {
6017
+ onClose: U(y)
6018
+ }, null, 8, ["images", "initial-index", "onClose"])) : F("", !0),
6019
+ m.value && e.mode === "edit" ? (N(), Q(U(o), {
6013
6020
  key: 3,
6014
6021
  scene: "richtext_attr",
6015
6022
  title: "块属性",
@@ -6017,16 +6024,20 @@ const cd = {
6017
6024
  attrs: h.value,
6018
6025
  onUpdate: L,
6019
6026
  onClose: R
6020
- }, null, 8, ["subtitle", "attrs"])) : U("", !0)
6027
+ }, null, 8, ["subtitle", "attrs"])) : F("", !0)
6021
6028
  ], 2));
6022
6029
  }
6023
- }, fd = /* @__PURE__ */ je(dd, [["__scopeId", "data-v-2d725fe4"]]), hd = (e) => {
6024
- e.component("GbRichTextEditor", fd), e.component("GbRichEditorCore", Si);
6025
- }, gd = { install: hd, version: "0.1.0" };
6030
+ }, fd = /* @__PURE__ */ We(dd, [["__scopeId", "data-v-2d725fe4"]]), hd = (e) => {
6031
+ e.component("GbRichTextEditor", fd), e.component("GbRichEditorCore", wi);
6032
+ }, gd = { install: hd, version: "0.1.2" };
6026
6033
  export {
6027
6034
  fd as G,
6028
- je as _,
6035
+ We as _,
6029
6036
  ve as a,
6030
- Si as b,
6031
- gd as i
6037
+ wi as b,
6038
+ X as c,
6039
+ so as d,
6040
+ ae as e,
6041
+ gd as i,
6042
+ V as r
6032
6043
  };