@nine-lab/nine-ux 0.1.42 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,10 @@ var ii = (n) => {
3
3
  throw TypeError(n);
4
4
  };
5
5
  var gl = (n, e, t) => e in n ? ml(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
- var ye = (n, e, t) => gl(n, typeof e != "symbol" ? e + "" : e, t), Wn = (n, e, t) => e.has(n) || ii("Cannot " + t);
7
- var O = (n, e, t) => (Wn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Wn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Q = (n, e, t) => (Wn(n, e, "access private method"), t);
6
+ var ye = (n, e, t) => gl(n, typeof e != "symbol" ? e + "" : e, t), Hn = (n, e, t) => e.has(n) || ii("Cannot " + t);
7
+ var O = (n, e, t) => (Hn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Hn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Q = (n, e, t) => (Hn(n, e, "access private method"), t);
8
8
  import { nine as yl } from "@nine-lab/nine-util";
9
+ import { nine as Ph } from "@nine-lab/nine-util";
9
10
  const bl = `
10
11
  dialog::backdrop {
11
12
  background: rgba(0, 0, 0, 0.3);
@@ -410,7 +411,7 @@ class kl extends HTMLElement {
410
411
  }
411
412
  Oe = new WeakMap(), q = new WeakMap(), Cn = new WeakMap(), Tn = new WeakMap(), On = new WeakMap();
412
413
  customElements.get("nine-dialog") || customElements.define("nine-dialog", kl);
413
- class Ir extends HTMLElement {
414
+ class Dr extends HTMLElement {
414
415
  constructor() {
415
416
  super(), this.attachShadow({ mode: "open" });
416
417
  }
@@ -426,14 +427,14 @@ class Ir extends HTMLElement {
426
427
  `;
427
428
  }
428
429
  }
429
- ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
430
+ ye(Dr, "confirm", async (e, t = "Confirm", r = {}) => {
430
431
  var d;
431
432
  const i = {
432
433
  "true-text": "Yes",
433
434
  "false-text": "No",
434
435
  class: "",
435
436
  animation: "",
436
- ...((d = Nn.options) == null ? void 0 : d.confirm) || {},
437
+ ...((d = Rr.options) == null ? void 0 : d.confirm) || {},
437
438
  ...r
438
439
  };
439
440
  document.querySelectorAll("nine-confirm-popup").forEach((u) => u.remove());
@@ -448,7 +449,7 @@ ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
448
449
  }, o.addEventListener("close", () => u(void 0)), o.showModal();
449
450
  });
450
451
  });
451
- class Rr extends HTMLElement {
452
+ class Ir extends HTMLElement {
452
453
  constructor() {
453
454
  super(), this.attachShadow({ mode: "open" });
454
455
  }
@@ -463,12 +464,12 @@ class Rr extends HTMLElement {
463
464
  `;
464
465
  }
465
466
  }
466
- ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
467
+ ye(Ir, "alert", async (e, t = "Alert", r = {}) => {
467
468
  var c;
468
469
  const i = {
469
470
  class: "",
470
471
  animation: "",
471
- ...((c = Nn.options) == null ? void 0 : c.alert) || {},
472
+ ...((c = Rr.options) == null ? void 0 : c.alert) || {},
472
473
  ...r
473
474
  };
474
475
  document.querySelectorAll("nine-alert-popup").forEach((d) => d.remove());
@@ -482,8 +483,8 @@ ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
482
483
  l.onclick = u, o.showModal();
483
484
  });
484
485
  });
485
- customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Ir);
486
- customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Rr);
486
+ customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Dr);
487
+ customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Ir);
487
488
  var Wt;
488
489
  class xl {
489
490
  constructor() {
@@ -500,10 +501,10 @@ class xl {
500
501
  // 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
501
502
  // 오직 팝업을 실행하는 인터페이스 역할만 수행.
502
503
  async alert(e, t = "Alert", r = {}) {
503
- return await Rr.alert(e, t, r);
504
+ return await Ir.alert(e, t, r);
504
505
  }
505
506
  async confirm(e, t = "Confirm", r = {}) {
506
- return await Ir.confirm(e, t, r);
507
+ return await Dr.confirm(e, t, r);
507
508
  }
508
509
  /**
509
510
  * 컴포넌트별 CSS 경로 생성 헬퍼 (복구!)
@@ -514,8 +515,8 @@ class xl {
514
515
  }
515
516
  }
516
517
  Wt = new WeakMap();
517
- const Nn = new xl();
518
- var qt, Xe, jt, ae, Ct, cr, dr, Kt, En;
518
+ const Rr = new xl();
519
+ var qt, Xe, jt, ae, Ct, ar, cr, Kt, En;
519
520
  class Sl extends HTMLElement {
520
521
  constructor() {
521
522
  super();
@@ -540,20 +541,20 @@ class Sl extends HTMLElement {
540
541
  });
541
542
  // 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
542
543
  ye(this, "clearData", (t = {}) => {
543
- Q(this, ae, dr).call(this), Q(this, ae, Ct).call(this).forEach((r) => {
544
+ Q(this, ae, cr).call(this), Q(this, ae, Ct).call(this).forEach((r) => {
544
545
  const i = r.name;
545
546
  if (!i) return;
546
547
  const s = t && t[i] !== void 0 ? t[i] : "";
547
- Q(this, ae, cr).call(this, r, s);
548
+ Q(this, ae, ar).call(this, r, s);
548
549
  }), this.changed = !1;
549
550
  });
550
551
  ye(this, "setData", (t) => {
551
552
  if (!t || typeof t != "object") return;
552
- Q(this, ae, dr).call(this);
553
+ Q(this, ae, cr).call(this);
553
554
  let r = !1;
554
555
  Q(this, ae, Ct).call(this).forEach((i) => {
555
556
  const s = i.name;
556
- !s || !t.hasOwnProperty(s) || Q(this, ae, cr).call(this, i, t[s]) && (r = !0);
557
+ !s || !t.hasOwnProperty(s) || Q(this, ae, ar).call(this, i, t[s]) && (r = !0);
557
558
  }), r && (this.changed = !0);
558
559
  });
559
560
  ye(this, "initData", (t) => {
@@ -592,7 +593,7 @@ qt = new WeakMap(), Xe = new WeakMap(), jt = new WeakMap(), ae = new WeakSet(),
592
593
  Ct = function() {
593
594
  return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Xe));
594
595
  }, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
595
- cr = function(t, r) {
596
+ ar = function(t, r) {
596
597
  const i = t.tagName.toUpperCase(), s = t.type;
597
598
  let o = !1;
598
599
  if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(i))
@@ -608,7 +609,7 @@ cr = function(t, r) {
608
609
  t.textContent !== r && (o = !0), t.textContent = r;
609
610
  return o;
610
611
  }, // [공통 로직 2] 이벤트 리스너 일괄 등록
611
- dr = function() {
612
+ cr = function() {
612
613
  Q(this, ae, Ct).call(this).forEach((t) => {
613
614
  t.removeEventListener("input", O(this, Kt)), t.addEventListener("input", O(this, Kt));
614
615
  });
@@ -1015,9 +1016,9 @@ class b {
1015
1016
  }
1016
1017
  }
1017
1018
  b.empty = new b([], 0);
1018
- const qn = { index: 0, offset: 0 };
1019
+ const Wn = { index: 0, offset: 0 };
1019
1020
  function Xt(n, e) {
1020
- return qn.index = n, qn.offset = e, qn;
1021
+ return Wn.index = n, Wn.offset = e, Wn;
1021
1022
  }
1022
1023
  function dn(n, e) {
1023
1024
  if (n === e)
@@ -1043,7 +1044,7 @@ function dn(n, e) {
1043
1044
  }
1044
1045
  return !0;
1045
1046
  }
1046
- let A = class ur {
1047
+ let A = class dr {
1047
1048
  /**
1048
1049
  @internal
1049
1050
  */
@@ -1141,8 +1142,8 @@ let A = class ur {
1141
1142
  */
1142
1143
  static setFrom(e) {
1143
1144
  if (!e || Array.isArray(e) && e.length == 0)
1144
- return ur.none;
1145
- if (e instanceof ur)
1145
+ return dr.none;
1146
+ if (e instanceof dr)
1146
1147
  return [e];
1147
1148
  let t = e.slice();
1148
1149
  return t.sort((r, i) => r.type.rank - i.type.rank), t;
@@ -1276,7 +1277,7 @@ function Cs(n, e) {
1276
1277
  if (!e.type.compatibleContent(n.type))
1277
1278
  throw new un("Cannot join " + e.type.name + " onto " + n.type.name);
1278
1279
  }
1279
- function fr(n, e, t) {
1280
+ function ur(n, e, t) {
1280
1281
  let r = n.node(t);
1281
1282
  return Cs(r, e.node(t)), r;
1282
1283
  }
@@ -1295,13 +1296,13 @@ function Qe(n, e) {
1295
1296
  return n.type.checkContent(e), n.copy(e);
1296
1297
  }
1297
1298
  function Ts(n, e, t, r, i) {
1298
- let s = n.depth > i && fr(n, e, i + 1), o = r.depth > i && fr(t, r, i + 1), l = [];
1299
+ let s = n.depth > i && ur(n, e, i + 1), o = r.depth > i && ur(t, r, i + 1), l = [];
1299
1300
  return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Cs(s, o), Ze(Qe(s, Ts(n, e, t, r, i + 1)), l)) : (s && Ze(Qe(s, fn(n, e, i + 1)), l), Nt(e, t, i, l), o && Ze(Qe(o, fn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
1300
1301
  }
1301
1302
  function fn(n, e, t) {
1302
1303
  let r = [];
1303
1304
  if (Nt(null, n, t, r), n.depth > t) {
1304
- let i = fr(n, e, t + 1);
1305
+ let i = ur(n, e, t + 1);
1305
1306
  Ze(Qe(i, fn(n, e, t + 1)), r);
1306
1307
  }
1307
1308
  return Nt(e, null, t, r), new b(r);
@@ -1609,7 +1610,7 @@ class hn {
1609
1610
  }
1610
1611
  }
1611
1612
  const Ol = /* @__PURE__ */ Object.create(null);
1612
- let ze = class hr {
1613
+ let ze = class fr {
1613
1614
  /**
1614
1615
  @internal
1615
1616
  */
@@ -1734,14 +1735,14 @@ let ze = class hr {
1734
1735
  the given content (or empty, if no content is given).
1735
1736
  */
1736
1737
  copy(e = null) {
1737
- return e == this.content ? this : new hr(this.type, this.attrs, e, this.marks);
1738
+ return e == this.content ? this : new fr(this.type, this.attrs, e, this.marks);
1738
1739
  }
1739
1740
  /**
1740
1741
  Create a copy of this node, with the given set of marks instead
1741
1742
  of the node's own marks.
1742
1743
  */
1743
1744
  mark(e) {
1744
- return e == this.marks ? this : new hr(this.type, this.attrs, this.content, e);
1745
+ return e == this.marks ? this : new fr(this.type, this.attrs, this.content, e);
1745
1746
  }
1746
1747
  /**
1747
1748
  Create a copy of this node with only the content between the
@@ -2601,7 +2602,7 @@ class zl {
2601
2602
  return !this.hasDefault;
2602
2603
  }
2603
2604
  }
2604
- class vn {
2605
+ class Nn {
2605
2606
  /**
2606
2607
  @internal
2607
2608
  */
@@ -2623,7 +2624,7 @@ class vn {
2623
2624
  */
2624
2625
  static compile(e, t) {
2625
2626
  let r = /* @__PURE__ */ Object.create(null), i = 0;
2626
- return e.forEach((s, o) => r[s] = new vn(s, i++, t, o)), r;
2627
+ return e.forEach((s, o) => r[s] = new Nn(s, i++, t, o)), r;
2627
2628
  }
2628
2629
  /**
2629
2630
  When there is a mark of this type in the given set, a new set
@@ -2665,7 +2666,7 @@ class Ps {
2665
2666
  let t = this.spec = {};
2666
2667
  for (let i in e)
2667
2668
  t[i] = e[i];
2668
- t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = vn.compile(this.spec.marks, this);
2669
+ t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = Nn.compile(this.spec.marks, this);
2669
2670
  let r = /* @__PURE__ */ Object.create(null);
2670
2671
  for (let i in this.nodes) {
2671
2672
  if (i in this.marks)
@@ -2902,9 +2903,9 @@ const Bs = {
2902
2903
  script: !0,
2903
2904
  style: !0,
2904
2905
  title: !0
2905
- }, Ls = { ol: !0, ul: !0 }, Rt = 1, pr = 2, vt = 4;
2906
+ }, Ls = { ol: !0, ul: !0 }, Rt = 1, hr = 2, vt = 4;
2906
2907
  function di(n, e, t) {
2907
- return e != null ? (e ? Rt : 0) | (e === "full" ? pr : 0) : n && n.whitespace == "pre" ? Rt | pr : t & ~vt;
2908
+ return e != null ? (e ? Rt : 0) | (e === "full" ? hr : 0) : n && n.whitespace == "pre" ? Rt | hr : t & ~vt;
2908
2909
  }
2909
2910
  class Zt {
2910
2911
  constructor(e, t, r, i, s, o) {
@@ -2955,7 +2956,7 @@ class ui {
2955
2956
  e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
2956
2957
  }
2957
2958
  addTextNode(e, t) {
2958
- let r = e.nodeValue, i = this.top, s = i.options & pr ? "full" : this.localPreserveWS || (i.options & Rt) > 0, { schema: o } = this.parser;
2959
+ let r = e.nodeValue, i = this.top, s = i.options & hr ? "full" : this.localPreserveWS || (i.options & Rt) > 0, { schema: o } = this.parser;
2959
2960
  if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
2960
2961
  if (s)
2961
2962
  if (s === "full")
@@ -3274,7 +3275,7 @@ class ct {
3274
3275
  nodes.
3275
3276
  */
3276
3277
  serializeFragment(e, t = {}, r) {
3277
- r || (r = jn(t).createDocumentFragment());
3278
+ r || (r = qn(t).createDocumentFragment());
3278
3279
  let i = r, s = [];
3279
3280
  return e.forEach((o) => {
3280
3281
  if (s.length || o.marks.length) {
@@ -3303,7 +3304,7 @@ class ct {
3303
3304
  @internal
3304
3305
  */
3305
3306
  serializeNodeInner(e, t) {
3306
- let { dom: r, contentDOM: i } = on(jn(t), this.nodes[e.type.name](e), null, e.attrs);
3307
+ let { dom: r, contentDOM: i } = on(qn(t), this.nodes[e.type.name](e), null, e.attrs);
3307
3308
  if (i) {
3308
3309
  if (e.isLeaf)
3309
3310
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -3331,7 +3332,7 @@ class ct {
3331
3332
  */
3332
3333
  serializeMark(e, t, r = {}) {
3333
3334
  let i = this.marks[e.type.name];
3334
- return i && on(jn(r), i(e, t), null, e.attrs);
3335
+ return i && on(qn(r), i(e, t), null, e.attrs);
3335
3336
  }
3336
3337
  static renderSpec(e, t, r = null, i) {
3337
3338
  return on(e, t, r, i);
@@ -3366,7 +3367,7 @@ function pi(n) {
3366
3367
  }
3367
3368
  return e;
3368
3369
  }
3369
- function jn(n) {
3370
+ function qn(n) {
3370
3371
  return n.document || window.document;
3371
3372
  }
3372
3373
  const mi = /* @__PURE__ */ new WeakMap();
@@ -3441,7 +3442,7 @@ function Jl(n) {
3441
3442
  return (n - (n & zs)) / Fs;
3442
3443
  }
3443
3444
  const $s = 1, Vs = 2, ln = 4, Hs = 8;
3444
- class mr {
3445
+ class pr {
3445
3446
  /**
3446
3447
  @internal
3447
3448
  */
@@ -3518,11 +3519,11 @@ class le {
3518
3519
  if (r)
3519
3520
  return h;
3520
3521
  let p = e == (t < 0 ? a : u) ? null : Kl(l / 3, e - a), m = e == a ? Vs : e == u ? $s : ln;
3521
- return (t < 0 ? e != a : e != u) && (m |= Hs), new mr(h, m, p);
3522
+ return (t < 0 ? e != a : e != u) && (m |= Hs), new pr(h, m, p);
3522
3523
  }
3523
3524
  i += d - c;
3524
3525
  }
3525
- return r ? e + i : new mr(e + i, 0, null);
3526
+ return r ? e + i : new pr(e + i, 0, null);
3526
3527
  }
3527
3528
  /**
3528
3529
  @internal
@@ -3678,10 +3679,10 @@ class Pt {
3678
3679
  }
3679
3680
  i |= l.delInfo, e = l.pos;
3680
3681
  }
3681
- return r ? e : new mr(e, i, null);
3682
+ return r ? e : new pr(e, i, null);
3682
3683
  }
3683
3684
  }
3684
- const Kn = /* @__PURE__ */ Object.create(null);
3685
+ const jn = /* @__PURE__ */ Object.create(null);
3685
3686
  class Z {
3686
3687
  /**
3687
3688
  Get the step map that represents the changes made by this step,
@@ -3706,7 +3707,7 @@ class Z {
3706
3707
  static fromJSON(e, t) {
3707
3708
  if (!t || !t.stepType)
3708
3709
  throw new RangeError("Invalid input for Step.fromJSON");
3709
- let r = Kn[t.stepType];
3710
+ let r = jn[t.stepType];
3710
3711
  if (!r)
3711
3712
  throw new RangeError(`No step type ${t.stepType} defined`);
3712
3713
  return r.fromJSON(e, t);
@@ -3718,9 +3719,9 @@ class Z {
3718
3719
  that's unlikely to clash with steps from other modules.
3719
3720
  */
3720
3721
  static jsonID(e, t) {
3721
- if (e in Kn)
3722
+ if (e in jn)
3722
3723
  throw new RangeError("Duplicate use of step JSON ID " + e);
3723
- return Kn[e] = t, t.prototype.jsonID = e, t;
3724
+ return jn[e] = t, t.prototype.jsonID = e, t;
3724
3725
  }
3725
3726
  }
3726
3727
  class B {
@@ -3936,7 +3937,7 @@ class P extends Z {
3936
3937
  super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
3937
3938
  }
3938
3939
  apply(e) {
3939
- return this.structure && gr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3940
+ return this.structure && mr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3940
3941
  }
3941
3942
  getMap() {
3942
3943
  return new le([this.from, this.to - this.from, this.slice.size]);
@@ -3986,7 +3987,7 @@ class F extends Z {
3986
3987
  super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
3987
3988
  }
3988
3989
  apply(e) {
3989
- if (this.structure && (gr(e, this.from, this.gapFrom) || gr(e, this.gapTo, this.to)))
3990
+ if (this.structure && (mr(e, this.from, this.gapFrom) || mr(e, this.gapTo, this.to)))
3990
3991
  return B.fail("Structure gap-replace would overwrite content");
3991
3992
  let t = e.slice(this.gapFrom, this.gapTo);
3992
3993
  if (t.openStart || t.openEnd)
@@ -4033,7 +4034,7 @@ class F extends Z {
4033
4034
  }
4034
4035
  }
4035
4036
  Z.jsonID("replaceAround", F);
4036
- function gr(n, e, t) {
4037
+ function mr(n, e, t) {
4037
4038
  let r = n.resolve(e), i = t - e, s = r.depth;
4038
4039
  for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
4039
4040
  s--, i--;
@@ -4068,7 +4069,7 @@ function _l(n, e, t, r) {
4068
4069
  return;
4069
4070
  s++;
4070
4071
  let a = null;
4071
- if (r instanceof vn) {
4072
+ if (r instanceof Nn) {
4072
4073
  let c = o.marks, d;
4073
4074
  for (; d = r.isInSet(c); )
4074
4075
  (a || (a = [])).push(d), c = d.removeFromSet(c);
@@ -4268,7 +4269,7 @@ function ia(n, e) {
4268
4269
  function js(n, e) {
4269
4270
  return !!(n && e && !n.isLeaf && ia(n, e));
4270
4271
  }
4271
- function An(n, e, t = -1) {
4272
+ function vn(n, e, t = -1) {
4272
4273
  let r = n.resolve(e);
4273
4274
  for (let i = r.depth; ; i--) {
4274
4275
  let s, o, l = r.index(i);
@@ -4341,7 +4342,7 @@ function Ks(n, e, t) {
4341
4342
  }
4342
4343
  return null;
4343
4344
  }
4344
- function Dn(n, e, t = e, r = k.empty) {
4345
+ function An(n, e, t = e, r = k.empty) {
4345
4346
  if (e == t && !r.size)
4346
4347
  return null;
4347
4348
  let i = n.resolve(e), s = n.resolve(t);
@@ -4396,7 +4397,7 @@ class la {
4396
4397
  for (let t = 1; t <= 2; t++)
4397
4398
  for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
4398
4399
  let i, s = null;
4399
- r ? (s = Jn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4400
+ r ? (s = Kn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4400
4401
  let o = i.firstChild;
4401
4402
  for (let l = this.depth; l >= 0; l--) {
4402
4403
  let { type: a, match: c } = this.frontier[l], d, u = null;
@@ -4410,11 +4411,11 @@ class la {
4410
4411
  }
4411
4412
  }
4412
4413
  openMore() {
4413
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
4414
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Kn(e, t);
4414
4415
  return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new k(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
4415
4416
  }
4416
4417
  dropNode() {
4417
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
4418
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Kn(e, t);
4418
4419
  if (i.childCount <= 1 && t > 0) {
4419
4420
  let s = e.size - t <= t + i.size;
4420
4421
  this.unplaced = new k(Tt(e, t - 1, 1), t - 1, s ? t - 1 : r);
@@ -4455,7 +4456,7 @@ class la {
4455
4456
  if (!this.$to.parent.isTextblock)
4456
4457
  return -1;
4457
4458
  let e = this.frontier[this.depth], t;
4458
- if (!e.type.isTextblock || !Un(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4459
+ if (!e.type.isTextblock || !Jn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4459
4460
  return -1;
4460
4461
  let { depth: r } = this.$to, i = this.$to.after(r);
4461
4462
  for (; r > 1 && i == this.$to.end(--r); )
@@ -4464,10 +4465,10 @@ class la {
4464
4465
  }
4465
4466
  findCloseLevel(e) {
4466
4467
  e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
4467
- let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Un(e, t, i, r, s);
4468
+ let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Jn(e, t, i, r, s);
4468
4469
  if (o) {
4469
4470
  for (let l = t - 1; l >= 0; l--) {
4470
- let { match: a, type: c } = this.frontier[l], d = Un(e, l, c, a, !0);
4471
+ let { match: a, type: c } = this.frontier[l], d = Jn(e, l, c, a, !0);
4471
4472
  if (!d || d.childCount)
4472
4473
  continue e;
4473
4474
  }
@@ -4503,7 +4504,7 @@ function Tt(n, e, t) {
4503
4504
  function Ot(n, e, t) {
4504
4505
  return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Ot(n.lastChild.content, e - 1, t)));
4505
4506
  }
4506
- function Jn(n, e) {
4507
+ function Kn(n, e) {
4507
4508
  for (let t = 0; t < e; t++)
4508
4509
  n = n.firstChild.content;
4509
4510
  return n;
@@ -4514,7 +4515,7 @@ function Us(n, e, t) {
4514
4515
  let r = n.content;
4515
4516
  return e > 1 && (r = r.replaceChild(0, Us(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
4516
4517
  }
4517
- function Un(n, e, t, r, i) {
4518
+ function Jn(n, e, t, r, i) {
4518
4519
  let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
4519
4520
  if (o == s.childCount && !t.compatibleContent(s.type))
4520
4521
  return null;
@@ -4780,7 +4781,7 @@ class ha {
4780
4781
  given `slice`.
4781
4782
  */
4782
4783
  replace(e, t = e, r = k.empty) {
4783
- let i = Dn(this.doc, e, t, r);
4784
+ let i = An(this.doc, e, t, r);
4784
4785
  return i && this.step(i), this;
4785
4786
  }
4786
4787
  /**
@@ -4956,7 +4957,7 @@ class ha {
4956
4957
  return Br(this, e, t, r), this;
4957
4958
  }
4958
4959
  }
4959
- const _n = /* @__PURE__ */ Object.create(null);
4960
+ const Un = /* @__PURE__ */ Object.create(null);
4960
4961
  class E {
4961
4962
  /**
4962
4963
  Initialize a selection with the head and anchor and ranges. If no
@@ -5092,7 +5093,7 @@ class E {
5092
5093
  static fromJSON(e, t) {
5093
5094
  if (!t || !t.type)
5094
5095
  throw new RangeError("Invalid input for Selection.fromJSON");
5095
- let r = _n[t.type];
5096
+ let r = Un[t.type];
5096
5097
  if (!r)
5097
5098
  throw new RangeError(`No selection type ${t.type} defined`);
5098
5099
  return r.fromJSON(e, t);
@@ -5104,9 +5105,9 @@ class E {
5104
5105
  clash with classes from other modules.
5105
5106
  */
5106
5107
  static jsonID(e, t) {
5107
- if (e in _n)
5108
+ if (e in Un)
5108
5109
  throw new RangeError("Duplicate use of selection JSON ID " + e);
5109
- return _n[e] = t, t.prototype.jsonID = e, t;
5110
+ return Un[e] = t, t.prototype.jsonID = e, t;
5110
5111
  }
5111
5112
  /**
5112
5113
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
@@ -5165,7 +5166,7 @@ class M extends E {
5165
5166
  return e instanceof M && e.anchor == this.anchor && e.head == this.head;
5166
5167
  }
5167
5168
  getBookmark() {
5168
- return new In(this.anchor, this.head);
5169
+ return new Dn(this.anchor, this.head);
5169
5170
  }
5170
5171
  toJSON() {
5171
5172
  return { type: "text", anchor: this.anchor, head: this.head };
@@ -5206,12 +5207,12 @@ class M extends E {
5206
5207
  }
5207
5208
  }
5208
5209
  E.jsonID("text", M);
5209
- class In {
5210
+ class Dn {
5210
5211
  constructor(e, t) {
5211
5212
  this.anchor = e, this.head = t;
5212
5213
  }
5213
5214
  map(e) {
5214
- return new In(e.map(this.anchor), e.map(this.head));
5215
+ return new Dn(e.map(this.anchor), e.map(this.head));
5215
5216
  }
5216
5217
  resolve(e) {
5217
5218
  return M.between(e.resolve(this.anchor), e.resolve(this.head));
@@ -5272,7 +5273,7 @@ class zr {
5272
5273
  }
5273
5274
  map(e) {
5274
5275
  let { deleted: t, pos: r } = e.mapResult(this.anchor);
5275
- return t ? new In(r, r) : new zr(r);
5276
+ return t ? new Dn(r, r) : new zr(r);
5276
5277
  }
5277
5278
  resolve(e) {
5278
5279
  let t = e.resolve(this.anchor), r = t.nodeAfter;
@@ -5545,7 +5546,7 @@ const ya = [
5545
5546
  }
5546
5547
  })
5547
5548
  ];
5548
- class Gn {
5549
+ class _n {
5549
5550
  constructor(e, t) {
5550
5551
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = ya.slice(), t && t.forEach((r) => {
5551
5552
  if (this.pluginsByKey[r.key])
@@ -5646,7 +5647,7 @@ class pt {
5646
5647
  Create a new state.
5647
5648
  */
5648
5649
  static create(e) {
5649
- let t = new Gn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new pt(t);
5650
+ let t = new _n(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new pt(t);
5650
5651
  for (let i = 0; i < t.fields.length; i++)
5651
5652
  r[t.fields[i].name] = t.fields[i].init(e, r);
5652
5653
  return r;
@@ -5660,7 +5661,7 @@ class pt {
5660
5661
  configuration object..
5661
5662
  */
5662
5663
  reconfigure(e) {
5663
- let t = new Gn(this.schema, e.plugins), r = t.fields, i = new pt(t);
5664
+ let t = new _n(this.schema, e.plugins), r = t.fields, i = new pt(t);
5664
5665
  for (let s = 0; s < r.length; s++) {
5665
5666
  let o = r[s].name;
5666
5667
  i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
@@ -5697,7 +5698,7 @@ class pt {
5697
5698
  throw new RangeError("Invalid input for EditorState.fromJSON");
5698
5699
  if (!e.schema)
5699
5700
  throw new RangeError("Required config field 'schema' missing");
5700
- let i = new Gn(e.schema, e.plugins), s = new pt(i);
5701
+ let i = new _n(e.schema, e.plugins), s = new pt(i);
5701
5702
  return i.fields.forEach((o) => {
5702
5703
  if (o.name == "doc")
5703
5704
  s.doc = ze.fromJSON(e.schema, t.doc);
@@ -5740,9 +5741,9 @@ class se {
5740
5741
  return e[this.key];
5741
5742
  }
5742
5743
  }
5743
- const Yn = /* @__PURE__ */ Object.create(null);
5744
+ const Gn = /* @__PURE__ */ Object.create(null);
5744
5745
  function Xs(n) {
5745
- return n in Yn ? n + "$" + ++Yn[n] : (Yn[n] = 0, n + "$");
5746
+ return n in Gn ? n + "$" + ++Gn[n] : (Gn[n] = 0, n + "$");
5746
5747
  }
5747
5748
  class we {
5748
5749
  /**
@@ -5773,12 +5774,12 @@ const K = function(n) {
5773
5774
  let e = n.assignedSlot || n.parentNode;
5774
5775
  return e && e.nodeType == 11 ? e.host : e;
5775
5776
  };
5776
- let yr = null;
5777
+ let gr = null;
5777
5778
  const Te = function(n, e, t) {
5778
- let r = yr || (yr = document.createRange());
5779
+ let r = gr || (gr = document.createRange());
5779
5780
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5780
5781
  }, ba = function() {
5781
- yr = null;
5782
+ gr = null;
5782
5783
  }, st = function(n, e, t, r) {
5783
5784
  return t && (Ci(n, e, t, r, -1) || Ci(n, e, t, r, 1));
5784
5785
  }, ka = /^(img|br|input|textarea|hr)$/i;
@@ -5851,7 +5852,7 @@ function _t(n) {
5851
5852
  ;
5852
5853
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
5853
5854
  }
5854
- const Rn = function(n) {
5855
+ const In = function(n) {
5855
5856
  return n.focusNode && st(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
5856
5857
  };
5857
5858
  function Je(n, e) {
@@ -5878,9 +5879,9 @@ function Ca(n, e, t) {
5878
5879
  return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
5879
5880
  }
5880
5881
  }
5881
- const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "", br = /Edge\/(\d+)/.exec(je), Zs = /MSIE \d/.exec(je), kr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je), ie = !!(Zs || kr || br), $e = Zs ? document.documentMode : kr ? +kr[1] : br ? +br[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(je);
5882
+ const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "", yr = /Edge\/(\d+)/.exec(je), Zs = /MSIE \d/.exec(je), br = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je), ie = !!(Zs || br || yr), $e = Zs ? document.documentMode : br ? +br[1] : yr ? +yr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(je);
5882
5883
  pe && +(/Firefox\/(\d+)/.exec(je) || [0, 0])[1];
5883
- const xr = !ie && /Chrome\/(\d+)/.exec(je), U = !!xr, Qs = xr ? +xr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), xt = X && (/Mobile\/\w+/.test(je) || !!xe && xe.maxTouchPoints > 2), ue = xt || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(je), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Ta = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5884
+ const kr = !ie && /Chrome\/(\d+)/.exec(je), U = !!kr, Qs = kr ? +kr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), xt = X && (/Mobile\/\w+/.test(je) || !!xe && xe.maxTouchPoints > 2), ue = xt || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(je), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Ta = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5884
5885
  function Oa(n) {
5885
5886
  let e = n.defaultView && n.defaultView.visualViewport;
5886
5887
  return e ? {
@@ -6118,14 +6119,14 @@ function so(n, e, t) {
6118
6119
  if (s == null && i && (t < 0 || i == fe(r))) {
6119
6120
  let a = r.childNodes[i - 1];
6120
6121
  if (a.nodeType == 1)
6121
- return Xn(a.getBoundingClientRect(), !1);
6122
+ return Yn(a.getBoundingClientRect(), !1);
6122
6123
  }
6123
6124
  if (s == null && i < fe(r)) {
6124
6125
  let a = r.childNodes[i];
6125
6126
  if (a.nodeType == 1)
6126
- return Xn(a.getBoundingClientRect(), !0);
6127
+ return Yn(a.getBoundingClientRect(), !0);
6127
6128
  }
6128
- return Xn(r.getBoundingClientRect(), t >= 0);
6129
+ return Yn(r.getBoundingClientRect(), t >= 0);
6129
6130
  }
6130
6131
  if (s == null && i && (t < 0 || i == fe(r))) {
6131
6132
  let a = r.childNodes[i - 1], c = a.nodeType == 3 ? Te(a, fe(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
@@ -6148,7 +6149,7 @@ function wt(n, e) {
6148
6149
  let t = e ? n.left : n.right;
6149
6150
  return { top: n.top, bottom: n.bottom, left: t, right: t };
6150
6151
  }
6151
- function Xn(n, e) {
6152
+ function Yn(n, e) {
6152
6153
  if (n.height == 0)
6153
6154
  return n;
6154
6155
  let t = e ? n.top : n.bottom;
@@ -6645,7 +6646,7 @@ class ot extends Yt {
6645
6646
  }
6646
6647
  slice(e, t, r) {
6647
6648
  let i = ot.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
6648
- t < o && (s = Mr(s, t, o, r)), e > 0 && (s = Mr(s, 0, e, r));
6649
+ t < o && (s = Sr(s, t, o, r)), e > 0 && (s = Sr(s, 0, e, r));
6649
6650
  for (let l = 0; l < s.length; l++)
6650
6651
  s[l].parent = i;
6651
6652
  return i.children = s, i;
@@ -6685,7 +6686,7 @@ class Ve extends Yt {
6685
6686
  } else d || ({ dom: d, contentDOM: u } = ct.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6686
6687
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6687
6688
  let f = d;
6688
- return d = fo(d, r, t), c ? a = new Wa(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Pn(e, t, r, i, d, f, s) : new Ve(e, t, r, i, d, u || null, f, s, o + 1);
6689
+ return d = fo(d, r, t), c ? a = new Wa(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Rn(e, t, r, i, d, f, s) : new Ve(e, t, r, i, d, u || null, f, s, o + 1);
6689
6690
  }
6690
6691
  parseRule() {
6691
6692
  if (this.node.type.spec.reparseInView)
@@ -6755,7 +6756,7 @@ class Ve extends Yt {
6755
6756
  s.pmViewDesc && (s.pmViewDesc = void 0);
6756
6757
  }
6757
6758
  let o = new Ha(this, s, t, i);
6758
- e.input.compositionNodes.push(o), this.children = Mr(this.children, r, r + i.length, e, o);
6759
+ e.input.compositionNodes.push(o), this.children = Sr(this.children, r, r + i.length, e, o);
6759
6760
  }
6760
6761
  // If this desc must be updated to match the given node decoration,
6761
6762
  // do so and return true.
@@ -6769,7 +6770,7 @@ class Ve extends Yt {
6769
6770
  if (mn(e, this.outerDeco))
6770
6771
  return;
6771
6772
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
6772
- this.dom = uo(this.dom, this.nodeDOM, Sr(this.outerDeco, this.node, t), Sr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6773
+ this.dom = uo(this.dom, this.nodeDOM, xr(this.outerDeco, this.node, t), xr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6773
6774
  }
6774
6775
  // Mark this node as being the selected node.
6775
6776
  selectNode() {
@@ -6788,7 +6789,7 @@ function Ii(n, e, t, r, i) {
6788
6789
  let s = new Ve(void 0, n, e, t, r, r, r, i, 0);
6789
6790
  return s.contentDOM && s.updateChildren(i, 0), s;
6790
6791
  }
6791
- class Pn extends Ve {
6792
+ class Rn extends Ve {
6792
6793
  constructor(e, t, r, i, s, o, l) {
6793
6794
  super(e, t, r, i, s, null, o, l, 0);
6794
6795
  }
@@ -6819,7 +6820,7 @@ class Pn extends Ve {
6819
6820
  }
6820
6821
  slice(e, t, r) {
6821
6822
  let i = this.node.cut(e, t), s = document.createTextNode(i.text);
6822
- return new Pn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6823
+ return new Rn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6823
6824
  }
6824
6825
  markDirty(e, t) {
6825
6826
  super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Se);
@@ -6903,7 +6904,7 @@ const At = function(n) {
6903
6904
  };
6904
6905
  At.prototype = /* @__PURE__ */ Object.create(null);
6905
6906
  const Ge = [new At()];
6906
- function Sr(n, e, t) {
6907
+ function xr(n, e, t) {
6907
6908
  if (n.length == 0)
6908
6909
  return Ge;
6909
6910
  let r = t ? Ge[0] : new At(), i = [r];
@@ -6956,7 +6957,7 @@ function qa(n, e, t) {
6956
6957
  }
6957
6958
  }
6958
6959
  function fo(n, e, t) {
6959
- return uo(n, n, Ge, Sr(e, t, n.nodeType != 1));
6960
+ return uo(n, n, Ge, xr(e, t, n.nodeType != 1));
6960
6961
  }
6961
6962
  function mn(n, e) {
6962
6963
  if (n.length != e.length)
@@ -7105,7 +7106,7 @@ class ja {
7105
7106
  for (; e instanceof ot; )
7106
7107
  t = e, e = t.children[t.children.length - 1];
7107
7108
  (!e || // Empty textblock
7108
- !(e instanceof Pn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((X || U) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7109
+ !(e instanceof Rn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((X || U) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7109
7110
  }
7110
7111
  addHackNode(e, t) {
7111
7112
  if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
@@ -7229,7 +7230,7 @@ function Ga(n, e, t, r) {
7229
7230
  }
7230
7231
  return -1;
7231
7232
  }
7232
- function Mr(n, e, t, r, i) {
7233
+ function Sr(n, e, t, r, i) {
7233
7234
  let s = [];
7234
7235
  for (let o = 0, l = 0; o < n.length; o++) {
7235
7236
  let a = n[o], c = l, d = l += a.size;
@@ -7245,7 +7246,7 @@ function $r(n, e = null) {
7245
7246
  if (o < 0)
7246
7247
  return null;
7247
7248
  let l = r.resolve(o), a, c;
7248
- if (Rn(t)) {
7249
+ if (In(t)) {
7249
7250
  for (a = o; i && !i.node; )
7250
7251
  i = i.parent;
7251
7252
  let u = i.node;
@@ -7301,15 +7302,15 @@ const Pi = X || U && Qs < 63;
7301
7302
  function Bi(n, e) {
7302
7303
  let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
7303
7304
  if (X && i && i.contentEditable == "false")
7304
- return Zn(i);
7305
+ return Xn(i);
7305
7306
  if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
7306
7307
  if (i)
7307
- return Zn(i);
7308
+ return Xn(i);
7308
7309
  if (s)
7309
- return Zn(s);
7310
+ return Xn(s);
7310
7311
  }
7311
7312
  }
7312
- function Zn(n) {
7313
+ function Xn(n) {
7313
7314
  return n.contentEditable = "true", X && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
7314
7315
  }
7315
7316
  function Li(n) {
@@ -7362,7 +7363,7 @@ function Za(n) {
7362
7363
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7363
7364
  return st(e.node, e.offset, t.anchorNode, t.anchorOffset);
7364
7365
  }
7365
- function wr(n, e) {
7366
+ function Mr(n, e) {
7366
7367
  let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
7367
7368
  return s && E.findFrom(s, e);
7368
7369
  }
@@ -7380,7 +7381,7 @@ function $i(n, e, t) {
7380
7381
  return De(n, new M(r.$anchor, o));
7381
7382
  } else if (r.empty) {
7382
7383
  if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
7383
- let i = wr(n.state, e);
7384
+ let i = Mr(n.state, e);
7384
7385
  return i && i instanceof S ? De(n, i) : !1;
7385
7386
  } else if (!(ue && t.indexOf("m") > -1)) {
7386
7387
  let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
@@ -7394,7 +7395,7 @@ function $i(n, e, t) {
7394
7395
  if (r instanceof S && r.node.isInline)
7395
7396
  return De(n, new M(e > 0 ? r.$to : r.$from));
7396
7397
  {
7397
- let i = wr(n.state, e);
7398
+ let i = Mr(n.state, e);
7398
7399
  return i ? De(n, i) : !1;
7399
7400
  }
7400
7401
  }
@@ -7443,7 +7444,7 @@ function Qa(n) {
7443
7444
  }
7444
7445
  }
7445
7446
  }
7446
- o ? Cr(n, t, r) : i && Cr(n, i, s);
7447
+ o ? wr(n, t, r) : i && wr(n, i, s);
7447
7448
  }
7448
7449
  function ec(n) {
7449
7450
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
@@ -7475,7 +7476,7 @@ function ec(n) {
7475
7476
  }
7476
7477
  }
7477
7478
  }
7478
- s && Cr(n, s, o);
7479
+ s && wr(n, s, o);
7479
7480
  }
7480
7481
  function go(n) {
7481
7482
  let e = n.pmViewDesc;
@@ -7505,7 +7506,7 @@ function nc(n, e) {
7505
7506
  n = t, e = n.childNodes.length;
7506
7507
  }
7507
7508
  }
7508
- function Cr(n, e, t) {
7509
+ function wr(n, e, t) {
7509
7510
  if (e.nodeType != 3) {
7510
7511
  let s, o;
7511
7512
  (o = tc(e, t)) ? (e = o, t = 0) : (s = nc(e, t)) && (e = s, t = s.nodeValue.length);
@@ -7513,7 +7514,7 @@ function Cr(n, e, t) {
7513
7514
  let r = n.domSelection();
7514
7515
  if (!r)
7515
7516
  return;
7516
- if (Rn(r)) {
7517
+ if (In(r)) {
7517
7518
  let s = document.createRange();
7518
7519
  s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
7519
7520
  } else r.extend && r.extend(e, t);
@@ -7546,7 +7547,7 @@ function Hi(n, e, t) {
7546
7547
  return !1;
7547
7548
  let { $from: i, $to: s } = r;
7548
7549
  if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
7549
- let o = wr(n.state, e);
7550
+ let o = Mr(n.state, e);
7550
7551
  if (o && o instanceof S)
7551
7552
  return De(n, o);
7552
7553
  }
@@ -7743,12 +7744,12 @@ function xo(n, e) {
7743
7744
  let t = n.content.replaceChild(n.childCount - 1, xo(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
7744
7745
  return n.copy(t.append(r));
7745
7746
  }
7746
- function Tr(n, e, t, r, i, s) {
7747
+ function Cr(n, e, t, r, i, s) {
7747
7748
  let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
7748
- return n.childCount > 1 && (s = 0), i < r - 1 && (l = Tr(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
7749
+ return n.childCount > 1 && (s = 0), i < r - 1 && (l = Cr(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
7749
7750
  }
7750
7751
  function ji(n, e, t) {
7751
- return e < n.openStart && (n = new k(Tr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Tr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7752
+ return e < n.openStart && (n = new k(Cr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Cr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7752
7753
  }
7753
7754
  const So = {
7754
7755
  thead: ["table"],
@@ -7765,10 +7766,10 @@ let Ki = null;
7765
7766
  function Mo() {
7766
7767
  return Ki || (Ki = document.implementation.createHTMLDocument("title"));
7767
7768
  }
7768
- let Qn = null;
7769
+ let Zn = null;
7769
7770
  function ac(n) {
7770
7771
  let e = window.trustedTypes;
7771
- return e ? (Qn || (Qn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Qn.createHTML(n)) : n;
7772
+ return e ? (Zn || (Zn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Zn.createHTML(n)) : n;
7772
7773
  }
7773
7774
  function cc(n) {
7774
7775
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
@@ -7817,7 +7818,7 @@ function pc(n) {
7817
7818
  gc(n, r) && !Wr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7818
7819
  }, fc[e] ? { passive: !0 } : void 0);
7819
7820
  }
7820
- X && n.dom.addEventListener("input", () => null), Or(n);
7821
+ X && n.dom.addEventListener("input", () => null), Tr(n);
7821
7822
  }
7822
7823
  function Le(n, e) {
7823
7824
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
@@ -7828,7 +7829,7 @@ function mc(n) {
7828
7829
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
7829
7830
  clearTimeout(n.input.composingTimeout), clearTimeout(n.input.lastIOSEnterFallbackTimeout);
7830
7831
  }
7831
- function Or(n) {
7832
+ function Tr(n) {
7832
7833
  n.someProp("handleDOMEvents", (e) => {
7833
7834
  for (let t in e)
7834
7835
  n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => Wr(n, r));
@@ -7880,7 +7881,7 @@ te.keypress = (n, e) => {
7880
7881
  !/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
7881
7882
  }
7882
7883
  };
7883
- function Bn(n) {
7884
+ function Pn(n) {
7884
7885
  return { left: n.clientX, top: n.clientY };
7885
7886
  }
7886
7887
  function bc(n, e) {
@@ -7959,7 +7960,7 @@ ee.mousedown = (n, e) => {
7959
7960
  n.input.shiftKey = t.shiftKey;
7960
7961
  let r = jr(n), i = Date.now(), s = "singleClick";
7961
7962
  i - n.input.lastClick.time < 500 && bc(t, n.input.lastClick) && !t[wo] && 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 };
7962
- let o = n.posAtCoords(Bn(t));
7963
+ let o = n.posAtCoords(Pn(t));
7963
7964
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Tc(n, o, t, !!r)) : (s == "doubleClick" ? Mc : wc)(n, o.pos, o.inside, t) ? t.preventDefault() : Le(n, "pointer"));
7964
7965
  };
7965
7966
  class Tc {
@@ -7991,7 +7992,7 @@ class Tc {
7991
7992
  if (this.done(), !this.view.dom.contains(e.target))
7992
7993
  return;
7993
7994
  let t = this.pos;
7994
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Bn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Le(this.view, "pointer") : Sc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7995
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Pn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Le(this.view, "pointer") : Sc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7995
7996
  X && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7996
7997
  // cursor, but still report that the node is selected
7997
7998
  // when asked through getSelection. You'll then get a
@@ -8162,7 +8163,7 @@ ee.dragstart = (n, e) => {
8162
8163
  let t = e, r = n.input.mouseDown;
8163
8164
  if (r && r.done(), !t.dataTransfer)
8164
8165
  return;
8165
- let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Bn(t)), o;
8166
+ let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Pn(t)), o;
8166
8167
  if (!(s && s.pos >= i.from && s.pos <= (i instanceof S ? i.to - 1 : i.to))) {
8167
8168
  if (r && r.mightDrag)
8168
8169
  o = S.create(n.state.doc, r.mightDrag.pos);
@@ -8191,7 +8192,7 @@ te.drop = (n, e) => {
8191
8192
  function Pc(n, e, t) {
8192
8193
  if (!e.dataTransfer)
8193
8194
  return;
8194
- let r = n.posAtCoords(Bn(e));
8195
+ let r = n.posAtCoords(Pn(e));
8195
8196
  if (!r)
8196
8197
  return;
8197
8198
  let i = n.state.doc.resolve(r.pos), s = t && t.slice;
@@ -8749,7 +8750,7 @@ function Ji(n, e, t) {
8749
8750
  e++;
8750
8751
  n.splice(e, 0, t);
8751
8752
  }
8752
- function er(n) {
8753
+ function Qn(n) {
8753
8754
  let e = [];
8754
8755
  return n.someProp("decorations", (t) => {
8755
8756
  let r = t(n.state);
@@ -8897,7 +8898,7 @@ class Vc {
8897
8898
  }
8898
8899
  }
8899
8900
  let c = null;
8900
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Rn(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ve(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Hc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, jc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || ve(e), this.currentSelection.set(r));
8901
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && In(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ve(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Hc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, jc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || ve(e), this.currentSelection.set(r));
8901
8902
  }
8902
8903
  registerMutation(e, t) {
8903
8904
  if (t.indexOf(e.target) > -1)
@@ -8987,7 +8988,7 @@ function jc(n, e) {
8987
8988
  }
8988
8989
  function Kc(n, e, t) {
8989
8990
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
8990
- if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Rn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
8991
+ if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], In(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
8991
8992
  for (let g = s; g > i; g--) {
8992
8993
  let y = r.childNodes[g - 1], T = y.pmViewDesc;
8993
8994
  if (y.nodeName == "BR" && !T) {
@@ -9130,7 +9131,7 @@ function Yc(n, e, t, r, i) {
9130
9131
  if (
9131
9132
  // The content must have shrunk
9132
9133
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
9133
- tr(r, !0, !1) < i.pos
9134
+ er(r, !0, !1) < i.pos
9134
9135
  )
9135
9136
  return !1;
9136
9137
  let s = n.resolve(e);
@@ -9140,10 +9141,10 @@ function Yc(n, e, t, r, i) {
9140
9141
  }
9141
9142
  if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
9142
9143
  return !1;
9143
- let o = n.resolve(tr(s, !0, !0));
9144
- return !o.parent.isTextblock || o.pos > t || tr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9144
+ let o = n.resolve(er(s, !0, !0));
9145
+ return !o.parent.isTextblock || o.pos > t || er(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9145
9146
  }
9146
- function tr(n, e, t) {
9147
+ function er(n, e, t) {
9147
9148
  let r = n.depth, i = e ? n.end() : n.pos;
9148
9149
  for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
9149
9150
  r--, i++, e = !1;
@@ -9187,7 +9188,7 @@ class Ro {
9187
9188
  added to the document.
9188
9189
  */
9189
9190
  constructor(e, t) {
9190
- 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 hc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), 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 = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), er(this), this.dom, this), this.domObserver = new Vc(this, (r, i, s, o) => _c(this, r, i, s, o)), this.domObserver.start(), pc(this), this.updatePluginViews();
9191
+ 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 hc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), 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 = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), Qn(this), this.dom, this), this.domObserver = new Vc(this, (r, i, s, o) => _c(this, r, i, s, o)), this.domObserver.start(), pc(this), this.updatePluginViews();
9191
9192
  }
9192
9193
  /**
9193
9194
  Holds `true` when a
@@ -9215,7 +9216,7 @@ class Ro {
9215
9216
  the DOM.
9216
9217
  */
9217
9218
  update(e) {
9218
- e.handleDOMEvents != this._props.handleDOMEvents && Or(this);
9219
+ e.handleDOMEvents != this._props.handleDOMEvents && Tr(this);
9219
9220
  let t = this._props;
9220
9221
  this._props = e, e.plugins && (e.plugins.forEach(ns), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9221
9222
  }
@@ -9249,8 +9250,8 @@ class Ro {
9249
9250
  let h = ts(this);
9250
9251
  Qc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9251
9252
  }
9252
- (l || t.handleDOMEvents != this._props.handleDOMEvents) && Or(this), this.editable = es(this), Qi(this);
9253
- let a = er(this), c = Zi(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);
9253
+ (l || t.handleDOMEvents != this._props.handleDOMEvents) && Tr(this), this.editable = es(this), Qi(this);
9254
+ let a = Qn(this), c = Zi(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);
9254
9255
  (u || !e.selection.eq(i.selection)) && (o = !0);
9255
9256
  let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Na(this);
9256
9257
  if (o) {
@@ -9480,7 +9481,7 @@ class Ro {
9480
9481
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9481
9482
  */
9482
9483
  destroy() {
9483
- this.docView && (mc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], er(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ba());
9484
+ this.docView && (mc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Qn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ba());
9484
9485
  }
9485
9486
  /**
9486
9487
  This is true when the view has been
@@ -9642,7 +9643,7 @@ for (var J = 0; J < 10; J++) We[48 + J] = We[96 + J] = String(J);
9642
9643
  for (var J = 1; J <= 24; J++) We[J + 111] = "F" + J;
9643
9644
  for (var J = 65; J <= 90; J++)
9644
9645
  We[J] = String.fromCharCode(J + 32), xn[J] = String.fromCharCode(J);
9645
- for (var nr in We) xn.hasOwnProperty(nr) || (xn[nr] = We[nr]);
9646
+ for (var tr in We) xn.hasOwnProperty(tr) || (xn[tr] = We[tr]);
9646
9647
  function nd(n) {
9647
9648
  var e = ed && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || td && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? xn : We)[n.keyCode] || n.key || "Unidentified";
9648
9649
  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;
@@ -9675,7 +9676,7 @@ function od(n) {
9675
9676
  e[sd(t)] = n[t];
9676
9677
  return e;
9677
9678
  }
9678
- function rr(n, e, t = !0) {
9679
+ function nr(n, e, t = !0) {
9679
9680
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9680
9681
  }
9681
9682
  function ld(n) {
@@ -9684,18 +9685,18 @@ function ld(n) {
9684
9685
  function Po(n) {
9685
9686
  let e = od(n);
9686
9687
  return function(t, r) {
9687
- let i = nd(r), s, o = e[rr(i, r)];
9688
+ let i = nd(r), s, o = e[nr(i, r)];
9688
9689
  if (o && o(t.state, t.dispatch, t))
9689
9690
  return !0;
9690
9691
  if (i.length == 1 && i != " ") {
9691
9692
  if (r.shiftKey) {
9692
- let l = e[rr(i, r, !1)];
9693
+ let l = e[nr(i, r, !1)];
9693
9694
  if (l && l(t.state, t.dispatch, t))
9694
9695
  return !0;
9695
9696
  }
9696
9697
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9697
9698
  !(id && r.ctrlKey && r.altKey) && (s = We[r.keyCode]) && s != i) {
9698
- let l = e[rr(s, r)];
9699
+ let l = e[nr(s, r)];
9699
9700
  if (l && l(t.state, t.dispatch, t))
9700
9701
  return !0;
9701
9702
  }
@@ -9722,7 +9723,7 @@ const Lo = (n, e, t) => {
9722
9723
  return !0;
9723
9724
  if (r.parent.content.size == 0 && (St(s, "end") || S.isSelectable(s)))
9724
9725
  for (let o = r.depth; ; o--) {
9725
- let l = Dn(n.doc, r.before(o), r.after(o), k.empty);
9726
+ let l = An(n.doc, r.before(o), r.after(o), k.empty);
9726
9727
  if (l && l.slice.size < l.to - l.from) {
9727
9728
  if (e) {
9728
9729
  let a = n.tr.step(l);
@@ -9766,7 +9767,7 @@ function zo(n, e, t) {
9766
9767
  return !1;
9767
9768
  l = d;
9768
9769
  }
9769
- let c = Dn(n.doc, s, a, k.empty);
9770
+ let c = An(n.doc, s, a, k.empty);
9770
9771
  if (!c || c.from != s || c instanceof P && c.slice.size >= a - s)
9771
9772
  return !1;
9772
9773
  if (t) {
@@ -9821,7 +9822,7 @@ const Vo = (n, e, t) => {
9821
9822
  if (Ko(n, i, e, 1))
9822
9823
  return !0;
9823
9824
  if (r.parent.content.size == 0 && (St(s, "start") || S.isSelectable(s))) {
9824
- let o = Dn(n.doc, r.before(), r.after(), k.empty);
9825
+ let o = An(n.doc, r.before(), r.after(), k.empty);
9825
9826
  if (o && o.slice.size < o.to - o.from) {
9826
9827
  if (e) {
9827
9828
  let l = n.tr.step(o);
@@ -9860,7 +9861,7 @@ const dd = (n, e) => {
9860
9861
  if (t.node.isTextblock || !qe(n.doc, t.from))
9861
9862
  return !1;
9862
9863
  i = t.from;
9863
- } else if (i = An(n.doc, t.from, -1), i == null)
9864
+ } else if (i = vn(n.doc, t.from, -1), i == null)
9864
9865
  return !1;
9865
9866
  if (e) {
9866
9867
  let s = n.tr.join(i);
@@ -9873,7 +9874,7 @@ const dd = (n, e) => {
9873
9874
  if (t.node.isTextblock || !qe(n.doc, t.to))
9874
9875
  return !1;
9875
9876
  r = t.to;
9876
- } else if (r = An(n.doc, t.to, 1), r == null)
9877
+ } else if (r = vn(n.doc, t.to, 1), r == null)
9877
9878
  return !1;
9878
9879
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9879
9880
  }, fd = (n, e) => {
@@ -10144,7 +10145,7 @@ function Ed(n) {
10144
10145
  return !0;
10145
10146
  };
10146
10147
  }
10147
- function Ln(n) {
10148
+ function Bn(n) {
10148
10149
  const { state: e, transaction: t } = n;
10149
10150
  let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
10150
10151
  return {
@@ -10169,7 +10170,7 @@ function Ln(n) {
10169
10170
  }
10170
10171
  };
10171
10172
  }
10172
- class zn {
10173
+ class Ln {
10173
10174
  constructor(e) {
10174
10175
  this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
10175
10176
  }
@@ -10214,7 +10215,7 @@ class zn {
10214
10215
  tr: e,
10215
10216
  editor: i,
10216
10217
  view: o,
10217
- state: Ln({
10218
+ state: Bn({
10218
10219
  state: s,
10219
10220
  transaction: e
10220
10221
  }),
@@ -10260,7 +10261,7 @@ function x(n, e, t) {
10260
10261
  parent: n.parent ? x(n.parent, e, t) : null
10261
10262
  }) : n.config[e];
10262
10263
  }
10263
- function Fn(n) {
10264
+ function zn(n) {
10264
10265
  const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
10265
10266
  return {
10266
10267
  baseExtensions: e,
@@ -10269,7 +10270,7 @@ function Fn(n) {
10269
10270
  };
10270
10271
  }
10271
10272
  function Uo(n) {
10272
- const e = [], { nodeExtensions: t, markExtensions: r } = Fn(n), i = [...t, ...r], s = {
10273
+ const e = [], { nodeExtensions: t, markExtensions: r } = zn(n), i = [...t, ...r], s = {
10273
10274
  default: null,
10274
10275
  rendered: !0,
10275
10276
  renderHTML: null,
@@ -10355,7 +10356,7 @@ function H(...n) {
10355
10356
  }), r;
10356
10357
  }, {});
10357
10358
  }
10358
- function Er(n, e) {
10359
+ function Or(n, e) {
10359
10360
  return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
10360
10361
  [t.name]: n.attrs[t.name]
10361
10362
  }).reduce((t, r) => H(t, r), {});
@@ -10398,7 +10399,7 @@ function ss(n) {
10398
10399
  }
10399
10400
  function Dd(n, e) {
10400
10401
  var t;
10401
- const r = Uo(n), { nodeExtensions: i, markExtensions: s } = Fn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10402
+ const r = Uo(n), { nodeExtensions: i, markExtensions: s } = zn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10402
10403
  const d = r.filter((y) => y.type === c.name), u = {
10403
10404
  name: c.name,
10404
10405
  options: c.options,
@@ -10433,7 +10434,7 @@ function Dd(n, e) {
10433
10434
  const m = x(c, "renderHTML", u);
10434
10435
  m && (h.toDOM = (y) => m({
10435
10436
  node: y,
10436
- HTMLAttributes: Er(y, d)
10437
+ HTMLAttributes: Or(y, d)
10437
10438
  }));
10438
10439
  const g = x(c, "renderText", u);
10439
10440
  return g && (h.toText = g), [c.name, h];
@@ -10465,7 +10466,7 @@ function Dd(n, e) {
10465
10466
  const m = x(c, "renderHTML", u);
10466
10467
  return m && (h.toDOM = (g) => m({
10467
10468
  mark: g,
10468
- HTMLAttributes: Er(g, d)
10469
+ HTMLAttributes: Or(g, d)
10469
10470
  })), [c.name, h];
10470
10471
  }));
10471
10472
  return new Ps({
@@ -10474,7 +10475,7 @@ function Dd(n, e) {
10474
10475
  marks: a
10475
10476
  });
10476
10477
  }
10477
- function ir(n, e) {
10478
+ function rr(n, e) {
10478
10479
  return e.nodes[n] || e.marks[n] || null;
10479
10480
  }
10480
10481
  function ls(n, e) {
@@ -10501,7 +10502,7 @@ const Id = (n, e = 500) => {
10501
10502
  function Qr(n) {
10502
10503
  return Object.prototype.toString.call(n) === "[object RegExp]";
10503
10504
  }
10504
- class $n {
10505
+ class Fn {
10505
10506
  constructor(e) {
10506
10507
  this.find = e.find, this.handler = e.handler;
10507
10508
  }
@@ -10534,13 +10535,13 @@ function en(n) {
10534
10535
  const h = Rd(u, f.find);
10535
10536
  if (!h)
10536
10537
  return;
10537
- const p = a.state.tr, m = Ln({
10538
+ const p = a.state.tr, m = Bn({
10538
10539
  state: a.state,
10539
10540
  transaction: p
10540
10541
  }), g = {
10541
10542
  from: r - (h[0].length - s.length),
10542
10543
  to: i
10543
- }, { commands: y, chain: T, can: w } = new zn({
10544
+ }, { commands: y, chain: T, can: w } = new Ln({
10544
10545
  editor: t,
10545
10546
  state: m
10546
10547
  });
@@ -10637,10 +10638,10 @@ function Bd(n) {
10637
10638
  function tn(n) {
10638
10639
  return Bd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10639
10640
  }
10640
- function Vn(n, e) {
10641
+ function $n(n, e) {
10641
10642
  const t = { ...n };
10642
10643
  return tn(n) && tn(e) && Object.keys(e).forEach((r) => {
10643
- tn(e[r]) && tn(n[r]) ? t[r] = Vn(n[r], e[r]) : t[r] = e[r];
10644
+ tn(e[r]) && tn(n[r]) ? t[r] = $n(n[r], e[r]) : t[r] = e[r];
10644
10645
  }), t;
10645
10646
  }
10646
10647
  class Me {
@@ -10664,7 +10665,7 @@ class Me {
10664
10665
  configure(e = {}) {
10665
10666
  const t = this.extend({
10666
10667
  ...this.config,
10667
- addOptions: () => Vn(this.options, e)
10668
+ addOptions: () => $n(this.options, e)
10668
10669
  });
10669
10670
  return t.name = this.name, t.parent = this.parent, t;
10670
10671
  }
@@ -10707,7 +10708,7 @@ const Fd = (n, e, t) => {
10707
10708
  }) : [];
10708
10709
  };
10709
10710
  function $d(n) {
10710
- const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new zn({
10711
+ const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Ln({
10711
10712
  editor: e,
10712
10713
  state: t
10713
10714
  }), u = [];
@@ -10752,7 +10753,7 @@ function Hd(n) {
10752
10753
  l = null;
10753
10754
  }
10754
10755
  const a = ({ state: d, from: u, to: f, rule: h, pasteEvt: p }) => {
10755
- const m = d.tr, g = Ln({
10756
+ const m = d.tr, g = Bn({
10756
10757
  state: d,
10757
10758
  transaction: m
10758
10759
  });
@@ -10890,7 +10891,7 @@ class mt {
10890
10891
  options: t.options,
10891
10892
  storage: t.storage,
10892
10893
  editor: this.editor,
10893
- type: ir(t.name, this.schema)
10894
+ type: rr(t.name, this.schema)
10894
10895
  }, i = x(t, "addCommands", r);
10895
10896
  return i ? {
10896
10897
  ...e,
@@ -10909,7 +10910,7 @@ class mt {
10909
10910
  options: o.options,
10910
10911
  storage: o.storage,
10911
10912
  editor: e,
10912
- type: ir(o.name, this.schema)
10913
+ type: rr(o.name, this.schema)
10913
10914
  }, a = [], c = x(o, "addKeyboardShortcuts", l);
10914
10915
  let d = {};
10915
10916
  if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => Me.handleExit({ editor: e, mark: o })), c) {
@@ -10953,7 +10954,7 @@ class mt {
10953
10954
  * @returns An object with all node views where the key is the node name and the value is the node view function
10954
10955
  */
10955
10956
  get nodeViews() {
10956
- const { editor: e } = this, { nodeExtensions: t } = Fn(this.extensions);
10957
+ const { editor: e } = this, { nodeExtensions: t } = zn(this.extensions);
10957
10958
  return Object.fromEntries(t.filter((r) => !!x(r, "addNodeView")).map((r) => {
10958
10959
  const i = this.attributes.filter((a) => a.type === r.name), s = {
10959
10960
  name: r.name,
@@ -10965,7 +10966,7 @@ class mt {
10965
10966
  if (!o)
10966
10967
  return [];
10967
10968
  const l = (a, c, d, u, f) => {
10968
- const h = Er(a, i);
10969
+ const h = Or(a, i);
10969
10970
  return o()({
10970
10971
  // pass-through
10971
10972
  node: a,
@@ -10995,7 +10996,7 @@ class mt {
10995
10996
  options: e.options,
10996
10997
  storage: e.storage,
10997
10998
  editor: this.editor,
10998
- type: ir(e.name, this.schema)
10999
+ type: rr(e.name, this.schema)
10999
11000
  };
11000
11001
  e.type === "mark" && (!((t = N(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
11001
11002
  const i = x(e, "onBeforeCreate", r), s = x(e, "onCreate", r), o = x(e, "onUpdate", r), l = x(e, "onSelectionUpdate", r), a = x(e, "onTransaction", r), c = x(e, "onFocus", r), d = x(e, "onBlur", r), u = x(e, "onDestroy", r);
@@ -11024,7 +11025,7 @@ class _ {
11024
11025
  configure(e = {}) {
11025
11026
  const t = this.extend({
11026
11027
  ...this.config,
11027
- addOptions: () => Vn(this.options, e)
11028
+ addOptions: () => $n(this.options, e)
11028
11029
  });
11029
11030
  return t.name = this.name, t.parent = this.parent, t;
11030
11031
  }
@@ -11382,14 +11383,14 @@ const cu = (n) => !("type" in n), du = (n, e, t) => ({ tr: r, dispatch: i, edito
11382
11383
  return !0;
11383
11384
  }, uu = () => ({ state: n, dispatch: e }) => dd(n, e), fu = () => ({ state: n, dispatch: e }) => ud(n, e), hu = () => ({ state: n, dispatch: e }) => Lo(n, e), pu = () => ({ state: n, dispatch: e }) => Vo(n, e), mu = () => ({ state: n, dispatch: e, tr: t }) => {
11384
11385
  try {
11385
- const r = An(n.doc, n.selection.$from.pos, -1);
11386
+ const r = vn(n.doc, n.selection.$from.pos, -1);
11386
11387
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11387
11388
  } catch {
11388
11389
  return !1;
11389
11390
  }
11390
11391
  }, gu = () => ({ state: n, dispatch: e, tr: t }) => {
11391
11392
  try {
11392
- const r = An(n.doc, n.selection.$from.pos, 1);
11393
+ const r = vn(n.doc, n.selection.$from.pos, 1);
11393
11394
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11394
11395
  } catch {
11395
11396
  return !1;
@@ -11459,7 +11460,7 @@ const Su = (n, e = {}) => ({ state: t, dispatch: r }) => {
11459
11460
  const r = V(n, e.schema);
11460
11461
  return Cd(r)(e, t);
11461
11462
  }, Cu = () => ({ state: n, dispatch: e }) => Wo(n, e);
11462
- function Hn(n, e) {
11463
+ function Vn(n, e) {
11463
11464
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11464
11465
  }
11465
11466
  function ds(n, e) {
@@ -11468,7 +11469,7 @@ function ds(n, e) {
11468
11469
  }
11469
11470
  const Tu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11470
11471
  let s = null, o = null;
11471
- const l = Hn(typeof n == "string" ? n : n.name, r.schema);
11472
+ const l = Vn(typeof n == "string" ? n : n.name, r.schema);
11472
11473
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11473
11474
  r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
11474
11475
  s && s === c.type && t.setNodeMarkup(d, void 0, ds(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
@@ -11483,7 +11484,7 @@ const Tu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11483
11484
  }
11484
11485
  return !0;
11485
11486
  }, Nu = () => ({ state: n, dispatch: e }) => Fo(n, e), vu = () => ({ state: n, dispatch: e }) => Ho(n, e), Au = () => ({ state: n, dispatch: e }) => gd(n, e), Du = () => ({ state: n, dispatch: e }) => kd(n, e), Iu = () => ({ state: n, dispatch: e }) => bd(n, e);
11486
- function Nr(n, e, t = {}, r = {}) {
11487
+ function Er(n, e, t = {}, r = {}) {
11487
11488
  return $t(n, e, {
11488
11489
  slice: !1,
11489
11490
  parseOptions: t,
@@ -11494,7 +11495,7 @@ const Ru = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
11494
11495
  var a, c;
11495
11496
  const { doc: d } = s;
11496
11497
  if (t.preserveWhitespace !== "full") {
11497
- const u = Nr(n, i.schema, t, {
11498
+ const u = Er(n, i.schema, t, {
11498
11499
  errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
11499
11500
  });
11500
11501
  return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
@@ -11551,7 +11552,7 @@ function zu(n, e) {
11551
11552
  return o ? { ...o.attrs } : {};
11552
11553
  }
11553
11554
  function Fu(n, e) {
11554
- const t = Hn(typeof e == "string" ? e : e.name, n.schema);
11555
+ const t = Vn(typeof e == "string" ? e : e.name, n.schema);
11555
11556
  return t === "node" ? zu(n, e) : t === "mark" ? nl(n, e) : {};
11556
11557
  }
11557
11558
  function rl(n, e, t) {
@@ -11576,7 +11577,7 @@ function an(n, e, t) {
11576
11577
  return i ? i.attribute.keepOnSplit : !1;
11577
11578
  }));
11578
11579
  }
11579
- function vr(n, e, t = {}) {
11580
+ function Nr(n, e, t = {}) {
11580
11581
  const { empty: r, ranges: i } = n.selection, s = e ? Ke(e, n.schema) : null;
11581
11582
  if (r)
11582
11583
  return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => Sn(u.attrs, t, { strict: !1 }));
@@ -11601,12 +11602,12 @@ function vr(n, e, t = {}) {
11601
11602
  }
11602
11603
  function $u(n, e, t = {}) {
11603
11604
  if (!e)
11604
- return Vt(n, null, t) || vr(n, null, t);
11605
- const r = Hn(e, n.schema);
11606
- return r === "node" ? Vt(n, e, t) : r === "mark" ? vr(n, e, t) : !1;
11605
+ return Vt(n, null, t) || Nr(n, null, t);
11606
+ const r = Vn(e, n.schema);
11607
+ return r === "node" ? Vt(n, e, t) : r === "mark" ? Nr(n, e, t) : !1;
11607
11608
  }
11608
11609
  function us(n, e) {
11609
- const { nodeExtensions: t } = Fn(e), r = t.find((o) => o.name === n);
11610
+ const { nodeExtensions: t } = zn(e), r = t.find((o) => o.name === n);
11610
11611
  if (!r)
11611
11612
  return !1;
11612
11613
  const i = {
@@ -11794,7 +11795,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11794
11795
  t.ensureMarks(D);
11795
11796
  }
11796
11797
  return !0;
11797
- }, sr = (n, e) => {
11798
+ }, ir = (n, e) => {
11798
11799
  const t = ti((o) => o.type === e)(n.selection);
11799
11800
  if (!t)
11800
11801
  return !0;
@@ -11803,7 +11804,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11803
11804
  return !0;
11804
11805
  const i = n.doc.nodeAt(r);
11805
11806
  return t.node.type === (i == null ? void 0 : i.type) && qe(n.doc, t.pos) && n.join(t.pos), !0;
11806
- }, or = (n, e) => {
11807
+ }, sr = (n, e) => {
11807
11808
  const t = ti((o) => o.type === e)(n.selection);
11808
11809
  if (!t)
11809
11810
  return !0;
@@ -11821,15 +11822,15 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11821
11822
  if (D.node.type === h)
11822
11823
  return c.liftListItem(p);
11823
11824
  if (us(D.node.type.name, u) && h.validContent(D.node.content) && l)
11824
- return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => sr(s, h)).command(() => or(s, h)).run();
11825
+ return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => ir(s, h)).command(() => sr(s, h)).run();
11825
11826
  }
11826
- return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run() : a().command(() => {
11827
+ return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => ir(s, h)).command(() => sr(s, h)).run() : a().command(() => {
11827
11828
  const L = d().wrapInList(h, r), C = I.filter((v) => f.includes(v.type.name));
11828
11829
  return s.ensureMarks(C), L ? !0 : c.clearNodes();
11829
- }).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run();
11830
+ }).wrapInList(h, r).command(() => ir(s, h)).command(() => sr(s, h)).run();
11830
11831
  }, Xu = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11831
11832
  const { extendEmptyMarkRange: s = !1 } = t, o = Ke(n, r.schema);
11832
- return vr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11833
+ return Nr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11833
11834
  }, Zu = (n, e, t = {}) => ({ state: r, commands: i }) => {
11834
11835
  const s = V(n, r.schema), o = V(e, r.schema), l = Vt(r, s, t);
11835
11836
  let a;
@@ -11878,7 +11879,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11878
11879
  return t.removeStoredMark(a), !0;
11879
11880
  }, rf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11880
11881
  let s = null, o = null;
11881
- const l = Hn(typeof n == "string" ? n : n.name, r.schema);
11882
+ const l = Vn(typeof n == "string" ? n : n.name, r.schema);
11882
11883
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11883
11884
  const c = a.$from.pos, d = a.$to.pos;
11884
11885
  let u, f, h, p;
@@ -12102,10 +12103,10 @@ const af = _.create({
12102
12103
  const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
12103
12104
  if (s || !(o === a && l === c) || !ni(t.doc))
12104
12105
  return;
12105
- const f = t.tr, h = Ln({
12106
+ const f = t.tr, h = Bn({
12106
12107
  state: t,
12107
12108
  transaction: f
12108
- }), { commands: p } = new zn({
12109
+ }), { commands: p } = new Ln({
12109
12110
  editor: this.editor,
12110
12111
  state: h
12111
12112
  });
@@ -12503,7 +12504,7 @@ class bf extends Nd {
12503
12504
  * Creates an command manager.
12504
12505
  */
12505
12506
  createCommandManager() {
12506
- this.commandManager = new zn({
12507
+ this.commandManager = new Ln({
12507
12508
  editor: this
12508
12509
  });
12509
12510
  }
@@ -12520,7 +12521,7 @@ class bf extends Nd {
12520
12521
  var e;
12521
12522
  let t;
12522
12523
  try {
12523
- t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12524
+ t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12524
12525
  } catch (o) {
12525
12526
  if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
12526
12527
  throw o;
@@ -12530,7 +12531,7 @@ class bf extends Nd {
12530
12531
  disableCollaboration: () => {
12531
12532
  this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
12532
12533
  }
12533
- }), t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12534
+ }), t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12534
12535
  }
12535
12536
  const r = Qo(t, this.options.autofocus);
12536
12537
  this.view = new Ro(this.options.element, {
@@ -12702,7 +12703,7 @@ class bf extends Nd {
12702
12703
  }
12703
12704
  }
12704
12705
  function lt(n) {
12705
- return new $n({
12706
+ return new Fn({
12706
12707
  find: n.find,
12707
12708
  handler: ({ state: e, range: t, match: r }) => {
12708
12709
  const i = N(n.getAttributes, void 0, r);
@@ -12721,7 +12722,7 @@ function lt(n) {
12721
12722
  });
12722
12723
  }
12723
12724
  function il(n) {
12724
- return new $n({
12725
+ return new Fn({
12725
12726
  find: n.find,
12726
12727
  handler: ({ state: e, range: t, match: r }) => {
12727
12728
  const i = N(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
@@ -12741,8 +12742,8 @@ function il(n) {
12741
12742
  }
12742
12743
  });
12743
12744
  }
12744
- function Ar(n) {
12745
- return new $n({
12745
+ function vr(n) {
12746
+ return new Fn({
12746
12747
  find: n.find,
12747
12748
  handler: ({ state: e, range: t, match: r }) => {
12748
12749
  const i = e.doc.resolve(t.from), s = N(n.getAttributes, void 0, r) || {};
@@ -12753,7 +12754,7 @@ function Ar(n) {
12753
12754
  });
12754
12755
  }
12755
12756
  function Ht(n) {
12756
- return new $n({
12757
+ return new Fn({
12757
12758
  find: n.find,
12758
12759
  handler: ({ state: e, range: t, match: r, chain: i }) => {
12759
12760
  const s = N(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Lr(a, n.type, s);
@@ -12796,7 +12797,7 @@ class ne {
12796
12797
  configure(e = {}) {
12797
12798
  const t = this.extend({
12798
12799
  ...this.config,
12799
- addOptions: () => Vn(this.options, e)
12800
+ addOptions: () => $n(this.options, e)
12800
12801
  });
12801
12802
  return t.name = this.name, t.parent = this.parent, t;
12802
12803
  }
@@ -13131,14 +13132,14 @@ const xf = /^\s*>\s$/, Sf = ne.create({
13131
13132
  },
13132
13133
  addInputRules() {
13133
13134
  return [
13134
- Ar({
13135
+ vr({
13135
13136
  find: If,
13136
13137
  type: this.type,
13137
13138
  getAttributes: (n) => ({
13138
13139
  language: n[1]
13139
13140
  })
13140
13141
  }),
13141
- Ar({
13142
+ vr({
13142
13143
  find: Rf,
13143
13144
  type: this.type,
13144
13145
  getAttributes: (n) => ({
@@ -13574,7 +13575,7 @@ const Jf = _.create({
13574
13575
  }), {});
13575
13576
  },
13576
13577
  addInputRules() {
13577
- return this.options.levels.map((n) => Ar({
13578
+ return this.options.levels.map((n) => vr({
13578
13579
  find: new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),
13579
13580
  type: this.type,
13580
13581
  getAttributes: {
@@ -13830,9 +13831,9 @@ function Qf(n, e, t, r) {
13830
13831
  if (o && o.getMeta(nt))
13831
13832
  return o.getMeta(nt).redo ? new Ie(n.done.addTransform(t, void 0, r, cn(e)), n.undone, ms(t.mapping.maps), n.prevTime, n.prevComposition) : new Ie(n.done, n.undone.addTransform(t, void 0, r, cn(e)), null, n.prevTime, n.prevComposition);
13832
13833
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13833
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !eh(t, n.prevRanges)), c = o ? lr(n.prevRanges, t.mapping) : ms(t.mapping.maps);
13834
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !eh(t, n.prevRanges)), c = o ? or(n.prevRanges, t.mapping) : ms(t.mapping.maps);
13834
13835
  return new Ie(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, cn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
13835
- } else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Ie(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13836
+ } else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s), or(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Ie(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), or(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13836
13837
  }
13837
13838
  function eh(n, e) {
13838
13839
  if (!e)
@@ -13851,7 +13852,7 @@ function ms(n) {
13851
13852
  n[t].forEach((r, i, s, o) => e.push(s, o));
13852
13853
  return e;
13853
13854
  }
13854
- function lr(n, e) {
13855
+ function or(n, e) {
13855
13856
  if (!n)
13856
13857
  return null;
13857
13858
  let t = [];
@@ -13868,18 +13869,18 @@ function th(n, e, t) {
13868
13869
  let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Ie(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
13869
13870
  return s.transform.setSelection(o).setMeta(nt, { redo: t, historyState: a });
13870
13871
  }
13871
- let ar = !1, gs = null;
13872
+ let lr = !1, gs = null;
13872
13873
  function cn(n) {
13873
13874
  let e = n.plugins;
13874
13875
  if (gs != e) {
13875
- ar = !1, gs = e;
13876
+ lr = !1, gs = e;
13876
13877
  for (let t = 0; t < e.length; t++)
13877
13878
  if (e[t].spec.historyPreserveItems) {
13878
- ar = !0;
13879
+ lr = !0;
13879
13880
  break;
13880
13881
  }
13881
13882
  }
13882
- return ar;
13883
+ return lr;
13883
13884
  }
13884
13885
  const nt = new we("history"), nh = new we("closeHistory");
13885
13886
  function rh(n = {}) {
@@ -14484,7 +14485,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), ih = _.create({
14484
14485
  ];
14485
14486
  }
14486
14487
  });
14487
- var re, Jt, Ut, de, Dr, dl, ul, fl, hl;
14488
+ var re, Jt, Ut, de, Ar, dl, ul, fl, hl;
14488
14489
  class vh extends Sl {
14489
14490
  constructor() {
14490
14491
  super();
@@ -14494,7 +14495,7 @@ class vh extends Sl {
14494
14495
  W(this, Ut, null);
14495
14496
  }
14496
14497
  connectedCallback() {
14497
- super.connectedCallback() && (Q(this, de, dl).call(this), Q(this, de, ul).call(this), Q(this, de, Dr).call(this));
14498
+ super.connectedCallback() && (Q(this, de, dl).call(this), Q(this, de, ul).call(this), Q(this, de, Ar).call(this));
14498
14499
  }
14499
14500
  get value() {
14500
14501
  return O(this, re).getHTML();
@@ -14521,14 +14522,14 @@ class vh extends Sl {
14521
14522
  return this.hasAttribute("readonly");
14522
14523
  }
14523
14524
  set readonly(t) {
14524
- t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, de, Dr).call(this);
14525
+ t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, de, Ar).call(this);
14525
14526
  }
14526
14527
  disconnectedCallback() {
14527
14528
  O(this, re) && (O(this, re).destroy(), oe(this, re, null));
14528
14529
  }
14529
14530
  }
14530
14531
  re = new WeakMap(), Jt = new WeakMap(), Ut = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
14531
- Dr = function() {
14532
+ Ar = function() {
14532
14533
  if (O(this, re)) {
14533
14534
  const t = this.readonly;
14534
14535
  O(this, re).setEditable(!t);
@@ -14536,10 +14537,10 @@ Dr = function() {
14536
14537
  r && (r.style.display = t ? "none" : "flex");
14537
14538
  }
14538
14539
  }, dl = function() {
14539
- const t = Nn.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14540
+ const t = Rr.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14540
14541
  this.shadowRoot.innerHTML = `
14541
14542
  <style>
14542
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.42/dist/css/nineEditor.css";
14543
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.44/dist/css/nineEditor.css";
14543
14544
  ${r}
14544
14545
  </style>
14545
14546
 
@@ -14640,9 +14641,10 @@ Dr = function() {
14640
14641
  r && t.chain().focus().setImage({ src: r }).run();
14641
14642
  };
14642
14643
  };
14643
- typeof window < "u" && (window.nineUx = Nn, customElements.get("nine-editor") || customElements.define("nine-editor", vh));
14644
+ typeof window < "u" && (console.log("[nine-ux] Registering nine-editor..."), customElements.get("nine-editor") || (customElements.define("nine-editor", vh), console.log("[nine-ux] nine-editor registered successfully!")));
14644
14645
  export {
14646
+ Ph as nine,
14645
14647
  vh as nineEditor,
14646
- Nn as nineUx
14648
+ Rr as nineUx
14647
14649
  };
14648
14650
  //# sourceMappingURL=nine-ux.es.js.map