@sit-onyx/tiptap 0.1.0-dev-20260220131055 → 0.1.0-dev-20260224080800

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.
Files changed (2) hide show
  1. package/dist/index.js +185 -183
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { computed as Q, defineComponent as Ee, openBlock as O, createBlock as N, unref as x, mergeProps as qe, withCtx as B, createVNode as z, renderSlot as nn, createElementBlock as Sr, normalizeClass as wr, Fragment as no, renderList as ro, createCommentVNode as J, createTextVNode as io, toDisplayString as oo, toRef as Cr, useId as so, ref as An, watch as Ie, withModifiers as lo, useSlots as ao, createElementVNode as nt } from "vue";
2
- import { iconChevronDownSmall as co, iconH4 as fo, iconH3 as uo, iconH2 as ho, iconH1 as po, iconParagraphText as On, iconLink as Nn, iconCheckSmall as mo, iconBulletList as go, iconNumberedList as yo, iconList as xo, iconToolBold as bo, iconToolItalic as ko, iconToolUnderlined as So, iconToolStrike as wo, iconAlignmentLeft as Co, iconAlignmentCenter as vo, iconAlignmentRight as To, iconAlignmentBlock as Eo, iconQuote as Mo, iconUndo as Ao, iconRedo as Oo } from "@sit-onyx/icons";
2
+ import { iconChevronDownSmall as co, iconH4 as fo, iconH3 as uo, iconH2 as ho, iconH1 as po, iconParagraphText as On, iconLink as Nn, iconCheckSmall as mo, iconBulletList as go, iconNumberedList as yo, iconList as xo, iconToolBold as ko, iconToolItalic as bo, iconToolUnderlined as So, iconToolStrike as wo, iconAlignmentLeft as Co, iconAlignmentCenter as vo, iconAlignmentRight as To, iconAlignmentBlock as Eo, iconQuote as Mo, iconUndo as Ao, iconRedo as Oo } from "@sit-onyx/icons";
3
3
  import { mergeAttributes as vr, Extension as No, useEditor as Io, EditorContent as Ro } from "@tiptap/vue-3";
4
4
  import { useForwardProps as Tr, OnyxSystemButton as In, useRootAttrs as zo, OnyxTooltip as Do, mergeVueProps as Bo, OnyxFlyoutMenu as Po, OnyxMenuItem as $o, OnyxIcon as at, injectI18n as Tt, OnyxDialog as Fo, OnyxForm as Lo, OnyxInput as Rn, OnyxBottomBar as Vo, OnyxButton as zn, FORM_INJECTED_SYMBOL as Dn, useFormContext as _o, useVModel as Jo, OnyxFormElement as Bn, getFormMessages as Pn } from "sit-onyx";
5
5
  import Wo from "@tiptap/extension-text-align";
@@ -154,7 +154,7 @@ function Mr(n, e, t, r) {
154
154
  t -= a, r -= a;
155
155
  }
156
156
  }
157
- class b {
157
+ class k {
158
158
  /**
159
159
  @internal
160
160
  */
@@ -209,7 +209,7 @@ class b {
209
209
  let t = this.lastChild, r = e.firstChild, i = this.content.slice(), o = 0;
210
210
  for (t.isText && t.sameMarkup(r) && (i[i.length - 1] = t.withText(t.text + r.text), o = 1); o < e.content.length; o++)
211
211
  i.push(e.content[o]);
212
- return new b(i, this.size + e.size);
212
+ return new k(i, this.size + e.size);
213
213
  }
214
214
  /**
215
215
  Cut out the sub-fragment between the two given positions.
@@ -223,13 +223,13 @@ class b {
223
223
  let l = this.content[o], a = s + l.nodeSize;
224
224
  a > e && ((s < e || a > t) && (l.isText ? l = l.cut(Math.max(0, e - s), Math.min(l.text.length, t - s)) : l = l.cut(Math.max(0, e - s - 1), Math.min(l.content.size, t - s - 1))), r.push(l), i += l.nodeSize), s = a;
225
225
  }
226
- return new b(r, i);
226
+ return new k(r, i);
227
227
  }
228
228
  /**
229
229
  @internal
230
230
  */
231
231
  cutByIndex(e, t) {
232
- return e == t ? b.empty : e == 0 && t == this.content.length ? this : new b(this.content.slice(e, t));
232
+ return e == t ? k.empty : e == 0 && t == this.content.length ? this : new k(this.content.slice(e, t));
233
233
  }
234
234
  /**
235
235
  Create a new fragment in which the node at the given index is
@@ -240,21 +240,21 @@ class b {
240
240
  if (r == t)
241
241
  return this;
242
242
  let i = this.content.slice(), o = this.size + t.nodeSize - r.nodeSize;
243
- return i[e] = t, new b(i, o);
243
+ return i[e] = t, new k(i, o);
244
244
  }
245
245
  /**
246
246
  Create a new fragment by prepending the given node to this
247
247
  fragment.
248
248
  */
249
249
  addToStart(e) {
250
- return new b([e].concat(this.content), this.size + e.nodeSize);
250
+ return new k([e].concat(this.content), this.size + e.nodeSize);
251
251
  }
252
252
  /**
253
253
  Create a new fragment by appending the given node to this
254
254
  fragment.
255
255
  */
256
256
  addToEnd(e) {
257
- return new b(this.content.concat(e), this.size + e.nodeSize);
257
+ return new k(this.content.concat(e), this.size + e.nodeSize);
258
258
  }
259
259
  /**
260
260
  Compare this fragment to another one.
@@ -369,10 +369,10 @@ class b {
369
369
  */
370
370
  static fromJSON(e, t) {
371
371
  if (!t)
372
- return b.empty;
372
+ return k.empty;
373
373
  if (!Array.isArray(t))
374
374
  throw new RangeError("Invalid input for Fragment.fromJSON");
375
- return new b(t.map(e.nodeFromJSON));
375
+ return new k(t.map(e.nodeFromJSON));
376
376
  }
377
377
  /**
378
378
  Build a fragment from an array of nodes. Ensures that adjacent
@@ -380,13 +380,13 @@ class b {
380
380
  */
381
381
  static fromArray(e) {
382
382
  if (!e.length)
383
- return b.empty;
383
+ return k.empty;
384
384
  let t, r = 0;
385
385
  for (let i = 0; i < e.length; i++) {
386
386
  let o = e[i];
387
387
  r += o.nodeSize, i && o.isText && e[i - 1].sameMarkup(o) ? (t || (t = e.slice(0, i)), t[t.length - 1] = o.withText(t[t.length - 1].text + o.text)) : t && t.push(o);
388
388
  }
389
- return new b(t || e, r);
389
+ return new k(t || e, r);
390
390
  }
391
391
  /**
392
392
  Create a fragment from something that can be interpreted as a
@@ -396,17 +396,17 @@ class b {
396
396
  */
397
397
  static from(e) {
398
398
  if (!e)
399
- return b.empty;
400
- if (e instanceof b)
399
+ return k.empty;
400
+ if (e instanceof k)
401
401
  return e;
402
402
  if (Array.isArray(e))
403
403
  return this.fromArray(e);
404
404
  if (e.attrs)
405
- return new b([e], e.nodeSize);
405
+ return new k([e], e.nodeSize);
406
406
  throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
407
407
  }
408
408
  }
409
- b.empty = new b([], 0);
409
+ k.empty = new k([], 0);
410
410
  const zt = { index: 0, offset: 0 };
411
411
  function rt(n, e) {
412
412
  return zt.index = n, zt.offset = e, zt;
@@ -543,7 +543,7 @@ class M {
543
543
  M.none = [];
544
544
  class ht extends Error {
545
545
  }
546
- class k {
546
+ class b {
547
547
  /**
548
548
  Create a slice. When specifying a non-zero open depth, you must
549
549
  make sure that there are nodes of at least that depth at the
@@ -570,13 +570,13 @@ class k {
570
570
  */
571
571
  insertAt(e, t) {
572
572
  let r = Or(this.content, e + this.openStart, t);
573
- return r && new k(r, this.openStart, this.openEnd);
573
+ return r && new b(r, this.openStart, this.openEnd);
574
574
  }
575
575
  /**
576
576
  @internal
577
577
  */
578
578
  removeBetween(e, t) {
579
- return new k(Ar(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
579
+ return new b(Ar(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
580
580
  }
581
581
  /**
582
582
  Tests whether this slice is equal to another slice.
@@ -604,11 +604,11 @@ class k {
604
604
  */
605
605
  static fromJSON(e, t) {
606
606
  if (!t)
607
- return k.empty;
607
+ return b.empty;
608
608
  let r = t.openStart || 0, i = t.openEnd || 0;
609
609
  if (typeof r != "number" || typeof i != "number")
610
610
  throw new RangeError("Invalid input for Slice.fromJSON");
611
- return new k(b.fromJSON(e, t.content), r, i);
611
+ return new b(k.fromJSON(e, t.content), r, i);
612
612
  }
613
613
  /**
614
614
  Create a slice from a fragment by taking the maximum possible
@@ -620,10 +620,10 @@ class k {
620
620
  r++;
621
621
  for (let o = e.lastChild; o && !o.isLeaf && (t || !o.type.spec.isolating); o = o.lastChild)
622
622
  i++;
623
- return new k(e, r, i);
623
+ return new b(e, r, i);
624
624
  }
625
625
  }
626
- k.empty = new k(b.empty, 0, 0);
626
+ b.empty = new b(k.empty, 0, 0);
627
627
  function Ar(n, e, t) {
628
628
  let { index: r, offset: i } = n.findIndex(e), o = n.maybeChild(r), { index: s, offset: l } = n.findIndex(t);
629
629
  if (i == e || o.isText) {
@@ -657,12 +657,12 @@ function Nr(n, e, t, r) {
657
657
  } else if (t.content.size)
658
658
  if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
659
659
  let s = n.parent, l = s.content;
660
- return ke(s, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
660
+ return be(s, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
661
661
  } else {
662
662
  let { start: s, end: l } = Ho(t, n);
663
- return ke(o, Rr(n, s, l, e, r));
663
+ return be(o, Rr(n, s, l, e, r));
664
664
  }
665
- else return ke(o, pt(n, e, r));
665
+ else return be(o, pt(n, e, r));
666
666
  }
667
667
  function Ir(n, e) {
668
668
  if (!e.type.compatibleContent(n.type))
@@ -672,36 +672,36 @@ function jt(n, e, t) {
672
672
  let r = n.node(t);
673
673
  return Ir(r, e.node(t)), r;
674
674
  }
675
- function be(n, e) {
675
+ function ke(n, e) {
676
676
  let t = e.length - 1;
677
677
  t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
678
678
  }
679
679
  function Je(n, e, t, r) {
680
680
  let i = (e || n).node(t), o = 0, s = e ? e.index(t) : i.childCount;
681
- n && (o = n.index(t), n.depth > t ? o++ : n.textOffset && (be(n.nodeAfter, r), o++));
681
+ n && (o = n.index(t), n.depth > t ? o++ : n.textOffset && (ke(n.nodeAfter, r), o++));
682
682
  for (let l = o; l < s; l++)
683
- be(i.child(l), r);
684
- e && e.depth == t && e.textOffset && be(e.nodeBefore, r);
683
+ ke(i.child(l), r);
684
+ e && e.depth == t && e.textOffset && ke(e.nodeBefore, r);
685
685
  }
686
- function ke(n, e) {
686
+ function be(n, e) {
687
687
  return n.type.checkContent(e), n.copy(e);
688
688
  }
689
689
  function Rr(n, e, t, r, i) {
690
690
  let o = n.depth > i && jt(n, e, i + 1), s = r.depth > i && jt(t, r, i + 1), l = [];
691
- return Je(null, n, i, l), o && s && e.index(i) == t.index(i) ? (Ir(o, s), be(ke(o, Rr(n, e, t, r, i + 1)), l)) : (o && be(ke(o, pt(n, e, i + 1)), l), Je(e, t, i, l), s && be(ke(s, pt(t, r, i + 1)), l)), Je(r, null, i, l), new b(l);
691
+ return Je(null, n, i, l), o && s && e.index(i) == t.index(i) ? (Ir(o, s), ke(be(o, Rr(n, e, t, r, i + 1)), l)) : (o && ke(be(o, pt(n, e, i + 1)), l), Je(e, t, i, l), s && ke(be(s, pt(t, r, i + 1)), l)), Je(r, null, i, l), new k(l);
692
692
  }
693
693
  function pt(n, e, t) {
694
694
  let r = [];
695
695
  if (Je(null, n, t, r), n.depth > t) {
696
696
  let i = jt(n, e, t + 1);
697
- be(ke(i, pt(n, e, t + 1)), r);
697
+ ke(be(i, pt(n, e, t + 1)), r);
698
698
  }
699
- return Je(e, null, t, r), new b(r);
699
+ return Je(e, null, t, r), new k(r);
700
700
  }
701
701
  function Ho(n, e) {
702
702
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
703
703
  for (let o = t - 1; o >= 0; o--)
704
- i = e.node(o).copy(b.from(i));
704
+ i = e.node(o).copy(k.from(i));
705
705
  return {
706
706
  start: i.resolveNoCache(n.openStart + t),
707
707
  end: i.resolveNoCache(i.content.size - n.openEnd - t)
@@ -1006,7 +1006,7 @@ class te {
1006
1006
  @internal
1007
1007
  */
1008
1008
  constructor(e, t, r, i = M.none) {
1009
- this.type = e, this.attrs = t, this.marks = i, this.content = r || b.empty;
1009
+ this.type = e, this.attrs = t, this.marks = i, this.content = r || k.empty;
1010
1010
  }
1011
1011
  /**
1012
1012
  The array of this node's child nodes.
@@ -1149,9 +1149,9 @@ class te {
1149
1149
  */
1150
1150
  slice(e, t = this.content.size, r = !1) {
1151
1151
  if (e == t)
1152
- return k.empty;
1152
+ return b.empty;
1153
1153
  let i = this.resolve(e), o = this.resolve(t), s = r ? 0 : i.sharedDepth(t), l = i.start(s), c = i.node(s).content.cut(i.pos - l, o.pos - l);
1154
- return new k(c, i.depth - s, o.depth - s);
1154
+ return new b(c, i.depth - s, o.depth - s);
1155
1155
  }
1156
1156
  /**
1157
1157
  Replace the part of the document between the given positions with
@@ -1295,7 +1295,7 @@ class te {
1295
1295
  can optionally pass `start` and `end` indices into the
1296
1296
  replacement fragment.
1297
1297
  */
1298
- canReplace(e, t, r = b.empty, i = 0, o = r.childCount) {
1298
+ canReplace(e, t, r = k.empty, i = 0, o = r.childCount) {
1299
1299
  let s = this.contentMatchAt(e).matchFragment(r, i, o), l = s && s.matchFragment(this.content, t);
1300
1300
  if (!l || !l.validEnd)
1301
1301
  return !1;
@@ -1366,7 +1366,7 @@ class te {
1366
1366
  throw new RangeError("Invalid text node in JSON");
1367
1367
  return e.text(t.text, r);
1368
1368
  }
1369
- let i = b.fromJSON(e, t.content), o = e.nodeType(t.type).create(t.attrs, i, r);
1369
+ let i = k.fromJSON(e, t.content), o = e.nodeType(t.type).create(t.attrs, i, r);
1370
1370
  return o.type.checkAttrs(o.attrs), o;
1371
1371
  }
1372
1372
  }
@@ -1494,7 +1494,7 @@ class ve {
1494
1494
  function o(s, l) {
1495
1495
  let a = s.matchFragment(e, r);
1496
1496
  if (a && (!t || a.validEnd))
1497
- return b.from(l.map((c) => c.createAndFill()));
1497
+ return k.from(l.map((c) => c.createAndFill()));
1498
1498
  for (let c = 0; c < s.next.length; c++) {
1499
1499
  let { type: f, next: u } = s.next[c];
1500
1500
  if (!(f.isText || f.hasRequiredAttrs()) && i.indexOf(u) == -1) {
@@ -1877,7 +1877,7 @@ let Vn = class Vr {
1877
1877
  create(e = null, t, r) {
1878
1878
  if (this.isText)
1879
1879
  throw new Error("NodeType.create can't construct text nodes");
1880
- return new te(this, this.computeAttrs(e), b.from(t), M.setFrom(r));
1880
+ return new te(this, this.computeAttrs(e), k.from(t), M.setFrom(r));
1881
1881
  }
1882
1882
  /**
1883
1883
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
@@ -1885,7 +1885,7 @@ let Vn = class Vr {
1885
1885
  if it doesn't match.
1886
1886
  */
1887
1887
  createChecked(e = null, t, r) {
1888
- return t = b.from(t), this.checkContent(t), new te(this, this.computeAttrs(e), t, M.setFrom(r));
1888
+ return t = k.from(t), this.checkContent(t), new te(this, this.computeAttrs(e), t, M.setFrom(r));
1889
1889
  }
1890
1890
  /**
1891
1891
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
@@ -1896,13 +1896,13 @@ let Vn = class Vr {
1896
1896
  `Fragment.empty` as content.
1897
1897
  */
1898
1898
  createAndFill(e = null, t, r) {
1899
- if (e = this.computeAttrs(e), t = b.from(t), t.size) {
1899
+ if (e = this.computeAttrs(e), t = k.from(t), t.size) {
1900
1900
  let s = this.contentMatch.fillBefore(t);
1901
1901
  if (!s)
1902
1902
  return null;
1903
1903
  t = s.append(t);
1904
1904
  }
1905
- let i = this.contentMatch.matchFragment(t), o = i && i.fillBefore(b.empty, !0);
1905
+ let i = this.contentMatch.matchFragment(t), o = i && i.fillBefore(k.empty, !0);
1906
1906
  return o ? new te(this, e, t.append(o), M.setFrom(r)) : null;
1907
1907
  }
1908
1908
  /**
@@ -2178,7 +2178,7 @@ class Se {
2178
2178
  */
2179
2179
  parseSlice(e, t = {}) {
2180
2180
  let r = new Wn(this, t, !0);
2181
- return r.addAll(e, M.none, t.from, t.to), k.maxOpen(r.finish());
2181
+ return r.addAll(e, M.none, t.from, t.to), b.maxOpen(r.finish());
2182
2182
  }
2183
2183
  /**
2184
2184
  @internal
@@ -2306,7 +2306,7 @@ class it {
2306
2306
  if (!this.match) {
2307
2307
  if (!this.type)
2308
2308
  return [];
2309
- let t = this.type.contentMatch.fillBefore(b.from(e));
2309
+ let t = this.type.contentMatch.fillBefore(k.from(e));
2310
2310
  if (t)
2311
2311
  this.match = this.type.contentMatch.matchFragment(t);
2312
2312
  else {
@@ -2324,8 +2324,8 @@ class it {
2324
2324
  r.text.length == i[0].length ? this.content.pop() : this.content[this.content.length - 1] = o.withText(o.text.slice(0, o.text.length - i[0].length));
2325
2325
  }
2326
2326
  }
2327
- let t = b.from(this.content);
2328
- return !e && this.match && (t = t.append(this.match.fillBefore(b.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
2327
+ let t = k.from(this.content);
2328
+ return !e && this.match && (t = t.append(this.match.fillBefore(k.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
2329
2329
  }
2330
2330
  inlineContext(e) {
2331
2331
  return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !_r.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
@@ -3155,7 +3155,7 @@ function rn(n, e, t) {
3155
3155
  let o = n.child(i);
3156
3156
  o.content.size && (o = o.copy(rn(o.content, e, o))), o.isInline && (o = e(o, t, i)), r.push(o);
3157
3157
  }
3158
- return b.fromArray(r);
3158
+ return k.fromArray(r);
3159
3159
  }
3160
3160
  class ue extends _ {
3161
3161
  /**
@@ -3165,7 +3165,7 @@ class ue extends _ {
3165
3165
  super(), this.from = e, this.to = t, this.mark = r;
3166
3166
  }
3167
3167
  apply(e) {
3168
- let t = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), o = new k(rn(t.content, (s, l) => !s.isAtom || !l.type.allowsMarkType(this.mark.type) ? s : s.mark(this.mark.addToSet(s.marks)), i), t.openStart, t.openEnd);
3168
+ let t = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), o = new b(rn(t.content, (s, l) => !s.isAtom || !l.type.allowsMarkType(this.mark.type) ? s : s.mark(this.mark.addToSet(s.marks)), i), t.openStart, t.openEnd);
3169
3169
  return I.fromReplace(e, this.from, this.to, o);
3170
3170
  }
3171
3171
  invert() {
@@ -3204,7 +3204,7 @@ class G extends _ {
3204
3204
  super(), this.from = e, this.to = t, this.mark = r;
3205
3205
  }
3206
3206
  apply(e) {
3207
- let t = e.slice(this.from, this.to), r = new k(rn(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
3207
+ let t = e.slice(this.from, this.to), r = new b(rn(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
3208
3208
  return I.fromReplace(e, this.from, this.to, r);
3209
3209
  }
3210
3210
  invert() {
@@ -3247,7 +3247,7 @@ class de extends _ {
3247
3247
  if (!t)
3248
3248
  return I.fail("No node at mark step's position");
3249
3249
  let r = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
3250
- return I.fromReplace(e, this.pos, this.pos + 1, new k(b.from(r), 0, t.isLeaf ? 0 : 1));
3250
+ return I.fromReplace(e, this.pos, this.pos + 1, new b(k.from(r), 0, t.isLeaf ? 0 : 1));
3251
3251
  }
3252
3252
  invert(e) {
3253
3253
  let t = e.nodeAt(this.pos);
@@ -3291,7 +3291,7 @@ class Te extends _ {
3291
3291
  if (!t)
3292
3292
  return I.fail("No node at mark step's position");
3293
3293
  let r = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
3294
- return I.fromReplace(e, this.pos, this.pos + 1, new k(b.from(r), 0, t.isLeaf ? 0 : 1));
3294
+ return I.fromReplace(e, this.pos, this.pos + 1, new b(k.from(r), 0, t.isLeaf ? 0 : 1));
3295
3295
  }
3296
3296
  invert(e) {
3297
3297
  let t = e.nodeAt(this.pos);
@@ -3344,10 +3344,10 @@ class P extends _ {
3344
3344
  if (!(e instanceof P) || e.structure || this.structure)
3345
3345
  return null;
3346
3346
  if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {
3347
- let t = this.slice.size + e.slice.size == 0 ? k.empty : new k(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
3347
+ let t = this.slice.size + e.slice.size == 0 ? b.empty : new b(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
3348
3348
  return new P(this.from, this.to + (e.to - e.from), t, this.structure);
3349
3349
  } else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {
3350
- let t = this.slice.size + e.slice.size == 0 ? k.empty : new k(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
3350
+ let t = this.slice.size + e.slice.size == 0 ? b.empty : new b(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
3351
3351
  return new P(e.from, this.to, t, this.structure);
3352
3352
  } else
3353
3353
  return null;
@@ -3362,7 +3362,7 @@ class P extends _ {
3362
3362
  static fromJSON(e, t) {
3363
3363
  if (typeof t.from != "number" || typeof t.to != "number")
3364
3364
  throw new RangeError("Invalid input for ReplaceStep.fromJSON");
3365
- return new P(t.from, t.to, k.fromJSON(e, t.slice), !!t.structure);
3365
+ return new P(t.from, t.to, b.fromJSON(e, t.slice), !!t.structure);
3366
3366
  }
3367
3367
  }
3368
3368
  _.jsonID("replace", P);
@@ -3420,7 +3420,7 @@ class $ extends _ {
3420
3420
  static fromJSON(e, t) {
3421
3421
  if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
3422
3422
  throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
3423
- return new $(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
3423
+ return new $(t.from, t.to, t.gapFrom, t.gapTo, b.fromJSON(e, t.slice), t.insert, !!t.structure);
3424
3424
  }
3425
3425
  }
3426
3426
  _.jsonID("replaceAround", $);
@@ -3438,7 +3438,7 @@ function Ht(n, e, t) {
3438
3438
  }
3439
3439
  return !1;
3440
3440
  }
3441
- function bs(n, e, t, r) {
3441
+ function ks(n, e, t, r) {
3442
3442
  let i = [], o = [], s, l;
3443
3443
  n.doc.nodesBetween(e, t, (a, c, f) => {
3444
3444
  if (!a.isInline)
@@ -3452,7 +3452,7 @@ function bs(n, e, t, r) {
3452
3452
  }
3453
3453
  }), i.forEach((a) => n.step(a)), o.forEach((a) => n.step(a));
3454
3454
  }
3455
- function ks(n, e, t, r) {
3455
+ function bs(n, e, t, r) {
3456
3456
  let i = [], o = 0;
3457
3457
  n.doc.nodesBetween(e, t, (s, l) => {
3458
3458
  if (!s.isInline)
@@ -3482,7 +3482,7 @@ function on(n, e, t, r = t.contentMatch, i = !0) {
3482
3482
  for (let a = 0; a < o.childCount; a++) {
3483
3483
  let c = o.child(a), f = l + c.nodeSize, u = r.matchType(c.type);
3484
3484
  if (!u)
3485
- s.push(new P(l, f, k.empty));
3485
+ s.push(new P(l, f, b.empty));
3486
3486
  else {
3487
3487
  r = u;
3488
3488
  for (let d = 0; d < c.marks.length; d++)
@@ -3490,14 +3490,14 @@ function on(n, e, t, r = t.contentMatch, i = !0) {
3490
3490
  if (i && c.isText && t.whitespace != "pre") {
3491
3491
  let d, h = /\r?\n|\r/g, p;
3492
3492
  for (; d = h.exec(c.text); )
3493
- p || (p = new k(b.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), s.push(new P(l + d.index, l + d.index + d[0].length, p));
3493
+ p || (p = new b(k.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), s.push(new P(l + d.index, l + d.index + d[0].length, p));
3494
3494
  }
3495
3495
  }
3496
3496
  l = f;
3497
3497
  }
3498
3498
  if (!r.validEnd) {
3499
- let a = r.fillBefore(b.empty, !0);
3500
- n.replace(l, l, new k(a, 0, 0));
3499
+ let a = r.fillBefore(k.empty, !0);
3500
+ n.replace(l, l, new b(a, 0, 0));
3501
3501
  }
3502
3502
  for (let a = s.length - 1; a >= 0; a--)
3503
3503
  n.step(s[a]);
@@ -3518,13 +3518,13 @@ function Fe(n) {
3518
3518
  return null;
3519
3519
  }
3520
3520
  function ws(n, e, t) {
3521
- let { $from: r, $to: i, depth: o } = e, s = r.before(o + 1), l = i.after(o + 1), a = s, c = l, f = b.empty, u = 0;
3521
+ let { $from: r, $to: i, depth: o } = e, s = r.before(o + 1), l = i.after(o + 1), a = s, c = l, f = k.empty, u = 0;
3522
3522
  for (let p = o, m = !1; p > t; p--)
3523
- m || r.index(p) > 0 ? (m = !0, f = b.from(r.node(p).copy(f)), u++) : a--;
3524
- let d = b.empty, h = 0;
3523
+ m || r.index(p) > 0 ? (m = !0, f = k.from(r.node(p).copy(f)), u++) : a--;
3524
+ let d = k.empty, h = 0;
3525
3525
  for (let p = o, m = !1; p > t; p--)
3526
- m || i.after(p + 1) < i.end(p) ? (m = !0, d = b.from(i.node(p).copy(d)), h++) : c++;
3527
- n.step(new $(a, c, s, l, new k(f.append(d), u, h), f.size - u, !0));
3526
+ m || i.after(p + 1) < i.end(p) ? (m = !0, d = k.from(i.node(p).copy(d)), h++) : c++;
3527
+ n.step(new $(a, c, s, l, new b(f.append(d), u, h), f.size - u, !0));
3528
3528
  }
3529
3529
  function Ur(n, e, t = null, r = n) {
3530
3530
  let i = Cs(n, e), o = i && vs(r, e);
@@ -3550,17 +3550,17 @@ function vs(n, e) {
3550
3550
  return !a || !a.validEnd ? null : s;
3551
3551
  }
3552
3552
  function Ts(n, e, t) {
3553
- let r = b.empty;
3553
+ let r = k.empty;
3554
3554
  for (let s = t.length - 1; s >= 0; s--) {
3555
3555
  if (r.size) {
3556
3556
  let l = t[s].type.contentMatch.matchFragment(r);
3557
3557
  if (!l || !l.validEnd)
3558
3558
  throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
3559
3559
  }
3560
- r = b.from(t[s].type.create(t[s].attrs, r));
3560
+ r = k.from(t[s].type.create(t[s].attrs, r));
3561
3561
  }
3562
3562
  let i = e.start, o = e.end;
3563
- n.step(new $(i, o, i, o, new k(r, 0, 0), t.length, !0));
3563
+ n.step(new $(i, o, i, o, new b(r, 0, 0), t.length, !0));
3564
3564
  }
3565
3565
  function Es(n, e, t, r, i) {
3566
3566
  if (!r.isTextblock)
@@ -3576,7 +3576,7 @@ function Es(n, e, t, r, i) {
3576
3576
  }
3577
3577
  c === !1 && Qr(n, s, l, o), on(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
3578
3578
  let f = n.mapping.slice(o), u = f.map(l, 1), d = f.map(l + s.nodeSize, 1);
3579
- return n.step(new $(u, d, u + 1, d - 1, new k(b.from(r.create(a, null, s.marks)), 0, 0), 1, !0)), c === !0 && Zr(n, s, l, o), !1;
3579
+ return n.step(new $(u, d, u + 1, d - 1, new b(k.from(r.create(a, null, s.marks)), 0, 0), 1, !0)), c === !0 && Zr(n, s, l, o), !1;
3580
3580
  }
3581
3581
  });
3582
3582
  }
@@ -3614,7 +3614,7 @@ function As(n, e, t, r, i) {
3614
3614
  return n.replaceWith(e, e + o.nodeSize, s);
3615
3615
  if (!t.validContent(o.content))
3616
3616
  throw new RangeError("Invalid content for node type " + t.name);
3617
- n.step(new $(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new k(b.from(s), 0, 0), 1, !0));
3617
+ n.step(new $(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new b(k.from(s), 0, 0), 1, !0));
3618
3618
  }
3619
3619
  function ie(n, e, t = 1, r) {
3620
3620
  let i = n.resolve(e), o = i.depth - t, s = r && r[r.length - 1] || i.parent;
@@ -3634,13 +3634,13 @@ function ie(n, e, t = 1, r) {
3634
3634
  return i.node(o).canReplaceWith(l, l, a ? a.type : i.node(o + 1).type);
3635
3635
  }
3636
3636
  function Os(n, e, t = 1, r) {
3637
- let i = n.doc.resolve(e), o = b.empty, s = b.empty;
3637
+ let i = n.doc.resolve(e), o = k.empty, s = k.empty;
3638
3638
  for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
3639
- o = b.from(i.node(l).copy(o));
3639
+ o = k.from(i.node(l).copy(o));
3640
3640
  let f = r && r[c];
3641
- s = b.from(f ? f.type.create(f.attrs, s) : i.node(l).copy(s));
3641
+ s = k.from(f ? f.type.create(f.attrs, s) : i.node(l).copy(s));
3642
3642
  }
3643
- n.step(new P(e, e, new k(o.append(s), t, t), !0));
3643
+ n.step(new P(e, e, new b(o.append(s), t, t), !0));
3644
3644
  }
3645
3645
  function Me(n, e) {
3646
3646
  let t = n.resolve(e), r = t.index();
@@ -3683,7 +3683,7 @@ function Is(n, e, t) {
3683
3683
  }
3684
3684
  s.inlineContent && on(n, e + t - 1, s, o.node().contentMatchAt(o.index()), r == null);
3685
3685
  let a = n.mapping.slice(l), c = a.map(e - t);
3686
- if (n.step(new P(c, a.map(e + t, -1), k.empty, !0)), r === !0) {
3686
+ if (n.step(new P(c, a.map(e + t, -1), b.empty, !0)), r === !0) {
3687
3687
  let f = n.doc.resolve(c);
3688
3688
  Zr(n, f.node(), f.before(), n.steps.length);
3689
3689
  }
@@ -3732,7 +3732,7 @@ function zs(n, e, t) {
3732
3732
  }
3733
3733
  return null;
3734
3734
  }
3735
- function Ot(n, e, t = e, r = k.empty) {
3735
+ function Ot(n, e, t = e, r = b.empty) {
3736
3736
  if (e == t && !r.size)
3737
3737
  return null;
3738
3738
  let i = n.resolve(e), o = n.resolve(t);
@@ -3743,7 +3743,7 @@ function Yr(n, e, t) {
3743
3743
  }
3744
3744
  class Ds {
3745
3745
  constructor(e, t, r) {
3746
- this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = b.empty;
3746
+ this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = k.empty;
3747
3747
  for (let i = 0; i <= e.depth; i++) {
3748
3748
  let o = e.node(i);
3749
3749
  this.frontier.push({
@@ -3752,7 +3752,7 @@ class Ds {
3752
3752
  });
3753
3753
  }
3754
3754
  for (let i = e.depth; i > 0; i--)
3755
- this.placed = b.from(e.node(i).copy(this.placed));
3755
+ this.placed = k.from(e.node(i).copy(this.placed));
3756
3756
  }
3757
3757
  get depth() {
3758
3758
  return this.frontier.length - 1;
@@ -3768,7 +3768,7 @@ class Ds {
3768
3768
  let o = this.placed, s = r.depth, l = i.depth;
3769
3769
  for (; s && l && o.childCount == 1; )
3770
3770
  o = o.firstChild.content, s--, l--;
3771
- let a = new k(o, s, l);
3771
+ let a = new b(o, s, l);
3772
3772
  return e > -1 ? new $(r.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || r.pos != this.$to.pos ? new P(r.pos, i.pos, a) : null;
3773
3773
  }
3774
3774
  // Find a position on the start spine of `this.unplaced` that has
@@ -3791,7 +3791,7 @@ class Ds {
3791
3791
  let s = i.firstChild;
3792
3792
  for (let l = this.depth; l >= 0; l--) {
3793
3793
  let { type: a, match: c } = this.frontier[l], f, u = null;
3794
- if (t == 1 && (s ? c.matchType(s.type) || (u = c.fillBefore(b.from(s), !1)) : o && a.compatibleContent(o.type)))
3794
+ if (t == 1 && (s ? c.matchType(s.type) || (u = c.fillBefore(k.from(s), !1)) : o && a.compatibleContent(o.type)))
3795
3795
  return { sliceDepth: r, frontierDepth: l, parent: o, inject: u };
3796
3796
  if (t == 2 && s && (f = c.findWrapping(s.type)))
3797
3797
  return { sliceDepth: r, frontierDepth: l, parent: o, wrap: f };
@@ -3802,15 +3802,15 @@ class Ds {
3802
3802
  }
3803
3803
  openMore() {
3804
3804
  let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Pt(e, t);
3805
- return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new k(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
3805
+ return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new b(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
3806
3806
  }
3807
3807
  dropNode() {
3808
3808
  let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Pt(e, t);
3809
3809
  if (i.childCount <= 1 && t > 0) {
3810
3810
  let o = e.size - t <= t + i.size;
3811
- this.unplaced = new k(Ve(e, t - 1, 1), t - 1, o ? t - 1 : r);
3811
+ this.unplaced = new b(Ve(e, t - 1, 1), t - 1, o ? t - 1 : r);
3812
3812
  } else
3813
- this.unplaced = new k(Ve(e, t, 1), t, r);
3813
+ this.unplaced = new b(Ve(e, t, 1), t, r);
3814
3814
  }
3815
3815
  // Move content from the unplaced slice at `sliceDepth` to the
3816
3816
  // frontier node at `frontierDepth`. Close that frontier node when
@@ -3835,12 +3835,12 @@ class Ds {
3835
3835
  c++, (c > 1 || a == 0 || m.content.size) && (u = g, f.push(Xr(m.mark(d.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
3836
3836
  }
3837
3837
  let p = c == l.childCount;
3838
- p || (h = -1), this.placed = _e(this.placed, t, b.from(f)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3838
+ p || (h = -1), this.placed = _e(this.placed, t, k.from(f)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3839
3839
  for (let m = 0, g = l; m < h; m++) {
3840
3840
  let y = g.lastChild;
3841
3841
  this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
3842
3842
  }
3843
- this.unplaced = p ? e == 0 ? k.empty : new k(Ve(s.content, e - 1, 1), e - 1, h < 0 ? s.openEnd : e - 1) : new k(Ve(s.content, e, c), s.openStart, s.openEnd);
3843
+ this.unplaced = p ? e == 0 ? b.empty : new b(Ve(s.content, e - 1, 1), e - 1, h < 0 ? s.openEnd : e - 1) : new b(Ve(s.content, e, c), s.openStart, s.openEnd);
3844
3844
  }
3845
3845
  mustMoveInline() {
3846
3846
  if (!this.$to.parent.isTextblock)
@@ -3881,10 +3881,10 @@ class Ds {
3881
3881
  }
3882
3882
  openFrontierNode(e, t = null, r) {
3883
3883
  let i = this.frontier[this.depth];
3884
- i.match = i.match.matchType(e), this.placed = _e(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3884
+ i.match = i.match.matchType(e), this.placed = _e(this.placed, this.depth, k.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3885
3885
  }
3886
3886
  closeFrontierNode() {
3887
- let t = this.frontier.pop().match.fillBefore(b.empty, !0);
3887
+ let t = this.frontier.pop().match.fillBefore(k.empty, !0);
3888
3888
  t.childCount && (this.placed = _e(this.placed, this.frontier.length, t));
3889
3889
  }
3890
3890
  }
@@ -3903,7 +3903,7 @@ function Xr(n, e, t) {
3903
3903
  if (e <= 0)
3904
3904
  return n;
3905
3905
  let r = n.content;
3906
- return e > 1 && (r = r.replaceChild(0, Xr(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
3906
+ return e > 1 && (r = r.replaceChild(0, Xr(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(k.empty, !0)))), n.copy(r);
3907
3907
  }
3908
3908
  function $t(n, e, t, r, i) {
3909
3909
  let o = n.node(e), s = i ? n.indexAfter(e) : n.index(e);
@@ -3959,7 +3959,7 @@ function $s(n, e, t, r) {
3959
3959
  g < 0 && (y = !1, g = -g);
3960
3960
  let S = i.node(g - 1), C = i.index(g - 1);
3961
3961
  if (S.canReplaceWith(C, C, p.type, p.marks))
3962
- return n.replace(i.before(g), y ? o.after(g) : t, new k(ei(r.content, 0, r.openStart, h), h, r.openEnd));
3962
+ return n.replace(i.before(g), y ? o.after(g) : t, new b(ei(r.content, 0, r.openStart, h), h, r.openEnd));
3963
3963
  }
3964
3964
  }
3965
3965
  let u = n.steps.length;
@@ -3975,7 +3975,7 @@ function ei(n, e, t, r, i) {
3975
3975
  }
3976
3976
  if (e > r) {
3977
3977
  let o = i.contentMatchAt(0), s = o.fillBefore(n).append(n);
3978
- n = s.append(o.matchFragment(s).fillBefore(b.empty, !0));
3978
+ n = s.append(o.matchFragment(s).fillBefore(k.empty, !0));
3979
3979
  }
3980
3980
  return n;
3981
3981
  }
@@ -3984,7 +3984,7 @@ function Fs(n, e, t, r) {
3984
3984
  let i = Rs(n.doc, e, r.type);
3985
3985
  i != null && (e = t = i);
3986
3986
  }
3987
- n.replaceRange(e, t, new k(b.from(r), 0, 0));
3987
+ n.replaceRange(e, t, new b(k.from(r), 0, 0));
3988
3988
  }
3989
3989
  function Ls(n, e, t) {
3990
3990
  let r = n.doc.resolve(e), i = n.doc.resolve(t), o = ti(r, i);
@@ -4026,7 +4026,7 @@ class De extends _ {
4026
4026
  r[o] = t.attrs[o];
4027
4027
  r[this.attr] = this.value;
4028
4028
  let i = t.type.create(r, null, t.marks);
4029
- return I.fromReplace(e, this.pos, this.pos + 1, new k(b.from(i), 0, t.isLeaf ? 0 : 1));
4029
+ return I.fromReplace(e, this.pos, this.pos + 1, new b(k.from(i), 0, t.isLeaf ? 0 : 1));
4030
4030
  }
4031
4031
  getMap() {
4032
4032
  return q.empty;
@@ -4155,7 +4155,7 @@ class Vs {
4155
4155
  Replace the part of the document between `from` and `to` with the
4156
4156
  given `slice`.
4157
4157
  */
4158
- replace(e, t = e, r = k.empty) {
4158
+ replace(e, t = e, r = b.empty) {
4159
4159
  let i = Ot(this.doc, e, t, r);
4160
4160
  return i && this.step(i), this;
4161
4161
  }
@@ -4164,13 +4164,13 @@ class Vs {
4164
4164
  fragment, node, or array of nodes.
4165
4165
  */
4166
4166
  replaceWith(e, t, r) {
4167
- return this.replace(e, t, new k(b.from(r), 0, 0));
4167
+ return this.replace(e, t, new b(k.from(r), 0, 0));
4168
4168
  }
4169
4169
  /**
4170
4170
  Delete the content between the given positions.
4171
4171
  */
4172
4172
  delete(e, t) {
4173
- return this.replace(e, t, k.empty);
4173
+ return this.replace(e, t, b.empty);
4174
4174
  }
4175
4175
  /**
4176
4176
  Insert the given content at the given position.
@@ -4311,7 +4311,7 @@ class Vs {
4311
4311
  Add the given mark to the inline content between `from` and `to`.
4312
4312
  */
4313
4313
  addMark(e, t, r) {
4314
- return bs(this, e, t, r), this;
4314
+ return ks(this, e, t, r), this;
4315
4315
  }
4316
4316
  /**
4317
4317
  Remove marks from inline nodes between `from` and `to`. When
@@ -4320,7 +4320,7 @@ class Vs {
4320
4320
  remove all marks of any type.
4321
4321
  */
4322
4322
  removeMark(e, t, r) {
4323
- return ks(this, e, t, r), this;
4323
+ return bs(this, e, t, r), this;
4324
4324
  }
4325
4325
  /**
4326
4326
  Removes all marks and nodes from the content of the node at
@@ -4398,14 +4398,14 @@ class T {
4398
4398
  Replace the selection with a slice or, if no slice is given,
4399
4399
  delete the selection. Will append to the given transaction.
4400
4400
  */
4401
- replace(e, t = k.empty) {
4401
+ replace(e, t = b.empty) {
4402
4402
  let r = t.content.lastChild, i = null;
4403
4403
  for (let l = 0; l < t.openEnd; l++)
4404
4404
  i = r, r = r.lastChild;
4405
4405
  let o = e.steps.length, s = this.ranges;
4406
4406
  for (let l = 0; l < s.length; l++) {
4407
4407
  let { $from: a, $to: c } = s[l], f = e.mapping.slice(o);
4408
- e.replaceRange(f.map(a.pos), f.map(c.pos), l ? k.empty : t), l == 0 && Yn(e, o, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
4408
+ e.replaceRange(f.map(a.pos), f.map(c.pos), l ? b.empty : t), l == 0 && Yn(e, o, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
4409
4409
  }
4410
4410
  }
4411
4411
  /**
@@ -4531,8 +4531,8 @@ class v extends T {
4531
4531
  let i = e.resolve(t.map(this.anchor));
4532
4532
  return new v(i.parent.inlineContent ? i : r, r);
4533
4533
  }
4534
- replace(e, t = k.empty) {
4535
- if (super.replace(e, t), t == k.empty) {
4534
+ replace(e, t = b.empty) {
4535
+ if (super.replace(e, t), t == b.empty) {
4536
4536
  let r = this.$from.marksAcross(this.$to);
4537
4537
  r && e.ensureMarks(r);
4538
4538
  }
@@ -4607,7 +4607,7 @@ class w extends T {
4607
4607
  return r ? T.near(o) : new w(o);
4608
4608
  }
4609
4609
  content() {
4610
- return new k(b.from(this.node), 0, 0);
4610
+ return new b(k.from(this.node), 0, 0);
4611
4611
  }
4612
4612
  eq(e) {
4613
4613
  return e instanceof w && e.anchor == this.anchor;
@@ -4662,8 +4662,8 @@ class K extends T {
4662
4662
  constructor(e) {
4663
4663
  super(e.resolve(0), e.resolve(e.content.size));
4664
4664
  }
4665
- replace(e, t = k.empty) {
4666
- if (t == k.empty) {
4665
+ replace(e, t = b.empty) {
4666
+ if (t == b.empty) {
4667
4667
  e.delete(0, e.doc.content.size);
4668
4668
  let r = T.atStart(e.doc);
4669
4669
  r.eq(e.selection) || e.setSelection(r);
@@ -4829,7 +4829,7 @@ const oi = (n, e, t) => {
4829
4829
  return !0;
4830
4830
  if (r.parent.content.size == 0 && ($e(o, "end") || w.isSelectable(o)))
4831
4831
  for (let s = r.depth; ; s--) {
4832
- let l = Ot(n.doc, r.before(s), r.after(s), k.empty);
4832
+ let l = Ot(n.doc, r.before(s), r.after(s), b.empty);
4833
4833
  if (l && l.slice.size < l.to - l.from) {
4834
4834
  if (e) {
4835
4835
  let a = n.tr.step(l);
@@ -4873,7 +4873,7 @@ function si(n, e, t) {
4873
4873
  return !1;
4874
4874
  l = f;
4875
4875
  }
4876
- let c = Ot(n.doc, o, a, k.empty);
4876
+ let c = Ot(n.doc, o, a, b.empty);
4877
4877
  if (!c || c.from != o || c instanceof P && c.slice.size >= a - o)
4878
4878
  return !1;
4879
4879
  if (t) {
@@ -4928,7 +4928,7 @@ const ci = (n, e, t) => {
4928
4928
  if (pi(n, i, e, 1))
4929
4929
  return !0;
4930
4930
  if (r.parent.content.size == 0 && ($e(o, "start") || w.isSelectable(o))) {
4931
- let s = Ot(n.doc, r.before(), r.after(), k.empty);
4931
+ let s = Ot(n.doc, r.before(), r.after(), b.empty);
4932
4932
  if (s && s.slice.size < s.to - s.from) {
4933
4933
  if (e) {
4934
4934
  let l = n.tr.step(s);
@@ -5079,11 +5079,11 @@ function pi(n, e, t, r) {
5079
5079
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
5080
5080
  if (c && (s = (l = i.contentMatchAt(i.childCount)).findWrapping(o.type)) && l.matchType(s[0] || o.type).validEnd) {
5081
5081
  if (t) {
5082
- let h = e.pos + o.nodeSize, p = b.empty;
5082
+ let h = e.pos + o.nodeSize, p = k.empty;
5083
5083
  for (let y = s.length - 1; y >= 0; y--)
5084
- p = b.from(s[y].create(null, p));
5085
- p = b.from(i.copy(p));
5086
- let m = n.tr.step(new $(e.pos - 1, h, e.pos, h, new k(p, 1, 0), s.length, !0)), g = m.doc.resolve(h + 2 * s.length);
5084
+ p = k.from(s[y].create(null, p));
5085
+ p = k.from(i.copy(p));
5086
+ let m = n.tr.step(new $(e.pos - 1, h, e.pos, h, new b(p, 1, 0), s.length, !0)), g = m.doc.resolve(h + 2 * s.length);
5087
5087
  g.nodeAfter && g.nodeAfter.type == i.type && Me(m.doc, g.pos) && m.join(g.pos), t(m.scrollIntoView());
5088
5088
  }
5089
5089
  return !0;
@@ -5100,10 +5100,10 @@ function pi(n, e, t, r) {
5100
5100
  g++;
5101
5101
  if (h.canReplace(h.childCount, h.childCount, m.content)) {
5102
5102
  if (t) {
5103
- let y = b.empty;
5103
+ let y = k.empty;
5104
5104
  for (let C = p.length - 1; C >= 0; C--)
5105
- y = b.from(p[C].copy(y));
5106
- let S = n.tr.step(new $(e.pos - p.length, e.pos + o.nodeSize, e.pos + g, e.pos + o.nodeSize - g, new k(y, p.length, 0), 0, !0));
5105
+ y = k.from(p[C].copy(y));
5106
+ let S = n.tr.step(new $(e.pos - p.length, e.pos + o.nodeSize, e.pos + g, e.pos + o.nodeSize - g, new b(y, p.length, 0), 0, !0));
5107
5107
  t(S.scrollIntoView());
5108
5108
  }
5109
5109
  return !0;
@@ -5192,10 +5192,10 @@ function rl(n, e, t, r = null) {
5192
5192
  return l ? (n && il(n, e, l, i, t), !0) : !1;
5193
5193
  }
5194
5194
  function il(n, e, t, r, i) {
5195
- let o = b.empty;
5195
+ let o = k.empty;
5196
5196
  for (let f = t.length - 1; f >= 0; f--)
5197
- o = b.from(t[f].type.create(t[f].attrs, o));
5198
- n.step(new $(e.start - (r ? 2 : 0), e.end, e.start, e.end, new k(o, 0, 0), t.length, !0));
5197
+ o = k.from(t[f].type.create(t[f].attrs, o));
5198
+ n.step(new $(e.start - (r ? 2 : 0), e.end, e.start, e.end, new b(o, 0, 0), t.length, !0));
5199
5199
  let s = 0;
5200
5200
  for (let f = 0; f < t.length; f++)
5201
5201
  t[f].type == i && (s = f + 1);
@@ -5212,7 +5212,7 @@ function ol(n) {
5212
5212
  }
5213
5213
  function sl(n, e, t, r) {
5214
5214
  let i = n.tr, o = r.end, s = r.$to.end(r.depth);
5215
- o < s && (i.step(new $(o - 1, s, o, s, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new mt(i.doc.resolve(r.$from.pos), i.doc.resolve(s), r.depth));
5215
+ o < s && (i.step(new $(o - 1, s, o, s, new b(k.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new mt(i.doc.resolve(r.$from.pos), i.doc.resolve(s), r.depth));
5216
5216
  const l = Fe(r);
5217
5217
  if (l == null)
5218
5218
  return !1;
@@ -5228,10 +5228,10 @@ function ll(n, e, t) {
5228
5228
  if (r.mapping.map(t.end) != t.start + o.nodeAfter.nodeSize)
5229
5229
  return !1;
5230
5230
  let l = t.startIndex == 0, a = t.endIndex == i.childCount, c = o.node(-1), f = o.index(-1);
5231
- if (!c.canReplace(f + (l ? 0 : 1), f + 1, s.content.append(a ? b.empty : b.from(i))))
5231
+ if (!c.canReplace(f + (l ? 0 : 1), f + 1, s.content.append(a ? k.empty : k.from(i))))
5232
5232
  return !1;
5233
5233
  let u = o.pos, d = u + s.nodeSize;
5234
- return r.step(new $(u - (l ? 1 : 0), d + (a ? 1 : 0), u + 1, d - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
5234
+ return r.step(new $(u - (l ? 1 : 0), d + (a ? 1 : 0), u + 1, d - 1, new b((l ? k.empty : k.from(i.copy(k.empty))).append(a ? k.empty : k.from(i.copy(k.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
5235
5235
  }
5236
5236
  function al(n) {
5237
5237
  return function(e, t) {
@@ -5245,7 +5245,7 @@ function al(n) {
5245
5245
  if (a.type != n)
5246
5246
  return !1;
5247
5247
  if (t) {
5248
- let c = a.lastChild && a.lastChild.type == l.type, f = b.from(c ? n.create() : null), u = new k(b.from(n.create(null, b.from(l.type.create(null, f)))), c ? 3 : 1, 0), d = o.start, h = o.end;
5248
+ let c = a.lastChild && a.lastChild.type == l.type, f = k.from(c ? n.create() : null), u = new b(k.from(n.create(null, k.from(l.type.create(null, f)))), c ? 3 : 1, 0), d = o.start, h = o.end;
5249
5249
  t(e.tr.step(new $(d - (c ? 3 : 1), h, d, h, u, 1, !0)).scrollIntoView());
5250
5250
  }
5251
5251
  return !0;
@@ -5306,7 +5306,7 @@ function xi(n, e) {
5306
5306
  let t = document.createEvent("Event");
5307
5307
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5308
5308
  }
5309
- const ne = typeof navigator < "u" ? navigator : null, nr = typeof document < "u" ? document : null, me = ne && ne.userAgent || "", Ut = /Edge\/(\d+)/.exec(me), bi = /MSIE \d/.exec(me), Zt = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(me), Xe = !!(bi || Zt || Ut), ki = bi ? document.documentMode : Zt ? +Zt[1] : Ut ? +Ut[1] : 0, It = !Xe && /gecko\/(\d+)/i.test(me);
5309
+ const ne = typeof navigator < "u" ? navigator : null, nr = typeof document < "u" ? document : null, me = ne && ne.userAgent || "", Ut = /Edge\/(\d+)/.exec(me), ki = /MSIE \d/.exec(me), Zt = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(me), Xe = !!(ki || Zt || Ut), bi = ki ? document.documentMode : Zt ? +Zt[1] : Ut ? +Ut[1] : 0, It = !Xe && /gecko\/(\d+)/i.test(me);
5310
5310
  It && +(/Firefox\/(\d+)/.exec(me) || [0, 0])[1];
5311
5311
  const Qt = !Xe && /Chrome\/(\d+)/.exec(me), le = !!Qt, Si = Qt ? +Qt[1] : 0, Oe = !Xe && !!ne && /Apple Computer/.test(ne.vendor), hn = Oe && (/Mobile\/\w+/.test(me) || !!ne && ne.maxTouchPoints > 2), Z = hn || (ne ? /Mac/.test(ne.platform) : !1), wi = ne ? /Win/.test(ne.platform) : !1, et = /Android \d/.test(me), pn = !!nr && "webkitFontSmoothing" in nr.documentElement.style, ul = pn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5312
5312
  function dl(n, e = null) {
@@ -5402,7 +5402,7 @@ function pl(n) {
5402
5402
  if (!e)
5403
5403
  return;
5404
5404
  let t = n.cursorWrapper.dom, r = t.nodeName == "IMG";
5405
- r ? e.collapse(t.parentNode, Ae(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible && Xe && ki <= 11 && (t.disabled = !0, t.disabled = !1);
5405
+ r ? e.collapse(t.parentNode, Ae(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible && Xe && bi <= 11 && (t.disabled = !0, t.disabled = !1);
5406
5406
  }
5407
5407
  function ml(n, e) {
5408
5408
  if (e instanceof w) {
@@ -5464,7 +5464,7 @@ function lr(n, e, t) {
5464
5464
  }
5465
5465
  }
5466
5466
  }
5467
- function bt(n) {
5467
+ function kt(n) {
5468
5468
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5469
5469
  }
5470
5470
  function je(n, e) {
@@ -5479,7 +5479,7 @@ function yl(n) {
5479
5479
  if (!t)
5480
5480
  return;
5481
5481
  let i, o, s = !1;
5482
- for (It && t.nodeType == 1 && r < bt(t) && je(t.childNodes[r], -1) && (s = !0); ; )
5482
+ for (It && t.nodeType == 1 && r < kt(t) && je(t.childNodes[r], -1) && (s = !0); ; )
5483
5483
  if (r > 0) {
5484
5484
  if (t.nodeType != 1)
5485
5485
  break;
@@ -5500,7 +5500,7 @@ function yl(n) {
5500
5500
  for (; l && je(l, -1); )
5501
5501
  i = t.parentNode, o = Ae(l), l = l.previousSibling;
5502
5502
  if (l)
5503
- t = l, r = bt(t);
5503
+ t = l, r = kt(t);
5504
5504
  else {
5505
5505
  if (t = t.parentNode, t == n.dom)
5506
5506
  break;
@@ -5514,7 +5514,7 @@ function xl(n) {
5514
5514
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
5515
5515
  if (!t)
5516
5516
  return;
5517
- let i = bt(t), o, s;
5517
+ let i = kt(t), o, s;
5518
5518
  for (; ; )
5519
5519
  if (r < i) {
5520
5520
  if (t.nodeType != 1)
@@ -5532,7 +5532,7 @@ function xl(n) {
5532
5532
  for (; l && je(l, 1); )
5533
5533
  o = l.parentNode, s = Ae(l) + 1, l = l.nextSibling;
5534
5534
  if (l)
5535
- t = l, r = 0, i = bt(t);
5535
+ t = l, r = 0, i = kt(t);
5536
5536
  else {
5537
5537
  if (t = t.parentNode, t == n.dom)
5538
5538
  break;
@@ -5546,7 +5546,7 @@ function Ti(n) {
5546
5546
  let e = n.pmViewDesc;
5547
5547
  return e && e.node && e.node.isBlock;
5548
5548
  }
5549
- function bl(n, e) {
5549
+ function kl(n, e) {
5550
5550
  for (; n && e == n.childNodes.length && !dn(n); )
5551
5551
  e = Ae(n) + 1, n = n.parentNode;
5552
5552
  for (; n && e < n.childNodes.length; ) {
@@ -5558,7 +5558,7 @@ function bl(n, e) {
5558
5558
  n = t, e = 0;
5559
5559
  }
5560
5560
  }
5561
- function kl(n, e) {
5561
+ function bl(n, e) {
5562
5562
  for (; n && !e && !dn(n); )
5563
5563
  e = Ae(n), n = n.parentNode;
5564
5564
  for (; n && e; ) {
@@ -5573,7 +5573,7 @@ function kl(n, e) {
5573
5573
  function Yt(n, e, t) {
5574
5574
  if (e.nodeType != 3) {
5575
5575
  let o, s;
5576
- (s = bl(e, t)) ? (e = s, t = 0) : (o = kl(e, t)) && (e = o, t = o.nodeValue.length);
5576
+ (s = kl(e, t)) ? (e = s, t = 0) : (o = bl(e, t)) && (e = o, t = o.nodeValue.length);
5577
5577
  }
5578
5578
  let r = n.domSelection();
5579
5579
  if (!r)
@@ -5716,7 +5716,7 @@ function Mi(n, e, t, r, i) {
5716
5716
  if (n.someProp("transformPastedText", (d) => {
5717
5717
  e = d(e, o || r, n);
5718
5718
  }), o)
5719
- return l = new k(b.from(n.state.schema.text(e.replace(/\r\n?/g, `
5719
+ return l = new b(k.from(n.state.schema.text(e.replace(/\r\n?/g, `
5720
5720
  `))), 0, 0), n.someProp("transformPasted", (d) => {
5721
5721
  l = d(l, n, !0);
5722
5722
  }), l;
@@ -5752,7 +5752,7 @@ function Mi(n, e, t, r, i) {
5752
5752
  }
5753
5753
  })), f)
5754
5754
  l = Ol(dr(l, +f[1], +f[2]), f[4]);
5755
- else if (l = k.maxOpen(Tl(l.content, i), !0), l.openStart || l.openEnd) {
5755
+ else if (l = b.maxOpen(Tl(l.content, i), !0), l.openStart || l.openEnd) {
5756
5756
  let u = 0, d = 0;
5757
5757
  for (let h = l.content.firstChild; u < l.openStart && !h.type.spec.isolating; u++, h = h.firstChild)
5758
5758
  ;
@@ -5784,13 +5784,13 @@ function Tl(n, e) {
5784
5784
  s.push(f), i = i.matchType(f.type), o = a;
5785
5785
  }
5786
5786
  }), s)
5787
- return b.from(s);
5787
+ return k.from(s);
5788
5788
  }
5789
5789
  return n;
5790
5790
  }
5791
5791
  function Ai(n, e, t = 0) {
5792
5792
  for (let r = e.length - 1; r >= t; r--)
5793
- n = e[r].create(null, b.from(n));
5793
+ n = e[r].create(null, k.from(n));
5794
5794
  return n;
5795
5795
  }
5796
5796
  function Oi(n, e, t, r, i) {
@@ -5799,21 +5799,21 @@ function Oi(n, e, t, r, i) {
5799
5799
  if (o)
5800
5800
  return r.copy(r.content.replaceChild(r.childCount - 1, o));
5801
5801
  if (r.contentMatchAt(r.childCount).matchType(i == n.length - 1 ? t.type : n[i + 1]))
5802
- return r.copy(r.content.append(b.from(Ai(t, n, i + 1))));
5802
+ return r.copy(r.content.append(k.from(Ai(t, n, i + 1))));
5803
5803
  }
5804
5804
  }
5805
5805
  function Ni(n, e) {
5806
5806
  if (e == 0)
5807
5807
  return n;
5808
- let t = n.content.replaceChild(n.childCount - 1, Ni(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
5808
+ let t = n.content.replaceChild(n.childCount - 1, Ni(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(k.empty, !0);
5809
5809
  return n.copy(t.append(r));
5810
5810
  }
5811
5811
  function Xt(n, e, t, r, i, o) {
5812
5812
  let s = e < 0 ? n.firstChild : n.lastChild, l = s.content;
5813
- return n.childCount > 1 && (o = 0), i < r - 1 && (l = Xt(l, e, t, r, i + 1, o)), i >= t && (l = e < 0 ? s.contentMatchAt(0).fillBefore(l, o <= i).append(l) : l.append(s.contentMatchAt(s.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, s.copy(l));
5813
+ return n.childCount > 1 && (o = 0), i < r - 1 && (l = Xt(l, e, t, r, i + 1, o)), i >= t && (l = e < 0 ? s.contentMatchAt(0).fillBefore(l, o <= i).append(l) : l.append(s.contentMatchAt(s.childCount).fillBefore(k.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, s.copy(l));
5814
5814
  }
5815
5815
  function dr(n, e, t) {
5816
- return e < n.openStart && (n = new k(Xt(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Xt(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
5816
+ return e < n.openStart && (n = new b(Xt(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new b(Xt(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
5817
5817
  }
5818
5818
  const Ii = {
5819
5819
  thead: ["table"],
@@ -5865,9 +5865,9 @@ function Ol(n, e) {
5865
5865
  let a = t.nodes[r[l]];
5866
5866
  if (!a || a.hasRequiredAttrs())
5867
5867
  break;
5868
- i = b.from(a.create(r[l + 1], i)), o++, s++;
5868
+ i = k.from(a.create(r[l + 1], i)), o++, s++;
5869
5869
  }
5870
- return new k(i, o, s);
5870
+ return new b(i, o, s);
5871
5871
  }
5872
5872
  const Y = {}, H = {};
5873
5873
  function he(n, e) {
@@ -5971,7 +5971,7 @@ function Pl(n, e, t) {
5971
5971
  }
5972
5972
  }
5973
5973
  function yn(n) {
5974
- return kt(n);
5974
+ return bt(n);
5975
5975
  }
5976
5976
  const zi = Z ? "metaKey" : "ctrlKey";
5977
5977
  Y.mousedown = (n, e) => {
@@ -6044,8 +6044,8 @@ H.compositionstart = H.compositionupdate = (n) => {
6044
6044
  n.domObserver.flush();
6045
6045
  let { state: e } = n, t = e.selection.$to;
6046
6046
  if (e.selection instanceof v && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || le && wi && Ll(n)))
6047
- n.markCursor = n.state.storedMarks || t.marks(), kt(n, !0), n.markCursor = null;
6048
- else if (kt(n, !e.selection.empty), It && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
6047
+ n.markCursor = n.state.storedMarks || t.marks(), bt(n, !0), n.markCursor = null;
6048
+ else if (bt(n, !e.selection.empty), It && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
6049
6049
  let r = n.domSelectionRange();
6050
6050
  for (let i = r.focusNode, o = r.focusOffset; i && i.nodeType == 1 && o != 0; ) {
6051
6051
  let s = o < 0 ? i.lastChild : i.childNodes[o - 1];
@@ -6074,7 +6074,7 @@ H.compositionend = (n, e) => {
6074
6074
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Bi(n, 20));
6075
6075
  };
6076
6076
  function Bi(n, e) {
6077
- clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => kt(n), e));
6077
+ clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => bt(n), e));
6078
6078
  }
6079
6079
  function Vl(n) {
6080
6080
  for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = _l()); n.input.compositionNodes.length > 0; )
@@ -6084,7 +6084,7 @@ function _l() {
6084
6084
  let n = document.createEvent("Event");
6085
6085
  return n.initEvent("event", !0, !0), n.timeStamp;
6086
6086
  }
6087
- function kt(n, e = !1) {
6087
+ function bt(n, e = !1) {
6088
6088
  if (!(et && n.domObserver.flushingSoon >= 0)) {
6089
6089
  if (n.domObserver.forceFlush(), Vl(n), e || n.docView && n.docView.dirty) {
6090
6090
  let t = dl(n), r = n.state.selection;
@@ -6103,7 +6103,7 @@ function Jl(n, e) {
6103
6103
  t.parentNode && t.parentNode.removeChild(t), n.focus();
6104
6104
  }, 50);
6105
6105
  }
6106
- const Ze = Xe && ki < 15 || hn && ul < 604;
6106
+ const Ze = Xe && bi < 15 || hn && ul < 604;
6107
6107
  Y.copy = H.cut = (n, e) => {
6108
6108
  let t = e, r = n.state.selection, i = t.type == "cut";
6109
6109
  if (r.empty)
@@ -6126,7 +6126,7 @@ function jl(n, e) {
6126
6126
  }
6127
6127
  function en(n, e, t, r, i) {
6128
6128
  let o = Mi(n, e, t, r, n.state.selection.$from);
6129
- if (n.someProp("handlePaste", (a) => a(n, i, o || k.empty)))
6129
+ if (n.someProp("handlePaste", (a) => a(n, i, o || b.empty)))
6130
6130
  return !0;
6131
6131
  if (!o)
6132
6132
  return !1;
@@ -6198,7 +6198,7 @@ function Hl(n, e, t) {
6198
6198
  o = h(o, n, !1);
6199
6199
  }) : o = Mi(n, Pi(e.dataTransfer), Ze ? null : e.dataTransfer.getData("text/html"), !1, i);
6200
6200
  let s = !!(t && $i(n, e));
6201
- if (n.someProp("handleDrop", (h) => h(n, e, o || k.empty, s))) {
6201
+ if (n.someProp("handleDrop", (h) => h(n, e, o || b.empty, s))) {
6202
6202
  e.preventDefault();
6203
6203
  return;
6204
6204
  }
@@ -6541,7 +6541,7 @@ class D {
6541
6541
  @internal
6542
6542
  */
6543
6543
  locals(e) {
6544
- return bn(this.localsInner(e));
6544
+ return kn(this.localsInner(e));
6545
6545
  }
6546
6546
  /**
6547
6547
  @internal
@@ -6561,7 +6561,7 @@ class D {
6561
6561
  }
6562
6562
  }
6563
6563
  D.empty = new D([], []);
6564
- D.removeOverlap = bn;
6564
+ D.removeOverlap = kn;
6565
6565
  const W = D.empty;
6566
6566
  class ye {
6567
6567
  constructor(e) {
@@ -6602,7 +6602,7 @@ class ye {
6602
6602
  t.push(o[s]);
6603
6603
  }
6604
6604
  }
6605
- return t ? bn(r ? t : t.sort(Ce)) : ze;
6605
+ return t ? kn(r ? t : t.sort(Ce)) : ze;
6606
6606
  }
6607
6607
  // Create a group for the given array of decoration sets, or return
6608
6608
  // a single set when possible.
@@ -6725,7 +6725,7 @@ function wt(n, e, t, r) {
6725
6725
  function Ce(n, e) {
6726
6726
  return n.from - e.from || n.to - e.to;
6727
6727
  }
6728
- function bn(n) {
6728
+ function kn(n) {
6729
6729
  let e = n;
6730
6730
  for (let t = 0; t < e.length - 1; t++) {
6731
6731
  let r = e[t];
@@ -6748,7 +6748,7 @@ function pr(n, e, t) {
6748
6748
  e++;
6749
6749
  n.splice(e, 0, t);
6750
6750
  }
6751
- var Ql = Object.defineProperty, kn = (n, e) => {
6751
+ var Ql = Object.defineProperty, bn = (n, e) => {
6752
6752
  for (var t in e)
6753
6753
  Ql(n, t, { get: e[t], enumerable: !0 });
6754
6754
  };
@@ -6845,7 +6845,7 @@ var Gl = class {
6845
6845
  return s;
6846
6846
  }
6847
6847
  }, Ji = {};
6848
- kn(Ji, {
6848
+ bn(Ji, {
6849
6849
  blur: () => Yl,
6850
6850
  clearContent: () => Xl,
6851
6851
  clearNodes: () => ea,
@@ -6863,7 +6863,7 @@ kn(Ji, {
6863
6863
  focus: () => ma,
6864
6864
  forEach: () => ga,
6865
6865
  insertContent: () => ya,
6866
- insertContentAt: () => ka,
6866
+ insertContentAt: () => ba,
6867
6867
  joinBackward: () => Ca,
6868
6868
  joinDown: () => wa,
6869
6869
  joinForward: () => va,
@@ -6902,8 +6902,8 @@ kn(Ji, {
6902
6902
  undoInputRule: () => gc,
6903
6903
  unsetAllMarks: () => yc,
6904
6904
  unsetMark: () => xc,
6905
- unsetTextDirection: () => bc,
6906
- updateAttributes: () => kc,
6905
+ unsetTextDirection: () => kc,
6906
+ updateAttributes: () => bc,
6907
6907
  wrapIn: () => Sc,
6908
6908
  wrapInList: () => wc
6909
6909
  });
@@ -7091,7 +7091,7 @@ function st(n) {
7091
7091
  return Ki(t);
7092
7092
  }
7093
7093
  function Ge(n, e, t) {
7094
- if (n instanceof te || n instanceof b)
7094
+ if (n instanceof te || n instanceof k)
7095
7095
  return n;
7096
7096
  t = {
7097
7097
  slice: !0,
@@ -7102,7 +7102,7 @@ function Ge(n, e, t) {
7102
7102
  if (r)
7103
7103
  try {
7104
7104
  if (Array.isArray(n) && n.length > 0)
7105
- return b.fromArray(n.map((l) => e.nodeFromJSON(l)));
7105
+ return k.fromArray(n.map((l) => e.nodeFromJSON(l)));
7106
7106
  const s = e.nodeFromJSON(n);
7107
7107
  return t.errorOnInvalidContent && s.check(), s;
7108
7108
  } catch (o) {
@@ -7154,7 +7154,7 @@ function xa(n, e, t) {
7154
7154
  s === 0 && (s = f);
7155
7155
  }), n.setSelection(T.near(n.doc.resolve(s), t));
7156
7156
  }
7157
- var ba = (n) => !("type" in n), ka = (n, e, t) => ({ tr: r, dispatch: i, editor: o }) => {
7157
+ var ka = (n) => !("type" in n), ba = (n, e, t) => ({ tr: r, dispatch: i, editor: o }) => {
7158
7158
  var s;
7159
7159
  if (i) {
7160
7160
  t = {
@@ -7195,7 +7195,7 @@ var ba = (n) => !("type" in n), ka = (n, e, t) => ({ tr: r, dispatch: i, editor:
7195
7195
  return a(g), !1;
7196
7196
  }
7197
7197
  let { from: f, to: u } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, d = !0, h = !0;
7198
- if ((ba(l) ? l : [l]).forEach((g) => {
7198
+ if ((ka(l) ? l : [l]).forEach((g) => {
7199
7199
  g.check(), d = d ? g.isText && g.marks.length === 0 : !1, h = h ? g.isBlock : !1;
7200
7200
  }), f === u && h) {
7201
7201
  const { parent: g } = r.doc.resolve(f);
@@ -7205,7 +7205,7 @@ var ba = (n) => !("type" in n), ka = (n, e, t) => ({ tr: r, dispatch: i, editor:
7205
7205
  if (d) {
7206
7206
  if (Array.isArray(e))
7207
7207
  m = e.map((g) => g.text || "").join("");
7208
- else if (e instanceof b) {
7208
+ else if (e instanceof k) {
7209
7209
  let g = "";
7210
7210
  e.forEach((y) => {
7211
7211
  y.text && (g += y.text);
@@ -7491,6 +7491,8 @@ function tc(n, e, t = {}) {
7491
7491
  if (i.forEach(({ $from: u, $to: d }) => {
7492
7492
  const h = u.pos, p = d.pos;
7493
7493
  n.doc.nodesBetween(h, p, (m, g) => {
7494
+ if (o && m.inlineContent && !m.type.allowsMarkType(o))
7495
+ return !1;
7494
7496
  if (!m.isText && !m.marks.length)
7495
7497
  return;
7496
7498
  const y = Math.max(h, g), S = Math.min(p, g + m.nodeSize), C = S - y;
@@ -7623,7 +7625,7 @@ var rc = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
7623
7625
  const r = V(n, e.schema);
7624
7626
  return al(r)(e, t);
7625
7627
  };
7626
- function br(n, e) {
7628
+ function kr(n, e) {
7627
7629
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
7628
7630
  if (t) {
7629
7631
  const r = t.filter((i) => e?.includes(i.type.name));
@@ -7633,7 +7635,7 @@ function br(n, e) {
7633
7635
  var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
7634
7636
  const { selection: o, doc: s } = e, { $from: l, $to: a } = o, c = i.extensionManager.attributes, f = ut(c, l.node().type.name, l.node().attrs);
7635
7637
  if (o instanceof w && o.node.isBlock)
7636
- return !l.parentOffset || !ie(s, l.pos) ? !1 : (r && (n && br(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
7638
+ return !l.parentOffset || !ie(s, l.pos) ? !1 : (r && (n && kr(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
7637
7639
  if (!l.parent.isBlock)
7638
7640
  return !1;
7639
7641
  const u = a.parentOffset === a.parent.content.size, d = l.depth === 0 ? void 0 : Ha(l.node(-1).contentMatchAt(l.indexAfter(-1)));
@@ -7653,7 +7655,7 @@ var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
7653
7655
  const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
7654
7656
  l.node(-1).canReplaceWith(g.index(), g.index() + 1, d) && e.setNodeMarkup(e.mapping.map(l.before()), d);
7655
7657
  }
7656
- n && br(t, i.extensionManager.splittableMarks), e.scrollIntoView();
7658
+ n && kr(t, i.extensionManager.splittableMarks), e.scrollIntoView();
7657
7659
  }
7658
7660
  return p;
7659
7661
  }, uc = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: o }) => {
@@ -7669,10 +7671,10 @@ var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
7669
7671
  if (a.depth === 2 || a.node(-3).type !== l || a.index(-2) !== a.node(-2).childCount - 1)
7670
7672
  return !1;
7671
7673
  if (i) {
7672
- let y = b.empty;
7674
+ let y = k.empty;
7673
7675
  const S = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
7674
7676
  for (let U = a.depth - S; U >= a.depth - 3; U -= 1)
7675
- y = b.from(a.node(U).copy(y));
7677
+ y = k.from(a.node(U).copy(y));
7676
7678
  const C = (
7677
7679
  // eslint-disable-next-line no-nested-ternary
7678
7680
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
@@ -7680,9 +7682,9 @@ var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
7680
7682
  ...ut(d, a.node().type.name, a.node().attrs),
7681
7683
  ...e
7682
7684
  }, E = ((s = l.contentMatch.defaultType) == null ? void 0 : s.createAndFill(A)) || void 0;
7683
- y = y.append(b.from(l.createAndFill(null, E) || void 0));
7685
+ y = y.append(k.from(l.createAndFill(null, E) || void 0));
7684
7686
  const R = a.before(a.depth - (S - 1));
7685
- t.replace(R, a.after(-C), new k(y, 4 - S, 0));
7687
+ t.replace(R, a.after(-C), new b(y, 4 - S, 0));
7686
7688
  let L = -1;
7687
7689
  t.doc.nodesBetween(R, t.doc.content.size, (U, ae) => {
7688
7690
  if (L > -1)
@@ -7796,7 +7798,7 @@ var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
7796
7798
  t.removeMark(d.$from.pos, d.$to.pos, a);
7797
7799
  });
7798
7800
  return t.removeStoredMark(a), !0;
7799
- }, bc = (n) => ({ tr: e, state: t, dispatch: r }) => {
7801
+ }, kc = (n) => ({ tr: e, state: t, dispatch: r }) => {
7800
7802
  const { selection: i } = t;
7801
7803
  let o, s;
7802
7804
  return typeof n == "number" ? (o = n, s = n) : n && "from" in n && "to" in n ? (o = n.from, s = n.to) : (o = i.from, s = i.to), r && e.doc.nodesBetween(o, s, (l, a) => {
@@ -7805,7 +7807,7 @@ var fc = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
7805
7807
  const c = { ...l.attrs };
7806
7808
  delete c.dir, e.setNodeMarkup(a, void 0, c);
7807
7809
  }), !0;
7808
- }, kc = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
7810
+ }, bc = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
7809
7811
  let o = null, s = null;
7810
7812
  const l = Ui(
7811
7813
  typeof n == "string" ? n : n.name,
@@ -7910,7 +7912,7 @@ var vc = class {
7910
7912
  return e.parent = this, this.child = e, e.name = "name" in n ? n.name : e.parent.name, e;
7911
7913
  }
7912
7914
  }, Tc = {};
7913
- kn(Tc, {
7915
+ bn(Tc, {
7914
7916
  ClipboardTextSerializer: () => Ec,
7915
7917
  Commands: () => Mc,
7916
7918
  Delete: () => Ac,
@@ -8236,7 +8238,7 @@ var X = class Gi extends vc {
8236
8238
  ];
8237
8239
  }
8238
8240
  }), Pc = {};
8239
- kn(Pc, {
8241
+ bn(Pc, {
8240
8242
  createAtomBlockMarkdownSpec: () => $c,
8241
8243
  createBlockMarkdownSpec: () => Fc,
8242
8244
  createInlineMarkdownSpec: () => _c,
@@ -8573,7 +8575,7 @@ function Wc(n, e, t, r) {
8573
8575
  }), a.join(`
8574
8576
  `);
8575
8577
  }
8576
- var kr = "placeholder";
8578
+ var br = "placeholder";
8577
8579
  function jc(n) {
8578
8580
  return n.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
8579
8581
  }
@@ -8583,7 +8585,7 @@ var qc = X.create({
8583
8585
  return {
8584
8586
  emptyEditorClass: "is-editor-empty",
8585
8587
  emptyNodeClass: "is-empty",
8586
- dataAttribute: kr,
8588
+ dataAttribute: br,
8587
8589
  placeholder: "Write something …",
8588
8590
  showOnlyWhenEditable: !0,
8589
8591
  showOnlyCurrent: !0,
@@ -8591,7 +8593,7 @@ var qc = X.create({
8591
8593
  };
8592
8594
  },
8593
8595
  addProseMirrorPlugins() {
8594
- const n = this.options.dataAttribute ? `data-${jc(this.options.dataAttribute)}` : `data-${kr}`;
8596
+ const n = this.options.dataAttribute ? `data-${jc(this.options.dataAttribute)}` : `data-${br}`;
8595
8597
  return [
8596
8598
  new oe({
8597
8599
  key: new se("placeholder"),
@@ -9073,7 +9075,7 @@ const En = (n) => {
9073
9075
  x(p)("bold") ? (O(), N(j, {
9074
9076
  key: 0,
9075
9077
  label: x(s)("editor.bold"),
9076
- icon: x(bo),
9078
+ icon: x(ko),
9077
9079
  active: x(c)?.isActive("bold"),
9078
9080
  disabled: !x(c)?.can().chain().toggleBold().run(),
9079
9081
  onClick: S[0] || (S[0] = (C) => x(c)?.chain().focus().toggleBold().run())
@@ -9081,7 +9083,7 @@ const En = (n) => {
9081
9083
  x(p)("italic") ? (O(), N(j, {
9082
9084
  key: 1,
9083
9085
  label: x(s)("editor.italic"),
9084
- icon: x(ko),
9086
+ icon: x(bo),
9085
9087
  active: x(c)?.isActive("italic"),
9086
9088
  disabled: !x(c)?.can().chain().toggleItalic().run(),
9087
9089
  onClick: S[1] || (S[1] = (C) => x(c)?.chain().focus().toggleItalic().run())