@alxgrn/prose-editor 0.0.30 → 0.0.32

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.
@@ -58,7 +58,7 @@ function Kf() {
58
58
  return b.$$typeof === br ? null : b.displayName || b.name || null;
59
59
  if (typeof b == "string") return b;
60
60
  switch (b) {
61
- case S:
61
+ case C:
62
62
  return "Fragment";
63
63
  case v:
64
64
  return "Portal";
@@ -322,7 +322,7 @@ function Kf() {
322
322
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
323
323
  )), b = this.props.ref, b !== void 0 ? b : null;
324
324
  }
325
- function p(b, A, R, L, le, K) {
325
+ function h(b, A, R, L, le, K) {
326
326
  return R = K.ref, b = {
327
327
  $$typeof: O,
328
328
  type: b,
@@ -344,8 +344,8 @@ function Kf() {
344
344
  value: null
345
345
  }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
346
346
  }
347
- function h(b, A, R, L, le, K) {
348
- if (typeof b == "string" || typeof b == "function" || b === S || b === j || b === $ || b === dt || b === Ee || b === on || typeof b == "object" && b !== null && (b.$$typeof === $t || b.$$typeof === $e || b.$$typeof === _ || b.$$typeof === E || b.$$typeof === Se || b.$$typeof === Rf || b.getModuleId !== void 0)) {
347
+ function p(b, A, R, L, le, K) {
348
+ if (typeof b == "string" || typeof b == "function" || b === C || b === j || b === $ || b === dt || b === Ee || b === on || typeof b == "object" && b !== null && (b.$$typeof === $t || b.$$typeof === $e || b.$$typeof === _ || b.$$typeof === E || b.$$typeof === Se || b.$$typeof === Rf || b.getModuleId !== void 0)) {
349
349
  var F = A.children;
350
350
  if (F !== void 0)
351
351
  if (L)
@@ -390,7 +390,7 @@ React keys must be passed directly to JSX without using spread:
390
390
  return F && f(
391
391
  R,
392
392
  typeof b == "function" ? b.displayName || b.name || "Unknown" : b
393
- ), p(b, F, K, le, c(), R);
393
+ ), h(b, F, K, le, c(), R);
394
394
  }
395
395
  function y(b, A) {
396
396
  if (typeof b == "object" && b && b.$$typeof !== If) {
@@ -410,7 +410,7 @@ React keys must be passed directly to JSX without using spread:
410
410
  return typeof b == "object" && b !== null && b.$$typeof === O;
411
411
  }
412
412
  function x(b, A) {
413
- if (b._store && !b._store.validated && b.key == null && (b._store.validated = 1, A = C(A), !vi[A])) {
413
+ if (b._store && !b._store.validated && b.key == null && (b._store.validated = 1, A = k(A), !vi[A])) {
414
414
  vi[A] = !0;
415
415
  var R = "";
416
416
  b && b._owner != null && b._owner !== c() && (R = null, typeof b._owner.tag == "number" ? R = n(b._owner.type) : typeof b._owner.name == "string" && (R = b._owner.name), R = " It was passed a child from " + R + ".");
@@ -425,7 +425,7 @@ React keys must be passed directly to JSX without using spread:
425
425
  ), zt.getCurrentStack = L;
426
426
  }
427
427
  }
428
- function C(b) {
428
+ function k(b) {
429
429
  var A = "", R = c();
430
430
  return R && (R = n(R.type)) && (A = `
431
431
 
@@ -433,13 +433,13 @@ Check the render method of \`` + R + "`."), A || (b = n(b)) && (A = `
433
433
 
434
434
  Check the top-level render call using <` + b + ">."), A;
435
435
  }
436
- var w = P, O = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), Se = Symbol.for("react.forward_ref"), dt = Symbol.for("react.suspense"), Ee = Symbol.for("react.suspense_list"), $e = Symbol.for("react.memo"), $t = Symbol.for("react.lazy"), on = Symbol.for("react.offscreen"), Tn = Symbol.iterator, br = Symbol.for("react.client.reference"), zt = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Ci = Object.prototype.hasOwnProperty, jt = Object.assign, Rf = Symbol.for("react.client.reference"), Cs = Array.isArray, An = 0, wi, Mi, Ni, Di, Oi, Ei, Ti;
436
+ var w = P, O = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), Se = Symbol.for("react.forward_ref"), dt = Symbol.for("react.suspense"), Ee = Symbol.for("react.suspense_list"), $e = Symbol.for("react.memo"), $t = Symbol.for("react.lazy"), on = Symbol.for("react.offscreen"), Tn = Symbol.iterator, br = Symbol.for("react.client.reference"), zt = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Ci = Object.prototype.hasOwnProperty, jt = Object.assign, Rf = Symbol.for("react.client.reference"), Cs = Array.isArray, An = 0, wi, Mi, Ni, Di, Oi, Ei, Ti;
437
437
  r.__reactDisabledLog = !0;
438
438
  var ws, Ai, Ms = !1, Ns = new (typeof WeakMap == "function" ? WeakMap : Map)(), If = Symbol.for("react.client.reference"), Ri, Ii = {}, Pi = {}, vi = {};
439
- Pn.Fragment = S, Pn.jsx = function(b, A, R, L, le) {
440
- return h(b, A, R, !1, L, le);
439
+ Pn.Fragment = C, Pn.jsx = function(b, A, R, L, le) {
440
+ return p(b, A, R, !1, L, le);
441
441
  }, Pn.jsxs = function(b, A, R, L, le) {
442
- return h(b, A, R, !0, L, le);
442
+ return p(b, A, R, !0, L, le);
443
443
  };
444
444
  }()), Pn;
445
445
  }
@@ -594,7 +594,7 @@ function Fa(n, e, t, r) {
594
594
  t -= a, r -= a;
595
595
  }
596
596
  }
597
- class k {
597
+ class S {
598
598
  /**
599
599
  @internal
600
600
  */
@@ -649,7 +649,7 @@ class k {
649
649
  let t = this.lastChild, r = e.firstChild, s = this.content.slice(), o = 0;
650
650
  for (t.isText && t.sameMarkup(r) && (s[s.length - 1] = t.withText(t.text + r.text), o = 1); o < e.content.length; o++)
651
651
  s.push(e.content[o]);
652
- return new k(s, this.size + e.size);
652
+ return new S(s, this.size + e.size);
653
653
  }
654
654
  /**
655
655
  Cut out the sub-fragment between the two given positions.
@@ -663,13 +663,13 @@ class k {
663
663
  let l = this.content[o], a = i + l.nodeSize;
664
664
  a > e && ((i < e || a > t) && (l.isText ? l = l.cut(Math.max(0, e - i), Math.min(l.text.length, t - i)) : l = l.cut(Math.max(0, e - i - 1), Math.min(l.content.size, t - i - 1))), r.push(l), s += l.nodeSize), i = a;
665
665
  }
666
- return new k(r, s);
666
+ return new S(r, s);
667
667
  }
668
668
  /**
669
669
  @internal
670
670
  */
671
671
  cutByIndex(e, t) {
672
- return e == t ? k.empty : e == 0 && t == this.content.length ? this : new k(this.content.slice(e, t));
672
+ return e == t ? S.empty : e == 0 && t == this.content.length ? this : new S(this.content.slice(e, t));
673
673
  }
674
674
  /**
675
675
  Create a new fragment in which the node at the given index is
@@ -680,21 +680,21 @@ class k {
680
680
  if (r == t)
681
681
  return this;
682
682
  let s = this.content.slice(), o = this.size + t.nodeSize - r.nodeSize;
683
- return s[e] = t, new k(s, o);
683
+ return s[e] = t, new S(s, o);
684
684
  }
685
685
  /**
686
686
  Create a new fragment by prepending the given node to this
687
687
  fragment.
688
688
  */
689
689
  addToStart(e) {
690
- return new k([e].concat(this.content), this.size + e.nodeSize);
690
+ return new S([e].concat(this.content), this.size + e.nodeSize);
691
691
  }
692
692
  /**
693
693
  Create a new fragment by appending the given node to this
694
694
  fragment.
695
695
  */
696
696
  addToEnd(e) {
697
- return new k(this.content.concat(e), this.size + e.nodeSize);
697
+ return new S(this.content.concat(e), this.size + e.nodeSize);
698
698
  }
699
699
  /**
700
700
  Compare this fragment to another one.
@@ -809,10 +809,10 @@ class k {
809
809
  */
810
810
  static fromJSON(e, t) {
811
811
  if (!t)
812
- return k.empty;
812
+ return S.empty;
813
813
  if (!Array.isArray(t))
814
814
  throw new RangeError("Invalid input for Fragment.fromJSON");
815
- return new k(t.map(e.nodeFromJSON));
815
+ return new S(t.map(e.nodeFromJSON));
816
816
  }
817
817
  /**
818
818
  Build a fragment from an array of nodes. Ensures that adjacent
@@ -820,13 +820,13 @@ class k {
820
820
  */
821
821
  static fromArray(e) {
822
822
  if (!e.length)
823
- return k.empty;
823
+ return S.empty;
824
824
  let t, r = 0;
825
825
  for (let s = 0; s < e.length; s++) {
826
826
  let o = e[s];
827
827
  r += o.nodeSize, s && o.isText && e[s - 1].sameMarkup(o) ? (t || (t = e.slice(0, s)), t[t.length - 1] = o.withText(t[t.length - 1].text + o.text)) : t && t.push(o);
828
828
  }
829
- return new k(t || e, r);
829
+ return new S(t || e, r);
830
830
  }
831
831
  /**
832
832
  Create a fragment from something that can be interpreted as a
@@ -836,17 +836,17 @@ class k {
836
836
  */
837
837
  static from(e) {
838
838
  if (!e)
839
- return k.empty;
840
- if (e instanceof k)
839
+ return S.empty;
840
+ if (e instanceof S)
841
841
  return e;
842
842
  if (Array.isArray(e))
843
843
  return this.fromArray(e);
844
844
  if (e.attrs)
845
- return new k([e], e.nodeSize);
845
+ return new S([e], e.nodeSize);
846
846
  throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
847
847
  }
848
848
  }
849
- k.empty = new k([], 0);
849
+ S.empty = new S([], 0);
850
850
  const Ds = { index: 0, offset: 0 };
851
851
  function kr(n, e) {
852
852
  return Ds.index = n, Ds.offset = e, Ds;
@@ -1048,7 +1048,7 @@ class M {
1048
1048
  let r = t.openStart || 0, s = t.openEnd || 0;
1049
1049
  if (typeof r != "number" || typeof s != "number")
1050
1050
  throw new RangeError("Invalid input for Slice.fromJSON");
1051
- return new M(k.fromJSON(e, t.content), r, s);
1051
+ return new M(S.fromJSON(e, t.content), r, s);
1052
1052
  }
1053
1053
  /**
1054
1054
  Create a slice from a fragment by taking the maximum possible
@@ -1063,7 +1063,7 @@ class M {
1063
1063
  return new M(e, r, s);
1064
1064
  }
1065
1065
  }
1066
- M.empty = new M(k.empty, 0, 0);
1066
+ M.empty = new M(S.empty, 0, 0);
1067
1067
  function Ba(n, e, t) {
1068
1068
  let { index: r, offset: s } = n.findIndex(e), o = n.maybeChild(r), { index: i, offset: l } = n.findIndex(t);
1069
1069
  if (s == e || o.isText) {
@@ -1128,7 +1128,7 @@ function Ht(n, e) {
1128
1128
  }
1129
1129
  function qa(n, e, t, r, s) {
1130
1130
  let o = n.depth > s && oo(n, e, s + 1), i = r.depth > s && oo(t, r, s + 1), l = [];
1131
- return Ln(null, n, s, l), o && i && e.index(s) == t.index(s) ? (_a(o, i), qt(Ht(o, qa(n, e, t, r, s + 1)), l)) : (o && qt(Ht(o, Fr(n, e, s + 1)), l), Ln(e, t, s, l), i && qt(Ht(i, Fr(t, r, s + 1)), l)), Ln(r, null, s, l), new k(l);
1131
+ return Ln(null, n, s, l), o && i && e.index(s) == t.index(s) ? (_a(o, i), qt(Ht(o, qa(n, e, t, r, s + 1)), l)) : (o && qt(Ht(o, Fr(n, e, s + 1)), l), Ln(e, t, s, l), i && qt(Ht(i, Fr(t, r, s + 1)), l)), Ln(r, null, s, l), new S(l);
1132
1132
  }
1133
1133
  function Fr(n, e, t) {
1134
1134
  let r = [];
@@ -1136,12 +1136,12 @@ function Fr(n, e, t) {
1136
1136
  let s = oo(n, e, t + 1);
1137
1137
  qt(Ht(s, Fr(n, e, t + 1)), r);
1138
1138
  }
1139
- return Ln(e, null, t, r), new k(r);
1139
+ return Ln(e, null, t, r), new S(r);
1140
1140
  }
1141
1141
  function Uf(n, e) {
1142
1142
  let t = e.depth - n.openStart, s = e.node(t).copy(n.content);
1143
1143
  for (let o = t - 1; o >= 0; o--)
1144
- s = e.node(o).copy(k.from(s));
1144
+ s = e.node(o).copy(S.from(s));
1145
1145
  return {
1146
1146
  start: s.resolveNoCache(n.openStart + t),
1147
1147
  end: s.resolveNoCache(s.content.size - n.openEnd - t)
@@ -1446,7 +1446,7 @@ class Ne {
1446
1446
  @internal
1447
1447
  */
1448
1448
  constructor(e, t, r, s = W.none) {
1449
- this.type = e, this.attrs = t, this.marks = s, this.content = r || k.empty;
1449
+ this.type = e, this.attrs = t, this.marks = s, this.content = r || S.empty;
1450
1450
  }
1451
1451
  /**
1452
1452
  The array of this node's child nodes.
@@ -1735,7 +1735,7 @@ class Ne {
1735
1735
  can optionally pass `start` and `end` indices into the
1736
1736
  replacement fragment.
1737
1737
  */
1738
- canReplace(e, t, r = k.empty, s = 0, o = r.childCount) {
1738
+ canReplace(e, t, r = S.empty, s = 0, o = r.childCount) {
1739
1739
  let i = this.contentMatchAt(e).matchFragment(r, s, o), l = i && i.matchFragment(this.content, t);
1740
1740
  if (!l || !l.validEnd)
1741
1741
  return !1;
@@ -1806,7 +1806,7 @@ class Ne {
1806
1806
  throw new RangeError("Invalid text node in JSON");
1807
1807
  return e.text(t.text, r);
1808
1808
  }
1809
- let s = k.fromJSON(e, t.content), o = e.nodeType(t.type).create(t.attrs, s, r);
1809
+ let s = S.fromJSON(e, t.content), o = e.nodeType(t.type).create(t.attrs, s, r);
1810
1810
  return o.type.checkAttrs(o.attrs), o;
1811
1811
  }
1812
1812
  }
@@ -1934,7 +1934,7 @@ class Gt {
1934
1934
  function o(i, l) {
1935
1935
  let a = i.matchFragment(e, r);
1936
1936
  if (a && (!t || a.validEnd))
1937
- return k.from(l.map((c) => c.createAndFill()));
1937
+ return S.from(l.map((c) => c.createAndFill()));
1938
1938
  for (let c = 0; c < i.next.length; c++) {
1939
1939
  let { type: u, next: f } = i.next[c];
1940
1940
  if (!(u.isText || u.hasRequiredAttrs()) && s.indexOf(f) == -1) {
@@ -2317,7 +2317,7 @@ let Li = class Qa {
2317
2317
  create(e = null, t, r) {
2318
2318
  if (this.isText)
2319
2319
  throw new Error("NodeType.create can't construct text nodes");
2320
- return new Ne(this, this.computeAttrs(e), k.from(t), W.setFrom(r));
2320
+ return new Ne(this, this.computeAttrs(e), S.from(t), W.setFrom(r));
2321
2321
  }
2322
2322
  /**
2323
2323
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
@@ -2325,7 +2325,7 @@ let Li = class Qa {
2325
2325
  if it doesn't match.
2326
2326
  */
2327
2327
  createChecked(e = null, t, r) {
2328
- return t = k.from(t), this.checkContent(t), new Ne(this, this.computeAttrs(e), t, W.setFrom(r));
2328
+ return t = S.from(t), this.checkContent(t), new Ne(this, this.computeAttrs(e), t, W.setFrom(r));
2329
2329
  }
2330
2330
  /**
2331
2331
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
@@ -2336,13 +2336,13 @@ let Li = class Qa {
2336
2336
  `Fragment.empty` as content.
2337
2337
  */
2338
2338
  createAndFill(e = null, t, r) {
2339
- if (e = this.computeAttrs(e), t = k.from(t), t.size) {
2339
+ if (e = this.computeAttrs(e), t = S.from(t), t.size) {
2340
2340
  let i = this.contentMatch.fillBefore(t);
2341
2341
  if (!i)
2342
2342
  return null;
2343
2343
  t = i.append(t);
2344
2344
  }
2345
- let s = this.contentMatch.matchFragment(t), o = s && s.fillBefore(k.empty, !0);
2345
+ let s = this.contentMatch.matchFragment(t), o = s && s.fillBefore(S.empty, !0);
2346
2346
  return o ? new Ne(this, e, t.append(o), W.setFrom(r)) : null;
2347
2347
  }
2348
2348
  /**
@@ -2760,7 +2760,7 @@ class Sr {
2760
2760
  if (!this.match) {
2761
2761
  if (!this.type)
2762
2762
  return [];
2763
- let t = this.type.contentMatch.fillBefore(k.from(e));
2763
+ let t = this.type.contentMatch.fillBefore(S.from(e));
2764
2764
  if (t)
2765
2765
  this.match = this.type.contentMatch.matchFragment(t);
2766
2766
  else {
@@ -2778,8 +2778,8 @@ class Sr {
2778
2778
  r.text.length == s[0].length ? this.content.pop() : this.content[this.content.length - 1] = o.withText(o.text.slice(0, o.text.length - s[0].length));
2779
2779
  }
2780
2780
  }
2781
- let t = k.from(this.content);
2782
- return !e && this.match && (t = t.append(this.match.fillBefore(k.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
2781
+ let t = S.from(this.content);
2782
+ return !e && this.match && (t = t.append(this.match.fillBefore(S.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
2783
2783
  }
2784
2784
  inlineContext(e) {
2785
2785
  return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Za.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
@@ -3258,11 +3258,11 @@ function Ar(n, e, t, r) {
3258
3258
  throw new RangeError("Content hole must be the only child of its parent node");
3259
3259
  return { dom: a, contentDOM: a };
3260
3260
  } else {
3261
- let { dom: p, contentDOM: h } = Ar(n, d, t, r);
3262
- if (a.appendChild(p), h) {
3261
+ let { dom: h, contentDOM: p } = Ar(n, d, t, r);
3262
+ if (a.appendChild(h), p) {
3263
3263
  if (l)
3264
3264
  throw new RangeError("Multiple content holes");
3265
- l = h;
3265
+ l = p;
3266
3266
  }
3267
3267
  }
3268
3268
  }
@@ -3352,11 +3352,11 @@ class we {
3352
3352
  break;
3353
3353
  let c = this.ranges[l + o], u = this.ranges[l + i], f = a + c;
3354
3354
  if (e <= f) {
3355
- let d = c ? e == a ? -1 : e == f ? 1 : t : t, p = a + s + (d < 0 ? 0 : u);
3355
+ let d = c ? e == a ? -1 : e == f ? 1 : t : t, h = a + s + (d < 0 ? 0 : u);
3356
3356
  if (r)
3357
- return p;
3358
- let h = e == (t < 0 ? a : f) ? null : gd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Rr;
3359
- return (t < 0 ? e != a : e != f) && (y |= oc), new lo(p, y, h);
3357
+ return h;
3358
+ let p = e == (t < 0 ? a : f) ? null : gd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Rr;
3359
+ return (t < 0 ? e != a : e != f) && (y |= oc), new lo(h, y, p);
3360
3360
  }
3361
3361
  s += u - c;
3362
3362
  }
@@ -3601,7 +3601,7 @@ function Fo(n, e, t) {
3601
3601
  let o = n.child(s);
3602
3602
  o.content.size && (o = o.copy(Fo(o.content, e, o))), o.isInline && (o = e(o, t, s)), r.push(o);
3603
3603
  }
3604
- return k.fromArray(r);
3604
+ return S.fromArray(r);
3605
3605
  }
3606
3606
  class St extends de {
3607
3607
  /**
@@ -3693,7 +3693,7 @@ class Ct extends de {
3693
3693
  if (!t)
3694
3694
  return Y.fail("No node at mark step's position");
3695
3695
  let r = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
3696
- return Y.fromReplace(e, this.pos, this.pos + 1, new M(k.from(r), 0, t.isLeaf ? 0 : 1));
3696
+ return Y.fromReplace(e, this.pos, this.pos + 1, new M(S.from(r), 0, t.isLeaf ? 0 : 1));
3697
3697
  }
3698
3698
  invert(e) {
3699
3699
  let t = e.nodeAt(this.pos);
@@ -3737,7 +3737,7 @@ class Qt extends de {
3737
3737
  if (!t)
3738
3738
  return Y.fail("No node at mark step's position");
3739
3739
  let r = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
3740
- return Y.fromReplace(e, this.pos, this.pos + 1, new M(k.from(r), 0, t.isLeaf ? 0 : 1));
3740
+ return Y.fromReplace(e, this.pos, this.pos + 1, new M(S.from(r), 0, t.isLeaf ? 0 : 1));
3741
3741
  }
3742
3742
  invert(e) {
3743
3743
  let t = e.nodeAt(this.pos);
@@ -3891,10 +3891,10 @@ function bd(n, e, t, r) {
3891
3891
  return;
3892
3892
  let f = a.marks;
3893
3893
  if (!r.isInSet(f) && u.type.allowsMarkType(r.type)) {
3894
- let d = Math.max(c, e), p = Math.min(c + a.nodeSize, t), h = r.addToSet(f);
3894
+ let d = Math.max(c, e), h = Math.min(c + a.nodeSize, t), p = r.addToSet(f);
3895
3895
  for (let y = 0; y < f.length; y++)
3896
- f[y].isInSet(h) || (i && i.to == d && i.mark.eq(f[y]) ? i.to = p : s.push(i = new _e(d, p, f[y])));
3897
- l && l.to == d ? l.to = p : o.push(l = new St(d, p, r));
3896
+ f[y].isInSet(p) || (i && i.to == d && i.mark.eq(f[y]) ? i.to = h : s.push(i = new _e(d, h, f[y])));
3897
+ l && l.to == d ? l.to = h : o.push(l = new St(d, h, r));
3898
3898
  }
3899
3899
  }), s.forEach((a) => n.step(a)), o.forEach((a) => n.step(a));
3900
3900
  }
@@ -3914,9 +3914,9 @@ function xd(n, e, t, r) {
3914
3914
  let c = Math.min(l + i.nodeSize, t);
3915
3915
  for (let u = 0; u < a.length; u++) {
3916
3916
  let f = a[u], d;
3917
- for (let p = 0; p < s.length; p++) {
3918
- let h = s[p];
3919
- h.step == o - 1 && f.eq(s[p].style) && (d = h);
3917
+ for (let h = 0; h < s.length; h++) {
3918
+ let p = s[h];
3919
+ p.step == o - 1 && f.eq(s[h].style) && (d = p);
3920
3920
  }
3921
3921
  d ? (d.to = c, d.step = o) : s.push({ style: f, from: Math.max(l, e), to: c, step: o });
3922
3922
  }
@@ -3934,15 +3934,15 @@ function Bo(n, e, t, r = t.contentMatch, s = !0) {
3934
3934
  for (let d = 0; d < c.marks.length; d++)
3935
3935
  t.allowsMarkType(c.marks[d].type) || n.step(new _e(l, u, c.marks[d]));
3936
3936
  if (s && c.isText && t.whitespace != "pre") {
3937
- let d, p = /\r?\n|\r/g, h;
3938
- for (; d = p.exec(c.text); )
3939
- h || (h = new M(k.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, h));
3937
+ let d, h = /\r?\n|\r/g, p;
3938
+ for (; d = h.exec(c.text); )
3939
+ p || (p = new M(S.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, p));
3940
3940
  }
3941
3941
  }
3942
3942
  l = u;
3943
3943
  }
3944
3944
  if (!r.validEnd) {
3945
- let a = r.fillBefore(k.empty, !0);
3945
+ let a = r.fillBefore(S.empty, !0);
3946
3946
  n.replace(l, l, new M(a, 0, 0));
3947
3947
  }
3948
3948
  for (let a = i.length - 1; a >= 0; a--)
@@ -3963,13 +3963,13 @@ function ur(n) {
3963
3963
  return null;
3964
3964
  }
3965
3965
  function Sd(n, e, t) {
3966
- let { $from: r, $to: s, depth: o } = e, i = r.before(o + 1), l = s.after(o + 1), a = i, c = l, u = k.empty, f = 0;
3967
- for (let h = o, y = !1; h > t; h--)
3968
- y || r.index(h) > 0 ? (y = !0, u = k.from(r.node(h).copy(u)), f++) : a--;
3969
- let d = k.empty, p = 0;
3970
- for (let h = o, y = !1; h > t; h--)
3971
- y || s.after(h + 1) < s.end(h) ? (y = !0, d = k.from(s.node(h).copy(d)), p++) : c++;
3972
- n.step(new oe(a, c, i, l, new M(u.append(d), f, p), u.size - f, !0));
3966
+ let { $from: r, $to: s, depth: o } = e, i = r.before(o + 1), l = s.after(o + 1), a = i, c = l, u = S.empty, f = 0;
3967
+ for (let p = o, y = !1; p > t; p--)
3968
+ y || r.index(p) > 0 ? (y = !0, u = S.from(r.node(p).copy(u)), f++) : a--;
3969
+ let d = S.empty, h = 0;
3970
+ for (let p = o, y = !1; p > t; p--)
3971
+ y || s.after(p + 1) < s.end(p) ? (y = !0, d = S.from(s.node(p).copy(d)), h++) : c++;
3972
+ n.step(new oe(a, c, i, l, new M(u.append(d), f, h), u.size - f, !0));
3973
3973
  }
3974
3974
  function Lo(n, e, t = null, r = n) {
3975
3975
  let s = Cd(n, e), o = s && wd(r, e);
@@ -3995,14 +3995,14 @@ function wd(n, e) {
3995
3995
  return !a || !a.validEnd ? null : i;
3996
3996
  }
3997
3997
  function Md(n, e, t) {
3998
- let r = k.empty;
3998
+ let r = S.empty;
3999
3999
  for (let i = t.length - 1; i >= 0; i--) {
4000
4000
  if (r.size) {
4001
4001
  let l = t[i].type.contentMatch.matchFragment(r);
4002
4002
  if (!l || !l.validEnd)
4003
4003
  throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
4004
4004
  }
4005
- r = k.from(t[i].type.create(t[i].attrs, r));
4005
+ r = S.from(t[i].type.create(t[i].attrs, r));
4006
4006
  }
4007
4007
  let s = e.start, o = e.end;
4008
4008
  n.step(new oe(s, o, s, o, new M(r, 0, 0), t.length, !0));
@@ -4016,12 +4016,12 @@ function Nd(n, e, t, r, s) {
4016
4016
  if (i.isTextblock && !i.hasMarkup(r, a) && Dd(n.doc, n.mapping.slice(o).map(l), r)) {
4017
4017
  let c = null;
4018
4018
  if (r.schema.linebreakReplacement) {
4019
- let p = r.whitespace == "pre", h = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
4020
- p && !h ? c = !1 : !p && h && (c = !0);
4019
+ let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
4020
+ h && !p ? c = !1 : !h && p && (c = !0);
4021
4021
  }
4022
4022
  c === !1 && lc(n, i, l, o), Bo(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
4023
4023
  let u = n.mapping.slice(o), f = u.map(l, 1), d = u.map(l + i.nodeSize, 1);
4024
- return n.step(new oe(f, d, f + 1, d - 1, new M(k.from(r.create(a, null, i.marks)), 0, 0), 1, !0)), c === !0 && ic(n, i, l, o), !1;
4024
+ return n.step(new oe(f, d, f + 1, d - 1, new M(S.from(r.create(a, null, i.marks)), 0, 0), 1, !0)), c === !0 && ic(n, i, l, o), !1;
4025
4025
  }
4026
4026
  });
4027
4027
  }
@@ -4059,7 +4059,7 @@ function Od(n, e, t, r, s) {
4059
4059
  return n.replaceWith(e, e + o.nodeSize, i);
4060
4060
  if (!t.validContent(o.content))
4061
4061
  throw new RangeError("Invalid content for node type " + t.name);
4062
- n.step(new oe(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new M(k.from(i), 0, 0), 1, !0));
4062
+ n.step(new oe(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new M(S.from(i), 0, 0), 1, !0));
4063
4063
  }
4064
4064
  function bn(n, e, t = 1, r) {
4065
4065
  let s = n.resolve(e), o = s.depth - t, i = r && r[r.length - 1] || s.parent;
@@ -4069,21 +4069,21 @@ function bn(n, e, t = 1, r) {
4069
4069
  let f = s.node(c), d = s.index(c);
4070
4070
  if (f.type.spec.isolating)
4071
4071
  return !1;
4072
- let p = f.content.cutByIndex(d, f.childCount), h = r && r[u + 1];
4073
- h && (p = p.replaceChild(0, h.type.create(h.attrs)));
4072
+ let h = f.content.cutByIndex(d, f.childCount), p = r && r[u + 1];
4073
+ p && (h = h.replaceChild(0, p.type.create(p.attrs)));
4074
4074
  let y = r && r[u] || f;
4075
- if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(p))
4075
+ if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(h))
4076
4076
  return !1;
4077
4077
  }
4078
4078
  let l = s.indexAfter(o), a = r && r[0];
4079
4079
  return s.node(o).canReplaceWith(l, l, a ? a.type : s.node(o + 1).type);
4080
4080
  }
4081
4081
  function Ed(n, e, t = 1, r) {
4082
- let s = n.doc.resolve(e), o = k.empty, i = k.empty;
4082
+ let s = n.doc.resolve(e), o = S.empty, i = S.empty;
4083
4083
  for (let l = s.depth, a = s.depth - t, c = t - 1; l > a; l--, c--) {
4084
- o = k.from(s.node(l).copy(o));
4084
+ o = S.from(s.node(l).copy(o));
4085
4085
  let u = r && r[c];
4086
- i = k.from(u ? u.type.create(u.attrs, i) : s.node(l).copy(i));
4086
+ i = S.from(u ? u.type.create(u.attrs, i) : s.node(l).copy(i));
4087
4087
  }
4088
4088
  n.step(new ce(e, e, new M(o.append(i), t, t), !0));
4089
4089
  }
@@ -4188,7 +4188,7 @@ function uc(n, e, t) {
4188
4188
  }
4189
4189
  class Id {
4190
4190
  constructor(e, t, r) {
4191
- this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = k.empty;
4191
+ this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = S.empty;
4192
4192
  for (let s = 0; s <= e.depth; s++) {
4193
4193
  let o = e.node(s);
4194
4194
  this.frontier.push({
@@ -4197,7 +4197,7 @@ class Id {
4197
4197
  });
4198
4198
  }
4199
4199
  for (let s = e.depth; s > 0; s--)
4200
- this.placed = k.from(e.node(s).copy(this.placed));
4200
+ this.placed = S.from(e.node(s).copy(this.placed));
4201
4201
  }
4202
4202
  get depth() {
4203
4203
  return this.frontier.length - 1;
@@ -4236,7 +4236,7 @@ class Id {
4236
4236
  let i = s.firstChild;
4237
4237
  for (let l = this.depth; l >= 0; l--) {
4238
4238
  let { type: a, match: c } = this.frontier[l], u, f = null;
4239
- if (t == 1 && (i ? c.matchType(i.type) || (f = c.fillBefore(k.from(i), !1)) : o && a.compatibleContent(o.type)))
4239
+ if (t == 1 && (i ? c.matchType(i.type) || (f = c.fillBefore(S.from(i), !1)) : o && a.compatibleContent(o.type)))
4240
4240
  return { sliceDepth: r, frontierDepth: l, parent: o, inject: f };
4241
4241
  if (t == 2 && i && (u = c.findWrapping(i.type)))
4242
4242
  return { sliceDepth: r, frontierDepth: l, parent: o, wrap: u };
@@ -4272,20 +4272,20 @@ class Id {
4272
4272
  u.push(s.child(y));
4273
4273
  f = f.matchFragment(s);
4274
4274
  }
4275
- let p = l.size + e - (i.content.size - i.openEnd);
4275
+ let h = l.size + e - (i.content.size - i.openEnd);
4276
4276
  for (; c < l.childCount; ) {
4277
4277
  let y = l.child(c), m = f.matchType(y.type);
4278
4278
  if (!m)
4279
4279
  break;
4280
- c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? p : -1)));
4280
+ c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
4281
4281
  }
4282
- let h = c == l.childCount;
4283
- h || (p = -1), this.placed = $n(this.placed, t, k.from(u)), this.frontier[t].match = f, h && p < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4284
- for (let y = 0, m = l; y < p; y++) {
4282
+ let p = c == l.childCount;
4283
+ p || (h = -1), this.placed = $n(this.placed, t, S.from(u)), this.frontier[t].match = f, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4284
+ for (let y = 0, m = l; y < h; y++) {
4285
4285
  let x = m.lastChild;
4286
4286
  this.frontier.push({ type: x.type, match: x.contentMatchAt(x.childCount) }), m = x.content;
4287
4287
  }
4288
- this.unplaced = h ? e == 0 ? M.empty : new M(Vn(i.content, e - 1, 1), e - 1, p < 0 ? i.openEnd : e - 1) : new M(Vn(i.content, e, c), i.openStart, i.openEnd);
4288
+ this.unplaced = p ? e == 0 ? M.empty : new M(Vn(i.content, e - 1, 1), e - 1, h < 0 ? i.openEnd : e - 1) : new M(Vn(i.content, e, c), i.openStart, i.openEnd);
4289
4289
  }
4290
4290
  mustMoveInline() {
4291
4291
  if (!this.$to.parent.isTextblock)
@@ -4326,10 +4326,10 @@ class Id {
4326
4326
  }
4327
4327
  openFrontierNode(e, t = null, r) {
4328
4328
  let s = this.frontier[this.depth];
4329
- s.match = s.match.matchType(e), this.placed = $n(this.placed, this.depth, k.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
4329
+ s.match = s.match.matchType(e), this.placed = $n(this.placed, this.depth, S.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
4330
4330
  }
4331
4331
  closeFrontierNode() {
4332
- let t = this.frontier.pop().match.fillBefore(k.empty, !0);
4332
+ let t = this.frontier.pop().match.fillBefore(S.empty, !0);
4333
4333
  t.childCount && (this.placed = $n(this.placed, this.frontier.length, t));
4334
4334
  }
4335
4335
  }
@@ -4348,7 +4348,7 @@ function fc(n, e, t) {
4348
4348
  if (e <= 0)
4349
4349
  return n;
4350
4350
  let r = n.content;
4351
- return e > 1 && (r = r.replaceChild(0, fc(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(k.empty, !0)))), n.copy(r);
4351
+ return e > 1 && (r = r.replaceChild(0, fc(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty, !0)))), n.copy(r);
4352
4352
  }
4353
4353
  function As(n, e, t, r, s) {
4354
4354
  let o = n.node(e), i = s ? n.indexAfter(e) : n.index(e);
@@ -4376,41 +4376,41 @@ function Vd(n, e, t, r) {
4376
4376
  i[i.length - 1] == 0 && i.pop();
4377
4377
  let l = -(s.depth + 1);
4378
4378
  i.unshift(l);
4379
- for (let d = s.depth, p = s.pos - 1; d > 0; d--, p--) {
4380
- let h = s.node(d).type.spec;
4381
- if (h.defining || h.definingAsContext || h.isolating)
4379
+ for (let d = s.depth, h = s.pos - 1; d > 0; d--, h--) {
4380
+ let p = s.node(d).type.spec;
4381
+ if (p.defining || p.definingAsContext || p.isolating)
4382
4382
  break;
4383
- i.indexOf(d) > -1 ? l = d : s.before(d) == p && i.splice(1, 0, -d);
4383
+ i.indexOf(d) > -1 ? l = d : s.before(d) == h && i.splice(1, 0, -d);
4384
4384
  }
4385
4385
  let a = i.indexOf(l), c = [], u = r.openStart;
4386
- for (let d = r.content, p = 0; ; p++) {
4387
- let h = d.firstChild;
4388
- if (c.push(h), p == r.openStart)
4386
+ for (let d = r.content, h = 0; ; h++) {
4387
+ let p = d.firstChild;
4388
+ if (c.push(p), h == r.openStart)
4389
4389
  break;
4390
- d = h.content;
4390
+ d = p.content;
4391
4391
  }
4392
4392
  for (let d = u - 1; d >= 0; d--) {
4393
- let p = c[d], h = vd(p.type);
4394
- if (h && !p.sameMarkup(s.node(Math.abs(l) - 1)))
4393
+ let h = c[d], p = vd(h.type);
4394
+ if (p && !h.sameMarkup(s.node(Math.abs(l) - 1)))
4395
4395
  u = d;
4396
- else if (h || !p.type.isTextblock)
4396
+ else if (p || !h.type.isTextblock)
4397
4397
  break;
4398
4398
  }
4399
4399
  for (let d = r.openStart; d >= 0; d--) {
4400
- let p = (d + u + 1) % (r.openStart + 1), h = c[p];
4401
- if (h)
4400
+ let h = (d + u + 1) % (r.openStart + 1), p = c[h];
4401
+ if (p)
4402
4402
  for (let y = 0; y < i.length; y++) {
4403
4403
  let m = i[(y + a) % i.length], x = !0;
4404
4404
  m < 0 && (x = !1, m = -m);
4405
- let C = s.node(m - 1), w = s.index(m - 1);
4406
- if (C.canReplaceWith(w, w, h.type, h.marks))
4407
- return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart, p), p, r.openEnd));
4405
+ let k = s.node(m - 1), w = s.index(m - 1);
4406
+ if (k.canReplaceWith(w, w, p.type, p.marks))
4407
+ return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart, h), h, r.openEnd));
4408
4408
  }
4409
4409
  }
4410
4410
  let f = n.steps.length;
4411
4411
  for (let d = i.length - 1; d >= 0 && (n.replace(e, t, r), !(n.steps.length > f)); d--) {
4412
- let p = i[d];
4413
- p < 0 || (e = s.before(p), t = o.after(p));
4412
+ let h = i[d];
4413
+ h < 0 || (e = s.before(h), t = o.after(h));
4414
4414
  }
4415
4415
  }
4416
4416
  function dc(n, e, t, r, s) {
@@ -4420,7 +4420,7 @@ function dc(n, e, t, r, s) {
4420
4420
  }
4421
4421
  if (e > r) {
4422
4422
  let o = s.contentMatchAt(0), i = o.fillBefore(n).append(n);
4423
- n = i.append(o.matchFragment(i).fillBefore(k.empty, !0));
4423
+ n = i.append(o.matchFragment(i).fillBefore(S.empty, !0));
4424
4424
  }
4425
4425
  return n;
4426
4426
  }
@@ -4429,7 +4429,7 @@ function $d(n, e, t, r) {
4429
4429
  let s = Rd(n.doc, e, r.type);
4430
4430
  s != null && (e = t = s);
4431
4431
  }
4432
- n.replaceRange(e, t, new M(k.from(r), 0, 0));
4432
+ n.replaceRange(e, t, new M(S.from(r), 0, 0));
4433
4433
  }
4434
4434
  function zd(n, e, t) {
4435
4435
  let r = n.doc.resolve(e), s = n.doc.resolve(t), o = hc(r, s);
@@ -4471,7 +4471,7 @@ class xn extends de {
4471
4471
  r[o] = t.attrs[o];
4472
4472
  r[this.attr] = this.value;
4473
4473
  let s = t.type.create(r, null, t.marks);
4474
- return Y.fromReplace(e, this.pos, this.pos + 1, new M(k.from(s), 0, t.isLeaf ? 0 : 1));
4474
+ return Y.fromReplace(e, this.pos, this.pos + 1, new M(S.from(s), 0, t.isLeaf ? 0 : 1));
4475
4475
  }
4476
4476
  getMap() {
4477
4477
  return we.empty;
@@ -4593,7 +4593,7 @@ class pc {
4593
4593
  fragment, node, or array of nodes.
4594
4594
  */
4595
4595
  replaceWith(e, t, r) {
4596
- return this.replace(e, t, new M(k.from(r), 0, 0));
4596
+ return this.replace(e, t, new M(S.from(r), 0, 0));
4597
4597
  }
4598
4598
  /**
4599
4599
  Delete the content between the given positions.
@@ -5036,7 +5036,7 @@ class D extends z {
5036
5036
  return r ? z.near(o) : new D(o);
5037
5037
  }
5038
5038
  content() {
5039
- return new M(k.from(this.node), 0, 0);
5039
+ return new M(S.from(this.node), 0, 0);
5040
5040
  }
5041
5041
  eq(e) {
5042
5042
  return e instanceof D && e.anchor == this.anchor;
@@ -5693,8 +5693,8 @@ class ze {
5693
5693
  }
5694
5694
  if (s) {
5695
5695
  u.push(new We(f.map));
5696
- let p = f.step.map(s.slice(o)), h;
5697
- p && i.maybeStep(p).doc && (h = i.mapping.maps[i.mapping.maps.length - 1], c.push(new We(h, void 0, void 0, c.length + u.length))), o--, h && s.appendMap(h, o);
5696
+ let h = f.step.map(s.slice(o)), p;
5697
+ h && i.maybeStep(h).doc && (p = i.mapping.maps[i.mapping.maps.length - 1], c.push(new We(p, void 0, void 0, c.length + u.length))), o--, p && s.appendMap(p, o);
5698
5698
  } else
5699
5699
  i.maybeStep(f.step);
5700
5700
  if (f.selection)
@@ -5705,8 +5705,8 @@ class ze {
5705
5705
  addTransform(e, t, r, s) {
5706
5706
  let o = [], i = this.eventCount, l = this.items, a = !s && l.length ? l.get(l.length - 1) : null;
5707
5707
  for (let u = 0; u < e.steps.length; u++) {
5708
- let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t), p;
5709
- (p = a && a.merge(d)) && (d = p, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(d), t && (i++, t = void 0), s || (a = d);
5708
+ let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t), h;
5709
+ (h = a && a.merge(d)) && (d = h, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(d), t && (i++, t = void 0), s || (a = d);
5710
5710
  }
5711
5711
  let c = i - r.depth;
5712
5712
  return c > qd && (l = _d(l, c), i -= c), new ze(l.append(o), i);
@@ -5734,16 +5734,16 @@ class ze {
5734
5734
  }, s);
5735
5735
  let a = t;
5736
5736
  this.items.forEach((d) => {
5737
- let p = o.getMirror(--a);
5738
- if (p == null)
5737
+ let h = o.getMirror(--a);
5738
+ if (h == null)
5739
5739
  return;
5740
- i = Math.min(i, p);
5741
- let h = o.maps[p];
5740
+ i = Math.min(i, h);
5741
+ let p = o.maps[h];
5742
5742
  if (d.step) {
5743
- let y = e.steps[p].invert(e.docs[p]), m = d.selection && d.selection.map(o.slice(a + 1, p));
5744
- m && l++, r.push(new We(h, y, m));
5743
+ let y = e.steps[h].invert(e.docs[h]), m = d.selection && d.selection.map(o.slice(a + 1, h));
5744
+ m && l++, r.push(new We(p, y, m));
5745
5745
  } else
5746
- r.push(new We(h));
5746
+ r.push(new We(p));
5747
5747
  }, s);
5748
5748
  let c = [];
5749
5749
  for (let d = t; d < i; d++)
@@ -5773,8 +5773,8 @@ class ze {
5773
5773
  if (r--, c && t.appendMap(c, r), a) {
5774
5774
  let u = i.selection && i.selection.map(t.slice(r));
5775
5775
  u && o++;
5776
- let f = new We(c.invert(), a, u), d, p = s.length - 1;
5777
- (d = s.length && s[p].merge(f)) ? s[p] = d : s.push(f);
5776
+ let f = new We(c.invert(), a, u), d, h = s.length - 1;
5777
+ (d = s.length && s[h].merge(f)) ? s[h] = d : s.push(f);
5778
5778
  }
5779
5779
  } else i.map && r--;
5780
5780
  }, this.items.length, 0), new ze(ee.from(s.reverse()), o);
@@ -6247,12 +6247,12 @@ function dh(n) {
6247
6247
  if (!r.depth)
6248
6248
  return !1;
6249
6249
  let o = [], i, l, a = !1, c = !1;
6250
- for (let p = r.depth; ; p--)
6251
- if (r.node(p).isBlock) {
6252
- a = r.end(p) == r.pos + (r.depth - p), c = r.start(p) == r.pos - (r.depth - p), l = Uo(r.node(p - 1).contentMatchAt(r.indexAfter(p - 1))), o.unshift(a && l ? { type: l } : null), i = p;
6250
+ for (let h = r.depth; ; h--)
6251
+ if (r.node(h).isBlock) {
6252
+ a = r.end(h) == r.pos + (r.depth - h), c = r.start(h) == r.pos - (r.depth - h), l = Uo(r.node(h - 1).contentMatchAt(r.indexAfter(h - 1))), o.unshift(a && l ? { type: l } : null), i = h;
6253
6253
  break;
6254
6254
  } else {
6255
- if (p == 1)
6255
+ if (h == 1)
6256
6256
  return !1;
6257
6257
  o.unshift(null);
6258
6258
  }
@@ -6262,8 +6262,8 @@ function dh(n) {
6262
6262
  if (d || (o[0] = l ? { type: l } : null, d = bn(u.doc, f, o.length, o)), !d)
6263
6263
  return !1;
6264
6264
  if (u.split(f, o.length, o), !a && c && r.node(i).type != l) {
6265
- let p = u.mapping.map(r.before(i)), h = u.doc.resolve(p);
6266
- l && r.node(i - 1).canReplaceWith(h.index(), h.index() + 1, l) && u.setNodeMarkup(u.mapping.map(r.before(i)), l);
6265
+ let h = u.mapping.map(r.before(i)), p = u.doc.resolve(h);
6266
+ l && r.node(i - 1).canReplaceWith(p.index(), p.index() + 1, l) && u.setNodeMarkup(u.mapping.map(r.before(i)), l);
6267
6267
  }
6268
6268
  return t && t(u.scrollIntoView()), !0;
6269
6269
  };
@@ -6283,11 +6283,11 @@ function Nc(n, e, t, r) {
6283
6283
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
6284
6284
  if (c && (i = (l = s.contentMatchAt(s.childCount)).findWrapping(o.type)) && l.matchType(i[0] || o.type).validEnd) {
6285
6285
  if (t) {
6286
- let p = e.pos + o.nodeSize, h = k.empty;
6286
+ let h = e.pos + o.nodeSize, p = S.empty;
6287
6287
  for (let x = i.length - 1; x >= 0; x--)
6288
- h = k.from(i[x].create(null, h));
6289
- h = k.from(s.copy(h));
6290
- let y = n.tr.step(new oe(e.pos - 1, p, e.pos, p, new M(h, 1, 0), i.length, !0)), m = y.doc.resolve(p + 2 * i.length);
6288
+ p = S.from(i[x].create(null, p));
6289
+ p = S.from(s.copy(p));
6290
+ let y = n.tr.step(new oe(e.pos - 1, h, e.pos, h, new M(p, 1, 0), i.length, !0)), m = y.doc.resolve(h + 2 * i.length);
6291
6291
  m.nodeAfter && m.nodeAfter.type == s.type && En(y.doc, m.pos) && y.join(m.pos), t(y.scrollIntoView());
6292
6292
  }
6293
6293
  return !0;
@@ -6296,19 +6296,19 @@ function Nc(n, e, t, r) {
6296
6296
  if (d != null && d >= e.depth)
6297
6297
  return t && t(n.tr.lift(f, d).scrollIntoView()), !0;
6298
6298
  if (c && Nn(o, "start", !0) && Nn(s, "end")) {
6299
- let p = s, h = [];
6300
- for (; h.push(p), !p.isTextblock; )
6301
- p = p.lastChild;
6299
+ let h = s, p = [];
6300
+ for (; p.push(h), !h.isTextblock; )
6301
+ h = h.lastChild;
6302
6302
  let y = o, m = 1;
6303
6303
  for (; !y.isTextblock; y = y.firstChild)
6304
6304
  m++;
6305
- if (p.canReplace(p.childCount, p.childCount, y.content)) {
6305
+ if (h.canReplace(h.childCount, h.childCount, y.content)) {
6306
6306
  if (t) {
6307
- let x = k.empty;
6308
- for (let w = h.length - 1; w >= 0; w--)
6309
- x = k.from(h[w].copy(x));
6310
- let C = n.tr.step(new oe(e.pos - h.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new M(x, h.length, 0), 0, !0));
6311
- t(C.scrollIntoView());
6307
+ let x = S.empty;
6308
+ for (let w = p.length - 1; w >= 0; w--)
6309
+ x = S.from(p[w].copy(x));
6310
+ let k = n.tr.step(new oe(e.pos - p.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new M(x, p.length, 0), 0, !0));
6311
+ t(k.scrollIntoView());
6312
6312
  }
6313
6313
  return !0;
6314
6314
  }
@@ -6391,8 +6391,8 @@ function Ce(n, e = null, t) {
6391
6391
  if (!a)
6392
6392
  c.removeMark(f.pos, d.pos, n);
6393
6393
  else {
6394
- let p = f.pos, h = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, C = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
6395
- p + x < h && (p += x, h -= C), c.addMark(p, h, n.create(e));
6394
+ let h = f.pos, p = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, k = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
6395
+ h + x < p && (h += x, p -= k), c.addMark(h, p, n.create(e));
6396
6396
  }
6397
6397
  }
6398
6398
  s(c.scrollIntoView());
@@ -6462,12 +6462,12 @@ class Ch {
6462
6462
  if (t) {
6463
6463
  let f = e.nodeBefore, d = e.nodeAfter;
6464
6464
  if (f || d) {
6465
- let p = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
6466
- if (p) {
6467
- let h = p.getBoundingClientRect(), y = f ? h.bottom : h.top;
6465
+ let h = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
6466
+ if (h) {
6467
+ let p = h.getBoundingClientRect(), y = f ? p.bottom : p.top;
6468
6468
  f && d && (y = (y + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
6469
6469
  let m = this.width / 2 * l;
6470
- r = { left: h.left, right: h.right, top: y - m, bottom: y + m };
6470
+ r = { left: p.left, right: p.right, top: y - m, bottom: y + m };
6471
6471
  }
6472
6472
  }
6473
6473
  }
@@ -6481,8 +6481,8 @@ class Ch {
6481
6481
  if (!a || a == document.body && getComputedStyle(a).position == "static")
6482
6482
  c = -pageXOffset, u = -pageYOffset;
6483
6483
  else {
6484
- let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth, p = f.height / a.offsetHeight;
6485
- c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop * p;
6484
+ let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth, h = f.height / a.offsetHeight;
6485
+ c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop * h;
6486
6486
  }
6487
6487
  this.element.style.left = (r.left - c) / i + "px", this.element.style.top = (r.top - u) / l + "px", this.element.style.width = (r.right - r.left) / i + "px", this.element.style.height = (r.bottom - r.top) / l + "px";
6488
6488
  }
@@ -6659,10 +6659,10 @@ function cl(n, e, t) {
6659
6659
  if (a)
6660
6660
  o.defaultView.scrollBy(u, f);
6661
6661
  else {
6662
- let d = l.scrollLeft, p = l.scrollTop;
6662
+ let d = l.scrollLeft, h = l.scrollTop;
6663
6663
  f && (l.scrollTop += f), u && (l.scrollLeft += u);
6664
- let h = l.scrollLeft - d, y = l.scrollTop - p;
6665
- e = { left: e.left - h, top: e.top - y, right: e.right - h, bottom: e.bottom - y };
6664
+ let p = l.scrollLeft - d, y = l.scrollTop - h;
6665
+ e = { left: e.left - p, top: e.top - y, right: e.right - p, bottom: e.bottom - y };
6666
6666
  }
6667
6667
  if (a || /^(fixed|sticky)$/.test(getComputedStyle(i).position))
6668
6668
  break;
@@ -6721,20 +6721,20 @@ function Pc(n, e) {
6721
6721
  d = ot(u).getClientRects();
6722
6722
  else
6723
6723
  continue;
6724
- for (let p = 0; p < d.length; p++) {
6725
- let h = d[p];
6726
- if (h.top <= i && h.bottom >= l) {
6727
- i = Math.max(h.bottom, i), l = Math.min(h.top, l);
6728
- let y = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
6724
+ for (let h = 0; h < d.length; h++) {
6725
+ let p = d[h];
6726
+ if (p.top <= i && p.bottom >= l) {
6727
+ i = Math.max(p.bottom, i), l = Math.min(p.top, l);
6728
+ let y = p.left > e.left ? p.left - e.left : p.right < e.left ? e.left - p.right : 0;
6729
6729
  if (y < r) {
6730
6730
  t = u, r = y, s = y && t.nodeType == 3 ? {
6731
- left: h.right < e.left ? h.right : h.left,
6731
+ left: p.right < e.left ? p.right : p.left,
6732
6732
  top: e.top
6733
- } : e, u.nodeType == 1 && y && (o = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
6733
+ } : e, u.nodeType == 1 && y && (o = f + (e.left >= (p.left + p.right) / 2 ? 1 : 0));
6734
6734
  continue;
6735
6735
  }
6736
- } else h.top > e.top && !a && h.left <= e.left && h.right >= e.left && (a = u, c = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
6737
- !t && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (o = f + 1);
6736
+ } else p.top > e.top && !a && p.left <= e.left && p.right >= e.left && (a = u, c = { left: Math.max(p.left, Math.min(p.right, e.left)), top: p.top });
6737
+ !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (o = f + 1);
6738
6738
  }
6739
6739
  }
6740
6740
  return !t && a && (t = a, s = c, r = 0), t && t.nodeType == 3 ? zh(t, s) : !t || r && t.nodeType == 1 ? { node: n, offset: o } : Pc(t, s);
@@ -6940,7 +6940,7 @@ function Hh(n, e, t) {
6940
6940
  return l ? !qh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : $c(n, e, () => {
6941
6941
  let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: f } = n.domSelectionRange(), d = l.caretBidiLevel;
6942
6942
  l.modify("move", t, "character");
6943
- let p = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: h, focusOffset: y } = n.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == y;
6943
+ let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: y } = n.domSelectionRange(), m = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == y;
6944
6944
  try {
6945
6945
  l.collapse(u, f), a && (a != u || c != f) && l.extend && l.extend(a, c);
6946
6946
  } catch {
@@ -7199,19 +7199,19 @@ let hr = class {
7199
7199
  // case we just use whatever domFromPos produces as a best effort.
7200
7200
  setSelection(e, t, r, s = !1) {
7201
7201
  let o = Math.min(e, t), i = Math.max(e, t);
7202
- for (let p = 0, h = 0; p < this.children.length; p++) {
7203
- let y = this.children[p], m = h + y.size;
7204
- if (o > h && i < m)
7205
- return y.setSelection(e - h - y.border, t - h - y.border, r, s);
7206
- h = m;
7202
+ for (let h = 0, p = 0; h < this.children.length; h++) {
7203
+ let y = this.children[h], m = p + y.size;
7204
+ if (o > p && i < m)
7205
+ return y.setSelection(e - p - y.border, t - p - y.border, r, s);
7206
+ p = m;
7207
7207
  }
7208
7208
  let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), f = !1;
7209
7209
  if ((je || me) && e == t) {
7210
- let { node: p, offset: h } = l;
7211
- if (p.nodeType == 3) {
7212
- if (f = !!(h && p.nodeValue[h - 1] == `
7213
- `), f && h == p.nodeValue.length)
7214
- for (let y = p, m; y; y = y.parentNode) {
7210
+ let { node: h, offset: p } = l;
7211
+ if (h.nodeType == 3) {
7212
+ if (f = !!(p && h.nodeValue[p - 1] == `
7213
+ `), f && p == h.nodeValue.length)
7214
+ for (let y = h, m; y; y = y.parentNode) {
7215
7215
  if (m = y.nextSibling) {
7216
7216
  m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: re(m) + 1 });
7217
7217
  break;
@@ -7221,13 +7221,13 @@ let hr = class {
7221
7221
  break;
7222
7222
  }
7223
7223
  } else {
7224
- let y = p.childNodes[h - 1];
7224
+ let y = h.childNodes[p - 1];
7225
7225
  f = y && (y.nodeName == "BR" || y.contentEditable == "false");
7226
7226
  }
7227
7227
  }
7228
7228
  if (je && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
7229
- let p = u.focusNode.childNodes[u.focusOffset];
7230
- p && p.contentEditable == "false" && (s = !0);
7229
+ let h = u.focusNode.childNodes[u.focusOffset];
7230
+ h && h.contentEditable == "false" && (s = !0);
7231
7231
  }
7232
7232
  if (!(s || f && me) && Zt(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zt(a.node, a.offset, u.focusNode, u.focusOffset))
7233
7233
  return;
@@ -7241,11 +7241,11 @@ let hr = class {
7241
7241
  }
7242
7242
  if (!d) {
7243
7243
  if (e > t) {
7244
- let h = l;
7245
- l = a, a = h;
7244
+ let p = l;
7245
+ l = a, a = p;
7246
7246
  }
7247
- let p = document.createRange();
7248
- p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
7247
+ let h = document.createRange();
7248
+ h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
7249
7249
  }
7250
7250
  }
7251
7251
  ignoreMutation(e) {
@@ -7423,7 +7423,7 @@ let hr = class {
7423
7423
  break;
7424
7424
  }
7425
7425
  }
7426
- e.contentElement || (e.getContent = () => k.empty);
7426
+ e.contentElement || (e.getContent = () => S.empty);
7427
7427
  }
7428
7428
  return e;
7429
7429
  }
@@ -7446,8 +7446,8 @@ let hr = class {
7446
7446
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !f && a.syncToMarks(u == this.node.childCount ? W.none : this.node.child(u).marks, r, e), a.placeWidget(c, e, s);
7447
7447
  }, (c, u, f, d) => {
7448
7448
  a.syncToMarks(c.marks, r, e);
7449
- let p;
7450
- a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (p = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, f, p, e) || a.updateNextNode(c, u, f, e, d, s) || a.addNode(c, u, f, e, s), s += c.nodeSize;
7449
+ let h;
7450
+ a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (h = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, f, h, e) || a.updateNextNode(c, u, f, e, d, s) || a.addNode(c, u, f, e, s), s += c.nodeSize;
7451
7451
  }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Wt) && (i && this.protectLocalComposition(e, i), Wc(this.contentDOM, this.children, e), Dn && ep(this.dom));
7452
7452
  }
7453
7453
  localCompositionInfo(e, t) {
@@ -7892,29 +7892,29 @@ function Zh(n, e, t, r) {
7892
7892
  t(f[m], c, !!a);
7893
7893
  } else
7894
7894
  t(u, c, !!a);
7895
- let d, p;
7895
+ let d, h;
7896
7896
  if (a)
7897
- p = -1, d = a, a = null;
7897
+ h = -1, d = a, a = null;
7898
7898
  else if (c < n.childCount)
7899
- p = c, d = n.child(c++);
7899
+ h = c, d = n.child(c++);
7900
7900
  else
7901
7901
  break;
7902
7902
  for (let m = 0; m < l.length; m++)
7903
7903
  l[m].to <= o && l.splice(m--, 1);
7904
7904
  for (; i < s.length && s[i].from <= o && s[i].to > o; )
7905
7905
  l.push(s[i++]);
7906
- let h = o + d.nodeSize;
7906
+ let p = o + d.nodeSize;
7907
7907
  if (d.isText) {
7908
- let m = h;
7908
+ let m = p;
7909
7909
  i < s.length && s[i].from < m && (m = s[i].from);
7910
7910
  for (let x = 0; x < l.length; x++)
7911
7911
  l[x].to < m && (m = l[x].to);
7912
- m < h && (a = d.cut(m - o), d = d.cut(0, m - o), h = m, p = -1);
7912
+ m < p && (a = d.cut(m - o), d = d.cut(0, m - o), p = m, h = -1);
7913
7913
  } else
7914
- for (; i < s.length && s[i].to < h; )
7914
+ for (; i < s.length && s[i].to < p; )
7915
7915
  i++;
7916
7916
  let y = d.isInline && !d.isLeaf ? l.filter((m) => !m.inline) : l.slice();
7917
- r(d, y, e.forChild(o, d), p), o = h;
7917
+ r(d, y, e.forChild(o, d), h), o = p;
7918
7918
  }
7919
7919
  }
7920
7920
  function ep(n) {
@@ -7974,9 +7974,9 @@ function Go(n, e = null) {
7974
7974
  } else {
7975
7975
  if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
7976
7976
  let f = i, d = i;
7977
- for (let p = 0; p < t.rangeCount; p++) {
7978
- let h = t.getRangeAt(p);
7979
- f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
7977
+ for (let h = 0; h < t.rangeCount; h++) {
7978
+ let p = t.getRangeAt(h);
7979
+ f = Math.min(f, n.docView.posFromDOM(p.startContainer, p.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(p.endContainer, p.endOffset, -1));
7980
7980
  }
7981
7981
  if (f < 0)
7982
7982
  return null;
@@ -8333,29 +8333,29 @@ function fp(n, e) {
8333
8333
  return !1;
8334
8334
  }
8335
8335
  function Yc(n, e) {
8336
- n.someProp("transformCopied", (p) => {
8337
- e = p(e, n);
8336
+ n.someProp("transformCopied", (h) => {
8337
+ e = h(e, n);
8338
8338
  });
8339
8339
  let t = [], { content: r, openStart: s, openEnd: o } = e;
8340
8340
  for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
8341
8341
  s--, o--;
8342
- let p = r.firstChild;
8343
- t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
8342
+ let h = r.firstChild;
8343
+ t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
8344
8344
  }
8345
8345
  let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = tu(), a = l.createElement("div");
8346
8346
  a.appendChild(i.serializeFragment(r, { document: l }));
8347
8347
  let c = a.firstChild, u, f = 0;
8348
8348
  for (; c && c.nodeType == 1 && (u = eu[c.nodeName.toLowerCase()]); ) {
8349
- for (let p = u.length - 1; p >= 0; p--) {
8350
- let h = l.createElement(u[p]);
8349
+ for (let h = u.length - 1; h >= 0; h--) {
8350
+ let p = l.createElement(u[h]);
8351
8351
  for (; a.firstChild; )
8352
- h.appendChild(a.firstChild);
8353
- a.appendChild(h), f++;
8352
+ p.appendChild(a.firstChild);
8353
+ a.appendChild(p), f++;
8354
8354
  }
8355
8355
  c = a.firstChild;
8356
8356
  }
8357
8357
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
8358
- let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
8358
+ let d = n.someProp("clipboardTextSerializer", (h) => h(e, n)) || e.content.textBetween(0, e.content.size, `
8359
8359
 
8360
8360
  `);
8361
8361
  return { dom: a, text: d, slice: e };
@@ -8369,16 +8369,16 @@ function Gc(n, e, t, r, s) {
8369
8369
  if (n.someProp("transformPastedText", (d) => {
8370
8370
  e = d(e, o || r, n);
8371
8371
  }), o)
8372
- return e ? new M(k.from(n.state.schema.text(e.replace(/\r\n?/g, `
8372
+ return e ? new M(S.from(n.state.schema.text(e.replace(/\r\n?/g, `
8373
8373
  `))), 0, 0) : M.empty;
8374
8374
  let f = n.someProp("clipboardTextParser", (d) => d(e, s, r, n));
8375
8375
  if (f)
8376
8376
  l = f;
8377
8377
  else {
8378
- let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
8378
+ let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
8379
8379
  i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
8380
8380
  let m = i.appendChild(document.createElement("p"));
8381
- y && m.appendChild(h.serializeNode(p.text(y, d)));
8381
+ y && m.appendChild(p.serializeNode(h.text(y, d)));
8382
8382
  });
8383
8383
  }
8384
8384
  } else
@@ -8405,9 +8405,9 @@ function Gc(n, e, t, r, s) {
8405
8405
  l = yp(Ol(l, +u[1], +u[2]), u[4]);
8406
8406
  else if (l = M.maxOpen(hp(l.content, s), !0), l.openStart || l.openEnd) {
8407
8407
  let f = 0, d = 0;
8408
- for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
8408
+ for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
8409
8409
  ;
8410
- for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
8410
+ for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
8411
8411
  ;
8412
8412
  l = Ol(l, f, d);
8413
8413
  }
@@ -8435,13 +8435,13 @@ function hp(n, e) {
8435
8435
  i.push(u), s = s.matchType(u.type), o = a;
8436
8436
  }
8437
8437
  }), i)
8438
- return k.from(i);
8438
+ return S.from(i);
8439
8439
  }
8440
8440
  return n;
8441
8441
  }
8442
8442
  function Xc(n, e, t = 0) {
8443
8443
  for (let r = e.length - 1; r >= t; r--)
8444
- n = e[r].create(null, k.from(n));
8444
+ n = e[r].create(null, S.from(n));
8445
8445
  return n;
8446
8446
  }
8447
8447
  function Qc(n, e, t, r, s) {
@@ -8450,18 +8450,18 @@ function Qc(n, e, t, r, s) {
8450
8450
  if (o)
8451
8451
  return r.copy(r.content.replaceChild(r.childCount - 1, o));
8452
8452
  if (r.contentMatchAt(r.childCount).matchType(s == n.length - 1 ? t.type : n[s + 1]))
8453
- return r.copy(r.content.append(k.from(Xc(t, n, s + 1))));
8453
+ return r.copy(r.content.append(S.from(Xc(t, n, s + 1))));
8454
8454
  }
8455
8455
  }
8456
8456
  function Zc(n, e) {
8457
8457
  if (e == 0)
8458
8458
  return n;
8459
- let t = n.content.replaceChild(n.childCount - 1, Zc(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(k.empty, !0);
8459
+ let t = n.content.replaceChild(n.childCount - 1, Zc(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(S.empty, !0);
8460
8460
  return n.copy(t.append(r));
8461
8461
  }
8462
8462
  function So(n, e, t, r, s, o) {
8463
8463
  let i = e < 0 ? n.firstChild : n.lastChild, l = i.content;
8464
- return n.childCount > 1 && (o = 0), s < r - 1 && (l = So(l, e, t, r, s + 1, o)), s >= t && (l = e < 0 ? i.contentMatchAt(0).fillBefore(l, o <= s).append(l) : l.append(i.contentMatchAt(i.childCount).fillBefore(k.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, i.copy(l));
8464
+ return n.childCount > 1 && (o = 0), s < r - 1 && (l = So(l, e, t, r, s + 1, o)), s >= t && (l = e < 0 ? i.contentMatchAt(0).fillBefore(l, o <= s).append(l) : l.append(i.contentMatchAt(i.childCount).fillBefore(S.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, i.copy(l));
8465
8465
  }
8466
8466
  function Ol(n, e, t) {
8467
8467
  return e < n.openStart && (n = new M(So(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new M(So(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
@@ -8516,7 +8516,7 @@ function yp(n, e) {
8516
8516
  let a = t.nodes[r[l]];
8517
8517
  if (!a || a.hasRequiredAttrs())
8518
8518
  break;
8519
- s = k.from(a.create(r[l + 1], s)), o++, i++;
8519
+ s = S.from(a.create(r[l + 1], s)), o++, i++;
8520
8520
  }
8521
8521
  return new M(s, o, i);
8522
8522
  }
@@ -8892,11 +8892,11 @@ ye.drop = (n, e) => {
8892
8892
  if (!s)
8893
8893
  return;
8894
8894
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
8895
- i ? n.someProp("transformPasted", (h) => {
8896
- i = h(i, n);
8895
+ i ? n.someProp("transformPasted", (p) => {
8896
+ i = p(i, n);
8897
8897
  }) : i = Gc(n, iu(t.dataTransfer), Qn ? null : t.dataTransfer.getData("text/html"), !1, o);
8898
8898
  let l = !!(r && !t[au]);
8899
- if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
8899
+ if (n.someProp("handleDrop", (p) => p(n, t, i || M.empty, l))) {
8900
8900
  t.preventDefault();
8901
8901
  return;
8902
8902
  }
@@ -8907,18 +8907,18 @@ ye.drop = (n, e) => {
8907
8907
  a == null && (a = o.pos);
8908
8908
  let c = n.state.tr;
8909
8909
  if (l) {
8910
- let { node: h } = r;
8911
- h ? h.replace(c) : c.deleteSelection();
8910
+ let { node: p } = r;
8911
+ p ? p.replace(c) : c.deleteSelection();
8912
8912
  }
8913
8913
  let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
8914
8914
  if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
8915
8915
  return;
8916
- let p = c.doc.resolve(u);
8917
- if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
8918
- c.setSelection(new D(p));
8916
+ let h = c.doc.resolve(u);
8917
+ if (f && D.isSelectable(i.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(i.content.firstChild))
8918
+ c.setSelection(new D(h));
8919
8919
  else {
8920
- let h = c.mapping.map(a);
8921
- c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(Xo(n, p, c.doc.resolve(h)));
8920
+ let p = c.mapping.map(a);
8921
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, k) => p = k), c.setSelection(Xo(n, h, c.doc.resolve(p)));
8922
8922
  }
8923
8923
  n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
8924
8924
  };
@@ -9320,14 +9320,14 @@ function Fp(n, e, t, r, s, o, i) {
9320
9320
  let l = n.slice();
9321
9321
  for (let c = 0, u = o; c < t.maps.length; c++) {
9322
9322
  let f = 0;
9323
- t.maps[c].forEach((d, p, h, y) => {
9324
- let m = y - h - (p - d);
9323
+ t.maps[c].forEach((d, h, p, y) => {
9324
+ let m = y - p - (h - d);
9325
9325
  for (let x = 0; x < l.length; x += 3) {
9326
- let C = l[x + 1];
9327
- if (C < 0 || d > C + u - f)
9326
+ let k = l[x + 1];
9327
+ if (k < 0 || d > k + u - f)
9328
9328
  continue;
9329
9329
  let w = l[x] + u - f;
9330
- p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
9330
+ h >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
9331
9331
  }
9332
9332
  f += m;
9333
9333
  }), u = t.maps[c].map(u, -1);
@@ -9344,10 +9344,10 @@ function Fp(n, e, t, r, s, o, i) {
9344
9344
  a = !0;
9345
9345
  continue;
9346
9346
  }
9347
- let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
9348
- if (m && y == f && y + m.nodeSize == p) {
9347
+ let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
9348
+ if (m && y == f && y + m.nodeSize == h) {
9349
9349
  let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
9350
- x != ae ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
9350
+ x != ae ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
9351
9351
  } else
9352
9352
  a = !0;
9353
9353
  }
@@ -9357,8 +9357,8 @@ function Fp(n, e, t, r, s, o, i) {
9357
9357
  for (let f = 0; f < l.length; f += 3)
9358
9358
  l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
9359
9359
  for (let f = 0, d = 0; f < u.children.length; f += 3) {
9360
- let p = u.children[f];
9361
- for (; d < l.length && l[d] < p; )
9360
+ let h = u.children[f];
9361
+ for (; d < l.length && l[d] < h; )
9362
9362
  d += 3;
9363
9363
  l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
9364
9364
  }
@@ -9573,8 +9573,8 @@ class qp {
9573
9573
  } else {
9574
9574
  let { focusNode: f } = this.currentSelection;
9575
9575
  for (let d of u) {
9576
- let p = d.parentNode;
9577
- p && p.nodeName == "LI" && (!f || Jp(e, f) != p) && d.remove();
9576
+ let h = d.parentNode;
9577
+ h && h.nodeName == "LI" && (!f || Jp(e, f) != h) && d.remove();
9578
9578
  }
9579
9579
  }
9580
9580
  }
@@ -9650,30 +9650,30 @@ function Up(n, e, t) {
9650
9650
  let { node: r, fromOffset: s, toOffset: o, from: i, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
9651
9651
  if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], ds(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), ue && n.input.lastKeyCode === 8)
9652
9652
  for (let m = o; m > s; m--) {
9653
- let x = r.childNodes[m - 1], C = x.pmViewDesc;
9654
- if (x.nodeName == "BR" && !C) {
9653
+ let x = r.childNodes[m - 1], k = x.pmViewDesc;
9654
+ if (x.nodeName == "BR" && !k) {
9655
9655
  o = m;
9656
9656
  break;
9657
9657
  }
9658
- if (!C || C.size)
9658
+ if (!k || k.size)
9659
9659
  break;
9660
9660
  }
9661
- let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema), p = f.resolve(i), h = null, y = d.parse(r, {
9662
- topNode: p.parent,
9663
- topMatch: p.parent.contentMatchAt(p.index()),
9661
+ let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema), h = f.resolve(i), p = null, y = d.parse(r, {
9662
+ topNode: h.parent,
9663
+ topMatch: h.parent.contentMatchAt(h.index()),
9664
9664
  topOpen: !0,
9665
9665
  from: s,
9666
9666
  to: o,
9667
- preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
9667
+ preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
9668
9668
  findPositions: c,
9669
9669
  ruleFromNode: Yp,
9670
- context: p
9670
+ context: h
9671
9671
  });
9672
9672
  if (c && c[0].pos != null) {
9673
9673
  let m = c[0].pos, x = c[1] && c[1].pos;
9674
- x == null && (x = m), h = { anchor: m + i, head: x + i };
9674
+ x == null && (x = m), p = { anchor: m + i, head: x + i };
9675
9675
  }
9676
- return { doc: y, sel: h, from: i, to: l };
9676
+ return { doc: y, sel: p, from: i, to: l };
9677
9677
  }
9678
9678
  function Yp(n) {
9679
9679
  let e = n.pmViewDesc;
@@ -9704,16 +9704,16 @@ function Xp(n, e, t, r, s) {
9704
9704
  }
9705
9705
  let i = n.state.doc.resolve(e), l = i.sharedDepth(t);
9706
9706
  e = i.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
9707
- let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, p;
9708
- n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, p = "end") : (d = n.state.selection.from, p = "start"), n.input.lastKeyCode = null;
9709
- let h = em(f.content, c.doc.content, c.from, d, p);
9710
- if (h && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || at) && s.some((E) => E.nodeType == 1 && !Gp.test(E.nodeName)) && (!h || h.endA >= h.endB) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9707
+ let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, h;
9708
+ n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, h = "end") : (d = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
9709
+ let p = em(f.content, c.doc.content, c.from, d, h);
9710
+ if (p && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || at) && s.some((E) => E.nodeType == 1 && !Gp.test(E.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9711
9711
  n.input.lastIOSEnter = 0;
9712
9712
  return;
9713
9713
  }
9714
- if (!h)
9714
+ if (!p)
9715
9715
  if (r && a instanceof V && !a.empty && a.$head.sameParent(a.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
9716
- h = { start: a.from, endA: a.to, endB: a.to };
9716
+ p = { start: a.from, endA: a.to, endB: a.to };
9717
9717
  else {
9718
9718
  if (c.sel) {
9719
9719
  let E = vl(n, n.state.doc, c.sel);
@@ -9724,42 +9724,42 @@ function Xp(n, e, t, r, s) {
9724
9724
  }
9725
9725
  return;
9726
9726
  }
9727
- n.state.selection.from < n.state.selection.to && h.start == h.endB && n.state.selection instanceof V && (h.start > n.state.selection.from && h.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? h.start = n.state.selection.from : h.endA < n.state.selection.to && h.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (h.endB += n.state.selection.to - h.endA, h.endA = n.state.selection.to)), ke && Ot <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == "  " && (h.start--, h.endA--, h.endB--);
9728
- let y = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), x = u.resolve(h.start), C = y.sameParent(m) && y.parent.inlineContent && x.end() >= h.endA, w;
9729
- if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!C || s.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !C && y.pos < c.doc.content.size && !y.sameParent(m) && (w = z.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head == m.pos) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9727
+ n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof V && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ke && Ot <= 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--);
9728
+ let y = c.doc.resolveNoCache(p.start - c.from), m = c.doc.resolveNoCache(p.endB - c.from), x = u.resolve(p.start), k = y.sameParent(m) && y.parent.inlineContent && x.end() >= p.endA, w;
9729
+ if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !k && y.pos < c.doc.content.size && !y.sameParent(m) && (w = z.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head == m.pos) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9730
9730
  n.input.lastIOSEnter = 0;
9731
9731
  return;
9732
9732
  }
9733
- if (n.state.selection.anchor > h.start && Zp(u, h.start, h.endA, y, m) && n.someProp("handleKeyDown", (E) => E(n, Lt(8, "Backspace")))) {
9733
+ if (n.state.selection.anchor > p.start && Zp(u, p.start, p.endA, y, m) && n.someProp("handleKeyDown", (E) => E(n, Lt(8, "Backspace")))) {
9734
9734
  at && ue && n.domObserver.suppressSelectionUpdates();
9735
9735
  return;
9736
9736
  }
9737
- ue && h.endB == h.start && (n.input.lastChromeDelete = Date.now()), at && !C && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
9737
+ ue && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), at && !k && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, m = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
9738
9738
  n.someProp("handleKeyDown", function(E) {
9739
9739
  return E(n, Lt(13, "Enter"));
9740
9740
  });
9741
9741
  }, 20));
9742
- let O = h.start, v = h.endA, S, $, j;
9743
- if (C) {
9742
+ let O = p.start, v = p.endA, C, $, j;
9743
+ if (k) {
9744
9744
  if (y.pos == m.pos)
9745
- ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), S = n.state.tr.delete(O, v), $ = u.resolve(h.start).marksAcross(u.resolve(h.endA));
9745
+ ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), C = n.state.tr.delete(O, v), $ = u.resolve(p.start).marksAcross(u.resolve(p.endA));
9746
9746
  else if (
9747
9747
  // Adding or removing a mark
9748
- h.endA == h.endB && (j = Qp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, h.endA - x.start())))
9748
+ p.endA == p.endB && (j = Qp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, p.endA - x.start())))
9749
9749
  )
9750
- S = n.state.tr, j.type == "add" ? S.addMark(O, v, j.mark) : S.removeMark(O, v, j.mark);
9750
+ C = n.state.tr, j.type == "add" ? C.addMark(O, v, j.mark) : C.removeMark(O, v, j.mark);
9751
9751
  else if (y.parent.child(y.index()).isText && y.index() == m.index() - (m.textOffset ? 0 : 1)) {
9752
9752
  let E = y.parent.textBetween(y.parentOffset, m.parentOffset);
9753
9753
  if (n.someProp("handleTextInput", (_) => _(n, O, v, E)))
9754
9754
  return;
9755
- S = n.state.tr.insertText(E, O, v);
9755
+ C = n.state.tr.insertText(E, O, v);
9756
9756
  }
9757
9757
  }
9758
- if (S || (S = n.state.tr.replace(O, v, c.doc.slice(h.start - c.from, h.endB - c.from))), c.sel) {
9759
- let E = vl(n, S.doc, c.sel);
9760
- E && !(ue && n.composing && E.empty && (h.start != h.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == O || E.head == S.mapping.map(v) - 1) || ke && E.empty && E.head == O) && S.setSelection(E);
9758
+ if (C || (C = n.state.tr.replace(O, v, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
9759
+ let E = vl(n, C.doc, c.sel);
9760
+ E && !(ue && n.composing && E.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == O || E.head == C.mapping.map(v) - 1) || ke && E.empty && E.head == O) && C.setSelection(E);
9761
9761
  }
9762
- $ && S.ensureMarks($), o && S.setMeta("composition", o), n.dispatch(S.scrollIntoView());
9762
+ $ && C.ensureMarks($), o && C.setMeta("composition", o), n.dispatch(C.scrollIntoView());
9763
9763
  }
9764
9764
  function vl(n, e, t) {
9765
9765
  return Math.max(t.anchor, t.head) > e.content.size ? null : Xo(n, e.resolve(t.anchor), e.resolve(t.head));
@@ -9779,7 +9779,7 @@ function Qp(n, e) {
9779
9779
  let c = [];
9780
9780
  for (let u = 0; u < e.childCount; u++)
9781
9781
  c.push(a(e.child(u)));
9782
- if (k.from(c).eq(n))
9782
+ if (S.from(c).eq(n))
9783
9783
  return { mark: l, type: i };
9784
9784
  }
9785
9785
  function Zp(n, e, t, r, s) {
@@ -9902,8 +9902,8 @@ class tm {
9902
9902
  e.storedMarks && this.composing && (ou(this), i = !0), this.state = e;
9903
9903
  let l = s.plugins != e.plugins || this._props.plugins != t.plugins;
9904
9904
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9905
- let p = Fl(this);
9906
- rm(p, this.nodeViews) && (this.nodeViews = p, o = !0);
9905
+ let h = Fl(this);
9906
+ rm(h, this.nodeViews) && (this.nodeViews = h, o = !0);
9907
9907
  }
9908
9908
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Co(this), this.editable = jl(this), zl(this);
9909
9909
  let a = _s(this), c = $l(this), u = s.plugins != e.plugins && !s.doc.eq(e.doc) ? "reset" : e.scrollToSelection > s.scrollToSelection ? "to selection" : "preserve", f = o || !this.docView.matchesNode(e.doc, c, a);
@@ -9911,12 +9911,12 @@ class tm {
9911
9911
  let d = u == "preserve" && i && this.dom.style.overflowAnchor == null && vh(this);
9912
9912
  if (i) {
9913
9913
  this.domObserver.stop();
9914
- let p = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && nm(s.selection, e.selection);
9914
+ let h = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && nm(s.selection, e.selection);
9915
9915
  if (f) {
9916
- let h = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
9917
- this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)), h && !this.trackWrites && (p = !0);
9916
+ let p = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
9917
+ this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9918
9918
  }
9919
- p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && sp(this)) ? ut(this, p) : (Kc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9919
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && sp(this)) ? ut(this, h) : (Kc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9920
9920
  }
9921
9921
  this.updatePluginViews(s), !((r = this.dragging) === null || r === void 0) && r.node && !s.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, s), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : d && Vh(d);
9922
9922
  }
@@ -10392,9 +10392,9 @@ function cm(n, e) {
10392
10392
  let { $from: t } = n.state.selection, r = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
10393
10393
  if (!r)
10394
10394
  return !1;
10395
- let s = k.empty;
10395
+ let s = S.empty;
10396
10396
  for (let i = r.length - 1; i >= 0; i--)
10397
- s = k.from(r[i].createAndFill(null, s));
10397
+ s = S.from(r[i].createAndFill(null, s));
10398
10398
  let o = n.state.tr.replace(t.pos, t.pos, new M(s, 0, 0));
10399
10399
  return o.setSelection(V.near(o.doc.resolve(t.pos + 1))), n.dispatch(o), !1;
10400
10400
  }
@@ -10460,9 +10460,9 @@ function bm(n, e, t, r = null) {
10460
10460
  return l ? (n && xm(n, e, l, s, t), !0) : !1;
10461
10461
  }
10462
10462
  function xm(n, e, t, r, s) {
10463
- let o = k.empty;
10463
+ let o = S.empty;
10464
10464
  for (let u = t.length - 1; u >= 0; u--)
10465
- o = k.from(t[u].type.create(t[u].attrs, o));
10465
+ o = S.from(t[u].type.create(t[u].attrs, o));
10466
10466
  n.step(new oe(e.start - (r ? 2 : 0), e.end, e.start, e.end, new M(o, 0, 0), t.length, !0));
10467
10467
  let i = 0;
10468
10468
  for (let u = 0; u < t.length; u++)
@@ -10484,16 +10484,16 @@ function km(n, e) {
10484
10484
  if (s.depth == 3 || s.node(-3).type != n || s.index(-2) != s.node(-2).childCount - 1)
10485
10485
  return !1;
10486
10486
  if (r) {
10487
- let f = k.empty, d = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
10487
+ let f = S.empty, d = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
10488
10488
  for (let x = s.depth - d; x >= s.depth - 3; x--)
10489
- f = k.from(s.node(x).copy(f));
10490
- let p = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
10491
- f = f.append(k.from(n.createAndFill()));
10492
- let h = s.before(s.depth - (d - 1)), y = t.tr.replace(h, s.after(-p), new M(f, 4 - d, 0)), m = -1;
10493
- y.doc.nodesBetween(h, y.doc.content.size, (x, C) => {
10489
+ f = S.from(s.node(x).copy(f));
10490
+ let h = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
10491
+ f = f.append(S.from(n.createAndFill()));
10492
+ let p = s.before(s.depth - (d - 1)), y = t.tr.replace(p, s.after(-h), new M(f, 4 - d, 0)), m = -1;
10493
+ y.doc.nodesBetween(p, y.doc.content.size, (x, k) => {
10494
10494
  if (m > -1)
10495
10495
  return !1;
10496
- x.isTextblock && x.content.size == 0 && (m = C + 1);
10496
+ x.isTextblock && x.content.size == 0 && (m = k + 1);
10497
10497
  }), m > -1 && y.setSelection(z.near(y.doc.resolve(m))), r(y.scrollIntoView());
10498
10498
  }
10499
10499
  return !0;
@@ -10510,7 +10510,7 @@ function Sm(n) {
10510
10510
  }
10511
10511
  function Cm(n, e, t, r) {
10512
10512
  let s = n.tr, o = r.end, i = r.$to.end(r.depth);
10513
- o < i && (s.step(new oe(o - 1, i, o, i, new M(k.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Br(s.doc.resolve(r.$from.pos), s.doc.resolve(i), r.depth));
10513
+ o < i && (s.step(new oe(o - 1, i, o, i, new M(S.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Br(s.doc.resolve(r.$from.pos), s.doc.resolve(i), r.depth));
10514
10514
  const l = ur(r);
10515
10515
  if (l == null)
10516
10516
  return !1;
@@ -10520,16 +10520,16 @@ function Cm(n, e, t, r) {
10520
10520
  }
10521
10521
  function wm(n, e, t) {
10522
10522
  let r = n.tr, s = t.parent;
10523
- for (let p = t.end, h = t.endIndex - 1, y = t.startIndex; h > y; h--)
10524
- p -= s.child(h).nodeSize, r.delete(p - 1, p + 1);
10523
+ for (let h = t.end, p = t.endIndex - 1, y = t.startIndex; p > y; p--)
10524
+ h -= s.child(p).nodeSize, r.delete(h - 1, h + 1);
10525
10525
  let o = r.doc.resolve(t.start), i = o.nodeAfter;
10526
10526
  if (r.mapping.map(t.end) != t.start + o.nodeAfter.nodeSize)
10527
10527
  return !1;
10528
10528
  let l = t.startIndex == 0, a = t.endIndex == s.childCount, c = o.node(-1), u = o.index(-1);
10529
- if (!c.canReplace(u + (l ? 0 : 1), u + 1, i.content.append(a ? k.empty : k.from(s))))
10529
+ if (!c.canReplace(u + (l ? 0 : 1), u + 1, i.content.append(a ? S.empty : S.from(s))))
10530
10530
  return !1;
10531
10531
  let f = o.pos, d = f + i.nodeSize;
10532
- return r.step(new oe(f - (l ? 1 : 0), d + (a ? 1 : 0), f + 1, d - 1, new M((l ? k.empty : k.from(s.copy(k.empty))).append(a ? k.empty : k.from(s.copy(k.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
10532
+ return r.step(new oe(f - (l ? 1 : 0), d + (a ? 1 : 0), f + 1, d - 1, new M((l ? S.empty : S.from(s.copy(S.empty))).append(a ? S.empty : S.from(s.copy(S.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
10533
10533
  }
10534
10534
  function Mm(n) {
10535
10535
  return function(e, t) {
@@ -10543,8 +10543,8 @@ function Mm(n) {
10543
10543
  if (a.type != n)
10544
10544
  return !1;
10545
10545
  if (t) {
10546
- let c = a.lastChild && a.lastChild.type == l.type, u = k.from(c ? n.create() : null), f = new M(k.from(n.create(null, k.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, p = o.end;
10547
- t(e.tr.step(new oe(d - (c ? 3 : 1), p, d, p, f, 1, !0)).scrollIntoView());
10546
+ let c = a.lastChild && a.lastChild.type == l.type, u = S.from(c ? n.create() : null), f = new M(S.from(n.create(null, S.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, h = o.end;
10547
+ t(e.tr.step(new oe(d - (c ? 3 : 1), h, d, h, f, 1, !0)).scrollIntoView());
10548
10548
  }
10549
10549
  return !0;
10550
10550
  };
@@ -10617,7 +10617,7 @@ function Ll(n, e, t, r, s, o) {
10617
10617
  let i = n.state, l = i.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Dm), l.parentOffset, null, "") + r;
10618
10618
  for (let c = 0; c < s.length; c++) {
10619
10619
  let u = s[c];
10620
- if (!u.inCodeMark && l.marks().some((p) => p.type.spec.code))
10620
+ if (!u.inCodeMark && l.marks().some((h) => h.type.spec.code))
10621
10621
  continue;
10622
10622
  if (l.parent.type.spec.code) {
10623
10623
  if (!u.inCode)
@@ -10657,8 +10657,8 @@ function ri(n, e, t = null, r) {
10657
10657
  if (!d)
10658
10658
  return null;
10659
10659
  c.wrap(f, d);
10660
- let p = c.doc.resolve(i - 1).nodeBefore;
10661
- return p && p.type == e && En(c.doc, i - 1) && (!r || r(o, p)) && c.join(i - 1), c;
10660
+ let h = c.doc.resolve(i - 1).nodeBefore;
10661
+ return h && h.type == e && En(c.doc, i - 1) && (!r || r(o, h)) && c.join(i - 1), c;
10662
10662
  });
10663
10663
  }
10664
10664
  function mu(n, e, t = null) {
@@ -10830,9 +10830,9 @@ function Xm(n, e = null) {
10830
10830
  } else {
10831
10831
  if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
10832
10832
  let f = i, d = i;
10833
- for (let p = 0; p < t.rangeCount; p++) {
10834
- let h = t.getRangeAt(p);
10835
- f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
10833
+ for (let h = 0; h < t.rangeCount; h++) {
10834
+ let p = t.getRangeAt(h);
10835
+ f = Math.min(f, n.docView.posFromDOM(p.startContainer, p.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(p.endContainer, p.endOffset, -1));
10836
10836
  }
10837
10837
  if (f < 0)
10838
10838
  return null;
@@ -11182,29 +11182,29 @@ function ag(n, e) {
11182
11182
  return !1;
11183
11183
  }
11184
11184
  function Nu(n, e) {
11185
- n.someProp("transformCopied", (p) => {
11186
- e = p(e, n);
11185
+ n.someProp("transformCopied", (h) => {
11186
+ e = h(e, n);
11187
11187
  });
11188
11188
  let t = [], { content: r, openStart: s, openEnd: o } = e;
11189
11189
  for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
11190
11190
  s--, o--;
11191
- let p = r.firstChild;
11192
- t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
11191
+ let h = r.firstChild;
11192
+ t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
11193
11193
  }
11194
11194
  let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = Ru(), a = l.createElement("div");
11195
11195
  a.appendChild(i.serializeFragment(r, { document: l }));
11196
11196
  let c = a.firstChild, u, f = 0;
11197
11197
  for (; c && c.nodeType == 1 && (u = Au[c.nodeName.toLowerCase()]); ) {
11198
- for (let p = u.length - 1; p >= 0; p--) {
11199
- let h = l.createElement(u[p]);
11198
+ for (let h = u.length - 1; h >= 0; h--) {
11199
+ let p = l.createElement(u[h]);
11200
11200
  for (; a.firstChild; )
11201
- h.appendChild(a.firstChild);
11202
- a.appendChild(h), f++;
11201
+ p.appendChild(a.firstChild);
11202
+ a.appendChild(p), f++;
11203
11203
  }
11204
11204
  c = a.firstChild;
11205
11205
  }
11206
11206
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
11207
- let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
11207
+ let d = n.someProp("clipboardTextSerializer", (h) => h(e, n)) || e.content.textBetween(0, e.content.size, `
11208
11208
 
11209
11209
  `);
11210
11210
  return { dom: a, text: d, slice: e };
@@ -11218,16 +11218,16 @@ function Du(n, e, t, r, s) {
11218
11218
  if (n.someProp("transformPastedText", (d) => {
11219
11219
  e = d(e, o || r, n);
11220
11220
  }), o)
11221
- return e ? new M(k.from(n.state.schema.text(e.replace(/\r\n?/g, `
11221
+ return e ? new M(S.from(n.state.schema.text(e.replace(/\r\n?/g, `
11222
11222
  `))), 0, 0) : M.empty;
11223
11223
  let f = n.someProp("clipboardTextParser", (d) => d(e, s, r, n));
11224
11224
  if (f)
11225
11225
  l = f;
11226
11226
  else {
11227
- let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
11227
+ let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
11228
11228
  i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
11229
11229
  let m = i.appendChild(document.createElement("p"));
11230
- y && m.appendChild(h.serializeNode(p.text(y, d)));
11230
+ y && m.appendChild(p.serializeNode(h.text(y, d)));
11231
11231
  });
11232
11232
  }
11233
11233
  } else
@@ -11254,9 +11254,9 @@ function Du(n, e, t, r, s) {
11254
11254
  l = pg(ea(l, +u[1], +u[2]), u[4]);
11255
11255
  else if (l = M.maxOpen(ug(l.content, s), !0), l.openStart || l.openEnd) {
11256
11256
  let f = 0, d = 0;
11257
- for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
11257
+ for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
11258
11258
  ;
11259
- for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
11259
+ for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
11260
11260
  ;
11261
11261
  l = ea(l, f, d);
11262
11262
  }
@@ -11284,13 +11284,13 @@ function ug(n, e) {
11284
11284
  i.push(u), s = s.matchType(u.type), o = a;
11285
11285
  }
11286
11286
  }), i)
11287
- return k.from(i);
11287
+ return S.from(i);
11288
11288
  }
11289
11289
  return n;
11290
11290
  }
11291
11291
  function Ou(n, e, t = 0) {
11292
11292
  for (let r = e.length - 1; r >= t; r--)
11293
- n = e[r].create(null, k.from(n));
11293
+ n = e[r].create(null, S.from(n));
11294
11294
  return n;
11295
11295
  }
11296
11296
  function Eu(n, e, t, r, s) {
@@ -11299,18 +11299,18 @@ function Eu(n, e, t, r, s) {
11299
11299
  if (o)
11300
11300
  return r.copy(r.content.replaceChild(r.childCount - 1, o));
11301
11301
  if (r.contentMatchAt(r.childCount).matchType(s == n.length - 1 ? t.type : n[s + 1]))
11302
- return r.copy(r.content.append(k.from(Ou(t, n, s + 1))));
11302
+ return r.copy(r.content.append(S.from(Ou(t, n, s + 1))));
11303
11303
  }
11304
11304
  }
11305
11305
  function Tu(n, e) {
11306
11306
  if (e == 0)
11307
11307
  return n;
11308
- let t = n.content.replaceChild(n.childCount - 1, Tu(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(k.empty, !0);
11308
+ let t = n.content.replaceChild(n.childCount - 1, Tu(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(S.empty, !0);
11309
11309
  return n.copy(t.append(r));
11310
11310
  }
11311
11311
  function To(n, e, t, r, s, o) {
11312
11312
  let i = e < 0 ? n.firstChild : n.lastChild, l = i.content;
11313
- return n.childCount > 1 && (o = 0), s < r - 1 && (l = To(l, e, t, r, s + 1, o)), s >= t && (l = e < 0 ? i.contentMatchAt(0).fillBefore(l, o <= s).append(l) : l.append(i.contentMatchAt(i.childCount).fillBefore(k.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, i.copy(l));
11313
+ return n.childCount > 1 && (o = 0), s < r - 1 && (l = To(l, e, t, r, s + 1, o)), s >= t && (l = e < 0 ? i.contentMatchAt(0).fillBefore(l, o <= s).append(l) : l.append(i.contentMatchAt(i.childCount).fillBefore(S.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, i.copy(l));
11314
11314
  }
11315
11315
  function ea(n, e, t) {
11316
11316
  return e < n.openStart && (n = new M(To(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new M(To(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
@@ -11365,7 +11365,7 @@ function pg(n, e) {
11365
11365
  let a = t.nodes[r[l]];
11366
11366
  if (!a || a.hasRequiredAttrs())
11367
11367
  break;
11368
- s = k.from(a.create(r[l + 1], s)), o++, i++;
11368
+ s = S.from(a.create(r[l + 1], s)), o++, i++;
11369
11369
  }
11370
11370
  return new M(s, o, i);
11371
11371
  }
@@ -11681,11 +11681,11 @@ De.drop = (n, e) => {
11681
11681
  if (!s)
11682
11682
  return;
11683
11683
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
11684
- i ? n.someProp("transformPasted", (h) => {
11685
- i = h(i, n);
11684
+ i ? n.someProp("transformPasted", (p) => {
11685
+ i = p(i, n);
11686
11686
  }) : i = Du(n, Vu(t.dataTransfer), tr ? null : t.dataTransfer.getData("text/html"), !1, o);
11687
11687
  let l = !!(r && $u(n, t));
11688
- if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
11688
+ if (n.someProp("handleDrop", (p) => p(n, t, i || M.empty, l))) {
11689
11689
  t.preventDefault();
11690
11690
  return;
11691
11691
  }
@@ -11696,18 +11696,18 @@ De.drop = (n, e) => {
11696
11696
  a == null && (a = o.pos);
11697
11697
  let c = n.state.tr;
11698
11698
  if (l) {
11699
- let { node: h } = r;
11700
- h ? h.replace(c) : c.deleteSelection();
11699
+ let { node: p } = r;
11700
+ p ? p.replace(c) : c.deleteSelection();
11701
11701
  }
11702
11702
  let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
11703
11703
  if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
11704
11704
  return;
11705
- let p = c.doc.resolve(u);
11706
- if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
11707
- c.setSelection(new D(p));
11705
+ let h = c.doc.resolve(u);
11706
+ if (f && D.isSelectable(i.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(i.content.firstChild))
11707
+ c.setSelection(new D(h));
11708
11708
  else {
11709
- let h = c.mapping.map(a);
11710
- c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(wu(n, p, c.doc.resolve(h)));
11709
+ let p = c.mapping.map(a);
11710
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, k) => p = k), c.setSelection(wu(n, h, c.doc.resolve(p)));
11711
11711
  }
11712
11712
  n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
11713
11713
  };
@@ -12112,14 +12112,14 @@ function Ig(n, e, t, r, s, o, i) {
12112
12112
  let l = n.slice();
12113
12113
  for (let c = 0, u = o; c < t.maps.length; c++) {
12114
12114
  let f = 0;
12115
- t.maps[c].forEach((d, p, h, y) => {
12116
- let m = y - h - (p - d);
12115
+ t.maps[c].forEach((d, h, p, y) => {
12116
+ let m = y - p - (h - d);
12117
12117
  for (let x = 0; x < l.length; x += 3) {
12118
- let C = l[x + 1];
12119
- if (C < 0 || d > C + u - f)
12118
+ let k = l[x + 1];
12119
+ if (k < 0 || d > k + u - f)
12120
12120
  continue;
12121
12121
  let w = l[x] + u - f;
12122
- p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
12122
+ h >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
12123
12123
  }
12124
12124
  f += m;
12125
12125
  }), u = t.maps[c].map(u, -1);
@@ -12136,10 +12136,10 @@ function Ig(n, e, t, r, s, o, i) {
12136
12136
  a = !0;
12137
12137
  continue;
12138
12138
  }
12139
- let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
12140
- if (m && y == f && y + m.nodeSize == p) {
12139
+ let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
12140
+ if (m && y == f && y + m.nodeSize == h) {
12141
12141
  let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
12142
- x != pe ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
12142
+ x != pe ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
12143
12143
  } else
12144
12144
  a = !0;
12145
12145
  }
@@ -12149,8 +12149,8 @@ function Ig(n, e, t, r, s, o, i) {
12149
12149
  for (let f = 0; f < l.length; f += 3)
12150
12150
  l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
12151
12151
  for (let f = 0, d = 0; f < u.children.length; f += 3) {
12152
- let p = u.children[f];
12153
- for (; d < l.length && l[d] < p; )
12152
+ let h = u.children[f];
12153
+ for (; d < l.length && l[d] < h; )
12154
12154
  d += 3;
12155
12155
  l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
12156
12156
  }
@@ -12339,10 +12339,10 @@ function vg(n) {
12339
12339
  for (let c = 0, u = 0; c < t; c++) {
12340
12340
  const f = n.child(c);
12341
12341
  u++;
12342
- for (let h = 0; ; h++) {
12342
+ for (let p = 0; ; p++) {
12343
12343
  for (; s < r.length && r[s] != 0; ) s++;
12344
- if (h == f.childCount) break;
12345
- const y = f.child(h), { colspan: m, rowspan: x, colwidth: C } = y.attrs;
12344
+ if (p == f.childCount) break;
12345
+ const y = f.child(p), { colspan: m, rowspan: x, colwidth: k } = y.attrs;
12346
12346
  for (let w = 0; w < x; w++) {
12347
12347
  if (w + c >= t) {
12348
12348
  (o || (o = [])).push({
@@ -12360,19 +12360,19 @@ function vg(n) {
12360
12360
  pos: u,
12361
12361
  n: m - v
12362
12362
  });
12363
- const S = C && C[v];
12364
- if (S) {
12363
+ const C = k && k[v];
12364
+ if (C) {
12365
12365
  const $ = (O + v) % e * 2, j = i[$];
12366
- j == null || j != S && i[$ + 1] == 1 ? (i[$] = S, i[$ + 1] = 1) : j == S && i[$ + 1]++;
12366
+ j == null || j != C && i[$ + 1] == 1 ? (i[$] = C, i[$ + 1] = 1) : j == C && i[$ + 1]++;
12367
12367
  }
12368
12368
  }
12369
12369
  }
12370
12370
  s += m, u += y.nodeSize;
12371
12371
  }
12372
12372
  const d = (c + 1) * e;
12373
- let p = 0;
12374
- for (; s < d; ) r[s++] == 0 && p++;
12375
- p && (o || (o = [])).push({ type: "missing", row: c, n: p }), u++;
12373
+ let h = 0;
12374
+ for (; s < d; ) r[s++] == 0 && h++;
12375
+ h && (o || (o = [])).push({ type: "missing", row: c, n: h }), u++;
12376
12376
  }
12377
12377
  (e === 0 || t === 0) && (o || (o = [])).push({ type: "zero_sized" });
12378
12378
  const l = new Z(e, t, r, o);
@@ -12648,38 +12648,38 @@ var H = class st extends z {
12648
12648
  const d = t.map[u];
12649
12649
  if (o[d]) continue;
12650
12650
  o[d] = !0;
12651
- const p = t.findCell(d);
12652
- let h = e.nodeAt(d);
12653
- if (!h)
12651
+ const h = t.findCell(d);
12652
+ let p = e.nodeAt(d);
12653
+ if (!p)
12654
12654
  throw RangeError(`No cell with offset ${d} found`);
12655
- const y = s.left - p.left, m = p.right - s.right;
12655
+ const y = s.left - h.left, m = h.right - s.right;
12656
12656
  if (y > 0 || m > 0) {
12657
- let x = h.attrs;
12657
+ let x = p.attrs;
12658
12658
  if (y > 0 && (x = en(x, 0, y)), m > 0 && (x = en(
12659
12659
  x,
12660
12660
  x.colspan - m,
12661
12661
  m
12662
- )), p.left < s.left) {
12663
- if (h = h.type.createAndFill(x), !h)
12662
+ )), h.left < s.left) {
12663
+ if (p = p.type.createAndFill(x), !p)
12664
12664
  throw RangeError(
12665
12665
  `Could not create cell with attrs ${JSON.stringify(x)}`
12666
12666
  );
12667
12667
  } else
12668
- h = h.type.create(x, h.content);
12668
+ p = p.type.create(x, p.content);
12669
12669
  }
12670
- if (p.top < s.top || p.bottom > s.bottom) {
12670
+ if (h.top < s.top || h.bottom > s.bottom) {
12671
12671
  const x = {
12672
- ...h.attrs,
12673
- rowspan: Math.min(p.bottom, s.bottom) - Math.max(p.top, s.top)
12672
+ ...p.attrs,
12673
+ rowspan: Math.min(h.bottom, s.bottom) - Math.max(h.top, s.top)
12674
12674
  };
12675
- p.top < s.top ? h = h.type.createAndFill(x) : h = h.type.create(x, h.content);
12675
+ h.top < s.top ? p = p.type.createAndFill(x) : p = p.type.create(x, p.content);
12676
12676
  }
12677
- c.push(h);
12677
+ c.push(p);
12678
12678
  }
12679
- i.push(e.child(a).copy(k.from(c)));
12679
+ i.push(e.child(a).copy(S.from(c)));
12680
12680
  }
12681
12681
  const l = this.isColSelection() && this.isRowSelection() ? e : i;
12682
- return new M(k.from(l), 1, 1);
12682
+ return new M(S.from(l), 1, 1);
12683
12683
  }
12684
12684
  replace(e, t = M.empty) {
12685
12685
  const r = e.steps.length, s = this.ranges;
@@ -12698,7 +12698,7 @@ var H = class st extends z {
12698
12698
  o && e.setSelection(o);
12699
12699
  }
12700
12700
  replaceWith(e, t) {
12701
- this.replace(e, new M(k.from(t), 0, 0));
12701
+ this.replace(e, new M(S.from(t), 0, 0));
12702
12702
  }
12703
12703
  forEachCell(e) {
12704
12704
  const t = this.$anchorCell.node(-1), r = Z.get(t), s = this.$anchorCell.start(-1), o = r.cellsInRect(
@@ -12899,15 +12899,15 @@ function Gg(n, e, t, r) {
12899
12899
  for (let a = 0, c = t + 1; a < s.height; a++) {
12900
12900
  const u = e.child(a), f = c + u.nodeSize, d = o[a];
12901
12901
  if (d > 0) {
12902
- let p = "cell";
12903
- u.firstChild && (p = u.firstChild.type.spec.tableRole);
12904
- const h = [];
12902
+ let h = "cell";
12903
+ u.firstChild && (h = u.firstChild.type.spec.tableRole);
12904
+ const p = [];
12905
12905
  for (let m = 0; m < d; m++) {
12906
- const x = be(n.schema)[p].createAndFill();
12907
- x && h.push(x);
12906
+ const x = be(n.schema)[h].createAndFill();
12907
+ x && p.push(x);
12908
12908
  }
12909
12909
  const y = (a == 0 || i == a - 1) && l == a ? c + 1 : f - 1;
12910
- r.insert(r.mapping.map(y), h);
12910
+ r.insert(r.mapping.map(y), p);
12911
12911
  }
12912
12912
  c = f;
12913
12913
  }
@@ -13047,11 +13047,11 @@ function sy(n, { map: e, table: t, tableStart: r }, s) {
13047
13047
  rowspan: d.rowspan - 1
13048
13048
  }), c += d.colspan - 1;
13049
13049
  } else if (s < e.height && f == e.map[u + e.width]) {
13050
- const d = t.nodeAt(f), p = d.attrs, h = d.type.create(
13051
- { ...p, rowspan: d.attrs.rowspan - 1 },
13050
+ const d = t.nodeAt(f), h = d.attrs, p = d.type.create(
13051
+ { ...h, rowspan: d.attrs.rowspan - 1 },
13052
13052
  d.content
13053
13053
  ), y = e.positionAt(s + 1, c, t);
13054
- n.insert(n.mapping.slice(l).map(r + y), h), c += p.colspan - 1;
13054
+ n.insert(n.mapping.slice(l).map(r + y), p), c += h.colspan - 1;
13055
13055
  }
13056
13056
  }
13057
13057
  }
@@ -13097,17 +13097,17 @@ function ly(n, e) {
13097
13097
  if (iy(s, r)) return !1;
13098
13098
  if (e) {
13099
13099
  const o = n.tr, i = {};
13100
- let l = k.empty, a, c;
13100
+ let l = S.empty, a, c;
13101
13101
  for (let u = r.top; u < r.bottom; u++)
13102
13102
  for (let f = r.left; f < r.right; f++) {
13103
- const d = s.map[u * s.width + f], p = r.table.nodeAt(d);
13104
- if (!(i[d] || !p))
13103
+ const d = s.map[u * s.width + f], h = r.table.nodeAt(d);
13104
+ if (!(i[d] || !h))
13105
13105
  if (i[d] = !0, a == null)
13106
- a = d, c = p;
13106
+ a = d, c = h;
13107
13107
  else {
13108
- ia(p) || (l = l.append(p.content));
13109
- const h = o.mapping.map(d + r.tableStart);
13110
- o.delete(h, h + p.nodeSize);
13108
+ ia(h) || (l = l.append(h.content));
13109
+ const p = o.mapping.map(d + r.tableStart);
13110
+ o.delete(p, p + h.nodeSize);
13111
13111
  }
13112
13112
  }
13113
13113
  if (a == null || c == null)
@@ -13152,21 +13152,21 @@ function cy(n) {
13152
13152
  const a = [], c = l.colwidth;
13153
13153
  l.rowspan > 1 && (l = { ...l, rowspan: 1 }), l.colspan > 1 && (l = { ...l, colspan: 1 });
13154
13154
  const u = Ze(e), f = e.tr;
13155
- for (let p = 0; p < u.right - u.left; p++)
13155
+ for (let h = 0; h < u.right - u.left; h++)
13156
13156
  a.push(
13157
13157
  c ? {
13158
13158
  ...l,
13159
- colwidth: c && c[p] ? [c[p]] : null
13159
+ colwidth: c && c[h] ? [c[h]] : null
13160
13160
  } : l
13161
13161
  );
13162
13162
  let d;
13163
- for (let p = u.top; p < u.bottom; p++) {
13164
- let h = u.map.positionAt(p, u.left, u.table);
13165
- p == u.top && (h += o.nodeSize);
13163
+ for (let h = u.top; h < u.bottom; h++) {
13164
+ let p = u.map.positionAt(h, u.left, u.table);
13165
+ h == u.top && (p += o.nodeSize);
13166
13166
  for (let y = u.left, m = 0; y < u.right; y++, m++)
13167
- y == u.left && p == u.top || f.insert(
13168
- d = f.mapping.map(h + u.tableStart, 1),
13169
- n({ node: o, row: p, col: y }).createAndFill(a[m])
13167
+ y == u.left && h == u.top || f.insert(
13168
+ d = f.mapping.map(p + u.tableStart, 1),
13169
+ n({ node: o, row: h, col: y }).createAndFill(a[m])
13170
13170
  );
13171
13171
  }
13172
13172
  f.setNodeMarkup(
@@ -13271,9 +13271,9 @@ function pi(n, e) {
13271
13271
  right: o.map.width,
13272
13272
  bottom: 1
13273
13273
  } : o, d = n == "column" ? a ? s.cell : s.header_cell : n == "row" ? l ? s.cell : s.header_cell : s.cell;
13274
- o.map.cellsInRect(f).forEach((p) => {
13275
- const h = p + o.tableStart, y = i.doc.nodeAt(h);
13276
- y && i.setNodeMarkup(h, d, y.attrs);
13274
+ o.map.cellsInRect(f).forEach((h) => {
13275
+ const p = h + o.tableStart, y = i.doc.nodeAt(p);
13276
+ y && i.setNodeMarkup(p, d, y.attrs);
13277
13277
  }), r(i);
13278
13278
  }
13279
13279
  return !0;
@@ -13385,11 +13385,11 @@ function yy(n, e) {
13385
13385
  let r = 0;
13386
13386
  for (let s = 0; s < t.length; s++) r = Math.max(r, t[s]);
13387
13387
  for (let s = 0; s < t.length; s++)
13388
- if (s >= e.length && e.push(k.empty), t[s] < r) {
13388
+ if (s >= e.length && e.push(S.empty), t[s] < r) {
13389
13389
  const o = be(n).cell.createAndFill(), i = [];
13390
13390
  for (let l = t[s]; l < r; l++)
13391
13391
  i.push(o);
13392
- e[s] = e[s].append(k.from(i));
13392
+ e[s] = e[s].append(S.from(i));
13393
13393
  }
13394
13394
  return { height: e.length, width: r, rows: e };
13395
13395
  }
@@ -13412,10 +13412,10 @@ function by({ width: n, height: e, rows: t }, r, s) {
13412
13412
  ),
13413
13413
  d.content
13414
13414
  )), c.push(d), u += d.attrs.colspan;
13415
- for (let p = 1; p < d.attrs.rowspan; p++)
13416
- o[l + p] = (o[l + p] || 0) + d.attrs.colspan;
13415
+ for (let h = 1; h < d.attrs.rowspan; h++)
13416
+ o[l + h] = (o[l + h] || 0) + d.attrs.colspan;
13417
13417
  }
13418
- i.push(k.from(c));
13418
+ i.push(S.from(c));
13419
13419
  }
13420
13420
  t = i, n = r;
13421
13421
  }
@@ -13433,7 +13433,7 @@ function by({ width: n, height: e, rows: t }, r, s) {
13433
13433
  f.content
13434
13434
  )), a.push(f);
13435
13435
  }
13436
- o.push(k.from(a));
13436
+ o.push(S.from(a));
13437
13437
  }
13438
13438
  t = o, e = s;
13439
13439
  }
@@ -13444,25 +13444,25 @@ function xy(n, e, t, r, s, o, i) {
13444
13444
  let c, u;
13445
13445
  if (s > e.width)
13446
13446
  for (let f = 0, d = 0; f < e.height; f++) {
13447
- const p = t.child(f);
13448
- d += p.nodeSize;
13449
- const h = [];
13447
+ const h = t.child(f);
13448
+ d += h.nodeSize;
13449
+ const p = [];
13450
13450
  let y;
13451
- p.lastChild == null || p.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
13452
- for (let m = e.width; m < s; m++) h.push(y);
13453
- n.insert(n.mapping.slice(i).map(d - 1 + r), h);
13451
+ h.lastChild == null || h.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
13452
+ for (let m = e.width; m < s; m++) p.push(y);
13453
+ n.insert(n.mapping.slice(i).map(d - 1 + r), p);
13454
13454
  }
13455
13455
  if (o > e.height) {
13456
13456
  const f = [];
13457
- for (let h = 0, y = (e.height - 1) * e.width; h < Math.max(e.width, s); h++) {
13458
- const m = h >= e.width ? !1 : t.nodeAt(e.map[y + h]).type == a.header_cell;
13457
+ for (let p = 0, y = (e.height - 1) * e.width; p < Math.max(e.width, s); p++) {
13458
+ const m = p >= e.width ? !1 : t.nodeAt(e.map[y + p]).type == a.header_cell;
13459
13459
  f.push(
13460
13460
  m ? u || (u = a.header_cell.createAndFill()) : c || (c = a.cell.createAndFill())
13461
13461
  );
13462
13462
  }
13463
- const d = a.row.create(null, k.from(f)), p = [];
13464
- for (let h = e.height; h < o; h++) p.push(d);
13465
- n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2), p);
13463
+ const d = a.row.create(null, S.from(f)), h = [];
13464
+ for (let p = e.height; p < o; p++) h.push(d);
13465
+ n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2), h);
13466
13466
  }
13467
13467
  return !!(c || u);
13468
13468
  }
@@ -13473,15 +13473,15 @@ function ca(n, e, t, r, s, o, i, l) {
13473
13473
  const u = i * e.width + c, f = e.map[u];
13474
13474
  if (e.map[u - e.width] == f) {
13475
13475
  a = !0;
13476
- const d = t.nodeAt(f), { top: p, left: h } = e.findCell(f);
13476
+ const d = t.nodeAt(f), { top: h, left: p } = e.findCell(f);
13477
13477
  n.setNodeMarkup(n.mapping.slice(l).map(f + r), null, {
13478
13478
  ...d.attrs,
13479
- rowspan: i - p
13479
+ rowspan: i - h
13480
13480
  }), n.insert(
13481
- n.mapping.slice(l).map(e.positionAt(i, h, t)),
13481
+ n.mapping.slice(l).map(e.positionAt(i, p, t)),
13482
13482
  d.type.createAndFill({
13483
13483
  ...d.attrs,
13484
- rowspan: p + d.attrs.rowspan - i
13484
+ rowspan: h + d.attrs.rowspan - i
13485
13485
  })
13486
13486
  ), c += d.attrs.colspan - 1;
13487
13487
  }
@@ -13495,19 +13495,19 @@ function ua(n, e, t, r, s, o, i, l) {
13495
13495
  const u = c * e.width + i, f = e.map[u];
13496
13496
  if (e.map[u - 1] == f) {
13497
13497
  a = !0;
13498
- const d = t.nodeAt(f), p = e.colCount(f), h = n.mapping.slice(l).map(f + r);
13498
+ const d = t.nodeAt(f), h = e.colCount(f), p = n.mapping.slice(l).map(f + r);
13499
13499
  n.setNodeMarkup(
13500
- h,
13500
+ p,
13501
13501
  null,
13502
13502
  en(
13503
13503
  d.attrs,
13504
- i - p,
13505
- d.attrs.colspan - (i - p)
13504
+ i - h,
13505
+ d.attrs.colspan - (i - h)
13506
13506
  )
13507
13507
  ), n.insert(
13508
- h + d.nodeSize,
13508
+ p + d.nodeSize,
13509
13509
  d.type.createAndFill(
13510
- en(d.attrs, 0, i - p)
13510
+ en(d.attrs, 0, i - h)
13511
13511
  )
13512
13512
  ), c += d.attrs.rowspan - 1;
13513
13513
  }
@@ -13521,21 +13521,21 @@ function fa(n, e, t, r, s) {
13521
13521
  let i = Z.get(o);
13522
13522
  const { top: l, left: a } = r, c = a + s.width, u = l + s.height, f = n.tr;
13523
13523
  let d = 0;
13524
- function p() {
13524
+ function h() {
13525
13525
  if (o = t ? f.doc.nodeAt(t - 1) : f.doc, !o)
13526
13526
  throw new Error("No table found");
13527
13527
  i = Z.get(o), d = f.mapping.maps.length;
13528
13528
  }
13529
- xy(f, i, o, t, c, u, d) && p(), ca(f, i, o, t, a, c, l, d) && p(), ca(f, i, o, t, a, c, u, d) && p(), ua(f, i, o, t, l, u, a, d) && p(), ua(f, i, o, t, l, u, c, d) && p();
13530
- for (let h = l; h < u; h++) {
13531
- const y = i.positionAt(h, a, o), m = i.positionAt(h, c, o);
13529
+ xy(f, i, o, t, c, u, d) && h(), ca(f, i, o, t, a, c, l, d) && h(), ca(f, i, o, t, a, c, u, d) && h(), ua(f, i, o, t, l, u, a, d) && h(), ua(f, i, o, t, l, u, c, d) && h();
13530
+ for (let p = l; p < u; p++) {
13531
+ const y = i.positionAt(p, a, o), m = i.positionAt(p, c, o);
13532
13532
  f.replace(
13533
13533
  f.mapping.slice(d).map(y + t),
13534
13534
  f.mapping.slice(d).map(m + t),
13535
- new M(s.rows[h - l], 0, 0)
13535
+ new M(s.rows[p - l], 0, 0)
13536
13536
  );
13537
13537
  }
13538
- p(), f.setSelection(
13538
+ h(), f.setSelection(
13539
13539
  new H(
13540
13540
  f.doc.resolve(t + i.positionAt(l, a, o)),
13541
13541
  f.doc.resolve(t + i.positionAt(u - 1, c - 1, o))
@@ -13618,7 +13618,7 @@ function Cy(n, e, t) {
13618
13618
  width: 1,
13619
13619
  height: 1,
13620
13620
  rows: [
13621
- k.from(
13621
+ S.from(
13622
13622
  Po(be(n.state.schema).cell, t)
13623
13623
  )
13624
13624
  ]
@@ -13659,8 +13659,8 @@ function wy(n, e) {
13659
13659
  else return;
13660
13660
  const d = new H(a, u);
13661
13661
  if (f || !n.state.selection.eq(d)) {
13662
- const p = n.state.tr.setSelection(d);
13663
- f && p.setMeta(kt, a.pos), n.dispatch(p);
13662
+ const h = n.state.tr.setSelection(d);
13663
+ f && h.setMeta(kt, a.pos), n.dispatch(h);
13664
13664
  }
13665
13665
  }
13666
13666
  function i() {
@@ -14024,8 +14024,8 @@ function By() {
14024
14024
  for (const [c, u] of a) {
14025
14025
  const { pos: f, deleted: d } = e.mapping.mapResult(c);
14026
14026
  if (d) continue;
14027
- let p = u;
14028
- i === u && (p = Gs()), l.posToKey.set(f, p), l.keyToPos.set(p, f);
14027
+ let h = u;
14028
+ i === u && (h = Gs()), l.posToKey.set(f, h), l.keyToPos.set(h, f);
14029
14029
  }
14030
14030
  return s.doc.descendants((c, u) => {
14031
14031
  if (l.posToKey.has(u)) return !0;
@@ -14130,8 +14130,8 @@ function Ly(n) {
14130
14130
  case "deleteContent": {
14131
14131
  const l = s.getTargetRanges(), { tr: a } = r.state;
14132
14132
  for (const c of l) {
14133
- const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state, p = d.resolve(u).marksAcross(d.resolve(f));
14134
- a.delete(u, f).setStoredMarks(p);
14133
+ const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state, h = d.resolve(u).marksAcross(d.resolve(f));
14134
+ a.delete(u, f).setStoredMarks(h);
14135
14135
  }
14136
14136
  r.dispatch(a);
14137
14137
  break;
@@ -14202,16 +14202,16 @@ function xa(n) {
14202
14202
  t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1
14203
14203
  ) {
14204
14204
  let f = i, d = i;
14205
- for (let p = 0; p < t.rangeCount; p++) {
14206
- const h = t.getRangeAt(p);
14205
+ for (let h = 0; h < t.rangeCount; h++) {
14206
+ const p = t.getRangeAt(h);
14207
14207
  f = Math.min(
14208
14208
  f,
14209
14209
  // @ts-expect-error Internal method
14210
- n.docView.posFromDOM(h.startContainer, h.startOffset, 1)
14210
+ n.docView.posFromDOM(p.startContainer, p.startOffset, 1)
14211
14211
  ), d = Math.max(
14212
14212
  d,
14213
14213
  // @ts-expect-error Internal method
14214
- n.docView.posFromDOM(h.endContainer, h.endOffset, -1)
14214
+ n.docView.posFromDOM(p.endContainer, p.endOffset, -1)
14215
14215
  );
14216
14216
  }
14217
14217
  if (f < 0) return null;
@@ -14784,11 +14784,11 @@ class yr {
14784
14784
  // a selection starts in such a node and ends in another, in which
14785
14785
  // case we just use whatever domFromPos produces as a best effort.
14786
14786
  setSelection(e, t, r) {
14787
- var p;
14787
+ var h;
14788
14788
  let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
14789
14789
  const o = Math.min(e, t), i = Math.max(e, t);
14790
- for (let h = 0, y = 0; h < this.children.length; h++) {
14791
- const m = this.children[h], x = y + m.size;
14790
+ for (let p = 0, y = 0; p < this.children.length; p++) {
14791
+ const m = this.children[p], x = y + m.size;
14792
14792
  if (o > y && i < x) return m.setSelection(e - y - m.border, t - y - m.border, r, s);
14793
14793
  y = x;
14794
14794
  }
@@ -14796,11 +14796,11 @@ class yr {
14796
14796
  const c = r.root.getSelection(), u = r.domSelectionRange();
14797
14797
  let f = !1;
14798
14798
  if ((fe.gecko || fe.safari) && e == t) {
14799
- const { node: h, offset: y } = l;
14800
- if (h.nodeType == 3) {
14801
- if (f = !!(y && ((p = h.nodeValue) == null ? void 0 : p[y - 1]) == `
14802
- `), f && y == h.nodeValue.length)
14803
- for (let m = h, x; m; m = m.parentNode) {
14799
+ const { node: p, offset: y } = l;
14800
+ if (p.nodeType == 3) {
14801
+ if (f = !!(y && ((h = p.nodeValue) == null ? void 0 : h[y - 1]) == `
14802
+ `), f && y == p.nodeValue.length)
14803
+ for (let m = p, x; m; m = m.parentNode) {
14804
14804
  if (x = m.nextSibling) {
14805
14805
  x.nodeName == "BR" && (l = a = {
14806
14806
  node: x.parentNode,
@@ -14808,17 +14808,17 @@ class yr {
14808
14808
  });
14809
14809
  break;
14810
14810
  }
14811
- const C = m.pmViewDesc;
14812
- if (C && C.node && C.node.isBlock) break;
14811
+ const k = m.pmViewDesc;
14812
+ if (k && k.node && k.node.isBlock) break;
14813
14813
  }
14814
14814
  } else {
14815
- const m = h.childNodes[y - 1];
14815
+ const m = p.childNodes[y - 1];
14816
14816
  f = m && (m.nodeName == "BR" || m.contentEditable == "false");
14817
14817
  }
14818
14818
  }
14819
14819
  if (fe.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
14820
- const h = u.focusNode.childNodes[u.focusOffset];
14821
- h && h.contentEditable == "false" && (s = !0);
14820
+ const p = u.focusNode.childNodes[u.focusOffset];
14821
+ p && p.contentEditable == "false" && (s = !0);
14822
14822
  }
14823
14823
  if (!(s || f && fe.safari) && rs(l.node, l.offset, u.anchorNode, u.anchorOffset) && rs(a.node, a.offset, u.focusNode, u.focusOffset)) return;
14824
14824
  let d = !1;
@@ -14834,8 +14834,8 @@ class yr {
14834
14834
  const y = l;
14835
14835
  l = a, a = y;
14836
14836
  }
14837
- const h = document.createRange();
14838
- h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
14837
+ const p = document.createRange();
14838
+ p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
14839
14839
  }
14840
14840
  }
14841
14841
  ignoreMutation(e) {
@@ -14958,7 +14958,7 @@ class sb extends yr {
14958
14958
  }
14959
14959
  }
14960
14960
  class yi extends yr {
14961
- constructor(t, r, s, o, i, l, a, c, u, f, d, p, h) {
14961
+ constructor(t, r, s, o, i, l, a, c, u, f, d, h, p) {
14962
14962
  super(t, r, s, a, c);
14963
14963
  B(this, "node");
14964
14964
  B(this, "outerDeco");
@@ -14968,7 +14968,7 @@ class yi extends yr {
14968
14968
  B(this, "selectNode");
14969
14969
  B(this, "deselectNode");
14970
14970
  B(this, "ignoreMutation");
14971
- this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode = p, this.ignoreMutation = h;
14971
+ this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode = h, this.ignoreMutation = p;
14972
14972
  }
14973
14973
  updateOuterDeco() {
14974
14974
  }
@@ -14990,7 +14990,7 @@ class yi extends yr {
14990
14990
  break;
14991
14991
  }
14992
14992
  }
14993
- t.contentElement || (t.getContent = () => k.empty);
14993
+ t.contentElement || (t.getContent = () => S.empty);
14994
14994
  }
14995
14995
  return t;
14996
14996
  }
@@ -15224,18 +15224,18 @@ const db = new cs({
15224
15224
  let Aa = !1;
15225
15225
  function pb(n, e) {
15226
15226
  process.env.NODE_ENV !== "production" && e.defaultState !== void 0 && e.state !== void 0 && !Aa && (console.error("A component contains a ProseMirror editor with both value and defaultValue props. ProseMirror editors must be either controlled or uncontrolled (specify either the state prop, or the defaultState prop, but not both). Decide between using a controlled or uncontrolled ProseMirror editor and remove one of these props. More info: https://reactjs.org/link/controlled-components"), Aa = !0);
15227
- const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(), p = He(($) => {
15227
+ const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(), h = He(($) => {
15228
15228
  Vi(() => {
15229
15229
  s($);
15230
15230
  });
15231
- }, []), h = Me(() => [
15231
+ }, []), p = Me(() => [
15232
15232
  ...e.plugins ?? [],
15233
15233
  u,
15234
- Ly(p)
15234
+ Ly(h)
15235
15235
  ], [
15236
15236
  e.plugins,
15237
15237
  u,
15238
- p
15238
+ h
15239
15239
  ]), y = He(function(j) {
15240
15240
  t.current ? Vi(() => {
15241
15241
  e.state || a((E) => E.apply(j)), e.dispatchTransaction && e.dispatchTransaction.call(this, j);
@@ -15245,14 +15245,14 @@ function pb(n, e) {
15245
15245
  e.state
15246
15246
  ]), m = nf(), x = document.createElement("div");
15247
15247
  m();
15248
- const C = I(new yi(void 0, [], () => -1, c.doc, [], U.empty, x, null, x, () => !1, () => {
15248
+ const k = I(new yi(void 0, [], () => -1, c.doc, [], U.empty, x, null, x, () => !1, () => {
15249
15249
  }, () => {
15250
15250
  }, () => !1)), w = {
15251
15251
  ...e,
15252
15252
  state: c,
15253
- plugins: h,
15253
+ plugins: p,
15254
15254
  dispatchTransaction: y,
15255
- docView: C.current
15255
+ docView: k.current
15256
15256
  }, [O, v] = N(
15257
15257
  // During the initial render, we create something of a dummy
15258
15258
  // EditorView. This allows us to ensure that the first render actually
@@ -15286,7 +15286,7 @@ function pb(n, e) {
15286
15286
  registerEventListener: f,
15287
15287
  unregisterEventListener: d,
15288
15288
  cursorWrapper: r,
15289
- docViewDescRef: C,
15289
+ docViewDescRef: k,
15290
15290
  flushSyncRef: t
15291
15291
  }), [
15292
15292
  O,
@@ -15333,23 +15333,23 @@ const Oe = ft({
15333
15333
  }
15334
15334
  });
15335
15335
  function xi(n, e, t, r, s, o, i, l) {
15336
- const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), p = He((S) => {
15337
- d.current = S;
15338
- }, []), h = I(() => !1), y = He((S) => {
15339
- h.current = S;
15336
+ const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), h = He((C) => {
15337
+ d.current = C;
15338
+ }, []), p = I(() => !1), y = He((C) => {
15339
+ p.current = C;
15340
15340
  }, []), m = I(() => {
15341
15341
  !r.current || !n || (r.current.nodeType == 1 && r.current.classList.add("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && (((t == null ? void 0 : t.current) ?? r.current).draggable = !0));
15342
15342
  }), x = I(() => {
15343
15343
  !r.current || !n || r.current.nodeType == 1 && (r.current.classList.remove("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && ((t == null ? void 0 : t.current) ?? r.current).removeAttribute("draggable"));
15344
- }), C = He((S, $) => {
15345
- m.current = S, x.current = $;
15344
+ }), k = He((C, $) => {
15345
+ m.current = C, x.current = $;
15346
15346
  }, []), { siblingsRef: w, parentRef: O } = ie(Oe), v = I([]);
15347
15347
  return X(() => {
15348
- const S = w.current;
15348
+ const C = w.current;
15349
15349
  return () => {
15350
- if (f.current && S.includes(f.current)) {
15351
- const $ = S.indexOf(f.current);
15352
- S.splice($, 1);
15350
+ if (f.current && C.includes(f.current)) {
15351
+ const $ = C.indexOf(f.current);
15352
+ C.splice($, 1);
15353
15353
  }
15354
15354
  };
15355
15355
  }, [
@@ -15357,12 +15357,12 @@ function xi(n, e, t, r, s, o, i, l) {
15357
15357
  ]), X(() => {
15358
15358
  var $;
15359
15359
  if (!n || !r.current) return;
15360
- const S = v.current[0];
15360
+ const C = v.current[0];
15361
15361
  f.current ? (f.current.parent = O.current, f.current.children = v.current, f.current.node = n, f.current.getPos = e, f.current.outerDeco = o, f.current.innerDeco = s, f.current.dom = (t == null ? void 0 : t.current) ?? r.current, f.current.dom.pmViewDesc = f.current, f.current.contentDOM = // If there's already a contentDOM, we can just
15362
15362
  // keep it; it won't have changed. This is especially
15363
15363
  // important during compositions, where the
15364
15364
  // firstChildDesc might not have a correct dom node set yet.
15365
- (l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (S == null ? void 0 : S.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (S == null ? void 0 : S.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) => h.current(j)), u(f.current.contentDOM !== null), w.current.includes(f.current) || w.current.push(f.current), w.current.sort(sn);
15365
+ (l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (C == null ? void 0 : C.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (C == null ? void 0 : C.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) => p.current(j)), u(f.current.contentDOM !== null), w.current.includes(f.current) || w.current.push(f.current), w.current.sort(sn);
15366
15366
  for (const j of v.current)
15367
15367
  if (j.parent = f.current, j instanceof ss) {
15368
15368
  const E = ($ = f.current.contentDOM) == null ? void 0 : $.firstChild;
@@ -15381,8 +15381,8 @@ function xi(n, e, t, r, s, o, i, l) {
15381
15381
  hasContentDOM: c,
15382
15382
  childDescriptors: v,
15383
15383
  nodeViewDescRef: f,
15384
- setStopEvent: p,
15385
- setSelectNode: C,
15384
+ setStopEvent: h,
15385
+ setSelectNode: k,
15386
15386
  setIgnoreMutation: y
15387
15387
  };
15388
15388
  }
@@ -15404,10 +15404,10 @@ function yb(n, e, t, r) {
15404
15404
  let a = null;
15405
15405
  for (let c = 0; ; ) {
15406
15406
  if (i < s.length && s[i].to == o) {
15407
- const h = s[i++];
15407
+ const p = s[i++];
15408
15408
  let y;
15409
15409
  for (; i < s.length && s[i].to == o; ) (y || (y = [
15410
- h
15410
+ p
15411
15411
  ])).push(s[i++]);
15412
15412
  if (y) {
15413
15413
  y.sort(gb);
@@ -15421,9 +15421,9 @@ function yb(n, e, t, r) {
15421
15421
  );
15422
15422
  } else
15423
15423
  t(
15424
- h,
15424
+ p,
15425
15425
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15426
- !(h.type instanceof rr),
15426
+ !(p.type instanceof rr),
15427
15427
  o,
15428
15428
  c,
15429
15429
  !!a
@@ -15436,17 +15436,17 @@ function yb(n, e, t, r) {
15436
15436
  f = c, u = n.child(c++);
15437
15437
  else
15438
15438
  break;
15439
- for (let h = 0; h < l.length; h++) l[h].to <= o && l.splice(h--, 1);
15439
+ for (let p = 0; p < l.length; p++) l[p].to <= o && l.splice(p--, 1);
15440
15440
  for (; i < s.length && s[i].from <= o && s[i].to > o; ) l.push(s[i++]);
15441
15441
  let d = o + u.nodeSize;
15442
15442
  if (u.isText) {
15443
- let h = d;
15444
- i < s.length && s[i].from < h && (h = s[i].from);
15445
- for (let y = 0; y < l.length; y++) l[y].to < h && (h = l[y].to);
15446
- h < d && (a = u.cut(h - o), u = u.cut(0, h - o), d = h, f = -1);
15443
+ let p = d;
15444
+ i < s.length && s[i].from < p && (p = s[i].from);
15445
+ for (let y = 0; y < l.length; y++) l[y].to < p && (p = l[y].to);
15446
+ p < d && (a = u.cut(p - o), u = u.cut(0, p - o), d = p, f = -1);
15447
15447
  }
15448
- const p = u.isInline && !u.isLeaf ? l.filter((h) => !h.inline) : l.slice();
15449
- r(u, p, e.forChild(o, u), o, f), o = d;
15448
+ const h = u.isInline && !u.isLeaf ? l.filter((p) => !p.inline) : l.slice();
15449
+ r(u, h, e.forChild(o, u), o, f), o = d;
15450
15450
  }
15451
15451
  }
15452
15452
  function bb() {
@@ -15706,15 +15706,15 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15706
15706
  }, f = 1;
15707
15707
  c && typeof c == "object" && c.nodeType == null && !Array.isArray(c) && (f = 2, u = sf(of(c), u));
15708
15708
  const d = [];
15709
- for (let p = f; p < r.length; p++) {
15710
- const h = r[p];
15711
- if (h === 0) {
15712
- if (p < r.length - 1 || p > f)
15709
+ for (let h = f; h < r.length; h++) {
15710
+ const p = r[h];
15711
+ if (p === 0) {
15712
+ if (h < r.length - 1 || h > f)
15713
15713
  throw new RangeError("Content hole must be the only child of its parent node");
15714
15714
  return /* @__PURE__ */ Kn(a, u, o);
15715
15715
  }
15716
15716
  d.push(/* @__PURE__ */ P.createElement(ki, {
15717
- outputSpec: h
15717
+ outputSpec: p
15718
15718
  }, o));
15719
15719
  }
15720
15720
  return s && !lf(r) && d.push(o), /* @__PURE__ */ Kn(a, u, ...d);
@@ -15723,31 +15723,31 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15723
15723
  const { siblingsRef: i, parentRef: l } = ie(Oe), a = I(void 0), c = I([]), u = I(null);
15724
15724
  is(t, () => u.current, []);
15725
15725
  const f = Me(() => {
15726
- var p, h;
15727
- return (h = (p = r.type.spec).toDOM) == null ? void 0 : h.call(p, r, !0);
15726
+ var h, p;
15727
+ return (p = (h = r.type.spec).toDOM) == null ? void 0 : p.call(h, r, !0);
15728
15728
  }, [
15729
15729
  r
15730
15730
  ]);
15731
15731
  if (!f) throw new Error(`Mark spec for ${r.type.name} is missing toDOM`);
15732
15732
  X(() => {
15733
- const p = i.current;
15733
+ const h = i.current;
15734
15734
  return () => {
15735
- if (a.current && p.includes(a.current)) {
15736
- const h = p.indexOf(a.current);
15737
- p.splice(h, 1);
15735
+ if (a.current && h.includes(a.current)) {
15736
+ const p = h.indexOf(a.current);
15737
+ h.splice(p, 1);
15738
15738
  }
15739
15739
  };
15740
15740
  }, [
15741
15741
  i
15742
15742
  ]), X(() => {
15743
15743
  if (!u.current) return;
15744
- const p = c.current[0];
15745
- a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (p == null ? void 0 : p.dom.parentElement) ?? u.current, a.current.mark = r, a.current.getPos = () => s.current()) : a.current = new sb(l.current, c.current, () => s.current(), r, u.current, (p == null ? void 0 : p.dom.parentElement) ?? u.current, {
15744
+ const h = c.current[0];
15745
+ a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (h == null ? void 0 : h.dom.parentElement) ?? u.current, a.current.mark = r, a.current.getPos = () => s.current()) : a.current = new sb(l.current, c.current, () => s.current(), r, u.current, (h == null ? void 0 : h.dom.parentElement) ?? u.current, {
15746
15746
  dom: u.current,
15747
- contentDOM: (p == null ? void 0 : p.dom.parentElement) ?? u.current
15747
+ contentDOM: (h == null ? void 0 : h.dom.parentElement) ?? u.current
15748
15748
  }), i.current.includes(a.current) || i.current.push(a.current), i.current.sort(sn);
15749
- for (const h of c.current)
15750
- h.parent = a.current;
15749
+ for (const p of c.current)
15750
+ p.parent = a.current;
15751
15751
  });
15752
15752
  const d = Me(() => ({
15753
15753
  parentRef: a,
@@ -15808,11 +15808,11 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15808
15808
  let { customNodeView: t, node: r, getPos: s, innerDeco: o, outerDeco: i } = e;
15809
15809
  const { view: l } = ie(Vt), a = I(null), c = I(null), u = I(null), f = I(() => s.current()).current, d = I(r);
15810
15810
  d.current = r;
15811
- const p = I(i);
15812
- p.current = i;
15813
- const h = I(o);
15814
- h.current = o;
15815
- const y = I(null), m = I(null), x = bi(), C = Db();
15811
+ const h = I(i);
15812
+ h.current = i;
15813
+ const p = I(o);
15814
+ p.current = o;
15815
+ const y = I(null), m = I(null), x = bi(), k = Db();
15816
15816
  X(() => {
15817
15817
  var $t, on, Tn;
15818
15818
  if (m.current || (m.current = t(
@@ -15822,9 +15822,9 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15822
15822
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15823
15823
  l,
15824
15824
  f,
15825
- p.current,
15826
- h.current
15827
- ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
15825
+ h.current,
15826
+ p.current
15827
+ ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && C(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
15828
15828
  })), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)), x()), !y.current) return;
15829
15829
  const { dom: Ee } = m.current;
15830
15830
  if (y.current.firstChild === Ee)
@@ -15850,8 +15850,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15850
15850
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15851
15851
  l,
15852
15852
  f,
15853
- p.current,
15854
- h.current
15853
+ h.current,
15854
+ p.current
15855
15855
  );
15856
15856
  const { dom: on } = m.current;
15857
15857
  c.current = y.current, y.current.appendChild(on);
@@ -15864,14 +15864,14 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15864
15864
  s,
15865
15865
  f
15866
15866
  ]);
15867
- const { childDescriptors: w, nodeViewDescRef: O, setStopEvent: v, setSelectNode: S, setIgnoreMutation: $ } = xi(r, f, a, c, o, i, void 0, u), j = Me(() => ({
15867
+ const { childDescriptors: w, nodeViewDescRef: O, setStopEvent: v, setSelectNode: C, setIgnoreMutation: $ } = xi(r, f, a, c, o, i, void 0, u), j = Me(() => ({
15868
15868
  parentRef: O,
15869
15869
  siblingsRef: w
15870
15870
  }), [
15871
15871
  w,
15872
15872
  O
15873
15873
  ]);
15874
- if (!C) return null;
15874
+ if (!k) return null;
15875
15875
  m.current || (m.current = t(
15876
15876
  d.current,
15877
15877
  // customNodeView will only be set if view is set, and we can only reach
@@ -15879,9 +15879,9 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15879
15879
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15880
15880
  l,
15881
15881
  () => s.current(),
15882
- p.current,
15883
- h.current
15884
- ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
15882
+ h.current,
15883
+ p.current
15884
+ ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && C(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
15885
15885
  })), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)));
15886
15886
  const { contentDOM: E } = m.current;
15887
15887
  u.current = E ?? null;
@@ -15911,17 +15911,17 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15911
15911
  let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
15912
15912
  const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Ju);
15913
15913
  let d = null;
15914
- const p = f[s.type.name], h = Me(() => {
15914
+ const h = f[s.type.name], p = Me(() => {
15915
15915
  var E, _;
15916
15916
  return (_ = (E = s.type.spec).toDOM) == null ? void 0 : _.call(E, s);
15917
15917
  }, [
15918
15918
  s
15919
- ]), { hasContentDOM: y, childDescriptors: m, setStopEvent: x, setSelectNode: C, setIgnoreMutation: w, nodeViewDescRef: O } = xi(s, () => r.current(), l, a, o, t, void 0, c), v = {
15919
+ ]), { hasContentDOM: y, childDescriptors: m, setStopEvent: x, setSelectNode: k, setIgnoreMutation: w, nodeViewDescRef: O } = xi(s, () => r.current(), l, a, o, t, void 0, c), v = {
15920
15920
  ...i,
15921
15921
  ...!y && {
15922
15922
  contentEditable: !1
15923
15923
  }
15924
- }, S = Me(() => ({
15924
+ }, C = Me(() => ({
15925
15925
  node: s,
15926
15926
  getPos: u,
15927
15927
  decorations: t,
@@ -15932,18 +15932,18 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15932
15932
  s,
15933
15933
  t
15934
15934
  ]);
15935
- if (p ? d = /* @__PURE__ */ P.createElement(p, {
15935
+ if (h ? d = /* @__PURE__ */ P.createElement(h, {
15936
15936
  ...v,
15937
15937
  ref: a,
15938
- nodeProps: S
15938
+ nodeProps: C
15939
15939
  }, /* @__PURE__ */ P.createElement(lr, {
15940
15940
  getPos: r,
15941
15941
  node: s,
15942
15942
  innerDecorations: o
15943
- })) : h && (d = /* @__PURE__ */ P.createElement(ki, {
15943
+ })) : p && (d = /* @__PURE__ */ P.createElement(ki, {
15944
15944
  ...v,
15945
15945
  ref: a,
15946
- outputSpec: h
15946
+ outputSpec: p
15947
15947
  }, /* @__PURE__ */ P.createElement(lr, {
15948
15948
  getPos: r,
15949
15949
  node: s,
@@ -15968,7 +15968,7 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15968
15968
  O
15969
15969
  ]);
15970
15970
  return /* @__PURE__ */ P.createElement(Tb.Provider, {
15971
- value: C
15971
+ value: k
15972
15972
  }, /* @__PURE__ */ P.createElement(cf.Provider, {
15973
15973
  value: x
15974
15974
  }, /* @__PURE__ */ P.createElement(Eb.Provider, {
@@ -16084,28 +16084,28 @@ function Ib() {
16084
16084
  }
16085
16085
  if (a.return !== c.return) a = u, c = f;
16086
16086
  else {
16087
- for (var d = !1, p = u.child; p; ) {
16088
- if (p === a) {
16087
+ for (var d = !1, h = u.child; h; ) {
16088
+ if (h === a) {
16089
16089
  d = !0, a = u, c = f;
16090
16090
  break;
16091
16091
  }
16092
- if (p === c) {
16092
+ if (h === c) {
16093
16093
  d = !0, c = u, a = f;
16094
16094
  break;
16095
16095
  }
16096
- p = p.sibling;
16096
+ h = h.sibling;
16097
16097
  }
16098
16098
  if (!d) {
16099
- for (p = f.child; p; ) {
16100
- if (p === a) {
16099
+ for (h = f.child; h; ) {
16100
+ if (h === a) {
16101
16101
  d = !0, a = f, c = u;
16102
16102
  break;
16103
16103
  }
16104
- if (p === c) {
16104
+ if (h === c) {
16105
16105
  d = !0, c = f, a = u;
16106
16106
  break;
16107
16107
  }
16108
- p = p.sibling;
16108
+ h = h.sibling;
16109
16109
  }
16110
16110
  if (!d) throw Error(n(189));
16111
16111
  }
@@ -16601,52 +16601,52 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16601
16601
  if (!r) return null;
16602
16602
  const a = /* @__PURE__ */ new Set();
16603
16603
  let c = [], u = null;
16604
- yb(r, s, (h, y, m, x) => {
16605
- const C = h.type.spec.marks ?? [];
16604
+ yb(r, s, (p, y, m, x) => {
16605
+ const k = p.type.spec.marks ?? [];
16606
16606
  let w;
16607
16607
  if (y) {
16608
- w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, h, x);
16608
+ w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, p, x);
16609
16609
  const v = {
16610
16610
  type: "native-widget",
16611
- widget: h,
16612
- marks: C,
16611
+ widget: p,
16612
+ marks: k,
16613
16613
  offset: m,
16614
16614
  index: x,
16615
16615
  key: w
16616
- }, S = l.get(w);
16617
- S && Zs(S, v) ? S.offset = m : l.set(w, v), a.add(w);
16616
+ }, C = l.get(w);
16617
+ C && Zs(C, v) ? C.offset = m : l.set(w, v), a.add(w);
16618
16618
  } else {
16619
- w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey, h, x);
16619
+ w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey, p, x);
16620
16620
  const v = {
16621
16621
  type: "widget",
16622
- widget: h,
16623
- marks: C,
16622
+ widget: p,
16623
+ marks: k,
16624
16624
  offset: m,
16625
16625
  index: x,
16626
16626
  key: w
16627
- }, S = l.get(w);
16628
- S && Zs(S, v) ? S.offset = m : l.set(w, v), a.add(w);
16627
+ }, C = l.get(w);
16628
+ C && Zs(C, v) ? C.offset = m : l.set(w, v), a.add(w);
16629
16629
  }
16630
16630
  const O = l.get(w);
16631
16631
  c.push(O), qb(u, l.get(w));
16632
- }, (h, y, m, x) => {
16633
- const C = eo(i.current(), x, "node", o == null ? void 0 : o.posToKey), w = {
16632
+ }, (p, y, m, x) => {
16633
+ const k = eo(i.current(), x, "node", o == null ? void 0 : o.posToKey), w = {
16634
16634
  type: "node",
16635
- node: h,
16636
- marks: h.marks,
16635
+ node: p,
16636
+ marks: p.marks,
16637
16637
  innerDeco: m,
16638
16638
  outerDeco: y,
16639
16639
  offset: x,
16640
- key: C
16641
- }, O = l.get(C);
16642
- O && Zs(O, w) ? (O.offset = x, u = O) : (l.set(C, w), u = w), a.add(C), Hb(c, u), c = [];
16640
+ key: k
16641
+ }, O = l.get(k);
16642
+ O && Zs(O, w) ? (O.offset = x, u = O) : (l.set(k, w), u = w), a.add(k), Hb(c, u), c = [];
16643
16643
  });
16644
- for (const h of l.keys())
16645
- a.has(h) || l.delete(h);
16646
- const f = Array.from(l.values()).sort((h, y) => h.offset - y.offset), d = Jb(f, i), p = f[f.length - 1];
16647
- return (!p || p.type !== "node" || p.node.isInline && !p.node.isText || // RegExp.test actually handles undefined just fine
16644
+ for (const p of l.keys())
16645
+ a.has(p) || l.delete(p);
16646
+ const f = Array.from(l.values()).sort((p, y) => p.offset - y.offset), d = Jb(f, i), h = f[f.length - 1];
16647
+ return (!h || h.type !== "node" || h.node.isInline && !h.node.isText || // RegExp.test actually handles undefined just fine
16648
16648
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
16649
- /\n$/.test(p.node.text)) && d.push(/* @__PURE__ */ P.createElement(Rb, {
16649
+ /\n$/.test(h.node.text)) && d.push(/* @__PURE__ */ P.createElement(Rb, {
16650
16650
  getPos: i,
16651
16651
  key: "trailing-hack-img"
16652
16652
  }), /* @__PURE__ */ P.createElement(Bb, {
@@ -16661,32 +16661,32 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16661
16661
  let { className: r, node: s, innerDeco: o, outerDeco: i, as: l, viewDesc: a, ...c } = e;
16662
16662
  const u = I(null);
16663
16663
  is(t, () => u.current, []);
16664
- const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a), p = Me(() => ({
16664
+ const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a), h = Me(() => ({
16665
16665
  parentRef: d,
16666
16666
  siblingsRef: f
16667
16667
  }), [
16668
16668
  f,
16669
16669
  d
16670
- ]), h = {
16670
+ ]), p = {
16671
16671
  ...c,
16672
16672
  ref: u,
16673
16673
  className: r,
16674
16674
  suppressContentEditableWarning: !0
16675
- }, y = l ? /* @__PURE__ */ ls(l, h, /* @__PURE__ */ P.createElement(Oe.Provider, {
16676
- value: p
16675
+ }, y = l ? /* @__PURE__ */ ls(l, p, /* @__PURE__ */ P.createElement(Oe.Provider, {
16676
+ value: h
16677
16677
  }, /* @__PURE__ */ P.createElement(lr, {
16678
16678
  getPos: to,
16679
16679
  node: s,
16680
16680
  innerDecorations: o
16681
- }))) : /* @__PURE__ */ Kn("div", h, /* @__PURE__ */ P.createElement(Oe.Provider, {
16682
- value: p
16681
+ }))) : /* @__PURE__ */ Kn("div", p, /* @__PURE__ */ P.createElement(Oe.Provider, {
16682
+ value: h
16683
16683
  }, /* @__PURE__ */ P.createElement(lr, {
16684
16684
  getPos: to,
16685
16685
  node: s,
16686
16686
  innerDecorations: o
16687
16687
  })));
16688
16688
  if (!s) return y;
16689
- const m = i.filter((C) => !C.inline);
16689
+ const m = i.filter((k) => !k.inline);
16690
16690
  return m.length ? m.reduce(bs, y) : y;
16691
16691
  })), ff = /* @__PURE__ */ ft(null);
16692
16692
  function Yb(n, e) {
@@ -16713,7 +16713,7 @@ function Yb(n, e) {
16713
16713
  }
16714
16714
  const df = /* @__PURE__ */ Ge(Yb), Gb = [];
16715
16715
  function Xb(n) {
16716
- var h;
16716
+ var p;
16717
16717
  let { className: e, children: t, nodeViews: r, customNodeViews: s, ...o } = n;
16718
16718
  const [i, l] = N(null), { editor: a, state: c } = pb(i, {
16719
16719
  ...o,
@@ -16722,7 +16722,7 @@ function Xb(n) {
16722
16722
  nodeViews: r ?? {}
16723
16723
  }), [
16724
16724
  r
16725
- ]), p = Me(() => {
16725
+ ]), h = Me(() => {
16726
16726
  var y;
16727
16727
  return {
16728
16728
  className: e,
@@ -16735,7 +16735,7 @@ function Xb(n) {
16735
16735
  }, [
16736
16736
  e,
16737
16737
  a.docViewDescRef,
16738
- (h = a.view) == null ? void 0 : h.state.doc,
16738
+ (p = a.view) == null ? void 0 : p.state.doc,
16739
16739
  u,
16740
16740
  f
16741
16741
  ]);
@@ -16746,7 +16746,7 @@ function Xb(n) {
16746
16746
  }, /* @__PURE__ */ P.createElement(Ju.Provider, {
16747
16747
  value: d
16748
16748
  }, /* @__PURE__ */ P.createElement(ff.Provider, {
16749
- value: p
16749
+ value: h
16750
16750
  }, t))));
16751
16751
  }
16752
16752
  function hf(n) {
@@ -17349,8 +17349,8 @@ const Cf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
17349
17349
  s(""), a(""), i(void 0);
17350
17350
  }, [e]), et((d) => {
17351
17351
  if (!d || !e) return;
17352
- const p = ct.getState(d.state);
17353
- u(p.upload !== void 0);
17352
+ const h = ct.getState(d.state);
17353
+ u(h.upload !== void 0);
17354
17354
  }, [e]);
17355
17355
  const f = se((d) => {
17356
17356
  d && (c ? Hm(d, o, l, n) : Km(d, r, l, n), d.focus(), t());
@@ -17497,14 +17497,14 @@ function k0() {
17497
17497
  return (n, e) => {
17498
17498
  const t = n.tr.selection.anchor + 1, r = n.tr, s = n.schema.nodes.table_cell.createAndFill(), o = n.schema.nodes.table.create(
17499
17499
  null,
17500
- k.fromArray([
17500
+ S.fromArray([
17501
17501
  n.schema.nodes.table_row.create(
17502
17502
  null,
17503
- k.fromArray([s, s, s])
17503
+ S.fromArray([s, s, s])
17504
17504
  ),
17505
17505
  n.schema.nodes.table_row.create(
17506
17506
  null,
17507
- k.fromArray([s, s, s])
17507
+ S.fromArray([s, s, s])
17508
17508
  )
17509
17509
  ])
17510
17510
  );
@@ -17542,34 +17542,34 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17542
17542
  ] }), Of = Ge(
17543
17543
  function({ children: e, nodeProps: t, ...r }, s) {
17544
17544
  const [o, i] = N(t.node.attrs.alt ?? ""), [l, a] = N(t.node.attrs.title ?? ""), [c, u] = N(!1), [f, d] = N("");
17545
- pf((x, C) => x ? !(C instanceof MouseEvent) : !1), et((x) => {
17545
+ pf((x, k) => x ? !(k instanceof MouseEvent) : !1), et((x) => {
17546
17546
  if (d(""), u(!1), !x || !x.state.schema.nodes.carousel) return;
17547
- const C = t.getPos(), w = x.state.doc.resolve(C).parent;
17547
+ const k = t.getPos(), w = x.state.doc.resolve(k).parent;
17548
17548
  if (u(w.type.name !== "carousel"), w.type.name === "carousel") {
17549
17549
  let O = 0;
17550
- w.forEach((v, S) => {
17551
- v === t.node && (O = S + 1);
17550
+ w.forEach((v, C) => {
17551
+ v === t.node && (O = C + 1);
17552
17552
  }), d(O ? `${O} / ${w.childCount}` : "");
17553
17553
  }
17554
17554
  });
17555
- const p = se((x, C) => {
17555
+ const h = se((x, k) => {
17556
17556
  if (!x) return;
17557
- i(C);
17557
+ i(k);
17558
17558
  const w = x.state.tr, O = t.getPos();
17559
- x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, alt: C })), x.focus();
17560
- }), h = se((x, C) => {
17559
+ x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, alt: k })), x.focus();
17560
+ }), p = se((x, k) => {
17561
17561
  if (!x) return;
17562
- a(C);
17562
+ a(k);
17563
17563
  const w = x.state.tr, O = t.getPos();
17564
- x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, title: C })), x.focus();
17564
+ x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, title: k })), x.focus();
17565
17565
  }), y = se((x) => {
17566
17566
  if (!x) return;
17567
- const C = t.getPos(), w = t.node.nodeSize, O = t.node.attrs, v = x.state.schema, S = v.nodes.carousel.create(null, v.nodes.image.create(O));
17568
- x.dispatch(x.state.tr.replaceWith(C, C + w, S));
17567
+ const k = t.getPos(), w = t.node.nodeSize, O = t.node.attrs, v = x.state.schema, C = v.nodes.carousel.create(null, v.nodes.image.create(O));
17568
+ x.dispatch(x.state.tr.replaceWith(k, k + w, C));
17569
17569
  }), m = se((x) => {
17570
17570
  if (!x) return;
17571
- const C = x.state.tr, w = t.getPos(), O = t.node.nodeSize;
17572
- x.dispatch(C.delete(w, w + O));
17571
+ const k = x.state.tr, w = t.getPos(), O = t.node.nodeSize;
17572
+ x.dispatch(k.delete(w, w + O));
17573
17573
  });
17574
17574
  return /* @__PURE__ */ g.jsxs(
17575
17575
  "div",
@@ -17589,7 +17589,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17589
17589
  {
17590
17590
  value: o,
17591
17591
  placeholder: "Alt: описание изображения (не обязательно)",
17592
- onChange: p,
17592
+ onChange: h,
17593
17593
  empty: !0,
17594
17594
  style: {
17595
17595
  textAlign: "center",
@@ -17610,7 +17610,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17610
17610
  {
17611
17611
  value: l,
17612
17612
  placeholder: "Title: подпись под изображением (не обязательно)",
17613
- onChange: h,
17613
+ onChange: p,
17614
17614
  empty: !0,
17615
17615
  style: {
17616
17616
  textAlign: "center",
@@ -17631,12 +17631,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17631
17631
  const u = se((f, d) => {
17632
17632
  if (!f) return;
17633
17633
  a(d);
17634
- const { $from: p, $to: h } = f.state.selection, y = p.blockRange(h);
17634
+ const { $from: h, $to: p } = f.state.selection, y = h.blockRange(p);
17635
17635
  if (y) {
17636
17636
  const m = f.state.doc;
17637
17637
  let x = f.state.tr;
17638
- m.nodesBetween(y.start, y.end, (C, w) => {
17639
- C.type.name === "video" && (x = x.setNodeMarkup(w, null, { ...t.node.attrs, title: d }));
17638
+ m.nodesBetween(y.start, y.end, (k, w) => {
17639
+ k.type.name === "video" && (x = x.setNodeMarkup(w, null, { ...t.node.attrs, title: d }));
17640
17640
  }), f.dispatch(x);
17641
17641
  }
17642
17642
  f.focus();
@@ -17701,15 +17701,15 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17701
17701
  }, d1 = ({ title: n = !1, content: e, onSave: t, onCancel: r, onChange: s, onUpload: o }) => {
17702
17702
  const [i, l] = N(""), [a, c] = N();
17703
17703
  q(() => {
17704
- const p = lt.create({
17704
+ const h = lt.create({
17705
17705
  doc: y0(e),
17706
17706
  schema: Vr,
17707
17707
  plugins: mf({ schema: Vr, upload: o })
17708
17708
  });
17709
- c(p), n !== !1 && l(typeof n == "string" ? n : "");
17709
+ c(h), n !== !1 && l(typeof n == "string" ? n : "");
17710
17710
  }, [n, e]);
17711
- const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (p) => {
17712
- !t || !u() || t({ ...p, name: i });
17711
+ const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (h) => {
17712
+ !t || !u() || t({ ...h, name: i });
17713
17713
  }, d = () => {
17714
17714
  r && r();
17715
17715
  };
@@ -17718,7 +17718,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17718
17718
  "input",
17719
17719
  {
17720
17720
  className: "ProseNotesTitle",
17721
- onChange: (p) => l(p.currentTarget.value),
17721
+ onChange: (h) => l(h.currentTarget.value),
17722
17722
  value: i,
17723
17723
  placeholder: "Укажите заголовок"
17724
17724
  }
@@ -17727,8 +17727,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17727
17727
  hf,
17728
17728
  {
17729
17729
  state: a,
17730
- dispatchTransaction: (p) => c((h) => {
17731
- const y = h == null ? void 0 : h.apply(p);
17730
+ dispatchTransaction: (h) => c((p) => {
17731
+ const y = p == null ? void 0 : p.apply(h);
17732
17732
  return y && s && s(!!Ko(y)), y;
17733
17733
  }),
17734
17734
  nodeViews: {
@@ -17754,12 +17754,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17754
17754
  const u = n.nodes.heading;
17755
17755
  if (!c || !u || !i) return;
17756
17756
  const f = [], d = [];
17757
- for (let p = 2; p < 7; p++) {
17758
- const y = kn(u, { level: p });
17759
- d[p] = y, f[p] = {
17760
- id: p,
17761
- icon: /* @__PURE__ */ g.jsx(w0, { level: p }),
17762
- text: `уровень ${p}`,
17757
+ for (let h = 2; h < 7; h++) {
17758
+ const y = kn(u, { level: h });
17759
+ d[h] = y, f[h] = {
17760
+ id: h,
17761
+ icon: /* @__PURE__ */ g.jsx(w0, { level: h }),
17762
+ text: `уровень ${h}`,
17763
17763
  disabled: !y(c.state)
17764
17764
  };
17765
17765
  }
@@ -17828,8 +17828,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17828
17828
  if (u) {
17829
17829
  const f = o.state.doc;
17830
17830
  let d = o.state.tr;
17831
- f.nodesBetween(u.start, u.end, (p, h) => {
17832
- p.type.name === "paragraph" && (d = d.setNodeMarkup(h, null, { align: l }));
17831
+ f.nodesBetween(u.start, u.end, (h, p) => {
17832
+ h.type.name === "paragraph" && (d = d.setNodeMarkup(p, null, { align: l }));
17833
17833
  }), o.dispatch(d);
17834
17834
  }
17835
17835
  o.focus(), r(!1);
@@ -17869,35 +17869,35 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17869
17869
  /* @__PURE__ */ g.jsx(Cf, {}),
17870
17870
  /* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ g.jsx(Tf, { onSave: e }) })
17871
17871
  ] }), O0 = 7, Af = 1, Fn = 50, E0 = ({ width: n, onChange: e, onWidth: t }) => {
17872
- const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (h) => {
17872
+ const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (p) => {
17873
17873
  const y = n[l], m = n[l + 1], x = [...c];
17874
- return y + h < Fn && (h = Fn - y), m - h < Fn && (h = m - Fn), x[l] = y + h, x[l + 1] = m - h, x;
17874
+ return y + p < Fn && (p = Fn - y), m - p < Fn && (p = m - Fn), x[l] = y + p, x[l + 1] = m - p, x;
17875
17875
  };
17876
17876
  q(() => {
17877
17877
  u(n);
17878
17878
  }, [n]), q(() => {
17879
- const h = (m) => {
17879
+ const p = (m) => {
17880
17880
  if (!r) return;
17881
17881
  s(!1), m.preventDefault(), m.stopPropagation();
17882
- const x = m.clientX - o, C = f(x);
17883
- t(C);
17882
+ const x = m.clientX - o, k = f(x);
17883
+ t(k);
17884
17884
  }, y = (m) => {
17885
17885
  if (!r) return;
17886
17886
  m.preventDefault(), m.stopPropagation();
17887
- const x = m.clientX - o, C = f(x);
17888
- u(C), e(C);
17887
+ const x = m.clientX - o, k = f(x);
17888
+ u(k), e(k);
17889
17889
  };
17890
- return document.addEventListener("mouseup", h), document.addEventListener("mousemove", y), () => {
17891
- document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", y);
17890
+ return document.addEventListener("mouseup", p), document.addEventListener("mousemove", y), () => {
17891
+ document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", y);
17892
17892
  };
17893
17893
  }, [r, l]);
17894
- const d = (h, y) => {
17895
- y !== n.length - 1 && (h.preventDefault(), h.stopPropagation(), s(!0), i(h.clientX), a(y));
17896
- }, p = (h) => c.slice(0, h + 1).reduce((y, m) => y + m, 0) + h + Af - Math.floor(O0 / 2);
17897
- return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((h, y) => /* @__PURE__ */ g.jsx(
17894
+ const d = (p, y) => {
17895
+ y !== n.length - 1 && (p.preventDefault(), p.stopPropagation(), s(!0), i(p.clientX), a(y));
17896
+ }, h = (p) => c.slice(0, p + 1).reduce((y, m) => y + m, 0) + p + Af - Math.floor(O0 / 2);
17897
+ return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((p, y) => /* @__PURE__ */ g.jsx(
17898
17898
  "div",
17899
17899
  {
17900
- style: { left: p(y) + "px" },
17900
+ style: { left: h(y) + "px" },
17901
17901
  onMouseDown: (m) => d(m, y)
17902
17902
  },
17903
17903
  y
@@ -17905,29 +17905,29 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17905
17905
  }, T0 = Ge(
17906
17906
  function({ children: e, nodeProps: t, ...r }, s) {
17907
17907
  var f;
17908
- const o = I(null), i = I(null), [l, a] = N([]), c = se((d, p) => {
17908
+ const o = I(null), i = I(null), [l, a] = N([]), c = se((d, h) => {
17909
17909
  if (!d) return;
17910
- const h = t.node, y = t.getPos() + 1, m = Z.get(h), x = d.state.tr;
17911
- for (let C = 0; C < m.height; C++)
17910
+ const p = t.node, y = t.getPos() + 1, m = Z.get(p), x = d.state.tr;
17911
+ for (let k = 0; k < m.height; k++)
17912
17912
  for (let w = 0; w < m.width; ) {
17913
- const O = C * m.width + w, v = m.map[O], S = h.nodeAt(v).attrs, $ = p.slice(w, w + S.colspan);
17914
- C && m.map[O] == m.map[O - m.width] || x.setNodeMarkup(y + v, null, { ...S, colwidth: $ }), w += S.colspan;
17913
+ const O = k * m.width + w, v = m.map[O], C = p.nodeAt(v).attrs, $ = h.slice(w, w + C.colspan);
17914
+ k && m.map[O] == m.map[O - m.width] || x.setNodeMarkup(y + v, null, { ...C, colwidth: $ }), w += C.colspan;
17915
17915
  }
17916
17916
  x.docChanged && d.dispatch(x);
17917
17917
  });
17918
17918
  q(() => {
17919
17919
  if (!o.current || !i.current) return;
17920
- const p = t.node.firstChild;
17921
- if (!p) return;
17922
- let h = [];
17923
- for (let S = 0; S < p.childCount; S++) {
17924
- const $ = p.child(S), { colspan: j, colwidth: E } = $.attrs;
17925
- h = h.concat(Array.isArray(E) ? E : Array(j).fill(0));
17926
- }
17927
- const y = h.filter((S) => !S).length, m = h.reduce((S, $) => S + $, 0), x = (h.length + 1) * Af, C = Math.max(y ? (o.current.offsetWidth - m - x) / y : 0, Fn);
17928
- h = h.map((S) => S || C);
17929
- const w = h.reduce((S, $) => S + $, 0), O = i.current.offsetWidth - x - 16, v = O / w;
17930
- h = h.map((S) => Math.round(S * v)), h[h.length - 1] += O - h.reduce((S, $) => S + $, 0), a(h);
17920
+ const h = t.node.firstChild;
17921
+ if (!h) return;
17922
+ let p = [];
17923
+ for (let C = 0; C < h.childCount; C++) {
17924
+ const $ = h.child(C), { colspan: j, colwidth: E } = $.attrs;
17925
+ p = p.concat(Array.isArray(E) ? E : Array(j).fill(0));
17926
+ }
17927
+ const y = p.filter((C) => !C).length, m = p.reduce((C, $) => C + $, 0), x = (p.length + 1) * Af, k = Math.max(y ? (o.current.offsetWidth - m - x) / y : 0, Fn);
17928
+ p = p.map((C) => C || k);
17929
+ const w = p.reduce((C, $) => C + $, 0), O = i.current.offsetWidth - x - 16, v = O / w;
17930
+ p = p.map((C) => Math.round(C * v)), p[p.length - 1] += O - p.reduce((C, $) => C + $, 0), a(p);
17931
17931
  }, [t, o, i, (f = i.current) == null ? void 0 : f.offsetWidth]);
17932
17932
  const u = se((d) => {
17933
17933
  my(d.state, d.dispatch);
@@ -17943,7 +17943,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17943
17943
  children: [
17944
17944
  /* @__PURE__ */ g.jsx(E0, { width: l, onChange: a, onWidth: c }),
17945
17945
  /* @__PURE__ */ g.jsxs("table", { ref: o, children: [
17946
- /* @__PURE__ */ g.jsx("colgroup", { children: l.map((d, p) => /* @__PURE__ */ g.jsx("col", { width: d }, p)) }),
17946
+ /* @__PURE__ */ g.jsx("colgroup", { children: l.map((d, h) => /* @__PURE__ */ g.jsx("col", { width: d }, h)) }),
17947
17947
  /* @__PURE__ */ g.jsx("caption", { onClick: u, children: /* @__PURE__ */ g.jsx(T.Trash, {}) }),
17948
17948
  /* @__PURE__ */ g.jsx("tbody", { children: e })
17949
17949
  ] })
@@ -18020,133 +18020,131 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18020
18020
  text: "Split cell",
18021
18021
  icon: /* @__PURE__ */ g.jsx(T.CellsSplit, {})
18022
18022
  }], va = ({
18023
- parent: n,
18024
- isRowMenuOpen: e,
18025
- isCellMenuOpen: t,
18026
- isColumnMenuOpen: r,
18027
- onRowMenuClose: s,
18028
- onCellMenuClose: o,
18029
- onColumnMenuClose: i
18023
+ x: n,
18024
+ y: e,
18025
+ isRowMenuOpen: t,
18026
+ isCellMenuOpen: r,
18027
+ isColumnMenuOpen: s,
18028
+ onRowMenuClose: o,
18029
+ onCellMenuClose: i,
18030
+ onColumnMenuClose: l
18030
18031
  }) => {
18031
- const l = se((a, c) => {
18032
- if (a) {
18033
- switch (c.id) {
18032
+ const a = se((c, u) => {
18033
+ if (c) {
18034
+ switch (u.id) {
18034
18035
  case "toggleHeaderRow":
18035
- fy(a.state, a.dispatch);
18036
+ fy(c.state, c.dispatch);
18036
18037
  break;
18037
18038
  case "addRowBefore":
18038
- ny(a.state, a.dispatch);
18039
+ ny(c.state, c.dispatch);
18039
18040
  break;
18040
18041
  case "addRowAfter":
18041
- ry(a.state, a.dispatch);
18042
+ ry(c.state, c.dispatch);
18042
18043
  break;
18043
18044
  case "deleteRow":
18044
- oy(a.state, a.dispatch);
18045
+ oy(c.state, c.dispatch);
18045
18046
  break;
18046
18047
  case "toggleHeaderColumn":
18047
- dy(a.state, a.dispatch);
18048
+ dy(c.state, c.dispatch);
18048
18049
  break;
18049
18050
  case "addColumnBefore":
18050
- Xg(a.state, a.dispatch);
18051
+ Xg(c.state, c.dispatch);
18051
18052
  break;
18052
18053
  case "addColumnAfter":
18053
- Qg(a.state, a.dispatch);
18054
+ Qg(c.state, c.dispatch);
18054
18055
  break;
18055
18056
  case "deleteColumn":
18056
- ey(a.state, a.dispatch);
18057
+ ey(c.state, c.dispatch);
18057
18058
  break;
18058
18059
  case "mergeCells":
18059
- ly(a.state, a.dispatch);
18060
+ ly(c.state, c.dispatch);
18060
18061
  break;
18061
18062
  case "splitCell":
18062
- ay(a.state, a.dispatch);
18063
+ ay(c.state, c.dispatch);
18063
18064
  break;
18064
18065
  case "toggleHeaderCell":
18065
- hy(a.state, a.dispatch);
18066
+ hy(c.state, c.dispatch);
18066
18067
  break;
18067
18068
  case "alignLeft":
18068
- fn("halign", "left")(a.state, a.dispatch);
18069
+ fn("halign", "left")(c.state, c.dispatch);
18069
18070
  break;
18070
18071
  case "alignCenter":
18071
- fn("halign", "center")(a.state, a.dispatch);
18072
+ fn("halign", "center")(c.state, c.dispatch);
18072
18073
  break;
18073
18074
  case "alignRight":
18074
- fn("halign", "right")(a.state, a.dispatch);
18075
+ fn("halign", "right")(c.state, c.dispatch);
18075
18076
  break;
18076
18077
  case "alignTop":
18077
- fn("valign", "top")(a.state, a.dispatch);
18078
+ fn("valign", "top")(c.state, c.dispatch);
18078
18079
  break;
18079
18080
  case "alignMiddle":
18080
- fn("valign", "middle")(a.state, a.dispatch);
18081
+ fn("valign", "middle")(c.state, c.dispatch);
18081
18082
  break;
18082
18083
  case "alignBottom":
18083
- fn("valign", "bottom")(a.state, a.dispatch);
18084
+ fn("valign", "bottom")(c.state, c.dispatch);
18084
18085
  break;
18085
18086
  }
18086
- s(), o(), i(), a.focus();
18087
+ o(), i(), l(), c.focus();
18087
18088
  }
18088
18089
  });
18089
- return n ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
18090
+ return /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
18090
18091
  /* @__PURE__ */ g.jsx(
18091
18092
  Bn,
18092
18093
  {
18093
- parent: n,
18094
+ x: n,
18095
+ y: e,
18094
18096
  items: A0,
18095
- isOpen: e,
18096
- onClose: s,
18097
- onClick: l,
18098
- vertical: "top",
18099
- horizontal: "inner-left"
18097
+ isOpen: t,
18098
+ onClose: o,
18099
+ onClick: a
18100
18100
  }
18101
18101
  ),
18102
18102
  /* @__PURE__ */ g.jsx(
18103
18103
  Bn,
18104
18104
  {
18105
- parent: n,
18105
+ x: n,
18106
+ y: e,
18106
18107
  items: I0,
18107
- isOpen: t,
18108
- onClose: o,
18109
- onClick: l,
18110
- horizontal: "inner-left"
18108
+ isOpen: r,
18109
+ onClose: i,
18110
+ onClick: a
18111
18111
  }
18112
18112
  ),
18113
18113
  /* @__PURE__ */ g.jsx(
18114
18114
  Bn,
18115
18115
  {
18116
- parent: n,
18116
+ x: n,
18117
+ y: e,
18117
18118
  items: R0,
18118
- isOpen: r,
18119
- onClose: i,
18120
- onClick: l,
18121
- vertical: "top",
18122
- horizontal: "inner-left",
18123
- margin: "var(--alxgrn-unit)"
18119
+ isOpen: s,
18120
+ onClose: l,
18121
+ onClick: a
18124
18122
  }
18125
18123
  )
18126
- ] }) : null;
18124
+ ] });
18127
18125
  }, Va = Ge(
18128
18126
  function({ children: e, nodeProps: t, ...r }, s) {
18129
- const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1);
18127
+ const o = I(null), [i, l] = N(0), [a, c] = N(0), [u, f] = N(!1), [d, h] = N(!1), [p, y] = N(!1);
18130
18128
  q(() => {
18131
- const h = (y) => {
18132
- o.current !== y.target && (l(!1), c(!1), f(!1));
18129
+ const k = (w) => {
18130
+ o.current !== w.target && (f(!1), h(!1), y(!1));
18133
18131
  };
18134
- return document.addEventListener("contextmenu", h, !0), () => document.removeEventListener("contextmenu", h, !0);
18132
+ return document.addEventListener("contextmenu", k, !0), () => document.removeEventListener("contextmenu", k, !0);
18135
18133
  }, []);
18136
- const d = (h) => {
18137
- h.preventDefault(), h.stopPropagation(), l(!1), c(!1), f(!1);
18138
- const y = h.currentTarget.getBoundingClientRect();
18139
- h.clientY < y.y ? f(!0) : h.clientX < y.x ? l(!0) : c(!0);
18140
- }, p = (h) => {
18141
- l(!1), c(!1), f(!1);
18142
- const y = h.currentTarget.getBoundingClientRect();
18143
- if (h.clientY < y.y)
18134
+ const m = (k) => {
18135
+ k.preventDefault(), k.stopPropagation(), f(!1), h(!1), y(!1), l(k.clientX), c(k.clientY);
18136
+ const w = k.currentTarget.getBoundingClientRect();
18137
+ k.clientY < w.y ? y(!0) : k.clientX < w.x ? f(!0) : h(!0);
18138
+ }, x = (k) => {
18139
+ f(!1), h(!1), y(!1), l(k.clientX), c(k.clientY);
18140
+ const w = k.currentTarget.getBoundingClientRect();
18141
+ if (k.clientY < w.y)
18142
+ y(!0);
18143
+ else if (k.clientX < w.x)
18144
18144
  f(!0);
18145
- else if (h.clientX < y.x)
18146
- l(!0);
18147
18145
  else
18148
18146
  return;
18149
- h.preventDefault(), h.stopPropagation();
18147
+ k.preventDefault(), k.stopPropagation();
18150
18148
  };
18151
18149
  return t.node.type.spec.tableRole === "header_cell" ? /* @__PURE__ */ g.jsxs(
18152
18150
  "th",
@@ -18159,23 +18157,24 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18159
18157
  textAlign: t.node.attrs.halign,
18160
18158
  verticalAlign: t.node.attrs.valign
18161
18159
  },
18162
- onClick: p,
18163
- onContextMenu: d,
18164
- ref: (h) => {
18165
- o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
18160
+ onClick: x,
18161
+ onContextMenu: m,
18162
+ ref: (k) => {
18163
+ o.current = k, s && (typeof s == "function" ? s(k) : s.current = k);
18166
18164
  },
18167
18165
  children: [
18168
18166
  e,
18169
18167
  /* @__PURE__ */ g.jsx(
18170
18168
  va,
18171
18169
  {
18172
- parent: o.current,
18173
- isRowMenuOpen: i,
18174
- onRowMenuClose: () => l(!1),
18175
- isCellMenuOpen: a,
18176
- onCellMenuClose: () => c(!1),
18177
- isColumnMenuOpen: u,
18178
- onColumnMenuClose: () => f(!1)
18170
+ x: i,
18171
+ y: a,
18172
+ isRowMenuOpen: u,
18173
+ onRowMenuClose: () => f(!1),
18174
+ isCellMenuOpen: d,
18175
+ onCellMenuClose: () => h(!1),
18176
+ isColumnMenuOpen: p,
18177
+ onColumnMenuClose: () => y(!1)
18179
18178
  }
18180
18179
  )
18181
18180
  ]
@@ -18191,23 +18190,24 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18191
18190
  textAlign: t.node.attrs.halign,
18192
18191
  verticalAlign: t.node.attrs.valign
18193
18192
  },
18194
- onClick: p,
18195
- onContextMenu: d,
18196
- ref: (h) => {
18197
- o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
18193
+ onClick: x,
18194
+ onContextMenu: m,
18195
+ ref: (k) => {
18196
+ o.current = k, s && (typeof s == "function" ? s(k) : s.current = k);
18198
18197
  },
18199
18198
  children: [
18200
18199
  e,
18201
18200
  /* @__PURE__ */ g.jsx(
18202
18201
  va,
18203
18202
  {
18204
- parent: o.current,
18205
- isRowMenuOpen: i,
18206
- onRowMenuClose: () => l(!1),
18207
- isCellMenuOpen: a,
18208
- onCellMenuClose: () => c(!1),
18209
- isColumnMenuOpen: u,
18210
- onColumnMenuClose: () => f(!1)
18203
+ x: i,
18204
+ y: a,
18205
+ isRowMenuOpen: u,
18206
+ onRowMenuClose: () => f(!1),
18207
+ isCellMenuOpen: d,
18208
+ onCellMenuClose: () => h(!1),
18209
+ isColumnMenuOpen: p,
18210
+ onColumnMenuClose: () => y(!1)
18211
18211
  }
18212
18212
  )
18213
18213
  ]
@@ -18217,29 +18217,29 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18217
18217
  ), P0 = Ge(
18218
18218
  function({ children: e, nodeProps: t, ...r }, s) {
18219
18219
  var v;
18220
- const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, p] = N(), [h, y] = N(), m = (S) => {
18221
- const $ = S.scrollLeft, j = S.clientWidth, E = S.scrollWidth;
18220
+ const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, h] = N(), [p, y] = N(), m = (C) => {
18221
+ const $ = C.scrollLeft, j = C.clientWidth, E = C.scrollWidth;
18222
18222
  c($ > 0), f($ < E - j * 1.5);
18223
18223
  };
18224
18224
  q(() => {
18225
- o.current && (h && o.current.scrollWidth > h && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), y(o.current.scrollWidth));
18225
+ o.current && (p && o.current.scrollWidth > p && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), y(o.current.scrollWidth));
18226
18226
  }, [(v = o.current) == null ? void 0 : v.scrollWidth]), q(() => {
18227
- p(t.getPos() + t.node.nodeSize - 1), o.current && t.node.childCount > 1 && m(o.current);
18228
- }, [t, o]), et((S) => {
18229
- if (!S || t.node.childCount > 0) return;
18230
- const $ = S.state.tr, j = t.getPos(), E = t.node.nodeSize;
18231
- S.dispatch($.delete(j, j + E));
18227
+ h(t.getPos() + t.node.nodeSize - 1), o.current && t.node.childCount > 1 && m(o.current);
18228
+ }, [t, o]), et((C) => {
18229
+ if (!C || t.node.childCount > 0) return;
18230
+ const $ = C.state.tr, j = t.getPos(), E = t.node.nodeSize;
18231
+ C.dispatch($.delete(j, j + E));
18232
18232
  }, [t]);
18233
- const x = se((S) => {
18234
- if (!S) return;
18233
+ const x = se((C) => {
18234
+ if (!C) return;
18235
18235
  const $ = t.getPos(), j = t.node.nodeSize;
18236
- S.dispatch(S.state.tr.delete($, $ + j));
18237
- }), C = () => {
18236
+ C.dispatch(C.state.tr.delete($, $ + j));
18237
+ }), k = () => {
18238
18238
  l(!0);
18239
- }, w = (S) => {
18240
- m(S.currentTarget);
18241
- }, O = (S, $) => {
18242
- if (S.stopPropagation(), !o.current) return;
18239
+ }, w = (C) => {
18240
+ m(C.currentTarget);
18241
+ }, O = (C, $) => {
18242
+ if (C.stopPropagation(), !o.current) return;
18243
18243
  const j = o.current.clientWidth;
18244
18244
  let E = o.current.scrollLeft + $ * j;
18245
18245
  o.current.scrollLeft = E;
@@ -18248,10 +18248,10 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18248
18248
  /* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: o, onScroll: w, children: e }),
18249
18249
  /* @__PURE__ */ g.jsxs("div", { className: "carousel-buttons", children: [
18250
18250
  /* @__PURE__ */ g.jsx("div", { onClick: x, className: "text-button", children: "Удалить карусель" }),
18251
- /* @__PURE__ */ g.jsx("div", { onClick: C, children: /* @__PURE__ */ g.jsx(T.Plus, {}) })
18251
+ /* @__PURE__ */ g.jsx("div", { onClick: k, children: /* @__PURE__ */ g.jsx(T.Plus, {}) })
18252
18252
  ] }),
18253
- a && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (S) => O(S, -1), children: /* @__PURE__ */ g.jsx(T.ChevronLeft, {}) }),
18254
- u && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (S) => O(S, 1), children: /* @__PURE__ */ g.jsx(T.ChevronRight, {}) }),
18253
+ a && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (C) => O(C, -1), children: /* @__PURE__ */ g.jsx(T.ChevronLeft, {}) }),
18254
+ u && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (C) => O(C, 1), children: /* @__PURE__ */ g.jsx(T.ChevronRight, {}) }),
18255
18255
  /* @__PURE__ */ g.jsx(Mf, { pos: d, isOpen: i, onClose: () => l(!1) })
18256
18256
  ] });
18257
18257
  }
@@ -18334,9 +18334,9 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18334
18334
  };
18335
18335
  return document.addEventListener("fullscreenchange", f), () => document.removeEventListener("fullscreenchange", f);
18336
18336
  }, []), q(() => {
18337
- var p, h, y, m, x, C, w;
18338
- let f = (p = n.attrs) == null ? void 0 : p.fid, d = (h = n.attrs) != null && h.src ? `${(y = n.attrs) == null ? void 0 : y.src}` : "";
18339
- f && (d = `${xs}/files/${f}`), d || (d = ks), r(d), o((m = n.attrs) != null && m.alt ? `${(x = n.attrs) == null ? void 0 : x.alt}` : ""), l((C = n.attrs) != null && C.title ? `${(w = n.attrs) == null ? void 0 : w.title}` : "");
18337
+ var h, p, y, m, x, k, w;
18338
+ let f = (h = n.attrs) == null ? void 0 : h.fid, d = (p = n.attrs) != null && p.src ? `${(y = n.attrs) == null ? void 0 : y.src}` : "";
18339
+ f && (d = `${xs}/files/${f}`), d || (d = ks), r(d), o((m = n.attrs) != null && m.alt ? `${(x = n.attrs) == null ? void 0 : x.alt}` : ""), l((k = n.attrs) != null && k.title ? `${(w = n.attrs) == null ? void 0 : w.title}` : "");
18340
18340
  }, [n]);
18341
18341
  const u = (f) => {
18342
18342
  var d;
@@ -18427,9 +18427,9 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18427
18427
  t((i = n.attrs) != null && i.src ? `${(l = n.attrs) == null ? void 0 : l.src}` : ""), s((a = n.attrs) != null && a.title ? `${(c = n.attrs) == null ? void 0 : c.title}` : "");
18428
18428
  }, [n]), Ss(e) ? /* @__PURE__ */ g.jsx("div", { title: r, className: "video", children: /* @__PURE__ */ g.jsx("iframe", { src: e, allow: o }) }) : /* @__PURE__ */ g.jsx("div", { title: r, className: "image", children: /* @__PURE__ */ g.jsx("img", { src: ks }) });
18429
18429
  }, Y0 = () => /* @__PURE__ */ g.jsx("br", {}), G0 = ({ node: n }) => {
18430
- const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), p = (m) => {
18431
- const x = m.scrollLeft, C = m.clientWidth, w = m.scrollWidth;
18432
- i(x > C / 2), a(x < w - C * 1.5), u(Math.round(x / C + 1));
18430
+ const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), h = (m) => {
18431
+ const x = m.scrollLeft, k = m.clientWidth, w = m.scrollWidth;
18432
+ i(x > k / 2), a(x < w - k * 1.5), u(Math.round(x / k + 1));
18433
18433
  };
18434
18434
  q(() => {
18435
18435
  var m;
@@ -18446,31 +18446,31 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18446
18446
  };
18447
18447
  return document.body.addEventListener("keydown", m), () => document.body.removeEventListener("keydown", m);
18448
18448
  }, [r]);
18449
- const h = (m) => {
18449
+ const p = (m) => {
18450
18450
  var x;
18451
18451
  m.stopPropagation(), r ? document.exitFullscreen() : (x = t.current) == null || x.requestFullscreen();
18452
18452
  }, y = (m, x) => {
18453
18453
  if (m == null || m.stopPropagation(), !e.current) return;
18454
- const C = e.current.clientWidth;
18455
- let w = e.current.scrollLeft + x * C;
18454
+ const k = e.current.clientWidth;
18455
+ let w = e.current.scrollLeft + x * k;
18456
18456
  e.current.scrollLeft = w;
18457
18457
  };
18458
18458
  return Array.isArray(n.content) ? /* @__PURE__ */ g.jsxs("div", { className: "carousel", ref: t, children: [
18459
- /* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => p(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(X0, { node: m, onClick: h }, x)) }),
18459
+ /* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => h(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(X0, { node: m, onClick: p }, x)) }),
18460
18460
  /* @__PURE__ */ g.jsxs("div", { className: "carousel-numb", children: [
18461
18461
  c,
18462
18462
  " / ",
18463
18463
  f
18464
18464
  ] }),
18465
- /* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: h, children: r ? /* @__PURE__ */ g.jsx(T.Minimize, {}) : /* @__PURE__ */ g.jsx(T.Maximize, {}) }),
18465
+ /* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: p, children: r ? /* @__PURE__ */ g.jsx(T.Minimize, {}) : /* @__PURE__ */ g.jsx(T.Maximize, {}) }),
18466
18466
  o && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (m) => y(m, -1), children: /* @__PURE__ */ g.jsx(T.ChevronLeft, {}) }),
18467
18467
  l && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (m) => y(m, 1), children: /* @__PURE__ */ g.jsx(T.ChevronRight, {}) })
18468
18468
  ] }) : null;
18469
18469
  }, X0 = ({ node: n, onClick: e }) => {
18470
18470
  const [t, r] = N(""), [s, o] = N(""), [i, l] = N("");
18471
18471
  return q(() => {
18472
- var d, p, h, y;
18473
- let a = (d = n.attrs) == null ? void 0 : d.fid, c = (p = n.attrs) != null && p.src ? `${n.attrs.src}` : "", u = (h = n.attrs) != null && h.alt ? `${n.attrs.alt}` : "", f = (y = n.attrs) != null && y.title ? `${n.attrs.title}` : "";
18472
+ var d, h, p, y;
18473
+ let a = (d = n.attrs) == null ? void 0 : d.fid, c = (h = n.attrs) != null && h.src ? `${n.attrs.src}` : "", u = (p = n.attrs) != null && p.alt ? `${n.attrs.alt}` : "", f = (y = n.attrs) != null && y.title ? `${n.attrs.title}` : "";
18474
18474
  a && (c = `${xs}/files/${a}`), c || (c = ks), r(c), o(u), l(f);
18475
18475
  }, [n]), n.type !== "image" ? null : /* @__PURE__ */ g.jsxs("div", { className: "image", children: [
18476
18476
  t && /* @__PURE__ */ g.jsx("img", { src: t, onClick: e, alt: s, title: i }),