@jinntec/jinntap 1.4.0 → 1.5.0

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.
@@ -635,7 +635,7 @@ function Wi(r, e, t, n) {
635
635
  let l = Wi(o.content, e - s - 1, t);
636
636
  return l && r.replaceChild(i, o.copy(l));
637
637
  }
638
- function Ao(r, e, t) {
638
+ function vo(r, e, t) {
639
639
  if (t.openStart > r.depth)
640
640
  throw new Ht("Inserted content deeper than insertion position");
641
641
  if (r.depth - t.openStart != e.depth - t.openEnd)
@@ -652,7 +652,7 @@ function Ji(r, e, t, n) {
652
652
  let o = r.parent, l = o.content;
653
653
  return Fe(o, l.cut(0, r.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
654
654
  } else {
655
- let { start: o, end: l } = vo(t, r);
655
+ let { start: o, end: l } = Do(t, r);
656
656
  return Fe(s, Ki(r, o, l, e, n));
657
657
  }
658
658
  else return Fe(s, Wt(r, e, n));
@@ -691,7 +691,7 @@ function Wt(r, e, t) {
691
691
  }
692
692
  return ut(e, null, t, n), new b(n);
693
693
  }
694
- function vo(r, e) {
694
+ function Do(r, e) {
695
695
  let t = e.depth - r.openStart, i = e.node(t).copy(r.content);
696
696
  for (let s = t - 1; s >= 0; s--)
697
697
  i = e.node(s).copy(b.from(i));
@@ -942,17 +942,17 @@ class mt {
942
942
  return o;
943
943
  }
944
944
  else
945
- Nr.set(e, n = new Do());
945
+ Nr.set(e, n = new Io());
946
946
  let i = n.elts[n.i] = mt.resolve(e, t);
947
- return n.i = (n.i + 1) % Io, i;
947
+ return n.i = (n.i + 1) % Po, i;
948
948
  }
949
949
  }
950
- class Do {
950
+ class Io {
951
951
  constructor() {
952
952
  this.elts = [], this.i = 0;
953
953
  }
954
954
  }
955
- const Io = 12, Nr = /* @__PURE__ */ new WeakMap();
955
+ const Po = 12, Nr = /* @__PURE__ */ new WeakMap();
956
956
  class Jt {
957
957
  /**
958
958
  Construct a node range. `$from` and `$to` should point into the
@@ -993,7 +993,7 @@ class Jt {
993
993
  return this.$to.indexAfter(this.depth);
994
994
  }
995
995
  }
996
- const Po = /* @__PURE__ */ Object.create(null);
996
+ const Ro = /* @__PURE__ */ Object.create(null);
997
997
  let Me = class Ln {
998
998
  /**
999
999
  @internal
@@ -1112,7 +1112,7 @@ let Me = class Ln {
1112
1112
  attributes, and marks.
1113
1113
  */
1114
1114
  hasMarkup(e, t, n) {
1115
- return this.type == e && jt(this.attrs, t || e.defaultAttrs || Po) && D.sameSet(this.marks, n || D.none);
1115
+ return this.type == e && jt(this.attrs, t || e.defaultAttrs || Ro) && D.sameSet(this.marks, n || D.none);
1116
1116
  }
1117
1117
  /**
1118
1118
  Create a new node with the same markup as this node, containing
@@ -1155,7 +1155,7 @@ let Me = class Ln {
1155
1155
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
1156
1156
  */
1157
1157
  replace(e, t, n) {
1158
- return Ao(this.resolve(e), this.resolve(t), n);
1158
+ return vo(this.resolve(e), this.resolve(t), n);
1159
1159
  }
1160
1160
  /**
1161
1161
  Find the node directly after the given position.
@@ -1418,13 +1418,13 @@ class je {
1418
1418
  @internal
1419
1419
  */
1420
1420
  static parse(e, t) {
1421
- let n = new Ro(e, t);
1421
+ let n = new Bo(e, t);
1422
1422
  if (n.next == null)
1423
1423
  return je.empty;
1424
1424
  let i = _i(n);
1425
1425
  n.next && n.err("Unexpected trailing text");
1426
- let s = jo(Vo(i));
1427
- return Ho(s, n), s;
1426
+ let s = Ho(jo(i));
1427
+ return Wo(s, n), s;
1428
1428
  }
1429
1429
  /**
1430
1430
  Match a node type, returning a match after that node if
@@ -1570,7 +1570,7 @@ class je {
1570
1570
  }
1571
1571
  }
1572
1572
  je.empty = new je(!0);
1573
- class Ro {
1573
+ class Bo {
1574
1574
  constructor(e, t) {
1575
1575
  this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
1576
1576
  }
@@ -1587,19 +1587,19 @@ class Ro {
1587
1587
  function _i(r) {
1588
1588
  let e = [];
1589
1589
  do
1590
- e.push(Bo(r));
1590
+ e.push(zo(r));
1591
1591
  while (r.eat("|"));
1592
1592
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
1593
1593
  }
1594
- function Bo(r) {
1594
+ function zo(r) {
1595
1595
  let e = [];
1596
1596
  do
1597
- e.push(zo(r));
1597
+ e.push(Fo(r));
1598
1598
  while (r.next && r.next != ")" && r.next != "|");
1599
1599
  return e.length == 1 ? e[0] : { type: "seq", exprs: e };
1600
1600
  }
1601
- function zo(r) {
1602
- let e = $o(r);
1601
+ function Fo(r) {
1602
+ let e = Vo(r);
1603
1603
  for (; ; )
1604
1604
  if (r.eat("+"))
1605
1605
  e = { type: "plus", expr: e };
@@ -1608,7 +1608,7 @@ function zo(r) {
1608
1608
  else if (r.eat("?"))
1609
1609
  e = { type: "opt", expr: e };
1610
1610
  else if (r.eat("{"))
1611
- e = Fo(r, e);
1611
+ e = Lo(r, e);
1612
1612
  else
1613
1613
  break;
1614
1614
  return e;
@@ -1618,11 +1618,11 @@ function Ar(r) {
1618
1618
  let e = Number(r.next);
1619
1619
  return r.pos++, e;
1620
1620
  }
1621
- function Fo(r, e) {
1621
+ function Lo(r, e) {
1622
1622
  let t = Ar(r), n = t;
1623
1623
  return r.eat(",") && (r.next != "}" ? n = Ar(r) : n = -1), r.eat("}") || r.err("Unclosed braced range"), { type: "range", min: t, max: n, expr: e };
1624
1624
  }
1625
- function Lo(r, e) {
1625
+ function $o(r, e) {
1626
1626
  let t = r.nodeTypes, n = t[e];
1627
1627
  if (n)
1628
1628
  return [n];
@@ -1633,18 +1633,18 @@ function Lo(r, e) {
1633
1633
  }
1634
1634
  return i.length == 0 && r.err("No node type or group '" + e + "' found"), i;
1635
1635
  }
1636
- function $o(r) {
1636
+ function Vo(r) {
1637
1637
  if (r.eat("(")) {
1638
1638
  let e = _i(r);
1639
1639
  return r.eat(")") || r.err("Missing closing paren"), e;
1640
1640
  } else if (/\W/.test(r.next))
1641
1641
  r.err("Unexpected token '" + r.next + "'");
1642
1642
  else {
1643
- let e = Lo(r, r.next).map((t) => (r.inline == null ? r.inline = t.isInline : r.inline != t.isInline && r.err("Mixing inline and block content"), { type: "name", value: t }));
1643
+ let e = $o(r, r.next).map((t) => (r.inline == null ? r.inline = t.isInline : r.inline != t.isInline && r.err("Mixing inline and block content"), { type: "name", value: t }));
1644
1644
  return r.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
1645
1645
  }
1646
1646
  }
1647
- function Vo(r) {
1647
+ function jo(r) {
1648
1648
  let e = [[]];
1649
1649
  return i(s(r, 0), t()), e;
1650
1650
  function t() {
@@ -1715,7 +1715,7 @@ function vr(r, e) {
1715
1715
  }
1716
1716
  }
1717
1717
  }
1718
- function jo(r) {
1718
+ function Ho(r) {
1719
1719
  let e = /* @__PURE__ */ Object.create(null);
1720
1720
  return t(vr(r, 0));
1721
1721
  function t(n) {
@@ -1740,7 +1740,7 @@ function jo(r) {
1740
1740
  return s;
1741
1741
  }
1742
1742
  }
1743
- function Ho(r, e) {
1743
+ function Wo(r, e) {
1744
1744
  for (let t = 0, n = [r]; t < n.length; t++) {
1745
1745
  let i = n[t], s = !i.validEnd, o = [];
1746
1746
  for (let l = 0; l < i.next.length; l++) {
@@ -1788,7 +1788,7 @@ function Qi(r, e) {
1788
1788
  let t = /* @__PURE__ */ Object.create(null);
1789
1789
  if (e)
1790
1790
  for (let n in e)
1791
- t[n] = new Jo(r, n, e[n]);
1791
+ t[n] = new qo(r, n, e[n]);
1792
1792
  return t;
1793
1793
  }
1794
1794
  let Dr = class es {
@@ -1970,7 +1970,7 @@ let Dr = class es {
1970
1970
  return n;
1971
1971
  }
1972
1972
  };
1973
- function Wo(r, e, t) {
1973
+ function Jo(r, e, t) {
1974
1974
  let n = t.split("|");
1975
1975
  return (i) => {
1976
1976
  let s = i === null ? "null" : typeof i;
@@ -1978,9 +1978,9 @@ function Wo(r, e, t) {
1978
1978
  throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`);
1979
1979
  };
1980
1980
  }
1981
- class Jo {
1981
+ class qo {
1982
1982
  constructor(e, t, n) {
1983
- this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ? Wo(e, t, n.validate) : n.validate;
1983
+ this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ? Jo(e, t, n.validate) : n.validate;
1984
1984
  }
1985
1985
  get isRequired() {
1986
1986
  return !this.hasDefault;
@@ -2140,10 +2140,10 @@ function Ir(r, e) {
2140
2140
  }
2141
2141
  return t;
2142
2142
  }
2143
- function qo(r) {
2143
+ function Ko(r) {
2144
2144
  return r.tag != null;
2145
2145
  }
2146
- function Ko(r) {
2146
+ function Uo(r) {
2147
2147
  return r.style != null;
2148
2148
  }
2149
2149
  let dt = class $n {
@@ -2155,9 +2155,9 @@ let dt = class $n {
2155
2155
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
2156
2156
  let n = this.matchedStyles = [];
2157
2157
  t.forEach((i) => {
2158
- if (qo(i))
2158
+ if (Ko(i))
2159
2159
  this.tags.push(i);
2160
- else if (Ko(i)) {
2160
+ else if (Uo(i)) {
2161
2161
  let s = /[^=]*/.exec(i.style)[0];
2162
2162
  n.indexOf(s) < 0 && n.push(s), this.styles.push(i);
2163
2163
  }
@@ -2193,7 +2193,7 @@ let dt = class $n {
2193
2193
  matchTag(e, t, n) {
2194
2194
  for (let i = n ? this.tags.indexOf(n) + 1 : 0; i < this.tags.length; i++) {
2195
2195
  let s = this.tags[i];
2196
- if (Go(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2196
+ if (Yo(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2197
2197
  if (s.getAttrs) {
2198
2198
  let o = s.getAttrs(e);
2199
2199
  if (o === !1)
@@ -2294,7 +2294,7 @@ const ns = {
2294
2294
  table: !0,
2295
2295
  tfoot: !0,
2296
2296
  ul: !0
2297
- }, Uo = {
2297
+ }, _o = {
2298
2298
  head: !0,
2299
2299
  noscript: !0,
2300
2300
  object: !0,
@@ -2373,9 +2373,9 @@ class Rr {
2373
2373
  let i = this.localPreserveWS, s = this.top;
2374
2374
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
2375
2375
  let o = e.nodeName.toLowerCase(), l;
2376
- rs.hasOwnProperty(o) && this.parser.normalizeLists && _o(e);
2376
+ rs.hasOwnProperty(o) && this.parser.normalizeLists && Go(e);
2377
2377
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, n));
2378
- e: if (a ? a.ignore : Uo.hasOwnProperty(o))
2378
+ e: if (a ? a.ignore : _o.hasOwnProperty(o))
2379
2379
  this.findInside(e), this.ignoreFallback(e, t);
2380
2380
  else if (!a || a.skip || a.closeParent) {
2381
2381
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -2607,13 +2607,13 @@ class Rr {
2607
2607
  }
2608
2608
  }
2609
2609
  }
2610
- function _o(r) {
2610
+ function Go(r) {
2611
2611
  for (let e = r.firstChild, t = null; e; e = e.nextSibling) {
2612
2612
  let n = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
2613
2613
  n && rs.hasOwnProperty(n) && t ? (t.appendChild(e), e = t) : n == "li" ? t = e : n && (t = null);
2614
2614
  }
2615
2615
  }
2616
- function Go(r, e) {
2616
+ function Yo(r, e) {
2617
2617
  return (r.matches || r.msMatchesSelector || r.webkitMatchesSelector || r.mozMatchesSelector).call(r, e);
2618
2618
  }
2619
2619
  function Br(r) {
@@ -2756,11 +2756,11 @@ function yn(r) {
2756
2756
  return r.document || window.document;
2757
2757
  }
2758
2758
  const Lr = /* @__PURE__ */ new WeakMap();
2759
- function Yo(r) {
2759
+ function Xo(r) {
2760
2760
  let e = Lr.get(r);
2761
- return e === void 0 && Lr.set(r, e = Xo(r)), e;
2761
+ return e === void 0 && Lr.set(r, e = Zo(r)), e;
2762
2762
  }
2763
- function Xo(r) {
2763
+ function Zo(r) {
2764
2764
  let e = null;
2765
2765
  function t(n) {
2766
2766
  if (n && typeof n == "object")
@@ -2786,7 +2786,7 @@ function zt(r, e, t, n) {
2786
2786
  let i = e[0], s;
2787
2787
  if (typeof i != "string")
2788
2788
  throw new RangeError("Invalid array passed to renderSpec");
2789
- if (n && (s = Yo(n)) && s.indexOf(e) > -1)
2789
+ if (n && (s = Xo(n)) && s.indexOf(e) > -1)
2790
2790
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
2791
2791
  let o = i.indexOf(" ");
2792
2792
  o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
@@ -2817,13 +2817,13 @@ function zt(r, e, t, n) {
2817
2817
  return { dom: a, contentDOM: l };
2818
2818
  }
2819
2819
  const is = 65535, ss = Math.pow(2, 16);
2820
- function Zo(r, e) {
2820
+ function Qo(r, e) {
2821
2821
  return r + e * ss;
2822
2822
  }
2823
2823
  function $r(r) {
2824
2824
  return r & is;
2825
2825
  }
2826
- function Qo(r) {
2826
+ function el(r) {
2827
2827
  return (r - (r & is)) / ss;
2828
2828
  }
2829
2829
  const ls = 1, as = 2, Ft = 4, cs = 8;
@@ -2881,7 +2881,7 @@ class X {
2881
2881
  if (!this.inverted)
2882
2882
  for (let i = 0; i < n; i++)
2883
2883
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
2884
- return this.ranges[n * 3] + t + Qo(e);
2884
+ return this.ranges[n * 3] + t + el(e);
2885
2885
  }
2886
2886
  mapResult(e, t = 1) {
2887
2887
  return this._map(e, t, !1);
@@ -2903,7 +2903,7 @@ class X {
2903
2903
  let f = c ? e == a ? -1 : e == d ? 1 : t : t, h = a + i + (f < 0 ? 0 : u);
2904
2904
  if (n)
2905
2905
  return h;
2906
- let p = e == (t < 0 ? a : d) ? null : Zo(l / 3, e - a), m = e == a ? as : e == d ? ls : Ft;
2906
+ let p = e == (t < 0 ? a : d) ? null : Qo(l / 3, e - a), m = e == a ? as : e == d ? ls : Ft;
2907
2907
  return (t < 0 ? e != a : e != d) && (m |= cs), new jn(h, m, p);
2908
2908
  }
2909
2909
  i += u - c;
@@ -3432,7 +3432,7 @@ function Hn(r, e, t) {
3432
3432
  }
3433
3433
  return !1;
3434
3434
  }
3435
- function el(r, e, t, n) {
3435
+ function tl(r, e, t, n) {
3436
3436
  let i = [], s = [], o, l;
3437
3437
  r.doc.nodesBetween(e, t, (a, c, u) => {
3438
3438
  if (!a.isInline)
@@ -3446,7 +3446,7 @@ function el(r, e, t, n) {
3446
3446
  }
3447
3447
  }), i.forEach((a) => r.step(a)), s.forEach((a) => r.step(a));
3448
3448
  }
3449
- function tl(r, e, t, n) {
3449
+ function nl(r, e, t, n) {
3450
3450
  let i = [], s = 0;
3451
3451
  r.doc.nodesBetween(e, t, (o, l) => {
3452
3452
  if (!o.isInline)
@@ -3496,7 +3496,7 @@ function or(r, e, t, n = t.contentMatch, i = !0) {
3496
3496
  for (let a = o.length - 1; a >= 0; a--)
3497
3497
  r.step(o[a]);
3498
3498
  }
3499
- function nl(r, e, t) {
3499
+ function rl(r, e, t) {
3500
3500
  return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));
3501
3501
  }
3502
3502
  function st(r) {
@@ -3505,12 +3505,12 @@ function st(r) {
3505
3505
  let i = r.$from.node(n), s = r.$from.index(n), o = r.$to.indexAfter(n);
3506
3506
  if (n < r.depth && i.canReplace(s, o, t))
3507
3507
  return n;
3508
- if (n == 0 || i.type.spec.isolating || !nl(i, s, o))
3508
+ if (n == 0 || i.type.spec.isolating || !rl(i, s, o))
3509
3509
  break;
3510
3510
  }
3511
3511
  return null;
3512
3512
  }
3513
- function rl(r, e, t) {
3513
+ function il(r, e, t) {
3514
3514
  let { $from: n, $to: i, depth: s } = e, o = n.before(s + 1), l = i.after(s + 1), a = o, c = l, u = b.empty, d = 0;
3515
3515
  for (let p = s, m = !1; p > t; p--)
3516
3516
  m || n.index(p) > 0 ? (m = !0, u = b.from(n.node(p).copy(u)), d++) : a--;
@@ -3520,20 +3520,20 @@ function rl(r, e, t) {
3520
3520
  r.step(new z(a, c, o, l, new k(u.append(f), d, h), u.size - d, !0));
3521
3521
  }
3522
3522
  function us(r, e, t = null, n = r) {
3523
- let i = il(r, e), s = i && sl(n, e);
3523
+ let i = sl(r, e), s = i && ol(n, e);
3524
3524
  return s ? i.map(Vr).concat({ type: e, attrs: t }).concat(s.map(Vr)) : null;
3525
3525
  }
3526
3526
  function Vr(r) {
3527
3527
  return { type: r, attrs: null };
3528
3528
  }
3529
- function il(r, e) {
3529
+ function sl(r, e) {
3530
3530
  let { parent: t, startIndex: n, endIndex: i } = r, s = t.contentMatchAt(n).findWrapping(e);
3531
3531
  if (!s)
3532
3532
  return null;
3533
3533
  let o = s.length ? s[0] : e;
3534
3534
  return t.canReplaceWith(n, i, o) ? s : null;
3535
3535
  }
3536
- function sl(r, e) {
3536
+ function ol(r, e) {
3537
3537
  let { parent: t, startIndex: n, endIndex: i } = r, s = t.child(n), o = e.contentMatch.findWrapping(s.type);
3538
3538
  if (!o)
3539
3539
  return null;
@@ -3542,7 +3542,7 @@ function sl(r, e) {
3542
3542
  a = a.matchType(t.child(c).type);
3543
3543
  return !a || !a.validEnd ? null : o;
3544
3544
  }
3545
- function ol(r, e, t) {
3545
+ function ll(r, e, t) {
3546
3546
  let n = b.empty;
3547
3547
  for (let o = t.length - 1; o >= 0; o--) {
3548
3548
  if (n.size) {
@@ -3555,13 +3555,13 @@ function ol(r, e, t) {
3555
3555
  let i = e.start, s = e.end;
3556
3556
  r.step(new z(i, s, i, s, new k(n, 0, 0), t.length, !0));
3557
3557
  }
3558
- function ll(r, e, t, n, i) {
3558
+ function al(r, e, t, n, i) {
3559
3559
  if (!n.isTextblock)
3560
3560
  throw new RangeError("Type given to setBlockType should be a textblock");
3561
3561
  let s = r.steps.length;
3562
3562
  r.doc.nodesBetween(e, t, (o, l) => {
3563
3563
  let a = typeof i == "function" ? i(o) : i;
3564
- if (o.isTextblock && !o.hasMarkup(n, a) && al(r.doc, r.mapping.slice(s).map(l), n)) {
3564
+ if (o.isTextblock && !o.hasMarkup(n, a) && cl(r.doc, r.mapping.slice(s).map(l), n)) {
3565
3565
  let c = null;
3566
3566
  if (n.schema.linebreakReplacement) {
3567
3567
  let h = n.whitespace == "pre", p = !!n.contentMatch.matchType(n.schema.linebreakReplacement);
@@ -3593,11 +3593,11 @@ function fs(r, e, t, n) {
3593
3593
  }
3594
3594
  });
3595
3595
  }
3596
- function al(r, e, t) {
3596
+ function cl(r, e, t) {
3597
3597
  let n = r.resolve(e), i = n.index();
3598
3598
  return n.parent.canReplaceWith(i, i + 1, t);
3599
3599
  }
3600
- function cl(r, e, t, n, i) {
3600
+ function ul(r, e, t, n, i) {
3601
3601
  let s = r.doc.nodeAt(e);
3602
3602
  if (!s)
3603
3603
  throw new RangeError("No node at given position");
@@ -3626,7 +3626,7 @@ function me(r, e, t = 1, n) {
3626
3626
  let l = i.indexAfter(s), a = n && n[0];
3627
3627
  return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
3628
3628
  }
3629
- function ul(r, e, t = 1, n) {
3629
+ function dl(r, e, t = 1, n) {
3630
3630
  let i = r.doc.resolve(e), s = b.empty, o = b.empty;
3631
3631
  for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
3632
3632
  s = b.from(i.node(l).copy(s));
@@ -3639,7 +3639,7 @@ function qe(r, e) {
3639
3639
  let t = r.resolve(e), n = t.index();
3640
3640
  return hs(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
3641
3641
  }
3642
- function dl(r, e) {
3642
+ function fl(r, e) {
3643
3643
  e.content.size || r.type.compatibleContent(e.type);
3644
3644
  let t = r.contentMatchAt(r.childCount), { linebreakReplacement: n } = r.type.schema;
3645
3645
  for (let i = 0; i < e.childCount; i++) {
@@ -3650,7 +3650,7 @@ function dl(r, e) {
3650
3650
  return t.validEnd;
3651
3651
  }
3652
3652
  function hs(r, e) {
3653
- return !!(r && e && !r.isLeaf && dl(r, e));
3653
+ return !!(r && e && !r.isLeaf && fl(r, e));
3654
3654
  }
3655
3655
  function nn(r, e, t = -1) {
3656
3656
  let n = r.resolve(e);
@@ -3663,7 +3663,7 @@ function nn(r, e, t = -1) {
3663
3663
  e = t < 0 ? n.before(i) : n.after(i);
3664
3664
  }
3665
3665
  }
3666
- function fl(r, e, t) {
3666
+ function hl(r, e, t) {
3667
3667
  let n = null, { linebreakReplacement: i } = r.doc.type.schema, s = r.doc.resolve(e - t), o = s.node().type;
3668
3668
  if (i && o.inlineContent) {
3669
3669
  let u = o.whitespace == "pre", d = !!o.contentMatch.matchType(i);
@@ -3682,7 +3682,7 @@ function fl(r, e, t) {
3682
3682
  }
3683
3683
  return r;
3684
3684
  }
3685
- function hl(r, e, t) {
3685
+ function pl(r, e, t) {
3686
3686
  let n = r.resolve(e);
3687
3687
  if (n.parent.canReplaceWith(n.index(), n.index(), t))
3688
3688
  return e;
@@ -3704,7 +3704,7 @@ function hl(r, e, t) {
3704
3704
  }
3705
3705
  return null;
3706
3706
  }
3707
- function pl(r, e, t) {
3707
+ function ml(r, e, t) {
3708
3708
  let n = r.resolve(e);
3709
3709
  if (!t.content.size)
3710
3710
  return e;
@@ -3729,12 +3729,12 @@ function rn(r, e, t = e, n = k.empty) {
3729
3729
  if (e == t && !n.size)
3730
3730
  return null;
3731
3731
  let i = r.resolve(e), s = r.resolve(t);
3732
- return ps(i, s, n) ? new P(e, t, n) : new ml(i, s, n).fit();
3732
+ return ps(i, s, n) ? new P(e, t, n) : new gl(i, s, n).fit();
3733
3733
  }
3734
3734
  function ps(r, e, t) {
3735
3735
  return !t.openStart && !t.openEnd && r.start() == e.start() && r.parent.canReplace(r.index(), e.index(), t.content);
3736
3736
  }
3737
- class ml {
3737
+ class gl {
3738
3738
  constructor(e, t, n) {
3739
3739
  this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed = b.empty;
3740
3740
  for (let i = 0; i <= e.depth; i++) {
@@ -3903,18 +3903,18 @@ function xn(r, e, t, n, i) {
3903
3903
  if (o == s.childCount && !t.compatibleContent(s.type))
3904
3904
  return null;
3905
3905
  let l = n.fillBefore(s.content, !0, o);
3906
- return l && !gl(t, s.content, o) ? l : null;
3906
+ return l && !yl(t, s.content, o) ? l : null;
3907
3907
  }
3908
- function gl(r, e, t) {
3908
+ function yl(r, e, t) {
3909
3909
  for (let n = t; n < e.childCount; n++)
3910
3910
  if (!r.allowsMarks(e.child(n).marks))
3911
3911
  return !0;
3912
3912
  return !1;
3913
3913
  }
3914
- function yl(r) {
3914
+ function bl(r) {
3915
3915
  return r.spec.defining || r.spec.definingForContent;
3916
3916
  }
3917
- function bl(r, e, t, n) {
3917
+ function kl(r, e, t, n) {
3918
3918
  if (!n.size)
3919
3919
  return r.deleteRange(e, t);
3920
3920
  let i = r.doc.resolve(e), s = r.doc.resolve(t);
@@ -3938,7 +3938,7 @@ function bl(r, e, t, n) {
3938
3938
  f = p.content;
3939
3939
  }
3940
3940
  for (let f = u - 1; f >= 0; f--) {
3941
- let h = c[f], p = yl(h.type);
3941
+ let h = c[f], p = bl(h.type);
3942
3942
  if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
3943
3943
  u = f;
3944
3944
  else if (p || !h.type.isTextblock)
@@ -3972,14 +3972,14 @@ function gs(r, e, t, n, i) {
3972
3972
  }
3973
3973
  return r;
3974
3974
  }
3975
- function kl(r, e, t, n) {
3975
+ function xl(r, e, t, n) {
3976
3976
  if (!n.isInline && e == t && r.doc.resolve(e).parent.content.size) {
3977
- let i = hl(r.doc, e, n.type);
3977
+ let i = pl(r.doc, e, n.type);
3978
3978
  i != null && (e = t = i);
3979
3979
  }
3980
3980
  r.replaceRange(e, t, new k(b.from(n), 0, 0));
3981
3981
  }
3982
- function xl(r, e, t) {
3982
+ function Sl(r, e, t) {
3983
3983
  let n = r.doc.resolve(e), i = r.doc.resolve(t), s = ys(n, i);
3984
3984
  for (let o = 0; o < s.length; o++) {
3985
3985
  let l = s[o], a = o == s.length - 1;
@@ -4084,7 +4084,7 @@ tt = function r(e) {
4084
4084
  tt.prototype = Object.create(Error.prototype);
4085
4085
  tt.prototype.constructor = tt;
4086
4086
  tt.prototype.name = "TransformError";
4087
- class Sl {
4087
+ class Cl {
4088
4088
  /**
4089
4089
  Create a transform that starts with the given document.
4090
4090
  */
@@ -4175,7 +4175,7 @@ class Sl {
4175
4175
  control over what happens.
4176
4176
  */
4177
4177
  replaceRange(e, t, n) {
4178
- return bl(this, e, t, n), this;
4178
+ return kl(this, e, t, n), this;
4179
4179
  }
4180
4180
  /**
4181
4181
  Replace the given range with a node, but use `from` and `to` as
@@ -4187,14 +4187,14 @@ class Sl {
4187
4187
  that parent node.
4188
4188
  */
4189
4189
  replaceRangeWith(e, t, n) {
4190
- return kl(this, e, t, n), this;
4190
+ return xl(this, e, t, n), this;
4191
4191
  }
4192
4192
  /**
4193
4193
  Delete the given range, expanding it to cover fully covered
4194
4194
  parent nodes until a valid replace is found.
4195
4195
  */
4196
4196
  deleteRange(e, t) {
4197
- return xl(this, e, t), this;
4197
+ return Sl(this, e, t), this;
4198
4198
  }
4199
4199
  /**
4200
4200
  Split the content in the given range off from its parent, if there
@@ -4204,14 +4204,14 @@ class Sl {
4204
4204
  sure the lift is valid.
4205
4205
  */
4206
4206
  lift(e, t) {
4207
- return rl(this, e, t), this;
4207
+ return il(this, e, t), this;
4208
4208
  }
4209
4209
  /**
4210
4210
  Join the blocks around the given position. If depth is 2, their
4211
4211
  last and first siblings are also joined, and so on.
4212
4212
  */
4213
4213
  join(e, t = 1) {
4214
- return fl(this, e, t), this;
4214
+ return hl(this, e, t), this;
4215
4215
  }
4216
4216
  /**
4217
4217
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
@@ -4219,21 +4219,21 @@ class Sl {
4219
4219
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
4220
4220
  */
4221
4221
  wrap(e, t) {
4222
- return ol(this, e, t), this;
4222
+ return ll(this, e, t), this;
4223
4223
  }
4224
4224
  /**
4225
4225
  Set the type of all textblocks (partly) between `from` and `to` to
4226
4226
  the given node type with the given attributes.
4227
4227
  */
4228
4228
  setBlockType(e, t = e, n, i = null) {
4229
- return ll(this, e, t, n, i), this;
4229
+ return al(this, e, t, n, i), this;
4230
4230
  }
4231
4231
  /**
4232
4232
  Change the type, attributes, and/or marks of the node at `pos`.
4233
4233
  When `type` isn't given, the existing node type is preserved,
4234
4234
  */
4235
4235
  setNodeMarkup(e, t, n = null, i) {
4236
- return cl(this, e, t, n, i), this;
4236
+ return ul(this, e, t, n, i), this;
4237
4237
  }
4238
4238
  /**
4239
4239
  Set a single attribute on a given node to a new value.
@@ -4277,13 +4277,13 @@ class Sl {
4277
4277
  use after the split (with the outermost nodes coming first).
4278
4278
  */
4279
4279
  split(e, t = 1, n) {
4280
- return ul(this, e, t, n), this;
4280
+ return dl(this, e, t, n), this;
4281
4281
  }
4282
4282
  /**
4283
4283
  Add the given mark to the inline content between `from` and `to`.
4284
4284
  */
4285
4285
  addMark(e, t, n) {
4286
- return el(this, e, t, n), this;
4286
+ return tl(this, e, t, n), this;
4287
4287
  }
4288
4288
  /**
4289
4289
  Remove marks from inline nodes between `from` and `to`. When
@@ -4292,7 +4292,7 @@ class Sl {
4292
4292
  remove all marks of any type.
4293
4293
  */
4294
4294
  removeMark(e, t, n) {
4295
- return tl(this, e, t, n), this;
4295
+ return nl(this, e, t, n), this;
4296
4296
  }
4297
4297
  /**
4298
4298
  Removes all marks and nodes from the content of the node at
@@ -4312,7 +4312,7 @@ class O {
4312
4312
  `$head`.
4313
4313
  */
4314
4314
  constructor(e, t, n) {
4315
- this.$anchor = e, this.$head = t, this.ranges = n || [new Cl(e.min(t), e.max(t))];
4315
+ this.$anchor = e, this.$head = t, this.ranges = n || [new wl(e.min(t), e.max(t))];
4316
4316
  }
4317
4317
  /**
4318
4318
  The selection's anchor, as an unresolved position.
@@ -4470,7 +4470,7 @@ class O {
4470
4470
  }
4471
4471
  }
4472
4472
  O.prototype.visible = !0;
4473
- class Cl {
4473
+ class wl {
4474
4474
  /**
4475
4475
  Create a range.
4476
4476
  */
@@ -4658,11 +4658,11 @@ class Z extends O {
4658
4658
  return e instanceof Z;
4659
4659
  }
4660
4660
  getBookmark() {
4661
- return wl;
4661
+ return Ml;
4662
4662
  }
4663
4663
  }
4664
4664
  O.jsonID("all", Z);
4665
- const wl = {
4665
+ const Ml = {
4666
4666
  map() {
4667
4667
  return this;
4668
4668
  },
@@ -4700,7 +4700,7 @@ function Wr(r, e, t) {
4700
4700
  }), r.setSelection(O.near(r.doc.resolve(o), t));
4701
4701
  }
4702
4702
  const Jr = 1, qr = 2, Kr = 4;
4703
- class Ml extends Sl {
4703
+ class El extends Cl {
4704
4704
  /**
4705
4705
  @internal
4706
4706
  */
@@ -4859,7 +4859,7 @@ class ct {
4859
4859
  this.name = e, this.init = Ur(t.init, n), this.apply = Ur(t.apply, n);
4860
4860
  }
4861
4861
  }
4862
- const El = [
4862
+ const Tl = [
4863
4863
  new ct("doc", {
4864
4864
  init(r) {
4865
4865
  return r.doc || r.schema.topNodeType.createAndFill();
@@ -4895,7 +4895,7 @@ const El = [
4895
4895
  ];
4896
4896
  class Cn {
4897
4897
  constructor(e, t) {
4898
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = El.slice(), t && t.forEach((n) => {
4898
+ this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Tl.slice(), t && t.forEach((n) => {
4899
4899
  if (this.pluginsByKey[n.key])
4900
4900
  throw new RangeError("Adding different instances of a keyed plugin (" + n.key + ")");
4901
4901
  this.plugins.push(n), this.pluginsByKey[n.key] = n, n.spec.state && this.fields.push(new ct(n.key, n.spec.state, n));
@@ -4988,7 +4988,7 @@ class Ye {
4988
4988
  Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
4989
4989
  */
4990
4990
  get tr() {
4991
- return new Ml(this);
4991
+ return new El(this);
4992
4992
  }
4993
4993
  /**
4994
4994
  Create a new state.
@@ -5125,18 +5125,18 @@ let Wn = null;
5125
5125
  const he = function(r, e, t) {
5126
5126
  let n = Wn || (Wn = document.createRange());
5127
5127
  return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
5128
- }, Tl = function() {
5128
+ }, Ol = function() {
5129
5129
  Wn = null;
5130
5130
  }, He = function(r, e, t, n) {
5131
5131
  return t && (_r(r, e, t, n, -1) || _r(r, e, t, n, 1));
5132
- }, Ol = /^(img|br|input|textarea|hr)$/i;
5132
+ }, Nl = /^(img|br|input|textarea|hr)$/i;
5133
5133
  function _r(r, e, t, n, i) {
5134
5134
  for (; ; ) {
5135
5135
  if (r == t && e == n)
5136
5136
  return !0;
5137
5137
  if (e == (i < 0 ? 0 : ne(r))) {
5138
5138
  let s = r.parentNode;
5139
- if (!s || s.nodeType != 1 || Et(r) || Ol.test(r.nodeName) || r.contentEditable == "false")
5139
+ if (!s || s.nodeType != 1 || Et(r) || Nl.test(r.nodeName) || r.contentEditable == "false")
5140
5140
  return !1;
5141
5141
  e = V(r) + (i < 0 ? 0 : 1), r = s;
5142
5142
  } else if (r.nodeType == 1) {
@@ -5150,7 +5150,7 @@ function _r(r, e, t, n, i) {
5150
5150
  function ne(r) {
5151
5151
  return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;
5152
5152
  }
5153
- function Nl(r, e) {
5153
+ function Al(r, e) {
5154
5154
  for (; ; ) {
5155
5155
  if (r.nodeType == 3 && e)
5156
5156
  return r;
@@ -5164,7 +5164,7 @@ function Nl(r, e) {
5164
5164
  return null;
5165
5165
  }
5166
5166
  }
5167
- function Al(r, e) {
5167
+ function vl(r, e) {
5168
5168
  for (; ; ) {
5169
5169
  if (r.nodeType == 3 && e < r.nodeValue.length)
5170
5170
  return r;
@@ -5178,7 +5178,7 @@ function Al(r, e) {
5178
5178
  return null;
5179
5179
  }
5180
5180
  }
5181
- function vl(r, e, t) {
5181
+ function Dl(r, e, t) {
5182
5182
  for (let n = e == 0, i = e == ne(r); n || i; ) {
5183
5183
  if (r == t)
5184
5184
  return !0;
@@ -5201,13 +5201,13 @@ function De(r, e) {
5201
5201
  let t = document.createEvent("Event");
5202
5202
  return t.initEvent("keydown", !0, !0), t.keyCode = r, t.key = t.code = e, t;
5203
5203
  }
5204
- function Dl(r) {
5204
+ function Il(r) {
5205
5205
  let e = r.activeElement;
5206
5206
  for (; e && e.shadowRoot; )
5207
5207
  e = e.shadowRoot.activeElement;
5208
5208
  return e;
5209
5209
  }
5210
- function Il(r, e, t) {
5210
+ function Pl(r, e, t) {
5211
5211
  if (r.caretPositionFromPoint)
5212
5212
  try {
5213
5213
  let n = r.caretPositionFromPoint(e, t);
@@ -5221,10 +5221,10 @@ function Il(r, e, t) {
5221
5221
  return { node: n.startContainer, offset: Math.min(ne(n.startContainer), n.startOffset) };
5222
5222
  }
5223
5223
  }
5224
- const ue = typeof navigator < "u" ? navigator : null, Gr = typeof document < "u" ? document : null, Ae = ue && ue.userAgent || "", Jn = /Edge\/(\d+)/.exec(Ae), xs = /MSIE \d/.exec(Ae), qn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ae), G = !!(xs || qn || Jn), Ee = xs ? document.documentMode : qn ? +qn[1] : Jn ? +Jn[1] : 0, oe = !G && /gecko\/(\d+)/i.test(Ae);
5224
+ const ue = typeof navigator < "u" ? navigator : null, Gr = typeof document < "u" ? document : null, Ae = ue && ue.userAgent || "", Jn = /Edge\/(\d+)/.exec(Ae), xs = /MSIE \d/.exec(Ae), qn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ae), Y = !!(xs || qn || Jn), Ee = xs ? document.documentMode : qn ? +qn[1] : Jn ? +Jn[1] : 0, oe = !Y && /gecko\/(\d+)/i.test(Ae);
5225
5225
  oe && +(/Firefox\/(\d+)/.exec(Ae) || [0, 0])[1];
5226
- const Kn = !G && /Chrome\/(\d+)/.exec(Ae), J = !!Kn, Ss = Kn ? +Kn[1] : 0, K = !G && !!ue && /Apple Computer/.test(ue.vendor), rt = K && (/Mobile\/\w+/.test(Ae) || !!ue && ue.maxTouchPoints > 2), te = rt || (ue ? /Mac/.test(ue.platform) : !1), Pl = ue ? /Win/.test(ue.platform) : !1, pe = /Android \d/.test(Ae), Tt = !!Gr && "webkitFontSmoothing" in Gr.documentElement.style, Rl = Tt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5227
- function Bl(r) {
5226
+ const Kn = !Y && /Chrome\/(\d+)/.exec(Ae), J = !!Kn, Ss = Kn ? +Kn[1] : 0, K = !Y && !!ue && /Apple Computer/.test(ue.vendor), rt = K && (/Mobile\/\w+/.test(Ae) || !!ue && ue.maxTouchPoints > 2), te = rt || (ue ? /Mac/.test(ue.platform) : !1), Rl = ue ? /Win/.test(ue.platform) : !1, pe = /Android \d/.test(Ae), Tt = !!Gr && "webkitFontSmoothing" in Gr.documentElement.style, Bl = Tt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5227
+ function zl(r) {
5228
5228
  let e = r.defaultView && r.defaultView.visualViewport;
5229
5229
  return e ? {
5230
5230
  left: 0,
@@ -5241,7 +5241,7 @@ function Bl(r) {
5241
5241
  function fe(r, e) {
5242
5242
  return typeof r == "number" ? r : r[e];
5243
5243
  }
5244
- function zl(r) {
5244
+ function Fl(r) {
5245
5245
  let e = r.getBoundingClientRect(), t = e.width / r.offsetWidth || 1, n = e.height / r.offsetHeight || 1;
5246
5246
  return {
5247
5247
  left: e.left,
@@ -5257,7 +5257,7 @@ function Yr(r, e, t) {
5257
5257
  o = nt(o);
5258
5258
  continue;
5259
5259
  }
5260
- let l = o, a = l == s.body, c = a ? Bl(s) : zl(l), u = 0, d = 0;
5260
+ let l = o, a = l == s.body, c = a ? zl(s) : Fl(l), u = 0, d = 0;
5261
5261
  if (e.top < c.top + fe(n, "top") ? d = -(c.top - e.top + fe(i, "top")) : e.bottom > c.bottom - fe(n, "bottom") && (d = e.bottom - e.top > c.bottom - c.top ? e.top + fe(i, "top") - c.top : e.bottom - c.bottom + fe(i, "bottom")), e.left < c.left + fe(n, "left") ? u = -(c.left - e.left + fe(i, "left")) : e.right > c.right - fe(n, "right") && (u = e.right - c.right + fe(i, "right")), u || d)
5262
5262
  if (a)
5263
5263
  s.defaultView.scrollBy(u, d);
@@ -5273,7 +5273,7 @@ function Yr(r, e, t) {
5273
5273
  o = f == "absolute" ? o.offsetParent : nt(o);
5274
5274
  }
5275
5275
  }
5276
- function Fl(r) {
5276
+ function Ll(r) {
5277
5277
  let e = r.dom.getBoundingClientRect(), t = Math.max(0, e.top), n, i;
5278
5278
  for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
5279
5279
  let l = r.root.elementFromPoint(s, o);
@@ -5293,7 +5293,7 @@ function Cs(r) {
5293
5293
  ;
5294
5294
  return e;
5295
5295
  }
5296
- function Ll({ refDOM: r, refTop: e, stack: t }) {
5296
+ function $l({ refDOM: r, refTop: e, stack: t }) {
5297
5297
  let n = r ? r.getBoundingClientRect().top : 0;
5298
5298
  ws(t, n == 0 ? 0 : n - e);
5299
5299
  }
@@ -5304,7 +5304,7 @@ function ws(r, e) {
5304
5304
  }
5305
5305
  }
5306
5306
  let Ke = null;
5307
- function $l(r) {
5307
+ function Vl(r) {
5308
5308
  if (r.setActive)
5309
5309
  return r.setActive();
5310
5310
  if (Ke)
@@ -5342,9 +5342,9 @@ function Ms(r, e) {
5342
5342
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = d + 1);
5343
5343
  }
5344
5344
  }
5345
- return !t && a && (t = a, i = c, n = 0), t && t.nodeType == 3 ? Vl(t, i) : !t || n && t.nodeType == 1 ? { node: r, offset: s } : Ms(t, i);
5345
+ return !t && a && (t = a, i = c, n = 0), t && t.nodeType == 3 ? jl(t, i) : !t || n && t.nodeType == 1 ? { node: r, offset: s } : Ms(t, i);
5346
5346
  }
5347
- function Vl(r, e) {
5347
+ function jl(r, e) {
5348
5348
  let t = r.nodeValue.length, n = document.createRange();
5349
5349
  for (let i = 0; i < t; i++) {
5350
5350
  n.setEnd(r, i + 1), n.setStart(r, i);
@@ -5357,11 +5357,11 @@ function Vl(r, e) {
5357
5357
  function ar(r, e) {
5358
5358
  return r.left >= e.left - 1 && r.left <= e.right + 1 && r.top >= e.top - 1 && r.top <= e.bottom + 1;
5359
5359
  }
5360
- function jl(r, e) {
5360
+ function Hl(r, e) {
5361
5361
  let t = r.parentNode;
5362
5362
  return t && /^li$/i.test(t.nodeName) && e.left < r.getBoundingClientRect().left ? t : r;
5363
5363
  }
5364
- function Hl(r, e, t) {
5364
+ function Wl(r, e, t) {
5365
5365
  let { node: n, offset: i } = Ms(e, t), s = -1;
5366
5366
  if (n.nodeType == 1 && !n.firstChild) {
5367
5367
  let o = n.getBoundingClientRect();
@@ -5369,7 +5369,7 @@ function Hl(r, e, t) {
5369
5369
  }
5370
5370
  return r.docView.posFromDOM(n, i, s);
5371
5371
  }
5372
- function Wl(r, e, t, n) {
5372
+ function Jl(r, e, t, n) {
5373
5373
  let i = -1;
5374
5374
  for (let s = e, o = !1; s != r.dom; ) {
5375
5375
  let l = r.docView.nearestDesc(s, !0), a;
@@ -5400,8 +5400,8 @@ function Es(r, e, t) {
5400
5400
  }
5401
5401
  return r;
5402
5402
  }
5403
- function Jl(r, e) {
5404
- let t = r.dom.ownerDocument, n, i = 0, s = Il(t, e.left, e.top);
5403
+ function ql(r, e) {
5404
+ let t = r.dom.ownerDocument, n, i = 0, s = Pl(t, e.left, e.top);
5405
5405
  s && ({ node: n, offset: i } = s);
5406
5406
  let o = (r.root.elementFromPoint ? r.root : t).elementFromPoint(e.left, e.top), l;
5407
5407
  if (!o || !r.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
@@ -5412,15 +5412,15 @@ function Jl(r, e) {
5412
5412
  if (K)
5413
5413
  for (let c = o; n && c; c = nt(c))
5414
5414
  c.draggable && (n = void 0);
5415
- if (o = jl(o, e), n) {
5415
+ if (o = Hl(o, e), n) {
5416
5416
  if (oe && n.nodeType == 1 && (i = Math.min(i, n.childNodes.length), i < n.childNodes.length)) {
5417
5417
  let u = n.childNodes[i], d;
5418
5418
  u.nodeName == "IMG" && (d = u.getBoundingClientRect()).right <= e.left && d.bottom > e.top && i++;
5419
5419
  }
5420
5420
  let c;
5421
- Tt && i && n.nodeType == 1 && (c = n.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, n == r.dom && i == n.childNodes.length - 1 && n.lastChild.nodeType == 1 && e.top > n.lastChild.getBoundingClientRect().bottom ? l = r.state.doc.content.size : (i == 0 || n.nodeType != 1 || n.childNodes[i - 1].nodeName != "BR") && (l = Wl(r, n, i, e));
5421
+ Tt && i && n.nodeType == 1 && (c = n.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, n == r.dom && i == n.childNodes.length - 1 && n.lastChild.nodeType == 1 && e.top > n.lastChild.getBoundingClientRect().bottom ? l = r.state.doc.content.size : (i == 0 || n.nodeType != 1 || n.childNodes[i - 1].nodeName != "BR") && (l = Jl(r, n, i, e));
5422
5422
  }
5423
- l == null && (l = Hl(r, o, e));
5423
+ l == null && (l = Wl(r, o, e));
5424
5424
  let a = r.docView.nearestDesc(o, !0);
5425
5425
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
5426
5426
  }
@@ -5436,11 +5436,11 @@ function ye(r, e) {
5436
5436
  }
5437
5437
  return Array.prototype.find.call(t, Xr) || r.getBoundingClientRect();
5438
5438
  }
5439
- const ql = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5439
+ const Kl = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5440
5440
  function Ts(r, e, t) {
5441
5441
  let { node: n, offset: i, atom: s } = r.docView.domFromPos(e, t < 0 ? -1 : 1), o = Tt || oe;
5442
5442
  if (n.nodeType == 3)
5443
- if (o && (ql.test(n.nodeValue) || (t < 0 ? !i : i == n.nodeValue.length))) {
5443
+ if (o && (Kl.test(n.nodeValue) || (t < 0 ? !i : i == n.nodeValue.length))) {
5444
5444
  let a = ye(he(n, i, i), t);
5445
5445
  if (oe && i && /\s/.test(n.nodeValue[i - 1]) && i < n.nodeValue.length) {
5446
5446
  let c = ye(he(n, i - 1, i - 1), -1);
@@ -5504,7 +5504,7 @@ function Os(r, e, t) {
5504
5504
  n != e && r.updateState(n), i != r.dom && i && i.focus();
5505
5505
  }
5506
5506
  }
5507
- function Kl(r, e, t) {
5507
+ function Ul(r, e, t) {
5508
5508
  let n = e.selection, i = t == "up" ? n.$from : n.$to;
5509
5509
  return Os(r, e, () => {
5510
5510
  let { node: s } = r.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
@@ -5536,13 +5536,13 @@ function Kl(r, e, t) {
5536
5536
  return !0;
5537
5537
  });
5538
5538
  }
5539
- const Ul = /[\u0590-\u08ac]/;
5540
- function _l(r, e, t) {
5539
+ const _l = /[\u0590-\u08ac]/;
5540
+ function Gl(r, e, t) {
5541
5541
  let { $head: n } = e.selection;
5542
5542
  if (!n.parent.isTextblock)
5543
5543
  return !1;
5544
5544
  let i = n.parentOffset, s = !i, o = i == n.parent.content.size, l = r.domSelection();
5545
- return l ? !Ul.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Os(r, e, () => {
5545
+ return l ? !_l.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Os(r, e, () => {
5546
5546
  let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: d } = r.domSelectionRange(), f = l.caretBidiLevel;
5547
5547
  l.modify("move", t, "character");
5548
5548
  let h = n.depth ? r.docView.domAfterPos(n.before()) : r.dom, { focusNode: p, focusOffset: m } = r.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -5554,8 +5554,8 @@ function _l(r, e, t) {
5554
5554
  }) : n.pos == n.start() || n.pos == n.end();
5555
5555
  }
5556
5556
  let Zr = null, Qr = null, ei = !1;
5557
- function Gl(r, e, t) {
5558
- return Zr == e && Qr == t ? ei : (Zr = e, Qr = t, ei = t == "up" || t == "down" ? Kl(r, e, t) : _l(r, e, t));
5557
+ function Yl(r, e, t) {
5558
+ return Zr == e && Qr == t ? ei : (Zr = e, Qr = t, ei = t == "up" || t == "down" ? Ul(r, e, t) : Gl(r, e, t));
5559
5559
  }
5560
5560
  const ie = 0, ti = 1, Pe = 2, de = 3;
5561
5561
  class Ot {
@@ -5939,7 +5939,7 @@ class Ns extends Ot {
5939
5939
  return this.widget.type.side;
5940
5940
  }
5941
5941
  }
5942
- class Yl extends Ot {
5942
+ class Xl extends Ot {
5943
5943
  constructor(e, t, n, i) {
5944
5944
  super(e, [], t, null), this.textDOM = n, this.text = i;
5945
5945
  }
@@ -6020,7 +6020,7 @@ class Te extends Ot {
6020
6020
  } else u || ({ dom: u, contentDOM: d } = Je.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6021
6021
  !d && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
6022
6022
  let f = u;
6023
- return u = Is(u, n, t), c ? a = new Xl(e, t, n, i, u, d || null, f, c, s, o + 1) : t.isText ? new ln(e, t, n, i, u, f, s) : new Te(e, t, n, i, u, d || null, f, s, o + 1);
6023
+ return u = Is(u, n, t), c ? a = new Zl(e, t, n, i, u, d || null, f, c, s, o + 1) : t.isText ? new ln(e, t, n, i, u, f, s) : new Te(e, t, n, i, u, d || null, f, s, o + 1);
6024
6024
  }
6025
6025
  parseRule() {
6026
6026
  if (this.node.type.spec.reparseInView)
@@ -6056,14 +6056,14 @@ class Te extends Ot {
6056
6056
  // separate step, syncs the DOM inside `this.contentDOM` to
6057
6057
  // `this.children`.
6058
6058
  updateChildren(e, t) {
6059
- let n = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Ql(this, o && o.node, e);
6060
- na(this.node, this.innerDeco, (c, u, d) => {
6059
+ let n = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new ea(this, o && o.node, e);
6060
+ ra(this.node, this.innerDeco, (c, u, d) => {
6061
6061
  c.spec.marks ? a.syncToMarks(c.spec.marks, n, e) : c.type.side >= 0 && !d && a.syncToMarks(u == this.node.childCount ? D.none : this.node.child(u).marks, n, e), a.placeWidget(c, e, i);
6062
6062
  }, (c, u, d, f) => {
6063
6063
  a.syncToMarks(c.marks, n, e);
6064
6064
  let h;
6065
6065
  a.findNodeMatch(c, u, d, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, u, d, h, e) || a.updateNextNode(c, u, d, e, f, i) || a.addNode(c, u, d, e, i), i += c.nodeSize;
6066
- }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Pe) && (o && this.protectLocalComposition(e, o), vs(this.contentDOM, this.children, e), rt && ra(this.dom));
6066
+ }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Pe) && (o && this.protectLocalComposition(e, o), vs(this.contentDOM, this.children, e), rt && ia(this.dom));
6067
6067
  }
6068
6068
  localCompositionInfo(e, t) {
6069
6069
  let { from: n, to: i } = e.state.selection;
@@ -6073,7 +6073,7 @@ class Te extends Ot {
6073
6073
  if (!s || !this.dom.contains(s.parentNode))
6074
6074
  return null;
6075
6075
  if (this.node.inlineContent) {
6076
- let o = s.nodeValue, l = ia(this.node.content, o, n - t, i - t);
6076
+ let o = s.nodeValue, l = sa(this.node.content, o, n - t, i - t);
6077
6077
  return l < 0 ? null : { node: s, pos: l, text: o };
6078
6078
  } else
6079
6079
  return { node: s, pos: -1, text: "" };
@@ -6089,7 +6089,7 @@ class Te extends Ot {
6089
6089
  s.parentNode.removeChild(s.nextSibling);
6090
6090
  s.pmViewDesc && (s.pmViewDesc = void 0);
6091
6091
  }
6092
- let o = new Yl(this, s, t, i);
6092
+ let o = new Xl(this, s, t, i);
6093
6093
  e.input.compositionNodes.push(o), this.children = _n(this.children, n, n + i.length, e, o);
6094
6094
  }
6095
6095
  // If this desc must be updated to match the given node decoration,
@@ -6180,7 +6180,7 @@ class As extends Ot {
6180
6180
  return this.dom.nodeName == "IMG";
6181
6181
  }
6182
6182
  }
6183
- class Xl extends Te {
6183
+ class Zl extends Te {
6184
6184
  constructor(e, t, n, i, s, o, l, a, c, u) {
6185
6185
  super(e, t, n, i, s, o, l, c, u), this.spec = a;
6186
6186
  }
@@ -6264,11 +6264,11 @@ function Ds(r, e, t, n) {
6264
6264
  let a;
6265
6265
  l && l.nodeName == o.nodeName && i != r && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Re[0]), i = a;
6266
6266
  }
6267
- Zl(i, l || Re[0], o);
6267
+ Ql(i, l || Re[0], o);
6268
6268
  }
6269
6269
  return i;
6270
6270
  }
6271
- function Zl(r, e, t) {
6271
+ function Ql(r, e, t) {
6272
6272
  for (let n in e)
6273
6273
  n != "class" && n != "style" && n != "nodeName" && !(n in t) && r.removeAttribute(n);
6274
6274
  for (let n in t)
@@ -6305,9 +6305,9 @@ function ri(r) {
6305
6305
  let e = r.nextSibling;
6306
6306
  return r.parentNode.removeChild(r), e;
6307
6307
  }
6308
- class Ql {
6308
+ class ea {
6309
6309
  constructor(e, t, n) {
6310
- this.lock = t, this.view = n, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = ea(e.node.content, e);
6310
+ this.lock = t, this.view = n, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = ta(e.node.content, e);
6311
6311
  }
6312
6312
  // Destroy and remove the children between the given indices in
6313
6313
  // `this.top`.
@@ -6455,7 +6455,7 @@ class Ql {
6455
6455
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
6456
6456
  }
6457
6457
  }
6458
- function ea(r, e) {
6458
+ function ta(r, e) {
6459
6459
  let t = e, n = t.children.length, i = r.childCount, s = /* @__PURE__ */ new Map(), o = [];
6460
6460
  e: for (; i > 0; ) {
6461
6461
  let l;
@@ -6482,10 +6482,10 @@ function ea(r, e) {
6482
6482
  }
6483
6483
  return { index: i, matched: s, matches: o.reverse() };
6484
6484
  }
6485
- function ta(r, e) {
6485
+ function na(r, e) {
6486
6486
  return r.type.side - e.type.side;
6487
6487
  }
6488
- function na(r, e, t, n) {
6488
+ function ra(r, e, t, n) {
6489
6489
  let i = e.locals(r), s = 0;
6490
6490
  if (i.length == 0) {
6491
6491
  for (let c = 0; c < r.childCount; c++) {
@@ -6503,7 +6503,7 @@ function na(r, e, t, n) {
6503
6503
  }
6504
6504
  if (u)
6505
6505
  if (d) {
6506
- d.sort(ta);
6506
+ d.sort(na);
6507
6507
  for (let g = 0; g < d.length; g++)
6508
6508
  t(d[g], c, !!a);
6509
6509
  } else
@@ -6533,13 +6533,13 @@ function na(r, e, t, n) {
6533
6533
  n(f, m, e.forChild(s, f), h), s = p;
6534
6534
  }
6535
6535
  }
6536
- function ra(r) {
6536
+ function ia(r) {
6537
6537
  if (r.nodeName == "UL" || r.nodeName == "OL") {
6538
6538
  let e = r.style.cssText;
6539
6539
  r.style.cssText = e + "; list-style: square !important", window.getComputedStyle(r).listStyle, r.style.cssText = e;
6540
6540
  }
6541
6541
  }
6542
- function ia(r, e, t, n) {
6542
+ function sa(r, e, t, n) {
6543
6543
  for (let i = 0, s = 0; i < r.childCount && s <= n; ) {
6544
6544
  let o = r.child(i++), l = s;
6545
6545
  if (s += o.nodeSize, !o.isText)
@@ -6583,7 +6583,7 @@ function cr(r, e = null) {
6583
6583
  for (a = o; i && !i.node; )
6584
6584
  i = i.parent;
6585
6585
  let d = i.node;
6586
- if (i && d.isAtom && C.isSelectable(d) && i.parent && !(d.isInline && vl(t.focusNode, t.focusOffset, i.dom))) {
6586
+ if (i && d.isAtom && C.isSelectable(d) && i.parent && !(d.isInline && Dl(t.focusNode, t.focusOffset, i.dom))) {
6587
6587
  let f = i.posBefore;
6588
6588
  c = new C(o == f ? l : n.resolve(f));
6589
6589
  }
@@ -6623,10 +6623,10 @@ function ge(r, e = !1) {
6623
6623
  }
6624
6624
  }
6625
6625
  if (r.domObserver.disconnectSelection(), r.cursorWrapper)
6626
- oa(r);
6626
+ la(r);
6627
6627
  else {
6628
6628
  let { anchor: n, head: i } = t, s, o;
6629
- ii && !(t instanceof T) && (t.$from.parent.inlineContent || (s = si(r, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = si(r, t.to))), r.docView.setSelection(n, i, r, e), ii && (s && oi(s), o && oi(o)), t.visible ? r.dom.classList.remove("ProseMirror-hideselection") : (r.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && sa(r));
6629
+ ii && !(t instanceof T) && (t.$from.parent.inlineContent || (s = si(r, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = si(r, t.to))), r.docView.setSelection(n, i, r, e), ii && (s && oi(s), o && oi(o)), t.visible ? r.dom.classList.remove("ProseMirror-hideselection") : (r.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && oa(r));
6630
6630
  }
6631
6631
  r.domObserver.setCurSelection(), r.domObserver.connectSelection();
6632
6632
  }
@@ -6649,7 +6649,7 @@ function En(r) {
6649
6649
  function oi(r) {
6650
6650
  r.contentEditable = "false", r.wasDraggable && (r.draggable = !0, r.wasDraggable = null);
6651
6651
  }
6652
- function sa(r) {
6652
+ function oa(r) {
6653
6653
  let e = r.dom.ownerDocument;
6654
6654
  e.removeEventListener("selectionchange", r.input.hideSelectionGuard);
6655
6655
  let t = r.domSelectionRange(), n = t.anchorNode, i = t.anchorOffset;
@@ -6659,12 +6659,12 @@ function sa(r) {
6659
6659
  }, 20));
6660
6660
  });
6661
6661
  }
6662
- function oa(r) {
6662
+ function la(r) {
6663
6663
  let e = r.domSelection(), t = document.createRange();
6664
6664
  if (!e)
6665
6665
  return;
6666
6666
  let n = r.cursorWrapper.dom, i = n.nodeName == "IMG";
6667
- i ? t.setStart(n.parentNode, V(n) + 1) : t.setStart(n, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !r.state.selection.visible && G && Ee <= 11 && (n.disabled = !0, n.disabled = !1);
6667
+ i ? t.setStart(n.parentNode, V(n) + 1) : t.setStart(n, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !r.state.selection.visible && Y && Ee <= 11 && (n.disabled = !0, n.disabled = !1);
6668
6668
  }
6669
6669
  function Rs(r, e) {
6670
6670
  if (e instanceof C) {
@@ -6692,7 +6692,7 @@ function Bs(r) {
6692
6692
  return !1;
6693
6693
  }
6694
6694
  }
6695
- function la(r) {
6695
+ function aa(r) {
6696
6696
  let e = r.docView.domFromPos(r.state.selection.anchor, 0), t = r.domSelectionRange();
6697
6697
  return He(e.node, e.offset, t.anchorNode, t.anchorOffset);
6698
6698
  }
@@ -6741,9 +6741,9 @@ function ht(r, e) {
6741
6741
  return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != "BR");
6742
6742
  }
6743
6743
  function Ue(r, e) {
6744
- return e < 0 ? aa(r) : ca(r);
6744
+ return e < 0 ? ca(r) : ua(r);
6745
6745
  }
6746
- function aa(r) {
6746
+ function ca(r) {
6747
6747
  let e = r.domSelectionRange(), t = e.focusNode, n = e.focusOffset;
6748
6748
  if (!t)
6749
6749
  return;
@@ -6779,7 +6779,7 @@ function aa(r) {
6779
6779
  }
6780
6780
  o ? Yn(r, t, n) : i && Yn(r, i, s);
6781
6781
  }
6782
- function ca(r) {
6782
+ function ua(r) {
6783
6783
  let e = r.domSelectionRange(), t = e.focusNode, n = e.focusOffset;
6784
6784
  if (!t)
6785
6785
  return;
@@ -6815,7 +6815,7 @@ function zs(r) {
6815
6815
  let e = r.pmViewDesc;
6816
6816
  return e && e.node && e.node.isBlock;
6817
6817
  }
6818
- function ua(r, e) {
6818
+ function da(r, e) {
6819
6819
  for (; r && e == r.childNodes.length && !Et(r); )
6820
6820
  e = V(r) + 1, r = r.parentNode;
6821
6821
  for (; r && e < r.childNodes.length; ) {
@@ -6827,7 +6827,7 @@ function ua(r, e) {
6827
6827
  r = t, e = 0;
6828
6828
  }
6829
6829
  }
6830
- function da(r, e) {
6830
+ function fa(r, e) {
6831
6831
  for (; r && !e && !Et(r); )
6832
6832
  e = V(r), r = r.parentNode;
6833
6833
  for (; r && e; ) {
@@ -6842,7 +6842,7 @@ function da(r, e) {
6842
6842
  function Yn(r, e, t) {
6843
6843
  if (e.nodeType != 3) {
6844
6844
  let s, o;
6845
- (o = ua(e, t)) ? (e = o, t = 0) : (s = da(e, t)) && (e = s, t = s.nodeValue.length);
6845
+ (o = da(e, t)) ? (e = o, t = 0) : (s = fa(e, t)) && (e = s, t = s.nodeValue.length);
6846
6846
  }
6847
6847
  let n = r.domSelection();
6848
6848
  if (!n)
@@ -6859,7 +6859,7 @@ function Yn(r, e, t) {
6859
6859
  }
6860
6860
  function ui(r, e) {
6861
6861
  let t = r.state.doc.resolve(e);
6862
- if (!(J || Pl) && t.parent.inlineContent) {
6862
+ if (!(J || Rl) && t.parent.inlineContent) {
6863
6863
  let i = r.coordsAtPos(e);
6864
6864
  if (e > t.start()) {
6865
6865
  let s = r.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
@@ -6910,7 +6910,7 @@ function fi(r, e) {
6910
6910
  function hi(r, e, t) {
6911
6911
  r.domObserver.stop(), e.contentEditable = t, r.domObserver.start();
6912
6912
  }
6913
- function fa(r) {
6913
+ function ha(r) {
6914
6914
  if (!K || r.state.selection.$head.parentOffset > 0)
6915
6915
  return !1;
6916
6916
  let { focusNode: e, focusOffset: t } = r.domSelectionRange();
@@ -6920,12 +6920,12 @@ function fa(r) {
6920
6920
  }
6921
6921
  return !1;
6922
6922
  }
6923
- function ha(r) {
6923
+ function pa(r) {
6924
6924
  let e = "";
6925
6925
  return r.ctrlKey && (e += "c"), r.metaKey && (e += "m"), r.altKey && (e += "a"), r.shiftKey && (e += "s"), e;
6926
6926
  }
6927
- function pa(r, e) {
6928
- let t = e.keyCode, n = ha(e);
6927
+ function ma(r, e) {
6928
+ let t = e.keyCode, n = pa(e);
6929
6929
  if (t == 8 || te && t == 72 && n == "c")
6930
6930
  return fi(r, -1) || Ue(r, -1);
6931
6931
  if (t == 46 && !e.shiftKey || te && t == 68 && n == "c")
@@ -6942,7 +6942,7 @@ function pa(r, e) {
6942
6942
  if (t == 38 || te && t == 80 && n == "c")
6943
6943
  return di(r, -1, n) || Ue(r, -1);
6944
6944
  if (t == 40 || te && t == 78 && n == "c")
6945
- return fa(r) || di(r, 1, n) || Ue(r, 1);
6945
+ return ha(r) || di(r, 1, n) || Ue(r, 1);
6946
6946
  if (n == (te ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
6947
6947
  return !0;
6948
6948
  }
@@ -7000,7 +7000,7 @@ function Fs(r, e, t, n, i) {
7000
7000
  } else
7001
7001
  r.someProp("transformPastedHTML", (d) => {
7002
7002
  t = d(t, r);
7003
- }), o = ba(t), Tt && ka(o);
7003
+ }), o = ka(t), Tt && xa(o);
7004
7004
  let c = o && o.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7005
7005
  if (u && u[3])
7006
7006
  for (let d = +u[3]; d > 0; d--) {
@@ -7015,11 +7015,11 @@ function Fs(r, e, t, n, i) {
7015
7015
  preserveWhitespace: !!(a || u),
7016
7016
  context: i,
7017
7017
  ruleFromNode(f) {
7018
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !ma.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7018
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !ga.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7019
7019
  }
7020
7020
  })), u)
7021
- l = xa(pi(l, +u[1], +u[2]), u[4]);
7022
- else if (l = k.maxOpen(ga(l.content, i), !0), l.openStart || l.openEnd) {
7021
+ l = Sa(pi(l, +u[1], +u[2]), u[4]);
7022
+ else if (l = k.maxOpen(ya(l.content, i), !0), l.openStart || l.openEnd) {
7023
7023
  let d = 0, f = 0;
7024
7024
  for (let h = l.content.firstChild; d < l.openStart && !h.type.spec.isolating; d++, h = h.firstChild)
7025
7025
  ;
@@ -7031,8 +7031,8 @@ function Fs(r, e, t, n, i) {
7031
7031
  l = d(l, r);
7032
7032
  }), l;
7033
7033
  }
7034
- const ma = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7035
- function ga(r, e) {
7034
+ const ga = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7035
+ function ya(r, e) {
7036
7036
  if (r.childCount < 2)
7037
7037
  return r;
7038
7038
  for (let t = e.depth; t >= 0; t--) {
@@ -7098,27 +7098,27 @@ function Hs() {
7098
7098
  return mi || (mi = document.implementation.createHTMLDocument("title"));
7099
7099
  }
7100
7100
  let Tn = null;
7101
- function ya(r) {
7101
+ function ba(r) {
7102
7102
  let e = window.trustedTypes;
7103
7103
  return e ? (Tn || (Tn = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Tn.createHTML(r)) : r;
7104
7104
  }
7105
- function ba(r) {
7105
+ function ka(r) {
7106
7106
  let e = /^(\s*<meta [^>]*>)*/.exec(r);
7107
7107
  e && (r = r.slice(e[0].length));
7108
7108
  let t = Hs().createElement("div"), n = /<([a-z][^>\s]+)/i.exec(r), i;
7109
- if ((i = n && js[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = ya(r), i)
7109
+ if ((i = n && js[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = ba(r), i)
7110
7110
  for (let s = 0; s < i.length; s++)
7111
7111
  t = t.querySelector(i[s]) || t;
7112
7112
  return t;
7113
7113
  }
7114
- function ka(r) {
7114
+ function xa(r) {
7115
7115
  let e = r.querySelectorAll(J ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7116
7116
  for (let t = 0; t < e.length; t++) {
7117
7117
  let n = e[t];
7118
7118
  n.childNodes.length == 1 && n.textContent == " " && n.parentNode && n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "), n);
7119
7119
  }
7120
7120
  }
7121
- function xa(r, e) {
7121
+ function Sa(r, e) {
7122
7122
  if (!r.size)
7123
7123
  return r;
7124
7124
  let t = r.content.firstChild.type.schema, n;
@@ -7136,25 +7136,25 @@ function xa(r, e) {
7136
7136
  }
7137
7137
  return new k(i, s, o);
7138
7138
  }
7139
- const U = {}, _ = {}, Sa = { touchstart: !0, touchmove: !0 };
7140
- class Ca {
7139
+ const U = {}, _ = {}, Ca = { touchstart: !0, touchmove: !0 };
7140
+ class wa {
7141
7141
  constructor() {
7142
7142
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7143
7143
  }
7144
7144
  }
7145
- function wa(r) {
7145
+ function Ma(r) {
7146
7146
  for (let e in U) {
7147
7147
  let t = U[e];
7148
7148
  r.dom.addEventListener(e, r.input.eventHandlers[e] = (n) => {
7149
- Ea(r, n) && !fr(r, n) && (r.editable || !(n.type in _)) && t(r, n);
7150
- }, Sa[e] ? { passive: !0 } : void 0);
7149
+ Ta(r, n) && !fr(r, n) && (r.editable || !(n.type in _)) && t(r, n);
7150
+ }, Ca[e] ? { passive: !0 } : void 0);
7151
7151
  }
7152
7152
  K && r.dom.addEventListener("input", () => null), Zn(r);
7153
7153
  }
7154
7154
  function we(r, e) {
7155
7155
  r.input.lastSelectionOrigin = e, r.input.lastSelectionTime = Date.now();
7156
7156
  }
7157
- function Ma(r) {
7157
+ function Ea(r) {
7158
7158
  r.domObserver.stop();
7159
7159
  for (let e in r.input.eventHandlers)
7160
7160
  r.dom.removeEventListener(e, r.input.eventHandlers[e]);
@@ -7172,7 +7172,7 @@ function fr(r, e) {
7172
7172
  return n ? n(r, e) || e.defaultPrevented : !1;
7173
7173
  });
7174
7174
  }
7175
- function Ea(r, e) {
7175
+ function Ta(r, e) {
7176
7176
  if (!e.bubbles)
7177
7177
  return !0;
7178
7178
  if (e.defaultPrevented)
@@ -7182,7 +7182,7 @@ function Ea(r, e) {
7182
7182
  return !1;
7183
7183
  return !0;
7184
7184
  }
7185
- function Ta(r, e) {
7185
+ function Oa(r, e) {
7186
7186
  !fr(r, e) && U[e.type] && (r.editable || !(e.type in _)) && U[e.type](r, e);
7187
7187
  }
7188
7188
  _.keydown = (r, e) => {
@@ -7193,7 +7193,7 @@ _.keydown = (r, e) => {
7193
7193
  r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7194
7194
  r.input.lastIOSEnter == n && (r.someProp("handleKeyDown", (i) => i(r, De(13, "Enter"))), r.input.lastIOSEnter = 0);
7195
7195
  }, 200);
7196
- } else r.someProp("handleKeyDown", (n) => n(r, t)) || pa(r, t) ? t.preventDefault() : we(r, "key");
7196
+ } else r.someProp("handleKeyDown", (n) => n(r, t)) || ma(r, t) ? t.preventDefault() : we(r, "key");
7197
7197
  };
7198
7198
  _.keyup = (r, e) => {
7199
7199
  e.keyCode == 16 && (r.input.shiftKey = !1);
@@ -7215,7 +7215,7 @@ _.keypress = (r, e) => {
7215
7215
  function an(r) {
7216
7216
  return { left: r.clientX, top: r.clientY };
7217
7217
  }
7218
- function Oa(r, e) {
7218
+ function Na(r, e) {
7219
7219
  let t = e.x - r.clientX, n = e.y - r.clientY;
7220
7220
  return t * t + n * n < 100;
7221
7221
  }
@@ -7234,13 +7234,13 @@ function Qe(r, e, t) {
7234
7234
  let n = r.state.tr.setSelection(e);
7235
7235
  n.setMeta("pointer", !0), r.dispatch(n);
7236
7236
  }
7237
- function Na(r, e) {
7237
+ function Aa(r, e) {
7238
7238
  if (e == -1)
7239
7239
  return !1;
7240
7240
  let t = r.state.doc.resolve(e), n = t.nodeAfter;
7241
7241
  return n && n.isAtom && C.isSelectable(n) ? (Qe(r, new C(t)), !0) : !1;
7242
7242
  }
7243
- function Aa(r, e) {
7243
+ function va(r, e) {
7244
7244
  if (e == -1)
7245
7245
  return !1;
7246
7246
  let t = r.state.selection, n, i;
@@ -7255,16 +7255,16 @@ function Aa(r, e) {
7255
7255
  }
7256
7256
  return i != null ? (Qe(r, C.create(r.state.doc, i)), !0) : !1;
7257
7257
  }
7258
- function va(r, e, t, n, i) {
7259
- return hr(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (s) => s(r, e, n)) || (i ? Aa(r, t) : Na(r, t));
7258
+ function Da(r, e, t, n, i) {
7259
+ return hr(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (s) => s(r, e, n)) || (i ? va(r, t) : Aa(r, t));
7260
7260
  }
7261
- function Da(r, e, t, n) {
7261
+ function Ia(r, e, t, n) {
7262
7262
  return hr(r, "handleDoubleClickOn", e, t, n) || r.someProp("handleDoubleClick", (i) => i(r, e, n));
7263
7263
  }
7264
- function Ia(r, e, t, n) {
7265
- return hr(r, "handleTripleClickOn", e, t, n) || r.someProp("handleTripleClick", (i) => i(r, e, n)) || Pa(r, t, n);
7264
+ function Pa(r, e, t, n) {
7265
+ return hr(r, "handleTripleClickOn", e, t, n) || r.someProp("handleTripleClick", (i) => i(r, e, n)) || Ra(r, t, n);
7266
7266
  }
7267
- function Pa(r, e, t) {
7267
+ function Ra(r, e, t) {
7268
7268
  if (t.button != 0)
7269
7269
  return !1;
7270
7270
  let n = r.state.doc;
@@ -7290,11 +7290,11 @@ U.mousedown = (r, e) => {
7290
7290
  let t = e;
7291
7291
  r.input.shiftKey = t.shiftKey;
7292
7292
  let n = pr(r), i = Date.now(), s = "singleClick";
7293
- i - r.input.lastClick.time < 500 && Oa(t, r.input.lastClick) && !t[Ws] && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
7293
+ i - r.input.lastClick.time < 500 && Na(t, r.input.lastClick) && !t[Ws] && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
7294
7294
  let o = r.posAtCoords(an(t));
7295
- o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new Ra(r, o, t, !!n)) : (s == "doubleClick" ? Da : Ia)(r, o.pos, o.inside, t) ? t.preventDefault() : we(r, "pointer"));
7295
+ o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new Ba(r, o, t, !!n)) : (s == "doubleClick" ? Ia : Pa)(r, o.pos, o.inside, t) ? t.preventDefault() : we(r, "pointer"));
7296
7296
  };
7297
- class Ra {
7297
+ class Ba {
7298
7298
  constructor(e, t, n, i) {
7299
7299
  this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[Ws], this.allowDefault = n.shiftKey;
7300
7300
  let s, o;
@@ -7323,7 +7323,7 @@ class Ra {
7323
7323
  if (this.done(), !this.view.dom.contains(e.target))
7324
7324
  return;
7325
7325
  let t = this.pos;
7326
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(an(e))), this.updateAllowDefault(e), this.allowDefault || !t ? we(this.view, "pointer") : va(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7326
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(an(e))), this.updateAllowDefault(e), this.allowDefault || !t ? we(this.view, "pointer") : Da(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7327
7327
  K && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7328
7328
  // cursor, but still report that the node is selected
7329
7329
  // when asked through getSelection. You'll then get a
@@ -7350,7 +7350,7 @@ U.contextmenu = (r) => pr(r);
7350
7350
  function Js(r, e) {
7351
7351
  return r.composing ? !0 : K && Math.abs(e.timeStamp - r.input.compositionEndedAt) < 500 ? (r.input.compositionEndedAt = -2e8, !0) : !1;
7352
7352
  }
7353
- const Ba = pe ? 5e3 : -1;
7353
+ const za = pe ? 5e3 : -1;
7354
7354
  _.compositionstart = _.compositionupdate = (r) => {
7355
7355
  if (!r.composing) {
7356
7356
  r.domObserver.flush();
@@ -7373,7 +7373,7 @@ _.compositionstart = _.compositionupdate = (r) => {
7373
7373
  }
7374
7374
  r.input.composing = !0;
7375
7375
  }
7376
- qs(r, Ba);
7376
+ qs(r, za);
7377
7377
  };
7378
7378
  _.compositionend = (r, e) => {
7379
7379
  r.composing && (r.input.composing = !1, r.input.compositionEndedAt = e.timeStamp, r.input.compositionPendingChanges = r.domObserver.pendingRecords().length ? r.input.compositionID : 0, r.input.compositionNode = null, r.input.compositionPendingChanges && Promise.resolve().then(() => r.domObserver.flush()), r.input.compositionID++, qs(r, 20));
@@ -7382,14 +7382,14 @@ function qs(r, e) {
7382
7382
  clearTimeout(r.input.composingTimeout), e > -1 && (r.input.composingTimeout = setTimeout(() => _t(r), e));
7383
7383
  }
7384
7384
  function Ks(r) {
7385
- for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt = Fa()); r.input.compositionNodes.length > 0; )
7385
+ for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt = La()); r.input.compositionNodes.length > 0; )
7386
7386
  r.input.compositionNodes.pop().markParentsDirty();
7387
7387
  }
7388
- function za(r) {
7388
+ function Fa(r) {
7389
7389
  let e = r.domSelectionRange();
7390
7390
  if (!e.focusNode)
7391
7391
  return null;
7392
- let t = Nl(e.focusNode, e.focusOffset), n = Al(e.focusNode, e.focusOffset);
7392
+ let t = Al(e.focusNode, e.focusOffset), n = vl(e.focusNode, e.focusOffset);
7393
7393
  if (t && n && t != n) {
7394
7394
  let i = n.pmViewDesc, s = r.domObserver.lastChangedTextNode;
7395
7395
  if (t == s || n == s)
@@ -7404,7 +7404,7 @@ function za(r) {
7404
7404
  }
7405
7405
  return t || n;
7406
7406
  }
7407
- function Fa() {
7407
+ function La() {
7408
7408
  let r = document.createEvent("Event");
7409
7409
  return r.initEvent("event", !0, !0), r.timeStamp;
7410
7410
  }
@@ -7417,7 +7417,7 @@ function _t(r, e = !1) {
7417
7417
  return !1;
7418
7418
  }
7419
7419
  }
7420
- function La(r, e) {
7420
+ function $a(r, e) {
7421
7421
  if (!r.dom.parentNode)
7422
7422
  return;
7423
7423
  let t = r.dom.parentNode.appendChild(document.createElement("div"));
@@ -7427,18 +7427,18 @@ function La(r, e) {
7427
7427
  t.parentNode && t.parentNode.removeChild(t), r.focus();
7428
7428
  }, 50);
7429
7429
  }
7430
- const kt = G && Ee < 15 || rt && Rl < 604;
7430
+ const kt = Y && Ee < 15 || rt && Bl < 604;
7431
7431
  U.copy = _.cut = (r, e) => {
7432
7432
  let t = e, n = r.state.selection, i = t.type == "cut";
7433
7433
  if (n.empty)
7434
7434
  return;
7435
7435
  let s = kt ? null : t.clipboardData, o = n.content(), { dom: l, text: a } = dr(r, o);
7436
- s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : La(r, l), i && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7436
+ s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : $a(r, l), i && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7437
7437
  };
7438
- function $a(r) {
7438
+ function Va(r) {
7439
7439
  return r.openStart == 0 && r.openEnd == 0 && r.content.childCount == 1 ? r.content.firstChild : null;
7440
7440
  }
7441
- function Va(r, e) {
7441
+ function ja(r, e) {
7442
7442
  if (!r.dom.parentNode)
7443
7443
  return;
7444
7444
  let t = r.input.shiftKey || r.state.selection.$from.parent.type.spec.code, n = r.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -7454,7 +7454,7 @@ function xt(r, e, t, n, i) {
7454
7454
  return !0;
7455
7455
  if (!s)
7456
7456
  return !1;
7457
- let o = $a(s), l = o ? r.state.tr.replaceSelectionWith(o, n) : r.state.tr.replaceSelection(s);
7457
+ let o = Va(s), l = o ? r.state.tr.replaceSelectionWith(o, n) : r.state.tr.replaceSelection(s);
7458
7458
  return r.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
7459
7459
  }
7460
7460
  function Us(r) {
@@ -7469,17 +7469,17 @@ _.paste = (r, e) => {
7469
7469
  if (r.composing && !pe)
7470
7470
  return;
7471
7471
  let n = kt ? null : t.clipboardData, i = r.input.shiftKey && r.input.lastKeyCode != 45;
7472
- n && xt(r, Us(n), n.getData("text/html"), i, t) ? t.preventDefault() : Va(r, t);
7472
+ n && xt(r, Us(n), n.getData("text/html"), i, t) ? t.preventDefault() : ja(r, t);
7473
7473
  };
7474
7474
  class _s {
7475
7475
  constructor(e, t, n) {
7476
7476
  this.slice = e, this.move = t, this.node = n;
7477
7477
  }
7478
7478
  }
7479
- const ja = te ? "altKey" : "ctrlKey";
7479
+ const Ha = te ? "altKey" : "ctrlKey";
7480
7480
  function Gs(r, e) {
7481
7481
  let t = r.someProp("dragCopies", (n) => !n(e));
7482
- return t ?? !e[ja];
7482
+ return t ?? !e[Ha];
7483
7483
  }
7484
7484
  U.dragstart = (r, e) => {
7485
7485
  let t = e, n = r.input.mouseDown;
@@ -7523,7 +7523,7 @@ _.drop = (r, e) => {
7523
7523
  if (!o)
7524
7524
  return;
7525
7525
  t.preventDefault();
7526
- let a = o ? pl(r.state.doc, s.pos, o) : s.pos;
7526
+ let a = o ? ml(r.state.doc, s.pos, o) : s.pos;
7527
7527
  a == null && (a = s.pos);
7528
7528
  let c = r.state.tr;
7529
7529
  if (l) {
@@ -7761,7 +7761,7 @@ class B {
7761
7761
  let a = this.local[l].map(e, n, i);
7762
7762
  a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
7763
7763
  }
7764
- return this.children.length ? Ha(this.children, o || [], e, t, n, i, s) : o ? new B(o.sort($e), Ge) : W;
7764
+ return this.children.length ? Wa(this.children, o || [], e, t, n, i, s) : o ? new B(o.sort($e), Ge) : W;
7765
7765
  }
7766
7766
  /**
7767
7767
  Add the given array of decorations to the ones in the set,
@@ -7939,7 +7939,7 @@ class xe {
7939
7939
  this.members[t].forEachSet(e);
7940
7940
  }
7941
7941
  }
7942
- function Ha(r, e, t, n, i, s, o) {
7942
+ function Wa(r, e, t, n, i, s, o) {
7943
7943
  let l = r.slice();
7944
7944
  for (let c = 0, u = s; c < t.maps.length; c++) {
7945
7945
  let d = 0;
@@ -7975,7 +7975,7 @@ function Ha(r, e, t, n, i, s, o) {
7975
7975
  a = !0;
7976
7976
  }
7977
7977
  if (a) {
7978
- let c = Wa(l, r, e, t, i, s, o), u = Yt(c, n, 0, o);
7978
+ let c = Ja(l, r, e, t, i, s, o), u = Yt(c, n, 0, o);
7979
7979
  e = u.local;
7980
7980
  for (let d = 0; d < l.length; d += 3)
7981
7981
  l[d + 1] < 0 && (l.splice(d, 3), d -= 3);
@@ -7998,7 +7998,7 @@ function Ys(r, e) {
7998
7998
  }
7999
7999
  return t;
8000
8000
  }
8001
- function Wa(r, e, t, n, i, s, o) {
8001
+ function Ja(r, e, t, n, i, s, o) {
8002
8002
  function l(a, c) {
8003
8003
  for (let u = 0; u < a.local.length; u++) {
8004
8004
  let d = a.local[u].map(n, i, c);
@@ -8073,15 +8073,15 @@ function On(r) {
8073
8073
  n && n != W && e.push(n);
8074
8074
  }), r.cursorWrapper && e.push(B.create(r.state.doc, [r.cursorWrapper.deco])), xe.from(e);
8075
8075
  }
8076
- const Ja = {
8076
+ const qa = {
8077
8077
  childList: !0,
8078
8078
  characterData: !0,
8079
8079
  characterDataOldValue: !0,
8080
8080
  attributes: !0,
8081
8081
  attributeOldValue: !0,
8082
8082
  subtree: !0
8083
- }, qa = G && Ee <= 11;
8084
- class Ka {
8083
+ }, Ka = Y && Ee <= 11;
8084
+ class Ua {
8085
8085
  constructor() {
8086
8086
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
8087
8087
  }
@@ -8095,13 +8095,13 @@ class Ka {
8095
8095
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8096
8096
  }
8097
8097
  }
8098
- class Ua {
8098
+ class _a {
8099
8099
  constructor(e, t) {
8100
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Ka(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {
8100
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Ua(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {
8101
8101
  for (let i = 0; i < n.length; i++)
8102
8102
  this.queue.push(n[i]);
8103
- G && Ee <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
8104
- }), qa && (this.onCharData = (n) => {
8103
+ Y && Ee <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
8104
+ }), Ka && (this.onCharData = (n) => {
8105
8105
  this.queue.push({ target: n.target, type: "characterData", oldValue: n.prevValue }), this.flushSoon();
8106
8106
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
8107
8107
  }
@@ -8114,7 +8114,7 @@ class Ua {
8114
8114
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8115
8115
  }
8116
8116
  start() {
8117
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Ja)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8117
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, qa)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8118
8118
  }
8119
8119
  stop() {
8120
8120
  if (this.observer) {
@@ -8141,7 +8141,7 @@ class Ua {
8141
8141
  if (ai(this.view)) {
8142
8142
  if (this.suppressingSelectionUpdates)
8143
8143
  return ge(this.view);
8144
- if (G && Ee <= 11 && !this.view.state.selection.empty) {
8144
+ if (Y && Ee <= 11 && !this.view.state.selection.empty) {
8145
8145
  let e = this.view.domSelectionRange();
8146
8146
  if (e.focusNode && He(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
8147
8147
  return this.flushSoon();
@@ -8197,12 +8197,12 @@ class Ua {
8197
8197
  let { focusNode: d } = this.currentSelection;
8198
8198
  for (let f of u) {
8199
8199
  let h = f.parentNode;
8200
- h && h.nodeName == "LI" && (!d || Ya(e, d) != h) && f.remove();
8200
+ h && h.nodeName == "LI" && (!d || Xa(e, d) != h) && f.remove();
8201
8201
  }
8202
8202
  }
8203
8203
  }
8204
8204
  let c = null;
8205
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(n) && (c = cr(e)) && c.eq(O.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ge(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), _a(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || ge(e), this.currentSelection.set(n));
8205
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(n) && (c = cr(e)) && c.eq(O.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ge(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Ga(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || ge(e), this.currentSelection.set(n));
8206
8206
  }
8207
8207
  registerMutation(e, t) {
8208
8208
  if (t.indexOf(e.target) > -1)
@@ -8219,7 +8219,7 @@ class Ua {
8219
8219
  if (n.contentDOM && n.contentDOM != n.dom && !n.contentDOM.contains(e.target))
8220
8220
  return { from: n.posBefore, to: n.posAfter };
8221
8221
  let i = e.previousSibling, s = e.nextSibling;
8222
- if (G && Ee <= 11 && e.addedNodes.length)
8222
+ if (Y && Ee <= 11 && e.addedNodes.length)
8223
8223
  for (let u = 0; u < e.addedNodes.length; u++) {
8224
8224
  let { previousSibling: d, nextSibling: f } = e.addedNodes[u];
8225
8225
  (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f);
@@ -8238,7 +8238,7 @@ class Ua {
8238
8238
  }
8239
8239
  }
8240
8240
  let yi = /* @__PURE__ */ new WeakMap(), bi = !1;
8241
- function _a(r) {
8241
+ function Ga(r) {
8242
8242
  if (!yi.has(r) && (yi.set(r, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace) !== -1)) {
8243
8243
  if (r.requiresGeckoHackNode = oe, bi)
8244
8244
  return;
@@ -8249,7 +8249,7 @@ function ki(r, e) {
8249
8249
  let t = e.startContainer, n = e.startOffset, i = e.endContainer, s = e.endOffset, o = r.domAtPos(r.state.selection.anchor);
8250
8250
  return He(o.node, o.offset, i, s) && ([t, n, i, s] = [i, s, t, n]), { anchorNode: t, anchorOffset: n, focusNode: i, focusOffset: s };
8251
8251
  }
8252
- function Ga(r, e) {
8252
+ function Ya(r, e) {
8253
8253
  if (e.getComposedRanges) {
8254
8254
  let i = e.getComposedRanges(r.root)[0];
8255
8255
  if (i)
@@ -8261,7 +8261,7 @@ function Ga(r, e) {
8261
8261
  }
8262
8262
  return r.dom.addEventListener("beforeinput", n, !0), document.execCommand("indent"), r.dom.removeEventListener("beforeinput", n, !0), t ? ki(r, t) : null;
8263
8263
  }
8264
- function Ya(r, e) {
8264
+ function Xa(r, e) {
8265
8265
  for (let t = e.parentNode; t && t != r.dom; t = t.parentNode) {
8266
8266
  let n = r.docView.nearestDesc(t, !0);
8267
8267
  if (n && n.node.isBlock)
@@ -8269,7 +8269,7 @@ function Ya(r, e) {
8269
8269
  }
8270
8270
  return null;
8271
8271
  }
8272
- function Xa(r, e, t) {
8272
+ function Za(r, e, t) {
8273
8273
  let { node: n, fromOffset: i, toOffset: s, from: o, to: l } = r.docView.parseRange(e, t), a = r.domSelectionRange(), c, u = a.anchorNode;
8274
8274
  if (u && r.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], on(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), J && r.input.lastKeyCode === 8)
8275
8275
  for (let g = s; g > i; g--) {
@@ -8289,7 +8289,7 @@ function Xa(r, e, t) {
8289
8289
  to: s,
8290
8290
  preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
8291
8291
  findPositions: c,
8292
- ruleFromNode: Za,
8292
+ ruleFromNode: Qa,
8293
8293
  context: h
8294
8294
  });
8295
8295
  if (c && c[0].pos != null) {
@@ -8298,7 +8298,7 @@ function Xa(r, e, t) {
8298
8298
  }
8299
8299
  return { doc: m, sel: p, from: o, to: l };
8300
8300
  }
8301
- function Za(r) {
8301
+ function Qa(r) {
8302
8302
  let e = r.pmViewDesc;
8303
8303
  if (e)
8304
8304
  return e.parseRule();
@@ -8312,13 +8312,13 @@ function Za(r) {
8312
8312
  return { ignore: !0 };
8313
8313
  return null;
8314
8314
  }
8315
- const Qa = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8316
- function ec(r, e, t, n, i) {
8315
+ const ec = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8316
+ function tc(r, e, t, n, i) {
8317
8317
  let s = r.input.compositionPendingChanges || (r.composing ? r.input.compositionID : 0);
8318
8318
  if (r.input.compositionPendingChanges = 0, e < 0) {
8319
8319
  let E = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, ee = cr(r, E);
8320
8320
  if (ee && !r.state.selection.eq(ee)) {
8321
- if (J && pe && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (No) => No(r, De(13, "Enter"))))
8321
+ if (J && pe && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (Ao) => Ao(r, De(13, "Enter"))))
8322
8322
  return;
8323
8323
  let Nt = r.state.tr.setSelection(ee);
8324
8324
  E == "pointer" ? Nt.setMeta("pointer", !0) : E == "key" && Nt.scrollIntoView(), s && Nt.setMeta("composition", s), r.dispatch(Nt);
@@ -8327,10 +8327,10 @@ function ec(r, e, t, n, i) {
8327
8327
  }
8328
8328
  let o = r.state.doc.resolve(e), l = o.sharedDepth(t);
8329
8329
  e = o.before(l + 1), t = r.state.doc.resolve(t).after(l + 1);
8330
- let a = r.state.selection, c = Xa(r, e, t), u = r.state.doc, d = u.slice(c.from, c.to), f, h;
8330
+ let a = r.state.selection, c = Za(r, e, t), u = r.state.doc, d = u.slice(c.from, c.to), f, h;
8331
8331
  r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (f = r.state.selection.to, h = "end") : (f = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
8332
- let p = rc(d.content, c.doc.content, c.from, f, h);
8333
- if (p && r.input.domChangeCount++, (rt && r.input.lastIOSEnter > Date.now() - 225 || pe) && i.some((E) => E.nodeType == 1 && !Qa.test(E.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (E) => E(r, De(13, "Enter")))) {
8332
+ let p = ic(d.content, c.doc.content, c.from, f, h);
8333
+ if (p && r.input.domChangeCount++, (rt && r.input.lastIOSEnter > Date.now() - 225 || pe) && i.some((E) => E.nodeType == 1 && !ec.test(E.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (E) => E(r, De(13, "Enter")))) {
8334
8334
  r.input.lastIOSEnter = 0;
8335
8335
  return;
8336
8336
  }
@@ -8347,13 +8347,13 @@ function ec(r, e, t, n, i) {
8347
8347
  }
8348
8348
  return;
8349
8349
  }
8350
- r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof T && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), G && Ee <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8350
+ r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof T && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), Y && Ee <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8351
8351
  let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = u.resolve(p.start), S = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA, w;
8352
8352
  if ((rt && r.input.lastIOSEnter > Date.now() - 225 && (!S || i.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !S && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && (w = O.findFrom(c.doc.resolve(m.pos + 1), 1, !0)) && w.head > m.pos) && r.someProp("handleKeyDown", (E) => E(r, De(13, "Enter")))) {
8353
8353
  r.input.lastIOSEnter = 0;
8354
8354
  return;
8355
8355
  }
8356
- if (r.state.selection.anchor > p.start && nc(u, p.start, p.endA, m, g) && r.someProp("handleKeyDown", (E) => E(r, De(8, "Backspace")))) {
8356
+ if (r.state.selection.anchor > p.start && rc(u, p.start, p.endA, m, g) && r.someProp("handleKeyDown", (E) => E(r, De(8, "Backspace")))) {
8357
8357
  pe && J && r.domObserver.suppressSelectionUpdates();
8358
8358
  return;
8359
8359
  }
@@ -8365,10 +8365,10 @@ function ec(r, e, t, n, i) {
8365
8365
  let v = p.start, A = p.endA, M, I, H;
8366
8366
  if (S) {
8367
8367
  if (m.pos == g.pos)
8368
- G && Ee <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => ge(r), 20)), M = r.state.tr.delete(v, A), I = u.resolve(p.start).marksAcross(u.resolve(p.endA));
8368
+ Y && Ee <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => ge(r), 20)), M = r.state.tr.delete(v, A), I = u.resolve(p.start).marksAcross(u.resolve(p.endA));
8369
8369
  else if (
8370
8370
  // Adding or removing a mark
8371
- p.endA == p.endB && (H = tc(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8371
+ p.endA == p.endB && (H = nc(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8372
8372
  )
8373
8373
  M = r.state.tr, H.type == "add" ? M.addMark(v, A, H.mark) : M.removeMark(v, A, H.mark);
8374
8374
  else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
@@ -8380,14 +8380,14 @@ function ec(r, e, t, n, i) {
8380
8380
  }
8381
8381
  if (M || (M = r.state.tr.replace(v, A, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
8382
8382
  let E = xi(r, M.doc, c.sel);
8383
- E && !(J && r.composing && E.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (E.head == v || E.head == M.mapping.map(A) - 1) || G && E.empty && E.head == v) && M.setSelection(E);
8383
+ E && !(J && r.composing && E.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (E.head == v || E.head == M.mapping.map(A) - 1) || Y && E.empty && E.head == v) && M.setSelection(E);
8384
8384
  }
8385
8385
  I && M.ensureMarks(I), s && M.setMeta("composition", s), r.dispatch(M.scrollIntoView());
8386
8386
  }
8387
8387
  function xi(r, e, t) {
8388
8388
  return Math.max(t.anchor, t.head) > e.content.size ? null : ur(r, e.resolve(t.anchor), e.resolve(t.head));
8389
8389
  }
8390
- function tc(r, e) {
8390
+ function nc(r, e) {
8391
8391
  let t = r.firstChild.marks, n = e.firstChild.marks, i = t, s = n, o, l, a;
8392
8392
  for (let u = 0; u < n.length; u++)
8393
8393
  i = n[u].removeFromSet(i);
@@ -8405,7 +8405,7 @@ function tc(r, e) {
8405
8405
  if (b.from(c).eq(r))
8406
8406
  return { mark: l, type: o };
8407
8407
  }
8408
- function nc(r, e, t, n, i) {
8408
+ function rc(r, e, t, n, i) {
8409
8409
  if (
8410
8410
  // The content must have shrunk
8411
8411
  t - e <= i.pos - n.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -8433,7 +8433,7 @@ function Nn(r, e, t) {
8433
8433
  }
8434
8434
  return i;
8435
8435
  }
8436
- function rc(r, e, t, n, i) {
8436
+ function ic(r, e, t, n, i) {
8437
8437
  let s = r.findDiffStart(e, t);
8438
8438
  if (s == null)
8439
8439
  return null;
@@ -8457,7 +8457,7 @@ function Si(r) {
8457
8457
  let e = r.charCodeAt(0), t = r.charCodeAt(1);
8458
8458
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
8459
8459
  }
8460
- class ic {
8460
+ class sc {
8461
8461
  /**
8462
8462
  Create a view. `place` may be a DOM node that the editor should
8463
8463
  be appended to, a function that will place it into the document,
@@ -8466,7 +8466,7 @@ class ic {
8466
8466
  added to the document.
8467
8467
  */
8468
8468
  constructor(e, t) {
8469
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Ca(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ti), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Mi(this), wi(this), this.nodeViews = Ei(this), this.docView = ni(this.state.doc, Ci(this), On(this), this.dom, this), this.domObserver = new Ua(this, (n, i, s, o) => ec(this, n, i, s, o)), this.domObserver.start(), wa(this), this.updatePluginViews();
8469
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new wa(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ti), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Mi(this), wi(this), this.nodeViews = Ei(this), this.docView = ni(this.state.doc, Ci(this), On(this), this.dom, this), this.domObserver = new _a(this, (n, i, s, o) => tc(this, n, i, s, o)), this.domObserver.start(), Ma(this), this.updatePluginViews();
8470
8470
  }
8471
8471
  /**
8472
8472
  Holds `true` when a
@@ -8526,22 +8526,22 @@ class ic {
8526
8526
  let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
8527
8527
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
8528
8528
  let h = Ei(this);
8529
- oc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
8529
+ lc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
8530
8530
  }
8531
8531
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Zn(this), this.editable = Mi(this), wi(this);
8532
8532
  let a = On(this), c = Ci(this), u = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
8533
8533
  (d || !e.selection.eq(i.selection)) && (o = !0);
8534
- let f = u == "preserve" && o && this.dom.style.overflowAnchor == null && Fl(this);
8534
+ let f = u == "preserve" && o && this.dom.style.overflowAnchor == null && Ll(this);
8535
8535
  if (o) {
8536
8536
  this.domObserver.stop();
8537
- let h = d && (G || J) && !this.composing && !i.selection.empty && !e.selection.empty && sc(i.selection, e.selection);
8537
+ let h = d && (Y || J) && !this.composing && !i.selection.empty && !e.selection.empty && oc(i.selection, e.selection);
8538
8538
  if (d) {
8539
8539
  let p = J ? this.trackWrites = this.domSelectionRange().focusNode : null;
8540
- this.composing && (this.input.compositionNode = za(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ni(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
8540
+ this.composing && (this.input.compositionNode = Fa(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ni(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
8541
8541
  }
8542
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && la(this)) ? ge(this, h) : (Rs(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8542
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && aa(this)) ? ge(this, h) : (Rs(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8543
8543
  }
8544
- this.updatePluginViews(i), !((n = this.dragging) === null || n === void 0) && n.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : f && Ll(f);
8544
+ this.updatePluginViews(i), !((n = this.dragging) === null || n === void 0) && n.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : f && $l(f);
8545
8545
  }
8546
8546
  /**
8547
8547
  @internal
@@ -8609,7 +8609,7 @@ class ic {
8609
8609
  Query whether the view has focus.
8610
8610
  */
8611
8611
  hasFocus() {
8612
- if (G) {
8612
+ if (Y) {
8613
8613
  let e = this.root.activeElement;
8614
8614
  if (e == this.dom)
8615
8615
  return !0;
@@ -8628,7 +8628,7 @@ class ic {
8628
8628
  Focus the editor.
8629
8629
  */
8630
8630
  focus() {
8631
- this.domObserver.stop(), this.editable && $l(this.dom), ge(this), this.domObserver.start();
8631
+ this.domObserver.stop(), this.editable && Vl(this.dom), ge(this), this.domObserver.start();
8632
8632
  }
8633
8633
  /**
8634
8634
  Get the document root in which the editor exists. This will
@@ -8662,7 +8662,7 @@ class ic {
8662
8662
  the top level, not in any node.
8663
8663
  */
8664
8664
  posAtCoords(e) {
8665
- return Jl(this, e);
8665
+ return ql(this, e);
8666
8666
  }
8667
8667
  /**
8668
8668
  Returns the viewport rectangle at a given document position.
@@ -8727,7 +8727,7 @@ class ic {
8727
8727
  pass a different state.
8728
8728
  */
8729
8729
  endOfTextblock(e, t) {
8730
- return Gl(this, t || this.state, e);
8730
+ return Yl(this, t || this.state, e);
8731
8731
  }
8732
8732
  /**
8733
8733
  Run the editor's paste logic with the given HTML string. The
@@ -8759,7 +8759,7 @@ class ic {
8759
8759
  views](https://prosemirror.net/docs/ref/#view.NodeView).
8760
8760
  */
8761
8761
  destroy() {
8762
- this.docView && (Ma(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], On(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Tl());
8762
+ this.docView && (Ea(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], On(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Ol());
8763
8763
  }
8764
8764
  /**
8765
8765
  This is true when the view has been
@@ -8773,7 +8773,7 @@ class ic {
8773
8773
  Used for testing.
8774
8774
  */
8775
8775
  dispatchEvent(e) {
8776
- return Ta(this, e);
8776
+ return Oa(this, e);
8777
8777
  }
8778
8778
  /**
8779
8779
  Dispatch a transaction. Will call
@@ -8793,7 +8793,7 @@ class ic {
8793
8793
  */
8794
8794
  domSelectionRange() {
8795
8795
  let e = this.domSelection();
8796
- return e ? K && this.root.nodeType === 11 && Dl(this.dom.ownerDocument) == this.dom && Ga(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8796
+ return e ? K && this.root.nodeType === 11 && Il(this.dom.ownerDocument) == this.dom && Ya(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8797
8797
  }
8798
8798
  /**
8799
8799
  @internal
@@ -8820,7 +8820,7 @@ function wi(r) {
8820
8820
  function Mi(r) {
8821
8821
  return !r.someProp("editable", (e) => e(r.state) === !1);
8822
8822
  }
8823
- function sc(r, e) {
8823
+ function oc(r, e) {
8824
8824
  let t = Math.min(r.$anchor.sharedDepth(r.head), e.$anchor.sharedDepth(e.head));
8825
8825
  return r.$anchor.start(t) != e.$anchor.start(t);
8826
8826
  }
@@ -8832,7 +8832,7 @@ function Ei(r) {
8832
8832
  }
8833
8833
  return r.someProp("nodeViews", t), r.someProp("markViews", t), e;
8834
8834
  }
8835
- function oc(r, e) {
8835
+ function lc(r, e) {
8836
8836
  let t = 0, n = 0;
8837
8837
  for (let i in r) {
8838
8838
  if (r[i] != e[i])
@@ -8925,18 +8925,18 @@ var Ne = {
8925
8925
  220: "|",
8926
8926
  221: "}",
8927
8927
  222: '"'
8928
- }, lc = typeof navigator < "u" && /Mac/.test(navigator.platform), ac = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
8928
+ }, ac = typeof navigator < "u" && /Mac/.test(navigator.platform), cc = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
8929
8929
  for (var j = 0; j < 10; j++) Ne[48 + j] = Ne[96 + j] = String(j);
8930
8930
  for (var j = 1; j <= 24; j++) Ne[j + 111] = "F" + j;
8931
8931
  for (var j = 65; j <= 90; j++)
8932
8932
  Ne[j] = String.fromCharCode(j + 32), Xt[j] = String.fromCharCode(j);
8933
8933
  for (var An in Ne) Xt.hasOwnProperty(An) || (Xt[An] = Ne[An]);
8934
- function cc(r) {
8935
- var e = lc && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || ac && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Xt : Ne)[r.keyCode] || r.key || "Unidentified";
8934
+ function uc(r) {
8935
+ var e = ac && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || cc && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Xt : Ne)[r.keyCode] || r.key || "Unidentified";
8936
8936
  return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
8937
8937
  }
8938
- const uc = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
8939
- function dc(r) {
8938
+ const dc = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
8939
+ function fc(r) {
8940
8940
  let e = r.split(/-(?!$)/), t = e[e.length - 1];
8941
8941
  t == "Space" && (t = " ");
8942
8942
  let n, i, s, o;
@@ -8951,28 +8951,28 @@ function dc(r) {
8951
8951
  else if (/^s(hift)?$/i.test(a))
8952
8952
  s = !0;
8953
8953
  else if (/^mod$/i.test(a))
8954
- uc ? o = !0 : i = !0;
8954
+ dc ? o = !0 : i = !0;
8955
8955
  else
8956
8956
  throw new Error("Unrecognized modifier name: " + a);
8957
8957
  }
8958
8958
  return n && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
8959
8959
  }
8960
- function fc(r) {
8960
+ function hc(r) {
8961
8961
  let e = /* @__PURE__ */ Object.create(null);
8962
8962
  for (let t in r)
8963
- e[dc(t)] = r[t];
8963
+ e[fc(t)] = r[t];
8964
8964
  return e;
8965
8965
  }
8966
8966
  function vn(r, e, t = !0) {
8967
8967
  return e.altKey && (r = "Alt-" + r), e.ctrlKey && (r = "Ctrl-" + r), e.metaKey && (r = "Meta-" + r), t && e.shiftKey && (r = "Shift-" + r), r;
8968
8968
  }
8969
- function hc(r) {
8970
- return new Q({ props: { handleKeyDown: pc(r) } });
8971
- }
8972
8969
  function pc(r) {
8973
- let e = fc(r);
8970
+ return new Q({ props: { handleKeyDown: mc(r) } });
8971
+ }
8972
+ function mc(r) {
8973
+ let e = hc(r);
8974
8974
  return function(t, n) {
8975
- let i = cc(n), s, o = e[vn(i, n)];
8975
+ let i = uc(n), s, o = e[vn(i, n)];
8976
8976
  if (o && o(t.state, t.dispatch, t))
8977
8977
  return !0;
8978
8978
  if (i.length == 1 && i != " ") {
@@ -9021,13 +9021,13 @@ const eo = (r, e, t) => {
9021
9021
  break;
9022
9022
  }
9023
9023
  return s.isAtom && i.depth == n.depth - 1 ? (e && e(r.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
9024
- }, mc = (r, e, t) => {
9024
+ }, gc = (r, e, t) => {
9025
9025
  let n = Qs(r, t);
9026
9026
  if (!n)
9027
9027
  return !1;
9028
9028
  let i = br(n);
9029
9029
  return i ? to(r, i, e) : !1;
9030
- }, gc = (r, e, t) => {
9030
+ }, yc = (r, e, t) => {
9031
9031
  let n = ro(r, t);
9032
9032
  if (!n)
9033
9033
  return !1;
@@ -9141,7 +9141,7 @@ function kr(r) {
9141
9141
  }
9142
9142
  return null;
9143
9143
  }
9144
- const yc = (r, e) => {
9144
+ const bc = (r, e) => {
9145
9145
  let t = r.selection, n = t instanceof C, i;
9146
9146
  if (n) {
9147
9147
  if (t.node.isTextblock || !qe(r.doc, t.from))
@@ -9154,7 +9154,7 @@ const yc = (r, e) => {
9154
9154
  n && s.setSelection(C.create(s.doc, i - r.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
9155
9155
  }
9156
9156
  return !0;
9157
- }, bc = (r, e) => {
9157
+ }, kc = (r, e) => {
9158
9158
  let t = r.selection, n;
9159
9159
  if (t instanceof C) {
9160
9160
  if (t.node.isTextblock || !qe(r.doc, t.to))
@@ -9163,7 +9163,7 @@ const yc = (r, e) => {
9163
9163
  } else if (n = nn(r.doc, t.to, 1), n == null)
9164
9164
  return !1;
9165
9165
  return e && e(r.tr.join(n).scrollIntoView()), !0;
9166
- }, kc = (r, e) => {
9166
+ }, xc = (r, e) => {
9167
9167
  let { $from: t, $to: n } = r.selection, i = t.blockRange(n), s = i && st(i);
9168
9168
  return s == null ? !1 : (e && e(r.tr.lift(i, s).scrollIntoView()), !0);
9169
9169
  }, oo = (r, e) => {
@@ -9179,7 +9179,7 @@ function xr(r) {
9179
9179
  }
9180
9180
  return null;
9181
9181
  }
9182
- const xc = (r, e) => {
9182
+ const Sc = (r, e) => {
9183
9183
  let { $head: t, $anchor: n } = r.selection;
9184
9184
  if (!t.parent.type.spec.code || !t.sameParent(n))
9185
9185
  return !1;
@@ -9215,7 +9215,7 @@ const xc = (r, e) => {
9215
9215
  let n = t.blockRange(), i = n && st(n);
9216
9216
  return i == null ? !1 : (e && e(r.tr.lift(n, i).scrollIntoView()), !0);
9217
9217
  };
9218
- function Sc(r) {
9218
+ function Cc(r) {
9219
9219
  return (e, t) => {
9220
9220
  let { $from: n, $to: i } = e.selection;
9221
9221
  if (e.selection instanceof C && e.selection.node.isBlock)
@@ -9244,17 +9244,17 @@ function Sc(r) {
9244
9244
  return t && t(u.scrollIntoView()), !0;
9245
9245
  };
9246
9246
  }
9247
- const Cc = Sc(), wc = (r, e) => {
9247
+ const wc = Cc(), Mc = (r, e) => {
9248
9248
  let { $from: t, to: n } = r.selection, i, s = t.sharedDepth(n);
9249
9249
  return s == 0 ? !1 : (i = t.before(s), e && e(r.tr.setSelection(C.create(r.doc, i))), !0);
9250
9250
  };
9251
- function Mc(r, e, t) {
9251
+ function Ec(r, e, t) {
9252
9252
  let n = e.nodeBefore, i = e.nodeAfter, s = e.index();
9253
9253
  return !n || !i || !n.type.compatibleContent(i.type) ? !1 : !n.content.size && e.parent.canReplace(s - 1, s) ? (t && t(r.tr.delete(e.pos - n.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || qe(r.doc, e.pos)) ? !1 : (t && t(r.tr.join(e.pos).scrollIntoView()), !0);
9254
9254
  }
9255
9255
  function co(r, e, t, n) {
9256
9256
  let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
9257
- if (!a && Mc(r, e, t))
9257
+ if (!a && Ec(r, e, t))
9258
9258
  return !0;
9259
9259
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
9260
9260
  if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
@@ -9302,8 +9302,8 @@ function uo(r) {
9302
9302
  return i.node(s).isTextblock ? (t && t(e.tr.setSelection(T.create(e.doc, r < 0 ? i.start(s) : i.end(s)))), !0) : !1;
9303
9303
  };
9304
9304
  }
9305
- const Ec = uo(-1), Tc = uo(1);
9306
- function Oc(r, e = null) {
9305
+ const Tc = uo(-1), Oc = uo(1);
9306
+ function Nc(r, e = null) {
9307
9307
  return function(t, n) {
9308
9308
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && us(o, r, e);
9309
9309
  return l ? (n && n(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
@@ -9349,18 +9349,18 @@ function Sr(...r) {
9349
9349
  }
9350
9350
  Sr(yr, eo, no);
9351
9351
  Sr(yr, io, so);
9352
- Sr(oo, lo, ao, Cc);
9352
+ Sr(oo, lo, ao, wc);
9353
9353
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
9354
- function Nc(r, e = null) {
9354
+ function Ac(r, e = null) {
9355
9355
  return function(t, n) {
9356
9356
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s);
9357
9357
  if (!o)
9358
9358
  return !1;
9359
9359
  let l = n ? t.tr : null;
9360
- return Ac(l, o, r, e) ? (n && n(l.scrollIntoView()), !0) : !1;
9360
+ return vc(l, o, r, e) ? (n && n(l.scrollIntoView()), !0) : !1;
9361
9361
  };
9362
9362
  }
9363
- function Ac(r, e, t, n = null) {
9363
+ function vc(r, e, t, n = null) {
9364
9364
  let i = !1, s = e, o = e.$from.doc;
9365
9365
  if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
9366
9366
  if (e.$from.index(e.depth - 1) == 0)
@@ -9369,9 +9369,9 @@ function Ac(r, e, t, n = null) {
9369
9369
  s = new Jt(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new Jt(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
9370
9370
  }
9371
9371
  let l = us(s, t, n, e);
9372
- return l ? (r && vc(r, e, l, i, t), !0) : !1;
9372
+ return l ? (r && Dc(r, e, l, i, t), !0) : !1;
9373
9373
  }
9374
- function vc(r, e, t, n, i) {
9374
+ function Dc(r, e, t, n, i) {
9375
9375
  let s = b.empty;
9376
9376
  for (let u = t.length - 1; u >= 0; u--)
9377
9377
  s = b.from(t[u].type.create(t[u].attrs, s));
@@ -9384,13 +9384,13 @@ function vc(r, e, t, n, i) {
9384
9384
  !f && me(r.doc, a, l) && (r.split(a, l), a += 2 * l), a += c.child(u).nodeSize;
9385
9385
  return r;
9386
9386
  }
9387
- function Dc(r) {
9387
+ function Ic(r) {
9388
9388
  return function(e, t) {
9389
9389
  let { $from: n, $to: i } = e.selection, s = n.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == r);
9390
- return s ? t ? n.node(s.depth - 1).type == r ? Ic(e, t, r, s) : Pc(e, t, s) : !0 : !1;
9390
+ return s ? t ? n.node(s.depth - 1).type == r ? Pc(e, t, r, s) : Rc(e, t, s) : !0 : !1;
9391
9391
  };
9392
9392
  }
9393
- function Ic(r, e, t, n) {
9393
+ function Pc(r, e, t, n) {
9394
9394
  let i = r.tr, s = n.end, o = n.$to.end(n.depth);
9395
9395
  s < o && (i.step(new z(s - 1, o, s, o, new k(b.from(t.create(null, n.parent.copy())), 1, 0), 1, !0)), n = new Jt(i.doc.resolve(n.$from.pos), i.doc.resolve(o), n.depth));
9396
9396
  const l = st(n);
@@ -9400,7 +9400,7 @@ function Ic(r, e, t, n) {
9400
9400
  let a = i.doc.resolve(i.mapping.map(s, -1) - 1);
9401
9401
  return qe(i.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && i.join(a.pos), e(i.scrollIntoView()), !0;
9402
9402
  }
9403
- function Pc(r, e, t) {
9403
+ function Rc(r, e, t) {
9404
9404
  let n = r.tr, i = t.parent;
9405
9405
  for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
9406
9406
  h -= i.child(p).nodeSize, n.delete(h - 1, h + 1);
@@ -9413,7 +9413,7 @@ function Pc(r, e, t) {
9413
9413
  let d = s.pos, f = d + o.nodeSize;
9414
9414
  return n.step(new z(d - (l ? 1 : 0), f + (a ? 1 : 0), d + 1, f - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(n.scrollIntoView()), !0;
9415
9415
  }
9416
- function Rc(r) {
9416
+ function Bc(r) {
9417
9417
  return function(e, t) {
9418
9418
  let { $from: n, $to: i } = e.selection, s = n.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == r);
9419
9419
  if (!s)
@@ -9516,7 +9516,7 @@ class un {
9516
9516
  return l;
9517
9517
  }
9518
9518
  }
9519
- class Bc {
9519
+ class zc {
9520
9520
  constructor() {
9521
9521
  this.callbacks = {};
9522
9522
  }
@@ -9617,7 +9617,7 @@ function L(r, e) {
9617
9617
  }
9618
9618
  return r;
9619
9619
  }
9620
- function zc(...r) {
9620
+ function Fc(...r) {
9621
9621
  return r.filter((e) => !!e).reduce((e, t) => {
9622
9622
  const n = { ...e };
9623
9623
  return Object.entries(t).forEach(([i, s]) => {
@@ -9645,7 +9645,7 @@ function zc(...r) {
9645
9645
  function Qn(r, e) {
9646
9646
  return e.filter((t) => t.type === r.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(r.attrs) || {} : {
9647
9647
  [t.name]: r.attrs[t.name]
9648
- }).reduce((t, n) => zc(t, n), {});
9648
+ }).reduce((t, n) => Fc(t, n), {});
9649
9649
  }
9650
9650
  function ho(r) {
9651
9651
  return typeof r == "function";
@@ -9653,10 +9653,10 @@ function ho(r) {
9653
9653
  function N(r, e = void 0, ...t) {
9654
9654
  return ho(r) ? e ? r.bind(e)(...t) : r(...t) : r;
9655
9655
  }
9656
- function Fc(r = {}) {
9656
+ function Lc(r = {}) {
9657
9657
  return Object.keys(r).length === 0 && r.constructor === Object;
9658
9658
  }
9659
- function Lc(r) {
9659
+ function $c(r) {
9660
9660
  return typeof r != "string" ? r : r.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(r) : r === "true" ? !0 : r === "false" ? !1 : r;
9661
9661
  }
9662
9662
  function Ni(r, e) {
@@ -9667,7 +9667,7 @@ function Ni(r, e) {
9667
9667
  if (n === !1)
9668
9668
  return !1;
9669
9669
  const i = e.reduce((s, o) => {
9670
- const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Lc(t.getAttribute(o.name));
9670
+ const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : $c(t.getAttribute(o.name));
9671
9671
  return l == null ? s : {
9672
9672
  ...s,
9673
9673
  [o.name]: l
@@ -9680,10 +9680,10 @@ function Ni(r, e) {
9680
9680
  function Ai(r) {
9681
9681
  return Object.fromEntries(
9682
9682
  // @ts-ignore
9683
- Object.entries(r).filter(([e, t]) => e === "attrs" && Fc(t) ? !1 : t != null)
9683
+ Object.entries(r).filter(([e, t]) => e === "attrs" && Lc(t) ? !1 : t != null)
9684
9684
  );
9685
9685
  }
9686
- function $c(r, e) {
9686
+ function Vc(r, e) {
9687
9687
  var t;
9688
9688
  const n = fo(r), { nodeExtensions: i, markExtensions: s } = dn(r), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
9689
9689
  const u = n.filter((y) => y.type === c.name), d = {
@@ -9771,7 +9771,7 @@ function Cr(r, e) {
9771
9771
  const t = Je.fromSchema(e).serializeFragment(r), i = document.implementation.createHTMLDocument().createElement("div");
9772
9772
  return i.appendChild(t), i.innerHTML;
9773
9773
  }
9774
- const Vc = (r, e = 500) => {
9774
+ const jc = (r, e = 500) => {
9775
9775
  let t = "";
9776
9776
  const n = r.parentOffset;
9777
9777
  return r.parent.nodesBetween(Math.max(0, n - e), n, (i, s, o, l) => {
@@ -9788,7 +9788,12 @@ const Vc = (r, e = 500) => {
9788
9788
  function wr(r) {
9789
9789
  return Object.prototype.toString.call(r) === "[object RegExp]";
9790
9790
  }
9791
- const jc = (r, e) => {
9791
+ class Hc {
9792
+ constructor(e) {
9793
+ this.find = e.find, this.handler = e.handler;
9794
+ }
9795
+ }
9796
+ const Wc = (r, e) => {
9792
9797
  if (wr(e))
9793
9798
  return e.exec(r);
9794
9799
  const t = e(r);
@@ -9809,11 +9814,11 @@ function Dt(r) {
9809
9814
  )
9810
9815
  return !1;
9811
9816
  let u = !1;
9812
- const d = Vc(c) + s;
9817
+ const d = jc(c) + s;
9813
9818
  return o.forEach((f) => {
9814
9819
  if (u)
9815
9820
  return;
9816
- const h = jc(d, f.find);
9821
+ const h = Wc(d, f.find);
9817
9822
  if (!h)
9818
9823
  return;
9819
9824
  const p = a.state.tr, m = cn({
@@ -9841,7 +9846,7 @@ function Dt(r) {
9841
9846
  }), a.dispatch(p), u = !0);
9842
9847
  }), u;
9843
9848
  }
9844
- function Hc(r) {
9849
+ function Jc(r) {
9845
9850
  const { editor: e, rules: t } = r, n = new Q({
9846
9851
  state: {
9847
9852
  init() {
@@ -9913,11 +9918,11 @@ function Hc(r) {
9913
9918
  });
9914
9919
  return n;
9915
9920
  }
9916
- function Wc(r) {
9921
+ function qc(r) {
9917
9922
  return Object.prototype.toString.call(r).slice(8, -1);
9918
9923
  }
9919
9924
  function It(r) {
9920
- return Wc(r) !== "Object" ? !1 : r.constructor === Object && Object.getPrototypeOf(r) === Object.prototype;
9925
+ return qc(r) !== "Object" ? !1 : r.constructor === Object && Object.getPrototypeOf(r) === Object.prototype;
9921
9926
  }
9922
9927
  function fn(r, e) {
9923
9928
  const t = { ...r };
@@ -9971,10 +9976,10 @@ class Ct {
9971
9976
  return !1;
9972
9977
  }
9973
9978
  }
9974
- function Jc(r) {
9979
+ function Kc(r) {
9975
9980
  return typeof r == "number";
9976
9981
  }
9977
- const qc = (r, e, t) => {
9982
+ const Uc = (r, e, t) => {
9978
9983
  if (wr(e))
9979
9984
  return [...r.matchAll(e)];
9980
9985
  const n = e(r, t);
@@ -9983,7 +9988,7 @@ const qc = (r, e, t) => {
9983
9988
  return s.index = i.index, s.input = r, s.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(i.replaceWith)), s;
9984
9989
  }) : [];
9985
9990
  };
9986
- function Kc(r) {
9991
+ function _c(r) {
9987
9992
  const { editor: e, state: t, from: n, to: i, rule: s, pasteEvent: o, dropEvent: l } = r, { commands: a, chain: c, can: u } = new un({
9988
9993
  editor: e,
9989
9994
  state: t
@@ -9992,7 +9997,7 @@ function Kc(r) {
9992
9997
  if (!h.isTextblock || h.type.spec.code)
9993
9998
  return;
9994
9999
  const m = Math.max(n, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
9995
- qc(y, s.find, o).forEach((w) => {
10000
+ Uc(y, s.find, o).forEach((w) => {
9996
10001
  if (w.index === void 0)
9997
10002
  return;
9998
10003
  const v = m + w.index + 1, A = v + w[0].length, M = {
@@ -10013,14 +10018,14 @@ function Kc(r) {
10013
10018
  }), d.every((h) => h !== null);
10014
10019
  }
10015
10020
  let Pt = null;
10016
- const Uc = (r) => {
10021
+ const Gc = (r) => {
10017
10022
  var e;
10018
10023
  const t = new ClipboardEvent("paste", {
10019
10024
  clipboardData: new DataTransfer()
10020
10025
  });
10021
10026
  return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", r), t;
10022
10027
  };
10023
- function _c(r) {
10028
+ function Yc(r) {
10024
10029
  const { editor: e, rules: t } = r;
10025
10030
  let n = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
10026
10031
  try {
@@ -10033,7 +10038,7 @@ function _c(r) {
10033
10038
  state: u,
10034
10039
  transaction: m
10035
10040
  });
10036
- if (!(!Kc({
10041
+ if (!(!_c({
10037
10042
  editor: e,
10038
10043
  state: g,
10039
10044
  from: Math.max(d - 1, 0),
@@ -10091,7 +10096,7 @@ function _c(r) {
10091
10096
  if (S) {
10092
10097
  let { text: A } = y;
10093
10098
  typeof A == "string" ? A = A : A = Cr(b.from(A), h.schema);
10094
- const { from: M } = y, I = M + A.length, H = Uc(A);
10099
+ const { from: M } = y, I = M + A.length, H = Gc(A);
10095
10100
  return a({
10096
10101
  rule: u,
10097
10102
  state: h,
@@ -10101,7 +10106,7 @@ function _c(r) {
10101
10106
  });
10102
10107
  }
10103
10108
  const w = f.doc.content.findDiffStart(h.doc.content), v = f.doc.content.findDiffEnd(h.doc.content);
10104
- if (!(!Jc(w) || !v || w === v.b))
10109
+ if (!(!Kc(w) || !v || w === v.b))
10105
10110
  return a({
10106
10111
  rule: u,
10107
10112
  state: h,
@@ -10112,13 +10117,13 @@ function _c(r) {
10112
10117
  }
10113
10118
  }));
10114
10119
  }
10115
- function Gc(r) {
10120
+ function Xc(r) {
10116
10121
  const e = r.filter((t, n) => r.indexOf(t) !== n);
10117
10122
  return Array.from(new Set(e));
10118
10123
  }
10119
10124
  class Xe {
10120
10125
  constructor(e, t) {
10121
- this.splittableMarks = [], this.editor = t, this.extensions = Xe.resolve(e), this.schema = $c(this.extensions, t), this.setupExtensions();
10126
+ this.splittableMarks = [], this.editor = t, this.extensions = Xe.resolve(e), this.schema = Vc(this.extensions, t), this.setupExtensions();
10122
10127
  }
10123
10128
  /**
10124
10129
  * Returns a flattened and sorted extension list while
@@ -10127,7 +10132,7 @@ class Xe {
10127
10132
  * @returns An flattened and sorted array of Tiptap extensions
10128
10133
  */
10129
10134
  static resolve(e) {
10130
- const t = Xe.sort(Xe.flatten(e)), n = Gc(t.map((i) => i.name));
10135
+ const t = Xe.sort(Xe.flatten(e)), n = Xc(t.map((i) => i.name));
10131
10136
  return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
10132
10137
  }
10133
10138
  /**
@@ -10193,7 +10198,7 @@ class Xe {
10193
10198
  const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
10194
10199
  u = { ...u, ...m };
10195
10200
  }
10196
- const d = hc(u);
10201
+ const d = pc(u);
10197
10202
  a.push(d);
10198
10203
  const f = x(o, "addInputRules", l);
10199
10204
  vi(o, e.options.enableInputRules) && f && n.push(...f());
@@ -10207,11 +10212,11 @@ class Xe {
10207
10212
  return a;
10208
10213
  }).flat();
10209
10214
  return [
10210
- Hc({
10215
+ Jc({
10211
10216
  editor: e,
10212
10217
  rules: n
10213
10218
  }),
10214
- ..._c({
10219
+ ...Yc({
10215
10220
  editor: e,
10216
10221
  rules: i
10217
10222
  }),
@@ -10280,7 +10285,7 @@ class Xe {
10280
10285
  });
10281
10286
  }
10282
10287
  }
10283
- class Y {
10288
+ class G {
10284
10289
  constructor(e = {}) {
10285
10290
  this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
10286
10291
  name: this.name,
@@ -10296,7 +10301,7 @@ class Y {
10296
10301
  })) || {};
10297
10302
  }
10298
10303
  static create(e = {}) {
10299
- return new Y(e);
10304
+ return new G(e);
10300
10305
  }
10301
10306
  configure(e = {}) {
10302
10307
  const t = this.extend({
@@ -10306,7 +10311,7 @@ class Y {
10306
10311
  return t.name = this.name, t.parent = this.parent, t;
10307
10312
  }
10308
10313
  extend(e = {}) {
10309
- const t = new Y({ ...this.config, ...e });
10314
+ const t = new G({ ...this.config, ...e });
10310
10315
  return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = N(x(t, "addOptions", {
10311
10316
  name: t.name
10312
10317
  })), t.storage = N(x(t, "addStorage", {
@@ -10338,7 +10343,7 @@ function po(r, e, t) {
10338
10343
  function mo(r) {
10339
10344
  return Object.fromEntries(Object.entries(r.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
10340
10345
  }
10341
- const Yc = Y.create({
10346
+ const Zc = G.create({
10342
10347
  name: "clipboardTextSerializer",
10343
10348
  addOptions() {
10344
10349
  return {
@@ -10361,10 +10366,10 @@ const Yc = Y.create({
10361
10366
  })
10362
10367
  ];
10363
10368
  }
10364
- }), Xc = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
10369
+ }), Qc = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
10365
10370
  var t;
10366
10371
  r.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
10367
- }), !0), Zc = (r = !1) => ({ commands: e }) => e.setContent("", r), Qc = () => ({ state: r, tr: e, dispatch: t }) => {
10372
+ }), !0), eu = (r = !1) => ({ commands: e }) => e.setContent("", r), tu = () => ({ state: r, tr: e, dispatch: t }) => {
10368
10373
  const { selection: n } = e, { ranges: i } = n;
10369
10374
  return t && i.forEach(({ $from: s, $to: o }) => {
10370
10375
  r.doc.nodesBetween(s.pos, o.pos, (l, a) => {
@@ -10381,12 +10386,12 @@ const Yc = Y.create({
10381
10386
  (p || p === 0) && e.lift(h, p);
10382
10387
  });
10383
10388
  }), !0;
10384
- }, eu = (r) => (e) => r(e), tu = () => ({ state: r, dispatch: e }) => lo(r, e), nu = (r, e) => ({ editor: t, tr: n }) => {
10389
+ }, nu = (r) => (e) => r(e), ru = () => ({ state: r, dispatch: e }) => lo(r, e), iu = (r, e) => ({ editor: t, tr: n }) => {
10385
10390
  const { state: i } = t, s = i.doc.slice(r.from, r.to);
10386
10391
  n.deleteRange(r.from, r.to);
10387
10392
  const o = n.mapping.map(e);
10388
10393
  return n.insert(o, s.content), n.setSelection(new T(n.doc.resolve(o - 1))), !0;
10389
- }, ru = () => ({ tr: r, dispatch: e }) => {
10394
+ }, su = () => ({ tr: r, dispatch: e }) => {
10390
10395
  const { selection: t } = r, n = t.$anchor.node();
10391
10396
  if (n.content.size > 0)
10392
10397
  return !1;
@@ -10400,7 +10405,7 @@ const Yc = Y.create({
10400
10405
  return !0;
10401
10406
  }
10402
10407
  return !1;
10403
- }, iu = (r) => ({ tr: e, state: t, dispatch: n }) => {
10408
+ }, ou = (r) => ({ tr: e, state: t, dispatch: n }) => {
10404
10409
  const i = L(r, t.schema), s = e.selection.$anchor;
10405
10410
  for (let o = s.depth; o > 0; o -= 1)
10406
10411
  if (s.node(o).type === i) {
@@ -10411,10 +10416,10 @@ const Yc = Y.create({
10411
10416
  return !0;
10412
10417
  }
10413
10418
  return !1;
10414
- }, su = (r) => ({ tr: e, dispatch: t }) => {
10419
+ }, lu = (r) => ({ tr: e, dispatch: t }) => {
10415
10420
  const { from: n, to: i } = r;
10416
10421
  return t && e.delete(n, i), !0;
10417
- }, ou = () => ({ state: r, dispatch: e }) => yr(r, e), lu = () => ({ commands: r }) => r.keyboardShortcut("Enter"), au = () => ({ state: r, dispatch: e }) => xc(r, e);
10422
+ }, au = () => ({ state: r, dispatch: e }) => yr(r, e), cu = () => ({ commands: r }) => r.keyboardShortcut("Enter"), uu = () => ({ state: r, dispatch: e }) => Sc(r, e);
10418
10423
  function Zt(r, e, t = { strict: !0 }) {
10419
10424
  const n = Object.keys(e);
10420
10425
  return n.length ? n.every((i) => t.strict ? e[i] === r[i] : wr(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
@@ -10454,7 +10459,7 @@ function ve(r, e) {
10454
10459
  }
10455
10460
  return r;
10456
10461
  }
10457
- const cu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10462
+ const du = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10458
10463
  const s = ve(r, n.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: u } = l;
10459
10464
  if (i) {
10460
10465
  const d = Mr(a, s, e);
@@ -10464,7 +10469,7 @@ const cu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10464
10469
  }
10465
10470
  }
10466
10471
  return !0;
10467
- }, uu = (r) => (e) => {
10472
+ }, fu = (r) => (e) => {
10468
10473
  const t = typeof r == "function" ? r(e) : r;
10469
10474
  for (let n = 0; n < t.length; n += 1)
10470
10475
  if (t[n](e))
@@ -10488,7 +10493,7 @@ function bo(r, e = null) {
10488
10493
  const i = t.from, s = n.to;
10489
10494
  return e === "all" ? T.create(r, Be(0, i, s), Be(r.content.size, i, s)) : T.create(r, Be(e, i, s), Be(e, i, s));
10490
10495
  }
10491
- function du() {
10496
+ function hu() {
10492
10497
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
10493
10498
  }
10494
10499
  function Er() {
@@ -10501,13 +10506,13 @@ function Er() {
10501
10506
  "iPod"
10502
10507
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
10503
10508
  }
10504
- const fu = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
10509
+ const pu = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
10505
10510
  e = {
10506
10511
  scrollIntoView: !0,
10507
10512
  ...e
10508
10513
  };
10509
10514
  const o = () => {
10510
- (Er() || du()) && n.dom.focus(), requestAnimationFrame(() => {
10515
+ (Er() || hu()) && n.dom.focus(), requestAnimationFrame(() => {
10511
10516
  t.isDestroyed || (n.focus(), e != null && e.scrollIntoView && t.commands.scrollIntoView());
10512
10517
  });
10513
10518
  };
@@ -10517,7 +10522,7 @@ const fu = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) =>
10517
10522
  return o(), !0;
10518
10523
  const l = bo(i.doc, r) || t.state.selection, a = t.state.selection.eq(l);
10519
10524
  return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
10520
- }, hu = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), pu = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), ko = (r) => {
10525
+ }, mu = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), gu = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), ko = (r) => {
10521
10526
  const e = r.childNodes;
10522
10527
  for (let t = e.length - 1; t >= 0; t -= 1) {
10523
10528
  const n = e[t];
@@ -10578,7 +10583,7 @@ function Qt(r, e, t) {
10578
10583
  }
10579
10584
  return Qt("", e, t);
10580
10585
  }
10581
- function mu(r, e, t) {
10586
+ function yu(r, e, t) {
10582
10587
  const n = r.steps.length - 1;
10583
10588
  if (n < e)
10584
10589
  return;
@@ -10591,7 +10596,7 @@ function mu(r, e, t) {
10591
10596
  o === 0 && (o = u);
10592
10597
  }), r.setSelection(O.near(r.doc.resolve(o), t));
10593
10598
  }
10594
- const gu = (r) => !("type" in r), yu = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
10599
+ const bu = (r) => !("type" in r), ku = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
10595
10600
  var o;
10596
10601
  if (i) {
10597
10602
  t = {
@@ -10620,7 +10625,7 @@ const gu = (r) => !("type" in r), yu = (r, e, t) => ({ tr: n, dispatch: i, edito
10620
10625
  }), !1;
10621
10626
  }
10622
10627
  let { from: a, to: c } = typeof r == "number" ? { from: r, to: r } : { from: r.from, to: r.to }, u = !0, d = !0;
10623
- if ((gu(l) ? l : [l]).forEach((p) => {
10628
+ if ((bu(l) ? l : [l]).forEach((p) => {
10624
10629
  p.check(), u = u ? p.isText && p.marks.length === 0 : !1, d = d ? p.isBlock : !1;
10625
10630
  }), a === c && d) {
10626
10631
  const { parent: p } = n.doc.resolve(a);
@@ -10639,28 +10644,28 @@ const gu = (r) => !("type" in r), yu = (r, e, t) => ({ tr: n, dispatch: i, edito
10639
10644
  n.insertText(h, a, c);
10640
10645
  } else
10641
10646
  h = l, n.replaceWith(a, c, h);
10642
- t.updateSelection && mu(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: a, text: h }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: a, text: h });
10647
+ t.updateSelection && yu(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: a, text: h }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: a, text: h });
10643
10648
  }
10644
10649
  return !0;
10645
- }, bu = () => ({ state: r, dispatch: e }) => yc(r, e), ku = () => ({ state: r, dispatch: e }) => bc(r, e), xu = () => ({ state: r, dispatch: e }) => eo(r, e), Su = () => ({ state: r, dispatch: e }) => io(r, e), Cu = () => ({ state: r, dispatch: e, tr: t }) => {
10650
+ }, xu = () => ({ state: r, dispatch: e }) => bc(r, e), Su = () => ({ state: r, dispatch: e }) => kc(r, e), Cu = () => ({ state: r, dispatch: e }) => eo(r, e), wu = () => ({ state: r, dispatch: e }) => io(r, e), Mu = () => ({ state: r, dispatch: e, tr: t }) => {
10646
10651
  try {
10647
10652
  const n = nn(r.doc, r.selection.$from.pos, -1);
10648
10653
  return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
10649
10654
  } catch {
10650
10655
  return !1;
10651
10656
  }
10652
- }, wu = () => ({ state: r, dispatch: e, tr: t }) => {
10657
+ }, Eu = () => ({ state: r, dispatch: e, tr: t }) => {
10653
10658
  try {
10654
10659
  const n = nn(r.doc, r.selection.$from.pos, 1);
10655
10660
  return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
10656
10661
  } catch {
10657
10662
  return !1;
10658
10663
  }
10659
- }, Mu = () => ({ state: r, dispatch: e }) => mc(r, e), Eu = () => ({ state: r, dispatch: e }) => gc(r, e);
10664
+ }, Tu = () => ({ state: r, dispatch: e }) => gc(r, e), Ou = () => ({ state: r, dispatch: e }) => yc(r, e);
10660
10665
  function xo() {
10661
10666
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
10662
10667
  }
10663
- function Tu(r) {
10668
+ function Nu(r) {
10664
10669
  const e = r.split(/-(?!$)/);
10665
10670
  let t = e[e.length - 1];
10666
10671
  t === "Space" && (t = " ");
@@ -10682,8 +10687,8 @@ function Tu(r) {
10682
10687
  }
10683
10688
  return n && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
10684
10689
  }
10685
- const Ou = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
10686
- const s = Tu(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
10690
+ const Au = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
10691
+ const s = Nu(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
10687
10692
  key: o === "Space" ? " " : o,
10688
10693
  altKey: s.includes("Alt"),
10689
10694
  ctrlKey: s.includes("Ctrl"),
@@ -10714,13 +10719,13 @@ function wt(r, e, t = {}) {
10714
10719
  const a = i - n, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) => Zt(d.node.attrs, t, { strict: !1 }));
10715
10720
  return s ? !!c.length : c.reduce((d, f) => d + f.to - f.from, 0) >= a;
10716
10721
  }
10717
- const Nu = (r, e = {}) => ({ state: t, dispatch: n }) => {
10722
+ const vu = (r, e = {}) => ({ state: t, dispatch: n }) => {
10718
10723
  const i = L(r, t.schema);
10719
- return wt(t, i, e) ? kc(t, n) : !1;
10720
- }, Au = () => ({ state: r, dispatch: e }) => ao(r, e), vu = (r) => ({ state: e, dispatch: t }) => {
10724
+ return wt(t, i, e) ? xc(t, n) : !1;
10725
+ }, Du = () => ({ state: r, dispatch: e }) => ao(r, e), Iu = (r) => ({ state: e, dispatch: t }) => {
10721
10726
  const n = L(r, e.schema);
10722
- return Dc(n)(e, t);
10723
- }, Du = () => ({ state: r, dispatch: e }) => oo(r, e);
10727
+ return Ic(n)(e, t);
10728
+ }, Pu = () => ({ state: r, dispatch: e }) => oo(r, e);
10724
10729
  function hn(r, e) {
10725
10730
  return e.nodes[r] ? "node" : e.marks[r] ? "mark" : null;
10726
10731
  }
@@ -10728,7 +10733,7 @@ function Ii(r, e) {
10728
10733
  const t = typeof e == "string" ? [e] : e;
10729
10734
  return Object.keys(r).reduce((n, i) => (t.includes(i) || (n[i] = r[i]), n), {});
10730
10735
  }
10731
- const Iu = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
10736
+ const Ru = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
10732
10737
  let s = null, o = null;
10733
10738
  const l = hn(typeof r == "string" ? r : r.name, n.schema);
10734
10739
  return l ? (l === "node" && (s = L(r, n.schema)), l === "mark" && (o = ve(r, n.schema)), i && t.selection.ranges.forEach((a) => {
@@ -10738,13 +10743,13 @@ const Iu = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
10738
10743
  });
10739
10744
  });
10740
10745
  }), !0) : !1;
10741
- }, Pu = () => ({ tr: r, dispatch: e }) => (e && r.scrollIntoView(), !0), Ru = () => ({ tr: r, dispatch: e }) => {
10746
+ }, Bu = () => ({ tr: r, dispatch: e }) => (e && r.scrollIntoView(), !0), zu = () => ({ tr: r, dispatch: e }) => {
10742
10747
  if (e) {
10743
10748
  const t = new Z(r.doc);
10744
10749
  r.setSelection(t);
10745
10750
  }
10746
10751
  return !0;
10747
- }, Bu = () => ({ state: r, dispatch: e }) => no(r, e), zu = () => ({ state: r, dispatch: e }) => so(r, e), Fu = () => ({ state: r, dispatch: e }) => wc(r, e), Lu = () => ({ state: r, dispatch: e }) => Tc(r, e), $u = () => ({ state: r, dispatch: e }) => Ec(r, e);
10752
+ }, Fu = () => ({ state: r, dispatch: e }) => no(r, e), Lu = () => ({ state: r, dispatch: e }) => so(r, e), $u = () => ({ state: r, dispatch: e }) => Mc(r, e), Vu = () => ({ state: r, dispatch: e }) => Oc(r, e), ju = () => ({ state: r, dispatch: e }) => Tc(r, e);
10748
10753
  function er(r, e, t = {}, n = {}) {
10749
10754
  return Qt(r, e, {
10750
10755
  slice: !1,
@@ -10752,7 +10757,7 @@ function er(r, e, t = {}, n = {}) {
10752
10757
  errorOnInvalidContent: n.errorOnInvalidContent
10753
10758
  });
10754
10759
  }
10755
- const Vu = (r, e = !1, t = {}, n = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
10760
+ const Hu = (r, e = !1, t = {}, n = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
10756
10761
  var a, c;
10757
10762
  const { doc: u } = s;
10758
10763
  if (t.preserveWhitespace !== "full") {
@@ -10774,7 +10779,7 @@ function So(r, e) {
10774
10779
  const l = o.find((a) => a.type.name === t.name);
10775
10780
  return l ? { ...l.attrs } : {};
10776
10781
  }
10777
- function ju(r) {
10782
+ function Wu(r) {
10778
10783
  for (let e = 0; e < r.edgeCount; e += 1) {
10779
10784
  const { type: t } = r.edge(e);
10780
10785
  if (t.isTextblock && !t.hasRequiredAttrs())
@@ -10797,14 +10802,14 @@ function pt(r, e) {
10797
10802
  function Tr(r) {
10798
10803
  return (e) => pt(e.$from, r);
10799
10804
  }
10800
- function Hu(r, e) {
10805
+ function Ju(r, e) {
10801
10806
  const t = {
10802
10807
  from: 0,
10803
10808
  to: r.content.size
10804
10809
  };
10805
10810
  return po(r, t, e);
10806
10811
  }
10807
- function Wu(r, e) {
10812
+ function qu(r, e) {
10808
10813
  const t = L(e, r.schema), { from: n, to: i } = r.selection, s = [];
10809
10814
  r.doc.nodesBetween(n, i, (l) => {
10810
10815
  s.push(l);
@@ -10812,9 +10817,9 @@ function Wu(r, e) {
10812
10817
  const o = s.reverse().find((l) => l.type.name === t.name);
10813
10818
  return o ? { ...o.attrs } : {};
10814
10819
  }
10815
- function Ju(r, e) {
10820
+ function Ku(r, e) {
10816
10821
  const t = hn(typeof e == "string" ? e : e.name, r.schema);
10817
- return t === "node" ? Wu(r, e) : t === "mark" ? So(r, e) : {};
10822
+ return t === "node" ? qu(r, e) : t === "mark" ? So(r, e) : {};
10818
10823
  }
10819
10824
  function Lt(r, e, t) {
10820
10825
  return Object.fromEntries(Object.entries(t).filter(([n]) => {
@@ -10845,7 +10850,7 @@ function tr(r, e, t = {}) {
10845
10850
  const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Zt(d.mark.attrs, t, { strict: !1 })).reduce((d, f) => d + f.to - f.from, 0), c = l.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, f) => d + f.to - f.from, 0);
10846
10851
  return (a > 0 ? a + c : a) >= o;
10847
10852
  }
10848
- function qu(r, e, t = {}) {
10853
+ function Uu(r, e, t = {}) {
10849
10854
  if (!e)
10850
10855
  return wt(r, null, t) || tr(r, null, t);
10851
10856
  const n = hn(e, r.schema);
@@ -10884,7 +10889,7 @@ function pn(r, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
10884
10889
  }
10885
10890
  return !1;
10886
10891
  }
10887
- function Ku(r, e, t) {
10892
+ function _u(r, e, t) {
10888
10893
  var n;
10889
10894
  const { selection: i } = e;
10890
10895
  let s = null;
@@ -10906,7 +10911,7 @@ function Ku(r, e, t) {
10906
10911
  }), c;
10907
10912
  });
10908
10913
  }
10909
- const Uu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10914
+ const Gu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10910
10915
  const { selection: s } = t, { empty: o, ranges: l } = s, a = ve(r, n.schema);
10911
10916
  if (i)
10912
10917
  if (o) {
@@ -10928,26 +10933,26 @@ const Uu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
10928
10933
  }) : t.addMark(p, m, a.create(e));
10929
10934
  });
10930
10935
  });
10931
- return Ku(n, t, a);
10932
- }, _u = (r, e) => ({ tr: t }) => (t.setMeta(r, e), !0), Gu = (r, e = {}) => ({ state: t, dispatch: n, chain: i }) => {
10936
+ return _u(n, t, a);
10937
+ }, Yu = (r, e) => ({ tr: t }) => (t.setMeta(r, e), !0), Xu = (r, e = {}) => ({ state: t, dispatch: n, chain: i }) => {
10933
10938
  const s = L(r, t.schema);
10934
10939
  let o;
10935
10940
  return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => Oi(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => Oi(s, { ...o, ...e })(l, n)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
10936
- }, Yu = (r) => ({ tr: e, dispatch: t }) => {
10941
+ }, Zu = (r) => ({ tr: e, dispatch: t }) => {
10937
10942
  if (t) {
10938
10943
  const { doc: n } = e, i = Be(r, 0, n.content.size), s = C.create(n, i);
10939
10944
  e.setSelection(s);
10940
10945
  }
10941
10946
  return !0;
10942
- }, Xu = (r) => ({ tr: e, dispatch: t }) => {
10947
+ }, Qu = (r) => ({ tr: e, dispatch: t }) => {
10943
10948
  if (t) {
10944
10949
  const { doc: n } = e, { from: i, to: s } = typeof r == "number" ? { from: r, to: r } : r, o = T.atStart(n).from, l = T.atEnd(n).to, a = Be(i, o, l), c = Be(s, o, l), u = T.create(n, a, c);
10945
10950
  e.setSelection(u);
10946
10951
  }
10947
10952
  return !0;
10948
- }, Zu = (r) => ({ state: e, dispatch: t }) => {
10953
+ }, ed = (r) => ({ state: e, dispatch: t }) => {
10949
10954
  const n = L(r, e.schema);
10950
- return Rc(n)(e, t);
10955
+ return Bc(n)(e, t);
10951
10956
  };
10952
10957
  function Ri(r, e) {
10953
10958
  const t = r.storedMarks || r.selection.$to.parentOffset && r.selection.$from.marks();
@@ -10956,13 +10961,13 @@ function Ri(r, e) {
10956
10961
  r.tr.ensureMarks(n);
10957
10962
  }
10958
10963
  }
10959
- const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor: i }) => {
10964
+ const td = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor: i }) => {
10960
10965
  const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, u = Lt(c, l.node().type.name, l.node().attrs);
10961
10966
  if (s instanceof C && s.node.isBlock)
10962
10967
  return !l.parentOffset || !me(o, l.pos) ? !1 : (n && (r && Ri(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
10963
10968
  if (!l.parent.isBlock)
10964
10969
  return !1;
10965
- const d = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : ju(l.node(-1).contentMatchAt(l.indexAfter(-1)));
10970
+ const d = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Wu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
10966
10971
  let h = d && f ? [
10967
10972
  {
10968
10973
  type: f,
@@ -10982,7 +10987,7 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
10982
10987
  r && Ri(t, i.extensionManager.splittableMarks), e.scrollIntoView();
10983
10988
  }
10984
10989
  return p;
10985
- }, ed = (r, e = {}) => ({ tr: t, state: n, dispatch: i, editor: s }) => {
10990
+ }, nd = (r, e = {}) => ({ tr: t, state: n, dispatch: i, editor: s }) => {
10986
10991
  var o;
10987
10992
  const l = L(r, n.schema), { $from: a, $to: c } = n.selection, u = n.selection.node;
10988
10993
  if (u && u.isBlock || a.depth < 2 || !a.sameParent(c))
@@ -11055,7 +11060,7 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11055
11060
  return !0;
11056
11061
  const i = r.doc.nodeAt(n);
11057
11062
  return t.node.type === (i == null ? void 0 : i.type) && qe(r.doc, n) && r.join(n), !0;
11058
- }, td = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: u }) => {
11063
+ }, rd = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: u }) => {
11059
11064
  const { extensions: d, splittableMarks: f } = i.extensionManager, h = L(r, o.schema), p = L(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: S } = m, w = y.blockRange(S), v = g || m.$to.parentOffset && m.$from.marks();
11060
11065
  if (!w)
11061
11066
  return !1;
@@ -11070,17 +11075,17 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11070
11075
  const M = u().wrapInList(h, n), I = v.filter((H) => f.includes(H.type.name));
11071
11076
  return s.ensureMarks(I), M ? !0 : c.clearNodes();
11072
11077
  }).wrapInList(h, n).command(() => In(s, h)).command(() => Pn(s, h)).run();
11073
- }, nd = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
11078
+ }, id = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
11074
11079
  const { extendEmptyMarkRange: s = !1 } = t, o = ve(r, n.schema);
11075
11080
  return tr(n, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11076
- }, rd = (r, e, t = {}) => ({ state: n, commands: i }) => {
11081
+ }, sd = (r, e, t = {}) => ({ state: n, commands: i }) => {
11077
11082
  const s = L(r, n.schema), o = L(e, n.schema), l = wt(n, s, t);
11078
11083
  let a;
11079
11084
  return n.selection.$anchor.sameParent(n.selection.$head) && (a = n.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
11080
- }, id = (r, e = {}) => ({ state: t, commands: n }) => {
11085
+ }, od = (r, e = {}) => ({ state: t, commands: n }) => {
11081
11086
  const i = L(r, t.schema);
11082
11087
  return wt(t, i, e) ? n.lift(i) : n.wrapIn(i, e);
11083
- }, sd = () => ({ state: r, dispatch: e }) => {
11088
+ }, ld = () => ({ state: r, dispatch: e }) => {
11084
11089
  const t = r.plugins;
11085
11090
  for (let n = 0; n < t.length; n += 1) {
11086
11091
  const i = t[n];
@@ -11100,12 +11105,12 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11100
11105
  }
11101
11106
  }
11102
11107
  return !1;
11103
- }, od = () => ({ tr: r, dispatch: e }) => {
11108
+ }, ad = () => ({ tr: r, dispatch: e }) => {
11104
11109
  const { selection: t } = r, { empty: n, ranges: i } = t;
11105
11110
  return n || e && i.forEach((s) => {
11106
11111
  r.removeMark(s.$from.pos, s.$to.pos);
11107
11112
  }), !0;
11108
- }, ld = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
11113
+ }, cd = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
11109
11114
  var s;
11110
11115
  const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = ve(r, n.schema), { $from: c, empty: u, ranges: d } = l;
11111
11116
  if (!i)
@@ -11119,7 +11124,7 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11119
11124
  t.removeMark(f.$from.pos, f.$to.pos, a);
11120
11125
  });
11121
11126
  return t.removeStoredMark(a), !0;
11122
- }, ad = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
11127
+ }, ud = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
11123
11128
  let s = null, o = null;
11124
11129
  const l = hn(typeof r == "string" ? r : r.name, n.schema);
11125
11130
  return l ? (l === "node" && (s = L(r, n.schema)), l === "mark" && (o = ve(r, n.schema)), i && t.selection.ranges.forEach((a) => {
@@ -11150,82 +11155,82 @@ const Qu = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11150
11155
  }));
11151
11156
  }));
11152
11157
  }), !0) : !1;
11153
- }, cd = (r, e = {}) => ({ state: t, dispatch: n }) => {
11154
- const i = L(r, t.schema);
11155
- return Oc(i, e)(t, n);
11156
- }, ud = (r, e = {}) => ({ state: t, dispatch: n }) => {
11158
+ }, dd = (r, e = {}) => ({ state: t, dispatch: n }) => {
11157
11159
  const i = L(r, t.schema);
11158
11160
  return Nc(i, e)(t, n);
11161
+ }, fd = (r, e = {}) => ({ state: t, dispatch: n }) => {
11162
+ const i = L(r, t.schema);
11163
+ return Ac(i, e)(t, n);
11159
11164
  };
11160
- var dd = /* @__PURE__ */ Object.freeze({
11165
+ var hd = /* @__PURE__ */ Object.freeze({
11161
11166
  __proto__: null,
11162
- blur: Xc,
11163
- clearContent: Zc,
11164
- clearNodes: Qc,
11165
- command: eu,
11166
- createParagraphNear: tu,
11167
- cut: nu,
11168
- deleteCurrentNode: ru,
11169
- deleteNode: iu,
11170
- deleteRange: su,
11171
- deleteSelection: ou,
11172
- enter: lu,
11173
- exitCode: au,
11174
- extendMarkRange: cu,
11175
- first: uu,
11176
- focus: fu,
11177
- forEach: hu,
11178
- insertContent: pu,
11179
- insertContentAt: yu,
11180
- joinBackward: xu,
11181
- joinDown: ku,
11182
- joinForward: Su,
11183
- joinItemBackward: Cu,
11184
- joinItemForward: wu,
11185
- joinTextblockBackward: Mu,
11186
- joinTextblockForward: Eu,
11187
- joinUp: bu,
11188
- keyboardShortcut: Ou,
11189
- lift: Nu,
11190
- liftEmptyBlock: Au,
11191
- liftListItem: vu,
11192
- newlineInCode: Du,
11193
- resetAttributes: Iu,
11194
- scrollIntoView: Pu,
11195
- selectAll: Ru,
11196
- selectNodeBackward: Bu,
11197
- selectNodeForward: zu,
11198
- selectParentNode: Fu,
11199
- selectTextblockEnd: Lu,
11200
- selectTextblockStart: $u,
11201
- setContent: Vu,
11202
- setMark: Uu,
11203
- setMeta: _u,
11204
- setNode: Gu,
11205
- setNodeSelection: Yu,
11206
- setTextSelection: Xu,
11207
- sinkListItem: Zu,
11208
- splitBlock: Qu,
11209
- splitListItem: ed,
11210
- toggleList: td,
11211
- toggleMark: nd,
11212
- toggleNode: rd,
11213
- toggleWrap: id,
11214
- undoInputRule: sd,
11215
- unsetAllMarks: od,
11216
- unsetMark: ld,
11217
- updateAttributes: ad,
11218
- wrapIn: cd,
11219
- wrapInList: ud
11167
+ blur: Qc,
11168
+ clearContent: eu,
11169
+ clearNodes: tu,
11170
+ command: nu,
11171
+ createParagraphNear: ru,
11172
+ cut: iu,
11173
+ deleteCurrentNode: su,
11174
+ deleteNode: ou,
11175
+ deleteRange: lu,
11176
+ deleteSelection: au,
11177
+ enter: cu,
11178
+ exitCode: uu,
11179
+ extendMarkRange: du,
11180
+ first: fu,
11181
+ focus: pu,
11182
+ forEach: mu,
11183
+ insertContent: gu,
11184
+ insertContentAt: ku,
11185
+ joinBackward: Cu,
11186
+ joinDown: Su,
11187
+ joinForward: wu,
11188
+ joinItemBackward: Mu,
11189
+ joinItemForward: Eu,
11190
+ joinTextblockBackward: Tu,
11191
+ joinTextblockForward: Ou,
11192
+ joinUp: xu,
11193
+ keyboardShortcut: Au,
11194
+ lift: vu,
11195
+ liftEmptyBlock: Du,
11196
+ liftListItem: Iu,
11197
+ newlineInCode: Pu,
11198
+ resetAttributes: Ru,
11199
+ scrollIntoView: Bu,
11200
+ selectAll: zu,
11201
+ selectNodeBackward: Fu,
11202
+ selectNodeForward: Lu,
11203
+ selectParentNode: $u,
11204
+ selectTextblockEnd: Vu,
11205
+ selectTextblockStart: ju,
11206
+ setContent: Hu,
11207
+ setMark: Gu,
11208
+ setMeta: Yu,
11209
+ setNode: Xu,
11210
+ setNodeSelection: Zu,
11211
+ setTextSelection: Qu,
11212
+ sinkListItem: ed,
11213
+ splitBlock: td,
11214
+ splitListItem: nd,
11215
+ toggleList: rd,
11216
+ toggleMark: id,
11217
+ toggleNode: sd,
11218
+ toggleWrap: od,
11219
+ undoInputRule: ld,
11220
+ unsetAllMarks: ad,
11221
+ unsetMark: cd,
11222
+ updateAttributes: ud,
11223
+ wrapIn: dd,
11224
+ wrapInList: fd
11220
11225
  });
11221
- const fd = Y.create({
11226
+ const pd = G.create({
11222
11227
  name: "commands",
11223
11228
  addCommands() {
11224
11229
  return {
11225
- ...dd
11230
+ ...hd
11226
11231
  };
11227
11232
  }
11228
- }), hd = Y.create({
11233
+ }), md = G.create({
11229
11234
  name: "drop",
11230
11235
  addProseMirrorPlugins() {
11231
11236
  return [
@@ -11244,7 +11249,7 @@ const fd = Y.create({
11244
11249
  })
11245
11250
  ];
11246
11251
  }
11247
- }), pd = Y.create({
11252
+ }), gd = G.create({
11248
11253
  name: "editable",
11249
11254
  addProseMirrorPlugins() {
11250
11255
  return [
@@ -11256,13 +11261,13 @@ const fd = Y.create({
11256
11261
  })
11257
11262
  ];
11258
11263
  }
11259
- }), md = new le("focusEvents"), gd = Y.create({
11264
+ }), yd = new le("focusEvents"), bd = G.create({
11260
11265
  name: "focusEvents",
11261
11266
  addProseMirrorPlugins() {
11262
11267
  const { editor: r } = this;
11263
11268
  return [
11264
11269
  new Q({
11265
- key: md,
11270
+ key: yd,
11266
11271
  props: {
11267
11272
  handleDOMEvents: {
11268
11273
  focus: (e, t) => {
@@ -11280,7 +11285,7 @@ const fd = Y.create({
11280
11285
  })
11281
11286
  ];
11282
11287
  }
11283
- }), yd = Y.create({
11288
+ }), kd = G.create({
11284
11289
  name: "keymap",
11285
11290
  addKeyboardShortcuts() {
11286
11291
  const r = () => this.editor.commands.first(({ commands: o }) => [
@@ -11358,7 +11363,7 @@ const fd = Y.create({
11358
11363
  })
11359
11364
  ];
11360
11365
  }
11361
- }), bd = Y.create({
11366
+ }), xd = G.create({
11362
11367
  name: "paste",
11363
11368
  addProseMirrorPlugins() {
11364
11369
  return [
@@ -11376,7 +11381,7 @@ const fd = Y.create({
11376
11381
  })
11377
11382
  ];
11378
11383
  }
11379
- }), kd = Y.create({
11384
+ }), Sd = G.create({
11380
11385
  name: "tabindex",
11381
11386
  addProseMirrorPlugins() {
11382
11387
  return [
@@ -11512,7 +11517,7 @@ class Ie {
11512
11517
  }), this.editor.view.dispatch(t);
11513
11518
  }
11514
11519
  }
11515
- const xd = `.ProseMirror {
11520
+ const Cd = `.ProseMirror {
11516
11521
  position: relative;
11517
11522
  }
11518
11523
 
@@ -11587,14 +11592,14 @@ img.ProseMirror-separator {
11587
11592
  .tippy-box[data-animation=fade][data-state=hidden] {
11588
11593
  opacity: 0
11589
11594
  }`;
11590
- function Sd(r, e, t) {
11595
+ function wd(r, e, t) {
11591
11596
  const n = document.querySelector("style[data-tiptap-style]");
11592
11597
  if (n !== null)
11593
11598
  return n;
11594
11599
  const i = document.createElement("style");
11595
11600
  return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = r, document.getElementsByTagName("head")[0].appendChild(i), i;
11596
11601
  }
11597
- class Cd extends Bc {
11602
+ class Md extends zc {
11598
11603
  constructor(e = {}) {
11599
11604
  super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
11600
11605
  element: document.createElement("div"),
@@ -11656,7 +11661,7 @@ class Cd extends Bc {
11656
11661
  * Inject CSS styles.
11657
11662
  */
11658
11663
  injectCSS() {
11659
- this.options.injectCSS && document && (this.css = Sd(xd, this.options.injectNonce));
11664
+ this.options.injectCSS && document && (this.css = wd(Cd, this.options.injectNonce));
11660
11665
  }
11661
11666
  /**
11662
11667
  * Update editor options.
@@ -11725,16 +11730,16 @@ class Cd extends Bc {
11725
11730
  createExtensionManager() {
11726
11731
  var e, t;
11727
11732
  const i = [...this.options.enableCoreExtensions ? [
11728
- pd,
11729
- Yc.configure({
11733
+ gd,
11734
+ Zc.configure({
11730
11735
  blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
11731
11736
  }),
11732
- fd,
11733
- gd,
11734
- yd,
11737
+ pd,
11738
+ bd,
11735
11739
  kd,
11736
- hd,
11737
- bd
11740
+ Sd,
11741
+ md,
11742
+ xd
11738
11743
  ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
11739
11744
  this.extensionManager = new Xe(i, this);
11740
11745
  }
@@ -11772,7 +11777,7 @@ class Cd extends Bc {
11772
11777
  }), t = er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
11773
11778
  }
11774
11779
  const n = bo(t, this.options.autofocus);
11775
- this.view = new ic(this.options.element, {
11780
+ this.view = new sc(this.options.element, {
11776
11781
  ...this.options.editorProps,
11777
11782
  attributes: {
11778
11783
  // add `role="textbox"` to the editor element
@@ -11860,11 +11865,11 @@ class Cd extends Bc {
11860
11865
  * Get attributes of the currently selected node or mark.
11861
11866
  */
11862
11867
  getAttributes(e) {
11863
- return Ju(this.state, e);
11868
+ return Ku(this.state, e);
11864
11869
  }
11865
11870
  isActive(e, t) {
11866
11871
  const n = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
11867
- return qu(this.state, n, i);
11872
+ return Uu(this.state, n, i);
11868
11873
  }
11869
11874
  /**
11870
11875
  * Get the document as JSON.
@@ -11885,7 +11890,7 @@ class Cd extends Bc {
11885
11890
  const { blockSeparator: t = `
11886
11891
 
11887
11892
  `, textSerializers: n = {} } = e || {};
11888
- return Hu(this.state.doc, {
11893
+ return Ju(this.state.doc, {
11889
11894
  blockSeparator: t,
11890
11895
  textSerializers: {
11891
11896
  ...mo(this.schema),
@@ -11940,6 +11945,22 @@ class Cd extends Bc {
11940
11945
  return this.$pos(0);
11941
11946
  }
11942
11947
  }
11948
+ function Co(r) {
11949
+ return new Hc({
11950
+ find: r.find,
11951
+ handler: ({ state: e, range: t, match: n }) => {
11952
+ let i = r.replace, s = t.from;
11953
+ const o = t.to;
11954
+ if (n[1]) {
11955
+ const l = n[0].lastIndexOf(n[1]);
11956
+ i += n[0].slice(l + n[1].length), s += l;
11957
+ const a = s - o;
11958
+ a > 0 && (i = n[0].slice(l - a, l) + i, s = o);
11959
+ }
11960
+ e.tr.insertText(i, s, o);
11961
+ }
11962
+ });
11963
+ }
11943
11964
  let Or = class nr {
11944
11965
  constructor(e = {}) {
11945
11966
  this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
@@ -11984,7 +12005,7 @@ F.prototype.prepend = function(e) {
11984
12005
  return e.length ? F.from(e).append(this) : this;
11985
12006
  };
11986
12007
  F.prototype.appendInner = function(e) {
11987
- return new wd(this, e);
12008
+ return new Ed(this, e);
11988
12009
  };
11989
12010
  F.prototype.slice = function(e, t) {
11990
12011
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? F.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -12004,9 +12025,9 @@ F.prototype.map = function(e, t, n) {
12004
12025
  }, t, n), i;
12005
12026
  };
12006
12027
  F.from = function(e) {
12007
- return e instanceof F ? e : e && e.length ? new Co(e) : F.empty;
12028
+ return e instanceof F ? e : e && e.length ? new wo(e) : F.empty;
12008
12029
  };
12009
- var Co = /* @__PURE__ */ function(r) {
12030
+ var wo = /* @__PURE__ */ function(r) {
12010
12031
  function e(n) {
12011
12032
  r.call(this), this.values = n;
12012
12033
  }
@@ -12038,8 +12059,8 @@ var Co = /* @__PURE__ */ function(r) {
12038
12059
  return 0;
12039
12060
  }, Object.defineProperties(e.prototype, t), e;
12040
12061
  }(F);
12041
- F.empty = new Co([]);
12042
- var wd = /* @__PURE__ */ function(r) {
12062
+ F.empty = new wo([]);
12063
+ var Ed = /* @__PURE__ */ function(r) {
12043
12064
  function e(t, n) {
12044
12065
  r.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
12045
12066
  }
@@ -12072,7 +12093,7 @@ var wd = /* @__PURE__ */ function(r) {
12072
12093
  return this.left.depth >= Math.max(this.right.depth, n.depth) + 1 ? new e(this.left, new e(this.right, n)) : new e(this, n);
12073
12094
  }, e;
12074
12095
  }(F);
12075
- const Md = 500;
12096
+ const Td = 500;
12076
12097
  class se {
12077
12098
  constructor(e, t) {
12078
12099
  this.items = e, this.eventCount = t;
@@ -12114,7 +12135,7 @@ class se {
12114
12135
  (h = a && a.merge(f)) && (f = h, u ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
12115
12136
  }
12116
12137
  let c = o - n.depth;
12117
- return c > Td && (l = Ed(l, c), o -= c), new se(l.append(s), o);
12138
+ return c > Nd && (l = Od(l, c), o -= c), new se(l.append(s), o);
12118
12139
  }
12119
12140
  remapping(e, t) {
12120
12141
  let n = new yt();
@@ -12154,7 +12175,7 @@ class se {
12154
12175
  for (let f = t; f < o; f++)
12155
12176
  c.push(new ae(s.maps[f]));
12156
12177
  let u = this.items.slice(0, i).append(c).append(n), d = new se(u, l);
12157
- return d.emptyItemCount() > Md && (d = d.compress(this.items.length - n.length)), d;
12178
+ return d.emptyItemCount() > Td && (d = d.compress(this.items.length - n.length)), d;
12158
12179
  }
12159
12180
  emptyItemCount() {
12160
12181
  let e = 0;
@@ -12186,7 +12207,7 @@ class se {
12186
12207
  }
12187
12208
  }
12188
12209
  se.empty = new se(F.empty, 0);
12189
- function Ed(r, e) {
12210
+ function Od(r, e) {
12190
12211
  let t;
12191
12212
  return r.forEach((n, i) => {
12192
12213
  if (n.selection && e-- == 0)
@@ -12210,23 +12231,23 @@ class ke {
12210
12231
  this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = i, this.prevComposition = s;
12211
12232
  }
12212
12233
  }
12213
- const Td = 20;
12214
- function Od(r, e, t, n) {
12234
+ const Nd = 20;
12235
+ function Ad(r, e, t, n) {
12215
12236
  let i = t.getMeta(Ve), s;
12216
12237
  if (i)
12217
12238
  return i.historyState;
12218
- t.getMeta(vd) && (r = new ke(r.done, r.undone, null, 0, -1));
12239
+ t.getMeta(Id) && (r = new ke(r.done, r.undone, null, 0, -1));
12219
12240
  let o = t.getMeta("appendedTransaction");
12220
12241
  if (t.steps.length == 0)
12221
12242
  return r;
12222
12243
  if (o && o.getMeta(Ve))
12223
12244
  return o.getMeta(Ve).redo ? new ke(r.done.addTransform(t, void 0, n, $t(e)), r.undone, Bi(t.mapping.maps), r.prevTime, r.prevComposition) : new ke(r.done, r.undone.addTransform(t, void 0, n, $t(e)), null, r.prevTime, r.prevComposition);
12224
12245
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
12225
- let l = t.getMeta("composition"), a = r.prevTime == 0 || !o && r.prevComposition != l && (r.prevTime < (t.time || 0) - n.newGroupDelay || !Nd(t, r.prevRanges)), c = o ? Rn(r.prevRanges, t.mapping) : Bi(t.mapping.maps);
12246
+ let l = t.getMeta("composition"), a = r.prevTime == 0 || !o && r.prevComposition != l && (r.prevTime < (t.time || 0) - n.newGroupDelay || !vd(t, r.prevRanges)), c = o ? Rn(r.prevRanges, t.mapping) : Bi(t.mapping.maps);
12226
12247
  return new ke(r.done.addTransform(t, a ? e.selection.getBookmark() : void 0, n, $t(e)), se.empty, c, t.time, l ?? r.prevComposition);
12227
12248
  } else return (s = t.getMeta("rebased")) ? new ke(r.done.rebased(t, s), r.undone.rebased(t, s), Rn(r.prevRanges, t.mapping), r.prevTime, r.prevComposition) : new ke(r.done.addMaps(t.mapping.maps), r.undone.addMaps(t.mapping.maps), Rn(r.prevRanges, t.mapping), r.prevTime, r.prevComposition);
12228
12249
  }
12229
- function Nd(r, e) {
12250
+ function vd(r, e) {
12230
12251
  if (!e)
12231
12252
  return !1;
12232
12253
  if (!r.docChanged)
@@ -12253,7 +12274,7 @@ function Rn(r, e) {
12253
12274
  }
12254
12275
  return t;
12255
12276
  }
12256
- function Ad(r, e, t) {
12277
+ function Dd(r, e, t) {
12257
12278
  let n = $t(e), i = Ve.get(e).spec.config, s = (t ? r.undone : r.done).popEvent(e, n);
12258
12279
  if (!s)
12259
12280
  return null;
@@ -12273,8 +12294,8 @@ function $t(r) {
12273
12294
  }
12274
12295
  return Bn;
12275
12296
  }
12276
- const Ve = new le("history"), vd = new le("closeHistory");
12277
- function Dd(r = {}) {
12297
+ const Ve = new le("history"), Id = new le("closeHistory");
12298
+ function Pd(r = {}) {
12278
12299
  return r = {
12279
12300
  depth: r.depth || 100,
12280
12301
  newGroupDelay: r.newGroupDelay || 500
@@ -12285,33 +12306,33 @@ function Dd(r = {}) {
12285
12306
  return new ke(se.empty, se.empty, null, 0, -1);
12286
12307
  },
12287
12308
  apply(e, t, n) {
12288
- return Od(t, n, e, r);
12309
+ return Ad(t, n, e, r);
12289
12310
  }
12290
12311
  },
12291
12312
  config: r,
12292
12313
  props: {
12293
12314
  handleDOMEvents: {
12294
12315
  beforeinput(e, t) {
12295
- let n = t.inputType, i = n == "historyUndo" ? Mo : n == "historyRedo" ? Eo : null;
12316
+ let n = t.inputType, i = n == "historyUndo" ? Eo : n == "historyRedo" ? To : null;
12296
12317
  return i ? (t.preventDefault(), i(e.state, e.dispatch)) : !1;
12297
12318
  }
12298
12319
  }
12299
12320
  }
12300
12321
  });
12301
12322
  }
12302
- function wo(r, e) {
12323
+ function Mo(r, e) {
12303
12324
  return (t, n) => {
12304
12325
  let i = Ve.getState(t);
12305
12326
  if (!i || (r ? i.undone : i.done).eventCount == 0)
12306
12327
  return !1;
12307
12328
  if (n) {
12308
- let s = Ad(i, t, r);
12329
+ let s = Dd(i, t, r);
12309
12330
  s && n(e ? s.scrollIntoView() : s);
12310
12331
  }
12311
12332
  return !0;
12312
12333
  };
12313
12334
  }
12314
- const Mo = wo(!1, !0), Eo = wo(!0, !0), Id = Y.create({
12335
+ const Eo = Mo(!1, !0), To = Mo(!0, !0), Rd = G.create({
12315
12336
  name: "history",
12316
12337
  addOptions() {
12317
12338
  return {
@@ -12321,13 +12342,13 @@ const Mo = wo(!1, !0), Eo = wo(!0, !0), Id = Y.create({
12321
12342
  },
12322
12343
  addCommands() {
12323
12344
  return {
12324
- undo: () => ({ state: r, dispatch: e }) => Mo(r, e),
12325
- redo: () => ({ state: r, dispatch: e }) => Eo(r, e)
12345
+ undo: () => ({ state: r, dispatch: e }) => Eo(r, e),
12346
+ redo: () => ({ state: r, dispatch: e }) => To(r, e)
12326
12347
  };
12327
12348
  },
12328
12349
  addProseMirrorPlugins() {
12329
12350
  return [
12330
- Dd(this.options)
12351
+ Pd(this.options)
12331
12352
  ];
12332
12353
  },
12333
12354
  addKeyboardShortcuts() {
@@ -12340,7 +12361,7 @@ const Mo = wo(!1, !0), Eo = wo(!0, !0), Id = Y.create({
12340
12361
  "Shift-Mod-я": () => this.editor.commands.redo()
12341
12362
  };
12342
12363
  }
12343
- }), Pd = Y.create({
12364
+ }), Bd = G.create({
12344
12365
  name: "placeholder",
12345
12366
  addOptions() {
12346
12367
  return {
@@ -12387,7 +12408,7 @@ const Mo = wo(!1, !0), Eo = wo(!0, !0), Id = Y.create({
12387
12408
  }
12388
12409
  });
12389
12410
  function Fi(r) {
12390
- const t = r.state.doc.toJSON(), n = new Rd(r);
12411
+ const t = r.state.doc.toJSON(), n = new zd(r);
12391
12412
  let i = [];
12392
12413
  return t.content.forEach((s) => {
12393
12414
  i.push(n.serialize(s));
@@ -12397,7 +12418,7 @@ function Fi(r) {
12397
12418
  function Li(r, e) {
12398
12419
  return r.type === e.type && JSON.stringify(r.attrs) === JSON.stringify(e.attrs);
12399
12420
  }
12400
- class Rd {
12421
+ class zd {
12401
12422
  constructor(e) {
12402
12423
  this.editor = e, this.openMarks = [];
12403
12424
  }
@@ -12428,14 +12449,14 @@ class Rd {
12428
12449
  }), this.openMarks = [], e;
12429
12450
  }
12430
12451
  }
12431
- const Bd = Or.create({
12452
+ const Fd = Or.create({
12432
12453
  name: "doc",
12433
12454
  topNode: !0,
12434
12455
  content: "block+"
12435
- }), zd = Or.create({
12456
+ }), Ld = Or.create({
12436
12457
  name: "text",
12437
12458
  group: "inline"
12438
- }), Fd = Ct.create({
12459
+ }), $d = Ct.create({
12439
12460
  name: "inline",
12440
12461
  addOptions() {
12441
12462
  return {
@@ -12531,7 +12552,7 @@ const Bd = Or.create({
12531
12552
  [`lift${r}`]: () => ({ commands: e, attributes: t }) => e.lift(this.name, t)
12532
12553
  };
12533
12554
  }
12534
- }), Ld = mn.extend({
12555
+ }), Vd = mn.extend({
12535
12556
  name: "list",
12536
12557
  content: "head? item+",
12537
12558
  group: "block",
@@ -12565,7 +12586,7 @@ const Bd = Or.create({
12565
12586
  r[e] = () => this.editor.commands[`toggle${n}`](this.name);
12566
12587
  }), r;
12567
12588
  }
12568
- }), $d = mn.extend({
12589
+ }), jd = mn.extend({
12569
12590
  name: "item",
12570
12591
  content: "p block*",
12571
12592
  group: "item",
@@ -12582,10 +12603,10 @@ const Bd = Or.create({
12582
12603
  };
12583
12604
  }
12584
12605
  });
12585
- function Vd(r) {
12606
+ function Hd(r) {
12586
12607
  return Object.entries(r || {}).map(([e, t]) => `${e}="${t}"`).join(" ");
12587
12608
  }
12588
- const To = mn.extend({
12609
+ const Oo = mn.extend({
12589
12610
  name: "emptyElement",
12590
12611
  group: "inline",
12591
12612
  content: "",
@@ -12618,7 +12639,7 @@ const To = mn.extend({
12618
12639
  if (t.type !== r.type)
12619
12640
  return !1;
12620
12641
  r.attrs = t.attrs;
12621
- const n = Vd(t.attrs);
12642
+ const n = Hd(t.attrs);
12622
12643
  return n && e.setAttribute("data-tooltip", n), Object.entries(r.attrs).forEach(([i, s]) => {
12623
12644
  s ? e.setAttribute(i, s) : e.removeAttribute(i);
12624
12645
  }), !0;
@@ -12641,7 +12662,7 @@ function $i() {
12641
12662
  return `fn-${r}-${e}`;
12642
12663
  }
12643
12664
  const rr = /* @__PURE__ */ new Map();
12644
- function jd(r) {
12665
+ function Wd(r) {
12645
12666
  const e = [];
12646
12667
  return r.nodesBetween(0, r.content.size, (t, n) => {
12647
12668
  t.type.name === "anchor" && e.push({ node: t, pos: n });
@@ -12653,7 +12674,7 @@ function jd(r) {
12653
12674
  function Mt(r) {
12654
12675
  return rr.get(r) || -1;
12655
12676
  }
12656
- function Hd(r, e) {
12677
+ function Jd(r, e) {
12657
12678
  return e.nodesBetween(0, e.content.size, (t, n) => {
12658
12679
  if (t.type.name === "note") {
12659
12680
  const i = t.attrs.target;
@@ -12668,7 +12689,7 @@ function Hd(r, e) {
12668
12689
  }
12669
12690
  }), r;
12670
12691
  }
12671
- function Wd(r, e, t = null) {
12692
+ function qd(r, e, t = null) {
12672
12693
  let n = null;
12673
12694
  if (e.descendants((c, u) => {
12674
12695
  if (c.type.name === "noteGrp")
@@ -12706,7 +12727,7 @@ function Wd(r, e, t = null) {
12706
12727
  }
12707
12728
  return r;
12708
12729
  }
12709
- function Jd(r, e) {
12730
+ function Kd(r, e) {
12710
12731
  const t = Date.now();
12711
12732
  return e.nodesBetween(0, e.content.size, (n, i) => {
12712
12733
  if (n.type.name === "anchor") {
@@ -12720,7 +12741,7 @@ function Jd(r, e) {
12720
12741
  }
12721
12742
  }), r;
12722
12743
  }
12723
- const qd = To.extend({
12744
+ const Ud = Oo.extend({
12724
12745
  name: "anchor",
12725
12746
  group: "inline",
12726
12747
  content: "",
@@ -12801,7 +12822,7 @@ const qd = To.extend({
12801
12822
  };
12802
12823
  };
12803
12824
  }
12804
- }), Kd = Y.create({
12825
+ }), _d = G.create({
12805
12826
  name: "footnoteRules",
12806
12827
  priority: 1e3,
12807
12828
  addProseMirrorPlugins() {
@@ -12866,29 +12887,29 @@ const qd = To.extend({
12866
12887
  h + 1
12867
12888
  )));
12868
12889
  }
12869
- return s && (jd(n.doc), n = Jd(n, n.doc), n = Hd(n, n.doc), n = Wd(n, n.doc, i)), n;
12890
+ return s && (Wd(n.doc), n = Kd(n, n.doc), n = Jd(n, n.doc), n = qd(n, n.doc, i)), n;
12870
12891
  }
12871
12892
  })
12872
12893
  ];
12873
12894
  }
12874
12895
  });
12875
- function Ud(r) {
12896
+ function Gd(r) {
12876
12897
  const e = [
12877
- _d,
12878
- zd
12898
+ Yd,
12899
+ Ld
12879
12900
  ];
12880
12901
  return Object.entries(r.schema).forEach(([t, n]) => {
12881
12902
  let i;
12882
- n.type === "inline" ? i = Fd.extend({
12903
+ n.type === "inline" ? i = $d.extend({
12883
12904
  name: t
12884
- }) : n.type === "anchor" ? i = qd.extend({
12905
+ }) : n.type === "anchor" ? i = Ud.extend({
12885
12906
  name: t
12886
- }) : n.type === "empty" ? i = To.extend({
12907
+ }) : n.type === "empty" ? i = Oo.extend({
12887
12908
  name: t
12888
- }) : n.type === "list" ? i = Ld.extend({
12909
+ }) : n.type === "list" ? i = Vd.extend({
12889
12910
  name: t,
12890
12911
  content: n.content || "item+"
12891
- }) : n.type === "listItem" ? i = $d.extend({
12912
+ }) : n.type === "listItem" ? i = jd.extend({
12892
12913
  name: t,
12893
12914
  content: n.content || "p block*"
12894
12915
  }) : n.type === "block" && (i = mn.extend({
@@ -12908,10 +12929,24 @@ function Ud(r) {
12908
12929
  }));
12909
12930
  }), e;
12910
12931
  }
12911
- const _d = Bd.extend({
12932
+ const Yd = Fd.extend({
12912
12933
  content: "block+ noteGrp?"
12934
+ }), Xd = Co({
12935
+ find: /---|–-/,
12936
+ replace: "—"
12937
+ }), Zd = Co({
12938
+ find: /--(?!-)/,
12939
+ replace: "–"
12940
+ }), Qd = G.create({
12941
+ name: "inputRules",
12942
+ addInputRules() {
12943
+ return [
12944
+ Xd,
12945
+ Zd
12946
+ ];
12947
+ }
12913
12948
  });
12914
- function Oo(r, e, t) {
12949
+ function No(r, e, t) {
12915
12950
  let n = null;
12916
12951
  return r.state.doc.nodesBetween(e, t, (i, s, o, l) => {
12917
12952
  i.isText && (n == null ? n = i.marks.map((a) => ({ mark: a, pos: s })) : n = n.filter((a) => i.marks.find((c) => c.type.name === a.mark.type.name)));
@@ -12923,7 +12958,7 @@ function Oo(r, e, t) {
12923
12958
  return (((o = s.text) == null ? void 0 : o.length) || 0) - (((l = i.text) == null ? void 0 : l.length) || 0);
12924
12959
  })), n;
12925
12960
  }
12926
- function Gd(r, e = []) {
12961
+ function ef(r, e = []) {
12927
12962
  const t = {}, n = [];
12928
12963
  return r.state.doc.nodesBetween(0, r.state.doc.content.size, (i, s) => {
12929
12964
  i.isText && e.forEach((o) => {
@@ -12937,11 +12972,11 @@ function Gd(r, e = []) {
12937
12972
  });
12938
12973
  }), t;
12939
12974
  }
12940
- function Yd(r) {
12975
+ function tf(r) {
12941
12976
  const t = new DOMParser().parseFromString(r, "application/xml"), n = t.querySelector("parsererror");
12942
12977
  return n ? (console.error("XML Parsing Error:", n.textContent), null) : t;
12943
12978
  }
12944
- function Xd(r) {
12979
+ function nf(r) {
12945
12980
  if (!r) return "";
12946
12981
  const e = [], t = r.querySelectorAll("text > body > *"), n = (i) => {
12947
12982
  if (i.nodeType === Node.ELEMENT_NODE) {
@@ -12959,11 +12994,11 @@ function Xd(r) {
12959
12994
  e.push(s.outerHTML);
12960
12995
  }), e.join("");
12961
12996
  }
12962
- function Zd(r) {
12963
- const e = Yd(r);
12964
- return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? Xd(e) : xml;
12997
+ function rf(r) {
12998
+ const e = tf(r);
12999
+ return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? nf(e) : xml;
12965
13000
  }
12966
- function Qd(r, e, t, n = 3) {
13001
+ function sf(r, e, t, n = 3) {
12967
13002
  let i = e - 1, s = 0;
12968
13003
  for (; i >= 0; ) {
12969
13004
  if (/[\p{P}\s]/.test(r.charAt(i))) {
@@ -12986,7 +13021,7 @@ function Qd(r, e, t, n = 3) {
12986
13021
  }
12987
13022
  return `&#8230; ${r.substring(i, e)}<mark>${r.substring(e, t)}</mark>${r.substring(t, o + 1)} &#8230;`;
12988
13023
  }
12989
- class ef {
13024
+ class of {
12990
13025
  constructor(e, t) {
12991
13026
  this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
12992
13027
  }
@@ -13001,7 +13036,7 @@ class ef {
13001
13036
  }
13002
13037
  updatePanelForCurrentPosition(e) {
13003
13038
  var l;
13004
- const { from: t, to: n } = e.state.selection, i = Oo(e, t, n);
13039
+ const { from: t, to: n } = e.state.selection, i = No(e, t, n);
13005
13040
  if (i && i.length > 0) {
13006
13041
  this.currentElement = null;
13007
13042
  const a = i[i.length - 1];
@@ -13103,7 +13138,7 @@ class ef {
13103
13138
  this.editor.chain().focus().extendMarkRange(e.type).run(), i.length > 0 && this.editor.commands.resetAttributes(e.type, i), Object.keys(t).length > 0 && this.editor.chain().focus().updateAttributes(e.type, t).setTextSelection({ from: s, to: o }).run();
13104
13139
  }
13105
13140
  updateOccurrences(e, t, n) {
13106
- const i = Gd(e, n), s = document.createElement("div");
13141
+ const i = ef(e, n), s = document.createElement("div");
13107
13142
  s.classList.add("occurrences"), s.innerHTML = `
13108
13143
  <h5>Other Occurrences
13109
13144
  <div role="group">
@@ -13131,7 +13166,7 @@ class ef {
13131
13166
  to: d.pos + d.index + d.length,
13132
13167
  hasMark: m
13133
13168
  });
13134
- const w = e.state.doc.textBetween(d.pos, f.end()), v = Qd(w, d.index, d.index + d.length), A = document.createElement("span");
13169
+ const w = e.state.doc.textBetween(d.pos, f.end()), v = sf(w, d.index, d.index + d.length), A = document.createElement("span");
13135
13170
  A.innerHTML = v, y.appendChild(A), g.appendChild(y), o.appendChild(g), y.addEventListener("mouseenter", (M) => {
13136
13171
  M.preventDefault(), M.stopPropagation();
13137
13172
  const I = e.view.nodeDOM(d.pos);
@@ -13163,7 +13198,7 @@ class ef {
13163
13198
  });
13164
13199
  }
13165
13200
  }
13166
- class tf {
13201
+ class lf {
13167
13202
  constructor(e, t) {
13168
13203
  this.editor = e.tiptap, this.attributePanel = t, this.panel = e.querySelector(".navigation-panel"), this.setupEventListeners();
13169
13204
  }
@@ -13177,7 +13212,7 @@ class tf {
13177
13212
  const { from: t, to: n } = e.state.selection, i = e.state.doc.nodeAt(t), s = [];
13178
13213
  let o;
13179
13214
  if (i) {
13180
- i.isText && (o = Oo(e, t, n));
13215
+ i.isText && (o = No(e, t, n));
13181
13216
  let a = t, c = e.state.doc.resolve(a).depth;
13182
13217
  const u = e.state.doc.resolve(a);
13183
13218
  for (; c > 0; ) {
@@ -13207,7 +13242,7 @@ class tf {
13207
13242
  }), this.panel.appendChild(l);
13208
13243
  }
13209
13244
  }
13210
- class nf {
13245
+ class af {
13211
13246
  /**
13212
13247
  * Create a new Toolbar instance.
13213
13248
  *
@@ -13330,7 +13365,7 @@ class nf {
13330
13365
  }), e.querySelector("ul").appendChild(o);
13331
13366
  }
13332
13367
  }
13333
- function rf(r) {
13368
+ function cf(r) {
13334
13369
  const e = "#E48500", t = {}, n = [], i = (u) => {
13335
13370
  let d = parseInt(u.substring(1, 3), 16) / 255, f = parseInt(u.substring(3, 5), 16) / 255, h = parseInt(u.substring(5, 7), 16) / 255, p = Math.max(d, f, h), m = Math.min(d, f, h), g, y, S = (p + m) / 2;
13336
13371
  if (p === m)
@@ -13382,14 +13417,14 @@ function rf(r) {
13382
13417
  `)}
13383
13418
  `;
13384
13419
  }
13385
- const sf = {
13420
+ const uf = {
13386
13421
  rend: {
13387
13422
  type: "string"
13388
13423
  },
13389
13424
  id: {
13390
13425
  type: "string"
13391
13426
  }
13392
- }, of = {
13427
+ }, df = {
13393
13428
  div: {
13394
13429
  type: "block",
13395
13430
  defining: !0,
@@ -13820,8 +13855,8 @@ const sf = {
13820
13855
  }
13821
13856
  }
13822
13857
  }, Vt = {
13823
- attributes: sf,
13824
- schema: of
13858
+ attributes: uf,
13859
+ schema: df
13825
13860
  }, ir = document.createElement("style");
13826
13861
  ir.textContent = `
13827
13862
  jinn-tap {
@@ -13908,10 +13943,10 @@ ir.textContent = `
13908
13943
  border-radius: 5px;
13909
13944
  }
13910
13945
 
13911
- ${rf(Vt)}
13946
+ ${cf(Vt)}
13912
13947
  `;
13913
13948
  document.querySelector("#jinn-tap-styles") || (ir.id = "jinn-tap-styles", document.head.appendChild(ir));
13914
- class lf extends HTMLElement {
13949
+ class ff extends HTMLElement {
13915
13950
  static get observedAttributes() {
13916
13951
  return ["debug", "url"];
13917
13952
  }
@@ -13926,7 +13961,7 @@ class lf extends HTMLElement {
13926
13961
  const t = await fetch(e);
13927
13962
  if (!t.ok)
13928
13963
  throw new Error(`HTTP error! status: ${t.status}`);
13929
- const n = await t.text(), i = Zd(n);
13964
+ const n = await t.text(), i = rf(n);
13930
13965
  this.editor ? this.content = i : this._pendingContent = i;
13931
13966
  } catch (t) {
13932
13967
  console.error("Error loading content from URL:", t), this.dispatchEvent(new CustomEvent("error", {
@@ -13952,14 +13987,15 @@ class lf extends HTMLElement {
13952
13987
  <div class="attribute-panel"></div>
13953
13988
  </div>
13954
13989
  `, this.applySlots(e);
13955
- const t = e.innerHTML.trim(), n = Ud(Vt);
13956
- this.editor = new Cd({
13990
+ const t = e.innerHTML.trim(), n = Gd(Vt);
13991
+ this.editor = new Md({
13957
13992
  element: this.querySelector(".editor-area"),
13958
13993
  extensions: [
13959
13994
  ...n,
13960
- Kd,
13961
- Id,
13962
- Pd.configure({
13995
+ Qd,
13996
+ _d,
13997
+ Rd,
13998
+ Bd.configure({
13963
13999
  placeholder: "Write something...",
13964
14000
  includeChildren: !0
13965
14001
  })
@@ -13974,7 +14010,7 @@ class lf extends HTMLElement {
13974
14010
  this.dispatchContentChange(), this.dispatchEvent(new CustomEvent("ready"));
13975
14011
  },
13976
14012
  onUpdate: () => this.dispatchContentChange()
13977
- }), this.toolbar = new nf(this, Vt), this.attributePanel = new ef(this, Vt), this.navigationPanel = new tf(this, this.attributePanel);
14013
+ }), this.toolbar = new af(this, Vt), this.attributePanel = new of(this, Vt), this.navigationPanel = new lf(this, this.attributePanel);
13978
14014
  const i = this.getAttribute("url");
13979
14015
  i && this.loadFromUrl(i);
13980
14016
  }
@@ -14021,8 +14057,8 @@ class lf extends HTMLElement {
14021
14057
  return t.forEach((n) => n.remove()), e;
14022
14058
  }
14023
14059
  }
14024
- customElements.define("jinn-tap", lf);
14060
+ customElements.define("jinn-tap", ff);
14025
14061
  export {
14026
- lf as JinnTap
14062
+ ff as JinnTap
14027
14063
  };
14028
14064
  //# sourceMappingURL=jinn-tap.es.js.map