@nine-lab/nine-ux 0.1.112 → 0.1.114

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.
package/dist/nine-ux.js CHANGED
@@ -5,8 +5,8 @@ var ui = (n) => {
5
5
  var El = (n, e, t) => e in n ? vl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
6
  var be = (n, e, t) => El(n, typeof e != "symbol" ? e + "" : e, t), _n = (n, e, t) => e.has(n) || ui("Cannot " + t);
7
7
  var O = (n, e, t) => (_n(n, e, "read from private field"), t ? t.call(n) : e.get(n)), B = (n, e, t) => e.has(n) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Y = (n, e, t, r) => (_n(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), R = (n, e, t) => (_n(n, e, "access private method"), t);
8
- import { nine as Es } from "@nine-lab/nine-util";
9
- const Al = `
8
+ import { trace as Al, nine as Es } from "@nine-lab/nine-util";
9
+ const Nl = `
10
10
  dialog::backdrop {
11
11
  background: rgba(0, 0, 0, 0.3);
12
12
  }
@@ -418,7 +418,7 @@ dialog.out { animation: nx-fade-out 0.3s forwards; }
418
418
  @keyframes nx-fade-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.9); } }
419
419
  `;
420
420
  var Ee, j, Dn, In, Rn;
421
- class Nl extends HTMLElement {
421
+ class Dl extends HTMLElement {
422
422
  constructor() {
423
423
  super();
424
424
  B(this, Ee);
@@ -472,8 +472,8 @@ class Nl extends HTMLElement {
472
472
  }
473
473
  connectedCallback() {
474
474
  const t = this.innerHTML, r = this.getAttribute("title") || "Details";
475
- this.innerHTML = `
476
- <style>${Al}</style>
475
+ Al.log("================================"), this.innerHTML = `
476
+ <style>${Nl}</style>
477
477
 
478
478
  <dialog>
479
479
  <div class="head">
@@ -507,7 +507,7 @@ class Nl extends HTMLElement {
507
507
  }
508
508
  }
509
509
  Ee = new WeakMap(), j = new WeakMap(), Dn = new WeakMap(), In = new WeakMap(), Rn = new WeakMap();
510
- customElements.get("nine-dialog") || customElements.define("nine-dialog", Nl);
510
+ customElements.get("nine-dialog") || customElements.define("nine-dialog", Dl);
511
511
  class $r extends HTMLElement {
512
512
  constructor() {
513
513
  super(), this.attachShadow({ mode: "open" });
@@ -582,9 +582,9 @@ be(Vr, "alert", async (e, t = "Alert", r = {}) => {
582
582
  });
583
583
  customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", $r);
584
584
  customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Vr);
585
- const Dl = typeof window < "u" && window.nine ? window.nine : Es;
585
+ const Il = typeof window < "u" && window.nine ? window.nine : Es;
586
586
  var _t, Gt, mr;
587
- class Il {
587
+ class Rl {
588
588
  constructor() {
589
589
  B(this, Gt);
590
590
  B(this, _t, "");
@@ -592,7 +592,7 @@ class Il {
592
592
  // 1. 값만 깔끔하게 반환
593
593
  get cssPath() {
594
594
  var e;
595
- return ((e = Dl.config.ux) == null ? void 0 : e.cssPath) || O(this, _t);
595
+ return ((e = Il.config.ux) == null ? void 0 : e.cssPath) || O(this, _t);
596
596
  }
597
597
  set cssPath(e) {
598
598
  Y(this, _t, e);
@@ -633,9 +633,9 @@ _t = new WeakMap(), Gt = new WeakSet(), mr = function(e, t, r, i) {
633
633
  l || (l = !0, o[e](t, r, s));
634
634
  }), a;
635
635
  };
636
- const zt = new Il();
636
+ const zt = new Rl();
637
637
  var Xt, Qe, Yt, ae, Et, gr, yr, Zt, Pn;
638
- class Rl extends HTMLElement {
638
+ class Pl extends HTMLElement {
639
639
  constructor() {
640
640
  super();
641
641
  B(this, ae);
@@ -1369,7 +1369,7 @@ function Is(n, e, t, r) {
1369
1369
  let l = Is(o.content, e - s - 1, t, o);
1370
1370
  return l && n.replaceChild(i, o.copy(l));
1371
1371
  }
1372
- function Pl(n, e, t) {
1372
+ function Bl(n, e, t) {
1373
1373
  if (t.openStart > n.depth)
1374
1374
  throw new bn("Inserted content deeper than insertion position");
1375
1375
  if (n.depth - t.openStart != e.depth - t.openEnd)
@@ -1386,7 +1386,7 @@ function Rs(n, e, t, r) {
1386
1386
  let o = n.parent, l = o.content;
1387
1387
  return tt(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
1388
1388
  } else {
1389
- let { start: o, end: l } = Bl(t, n);
1389
+ let { start: o, end: l } = Ll(t, n);
1390
1390
  return tt(s, Bs(n, o, l, e, r));
1391
1391
  }
1392
1392
  else return tt(s, kn(n, e, r));
@@ -1425,7 +1425,7 @@ function kn(n, e, t) {
1425
1425
  }
1426
1426
  return Rt(e, null, t, r), new b(r);
1427
1427
  }
1428
- function Bl(n, e) {
1428
+ function Ll(n, e) {
1429
1429
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
1430
1430
  for (let s = t - 1; s >= 0; s--)
1431
1431
  i = e.node(s).copy(b.from(i));
@@ -1676,17 +1676,17 @@ class Ft {
1676
1676
  return o;
1677
1677
  }
1678
1678
  else
1679
- fi.set(e, r = new Ll());
1679
+ fi.set(e, r = new zl());
1680
1680
  let i = r.elts[r.i] = Ft.resolve(e, t);
1681
- return r.i = (r.i + 1) % zl, i;
1681
+ return r.i = (r.i + 1) % Fl, i;
1682
1682
  }
1683
1683
  }
1684
- class Ll {
1684
+ class zl {
1685
1685
  constructor() {
1686
1686
  this.elts = [], this.i = 0;
1687
1687
  }
1688
1688
  }
1689
- const zl = 12, fi = /* @__PURE__ */ new WeakMap();
1689
+ const Fl = 12, fi = /* @__PURE__ */ new WeakMap();
1690
1690
  class xn {
1691
1691
  /**
1692
1692
  Construct a node range. `$from` and `$to` should point into the
@@ -1727,7 +1727,7 @@ class xn {
1727
1727
  return this.$to.indexAfter(this.depth);
1728
1728
  }
1729
1729
  }
1730
- const Fl = /* @__PURE__ */ Object.create(null);
1730
+ const $l = /* @__PURE__ */ Object.create(null);
1731
1731
  let $e = class xr {
1732
1732
  /**
1733
1733
  @internal
@@ -1846,7 +1846,7 @@ let $e = class xr {
1846
1846
  attributes, and marks.
1847
1847
  */
1848
1848
  hasMarkup(e, t, r) {
1849
- return this.type == e && yn(this.attrs, t || e.defaultAttrs || Fl) && N.sameSet(this.marks, r || N.none);
1849
+ return this.type == e && yn(this.attrs, t || e.defaultAttrs || $l) && N.sameSet(this.marks, r || N.none);
1850
1850
  }
1851
1851
  /**
1852
1852
  Create a new node with the same markup as this node, containing
@@ -1889,7 +1889,7 @@ let $e = class xr {
1889
1889
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
1890
1890
  */
1891
1891
  replace(e, t, r) {
1892
- return Pl(this.resolve(e), this.resolve(t), r);
1892
+ return Bl(this.resolve(e), this.resolve(t), r);
1893
1893
  }
1894
1894
  /**
1895
1895
  Find the node directly after the given position.
@@ -2152,13 +2152,13 @@ class st {
2152
2152
  @internal
2153
2153
  */
2154
2154
  static parse(e, t) {
2155
- let r = new $l(e, t);
2155
+ let r = new Vl(e, t);
2156
2156
  if (r.next == null)
2157
2157
  return st.empty;
2158
2158
  let i = zs(r);
2159
2159
  r.next && r.err("Unexpected trailing text");
2160
- let s = Jl(Kl(i));
2161
- return Ul(s, r), s;
2160
+ let s = Ul(Jl(i));
2161
+ return _l(s, r), s;
2162
2162
  }
2163
2163
  /**
2164
2164
  Match a node type, returning a match after that node if
@@ -2304,7 +2304,7 @@ class st {
2304
2304
  }
2305
2305
  }
2306
2306
  st.empty = new st(!0);
2307
- class $l {
2307
+ class Vl {
2308
2308
  constructor(e, t) {
2309
2309
  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();
2310
2310
  }
@@ -2321,19 +2321,19 @@ class $l {
2321
2321
  function zs(n) {
2322
2322
  let e = [];
2323
2323
  do
2324
- e.push(Vl(n));
2324
+ e.push(Hl(n));
2325
2325
  while (n.eat("|"));
2326
2326
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
2327
2327
  }
2328
- function Vl(n) {
2328
+ function Hl(n) {
2329
2329
  let e = [];
2330
2330
  do
2331
- e.push(Hl(n));
2331
+ e.push(Wl(n));
2332
2332
  while (n.next && n.next != ")" && n.next != "|");
2333
2333
  return e.length == 1 ? e[0] : { type: "seq", exprs: e };
2334
2334
  }
2335
- function Hl(n) {
2336
- let e = jl(n);
2335
+ function Wl(n) {
2336
+ let e = Kl(n);
2337
2337
  for (; ; )
2338
2338
  if (n.eat("+"))
2339
2339
  e = { type: "plus", expr: e };
@@ -2342,7 +2342,7 @@ function Hl(n) {
2342
2342
  else if (n.eat("?"))
2343
2343
  e = { type: "opt", expr: e };
2344
2344
  else if (n.eat("{"))
2345
- e = Wl(n, e);
2345
+ e = ql(n, e);
2346
2346
  else
2347
2347
  break;
2348
2348
  return e;
@@ -2352,11 +2352,11 @@ function hi(n) {
2352
2352
  let e = Number(n.next);
2353
2353
  return n.pos++, e;
2354
2354
  }
2355
- function Wl(n, e) {
2355
+ function ql(n, e) {
2356
2356
  let t = hi(n), r = t;
2357
2357
  return n.eat(",") && (n.next != "}" ? r = hi(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
2358
2358
  }
2359
- function ql(n, e) {
2359
+ function jl(n, e) {
2360
2360
  let t = n.nodeTypes, r = t[e];
2361
2361
  if (r)
2362
2362
  return [r];
@@ -2367,18 +2367,18 @@ function ql(n, e) {
2367
2367
  }
2368
2368
  return i.length == 0 && n.err("No node type or group '" + e + "' found"), i;
2369
2369
  }
2370
- function jl(n) {
2370
+ function Kl(n) {
2371
2371
  if (n.eat("(")) {
2372
2372
  let e = zs(n);
2373
2373
  return n.eat(")") || n.err("Missing closing paren"), e;
2374
2374
  } else if (/\W/.test(n.next))
2375
2375
  n.err("Unexpected token '" + n.next + "'");
2376
2376
  else {
2377
- let e = ql(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2377
+ let e = jl(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2378
2378
  return n.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
2379
2379
  }
2380
2380
  }
2381
- function Kl(n) {
2381
+ function Jl(n) {
2382
2382
  let e = [[]];
2383
2383
  return i(s(n, 0), t()), e;
2384
2384
  function t() {
@@ -2449,7 +2449,7 @@ function pi(n, e) {
2449
2449
  }
2450
2450
  }
2451
2451
  }
2452
- function Jl(n) {
2452
+ function Ul(n) {
2453
2453
  let e = /* @__PURE__ */ Object.create(null);
2454
2454
  return t(pi(n, 0));
2455
2455
  function t(r) {
@@ -2474,7 +2474,7 @@ function Jl(n) {
2474
2474
  return s;
2475
2475
  }
2476
2476
  }
2477
- function Ul(n, e) {
2477
+ function _l(n, e) {
2478
2478
  for (let t = 0, r = [n]; t < r.length; t++) {
2479
2479
  let i = r[t], s = !i.validEnd, o = [];
2480
2480
  for (let l = 0; l < i.next.length; l++) {
@@ -2522,7 +2522,7 @@ function Ws(n, e) {
2522
2522
  let t = /* @__PURE__ */ Object.create(null);
2523
2523
  if (e)
2524
2524
  for (let r in e)
2525
- t[r] = new Gl(n, r, e[r]);
2525
+ t[r] = new Xl(n, r, e[r]);
2526
2526
  return t;
2527
2527
  }
2528
2528
  let mi = class qs {
@@ -2704,7 +2704,7 @@ let mi = class qs {
2704
2704
  return r;
2705
2705
  }
2706
2706
  };
2707
- function _l(n, e, t) {
2707
+ function Gl(n, e, t) {
2708
2708
  let r = t.split("|");
2709
2709
  return (i) => {
2710
2710
  let s = i === null ? "null" : typeof i;
@@ -2712,9 +2712,9 @@ function _l(n, e, t) {
2712
2712
  throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`);
2713
2713
  };
2714
2714
  }
2715
- class Gl {
2715
+ class Xl {
2716
2716
  constructor(e, t, r) {
2717
- this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? _l(e, t, r.validate) : r.validate;
2717
+ this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? Gl(e, t, r.validate) : r.validate;
2718
2718
  }
2719
2719
  get isRequired() {
2720
2720
  return !this.hasDefault;
@@ -2860,10 +2860,10 @@ function gi(n, e) {
2860
2860
  }
2861
2861
  return t;
2862
2862
  }
2863
- function Xl(n) {
2863
+ function Yl(n) {
2864
2864
  return n.tag != null;
2865
2865
  }
2866
- function Yl(n) {
2866
+ function Zl(n) {
2867
2867
  return n.style != null;
2868
2868
  }
2869
2869
  class Ve {
@@ -2875,9 +2875,9 @@ class Ve {
2875
2875
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
2876
2876
  let r = this.matchedStyles = [];
2877
2877
  t.forEach((i) => {
2878
- if (Xl(i))
2878
+ if (Yl(i))
2879
2879
  this.tags.push(i);
2880
- else if (Yl(i)) {
2880
+ else if (Zl(i)) {
2881
2881
  let s = /[^=]*/.exec(i.style)[0];
2882
2882
  r.indexOf(s) < 0 && r.push(s), this.styles.push(i);
2883
2883
  }
@@ -2913,7 +2913,7 @@ class Ve {
2913
2913
  matchTag(e, t, r) {
2914
2914
  for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
2915
2915
  let s = this.tags[i];
2916
- if (ea(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2916
+ if (ta(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2917
2917
  if (s.getAttrs) {
2918
2918
  let o = s.getAttrs(e);
2919
2919
  if (o === !1)
@@ -3014,7 +3014,7 @@ const Ks = {
3014
3014
  table: !0,
3015
3015
  tfoot: !0,
3016
3016
  ul: !0
3017
- }, Zl = {
3017
+ }, Ql = {
3018
3018
  head: !0,
3019
3019
  noscript: !0,
3020
3020
  object: !0,
@@ -3101,9 +3101,9 @@ class bi {
3101
3101
  let i = this.localPreserveWS, s = this.top;
3102
3102
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3103
3103
  let o = e.nodeName.toLowerCase(), l;
3104
- Js.hasOwnProperty(o) && this.parser.normalizeLists && Ql(e);
3104
+ Js.hasOwnProperty(o) && this.parser.normalizeLists && ea(e);
3105
3105
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
3106
- e: if (a ? a.ignore : Zl.hasOwnProperty(o))
3106
+ e: if (a ? a.ignore : Ql.hasOwnProperty(o))
3107
3107
  this.findInside(e), this.ignoreFallback(e, t);
3108
3108
  else if (!a || a.skip || a.closeParent) {
3109
3109
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3340,13 +3340,13 @@ class bi {
3340
3340
  }
3341
3341
  }
3342
3342
  }
3343
- function Ql(n) {
3343
+ function ea(n) {
3344
3344
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3345
3345
  let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3346
3346
  r && Js.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
3347
3347
  }
3348
3348
  }
3349
- function ea(n, e) {
3349
+ function ta(n, e) {
3350
3350
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3351
3351
  }
3352
3352
  function ki(n) {
@@ -3489,11 +3489,11 @@ function Xn(n) {
3489
3489
  return n.document || window.document;
3490
3490
  }
3491
3491
  const wi = /* @__PURE__ */ new WeakMap();
3492
- function ta(n) {
3492
+ function na(n) {
3493
3493
  let e = wi.get(n);
3494
- return e === void 0 && wi.set(n, e = na(n)), e;
3494
+ return e === void 0 && wi.set(n, e = ra(n)), e;
3495
3495
  }
3496
- function na(n) {
3496
+ function ra(n) {
3497
3497
  let e = null;
3498
3498
  function t(r) {
3499
3499
  if (r && typeof r == "object")
@@ -3519,7 +3519,7 @@ function hn(n, e, t, r) {
3519
3519
  let i = e[0], s;
3520
3520
  if (typeof i != "string")
3521
3521
  throw new RangeError("Invalid array passed to renderSpec");
3522
- if (r && (s = ta(r)) && s.indexOf(e) > -1)
3522
+ if (r && (s = na(r)) && s.indexOf(e) > -1)
3523
3523
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3524
3524
  let o = i.indexOf(" ");
3525
3525
  o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
@@ -3550,13 +3550,13 @@ function hn(n, e, t, r) {
3550
3550
  return { dom: a, contentDOM: l };
3551
3551
  }
3552
3552
  const Us = 65535, _s = Math.pow(2, 16);
3553
- function ra(n, e) {
3553
+ function ia(n, e) {
3554
3554
  return n + e * _s;
3555
3555
  }
3556
3556
  function Mi(n) {
3557
3557
  return n & Us;
3558
3558
  }
3559
- function ia(n) {
3559
+ function sa(n) {
3560
3560
  return (n - (n & Us)) / _s;
3561
3561
  }
3562
3562
  const Gs = 1, Xs = 2, pn = 4, Ys = 8;
@@ -3614,7 +3614,7 @@ class le {
3614
3614
  if (!this.inverted)
3615
3615
  for (let i = 0; i < r; i++)
3616
3616
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
3617
- return this.ranges[r * 3] + t + ia(e);
3617
+ return this.ranges[r * 3] + t + sa(e);
3618
3618
  }
3619
3619
  mapResult(e, t = 1) {
3620
3620
  return this._map(e, t, !1);
@@ -3636,7 +3636,7 @@ class le {
3636
3636
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
3637
3637
  if (r)
3638
3638
  return h;
3639
- let p = e == (t < 0 ? a : u) ? null : ra(l / 3, e - a), m = e == a ? Xs : e == u ? Gs : pn;
3639
+ let p = e == (t < 0 ? a : u) ? null : ia(l / 3, e - a), m = e == a ? Xs : e == u ? Gs : pn;
3640
3640
  return (t < 0 ? e != a : e != u) && (m |= Ys), new wr(h, m, p);
3641
3641
  }
3642
3642
  i += d - c;
@@ -4166,7 +4166,7 @@ function Mr(n, e, t) {
4166
4166
  }
4167
4167
  return !1;
4168
4168
  }
4169
- function sa(n, e, t, r) {
4169
+ function oa(n, e, t, r) {
4170
4170
  let i = [], s = [], o, l;
4171
4171
  n.doc.nodesBetween(e, t, (a, c, d) => {
4172
4172
  if (!a.isInline)
@@ -4180,7 +4180,7 @@ function sa(n, e, t, r) {
4180
4180
  }
4181
4181
  }), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
4182
4182
  }
4183
- function oa(n, e, t, r) {
4183
+ function la(n, e, t, r) {
4184
4184
  let i = [], s = 0;
4185
4185
  n.doc.nodesBetween(e, t, (o, l) => {
4186
4186
  if (!o.isInline)
@@ -4230,7 +4230,7 @@ function Wr(n, e, t, r = t.contentMatch, i = !0) {
4230
4230
  for (let a = o.length - 1; a >= 0; a--)
4231
4231
  n.step(o[a]);
4232
4232
  }
4233
- function la(n, e, t) {
4233
+ function aa(n, e, t) {
4234
4234
  return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
4235
4235
  }
4236
4236
  function Ot(n) {
@@ -4239,13 +4239,13 @@ function Ot(n) {
4239
4239
  let o = n.$from.node(r), l = n.$from.index(r) + i, a = n.$to.indexAfter(r) - s;
4240
4240
  if (r < n.depth && o.canReplace(l, a, t))
4241
4241
  return r;
4242
- if (r == 0 || o.type.spec.isolating || !la(o, l, a))
4242
+ if (r == 0 || o.type.spec.isolating || !aa(o, l, a))
4243
4243
  break;
4244
4244
  l && (i = 1), a < o.childCount && (s = 1);
4245
4245
  }
4246
4246
  return null;
4247
4247
  }
4248
- function aa(n, e, t) {
4248
+ function ca(n, e, t) {
4249
4249
  let { $from: r, $to: i, depth: s } = e, o = r.before(s + 1), l = i.after(s + 1), a = o, c = l, d = b.empty, u = 0;
4250
4250
  for (let p = s, m = !1; p > t; p--)
4251
4251
  m || r.index(p) > 0 ? (m = !0, d = b.from(r.node(p).copy(d)), u++) : a--;
@@ -4255,20 +4255,20 @@ function aa(n, e, t) {
4255
4255
  n.step(new V(a, c, o, l, new k(d.append(f), u, h), d.size - u, !0));
4256
4256
  }
4257
4257
  function qr(n, e, t = null, r = n) {
4258
- let i = ca(n, e), s = i && da(r, e);
4258
+ let i = da(n, e), s = i && ua(r, e);
4259
4259
  return s ? i.map(Ci).concat({ type: e, attrs: t }).concat(s.map(Ci)) : null;
4260
4260
  }
4261
4261
  function Ci(n) {
4262
4262
  return { type: n, attrs: null };
4263
4263
  }
4264
- function ca(n, e) {
4264
+ function da(n, e) {
4265
4265
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.contentMatchAt(r).findWrapping(e);
4266
4266
  if (!s)
4267
4267
  return null;
4268
4268
  let o = s.length ? s[0] : e;
4269
4269
  return t.canReplaceWith(r, i, o) ? s : null;
4270
4270
  }
4271
- function da(n, e) {
4271
+ function ua(n, e) {
4272
4272
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.child(r), o = e.contentMatch.findWrapping(s.type);
4273
4273
  if (!o)
4274
4274
  return null;
@@ -4277,7 +4277,7 @@ function da(n, e) {
4277
4277
  a = a.matchType(t.child(c).type);
4278
4278
  return !a || !a.validEnd ? null : o;
4279
4279
  }
4280
- function ua(n, e, t) {
4280
+ function fa(n, e, t) {
4281
4281
  let r = b.empty;
4282
4282
  for (let o = t.length - 1; o >= 0; o--) {
4283
4283
  if (r.size) {
@@ -4290,13 +4290,13 @@ function ua(n, e, t) {
4290
4290
  let i = e.start, s = e.end;
4291
4291
  n.step(new V(i, s, i, s, new k(r, 0, 0), t.length, !0));
4292
4292
  }
4293
- function fa(n, e, t, r, i) {
4293
+ function ha(n, e, t, r, i) {
4294
4294
  if (!r.isTextblock)
4295
4295
  throw new RangeError("Type given to setBlockType should be a textblock");
4296
4296
  let s = n.steps.length;
4297
4297
  n.doc.nodesBetween(e, t, (o, l) => {
4298
4298
  let a = typeof i == "function" ? i(o) : i;
4299
- if (o.isTextblock && !o.hasMarkup(r, a) && ha(n.doc, n.mapping.slice(s).map(l), r)) {
4299
+ if (o.isTextblock && !o.hasMarkup(r, a) && pa(n.doc, n.mapping.slice(s).map(l), r)) {
4300
4300
  let c = null;
4301
4301
  if (r.schema.linebreakReplacement) {
4302
4302
  let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
@@ -4328,11 +4328,11 @@ function Qs(n, e, t, r) {
4328
4328
  }
4329
4329
  });
4330
4330
  }
4331
- function ha(n, e, t) {
4331
+ function pa(n, e, t) {
4332
4332
  let r = n.resolve(e), i = r.index();
4333
4333
  return r.parent.canReplaceWith(i, i + 1, t);
4334
4334
  }
4335
- function pa(n, e, t, r, i) {
4335
+ function ma(n, e, t, r, i) {
4336
4336
  let s = n.doc.nodeAt(e);
4337
4337
  if (!s)
4338
4338
  throw new RangeError("No node at given position");
@@ -4361,7 +4361,7 @@ function Ne(n, e, t = 1, r) {
4361
4361
  let l = i.indexAfter(s), a = r && r[0];
4362
4362
  return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
4363
4363
  }
4364
- function ma(n, e, t = 1, r) {
4364
+ function ga(n, e, t = 1, r) {
4365
4365
  let i = n.doc.resolve(e), s = b.empty, o = b.empty;
4366
4366
  for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
4367
4367
  s = b.from(i.node(l).copy(s));
@@ -4374,7 +4374,7 @@ function Ke(n, e) {
4374
4374
  let t = n.resolve(e), r = t.index();
4375
4375
  return eo(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
4376
4376
  }
4377
- function ga(n, e) {
4377
+ function ya(n, e) {
4378
4378
  e.content.size || n.type.compatibleContent(e.type);
4379
4379
  let t = n.contentMatchAt(n.childCount), { linebreakReplacement: r } = n.type.schema;
4380
4380
  for (let i = 0; i < e.childCount; i++) {
@@ -4385,7 +4385,7 @@ function ga(n, e) {
4385
4385
  return t.validEnd;
4386
4386
  }
4387
4387
  function eo(n, e) {
4388
- return !!(n && e && !n.isLeaf && ga(n, e));
4388
+ return !!(n && e && !n.isLeaf && ya(n, e));
4389
4389
  }
4390
4390
  function Ln(n, e, t = -1) {
4391
4391
  let r = n.resolve(e);
@@ -4398,7 +4398,7 @@ function Ln(n, e, t = -1) {
4398
4398
  e = t < 0 ? r.before(i) : r.after(i);
4399
4399
  }
4400
4400
  }
4401
- function ya(n, e, t) {
4401
+ function ba(n, e, t) {
4402
4402
  let r = null, { linebreakReplacement: i } = n.doc.type.schema, s = n.doc.resolve(e - t), o = s.node().type;
4403
4403
  if (i && o.inlineContent) {
4404
4404
  let d = o.whitespace == "pre", u = !!o.contentMatch.matchType(i);
@@ -4417,7 +4417,7 @@ function ya(n, e, t) {
4417
4417
  }
4418
4418
  return n;
4419
4419
  }
4420
- function ba(n, e, t) {
4420
+ function ka(n, e, t) {
4421
4421
  let r = n.resolve(e);
4422
4422
  if (r.parent.canReplaceWith(r.index(), r.index(), t))
4423
4423
  return e;
@@ -4464,12 +4464,12 @@ function zn(n, e, t = e, r = k.empty) {
4464
4464
  if (e == t && !r.size)
4465
4465
  return null;
4466
4466
  let i = n.resolve(e), s = n.resolve(t);
4467
- return no(i, s, r) ? new L(e, t, r) : new ka(i, s, r).fit();
4467
+ return no(i, s, r) ? new L(e, t, r) : new xa(i, s, r).fit();
4468
4468
  }
4469
4469
  function no(n, e, t) {
4470
4470
  return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
4471
4471
  }
4472
- class ka {
4472
+ class xa {
4473
4473
  constructor(e, t, r) {
4474
4474
  this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = b.empty;
4475
4475
  for (let i = 0; i <= e.depth; i++) {
@@ -4638,18 +4638,18 @@ function Qn(n, e, t, r, i) {
4638
4638
  if (o == s.childCount && !t.compatibleContent(s.type))
4639
4639
  return null;
4640
4640
  let l = r.fillBefore(s.content, !0, o);
4641
- return l && !xa(t, s.content, o) ? l : null;
4641
+ return l && !Sa(t, s.content, o) ? l : null;
4642
4642
  }
4643
- function xa(n, e, t) {
4643
+ function Sa(n, e, t) {
4644
4644
  for (let r = t; r < e.childCount; r++)
4645
4645
  if (!n.allowsMarks(e.child(r).marks))
4646
4646
  return !0;
4647
4647
  return !1;
4648
4648
  }
4649
- function Sa(n) {
4649
+ function wa(n) {
4650
4650
  return n.spec.defining || n.spec.definingForContent;
4651
4651
  }
4652
- function wa(n, e, t, r) {
4652
+ function Ma(n, e, t, r) {
4653
4653
  if (!r.size)
4654
4654
  return n.deleteRange(e, t);
4655
4655
  let i = n.doc.resolve(e), s = n.doc.resolve(t);
@@ -4673,7 +4673,7 @@ function wa(n, e, t, r) {
4673
4673
  f = p.content;
4674
4674
  }
4675
4675
  for (let f = d - 1; f >= 0; f--) {
4676
- let h = c[f], p = Sa(h.type);
4676
+ let h = c[f], p = wa(h.type);
4677
4677
  if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
4678
4678
  d = f;
4679
4679
  else if (p || !h.type.isTextblock)
@@ -4707,14 +4707,14 @@ function io(n, e, t, r, i) {
4707
4707
  }
4708
4708
  return n;
4709
4709
  }
4710
- function Ma(n, e, t, r) {
4710
+ function Ca(n, e, t, r) {
4711
4711
  if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
4712
- let i = ba(n.doc, e, r.type);
4712
+ let i = ka(n.doc, e, r.type);
4713
4713
  i != null && (e = t = i);
4714
4714
  }
4715
4715
  n.replaceRange(e, t, new k(b.from(r), 0, 0));
4716
4716
  }
4717
- function Ca(n, e, t) {
4717
+ function Ta(n, e, t) {
4718
4718
  let r = n.doc.resolve(e), i = n.doc.resolve(t);
4719
4719
  if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
4720
4720
  let o = r.sharedDepth(t), l = !1;
@@ -4834,7 +4834,7 @@ wt = function n(e) {
4834
4834
  wt.prototype = Object.create(Error.prototype);
4835
4835
  wt.prototype.constructor = wt;
4836
4836
  wt.prototype.name = "TransformError";
4837
- class Ta {
4837
+ class Oa {
4838
4838
  /**
4839
4839
  Create a transform that starts with the given document.
4840
4840
  */
@@ -4941,7 +4941,7 @@ class Ta {
4941
4941
  control over what happens.
4942
4942
  */
4943
4943
  replaceRange(e, t, r) {
4944
- return wa(this, e, t, r), this;
4944
+ return Ma(this, e, t, r), this;
4945
4945
  }
4946
4946
  /**
4947
4947
  Replace the given range with a node, but use `from` and `to` as
@@ -4953,14 +4953,14 @@ class Ta {
4953
4953
  that parent node.
4954
4954
  */
4955
4955
  replaceRangeWith(e, t, r) {
4956
- return Ma(this, e, t, r), this;
4956
+ return Ca(this, e, t, r), this;
4957
4957
  }
4958
4958
  /**
4959
4959
  Delete the given range, expanding it to cover fully covered
4960
4960
  parent nodes until a valid replace is found.
4961
4961
  */
4962
4962
  deleteRange(e, t) {
4963
- return Ca(this, e, t), this;
4963
+ return Ta(this, e, t), this;
4964
4964
  }
4965
4965
  /**
4966
4966
  Split the content in the given range off from its parent, if there
@@ -4970,14 +4970,14 @@ class Ta {
4970
4970
  sure the lift is valid.
4971
4971
  */
4972
4972
  lift(e, t) {
4973
- return aa(this, e, t), this;
4973
+ return ca(this, e, t), this;
4974
4974
  }
4975
4975
  /**
4976
4976
  Join the blocks around the given position. If depth is 2, their
4977
4977
  last and first siblings are also joined, and so on.
4978
4978
  */
4979
4979
  join(e, t = 1) {
4980
- return ya(this, e, t), this;
4980
+ return ba(this, e, t), this;
4981
4981
  }
4982
4982
  /**
4983
4983
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
@@ -4985,21 +4985,21 @@ class Ta {
4985
4985
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
4986
4986
  */
4987
4987
  wrap(e, t) {
4988
- return ua(this, e, t), this;
4988
+ return fa(this, e, t), this;
4989
4989
  }
4990
4990
  /**
4991
4991
  Set the type of all textblocks (partly) between `from` and `to` to
4992
4992
  the given node type with the given attributes.
4993
4993
  */
4994
4994
  setBlockType(e, t = e, r, i = null) {
4995
- return fa(this, e, t, r, i), this;
4995
+ return ha(this, e, t, r, i), this;
4996
4996
  }
4997
4997
  /**
4998
4998
  Change the type, attributes, and/or marks of the node at `pos`.
4999
4999
  When `type` isn't given, the existing node type is preserved,
5000
5000
  */
5001
5001
  setNodeMarkup(e, t, r = null, i) {
5002
- return pa(this, e, t, r, i), this;
5002
+ return ma(this, e, t, r, i), this;
5003
5003
  }
5004
5004
  /**
5005
5005
  Set a single attribute on a given node to a new value.
@@ -5048,13 +5048,13 @@ class Ta {
5048
5048
  use after the split (with the outermost nodes coming first).
5049
5049
  */
5050
5050
  split(e, t = 1, r) {
5051
- return ma(this, e, t, r), this;
5051
+ return ga(this, e, t, r), this;
5052
5052
  }
5053
5053
  /**
5054
5054
  Add the given mark to the inline content between `from` and `to`.
5055
5055
  */
5056
5056
  addMark(e, t, r) {
5057
- return sa(this, e, t, r), this;
5057
+ return oa(this, e, t, r), this;
5058
5058
  }
5059
5059
  /**
5060
5060
  Remove marks from inline nodes between `from` and `to`. When
@@ -5063,7 +5063,7 @@ class Ta {
5063
5063
  remove all marks of any type.
5064
5064
  */
5065
5065
  removeMark(e, t, r) {
5066
- return oa(this, e, t, r), this;
5066
+ return la(this, e, t, r), this;
5067
5067
  }
5068
5068
  /**
5069
5069
  Removes all marks and nodes from the content of the node at
@@ -5083,7 +5083,7 @@ class v {
5083
5083
  `$head`.
5084
5084
  */
5085
5085
  constructor(e, t, r) {
5086
- this.$anchor = e, this.$head = t, this.ranges = r || [new Oa(e.min(t), e.max(t))];
5086
+ this.$anchor = e, this.$head = t, this.ranges = r || [new va(e.min(t), e.max(t))];
5087
5087
  }
5088
5088
  /**
5089
5089
  The selection's anchor, as an unresolved position.
@@ -5241,7 +5241,7 @@ class v {
5241
5241
  }
5242
5242
  }
5243
5243
  v.prototype.visible = !0;
5244
- class Oa {
5244
+ class va {
5245
5245
  /**
5246
5246
  Create a range.
5247
5247
  */
@@ -5429,11 +5429,11 @@ class ce extends v {
5429
5429
  return e instanceof ce;
5430
5430
  }
5431
5431
  getBookmark() {
5432
- return va;
5432
+ return Ea;
5433
5433
  }
5434
5434
  }
5435
5435
  v.jsonID("all", ce);
5436
- const va = {
5436
+ const Ea = {
5437
5437
  map() {
5438
5438
  return this;
5439
5439
  },
@@ -5471,7 +5471,7 @@ function vi(n, e, t) {
5471
5471
  }), n.setSelection(v.near(n.doc.resolve(o), t));
5472
5472
  }
5473
5473
  const Ei = 1, ln = 2, Ai = 4;
5474
- class Ea extends Ta {
5474
+ class Aa extends Oa {
5475
5475
  /**
5476
5476
  @internal
5477
5477
  */
@@ -5630,7 +5630,7 @@ class Dt {
5630
5630
  this.name = e, this.init = Ni(t.init, r), this.apply = Ni(t.apply, r);
5631
5631
  }
5632
5632
  }
5633
- const Aa = [
5633
+ const Na = [
5634
5634
  new Dt("doc", {
5635
5635
  init(n) {
5636
5636
  return n.doc || n.schema.topNodeType.createAndFill();
@@ -5666,7 +5666,7 @@ const Aa = [
5666
5666
  ];
5667
5667
  class tr {
5668
5668
  constructor(e, t) {
5669
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Aa.slice(), t && t.forEach((r) => {
5669
+ this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Na.slice(), t && t.forEach((r) => {
5670
5670
  if (this.pluginsByKey[r.key])
5671
5671
  throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
5672
5672
  this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Dt(r.key, r.spec.state, r));
@@ -5759,7 +5759,7 @@ class gt {
5759
5759
  Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
5760
5760
  */
5761
5761
  get tr() {
5762
- return new Ea(this);
5762
+ return new Aa(this);
5763
5763
  }
5764
5764
  /**
5765
5765
  Create a new state.
@@ -5896,18 +5896,18 @@ let Cr = null;
5896
5896
  const Oe = function(n, e, t) {
5897
5897
  let r = Cr || (Cr = document.createRange());
5898
5898
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5899
- }, Na = function() {
5899
+ }, Da = function() {
5900
5900
  Cr = null;
5901
5901
  }, lt = function(n, e, t, r) {
5902
5902
  return t && (Di(n, e, t, r, -1) || Di(n, e, t, r, 1));
5903
- }, Da = /^(img|br|input|textarea|hr)$/i;
5903
+ }, Ia = /^(img|br|input|textarea|hr)$/i;
5904
5904
  function Di(n, e, t, r, i) {
5905
5905
  for (var s; ; ) {
5906
5906
  if (n == t && e == r)
5907
5907
  return !0;
5908
5908
  if (e == (i < 0 ? 0 : fe(n))) {
5909
5909
  let o = n.parentNode;
5910
- if (!o || o.nodeType != 1 || tn(n) || Da.test(n.nodeName) || n.contentEditable == "false")
5910
+ if (!o || o.nodeType != 1 || tn(n) || Ia.test(n.nodeName) || n.contentEditable == "false")
5911
5911
  return !1;
5912
5912
  e = J(n) + (i < 0 ? 0 : 1), n = o;
5913
5913
  } else if (n.nodeType == 1) {
@@ -5926,7 +5926,7 @@ function Di(n, e, t, r, i) {
5926
5926
  function fe(n) {
5927
5927
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5928
5928
  }
5929
- function Ia(n, e) {
5929
+ function Ra(n, e) {
5930
5930
  for (; ; ) {
5931
5931
  if (n.nodeType == 3 && e)
5932
5932
  return n;
@@ -5940,7 +5940,7 @@ function Ia(n, e) {
5940
5940
  return null;
5941
5941
  }
5942
5942
  }
5943
- function Ra(n, e) {
5943
+ function Pa(n, e) {
5944
5944
  for (; ; ) {
5945
5945
  if (n.nodeType == 3 && e < n.nodeValue.length)
5946
5946
  return n;
@@ -5954,7 +5954,7 @@ function Ra(n, e) {
5954
5954
  return null;
5955
5955
  }
5956
5956
  }
5957
- function Pa(n, e, t) {
5957
+ function Ba(n, e, t) {
5958
5958
  for (let r = e == 0, i = e == fe(n); r || i; ) {
5959
5959
  if (n == t)
5960
5960
  return !0;
@@ -5977,13 +5977,13 @@ function _e(n, e) {
5977
5977
  let t = document.createEvent("Event");
5978
5978
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5979
5979
  }
5980
- function Ba(n) {
5980
+ function La(n) {
5981
5981
  let e = n.activeElement;
5982
5982
  for (; e && e.shadowRoot; )
5983
5983
  e = e.shadowRoot.activeElement;
5984
5984
  return e;
5985
5985
  }
5986
- function La(n, e, t) {
5986
+ function za(n, e, t) {
5987
5987
  if (n.caretPositionFromPoint)
5988
5988
  try {
5989
5989
  let r = n.caretPositionFromPoint(e, t);
@@ -5999,8 +5999,8 @@ function La(n, e, t) {
5999
5999
  }
6000
6000
  const Se = typeof navigator < "u" ? navigator : null, Ii = typeof document < "u" ? document : null, Je = Se && Se.userAgent || "", Tr = /Edge\/(\d+)/.exec(Je), ao = /MSIE \d/.exec(Je), Or = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), se = !!(ao || Or || Tr), He = ao ? document.documentMode : Or ? +Or[1] : Tr ? +Tr[1] : 0, pe = !se && /gecko\/(\d+)/i.test(Je);
6001
6001
  pe && +(/Firefox\/(\d+)/.exec(Je) || [0, 0])[1];
6002
- const vr = !se && /Chrome\/(\d+)/.exec(Je), _ = !!vr, co = vr ? +vr[1] : 0, Q = !se && !!Se && /Apple Computer/.test(Se.vendor), Ct = Q && (/Mobile\/\w+/.test(Je) || !!Se && Se.maxTouchPoints > 2), ue = Ct || (Se ? /Mac/.test(Se.platform) : !1), uo = Se ? /Win/.test(Se.platform) : !1, Ae = /Android \d/.test(Je), nn = !!Ii && "webkitFontSmoothing" in Ii.documentElement.style, za = nn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6003
- function Fa(n) {
6002
+ const vr = !se && /Chrome\/(\d+)/.exec(Je), _ = !!vr, co = vr ? +vr[1] : 0, Q = !se && !!Se && /Apple Computer/.test(Se.vendor), Ct = Q && (/Mobile\/\w+/.test(Je) || !!Se && Se.maxTouchPoints > 2), ue = Ct || (Se ? /Mac/.test(Se.platform) : !1), uo = Se ? /Win/.test(Se.platform) : !1, Ae = /Android \d/.test(Je), nn = !!Ii && "webkitFontSmoothing" in Ii.documentElement.style, Fa = nn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6003
+ function $a(n) {
6004
6004
  let e = n.defaultView && n.defaultView.visualViewport;
6005
6005
  return e ? {
6006
6006
  left: 0,
@@ -6017,7 +6017,7 @@ function Fa(n) {
6017
6017
  function Te(n, e) {
6018
6018
  return typeof n == "number" ? n : n[e];
6019
6019
  }
6020
- function $a(n) {
6020
+ function Va(n) {
6021
6021
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
6022
6022
  return {
6023
6023
  left: e.left,
@@ -6033,7 +6033,7 @@ function Ri(n, e, t) {
6033
6033
  o = Mt(o);
6034
6034
  continue;
6035
6035
  }
6036
- let l = o, a = l == s.body, c = a ? Fa(s) : $a(l), d = 0, u = 0;
6036
+ let l = o, a = l == s.body, c = a ? $a(s) : Va(l), d = 0, u = 0;
6037
6037
  if (e.top < c.top + Te(r, "top") ? u = -(c.top - e.top + Te(i, "top")) : e.bottom > c.bottom - Te(r, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Te(i, "top") - c.top : e.bottom - c.bottom + Te(i, "bottom")), e.left < c.left + Te(r, "left") ? d = -(c.left - e.left + Te(i, "left")) : e.right > c.right - Te(r, "right") && (d = e.right - c.right + Te(i, "right")), d || u)
6038
6038
  if (a)
6039
6039
  s.defaultView.scrollBy(d, u);
@@ -6049,7 +6049,7 @@ function Ri(n, e, t) {
6049
6049
  o = f == "absolute" ? o.offsetParent : Mt(o);
6050
6050
  }
6051
6051
  }
6052
- function Va(n) {
6052
+ function Ha(n) {
6053
6053
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
6054
6054
  for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
6055
6055
  let l = n.root.elementFromPoint(s, o);
@@ -6069,7 +6069,7 @@ function fo(n) {
6069
6069
  ;
6070
6070
  return e;
6071
6071
  }
6072
- function Ha({ refDOM: n, refTop: e, stack: t }) {
6072
+ function Wa({ refDOM: n, refTop: e, stack: t }) {
6073
6073
  let r = n ? n.getBoundingClientRect().top : 0;
6074
6074
  ho(t, r == 0 ? 0 : r - e);
6075
6075
  }
@@ -6080,7 +6080,7 @@ function ho(n, e) {
6080
6080
  }
6081
6081
  }
6082
6082
  let ft = null;
6083
- function Wa(n) {
6083
+ function qa(n) {
6084
6084
  if (n.setActive)
6085
6085
  return n.setActive();
6086
6086
  if (ft)
@@ -6118,9 +6118,9 @@ function po(n, e) {
6118
6118
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = u + 1);
6119
6119
  }
6120
6120
  }
6121
- return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? qa(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : po(t, i);
6121
+ return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? ja(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : po(t, i);
6122
6122
  }
6123
- function qa(n, e) {
6123
+ function ja(n, e) {
6124
6124
  let t = n.nodeValue.length, r = document.createRange(), i;
6125
6125
  for (let s = 0; s < t; s++) {
6126
6126
  r.setEnd(n, s + 1), r.setStart(n, s);
@@ -6135,11 +6135,11 @@ function qa(n, e) {
6135
6135
  function Kr(n, e) {
6136
6136
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
6137
6137
  }
6138
- function ja(n, e) {
6138
+ function Ka(n, e) {
6139
6139
  let t = n.parentNode;
6140
6140
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
6141
6141
  }
6142
- function Ka(n, e, t) {
6142
+ function Ja(n, e, t) {
6143
6143
  let { node: r, offset: i } = po(e, t), s = -1;
6144
6144
  if (r.nodeType == 1 && !r.firstChild) {
6145
6145
  let o = r.getBoundingClientRect();
@@ -6147,7 +6147,7 @@ function Ka(n, e, t) {
6147
6147
  }
6148
6148
  return n.docView.posFromDOM(r, i, s);
6149
6149
  }
6150
- function Ja(n, e, t, r) {
6150
+ function Ua(n, e, t, r) {
6151
6151
  let i = -1;
6152
6152
  for (let s = e, o = !1; s != n.dom; ) {
6153
6153
  let l = n.docView.nearestDesc(s, !0), a;
@@ -6178,8 +6178,8 @@ function mo(n, e, t) {
6178
6178
  }
6179
6179
  return n;
6180
6180
  }
6181
- function Ua(n, e) {
6182
- let t = n.dom.ownerDocument, r, i = 0, s = La(t, e.left, e.top);
6181
+ function _a(n, e) {
6182
+ let t = n.dom.ownerDocument, r, i = 0, s = za(t, e.left, e.top);
6183
6183
  s && ({ node: r, offset: i } = s);
6184
6184
  let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
6185
6185
  if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
@@ -6190,15 +6190,15 @@ function Ua(n, e) {
6190
6190
  if (Q)
6191
6191
  for (let c = o; r && c; c = Mt(c))
6192
6192
  c.draggable && (r = void 0);
6193
- if (o = ja(o, e), r) {
6193
+ if (o = Ka(o, e), r) {
6194
6194
  if (pe && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
6195
6195
  let d = r.childNodes[i], u;
6196
6196
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && i++;
6197
6197
  }
6198
6198
  let c;
6199
- nn && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ja(n, r, i, e));
6199
+ nn && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ua(n, r, i, e));
6200
6200
  }
6201
- l == null && (l = Ka(n, o, e));
6201
+ l == null && (l = Ja(n, o, e));
6202
6202
  let a = n.docView.nearestDesc(o, !0);
6203
6203
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
6204
6204
  }
@@ -6214,11 +6214,11 @@ function Ie(n, e) {
6214
6214
  }
6215
6215
  return Array.prototype.find.call(t, Pi) || n.getBoundingClientRect();
6216
6216
  }
6217
- const _a = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6217
+ const Ga = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6218
6218
  function go(n, e, t) {
6219
6219
  let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = nn || pe;
6220
6220
  if (r.nodeType == 3)
6221
- if (o && (_a.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6221
+ if (o && (Ga.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6222
6222
  let a = Ie(Oe(r, i, i), t);
6223
6223
  if (pe && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
6224
6224
  let c = Ie(Oe(r, i - 1, i - 1), -1);
@@ -6282,7 +6282,7 @@ function yo(n, e, t) {
6282
6282
  r != e && n.updateState(r), i != n.dom && i && i.focus();
6283
6283
  }
6284
6284
  }
6285
- function Ga(n, e, t) {
6285
+ function Xa(n, e, t) {
6286
6286
  let r = e.selection, i = t == "up" ? r.$from : r.$to;
6287
6287
  return yo(n, e, () => {
6288
6288
  let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
@@ -6314,13 +6314,13 @@ function Ga(n, e, t) {
6314
6314
  return !0;
6315
6315
  });
6316
6316
  }
6317
- const Xa = /[\u0590-\u08ac]/;
6318
- function Ya(n, e, t) {
6317
+ const Ya = /[\u0590-\u08ac]/;
6318
+ function Za(n, e, t) {
6319
6319
  let { $head: r } = e.selection;
6320
6320
  if (!r.parent.isTextblock)
6321
6321
  return !1;
6322
6322
  let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
6323
- return l ? !Xa.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : yo(n, e, () => {
6323
+ return l ? !Ya.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : yo(n, e, () => {
6324
6324
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
6325
6325
  l.modify("move", t, "character");
6326
6326
  let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -6332,8 +6332,8 @@ function Ya(n, e, t) {
6332
6332
  }) : r.pos == r.start() || r.pos == r.end();
6333
6333
  }
6334
6334
  let Bi = null, Li = null, zi = !1;
6335
- function Za(n, e, t) {
6336
- return Bi == e && Li == t ? zi : (Bi = e, Li = t, zi = t == "up" || t == "down" ? Ga(n, e, t) : Ya(n, e, t));
6335
+ function Qa(n, e, t) {
6336
+ return Bi == e && Li == t ? zi : (Bi = e, Li = t, zi = t == "up" || t == "down" ? Xa(n, e, t) : Za(n, e, t));
6337
6337
  }
6338
6338
  const me = 0, Fi = 1, Xe = 2, we = 3;
6339
6339
  class rn {
@@ -6723,7 +6723,7 @@ class bo extends rn {
6723
6723
  return this.widget.type.side;
6724
6724
  }
6725
6725
  }
6726
- class Qa extends rn {
6726
+ class ec extends rn {
6727
6727
  constructor(e, t, r, i) {
6728
6728
  super(e, [], t, null), this.textDOM = r, this.text = i;
6729
6729
  }
@@ -6804,7 +6804,7 @@ class We extends rn {
6804
6804
  } else d || ({ dom: d, contentDOM: u } = ut.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6805
6805
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6806
6806
  let f = d;
6807
- return d = wo(d, r, t), c ? a = new ec(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Vn(e, t, r, i, d, f, s) : new We(e, t, r, i, d, u || null, f, s, o + 1);
6807
+ return d = wo(d, r, t), c ? a = new tc(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Vn(e, t, r, i, d, f, s) : new We(e, t, r, i, d, u || null, f, s, o + 1);
6808
6808
  }
6809
6809
  parseRule() {
6810
6810
  if (this.node.type.spec.reparseInView)
@@ -6840,14 +6840,14 @@ class We extends rn {
6840
6840
  // separate step, syncs the DOM inside `this.contentDOM` to
6841
6841
  // `this.children`.
6842
6842
  updateChildren(e, t) {
6843
- let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new nc(this, o && o.node, e);
6844
- sc(this.node, this.innerDeco, (c, d, u) => {
6843
+ let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new rc(this, o && o.node, e);
6844
+ oc(this.node, this.innerDeco, (c, d, u) => {
6845
6845
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e, d) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? N.none : this.node.child(d).marks, r, e, d), a.placeWidget(c, e, i);
6846
6846
  }, (c, d, u, f) => {
6847
6847
  a.syncToMarks(c.marks, r, e, f);
6848
6848
  let h;
6849
6849
  a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, h, e) || a.updateNextNode(c, d, u, e, f, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
6850
- }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (o && this.protectLocalComposition(e, o), xo(this.contentDOM, this.children, e), Ct && oc(this.dom));
6850
+ }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (o && this.protectLocalComposition(e, o), xo(this.contentDOM, this.children, e), Ct && lc(this.dom));
6851
6851
  }
6852
6852
  localCompositionInfo(e, t) {
6853
6853
  let { from: r, to: i } = e.state.selection;
@@ -6857,7 +6857,7 @@ class We extends rn {
6857
6857
  if (!s || !this.dom.contains(s.parentNode))
6858
6858
  return null;
6859
6859
  if (this.node.inlineContent) {
6860
- let o = s.nodeValue, l = lc(this.node.content, o, r - t, i - t);
6860
+ let o = s.nodeValue, l = ac(this.node.content, o, r - t, i - t);
6861
6861
  return l < 0 ? null : { node: s, pos: l, text: o };
6862
6862
  } else
6863
6863
  return { node: s, pos: -1, text: "" };
@@ -6873,7 +6873,7 @@ class We extends rn {
6873
6873
  s.parentNode.removeChild(s.nextSibling);
6874
6874
  s.pmViewDesc && (s.pmViewDesc = void 0);
6875
6875
  }
6876
- let o = new Qa(this, s, t, i);
6876
+ let o = new ec(this, s, t, i);
6877
6877
  e.input.compositionNodes.push(o), this.children = Ar(this.children, r, r + i.length, e, o);
6878
6878
  }
6879
6879
  // If this desc must be updated to match the given node decoration,
@@ -6964,7 +6964,7 @@ class ko extends rn {
6964
6964
  return this.dom.nodeName == "IMG";
6965
6965
  }
6966
6966
  }
6967
- class ec extends We {
6967
+ class tc extends We {
6968
6968
  constructor(e, t, r, i, s, o, l, a, c, d) {
6969
6969
  super(e, t, r, i, s, o, l, c, d), this.spec = a;
6970
6970
  }
@@ -7048,11 +7048,11 @@ function So(n, e, t, r) {
7048
7048
  let a;
7049
7049
  l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Ye[0]), i = a;
7050
7050
  }
7051
- tc(i, l || Ye[0], o);
7051
+ nc(i, l || Ye[0], o);
7052
7052
  }
7053
7053
  return i;
7054
7054
  }
7055
- function tc(n, e, t) {
7055
+ function nc(n, e, t) {
7056
7056
  for (let r in e)
7057
7057
  r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
7058
7058
  for (let r in t)
@@ -7089,9 +7089,9 @@ function Vi(n) {
7089
7089
  let e = n.nextSibling;
7090
7090
  return n.parentNode.removeChild(n), e;
7091
7091
  }
7092
- class nc {
7092
+ class rc {
7093
7093
  constructor(e, t, r) {
7094
- this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = rc(e.node.content, e);
7094
+ this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = ic(e.node.content, e);
7095
7095
  }
7096
7096
  // Destroy and remove the children between the given indices in
7097
7097
  // `this.top`.
@@ -7240,7 +7240,7 @@ class nc {
7240
7240
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
7241
7241
  }
7242
7242
  }
7243
- function rc(n, e) {
7243
+ function ic(n, e) {
7244
7244
  let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
7245
7245
  e: for (; i > 0; ) {
7246
7246
  let l;
@@ -7267,10 +7267,10 @@ function rc(n, e) {
7267
7267
  }
7268
7268
  return { index: i, matched: s, matches: o.reverse() };
7269
7269
  }
7270
- function ic(n, e) {
7270
+ function sc(n, e) {
7271
7271
  return n.type.side - e.type.side;
7272
7272
  }
7273
- function sc(n, e, t, r) {
7273
+ function oc(n, e, t, r) {
7274
7274
  let i = e.locals(n), s = 0;
7275
7275
  if (i.length == 0) {
7276
7276
  for (let c = 0; c < n.childCount; c++) {
@@ -7288,7 +7288,7 @@ function sc(n, e, t, r) {
7288
7288
  }
7289
7289
  if (d)
7290
7290
  if (u) {
7291
- u.sort(ic);
7291
+ u.sort(sc);
7292
7292
  for (let g = 0; g < u.length; g++)
7293
7293
  t(u[g], c, !!a);
7294
7294
  } else
@@ -7318,13 +7318,13 @@ function sc(n, e, t, r) {
7318
7318
  r(f, m, e.forChild(s, f), h), s = p;
7319
7319
  }
7320
7320
  }
7321
- function oc(n) {
7321
+ function lc(n) {
7322
7322
  if (n.nodeName == "UL" || n.nodeName == "OL") {
7323
7323
  let e = n.style.cssText;
7324
7324
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
7325
7325
  }
7326
7326
  }
7327
- function lc(n, e, t, r) {
7327
+ function ac(n, e, t, r) {
7328
7328
  for (let i = 0, s = 0; i < n.childCount && s <= r; ) {
7329
7329
  let o = n.child(i++), l = s;
7330
7330
  if (s += o.nodeSize, !o.isText)
@@ -7368,7 +7368,7 @@ function Jr(n, e = null) {
7368
7368
  for (a = o; i && !i.node; )
7369
7369
  i = i.parent;
7370
7370
  let u = i.node;
7371
- if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && Pa(t.focusNode, t.focusOffset, i.dom))) {
7371
+ if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && Ba(t.focusNode, t.focusOffset, i.dom))) {
7372
7372
  let f = i.posBefore;
7373
7373
  c = new S(o == f ? l : r.resolve(f));
7374
7374
  }
@@ -7408,10 +7408,10 @@ function De(n, e = !1) {
7408
7408
  }
7409
7409
  }
7410
7410
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
7411
- cc(n);
7411
+ dc(n);
7412
7412
  else {
7413
7413
  let { anchor: r, head: i } = t, s, o;
7414
- Hi && !(t instanceof w) && (t.$from.parent.inlineContent || (s = Wi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Wi(n, t.to))), n.docView.setSelection(r, i, n, e), Hi && (s && qi(s), o && qi(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ac(n));
7414
+ Hi && !(t instanceof w) && (t.$from.parent.inlineContent || (s = Wi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Wi(n, t.to))), n.docView.setSelection(r, i, n, e), Hi && (s && qi(s), o && qi(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && cc(n));
7415
7415
  }
7416
7416
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7417
7417
  }
@@ -7434,7 +7434,7 @@ function ir(n) {
7434
7434
  function qi(n) {
7435
7435
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
7436
7436
  }
7437
- function ac(n) {
7437
+ function cc(n) {
7438
7438
  let e = n.dom.ownerDocument;
7439
7439
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
7440
7440
  let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
@@ -7444,7 +7444,7 @@ function ac(n) {
7444
7444
  }, 20));
7445
7445
  });
7446
7446
  }
7447
- function cc(n) {
7447
+ function dc(n) {
7448
7448
  let e = n.domSelection();
7449
7449
  if (!e)
7450
7450
  return;
@@ -7477,7 +7477,7 @@ function To(n) {
7477
7477
  return !1;
7478
7478
  }
7479
7479
  }
7480
- function dc(n) {
7480
+ function uc(n) {
7481
7481
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7482
7482
  return lt(e.node, e.offset, t.anchorNode, t.anchorOffset);
7483
7483
  }
@@ -7526,9 +7526,9 @@ function Lt(n, e) {
7526
7526
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7527
7527
  }
7528
7528
  function ht(n, e) {
7529
- return e < 0 ? uc(n) : fc(n);
7529
+ return e < 0 ? fc(n) : hc(n);
7530
7530
  }
7531
- function uc(n) {
7531
+ function fc(n) {
7532
7532
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7533
7533
  if (!t)
7534
7534
  return;
@@ -7564,7 +7564,7 @@ function uc(n) {
7564
7564
  }
7565
7565
  o ? Dr(n, t, r) : i && Dr(n, i, s);
7566
7566
  }
7567
- function fc(n) {
7567
+ function hc(n) {
7568
7568
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7569
7569
  if (!t)
7570
7570
  return;
@@ -7600,7 +7600,7 @@ function Oo(n) {
7600
7600
  let e = n.pmViewDesc;
7601
7601
  return e && e.node && e.node.isBlock;
7602
7602
  }
7603
- function hc(n, e) {
7603
+ function pc(n, e) {
7604
7604
  for (; n && e == n.childNodes.length && !tn(n); )
7605
7605
  e = J(n) + 1, n = n.parentNode;
7606
7606
  for (; n && e < n.childNodes.length; ) {
@@ -7612,7 +7612,7 @@ function hc(n, e) {
7612
7612
  n = t, e = 0;
7613
7613
  }
7614
7614
  }
7615
- function pc(n, e) {
7615
+ function mc(n, e) {
7616
7616
  for (; n && !e && !tn(n); )
7617
7617
  e = J(n), n = n.parentNode;
7618
7618
  for (; n && e; ) {
@@ -7627,7 +7627,7 @@ function pc(n, e) {
7627
7627
  function Dr(n, e, t) {
7628
7628
  if (e.nodeType != 3) {
7629
7629
  let s, o;
7630
- (o = hc(e, t)) ? (e = o, t = 0) : (s = pc(e, t)) && (e = s, t = s.nodeValue.length);
7630
+ (o = pc(e, t)) ? (e = o, t = 0) : (s = mc(e, t)) && (e = s, t = s.nodeValue.length);
7631
7631
  }
7632
7632
  let r = n.domSelection();
7633
7633
  if (!r)
@@ -7695,7 +7695,7 @@ function Gi(n, e) {
7695
7695
  function Xi(n, e, t) {
7696
7696
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
7697
7697
  }
7698
- function mc(n) {
7698
+ function gc(n) {
7699
7699
  if (!Q || n.state.selection.$head.parentOffset > 0)
7700
7700
  return !1;
7701
7701
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -7705,12 +7705,12 @@ function mc(n) {
7705
7705
  }
7706
7706
  return !1;
7707
7707
  }
7708
- function gc(n) {
7708
+ function yc(n) {
7709
7709
  let e = "";
7710
7710
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
7711
7711
  }
7712
- function yc(n, e) {
7713
- let t = e.keyCode, r = gc(e);
7712
+ function bc(n, e) {
7713
+ let t = e.keyCode, r = yc(e);
7714
7714
  if (t == 8 || ue && t == 72 && r == "c")
7715
7715
  return Gi(n, -1) || ht(n, -1);
7716
7716
  if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
@@ -7727,7 +7727,7 @@ function yc(n, e) {
7727
7727
  if (t == 38 || ue && t == 80 && r == "c")
7728
7728
  return _i(n, -1, r) || ht(n, -1);
7729
7729
  if (t == 40 || ue && t == 78 && r == "c")
7730
- return mc(n) || _i(n, 1, r) || ht(n, 1);
7730
+ return gc(n) || _i(n, 1, r) || ht(n, 1);
7731
7731
  if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
7732
7732
  return !0;
7733
7733
  }
@@ -7787,7 +7787,7 @@ function vo(n, e, t, r, i) {
7787
7787
  } else
7788
7788
  n.someProp("transformPastedHTML", (u) => {
7789
7789
  t = u(t, n);
7790
- }), o = Sc(t), nn && wc(o);
7790
+ }), o = wc(t), nn && Mc(o);
7791
7791
  let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7792
7792
  if (d && d[3])
7793
7793
  for (let u = +d[3]; u > 0; u--) {
@@ -7802,11 +7802,11 @@ function vo(n, e, t, r, i) {
7802
7802
  preserveWhitespace: !!(a || d),
7803
7803
  context: i,
7804
7804
  ruleFromNode(f) {
7805
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !bc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7805
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !kc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7806
7806
  }
7807
7807
  })), d)
7808
- l = Mc(Yi(l, +d[1], +d[2]), d[4]);
7809
- else if (l = k.maxOpen(kc(l.content, i), !0), l.openStart || l.openEnd) {
7808
+ l = Cc(Yi(l, +d[1], +d[2]), d[4]);
7809
+ else if (l = k.maxOpen(xc(l.content, i), !0), l.openStart || l.openEnd) {
7810
7810
  let u = 0, f = 0;
7811
7811
  for (let h = l.content.firstChild; u < l.openStart && !h.type.spec.isolating; u++, h = h.firstChild)
7812
7812
  ;
@@ -7818,8 +7818,8 @@ function vo(n, e, t, r, i) {
7818
7818
  l = u(l, n, a);
7819
7819
  }), l;
7820
7820
  }
7821
- const bc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7822
- function kc(n, e) {
7821
+ const kc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7822
+ function xc(n, e) {
7823
7823
  if (n.childCount < 2)
7824
7824
  return n;
7825
7825
  for (let t = e.depth; t >= 0; t--) {
@@ -7885,27 +7885,27 @@ function Io() {
7885
7885
  return Zi || (Zi = document.implementation.createHTMLDocument("title"));
7886
7886
  }
7887
7887
  let sr = null;
7888
- function xc(n) {
7888
+ function Sc(n) {
7889
7889
  let e = window.trustedTypes;
7890
7890
  return e ? (sr || (sr = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), sr.createHTML(n)) : n;
7891
7891
  }
7892
- function Sc(n) {
7892
+ function wc(n) {
7893
7893
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
7894
7894
  e && (n = n.slice(e[0].length));
7895
7895
  let t = Io().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
7896
- if ((i = r && Do[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = xc(n), i)
7896
+ if ((i = r && Do[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = Sc(n), i)
7897
7897
  for (let s = 0; s < i.length; s++)
7898
7898
  t = t.querySelector(i[s]) || t;
7899
7899
  return t;
7900
7900
  }
7901
- function wc(n) {
7901
+ function Mc(n) {
7902
7902
  let e = n.querySelectorAll(_ ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7903
7903
  for (let t = 0; t < e.length; t++) {
7904
7904
  let r = e[t];
7905
7905
  r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
7906
7906
  }
7907
7907
  }
7908
- function Mc(n, e) {
7908
+ function Cc(n, e) {
7909
7909
  if (!n.size)
7910
7910
  return n;
7911
7911
  let t = n.content.firstChild.type.schema, r;
@@ -7923,25 +7923,25 @@ function Mc(n, e) {
7923
7923
  }
7924
7924
  return new k(i, s, o);
7925
7925
  }
7926
- const te = {}, ne = {}, Cc = { touchstart: !0, touchmove: !0 };
7927
- class Tc {
7926
+ const te = {}, ne = {}, Tc = { touchstart: !0, touchmove: !0 };
7927
+ class Oc {
7928
7928
  constructor() {
7929
7929
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7930
7930
  }
7931
7931
  }
7932
- function Oc(n) {
7932
+ function vc(n) {
7933
7933
  for (let e in te) {
7934
7934
  let t = te[e];
7935
7935
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
7936
- Ec(n, r) && !Gr(n, r) && (n.editable || !(r.type in ne)) && t(n, r);
7937
- }, Cc[e] ? { passive: !0 } : void 0);
7936
+ Ac(n, r) && !Gr(n, r) && (n.editable || !(r.type in ne)) && t(n, r);
7937
+ }, Tc[e] ? { passive: !0 } : void 0);
7938
7938
  }
7939
7939
  Q && n.dom.addEventListener("input", () => null), Rr(n);
7940
7940
  }
7941
7941
  function Fe(n, e) {
7942
7942
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7943
7943
  }
7944
- function vc(n) {
7944
+ function Ec(n) {
7945
7945
  n.domObserver.stop();
7946
7946
  for (let e in n.input.eventHandlers)
7947
7947
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7959,7 +7959,7 @@ function Gr(n, e) {
7959
7959
  return r ? r(n, e) || e.defaultPrevented : !1;
7960
7960
  });
7961
7961
  }
7962
- function Ec(n, e) {
7962
+ function Ac(n, e) {
7963
7963
  if (!e.bubbles)
7964
7964
  return !0;
7965
7965
  if (e.defaultPrevented)
@@ -7969,7 +7969,7 @@ function Ec(n, e) {
7969
7969
  return !1;
7970
7970
  return !0;
7971
7971
  }
7972
- function Ac(n, e) {
7972
+ function Nc(n, e) {
7973
7973
  !Gr(n, e) && te[e.type] && (n.editable || !(e.type in ne)) && te[e.type](n, e);
7974
7974
  }
7975
7975
  ne.keydown = (n, e) => {
@@ -7980,7 +7980,7 @@ ne.keydown = (n, e) => {
7980
7980
  n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7981
7981
  n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, _e(13, "Enter"))), n.input.lastIOSEnter = 0);
7982
7982
  }, 200);
7983
- } else n.someProp("handleKeyDown", (r) => r(n, t)) || yc(n, t) ? t.preventDefault() : Fe(n, "key");
7983
+ } else n.someProp("handleKeyDown", (r) => r(n, t)) || bc(n, t) ? t.preventDefault() : Fe(n, "key");
7984
7984
  };
7985
7985
  ne.keyup = (n, e) => {
7986
7986
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -8002,7 +8002,7 @@ ne.keypress = (n, e) => {
8002
8002
  function Hn(n) {
8003
8003
  return { left: n.clientX, top: n.clientY };
8004
8004
  }
8005
- function Nc(n, e) {
8005
+ function Dc(n, e) {
8006
8006
  let t = e.x - n.clientX, r = e.y - n.clientY;
8007
8007
  return t * t + r * r < 100;
8008
8008
  }
@@ -8021,13 +8021,13 @@ function kt(n, e, t) {
8021
8021
  let r = n.state.tr.setSelection(e);
8022
8022
  r.setMeta("pointer", !0), n.dispatch(r);
8023
8023
  }
8024
- function Dc(n, e) {
8024
+ function Ic(n, e) {
8025
8025
  if (e == -1)
8026
8026
  return !1;
8027
8027
  let t = n.state.doc.resolve(e), r = t.nodeAfter;
8028
8028
  return r && r.isAtom && S.isSelectable(r) ? (kt(n, new S(t)), !0) : !1;
8029
8029
  }
8030
- function Ic(n, e) {
8030
+ function Rc(n, e) {
8031
8031
  if (e == -1)
8032
8032
  return !1;
8033
8033
  let t = n.state.selection, r, i;
@@ -8042,16 +8042,16 @@ function Ic(n, e) {
8042
8042
  }
8043
8043
  return i != null ? (kt(n, S.create(n.state.doc, i)), !0) : !1;
8044
8044
  }
8045
- function Rc(n, e, t, r, i) {
8046
- return Xr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Ic(n, t) : Dc(n, t));
8045
+ function Pc(n, e, t, r, i) {
8046
+ return Xr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Rc(n, t) : Ic(n, t));
8047
8047
  }
8048
- function Pc(n, e, t, r) {
8048
+ function Bc(n, e, t, r) {
8049
8049
  return Xr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
8050
8050
  }
8051
- function Bc(n, e, t, r) {
8052
- return Xr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Lc(n, t, r);
8051
+ function Lc(n, e, t, r) {
8052
+ return Xr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || zc(n, t, r);
8053
8053
  }
8054
- function Lc(n, e, t) {
8054
+ function zc(n, e, t) {
8055
8055
  if (t.button != 0)
8056
8056
  return !1;
8057
8057
  let r = n.state.doc;
@@ -8077,11 +8077,11 @@ te.mousedown = (n, e) => {
8077
8077
  let t = e;
8078
8078
  n.input.shiftKey = t.shiftKey;
8079
8079
  let r = Yr(n), i = Date.now(), s = "singleClick";
8080
- i - n.input.lastClick.time < 500 && Nc(t, n.input.lastClick) && !t[Ro] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
8080
+ i - n.input.lastClick.time < 500 && Dc(t, n.input.lastClick) && !t[Ro] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
8081
8081
  let o = n.posAtCoords(Hn(t));
8082
- o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new zc(n, o, t, !!r)) : (s == "doubleClick" ? Pc : Bc)(n, o.pos, o.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
8082
+ o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Fc(n, o, t, !!r)) : (s == "doubleClick" ? Bc : Lc)(n, o.pos, o.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
8083
8083
  };
8084
- class zc {
8084
+ class Fc {
8085
8085
  constructor(e, t, r, i) {
8086
8086
  this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Ro], this.allowDefault = r.shiftKey;
8087
8087
  let s, o;
@@ -8110,7 +8110,7 @@ class zc {
8110
8110
  if (this.done(), !this.view.dom.contains(e.target))
8111
8111
  return;
8112
8112
  let t = this.pos;
8113
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Hn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Rc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8113
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Hn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Pc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8114
8114
  Q && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
8115
8115
  // cursor, but still report that the node is selected
8116
8116
  // when asked through getSelection. You'll then get a
@@ -8137,12 +8137,12 @@ te.contextmenu = (n) => Yr(n);
8137
8137
  function Po(n, e) {
8138
8138
  return n.composing ? !0 : Q && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
8139
8139
  }
8140
- const Fc = Ae ? 5e3 : -1;
8140
+ const $c = Ae ? 5e3 : -1;
8141
8141
  ne.compositionstart = ne.compositionupdate = (n) => {
8142
8142
  if (!n.composing) {
8143
8143
  n.domObserver.flush();
8144
8144
  let { state: e } = n, t = e.selection.$to;
8145
- if (e.selection instanceof w && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && uo && $c(n)))
8145
+ if (e.selection instanceof w && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && uo && Vc(n)))
8146
8146
  n.markCursor = n.state.storedMarks || t.marks(), Cn(n, !0), n.markCursor = null;
8147
8147
  else if (Cn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8148
8148
  let r = n.domSelectionRange();
@@ -8160,9 +8160,9 @@ ne.compositionstart = ne.compositionupdate = (n) => {
8160
8160
  }
8161
8161
  n.input.composing = !0;
8162
8162
  }
8163
- Bo(n, Fc);
8163
+ Bo(n, $c);
8164
8164
  };
8165
- function $c(n) {
8165
+ function Vc(n) {
8166
8166
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
8167
8167
  if (!e || e.nodeType != 1 || t >= e.childNodes.length)
8168
8168
  return !1;
@@ -8176,14 +8176,14 @@ function Bo(n, e) {
8176
8176
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Cn(n), e));
8177
8177
  }
8178
8178
  function Lo(n) {
8179
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Hc()); n.input.compositionNodes.length > 0; )
8179
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Wc()); n.input.compositionNodes.length > 0; )
8180
8180
  n.input.compositionNodes.pop().markParentsDirty();
8181
8181
  }
8182
- function Vc(n) {
8182
+ function Hc(n) {
8183
8183
  let e = n.domSelectionRange();
8184
8184
  if (!e.focusNode)
8185
8185
  return null;
8186
- let t = Ia(e.focusNode, e.focusOffset), r = Ra(e.focusNode, e.focusOffset);
8186
+ let t = Ra(e.focusNode, e.focusOffset), r = Pa(e.focusNode, e.focusOffset);
8187
8187
  if (t && r && t != r) {
8188
8188
  let i = r.pmViewDesc, s = n.domObserver.lastChangedTextNode;
8189
8189
  if (t == s || r == s)
@@ -8198,7 +8198,7 @@ function Vc(n) {
8198
8198
  }
8199
8199
  return t || r;
8200
8200
  }
8201
- function Hc() {
8201
+ function Wc() {
8202
8202
  let n = document.createEvent("Event");
8203
8203
  return n.initEvent("event", !0, !0), n.timeStamp;
8204
8204
  }
@@ -8211,7 +8211,7 @@ function Cn(n, e = !1) {
8211
8211
  return !1;
8212
8212
  }
8213
8213
  }
8214
- function Wc(n, e) {
8214
+ function qc(n, e) {
8215
8215
  if (!n.dom.parentNode)
8216
8216
  return;
8217
8217
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -8221,18 +8221,18 @@ function Wc(n, e) {
8221
8221
  t.parentNode && t.parentNode.removeChild(t), n.focus();
8222
8222
  }, 50);
8223
8223
  }
8224
- const Wt = se && He < 15 || Ct && za < 604;
8224
+ const Wt = se && He < 15 || Ct && Fa < 604;
8225
8225
  te.copy = ne.cut = (n, e) => {
8226
8226
  let t = e, r = n.state.selection, i = t.type == "cut";
8227
8227
  if (r.empty)
8228
8228
  return;
8229
8229
  let s = Wt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = _r(n, o);
8230
- s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Wc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8230
+ s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : qc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8231
8231
  };
8232
- function qc(n) {
8232
+ function jc(n) {
8233
8233
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
8234
8234
  }
8235
- function jc(n, e) {
8235
+ function Kc(n, e) {
8236
8236
  if (!n.dom.parentNode)
8237
8237
  return;
8238
8238
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -8248,7 +8248,7 @@ function qt(n, e, t, r, i) {
8248
8248
  return !0;
8249
8249
  if (!s)
8250
8250
  return !1;
8251
- let o = qc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8251
+ let o = jc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8252
8252
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
8253
8253
  }
8254
8254
  function zo(n) {
@@ -8263,19 +8263,19 @@ ne.paste = (n, e) => {
8263
8263
  if (n.composing && !Ae)
8264
8264
  return;
8265
8265
  let r = Wt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8266
- r && qt(n, zo(r), r.getData("text/html"), i, t) ? t.preventDefault() : jc(n, t);
8266
+ r && qt(n, zo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Kc(n, t);
8267
8267
  };
8268
8268
  class Fo {
8269
8269
  constructor(e, t, r) {
8270
8270
  this.slice = e, this.move = t, this.node = r;
8271
8271
  }
8272
8272
  }
8273
- const Kc = ue ? "altKey" : "ctrlKey";
8273
+ const Jc = ue ? "altKey" : "ctrlKey";
8274
8274
  function $o(n, e) {
8275
8275
  let t;
8276
8276
  return n.someProp("dragCopies", (r) => {
8277
8277
  t = t || r(e);
8278
- }), t != null ? !t : !e[Kc];
8278
+ }), t != null ? !t : !e[Jc];
8279
8279
  }
8280
8280
  te.dragstart = (n, e) => {
8281
8281
  let t = e, r = n.input.mouseDown;
@@ -8302,12 +8302,12 @@ te.dragend = (n) => {
8302
8302
  ne.dragover = ne.dragenter = (n, e) => e.preventDefault();
8303
8303
  ne.drop = (n, e) => {
8304
8304
  try {
8305
- Jc(n, e, n.dragging);
8305
+ Uc(n, e, n.dragging);
8306
8306
  } finally {
8307
8307
  n.dragging = null;
8308
8308
  }
8309
8309
  };
8310
- function Jc(n, e, t) {
8310
+ function Uc(n, e, t) {
8311
8311
  if (!e.dataTransfer)
8312
8312
  return;
8313
8313
  let r = n.posAtCoords(Hn(e));
@@ -8563,7 +8563,7 @@ class $ {
8563
8563
  let a = this.local[l].map(e, r, i);
8564
8564
  a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
8565
8565
  }
8566
- return this.children.length ? Uc(this.children, o || [], e, t, r, i, s) : o ? new $(o.sort(rt), mt) : Z;
8566
+ return this.children.length ? _c(this.children, o || [], e, t, r, i, s) : o ? new $(o.sort(rt), mt) : Z;
8567
8567
  }
8568
8568
  /**
8569
8569
  Add the given array of decorations to the ones in the set,
@@ -8741,7 +8741,7 @@ class Be {
8741
8741
  this.members[t].forEachSet(e);
8742
8742
  }
8743
8743
  }
8744
- function Uc(n, e, t, r, i, s, o) {
8744
+ function _c(n, e, t, r, i, s, o) {
8745
8745
  let l = n.slice();
8746
8746
  for (let c = 0, d = s; c < t.maps.length; c++) {
8747
8747
  let u = 0;
@@ -8777,7 +8777,7 @@ function Uc(n, e, t, r, i, s, o) {
8777
8777
  a = !0;
8778
8778
  }
8779
8779
  if (a) {
8780
- let c = _c(l, n, e, t, i, s, o), d = On(c, r, 0, o);
8780
+ let c = Gc(l, n, e, t, i, s, o), d = On(c, r, 0, o);
8781
8781
  e = d.local;
8782
8782
  for (let u = 0; u < l.length; u += 3)
8783
8783
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -8800,7 +8800,7 @@ function Vo(n, e) {
8800
8800
  }
8801
8801
  return t;
8802
8802
  }
8803
- function _c(n, e, t, r, i, s, o) {
8803
+ function Gc(n, e, t, r, i, s, o) {
8804
8804
  function l(a, c) {
8805
8805
  for (let d = 0; d < a.local.length; d++) {
8806
8806
  let u = a.local[d].map(r, i, c);
@@ -8875,15 +8875,15 @@ function or(n) {
8875
8875
  r && r != Z && e.push(r);
8876
8876
  }), n.cursorWrapper && e.push($.create(n.state.doc, [n.cursorWrapper.deco])), Be.from(e);
8877
8877
  }
8878
- const Gc = {
8878
+ const Xc = {
8879
8879
  childList: !0,
8880
8880
  characterData: !0,
8881
8881
  characterDataOldValue: !0,
8882
8882
  attributes: !0,
8883
8883
  attributeOldValue: !0,
8884
8884
  subtree: !0
8885
- }, Xc = se && He <= 11;
8886
- class Yc {
8885
+ }, Yc = se && He <= 11;
8886
+ class Zc {
8887
8887
  constructor() {
8888
8888
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
8889
8889
  }
@@ -8897,13 +8897,13 @@ class Yc {
8897
8897
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8898
8898
  }
8899
8899
  }
8900
- class Zc {
8900
+ class Qc {
8901
8901
  constructor(e, t) {
8902
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Yc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8902
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Zc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8903
8903
  for (let i = 0; i < r.length; i++)
8904
8904
  this.queue.push(r[i]);
8905
8905
  se && He <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : Q && e.composing && r.some((i) => i.type == "childList" && i.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
8906
- }), Xc && (this.onCharData = (r) => {
8906
+ }), Yc && (this.onCharData = (r) => {
8907
8907
  this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
8908
8908
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
8909
8909
  }
@@ -8916,7 +8916,7 @@ class Zc {
8916
8916
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8917
8917
  }
8918
8918
  start() {
8919
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Gc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8919
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Xc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8920
8920
  }
8921
8921
  stop() {
8922
8922
  if (this.observer) {
@@ -9011,12 +9011,12 @@ class Zc {
9011
9011
  let { focusNode: u } = this.currentSelection;
9012
9012
  for (let f of d) {
9013
9013
  let h = f.parentNode;
9014
- h && h.nodeName == "LI" && (!u || td(e, u) != h) && f.remove();
9014
+ h && h.nodeName == "LI" && (!u || nd(e, u) != h) && f.remove();
9015
9015
  }
9016
9016
  }
9017
9017
  }
9018
9018
  let c = null;
9019
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && $n(r) && (c = Jr(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, De(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Qc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, nd(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || De(e), this.currentSelection.set(r));
9019
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && $n(r) && (c = Jr(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, De(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), ed(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, rd(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || De(e), this.currentSelection.set(r));
9020
9020
  }
9021
9021
  registerMutation(e, t) {
9022
9022
  if (t.indexOf(e.target) > -1)
@@ -9052,7 +9052,7 @@ class Zc {
9052
9052
  }
9053
9053
  }
9054
9054
  let es = /* @__PURE__ */ new WeakMap(), ts = !1;
9055
- function Qc(n) {
9055
+ function ed(n) {
9056
9056
  if (!es.has(n) && (es.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
9057
9057
  if (n.requiresGeckoHackNode = pe, ts)
9058
9058
  return;
@@ -9063,7 +9063,7 @@ function ns(n, e) {
9063
9063
  let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
9064
9064
  return lt(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
9065
9065
  }
9066
- function ed(n, e) {
9066
+ function td(n, e) {
9067
9067
  if (e.getComposedRanges) {
9068
9068
  let i = e.getComposedRanges(n.root)[0];
9069
9069
  if (i)
@@ -9075,7 +9075,7 @@ function ed(n, e) {
9075
9075
  }
9076
9076
  return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? ns(n, t) : null;
9077
9077
  }
9078
- function td(n, e) {
9078
+ function nd(n, e) {
9079
9079
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
9080
9080
  let r = n.docView.nearestDesc(t, !0);
9081
9081
  if (r && r.node.isBlock)
@@ -9083,7 +9083,7 @@ function td(n, e) {
9083
9083
  }
9084
9084
  return null;
9085
9085
  }
9086
- function nd(n, e) {
9086
+ function rd(n, e) {
9087
9087
  var t;
9088
9088
  let { focusNode: r, focusOffset: i } = n.domSelectionRange();
9089
9089
  for (let s of e)
@@ -9104,7 +9104,7 @@ function nd(n, e) {
9104
9104
  s.parentNode.removeChild(s);
9105
9105
  }
9106
9106
  }
9107
- function rd(n, e, t) {
9107
+ function id(n, e, t) {
9108
9108
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
9109
9109
  if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], $n(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
9110
9110
  for (let g = s; g > i; g--) {
@@ -9124,7 +9124,7 @@ function rd(n, e, t) {
9124
9124
  to: s,
9125
9125
  preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
9126
9126
  findPositions: c,
9127
- ruleFromNode: id,
9127
+ ruleFromNode: sd,
9128
9128
  context: h
9129
9129
  });
9130
9130
  if (c && c[0].pos != null) {
@@ -9133,7 +9133,7 @@ function rd(n, e, t) {
9133
9133
  }
9134
9134
  return { doc: m, sel: p, from: o, to: l };
9135
9135
  }
9136
- function id(n) {
9136
+ function sd(n) {
9137
9137
  let e = n.pmViewDesc;
9138
9138
  if (e)
9139
9139
  return e.parseRule();
@@ -9147,8 +9147,8 @@ function id(n) {
9147
9147
  return { ignore: !0 };
9148
9148
  return null;
9149
9149
  }
9150
- const sd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9151
- function od(n, e, t, r, i) {
9150
+ const od = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9151
+ function ld(n, e, t, r, i) {
9152
9152
  let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
9153
9153
  if (n.input.compositionPendingChanges = 0, e < 0) {
9154
9154
  let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, A = Jr(n, C);
@@ -9162,10 +9162,10 @@ function od(n, e, t, r, i) {
9162
9162
  }
9163
9163
  let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
9164
9164
  e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
9165
- let a = n.state.selection, c = rd(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9165
+ let a = n.state.selection, c = id(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9166
9166
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
9167
- let p = cd(u.content, c.doc.content, c.from, f, h);
9168
- if (p && n.input.domChangeCount++, (Ct && n.input.lastIOSEnter > Date.now() - 225 || Ae) && i.some((C) => C.nodeType == 1 && !sd.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, _e(13, "Enter")))) {
9167
+ let p = dd(u.content, c.doc.content, c.from, f, h);
9168
+ if (p && n.input.domChangeCount++, (Ct && n.input.lastIOSEnter > Date.now() - 225 || Ae) && i.some((C) => C.nodeType == 1 && !od.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, _e(13, "Enter")))) {
9169
9169
  n.input.lastIOSEnter = 0;
9170
9170
  return;
9171
9171
  }
@@ -9188,7 +9188,7 @@ function od(n, e, t, r, i) {
9188
9188
  n.input.lastIOSEnter = 0;
9189
9189
  return;
9190
9190
  }
9191
- if (n.state.selection.anchor > p.start && ad(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, _e(8, "Backspace")))) {
9191
+ if (n.state.selection.anchor > p.start && cd(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, _e(8, "Backspace")))) {
9192
9192
  Ae && _ && n.domObserver.suppressSelectionUpdates();
9193
9193
  return;
9194
9194
  }
@@ -9212,7 +9212,7 @@ function od(n, e, t, r, i) {
9212
9212
  A && C.ensureMarks(A), n.dispatch(C);
9213
9213
  } else if (
9214
9214
  // Adding or removing a mark
9215
- p.endA == p.endB && (F = ld(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9215
+ p.endA == p.endB && (F = ad(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9216
9216
  ) {
9217
9217
  let C = D(n.state.tr);
9218
9218
  F.type == "add" ? C.addMark(M, I, F.mark) : C.removeMark(M, I, F.mark), n.dispatch(C);
@@ -9227,7 +9227,7 @@ function od(n, e, t, r, i) {
9227
9227
  function rs(n, e, t) {
9228
9228
  return Math.max(t.anchor, t.head) > e.content.size ? null : Ur(n, e.resolve(t.anchor), e.resolve(t.head));
9229
9229
  }
9230
- function ld(n, e) {
9230
+ function ad(n, e) {
9231
9231
  let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
9232
9232
  for (let d = 0; d < r.length; d++)
9233
9233
  i = r[d].removeFromSet(i);
@@ -9245,7 +9245,7 @@ function ld(n, e) {
9245
9245
  if (b.from(c).eq(n))
9246
9246
  return { mark: l, type: o };
9247
9247
  }
9248
- function ad(n, e, t, r, i) {
9248
+ function cd(n, e, t, r, i) {
9249
9249
  if (
9250
9250
  // The content must have shrunk
9251
9251
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -9273,7 +9273,7 @@ function lr(n, e, t) {
9273
9273
  }
9274
9274
  return i;
9275
9275
  }
9276
- function cd(n, e, t, r, i) {
9276
+ function dd(n, e, t, r, i) {
9277
9277
  let s = n.findDiffStart(e, t);
9278
9278
  if (s == null)
9279
9279
  return null;
@@ -9306,7 +9306,7 @@ class qo {
9306
9306
  added to the document.
9307
9307
  */
9308
9308
  constructor(e, t) {
9309
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Tc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ds), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = as(this), ls(this), this.nodeViews = cs(this), this.docView = $i(this.state.doc, ss(this), or(this), this.dom, this), this.domObserver = new Zc(this, (r, i, s, o) => od(this, r, i, s, o)), this.domObserver.start(), Oc(this), this.updatePluginViews();
9309
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Oc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ds), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = as(this), ls(this), this.nodeViews = cs(this), this.docView = $i(this.state.doc, ss(this), or(this), this.dom, this), this.domObserver = new Qc(this, (r, i, s, o) => ld(this, r, i, s, o)), this.domObserver.start(), vc(this), this.updatePluginViews();
9310
9310
  }
9311
9311
  /**
9312
9312
  Holds `true` when a
@@ -9366,22 +9366,22 @@ class qo {
9366
9366
  let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
9367
9367
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9368
9368
  let h = cs(this);
9369
- ud(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9369
+ fd(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9370
9370
  }
9371
9371
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Rr(this), this.editable = as(this), ls(this);
9372
9372
  let a = or(this), c = ss(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
9373
9373
  (u || !e.selection.eq(i.selection)) && (o = !0);
9374
- let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Va(this);
9374
+ let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ha(this);
9375
9375
  if (o) {
9376
9376
  this.domObserver.stop();
9377
- let h = u && (se || _) && !this.composing && !i.selection.empty && !e.selection.empty && dd(i.selection, e.selection);
9377
+ let h = u && (se || _) && !this.composing && !i.selection.empty && !e.selection.empty && ud(i.selection, e.selection);
9378
9378
  if (u) {
9379
9379
  let p = _ ? this.trackWrites = this.domSelectionRange().focusNode : null;
9380
- this.composing && (this.input.compositionNode = Vc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = $i(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9380
+ this.composing && (this.input.compositionNode = Hc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = $i(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9381
9381
  }
9382
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && dc(this)) ? De(this, h) : (Co(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9382
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && uc(this)) ? De(this, h) : (Co(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9383
9383
  }
9384
- this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Ha(f);
9384
+ this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Wa(f);
9385
9385
  }
9386
9386
  /**
9387
9387
  @internal
@@ -9468,7 +9468,7 @@ class qo {
9468
9468
  Focus the editor.
9469
9469
  */
9470
9470
  focus() {
9471
- this.domObserver.stop(), this.editable && Wa(this.dom), De(this), this.domObserver.start();
9471
+ this.domObserver.stop(), this.editable && qa(this.dom), De(this), this.domObserver.start();
9472
9472
  }
9473
9473
  /**
9474
9474
  Get the document root in which the editor exists. This will
@@ -9502,7 +9502,7 @@ class qo {
9502
9502
  the top level, not in any node.
9503
9503
  */
9504
9504
  posAtCoords(e) {
9505
- return Ua(this, e);
9505
+ return _a(this, e);
9506
9506
  }
9507
9507
  /**
9508
9508
  Returns the viewport rectangle at a given document position.
@@ -9567,7 +9567,7 @@ class qo {
9567
9567
  pass a different state.
9568
9568
  */
9569
9569
  endOfTextblock(e, t) {
9570
- return Za(this, t || this.state, e);
9570
+ return Qa(this, t || this.state, e);
9571
9571
  }
9572
9572
  /**
9573
9573
  Run the editor's paste logic with the given HTML string. The
@@ -9599,7 +9599,7 @@ class qo {
9599
9599
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9600
9600
  */
9601
9601
  destroy() {
9602
- this.docView && (vc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], or(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Na());
9602
+ this.docView && (Ec(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], or(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Da());
9603
9603
  }
9604
9604
  /**
9605
9605
  This is true when the view has been
@@ -9613,14 +9613,14 @@ class qo {
9613
9613
  Used for testing.
9614
9614
  */
9615
9615
  dispatchEvent(e) {
9616
- return Ac(this, e);
9616
+ return Nc(this, e);
9617
9617
  }
9618
9618
  /**
9619
9619
  @internal
9620
9620
  */
9621
9621
  domSelectionRange() {
9622
9622
  let e = this.domSelection();
9623
- return e ? Q && this.root.nodeType === 11 && Ba(this.dom.ownerDocument) == this.dom && ed(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9623
+ return e ? Q && this.root.nodeType === 11 && La(this.dom.ownerDocument) == this.dom && td(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9624
9624
  }
9625
9625
  /**
9626
9626
  @internal
@@ -9651,7 +9651,7 @@ function ls(n) {
9651
9651
  function as(n) {
9652
9652
  return !n.someProp("editable", (e) => e(n.state) === !1);
9653
9653
  }
9654
- function dd(n, e) {
9654
+ function ud(n, e) {
9655
9655
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
9656
9656
  return n.$anchor.start(t) != e.$anchor.start(t);
9657
9657
  }
@@ -9663,7 +9663,7 @@ function cs(n) {
9663
9663
  }
9664
9664
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
9665
9665
  }
9666
- function ud(n, e) {
9666
+ function fd(n, e) {
9667
9667
  let t = 0, r = 0;
9668
9668
  for (let i in n) {
9669
9669
  if (n[i] != e[i])
@@ -9756,18 +9756,18 @@ var je = {
9756
9756
  220: "|",
9757
9757
  221: "}",
9758
9758
  222: '"'
9759
- }, fd = typeof navigator < "u" && /Mac/.test(navigator.platform), hd = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9759
+ }, hd = typeof navigator < "u" && /Mac/.test(navigator.platform), pd = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9760
9760
  for (var U = 0; U < 10; U++) je[48 + U] = je[96 + U] = String(U);
9761
9761
  for (var U = 1; U <= 24; U++) je[U + 111] = "F" + U;
9762
9762
  for (var U = 65; U <= 90; U++)
9763
9763
  je[U] = String.fromCharCode(U + 32), vn[U] = String.fromCharCode(U);
9764
9764
  for (var ar in je) vn.hasOwnProperty(ar) || (vn[ar] = je[ar]);
9765
- function pd(n) {
9766
- var e = fd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || hd && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? vn : je)[n.keyCode] || n.key || "Unidentified";
9765
+ function md(n) {
9766
+ var e = hd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || pd && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? vn : je)[n.keyCode] || n.key || "Unidentified";
9767
9767
  return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
9768
9768
  }
9769
- const md = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), gd = typeof navigator < "u" && /Win/.test(navigator.platform);
9770
- function yd(n) {
9769
+ const gd = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), yd = typeof navigator < "u" && /Win/.test(navigator.platform);
9770
+ function bd(n) {
9771
9771
  let e = n.split(/-(?!$)/), t = e[e.length - 1];
9772
9772
  t == "Space" && (t = " ");
9773
9773
  let r, i, s, o;
@@ -9782,28 +9782,28 @@ function yd(n) {
9782
9782
  else if (/^s(hift)?$/i.test(a))
9783
9783
  s = !0;
9784
9784
  else if (/^mod$/i.test(a))
9785
- md ? o = !0 : i = !0;
9785
+ gd ? o = !0 : i = !0;
9786
9786
  else
9787
9787
  throw new Error("Unrecognized modifier name: " + a);
9788
9788
  }
9789
9789
  return r && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
9790
9790
  }
9791
- function bd(n) {
9791
+ function kd(n) {
9792
9792
  let e = /* @__PURE__ */ Object.create(null);
9793
9793
  for (let t in n)
9794
- e[yd(t)] = n[t];
9794
+ e[bd(t)] = n[t];
9795
9795
  return e;
9796
9796
  }
9797
9797
  function cr(n, e, t = !0) {
9798
9798
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9799
9799
  }
9800
- function kd(n) {
9800
+ function xd(n) {
9801
9801
  return new oe({ props: { handleKeyDown: jo(n) } });
9802
9802
  }
9803
9803
  function jo(n) {
9804
- let e = bd(n);
9804
+ let e = kd(n);
9805
9805
  return function(t, r) {
9806
- let i = pd(r), s, o = e[cr(i, r)];
9806
+ let i = md(r), s, o = e[cr(i, r)];
9807
9807
  if (o && o(t.state, t.dispatch, t))
9808
9808
  return !0;
9809
9809
  if (i.length == 1 && i != " ") {
@@ -9813,7 +9813,7 @@ function jo(n) {
9813
9813
  return !0;
9814
9814
  }
9815
9815
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9816
- !(gd && r.ctrlKey && r.altKey) && (s = je[r.keyCode]) && s != i) {
9816
+ !(yd && r.ctrlKey && r.altKey) && (s = je[r.keyCode]) && s != i) {
9817
9817
  let l = e[cr(s, r)];
9818
9818
  if (l && l(t.state, t.dispatch, t))
9819
9819
  return !0;
@@ -9853,13 +9853,13 @@ const Jo = (n, e, t) => {
9853
9853
  break;
9854
9854
  }
9855
9855
  return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
9856
- }, xd = (n, e, t) => {
9856
+ }, Sd = (n, e, t) => {
9857
9857
  let r = Ko(n, t);
9858
9858
  if (!r)
9859
9859
  return !1;
9860
9860
  let i = ti(r);
9861
9861
  return i ? Uo(n, i, e) : !1;
9862
- }, Sd = (n, e, t) => {
9862
+ }, wd = (n, e, t) => {
9863
9863
  let r = Go(n, t);
9864
9864
  if (!r)
9865
9865
  return !1;
@@ -9973,7 +9973,7 @@ function ni(n) {
9973
9973
  }
9974
9974
  return null;
9975
9975
  }
9976
- const wd = (n, e) => {
9976
+ const Md = (n, e) => {
9977
9977
  let t = n.selection, r = t instanceof S, i;
9978
9978
  if (r) {
9979
9979
  if (t.node.isTextblock || !Ke(n.doc, t.from))
@@ -9986,7 +9986,7 @@ const wd = (n, e) => {
9986
9986
  r && s.setSelection(S.create(s.doc, i - n.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
9987
9987
  }
9988
9988
  return !0;
9989
- }, Md = (n, e) => {
9989
+ }, Cd = (n, e) => {
9990
9990
  let t = n.selection, r;
9991
9991
  if (t instanceof S) {
9992
9992
  if (t.node.isTextblock || !Ke(n.doc, t.to))
@@ -9995,7 +9995,7 @@ const wd = (n, e) => {
9995
9995
  } else if (r = Ln(n.doc, t.to, 1), r == null)
9996
9996
  return !1;
9997
9997
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9998
- }, Cd = (n, e) => {
9998
+ }, Td = (n, e) => {
9999
9999
  let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && Ot(i);
10000
10000
  return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
10001
10001
  }, Zo = (n, e) => {
@@ -10011,7 +10011,7 @@ function ri(n) {
10011
10011
  }
10012
10012
  return null;
10013
10013
  }
10014
- const Td = (n, e) => {
10014
+ const Od = (n, e) => {
10015
10015
  let { $head: t, $anchor: r } = n.selection;
10016
10016
  if (!t.parent.type.spec.code || !t.sameParent(r))
10017
10017
  return !1;
@@ -10047,7 +10047,7 @@ const Td = (n, e) => {
10047
10047
  let r = t.blockRange(), i = r && Ot(r);
10048
10048
  return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
10049
10049
  };
10050
- function Od(n) {
10050
+ function vd(n) {
10051
10051
  return (e, t) => {
10052
10052
  let { $from: r, $to: i } = e.selection;
10053
10053
  if (e.selection instanceof S && e.selection.node.isBlock)
@@ -10076,17 +10076,17 @@ function Od(n) {
10076
10076
  return t && t(d.scrollIntoView()), !0;
10077
10077
  };
10078
10078
  }
10079
- const vd = Od(), Ed = (n, e) => {
10079
+ const Ed = vd(), Ad = (n, e) => {
10080
10080
  let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
10081
10081
  return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(S.create(n.doc, i))), !0);
10082
10082
  };
10083
- function Ad(n, e, t) {
10083
+ function Nd(n, e, t) {
10084
10084
  let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
10085
10085
  return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || Ke(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
10086
10086
  }
10087
10087
  function tl(n, e, t, r) {
10088
10088
  let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
10089
- if (!a && Ad(n, e, t))
10089
+ if (!a && Nd(n, e, t))
10090
10090
  return !0;
10091
10091
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
10092
10092
  if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
@@ -10134,8 +10134,8 @@ function nl(n) {
10134
10134
  return i.node(s).isTextblock ? (t && t(e.tr.setSelection(w.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
10135
10135
  };
10136
10136
  }
10137
- const Nd = nl(-1), Dd = nl(1);
10138
- function Id(n, e = null) {
10137
+ const Dd = nl(-1), Id = nl(1);
10138
+ function Rd(n, e = null) {
10139
10139
  return function(t, r) {
10140
10140
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && qr(o, n, e);
10141
10141
  return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
@@ -10181,18 +10181,18 @@ function ii(...n) {
10181
10181
  }
10182
10182
  ii(ei, Jo, _o);
10183
10183
  ii(ei, Xo, Yo);
10184
- ii(Zo, Qo, el, vd);
10184
+ ii(Zo, Qo, el, Ed);
10185
10185
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
10186
- function Rd(n, e = null) {
10186
+ function Pd(n, e = null) {
10187
10187
  return function(t, r) {
10188
10188
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s);
10189
10189
  if (!o)
10190
10190
  return !1;
10191
10191
  let l = r ? t.tr : null;
10192
- return Pd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10192
+ return Bd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10193
10193
  };
10194
10194
  }
10195
- function Pd(n, e, t, r = null) {
10195
+ function Bd(n, e, t, r = null) {
10196
10196
  let i = !1, s = e, o = e.$from.doc;
10197
10197
  if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
10198
10198
  if (e.$from.index(e.depth - 1) == 0)
@@ -10201,9 +10201,9 @@ function Pd(n, e, t, r = null) {
10201
10201
  s = new xn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new xn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
10202
10202
  }
10203
10203
  let l = qr(s, t, r, e);
10204
- return l ? (n && Bd(n, e, l, i, t), !0) : !1;
10204
+ return l ? (n && Ld(n, e, l, i, t), !0) : !1;
10205
10205
  }
10206
- function Bd(n, e, t, r, i) {
10206
+ function Ld(n, e, t, r, i) {
10207
10207
  let s = b.empty;
10208
10208
  for (let d = t.length - 1; d >= 0; d--)
10209
10209
  s = b.from(t[d].type.create(t[d].attrs, s));
@@ -10216,13 +10216,13 @@ function Bd(n, e, t, r, i) {
10216
10216
  !f && Ne(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
10217
10217
  return n;
10218
10218
  }
10219
- function Ld(n) {
10219
+ function zd(n) {
10220
10220
  return function(e, t) {
10221
10221
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == n);
10222
- return s ? t ? r.node(s.depth - 1).type == n ? zd(e, t, n, s) : Fd(e, t, s) : !0 : !1;
10222
+ return s ? t ? r.node(s.depth - 1).type == n ? Fd(e, t, n, s) : $d(e, t, s) : !0 : !1;
10223
10223
  };
10224
10224
  }
10225
- function zd(n, e, t, r) {
10225
+ function Fd(n, e, t, r) {
10226
10226
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
10227
10227
  s < o && (i.step(new V(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new xn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
10228
10228
  const l = Ot(r);
@@ -10232,7 +10232,7 @@ function zd(n, e, t, r) {
10232
10232
  let a = i.doc.resolve(i.mapping.map(s, -1) - 1);
10233
10233
  return Ke(i.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && i.join(a.pos), e(i.scrollIntoView()), !0;
10234
10234
  }
10235
- function Fd(n, e, t) {
10235
+ function $d(n, e, t) {
10236
10236
  let r = n.tr, i = t.parent;
10237
10237
  for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
10238
10238
  h -= i.child(p).nodeSize, r.delete(h - 1, h + 1);
@@ -10245,7 +10245,7 @@ function Fd(n, e, t) {
10245
10245
  let u = s.pos, f = u + o.nodeSize;
10246
10246
  return r.step(new V(u - (l ? 1 : 0), f + (a ? 1 : 0), u + 1, f - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
10247
10247
  }
10248
- function $d(n) {
10248
+ function Vd(n) {
10249
10249
  return function(e, t) {
10250
10250
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == n);
10251
10251
  if (!s)
@@ -10348,7 +10348,7 @@ class qn {
10348
10348
  return l;
10349
10349
  }
10350
10350
  }
10351
- class Vd {
10351
+ class Hd {
10352
10352
  constructor() {
10353
10353
  this.callbacks = {};
10354
10354
  }
@@ -10485,10 +10485,10 @@ function il(n) {
10485
10485
  function E(n, e = void 0, ...t) {
10486
10486
  return il(n) ? e ? n.bind(e)(...t) : n(...t) : n;
10487
10487
  }
10488
- function Hd(n = {}) {
10488
+ function Wd(n = {}) {
10489
10489
  return Object.keys(n).length === 0 && n.constructor === Object;
10490
10490
  }
10491
- function Wd(n) {
10491
+ function qd(n) {
10492
10492
  return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
10493
10493
  }
10494
10494
  function fs(n, e) {
@@ -10499,7 +10499,7 @@ function fs(n, e) {
10499
10499
  if (r === !1)
10500
10500
  return !1;
10501
10501
  const i = e.reduce((s, o) => {
10502
- const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Wd(t.getAttribute(o.name));
10502
+ const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : qd(t.getAttribute(o.name));
10503
10503
  return l == null ? s : {
10504
10504
  ...s,
10505
10505
  [o.name]: l
@@ -10512,10 +10512,10 @@ function fs(n, e) {
10512
10512
  function hs(n) {
10513
10513
  return Object.fromEntries(
10514
10514
  // @ts-ignore
10515
- Object.entries(n).filter(([e, t]) => e === "attrs" && Hd(t) ? !1 : t != null)
10515
+ Object.entries(n).filter(([e, t]) => e === "attrs" && Wd(t) ? !1 : t != null)
10516
10516
  );
10517
10517
  }
10518
- function qd(n, e) {
10518
+ function jd(n, e) {
10519
10519
  var t;
10520
10520
  const r = rl(n), { nodeExtensions: i, markExtensions: s } = jn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10521
10521
  const d = r.filter((y) => y.type === c.name), u = {
@@ -10603,7 +10603,7 @@ function si(n, e) {
10603
10603
  const t = ut.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
10604
10604
  return i.appendChild(t), i.innerHTML;
10605
10605
  }
10606
- const jd = (n, e = 500) => {
10606
+ const Kd = (n, e = 500) => {
10607
10607
  let t = "";
10608
10608
  const r = n.parentOffset;
10609
10609
  return n.parent.nodesBetween(Math.max(0, r - e), r, (i, s, o, l) => {
@@ -10625,7 +10625,7 @@ class Kn {
10625
10625
  this.find = e.find, this.handler = e.handler;
10626
10626
  }
10627
10627
  }
10628
- const Kd = (n, e) => {
10628
+ const Jd = (n, e) => {
10629
10629
  if (oi(e))
10630
10630
  return e.exec(n);
10631
10631
  const t = e(n);
@@ -10646,11 +10646,11 @@ function an(n) {
10646
10646
  )
10647
10647
  return !1;
10648
10648
  let d = !1;
10649
- const u = jd(c) + s;
10649
+ const u = Kd(c) + s;
10650
10650
  return o.forEach((f) => {
10651
10651
  if (d)
10652
10652
  return;
10653
- const h = Kd(u, f.find);
10653
+ const h = Jd(u, f.find);
10654
10654
  if (!h)
10655
10655
  return;
10656
10656
  const p = a.state.tr, m = Wn({
@@ -10678,7 +10678,7 @@ function an(n) {
10678
10678
  }), a.dispatch(p), d = !0);
10679
10679
  }), d;
10680
10680
  }
10681
- function Jd(n) {
10681
+ function Ud(n) {
10682
10682
  const { editor: e, rules: t } = n, r = new oe({
10683
10683
  state: {
10684
10684
  init() {
@@ -10750,11 +10750,11 @@ function Jd(n) {
10750
10750
  });
10751
10751
  return r;
10752
10752
  }
10753
- function Ud(n) {
10753
+ function _d(n) {
10754
10754
  return Object.prototype.toString.call(n).slice(8, -1);
10755
10755
  }
10756
10756
  function cn(n) {
10757
- return Ud(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10757
+ return _d(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10758
10758
  }
10759
10759
  function Jn(n, e) {
10760
10760
  const t = { ...n };
@@ -10808,15 +10808,15 @@ class Me {
10808
10808
  return !1;
10809
10809
  }
10810
10810
  }
10811
- function _d(n) {
10811
+ function Gd(n) {
10812
10812
  return typeof n == "number";
10813
10813
  }
10814
- class Gd {
10814
+ class Xd {
10815
10815
  constructor(e) {
10816
10816
  this.find = e.find, this.handler = e.handler;
10817
10817
  }
10818
10818
  }
10819
- const Xd = (n, e, t) => {
10819
+ const Yd = (n, e, t) => {
10820
10820
  if (oi(e))
10821
10821
  return [...n.matchAll(e)];
10822
10822
  const r = e(n, t);
@@ -10825,7 +10825,7 @@ const Xd = (n, e, t) => {
10825
10825
  return s.index = i.index, s.input = n, s.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(i.replaceWith)), s;
10826
10826
  }) : [];
10827
10827
  };
10828
- function Yd(n) {
10828
+ function Zd(n) {
10829
10829
  const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new qn({
10830
10830
  editor: e,
10831
10831
  state: t
@@ -10834,7 +10834,7 @@ function Yd(n) {
10834
10834
  if (!h.isTextblock || h.type.spec.code)
10835
10835
  return;
10836
10836
  const m = Math.max(r, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
10837
- Xd(y, s.find, o).forEach((M) => {
10837
+ Yd(y, s.find, o).forEach((M) => {
10838
10838
  if (M.index === void 0)
10839
10839
  return;
10840
10840
  const I = m + M.index + 1, D = I + M[0].length, F = {
@@ -10855,14 +10855,14 @@ function Yd(n) {
10855
10855
  }), u.every((h) => h !== null);
10856
10856
  }
10857
10857
  let dn = null;
10858
- const Zd = (n) => {
10858
+ const Qd = (n) => {
10859
10859
  var e;
10860
10860
  const t = new ClipboardEvent("paste", {
10861
10861
  clipboardData: new DataTransfer()
10862
10862
  });
10863
10863
  return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", n), t;
10864
10864
  };
10865
- function Qd(n) {
10865
+ function eu(n) {
10866
10866
  const { editor: e, rules: t } = n;
10867
10867
  let r = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
10868
10868
  try {
@@ -10875,7 +10875,7 @@ function Qd(n) {
10875
10875
  state: d,
10876
10876
  transaction: m
10877
10877
  });
10878
- if (!(!Yd({
10878
+ if (!(!Zd({
10879
10879
  editor: e,
10880
10880
  state: g,
10881
10881
  from: Math.max(u - 1, 0),
@@ -10933,7 +10933,7 @@ function Qd(n) {
10933
10933
  if (T) {
10934
10934
  let { text: D } = y;
10935
10935
  typeof D == "string" ? D = D : D = si(b.from(D), h.schema);
10936
- const { from: F } = y, C = F + D.length, A = Zd(D);
10936
+ const { from: F } = y, C = F + D.length, A = Qd(D);
10937
10937
  return a({
10938
10938
  rule: d,
10939
10939
  state: h,
@@ -10943,7 +10943,7 @@ function Qd(n) {
10943
10943
  });
10944
10944
  }
10945
10945
  const M = f.doc.content.findDiffStart(h.doc.content), I = f.doc.content.findDiffEnd(h.doc.content);
10946
- if (!(!_d(M) || !I || M === I.b))
10946
+ if (!(!Gd(M) || !I || M === I.b))
10947
10947
  return a({
10948
10948
  rule: d,
10949
10949
  state: h,
@@ -10954,13 +10954,13 @@ function Qd(n) {
10954
10954
  }
10955
10955
  }));
10956
10956
  }
10957
- function eu(n) {
10957
+ function tu(n) {
10958
10958
  const e = n.filter((t, r) => n.indexOf(t) !== r);
10959
10959
  return Array.from(new Set(e));
10960
10960
  }
10961
10961
  class yt {
10962
10962
  constructor(e, t) {
10963
- this.splittableMarks = [], this.editor = t, this.extensions = yt.resolve(e), this.schema = qd(this.extensions, t), this.setupExtensions();
10963
+ this.splittableMarks = [], this.editor = t, this.extensions = yt.resolve(e), this.schema = jd(this.extensions, t), this.setupExtensions();
10964
10964
  }
10965
10965
  /**
10966
10966
  * Returns a flattened and sorted extension list while
@@ -10969,7 +10969,7 @@ class yt {
10969
10969
  * @returns An flattened and sorted array of Tiptap extensions
10970
10970
  */
10971
10971
  static resolve(e) {
10972
- const t = yt.sort(yt.flatten(e)), r = eu(t.map((i) => i.name));
10972
+ const t = yt.sort(yt.flatten(e)), r = tu(t.map((i) => i.name));
10973
10973
  return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
10974
10974
  }
10975
10975
  /**
@@ -11035,7 +11035,7 @@ class yt {
11035
11035
  const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
11036
11036
  d = { ...d, ...m };
11037
11037
  }
11038
- const u = kd(d);
11038
+ const u = xd(d);
11039
11039
  a.push(u);
11040
11040
  const f = x(o, "addInputRules", l);
11041
11041
  ps(o, e.options.enableInputRules) && f && r.push(...f());
@@ -11049,11 +11049,11 @@ class yt {
11049
11049
  return a;
11050
11050
  }).flat();
11051
11051
  return [
11052
- Jd({
11052
+ Ud({
11053
11053
  editor: e,
11054
11054
  rules: r
11055
11055
  }),
11056
- ...Qd({
11056
+ ...eu({
11057
11057
  editor: e,
11058
11058
  rules: i
11059
11059
  }),
@@ -11180,7 +11180,7 @@ function sl(n, e, t) {
11180
11180
  function ol(n) {
11181
11181
  return Object.fromEntries(Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
11182
11182
  }
11183
- const tu = G.create({
11183
+ const nu = G.create({
11184
11184
  name: "clipboardTextSerializer",
11185
11185
  addOptions() {
11186
11186
  return {
@@ -11203,10 +11203,10 @@ const tu = G.create({
11203
11203
  })
11204
11204
  ];
11205
11205
  }
11206
- }), nu = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11206
+ }), ru = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11207
11207
  var t;
11208
11208
  n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
11209
- }), !0), ru = (n = !1) => ({ commands: e }) => e.setContent("", n), iu = () => ({ state: n, tr: e, dispatch: t }) => {
11209
+ }), !0), iu = (n = !1) => ({ commands: e }) => e.setContent("", n), su = () => ({ state: n, tr: e, dispatch: t }) => {
11210
11210
  const { selection: r } = e, { ranges: i } = r;
11211
11211
  return t && i.forEach(({ $from: s, $to: o }) => {
11212
11212
  n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
@@ -11223,12 +11223,12 @@ const tu = G.create({
11223
11223
  (p || p === 0) && e.lift(h, p);
11224
11224
  });
11225
11225
  }), !0;
11226
- }, su = (n) => (e) => n(e), ou = () => ({ state: n, dispatch: e }) => Qo(n, e), lu = (n, e) => ({ editor: t, tr: r }) => {
11226
+ }, ou = (n) => (e) => n(e), lu = () => ({ state: n, dispatch: e }) => Qo(n, e), au = (n, e) => ({ editor: t, tr: r }) => {
11227
11227
  const { state: i } = t, s = i.doc.slice(n.from, n.to);
11228
11228
  r.deleteRange(n.from, n.to);
11229
11229
  const o = r.mapping.map(e);
11230
11230
  return r.insert(o, s.content), r.setSelection(new w(r.doc.resolve(Math.max(o - 1, 0)))), !0;
11231
- }, au = () => ({ tr: n, dispatch: e }) => {
11231
+ }, cu = () => ({ tr: n, dispatch: e }) => {
11232
11232
  const { selection: t } = n, r = t.$anchor.node();
11233
11233
  if (r.content.size > 0)
11234
11234
  return !1;
@@ -11242,7 +11242,7 @@ const tu = G.create({
11242
11242
  return !0;
11243
11243
  }
11244
11244
  return !1;
11245
- }, cu = (n) => ({ tr: e, state: t, dispatch: r }) => {
11245
+ }, du = (n) => ({ tr: e, state: t, dispatch: r }) => {
11246
11246
  const i = W(n, t.schema), s = e.selection.$anchor;
11247
11247
  for (let o = s.depth; o > 0; o -= 1)
11248
11248
  if (s.node(o).type === i) {
@@ -11253,10 +11253,10 @@ const tu = G.create({
11253
11253
  return !0;
11254
11254
  }
11255
11255
  return !1;
11256
- }, du = (n) => ({ tr: e, dispatch: t }) => {
11256
+ }, uu = (n) => ({ tr: e, dispatch: t }) => {
11257
11257
  const { from: r, to: i } = n;
11258
11258
  return t && e.delete(r, i), !0;
11259
- }, uu = () => ({ state: n, dispatch: e }) => ei(n, e), fu = () => ({ commands: n }) => n.keyboardShortcut("Enter"), hu = () => ({ state: n, dispatch: e }) => Td(n, e);
11259
+ }, fu = () => ({ state: n, dispatch: e }) => ei(n, e), hu = () => ({ commands: n }) => n.keyboardShortcut("Enter"), pu = () => ({ state: n, dispatch: e }) => Od(n, e);
11260
11260
  function En(n, e, t = { strict: !0 }) {
11261
11261
  const r = Object.keys(e);
11262
11262
  return r.length ? r.every((i) => t.strict ? e[i] === n[i] : oi(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
@@ -11296,7 +11296,7 @@ function Ue(n, e) {
11296
11296
  }
11297
11297
  return n;
11298
11298
  }
11299
- const pu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11299
+ const mu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11300
11300
  const s = Ue(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: d } = l;
11301
11301
  if (i) {
11302
11302
  const u = li(a, s, e);
@@ -11306,7 +11306,7 @@ const pu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11306
11306
  }
11307
11307
  }
11308
11308
  return !0;
11309
- }, mu = (n) => (e) => {
11309
+ }, gu = (n) => (e) => {
11310
11310
  const t = typeof n == "function" ? n(e) : n;
11311
11311
  for (let r = 0; r < t.length; r += 1)
11312
11312
  if (t[r](e))
@@ -11343,17 +11343,17 @@ function An() {
11343
11343
  "iPod"
11344
11344
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
11345
11345
  }
11346
- function gu() {
11346
+ function yu() {
11347
11347
  return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
11348
11348
  }
11349
- const yu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11349
+ const bu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11350
11350
  e = {
11351
11351
  scrollIntoView: !0,
11352
11352
  ...e
11353
11353
  };
11354
11354
  const o = () => {
11355
11355
  (An() || gs()) && r.dom.focus(), requestAnimationFrame(() => {
11356
- t.isDestroyed || (r.focus(), gu() && !An() && !gs() && r.dom.focus({ preventScroll: !0 }));
11356
+ t.isDestroyed || (r.focus(), yu() && !An() && !gs() && r.dom.focus({ preventScroll: !0 }));
11357
11357
  });
11358
11358
  };
11359
11359
  if (r.hasFocus() && n === null || n === !1)
@@ -11362,7 +11362,7 @@ const yu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
11362
11362
  return o(), !0;
11363
11363
  const l = cl(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
11364
11364
  return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
11365
- }, bu = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), ku = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), dl = (n) => {
11365
+ }, ku = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), xu = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), dl = (n) => {
11366
11366
  const e = n.childNodes;
11367
11367
  for (let t = e.length - 1; t >= 0; t -= 1) {
11368
11368
  const r = e[t];
@@ -11423,7 +11423,7 @@ function Kt(n, e, t) {
11423
11423
  }
11424
11424
  return Kt("", e, t);
11425
11425
  }
11426
- function xu(n, e, t) {
11426
+ function Su(n, e, t) {
11427
11427
  const r = n.steps.length - 1;
11428
11428
  if (r < e)
11429
11429
  return;
@@ -11436,7 +11436,7 @@ function xu(n, e, t) {
11436
11436
  o === 0 && (o = d);
11437
11437
  }), n.setSelection(v.near(n.doc.resolve(o), t));
11438
11438
  }
11439
- const Su = (n) => !("type" in n), wu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11439
+ const wu = (n) => !("type" in n), Mu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11440
11440
  var o;
11441
11441
  if (i) {
11442
11442
  t = {
@@ -11477,7 +11477,7 @@ const Su = (n) => !("type" in n), wu = (n, e, t) => ({ tr: r, dispatch: i, edito
11477
11477
  return a(g), !1;
11478
11478
  }
11479
11479
  let { from: d, to: u } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, h = !0;
11480
- if ((Su(l) ? l : [l]).forEach((g) => {
11480
+ if ((wu(l) ? l : [l]).forEach((g) => {
11481
11481
  g.check(), f = f ? g.isText && g.marks.length === 0 : !1, h = h ? g.isBlock : !1;
11482
11482
  }), d === u && h) {
11483
11483
  const { parent: g } = r.doc.resolve(d);
@@ -11496,28 +11496,28 @@ const Su = (n) => !("type" in n), wu = (n, e, t) => ({ tr: r, dispatch: i, edito
11496
11496
  r.insertText(m, d, u);
11497
11497
  } else
11498
11498
  m = l, r.replaceWith(d, u, m);
11499
- t.updateSelection && xu(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11499
+ t.updateSelection && Su(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11500
11500
  }
11501
11501
  return !0;
11502
- }, Mu = () => ({ state: n, dispatch: e }) => wd(n, e), Cu = () => ({ state: n, dispatch: e }) => Md(n, e), Tu = () => ({ state: n, dispatch: e }) => Jo(n, e), Ou = () => ({ state: n, dispatch: e }) => Xo(n, e), vu = () => ({ state: n, dispatch: e, tr: t }) => {
11502
+ }, Cu = () => ({ state: n, dispatch: e }) => Md(n, e), Tu = () => ({ state: n, dispatch: e }) => Cd(n, e), Ou = () => ({ state: n, dispatch: e }) => Jo(n, e), vu = () => ({ state: n, dispatch: e }) => Xo(n, e), Eu = () => ({ state: n, dispatch: e, tr: t }) => {
11503
11503
  try {
11504
11504
  const r = Ln(n.doc, n.selection.$from.pos, -1);
11505
11505
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11506
11506
  } catch {
11507
11507
  return !1;
11508
11508
  }
11509
- }, Eu = () => ({ state: n, dispatch: e, tr: t }) => {
11509
+ }, Au = () => ({ state: n, dispatch: e, tr: t }) => {
11510
11510
  try {
11511
11511
  const r = Ln(n.doc, n.selection.$from.pos, 1);
11512
11512
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11513
11513
  } catch {
11514
11514
  return !1;
11515
11515
  }
11516
- }, Au = () => ({ state: n, dispatch: e }) => xd(n, e), Nu = () => ({ state: n, dispatch: e }) => Sd(n, e);
11516
+ }, Nu = () => ({ state: n, dispatch: e }) => Sd(n, e), Du = () => ({ state: n, dispatch: e }) => wd(n, e);
11517
11517
  function ul() {
11518
11518
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
11519
11519
  }
11520
- function Du(n) {
11520
+ function Iu(n) {
11521
11521
  const e = n.split(/-(?!$)/);
11522
11522
  let t = e[e.length - 1];
11523
11523
  t === "Space" && (t = " ");
@@ -11539,8 +11539,8 @@ function Du(n) {
11539
11539
  }
11540
11540
  return r && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
11541
11541
  }
11542
- const Iu = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11543
- const s = Du(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11542
+ const Ru = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11543
+ const s = Iu(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11544
11544
  key: o === "Space" ? " " : o,
11545
11545
  altKey: s.includes("Alt"),
11546
11546
  ctrlKey: s.includes("Ctrl"),
@@ -11571,13 +11571,13 @@ function Jt(n, e, t = {}) {
11571
11571
  const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => En(u.node.attrs, t, { strict: !1 }));
11572
11572
  return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
11573
11573
  }
11574
- const Ru = (n, e = {}) => ({ state: t, dispatch: r }) => {
11574
+ const Pu = (n, e = {}) => ({ state: t, dispatch: r }) => {
11575
11575
  const i = W(n, t.schema);
11576
- return Jt(t, i, e) ? Cd(t, r) : !1;
11577
- }, Pu = () => ({ state: n, dispatch: e }) => el(n, e), Bu = (n) => ({ state: e, dispatch: t }) => {
11576
+ return Jt(t, i, e) ? Td(t, r) : !1;
11577
+ }, Bu = () => ({ state: n, dispatch: e }) => el(n, e), Lu = (n) => ({ state: e, dispatch: t }) => {
11578
11578
  const r = W(n, e.schema);
11579
- return Ld(r)(e, t);
11580
- }, Lu = () => ({ state: n, dispatch: e }) => Zo(n, e);
11579
+ return zd(r)(e, t);
11580
+ }, zu = () => ({ state: n, dispatch: e }) => Zo(n, e);
11581
11581
  function Un(n, e) {
11582
11582
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11583
11583
  }
@@ -11585,7 +11585,7 @@ function ys(n, e) {
11585
11585
  const t = typeof e == "string" ? [e] : e;
11586
11586
  return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
11587
11587
  }
11588
- const zu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11588
+ const Fu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11589
11589
  let s = null, o = null;
11590
11590
  const l = Un(typeof n == "string" ? n : n.name, r.schema);
11591
11591
  return l ? (l === "node" && (s = W(n, r.schema)), l === "mark" && (o = Ue(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -11595,13 +11595,13 @@ const zu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11595
11595
  });
11596
11596
  });
11597
11597
  }), !0) : !1;
11598
- }, Fu = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), $u = () => ({ tr: n, dispatch: e }) => {
11598
+ }, $u = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Vu = () => ({ tr: n, dispatch: e }) => {
11599
11599
  if (e) {
11600
11600
  const t = new ce(n.doc);
11601
11601
  n.setSelection(t);
11602
11602
  }
11603
11603
  return !0;
11604
- }, Vu = () => ({ state: n, dispatch: e }) => _o(n, e), Hu = () => ({ state: n, dispatch: e }) => Yo(n, e), Wu = () => ({ state: n, dispatch: e }) => Ed(n, e), qu = () => ({ state: n, dispatch: e }) => Dd(n, e), ju = () => ({ state: n, dispatch: e }) => Nd(n, e);
11604
+ }, Hu = () => ({ state: n, dispatch: e }) => _o(n, e), Wu = () => ({ state: n, dispatch: e }) => Yo(n, e), qu = () => ({ state: n, dispatch: e }) => Ad(n, e), ju = () => ({ state: n, dispatch: e }) => Id(n, e), Ku = () => ({ state: n, dispatch: e }) => Dd(n, e);
11605
11605
  function Br(n, e, t = {}, r = {}) {
11606
11606
  return Kt(n, e, {
11607
11607
  slice: !1,
@@ -11609,7 +11609,7 @@ function Br(n, e, t = {}, r = {}) {
11609
11609
  errorOnInvalidContent: r.errorOnInvalidContent
11610
11610
  });
11611
11611
  }
11612
- const Ku = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11612
+ const Ju = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11613
11613
  var a, c;
11614
11614
  const { doc: d } = s;
11615
11615
  if (t.preserveWhitespace !== "full") {
@@ -11631,7 +11631,7 @@ function fl(n, e) {
11631
11631
  const l = o.find((a) => a.type.name === t.name);
11632
11632
  return l ? { ...l.attrs } : {};
11633
11633
  }
11634
- function Ju(n) {
11634
+ function Uu(n) {
11635
11635
  for (let e = 0; e < n.edgeCount; e += 1) {
11636
11636
  const { type: t } = n.edge(e);
11637
11637
  if (t.isTextblock && !t.hasRequiredAttrs())
@@ -11639,7 +11639,7 @@ function Ju(n) {
11639
11639
  }
11640
11640
  return null;
11641
11641
  }
11642
- function Uu(n, e) {
11642
+ function _u(n, e) {
11643
11643
  for (let t = n.depth; t > 0; t -= 1) {
11644
11644
  const r = n.node(t);
11645
11645
  if (e(r))
@@ -11652,16 +11652,16 @@ function Uu(n, e) {
11652
11652
  }
11653
11653
  }
11654
11654
  function ai(n) {
11655
- return (e) => Uu(e.$from, n);
11655
+ return (e) => _u(e.$from, n);
11656
11656
  }
11657
- function _u(n, e) {
11657
+ function Gu(n, e) {
11658
11658
  const t = {
11659
11659
  from: 0,
11660
11660
  to: n.content.size
11661
11661
  };
11662
11662
  return sl(n, t, e);
11663
11663
  }
11664
- function Gu(n, e) {
11664
+ function Xu(n, e) {
11665
11665
  const t = W(e, n.schema), { from: r, to: i } = n.selection, s = [];
11666
11666
  n.doc.nodesBetween(r, i, (l) => {
11667
11667
  s.push(l);
@@ -11669,9 +11669,9 @@ function Gu(n, e) {
11669
11669
  const o = s.reverse().find((l) => l.type.name === t.name);
11670
11670
  return o ? { ...o.attrs } : {};
11671
11671
  }
11672
- function Xu(n, e) {
11672
+ function Yu(n, e) {
11673
11673
  const t = Un(typeof e == "string" ? e : e.name, n.schema);
11674
- return t === "node" ? Gu(n, e) : t === "mark" ? fl(n, e) : {};
11674
+ return t === "node" ? Xu(n, e) : t === "mark" ? fl(n, e) : {};
11675
11675
  }
11676
11676
  function hl(n, e, t) {
11677
11677
  const r = [];
@@ -11718,7 +11718,7 @@ function Lr(n, e, t = {}) {
11718
11718
  const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => En(u.mark.attrs, t, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, f) => u + f.to - f.from, 0);
11719
11719
  return (a > 0 ? a + c : a) >= o;
11720
11720
  }
11721
- function Yu(n, e, t = {}) {
11721
+ function Zu(n, e, t = {}) {
11722
11722
  if (!e)
11723
11723
  return Jt(n, null, t) || Lr(n, null, t);
11724
11724
  const r = Un(e, n.schema);
@@ -11757,10 +11757,10 @@ function ci(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
11757
11757
  }
11758
11758
  return !1;
11759
11759
  }
11760
- function Zu(n) {
11760
+ function Qu(n) {
11761
11761
  return n instanceof S;
11762
11762
  }
11763
- function Qu(n, e, t) {
11763
+ function ef(n, e, t) {
11764
11764
  var r;
11765
11765
  const { selection: i } = e;
11766
11766
  let s = null;
@@ -11782,7 +11782,7 @@ function Qu(n, e, t) {
11782
11782
  }), c;
11783
11783
  });
11784
11784
  }
11785
- const ef = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11785
+ const tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11786
11786
  const { selection: s } = t, { empty: o, ranges: l } = s, a = Ue(n, r.schema);
11787
11787
  if (i)
11788
11788
  if (o) {
@@ -11804,26 +11804,26 @@ const ef = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11804
11804
  }) : t.addMark(p, m, a.create(e));
11805
11805
  });
11806
11806
  });
11807
- return Qu(r, t, a);
11808
- }, tf = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), nf = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11807
+ return ef(r, t, a);
11808
+ }, nf = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), rf = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11809
11809
  const s = W(n, t.schema);
11810
11810
  let o;
11811
11811
  return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => us(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => us(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
11812
- }, rf = (n) => ({ tr: e, dispatch: t }) => {
11812
+ }, sf = (n) => ({ tr: e, dispatch: t }) => {
11813
11813
  if (t) {
11814
11814
  const { doc: r } = e, i = Ze(n, 0, r.content.size), s = S.create(r, i);
11815
11815
  e.setSelection(s);
11816
11816
  }
11817
11817
  return !0;
11818
- }, sf = (n) => ({ tr: e, dispatch: t }) => {
11818
+ }, of = (n) => ({ tr: e, dispatch: t }) => {
11819
11819
  if (t) {
11820
11820
  const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = w.atStart(r).from, l = w.atEnd(r).to, a = Ze(i, o, l), c = Ze(s, o, l), d = w.create(r, a, c);
11821
11821
  e.setSelection(d);
11822
11822
  }
11823
11823
  return !0;
11824
- }, of = (n) => ({ state: e, dispatch: t }) => {
11824
+ }, lf = (n) => ({ state: e, dispatch: t }) => {
11825
11825
  const r = W(n, e.schema);
11826
- return $d(r)(e, t);
11826
+ return Vd(r)(e, t);
11827
11827
  };
11828
11828
  function ks(n, e) {
11829
11829
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
@@ -11832,13 +11832,13 @@ function ks(n, e) {
11832
11832
  n.tr.ensureMarks(r);
11833
11833
  }
11834
11834
  }
11835
- const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11835
+ const af = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11836
11836
  const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = mn(c, l.node().type.name, l.node().attrs);
11837
11837
  if (s instanceof S && s.node.isBlock)
11838
11838
  return !l.parentOffset || !Ne(o, l.pos) ? !1 : (r && (n && ks(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
11839
11839
  if (!l.parent.isBlock)
11840
11840
  return !1;
11841
- const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Ju(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11841
+ const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Uu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11842
11842
  let h = u && f ? [
11843
11843
  {
11844
11844
  type: f,
@@ -11858,7 +11858,7 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11858
11858
  n && ks(t, i.extensionManager.splittableMarks), e.scrollIntoView();
11859
11859
  }
11860
11860
  return p;
11861
- }, af = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11861
+ }, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11862
11862
  var o;
11863
11863
  const l = W(n, r.schema), { $from: a, $to: c } = r.selection, d = r.selection.node;
11864
11864
  if (d && d.isBlock || a.depth < 2 || !a.sameParent(c))
@@ -11931,7 +11931,7 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11931
11931
  return !0;
11932
11932
  const i = n.doc.nodeAt(r);
11933
11933
  return t.node.type === (i == null ? void 0 : i.type) && Ke(n.doc, r) && n.join(r), !0;
11934
- }, cf = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11934
+ }, df = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11935
11935
  const { extensions: u, splittableMarks: f } = i.extensionManager, h = W(n, o.schema), p = W(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: T } = m, M = y.blockRange(T), I = g || m.$to.parentOffset && m.$from.marks();
11936
11936
  if (!M)
11937
11937
  return !1;
@@ -11946,17 +11946,17 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11946
11946
  const F = d().wrapInList(h, r), C = I.filter((A) => f.includes(A.type.name));
11947
11947
  return s.ensureMarks(C), F ? !0 : c.clearNodes();
11948
11948
  }).wrapInList(h, r).command(() => ur(s, h)).command(() => fr(s, h)).run();
11949
- }, df = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11949
+ }, uf = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11950
11950
  const { extendEmptyMarkRange: s = !1 } = t, o = Ue(n, r.schema);
11951
11951
  return Lr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11952
- }, uf = (n, e, t = {}) => ({ state: r, commands: i }) => {
11952
+ }, ff = (n, e, t = {}) => ({ state: r, commands: i }) => {
11953
11953
  const s = W(n, r.schema), o = W(e, r.schema), l = Jt(r, s, t);
11954
11954
  let a;
11955
11955
  return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
11956
- }, ff = (n, e = {}) => ({ state: t, commands: r }) => {
11956
+ }, hf = (n, e = {}) => ({ state: t, commands: r }) => {
11957
11957
  const i = W(n, t.schema);
11958
11958
  return Jt(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
11959
- }, hf = () => ({ state: n, dispatch: e }) => {
11959
+ }, pf = () => ({ state: n, dispatch: e }) => {
11960
11960
  const t = n.plugins;
11961
11961
  for (let r = 0; r < t.length; r += 1) {
11962
11962
  const i = t[r];
@@ -11976,12 +11976,12 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11976
11976
  }
11977
11977
  }
11978
11978
  return !1;
11979
- }, pf = () => ({ tr: n, dispatch: e }) => {
11979
+ }, mf = () => ({ tr: n, dispatch: e }) => {
11980
11980
  const { selection: t } = n, { empty: r, ranges: i } = t;
11981
11981
  return r || e && i.forEach((s) => {
11982
11982
  n.removeMark(s.$from.pos, s.$to.pos);
11983
11983
  }), !0;
11984
- }, mf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11984
+ }, gf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11985
11985
  var s;
11986
11986
  const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = Ue(n, r.schema), { $from: c, empty: d, ranges: u } = l;
11987
11987
  if (!i)
@@ -11995,7 +11995,7 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11995
11995
  t.removeMark(f.$from.pos, f.$to.pos, a);
11996
11996
  });
11997
11997
  return t.removeStoredMark(a), !0;
11998
- }, gf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11998
+ }, yf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11999
11999
  let s = null, o = null;
12000
12000
  const l = Un(typeof n == "string" ? n : n.name, r.schema);
12001
12001
  return l ? (l === "node" && (s = W(n, r.schema)), l === "mark" && (o = Ue(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -12026,82 +12026,82 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
12026
12026
  }));
12027
12027
  }));
12028
12028
  }), !0) : !1;
12029
- }, yf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12030
- const i = W(n, t.schema);
12031
- return Id(i, e)(t, r);
12032
12029
  }, bf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12033
12030
  const i = W(n, t.schema);
12034
12031
  return Rd(i, e)(t, r);
12032
+ }, kf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12033
+ const i = W(n, t.schema);
12034
+ return Pd(i, e)(t, r);
12035
12035
  };
12036
- var kf = /* @__PURE__ */ Object.freeze({
12036
+ var xf = /* @__PURE__ */ Object.freeze({
12037
12037
  __proto__: null,
12038
- blur: nu,
12039
- clearContent: ru,
12040
- clearNodes: iu,
12041
- command: su,
12042
- createParagraphNear: ou,
12043
- cut: lu,
12044
- deleteCurrentNode: au,
12045
- deleteNode: cu,
12046
- deleteRange: du,
12047
- deleteSelection: uu,
12048
- enter: fu,
12049
- exitCode: hu,
12050
- extendMarkRange: pu,
12051
- first: mu,
12052
- focus: yu,
12053
- forEach: bu,
12054
- insertContent: ku,
12055
- insertContentAt: wu,
12056
- joinBackward: Tu,
12057
- joinDown: Cu,
12058
- joinForward: Ou,
12059
- joinItemBackward: vu,
12060
- joinItemForward: Eu,
12061
- joinTextblockBackward: Au,
12062
- joinTextblockForward: Nu,
12063
- joinUp: Mu,
12064
- keyboardShortcut: Iu,
12065
- lift: Ru,
12066
- liftEmptyBlock: Pu,
12067
- liftListItem: Bu,
12068
- newlineInCode: Lu,
12069
- resetAttributes: zu,
12070
- scrollIntoView: Fu,
12071
- selectAll: $u,
12072
- selectNodeBackward: Vu,
12073
- selectNodeForward: Hu,
12074
- selectParentNode: Wu,
12075
- selectTextblockEnd: qu,
12076
- selectTextblockStart: ju,
12077
- setContent: Ku,
12078
- setMark: ef,
12079
- setMeta: tf,
12080
- setNode: nf,
12081
- setNodeSelection: rf,
12082
- setTextSelection: sf,
12083
- sinkListItem: of,
12084
- splitBlock: lf,
12085
- splitListItem: af,
12086
- toggleList: cf,
12087
- toggleMark: df,
12088
- toggleNode: uf,
12089
- toggleWrap: ff,
12090
- undoInputRule: hf,
12091
- unsetAllMarks: pf,
12092
- unsetMark: mf,
12093
- updateAttributes: gf,
12094
- wrapIn: yf,
12095
- wrapInList: bf
12038
+ blur: ru,
12039
+ clearContent: iu,
12040
+ clearNodes: su,
12041
+ command: ou,
12042
+ createParagraphNear: lu,
12043
+ cut: au,
12044
+ deleteCurrentNode: cu,
12045
+ deleteNode: du,
12046
+ deleteRange: uu,
12047
+ deleteSelection: fu,
12048
+ enter: hu,
12049
+ exitCode: pu,
12050
+ extendMarkRange: mu,
12051
+ first: gu,
12052
+ focus: bu,
12053
+ forEach: ku,
12054
+ insertContent: xu,
12055
+ insertContentAt: Mu,
12056
+ joinBackward: Ou,
12057
+ joinDown: Tu,
12058
+ joinForward: vu,
12059
+ joinItemBackward: Eu,
12060
+ joinItemForward: Au,
12061
+ joinTextblockBackward: Nu,
12062
+ joinTextblockForward: Du,
12063
+ joinUp: Cu,
12064
+ keyboardShortcut: Ru,
12065
+ lift: Pu,
12066
+ liftEmptyBlock: Bu,
12067
+ liftListItem: Lu,
12068
+ newlineInCode: zu,
12069
+ resetAttributes: Fu,
12070
+ scrollIntoView: $u,
12071
+ selectAll: Vu,
12072
+ selectNodeBackward: Hu,
12073
+ selectNodeForward: Wu,
12074
+ selectParentNode: qu,
12075
+ selectTextblockEnd: ju,
12076
+ selectTextblockStart: Ku,
12077
+ setContent: Ju,
12078
+ setMark: tf,
12079
+ setMeta: nf,
12080
+ setNode: rf,
12081
+ setNodeSelection: sf,
12082
+ setTextSelection: of,
12083
+ sinkListItem: lf,
12084
+ splitBlock: af,
12085
+ splitListItem: cf,
12086
+ toggleList: df,
12087
+ toggleMark: uf,
12088
+ toggleNode: ff,
12089
+ toggleWrap: hf,
12090
+ undoInputRule: pf,
12091
+ unsetAllMarks: mf,
12092
+ unsetMark: gf,
12093
+ updateAttributes: yf,
12094
+ wrapIn: bf,
12095
+ wrapInList: kf
12096
12096
  });
12097
- const xf = G.create({
12097
+ const Sf = G.create({
12098
12098
  name: "commands",
12099
12099
  addCommands() {
12100
12100
  return {
12101
- ...kf
12101
+ ...xf
12102
12102
  };
12103
12103
  }
12104
- }), Sf = G.create({
12104
+ }), wf = G.create({
12105
12105
  name: "drop",
12106
12106
  addProseMirrorPlugins() {
12107
12107
  return [
@@ -12120,7 +12120,7 @@ const xf = G.create({
12120
12120
  })
12121
12121
  ];
12122
12122
  }
12123
- }), wf = G.create({
12123
+ }), Mf = G.create({
12124
12124
  name: "editable",
12125
12125
  addProseMirrorPlugins() {
12126
12126
  return [
@@ -12132,13 +12132,13 @@ const xf = G.create({
12132
12132
  })
12133
12133
  ];
12134
12134
  }
12135
- }), Mf = new Ce("focusEvents"), Cf = G.create({
12135
+ }), Cf = new Ce("focusEvents"), Tf = G.create({
12136
12136
  name: "focusEvents",
12137
12137
  addProseMirrorPlugins() {
12138
12138
  const { editor: n } = this;
12139
12139
  return [
12140
12140
  new oe({
12141
- key: Mf,
12141
+ key: Cf,
12142
12142
  props: {
12143
12143
  handleDOMEvents: {
12144
12144
  focus: (e, t) => {
@@ -12156,7 +12156,7 @@ const xf = G.create({
12156
12156
  })
12157
12157
  ];
12158
12158
  }
12159
- }), Tf = G.create({
12159
+ }), Of = G.create({
12160
12160
  name: "keymap",
12161
12161
  addKeyboardShortcuts() {
12162
12162
  const n = () => this.editor.commands.first(({ commands: o }) => [
@@ -12234,7 +12234,7 @@ const xf = G.create({
12234
12234
  })
12235
12235
  ];
12236
12236
  }
12237
- }), Of = G.create({
12237
+ }), vf = G.create({
12238
12238
  name: "paste",
12239
12239
  addProseMirrorPlugins() {
12240
12240
  return [
@@ -12252,7 +12252,7 @@ const xf = G.create({
12252
12252
  })
12253
12253
  ];
12254
12254
  }
12255
- }), vf = G.create({
12255
+ }), Ef = G.create({
12256
12256
  name: "tabindex",
12257
12257
  addProseMirrorPlugins() {
12258
12258
  return [
@@ -12391,7 +12391,7 @@ class Ge {
12391
12391
  }), this.editor.view.dispatch(t);
12392
12392
  }
12393
12393
  }
12394
- const Ef = `.ProseMirror {
12394
+ const Af = `.ProseMirror {
12395
12395
  position: relative;
12396
12396
  }
12397
12397
 
@@ -12466,14 +12466,14 @@ img.ProseMirror-separator {
12466
12466
  .tippy-box[data-animation=fade][data-state=hidden] {
12467
12467
  opacity: 0
12468
12468
  }`;
12469
- function Af(n, e, t) {
12469
+ function Nf(n, e, t) {
12470
12470
  const r = document.querySelector("style[data-tiptap-style]");
12471
12471
  if (r !== null)
12472
12472
  return r;
12473
12473
  const i = document.createElement("style");
12474
12474
  return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(i), i;
12475
12475
  }
12476
- class Nf extends Vd {
12476
+ class Df extends Hd {
12477
12477
  constructor(e = {}) {
12478
12478
  super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
12479
12479
  element: document.createElement("div"),
@@ -12536,7 +12536,7 @@ class Nf extends Vd {
12536
12536
  * Inject CSS styles.
12537
12537
  */
12538
12538
  injectCSS() {
12539
- this.options.injectCSS && document && (this.css = Af(Ef, this.options.injectNonce));
12539
+ this.options.injectCSS && document && (this.css = Nf(Af, this.options.injectNonce));
12540
12540
  }
12541
12541
  /**
12542
12542
  * Update editor options.
@@ -12605,16 +12605,16 @@ class Nf extends Vd {
12605
12605
  createExtensionManager() {
12606
12606
  var e, t;
12607
12607
  const i = [...this.options.enableCoreExtensions ? [
12608
- wf,
12609
- tu.configure({
12608
+ Mf,
12609
+ nu.configure({
12610
12610
  blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
12611
12611
  }),
12612
- xf,
12613
- Cf,
12614
- Tf,
12615
- vf,
12616
12612
  Sf,
12617
- Of
12613
+ Tf,
12614
+ Of,
12615
+ Ef,
12616
+ wf,
12617
+ vf
12618
12618
  ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
12619
12619
  this.extensionManager = new yt(i, this);
12620
12620
  }
@@ -12740,11 +12740,11 @@ class Nf extends Vd {
12740
12740
  * Get attributes of the currently selected node or mark.
12741
12741
  */
12742
12742
  getAttributes(e) {
12743
- return Xu(this.state, e);
12743
+ return Yu(this.state, e);
12744
12744
  }
12745
12745
  isActive(e, t) {
12746
12746
  const r = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
12747
- return Yu(this.state, r, i);
12747
+ return Zu(this.state, r, i);
12748
12748
  }
12749
12749
  /**
12750
12750
  * Get the document as JSON.
@@ -12765,7 +12765,7 @@ class Nf extends Vd {
12765
12765
  const { blockSeparator: t = `
12766
12766
 
12767
12767
  `, textSerializers: r = {} } = e || {};
12768
- return _u(this.state.doc, {
12768
+ return Gu(this.state.doc, {
12769
12769
  blockSeparator: t,
12770
12770
  textSerializers: {
12771
12771
  ...ol(this.schema),
@@ -12930,7 +12930,7 @@ class re {
12930
12930
  }
12931
12931
  }
12932
12932
  function dt(n) {
12933
- return new Gd({
12933
+ return new Xd({
12934
12934
  find: n.find,
12935
12935
  handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
12936
12936
  const s = E(n.getAttributes, void 0, r, i);
@@ -12947,7 +12947,7 @@ function dt(n) {
12947
12947
  }
12948
12948
  });
12949
12949
  }
12950
- function Df(n, e) {
12950
+ function If(n, e) {
12951
12951
  const { selection: t } = n, { $from: r } = t;
12952
12952
  if (t instanceof S) {
12953
12953
  const s = r.index();
@@ -12962,7 +12962,7 @@ function Df(n, e) {
12962
12962
  }
12963
12963
  return !1;
12964
12964
  }
12965
- const If = /^\s*>\s$/, Rf = re.create({
12965
+ const Rf = /^\s*>\s$/, Pf = re.create({
12966
12966
  name: "blockquote",
12967
12967
  addOptions() {
12968
12968
  return {
@@ -12995,12 +12995,12 @@ const If = /^\s*>\s$/, Rf = re.create({
12995
12995
  addInputRules() {
12996
12996
  return [
12997
12997
  Ut({
12998
- find: If,
12998
+ find: Rf,
12999
12999
  type: this.type
13000
13000
  })
13001
13001
  ];
13002
13002
  }
13003
- }), Pf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Bf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Lf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, zf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Ff = Me.create({
13003
+ }), Bf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Lf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, zf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Ff = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, $f = Me.create({
13004
13004
  name: "bold",
13005
13005
  addOptions() {
13006
13006
  return {
@@ -13045,11 +13045,11 @@ const If = /^\s*>\s$/, Rf = re.create({
13045
13045
  addInputRules() {
13046
13046
  return [
13047
13047
  ct({
13048
- find: Pf,
13048
+ find: Bf,
13049
13049
  type: this.type
13050
13050
  }),
13051
13051
  ct({
13052
- find: Lf,
13052
+ find: zf,
13053
13053
  type: this.type
13054
13054
  })
13055
13055
  ];
@@ -13057,16 +13057,16 @@ const If = /^\s*>\s$/, Rf = re.create({
13057
13057
  addPasteRules() {
13058
13058
  return [
13059
13059
  dt({
13060
- find: Bf,
13060
+ find: Lf,
13061
13061
  type: this.type
13062
13062
  }),
13063
13063
  dt({
13064
- find: zf,
13064
+ find: Ff,
13065
13065
  type: this.type
13066
13066
  })
13067
13067
  ];
13068
13068
  }
13069
- }), $f = "listItem", xs = "textStyle", Ss = /^\s*([-+*])\s$/, Vf = re.create({
13069
+ }), Vf = "listItem", xs = "textStyle", Ss = /^\s*([-+*])\s$/, Hf = re.create({
13070
13070
  name: "bulletList",
13071
13071
  addOptions() {
13072
13072
  return {
@@ -13090,7 +13090,7 @@ const If = /^\s*>\s$/, Rf = re.create({
13090
13090
  },
13091
13091
  addCommands() {
13092
13092
  return {
13093
- toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes($f, this.editor.getAttributes(xs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
13093
+ toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Vf, this.editor.getAttributes(xs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
13094
13094
  };
13095
13095
  },
13096
13096
  addKeyboardShortcuts() {
@@ -13114,7 +13114,7 @@ const If = /^\s*>\s$/, Rf = re.create({
13114
13114
  n
13115
13115
  ];
13116
13116
  }
13117
- }), Hf = /(^|[^`])`([^`]+)`(?!`)/, Wf = /(^|[^`])`([^`]+)`(?!`)/g, qf = Me.create({
13117
+ }), Wf = /(^|[^`])`([^`]+)`(?!`)/, qf = /(^|[^`])`([^`]+)`(?!`)/g, jf = Me.create({
13118
13118
  name: "code",
13119
13119
  addOptions() {
13120
13120
  return {
@@ -13147,7 +13147,7 @@ const If = /^\s*>\s$/, Rf = re.create({
13147
13147
  addInputRules() {
13148
13148
  return [
13149
13149
  ct({
13150
- find: Hf,
13150
+ find: Wf,
13151
13151
  type: this.type
13152
13152
  })
13153
13153
  ];
@@ -13155,12 +13155,12 @@ const If = /^\s*>\s$/, Rf = re.create({
13155
13155
  addPasteRules() {
13156
13156
  return [
13157
13157
  dt({
13158
- find: Wf,
13158
+ find: qf,
13159
13159
  type: this.type
13160
13160
  })
13161
13161
  ];
13162
13162
  }
13163
- }), jf = /^```([a-z]+)?[\s\n]$/, Kf = /^~~~([a-z]+)?[\s\n]$/, Jf = re.create({
13163
+ }), Kf = /^```([a-z]+)?[\s\n]$/, Jf = /^~~~([a-z]+)?[\s\n]$/, Uf = re.create({
13164
13164
  name: "codeBlock",
13165
13165
  addOptions() {
13166
13166
  return {
@@ -13251,14 +13251,14 @@ const If = /^\s*>\s$/, Rf = re.create({
13251
13251
  addInputRules() {
13252
13252
  return [
13253
13253
  zr({
13254
- find: jf,
13254
+ find: Kf,
13255
13255
  type: this.type,
13256
13256
  getAttributes: (n) => ({
13257
13257
  language: n[1]
13258
13258
  })
13259
13259
  }),
13260
13260
  zr({
13261
- find: Kf,
13261
+ find: Jf,
13262
13262
  type: this.type,
13263
13263
  getAttributes: (n) => ({
13264
13264
  language: n[1]
@@ -13287,19 +13287,19 @@ const If = /^\s*>\s$/, Rf = re.create({
13287
13287
  })
13288
13288
  ];
13289
13289
  }
13290
- }), Uf = re.create({
13290
+ }), _f = re.create({
13291
13291
  name: "doc",
13292
13292
  topNode: !0,
13293
13293
  content: "block+"
13294
13294
  });
13295
- function _f(n = {}) {
13295
+ function Gf(n = {}) {
13296
13296
  return new oe({
13297
13297
  view(e) {
13298
- return new Gf(e, n);
13298
+ return new Xf(e, n);
13299
13299
  }
13300
13300
  });
13301
13301
  }
13302
- class Gf {
13302
+ class Xf {
13303
13303
  constructor(e, t) {
13304
13304
  var r;
13305
13305
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (r = t.width) !== null && r !== void 0 ? r : 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
@@ -13373,7 +13373,7 @@ class Gf {
13373
13373
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
13374
13374
  }
13375
13375
  }
13376
- const Xf = G.create({
13376
+ const Yf = G.create({
13377
13377
  name: "dropCursor",
13378
13378
  addOptions() {
13379
13379
  return {
@@ -13384,7 +13384,7 @@ const Xf = G.create({
13384
13384
  },
13385
13385
  addProseMirrorPlugins() {
13386
13386
  return [
13387
- _f(this.options)
13387
+ Gf(this.options)
13388
13388
  ];
13389
13389
  }
13390
13390
  });
@@ -13427,7 +13427,7 @@ class P extends v {
13427
13427
  */
13428
13428
  static valid(e) {
13429
13429
  let t = e.parent;
13430
- if (t.inlineContent || !Yf(e) || !Zf(e))
13430
+ if (t.inlineContent || !Zf(e) || !Qf(e))
13431
13431
  return !1;
13432
13432
  let r = t.type.spec.allowGapCursor;
13433
13433
  if (r != null)
@@ -13491,7 +13491,7 @@ class di {
13491
13491
  function ml(n) {
13492
13492
  return n.isAtom || n.spec.isolating || n.spec.createGapCursor;
13493
13493
  }
13494
- function Yf(n) {
13494
+ function Zf(n) {
13495
13495
  for (let e = n.depth; e >= 0; e--) {
13496
13496
  let t = n.index(e), r = n.node(e);
13497
13497
  if (t == 0) {
@@ -13508,7 +13508,7 @@ function Yf(n) {
13508
13508
  }
13509
13509
  return !0;
13510
13510
  }
13511
- function Zf(n) {
13511
+ function Qf(n) {
13512
13512
  for (let e = n.depth; e >= 0; e--) {
13513
13513
  let t = n.indexAfter(e), r = n.node(e);
13514
13514
  if (t == r.childCount) {
@@ -13525,20 +13525,20 @@ function Zf(n) {
13525
13525
  }
13526
13526
  return !0;
13527
13527
  }
13528
- function Qf() {
13528
+ function eh() {
13529
13529
  return new oe({
13530
13530
  props: {
13531
- decorations: rh,
13531
+ decorations: ih,
13532
13532
  createSelectionBetween(n, e, t) {
13533
13533
  return e.pos == t.pos && P.valid(t) ? new P(t) : null;
13534
13534
  },
13535
- handleClick: th,
13536
- handleKeyDown: eh,
13537
- handleDOMEvents: { beforeinput: nh }
13535
+ handleClick: nh,
13536
+ handleKeyDown: th,
13537
+ handleDOMEvents: { beforeinput: rh }
13538
13538
  }
13539
13539
  });
13540
13540
  }
13541
- const eh = jo({
13541
+ const th = jo({
13542
13542
  ArrowLeft: fn("horiz", -1),
13543
13543
  ArrowRight: fn("horiz", 1),
13544
13544
  ArrowUp: fn("vert", -1),
@@ -13557,7 +13557,7 @@ function fn(n, e) {
13557
13557
  return c ? (i && i(r.tr.setSelection(new P(c))), !0) : !1;
13558
13558
  };
13559
13559
  }
13560
- function th(n, e, t) {
13560
+ function nh(n, e, t) {
13561
13561
  if (!n || !n.editable)
13562
13562
  return !1;
13563
13563
  let r = n.state.doc.resolve(e);
@@ -13566,7 +13566,7 @@ function th(n, e, t) {
13566
13566
  let i = n.posAtCoords({ left: t.clientX, top: t.clientY });
13567
13567
  return i && i.inside > -1 && S.isSelectable(n.state.doc.nodeAt(i.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new P(r))), !0);
13568
13568
  }
13569
- function nh(n, e) {
13569
+ function rh(n, e) {
13570
13570
  if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof P))
13571
13571
  return !1;
13572
13572
  let { $from: t } = n.state.selection, r = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
@@ -13578,17 +13578,17 @@ function nh(n, e) {
13578
13578
  let s = n.state.tr.replace(t.pos, t.pos, new k(i, 0, 0));
13579
13579
  return s.setSelection(w.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
13580
13580
  }
13581
- function rh(n) {
13581
+ function ih(n) {
13582
13582
  if (!(n.selection instanceof P))
13583
13583
  return null;
13584
13584
  let e = document.createElement("div");
13585
13585
  return e.className = "ProseMirror-gapcursor", $.create(n.doc, [he.widget(n.selection.head, e, { key: "gapcursor" })]);
13586
13586
  }
13587
- const ih = G.create({
13587
+ const sh = G.create({
13588
13588
  name: "gapCursor",
13589
13589
  addProseMirrorPlugins() {
13590
13590
  return [
13591
- Qf()
13591
+ eh()
13592
13592
  ];
13593
13593
  },
13594
13594
  extendNodeSchema(n) {
@@ -13602,7 +13602,7 @@ const ih = G.create({
13602
13602
  allowGapCursor: (e = E(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
13603
13603
  };
13604
13604
  }
13605
- }), sh = re.create({
13605
+ }), oh = re.create({
13606
13606
  name: "hardBreak",
13607
13607
  addOptions() {
13608
13608
  return {
@@ -13652,7 +13652,7 @@ const ih = G.create({
13652
13652
  "Shift-Enter": () => this.editor.commands.setHardBreak()
13653
13653
  };
13654
13654
  }
13655
- }), oh = re.create({
13655
+ }), lh = re.create({
13656
13656
  name: "heading",
13657
13657
  addOptions() {
13658
13658
  return {
@@ -13711,7 +13711,7 @@ H.prototype.prepend = function(e) {
13711
13711
  return e.length ? H.from(e).append(this) : this;
13712
13712
  };
13713
13713
  H.prototype.appendInner = function(e) {
13714
- return new lh(this, e);
13714
+ return new ah(this, e);
13715
13715
  };
13716
13716
  H.prototype.slice = function(e, t) {
13717
13717
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? H.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -13766,7 +13766,7 @@ var gl = /* @__PURE__ */ function(n) {
13766
13766
  }, Object.defineProperties(e.prototype, t), e;
13767
13767
  }(H);
13768
13768
  H.empty = new gl([]);
13769
- var lh = /* @__PURE__ */ function(n) {
13769
+ var ah = /* @__PURE__ */ function(n) {
13770
13770
  function e(t, r) {
13771
13771
  n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
13772
13772
  }
@@ -13799,7 +13799,7 @@ var lh = /* @__PURE__ */ function(n) {
13799
13799
  return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
13800
13800
  }, e;
13801
13801
  }(H);
13802
- const ah = 500;
13802
+ const ch = 500;
13803
13803
  class ge {
13804
13804
  constructor(e, t) {
13805
13805
  this.items = e, this.eventCount = t;
@@ -13841,7 +13841,7 @@ class ge {
13841
13841
  (h = a && a.merge(f)) && (f = h, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
13842
13842
  }
13843
13843
  let c = o - r.depth;
13844
- return c > dh && (l = ch(l, c), o -= c), new ge(l.append(s), o);
13844
+ return c > uh && (l = dh(l, c), o -= c), new ge(l.append(s), o);
13845
13845
  }
13846
13846
  remapping(e, t) {
13847
13847
  let r = new Vt();
@@ -13881,7 +13881,7 @@ class ge {
13881
13881
  for (let f = t; f < o; f++)
13882
13882
  c.push(new ke(s.maps[f]));
13883
13883
  let d = this.items.slice(0, i).append(c).append(r), u = new ge(d, l);
13884
- return u.emptyItemCount() > ah && (u = u.compress(this.items.length - r.length)), u;
13884
+ return u.emptyItemCount() > ch && (u = u.compress(this.items.length - r.length)), u;
13885
13885
  }
13886
13886
  emptyItemCount() {
13887
13887
  let e = 0;
@@ -13913,7 +13913,7 @@ class ge {
13913
13913
  }
13914
13914
  }
13915
13915
  ge.empty = new ge(H.empty, 0);
13916
- function ch(n, e) {
13916
+ function dh(n, e) {
13917
13917
  let t;
13918
13918
  return n.forEach((r, i) => {
13919
13919
  if (r.selection && e-- == 0)
@@ -13937,23 +13937,23 @@ class Pe {
13937
13937
  this.done = e, this.undone = t, this.prevRanges = r, this.prevTime = i, this.prevComposition = s;
13938
13938
  }
13939
13939
  }
13940
- const dh = 20;
13941
- function uh(n, e, t, r) {
13940
+ const uh = 20;
13941
+ function fh(n, e, t, r) {
13942
13942
  let i = t.getMeta(it), s;
13943
13943
  if (i)
13944
13944
  return i.historyState;
13945
- t.getMeta(ph) && (n = new Pe(n.done, n.undone, null, 0, -1));
13945
+ t.getMeta(mh) && (n = new Pe(n.done, n.undone, null, 0, -1));
13946
13946
  let o = t.getMeta("appendedTransaction");
13947
13947
  if (t.steps.length == 0)
13948
13948
  return n;
13949
13949
  if (o && o.getMeta(it))
13950
13950
  return o.getMeta(it).redo ? new Pe(n.done.addTransform(t, void 0, r, gn(e)), n.undone, ws(t.mapping.maps), n.prevTime, n.prevComposition) : new Pe(n.done, n.undone.addTransform(t, void 0, r, gn(e)), null, n.prevTime, n.prevComposition);
13951
13951
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13952
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !fh(t, n.prevRanges)), c = o ? hr(n.prevRanges, t.mapping) : ws(t.mapping.maps);
13952
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !hh(t, n.prevRanges)), c = o ? hr(n.prevRanges, t.mapping) : ws(t.mapping.maps);
13953
13953
  return new Pe(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, gn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
13954
13954
  } else return (s = t.getMeta("rebased")) ? new Pe(n.done.rebased(t, s), n.undone.rebased(t, s), hr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Pe(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), hr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13955
13955
  }
13956
- function fh(n, e) {
13956
+ function hh(n, e) {
13957
13957
  if (!e)
13958
13958
  return !1;
13959
13959
  if (!n.docChanged)
@@ -13980,7 +13980,7 @@ function hr(n, e) {
13980
13980
  }
13981
13981
  return t;
13982
13982
  }
13983
- function hh(n, e, t) {
13983
+ function ph(n, e, t) {
13984
13984
  let r = gn(e), i = it.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
13985
13985
  if (!s)
13986
13986
  return null;
@@ -14000,8 +14000,8 @@ function gn(n) {
14000
14000
  }
14001
14001
  return pr;
14002
14002
  }
14003
- const it = new Ce("history"), ph = new Ce("closeHistory");
14004
- function mh(n = {}) {
14003
+ const it = new Ce("history"), mh = new Ce("closeHistory");
14004
+ function gh(n = {}) {
14005
14005
  return n = {
14006
14006
  depth: n.depth || 100,
14007
14007
  newGroupDelay: n.newGroupDelay || 500
@@ -14012,7 +14012,7 @@ function mh(n = {}) {
14012
14012
  return new Pe(ge.empty, ge.empty, null, 0, -1);
14013
14013
  },
14014
14014
  apply(e, t, r) {
14015
- return uh(t, r, e, n);
14015
+ return fh(t, r, e, n);
14016
14016
  }
14017
14017
  },
14018
14018
  config: n,
@@ -14032,13 +14032,13 @@ function yl(n, e) {
14032
14032
  if (!i || (n ? i.undone : i.done).eventCount == 0)
14033
14033
  return !1;
14034
14034
  if (r) {
14035
- let s = hh(i, t, n);
14035
+ let s = ph(i, t, n);
14036
14036
  s && r(e ? s.scrollIntoView() : s);
14037
14037
  }
14038
14038
  return !0;
14039
14039
  };
14040
14040
  }
14041
- const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14041
+ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
14042
14042
  name: "history",
14043
14043
  addOptions() {
14044
14044
  return {
@@ -14054,7 +14054,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14054
14054
  },
14055
14055
  addProseMirrorPlugins() {
14056
14056
  return [
14057
- mh(this.options)
14057
+ gh(this.options)
14058
14058
  ];
14059
14059
  },
14060
14060
  addKeyboardShortcuts() {
@@ -14067,7 +14067,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14067
14067
  "Shift-Mod-я": () => this.editor.commands.redo()
14068
14068
  };
14069
14069
  }
14070
- }), yh = re.create({
14070
+ }), bh = re.create({
14071
14071
  name: "horizontalRule",
14072
14072
  addOptions() {
14073
14073
  return {
@@ -14084,7 +14084,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14084
14084
  addCommands() {
14085
14085
  return {
14086
14086
  setHorizontalRule: () => ({ chain: n, state: e }) => {
14087
- if (!Df(e, e.schema.nodes[this.name]))
14087
+ if (!If(e, e.schema.nodes[this.name]))
14088
14088
  return !1;
14089
14089
  const { selection: t } = e, { $from: r, $to: i } = t, s = n();
14090
14090
  return r.parentOffset === 0 ? s.insertContentAt({
@@ -14092,7 +14092,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14092
14092
  to: i.pos
14093
14093
  }, {
14094
14094
  type: this.name
14095
- }) : Zu(t) ? s.insertContentAt(i.pos, {
14095
+ }) : Qu(t) ? s.insertContentAt(i.pos, {
14096
14096
  type: this.name
14097
14097
  }) : s.insertContent({ type: this.name }), s.command(({ tr: o, dispatch: l }) => {
14098
14098
  var a;
@@ -14119,7 +14119,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14119
14119
  })
14120
14120
  ];
14121
14121
  }
14122
- }), bh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, kh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, xh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Sh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, wh = Me.create({
14122
+ }), kh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, xh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Sh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, wh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Mh = Me.create({
14123
14123
  name: "italic",
14124
14124
  addOptions() {
14125
14125
  return {
@@ -14163,11 +14163,11 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14163
14163
  addInputRules() {
14164
14164
  return [
14165
14165
  ct({
14166
- find: bh,
14166
+ find: kh,
14167
14167
  type: this.type
14168
14168
  }),
14169
14169
  ct({
14170
- find: xh,
14170
+ find: Sh,
14171
14171
  type: this.type
14172
14172
  })
14173
14173
  ];
@@ -14175,16 +14175,16 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14175
14175
  addPasteRules() {
14176
14176
  return [
14177
14177
  dt({
14178
- find: kh,
14178
+ find: xh,
14179
14179
  type: this.type
14180
14180
  }),
14181
14181
  dt({
14182
- find: Sh,
14182
+ find: wh,
14183
14183
  type: this.type
14184
14184
  })
14185
14185
  ];
14186
14186
  }
14187
- }), Mh = re.create({
14187
+ }), Ch = re.create({
14188
14188
  name: "listItem",
14189
14189
  addOptions() {
14190
14190
  return {
@@ -14212,7 +14212,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14212
14212
  "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
14213
14213
  };
14214
14214
  }
14215
- }), Ch = "listItem", Cs = "textStyle", Ts = /^(\d+)\.\s$/, Th = re.create({
14215
+ }), Th = "listItem", Cs = "textStyle", Ts = /^(\d+)\.\s$/, Oh = re.create({
14216
14216
  name: "orderedList",
14217
14217
  addOptions() {
14218
14218
  return {
@@ -14251,7 +14251,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14251
14251
  },
14252
14252
  addCommands() {
14253
14253
  return {
14254
- toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ch, this.editor.getAttributes(Cs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14254
+ toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Th, this.editor.getAttributes(Cs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14255
14255
  };
14256
14256
  },
14257
14257
  addKeyboardShortcuts() {
@@ -14278,7 +14278,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14278
14278
  n
14279
14279
  ];
14280
14280
  }
14281
- }), Oh = re.create({
14281
+ }), vh = re.create({
14282
14282
  name: "paragraph",
14283
14283
  priority: 1e3,
14284
14284
  addOptions() {
@@ -14306,7 +14306,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14306
14306
  "Mod-Alt-0": () => this.editor.commands.setParagraph()
14307
14307
  };
14308
14308
  }
14309
- }), vh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Eh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Ah = Me.create({
14309
+ }), Eh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Ah = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Nh = Me.create({
14310
14310
  name: "strike",
14311
14311
  addOptions() {
14312
14312
  return {
@@ -14349,7 +14349,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14349
14349
  addInputRules() {
14350
14350
  return [
14351
14351
  ct({
14352
- find: vh,
14352
+ find: Eh,
14353
14353
  type: this.type
14354
14354
  })
14355
14355
  ];
@@ -14357,21 +14357,21 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14357
14357
  addPasteRules() {
14358
14358
  return [
14359
14359
  dt({
14360
- find: Eh,
14360
+ find: Ah,
14361
14361
  type: this.type
14362
14362
  })
14363
14363
  ];
14364
14364
  }
14365
- }), Nh = re.create({
14365
+ }), Dh = re.create({
14366
14366
  name: "text",
14367
14367
  group: "inline"
14368
- }), Dh = G.create({
14368
+ }), Ih = G.create({
14369
14369
  name: "starterKit",
14370
14370
  addExtensions() {
14371
14371
  const n = [];
14372
- return this.options.bold !== !1 && n.push(Ff.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Rf.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Vf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(qf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push(Jf.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Uf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(Xf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(ih.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(sh.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(oh.configure(this.options.heading)), this.options.history !== !1 && n.push(gh.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(yh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(wh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(Mh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(Th.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(Oh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(Ah.configure(this.options.strike)), this.options.text !== !1 && n.push(Nh.configure(this.options.text)), n;
14372
+ return this.options.bold !== !1 && n.push($f.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Pf.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Hf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(jf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push(Uf.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(_f.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(Yf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(sh.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(oh.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(lh.configure(this.options.heading)), this.options.history !== !1 && n.push(yh.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(bh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(Mh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(Ch.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(Oh.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(vh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(Nh.configure(this.options.strike)), this.options.text !== !1 && n.push(Dh.configure(this.options.text)), n;
14373
14373
  }
14374
- }), Ih = (n) => {
14374
+ }), Rh = (n) => {
14375
14375
  if (!n.children.length)
14376
14376
  return;
14377
14377
  const e = n.querySelectorAll("span");
@@ -14380,7 +14380,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14380
14380
  const s = t.getAttribute("style"), o = (i = (r = t.parentElement) === null || r === void 0 ? void 0 : r.closest("span")) === null || i === void 0 ? void 0 : i.getAttribute("style");
14381
14381
  t.setAttribute("style", `${o};${s}`);
14382
14382
  });
14383
- }, Rh = Me.create({
14383
+ }, Ph = Me.create({
14384
14384
  name: "textStyle",
14385
14385
  priority: 101,
14386
14386
  addOptions() {
@@ -14393,7 +14393,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14393
14393
  return [
14394
14394
  {
14395
14395
  tag: "span",
14396
- getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && Ih(n), {}) : !1
14396
+ getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && Rh(n), {}) : !1
14397
14397
  }
14398
14398
  ];
14399
14399
  },
@@ -14412,7 +14412,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14412
14412
  }
14413
14413
  };
14414
14414
  }
14415
- }), Ph = G.create({
14415
+ }), Bh = G.create({
14416
14416
  name: "color",
14417
14417
  addOptions() {
14418
14418
  return {
@@ -14444,7 +14444,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14444
14444
  unsetColor: () => ({ chain: n }) => n().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
14445
14445
  };
14446
14446
  }
14447
- }), Bh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Lh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, zh = Me.create({
14447
+ }), Lh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, zh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Fh = Me.create({
14448
14448
  name: "highlight",
14449
14449
  addOptions() {
14450
14450
  return {
@@ -14489,7 +14489,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14489
14489
  addInputRules() {
14490
14490
  return [
14491
14491
  ct({
14492
- find: Bh,
14492
+ find: Lh,
14493
14493
  type: this.type
14494
14494
  })
14495
14495
  ];
@@ -14497,12 +14497,12 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14497
14497
  addPasteRules() {
14498
14498
  return [
14499
14499
  dt({
14500
- find: Lh,
14500
+ find: zh,
14501
14501
  type: this.type
14502
14502
  })
14503
14503
  ];
14504
14504
  }
14505
- }), Fh = G.create({
14505
+ }), $h = G.create({
14506
14506
  name: "textAlign",
14507
14507
  addOptions() {
14508
14508
  return {
@@ -14543,7 +14543,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14543
14543
  "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
14544
14544
  };
14545
14545
  }
14546
- }), $h = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Vh = re.create({
14546
+ }), Vh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Hh = re.create({
14547
14547
  name: "image",
14548
14548
  addOptions() {
14549
14549
  return {
@@ -14593,7 +14593,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14593
14593
  addInputRules() {
14594
14594
  return [
14595
14595
  pl({
14596
- find: $h,
14596
+ find: Vh,
14597
14597
  type: this.type,
14598
14598
  getAttributes: (n) => {
14599
14599
  const [, , e, t, r] = n;
@@ -14604,7 +14604,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
14604
14604
  }
14605
14605
  });
14606
14606
  var ie, Qt, en, de, Fr, xl, Sl, wl, Ml;
14607
- class Hh extends Rl {
14607
+ class Wh extends Pl {
14608
14608
  constructor() {
14609
14609
  super();
14610
14610
  B(this, de);
@@ -14658,7 +14658,7 @@ Fr = function() {
14658
14658
  const t = zt.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14659
14659
  this.shadowRoot.innerHTML = `
14660
14660
  <style>
14661
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.112/dist/css/nineEditor.css";
14661
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.114/dist/css/nineEditor.css";
14662
14662
  ${r}
14663
14663
  </style>
14664
14664
 
@@ -14698,22 +14698,22 @@ Fr = function() {
14698
14698
  console.log(i.target, s), O(this, ie).chain().focus().setMark("textStyle", { fontSize: s }).run();
14699
14699
  };
14700
14700
  }, Sl = function() {
14701
- Y(this, ie, new Nf({
14701
+ Y(this, ie, new Df({
14702
14702
  element: O(this, Qt),
14703
14703
  editable: !this.readonly,
14704
14704
  // 4. 생성 시 readonly 여부 반영
14705
14705
  extensions: [
14706
- Dh,
14706
+ Ih,
14707
14707
  // 기본 셋 (Bold, Italic, Strike 등 포함)
14708
14708
  //Underline, // StarterKit에 없으므로 유지
14709
- Ph,
14709
+ Bh,
14710
14710
  // StarterKit에 없으므로 유지
14711
- zh.configure({ multicolor: !0 }),
14712
- Fh.configure({ types: ["heading", "paragraph"] }),
14713
- Vh.configure({ inline: !0, allowBase64: !0 }),
14711
+ Fh.configure({ multicolor: !0 }),
14712
+ $h.configure({ types: ["heading", "paragraph"] }),
14713
+ Hh.configure({ inline: !0, allowBase64: !0 }),
14714
14714
  // TextStyle은 여기서 'extend'로 직접 정의하므로
14715
14715
  // 배열에 별도의 TextStyle을 또 넣지 마세요.
14716
- Rh.extend({
14716
+ Ph.extend({
14717
14717
  addAttributes() {
14718
14718
  return {
14719
14719
  fontSize: {
@@ -14767,14 +14767,14 @@ const ve = typeof window < "u" && window.nine ? window.nine : Es, Os = {
14767
14767
  console.log(ve, window.nine);
14768
14768
  const { nativeOverride: n } = ((t = ve == null ? void 0 : ve.config) == null ? void 0 : t.ux) || {}, e = Array.isArray(n) ? n : n === !0 ? ["alert", "confirm"] : [];
14769
14769
  console.log(ve, e), window.alert = e.includes("alert") ? (r) => zt.alert(r) : Os.alert, window.confirm = e.includes("confirm") ? async (r) => await zt.confirm(r) : Os.confirm, ve.config.debug && e.length > 0 && console.log(`[nine-ux] Native API Overridden: ${e.join(", ")}`);
14770
- }, Wh = () => {
14770
+ }, qh = () => {
14771
14771
  vs(), ve == null || ve.subscribeConfig((n) => {
14772
14772
  (n === "ux" || n === "config") && vs();
14773
14773
  });
14774
14774
  };
14775
- Wh();
14775
+ qh();
14776
14776
  var xt, St, ye, Cl, It, Tl;
14777
- class qh extends HTMLElement {
14777
+ class jh extends HTMLElement {
14778
14778
  constructor() {
14779
14779
  super();
14780
14780
  B(this, ye);
@@ -14805,7 +14805,7 @@ xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Cl = async function(
14805
14805
  const t = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || this.textContent.trim() || "", i = this.getAttribute("css-path");
14806
14806
  O(this, St).innerHTML = `
14807
14807
  <style>
14808
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.112/dist/css/nine-code-block.css";
14808
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.114/dist/css/nine-code-block.css";
14809
14809
  ${i ? `@import "${i}";` : ""}
14810
14810
  </style>
14811
14811
 
@@ -14828,5 +14828,5 @@ xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Cl = async function(
14828
14828
  const r = document.createElement("div");
14829
14829
  return r.textContent = t, r.innerHTML;
14830
14830
  };
14831
- typeof window < "u" && (customElements.get("nine-code-block") || customElements.define("nine-code-block", qh));
14832
- typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", Hh));
14831
+ typeof window < "u" && (customElements.get("nine-code-block") || customElements.define("nine-code-block", jh));
14832
+ typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", Wh));