xiaodao-editor 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var pc = Object.defineProperty;
2
2
  var hc = (e, t, n) => t in e ? pc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var It = (e, t, n) => hc(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { inject as Zn, ref as j, defineComponent as Ft, shallowRef as ur, onMounted as oo, watch as Tt, openBlock as Z, createElementBlock as te, withModifiers as ie, unref as fe, provide as so, computed as Me, nextTick as qe, onBeforeUnmount as Ln, normalizeStyle as rn, normalizeClass as ze, createElementVNode as C, withKeys as no, createStaticVNode as ji, createBlock as mn, createCommentVNode as De, resolveDynamicComponent as gc, resolveComponent as bc, Fragment as rt, renderList as bn, createVNode as gn, Teleport as $n, toDisplayString as Rt, reactive as Sn, withDirectives as bo, vShow as _r, mergeProps as mc, vModelText as Hr, useAttrs as Qi, h as ve, watchEffect as vc } from "vue";
4
+ import { inject as Zn, ref as j, defineComponent as Ft, shallowRef as ur, onMounted as oo, watch as Tt, openBlock as Z, createElementBlock as te, withModifiers as ie, unref as fe, provide as so, computed as Me, nextTick as qe, onBeforeUnmount as Bn, normalizeStyle as rn, normalizeClass as ze, createElementVNode as C, withKeys as no, createStaticVNode as ji, createBlock as mn, createCommentVNode as De, resolveDynamicComponent as gc, resolveComponent as bc, Fragment as rt, renderList as bn, createVNode as gn, Teleport as Pn, toDisplayString as Rt, reactive as An, withDirectives as bo, vShow as _r, mergeProps as mc, vModelText as Hr, useAttrs as Qi, h as ve, watchEffect as vc } from "vue";
5
5
  function X3(e) {
6
6
  return typeof e == "string" && e.length > 0;
7
7
  }
@@ -265,7 +265,7 @@ function Sc(e) {
265
265
  function Wt(e, t) {
266
266
  return e.blocks.get(t);
267
267
  }
268
- function Nn(e, t) {
268
+ function Rn(e, t) {
269
269
  const n = e.blocks.get(t);
270
270
  if (!n) throw new Error(`BlockEditor: unknown block ${t}`);
271
271
  return n;
@@ -289,11 +289,11 @@ function mr(e, t) {
289
289
  const o = e.blocks.get(n);
290
290
  return o ? o.children : e.root;
291
291
  }
292
- function Rn(e, t) {
292
+ function Ln(e, t) {
293
293
  return mr(e, t).indexOf(t);
294
294
  }
295
295
  function es(e, t) {
296
- const n = Rn(e, t);
296
+ const n = Ln(e, t);
297
297
  if (n <= 0) return;
298
298
  const o = mr(e, t);
299
299
  return e.blocks.get(o[n - 1]);
@@ -324,7 +324,7 @@ function vr(e, t) {
324
324
  return e.blocks.get(n[o + 1]);
325
325
  }
326
326
  function Ac(e, t) {
327
- const n = Nn(e, t);
327
+ const n = Rn(e, t);
328
328
  if (n.children.length === 0) return n;
329
329
  const o = n.children[n.children.length - 1];
330
330
  return Ac(e, o);
@@ -565,7 +565,7 @@ function Dc(e, t) {
565
565
  op: "moveBlock",
566
566
  id: r.id,
567
567
  toParent: jt(t, r.id),
568
- toIndex: Rn(t, r.id)
568
+ toIndex: Ln(t, r.id)
569
569
  });
570
570
  break;
571
571
  }
@@ -589,11 +589,11 @@ function Dc(e, t) {
589
589
  }
590
590
  function $c(e, t) {
591
591
  const n = [], o = (r) => {
592
- const i = Nn(t, r);
592
+ const i = Rn(t, r);
593
593
  n.push({
594
594
  op: "insertBlock",
595
595
  parent: jt(t, r),
596
- index: Rn(t, r),
596
+ index: Ln(t, r),
597
597
  id: r,
598
598
  type: i.type,
599
599
  attrs: i.attrs,
@@ -674,7 +674,7 @@ function Xr(e) {
674
674
  return { blockId: t, offset: n };
675
675
  }
676
676
  const Tl = 10;
677
- function Bn(e, t, n) {
677
+ function On(e, t, n) {
678
678
  const o = t.peek();
679
679
  if (o.length === 0) return;
680
680
  const r = _l(e.doc, o), i = Ic(r.doc, n.registries.schema);
@@ -688,10 +688,10 @@ function Dr(e) {
688
688
  let s, c;
689
689
  if (t.after) {
690
690
  if (!Wt(n.doc, t.after)) return !1;
691
- s = jt(n.doc, t.after), c = Rn(n.doc, t.after) + 1;
691
+ s = jt(n.doc, t.after), c = Ln(n.doc, t.after) + 1;
692
692
  } else if (t.parent !== void 0) {
693
693
  s = t.parent;
694
- const u = s === null ? n.doc.root : Nn(n.doc, s).children;
694
+ const u = s === null ? n.doc.root : Rn(n.doc, s).children;
695
695
  c = t.index ?? u.length;
696
696
  } else
697
697
  s = null, c = n.doc.root.length;
@@ -711,9 +711,9 @@ function vl(e) {
711
711
  name: "removeBlock",
712
712
  run: (t) => (n, o) => {
713
713
  if (!Wt(n.doc, t.id)) return !1;
714
- const r = yo(n.doc, t.id), i = vr(n.doc, t.id), l = r ?? i, s = bt(), a = Nn(n.doc, t.id).children ?? [];
714
+ const r = yo(n.doc, t.id), i = vr(n.doc, t.id), l = r ?? i, s = bt(), a = Rn(n.doc, t.id).children ?? [];
715
715
  if (a.length > 0) {
716
- const d = jt(n.doc, t.id), u = Rn(n.doc, t.id);
716
+ const d = jt(n.doc, t.id), u = Ln(n.doc, t.id);
717
717
  if ((() => {
718
718
  if (!r) return !1;
719
719
  const p = e.registries.schema.get(r.type);
@@ -728,7 +728,7 @@ function vl(e) {
728
728
  s.moveBlock(f, d, p), p++;
729
729
  }
730
730
  }
731
- if (s.removeBlock(t.id), Bn(n, s, e), l) {
731
+ if (s.removeBlock(t.id), On(n, s, e), l) {
732
732
  const d = Fe(l.content);
733
733
  s.setSelection(yt(l.id, d.length));
734
734
  }
@@ -742,7 +742,7 @@ function Uc(e) {
742
742
  run: (t) => (n, o) => {
743
743
  if (!Wt(n.doc, t.id)) return !1;
744
744
  const i = t.attrs ?? e.registries.schema.defaultAttrsFor(t.type), l = bt();
745
- return l.replaceBlock(t.id, t.type, i), Bn(n, l, e), l.setSelection(yt(t.id, 0)), o == null || o(l.build()), !0;
745
+ return l.replaceBlock(t.id, t.type, i), On(n, l, e), l.setSelection(yt(t.id, 0)), o == null || o(l.build()), !0;
746
746
  }
747
747
  };
748
748
  }
@@ -772,7 +772,7 @@ function kl(e) {
772
772
  run: (t) => (n, o) => {
773
773
  const r = Wt(n.doc, t.id);
774
774
  if (!r || !e.registries.schema.hasText(r.type)) return !1;
775
- const i = Fe(r.content).length, l = Math.max(0, Math.min(t.offset, i)), [s, c] = pn(r.content, l), a = jt(n.doc, t.id), d = Rn(n.doc, t.id), u = r.children ?? [], h = t.asType ?? e.registries.defaultBlockType, p = t.asAttrs ?? e.registries.schema.defaultAttrsFor(h), f = bt();
775
+ const i = Fe(r.content).length, l = Math.max(0, Math.min(t.offset, i)), [s, c] = pn(r.content, l), a = jt(n.doc, t.id), d = Ln(n.doc, t.id), u = r.children ?? [], h = t.asType ?? e.registries.defaultBlockType, p = t.asAttrs ?? e.registries.schema.defaultAttrsFor(h), f = bt();
776
776
  f.setText(t.id, s);
777
777
  const m = f.insertBlock({
778
778
  parent: a,
@@ -784,7 +784,7 @@ function kl(e) {
784
784
  if (u.length > 0)
785
785
  for (let T = 0; T < u.length; T++)
786
786
  f.moveBlock(u[T], m, T);
787
- return Bn(n, f, e), f.setSelection(yt(m, 0)), o == null || o(f.build()), !0;
787
+ return On(n, f, e), f.setSelection(yt(m, 0)), o == null || o(f.build()), !0;
788
788
  }
789
789
  };
790
790
  }
@@ -800,7 +800,7 @@ function ts(e) {
800
800
  c.setText(i.id, s);
801
801
  const a = r.children ?? [];
802
802
  if (a.length > 0) {
803
- const d = jt(n.doc, t.id), u = Rn(n.doc, t.id), h = e.registries.schema.get(i.type);
803
+ const d = jt(n.doc, t.id), u = Ln(n.doc, t.id), h = e.registries.schema.get(i.type);
804
804
  if (!!(h != null && h.nestable) && ko(n.doc, i.id) < Tl) {
805
805
  let m = (i.children ?? []).length;
806
806
  for (const T of a)
@@ -811,7 +811,7 @@ function ts(e) {
811
811
  c.moveBlock(m, d, f), f++;
812
812
  }
813
813
  }
814
- return c.removeBlock(t.id), Bn(n, c, e), c.setSelection(yt(i.id, l.length)), o == null || o(c.build()), !0;
814
+ return c.removeBlock(t.id), On(n, c, e), c.setSelection(yt(i.id, l.length)), o == null || o(c.build()), !0;
815
815
  }
816
816
  };
817
817
  }
@@ -827,7 +827,7 @@ function Kc(e) {
827
827
  }
828
828
  return !1;
829
829
  }
830
- const i = Nn(t.doc, r.blockId), l = e.registries.schema.get(i.type);
830
+ const i = Rn(t.doc, r.blockId), l = e.registries.schema.get(i.type);
831
831
  if (!e.registries.schema.hasText(i.type))
832
832
  return Dr(e).run({ type: e.registries.defaultBlockType, after: i.id })(t, n);
833
833
  if (l.isolating) return !1;
@@ -845,11 +845,11 @@ function Wc(e) {
845
845
  const s = o.blockIds[0], c = yo(t.doc, s), a = bt();
846
846
  for (const u of o.blockIds) a.removeBlock(u);
847
847
  const d = c ?? vr(t.doc, o.blockIds[o.blockIds.length - 1]);
848
- return Bn(t, a, e), d && a.setSelection(yt(d.id, Fe(d.content).length)), n == null || n(a.build()), !0;
848
+ return On(t, a, e), d && a.setSelection(yt(d.id, Fe(d.content).length)), n == null || n(a.build()), !0;
849
849
  }
850
850
  const r = Xr(o);
851
851
  if (!r) return !1;
852
- const i = Nn(t.doc, r.blockId);
852
+ const i = Rn(t.doc, r.blockId);
853
853
  if (No(o) && !vi(o) && o.anchor.blockId === o.focus.blockId) {
854
854
  const [s, c] = o.anchor.offset <= o.focus.offset ? [o.anchor.offset, o.focus.offset] : [o.focus.offset, o.anchor.offset], a = Fe(i.content), d = Lo(a.slice(0, s) + a.slice(c)), u = bt();
855
855
  return u.setText(i.id, d), u.setSelection(yt(i.id, s)), u.skipDomWrite([i.id]), n == null || n(u.build()), !0;
@@ -859,11 +859,11 @@ function Wc(e) {
859
859
  if (c === -1 || a === -1) return !1;
860
860
  const [d, u] = c <= a ? [o.anchor, o.focus] : [o.focus, o.anchor], h = s.indexOf(d.blockId), p = s.indexOf(u.blockId);
861
861
  if (h === -1 || p === -1 || h >= p) return !1;
862
- const f = Nn(t.doc, d.blockId), m = Nn(t.doc, u.blockId), T = Fe(f.content).length, D = Fe(m.content).length, F = Math.min(d.offset, T), K = Math.min(u.offset, D), [oe] = pn(f.content, F), [, $] = pn(m.content, K), U = [...oe, ...$], ce = Fe(oe).length, G = bt();
862
+ const f = Rn(t.doc, d.blockId), m = Rn(t.doc, u.blockId), T = Fe(f.content).length, D = Fe(m.content).length, F = Math.min(d.offset, T), z = Math.min(u.offset, D), [oe] = pn(f.content, F), [, $] = pn(m.content, z), U = [...oe, ...$], ce = Fe(oe).length, G = bt();
863
863
  G.setText(d.blockId, U);
864
864
  for (let le = p; le > h; le--)
865
865
  G.removeBlock(s[le]);
866
- return G.setSelection(yt(d.blockId, ce)), Bn(t, G, e), n == null || n(G.build()), !0;
866
+ return G.setSelection(yt(d.blockId, ce)), On(t, G, e), n == null || n(G.build()), !0;
867
867
  }
868
868
  if (r.offset > 0) return !1;
869
869
  if (ko(t.doc, i.id) > 0)
@@ -923,7 +923,7 @@ function Zc() {
923
923
  run: () => (e, t) => {
924
924
  const n = ao(e.doc);
925
925
  if (n.length === 0) return !1;
926
- const o = n[0], r = n[n.length - 1], i = Nn(e.doc, r), l = Fe(i.content).length, s = {
926
+ const o = n[0], r = n[n.length - 1], i = Rn(e.doc, r), l = Fe(i.content).length, s = {
927
927
  kind: "text",
928
928
  anchor: { blockId: o, offset: 0 },
929
929
  focus: { blockId: r, offset: l }
@@ -959,7 +959,7 @@ function jc(e) {
959
959
  if (!(s != null && s.nestable)) return !1;
960
960
  }
961
961
  const i = bt();
962
- return i.moveBlock(t.id, t.toParent, t.toIndex), Bn(n, i, e), i.setSelection(yt(t.id, 0)), o == null || o(i.build()), !0;
962
+ return i.moveBlock(t.id, t.toParent, t.toIndex), On(n, i, e), i.setSelection(yt(t.id, 0)), o == null || o(i.build()), !0;
963
963
  }
964
964
  };
965
965
  }
@@ -979,7 +979,7 @@ function Ur(e) {
979
979
  "color" in h && (h.color = "default"), "bgColor" in h && (h.bgColor = "default"), l = h;
980
980
  }
981
981
  const a = n.selection.kind === "caret" && n.selection.blockId === t.id ? n.selection.offset : 0, d = bt();
982
- d.replaceBlock(t.id, t.type, l), c !== r.content && d.setText(t.id, c), Bn(n, d, e);
982
+ d.replaceBlock(t.id, t.type, l), c !== r.content && d.setText(t.id, c), On(n, d, e);
983
983
  const u = Fe(c).length;
984
984
  return d.setSelection(yt(t.id, Math.min(a, u))), o == null || o(d.build()), !0;
985
985
  }
@@ -991,8 +991,8 @@ function Qc(e) {
991
991
  run: (t) => (n, o) => {
992
992
  const r = yo(n.doc, t.id);
993
993
  if (!r) return !1;
994
- const i = jt(n.doc, r.id), s = (i === null ? n.doc.root : Nn(n.doc, i).children).indexOf(r.id), c = i, a = bt();
995
- return a.moveBlock(t.id, c, Math.max(0, s)), Bn(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
994
+ const i = jt(n.doc, r.id), s = (i === null ? n.doc.root : Rn(n.doc, i).children).indexOf(r.id), c = i, a = bt();
995
+ return a.moveBlock(t.id, c, Math.max(0, s)), On(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
996
996
  }
997
997
  };
998
998
  }
@@ -1002,8 +1002,8 @@ function Jc(e) {
1002
1002
  run: (t) => (n, o) => {
1003
1003
  const r = vr(n.doc, t.id);
1004
1004
  if (!r) return !1;
1005
- const i = jt(n.doc, t.id), l = i === null ? n.doc.root : Nn(n.doc, i).children, s = l.indexOf(r.id), c = i, a = bt(), d = l.indexOf(t.id), u = s > d ? s : s + 1;
1006
- return a.moveBlock(t.id, c, Math.max(0, Math.min(l.length, u))), Bn(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
1005
+ const i = jt(n.doc, t.id), l = i === null ? n.doc.root : Rn(n.doc, i).children, s = l.indexOf(r.id), c = i, a = bt(), d = l.indexOf(t.id), u = s > d ? s : s + 1;
1006
+ return a.moveBlock(t.id, c, Math.max(0, Math.min(l.length, u))), On(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
1007
1007
  }
1008
1008
  };
1009
1009
  }
@@ -1024,11 +1024,11 @@ function ea(e) {
1024
1024
  if (i.length === 0) return !1;
1025
1025
  const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = bt();
1026
1026
  for (const u of i) {
1027
- const h = Nn(n.doc, u.oldId);
1027
+ const h = Rn(n.doc, u.oldId);
1028
1028
  let p, f;
1029
1029
  if (u.oldId === t.id) {
1030
1030
  p = u.parentOldId;
1031
- const D = p === null ? n.doc.root : Nn(n.doc, p).children, F = D.indexOf(t.id);
1031
+ const D = p === null ? n.doc.root : Rn(n.doc, p).children, F = D.indexOf(t.id);
1032
1032
  f = F >= 0 ? F + 1 : D.length;
1033
1033
  } else {
1034
1034
  const D = u.parentOldId, F = s.get(D) ?? null;
@@ -1044,7 +1044,7 @@ function ea(e) {
1044
1044
  });
1045
1045
  s.set(u.oldId, T);
1046
1046
  }
1047
- Bn(n, a, e);
1047
+ On(n, a, e);
1048
1048
  const d = s.get(t.id) ?? null;
1049
1049
  return d && a.setSelection(yt(d, 0)), o == null || o(a.build()), !0;
1050
1050
  }
@@ -1112,7 +1112,7 @@ function la(e) {
1112
1112
  const l = es(n.doc, r);
1113
1113
  if (!l || !e.registries.schema.get(l.type).nestable || ko(n.doc, l.id) >= Tl) return !1;
1114
1114
  const c = l.id, a = l.children.length, d = bt();
1115
- return d.moveBlock(r, c, a), Bn(n, d, e), d.setSelection(yt(r, 0)), o == null || o(d.build()), !0;
1115
+ return d.moveBlock(r, c, a), On(n, d, e), d.setSelection(yt(r, 0)), o == null || o(d.build()), !0;
1116
1116
  }
1117
1117
  };
1118
1118
  }
@@ -1125,7 +1125,7 @@ function ns(e) {
1125
1125
  const l = jt(n.doc, r);
1126
1126
  if (l === null) return !1;
1127
1127
  const s = jt(n.doc, l), c = mr(n.doc, l), a = c.indexOf(l), d = a === -1 ? c.length : a + 1, u = bt();
1128
- return u.moveBlock(r, s, d), Bn(n, u, e), u.setSelection(yt(r, 0)), o == null || o(u.build()), !0;
1128
+ return u.moveBlock(r, s, d), On(n, u, e), u.setSelection(yt(r, 0)), o == null || o(u.build()), !0;
1129
1129
  }
1130
1130
  };
1131
1131
  }
@@ -1149,10 +1149,10 @@ function sa(e) {
1149
1149
  let a = 0;
1150
1150
  for (const m of r.content) {
1151
1151
  if (m.type !== "text") continue;
1152
- const T = (m.marks ?? []).map((oe) => ({ ...oe })), D = a, F = a + m.text.length, K = [D, F];
1153
- l > D && l < F && K.push(l), s > D && s < F && K.push(s), K.sort((oe, $) => oe - $);
1154
- for (let oe = 0; oe < K.length - 1; oe++) {
1155
- const $ = K[oe], U = K[oe + 1];
1152
+ const T = (m.marks ?? []).map((oe) => ({ ...oe })), D = a, F = a + m.text.length, z = [D, F];
1153
+ l > D && l < F && z.push(l), s > D && s < F && z.push(s), z.sort((oe, $) => oe - $);
1154
+ for (let oe = 0; oe < z.length - 1; oe++) {
1155
+ const $ = z[oe], U = z[oe + 1];
1156
1156
  $ >= U || c.push({
1157
1157
  text: m.text.slice($ - D, U - D),
1158
1158
  marks: T.map((ce) => ({ ...ce }))
@@ -1204,11 +1204,11 @@ function rs(e) {
1204
1204
  for (const p of r.content) {
1205
1205
  if (p.type !== "text") continue;
1206
1206
  const f = (p.marks ?? []).map((F) => ({ ...F })), m = a, T = a + p.text.length, D = [m, T];
1207
- l > m && l < T && D.push(l), s > m && s < T && D.push(s), D.sort((F, K) => F - K);
1207
+ l > m && l < T && D.push(l), s > m && s < T && D.push(s), D.sort((F, z) => F - z);
1208
1208
  for (let F = 0; F < D.length - 1; F++) {
1209
- const K = D[F], oe = D[F + 1];
1210
- K >= oe || c.push({
1211
- text: p.text.slice(K - m, oe - m),
1209
+ const z = D[F], oe = D[F + 1];
1210
+ z >= oe || c.push({
1211
+ text: p.text.slice(z - m, oe - m),
1212
1212
  marks: [...f]
1213
1213
  });
1214
1214
  }
@@ -2124,13 +2124,13 @@ function Ua(e) {
2124
2124
  for (; f != null && !m.has(f); )
2125
2125
  m.add(f), p++, f = r.get(f);
2126
2126
  if (p = Math.min(d, p), (typeof h.attrs.indent == "number" ? h.attrs.indent : 0) === p) continue;
2127
- const { indent: D, ...F } = h.attrs, K = p > 0 ? { ...F, indent: p } : F;
2128
- o.set(u, { ...h, attrs: K });
2127
+ const { indent: D, ...F } = h.attrs, z = p > 0 ? { ...F, indent: p } : F;
2128
+ o.set(u, { ...h, attrs: z });
2129
2129
  }
2130
2130
  return { id: "doc_" + Math.random().toString(36).slice(2, 10), root: i, blocks: o, parent: r };
2131
2131
  }
2132
2132
  const ss = Symbol("block-editor-mobile"), Ml = Symbol("block-editor-fixed-toolbar-bridge"), yr = Symbol("block-editor-fixed-toolbar-bottom"), cs = Symbol("block-editor"), as = Symbol("block-editor-editable"), us = Symbol("block-editor-image-upload");
2133
- function Pn() {
2133
+ function Hn() {
2134
2134
  const e = Zn(cs);
2135
2135
  if (!e)
2136
2136
  throw new Error("useEditor(): must be called within a <BlockEditor> component tree");
@@ -2270,7 +2270,7 @@ function Ga(e, t, n, o) {
2270
2270
  T.setStart(f, 0), T.setEnd(f, m);
2271
2271
  const D = T.getBoundingClientRect();
2272
2272
  if (D.width <= 0 && D.height <= 0) continue;
2273
- const F = Math.max(D.left, Math.min(e, D.right)), K = Math.max(D.top, Math.min(t, D.bottom)), oe = Math.hypot(e - F, t - K), $ = D.width > 0 ? Math.round((e - D.left) / D.width * m) : 0, U = u + Math.max(0, Math.min(m, $));
2273
+ const F = Math.max(D.left, Math.min(e, D.right)), z = Math.max(D.top, Math.min(t, D.bottom)), oe = Math.hypot(e - F, t - z), $ = D.width > 0 ? Math.round((e - D.left) / D.width * m) : 0, U = u + Math.max(0, Math.min(m, $));
2274
2274
  (!d || oe < d.dist) && (d = { offset: U, dist: oe }), u += m;
2275
2275
  }
2276
2276
  return d ? { blockEl: i, blockId: l, offset: Math.min(d.offset, a) } : { blockEl: i, blockId: l, offset: 0 };
@@ -2329,17 +2329,17 @@ function sl(e, t, n) {
2329
2329
  const m = Fe(p.content).length;
2330
2330
  let T = 0, D = m;
2331
2331
  if (u === c) {
2332
- const K = l === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
2333
- T = Math.min(K, m);
2332
+ const z = l === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
2333
+ T = Math.min(z, m);
2334
2334
  }
2335
2335
  if (u === a) {
2336
- const K = s === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
2337
- D = Math.min(K, m);
2336
+ const z = s === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
2337
+ D = Math.min(z, m);
2338
2338
  }
2339
2339
  const F = ds(f, T, Math.max(T, D));
2340
2340
  if (F)
2341
- for (const K of F.getClientRects())
2342
- K.width > 0 && K.height > 0 && d.push(K);
2341
+ for (const z of F.getClientRects())
2342
+ z.width > 0 && z.height > 0 && d.push(z);
2343
2343
  }
2344
2344
  return d;
2345
2345
  }
@@ -2421,20 +2421,20 @@ function $r(e) {
2421
2421
  for (; (h = tr.exec(c)) !== null; ) {
2422
2422
  const p = h[0], f = h[2], m = h.index + p.length - f.length, T = m + f.length;
2423
2423
  if (m > u) {
2424
- const K = c.slice(u, m);
2425
- K.length > 0 && n.push({
2424
+ const z = c.slice(u, m);
2425
+ z.length > 0 && n.push({
2426
2426
  type: "text",
2427
- text: K,
2427
+ text: z,
2428
2428
  marks: a.length > 0 ? [...a] : void 0
2429
2429
  });
2430
2430
  }
2431
2431
  const D = So(f), F = co(D);
2432
2432
  if (F) {
2433
- const K = { type: "link", attrs: { href: F } };
2433
+ const z = { type: "link", attrs: { href: F } };
2434
2434
  n.push({
2435
2435
  type: "text",
2436
2436
  text: f,
2437
- marks: [...a, K]
2437
+ marks: [...a, z]
2438
2438
  });
2439
2439
  } else
2440
2440
  n.push({
@@ -2503,7 +2503,7 @@ function tu(e) {
2503
2503
  }
2504
2504
  return t;
2505
2505
  }
2506
- function In(e) {
2506
+ function Nn(e) {
2507
2507
  const t = [];
2508
2508
  function n(o, r) {
2509
2509
  if (o.nodeType === Node.TEXT_NODE) {
@@ -2658,8 +2658,8 @@ function io(e, t, n, o, r) {
2658
2658
  }
2659
2659
  const F = (h = e.cells[T]) == null ? void 0 : h[D];
2660
2660
  if (!F || F.covered) continue;
2661
- const K = T + Math.max(1, F.rowspan) - 1, oe = D + Math.max(1, F.colspan) - 1;
2662
- i > T && (i = T, a = !0), l < K && (l = K, a = !0), s > D && (s = D, a = !0), c < oe && (c = oe, a = !0);
2661
+ const z = T + Math.max(1, F.rowspan) - 1, oe = D + Math.max(1, F.colspan) - 1;
2662
+ i > T && (i = T, a = !0), l < z && (l = z, a = !0), s > D && (s = D, a = !0), c < oe && (c = oe, a = !0);
2663
2663
  }
2664
2664
  }
2665
2665
  return { r1: i, c1: s, r2: l, c2: c };
@@ -2934,7 +2934,7 @@ function hu(e, t, n, o, r) {
2934
2934
  }
2935
2935
  d -= 1, u = e.cols - 1;
2936
2936
  }
2937
- const h = d >= 0 ? (ce = e.cells[d]) == null ? void 0 : ce[u] : void 0, p = h ? h.content.map((G) => ({ ...G })) : [], f = h == null ? void 0 : h.cellType, m = h == null ? void 0 : h.align, T = h == null ? void 0 : h.verticalAlign, D = h == null ? void 0 : h.bgColor, F = h == null ? void 0 : h.checked, K = h == null ? void 0 : h.startNumber;
2937
+ const h = d >= 0 ? (ce = e.cells[d]) == null ? void 0 : ce[u] : void 0, p = h ? h.content.map((G) => ({ ...G })) : [], f = h == null ? void 0 : h.cellType, m = h == null ? void 0 : h.align, T = h == null ? void 0 : h.verticalAlign, D = h == null ? void 0 : h.bgColor, F = h == null ? void 0 : h.checked, z = h == null ? void 0 : h.startNumber;
2938
2938
  a[i][s] = {
2939
2939
  content: Yo(p, f),
2940
2940
  rowspan: l - i + 1,
@@ -2945,7 +2945,7 @@ function hu(e, t, n, o, r) {
2945
2945
  verticalAlign: T,
2946
2946
  bgColor: D,
2947
2947
  checked: F,
2948
- startNumber: K
2948
+ startNumber: z
2949
2949
  };
2950
2950
  const oe = uo(a, e.rows, e.cols);
2951
2951
  return { ...e, cells: oe };
@@ -3079,7 +3079,7 @@ function ku(e) {
3079
3079
  for (const f of h) {
3080
3080
  for (; p < n && i[u][p].covered; ) p++;
3081
3081
  if (p >= n) break;
3082
- const m = Math.max(1, Math.min(f.rowSpan || 1, r - u)), T = Math.max(1, Math.min(f.colSpan || 1, n - p)), D = Yo(In(f));
3082
+ const m = Math.max(1, Math.min(f.rowSpan || 1, r - u)), T = Math.max(1, Math.min(f.colSpan || 1, n - p)), D = Yo(Nn(f));
3083
3083
  i[u][p] = {
3084
3084
  content: D,
3085
3085
  rowspan: m,
@@ -3087,8 +3087,8 @@ function ku(e) {
3087
3087
  covered: !1
3088
3088
  };
3089
3089
  for (let F = u; F < u + m; F++)
3090
- for (let K = p; K < p + T; K++)
3091
- F === u && K === p || F < r && K < n && (i[F][K] = { content: [], rowspan: 1, colspan: 1, covered: !0 });
3090
+ for (let z = p; z < p + T; z++)
3091
+ F === u && z === p || F < r && z < n && (i[F][z] = { content: [], rowspan: 1, colspan: 1, covered: !0 });
3092
3092
  p += T;
3093
3093
  }
3094
3094
  }
@@ -3288,7 +3288,7 @@ function cr(e, t, n) {
3288
3288
  }
3289
3289
  const c = t.createElement("div");
3290
3290
  for (const d of o) c.appendChild(d.cloneNode(!0));
3291
- const a = In(c);
3291
+ const a = Nn(c);
3292
3292
  n.push({ type: "paragraph", attrs: {}, content: a }), o = [], r = 0;
3293
3293
  }
3294
3294
  for (const s of e) {
@@ -3330,7 +3330,7 @@ function cr(e, t, n) {
3330
3330
  i(), n.push({
3331
3331
  type: "heading",
3332
3332
  attrs: { level: El[a] },
3333
- content: In(c)
3333
+ content: Nn(c)
3334
3334
  }), r = 0;
3335
3335
  continue;
3336
3336
  }
@@ -3340,7 +3340,7 @@ function cr(e, t, n) {
3340
3340
  }
3341
3341
  if (a === "li") {
3342
3342
  i();
3343
- const d = c.parentElement, u = (d == null ? void 0 : d.tagName.toLowerCase()) ?? "", h = In(c);
3343
+ const d = c.parentElement, u = (d == null ? void 0 : d.tagName.toLowerCase()) ?? "", h = Nn(c);
3344
3344
  u === "ol" ? n.push({ type: "orderedList", attrs: {}, content: h }) : u === "ul" ? n.push({ type: "bulletList", attrs: {}, content: h }) : n.push({ type: "paragraph", attrs: {}, content: h }), r = 0;
3345
3345
  continue;
3346
3346
  }
@@ -3349,7 +3349,7 @@ function cr(e, t, n) {
3349
3349
  const d = Array.from(c.children).some(
3350
3350
  (h) => Kr(h.tagName.toLowerCase())
3351
3351
  ), u = !!c.querySelector("img");
3352
- d || u ? cr(c.childNodes, t, n) : c.querySelector("br") ? Su(c, t, n) : n.push({ type: "paragraph", attrs: {}, content: In(c) }), r = 0;
3352
+ d || u ? cr(c.childNodes, t, n) : c.querySelector("br") ? Su(c, t, n) : n.push({ type: "paragraph", attrs: {}, content: Nn(c) }), r = 0;
3353
3353
  continue;
3354
3354
  }
3355
3355
  if (a === "div" || a === "span") {
@@ -3403,7 +3403,7 @@ function Su(e, t, n) {
3403
3403
  for (const r of o) {
3404
3404
  const i = t.createElement("div");
3405
3405
  for (const s of r) i.appendChild(s.cloneNode(!0));
3406
- const l = In(i);
3406
+ const l = Nn(i);
3407
3407
  n.push({ type: "paragraph", attrs: {}, content: l });
3408
3408
  }
3409
3409
  }
@@ -3622,7 +3622,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3622
3622
  },
3623
3623
  emits: ["slashTrigger", "inputChanged", "linkClick", "focusIn"],
3624
3624
  setup(e, { emit: t }) {
3625
- const n = e, o = t, r = Pn(), i = wo(), l = j(null), s = ur(!1);
3625
+ const n = e, o = t, r = Hn(), i = wo(), l = j(null), s = ur(!1);
3626
3626
  function c() {
3627
3627
  return Fe(n.block.content).length === 0;
3628
3628
  }
@@ -3687,7 +3687,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3687
3687
  if (!V && !me)
3688
3688
  W.textContent !== y && (W.textContent = y, I = !0);
3689
3689
  else {
3690
- const ae = xi(In(W)), ye = xi(A.content);
3690
+ const ae = xi(Nn(W)), ye = xi(A.content);
3691
3691
  ae !== ye && (W.innerHTML = mo(A.content), I = !0);
3692
3692
  }
3693
3693
  }
@@ -3702,7 +3702,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3702
3702
  if (!i.value) return;
3703
3703
  const W = l.value;
3704
3704
  if (!W) return;
3705
- const _ = In(W), O = Fe(_);
3705
+ const _ = Nn(W), O = Fe(_);
3706
3706
  if (a.value = O.length === 0, o("inputChanged", n.block.id, O), s.value || qa({
3707
3707
  editor: r,
3708
3708
  registry: r.registries.inputRules,
@@ -3727,7 +3727,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3727
3727
  if (s.value = !1, !i.value) return;
3728
3728
  const W = l.value;
3729
3729
  if (!W) return;
3730
- const _ = In(W), O = Fe(_);
3730
+ const _ = Nn(W), O = Fe(_);
3731
3731
  a.value = O.length === 0, o("inputChanged", n.block.id, O);
3732
3732
  const y = r.registries.schema.get(n.block.type).inlineMarks ? $r(_) : _;
3733
3733
  (I = (S = r.commands).setText) == null || I.call(S, {
@@ -3758,7 +3758,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3758
3758
  const [, M] = pn(n.block.content, _), [y] = pn(M, O - _), S = Fe(y), I = mo(y);
3759
3759
  A.preventDefault(), (V = A.clipboardData) == null || V.setData("text/plain", S), (me = A.clipboardData) == null || me.setData("text/html", I);
3760
3760
  }
3761
- function K(A) {
3761
+ function z(A) {
3762
3762
  var ae, ye, pe, ue;
3763
3763
  if (!i.value) {
3764
3764
  A.preventDefault();
@@ -3797,7 +3797,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3797
3797
  return W;
3798
3798
  }
3799
3799
  async function U(A) {
3800
- var Ht, an, ln, Vt, ut, At, Bt, lt, Ze, Ot, be, Dt, it, He, sn, pt, Lt, P, k, z, _e, Se, dt, ht, vn, En, Ye, Hn, un, On, Un, Fn;
3800
+ var Ht, an, ln, Vt, ut, At, Bt, lt, Ze, Ot, be, Dt, it, He, sn, pt, Lt, P, k, K, _e, Se, dt, ht, vn, En, Ye, Un, un, Dn, Fn, zn;
3801
3801
  if (!i.value) {
3802
3802
  A.preventDefault();
3803
3803
  return;
@@ -3936,7 +3936,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3936
3936
  et.type,
3937
3937
  et.attrs
3938
3938
  );
3939
- (z = (k = r.commands).insertBlock) == null || z.call(k, {
3939
+ (K = (k = r.commands).insertBlock) == null || K.call(k, {
3940
3940
  after: Ie,
3941
3941
  type: et.type,
3942
3942
  attrs: Je,
@@ -3993,17 +3993,17 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
3993
3993
  }
3994
3994
  }
3995
3995
  if (Oe === -1 && ye.length > 0) {
3996
- (Hn = (Ye = r.commands).insertBlock) == null || Hn.call(Ye, {
3996
+ (Un = (Ye = r.commands).insertBlock) == null || Un.call(Ye, {
3997
3997
  after: Ie,
3998
3998
  type: "paragraph",
3999
3999
  attrs: {},
4000
4000
  content: ye
4001
4001
  });
4002
4002
  const Le = r.getState();
4003
- Le.selection.kind === "caret" && (Ie = Le.selection.blockId, (On = (un = r.commands).setSelection) == null || On.call(un, {
4003
+ Le.selection.kind === "caret" && (Ie = Le.selection.blockId, (Dn = (un = r.commands).setSelection) == null || Dn.call(un, {
4004
4004
  selection: yt(Ie, Fe(ye).length)
4005
4005
  }));
4006
- } else Oe === -1 && (ae.length > 0 || ye.length > 0) && ((Fn = (Un = r.commands).insertBlock) == null || Fn.call(Un, {
4006
+ } else Oe === -1 && (ae.length > 0 || ye.length > 0) && ((zn = (Fn = r.commands).insertBlock) == null || zn.call(Fn, {
4007
4007
  after: Ie,
4008
4008
  type: "paragraph",
4009
4009
  attrs: {},
@@ -4057,7 +4057,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
4057
4057
  onClick: X,
4058
4058
  onPaste: ie(U, ["prevent"]),
4059
4059
  onCopy: F,
4060
- onCut: K
4060
+ onCut: z
4061
4061
  }, null, 40, Uu));
4062
4062
  }
4063
4063
  });
@@ -4458,7 +4458,7 @@ const Ku = {
4458
4458
  function Gu(e, t) {
4459
4459
  so(Ts, e), so(Ms, t);
4460
4460
  }
4461
- function _n() {
4461
+ function Tn() {
4462
4462
  const e = Zn(Ts, j("zh-CN")), t = Zn(Ms, j("light"));
4463
4463
  return {
4464
4464
  get locale() {
@@ -4481,7 +4481,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4481
4481
  },
4482
4482
  emits: ["openPlusMenu", "openSettingsMenu", "gripPointerDown", "gripPointerUp"],
4483
4483
  setup(e, { expose: t, emit: n }) {
4484
- const o = e, r = n, { t: i } = _n(), l = wo(), s = j(null), c = j(null), a = j(null), d = j(!1), u = j(!1), h = j(null);
4484
+ const o = e, r = n, { t: i } = Tn(), l = wo(), s = j(null), c = j(null), a = j(null), d = j(!1), u = j(!1), h = j(null);
4485
4485
  let p = null;
4486
4486
  const f = Me(
4487
4487
  () => h.value === null ? void 0 : { top: `${h.value}px` }
@@ -4516,8 +4516,8 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4516
4516
  T(), D();
4517
4517
  }) : F();
4518
4518
  }
4519
- ), oo(T), Ln(F);
4520
- function K() {
4519
+ ), oo(T), Bn(F);
4520
+ function z() {
4521
4521
  l.value && c.value && r("openPlusMenu", c.value);
4522
4522
  }
4523
4523
  let oe = 0, $ = 0, U = 0, ce = !1;
@@ -4546,10 +4546,10 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4546
4546
  tabindex: "0",
4547
4547
  title: fe(i)("handle.plus.title"),
4548
4548
  "aria-label": fe(i)("handle.plus.ariaLabel"),
4549
- onMousedown: ie(K, ["prevent", "stop"]),
4549
+ onMousedown: ie(z, ["prevent", "stop"]),
4550
4550
  onKeydown: [
4551
- no(ie(K, ["prevent", "stop"]), ["enter"]),
4552
- no(ie(K, ["prevent", "stop"]), ["space"])
4551
+ no(ie(z, ["prevent", "stop"]), ["enter"]),
4552
+ no(ie(z, ["prevent", "stop"]), ["space"])
4553
4553
  ]
4554
4554
  }, [...W[0] || (W[0] = [
4555
4555
  C("svg", {
@@ -4600,7 +4600,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4600
4600
  },
4601
4601
  emits: ["openSettingsMenu", "openPlusMenu", "slashTrigger", "inputChanged", "hoverChange", "gripPointerDown", "gripPointerUp", "linkClick", "focusIn"],
4602
4602
  setup(e, { expose: t, emit: n }) {
4603
- const o = e, r = n, i = Pn(), l = wo(), s = j(null), c = j(null), a = Me(() => !l.value || o.hasTextSelection ? !1 : o.hoveredBlockId === o.block.id || o.hoveredBlockId === null && o.focusedBlockId === o.block.id), d = Me(() => o.draggingBlockId === o.block.id), u = Me(() => o.menuOpenBlockId === o.block.id), h = Me(() => o.dropTargetBlockId === o.block.id), p = Me(() => o.dropPosition ?? "after");
4603
+ const o = e, r = n, i = Hn(), l = wo(), s = j(null), c = j(null), a = Me(() => !l.value || o.hasTextSelection ? !1 : o.hoveredBlockId === o.block.id || o.hoveredBlockId === null && o.focusedBlockId === o.block.id), d = Me(() => o.draggingBlockId === o.block.id), u = Me(() => o.menuOpenBlockId === o.block.id), h = Me(() => o.dropTargetBlockId === o.block.id), p = Me(() => o.dropPosition ?? "after");
4604
4604
  function f(X, A, W, _) {
4605
4605
  r("gripPointerDown", X, A, W, _);
4606
4606
  }
@@ -4617,7 +4617,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4617
4617
  function F() {
4618
4618
  r("hoverChange", null);
4619
4619
  }
4620
- function K(X) {
4620
+ function z(X) {
4621
4621
  r("openPlusMenu", o.block.id, X);
4622
4622
  }
4623
4623
  function oe(X) {
@@ -4663,7 +4663,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4663
4663
  ref: c,
4664
4664
  "block-id": e.block.id,
4665
4665
  visible: a.value,
4666
- onOpenPlusMenu: K,
4666
+ onOpenPlusMenu: z,
4667
4667
  onOpenSettingsMenu: oe,
4668
4668
  onGripPointerDown: f,
4669
4669
  onGripPointerUp: m
@@ -4742,7 +4742,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4742
4742
  function F($) {
4743
4743
  r("gripPointerUp", $);
4744
4744
  }
4745
- function K($, U) {
4745
+ function z($, U) {
4746
4746
  r("linkClick", $, U);
4747
4747
  }
4748
4748
  function oe($) {
@@ -4780,7 +4780,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4780
4780
  onHoverChange: m,
4781
4781
  onGripPointerDown: D,
4782
4782
  onGripPointerUp: F,
4783
- onLinkClick: K,
4783
+ onLinkClick: z,
4784
4784
  onFocusIn: oe
4785
4785
  }, null, 8, ["block", "placeholder", "hovered-block-id", "focused-block-id", "has-text-selection", "dragging-block-id", "drop-target-block-id", "drop-position", "menu-open-block-id"]),
4786
4786
  G.block.children.length > 0 ? (Z(), mn(ce, {
@@ -4813,8 +4813,8 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
4813
4813
  function Ss(e, t, n, o = 6, r = "auto", i = 0, l = 0) {
4814
4814
  const s = t instanceof HTMLElement ? t.getBoundingClientRect() : t, c = document.documentElement.clientHeight, a = nd(), d = Math.max(0, c - s.bottom - o - i), u = Math.max(0, s.top - o - l), h = d >= n.height + o, p = u >= n.height + o, f = r === "down" ? !1 : r === "up" ? !0 : !h && (p || u > d);
4815
4815
  let m, T, D;
4816
- const F = s.bottom + o, K = s.top - o;
4817
- f ? (m = Math.max(o + l, K - n.height), T = K, D = Math.max(120, u)) : (m = F, T = m + n.height, D = Math.max(120, d));
4816
+ const F = s.bottom + o, z = s.top - o;
4817
+ f ? (m = Math.max(o + l, z - n.height), T = z, D = Math.max(120, u)) : (m = F, T = m + n.height, D = Math.max(120, d));
4818
4818
  const oe = a - n.width - o, $ = Math.max(o, Math.min(oe, s.left));
4819
4819
  return { top: m, left: $, above: f, availableHeight: D, bottom: T, topBaseline: F };
4820
4820
  }
@@ -4863,7 +4863,7 @@ function jr(e, t) {
4863
4863
  });
4864
4864
  },
4865
4865
  { immediate: !0 }
4866
- ), Ln(() => {
4866
+ ), Bn(() => {
4867
4867
  s(c), c = null;
4868
4868
  });
4869
4869
  }
@@ -4905,11 +4905,11 @@ function As(e, t, n, o) {
4905
4905
  { immediate: !0 }
4906
4906
  ), oo(() => {
4907
4907
  window.addEventListener("mousedown", i, !0), window.addEventListener("touchstart", i, !0), window.addEventListener("wheel", l, !0);
4908
- }), Ln(() => {
4908
+ }), Bn(() => {
4909
4909
  window.removeEventListener("mousedown", i, !0), window.removeEventListener("touchstart", i, !0), window.removeEventListener("wheel", l, !0), a(d), d = null;
4910
4910
  });
4911
4911
  }
4912
- const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
4912
+ const od = ["innerHTML"], In = /* @__PURE__ */ Ft({
4913
4913
  __name: "SafeHtml",
4914
4914
  props: {
4915
4915
  html: { default: "" }
@@ -4938,11 +4938,11 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
4938
4938
  },
4939
4939
  emits: ["close", "commit"],
4940
4940
  setup(e, { expose: t, emit: n }) {
4941
- const o = e, r = n, { t: i } = _n(), l = Me(() => ({
4941
+ const o = e, r = n, { t: i } = Tn(), l = Me(() => ({
4942
4942
  basic: i("plus.category.basic"),
4943
4943
  list: i("plus.category.list"),
4944
4944
  other: i("plus.category.other")
4945
- })), s = Pn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(0), h = j({ top: 0, left: 0, availableHeight: 360, above: !1, bottom: 0, topBaseline: 0 }), p = j(!1), f = j(!1), m = j(!1), T = j(!1);
4945
+ })), s = Hn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(0), h = j({ top: 0, left: 0, availableHeight: 360, above: !1, bottom: 0, topBaseline: 0 }), p = j(!1), f = j(!1), m = j(!1), T = j(!1);
4946
4946
  let D = null;
4947
4947
  Tt(() => o.visible, (M) => {
4948
4948
  M ? (D && (clearTimeout(D), D = null), T.value = !0) : D = setTimeout(() => {
@@ -4952,12 +4952,12 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
4952
4952
  function F(M) {
4953
4953
  return typeof M == "string" ? M : "•";
4954
4954
  }
4955
- const K = Me(() => {
4955
+ const z = Me(() => {
4956
4956
  const M = o.query.trim().toLowerCase(), y = s.registries.slash.all;
4957
4957
  return M ? y.filter((S) => (i(S.title) + " " + (S.keywords ?? []).join(" ")).toLowerCase().includes(M)) : y;
4958
4958
  }), oe = Me(() => {
4959
4959
  const M = [], y = /* @__PURE__ */ new Map();
4960
- for (const I of K.value) {
4960
+ for (const I of z.value) {
4961
4961
  const V = I.category ?? "other";
4962
4962
  y.has(V) || y.set(V, []), y.get(V).push(I);
4963
4963
  }
@@ -4971,9 +4971,9 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
4971
4971
  return M;
4972
4972
  });
4973
4973
  function $(M) {
4974
- return K.value.findIndex((y) => y.id === M);
4974
+ return z.value.findIndex((y) => y.id === M);
4975
4975
  }
4976
- Tt([K, () => o.visible], () => {
4976
+ Tt([z, () => o.visible], () => {
4977
4977
  u.value = 0, qe(() => {
4978
4978
  d.value && (d.value.scrollTop = 0), U();
4979
4979
  });
@@ -4996,7 +4996,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
4996
4996
  M && (p.value = !1, h.value = { top: 0, left: 0, availableHeight: 360, above: !1, bottom: 0, topBaseline: 0 });
4997
4997
  }
4998
4998
  ), Tt(
4999
- [() => o.visible, () => o.anchorEl, a, K, f, m],
4999
+ [() => o.visible, () => o.anchorEl, a, z, f, m],
5000
5000
  async () => {
5001
5001
  if (!o.visible || !o.anchorEl || !o.rootEl) return;
5002
5002
  await qe();
@@ -5027,8 +5027,8 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5027
5027
  return V;
5028
5028
  });
5029
5029
  function X(M) {
5030
- if (K.value.length === 0) return;
5031
- const y = K.value.length;
5030
+ if (z.value.length === 0) return;
5031
+ const y = z.value.length;
5032
5032
  u.value = ((u.value + M) % y + y) % y, A();
5033
5033
  }
5034
5034
  function A() {
@@ -5049,7 +5049,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5049
5049
  case "Home":
5050
5050
  return M.preventDefault(), u.value = 0, A(), !0;
5051
5051
  case "End":
5052
- return M.preventDefault(), u.value = Math.max(0, K.value.length - 1), A(), !0;
5052
+ return M.preventDefault(), u.value = Math.max(0, z.value.length - 1), A(), !0;
5053
5053
  case "Enter":
5054
5054
  return M.preventDefault(), _(), !0;
5055
5055
  case "Escape":
@@ -5059,11 +5059,11 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5059
5059
  }
5060
5060
  }
5061
5061
  function _() {
5062
- const M = K.value[u.value];
5062
+ const M = z.value[u.value];
5063
5063
  M && r("commit", M, o.mode), r("close");
5064
5064
  }
5065
5065
  function O(M) {
5066
- const y = K.value.indexOf(M);
5066
+ const y = z.value.indexOf(M);
5067
5067
  y >= 0 && (u.value = y), _();
5068
5068
  }
5069
5069
  return t({ onKeyDown: W }), As(
@@ -5073,9 +5073,9 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5073
5073
  () => o.anchorEl
5074
5074
  ), oo(() => {
5075
5075
  window.addEventListener("resize", U);
5076
- }), Ln(() => {
5076
+ }), Bn(() => {
5077
5077
  window.removeEventListener("resize", U);
5078
- }), (M, y) => (Z(), mn($n, { to: "body" }, [
5078
+ }), (M, y) => (Z(), mn(Pn, { to: "body" }, [
5079
5079
  T.value && e.rootEl ? (Z(), te("div", {
5080
5080
  key: 0,
5081
5081
  ref_key: "menuEl",
@@ -5113,7 +5113,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5113
5113
  class: "slash-menu-scroll",
5114
5114
  onScroll: U
5115
5115
  }, [
5116
- K.value.length === 0 ? (Z(), te("div", ld, Rt(fe(i)("plus.noMatch")), 1)) : (Z(!0), te(rt, { key: 1 }, bn(oe.value, (S) => (Z(), te("div", {
5116
+ z.value.length === 0 ? (Z(), te("div", ld, Rt(fe(i)("plus.noMatch")), 1)) : (Z(!0), te(rt, { key: 1 }, bn(oe.value, (S) => (Z(), te("div", {
5117
5117
  key: S.category,
5118
5118
  class: "slash-menu-group"
5119
5119
  }, [
@@ -5126,7 +5126,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
5126
5126
  onMousedown: ie((V) => O(I), ["prevent"]),
5127
5127
  onMouseenter: (V) => u.value = $(I.id)
5128
5128
  }, [
5129
- gn(An, {
5129
+ gn(In, {
5130
5130
  class: "slash-menu-icon",
5131
5131
  html: F(I.icon)
5132
5132
  }, null, 8, ["html"]),
@@ -5249,7 +5249,7 @@ const Is = [
5249
5249
  },
5250
5250
  emits: ["close"],
5251
5251
  setup(e, { expose: t, emit: n }) {
5252
- const o = e, r = n, { t: i } = _n(), l = Pn(), s = Zn(yr, j(!1)), c = j(null), a = j(null), d = j("paragraph"), u = j({ top: 0, left: 0, availableHeight: 520, above: !1, bottom: 0, topBaseline: 0 }), h = j(!1), p = j(!1), f = j(!1), m = Sn({
5252
+ const o = e, r = n, { t: i } = Tn(), l = Hn(), s = Zn(yr, j(!1)), c = j(null), a = j(null), d = j("paragraph"), u = j({ top: 0, left: 0, availableHeight: 520, above: !1, bottom: 0, topBaseline: 0 }), h = j(!1), p = j(!1), f = j(!1), m = An({
5253
5253
  alignIndent: !1,
5254
5254
  indent: !1,
5255
5255
  textColor: !1,
@@ -5262,7 +5262,7 @@ const Is = [
5262
5262
  }, 300);
5263
5263
  }, { immediate: !0 });
5264
5264
  const F = ur(l.getState());
5265
- let K = null;
5265
+ let z = null;
5266
5266
  const oe = Me(
5267
5267
  () => o.blockId != null ? F.value.doc.blocks.get(o.blockId) : void 0
5268
5268
  ), $ = j(void 0), U = Me(() => {
@@ -5293,8 +5293,8 @@ const Is = [
5293
5293
  const O = Me(() => !!$.value), M = Me(() => {
5294
5294
  const P = oe.value;
5295
5295
  if (!P) return !0;
5296
- const k = F.value.doc, z = es(k, P.id);
5297
- return !z || !_(z.type) || ko(k, z.id) >= 10;
5296
+ const k = F.value.doc, K = es(k, P.id);
5297
+ return !K || !_(K.type) || ko(k, K.id) >= 10;
5298
5298
  }), y = Me(() => W.value <= 0), S = Me(() => {
5299
5299
  var k;
5300
5300
  const P = (k = oe.value) == null ? void 0 : k.attrs.color;
@@ -5463,9 +5463,9 @@ const Is = [
5463
5463
  Tt(
5464
5464
  () => o.visible,
5465
5465
  (P) => {
5466
- var z;
5466
+ var K;
5467
5467
  if (!P) return;
5468
- $.value = o.blockId != null ? (z = F.value.doc.blocks.get(o.blockId)) == null ? void 0 : z.type : void 0;
5468
+ $.value = o.blockId != null ? (K = F.value.doc.blocks.get(o.blockId)) == null ? void 0 : K.type : void 0;
5469
5469
  const k = V.value.find((_e) => me(_e.id));
5470
5470
  d.value = k ? k.id : "paragraph", m.alignIndent = !1, m.indent = !1, m.textColor = !1, m.bgColor = !1;
5471
5471
  },
@@ -5480,8 +5480,8 @@ const Is = [
5480
5480
  return G.value || P.push({ id: "align-justify", value: "justify", title: i("align.justify"), run: () => pe("justify") }), P;
5481
5481
  });
5482
5482
  function pe(P) {
5483
- var k, z;
5484
- (z = (k = l.commands).setBlockAlign) == null || z.call(k, { id: o.blockId, align: P });
5483
+ var k, K;
5484
+ (K = (k = l.commands).setBlockAlign) == null || K.call(k, { id: o.blockId, align: P });
5485
5485
  }
5486
5486
  function ue() {
5487
5487
  var P, k;
@@ -5493,12 +5493,12 @@ const Is = [
5493
5493
  }
5494
5494
  const Ie = Is, et = Ns;
5495
5495
  function Ht(P) {
5496
- var k, z;
5497
- (z = (k = l.commands).setBlockColor) == null || z.call(k, { id: o.blockId, color: P });
5496
+ var k, K;
5497
+ (K = (k = l.commands).setBlockColor) == null || K.call(k, { id: o.blockId, color: P });
5498
5498
  }
5499
5499
  function an(P) {
5500
- var k, z;
5501
- (z = (k = l.commands).setBlockBgColor) == null || z.call(k, { id: o.blockId, bgColor: P });
5500
+ var k, K;
5501
+ (K = (k = l.commands).setBlockBgColor) == null || K.call(k, { id: o.blockId, bgColor: P });
5502
5502
  }
5503
5503
  async function ln() {
5504
5504
  var dt, ht;
@@ -5531,16 +5531,16 @@ const Is = [
5531
5531
  function ut(P) {
5532
5532
  const k = document.createElement("textarea");
5533
5533
  k.value = P, k.setAttribute("readonly", ""), k.style.position = "fixed", k.style.top = "-9999px", k.style.left = "-9999px", k.style.opacity = "0", document.body.appendChild(k);
5534
- const z = document.activeElement;
5534
+ const K = document.activeElement;
5535
5535
  k.focus(), k.select();
5536
5536
  try {
5537
5537
  return document.execCommand("copy");
5538
5538
  } catch {
5539
5539
  return !1;
5540
5540
  } finally {
5541
- if (document.body.removeChild(k), z && typeof z.focus == "function")
5541
+ if (document.body.removeChild(k), K && typeof K.focus == "function")
5542
5542
  try {
5543
- z.focus();
5543
+ K.focus();
5544
5544
  } catch {
5545
5545
  }
5546
5546
  }
@@ -5619,8 +5619,8 @@ const Is = [
5619
5619
  }
5620
5620
  );
5621
5621
  function Ot() {
5622
- const P = o.anchorEl, k = o.rootEl, z = c.value;
5623
- !o.visible || !P || !k || !z || qe().then(() => {
5622
+ const P = o.anchorEl, k = o.rootEl, K = c.value;
5623
+ !o.visible || !P || !k || !K || qe().then(() => {
5624
5624
  const _e = c.value;
5625
5625
  if (!_e) return;
5626
5626
  const Se = _e.getBoundingClientRect(), dt = !!P.closest(".fixed-toolbar"), ht = dt ? s.value ? "up" : "down" : "auto", vn = dt ? 10 : 0, En = Ss(k, P, {
@@ -5654,7 +5654,7 @@ const Is = [
5654
5654
  const sn = Me(() => {
5655
5655
  if (!o.rootEl) return { display: "none" };
5656
5656
  if (!h.value) return { visibility: "hidden", top: "0px", left: "0px", width: `${dl}px`, "--scroll-max-height": "100vh" };
5657
- const P = u.value.above, k = u.value.left, z = (p.value ? Ni : 0) + (f.value ? Ni : 0), _e = u.value.availableHeight - z, Se = {
5657
+ const P = u.value.above, k = u.value.left, K = (p.value ? Ni : 0) + (f.value ? Ni : 0), _e = u.value.availableHeight - K, Se = {
5658
5658
  left: `${k}px`,
5659
5659
  width: `${dl}px`,
5660
5660
  maxHeight: `${u.value.availableHeight}px`,
@@ -5669,7 +5669,7 @@ const Is = [
5669
5669
  });
5670
5670
  function pt(P) {
5671
5671
  if (P.kind === "turnInto" && ae(P.id)) {
5672
- const k = V.value.find((z) => z.id === "paragraph");
5672
+ const k = V.value.find((K) => K.id === "paragraph");
5673
5673
  if (k) {
5674
5674
  d.value = "paragraph", k.run(), r("close");
5675
5675
  return;
@@ -5680,14 +5680,14 @@ const Is = [
5680
5680
  function Lt(P) {
5681
5681
  const k = [...V.value, ...Ze.value];
5682
5682
  if (k.length === 0) return !1;
5683
- const z = k.findIndex((Se) => Se.id === d.value), _e = (Se) => (Se % k.length + k.length) % k.length;
5683
+ const K = k.findIndex((Se) => Se.id === d.value), _e = (Se) => (Se % k.length + k.length) % k.length;
5684
5684
  switch (P.key) {
5685
5685
  case "ArrowDown":
5686
- return P.preventDefault(), d.value = k[_e(z + 1)].id, !0;
5686
+ return P.preventDefault(), d.value = k[_e(K + 1)].id, !0;
5687
5687
  case "ArrowUp":
5688
- return P.preventDefault(), d.value = k[_e(z - 1)].id, !0;
5688
+ return P.preventDefault(), d.value = k[_e(K - 1)].id, !0;
5689
5689
  case "Enter":
5690
- return P.preventDefault(), pt(k[_e(z)]), !0;
5690
+ return P.preventDefault(), pt(k[_e(K)]), !0;
5691
5691
  case "Escape":
5692
5692
  return P.preventDefault(), r("close"), !0;
5693
5693
  default:
@@ -5700,12 +5700,12 @@ const Is = [
5700
5700
  () => r("close"),
5701
5701
  () => o.anchorEl
5702
5702
  ), oo(() => {
5703
- K = l.subscribe((P) => {
5703
+ z = l.subscribe((P) => {
5704
5704
  F.value = P.state;
5705
5705
  });
5706
- }), Ln(() => {
5707
- K == null || K(), K = null;
5708
- }), (P, k) => (Z(), mn($n, { to: "body" }, [
5706
+ }), Bn(() => {
5707
+ z == null || z(), z = null;
5708
+ }), (P, k) => (Z(), mn(Pn, { to: "body" }, [
5709
5709
  T.value && e.rootEl ? (Z(), te("div", {
5710
5710
  key: 0,
5711
5711
  ref_key: "menuEl",
@@ -5746,17 +5746,17 @@ const Is = [
5746
5746
  !G.value && !le.value ? (Z(), te(rt, { key: 0 }, [
5747
5747
  C("div", Md, [
5748
5748
  C("div", Sd, [
5749
- (Z(!0), te(rt, null, bn(V.value, (z) => (Z(), te("button", {
5750
- key: z.id,
5751
- class: ze(["bsm-icon-cell", { active: ae(z.id) }]),
5752
- title: z.title,
5749
+ (Z(!0), te(rt, null, bn(V.value, (K) => (Z(), te("button", {
5750
+ key: K.id,
5751
+ class: ze(["bsm-icon-cell", { active: ae(K.id) }]),
5752
+ title: K.title,
5753
5753
  role: "menuitem",
5754
- onMousedown: ie((_e) => pt(z), ["prevent"]),
5755
- onMouseenter: (_e) => d.value = z.id
5754
+ onMousedown: ie((_e) => pt(K), ["prevent"]),
5755
+ onMouseenter: (_e) => d.value = K.id
5756
5756
  }, [
5757
- gn(An, {
5757
+ gn(In, {
5758
5758
  class: "bsm-icon-svg",
5759
- html: z.iconHtml
5759
+ html: K.iconHtml
5760
5760
  }, null, 8, ["html"])
5761
5761
  ], 42, Ad))), 128))
5762
5762
  ])
@@ -5767,7 +5767,7 @@ const Is = [
5767
5767
  C("button", {
5768
5768
  class: ze(["bsm-collapse-header", { "bsm-disabled": ce.value && !O.value, expanded: m.alignIndent }]),
5769
5769
  role: "menuitem",
5770
- onMousedown: k[0] || (k[0] = ie((z) => be("alignIndent"), ["prevent"]))
5770
+ onMousedown: k[0] || (k[0] = ie((K) => be("alignIndent"), ["prevent"]))
5771
5771
  }, [
5772
5772
  C("span", Nd, Rt(fe(i)("bsm.section.alignIndent")), 1),
5773
5773
  k[10] || (k[10] = C("svg", {
@@ -5789,16 +5789,16 @@ const Is = [
5789
5789
  ], 34),
5790
5790
  bo(C("div", Rd, [
5791
5791
  C("div", Ld, [
5792
- (Z(!0), te(rt, null, bn(ye.value, (z) => (Z(), te("button", {
5793
- key: z.id,
5794
- class: ze(["bsm-icon-btn", { active: !ce.value && U.value === z.value, "bsm-disabled": ce.value }]),
5792
+ (Z(!0), te(rt, null, bn(ye.value, (K) => (Z(), te("button", {
5793
+ key: K.id,
5794
+ class: ze(["bsm-icon-btn", { active: !ce.value && U.value === K.value, "bsm-disabled": ce.value }]),
5795
5795
  disabled: ce.value,
5796
- title: z.title,
5796
+ title: K.title,
5797
5797
  role: "menuitem",
5798
- onMousedown: ie((_e) => !ce.value && pt(z), ["prevent"])
5798
+ onMousedown: ie((_e) => !ce.value && pt(K), ["prevent"])
5799
5799
  }, [
5800
5800
  (Z(), te("svg", Od, [
5801
- z.value === "left" ? (Z(), te(rt, { key: 0 }, [
5801
+ K.value === "left" ? (Z(), te(rt, { key: 0 }, [
5802
5802
  k[11] || (k[11] = C("line", {
5803
5803
  x1: "2",
5804
5804
  y1: "4",
@@ -5826,7 +5826,7 @@ const Is = [
5826
5826
  "stroke-width": "1.3",
5827
5827
  "stroke-linecap": "round"
5828
5828
  }, null, -1))
5829
- ], 64)) : z.value === "center" ? (Z(), te(rt, { key: 1 }, [
5829
+ ], 64)) : K.value === "center" ? (Z(), te(rt, { key: 1 }, [
5830
5830
  k[14] || (k[14] = C("line", {
5831
5831
  x1: "2",
5832
5832
  y1: "4",
@@ -5854,7 +5854,7 @@ const Is = [
5854
5854
  "stroke-width": "1.3",
5855
5855
  "stroke-linecap": "round"
5856
5856
  }, null, -1))
5857
- ], 64)) : z.value === "right" ? (Z(), te(rt, { key: 2 }, [
5857
+ ], 64)) : K.value === "right" ? (Z(), te(rt, { key: 2 }, [
5858
5858
  k[17] || (k[17] = C("line", {
5859
5859
  x1: "2",
5860
5860
  y1: "4",
@@ -5920,7 +5920,7 @@ const Is = [
5920
5920
  disabled: y.value,
5921
5921
  title: fe(i)("bsm.indent.decrease"),
5922
5922
  role: "menuitem",
5923
- onMousedown: k[1] || (k[1] = ie((z) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
5923
+ onMousedown: k[1] || (k[1] = ie((K) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
5924
5924
  }, [...k[23] || (k[23] = [
5925
5925
  C("svg", {
5926
5926
  viewBox: "0 0 1024 1024",
@@ -5939,7 +5939,7 @@ const Is = [
5939
5939
  disabled: M.value,
5940
5940
  title: fe(i)("bsm.indent.increase"),
5941
5941
  role: "menuitem",
5942
- onMousedown: k[2] || (k[2] = ie((z) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
5942
+ onMousedown: k[2] || (k[2] = ie((K) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
5943
5943
  }, [...k[24] || (k[24] = [
5944
5944
  C("svg", {
5945
5945
  viewBox: "0 0 1024 1024",
@@ -5962,7 +5962,7 @@ const Is = [
5962
5962
  C("button", {
5963
5963
  class: ze(["bsm-collapse-header", { "bsm-disabled": !O.value, expanded: m.indent }]),
5964
5964
  role: "menuitem",
5965
- onMousedown: k[3] || (k[3] = ie((z) => be("indent"), ["prevent"]))
5965
+ onMousedown: k[3] || (k[3] = ie((K) => be("indent"), ["prevent"]))
5966
5966
  }, [
5967
5967
  C("span", Ud, Rt(fe(i)("bsm.section.indent")), 1),
5968
5968
  k[25] || (k[25] = C("svg", {
@@ -5989,7 +5989,7 @@ const Is = [
5989
5989
  disabled: y.value,
5990
5990
  title: fe(i)("bsm.indent.decrease"),
5991
5991
  role: "menuitem",
5992
- onMousedown: k[4] || (k[4] = ie((z) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
5992
+ onMousedown: k[4] || (k[4] = ie((K) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
5993
5993
  }, [...k[26] || (k[26] = [
5994
5994
  C("svg", {
5995
5995
  viewBox: "0 0 1024 1024",
@@ -6008,7 +6008,7 @@ const Is = [
6008
6008
  disabled: M.value,
6009
6009
  title: fe(i)("bsm.indent.increase"),
6010
6010
  role: "menuitem",
6011
- onMousedown: k[5] || (k[5] = ie((z) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
6011
+ onMousedown: k[5] || (k[5] = ie((K) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
6012
6012
  }, [...k[27] || (k[27] = [
6013
6013
  C("svg", {
6014
6014
  viewBox: "0 0 1024 1024",
@@ -6031,7 +6031,7 @@ const Is = [
6031
6031
  C("button", {
6032
6032
  class: ze(["bsm-collapse-header", { "bsm-disabled": A.value, expanded: m.textColor }]),
6033
6033
  role: "menuitem",
6034
- onMousedown: k[6] || (k[6] = ie((z) => !A.value && be("textColor"), ["prevent"]))
6034
+ onMousedown: k[6] || (k[6] = ie((K) => !A.value && be("textColor"), ["prevent"]))
6035
6035
  }, [
6036
6036
  C("span", Gd, Rt(fe(i)("bsm.section.textColor")), 1),
6037
6037
  k[28] || (k[28] = C("svg", {
@@ -6053,13 +6053,13 @@ const Is = [
6053
6053
  ], 34),
6054
6054
  bo(C("div", qd, [
6055
6055
  C("div", Yd, [
6056
- (Z(!0), te(rt, null, bn(fe(Ie), (z) => (Z(), te("button", {
6057
- key: "tc-" + z.key,
6058
- class: ze(["bsm-swatch", { active: S.value === z.key, "bsm-disabled": A.value }]),
6059
- title: fe(i)(z.key === "default" ? "color.default" : "color." + z.key),
6060
- style: rn({ backgroundColor: z.displayCssValue ?? z.cssValue }),
6056
+ (Z(!0), te(rt, null, bn(fe(Ie), (K) => (Z(), te("button", {
6057
+ key: "tc-" + K.key,
6058
+ class: ze(["bsm-swatch", { active: S.value === K.key, "bsm-disabled": A.value }]),
6059
+ title: fe(i)(K.key === "default" ? "color.default" : "color." + K.key),
6060
+ style: rn({ backgroundColor: K.displayCssValue ?? K.cssValue }),
6061
6061
  disabled: A.value,
6062
- onMousedown: ie((_e) => !A.value && pt({ id: `tc-${z.key}`, run: () => Ht(z.key) }), ["prevent"])
6062
+ onMousedown: ie((_e) => !A.value && pt({ id: `tc-${K.key}`, run: () => Ht(K.key) }), ["prevent"])
6063
6063
  }, null, 46, Zd))), 128))
6064
6064
  ])
6065
6065
  ], 512), [
@@ -6070,7 +6070,7 @@ const Is = [
6070
6070
  C("button", {
6071
6071
  class: ze(["bsm-collapse-header", { "bsm-disabled": A.value, expanded: m.bgColor }]),
6072
6072
  role: "menuitem",
6073
- onMousedown: k[7] || (k[7] = ie((z) => !A.value && be("bgColor"), ["prevent"]))
6073
+ onMousedown: k[7] || (k[7] = ie((K) => !A.value && be("bgColor"), ["prevent"]))
6074
6074
  }, [
6075
6075
  C("span", jd, Rt(fe(i)("bsm.section.bgColor")), 1),
6076
6076
  k[29] || (k[29] = C("svg", {
@@ -6092,16 +6092,16 @@ const Is = [
6092
6092
  ], 34),
6093
6093
  bo(C("div", Qd, [
6094
6094
  C("div", Jd, [
6095
- (Z(!0), te(rt, null, bn(fe(et), (z) => (Z(), te("button", {
6096
- key: "bc-" + z.key,
6095
+ (Z(!0), te(rt, null, bn(fe(et), (K) => (Z(), te("button", {
6096
+ key: "bc-" + K.key,
6097
6097
  class: ze(["bsm-swatch", [
6098
- { active: I.value === z.key, "bsm-disabled": A.value },
6099
- z.key === "default" ? "bsm-swatch--none" : ""
6098
+ { active: I.value === K.key, "bsm-disabled": A.value },
6099
+ K.key === "default" ? "bsm-swatch--none" : ""
6100
6100
  ]]),
6101
- title: fe(i)(z.key === "default" ? "color.none" : "color." + z.key),
6102
- style: rn({ backgroundColor: z.displayCssValue ?? z.cssValue }),
6101
+ title: fe(i)(K.key === "default" ? "color.none" : "color." + K.key),
6102
+ style: rn({ backgroundColor: K.displayCssValue ?? K.cssValue }),
6103
6103
  disabled: A.value,
6104
- onMousedown: ie((_e) => !A.value && pt({ id: `bc-${z.key}`, run: () => an(z.key) }), ["prevent"])
6104
+ onMousedown: ie((_e) => !A.value && pt({ id: `bc-${K.key}`, run: () => an(K.key) }), ["prevent"])
6105
6105
  }, null, 46, ef))), 128))
6106
6106
  ])
6107
6107
  ], 512), [
@@ -6110,23 +6110,23 @@ const Is = [
6110
6110
  ])) : De("", !0),
6111
6111
  k[30] || (k[30] = C("div", { class: "bsm-sep" }, null, -1)),
6112
6112
  C("div", tf, [
6113
- (Z(!0), te(rt, null, bn(Ze.value, (z) => (Z(), te("button", {
6114
- key: z.id,
6115
- class: ze(["bsm-item bsm-action", { danger: z.danger }]),
6113
+ (Z(!0), te(rt, null, bn(Ze.value, (K) => (Z(), te("button", {
6114
+ key: K.id,
6115
+ class: ze(["bsm-item bsm-action", { danger: K.danger }]),
6116
6116
  role: "menuitem",
6117
- onMousedown: ie((_e) => pt(z), ["prevent"]),
6118
- onMouseenter: (_e) => d.value = z.id
6117
+ onMousedown: ie((_e) => pt(K), ["prevent"]),
6118
+ onMouseenter: (_e) => d.value = K.id
6119
6119
  }, [
6120
- gn(An, {
6120
+ gn(In, {
6121
6121
  class: "bsm-action-icon",
6122
- html: z.iconHtml
6122
+ html: K.iconHtml
6123
6123
  }, null, 8, ["html"]),
6124
- C("span", of, Rt(z.title), 1),
6125
- z.shortcutHtml ? (Z(), mn(An, {
6124
+ C("span", of, Rt(K.title), 1),
6125
+ K.shortcutHtml ? (Z(), mn(In, {
6126
6126
  key: 0,
6127
6127
  class: "bsm-shortcut",
6128
- html: z.shortcutHtml
6129
- }, null, 8, ["html"])) : z.shortcut ? (Z(), te("span", rf, Rt(z.shortcut), 1)) : De("", !0)
6128
+ html: K.shortcutHtml
6129
+ }, null, 8, ["html"])) : K.shortcut ? (Z(), te("span", rf, Rt(K.shortcut), 1)) : De("", !0)
6130
6130
  ], 42, nf))), 128))
6131
6131
  ])
6132
6132
  ], 544),
@@ -6236,7 +6236,7 @@ const Is = [
6236
6236
  function i() {
6237
6237
  r("interacting");
6238
6238
  }
6239
- const { t: l } = _n(), s = Pn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(null), h = j(null), p = j(null), f = j(null), m = j(null), T = j(null), D = j(null), F = j({ top: 0, left: 0, above: !1 }), K = j(null), oe = j(!1), $ = j(null), U = j(null), ce = j(!1), G = j(!1), le = j(null), X = j(!1), A = j(!1), W = j(!1), _ = Me(() => ({
6239
+ const { t: l } = Tn(), s = Hn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(null), h = j(null), p = j(null), f = j(null), m = j(null), T = j(null), D = j(null), F = j({ top: 0, left: 0, above: !1 }), z = j(null), oe = j(!1), $ = j(null), U = j(null), ce = j(!1), G = j(!1), le = j(null), X = j(!1), A = j(!1), W = j(!1), _ = Me(() => ({
6240
6240
  maxHeight: $.value !== null ? `${$.value}px` : void 0
6241
6241
  })), O = j(null), M = Me(() => {
6242
6242
  if (!o.mobile || !O.value) return;
@@ -6256,8 +6256,8 @@ const Is = [
6256
6256
  ), me = Me(() => {
6257
6257
  var b;
6258
6258
  if (o.cellEditMode || o.tableMode) {
6259
- const B = o.blockAttrs.align;
6260
- return typeof B == "string" ? B : "left";
6259
+ const L = o.blockAttrs.align;
6260
+ return typeof L == "string" ? L : "left";
6261
6261
  }
6262
6262
  const R = (b = V.value) == null ? void 0 : b.attrs.align;
6263
6263
  return typeof R == "string" ? R : "left";
@@ -6273,9 +6273,9 @@ const Is = [
6273
6273
  return "middle";
6274
6274
  }), ye = j(""), pe = j("");
6275
6275
  Tt(() => o.visible, (R) => {
6276
- R || (K.value = null);
6276
+ R || (z.value = null);
6277
6277
  }), Tt(() => o.blockId, () => {
6278
- K.value = null;
6278
+ z.value = null;
6279
6279
  });
6280
6280
  const ue = j(/* @__PURE__ */ new Set()), Oe = j(0);
6281
6281
  function Ie() {
@@ -6284,8 +6284,8 @@ const Is = [
6284
6284
  if (o.cellEditMode) {
6285
6285
  const b = window.getSelection();
6286
6286
  if (!b || b.rangeCount === 0) return null;
6287
- const B = b.getRangeAt(0);
6288
- return (R = B.commonAncestorContainer.nodeType === 1 ? B.commonAncestorContainer : B.commonAncestorContainer.parentElement) == null ? void 0 : R.closest(".table-cell-inner");
6287
+ const L = b.getRangeAt(0);
6288
+ return (R = L.commonAncestorContainer.nodeType === 1 ? L.commonAncestorContainer : L.commonAncestorContainer.parentElement) == null ? void 0 : R.closest(".table-cell-inner");
6289
6289
  }
6290
6290
  return o.rootEl.querySelector(`[data-block-id="${o.blockId}"]`);
6291
6291
  }
@@ -6305,9 +6305,9 @@ const Is = [
6305
6305
  if (v && v.rangeCount > 0) {
6306
6306
  const w = v.getRangeAt(0);
6307
6307
  if (!w.collapsed && b.contains(w.commonAncestorContainer)) {
6308
- const x = [], L = document.createTreeWalker(b, NodeFilter.SHOW_TEXT);
6309
- for (; L.nextNode(); ) {
6310
- const q = L.currentNode;
6308
+ const x = [], B = document.createTreeWalker(b, NodeFilter.SHOW_TEXT);
6309
+ for (; B.nextNode(); ) {
6310
+ const q = B.currentNode;
6311
6311
  (q.nodeValue ?? "").length !== 0 && w.intersectsNode(q) && x.push(q);
6312
6312
  }
6313
6313
  if (x.length > 0) {
@@ -6336,12 +6336,12 @@ const Is = [
6336
6336
  }
6337
6337
  }
6338
6338
  }
6339
- const B = S.value, he = o.blockId ? B.doc.blocks.get(o.blockId) : void 0;
6339
+ const L = S.value, he = o.blockId ? L.doc.blocks.get(o.blockId) : void 0;
6340
6340
  if (!he) {
6341
6341
  ue.value = R;
6342
6342
  return;
6343
6343
  }
6344
- const Ne = B.selection;
6344
+ const Ne = L.selection;
6345
6345
  let Ke = 0, Pe = Fe(he.content).length;
6346
6346
  if (Ne.kind === "text" && Ne.anchor.blockId === o.blockId && Ne.focus.blockId === o.blockId)
6347
6347
  Ke = Math.min(Ne.anchor.offset, Ne.focus.offset), Pe = Math.max(Ne.anchor.offset, Ne.focus.offset);
@@ -6355,15 +6355,15 @@ const Is = [
6355
6355
  }
6356
6356
  const Ee = ["bold", "italic", "underline", "strikethrough", "code", "link"];
6357
6357
  for (const v of Ee) {
6358
- let w = !0, x = !1, L = 0;
6358
+ let w = !0, x = !1, B = 0;
6359
6359
  for (const q of he.content) {
6360
6360
  if (q.type !== "text") continue;
6361
- const Q = L, de = L + q.text.length;
6361
+ const Q = B, de = B + q.text.length;
6362
6362
  if (de > Ke && Q < Pe && (x = !0, !q.marks || !q.marks.some((Ce) => Ce.type === v))) {
6363
6363
  w = !1;
6364
6364
  break;
6365
6365
  }
6366
- L = de;
6366
+ B = de;
6367
6367
  }
6368
6368
  x && w && R.add(v);
6369
6369
  }
@@ -6401,20 +6401,20 @@ const Is = [
6401
6401
  { id: "strikethrough", title: l("mark.strikethrough"), iconHtml: '<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z" fill="currentColor"/></svg>' },
6402
6402
  { id: "code", title: l("mark.inlineCode"), iconHtml: '<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M197.802 747.664v-145.287a58.916 58.916 0 0 0-58.916-58.916h-19.619v-62.922h19.619a58.916 58.916 0 0 0 58.916-58.916V276.336a117.832 117.832 0 0 1 117.832-117.832h39.297v78.535h-39.356a39.297 39.297 0 0 0-39.238 39.297v161.017A78.594 78.594 0 0 1 222.37 512a78.594 78.594 0 0 1 53.967 74.646V747.664a39.238 39.238 0 0 0 39.238 39.238h39.356v78.594h-39.356a117.832 117.832 0 0 1-117.832-117.832z m628.456-145.287V747.664a117.832 117.832 0 0 1-117.832 117.832h-39.356v-78.594h39.356a39.238 39.238 0 0 0 39.238-39.238v-161.017A78.535 78.535 0 0 1 801.63 512a78.594 78.594 0 0 1-53.967-74.646V276.336a39.297 39.297 0 0 0-39.238-39.297h-39.356V158.504h39.356a117.832 117.832 0 0 1 117.832 117.832v145.287a58.916 58.916 0 0 0 58.916 58.916h19.56v62.922h-19.56a58.916 58.916 0 0 0-58.916 58.916z" fill="currentColor"/></svg>' }
6403
6403
  ]), Bt = Me(() => {
6404
- const R = o.blockType, b = o.blockAttrs, B = (Ne, Ke) => R === Ne && (Ke === void 0 || Number(b.level) === Ke);
6404
+ const R = o.blockType, b = o.blockAttrs, L = (Ne, Ke) => R === Ne && (Ke === void 0 || Number(b.level) === Ke);
6405
6405
  return [
6406
- { id: "text", label: l("turnInto.paragraph"), iconHtml: Bl, active: B("paragraph"), convertType: "paragraph" },
6407
- { id: "h1", label: l("turnInto.h1"), iconHtml: Ol, active: B("heading", 1), convertType: "heading", convertAttrs: { level: 1 } },
6408
- { id: "h2", label: l("turnInto.h2"), iconHtml: Dl, active: B("heading", 2), convertType: "heading", convertAttrs: { level: 2 } },
6409
- { id: "h3", label: l("turnInto.h3"), iconHtml: $l, active: B("heading", 3), convertType: "heading", convertAttrs: { level: 3 } },
6410
- { id: "h4", label: l("turnInto.h4"), iconHtml: Pl, active: B("heading", 4), convertType: "heading", convertAttrs: { level: 4 } },
6411
- { id: "h5", label: l("turnInto.h5"), iconHtml: Hl, active: B("heading", 5), convertType: "heading", convertAttrs: { level: 5 } },
6412
- { id: "h6", label: l("turnInto.h6"), iconHtml: Ul, active: B("heading", 6), convertType: "heading", convertAttrs: { level: 6 } },
6413
- { id: "bullet", label: l("turnInto.bullet"), iconHtml: Fl, active: B("bulletList"), convertType: "bulletList" },
6414
- { id: "ordered", label: l("turnInto.ordered"), iconHtml: zl, active: B("orderedList"), convertType: "orderedList" },
6415
- { id: "todo", label: l("turnInto.todo"), iconHtml: Kl, active: B("todoList"), convertType: "todoList", convertAttrs: { checked: !1 } },
6416
- { id: "quote", label: l("turnInto.quote"), iconHtml: Wl, active: B("quote"), convertType: "quote" },
6417
- { id: "code", label: l("turnInto.code"), iconHtml: Vl, active: B("codeBlock"), convertType: "codeBlock", convertAttrs: { language: "plain" } }
6406
+ { id: "text", label: l("turnInto.paragraph"), iconHtml: Bl, active: L("paragraph"), convertType: "paragraph" },
6407
+ { id: "h1", label: l("turnInto.h1"), iconHtml: Ol, active: L("heading", 1), convertType: "heading", convertAttrs: { level: 1 } },
6408
+ { id: "h2", label: l("turnInto.h2"), iconHtml: Dl, active: L("heading", 2), convertType: "heading", convertAttrs: { level: 2 } },
6409
+ { id: "h3", label: l("turnInto.h3"), iconHtml: $l, active: L("heading", 3), convertType: "heading", convertAttrs: { level: 3 } },
6410
+ { id: "h4", label: l("turnInto.h4"), iconHtml: Pl, active: L("heading", 4), convertType: "heading", convertAttrs: { level: 4 } },
6411
+ { id: "h5", label: l("turnInto.h5"), iconHtml: Hl, active: L("heading", 5), convertType: "heading", convertAttrs: { level: 5 } },
6412
+ { id: "h6", label: l("turnInto.h6"), iconHtml: Ul, active: L("heading", 6), convertType: "heading", convertAttrs: { level: 6 } },
6413
+ { id: "bullet", label: l("turnInto.bullet"), iconHtml: Fl, active: L("bulletList"), convertType: "bulletList" },
6414
+ { id: "ordered", label: l("turnInto.ordered"), iconHtml: zl, active: L("orderedList"), convertType: "orderedList" },
6415
+ { id: "todo", label: l("turnInto.todo"), iconHtml: Kl, active: L("todoList"), convertType: "todoList", convertAttrs: { checked: !1 } },
6416
+ { id: "quote", label: l("turnInto.quote"), iconHtml: Wl, active: L("quote"), convertType: "quote" },
6417
+ { id: "code", label: l("turnInto.code"), iconHtml: Vl, active: L("codeBlock"), convertType: "codeBlock", convertAttrs: { language: "plain" } }
6418
6418
  ];
6419
6419
  }), lt = Me(() => {
6420
6420
  const R = Bt.value.find((b) => b.active);
@@ -6436,13 +6436,13 @@ const Is = [
6436
6436
  X.value = !1;
6437
6437
  return;
6438
6438
  }
6439
- const B = b.scrollLeft;
6439
+ const L = b.scrollLeft;
6440
6440
  b.style.maxWidth = "", b.offsetWidth;
6441
6441
  const he = b.scrollWidth, Ne = o.mobile ? Math.max(120, (((Ee = R.parentElement) == null ? void 0 : Ee.clientWidth) ?? R.clientWidth) - 8) : Math.max(200, document.documentElement.clientWidth - 32), Ke = vp * 2, Pe = Ne - Ke;
6442
6442
  if (he > Pe) {
6443
6443
  X.value = !0, b.style.maxWidth = `${Pe}px`;
6444
6444
  const v = Math.max(0, b.scrollWidth - b.clientWidth);
6445
- b.scrollLeft = Math.min(B, v), He();
6445
+ b.scrollLeft = Math.min(L, v), He();
6446
6446
  } else
6447
6447
  X.value = !1, b.style.maxWidth = "", A.value = !1, W.value = !1;
6448
6448
  }
@@ -6451,31 +6451,31 @@ const Is = [
6451
6451
  R && (A.value = R.scrollLeft > 0, W.value = R.scrollLeft + R.clientWidth < R.scrollWidth - 1);
6452
6452
  }
6453
6453
  function sn(R) {
6454
- K.value = null;
6454
+ z.value = null;
6455
6455
  const b = le.value;
6456
6456
  b && (b.scrollLeft += R * mp, He());
6457
6457
  }
6458
- let pt = null, Lt = 0, P = 0, k = !1, z = !1;
6458
+ let pt = null, Lt = 0, P = 0, k = !1, K = !1;
6459
6459
  function _e(R) {
6460
6460
  if (!k) return;
6461
6461
  const b = R.touches[0];
6462
6462
  if (!b) return;
6463
- const B = Math.abs(b.clientX - Lt), he = Math.abs(b.clientY - P);
6464
- (B > Li || he > Li) && (z || (K.value = null), z = !0);
6463
+ const L = Math.abs(b.clientX - Lt), he = Math.abs(b.clientY - P);
6464
+ (L > Li || he > Li) && (K || (z.value = null), K = !0);
6465
6465
  }
6466
6466
  function Se(R) {
6467
6467
  if (!k) return;
6468
6468
  const b = pt;
6469
6469
  pt = null, k = !1;
6470
- const B = z;
6471
- z = !1, B || (R.cancelable && R.preventDefault(), b && b());
6470
+ const L = K;
6471
+ K = !1, L || (R.cancelable && R.preventDefault(), b && b());
6472
6472
  }
6473
6473
  function dt(R, b) {
6474
6474
  b.cancelable && b.preventDefault(), sn(R);
6475
6475
  }
6476
6476
  function ht(R, b) {
6477
- const B = b.touches[0];
6478
- B && (Lt = B.clientX, P = B.clientY), pt = R, k = !0, z = !1;
6477
+ const L = b.touches[0];
6478
+ L && (Lt = L.clientX, P = L.clientY), pt = R, k = !0, K = !1;
6479
6479
  }
6480
6480
  Tt(
6481
6481
  [() => o.visible, () => o.selectionRect, a, () => o.mobile],
@@ -6488,12 +6488,12 @@ const Is = [
6488
6488
  const R = a.value;
6489
6489
  if (!R) return;
6490
6490
  it(), await qe();
6491
- const b = R.getBoundingClientRect(), B = b.width, he = Math.max(b.height, fl);
6491
+ const b = R.getBoundingClientRect(), L = b.width, he = Math.max(b.height, fl);
6492
6492
  F.value = o.tableMode ? Ai(o.rootEl, o.selectionRect, {
6493
- width: B,
6493
+ width: L,
6494
6494
  height: he
6495
6495
  }) : Si(o.rootEl, o.selectionRect, {
6496
- width: B,
6496
+ width: L,
6497
6497
  height: he
6498
6498
  });
6499
6499
  },
@@ -6505,9 +6505,9 @@ const Is = [
6505
6505
  width: "100vw",
6506
6506
  height: "100vh"
6507
6507
  })), En = Me(() => {
6508
- const R = a.value, b = (R == null ? void 0 : R.offsetWidth) ?? kp, B = document.documentElement.clientWidth, he = 8;
6508
+ const R = a.value, b = (R == null ? void 0 : R.offsetWidth) ?? kp, L = document.documentElement.clientWidth, he = 8;
6509
6509
  let Ne = F.value.left;
6510
- const Ke = Math.max(he, B - b - he);
6510
+ const Ke = Math.max(he, L - b - he);
6511
6511
  Ne = Math.max(he, Math.min(Ke, Ne));
6512
6512
  const Pe = {
6513
6513
  top: `${F.value.top}px`,
@@ -6520,14 +6520,14 @@ const Is = [
6520
6520
  return Pe;
6521
6521
  });
6522
6522
  async function Ye(R) {
6523
- K.value = K.value === R ? null : R, K.value && (await qe(), Hn());
6523
+ z.value = z.value === R ? null : R, z.value && (await qe(), Un());
6524
6524
  }
6525
- function Hn() {
6526
- const R = K.value;
6525
+ function Un() {
6526
+ const R = z.value;
6527
6527
  if (!R) return;
6528
- const b = R === "type" ? d.value : R === "align" ? u.value : R === "verticalAlign" ? h.value : p.value, B = R === "type" ? f.value : R === "align" ? m.value : R === "verticalAlign" ? T.value : D.value;
6529
- if (!b || !B) return;
6530
- const he = B.getBoundingClientRect(), Ne = window.innerHeight, Ke = 6, Pe = Math.floor(Ne - he.bottom - Ke), Ee = Math.floor(he.top - Ke), v = b.scrollHeight;
6528
+ const b = R === "type" ? d.value : R === "align" ? u.value : R === "verticalAlign" ? h.value : p.value, L = R === "type" ? f.value : R === "align" ? m.value : R === "verticalAlign" ? T.value : D.value;
6529
+ if (!b || !L) return;
6530
+ const he = L.getBoundingClientRect(), Ne = window.innerHeight, Ke = 6, Pe = Math.floor(Ne - he.bottom - Ke), Ee = Math.floor(he.top - Ke), v = b.scrollHeight;
6531
6531
  if (o.mobile) {
6532
6532
  const q = document.documentElement.clientHeight, Q = 10;
6533
6533
  if (c.value) {
@@ -6568,8 +6568,8 @@ const Is = [
6568
6568
  const q = o.rootEl.getBoundingClientRect(), Q = a.value.getBoundingClientRect();
6569
6569
  q.bottom - Q.bottom < Bi && Ee > Bi && (w = !0);
6570
6570
  }
6571
- let x = !1, L;
6572
- w ? (x = !0, L = Ee) : v <= Pe ? (x = !1, L = Pe) : Ee > Pe ? (x = !0, L = Ee) : (x = !1, L = Pe), oe.value = x, $.value = Math.max(120, Math.min(L, 360)), qe(un);
6571
+ let x = !1, B;
6572
+ w ? (x = !0, B = Ee) : v <= Pe ? (x = !1, B = Pe) : Ee > Pe ? (x = !0, B = Ee) : (x = !1, B = Pe), oe.value = x, $.value = Math.max(120, Math.min(B, 360)), qe(un);
6573
6573
  }
6574
6574
  function un() {
6575
6575
  const R = U.value;
@@ -6579,19 +6579,19 @@ const Is = [
6579
6579
  }
6580
6580
  ce.value = R.scrollTop > 1, G.value = R.scrollTop + R.clientHeight < R.scrollHeight - 1;
6581
6581
  }
6582
- function On() {
6582
+ function Dn() {
6583
6583
  const R = U.value;
6584
6584
  R && (R.scrollTop -= R.clientHeight * 0.8);
6585
6585
  }
6586
- function Un() {
6586
+ function Fn() {
6587
6587
  const R = U.value;
6588
6588
  R && (R.scrollTop += R.clientHeight * 0.8);
6589
6589
  }
6590
6590
  jr(U, un);
6591
- function Fn(R) {
6592
- var B, he, Ne, Ke, Pe;
6591
+ function zn(R) {
6592
+ var L, he, Ne, Ke, Pe;
6593
6593
  if (r("interacting"), o.tableMode || o.cellEditMode) {
6594
- R.convertType === "heading" && ((B = R.convertAttrs) != null && B.level) ? r("tableType", `heading${R.convertAttrs.level}`) : r("tableType", R.convertType), K.value = null, o.tableMode && r("close");
6594
+ R.convertType === "heading" && ((L = R.convertAttrs) != null && L.level) ? r("tableType", `heading${R.convertAttrs.level}`) : r("tableType", R.convertType), z.value = null, o.tableMode && r("close");
6595
6595
  return;
6596
6596
  }
6597
6597
  const b = Et();
@@ -6602,41 +6602,41 @@ const Is = [
6602
6602
  type: R.convertType,
6603
6603
  attrs: R.convertAttrs ?? {}
6604
6604
  });
6605
- K.value = null, r("close");
6605
+ z.value = null, r("close");
6606
6606
  return;
6607
6607
  }
6608
6608
  y.value && ((Pe = (Ke = s.commands).convertBlock) == null || Pe.call(Ke, {
6609
6609
  id: y.value,
6610
6610
  type: R.convertType,
6611
6611
  attrs: R.convertAttrs ?? {}
6612
- }), K.value = null, r("close"));
6612
+ }), z.value = null, r("close"));
6613
6613
  }
6614
6614
  function Le(R) {
6615
- var B, he, Ne, Ke;
6615
+ var L, he, Ne, Ke;
6616
6616
  if (r("interacting"), o.tableMode || o.cellEditMode) {
6617
- r("tableAlign", R), K.value = null;
6617
+ r("tableAlign", R), z.value = null;
6618
6618
  return;
6619
6619
  }
6620
6620
  const b = Et();
6621
6621
  if (b) {
6622
6622
  for (const Pe of b.ranges)
6623
- (he = (B = s.commands).setBlockAlign) == null || he.call(B, { id: Pe.id, align: R });
6624
- K.value = null;
6623
+ (he = (L = s.commands).setBlockAlign) == null || he.call(L, { id: Pe.id, align: R });
6624
+ z.value = null;
6625
6625
  return;
6626
6626
  }
6627
- y.value && ((Ke = (Ne = s.commands).setBlockAlign) == null || Ke.call(Ne, { id: y.value, align: R }), K.value = null);
6627
+ y.value && ((Ke = (Ne = s.commands).setBlockAlign) == null || Ke.call(Ne, { id: y.value, align: R }), z.value = null);
6628
6628
  }
6629
6629
  function $e(R) {
6630
6630
  if (o.tableMode || o.cellEditMode) {
6631
- r("tableVerticalAlign", R), K.value = null;
6631
+ r("tableVerticalAlign", R), z.value = null;
6632
6632
  return;
6633
6633
  }
6634
- K.value = null;
6634
+ z.value = null;
6635
6635
  }
6636
6636
  function tt(R) {
6637
6637
  var he, Ne, Ke, Pe;
6638
6638
  if (r("interacting"), o.tableMode) {
6639
- r("tableTextColor", R === "default" ? null : R), K.value = null;
6639
+ r("tableTextColor", R === "default" ? null : R), z.value = null;
6640
6640
  return;
6641
6641
  }
6642
6642
  if (o.cellEditMode) {
@@ -6646,8 +6646,8 @@ const Is = [
6646
6646
  if (R === "default") {
6647
6647
  const w = v.extractContents();
6648
6648
  w.querySelectorAll('span[class*="be-color-"]').forEach((x) => {
6649
- const L = x.className.replace(/be-color-\w+/g, "").trim();
6650
- if (L) x.className = L;
6649
+ const B = x.className.replace(/be-color-\w+/g, "").trim();
6650
+ if (B) x.className = B;
6651
6651
  else {
6652
6652
  for (; x.firstChild; ) x.parentNode.insertBefore(x.firstChild, x);
6653
6653
  x.parentNode.removeChild(x);
@@ -6660,7 +6660,7 @@ const Is = [
6660
6660
  x.selectNodeContents(w), Ee.addRange(x);
6661
6661
  }
6662
6662
  }
6663
- K.value = null, Je();
6663
+ z.value = null, Je();
6664
6664
  return;
6665
6665
  }
6666
6666
  const b = Et();
@@ -6676,21 +6676,21 @@ const Is = [
6676
6676
  return;
6677
6677
  }
6678
6678
  if (!y.value) return;
6679
- const B = $t();
6680
- B && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
6679
+ const L = $t();
6680
+ L && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
6681
6681
  id: y.value,
6682
6682
  markType: "color",
6683
6683
  attrs: R === "default" ? null : { color: R },
6684
- from: B.from,
6685
- to: B.to
6684
+ from: L.from,
6685
+ to: L.to
6686
6686
  }), qe(() => {
6687
6687
  var Q;
6688
- const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, L = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && L);
6688
+ const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
6689
6689
  if (!x) {
6690
6690
  r("close");
6691
6691
  return;
6692
6692
  }
6693
- if (!q && !L) {
6693
+ if (!q && !B) {
6694
6694
  r("close");
6695
6695
  return;
6696
6696
  }
@@ -6700,7 +6700,7 @@ const Is = [
6700
6700
  function mt(R) {
6701
6701
  var he, Ne, Ke, Pe;
6702
6702
  if (r("interacting"), o.tableMode) {
6703
- r("tableBgColor", R === "default" ? null : R), K.value = null;
6703
+ r("tableBgColor", R === "default" ? null : R), z.value = null;
6704
6704
  return;
6705
6705
  }
6706
6706
  if (o.cellEditMode) {
@@ -6710,8 +6710,8 @@ const Is = [
6710
6710
  if (R === "default") {
6711
6711
  const w = v.extractContents();
6712
6712
  w.querySelectorAll('span[class*="be-bg-"]').forEach((x) => {
6713
- const L = x.className.replace(/be-bg-\w+/g, "").trim();
6714
- if (L) x.className = L;
6713
+ const B = x.className.replace(/be-bg-\w+/g, "").trim();
6714
+ if (B) x.className = B;
6715
6715
  else {
6716
6716
  for (; x.firstChild; ) x.parentNode.insertBefore(x.firstChild, x);
6717
6717
  x.parentNode.removeChild(x);
@@ -6724,7 +6724,7 @@ const Is = [
6724
6724
  x.selectNodeContents(w), Ee.addRange(x);
6725
6725
  }
6726
6726
  }
6727
- K.value = null, Je();
6727
+ z.value = null, Je();
6728
6728
  return;
6729
6729
  }
6730
6730
  const b = Et();
@@ -6740,21 +6740,21 @@ const Is = [
6740
6740
  return;
6741
6741
  }
6742
6742
  if (!y.value) return;
6743
- const B = $t();
6744
- B && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
6743
+ const L = $t();
6744
+ L && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
6745
6745
  id: y.value,
6746
6746
  markType: "bgColor",
6747
6747
  attrs: R === "default" ? null : { bgColor: R },
6748
- from: B.from,
6749
- to: B.to
6748
+ from: L.from,
6749
+ to: L.to
6750
6750
  }), qe(() => {
6751
6751
  var Q;
6752
- const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, L = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && L);
6752
+ const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
6753
6753
  if (!x) {
6754
6754
  r("close");
6755
6755
  return;
6756
6756
  }
6757
- if (!q && !L) {
6757
+ if (!q && !B) {
6758
6758
  r("close");
6759
6759
  return;
6760
6760
  }
@@ -6771,7 +6771,7 @@ const Is = [
6771
6771
  if (v && w && w.rangeCount > 0) {
6772
6772
  const x = w.getRangeAt(0);
6773
6773
  if (!x.collapsed && v.contains(x.commonAncestorContainer)) {
6774
- const L = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Set(), Q = [], de = document.createTreeWalker(v, NodeFilter.SHOW_TEXT);
6774
+ const B = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Set(), Q = [], de = document.createTreeWalker(v, NodeFilter.SHOW_TEXT);
6775
6775
  for (; de.nextNode(); ) {
6776
6776
  const ge = de.currentNode;
6777
6777
  (ge.nodeValue ?? "").length !== 0 && x.intersectsNode(ge) && Q.push(ge);
@@ -6783,7 +6783,7 @@ const Is = [
6783
6783
  const ke = Ce.className;
6784
6784
  if (typeof ke == "string") {
6785
6785
  const Re = ke.match(/be-color-(\w+)/);
6786
- Re && L.add(Re[1]);
6786
+ Re && B.add(Re[1]);
6787
6787
  const Be = ke.match(/be-bg-(\w+)/);
6788
6788
  Be && q.add(Be[1]);
6789
6789
  }
@@ -6791,8 +6791,8 @@ const Is = [
6791
6791
  Ce = Ce.parentNode;
6792
6792
  }
6793
6793
  }
6794
- if (L.size > 0 || q.size > 0) {
6795
- ye.value = L.size === 1 ? [...L][0] : "", pe.value = q.size === 1 ? [...q][0] : "";
6794
+ if (B.size > 0 || q.size > 0) {
6795
+ ye.value = B.size === 1 ? [...B][0] : "", pe.value = q.size === 1 ? [...q][0] : "";
6796
6796
  return;
6797
6797
  }
6798
6798
  }
@@ -6803,10 +6803,10 @@ const Is = [
6803
6803
  ye.value = "", pe.value = "";
6804
6804
  return;
6805
6805
  }
6806
- const B = R.selection;
6806
+ const L = R.selection;
6807
6807
  let he, Ne;
6808
- if (B.kind === "text" && B.anchor.blockId === o.blockId && B.focus.blockId === o.blockId)
6809
- he = Math.min(B.anchor.offset, B.focus.offset), Ne = Math.max(B.anchor.offset, B.focus.offset);
6808
+ if (L.kind === "text" && L.anchor.blockId === o.blockId && L.focus.blockId === o.blockId)
6809
+ he = Math.min(L.anchor.offset, L.focus.offset), Ne = Math.max(L.anchor.offset, L.focus.offset);
6810
6810
  else {
6811
6811
  const v = $t();
6812
6812
  he = v ? v.from : 0, Ne = v ? v.to : Fe(b.content).length;
@@ -6821,8 +6821,8 @@ const Is = [
6821
6821
  if (v.type !== "text") continue;
6822
6822
  const w = Ee, x = Ee + v.text.length;
6823
6823
  if (x > he && w < Ne && v.marks)
6824
- for (const L of v.marks)
6825
- L.type === "color" && L.attrs && typeof L.attrs.color == "string" && Ke.add(L.attrs.color), L.type === "bgColor" && L.attrs && typeof L.attrs.bgColor == "string" && Pe.add(L.attrs.bgColor);
6824
+ for (const B of v.marks)
6825
+ B.type === "color" && B.attrs && typeof B.attrs.color == "string" && Ke.add(B.attrs.color), B.type === "bgColor" && B.attrs && typeof B.attrs.bgColor == "string" && Pe.add(B.attrs.bgColor);
6826
6826
  Ee = x;
6827
6827
  }
6828
6828
  ye.value = Ke.size === 1 ? [...Ke][0] : "", pe.value = Pe.size === 1 ? [...Pe][0] : "";
@@ -6833,29 +6833,29 @@ const Is = [
6833
6833
  if (!R) return null;
6834
6834
  const b = window.getSelection();
6835
6835
  if (!b || b.rangeCount === 0) return null;
6836
- const B = b.getRangeAt(0);
6837
- if (B.collapsed || !R.contains(B.commonAncestorContainer)) return null;
6836
+ const L = b.getRangeAt(0);
6837
+ if (L.collapsed || !R.contains(L.commonAncestorContainer)) return null;
6838
6838
  const he = document.createRange();
6839
- he.selectNodeContents(R), he.setEnd(B.startContainer, B.startOffset);
6839
+ he.selectNodeContents(R), he.setEnd(L.startContainer, L.startOffset);
6840
6840
  const Ne = he.toString().length;
6841
- he.setEnd(B.endContainer, B.endOffset);
6841
+ he.setEnd(L.endContainer, L.endOffset);
6842
6842
  const Ke = he.toString().length;
6843
6843
  return { from: Math.min(Ne, Ke), to: Math.max(Ne, Ke) };
6844
6844
  }
6845
6845
  function Et() {
6846
6846
  const R = S.value.selection;
6847
6847
  if (R.kind !== "text" || !on(R)) return null;
6848
- const b = S.value.doc, B = ao(b), he = B.indexOf(R.anchor.blockId), Ne = B.indexOf(R.focus.blockId);
6848
+ const b = S.value.doc, L = ao(b), he = L.indexOf(R.anchor.blockId), Ne = L.indexOf(R.focus.blockId);
6849
6849
  if (he === -1 || Ne === -1) return null;
6850
- const [Ke, Pe] = he <= Ne ? [R.anchor, R.focus] : [R.focus, R.anchor], Ee = B.indexOf(Ke.blockId), v = B.indexOf(Pe.blockId);
6850
+ const [Ke, Pe] = he <= Ne ? [R.anchor, R.focus] : [R.focus, R.anchor], Ee = L.indexOf(Ke.blockId), v = L.indexOf(Pe.blockId);
6851
6851
  if (Ee === -1 || v === -1 || Ee > v) return null;
6852
6852
  const w = [];
6853
6853
  for (let x = Ee; x <= v; x++) {
6854
- const L = B[x], q = b.blocks.get(L);
6854
+ const B = L[x], q = b.blocks.get(B);
6855
6855
  if (!q) continue;
6856
6856
  const Q = Fe(q.content).length;
6857
6857
  let de = 0, ge = Q;
6858
- x === Ee && (de = Math.min(Ke.offset, Q)), x === v && (ge = Math.min(Pe.offset, Q)), w.push({ id: L, from: de, to: ge });
6858
+ x === Ee && (de = Math.min(Ke.offset, Q)), x === v && (ge = Math.min(Pe.offset, Q)), w.push({ id: B, from: de, to: ge });
6859
6859
  }
6860
6860
  return { ranges: w };
6861
6861
  }
@@ -6864,9 +6864,9 @@ const Is = [
6864
6864
  if (R.kind !== "text" || !on(R)) return null;
6865
6865
  const b = Et();
6866
6866
  if (!b) return null;
6867
- const B = S.value.doc, he = [], Ne = [];
6867
+ const L = S.value.doc, he = [], Ne = [];
6868
6868
  for (const Ke of b.ranges) {
6869
- const Pe = B.blocks.get(Ke.id);
6869
+ const Pe = L.blocks.get(Ke.id);
6870
6870
  if (!Pe) continue;
6871
6871
  const [, Ee] = pn(Pe.content, Ke.from), [v] = pn(Ee, Ke.to - Ke.from);
6872
6872
  he.push(Fe(v)), Ne.push(mo(v));
@@ -6891,11 +6891,11 @@ const Is = [
6891
6891
  if (v === "insertHTML") {
6892
6892
  const w = window.getSelection();
6893
6893
  if (w && w.rangeCount > 0 && !w.isCollapsed) {
6894
- const x = w.getRangeAt(0), L = document.createElement("code");
6894
+ const x = w.getRangeAt(0), B = document.createElement("code");
6895
6895
  try {
6896
- L.appendChild(x.extractContents()), x.insertNode(L), w.removeAllRanges();
6896
+ B.appendChild(x.extractContents()), x.insertNode(B), w.removeAllRanges();
6897
6897
  const q = document.createRange();
6898
- q.selectNodeContents(L), w.addRange(q);
6898
+ q.selectNodeContents(B), w.addRange(q);
6899
6899
  } catch {
6900
6900
  }
6901
6901
  }
@@ -6915,21 +6915,21 @@ const Is = [
6915
6915
  return;
6916
6916
  }
6917
6917
  if (!y.value) return;
6918
- const B = $t();
6919
- B && ((Pe = (Ke = s.commands).toggleMark) == null || Pe.call(Ke, {
6918
+ const L = $t();
6919
+ L && ((Pe = (Ke = s.commands).toggleMark) == null || Pe.call(Ke, {
6920
6920
  id: y.value,
6921
6921
  markType: R,
6922
- from: B.from,
6923
- to: B.to
6922
+ from: L.from,
6923
+ to: L.to
6924
6924
  }), qe(() => {
6925
6925
  var Q;
6926
6926
  Oe.value++;
6927
- const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, L = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && L);
6927
+ const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
6928
6928
  if (!x) {
6929
6929
  r("close");
6930
6930
  return;
6931
6931
  }
6932
- if (!q && !L) {
6932
+ if (!q && !B) {
6933
6933
  r("close");
6934
6934
  return;
6935
6935
  }
@@ -6937,7 +6937,7 @@ const Is = [
6937
6937
  }));
6938
6938
  }
6939
6939
  function Cn() {
6940
- if (r("interacting"), K.value = null, o.cellEditMode) {
6940
+ if (r("interacting"), z.value = null, o.cellEditMode) {
6941
6941
  r("linkClick", y.value ?? "", 0, 0);
6942
6942
  return;
6943
6943
  }
@@ -6957,13 +6957,13 @@ const Is = [
6957
6957
  (he = navigator.clipboard) == null || he.writeText(R.text), r("close");
6958
6958
  return;
6959
6959
  }
6960
- const b = window.getSelection(), B = b ? b.toString() : "";
6961
- B && ((Ne = navigator.clipboard) == null || Ne.writeText(B)), r("close");
6960
+ const b = window.getSelection(), L = b ? b.toString() : "";
6961
+ L && ((Ne = navigator.clipboard) == null || Ne.writeText(L)), r("close");
6962
6962
  }
6963
6963
  t({});
6964
- async function Tn() {
6964
+ async function Mn() {
6965
6965
  if (o.mobile) {
6966
- o.visible && it(), K.value && Hn(), un(), et(), Je();
6966
+ o.visible && it(), z.value && Un(), un(), et(), Je();
6967
6967
  return;
6968
6968
  }
6969
6969
  if (o.visible && o.selectionRect && o.rootEl && a.value) {
@@ -6977,51 +6977,53 @@ const Is = [
6977
6977
  height: Math.max(R.height, fl)
6978
6978
  });
6979
6979
  }
6980
- K.value && Hn(), un(), et(), Je();
6980
+ z.value && Un(), un(), et(), Je();
6981
6981
  }
6982
- function zn(R) {
6983
- if (!K.value) return;
6984
- const b = [d.value, u.value, h.value, p.value], B = [f.value, m.value, T.value, D.value];
6982
+ function xn(R) {
6983
+ if (!z.value) return;
6984
+ const b = [d.value, u.value, h.value, p.value], L = [f.value, m.value, T.value, D.value];
6985
6985
  for (const he of b)
6986
6986
  if (he && he.contains(R)) return;
6987
- for (const he of B)
6987
+ for (const he of L)
6988
6988
  if (he && he.contains(R)) return;
6989
- K.value = null;
6989
+ z.value = null;
6990
6990
  }
6991
6991
  function Kn(R) {
6992
6992
  if (!o.visible) return;
6993
6993
  const b = a.value;
6994
6994
  if (b && b.contains(R.target)) {
6995
- R.preventDefault();
6995
+ R.preventDefault(), z.value && xn(R.target);
6996
6996
  return;
6997
6997
  }
6998
- zn(R.target);
6998
+ xn(R.target);
6999
6999
  }
7000
- function xn(R) {
7000
+ function _n(R) {
7001
7001
  if (!o.visible || !R.touches[0]) return;
7002
- const B = R.target, he = a.value;
7003
- if (he && he.contains(B)) {
7002
+ const L = R.target, he = a.value;
7003
+ if (he && he.contains(L)) {
7004
7004
  const Ne = le.value;
7005
- if (Ne && Ne.contains(B))
7005
+ if (Ne && Ne.contains(L)) {
7006
+ z.value && xn(L);
7006
7007
  return;
7007
- R.preventDefault();
7008
+ }
7009
+ R.preventDefault(), z.value && xn(L);
7008
7010
  return;
7009
7011
  }
7010
- zn(B);
7012
+ xn(L);
7011
7013
  }
7012
7014
  Tt(() => o.visible, (R) => {
7013
7015
  R && qe(() => {
7014
7016
  et(), Je();
7015
7017
  });
7016
7018
  }), oo(() => {
7017
- window.addEventListener("scroll", Tn, !0), window.addEventListener("resize", Tn), window.addEventListener("mousedown", Kn, !0), window.addEventListener("touchstart", xn, !0), document.addEventListener("selectionchange", po), I = s.subscribe(() => {
7019
+ window.addEventListener("scroll", Mn, !0), window.addEventListener("resize", Mn), window.addEventListener("mousedown", Kn, !0), window.addEventListener("touchstart", _n, !0), document.addEventListener("selectionchange", po), I = s.subscribe(() => {
7018
7020
  qe(() => {
7019
7021
  const R = s.getState();
7020
7022
  S.value = R, Oe.value++, et(), Je();
7021
7023
  });
7022
7024
  });
7023
- }), Ln(() => {
7024
- window.removeEventListener("scroll", Tn, !0), window.removeEventListener("resize", Tn), window.removeEventListener("mousedown", Kn, !0), window.removeEventListener("touchstart", xn, !0), document.removeEventListener("selectionchange", po), I == null || I(), I = null;
7025
+ }), Bn(() => {
7026
+ window.removeEventListener("scroll", Mn, !0), window.removeEventListener("resize", Mn), window.removeEventListener("mousedown", Kn, !0), window.removeEventListener("touchstart", _n, !0), document.removeEventListener("selectionchange", po), I == null || I(), I = null;
7025
7027
  });
7026
7028
  function po() {
7027
7029
  o.visible && Wn === null && (Wn = requestAnimationFrame(() => {
@@ -7029,7 +7031,7 @@ const Is = [
7029
7031
  }));
7030
7032
  }
7031
7033
  let Wn = null;
7032
- return (R, b) => (Z(), mn($n, {
7034
+ return (R, b) => (Z(), mn(Pn, {
7033
7035
  to: "body",
7034
7036
  disabled: e.mobile
7035
7037
  }, [
@@ -7057,10 +7059,10 @@ const Is = [
7057
7059
  class: ze(["ht-nav-btn ht-nav-left", { disabled: !A.value }]),
7058
7060
  title: fe(l)("ui.scrollLeft"),
7059
7061
  "aria-label": fe(l)("ui.scrollLeft"),
7060
- onMousedown: b[0] || (b[0] = ie((B) => sn(-1), ["prevent", "stop"])),
7062
+ onMousedown: b[0] || (b[0] = ie((L) => sn(-1), ["prevent", "stop"])),
7061
7063
  onTouchstart: b[1] || (b[1] = ie(() => {
7062
7064
  }, ["stop"])),
7063
- onTouchend: b[2] || (b[2] = ie((B) => dt(-1, B), ["stop"])),
7065
+ onTouchend: b[2] || (b[2] = ie((L) => dt(-1, L), ["stop"])),
7064
7066
  onClick: b[3] || (b[3] = ie(() => {
7065
7067
  }, ["prevent", "stop"]))
7066
7068
  }, [...b[39] || (b[39] = [
@@ -7083,7 +7085,7 @@ const Is = [
7083
7085
  C("div", {
7084
7086
  ref_key: "htContentEl",
7085
7087
  ref: le,
7086
- class: ze(["ht-content", { "dropdown-open": !e.mobile && !!K.value }]),
7088
+ class: ze(["ht-content", { "dropdown-open": !e.mobile && !!z.value }]),
7087
7089
  onScroll: He,
7088
7090
  onTouchmovePassive: _e,
7089
7091
  onTouchend: ie(Se, ["stop"])
@@ -7092,14 +7094,14 @@ const Is = [
7092
7094
  C("button", {
7093
7095
  ref_key: "typeBtnEl",
7094
7096
  ref: f,
7095
- class: ze(["ht-btn ht-type-btn", { open: K.value === "type", disabled: ln.value }]),
7097
+ class: ze(["ht-btn ht-type-btn", { open: z.value === "type", disabled: ln.value }]),
7096
7098
  title: fe(l)("hoverToolbar.typeBtnTitle"),
7097
7099
  disabled: ln.value,
7098
- onMousedown: b[4] || (b[4] = ie((B) => !ln.value && Ye("type"), ["prevent", "stop"])),
7099
- onTouchstart: b[5] || (b[5] = ie((B) => {
7100
+ onMousedown: b[4] || (b[4] = ie((L) => !ln.value && Ye("type"), ["prevent", "stop"])),
7101
+ onTouchstart: b[5] || (b[5] = ie((L) => {
7100
7102
  ht(() => {
7101
7103
  ln.value || Ye("type");
7102
- }, B);
7104
+ }, L);
7103
7105
  }, ["stop"])),
7104
7106
  onClick: b[6] || (b[6] = ie(() => {
7105
7107
  }, ["prevent", "stop"]))
@@ -7122,11 +7124,11 @@ const Is = [
7122
7124
  })
7123
7125
  ], -1))
7124
7126
  ], 42, Mf),
7125
- (Z(), mn($n, {
7127
+ (Z(), mn(Pn, {
7126
7128
  to: "body",
7127
7129
  disabled: !e.mobile
7128
7130
  }, [
7129
- K.value === "type" ? (Z(), te("div", {
7131
+ z.value === "type" ? (Z(), te("div", {
7130
7132
  key: 0,
7131
7133
  ref_key: "typeDropdownEl",
7132
7134
  ref: d,
@@ -7138,7 +7140,7 @@ const Is = [
7138
7140
  class: "menu-scroll-btn menu-scroll-up",
7139
7141
  type: "button",
7140
7142
  "aria-label": fe(l)("ui.scrollUp"),
7141
- onMousedown: ie(On, ["prevent"])
7143
+ onMousedown: ie(Dn, ["prevent"])
7142
7144
  }, [...b[41] || (b[41] = [
7143
7145
  C("svg", {
7144
7146
  viewBox: "0 0 12 12",
@@ -7162,17 +7164,17 @@ const Is = [
7162
7164
  class: "ht-dropdown-scroll",
7163
7165
  onScroll: un
7164
7166
  }, [
7165
- (Z(!0), te(rt, null, bn(Bt.value, (B) => (Z(), te("button", {
7166
- key: B.id,
7167
- class: ze(["ht-dropdown-item", { active: B.active }]),
7168
- onMousedown: ie((he) => Fn(B), ["prevent", "stop"])
7167
+ (Z(!0), te(rt, null, bn(Bt.value, (L) => (Z(), te("button", {
7168
+ key: L.id,
7169
+ class: ze(["ht-dropdown-item", { active: L.active }]),
7170
+ onMousedown: ie((he) => zn(L), ["prevent", "stop"])
7169
7171
  }, [
7170
- gn(An, {
7172
+ gn(In, {
7171
7173
  class: "ht-dropdown-icon",
7172
- html: B.iconHtml
7174
+ html: L.iconHtml
7173
7175
  }, null, 8, ["html"]),
7174
- C("span", null, Rt(B.label), 1),
7175
- B.active ? (Z(), te("svg", Nf, [...b[42] || (b[42] = [
7176
+ C("span", null, Rt(L.label), 1),
7177
+ L.active ? (Z(), te("svg", Nf, [...b[42] || (b[42] = [
7176
7178
  C("path", {
7177
7179
  d: "M2.5 6L5 8.5L9.5 4",
7178
7180
  stroke: "currentColor",
@@ -7189,7 +7191,7 @@ const Is = [
7189
7191
  class: "menu-scroll-btn menu-scroll-down",
7190
7192
  type: "button",
7191
7193
  "aria-label": fe(l)("ui.scrollDown"),
7192
- onMousedown: ie(Un, ["prevent"])
7194
+ onMousedown: ie(Fn, ["prevent"])
7193
7195
  }, [...b[43] || (b[43] = [
7194
7196
  C("svg", {
7195
7197
  viewBox: "0 0 12 12",
@@ -7214,14 +7216,14 @@ const Is = [
7214
7216
  C("button", {
7215
7217
  ref_key: "alignBtnEl",
7216
7218
  ref: m,
7217
- class: ze(["ht-btn ht-icon-only", { open: K.value === "align", disabled: Vt.value }]),
7219
+ class: ze(["ht-btn ht-icon-only", { open: z.value === "align", disabled: Vt.value }]),
7218
7220
  title: fe(l)("hoverToolbar.alignBtnTitle"),
7219
7221
  disabled: Vt.value,
7220
- onMousedown: b[7] || (b[7] = ie((B) => !Vt.value && Ye("align"), ["prevent", "stop"])),
7221
- onTouchstart: b[8] || (b[8] = ie((B) => {
7222
+ onMousedown: b[7] || (b[7] = ie((L) => !Vt.value && Ye("align"), ["prevent", "stop"])),
7223
+ onTouchstart: b[8] || (b[8] = ie((L) => {
7222
7224
  ht(() => {
7223
7225
  Vt.value || Ye("align");
7224
- }, B);
7226
+ }, L);
7225
7227
  }, ["stop"])),
7226
7228
  onClick: b[9] || (b[9] = ie(() => {
7227
7229
  }, ["prevent", "stop"]))
@@ -7342,11 +7344,11 @@ const Is = [
7342
7344
  ], 64))
7343
7345
  ]))
7344
7346
  ], 42, Bf),
7345
- (Z(), mn($n, {
7347
+ (Z(), mn(Pn, {
7346
7348
  to: "body",
7347
7349
  disabled: !e.mobile
7348
7350
  }, [
7349
- K.value === "align" ? (Z(), te("div", {
7351
+ z.value === "align" ? (Z(), te("div", {
7350
7352
  key: 0,
7351
7353
  ref_key: "alignDropdownEl",
7352
7354
  ref: u,
@@ -7358,7 +7360,7 @@ const Is = [
7358
7360
  class: "menu-scroll-btn menu-scroll-up",
7359
7361
  type: "button",
7360
7362
  "aria-label": fe(l)("ui.scrollUp"),
7361
- onMousedown: ie(On, ["prevent"])
7363
+ onMousedown: ie(Dn, ["prevent"])
7362
7364
  }, [...b[56] || (b[56] = [
7363
7365
  C("svg", {
7364
7366
  viewBox: "0 0 12 12",
@@ -7382,13 +7384,13 @@ const Is = [
7382
7384
  class: "ht-dropdown-scroll",
7383
7385
  onScroll: un
7384
7386
  }, [
7385
- (Z(!0), te(rt, null, bn(Ze.value, (B) => (Z(), te("button", {
7386
- key: B.id,
7387
- class: ze(["ht-dropdown-item ht-align-item", { active: me.value === B.value }]),
7388
- onMousedown: ie((he) => Le(B.value), ["prevent", "stop"])
7387
+ (Z(!0), te(rt, null, bn(Ze.value, (L) => (Z(), te("button", {
7388
+ key: L.id,
7389
+ class: ze(["ht-dropdown-item ht-align-item", { active: me.value === L.value }]),
7390
+ onMousedown: ie((he) => Le(L.value), ["prevent", "stop"])
7389
7391
  }, [
7390
7392
  (Z(), te("svg", Pf, [
7391
- B.value === "left" ? (Z(), te(rt, { key: 0 }, [
7393
+ L.value === "left" ? (Z(), te(rt, { key: 0 }, [
7392
7394
  b[57] || (b[57] = C("line", {
7393
7395
  x1: "2",
7394
7396
  y1: "4",
@@ -7416,7 +7418,7 @@ const Is = [
7416
7418
  "stroke-width": "1.3",
7417
7419
  "stroke-linecap": "round"
7418
7420
  }, null, -1))
7419
- ], 64)) : B.value === "center" ? (Z(), te(rt, { key: 1 }, [
7421
+ ], 64)) : L.value === "center" ? (Z(), te(rt, { key: 1 }, [
7420
7422
  b[60] || (b[60] = C("line", {
7421
7423
  x1: "2",
7422
7424
  y1: "4",
@@ -7444,7 +7446,7 @@ const Is = [
7444
7446
  "stroke-width": "1.3",
7445
7447
  "stroke-linecap": "round"
7446
7448
  }, null, -1))
7447
- ], 64)) : B.value === "right" ? (Z(), te(rt, { key: 2 }, [
7449
+ ], 64)) : L.value === "right" ? (Z(), te(rt, { key: 2 }, [
7448
7450
  b[63] || (b[63] = C("line", {
7449
7451
  x1: "2",
7450
7452
  y1: "4",
@@ -7502,8 +7504,8 @@ const Is = [
7502
7504
  }, null, -1))
7503
7505
  ], 64))
7504
7506
  ])),
7505
- C("span", null, Rt(B.label), 1),
7506
- me.value === B.value ? (Z(), te("svg", Hf, [...b[69] || (b[69] = [
7507
+ C("span", null, Rt(L.label), 1),
7508
+ me.value === L.value ? (Z(), te("svg", Hf, [...b[69] || (b[69] = [
7507
7509
  C("path", {
7508
7510
  d: "M2.5 6L5 8.5L9.5 4",
7509
7511
  stroke: "currentColor",
@@ -7520,7 +7522,7 @@ const Is = [
7520
7522
  class: "menu-scroll-btn menu-scroll-down",
7521
7523
  type: "button",
7522
7524
  "aria-label": fe(l)("ui.scrollDown"),
7523
- onMousedown: ie(Un, ["prevent"])
7525
+ onMousedown: ie(Fn, ["prevent"])
7524
7526
  }, [...b[70] || (b[70] = [
7525
7527
  C("svg", {
7526
7528
  viewBox: "0 0 12 12",
@@ -7545,14 +7547,14 @@ const Is = [
7545
7547
  C("button", {
7546
7548
  ref_key: "verticalAlignBtnEl",
7547
7549
  ref: T,
7548
- class: ze(["ht-btn ht-icon-only", { open: K.value === "verticalAlign", disabled: Vt.value }]),
7550
+ class: ze(["ht-btn ht-icon-only", { open: z.value === "verticalAlign", disabled: Vt.value }]),
7549
7551
  title: fe(l)("hoverToolbar.verticalAlignBtnTitle"),
7550
7552
  disabled: Vt.value,
7551
- onMousedown: b[10] || (b[10] = ie((B) => !Vt.value && Ye("verticalAlign"), ["prevent", "stop"])),
7552
- onTouchstart: b[11] || (b[11] = ie((B) => {
7553
+ onMousedown: b[10] || (b[10] = ie((L) => !Vt.value && Ye("verticalAlign"), ["prevent", "stop"])),
7554
+ onTouchstart: b[11] || (b[11] = ie((L) => {
7553
7555
  ht(() => {
7554
7556
  Vt.value || Ye("verticalAlign");
7555
- }, B);
7557
+ }, L);
7556
7558
  }, ["stop"])),
7557
7559
  onClick: b[12] || (b[12] = ie(() => {
7558
7560
  }, ["prevent", "stop"]))
@@ -7645,11 +7647,11 @@ const Is = [
7645
7647
  ], 64))
7646
7648
  ]))
7647
7649
  ], 42, zf),
7648
- (Z(), mn($n, {
7650
+ (Z(), mn(Pn, {
7649
7651
  to: "body",
7650
7652
  disabled: !e.mobile
7651
7653
  }, [
7652
- K.value === "verticalAlign" ? (Z(), te("div", {
7654
+ z.value === "verticalAlign" ? (Z(), te("div", {
7653
7655
  key: 0,
7654
7656
  ref_key: "verticalAlignDropdownEl",
7655
7657
  ref: h,
@@ -7661,7 +7663,7 @@ const Is = [
7661
7663
  class: "menu-scroll-btn menu-scroll-up",
7662
7664
  type: "button",
7663
7665
  "aria-label": fe(l)("ui.scrollUp"),
7664
- onMousedown: ie(On, ["prevent"])
7666
+ onMousedown: ie(Dn, ["prevent"])
7665
7667
  }, [...b[80] || (b[80] = [
7666
7668
  C("svg", {
7667
7669
  viewBox: "0 0 12 12",
@@ -7685,13 +7687,13 @@ const Is = [
7685
7687
  class: "ht-dropdown-scroll",
7686
7688
  onScroll: un
7687
7689
  }, [
7688
- (Z(!0), te(rt, null, bn(Ot.value, (B) => (Z(), te("button", {
7689
- key: B.id,
7690
- class: ze(["ht-dropdown-item ht-align-item", { active: ae.value === B.value }]),
7691
- onMousedown: ie((he) => $e(B.value), ["prevent", "stop"])
7690
+ (Z(!0), te(rt, null, bn(Ot.value, (L) => (Z(), te("button", {
7691
+ key: L.id,
7692
+ class: ze(["ht-dropdown-item ht-align-item", { active: ae.value === L.value }]),
7693
+ onMousedown: ie((he) => $e(L.value), ["prevent", "stop"])
7692
7694
  }, [
7693
7695
  (Z(), te("svg", Gf, [
7694
- B.value === "top" ? (Z(), te(rt, { key: 0 }, [
7696
+ L.value === "top" ? (Z(), te(rt, { key: 0 }, [
7695
7697
  b[81] || (b[81] = C("line", {
7696
7698
  x1: "2",
7697
7699
  y1: "3",
@@ -7719,7 +7721,7 @@ const Is = [
7719
7721
  "stroke-width": "1.3",
7720
7722
  "stroke-linecap": "round"
7721
7723
  }, null, -1))
7722
- ], 64)) : B.value === "bottom" ? (Z(), te(rt, { key: 1 }, [
7724
+ ], 64)) : L.value === "bottom" ? (Z(), te(rt, { key: 1 }, [
7723
7725
  b[84] || (b[84] = C("line", {
7724
7726
  x1: "5",
7725
7727
  y1: "5",
@@ -7777,8 +7779,8 @@ const Is = [
7777
7779
  }, null, -1))
7778
7780
  ], 64))
7779
7781
  ])),
7780
- C("span", null, Rt(B.label), 1),
7781
- ae.value === B.value ? (Z(), te("svg", qf, [...b[90] || (b[90] = [
7782
+ C("span", null, Rt(L.label), 1),
7783
+ ae.value === L.value ? (Z(), te("svg", qf, [...b[90] || (b[90] = [
7782
7784
  C("path", {
7783
7785
  d: "M2.5 6L5 8.5L9.5 4",
7784
7786
  stroke: "currentColor",
@@ -7795,7 +7797,7 @@ const Is = [
7795
7797
  class: "menu-scroll-btn menu-scroll-down",
7796
7798
  type: "button",
7797
7799
  "aria-label": fe(l)("ui.scrollDown"),
7798
- onMousedown: ie(Un, ["prevent"])
7800
+ onMousedown: ie(Fn, ["prevent"])
7799
7801
  }, [...b[91] || (b[91] = [
7800
7802
  C("svg", {
7801
7803
  viewBox: "0 0 12 12",
@@ -7817,22 +7819,22 @@ const Is = [
7817
7819
  ], 8, ["disabled"]))
7818
7820
  ])) : De("", !0),
7819
7821
  b[100] || (b[100] = C("div", { class: "ht-sep" }, null, -1)),
7820
- (Z(!0), te(rt, null, bn(At.value, (B) => (Z(), te("button", {
7821
- key: B.id,
7822
- class: ze(["ht-btn ht-icon-only", { active: ue.value.has(B.id), disabled: ut(B.id) }]),
7823
- title: B.title,
7824
- disabled: ut(B.id),
7825
- onMousedown: ie((he) => !ut(B.id) && zt(B.id), ["prevent", "stop"]),
7822
+ (Z(!0), te(rt, null, bn(At.value, (L) => (Z(), te("button", {
7823
+ key: L.id,
7824
+ class: ze(["ht-btn ht-icon-only", { active: ue.value.has(L.id), disabled: ut(L.id) }]),
7825
+ title: L.title,
7826
+ disabled: ut(L.id),
7827
+ onMousedown: ie((he) => !ut(L.id) && zt(L.id), ["prevent", "stop"]),
7826
7828
  onTouchstart: ie((he) => {
7827
7829
  ht(() => {
7828
- ut(B.id) || zt(B.id);
7830
+ ut(L.id) || zt(L.id);
7829
7831
  }, he);
7830
7832
  }, ["stop"]),
7831
7833
  onClick: b[13] || (b[13] = ie(() => {
7832
7834
  }, ["prevent", "stop"]))
7833
7835
  }, [
7834
- gn(An, {
7835
- html: B.iconHtml
7836
+ gn(In, {
7837
+ html: L.iconHtml
7836
7838
  }, null, 8, ["html"])
7837
7839
  ], 42, Zf))), 128)),
7838
7840
  e.tableMode ? De("", !0) : (Z(), te("button", {
@@ -7840,11 +7842,11 @@ const Is = [
7840
7842
  class: ze(["ht-btn ht-icon-only", { active: ue.value.has("link"), disabled: ut("link") }]),
7841
7843
  title: fe(l)("hoverToolbar.linkBtnTitle"),
7842
7844
  disabled: ut("link"),
7843
- onMousedown: b[14] || (b[14] = ie((B) => !ut("link") && Cn(), ["prevent", "stop"])),
7844
- onTouchstart: b[15] || (b[15] = ie((B) => {
7845
+ onMousedown: b[14] || (b[14] = ie((L) => !ut("link") && Cn(), ["prevent", "stop"])),
7846
+ onTouchstart: b[15] || (b[15] = ie((L) => {
7845
7847
  ht(() => {
7846
7848
  ut("link") || Cn();
7847
- }, B);
7849
+ }, L);
7848
7850
  }, ["stop"])),
7849
7851
  onClick: b[16] || (b[16] = ie(() => {
7850
7852
  }, ["prevent", "stop"]))
@@ -7866,14 +7868,14 @@ const Is = [
7866
7868
  C("button", {
7867
7869
  ref_key: "colorBtnEl",
7868
7870
  ref: D,
7869
- class: ze(["ht-btn ht-icon-only", { open: K.value === "color", disabled: ut("color") }]),
7871
+ class: ze(["ht-btn ht-icon-only", { open: z.value === "color", disabled: ut("color") }]),
7870
7872
  title: fe(l)("hoverToolbar.colorBtnTitle"),
7871
7873
  disabled: ut("color"),
7872
- onMousedown: b[17] || (b[17] = ie((B) => !ut("color") && Ye("color"), ["prevent", "stop"])),
7873
- onTouchstart: b[18] || (b[18] = ie((B) => {
7874
+ onMousedown: b[17] || (b[17] = ie((L) => !ut("color") && Ye("color"), ["prevent", "stop"])),
7875
+ onTouchstart: b[18] || (b[18] = ie((L) => {
7874
7876
  ht(() => {
7875
7877
  ut("color") || Ye("color");
7876
- }, B);
7878
+ }, L);
7877
7879
  }, ["stop"])),
7878
7880
  onClick: b[19] || (b[19] = ie(() => {
7879
7881
  }, ["prevent", "stop"]))
@@ -7890,11 +7892,11 @@ const Is = [
7890
7892
  })
7891
7893
  ], -1)
7892
7894
  ])], 42, Qf),
7893
- (Z(), mn($n, {
7895
+ (Z(), mn(Pn, {
7894
7896
  to: "body",
7895
7897
  disabled: !e.mobile
7896
7898
  }, [
7897
- K.value === "color" ? (Z(), te("div", {
7899
+ z.value === "color" ? (Z(), te("div", {
7898
7900
  key: 0,
7899
7901
  ref_key: "colorDropdownEl",
7900
7902
  ref: p,
@@ -7906,7 +7908,7 @@ const Is = [
7906
7908
  class: "menu-scroll-btn menu-scroll-up",
7907
7909
  type: "button",
7908
7910
  "aria-label": fe(l)("ui.scrollUp"),
7909
- onMousedown: ie(On, ["prevent"])
7911
+ onMousedown: ie(Dn, ["prevent"])
7910
7912
  }, [...b[94] || (b[94] = [
7911
7913
  C("svg", {
7912
7914
  viewBox: "0 0 12 12",
@@ -7933,27 +7935,27 @@ const Is = [
7933
7935
  C("div", ep, [
7934
7936
  C("div", tp, Rt(fe(l)("hoverToolbar.textColor")), 1),
7935
7937
  C("div", np, [
7936
- (Z(!0), te(rt, null, bn(fe(be), (B) => (Z(), te("button", {
7937
- key: "tc-" + B.key,
7938
- class: ze(["ht-swatch", { active: ye.value === B.key }]),
7939
- title: fe(l)(B.key === "default" ? "color.default" : "color." + B.key),
7940
- style: rn({ backgroundColor: B.displayCssValue ?? B.cssValue }),
7941
- onMousedown: ie((he) => tt(B.key), ["prevent", "stop"])
7938
+ (Z(!0), te(rt, null, bn(fe(be), (L) => (Z(), te("button", {
7939
+ key: "tc-" + L.key,
7940
+ class: ze(["ht-swatch", { active: ye.value === L.key }]),
7941
+ title: fe(l)(L.key === "default" ? "color.default" : "color." + L.key),
7942
+ style: rn({ backgroundColor: L.displayCssValue ?? L.cssValue }),
7943
+ onMousedown: ie((he) => tt(L.key), ["prevent", "stop"])
7942
7944
  }, null, 46, op))), 128))
7943
7945
  ])
7944
7946
  ]),
7945
7947
  C("div", rp, [
7946
7948
  C("div", lp, Rt(fe(l)("hoverToolbar.bgColor")), 1),
7947
7949
  C("div", ip, [
7948
- (Z(!0), te(rt, null, bn(fe(Dt), (B) => (Z(), te("button", {
7949
- key: "bc-" + B.key,
7950
+ (Z(!0), te(rt, null, bn(fe(Dt), (L) => (Z(), te("button", {
7951
+ key: "bc-" + L.key,
7950
7952
  class: ze(["ht-swatch", [
7951
- { active: pe.value === B.key },
7952
- B.key === "default" ? "ht-swatch--none" : ""
7953
+ { active: pe.value === L.key },
7954
+ L.key === "default" ? "ht-swatch--none" : ""
7953
7955
  ]]),
7954
- title: fe(l)(B.key === "default" ? "color.none" : "color." + B.key),
7955
- style: rn({ backgroundColor: B.displayCssValue ?? B.cssValue }),
7956
- onMousedown: ie((he) => mt(B.key), ["prevent", "stop"])
7956
+ title: fe(l)(L.key === "default" ? "color.none" : "color." + L.key),
7957
+ style: rn({ backgroundColor: L.displayCssValue ?? L.cssValue }),
7958
+ onMousedown: ie((he) => mt(L.key), ["prevent", "stop"])
7957
7959
  }, null, 46, sp))), 128))
7958
7960
  ])
7959
7961
  ])
@@ -7963,7 +7965,7 @@ const Is = [
7963
7965
  class: "menu-scroll-btn menu-scroll-down",
7964
7966
  type: "button",
7965
7967
  "aria-label": fe(l)("ui.scrollDown"),
7966
- onMousedown: ie(Un, ["prevent"])
7968
+ onMousedown: ie(Fn, ["prevent"])
7967
7969
  }, [...b[95] || (b[95] = [
7968
7970
  C("svg", {
7969
7971
  viewBox: "0 0 12 12",
@@ -7990,11 +7992,11 @@ const Is = [
7990
7992
  title: fe(l)("hoverToolbar.copySelection"),
7991
7993
  "aria-label": fe(l)("hoverToolbar.copySelection"),
7992
7994
  disabled: Ht.value,
7993
- onMousedown: b[20] || (b[20] = ie((B) => !Ht.value && Gt(), ["prevent", "stop"])),
7994
- onTouchstart: b[21] || (b[21] = ie((B) => {
7995
+ onMousedown: b[20] || (b[20] = ie((L) => !Ht.value && Gt(), ["prevent", "stop"])),
7996
+ onTouchstart: b[21] || (b[21] = ie((L) => {
7995
7997
  ht(() => {
7996
7998
  Ht.value || Gt();
7997
- }, B);
7999
+ }, L);
7998
8000
  }, ["stop"])),
7999
8001
  onClick: b[22] || (b[22] = ie(() => {
8000
8002
  }, ["prevent", "stop"]))
@@ -8030,8 +8032,8 @@ const Is = [
8030
8032
  key: 1,
8031
8033
  class: "ht-btn ht-icon-only",
8032
8034
  title: fe(l)("table.mergeCells"),
8033
- onMousedown: b[23] || (b[23] = ie((B) => r("merge"), ["prevent", "stop"])),
8034
- onTouchstart: b[24] || (b[24] = ie((B) => ht(() => r("merge"), B), ["stop"])),
8035
+ onMousedown: b[23] || (b[23] = ie((L) => r("merge"), ["prevent", "stop"])),
8036
+ onTouchstart: b[24] || (b[24] = ie((L) => ht(() => r("merge"), L), ["stop"])),
8035
8037
  onClick: b[25] || (b[25] = ie(() => {
8036
8038
  }, ["prevent", "stop"]))
8037
8039
  }, [...b[97] || (b[97] = [
@@ -8049,8 +8051,8 @@ const Is = [
8049
8051
  key: 2,
8050
8052
  class: "ht-btn ht-icon-only",
8051
8053
  title: fe(l)("table.splitCell"),
8052
- onMousedown: b[26] || (b[26] = ie((B) => r("split"), ["prevent", "stop"])),
8053
- onTouchstart: b[27] || (b[27] = ie((B) => ht(() => r("split"), B), ["stop"])),
8054
+ onMousedown: b[26] || (b[26] = ie((L) => r("split"), ["prevent", "stop"])),
8055
+ onTouchstart: b[27] || (b[27] = ie((L) => ht(() => r("split"), L), ["stop"])),
8054
8056
  onClick: b[28] || (b[28] = ie(() => {
8055
8057
  }, ["prevent", "stop"]))
8056
8058
  }, [...b[98] || (b[98] = [
@@ -8069,8 +8071,8 @@ const Is = [
8069
8071
  key: 3,
8070
8072
  class: ze(["ht-btn ht-icon-only", { active: e.headerRowActive }]),
8071
8073
  title: fe(l)("table.toggleHeader"),
8072
- onMousedown: b[29] || (b[29] = ie((B) => r("tableHeaderRow"), ["prevent", "stop"])),
8073
- onTouchstart: b[30] || (b[30] = ie((B) => ht(() => r("tableHeaderRow"), B), ["stop"])),
8074
+ onMousedown: b[29] || (b[29] = ie((L) => r("tableHeaderRow"), ["prevent", "stop"])),
8075
+ onTouchstart: b[30] || (b[30] = ie((L) => ht(() => r("tableHeaderRow"), L), ["stop"])),
8074
8076
  onClick: b[31] || (b[31] = ie(() => {
8075
8077
  }, ["prevent", "stop"]))
8076
8078
  }, [...b[99] || (b[99] = [
@@ -8101,12 +8103,12 @@ const Is = [
8101
8103
  C("button", {
8102
8104
  class: "ht-btn ht-danger ht-icon-only",
8103
8105
  title: e.deleteLabel || fe(l)("hoverToolbar.deleteBlock"),
8104
- onMousedown: b[32] || (b[32] = ie((B) => r("delete"), ["prevent", "stop"])),
8105
- onTouchstart: b[33] || (b[33] = ie((B) => ht(() => r("delete"), B), ["stop"])),
8106
+ onMousedown: b[32] || (b[32] = ie((L) => r("delete"), ["prevent", "stop"])),
8107
+ onTouchstart: b[33] || (b[33] = ie((L) => ht(() => r("delete"), L), ["stop"])),
8106
8108
  onClick: b[34] || (b[34] = ie(() => {
8107
8109
  }, ["prevent", "stop"]))
8108
8110
  }, [
8109
- gn(An, {
8111
+ gn(In, {
8110
8112
  html: e.deleteIcon || "<svg viewBox='0 0 1024 1024' width='15' height='15' fill='currentColor' aria-hidden='true'><path d='M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z'/><path d='M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z'/></svg>"
8111
8113
  }, null, 8, ["html"])
8112
8114
  ], 40, gp)
@@ -8118,10 +8120,10 @@ const Is = [
8118
8120
  class: ze(["ht-nav-btn ht-nav-right", { disabled: !W.value }]),
8119
8121
  title: fe(l)("ui.scrollRight"),
8120
8122
  "aria-label": fe(l)("ui.scrollRight"),
8121
- onMousedown: b[35] || (b[35] = ie((B) => sn(1), ["prevent", "stop"])),
8123
+ onMousedown: b[35] || (b[35] = ie((L) => sn(1), ["prevent", "stop"])),
8122
8124
  onTouchstart: b[36] || (b[36] = ie(() => {
8123
8125
  }, ["stop"])),
8124
- onTouchend: b[37] || (b[37] = ie((B) => dt(1, B), ["stop"])),
8126
+ onTouchend: b[37] || (b[37] = ie((L) => dt(1, L), ["stop"])),
8125
8127
  onClick: b[38] || (b[38] = ie(() => {
8126
8128
  }, ["prevent", "stop"]))
8127
8129
  }, [...b[103] || (b[103] = [
@@ -8168,7 +8170,7 @@ const Is = [
8168
8170
  function r($) {
8169
8171
  o("toolbarInteracting");
8170
8172
  }
8171
- const { t: i } = _n(), l = wo(), s = Pn(), c = Zn(ss, j(!1)), a = Me(() => n.position === "top" ? !1 : n.position === "bottom" ? !0 : c.value);
8173
+ const { t: i } = Tn(), l = wo(), s = Hn(), c = Zn(ss, j(!1)), a = Me(() => n.position === "top" ? !1 : n.position === "bottom" ? !0 : c.value);
8172
8174
  so(yr, a);
8173
8175
  const d = Zn(Ml, j(null)), u = j(null), h = ($) => {
8174
8176
  var G;
@@ -8281,7 +8283,7 @@ const Is = [
8281
8283
  const $ = d.value;
8282
8284
  return $ && $.visible ? $.blockId : n.hoverVisible && n.hoverBlockId ? n.hoverBlockId : n.focusBlockId;
8283
8285
  }), D = j(null), F = j(null);
8284
- function K() {
8286
+ function z() {
8285
8287
  const $ = T.value, U = D.value;
8286
8288
  !$ || !U || o("openPlusMenu", $, U);
8287
8289
  }
@@ -8310,7 +8312,7 @@ const Is = [
8310
8312
  disabled: !T.value,
8311
8313
  title: fe(i)("handle.plus.title"),
8312
8314
  "aria-label": fe(i)("handle.plus.ariaLabel"),
8313
- onMousedown: ie(K, ["prevent", "stop"]),
8315
+ onMousedown: ie(z, ["prevent", "stop"]),
8314
8316
  onTouchstart: U[0] || (U[0] = ie(() => {
8315
8317
  }, ["stop"]))
8316
8318
  }, [...U[3] || (U[3] = [
@@ -8361,7 +8363,7 @@ const Is = [
8361
8363
  },
8362
8364
  emits: ["continue", "startNew", "modify", "close"],
8363
8365
  setup(e, { emit: t }) {
8364
- const n = e, o = t, { t: r } = _n(), i = j(null), l = j({ top: 0, left: 0, above: !1 });
8366
+ const n = e, o = t, { t: r } = Tn(), i = j(null), l = j({ top: 0, left: 0, above: !1 });
8365
8367
  Tt(
8366
8368
  [() => n.visible, () => n.anchor, i],
8367
8369
  async () => {
@@ -8392,7 +8394,7 @@ const Is = [
8392
8394
  function d() {
8393
8395
  o("modify", n.currentNumber);
8394
8396
  }
8395
- return (u, h) => (Z(), mn($n, { to: "body" }, [
8397
+ return (u, h) => (Z(), mn(Pn, { to: "body" }, [
8396
8398
  e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
8397
8399
  key: 0,
8398
8400
  ref_key: "menuEl",
@@ -8467,7 +8469,7 @@ const Is = [
8467
8469
  },
8468
8470
  emits: ["confirm", "close"],
8469
8471
  setup(e, { emit: t }) {
8470
- const n = e, o = t, { t: r } = _n(), i = j(null), l = j(n.initialValue), s = j({ top: 0, left: 0 });
8472
+ const n = e, o = t, { t: r } = Tn(), i = j(null), l = j(n.initialValue), s = j({ top: 0, left: 0 });
8471
8473
  Tt(
8472
8474
  [() => n.visible, () => n.anchor, () => n.initialValue],
8473
8475
  async () => {
@@ -8493,7 +8495,7 @@ const Is = [
8493
8495
  let d = l.value;
8494
8496
  Number.isFinite(d) || (d = n.initialValue), d = Math.max(1, Math.floor(d)), o("confirm", d);
8495
8497
  }
8496
- return (d, u) => (Z(), mn($n, { to: "body" }, [
8498
+ return (d, u) => (Z(), mn(Pn, { to: "body" }, [
8497
8499
  e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
8498
8500
  key: 0,
8499
8501
  class: "number-picker",
@@ -8552,7 +8554,7 @@ const Is = [
8552
8554
  },
8553
8555
  emits: ["confirm", "close"],
8554
8556
  setup(e, { emit: t }) {
8555
- const n = e, o = t, { t: r } = _n(), i = [
8557
+ const n = e, o = t, { t: r } = Tn(), i = [
8556
8558
  "plain",
8557
8559
  "javascript",
8558
8560
  "typescript",
@@ -8613,7 +8615,7 @@ const Is = [
8613
8615
  const le = c.value;
8614
8616
  le && (le.scrollTop -= le.clientHeight * 0.8);
8615
8617
  }
8616
- function K() {
8618
+ function z() {
8617
8619
  const le = c.value;
8618
8620
  le && (le.scrollTop += le.clientHeight * 0.8);
8619
8621
  }
@@ -8640,7 +8642,7 @@ const Is = [
8640
8642
  left: `${h.value.left}px`,
8641
8643
  maxHeight: `${h.value.maxHeight}px`
8642
8644
  }));
8643
- return (le, X) => (Z(), mn($n, { to: "body" }, [
8645
+ return (le, X) => (Z(), mn(Pn, { to: "body" }, [
8644
8646
  e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
8645
8647
  key: 0,
8646
8648
  ref_key: "menuEl",
@@ -8740,7 +8742,7 @@ const Is = [
8740
8742
  class: "menu-scroll-btn menu-scroll-down",
8741
8743
  type: "button",
8742
8744
  "aria-label": fe(r)("ui.scrollDown"),
8743
- onMousedown: ie(K, ["prevent"])
8745
+ onMousedown: ie(z, ["prevent"])
8744
8746
  }, [...X[6] || (X[6] = [
8745
8747
  C("svg", {
8746
8748
  viewBox: "0 0 12 12",
@@ -8790,10 +8792,10 @@ const Is = [
8790
8792
  },
8791
8793
  emits: ["close"],
8792
8794
  setup(e, { expose: t, emit: n }) {
8793
- const o = e, r = n, { t: i } = _n(), l = Pn(), s = j(null), c = j(null), a = j(!1), d = j(!1), u = j("view"), h = j(""), p = j(""), f = j({ top: 0, left: 0 }), m = j(""), T = Me(() => o.showTextInput ?? !1), D = Me(() => u.value === "edit" ? h.value : o.href), F = Me(() => {
8795
+ const o = e, r = n, { t: i } = Tn(), l = Hn(), s = j(null), c = j(null), a = j(!1), d = j(!1), u = j("view"), h = j(""), p = j(""), f = j({ top: 0, left: 0 }), m = j(""), T = Me(() => o.showTextInput ?? !1), D = Me(() => u.value === "edit" ? h.value : o.href), F = Me(() => {
8794
8796
  const _ = So(D.value);
8795
8797
  return co(_) ?? "#";
8796
- }), K = Me(() => {
8798
+ }), z = Me(() => {
8797
8799
  const _ = D.value;
8798
8800
  return _ ? _.length > 60 ? _.slice(0, 57) + "..." : _ : i("link.emptyUrl");
8799
8801
  }), oe = Me(() => ({
@@ -8879,13 +8881,13 @@ const Is = [
8879
8881
  const _ = So(o.href), O = co(_);
8880
8882
  O && O !== "#" && window.open(O, "_blank", "noopener,noreferrer");
8881
8883
  }
8882
- return Ln(() => {
8884
+ return Bn(() => {
8883
8885
  a.value = !1;
8884
8886
  }), t({
8885
8887
  isEditing: () => u.value === "edit",
8886
8888
  save: G,
8887
8889
  cancel: le
8888
- }), (_, O) => (Z(), mn($n, { to: "body" }, [
8890
+ }), (_, O) => (Z(), mn(Pn, { to: "body" }, [
8889
8891
  a.value ? (Z(), te("div", {
8890
8892
  key: 0,
8891
8893
  ref_key: "popoverEl",
@@ -8907,7 +8909,7 @@ const Is = [
8907
8909
  class: "link-popover-url",
8908
8910
  title: D.value,
8909
8911
  onClick: W
8910
- }, Rt(K.value), 9, Zp),
8912
+ }, Rt(z.value), 9, Zp),
8911
8913
  C("div", Xp, [
8912
8914
  C("button", {
8913
8915
  class: "link-popover-btn",
@@ -9064,7 +9066,7 @@ const Is = [
9064
9066
  validate: (e) => e == null ? !0 : Number.isInteger(e) && e >= 1
9065
9067
  };
9066
9068
  function Os(e, t) {
9067
- const n = mr(e, t), o = Rn(e, t);
9069
+ const n = mr(e, t), o = Ln(e, t);
9068
9070
  if (o < 0) return 1;
9069
9071
  const r = e.blocks.get(t);
9070
9072
  if (!r) return 1;
@@ -9090,14 +9092,14 @@ const ah = Ft({
9090
9092
  placeholder: { type: String, default: void 0 }
9091
9093
  },
9092
9094
  setup(e) {
9093
- const t = Pn(), n = wo(), o = j(null), r = Qi(), i = {
9095
+ const t = Hn(), n = wo(), o = j(null), r = Qi(), i = {
9094
9096
  ...typeof r.onLinkClick == "function" ? { onLinkClick: r.onLinkClick } : {},
9095
9097
  ...typeof r.onSlashTrigger == "function" ? { onSlashTrigger: r.onSlashTrigger } : {},
9096
9098
  ...typeof r.onInputChanged == "function" ? { onInputChanged: r.onInputChanged } : {}
9097
9099
  }, l = j(0), s = t.subscribe(() => {
9098
9100
  l.value++;
9099
9101
  });
9100
- return Ln(s), () => {
9102
+ return Bn(s), () => {
9101
9103
  l.value;
9102
9104
  const c = t.getState().doc, a = Os(c, e.block.id), d = ve(
9103
9105
  "div",
@@ -9360,7 +9362,7 @@ const Ko = (e, t, n, o, r, i) => ({
9360
9362
  placeholder: { type: String, default: void 0 }
9361
9363
  },
9362
9364
  setup(e) {
9363
- const t = Pn(), n = Qi(), o = {
9365
+ const t = Hn(), n = Qi(), o = {
9364
9366
  ...typeof n.onLinkClick == "function" ? { onLinkClick: n.onLinkClick } : {},
9365
9367
  ...typeof n.onSlashTrigger == "function" ? { onSlashTrigger: n.onSlashTrigger } : {},
9366
9368
  ...typeof n.onInputChanged == "function" ? { onInputChanged: n.onInputChanged } : {}
@@ -10176,8 +10178,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10176
10178
  }
10177
10179
  function u(y, S, I, V) {
10178
10180
  const me = /* @__PURE__ */ Object.create(null);
10179
- function ae(k, z) {
10180
- return k.keywords[z];
10181
+ function ae(k, K) {
10182
+ return k.keywords[K];
10181
10183
  }
10182
10184
  function ye() {
10183
10185
  if (!be.keywords) {
@@ -10186,21 +10188,21 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10186
10188
  }
10187
10189
  let k = 0;
10188
10190
  be.keywordPatternRe.lastIndex = 0;
10189
- let z = be.keywordPatternRe.exec(He), _e = "";
10190
- for (; z; ) {
10191
- _e += He.substring(k, z.index);
10192
- const Se = lt.case_insensitive ? z[0].toLowerCase() : z[0], dt = ae(be, Se);
10191
+ let K = be.keywordPatternRe.exec(He), _e = "";
10192
+ for (; K; ) {
10193
+ _e += He.substring(k, K.index);
10194
+ const Se = lt.case_insensitive ? K[0].toLowerCase() : K[0], dt = ae(be, Se);
10193
10195
  if (dt) {
10194
10196
  const [ht, vn] = dt;
10195
10197
  if (it.addText(_e), _e = "", me[Se] = (me[Se] || 0) + 1, me[Se] <= gg && (sn += vn), ht.startsWith("_"))
10196
- _e += z[0];
10198
+ _e += K[0];
10197
10199
  else {
10198
10200
  const En = lt.classNameAliases[ht] || ht;
10199
- Oe(z[0], En);
10201
+ Oe(K[0], En);
10200
10202
  }
10201
10203
  } else
10202
- _e += z[0];
10203
- k = be.keywordPatternRe.lastIndex, z = be.keywordPatternRe.exec(He);
10204
+ _e += K[0];
10205
+ k = be.keywordPatternRe.lastIndex, K = be.keywordPatternRe.exec(He);
10204
10206
  }
10205
10207
  _e += He.substring(k), it.addText(_e);
10206
10208
  }
@@ -10221,30 +10223,30 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10221
10223
  function ue() {
10222
10224
  be.subLanguage != null ? pe() : ye(), He = "";
10223
10225
  }
10224
- function Oe(k, z) {
10225
- k !== "" && (it.startScope(z), it.addText(k), it.endScope());
10226
+ function Oe(k, K) {
10227
+ k !== "" && (it.startScope(K), it.addText(k), it.endScope());
10226
10228
  }
10227
- function Ie(k, z) {
10229
+ function Ie(k, K) {
10228
10230
  let _e = 1;
10229
- const Se = z.length - 1;
10231
+ const Se = K.length - 1;
10230
10232
  for (; _e <= Se; ) {
10231
10233
  if (!k._emit[_e]) {
10232
10234
  _e++;
10233
10235
  continue;
10234
10236
  }
10235
- const dt = lt.classNameAliases[k[_e]] || k[_e], ht = z[_e];
10237
+ const dt = lt.classNameAliases[k[_e]] || k[_e], ht = K[_e];
10236
10238
  dt ? Oe(ht, dt) : (He = ht, ye(), He = ""), _e++;
10237
10239
  }
10238
10240
  }
10239
- function et(k, z) {
10240
- return k.scope && typeof k.scope == "string" && it.openNode(lt.classNameAliases[k.scope] || k.scope), k.beginScope && (k.beginScope._wrap ? (Oe(He, lt.classNameAliases[k.beginScope._wrap] || k.beginScope._wrap), He = "") : k.beginScope._multi && (Ie(k.beginScope, z), He = "")), be = Object.create(k, { parent: { value: be } }), be;
10241
+ function et(k, K) {
10242
+ return k.scope && typeof k.scope == "string" && it.openNode(lt.classNameAliases[k.scope] || k.scope), k.beginScope && (k.beginScope._wrap ? (Oe(He, lt.classNameAliases[k.beginScope._wrap] || k.beginScope._wrap), He = "") : k.beginScope._multi && (Ie(k.beginScope, K), He = "")), be = Object.create(k, { parent: { value: be } }), be;
10241
10243
  }
10242
- function Ht(k, z, _e) {
10244
+ function Ht(k, K, _e) {
10243
10245
  let Se = Nh(k.endRe, _e);
10244
10246
  if (Se) {
10245
10247
  if (k["on:end"]) {
10246
10248
  const dt = new Di(k);
10247
- k["on:end"](z, dt), dt.isMatchIgnored && (Se = !1);
10249
+ k["on:end"](K, dt), dt.isMatchIgnored && (Se = !1);
10248
10250
  }
10249
10251
  if (Se) {
10250
10252
  for (; k.endsParent && k.parent; )
@@ -10253,61 +10255,61 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10253
10255
  }
10254
10256
  }
10255
10257
  if (k.endsWithParent)
10256
- return Ht(k.parent, z, _e);
10258
+ return Ht(k.parent, K, _e);
10257
10259
  }
10258
10260
  function an(k) {
10259
10261
  return be.matcher.regexIndex === 0 ? (He += k[0], 1) : (P = !0, 0);
10260
10262
  }
10261
10263
  function ln(k) {
10262
- const z = k[0], _e = k.rule, Se = new Di(_e), dt = [_e.__beforeBegin, _e["on:begin"]];
10264
+ const K = k[0], _e = k.rule, Se = new Di(_e), dt = [_e.__beforeBegin, _e["on:begin"]];
10263
10265
  for (const ht of dt)
10264
10266
  if (ht && (ht(k, Se), Se.isMatchIgnored))
10265
- return an(z);
10266
- return _e.skip ? He += z : (_e.excludeBegin && (He += z), ue(), !_e.returnBegin && !_e.excludeBegin && (He = z)), et(_e, k), _e.returnBegin ? 0 : z.length;
10267
+ return an(K);
10268
+ return _e.skip ? He += K : (_e.excludeBegin && (He += K), ue(), !_e.returnBegin && !_e.excludeBegin && (He = K)), et(_e, k), _e.returnBegin ? 0 : K.length;
10267
10269
  }
10268
10270
  function Vt(k) {
10269
- const z = k[0], _e = S.substring(k.index), Se = Ht(be, k, _e);
10271
+ const K = k[0], _e = S.substring(k.index), Se = Ht(be, k, _e);
10270
10272
  if (!Se)
10271
10273
  return zi;
10272
10274
  const dt = be;
10273
- be.endScope && be.endScope._wrap ? (ue(), Oe(z, be.endScope._wrap)) : be.endScope && be.endScope._multi ? (ue(), Ie(be.endScope, k)) : dt.skip ? He += z : (dt.returnEnd || dt.excludeEnd || (He += z), ue(), dt.excludeEnd && (He = z));
10275
+ be.endScope && be.endScope._wrap ? (ue(), Oe(K, be.endScope._wrap)) : be.endScope && be.endScope._multi ? (ue(), Ie(be.endScope, k)) : dt.skip ? He += K : (dt.returnEnd || dt.excludeEnd || (He += K), ue(), dt.excludeEnd && (He = K));
10274
10276
  do
10275
10277
  be.scope && it.closeNode(), !be.skip && !be.subLanguage && (sn += be.relevance), be = be.parent;
10276
10278
  while (be !== Se.parent);
10277
- return Se.starts && et(Se.starts, k), dt.returnEnd ? 0 : z.length;
10279
+ return Se.starts && et(Se.starts, k), dt.returnEnd ? 0 : K.length;
10278
10280
  }
10279
10281
  function ut() {
10280
10282
  const k = [];
10281
- for (let z = be; z !== lt; z = z.parent)
10282
- z.scope && k.unshift(z.scope);
10283
- k.forEach((z) => it.openNode(z));
10283
+ for (let K = be; K !== lt; K = K.parent)
10284
+ K.scope && k.unshift(K.scope);
10285
+ k.forEach((K) => it.openNode(K));
10284
10286
  }
10285
10287
  let At = {};
10286
- function Bt(k, z) {
10287
- const _e = z && z[0];
10288
+ function Bt(k, K) {
10289
+ const _e = K && K[0];
10288
10290
  if (He += k, _e == null)
10289
10291
  return ue(), 0;
10290
- if (At.type === "begin" && z.type === "end" && At.index === z.index && _e === "") {
10291
- if (He += S.slice(z.index, z.index + 1), !r) {
10292
+ if (At.type === "begin" && K.type === "end" && At.index === K.index && _e === "") {
10293
+ if (He += S.slice(K.index, K.index + 1), !r) {
10292
10294
  const Se = new Error(`0 width match regex (${y})`);
10293
10295
  throw Se.languageName = y, Se.badRule = At.rule, Se;
10294
10296
  }
10295
10297
  return 1;
10296
10298
  }
10297
- if (At = z, z.type === "begin")
10298
- return ln(z);
10299
- if (z.type === "illegal" && !I) {
10299
+ if (At = K, K.type === "begin")
10300
+ return ln(K);
10301
+ if (K.type === "illegal" && !I) {
10300
10302
  const Se = new Error('Illegal lexeme "' + _e + '" for mode "' + (be.scope || "<unnamed>") + '"');
10301
10303
  throw Se.mode = be, Se;
10302
- } else if (z.type === "end") {
10303
- const Se = Vt(z);
10304
+ } else if (K.type === "end") {
10305
+ const Se = Vt(K);
10304
10306
  if (Se !== zi)
10305
10307
  return Se;
10306
10308
  }
10307
- if (z.type === "illegal" && _e === "")
10309
+ if (K.type === "illegal" && _e === "")
10308
10310
  return He += `
10309
10311
  `, 1;
10310
- if (Lt > 1e5 && Lt > z.index * 3)
10312
+ if (Lt > 1e5 && Lt > K.index * 3)
10311
10313
  throw new Error("potential infinite loop, way more iterations than matches");
10312
10314
  return He += _e, _e.length;
10313
10315
  }
@@ -10327,7 +10329,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10327
10329
  Lt++, P ? P = !1 : be.matcher.considerAll(), be.matcher.lastIndex = pt;
10328
10330
  const k = be.matcher.exec(S);
10329
10331
  if (!k) break;
10330
- const z = S.substring(pt, k.index), _e = Bt(z, k);
10332
+ const K = S.substring(pt, k.index), _e = Bt(K, k);
10331
10333
  pt = k.index + _e;
10332
10334
  }
10333
10335
  Bt(S.substring(pt));
@@ -10438,13 +10440,13 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
10438
10440
  function F() {
10439
10441
  oe(), Wo("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
10440
10442
  }
10441
- let K = !1;
10443
+ let z = !1;
10442
10444
  function oe() {
10443
10445
  function y() {
10444
10446
  oe();
10445
10447
  }
10446
10448
  if (document.readyState === "loading") {
10447
- K || window.addEventListener("DOMContentLoaded", y, !1), K = !0;
10449
+ z || window.addEventListener("DOMContentLoaded", y, !1), z = !0;
10448
10450
  return;
10449
10451
  }
10450
10452
  document.querySelectorAll(s.cssSelector).forEach(m);
@@ -10851,7 +10853,7 @@ function wg(e) {
10851
10853
  e.C_BLOCK_COMMENT_MODE,
10852
10854
  e.C_LINE_COMMENT_MODE
10853
10855
  ]
10854
- }, K = [
10856
+ }, z = [
10855
10857
  e.APOS_STRING_MODE,
10856
10858
  e.QUOTE_STRING_MODE,
10857
10859
  p,
@@ -10865,7 +10867,7 @@ function wg(e) {
10865
10867
  // See https://github.com/highlightjs/highlight.js/issues/3288
10866
10868
  // hljs.REGEXP_MODE
10867
10869
  ];
10868
- h.contains = K.concat({
10870
+ h.contains = z.concat({
10869
10871
  // we need to pair up {} inside our subst to prevent
10870
10872
  // it from ending too early by matching another }
10871
10873
  begin: /\{/,
@@ -10873,7 +10875,7 @@ function wg(e) {
10873
10875
  keywords: s,
10874
10876
  contains: [
10875
10877
  "self"
10876
- ].concat(K)
10878
+ ].concat(z)
10877
10879
  });
10878
10880
  const oe = [].concat(F, h.contains), $ = oe.concat([
10879
10881
  // eat recursive parens in sub expressions
@@ -11506,7 +11508,7 @@ function Eg(e) {
11506
11508
  e.C_BLOCK_COMMENT_MODE,
11507
11509
  e.C_LINE_COMMENT_MODE
11508
11510
  ]
11509
- }, K = [
11511
+ }, z = [
11510
11512
  e.APOS_STRING_MODE,
11511
11513
  e.QUOTE_STRING_MODE,
11512
11514
  p,
@@ -11520,7 +11522,7 @@ function Eg(e) {
11520
11522
  // See https://github.com/highlightjs/highlight.js/issues/3288
11521
11523
  // hljs.REGEXP_MODE
11522
11524
  ];
11523
- h.contains = K.concat({
11525
+ h.contains = z.concat({
11524
11526
  // we need to pair up {} inside our subst to prevent
11525
11527
  // it from ending too early by matching another }
11526
11528
  begin: /\{/,
@@ -11528,7 +11530,7 @@ function Eg(e) {
11528
11530
  keywords: s,
11529
11531
  contains: [
11530
11532
  "self"
11531
- ].concat(K)
11533
+ ].concat(z)
11532
11534
  });
11533
11535
  const oe = [].concat(F, h.contains), $ = oe.concat([
11534
11536
  // eat recursive parens in sub expressions
@@ -11916,7 +11918,7 @@ function Cg(e) {
11916
11918
  className: "meta",
11917
11919
  begin: "@" + o
11918
11920
  }, u = (m, T, D) => {
11919
- const F = m.contains.findIndex((K) => K.label === T);
11921
+ const F = m.contains.findIndex((z) => z.label === T);
11920
11922
  if (F === -1)
11921
11923
  throw new Error("can not find mode to replace");
11922
11924
  m.contains.splice(F, 1, D);
@@ -12762,7 +12764,7 @@ function Tg(e) {
12762
12764
  }
12763
12765
  ]),
12764
12766
  relevance: 0
12765
- }, K = {
12767
+ }, z = {
12766
12768
  begin: "(" + l + "[\\*&\\s]+)+" + p,
12767
12769
  returnBegin: !0,
12768
12770
  end: /[{;=]/,
@@ -12833,7 +12835,7 @@ function Tg(e) {
12833
12835
  illegal: "</",
12834
12836
  contains: [].concat(
12835
12837
  F,
12836
- K,
12838
+ z,
12837
12839
  D,
12838
12840
  [
12839
12841
  u,
@@ -13606,7 +13608,7 @@ function Sg(e) {
13606
13608
  { beginKeywords: "in out" },
13607
13609
  s
13608
13610
  ]
13609
- }, K = e.IDENT_RE + "(<" + e.IDENT_RE + "(\\s*,\\s*" + e.IDENT_RE + ")*>)?(\\[\\])?", oe = {
13611
+ }, z = e.IDENT_RE + "(<" + e.IDENT_RE + "(\\s*,\\s*" + e.IDENT_RE + ")*>)?(\\[\\])?", oe = {
13610
13612
  // prevents expressions like `@class` from incorrect flagging
13611
13613
  // `class` as a keyword
13612
13614
  begin: "@" + e.IDENT_RE,
@@ -13713,7 +13715,7 @@ function Sg(e) {
13713
13715
  },
13714
13716
  {
13715
13717
  className: "function",
13716
- begin: "(" + K + "\\s+)+" + e.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
13718
+ begin: "(" + z + "\\s+)+" + e.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
13717
13719
  returnBegin: !0,
13718
13720
  end: /\s*[{;=]/,
13719
13721
  excludeEnd: !0,
@@ -15553,7 +15555,7 @@ function Ug(e) {
15553
15555
  }, T = [
15554
15556
  f,
15555
15557
  m
15556
- ], D = "([0-9]_*)+", F = "([0-9a-fA-F]_*)+", K = {
15558
+ ], D = "([0-9]_*)+", F = "([0-9a-fA-F]_*)+", z = {
15557
15559
  className: "number",
15558
15560
  relevance: 0,
15559
15561
  variants: [
@@ -15661,7 +15663,7 @@ function Ug(e) {
15661
15663
  keywords: Hg,
15662
15664
  contains: [
15663
15665
  ...T,
15664
- K,
15666
+ z,
15665
15667
  le
15666
15668
  ]
15667
15669
  }
@@ -15737,7 +15739,7 @@ function Ug(e) {
15737
15739
  ...d,
15738
15740
  ...p,
15739
15741
  ...T,
15740
- K,
15742
+ z,
15741
15743
  le,
15742
15744
  ...S,
15743
15745
  ...ae,
@@ -15777,7 +15779,7 @@ function Ug(e) {
15777
15779
  ...o,
15778
15780
  ...d,
15779
15781
  ...T,
15780
- K,
15782
+ z,
15781
15783
  le,
15782
15784
  ...ae,
15783
15785
  ye,
@@ -15902,7 +15904,7 @@ function Ug(e) {
15902
15904
  ...d,
15903
15905
  ...p,
15904
15906
  ...T,
15905
- K,
15907
+ z,
15906
15908
  le,
15907
15909
  ...S
15908
15910
  ];
@@ -15940,7 +15942,7 @@ function Ug(e) {
15940
15942
  ...d,
15941
15943
  ...p,
15942
15944
  ...T,
15943
- K,
15945
+ z,
15944
15946
  le,
15945
15947
  ...S,
15946
15948
  ...ae,
@@ -17947,7 +17949,7 @@ function o3(e) {
17947
17949
  "trap",
17948
17950
  "umask",
17949
17951
  "unset"
17950
- ], K = [
17952
+ ], z = [
17951
17953
  "alias",
17952
17954
  "bind",
17953
17955
  "builtin",
@@ -18156,7 +18158,7 @@ function o3(e) {
18156
18158
  literal: T,
18157
18159
  built_in: [
18158
18160
  ...F,
18159
- ...K,
18161
+ ...z,
18160
18162
  // Shell modifiers
18161
18163
  "set",
18162
18164
  "shopt",
@@ -18342,7 +18344,7 @@ function r3(e) {
18342
18344
  className: "selector-tag",
18343
18345
  begin: /@\B/,
18344
18346
  relevance: 0
18345
- }, K = {
18347
+ }, z = {
18346
18348
  className: "function",
18347
18349
  begin: /\[.*\]\s*[\w]+[ ]??\(/,
18348
18350
  end: /$/,
@@ -18365,7 +18367,7 @@ function r3(e) {
18365
18367
  ]
18366
18368
  }, oe = [
18367
18369
  // STATIC_MEMBER,
18368
- K,
18370
+ z,
18369
18371
  h,
18370
18372
  l,
18371
18373
  e.NUMBER_MODE,
@@ -18397,7 +18399,7 @@ function r3(e) {
18397
18399
  }
18398
18400
  )
18399
18401
  };
18400
- return K.contains.unshift($), {
18402
+ return z.contains.unshift($), {
18401
18403
  name: "PowerShell",
18402
18404
  aliases: [
18403
18405
  "pwsh",
@@ -19138,7 +19140,7 @@ function i3(e) {
19138
19140
  /\b/
19139
19141
  );
19140
19142
  }
19141
- const K = {
19143
+ const z = {
19142
19144
  scope: "keyword",
19143
19145
  match: F(h),
19144
19146
  relevance: 0
@@ -19167,7 +19169,7 @@ function i3(e) {
19167
19169
  scope: "type",
19168
19170
  match: F(l)
19169
19171
  },
19170
- K,
19172
+ z,
19171
19173
  D,
19172
19174
  m,
19173
19175
  o,
@@ -19503,7 +19505,7 @@ const d3 = Ft({
19503
19505
  placeholder: { type: String, default: void 0 }
19504
19506
  },
19505
19507
  setup(e) {
19506
- const t = j(null), n = _n(), o = wo(), r = Me(
19508
+ const t = j(null), n = Tn(), o = wo(), r = Me(
19507
19509
  () => u3(
19508
19510
  Fe(e.block.content),
19509
19511
  e.block.attrs.language ?? "plain"
@@ -19629,10 +19631,10 @@ const d3 = Ft({
19629
19631
  },
19630
19632
  setup(e) {
19631
19633
  e.placeholder;
19632
- const t = Pn(), n = wo(), o = _n(), r = e.block.id, i = j(go(r)), l = Es((A, W) => {
19634
+ const t = Hn(), n = wo(), o = Tn(), r = e.block.id, i = j(go(r)), l = Es((A, W) => {
19633
19635
  A === r && (i.value = W);
19634
19636
  });
19635
- Ln(() => {
19637
+ Bn(() => {
19636
19638
  l();
19637
19639
  });
19638
19640
  const s = j(null), c = j(null), a = j(!1);
@@ -19665,7 +19667,7 @@ const d3 = Ft({
19665
19667
  const me = M / Math.max(1, y);
19666
19668
  M = O, y = Math.round(M / me);
19667
19669
  }
19668
- d = M, u = y, h = A.clientX, p = d / Math.max(1, u), a.value = !0, document.addEventListener("mousemove", D, !0), document.addEventListener("mouseup", F, !0), document.addEventListener("selectstart", K, !0);
19670
+ d = M, u = y, h = A.clientX, p = d / Math.max(1, u), a.value = !0, document.addEventListener("mousemove", D, !0), document.addEventListener("mouseup", F, !0), document.addEventListener("selectstart", z, !0);
19669
19671
  }
19670
19672
  const T = 600;
19671
19673
  function D(A) {
@@ -19689,9 +19691,9 @@ const d3 = Ft({
19689
19691
  });
19690
19692
  }
19691
19693
  function F() {
19692
- a.value = !1, document.removeEventListener("mousemove", D, !0), document.removeEventListener("mouseup", F, !0), document.removeEventListener("selectstart", K, !0);
19694
+ a.value = !1, document.removeEventListener("mousemove", D, !0), document.removeEventListener("mouseup", F, !0), document.removeEventListener("selectstart", z, !0);
19693
19695
  }
19694
- function K(A) {
19696
+ function z(A) {
19695
19697
  A.preventDefault();
19696
19698
  }
19697
19699
  const oe = j(null);
@@ -19779,20 +19781,20 @@ const d3 = Ft({
19779
19781
  onClick: (Ie) => {
19780
19782
  Ie.stopPropagation(), $();
19781
19783
  }
19782
- }, [ve(An, { html: xd })]),
19784
+ }, [ve(In, { html: xd })]),
19783
19785
  ve("button", {
19784
19786
  class: "image-block-btn",
19785
19787
  title: o.t("image.remove"),
19786
19788
  onClick: (Ie) => {
19787
19789
  Ie.stopPropagation(), G();
19788
19790
  }
19789
- }, [ve(An, { html: Cd })])
19791
+ }, [ve(In, { html: Cd })])
19790
19792
  ])
19791
19793
  ), (_ == null ? void 0 : _.status) === "pending") {
19792
19794
  const Ie = Math.round(_.progress * 100);
19793
19795
  V.push(
19794
19796
  ve("div", { class: "image-block-upload-overlay" }, [
19795
- ve(An, { html: wd, class: "image-block-spinner" }),
19797
+ ve(In, { html: wd, class: "image-block-spinner" }),
19796
19798
  ve("div", { class: "image-block-upload-label" }, o.t("image.uploading")),
19797
19799
  ve("div", { class: "image-block-progress-track" }, [
19798
19800
  ve("div", {
@@ -19815,7 +19817,7 @@ const d3 = Ft({
19815
19817
  Ie.stopPropagation(), ce();
19816
19818
  }
19817
19819
  }, [
19818
- ve(An, { html: Ed }),
19820
+ ve(In, { html: Ed }),
19819
19821
  " ",
19820
19822
  o.t("image.retry")
19821
19823
  ])
@@ -19827,7 +19829,7 @@ const d3 = Ft({
19827
19829
  Ie.stopPropagation(), n.value && $();
19828
19830
  }
19829
19831
  }, [
19830
- ve(An, { html: _d, class: "image-block-empty-icon" }),
19832
+ ve(In, { html: _d, class: "image-block-empty-icon" }),
19831
19833
  ve("div", { class: "image-block-empty-title" }, o.t("image.emptyTitle")),
19832
19834
  ve("div", { class: "image-block-empty-sub" }, o.t("image.emptySub"))
19833
19835
  ])
@@ -19992,7 +19994,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
19992
19994
  },
19993
19995
  setup(e, { expose: t }) {
19994
19996
  e.placeholder;
19995
- const n = Pn(), o = wo(), r = _n(), i = e.block.id, l = Zn(Ml, null);
19997
+ const n = Hn(), o = wo(), r = Tn(), i = e.block.id, l = Zn(Ml, null);
19996
19998
  let s = "__none__";
19997
19999
  function c(v) {
19998
20000
  if (!v) return "null";
@@ -20031,10 +20033,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20031
20033
  function F() {
20032
20034
  return Date.now() - T < D;
20033
20035
  }
20034
- function K(v) {
20035
- var L;
20036
+ function z(v) {
20037
+ var B;
20036
20038
  const w = v.target;
20037
- !!(w && (w.nodeType === 1 ? w.closest(".hover-toolbar") : (L = w.parentElement) != null && L.closest(".hover-toolbar"))) && (T = Date.now());
20039
+ !!(w && (w.nodeType === 1 ? w.closest(".hover-toolbar") : (B = w.parentElement) != null && B.closest(".hover-toolbar"))) && (T = Date.now());
20038
20040
  }
20039
20041
  function oe() {
20040
20042
  T = Date.now();
@@ -20045,7 +20047,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20045
20047
  let X = !1;
20046
20048
  const A = j(null);
20047
20049
  let W = null, _ = null, O = !1, M = !1;
20048
- const y = Sn({
20050
+ const y = An({
20049
20051
  blockType: "paragraph",
20050
20052
  blockAttrs: { align: "left" },
20051
20053
  marks: /* @__PURE__ */ new Set(),
@@ -20059,10 +20061,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20059
20061
  showSplit: !1,
20060
20062
  showHeaderRow: !1,
20061
20063
  headerRowActive: !1
20062
- }), S = j(null), I = Sn({
20064
+ }), S = j(null), I = An({
20063
20065
  visible: !1,
20064
20066
  selectionRect: null
20065
- }), V = Sn({
20067
+ }), V = An({
20066
20068
  visible: !1,
20067
20069
  anchorRect: null,
20068
20070
  href: "",
@@ -20071,7 +20073,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20071
20073
  showTextInput: !1
20072
20074
  });
20073
20075
  let me = null, ae = null, ye = !1;
20074
- const pe = Sn({
20076
+ const pe = An({
20075
20077
  visible: !1,
20076
20078
  row: -1,
20077
20079
  col: -1,
@@ -20083,7 +20085,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20083
20085
  function ue() {
20084
20086
  pe.visible = !1, pe.anchor = null, pe.row = -1, pe.col = -1;
20085
20087
  }
20086
- const Oe = Sn({
20088
+ const Oe = An({
20087
20089
  visible: !1,
20088
20090
  row: -1,
20089
20091
  col: -1,
@@ -20096,9 +20098,9 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20096
20098
  function et(v, w, x) {
20097
20099
  var ke, Re;
20098
20100
  if (!o.value) return;
20099
- const L = (ke = u.value.cells[v]) == null ? void 0 : ke[w];
20100
- if (!L || L.covered || L.cellType !== "orderedList") return;
20101
- const q = wl(u.value, v, w), Q = typeof L.startNumber == "number";
20101
+ const B = (ke = u.value.cells[v]) == null ? void 0 : ke[w];
20102
+ if (!B || B.covered || B.cellType !== "orderedList") return;
20103
+ const q = wl(u.value, v, w), Q = typeof B.startNumber == "number";
20102
20104
  let de = !1;
20103
20105
  for (let Be = v - 1; Be >= 0; Be--) {
20104
20106
  const nt = (Re = u.value.cells[Be]) == null ? void 0 : Re[w];
@@ -20124,17 +20126,17 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20124
20126
  }
20125
20127
  function ln() {
20126
20128
  if (pe.row < 0 || pe.col < 0) return;
20127
- const v = pe.anchor, w = pe.row, x = pe.col, L = pe.currentNumber;
20128
- ue(), v && (Oe.visible = !0, Oe.initialValue = L, Oe.anchor = v, Oe.row = w, Oe.col = x);
20129
+ const v = pe.anchor, w = pe.row, x = pe.col, B = pe.currentNumber;
20130
+ ue(), v && (Oe.visible = !0, Oe.initialValue = B, Oe.anchor = v, Oe.row = w, Oe.col = x);
20129
20131
  }
20130
20132
  function Vt(v) {
20131
- var x, L;
20133
+ var x, B;
20132
20134
  if (Oe.row < 0 || Oe.col < 0) {
20133
20135
  Ie();
20134
20136
  return;
20135
20137
  }
20136
20138
  const w = or(u.value, Oe.row, Oe.col, { startNumber: v });
20137
- (L = (x = n.commands).setAttrs) == null || L.call(x, { id: i, attrs: w }), Ie();
20139
+ (B = (x = n.commands).setAttrs) == null || B.call(x, { id: i, attrs: w }), Ie();
20138
20140
  }
20139
20141
  function ut() {
20140
20142
  if (!V.visible) return;
@@ -20151,8 +20153,8 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20151
20153
  function At() {
20152
20154
  const v = window.getSelection();
20153
20155
  if (!v || v.rangeCount === 0) return null;
20154
- const x = v.getRangeAt(0).commonAncestorContainer, L = x.nodeType === 1 ? x : x.parentElement;
20155
- return L ? L.closest("a") : null;
20156
+ const x = v.getRangeAt(0).commonAncestorContainer, B = x.nodeType === 1 ? x : x.parentElement;
20157
+ return B ? B.closest("a") : null;
20156
20158
  }
20157
20159
  function Bt() {
20158
20160
  const v = window.getSelection();
@@ -20160,20 +20162,20 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20160
20162
  const w = v.getRangeAt(0), x = w.getBoundingClientRect();
20161
20163
  if (x.width === 0 && x.height === 0) return;
20162
20164
  me = w.cloneRange();
20163
- const L = At(), q = (L == null ? void 0 : L.getAttribute("href")) ?? "", Q = v.toString();
20165
+ const B = At(), q = (B == null ? void 0 : B.getAttribute("href")) ?? "", Q = v.toString();
20164
20166
  V.anchorRect = x, V.href = q, V.text = Q, V.initialMode = q ? "view" : "edit", V.showTextInput = !Q && !q, V.visible = !0, I.visible = !1;
20165
20167
  }
20166
20168
  function lt(v) {
20167
- const w = v.getAttribute("href") || "", x = v.textContent || "", L = v.getBoundingClientRect();
20168
- V.anchorRect = L, V.href = w, V.text = x, V.initialMode = "view", V.showTextInput = !1, V.visible = !0, ye = !0, ae = v, I.visible = !1, I.selectionRect = null;
20169
+ const w = v.getAttribute("href") || "", x = v.textContent || "", B = v.getBoundingClientRect();
20170
+ V.anchorRect = B, V.href = w, V.text = x, V.initialMode = "view", V.showTextInput = !1, V.visible = !0, ye = !0, ae = v, I.visible = !1, I.selectionRect = null;
20169
20171
  }
20170
20172
  function Ze(v) {
20171
20173
  const w = v.closest(".table-cell-inner");
20172
20174
  if (!w) return;
20173
20175
  const x = w.closest(".table-cell");
20174
20176
  if (!x) return;
20175
- const L = Number(x.getAttribute("data-row")), q = Number(x.getAttribute("data-col"));
20176
- !Number.isFinite(L) || !Number.isFinite(q) || Se(L, q, w);
20177
+ const B = Number(x.getAttribute("data-row")), q = Number(x.getAttribute("data-col"));
20178
+ !Number.isFinite(B) || !Number.isFinite(q) || Se(B, q, w);
20177
20179
  }
20178
20180
  function Ot(v, w) {
20179
20181
  if (ae && ae.isConnected) {
@@ -20186,9 +20188,9 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20186
20188
  const q = m.value, Q = q ? h.get(`${q.row}-${q.col}`) : null;
20187
20189
  Q && Q.isConnected && (x.removeAllRanges(), x.addRange(me));
20188
20190
  }
20189
- const L = At();
20190
- if (L)
20191
- L.setAttribute("href", v), L.setAttribute("target", "_blank"), L.setAttribute("rel", "noopener noreferrer"), w !== void 0 && w !== L.textContent && (L.textContent = w);
20191
+ const B = At();
20192
+ if (B)
20193
+ B.setAttribute("href", v), B.setAttribute("target", "_blank"), B.setAttribute("rel", "noopener noreferrer"), w !== void 0 && w !== B.textContent && (B.textContent = w);
20192
20194
  else {
20193
20195
  if (x.rangeCount === 0) return;
20194
20196
  const q = x.getRangeAt(0), Q = document.createElement("a");
@@ -20204,19 +20206,19 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20204
20206
  }
20205
20207
  function be() {
20206
20208
  if (ae && ae.isConnected) {
20207
- const L = ae, q = L.parentElement;
20209
+ const B = ae, q = B.parentElement;
20208
20210
  if (q) {
20209
- for (; L.firstChild; )
20210
- q.insertBefore(L.firstChild, L);
20211
- q.removeChild(L);
20211
+ for (; B.firstChild; )
20212
+ q.insertBefore(B.firstChild, B);
20213
+ q.removeChild(B);
20212
20214
  }
20213
- Ze(L);
20215
+ Ze(B);
20214
20216
  return;
20215
20217
  }
20216
20218
  const v = window.getSelection();
20217
20219
  if (!v) return;
20218
20220
  if (me) {
20219
- const L = m.value, q = L ? h.get(`${L.row}-${L.col}`) : null;
20221
+ const B = m.value, q = B ? h.get(`${B.row}-${B.col}`) : null;
20220
20222
  q && q.isConnected && (v.removeAllRanges(), v.addRange(me));
20221
20223
  }
20222
20224
  const w = At();
@@ -20304,21 +20306,21 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20304
20306
  const v = S.value;
20305
20307
  v && v.focus();
20306
20308
  }
20307
- function z(v) {
20308
- var x, L;
20309
+ function K(v) {
20310
+ var x, B;
20309
20311
  const w = v.target;
20310
20312
  if (w.closest("a") && w.closest(".table-cell-inner")) {
20311
20313
  v.preventDefault();
20312
20314
  return;
20313
20315
  }
20314
- w.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle") || (v.stopPropagation(), G.value = { kind: "none" }, f.value = null, P(0), (L = (x = n.commands).selectBlock) == null || L.call(x, { id: i }));
20316
+ w.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle") || (v.stopPropagation(), G.value = { kind: "none" }, f.value = null, P(0), (B = (x = n.commands).selectBlock) == null || B.call(x, { id: i }));
20315
20317
  }
20316
20318
  function _e(v, w) {
20317
20319
  if (v.length !== w.length) return !1;
20318
20320
  for (let x = 0; x < v.length; x++) {
20319
- const L = v[x], q = w[x];
20320
- if (L.type !== q.type || "text" in L && L.text !== q.text) return !1;
20321
- const Q = L.marks ?? [], de = q.marks ?? [];
20321
+ const B = v[x], q = w[x];
20322
+ if (B.type !== q.type || "text" in B && B.text !== q.text) return !1;
20323
+ const Q = B.marks ?? [], de = q.marks ?? [];
20322
20324
  if (Q.length !== de.length) return !1;
20323
20325
  for (let ge = 0; ge < Q.length; ge++) {
20324
20326
  const Ce = Q[ge], ke = de[ge];
@@ -20332,19 +20334,19 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20332
20334
  }
20333
20335
  function Se(v, w, x) {
20334
20336
  var Ce, ke, Re;
20335
- const L = In(x), q = $r(L), Q = u.value, de = (Ce = Q.cells[v]) == null ? void 0 : Ce[w];
20337
+ const B = Nn(x), q = $r(B), Q = u.value, de = (Ce = Q.cells[v]) == null ? void 0 : Ce[w];
20336
20338
  if (de && _e(de.content, q)) return;
20337
20339
  const ge = nr(Q, v, w, q);
20338
- if ((Re = (ke = n.commands).setAttrs) == null || Re.call(ke, { id: i, attrs: ge }), q !== L) {
20340
+ if ((Re = (ke = n.commands).setAttrs) == null || Re.call(ke, { id: i, attrs: ge }), q !== B) {
20339
20341
  const Be = mo(q);
20340
20342
  x.innerHTML !== Be && (x.innerHTML = Be);
20341
20343
  }
20342
20344
  }
20343
- function dt(v, w, x, L) {
20345
+ function dt(v, w, x, B) {
20344
20346
  var Q, de, ge;
20345
20347
  if (I.visible && F())
20346
20348
  return;
20347
- const q = L == null ? void 0 : L.relatedTarget;
20349
+ const q = B == null ? void 0 : B.relatedTarget;
20348
20350
  if (!(q != null && q.closest(".link-popover")) && !(q != null && q.closest(".hover-toolbar"))) {
20349
20351
  if (I.visible) {
20350
20352
  const Ce = window.getSelection();
@@ -20357,7 +20359,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20357
20359
  }
20358
20360
  }
20359
20361
  function ht(v) {
20360
- var L;
20362
+ var B;
20361
20363
  if (I.visible && F()) {
20362
20364
  f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), ue(), Ie();
20363
20365
  return;
@@ -20368,7 +20370,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20368
20370
  const q = window.getSelection();
20369
20371
  if (q && q.rangeCount > 0 && !q.isCollapsed) {
20370
20372
  const Q = q.getRangeAt(0);
20371
- if ((L = Q.commonAncestorContainer.nodeType === 1 ? Q.commonAncestorContainer : Q.commonAncestorContainer.parentElement) == null ? void 0 : L.closest(".table-cell-inner")) {
20373
+ if ((B = Q.commonAncestorContainer.nodeType === 1 ? Q.commonAncestorContainer : Q.commonAncestorContainer.parentElement) == null ? void 0 : B.closest(".table-cell-inner")) {
20372
20374
  f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), ue(), Ie();
20373
20375
  return;
20374
20376
  }
@@ -20377,12 +20379,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20377
20379
  f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), m.value && (m.value = null), ut(), ue(), Ie();
20378
20380
  }
20379
20381
  }
20380
- function vn(v, w, x, L) {
20382
+ function vn(v, w, x, B) {
20381
20383
  var q, Q, de, ge, Ce, ke, Re, Be, nt, st, vt, cn, dn;
20382
- if (L.key === "Enter" && !L.shiftKey && !L.ctrlKey && !L.metaKey) {
20384
+ if (B.key === "Enter" && !B.shiftKey && !B.ctrlKey && !B.metaKey) {
20383
20385
  const qt = (q = u.value.cells[v]) == null ? void 0 : q[w];
20384
20386
  if ((qt == null ? void 0 : qt.cellType) === "codeBlock") {
20385
- L.preventDefault(), L.stopPropagation();
20387
+ B.preventDefault(), B.stopPropagation();
20386
20388
  const Xe = window.getSelection();
20387
20389
  let ot = ((Q = x.textContent) == null ? void 0 : Q.length) ?? 0;
20388
20390
  if (Xe && Xe.rangeCount > 0) {
@@ -20429,18 +20431,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20429
20431
  });
20430
20432
  return;
20431
20433
  }
20432
- L.preventDefault(), L.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur(), G.value = { kind: "cell", rect: { r1: v, c1: w, r2: v, c2: w } }, f.value = { anchor: { row: v, col: w }, focus: { row: v, col: w } }, k(), qe(() => {
20434
+ B.preventDefault(), B.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur(), G.value = { kind: "cell", rect: { r1: v, c1: w, r2: v, c2: w } }, f.value = { anchor: { row: v, col: w }, focus: { row: v, col: w } }, k(), qe(() => {
20433
20435
  const Xe = mt(v, w, v, w);
20434
20436
  Xe && Lt(Xe);
20435
20437
  });
20436
20438
  return;
20437
20439
  }
20438
- if (L.key === "Tab") {
20439
- L.preventDefault(), L.stopPropagation(), ut();
20440
- const qt = w3(u.value, v, w, L.shiftKey);
20440
+ if (B.key === "Tab") {
20441
+ B.preventDefault(), B.stopPropagation(), ut();
20442
+ const qt = w3(u.value, v, w, B.shiftKey);
20441
20443
  if (!qt) {
20442
- if (E3(u.value, v, w) && !L.shiftKey) {
20443
- const Yt = In(x), Qn = u.value, Qt = nr(Qn, v, w, Yt), Jn = hs(Qt, Qt.rows);
20444
+ if (E3(u.value, v, w) && !B.shiftKey) {
20445
+ const Yt = Nn(x), Qn = u.value, Qt = nr(Qn, v, w, Yt), Jn = hs(Qt, Qt.rows);
20444
20446
  (Ce = (ge = n.commands).setAttrs) == null || Ce.call(ge, { id: i, attrs: Jn }), qe(() => {
20445
20447
  const Jt = `${Jn.rows - 1}-0`, Zt = h.get(Jt);
20446
20448
  Zt == null || Zt.focus(), ml(Zt);
@@ -20449,15 +20451,15 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20449
20451
  }
20450
20452
  return;
20451
20453
  }
20452
- const { r: Xe, c: ot } = qt, fn = In(x), wt = u.value, Pt = (ke = wt.cells[v]) == null ? void 0 : ke[w];
20454
+ const { r: Xe, c: ot } = qt, fn = Nn(x), wt = u.value, Pt = (ke = wt.cells[v]) == null ? void 0 : ke[w];
20453
20455
  let hn = wt;
20454
20456
  Pt && (_e(Pt.content, fn) || (hn = nr(wt, v, w, fn))), hn !== wt && ((Be = (Re = n.commands).setAttrs) == null || Be.call(Re, { id: i, attrs: hn })), qe(() => {
20455
20457
  const Xt = `${Xe}-${ot}`, Yt = h.get(Xt);
20456
- Yt == null || Yt.focus(), L.shiftKey ? Xi(Yt) : ml(Yt);
20458
+ Yt == null || Yt.focus(), B.shiftKey ? Xi(Yt) : ml(Yt);
20457
20459
  });
20458
20460
  return;
20459
20461
  }
20460
- if (L.key === "Backspace") {
20462
+ if (B.key === "Backspace") {
20461
20463
  const qt = (nt = u.value.cells[v]) == null ? void 0 : nt[w], Xe = qt == null ? void 0 : qt.cellType;
20462
20464
  if (Xe && Xe !== "paragraph") {
20463
20465
  const ot = window.getSelection();
@@ -20475,8 +20477,8 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20475
20477
  }
20476
20478
  }
20477
20479
  if (fn === 0 && (!x.textContent || x.textContent.trim() === "" || (Xe === "bulletList" || Xe === "orderedList" || Xe === "todoList"))) {
20478
- L.preventDefault(), L.stopPropagation(), ut(), ue(), Ie();
20479
- const hn = In(x), Xt = u.value, Yt = nr(Xt, v, w, hn), Qn = or(Yt, v, w, { cellType: "paragraph" });
20480
+ B.preventDefault(), B.stopPropagation(), ut(), ue(), Ie();
20481
+ const hn = Nn(x), Xt = u.value, Yt = nr(Xt, v, w, hn), Qn = or(Yt, v, w, { cellType: "paragraph" });
20480
20482
  (dn = (cn = n.commands).setAttrs) == null || dn.call(cn, { id: i, attrs: Qn }), qe(() => {
20481
20483
  const Qt = h.get(`${v}-${w}`);
20482
20484
  Qt && (Qt.focus(), Xi(Qt));
@@ -20485,7 +20487,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20485
20487
  }
20486
20488
  }
20487
20489
  }
20488
- L.key === "Escape" && (L.preventDefault(), L.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur());
20490
+ B.key === "Escape" && (B.preventDefault(), B.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur());
20489
20491
  }
20490
20492
  function En(v, w, x) {
20491
20493
  m.value = { row: v, col: w }, f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0));
@@ -20495,18 +20497,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20495
20497
  if (!w) return null;
20496
20498
  const x = w.closest(".table-cell");
20497
20499
  if (!x) return null;
20498
- const L = Number(x.getAttribute("data-row") ?? x.dataset.row), q = Number(x.getAttribute("data-col") ?? x.dataset.col);
20499
- return !Number.isFinite(L) || !Number.isFinite(q) ? null : { r: L, c: q, el: x };
20500
+ const B = Number(x.getAttribute("data-row") ?? x.dataset.row), q = Number(x.getAttribute("data-col") ?? x.dataset.col);
20501
+ return !Number.isFinite(B) || !Number.isFinite(q) ? null : { r: B, c: q, el: x };
20500
20502
  }
20501
- function Hn(v) {
20503
+ function Un(v) {
20502
20504
  if (!o.value) return;
20503
20505
  const w = v.target;
20504
20506
  if (!w) return;
20505
20507
  const x = w.closest(".table-cell-inner");
20506
20508
  if (!x) return;
20507
- const L = x.closest(".table-cell");
20508
- if (!L) return;
20509
- const q = Number(L.getAttribute("data-row")), Q = Number(L.getAttribute("data-col"));
20509
+ const B = x.closest(".table-cell");
20510
+ if (!B) return;
20511
+ const q = Number(B.getAttribute("data-row")), Q = Number(B.getAttribute("data-col"));
20510
20512
  !Number.isFinite(q) || !Number.isFinite(Q) || vn(q, Q, x, v);
20511
20513
  }
20512
20514
  function un(v) {
@@ -20520,45 +20522,45 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20520
20522
  return;
20521
20523
  }
20522
20524
  V.visible && ut();
20523
- const L = Ye(v);
20524
- if (!L || v.button !== 0) return;
20525
+ const B = Ye(v);
20526
+ if (!B || v.button !== 0) return;
20525
20527
  const q = m.value;
20526
- if (q && q.row === L.r && q.col === L.c) {
20528
+ if (q && q.row === B.r && q.col === B.c) {
20527
20529
  it = !0, document.addEventListener("mouseup", sn, { once: !0, capture: !0 });
20528
20530
  return;
20529
20531
  }
20530
20532
  v.preventDefault(), v.stopPropagation();
20531
- const { r: Q, c: de } = L, ge = document.activeElement;
20533
+ const { r: Q, c: de } = B, ge = document.activeElement;
20532
20534
  ge && ge.closest(".table-cell-inner") && ge.blur(), m.value = null, (Re = (ke = n.commands).selectBlock) == null || Re.call(ke, { id: i }), k(), M = A.value !== null, M && (O = !0, W && (clearTimeout(W), W = null), _ && (clearTimeout(_), _ = null)), G.value = { kind: "none" }, X = !0;
20533
20535
  const Ce = { row: Q, col: de };
20534
- le.value = { start: Ce, current: Ce }, f.value = { anchor: Ce, focus: Ce }, document.addEventListener("mouseup", Fn, !0);
20536
+ le.value = { start: Ce, current: Ce }, f.value = { anchor: Ce, focus: Ce }, document.addEventListener("mouseup", zn, !0);
20535
20537
  }
20536
- function On(v) {
20538
+ function Dn(v) {
20537
20539
  if (!X || !le.value) return;
20538
20540
  const w = Ye(v);
20539
20541
  if (!w) return;
20540
- const { r: x, c: L } = w, q = le.value.current;
20541
- if (x === q.row && L === q.col) return;
20542
- le.value = { ...le.value, current: { row: x, col: L } };
20542
+ const { r: x, c: B } = w, q = le.value.current;
20543
+ if (x === q.row && B === q.col) return;
20544
+ le.value = { ...le.value, current: { row: x, col: B } };
20543
20545
  const Q = le.value.start;
20544
- f.value = { anchor: Q, focus: { row: x, col: L } };
20546
+ f.value = { anchor: Q, focus: { row: x, col: B } };
20545
20547
  }
20546
- function Un(v) {
20548
+ function Fn(v) {
20547
20549
  if (!o.value) return;
20548
20550
  const w = v.target;
20549
20551
  if (w.tagName === "INPUT" && w.classList.contains("table-cell-todo-checkbox") || w.classList.contains("table-cell-ol-marker"))
20550
20552
  return;
20551
20553
  const x = Ye(v);
20552
20554
  if (!x) return;
20553
- const { r: L, c: q } = x, Q = m.value;
20554
- Q && Q.row === L && Q.col === q || (v.preventDefault(), v.stopPropagation(), _ && (clearTimeout(_), _ = null), O = !1, X = !1, le.value = null, f.value = null, G.value = { kind: "none" }, P(0), document.removeEventListener("mouseup", Fn, !0), m.value = { row: L, col: q }, qe(() => {
20555
- const de = `${L}-${q}`, ge = h.get(de);
20555
+ const { r: B, c: q } = x, Q = m.value;
20556
+ Q && Q.row === B && Q.col === q || (v.preventDefault(), v.stopPropagation(), _ && (clearTimeout(_), _ = null), O = !1, X = !1, le.value = null, f.value = null, G.value = { kind: "none" }, P(0), document.removeEventListener("mouseup", zn, !0), m.value = { row: B, col: q }, qe(() => {
20557
+ const de = `${B}-${q}`, ge = h.get(de);
20556
20558
  ge && (ge.focus(), ml(ge));
20557
20559
  }));
20558
20560
  }
20559
- function Fn(v) {
20561
+ function zn(v) {
20560
20562
  if (X && le.value) {
20561
- const w = le.value.start, x = le.value.current, L = Math.min(w.row, x.row), q = Math.min(w.col, x.col), Q = Math.max(w.row, x.row), de = Math.max(w.col, x.col), ge = io(u.value, L, q, Q, de), { r1: Ce, c1: ke, r2: Re, c2: Be } = ge;
20563
+ const w = le.value.start, x = le.value.current, B = Math.min(w.row, x.row), q = Math.min(w.col, x.col), Q = Math.max(w.row, x.row), de = Math.max(w.col, x.col), ge = io(u.value, B, q, Q, de), { r1: Ce, c1: ke, r2: Re, c2: Be } = ge;
20562
20564
  if (G.value = { kind: "cell", rect: { r1: Ce, c1: ke, r2: Re, c2: Be } }, f.value = {
20563
20565
  anchor: { row: Ce, col: ke },
20564
20566
  focus: { row: Re, col: Be }
@@ -20577,7 +20579,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20577
20579
  st && Lt(st);
20578
20580
  }, 250);
20579
20581
  }
20580
- X = !1, le.value = null, document.removeEventListener("mouseup", Fn, !0);
20582
+ X = !1, le.value = null, document.removeEventListener("mouseup", zn, !0);
20581
20583
  }
20582
20584
  function Le(v) {
20583
20585
  if (G.value.kind === "row" && G.value.row === v) {
@@ -20585,7 +20587,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20585
20587
  return;
20586
20588
  }
20587
20589
  A.value !== null && (O = !0);
20588
- const w = u.value, x = w.cols, L = v, q = 0, Q = v, de = Math.max(0, x - 1), ge = x > 0 ? io(w, L, q, Q, de) : { r1: L, c1: q, r2: Q, c2: de };
20590
+ const w = u.value, x = w.cols, B = v, q = 0, Q = v, de = Math.max(0, x - 1), ge = x > 0 ? io(w, B, q, Q, de) : { r1: B, c1: q, r2: Q, c2: de };
20589
20591
  G.value = { kind: "row", row: v }, f.value = x > 0 ? { anchor: { row: ge.r1, col: ge.c1 }, focus: { row: ge.r2, col: ge.c2 } } : null, m.value = null;
20590
20592
  const Ce = document.activeElement;
20591
20593
  Ce && Ce.closest(".table-cell-inner") && Ce.blur(), k(), qe(() => {
@@ -20599,7 +20601,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20599
20601
  return;
20600
20602
  }
20601
20603
  A.value !== null && (O = !0);
20602
- const w = u.value, x = w.rows, L = 0, q = v, Q = Math.max(0, x - 1), de = v, ge = x > 0 ? io(w, L, q, Q, de) : { r1: L, c1: q, r2: Q, c2: de };
20604
+ const w = u.value, x = w.rows, B = 0, q = v, Q = Math.max(0, x - 1), de = v, ge = x > 0 ? io(w, B, q, Q, de) : { r1: B, c1: q, r2: Q, c2: de };
20603
20605
  G.value = { kind: "col", col: v }, f.value = x > 0 ? { anchor: { row: ge.r1, col: ge.c1 }, focus: { row: ge.r2, col: ge.c2 } } : null, m.value = null;
20604
20606
  const Ce = document.activeElement;
20605
20607
  Ce && Ce.closest(".table-cell-inner") && Ce.blur(), k(), qe(() => {
@@ -20623,16 +20625,16 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20623
20625
  }, m.value = null;
20624
20626
  const x = document.activeElement;
20625
20627
  x && x.closest(".table-cell-inner") && x.blur(), k(), qe(() => {
20626
- const L = zt.value, q = L.rowTops[0] ?? 0, Q = L.colLefts[0] ?? 0, de = L.colWidths.length > 0 ? L.colWidths.reduce((Re, Be) => Re + Be, 0) : v.colWidths.reduce((Re, Be) => Re + Be, 0), ge = L.rowTops[v.rows - 1] ?? 0, Ce = L.rowHeights[v.rows - 1] ?? 32, ke = new DOMRect(Q, q, de, ge + Ce - q);
20628
+ const B = zt.value, q = B.rowTops[0] ?? 0, Q = B.colLefts[0] ?? 0, de = B.colWidths.length > 0 ? B.colWidths.reduce((Re, Be) => Re + Be, 0) : v.colWidths.reduce((Re, Be) => Re + Be, 0), ge = B.rowTops[v.rows - 1] ?? 0, Ce = B.rowHeights[v.rows - 1] ?? 32, ke = new DOMRect(Q, q, de, ge + Ce - q);
20627
20629
  Lt(ke);
20628
20630
  });
20629
20631
  }
20630
- function mt(v, w, x, L) {
20631
- const q = zt.value, Q = q.rowTops[v] ?? 0, de = q.rowTops[x] ?? 0, ge = q.rowHeights[x] ?? 32, Ce = de + ge, ke = q.colLefts[w] ?? 0, Re = q.colLefts[L] ?? 0, Be = q.colWidths[L] ?? 80, nt = Re + Be;
20632
+ function mt(v, w, x, B) {
20633
+ const q = zt.value, Q = q.rowTops[v] ?? 0, de = q.rowTops[x] ?? 0, ge = q.rowHeights[x] ?? 32, Ce = de + ge, ke = q.colLefts[w] ?? 0, Re = q.colLefts[B] ?? 0, Be = q.colWidths[B] ?? 80, nt = Re + Be;
20632
20634
  return new DOMRect(ke, Q, nt - ke, Ce - Q);
20633
20635
  }
20634
- Ln(() => {
20635
- document.removeEventListener("mouseup", Fn, !0), document.removeEventListener("mouseup", sn, !0), document.removeEventListener("mousemove", zn, !0), document.removeEventListener("mouseup", Kn, !0), document.removeEventListener("keydown", Je, !0), document.removeEventListener("selectionchange", He), document.removeEventListener("mousedown", $t, !0), window.removeEventListener("scroll", Et, !0), document.removeEventListener("touchmove", Et, !0), document.removeEventListener("mousedown", K, !0), document.removeEventListener("mouseup", oe, !0), _ && (clearTimeout(_), _ = null);
20636
+ Bn(() => {
20637
+ document.removeEventListener("mouseup", zn, !0), document.removeEventListener("mouseup", sn, !0), document.removeEventListener("mousemove", xn, !0), document.removeEventListener("mouseup", Kn, !0), document.removeEventListener("keydown", Je, !0), document.removeEventListener("selectionchange", He), document.removeEventListener("mousedown", $t, !0), window.removeEventListener("scroll", Et, !0), document.removeEventListener("touchmove", Et, !0), document.removeEventListener("mousedown", z, !0), document.removeEventListener("mouseup", oe, !0), _ && (clearTimeout(_), _ = null);
20636
20638
  });
20637
20639
  function Je(v) {
20638
20640
  var q, Q;
@@ -20685,7 +20687,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20685
20687
  }
20686
20688
  }
20687
20689
  oo(() => {
20688
- document.addEventListener("keydown", Je, !0), document.addEventListener("selectionchange", He), document.addEventListener("mousedown", $t, !0), document.addEventListener("mousedown", K, !0), document.addEventListener("mouseup", oe, !0), window.addEventListener("scroll", Et, !0), document.addEventListener("touchmove", Et, { passive: !0, capture: !0 });
20690
+ document.addEventListener("keydown", Je, !0), document.addEventListener("selectionchange", He), document.addEventListener("mousedown", $t, !0), document.addEventListener("mousedown", z, !0), document.addEventListener("mouseup", oe, !0), window.addEventListener("scroll", Et, !0), document.addEventListener("touchmove", Et, { passive: !0, capture: !0 });
20689
20691
  });
20690
20692
  const _t = j(null), zt = j({
20691
20693
  rowTops: [],
@@ -20700,12 +20702,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20700
20702
  function Cn() {
20701
20703
  const v = p.value, w = _t.value, x = S.value;
20702
20704
  if (!v || !w || !x) return;
20703
- const L = u.value.rows, q = u.value.cols, Q = w.getBoundingClientRect(), de = x.getBoundingClientRect(), ge = Math.round(Q.left - de.left), Ce = Math.round(Q.top - de.top), ke = Array.from(v.querySelectorAll("tr")), Re = [], Be = [];
20705
+ const B = u.value.rows, q = u.value.cols, Q = w.getBoundingClientRect(), de = x.getBoundingClientRect(), ge = Math.round(Q.left - de.left), Ce = Math.round(Q.top - de.top), ke = Array.from(v.querySelectorAll("tr")), Re = [], Be = [];
20704
20706
  for (const Xe of ke) {
20705
20707
  const ot = Xe.getBoundingClientRect();
20706
20708
  Re.push(Math.round(ot.top - Q.top)), Be.push(Math.round(ot.height));
20707
20709
  }
20708
- for (; Re.length < L; ) {
20710
+ for (; Re.length < B; ) {
20709
20711
  const Xe = Re.length > 0 ? Re[Re.length - 1] + Be[Be.length - 1] : 0;
20710
20712
  Re.push(Xe), Be.push(Be.length > 0 ? Be[Be.length - 1] : 32);
20711
20713
  }
@@ -20745,22 +20747,22 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20745
20747
  }), _t.value && Gt.observe(_t.value), p.value && Gt.observe(p.value);
20746
20748
  const v = (w = S.value) == null ? void 0 : w.closest(".block-editor");
20747
20749
  v && Gt.observe(v), _t.value && _t.value.addEventListener("scroll", Ne, { passive: !0 }), he();
20748
- }), Ln(() => {
20750
+ }), Bn(() => {
20749
20751
  var v;
20750
- Gt == null || Gt.disconnect(), _t.value && _t.value.removeEventListener("scroll", Ne), b && cancelAnimationFrame(b), B && clearTimeout(B), l && ((v = l.value) == null ? void 0 : v.blockId) === i && (l.value = null);
20752
+ Gt == null || Gt.disconnect(), _t.value && _t.value.removeEventListener("scroll", Ne), b && cancelAnimationFrame(b), L && clearTimeout(L), l && ((v = l.value) == null ? void 0 : v.blockId) === i && (l.value = null);
20751
20753
  });
20752
- function Tn(v, w) {
20754
+ function Mn(v, w) {
20753
20755
  if (!o.value) return;
20754
- w.preventDefault(), w.stopPropagation(), $.value = v, ce = zt.value.colWidths[v] ?? 80, U = w.clientX, document.addEventListener("mousemove", zn, !0), document.addEventListener("mouseup", Kn, !0), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
20756
+ w.preventDefault(), w.stopPropagation(), $.value = v, ce = zt.value.colWidths[v] ?? 80, U = w.clientX, document.addEventListener("mousemove", xn, !0), document.addEventListener("mouseup", Kn, !0), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
20755
20757
  }
20756
- function zn(v) {
20758
+ function xn(v) {
20757
20759
  var Q, de;
20758
20760
  if ($.value === null) return;
20759
20761
  const w = v.clientX - U;
20760
20762
  let x = Math.max(40, Math.round(ce + w));
20761
- const L = _t.value;
20762
- if (L) {
20763
- const ge = L.clientWidth - 4, Ce = u.value.colWidths.reduce((Re, Be, nt) => nt === $.value ? Re : Re + Be, 0);
20763
+ const B = _t.value;
20764
+ if (B) {
20765
+ const ge = B.clientWidth - 4, Ce = u.value.colWidths.reduce((Re, Be, nt) => nt === $.value ? Re : Re + Be, 0);
20764
20766
  if (Ce + x <= ge) {
20765
20767
  const Re = Math.max(40, ge - Ce);
20766
20768
  x = Math.min(x, Re);
@@ -20770,32 +20772,32 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20770
20772
  (de = (Q = n.commands).setAttrs) == null || de.call(Q, { id: i, attrs: q });
20771
20773
  }
20772
20774
  function Kn() {
20773
- $.value = null, document.removeEventListener("mousemove", zn, !0), document.removeEventListener("mouseup", Kn, !0), document.body.style.cursor = "", document.body.style.userSelect = "", qe(() => {
20775
+ $.value = null, document.removeEventListener("mousemove", xn, !0), document.removeEventListener("mouseup", Kn, !0), document.body.style.cursor = "", document.body.style.userSelect = "", qe(() => {
20774
20776
  Cn(), he();
20775
20777
  });
20776
20778
  }
20777
- const xn = j(0), po = j(0), Wn = j(0), R = j(!1);
20778
- let b = 0, B;
20779
+ const _n = j(0), po = j(0), Wn = j(0), R = j(!1);
20780
+ let b = 0, L;
20779
20781
  function he() {
20780
20782
  const v = _t.value;
20781
- v && (xn.value = v.scrollLeft, po.value = v.clientWidth, Wn.value = v.scrollWidth);
20783
+ v && (_n.value = v.scrollLeft, po.value = v.clientWidth, Wn.value = v.scrollWidth);
20782
20784
  }
20783
20785
  function Ne() {
20784
20786
  R.value || (R.value = !0), b && cancelAnimationFrame(b), b = requestAnimationFrame(() => {
20785
20787
  b = 0, he();
20786
- }), B && clearTimeout(B), B = setTimeout(() => {
20788
+ }), L && clearTimeout(L), L = setTimeout(() => {
20787
20789
  R.value = !1, he();
20788
20790
  }, 130);
20789
20791
  }
20790
20792
  const Ke = Me(() => {
20791
20793
  if (!o.value) return [];
20792
- const v = zt.value, w = u.value.cols, x = v.colLefts, L = v.colWidths;
20793
- if (w === 0 || x.length < w || L.length < w) return [];
20794
- const q = xn.value, Q = po.value, de = Wn.value;
20794
+ const v = zt.value, w = u.value.cols, x = v.colLefts, B = v.colWidths;
20795
+ if (w === 0 || x.length < w || B.length < w) return [];
20796
+ const q = _n.value, Q = po.value, de = Wn.value;
20795
20797
  if (Q <= 0) return [];
20796
20798
  const ge = q <= 0, Ce = q + Q >= de - 1, ke = de <= Q + 1, Re = 6, Be = [];
20797
20799
  for (let nt = 0; nt <= w; nt++) {
20798
- const vt = (nt === 0 ? x[0] ?? 0 : nt === w ? (x[w - 1] ?? 0) + (L[w - 1] ?? 0) : x[nt] ?? 0) - q;
20800
+ const vt = (nt === 0 ? x[0] ?? 0 : nt === w ? (x[w - 1] ?? 0) + (B[w - 1] ?? 0) : x[nt] ?? 0) - q;
20799
20801
  let cn = vt >= -1 && vt <= Q + 1;
20800
20802
  if (nt === 0 && (ge || ke) && (cn = !0), nt === w && (Ce || ke) && (cn = !0), !cn) continue;
20801
20803
  const dn = Math.max(Re, Math.min(vt, Q - Re)) + (nt > 0 ? 2 : -2);
@@ -20804,18 +20806,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20804
20806
  return Be;
20805
20807
  });
20806
20808
  function Pe(v, w) {
20807
- var L, q;
20809
+ var B, q;
20808
20810
  const x = { id: i, ...w };
20809
- (q = (L = n.commands)[v]) == null || q.call(L, x);
20811
+ (q = (B = n.commands)[v]) == null || q.call(B, x);
20810
20812
  }
20811
20813
  function Ee() {
20812
20814
  m.value = null, f.value = null, G.value.kind !== "none" && (G.value = { kind: "none" }), P(0), ue(), Ie();
20813
20815
  }
20814
20816
  return t({ clearInnerFocus: Ee }), () => {
20815
20817
  var ho, jo, Po, Ql, Jl, ei, ti, ni, oi, ri, li;
20816
- const v = u.value, w = v.rows, x = v.cols, L = lr(f.value), q = L ? io(v, L.r1, L.c1, L.r2, L.c2) : null, Q = zt.value, de = G.value, ge = [], Ce = ve("div", { class: "table-toolbar" }, [
20818
+ const v = u.value, w = v.rows, x = v.cols, B = lr(f.value), q = B ? io(v, B.r1, B.c1, B.r2, B.c2) : null, Q = zt.value, de = G.value, ge = [], Ce = ve("div", { class: "table-toolbar" }, [
20817
20819
  ve("div", { class: "table-toolbar-title" }, [
20818
- ve(An, { html: Pr, class: "table-toolbar-icon" }),
20820
+ ve(In, { html: Pr, class: "table-toolbar-icon" }),
20819
20821
  ve("span", r.t("table.title"))
20820
20822
  ])
20821
20823
  ]), ke = [];
@@ -20840,10 +20842,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
20840
20842
  ii !== "top" && (si = { verticalAlign: ii });
20841
20843
  const ci = !uc && ((jo = m.value) == null ? void 0 : jo.row) === Y && ((Po = m.value) == null ? void 0 : Po.col) === Ae;
20842
20844
  ci && Co.push("table-cell-focused");
20843
- const Mn = ["table-cell-inner"], kn = xe.cellType;
20844
- kn === "heading" || kn === "heading1" ? Mn.push("table-cell-heading", "table-cell-h1") : kn === "heading2" ? Mn.push("table-cell-heading", "table-cell-h2") : kn === "heading3" ? Mn.push("table-cell-heading", "table-cell-h3") : kn === "heading4" ? Mn.push("table-cell-heading", "table-cell-h4") : kn === "heading5" ? Mn.push("table-cell-heading", "table-cell-h5") : kn === "heading6" ? Mn.push("table-cell-heading", "table-cell-h6") : kn === "bulletList" ? Mn.push("table-cell-bullet") : kn === "orderedList" ? Mn.push("table-cell-ordered") : kn === "todoList" ? (Mn.push("table-cell-todo"), xe.checked && Mn.push("todo-checked")) : kn === "quote" ? Mn.push("table-cell-quote") : kn === "codeBlock" && Mn.push("table-cell-code");
20845
+ const Sn = ["table-cell-inner"], kn = xe.cellType;
20846
+ kn === "heading" || kn === "heading1" ? Sn.push("table-cell-heading", "table-cell-h1") : kn === "heading2" ? Sn.push("table-cell-heading", "table-cell-h2") : kn === "heading3" ? Sn.push("table-cell-heading", "table-cell-h3") : kn === "heading4" ? Sn.push("table-cell-heading", "table-cell-h4") : kn === "heading5" ? Sn.push("table-cell-heading", "table-cell-h5") : kn === "heading6" ? Sn.push("table-cell-heading", "table-cell-h6") : kn === "bulletList" ? Sn.push("table-cell-bullet") : kn === "orderedList" ? Sn.push("table-cell-ordered") : kn === "todoList" ? (Sn.push("table-cell-todo"), xe.checked && Sn.push("todo-checked")) : kn === "quote" ? Sn.push("table-cell-quote") : kn === "codeBlock" && Sn.push("table-cell-code");
20845
20847
  const ai = kn === "orderedList" ? wl(v, Y, Ae) : -1, rl = ve("div", {
20846
- class: Mn,
20848
+ class: Sn,
20847
20849
  // contenteditable is ONLY true when this cell is in editing
20848
20850
  // mode (set via focusedCell after dblclick) AND the editor is
20849
20851
  // in editable mode. Otherwise false → clicks won't grab focus,
@@ -21011,7 +21013,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
21011
21013
  ve("div", {
21012
21014
  class: "table-col-resizer",
21013
21015
  title: r.t("table.resizeCol"),
21014
- onMousedown: (xe) => Tn(Y, xe)
21016
+ onMousedown: (xe) => Mn(Y, xe)
21015
21017
  })
21016
21018
  ]));
21017
21019
  }
@@ -21219,7 +21221,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
21219
21221
  let ft = "paragraph";
21220
21222
  const nn = {};
21221
21223
  Ge === "heading" || Ge === "heading1" ? (ft = "heading", nn.level = 1) : Ge === "heading2" ? (ft = "heading", nn.level = 2) : Ge === "heading3" ? (ft = "heading", nn.level = 3) : Ge === "heading4" ? (ft = "heading", nn.level = 4) : Ge === "heading5" ? (ft = "heading", nn.level = 5) : Ge === "heading6" ? (ft = "heading", nn.level = 6) : Ge === "bulletList" ? ft = "bulletList" : Ge === "orderedList" ? ft = "orderedList" : Ge === "todoList" ? ft = "todoList" : Ge === "quote" ? ft = "quote" : Ge === "codeBlock" && (ft = "codeBlock"), typeof (tn == null ? void 0 : tn.align) == "string" && (nn.align = tn.align), typeof (tn == null ? void 0 : tn.verticalAlign) == "string" && (nn.verticalAlign = tn.verticalAlign);
21222
- const Dn = {
21224
+ const $n = {
21223
21225
  visible: I.visible && !!I.selectionRect,
21224
21226
  selectionRect: I.selectionRect,
21225
21227
  blockId: i,
@@ -21252,7 +21254,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
21252
21254
  Bt();
21253
21255
  }
21254
21256
  };
21255
- return l && (Dn.visible ? d(Dn) : ((ri = l.value) == null ? void 0 : ri.blockId) === i && ((li = l.value) != null && li.cellEditMode) && d(null)), ge.push(
21257
+ return l && ($n.visible ? d($n) : ((ri = l.value) == null ? void 0 : ri.blockId) === i && ((li = l.value) != null && li.cellEditMode) && d(null)), ge.push(
21256
21258
  ve(Bs, {
21257
21259
  visible: V.visible,
21258
21260
  anchorRect: V.anchorRect,
@@ -21303,12 +21305,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
21303
21305
  class: ["block-table-container", "block-focus-root", ...jn(e.block.attrs)],
21304
21306
  ref: S,
21305
21307
  tabindex: "-1",
21306
- onClick: z,
21308
+ onClick: K,
21307
21309
  onMousedown: un,
21308
- onMouseover: On,
21309
- onDblclick: Un,
21310
+ onMouseover: Dn,
21311
+ onDblclick: Fn,
21310
21312
  onFocusout: ht,
21311
- onKeydown: Hn
21313
+ onKeydown: Un
21312
21314
  },
21313
21315
  ge
21314
21316
  );
@@ -21516,13 +21518,13 @@ function B3() {
21516
21518
  const $ = t.selection, U = $.kind === "caret" ? $.blockId : $.kind === "text" ? $.focus.blockId : $.blockIds[0] ?? null;
21517
21519
  U && (h = U);
21518
21520
  }
21519
- if (h && (t.doc.blocks.get(h) ? (d = jt(t.doc, h), u = Rn(t.doc, h)) : h = null), !h)
21521
+ if (h && (t.doc.blocks.get(h) ? (d = jt(t.doc, h), u = Ln(t.doc, h)) : h = null), !h)
21520
21522
  if (e.after) {
21521
21523
  if (!t.doc.blocks.get(e.after)) return !1;
21522
- d = jt(t.doc, e.after), u = Rn(t.doc, e.after) + 1;
21524
+ d = jt(t.doc, e.after), u = Ln(t.doc, e.after) + 1;
21523
21525
  } else {
21524
21526
  const $ = t.selection, U = $.kind === "caret" ? $.blockId : $.kind === "text" ? $.focus.blockId : $.blockIds[0] ?? null;
21525
- U && (d = jt(t.doc, U), u = Rn(t.doc, U) + 1);
21527
+ U && (d = jt(t.doc, U), u = Ln(t.doc, U) + 1);
21526
21528
  }
21527
21529
  const p = bt();
21528
21530
  h && p.removeBlock(h);
@@ -21532,7 +21534,7 @@ function B3() {
21532
21534
  type: "table",
21533
21535
  attrs: m,
21534
21536
  content: []
21535
- }), D = _l(t.doc, p.peek()), F = vr(D.doc, T), K = yo(D.doc, T), oe = F ?? K;
21537
+ }), D = _l(t.doc, p.peek()), F = vr(D.doc, T), z = yo(D.doc, T), oe = F ?? z;
21536
21538
  return oe ? p.setSelection(yt(oe.id, 0)) : p.setSelection(yt(T, 0)), n == null || n(p.build()), !0;
21537
21539
  }
21538
21540
  };
@@ -21705,13 +21707,13 @@ const H3 = Ft({
21705
21707
  },
21706
21708
  setup(e) {
21707
21709
  e.block, e.placeholder;
21708
- const t = Pn(), n = _n(), o = j(null), r = j(0), i = Me(() => (r.value, P3(t.getState().doc)));
21710
+ const t = Hn(), n = Tn(), o = j(null), r = j(0), i = Me(() => (r.value, P3(t.getState().doc)));
21709
21711
  let l = null;
21710
21712
  oo(() => {
21711
21713
  l = t.subscribe(() => {
21712
21714
  r.value++;
21713
21715
  });
21714
- }), Ln(() => {
21716
+ }), Bn(() => {
21715
21717
  l == null || l();
21716
21718
  });
21717
21719
  function s(c) {
@@ -21831,7 +21833,7 @@ const H3 = Ft({
21831
21833
  c.value = g, a.value = E;
21832
21834
  }
21833
21835
  );
21834
- const d = _n(), u = Me(() => `theme-${s.value}`), h = Me(() => {
21836
+ const d = Tn(), u = Me(() => `theme-${s.value}`), h = Me(() => {
21835
21837
  const g = {};
21836
21838
  return g.width = o.width !== void 0 ? typeof o.width == "number" ? `${o.width}px` : o.width : "100%", g.height = o.height !== void 0 ? typeof o.height == "number" ? `${o.height}px` : o.height : "100%", g;
21837
21839
  });
@@ -21856,8 +21858,8 @@ const H3 = Ft({
21856
21858
  function F() {
21857
21859
  D.value = !!(T != null && T.matches);
21858
21860
  }
21859
- const K = j(null);
21860
- so(ss, D), so(Ml, K);
21861
+ const z = j(null);
21862
+ so(ss, D), so(Ml, z);
21861
21863
  const oe = Me(() => o.toolbarPosition === "top" ? "top" : o.toolbarPosition === "bottom" || D.value ? "bottom" : "top");
21862
21864
  so(yr, Me(() => oe.value === "bottom")), Tt(
21863
21865
  () => o.editable,
@@ -21957,19 +21959,19 @@ const H3 = Ft({
21957
21959
  type: "image",
21958
21960
  attrs: To(Ge)
21959
21961
  });
21960
- const Dn = f.getState().selection;
21961
- Dn.kind === "caret" ? ne = Dn.blockId : Dn.kind === "text" && (ne = Dn.anchor.blockId);
21962
+ const $n = f.getState().selection;
21963
+ $n.kind === "caret" ? ne = $n.blockId : $n.kind === "text" && (ne = $n.anchor.blockId);
21962
21964
  }
21963
21965
  if (!ne) return null;
21964
21966
  if (typeof g == "string") {
21965
21967
  const Ge = g;
21966
21968
  try {
21967
- const ft = await new Promise((Dn) => {
21968
- if (typeof document > "u") return Dn({});
21969
+ const ft = await new Promise(($n) => {
21970
+ if (typeof document > "u") return $n({});
21969
21971
  const ho = document.createElement("img");
21970
21972
  let jo = !1;
21971
21973
  const Po = () => {
21972
- jo || (jo = !0, Dn({
21974
+ jo || (jo = !0, $n({
21973
21975
  width: ho.naturalWidth || void 0,
21974
21976
  height: ho.naturalHeight || void 0
21975
21977
  }));
@@ -22010,17 +22012,17 @@ const H3 = Ft({
22010
22012
  H && E.push({ id: N, block: H });
22011
22013
  }
22012
22014
  return E;
22013
- }), _ = Sn({
22015
+ }), _ = An({
22014
22016
  visible: !1,
22015
22017
  anchorEl: null,
22016
22018
  blockId: "",
22017
22019
  query: "",
22018
22020
  mode: "slash"
22019
- }), O = j(null), M = Sn({
22021
+ }), O = j(null), M = An({
22020
22022
  visible: !1,
22021
22023
  anchorEl: null,
22022
22024
  blockId: null
22023
- }), y = j(null), S = Sn({
22025
+ }), y = j(null), S = An({
22024
22026
  visible: !1,
22025
22027
  selectionRect: null,
22026
22028
  blockId: null,
@@ -22033,24 +22035,24 @@ const H3 = Ft({
22033
22035
  I = !1, V = null, st({ force: !0 });
22034
22036
  }, 500);
22035
22037
  }
22036
- const ae = Sn({
22038
+ const ae = An({
22037
22039
  visible: !1,
22038
22040
  blockId: null,
22039
22041
  anchor: null,
22040
22042
  canContinue: !1,
22041
22043
  canStartNew: !1,
22042
22044
  currentNumber: 1
22043
- }), ye = Sn({
22045
+ }), ye = An({
22044
22046
  visible: !1,
22045
22047
  initialValue: 1,
22046
22048
  anchor: null,
22047
22049
  blockId: null
22048
- }), pe = Sn({
22050
+ }), pe = An({
22049
22051
  visible: !1,
22050
22052
  initialValue: "plain",
22051
22053
  anchor: null,
22052
22054
  blockId: null
22053
- }), ue = Sn({
22055
+ }), ue = An({
22054
22056
  visible: !1,
22055
22057
  anchorRect: null,
22056
22058
  blockId: null,
@@ -22126,7 +22128,7 @@ const H3 = Ft({
22126
22128
  function Ht() {
22127
22129
  var E;
22128
22130
  if (!m.value) return;
22129
- On();
22131
+ Dn();
22130
22132
  const g = f.getState().selection;
22131
22133
  if (g.kind === "caret") {
22132
22134
  const N = Ie(g.blockId, g.offset);
@@ -22211,9 +22213,9 @@ const H3 = Ft({
22211
22213
  Dt = 0, it && P(it);
22212
22214
  })));
22213
22215
  }
22214
- function z() {
22216
+ function K() {
22215
22217
  if (!be) return;
22216
- be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", z, !0), document.removeEventListener("selectstart", Lt, !0), pt();
22218
+ be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", K, !0), document.removeEventListener("selectstart", Lt, !0), pt();
22217
22219
  const g = f.getState().selection;
22218
22220
  g.kind === "text" && on(g) && dn(g);
22219
22221
  }
@@ -22305,8 +22307,8 @@ const H3 = Ft({
22305
22307
  },
22306
22308
  { deep: !0 }
22307
22309
  );
22308
- const Ye = j(null), Hn = j(null), un = () => Hn.value;
22309
- function On() {
22310
+ const Ye = j(null), Un = j(null), un = () => Un.value;
22311
+ function Dn() {
22310
22312
  const g = Ye.value;
22311
22313
  if (!g) return;
22312
22314
  const E = yi(g, f.getState().doc);
@@ -22318,7 +22320,7 @@ const H3 = Ft({
22318
22320
  };
22319
22321
  X = !0, f.dispatch(N), X = !1;
22320
22322
  }
22321
- function Un(g) {
22323
+ function Fn(g) {
22322
22324
  var ne, se, re, ee, we, Ve, We, gt, Qe, ct, je, kt;
22323
22325
  if (_.visible && ((ne = O.value) != null && ne.onKeyDown(g)) || M.visible && ((se = y.value) != null && se.onKeyDown(g))) return;
22324
22326
  if (!m.value) {
@@ -22364,7 +22366,7 @@ const H3 = Ft({
22364
22366
  if (E && E.classList.contains("image-block-caption") || E && E.closest(".table-cell-inner"))
22365
22367
  return;
22366
22368
  const N = f.getState().selection;
22367
- N.kind === "text" && on(N) || On();
22369
+ N.kind === "text" && on(N) || Dn();
22368
22370
  const H = f.getState().selection;
22369
22371
  if (H.kind === "text" && on(H) && !g.isComposing) {
22370
22372
  const Ue = g.key, Kt = Ue.length === 1 && !g.ctrlKey && !g.metaKey && !g.altKey;
@@ -22420,8 +22422,8 @@ const H3 = Ft({
22420
22422
  if (Mt && f.registries.schema.get(Mt.type).isolating) {
22421
22423
  const Ut = Fe(Mt.content), en = Ut.slice(0, Ct), St = Ut.slice(Ct), tn = en.lastIndexOf(`
22422
22424
  `) + 1, Ge = St.indexOf(`
22423
- `), ft = Ge === -1 ? Ut.length : Ct + Ge, nn = tn === 0, Dn = ft === Ut.length;
22424
- if (g.key === "ArrowUp" && !nn || g.key === "ArrowDown" && !Dn)
22425
+ `), ft = Ge === -1 ? Ut.length : Ct + Ge, nn = tn === 0, $n = ft === Ut.length;
22426
+ if (g.key === "ArrowUp" && !nn || g.key === "ArrowDown" && !$n)
22425
22427
  return;
22426
22428
  }
22427
22429
  }
@@ -22434,11 +22436,11 @@ const H3 = Ft({
22434
22436
  const Ue = f.getState().selection;
22435
22437
  if (Ue.kind === "caret" || Ue.kind === "text") {
22436
22438
  const Kt = Ue.kind === "caret" ? Ue.blockId : Ue.focus.blockId, Ct = Ue.kind === "caret" ? Ue.offset : Ue.focus.offset, Mt = f.getState().doc.blocks.get(Kt);
22437
- Mt && f.registries.schema.get(Mt.type).isolating && (g.preventDefault(), Fn(Kt, Ct));
22439
+ Mt && f.registries.schema.get(Mt.type).isolating && (g.preventDefault(), zn(Kt, Ct));
22438
22440
  }
22439
22441
  }
22440
22442
  }
22441
- function Fn(g, E) {
22443
+ function zn(g, E) {
22442
22444
  const N = f.getState().doc.blocks.get(g);
22443
22445
  if (!N) return;
22444
22446
  const [H, J] = pn(N.content, E), ne = [...H, { type: "text", text: `
@@ -22466,23 +22468,23 @@ const H3 = Ft({
22466
22468
  f.dispatch(Ve);
22467
22469
  }
22468
22470
  const Le = j(null), $e = j("after");
22469
- let tt = "idle", mt = 0, Je = 0, $t = 4, Et = null, _t = null, zt = 0, Cn = 0, Gt = null, Tn = null, zn = null, Kn = null;
22470
- function xn() {
22471
- Kn !== null && (clearTimeout(Kn), Kn = null), zn = null;
22471
+ let tt = "idle", mt = 0, Je = 0, $t = 4, Et = null, _t = null, zt = 0, Cn = 0, Gt = null, Mn = null, xn = null, Kn = null;
22472
+ function _n() {
22473
+ Kn !== null && (clearTimeout(Kn), Kn = null), xn = null;
22472
22474
  }
22473
22475
  function po() {
22474
22476
  var g;
22475
- Gt && (Gt.classList.remove("block-being-dragged"), Gt = null), _t && (_t.remove(), _t = null), Tn !== null && ((g = un()) == null || g.setBlockHandleDragging(Tn, !1)), Tn = null, Et = null, tt = "idle", Bt.value = null, Le.value = null, $e.value = "after", xn();
22477
+ Gt && (Gt.classList.remove("block-being-dragged"), Gt = null), _t && (_t.remove(), _t = null), Mn !== null && ((g = un()) == null || g.setBlockHandleDragging(Mn, !1)), Mn = null, Et = null, tt = "idle", Bt.value = null, Le.value = null, $e.value = "after", _n();
22476
22478
  }
22477
22479
  function Wn() {
22478
- document.removeEventListener("mousemove", he, !0), document.removeEventListener("mouseup", Ne, !0), document.removeEventListener("selectstart", B, !0);
22480
+ document.removeEventListener("mousemove", he, !0), document.removeEventListener("mouseup", Ne, !0), document.removeEventListener("selectstart", L, !0);
22479
22481
  }
22480
22482
  function R(g, E, N, H) {
22481
- m.value && (tt !== "idle" && (Wn(), po()), tt = "pending", Et = g, mt = E, Je = N, $t = H.thresholdPx, document.addEventListener("selectstart", B, !0), document.addEventListener("mousemove", he, !0), document.addEventListener("mouseup", Ne, !0));
22483
+ m.value && (tt !== "idle" && (Wn(), po()), tt = "pending", Et = g, mt = E, Je = N, $t = H.thresholdPx, document.addEventListener("selectstart", L, !0), document.addEventListener("mousemove", he, !0), document.addEventListener("mouseup", Ne, !0));
22482
22484
  }
22483
22485
  function b(g) {
22484
22486
  }
22485
- function B(g) {
22487
+ function L(g) {
22486
22488
  g.preventDefault();
22487
22489
  }
22488
22490
  function he(g) {
@@ -22498,7 +22500,7 @@ const H3 = Ft({
22498
22500
  } catch {
22499
22501
  }
22500
22502
  _t && (_t.style.left = `${g.clientX + zt}px`, _t.style.top = `${g.clientY + Cn}px`);
22501
- const E = Tn;
22503
+ const E = Mn;
22502
22504
  if (!E) return;
22503
22505
  const N = Array.from(document.querySelectorAll(".block-host"));
22504
22506
  if (N.length <= 1) {
@@ -22507,26 +22509,26 @@ const H3 = Ft({
22507
22509
  }
22508
22510
  const H = N[0].getBoundingClientRect(), J = N[N.length - 1].getBoundingClientRect();
22509
22511
  if (g.clientY < H.top + H.height / 2) {
22510
- xn(), Le.value = null, $e.value = "first";
22512
+ _n(), Le.value = null, $e.value = "first";
22511
22513
  return;
22512
22514
  }
22513
22515
  if (g.clientY > J.bottom - J.height / 2) {
22514
- xn(), Le.value = null, $e.value = "last";
22516
+ _n(), Le.value = null, $e.value = "last";
22515
22517
  return;
22516
22518
  }
22517
22519
  const ne = document.elementFromPoint(g.clientX, g.clientY);
22518
22520
  if (!ne) {
22519
- xn(), Le.value = null;
22521
+ _n(), Le.value = null;
22520
22522
  return;
22521
22523
  }
22522
22524
  const se = ne.closest(".block-host");
22523
22525
  if (!se) {
22524
- xn(), Le.value = null;
22526
+ _n(), Le.value = null;
22525
22527
  return;
22526
22528
  }
22527
22529
  const re = se.dataset.blockId;
22528
22530
  if (!re || re === E) {
22529
- xn(), Le.value = null;
22531
+ _n(), Le.value = null;
22530
22532
  return;
22531
22533
  }
22532
22534
  const ee = se.getBoundingClientRect(), we = ee.height === 0 ? 0 : (g.clientY - ee.top) / ee.height;
@@ -22548,18 +22550,18 @@ const H3 = Ft({
22548
22550
  if (we > V3 && we < G3 && Ve) {
22549
22551
  Le.value = re;
22550
22552
  const je = we < 0.5;
22551
- zn !== re && (xn(), zn = re, Kn = setTimeout(() => {
22552
- zn === re && (Le.value = re, $e.value = "into");
22553
+ xn !== re && (_n(), xn = re, Kn = setTimeout(() => {
22554
+ xn === re && (Le.value = re, $e.value = "into");
22553
22555
  }, W3)), $e.value !== "into" && ($e.value = je ? "before" : "after");
22554
22556
  } else
22555
- xn(), Le.value = re, $e.value = we < 0.5 ? "before" : "after";
22557
+ _n(), Le.value = re, $e.value = we < 0.5 ? "before" : "after";
22556
22558
  }
22557
22559
  function Ne(g) {
22558
22560
  if (Wn(), tt === "pending") {
22559
22561
  tt = "idle", Et = null;
22560
22562
  return;
22561
22563
  }
22562
- const E = Tn, N = Le.value, H = $e.value;
22564
+ const E = Mn, N = Le.value, H = $e.value;
22563
22565
  po(), E && (H === "into" && !N || !N && H !== "first" && H !== "last" || Pe(E, N, H));
22564
22566
  }
22565
22567
  function Ke() {
@@ -22572,7 +22574,7 @@ const H3 = Ft({
22572
22574
  We && We.removeAllRanges();
22573
22575
  } catch {
22574
22576
  }
22575
- be && (be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", z, !0), document.removeEventListener("selectstart", Lt, !0), He.value = []), Ot(null);
22577
+ be && (be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", K, !0), document.removeEventListener("selectstart", Lt, !0), He.value = []), Ot(null);
22576
22578
  const H = document.querySelector(`.block-host[data-block-id="${g}"]`);
22577
22579
  if (!H) {
22578
22580
  Wn(), tt = "idle", Et = null;
@@ -22589,7 +22591,7 @@ const H3 = Ft({
22589
22591
  const re = document.createElement("div");
22590
22592
  re.className = "drag-ghost";
22591
22593
  const ee = J.firstElementChild;
22592
- ee && re.appendChild(ee.cloneNode(!0)), re.style.width = `${se.width}px`, re.style.left = `${E + zt}px`, re.style.top = `${N + Cn}px`, document.body.appendChild(re), _t = re, Bt.value = g, Tn = g, Le.value = null, $e.value = "after", (Ve = un()) == null || Ve.setBlockHandleDragging(g, !0), tt = "active";
22594
+ ee && re.appendChild(ee.cloneNode(!0)), re.style.width = `${se.width}px`, re.style.left = `${E + zt}px`, re.style.top = `${N + Cn}px`, document.body.appendChild(re), _t = re, Bt.value = g, Mn = g, Le.value = null, $e.value = "after", (Ve = un()) == null || Ve.setBlockHandleDragging(g, !0), tt = "active";
22593
22595
  }
22594
22596
  function Pe(g, E, N) {
22595
22597
  var We, gt, Qe;
@@ -22603,7 +22605,7 @@ const H3 = Ft({
22603
22605
  ct = jt(H, ct);
22604
22606
  }
22605
22607
  }
22606
- const ne = jt(H, g), se = Rn(H, g);
22608
+ const ne = jt(H, g), se = Ln(H, g);
22607
22609
  if (se === -1) return;
22608
22610
  let re = null, ee;
22609
22611
  if (N === "first")
@@ -22622,7 +22624,7 @@ const H3 = Ft({
22622
22624
  }
22623
22625
  re = E, ee = 0;
22624
22626
  } else if ((N === "before" || N === "after") && E) {
22625
- const ct = jt(H, E), je = Rn(H, E);
22627
+ const ct = jt(H, E), je = Ln(H, E);
22626
22628
  if (je === -1) return;
22627
22629
  re = ct, ee = N === "before" ? je : je + 1;
22628
22630
  } else
@@ -22694,7 +22696,7 @@ const H3 = Ft({
22694
22696
  const E = g.relatedTarget, N = Ye.value;
22695
22697
  N && E && N.contains(E) || Ee.value && (Ee.value = !1, Le.value = null, $e.value = "after");
22696
22698
  }
22697
- async function L(g) {
22699
+ async function B(g) {
22698
22700
  if (Bt.value) return;
22699
22701
  const E = g.dataTransfer;
22700
22702
  if (!E) return;
@@ -22937,7 +22939,7 @@ const H3 = Ft({
22937
22939
  re && (H.kind === "text" && on(H) && (X = !0, (ne = (J = f.commands).setSelection) == null || ne.call(J, { selection: yt(re.blockId, re.offset) }), X = !1), be = {
22938
22940
  start: { blockId: re.blockId, offset: re.offset },
22939
22941
  crossBlock: !1
22940
- }, document.addEventListener("mousemove", k, !0), document.addEventListener("mouseup", z, !0));
22942
+ }, document.addEventListener("mousemove", k, !0), document.addEventListener("mouseup", K, !0));
22941
22943
  }
22942
22944
  }
22943
22945
  function Xe() {
@@ -23169,7 +23171,7 @@ const H3 = Ft({
23169
23171
  const E = f.getState().selection;
23170
23172
  Ei(g, E), g.addEventListener("ordered-list-marker-click", Jn), g.addEventListener("code-lang-click", Er), g.addEventListener("click", eo), g.addEventListener("click", nl);
23171
23173
  }), document.addEventListener("selectionchange", st), document.addEventListener("mousedown", qt, !0), document.addEventListener("mouseup", Xe, !0), document.addEventListener("mousedown", Do, !0), document.addEventListener("touchstart", Do, !0), window.addEventListener("scroll", vt, !0), window.addEventListener("resize", vt), window.addEventListener("scroll", $o, !0), document.addEventListener("touchmove", $o, { passive: !0, capture: !0 }), document.addEventListener("keydown", Cr, !0), T == null || T.addEventListener("change", F), document.addEventListener("touchstart", wt, { passive: !1, capture: !0 });
23172
- }), Ln(() => {
23174
+ }), Bn(() => {
23173
23175
  const g = Ye.value;
23174
23176
  g && (g.removeEventListener("ordered-list-marker-click", Jn), g.removeEventListener("code-lang-click", Er), g.removeEventListener("click", eo), g.removeEventListener("click", nl)), document.removeEventListener("selectionchange", st), document.removeEventListener("mousedown", qt, !0), document.removeEventListener("mouseup", Xe, !0), document.removeEventListener("mousedown", Do, !0), document.removeEventListener("touchstart", Do, !0), window.removeEventListener("scroll", vt, !0), window.removeEventListener("resize", vt), window.removeEventListener("scroll", $o, !0), document.removeEventListener("touchmove", $o, !0), document.removeEventListener("keydown", Cr, !0), T == null || T.removeEventListener("change", F), document.removeEventListener("touchstart", wt, !0), document.removeEventListener("touchmove", Pt, !0), document.removeEventListener("touchend", Xt, !0), document.removeEventListener("touchcancel", Xt, !0), vn(), f.destroy(), U(), Nu(), Ru();
23175
23177
  }), t({ editor: f }), (g, E) => (Z(), te("div", {
@@ -23178,12 +23180,12 @@ const H3 = Ft({
23178
23180
  class: ze(["block-editor", [u.value, { "block-editor-dragging": Bt.value !== null, "is-mobile": D.value }]]),
23179
23181
  style: rn(h.value),
23180
23182
  contenteditable: !1,
23181
- onKeydown: Un,
23183
+ onKeydown: Fn,
23182
23184
  onCopy: Qn,
23183
23185
  onCut: Qt,
23184
23186
  onDragover: ie(w, ["prevent"]),
23185
23187
  onDragleave: x,
23186
- onDrop: ie(L, ["prevent"])
23188
+ onDrop: ie(B, ["prevent"])
23187
23189
  }, [
23188
23190
  gn(Tp, {
23189
23191
  "root-el": Ye.value,
@@ -23205,7 +23207,7 @@ const H3 = Ft({
23205
23207
  C("div", z3, [
23206
23208
  gn(td, {
23207
23209
  ref_key: "blockListRef",
23208
- ref: Hn,
23210
+ ref: Un,
23209
23211
  items: W.value,
23210
23212
  "blocks-map": G.value.doc.blocks,
23211
23213
  "first-block-placeholder": p.value,
@@ -23227,7 +23229,7 @@ const H3 = Ft({
23227
23229
  onFocusIn: Vt
23228
23230
  }, null, 8, ["items", "blocks-map", "first-block-placeholder", "hovered-block-id", "focused-block-id", "has-text-selection", "dragging-block-id", "drop-target-block-id", "drop-position", "menu-open-block-id"])
23229
23231
  ]),
23230
- (Z(), mn($n, { to: "body" }, [
23232
+ (Z(), mn(Pn, { to: "body" }, [
23231
23233
  He.value.length > 0 ? (Z(), te("div", K3, [
23232
23234
  (Z(!0), te(rt, null, bn(He.value, (N, H) => (Z(), te("div", {
23233
23235
  key: H,
@@ -23358,7 +23360,7 @@ export {
23358
23360
  ob as focusOffset,
23359
23361
  Wt as getBlock,
23360
23362
  Cc as hasText,
23361
- Rn as indexOf,
23363
+ Ln as indexOf,
23362
23364
  Lo as inlineFromString,
23363
23365
  Fe as inlineText,
23364
23366
  Dc as invertSteps,
@@ -23380,12 +23382,12 @@ export {
23380
23382
  jt as parentOf,
23381
23383
  es as prevSibling,
23382
23384
  Pc as primaryBlock,
23383
- Nn as requireBlock,
23385
+ Rn as requireBlock,
23384
23386
  mr as siblingList,
23385
23387
  pn as splitInline,
23386
23388
  mi as textSelection,
23387
- Pn as useEditor,
23388
- _n as useI18n,
23389
+ Hn as useEditor,
23390
+ Tn as useI18n,
23389
23391
  tb as withAttrs,
23390
23392
  eb as withContent
23391
23393
  };