@alxgrn/prose-editor 0.0.15 → 0.0.17

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.
@@ -2,8 +2,8 @@ import './index.css';var Rf = Object.defineProperty;
2
2
  var If = (n, e, t) => e in n ? Rf(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var F = (n, e, t) => If(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import A, { createContext as ct, useLayoutEffect as Pf, useContext as ie, forwardRef as Ge, useState as N, useRef as I, useImperativeHandle as rs, useCallback as He, useMemo as Me, useReducer as vf, memo as Fe, createElement as Hn, useSyncExternalStore as Vf, cloneElement as ss, Component as $f, useEffect as q } from "react";
5
- import { unstable_batchedUpdates as zf, flushSync as Pi, createPortal as jf } from "react-dom";
6
- import { Icons as O, Prompt as Ff, Modal as Va, Form as $a, Image as Bf, Input as vr, Editable as za, Button as Lf, Menu as Fn } from "@alxgrn/telefrag-ui";
5
+ import { unstable_batchedUpdates as zf, flushSync as Ii, createPortal as jf } from "react-dom";
6
+ import { Icons as O, Prompt as Ff, Modal as va, Form as Va, Image as Bf, Input as vr, Editable as $a, Button as Lf, Menu as Fn } from "@alxgrn/telefrag-ui";
7
7
  function Wf(n) {
8
8
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
9
9
  }
@@ -17,10 +17,10 @@ var eo = { exports: {} }, In = {};
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
19
  */
20
- var vi;
20
+ var Pi;
21
21
  function _f() {
22
- if (vi) return In;
23
- vi = 1;
22
+ if (Pi) return In;
23
+ Pi = 1;
24
24
  var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
25
25
  function t(r, s, o) {
26
26
  var i = null;
@@ -49,9 +49,9 @@ var Pn = {};
49
49
  * This source code is licensed under the MIT license found in the
50
50
  * LICENSE file in the root directory of this source tree.
51
51
  */
52
- var Vi;
52
+ var vi;
53
53
  function qf() {
54
- return Vi || (Vi = 1, process.env.NODE_ENV !== "production" && function() {
54
+ return vi || (vi = 1, process.env.NODE_ENV !== "production" && function() {
55
55
  function n(b) {
56
56
  if (b == null) return null;
57
57
  if (typeof b == "function")
@@ -117,7 +117,7 @@ function qf() {
117
117
  }
118
118
  function s() {
119
119
  if (An === 0) {
120
- ki = console.log, Ci = console.info, wi = console.warn, Mi = console.error, Ni = console.group, Di = console.groupCollapsed, Oi = console.groupEnd;
120
+ Si = console.log, ki = console.info, Ci = console.warn, wi = console.error, Mi = console.group, Ni = console.groupCollapsed, Di = console.groupEnd;
121
121
  var b = {
122
122
  configurable: !0,
123
123
  enumerable: !0,
@@ -140,13 +140,13 @@ function qf() {
140
140
  if (An--, An === 0) {
141
141
  var b = { configurable: !0, enumerable: !0, writable: !0 };
142
142
  Object.defineProperties(console, {
143
- log: jt({}, b, { value: ki }),
144
- info: jt({}, b, { value: Ci }),
145
- warn: jt({}, b, { value: wi }),
146
- error: jt({}, b, { value: Mi }),
147
- group: jt({}, b, { value: Ni }),
148
- groupCollapsed: jt({}, b, { value: Di }),
149
- groupEnd: jt({}, b, { value: Oi })
143
+ log: jt({}, b, { value: Si }),
144
+ info: jt({}, b, { value: ki }),
145
+ warn: jt({}, b, { value: Ci }),
146
+ error: jt({}, b, { value: wi }),
147
+ group: jt({}, b, { value: Mi }),
148
+ groupCollapsed: jt({}, b, { value: Ni }),
149
+ groupEnd: jt({}, b, { value: Di })
150
150
  });
151
151
  }
152
152
  0 > An && console.error(
@@ -159,11 +159,11 @@ function qf() {
159
159
  throw Error();
160
160
  } catch (T) {
161
161
  var E = T.stack.trim().match(/\n( *(at )?)/);
162
- ks = E && E[1] || "", Ei = -1 < T.stack.indexOf(`
162
+ ks = E && E[1] || "", Oi = -1 < T.stack.indexOf(`
163
163
  at`) ? " (<anonymous>)" : -1 < T.stack.indexOf("@") ? "@unknown:0:0" : "";
164
164
  }
165
165
  return `
166
- ` + ks + b + Ei;
166
+ ` + ks + b + Oi;
167
167
  }
168
168
  function l(b, E) {
169
169
  if (!b || Cs) return "";
@@ -298,7 +298,7 @@ function qf() {
298
298
  return b === null ? null : b.getOwner();
299
299
  }
300
300
  function u(b) {
301
- if (Si.call(b, "key")) {
301
+ if (xi.call(b, "key")) {
302
302
  var E = Object.getOwnPropertyDescriptor(b, "key").get;
303
303
  if (E && E.isReactWarning) return !1;
304
304
  }
@@ -306,7 +306,7 @@ function qf() {
306
306
  }
307
307
  function f(b, E) {
308
308
  function T() {
309
- Ti || (Ti = !0, console.error(
309
+ Ei || (Ei = !0, console.error(
310
310
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
311
311
  E
312
312
  ));
@@ -318,7 +318,7 @@ function qf() {
318
318
  }
319
319
  function d() {
320
320
  var b = n(this.type);
321
- return Ai[b] || (Ai[b] = !0, console.error(
321
+ return Ti[b] || (Ti[b] = !0, console.error(
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
  }
@@ -364,12 +364,12 @@ function qf() {
364
364
  W,
365
365
  j
366
366
  );
367
- if (Si.call(E, "key")) {
367
+ if (xi.call(E, "key")) {
368
368
  j = n(b);
369
369
  var Ze = Object.keys(E).filter(function(he) {
370
370
  return he !== "key";
371
371
  });
372
- W = 0 < Ze.length ? "{key: someKey, " + Ze.join(": ..., ") + ": ...}" : "{key: someKey}", Ri[j + W] || (Ze = 0 < Ze.length ? "{" + Ze.join(": ..., ") + ": ...}" : "{}", console.error(
372
+ W = 0 < Ze.length ? "{key: someKey, " + Ze.join(": ..., ") + ": ...}" : "{key: someKey}", Ai[j + W] || (Ze = 0 < Ze.length ? "{" + Ze.join(": ..., ") + ": ...}" : "{}", console.error(
373
373
  `A props object containing a "key" prop is being spread into JSX:
374
374
  let props = %s;
375
375
  <%s {...props} />
@@ -380,7 +380,7 @@ React keys must be passed directly to JSX without using spread:
380
380
  j,
381
381
  Ze,
382
382
  j
383
- ), Ri[j + W] = !0);
383
+ ), Ai[j + W] = !0);
384
384
  }
385
385
  if (j = null, T !== void 0 && (t(T), j = "" + T), u(E) && (t(E.key), j = "" + E.key), "key" in E) {
386
386
  T = {};
@@ -410,8 +410,8 @@ React keys must be passed directly to JSX without using spread:
410
410
  return typeof b == "object" && b !== null && b.$$typeof === P;
411
411
  }
412
412
  function x(b, E) {
413
- if (b._store && !b._store.validated && b.key == null && (b._store.validated = 1, E = k(E), !Ii[E])) {
414
- Ii[E] = !0;
413
+ if (b._store && !b._store.validated && b.key == null && (b._store.validated = 1, E = k(E), !Ri[E])) {
414
+ Ri[E] = !0;
415
415
  var T = "";
416
416
  b && b._owner != null && b._owner !== c() && (T = null, typeof b._owner.tag == "number" ? T = n(b._owner.type) : typeof b._owner.name == "string" && (T = b._owner.name), T = " It was passed a child from " + T + ".");
417
417
  var W = zt.getCurrentStack;
@@ -433,9 +433,9 @@ Check the render method of \`` + T + "`."), E || (b = n(b)) && (E = `
433
433
 
434
434
  Check the top-level render call using <` + b + ">."), E;
435
435
  }
436
- var M = A, P = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), L = Symbol.for("react.context"), ee = 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, gr = Symbol.for("react.client.reference"), zt = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Si = Object.prototype.hasOwnProperty, jt = Object.assign, Tf = Symbol.for("react.client.reference"), Ss = Array.isArray, An = 0, ki, Ci, wi, Mi, Ni, Di, Oi;
436
+ var M = A, P = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), L = Symbol.for("react.context"), ee = 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, gr = Symbol.for("react.client.reference"), zt = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, xi = Object.prototype.hasOwnProperty, jt = Object.assign, Tf = Symbol.for("react.client.reference"), Ss = Array.isArray, An = 0, Si, ki, Ci, wi, Mi, Ni, Di;
437
437
  r.__reactDisabledLog = !0;
438
- var ks, Ei, Cs = !1, ws = new (typeof WeakMap == "function" ? WeakMap : Map)(), Af = Symbol.for("react.client.reference"), Ti, Ai = {}, Ri = {}, Ii = {};
438
+ var ks, Oi, Cs = !1, ws = new (typeof WeakMap == "function" ? WeakMap : Map)(), Af = Symbol.for("react.client.reference"), Ei, Ti = {}, Ai = {}, Ri = {};
439
439
  Pn.Fragment = R, Pn.jsx = function(b, E, T, W, le) {
440
440
  return p(b, E, T, !1, W, le);
441
441
  }, Pn.jsxs = function(b, E, T, W, le) {
@@ -545,7 +545,7 @@ te.from = function(n) {
545
545
  if (n) for (var t in n) e.push(t, n[t]);
546
546
  return new te(e);
547
547
  };
548
- function ja(n, e, t) {
548
+ function za(n, e, t) {
549
549
  for (let r = 0; ; r++) {
550
550
  if (r == n.childCount || r == e.childCount)
551
551
  return n.childCount == e.childCount ? null : t;
@@ -562,14 +562,14 @@ function ja(n, e, t) {
562
562
  return t;
563
563
  }
564
564
  if (s.content.size || o.content.size) {
565
- let i = ja(s.content, o.content, t + 1);
565
+ let i = za(s.content, o.content, t + 1);
566
566
  if (i != null)
567
567
  return i;
568
568
  }
569
569
  t += s.nodeSize;
570
570
  }
571
571
  }
572
- function Fa(n, e, t, r) {
572
+ function ja(n, e, t, r) {
573
573
  for (let s = n.childCount, o = e.childCount; ; ) {
574
574
  if (s == 0 || o == 0)
575
575
  return s == o ? null : { a: t, b: r };
@@ -587,7 +587,7 @@ function Fa(n, e, t, r) {
587
587
  return { a: t, b: r };
588
588
  }
589
589
  if (i.content.size || l.content.size) {
590
- let c = Fa(i.content, l.content, t - 1, r - 1);
590
+ let c = ja(i.content, l.content, t - 1, r - 1);
591
591
  if (c)
592
592
  return c;
593
593
  }
@@ -756,7 +756,7 @@ class S {
756
756
  fragment differ, or `null` if they are the same.
757
757
  */
758
758
  findDiffStart(e, t = 0) {
759
- return ja(this, e, t);
759
+ return za(this, e, t);
760
760
  }
761
761
  /**
762
762
  Find the first position, searching from the end, at which this
@@ -765,7 +765,7 @@ class S {
765
765
  nodes, an object with two separate positions is returned.
766
766
  */
767
767
  findDiffEnd(e, t = this.size, r = e.size) {
768
- return Fa(this, e, t, r);
768
+ return ja(this, e, t, r);
769
769
  }
770
770
  /**
771
771
  Find the index and inner offset corresponding to a given relative
@@ -1009,14 +1009,14 @@ class C {
1009
1009
  @internal
1010
1010
  */
1011
1011
  insertAt(e, t) {
1012
- let r = La(this.content, e + this.openStart, t);
1012
+ let r = Ba(this.content, e + this.openStart, t);
1013
1013
  return r && new C(r, this.openStart, this.openEnd);
1014
1014
  }
1015
1015
  /**
1016
1016
  @internal
1017
1017
  */
1018
1018
  removeBetween(e, t) {
1019
- return new C(Ba(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
1019
+ return new C(Fa(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
1020
1020
  }
1021
1021
  /**
1022
1022
  Tests whether this slice is equal to another slice.
@@ -1064,7 +1064,7 @@ class C {
1064
1064
  }
1065
1065
  }
1066
1066
  C.empty = new C(S.empty, 0, 0);
1067
- function Ba(n, e, t) {
1067
+ function Fa(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) {
1070
1070
  if (l != t && !n.child(i).isText)
@@ -1073,13 +1073,13 @@ function Ba(n, e, t) {
1073
1073
  }
1074
1074
  if (r != i)
1075
1075
  throw new RangeError("Removing non-flat range");
1076
- return n.replaceChild(r, o.copy(Ba(o.content, e - s - 1, t - s - 1)));
1076
+ return n.replaceChild(r, o.copy(Fa(o.content, e - s - 1, t - s - 1)));
1077
1077
  }
1078
- function La(n, e, t, r) {
1078
+ function Ba(n, e, t, r) {
1079
1079
  let { index: s, offset: o } = n.findIndex(e), i = n.maybeChild(s);
1080
1080
  if (o == e || i.isText)
1081
1081
  return n.cut(0, e).append(t).append(n.cut(e));
1082
- let l = La(i.content, e - o - 1, t);
1082
+ let l = Ba(i.content, e - o - 1, t);
1083
1083
  return l && n.replaceChild(s, i.copy(l));
1084
1084
  }
1085
1085
  function Hf(n, e, t) {
@@ -1087,12 +1087,12 @@ function Hf(n, e, t) {
1087
1087
  throw new $r("Inserted content deeper than insertion position");
1088
1088
  if (n.depth - t.openStart != e.depth - t.openEnd)
1089
1089
  throw new $r("Inconsistent open depths");
1090
- return Wa(n, e, t, 0);
1090
+ return La(n, e, t, 0);
1091
1091
  }
1092
- function Wa(n, e, t, r) {
1092
+ function La(n, e, t, r) {
1093
1093
  let s = n.index(r), o = n.node(r);
1094
1094
  if (s == e.index(r) && r < n.depth - t.openStart) {
1095
- let i = Wa(n, e, t, r + 1);
1095
+ let i = La(n, e, t, r + 1);
1096
1096
  return o.copy(o.content.replaceChild(s, i));
1097
1097
  } else if (t.content.size)
1098
1098
  if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
@@ -1100,17 +1100,17 @@ function Wa(n, e, t, r) {
1100
1100
  return Ht(i, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
1101
1101
  } else {
1102
1102
  let { start: i, end: l } = Jf(t, n);
1103
- return Ht(o, qa(n, i, l, e, r));
1103
+ return Ht(o, _a(n, i, l, e, r));
1104
1104
  }
1105
1105
  else return Ht(o, zr(n, e, r));
1106
1106
  }
1107
- function _a(n, e) {
1107
+ function Wa(n, e) {
1108
1108
  if (!e.type.compatibleContent(n.type))
1109
1109
  throw new $r("Cannot join " + e.type.name + " onto " + n.type.name);
1110
1110
  }
1111
1111
  function to(n, e, t) {
1112
1112
  let r = n.node(t);
1113
- return _a(r, e.node(t)), r;
1113
+ return Wa(r, e.node(t)), r;
1114
1114
  }
1115
1115
  function qt(n, e) {
1116
1116
  let t = e.length - 1;
@@ -1126,9 +1126,9 @@ function Bn(n, e, t, r) {
1126
1126
  function Ht(n, e) {
1127
1127
  return n.type.checkContent(e), n.copy(e);
1128
1128
  }
1129
- function qa(n, e, t, r, s) {
1129
+ function _a(n, e, t, r, s) {
1130
1130
  let o = n.depth > s && to(n, e, s + 1), i = r.depth > s && to(t, r, s + 1), l = [];
1131
- return Bn(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, zr(n, e, s + 1)), l), Bn(e, t, s, l), i && qt(Ht(i, zr(t, r, s + 1)), l)), Bn(r, null, s, l), new S(l);
1131
+ return Bn(null, n, s, l), o && i && e.index(s) == t.index(s) ? (Wa(o, i), qt(Ht(o, _a(n, e, t, r, s + 1)), l)) : (o && qt(Ht(o, zr(n, e, s + 1)), l), Bn(e, t, s, l), i && qt(Ht(i, zr(t, r, s + 1)), l)), Bn(r, null, s, l), new S(l);
1132
1132
  }
1133
1133
  function zr(n, e, t) {
1134
1134
  let r = [];
@@ -1381,7 +1381,7 @@ class Jn {
1381
1381
  @internal
1382
1382
  */
1383
1383
  static resolveCached(e, t) {
1384
- let r = $i.get(e);
1384
+ let r = Vi.get(e);
1385
1385
  if (r)
1386
1386
  for (let o = 0; o < r.elts.length; o++) {
1387
1387
  let i = r.elts[o];
@@ -1389,7 +1389,7 @@ class Jn {
1389
1389
  return i;
1390
1390
  }
1391
1391
  else
1392
- $i.set(e, r = new Kf());
1392
+ Vi.set(e, r = new Kf());
1393
1393
  let s = r.elts[r.i] = Jn.resolve(e, t);
1394
1394
  return r.i = (r.i + 1) % Uf, s;
1395
1395
  }
@@ -1399,7 +1399,7 @@ class Kf {
1399
1399
  this.elts = [], this.i = 0;
1400
1400
  }
1401
1401
  }
1402
- const Uf = 12, $i = /* @__PURE__ */ new WeakMap();
1402
+ const Uf = 12, Vi = /* @__PURE__ */ new WeakMap();
1403
1403
  class jr {
1404
1404
  /**
1405
1405
  Construct a node range. `$from` and `$to` should point into the
@@ -1717,7 +1717,7 @@ class Ne {
1717
1717
  if (this.type.spec.toDebugString)
1718
1718
  return this.type.spec.toDebugString(this);
1719
1719
  let e = this.type.name;
1720
- return this.content.size && (e += "(" + this.content.toStringInner() + ")"), Ha(this.marks, e);
1720
+ return this.content.size && (e += "(" + this.content.toStringInner() + ")"), qa(this.marks, e);
1721
1721
  }
1722
1722
  /**
1723
1723
  Get the content match in this node at the given index.
@@ -1821,7 +1821,7 @@ class Fr extends Ne {
1821
1821
  this.text = r;
1822
1822
  }
1823
1823
  toString() {
1824
- return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : Ha(this.marks, JSON.stringify(this.text));
1824
+ return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : qa(this.marks, JSON.stringify(this.text));
1825
1825
  }
1826
1826
  get textContent() {
1827
1827
  return this.text;
@@ -1849,7 +1849,7 @@ class Fr extends Ne {
1849
1849
  return e.text = this.text, e;
1850
1850
  }
1851
1851
  }
1852
- function Ha(n, e) {
1852
+ function qa(n, e) {
1853
1853
  for (let t = n.length - 1; t >= 0; t--)
1854
1854
  e = n[t].type.name + "(" + e + ")";
1855
1855
  return e;
@@ -1868,7 +1868,7 @@ class Gt {
1868
1868
  let r = new Gf(e, t);
1869
1869
  if (r.next == null)
1870
1870
  return Gt.empty;
1871
- let s = Ja(r);
1871
+ let s = Ha(r);
1872
1872
  r.next && r.err("Unexpected trailing text");
1873
1873
  let o = rd(nd(s));
1874
1874
  return sd(o, r), o;
@@ -2031,7 +2031,7 @@ class Gf {
2031
2031
  throw new SyntaxError(e + " (in content expression '" + this.string + "')");
2032
2032
  }
2033
2033
  }
2034
- function Ja(n) {
2034
+ function Ha(n) {
2035
2035
  let e = [];
2036
2036
  do
2037
2037
  e.push(Xf(n));
@@ -2060,14 +2060,14 @@ function Qf(n) {
2060
2060
  break;
2061
2061
  return e;
2062
2062
  }
2063
- function zi(n) {
2063
+ function $i(n) {
2064
2064
  /\D/.test(n.next) && n.err("Expected number, got '" + n.next + "'");
2065
2065
  let e = Number(n.next);
2066
2066
  return n.pos++, e;
2067
2067
  }
2068
2068
  function Zf(n, e) {
2069
- let t = zi(n), r = t;
2070
- return n.eat(",") && (n.next != "}" ? r = zi(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
2069
+ let t = $i(n), r = t;
2070
+ return n.eat(",") && (n.next != "}" ? r = $i(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
2071
2071
  }
2072
2072
  function ed(n, e) {
2073
2073
  let t = n.nodeTypes, r = t[e];
@@ -2082,7 +2082,7 @@ function ed(n, e) {
2082
2082
  }
2083
2083
  function td(n) {
2084
2084
  if (n.eat("(")) {
2085
- let e = Ja(n);
2085
+ let e = Ha(n);
2086
2086
  return n.eat(")") || n.err("Missing closing paren"), e;
2087
2087
  } else if (/\W/.test(n.next))
2088
2088
  n.err("Unexpected token '" + n.next + "'");
@@ -2145,12 +2145,12 @@ function nd(n) {
2145
2145
  }
2146
2146
  }
2147
2147
  }
2148
- function Ka(n, e) {
2148
+ function Ja(n, e) {
2149
2149
  return e - n;
2150
2150
  }
2151
- function ji(n, e) {
2151
+ function zi(n, e) {
2152
2152
  let t = [];
2153
- return r(e), t.sort(Ka);
2153
+ return r(e), t.sort(Ja);
2154
2154
  function r(s) {
2155
2155
  let o = n[s];
2156
2156
  if (o.length == 1 && !o[0].term)
@@ -2164,7 +2164,7 @@ function ji(n, e) {
2164
2164
  }
2165
2165
  function rd(n) {
2166
2166
  let e = /* @__PURE__ */ Object.create(null);
2167
- return t(ji(n, 0));
2167
+ return t(zi(n, 0));
2168
2168
  function t(r) {
2169
2169
  let s = [];
2170
2170
  r.forEach((i) => {
@@ -2174,14 +2174,14 @@ function rd(n) {
2174
2174
  let c;
2175
2175
  for (let u = 0; u < s.length; u++)
2176
2176
  s[u][0] == l && (c = s[u][1]);
2177
- ji(n, a).forEach((u) => {
2177
+ zi(n, a).forEach((u) => {
2178
2178
  c || s.push([l, c = []]), c.indexOf(u) == -1 && c.push(u);
2179
2179
  });
2180
2180
  });
2181
2181
  });
2182
2182
  let o = e[r.join(",")] = new Gt(r.indexOf(n.length - 1) > -1);
2183
2183
  for (let i = 0; i < s.length; i++) {
2184
- let l = s[i][1].sort(Ka);
2184
+ let l = s[i][1].sort(Ja);
2185
2185
  o.next.push({ type: s[i][0], next: e[l.join(",")] || t(l) });
2186
2186
  }
2187
2187
  return o;
@@ -2197,7 +2197,7 @@ function sd(n, e) {
2197
2197
  o && e.err("Only non-generatable nodes (" + i.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
2198
2198
  }
2199
2199
  }
2200
- function Ua(n) {
2200
+ function Ka(n) {
2201
2201
  let e = /* @__PURE__ */ Object.create(null);
2202
2202
  for (let t in n) {
2203
2203
  let r = n[t];
@@ -2207,7 +2207,7 @@ function Ua(n) {
2207
2207
  }
2208
2208
  return e;
2209
2209
  }
2210
- function Ya(n, e) {
2210
+ function Ua(n, e) {
2211
2211
  let t = /* @__PURE__ */ Object.create(null);
2212
2212
  for (let r in n) {
2213
2213
  let s = e && e[r];
@@ -2222,7 +2222,7 @@ function Ya(n, e) {
2222
2222
  }
2223
2223
  return t;
2224
2224
  }
2225
- function Ga(n, e, t, r) {
2225
+ function Ya(n, e, t, r) {
2226
2226
  for (let s in e)
2227
2227
  if (!(s in n))
2228
2228
  throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);
@@ -2231,19 +2231,19 @@ function Ga(n, e, t, r) {
2231
2231
  o.validate && o.validate(e[s]);
2232
2232
  }
2233
2233
  }
2234
- function Xa(n, e) {
2234
+ function Ga(n, e) {
2235
2235
  let t = /* @__PURE__ */ Object.create(null);
2236
2236
  if (e)
2237
2237
  for (let r in e)
2238
2238
  t[r] = new id(n, r, e[r]);
2239
2239
  return t;
2240
2240
  }
2241
- let Fi = class Qa {
2241
+ let ji = class Xa {
2242
2242
  /**
2243
2243
  @internal
2244
2244
  */
2245
2245
  constructor(e, t, r) {
2246
- this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Xa(e, r.attrs), this.defaultAttrs = Ua(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
2246
+ this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Ga(e, r.attrs), this.defaultAttrs = Ka(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
2247
2247
  }
2248
2248
  /**
2249
2249
  True if this is an inline type.
@@ -2304,7 +2304,7 @@ let Fi = class Qa {
2304
2304
  @internal
2305
2305
  */
2306
2306
  computeAttrs(e) {
2307
- return !e && this.defaultAttrs ? this.defaultAttrs : Ya(this.attrs, e);
2307
+ return !e && this.defaultAttrs ? this.defaultAttrs : Ua(this.attrs, e);
2308
2308
  }
2309
2309
  /**
2310
2310
  Create a `Node` of this type. The given attributes are
@@ -2371,7 +2371,7 @@ let Fi = class Qa {
2371
2371
  @internal
2372
2372
  */
2373
2373
  checkAttrs(e) {
2374
- Ga(this.attrs, e, "node", this.name);
2374
+ Ya(this.attrs, e, "node", this.name);
2375
2375
  }
2376
2376
  /**
2377
2377
  Check whether the given mark type is allowed in this node.
@@ -2406,7 +2406,7 @@ let Fi = class Qa {
2406
2406
  */
2407
2407
  static compile(e, t) {
2408
2408
  let r = /* @__PURE__ */ Object.create(null);
2409
- e.forEach((o, i) => r[o] = new Qa(o, t, i));
2409
+ e.forEach((o, i) => r[o] = new Xa(o, t, i));
2410
2410
  let s = t.spec.topNode || "doc";
2411
2411
  if (!r[s])
2412
2412
  throw new RangeError("Schema is missing its top node type ('" + s + "')");
@@ -2438,8 +2438,8 @@ class is {
2438
2438
  @internal
2439
2439
  */
2440
2440
  constructor(e, t, r, s) {
2441
- this.name = e, this.rank = t, this.schema = r, this.spec = s, this.attrs = Xa(e, s.attrs), this.excluded = null;
2442
- let o = Ua(this.attrs);
2441
+ this.name = e, this.rank = t, this.schema = r, this.spec = s, this.attrs = Ga(e, s.attrs), this.excluded = null;
2442
+ let o = Ka(this.attrs);
2443
2443
  this.instance = o ? new _(this, o) : null;
2444
2444
  }
2445
2445
  /**
@@ -2448,7 +2448,7 @@ class is {
2448
2448
  they have defaults, will be added.
2449
2449
  */
2450
2450
  create(e = null) {
2451
- return !e && this.instance ? this.instance : new _(this, Ya(this.attrs, e));
2451
+ return !e && this.instance ? this.instance : new _(this, Ua(this.attrs, e));
2452
2452
  }
2453
2453
  /**
2454
2454
  @internal
@@ -2478,7 +2478,7 @@ class is {
2478
2478
  @internal
2479
2479
  */
2480
2480
  checkAttrs(e) {
2481
- Ga(this.attrs, e, "mark", this.name);
2481
+ Ya(this.attrs, e, "mark", this.name);
2482
2482
  }
2483
2483
  /**
2484
2484
  Queries whether a given mark type is
@@ -2497,7 +2497,7 @@ class ls {
2497
2497
  let t = this.spec = {};
2498
2498
  for (let s in e)
2499
2499
  t[s] = e[s];
2500
- t.nodes = te.from(e.nodes), t.marks = te.from(e.marks || {}), this.nodes = Fi.compile(this.spec.nodes, this), this.marks = is.compile(this.spec.marks, this);
2500
+ t.nodes = te.from(e.nodes), t.marks = te.from(e.marks || {}), this.nodes = ji.compile(this.spec.nodes, this), this.marks = is.compile(this.spec.marks, this);
2501
2501
  let r = /* @__PURE__ */ Object.create(null);
2502
2502
  for (let s in this.nodes) {
2503
2503
  if (s in this.marks)
@@ -2510,11 +2510,11 @@ class ls {
2510
2510
  throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
2511
2511
  this.linebreakReplacement = o;
2512
2512
  }
2513
- o.markSet = l == "_" ? null : l ? Bi(this, l.split(" ")) : l == "" || !o.inlineContent ? [] : null;
2513
+ o.markSet = l == "_" ? null : l ? Fi(this, l.split(" ")) : l == "" || !o.inlineContent ? [] : null;
2514
2514
  }
2515
2515
  for (let s in this.marks) {
2516
2516
  let o = this.marks[s], i = o.spec.excludes;
2517
- o.excluded = i == null ? [o] : i == "" ? [] : Bi(this, i.split(" "));
2517
+ o.excluded = i == null ? [o] : i == "" ? [] : Fi(this, i.split(" "));
2518
2518
  }
2519
2519
  this.nodeFromJSON = this.nodeFromJSON.bind(this), this.markFromJSON = this.markFromJSON.bind(this), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
2520
2520
  }
@@ -2527,7 +2527,7 @@ class ls {
2527
2527
  node(e, t = null, r, s) {
2528
2528
  if (typeof e == "string")
2529
2529
  e = this.nodeType(e);
2530
- else if (e instanceof Fi) {
2530
+ else if (e instanceof ji) {
2531
2531
  if (e.schema != this)
2532
2532
  throw new RangeError("Node type from different schema used (" + e.name + ")");
2533
2533
  } else throw new RangeError("Invalid node type: " + e);
@@ -2571,7 +2571,7 @@ class ls {
2571
2571
  return t;
2572
2572
  }
2573
2573
  }
2574
- function Bi(n, e) {
2574
+ function Fi(n, e) {
2575
2575
  let t = [];
2576
2576
  for (let r = 0; r < e.length; r++) {
2577
2577
  let s = e[r], o = n.marks[s], i = o;
@@ -2619,7 +2619,7 @@ class Xt {
2619
2619
  Parse a document from the content of a DOM node.
2620
2620
  */
2621
2621
  parse(e, t = {}) {
2622
- let r = new Wi(this, t, !1);
2622
+ let r = new Li(this, t, !1);
2623
2623
  return r.addAll(e, _.none, t.from, t.to), r.finish();
2624
2624
  }
2625
2625
  /**
@@ -2631,7 +2631,7 @@ class Xt {
2631
2631
  the left of the input and the end of nodes at the end.
2632
2632
  */
2633
2633
  parseSlice(e, t = {}) {
2634
- let r = new Wi(this, t, !0);
2634
+ let r = new Li(this, t, !0);
2635
2635
  return r.addAll(e, _.none, t.from, t.to), C.maxOpen(r.finish());
2636
2636
  }
2637
2637
  /**
@@ -2688,13 +2688,13 @@ class Xt {
2688
2688
  for (let s in e.marks) {
2689
2689
  let o = e.marks[s].spec.parseDOM;
2690
2690
  o && o.forEach((i) => {
2691
- r(i = _i(i)), i.mark || i.ignore || i.clearMark || (i.mark = s);
2691
+ r(i = Wi(i)), i.mark || i.ignore || i.clearMark || (i.mark = s);
2692
2692
  });
2693
2693
  }
2694
2694
  for (let s in e.nodes) {
2695
2695
  let o = e.nodes[s].spec.parseDOM;
2696
2696
  o && o.forEach((i) => {
2697
- r(i = _i(i)), i.node || i.ignore || i.mark || (i.node = s);
2697
+ r(i = Wi(i)), i.node || i.ignore || i.mark || (i.node = s);
2698
2698
  });
2699
2699
  }
2700
2700
  return t;
@@ -2708,7 +2708,7 @@ class Xt {
2708
2708
  return e.cached.domParser || (e.cached.domParser = new Xt(e, Xt.schemaRules(e)));
2709
2709
  }
2710
2710
  }
2711
- const Za = {
2711
+ const Qa = {
2712
2712
  address: !0,
2713
2713
  article: !0,
2714
2714
  aside: !0,
@@ -2748,8 +2748,8 @@ const Za = {
2748
2748
  script: !0,
2749
2749
  style: !0,
2750
2750
  title: !0
2751
- }, ec = { ol: !0, ul: !0 }, Kn = 1, no = 2, Or = 4;
2752
- function Li(n, e, t) {
2751
+ }, Za = { ol: !0, ul: !0 }, Kn = 1, no = 2, Or = 4;
2752
+ function Bi(n, e, t) {
2753
2753
  return e != null ? (e ? Kn : 0) | (e === "full" ? no : 0) : n && n.whitespace == "pre" ? Kn | no : t & -5;
2754
2754
  }
2755
2755
  class xr {
@@ -2782,13 +2782,13 @@ class xr {
2782
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
- return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Za.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
2785
+ return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Qa.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
2786
2786
  }
2787
2787
  }
2788
- class Wi {
2788
+ class Li {
2789
2789
  constructor(e, t, r) {
2790
2790
  this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
2791
- let s = t.topNode, o, i = Li(null, t.preserveWhitespace, 0) | (r ? Or : 0);
2791
+ let s = t.topNode, o, i = Bi(null, t.preserveWhitespace, 0) | (r ? Or : 0);
2792
2792
  s ? o = new xr(s.type, s.attrs, _.none, !0, t.topMatch || s.type.contentMatch, i) : r ? o = new xr(null, null, _.none, !0, null, i) : o = new xr(e.schema.topNodeType, null, _.none, !0, null, i), this.nodes = [o], this.find = t.findPositions, this.needsBlock = !1;
2793
2793
  }
2794
2794
  get top() {
@@ -2820,14 +2820,14 @@ class Wi {
2820
2820
  let s = this.localPreserveWS, o = this.top;
2821
2821
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
2822
2822
  let i = e.nodeName.toLowerCase(), l;
2823
- ec.hasOwnProperty(i) && this.parser.normalizeLists && ud(e);
2823
+ Za.hasOwnProperty(i) && this.parser.normalizeLists && ud(e);
2824
2824
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
2825
2825
  e: if (a ? a.ignore : cd.hasOwnProperty(i))
2826
2826
  this.findInside(e), this.ignoreFallback(e, t);
2827
2827
  else if (!a || a.skip || a.closeParent) {
2828
2828
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
2829
2829
  let c, u = this.needsBlock;
2830
- if (Za.hasOwnProperty(i))
2830
+ if (Qa.hasOwnProperty(i))
2831
2831
  o.content.length && o.content[0].isInline && this.open && (this.open--, o = this.top), c = !0, o.type || (this.needsBlock = !0);
2832
2832
  else if (!e.firstChild) {
2833
2833
  this.leafFallback(e, t);
@@ -2946,7 +2946,7 @@ class Wi {
2946
2946
  o.match && (o.match = o.match.matchType(e.type));
2947
2947
  let i = _.none;
2948
2948
  for (let l of s.concat(e.marks))
2949
- (o.type ? o.type.allowsMarkType(l.type) : qi(l.type, e.type)) && (i = l.addToSet(i));
2949
+ (o.type ? o.type.allowsMarkType(l.type) : _i(l.type, e.type)) && (i = l.addToSet(i));
2950
2950
  return o.content.push(e.mark(i)), !0;
2951
2951
  }
2952
2952
  return !1;
@@ -2962,10 +2962,10 @@ class Wi {
2962
2962
  this.closeExtra();
2963
2963
  let i = this.top;
2964
2964
  i.match = i.match && i.match.matchType(e);
2965
- let l = Li(e, o, i.options);
2965
+ let l = Bi(e, o, i.options);
2966
2966
  i.options & Or && i.content.length == 0 && (l |= Or);
2967
2967
  let a = _.none;
2968
- return r = r.filter((c) => (i.type ? i.type.allowsMarkType(c.type) : qi(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new xr(e, t, a, s, null, l)), this.open++, r;
2968
+ return r = r.filter((c) => (i.type ? i.type.allowsMarkType(c.type) : _i(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new xr(e, t, a, s, null, l)), this.open++, r;
2969
2969
  }
2970
2970
  // Make sure all nodes above this.open are finished and added to
2971
2971
  // their parents
@@ -3062,19 +3062,19 @@ class Wi {
3062
3062
  function ud(n) {
3063
3063
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3064
3064
  let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3065
- r && ec.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
3065
+ r && Za.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
3066
3066
  }
3067
3067
  }
3068
3068
  function fd(n, e) {
3069
3069
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3070
3070
  }
3071
- function _i(n) {
3071
+ function Wi(n) {
3072
3072
  let e = {};
3073
3073
  for (let t in n)
3074
3074
  e[t] = n[t];
3075
3075
  return e;
3076
3076
  }
3077
- function qi(n, e) {
3077
+ function _i(n, e) {
3078
3078
  let t = e.schema.nodes;
3079
3079
  for (let r in t) {
3080
3080
  let s = t[r];
@@ -3186,17 +3186,17 @@ class Xe {
3186
3186
  This can be useful as a base to build a custom serializer from.
3187
3187
  */
3188
3188
  static nodesFromSchema(e) {
3189
- let t = Hi(e.nodes);
3189
+ let t = qi(e.nodes);
3190
3190
  return t.text || (t.text = (r) => r.text), t;
3191
3191
  }
3192
3192
  /**
3193
3193
  Gather the serializers in a schema's mark specs into an object.
3194
3194
  */
3195
3195
  static marksFromSchema(e) {
3196
- return Hi(e.marks);
3196
+ return qi(e.marks);
3197
3197
  }
3198
3198
  }
3199
- function Hi(n) {
3199
+ function qi(n) {
3200
3200
  let e = {};
3201
3201
  for (let t in n) {
3202
3202
  let r = n[t].spec.toDOM;
@@ -3207,10 +3207,10 @@ function Hi(n) {
3207
3207
  function Ns(n) {
3208
3208
  return n.document || window.document;
3209
3209
  }
3210
- const Ji = /* @__PURE__ */ new WeakMap();
3210
+ const Hi = /* @__PURE__ */ new WeakMap();
3211
3211
  function dd(n) {
3212
- let e = Ji.get(n);
3213
- return e === void 0 && Ji.set(n, e = hd(n)), e;
3212
+ let e = Hi.get(n);
3213
+ return e === void 0 && Hi.set(n, e = hd(n)), e;
3214
3214
  }
3215
3215
  function hd(n) {
3216
3216
  let e = null;
@@ -3268,17 +3268,17 @@ function Er(n, e, t, r) {
3268
3268
  }
3269
3269
  return { dom: a, contentDOM: l };
3270
3270
  }
3271
- const tc = 65535, nc = Math.pow(2, 16);
3271
+ const ec = 65535, tc = Math.pow(2, 16);
3272
3272
  function pd(n, e) {
3273
- return n + e * nc;
3273
+ return n + e * tc;
3274
3274
  }
3275
- function Ki(n) {
3276
- return n & tc;
3275
+ function Ji(n) {
3276
+ return n & ec;
3277
3277
  }
3278
3278
  function md(n) {
3279
- return (n - (n & tc)) / nc;
3279
+ return (n - (n & ec)) / tc;
3280
3280
  }
3281
- const rc = 1, sc = 2, Tr = 4, oc = 8;
3281
+ const nc = 1, rc = 2, Tr = 4, sc = 8;
3282
3282
  class ro {
3283
3283
  /**
3284
3284
  @internal
@@ -3292,19 +3292,19 @@ class ro {
3292
3292
  argument from the document.
3293
3293
  */
3294
3294
  get deleted() {
3295
- return (this.delInfo & oc) > 0;
3295
+ return (this.delInfo & sc) > 0;
3296
3296
  }
3297
3297
  /**
3298
3298
  Tells you whether the token before the mapped position was deleted.
3299
3299
  */
3300
3300
  get deletedBefore() {
3301
- return (this.delInfo & (rc | Tr)) > 0;
3301
+ return (this.delInfo & (nc | Tr)) > 0;
3302
3302
  }
3303
3303
  /**
3304
3304
  True when the token after the mapped position was deleted.
3305
3305
  */
3306
3306
  get deletedAfter() {
3307
- return (this.delInfo & (sc | Tr)) > 0;
3307
+ return (this.delInfo & (rc | Tr)) > 0;
3308
3308
  }
3309
3309
  /**
3310
3310
  Tells whether any of the steps mapped through deletes across the
@@ -3329,7 +3329,7 @@ class we {
3329
3329
  @internal
3330
3330
  */
3331
3331
  recover(e) {
3332
- let t = 0, r = Ki(e);
3332
+ let t = 0, r = Ji(e);
3333
3333
  if (!this.inverted)
3334
3334
  for (let s = 0; s < r; s++)
3335
3335
  t += this.ranges[s * 3 + 2] - this.ranges[s * 3 + 1];
@@ -3355,8 +3355,8 @@ class we {
3355
3355
  let d = c ? e == a ? -1 : e == f ? 1 : t : t, h = a + s + (d < 0 ? 0 : u);
3356
3356
  if (r)
3357
3357
  return h;
3358
- let p = e == (t < 0 ? a : f) ? null : pd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Tr;
3359
- return (t < 0 ? e != a : e != f) && (y |= oc), new ro(h, y, p);
3358
+ let p = e == (t < 0 ? a : f) ? null : pd(l / 3, e - a), y = e == a ? rc : e == f ? nc : Tr;
3359
+ return (t < 0 ? e != a : e != f) && (y |= sc), new ro(h, y, p);
3360
3360
  }
3361
3361
  s += u - c;
3362
3362
  }
@@ -3366,7 +3366,7 @@ class we {
3366
3366
  @internal
3367
3367
  */
3368
3368
  touches(e, t) {
3369
- let r = 0, s = Ki(t), o = this.inverted ? 2 : 1, i = this.inverted ? 1 : 2;
3369
+ let r = 0, s = Ji(t), o = this.inverted ? 2 : 1, i = this.inverted ? 1 : 2;
3370
3370
  for (let l = 0; l < this.ranges.length; l += 3) {
3371
3371
  let a = this.ranges[l] - (this.inverted ? r : 0);
3372
3372
  if (a > e)
@@ -3973,9 +3973,9 @@ function xd(n, e, t) {
3973
3973
  }
3974
3974
  function jo(n, e, t = null, r = n) {
3975
3975
  let s = Sd(n, e), o = s && kd(r, e);
3976
- return o ? s.map(Ui).concat({ type: e, attrs: t }).concat(o.map(Ui)) : null;
3976
+ return o ? s.map(Ki).concat({ type: e, attrs: t }).concat(o.map(Ki)) : null;
3977
3977
  }
3978
- function Ui(n) {
3978
+ function Ki(n) {
3979
3979
  return { type: n, attrs: null };
3980
3980
  }
3981
3981
  function Sd(n, e) {
@@ -4019,13 +4019,13 @@ function wd(n, e, t, r, s) {
4019
4019
  let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
4020
4020
  h && !p ? c = !1 : !h && p && (c = !0);
4021
4021
  }
4022
- c === !1 && lc(n, i, l, o), zo(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
4022
+ c === !1 && ic(n, i, l, o), zo(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 C(S.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 C(S.from(r.create(a, null, i.marks)), 0, 0), 1, !0)), c === !0 && oc(n, i, l, o), !1;
4025
4025
  }
4026
4026
  });
4027
4027
  }
4028
- function ic(n, e, t, r) {
4028
+ function oc(n, e, t, r) {
4029
4029
  e.forEach((s, o) => {
4030
4030
  if (s.isText) {
4031
4031
  let i, l = /\r?\n|\r/g;
@@ -4036,7 +4036,7 @@ function ic(n, e, t, r) {
4036
4036
  }
4037
4037
  });
4038
4038
  }
4039
- function lc(n, e, t, r) {
4039
+ function ic(n, e, t, r) {
4040
4040
  e.forEach((s, o) => {
4041
4041
  if (s.type == s.type.schema.linebreakReplacement) {
4042
4042
  let i = n.mapping.slice(r).map(t + 1 + o);
@@ -4089,7 +4089,7 @@ function Dd(n, e, t = 1, r) {
4089
4089
  }
4090
4090
  function En(n, e) {
4091
4091
  let t = n.resolve(e), r = t.index();
4092
- return ac(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
4092
+ return lc(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
4093
4093
  }
4094
4094
  function Od(n, e) {
4095
4095
  e.content.size || n.type.compatibleContent(e.type);
@@ -4101,14 +4101,14 @@ function Od(n, e) {
4101
4101
  }
4102
4102
  return t.validEnd;
4103
4103
  }
4104
- function ac(n, e) {
4104
+ function lc(n, e) {
4105
4105
  return !!(n && e && !n.isLeaf && Od(n, e));
4106
4106
  }
4107
- function cc(n, e, t = -1) {
4107
+ function ac(n, e, t = -1) {
4108
4108
  let r = n.resolve(e);
4109
4109
  for (let s = r.depth; ; s--) {
4110
4110
  let o, i, l = r.index(s);
4111
- if (s == r.depth ? (o = r.nodeBefore, i = r.nodeAfter) : t > 0 ? (o = r.node(s + 1), l++, i = r.node(s).maybeChild(l)) : (o = r.node(s).maybeChild(l - 1), i = r.node(s + 1)), o && !o.isTextblock && ac(o, i) && r.node(s).canReplace(l, l + 1))
4111
+ if (s == r.depth ? (o = r.nodeBefore, i = r.nodeAfter) : t > 0 ? (o = r.node(s + 1), l++, i = r.node(s).maybeChild(l)) : (o = r.node(s).maybeChild(l - 1), i = r.node(s + 1)), o && !o.isTextblock && lc(o, i) && r.node(s).canReplace(l, l + 1))
4112
4112
  return e;
4113
4113
  if (s == 0)
4114
4114
  break;
@@ -4124,13 +4124,13 @@ function Ed(n, e, t) {
4124
4124
  let l = n.steps.length;
4125
4125
  if (r === !1) {
4126
4126
  let u = n.doc.resolve(e + t);
4127
- lc(n, u.node(), u.before(), l);
4127
+ ic(n, u.node(), u.before(), l);
4128
4128
  }
4129
4129
  i.inlineContent && zo(n, e + t - 1, i, o.node().contentMatchAt(o.index()), r == null);
4130
4130
  let a = n.mapping.slice(l), c = a.map(e - t);
4131
4131
  if (n.step(new ce(c, a.map(e + t, -1), C.empty, !0)), r === !0) {
4132
4132
  let u = n.doc.resolve(c);
4133
- ic(n, u.node(), u.before(), n.steps.length);
4133
+ oc(n, u.node(), u.before(), n.steps.length);
4134
4134
  }
4135
4135
  return n;
4136
4136
  }
@@ -4181,9 +4181,9 @@ function Bo(n, e, t = e, r = C.empty) {
4181
4181
  if (e == t && !r.size)
4182
4182
  return null;
4183
4183
  let s = n.resolve(e), o = n.resolve(t);
4184
- return uc(s, o, r) ? new ce(e, t, r) : new Ad(s, o, r).fit();
4184
+ return cc(s, o, r) ? new ce(e, t, r) : new Ad(s, o, r).fit();
4185
4185
  }
4186
- function uc(n, e, t) {
4186
+ function cc(n, e, t) {
4187
4187
  return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
4188
4188
  }
4189
4189
  class Ad {
@@ -4277,7 +4277,7 @@ class Ad {
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 ? h : -1)));
4280
+ c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(uc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
4281
4281
  }
4282
4282
  let p = c == l.childCount;
4283
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();
@@ -4344,11 +4344,11 @@ function Os(n, e) {
4344
4344
  n = n.firstChild.content;
4345
4345
  return n;
4346
4346
  }
4347
- function fc(n, e, t) {
4347
+ function uc(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(S.empty, !0)))), n.copy(r);
4351
+ return e > 1 && (r = r.replaceChild(0, uc(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 Es(n, e, t, r, s) {
4354
4354
  let o = n.node(e), i = s ? n.indexAfter(e) : n.index(e);
@@ -4370,9 +4370,9 @@ function Pd(n, e, t, r) {
4370
4370
  if (!r.size)
4371
4371
  return n.deleteRange(e, t);
4372
4372
  let s = n.doc.resolve(e), o = n.doc.resolve(t);
4373
- if (uc(s, o, r))
4373
+ if (cc(s, o, r))
4374
4374
  return n.step(new ce(e, t, r));
4375
- let i = hc(s, n.doc.resolve(t));
4375
+ let i = dc(s, n.doc.resolve(t));
4376
4376
  i[i.length - 1] == 0 && i.pop();
4377
4377
  let l = -(s.depth + 1);
4378
4378
  i.unshift(l);
@@ -4404,7 +4404,7 @@ function Pd(n, e, t, r) {
4404
4404
  m < 0 && (x = !1, m = -m);
4405
4405
  let k = s.node(m - 1), M = s.index(m - 1);
4406
4406
  if (k.canReplaceWith(M, M, p.type, p.marks))
4407
- return n.replace(s.before(m), x ? o.after(m) : t, new C(dc(r.content, 0, r.openStart, h), h, r.openEnd));
4407
+ return n.replace(s.before(m), x ? o.after(m) : t, new C(fc(r.content, 0, r.openStart, h), h, r.openEnd));
4408
4408
  }
4409
4409
  }
4410
4410
  let f = n.steps.length;
@@ -4413,10 +4413,10 @@ function Pd(n, e, t, r) {
4413
4413
  h < 0 || (e = s.before(h), t = o.after(h));
4414
4414
  }
4415
4415
  }
4416
- function dc(n, e, t, r, s) {
4416
+ function fc(n, e, t, r, s) {
4417
4417
  if (e < t) {
4418
4418
  let o = n.firstChild;
4419
- n = n.replaceChild(0, o.copy(dc(o.content, e + 1, t, r, o)));
4419
+ n = n.replaceChild(0, o.copy(fc(o.content, e + 1, t, r, o)));
4420
4420
  }
4421
4421
  if (e > r) {
4422
4422
  let o = s.contentMatchAt(0), i = o.fillBefore(n).append(n);
@@ -4432,7 +4432,7 @@ function vd(n, e, t, r) {
4432
4432
  n.replaceRange(e, t, new C(S.from(r), 0, 0));
4433
4433
  }
4434
4434
  function Vd(n, e, t) {
4435
- let r = n.doc.resolve(e), s = n.doc.resolve(t), o = hc(r, s);
4435
+ let r = n.doc.resolve(e), s = n.doc.resolve(t), o = dc(r, s);
4436
4436
  for (let i = 0; i < o.length; i++) {
4437
4437
  let l = o[i], a = i == o.length - 1;
4438
4438
  if (a && l == 0 || r.node(l).type.contentMatch.validEnd)
@@ -4445,7 +4445,7 @@ function Vd(n, e, t) {
4445
4445
  return n.delete(r.before(i), t);
4446
4446
  n.delete(e, t);
4447
4447
  }
4448
- function hc(n, e) {
4448
+ function dc(n, e) {
4449
4449
  let t = [], r = Math.min(n.depth, e.depth);
4450
4450
  for (let s = r; s >= 0; s--) {
4451
4451
  let o = n.start(s);
@@ -4536,7 +4536,7 @@ Mn = function n(e) {
4536
4536
  Mn.prototype = Object.create(Error.prototype);
4537
4537
  Mn.prototype.constructor = Mn;
4538
4538
  Mn.prototype.name = "TransformError";
4539
- class pc {
4539
+ class hc {
4540
4540
  /**
4541
4541
  Create a transform that starts with the given document.
4542
4542
  */
@@ -4769,7 +4769,7 @@ class $ {
4769
4769
  `$head`.
4770
4770
  */
4771
4771
  constructor(e, t, r) {
4772
- this.$anchor = e, this.$head = t, this.ranges = r || [new mc(e.min(t), e.max(t))];
4772
+ this.$anchor = e, this.$head = t, this.ranges = r || [new pc(e.min(t), e.max(t))];
4773
4773
  }
4774
4774
  /**
4775
4775
  The selection's anchor, as an unresolved position.
@@ -4834,7 +4834,7 @@ class $ {
4834
4834
  let o = e.steps.length, i = this.ranges;
4835
4835
  for (let l = 0; l < i.length; l++) {
4836
4836
  let { $from: a, $to: c } = i[l], u = e.mapping.slice(o);
4837
- e.replaceRange(u.map(a.pos), u.map(c.pos), l ? C.empty : t), l == 0 && Xi(e, o, (r ? r.isInline : s && s.isTextblock) ? -1 : 1);
4837
+ e.replaceRange(u.map(a.pos), u.map(c.pos), l ? C.empty : t), l == 0 && Gi(e, o, (r ? r.isInline : s && s.isTextblock) ? -1 : 1);
4838
4838
  }
4839
4839
  }
4840
4840
  /**
@@ -4845,7 +4845,7 @@ class $ {
4845
4845
  let r = e.steps.length, s = this.ranges;
4846
4846
  for (let o = 0; o < s.length; o++) {
4847
4847
  let { $from: i, $to: l } = s[o], a = e.mapping.slice(r), c = a.map(i.pos), u = a.map(l.pos);
4848
- o ? e.deleteRange(c, u) : (e.replaceRangeWith(c, u, t), Xi(e, r, t.isInline ? -1 : 1));
4848
+ o ? e.deleteRange(c, u) : (e.replaceRangeWith(c, u, t), Gi(e, r, t.isInline ? -1 : 1));
4849
4849
  }
4850
4850
  }
4851
4851
  /**
@@ -4927,7 +4927,7 @@ class $ {
4927
4927
  }
4928
4928
  }
4929
4929
  $.prototype.visible = !0;
4930
- class mc {
4930
+ class pc {
4931
4931
  /**
4932
4932
  Create a range.
4933
4933
  */
@@ -4935,16 +4935,16 @@ class mc {
4935
4935
  this.$from = e, this.$to = t;
4936
4936
  }
4937
4937
  }
4938
- let Yi = !1;
4939
- function Gi(n) {
4940
- !Yi && !n.parent.inlineContent && (Yi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4938
+ let Ui = !1;
4939
+ function Yi(n) {
4940
+ !Ui && !n.parent.inlineContent && (Ui = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4941
4941
  }
4942
4942
  class V extends $ {
4943
4943
  /**
4944
4944
  Construct a text selection between the given points.
4945
4945
  */
4946
4946
  constructor(e, t = e) {
4947
- Gi(e), Gi(t), super(e, t);
4947
+ Yi(e), Yi(t), super(e, t);
4948
4948
  }
4949
4949
  /**
4950
4950
  Returns a resolved position if this is a cursor selection (an
@@ -5144,7 +5144,7 @@ function dn(n, e, t, r, s, o = !1) {
5144
5144
  }
5145
5145
  return null;
5146
5146
  }
5147
- function Xi(n, e, t) {
5147
+ function Gi(n, e, t) {
5148
5148
  let r = n.steps.length - 1;
5149
5149
  if (r < e)
5150
5150
  return;
@@ -5156,8 +5156,8 @@ function Xi(n, e, t) {
5156
5156
  i == null && (i = u);
5157
5157
  }), n.setSelection($.near(n.doc.resolve(i), t));
5158
5158
  }
5159
- const Qi = 1, Zi = 2, el = 4;
5160
- class zd extends pc {
5159
+ const Xi = 1, Qi = 2, Zi = 4;
5160
+ class zd extends hc {
5161
5161
  /**
5162
5162
  @internal
5163
5163
  */
@@ -5180,19 +5180,19 @@ class zd extends pc {
5180
5180
  setSelection(e) {
5181
5181
  if (e.$from.doc != this.doc)
5182
5182
  throw new RangeError("Selection passed to setSelection must point at the current document");
5183
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Qi) & -3, this.storedMarks = null, this;
5183
+ return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Xi) & -3, this.storedMarks = null, this;
5184
5184
  }
5185
5185
  /**
5186
5186
  Whether the selection was explicitly updated by this transaction.
5187
5187
  */
5188
5188
  get selectionSet() {
5189
- return (this.updated & Qi) > 0;
5189
+ return (this.updated & Xi) > 0;
5190
5190
  }
5191
5191
  /**
5192
5192
  Set the current stored marks.
5193
5193
  */
5194
5194
  setStoredMarks(e) {
5195
- return this.storedMarks = e, this.updated |= Zi, this;
5195
+ return this.storedMarks = e, this.updated |= Qi, this;
5196
5196
  }
5197
5197
  /**
5198
5198
  Make sure the current stored marks or, if that is null, the marks
@@ -5218,7 +5218,7 @@ class zd extends pc {
5218
5218
  Whether the stored marks were explicitly set for this transaction.
5219
5219
  */
5220
5220
  get storedMarksSet() {
5221
- return (this.updated & Zi) > 0;
5221
+ return (this.updated & Qi) > 0;
5222
5222
  }
5223
5223
  /**
5224
5224
  @internal
@@ -5299,21 +5299,21 @@ class zd extends pc {
5299
5299
  when updated to the state produced by this transaction.
5300
5300
  */
5301
5301
  scrollIntoView() {
5302
- return this.updated |= el, this;
5302
+ return this.updated |= Zi, this;
5303
5303
  }
5304
5304
  /**
5305
5305
  True when this transaction has had `scrollIntoView` called on it.
5306
5306
  */
5307
5307
  get scrolledIntoView() {
5308
- return (this.updated & el) > 0;
5308
+ return (this.updated & Zi) > 0;
5309
5309
  }
5310
5310
  }
5311
- function tl(n, e) {
5311
+ function el(n, e) {
5312
5312
  return !e || !n ? n : n.bind(e);
5313
5313
  }
5314
5314
  class zn {
5315
5315
  constructor(e, t, r) {
5316
- this.name = e, this.init = tl(t.init, r), this.apply = tl(t.apply, r);
5316
+ this.name = e, this.init = el(t.init, r), this.apply = el(t.apply, r);
5317
5317
  }
5318
5318
  }
5319
5319
  const jd = [
@@ -5524,10 +5524,10 @@ class ot {
5524
5524
  }), o;
5525
5525
  }
5526
5526
  }
5527
- function gc(n, e, t) {
5527
+ function mc(n, e, t) {
5528
5528
  for (let r in n) {
5529
5529
  let s = n[r];
5530
- s instanceof Function ? s = s.bind(e) : r == "handleDOMEvents" && (s = gc(s, e, {})), t[r] = s;
5530
+ s instanceof Function ? s = s.bind(e) : r == "handleDOMEvents" && (s = mc(s, e, {})), t[r] = s;
5531
5531
  }
5532
5532
  return t;
5533
5533
  }
@@ -5536,7 +5536,7 @@ class ut {
5536
5536
  Create a plugin.
5537
5537
  */
5538
5538
  constructor(e) {
5539
- this.spec = e, this.props = {}, e.props && gc(e.props, this, this.props), this.key = e.key ? e.key.key : yc("plugin");
5539
+ this.spec = e, this.props = {}, e.props && mc(e.props, this, this.props), this.key = e.key ? e.key.key : gc("plugin");
5540
5540
  }
5541
5541
  /**
5542
5542
  Extract the plugin's state field from an editor state.
@@ -5546,7 +5546,7 @@ class ut {
5546
5546
  }
5547
5547
  }
5548
5548
  const Rs = /* @__PURE__ */ Object.create(null);
5549
- function yc(n) {
5549
+ function gc(n) {
5550
5550
  return n in Rs ? n + "$" + ++Rs[n] : (Rs[n] = 0, n + "$");
5551
5551
  }
5552
5552
  class At {
@@ -5554,7 +5554,7 @@ class At {
5554
5554
  Create a plugin key.
5555
5555
  */
5556
5556
  constructor(e = "key") {
5557
- this.key = yc(e);
5557
+ this.key = gc(e);
5558
5558
  }
5559
5559
  /**
5560
5560
  Get the active plugin with this key, if any, from an editor
@@ -5599,9 +5599,9 @@ Z.prototype.map = function(e, t, r) {
5599
5599
  }, t, r), s;
5600
5600
  };
5601
5601
  Z.from = function(e) {
5602
- return e instanceof Z ? e : e && e.length ? new bc(e) : Z.empty;
5602
+ return e instanceof Z ? e : e && e.length ? new yc(e) : Z.empty;
5603
5603
  };
5604
- var bc = /* @__PURE__ */ function(n) {
5604
+ var yc = /* @__PURE__ */ function(n) {
5605
5605
  function e(r) {
5606
5606
  n.call(this), this.values = r;
5607
5607
  }
@@ -5633,7 +5633,7 @@ var bc = /* @__PURE__ */ function(n) {
5633
5633
  return 0;
5634
5634
  }, Object.defineProperties(e.prototype, t), e;
5635
5635
  }(Z);
5636
- Z.empty = new bc([]);
5636
+ Z.empty = new yc([]);
5637
5637
  var Fd = /* @__PURE__ */ function(n) {
5638
5638
  function e(t, r) {
5639
5639
  n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
@@ -5815,9 +5815,9 @@ function _d(n, e, t, r) {
5815
5815
  if (t.steps.length == 0)
5816
5816
  return n;
5817
5817
  if (i && i.getMeta(Dt))
5818
- return i.getMeta(Dt).redo ? new gt(n.done.addTransform(t, void 0, r, Ar(e)), n.undone, nl(t.mapping.maps), n.prevTime, n.prevComposition) : new gt(n.done, n.undone.addTransform(t, void 0, r, Ar(e)), null, n.prevTime, n.prevComposition);
5818
+ return i.getMeta(Dt).redo ? new gt(n.done.addTransform(t, void 0, r, Ar(e)), n.undone, tl(t.mapping.maps), n.prevTime, n.prevComposition) : new gt(n.done, n.undone.addTransform(t, void 0, r, Ar(e)), null, n.prevTime, n.prevComposition);
5819
5819
  if (t.getMeta("addToHistory") !== !1 && !(i && i.getMeta("addToHistory") === !1)) {
5820
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !i && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !qd(t, n.prevRanges)), c = i ? Is(n.prevRanges, t.mapping) : nl(t.mapping.maps);
5820
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !i && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !qd(t, n.prevRanges)), c = i ? Is(n.prevRanges, t.mapping) : tl(t.mapping.maps);
5821
5821
  return new gt(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, Ar(e)), ze.empty, c, t.time, l ?? n.prevComposition);
5822
5822
  } else return (o = t.getMeta("rebased")) ? new gt(n.done.rebased(t, o), n.undone.rebased(t, o), Is(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new gt(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), Is(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
5823
5823
  }
@@ -5832,7 +5832,7 @@ function qd(n, e) {
5832
5832
  r <= e[o + 1] && s >= e[o] && (t = !0);
5833
5833
  }), t;
5834
5834
  }
5835
- function nl(n) {
5835
+ function tl(n) {
5836
5836
  let e = [];
5837
5837
  for (let t = n.length - 1; t >= 0 && e.length == 0; t--)
5838
5838
  n[t].forEach((r, s, o, i) => e.push(o, i));
@@ -5855,11 +5855,11 @@ function Hd(n, e, t) {
5855
5855
  let i = o.selection.resolve(o.transform.doc), l = (t ? n.done : n.undone).addTransform(o.transform, e.selection.getBookmark(), s, r), a = new gt(t ? l : o.remaining, t ? o.remaining : l, null, 0, -1);
5856
5856
  return o.transform.setSelection(i).setMeta(Dt, { redo: t, historyState: a });
5857
5857
  }
5858
- let Ps = !1, rl = null;
5858
+ let Ps = !1, nl = null;
5859
5859
  function Ar(n) {
5860
5860
  let e = n.plugins;
5861
- if (rl != e) {
5862
- Ps = !1, rl = e;
5861
+ if (nl != e) {
5862
+ Ps = !1, nl = e;
5863
5863
  for (let t = 0; t < e.length; t++)
5864
5864
  if (e[t].spec.historyPreserveItems) {
5865
5865
  Ps = !0;
@@ -5894,7 +5894,7 @@ function Kd(n = {}) {
5894
5894
  }
5895
5895
  });
5896
5896
  }
5897
- function xc(n, e) {
5897
+ function bc(n, e) {
5898
5898
  return (t, r) => {
5899
5899
  let s = Dt.getState(t);
5900
5900
  if (!s || (n ? s.undone : s.done).eventCount == 0)
@@ -5906,7 +5906,7 @@ function xc(n, e) {
5906
5906
  return !0;
5907
5907
  };
5908
5908
  }
5909
- const Wo = xc(!1, !0), Lr = xc(!0, !0);
5909
+ const Wo = bc(!1, !0), Lr = bc(!0, !0);
5910
5910
  function _o(n) {
5911
5911
  let e = Dt.getState(n);
5912
5912
  return e ? e.done.eventCount : 0;
@@ -6054,7 +6054,7 @@ function qo(n) {
6054
6054
  return !1;
6055
6055
  };
6056
6056
  }
6057
- const Sc = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
6057
+ const xc = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
6058
6058
  function eh(n, e) {
6059
6059
  let { $cursor: t } = n.selection;
6060
6060
  return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
@@ -6063,13 +6063,13 @@ const th = (n, e, t) => {
6063
6063
  let r = eh(n, t);
6064
6064
  if (!r)
6065
6065
  return !1;
6066
- let s = kc(r);
6066
+ let s = Sc(r);
6067
6067
  if (!s) {
6068
6068
  let i = r.blockRange(), l = i && ar(i);
6069
6069
  return l == null ? !1 : (e && e(n.tr.lift(i, l).scrollIntoView()), !0);
6070
6070
  }
6071
6071
  let o = s.nodeBefore;
6072
- if (Nc(n, s, e, -1))
6072
+ if (Mc(n, s, e, -1))
6073
6073
  return !0;
6074
6074
  if (r.parent.content.size == 0 && (Nn(o, "end") || w.isSelectable(o)))
6075
6075
  for (let i = r.depth; ; i--) {
@@ -6102,12 +6102,12 @@ const nh = (n, e, t) => {
6102
6102
  if (r.parent.isTextblock) {
6103
6103
  if (t ? !t.endOfTextblock("backward", n) : r.parentOffset > 0)
6104
6104
  return !1;
6105
- o = kc(r);
6105
+ o = Sc(r);
6106
6106
  }
6107
6107
  let i = o && o.nodeBefore;
6108
6108
  return !i || !w.isSelectable(i) ? !1 : (e && e(n.tr.setSelection(w.create(n.doc, o.pos - i.nodeSize)).scrollIntoView()), !0);
6109
6109
  };
6110
- function kc(n) {
6110
+ function Sc(n) {
6111
6111
  if (!n.parent.type.spec.isolating)
6112
6112
  for (let e = n.depth - 1; e >= 0; e--) {
6113
6113
  if (n.index(e) > 0)
@@ -6125,11 +6125,11 @@ const sh = (n, e, t) => {
6125
6125
  let r = rh(n, t);
6126
6126
  if (!r)
6127
6127
  return !1;
6128
- let s = Cc(r);
6128
+ let s = kc(r);
6129
6129
  if (!s)
6130
6130
  return !1;
6131
6131
  let o = s.nodeAfter;
6132
- if (Nc(n, s, e, 1))
6132
+ if (Mc(n, s, e, 1))
6133
6133
  return !0;
6134
6134
  if (r.parent.content.size == 0 && (Nn(o, "start") || w.isSelectable(o))) {
6135
6135
  let i = Bo(n.doc, r.before(), r.after(), C.empty);
@@ -6149,12 +6149,12 @@ const sh = (n, e, t) => {
6149
6149
  if (r.parent.isTextblock) {
6150
6150
  if (t ? !t.endOfTextblock("forward", n) : r.parentOffset < r.parent.content.size)
6151
6151
  return !1;
6152
- o = Cc(r);
6152
+ o = kc(r);
6153
6153
  }
6154
6154
  let i = o && o.nodeAfter;
6155
6155
  return !i || !w.isSelectable(i) ? !1 : (e && e(n.tr.setSelection(w.create(n.doc, o.pos)).scrollIntoView()), !0);
6156
6156
  };
6157
- function Cc(n) {
6157
+ function kc(n) {
6158
6158
  if (!n.parent.type.spec.isolating)
6159
6159
  for (let e = n.depth - 1; e >= 0; e--) {
6160
6160
  let t = n.node(e);
@@ -6165,13 +6165,13 @@ function Cc(n) {
6165
6165
  }
6166
6166
  return null;
6167
6167
  }
6168
- const wc = (n, e) => {
6168
+ const Cc = (n, e) => {
6169
6169
  let t = n.selection, r = t instanceof w, s;
6170
6170
  if (r) {
6171
6171
  if (t.node.isTextblock || !En(n.doc, t.from))
6172
6172
  return !1;
6173
6173
  s = t.from;
6174
- } else if (s = cc(n.doc, t.from, -1), s == null)
6174
+ } else if (s = ac(n.doc, t.from, -1), s == null)
6175
6175
  return !1;
6176
6176
  if (e) {
6177
6177
  let o = n.tr.join(s);
@@ -6184,7 +6184,7 @@ const wc = (n, e) => {
6184
6184
  if (t.node.isTextblock || !En(n.doc, t.to))
6185
6185
  return !1;
6186
6186
  r = t.to;
6187
- } else if (r = cc(n.doc, t.to, 1), r == null)
6187
+ } else if (r = ac(n.doc, t.to, 1), r == null)
6188
6188
  return !1;
6189
6189
  return e && e(n.tr.join(r).scrollIntoView()), !0;
6190
6190
  }, oo = (n, e) => {
@@ -6203,7 +6203,7 @@ function Ho(n) {
6203
6203
  }
6204
6204
  return null;
6205
6205
  }
6206
- const Mc = (n, e) => {
6206
+ const wc = (n, e) => {
6207
6207
  let { $head: t, $anchor: r } = n.selection;
6208
6208
  if (!t.parent.type.spec.code || !t.sameParent(r))
6209
6209
  return !1;
@@ -6276,7 +6276,7 @@ function hh(n, e, t) {
6276
6276
  let r = e.nodeBefore, s = e.nodeAfter, o = e.index();
6277
6277
  return !r || !s || !r.type.compatibleContent(s.type) ? !1 : !r.content.size && e.parent.canReplace(o - 1, o) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(s.isTextblock || En(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
6278
6278
  }
6279
- function Nc(n, e, t, r) {
6279
+ function Mc(n, e, t, r) {
6280
6280
  let s = e.nodeBefore, o = e.nodeAfter, i, l, a = s.type.spec.isolating || o.type.spec.isolating;
6281
6281
  if (!a && hh(n, e, t))
6282
6282
  return !0;
@@ -6315,7 +6315,7 @@ function Nc(n, e, t, r) {
6315
6315
  }
6316
6316
  return !1;
6317
6317
  }
6318
- function Dc(n) {
6318
+ function Nc(n) {
6319
6319
  return function(e, t) {
6320
6320
  let r = e.selection, s = n < 0 ? r.$from : r.$to, o = s.depth;
6321
6321
  for (; s.node(o).isInline; ) {
@@ -6326,8 +6326,8 @@ function Dc(n) {
6326
6326
  return s.node(o).isTextblock ? (t && t(e.tr.setSelection(V.create(e.doc, n < 0 ? s.start(o) : s.end(o)))), !0) : !1;
6327
6327
  };
6328
6328
  }
6329
- const ph = Dc(-1), mh = Dc(1);
6330
- function Oc(n, e = null) {
6329
+ const ph = Nc(-1), mh = Nc(1);
6330
+ function Dc(n, e = null) {
6331
6331
  return function(t, r) {
6332
6332
  let { $from: s, $to: o } = t.selection, i = s.blockRange(o), l = i && jo(i, n, e);
6333
6333
  return l ? (r && r(t.tr.wrap(i, l).scrollIntoView()), !0) : !1;
@@ -6408,17 +6408,17 @@ function cs(...n) {
6408
6408
  return !1;
6409
6409
  };
6410
6410
  }
6411
- let zs = cs(Sc, th, nh), sl = cs(Sc, sh, oh);
6411
+ let zs = cs(xc, th, nh), rl = cs(xc, sh, oh);
6412
6412
  const st = {
6413
6413
  Enter: cs(lh, ah, ch, fh),
6414
- "Mod-Enter": Mc,
6414
+ "Mod-Enter": wc,
6415
6415
  Backspace: zs,
6416
6416
  "Mod-Backspace": zs,
6417
6417
  "Shift-Backspace": zs,
6418
- Delete: sl,
6419
- "Mod-Delete": sl,
6418
+ Delete: rl,
6419
+ "Mod-Delete": rl,
6420
6420
  "Mod-a": dh
6421
- }, Ec = {
6421
+ }, Oc = {
6422
6422
  "Ctrl-h": st.Backspace,
6423
6423
  "Alt-Backspace": st["Mod-Backspace"],
6424
6424
  "Ctrl-d": st.Delete,
@@ -6429,8 +6429,8 @@ const st = {
6429
6429
  "Ctrl-e": mh
6430
6430
  };
6431
6431
  for (let n in st)
6432
- Ec[n] = st[n];
6433
- const yh = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, bh = yh ? Ec : st;
6432
+ Oc[n] = st[n];
6433
+ const yh = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, bh = yh ? Oc : st;
6434
6434
  function xh(n = {}) {
6435
6435
  return new ut({
6436
6436
  view(e) {
@@ -6527,9 +6527,9 @@ const rt = function(n, e, t) {
6527
6527
  }, kh = function() {
6528
6528
  lo = null;
6529
6529
  }, Zt = function(n, e, t, r) {
6530
- return t && (ol(n, e, t, r, -1) || ol(n, e, t, r, 1));
6530
+ return t && (sl(n, e, t, r, -1) || sl(n, e, t, r, 1));
6531
6531
  }, Ch = /^(img|br|input|textarea|hr)$/i;
6532
- function ol(n, e, t, r, s) {
6532
+ function sl(n, e, t, r, s) {
6533
6533
  for (; ; ) {
6534
6534
  if (n == t && e == r)
6535
6535
  return !0;
@@ -6620,9 +6620,9 @@ function Oh(n, e, t) {
6620
6620
  return { node: r.startContainer, offset: Math.min(Pe(r.startContainer), r.startOffset) };
6621
6621
  }
6622
6622
  }
6623
- const Je = typeof navigator < "u" ? navigator : null, il = typeof document < "u" ? document : null, Rt = Je && Je.userAgent || "", ao = /Edge\/(\d+)/.exec(Rt), Tc = /MSIE \d/.exec(Rt), co = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rt), ke = !!(Tc || co || ao), Ot = Tc ? document.documentMode : co ? +co[1] : ao ? +ao[1] : 0, je = !ke && /gecko\/(\d+)/i.test(Rt);
6623
+ const Je = typeof navigator < "u" ? navigator : null, ol = typeof document < "u" ? document : null, Rt = Je && Je.userAgent || "", ao = /Edge\/(\d+)/.exec(Rt), Ec = /MSIE \d/.exec(Rt), co = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rt), ke = !!(Ec || co || ao), Ot = Ec ? document.documentMode : co ? +co[1] : ao ? +ao[1] : 0, je = !ke && /gecko\/(\d+)/i.test(Rt);
6624
6624
  je && +(/Firefox\/(\d+)/.exec(Rt) || [0, 0])[1];
6625
- const uo = !ke && /Chrome\/(\d+)/.exec(Rt), ue = !!uo, Ac = uo ? +uo[1] : 0, ge = !ke && !!Je && /Apple Computer/.test(Je.vendor), Dn = ge && (/Mobile\/\w+/.test(Rt) || !!Je && Je.maxTouchPoints > 2), Re = Dn || (Je ? /Mac/.test(Je.platform) : !1), Eh = Je ? /Win/.test(Je.platform) : !1, it = /Android \d/.test(Rt), ur = !!il && "webkitFontSmoothing" in il.documentElement.style, Th = ur ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6625
+ const uo = !ke && /Chrome\/(\d+)/.exec(Rt), ue = !!uo, Tc = uo ? +uo[1] : 0, ge = !ke && !!Je && /Apple Computer/.test(Je.vendor), Dn = ge && (/Mobile\/\w+/.test(Rt) || !!Je && Je.maxTouchPoints > 2), Re = Dn || (Je ? /Mac/.test(Je.platform) : !1), Eh = Je ? /Win/.test(Je.platform) : !1, it = /Android \d/.test(Rt), ur = !!ol && "webkitFontSmoothing" in ol.documentElement.style, Th = ur ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6626
6626
  function Ah(n) {
6627
6627
  let e = n.defaultView && n.defaultView.visualViewport;
6628
6628
  return e ? {
@@ -6649,7 +6649,7 @@ function Rh(n) {
6649
6649
  bottom: e.top + n.clientHeight * r
6650
6650
  };
6651
6651
  }
6652
- function ll(n, e, t) {
6652
+ function il(n, e, t) {
6653
6653
  let r = n.someProp("scrollThreshold") || 0, s = n.someProp("scrollMargin") || 5, o = n.dom.ownerDocument;
6654
6654
  for (let i = t || n.dom; i; i = Gn(i)) {
6655
6655
  if (i.nodeType != 1)
@@ -6680,9 +6680,9 @@ function Ih(n) {
6680
6680
  break;
6681
6681
  }
6682
6682
  }
6683
- return { refDOM: r, refTop: s, stack: Rc(n.dom) };
6683
+ return { refDOM: r, refTop: s, stack: Ac(n.dom) };
6684
6684
  }
6685
- function Rc(n) {
6685
+ function Ac(n) {
6686
6686
  let e = [], t = n.ownerDocument;
6687
6687
  for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Gn(r))
6688
6688
  ;
@@ -6690,9 +6690,9 @@ function Rc(n) {
6690
6690
  }
6691
6691
  function Ph({ refDOM: n, refTop: e, stack: t }) {
6692
6692
  let r = n ? n.getBoundingClientRect().top : 0;
6693
- Ic(t, r == 0 ? 0 : r - e);
6693
+ Rc(t, r == 0 ? 0 : r - e);
6694
6694
  }
6695
- function Ic(n, e) {
6695
+ function Rc(n, e) {
6696
6696
  for (let t = 0; t < n.length; t++) {
6697
6697
  let { dom: r, top: s, left: o } = n[t];
6698
6698
  r.scrollTop != s + e && (r.scrollTop = s + e), r.scrollLeft != o && (r.scrollLeft = o);
@@ -6704,14 +6704,14 @@ function vh(n) {
6704
6704
  return n.setActive();
6705
6705
  if (an)
6706
6706
  return n.focus(an);
6707
- let e = Rc(n);
6707
+ let e = Ac(n);
6708
6708
  n.focus(an == null ? {
6709
6709
  get preventScroll() {
6710
6710
  return an = { preventScroll: !0 }, !0;
6711
6711
  }
6712
- } : void 0), an || (an = !1, Ic(e, 0));
6712
+ } : void 0), an || (an = !1, Rc(e, 0));
6713
6713
  }
6714
- function Pc(n, e) {
6714
+ function Ic(n, e) {
6715
6715
  let t, r = 2e8, s, o = 0, i = e.top, l = e.top, a, c;
6716
6716
  for (let u = n.firstChild, f = 0; u; u = u.nextSibling, f++) {
6717
6717
  let d;
@@ -6737,7 +6737,7 @@ function Pc(n, e) {
6737
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
- return !t && a && (t = a, s = c, r = 0), t && t.nodeType == 3 ? Vh(t, s) : !t || r && t.nodeType == 1 ? { node: n, offset: o } : Pc(t, s);
6740
+ return !t && a && (t = a, s = c, r = 0), t && t.nodeType == 3 ? Vh(t, s) : !t || r && t.nodeType == 1 ? { node: n, offset: o } : Ic(t, s);
6741
6741
  }
6742
6742
  function Vh(n, e) {
6743
6743
  let t = n.nodeValue.length, r = document.createRange();
@@ -6757,7 +6757,7 @@ function $h(n, e) {
6757
6757
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
6758
6758
  }
6759
6759
  function zh(n, e, t) {
6760
- let { node: r, offset: s } = Pc(e, t), o = -1;
6760
+ let { node: r, offset: s } = Ic(e, t), o = -1;
6761
6761
  if (r.nodeType == 1 && !r.firstChild) {
6762
6762
  let i = r.getBoundingClientRect();
6763
6763
  o = i.left != i.right && t.left > (i.left + i.right) / 2 ? 1 : -1;
@@ -6777,7 +6777,7 @@ function jh(n, e, t, r) {
6777
6777
  }
6778
6778
  return s > -1 ? s : n.docView.posFromDOM(e, t, -1);
6779
6779
  }
6780
- function vc(n, e, t) {
6780
+ function Pc(n, e, t) {
6781
6781
  let r = n.childNodes.length;
6782
6782
  if (r && t.top < t.bottom)
6783
6783
  for (let s = Math.max(0, Math.min(r - 1, Math.floor(r * (e.top - t.top) / (t.bottom - t.top)) - 2)), o = s; ; ) {
@@ -6787,7 +6787,7 @@ function vc(n, e, t) {
6787
6787
  for (let a = 0; a < l.length; a++) {
6788
6788
  let c = l[a];
6789
6789
  if (Jo(e, c))
6790
- return vc(i, e, c);
6790
+ return Pc(i, e, c);
6791
6791
  }
6792
6792
  }
6793
6793
  if ((o = (o + 1) % r) == s)
@@ -6801,7 +6801,7 @@ function Fh(n, e) {
6801
6801
  let i = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
6802
6802
  if (!i || !n.dom.contains(i.nodeType != 1 ? i.parentNode : i)) {
6803
6803
  let c = n.dom.getBoundingClientRect();
6804
- if (!Jo(e, c) || (i = vc(n.dom, e, c), !i))
6804
+ if (!Jo(e, c) || (i = Pc(n.dom, e, c), !i))
6805
6805
  return null;
6806
6806
  }
6807
6807
  if (ge)
@@ -6819,20 +6819,20 @@ function Fh(n, e) {
6819
6819
  let a = n.docView.nearestDesc(i, !0);
6820
6820
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
6821
6821
  }
6822
- function al(n) {
6822
+ function ll(n) {
6823
6823
  return n.top < n.bottom || n.left < n.right;
6824
6824
  }
6825
6825
  function pt(n, e) {
6826
6826
  let t = n.getClientRects();
6827
6827
  if (t.length) {
6828
6828
  let r = t[e < 0 ? 0 : t.length - 1];
6829
- if (al(r))
6829
+ if (ll(r))
6830
6830
  return r;
6831
6831
  }
6832
- return Array.prototype.find.call(t, al) || n.getBoundingClientRect();
6832
+ return Array.prototype.find.call(t, ll) || n.getBoundingClientRect();
6833
6833
  }
6834
6834
  const Bh = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6835
- function Vc(n, e, t) {
6835
+ function vc(n, e, t) {
6836
6836
  let { node: r, offset: s, atom: o } = n.docView.domFromPos(e, t < 0 ? -1 : 1), i = ur || je;
6837
6837
  if (r.nodeType == 3)
6838
6838
  if (i && (Bh.test(r.nodeValue) || (t < 0 ? !s : s == r.nodeValue.length))) {
@@ -6890,7 +6890,7 @@ function js(n, e) {
6890
6890
  let t = e ? n.top : n.bottom;
6891
6891
  return { top: t, bottom: t, left: n.left, right: n.right };
6892
6892
  }
6893
- function $c(n, e, t) {
6893
+ function Vc(n, e, t) {
6894
6894
  let r = n.state, s = n.root.activeElement;
6895
6895
  r != e && n.updateState(e), s != n.dom && n.focus();
6896
6896
  try {
@@ -6901,7 +6901,7 @@ function $c(n, e, t) {
6901
6901
  }
6902
6902
  function Lh(n, e, t) {
6903
6903
  let r = e.selection, s = t == "up" ? r.$from : r.$to;
6904
- return $c(n, e, () => {
6904
+ return Vc(n, e, () => {
6905
6905
  let { node: o } = n.docView.domFromPos(s.pos, t == "up" ? -1 : 1);
6906
6906
  for (; ; ) {
6907
6907
  let l = n.docView.nearestDesc(o, !0);
@@ -6913,7 +6913,7 @@ function Lh(n, e, t) {
6913
6913
  }
6914
6914
  o = l.dom.parentNode;
6915
6915
  }
6916
- let i = Vc(n, s.pos, 1);
6916
+ let i = vc(n, s.pos, 1);
6917
6917
  for (let l = o.firstChild; l; l = l.nextSibling) {
6918
6918
  let a;
6919
6919
  if (l.nodeType == 1)
@@ -6937,7 +6937,7 @@ function _h(n, e, t) {
6937
6937
  if (!r.parent.isTextblock)
6938
6938
  return !1;
6939
6939
  let s = r.parentOffset, o = !s, i = s == r.parent.content.size, l = n.domSelection();
6940
- return l ? !Wh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : $c(n, e, () => {
6940
+ return l ? !Wh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : Vc(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
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;
@@ -6948,11 +6948,11 @@ function _h(n, e, t) {
6948
6948
  return d != null && (l.caretBidiLevel = d), m;
6949
6949
  }) : r.pos == r.start() || r.pos == r.end();
6950
6950
  }
6951
- let cl = null, ul = null, fl = !1;
6951
+ let al = null, cl = null, ul = !1;
6952
6952
  function qh(n, e, t) {
6953
- return cl == e && ul == t ? fl : (cl = e, ul = t, fl = t == "up" || t == "down" ? Lh(n, e, t) : _h(n, e, t));
6953
+ return al == e && cl == t ? ul : (al = e, cl = t, ul = t == "up" || t == "down" ? Lh(n, e, t) : _h(n, e, t));
6954
6954
  }
6955
- const ve = 0, dl = 1, Wt = 2, Ke = 3;
6955
+ const ve = 0, fl = 1, Wt = 2, Ke = 3;
6956
6956
  let fr = class {
6957
6957
  constructor(e, t, r, s) {
6958
6958
  this.parent = e, this.children = t, this.dom = r, this.contentDOM = s, this.dirty = ve, r.pmViewDesc = this;
@@ -7118,7 +7118,7 @@ let fr = class {
7118
7118
  let r = 0, s = 0;
7119
7119
  for (let o = 0; r < this.children.length; r++) {
7120
7120
  let i = this.children[r], l = o + i.size;
7121
- if (l > e || i instanceof Lc) {
7121
+ if (l > e || i instanceof Bc) {
7122
7122
  s = e - o;
7123
7123
  break;
7124
7124
  }
@@ -7126,7 +7126,7 @@ let fr = class {
7126
7126
  }
7127
7127
  if (s)
7128
7128
  return this.children[r].domFromPos(s - this.children[r].border, t);
7129
- for (let o; r && !(o = this.children[r - 1]).size && o instanceof zc && o.side >= 0; r--)
7129
+ for (let o; r && !(o = this.children[r - 1]).size && o instanceof $c && o.side >= 0; r--)
7130
7130
  ;
7131
7131
  if (t <= 0) {
7132
7132
  let o, i = !0;
@@ -7262,7 +7262,7 @@ let fr = class {
7262
7262
  if (r == i ? e <= i && t >= r : e < i && t > r) {
7263
7263
  let l = r + o.border, a = i - o.border;
7264
7264
  if (e >= l && t <= a) {
7265
- this.dirty = e == r || t == i ? Wt : dl, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = Ke : o.markDirty(e - l, t - l);
7265
+ this.dirty = e == r || t == i ? Wt : fl, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = Ke : o.markDirty(e - l, t - l);
7266
7266
  return;
7267
7267
  } else
7268
7268
  o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? Wt : Ke;
@@ -7274,7 +7274,7 @@ let fr = class {
7274
7274
  markParentsDirty() {
7275
7275
  let e = 1;
7276
7276
  for (let t = this.parent; t; t = t.parent, e++) {
7277
- let r = e == 1 ? Wt : dl;
7277
+ let r = e == 1 ? Wt : fl;
7278
7278
  t.dirty < r && (t.dirty = r);
7279
7279
  }
7280
7280
  }
@@ -7287,7 +7287,7 @@ let fr = class {
7287
7287
  isText(e) {
7288
7288
  return !1;
7289
7289
  }
7290
- }, zc = class extends fr {
7290
+ }, $c = class extends fr {
7291
7291
  constructor(e, t, r, s) {
7292
7292
  let o, i = t.type.toDOM;
7293
7293
  if (typeof i == "function" && (i = i(r, () => {
@@ -7377,7 +7377,7 @@ let fr = class {
7377
7377
  destroy() {
7378
7378
  this.spec.destroy && this.spec.destroy(), super.destroy();
7379
7379
  }
7380
- }, kn = class jc extends fr {
7380
+ }, kn = class zc extends fr {
7381
7381
  constructor(e, t, r, s, o, i, l, a, c) {
7382
7382
  super(e, [], o, i), this.node = t, this.outerDeco = r, this.innerDeco = s, this.nodeDOM = l;
7383
7383
  }
@@ -7405,7 +7405,7 @@ let fr = class {
7405
7405
  } else u || ({ dom: u, contentDOM: f } = Xe.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
7406
7406
  !f && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
7407
7407
  let d = u;
7408
- return u = qc(u, r, t), c ? a = new Jh(e, t, r, s, u, f || null, d, c, o, i + 1) : t.isText ? new Fc(e, t, r, s, u, d, o) : new jc(e, t, r, s, u, f || null, d, o, i + 1);
7408
+ return u = _c(u, r, t), c ? a = new Jh(e, t, r, s, u, f || null, d, c, o, i + 1) : t.isText ? new jc(e, t, r, s, u, d, o) : new zc(e, t, r, s, u, f || null, d, o, i + 1);
7409
7409
  }
7410
7410
  parseRule() {
7411
7411
  if (this.node.type.spec.reparseInView)
@@ -7448,7 +7448,7 @@ let fr = class {
7448
7448
  a.syncToMarks(c.marks, r, e);
7449
7449
  let h;
7450
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
- }), 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 && Qh(this.dom));
7451
+ }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Wt) && (i && this.protectLocalComposition(e, i), Lc(this.contentDOM, this.children, e), Dn && Qh(this.dom));
7452
7452
  }
7453
7453
  localCompositionInfo(e, t) {
7454
7454
  let { from: r, to: s } = e.state.selection;
@@ -7489,7 +7489,7 @@ let fr = class {
7489
7489
  if (qr(e, this.outerDeco))
7490
7490
  return;
7491
7491
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
7492
- this.dom = _c(this.dom, this.nodeDOM, ho(this.outerDeco, this.node, t), ho(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
7492
+ this.dom = Wc(this.dom, this.nodeDOM, ho(this.outerDeco, this.node, t), ho(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
7493
7493
  }
7494
7494
  // Mark this node as being the selected node.
7495
7495
  selectNode() {
@@ -7503,12 +7503,12 @@ let fr = class {
7503
7503
  return this.node.isAtom;
7504
7504
  }
7505
7505
  };
7506
- function hl(n, e, t, r, s) {
7507
- qc(r, e, n);
7506
+ function dl(n, e, t, r, s) {
7507
+ _c(r, e, n);
7508
7508
  let o = new kn(void 0, n, e, t, r, r, r, s, 0);
7509
7509
  return o.contentDOM && o.updateChildren(s, 0), o;
7510
7510
  }
7511
- let Fc = class Bc extends kn {
7511
+ let jc = class Fc extends kn {
7512
7512
  constructor(e, t, r, s, o, i, l) {
7513
7513
  super(e, t, r, s, o, null, i, l, 0);
7514
7514
  }
@@ -7539,7 +7539,7 @@ let Fc = class Bc extends kn {
7539
7539
  }
7540
7540
  slice(e, t, r) {
7541
7541
  let s = this.node.cut(e, t), o = document.createTextNode(s.text);
7542
- return new Bc(this.parent, s, this.outerDeco, this.innerDeco, o, o, r);
7542
+ return new Fc(this.parent, s, this.outerDeco, this.innerDeco, o, o, r);
7543
7543
  }
7544
7544
  markDirty(e, t) {
7545
7545
  super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Ke);
@@ -7550,7 +7550,7 @@ let Fc = class Bc extends kn {
7550
7550
  isText(e) {
7551
7551
  return this.node.text == e;
7552
7552
  }
7553
- }, Lc = class extends fr {
7553
+ }, Bc = class extends fr {
7554
7554
  parseRule() {
7555
7555
  return { ignore: !0 };
7556
7556
  }
@@ -7598,23 +7598,23 @@ class Jh extends kn {
7598
7598
  return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
7599
7599
  }
7600
7600
  }
7601
- function Wc(n, e, t) {
7601
+ function Lc(n, e, t) {
7602
7602
  let r = n.firstChild, s = !1;
7603
7603
  for (let o = 0; o < e.length; o++) {
7604
7604
  let i = e[o], l = i.dom;
7605
7605
  if (l.parentNode == n) {
7606
7606
  for (; l != r; )
7607
- r = pl(r), s = !0;
7607
+ r = hl(r), s = !0;
7608
7608
  r = r.nextSibling;
7609
7609
  } else
7610
7610
  s = !0, n.insertBefore(l, r);
7611
7611
  if (i instanceof _r) {
7612
7612
  let a = r ? r.previousSibling : n.lastChild;
7613
- Wc(i.contentDOM, i.children, t), r = a ? a.nextSibling : n.firstChild;
7613
+ Lc(i.contentDOM, i.children, t), r = a ? a.nextSibling : n.firstChild;
7614
7614
  }
7615
7615
  }
7616
7616
  for (; r; )
7617
- r = pl(r), s = !0;
7617
+ r = hl(r), s = !0;
7618
7618
  s && t.trackWrites == n && (t.trackWrites = null);
7619
7619
  }
7620
7620
  const Ln = function(n) {
@@ -7638,7 +7638,7 @@ function ho(n, e, t) {
7638
7638
  }
7639
7639
  return s;
7640
7640
  }
7641
- function _c(n, e, t, r) {
7641
+ function Wc(n, e, t, r) {
7642
7642
  if (t == _t && r == _t)
7643
7643
  return e;
7644
7644
  let s = e;
@@ -7674,8 +7674,8 @@ function Kh(n, e, t) {
7674
7674
  t.style && (n.style.cssText += t.style);
7675
7675
  }
7676
7676
  }
7677
- function qc(n, e, t) {
7678
- return _c(n, n, _t, ho(e, t, n.nodeType != 1));
7677
+ function _c(n, e, t) {
7678
+ return Wc(n, n, _t, ho(e, t, n.nodeType != 1));
7679
7679
  }
7680
7680
  function qr(n, e) {
7681
7681
  if (n.length != e.length)
@@ -7685,7 +7685,7 @@ function qr(n, e) {
7685
7685
  return !1;
7686
7686
  return !0;
7687
7687
  }
7688
- function pl(n) {
7688
+ function hl(n) {
7689
7689
  let e = n.nextSibling;
7690
7690
  return n.parentNode.removeChild(n), e;
7691
7691
  }
@@ -7812,7 +7812,7 @@ class Uh {
7812
7812
  if (s && s.matchesWidget(e) && (e == s.widget || !s.widget.type.toDOM.parentNode))
7813
7813
  this.index++;
7814
7814
  else {
7815
- let o = new zc(this.top, e, t, r);
7815
+ let o = new $c(this.top, e, t, r);
7816
7816
  this.top.children.splice(this.index++, 0, o), this.changed = !0;
7817
7817
  }
7818
7818
  }
@@ -7823,7 +7823,7 @@ class Uh {
7823
7823
  for (; e instanceof _r; )
7824
7824
  t = e, e = t.children[t.children.length - 1];
7825
7825
  (!e || // Empty textblock
7826
- !(e instanceof Fc) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ge || ue) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7826
+ !(e instanceof jc) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ge || ue) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7827
7827
  }
7828
7828
  addHackNode(e, t) {
7829
7829
  if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
@@ -7831,7 +7831,7 @@ class Uh {
7831
7831
  else {
7832
7832
  let r = document.createElement(e);
7833
7833
  e == "IMG" && (r.className = "ProseMirror-separator", r.alt = ""), e == "BR" && (r.className = "ProseMirror-trailingBreak");
7834
- let s = new Lc(this.top, [], r, null);
7834
+ let s = new Bc(this.top, [], r, null);
7835
7835
  t != this.top ? t.children.push(s) : t.children.splice(this.index++, 0, s), this.changed = !0;
7836
7836
  }
7837
7837
  }
@@ -7993,12 +7993,12 @@ function Ko(n, e = null) {
7993
7993
  }
7994
7994
  return c;
7995
7995
  }
7996
- function Hc(n) {
7997
- return n.editable ? n.hasFocus() : Kc(n) && document.activeElement && document.activeElement.contains(n.dom);
7996
+ function qc(n) {
7997
+ return n.editable ? n.hasFocus() : Jc(n) && document.activeElement && document.activeElement.contains(n.dom);
7998
7998
  }
7999
7999
  function at(n, e = !1) {
8000
8000
  let t = n.state.selection;
8001
- if (Jc(n, t), !!Hc(n)) {
8001
+ if (Hc(n, t), !!qc(n)) {
8002
8002
  if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && ue) {
8003
8003
  let r = n.domSelectionRange(), s = n.domObserver.currentSelection;
8004
8004
  if (r.anchorNode && s.anchorNode && Zt(r.anchorNode, r.anchorOffset, s.anchorNode, s.anchorOffset)) {
@@ -8010,13 +8010,13 @@ function at(n, e = !1) {
8010
8010
  tp(n);
8011
8011
  else {
8012
8012
  let { anchor: r, head: s } = t, o, i;
8013
- ml && !(t instanceof V) && (t.$from.parent.inlineContent || (o = gl(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (i = gl(n, t.to))), n.docView.setSelection(r, s, n, e), ml && (o && yl(o), i && yl(i)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ep(n));
8013
+ pl && !(t instanceof V) && (t.$from.parent.inlineContent || (o = ml(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (i = ml(n, t.to))), n.docView.setSelection(r, s, n, e), pl && (o && gl(o), i && gl(i)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ep(n));
8014
8014
  }
8015
8015
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
8016
8016
  }
8017
8017
  }
8018
- const ml = ge || ue && Ac < 63;
8019
- function gl(n, e) {
8018
+ const pl = ge || ue && Tc < 63;
8019
+ function ml(n, e) {
8020
8020
  let { node: t, offset: r } = n.docView.domFromPos(e, 0), s = r < t.childNodes.length ? t.childNodes[r] : null, o = r ? t.childNodes[r - 1] : null;
8021
8021
  if (ge && s && s.contentEditable == "false")
8022
8022
  return Fs(s);
@@ -8030,7 +8030,7 @@ function gl(n, e) {
8030
8030
  function Fs(n) {
8031
8031
  return n.contentEditable = "true", ge && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
8032
8032
  }
8033
- function yl(n) {
8033
+ function gl(n) {
8034
8034
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
8035
8035
  }
8036
8036
  function ep(n) {
@@ -8039,7 +8039,7 @@ function ep(n) {
8039
8039
  let t = n.domSelectionRange(), r = t.anchorNode, s = t.anchorOffset;
8040
8040
  e.addEventListener("selectionchange", n.input.hideSelectionGuard = () => {
8041
8041
  (t.anchorNode != r || t.anchorOffset != s) && (e.removeEventListener("selectionchange", n.input.hideSelectionGuard), setTimeout(() => {
8042
- (!Hc(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
8042
+ (!qc(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
8043
8043
  }, 20));
8044
8044
  });
8045
8045
  }
@@ -8050,23 +8050,23 @@ function tp(n) {
8050
8050
  let r = n.cursorWrapper.dom, s = r.nodeName == "IMG";
8051
8051
  s ? t.setStart(r.parentNode, re(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !s && !n.state.selection.visible && ke && Ot <= 11 && (r.disabled = !0, r.disabled = !1);
8052
8052
  }
8053
- function Jc(n, e) {
8053
+ function Hc(n, e) {
8054
8054
  if (e instanceof w) {
8055
8055
  let t = n.docView.descAt(e.from);
8056
- t != n.lastSelectedViewDesc && (bl(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
8056
+ t != n.lastSelectedViewDesc && (yl(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
8057
8057
  } else
8058
- bl(n);
8058
+ yl(n);
8059
8059
  }
8060
- function bl(n) {
8060
+ function yl(n) {
8061
8061
  n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
8062
8062
  }
8063
8063
  function Uo(n, e, t, r) {
8064
8064
  return n.someProp("createSelectionBetween", (s) => s(n, e, t)) || V.between(e, t, r);
8065
8065
  }
8066
- function xl(n) {
8067
- return n.editable && !n.hasFocus() ? !1 : Kc(n);
8066
+ function bl(n) {
8067
+ return n.editable && !n.hasFocus() ? !1 : Jc(n);
8068
8068
  }
8069
- function Kc(n) {
8069
+ function Jc(n) {
8070
8070
  let e = n.domSelectionRange();
8071
8071
  if (!e.anchorNode)
8072
8072
  return !1;
@@ -8087,7 +8087,7 @@ function mo(n, e) {
8087
8087
  function yt(n, e) {
8088
8088
  return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
8089
8089
  }
8090
- function Sl(n, e, t) {
8090
+ function xl(n, e, t) {
8091
8091
  let r = n.state.selection;
8092
8092
  if (r instanceof V)
8093
8093
  if (t.indexOf("s") > -1) {
@@ -8146,7 +8146,7 @@ function rp(n) {
8146
8146
  break;
8147
8147
  }
8148
8148
  } else {
8149
- if (Uc(t))
8149
+ if (Kc(t))
8150
8150
  break;
8151
8151
  {
8152
8152
  let l = t.previousSibling;
@@ -8178,7 +8178,7 @@ function sp(n) {
8178
8178
  else
8179
8179
  break;
8180
8180
  } else {
8181
- if (Uc(t))
8181
+ if (Kc(t))
8182
8182
  break;
8183
8183
  {
8184
8184
  let l = t.nextSibling;
@@ -8195,7 +8195,7 @@ function sp(n) {
8195
8195
  }
8196
8196
  o && go(n, o, i);
8197
8197
  }
8198
- function Uc(n) {
8198
+ function Kc(n) {
8199
8199
  let e = n.pmViewDesc;
8200
8200
  return e && e.node && e.node.isBlock;
8201
8201
  }
@@ -8241,7 +8241,7 @@ function go(n, e, t) {
8241
8241
  n.state == s && at(n);
8242
8242
  }, 50);
8243
8243
  }
8244
- function kl(n, e) {
8244
+ function Sl(n, e) {
8245
8245
  let t = n.state.doc.resolve(e);
8246
8246
  if (!(ue || Eh) && t.parent.inlineContent) {
8247
8247
  let s = n.coordsAtPos(e);
@@ -8258,7 +8258,7 @@ function kl(n, e) {
8258
8258
  }
8259
8259
  return getComputedStyle(n.dom).direction == "rtl" ? "rtl" : "ltr";
8260
8260
  }
8261
- function Cl(n, e, t) {
8261
+ function kl(n, e, t) {
8262
8262
  let r = n.state.selection;
8263
8263
  if (r instanceof V && !r.empty || t.indexOf("s") > -1 || Re && t.indexOf("m") > -1)
8264
8264
  return !1;
@@ -8274,7 +8274,7 @@ function Cl(n, e, t) {
8274
8274
  }
8275
8275
  return !1;
8276
8276
  }
8277
- function wl(n, e) {
8277
+ function Cl(n, e) {
8278
8278
  if (!(n.state.selection instanceof V))
8279
8279
  return !0;
8280
8280
  let { $head: t, $anchor: r, empty: s } = n.state.selection;
@@ -8291,7 +8291,7 @@ function wl(n, e) {
8291
8291
  }
8292
8292
  return !1;
8293
8293
  }
8294
- function Ml(n, e, t) {
8294
+ function wl(n, e, t) {
8295
8295
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
8296
8296
  }
8297
8297
  function lp(n) {
@@ -8300,7 +8300,7 @@ function lp(n) {
8300
8300
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
8301
8301
  if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
8302
8302
  let r = e.firstChild;
8303
- Ml(n, r, "true"), setTimeout(() => Ml(n, r, "false"), 20);
8303
+ wl(n, r, "true"), setTimeout(() => wl(n, r, "false"), 20);
8304
8304
  }
8305
8305
  return !1;
8306
8306
  }
@@ -8311,28 +8311,28 @@ function ap(n) {
8311
8311
  function cp(n, e) {
8312
8312
  let t = e.keyCode, r = ap(e);
8313
8313
  if (t == 8 || Re && t == 72 && r == "c")
8314
- return wl(n, -1) || cn(n, -1);
8314
+ return Cl(n, -1) || cn(n, -1);
8315
8315
  if (t == 46 && !e.shiftKey || Re && t == 68 && r == "c")
8316
- return wl(n, 1) || cn(n, 1);
8316
+ return Cl(n, 1) || cn(n, 1);
8317
8317
  if (t == 13 || t == 27)
8318
8318
  return !0;
8319
8319
  if (t == 37 || Re && t == 66 && r == "c") {
8320
- let s = t == 37 ? kl(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
8321
- return Sl(n, s, r) || cn(n, s);
8320
+ let s = t == 37 ? Sl(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
8321
+ return xl(n, s, r) || cn(n, s);
8322
8322
  } else if (t == 39 || Re && t == 70 && r == "c") {
8323
- let s = t == 39 ? kl(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
8324
- return Sl(n, s, r) || cn(n, s);
8323
+ let s = t == 39 ? Sl(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
8324
+ return xl(n, s, r) || cn(n, s);
8325
8325
  } else {
8326
8326
  if (t == 38 || Re && t == 80 && r == "c")
8327
- return Cl(n, -1, r) || cn(n, -1);
8327
+ return kl(n, -1, r) || cn(n, -1);
8328
8328
  if (t == 40 || Re && t == 78 && r == "c")
8329
- return lp(n) || Cl(n, 1, r) || cn(n, 1);
8329
+ return lp(n) || kl(n, 1, r) || cn(n, 1);
8330
8330
  if (r == (Re ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
8331
8331
  return !0;
8332
8332
  }
8333
8333
  return !1;
8334
8334
  }
8335
- function Yc(n, e) {
8335
+ function Uc(n, e) {
8336
8336
  n.someProp("transformCopied", (h) => {
8337
8337
  e = h(e, n);
8338
8338
  });
@@ -8342,10 +8342,10 @@ function Yc(n, e) {
8342
8342
  let h = r.firstChild;
8343
8343
  t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
8344
8344
  }
8345
- let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = tu(), a = l.createElement("div");
8345
+ let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = eu(), a = l.createElement("div");
8346
8346
  a.appendChild(i.serializeFragment(r, { document: l }));
8347
8347
  let c = a.firstChild, u, f = 0;
8348
- for (; c && c.nodeType == 1 && (u = eu[c.nodeName.toLowerCase()]); ) {
8348
+ for (; c && c.nodeType == 1 && (u = Zc[c.nodeName.toLowerCase()]); ) {
8349
8349
  for (let h = u.length - 1; h >= 0; h--) {
8350
8350
  let p = l.createElement(u[h]);
8351
8351
  for (; a.firstChild; )
@@ -8360,7 +8360,7 @@ function Yc(n, e) {
8360
8360
  `);
8361
8361
  return { dom: a, text: d, slice: e };
8362
8362
  }
8363
- function Gc(n, e, t, r, s) {
8363
+ function Yc(n, e, t, r, s) {
8364
8364
  let o = s.parent.type.spec.code, i, l;
8365
8365
  if (!t && !e)
8366
8366
  return null;
@@ -8402,14 +8402,14 @@ function Gc(n, e, t, r, s) {
8402
8402
  return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !up.test(d.parentNode.nodeName) ? { ignore: !0 } : null;
8403
8403
  }
8404
8404
  })), u)
8405
- l = mp(Nl(l, +u[1], +u[2]), u[4]);
8405
+ l = mp(Ml(l, +u[1], +u[2]), u[4]);
8406
8406
  else if (l = C.maxOpen(fp(l.content, s), !0), l.openStart || l.openEnd) {
8407
8407
  let f = 0, d = 0;
8408
8408
  for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
8409
8409
  ;
8410
8410
  for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
8411
8411
  ;
8412
- l = Nl(l, f, d);
8412
+ l = Ml(l, f, d);
8413
8413
  }
8414
8414
  return n.someProp("transformPasted", (f) => {
8415
8415
  l = f(l, n);
@@ -8427,11 +8427,11 @@ function fp(n, e) {
8427
8427
  let a = s.findWrapping(l.type), c;
8428
8428
  if (!a)
8429
8429
  return i = null;
8430
- if (c = i.length && o.length && Qc(a, o, l, i[i.length - 1], 0))
8430
+ if (c = i.length && o.length && Xc(a, o, l, i[i.length - 1], 0))
8431
8431
  i[i.length - 1] = c;
8432
8432
  else {
8433
- i.length && (i[i.length - 1] = Zc(i[i.length - 1], o.length));
8434
- let u = Xc(l, a);
8433
+ i.length && (i[i.length - 1] = Qc(i[i.length - 1], o.length));
8434
+ let u = Gc(l, a);
8435
8435
  i.push(u), s = s.matchType(u.type), o = a;
8436
8436
  }
8437
8437
  }), i)
@@ -8439,34 +8439,34 @@ function fp(n, e) {
8439
8439
  }
8440
8440
  return n;
8441
8441
  }
8442
- function Xc(n, e, t = 0) {
8442
+ function Gc(n, e, t = 0) {
8443
8443
  for (let r = e.length - 1; r >= t; r--)
8444
8444
  n = e[r].create(null, S.from(n));
8445
8445
  return n;
8446
8446
  }
8447
- function Qc(n, e, t, r, s) {
8447
+ function Xc(n, e, t, r, s) {
8448
8448
  if (s < n.length && s < e.length && n[s] == e[s]) {
8449
- let o = Qc(n, e, t, r.lastChild, s + 1);
8449
+ let o = Xc(n, e, t, r.lastChild, s + 1);
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(S.from(Xc(t, n, s + 1))));
8453
+ return r.copy(r.content.append(S.from(Gc(t, n, s + 1))));
8454
8454
  }
8455
8455
  }
8456
- function Zc(n, e) {
8456
+ function Qc(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(S.empty, !0);
8459
+ let t = n.content.replaceChild(n.childCount - 1, Qc(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 yo(n, e, t, r, s, o) {
8463
8463
  let i = e < 0 ? n.firstChild : n.lastChild, l = i.content;
8464
8464
  return n.childCount > 1 && (o = 0), s < r - 1 && (l = yo(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
- function Nl(n, e, t) {
8466
+ function Ml(n, e, t) {
8467
8467
  return e < n.openStart && (n = new C(yo(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new C(yo(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
8468
8468
  }
8469
- const eu = {
8469
+ const Zc = {
8470
8470
  thead: ["table"],
8471
8471
  tbody: ["table"],
8472
8472
  tfoot: ["table"],
@@ -8477,9 +8477,9 @@ const eu = {
8477
8477
  td: ["table", "tbody", "tr"],
8478
8478
  th: ["table", "tbody", "tr"]
8479
8479
  };
8480
- let Dl = null;
8481
- function tu() {
8482
- return Dl || (Dl = document.implementation.createHTMLDocument("title"));
8480
+ let Nl = null;
8481
+ function eu() {
8482
+ return Nl || (Nl = document.implementation.createHTMLDocument("title"));
8483
8483
  }
8484
8484
  let Bs = null;
8485
8485
  function dp(n) {
@@ -8489,8 +8489,8 @@ function dp(n) {
8489
8489
  function hp(n) {
8490
8490
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
8491
8491
  e && (n = n.slice(e[0].length));
8492
- let t = tu().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), s;
8493
- if ((s = r && eu[r[1].toLowerCase()]) && (n = s.map((o) => "<" + o + ">").join("") + n + s.map((o) => "</" + o + ">").reverse().join("")), t.innerHTML = dp(n), s)
8492
+ let t = eu().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), s;
8493
+ if ((s = r && Zc[r[1].toLowerCase()]) && (n = s.map((o) => "<" + o + ">").join("") + n + s.map((o) => "</" + o + ">").reverse().join("")), t.innerHTML = dp(n), s)
8494
8494
  for (let o = 0; o < s.length; o++)
8495
8495
  t = t.querySelector(s[o]) || t;
8496
8496
  return t;
@@ -8571,7 +8571,7 @@ function kp(n, e) {
8571
8571
  }
8572
8572
  be.keydown = (n, e) => {
8573
8573
  let t = e;
8574
- if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !ru(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(it && ue && t.keyCode == 13)))
8574
+ if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !nu(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(it && ue && t.keyCode == 13)))
8575
8575
  if (t.keyCode != 229 && n.domObserver.forceFlush(), Dn && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
8576
8576
  let r = Date.now();
8577
8577
  n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
@@ -8584,7 +8584,7 @@ be.keyup = (n, e) => {
8584
8584
  };
8585
8585
  be.keypress = (n, e) => {
8586
8586
  let t = e;
8587
- if (ru(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Re && t.metaKey)
8587
+ if (nu(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Re && t.metaKey)
8588
8588
  return;
8589
8589
  if (n.someProp("handleKeyPress", (s) => s(n, t))) {
8590
8590
  t.preventDefault();
@@ -8669,18 +8669,18 @@ function Ep(n, e, t) {
8669
8669
  function Xo(n) {
8670
8670
  return Jr(n);
8671
8671
  }
8672
- const nu = Re ? "metaKey" : "ctrlKey";
8672
+ const tu = Re ? "metaKey" : "ctrlKey";
8673
8673
  ye.mousedown = (n, e) => {
8674
8674
  let t = e;
8675
8675
  n.input.shiftKey = t.shiftKey;
8676
8676
  let r = Xo(n), s = Date.now(), o = "singleClick";
8677
- s - n.input.lastClick.time < 500 && Cp(t, n.input.lastClick) && !t[nu] && (n.input.lastClick.type == "singleClick" ? o = "doubleClick" : n.input.lastClick.type == "doubleClick" && (o = "tripleClick")), n.input.lastClick = { time: s, x: t.clientX, y: t.clientY, type: o };
8677
+ s - n.input.lastClick.time < 500 && Cp(t, n.input.lastClick) && !t[tu] && (n.input.lastClick.type == "singleClick" ? o = "doubleClick" : n.input.lastClick.type == "doubleClick" && (o = "tripleClick")), n.input.lastClick = { time: s, x: t.clientX, y: t.clientY, type: o };
8678
8678
  let i = n.posAtCoords(fs(t));
8679
8679
  i && (o == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Tp(n, i, t, !!r)) : (o == "doubleClick" ? Dp : Op)(n, i.pos, i.inside, t) ? t.preventDefault() : wt(n, "pointer"));
8680
8680
  };
8681
8681
  let Tp = class {
8682
8682
  constructor(e, t, r, s) {
8683
- this.view = e, this.pos = t, this.event = r, this.flushed = s, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[nu], this.allowDefault = r.shiftKey;
8683
+ this.view = e, this.pos = t, this.event = r, this.flushed = s, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[tu], this.allowDefault = r.shiftKey;
8684
8684
  let o, i;
8685
8685
  if (t.inside > -1)
8686
8686
  o = e.state.doc.nodeAt(t.inside), i = t.inside;
@@ -8731,7 +8731,7 @@ ye.touchmove = (n) => {
8731
8731
  n.input.lastTouch = Date.now(), wt(n, "pointer");
8732
8732
  };
8733
8733
  ye.contextmenu = (n) => Xo(n);
8734
- function ru(n, e) {
8734
+ function nu(n, e) {
8735
8735
  return n.composing ? !0 : ge && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
8736
8736
  }
8737
8737
  const Ap = it ? 5e3 : -1;
@@ -8757,15 +8757,15 @@ be.compositionstart = be.compositionupdate = (n) => {
8757
8757
  }
8758
8758
  n.input.composing = !0;
8759
8759
  }
8760
- su(n, Ap);
8760
+ ru(n, Ap);
8761
8761
  };
8762
8762
  be.compositionend = (n, e) => {
8763
- n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, su(n, 20));
8763
+ n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, ru(n, 20));
8764
8764
  };
8765
- function su(n, e) {
8765
+ function ru(n, e) {
8766
8766
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Jr(n), e));
8767
8767
  }
8768
- function ou(n) {
8768
+ function su(n) {
8769
8769
  for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Ip()); n.input.compositionNodes.length > 0; )
8770
8770
  n.input.compositionNodes.pop().markParentsDirty();
8771
8771
  }
@@ -8794,7 +8794,7 @@ function Ip() {
8794
8794
  }
8795
8795
  function Jr(n, e = !1) {
8796
8796
  if (!(it && n.domObserver.flushingSoon >= 0)) {
8797
- if (n.domObserver.forceFlush(), ou(n), e || n.docView && n.docView.dirty) {
8797
+ if (n.domObserver.forceFlush(), su(n), e || n.docView && n.docView.dirty) {
8798
8798
  let t = Ko(n);
8799
8799
  return t && !t.eq(n.state.selection) ? n.dispatch(n.state.tr.setSelection(t)) : (n.markCursor || e) && !n.state.selection.empty ? n.dispatch(n.state.tr.deleteSelection()) : n.updateState(n.state), !0;
8800
8800
  }
@@ -8816,7 +8816,7 @@ ye.copy = be.cut = (n, e) => {
8816
8816
  let t = e, r = n.state.selection, s = t.type == "cut";
8817
8817
  if (r.empty)
8818
8818
  return;
8819
- let o = Xn ? null : t.clipboardData, i = r.content(), { dom: l, text: a } = Yc(n, i);
8819
+ let o = Xn ? null : t.clipboardData, i = r.content(), { dom: l, text: a } = Uc(n, i);
8820
8820
  o ? (t.preventDefault(), o.clearData(), o.setData("text/html", l.innerHTML), o.setData("text/plain", a)) : Pp(n, l), s && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8821
8821
  };
8822
8822
  function vp(n) {
@@ -8833,7 +8833,7 @@ function Vp(n, e) {
8833
8833
  }, 50);
8834
8834
  }
8835
8835
  function Qn(n, e, t, r, s) {
8836
- let o = Gc(n, e, t, r, n.state.selection.$from);
8836
+ let o = Yc(n, e, t, r, n.state.selection.$from);
8837
8837
  if (n.someProp("handlePaste", (a) => a(n, s, o || C.empty)))
8838
8838
  return !0;
8839
8839
  if (!o)
@@ -8841,7 +8841,7 @@ function Qn(n, e, t, r, s) {
8841
8841
  let i = vp(o), l = i ? n.state.tr.replaceSelectionWith(i, r) : n.state.tr.replaceSelection(o);
8842
8842
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
8843
8843
  }
8844
- function iu(n) {
8844
+ function ou(n) {
8845
8845
  let e = n.getData("text/plain") || n.getData("Text");
8846
8846
  if (e)
8847
8847
  return e;
@@ -8853,14 +8853,14 @@ be.paste = (n, e) => {
8853
8853
  if (n.composing && !it)
8854
8854
  return;
8855
8855
  let r = Xn ? null : t.clipboardData, s = n.input.shiftKey && n.input.lastKeyCode != 45;
8856
- r && Qn(n, iu(r), r.getData("text/html"), s, t) ? t.preventDefault() : Vp(n, t);
8856
+ r && Qn(n, ou(r), r.getData("text/html"), s, t) ? t.preventDefault() : Vp(n, t);
8857
8857
  };
8858
- let lu = class {
8858
+ let iu = class {
8859
8859
  constructor(e, t, r) {
8860
8860
  this.slice = e, this.move = t, this.node = r;
8861
8861
  }
8862
8862
  };
8863
- const au = Re ? "altKey" : "ctrlKey";
8863
+ const lu = Re ? "altKey" : "ctrlKey";
8864
8864
  ye.dragstart = (n, e) => {
8865
8865
  let t = e, r = n.input.mouseDown;
8866
8866
  if (r && r.done(), !t.dataTransfer)
@@ -8874,8 +8874,8 @@ ye.dragstart = (n, e) => {
8874
8874
  f && f.node.type.spec.draggable && f != n.docView && (i = w.create(n.state.doc, f.posBefore));
8875
8875
  }
8876
8876
  }
8877
- let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Yc(n, l);
8878
- (!t.dataTransfer.files.length || !ue || Ac > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Xn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Xn || t.dataTransfer.setData("text/plain", c), n.dragging = new lu(u, !t[au], i);
8877
+ let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Uc(n, l);
8878
+ (!t.dataTransfer.files.length || !ue || Tc > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Xn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Xn || t.dataTransfer.setData("text/plain", c), n.dragging = new iu(u, !t[lu], i);
8879
8879
  };
8880
8880
  ye.dragend = (n) => {
8881
8881
  let e = n.dragging;
@@ -8894,8 +8894,8 @@ be.drop = (n, e) => {
8894
8894
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
8895
8895
  i ? n.someProp("transformPasted", (p) => {
8896
8896
  i = p(i, n);
8897
- }) : i = Gc(n, iu(t.dataTransfer), Xn ? null : t.dataTransfer.getData("text/html"), !1, o);
8898
- let l = !!(r && !t[au]);
8897
+ }) : i = Yc(n, ou(t.dataTransfer), Xn ? null : t.dataTransfer.getData("text/html"), !1, o);
8898
+ let l = !!(r && !t[lu]);
8899
8899
  if (n.someProp("handleDrop", (p) => p(n, t, i || C.empty, l))) {
8900
8900
  t.preventDefault();
8901
8901
  return;
@@ -8956,7 +8956,7 @@ function Zn(n, e) {
8956
8956
  return !1;
8957
8957
  return !0;
8958
8958
  }
8959
- let Ol = class cu {
8959
+ let Dl = class au {
8960
8960
  constructor(e, t) {
8961
8961
  this.toDOM = e, this.spec = t || Jt, this.side = this.spec.side || 0;
8962
8962
  }
@@ -8968,7 +8968,7 @@ let Ol = class cu {
8968
8968
  return !0;
8969
8969
  }
8970
8970
  eq(e) {
8971
- return this == e || e instanceof cu && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Zn(this.spec, e.spec));
8971
+ return this == e || e instanceof au && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Zn(this.spec, e.spec));
8972
8972
  }
8973
8973
  destroy(e) {
8974
8974
  this.spec.destroy && this.spec.destroy(e);
@@ -8992,7 +8992,7 @@ let Ol = class cu {
8992
8992
  }
8993
8993
  destroy() {
8994
8994
  }
8995
- }, $p = class uu {
8995
+ }, $p = class cu {
8996
8996
  constructor(e, t) {
8997
8997
  this.attrs = e, this.spec = t || Jt;
8998
8998
  }
@@ -9008,7 +9008,7 @@ let Ol = class cu {
9008
9008
  return s == t.from && !(o = e.child(r)).isText && s + o.nodeSize == t.to;
9009
9009
  }
9010
9010
  eq(e) {
9011
- return this == e || e instanceof uu && Zn(this.attrs, e.attrs) && Zn(this.spec, e.spec);
9011
+ return this == e || e instanceof cu && Zn(this.attrs, e.attrs) && Zn(this.spec, e.spec);
9012
9012
  }
9013
9013
  destroy() {
9014
9014
  }
@@ -9046,7 +9046,7 @@ let Ol = class cu {
9046
9046
  widget's current document position.
9047
9047
  */
9048
9048
  static widget(e, t, r) {
9049
- return new jn(e, e, new Ol(t, r));
9049
+ return new jn(e, e, new Dl(t, r));
9050
9050
  }
9051
9051
  /**
9052
9052
  Creates an inline decoration, which adds the given attributes to
@@ -9080,7 +9080,7 @@ let Ol = class cu {
9080
9080
  @internal
9081
9081
  */
9082
9082
  get widget() {
9083
- return this.type instanceof Ol;
9083
+ return this.type instanceof Dl;
9084
9084
  }
9085
9085
  };
9086
9086
  const hn = [], Jt = {};
@@ -9153,13 +9153,13 @@ let U = class mt {
9153
9153
  let s, o = 0;
9154
9154
  e.forEach((l, a) => {
9155
9155
  let c = a + r, u;
9156
- if (u = hu(t, l, c)) {
9156
+ if (u = du(t, l, c)) {
9157
9157
  for (s || (s = this.children.slice()); o < s.length && s[o] < a; )
9158
9158
  o += 3;
9159
9159
  s[o] == a ? s[o + 2] = s[o + 2].addInner(l, u, c + 1) : s.splice(o, 0, a, a + l.nodeSize, Kr(u, l, c + 1, Jt)), o += 3;
9160
9160
  }
9161
9161
  });
9162
- let i = du(o ? pu(t) : t, -r);
9162
+ let i = fu(o ? hu(t) : t, -r);
9163
9163
  for (let l = 0; l < i.length; l++)
9164
9164
  i[l].type.valid(e, i[l]) || i.splice(l--, 1);
9165
9165
  return new mt(i.length ? this.local.concat(i).sort(Kt) : this.local, s || this.children);
@@ -9212,7 +9212,7 @@ let U = class mt {
9212
9212
  }
9213
9213
  if (s) {
9214
9214
  let l = new mt(s.sort(Kt), hn);
9215
- return r ? new fu([l, r]) : l;
9215
+ return r ? new uu([l, r]) : l;
9216
9216
  }
9217
9217
  return r || ae;
9218
9218
  }
@@ -9258,7 +9258,7 @@ let U = class mt {
9258
9258
  U.empty = new U([], []);
9259
9259
  U.removeOverlap = Qo;
9260
9260
  const ae = U.empty;
9261
- let fu = class pn {
9261
+ let uu = class pn {
9262
9262
  constructor(e) {
9263
9263
  this.members = e;
9264
9264
  }
@@ -9365,7 +9365,7 @@ function zp(n, e, t, r, s, o, i) {
9365
9365
  }
9366
9366
  return new U(e.sort(Kt), l);
9367
9367
  }
9368
- function du(n, e) {
9368
+ function fu(n, e) {
9369
9369
  if (!e || !n.length)
9370
9370
  return n;
9371
9371
  let t = [];
@@ -9388,7 +9388,7 @@ function jp(n, e, t, r, s, o, i) {
9388
9388
  n[a + 1] == -1 && l(n[a + 2], e[a] + o + 1);
9389
9389
  return t;
9390
9390
  }
9391
- function hu(n, e, t) {
9391
+ function du(n, e, t) {
9392
9392
  if (e.isLeaf)
9393
9393
  return null;
9394
9394
  let r = t + e.nodeSize, s = null;
@@ -9396,7 +9396,7 @@ function hu(n, e, t) {
9396
9396
  (i = n[o]) && i.from > t && i.to < r && ((s || (s = [])).push(i), n[o] = null);
9397
9397
  return s;
9398
9398
  }
9399
- function pu(n) {
9399
+ function hu(n) {
9400
9400
  let e = [];
9401
9401
  for (let t = 0; t < n.length; t++)
9402
9402
  n[t] != null && e.push(n[t]);
@@ -9405,14 +9405,14 @@ function pu(n) {
9405
9405
  function Kr(n, e, t, r) {
9406
9406
  let s = [], o = !1;
9407
9407
  e.forEach((l, a) => {
9408
- let c = hu(n, l, a + t);
9408
+ let c = du(n, l, a + t);
9409
9409
  if (c) {
9410
9410
  o = !0;
9411
9411
  let u = Kr(c, l, t + a + 1, r);
9412
9412
  u != ae && s.push(a, a + l.nodeSize, u);
9413
9413
  }
9414
9414
  });
9415
- let i = du(o ? pu(n) : n, -t).sort(Kt);
9415
+ let i = fu(o ? hu(n) : n, -t).sort(Kt);
9416
9416
  for (let l = 0; l < i.length; l++)
9417
9417
  i[l].type.valid(e, i[l]) || (r.onRemove && r.onRemove(i[l].spec), i.splice(l--, 1));
9418
9418
  return i.length || s.length ? new U(i, s) : ae;
@@ -9428,17 +9428,17 @@ function Qo(n) {
9428
9428
  for (let s = t + 1; s < e.length; s++) {
9429
9429
  let o = e[s];
9430
9430
  if (o.from == r.from) {
9431
- o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), El(e, s + 1, o.copy(r.to, o.to)));
9431
+ o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), Ol(e, s + 1, o.copy(r.to, o.to)));
9432
9432
  continue;
9433
9433
  } else {
9434
- o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), El(e, s, r.copy(o.from, r.to)));
9434
+ o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), Ol(e, s, r.copy(o.from, r.to)));
9435
9435
  break;
9436
9436
  }
9437
9437
  }
9438
9438
  }
9439
9439
  return e;
9440
9440
  }
9441
- function El(n, e, t) {
9441
+ function Ol(n, e, t) {
9442
9442
  for (; e < n.length && Kt(t, n[e]) > 0; )
9443
9443
  e++;
9444
9444
  n.splice(e, 0, t);
@@ -9448,7 +9448,7 @@ function Ls(n) {
9448
9448
  return n.someProp("decorations", (t) => {
9449
9449
  let r = t(n.state);
9450
9450
  r && r != ae && e.push(r);
9451
- }), n.cursorWrapper && e.push(U.create(n.state.doc, [n.cursorWrapper.deco])), fu.from(e);
9451
+ }), n.cursorWrapper && e.push(U.create(n.state.doc, [n.cursorWrapper.deco])), uu.from(e);
9452
9452
  }
9453
9453
  const Fp = {
9454
9454
  childList: !0,
@@ -9515,7 +9515,7 @@ class Wp {
9515
9515
  this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
9516
9516
  }
9517
9517
  onSelectionChange() {
9518
- if (xl(this.view)) {
9518
+ if (bl(this.view)) {
9519
9519
  if (this.suppressingSelectionUpdates)
9520
9520
  return at(this.view);
9521
9521
  if (ke && Ot <= 11 && !this.view.state.selection.empty) {
@@ -9559,7 +9559,7 @@ class Wp {
9559
9559
  return;
9560
9560
  let t = this.pendingRecords();
9561
9561
  t.length && (this.queue = []);
9562
- let r = e.domSelectionRange(), s = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && xl(e) && !this.ignoreSelectionChange(r), o = -1, i = -1, l = !1, a = [];
9562
+ let r = e.domSelectionRange(), s = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && bl(e) && !this.ignoreSelectionChange(r), o = -1, i = -1, l = !1, a = [];
9563
9563
  if (e.editable)
9564
9564
  for (let u = 0; u < t.length; u++) {
9565
9565
  let f = this.registerMutation(t[u], a);
@@ -9614,15 +9614,15 @@ class Wp {
9614
9614
  });
9615
9615
  }
9616
9616
  }
9617
- let Tl = /* @__PURE__ */ new WeakMap(), Al = !1;
9617
+ let El = /* @__PURE__ */ new WeakMap(), Tl = !1;
9618
9618
  function _p(n) {
9619
- if (!Tl.has(n) && (Tl.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
9620
- if (n.requiresGeckoHackNode = je, Al)
9619
+ if (!El.has(n) && (El.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
9620
+ if (n.requiresGeckoHackNode = je, Tl)
9621
9621
  return;
9622
- console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Al = !0;
9622
+ console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Tl = !0;
9623
9623
  }
9624
9624
  }
9625
- function Rl(n, e) {
9625
+ function Al(n, e) {
9626
9626
  let t = e.startContainer, r = e.startOffset, s = e.endContainer, o = e.endOffset, i = n.domAtPos(n.state.selection.anchor);
9627
9627
  return Zt(i.node, i.offset, s, o) && ([t, r, s, o] = [s, o, t, r]), { anchorNode: t, anchorOffset: r, focusNode: s, focusOffset: o };
9628
9628
  }
@@ -9630,13 +9630,13 @@ function qp(n, e) {
9630
9630
  if (e.getComposedRanges) {
9631
9631
  let s = e.getComposedRanges(n.root)[0];
9632
9632
  if (s)
9633
- return Rl(n, s);
9633
+ return Al(n, s);
9634
9634
  }
9635
9635
  let t;
9636
9636
  function r(s) {
9637
9637
  s.preventDefault(), s.stopImmediatePropagation(), t = s.getTargetRanges()[0];
9638
9638
  }
9639
- return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Rl(n, t) : null;
9639
+ return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Al(n, t) : null;
9640
9640
  }
9641
9641
  function Hp(n, e) {
9642
9642
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
@@ -9716,7 +9716,7 @@ function Yp(n, e, t, r, s) {
9716
9716
  p = { start: a.from, endA: a.to, endB: a.to };
9717
9717
  else {
9718
9718
  if (c.sel) {
9719
- let D = Il(n, n.state.doc, c.sel);
9719
+ let D = Rl(n, n.state.doc, c.sel);
9720
9720
  if (D && !D.eq(n.state.selection)) {
9721
9721
  let L = n.state.tr.setSelection(D);
9722
9722
  o && L.setMeta("composition", o), n.dispatch(L);
@@ -9756,12 +9756,12 @@ function Yp(n, e, t, r, s) {
9756
9756
  }
9757
9757
  }
9758
9758
  if (R || (R = n.state.tr.replace(P, z, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
9759
- let D = Il(n, R.doc, c.sel);
9759
+ let D = Rl(n, R.doc, c.sel);
9760
9760
  D && !(ue && n.composing && D.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (D.head == P || D.head == R.mapping.map(z) - 1) || ke && D.empty && D.head == P) && R.setSelection(D);
9761
9761
  }
9762
9762
  B && R.ensureMarks(B), o && R.setMeta("composition", o), n.dispatch(R.scrollIntoView());
9763
9763
  }
9764
- function Il(n, e, t) {
9764
+ function Rl(n, e, t) {
9765
9765
  return Math.max(t.anchor, t.head) > e.content.size ? null : Uo(n, e.resolve(t.anchor), e.resolve(t.head));
9766
9766
  }
9767
9767
  function Gp(n, e) {
@@ -9821,14 +9821,14 @@ function Qp(n, e, t, r, s) {
9821
9821
  }
9822
9822
  if (i < o && n.size < e.size) {
9823
9823
  let a = r <= o && r >= i ? o - r : 0;
9824
- o -= a, o && o < e.size && Pl(e.textBetween(o - 1, o + 1)) && (o += a ? 1 : -1), l = o + (l - i), i = o;
9824
+ o -= a, o && o < e.size && Il(e.textBetween(o - 1, o + 1)) && (o += a ? 1 : -1), l = o + (l - i), i = o;
9825
9825
  } else if (l < o) {
9826
9826
  let a = r <= o && r >= l ? o - r : 0;
9827
- o -= a, o && o < n.size && Pl(n.textBetween(o - 1, o + 1)) && (o += a ? 1 : -1), i = o + (i - l), l = o;
9827
+ o -= a, o && o < n.size && Il(n.textBetween(o - 1, o + 1)) && (o += a ? 1 : -1), i = o + (i - l), l = o;
9828
9828
  }
9829
9829
  return { start: o, endA: i, endB: l };
9830
9830
  }
9831
- function Pl(n) {
9831
+ function Il(n) {
9832
9832
  if (n.length != 2)
9833
9833
  return !1;
9834
9834
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
@@ -9843,7 +9843,7 @@ class Zp {
9843
9843
  added to the document.
9844
9844
  */
9845
9845
  constructor(e, t) {
9846
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new yp(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(jl), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = $l(this), Vl(this), this.nodeViews = zl(this), this.docView = hl(this.state.doc, vl(this), Ls(this), this.dom, this), this.domObserver = new Wp(this, (r, s, o, i) => Yp(this, r, s, o, i)), this.domObserver.start(), bp(this), this.updatePluginViews();
9846
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new yp(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(zl), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Vl(this), vl(this), this.nodeViews = $l(this), this.docView = dl(this.state.doc, Pl(this), Ls(this), this.dom, this), this.domObserver = new Wp(this, (r, s, o, i) => Yp(this, r, s, o, i)), this.domObserver.start(), bp(this), this.updatePluginViews();
9847
9847
  }
9848
9848
  /**
9849
9849
  Holds `true` when a
@@ -9873,7 +9873,7 @@ class Zp {
9873
9873
  update(e) {
9874
9874
  e.handleDOMEvents != this._props.handleDOMEvents && bo(this);
9875
9875
  let t = this._props;
9876
- this._props = e, e.plugins && (e.plugins.forEach(jl), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9876
+ this._props = e, e.plugins && (e.plugins.forEach(zl), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9877
9877
  }
9878
9878
  /**
9879
9879
  Update the view by updating existing props object with the object
@@ -9899,14 +9899,14 @@ class Zp {
9899
9899
  updateStateInner(e, t) {
9900
9900
  var r;
9901
9901
  let s = this.state, o = !1, i = !1;
9902
- e.storedMarks && this.composing && (ou(this), i = !0), this.state = e;
9902
+ e.storedMarks && this.composing && (su(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 h = zl(this);
9905
+ let h = $l(this);
9906
9906
  tm(h, this.nodeViews) && (this.nodeViews = h, o = !0);
9907
9907
  }
9908
- (l || t.handleDOMEvents != this._props.handleDOMEvents) && bo(this), this.editable = $l(this), Vl(this);
9909
- let a = Ls(this), c = vl(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);
9908
+ (l || t.handleDOMEvents != this._props.handleDOMEvents) && bo(this), this.editable = Vl(this), vl(this);
9909
+ let a = Ls(this), c = Pl(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);
9910
9910
  (f || !e.selection.eq(s.selection)) && (i = !0);
9911
9911
  let d = u == "preserve" && i && this.dom.style.overflowAnchor == null && Ih(this);
9912
9912
  if (i) {
@@ -9914,9 +9914,9 @@ class Zp {
9914
9914
  let h = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && em(s.selection, e.selection);
9915
9915
  if (f) {
9916
9916
  let p = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
9917
- this.composing && (this.input.compositionNode = Rp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = hl(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9917
+ this.composing && (this.input.compositionNode = Rp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = dl(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9918
9918
  }
9919
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && np(this)) ? at(this, h) : (Jc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9919
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && np(this)) ? at(this, h) : (Hc(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 && Ph(d);
9922
9922
  }
@@ -9927,9 +9927,9 @@ class Zp {
9927
9927
  let e = this.domSelectionRange().focusNode;
9928
9928
  if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof w) {
9929
9929
  let t = this.docView.domAfterPos(this.state.selection.from);
9930
- t.nodeType == 1 && ll(this, t.getBoundingClientRect(), e);
9930
+ t.nodeType == 1 && il(this, t.getBoundingClientRect(), e);
9931
9931
  } else
9932
- ll(this, this.coordsAtPos(this.state.selection.head, 1), e);
9932
+ il(this, this.coordsAtPos(this.state.selection.head, 1), e);
9933
9933
  }
9934
9934
  destroyPluginViews() {
9935
9935
  let e;
@@ -9961,7 +9961,7 @@ class Zp {
9961
9961
  let o = r.from + (this.state.doc.content.size - t.doc.content.size);
9962
9962
  (o > 0 && this.state.doc.nodeAt(o)) == r.node && (s = o);
9963
9963
  }
9964
- this.dragging = new lu(e.slice, e.move, s < 0 ? void 0 : w.create(this.state.doc, s));
9964
+ this.dragging = new iu(e.slice, e.move, s < 0 ? void 0 : w.create(this.state.doc, s));
9965
9965
  }
9966
9966
  someProp(e, t) {
9967
9967
  let r = this._props && this._props[e], s;
@@ -10048,7 +10048,7 @@ class Zp {
10048
10048
  otherwise the element after.
10049
10049
  */
10050
10050
  coordsAtPos(e, t = 1) {
10051
- return Vc(this, e, t);
10051
+ return vc(this, e, t);
10052
10052
  }
10053
10053
  /**
10054
10054
  Find the DOM position that corresponds to the given document
@@ -10166,7 +10166,7 @@ class Zp {
10166
10166
  return this.root.getSelection();
10167
10167
  }
10168
10168
  }
10169
- function vl(n) {
10169
+ function Pl(n) {
10170
10170
  let e = /* @__PURE__ */ Object.create(null);
10171
10171
  return e.class = "ProseMirror", e.contenteditable = String(n.editable), n.someProp("attributes", (t) => {
10172
10172
  if (typeof t == "function" && (t = t(n.state)), t)
@@ -10174,21 +10174,21 @@ function vl(n) {
10174
10174
  r == "class" ? e.class += " " + t[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + t[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(t[r]));
10175
10175
  }), e.translate || (e.translate = "no"), [Be.node(0, n.state.doc.content.size, e)];
10176
10176
  }
10177
- function Vl(n) {
10177
+ function vl(n) {
10178
10178
  if (n.markCursor) {
10179
10179
  let e = document.createElement("img");
10180
10180
  e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: Be.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
10181
10181
  } else
10182
10182
  n.cursorWrapper = null;
10183
10183
  }
10184
- function $l(n) {
10184
+ function Vl(n) {
10185
10185
  return !n.someProp("editable", (e) => e(n.state) === !1);
10186
10186
  }
10187
10187
  function em(n, e) {
10188
10188
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
10189
10189
  return n.$anchor.start(t) != e.$anchor.start(t);
10190
10190
  }
10191
- function zl(n) {
10191
+ function $l(n) {
10192
10192
  let e = /* @__PURE__ */ Object.create(null);
10193
10193
  function t(r) {
10194
10194
  for (let s in r)
@@ -10207,7 +10207,7 @@ function tm(n, e) {
10207
10207
  r++;
10208
10208
  return t != r;
10209
10209
  }
10210
- function jl(n) {
10210
+ function zl(n) {
10211
10211
  if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
10212
10212
  throw new RangeError("Plugins passed directly to the view must not have a state component");
10213
10213
  }
@@ -10596,13 +10596,13 @@ function Nm({ rules: n }) {
10596
10596
  },
10597
10597
  props: {
10598
10598
  handleTextInput(t, r, s, o) {
10599
- return Fl(t, r, s, o, n, e);
10599
+ return jl(t, r, s, o, n, e);
10600
10600
  },
10601
10601
  handleDOMEvents: {
10602
10602
  compositionend: (t) => {
10603
10603
  setTimeout(() => {
10604
10604
  let { $cursor: r } = t.state.selection;
10605
- r && Fl(t, r.pos, r.pos, "", n, e);
10605
+ r && jl(t, r.pos, r.pos, "", n, e);
10606
10606
  });
10607
10607
  }
10608
10608
  }
@@ -10611,7 +10611,7 @@ function Nm({ rules: n }) {
10611
10611
  });
10612
10612
  return e;
10613
10613
  }
10614
- function Fl(n, e, t, r, s, o) {
10614
+ function jl(n, e, t, r, s, o) {
10615
10615
  if (n.composing)
10616
10616
  return !1;
10617
10617
  let i = n.state, l = i.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Mm), l.parentOffset, null, "") + r;
@@ -10661,21 +10661,21 @@ function ei(n, e, t = null, r) {
10661
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
- function mu(n, e, t = null) {
10664
+ function pu(n, e, t = null) {
10665
10665
  return new It(n, (r, s, o, i) => {
10666
10666
  let l = r.doc.resolve(o), a = t instanceof Function ? t(s) : t;
10667
10667
  return l.node(-1).canReplaceWith(l.index(-1), l.indexAfter(-1), e) ? r.tr.delete(o, i).setBlockType(o, o, e, a) : null;
10668
10668
  });
10669
10669
  }
10670
- const Bl = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
10670
+ const Fl = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
10671
10671
  function vm(n, e) {
10672
10672
  let t = {}, r;
10673
10673
  function s(o, i) {
10674
10674
  t[o] = i;
10675
10675
  }
10676
- if (s("Mod-z", Wo), s("Shift-Mod-z", Lr), s("Backspace", Dm), Bl || s("Mod-y", Lr), s("Alt-ArrowUp", wc), s("Alt-ArrowDown", ih), s("Mod-BracketLeft", oo), s("Escape", io), (r = n.marks.strong) && (s("Mod-b", Ce(r)), s("Mod-B", Ce(r))), (r = n.marks.em) && (s("Mod-i", Ce(r)), s("Mod-I", Ce(r))), (r = n.marks.code) && s("Mod-`", Ce(r)), (r = n.nodes.bullet_list) && s("Shift-Ctrl-8", Ur(r)), (r = n.nodes.ordered_list) && s("Shift-Ctrl-9", Ur(r)), (r = n.nodes.blockquote) && s("Ctrl->", Oc(r)), r = n.nodes.hard_break) {
10677
- let o = r, i = cs(Mc, (l, a) => (a && a(l.tr.replaceSelectionWith(o.create()).scrollIntoView()), !0));
10678
- s("Mod-Enter", i), s("Shift-Enter", i), Bl && s("Ctrl-Enter", i);
10676
+ if (s("Mod-z", Wo), s("Shift-Mod-z", Lr), s("Backspace", Dm), Fl || s("Mod-y", Lr), s("Alt-ArrowUp", Cc), s("Alt-ArrowDown", ih), s("Mod-BracketLeft", oo), s("Escape", io), (r = n.marks.strong) && (s("Mod-b", Ce(r)), s("Mod-B", Ce(r))), (r = n.marks.em) && (s("Mod-i", Ce(r)), s("Mod-I", Ce(r))), (r = n.marks.code) && s("Mod-`", Ce(r)), (r = n.nodes.bullet_list) && s("Shift-Ctrl-8", Ur(r)), (r = n.nodes.ordered_list) && s("Shift-Ctrl-9", Ur(r)), (r = n.nodes.blockquote) && s("Ctrl->", Dc(r)), r = n.nodes.hard_break) {
10677
+ let o = r, i = cs(wc, (l, a) => (a && a(l.tr.replaceSelectionWith(o.create()).scrollIntoView()), !0));
10678
+ s("Mod-Enter", i), s("Shift-Enter", i), Fl && s("Ctrl-Enter", i);
10679
10679
  }
10680
10680
  if ((r = n.nodes.list_item) && (s("Enter", bm(r)), s("Mod-[", xm(r)), s("Mod-]", Cm(r))), (r = n.nodes.paragraph) && s("Shift-Ctrl-0", Sn(r)), (r = n.nodes.code_block) && s("Shift-Ctrl-\\", Sn(r)), r = n.nodes.heading)
10681
10681
  for (let o = 1; o <= 6; o++)
@@ -10696,10 +10696,10 @@ function zm(n) {
10696
10696
  return ei(/^\s*([-+*])\s$/, n);
10697
10697
  }
10698
10698
  function jm(n) {
10699
- return mu(/^```$/, n);
10699
+ return pu(/^```$/, n);
10700
10700
  }
10701
10701
  function Fm(n, e) {
10702
- return mu(new RegExp("^(#{1," + e + "})\\s$"), n, (t) => ({ level: t[1].length }));
10702
+ return pu(new RegExp("^(#{1," + e + "})\\s$"), n, (t) => ({ level: t[1].length }));
10703
10703
  }
10704
10704
  function Bm(n) {
10705
10705
  let e = Pm.concat(Em, Om), t;
@@ -10762,10 +10762,10 @@ const lt = new At("ImagePluginKey"), Lm = (n) => new ut({
10762
10762
  for (var e = 0; ; e++)
10763
10763
  if (n = n.previousSibling, !n)
10764
10764
  return e;
10765
- }, gu = function(n, e, t, r) {
10766
- return t && (Ll(n, e, t, r, -1) || Ll(n, e, t, r, 1));
10765
+ }, mu = function(n, e, t, r) {
10766
+ return t && (Bl(n, e, t, r, -1) || Bl(n, e, t, r, 1));
10767
10767
  }, Hm = /^(img|br|input|textarea|hr)$/i;
10768
- function Ll(n, e, t, r, s) {
10768
+ function Bl(n, e, t, r, s) {
10769
10769
  for (; ; ) {
10770
10770
  if (n == t && e == r)
10771
10771
  return !0;
@@ -10801,16 +10801,16 @@ function ti(n) {
10801
10801
  ;
10802
10802
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
10803
10803
  }
10804
- const yu = function(n) {
10805
- return n.focusNode && gu(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
10804
+ const gu = function(n) {
10805
+ return n.focusNode && mu(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
10806
10806
  };
10807
- function bu(n, e) {
10807
+ function yu(n, e) {
10808
10808
  let t = document.createEvent("Event");
10809
10809
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
10810
10810
  }
10811
- const Ue = typeof navigator < "u" ? navigator : null, Wl = typeof document < "u" ? document : null, Pt = Ue && Ue.userAgent || "", So = /Edge\/(\d+)/.exec(Pt), xu = /MSIE \d/.exec(Pt), ko = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Pt), dr = !!(xu || ko || So), Su = xu ? document.documentMode : ko ? +ko[1] : So ? +So[1] : 0, ds = !dr && /gecko\/(\d+)/i.test(Pt);
10811
+ const Ue = typeof navigator < "u" ? navigator : null, Ll = typeof document < "u" ? document : null, Pt = Ue && Ue.userAgent || "", So = /Edge\/(\d+)/.exec(Pt), bu = /MSIE \d/.exec(Pt), ko = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Pt), dr = !!(bu || ko || So), xu = bu ? document.documentMode : ko ? +ko[1] : So ? +So[1] : 0, ds = !dr && /gecko\/(\d+)/i.test(Pt);
10812
10812
  ds && +(/Firefox\/(\d+)/.exec(Pt) || [0, 0])[1];
10813
- const Co = !dr && /Chrome\/(\d+)/.exec(Pt), vt = !!Co, ku = Co ? +Co[1] : 0, nn = !dr && !!Ue && /Apple Computer/.test(Ue.vendor), ni = nn && (/Mobile\/\w+/.test(Pt) || !!Ue && Ue.maxTouchPoints > 2), Ie = ni || (Ue ? /Mac/.test(Ue.platform) : !1), Km = Ue ? /Win/.test(Ue.platform) : !1, hr = /Android \d/.test(Pt), ri = !!Wl && "webkitFontSmoothing" in Wl.documentElement.style, Um = ri ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
10813
+ const Co = !dr && /Chrome\/(\d+)/.exec(Pt), vt = !!Co, Su = Co ? +Co[1] : 0, nn = !dr && !!Ue && /Apple Computer/.test(Ue.vendor), ni = nn && (/Mobile\/\w+/.test(Pt) || !!Ue && Ue.maxTouchPoints > 2), Ie = ni || (Ue ? /Mac/.test(Ue.platform) : !1), Km = Ue ? /Win/.test(Ue.platform) : !1, hr = /Android \d/.test(Pt), ri = !!Ll && "webkitFontSmoothing" in Ll.documentElement.style, Um = ri ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
10814
10814
  function Ym(n, e = null) {
10815
10815
  let t = n.domSelectionRange(), r = n.state.doc;
10816
10816
  if (!t.focusNode)
@@ -10819,7 +10819,7 @@ function Ym(n, e = null) {
10819
10819
  if (i < 0)
10820
10820
  return null;
10821
10821
  let l = r.resolve(i), a, c;
10822
- if (yu(t)) {
10822
+ if (gu(t)) {
10823
10823
  for (a = i; s && !s.node; )
10824
10824
  s = s.parent;
10825
10825
  let f = s.node;
@@ -10845,19 +10845,19 @@ function Ym(n, e = null) {
10845
10845
  let u = r.resolve(a);
10846
10846
  if (!c) {
10847
10847
  let f = e == "pointer" || n.state.selection.head < l.pos && !o ? 1 : -1;
10848
- c = wu(n, u, l, f);
10848
+ c = Cu(n, u, l, f);
10849
10849
  }
10850
10850
  return c;
10851
10851
  }
10852
- function Cu(n) {
10852
+ function ku(n) {
10853
10853
  return n.editable ? n.hasFocus() : Zm(n) && document.activeElement && document.activeElement.contains(n.dom);
10854
10854
  }
10855
10855
  function si(n, e = !1) {
10856
10856
  let t = n.state.selection;
10857
- if (Qm(n, t), !!Cu(n)) {
10857
+ if (Qm(n, t), !!ku(n)) {
10858
10858
  if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && vt) {
10859
10859
  let r = n.domSelectionRange(), s = n.domObserver.currentSelection;
10860
- if (r.anchorNode && s.anchorNode && gu(r.anchorNode, r.anchorOffset, s.anchorNode, s.anchorOffset)) {
10860
+ if (r.anchorNode && s.anchorNode && mu(r.anchorNode, r.anchorOffset, s.anchorNode, s.anchorOffset)) {
10861
10861
  n.input.mouseDown.delayedSelectionSync = !0, n.domObserver.setCurSelection();
10862
10862
  return;
10863
10863
  }
@@ -10866,13 +10866,13 @@ function si(n, e = !1) {
10866
10866
  Xm(n);
10867
10867
  else {
10868
10868
  let { anchor: r, head: s } = t, o, i;
10869
- _l && !(t instanceof V) && (t.$from.parent.inlineContent || (o = ql(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (i = ql(n, t.to))), n.docView.setSelection(r, s, n, e), _l && (o && Hl(o), i && Hl(i)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Gm(n));
10869
+ Wl && !(t instanceof V) && (t.$from.parent.inlineContent || (o = _l(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (i = _l(n, t.to))), n.docView.setSelection(r, s, n, e), Wl && (o && ql(o), i && ql(i)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Gm(n));
10870
10870
  }
10871
10871
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
10872
10872
  }
10873
10873
  }
10874
- const _l = nn || vt && ku < 63;
10875
- function ql(n, e) {
10874
+ const Wl = nn || vt && Su < 63;
10875
+ function _l(n, e) {
10876
10876
  let { node: t, offset: r } = n.docView.domFromPos(e, 0), s = r < t.childNodes.length ? t.childNodes[r] : null, o = r ? t.childNodes[r - 1] : null;
10877
10877
  if (nn && s && s.contentEditable == "false")
10878
10878
  return qs(s);
@@ -10886,7 +10886,7 @@ function ql(n, e) {
10886
10886
  function qs(n) {
10887
10887
  return n.contentEditable = "true", nn && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
10888
10888
  }
10889
- function Hl(n) {
10889
+ function ql(n) {
10890
10890
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
10891
10891
  }
10892
10892
  function Gm(n) {
@@ -10895,7 +10895,7 @@ function Gm(n) {
10895
10895
  let t = n.domSelectionRange(), r = t.anchorNode, s = t.anchorOffset;
10896
10896
  e.addEventListener("selectionchange", n.input.hideSelectionGuard = () => {
10897
10897
  (t.anchorNode != r || t.anchorOffset != s) && (e.removeEventListener("selectionchange", n.input.hideSelectionGuard), setTimeout(() => {
10898
- (!Cu(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
10898
+ (!ku(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
10899
10899
  }, 20));
10900
10900
  });
10901
10901
  }
@@ -10904,19 +10904,19 @@ function Xm(n) {
10904
10904
  if (!e)
10905
10905
  return;
10906
10906
  let r = n.cursorWrapper.dom, s = r.nodeName == "IMG";
10907
- s ? t.setStart(r.parentNode, tn(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !s && !n.state.selection.visible && dr && Su <= 11 && (r.disabled = !0, r.disabled = !1);
10907
+ s ? t.setStart(r.parentNode, tn(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !s && !n.state.selection.visible && dr && xu <= 11 && (r.disabled = !0, r.disabled = !1);
10908
10908
  }
10909
10909
  function Qm(n, e) {
10910
10910
  if (e instanceof w) {
10911
10911
  let t = n.docView.descAt(e.from);
10912
- t != n.lastSelectedViewDesc && (Jl(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
10912
+ t != n.lastSelectedViewDesc && (Hl(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
10913
10913
  } else
10914
- Jl(n);
10914
+ Hl(n);
10915
10915
  }
10916
- function Jl(n) {
10916
+ function Hl(n) {
10917
10917
  n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
10918
10918
  }
10919
- function wu(n, e, t, r) {
10919
+ function Cu(n, e, t, r) {
10920
10920
  return n.someProp("createSelectionBetween", (s) => s(n, e, t)) || V.between(e, t, r);
10921
10921
  }
10922
10922
  function Zm(n) {
@@ -10936,7 +10936,7 @@ function wo(n, e) {
10936
10936
  function bt(n, e) {
10937
10937
  return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
10938
10938
  }
10939
- function Kl(n, e, t) {
10939
+ function Jl(n, e, t) {
10940
10940
  let r = n.state.selection;
10941
10941
  if (r instanceof V)
10942
10942
  if (t.indexOf("s") > -1) {
@@ -10995,7 +10995,7 @@ function eg(n) {
10995
10995
  break;
10996
10996
  }
10997
10997
  } else {
10998
- if (Mu(t))
10998
+ if (wu(t))
10999
10999
  break;
11000
11000
  {
11001
11001
  let l = t.previousSibling;
@@ -11027,7 +11027,7 @@ function tg(n) {
11027
11027
  else
11028
11028
  break;
11029
11029
  } else {
11030
- if (Mu(t))
11030
+ if (wu(t))
11031
11031
  break;
11032
11032
  {
11033
11033
  let l = t.nextSibling;
@@ -11044,7 +11044,7 @@ function tg(n) {
11044
11044
  }
11045
11045
  o && Mo(n, o, i);
11046
11046
  }
11047
- function Mu(n) {
11047
+ function wu(n) {
11048
11048
  let e = n.pmViewDesc;
11049
11049
  return e && e.node && e.node.isBlock;
11050
11050
  }
@@ -11080,7 +11080,7 @@ function Mo(n, e, t) {
11080
11080
  let r = n.domSelection();
11081
11081
  if (!r)
11082
11082
  return;
11083
- if (yu(r)) {
11083
+ if (gu(r)) {
11084
11084
  let o = document.createRange();
11085
11085
  o.setEnd(e, t), o.setStart(e, t), r.removeAllRanges(), r.addRange(o);
11086
11086
  } else r.extend && r.extend(e, t);
@@ -11090,7 +11090,7 @@ function Mo(n, e, t) {
11090
11090
  n.state == s && si(n);
11091
11091
  }, 50);
11092
11092
  }
11093
- function Ul(n, e) {
11093
+ function Kl(n, e) {
11094
11094
  let t = n.state.doc.resolve(e);
11095
11095
  if (!(vt || Km) && t.parent.inlineContent) {
11096
11096
  let s = n.coordsAtPos(e);
@@ -11107,7 +11107,7 @@ function Ul(n, e) {
11107
11107
  }
11108
11108
  return getComputedStyle(n.dom).direction == "rtl" ? "rtl" : "ltr";
11109
11109
  }
11110
- function Yl(n, e, t) {
11110
+ function Ul(n, e, t) {
11111
11111
  let r = n.state.selection;
11112
11112
  if (r instanceof V && !r.empty || t.indexOf("s") > -1 || Ie && t.indexOf("m") > -1)
11113
11113
  return !1;
@@ -11123,7 +11123,7 @@ function Yl(n, e, t) {
11123
11123
  }
11124
11124
  return !1;
11125
11125
  }
11126
- function Gl(n, e) {
11126
+ function Yl(n, e) {
11127
11127
  if (!(n.state.selection instanceof V))
11128
11128
  return !0;
11129
11129
  let { $head: t, $anchor: r, empty: s } = n.state.selection;
@@ -11140,7 +11140,7 @@ function Gl(n, e) {
11140
11140
  }
11141
11141
  return !1;
11142
11142
  }
11143
- function Xl(n, e, t) {
11143
+ function Gl(n, e, t) {
11144
11144
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
11145
11145
  }
11146
11146
  function sg(n) {
@@ -11149,7 +11149,7 @@ function sg(n) {
11149
11149
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
11150
11150
  if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
11151
11151
  let r = e.firstChild;
11152
- Xl(n, r, "true"), setTimeout(() => Xl(n, r, "false"), 20);
11152
+ Gl(n, r, "true"), setTimeout(() => Gl(n, r, "false"), 20);
11153
11153
  }
11154
11154
  return !1;
11155
11155
  }
@@ -11160,28 +11160,28 @@ function og(n) {
11160
11160
  function ig(n, e) {
11161
11161
  let t = e.keyCode, r = og(e);
11162
11162
  if (t == 8 || Ie && t == 72 && r == "c")
11163
- return Gl(n, -1) || un(n, -1);
11163
+ return Yl(n, -1) || un(n, -1);
11164
11164
  if (t == 46 && !e.shiftKey || Ie && t == 68 && r == "c")
11165
- return Gl(n, 1) || un(n, 1);
11165
+ return Yl(n, 1) || un(n, 1);
11166
11166
  if (t == 13 || t == 27)
11167
11167
  return !0;
11168
11168
  if (t == 37 || Ie && t == 66 && r == "c") {
11169
- let s = t == 37 ? Ul(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
11170
- return Kl(n, s, r) || un(n, s);
11169
+ let s = t == 37 ? Kl(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
11170
+ return Jl(n, s, r) || un(n, s);
11171
11171
  } else if (t == 39 || Ie && t == 70 && r == "c") {
11172
- let s = t == 39 ? Ul(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
11173
- return Kl(n, s, r) || un(n, s);
11172
+ let s = t == 39 ? Kl(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
11173
+ return Jl(n, s, r) || un(n, s);
11174
11174
  } else {
11175
11175
  if (t == 38 || Ie && t == 80 && r == "c")
11176
- return Yl(n, -1, r) || un(n, -1);
11176
+ return Ul(n, -1, r) || un(n, -1);
11177
11177
  if (t == 40 || Ie && t == 78 && r == "c")
11178
- return sg(n) || Yl(n, 1, r) || un(n, 1);
11178
+ return sg(n) || Ul(n, 1, r) || un(n, 1);
11179
11179
  if (r == (Ie ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
11180
11180
  return !0;
11181
11181
  }
11182
11182
  return !1;
11183
11183
  }
11184
- function Nu(n, e) {
11184
+ function Mu(n, e) {
11185
11185
  n.someProp("transformCopied", (h) => {
11186
11186
  e = h(e, n);
11187
11187
  });
@@ -11191,10 +11191,10 @@ function Nu(n, e) {
11191
11191
  let h = r.firstChild;
11192
11192
  t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
11193
11193
  }
11194
- let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = Ru(), a = l.createElement("div");
11194
+ let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = Au(), a = l.createElement("div");
11195
11195
  a.appendChild(i.serializeFragment(r, { document: l }));
11196
11196
  let c = a.firstChild, u, f = 0;
11197
- for (; c && c.nodeType == 1 && (u = Au[c.nodeName.toLowerCase()]); ) {
11197
+ for (; c && c.nodeType == 1 && (u = Tu[c.nodeName.toLowerCase()]); ) {
11198
11198
  for (let h = u.length - 1; h >= 0; h--) {
11199
11199
  let p = l.createElement(u[h]);
11200
11200
  for (; a.firstChild; )
@@ -11209,7 +11209,7 @@ function Nu(n, e) {
11209
11209
  `);
11210
11210
  return { dom: a, text: d, slice: e };
11211
11211
  }
11212
- function Du(n, e, t, r, s) {
11212
+ function Nu(n, e, t, r, s) {
11213
11213
  let o = s.parent.type.spec.code, i, l;
11214
11214
  if (!t && !e)
11215
11215
  return null;
@@ -11251,14 +11251,14 @@ function Du(n, e, t, r, s) {
11251
11251
  return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !lg.test(d.parentNode.nodeName) ? { ignore: !0 } : null;
11252
11252
  }
11253
11253
  })), u)
11254
- l = dg(Ql(l, +u[1], +u[2]), u[4]);
11254
+ l = dg(Xl(l, +u[1], +u[2]), u[4]);
11255
11255
  else if (l = C.maxOpen(ag(l.content, s), !0), l.openStart || l.openEnd) {
11256
11256
  let f = 0, d = 0;
11257
11257
  for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
11258
11258
  ;
11259
11259
  for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
11260
11260
  ;
11261
- l = Ql(l, f, d);
11261
+ l = Xl(l, f, d);
11262
11262
  }
11263
11263
  return n.someProp("transformPasted", (f) => {
11264
11264
  l = f(l, n);
@@ -11276,11 +11276,11 @@ function ag(n, e) {
11276
11276
  let a = s.findWrapping(l.type), c;
11277
11277
  if (!a)
11278
11278
  return i = null;
11279
- if (c = i.length && o.length && Eu(a, o, l, i[i.length - 1], 0))
11279
+ if (c = i.length && o.length && Ou(a, o, l, i[i.length - 1], 0))
11280
11280
  i[i.length - 1] = c;
11281
11281
  else {
11282
- i.length && (i[i.length - 1] = Tu(i[i.length - 1], o.length));
11283
- let u = Ou(l, a);
11282
+ i.length && (i[i.length - 1] = Eu(i[i.length - 1], o.length));
11283
+ let u = Du(l, a);
11284
11284
  i.push(u), s = s.matchType(u.type), o = a;
11285
11285
  }
11286
11286
  }), i)
@@ -11288,34 +11288,34 @@ function ag(n, e) {
11288
11288
  }
11289
11289
  return n;
11290
11290
  }
11291
- function Ou(n, e, t = 0) {
11291
+ function Du(n, e, t = 0) {
11292
11292
  for (let r = e.length - 1; r >= t; r--)
11293
11293
  n = e[r].create(null, S.from(n));
11294
11294
  return n;
11295
11295
  }
11296
- function Eu(n, e, t, r, s) {
11296
+ function Ou(n, e, t, r, s) {
11297
11297
  if (s < n.length && s < e.length && n[s] == e[s]) {
11298
- let o = Eu(n, e, t, r.lastChild, s + 1);
11298
+ let o = Ou(n, e, t, r.lastChild, s + 1);
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(S.from(Ou(t, n, s + 1))));
11302
+ return r.copy(r.content.append(S.from(Du(t, n, s + 1))));
11303
11303
  }
11304
11304
  }
11305
- function Tu(n, e) {
11305
+ function Eu(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(S.empty, !0);
11308
+ let t = n.content.replaceChild(n.childCount - 1, Eu(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 No(n, e, t, r, s, o) {
11312
11312
  let i = e < 0 ? n.firstChild : n.lastChild, l = i.content;
11313
11313
  return n.childCount > 1 && (o = 0), s < r - 1 && (l = No(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
- function Ql(n, e, t) {
11315
+ function Xl(n, e, t) {
11316
11316
  return e < n.openStart && (n = new C(No(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new C(No(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
11317
11317
  }
11318
- const Au = {
11318
+ const Tu = {
11319
11319
  thead: ["table"],
11320
11320
  tbody: ["table"],
11321
11321
  tfoot: ["table"],
@@ -11326,9 +11326,9 @@ const Au = {
11326
11326
  td: ["table", "tbody", "tr"],
11327
11327
  th: ["table", "tbody", "tr"]
11328
11328
  };
11329
- let Zl = null;
11330
- function Ru() {
11331
- return Zl || (Zl = document.implementation.createHTMLDocument("title"));
11329
+ let Ql = null;
11330
+ function Au() {
11331
+ return Ql || (Ql = document.implementation.createHTMLDocument("title"));
11332
11332
  }
11333
11333
  let Hs = null;
11334
11334
  function cg(n) {
@@ -11338,8 +11338,8 @@ function cg(n) {
11338
11338
  function ug(n) {
11339
11339
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
11340
11340
  e && (n = n.slice(e[0].length));
11341
- let t = Ru().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), s;
11342
- if ((s = r && Au[r[1].toLowerCase()]) && (n = s.map((o) => "<" + o + ">").join("") + n + s.map((o) => "</" + o + ">").reverse().join("")), t.innerHTML = cg(n), s)
11341
+ let t = Au().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), s;
11342
+ if ((s = r && Tu[r[1].toLowerCase()]) && (n = s.map((o) => "<" + o + ">").join("") + n + s.map((o) => "</" + o + ">").reverse().join("")), t.innerHTML = cg(n), s)
11343
11343
  for (let o = 0; o < s.length; o++)
11344
11344
  t = t.querySelector(s[o]) || t;
11345
11345
  return t;
@@ -11375,11 +11375,11 @@ function Mt(n, e) {
11375
11375
  }
11376
11376
  De.keydown = (n, e) => {
11377
11377
  let t = e;
11378
- if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Pu(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(hr && vt && t.keyCode == 13)))
11378
+ if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Iu(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(hr && vt && t.keyCode == 13)))
11379
11379
  if (t.keyCode != 229 && n.domObserver.forceFlush(), ni && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
11380
11380
  let r = Date.now();
11381
11381
  n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
11382
- n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (s) => s(n, bu(13, "Enter"))), n.input.lastIOSEnter = 0);
11382
+ n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (s) => s(n, yu(13, "Enter"))), n.input.lastIOSEnter = 0);
11383
11383
  }, 200);
11384
11384
  } else n.someProp("handleKeyDown", (r) => r(n, t)) || ig(n, t) ? t.preventDefault() : Mt(n, "key");
11385
11385
  };
@@ -11388,7 +11388,7 @@ De.keyup = (n, e) => {
11388
11388
  };
11389
11389
  De.keypress = (n, e) => {
11390
11390
  let t = e;
11391
- if (Pu(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Ie && t.metaKey)
11391
+ if (Iu(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Ie && t.metaKey)
11392
11392
  return;
11393
11393
  if (n.someProp("handleKeyPress", (s) => s(n, t))) {
11394
11394
  t.preventDefault();
@@ -11473,18 +11473,18 @@ function xg(n, e, t) {
11473
11473
  function ii(n) {
11474
11474
  return Xr(n);
11475
11475
  }
11476
- const Iu = Ie ? "metaKey" : "ctrlKey";
11476
+ const Ru = Ie ? "metaKey" : "ctrlKey";
11477
11477
  Le.mousedown = (n, e) => {
11478
11478
  let t = e;
11479
11479
  n.input.shiftKey = t.shiftKey;
11480
11480
  let r = ii(n), s = Date.now(), o = "singleClick";
11481
- s - n.input.lastClick.time < 500 && hg(t, n.input.lastClick) && !t[Iu] && (n.input.lastClick.type == "singleClick" ? o = "doubleClick" : n.input.lastClick.type == "doubleClick" && (o = "tripleClick")), n.input.lastClick = { time: s, x: t.clientX, y: t.clientY, type: o };
11481
+ s - n.input.lastClick.time < 500 && hg(t, n.input.lastClick) && !t[Ru] && (n.input.lastClick.type == "singleClick" ? o = "doubleClick" : n.input.lastClick.type == "doubleClick" && (o = "tripleClick")), n.input.lastClick = { time: s, x: t.clientX, y: t.clientY, type: o };
11482
11482
  let i = n.posAtCoords(hs(t));
11483
11483
  i && (o == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Sg(n, i, t, !!r)) : (o == "doubleClick" ? yg : bg)(n, i.pos, i.inside, t) ? t.preventDefault() : Mt(n, "pointer"));
11484
11484
  };
11485
11485
  class Sg {
11486
11486
  constructor(e, t, r, s) {
11487
- this.view = e, this.pos = t, this.event = r, this.flushed = s, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Iu], this.allowDefault = r.shiftKey;
11487
+ this.view = e, this.pos = t, this.event = r, this.flushed = s, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Ru], this.allowDefault = r.shiftKey;
11488
11488
  let o, i;
11489
11489
  if (t.inside > -1)
11490
11490
  o = e.state.doc.nodeAt(t.inside), i = t.inside;
@@ -11535,7 +11535,7 @@ Le.touchmove = (n) => {
11535
11535
  n.input.lastTouch = Date.now(), Mt(n, "pointer");
11536
11536
  };
11537
11537
  Le.contextmenu = (n) => ii(n);
11538
- function Pu(n, e) {
11538
+ function Iu(n, e) {
11539
11539
  return n.composing ? !0 : nn && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
11540
11540
  }
11541
11541
  const kg = hr ? 5e3 : -1;
@@ -11561,12 +11561,12 @@ De.compositionstart = De.compositionupdate = (n) => {
11561
11561
  }
11562
11562
  n.input.composing = !0;
11563
11563
  }
11564
- vu(n, kg);
11564
+ Pu(n, kg);
11565
11565
  };
11566
11566
  De.compositionend = (n, e) => {
11567
- n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, vu(n, 20));
11567
+ n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Pu(n, 20));
11568
11568
  };
11569
- function vu(n, e) {
11569
+ function Pu(n, e) {
11570
11570
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Xr(n), e));
11571
11571
  }
11572
11572
  function Cg(n) {
@@ -11596,12 +11596,12 @@ function Mg(n, e) {
11596
11596
  t.parentNode && t.parentNode.removeChild(t), n.focus();
11597
11597
  }, 50);
11598
11598
  }
11599
- const er = dr && Su < 15 || ni && Um < 604;
11599
+ const er = dr && xu < 15 || ni && Um < 604;
11600
11600
  Le.copy = De.cut = (n, e) => {
11601
11601
  let t = e, r = n.state.selection, s = t.type == "cut";
11602
11602
  if (r.empty)
11603
11603
  return;
11604
- let o = er ? null : t.clipboardData, i = r.content(), { dom: l, text: a } = Nu(n, i);
11604
+ let o = er ? null : t.clipboardData, i = r.content(), { dom: l, text: a } = Mu(n, i);
11605
11605
  o ? (t.preventDefault(), o.clearData(), o.setData("text/html", l.innerHTML), o.setData("text/plain", a)) : Mg(n, l), s && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
11606
11606
  };
11607
11607
  function Ng(n) {
@@ -11618,7 +11618,7 @@ function Dg(n, e) {
11618
11618
  }, 50);
11619
11619
  }
11620
11620
  function Do(n, e, t, r, s) {
11621
- let o = Du(n, e, t, r, n.state.selection.$from);
11621
+ let o = Nu(n, e, t, r, n.state.selection.$from);
11622
11622
  if (n.someProp("handlePaste", (a) => a(n, s, o || C.empty)))
11623
11623
  return !0;
11624
11624
  if (!o)
@@ -11626,7 +11626,7 @@ function Do(n, e, t, r, s) {
11626
11626
  let i = Ng(o), l = i ? n.state.tr.replaceSelectionWith(i, r) : n.state.tr.replaceSelection(o);
11627
11627
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
11628
11628
  }
11629
- function Vu(n) {
11629
+ function vu(n) {
11630
11630
  let e = n.getData("text/plain") || n.getData("Text");
11631
11631
  if (e)
11632
11632
  return e;
@@ -11638,7 +11638,7 @@ De.paste = (n, e) => {
11638
11638
  if (n.composing && !hr)
11639
11639
  return;
11640
11640
  let r = er ? null : t.clipboardData, s = n.input.shiftKey && n.input.lastKeyCode != 45;
11641
- r && Do(n, Vu(r), r.getData("text/html"), s, t) ? t.preventDefault() : Dg(n, t);
11641
+ r && Do(n, vu(r), r.getData("text/html"), s, t) ? t.preventDefault() : Dg(n, t);
11642
11642
  };
11643
11643
  class Og {
11644
11644
  constructor(e, t, r) {
@@ -11646,7 +11646,7 @@ class Og {
11646
11646
  }
11647
11647
  }
11648
11648
  const Eg = Ie ? "altKey" : "ctrlKey";
11649
- function $u(n, e) {
11649
+ function Vu(n, e) {
11650
11650
  let t = n.someProp("dragCopies", (r) => !r(e));
11651
11651
  return t ?? !e[Eg];
11652
11652
  }
@@ -11663,8 +11663,8 @@ Le.dragstart = (n, e) => {
11663
11663
  f && f.node.type.spec.draggable && f != n.docView && (i = w.create(n.state.doc, f.posBefore));
11664
11664
  }
11665
11665
  }
11666
- let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Nu(n, l);
11667
- (!t.dataTransfer.files.length || !vt || ku > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(er ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", er || t.dataTransfer.setData("text/plain", c), n.dragging = new Og(u, $u(n, t), i);
11666
+ let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Mu(n, l);
11667
+ (!t.dataTransfer.files.length || !vt || Su > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(er ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", er || t.dataTransfer.setData("text/plain", c), n.dragging = new Og(u, Vu(n, t), i);
11668
11668
  };
11669
11669
  Le.dragend = (n) => {
11670
11670
  let e = n.dragging;
@@ -11683,8 +11683,8 @@ De.drop = (n, e) => {
11683
11683
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
11684
11684
  i ? n.someProp("transformPasted", (p) => {
11685
11685
  i = p(i, n);
11686
- }) : i = Du(n, Vu(t.dataTransfer), er ? null : t.dataTransfer.getData("text/html"), !1, o);
11687
- let l = !!(r && $u(n, t));
11686
+ }) : i = Nu(n, vu(t.dataTransfer), er ? null : t.dataTransfer.getData("text/html"), !1, o);
11687
+ let l = !!(r && Vu(n, t));
11688
11688
  if (n.someProp("handleDrop", (p) => p(n, t, i || C.empty, l))) {
11689
11689
  t.preventDefault();
11690
11690
  return;
@@ -11707,7 +11707,7 @@ De.drop = (n, e) => {
11707
11707
  c.setSelection(new w(h));
11708
11708
  else {
11709
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)));
11710
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, k) => p = k), c.setSelection(Cu(n, h, c.doc.resolve(p)));
11711
11711
  }
11712
11712
  n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
11713
11713
  };
@@ -11725,7 +11725,7 @@ Le.beforeinput = (n, e) => {
11725
11725
  n.domObserver.flushSoon();
11726
11726
  let { domChangeCount: r } = n.input;
11727
11727
  setTimeout(() => {
11728
- if (n.input.domChangeCount != r || (n.dom.blur(), n.focus(), n.someProp("handleKeyDown", (o) => o(n, bu(8, "Backspace")))))
11728
+ if (n.input.domChangeCount != r || (n.dom.blur(), n.focus(), n.someProp("handleKeyDown", (o) => o(n, yu(8, "Backspace")))))
11729
11729
  return;
11730
11730
  let { $cursor: s } = n.state.selection;
11731
11731
  s && s.pos > 0 && n.dispatch(n.state.tr.delete(s.pos - 1, s.pos).scrollIntoView());
@@ -11945,13 +11945,13 @@ class Q {
11945
11945
  let s, o = 0;
11946
11946
  e.forEach((l, a) => {
11947
11947
  let c = a + r, u;
11948
- if (u = ju(t, l, c)) {
11948
+ if (u = zu(t, l, c)) {
11949
11949
  for (s || (s = this.children.slice()); o < s.length && s[o] < a; )
11950
11950
  o += 3;
11951
11951
  s[o] == a ? s[o + 2] = s[o + 2].addInner(l, u, c + 1) : s.splice(o, 0, a, a + l.nodeSize, Zr(u, l, c + 1, Ut)), o += 3;
11952
11952
  }
11953
11953
  });
11954
- let i = zu(o ? Fu(t) : t, -r);
11954
+ let i = $u(o ? ju(t) : t, -r);
11955
11955
  for (let l = 0; l < i.length; l++)
11956
11956
  i[l].type.valid(e, i[l]) || i.splice(l--, 1);
11957
11957
  return new Q(i.length ? this.local.concat(i).sort(Yt) : this.local, s || this.children);
@@ -12157,7 +12157,7 @@ function Ag(n, e, t, r, s, o, i) {
12157
12157
  }
12158
12158
  return new Q(e.sort(Yt), l);
12159
12159
  }
12160
- function zu(n, e) {
12160
+ function $u(n, e) {
12161
12161
  if (!e || !n.length)
12162
12162
  return n;
12163
12163
  let t = [];
@@ -12180,7 +12180,7 @@ function Rg(n, e, t, r, s, o, i) {
12180
12180
  n[a + 1] == -1 && l(n[a + 2], e[a] + o + 1);
12181
12181
  return t;
12182
12182
  }
12183
- function ju(n, e, t) {
12183
+ function zu(n, e, t) {
12184
12184
  if (e.isLeaf)
12185
12185
  return null;
12186
12186
  let r = t + e.nodeSize, s = null;
@@ -12188,7 +12188,7 @@ function ju(n, e, t) {
12188
12188
  (i = n[o]) && i.from > t && i.to < r && ((s || (s = [])).push(i), n[o] = null);
12189
12189
  return s;
12190
12190
  }
12191
- function Fu(n) {
12191
+ function ju(n) {
12192
12192
  let e = [];
12193
12193
  for (let t = 0; t < n.length; t++)
12194
12194
  n[t] != null && e.push(n[t]);
@@ -12197,14 +12197,14 @@ function Fu(n) {
12197
12197
  function Zr(n, e, t, r) {
12198
12198
  let s = [], o = !1;
12199
12199
  e.forEach((l, a) => {
12200
- let c = ju(n, l, a + t);
12200
+ let c = zu(n, l, a + t);
12201
12201
  if (c) {
12202
12202
  o = !0;
12203
12203
  let u = Zr(c, l, t + a + 1, r);
12204
12204
  u != pe && s.push(a, a + l.nodeSize, u);
12205
12205
  }
12206
12206
  });
12207
- let i = zu(o ? Fu(n) : n, -t).sort(Yt);
12207
+ let i = $u(o ? ju(n) : n, -t).sort(Yt);
12208
12208
  for (let l = 0; l < i.length; l++)
12209
12209
  i[l].type.valid(e, i[l]) || (r.onRemove && r.onRemove(i[l].spec), i.splice(l--, 1));
12210
12210
  return i.length || s.length ? new Q(i, s) : pe;
@@ -12220,17 +12220,17 @@ function ai(n) {
12220
12220
  for (let s = t + 1; s < e.length; s++) {
12221
12221
  let o = e[s];
12222
12222
  if (o.from == r.from) {
12223
- o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), ea(e, s + 1, o.copy(r.to, o.to)));
12223
+ o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), Zl(e, s + 1, o.copy(r.to, o.to)));
12224
12224
  continue;
12225
12225
  } else {
12226
- o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), ea(e, s, r.copy(o.from, r.to)));
12226
+ o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), Zl(e, s, r.copy(o.from, r.to)));
12227
12227
  break;
12228
12228
  }
12229
12229
  }
12230
12230
  }
12231
12231
  return e;
12232
12232
  }
12233
- function ea(n, e, t) {
12233
+ function Zl(n, e, t) {
12234
12234
  for (; e < n.length && Yt(t, n[e]) > 0; )
12235
12235
  e++;
12236
12236
  n.splice(e, 0, t);
@@ -12431,7 +12431,7 @@ function Vg(n) {
12431
12431
  for (let t = 0; t < n.colspan; t++) e.push(0);
12432
12432
  return e;
12433
12433
  }
12434
- function ta(n, e) {
12434
+ function ea(n, e) {
12435
12435
  if (typeof n == "string")
12436
12436
  return {};
12437
12437
  const t = n.getAttribute("data-colwidth"), r = t && /^\d+(,\d+)*$/.test(t) ? t.split(",").map((i) => Number(i)) : null, s = Number(n.getAttribute("colspan") || 1), o = {
@@ -12445,7 +12445,7 @@ function ta(n, e) {
12445
12445
  }
12446
12446
  return o;
12447
12447
  }
12448
- function na(n, e) {
12448
+ function ta(n, e) {
12449
12449
  const t = {};
12450
12450
  n.attrs.colspan != 1 && (t.colspan = n.attrs.colspan), n.attrs.rowspan != 1 && (t.rowspan = n.attrs.rowspan), n.attrs.colwidth && (t["data-colwidth"] = n.attrs.colwidth.join(","));
12451
12451
  for (const r in e) {
@@ -12499,10 +12499,10 @@ function zg(n) {
12499
12499
  tableRole: "cell",
12500
12500
  isolating: !0,
12501
12501
  parseDOM: [
12502
- { tag: "td", getAttrs: (r) => ta(r, e) }
12502
+ { tag: "td", getAttrs: (r) => ea(r, e) }
12503
12503
  ],
12504
12504
  toDOM(r) {
12505
- return ["td", na(r, e), 0];
12505
+ return ["td", ta(r, e), 0];
12506
12506
  }
12507
12507
  },
12508
12508
  table_header: {
@@ -12511,10 +12511,10 @@ function zg(n) {
12511
12511
  tableRole: "header_cell",
12512
12512
  isolating: !0,
12513
12513
  parseDOM: [
12514
- { tag: "th", getAttrs: (r) => ta(r, e) }
12514
+ { tag: "th", getAttrs: (r) => ea(r, e) }
12515
12515
  ],
12516
12516
  toDOM(r) {
12517
- return ["th", na(r, e), 0];
12517
+ return ["th", ta(r, e), 0];
12518
12518
  }
12519
12519
  }
12520
12520
  };
@@ -12572,7 +12572,7 @@ function Fg(n) {
12572
12572
  return n.doc.resolve(t - e.nodeSize);
12573
12573
  }
12574
12574
  }
12575
- function ra(n) {
12575
+ function na(n) {
12576
12576
  return n.parent.type.spec.tableRole == "row" && !!n.nodeAfter;
12577
12577
  }
12578
12578
  function Bg(n) {
@@ -12581,7 +12581,7 @@ function Bg(n) {
12581
12581
  function ci(n, e) {
12582
12582
  return n.depth == e.depth && n.pos >= e.start(-1) && n.pos <= e.end(-1);
12583
12583
  }
12584
- function Bu(n, e, t) {
12584
+ function Fu(n, e, t) {
12585
12585
  const r = n.node(-1), s = se.get(r), o = n.start(-1), i = s.nextCell(n.pos - o, e, t);
12586
12586
  return i == null ? null : n.node(0).resolve(o + i);
12587
12587
  }
@@ -12589,7 +12589,7 @@ function en(n, e, t = 1) {
12589
12589
  const r = { ...n, colspan: n.colspan - t };
12590
12590
  return r.colwidth && (r.colwidth = r.colwidth.slice(), r.colwidth.splice(e, t), r.colwidth.some((s) => s > 0) || (r.colwidth = null)), r;
12591
12591
  }
12592
- function Lu(n, e, t = 1) {
12592
+ function Bu(n, e, t = 1) {
12593
12593
  const r = { ...n, colspan: n.colspan + t };
12594
12594
  if (r.colwidth) {
12595
12595
  r.colwidth = r.colwidth.slice();
@@ -12620,7 +12620,7 @@ var H = class nt extends $ {
12620
12620
  if (!f)
12621
12621
  throw RangeError(`No cell with offset ${u} found`);
12622
12622
  const d = o + u + 1;
12623
- return new mc(
12623
+ return new pc(
12624
12624
  l.resolve(d),
12625
12625
  l.resolve(d + f.content.size)
12626
12626
  );
@@ -12629,7 +12629,7 @@ var H = class nt extends $ {
12629
12629
  }
12630
12630
  map(e, t) {
12631
12631
  const r = e.resolve(t.map(this.$anchorCell.pos)), s = e.resolve(t.map(this.$headCell.pos));
12632
- if (ra(r) && ra(s) && ci(r, s)) {
12632
+ if (na(r) && na(s) && ci(r, s)) {
12633
12633
  const o = this.$anchorCell.node(-1) != r.node(-1);
12634
12634
  return o && this.isRowSelection() ? nt.rowSelection(r, s) : o && this.isColSelection() ? nt.colSelection(r, s) : new nt(r, s);
12635
12635
  }
@@ -12770,12 +12770,12 @@ var H = class nt extends $ {
12770
12770
  };
12771
12771
  H.prototype.visible = !1;
12772
12772
  $.jsonID("cell", H);
12773
- var Wg = class Wu {
12773
+ var Wg = class Lu {
12774
12774
  constructor(e, t) {
12775
12775
  this.anchor = e, this.head = t;
12776
12776
  }
12777
12777
  map(e) {
12778
- return new Wu(e.map(this.anchor), e.map(this.head));
12778
+ return new Lu(e.map(this.anchor), e.map(this.head));
12779
12779
  }
12780
12780
  resolve(e) {
12781
12781
  const t = e.resolve(this.anchor), r = e.resolve(this.head);
@@ -12835,7 +12835,7 @@ function Jg(n, e, t) {
12835
12835
  return o && (e || (e = n.tr)).setSelection(o), e;
12836
12836
  }
12837
12837
  var Kg = new At("fix-tables");
12838
- function _u(n, e, t, r) {
12838
+ function Wu(n, e, t, r) {
12839
12839
  const s = n.childCount, o = e.childCount;
12840
12840
  e: for (let i = 0, l = 0; i < o; i++) {
12841
12841
  const a = e.child(i);
@@ -12844,7 +12844,7 @@ function _u(n, e, t, r) {
12844
12844
  l = c + 1, t += a.nodeSize;
12845
12845
  continue e;
12846
12846
  }
12847
- r(a, t), l < s && n.child(l).sameMarkup(a) ? _u(n.child(l), a, t + 1, r) : a.nodesBetween(0, a.content.size, r, t + 1), t += a.nodeSize;
12847
+ r(a, t), l < s && n.child(l).sameMarkup(a) ? Wu(n.child(l), a, t + 1, r) : a.nodesBetween(0, a.content.size, r, t + 1), t += a.nodeSize;
12848
12848
  }
12849
12849
  }
12850
12850
  function ui(n, e) {
@@ -12852,7 +12852,7 @@ function ui(n, e) {
12852
12852
  const r = (s, o) => {
12853
12853
  s.type.spec.tableRole == "table" && (t = Ug(n, s, o, t));
12854
12854
  };
12855
- return e ? e.doc != n.doc && _u(e.doc, n.doc, 0, r) : n.doc.descendants(r), t;
12855
+ return e ? e.doc != n.doc && Wu(e.doc, n.doc, 0, r) : n.doc.descendants(r), t;
12856
12856
  }
12857
12857
  function Ug(n, e, t, r) {
12858
12858
  const s = se.get(e);
@@ -12920,7 +12920,7 @@ function Qe(n) {
12920
12920
  e.$headCell.pos - s
12921
12921
  ) : o.findCell(t.pos - s), tableStart: s, map: o, table: r };
12922
12922
  }
12923
- function qu(n, { map: e, tableStart: t, table: r }, s) {
12923
+ function _u(n, { map: e, tableStart: t, table: r }, s) {
12924
12924
  let o = s > 0 ? -1 : 0;
12925
12925
  Lg(e, r, s + o) && (o = s == 0 || s == e.width ? null : 0);
12926
12926
  for (let i = 0; i < e.height; i++) {
@@ -12930,7 +12930,7 @@ function qu(n, { map: e, tableStart: t, table: r }, s) {
12930
12930
  n.setNodeMarkup(
12931
12931
  n.mapping.map(t + a),
12932
12932
  null,
12933
- Lu(c.attrs, s - e.colCount(a))
12933
+ Bu(c.attrs, s - e.colCount(a))
12934
12934
  ), i += c.attrs.rowspan - 1;
12935
12935
  } else {
12936
12936
  const a = o == null ? xe(r.type.schema).cell : r.nodeAt(e.map[l + o]).type, c = e.positionAt(i, s, r);
@@ -12943,7 +12943,7 @@ function Yg(n, e) {
12943
12943
  if (!Ve(n)) return !1;
12944
12944
  if (e) {
12945
12945
  const t = Qe(n);
12946
- e(qu(n.tr, t, t.left));
12946
+ e(_u(n.tr, t, t.left));
12947
12947
  }
12948
12948
  return !0;
12949
12949
  }
@@ -12951,7 +12951,7 @@ function Gg(n, e) {
12951
12951
  if (!Ve(n)) return !1;
12952
12952
  if (e) {
12953
12953
  const t = Qe(n);
12954
- e(qu(n.tr, t, t.right));
12954
+ e(_u(n.tr, t, t.right));
12955
12955
  }
12956
12956
  return !0;
12957
12957
  }
@@ -12995,7 +12995,7 @@ function Zg(n, e, t) {
12995
12995
  return !1;
12996
12996
  return !0;
12997
12997
  }
12998
- function Hu(n, { map: e, tableStart: t, table: r }, s) {
12998
+ function qu(n, { map: e, tableStart: t, table: r }, s) {
12999
12999
  var o;
13000
13000
  let i = t;
13001
13001
  for (let c = 0; c < s; c++) i += r.child(c).nodeSize;
@@ -13019,7 +13019,7 @@ function ey(n, e) {
13019
13019
  if (!Ve(n)) return !1;
13020
13020
  if (e) {
13021
13021
  const t = Qe(n);
13022
- e(Hu(n.tr, t, t.top));
13022
+ e(qu(n.tr, t, t.top));
13023
13023
  }
13024
13024
  return !0;
13025
13025
  }
@@ -13027,7 +13027,7 @@ function ty(n, e) {
13027
13027
  if (!Ve(n)) return !1;
13028
13028
  if (e) {
13029
13029
  const t = Qe(n);
13030
- e(Hu(n.tr, t, t.bottom));
13030
+ e(qu(n.tr, t, t.bottom));
13031
13031
  }
13032
13032
  return !0;
13033
13033
  }
@@ -13071,7 +13071,7 @@ function ry(n, e) {
13071
13071
  }
13072
13072
  return !0;
13073
13073
  }
13074
- function sa(n) {
13074
+ function ra(n) {
13075
13075
  const e = n.content;
13076
13076
  return e.childCount == 1 && e.child(0).isTextblock && e.child(0).childCount == 0;
13077
13077
  }
@@ -13105,7 +13105,7 @@ function oy(n, e) {
13105
13105
  if (i[d] = !0, a == null)
13106
13106
  a = d, c = h;
13107
13107
  else {
13108
- sa(h) || (l = l.append(h.content));
13108
+ ra(h) || (l = l.append(h.content));
13109
13109
  const p = o.mapping.map(d + r.tableStart);
13110
13110
  o.delete(p, p + h.nodeSize);
13111
13111
  }
@@ -13113,14 +13113,14 @@ function oy(n, e) {
13113
13113
  if (a == null || c == null)
13114
13114
  return !0;
13115
13115
  if (o.setNodeMarkup(a + r.tableStart, null, {
13116
- ...Lu(
13116
+ ...Bu(
13117
13117
  c.attrs,
13118
13118
  c.attrs.colspan,
13119
13119
  r.right - r.left - c.attrs.colspan
13120
13120
  ),
13121
13121
  rowspan: r.bottom - r.top
13122
13122
  }), l.size) {
13123
- const u = a + 1 + c.content.size, f = sa(c) ? a + 1 : u;
13123
+ const u = a + 1 + c.content.size, f = ra(c) ? a + 1 : u;
13124
13124
  o.replaceWith(f + r.tableStart, u + r.tableStart, l);
13125
13125
  }
13126
13126
  o.setSelection(
@@ -13238,7 +13238,7 @@ function ay(n) {
13238
13238
  return !0;
13239
13239
  };
13240
13240
  }
13241
- function oa(n, e, t) {
13241
+ function sa(n, e, t) {
13242
13242
  const r = e.map.cellsInRect({
13243
13243
  left: 0,
13244
13244
  top: 0,
@@ -13256,7 +13256,7 @@ function fi(n, e) {
13256
13256
  return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? ay(n) : function(t, r) {
13257
13257
  if (!Ve(t)) return !1;
13258
13258
  if (r) {
13259
- const s = xe(t.schema), o = Qe(t), i = t.tr, l = oa("row", o, s), a = oa(
13259
+ const s = xe(t.schema), o = Qe(t), i = t.tr, l = sa("row", o, s), a = sa(
13260
13260
  "column",
13261
13261
  o,
13262
13262
  s
@@ -13308,7 +13308,7 @@ function dy(n, e) {
13308
13308
  }
13309
13309
  return null;
13310
13310
  }
13311
- function ia(n) {
13311
+ function oa(n) {
13312
13312
  return function(e, t) {
13313
13313
  if (!Ve(e)) return !1;
13314
13314
  const r = dy(ps(e), n);
@@ -13395,7 +13395,7 @@ function my(n, e) {
13395
13395
  }
13396
13396
  function To(n, e) {
13397
13397
  const t = n.createAndFill();
13398
- return new pc(t).replace(0, t.content.size, e).doc;
13398
+ return new hc(t).replace(0, t.content.size, e).doc;
13399
13399
  }
13400
13400
  function gy({ width: n, height: e, rows: t }, r, s) {
13401
13401
  if (n != r) {
@@ -13466,7 +13466,7 @@ function yy(n, e, t, r, s, o, i) {
13466
13466
  }
13467
13467
  return !!(c || u);
13468
13468
  }
13469
- function la(n, e, t, r, s, o, i, l) {
13469
+ function ia(n, e, t, r, s, o, i, l) {
13470
13470
  if (i == 0 || i == e.height) return !1;
13471
13471
  let a = !1;
13472
13472
  for (let c = s; c < o; c++) {
@@ -13488,7 +13488,7 @@ function la(n, e, t, r, s, o, i, l) {
13488
13488
  }
13489
13489
  return a;
13490
13490
  }
13491
- function aa(n, e, t, r, s, o, i, l) {
13491
+ function la(n, e, t, r, s, o, i, l) {
13492
13492
  if (i == 0 || i == e.width) return !1;
13493
13493
  let a = !1;
13494
13494
  for (let c = s; c < o; c++) {
@@ -13514,7 +13514,7 @@ function aa(n, e, t, r, s, o, i, l) {
13514
13514
  }
13515
13515
  return a;
13516
13516
  }
13517
- function ca(n, e, t, r, s) {
13517
+ function aa(n, e, t, r, s) {
13518
13518
  let o = t ? n.doc.nodeAt(t - 1) : n.doc;
13519
13519
  if (!o)
13520
13520
  throw new Error("No table found");
@@ -13526,7 +13526,7 @@ function ca(n, e, t, r, s) {
13526
13526
  throw new Error("No table found");
13527
13527
  i = se.get(o), d = f.mapping.maps.length;
13528
13528
  }
13529
- yy(f, i, o, t, c, u, d) && h(), la(f, i, o, t, a, c, l, d) && h(), la(f, i, o, t, a, c, u, d) && h(), aa(f, i, o, t, l, u, a, d) && h(), aa(f, i, o, t, l, u, c, d) && h();
13529
+ yy(f, i, o, t, c, u, d) && h(), ia(f, i, o, t, a, c, l, d) && h(), ia(f, i, o, t, a, c, u, d) && h(), la(f, i, o, t, l, u, a, d) && h(), la(f, i, o, t, l, u, c, d) && h();
13530
13530
  for (let p = l; p < u; p++) {
13531
13531
  const y = i.positionAt(p, a, o), m = i.positionAt(p, c, o);
13532
13532
  f.replace(
@@ -13570,7 +13570,7 @@ function Cr(n, e) {
13570
13570
  $.near(o.$headCell, e)
13571
13571
  );
13572
13572
  if (n != "horiz" && !o.empty) return !1;
13573
- const i = Ju(s, n, e);
13573
+ const i = Hu(s, n, e);
13574
13574
  if (i == null) return !1;
13575
13575
  if (n == "horiz")
13576
13576
  return Rr(
@@ -13579,7 +13579,7 @@ function Cr(n, e) {
13579
13579
  $.near(t.doc.resolve(o.head + e), e)
13580
13580
  );
13581
13581
  {
13582
- const l = t.doc.resolve(i), a = Bu(l, n, e);
13582
+ const l = t.doc.resolve(i), a = Fu(l, n, e);
13583
13583
  let c;
13584
13584
  return a ? c = $.near(a, 1) : e < 0 ? c = $.near(t.doc.resolve(l.before(-1)), -1) : c = $.near(t.doc.resolve(l.after(-1)), 1), Rr(t, r, c);
13585
13585
  }
@@ -13593,11 +13593,11 @@ function wr(n, e) {
13593
13593
  if (o instanceof H)
13594
13594
  i = o;
13595
13595
  else {
13596
- const a = Ju(s, n, e);
13596
+ const a = Hu(s, n, e);
13597
13597
  if (a == null) return !1;
13598
13598
  i = new H(t.doc.resolve(a));
13599
13599
  }
13600
- const l = Bu(i.$headCell, n, e);
13600
+ const l = Fu(i.$headCell, n, e);
13601
13601
  return l ? Rr(
13602
13602
  t,
13603
13603
  r,
@@ -13627,10 +13627,10 @@ function Sy(n, e, t) {
13627
13627
  s.$anchorCell.pos - i,
13628
13628
  s.$headCell.pos - i
13629
13629
  );
13630
- return r = gy(r, l.right - l.left, l.bottom - l.top), ca(n.state, n.dispatch, i, l, r), !0;
13630
+ return r = gy(r, l.right - l.left, l.bottom - l.top), aa(n.state, n.dispatch, i, l, r), !0;
13631
13631
  } else if (r) {
13632
13632
  const o = ps(n.state), i = o.start(-1);
13633
- return ca(
13633
+ return aa(
13634
13634
  n.state,
13635
13635
  n.dispatch,
13636
13636
  i,
@@ -13643,7 +13643,7 @@ function Sy(n, e, t) {
13643
13643
  function ky(n, e) {
13644
13644
  var t;
13645
13645
  if (e.ctrlKey || e.metaKey) return;
13646
- const r = ua(n, e.target);
13646
+ const r = ca(n, e.target);
13647
13647
  let s;
13648
13648
  if (e.shiftKey && n.state.selection instanceof H)
13649
13649
  o(n.state.selection.$anchorCell, e), e.preventDefault();
@@ -13671,13 +13671,13 @@ function ky(n, e) {
13671
13671
  let f;
13672
13672
  if (u != null)
13673
13673
  f = n.state.doc.resolve(u);
13674
- else if (ua(n, c.target) != r && (f = Js(n, e), !f))
13674
+ else if (ca(n, c.target) != r && (f = Js(n, e), !f))
13675
13675
  return i();
13676
13676
  f && o(f, c);
13677
13677
  }
13678
13678
  n.root.addEventListener("mouseup", i), n.root.addEventListener("dragstart", i), n.root.addEventListener("mousemove", l);
13679
13679
  }
13680
- function Ju(n, e, t) {
13680
+ function Hu(n, e, t) {
13681
13681
  if (!(n.state.selection instanceof V)) return null;
13682
13682
  const { $head: r } = n.state.selection;
13683
13683
  for (let s = r.depth - 1; s >= 0; s--) {
@@ -13690,7 +13690,7 @@ function Ju(n, e, t) {
13690
13690
  }
13691
13691
  return null;
13692
13692
  }
13693
- function ua(n, e) {
13693
+ function ca(n, e) {
13694
13694
  for (; e && e != n.dom; e = e.parentNode)
13695
13695
  if (e.nodeName == "TD" || e.nodeName == "TH")
13696
13696
  return e;
@@ -13747,12 +13747,12 @@ function Cy({
13747
13747
  }
13748
13748
  });
13749
13749
  }
13750
- const Ku = (n) => [
13750
+ const Ju = (n) => [
13751
13751
  //columnResizing({ lastColumnResizable: false, View: null }),
13752
13752
  Cy(),
13753
13753
  $s({
13754
- Tab: ia(1),
13755
- "Shift-Tab": ia(-1)
13754
+ Tab: oa(1),
13755
+ "Shift-Tab": oa(-1)
13756
13756
  }),
13757
13757
  Bm(n.schema),
13758
13758
  $s(vm(n.schema)),
@@ -13762,7 +13762,7 @@ const Ku = (n) => [
13762
13762
  Kd(),
13763
13763
  Lm(n)
13764
13764
  //selectPlugin,
13765
- ], Vt = ct(null), wy = ct(null), Uu = /* @__PURE__ */ ct(null), Mr = /* @__PURE__ */ new WeakMap();
13765
+ ], Vt = ct(null), wy = ct(null), Ku = /* @__PURE__ */ ct(null), Mr = /* @__PURE__ */ new WeakMap();
13766
13766
  function My(n) {
13767
13767
  const e = /* @__PURE__ */ Object.create(null);
13768
13768
  e.class = "ProseMirror", e.contenteditable = String(n.editable), n.someProp("attributes", (s) => {
@@ -13775,7 +13775,7 @@ function My(n) {
13775
13775
  return !r || r[0].to !== n.state.doc.content.size || !r[0].type.eq(t[0].type) ? (Mr.set(n, t), t) : r;
13776
13776
  }
13777
13777
  const Ny = [], Dy = {}, Ao = U.empty;
13778
- let fa = class yn {
13778
+ let ua = class yn {
13779
13779
  constructor(e) {
13780
13780
  F(this, "members");
13781
13781
  this.members = e;
@@ -13810,7 +13810,7 @@ let fa = class yn {
13810
13810
  for (let i = 0; i < o.length; i++) t.push(o[i]);
13811
13811
  }
13812
13812
  }
13813
- return t ? Oy(r ? t : t.sort(Yu)) : Ny;
13813
+ return t ? Oy(r ? t : t.sort(Uu)) : Ny;
13814
13814
  }
13815
13815
  // Create a group for the given array of decoration sets, or return
13816
13816
  // a single set when possible.
@@ -13829,7 +13829,7 @@ let fa = class yn {
13829
13829
  this.members[t].forEachSet(e);
13830
13830
  }
13831
13831
  };
13832
- function Yu(n, e) {
13832
+ function Uu(n, e) {
13833
13833
  return n.from - e.from || n.to - e.to;
13834
13834
  }
13835
13835
  function Oy(n) {
@@ -13839,18 +13839,18 @@ function Oy(n) {
13839
13839
  if (r.from != r.to) for (let s = t + 1; s < e.length; s++) {
13840
13840
  const o = e[s];
13841
13841
  if (o.from == r.from) {
13842
- o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), da(e, s + 1, o.copy(r.to, o.to)));
13842
+ o.to != r.to && (e == n && (e = n.slice()), e[s] = o.copy(o.from, r.to), fa(e, s + 1, o.copy(r.to, o.to)));
13843
13843
  continue;
13844
13844
  } else {
13845
- o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), da(e, s, r.copy(o.from, r.to)));
13845
+ o.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, o.from), fa(e, s, r.copy(o.from, r.to)));
13846
13846
  break;
13847
13847
  }
13848
13848
  }
13849
13849
  }
13850
13850
  return e;
13851
13851
  }
13852
- function da(n, e, t) {
13853
- for (; e < n.length && Yu(t, n[e]) > 0; ) e++;
13852
+ function fa(n, e, t) {
13853
+ for (; e < n.length && Uu(t, n[e]) > 0; ) e++;
13854
13854
  n.splice(e, 0, t);
13855
13855
  }
13856
13856
  const Ks = /* @__PURE__ */ new WeakMap();
@@ -13867,14 +13867,14 @@ function Ey(n, e) {
13867
13867
  );
13868
13868
  const r = Ks.get(n);
13869
13869
  if (!r) {
13870
- const i = fa.from(t);
13870
+ const i = ua.from(t);
13871
13871
  return Ks.set(n, i), i;
13872
13872
  }
13873
13873
  let s = 0, o = !0;
13874
13874
  if (r.forEachSet((i) => {
13875
13875
  t[s++] !== i && (o = !1);
13876
13876
  }), s !== t.length && (o = !1), !o) {
13877
- const i = fa.from(t);
13877
+ const i = ua.from(t);
13878
13878
  return Ks.set(n, i), i;
13879
13879
  }
13880
13880
  return r;
@@ -13882,13 +13882,13 @@ function Ey(n, e) {
13882
13882
  const di = function(n) {
13883
13883
  for (let e = 0; ; e++)
13884
13884
  if (n = n.previousSibling, !n) return e;
13885
- }, ha = function(n) {
13885
+ }, da = function(n) {
13886
13886
  const e = n.assignedSlot || n.parentNode;
13887
13887
  return e && e.nodeType == 11 ? e.host : e;
13888
13888
  }, Ty = function(n, e, t, r) {
13889
- return t && (pa(n, e, t, r, -1) || pa(n, e, t, r, 1));
13889
+ return t && (ha(n, e, t, r, -1) || ha(n, e, t, r, 1));
13890
13890
  }, Ay = /^(img|br|input|textarea|hr)$/i;
13891
- function pa(n, e, t, r, s) {
13891
+ function ha(n, e, t, r, s) {
13892
13892
  for (; ; ) {
13893
13893
  if (n == t && e == r) return !0;
13894
13894
  if (e == (s < 0 ? 0 : es(n))) {
@@ -13919,16 +13919,16 @@ function Iy(n) {
13919
13919
  for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode) ;
13920
13920
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
13921
13921
  }
13922
- const Gu = function(n) {
13922
+ const Yu = function(n) {
13923
13923
  return n.focusNode && Ty(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
13924
- }, Xu = /* @__PURE__ */ ct(null);
13924
+ }, Gu = /* @__PURE__ */ ct(null);
13925
13925
  function X() {
13926
13926
  for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
13927
13927
  e[t] = arguments[t];
13928
13928
  typeof document > "u" || Pf(...e);
13929
13929
  }
13930
13930
  function Py(n, e) {
13931
- const t = ie(Xu);
13931
+ const t = ie(Gu);
13932
13932
  X(() => t(n), e);
13933
13933
  }
13934
13934
  function ft(n, e) {
@@ -14098,15 +14098,15 @@ function jy(n) {
14098
14098
  }
14099
14099
  });
14100
14100
  }
14101
- const Ye = typeof navigator < "u" ? navigator : null, ma = typeof document < "u" ? document : null, rn = Ye && Ye.userAgent || "", Io = /Edge\/(\d+)/.exec(rn), Qu = /MSIE \d/.exec(rn), Po = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn), ms = !!(Qu || Po || Io), Fy = Qu ? document.documentMode : Po ? +Po[1] : Io ? +Io[1] : 0, Zu = !ms && /gecko\/(\d+)/i.test(rn);
14102
- Zu && +(/Firefox\/(\d+)/.exec(rn) || [
14101
+ const Ye = typeof navigator < "u" ? navigator : null, pa = typeof document < "u" ? document : null, rn = Ye && Ye.userAgent || "", Io = /Edge\/(\d+)/.exec(rn), Xu = /MSIE \d/.exec(rn), Po = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn), ms = !!(Xu || Po || Io), Fy = Xu ? document.documentMode : Po ? +Po[1] : Io ? +Io[1] : 0, Qu = !ms && /gecko\/(\d+)/i.test(rn);
14102
+ Qu && +(/Firefox\/(\d+)/.exec(rn) || [
14103
14103
  0,
14104
14104
  0
14105
14105
  ])[1];
14106
- const vo = !ms && /Chrome\/(\d+)/.exec(rn), By = !!vo, Ly = vo ? +vo[1] : 0, ef = !ms && !!Ye && /Apple Computer/.test(Ye.vendor), Wy = ef && (/Mobile\/\w+/.test(rn) || !!Ye && Ye.maxTouchPoints > 2);
14106
+ const vo = !ms && /Chrome\/(\d+)/.exec(rn), By = !!vo, Ly = vo ? +vo[1] : 0, Zu = !ms && !!Ye && /Apple Computer/.test(Ye.vendor), Wy = Zu && (/Mobile\/\w+/.test(rn) || !!Ye && Ye.maxTouchPoints > 2);
14107
14107
  Wy || Ye && /Mac/.test(Ye.platform);
14108
14108
  Ye && /Win/.test(Ye.platform);
14109
- const _y = !!ma && "webkitFontSmoothing" in ma.documentElement.style;
14109
+ const _y = !!pa && "webkitFontSmoothing" in pa.documentElement.style;
14110
14110
  _y && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [
14111
14111
  0,
14112
14112
  0
@@ -14114,12 +14114,12 @@ _y && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [
14114
14114
  const fe = {
14115
14115
  ie: ms,
14116
14116
  ie_version: Fy,
14117
- gecko: Zu,
14117
+ gecko: Qu,
14118
14118
  chrome: By,
14119
14119
  chrome_version: Ly,
14120
- safari: ef
14120
+ safari: Zu
14121
14121
  };
14122
- function ga(n) {
14122
+ function ma(n) {
14123
14123
  return n.editable && !n.hasFocus() ? !1 : qy(n);
14124
14124
  }
14125
14125
  function qy(n) {
@@ -14135,7 +14135,7 @@ function qy(n) {
14135
14135
  function Hy(n, e, t, r) {
14136
14136
  return n.someProp("createSelectionBetween", (s) => s(n, e, t)) || V.between(e, t, r);
14137
14137
  }
14138
- function ya(n) {
14138
+ function ga(n) {
14139
14139
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
14140
14140
  const t = n.domSelectionRange(), r = n.state.doc;
14141
14141
  if (!t.focusNode) return null;
@@ -14144,7 +14144,7 @@ function ya(n) {
14144
14144
  let i = n.docView.posFromDOM(t.focusNode, t.focusOffset, 1);
14145
14145
  if (i < 0) return null;
14146
14146
  let l = r.resolve(i), a, c;
14147
- if (Gu(t)) {
14147
+ if (Yu(t)) {
14148
14148
  for (a = i; s && !s.node; ) s = s.parent;
14149
14149
  const f = s.node;
14150
14150
  if (s && f.isAtom && w.isSelectable(f) && s.parent && !(f.isInline && Ry(t.focusNode, t.focusOffset, s.dom))) {
@@ -14194,7 +14194,7 @@ function ya(n) {
14194
14194
  return c;
14195
14195
  }
14196
14196
  const ts = function(n, e, t, r) {
14197
- return t && (ba(n, e, t, r, -1) || ba(n, e, t, r, 1));
14197
+ return t && (ya(n, e, t, r, -1) || ya(n, e, t, r, 1));
14198
14198
  };
14199
14199
  function Jy(n) {
14200
14200
  let e;
@@ -14202,16 +14202,16 @@ function Jy(n) {
14202
14202
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
14203
14203
  }
14204
14204
  const Ky = /^(img|br|input|textarea|hr)$/i;
14205
- function ba(n, e, t, r, s) {
14205
+ function ya(n, e, t, r, s) {
14206
14206
  for (; ; ) {
14207
14207
  if (n == t && e == r) return !0;
14208
- if (e == (s < 0 ? 0 : xa(n))) {
14208
+ if (e == (s < 0 ? 0 : ba(n))) {
14209
14209
  const o = n.parentNode;
14210
14210
  if (!o || o.nodeType != 1 || Jy(n) || Ky.test(n.nodeName) || n.contentEditable == "false") return !1;
14211
14211
  e = xt(n) + (s < 0 ? 0 : 1), n = o;
14212
14212
  } else if (n.nodeType == 1) {
14213
14213
  if (n = n.childNodes[e + (s < 0 ? -1 : 0)], n.contentEditable == "false") return !1;
14214
- e = s < 0 ? xa(n) : 0;
14214
+ e = s < 0 ? ba(n) : 0;
14215
14215
  } else
14216
14216
  return !1;
14217
14217
  }
@@ -14221,18 +14221,18 @@ const xt = function(n) {
14221
14221
  for (let t = 0; ; t++)
14222
14222
  if (e = e.previousSibling, !e) return t;
14223
14223
  };
14224
- function xa(n) {
14224
+ function ba(n) {
14225
14225
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
14226
14226
  }
14227
14227
  function Uy(n, e) {
14228
14228
  const t = n;
14229
14229
  if (e instanceof w) {
14230
14230
  const r = t.docView.descAt(e.from);
14231
- r != t.lastSelectedViewDesc && (Sa(t), r && r.selectNode(), t.lastSelectedViewDesc = r);
14231
+ r != t.lastSelectedViewDesc && (xa(t), r && r.selectNode(), t.lastSelectedViewDesc = r);
14232
14232
  } else
14233
- Sa(t);
14233
+ xa(t);
14234
14234
  }
14235
- function Sa(n) {
14235
+ function xa(n) {
14236
14236
  const e = n;
14237
14237
  e.lastSelectedViewDesc && (e.lastSelectedViewDesc.parent && e.lastSelectedViewDesc.deselectNode(), e.lastSelectedViewDesc = void 0);
14238
14238
  }
@@ -14248,7 +14248,7 @@ function Yy(n) {
14248
14248
  return !1;
14249
14249
  }
14250
14250
  }
14251
- function tf(n) {
14251
+ function ef(n) {
14252
14252
  return n.editable ? n.hasFocus() : Yy(n) && document.activeElement && document.activeElement.contains(n.dom);
14253
14253
  }
14254
14254
  function Gy(n) {
@@ -14257,7 +14257,7 @@ function Gy(n) {
14257
14257
  const s = e.cursorWrapper.dom, o = s.nodeName == "IMG";
14258
14258
  o ? r.setStart(s.parentNode, xt(s) + 1) : r.setStart(s, 0), r.collapse(!0), t.removeAllRanges(), t.addRange(r), !o && !e.state.selection.visible && fe.ie && fe.ie_version <= 11 && (s.disabled = !0, s.disabled = !1);
14259
14259
  }
14260
- function ka(n, e) {
14260
+ function Sa(n, e) {
14261
14261
  const t = n, { node: r, offset: s } = t.docView.domFromPos(e, 0), o = s < r.childNodes.length ? r.childNodes[s] : null, i = s ? r.childNodes[s - 1] : null;
14262
14262
  if (fe.safari && o && o.contentEditable == "false") return Ys(o);
14263
14263
  if ((!o || o.contentEditable == "false") && (!i || i.contentEditable == "false")) {
@@ -14268,7 +14268,7 @@ function ka(n, e) {
14268
14268
  function Ys(n) {
14269
14269
  return n.contentEditable = "true", fe.safari && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
14270
14270
  }
14271
- function Ca(n) {
14271
+ function ka(n) {
14272
14272
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
14273
14273
  }
14274
14274
  function Xy(n) {
@@ -14277,15 +14277,15 @@ function Xy(n) {
14277
14277
  const r = e.domSelectionRange(), s = r.anchorNode, o = r.anchorOffset;
14278
14278
  t.addEventListener("selectionchange", e.input.hideSelectionGuard = () => {
14279
14279
  (r.anchorNode != s || r.anchorOffset != o) && (t.removeEventListener("selectionchange", e.input.hideSelectionGuard), setTimeout(() => {
14280
- (!tf(e) || e.state.selection.visible) && e.dom.classList.remove("ProseMirror-hideselection");
14280
+ (!ef(e) || e.state.selection.visible) && e.dom.classList.remove("ProseMirror-hideselection");
14281
14281
  }, 20));
14282
14282
  });
14283
14283
  }
14284
- const wa = fe.safari || fe.chrome && fe.chrome_version < 63;
14284
+ const Ca = fe.safari || fe.chrome && fe.chrome_version < 63;
14285
14285
  function Nr(n) {
14286
14286
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
14287
14287
  const t = n, r = t.state.selection;
14288
- if (Uy(t, r), !!tf(t)) {
14288
+ if (Uy(t, r), !!ef(t)) {
14289
14289
  if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && fe.chrome) {
14290
14290
  const s = t.domSelectionRange(), o = t.domObserver.currentSelection;
14291
14291
  if (s.anchorNode && o.anchorNode && ts(s.anchorNode, s.anchorOffset, o.anchorNode, o.anchorOffset)) {
@@ -14298,7 +14298,7 @@ function Nr(n) {
14298
14298
  else {
14299
14299
  const { anchor: s, head: o } = r;
14300
14300
  let i, l;
14301
- wa && !(r instanceof V) && (r.$from.parent.inlineContent || (i = ka(t, r.from)), !r.empty && !r.$from.parent.inlineContent && (l = ka(t, r.to))), t.docView.setSelection(s, o, t, e), wa && (i && Ca(i), l && Ca(l)), r.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Xy(t));
14301
+ Ca && !(r instanceof V) && (r.$from.parent.inlineContent || (i = Sa(t, r.from)), !r.empty && !r.$from.parent.inlineContent && (l = Sa(t, r.to))), t.docView.setSelection(s, o, t, e), Ca && (i && ka(i), l && ka(l)), r.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Xy(t));
14302
14302
  }
14303
14303
  t.domObserver.setCurSelection(), t.domObserver.connectSelection();
14304
14304
  }
@@ -14350,8 +14350,8 @@ class Zy {
14350
14350
  if (!e.focusNode) return !0;
14351
14351
  const t = /* @__PURE__ */ new Set();
14352
14352
  let r;
14353
- for (let o = e.focusNode; o; o = ha(o)) t.add(o);
14354
- for (let o = e.anchorNode; o; o = ha(o)) if (t.has(o)) {
14353
+ for (let o = e.focusNode; o; o = da(o)) t.add(o);
14354
+ for (let o = e.anchorNode; o; o = da(o)) if (t.has(o)) {
14355
14355
  r = o;
14356
14356
  break;
14357
14357
  }
@@ -14379,7 +14379,7 @@ class Zy {
14379
14379
  const r = (
14380
14380
  // @ts-expect-error Internal property (input)
14381
14381
  e.input.lastSelectionTime > Date.now() - 50 ? e.input.lastSelectionOrigin : null
14382
- ), s = ya(e, r);
14382
+ ), s = ga(e, r);
14383
14383
  if (s && !e.state.selection.eq(s)) {
14384
14384
  const o = e.state.tr.setSelection(s);
14385
14385
  r == "pointer" ? o.setMeta("pointer", !0) : r == "key" && o.scrollIntoView(), t && o.setMeta("composition", t), e.dispatch(o);
@@ -14394,17 +14394,17 @@ class Zy {
14394
14394
  flush() {
14395
14395
  const { view: e } = this;
14396
14396
  if (!e.docView || this.flushingSoon > -1) return;
14397
- const t = e.domSelectionRange(), r = !this.suppressingSelectionUpdates && !this.currentSelection.eq(t) && ga(e) && !this.ignoreSelectionChange(t);
14397
+ const t = e.domSelectionRange(), r = !this.suppressingSelectionUpdates && !this.currentSelection.eq(t) && ma(e) && !this.ignoreSelectionChange(t);
14398
14398
  let s = null;
14399
14399
  r && // @ts-expect-error Internal property (input)
14400
14400
  e.input.lastFocus > Date.now() - 200 && // @ts-expect-error Internal property (input)
14401
- Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Gu(t) && (s = ya(e)) && s.eq($.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Nr(e), this.currentSelection.set(t), e.scrollToSelection()) : r && (this.updateSelection(), this.currentSelection.eq(t) || Nr(e), this.currentSelection.set(t));
14401
+ Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Yu(t) && (s = ga(e)) && s.eq($.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Nr(e), this.currentSelection.set(t), e.scrollToSelection()) : r && (this.updateSelection(), this.currentSelection.eq(t) || Nr(e), this.currentSelection.set(t));
14402
14402
  }
14403
14403
  forceFlush() {
14404
14404
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
14405
14405
  }
14406
14406
  onSelectionChange() {
14407
- if (ga(this.view) && !this.view.composing) {
14407
+ if (ma(this.view) && !this.view.composing) {
14408
14408
  if (this.suppressingSelectionUpdates) return Nr(this.view);
14409
14409
  if (fe.ie && fe.ie_version <= 11 && !this.view.state.selection.empty) {
14410
14410
  const e = this.view.domSelectionRange();
@@ -14425,7 +14425,7 @@ let eb = class {
14425
14425
  }
14426
14426
  remove() {
14427
14427
  }
14428
- }, Ma = class Ir {
14428
+ }, wa = class Ir {
14429
14429
  constructor() {
14430
14430
  F(this, "nodeName", "div");
14431
14431
  F(this, "style", {});
@@ -14450,7 +14450,7 @@ let eb = class {
14450
14450
  return new eb();
14451
14451
  }
14452
14452
  get ownerDocument() {
14453
- return new nf();
14453
+ return new tf();
14454
14454
  }
14455
14455
  addEventListener() {
14456
14456
  }
@@ -14458,32 +14458,32 @@ let eb = class {
14458
14458
  }
14459
14459
  replaceChildren() {
14460
14460
  }
14461
- }, nf = class {
14461
+ }, tf = class {
14462
14462
  createElement() {
14463
- return new Ma();
14463
+ return new wa();
14464
14464
  }
14465
14465
  addEventListener() {
14466
14466
  }
14467
14467
  removeEventListener() {
14468
14468
  }
14469
14469
  get documentElement() {
14470
- return new Ma();
14470
+ return new wa();
14471
14471
  }
14472
14472
  };
14473
- function rf() {
14473
+ function nf() {
14474
14474
  const n = globalThis.window;
14475
14475
  globalThis.window ?? (globalThis.window = {
14476
14476
  visualViewport: null
14477
14477
  });
14478
14478
  const e = globalThis.document;
14479
- return globalThis.document ?? (globalThis.document = new nf()), function() {
14479
+ return globalThis.document ?? (globalThis.document = new tf()), function() {
14480
14480
  globalThis.window !== n && (globalThis.window = n), globalThis.document !== e && (globalThis.document = e);
14481
14481
  };
14482
14482
  }
14483
14483
  function sn(n, e) {
14484
14484
  return n instanceof sr ? 1 : e instanceof sr ? -1 : n.getPos() - e.getPos();
14485
14485
  }
14486
- const On = 0, Na = 1, Dr = 2, rr = 3;
14486
+ const On = 0, Ma = 1, Dr = 2, rr = 3;
14487
14487
  class mr {
14488
14488
  constructor(e, t, r, s, o) {
14489
14489
  F(this, "parent");
@@ -14807,7 +14807,7 @@ class mr {
14807
14807
  if (r == i ? e <= i && t >= r : e < i && t > r) {
14808
14808
  const l = r + o.border, a = i - o.border;
14809
14809
  if (e >= l && t <= a) {
14810
- this.dirty = e == r || t == i ? Dr : Na, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = rr : o.markDirty(e - l, t - l);
14810
+ this.dirty = e == r || t == i ? Dr : Ma, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = rr : o.markDirty(e - l, t - l);
14811
14811
  return;
14812
14812
  } else
14813
14813
  o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? Dr : rr;
@@ -14819,7 +14819,7 @@ class mr {
14819
14819
  markParentsDirty() {
14820
14820
  let e = 1;
14821
14821
  for (let t = this.parent; t; t = t.parent, e++) {
14822
- const r = e == 1 ? Dr : Na;
14822
+ const r = e == 1 ? Dr : Ma;
14823
14823
  t.dirty < r && (t.dirty = r);
14824
14824
  }
14825
14825
  }
@@ -15091,12 +15091,12 @@ function ab(n, e) {
15091
15091
  if (n[t] !== e[t]) return !0;
15092
15092
  return !1;
15093
15093
  }
15094
- function Da(n) {
15094
+ function Na(n) {
15095
15095
  return !n.someProp("editable", (e) => e(n.state) === !1);
15096
15096
  }
15097
- class Oa extends Zp {
15097
+ class Da extends Zp {
15098
15098
  constructor(t, r) {
15099
- const s = rf();
15099
+ const s = nf();
15100
15100
  super(t, {
15101
15101
  state: ot.create({
15102
15102
  schema: r.state.schema,
@@ -15109,7 +15109,7 @@ class Oa extends Zp {
15109
15109
  F(this, "_props");
15110
15110
  s(), this.shouldUpdatePluginViews = !0, this._props = r, this.oldProps = {
15111
15111
  state: r.state
15112
- }, this.state = r.state, this.domObserver.stop(), this.domObserver = new Zy(this), this.domObserver.start(), this.editable = Da(this), this.docView.dom.replaceChildren(), this.docView = r.docView;
15112
+ }, this.state = r.state, this.domObserver.stop(), this.domObserver = new Zy(this), this.domObserver.start(), this.editable = Na(this), this.docView.dom.replaceChildren(), this.docView = r.docView;
15113
15113
  }
15114
15114
  /**
15115
15115
  * Whether the EditorView's updateStateInner method thinks that the
@@ -15139,7 +15139,7 @@ class Oa extends Zp {
15139
15139
  this._props = {
15140
15140
  ...this._props,
15141
15141
  ...t
15142
- }, this.state = this._props.state, this.editable = Da(this);
15142
+ }, this.state = this._props.state, this.editable = Na(this);
15143
15143
  }
15144
15144
  /**
15145
15145
  * Triggers any side effects that have been queued by previous
@@ -15176,11 +15176,11 @@ const cb = new ls({
15176
15176
  }), ub = ot.create({
15177
15177
  schema: cb
15178
15178
  });
15179
- let Ea = !1;
15179
+ let Oa = !1;
15180
15180
  function fb(n, e) {
15181
- process.env.NODE_ENV !== "production" && e.defaultState !== void 0 && e.state !== void 0 && !Ea && (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"), Ea = !0);
15181
+ process.env.NODE_ENV !== "production" && e.defaultState !== void 0 && e.state !== void 0 && !Oa && (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"), Oa = !0);
15182
15182
  const t = I(!0), [r, s] = N(null), o = mi(), i = e.defaultState ?? ub, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ob(), h = He((B) => {
15183
- Pi(() => {
15183
+ Ii(() => {
15184
15184
  s(B);
15185
15185
  });
15186
15186
  }, []), p = Me(() => [
@@ -15192,13 +15192,13 @@ function fb(n, e) {
15192
15192
  u,
15193
15193
  h
15194
15194
  ]), y = He(function(v) {
15195
- t.current ? Pi(() => {
15195
+ t.current ? Ii(() => {
15196
15196
  e.state || a((D) => D.apply(v)), e.dispatchTransaction && e.dispatchTransaction.call(this, v);
15197
15197
  }) : (e.state || a((D) => D.apply(v)), e.dispatchTransaction && e.dispatchTransaction.call(this, v));
15198
15198
  }, [
15199
15199
  e.dispatchTransaction,
15200
15200
  e.state
15201
- ]), m = rf(), x = document.createElement("div");
15201
+ ]), m = nf(), x = document.createElement("div");
15202
15202
  m();
15203
15203
  const k = I(new pi(void 0, [], () => -1, c.doc, [], U.empty, x, null, x, () => !1, () => {
15204
15204
  }, () => {
@@ -15212,7 +15212,7 @@ function fb(n, e) {
15212
15212
  // During the initial render, we create something of a dummy
15213
15213
  // EditorView. This allows us to ensure that the first render actually
15214
15214
  // renders the document, which is necessary for SSR.
15215
- () => new Oa(null, M)
15215
+ () => new Da(null, M)
15216
15216
  );
15217
15217
  return X(() => () => {
15218
15218
  P == null || P.destroy();
@@ -15224,7 +15224,7 @@ function fb(n, e) {
15224
15224
  return;
15225
15225
  }
15226
15226
  if (!P || P.dom !== n) {
15227
- const B = new Oa({
15227
+ const B = new Da({
15228
15228
  mount: n
15229
15229
  }, M);
15230
15230
  z(B), B.dom.addEventListener("compositionend", o);
@@ -15275,7 +15275,7 @@ function db(n) {
15275
15275
  r.forEach((c) => c()), r.clear();
15276
15276
  })), X(() => (s.current = !0, () => {
15277
15277
  s.current = !1;
15278
- }), []), /* @__PURE__ */ A.createElement(Xu.Provider, {
15278
+ }), []), /* @__PURE__ */ A.createElement(Gu.Provider, {
15279
15279
  value: a
15280
15280
  }, e);
15281
15281
  }
@@ -15408,7 +15408,7 @@ function mb() {
15408
15408
  const { view: n } = ie(Vt);
15409
15409
  return n && Ro.getState(n.state);
15410
15410
  }
15411
- var sf = { exports: {} };
15411
+ var rf = { exports: {} };
15412
15412
  /*!
15413
15413
  Copyright (c) 2018 Jed Watson.
15414
15414
  Licensed under the MIT License (MIT), see
@@ -15443,24 +15443,24 @@ var sf = { exports: {} };
15443
15443
  }
15444
15444
  n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
15445
15445
  })();
15446
- })(sf);
15447
- var gb = sf.exports;
15446
+ })(rf);
15447
+ var gb = rf.exports;
15448
15448
  const yb = /* @__PURE__ */ Wf(gb);
15449
- let Ta = !1;
15449
+ let Ea = !1;
15450
15450
  function bb() {
15451
- if (Ta) return;
15451
+ if (Ea) return;
15452
15452
  const n = console.error;
15453
15453
  console.error = function() {
15454
15454
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
15455
15455
  t[r] = arguments[r];
15456
15456
  const [s, o, i] = t;
15457
15457
  typeof s == "string" && s.includes("Invalid DOM property `%s`. Did you mean `%s`?") && o === "STYLE" && i === "style" || n(...t);
15458
- }, Ta = !0;
15458
+ }, Ea = !0;
15459
15459
  }
15460
15460
  function xb(n, e) {
15461
15461
  return "STYLE" in n ? "STYLE" in e ? `${n.STYLE.match(/;\s*$/) ? n.STYLE : `${n.STYLE}`} ${e.STYLE}` : n.STYLE : "STYLE" in e ? e.STYLE : void 0;
15462
15462
  }
15463
- function of(n, e) {
15463
+ function sf(n, e) {
15464
15464
  return {
15465
15465
  ...n,
15466
15466
  ...e,
@@ -15472,7 +15472,7 @@ function of(n, e) {
15472
15472
  }
15473
15473
  };
15474
15474
  }
15475
- function lf(n) {
15475
+ function of(n) {
15476
15476
  bb();
15477
15477
  const e = {};
15478
15478
  for (const [t, r] of Object.entries(n))
@@ -15636,7 +15636,7 @@ function lf(n) {
15636
15636
  }
15637
15637
  return e;
15638
15638
  }
15639
- function af(n) {
15639
+ function lf(n) {
15640
15640
  if (!Array.isArray(n))
15641
15641
  throw new Error("@handlewithcare/react-prosemirror only supports strings and arrays in toDOM");
15642
15642
  const e = n[1];
@@ -15644,7 +15644,7 @@ function af(n) {
15644
15644
  e && typeof e == "object" && e.nodeType == null && !Array.isArray(e) && (t = 2);
15645
15645
  for (let r = t; r < n.length; r++) {
15646
15646
  const s = n[r];
15647
- if (s === 0 || af(s)) return !0;
15647
+ if (s === 0 || lf(s)) return !0;
15648
15648
  }
15649
15649
  return !1;
15650
15650
  }
@@ -15659,7 +15659,7 @@ const yi = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15659
15659
  ref: t,
15660
15660
  ...i
15661
15661
  }, f = 1;
15662
- c && typeof c == "object" && c.nodeType == null && !Array.isArray(c) && (f = 2, u = of(lf(c), u));
15662
+ c && typeof c == "object" && c.nodeType == null && !Array.isArray(c) && (f = 2, u = sf(of(c), u));
15663
15663
  const d = [];
15664
15664
  for (let h = f; h < r.length; h++) {
15665
15665
  const p = r[h];
@@ -15672,8 +15672,8 @@ const yi = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15672
15672
  outputSpec: p
15673
15673
  }, o));
15674
15674
  }
15675
- return s && !af(r) && d.push(o), /* @__PURE__ */ Hn(a, u, ...d);
15676
- })), cf = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15675
+ return s && !lf(r) && d.push(o), /* @__PURE__ */ Hn(a, u, ...d);
15676
+ })), af = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15677
15677
  let { mark: r, getPos: s, children: o } = e;
15678
15678
  const { siblingsRef: i, parentRef: l } = ie(Oe), a = I(void 0), c = I([]), u = I(null);
15679
15679
  rs(t, () => u.current, []);
@@ -15862,9 +15862,9 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
15862
15862
  return /* @__PURE__ */ A.createElement(Oe.Provider, {
15863
15863
  value: v
15864
15864
  }, ee);
15865
- }), Nb = ct(null), Db = ct(null), uf = ct(null), Ob = /* @__PURE__ */ Fe(function(e) {
15865
+ }), Nb = ct(null), Db = ct(null), cf = ct(null), Ob = /* @__PURE__ */ Fe(function(e) {
15866
15866
  let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
15867
- const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Uu);
15867
+ const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Ku);
15868
15868
  let d = null;
15869
15869
  const h = f[s.type.name], p = Me(() => {
15870
15870
  var D, L;
@@ -15924,14 +15924,14 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
15924
15924
  ]);
15925
15925
  return /* @__PURE__ */ A.createElement(Db.Provider, {
15926
15926
  value: k
15927
- }, /* @__PURE__ */ A.createElement(uf.Provider, {
15927
+ }, /* @__PURE__ */ A.createElement(cf.Provider, {
15928
15928
  value: x
15929
15929
  }, /* @__PURE__ */ A.createElement(Nb.Provider, {
15930
15930
  value: M
15931
15931
  }, /* @__PURE__ */ A.createElement(Oe.Provider, {
15932
15932
  value: v
15933
15933
  }, B))));
15934
- }), ff = /* @__PURE__ */ Fe(function(e) {
15934
+ }), uf = /* @__PURE__ */ Fe(function(e) {
15935
15935
  let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
15936
15936
  const { view: l } = ie(Vt), a = l == null ? void 0 : l.someProp("nodeViews", (c) => c == null ? void 0 : c[s.type.name]);
15937
15937
  return a ? /* @__PURE__ */ A.createElement(Mb, {
@@ -15984,10 +15984,10 @@ var Vo = { exports: {} }, Te = {};
15984
15984
  * This source code is licensed under the MIT license found in the
15985
15985
  * LICENSE file in the root directory of this source tree.
15986
15986
  */
15987
- var Aa;
15987
+ var Ta;
15988
15988
  function Tb() {
15989
- if (Aa) return Te;
15990
- Aa = 1;
15989
+ if (Ta) return Te;
15990
+ Ta = 1;
15991
15991
  function n(i) {
15992
15992
  var l = "https://react.dev/errors/" + i;
15993
15993
  if (1 < arguments.length) {
@@ -16127,9 +16127,9 @@ var Ae = {};
16127
16127
  * This source code is licensed under the MIT license found in the
16128
16128
  * LICENSE file in the root directory of this source tree.
16129
16129
  */
16130
- var Ra;
16130
+ var Aa;
16131
16131
  function Ab() {
16132
- return Ra || (Ra = 1, process.env.NODE_ENV !== "production" && function() {
16132
+ return Aa || (Aa = 1, process.env.NODE_ENV !== "production" && function() {
16133
16133
  function n(o) {
16134
16134
  var i = o, l = o;
16135
16135
  if (o.alternate) for (; i.return; ) i = i.return;
@@ -16390,8 +16390,8 @@ function jb(n) {
16390
16390
  });
16391
16391
  }
16392
16392
  function gs(n, e) {
16393
- const { nodeName: t, ...r } = e.type.attrs, s = lf(r);
16394
- return t || typeof n == "string" ? /* @__PURE__ */ Hn(t ?? "span", s, n) : /* @__PURE__ */ ss(n, of(n.props, s));
16393
+ const { nodeName: t, ...r } = e.type.attrs, s = of(r);
16394
+ return t || typeof n == "string" ? /* @__PURE__ */ Hn(t ?? "span", s, n) : /* @__PURE__ */ ss(n, sf(n.props, s));
16395
16395
  }
16396
16396
  function Gs(n, e) {
16397
16397
  var t, r, s;
@@ -16423,7 +16423,7 @@ const Fb = /* @__PURE__ */ Fe(function(e) {
16423
16423
  parentRef: a,
16424
16424
  decorations: t.outerDeco
16425
16425
  });
16426
- }) : /* @__PURE__ */ A.createElement(ff, {
16426
+ }) : /* @__PURE__ */ A.createElement(uf, {
16427
16427
  key: t.key,
16428
16428
  node: t.node,
16429
16429
  getPos: o,
@@ -16435,7 +16435,7 @@ const Fb = /* @__PURE__ */ Fe(function(e) {
16435
16435
  const s = t[0], o = I(() => r.current() + s.offset);
16436
16436
  o.current = () => r.current() + s.offset;
16437
16437
  const i = s.marks[0];
16438
- return i ? /* @__PURE__ */ A.createElement(cf, {
16438
+ return i ? /* @__PURE__ */ A.createElement(af, {
16439
16439
  getPos: o,
16440
16440
  key: s.key,
16441
16441
  mark: i
@@ -16519,10 +16519,10 @@ function Wb(n, e) {
16519
16519
  const _b = /* @__PURE__ */ Fe(function(e) {
16520
16520
  let { child: t, getInnerPos: r } = e;
16521
16521
  const s = I(() => r.current() + t.offset);
16522
- return s.current = () => r.current() + t.offset, t.type === "node" ? t.marks.reduce((o, i) => /* @__PURE__ */ A.createElement(cf, {
16522
+ return s.current = () => r.current() + t.offset, t.type === "node" ? t.marks.reduce((o, i) => /* @__PURE__ */ A.createElement(af, {
16523
16523
  getPos: s,
16524
16524
  mark: i
16525
- }, o), /* @__PURE__ */ A.createElement(ff, {
16525
+ }, o), /* @__PURE__ */ A.createElement(uf, {
16526
16526
  key: t.key,
16527
16527
  outerDeco: t.outerDeco,
16528
16528
  node: t.node,
@@ -16643,10 +16643,10 @@ const or = /* @__PURE__ */ Fe(function(e) {
16643
16643
  if (!s) return y;
16644
16644
  const m = i.filter((k) => !k.inline);
16645
16645
  return m.length ? m.reduce(gs, y) : y;
16646
- })), df = /* @__PURE__ */ ct(null);
16646
+ })), ff = /* @__PURE__ */ ct(null);
16647
16647
  function Jb(n, e) {
16648
16648
  let { as: t, ...r } = n;
16649
- const s = I([]), o = I(null), { setMount: i, ...l } = ie(df), a = I(void 0);
16649
+ const s = I([]), o = I(null), { setMount: i, ...l } = ie(ff), a = I(void 0);
16650
16650
  rs(e, () => o.current, []);
16651
16651
  const c = Me(() => ({
16652
16652
  parentRef: a,
@@ -16666,7 +16666,7 @@ function Jb(n, e) {
16666
16666
  as: t
16667
16667
  }));
16668
16668
  }
16669
- const hf = /* @__PURE__ */ Ge(Jb), Kb = [];
16669
+ const df = /* @__PURE__ */ Ge(Jb), Kb = [];
16670
16670
  function Ub(n) {
16671
16671
  var p;
16672
16672
  let { className: e, children: t, nodeViews: r, customNodeViews: s, ...o } = n;
@@ -16698,13 +16698,13 @@ function Ub(n) {
16698
16698
  value: a
16699
16699
  }, /* @__PURE__ */ A.createElement(wy.Provider, {
16700
16700
  value: c
16701
- }, /* @__PURE__ */ A.createElement(Uu.Provider, {
16701
+ }, /* @__PURE__ */ A.createElement(Ku.Provider, {
16702
16702
  value: d
16703
- }, /* @__PURE__ */ A.createElement(df.Provider, {
16703
+ }, /* @__PURE__ */ A.createElement(ff.Provider, {
16704
16704
  value: h
16705
16705
  }, t))));
16706
16706
  }
16707
- function pf(n) {
16707
+ function hf(n) {
16708
16708
  return /* @__PURE__ */ A.createElement(db, null, /* @__PURE__ */ A.createElement(Ub, n));
16709
16709
  }
16710
16710
  function me(n) {
@@ -16721,8 +16721,8 @@ function me(n) {
16721
16721
  t
16722
16722
  ]);
16723
16723
  }
16724
- function xi(n) {
16725
- const e = ie(uf), t = me(n);
16724
+ function pf(n) {
16725
+ const e = ie(cf), t = me(n);
16726
16726
  ft(() => {
16727
16727
  e(t);
16728
16728
  }, [
@@ -17275,7 +17275,7 @@ const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
17275
17275
  const s = n.nodes.blockquote;
17276
17276
  r.push({
17277
17277
  icon: /* @__PURE__ */ g.jsx(O.Quote, {}),
17278
- command: (o, i) => Oc(s)(o, i)
17278
+ command: (o, i) => Dc(s)(o, i)
17279
17279
  //isSelected: (s) => wrapIn(node)(s),
17280
17280
  });
17281
17281
  }
@@ -17293,10 +17293,10 @@ const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
17293
17293
  const f = me((d) => {
17294
17294
  d && (c ? _m(d, o, l, n) : qm(d, r, l, n), d.focus(), t());
17295
17295
  });
17296
- return /* @__PURE__ */ g.jsxs(Va, { isOpen: e, onClose: t, children: [
17296
+ return /* @__PURE__ */ g.jsxs(va, { isOpen: e, onClose: t, children: [
17297
17297
  /* @__PURE__ */ g.jsx("h1", { children: "Вставка картинки" }),
17298
17298
  /* @__PURE__ */ g.jsxs(
17299
- $a,
17299
+ Va,
17300
17300
  {
17301
17301
  submit: "Вставить",
17302
17302
  submitType: "Success",
@@ -17351,10 +17351,10 @@ const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
17351
17351
  const u = xs(r);
17352
17352
  a.dispatch(a.state.tr.replaceSelectionWith(c.create({ src: u, title: o }))), a.focus(), t();
17353
17353
  });
17354
- return n.nodes.video ? /* @__PURE__ */ g.jsxs(Va, { isOpen: e, onClose: t, children: [
17354
+ return n.nodes.video ? /* @__PURE__ */ g.jsxs(va, { isOpen: e, onClose: t, children: [
17355
17355
  /* @__PURE__ */ g.jsx("h1", { children: "Вставка видео" }),
17356
17356
  /* @__PURE__ */ g.jsxs(
17357
- $a,
17357
+ Va,
17358
17358
  {
17359
17359
  submit: "Вставить",
17360
17360
  submitType: "Success",
@@ -17457,7 +17457,7 @@ function y0() {
17457
17457
  }
17458
17458
  const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { items: [{
17459
17459
  icon: /* @__PURE__ */ g.jsx(O.JoinUp, {}),
17460
- command: wc
17460
+ command: Cc
17461
17461
  }, {
17462
17462
  icon: /* @__PURE__ */ g.jsx(O.IndentDecrease, {}),
17463
17463
  command: oo
@@ -17480,7 +17480,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17480
17480
  ] }), Df = Ge(
17481
17481
  function({ children: e, nodeProps: t, ...r }, s) {
17482
17482
  const [o, i] = N(t.node.attrs.title ?? ""), [l, a] = N(!1), [c, u] = N("");
17483
- xi(() => !0), ft((p) => {
17483
+ pf((p, y) => p ? ["keydown", "keyup", "keypress", "beforeinput"].includes(y.type) : !1), ft((p) => {
17484
17484
  if (u(""), a(!1), !p || !p.state.schema.nodes.carousel) return;
17485
17485
  const y = t.getPos(), m = p.state.doc.resolve(y).parent;
17486
17486
  if (a(m.type.name !== "carousel"), m.type.name === "carousel") {
@@ -17526,7 +17526,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17526
17526
  }
17527
17527
  ),
17528
17528
  /* @__PURE__ */ g.jsx("div", { children: /* @__PURE__ */ g.jsx(
17529
- za,
17529
+ $a,
17530
17530
  {
17531
17531
  value: o,
17532
17532
  placeholder: "Подпись под изображением (не обязательно)",
@@ -17545,7 +17545,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17545
17545
  ), Of = Ge(
17546
17546
  function({ children: e, nodeProps: t, ...r }, s) {
17547
17547
  const [o, i] = N(""), [l, a] = N(t.node.attrs.title ?? ""), c = "fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share";
17548
- xi(() => !0), q(() => {
17548
+ pf(() => !0), q(() => {
17549
17549
  i(xs(t.node.attrs.src));
17550
17550
  }, [t]);
17551
17551
  const u = me((f, d) => {
@@ -17571,7 +17571,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17571
17571
  children: [
17572
17572
  o ? /* @__PURE__ */ g.jsx("iframe", { src: o, allow: c }) : /* @__PURE__ */ g.jsx("img", { src: yf }),
17573
17573
  /* @__PURE__ */ g.jsx("div", { children: /* @__PURE__ */ g.jsx(
17574
- za,
17574
+ $a,
17575
17575
  {
17576
17576
  value: l,
17577
17577
  placeholder: "Подпись под видео (не обязательно)",
@@ -17624,7 +17624,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17624
17624
  const h = ot.create({
17625
17625
  doc: p0(e),
17626
17626
  schema: Pr,
17627
- plugins: Ku({ schema: Pr, upload: o })
17627
+ plugins: Ju({ schema: Pr, upload: o })
17628
17628
  });
17629
17629
  c(h), n !== !1 && l(typeof n == "string" ? n : "");
17630
17630
  }, [n, e]);
@@ -17644,7 +17644,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17644
17644
  }
17645
17645
  ),
17646
17646
  /* @__PURE__ */ g.jsxs(
17647
- pf,
17647
+ hf,
17648
17648
  {
17649
17649
  state: a,
17650
17650
  dispatchTransaction: (h) => c((p) => {
@@ -17658,7 +17658,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17658
17658
  children: [
17659
17659
  /* @__PURE__ */ g.jsxs("div", { className: "ProseNotesContent", children: [
17660
17660
  /* @__PURE__ */ g.jsx(b0, { schema: Pr }),
17661
- /* @__PURE__ */ g.jsx(hf, {})
17661
+ /* @__PURE__ */ g.jsx(df, {})
17662
17662
  ] }),
17663
17663
  (t || r) && /* @__PURE__ */ g.jsxs("div", { className: "ProseNotesButtons", children: [
17664
17664
  r && /* @__PURE__ */ g.jsx("span", { className: "a small", onClick: d, children: "Отменить" }),
@@ -17909,7 +17909,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
17909
17909
  id: "splitCell",
17910
17910
  text: "Split cell",
17911
17911
  icon: /* @__PURE__ */ g.jsx(O.CellsSplit, {})
17912
- }], Ia = ({
17912
+ }], Ra = ({
17913
17913
  parent: n,
17914
17914
  isRowMenuOpen: e,
17915
17915
  isCellMenuOpen: t,
@@ -18014,7 +18014,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18014
18014
  }
18015
18015
  )
18016
18016
  ] }) : null;
18017
- }, Pa = ({ parent: n, isResizible: e, onWidth: t }) => {
18017
+ }, Ia = ({ parent: n, isResizible: e, onWidth: t }) => {
18018
18018
  const [r, s] = N(!1), [o, i] = N(0);
18019
18019
  q(() => {
18020
18020
  const a = () => {
@@ -18039,7 +18039,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18039
18039
  onMouseDown: l
18040
18040
  }
18041
18041
  );
18042
- }, va = Ge(
18042
+ }, Pa = Ge(
18043
18043
  function({ children: e, nodeProps: t, ...r }, s) {
18044
18044
  const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, h] = N(!1), [p, y] = N();
18045
18045
  q(() => {
@@ -18078,7 +18078,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18078
18078
  children: [
18079
18079
  e,
18080
18080
  /* @__PURE__ */ g.jsx(
18081
- Pa,
18081
+ Ia,
18082
18082
  {
18083
18083
  parent: o.current,
18084
18084
  isResizible: d,
@@ -18086,7 +18086,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18086
18086
  }
18087
18087
  ),
18088
18088
  /* @__PURE__ */ g.jsx(
18089
- Ia,
18089
+ Ra,
18090
18090
  {
18091
18091
  parent: o.current,
18092
18092
  isRowMenuOpen: i,
@@ -18117,7 +18117,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18117
18117
  children: [
18118
18118
  e,
18119
18119
  /* @__PURE__ */ g.jsx(
18120
- Pa,
18120
+ Ia,
18121
18121
  {
18122
18122
  parent: o.current,
18123
18123
  isResizible: d,
@@ -18125,7 +18125,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18125
18125
  }
18126
18126
  ),
18127
18127
  /* @__PURE__ */ g.jsx(
18128
- Ia,
18128
+ Ra,
18129
18129
  {
18130
18130
  parent: o.current,
18131
18131
  isRowMenuOpen: i,
@@ -18147,7 +18147,7 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18147
18147
  const D = v.scrollLeft, L = v.clientWidth, ee = v.scrollWidth;
18148
18148
  f(D > 0), h(D < ee - L * 1.5);
18149
18149
  };
18150
- xi(() => !0), q(() => {
18150
+ q(() => {
18151
18151
  o.current && (m && o.current.scrollWidth > m && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), x(o.current.scrollWidth));
18152
18152
  }, [(B = o.current) == null ? void 0 : B.scrollWidth]), q(() => {
18153
18153
  y(t.getPos() + t.node.nodeSize - 1), c(t.node.childCount > 1), o.current && t.node.childCount > 1 && k(o.current);
@@ -18192,12 +18192,12 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18192
18192
  let l = ot.create({
18193
18193
  doc: i,
18194
18194
  schema: Nt,
18195
- plugins: Ku({ schema: Nt, upload: r })
18195
+ plugins: Ju({ schema: Nt, upload: r })
18196
18196
  });
18197
18197
  const a = ui(l);
18198
18198
  a && (l = l.apply(a.setMeta("addToHistory", !1))), o(l);
18199
18199
  }, [n]), s ? /* @__PURE__ */ g.jsx("div", { className: "ProseEditor", children: /* @__PURE__ */ g.jsxs(
18200
- pf,
18200
+ hf,
18201
18201
  {
18202
18202
  state: s,
18203
18203
  dispatchTransaction: (i) => o((l) => {
@@ -18208,13 +18208,13 @@ const Nf = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(lr, { ite
18208
18208
  image: Df,
18209
18209
  video: Of,
18210
18210
  table: D0,
18211
- table_header: va,
18212
- table_cell: va,
18211
+ table_header: Pa,
18212
+ table_cell: Pa,
18213
18213
  carousel: A0
18214
18214
  },
18215
18215
  children: [
18216
18216
  /* @__PURE__ */ g.jsx(w0, { schema: Nt, onSave: e }),
18217
- /* @__PURE__ */ g.jsx(hf, {})
18217
+ /* @__PURE__ */ g.jsx(df, {})
18218
18218
  ]
18219
18219
  }
18220
18220
  ) }) : null;