@alxgrn/prose-editor 0.0.47 → 0.0.49

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.
@@ -3,11 +3,11 @@ var Fc = (r, e, t) => e in r ? Bc(r, e, { enumerable: !0, configurable: !0, writ
3
3
  var W = (r, e, t) => Fc(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import I, { createContext as tt, useLayoutEffect as Lc, useContext as me, forwardRef as Ve, useState as M, useRef as j, useImperativeHandle as ir, useCallback as oe, useMemo as Ne, useReducer as $c, memo as je, createElement as lr, cloneElement as Sr, Component as Wc, useEffect as q } from "react";
5
5
  import { unstable_batchedUpdates as _c, flushSync as Ro, createPortal as qc } from "react-dom";
6
- import { Icons as E, Prompt as Jc, Modal as pl, Form as ml, Image as Hc, Input as Mt, Editable as ds, Button as Kc, Menu as kn } from "@alxgrn/telefrag-ui";
6
+ import { Icons as E, Prompt as Jc, Modal as pl, Form as ml, Image as Hc, Input as Mt, Editable as ds, Button as Kc, Menu as wn } from "@alxgrn/telefrag-ui";
7
7
  function Uc(r) {
8
8
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
9
9
  }
10
- var hs = { exports: {} }, hn = {};
10
+ var hs = { exports: {} }, pn = {};
11
11
  /**
12
12
  * @license React
13
13
  * react-jsx-runtime.production.js
@@ -19,7 +19,7 @@ var hs = { exports: {} }, hn = {};
19
19
  */
20
20
  var Io;
21
21
  function Yc() {
22
- if (Io) return hn;
22
+ if (Io) return pn;
23
23
  Io = 1;
24
24
  var r = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
25
25
  function t(n, s, o) {
@@ -37,9 +37,9 @@ function Yc() {
37
37
  props: o
38
38
  };
39
39
  }
40
- return hn.Fragment = e, hn.jsx = t, hn.jsxs = t, hn;
40
+ return pn.Fragment = e, pn.jsx = t, pn.jsxs = t, pn;
41
41
  }
42
- var pn = {};
42
+ var mn = {};
43
43
  /**
44
44
  * @license React
45
45
  * react-jsx-runtime.development.js
@@ -68,7 +68,7 @@ function Gc() {
68
68
  return "StrictMode";
69
69
  case ae:
70
70
  return "Suspense";
71
- case un:
71
+ case fn:
72
72
  return "SuspenseList";
73
73
  }
74
74
  if (typeof x == "object")
@@ -116,7 +116,7 @@ function Gc() {
116
116
  function n() {
117
117
  }
118
118
  function s() {
119
- if (fn === 0) {
119
+ if (dn === 0) {
120
120
  ko = console.log, wo = console.info, Co = console.warn, So = console.error, Mo = console.group, No = console.groupCollapsed, Oo = console.groupEnd;
121
121
  var x = {
122
122
  configurable: !0,
@@ -134,10 +134,10 @@ function Gc() {
134
134
  groupEnd: x
135
135
  });
136
136
  }
137
- fn++;
137
+ dn++;
138
138
  }
139
139
  function o() {
140
- if (fn--, fn === 0) {
140
+ if (dn--, dn === 0) {
141
141
  var x = { configurable: !0, enumerable: !0, writable: !0 };
142
142
  Object.defineProperties(console, {
143
143
  log: wt({}, x, { value: ko }),
@@ -149,7 +149,7 @@ function Gc() {
149
149
  groupEnd: wt({}, x, { value: Oo })
150
150
  });
151
151
  }
152
- 0 > fn && console.error(
152
+ 0 > dn && console.error(
153
153
  "disabledDepth fell below zero. This is a bug in React. Please file an issue."
154
154
  );
155
155
  }
@@ -225,10 +225,10 @@ function Gc() {
225
225
  "name",
226
226
  { value: "DetermineComponentFrameRoot" }
227
227
  );
228
- var B = ce.DetermineComponentFrameRoot(), Je = B[0], $t = B[1];
229
- if (Je && $t) {
228
+ var B = ce.DetermineComponentFrameRoot(), Je = B[0], Wt = B[1];
229
+ if (Je && Wt) {
230
230
  var pe = Je.split(`
231
- `), Ct = $t.split(`
231
+ `), Ct = Wt.split(`
232
232
  `);
233
233
  for (B = K = 0; K < pe.length && !pe[K].includes(
234
234
  "DetermineComponentFrameRoot"
@@ -246,12 +246,12 @@ function Gc() {
246
246
  if (K !== 1 || B !== 1)
247
247
  do
248
248
  if (K--, B--, 0 > B || pe[K] !== Ct[B]) {
249
- var dn = `
249
+ var hn = `
250
250
  ` + pe[K].replace(
251
251
  " at new ",
252
252
  " at "
253
253
  );
254
- return x.displayName && dn.includes("<anonymous>") && (dn = dn.replace("<anonymous>", x.displayName)), typeof x == "function" && Br.set(x, dn), dn;
254
+ return x.displayName && hn.includes("<anonymous>") && (hn = hn.replace("<anonymous>", x.displayName)), typeof x == "function" && Br.set(x, hn), hn;
255
255
  }
256
256
  while (1 <= K && 0 <= B);
257
257
  break;
@@ -275,7 +275,7 @@ function Gc() {
275
275
  switch (x) {
276
276
  case ae:
277
277
  return i("Suspense");
278
- case un:
278
+ case fn:
279
279
  return i("SuspenseList");
280
280
  }
281
281
  if (typeof x == "object")
@@ -345,7 +345,7 @@ function Gc() {
345
345
  }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
346
346
  }
347
347
  function p(x, A, v, L, ce, K) {
348
- if (typeof x == "string" || typeof x == "function" || x === S || x === z || x === R || x === ae || x === un || x === Pc || typeof x == "object" && x !== null && (x.$$typeof === Pr || x.$$typeof === Ir || x.$$typeof === G || x.$$typeof === T || x.$$typeof === J || x.$$typeof === jc || x.getModuleId !== void 0)) {
348
+ if (typeof x == "string" || typeof x == "function" || x === S || x === z || x === R || x === ae || x === fn || x === Pc || typeof x == "object" && x !== null && (x.$$typeof === Pr || x.$$typeof === Ir || x.$$typeof === G || x.$$typeof === T || x.$$typeof === J || x.$$typeof === jc || x.getModuleId !== void 0)) {
349
349
  var B = A.children;
350
350
  if (B !== void 0)
351
351
  if (L)
@@ -384,8 +384,8 @@ React keys must be passed directly to JSX without using spread:
384
384
  }
385
385
  if (B = null, v !== void 0 && (t(v), B = "" + v), u(A) && (t(A.key), B = "" + A.key), "key" in A) {
386
386
  v = {};
387
- for (var $t in A)
388
- $t !== "key" && (v[$t] = A[$t]);
387
+ for (var Wt in A)
388
+ Wt !== "key" && (v[Wt] = A[Wt]);
389
389
  } else v = A;
390
390
  return B && f(
391
391
  v,
@@ -433,15 +433,15 @@ Check the render method of \`` + v + "`."), A || (x = r(x)) && (A = `
433
433
 
434
434
  Check the top-level render call using <` + x + ">."), A;
435
435
  }
436
- var w = I, N = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), G = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), un = Symbol.for("react.suspense_list"), Ir = Symbol.for("react.memo"), Pr = Symbol.for("react.lazy"), Pc = Symbol.for("react.offscreen"), bo = Symbol.iterator, Vc = Symbol.for("react.client.reference"), kt = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, xo = Object.prototype.hasOwnProperty, wt = Object.assign, jc = Symbol.for("react.client.reference"), Vr = Array.isArray, fn = 0, ko, wo, Co, So, Mo, No, Oo;
436
+ var w = I, N = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), G = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), fn = Symbol.for("react.suspense_list"), Ir = Symbol.for("react.memo"), Pr = Symbol.for("react.lazy"), Pc = Symbol.for("react.offscreen"), bo = Symbol.iterator, Vc = Symbol.for("react.client.reference"), kt = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, xo = Object.prototype.hasOwnProperty, wt = Object.assign, jc = Symbol.for("react.client.reference"), Vr = Array.isArray, dn = 0, ko, wo, Co, So, Mo, No, Oo;
437
437
  n.__reactDisabledLog = !0;
438
438
  var jr, Do, zr = !1, Br = new (typeof WeakMap == "function" ? WeakMap : Map)(), zc = Symbol.for("react.client.reference"), Eo, To = {}, Ao = {}, vo = {};
439
- pn.Fragment = S, pn.jsx = function(x, A, v, L, ce) {
439
+ mn.Fragment = S, mn.jsx = function(x, A, v, L, ce) {
440
440
  return p(x, A, v, !1, L, ce);
441
- }, pn.jsxs = function(x, A, v, L, ce) {
441
+ }, mn.jsxs = function(x, A, v, L, ce) {
442
442
  return p(x, A, v, !0, L, ce);
443
443
  };
444
- }()), pn;
444
+ }()), mn;
445
445
  }
446
446
  process.env.NODE_ENV === "production" ? hs.exports = Yc() : hs.exports = Gc();
447
447
  var m = hs.exports;
@@ -1116,7 +1116,7 @@ function Et(r, e) {
1116
1116
  let t = e.length - 1;
1117
1117
  t >= 0 && r.isText && r.sameMarkup(e[t]) ? e[t] = r.withText(e[t].text + r.text) : e.push(r);
1118
1118
  }
1119
- function wn(r, e, t, n) {
1119
+ function Cn(r, e, t, n) {
1120
1120
  let s = (e || r).node(t), o = 0, i = e ? e.index(t) : s.childCount;
1121
1121
  r && (o = r.index(t), r.depth > t ? o++ : r.textOffset && (Et(r.nodeAfter, n), o++));
1122
1122
  for (let l = o; l < i; l++)
@@ -1128,15 +1128,15 @@ function Tt(r, e) {
1128
1128
  }
1129
1129
  function Cl(r, e, t, n, s) {
1130
1130
  let o = r.depth > s && ps(r, e, s + 1), i = n.depth > s && ps(t, n, s + 1), l = [];
1131
- return wn(null, r, s, l), o && i && e.index(s) == t.index(s) ? (wl(o, i), Et(Tt(o, Cl(r, e, t, n, s + 1)), l)) : (o && Et(Tt(o, ur(r, e, s + 1)), l), wn(e, t, s, l), i && Et(Tt(i, ur(t, n, s + 1)), l)), wn(n, null, s, l), new C(l);
1131
+ return Cn(null, r, s, l), o && i && e.index(s) == t.index(s) ? (wl(o, i), Et(Tt(o, Cl(r, e, t, n, s + 1)), l)) : (o && Et(Tt(o, ur(r, e, s + 1)), l), Cn(e, t, s, l), i && Et(Tt(i, ur(t, n, s + 1)), l)), Cn(n, null, s, l), new C(l);
1132
1132
  }
1133
1133
  function ur(r, e, t) {
1134
1134
  let n = [];
1135
- if (wn(null, r, t, n), r.depth > t) {
1135
+ if (Cn(null, r, t, n), r.depth > t) {
1136
1136
  let s = ps(r, e, t + 1);
1137
1137
  Et(Tt(s, ur(r, e, t + 1)), n);
1138
1138
  }
1139
- return wn(e, null, t, n), new C(n);
1139
+ return Cn(e, null, t, n), new C(n);
1140
1140
  }
1141
1141
  function Qc(r, e) {
1142
1142
  let t = e.depth - r.openStart, s = e.node(t).copy(r.content);
@@ -1147,7 +1147,7 @@ function Qc(r, e) {
1147
1147
  end: s.resolveNoCache(s.content.size - r.openEnd - t)
1148
1148
  };
1149
1149
  }
1150
- class Nn {
1150
+ class On {
1151
1151
  /**
1152
1152
  @internal
1153
1153
  */
@@ -1375,7 +1375,7 @@ class Nn {
1375
1375
  break;
1376
1376
  o = c - 1, s += a + 1;
1377
1377
  }
1378
- return new Nn(t, n, o);
1378
+ return new On(t, n, o);
1379
1379
  }
1380
1380
  /**
1381
1381
  @internal
@@ -1390,7 +1390,7 @@ class Nn {
1390
1390
  }
1391
1391
  else
1392
1392
  Vo.set(e, n = new Zc());
1393
- let s = n.elts[n.i] = Nn.resolve(e, t);
1393
+ let s = n.elts[n.i] = On.resolve(e, t);
1394
1394
  return n.i = (n.i + 1) % eu, s;
1395
1395
  }
1396
1396
  }
@@ -1645,13 +1645,13 @@ class Se {
1645
1645
  [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
1646
1646
  */
1647
1647
  resolve(e) {
1648
- return Nn.resolveCached(this, e);
1648
+ return On.resolveCached(this, e);
1649
1649
  }
1650
1650
  /**
1651
1651
  @internal
1652
1652
  */
1653
1653
  resolveNoCache(e) {
1654
- return Nn.resolve(this, e);
1654
+ return On.resolve(this, e);
1655
1655
  }
1656
1656
  /**
1657
1657
  Test whether a given mark or mark type occurs in this document
@@ -1854,7 +1854,7 @@ function Sl(r, e) {
1854
1854
  e = r[t].type.name + "(" + e + ")";
1855
1855
  return e;
1856
1856
  }
1857
- class Pt {
1857
+ class Vt {
1858
1858
  /**
1859
1859
  @internal
1860
1860
  */
@@ -1867,7 +1867,7 @@ class Pt {
1867
1867
  static parse(e, t) {
1868
1868
  let n = new nu(e, t);
1869
1869
  if (n.next == null)
1870
- return Pt.empty;
1870
+ return Vt.empty;
1871
1871
  let s = Ml(n);
1872
1872
  n.next && n.err("Unexpected trailing text");
1873
1873
  let o = cu(au(s));
@@ -2016,7 +2016,7 @@ class Pt {
2016
2016
  `);
2017
2017
  }
2018
2018
  }
2019
- Pt.empty = new Pt(!0);
2019
+ Vt.empty = new Vt(!0);
2020
2020
  class nu {
2021
2021
  constructor(e, t) {
2022
2022
  this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
@@ -2179,7 +2179,7 @@ function cu(r) {
2179
2179
  });
2180
2180
  });
2181
2181
  });
2182
- let o = e[n.join(",")] = new Pt(n.indexOf(r.length - 1) > -1);
2182
+ let o = e[n.join(",")] = new Vt(n.indexOf(r.length - 1) > -1);
2183
2183
  for (let i = 0; i < s.length; i++) {
2184
2184
  let l = s[i][1].sort(Nl);
2185
2185
  o.next.push({ type: s[i][0], next: e[l.join(",")] || t(l) });
@@ -2262,7 +2262,7 @@ let Bo = class Al {
2262
2262
  True for node types that allow no content.
2263
2263
  */
2264
2264
  get isLeaf() {
2265
- return this.contentMatch == Pt.empty;
2265
+ return this.contentMatch == Vt.empty;
2266
2266
  }
2267
2267
  /**
2268
2268
  True when this node is an atom, i.e. when it does not have
@@ -2503,7 +2503,7 @@ class Nr {
2503
2503
  if (s in this.marks)
2504
2504
  throw new RangeError(s + " can not be both a node and a mark");
2505
2505
  let o = this.nodes[s], i = o.spec.content || "", l = o.spec.marks;
2506
- if (o.contentMatch = n[i] || (n[i] = Pt.parse(i, this.nodes)), o.inlineContent = o.contentMatch.inlineContent, o.spec.linebreakReplacement) {
2506
+ if (o.contentMatch = n[i] || (n[i] = Vt.parse(i, this.nodes)), o.inlineContent = o.contentMatch.inlineContent, o.spec.linebreakReplacement) {
2507
2507
  if (this.linebreakReplacement)
2508
2508
  throw new RangeError("Multiple linebreak nodes defined");
2509
2509
  if (!o.isInline || !o.isLeaf)
@@ -2748,9 +2748,9 @@ const vl = {
2748
2748
  script: !0,
2749
2749
  style: !0,
2750
2750
  title: !0
2751
- }, Rl = { ol: !0, ul: !0 }, On = 1, gs = 2, tr = 4;
2751
+ }, Rl = { ol: !0, ul: !0 }, Dn = 1, gs = 2, tr = 4;
2752
2752
  function Lo(r, e, t) {
2753
- return e != null ? (e ? On : 0) | (e === "full" ? gs : 0) : r && r.whitespace == "pre" ? On | gs : t & -5;
2753
+ return e != null ? (e ? Dn : 0) | (e === "full" ? gs : 0) : r && r.whitespace == "pre" ? Dn | gs : t & -5;
2754
2754
  }
2755
2755
  class Un {
2756
2756
  constructor(e, t, n, s, o, i) {
@@ -2771,7 +2771,7 @@ class Un {
2771
2771
  return this.match.findWrapping(e.type);
2772
2772
  }
2773
2773
  finish(e) {
2774
- if (!(this.options & On)) {
2774
+ if (!(this.options & Dn)) {
2775
2775
  let n = this.content[this.content.length - 1], s;
2776
2776
  if (n && n.isText && (s = /[ \t\r\n\u000c]+$/.exec(n.text))) {
2777
2777
  let o = n;
@@ -2801,7 +2801,7 @@ class $o {
2801
2801
  e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
2802
2802
  }
2803
2803
  addTextNode(e, t) {
2804
- let n = e.nodeValue, s = this.top, o = s.options & gs ? "full" : this.localPreserveWS || (s.options & On) > 0;
2804
+ let n = e.nodeValue, s = this.top, o = s.options & gs ? "full" : this.localPreserveWS || (s.options & Dn) > 0;
2805
2805
  if (o === "full" || s.inlineContext(e) || /[^ \t\r\n\u000c]/.test(n)) {
2806
2806
  if (o)
2807
2807
  o !== "full" ? n = n.replace(/\r?\n|\r/g, " ") : n = n.replace(/\r\n?/g, `
@@ -2984,7 +2984,7 @@ class $o {
2984
2984
  for (let t = this.open; t >= 0; t--) {
2985
2985
  if (this.nodes[t] == e)
2986
2986
  return this.open = t, !0;
2987
- this.localPreserveWS && (this.nodes[t].options |= On);
2987
+ this.localPreserveWS && (this.nodes[t].options |= Dn);
2988
2988
  }
2989
2989
  return !1;
2990
2990
  }
@@ -3412,7 +3412,7 @@ class Ce {
3412
3412
  }
3413
3413
  }
3414
3414
  Ce.empty = new Ce([]);
3415
- class Dn {
3415
+ class En {
3416
3416
  /**
3417
3417
  Create a new mapping with the given position maps.
3418
3418
  */
@@ -3429,7 +3429,7 @@ class Dn {
3429
3429
  Create a mapping that maps only through a part of this one.
3430
3430
  */
3431
3431
  slice(e = 0, t = this.maps.length) {
3432
- return new Dn(this._maps, this.mirror, e, t);
3432
+ return new En(this._maps, this.mirror, e, t);
3433
3433
  }
3434
3434
  /**
3435
3435
  Add a step map to the end of this mapping. If `mirrors` is
@@ -3480,7 +3480,7 @@ class Dn {
3480
3480
  Create an inverted version of this mapping.
3481
3481
  */
3482
3482
  invert() {
3483
- let e = new Dn();
3483
+ let e = new En();
3484
3484
  return e.appendMappingInverted(this), e;
3485
3485
  }
3486
3486
  /**
@@ -3706,7 +3706,7 @@ class ut extends he {
3706
3706
  return new ut(this.pos, this.mark);
3707
3707
  }
3708
3708
  }
3709
- return new Vt(this.pos, this.mark);
3709
+ return new jt(this.pos, this.mark);
3710
3710
  }
3711
3711
  map(e) {
3712
3712
  let t = e.mapResult(this.pos, 1);
@@ -3725,7 +3725,7 @@ class ut extends he {
3725
3725
  }
3726
3726
  }
3727
3727
  he.jsonID("addNodeMark", ut);
3728
- class Vt extends he {
3728
+ class jt extends he {
3729
3729
  /**
3730
3730
  Create a mark-removing step.
3731
3731
  */
@@ -3745,7 +3745,7 @@ class Vt extends he {
3745
3745
  }
3746
3746
  map(e) {
3747
3747
  let t = e.mapResult(this.pos, 1);
3748
- return t.deletedAfter ? null : new Vt(t.pos, this.mark);
3748
+ return t.deletedAfter ? null : new jt(t.pos, this.mark);
3749
3749
  }
3750
3750
  toJSON() {
3751
3751
  return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
@@ -3756,10 +3756,10 @@ class Vt extends he {
3756
3756
  static fromJSON(e, t) {
3757
3757
  if (typeof t.pos != "number")
3758
3758
  throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
3759
- return new Vt(t.pos, e.markFromJSON(t.mark));
3759
+ return new jt(t.pos, e.markFromJSON(t.mark));
3760
3760
  }
3761
3761
  }
3762
- he.jsonID("removeNodeMark", Vt);
3762
+ he.jsonID("removeNodeMark", jt);
3763
3763
  class fe extends he {
3764
3764
  /**
3765
3765
  The given `slice` should fit the 'gap' between `from` and
@@ -4061,7 +4061,7 @@ function vu(r, e, t, n, s) {
4061
4061
  throw new RangeError("Invalid content for node type " + t.name);
4062
4062
  r.step(new ie(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new O(C.from(i), 0, 0), 1, !0));
4063
4063
  }
4064
- function Gt(r, e, t = 1, n) {
4064
+ function Xt(r, e, t = 1, n) {
4065
4065
  let s = r.resolve(e), o = s.depth - t, i = n && n[n.length - 1] || s.parent;
4066
4066
  if (o < 0 || s.parent.type.spec.isolating || !s.parent.canReplace(s.index(), s.parent.childCount) || !i.type.validContent(s.parent.content.cutByIndex(s.index(), s.parent.childCount)))
4067
4067
  return !1;
@@ -4087,7 +4087,7 @@ function Ru(r, e, t = 1, n) {
4087
4087
  }
4088
4088
  r.step(new fe(e, e, new O(o.append(i), t, t), !0));
4089
4089
  }
4090
- function an(r, e) {
4090
+ function cn(r, e) {
4091
4091
  let t = r.resolve(e), n = t.index();
4092
4092
  return Ll(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
4093
4093
  }
@@ -4253,9 +4253,9 @@ class ju {
4253
4253
  let { content: e, openStart: t, openEnd: n } = this.unplaced, s = Wr(e, t);
4254
4254
  if (s.childCount <= 1 && t > 0) {
4255
4255
  let o = e.size - t <= t + s.size;
4256
- this.unplaced = new O(gn(e, t - 1, 1), t - 1, o ? t - 1 : n);
4256
+ this.unplaced = new O(yn(e, t - 1, 1), t - 1, o ? t - 1 : n);
4257
4257
  } else
4258
- this.unplaced = new O(gn(e, t, 1), t, n);
4258
+ this.unplaced = new O(yn(e, t, 1), t, n);
4259
4259
  }
4260
4260
  // Move content from the unplaced slice at `sliceDepth` to the
4261
4261
  // frontier node at `frontierDepth`. Close that frontier node when
@@ -4280,12 +4280,12 @@ class ju {
4280
4280
  c++, (c > 1 || a == 0 || y.content.size) && (f = g, u.push(ql(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
- p || (h = -1), this.placed = yn(this.placed, t, C.from(u)), this.frontier[t].match = f, p && h < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4283
+ p || (h = -1), this.placed = bn(this.placed, t, C.from(u)), this.frontier[t].match = f, p && h < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4284
4284
  for (let y = 0, g = l; y < h; y++) {
4285
4285
  let b = g.lastChild;
4286
4286
  this.frontier.push({ type: b.type, match: b.contentMatchAt(b.childCount) }), g = b.content;
4287
4287
  }
4288
- this.unplaced = p ? e == 0 ? O.empty : new O(gn(i.content, e - 1, 1), e - 1, h < 0 ? i.openEnd : e - 1) : new O(gn(i.content, e, c), i.openStart, i.openEnd);
4288
+ this.unplaced = p ? e == 0 ? O.empty : new O(yn(i.content, e - 1, 1), e - 1, h < 0 ? i.openEnd : e - 1) : new O(yn(i.content, e, c), i.openStart, i.openEnd);
4289
4289
  }
4290
4290
  mustMoveInline() {
4291
4291
  if (!this.$to.parent.isTextblock)
@@ -4317,7 +4317,7 @@ class ju {
4317
4317
  return null;
4318
4318
  for (; this.depth > t.depth; )
4319
4319
  this.closeFrontierNode();
4320
- t.fit.childCount && (this.placed = yn(this.placed, t.depth, t.fit)), e = t.move;
4320
+ t.fit.childCount && (this.placed = bn(this.placed, t.depth, t.fit)), e = t.move;
4321
4321
  for (let n = t.depth + 1; n <= e.depth; n++) {
4322
4322
  let s = e.node(n), o = s.type.contentMatch.fillBefore(s.content, !0, e.index(n));
4323
4323
  this.openFrontierNode(s.type, s.attrs, o);
@@ -4326,18 +4326,18 @@ class ju {
4326
4326
  }
4327
4327
  openFrontierNode(e, t = null, n) {
4328
4328
  let s = this.frontier[this.depth];
4329
- s.match = s.match.matchType(e), this.placed = yn(this.placed, this.depth, C.from(e.create(t, n))), this.frontier.push({ type: e, match: e.contentMatch });
4329
+ s.match = s.match.matchType(e), this.placed = bn(this.placed, this.depth, C.from(e.create(t, n))), this.frontier.push({ type: e, match: e.contentMatch });
4330
4330
  }
4331
4331
  closeFrontierNode() {
4332
4332
  let t = this.frontier.pop().match.fillBefore(C.empty, !0);
4333
- t.childCount && (this.placed = yn(this.placed, this.frontier.length, t));
4333
+ t.childCount && (this.placed = bn(this.placed, this.frontier.length, t));
4334
4334
  }
4335
4335
  }
4336
- function gn(r, e, t) {
4337
- return e == 0 ? r.cutByIndex(t, r.childCount) : r.replaceChild(0, r.firstChild.copy(gn(r.firstChild.content, e - 1, t)));
4338
- }
4339
4336
  function yn(r, e, t) {
4340
- return e == 0 ? r.append(t) : r.replaceChild(r.childCount - 1, r.lastChild.copy(yn(r.lastChild.content, e - 1, t)));
4337
+ return e == 0 ? r.cutByIndex(t, r.childCount) : r.replaceChild(0, r.firstChild.copy(yn(r.firstChild.content, e - 1, t)));
4338
+ }
4339
+ function bn(r, e, t) {
4340
+ return e == 0 ? r.append(t) : r.replaceChild(r.childCount - 1, r.lastChild.copy(bn(r.lastChild.content, e - 1, t)));
4341
4341
  }
4342
4342
  function Wr(r, e) {
4343
4343
  for (let t = 0; t < e; t++)
@@ -4455,7 +4455,7 @@ function Hl(r, e) {
4455
4455
  }
4456
4456
  return t;
4457
4457
  }
4458
- class Xt extends he {
4458
+ class Qt extends he {
4459
4459
  /**
4460
4460
  Construct an attribute step.
4461
4461
  */
@@ -4477,11 +4477,11 @@ class Xt extends he {
4477
4477
  return Ce.empty;
4478
4478
  }
4479
4479
  invert(e) {
4480
- return new Xt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
4480
+ return new Qt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
4481
4481
  }
4482
4482
  map(e) {
4483
4483
  let t = e.mapResult(this.pos, 1);
4484
- return t.deletedAfter ? null : new Xt(t.pos, this.attr, this.value);
4484
+ return t.deletedAfter ? null : new Qt(t.pos, this.attr, this.value);
4485
4485
  }
4486
4486
  toJSON() {
4487
4487
  return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
@@ -4489,11 +4489,11 @@ class Xt extends he {
4489
4489
  static fromJSON(e, t) {
4490
4490
  if (typeof t.pos != "number" || typeof t.attr != "string")
4491
4491
  throw new RangeError("Invalid input for AttrStep.fromJSON");
4492
- return new Xt(t.pos, t.attr, t.value);
4492
+ return new Qt(t.pos, t.attr, t.value);
4493
4493
  }
4494
4494
  }
4495
- he.jsonID("attr", Xt);
4496
- class En extends he {
4495
+ he.jsonID("attr", Qt);
4496
+ class Tn extends he {
4497
4497
  /**
4498
4498
  Construct an attribute step.
4499
4499
  */
@@ -4512,7 +4512,7 @@ class En extends he {
4512
4512
  return Ce.empty;
4513
4513
  }
4514
4514
  invert(e) {
4515
- return new En(this.attr, e.attrs[this.attr]);
4515
+ return new Tn(this.attr, e.attrs[this.attr]);
4516
4516
  }
4517
4517
  map(e) {
4518
4518
  return this;
@@ -4523,25 +4523,25 @@ class En extends he {
4523
4523
  static fromJSON(e, t) {
4524
4524
  if (typeof t.attr != "string")
4525
4525
  throw new RangeError("Invalid input for DocAttrStep.fromJSON");
4526
- return new En(t.attr, t.value);
4526
+ return new Tn(t.attr, t.value);
4527
4527
  }
4528
4528
  }
4529
- he.jsonID("docAttr", En);
4530
- let nn = class extends Error {
4529
+ he.jsonID("docAttr", Tn);
4530
+ let rn = class extends Error {
4531
4531
  };
4532
- nn = function r(e) {
4532
+ rn = function r(e) {
4533
4533
  let t = Error.call(this, e);
4534
4534
  return t.__proto__ = r.prototype, t;
4535
4535
  };
4536
- nn.prototype = Object.create(Error.prototype);
4537
- nn.prototype.constructor = nn;
4538
- nn.prototype.name = "TransformError";
4536
+ rn.prototype = Object.create(Error.prototype);
4537
+ rn.prototype.constructor = rn;
4538
+ rn.prototype.name = "TransformError";
4539
4539
  class Kl {
4540
4540
  /**
4541
4541
  Create a transform that starts with the given document.
4542
4542
  */
4543
4543
  constructor(e) {
4544
- this.doc = e, this.steps = [], this.docs = [], this.mapping = new Dn();
4544
+ this.doc = e, this.steps = [], this.docs = [], this.mapping = new En();
4545
4545
  }
4546
4546
  /**
4547
4547
  The starting document.
@@ -4556,7 +4556,7 @@ class Kl {
4556
4556
  step(e) {
4557
4557
  let t = this.maybeStep(e);
4558
4558
  if (t.failed)
4559
- throw new nn(t.failed);
4559
+ throw new rn(t.failed);
4560
4560
  return this;
4561
4561
  }
4562
4562
  /**
@@ -4693,13 +4693,13 @@ class Kl {
4693
4693
  to set attributes on the document itself.
4694
4694
  */
4695
4695
  setNodeAttribute(e, t, n) {
4696
- return this.step(new Xt(e, t, n)), this;
4696
+ return this.step(new Qt(e, t, n)), this;
4697
4697
  }
4698
4698
  /**
4699
4699
  Set a single attribute on the document to a new value.
4700
4700
  */
4701
4701
  setDocAttribute(e, t) {
4702
- return this.step(new En(e, t)), this;
4702
+ return this.step(new Tn(e, t)), this;
4703
4703
  }
4704
4704
  /**
4705
4705
  Add a mark to the node at position `pos`.
@@ -4716,11 +4716,11 @@ class Kl {
4716
4716
  if (!n)
4717
4717
  throw new RangeError("No node at position " + e);
4718
4718
  if (t instanceof $)
4719
- t.isInSet(n.marks) && this.step(new Vt(e, t));
4719
+ t.isInSet(n.marks) && this.step(new jt(e, t));
4720
4720
  else {
4721
4721
  let s = n.marks, o, i = [];
4722
4722
  for (; o = t.isInSet(s); )
4723
- i.push(new Vt(e, o)), s = o.removeFromSet(s);
4723
+ i.push(new jt(e, o)), s = o.removeFromSet(s);
4724
4724
  for (let l = i.length - 1; l >= 0; l--)
4725
4725
  this.step(i[l]);
4726
4726
  }
@@ -4856,11 +4856,11 @@ class V {
4856
4856
  found.
4857
4857
  */
4858
4858
  static findFrom(e, t, n = !1) {
4859
- let s = e.parent.inlineContent ? new F(e) : Jt(e.node(0), e.parent, e.pos, e.index(), t, n);
4859
+ let s = e.parent.inlineContent ? new F(e) : Ht(e.node(0), e.parent, e.pos, e.index(), t, n);
4860
4860
  if (s)
4861
4861
  return s;
4862
4862
  for (let o = e.depth - 1; o >= 0; o--) {
4863
- let i = t < 0 ? Jt(e.node(0), e.node(o), e.before(o + 1), e.index(o), t, n) : Jt(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, t, n);
4863
+ let i = t < 0 ? Ht(e.node(0), e.node(o), e.before(o + 1), e.index(o), t, n) : Ht(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, t, n);
4864
4864
  if (i)
4865
4865
  return i;
4866
4866
  }
@@ -4881,14 +4881,14 @@ class V {
4881
4881
  exists.
4882
4882
  */
4883
4883
  static atStart(e) {
4884
- return Jt(e, e, 0, 0, 1) || new Me(e);
4884
+ return Ht(e, e, 0, 0, 1) || new Me(e);
4885
4885
  }
4886
4886
  /**
4887
4887
  Find the cursor or leaf node selection closest to the end of the
4888
4888
  given document.
4889
4889
  */
4890
4890
  static atEnd(e) {
4891
- return Jt(e, e, e.content.size, e.childCount, -1) || new Me(e);
4891
+ return Ht(e, e, e.content.size, e.childCount, -1) || new Me(e);
4892
4892
  }
4893
4893
  /**
4894
4894
  Deserialize the JSON representation of a selection. Must be
@@ -5127,7 +5127,7 @@ const Wu = {
5127
5127
  return new Me(r);
5128
5128
  }
5129
5129
  };
5130
- function Jt(r, e, t, n, s, o = !1) {
5130
+ function Ht(r, e, t, n, s, o = !1) {
5131
5131
  if (e.inlineContent)
5132
5132
  return F.create(r, t);
5133
5133
  for (let i = n - (s > 0 ? 0 : 1); s > 0 ? i < e.childCount : i >= 0; i += s) {
@@ -5136,7 +5136,7 @@ function Jt(r, e, t, n, s, o = !1) {
5136
5136
  if (!o && P.isSelectable(l))
5137
5137
  return P.create(r, t - (s < 0 ? l.nodeSize : 0));
5138
5138
  } else {
5139
- let a = Jt(r, l, t + s, s < 0 ? l.childCount : 0, s, o);
5139
+ let a = Ht(r, l, t + s, s < 0 ? l.childCount : 0, s, o);
5140
5140
  if (a)
5141
5141
  return a;
5142
5142
  }
@@ -5311,13 +5311,13 @@ class _u extends Kl {
5311
5311
  function ei(r, e) {
5312
5312
  return !e || !r ? r : r.bind(e);
5313
5313
  }
5314
- class bn {
5314
+ class xn {
5315
5315
  constructor(e, t, n) {
5316
5316
  this.name = e, this.init = ei(t.init, n), this.apply = ei(t.apply, n);
5317
5317
  }
5318
5318
  }
5319
5319
  const qu = [
5320
- new bn("doc", {
5320
+ new xn("doc", {
5321
5321
  init(r) {
5322
5322
  return r.doc || r.schema.topNodeType.createAndFill();
5323
5323
  },
@@ -5325,7 +5325,7 @@ const qu = [
5325
5325
  return r.doc;
5326
5326
  }
5327
5327
  }),
5328
- new bn("selection", {
5328
+ new xn("selection", {
5329
5329
  init(r, e) {
5330
5330
  return r.selection || V.atStart(e.doc);
5331
5331
  },
@@ -5333,7 +5333,7 @@ const qu = [
5333
5333
  return r.selection;
5334
5334
  }
5335
5335
  }),
5336
- new bn("storedMarks", {
5336
+ new xn("storedMarks", {
5337
5337
  init(r) {
5338
5338
  return r.storedMarks || null;
5339
5339
  },
@@ -5341,7 +5341,7 @@ const qu = [
5341
5341
  return n.selection.$cursor ? r.storedMarks : null;
5342
5342
  }
5343
5343
  }),
5344
- new bn("scrollToSelection", {
5344
+ new xn("scrollToSelection", {
5345
5345
  init() {
5346
5346
  return 0;
5347
5347
  },
@@ -5355,7 +5355,7 @@ class Jr {
5355
5355
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = qu.slice(), t && t.forEach((n) => {
5356
5356
  if (this.pluginsByKey[n.key])
5357
5357
  throw new RangeError("Adding different instances of a keyed plugin (" + n.key + ")");
5358
- this.plugins.push(n), this.pluginsByKey[n.key] = n, n.spec.state && this.fields.push(new bn(n.key, n.spec.state, n));
5358
+ this.plugins.push(n), this.pluginsByKey[n.key] = n, n.spec.state && this.fields.push(new xn(n.key, n.spec.state, n));
5359
5359
  });
5360
5360
  }
5361
5361
  }
@@ -5855,7 +5855,7 @@ class Re {
5855
5855
  return c > ef && (l = Zu(l, c), i -= c), new Re(l.append(o), i);
5856
5856
  }
5857
5857
  remapping(e, t) {
5858
- let n = new Dn();
5858
+ let n = new En();
5859
5859
  return this.items.forEach((s, o) => {
5860
5860
  let i = s.mirrorOffset != null && o - s.mirrorOffset >= e ? n.maps.length - s.mirrorOffset : void 0;
5861
5861
  n.appendMap(s.map, i);
@@ -6066,13 +6066,13 @@ const af = (r, e, t) => {
6066
6066
  let o = s.nodeBefore;
6067
6067
  if (sa(r, s, e, -1))
6068
6068
  return !0;
6069
- if (n.parent.content.size == 0 && (rn(o, "end") || P.isSelectable(o)))
6069
+ if (n.parent.content.size == 0 && (sn(o, "end") || P.isSelectable(o)))
6070
6070
  for (let i = n.depth; ; i--) {
6071
6071
  let l = Hs(r.doc, n.before(i), n.after(i), O.empty);
6072
6072
  if (l && l.slice.size < l.to - l.from) {
6073
6073
  if (e) {
6074
6074
  let a = r.tr.step(l);
6075
- a.setSelection(rn(o, "end") ? V.findFrom(a.doc.resolve(a.mapping.map(s.pos, -1)), -1) : P.create(a.doc, s.pos - o.nodeSize)), e(a.scrollIntoView());
6075
+ a.setSelection(sn(o, "end") ? V.findFrom(a.doc.resolve(a.mapping.map(s.pos, -1)), -1) : P.create(a.doc, s.pos - o.nodeSize)), e(a.scrollIntoView());
6076
6076
  }
6077
6077
  return !0;
6078
6078
  }
@@ -6081,7 +6081,7 @@ const af = (r, e, t) => {
6081
6081
  }
6082
6082
  return o.isAtom && s.depth == n.depth - 1 ? (e && e(r.tr.delete(s.pos - o.nodeSize, s.pos).scrollIntoView()), !0) : !1;
6083
6083
  };
6084
- function rn(r, e, t = !1) {
6084
+ function sn(r, e, t = !1) {
6085
6085
  for (let n = r; n; n = e == "start" ? n.firstChild : n.lastChild) {
6086
6086
  if (n.isTextblock)
6087
6087
  return !0;
@@ -6126,12 +6126,12 @@ const ff = (r, e, t) => {
6126
6126
  let o = s.nodeAfter;
6127
6127
  if (sa(r, s, e, 1))
6128
6128
  return !0;
6129
- if (n.parent.content.size == 0 && (rn(o, "start") || P.isSelectable(o))) {
6129
+ if (n.parent.content.size == 0 && (sn(o, "start") || P.isSelectable(o))) {
6130
6130
  let i = Hs(r.doc, n.before(), n.after(), O.empty);
6131
6131
  if (i && i.slice.size < i.to - i.from) {
6132
6132
  if (e) {
6133
6133
  let l = r.tr.step(i);
6134
- l.setSelection(rn(o, "start") ? V.findFrom(l.doc.resolve(l.mapping.map(s.pos)), 1) : P.create(l.doc, l.mapping.map(s.pos))), e(l.scrollIntoView());
6134
+ l.setSelection(sn(o, "start") ? V.findFrom(l.doc.resolve(l.mapping.map(s.pos)), 1) : P.create(l.doc, l.mapping.map(s.pos))), e(l.scrollIntoView());
6135
6135
  }
6136
6136
  return !0;
6137
6137
  }
@@ -6163,7 +6163,7 @@ function ta(r) {
6163
6163
  const na = (r, e) => {
6164
6164
  let t = r.selection, n = t instanceof P, s;
6165
6165
  if (n) {
6166
- if (t.node.isTextblock || !an(r.doc, t.from))
6166
+ if (t.node.isTextblock || !cn(r.doc, t.from))
6167
6167
  return !1;
6168
6168
  s = t.from;
6169
6169
  } else if (s = $l(r.doc, t.from, -1), s == null)
@@ -6176,7 +6176,7 @@ const na = (r, e) => {
6176
6176
  }, hf = (r, e) => {
6177
6177
  let t = r.selection, n;
6178
6178
  if (t instanceof P) {
6179
- if (t.node.isTextblock || !an(r.doc, t.to))
6179
+ if (t.node.isTextblock || !cn(r.doc, t.to))
6180
6180
  return !1;
6181
6181
  n = t.to;
6182
6182
  } else if (n = $l(r.doc, t.to, 1), n == null)
@@ -6228,7 +6228,7 @@ const ra = (r, e) => {
6228
6228
  return !1;
6229
6229
  if (t.depth > 1 && t.after() != t.end(-1)) {
6230
6230
  let o = t.before();
6231
- if (Gt(r.doc, o))
6231
+ if (Xt(r.doc, o))
6232
6232
  return e && e(r.tr.split(o).scrollIntoView()), !0;
6233
6233
  }
6234
6234
  let n = t.blockRange(), s = n && Ln(n);
@@ -6238,7 +6238,7 @@ function yf(r) {
6238
6238
  return (e, t) => {
6239
6239
  let { $from: n, $to: s } = e.selection;
6240
6240
  if (e.selection instanceof P && e.selection.node.isBlock)
6241
- return !n.parentOffset || !Gt(e.doc, n.pos) ? !1 : (t && t(e.tr.split(n.pos).scrollIntoView()), !0);
6241
+ return !n.parentOffset || !Xt(e.doc, n.pos) ? !1 : (t && t(e.tr.split(n.pos).scrollIntoView()), !0);
6242
6242
  if (!n.depth)
6243
6243
  return !1;
6244
6244
  let o = [], i, l, a = !1, c = !1;
@@ -6253,8 +6253,8 @@ function yf(r) {
6253
6253
  }
6254
6254
  let u = e.tr;
6255
6255
  (e.selection instanceof F || e.selection instanceof Me) && u.deleteSelection();
6256
- let f = u.mapping.map(n.pos), d = Gt(u.doc, f, o.length, o);
6257
- if (d || (o[0] = l ? { type: l } : null, d = Gt(u.doc, f, o.length, o)), !d)
6256
+ let f = u.mapping.map(n.pos), d = Xt(u.doc, f, o.length, o);
6257
+ if (d || (o[0] = l ? { type: l } : null, d = Xt(u.doc, f, o.length, o)), !d)
6258
6258
  return !1;
6259
6259
  if (u.split(f, o.length, o), !a && c && n.node(i).type != l) {
6260
6260
  let h = u.mapping.map(n.before(i)), p = u.doc.resolve(h);
@@ -6269,7 +6269,7 @@ const bf = yf(), ks = (r, e) => {
6269
6269
  }, xf = (r, e) => (e && e(r.tr.setSelection(new Me(r.doc))), !0);
6270
6270
  function kf(r, e, t) {
6271
6271
  let n = e.nodeBefore, s = e.nodeAfter, o = e.index();
6272
- return !n || !s || !n.type.compatibleContent(s.type) ? !1 : !n.content.size && e.parent.canReplace(o - 1, o) ? (t && t(r.tr.delete(e.pos - n.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(s.isTextblock || an(r.doc, e.pos)) ? !1 : (t && t(r.tr.join(e.pos).scrollIntoView()), !0);
6272
+ return !n || !s || !n.type.compatibleContent(s.type) ? !1 : !n.content.size && e.parent.canReplace(o - 1, o) ? (t && t(r.tr.delete(e.pos - n.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(s.isTextblock || cn(r.doc, e.pos)) ? !1 : (t && t(r.tr.join(e.pos).scrollIntoView()), !0);
6273
6273
  }
6274
6274
  function sa(r, e, t, n) {
6275
6275
  let s = e.nodeBefore, o = e.nodeAfter, i, l, a = s.type.spec.isolating || o.type.spec.isolating;
@@ -6283,14 +6283,14 @@ function sa(r, e, t, n) {
6283
6283
  p = C.from(i[b].create(null, p));
6284
6284
  p = C.from(s.copy(p));
6285
6285
  let y = r.tr.step(new ie(e.pos - 1, h, e.pos, h, new O(p, 1, 0), i.length, !0)), g = y.doc.resolve(h + 2 * i.length);
6286
- g.nodeAfter && g.nodeAfter.type == s.type && an(y.doc, g.pos) && y.join(g.pos), t(y.scrollIntoView());
6286
+ g.nodeAfter && g.nodeAfter.type == s.type && cn(y.doc, g.pos) && y.join(g.pos), t(y.scrollIntoView());
6287
6287
  }
6288
6288
  return !0;
6289
6289
  }
6290
6290
  let u = o.type.spec.isolating || n > 0 && a ? null : V.findFrom(e, 1), f = u && u.$from.blockRange(u.$to), d = f && Ln(f);
6291
6291
  if (d != null && d >= e.depth)
6292
6292
  return t && t(r.tr.lift(f, d).scrollIntoView()), !0;
6293
- if (c && rn(o, "start", !0) && rn(s, "end")) {
6293
+ if (c && sn(o, "start", !0) && sn(s, "end")) {
6294
6294
  let h = s, p = [];
6295
6295
  for (; p.push(h), !h.isTextblock; )
6296
6296
  h = h.lastChild;
@@ -6328,7 +6328,7 @@ function ia(r, e = null) {
6328
6328
  return l ? (n && n(t.tr.wrap(i, l).scrollIntoView()), !0) : !1;
6329
6329
  };
6330
6330
  }
6331
- function Qt(r, e = null) {
6331
+ function Zt(r, e = null) {
6332
6332
  return function(t, n) {
6333
6333
  let s = !1;
6334
6334
  for (let o = 0; o < t.selection.ranges.length && !s; o++) {
@@ -6511,7 +6511,7 @@ const ne = function(r) {
6511
6511
  for (var e = 0; ; e++)
6512
6512
  if (r = r.previousSibling, !r)
6513
6513
  return e;
6514
- }, sn = function(r) {
6514
+ }, on = function(r) {
6515
6515
  let e = r.assignedSlot || r.parentNode;
6516
6516
  return e && e.nodeType == 11 ? e.host : e;
6517
6517
  };
@@ -6521,7 +6521,7 @@ const Ye = function(r, e, t) {
6521
6521
  return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
6522
6522
  }, Ef = function() {
6523
6523
  ws = null;
6524
- }, jt = function(r, e, t, n) {
6524
+ }, zt = function(r, e, t, n) {
6525
6525
  return t && (si(r, e, t, n, -1) || si(r, e, t, n, 1));
6526
6526
  }, Tf = /^(img|br|input|textarea|hr)$/i;
6527
6527
  function si(r, e, t, n, s) {
@@ -6589,7 +6589,7 @@ function $n(r) {
6589
6589
  return e && e.node && e.node.isBlock && (e.dom == r || e.contentDOM == r);
6590
6590
  }
6591
6591
  const Tr = function(r) {
6592
- return r.focusNode && jt(r.focusNode, r.focusOffset, r.anchorNode, r.anchorOffset);
6592
+ return r.focusNode && zt(r.focusNode, r.focusOffset, r.anchorNode, r.anchorOffset);
6593
6593
  };
6594
6594
  function Nt(r, e) {
6595
6595
  let t = document.createEvent("Event");
@@ -6617,7 +6617,7 @@ function Pf(r, e, t) {
6617
6617
  }
6618
6618
  const Fe = typeof navigator < "u" ? navigator : null, oi = typeof document < "u" ? document : null, bt = Fe && Fe.userAgent || "", Cs = /Edge\/(\d+)/.exec(bt), aa = /MSIE \d/.exec(bt), Ss = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bt), ke = !!(aa || Ss || Cs), ht = aa ? document.documentMode : Ss ? +Ss[1] : Cs ? +Cs[1] : 0, Ie = !ke && /gecko\/(\d+)/i.test(bt);
6619
6619
  Ie && +(/Firefox\/(\d+)/.exec(bt) || [0, 0])[1];
6620
- const Ms = !ke && /Chrome\/(\d+)/.exec(bt), de = !!Ms, ca = Ms ? +Ms[1] : 0, ge = !ke && !!Fe && /Apple Computer/.test(Fe.vendor), on = ge && (/Mobile\/\w+/.test(bt) || !!Fe && Fe.maxTouchPoints > 2), Ee = on || (Fe ? /Mac/.test(Fe.platform) : !1), Vf = Fe ? /Win/.test(Fe.platform) : !1, Xe = /Android \d/.test(bt), Wn = !!oi && "webkitFontSmoothing" in oi.documentElement.style, jf = Wn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6620
+ const Ms = !ke && /Chrome\/(\d+)/.exec(bt), de = !!Ms, ca = Ms ? +Ms[1] : 0, ge = !ke && !!Fe && /Apple Computer/.test(Fe.vendor), ln = ge && (/Mobile\/\w+/.test(bt) || !!Fe && Fe.maxTouchPoints > 2), Ee = ln || (Fe ? /Mac/.test(Fe.platform) : !1), Vf = Fe ? /Win/.test(Fe.platform) : !1, Xe = /Android \d/.test(bt), Wn = !!oi && "webkitFontSmoothing" in oi.documentElement.style, jf = Wn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6621
6621
  function zf(r) {
6622
6622
  let e = r.defaultView && r.defaultView.visualViewport;
6623
6623
  return e ? {
@@ -6648,7 +6648,7 @@ function ii(r, e, t) {
6648
6648
  let n = r.someProp("scrollThreshold") || 0, s = r.someProp("scrollMargin") || 5, o = r.dom.ownerDocument;
6649
6649
  for (let i = t || r.dom; i; ) {
6650
6650
  if (i.nodeType != 1) {
6651
- i = sn(i);
6651
+ i = on(i);
6652
6652
  continue;
6653
6653
  }
6654
6654
  let l = i, a = l == o.body, c = a ? zf(o) : Bf(l), u = 0, f = 0;
@@ -6664,7 +6664,7 @@ function ii(r, e, t) {
6664
6664
  let d = a ? "fixed" : getComputedStyle(i).position;
6665
6665
  if (/^(fixed|sticky)$/.test(d))
6666
6666
  break;
6667
- i = d == "absolute" ? i.offsetParent : sn(i);
6667
+ i = d == "absolute" ? i.offsetParent : on(i);
6668
6668
  }
6669
6669
  }
6670
6670
  function Ff(r) {
@@ -6683,7 +6683,7 @@ function Ff(r) {
6683
6683
  }
6684
6684
  function ua(r) {
6685
6685
  let e = [], t = r.ownerDocument;
6686
- for (let n = r; n && (e.push({ dom: n, top: n.scrollTop, left: n.scrollLeft }), r != t); n = sn(n))
6686
+ for (let n = r; n && (e.push({ dom: n, top: n.scrollTop, left: n.scrollLeft }), r != t); n = on(n))
6687
6687
  ;
6688
6688
  return e;
6689
6689
  }
@@ -6697,18 +6697,18 @@ function fa(r, e) {
6697
6697
  n.scrollTop != s + e && (n.scrollTop = s + e), n.scrollLeft != o && (n.scrollLeft = o);
6698
6698
  }
6699
6699
  }
6700
- let Wt = null;
6700
+ let _t = null;
6701
6701
  function $f(r) {
6702
6702
  if (r.setActive)
6703
6703
  return r.setActive();
6704
- if (Wt)
6705
- return r.focus(Wt);
6704
+ if (_t)
6705
+ return r.focus(_t);
6706
6706
  let e = ua(r);
6707
- r.focus(Wt == null ? {
6707
+ r.focus(_t == null ? {
6708
6708
  get preventScroll() {
6709
- return Wt = { preventScroll: !0 }, !0;
6709
+ return _t = { preventScroll: !0 }, !0;
6710
6710
  }
6711
- } : void 0), Wt || (Wt = !1, fa(e, 0));
6711
+ } : void 0), _t || (_t = !1, fa(e, 0));
6712
6712
  }
6713
6713
  function da(r, e) {
6714
6714
  let t, n = 2e8, s, o = 0, i = e.top, l = e.top, a, c;
@@ -6804,7 +6804,7 @@ function Hf(r, e) {
6804
6804
  return null;
6805
6805
  }
6806
6806
  if (ge)
6807
- for (let c = i; n && c; c = sn(c))
6807
+ for (let c = i; n && c; c = on(c))
6808
6808
  c.draggable && (n = void 0);
6809
6809
  if (i = _f(i, e), n) {
6810
6810
  if (Ie && n.nodeType == 1 && (s = Math.min(s, n.childNodes.length), s < n.childNodes.length)) {
@@ -6841,13 +6841,13 @@ function pa(r, e, t) {
6841
6841
  if (c.top == a.top) {
6842
6842
  let u = st(Ye(n, s, s + 1), -1);
6843
6843
  if (u.top != a.top)
6844
- return mn(u, u.left < c.left);
6844
+ return gn(u, u.left < c.left);
6845
6845
  }
6846
6846
  }
6847
6847
  return a;
6848
6848
  } else {
6849
6849
  let a = s, c = s, u = t < 0 ? 1 : -1;
6850
- return t < 0 && !s ? (c++, u = -1) : t >= 0 && s == n.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, mn(st(Ye(n, a, c), u), u < 0);
6850
+ return t < 0 && !s ? (c++, u = -1) : t >= 0 && s == n.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, gn(st(Ye(n, a, c), u), u < 0);
6851
6851
  }
6852
6852
  if (!r.state.doc.resolve(e - (o || 0)).parent.inlineContent) {
6853
6853
  if (o == null && s && (t < 0 || s == Te(n))) {
@@ -6865,7 +6865,7 @@ function pa(r, e, t) {
6865
6865
  if (o == null && s && (t < 0 || s == Te(n))) {
6866
6866
  let a = n.childNodes[s - 1], c = a.nodeType == 3 ? Ye(a, Te(a) - (i ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
6867
6867
  if (c)
6868
- return mn(st(c, 1), !1);
6868
+ return gn(st(c, 1), !1);
6869
6869
  }
6870
6870
  if (o == null && s < Te(n)) {
6871
6871
  let a = n.childNodes[s];
@@ -6873,11 +6873,11 @@ function pa(r, e, t) {
6873
6873
  a = a.nextSibling;
6874
6874
  let c = a ? a.nodeType == 3 ? Ye(a, 0, i ? 0 : 1) : a.nodeType == 1 ? a : null : null;
6875
6875
  if (c)
6876
- return mn(st(c, -1), !0);
6876
+ return gn(st(c, -1), !0);
6877
6877
  }
6878
- return mn(st(n.nodeType == 3 ? Ye(n) : n, -t), t >= 0);
6878
+ return gn(st(n.nodeType == 3 ? Ye(n) : n, -t), t >= 0);
6879
6879
  }
6880
- function mn(r, e) {
6880
+ function gn(r, e) {
6881
6881
  if (r.width == 0)
6882
6882
  return r;
6883
6883
  let t = e ? r.left : r.right;
@@ -7234,7 +7234,7 @@ let _n = class {
7234
7234
  let h = u.focusNode.childNodes[u.focusOffset];
7235
7235
  h && h.contentEditable == "false" && (s = !0);
7236
7236
  }
7237
- if (!(s || f && ge) && jt(l.node, l.offset, u.anchorNode, u.anchorOffset) && jt(a.node, a.offset, u.focusNode, u.focusOffset))
7237
+ if (!(s || f && ge) && zt(l.node, l.offset, u.anchorNode, u.anchorOffset) && zt(a.node, a.offset, u.focusNode, u.focusOffset))
7238
7238
  return;
7239
7239
  let d = !1;
7240
7240
  if ((c.extend || e == t) && !f) {
@@ -7382,7 +7382,7 @@ let _n = class {
7382
7382
  destroy() {
7383
7383
  this.spec.destroy && this.spec.destroy(), super.destroy();
7384
7384
  }
7385
- }, Zt = class ya extends _n {
7385
+ }, en = class ya extends _n {
7386
7386
  constructor(e, t, n, s, o, i, l, a, c) {
7387
7387
  super(e, [], o, i), this.node = t, this.outerDeco = n, this.innerDeco = s, this.nodeDOM = l;
7388
7388
  }
@@ -7453,7 +7453,7 @@ let _n = class {
7453
7453
  a.syncToMarks(c.marks, n, e);
7454
7454
  let h;
7455
7455
  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;
7456
- }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ot) && (i && this.protectLocalComposition(e, i), wa(this.contentDOM, this.children, e), on && od(this.dom));
7456
+ }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ot) && (i && this.protectLocalComposition(e, i), wa(this.contentDOM, this.children, e), ln && od(this.dom));
7457
7457
  }
7458
7458
  localCompositionInfo(e, t) {
7459
7459
  let { from: n, to: s } = e.state.selection;
@@ -7510,10 +7510,10 @@ let _n = class {
7510
7510
  };
7511
7511
  function di(r, e, t, n, s) {
7512
7512
  Sa(n, e, r);
7513
- let o = new Zt(void 0, r, e, t, n, n, n, s, 0);
7513
+ let o = new en(void 0, r, e, t, n, n, n, s, 0);
7514
7514
  return o.contentDOM && o.updateChildren(s, 0), o;
7515
7515
  }
7516
- let ba = class xa extends Zt {
7516
+ let ba = class xa extends en {
7517
7517
  constructor(e, t, n, s, o, i, l) {
7518
7518
  super(e, t, n, s, o, null, i, l, 0);
7519
7519
  }
@@ -7568,7 +7568,7 @@ let ba = class xa extends Zt {
7568
7568
  get ignoreForCoords() {
7569
7569
  return this.dom.nodeName == "IMG";
7570
7570
  }
7571
- }, Zf = class extends Zt {
7571
+ }, Zf = class extends en {
7572
7572
  constructor(e, t, n, s, o, i, l, a, c, u) {
7573
7573
  super(e, t, n, s, o, i, l, c, u), this.spec = a;
7574
7574
  }
@@ -7621,22 +7621,22 @@ function wa(r, e, t) {
7621
7621
  n = hi(n), s = !0;
7622
7622
  s && t.trackWrites == r && (t.trackWrites = null);
7623
7623
  }
7624
- const Cn = function(r) {
7624
+ const Sn = function(r) {
7625
7625
  r && (this.nodeName = r);
7626
7626
  };
7627
- Cn.prototype = /* @__PURE__ */ Object.create(null);
7628
- const Dt = [new Cn()];
7627
+ Sn.prototype = /* @__PURE__ */ Object.create(null);
7628
+ const Dt = [new Sn()];
7629
7629
  function Os(r, e, t) {
7630
7630
  if (r.length == 0)
7631
7631
  return Dt;
7632
- let n = t ? Dt[0] : new Cn(), s = [n];
7632
+ let n = t ? Dt[0] : new Sn(), s = [n];
7633
7633
  for (let o = 0; o < r.length; o++) {
7634
7634
  let i = r[o].type.attrs;
7635
7635
  if (i) {
7636
- i.nodeName && s.push(n = new Cn(i.nodeName));
7636
+ i.nodeName && s.push(n = new Sn(i.nodeName));
7637
7637
  for (let l in i) {
7638
7638
  let a = i[l];
7639
- a != null && (t && s.length == 1 && s.push(n = new Cn(e.isInline ? "span" : "div")), l == "class" ? n.class = (n.class ? n.class + " " : "") + a : l == "style" ? n.style = (n.style ? n.style + ";" : "") + a : l != "nodeName" && (n[l] = a));
7639
+ a != null && (t && s.length == 1 && s.push(n = new Sn(e.isInline ? "span" : "div")), l == "class" ? n.class = (n.class ? n.class + " " : "") + a : l == "style" ? n.style = (n.style ? n.style + ";" : "") + a : l != "nodeName" && (n[l] = a));
7640
7640
  }
7641
7641
  }
7642
7642
  }
@@ -7779,7 +7779,7 @@ class td {
7779
7779
  updateNextNode(e, t, n, s, o, i) {
7780
7780
  for (let l = this.index; l < this.top.children.length; l++) {
7781
7781
  let a = this.top.children[l];
7782
- if (a instanceof Zt) {
7782
+ if (a instanceof en) {
7783
7783
  let c = this.preMatch.matched.get(a);
7784
7784
  if (c != null && c != o)
7785
7785
  return !1;
@@ -7798,7 +7798,7 @@ class td {
7798
7798
  recreateWrapper(e, t, n, s, o, i) {
7799
7799
  if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !yr(n, e.outerDeco) || !s.eq(e.innerDeco))
7800
7800
  return null;
7801
- let l = Zt.create(this.top, t, n, s, o, i);
7801
+ let l = en.create(this.top, t, n, s, o, i);
7802
7802
  if (l.contentDOM) {
7803
7803
  l.children = e.children, e.children = [];
7804
7804
  for (let a of l.children)
@@ -7808,7 +7808,7 @@ class td {
7808
7808
  }
7809
7809
  // Insert the node as a newly created node desc.
7810
7810
  addNode(e, t, n, s, o) {
7811
- let i = Zt.create(this.top, e, t, n, s, o);
7811
+ let i = en.create(this.top, e, t, n, s, o);
7812
7812
  i.contentDOM && i.updateChildren(s, o + 1), this.top.children.splice(this.index++, 0, i), this.changed = !0;
7813
7813
  }
7814
7814
  placeWidget(e, t, n) {
@@ -8005,7 +8005,7 @@ function et(r, e = !1) {
8005
8005
  if (Na(r, t), !!Ma(r)) {
8006
8006
  if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault && de) {
8007
8007
  let n = r.domSelectionRange(), s = r.domObserver.currentSelection;
8008
- if (n.anchorNode && s.anchorNode && jt(n.anchorNode, n.anchorOffset, s.anchorNode, s.anchorOffset)) {
8008
+ if (n.anchorNode && s.anchorNode && zt(n.anchorNode, n.anchorOffset, s.anchorNode, s.anchorOffset)) {
8009
8009
  r.input.mouseDown.delayedSelectionSync = !0, r.domObserver.setCurSelection();
8010
8010
  return;
8011
8011
  }
@@ -8082,7 +8082,7 @@ function Oa(r) {
8082
8082
  }
8083
8083
  function cd(r) {
8084
8084
  let e = r.docView.domFromPos(r.state.selection.anchor, 0), t = r.domSelectionRange();
8085
- return jt(e.node, e.offset, t.anchorNode, t.anchorOffset);
8085
+ return zt(e.node, e.offset, t.anchorNode, t.anchorOffset);
8086
8086
  }
8087
8087
  function Es(r, e) {
8088
8088
  let { $anchor: t, $head: n } = r.selection, s = e > 0 ? t.max(n) : t.min(n), o = s.parent.inlineContent ? s.depth ? r.doc.resolve(e > 0 ? s.after() : s.before()) : null : s;
@@ -8124,11 +8124,11 @@ function xi(r, e, t) {
8124
8124
  function br(r) {
8125
8125
  return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;
8126
8126
  }
8127
- function Sn(r, e) {
8127
+ function Mn(r, e) {
8128
8128
  let t = r.pmViewDesc;
8129
8129
  return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != "BR");
8130
8130
  }
8131
- function _t(r, e) {
8131
+ function qt(r, e) {
8132
8132
  return e < 0 ? ud(r) : fd(r);
8133
8133
  }
8134
8134
  function ud(r) {
@@ -8136,13 +8136,13 @@ function ud(r) {
8136
8136
  if (!t)
8137
8137
  return;
8138
8138
  let s, o, i = !1;
8139
- for (Ie && t.nodeType == 1 && n < br(t) && Sn(t.childNodes[n], -1) && (i = !0); ; )
8139
+ for (Ie && t.nodeType == 1 && n < br(t) && Mn(t.childNodes[n], -1) && (i = !0); ; )
8140
8140
  if (n > 0) {
8141
8141
  if (t.nodeType != 1)
8142
8142
  break;
8143
8143
  {
8144
8144
  let l = t.childNodes[n - 1];
8145
- if (Sn(l, -1))
8145
+ if (Mn(l, -1))
8146
8146
  s = t, o = --n;
8147
8147
  else if (l.nodeType == 3)
8148
8148
  t = l, n = t.nodeValue.length;
@@ -8154,7 +8154,7 @@ function ud(r) {
8154
8154
  break;
8155
8155
  {
8156
8156
  let l = t.previousSibling;
8157
- for (; l && Sn(l, -1); )
8157
+ for (; l && Mn(l, -1); )
8158
8158
  s = t.parentNode, o = ne(l), l = l.previousSibling;
8159
8159
  if (l)
8160
8160
  t = l, n = br(t);
@@ -8177,7 +8177,7 @@ function fd(r) {
8177
8177
  if (t.nodeType != 1)
8178
8178
  break;
8179
8179
  let l = t.childNodes[n];
8180
- if (Sn(l, 1))
8180
+ if (Mn(l, 1))
8181
8181
  o = t, i = ++n;
8182
8182
  else
8183
8183
  break;
@@ -8186,7 +8186,7 @@ function fd(r) {
8186
8186
  break;
8187
8187
  {
8188
8188
  let l = t.nextSibling;
8189
- for (; l && Sn(l, 1); )
8189
+ for (; l && Mn(l, 1); )
8190
8190
  o = l.parentNode, i = ne(l) + 1, l = l.nextSibling;
8191
8191
  if (l)
8192
8192
  t = l, n = 0, s = br(t);
@@ -8315,22 +8315,22 @@ function md(r) {
8315
8315
  function gd(r, e) {
8316
8316
  let t = e.keyCode, n = md(e);
8317
8317
  if (t == 8 || Ee && t == 72 && n == "c")
8318
- return Ci(r, -1) || _t(r, -1);
8318
+ return Ci(r, -1) || qt(r, -1);
8319
8319
  if (t == 46 && !e.shiftKey || Ee && t == 68 && n == "c")
8320
- return Ci(r, 1) || _t(r, 1);
8320
+ return Ci(r, 1) || qt(r, 1);
8321
8321
  if (t == 13 || t == 27)
8322
8322
  return !0;
8323
8323
  if (t == 37 || Ee && t == 66 && n == "c") {
8324
8324
  let s = t == 37 ? ki(r, r.state.selection.from) == "ltr" ? -1 : 1 : -1;
8325
- return xi(r, s, n) || _t(r, s);
8325
+ return xi(r, s, n) || qt(r, s);
8326
8326
  } else if (t == 39 || Ee && t == 70 && n == "c") {
8327
8327
  let s = t == 39 ? ki(r, r.state.selection.from) == "ltr" ? 1 : -1 : 1;
8328
- return xi(r, s, n) || _t(r, s);
8328
+ return xi(r, s, n) || qt(r, s);
8329
8329
  } else {
8330
8330
  if (t == 38 || Ee && t == 80 && n == "c")
8331
- return wi(r, -1, n) || _t(r, -1);
8331
+ return wi(r, -1, n) || qt(r, -1);
8332
8332
  if (t == 40 || Ee && t == 78 && n == "c")
8333
- return pd(r) || wi(r, 1, n) || _t(r, 1);
8333
+ return pd(r) || wi(r, 1, n) || qt(r, 1);
8334
8334
  if (n == (Ee ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
8335
8335
  return !0;
8336
8336
  }
@@ -8576,7 +8576,7 @@ function Ed(r, e) {
8576
8576
  be.keydown = (r, e) => {
8577
8577
  let t = e;
8578
8578
  if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Va(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(Xe && de && t.keyCode == 13)))
8579
- if (t.keyCode != 229 && r.domObserver.forceFlush(), on && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
8579
+ if (t.keyCode != 229 && r.domObserver.forceFlush(), ln && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
8580
8580
  let n = Date.now();
8581
8581
  r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
8582
8582
  r.input.lastIOSEnter == n && (r.someProp("handleKeyDown", (s) => s(r, Nt(13, "Enter"))), r.input.lastIOSEnter = 0);
@@ -8616,7 +8616,7 @@ function no(r, e, t, n, s) {
8616
8616
  return !0;
8617
8617
  return !1;
8618
8618
  }
8619
- function en(r, e, t) {
8619
+ function tn(r, e, t) {
8620
8620
  if (r.focused || r.focus(), r.state.selection.eq(e))
8621
8621
  return;
8622
8622
  let n = r.state.tr.setSelection(e);
@@ -8626,7 +8626,7 @@ function Ad(r, e) {
8626
8626
  if (e == -1)
8627
8627
  return !1;
8628
8628
  let t = r.state.doc.resolve(e), n = t.nodeAfter;
8629
- return n && n.isAtom && P.isSelectable(n) ? (en(r, new P(t)), !0) : !1;
8629
+ return n && n.isAtom && P.isSelectable(n) ? (tn(r, new P(t)), !0) : !1;
8630
8630
  }
8631
8631
  function vd(r, e) {
8632
8632
  if (e == -1)
@@ -8641,7 +8641,7 @@ function vd(r, e) {
8641
8641
  break;
8642
8642
  }
8643
8643
  }
8644
- return s != null ? (en(r, P.create(r.state.doc, s)), !0) : !1;
8644
+ return s != null ? (tn(r, P.create(r.state.doc, s)), !0) : !1;
8645
8645
  }
8646
8646
  function Rd(r, e, t, n, s) {
8647
8647
  return no(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (o) => o(r, e, n)) || (s ? vd(r, t) : Ad(r, t));
@@ -8657,14 +8657,14 @@ function Vd(r, e, t) {
8657
8657
  return !1;
8658
8658
  let n = r.state.doc;
8659
8659
  if (e == -1)
8660
- return n.inlineContent ? (en(r, F.create(n, 0, n.content.size)), !0) : !1;
8660
+ return n.inlineContent ? (tn(r, F.create(n, 0, n.content.size)), !0) : !1;
8661
8661
  let s = n.resolve(e);
8662
8662
  for (let o = s.depth + 1; o > 0; o--) {
8663
8663
  let i = o > s.depth ? s.nodeAfter : s.node(o), l = s.before(o);
8664
8664
  if (i.inlineContent)
8665
- en(r, F.create(n, l + 1, l + 1 + i.content.size));
8665
+ tn(r, F.create(n, l + 1, l + 1 + i.content.size));
8666
8666
  else if (P.isSelectable(i))
8667
- en(r, P.create(n, l));
8667
+ tn(r, P.create(n, l));
8668
8668
  else
8669
8669
  continue;
8670
8670
  return !0;
@@ -8719,7 +8719,7 @@ class jd {
8719
8719
  // (hidden) cursor is doesn't change the selection, and
8720
8720
  // thus doesn't get a reaction from ProseMirror. This
8721
8721
  // works around that.
8722
- de && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (en(this.view, V.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : dt(this.view, "pointer");
8722
+ de && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (tn(this.view, V.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : dt(this.view, "pointer");
8723
8723
  }
8724
8724
  move(e) {
8725
8725
  this.updateAllowDefault(e), dt(this.view, "pointer"), e.buttons == 0 && this.done();
@@ -8815,12 +8815,12 @@ function Ld(r, e) {
8815
8815
  t.parentNode && t.parentNode.removeChild(t), r.focus();
8816
8816
  }, 50);
8817
8817
  }
8818
- const Tn = ke && ht < 15 || on && jf < 604;
8818
+ const An = ke && ht < 15 || ln && jf < 604;
8819
8819
  ye.copy = be.cut = (r, e) => {
8820
8820
  let t = e, n = r.state.selection, s = t.type == "cut";
8821
8821
  if (n.empty)
8822
8822
  return;
8823
- let o = Tn ? null : t.clipboardData, i = n.content(), { dom: l, text: a } = eo(r, i);
8823
+ let o = An ? null : t.clipboardData, i = n.content(), { dom: l, text: a } = eo(r, i);
8824
8824
  o ? (t.preventDefault(), o.clearData(), o.setData("text/html", l.innerHTML), o.setData("text/plain", a)) : Ld(r, l), s && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8825
8825
  };
8826
8826
  function $d(r) {
@@ -8833,10 +8833,10 @@ function Wd(r, e) {
8833
8833
  t || (n.contentEditable = "true"), n.style.cssText = "position: fixed; left: -10000px; top: 10px", n.focus();
8834
8834
  let s = r.input.shiftKey && r.input.lastKeyCode != 45;
8835
8835
  setTimeout(() => {
8836
- r.focus(), n.parentNode && n.parentNode.removeChild(n), t ? An(r, n.value, null, s, e) : An(r, n.textContent, n.innerHTML, s, e);
8836
+ r.focus(), n.parentNode && n.parentNode.removeChild(n), t ? vn(r, n.value, null, s, e) : vn(r, n.textContent, n.innerHTML, s, e);
8837
8837
  }, 50);
8838
8838
  }
8839
- function An(r, e, t, n, s) {
8839
+ function vn(r, e, t, n, s) {
8840
8840
  let o = Ea(r, e, t, n, r.state.selection.$from);
8841
8841
  if (r.someProp("handlePaste", (a) => a(r, s, o || O.empty)))
8842
8842
  return !0;
@@ -8856,8 +8856,8 @@ be.paste = (r, e) => {
8856
8856
  let t = e;
8857
8857
  if (r.composing && !Xe)
8858
8858
  return;
8859
- let n = Tn ? null : t.clipboardData, s = r.input.shiftKey && r.input.lastKeyCode != 45;
8860
- n && An(r, Ba(n), n.getData("text/html"), s, t) ? t.preventDefault() : Wd(r, t);
8859
+ let n = An ? null : t.clipboardData, s = r.input.shiftKey && r.input.lastKeyCode != 45;
8860
+ n && vn(r, Ba(n), n.getData("text/html"), s, t) ? t.preventDefault() : Wd(r, t);
8861
8861
  };
8862
8862
  class Fa {
8863
8863
  constructor(e, t, n) {
@@ -8883,7 +8883,7 @@ ye.dragstart = (r, e) => {
8883
8883
  }
8884
8884
  }
8885
8885
  let l = (i || r.state.selection).content(), { dom: a, text: c, slice: u } = eo(r, l);
8886
- (!t.dataTransfer.files.length || !de || ca > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Tn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Tn || t.dataTransfer.setData("text/plain", c), r.dragging = new Fa(u, La(r, t), i);
8886
+ (!t.dataTransfer.files.length || !de || ca > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(An ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", An || t.dataTransfer.setData("text/plain", c), r.dragging = new Fa(u, La(r, t), i);
8887
8887
  };
8888
8888
  ye.dragend = (r) => {
8889
8889
  let e = r.dragging;
@@ -8902,7 +8902,7 @@ be.drop = (r, e) => {
8902
8902
  let o = r.state.doc.resolve(s.pos), i = n && n.slice;
8903
8903
  i ? r.someProp("transformPasted", (p) => {
8904
8904
  i = p(i, r);
8905
- }) : i = Ea(r, Ba(t.dataTransfer), Tn ? null : t.dataTransfer.getData("text/html"), !1, o);
8905
+ }) : i = Ea(r, Ba(t.dataTransfer), An ? null : t.dataTransfer.getData("text/html"), !1, o);
8906
8906
  let l = !!(n && La(r, t));
8907
8907
  if (r.someProp("handleDrop", (p) => p(r, t, i || O.empty, l))) {
8908
8908
  t.preventDefault();
@@ -8953,7 +8953,7 @@ ye.beforeinput = (r, e) => {
8953
8953
  };
8954
8954
  for (let r in be)
8955
8955
  ye[r] = be[r];
8956
- function vn(r, e) {
8956
+ function Rn(r, e) {
8957
8957
  if (r == e)
8958
8958
  return !0;
8959
8959
  for (let t in r)
@@ -8976,7 +8976,7 @@ class kr {
8976
8976
  return !0;
8977
8977
  }
8978
8978
  eq(e) {
8979
- return this == e || e instanceof kr && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && vn(this.spec, e.spec));
8979
+ return this == e || e instanceof kr && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Rn(this.spec, e.spec));
8980
8980
  }
8981
8981
  destroy(e) {
8982
8982
  this.spec.destroy && this.spec.destroy(e);
@@ -8994,7 +8994,7 @@ class pt {
8994
8994
  return t.from < t.to;
8995
8995
  }
8996
8996
  eq(e) {
8997
- return this == e || e instanceof pt && vn(this.attrs, e.attrs) && vn(this.spec, e.spec);
8997
+ return this == e || e instanceof pt && Rn(this.attrs, e.attrs) && Rn(this.spec, e.spec);
8998
8998
  }
8999
8999
  static is(e) {
9000
9000
  return e.type instanceof pt;
@@ -9018,7 +9018,7 @@ class so {
9018
9018
  return s == t.from && !(o = e.child(n)).isText && s + o.nodeSize == t.to;
9019
9019
  }
9020
9020
  eq(e) {
9021
- return this == e || e instanceof so && vn(this.attrs, e.attrs) && vn(this.spec, e.spec);
9021
+ return this == e || e instanceof so && Rn(this.attrs, e.attrs) && Rn(this.spec, e.spec);
9022
9022
  }
9023
9023
  destroy() {
9024
9024
  }
@@ -9094,13 +9094,13 @@ class re {
9094
9094
  return this.type instanceof kr;
9095
9095
  }
9096
9096
  }
9097
- const Ht = [], vt = {};
9097
+ const Kt = [], vt = {};
9098
9098
  class _ {
9099
9099
  /**
9100
9100
  @internal
9101
9101
  */
9102
9102
  constructor(e, t) {
9103
- this.local = e.length ? e : Ht, this.children = t.length ? t : Ht;
9103
+ this.local = e.length ? e : Kt, this.children = t.length ? t : Kt;
9104
9104
  }
9105
9105
  /**
9106
9106
  Create a set of decorations, using the structure of the given
@@ -9149,7 +9149,7 @@ class _ {
9149
9149
  let a = this.local[l].map(e, n, s);
9150
9150
  a && a.type.valid(t, a) ? (i || (i = [])).push(a) : o.onRemove && o.onRemove(this.local[l].spec);
9151
9151
  }
9152
- return this.children.length ? qd(this.children, i || [], e, t, n, s, o) : i ? new _(i.sort(Rt), Ht) : ue;
9152
+ return this.children.length ? qd(this.children, i || [], e, t, n, s, o) : i ? new _(i.sort(Rt), Kt) : ue;
9153
9153
  }
9154
9154
  /**
9155
9155
  Add the given array of decorations to the ones in the set,
@@ -9222,7 +9222,7 @@ class _ {
9222
9222
  }
9223
9223
  }
9224
9224
  if (s) {
9225
- let l = new _(s.sort(Rt), Ht);
9225
+ let l = new _(s.sort(Rt), Kt);
9226
9226
  return n ? new $a([l, n]) : l;
9227
9227
  }
9228
9228
  return n || ue;
@@ -9254,7 +9254,7 @@ class _ {
9254
9254
  */
9255
9255
  localsInner(e) {
9256
9256
  if (this == ue)
9257
- return Ht;
9257
+ return Kt;
9258
9258
  if (e.inlineContent || !this.local.some(pt.is))
9259
9259
  return this.local;
9260
9260
  let t = [];
@@ -9269,13 +9269,13 @@ class _ {
9269
9269
  _.empty = new _([], []);
9270
9270
  _.removeOverlap = oo;
9271
9271
  const ue = _.empty;
9272
- let $a = class Kt {
9272
+ let $a = class Ut {
9273
9273
  constructor(e) {
9274
9274
  this.members = e;
9275
9275
  }
9276
9276
  map(e, t) {
9277
9277
  const n = this.members.map((s) => s.map(e, t, vt));
9278
- return Kt.from(n);
9278
+ return Ut.from(n);
9279
9279
  }
9280
9280
  forChild(e, t) {
9281
9281
  if (t.isLeaf)
@@ -9283,12 +9283,12 @@ let $a = class Kt {
9283
9283
  let n = [];
9284
9284
  for (let s = 0; s < this.members.length; s++) {
9285
9285
  let o = this.members[s].forChild(e, t);
9286
- o != ue && (o instanceof Kt ? n = n.concat(o.members) : n.push(o));
9286
+ o != ue && (o instanceof Ut ? n = n.concat(o.members) : n.push(o));
9287
9287
  }
9288
- return Kt.from(n);
9288
+ return Ut.from(n);
9289
9289
  }
9290
9290
  eq(e) {
9291
- if (!(e instanceof Kt) || e.members.length != this.members.length)
9291
+ if (!(e instanceof Ut) || e.members.length != this.members.length)
9292
9292
  return !1;
9293
9293
  for (let t = 0; t < this.members.length; t++)
9294
9294
  if (!this.members[t].eq(e.members[t]))
@@ -9308,7 +9308,7 @@ let $a = class Kt {
9308
9308
  t.push(o[i]);
9309
9309
  }
9310
9310
  }
9311
- return t ? oo(n ? t : t.sort(Rt)) : Ht;
9311
+ return t ? oo(n ? t : t.sort(Rt)) : Kt;
9312
9312
  }
9313
9313
  // Create a group for the given array of decoration sets, or return
9314
9314
  // a single set when possible.
@@ -9319,7 +9319,7 @@ let $a = class Kt {
9319
9319
  case 1:
9320
9320
  return e[0];
9321
9321
  default:
9322
- return new Kt(e.every((t) => t instanceof _) ? e : e.reduce((t, n) => t.concat(n instanceof _ ? n : n.members), []));
9322
+ return new Ut(e.every((t) => t instanceof _) ? e : e.reduce((t, n) => t.concat(n instanceof _ ? n : n.members), []));
9323
9323
  }
9324
9324
  }
9325
9325
  forEachSet(e) {
@@ -9531,7 +9531,7 @@ class Yd {
9531
9531
  return et(this.view);
9532
9532
  if (ke && ht <= 11 && !this.view.state.selection.empty) {
9533
9533
  let e = this.view.domSelectionRange();
9534
- if (e.focusNode && jt(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
9534
+ if (e.focusNode && zt(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
9535
9535
  return this.flushSoon();
9536
9536
  }
9537
9537
  this.flush();
@@ -9544,9 +9544,9 @@ class Yd {
9544
9544
  if (!e.focusNode)
9545
9545
  return !0;
9546
9546
  let t = /* @__PURE__ */ new Set(), n;
9547
- for (let o = e.focusNode; o; o = sn(o))
9547
+ for (let o = e.focusNode; o; o = on(o))
9548
9548
  t.add(o);
9549
- for (let o = e.anchorNode; o; o = sn(o))
9549
+ for (let o = e.anchorNode; o; o = on(o))
9550
9550
  if (t.has(o)) {
9551
9551
  n = o;
9552
9552
  break;
@@ -9635,7 +9635,7 @@ function Gd(r) {
9635
9635
  }
9636
9636
  function Ti(r, e) {
9637
9637
  let t = e.startContainer, n = e.startOffset, s = e.endContainer, o = e.endOffset, i = r.domAtPos(r.state.selection.anchor);
9638
- return jt(i.node, i.offset, s, o) && ([t, n, s, o] = [s, o, t, n]), { anchorNode: t, anchorOffset: n, focusNode: s, focusOffset: o };
9638
+ return zt(i.node, i.offset, s, o) && ([t, n, s, o] = [s, o, t, n]), { anchorNode: t, anchorOffset: n, focusNode: s, focusOffset: o };
9639
9639
  }
9640
9640
  function Xd(r, e) {
9641
9641
  if (e.getComposedRanges) {
@@ -9718,7 +9718,7 @@ function nh(r, e, t, n, s) {
9718
9718
  let a = r.state.selection, c = Zd(r, e, t), u = r.state.doc, f = u.slice(c.from, c.to), d, h;
9719
9719
  r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (d = r.state.selection.to, h = "end") : (d = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
9720
9720
  let p = oh(f.content, c.doc.content, c.from, d, h);
9721
- if (p && r.input.domChangeCount++, (on && r.input.lastIOSEnter > Date.now() - 225 || Xe) && s.some((T) => T.nodeType == 1 && !th.test(T.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (T) => T(r, Nt(13, "Enter")))) {
9721
+ if (p && r.input.domChangeCount++, (ln && r.input.lastIOSEnter > Date.now() - 225 || Xe) && s.some((T) => T.nodeType == 1 && !th.test(T.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (T) => T(r, Nt(13, "Enter")))) {
9722
9722
  r.input.lastIOSEnter = 0;
9723
9723
  return;
9724
9724
  }
@@ -9737,7 +9737,7 @@ function nh(r, e, t, n, s) {
9737
9737
  }
9738
9738
  r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof F && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), ke && ht <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
9739
9739
  let y = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), b = u.resolve(p.start), k = y.sameParent(g) && y.parent.inlineContent && b.end() >= p.endA, w;
9740
- if ((on && r.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !k && y.pos < c.doc.content.size && (!y.sameParent(g) || !y.parent.inlineContent) && !/\S/.test(c.doc.textBetween(y.pos, g.pos, "", "")) && (w = V.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head > y.pos) && r.someProp("handleKeyDown", (T) => T(r, Nt(13, "Enter")))) {
9740
+ if ((ln && r.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !k && y.pos < c.doc.content.size && (!y.sameParent(g) || !y.parent.inlineContent) && !/\S/.test(c.doc.textBetween(y.pos, g.pos, "", "")) && (w = V.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head > y.pos) && r.someProp("handleKeyDown", (T) => T(r, Nt(13, "Enter")))) {
9741
9741
  r.input.lastIOSEnter = 0;
9742
9742
  return;
9743
9743
  }
@@ -10123,13 +10123,13 @@ class ih {
10123
10123
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
10124
10124
  */
10125
10125
  pasteHTML(e, t) {
10126
- return An(this, "", e, !1, t || new ClipboardEvent("paste"));
10126
+ return vn(this, "", e, !1, t || new ClipboardEvent("paste"));
10127
10127
  }
10128
10128
  /**
10129
10129
  Run the editor's paste logic with the given plain-text input.
10130
10130
  */
10131
10131
  pasteText(e, t) {
10132
- return An(this, e, null, !0, t || new ClipboardEvent("paste"));
10132
+ return vn(this, e, null, !0, t || new ClipboardEvent("paste"));
10133
10133
  }
10134
10134
  /**
10135
10135
  Serialize the given slice as it would be if it was copied from
@@ -10493,7 +10493,7 @@ function Mh(r, e, t, n, s) {
10493
10493
  t[u].type == s && (i = u + 1);
10494
10494
  let l = t.length - i, a = e.start + t.length - (n ? 2 : 0), c = e.parent;
10495
10495
  for (let u = e.startIndex, f = e.endIndex, d = !0; u < f; u++, d = !1)
10496
- !d && Gt(r.doc, a, l) && (r.split(a, l), a += 2 * l), a += c.child(u).nodeSize;
10496
+ !d && Xt(r.doc, a, l) && (r.split(a, l), a += 2 * l), a += c.child(u).nodeSize;
10497
10497
  return r;
10498
10498
  }
10499
10499
  function Nh(r, e) {
@@ -10523,7 +10523,7 @@ function Nh(r, e) {
10523
10523
  return !0;
10524
10524
  }
10525
10525
  let a = o.pos == s.end() ? l.contentMatchAt(0).defaultType : null, c = t.tr.delete(s.pos, o.pos), u = a ? [null, { type: a }] : void 0;
10526
- return Gt(c.doc, s.pos, 2, u) ? (n && n(c.split(s.pos, 2, u).scrollIntoView()), !0) : !1;
10526
+ return Xt(c.doc, s.pos, 2, u) ? (n && n(c.split(s.pos, 2, u).scrollIntoView()), !0) : !1;
10527
10527
  };
10528
10528
  }
10529
10529
  function Oh(r) {
@@ -10540,7 +10540,7 @@ function Dh(r, e, t, n) {
10540
10540
  return !1;
10541
10541
  s.lift(n, l);
10542
10542
  let a = s.doc.resolve(s.mapping.map(o, -1) - 1);
10543
- return an(s.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && s.join(a.pos), e(s.scrollIntoView()), !0;
10543
+ return cn(s.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && s.join(a.pos), e(s.scrollIntoView()), !0;
10544
10544
  }
10545
10545
  function Eh(r, e, t) {
10546
10546
  let n = r.tr, s = t.parent;
@@ -10682,7 +10682,7 @@ function lo(r, e, t = null, n) {
10682
10682
  return null;
10683
10683
  c.wrap(f, d);
10684
10684
  let h = c.doc.resolve(i - 1).nodeBefore;
10685
- return h && h.type == e && an(c.doc, i - 1) && (!n || n(o, h)) && c.join(i - 1), c;
10685
+ return h && h.type == e && cn(c.doc, i - 1) && (!n || n(o, h)) && c.join(i - 1), c;
10686
10686
  });
10687
10687
  }
10688
10688
  function Ja(r, e, t = null) {
@@ -10701,9 +10701,9 @@ function $h(r, e) {
10701
10701
  let o = n, i = Er(ra, (l, a) => (a && a(l.tr.replaceSelectionWith(o.create()).scrollIntoView()), !0));
10702
10702
  s("Mod-Enter", i), s("Shift-Enter", i), Bi && s("Ctrl-Enter", i);
10703
10703
  }
10704
- if ((n = r.nodes.list_item) && (s("Enter", Nh(n)), s("Mod-[", Oh(n)), s("Mod-]", Th(n))), (n = r.nodes.paragraph) && s("Shift-Ctrl-0", Qt(n)), (n = r.nodes.code_block) && s("Shift-Ctrl-\\", Qt(n)), n = r.nodes.heading)
10704
+ if ((n = r.nodes.list_item) && (s("Enter", Nh(n)), s("Mod-[", Oh(n)), s("Mod-]", Th(n))), (n = r.nodes.paragraph) && s("Shift-Ctrl-0", Zt(n)), (n = r.nodes.code_block) && s("Shift-Ctrl-\\", Zt(n)), n = r.nodes.heading)
10705
10705
  for (let o = 1; o <= 6; o++)
10706
- s("Shift-Ctrl-" + o, Qt(n, { level: o }));
10706
+ s("Shift-Ctrl-" + o, Zt(n, { level: o }));
10707
10707
  if (n = r.nodes.horizontal_rule) {
10708
10708
  let o = n;
10709
10709
  s("Mod-_", (i, l) => (l && l(i.tr.replaceSelectionWith(o.create()).scrollIntoView()), !0));
@@ -11133,7 +11133,7 @@ function Ha(r, e, t) {
11133
11133
  const n = r.node(-1), s = Q.get(n), o = r.start(-1), i = s.nextCell(r.pos - o, e, t);
11134
11134
  return i == null ? null : r.node(0).resolve(o + i);
11135
11135
  }
11136
- function zt(r, e, t = 1) {
11136
+ function Bt(r, e, t = 1) {
11137
11137
  const n = { ...r, colspan: r.colspan - t };
11138
11138
  return n.colwidth && (n.colwidth = n.colwidth.slice(), n.colwidth.splice(e, t), n.colwidth.some((s) => s > 0) || (n.colwidth = null)), n;
11139
11139
  }
@@ -11203,7 +11203,7 @@ var H = class Ue extends V {
11203
11203
  const y = s.left - h.left, g = h.right - s.right;
11204
11204
  if (y > 0 || g > 0) {
11205
11205
  let b = p.attrs;
11206
- if (y > 0 && (b = zt(b, 0, y)), g > 0 && (b = zt(
11206
+ if (y > 0 && (b = Bt(b, 0, y)), g > 0 && (b = Bt(
11207
11207
  b,
11208
11208
  b.colspan - g,
11209
11209
  g
@@ -11418,7 +11418,7 @@ function pp(r, e, t, n) {
11418
11418
  n.setNodeMarkup(
11419
11419
  n.mapping.map(t + 1 + c.pos),
11420
11420
  null,
11421
- zt(f, f.colspan - c.n, c.n)
11421
+ Bt(f, f.colspan - c.n, c.n)
11422
11422
  );
11423
11423
  } else if (c.type == "missing")
11424
11424
  o[c.row] += c.n;
@@ -11511,7 +11511,7 @@ function yp(r, { map: e, table: t, tableStart: n }, s) {
11511
11511
  r.setNodeMarkup(
11512
11512
  r.mapping.slice(o).map(n + a),
11513
11513
  null,
11514
- zt(u, s - e.colCount(a))
11514
+ Bt(u, s - e.colCount(a))
11515
11515
  );
11516
11516
  else {
11517
11517
  const f = r.mapping.slice(o).map(n + a);
@@ -11731,7 +11731,7 @@ function Dp(r) {
11731
11731
  return !0;
11732
11732
  };
11733
11733
  }
11734
- function qt(r, e) {
11734
+ function Jt(r, e) {
11735
11735
  return function(t, n) {
11736
11736
  if (!ve(t)) return !1;
11737
11737
  const s = vr(t);
@@ -11953,7 +11953,7 @@ function jp({ width: r, height: e, rows: t }, n, s) {
11953
11953
  for (let u = o[l] || 0, f = 0; u < n; f++) {
11954
11954
  let d = a.child(f % a.childCount);
11955
11955
  u + d.attrs.colspan > n && (d = d.type.createChecked(
11956
- zt(
11956
+ Bt(
11957
11957
  d.attrs,
11958
11958
  d.attrs.colspan,
11959
11959
  u + d.attrs.colspan - n
@@ -12047,7 +12047,7 @@ function Hi(r, e, t, n, s, o, i, l) {
12047
12047
  r.setNodeMarkup(
12048
12048
  p,
12049
12049
  null,
12050
- zt(
12050
+ Bt(
12051
12051
  d.attrs,
12052
12052
  i - h,
12053
12053
  d.attrs.colspan - (i - h)
@@ -12055,7 +12055,7 @@ function Hi(r, e, t, n, s, o, i, l) {
12055
12055
  ), r.insert(
12056
12056
  p + d.nodeSize,
12057
12057
  d.type.createAndFill(
12058
- zt(d.attrs, 0, i - h)
12058
+ Bt(d.attrs, 0, i - h)
12059
12059
  )
12060
12060
  ), c += d.attrs.rowspan - 1;
12061
12061
  }
@@ -12295,7 +12295,7 @@ function Wp({
12295
12295
  }
12296
12296
  });
12297
12297
  }
12298
- const cn = tt(null), _p = tt(null), Za = /* @__PURE__ */ tt(null), Zn = /* @__PURE__ */ new WeakMap();
12298
+ const un = tt(null), _p = tt(null), Za = /* @__PURE__ */ tt(null), Zn = /* @__PURE__ */ new WeakMap();
12299
12299
  function qp(r) {
12300
12300
  const e = /* @__PURE__ */ Object.create(null);
12301
12301
  e.class = "ProseMirror", e.contenteditable = String(r.editable), r.someProp("attributes", (s) => {
@@ -12308,26 +12308,26 @@ function qp(r) {
12308
12308
  return !n || n[0].to !== r.state.doc.content.size || !n[0].type.eq(t[0].type) ? (Zn.set(r, t), t) : n;
12309
12309
  }
12310
12310
  const Jp = [], Hp = {}, Vs = _.empty;
12311
- let Yi = class Ut {
12311
+ let Yi = class Yt {
12312
12312
  constructor(e) {
12313
12313
  W(this, "members");
12314
12314
  this.members = e;
12315
12315
  }
12316
12316
  map(e, t) {
12317
12317
  const n = this.members.map((s) => s.map(e, t, Hp));
12318
- return Ut.from(n);
12318
+ return Yt.from(n);
12319
12319
  }
12320
12320
  forChild(e, t) {
12321
12321
  if (t.isLeaf) return _.empty;
12322
12322
  let n = [];
12323
12323
  for (let s = 0; s < this.members.length; s++) {
12324
12324
  const o = this.members[s].forChild(e, t);
12325
- o != Vs && (o instanceof Ut ? n = n.concat(o.members) : n.push(o));
12325
+ o != Vs && (o instanceof Yt ? n = n.concat(o.members) : n.push(o));
12326
12326
  }
12327
- return Ut.from(n);
12327
+ return Yt.from(n);
12328
12328
  }
12329
12329
  eq(e) {
12330
- if (!(e instanceof Ut) || e.members.length != this.members.length) return !1;
12330
+ if (!(e instanceof Yt) || e.members.length != this.members.length) return !1;
12331
12331
  for (let t = 0; t < this.members.length; t++) if (!this.members[t].eq(e.members[t])) return !1;
12332
12332
  return !0;
12333
12333
  }
@@ -12354,7 +12354,7 @@ let Yi = class Ut {
12354
12354
  case 1:
12355
12355
  return e[0];
12356
12356
  default:
12357
- return new Ut(e.every((t) => t instanceof _) ? e : e.reduce((t, n) => t.concat(n instanceof _ ? n : n.members), []));
12357
+ return new Yt(e.every((t) => t instanceof _) ? e : e.reduce((t, n) => t.concat(n instanceof _ ? n : n.members), []));
12358
12358
  }
12359
12359
  }
12360
12360
  forEachSet(e) {
@@ -12641,7 +12641,7 @@ function Zp(r, e) {
12641
12641
  le(() => t(r), e);
12642
12642
  }
12643
12643
  function qe(r, e) {
12644
- const { view: t, flushSyncRef: n } = me(cn);
12644
+ const { view: t, flushSyncRef: n } = me(un);
12645
12645
  Zp(
12646
12646
  () => {
12647
12647
  if (t instanceof It) {
@@ -12686,7 +12686,7 @@ function tm(r, e) {
12686
12686
  const nm = {
12687
12687
  side: 0
12688
12688
  };
12689
- class tn {
12689
+ class nn {
12690
12690
  constructor(e, t) {
12691
12691
  W(this, "Component");
12692
12692
  W(this, "side");
@@ -12701,13 +12701,13 @@ class tn {
12701
12701
  return !0;
12702
12702
  }
12703
12703
  eq(e) {
12704
- return this == e || e instanceof tn && (this.spec.key && this.spec.key == e.spec.key || this.Component == e.Component && tm(this.spec, e.spec));
12704
+ return this == e || e instanceof nn && (this.spec.key && this.spec.key == e.spec.key || this.Component == e.Component && tm(this.spec, e.spec));
12705
12705
  }
12706
12706
  destroy() {
12707
12707
  }
12708
12708
  }
12709
12709
  function rm(r, e, t) {
12710
- return new re(r, r, new tn(e, t));
12710
+ return new re(r, r, new nn(e, t));
12711
12711
  }
12712
12712
  function as(r, e) {
12713
12713
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -12952,16 +12952,16 @@ const Pe = tt({
12952
12952
  siblingsRef: {
12953
12953
  current: []
12954
12954
  }
12955
- }), $e = typeof navigator < "u" ? navigator : null, rl = typeof document < "u" ? document : null, Ft = $e && $e.userAgent || "", zs = /Edge\/(\d+)/.exec(Ft), rc = /MSIE \d/.exec(Ft), Bs = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ft), fo = !!(rc || Bs || zs);
12955
+ }), $e = typeof navigator < "u" ? navigator : null, rl = typeof document < "u" ? document : null, Lt = $e && $e.userAgent || "", zs = /Edge\/(\d+)/.exec(Lt), rc = /MSIE \d/.exec(Lt), Bs = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lt), fo = !!(rc || Bs || zs);
12956
12956
  rc ? document.documentMode : Bs ? +Bs[1] : zs && +zs[1];
12957
- const sc = !fo && /gecko\/(\d+)/i.test(Ft);
12958
- sc && +(/Firefox\/(\d+)/.exec(Ft) || [
12957
+ const sc = !fo && /gecko\/(\d+)/i.test(Lt);
12958
+ sc && +(/Firefox\/(\d+)/.exec(Lt) || [
12959
12959
  0,
12960
12960
  0
12961
12961
  ])[1];
12962
- const Fs = !fo && /Chrome\/(\d+)/.exec(Ft), cm = !!Fs;
12962
+ const Fs = !fo && /Chrome\/(\d+)/.exec(Lt), cm = !!Fs;
12963
12963
  Fs && +Fs[1];
12964
- const oc = !fo && !!$e && /Apple Computer/.test($e.vendor), um = oc && (/Mobile\/\w+/.test(Ft) || !!$e && $e.maxTouchPoints > 2);
12964
+ const oc = !fo && !!$e && /Apple Computer/.test($e.vendor), um = oc && (/Mobile\/\w+/.test(Lt) || !!$e && $e.maxTouchPoints > 2);
12965
12965
  um || $e && /Mac/.test($e.platform);
12966
12966
  $e && /Win/.test($e.platform);
12967
12967
  const fm = !!rl && "webkitFontSmoothing" in rl.documentElement.style;
@@ -12969,15 +12969,15 @@ fm && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [
12969
12969
  0,
12970
12970
  0
12971
12971
  ])[1];
12972
- const Yt = {
12972
+ const Gt = {
12973
12973
  gecko: sc,
12974
12974
  chrome: cm,
12975
12975
  safari: oc
12976
12976
  };
12977
- function Lt(r, e) {
12978
- return r instanceof Rn ? 1 : e instanceof Rn ? -1 : r.getPos() - e.getPos();
12977
+ function $t(r, e) {
12978
+ return r instanceof In ? 1 : e instanceof In ? -1 : r.getPos() - e.getPos();
12979
12979
  }
12980
- const gt = 0, sl = 1, er = 2, Bt = 3;
12980
+ const gt = 0, sl = 1, er = 2, Ft = 3;
12981
12981
  class Jn {
12982
12982
  constructor(e, t, n, s, o) {
12983
12983
  W(this, "parent");
@@ -13148,7 +13148,7 @@ class Jn {
13148
13148
  let n = 0, s = 0;
13149
13149
  for (let o = 0; n < this.children.length; n++) {
13150
13150
  const i = this.children[n], l = o + i.size;
13151
- if (l > e || i instanceof Rn) {
13151
+ if (l > e || i instanceof In) {
13152
13152
  s = e - o;
13153
13153
  break;
13154
13154
  }
@@ -13253,7 +13253,7 @@ class Jn {
13253
13253
  let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1);
13254
13254
  const c = n.root.getSelection(), u = n.domSelectionRange();
13255
13255
  let f = !1;
13256
- if ((Yt.gecko || Yt.safari) && e == t) {
13256
+ if ((Gt.gecko || Gt.safari) && e == t) {
13257
13257
  const { node: p, offset: y } = l;
13258
13258
  if (p.nodeType == 3) {
13259
13259
  if (f = !!(y && ((h = p.nodeValue) == null ? void 0 : h[y - 1]) == `
@@ -13274,11 +13274,11 @@ class Jn {
13274
13274
  f = g && (g.nodeName == "BR" || g.contentEditable == "false");
13275
13275
  }
13276
13276
  }
13277
- if (Yt.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
13277
+ if (Gt.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
13278
13278
  const p = u.focusNode.childNodes[u.focusOffset];
13279
13279
  p && p.contentEditable == "false" && (s = !0);
13280
13280
  }
13281
- if (!(s || f && Yt.safari) && Zi(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zi(a.node, a.offset, u.focusNode, u.focusOffset)) return;
13281
+ if (!(s || f && Gt.safari) && Zi(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zi(a.node, a.offset, u.focusNode, u.focusOffset)) return;
13282
13282
  let d = !1;
13283
13283
  if ((c.extend || e == t) && !f) {
13284
13284
  c.collapse(l.node, l.offset);
@@ -13310,10 +13310,10 @@ class Jn {
13310
13310
  if (n == i ? e <= i && t >= n : e < i && t > n) {
13311
13311
  const l = n + o.border, a = i - o.border;
13312
13312
  if (e >= l && t <= a) {
13313
- this.dirty = e == n || t == i ? er : sl, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = Bt : o.markDirty(e - l, t - l);
13313
+ this.dirty = e == n || t == i ? er : sl, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = Ft : o.markDirty(e - l, t - l);
13314
13314
  return;
13315
13315
  } else
13316
- o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? er : Bt;
13316
+ o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? er : Ft;
13317
13317
  }
13318
13318
  n = i;
13319
13319
  }
@@ -13392,14 +13392,14 @@ class dm extends Jn {
13392
13392
  this.mark = o, this.spec = a;
13393
13393
  }
13394
13394
  parseRule() {
13395
- return this.dirty & Bt || this.mark.type.spec.reparseInView ? null : {
13395
+ return this.dirty & Ft || this.mark.type.spec.reparseInView ? null : {
13396
13396
  mark: this.mark.type.name,
13397
13397
  attrs: this.mark.attrs,
13398
13398
  contentElement: this.contentDOM
13399
13399
  };
13400
13400
  }
13401
13401
  matchesMark(t) {
13402
- return this.dirty != Bt && this.mark.eq(t);
13402
+ return this.dirty != Ft && this.mark.eq(t);
13403
13403
  }
13404
13404
  markDirty(t, n) {
13405
13405
  if (super.markDirty(t, n), this.dirty != gt) {
@@ -13460,7 +13460,7 @@ class ic extends Jn {
13460
13460
  // If this desc must be updated to match the given node decoration,
13461
13461
  // do so and return true.
13462
13462
  update(t, n, s, o) {
13463
- return this.dirty == Bt || !t.sameMarkup(this.node) ? !1 : (this.updateInner(t, n, s, o), !0);
13463
+ return this.dirty == Ft || !t.sameMarkup(this.node) ? !1 : (this.updateInner(t, n, s, o), !0);
13464
13464
  }
13465
13465
  updateInner(t, n, s, o) {
13466
13466
  this.updateOuterDeco(n), this.node = t, this.innerDeco = s, this.contentDOM && this.updateChildren(o, this.posAtStart), this.dirty = gt;
@@ -13509,13 +13509,13 @@ class hm extends ic {
13509
13509
  return e == this.nodeDOM ? this.posAtStart + Math.min(t, this.node.text.length) : super.localPosFromDOM(e, t, n);
13510
13510
  }
13511
13511
  markDirty(e, t) {
13512
- super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Bt);
13512
+ super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Ft);
13513
13513
  }
13514
13514
  get domAtom() {
13515
13515
  return !1;
13516
13516
  }
13517
13517
  }
13518
- class Rn extends Jn {
13518
+ class In extends Jn {
13519
13519
  parseRule() {
13520
13520
  return {
13521
13521
  ignore: !0
@@ -13541,7 +13541,7 @@ let pm = class extends ic {
13541
13541
  // through. If it does, and there's a `contentDOM` node, our logic
13542
13542
  // updates the children.
13543
13543
  update(t, n, s, o) {
13544
- if (this.dirty == Bt) return !1;
13544
+ if (this.dirty == Ft) return !1;
13545
13545
  if (this.spec.update && (this.node.type == t.type || this.spec.multiType)) {
13546
13546
  const i = this.spec.update(t, n, s);
13547
13547
  return i && this.updateInner(t, n, s, o), i;
@@ -13586,7 +13586,7 @@ function ol(r, e) {
13586
13586
  return (r == null ? void 0 : r.contentDOM) ?? ((n = (t = e[0]) == null ? void 0 : t.dom) == null ? void 0 : n.parentElement) ?? null;
13587
13587
  }
13588
13588
  function po(r, e, t) {
13589
- const { view: n } = me(cn), { parentRef: s, siblingsRef: o } = me(Pe), [i, l] = M(null), [a, c] = M(null), [u, f] = M(null), d = j(), h = j([]), p = oe((k) => {
13589
+ const { view: n } = me(un), { parentRef: s, siblingsRef: o } = me(Pe), [i, l] = M(null), [a, c] = M(null), [u, f] = M(null), d = j(), h = j([]), p = oe((k) => {
13590
13590
  if (!(n instanceof It))
13591
13591
  return;
13592
13592
  const w = r.current;
@@ -13595,8 +13595,8 @@ function po(r, e, t) {
13595
13595
  const { node: N, getPos: D, decorations: S, innerDecorations: R } = k, z = e(N, n, D, S, R);
13596
13596
  if (!z)
13597
13597
  return;
13598
- const T = s.current, G = h.current, J = ol(z, G), ae = z.dom, un = new mm(T, G, D, N, S, R, w, J, ae, z);
13599
- return l(w), f(J), c(ae), un;
13598
+ const T = s.current, G = h.current, J = ol(z, G), ae = z.dom, fn = new mm(T, G, D, N, S, R, w, J, ae, z);
13599
+ return l(w), f(J), c(ae), fn;
13600
13600
  }, [
13601
13601
  r,
13602
13602
  s,
@@ -13638,7 +13638,7 @@ function po(r, e, t) {
13638
13638
  return;
13639
13639
  n.dom === k.dom && n instanceof It && (n.docView = k);
13640
13640
  const w = s.current, N = o.current, D = h.current;
13641
- k.parent = w, N.includes(k) || N.push(k), N.sort(Lt);
13641
+ k.parent = w, N.includes(k) || N.push(k), N.sort($t);
13642
13642
  for (const R of D)
13643
13643
  if (R.parent = k, R instanceof Ls) {
13644
13644
  const z = (S = k == null ? void 0 : k.contentDOM) == null ? void 0 : S.firstChild;
@@ -13690,7 +13690,7 @@ function bm(r, e, t, n) {
13690
13690
  const g = s[i++];
13691
13691
  (g.widget || // FORK: Our custom widget type can't report itself as a widget,
13692
13692
  // so we have to explicitly check
13693
- g.type instanceof tn) && (p ? (y || (y = [
13693
+ g.type instanceof nn) && (p ? (y || (y = [
13694
13694
  p
13695
13695
  ])).push(g) : p = g);
13696
13696
  }
@@ -13700,7 +13700,7 @@ function bm(r, e, t, n) {
13700
13700
  for (let g = 0; g < y.length; g++) t(
13701
13701
  y[g],
13702
13702
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13703
- !(y[g].type instanceof tn),
13703
+ !(y[g].type instanceof nn),
13704
13704
  o,
13705
13705
  c + g,
13706
13706
  !!a
@@ -13709,7 +13709,7 @@ function bm(r, e, t, n) {
13709
13709
  t(
13710
13710
  p,
13711
13711
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13712
- !(p.type instanceof tn),
13712
+ !(p.type instanceof nn),
13713
13713
  o,
13714
13714
  c,
13715
13715
  !!a
@@ -13796,7 +13796,7 @@ function xm() {
13796
13796
  });
13797
13797
  }
13798
13798
  function km() {
13799
- const { view: r } = me(cn);
13799
+ const { view: r } = me(un);
13800
13800
  return lc.getState(r.state);
13801
13801
  }
13802
13802
  var ac = { exports: {} };
@@ -14091,7 +14091,7 @@ const mo = /* @__PURE__ */ je(/* @__PURE__ */ Ve(function(e, t) {
14091
14091
  a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (h == null ? void 0 : h.dom.parentElement) ?? u.current, a.current.mark = n) : a.current = new dm(l.current, c.current, s, n, u.current, (h == null ? void 0 : h.dom.parentElement) ?? u.current, {
14092
14092
  dom: u.current,
14093
14093
  contentDOM: (h == null ? void 0 : h.dom.parentElement) ?? u.current
14094
- }), i.current.includes(a.current) || i.current.push(a.current), i.current.sort(Lt);
14094
+ }), i.current.includes(a.current) || i.current.push(a.current), i.current.sort($t);
14095
14095
  for (const p of c.current)
14096
14096
  p.parent = a.current;
14097
14097
  });
@@ -14136,7 +14136,7 @@ function Nm(r) {
14136
14136
  }
14137
14137
  i.current.firstElementChild !== c && i.current.replaceChildren(c);
14138
14138
  }), le(() => {
14139
- i.current && (o.current ? (o.current.parent = s.current, o.current.widget = e, o.current.dom = i.current) : o.current = new ho(s.current, t, e, i.current), n.current.includes(o.current) || n.current.push(o.current), n.current.sort(Lt));
14139
+ i.current && (o.current ? (o.current.parent = s.current, o.current.widget = e, o.current.dom = i.current) : o.current = new ho(s.current, t, e, i.current), n.current.includes(o.current) || n.current.push(o.current), n.current.sort($t));
14140
14140
  }), /* @__PURE__ */ I.createElement("span", {
14141
14141
  ref: i
14142
14142
  });
@@ -14309,11 +14309,11 @@ function vm(r) {
14309
14309
  ]), le(() => {
14310
14310
  var c;
14311
14311
  const a = t.current[t.current.length - 1];
14312
- if ((Yt.safari || Yt.chrome) && ((c = a == null ? void 0 : a.dom) == null ? void 0 : c.contentEditable) == "false") {
14312
+ if ((Gt.safari || Gt.chrome) && ((c = a == null ? void 0 : a.dom) == null ? void 0 : c.contentEditable) == "false") {
14313
14313
  l(!0);
14314
14314
  return;
14315
14315
  }
14316
- o.current && (s.current ? (s.current.parent = n.current, s.current.dom = o.current) : s.current = new Rn(n.current, [], e, o.current, null), t.current.includes(s.current) || t.current.push(s.current), t.current.sort(Lt));
14316
+ o.current && (s.current ? (s.current.parent = n.current, s.current.dom = o.current) : s.current = new In(n.current, [], e, o.current, null), t.current.includes(s.current) || t.current.push(s.current), t.current.sort($t));
14317
14317
  }), i ? /* @__PURE__ */ I.createElement("img", {
14318
14318
  ref: o,
14319
14319
  className: "ProseMirror-separator"
@@ -14667,7 +14667,7 @@ class Fm extends Wc {
14667
14667
  let c = a;
14668
14668
  for (; c.firstChild; )
14669
14669
  c = c.firstChild;
14670
- !this.viewDescRef || this.viewDescRef instanceof Ls ? this.viewDescRef = new hm(void 0, [], i, l, n, _.empty, a, c) : (this.viewDescRef.parent = o.current, this.viewDescRef.children = [], this.viewDescRef.node = l, this.viewDescRef.outerDeco = n, this.viewDescRef.innerDeco = _.empty, this.viewDescRef.dom = a, this.viewDescRef.dom.pmViewDesc = this.viewDescRef, this.viewDescRef.nodeDOM = c), s.current.includes(this.viewDescRef) || s.current.push(this.viewDescRef), s.current.sort(Lt);
14670
+ !this.viewDescRef || this.viewDescRef instanceof Ls ? this.viewDescRef = new hm(void 0, [], i, l, n, _.empty, a, c) : (this.viewDescRef.parent = o.current, this.viewDescRef.children = [], this.viewDescRef.node = l, this.viewDescRef.outerDeco = n, this.viewDescRef.innerDeco = _.empty, this.viewDescRef.dom = a, this.viewDescRef.dom.pmViewDesc = this.viewDescRef, this.viewDescRef.nodeDOM = c), s.current.includes(this.viewDescRef) || s.current.push(this.viewDescRef), s.current.sort($t);
14671
14671
  }
14672
14672
  shouldComponentUpdate(t) {
14673
14673
  return !Bm(this.props, t);
@@ -14704,7 +14704,7 @@ function Lm(r) {
14704
14704
  }, [
14705
14705
  t
14706
14706
  ]), le(() => {
14707
- o.current && (s.current ? (s.current.parent = n.current, s.current.dom = o.current) : s.current = new Rn(n.current, [], e, o.current, null), t.current.includes(s.current) || t.current.push(s.current), t.current.sort(Lt));
14707
+ o.current && (s.current ? (s.current.parent = n.current, s.current.dom = o.current) : s.current = new In(n.current, [], e, o.current, null), t.current.includes(s.current) || t.current.push(s.current), t.current.sort($t));
14708
14708
  }), /* @__PURE__ */ I.createElement("br", {
14709
14709
  ref: o,
14710
14710
  className: "ProseMirror-trailingBreak"
@@ -14724,7 +14724,7 @@ function $m(r) {
14724
14724
  }, [
14725
14725
  n
14726
14726
  ]), le(() => {
14727
- i.current && (o.current ? (o.current.parent = s.current, o.current.widget = e, o.current.dom = i.current) : o.current = new ho(s.current, t, e, i.current), n.current.includes(o.current) || n.current.push(o.current), n.current.sort(Lt));
14727
+ i.current && (o.current ? (o.current.parent = s.current, o.current.widget = e, o.current.dom = i.current) : o.current = new ho(s.current, t, e, i.current), n.current.includes(o.current) || n.current.push(o.current), n.current.sort($t));
14728
14728
  });
14729
14729
  const { Component: l } = e.type;
14730
14730
  return l && /* @__PURE__ */ I.createElement(l, {
@@ -14748,7 +14748,7 @@ function cs(r, e) {
14748
14748
  }
14749
14749
  const Wm = /* @__PURE__ */ je(function(e) {
14750
14750
  let { child: t, getInnerPos: n } = e;
14751
- const { view: s } = me(cn), o = j(t);
14751
+ const { view: s } = me(un), o = j(t);
14752
14752
  o.current = t;
14753
14753
  const i = oe(() => n() + o.current.offset, [
14754
14754
  n
@@ -15062,7 +15062,7 @@ function Gm(r) {
15062
15062
  h,
15063
15063
  p
15064
15064
  ]);
15065
- return /* @__PURE__ */ I.createElement(cn.Provider, {
15065
+ return /* @__PURE__ */ I.createElement(un.Provider, {
15066
15066
  value: a
15067
15067
  }, /* @__PURE__ */ I.createElement(_p.Provider, {
15068
15068
  value: c
@@ -15080,7 +15080,7 @@ function Xm(r) {
15080
15080
  throw new DOMException("ProseMirror document is not mounted", "InvalidStateError");
15081
15081
  }
15082
15082
  function se(r) {
15083
- const e = j(r), { view: t } = me(cn);
15083
+ const e = j(r), { view: t } = me(un);
15084
15084
  return qe(() => {
15085
15085
  e.current = r;
15086
15086
  }, [
@@ -15326,9 +15326,9 @@ const xc = (r) => [
15326
15326
  }
15327
15327
  }
15328
15328
  });
15329
- let ln = "", ul = "", fl = "", In = "", Pn = "";
15329
+ let an = "", ul = "", fl = "", Pt = "", Pn = "";
15330
15330
  const ly = (r) => {
15331
- ln = r.api_url ?? ln, ul = r.video_image ?? ul, fl = r.empty_image ?? fl, In = r.error_image ?? In, Pn = r.error_embed ?? Pn;
15331
+ an = r.api_url ?? an, ul = r.video_image ?? ul, fl = r.empty_image ?? fl, Pt = r.error_image ?? Pt, Pn = r.error_embed ?? Pn;
15332
15332
  }, Vn = (r, e) => {
15333
15333
  try {
15334
15334
  const t = new URL(r);
@@ -15411,16 +15411,17 @@ const ly = (r) => {
15411
15411
  },
15412
15412
  group: "block",
15413
15413
  parseDOM: [{ tag: "img[src]", getAttrs(r) {
15414
- return {
15414
+ let e = r.getAttribute("src");
15415
+ return e || (e = Pt), e.startsWith("data:") && (e = Pt), {
15416
+ src: e,
15415
15417
  fid: r.getAttribute("fid"),
15416
- src: r.getAttribute("src"),
15417
15418
  alt: r.getAttribute("alt"),
15418
15419
  title: r.getAttribute("title")
15419
15420
  };
15420
15421
  } }],
15421
15422
  toDOM(r) {
15422
15423
  let { fid: e, src: t, alt: n, title: s } = r.attrs;
15423
- return e && (t = `${ln}/${e}`), t || (t = In), ["div", { title: s, class: "image" }, ["img", { fid: e, src: t, alt: n, title: s }]];
15424
+ return e && (t = `${an}/${e}`), t || (t = Pt), ["div", { title: s, class: "image" }, ["img", { fid: e, src: t, alt: n, title: s }]];
15424
15425
  }
15425
15426
  }, cg = {
15426
15427
  atom: !0,
@@ -15486,7 +15487,7 @@ const ly = (r) => {
15486
15487
  toDOM() {
15487
15488
  return ["div", { class: "carousel" }, 0];
15488
15489
  }
15489
- }, Cc = kc.spec.nodes.remove("image").append({ image: ag, video: cg }), Mn = new Nr({
15490
+ }, Cc = kc.spec.nodes.remove("image").append({ image: ag, video: cg }), Nn = new Nr({
15490
15491
  nodes: Cc.remove("horizontal_rule").remove("heading"),
15491
15492
  marks: wc
15492
15493
  }), hg = Cc.remove("heading").remove("paragraph").prepend({ paragraph: ug }).append({ heading: fg }).append({ carousel: dg }).append(rp(
@@ -15524,7 +15525,7 @@ const ly = (r) => {
15524
15525
  if (r)
15525
15526
  try {
15526
15527
  const e = Se.fromJSON(Ze, JSON.parse(r)), t = nt.fromSchema(Ze).serializeFragment(e.content);
15527
- return Or.fromSchema(Mn).parse(t);
15528
+ return Or.fromSchema(Nn).parse(t);
15528
15529
  } catch (e) {
15529
15530
  console.error(`Can not convert content to simple schema: ${e}`);
15530
15531
  }
@@ -15554,14 +15555,14 @@ const ly = (r) => {
15554
15555
  const o = r.nodes.paragraph;
15555
15556
  t({
15556
15557
  icon: /* @__PURE__ */ m.jsx(E.Type, {}),
15557
- command: Qt(o)
15558
+ command: Zt(o)
15558
15559
  });
15559
15560
  }
15560
15561
  if (r.nodes.code_block) {
15561
15562
  const o = r.nodes.code_block;
15562
15563
  s({
15563
15564
  icon: /* @__PURE__ */ m.jsx(E.CodeXml, {}),
15564
- command: Qt(o)
15565
+ command: Zt(o)
15565
15566
  });
15566
15567
  }
15567
15568
  }, [r]), /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
@@ -15980,7 +15981,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
15980
15981
  {
15981
15982
  title: t.node.attrs.title,
15982
15983
  alt: t.node.attrs.alt,
15983
- src: t.node.attrs.fid ? `${ln}/${t.node.attrs.fid}` : t.node.attrs.src
15984
+ src: t.node.attrs.fid ? `${an}/${t.node.attrs.fid}` : t.node.attrs.src
15984
15985
  }
15985
15986
  ),
15986
15987
  /* @__PURE__ */ m.jsx("div", { className: "image-title", children: /* @__PURE__ */ m.jsx(
@@ -16095,8 +16096,8 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16095
16096
  q(() => {
16096
16097
  const h = ft.create({
16097
16098
  doc: pg(e),
16098
- schema: Mn,
16099
- plugins: xc({ schema: Mn, upload: o })
16099
+ schema: Nn,
16100
+ plugins: xc({ schema: Nn, upload: o })
16100
16101
  });
16101
16102
  c(h), r !== !1 && l(typeof r == "string" ? r : "");
16102
16103
  }, [r, e]);
@@ -16129,7 +16130,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16129
16130
  },
16130
16131
  children: [
16131
16132
  /* @__PURE__ */ m.jsxs("div", { className: "ProseNotesContent", children: [
16132
- /* @__PURE__ */ m.jsx(bg, { schema: Mn }),
16133
+ /* @__PURE__ */ m.jsx(bg, { schema: Nn }),
16133
16134
  /* @__PURE__ */ m.jsx(gc, {})
16134
16135
  ] }),
16135
16136
  (t || n) && /* @__PURE__ */ m.jsxs("div", { className: "ProseNotesButtons", children: [
@@ -16147,7 +16148,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16147
16148
  if (!c || !u || !i) return;
16148
16149
  const f = [], d = [];
16149
16150
  for (let h = 2; h < 7; h++) {
16150
- const y = Qt(u, { level: h });
16151
+ const y = Zt(u, { level: h });
16151
16152
  d[h] = y, f[h] = {
16152
16153
  id: h,
16153
16154
  icon: /* @__PURE__ */ m.jsx(kg, { level: h }),
@@ -16171,7 +16172,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16171
16172
  }
16172
16173
  ),
16173
16174
  e.current && /* @__PURE__ */ m.jsx(
16174
- kn,
16175
+ wn,
16175
16176
  {
16176
16177
  parent: e.current,
16177
16178
  items: t,
@@ -16237,7 +16238,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16237
16238
  }
16238
16239
  ),
16239
16240
  e.current && /* @__PURE__ */ m.jsx(
16240
- kn,
16241
+ wn,
16241
16242
  {
16242
16243
  parent: e.current,
16243
16244
  items: wg,
@@ -16261,10 +16262,10 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16261
16262
  /* @__PURE__ */ m.jsx(Nc, {}),
16262
16263
  t && /* @__PURE__ */ m.jsx("div", { className: "MenuItem", onClick: () => t(), children: /* @__PURE__ */ m.jsx(E.Eye, {}) }),
16263
16264
  /* @__PURE__ */ m.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ m.jsx(Rc, { onSave: e }) })
16264
- ] }), Mg = 7, Ic = 1, xn = 50, Ng = ({ width: r, onChange: e, onWidth: t }) => {
16265
+ ] }), Mg = 7, Ic = 1, kn = 50, Ng = ({ width: r, onChange: e, onWidth: t }) => {
16265
16266
  const [n, s] = M(!1), [o, i] = M(0), [l, a] = M(0), [c, u] = M(r), f = (p) => {
16266
16267
  const y = r[l], g = r[l + 1], b = [...c];
16267
- return y + p < xn && (p = xn - y), g - p < xn && (p = g - xn), b[l] = y + p, b[l + 1] = g - p, b;
16268
+ return y + p < kn && (p = kn - y), g - p < kn && (p = g - kn), b[l] = y + p, b[l + 1] = g - p, b;
16268
16269
  };
16269
16270
  q(() => {
16270
16271
  u(r);
@@ -16317,7 +16318,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16317
16318
  const R = h.child(S), { colspan: z, colwidth: T } = R.attrs;
16318
16319
  p = p.concat(Array.isArray(T) ? T : Array(z).fill(0));
16319
16320
  }
16320
- const y = p.filter((S) => !S).length, g = p.reduce((S, R) => S + R, 0), b = (p.length + 1) * Ic, k = Math.max(y ? (o.current.offsetWidth - g - b) / y : 0, xn);
16321
+ const y = p.filter((S) => !S).length, g = p.reduce((S, R) => S + R, 0), b = (p.length + 1) * Ic, k = Math.max(y ? (o.current.offsetWidth - g - b) / y : 0, kn);
16321
16322
  p = p.map((S) => S || k);
16322
16323
  const w = p.reduce((S, R) => S + R, 0), N = i.current.offsetWidth - b - 16, D = N / w;
16323
16324
  p = p.map((S) => Math.round(S * D)), p[p.length - 1] += N - p.reduce((S, R) => S + R, 0), a(p);
@@ -16459,22 +16460,22 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16459
16460
  vp(c.state, c.dispatch);
16460
16461
  break;
16461
16462
  case "alignLeft":
16462
- qt("halign", "left")(c.state, c.dispatch);
16463
+ Jt("halign", "left")(c.state, c.dispatch);
16463
16464
  break;
16464
16465
  case "alignCenter":
16465
- qt("halign", "center")(c.state, c.dispatch);
16466
+ Jt("halign", "center")(c.state, c.dispatch);
16466
16467
  break;
16467
16468
  case "alignRight":
16468
- qt("halign", "right")(c.state, c.dispatch);
16469
+ Jt("halign", "right")(c.state, c.dispatch);
16469
16470
  break;
16470
16471
  case "alignTop":
16471
- qt("valign", "top")(c.state, c.dispatch);
16472
+ Jt("valign", "top")(c.state, c.dispatch);
16472
16473
  break;
16473
16474
  case "alignMiddle":
16474
- qt("valign", "middle")(c.state, c.dispatch);
16475
+ Jt("valign", "middle")(c.state, c.dispatch);
16475
16476
  break;
16476
16477
  case "alignBottom":
16477
- qt("valign", "bottom")(c.state, c.dispatch);
16478
+ Jt("valign", "bottom")(c.state, c.dispatch);
16478
16479
  break;
16479
16480
  }
16480
16481
  o(), i(), l(), c.focus();
@@ -16482,7 +16483,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16482
16483
  });
16483
16484
  return /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
16484
16485
  /* @__PURE__ */ m.jsx(
16485
- kn,
16486
+ wn,
16486
16487
  {
16487
16488
  x: r,
16488
16489
  y: e,
@@ -16493,7 +16494,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16493
16494
  }
16494
16495
  ),
16495
16496
  /* @__PURE__ */ m.jsx(
16496
- kn,
16497
+ wn,
16497
16498
  {
16498
16499
  x: r,
16499
16500
  y: e,
@@ -16504,7 +16505,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16504
16505
  }
16505
16506
  ),
16506
16507
  /* @__PURE__ */ m.jsx(
16507
- kn,
16508
+ wn,
16508
16509
  {
16509
16510
  x: r,
16510
16511
  y: e,
@@ -16734,7 +16735,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16734
16735
  }, []), q(() => {
16735
16736
  var h, p, y, g, b, k, w;
16736
16737
  let f = (h = r.attrs) == null ? void 0 : h.fid, d = (p = r.attrs) != null && p.src ? `${(y = r.attrs) == null ? void 0 : y.src}` : "";
16737
- f && (d = `${ln}/${f}`), d || (d = In), n(d), o((g = r.attrs) != null && g.alt ? `${(b = r.attrs) == null ? void 0 : b.alt}` : ""), l((k = r.attrs) != null && k.title ? `${(w = r.attrs) == null ? void 0 : w.title}` : "");
16738
+ f && (d = `${an}/${f}`), d || (d = Pt), n(d), o((g = r.attrs) != null && g.alt ? `${(b = r.attrs) == null ? void 0 : b.alt}` : ""), l((k = r.attrs) != null && k.title ? `${(w = r.attrs) == null ? void 0 : w.title}` : "");
16738
16739
  }, [r]);
16739
16740
  const u = (f) => {
16740
16741
  var d;
@@ -16887,7 +16888,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16887
16888
  return q(() => {
16888
16889
  var d, h, p, y;
16889
16890
  let a = (d = r.attrs) == null ? void 0 : d.fid, c = (h = r.attrs) != null && h.src ? `${r.attrs.src}` : "", u = (p = r.attrs) != null && p.alt ? `${r.attrs.alt}` : "", f = (y = r.attrs) != null && y.title ? `${r.attrs.title}` : "";
16890
- a && (c = `${ln}/${a}`), c || (c = In), n(c), o(u), l(f);
16891
+ a && (c = `${an}/${a}`), c || (c = Pt), n(c), o(u), l(f);
16891
16892
  }, [r]), r.type !== "image" ? null : /* @__PURE__ */ m.jsxs("div", { className: "image", children: [
16892
16893
  t && /* @__PURE__ */ m.jsx("img", { src: t, onClick: e, alt: s, title: i }),
16893
16894
  i && /* @__PURE__ */ m.jsx("div", { className: "image-title", children: i })
@@ -16965,7 +16966,7 @@ const Tc = ({ schema: r }) => r.nodes.carousel ? /* @__PURE__ */ m.jsx(Fn, { ite
16965
16966
  l && i[n].setAttribute("fid", l);
16966
16967
  }
16967
16968
  }
16968
- const o = Or.fromSchema(e ? Mn : Ze).parse(s).toJSON();
16969
+ const o = Or.fromSchema(e ? Nn : Ze).parse(s).toJSON();
16969
16970
  return JSON.stringify(o);
16970
16971
  } catch (s) {
16971
16972
  return console.error(`Can not convert html content to prose format: ${s}`), Gg;