@alxgrn/prose-editor 0.0.27 → 0.0.28

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.
@@ -322,7 +322,7 @@ function Kf() {
322
322
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
323
323
  )), b = this.props.ref, b !== void 0 ? b : null;
324
324
  }
325
- function h(b, A, R, L, le, K) {
325
+ function p(b, A, R, L, le, K) {
326
326
  return R = K.ref, b = {
327
327
  $$typeof: O,
328
328
  type: b,
@@ -344,7 +344,7 @@ function Kf() {
344
344
  value: null
345
345
  }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
346
346
  }
347
- function p(b, A, R, L, le, K) {
347
+ function h(b, A, R, L, le, K) {
348
348
  if (typeof b == "string" || typeof b == "function" || b === S || b === j || b === $ || b === dt || b === Ee || b === on || typeof b == "object" && b !== null && (b.$$typeof === $t || b.$$typeof === $e || b.$$typeof === _ || b.$$typeof === E || b.$$typeof === Se || b.$$typeof === Rf || b.getModuleId !== void 0)) {
349
349
  var F = A.children;
350
350
  if (F !== void 0)
@@ -390,7 +390,7 @@ React keys must be passed directly to JSX without using spread:
390
390
  return F && f(
391
391
  R,
392
392
  typeof b == "function" ? b.displayName || b.name || "Unknown" : b
393
- ), h(b, F, K, le, c(), R);
393
+ ), p(b, F, K, le, c(), R);
394
394
  }
395
395
  function y(b, A) {
396
396
  if (typeof b == "object" && b && b.$$typeof !== If) {
@@ -437,9 +437,9 @@ Check the top-level render call using <` + b + ">."), A;
437
437
  r.__reactDisabledLog = !0;
438
438
  var ws, Ai, Ms = !1, Ns = new (typeof WeakMap == "function" ? WeakMap : Map)(), If = Symbol.for("react.client.reference"), Ri, Ii = {}, Pi = {}, vi = {};
439
439
  Pn.Fragment = S, Pn.jsx = function(b, A, R, L, le) {
440
- return p(b, A, R, !1, L, le);
440
+ return h(b, A, R, !1, L, le);
441
441
  }, Pn.jsxs = function(b, A, R, L, le) {
442
- return p(b, A, R, !0, L, le);
442
+ return h(b, A, R, !0, L, le);
443
443
  };
444
444
  }()), Pn;
445
445
  }
@@ -3258,11 +3258,11 @@ function Ar(n, e, t, r) {
3258
3258
  throw new RangeError("Content hole must be the only child of its parent node");
3259
3259
  return { dom: a, contentDOM: a };
3260
3260
  } else {
3261
- let { dom: h, contentDOM: p } = Ar(n, d, t, r);
3262
- if (a.appendChild(h), p) {
3261
+ let { dom: p, contentDOM: h } = Ar(n, d, t, r);
3262
+ if (a.appendChild(p), h) {
3263
3263
  if (l)
3264
3264
  throw new RangeError("Multiple content holes");
3265
- l = p;
3265
+ l = h;
3266
3266
  }
3267
3267
  }
3268
3268
  }
@@ -3352,11 +3352,11 @@ class we {
3352
3352
  break;
3353
3353
  let c = this.ranges[l + o], u = this.ranges[l + i], f = a + c;
3354
3354
  if (e <= f) {
3355
- let d = c ? e == a ? -1 : e == f ? 1 : t : t, h = a + s + (d < 0 ? 0 : u);
3355
+ let d = c ? e == a ? -1 : e == f ? 1 : t : t, p = a + s + (d < 0 ? 0 : u);
3356
3356
  if (r)
3357
- return h;
3358
- let p = e == (t < 0 ? a : f) ? null : gd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Rr;
3359
- return (t < 0 ? e != a : e != f) && (y |= oc), new lo(h, y, p);
3357
+ return p;
3358
+ let h = e == (t < 0 ? a : f) ? null : gd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Rr;
3359
+ return (t < 0 ? e != a : e != f) && (y |= oc), new lo(p, y, h);
3360
3360
  }
3361
3361
  s += u - c;
3362
3362
  }
@@ -3891,10 +3891,10 @@ function bd(n, e, t, r) {
3891
3891
  return;
3892
3892
  let f = a.marks;
3893
3893
  if (!r.isInSet(f) && u.type.allowsMarkType(r.type)) {
3894
- let d = Math.max(c, e), h = Math.min(c + a.nodeSize, t), p = r.addToSet(f);
3894
+ let d = Math.max(c, e), p = Math.min(c + a.nodeSize, t), h = r.addToSet(f);
3895
3895
  for (let y = 0; y < f.length; y++)
3896
- f[y].isInSet(p) || (i && i.to == d && i.mark.eq(f[y]) ? i.to = h : s.push(i = new _e(d, h, f[y])));
3897
- l && l.to == d ? l.to = h : o.push(l = new St(d, h, r));
3896
+ f[y].isInSet(h) || (i && i.to == d && i.mark.eq(f[y]) ? i.to = p : s.push(i = new _e(d, p, f[y])));
3897
+ l && l.to == d ? l.to = p : o.push(l = new St(d, p, r));
3898
3898
  }
3899
3899
  }), s.forEach((a) => n.step(a)), o.forEach((a) => n.step(a));
3900
3900
  }
@@ -3914,9 +3914,9 @@ function xd(n, e, t, r) {
3914
3914
  let c = Math.min(l + i.nodeSize, t);
3915
3915
  for (let u = 0; u < a.length; u++) {
3916
3916
  let f = a[u], d;
3917
- for (let h = 0; h < s.length; h++) {
3918
- let p = s[h];
3919
- p.step == o - 1 && f.eq(s[h].style) && (d = p);
3917
+ for (let p = 0; p < s.length; p++) {
3918
+ let h = s[p];
3919
+ h.step == o - 1 && f.eq(s[p].style) && (d = h);
3920
3920
  }
3921
3921
  d ? (d.to = c, d.step = o) : s.push({ style: f, from: Math.max(l, e), to: c, step: o });
3922
3922
  }
@@ -3934,9 +3934,9 @@ function Bo(n, e, t, r = t.contentMatch, s = !0) {
3934
3934
  for (let d = 0; d < c.marks.length; d++)
3935
3935
  t.allowsMarkType(c.marks[d].type) || n.step(new _e(l, u, c.marks[d]));
3936
3936
  if (s && c.isText && t.whitespace != "pre") {
3937
- let d, h = /\r?\n|\r/g, p;
3938
- for (; d = h.exec(c.text); )
3939
- p || (p = new M(k.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, p));
3937
+ let d, p = /\r?\n|\r/g, h;
3938
+ for (; d = p.exec(c.text); )
3939
+ h || (h = new M(k.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, h));
3940
3940
  }
3941
3941
  }
3942
3942
  l = u;
@@ -3964,12 +3964,12 @@ function ur(n) {
3964
3964
  }
3965
3965
  function Sd(n, e, t) {
3966
3966
  let { $from: r, $to: s, depth: o } = e, i = r.before(o + 1), l = s.after(o + 1), a = i, c = l, u = k.empty, f = 0;
3967
- for (let p = o, y = !1; p > t; p--)
3968
- y || r.index(p) > 0 ? (y = !0, u = k.from(r.node(p).copy(u)), f++) : a--;
3969
- let d = k.empty, h = 0;
3970
- for (let p = o, y = !1; p > t; p--)
3971
- y || s.after(p + 1) < s.end(p) ? (y = !0, d = k.from(s.node(p).copy(d)), h++) : c++;
3972
- n.step(new oe(a, c, i, l, new M(u.append(d), f, h), u.size - f, !0));
3967
+ for (let h = o, y = !1; h > t; h--)
3968
+ y || r.index(h) > 0 ? (y = !0, u = k.from(r.node(h).copy(u)), f++) : a--;
3969
+ let d = k.empty, p = 0;
3970
+ for (let h = o, y = !1; h > t; h--)
3971
+ y || s.after(h + 1) < s.end(h) ? (y = !0, d = k.from(s.node(h).copy(d)), p++) : c++;
3972
+ n.step(new oe(a, c, i, l, new M(u.append(d), f, p), u.size - f, !0));
3973
3973
  }
3974
3974
  function Lo(n, e, t = null, r = n) {
3975
3975
  let s = Cd(n, e), o = s && wd(r, e);
@@ -4016,8 +4016,8 @@ function Nd(n, e, t, r, s) {
4016
4016
  if (i.isTextblock && !i.hasMarkup(r, a) && Dd(n.doc, n.mapping.slice(o).map(l), r)) {
4017
4017
  let c = null;
4018
4018
  if (r.schema.linebreakReplacement) {
4019
- let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
4020
- h && !p ? c = !1 : !h && p && (c = !0);
4019
+ let p = r.whitespace == "pre", h = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
4020
+ p && !h ? c = !1 : !p && h && (c = !0);
4021
4021
  }
4022
4022
  c === !1 && lc(n, i, l, o), Bo(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
4023
4023
  let u = n.mapping.slice(o), f = u.map(l, 1), d = u.map(l + i.nodeSize, 1);
@@ -4069,10 +4069,10 @@ function bn(n, e, t = 1, r) {
4069
4069
  let f = s.node(c), d = s.index(c);
4070
4070
  if (f.type.spec.isolating)
4071
4071
  return !1;
4072
- let h = f.content.cutByIndex(d, f.childCount), p = r && r[u + 1];
4073
- p && (h = h.replaceChild(0, p.type.create(p.attrs)));
4072
+ let p = f.content.cutByIndex(d, f.childCount), h = r && r[u + 1];
4073
+ h && (p = p.replaceChild(0, h.type.create(h.attrs)));
4074
4074
  let y = r && r[u] || f;
4075
- if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(h))
4075
+ if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(p))
4076
4076
  return !1;
4077
4077
  }
4078
4078
  let l = s.indexAfter(o), a = r && r[0];
@@ -4272,20 +4272,20 @@ class Id {
4272
4272
  u.push(s.child(y));
4273
4273
  f = f.matchFragment(s);
4274
4274
  }
4275
- let h = l.size + e - (i.content.size - i.openEnd);
4275
+ let p = l.size + e - (i.content.size - i.openEnd);
4276
4276
  for (; c < l.childCount; ) {
4277
4277
  let y = l.child(c), m = f.matchType(y.type);
4278
4278
  if (!m)
4279
4279
  break;
4280
- c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
4280
+ c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? p : -1)));
4281
4281
  }
4282
- let p = c == l.childCount;
4283
- p || (h = -1), this.placed = $n(this.placed, t, k.from(u)), this.frontier[t].match = f, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4284
- for (let y = 0, m = l; y < h; y++) {
4282
+ let h = c == l.childCount;
4283
+ h || (p = -1), this.placed = $n(this.placed, t, k.from(u)), this.frontier[t].match = f, h && p < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4284
+ for (let y = 0, m = l; y < p; y++) {
4285
4285
  let x = m.lastChild;
4286
4286
  this.frontier.push({ type: x.type, match: x.contentMatchAt(x.childCount) }), m = x.content;
4287
4287
  }
4288
- this.unplaced = p ? e == 0 ? M.empty : new M(Vn(i.content, e - 1, 1), e - 1, h < 0 ? i.openEnd : e - 1) : new M(Vn(i.content, e, c), i.openStart, i.openEnd);
4288
+ this.unplaced = h ? e == 0 ? M.empty : new M(Vn(i.content, e - 1, 1), e - 1, p < 0 ? i.openEnd : e - 1) : new M(Vn(i.content, e, c), i.openStart, i.openEnd);
4289
4289
  }
4290
4290
  mustMoveInline() {
4291
4291
  if (!this.$to.parent.isTextblock)
@@ -4376,41 +4376,41 @@ function Vd(n, e, t, r) {
4376
4376
  i[i.length - 1] == 0 && i.pop();
4377
4377
  let l = -(s.depth + 1);
4378
4378
  i.unshift(l);
4379
- for (let d = s.depth, h = s.pos - 1; d > 0; d--, h--) {
4380
- let p = s.node(d).type.spec;
4381
- if (p.defining || p.definingAsContext || p.isolating)
4379
+ for (let d = s.depth, p = s.pos - 1; d > 0; d--, p--) {
4380
+ let h = s.node(d).type.spec;
4381
+ if (h.defining || h.definingAsContext || h.isolating)
4382
4382
  break;
4383
- i.indexOf(d) > -1 ? l = d : s.before(d) == h && i.splice(1, 0, -d);
4383
+ i.indexOf(d) > -1 ? l = d : s.before(d) == p && i.splice(1, 0, -d);
4384
4384
  }
4385
4385
  let a = i.indexOf(l), c = [], u = r.openStart;
4386
- for (let d = r.content, h = 0; ; h++) {
4387
- let p = d.firstChild;
4388
- if (c.push(p), h == r.openStart)
4386
+ for (let d = r.content, p = 0; ; p++) {
4387
+ let h = d.firstChild;
4388
+ if (c.push(h), p == r.openStart)
4389
4389
  break;
4390
- d = p.content;
4390
+ d = h.content;
4391
4391
  }
4392
4392
  for (let d = u - 1; d >= 0; d--) {
4393
- let h = c[d], p = vd(h.type);
4394
- if (p && !h.sameMarkup(s.node(Math.abs(l) - 1)))
4393
+ let p = c[d], h = vd(p.type);
4394
+ if (h && !p.sameMarkup(s.node(Math.abs(l) - 1)))
4395
4395
  u = d;
4396
- else if (p || !h.type.isTextblock)
4396
+ else if (h || !p.type.isTextblock)
4397
4397
  break;
4398
4398
  }
4399
4399
  for (let d = r.openStart; d >= 0; d--) {
4400
- let h = (d + u + 1) % (r.openStart + 1), p = c[h];
4401
- if (p)
4400
+ let p = (d + u + 1) % (r.openStart + 1), h = c[p];
4401
+ if (h)
4402
4402
  for (let y = 0; y < i.length; y++) {
4403
4403
  let m = i[(y + a) % i.length], x = !0;
4404
4404
  m < 0 && (x = !1, m = -m);
4405
4405
  let C = s.node(m - 1), w = s.index(m - 1);
4406
- if (C.canReplaceWith(w, w, p.type, p.marks))
4407
- return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart, h), h, r.openEnd));
4406
+ if (C.canReplaceWith(w, w, h.type, h.marks))
4407
+ return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart, p), p, r.openEnd));
4408
4408
  }
4409
4409
  }
4410
4410
  let f = n.steps.length;
4411
4411
  for (let d = i.length - 1; d >= 0 && (n.replace(e, t, r), !(n.steps.length > f)); d--) {
4412
- let h = i[d];
4413
- h < 0 || (e = s.before(h), t = o.after(h));
4412
+ let p = i[d];
4413
+ p < 0 || (e = s.before(p), t = o.after(p));
4414
4414
  }
4415
4415
  }
4416
4416
  function dc(n, e, t, r, s) {
@@ -5693,8 +5693,8 @@ class ze {
5693
5693
  }
5694
5694
  if (s) {
5695
5695
  u.push(new We(f.map));
5696
- let h = f.step.map(s.slice(o)), p;
5697
- h && i.maybeStep(h).doc && (p = i.mapping.maps[i.mapping.maps.length - 1], c.push(new We(p, void 0, void 0, c.length + u.length))), o--, p && s.appendMap(p, o);
5696
+ let p = f.step.map(s.slice(o)), h;
5697
+ p && i.maybeStep(p).doc && (h = i.mapping.maps[i.mapping.maps.length - 1], c.push(new We(h, void 0, void 0, c.length + u.length))), o--, h && s.appendMap(h, o);
5698
5698
  } else
5699
5699
  i.maybeStep(f.step);
5700
5700
  if (f.selection)
@@ -5705,8 +5705,8 @@ class ze {
5705
5705
  addTransform(e, t, r, s) {
5706
5706
  let o = [], i = this.eventCount, l = this.items, a = !s && l.length ? l.get(l.length - 1) : null;
5707
5707
  for (let u = 0; u < e.steps.length; u++) {
5708
- let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t), h;
5709
- (h = a && a.merge(d)) && (d = h, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(d), t && (i++, t = void 0), s || (a = d);
5708
+ let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t), p;
5709
+ (p = a && a.merge(d)) && (d = p, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(d), t && (i++, t = void 0), s || (a = d);
5710
5710
  }
5711
5711
  let c = i - r.depth;
5712
5712
  return c > qd && (l = _d(l, c), i -= c), new ze(l.append(o), i);
@@ -5734,16 +5734,16 @@ class ze {
5734
5734
  }, s);
5735
5735
  let a = t;
5736
5736
  this.items.forEach((d) => {
5737
- let h = o.getMirror(--a);
5738
- if (h == null)
5737
+ let p = o.getMirror(--a);
5738
+ if (p == null)
5739
5739
  return;
5740
- i = Math.min(i, h);
5741
- let p = o.maps[h];
5740
+ i = Math.min(i, p);
5741
+ let h = o.maps[p];
5742
5742
  if (d.step) {
5743
- let y = e.steps[h].invert(e.docs[h]), m = d.selection && d.selection.map(o.slice(a + 1, h));
5744
- m && l++, r.push(new We(p, y, m));
5743
+ let y = e.steps[p].invert(e.docs[p]), m = d.selection && d.selection.map(o.slice(a + 1, p));
5744
+ m && l++, r.push(new We(h, y, m));
5745
5745
  } else
5746
- r.push(new We(p));
5746
+ r.push(new We(h));
5747
5747
  }, s);
5748
5748
  let c = [];
5749
5749
  for (let d = t; d < i; d++)
@@ -5773,8 +5773,8 @@ class ze {
5773
5773
  if (r--, c && t.appendMap(c, r), a) {
5774
5774
  let u = i.selection && i.selection.map(t.slice(r));
5775
5775
  u && o++;
5776
- let f = new We(c.invert(), a, u), d, h = s.length - 1;
5777
- (d = s.length && s[h].merge(f)) ? s[h] = d : s.push(f);
5776
+ let f = new We(c.invert(), a, u), d, p = s.length - 1;
5777
+ (d = s.length && s[p].merge(f)) ? s[p] = d : s.push(f);
5778
5778
  }
5779
5779
  } else i.map && r--;
5780
5780
  }, this.items.length, 0), new ze(ee.from(s.reverse()), o);
@@ -6247,12 +6247,12 @@ function dh(n) {
6247
6247
  if (!r.depth)
6248
6248
  return !1;
6249
6249
  let o = [], i, l, a = !1, c = !1;
6250
- for (let h = r.depth; ; h--)
6251
- if (r.node(h).isBlock) {
6252
- a = r.end(h) == r.pos + (r.depth - h), c = r.start(h) == r.pos - (r.depth - h), l = Uo(r.node(h - 1).contentMatchAt(r.indexAfter(h - 1))), o.unshift(a && l ? { type: l } : null), i = h;
6250
+ for (let p = r.depth; ; p--)
6251
+ if (r.node(p).isBlock) {
6252
+ a = r.end(p) == r.pos + (r.depth - p), c = r.start(p) == r.pos - (r.depth - p), l = Uo(r.node(p - 1).contentMatchAt(r.indexAfter(p - 1))), o.unshift(a && l ? { type: l } : null), i = p;
6253
6253
  break;
6254
6254
  } else {
6255
- if (h == 1)
6255
+ if (p == 1)
6256
6256
  return !1;
6257
6257
  o.unshift(null);
6258
6258
  }
@@ -6262,8 +6262,8 @@ function dh(n) {
6262
6262
  if (d || (o[0] = l ? { type: l } : null, d = bn(u.doc, f, o.length, o)), !d)
6263
6263
  return !1;
6264
6264
  if (u.split(f, o.length, o), !a && c && r.node(i).type != l) {
6265
- let h = u.mapping.map(r.before(i)), p = u.doc.resolve(h);
6266
- l && r.node(i - 1).canReplaceWith(p.index(), p.index() + 1, l) && u.setNodeMarkup(u.mapping.map(r.before(i)), l);
6265
+ let p = u.mapping.map(r.before(i)), h = u.doc.resolve(p);
6266
+ l && r.node(i - 1).canReplaceWith(h.index(), h.index() + 1, l) && u.setNodeMarkup(u.mapping.map(r.before(i)), l);
6267
6267
  }
6268
6268
  return t && t(u.scrollIntoView()), !0;
6269
6269
  };
@@ -6283,11 +6283,11 @@ function Nc(n, e, t, r) {
6283
6283
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
6284
6284
  if (c && (i = (l = s.contentMatchAt(s.childCount)).findWrapping(o.type)) && l.matchType(i[0] || o.type).validEnd) {
6285
6285
  if (t) {
6286
- let h = e.pos + o.nodeSize, p = k.empty;
6286
+ let p = e.pos + o.nodeSize, h = k.empty;
6287
6287
  for (let x = i.length - 1; x >= 0; x--)
6288
- p = k.from(i[x].create(null, p));
6289
- p = k.from(s.copy(p));
6290
- let y = n.tr.step(new oe(e.pos - 1, h, e.pos, h, new M(p, 1, 0), i.length, !0)), m = y.doc.resolve(h + 2 * i.length);
6288
+ h = k.from(i[x].create(null, h));
6289
+ h = k.from(s.copy(h));
6290
+ let y = n.tr.step(new oe(e.pos - 1, p, e.pos, p, new M(h, 1, 0), i.length, !0)), m = y.doc.resolve(p + 2 * i.length);
6291
6291
  m.nodeAfter && m.nodeAfter.type == s.type && En(y.doc, m.pos) && y.join(m.pos), t(y.scrollIntoView());
6292
6292
  }
6293
6293
  return !0;
@@ -6296,18 +6296,18 @@ function Nc(n, e, t, r) {
6296
6296
  if (d != null && d >= e.depth)
6297
6297
  return t && t(n.tr.lift(f, d).scrollIntoView()), !0;
6298
6298
  if (c && Nn(o, "start", !0) && Nn(s, "end")) {
6299
- let h = s, p = [];
6300
- for (; p.push(h), !h.isTextblock; )
6301
- h = h.lastChild;
6299
+ let p = s, h = [];
6300
+ for (; h.push(p), !p.isTextblock; )
6301
+ p = p.lastChild;
6302
6302
  let y = o, m = 1;
6303
6303
  for (; !y.isTextblock; y = y.firstChild)
6304
6304
  m++;
6305
- if (h.canReplace(h.childCount, h.childCount, y.content)) {
6305
+ if (p.canReplace(p.childCount, p.childCount, y.content)) {
6306
6306
  if (t) {
6307
6307
  let x = k.empty;
6308
- for (let w = p.length - 1; w >= 0; w--)
6309
- x = k.from(p[w].copy(x));
6310
- let C = n.tr.step(new oe(e.pos - p.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new M(x, p.length, 0), 0, !0));
6308
+ for (let w = h.length - 1; w >= 0; w--)
6309
+ x = k.from(h[w].copy(x));
6310
+ let C = n.tr.step(new oe(e.pos - h.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new M(x, h.length, 0), 0, !0));
6311
6311
  t(C.scrollIntoView());
6312
6312
  }
6313
6313
  return !0;
@@ -6391,8 +6391,8 @@ function Ce(n, e = null, t) {
6391
6391
  if (!a)
6392
6392
  c.removeMark(f.pos, d.pos, n);
6393
6393
  else {
6394
- let h = f.pos, p = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, C = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
6395
- h + x < p && (h += x, p -= C), c.addMark(h, p, n.create(e));
6394
+ let p = f.pos, h = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, C = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
6395
+ p + x < h && (p += x, h -= C), c.addMark(p, h, n.create(e));
6396
6396
  }
6397
6397
  }
6398
6398
  s(c.scrollIntoView());
@@ -6462,12 +6462,12 @@ class Ch {
6462
6462
  if (t) {
6463
6463
  let f = e.nodeBefore, d = e.nodeAfter;
6464
6464
  if (f || d) {
6465
- let h = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
6466
- if (h) {
6467
- let p = h.getBoundingClientRect(), y = f ? p.bottom : p.top;
6465
+ let p = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
6466
+ if (p) {
6467
+ let h = p.getBoundingClientRect(), y = f ? h.bottom : h.top;
6468
6468
  f && d && (y = (y + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
6469
6469
  let m = this.width / 2 * l;
6470
- r = { left: p.left, right: p.right, top: y - m, bottom: y + m };
6470
+ r = { left: h.left, right: h.right, top: y - m, bottom: y + m };
6471
6471
  }
6472
6472
  }
6473
6473
  }
@@ -6481,8 +6481,8 @@ class Ch {
6481
6481
  if (!a || a == document.body && getComputedStyle(a).position == "static")
6482
6482
  c = -pageXOffset, u = -pageYOffset;
6483
6483
  else {
6484
- let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth, h = f.height / a.offsetHeight;
6485
- c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop * h;
6484
+ let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth, p = f.height / a.offsetHeight;
6485
+ c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop * p;
6486
6486
  }
6487
6487
  this.element.style.left = (r.left - c) / i + "px", this.element.style.top = (r.top - u) / l + "px", this.element.style.width = (r.right - r.left) / i + "px", this.element.style.height = (r.bottom - r.top) / l + "px";
6488
6488
  }
@@ -6659,10 +6659,10 @@ function cl(n, e, t) {
6659
6659
  if (a)
6660
6660
  o.defaultView.scrollBy(u, f);
6661
6661
  else {
6662
- let d = l.scrollLeft, h = l.scrollTop;
6662
+ let d = l.scrollLeft, p = l.scrollTop;
6663
6663
  f && (l.scrollTop += f), u && (l.scrollLeft += u);
6664
- let p = l.scrollLeft - d, y = l.scrollTop - h;
6665
- e = { left: e.left - p, top: e.top - y, right: e.right - p, bottom: e.bottom - y };
6664
+ let h = l.scrollLeft - d, y = l.scrollTop - p;
6665
+ e = { left: e.left - h, top: e.top - y, right: e.right - h, bottom: e.bottom - y };
6666
6666
  }
6667
6667
  if (a || /^(fixed|sticky)$/.test(getComputedStyle(i).position))
6668
6668
  break;
@@ -6721,20 +6721,20 @@ function Pc(n, e) {
6721
6721
  d = ot(u).getClientRects();
6722
6722
  else
6723
6723
  continue;
6724
- for (let h = 0; h < d.length; h++) {
6725
- let p = d[h];
6726
- if (p.top <= i && p.bottom >= l) {
6727
- i = Math.max(p.bottom, i), l = Math.min(p.top, l);
6728
- let y = p.left > e.left ? p.left - e.left : p.right < e.left ? e.left - p.right : 0;
6724
+ for (let p = 0; p < d.length; p++) {
6725
+ let h = d[p];
6726
+ if (h.top <= i && h.bottom >= l) {
6727
+ i = Math.max(h.bottom, i), l = Math.min(h.top, l);
6728
+ let y = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
6729
6729
  if (y < r) {
6730
6730
  t = u, r = y, s = y && t.nodeType == 3 ? {
6731
- left: p.right < e.left ? p.right : p.left,
6731
+ left: h.right < e.left ? h.right : h.left,
6732
6732
  top: e.top
6733
- } : e, u.nodeType == 1 && y && (o = f + (e.left >= (p.left + p.right) / 2 ? 1 : 0));
6733
+ } : e, u.nodeType == 1 && y && (o = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
6734
6734
  continue;
6735
6735
  }
6736
- } else p.top > e.top && !a && p.left <= e.left && p.right >= e.left && (a = u, c = { left: Math.max(p.left, Math.min(p.right, e.left)), top: p.top });
6737
- !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (o = f + 1);
6736
+ } else h.top > e.top && !a && h.left <= e.left && h.right >= e.left && (a = u, c = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
6737
+ !t && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (o = f + 1);
6738
6738
  }
6739
6739
  }
6740
6740
  return !t && a && (t = a, s = c, r = 0), t && t.nodeType == 3 ? zh(t, s) : !t || r && t.nodeType == 1 ? { node: n, offset: o } : Pc(t, s);
@@ -6940,7 +6940,7 @@ function Hh(n, e, t) {
6940
6940
  return l ? !qh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : $c(n, e, () => {
6941
6941
  let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: f } = n.domSelectionRange(), d = l.caretBidiLevel;
6942
6942
  l.modify("move", t, "character");
6943
- let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: y } = n.domSelectionRange(), m = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == y;
6943
+ let p = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: h, focusOffset: y } = n.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == y;
6944
6944
  try {
6945
6945
  l.collapse(u, f), a && (a != u || c != f) && l.extend && l.extend(a, c);
6946
6946
  } catch {
@@ -7199,19 +7199,19 @@ let hr = class {
7199
7199
  // case we just use whatever domFromPos produces as a best effort.
7200
7200
  setSelection(e, t, r, s = !1) {
7201
7201
  let o = Math.min(e, t), i = Math.max(e, t);
7202
- for (let h = 0, p = 0; h < this.children.length; h++) {
7203
- let y = this.children[h], m = p + y.size;
7204
- if (o > p && i < m)
7205
- return y.setSelection(e - p - y.border, t - p - y.border, r, s);
7206
- p = m;
7202
+ for (let p = 0, h = 0; p < this.children.length; p++) {
7203
+ let y = this.children[p], m = h + y.size;
7204
+ if (o > h && i < m)
7205
+ return y.setSelection(e - h - y.border, t - h - y.border, r, s);
7206
+ h = m;
7207
7207
  }
7208
7208
  let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), f = !1;
7209
7209
  if ((je || me) && e == t) {
7210
- let { node: h, offset: p } = l;
7211
- if (h.nodeType == 3) {
7212
- if (f = !!(p && h.nodeValue[p - 1] == `
7213
- `), f && p == h.nodeValue.length)
7214
- for (let y = h, m; y; y = y.parentNode) {
7210
+ let { node: p, offset: h } = l;
7211
+ if (p.nodeType == 3) {
7212
+ if (f = !!(h && p.nodeValue[h - 1] == `
7213
+ `), f && h == p.nodeValue.length)
7214
+ for (let y = p, m; y; y = y.parentNode) {
7215
7215
  if (m = y.nextSibling) {
7216
7216
  m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: re(m) + 1 });
7217
7217
  break;
@@ -7221,13 +7221,13 @@ let hr = class {
7221
7221
  break;
7222
7222
  }
7223
7223
  } else {
7224
- let y = h.childNodes[p - 1];
7224
+ let y = p.childNodes[h - 1];
7225
7225
  f = y && (y.nodeName == "BR" || y.contentEditable == "false");
7226
7226
  }
7227
7227
  }
7228
7228
  if (je && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
7229
- let h = u.focusNode.childNodes[u.focusOffset];
7230
- h && h.contentEditable == "false" && (s = !0);
7229
+ let p = u.focusNode.childNodes[u.focusOffset];
7230
+ p && p.contentEditable == "false" && (s = !0);
7231
7231
  }
7232
7232
  if (!(s || f && me) && Zt(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zt(a.node, a.offset, u.focusNode, u.focusOffset))
7233
7233
  return;
@@ -7241,11 +7241,11 @@ let hr = class {
7241
7241
  }
7242
7242
  if (!d) {
7243
7243
  if (e > t) {
7244
- let p = l;
7245
- l = a, a = p;
7244
+ let h = l;
7245
+ l = a, a = h;
7246
7246
  }
7247
- let h = document.createRange();
7248
- h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
7247
+ let p = document.createRange();
7248
+ p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
7249
7249
  }
7250
7250
  }
7251
7251
  ignoreMutation(e) {
@@ -7446,8 +7446,8 @@ let hr = class {
7446
7446
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !f && a.syncToMarks(u == this.node.childCount ? W.none : this.node.child(u).marks, r, e), a.placeWidget(c, e, s);
7447
7447
  }, (c, u, f, d) => {
7448
7448
  a.syncToMarks(c.marks, r, e);
7449
- let h;
7450
- a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (h = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, f, h, e) || a.updateNextNode(c, u, f, e, d, s) || a.addNode(c, u, f, e, s), s += c.nodeSize;
7449
+ let p;
7450
+ a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (p = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, f, p, e) || a.updateNextNode(c, u, f, e, d, s) || a.addNode(c, u, f, e, s), s += c.nodeSize;
7451
7451
  }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Wt) && (i && this.protectLocalComposition(e, i), Wc(this.contentDOM, this.children, e), Dn && ep(this.dom));
7452
7452
  }
7453
7453
  localCompositionInfo(e, t) {
@@ -7892,29 +7892,29 @@ function Zh(n, e, t, r) {
7892
7892
  t(f[m], c, !!a);
7893
7893
  } else
7894
7894
  t(u, c, !!a);
7895
- let d, h;
7895
+ let d, p;
7896
7896
  if (a)
7897
- h = -1, d = a, a = null;
7897
+ p = -1, d = a, a = null;
7898
7898
  else if (c < n.childCount)
7899
- h = c, d = n.child(c++);
7899
+ p = c, d = n.child(c++);
7900
7900
  else
7901
7901
  break;
7902
7902
  for (let m = 0; m < l.length; m++)
7903
7903
  l[m].to <= o && l.splice(m--, 1);
7904
7904
  for (; i < s.length && s[i].from <= o && s[i].to > o; )
7905
7905
  l.push(s[i++]);
7906
- let p = o + d.nodeSize;
7906
+ let h = o + d.nodeSize;
7907
7907
  if (d.isText) {
7908
- let m = p;
7908
+ let m = h;
7909
7909
  i < s.length && s[i].from < m && (m = s[i].from);
7910
7910
  for (let x = 0; x < l.length; x++)
7911
7911
  l[x].to < m && (m = l[x].to);
7912
- m < p && (a = d.cut(m - o), d = d.cut(0, m - o), p = m, h = -1);
7912
+ m < h && (a = d.cut(m - o), d = d.cut(0, m - o), h = m, p = -1);
7913
7913
  } else
7914
- for (; i < s.length && s[i].to < p; )
7914
+ for (; i < s.length && s[i].to < h; )
7915
7915
  i++;
7916
7916
  let y = d.isInline && !d.isLeaf ? l.filter((m) => !m.inline) : l.slice();
7917
- r(d, y, e.forChild(o, d), h), o = p;
7917
+ r(d, y, e.forChild(o, d), p), o = h;
7918
7918
  }
7919
7919
  }
7920
7920
  function ep(n) {
@@ -7974,9 +7974,9 @@ function Go(n, e = null) {
7974
7974
  } else {
7975
7975
  if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
7976
7976
  let f = i, d = i;
7977
- for (let h = 0; h < t.rangeCount; h++) {
7978
- let p = t.getRangeAt(h);
7979
- f = Math.min(f, n.docView.posFromDOM(p.startContainer, p.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(p.endContainer, p.endOffset, -1));
7977
+ for (let p = 0; p < t.rangeCount; p++) {
7978
+ let h = t.getRangeAt(p);
7979
+ f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
7980
7980
  }
7981
7981
  if (f < 0)
7982
7982
  return null;
@@ -8333,29 +8333,29 @@ function fp(n, e) {
8333
8333
  return !1;
8334
8334
  }
8335
8335
  function Yc(n, e) {
8336
- n.someProp("transformCopied", (h) => {
8337
- e = h(e, n);
8336
+ n.someProp("transformCopied", (p) => {
8337
+ e = p(e, n);
8338
8338
  });
8339
8339
  let t = [], { content: r, openStart: s, openEnd: o } = e;
8340
8340
  for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
8341
8341
  s--, o--;
8342
- let h = r.firstChild;
8343
- t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
8342
+ let p = r.firstChild;
8343
+ t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
8344
8344
  }
8345
8345
  let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = tu(), a = l.createElement("div");
8346
8346
  a.appendChild(i.serializeFragment(r, { document: l }));
8347
8347
  let c = a.firstChild, u, f = 0;
8348
8348
  for (; c && c.nodeType == 1 && (u = eu[c.nodeName.toLowerCase()]); ) {
8349
- for (let h = u.length - 1; h >= 0; h--) {
8350
- let p = l.createElement(u[h]);
8349
+ for (let p = u.length - 1; p >= 0; p--) {
8350
+ let h = l.createElement(u[p]);
8351
8351
  for (; a.firstChild; )
8352
- p.appendChild(a.firstChild);
8353
- a.appendChild(p), f++;
8352
+ h.appendChild(a.firstChild);
8353
+ a.appendChild(h), f++;
8354
8354
  }
8355
8355
  c = a.firstChild;
8356
8356
  }
8357
8357
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
8358
- let d = n.someProp("clipboardTextSerializer", (h) => h(e, n)) || e.content.textBetween(0, e.content.size, `
8358
+ let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
8359
8359
 
8360
8360
  `);
8361
8361
  return { dom: a, text: d, slice: e };
@@ -8375,10 +8375,10 @@ function Gc(n, e, t, r, s) {
8375
8375
  if (f)
8376
8376
  l = f;
8377
8377
  else {
8378
- let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
8378
+ let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
8379
8379
  i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
8380
8380
  let m = i.appendChild(document.createElement("p"));
8381
- y && m.appendChild(p.serializeNode(h.text(y, d)));
8381
+ y && m.appendChild(h.serializeNode(p.text(y, d)));
8382
8382
  });
8383
8383
  }
8384
8384
  } else
@@ -8405,9 +8405,9 @@ function Gc(n, e, t, r, s) {
8405
8405
  l = yp(Ol(l, +u[1], +u[2]), u[4]);
8406
8406
  else if (l = M.maxOpen(hp(l.content, s), !0), l.openStart || l.openEnd) {
8407
8407
  let f = 0, d = 0;
8408
- for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
8408
+ for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
8409
8409
  ;
8410
- for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
8410
+ for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
8411
8411
  ;
8412
8412
  l = Ol(l, f, d);
8413
8413
  }
@@ -8892,11 +8892,11 @@ ye.drop = (n, e) => {
8892
8892
  if (!s)
8893
8893
  return;
8894
8894
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
8895
- i ? n.someProp("transformPasted", (p) => {
8896
- i = p(i, n);
8895
+ i ? n.someProp("transformPasted", (h) => {
8896
+ i = h(i, n);
8897
8897
  }) : i = Gc(n, iu(t.dataTransfer), Qn ? null : t.dataTransfer.getData("text/html"), !1, o);
8898
8898
  let l = !!(r && !t[au]);
8899
- if (n.someProp("handleDrop", (p) => p(n, t, i || M.empty, l))) {
8899
+ if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
8900
8900
  t.preventDefault();
8901
8901
  return;
8902
8902
  }
@@ -8907,18 +8907,18 @@ ye.drop = (n, e) => {
8907
8907
  a == null && (a = o.pos);
8908
8908
  let c = n.state.tr;
8909
8909
  if (l) {
8910
- let { node: p } = r;
8911
- p ? p.replace(c) : c.deleteSelection();
8910
+ let { node: h } = r;
8911
+ h ? h.replace(c) : c.deleteSelection();
8912
8912
  }
8913
8913
  let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
8914
8914
  if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
8915
8915
  return;
8916
- let h = c.doc.resolve(u);
8917
- if (f && D.isSelectable(i.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(i.content.firstChild))
8918
- c.setSelection(new D(h));
8916
+ let p = c.doc.resolve(u);
8917
+ if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
8918
+ c.setSelection(new D(p));
8919
8919
  else {
8920
- let p = c.mapping.map(a);
8921
- c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => p = C), c.setSelection(Xo(n, h, c.doc.resolve(p)));
8920
+ let h = c.mapping.map(a);
8921
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(Xo(n, p, c.doc.resolve(h)));
8922
8922
  }
8923
8923
  n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
8924
8924
  };
@@ -9320,14 +9320,14 @@ function Fp(n, e, t, r, s, o, i) {
9320
9320
  let l = n.slice();
9321
9321
  for (let c = 0, u = o; c < t.maps.length; c++) {
9322
9322
  let f = 0;
9323
- t.maps[c].forEach((d, h, p, y) => {
9324
- let m = y - p - (h - d);
9323
+ t.maps[c].forEach((d, p, h, y) => {
9324
+ let m = y - h - (p - d);
9325
9325
  for (let x = 0; x < l.length; x += 3) {
9326
9326
  let C = l[x + 1];
9327
9327
  if (C < 0 || d > C + u - f)
9328
9328
  continue;
9329
9329
  let w = l[x] + u - f;
9330
- h >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
9330
+ p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
9331
9331
  }
9332
9332
  f += m;
9333
9333
  }), u = t.maps[c].map(u, -1);
@@ -9344,10 +9344,10 @@ function Fp(n, e, t, r, s, o, i) {
9344
9344
  a = !0;
9345
9345
  continue;
9346
9346
  }
9347
- let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
9348
- if (m && y == f && y + m.nodeSize == h) {
9347
+ let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
9348
+ if (m && y == f && y + m.nodeSize == p) {
9349
9349
  let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
9350
- x != ae ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
9350
+ x != ae ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
9351
9351
  } else
9352
9352
  a = !0;
9353
9353
  }
@@ -9357,8 +9357,8 @@ function Fp(n, e, t, r, s, o, i) {
9357
9357
  for (let f = 0; f < l.length; f += 3)
9358
9358
  l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
9359
9359
  for (let f = 0, d = 0; f < u.children.length; f += 3) {
9360
- let h = u.children[f];
9361
- for (; d < l.length && l[d] < h; )
9360
+ let p = u.children[f];
9361
+ for (; d < l.length && l[d] < p; )
9362
9362
  d += 3;
9363
9363
  l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
9364
9364
  }
@@ -9573,8 +9573,8 @@ class qp {
9573
9573
  } else {
9574
9574
  let { focusNode: f } = this.currentSelection;
9575
9575
  for (let d of u) {
9576
- let h = d.parentNode;
9577
- h && h.nodeName == "LI" && (!f || Jp(e, f) != h) && d.remove();
9576
+ let p = d.parentNode;
9577
+ p && p.nodeName == "LI" && (!f || Jp(e, f) != p) && d.remove();
9578
9578
  }
9579
9579
  }
9580
9580
  }
@@ -9658,22 +9658,22 @@ function Up(n, e, t) {
9658
9658
  if (!C || C.size)
9659
9659
  break;
9660
9660
  }
9661
- let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema), h = f.resolve(i), p = null, y = d.parse(r, {
9662
- topNode: h.parent,
9663
- topMatch: h.parent.contentMatchAt(h.index()),
9661
+ let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema), p = f.resolve(i), h = null, y = d.parse(r, {
9662
+ topNode: p.parent,
9663
+ topMatch: p.parent.contentMatchAt(p.index()),
9664
9664
  topOpen: !0,
9665
9665
  from: s,
9666
9666
  to: o,
9667
- preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
9667
+ preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
9668
9668
  findPositions: c,
9669
9669
  ruleFromNode: Yp,
9670
- context: h
9670
+ context: p
9671
9671
  });
9672
9672
  if (c && c[0].pos != null) {
9673
9673
  let m = c[0].pos, x = c[1] && c[1].pos;
9674
- x == null && (x = m), p = { anchor: m + i, head: x + i };
9674
+ x == null && (x = m), h = { anchor: m + i, head: x + i };
9675
9675
  }
9676
- return { doc: y, sel: p, from: i, to: l };
9676
+ return { doc: y, sel: h, from: i, to: l };
9677
9677
  }
9678
9678
  function Yp(n) {
9679
9679
  let e = n.pmViewDesc;
@@ -9704,16 +9704,16 @@ function Xp(n, e, t, r, s) {
9704
9704
  }
9705
9705
  let i = n.state.doc.resolve(e), l = i.sharedDepth(t);
9706
9706
  e = i.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
9707
- let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, h;
9708
- n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, h = "end") : (d = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
9709
- let p = em(f.content, c.doc.content, c.from, d, h);
9710
- if (p && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || at) && s.some((E) => E.nodeType == 1 && !Gp.test(E.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9707
+ let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, p;
9708
+ n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, p = "end") : (d = n.state.selection.from, p = "start"), n.input.lastKeyCode = null;
9709
+ let h = em(f.content, c.doc.content, c.from, d, p);
9710
+ if (h && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || at) && s.some((E) => E.nodeType == 1 && !Gp.test(E.nodeName)) && (!h || h.endA >= h.endB) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9711
9711
  n.input.lastIOSEnter = 0;
9712
9712
  return;
9713
9713
  }
9714
- if (!p)
9714
+ if (!h)
9715
9715
  if (r && a instanceof V && !a.empty && a.$head.sameParent(a.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
9716
- p = { start: a.from, endA: a.to, endB: a.to };
9716
+ h = { start: a.from, endA: a.to, endB: a.to };
9717
9717
  else {
9718
9718
  if (c.sel) {
9719
9719
  let E = vl(n, n.state.doc, c.sel);
@@ -9724,28 +9724,28 @@ function Xp(n, e, t, r, s) {
9724
9724
  }
9725
9725
  return;
9726
9726
  }
9727
- n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof V && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ke && Ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
9728
- let y = c.doc.resolveNoCache(p.start - c.from), m = c.doc.resolveNoCache(p.endB - c.from), x = u.resolve(p.start), C = y.sameParent(m) && y.parent.inlineContent && x.end() >= p.endA, w;
9727
+ n.state.selection.from < n.state.selection.to && h.start == h.endB && n.state.selection instanceof V && (h.start > n.state.selection.from && h.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? h.start = n.state.selection.from : h.endA < n.state.selection.to && h.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (h.endB += n.state.selection.to - h.endA, h.endA = n.state.selection.to)), ke && Ot <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == "  " && (h.start--, h.endA--, h.endB--);
9728
+ let y = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), x = u.resolve(h.start), C = y.sameParent(m) && y.parent.inlineContent && x.end() >= h.endA, w;
9729
9729
  if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!C || s.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !C && y.pos < c.doc.content.size && !y.sameParent(m) && (w = z.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head == m.pos) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
9730
9730
  n.input.lastIOSEnter = 0;
9731
9731
  return;
9732
9732
  }
9733
- if (n.state.selection.anchor > p.start && Zp(u, p.start, p.endA, y, m) && n.someProp("handleKeyDown", (E) => E(n, Lt(8, "Backspace")))) {
9733
+ if (n.state.selection.anchor > h.start && Zp(u, h.start, h.endA, y, m) && n.someProp("handleKeyDown", (E) => E(n, Lt(8, "Backspace")))) {
9734
9734
  at && ue && n.domObserver.suppressSelectionUpdates();
9735
9735
  return;
9736
9736
  }
9737
- ue && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), at && !C && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, m = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
9737
+ ue && h.endB == h.start && (n.input.lastChromeDelete = Date.now()), at && !C && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
9738
9738
  n.someProp("handleKeyDown", function(E) {
9739
9739
  return E(n, Lt(13, "Enter"));
9740
9740
  });
9741
9741
  }, 20));
9742
- let O = p.start, v = p.endA, S, $, j;
9742
+ let O = h.start, v = h.endA, S, $, j;
9743
9743
  if (C) {
9744
9744
  if (y.pos == m.pos)
9745
- ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), S = n.state.tr.delete(O, v), $ = u.resolve(p.start).marksAcross(u.resolve(p.endA));
9745
+ ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), S = n.state.tr.delete(O, v), $ = u.resolve(h.start).marksAcross(u.resolve(h.endA));
9746
9746
  else if (
9747
9747
  // Adding or removing a mark
9748
- p.endA == p.endB && (j = Qp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, p.endA - x.start())))
9748
+ h.endA == h.endB && (j = Qp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, h.endA - x.start())))
9749
9749
  )
9750
9750
  S = n.state.tr, j.type == "add" ? S.addMark(O, v, j.mark) : S.removeMark(O, v, j.mark);
9751
9751
  else if (y.parent.child(y.index()).isText && y.index() == m.index() - (m.textOffset ? 0 : 1)) {
@@ -9755,9 +9755,9 @@ function Xp(n, e, t, r, s) {
9755
9755
  S = n.state.tr.insertText(E, O, v);
9756
9756
  }
9757
9757
  }
9758
- if (S || (S = n.state.tr.replace(O, v, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
9758
+ if (S || (S = n.state.tr.replace(O, v, c.doc.slice(h.start - c.from, h.endB - c.from))), c.sel) {
9759
9759
  let E = vl(n, S.doc, c.sel);
9760
- E && !(ue && n.composing && E.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == O || E.head == S.mapping.map(v) - 1) || ke && E.empty && E.head == O) && S.setSelection(E);
9760
+ E && !(ue && n.composing && E.empty && (h.start != h.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == O || E.head == S.mapping.map(v) - 1) || ke && E.empty && E.head == O) && S.setSelection(E);
9761
9761
  }
9762
9762
  $ && S.ensureMarks($), o && S.setMeta("composition", o), n.dispatch(S.scrollIntoView());
9763
9763
  }
@@ -9902,8 +9902,8 @@ class tm {
9902
9902
  e.storedMarks && this.composing && (ou(this), i = !0), this.state = e;
9903
9903
  let l = s.plugins != e.plugins || this._props.plugins != t.plugins;
9904
9904
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9905
- let h = Fl(this);
9906
- rm(h, this.nodeViews) && (this.nodeViews = h, o = !0);
9905
+ let p = Fl(this);
9906
+ rm(p, this.nodeViews) && (this.nodeViews = p, o = !0);
9907
9907
  }
9908
9908
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Co(this), this.editable = jl(this), zl(this);
9909
9909
  let a = _s(this), c = $l(this), u = s.plugins != e.plugins && !s.doc.eq(e.doc) ? "reset" : e.scrollToSelection > s.scrollToSelection ? "to selection" : "preserve", f = o || !this.docView.matchesNode(e.doc, c, a);
@@ -9911,12 +9911,12 @@ class tm {
9911
9911
  let d = u == "preserve" && i && this.dom.style.overflowAnchor == null && vh(this);
9912
9912
  if (i) {
9913
9913
  this.domObserver.stop();
9914
- let h = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && nm(s.selection, e.selection);
9914
+ let p = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && nm(s.selection, e.selection);
9915
9915
  if (f) {
9916
- let p = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
9917
- this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9916
+ let h = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
9917
+ this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)), h && !this.trackWrites && (p = !0);
9918
9918
  }
9919
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && sp(this)) ? ut(this, h) : (Kc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9919
+ p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && sp(this)) ? ut(this, p) : (Kc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9920
9920
  }
9921
9921
  this.updatePluginViews(s), !((r = this.dragging) === null || r === void 0) && r.node && !s.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, s), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : d && Vh(d);
9922
9922
  }
@@ -10487,10 +10487,10 @@ function km(n, e) {
10487
10487
  let f = k.empty, d = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
10488
10488
  for (let x = s.depth - d; x >= s.depth - 3; x--)
10489
10489
  f = k.from(s.node(x).copy(f));
10490
- let h = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
10490
+ let p = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
10491
10491
  f = f.append(k.from(n.createAndFill()));
10492
- let p = s.before(s.depth - (d - 1)), y = t.tr.replace(p, s.after(-h), new M(f, 4 - d, 0)), m = -1;
10493
- y.doc.nodesBetween(p, y.doc.content.size, (x, C) => {
10492
+ let h = s.before(s.depth - (d - 1)), y = t.tr.replace(h, s.after(-p), new M(f, 4 - d, 0)), m = -1;
10493
+ y.doc.nodesBetween(h, y.doc.content.size, (x, C) => {
10494
10494
  if (m > -1)
10495
10495
  return !1;
10496
10496
  x.isTextblock && x.content.size == 0 && (m = C + 1);
@@ -10520,8 +10520,8 @@ function Cm(n, e, t, r) {
10520
10520
  }
10521
10521
  function wm(n, e, t) {
10522
10522
  let r = n.tr, s = t.parent;
10523
- for (let h = t.end, p = t.endIndex - 1, y = t.startIndex; p > y; p--)
10524
- h -= s.child(p).nodeSize, r.delete(h - 1, h + 1);
10523
+ for (let p = t.end, h = t.endIndex - 1, y = t.startIndex; h > y; h--)
10524
+ p -= s.child(h).nodeSize, r.delete(p - 1, p + 1);
10525
10525
  let o = r.doc.resolve(t.start), i = o.nodeAfter;
10526
10526
  if (r.mapping.map(t.end) != t.start + o.nodeAfter.nodeSize)
10527
10527
  return !1;
@@ -10543,8 +10543,8 @@ function Mm(n) {
10543
10543
  if (a.type != n)
10544
10544
  return !1;
10545
10545
  if (t) {
10546
- let c = a.lastChild && a.lastChild.type == l.type, u = k.from(c ? n.create() : null), f = new M(k.from(n.create(null, k.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, h = o.end;
10547
- t(e.tr.step(new oe(d - (c ? 3 : 1), h, d, h, f, 1, !0)).scrollIntoView());
10546
+ let c = a.lastChild && a.lastChild.type == l.type, u = k.from(c ? n.create() : null), f = new M(k.from(n.create(null, k.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, p = o.end;
10547
+ t(e.tr.step(new oe(d - (c ? 3 : 1), p, d, p, f, 1, !0)).scrollIntoView());
10548
10548
  }
10549
10549
  return !0;
10550
10550
  };
@@ -10617,7 +10617,7 @@ function Ll(n, e, t, r, s, o) {
10617
10617
  let i = n.state, l = i.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Dm), l.parentOffset, null, "") + r;
10618
10618
  for (let c = 0; c < s.length; c++) {
10619
10619
  let u = s[c];
10620
- if (!u.inCodeMark && l.marks().some((h) => h.type.spec.code))
10620
+ if (!u.inCodeMark && l.marks().some((p) => p.type.spec.code))
10621
10621
  continue;
10622
10622
  if (l.parent.type.spec.code) {
10623
10623
  if (!u.inCode)
@@ -10657,8 +10657,8 @@ function ri(n, e, t = null, r) {
10657
10657
  if (!d)
10658
10658
  return null;
10659
10659
  c.wrap(f, d);
10660
- let h = c.doc.resolve(i - 1).nodeBefore;
10661
- return h && h.type == e && En(c.doc, i - 1) && (!r || r(o, h)) && c.join(i - 1), c;
10660
+ let p = c.doc.resolve(i - 1).nodeBefore;
10661
+ return p && p.type == e && En(c.doc, i - 1) && (!r || r(o, p)) && c.join(i - 1), c;
10662
10662
  });
10663
10663
  }
10664
10664
  function mu(n, e, t = null) {
@@ -10830,9 +10830,9 @@ function Xm(n, e = null) {
10830
10830
  } else {
10831
10831
  if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
10832
10832
  let f = i, d = i;
10833
- for (let h = 0; h < t.rangeCount; h++) {
10834
- let p = t.getRangeAt(h);
10835
- f = Math.min(f, n.docView.posFromDOM(p.startContainer, p.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(p.endContainer, p.endOffset, -1));
10833
+ for (let p = 0; p < t.rangeCount; p++) {
10834
+ let h = t.getRangeAt(p);
10835
+ f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
10836
10836
  }
10837
10837
  if (f < 0)
10838
10838
  return null;
@@ -11182,29 +11182,29 @@ function ag(n, e) {
11182
11182
  return !1;
11183
11183
  }
11184
11184
  function Nu(n, e) {
11185
- n.someProp("transformCopied", (h) => {
11186
- e = h(e, n);
11185
+ n.someProp("transformCopied", (p) => {
11186
+ e = p(e, n);
11187
11187
  });
11188
11188
  let t = [], { content: r, openStart: s, openEnd: o } = e;
11189
11189
  for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
11190
11190
  s--, o--;
11191
- let h = r.firstChild;
11192
- t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
11191
+ let p = r.firstChild;
11192
+ t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
11193
11193
  }
11194
11194
  let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = Ru(), a = l.createElement("div");
11195
11195
  a.appendChild(i.serializeFragment(r, { document: l }));
11196
11196
  let c = a.firstChild, u, f = 0;
11197
11197
  for (; c && c.nodeType == 1 && (u = Au[c.nodeName.toLowerCase()]); ) {
11198
- for (let h = u.length - 1; h >= 0; h--) {
11199
- let p = l.createElement(u[h]);
11198
+ for (let p = u.length - 1; p >= 0; p--) {
11199
+ let h = l.createElement(u[p]);
11200
11200
  for (; a.firstChild; )
11201
- p.appendChild(a.firstChild);
11202
- a.appendChild(p), f++;
11201
+ h.appendChild(a.firstChild);
11202
+ a.appendChild(h), f++;
11203
11203
  }
11204
11204
  c = a.firstChild;
11205
11205
  }
11206
11206
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
11207
- let d = n.someProp("clipboardTextSerializer", (h) => h(e, n)) || e.content.textBetween(0, e.content.size, `
11207
+ let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
11208
11208
 
11209
11209
  `);
11210
11210
  return { dom: a, text: d, slice: e };
@@ -11224,10 +11224,10 @@ function Du(n, e, t, r, s) {
11224
11224
  if (f)
11225
11225
  l = f;
11226
11226
  else {
11227
- let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
11227
+ let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
11228
11228
  i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
11229
11229
  let m = i.appendChild(document.createElement("p"));
11230
- y && m.appendChild(p.serializeNode(h.text(y, d)));
11230
+ y && m.appendChild(h.serializeNode(p.text(y, d)));
11231
11231
  });
11232
11232
  }
11233
11233
  } else
@@ -11254,9 +11254,9 @@ function Du(n, e, t, r, s) {
11254
11254
  l = pg(ea(l, +u[1], +u[2]), u[4]);
11255
11255
  else if (l = M.maxOpen(ug(l.content, s), !0), l.openStart || l.openEnd) {
11256
11256
  let f = 0, d = 0;
11257
- for (let h = l.content.firstChild; f < l.openStart && !h.type.spec.isolating; f++, h = h.firstChild)
11257
+ for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
11258
11258
  ;
11259
- for (let h = l.content.lastChild; d < l.openEnd && !h.type.spec.isolating; d++, h = h.lastChild)
11259
+ for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
11260
11260
  ;
11261
11261
  l = ea(l, f, d);
11262
11262
  }
@@ -11681,11 +11681,11 @@ De.drop = (n, e) => {
11681
11681
  if (!s)
11682
11682
  return;
11683
11683
  let o = n.state.doc.resolve(s.pos), i = r && r.slice;
11684
- i ? n.someProp("transformPasted", (p) => {
11685
- i = p(i, n);
11684
+ i ? n.someProp("transformPasted", (h) => {
11685
+ i = h(i, n);
11686
11686
  }) : i = Du(n, Vu(t.dataTransfer), tr ? null : t.dataTransfer.getData("text/html"), !1, o);
11687
11687
  let l = !!(r && $u(n, t));
11688
- if (n.someProp("handleDrop", (p) => p(n, t, i || M.empty, l))) {
11688
+ if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
11689
11689
  t.preventDefault();
11690
11690
  return;
11691
11691
  }
@@ -11696,18 +11696,18 @@ De.drop = (n, e) => {
11696
11696
  a == null && (a = o.pos);
11697
11697
  let c = n.state.tr;
11698
11698
  if (l) {
11699
- let { node: p } = r;
11700
- p ? p.replace(c) : c.deleteSelection();
11699
+ let { node: h } = r;
11700
+ h ? h.replace(c) : c.deleteSelection();
11701
11701
  }
11702
11702
  let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
11703
11703
  if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
11704
11704
  return;
11705
- let h = c.doc.resolve(u);
11706
- if (f && D.isSelectable(i.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(i.content.firstChild))
11707
- c.setSelection(new D(h));
11705
+ let p = c.doc.resolve(u);
11706
+ if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
11707
+ c.setSelection(new D(p));
11708
11708
  else {
11709
- let p = c.mapping.map(a);
11710
- c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => p = C), c.setSelection(wu(n, h, c.doc.resolve(p)));
11709
+ let h = c.mapping.map(a);
11710
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(wu(n, p, c.doc.resolve(h)));
11711
11711
  }
11712
11712
  n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
11713
11713
  };
@@ -12112,14 +12112,14 @@ function Ig(n, e, t, r, s, o, i) {
12112
12112
  let l = n.slice();
12113
12113
  for (let c = 0, u = o; c < t.maps.length; c++) {
12114
12114
  let f = 0;
12115
- t.maps[c].forEach((d, h, p, y) => {
12116
- let m = y - p - (h - d);
12115
+ t.maps[c].forEach((d, p, h, y) => {
12116
+ let m = y - h - (p - d);
12117
12117
  for (let x = 0; x < l.length; x += 3) {
12118
12118
  let C = l[x + 1];
12119
12119
  if (C < 0 || d > C + u - f)
12120
12120
  continue;
12121
12121
  let w = l[x] + u - f;
12122
- h >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
12122
+ p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
12123
12123
  }
12124
12124
  f += m;
12125
12125
  }), u = t.maps[c].map(u, -1);
@@ -12136,10 +12136,10 @@ function Ig(n, e, t, r, s, o, i) {
12136
12136
  a = !0;
12137
12137
  continue;
12138
12138
  }
12139
- let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
12140
- if (m && y == f && y + m.nodeSize == h) {
12139
+ let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
12140
+ if (m && y == f && y + m.nodeSize == p) {
12141
12141
  let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
12142
- x != pe ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
12142
+ x != pe ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
12143
12143
  } else
12144
12144
  a = !0;
12145
12145
  }
@@ -12149,8 +12149,8 @@ function Ig(n, e, t, r, s, o, i) {
12149
12149
  for (let f = 0; f < l.length; f += 3)
12150
12150
  l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
12151
12151
  for (let f = 0, d = 0; f < u.children.length; f += 3) {
12152
- let h = u.children[f];
12153
- for (; d < l.length && l[d] < h; )
12152
+ let p = u.children[f];
12153
+ for (; d < l.length && l[d] < p; )
12154
12154
  d += 3;
12155
12155
  l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
12156
12156
  }
@@ -12339,10 +12339,10 @@ function vg(n) {
12339
12339
  for (let c = 0, u = 0; c < t; c++) {
12340
12340
  const f = n.child(c);
12341
12341
  u++;
12342
- for (let p = 0; ; p++) {
12342
+ for (let h = 0; ; h++) {
12343
12343
  for (; s < r.length && r[s] != 0; ) s++;
12344
- if (p == f.childCount) break;
12345
- const y = f.child(p), { colspan: m, rowspan: x, colwidth: C } = y.attrs;
12344
+ if (h == f.childCount) break;
12345
+ const y = f.child(h), { colspan: m, rowspan: x, colwidth: C } = y.attrs;
12346
12346
  for (let w = 0; w < x; w++) {
12347
12347
  if (w + c >= t) {
12348
12348
  (o || (o = [])).push({
@@ -12370,9 +12370,9 @@ function vg(n) {
12370
12370
  s += m, u += y.nodeSize;
12371
12371
  }
12372
12372
  const d = (c + 1) * e;
12373
- let h = 0;
12374
- for (; s < d; ) r[s++] == 0 && h++;
12375
- h && (o || (o = [])).push({ type: "missing", row: c, n: h }), u++;
12373
+ let p = 0;
12374
+ for (; s < d; ) r[s++] == 0 && p++;
12375
+ p && (o || (o = [])).push({ type: "missing", row: c, n: p }), u++;
12376
12376
  }
12377
12377
  (e === 0 || t === 0) && (o || (o = [])).push({ type: "zero_sized" });
12378
12378
  const l = new Z(e, t, r, o);
@@ -12648,33 +12648,33 @@ var H = class st extends z {
12648
12648
  const d = t.map[u];
12649
12649
  if (o[d]) continue;
12650
12650
  o[d] = !0;
12651
- const h = t.findCell(d);
12652
- let p = e.nodeAt(d);
12653
- if (!p)
12651
+ const p = t.findCell(d);
12652
+ let h = e.nodeAt(d);
12653
+ if (!h)
12654
12654
  throw RangeError(`No cell with offset ${d} found`);
12655
- const y = s.left - h.left, m = h.right - s.right;
12655
+ const y = s.left - p.left, m = p.right - s.right;
12656
12656
  if (y > 0 || m > 0) {
12657
- let x = p.attrs;
12657
+ let x = h.attrs;
12658
12658
  if (y > 0 && (x = en(x, 0, y)), m > 0 && (x = en(
12659
12659
  x,
12660
12660
  x.colspan - m,
12661
12661
  m
12662
- )), h.left < s.left) {
12663
- if (p = p.type.createAndFill(x), !p)
12662
+ )), p.left < s.left) {
12663
+ if (h = h.type.createAndFill(x), !h)
12664
12664
  throw RangeError(
12665
12665
  `Could not create cell with attrs ${JSON.stringify(x)}`
12666
12666
  );
12667
12667
  } else
12668
- p = p.type.create(x, p.content);
12668
+ h = h.type.create(x, h.content);
12669
12669
  }
12670
- if (h.top < s.top || h.bottom > s.bottom) {
12670
+ if (p.top < s.top || p.bottom > s.bottom) {
12671
12671
  const x = {
12672
- ...p.attrs,
12673
- rowspan: Math.min(h.bottom, s.bottom) - Math.max(h.top, s.top)
12672
+ ...h.attrs,
12673
+ rowspan: Math.min(p.bottom, s.bottom) - Math.max(p.top, s.top)
12674
12674
  };
12675
- h.top < s.top ? p = p.type.createAndFill(x) : p = p.type.create(x, p.content);
12675
+ p.top < s.top ? h = h.type.createAndFill(x) : h = h.type.create(x, h.content);
12676
12676
  }
12677
- c.push(p);
12677
+ c.push(h);
12678
12678
  }
12679
12679
  i.push(e.child(a).copy(k.from(c)));
12680
12680
  }
@@ -12899,15 +12899,15 @@ function Gg(n, e, t, r) {
12899
12899
  for (let a = 0, c = t + 1; a < s.height; a++) {
12900
12900
  const u = e.child(a), f = c + u.nodeSize, d = o[a];
12901
12901
  if (d > 0) {
12902
- let h = "cell";
12903
- u.firstChild && (h = u.firstChild.type.spec.tableRole);
12904
- const p = [];
12902
+ let p = "cell";
12903
+ u.firstChild && (p = u.firstChild.type.spec.tableRole);
12904
+ const h = [];
12905
12905
  for (let m = 0; m < d; m++) {
12906
- const x = be(n.schema)[h].createAndFill();
12907
- x && p.push(x);
12906
+ const x = be(n.schema)[p].createAndFill();
12907
+ x && h.push(x);
12908
12908
  }
12909
12909
  const y = (a == 0 || i == a - 1) && l == a ? c + 1 : f - 1;
12910
- r.insert(r.mapping.map(y), p);
12910
+ r.insert(r.mapping.map(y), h);
12911
12911
  }
12912
12912
  c = f;
12913
12913
  }
@@ -13047,11 +13047,11 @@ function sy(n, { map: e, table: t, tableStart: r }, s) {
13047
13047
  rowspan: d.rowspan - 1
13048
13048
  }), c += d.colspan - 1;
13049
13049
  } else if (s < e.height && f == e.map[u + e.width]) {
13050
- const d = t.nodeAt(f), h = d.attrs, p = d.type.create(
13051
- { ...h, rowspan: d.attrs.rowspan - 1 },
13050
+ const d = t.nodeAt(f), p = d.attrs, h = d.type.create(
13051
+ { ...p, rowspan: d.attrs.rowspan - 1 },
13052
13052
  d.content
13053
13053
  ), y = e.positionAt(s + 1, c, t);
13054
- n.insert(n.mapping.slice(l).map(r + y), p), c += h.colspan - 1;
13054
+ n.insert(n.mapping.slice(l).map(r + y), h), c += p.colspan - 1;
13055
13055
  }
13056
13056
  }
13057
13057
  }
@@ -13100,14 +13100,14 @@ function ly(n, e) {
13100
13100
  let l = k.empty, a, c;
13101
13101
  for (let u = r.top; u < r.bottom; u++)
13102
13102
  for (let f = r.left; f < r.right; f++) {
13103
- const d = s.map[u * s.width + f], h = r.table.nodeAt(d);
13104
- if (!(i[d] || !h))
13103
+ const d = s.map[u * s.width + f], p = r.table.nodeAt(d);
13104
+ if (!(i[d] || !p))
13105
13105
  if (i[d] = !0, a == null)
13106
- a = d, c = h;
13106
+ a = d, c = p;
13107
13107
  else {
13108
- ia(h) || (l = l.append(h.content));
13109
- const p = o.mapping.map(d + r.tableStart);
13110
- o.delete(p, p + h.nodeSize);
13108
+ ia(p) || (l = l.append(p.content));
13109
+ const h = o.mapping.map(d + r.tableStart);
13110
+ o.delete(h, h + p.nodeSize);
13111
13111
  }
13112
13112
  }
13113
13113
  if (a == null || c == null)
@@ -13152,21 +13152,21 @@ function cy(n) {
13152
13152
  const a = [], c = l.colwidth;
13153
13153
  l.rowspan > 1 && (l = { ...l, rowspan: 1 }), l.colspan > 1 && (l = { ...l, colspan: 1 });
13154
13154
  const u = Ze(e), f = e.tr;
13155
- for (let h = 0; h < u.right - u.left; h++)
13155
+ for (let p = 0; p < u.right - u.left; p++)
13156
13156
  a.push(
13157
13157
  c ? {
13158
13158
  ...l,
13159
- colwidth: c && c[h] ? [c[h]] : null
13159
+ colwidth: c && c[p] ? [c[p]] : null
13160
13160
  } : l
13161
13161
  );
13162
13162
  let d;
13163
- for (let h = u.top; h < u.bottom; h++) {
13164
- let p = u.map.positionAt(h, u.left, u.table);
13165
- h == u.top && (p += o.nodeSize);
13163
+ for (let p = u.top; p < u.bottom; p++) {
13164
+ let h = u.map.positionAt(p, u.left, u.table);
13165
+ p == u.top && (h += o.nodeSize);
13166
13166
  for (let y = u.left, m = 0; y < u.right; y++, m++)
13167
- y == u.left && h == u.top || f.insert(
13168
- d = f.mapping.map(p + u.tableStart, 1),
13169
- n({ node: o, row: h, col: y }).createAndFill(a[m])
13167
+ y == u.left && p == u.top || f.insert(
13168
+ d = f.mapping.map(h + u.tableStart, 1),
13169
+ n({ node: o, row: p, col: y }).createAndFill(a[m])
13170
13170
  );
13171
13171
  }
13172
13172
  f.setNodeMarkup(
@@ -13271,9 +13271,9 @@ function pi(n, e) {
13271
13271
  right: o.map.width,
13272
13272
  bottom: 1
13273
13273
  } : o, d = n == "column" ? a ? s.cell : s.header_cell : n == "row" ? l ? s.cell : s.header_cell : s.cell;
13274
- o.map.cellsInRect(f).forEach((h) => {
13275
- const p = h + o.tableStart, y = i.doc.nodeAt(p);
13276
- y && i.setNodeMarkup(p, d, y.attrs);
13274
+ o.map.cellsInRect(f).forEach((p) => {
13275
+ const h = p + o.tableStart, y = i.doc.nodeAt(h);
13276
+ y && i.setNodeMarkup(h, d, y.attrs);
13277
13277
  }), r(i);
13278
13278
  }
13279
13279
  return !0;
@@ -13412,8 +13412,8 @@ function by({ width: n, height: e, rows: t }, r, s) {
13412
13412
  ),
13413
13413
  d.content
13414
13414
  )), c.push(d), u += d.attrs.colspan;
13415
- for (let h = 1; h < d.attrs.rowspan; h++)
13416
- o[l + h] = (o[l + h] || 0) + d.attrs.colspan;
13415
+ for (let p = 1; p < d.attrs.rowspan; p++)
13416
+ o[l + p] = (o[l + p] || 0) + d.attrs.colspan;
13417
13417
  }
13418
13418
  i.push(k.from(c));
13419
13419
  }
@@ -13444,25 +13444,25 @@ function xy(n, e, t, r, s, o, i) {
13444
13444
  let c, u;
13445
13445
  if (s > e.width)
13446
13446
  for (let f = 0, d = 0; f < e.height; f++) {
13447
- const h = t.child(f);
13448
- d += h.nodeSize;
13449
- const p = [];
13447
+ const p = t.child(f);
13448
+ d += p.nodeSize;
13449
+ const h = [];
13450
13450
  let y;
13451
- h.lastChild == null || h.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
13452
- for (let m = e.width; m < s; m++) p.push(y);
13453
- n.insert(n.mapping.slice(i).map(d - 1 + r), p);
13451
+ p.lastChild == null || p.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
13452
+ for (let m = e.width; m < s; m++) h.push(y);
13453
+ n.insert(n.mapping.slice(i).map(d - 1 + r), h);
13454
13454
  }
13455
13455
  if (o > e.height) {
13456
13456
  const f = [];
13457
- for (let p = 0, y = (e.height - 1) * e.width; p < Math.max(e.width, s); p++) {
13458
- const m = p >= e.width ? !1 : t.nodeAt(e.map[y + p]).type == a.header_cell;
13457
+ for (let h = 0, y = (e.height - 1) * e.width; h < Math.max(e.width, s); h++) {
13458
+ const m = h >= e.width ? !1 : t.nodeAt(e.map[y + h]).type == a.header_cell;
13459
13459
  f.push(
13460
13460
  m ? u || (u = a.header_cell.createAndFill()) : c || (c = a.cell.createAndFill())
13461
13461
  );
13462
13462
  }
13463
- const d = a.row.create(null, k.from(f)), h = [];
13464
- for (let p = e.height; p < o; p++) h.push(d);
13465
- n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2), h);
13463
+ const d = a.row.create(null, k.from(f)), p = [];
13464
+ for (let h = e.height; h < o; h++) p.push(d);
13465
+ n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2), p);
13466
13466
  }
13467
13467
  return !!(c || u);
13468
13468
  }
@@ -13473,15 +13473,15 @@ function ca(n, e, t, r, s, o, i, l) {
13473
13473
  const u = i * e.width + c, f = e.map[u];
13474
13474
  if (e.map[u - e.width] == f) {
13475
13475
  a = !0;
13476
- const d = t.nodeAt(f), { top: h, left: p } = e.findCell(f);
13476
+ const d = t.nodeAt(f), { top: p, left: h } = e.findCell(f);
13477
13477
  n.setNodeMarkup(n.mapping.slice(l).map(f + r), null, {
13478
13478
  ...d.attrs,
13479
- rowspan: i - h
13479
+ rowspan: i - p
13480
13480
  }), n.insert(
13481
- n.mapping.slice(l).map(e.positionAt(i, p, t)),
13481
+ n.mapping.slice(l).map(e.positionAt(i, h, t)),
13482
13482
  d.type.createAndFill({
13483
13483
  ...d.attrs,
13484
- rowspan: h + d.attrs.rowspan - i
13484
+ rowspan: p + d.attrs.rowspan - i
13485
13485
  })
13486
13486
  ), c += d.attrs.colspan - 1;
13487
13487
  }
@@ -13495,19 +13495,19 @@ function ua(n, e, t, r, s, o, i, l) {
13495
13495
  const u = c * e.width + i, f = e.map[u];
13496
13496
  if (e.map[u - 1] == f) {
13497
13497
  a = !0;
13498
- const d = t.nodeAt(f), h = e.colCount(f), p = n.mapping.slice(l).map(f + r);
13498
+ const d = t.nodeAt(f), p = e.colCount(f), h = n.mapping.slice(l).map(f + r);
13499
13499
  n.setNodeMarkup(
13500
- p,
13500
+ h,
13501
13501
  null,
13502
13502
  en(
13503
13503
  d.attrs,
13504
- i - h,
13505
- d.attrs.colspan - (i - h)
13504
+ i - p,
13505
+ d.attrs.colspan - (i - p)
13506
13506
  )
13507
13507
  ), n.insert(
13508
- p + d.nodeSize,
13508
+ h + d.nodeSize,
13509
13509
  d.type.createAndFill(
13510
- en(d.attrs, 0, i - h)
13510
+ en(d.attrs, 0, i - p)
13511
13511
  )
13512
13512
  ), c += d.attrs.rowspan - 1;
13513
13513
  }
@@ -13521,21 +13521,21 @@ function fa(n, e, t, r, s) {
13521
13521
  let i = Z.get(o);
13522
13522
  const { top: l, left: a } = r, c = a + s.width, u = l + s.height, f = n.tr;
13523
13523
  let d = 0;
13524
- function h() {
13524
+ function p() {
13525
13525
  if (o = t ? f.doc.nodeAt(t - 1) : f.doc, !o)
13526
13526
  throw new Error("No table found");
13527
13527
  i = Z.get(o), d = f.mapping.maps.length;
13528
13528
  }
13529
- xy(f, i, o, t, c, u, d) && h(), ca(f, i, o, t, a, c, l, d) && h(), ca(f, i, o, t, a, c, u, d) && h(), ua(f, i, o, t, l, u, a, d) && h(), ua(f, i, o, t, l, u, c, d) && h();
13530
- for (let p = l; p < u; p++) {
13531
- const y = i.positionAt(p, a, o), m = i.positionAt(p, c, o);
13529
+ xy(f, i, o, t, c, u, d) && p(), ca(f, i, o, t, a, c, l, d) && p(), ca(f, i, o, t, a, c, u, d) && p(), ua(f, i, o, t, l, u, a, d) && p(), ua(f, i, o, t, l, u, c, d) && p();
13530
+ for (let h = l; h < u; h++) {
13531
+ const y = i.positionAt(h, a, o), m = i.positionAt(h, c, o);
13532
13532
  f.replace(
13533
13533
  f.mapping.slice(d).map(y + t),
13534
13534
  f.mapping.slice(d).map(m + t),
13535
- new M(s.rows[p - l], 0, 0)
13535
+ new M(s.rows[h - l], 0, 0)
13536
13536
  );
13537
13537
  }
13538
- h(), f.setSelection(
13538
+ p(), f.setSelection(
13539
13539
  new H(
13540
13540
  f.doc.resolve(t + i.positionAt(l, a, o)),
13541
13541
  f.doc.resolve(t + i.positionAt(u - 1, c - 1, o))
@@ -13659,8 +13659,8 @@ function wy(n, e) {
13659
13659
  else return;
13660
13660
  const d = new H(a, u);
13661
13661
  if (f || !n.state.selection.eq(d)) {
13662
- const h = n.state.tr.setSelection(d);
13663
- f && h.setMeta(kt, a.pos), n.dispatch(h);
13662
+ const p = n.state.tr.setSelection(d);
13663
+ f && p.setMeta(kt, a.pos), n.dispatch(p);
13664
13664
  }
13665
13665
  }
13666
13666
  function i() {
@@ -14024,8 +14024,8 @@ function By() {
14024
14024
  for (const [c, u] of a) {
14025
14025
  const { pos: f, deleted: d } = e.mapping.mapResult(c);
14026
14026
  if (d) continue;
14027
- let h = u;
14028
- i === u && (h = Gs()), l.posToKey.set(f, h), l.keyToPos.set(h, f);
14027
+ let p = u;
14028
+ i === u && (p = Gs()), l.posToKey.set(f, p), l.keyToPos.set(p, f);
14029
14029
  }
14030
14030
  return s.doc.descendants((c, u) => {
14031
14031
  if (l.posToKey.has(u)) return !0;
@@ -14130,8 +14130,8 @@ function Ly(n) {
14130
14130
  case "deleteContent": {
14131
14131
  const l = s.getTargetRanges(), { tr: a } = r.state;
14132
14132
  for (const c of l) {
14133
- const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state, h = d.resolve(u).marksAcross(d.resolve(f));
14134
- a.delete(u, f).setStoredMarks(h);
14133
+ const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state, p = d.resolve(u).marksAcross(d.resolve(f));
14134
+ a.delete(u, f).setStoredMarks(p);
14135
14135
  }
14136
14136
  r.dispatch(a);
14137
14137
  break;
@@ -14202,16 +14202,16 @@ function xa(n) {
14202
14202
  t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1
14203
14203
  ) {
14204
14204
  let f = i, d = i;
14205
- for (let h = 0; h < t.rangeCount; h++) {
14206
- const p = t.getRangeAt(h);
14205
+ for (let p = 0; p < t.rangeCount; p++) {
14206
+ const h = t.getRangeAt(p);
14207
14207
  f = Math.min(
14208
14208
  f,
14209
14209
  // @ts-expect-error Internal method
14210
- n.docView.posFromDOM(p.startContainer, p.startOffset, 1)
14210
+ n.docView.posFromDOM(h.startContainer, h.startOffset, 1)
14211
14211
  ), d = Math.max(
14212
14212
  d,
14213
14213
  // @ts-expect-error Internal method
14214
- n.docView.posFromDOM(p.endContainer, p.endOffset, -1)
14214
+ n.docView.posFromDOM(h.endContainer, h.endOffset, -1)
14215
14215
  );
14216
14216
  }
14217
14217
  if (f < 0) return null;
@@ -14784,11 +14784,11 @@ class yr {
14784
14784
  // a selection starts in such a node and ends in another, in which
14785
14785
  // case we just use whatever domFromPos produces as a best effort.
14786
14786
  setSelection(e, t, r) {
14787
- var h;
14787
+ var p;
14788
14788
  let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
14789
14789
  const o = Math.min(e, t), i = Math.max(e, t);
14790
- for (let p = 0, y = 0; p < this.children.length; p++) {
14791
- const m = this.children[p], x = y + m.size;
14790
+ for (let h = 0, y = 0; h < this.children.length; h++) {
14791
+ const m = this.children[h], x = y + m.size;
14792
14792
  if (o > y && i < x) return m.setSelection(e - y - m.border, t - y - m.border, r, s);
14793
14793
  y = x;
14794
14794
  }
@@ -14796,11 +14796,11 @@ class yr {
14796
14796
  const c = r.root.getSelection(), u = r.domSelectionRange();
14797
14797
  let f = !1;
14798
14798
  if ((fe.gecko || fe.safari) && e == t) {
14799
- const { node: p, offset: y } = l;
14800
- if (p.nodeType == 3) {
14801
- if (f = !!(y && ((h = p.nodeValue) == null ? void 0 : h[y - 1]) == `
14802
- `), f && y == p.nodeValue.length)
14803
- for (let m = p, x; m; m = m.parentNode) {
14799
+ const { node: h, offset: y } = l;
14800
+ if (h.nodeType == 3) {
14801
+ if (f = !!(y && ((p = h.nodeValue) == null ? void 0 : p[y - 1]) == `
14802
+ `), f && y == h.nodeValue.length)
14803
+ for (let m = h, x; m; m = m.parentNode) {
14804
14804
  if (x = m.nextSibling) {
14805
14805
  x.nodeName == "BR" && (l = a = {
14806
14806
  node: x.parentNode,
@@ -14812,13 +14812,13 @@ class yr {
14812
14812
  if (C && C.node && C.node.isBlock) break;
14813
14813
  }
14814
14814
  } else {
14815
- const m = p.childNodes[y - 1];
14815
+ const m = h.childNodes[y - 1];
14816
14816
  f = m && (m.nodeName == "BR" || m.contentEditable == "false");
14817
14817
  }
14818
14818
  }
14819
14819
  if (fe.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
14820
- const p = u.focusNode.childNodes[u.focusOffset];
14821
- p && p.contentEditable == "false" && (s = !0);
14820
+ const h = u.focusNode.childNodes[u.focusOffset];
14821
+ h && h.contentEditable == "false" && (s = !0);
14822
14822
  }
14823
14823
  if (!(s || f && fe.safari) && rs(l.node, l.offset, u.anchorNode, u.anchorOffset) && rs(a.node, a.offset, u.focusNode, u.focusOffset)) return;
14824
14824
  let d = !1;
@@ -14834,8 +14834,8 @@ class yr {
14834
14834
  const y = l;
14835
14835
  l = a, a = y;
14836
14836
  }
14837
- const p = document.createRange();
14838
- p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
14837
+ const h = document.createRange();
14838
+ h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
14839
14839
  }
14840
14840
  }
14841
14841
  ignoreMutation(e) {
@@ -14958,7 +14958,7 @@ class sb extends yr {
14958
14958
  }
14959
14959
  }
14960
14960
  class yi extends yr {
14961
- constructor(t, r, s, o, i, l, a, c, u, f, d, h, p) {
14961
+ constructor(t, r, s, o, i, l, a, c, u, f, d, p, h) {
14962
14962
  super(t, r, s, a, c);
14963
14963
  B(this, "node");
14964
14964
  B(this, "outerDeco");
@@ -14968,7 +14968,7 @@ class yi extends yr {
14968
14968
  B(this, "selectNode");
14969
14969
  B(this, "deselectNode");
14970
14970
  B(this, "ignoreMutation");
14971
- this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode = h, this.ignoreMutation = p;
14971
+ this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode = p, this.ignoreMutation = h;
14972
14972
  }
14973
14973
  updateOuterDeco() {
14974
14974
  }
@@ -15224,18 +15224,18 @@ const db = new cs({
15224
15224
  let Aa = !1;
15225
15225
  function pb(n, e) {
15226
15226
  process.env.NODE_ENV !== "production" && e.defaultState !== void 0 && e.state !== void 0 && !Aa && (console.error("A component contains a ProseMirror editor with both value and defaultValue props. ProseMirror editors must be either controlled or uncontrolled (specify either the state prop, or the defaultState prop, but not both). Decide between using a controlled or uncontrolled ProseMirror editor and remove one of these props. More info: https://reactjs.org/link/controlled-components"), Aa = !0);
15227
- const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(), h = He(($) => {
15227
+ const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(), p = He(($) => {
15228
15228
  Vi(() => {
15229
15229
  s($);
15230
15230
  });
15231
- }, []), p = Me(() => [
15231
+ }, []), h = Me(() => [
15232
15232
  ...e.plugins ?? [],
15233
15233
  u,
15234
- Ly(h)
15234
+ Ly(p)
15235
15235
  ], [
15236
15236
  e.plugins,
15237
15237
  u,
15238
- h
15238
+ p
15239
15239
  ]), y = He(function(j) {
15240
15240
  t.current ? Vi(() => {
15241
15241
  e.state || a((E) => E.apply(j)), e.dispatchTransaction && e.dispatchTransaction.call(this, j);
@@ -15250,7 +15250,7 @@ function pb(n, e) {
15250
15250
  }, () => !1)), w = {
15251
15251
  ...e,
15252
15252
  state: c,
15253
- plugins: p,
15253
+ plugins: h,
15254
15254
  dispatchTransaction: y,
15255
15255
  docView: C.current
15256
15256
  }, [O, v] = N(
@@ -15333,10 +15333,10 @@ const Oe = ft({
15333
15333
  }
15334
15334
  });
15335
15335
  function xi(n, e, t, r, s, o, i, l) {
15336
- const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), h = He((S) => {
15336
+ const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), p = He((S) => {
15337
15337
  d.current = S;
15338
- }, []), p = I(() => !1), y = He((S) => {
15339
- p.current = S;
15338
+ }, []), h = I(() => !1), y = He((S) => {
15339
+ h.current = S;
15340
15340
  }, []), m = I(() => {
15341
15341
  !r.current || !n || (r.current.nodeType == 1 && r.current.classList.add("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && (((t == null ? void 0 : t.current) ?? r.current).draggable = !0));
15342
15342
  }), x = I(() => {
@@ -15362,7 +15362,7 @@ function xi(n, e, t, r, s, o, i, l) {
15362
15362
  // keep it; it won't have changed. This is especially
15363
15363
  // important during compositions, where the
15364
15364
  // firstChildDesc might not have a correct dom node set yet.
15365
- (l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (S == null ? void 0 : S.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (S == null ? void 0 : S.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) => p.current(j)), u(f.current.contentDOM !== null), w.current.includes(f.current) || w.current.push(f.current), w.current.sort(sn);
15365
+ (l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (S == null ? void 0 : S.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (S == null ? void 0 : S.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) => h.current(j)), u(f.current.contentDOM !== null), w.current.includes(f.current) || w.current.push(f.current), w.current.sort(sn);
15366
15366
  for (const j of v.current)
15367
15367
  if (j.parent = f.current, j instanceof ss) {
15368
15368
  const E = ($ = f.current.contentDOM) == null ? void 0 : $.firstChild;
@@ -15381,7 +15381,7 @@ function xi(n, e, t, r, s, o, i, l) {
15381
15381
  hasContentDOM: c,
15382
15382
  childDescriptors: v,
15383
15383
  nodeViewDescRef: f,
15384
- setStopEvent: h,
15384
+ setStopEvent: p,
15385
15385
  setSelectNode: C,
15386
15386
  setIgnoreMutation: y
15387
15387
  };
@@ -15404,10 +15404,10 @@ function yb(n, e, t, r) {
15404
15404
  let a = null;
15405
15405
  for (let c = 0; ; ) {
15406
15406
  if (i < s.length && s[i].to == o) {
15407
- const p = s[i++];
15407
+ const h = s[i++];
15408
15408
  let y;
15409
15409
  for (; i < s.length && s[i].to == o; ) (y || (y = [
15410
- p
15410
+ h
15411
15411
  ])).push(s[i++]);
15412
15412
  if (y) {
15413
15413
  y.sort(gb);
@@ -15421,9 +15421,9 @@ function yb(n, e, t, r) {
15421
15421
  );
15422
15422
  } else
15423
15423
  t(
15424
- p,
15424
+ h,
15425
15425
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15426
- !(p.type instanceof rr),
15426
+ !(h.type instanceof rr),
15427
15427
  o,
15428
15428
  c,
15429
15429
  !!a
@@ -15436,17 +15436,17 @@ function yb(n, e, t, r) {
15436
15436
  f = c, u = n.child(c++);
15437
15437
  else
15438
15438
  break;
15439
- for (let p = 0; p < l.length; p++) l[p].to <= o && l.splice(p--, 1);
15439
+ for (let h = 0; h < l.length; h++) l[h].to <= o && l.splice(h--, 1);
15440
15440
  for (; i < s.length && s[i].from <= o && s[i].to > o; ) l.push(s[i++]);
15441
15441
  let d = o + u.nodeSize;
15442
15442
  if (u.isText) {
15443
- let p = d;
15444
- i < s.length && s[i].from < p && (p = s[i].from);
15445
- for (let y = 0; y < l.length; y++) l[y].to < p && (p = l[y].to);
15446
- p < d && (a = u.cut(p - o), u = u.cut(0, p - o), d = p, f = -1);
15443
+ let h = d;
15444
+ i < s.length && s[i].from < h && (h = s[i].from);
15445
+ for (let y = 0; y < l.length; y++) l[y].to < h && (h = l[y].to);
15446
+ h < d && (a = u.cut(h - o), u = u.cut(0, h - o), d = h, f = -1);
15447
15447
  }
15448
- const h = u.isInline && !u.isLeaf ? l.filter((p) => !p.inline) : l.slice();
15449
- r(u, h, e.forChild(o, u), o, f), o = d;
15448
+ const p = u.isInline && !u.isLeaf ? l.filter((h) => !h.inline) : l.slice();
15449
+ r(u, p, e.forChild(o, u), o, f), o = d;
15450
15450
  }
15451
15451
  }
15452
15452
  function bb() {
@@ -15706,15 +15706,15 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15706
15706
  }, f = 1;
15707
15707
  c && typeof c == "object" && c.nodeType == null && !Array.isArray(c) && (f = 2, u = sf(of(c), u));
15708
15708
  const d = [];
15709
- for (let h = f; h < r.length; h++) {
15710
- const p = r[h];
15711
- if (p === 0) {
15712
- if (h < r.length - 1 || h > f)
15709
+ for (let p = f; p < r.length; p++) {
15710
+ const h = r[p];
15711
+ if (h === 0) {
15712
+ if (p < r.length - 1 || p > f)
15713
15713
  throw new RangeError("Content hole must be the only child of its parent node");
15714
15714
  return /* @__PURE__ */ Kn(a, u, o);
15715
15715
  }
15716
15716
  d.push(/* @__PURE__ */ P.createElement(ki, {
15717
- outputSpec: p
15717
+ outputSpec: h
15718
15718
  }, o));
15719
15719
  }
15720
15720
  return s && !lf(r) && d.push(o), /* @__PURE__ */ Kn(a, u, ...d);
@@ -15723,31 +15723,31 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
15723
15723
  const { siblingsRef: i, parentRef: l } = ie(Oe), a = I(void 0), c = I([]), u = I(null);
15724
15724
  is(t, () => u.current, []);
15725
15725
  const f = Me(() => {
15726
- var h, p;
15727
- return (p = (h = r.type.spec).toDOM) == null ? void 0 : p.call(h, r, !0);
15726
+ var p, h;
15727
+ return (h = (p = r.type.spec).toDOM) == null ? void 0 : h.call(p, r, !0);
15728
15728
  }, [
15729
15729
  r
15730
15730
  ]);
15731
15731
  if (!f) throw new Error(`Mark spec for ${r.type.name} is missing toDOM`);
15732
15732
  X(() => {
15733
- const h = i.current;
15733
+ const p = i.current;
15734
15734
  return () => {
15735
- if (a.current && h.includes(a.current)) {
15736
- const p = h.indexOf(a.current);
15737
- h.splice(p, 1);
15735
+ if (a.current && p.includes(a.current)) {
15736
+ const h = p.indexOf(a.current);
15737
+ p.splice(h, 1);
15738
15738
  }
15739
15739
  };
15740
15740
  }, [
15741
15741
  i
15742
15742
  ]), X(() => {
15743
15743
  if (!u.current) return;
15744
- const h = c.current[0];
15745
- a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (h == null ? void 0 : h.dom.parentElement) ?? u.current, a.current.mark = r, a.current.getPos = () => s.current()) : a.current = new sb(l.current, c.current, () => s.current(), r, u.current, (h == null ? void 0 : h.dom.parentElement) ?? u.current, {
15744
+ const p = c.current[0];
15745
+ a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (p == null ? void 0 : p.dom.parentElement) ?? u.current, a.current.mark = r, a.current.getPos = () => s.current()) : a.current = new sb(l.current, c.current, () => s.current(), r, u.current, (p == null ? void 0 : p.dom.parentElement) ?? u.current, {
15746
15746
  dom: u.current,
15747
- contentDOM: (h == null ? void 0 : h.dom.parentElement) ?? u.current
15747
+ contentDOM: (p == null ? void 0 : p.dom.parentElement) ?? u.current
15748
15748
  }), i.current.includes(a.current) || i.current.push(a.current), i.current.sort(sn);
15749
- for (const p of c.current)
15750
- p.parent = a.current;
15749
+ for (const h of c.current)
15750
+ h.parent = a.current;
15751
15751
  });
15752
15752
  const d = Me(() => ({
15753
15753
  parentRef: a,
@@ -15808,10 +15808,10 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15808
15808
  let { customNodeView: t, node: r, getPos: s, innerDeco: o, outerDeco: i } = e;
15809
15809
  const { view: l } = ie(Vt), a = I(null), c = I(null), u = I(null), f = I(() => s.current()).current, d = I(r);
15810
15810
  d.current = r;
15811
- const h = I(i);
15812
- h.current = i;
15813
- const p = I(o);
15814
- p.current = o;
15811
+ const p = I(i);
15812
+ p.current = i;
15813
+ const h = I(o);
15814
+ h.current = o;
15815
15815
  const y = I(null), m = I(null), x = bi(), C = Db();
15816
15816
  X(() => {
15817
15817
  var $t, on, Tn;
@@ -15822,8 +15822,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15822
15822
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15823
15823
  l,
15824
15824
  f,
15825
- h.current,
15826
- p.current
15825
+ p.current,
15826
+ h.current
15827
15827
  ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
15828
15828
  })), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)), x()), !y.current) return;
15829
15829
  const { dom: Ee } = m.current;
@@ -15850,8 +15850,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15850
15850
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15851
15851
  l,
15852
15852
  f,
15853
- h.current,
15854
- p.current
15853
+ p.current,
15854
+ h.current
15855
15855
  );
15856
15856
  const { dom: on } = m.current;
15857
15857
  c.current = y.current, y.current.appendChild(on);
@@ -15879,8 +15879,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15879
15879
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15880
15880
  l,
15881
15881
  () => s.current(),
15882
- h.current,
15883
- p.current
15882
+ p.current,
15883
+ h.current
15884
15884
  ), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
15885
15885
  })), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)));
15886
15886
  const { contentDOM: E } = m.current;
@@ -15911,7 +15911,7 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15911
15911
  let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
15912
15912
  const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Ju);
15913
15913
  let d = null;
15914
- const h = f[s.type.name], p = Me(() => {
15914
+ const p = f[s.type.name], h = Me(() => {
15915
15915
  var E, _;
15916
15916
  return (_ = (E = s.type.spec).toDOM) == null ? void 0 : _.call(E, s);
15917
15917
  }, [
@@ -15932,7 +15932,7 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15932
15932
  s,
15933
15933
  t
15934
15934
  ]);
15935
- if (h ? d = /* @__PURE__ */ P.createElement(h, {
15935
+ if (p ? d = /* @__PURE__ */ P.createElement(p, {
15936
15936
  ...v,
15937
15937
  ref: a,
15938
15938
  nodeProps: S
@@ -15940,10 +15940,10 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
15940
15940
  getPos: r,
15941
15941
  node: s,
15942
15942
  innerDecorations: o
15943
- })) : p && (d = /* @__PURE__ */ P.createElement(ki, {
15943
+ })) : h && (d = /* @__PURE__ */ P.createElement(ki, {
15944
15944
  ...v,
15945
15945
  ref: a,
15946
- outputSpec: p
15946
+ outputSpec: h
15947
15947
  }, /* @__PURE__ */ P.createElement(lr, {
15948
15948
  getPos: r,
15949
15949
  node: s,
@@ -16084,28 +16084,28 @@ function Ib() {
16084
16084
  }
16085
16085
  if (a.return !== c.return) a = u, c = f;
16086
16086
  else {
16087
- for (var d = !1, h = u.child; h; ) {
16088
- if (h === a) {
16087
+ for (var d = !1, p = u.child; p; ) {
16088
+ if (p === a) {
16089
16089
  d = !0, a = u, c = f;
16090
16090
  break;
16091
16091
  }
16092
- if (h === c) {
16092
+ if (p === c) {
16093
16093
  d = !0, c = u, a = f;
16094
16094
  break;
16095
16095
  }
16096
- h = h.sibling;
16096
+ p = p.sibling;
16097
16097
  }
16098
16098
  if (!d) {
16099
- for (h = f.child; h; ) {
16100
- if (h === a) {
16099
+ for (p = f.child; p; ) {
16100
+ if (p === a) {
16101
16101
  d = !0, a = f, c = u;
16102
16102
  break;
16103
16103
  }
16104
- if (h === c) {
16104
+ if (p === c) {
16105
16105
  d = !0, c = f, a = u;
16106
16106
  break;
16107
16107
  }
16108
- h = h.sibling;
16108
+ p = p.sibling;
16109
16109
  }
16110
16110
  if (!d) throw Error(n(189));
16111
16111
  }
@@ -16601,14 +16601,14 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16601
16601
  if (!r) return null;
16602
16602
  const a = /* @__PURE__ */ new Set();
16603
16603
  let c = [], u = null;
16604
- yb(r, s, (p, y, m, x) => {
16605
- const C = p.type.spec.marks ?? [];
16604
+ yb(r, s, (h, y, m, x) => {
16605
+ const C = h.type.spec.marks ?? [];
16606
16606
  let w;
16607
16607
  if (y) {
16608
- w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, p, x);
16608
+ w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, h, x);
16609
16609
  const v = {
16610
16610
  type: "native-widget",
16611
- widget: p,
16611
+ widget: h,
16612
16612
  marks: C,
16613
16613
  offset: m,
16614
16614
  index: x,
@@ -16616,10 +16616,10 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16616
16616
  }, S = l.get(w);
16617
16617
  S && Zs(S, v) ? S.offset = m : l.set(w, v), a.add(w);
16618
16618
  } else {
16619
- w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey, p, x);
16619
+ w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey, h, x);
16620
16620
  const v = {
16621
16621
  type: "widget",
16622
- widget: p,
16622
+ widget: h,
16623
16623
  marks: C,
16624
16624
  offset: m,
16625
16625
  index: x,
@@ -16629,11 +16629,11 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16629
16629
  }
16630
16630
  const O = l.get(w);
16631
16631
  c.push(O), qb(u, l.get(w));
16632
- }, (p, y, m, x) => {
16632
+ }, (h, y, m, x) => {
16633
16633
  const C = eo(i.current(), x, "node", o == null ? void 0 : o.posToKey), w = {
16634
16634
  type: "node",
16635
- node: p,
16636
- marks: p.marks,
16635
+ node: h,
16636
+ marks: h.marks,
16637
16637
  innerDeco: m,
16638
16638
  outerDeco: y,
16639
16639
  offset: x,
@@ -16641,12 +16641,12 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16641
16641
  }, O = l.get(C);
16642
16642
  O && Zs(O, w) ? (O.offset = x, u = O) : (l.set(C, w), u = w), a.add(C), Hb(c, u), c = [];
16643
16643
  });
16644
- for (const p of l.keys())
16645
- a.has(p) || l.delete(p);
16646
- const f = Array.from(l.values()).sort((p, y) => p.offset - y.offset), d = Jb(f, i), h = f[f.length - 1];
16647
- return (!h || h.type !== "node" || h.node.isInline && !h.node.isText || // RegExp.test actually handles undefined just fine
16644
+ for (const h of l.keys())
16645
+ a.has(h) || l.delete(h);
16646
+ const f = Array.from(l.values()).sort((h, y) => h.offset - y.offset), d = Jb(f, i), p = f[f.length - 1];
16647
+ return (!p || p.type !== "node" || p.node.isInline && !p.node.isText || // RegExp.test actually handles undefined just fine
16648
16648
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
16649
- /\n$/.test(h.node.text)) && d.push(/* @__PURE__ */ P.createElement(Rb, {
16649
+ /\n$/.test(p.node.text)) && d.push(/* @__PURE__ */ P.createElement(Rb, {
16650
16650
  getPos: i,
16651
16651
  key: "trailing-hack-img"
16652
16652
  }), /* @__PURE__ */ P.createElement(Bb, {
@@ -16661,25 +16661,25 @@ const lr = /* @__PURE__ */ Fe(function(e) {
16661
16661
  let { className: r, node: s, innerDeco: o, outerDeco: i, as: l, viewDesc: a, ...c } = e;
16662
16662
  const u = I(null);
16663
16663
  is(t, () => u.current, []);
16664
- const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a), h = Me(() => ({
16664
+ const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a), p = Me(() => ({
16665
16665
  parentRef: d,
16666
16666
  siblingsRef: f
16667
16667
  }), [
16668
16668
  f,
16669
16669
  d
16670
- ]), p = {
16670
+ ]), h = {
16671
16671
  ...c,
16672
16672
  ref: u,
16673
16673
  className: r,
16674
16674
  suppressContentEditableWarning: !0
16675
- }, y = l ? /* @__PURE__ */ ls(l, p, /* @__PURE__ */ P.createElement(Oe.Provider, {
16676
- value: h
16675
+ }, y = l ? /* @__PURE__ */ ls(l, h, /* @__PURE__ */ P.createElement(Oe.Provider, {
16676
+ value: p
16677
16677
  }, /* @__PURE__ */ P.createElement(lr, {
16678
16678
  getPos: to,
16679
16679
  node: s,
16680
16680
  innerDecorations: o
16681
- }))) : /* @__PURE__ */ Kn("div", p, /* @__PURE__ */ P.createElement(Oe.Provider, {
16682
- value: h
16681
+ }))) : /* @__PURE__ */ Kn("div", h, /* @__PURE__ */ P.createElement(Oe.Provider, {
16682
+ value: p
16683
16683
  }, /* @__PURE__ */ P.createElement(lr, {
16684
16684
  getPos: to,
16685
16685
  node: s,
@@ -16713,7 +16713,7 @@ function Yb(n, e) {
16713
16713
  }
16714
16714
  const df = /* @__PURE__ */ Ge(Yb), Gb = [];
16715
16715
  function Xb(n) {
16716
- var p;
16716
+ var h;
16717
16717
  let { className: e, children: t, nodeViews: r, customNodeViews: s, ...o } = n;
16718
16718
  const [i, l] = N(null), { editor: a, state: c } = pb(i, {
16719
16719
  ...o,
@@ -16722,7 +16722,7 @@ function Xb(n) {
16722
16722
  nodeViews: r ?? {}
16723
16723
  }), [
16724
16724
  r
16725
- ]), h = Me(() => {
16725
+ ]), p = Me(() => {
16726
16726
  var y;
16727
16727
  return {
16728
16728
  className: e,
@@ -16735,7 +16735,7 @@ function Xb(n) {
16735
16735
  }, [
16736
16736
  e,
16737
16737
  a.docViewDescRef,
16738
- (p = a.view) == null ? void 0 : p.state.doc,
16738
+ (h = a.view) == null ? void 0 : h.state.doc,
16739
16739
  u,
16740
16740
  f
16741
16741
  ]);
@@ -16746,7 +16746,7 @@ function Xb(n) {
16746
16746
  }, /* @__PURE__ */ P.createElement(Ju.Provider, {
16747
16747
  value: d
16748
16748
  }, /* @__PURE__ */ P.createElement(ff.Provider, {
16749
- value: h
16749
+ value: p
16750
16750
  }, t))));
16751
16751
  }
16752
16752
  function hf(n) {
@@ -17349,8 +17349,8 @@ const Cf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
17349
17349
  s(""), a(""), i(void 0);
17350
17350
  }, [e]), et((d) => {
17351
17351
  if (!d || !e) return;
17352
- const h = ct.getState(d.state);
17353
- u(h.upload !== void 0);
17352
+ const p = ct.getState(d.state);
17353
+ u(p.upload !== void 0);
17354
17354
  }, [e]);
17355
17355
  const f = se((d) => {
17356
17356
  d && (c ? Hm(d, o, l, n) : Km(d, r, l, n), d.focus(), t());
@@ -17552,12 +17552,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17552
17552
  }), d(O ? `${O} / ${w.childCount}` : "");
17553
17553
  }
17554
17554
  });
17555
- const h = se((x, C) => {
17555
+ const p = se((x, C) => {
17556
17556
  if (!x) return;
17557
17557
  i(C);
17558
17558
  const w = x.state.tr, O = t.getPos();
17559
17559
  x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, alt: C })), x.focus();
17560
- }), p = se((x, C) => {
17560
+ }), h = se((x, C) => {
17561
17561
  if (!x) return;
17562
17562
  a(C);
17563
17563
  const w = x.state.tr, O = t.getPos();
@@ -17589,7 +17589,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17589
17589
  {
17590
17590
  value: o,
17591
17591
  placeholder: "Alt: описание изображения (не обязательно)",
17592
- onChange: h,
17592
+ onChange: p,
17593
17593
  empty: !0,
17594
17594
  style: {
17595
17595
  textAlign: "center",
@@ -17610,7 +17610,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17610
17610
  {
17611
17611
  value: l,
17612
17612
  placeholder: "Title: подпись под изображением (не обязательно)",
17613
- onChange: p,
17613
+ onChange: h,
17614
17614
  empty: !0,
17615
17615
  style: {
17616
17616
  textAlign: "center",
@@ -17631,7 +17631,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17631
17631
  const u = se((f, d) => {
17632
17632
  if (!f) return;
17633
17633
  a(d);
17634
- const { $from: h, $to: p } = f.state.selection, y = h.blockRange(p);
17634
+ const { $from: p, $to: h } = f.state.selection, y = p.blockRange(h);
17635
17635
  if (y) {
17636
17636
  const m = f.state.doc;
17637
17637
  let x = f.state.tr;
@@ -17701,15 +17701,15 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17701
17701
  }, d1 = ({ title: n = !1, content: e, onSave: t, onCancel: r, onChange: s, onUpload: o }) => {
17702
17702
  const [i, l] = N(""), [a, c] = N();
17703
17703
  q(() => {
17704
- const h = lt.create({
17704
+ const p = lt.create({
17705
17705
  doc: y0(e),
17706
17706
  schema: Vr,
17707
17707
  plugins: mf({ schema: Vr, upload: o })
17708
17708
  });
17709
- c(h), n !== !1 && l(typeof n == "string" ? n : "");
17709
+ c(p), n !== !1 && l(typeof n == "string" ? n : "");
17710
17710
  }, [n, e]);
17711
- const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (h) => {
17712
- !t || !u() || t({ ...h, name: i });
17711
+ const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (p) => {
17712
+ !t || !u() || t({ ...p, name: i });
17713
17713
  }, d = () => {
17714
17714
  r && r();
17715
17715
  };
@@ -17718,7 +17718,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17718
17718
  "input",
17719
17719
  {
17720
17720
  className: "ProseNotesTitle",
17721
- onChange: (h) => l(h.currentTarget.value),
17721
+ onChange: (p) => l(p.currentTarget.value),
17722
17722
  value: i,
17723
17723
  placeholder: "Укажите заголовок"
17724
17724
  }
@@ -17727,8 +17727,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17727
17727
  hf,
17728
17728
  {
17729
17729
  state: a,
17730
- dispatchTransaction: (h) => c((p) => {
17731
- const y = p == null ? void 0 : p.apply(h);
17730
+ dispatchTransaction: (p) => c((h) => {
17731
+ const y = h == null ? void 0 : h.apply(p);
17732
17732
  return y && s && s(!!Ko(y)), y;
17733
17733
  }),
17734
17734
  nodeViews: {
@@ -17754,12 +17754,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17754
17754
  const u = n.nodes.heading;
17755
17755
  if (!c || !u || !i) return;
17756
17756
  const f = [], d = [];
17757
- for (let h = 2; h < 7; h++) {
17758
- const y = kn(u, { level: h });
17759
- d[h] = y, f[h] = {
17760
- id: h,
17761
- icon: /* @__PURE__ */ g.jsx(w0, { level: h }),
17762
- text: `уровень ${h}`,
17757
+ for (let p = 2; p < 7; p++) {
17758
+ const y = kn(u, { level: p });
17759
+ d[p] = y, f[p] = {
17760
+ id: p,
17761
+ icon: /* @__PURE__ */ g.jsx(w0, { level: p }),
17762
+ text: `уровень ${p}`,
17763
17763
  disabled: !y(c.state)
17764
17764
  };
17765
17765
  }
@@ -17828,8 +17828,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17828
17828
  if (u) {
17829
17829
  const f = o.state.doc;
17830
17830
  let d = o.state.tr;
17831
- f.nodesBetween(u.start, u.end, (h, p) => {
17832
- h.type.name === "paragraph" && (d = d.setNodeMarkup(p, null, { align: l }));
17831
+ f.nodesBetween(u.start, u.end, (p, h) => {
17832
+ p.type.name === "paragraph" && (d = d.setNodeMarkup(h, null, { align: l }));
17833
17833
  }), o.dispatch(d);
17834
17834
  }
17835
17835
  o.focus(), r(!1);
@@ -17868,15 +17868,15 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17868
17868
  /* @__PURE__ */ g.jsx(Df, { schema: n }),
17869
17869
  /* @__PURE__ */ g.jsx(Cf, {}),
17870
17870
  /* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ g.jsx(Tf, { onSave: e }) })
17871
- ] }), O0 = 12, Af = 1, Fn = 50, E0 = ({ width: n, onChange: e, onWidth: t }) => {
17872
- const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (p) => {
17871
+ ] }), O0 = 5, Af = 1, Fn = 50, E0 = ({ width: n, onChange: e, onWidth: t }) => {
17872
+ const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (h) => {
17873
17873
  const y = n[l], m = n[l + 1], x = [...c];
17874
- return y + p < Fn && (p = Fn - y), m - p < Fn && (p = m - Fn), x[l] = y + p, x[l + 1] = m - p, x;
17874
+ return y + h < Fn && (h = Fn - y), m - h < Fn && (h = m - Fn), x[l] = y + h, x[l + 1] = m - h, x;
17875
17875
  };
17876
17876
  q(() => {
17877
17877
  u(n);
17878
17878
  }, [n]), q(() => {
17879
- const p = (m) => {
17879
+ const h = (m) => {
17880
17880
  if (!r) return;
17881
17881
  s(!1), m.preventDefault(), m.stopPropagation();
17882
17882
  const x = m.clientX - o, C = f(x);
@@ -17887,17 +17887,17 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17887
17887
  const x = m.clientX - o, C = f(x);
17888
17888
  u(C), e(C);
17889
17889
  };
17890
- return document.addEventListener("mouseup", p), document.addEventListener("mousemove", y), () => {
17891
- document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", y);
17890
+ return document.addEventListener("mouseup", h), document.addEventListener("mousemove", y), () => {
17891
+ document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", y);
17892
17892
  };
17893
17893
  }, [r, l]);
17894
- const d = (p, y) => {
17895
- y !== n.length - 1 && (p.preventDefault(), p.stopPropagation(), s(!0), i(p.clientX), a(y));
17896
- }, h = (p) => c.slice(0, p + 1).reduce((y, m) => y + m, 0) + p + Af - O0 / 2;
17897
- return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((p, y) => /* @__PURE__ */ g.jsx(
17894
+ const d = (h, y) => {
17895
+ y !== n.length - 1 && (h.preventDefault(), h.stopPropagation(), s(!0), i(h.clientX), a(y));
17896
+ }, p = (h) => c.slice(0, h + 1).reduce((y, m) => y + m, 0) + h + Af - Math.floor(O0 / 2);
17897
+ return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((h, y) => /* @__PURE__ */ g.jsx(
17898
17898
  "div",
17899
17899
  {
17900
- style: { left: h(y) + "px" },
17900
+ style: { left: p(y) + "px" },
17901
17901
  onMouseDown: (m) => d(m, y)
17902
17902
  },
17903
17903
  y
@@ -17905,29 +17905,29 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17905
17905
  }, T0 = Ge(
17906
17906
  function({ children: e, nodeProps: t, ...r }, s) {
17907
17907
  var f;
17908
- const o = I(null), i = I(null), [l, a] = N([]), c = se((d, h) => {
17908
+ const o = I(null), i = I(null), [l, a] = N([]), c = se((d, p) => {
17909
17909
  if (!d) return;
17910
- const p = t.node, y = t.getPos() + 1, m = Z.get(p), x = d.state.tr;
17910
+ const h = t.node, y = t.getPos() + 1, m = Z.get(h), x = d.state.tr;
17911
17911
  for (let C = 0; C < m.height; C++)
17912
17912
  for (let w = 0; w < m.width; ) {
17913
- const O = C * m.width + w, v = m.map[O], S = p.nodeAt(v).attrs, $ = h.slice(w, w + S.colspan);
17913
+ const O = C * m.width + w, v = m.map[O], S = h.nodeAt(v).attrs, $ = p.slice(w, w + S.colspan);
17914
17914
  C && m.map[O] == m.map[O - m.width] || x.setNodeMarkup(y + v, null, { ...S, colwidth: $ }), w += S.colspan;
17915
17915
  }
17916
17916
  x.docChanged && d.dispatch(x);
17917
17917
  });
17918
17918
  q(() => {
17919
17919
  if (!o.current || !i.current) return;
17920
- const h = t.node.firstChild;
17921
- if (!h) return;
17922
- let p = [];
17923
- for (let S = 0; S < h.childCount; S++) {
17924
- const $ = h.child(S), { colspan: j, colwidth: E } = $.attrs;
17925
- p = p.concat(Array.isArray(E) ? E : Array(j).fill(0));
17926
- }
17927
- const y = p.filter((S) => !S).length, m = p.reduce((S, $) => S + $, 0), x = (p.length + 1) * Af, C = Math.max(y ? (o.current.offsetWidth - m - x) / y : 0, Fn);
17928
- p = p.map((S) => S || C);
17929
- const w = p.reduce((S, $) => S + $, 0), O = i.current.offsetWidth - x - 16, v = O / w;
17930
- p = p.map((S) => Math.round(S * v)), p[p.length - 1] += O - p.reduce((S, $) => S + $, 0), a(p);
17920
+ const p = t.node.firstChild;
17921
+ if (!p) return;
17922
+ let h = [];
17923
+ for (let S = 0; S < p.childCount; S++) {
17924
+ const $ = p.child(S), { colspan: j, colwidth: E } = $.attrs;
17925
+ h = h.concat(Array.isArray(E) ? E : Array(j).fill(0));
17926
+ }
17927
+ const y = h.filter((S) => !S).length, m = h.reduce((S, $) => S + $, 0), x = (h.length + 1) * Af, C = Math.max(y ? (o.current.offsetWidth - m - x) / y : 0, Fn);
17928
+ h = h.map((S) => S || C);
17929
+ const w = h.reduce((S, $) => S + $, 0), O = i.current.offsetWidth - x - 16, v = O / w;
17930
+ h = h.map((S) => Math.round(S * v)), h[h.length - 1] += O - h.reduce((S, $) => S + $, 0), a(h);
17931
17931
  }, [t, o, i, (f = i.current) == null ? void 0 : f.offsetWidth]);
17932
17932
  const u = se((d) => {
17933
17933
  my(d.state, d.dispatch);
@@ -17943,7 +17943,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
17943
17943
  children: [
17944
17944
  /* @__PURE__ */ g.jsx(E0, { width: l, onChange: a, onWidth: c }),
17945
17945
  /* @__PURE__ */ g.jsxs("table", { ref: o, children: [
17946
- /* @__PURE__ */ g.jsx("colgroup", { children: l.map((d, h) => /* @__PURE__ */ g.jsx("col", { width: d }, h)) }),
17946
+ /* @__PURE__ */ g.jsx("colgroup", { children: l.map((d, p) => /* @__PURE__ */ g.jsx("col", { width: d }, p)) }),
17947
17947
  /* @__PURE__ */ g.jsx("caption", { onClick: u, children: /* @__PURE__ */ g.jsx(T.Trash, {}) }),
17948
17948
  /* @__PURE__ */ g.jsx("tbody", { children: e })
17949
17949
  ] })
@@ -18128,15 +18128,25 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18128
18128
  function({ children: e, nodeProps: t, ...r }, s) {
18129
18129
  const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1);
18130
18130
  q(() => {
18131
- const h = (p) => {
18132
- o.current !== p.target && (l(!1), c(!1), f(!1));
18131
+ const h = (y) => {
18132
+ o.current !== y.target && (l(!1), c(!1), f(!1));
18133
18133
  };
18134
18134
  return document.addEventListener("contextmenu", h, !0), () => document.removeEventListener("contextmenu", h, !0);
18135
18135
  }, []);
18136
18136
  const d = (h) => {
18137
18137
  h.preventDefault(), h.stopPropagation(), l(!1), c(!1), f(!1);
18138
- const p = h.currentTarget.getBoundingClientRect();
18139
- h.clientY < p.y ? f(!0) : h.clientX < p.x ? l(!0) : c(!0);
18138
+ const y = h.currentTarget.getBoundingClientRect();
18139
+ h.clientY < y.y ? f(!0) : h.clientX < y.x ? l(!0) : c(!0);
18140
+ }, p = (h) => {
18141
+ l(!1), c(!1), f(!1);
18142
+ const y = h.currentTarget.getBoundingClientRect();
18143
+ if (h.clientY < y.y)
18144
+ f(!0);
18145
+ else if (h.clientX < y.x)
18146
+ l(!0);
18147
+ else
18148
+ return;
18149
+ h.preventDefault(), h.stopPropagation();
18140
18150
  };
18141
18151
  return t.node.type.spec.tableRole === "header_cell" ? /* @__PURE__ */ g.jsxs(
18142
18152
  "th",
@@ -18149,6 +18159,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18149
18159
  textAlign: t.node.attrs.halign,
18150
18160
  verticalAlign: t.node.attrs.valign
18151
18161
  },
18162
+ onClick: p,
18152
18163
  onContextMenu: d,
18153
18164
  ref: (h) => {
18154
18165
  o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
@@ -18180,6 +18191,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18180
18191
  textAlign: t.node.attrs.halign,
18181
18192
  verticalAlign: t.node.attrs.valign
18182
18193
  },
18194
+ onClick: p,
18183
18195
  onContextMenu: d,
18184
18196
  ref: (h) => {
18185
18197
  o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
@@ -18205,14 +18217,14 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18205
18217
  ), P0 = Ge(
18206
18218
  function({ children: e, nodeProps: t, ...r }, s) {
18207
18219
  var v;
18208
- const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, h] = N(), [p, y] = N(), m = (S) => {
18220
+ const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, p] = N(), [h, y] = N(), m = (S) => {
18209
18221
  const $ = S.scrollLeft, j = S.clientWidth, E = S.scrollWidth;
18210
18222
  c($ > 0), f($ < E - j * 1.5);
18211
18223
  };
18212
18224
  q(() => {
18213
- o.current && (p && o.current.scrollWidth > p && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), y(o.current.scrollWidth));
18225
+ o.current && (h && o.current.scrollWidth > h && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), y(o.current.scrollWidth));
18214
18226
  }, [(v = o.current) == null ? void 0 : v.scrollWidth]), q(() => {
18215
- h(t.getPos() + t.node.nodeSize - 1), o.current && t.node.childCount > 1 && m(o.current);
18227
+ p(t.getPos() + t.node.nodeSize - 1), o.current && t.node.childCount > 1 && m(o.current);
18216
18228
  }, [t, o]), et((S) => {
18217
18229
  if (!S || t.node.childCount > 0) return;
18218
18230
  const $ = S.state.tr, j = t.getPos(), E = t.node.nodeSize;
@@ -18322,8 +18334,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18322
18334
  };
18323
18335
  return document.addEventListener("fullscreenchange", f), () => document.removeEventListener("fullscreenchange", f);
18324
18336
  }, []), q(() => {
18325
- var h, p, y, m, x, C, w;
18326
- let f = (h = n.attrs) == null ? void 0 : h.fid, d = (p = n.attrs) != null && p.src ? `${(y = n.attrs) == null ? void 0 : y.src}` : "";
18337
+ var p, h, y, m, x, C, w;
18338
+ let f = (p = n.attrs) == null ? void 0 : p.fid, d = (h = n.attrs) != null && h.src ? `${(y = n.attrs) == null ? void 0 : y.src}` : "";
18327
18339
  f && (d = `${xs}/files/${f}`), d || (d = ks), r(d), o((m = n.attrs) != null && m.alt ? `${(x = n.attrs) == null ? void 0 : x.alt}` : ""), l((C = n.attrs) != null && C.title ? `${(w = n.attrs) == null ? void 0 : w.title}` : "");
18328
18340
  }, [n]);
18329
18341
  const u = (f) => {
@@ -18415,7 +18427,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18415
18427
  t((i = n.attrs) != null && i.src ? `${(l = n.attrs) == null ? void 0 : l.src}` : ""), s((a = n.attrs) != null && a.title ? `${(c = n.attrs) == null ? void 0 : c.title}` : "");
18416
18428
  }, [n]), Ss(e) ? /* @__PURE__ */ g.jsx("div", { title: r, className: "video", children: /* @__PURE__ */ g.jsx("iframe", { src: e, allow: o }) }) : /* @__PURE__ */ g.jsx("div", { title: r, className: "image", children: /* @__PURE__ */ g.jsx("img", { src: ks }) });
18417
18429
  }, Y0 = () => /* @__PURE__ */ g.jsx("br", {}), G0 = ({ node: n }) => {
18418
- const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), h = (m) => {
18430
+ const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), p = (m) => {
18419
18431
  const x = m.scrollLeft, C = m.clientWidth, w = m.scrollWidth;
18420
18432
  i(x > C / 2), a(x < w - C * 1.5), u(Math.round(x / C + 1));
18421
18433
  };
@@ -18434,7 +18446,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18434
18446
  };
18435
18447
  return document.body.addEventListener("keydown", m), () => document.body.removeEventListener("keydown", m);
18436
18448
  }, [r]);
18437
- const p = (m) => {
18449
+ const h = (m) => {
18438
18450
  var x;
18439
18451
  m.stopPropagation(), r ? document.exitFullscreen() : (x = t.current) == null || x.requestFullscreen();
18440
18452
  }, y = (m, x) => {
@@ -18444,21 +18456,21 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
18444
18456
  e.current.scrollLeft = w;
18445
18457
  };
18446
18458
  return Array.isArray(n.content) ? /* @__PURE__ */ g.jsxs("div", { className: "carousel", ref: t, children: [
18447
- /* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => h(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(X0, { node: m, onClick: p }, x)) }),
18459
+ /* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => p(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(X0, { node: m, onClick: h }, x)) }),
18448
18460
  /* @__PURE__ */ g.jsxs("div", { className: "carousel-numb", children: [
18449
18461
  c,
18450
18462
  " / ",
18451
18463
  f
18452
18464
  ] }),
18453
- /* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: p, children: r ? /* @__PURE__ */ g.jsx(T.Minimize, {}) : /* @__PURE__ */ g.jsx(T.Maximize, {}) }),
18465
+ /* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: h, children: r ? /* @__PURE__ */ g.jsx(T.Minimize, {}) : /* @__PURE__ */ g.jsx(T.Maximize, {}) }),
18454
18466
  o && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (m) => y(m, -1), children: /* @__PURE__ */ g.jsx(T.ChevronLeft, {}) }),
18455
18467
  l && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (m) => y(m, 1), children: /* @__PURE__ */ g.jsx(T.ChevronRight, {}) })
18456
18468
  ] }) : null;
18457
18469
  }, X0 = ({ node: n, onClick: e }) => {
18458
18470
  const [t, r] = N(""), [s, o] = N(""), [i, l] = N("");
18459
18471
  return q(() => {
18460
- var d, h, p, y;
18461
- let a = (d = n.attrs) == null ? void 0 : d.fid, c = (h = n.attrs) != null && h.src ? `${n.attrs.src}` : "", u = (p = n.attrs) != null && p.alt ? `${n.attrs.alt}` : "", f = (y = n.attrs) != null && y.title ? `${n.attrs.title}` : "";
18472
+ var d, p, h, y;
18473
+ let a = (d = n.attrs) == null ? void 0 : d.fid, c = (p = n.attrs) != null && p.src ? `${n.attrs.src}` : "", u = (h = n.attrs) != null && h.alt ? `${n.attrs.alt}` : "", f = (y = n.attrs) != null && y.title ? `${n.attrs.title}` : "";
18462
18474
  a && (c = `${xs}/files/${a}`), c || (c = ks), r(c), o(u), l(f);
18463
18475
  }, [n]), n.type !== "image" ? null : /* @__PURE__ */ g.jsxs("div", { className: "image", children: [
18464
18476
  t && /* @__PURE__ */ g.jsx("img", { src: t, onClick: e, alt: s, title: i }),