@nine-lab/nine-ux 0.1.15 → 0.1.16

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.
@@ -11,8 +11,6 @@ const yl = `
11
11
  }
12
12
 
13
13
  dialog:modal {
14
- width: calc(100% - 50px);
15
- height: calc(100% - 50px);
16
14
  display: flex;
17
15
  flex-direction: column;
18
16
  padding: 0;
@@ -21,8 +19,15 @@ const yl = `
21
19
  outline: none;
22
20
  resize: both;
23
21
  box-shadow: 0 0 4px 0 darkgreen;
24
- }
25
-
22
+ width: 500px;
23
+ height: 150px;
24
+ min-width: 330px;
25
+ min-height: 60px;
26
+ }
27
+
28
+
29
+
30
+
26
31
  div.head .rect1, div.head .rect2, div.head .rect3 {
27
32
  display: none;
28
33
  width: 50px;
@@ -179,20 +184,9 @@ const yl = `
179
184
  background-size: 12px 12px;
180
185
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" style="fill:none;stroke:white;stroke-width:2px;" focusable="false" aria-hidden="true" viewBox="0 0 16 16"><path d="M2 2l12 12M14 2L2 14"></path></svg>');
181
186
  }
182
- `, bl = `
183
- dialog::backdrop {
184
- background: rgba(0, 0, 0, 0.3);
185
- }
186
-
187
- dialog:modal {
188
- width: 500px;
189
- height: 150px;
190
- min-width: 330px;
191
- min-height: 60px;
192
- }
193
-
194
-
195
- button {
187
+
188
+
189
+ button {
196
190
  cursor: pointer;
197
191
  }
198
192
 
@@ -221,155 +215,14 @@ const yl = `
221
215
  }
222
216
 
223
217
  button.ok {
224
- color: white;
225
- background-color: #007bff;
218
+ display: none;
226
219
  }
227
220
  button.cancel {
228
221
  color: white;
229
222
  background-color: #6c757d;
230
223
  }
231
224
 
232
- div.msg {
233
-
234
- }
235
-
236
- .reset, .apply {
237
- display: none;
238
- }
239
-
240
-
241
-
242
- :host(.classic) dialog:modal {
243
- border: 1px solid #007bff;
244
- box-shadow: 0 0 4px 0 #007bff;
245
- }
246
-
247
- :host(.classic) div.head {
248
- background-color: #007bff;
249
- }
250
- :host(.classic) div.head:hover {
251
- filter: brightness(110%);
252
- }
253
-
254
- :host(.classic) div.head span {
255
- font-size: 12px;
256
- }
257
-
258
- :host(.classic) div.head span.title {
259
- color: #ddd;
260
- margin-left: 4px;
261
- font-weight: bold;
262
- }
263
-
264
- :host(.classic) div.head span.sub-title {
265
- color: #ccc;
266
- margin-left: 8px;
267
- font-style: italic;
268
- }
269
- :host(.classic) div.head button {
270
- margin-right: 4px;
271
- background-color: transparent;
272
- border: none;
273
- color: #ccc;
274
- font-size: x-small;
275
- }
276
-
277
-
278
-
279
-
280
- :host(.rgb) dialog:modal {
281
- border: none;
282
- box-shadow: unset;
283
- border-top: none;
284
- }
285
-
286
- :host(.rgb) div.left {
287
- display: block;
288
- background-color: #ddd;
289
- }
290
- :host(.rgb) div.left span {
291
- color: #ccc;
292
- }
293
- :host(.rgb) div.close2 {
294
- display: block;
295
- color: #666;
296
- }
297
- :host(.rgb) div.close2 svg:hover {
298
- color: #999;
299
- }
300
- :host(.rgb) div.head {
301
- height: 4px;
302
- background-color: #999;
303
- padding: 0;
304
- }
305
- :host(.rgb) div.contents {
306
- height: calc(100% - 4px);
307
- }
308
-
309
- :host(.rgb) div.head ng-sphere,
310
- :host(.rgb) div.head span,
311
- :host(.rgb) div.head buttons {
312
- display: none;
313
- }
314
-
315
- :host(.rgb) div.head .rect1,
316
- :host(.rgb) div.head .rect2,
317
- :host(.rgb) div.head .rect3 {
318
- display: flex;
319
- }
320
-
321
-
322
- :host(.rgb) div.head:hover {
323
- filter: unset;
324
- }
325
- `, kl = `
326
- dialog::backdrop {
327
- background: rgba(0, 0, 0, 0.3);
328
- }
329
-
330
- dialog:modal {
331
- width: 500px;
332
- height: 150px;
333
- min-width: 330px;
334
- min-height: 60px;
335
- }
336
-
337
-
338
- button {
339
- cursor: pointer;
340
- }
341
-
342
- buttons.buttons-confirm {
343
- position: absolute;
344
- bottom: 8px;
345
- right: 8px;
346
- }
347
225
 
348
- buttons.buttons-confirm button {
349
- height: 32px;
350
- margin-right: 8px;
351
- border: none;
352
- outline: none;
353
- width: 60px;
354
- -moz-user-select: none;
355
- -webkit-user-select: none;
356
- -ms-user-select: none;
357
- user-select: none;
358
- }
359
- buttons.buttons-confirm button:hover {
360
- filter: brightness(90%);
361
- }
362
- buttons.buttons-confirm button:active {
363
- color: #ccc;
364
- }
365
-
366
- button.ok {
367
- display: none;
368
- }
369
- button.cancel {
370
- color: white;
371
- background-color: #6c757d;
372
- }
373
226
 
374
227
  div.msg {
375
228
 
@@ -466,7 +319,7 @@ const yl = `
466
319
  }
467
320
  `;
468
321
  var Oe, q, Cn, Tn, On;
469
- class xl extends HTMLElement {
322
+ class bl extends HTMLElement {
470
323
  constructor() {
471
324
  super();
472
325
  W(this, Oe);
@@ -521,11 +374,7 @@ class xl extends HTMLElement {
521
374
  connectedCallback() {
522
375
  const t = this.innerHTML, r = this.getAttribute("title") || "Details";
523
376
  this.innerHTML = `
524
- <style>
525
- ${yl}
526
- ${bl}
527
- ${kl}
528
- </style>
377
+ <style>${yl}</style>
529
378
 
530
379
  <dialog>
531
380
  <div class="head">
@@ -559,7 +408,7 @@ class xl extends HTMLElement {
559
408
  }
560
409
  }
561
410
  Oe = new WeakMap(), q = new WeakMap(), Cn = new WeakMap(), Tn = new WeakMap(), On = new WeakMap();
562
- customElements.get("nine-dialog") || customElements.define("nine-dialog", xl);
411
+ customElements.get("nine-dialog") || customElements.define("nine-dialog", bl);
563
412
  class Ir extends HTMLElement {
564
413
  constructor() {
565
414
  super(), this.attachShadow({ mode: "open" });
@@ -583,7 +432,7 @@ ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
583
432
  "false-text": "No",
584
433
  class: "",
585
434
  animation: "",
586
- ...((d = En.options) == null ? void 0 : d.confirm) || {},
435
+ ...((d = Nn.options) == null ? void 0 : d.confirm) || {},
587
436
  ...r
588
437
  };
589
438
  document.querySelectorAll("nine-confirm-popup").forEach((u) => u.remove());
@@ -618,7 +467,7 @@ ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
618
467
  const i = {
619
468
  class: "",
620
469
  animation: "",
621
- ...((c = En.options) == null ? void 0 : c.alert) || {},
470
+ ...((c = Nn.options) == null ? void 0 : c.alert) || {},
622
471
  ...r
623
472
  };
624
473
  document.querySelectorAll("nine-alert-popup").forEach((d) => d.remove());
@@ -634,11 +483,11 @@ ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
634
483
  });
635
484
  customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Ir);
636
485
  customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Rr);
637
- var ve;
638
- class Sl {
486
+ var Ee;
487
+ class kl {
639
488
  constructor() {
640
489
  // # 키워드로 프라이빗 필드 선언
641
- W(this, ve, "");
490
+ W(this, Ee, "");
642
491
  this.options = {
643
492
  confirm: {
644
493
  "true-text": "확인",
@@ -654,11 +503,11 @@ class Sl {
654
503
  }
655
504
  // Getter
656
505
  get cssPath() {
657
- return T(this, ve);
506
+ return T(this, Ee);
658
507
  }
659
508
  // Setter
660
509
  set cssPath(e) {
661
- oe(this, ve, e);
510
+ oe(this, Ee, e);
662
511
  }
663
512
  /**
664
513
  * 알림창(Alert) 실행
@@ -676,13 +525,13 @@ class Sl {
676
525
  * 컴포넌트별 CSS 경로 생성 헬퍼
677
526
  */
678
527
  getComponentCssPath(e) {
679
- return T(this, ve) ? `${T(this, ve).endsWith("/") ? T(this, ve) : `${T(this, ve)}/`}${e}` : null;
528
+ return T(this, Ee) ? `${T(this, Ee).endsWith("/") ? T(this, Ee) : `${T(this, Ee)}/`}${e}` : null;
680
529
  }
681
530
  }
682
- ve = new WeakMap();
683
- const En = new Sl();
684
- var qt, Ze, jt, ae, Tt, cr, dr, Kt, vn;
685
- class Ml extends HTMLElement {
531
+ Ee = new WeakMap();
532
+ const Nn = new kl();
533
+ var qt, Ze, jt, ae, Tt, cr, dr, Kt, En;
534
+ class xl extends HTMLElement {
686
535
  constructor() {
687
536
  super();
688
537
  W(this, ae);
@@ -728,14 +577,14 @@ class Ml extends HTMLElement {
728
577
  W(this, Kt, (t) => {
729
578
  this.changed = !0;
730
579
  });
731
- W(this, vn, () => {
580
+ W(this, En, () => {
732
581
  for (const t of this.attributes)
733
582
  t.name.startsWith("css-") && this.style.setProperty(t.name.substring(4), t.value);
734
583
  this.originContents = this.innerHTML.trim(), this.innerHTML = "", this.shadowRoot && this.tagName.toLowerCase() === "nx-div" && (this.shadowRoot.innerHTML = this.originContents);
735
584
  });
736
585
  }
737
586
  connectedCallback() {
738
- return T(this, qt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), T(this, vn).call(this), oe(this, qt, !0), !0);
587
+ return T(this, qt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), T(this, En).call(this), oe(this, qt, !0), !0);
739
588
  }
740
589
  get changed() {
741
590
  return T(this, jt);
@@ -778,7 +627,7 @@ dr = function() {
778
627
  Q(this, ae, Tt).call(this).forEach((t) => {
779
628
  t.removeEventListener("input", T(this, Kt)), t.addEventListener("input", T(this, Kt));
780
629
  });
781
- }, Kt = new WeakMap(), vn = new WeakMap();
630
+ }, Kt = new WeakMap(), En = new WeakMap();
782
631
  function j(n) {
783
632
  this.content = n;
784
633
  }
@@ -1416,7 +1265,7 @@ function Ms(n, e, t, r) {
1416
1265
  let l = Ms(o.content, e - s - 1, t, o);
1417
1266
  return l && n.replaceChild(i, o.copy(l));
1418
1267
  }
1419
- function wl(n, e, t) {
1268
+ function Sl(n, e, t) {
1420
1269
  if (t.openStart > n.depth)
1421
1270
  throw new un("Inserted content deeper than insertion position");
1422
1271
  if (n.depth - t.openStart != e.depth - t.openEnd)
@@ -1433,7 +1282,7 @@ function ws(n, e, t, r) {
1433
1282
  let o = n.parent, l = o.content;
1434
1283
  return et(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
1435
1284
  } else {
1436
- let { start: o, end: l } = Cl(t, n);
1285
+ let { start: o, end: l } = Ml(t, n);
1437
1286
  return et(s, Ts(n, o, l, e, r));
1438
1287
  }
1439
1288
  else return et(s, fn(n, e, r));
@@ -1450,7 +1299,7 @@ function Qe(n, e) {
1450
1299
  let t = e.length - 1;
1451
1300
  t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
1452
1301
  }
1453
- function Nt(n, e, t, r) {
1302
+ function vt(n, e, t, r) {
1454
1303
  let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
1455
1304
  n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (Qe(n.nodeAfter, r), s++));
1456
1305
  for (let l = s; l < o; l++)
@@ -1462,17 +1311,17 @@ function et(n, e) {
1462
1311
  }
1463
1312
  function Ts(n, e, t, r, i) {
1464
1313
  let s = n.depth > i && fr(n, e, i + 1), o = r.depth > i && fr(t, r, i + 1), l = [];
1465
- return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Cs(s, o), Qe(et(s, Ts(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, fn(n, e, i + 1)), l), Nt(e, t, i, l), o && Qe(et(o, fn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
1314
+ return vt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Cs(s, o), Qe(et(s, Ts(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, fn(n, e, i + 1)), l), vt(e, t, i, l), o && Qe(et(o, fn(t, r, i + 1)), l)), vt(r, null, i, l), new b(l);
1466
1315
  }
1467
1316
  function fn(n, e, t) {
1468
1317
  let r = [];
1469
- if (Nt(null, n, t, r), n.depth > t) {
1318
+ if (vt(null, n, t, r), n.depth > t) {
1470
1319
  let i = fr(n, e, t + 1);
1471
1320
  Qe(et(i, fn(n, e, t + 1)), r);
1472
1321
  }
1473
- return Nt(e, null, t, r), new b(r);
1322
+ return vt(e, null, t, r), new b(r);
1474
1323
  }
1475
- function Cl(n, e) {
1324
+ function Ml(n, e) {
1476
1325
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
1477
1326
  for (let s = t - 1; s >= 0; s--)
1478
1327
  i = e.node(s).copy(b.from(i));
@@ -1723,17 +1572,17 @@ class Rt {
1723
1572
  return o;
1724
1573
  }
1725
1574
  else
1726
- si.set(e, r = new Tl());
1575
+ si.set(e, r = new wl());
1727
1576
  let i = r.elts[r.i] = Rt.resolve(e, t);
1728
- return r.i = (r.i + 1) % Ol, i;
1577
+ return r.i = (r.i + 1) % Cl, i;
1729
1578
  }
1730
1579
  }
1731
- class Tl {
1580
+ class wl {
1732
1581
  constructor() {
1733
1582
  this.elts = [], this.i = 0;
1734
1583
  }
1735
1584
  }
1736
- const Ol = 12, si = /* @__PURE__ */ new WeakMap();
1585
+ const Cl = 12, si = /* @__PURE__ */ new WeakMap();
1737
1586
  class hn {
1738
1587
  /**
1739
1588
  Construct a node range. `$from` and `$to` should point into the
@@ -1774,7 +1623,7 @@ class hn {
1774
1623
  return this.$to.indexAfter(this.depth);
1775
1624
  }
1776
1625
  }
1777
- const vl = /* @__PURE__ */ Object.create(null);
1626
+ const Tl = /* @__PURE__ */ Object.create(null);
1778
1627
  let Fe = class hr {
1779
1628
  /**
1780
1629
  @internal
@@ -1893,7 +1742,7 @@ let Fe = class hr {
1893
1742
  attributes, and marks.
1894
1743
  */
1895
1744
  hasMarkup(e, t, r) {
1896
- return this.type == e && dn(this.attrs, t || e.defaultAttrs || vl) && A.sameSet(this.marks, r || A.none);
1745
+ return this.type == e && dn(this.attrs, t || e.defaultAttrs || Tl) && A.sameSet(this.marks, r || A.none);
1897
1746
  }
1898
1747
  /**
1899
1748
  Create a new node with the same markup as this node, containing
@@ -1936,7 +1785,7 @@ let Fe = class hr {
1936
1785
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
1937
1786
  */
1938
1787
  replace(e, t, r) {
1939
- return wl(this.resolve(e), this.resolve(t), r);
1788
+ return Sl(this.resolve(e), this.resolve(t), r);
1940
1789
  }
1941
1790
  /**
1942
1791
  Find the node directly after the given position.
@@ -2199,13 +2048,13 @@ class it {
2199
2048
  @internal
2200
2049
  */
2201
2050
  static parse(e, t) {
2202
- let r = new El(e, t);
2051
+ let r = new Ol(e, t);
2203
2052
  if (r.next == null)
2204
2053
  return it.empty;
2205
- let i = vs(r);
2054
+ let i = Es(r);
2206
2055
  r.next && r.err("Unexpected trailing text");
2207
- let s = Bl(Pl(i));
2208
- return Ll(s, r), s;
2056
+ let s = Rl(Il(i));
2057
+ return Pl(s, r), s;
2209
2058
  }
2210
2059
  /**
2211
2060
  Match a node type, returning a match after that node if
@@ -2351,7 +2200,7 @@ class it {
2351
2200
  }
2352
2201
  }
2353
2202
  it.empty = new it(!0);
2354
- class El {
2203
+ class Ol {
2355
2204
  constructor(e, t) {
2356
2205
  this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
2357
2206
  }
@@ -2365,22 +2214,22 @@ class El {
2365
2214
  throw new SyntaxError(e + " (in content expression '" + this.string + "')");
2366
2215
  }
2367
2216
  }
2368
- function vs(n) {
2217
+ function Es(n) {
2369
2218
  let e = [];
2370
2219
  do
2371
- e.push(Nl(n));
2220
+ e.push(El(n));
2372
2221
  while (n.eat("|"));
2373
2222
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
2374
2223
  }
2375
- function Nl(n) {
2224
+ function El(n) {
2376
2225
  let e = [];
2377
2226
  do
2378
- e.push(Al(n));
2227
+ e.push(Nl(n));
2379
2228
  while (n.next && n.next != ")" && n.next != "|");
2380
2229
  return e.length == 1 ? e[0] : { type: "seq", exprs: e };
2381
2230
  }
2382
- function Al(n) {
2383
- let e = Rl(n);
2231
+ function Nl(n) {
2232
+ let e = Dl(n);
2384
2233
  for (; ; )
2385
2234
  if (n.eat("+"))
2386
2235
  e = { type: "plus", expr: e };
@@ -2389,7 +2238,7 @@ function Al(n) {
2389
2238
  else if (n.eat("?"))
2390
2239
  e = { type: "opt", expr: e };
2391
2240
  else if (n.eat("{"))
2392
- e = Dl(n, e);
2241
+ e = vl(n, e);
2393
2242
  else
2394
2243
  break;
2395
2244
  return e;
@@ -2399,11 +2248,11 @@ function oi(n) {
2399
2248
  let e = Number(n.next);
2400
2249
  return n.pos++, e;
2401
2250
  }
2402
- function Dl(n, e) {
2251
+ function vl(n, e) {
2403
2252
  let t = oi(n), r = t;
2404
2253
  return n.eat(",") && (n.next != "}" ? r = oi(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
2405
2254
  }
2406
- function Il(n, e) {
2255
+ function Al(n, e) {
2407
2256
  let t = n.nodeTypes, r = t[e];
2408
2257
  if (r)
2409
2258
  return [r];
@@ -2414,18 +2263,18 @@ function Il(n, e) {
2414
2263
  }
2415
2264
  return i.length == 0 && n.err("No node type or group '" + e + "' found"), i;
2416
2265
  }
2417
- function Rl(n) {
2266
+ function Dl(n) {
2418
2267
  if (n.eat("(")) {
2419
- let e = vs(n);
2268
+ let e = Es(n);
2420
2269
  return n.eat(")") || n.err("Missing closing paren"), e;
2421
2270
  } else if (/\W/.test(n.next))
2422
2271
  n.err("Unexpected token '" + n.next + "'");
2423
2272
  else {
2424
- let e = Il(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2273
+ let e = Al(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2425
2274
  return n.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
2426
2275
  }
2427
2276
  }
2428
- function Pl(n) {
2277
+ function Il(n) {
2429
2278
  let e = [[]];
2430
2279
  return i(s(n, 0), t()), e;
2431
2280
  function t() {
@@ -2479,12 +2328,12 @@ function Pl(n) {
2479
2328
  }
2480
2329
  }
2481
2330
  }
2482
- function Es(n, e) {
2331
+ function Ns(n, e) {
2483
2332
  return e - n;
2484
2333
  }
2485
2334
  function li(n, e) {
2486
2335
  let t = [];
2487
- return r(e), t.sort(Es);
2336
+ return r(e), t.sort(Ns);
2488
2337
  function r(i) {
2489
2338
  let s = n[i];
2490
2339
  if (s.length == 1 && !s[0].term)
@@ -2496,7 +2345,7 @@ function li(n, e) {
2496
2345
  }
2497
2346
  }
2498
2347
  }
2499
- function Bl(n) {
2348
+ function Rl(n) {
2500
2349
  let e = /* @__PURE__ */ Object.create(null);
2501
2350
  return t(li(n, 0));
2502
2351
  function t(r) {
@@ -2515,13 +2364,13 @@ function Bl(n) {
2515
2364
  });
2516
2365
  let s = e[r.join(",")] = new it(r.indexOf(n.length - 1) > -1);
2517
2366
  for (let o = 0; o < i.length; o++) {
2518
- let l = i[o][1].sort(Es);
2367
+ let l = i[o][1].sort(Ns);
2519
2368
  s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
2520
2369
  }
2521
2370
  return s;
2522
2371
  }
2523
2372
  }
2524
- function Ll(n, e) {
2373
+ function Pl(n, e) {
2525
2374
  for (let t = 0, r = [n]; t < r.length; t++) {
2526
2375
  let i = r[t], s = !i.validEnd, o = [];
2527
2376
  for (let l = 0; l < i.next.length; l++) {
@@ -2531,7 +2380,7 @@ function Ll(n, e) {
2531
2380
  s && e.err("Only non-generatable nodes (" + o.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
2532
2381
  }
2533
2382
  }
2534
- function Ns(n) {
2383
+ function vs(n) {
2535
2384
  let e = /* @__PURE__ */ Object.create(null);
2536
2385
  for (let t in n) {
2537
2386
  let r = n[t];
@@ -2569,7 +2418,7 @@ function Is(n, e) {
2569
2418
  let t = /* @__PURE__ */ Object.create(null);
2570
2419
  if (e)
2571
2420
  for (let r in e)
2572
- t[r] = new Fl(n, r, e[r]);
2421
+ t[r] = new Ll(n, r, e[r]);
2573
2422
  return t;
2574
2423
  }
2575
2424
  let ai = class Rs {
@@ -2577,7 +2426,7 @@ let ai = class Rs {
2577
2426
  @internal
2578
2427
  */
2579
2428
  constructor(e, t, r) {
2580
- this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Is(e, r.attrs), this.defaultAttrs = Ns(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
2429
+ this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Is(e, r.attrs), this.defaultAttrs = vs(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
2581
2430
  }
2582
2431
  /**
2583
2432
  True if this is an inline type.
@@ -2751,7 +2600,7 @@ let ai = class Rs {
2751
2600
  return r;
2752
2601
  }
2753
2602
  };
2754
- function zl(n, e, t) {
2603
+ function Bl(n, e, t) {
2755
2604
  let r = t.split("|");
2756
2605
  return (i) => {
2757
2606
  let s = i === null ? "null" : typeof i;
@@ -2759,21 +2608,21 @@ function zl(n, e, t) {
2759
2608
  throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`);
2760
2609
  };
2761
2610
  }
2762
- class Fl {
2611
+ class Ll {
2763
2612
  constructor(e, t, r) {
2764
- this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? zl(e, t, r.validate) : r.validate;
2613
+ this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? Bl(e, t, r.validate) : r.validate;
2765
2614
  }
2766
2615
  get isRequired() {
2767
2616
  return !this.hasDefault;
2768
2617
  }
2769
2618
  }
2770
- class Nn {
2619
+ class vn {
2771
2620
  /**
2772
2621
  @internal
2773
2622
  */
2774
2623
  constructor(e, t, r, i) {
2775
2624
  this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs = Is(e, i.attrs), this.excluded = null;
2776
- let s = Ns(this.attrs);
2625
+ let s = vs(this.attrs);
2777
2626
  this.instance = s ? new A(this, s) : null;
2778
2627
  }
2779
2628
  /**
@@ -2789,7 +2638,7 @@ class Nn {
2789
2638
  */
2790
2639
  static compile(e, t) {
2791
2640
  let r = /* @__PURE__ */ Object.create(null), i = 0;
2792
- return e.forEach((s, o) => r[s] = new Nn(s, i++, t, o)), r;
2641
+ return e.forEach((s, o) => r[s] = new vn(s, i++, t, o)), r;
2793
2642
  }
2794
2643
  /**
2795
2644
  When there is a mark of this type in the given set, a new set
@@ -2831,7 +2680,7 @@ class Ps {
2831
2680
  let t = this.spec = {};
2832
2681
  for (let i in e)
2833
2682
  t[i] = e[i];
2834
- t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = Nn.compile(this.spec.marks, this);
2683
+ t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = vn.compile(this.spec.marks, this);
2835
2684
  let r = /* @__PURE__ */ Object.create(null);
2836
2685
  for (let i in this.nodes) {
2837
2686
  if (i in this.marks)
@@ -2907,10 +2756,10 @@ function ci(n, e) {
2907
2756
  }
2908
2757
  return t;
2909
2758
  }
2910
- function $l(n) {
2759
+ function zl(n) {
2911
2760
  return n.tag != null;
2912
2761
  }
2913
- function Vl(n) {
2762
+ function Fl(n) {
2914
2763
  return n.style != null;
2915
2764
  }
2916
2765
  class $e {
@@ -2922,9 +2771,9 @@ class $e {
2922
2771
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
2923
2772
  let r = this.matchedStyles = [];
2924
2773
  t.forEach((i) => {
2925
- if ($l(i))
2774
+ if (zl(i))
2926
2775
  this.tags.push(i);
2927
- else if (Vl(i)) {
2776
+ else if (Fl(i)) {
2928
2777
  let s = /[^=]*/.exec(i.style)[0];
2929
2778
  r.indexOf(s) < 0 && r.push(s), this.styles.push(i);
2930
2779
  }
@@ -2960,7 +2809,7 @@ class $e {
2960
2809
  matchTag(e, t, r) {
2961
2810
  for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
2962
2811
  let s = this.tags[i];
2963
- if (ql(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2812
+ if (Hl(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2964
2813
  if (s.getAttrs) {
2965
2814
  let o = s.getAttrs(e);
2966
2815
  if (o === !1)
@@ -3061,7 +2910,7 @@ const Bs = {
3061
2910
  table: !0,
3062
2911
  tfoot: !0,
3063
2912
  ul: !0
3064
- }, Hl = {
2913
+ }, $l = {
3065
2914
  head: !0,
3066
2915
  noscript: !0,
3067
2916
  object: !0,
@@ -3148,9 +2997,9 @@ class ui {
3148
2997
  let i = this.localPreserveWS, s = this.top;
3149
2998
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3150
2999
  let o = e.nodeName.toLowerCase(), l;
3151
- Ls.hasOwnProperty(o) && this.parser.normalizeLists && Wl(e);
3000
+ Ls.hasOwnProperty(o) && this.parser.normalizeLists && Vl(e);
3152
3001
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
3153
- e: if (a ? a.ignore : Hl.hasOwnProperty(o))
3002
+ e: if (a ? a.ignore : $l.hasOwnProperty(o))
3154
3003
  this.findInside(e), this.ignoreFallback(e, t);
3155
3004
  else if (!a || a.skip || a.closeParent) {
3156
3005
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3387,13 +3236,13 @@ class ui {
3387
3236
  }
3388
3237
  }
3389
3238
  }
3390
- function Wl(n) {
3239
+ function Vl(n) {
3391
3240
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3392
3241
  let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3393
3242
  r && Ls.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
3394
3243
  }
3395
3244
  }
3396
- function ql(n, e) {
3245
+ function Hl(n, e) {
3397
3246
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3398
3247
  }
3399
3248
  function fi(n) {
@@ -3536,11 +3385,11 @@ function jn(n) {
3536
3385
  return n.document || window.document;
3537
3386
  }
3538
3387
  const mi = /* @__PURE__ */ new WeakMap();
3539
- function jl(n) {
3388
+ function Wl(n) {
3540
3389
  let e = mi.get(n);
3541
- return e === void 0 && mi.set(n, e = Kl(n)), e;
3390
+ return e === void 0 && mi.set(n, e = ql(n)), e;
3542
3391
  }
3543
- function Kl(n) {
3392
+ function ql(n) {
3544
3393
  let e = null;
3545
3394
  function t(r) {
3546
3395
  if (r && typeof r == "object")
@@ -3566,7 +3415,7 @@ function on(n, e, t, r) {
3566
3415
  let i = e[0], s;
3567
3416
  if (typeof i != "string")
3568
3417
  throw new RangeError("Invalid array passed to renderSpec");
3569
- if (r && (s = jl(r)) && s.indexOf(e) > -1)
3418
+ if (r && (s = Wl(r)) && s.indexOf(e) > -1)
3570
3419
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3571
3420
  let o = i.indexOf(" ");
3572
3421
  o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
@@ -3597,13 +3446,13 @@ function on(n, e, t, r) {
3597
3446
  return { dom: a, contentDOM: l };
3598
3447
  }
3599
3448
  const zs = 65535, Fs = Math.pow(2, 16);
3600
- function Jl(n, e) {
3449
+ function jl(n, e) {
3601
3450
  return n + e * Fs;
3602
3451
  }
3603
3452
  function gi(n) {
3604
3453
  return n & zs;
3605
3454
  }
3606
- function Ul(n) {
3455
+ function Kl(n) {
3607
3456
  return (n - (n & zs)) / Fs;
3608
3457
  }
3609
3458
  const $s = 1, Vs = 2, ln = 4, Hs = 8;
@@ -3661,7 +3510,7 @@ class le {
3661
3510
  if (!this.inverted)
3662
3511
  for (let i = 0; i < r; i++)
3663
3512
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
3664
- return this.ranges[r * 3] + t + Ul(e);
3513
+ return this.ranges[r * 3] + t + Kl(e);
3665
3514
  }
3666
3515
  mapResult(e, t = 1) {
3667
3516
  return this._map(e, t, !1);
@@ -3683,7 +3532,7 @@ class le {
3683
3532
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
3684
3533
  if (r)
3685
3534
  return h;
3686
- let p = e == (t < 0 ? a : u) ? null : Jl(l / 3, e - a), m = e == a ? Vs : e == u ? $s : ln;
3535
+ let p = e == (t < 0 ? a : u) ? null : jl(l / 3, e - a), m = e == a ? Vs : e == u ? $s : ln;
3687
3536
  return (t < 0 ? e != a : e != u) && (m |= Hs), new mr(h, m, p);
3688
3537
  }
3689
3538
  i += d - c;
@@ -4213,7 +4062,7 @@ function gr(n, e, t) {
4213
4062
  }
4214
4063
  return !1;
4215
4064
  }
4216
- function _l(n, e, t, r) {
4065
+ function Jl(n, e, t, r) {
4217
4066
  let i = [], s = [], o, l;
4218
4067
  n.doc.nodesBetween(e, t, (a, c, d) => {
4219
4068
  if (!a.isInline)
@@ -4227,14 +4076,14 @@ function _l(n, e, t, r) {
4227
4076
  }
4228
4077
  }), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
4229
4078
  }
4230
- function Gl(n, e, t, r) {
4079
+ function Ul(n, e, t, r) {
4231
4080
  let i = [], s = 0;
4232
4081
  n.doc.nodesBetween(e, t, (o, l) => {
4233
4082
  if (!o.isInline)
4234
4083
  return;
4235
4084
  s++;
4236
4085
  let a = null;
4237
- if (r instanceof Nn) {
4086
+ if (r instanceof vn) {
4238
4087
  let c = o.marks, d;
4239
4088
  for (; d = r.isInSet(c); )
4240
4089
  (a || (a = [])).push(d), c = d.removeFromSet(c);
@@ -4277,7 +4126,7 @@ function Br(n, e, t, r = t.contentMatch, i = !0) {
4277
4126
  for (let a = o.length - 1; a >= 0; a--)
4278
4127
  n.step(o[a]);
4279
4128
  }
4280
- function Yl(n, e, t) {
4129
+ function _l(n, e, t) {
4281
4130
  return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
4282
4131
  }
4283
4132
  function wt(n) {
@@ -4286,13 +4135,13 @@ function wt(n) {
4286
4135
  let o = n.$from.node(r), l = n.$from.index(r) + i, a = n.$to.indexAfter(r) - s;
4287
4136
  if (r < n.depth && o.canReplace(l, a, t))
4288
4137
  return r;
4289
- if (r == 0 || o.type.spec.isolating || !Yl(o, l, a))
4138
+ if (r == 0 || o.type.spec.isolating || !_l(o, l, a))
4290
4139
  break;
4291
4140
  l && (i = 1), a < o.childCount && (s = 1);
4292
4141
  }
4293
4142
  return null;
4294
4143
  }
4295
- function Xl(n, e, t) {
4144
+ function Gl(n, e, t) {
4296
4145
  let { $from: r, $to: i, depth: s } = e, o = r.before(s + 1), l = i.after(s + 1), a = o, c = l, d = b.empty, u = 0;
4297
4146
  for (let p = s, m = !1; p > t; p--)
4298
4147
  m || r.index(p) > 0 ? (m = !0, d = b.from(r.node(p).copy(d)), u++) : a--;
@@ -4302,20 +4151,20 @@ function Xl(n, e, t) {
4302
4151
  n.step(new F(a, c, o, l, new k(d.append(f), u, h), d.size - u, !0));
4303
4152
  }
4304
4153
  function Lr(n, e, t = null, r = n) {
4305
- let i = Zl(n, e), s = i && Ql(r, e);
4154
+ let i = Yl(n, e), s = i && Xl(r, e);
4306
4155
  return s ? i.map(yi).concat({ type: e, attrs: t }).concat(s.map(yi)) : null;
4307
4156
  }
4308
4157
  function yi(n) {
4309
4158
  return { type: n, attrs: null };
4310
4159
  }
4311
- function Zl(n, e) {
4160
+ function Yl(n, e) {
4312
4161
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.contentMatchAt(r).findWrapping(e);
4313
4162
  if (!s)
4314
4163
  return null;
4315
4164
  let o = s.length ? s[0] : e;
4316
4165
  return t.canReplaceWith(r, i, o) ? s : null;
4317
4166
  }
4318
- function Ql(n, e) {
4167
+ function Xl(n, e) {
4319
4168
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.child(r), o = e.contentMatch.findWrapping(s.type);
4320
4169
  if (!o)
4321
4170
  return null;
@@ -4324,7 +4173,7 @@ function Ql(n, e) {
4324
4173
  a = a.matchType(t.child(c).type);
4325
4174
  return !a || !a.validEnd ? null : o;
4326
4175
  }
4327
- function ea(n, e, t) {
4176
+ function Zl(n, e, t) {
4328
4177
  let r = b.empty;
4329
4178
  for (let o = t.length - 1; o >= 0; o--) {
4330
4179
  if (r.size) {
@@ -4337,13 +4186,13 @@ function ea(n, e, t) {
4337
4186
  let i = e.start, s = e.end;
4338
4187
  n.step(new F(i, s, i, s, new k(r, 0, 0), t.length, !0));
4339
4188
  }
4340
- function ta(n, e, t, r, i) {
4189
+ function Ql(n, e, t, r, i) {
4341
4190
  if (!r.isTextblock)
4342
4191
  throw new RangeError("Type given to setBlockType should be a textblock");
4343
4192
  let s = n.steps.length;
4344
4193
  n.doc.nodesBetween(e, t, (o, l) => {
4345
4194
  let a = typeof i == "function" ? i(o) : i;
4346
- if (o.isTextblock && !o.hasMarkup(r, a) && na(n.doc, n.mapping.slice(s).map(l), r)) {
4195
+ if (o.isTextblock && !o.hasMarkup(r, a) && ea(n.doc, n.mapping.slice(s).map(l), r)) {
4347
4196
  let c = null;
4348
4197
  if (r.schema.linebreakReplacement) {
4349
4198
  let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
@@ -4375,11 +4224,11 @@ function qs(n, e, t, r) {
4375
4224
  }
4376
4225
  });
4377
4226
  }
4378
- function na(n, e, t) {
4227
+ function ea(n, e, t) {
4379
4228
  let r = n.resolve(e), i = r.index();
4380
4229
  return r.parent.canReplaceWith(i, i + 1, t);
4381
4230
  }
4382
- function ra(n, e, t, r, i) {
4231
+ function ta(n, e, t, r, i) {
4383
4232
  let s = n.doc.nodeAt(e);
4384
4233
  if (!s)
4385
4234
  throw new RangeError("No node at given position");
@@ -4391,7 +4240,7 @@ function ra(n, e, t, r, i) {
4391
4240
  throw new RangeError("Invalid content for node type " + t.name);
4392
4241
  n.step(new F(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(b.from(o), 0, 0), 1, !0));
4393
4242
  }
4394
- function Ne(n, e, t = 1, r) {
4243
+ function ve(n, e, t = 1, r) {
4395
4244
  let i = n.resolve(e), s = i.depth - t, o = r && r[r.length - 1] || i.parent;
4396
4245
  if (s < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
4397
4246
  return !1;
@@ -4408,7 +4257,7 @@ function Ne(n, e, t = 1, r) {
4408
4257
  let l = i.indexAfter(s), a = r && r[0];
4409
4258
  return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
4410
4259
  }
4411
- function ia(n, e, t = 1, r) {
4260
+ function na(n, e, t = 1, r) {
4412
4261
  let i = n.doc.resolve(e), s = b.empty, o = b.empty;
4413
4262
  for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
4414
4263
  s = b.from(i.node(l).copy(s));
@@ -4421,7 +4270,7 @@ function je(n, e) {
4421
4270
  let t = n.resolve(e), r = t.index();
4422
4271
  return js(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
4423
4272
  }
4424
- function sa(n, e) {
4273
+ function ra(n, e) {
4425
4274
  e.content.size || n.type.compatibleContent(e.type);
4426
4275
  let t = n.contentMatchAt(n.childCount), { linebreakReplacement: r } = n.type.schema;
4427
4276
  for (let i = 0; i < e.childCount; i++) {
@@ -4432,7 +4281,7 @@ function sa(n, e) {
4432
4281
  return t.validEnd;
4433
4282
  }
4434
4283
  function js(n, e) {
4435
- return !!(n && e && !n.isLeaf && sa(n, e));
4284
+ return !!(n && e && !n.isLeaf && ra(n, e));
4436
4285
  }
4437
4286
  function An(n, e, t = -1) {
4438
4287
  let r = n.resolve(e);
@@ -4445,7 +4294,7 @@ function An(n, e, t = -1) {
4445
4294
  e = t < 0 ? r.before(i) : r.after(i);
4446
4295
  }
4447
4296
  }
4448
- function oa(n, e, t) {
4297
+ function ia(n, e, t) {
4449
4298
  let r = null, { linebreakReplacement: i } = n.doc.type.schema, s = n.doc.resolve(e - t), o = s.node().type;
4450
4299
  if (i && o.inlineContent) {
4451
4300
  let d = o.whitespace == "pre", u = !!o.contentMatch.matchType(i);
@@ -4464,7 +4313,7 @@ function oa(n, e, t) {
4464
4313
  }
4465
4314
  return n;
4466
4315
  }
4467
- function la(n, e, t) {
4316
+ function sa(n, e, t) {
4468
4317
  let r = n.resolve(e);
4469
4318
  if (r.parent.canReplaceWith(r.index(), r.index(), t))
4470
4319
  return e;
@@ -4511,12 +4360,12 @@ function Dn(n, e, t = e, r = k.empty) {
4511
4360
  if (e == t && !r.size)
4512
4361
  return null;
4513
4362
  let i = n.resolve(e), s = n.resolve(t);
4514
- return Js(i, s, r) ? new P(e, t, r) : new aa(i, s, r).fit();
4363
+ return Js(i, s, r) ? new P(e, t, r) : new oa(i, s, r).fit();
4515
4364
  }
4516
4365
  function Js(n, e, t) {
4517
4366
  return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
4518
4367
  }
4519
- class aa {
4368
+ class oa {
4520
4369
  constructor(e, t, r) {
4521
4370
  this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = b.empty;
4522
4371
  for (let i = 0; i <= e.depth; i++) {
@@ -4610,7 +4459,7 @@ class aa {
4610
4459
  c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(Us(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
4611
4460
  }
4612
4461
  let p = c == l.childCount;
4613
- p || (h = -1), this.placed = vt(this.placed, t, b.from(d)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4462
+ p || (h = -1), this.placed = Et(this.placed, t, b.from(d)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
4614
4463
  for (let m = 0, g = l; m < h; m++) {
4615
4464
  let y = g.lastChild;
4616
4465
  this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
@@ -4647,7 +4496,7 @@ class aa {
4647
4496
  return null;
4648
4497
  for (; this.depth > t.depth; )
4649
4498
  this.closeFrontierNode();
4650
- t.fit.childCount && (this.placed = vt(this.placed, t.depth, t.fit)), e = t.move;
4499
+ t.fit.childCount && (this.placed = Et(this.placed, t.depth, t.fit)), e = t.move;
4651
4500
  for (let r = t.depth + 1; r <= e.depth; r++) {
4652
4501
  let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
4653
4502
  this.openFrontierNode(i.type, i.attrs, s);
@@ -4656,18 +4505,18 @@ class aa {
4656
4505
  }
4657
4506
  openFrontierNode(e, t = null, r) {
4658
4507
  let i = this.frontier[this.depth];
4659
- i.match = i.match.matchType(e), this.placed = vt(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
4508
+ i.match = i.match.matchType(e), this.placed = Et(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
4660
4509
  }
4661
4510
  closeFrontierNode() {
4662
4511
  let t = this.frontier.pop().match.fillBefore(b.empty, !0);
4663
- t.childCount && (this.placed = vt(this.placed, this.frontier.length, t));
4512
+ t.childCount && (this.placed = Et(this.placed, this.frontier.length, t));
4664
4513
  }
4665
4514
  }
4666
4515
  function Ot(n, e, t) {
4667
4516
  return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Ot(n.firstChild.content, e - 1, t)));
4668
4517
  }
4669
- function vt(n, e, t) {
4670
- return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(vt(n.lastChild.content, e - 1, t)));
4518
+ function Et(n, e, t) {
4519
+ return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Et(n.lastChild.content, e - 1, t)));
4671
4520
  }
4672
4521
  function Jn(n, e) {
4673
4522
  for (let t = 0; t < e; t++)
@@ -4685,18 +4534,18 @@ function Un(n, e, t, r, i) {
4685
4534
  if (o == s.childCount && !t.compatibleContent(s.type))
4686
4535
  return null;
4687
4536
  let l = r.fillBefore(s.content, !0, o);
4688
- return l && !ca(t, s.content, o) ? l : null;
4537
+ return l && !la(t, s.content, o) ? l : null;
4689
4538
  }
4690
- function ca(n, e, t) {
4539
+ function la(n, e, t) {
4691
4540
  for (let r = t; r < e.childCount; r++)
4692
4541
  if (!n.allowsMarks(e.child(r).marks))
4693
4542
  return !0;
4694
4543
  return !1;
4695
4544
  }
4696
- function da(n) {
4545
+ function aa(n) {
4697
4546
  return n.spec.defining || n.spec.definingForContent;
4698
4547
  }
4699
- function ua(n, e, t, r) {
4548
+ function ca(n, e, t, r) {
4700
4549
  if (!r.size)
4701
4550
  return n.deleteRange(e, t);
4702
4551
  let i = n.doc.resolve(e), s = n.doc.resolve(t);
@@ -4720,7 +4569,7 @@ function ua(n, e, t, r) {
4720
4569
  f = p.content;
4721
4570
  }
4722
4571
  for (let f = d - 1; f >= 0; f--) {
4723
- let h = c[f], p = da(h.type);
4572
+ let h = c[f], p = aa(h.type);
4724
4573
  if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
4725
4574
  d = f;
4726
4575
  else if (p || !h.type.isTextblock)
@@ -4754,14 +4603,14 @@ function _s(n, e, t, r, i) {
4754
4603
  }
4755
4604
  return n;
4756
4605
  }
4757
- function fa(n, e, t, r) {
4606
+ function da(n, e, t, r) {
4758
4607
  if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
4759
- let i = la(n.doc, e, r.type);
4608
+ let i = sa(n.doc, e, r.type);
4760
4609
  i != null && (e = t = i);
4761
4610
  }
4762
4611
  n.replaceRange(e, t, new k(b.from(r), 0, 0));
4763
4612
  }
4764
- function ha(n, e, t) {
4613
+ function ua(n, e, t) {
4765
4614
  let r = n.doc.resolve(e), i = n.doc.resolve(t);
4766
4615
  if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
4767
4616
  let o = r.sharedDepth(t), l = !1;
@@ -4881,7 +4730,7 @@ kt = function n(e) {
4881
4730
  kt.prototype = Object.create(Error.prototype);
4882
4731
  kt.prototype.constructor = kt;
4883
4732
  kt.prototype.name = "TransformError";
4884
- class pa {
4733
+ class fa {
4885
4734
  /**
4886
4735
  Create a transform that starts with the given document.
4887
4736
  */
@@ -4988,7 +4837,7 @@ class pa {
4988
4837
  control over what happens.
4989
4838
  */
4990
4839
  replaceRange(e, t, r) {
4991
- return ua(this, e, t, r), this;
4840
+ return ca(this, e, t, r), this;
4992
4841
  }
4993
4842
  /**
4994
4843
  Replace the given range with a node, but use `from` and `to` as
@@ -5000,14 +4849,14 @@ class pa {
5000
4849
  that parent node.
5001
4850
  */
5002
4851
  replaceRangeWith(e, t, r) {
5003
- return fa(this, e, t, r), this;
4852
+ return da(this, e, t, r), this;
5004
4853
  }
5005
4854
  /**
5006
4855
  Delete the given range, expanding it to cover fully covered
5007
4856
  parent nodes until a valid replace is found.
5008
4857
  */
5009
4858
  deleteRange(e, t) {
5010
- return ha(this, e, t), this;
4859
+ return ua(this, e, t), this;
5011
4860
  }
5012
4861
  /**
5013
4862
  Split the content in the given range off from its parent, if there
@@ -5017,14 +4866,14 @@ class pa {
5017
4866
  sure the lift is valid.
5018
4867
  */
5019
4868
  lift(e, t) {
5020
- return Xl(this, e, t), this;
4869
+ return Gl(this, e, t), this;
5021
4870
  }
5022
4871
  /**
5023
4872
  Join the blocks around the given position. If depth is 2, their
5024
4873
  last and first siblings are also joined, and so on.
5025
4874
  */
5026
4875
  join(e, t = 1) {
5027
- return oa(this, e, t), this;
4876
+ return ia(this, e, t), this;
5028
4877
  }
5029
4878
  /**
5030
4879
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
@@ -5032,21 +4881,21 @@ class pa {
5032
4881
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
5033
4882
  */
5034
4883
  wrap(e, t) {
5035
- return ea(this, e, t), this;
4884
+ return Zl(this, e, t), this;
5036
4885
  }
5037
4886
  /**
5038
4887
  Set the type of all textblocks (partly) between `from` and `to` to
5039
4888
  the given node type with the given attributes.
5040
4889
  */
5041
4890
  setBlockType(e, t = e, r, i = null) {
5042
- return ta(this, e, t, r, i), this;
4891
+ return Ql(this, e, t, r, i), this;
5043
4892
  }
5044
4893
  /**
5045
4894
  Change the type, attributes, and/or marks of the node at `pos`.
5046
4895
  When `type` isn't given, the existing node type is preserved,
5047
4896
  */
5048
4897
  setNodeMarkup(e, t, r = null, i) {
5049
- return ra(this, e, t, r, i), this;
4898
+ return ta(this, e, t, r, i), this;
5050
4899
  }
5051
4900
  /**
5052
4901
  Set a single attribute on a given node to a new value.
@@ -5095,13 +4944,13 @@ class pa {
5095
4944
  use after the split (with the outermost nodes coming first).
5096
4945
  */
5097
4946
  split(e, t = 1, r) {
5098
- return ia(this, e, t, r), this;
4947
+ return na(this, e, t, r), this;
5099
4948
  }
5100
4949
  /**
5101
4950
  Add the given mark to the inline content between `from` and `to`.
5102
4951
  */
5103
4952
  addMark(e, t, r) {
5104
- return _l(this, e, t, r), this;
4953
+ return Jl(this, e, t, r), this;
5105
4954
  }
5106
4955
  /**
5107
4956
  Remove marks from inline nodes between `from` and `to`. When
@@ -5110,7 +4959,7 @@ class pa {
5110
4959
  remove all marks of any type.
5111
4960
  */
5112
4961
  removeMark(e, t, r) {
5113
- return Gl(this, e, t, r), this;
4962
+ return Ul(this, e, t, r), this;
5114
4963
  }
5115
4964
  /**
5116
4965
  Removes all marks and nodes from the content of the node at
@@ -5123,14 +4972,14 @@ class pa {
5123
4972
  }
5124
4973
  }
5125
4974
  const _n = /* @__PURE__ */ Object.create(null);
5126
- class v {
4975
+ class E {
5127
4976
  /**
5128
4977
  Initialize a selection with the head and anchor and ranges. If no
5129
4978
  ranges are given, constructs a single range across `$anchor` and
5130
4979
  `$head`.
5131
4980
  */
5132
4981
  constructor(e, t, r) {
5133
- this.$anchor = e, this.$head = t, this.ranges = r || [new ma(e.min(t), e.max(t))];
4982
+ this.$anchor = e, this.$head = t, this.ranges = r || [new ha(e.min(t), e.max(t))];
5134
4983
  }
5135
4984
  /**
5136
4985
  The selection's anchor, as an unresolved position.
@@ -5287,8 +5136,8 @@ class v {
5287
5136
  return M.between(this.$anchor, this.$head).getBookmark();
5288
5137
  }
5289
5138
  }
5290
- v.prototype.visible = !0;
5291
- class ma {
5139
+ E.prototype.visible = !0;
5140
+ class ha {
5292
5141
  /**
5293
5142
  Create a range.
5294
5143
  */
@@ -5300,7 +5149,7 @@ let bi = !1;
5300
5149
  function ki(n) {
5301
5150
  !bi && !n.parent.inlineContent && (bi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
5302
5151
  }
5303
- class M extends v {
5152
+ class M extends E {
5304
5153
  /**
5305
5154
  Construct a text selection between the given points.
5306
5155
  */
@@ -5317,7 +5166,7 @@ class M extends v {
5317
5166
  map(e, t) {
5318
5167
  let r = e.resolve(t.map(this.head));
5319
5168
  if (!r.parent.inlineContent)
5320
- return v.near(r);
5169
+ return E.near(r);
5321
5170
  let i = e.resolve(t.map(this.anchor));
5322
5171
  return new M(i.parent.inlineContent ? i : r, r);
5323
5172
  }
@@ -5362,16 +5211,16 @@ class M extends v {
5362
5211
  static between(e, t, r) {
5363
5212
  let i = e.pos - t.pos;
5364
5213
  if ((!r || i) && (r = i >= 0 ? 1 : -1), !t.parent.inlineContent) {
5365
- let s = v.findFrom(t, r, !0) || v.findFrom(t, -r, !0);
5214
+ let s = E.findFrom(t, r, !0) || E.findFrom(t, -r, !0);
5366
5215
  if (s)
5367
5216
  t = s.$head;
5368
5217
  else
5369
- return v.near(t, r);
5218
+ return E.near(t, r);
5370
5219
  }
5371
- return e.parent.inlineContent || (i == 0 ? e = t : (e = (v.findFrom(e, -r, !0) || v.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new M(e, t);
5220
+ return e.parent.inlineContent || (i == 0 ? e = t : (e = (E.findFrom(e, -r, !0) || E.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new M(e, t);
5372
5221
  }
5373
5222
  }
5374
- v.jsonID("text", M);
5223
+ E.jsonID("text", M);
5375
5224
  class In {
5376
5225
  constructor(e, t) {
5377
5226
  this.anchor = e, this.head = t;
@@ -5383,7 +5232,7 @@ class In {
5383
5232
  return M.between(e.resolve(this.anchor), e.resolve(this.head));
5384
5233
  }
5385
5234
  }
5386
- class S extends v {
5235
+ class S extends E {
5387
5236
  /**
5388
5237
  Create a node selection. Does not verify the validity of its
5389
5238
  argument.
@@ -5394,7 +5243,7 @@ class S extends v {
5394
5243
  }
5395
5244
  map(e, t) {
5396
5245
  let { deleted: r, pos: i } = t.mapResult(this.anchor), s = e.resolve(i);
5397
- return r ? v.near(s) : new S(s);
5246
+ return r ? E.near(s) : new S(s);
5398
5247
  }
5399
5248
  content() {
5400
5249
  return new k(b.from(this.node), 0, 0);
@@ -5431,7 +5280,7 @@ class S extends v {
5431
5280
  }
5432
5281
  }
5433
5282
  S.prototype.visible = !1;
5434
- v.jsonID("node", S);
5283
+ E.jsonID("node", S);
5435
5284
  class zr {
5436
5285
  constructor(e) {
5437
5286
  this.anchor = e;
@@ -5442,10 +5291,10 @@ class zr {
5442
5291
  }
5443
5292
  resolve(e) {
5444
5293
  let t = e.resolve(this.anchor), r = t.nodeAfter;
5445
- return r && S.isSelectable(r) ? new S(t) : v.near(t);
5294
+ return r && S.isSelectable(r) ? new S(t) : E.near(t);
5446
5295
  }
5447
5296
  }
5448
- class ce extends v {
5297
+ class ce extends E {
5449
5298
  /**
5450
5299
  Create an all-selection over the given document.
5451
5300
  */
@@ -5455,7 +5304,7 @@ class ce extends v {
5455
5304
  replace(e, t = k.empty) {
5456
5305
  if (t == k.empty) {
5457
5306
  e.delete(0, e.doc.content.size);
5458
- let r = v.atStart(e.doc);
5307
+ let r = E.atStart(e.doc);
5459
5308
  r.eq(e.selection) || e.setSelection(r);
5460
5309
  } else
5461
5310
  super.replace(e, t);
@@ -5476,11 +5325,11 @@ class ce extends v {
5476
5325
  return e instanceof ce;
5477
5326
  }
5478
5327
  getBookmark() {
5479
- return ga;
5328
+ return pa;
5480
5329
  }
5481
5330
  }
5482
- v.jsonID("all", ce);
5483
- const ga = {
5331
+ E.jsonID("all", ce);
5332
+ const pa = {
5484
5333
  map() {
5485
5334
  return this;
5486
5335
  },
@@ -5515,10 +5364,10 @@ function xi(n, e, t) {
5515
5364
  let s = n.mapping.maps[r], o;
5516
5365
  s.forEach((l, a, c, d) => {
5517
5366
  o == null && (o = d);
5518
- }), n.setSelection(v.near(n.doc.resolve(o), t));
5367
+ }), n.setSelection(E.near(n.doc.resolve(o), t));
5519
5368
  }
5520
5369
  const Si = 1, Qt = 2, Mi = 4;
5521
- class ya extends pa {
5370
+ class ma extends fa {
5522
5371
  /**
5523
5372
  @internal
5524
5373
  */
@@ -5630,7 +5479,7 @@ class ya extends pa {
5630
5479
  let o = this.doc.resolve(t);
5631
5480
  s = r == t ? o.marks() : o.marksAcross(this.doc.resolve(r));
5632
5481
  }
5633
- return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(v.near(this.selection.$to)), this;
5482
+ return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(E.near(this.selection.$to)), this;
5634
5483
  }
5635
5484
  }
5636
5485
  /**
@@ -5672,13 +5521,13 @@ class ya extends pa {
5672
5521
  function wi(n, e) {
5673
5522
  return !e || !n ? n : n.bind(e);
5674
5523
  }
5675
- class Et {
5524
+ class Nt {
5676
5525
  constructor(e, t, r) {
5677
5526
  this.name = e, this.init = wi(t.init, r), this.apply = wi(t.apply, r);
5678
5527
  }
5679
5528
  }
5680
- const ba = [
5681
- new Et("doc", {
5529
+ const ga = [
5530
+ new Nt("doc", {
5682
5531
  init(n) {
5683
5532
  return n.doc || n.schema.topNodeType.createAndFill();
5684
5533
  },
@@ -5686,15 +5535,15 @@ const ba = [
5686
5535
  return n.doc;
5687
5536
  }
5688
5537
  }),
5689
- new Et("selection", {
5538
+ new Nt("selection", {
5690
5539
  init(n, e) {
5691
- return n.selection || v.atStart(e.doc);
5540
+ return n.selection || E.atStart(e.doc);
5692
5541
  },
5693
5542
  apply(n) {
5694
5543
  return n.selection;
5695
5544
  }
5696
5545
  }),
5697
- new Et("storedMarks", {
5546
+ new Nt("storedMarks", {
5698
5547
  init(n) {
5699
5548
  return n.storedMarks || null;
5700
5549
  },
@@ -5702,7 +5551,7 @@ const ba = [
5702
5551
  return r.selection.$cursor ? n.storedMarks : null;
5703
5552
  }
5704
5553
  }),
5705
- new Et("scrollToSelection", {
5554
+ new Nt("scrollToSelection", {
5706
5555
  init() {
5707
5556
  return 0;
5708
5557
  },
@@ -5713,10 +5562,10 @@ const ba = [
5713
5562
  ];
5714
5563
  class Gn {
5715
5564
  constructor(e, t) {
5716
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = ba.slice(), t && t.forEach((r) => {
5565
+ this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = ga.slice(), t && t.forEach((r) => {
5717
5566
  if (this.pluginsByKey[r.key])
5718
5567
  throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
5719
- this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Et(r.key, r.spec.state, r));
5568
+ this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Nt(r.key, r.spec.state, r));
5720
5569
  });
5721
5570
  }
5722
5571
  }
@@ -5806,7 +5655,7 @@ class mt {
5806
5655
  Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
5807
5656
  */
5808
5657
  get tr() {
5809
- return new ya(this);
5658
+ return new ma(this);
5810
5659
  }
5811
5660
  /**
5812
5661
  Create a new state.
@@ -5868,7 +5717,7 @@ class mt {
5868
5717
  if (o.name == "doc")
5869
5718
  s.doc = Fe.fromJSON(e.schema, t.doc);
5870
5719
  else if (o.name == "selection")
5871
- s.selection = v.fromJSON(s.doc, t.selection);
5720
+ s.selection = E.fromJSON(s.doc, t.selection);
5872
5721
  else if (o.name == "storedMarks")
5873
5722
  t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
5874
5723
  else {
@@ -5943,18 +5792,18 @@ let yr = null;
5943
5792
  const Te = function(n, e, t) {
5944
5793
  let r = yr || (yr = document.createRange());
5945
5794
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5946
- }, ka = function() {
5795
+ }, ya = function() {
5947
5796
  yr = null;
5948
5797
  }, ot = function(n, e, t, r) {
5949
5798
  return t && (Ci(n, e, t, r, -1) || Ci(n, e, t, r, 1));
5950
- }, xa = /^(img|br|input|textarea|hr)$/i;
5799
+ }, ba = /^(img|br|input|textarea|hr)$/i;
5951
5800
  function Ci(n, e, t, r, i) {
5952
5801
  for (var s; ; ) {
5953
5802
  if (n == t && e == r)
5954
5803
  return !0;
5955
5804
  if (e == (i < 0 ? 0 : fe(n))) {
5956
5805
  let o = n.parentNode;
5957
- if (!o || o.nodeType != 1 || _t(n) || xa.test(n.nodeName) || n.contentEditable == "false")
5806
+ if (!o || o.nodeType != 1 || _t(n) || ba.test(n.nodeName) || n.contentEditable == "false")
5958
5807
  return !1;
5959
5808
  e = K(n) + (i < 0 ? 0 : 1), n = o;
5960
5809
  } else if (n.nodeType == 1) {
@@ -5973,7 +5822,7 @@ function Ci(n, e, t, r, i) {
5973
5822
  function fe(n) {
5974
5823
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5975
5824
  }
5976
- function Sa(n, e) {
5825
+ function ka(n, e) {
5977
5826
  for (; ; ) {
5978
5827
  if (n.nodeType == 3 && e)
5979
5828
  return n;
@@ -5987,7 +5836,7 @@ function Sa(n, e) {
5987
5836
  return null;
5988
5837
  }
5989
5838
  }
5990
- function Ma(n, e) {
5839
+ function xa(n, e) {
5991
5840
  for (; ; ) {
5992
5841
  if (n.nodeType == 3 && e < n.nodeValue.length)
5993
5842
  return n;
@@ -6001,7 +5850,7 @@ function Ma(n, e) {
6001
5850
  return null;
6002
5851
  }
6003
5852
  }
6004
- function wa(n, e, t) {
5853
+ function Sa(n, e, t) {
6005
5854
  for (let r = e == 0, i = e == fe(n); r || i; ) {
6006
5855
  if (n == t)
6007
5856
  return !0;
@@ -6024,13 +5873,13 @@ function Ue(n, e) {
6024
5873
  let t = document.createEvent("Event");
6025
5874
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
6026
5875
  }
6027
- function Ca(n) {
5876
+ function Ma(n) {
6028
5877
  let e = n.activeElement;
6029
5878
  for (; e && e.shadowRoot; )
6030
5879
  e = e.shadowRoot.activeElement;
6031
5880
  return e;
6032
5881
  }
6033
- function Ta(n, e, t) {
5882
+ function wa(n, e, t) {
6034
5883
  if (n.caretPositionFromPoint)
6035
5884
  try {
6036
5885
  let r = n.caretPositionFromPoint(e, t);
@@ -6046,8 +5895,8 @@ function Ta(n, e, t) {
6046
5895
  }
6047
5896
  const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "", br = /Edge\/(\d+)/.exec(Ke), Zs = /MSIE \d/.exec(Ke), kr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), ie = !!(Zs || kr || br), Ve = Zs ? document.documentMode : kr ? +kr[1] : br ? +br[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(Ke);
6048
5897
  pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
6049
- const xr = !ie && /Chrome\/(\d+)/.exec(Ke), U = !!xr, Qs = xr ? +xr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = X && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(Ke), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Oa = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6050
- function va(n) {
5898
+ const xr = !ie && /Chrome\/(\d+)/.exec(Ke), U = !!xr, Qs = xr ? +xr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = X && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ne = /Android \d/.test(Ke), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Ca = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5899
+ function Ta(n) {
6051
5900
  let e = n.defaultView && n.defaultView.visualViewport;
6052
5901
  return e ? {
6053
5902
  left: 0,
@@ -6064,7 +5913,7 @@ function va(n) {
6064
5913
  function Ce(n, e) {
6065
5914
  return typeof n == "number" ? n : n[e];
6066
5915
  }
6067
- function Ea(n) {
5916
+ function Oa(n) {
6068
5917
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
6069
5918
  return {
6070
5919
  left: e.left,
@@ -6080,7 +5929,7 @@ function Oi(n, e, t) {
6080
5929
  o = xt(o);
6081
5930
  continue;
6082
5931
  }
6083
- let l = o, a = l == s.body, c = a ? va(s) : Ea(l), d = 0, u = 0;
5932
+ let l = o, a = l == s.body, c = a ? Ta(s) : Oa(l), d = 0, u = 0;
6084
5933
  if (e.top < c.top + Ce(r, "top") ? u = -(c.top - e.top + Ce(i, "top")) : e.bottom > c.bottom - Ce(r, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Ce(i, "top") - c.top : e.bottom - c.bottom + Ce(i, "bottom")), e.left < c.left + Ce(r, "left") ? d = -(c.left - e.left + Ce(i, "left")) : e.right > c.right - Ce(r, "right") && (d = e.right - c.right + Ce(i, "right")), d || u)
6085
5934
  if (a)
6086
5935
  s.defaultView.scrollBy(d, u);
@@ -6096,7 +5945,7 @@ function Oi(n, e, t) {
6096
5945
  o = f == "absolute" ? o.offsetParent : xt(o);
6097
5946
  }
6098
5947
  }
6099
- function Na(n) {
5948
+ function Ea(n) {
6100
5949
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
6101
5950
  for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
6102
5951
  let l = n.root.elementFromPoint(s, o);
@@ -6116,7 +5965,7 @@ function to(n) {
6116
5965
  ;
6117
5966
  return e;
6118
5967
  }
6119
- function Aa({ refDOM: n, refTop: e, stack: t }) {
5968
+ function Na({ refDOM: n, refTop: e, stack: t }) {
6120
5969
  let r = n ? n.getBoundingClientRect().top : 0;
6121
5970
  no(t, r == 0 ? 0 : r - e);
6122
5971
  }
@@ -6127,7 +5976,7 @@ function no(n, e) {
6127
5976
  }
6128
5977
  }
6129
5978
  let ut = null;
6130
- function Da(n) {
5979
+ function va(n) {
6131
5980
  if (n.setActive)
6132
5981
  return n.setActive();
6133
5982
  if (ut)
@@ -6165,9 +6014,9 @@ function ro(n, e) {
6165
6014
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = u + 1);
6166
6015
  }
6167
6016
  }
6168
- return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? Ia(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : ro(t, i);
6017
+ return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? Aa(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : ro(t, i);
6169
6018
  }
6170
- function Ia(n, e) {
6019
+ function Aa(n, e) {
6171
6020
  let t = n.nodeValue.length, r = document.createRange(), i;
6172
6021
  for (let s = 0; s < t; s++) {
6173
6022
  r.setEnd(n, s + 1), r.setStart(n, s);
@@ -6182,11 +6031,11 @@ function Ia(n, e) {
6182
6031
  function Fr(n, e) {
6183
6032
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
6184
6033
  }
6185
- function Ra(n, e) {
6034
+ function Da(n, e) {
6186
6035
  let t = n.parentNode;
6187
6036
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
6188
6037
  }
6189
- function Pa(n, e, t) {
6038
+ function Ia(n, e, t) {
6190
6039
  let { node: r, offset: i } = ro(e, t), s = -1;
6191
6040
  if (r.nodeType == 1 && !r.firstChild) {
6192
6041
  let o = r.getBoundingClientRect();
@@ -6194,7 +6043,7 @@ function Pa(n, e, t) {
6194
6043
  }
6195
6044
  return n.docView.posFromDOM(r, i, s);
6196
6045
  }
6197
- function Ba(n, e, t, r) {
6046
+ function Ra(n, e, t, r) {
6198
6047
  let i = -1;
6199
6048
  for (let s = e, o = !1; s != n.dom; ) {
6200
6049
  let l = n.docView.nearestDesc(s, !0), a;
@@ -6225,8 +6074,8 @@ function io(n, e, t) {
6225
6074
  }
6226
6075
  return n;
6227
6076
  }
6228
- function La(n, e) {
6229
- let t = n.dom.ownerDocument, r, i = 0, s = Ta(t, e.left, e.top);
6077
+ function Pa(n, e) {
6078
+ let t = n.dom.ownerDocument, r, i = 0, s = wa(t, e.left, e.top);
6230
6079
  s && ({ node: r, offset: i } = s);
6231
6080
  let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
6232
6081
  if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
@@ -6237,35 +6086,35 @@ function La(n, e) {
6237
6086
  if (X)
6238
6087
  for (let c = o; r && c; c = xt(c))
6239
6088
  c.draggable && (r = void 0);
6240
- if (o = Ra(o, e), r) {
6089
+ if (o = Da(o, e), r) {
6241
6090
  if (pe && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
6242
6091
  let d = r.childNodes[i], u;
6243
6092
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && i++;
6244
6093
  }
6245
6094
  let c;
6246
- Gt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ba(n, r, i, e));
6095
+ Gt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ra(n, r, i, e));
6247
6096
  }
6248
- l == null && (l = Pa(n, o, e));
6097
+ l == null && (l = Ia(n, o, e));
6249
6098
  let a = n.docView.nearestDesc(o, !0);
6250
6099
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
6251
6100
  }
6252
- function vi(n) {
6101
+ function Ei(n) {
6253
6102
  return n.top < n.bottom || n.left < n.right;
6254
6103
  }
6255
6104
  function De(n, e) {
6256
6105
  let t = n.getClientRects();
6257
6106
  if (t.length) {
6258
6107
  let r = t[e < 0 ? 0 : t.length - 1];
6259
- if (vi(r))
6108
+ if (Ei(r))
6260
6109
  return r;
6261
6110
  }
6262
- return Array.prototype.find.call(t, vi) || n.getBoundingClientRect();
6111
+ return Array.prototype.find.call(t, Ei) || n.getBoundingClientRect();
6263
6112
  }
6264
- const za = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6113
+ const Ba = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6265
6114
  function so(n, e, t) {
6266
6115
  let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Gt || pe;
6267
6116
  if (r.nodeType == 3)
6268
- if (o && (za.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6117
+ if (o && (Ba.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6269
6118
  let a = De(Te(r, i, i), t);
6270
6119
  if (pe && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
6271
6120
  let c = De(Te(r, i - 1, i - 1), -1);
@@ -6329,7 +6178,7 @@ function oo(n, e, t) {
6329
6178
  r != e && n.updateState(r), i != n.dom && i && i.focus();
6330
6179
  }
6331
6180
  }
6332
- function Fa(n, e, t) {
6181
+ function La(n, e, t) {
6333
6182
  let r = e.selection, i = t == "up" ? r.$from : r.$to;
6334
6183
  return oo(n, e, () => {
6335
6184
  let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
@@ -6361,13 +6210,13 @@ function Fa(n, e, t) {
6361
6210
  return !0;
6362
6211
  });
6363
6212
  }
6364
- const $a = /[\u0590-\u08ac]/;
6365
- function Va(n, e, t) {
6213
+ const za = /[\u0590-\u08ac]/;
6214
+ function Fa(n, e, t) {
6366
6215
  let { $head: r } = e.selection;
6367
6216
  if (!r.parent.isTextblock)
6368
6217
  return !1;
6369
6218
  let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
6370
- return l ? !$a.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : oo(n, e, () => {
6219
+ return l ? !za.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : oo(n, e, () => {
6371
6220
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
6372
6221
  l.modify("move", t, "character");
6373
6222
  let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -6378,9 +6227,9 @@ function Va(n, e, t) {
6378
6227
  return f != null && (l.caretBidiLevel = f), g;
6379
6228
  }) : r.pos == r.start() || r.pos == r.end();
6380
6229
  }
6381
- let Ei = null, Ni = null, Ai = !1;
6382
- function Ha(n, e, t) {
6383
- return Ei == e && Ni == t ? Ai : (Ei = e, Ni = t, Ai = t == "up" || t == "down" ? Fa(n, e, t) : Va(n, e, t));
6230
+ let Ni = null, vi = null, Ai = !1;
6231
+ function $a(n, e, t) {
6232
+ return Ni == e && vi == t ? Ai : (Ni = e, vi = t, Ai = t == "up" || t == "down" ? La(n, e, t) : Fa(n, e, t));
6384
6233
  }
6385
6234
  const me = 0, Di = 1, Ge = 2, Se = 3;
6386
6235
  class Yt {
@@ -6770,7 +6619,7 @@ class lo extends Yt {
6770
6619
  return this.widget.type.side;
6771
6620
  }
6772
6621
  }
6773
- class Wa extends Yt {
6622
+ class Va extends Yt {
6774
6623
  constructor(e, t, r, i) {
6775
6624
  super(e, [], t, null), this.textDOM = r, this.text = i;
6776
6625
  }
@@ -6851,7 +6700,7 @@ class He extends Yt {
6851
6700
  } else d || ({ dom: d, contentDOM: u } = dt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6852
6701
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6853
6702
  let f = d;
6854
- return d = fo(d, r, t), c ? a = new qa(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Pn(e, t, r, i, d, f, s) : new He(e, t, r, i, d, u || null, f, s, o + 1);
6703
+ return d = fo(d, r, t), c ? a = new Ha(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Pn(e, t, r, i, d, f, s) : new He(e, t, r, i, d, u || null, f, s, o + 1);
6855
6704
  }
6856
6705
  parseRule() {
6857
6706
  if (this.node.type.spec.reparseInView)
@@ -6887,14 +6736,14 @@ class He extends Yt {
6887
6736
  // separate step, syncs the DOM inside `this.contentDOM` to
6888
6737
  // `this.children`.
6889
6738
  updateChildren(e, t) {
6890
- let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Ka(this, o && o.node, e);
6891
- _a(this.node, this.innerDeco, (c, d, u) => {
6739
+ let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new qa(this, o && o.node, e);
6740
+ Ja(this.node, this.innerDeco, (c, d, u) => {
6892
6741
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e, d) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? A.none : this.node.child(d).marks, r, e, d), a.placeWidget(c, e, i);
6893
6742
  }, (c, d, u, f) => {
6894
6743
  a.syncToMarks(c.marks, r, e, f);
6895
6744
  let h;
6896
6745
  a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, h, e) || a.updateNextNode(c, d, u, e, f, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
6897
- }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), co(this.contentDOM, this.children, e), St && Ga(this.dom));
6746
+ }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), co(this.contentDOM, this.children, e), St && Ua(this.dom));
6898
6747
  }
6899
6748
  localCompositionInfo(e, t) {
6900
6749
  let { from: r, to: i } = e.state.selection;
@@ -6904,7 +6753,7 @@ class He extends Yt {
6904
6753
  if (!s || !this.dom.contains(s.parentNode))
6905
6754
  return null;
6906
6755
  if (this.node.inlineContent) {
6907
- let o = s.nodeValue, l = Ya(this.node.content, o, r - t, i - t);
6756
+ let o = s.nodeValue, l = _a(this.node.content, o, r - t, i - t);
6908
6757
  return l < 0 ? null : { node: s, pos: l, text: o };
6909
6758
  } else
6910
6759
  return { node: s, pos: -1, text: "" };
@@ -6920,7 +6769,7 @@ class He extends Yt {
6920
6769
  s.parentNode.removeChild(s.nextSibling);
6921
6770
  s.pmViewDesc && (s.pmViewDesc = void 0);
6922
6771
  }
6923
- let o = new Wa(this, s, t, i);
6772
+ let o = new Va(this, s, t, i);
6924
6773
  e.input.compositionNodes.push(o), this.children = Mr(this.children, r, r + i.length, e, o);
6925
6774
  }
6926
6775
  // If this desc must be updated to match the given node decoration,
@@ -7011,7 +6860,7 @@ class ao extends Yt {
7011
6860
  return this.dom.nodeName == "IMG";
7012
6861
  }
7013
6862
  }
7014
- class qa extends He {
6863
+ class Ha extends He {
7015
6864
  constructor(e, t, r, i, s, o, l, a, c, d) {
7016
6865
  super(e, t, r, i, s, o, l, c, d), this.spec = a;
7017
6866
  }
@@ -7095,11 +6944,11 @@ function uo(n, e, t, r) {
7095
6944
  let a;
7096
6945
  l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Ye[0]), i = a;
7097
6946
  }
7098
- ja(i, l || Ye[0], o);
6947
+ Wa(i, l || Ye[0], o);
7099
6948
  }
7100
6949
  return i;
7101
6950
  }
7102
- function ja(n, e, t) {
6951
+ function Wa(n, e, t) {
7103
6952
  for (let r in e)
7104
6953
  r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
7105
6954
  for (let r in t)
@@ -7136,9 +6985,9 @@ function Ri(n) {
7136
6985
  let e = n.nextSibling;
7137
6986
  return n.parentNode.removeChild(n), e;
7138
6987
  }
7139
- class Ka {
6988
+ class qa {
7140
6989
  constructor(e, t, r) {
7141
- this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Ja(e.node.content, e);
6990
+ this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = ja(e.node.content, e);
7142
6991
  }
7143
6992
  // Destroy and remove the children between the given indices in
7144
6993
  // `this.top`.
@@ -7287,7 +7136,7 @@ class Ka {
7287
7136
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
7288
7137
  }
7289
7138
  }
7290
- function Ja(n, e) {
7139
+ function ja(n, e) {
7291
7140
  let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
7292
7141
  e: for (; i > 0; ) {
7293
7142
  let l;
@@ -7314,10 +7163,10 @@ function Ja(n, e) {
7314
7163
  }
7315
7164
  return { index: i, matched: s, matches: o.reverse() };
7316
7165
  }
7317
- function Ua(n, e) {
7166
+ function Ka(n, e) {
7318
7167
  return n.type.side - e.type.side;
7319
7168
  }
7320
- function _a(n, e, t, r) {
7169
+ function Ja(n, e, t, r) {
7321
7170
  let i = e.locals(n), s = 0;
7322
7171
  if (i.length == 0) {
7323
7172
  for (let c = 0; c < n.childCount; c++) {
@@ -7335,7 +7184,7 @@ function _a(n, e, t, r) {
7335
7184
  }
7336
7185
  if (d)
7337
7186
  if (u) {
7338
- u.sort(Ua);
7187
+ u.sort(Ka);
7339
7188
  for (let g = 0; g < u.length; g++)
7340
7189
  t(u[g], c, !!a);
7341
7190
  } else
@@ -7365,13 +7214,13 @@ function _a(n, e, t, r) {
7365
7214
  r(f, m, e.forChild(s, f), h), s = p;
7366
7215
  }
7367
7216
  }
7368
- function Ga(n) {
7217
+ function Ua(n) {
7369
7218
  if (n.nodeName == "UL" || n.nodeName == "OL") {
7370
7219
  let e = n.style.cssText;
7371
7220
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
7372
7221
  }
7373
7222
  }
7374
- function Ya(n, e, t, r) {
7223
+ function _a(n, e, t, r) {
7375
7224
  for (let i = 0, s = 0; i < n.childCount && s <= r; ) {
7376
7225
  let o = n.child(i++), l = s;
7377
7226
  if (s += o.nodeSize, !o.isText)
@@ -7415,7 +7264,7 @@ function $r(n, e = null) {
7415
7264
  for (a = o; i && !i.node; )
7416
7265
  i = i.parent;
7417
7266
  let u = i.node;
7418
- if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && wa(t.focusNode, t.focusOffset, i.dom))) {
7267
+ if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && Sa(t.focusNode, t.focusOffset, i.dom))) {
7419
7268
  let f = i.posBefore;
7420
7269
  c = new S(o == f ? l : r.resolve(f));
7421
7270
  }
@@ -7455,10 +7304,10 @@ function Ae(n, e = !1) {
7455
7304
  }
7456
7305
  }
7457
7306
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
7458
- Za(n);
7307
+ Ya(n);
7459
7308
  else {
7460
7309
  let { anchor: r, head: i } = t, s, o;
7461
- Pi && !(t instanceof M) && (t.$from.parent.inlineContent || (s = Bi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Bi(n, t.to))), n.docView.setSelection(r, i, n, e), Pi && (s && Li(s), o && Li(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Xa(n));
7310
+ Pi && !(t instanceof M) && (t.$from.parent.inlineContent || (s = Bi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Bi(n, t.to))), n.docView.setSelection(r, i, n, e), Pi && (s && Li(s), o && Li(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Ga(n));
7462
7311
  }
7463
7312
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7464
7313
  }
@@ -7481,7 +7330,7 @@ function Zn(n) {
7481
7330
  function Li(n) {
7482
7331
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
7483
7332
  }
7484
- function Xa(n) {
7333
+ function Ga(n) {
7485
7334
  let e = n.dom.ownerDocument;
7486
7335
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
7487
7336
  let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
@@ -7491,7 +7340,7 @@ function Xa(n) {
7491
7340
  }, 20));
7492
7341
  });
7493
7342
  }
7494
- function Za(n) {
7343
+ function Ya(n) {
7495
7344
  let e = n.domSelection();
7496
7345
  if (!e)
7497
7346
  return;
@@ -7524,13 +7373,13 @@ function mo(n) {
7524
7373
  return !1;
7525
7374
  }
7526
7375
  }
7527
- function Qa(n) {
7376
+ function Xa(n) {
7528
7377
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7529
7378
  return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
7530
7379
  }
7531
7380
  function wr(n, e) {
7532
7381
  let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
7533
- return s && v.findFrom(s, e);
7382
+ return s && E.findFrom(s, e);
7534
7383
  }
7535
7384
  function Ie(n, e) {
7536
7385
  return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
@@ -7573,9 +7422,9 @@ function It(n, e) {
7573
7422
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7574
7423
  }
7575
7424
  function ft(n, e) {
7576
- return e < 0 ? ec(n) : tc(n);
7425
+ return e < 0 ? Za(n) : Qa(n);
7577
7426
  }
7578
- function ec(n) {
7427
+ function Za(n) {
7579
7428
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7580
7429
  if (!t)
7581
7430
  return;
@@ -7611,7 +7460,7 @@ function ec(n) {
7611
7460
  }
7612
7461
  o ? Cr(n, t, r) : i && Cr(n, i, s);
7613
7462
  }
7614
- function tc(n) {
7463
+ function Qa(n) {
7615
7464
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7616
7465
  if (!t)
7617
7466
  return;
@@ -7647,7 +7496,7 @@ function go(n) {
7647
7496
  let e = n.pmViewDesc;
7648
7497
  return e && e.node && e.node.isBlock;
7649
7498
  }
7650
- function nc(n, e) {
7499
+ function ec(n, e) {
7651
7500
  for (; n && e == n.childNodes.length && !_t(n); )
7652
7501
  e = K(n) + 1, n = n.parentNode;
7653
7502
  for (; n && e < n.childNodes.length; ) {
@@ -7659,7 +7508,7 @@ function nc(n, e) {
7659
7508
  n = t, e = 0;
7660
7509
  }
7661
7510
  }
7662
- function rc(n, e) {
7511
+ function tc(n, e) {
7663
7512
  for (; n && !e && !_t(n); )
7664
7513
  e = K(n), n = n.parentNode;
7665
7514
  for (; n && e; ) {
@@ -7674,7 +7523,7 @@ function rc(n, e) {
7674
7523
  function Cr(n, e, t) {
7675
7524
  if (e.nodeType != 3) {
7676
7525
  let s, o;
7677
- (o = nc(e, t)) ? (e = o, t = 0) : (s = rc(e, t)) && (e = s, t = s.nodeValue.length);
7526
+ (o = ec(e, t)) ? (e = o, t = 0) : (s = tc(e, t)) && (e = s, t = s.nodeValue.length);
7678
7527
  }
7679
7528
  let r = n.domSelection();
7680
7529
  if (!r)
@@ -7717,7 +7566,7 @@ function Hi(n, e, t) {
7717
7566
  return Ie(n, o);
7718
7567
  }
7719
7568
  if (!i.parent.inlineContent) {
7720
- let o = e < 0 ? i : s, l = r instanceof ce ? v.near(o, e) : v.findFrom(o, e);
7569
+ let o = e < 0 ? i : s, l = r instanceof ce ? E.near(o, e) : E.findFrom(o, e);
7721
7570
  return l ? Ie(n, l) : !1;
7722
7571
  }
7723
7572
  return !1;
@@ -7742,7 +7591,7 @@ function Wi(n, e) {
7742
7591
  function qi(n, e, t) {
7743
7592
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
7744
7593
  }
7745
- function ic(n) {
7594
+ function nc(n) {
7746
7595
  if (!X || n.state.selection.$head.parentOffset > 0)
7747
7596
  return !1;
7748
7597
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -7752,12 +7601,12 @@ function ic(n) {
7752
7601
  }
7753
7602
  return !1;
7754
7603
  }
7755
- function sc(n) {
7604
+ function rc(n) {
7756
7605
  let e = "";
7757
7606
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
7758
7607
  }
7759
- function oc(n, e) {
7760
- let t = e.keyCode, r = sc(e);
7608
+ function ic(n, e) {
7609
+ let t = e.keyCode, r = rc(e);
7761
7610
  if (t == 8 || ue && t == 72 && r == "c")
7762
7611
  return Wi(n, -1) || ft(n, -1);
7763
7612
  if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
@@ -7774,7 +7623,7 @@ function oc(n, e) {
7774
7623
  if (t == 38 || ue && t == 80 && r == "c")
7775
7624
  return Hi(n, -1, r) || ft(n, -1);
7776
7625
  if (t == 40 || ue && t == 78 && r == "c")
7777
- return ic(n) || Hi(n, 1, r) || ft(n, 1);
7626
+ return nc(n) || Hi(n, 1, r) || ft(n, 1);
7778
7627
  if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
7779
7628
  return !0;
7780
7629
  }
@@ -7834,7 +7683,7 @@ function yo(n, e, t, r, i) {
7834
7683
  } else
7835
7684
  n.someProp("transformPastedHTML", (u) => {
7836
7685
  t = u(t, n);
7837
- }), o = dc(t), Gt && uc(o);
7686
+ }), o = ac(t), Gt && cc(o);
7838
7687
  let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7839
7688
  if (d && d[3])
7840
7689
  for (let u = +d[3]; u > 0; u--) {
@@ -7849,11 +7698,11 @@ function yo(n, e, t, r, i) {
7849
7698
  preserveWhitespace: !!(a || d),
7850
7699
  context: i,
7851
7700
  ruleFromNode(f) {
7852
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !lc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7701
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !sc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7853
7702
  }
7854
7703
  })), d)
7855
- l = fc(ji(l, +d[1], +d[2]), d[4]);
7856
- else if (l = k.maxOpen(ac(l.content, i), !0), l.openStart || l.openEnd) {
7704
+ l = dc(ji(l, +d[1], +d[2]), d[4]);
7705
+ else if (l = k.maxOpen(oc(l.content, i), !0), l.openStart || l.openEnd) {
7857
7706
  let u = 0, f = 0;
7858
7707
  for (let h = l.content.firstChild; u < l.openStart && !h.type.spec.isolating; u++, h = h.firstChild)
7859
7708
  ;
@@ -7865,8 +7714,8 @@ function yo(n, e, t, r, i) {
7865
7714
  l = u(l, n, a);
7866
7715
  }), l;
7867
7716
  }
7868
- const lc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7869
- function ac(n, e) {
7717
+ const sc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7718
+ function oc(n, e) {
7870
7719
  if (n.childCount < 2)
7871
7720
  return n;
7872
7721
  for (let t = e.depth; t >= 0; t--) {
@@ -7932,27 +7781,27 @@ function Mo() {
7932
7781
  return Ki || (Ki = document.implementation.createHTMLDocument("title"));
7933
7782
  }
7934
7783
  let Qn = null;
7935
- function cc(n) {
7784
+ function lc(n) {
7936
7785
  let e = window.trustedTypes;
7937
7786
  return e ? (Qn || (Qn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Qn.createHTML(n)) : n;
7938
7787
  }
7939
- function dc(n) {
7788
+ function ac(n) {
7940
7789
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
7941
7790
  e && (n = n.slice(e[0].length));
7942
7791
  let t = Mo().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
7943
- if ((i = r && So[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = cc(n), i)
7792
+ if ((i = r && So[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = lc(n), i)
7944
7793
  for (let s = 0; s < i.length; s++)
7945
7794
  t = t.querySelector(i[s]) || t;
7946
7795
  return t;
7947
7796
  }
7948
- function uc(n) {
7797
+ function cc(n) {
7949
7798
  let e = n.querySelectorAll(U ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7950
7799
  for (let t = 0; t < e.length; t++) {
7951
7800
  let r = e[t];
7952
7801
  r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
7953
7802
  }
7954
7803
  }
7955
- function fc(n, e) {
7804
+ function dc(n, e) {
7956
7805
  if (!n.size)
7957
7806
  return n;
7958
7807
  let t = n.content.firstChild.type.schema, r;
@@ -7970,25 +7819,25 @@ function fc(n, e) {
7970
7819
  }
7971
7820
  return new k(i, s, o);
7972
7821
  }
7973
- const ee = {}, te = {}, hc = { touchstart: !0, touchmove: !0 };
7974
- class pc {
7822
+ const ee = {}, te = {}, uc = { touchstart: !0, touchmove: !0 };
7823
+ class fc {
7975
7824
  constructor() {
7976
7825
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7977
7826
  }
7978
7827
  }
7979
- function mc(n) {
7828
+ function hc(n) {
7980
7829
  for (let e in ee) {
7981
7830
  let t = ee[e];
7982
7831
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
7983
- yc(n, r) && !Wr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7984
- }, hc[e] ? { passive: !0 } : void 0);
7832
+ mc(n, r) && !Wr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7833
+ }, uc[e] ? { passive: !0 } : void 0);
7985
7834
  }
7986
7835
  X && n.dom.addEventListener("input", () => null), Or(n);
7987
7836
  }
7988
7837
  function ze(n, e) {
7989
7838
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7990
7839
  }
7991
- function gc(n) {
7840
+ function pc(n) {
7992
7841
  n.domObserver.stop();
7993
7842
  for (let e in n.input.eventHandlers)
7994
7843
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -8006,7 +7855,7 @@ function Wr(n, e) {
8006
7855
  return r ? r(n, e) || e.defaultPrevented : !1;
8007
7856
  });
8008
7857
  }
8009
- function yc(n, e) {
7858
+ function mc(n, e) {
8010
7859
  if (!e.bubbles)
8011
7860
  return !0;
8012
7861
  if (e.defaultPrevented)
@@ -8016,18 +7865,18 @@ function yc(n, e) {
8016
7865
  return !1;
8017
7866
  return !0;
8018
7867
  }
8019
- function bc(n, e) {
7868
+ function gc(n, e) {
8020
7869
  !Wr(n, e) && ee[e.type] && (n.editable || !(e.type in te)) && ee[e.type](n, e);
8021
7870
  }
8022
7871
  te.keydown = (n, e) => {
8023
7872
  let t = e;
8024
- if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Co(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ee && U && t.keyCode == 13)))
7873
+ if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Co(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ne && U && t.keyCode == 13)))
8025
7874
  if (t.keyCode != 229 && n.domObserver.forceFlush(), St && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
8026
7875
  let r = Date.now();
8027
7876
  n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
8028
7877
  n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
8029
7878
  }, 200);
8030
- } else n.someProp("handleKeyDown", (r) => r(n, t)) || oc(n, t) ? t.preventDefault() : ze(n, "key");
7879
+ } else n.someProp("handleKeyDown", (r) => r(n, t)) || ic(n, t) ? t.preventDefault() : ze(n, "key");
8031
7880
  };
8032
7881
  te.keyup = (n, e) => {
8033
7882
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -8049,7 +7898,7 @@ te.keypress = (n, e) => {
8049
7898
  function Bn(n) {
8050
7899
  return { left: n.clientX, top: n.clientY };
8051
7900
  }
8052
- function kc(n, e) {
7901
+ function yc(n, e) {
8053
7902
  let t = e.x - n.clientX, r = e.y - n.clientY;
8054
7903
  return t * t + r * r < 100;
8055
7904
  }
@@ -8068,13 +7917,13 @@ function bt(n, e, t) {
8068
7917
  let r = n.state.tr.setSelection(e);
8069
7918
  r.setMeta("pointer", !0), n.dispatch(r);
8070
7919
  }
8071
- function xc(n, e) {
7920
+ function bc(n, e) {
8072
7921
  if (e == -1)
8073
7922
  return !1;
8074
7923
  let t = n.state.doc.resolve(e), r = t.nodeAfter;
8075
7924
  return r && r.isAtom && S.isSelectable(r) ? (bt(n, new S(t)), !0) : !1;
8076
7925
  }
8077
- function Sc(n, e) {
7926
+ function kc(n, e) {
8078
7927
  if (e == -1)
8079
7928
  return !1;
8080
7929
  let t = n.state.selection, r, i;
@@ -8089,16 +7938,16 @@ function Sc(n, e) {
8089
7938
  }
8090
7939
  return i != null ? (bt(n, S.create(n.state.doc, i)), !0) : !1;
8091
7940
  }
8092
- function Mc(n, e, t, r, i) {
8093
- return qr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Sc(n, t) : xc(n, t));
7941
+ function xc(n, e, t, r, i) {
7942
+ return qr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? kc(n, t) : bc(n, t));
8094
7943
  }
8095
- function wc(n, e, t, r) {
7944
+ function Sc(n, e, t, r) {
8096
7945
  return qr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
8097
7946
  }
8098
- function Cc(n, e, t, r) {
8099
- return qr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Tc(n, t, r);
7947
+ function Mc(n, e, t, r) {
7948
+ return qr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || wc(n, t, r);
8100
7949
  }
8101
- function Tc(n, e, t) {
7950
+ function wc(n, e, t) {
8102
7951
  if (t.button != 0)
8103
7952
  return !1;
8104
7953
  let r = n.state.doc;
@@ -8124,11 +7973,11 @@ ee.mousedown = (n, e) => {
8124
7973
  let t = e;
8125
7974
  n.input.shiftKey = t.shiftKey;
8126
7975
  let r = jr(n), i = Date.now(), s = "singleClick";
8127
- i - n.input.lastClick.time < 500 && kc(t, n.input.lastClick) && !t[wo] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
7976
+ i - n.input.lastClick.time < 500 && yc(t, n.input.lastClick) && !t[wo] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
8128
7977
  let o = n.posAtCoords(Bn(t));
8129
- o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Oc(n, o, t, !!r)) : (s == "doubleClick" ? wc : Cc)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
7978
+ o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Cc(n, o, t, !!r)) : (s == "doubleClick" ? Sc : Mc)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
8130
7979
  };
8131
- class Oc {
7980
+ class Cc {
8132
7981
  constructor(e, t, r, i) {
8133
7982
  this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[wo], this.allowDefault = r.shiftKey;
8134
7983
  let s, o;
@@ -8157,7 +8006,7 @@ class Oc {
8157
8006
  if (this.done(), !this.view.dom.contains(e.target))
8158
8007
  return;
8159
8008
  let t = this.pos;
8160
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Bn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : Mc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8009
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Bn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : xc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8161
8010
  X && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
8162
8011
  // cursor, but still report that the node is selected
8163
8012
  // when asked through getSelection. You'll then get a
@@ -8165,7 +8014,7 @@ class Oc {
8165
8014
  // (hidden) cursor is doesn't change the selection, and
8166
8015
  // thus doesn't get a reaction from ProseMirror. This
8167
8016
  // works around that.
8168
- U && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (bt(this.view, v.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : ze(this.view, "pointer");
8017
+ U && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (bt(this.view, E.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : ze(this.view, "pointer");
8169
8018
  }
8170
8019
  move(e) {
8171
8020
  this.updateAllowDefault(e), ze(this.view, "pointer"), e.buttons == 0 && this.done();
@@ -8184,12 +8033,12 @@ ee.contextmenu = (n) => jr(n);
8184
8033
  function Co(n, e) {
8185
8034
  return n.composing ? !0 : X && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
8186
8035
  }
8187
- const vc = Ee ? 5e3 : -1;
8036
+ const Tc = Ne ? 5e3 : -1;
8188
8037
  te.compositionstart = te.compositionupdate = (n) => {
8189
8038
  if (!n.composing) {
8190
8039
  n.domObserver.flush();
8191
8040
  let { state: e } = n, t = e.selection.$to;
8192
- if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || U && eo && Ec(n)))
8041
+ if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || U && eo && Oc(n)))
8193
8042
  n.markCursor = n.state.storedMarks || t.marks(), yn(n, !0), n.markCursor = null;
8194
8043
  else if (yn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8195
8044
  let r = n.domSelectionRange();
@@ -8207,9 +8056,9 @@ te.compositionstart = te.compositionupdate = (n) => {
8207
8056
  }
8208
8057
  n.input.composing = !0;
8209
8058
  }
8210
- To(n, vc);
8059
+ To(n, Tc);
8211
8060
  };
8212
- function Ec(n) {
8061
+ function Oc(n) {
8213
8062
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
8214
8063
  if (!e || e.nodeType != 1 || t >= e.childNodes.length)
8215
8064
  return !1;
@@ -8223,14 +8072,14 @@ function To(n, e) {
8223
8072
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => yn(n), e));
8224
8073
  }
8225
8074
  function Oo(n) {
8226
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Ac()); n.input.compositionNodes.length > 0; )
8075
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Nc()); n.input.compositionNodes.length > 0; )
8227
8076
  n.input.compositionNodes.pop().markParentsDirty();
8228
8077
  }
8229
- function Nc(n) {
8078
+ function Ec(n) {
8230
8079
  let e = n.domSelectionRange();
8231
8080
  if (!e.focusNode)
8232
8081
  return null;
8233
- let t = Sa(e.focusNode, e.focusOffset), r = Ma(e.focusNode, e.focusOffset);
8082
+ let t = ka(e.focusNode, e.focusOffset), r = xa(e.focusNode, e.focusOffset);
8234
8083
  if (t && r && t != r) {
8235
8084
  let i = r.pmViewDesc, s = n.domObserver.lastChangedTextNode;
8236
8085
  if (t == s || r == s)
@@ -8245,12 +8094,12 @@ function Nc(n) {
8245
8094
  }
8246
8095
  return t || r;
8247
8096
  }
8248
- function Ac() {
8097
+ function Nc() {
8249
8098
  let n = document.createEvent("Event");
8250
8099
  return n.initEvent("event", !0, !0), n.timeStamp;
8251
8100
  }
8252
8101
  function yn(n, e = !1) {
8253
- if (!(Ee && n.domObserver.flushingSoon >= 0)) {
8102
+ if (!(Ne && n.domObserver.flushingSoon >= 0)) {
8254
8103
  if (n.domObserver.forceFlush(), Oo(n), e || n.docView && n.docView.dirty) {
8255
8104
  let t = $r(n), r = n.state.selection;
8256
8105
  return t && !t.eq(r) ? n.dispatch(n.state.tr.setSelection(t)) : (n.markCursor || e) && !r.$from.node(r.$from.sharedDepth(r.to)).inlineContent ? n.dispatch(n.state.tr.deleteSelection()) : n.updateState(n.state), !0;
@@ -8258,7 +8107,7 @@ function yn(n, e = !1) {
8258
8107
  return !1;
8259
8108
  }
8260
8109
  }
8261
- function Dc(n, e) {
8110
+ function vc(n, e) {
8262
8111
  if (!n.dom.parentNode)
8263
8112
  return;
8264
8113
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -8268,18 +8117,18 @@ function Dc(n, e) {
8268
8117
  t.parentNode && t.parentNode.removeChild(t), n.focus();
8269
8118
  }, 50);
8270
8119
  }
8271
- const zt = ie && Ve < 15 || St && Oa < 604;
8120
+ const zt = ie && Ve < 15 || St && Ca < 604;
8272
8121
  ee.copy = te.cut = (n, e) => {
8273
8122
  let t = e, r = n.state.selection, i = t.type == "cut";
8274
8123
  if (r.empty)
8275
8124
  return;
8276
8125
  let s = zt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = Hr(n, o);
8277
- s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Dc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8126
+ s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : vc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8278
8127
  };
8279
- function Ic(n) {
8128
+ function Ac(n) {
8280
8129
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
8281
8130
  }
8282
- function Rc(n, e) {
8131
+ function Dc(n, e) {
8283
8132
  if (!n.dom.parentNode)
8284
8133
  return;
8285
8134
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -8295,10 +8144,10 @@ function Ft(n, e, t, r, i) {
8295
8144
  return !0;
8296
8145
  if (!s)
8297
8146
  return !1;
8298
- let o = Ic(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8147
+ let o = Ac(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8299
8148
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
8300
8149
  }
8301
- function vo(n) {
8150
+ function Eo(n) {
8302
8151
  let e = n.getData("text/plain") || n.getData("Text");
8303
8152
  if (e)
8304
8153
  return e;
@@ -8307,22 +8156,22 @@ function vo(n) {
8307
8156
  }
8308
8157
  te.paste = (n, e) => {
8309
8158
  let t = e;
8310
- if (n.composing && !Ee)
8159
+ if (n.composing && !Ne)
8311
8160
  return;
8312
8161
  let r = zt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8313
- r && Ft(n, vo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Rc(n, t);
8162
+ r && Ft(n, Eo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Dc(n, t);
8314
8163
  };
8315
- class Eo {
8164
+ class No {
8316
8165
  constructor(e, t, r) {
8317
8166
  this.slice = e, this.move = t, this.node = r;
8318
8167
  }
8319
8168
  }
8320
- const Pc = ue ? "altKey" : "ctrlKey";
8321
- function No(n, e) {
8169
+ const Ic = ue ? "altKey" : "ctrlKey";
8170
+ function vo(n, e) {
8322
8171
  let t;
8323
8172
  return n.someProp("dragCopies", (r) => {
8324
8173
  t = t || r(e);
8325
- }), t != null ? !t : !e[Pc];
8174
+ }), t != null ? !t : !e[Ic];
8326
8175
  }
8327
8176
  ee.dragstart = (n, e) => {
8328
8177
  let t = e, r = n.input.mouseDown;
@@ -8338,7 +8187,7 @@ ee.dragstart = (n, e) => {
8338
8187
  }
8339
8188
  }
8340
8189
  let l = (o || n.state.selection).content(), { dom: a, text: c, slice: d } = Hr(n, l);
8341
- (!t.dataTransfer.files.length || !U || Qs > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(zt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", zt || t.dataTransfer.setData("text/plain", c), n.dragging = new Eo(d, No(n, t), o);
8190
+ (!t.dataTransfer.files.length || !U || Qs > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(zt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", zt || t.dataTransfer.setData("text/plain", c), n.dragging = new No(d, vo(n, t), o);
8342
8191
  };
8343
8192
  ee.dragend = (n) => {
8344
8193
  let e = n.dragging;
@@ -8349,12 +8198,12 @@ ee.dragend = (n) => {
8349
8198
  te.dragover = te.dragenter = (n, e) => e.preventDefault();
8350
8199
  te.drop = (n, e) => {
8351
8200
  try {
8352
- Bc(n, e, n.dragging);
8201
+ Rc(n, e, n.dragging);
8353
8202
  } finally {
8354
8203
  n.dragging = null;
8355
8204
  }
8356
8205
  };
8357
- function Bc(n, e, t) {
8206
+ function Rc(n, e, t) {
8358
8207
  if (!e.dataTransfer)
8359
8208
  return;
8360
8209
  let r = n.posAtCoords(Bn(e));
@@ -8363,8 +8212,8 @@ function Bc(n, e, t) {
8363
8212
  let i = n.state.doc.resolve(r.pos), s = t && t.slice;
8364
8213
  s ? n.someProp("transformPasted", (h) => {
8365
8214
  s = h(s, n, !1);
8366
- }) : s = yo(n, vo(e.dataTransfer), zt ? null : e.dataTransfer.getData("text/html"), !1, i);
8367
- let o = !!(t && No(n, e));
8215
+ }) : s = yo(n, Eo(e.dataTransfer), zt ? null : e.dataTransfer.getData("text/html"), !1, i);
8216
+ let o = !!(t && vo(n, e));
8368
8217
  if (n.someProp("handleDrop", (h) => h(n, e, s || k.empty, o))) {
8369
8218
  e.preventDefault();
8370
8219
  return;
@@ -8401,7 +8250,7 @@ ee.blur = (n, e) => {
8401
8250
  n.focused && (n.domObserver.stop(), n.dom.classList.remove("ProseMirror-focused"), n.domObserver.start(), t.relatedTarget && n.dom.contains(t.relatedTarget) && n.domObserver.currentSelection.clear(), n.focused = !1);
8402
8251
  };
8403
8252
  ee.beforeinput = (n, e) => {
8404
- if (U && Ee && e.inputType == "deleteContentBackward") {
8253
+ if (U && Ne && e.inputType == "deleteContentBackward") {
8405
8254
  n.domObserver.flushSoon();
8406
8255
  let { domChangeCount: r } = n.input;
8407
8256
  setTimeout(() => {
@@ -8610,7 +8459,7 @@ class z {
8610
8459
  let a = this.local[l].map(e, r, i);
8611
8460
  a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
8612
8461
  }
8613
- return this.children.length ? Lc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
8462
+ return this.children.length ? Pc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
8614
8463
  }
8615
8464
  /**
8616
8465
  Add the given array of decorations to the ones in the set,
@@ -8788,7 +8637,7 @@ class Pe {
8788
8637
  this.members[t].forEachSet(e);
8789
8638
  }
8790
8639
  }
8791
- function Lc(n, e, t, r, i, s, o) {
8640
+ function Pc(n, e, t, r, i, s, o) {
8792
8641
  let l = n.slice();
8793
8642
  for (let c = 0, d = s; c < t.maps.length; c++) {
8794
8643
  let u = 0;
@@ -8824,7 +8673,7 @@ function Lc(n, e, t, r, i, s, o) {
8824
8673
  a = !0;
8825
8674
  }
8826
8675
  if (a) {
8827
- let c = zc(l, n, e, t, i, s, o), d = kn(c, r, 0, o);
8676
+ let c = Bc(l, n, e, t, i, s, o), d = kn(c, r, 0, o);
8828
8677
  e = d.local;
8829
8678
  for (let u = 0; u < l.length; u += 3)
8830
8679
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -8847,7 +8696,7 @@ function Ao(n, e) {
8847
8696
  }
8848
8697
  return t;
8849
8698
  }
8850
- function zc(n, e, t, r, i, s, o) {
8699
+ function Bc(n, e, t, r, i, s, o) {
8851
8700
  function l(a, c) {
8852
8701
  for (let d = 0; d < a.local.length; d++) {
8853
8702
  let u = a.local[d].map(r, i, c);
@@ -8922,15 +8771,15 @@ function er(n) {
8922
8771
  r && r != Y && e.push(r);
8923
8772
  }), n.cursorWrapper && e.push(z.create(n.state.doc, [n.cursorWrapper.deco])), Pe.from(e);
8924
8773
  }
8925
- const Fc = {
8774
+ const Lc = {
8926
8775
  childList: !0,
8927
8776
  characterData: !0,
8928
8777
  characterDataOldValue: !0,
8929
8778
  attributes: !0,
8930
8779
  attributeOldValue: !0,
8931
8780
  subtree: !0
8932
- }, $c = ie && Ve <= 11;
8933
- class Vc {
8781
+ }, zc = ie && Ve <= 11;
8782
+ class Fc {
8934
8783
  constructor() {
8935
8784
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
8936
8785
  }
@@ -8944,13 +8793,13 @@ class Vc {
8944
8793
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8945
8794
  }
8946
8795
  }
8947
- class Hc {
8796
+ class $c {
8948
8797
  constructor(e, t) {
8949
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Vc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8798
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Fc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8950
8799
  for (let i = 0; i < r.length; i++)
8951
8800
  this.queue.push(r[i]);
8952
8801
  ie && Ve <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : X && e.composing && r.some((i) => i.type == "childList" && i.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
8953
- }), $c && (this.onCharData = (r) => {
8802
+ }), zc && (this.onCharData = (r) => {
8954
8803
  this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
8955
8804
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
8956
8805
  }
@@ -8963,7 +8812,7 @@ class Hc {
8963
8812
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8964
8813
  }
8965
8814
  start() {
8966
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Fc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8815
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Lc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8967
8816
  }
8968
8817
  stop() {
8969
8818
  if (this.observer) {
@@ -9058,12 +8907,12 @@ class Hc {
9058
8907
  let { focusNode: u } = this.currentSelection;
9059
8908
  for (let f of d) {
9060
8909
  let h = f.parentNode;
9061
- h && h.nodeName == "LI" && (!u || jc(e, u) != h) && f.remove();
8910
+ h && h.nodeName == "LI" && (!u || Wc(e, u) != h) && f.remove();
9062
8911
  }
9063
8912
  }
9064
8913
  }
9065
8914
  let c = null;
9066
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Rn(r) && (c = $r(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ae(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Wc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Kc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ae(e), this.currentSelection.set(r));
8915
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Rn(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ae(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Vc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, qc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ae(e), this.currentSelection.set(r));
9067
8916
  }
9068
8917
  registerMutation(e, t) {
9069
8918
  if (t.indexOf(e.target) > -1)
@@ -9099,7 +8948,7 @@ class Hc {
9099
8948
  }
9100
8949
  }
9101
8950
  let Ui = /* @__PURE__ */ new WeakMap(), _i = !1;
9102
- function Wc(n) {
8951
+ function Vc(n) {
9103
8952
  if (!Ui.has(n) && (Ui.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
9104
8953
  if (n.requiresGeckoHackNode = pe, _i)
9105
8954
  return;
@@ -9110,7 +8959,7 @@ function Gi(n, e) {
9110
8959
  let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
9111
8960
  return ot(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
9112
8961
  }
9113
- function qc(n, e) {
8962
+ function Hc(n, e) {
9114
8963
  if (e.getComposedRanges) {
9115
8964
  let i = e.getComposedRanges(n.root)[0];
9116
8965
  if (i)
@@ -9122,7 +8971,7 @@ function qc(n, e) {
9122
8971
  }
9123
8972
  return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Gi(n, t) : null;
9124
8973
  }
9125
- function jc(n, e) {
8974
+ function Wc(n, e) {
9126
8975
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
9127
8976
  let r = n.docView.nearestDesc(t, !0);
9128
8977
  if (r && r.node.isBlock)
@@ -9130,7 +8979,7 @@ function jc(n, e) {
9130
8979
  }
9131
8980
  return null;
9132
8981
  }
9133
- function Kc(n, e) {
8982
+ function qc(n, e) {
9134
8983
  var t;
9135
8984
  let { focusNode: r, focusOffset: i } = n.domSelectionRange();
9136
8985
  for (let s of e)
@@ -9151,7 +9000,7 @@ function Kc(n, e) {
9151
9000
  s.parentNode.removeChild(s);
9152
9001
  }
9153
9002
  }
9154
- function Jc(n, e, t) {
9003
+ function jc(n, e, t) {
9155
9004
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
9156
9005
  if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Rn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
9157
9006
  for (let g = s; g > i; g--) {
@@ -9171,7 +9020,7 @@ function Jc(n, e, t) {
9171
9020
  to: s,
9172
9021
  preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
9173
9022
  findPositions: c,
9174
- ruleFromNode: Uc,
9023
+ ruleFromNode: Kc,
9175
9024
  context: h
9176
9025
  });
9177
9026
  if (c && c[0].pos != null) {
@@ -9180,7 +9029,7 @@ function Jc(n, e, t) {
9180
9029
  }
9181
9030
  return { doc: m, sel: p, from: o, to: l };
9182
9031
  }
9183
- function Uc(n) {
9032
+ function Kc(n) {
9184
9033
  let e = n.pmViewDesc;
9185
9034
  if (e)
9186
9035
  return e.parseRule();
@@ -9194,25 +9043,25 @@ function Uc(n) {
9194
9043
  return { ignore: !0 };
9195
9044
  return null;
9196
9045
  }
9197
- const _c = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9198
- function Gc(n, e, t, r, i) {
9046
+ const Jc = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9047
+ function Uc(n, e, t, r, i) {
9199
9048
  let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
9200
9049
  if (n.input.compositionPendingChanges = 0, e < 0) {
9201
- let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = $r(n, C);
9202
- if (N && !n.state.selection.eq(N)) {
9203
- if (U && Ee && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (pl) => pl(n, Ue(13, "Enter"))))
9050
+ let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, v = $r(n, C);
9051
+ if (v && !n.state.selection.eq(v)) {
9052
+ if (U && Ne && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (pl) => pl(n, Ue(13, "Enter"))))
9204
9053
  return;
9205
- let G = n.state.tr.setSelection(N);
9054
+ let G = n.state.tr.setSelection(v);
9206
9055
  C == "pointer" ? G.setMeta("pointer", !0) : C == "key" && G.scrollIntoView(), s && G.setMeta("composition", s), n.dispatch(G);
9207
9056
  }
9208
9057
  return;
9209
9058
  }
9210
9059
  let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
9211
9060
  e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
9212
- let a = n.state.selection, c = Jc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9061
+ let a = n.state.selection, c = jc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9213
9062
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
9214
- let p = Zc(u.content, c.doc.content, c.from, f, h);
9215
- if (p && n.input.domChangeCount++, (St && n.input.lastIOSEnter > Date.now() - 225 || Ee) && i.some((C) => C.nodeType == 1 && !_c.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
9063
+ let p = Yc(u.content, c.doc.content, c.from, f, h);
9064
+ if (p && n.input.domChangeCount++, (St && n.input.lastIOSEnter > Date.now() - 225 || Ne) && i.some((C) => C.nodeType == 1 && !Jc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
9216
9065
  n.input.lastIOSEnter = 0;
9217
9066
  return;
9218
9067
  }
@@ -9223,8 +9072,8 @@ function Gc(n, e, t, r, i) {
9223
9072
  if (c.sel) {
9224
9073
  let C = Yi(n, n.state.doc, c.sel);
9225
9074
  if (C && !C.eq(n.state.selection)) {
9226
- let N = n.state.tr.setSelection(C);
9227
- s && N.setMeta("composition", s), n.dispatch(N);
9075
+ let v = n.state.tr.setSelection(C);
9076
+ s && v.setMeta("composition", s), n.dispatch(v);
9228
9077
  }
9229
9078
  }
9230
9079
  return;
@@ -9235,37 +9084,37 @@ function Gc(n, e, t, r, i) {
9235
9084
  n.input.lastIOSEnter = 0;
9236
9085
  return;
9237
9086
  }
9238
- if (n.state.selection.anchor > p.start && Xc(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
9239
- Ee && U && n.domObserver.suppressSelectionUpdates();
9087
+ if (n.state.selection.anchor > p.start && Gc(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
9088
+ Ne && U && n.domObserver.suppressSelectionUpdates();
9240
9089
  return;
9241
9090
  }
9242
- U && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), Ee && !O && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
9091
+ U && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), Ne && !O && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
9243
9092
  n.someProp("handleKeyDown", function(C) {
9244
9093
  return C(n, Ue(13, "Enter"));
9245
9094
  });
9246
9095
  }, 20));
9247
9096
  let w = p.start, I = p.endA, D = (C) => {
9248
- let N = C || n.state.tr.replace(w, I, c.doc.slice(p.start - c.from, p.endB - c.from));
9097
+ let v = C || n.state.tr.replace(w, I, c.doc.slice(p.start - c.from, p.endB - c.from));
9249
9098
  if (c.sel) {
9250
- let G = Yi(n, N.doc, c.sel);
9251
- G && !(U && n.composing && G.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (G.head == w || G.head == N.mapping.map(I) - 1) || ie && G.empty && G.head == w) && N.setSelection(G);
9099
+ let G = Yi(n, v.doc, c.sel);
9100
+ G && !(U && n.composing && G.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (G.head == w || G.head == v.mapping.map(I) - 1) || ie && G.empty && G.head == w) && v.setSelection(G);
9252
9101
  }
9253
- return s && N.setMeta("composition", s), N.scrollIntoView();
9102
+ return s && v.setMeta("composition", s), v.scrollIntoView();
9254
9103
  }, L;
9255
9104
  if (O)
9256
9105
  if (m.pos == g.pos) {
9257
9106
  ie && Ve <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Ae(n), 20));
9258
- let C = D(n.state.tr.delete(w, I)), N = d.resolve(p.start).marksAcross(d.resolve(p.endA));
9259
- N && C.ensureMarks(N), n.dispatch(C);
9107
+ let C = D(n.state.tr.delete(w, I)), v = d.resolve(p.start).marksAcross(d.resolve(p.endA));
9108
+ v && C.ensureMarks(v), n.dispatch(C);
9260
9109
  } else if (
9261
9110
  // Adding or removing a mark
9262
- p.endA == p.endB && (L = Yc(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9111
+ p.endA == p.endB && (L = _c(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9263
9112
  ) {
9264
9113
  let C = D(n.state.tr);
9265
9114
  L.type == "add" ? C.addMark(w, I, L.mark) : C.removeMark(w, I, L.mark), n.dispatch(C);
9266
9115
  } else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
9267
- let C = m.parent.textBetween(m.parentOffset, g.parentOffset), N = () => D(n.state.tr.insertText(C, w, I));
9268
- n.someProp("handleTextInput", (G) => G(n, w, I, C, N)) || n.dispatch(N());
9116
+ let C = m.parent.textBetween(m.parentOffset, g.parentOffset), v = () => D(n.state.tr.insertText(C, w, I));
9117
+ n.someProp("handleTextInput", (G) => G(n, w, I, C, v)) || n.dispatch(v());
9269
9118
  } else
9270
9119
  n.dispatch(D());
9271
9120
  else
@@ -9274,7 +9123,7 @@ function Gc(n, e, t, r, i) {
9274
9123
  function Yi(n, e, t) {
9275
9124
  return Math.max(t.anchor, t.head) > e.content.size ? null : Vr(n, e.resolve(t.anchor), e.resolve(t.head));
9276
9125
  }
9277
- function Yc(n, e) {
9126
+ function _c(n, e) {
9278
9127
  let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
9279
9128
  for (let d = 0; d < r.length; d++)
9280
9129
  i = r[d].removeFromSet(i);
@@ -9292,7 +9141,7 @@ function Yc(n, e) {
9292
9141
  if (b.from(c).eq(n))
9293
9142
  return { mark: l, type: o };
9294
9143
  }
9295
- function Xc(n, e, t, r, i) {
9144
+ function Gc(n, e, t, r, i) {
9296
9145
  if (
9297
9146
  // The content must have shrunk
9298
9147
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -9320,7 +9169,7 @@ function tr(n, e, t) {
9320
9169
  }
9321
9170
  return i;
9322
9171
  }
9323
- function Zc(n, e, t, r, i) {
9172
+ function Yc(n, e, t, r, i) {
9324
9173
  let s = n.findDiffStart(e, t);
9325
9174
  if (s == null)
9326
9175
  return null;
@@ -9353,7 +9202,7 @@ class Ro {
9353
9202
  added to the document.
9354
9203
  */
9355
9204
  constructor(e, t) {
9356
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new pc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), er(this), this.dom, this), this.domObserver = new Hc(this, (r, i, s, o) => Gc(this, r, i, s, o)), this.domObserver.start(), mc(this), this.updatePluginViews();
9205
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new fc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), er(this), this.dom, this), this.domObserver = new $c(this, (r, i, s, o) => Uc(this, r, i, s, o)), this.domObserver.start(), hc(this), this.updatePluginViews();
9357
9206
  }
9358
9207
  /**
9359
9208
  Holds `true` when a
@@ -9413,22 +9262,22 @@ class Ro {
9413
9262
  let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
9414
9263
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9415
9264
  let h = ts(this);
9416
- ed(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9265
+ Zc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9417
9266
  }
9418
9267
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Or(this), this.editable = es(this), Qi(this);
9419
9268
  let a = er(this), c = Zi(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
9420
9269
  (u || !e.selection.eq(i.selection)) && (o = !0);
9421
- let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Na(this);
9270
+ let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ea(this);
9422
9271
  if (o) {
9423
9272
  this.domObserver.stop();
9424
- let h = u && (ie || U) && !this.composing && !i.selection.empty && !e.selection.empty && Qc(i.selection, e.selection);
9273
+ let h = u && (ie || U) && !this.composing && !i.selection.empty && !e.selection.empty && Xc(i.selection, e.selection);
9425
9274
  if (u) {
9426
9275
  let p = U ? this.trackWrites = this.domSelectionRange().focusNode : null;
9427
- this.composing && (this.input.compositionNode = Nc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Ii(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9276
+ this.composing && (this.input.compositionNode = Ec(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Ii(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9428
9277
  }
9429
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Qa(this)) ? Ae(this, h) : (po(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9278
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Xa(this)) ? Ae(this, h) : (po(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9430
9279
  }
9431
- this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Aa(f);
9280
+ this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Na(f);
9432
9281
  }
9433
9282
  /**
9434
9283
  @internal
@@ -9473,7 +9322,7 @@ class Ro {
9473
9322
  let s = r.from + (this.state.doc.content.size - t.doc.content.size);
9474
9323
  (s > 0 && s < this.state.doc.content.size && this.state.doc.nodeAt(s)) == r.node && (i = s);
9475
9324
  }
9476
- this.dragging = new Eo(e.slice, e.move, i < 0 ? void 0 : S.create(this.state.doc, i));
9325
+ this.dragging = new No(e.slice, e.move, i < 0 ? void 0 : S.create(this.state.doc, i));
9477
9326
  }
9478
9327
  someProp(e, t) {
9479
9328
  let r = this._props && this._props[e], i;
@@ -9515,7 +9364,7 @@ class Ro {
9515
9364
  Focus the editor.
9516
9365
  */
9517
9366
  focus() {
9518
- this.domObserver.stop(), this.editable && Da(this.dom), Ae(this), this.domObserver.start();
9367
+ this.domObserver.stop(), this.editable && va(this.dom), Ae(this), this.domObserver.start();
9519
9368
  }
9520
9369
  /**
9521
9370
  Get the document root in which the editor exists. This will
@@ -9549,7 +9398,7 @@ class Ro {
9549
9398
  the top level, not in any node.
9550
9399
  */
9551
9400
  posAtCoords(e) {
9552
- return La(this, e);
9401
+ return Pa(this, e);
9553
9402
  }
9554
9403
  /**
9555
9404
  Returns the viewport rectangle at a given document position.
@@ -9614,7 +9463,7 @@ class Ro {
9614
9463
  pass a different state.
9615
9464
  */
9616
9465
  endOfTextblock(e, t) {
9617
- return Ha(this, t || this.state, e);
9466
+ return $a(this, t || this.state, e);
9618
9467
  }
9619
9468
  /**
9620
9469
  Run the editor's paste logic with the given HTML string. The
@@ -9646,7 +9495,7 @@ class Ro {
9646
9495
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9647
9496
  */
9648
9497
  destroy() {
9649
- this.docView && (gc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], er(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ka());
9498
+ this.docView && (pc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], er(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ya());
9650
9499
  }
9651
9500
  /**
9652
9501
  This is true when the view has been
@@ -9660,14 +9509,14 @@ class Ro {
9660
9509
  Used for testing.
9661
9510
  */
9662
9511
  dispatchEvent(e) {
9663
- return bc(this, e);
9512
+ return gc(this, e);
9664
9513
  }
9665
9514
  /**
9666
9515
  @internal
9667
9516
  */
9668
9517
  domSelectionRange() {
9669
9518
  let e = this.domSelection();
9670
- return e ? X && this.root.nodeType === 11 && Ca(this.dom.ownerDocument) == this.dom && qc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9519
+ return e ? X && this.root.nodeType === 11 && Ma(this.dom.ownerDocument) == this.dom && Hc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9671
9520
  }
9672
9521
  /**
9673
9522
  @internal
@@ -9698,7 +9547,7 @@ function Qi(n) {
9698
9547
  function es(n) {
9699
9548
  return !n.someProp("editable", (e) => e(n.state) === !1);
9700
9549
  }
9701
- function Qc(n, e) {
9550
+ function Xc(n, e) {
9702
9551
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
9703
9552
  return n.$anchor.start(t) != e.$anchor.start(t);
9704
9553
  }
@@ -9710,7 +9559,7 @@ function ts(n) {
9710
9559
  }
9711
9560
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
9712
9561
  }
9713
- function ed(n, e) {
9562
+ function Zc(n, e) {
9714
9563
  let t = 0, r = 0;
9715
9564
  for (let i in n) {
9716
9565
  if (n[i] != e[i])
@@ -9803,18 +9652,18 @@ var qe = {
9803
9652
  220: "|",
9804
9653
  221: "}",
9805
9654
  222: '"'
9806
- }, td = typeof navigator < "u" && /Mac/.test(navigator.platform), nd = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9655
+ }, Qc = typeof navigator < "u" && /Mac/.test(navigator.platform), ed = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9807
9656
  for (var J = 0; J < 10; J++) qe[48 + J] = qe[96 + J] = String(J);
9808
9657
  for (var J = 1; J <= 24; J++) qe[J + 111] = "F" + J;
9809
9658
  for (var J = 65; J <= 90; J++)
9810
9659
  qe[J] = String.fromCharCode(J + 32), xn[J] = String.fromCharCode(J);
9811
9660
  for (var nr in qe) xn.hasOwnProperty(nr) || (xn[nr] = qe[nr]);
9812
- function rd(n) {
9813
- var e = td && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || nd && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? xn : qe)[n.keyCode] || n.key || "Unidentified";
9661
+ function td(n) {
9662
+ var e = Qc && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || ed && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? xn : qe)[n.keyCode] || n.key || "Unidentified";
9814
9663
  return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
9815
9664
  }
9816
- const id = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), sd = typeof navigator < "u" && /Win/.test(navigator.platform);
9817
- function od(n) {
9665
+ const nd = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), rd = typeof navigator < "u" && /Win/.test(navigator.platform);
9666
+ function id(n) {
9818
9667
  let e = n.split(/-(?!$)/), t = e[e.length - 1];
9819
9668
  t == "Space" && (t = " ");
9820
9669
  let r, i, s, o;
@@ -9829,28 +9678,28 @@ function od(n) {
9829
9678
  else if (/^s(hift)?$/i.test(a))
9830
9679
  s = !0;
9831
9680
  else if (/^mod$/i.test(a))
9832
- id ? o = !0 : i = !0;
9681
+ nd ? o = !0 : i = !0;
9833
9682
  else
9834
9683
  throw new Error("Unrecognized modifier name: " + a);
9835
9684
  }
9836
9685
  return r && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
9837
9686
  }
9838
- function ld(n) {
9687
+ function sd(n) {
9839
9688
  let e = /* @__PURE__ */ Object.create(null);
9840
9689
  for (let t in n)
9841
- e[od(t)] = n[t];
9690
+ e[id(t)] = n[t];
9842
9691
  return e;
9843
9692
  }
9844
9693
  function rr(n, e, t = !0) {
9845
9694
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9846
9695
  }
9847
- function ad(n) {
9696
+ function od(n) {
9848
9697
  return new se({ props: { handleKeyDown: Po(n) } });
9849
9698
  }
9850
9699
  function Po(n) {
9851
- let e = ld(n);
9700
+ let e = sd(n);
9852
9701
  return function(t, r) {
9853
- let i = rd(r), s, o = e[rr(i, r)];
9702
+ let i = td(r), s, o = e[rr(i, r)];
9854
9703
  if (o && o(t.state, t.dispatch, t))
9855
9704
  return !0;
9856
9705
  if (i.length == 1 && i != " ") {
@@ -9860,7 +9709,7 @@ function Po(n) {
9860
9709
  return !0;
9861
9710
  }
9862
9711
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9863
- !(sd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
9712
+ !(rd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
9864
9713
  let l = e[rr(s, r)];
9865
9714
  if (l && l(t.state, t.dispatch, t))
9866
9715
  return !0;
@@ -9892,7 +9741,7 @@ const Lo = (n, e, t) => {
9892
9741
  if (l && l.slice.size < l.to - l.from) {
9893
9742
  if (e) {
9894
9743
  let a = n.tr.step(l);
9895
- a.setSelection(Mt(s, "end") ? v.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
9744
+ a.setSelection(Mt(s, "end") ? E.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
9896
9745
  }
9897
9746
  return !0;
9898
9747
  }
@@ -9900,13 +9749,13 @@ const Lo = (n, e, t) => {
9900
9749
  break;
9901
9750
  }
9902
9751
  return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
9903
- }, cd = (n, e, t) => {
9752
+ }, ld = (n, e, t) => {
9904
9753
  let r = Bo(n, t);
9905
9754
  if (!r)
9906
9755
  return !1;
9907
9756
  let i = _r(r);
9908
9757
  return i ? zo(n, i, e) : !1;
9909
- }, dd = (n, e, t) => {
9758
+ }, ad = (n, e, t) => {
9910
9759
  let r = $o(n, t);
9911
9760
  if (!r)
9912
9761
  return !1;
@@ -9991,7 +9840,7 @@ const Vo = (n, e, t) => {
9991
9840
  if (o && o.slice.size < o.to - o.from) {
9992
9841
  if (e) {
9993
9842
  let l = n.tr.step(o);
9994
- l.setSelection(Mt(s, "start") ? v.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
9843
+ l.setSelection(Mt(s, "start") ? E.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
9995
9844
  }
9996
9845
  return !0;
9997
9846
  }
@@ -10020,7 +9869,7 @@ function Gr(n) {
10020
9869
  }
10021
9870
  return null;
10022
9871
  }
10023
- const ud = (n, e) => {
9872
+ const cd = (n, e) => {
10024
9873
  let t = n.selection, r = t instanceof S, i;
10025
9874
  if (r) {
10026
9875
  if (t.node.isTextblock || !je(n.doc, t.from))
@@ -10033,7 +9882,7 @@ const ud = (n, e) => {
10033
9882
  r && s.setSelection(S.create(s.doc, i - n.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
10034
9883
  }
10035
9884
  return !0;
10036
- }, fd = (n, e) => {
9885
+ }, dd = (n, e) => {
10037
9886
  let t = n.selection, r;
10038
9887
  if (t instanceof S) {
10039
9888
  if (t.node.isTextblock || !je(n.doc, t.to))
@@ -10042,7 +9891,7 @@ const ud = (n, e) => {
10042
9891
  } else if (r = An(n.doc, t.to, 1), r == null)
10043
9892
  return !1;
10044
9893
  return e && e(n.tr.join(r).scrollIntoView()), !0;
10045
- }, hd = (n, e) => {
9894
+ }, ud = (n, e) => {
10046
9895
  let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && wt(i);
10047
9896
  return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
10048
9897
  }, Wo = (n, e) => {
@@ -10058,7 +9907,7 @@ function Yr(n) {
10058
9907
  }
10059
9908
  return null;
10060
9909
  }
10061
- const pd = (n, e) => {
9910
+ const fd = (n, e) => {
10062
9911
  let { $head: t, $anchor: r } = n.selection;
10063
9912
  if (!t.parent.type.spec.code || !t.sameParent(r))
10064
9913
  return !1;
@@ -10067,7 +9916,7 @@ const pd = (n, e) => {
10067
9916
  return !1;
10068
9917
  if (e) {
10069
9918
  let l = t.after(), a = n.tr.replaceWith(l, l, o.createAndFill());
10070
- a.setSelection(v.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
9919
+ a.setSelection(E.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
10071
9920
  }
10072
9921
  return !0;
10073
9922
  }, qo = (n, e) => {
@@ -10088,17 +9937,17 @@ const pd = (n, e) => {
10088
9937
  return !1;
10089
9938
  if (t.depth > 1 && t.after() != t.end(-1)) {
10090
9939
  let s = t.before();
10091
- if (Ne(n.doc, s))
9940
+ if (ve(n.doc, s))
10092
9941
  return e && e(n.tr.split(s).scrollIntoView()), !0;
10093
9942
  }
10094
9943
  let r = t.blockRange(), i = r && wt(r);
10095
9944
  return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
10096
9945
  };
10097
- function md(n) {
9946
+ function hd(n) {
10098
9947
  return (e, t) => {
10099
9948
  let { $from: r, $to: i } = e.selection;
10100
9949
  if (e.selection instanceof S && e.selection.node.isBlock)
10101
- return !r.parentOffset || !Ne(e.doc, r.pos) ? !1 : (t && t(e.tr.split(r.pos).scrollIntoView()), !0);
9950
+ return !r.parentOffset || !ve(e.doc, r.pos) ? !1 : (t && t(e.tr.split(r.pos).scrollIntoView()), !0);
10102
9951
  if (!r.depth)
10103
9952
  return !1;
10104
9953
  let s = [], o, l, a = !1, c = !1;
@@ -10113,8 +9962,8 @@ function md(n) {
10113
9962
  }
10114
9963
  let d = e.tr;
10115
9964
  (e.selection instanceof M || e.selection instanceof ce) && d.deleteSelection();
10116
- let u = d.mapping.map(r.pos), f = Ne(d.doc, u, s.length, s);
10117
- if (f || (s[0] = l ? { type: l } : null, f = Ne(d.doc, u, s.length, s)), !f)
9965
+ let u = d.mapping.map(r.pos), f = ve(d.doc, u, s.length, s);
9966
+ if (f || (s[0] = l ? { type: l } : null, f = ve(d.doc, u, s.length, s)), !f)
10118
9967
  return !1;
10119
9968
  if (d.split(u, s.length, s), !a && c && r.node(o).type != l) {
10120
9969
  let h = d.mapping.map(r.before(o)), p = d.doc.resolve(h);
@@ -10123,17 +9972,17 @@ function md(n) {
10123
9972
  return t && t(d.scrollIntoView()), !0;
10124
9973
  };
10125
9974
  }
10126
- const gd = md(), yd = (n, e) => {
9975
+ const pd = hd(), md = (n, e) => {
10127
9976
  let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
10128
9977
  return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(S.create(n.doc, i))), !0);
10129
9978
  };
10130
- function bd(n, e, t) {
9979
+ function gd(n, e, t) {
10131
9980
  let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
10132
9981
  return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || je(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
10133
9982
  }
10134
9983
  function Ko(n, e, t, r) {
10135
9984
  let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
10136
- if (!a && bd(n, e, t))
9985
+ if (!a && gd(n, e, t))
10137
9986
  return !0;
10138
9987
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
10139
9988
  if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
@@ -10147,7 +9996,7 @@ function Ko(n, e, t, r) {
10147
9996
  }
10148
9997
  return !0;
10149
9998
  }
10150
- let d = s.type.spec.isolating || r > 0 && a ? null : v.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u && wt(u);
9999
+ let d = s.type.spec.isolating || r > 0 && a ? null : E.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u && wt(u);
10151
10000
  if (f != null && f >= e.depth)
10152
10001
  return t && t(n.tr.lift(u, f).scrollIntoView()), !0;
10153
10002
  if (c && Mt(s, "start", !0) && Mt(i, "end")) {
@@ -10181,8 +10030,8 @@ function Jo(n) {
10181
10030
  return i.node(s).isTextblock ? (t && t(e.tr.setSelection(M.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
10182
10031
  };
10183
10032
  }
10184
- const kd = Jo(-1), xd = Jo(1);
10185
- function Sd(n, e = null) {
10033
+ const yd = Jo(-1), bd = Jo(1);
10034
+ function kd(n, e = null) {
10186
10035
  return function(t, r) {
10187
10036
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && Lr(o, n, e);
10188
10037
  return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
@@ -10228,18 +10077,18 @@ function Xr(...n) {
10228
10077
  }
10229
10078
  Xr(Ur, Lo, Fo);
10230
10079
  Xr(Ur, Vo, Ho);
10231
- Xr(Wo, qo, jo, gd);
10080
+ Xr(Wo, qo, jo, pd);
10232
10081
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
10233
- function Md(n, e = null) {
10082
+ function xd(n, e = null) {
10234
10083
  return function(t, r) {
10235
10084
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s);
10236
10085
  if (!o)
10237
10086
  return !1;
10238
10087
  let l = r ? t.tr : null;
10239
- return wd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10088
+ return Sd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10240
10089
  };
10241
10090
  }
10242
- function wd(n, e, t, r = null) {
10091
+ function Sd(n, e, t, r = null) {
10243
10092
  let i = !1, s = e, o = e.$from.doc;
10244
10093
  if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
10245
10094
  if (e.$from.index(e.depth - 1) == 0)
@@ -10248,9 +10097,9 @@ function wd(n, e, t, r = null) {
10248
10097
  s = new hn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new hn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
10249
10098
  }
10250
10099
  let l = Lr(s, t, r, e);
10251
- return l ? (n && Cd(n, e, l, i, t), !0) : !1;
10100
+ return l ? (n && Md(n, e, l, i, t), !0) : !1;
10252
10101
  }
10253
- function Cd(n, e, t, r, i) {
10102
+ function Md(n, e, t, r, i) {
10254
10103
  let s = b.empty;
10255
10104
  for (let d = t.length - 1; d >= 0; d--)
10256
10105
  s = b.from(t[d].type.create(t[d].attrs, s));
@@ -10260,16 +10109,16 @@ function Cd(n, e, t, r, i) {
10260
10109
  t[d].type == i && (o = d + 1);
10261
10110
  let l = t.length - o, a = e.start + t.length - (r ? 2 : 0), c = e.parent;
10262
10111
  for (let d = e.startIndex, u = e.endIndex, f = !0; d < u; d++, f = !1)
10263
- !f && Ne(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
10112
+ !f && ve(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
10264
10113
  return n;
10265
10114
  }
10266
- function Td(n) {
10115
+ function wd(n) {
10267
10116
  return function(e, t) {
10268
10117
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == n);
10269
- return s ? t ? r.node(s.depth - 1).type == n ? Od(e, t, n, s) : vd(e, t, s) : !0 : !1;
10118
+ return s ? t ? r.node(s.depth - 1).type == n ? Cd(e, t, n, s) : Td(e, t, s) : !0 : !1;
10270
10119
  };
10271
10120
  }
10272
- function Od(n, e, t, r) {
10121
+ function Cd(n, e, t, r) {
10273
10122
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
10274
10123
  s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new hn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
10275
10124
  const l = wt(r);
@@ -10279,7 +10128,7 @@ function Od(n, e, t, r) {
10279
10128
  let a = i.doc.resolve(i.mapping.map(s, -1) - 1);
10280
10129
  return je(i.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && i.join(a.pos), e(i.scrollIntoView()), !0;
10281
10130
  }
10282
- function vd(n, e, t) {
10131
+ function Td(n, e, t) {
10283
10132
  let r = n.tr, i = t.parent;
10284
10133
  for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
10285
10134
  h -= i.child(p).nodeSize, r.delete(h - 1, h + 1);
@@ -10292,7 +10141,7 @@ function vd(n, e, t) {
10292
10141
  let u = s.pos, f = u + o.nodeSize;
10293
10142
  return r.step(new F(u - (l ? 1 : 0), f + (a ? 1 : 0), u + 1, f - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
10294
10143
  }
10295
- function Ed(n) {
10144
+ function Od(n) {
10296
10145
  return function(e, t) {
10297
10146
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == n);
10298
10147
  if (!s)
@@ -10395,7 +10244,7 @@ class zn {
10395
10244
  return l;
10396
10245
  }
10397
10246
  }
10398
- class Nd {
10247
+ class Ed {
10399
10248
  constructor() {
10400
10249
  this.callbacks = {};
10401
10250
  }
@@ -10521,7 +10370,7 @@ function H(...n) {
10521
10370
  }), r;
10522
10371
  }, {});
10523
10372
  }
10524
- function vr(n, e) {
10373
+ function Er(n, e) {
10525
10374
  return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
10526
10375
  [t.name]: n.attrs[t.name]
10527
10376
  }).reduce((t, r) => H(t, r), {});
@@ -10529,13 +10378,13 @@ function vr(n, e) {
10529
10378
  function _o(n) {
10530
10379
  return typeof n == "function";
10531
10380
  }
10532
- function E(n, e = void 0, ...t) {
10381
+ function N(n, e = void 0, ...t) {
10533
10382
  return _o(n) ? e ? n.bind(e)(...t) : n(...t) : n;
10534
10383
  }
10535
- function Ad(n = {}) {
10384
+ function Nd(n = {}) {
10536
10385
  return Object.keys(n).length === 0 && n.constructor === Object;
10537
10386
  }
10538
- function Dd(n) {
10387
+ function vd(n) {
10539
10388
  return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
10540
10389
  }
10541
10390
  function is(n, e) {
@@ -10546,7 +10395,7 @@ function is(n, e) {
10546
10395
  if (r === !1)
10547
10396
  return !1;
10548
10397
  const i = e.reduce((s, o) => {
10549
- const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Dd(t.getAttribute(o.name));
10398
+ const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : vd(t.getAttribute(o.name));
10550
10399
  return l == null ? s : {
10551
10400
  ...s,
10552
10401
  [o.name]: l
@@ -10559,10 +10408,10 @@ function is(n, e) {
10559
10408
  function ss(n) {
10560
10409
  return Object.fromEntries(
10561
10410
  // @ts-ignore
10562
- Object.entries(n).filter(([e, t]) => e === "attrs" && Ad(t) ? !1 : t != null)
10411
+ Object.entries(n).filter(([e, t]) => e === "attrs" && Nd(t) ? !1 : t != null)
10563
10412
  );
10564
10413
  }
10565
- function Id(n, e) {
10414
+ function Ad(n, e) {
10566
10415
  var t;
10567
10416
  const r = Uo(n), { nodeExtensions: i, markExtensions: s } = Fn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10568
10417
  const d = r.filter((y) => y.type === c.name), u = {
@@ -10578,28 +10427,28 @@ function Id(n, e) {
10578
10427
  };
10579
10428
  }, {}), h = ss({
10580
10429
  ...f,
10581
- content: E(x(c, "content", u)),
10582
- marks: E(x(c, "marks", u)),
10583
- group: E(x(c, "group", u)),
10584
- inline: E(x(c, "inline", u)),
10585
- atom: E(x(c, "atom", u)),
10586
- selectable: E(x(c, "selectable", u)),
10587
- draggable: E(x(c, "draggable", u)),
10588
- code: E(x(c, "code", u)),
10589
- whitespace: E(x(c, "whitespace", u)),
10590
- linebreakReplacement: E(x(c, "linebreakReplacement", u)),
10591
- defining: E(x(c, "defining", u)),
10592
- isolating: E(x(c, "isolating", u)),
10430
+ content: N(x(c, "content", u)),
10431
+ marks: N(x(c, "marks", u)),
10432
+ group: N(x(c, "group", u)),
10433
+ inline: N(x(c, "inline", u)),
10434
+ atom: N(x(c, "atom", u)),
10435
+ selectable: N(x(c, "selectable", u)),
10436
+ draggable: N(x(c, "draggable", u)),
10437
+ code: N(x(c, "code", u)),
10438
+ whitespace: N(x(c, "whitespace", u)),
10439
+ linebreakReplacement: N(x(c, "linebreakReplacement", u)),
10440
+ defining: N(x(c, "defining", u)),
10441
+ isolating: N(x(c, "isolating", u)),
10593
10442
  attrs: Object.fromEntries(d.map((y) => {
10594
10443
  var O;
10595
10444
  return [y.name, { default: (O = y == null ? void 0 : y.attribute) === null || O === void 0 ? void 0 : O.default }];
10596
10445
  }))
10597
- }), p = E(x(c, "parseHTML", u));
10446
+ }), p = N(x(c, "parseHTML", u));
10598
10447
  p && (h.parseDOM = p.map((y) => is(y, d)));
10599
10448
  const m = x(c, "renderHTML", u);
10600
10449
  m && (h.toDOM = (y) => m({
10601
10450
  node: y,
10602
- HTMLAttributes: vr(y, d)
10451
+ HTMLAttributes: Er(y, d)
10603
10452
  }));
10604
10453
  const g = x(c, "renderText", u);
10605
10454
  return g && (h.toText = g), [c.name, h];
@@ -10617,21 +10466,21 @@ function Id(n, e) {
10617
10466
  };
10618
10467
  }, {}), h = ss({
10619
10468
  ...f,
10620
- inclusive: E(x(c, "inclusive", u)),
10621
- excludes: E(x(c, "excludes", u)),
10622
- group: E(x(c, "group", u)),
10623
- spanning: E(x(c, "spanning", u)),
10624
- code: E(x(c, "code", u)),
10469
+ inclusive: N(x(c, "inclusive", u)),
10470
+ excludes: N(x(c, "excludes", u)),
10471
+ group: N(x(c, "group", u)),
10472
+ spanning: N(x(c, "spanning", u)),
10473
+ code: N(x(c, "code", u)),
10625
10474
  attrs: Object.fromEntries(d.map((g) => {
10626
10475
  var y;
10627
10476
  return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
10628
10477
  }))
10629
- }), p = E(x(c, "parseHTML", u));
10478
+ }), p = N(x(c, "parseHTML", u));
10630
10479
  p && (h.parseDOM = p.map((g) => is(g, d)));
10631
10480
  const m = x(c, "renderHTML", u);
10632
10481
  return m && (h.toDOM = (g) => m({
10633
10482
  mark: g,
10634
- HTMLAttributes: vr(g, d)
10483
+ HTMLAttributes: Er(g, d)
10635
10484
  })), [c.name, h];
10636
10485
  }));
10637
10486
  return new Ps({
@@ -10650,7 +10499,7 @@ function Zr(n, e) {
10650
10499
  const t = dt.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
10651
10500
  return i.appendChild(t), i.innerHTML;
10652
10501
  }
10653
- const Rd = (n, e = 500) => {
10502
+ const Dd = (n, e = 500) => {
10654
10503
  let t = "";
10655
10504
  const r = n.parentOffset;
10656
10505
  return n.parent.nodesBetween(Math.max(0, r - e), r, (i, s, o, l) => {
@@ -10672,7 +10521,7 @@ class $n {
10672
10521
  this.find = e.find, this.handler = e.handler;
10673
10522
  }
10674
10523
  }
10675
- const Pd = (n, e) => {
10524
+ const Id = (n, e) => {
10676
10525
  if (Qr(e))
10677
10526
  return e.exec(n);
10678
10527
  const t = e(n);
@@ -10693,11 +10542,11 @@ function en(n) {
10693
10542
  )
10694
10543
  return !1;
10695
10544
  let d = !1;
10696
- const u = Rd(c) + s;
10545
+ const u = Dd(c) + s;
10697
10546
  return o.forEach((f) => {
10698
10547
  if (d)
10699
10548
  return;
10700
- const h = Pd(u, f.find);
10549
+ const h = Id(u, f.find);
10701
10550
  if (!h)
10702
10551
  return;
10703
10552
  const p = a.state.tr, m = Ln({
@@ -10725,7 +10574,7 @@ function en(n) {
10725
10574
  }), a.dispatch(p), d = !0);
10726
10575
  }), d;
10727
10576
  }
10728
- function Bd(n) {
10577
+ function Rd(n) {
10729
10578
  const { editor: e, rules: t } = n, r = new se({
10730
10579
  state: {
10731
10580
  init() {
@@ -10797,11 +10646,11 @@ function Bd(n) {
10797
10646
  });
10798
10647
  return r;
10799
10648
  }
10800
- function Ld(n) {
10649
+ function Pd(n) {
10801
10650
  return Object.prototype.toString.call(n).slice(8, -1);
10802
10651
  }
10803
10652
  function tn(n) {
10804
- return Ld(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10653
+ return Pd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10805
10654
  }
10806
10655
  function Vn(n, e) {
10807
10656
  const t = { ...n };
@@ -10817,9 +10666,9 @@ class Me {
10817
10666
  }, this.config = {
10818
10667
  ...this.config,
10819
10668
  ...e
10820
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
10669
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = N(x(this, "addOptions", {
10821
10670
  name: this.name
10822
- }))), this.storage = E(x(this, "addStorage", {
10671
+ }))), this.storage = N(x(this, "addStorage", {
10823
10672
  name: this.name,
10824
10673
  options: this.options
10825
10674
  })) || {};
@@ -10836,9 +10685,9 @@ class Me {
10836
10685
  }
10837
10686
  extend(e = {}) {
10838
10687
  const t = new Me(e);
10839
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
10688
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = N(x(t, "addOptions", {
10840
10689
  name: t.name
10841
- })), t.storage = E(x(t, "addStorage", {
10690
+ })), t.storage = N(x(t, "addStorage", {
10842
10691
  name: t.name,
10843
10692
  options: t.options
10844
10693
  })), t;
@@ -10855,15 +10704,15 @@ class Me {
10855
10704
  return !1;
10856
10705
  }
10857
10706
  }
10858
- function zd(n) {
10707
+ function Bd(n) {
10859
10708
  return typeof n == "number";
10860
10709
  }
10861
- class Fd {
10710
+ class Ld {
10862
10711
  constructor(e) {
10863
10712
  this.find = e.find, this.handler = e.handler;
10864
10713
  }
10865
10714
  }
10866
- const $d = (n, e, t) => {
10715
+ const zd = (n, e, t) => {
10867
10716
  if (Qr(e))
10868
10717
  return [...n.matchAll(e)];
10869
10718
  const r = e(n, t);
@@ -10872,7 +10721,7 @@ const $d = (n, e, t) => {
10872
10721
  return s.index = i.index, s.input = n, s.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(i.replaceWith)), s;
10873
10722
  }) : [];
10874
10723
  };
10875
- function Vd(n) {
10724
+ function Fd(n) {
10876
10725
  const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new zn({
10877
10726
  editor: e,
10878
10727
  state: t
@@ -10881,7 +10730,7 @@ function Vd(n) {
10881
10730
  if (!h.isTextblock || h.type.spec.code)
10882
10731
  return;
10883
10732
  const m = Math.max(r, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
10884
- $d(y, s.find, o).forEach((w) => {
10733
+ zd(y, s.find, o).forEach((w) => {
10885
10734
  if (w.index === void 0)
10886
10735
  return;
10887
10736
  const I = m + w.index + 1, D = I + w[0].length, L = {
@@ -10902,14 +10751,14 @@ function Vd(n) {
10902
10751
  }), u.every((h) => h !== null);
10903
10752
  }
10904
10753
  let nn = null;
10905
- const Hd = (n) => {
10754
+ const $d = (n) => {
10906
10755
  var e;
10907
10756
  const t = new ClipboardEvent("paste", {
10908
10757
  clipboardData: new DataTransfer()
10909
10758
  });
10910
10759
  return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", n), t;
10911
10760
  };
10912
- function Wd(n) {
10761
+ function Vd(n) {
10913
10762
  const { editor: e, rules: t } = n;
10914
10763
  let r = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
10915
10764
  try {
@@ -10922,7 +10771,7 @@ function Wd(n) {
10922
10771
  state: d,
10923
10772
  transaction: m
10924
10773
  });
10925
- if (!(!Vd({
10774
+ if (!(!Fd({
10926
10775
  editor: e,
10927
10776
  state: g,
10928
10777
  from: Math.max(u - 1, 0),
@@ -10980,17 +10829,17 @@ function Wd(n) {
10980
10829
  if (O) {
10981
10830
  let { text: D } = y;
10982
10831
  typeof D == "string" ? D = D : D = Zr(b.from(D), h.schema);
10983
- const { from: L } = y, C = L + D.length, N = Hd(D);
10832
+ const { from: L } = y, C = L + D.length, v = $d(D);
10984
10833
  return a({
10985
10834
  rule: d,
10986
10835
  state: h,
10987
10836
  from: L,
10988
10837
  to: { b: C },
10989
- pasteEvt: N
10838
+ pasteEvt: v
10990
10839
  });
10991
10840
  }
10992
10841
  const w = f.doc.content.findDiffStart(h.doc.content), I = f.doc.content.findDiffEnd(h.doc.content);
10993
- if (!(!zd(w) || !I || w === I.b))
10842
+ if (!(!Bd(w) || !I || w === I.b))
10994
10843
  return a({
10995
10844
  rule: d,
10996
10845
  state: h,
@@ -11001,13 +10850,13 @@ function Wd(n) {
11001
10850
  }
11002
10851
  }));
11003
10852
  }
11004
- function qd(n) {
10853
+ function Hd(n) {
11005
10854
  const e = n.filter((t, r) => n.indexOf(t) !== r);
11006
10855
  return Array.from(new Set(e));
11007
10856
  }
11008
10857
  class gt {
11009
10858
  constructor(e, t) {
11010
- this.splittableMarks = [], this.editor = t, this.extensions = gt.resolve(e), this.schema = Id(this.extensions, t), this.setupExtensions();
10859
+ this.splittableMarks = [], this.editor = t, this.extensions = gt.resolve(e), this.schema = Ad(this.extensions, t), this.setupExtensions();
11011
10860
  }
11012
10861
  /**
11013
10862
  * Returns a flattened and sorted extension list while
@@ -11016,7 +10865,7 @@ class gt {
11016
10865
  * @returns An flattened and sorted array of Tiptap extensions
11017
10866
  */
11018
10867
  static resolve(e) {
11019
- const t = gt.sort(gt.flatten(e)), r = qd(t.map((i) => i.name));
10868
+ const t = gt.sort(gt.flatten(e)), r = Hd(t.map((i) => i.name));
11020
10869
  return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
11021
10870
  }
11022
10871
  /**
@@ -11082,7 +10931,7 @@ class gt {
11082
10931
  const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
11083
10932
  d = { ...d, ...m };
11084
10933
  }
11085
- const u = ad(d);
10934
+ const u = od(d);
11086
10935
  a.push(u);
11087
10936
  const f = x(o, "addInputRules", l);
11088
10937
  ls(o, e.options.enableInputRules) && f && r.push(...f());
@@ -11096,11 +10945,11 @@ class gt {
11096
10945
  return a;
11097
10946
  }).flat();
11098
10947
  return [
11099
- Bd({
10948
+ Rd({
11100
10949
  editor: e,
11101
10950
  rules: r
11102
10951
  }),
11103
- ...Wd({
10952
+ ...Vd({
11104
10953
  editor: e,
11105
10954
  rules: i
11106
10955
  }),
@@ -11131,7 +10980,7 @@ class gt {
11131
10980
  if (!o)
11132
10981
  return [];
11133
10982
  const l = (a, c, d, u, f) => {
11134
- const h = vr(a, i);
10983
+ const h = Er(a, i);
11135
10984
  return o()({
11136
10985
  // pass-through
11137
10986
  node: a,
@@ -11163,7 +11012,7 @@ class gt {
11163
11012
  editor: this.editor,
11164
11013
  type: ir(e.name, this.schema)
11165
11014
  };
11166
- e.type === "mark" && (!((t = E(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
11015
+ e.type === "mark" && (!((t = N(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
11167
11016
  const i = x(e, "onBeforeCreate", r), s = x(e, "onCreate", r), o = x(e, "onUpdate", r), l = x(e, "onSelectionUpdate", r), a = x(e, "onTransaction", r), c = x(e, "onFocus", r), d = x(e, "onBlur", r), u = x(e, "onDestroy", r);
11168
11017
  i && this.editor.on("beforeCreate", i), s && this.editor.on("create", s), o && this.editor.on("update", o), l && this.editor.on("selectionUpdate", l), a && this.editor.on("transaction", a), c && this.editor.on("focus", c), d && this.editor.on("blur", d), u && this.editor.on("destroy", u);
11169
11018
  });
@@ -11177,9 +11026,9 @@ class _ {
11177
11026
  }, this.config = {
11178
11027
  ...this.config,
11179
11028
  ...e
11180
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
11029
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = N(x(this, "addOptions", {
11181
11030
  name: this.name
11182
- }))), this.storage = E(x(this, "addStorage", {
11031
+ }))), this.storage = N(x(this, "addStorage", {
11183
11032
  name: this.name,
11184
11033
  options: this.options
11185
11034
  })) || {};
@@ -11196,9 +11045,9 @@ class _ {
11196
11045
  }
11197
11046
  extend(e = {}) {
11198
11047
  const t = new _({ ...this.config, ...e });
11199
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
11048
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = N(x(t, "addOptions", {
11200
11049
  name: t.name
11201
- })), t.storage = E(x(t, "addStorage", {
11050
+ })), t.storage = N(x(t, "addStorage", {
11202
11051
  name: t.name,
11203
11052
  options: t.options
11204
11053
  })), t;
@@ -11227,7 +11076,7 @@ function Go(n, e, t) {
11227
11076
  function Yo(n) {
11228
11077
  return Object.fromEntries(Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
11229
11078
  }
11230
- const jd = _.create({
11079
+ const Wd = _.create({
11231
11080
  name: "clipboardTextSerializer",
11232
11081
  addOptions() {
11233
11082
  return {
@@ -11250,10 +11099,10 @@ const jd = _.create({
11250
11099
  })
11251
11100
  ];
11252
11101
  }
11253
- }), Kd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11102
+ }), qd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11254
11103
  var t;
11255
11104
  n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
11256
- }), !0), Jd = (n = !1) => ({ commands: e }) => e.setContent("", n), Ud = () => ({ state: n, tr: e, dispatch: t }) => {
11105
+ }), !0), jd = (n = !1) => ({ commands: e }) => e.setContent("", n), Kd = () => ({ state: n, tr: e, dispatch: t }) => {
11257
11106
  const { selection: r } = e, { ranges: i } = r;
11258
11107
  return t && i.forEach(({ $from: s, $to: o }) => {
11259
11108
  n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
@@ -11270,12 +11119,12 @@ const jd = _.create({
11270
11119
  (p || p === 0) && e.lift(h, p);
11271
11120
  });
11272
11121
  }), !0;
11273
- }, _d = (n) => (e) => n(e), Gd = () => ({ state: n, dispatch: e }) => qo(n, e), Yd = (n, e) => ({ editor: t, tr: r }) => {
11122
+ }, Jd = (n) => (e) => n(e), Ud = () => ({ state: n, dispatch: e }) => qo(n, e), _d = (n, e) => ({ editor: t, tr: r }) => {
11274
11123
  const { state: i } = t, s = i.doc.slice(n.from, n.to);
11275
11124
  r.deleteRange(n.from, n.to);
11276
11125
  const o = r.mapping.map(e);
11277
11126
  return r.insert(o, s.content), r.setSelection(new M(r.doc.resolve(Math.max(o - 1, 0)))), !0;
11278
- }, Xd = () => ({ tr: n, dispatch: e }) => {
11127
+ }, Gd = () => ({ tr: n, dispatch: e }) => {
11279
11128
  const { selection: t } = n, r = t.$anchor.node();
11280
11129
  if (r.content.size > 0)
11281
11130
  return !1;
@@ -11289,7 +11138,7 @@ const jd = _.create({
11289
11138
  return !0;
11290
11139
  }
11291
11140
  return !1;
11292
- }, Zd = (n) => ({ tr: e, state: t, dispatch: r }) => {
11141
+ }, Yd = (n) => ({ tr: e, state: t, dispatch: r }) => {
11293
11142
  const i = V(n, t.schema), s = e.selection.$anchor;
11294
11143
  for (let o = s.depth; o > 0; o -= 1)
11295
11144
  if (s.node(o).type === i) {
@@ -11300,10 +11149,10 @@ const jd = _.create({
11300
11149
  return !0;
11301
11150
  }
11302
11151
  return !1;
11303
- }, Qd = (n) => ({ tr: e, dispatch: t }) => {
11152
+ }, Xd = (n) => ({ tr: e, dispatch: t }) => {
11304
11153
  const { from: r, to: i } = n;
11305
11154
  return t && e.delete(r, i), !0;
11306
- }, eu = () => ({ state: n, dispatch: e }) => Ur(n, e), tu = () => ({ commands: n }) => n.keyboardShortcut("Enter"), nu = () => ({ state: n, dispatch: e }) => pd(n, e);
11155
+ }, Zd = () => ({ state: n, dispatch: e }) => Ur(n, e), Qd = () => ({ commands: n }) => n.keyboardShortcut("Enter"), eu = () => ({ state: n, dispatch: e }) => fd(n, e);
11307
11156
  function Sn(n, e, t = { strict: !0 }) {
11308
11157
  const r = Object.keys(e);
11309
11158
  return r.length ? r.every((i) => t.strict ? e[i] === n[i] : Qr(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
@@ -11343,7 +11192,7 @@ function Je(n, e) {
11343
11192
  }
11344
11193
  return n;
11345
11194
  }
11346
- const ru = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11195
+ const tu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11347
11196
  const s = Je(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: d } = l;
11348
11197
  if (i) {
11349
11198
  const u = ei(a, s, e);
@@ -11353,7 +11202,7 @@ const ru = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11353
11202
  }
11354
11203
  }
11355
11204
  return !0;
11356
- }, iu = (n) => (e) => {
11205
+ }, nu = (n) => (e) => {
11357
11206
  const t = typeof n == "function" ? n(e) : n;
11358
11207
  for (let r = 0; r < t.length; r += 1)
11359
11208
  if (t[r](e))
@@ -11369,7 +11218,7 @@ function Xe(n = 0, e = 0, t = 0) {
11369
11218
  function Qo(n, e = null) {
11370
11219
  if (!e)
11371
11220
  return null;
11372
- const t = v.atStart(n), r = v.atEnd(n);
11221
+ const t = E.atStart(n), r = E.atEnd(n);
11373
11222
  if (e === "start" || e === !0)
11374
11223
  return t;
11375
11224
  if (e === "end")
@@ -11390,17 +11239,17 @@ function Mn() {
11390
11239
  "iPod"
11391
11240
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
11392
11241
  }
11393
- function su() {
11242
+ function ru() {
11394
11243
  return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
11395
11244
  }
11396
- const ou = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11245
+ const iu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11397
11246
  e = {
11398
11247
  scrollIntoView: !0,
11399
11248
  ...e
11400
11249
  };
11401
11250
  const o = () => {
11402
11251
  (Mn() || cs()) && r.dom.focus(), requestAnimationFrame(() => {
11403
- t.isDestroyed || (r.focus(), su() && !Mn() && !cs() && r.dom.focus({ preventScroll: !0 }));
11252
+ t.isDestroyed || (r.focus(), ru() && !Mn() && !cs() && r.dom.focus({ preventScroll: !0 }));
11404
11253
  });
11405
11254
  };
11406
11255
  if (r.hasFocus() && n === null || n === !1)
@@ -11409,7 +11258,7 @@ const ou = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
11409
11258
  return o(), !0;
11410
11259
  const l = Qo(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
11411
11260
  return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
11412
- }, lu = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), au = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), el = (n) => {
11261
+ }, su = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), ou = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), el = (n) => {
11413
11262
  const e = n.childNodes;
11414
11263
  for (let t = e.length - 1; t >= 0; t -= 1) {
11415
11264
  const r = e[t];
@@ -11470,7 +11319,7 @@ function Vt(n, e, t) {
11470
11319
  }
11471
11320
  return Vt("", e, t);
11472
11321
  }
11473
- function cu(n, e, t) {
11322
+ function lu(n, e, t) {
11474
11323
  const r = n.steps.length - 1;
11475
11324
  if (r < e)
11476
11325
  return;
@@ -11481,9 +11330,9 @@ function cu(n, e, t) {
11481
11330
  let o = 0;
11482
11331
  s.forEach((l, a, c, d) => {
11483
11332
  o === 0 && (o = d);
11484
- }), n.setSelection(v.near(n.doc.resolve(o), t));
11333
+ }), n.setSelection(E.near(n.doc.resolve(o), t));
11485
11334
  }
11486
- const du = (n) => !("type" in n), uu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11335
+ const au = (n) => !("type" in n), cu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11487
11336
  var o;
11488
11337
  if (i) {
11489
11338
  t = {
@@ -11524,7 +11373,7 @@ const du = (n) => !("type" in n), uu = (n, e, t) => ({ tr: r, dispatch: i, edito
11524
11373
  return a(g), !1;
11525
11374
  }
11526
11375
  let { from: d, to: u } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, h = !0;
11527
- if ((du(l) ? l : [l]).forEach((g) => {
11376
+ if ((au(l) ? l : [l]).forEach((g) => {
11528
11377
  g.check(), f = f ? g.isText && g.marks.length === 0 : !1, h = h ? g.isBlock : !1;
11529
11378
  }), d === u && h) {
11530
11379
  const { parent: g } = r.doc.resolve(d);
@@ -11543,28 +11392,28 @@ const du = (n) => !("type" in n), uu = (n, e, t) => ({ tr: r, dispatch: i, edito
11543
11392
  r.insertText(m, d, u);
11544
11393
  } else
11545
11394
  m = l, r.replaceWith(d, u, m);
11546
- t.updateSelection && cu(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11395
+ t.updateSelection && lu(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11547
11396
  }
11548
11397
  return !0;
11549
- }, fu = () => ({ state: n, dispatch: e }) => ud(n, e), hu = () => ({ state: n, dispatch: e }) => fd(n, e), pu = () => ({ state: n, dispatch: e }) => Lo(n, e), mu = () => ({ state: n, dispatch: e }) => Vo(n, e), gu = () => ({ state: n, dispatch: e, tr: t }) => {
11398
+ }, du = () => ({ state: n, dispatch: e }) => cd(n, e), uu = () => ({ state: n, dispatch: e }) => dd(n, e), fu = () => ({ state: n, dispatch: e }) => Lo(n, e), hu = () => ({ state: n, dispatch: e }) => Vo(n, e), pu = () => ({ state: n, dispatch: e, tr: t }) => {
11550
11399
  try {
11551
11400
  const r = An(n.doc, n.selection.$from.pos, -1);
11552
11401
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11553
11402
  } catch {
11554
11403
  return !1;
11555
11404
  }
11556
- }, yu = () => ({ state: n, dispatch: e, tr: t }) => {
11405
+ }, mu = () => ({ state: n, dispatch: e, tr: t }) => {
11557
11406
  try {
11558
11407
  const r = An(n.doc, n.selection.$from.pos, 1);
11559
11408
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11560
11409
  } catch {
11561
11410
  return !1;
11562
11411
  }
11563
- }, bu = () => ({ state: n, dispatch: e }) => cd(n, e), ku = () => ({ state: n, dispatch: e }) => dd(n, e);
11412
+ }, gu = () => ({ state: n, dispatch: e }) => ld(n, e), yu = () => ({ state: n, dispatch: e }) => ad(n, e);
11564
11413
  function tl() {
11565
11414
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
11566
11415
  }
11567
- function xu(n) {
11416
+ function bu(n) {
11568
11417
  const e = n.split(/-(?!$)/);
11569
11418
  let t = e[e.length - 1];
11570
11419
  t === "Space" && (t = " ");
@@ -11586,8 +11435,8 @@ function xu(n) {
11586
11435
  }
11587
11436
  return r && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
11588
11437
  }
11589
- const Su = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11590
- const s = xu(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11438
+ const ku = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11439
+ const s = bu(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11591
11440
  key: o === "Space" ? " " : o,
11592
11441
  altKey: s.includes("Alt"),
11593
11442
  ctrlKey: s.includes("Ctrl"),
@@ -11618,13 +11467,13 @@ function Ht(n, e, t = {}) {
11618
11467
  const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => Sn(u.node.attrs, t, { strict: !1 }));
11619
11468
  return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
11620
11469
  }
11621
- const Mu = (n, e = {}) => ({ state: t, dispatch: r }) => {
11470
+ const xu = (n, e = {}) => ({ state: t, dispatch: r }) => {
11622
11471
  const i = V(n, t.schema);
11623
- return Ht(t, i, e) ? hd(t, r) : !1;
11624
- }, wu = () => ({ state: n, dispatch: e }) => jo(n, e), Cu = (n) => ({ state: e, dispatch: t }) => {
11472
+ return Ht(t, i, e) ? ud(t, r) : !1;
11473
+ }, Su = () => ({ state: n, dispatch: e }) => jo(n, e), Mu = (n) => ({ state: e, dispatch: t }) => {
11625
11474
  const r = V(n, e.schema);
11626
- return Td(r)(e, t);
11627
- }, Tu = () => ({ state: n, dispatch: e }) => Wo(n, e);
11475
+ return wd(r)(e, t);
11476
+ }, wu = () => ({ state: n, dispatch: e }) => Wo(n, e);
11628
11477
  function Hn(n, e) {
11629
11478
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11630
11479
  }
@@ -11632,7 +11481,7 @@ function ds(n, e) {
11632
11481
  const t = typeof e == "string" ? [e] : e;
11633
11482
  return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
11634
11483
  }
11635
- const Ou = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11484
+ const Cu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11636
11485
  let s = null, o = null;
11637
11486
  const l = Hn(typeof n == "string" ? n : n.name, r.schema);
11638
11487
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -11642,25 +11491,25 @@ const Ou = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11642
11491
  });
11643
11492
  });
11644
11493
  }), !0) : !1;
11645
- }, vu = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Eu = () => ({ tr: n, dispatch: e }) => {
11494
+ }, Tu = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Ou = () => ({ tr: n, dispatch: e }) => {
11646
11495
  if (e) {
11647
11496
  const t = new ce(n.doc);
11648
11497
  n.setSelection(t);
11649
11498
  }
11650
11499
  return !0;
11651
- }, Nu = () => ({ state: n, dispatch: e }) => Fo(n, e), Au = () => ({ state: n, dispatch: e }) => Ho(n, e), Du = () => ({ state: n, dispatch: e }) => yd(n, e), Iu = () => ({ state: n, dispatch: e }) => xd(n, e), Ru = () => ({ state: n, dispatch: e }) => kd(n, e);
11652
- function Er(n, e, t = {}, r = {}) {
11500
+ }, Eu = () => ({ state: n, dispatch: e }) => Fo(n, e), Nu = () => ({ state: n, dispatch: e }) => Ho(n, e), vu = () => ({ state: n, dispatch: e }) => md(n, e), Au = () => ({ state: n, dispatch: e }) => bd(n, e), Du = () => ({ state: n, dispatch: e }) => yd(n, e);
11501
+ function Nr(n, e, t = {}, r = {}) {
11653
11502
  return Vt(n, e, {
11654
11503
  slice: !1,
11655
11504
  parseOptions: t,
11656
11505
  errorOnInvalidContent: r.errorOnInvalidContent
11657
11506
  });
11658
11507
  }
11659
- const Pu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11508
+ const Iu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11660
11509
  var a, c;
11661
11510
  const { doc: d } = s;
11662
11511
  if (t.preserveWhitespace !== "full") {
11663
- const u = Er(n, i.schema, t, {
11512
+ const u = Nr(n, i.schema, t, {
11664
11513
  errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
11665
11514
  });
11666
11515
  return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
@@ -11678,7 +11527,7 @@ function nl(n, e) {
11678
11527
  const l = o.find((a) => a.type.name === t.name);
11679
11528
  return l ? { ...l.attrs } : {};
11680
11529
  }
11681
- function Bu(n) {
11530
+ function Ru(n) {
11682
11531
  for (let e = 0; e < n.edgeCount; e += 1) {
11683
11532
  const { type: t } = n.edge(e);
11684
11533
  if (t.isTextblock && !t.hasRequiredAttrs())
@@ -11686,7 +11535,7 @@ function Bu(n) {
11686
11535
  }
11687
11536
  return null;
11688
11537
  }
11689
- function Lu(n, e) {
11538
+ function Pu(n, e) {
11690
11539
  for (let t = n.depth; t > 0; t -= 1) {
11691
11540
  const r = n.node(t);
11692
11541
  if (e(r))
@@ -11699,16 +11548,16 @@ function Lu(n, e) {
11699
11548
  }
11700
11549
  }
11701
11550
  function ti(n) {
11702
- return (e) => Lu(e.$from, n);
11551
+ return (e) => Pu(e.$from, n);
11703
11552
  }
11704
- function zu(n, e) {
11553
+ function Bu(n, e) {
11705
11554
  const t = {
11706
11555
  from: 0,
11707
11556
  to: n.content.size
11708
11557
  };
11709
11558
  return Go(n, t, e);
11710
11559
  }
11711
- function Fu(n, e) {
11560
+ function Lu(n, e) {
11712
11561
  const t = V(e, n.schema), { from: r, to: i } = n.selection, s = [];
11713
11562
  n.doc.nodesBetween(r, i, (l) => {
11714
11563
  s.push(l);
@@ -11716,9 +11565,9 @@ function Fu(n, e) {
11716
11565
  const o = s.reverse().find((l) => l.type.name === t.name);
11717
11566
  return o ? { ...o.attrs } : {};
11718
11567
  }
11719
- function $u(n, e) {
11568
+ function zu(n, e) {
11720
11569
  const t = Hn(typeof e == "string" ? e : e.name, n.schema);
11721
- return t === "node" ? Fu(n, e) : t === "mark" ? nl(n, e) : {};
11570
+ return t === "node" ? Lu(n, e) : t === "mark" ? nl(n, e) : {};
11722
11571
  }
11723
11572
  function rl(n, e, t) {
11724
11573
  const r = [];
@@ -11742,7 +11591,7 @@ function an(n, e, t) {
11742
11591
  return i ? i.attribute.keepOnSplit : !1;
11743
11592
  }));
11744
11593
  }
11745
- function Nr(n, e, t = {}) {
11594
+ function vr(n, e, t = {}) {
11746
11595
  const { empty: r, ranges: i } = n.selection, s = e ? Je(e, n.schema) : null;
11747
11596
  if (r)
11748
11597
  return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => Sn(u.attrs, t, { strict: !1 }));
@@ -11765,11 +11614,11 @@ function Nr(n, e, t = {}) {
11765
11614
  const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => Sn(u.mark.attrs, t, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, f) => u + f.to - f.from, 0);
11766
11615
  return (a > 0 ? a + c : a) >= o;
11767
11616
  }
11768
- function Vu(n, e, t = {}) {
11617
+ function Fu(n, e, t = {}) {
11769
11618
  if (!e)
11770
- return Ht(n, null, t) || Nr(n, null, t);
11619
+ return Ht(n, null, t) || vr(n, null, t);
11771
11620
  const r = Hn(e, n.schema);
11772
- return r === "node" ? Ht(n, e, t) : r === "mark" ? Nr(n, e, t) : !1;
11621
+ return r === "node" ? Ht(n, e, t) : r === "mark" ? vr(n, e, t) : !1;
11773
11622
  }
11774
11623
  function us(n, e) {
11775
11624
  const { nodeExtensions: t } = Fn(e), r = t.find((o) => o.name === n);
@@ -11779,7 +11628,7 @@ function us(n, e) {
11779
11628
  name: r.name,
11780
11629
  options: r.options,
11781
11630
  storage: r.storage
11782
- }, s = E(x(r, "group", i));
11631
+ }, s = N(x(r, "group", i));
11783
11632
  return typeof s != "string" ? !1 : s.split(" ").includes("list");
11784
11633
  }
11785
11634
  function ni(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
@@ -11804,10 +11653,10 @@ function ni(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
11804
11653
  }
11805
11654
  return !1;
11806
11655
  }
11807
- function Hu(n) {
11656
+ function $u(n) {
11808
11657
  return n instanceof S;
11809
11658
  }
11810
- function Wu(n, e, t) {
11659
+ function Vu(n, e, t) {
11811
11660
  var r;
11812
11661
  const { selection: i } = e;
11813
11662
  let s = null;
@@ -11829,7 +11678,7 @@ function Wu(n, e, t) {
11829
11678
  }), c;
11830
11679
  });
11831
11680
  }
11832
- const qu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11681
+ const Hu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11833
11682
  const { selection: s } = t, { empty: o, ranges: l } = s, a = Je(n, r.schema);
11834
11683
  if (i)
11835
11684
  if (o) {
@@ -11851,26 +11700,26 @@ const qu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11851
11700
  }) : t.addMark(p, m, a.create(e));
11852
11701
  });
11853
11702
  });
11854
- return Wu(r, t, a);
11855
- }, ju = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Ku = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11703
+ return Vu(r, t, a);
11704
+ }, Wu = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), qu = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11856
11705
  const s = V(n, t.schema);
11857
11706
  let o;
11858
11707
  return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => rs(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => rs(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
11859
- }, Ju = (n) => ({ tr: e, dispatch: t }) => {
11708
+ }, ju = (n) => ({ tr: e, dispatch: t }) => {
11860
11709
  if (t) {
11861
11710
  const { doc: r } = e, i = Xe(n, 0, r.content.size), s = S.create(r, i);
11862
11711
  e.setSelection(s);
11863
11712
  }
11864
11713
  return !0;
11865
- }, Uu = (n) => ({ tr: e, dispatch: t }) => {
11714
+ }, Ku = (n) => ({ tr: e, dispatch: t }) => {
11866
11715
  if (t) {
11867
11716
  const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a = Xe(i, o, l), c = Xe(s, o, l), d = M.create(r, a, c);
11868
11717
  e.setSelection(d);
11869
11718
  }
11870
11719
  return !0;
11871
- }, _u = (n) => ({ state: e, dispatch: t }) => {
11720
+ }, Ju = (n) => ({ state: e, dispatch: t }) => {
11872
11721
  const r = V(n, e.schema);
11873
- return Ed(r)(e, t);
11722
+ return Od(r)(e, t);
11874
11723
  };
11875
11724
  function fs(n, e) {
11876
11725
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
@@ -11879,20 +11728,20 @@ function fs(n, e) {
11879
11728
  n.tr.ensureMarks(r);
11880
11729
  }
11881
11730
  }
11882
- const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11731
+ const Uu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11883
11732
  const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = an(c, l.node().type.name, l.node().attrs);
11884
11733
  if (s instanceof S && s.node.isBlock)
11885
- return !l.parentOffset || !Ne(o, l.pos) ? !1 : (r && (n && fs(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
11734
+ return !l.parentOffset || !ve(o, l.pos) ? !1 : (r && (n && fs(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
11886
11735
  if (!l.parent.isBlock)
11887
11736
  return !1;
11888
- const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Bu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11737
+ const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Ru(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11889
11738
  let h = u && f ? [
11890
11739
  {
11891
11740
  type: f,
11892
11741
  attrs: d
11893
11742
  }
11894
- ] : void 0, p = Ne(e.doc, e.mapping.map(l.pos), 1, h);
11895
- if (!h && !p && Ne(e.doc, e.mapping.map(l.pos), 1, f ? [{ type: f }] : void 0) && (p = !0, h = f ? [
11743
+ ] : void 0, p = ve(e.doc, e.mapping.map(l.pos), 1, h);
11744
+ if (!h && !p && ve(e.doc, e.mapping.map(l.pos), 1, f ? [{ type: f }] : void 0) && (p = !0, h = f ? [
11896
11745
  {
11897
11746
  type: f,
11898
11747
  attrs: d
@@ -11905,7 +11754,7 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11905
11754
  n && fs(t, i.extensionManager.splittableMarks), e.scrollIntoView();
11906
11755
  }
11907
11756
  return p;
11908
- }, Yu = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11757
+ }, _u = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11909
11758
  var o;
11910
11759
  const l = V(n, r.schema), { $from: a, $to: c } = r.selection, d = r.selection.node;
11911
11760
  if (d && d.isBlock || a.depth < 2 || !a.sameParent(c))
@@ -11920,8 +11769,8 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11920
11769
  if (i) {
11921
11770
  let y = b.empty;
11922
11771
  const O = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
11923
- for (let N = a.depth - O; N >= a.depth - 3; N -= 1)
11924
- y = b.from(a.node(N).copy(y));
11772
+ for (let v = a.depth - O; v >= a.depth - 3; v -= 1)
11773
+ y = b.from(a.node(v).copy(y));
11925
11774
  const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, I = {
11926
11775
  ...an(f, a.node().type.name, a.node().attrs),
11927
11776
  ...e
@@ -11930,10 +11779,10 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11930
11779
  const L = a.before(a.depth - (O - 1));
11931
11780
  t.replace(L, a.after(-w), new k(y, 4 - O, 0));
11932
11781
  let C = -1;
11933
- t.doc.nodesBetween(L, t.doc.content.size, (N, G) => {
11782
+ t.doc.nodesBetween(L, t.doc.content.size, (v, G) => {
11934
11783
  if (C > -1)
11935
11784
  return !1;
11936
- N.isTextblock && N.content.size === 0 && (C = G + 1);
11785
+ v.isTextblock && v.content.size === 0 && (C = G + 1);
11937
11786
  }), C > -1 && t.setSelection(M.near(t.doc.resolve(C))), t.scrollIntoView();
11938
11787
  }
11939
11788
  return !0;
@@ -11950,7 +11799,7 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11950
11799
  { type: l, attrs: p },
11951
11800
  { type: h, attrs: m }
11952
11801
  ] : [{ type: l, attrs: p }];
11953
- if (!Ne(t.doc, a.pos, 2))
11802
+ if (!ve(t.doc, a.pos, 2))
11954
11803
  return !1;
11955
11804
  if (i) {
11956
11805
  const { selection: y, storedMarks: O } = r, { splittableMarks: w } = s.extensionManager, I = O || y.$to.parentOffset && y.$from.marks();
@@ -11978,7 +11827,7 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11978
11827
  return !0;
11979
11828
  const i = n.doc.nodeAt(r);
11980
11829
  return t.node.type === (i == null ? void 0 : i.type) && je(n.doc, r) && n.join(r), !0;
11981
- }, Xu = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11830
+ }, Gu = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11982
11831
  const { extensions: u, splittableMarks: f } = i.extensionManager, h = V(n, o.schema), p = V(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: O } = m, w = y.blockRange(O), I = g || m.$to.parentOffset && m.$from.marks();
11983
11832
  if (!w)
11984
11833
  return !1;
@@ -11990,20 +11839,20 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11990
11839
  return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => sr(s, h)).command(() => or(s, h)).run();
11991
11840
  }
11992
11841
  return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run() : a().command(() => {
11993
- const L = d().wrapInList(h, r), C = I.filter((N) => f.includes(N.type.name));
11842
+ const L = d().wrapInList(h, r), C = I.filter((v) => f.includes(v.type.name));
11994
11843
  return s.ensureMarks(C), L ? !0 : c.clearNodes();
11995
11844
  }).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run();
11996
- }, Zu = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11845
+ }, Yu = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11997
11846
  const { extendEmptyMarkRange: s = !1 } = t, o = Je(n, r.schema);
11998
- return Nr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11999
- }, Qu = (n, e, t = {}) => ({ state: r, commands: i }) => {
11847
+ return vr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11848
+ }, Xu = (n, e, t = {}) => ({ state: r, commands: i }) => {
12000
11849
  const s = V(n, r.schema), o = V(e, r.schema), l = Ht(r, s, t);
12001
11850
  let a;
12002
11851
  return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
12003
- }, ef = (n, e = {}) => ({ state: t, commands: r }) => {
11852
+ }, Zu = (n, e = {}) => ({ state: t, commands: r }) => {
12004
11853
  const i = V(n, t.schema);
12005
11854
  return Ht(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
12006
- }, tf = () => ({ state: n, dispatch: e }) => {
11855
+ }, Qu = () => ({ state: n, dispatch: e }) => {
12007
11856
  const t = n.plugins;
12008
11857
  for (let r = 0; r < t.length; r += 1) {
12009
11858
  const i = t[r];
@@ -12023,12 +11872,12 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
12023
11872
  }
12024
11873
  }
12025
11874
  return !1;
12026
- }, nf = () => ({ tr: n, dispatch: e }) => {
11875
+ }, ef = () => ({ tr: n, dispatch: e }) => {
12027
11876
  const { selection: t } = n, { empty: r, ranges: i } = t;
12028
11877
  return r || e && i.forEach((s) => {
12029
11878
  n.removeMark(s.$from.pos, s.$to.pos);
12030
11879
  }), !0;
12031
- }, rf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11880
+ }, tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
12032
11881
  var s;
12033
11882
  const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = Je(n, r.schema), { $from: c, empty: d, ranges: u } = l;
12034
11883
  if (!i)
@@ -12042,7 +11891,7 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
12042
11891
  t.removeMark(f.$from.pos, f.$to.pos, a);
12043
11892
  });
12044
11893
  return t.removeStoredMark(a), !0;
12045
- }, sf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11894
+ }, nf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
12046
11895
  let s = null, o = null;
12047
11896
  const l = Hn(typeof n == "string" ? n : n.name, r.schema);
12048
11897
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -12073,82 +11922,82 @@ const Gu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
12073
11922
  }));
12074
11923
  }));
12075
11924
  }), !0) : !1;
12076
- }, of = (n, e = {}) => ({ state: t, dispatch: r }) => {
11925
+ }, rf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12077
11926
  const i = V(n, t.schema);
12078
- return Sd(i, e)(t, r);
12079
- }, lf = (n, e = {}) => ({ state: t, dispatch: r }) => {
11927
+ return kd(i, e)(t, r);
11928
+ }, sf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12080
11929
  const i = V(n, t.schema);
12081
- return Md(i, e)(t, r);
11930
+ return xd(i, e)(t, r);
12082
11931
  };
12083
- var af = /* @__PURE__ */ Object.freeze({
11932
+ var of = /* @__PURE__ */ Object.freeze({
12084
11933
  __proto__: null,
12085
- blur: Kd,
12086
- clearContent: Jd,
12087
- clearNodes: Ud,
12088
- command: _d,
12089
- createParagraphNear: Gd,
12090
- cut: Yd,
12091
- deleteCurrentNode: Xd,
12092
- deleteNode: Zd,
12093
- deleteRange: Qd,
12094
- deleteSelection: eu,
12095
- enter: tu,
12096
- exitCode: nu,
12097
- extendMarkRange: ru,
12098
- first: iu,
12099
- focus: ou,
12100
- forEach: lu,
12101
- insertContent: au,
12102
- insertContentAt: uu,
12103
- joinBackward: pu,
12104
- joinDown: hu,
12105
- joinForward: mu,
12106
- joinItemBackward: gu,
12107
- joinItemForward: yu,
12108
- joinTextblockBackward: bu,
12109
- joinTextblockForward: ku,
12110
- joinUp: fu,
12111
- keyboardShortcut: Su,
12112
- lift: Mu,
12113
- liftEmptyBlock: wu,
12114
- liftListItem: Cu,
12115
- newlineInCode: Tu,
12116
- resetAttributes: Ou,
12117
- scrollIntoView: vu,
12118
- selectAll: Eu,
12119
- selectNodeBackward: Nu,
12120
- selectNodeForward: Au,
12121
- selectParentNode: Du,
12122
- selectTextblockEnd: Iu,
12123
- selectTextblockStart: Ru,
12124
- setContent: Pu,
12125
- setMark: qu,
12126
- setMeta: ju,
12127
- setNode: Ku,
12128
- setNodeSelection: Ju,
12129
- setTextSelection: Uu,
12130
- sinkListItem: _u,
12131
- splitBlock: Gu,
12132
- splitListItem: Yu,
12133
- toggleList: Xu,
12134
- toggleMark: Zu,
12135
- toggleNode: Qu,
12136
- toggleWrap: ef,
12137
- undoInputRule: tf,
12138
- unsetAllMarks: nf,
12139
- unsetMark: rf,
12140
- updateAttributes: sf,
12141
- wrapIn: of,
12142
- wrapInList: lf
11934
+ blur: qd,
11935
+ clearContent: jd,
11936
+ clearNodes: Kd,
11937
+ command: Jd,
11938
+ createParagraphNear: Ud,
11939
+ cut: _d,
11940
+ deleteCurrentNode: Gd,
11941
+ deleteNode: Yd,
11942
+ deleteRange: Xd,
11943
+ deleteSelection: Zd,
11944
+ enter: Qd,
11945
+ exitCode: eu,
11946
+ extendMarkRange: tu,
11947
+ first: nu,
11948
+ focus: iu,
11949
+ forEach: su,
11950
+ insertContent: ou,
11951
+ insertContentAt: cu,
11952
+ joinBackward: fu,
11953
+ joinDown: uu,
11954
+ joinForward: hu,
11955
+ joinItemBackward: pu,
11956
+ joinItemForward: mu,
11957
+ joinTextblockBackward: gu,
11958
+ joinTextblockForward: yu,
11959
+ joinUp: du,
11960
+ keyboardShortcut: ku,
11961
+ lift: xu,
11962
+ liftEmptyBlock: Su,
11963
+ liftListItem: Mu,
11964
+ newlineInCode: wu,
11965
+ resetAttributes: Cu,
11966
+ scrollIntoView: Tu,
11967
+ selectAll: Ou,
11968
+ selectNodeBackward: Eu,
11969
+ selectNodeForward: Nu,
11970
+ selectParentNode: vu,
11971
+ selectTextblockEnd: Au,
11972
+ selectTextblockStart: Du,
11973
+ setContent: Iu,
11974
+ setMark: Hu,
11975
+ setMeta: Wu,
11976
+ setNode: qu,
11977
+ setNodeSelection: ju,
11978
+ setTextSelection: Ku,
11979
+ sinkListItem: Ju,
11980
+ splitBlock: Uu,
11981
+ splitListItem: _u,
11982
+ toggleList: Gu,
11983
+ toggleMark: Yu,
11984
+ toggleNode: Xu,
11985
+ toggleWrap: Zu,
11986
+ undoInputRule: Qu,
11987
+ unsetAllMarks: ef,
11988
+ unsetMark: tf,
11989
+ updateAttributes: nf,
11990
+ wrapIn: rf,
11991
+ wrapInList: sf
12143
11992
  });
12144
- const cf = _.create({
11993
+ const lf = _.create({
12145
11994
  name: "commands",
12146
11995
  addCommands() {
12147
11996
  return {
12148
- ...af
11997
+ ...of
12149
11998
  };
12150
11999
  }
12151
- }), df = _.create({
12000
+ }), af = _.create({
12152
12001
  name: "drop",
12153
12002
  addProseMirrorPlugins() {
12154
12003
  return [
@@ -12167,7 +12016,7 @@ const cf = _.create({
12167
12016
  })
12168
12017
  ];
12169
12018
  }
12170
- }), uf = _.create({
12019
+ }), cf = _.create({
12171
12020
  name: "editable",
12172
12021
  addProseMirrorPlugins() {
12173
12022
  return [
@@ -12179,13 +12028,13 @@ const cf = _.create({
12179
12028
  })
12180
12029
  ];
12181
12030
  }
12182
- }), ff = new we("focusEvents"), hf = _.create({
12031
+ }), df = new we("focusEvents"), uf = _.create({
12183
12032
  name: "focusEvents",
12184
12033
  addProseMirrorPlugins() {
12185
12034
  const { editor: n } = this;
12186
12035
  return [
12187
12036
  new se({
12188
- key: ff,
12037
+ key: df,
12189
12038
  props: {
12190
12039
  handleDOMEvents: {
12191
12040
  focus: (e, t) => {
@@ -12203,14 +12052,14 @@ const cf = _.create({
12203
12052
  })
12204
12053
  ];
12205
12054
  }
12206
- }), pf = _.create({
12055
+ }), ff = _.create({
12207
12056
  name: "keymap",
12208
12057
  addKeyboardShortcuts() {
12209
12058
  const n = () => this.editor.commands.first(({ commands: o }) => [
12210
12059
  () => o.undoInputRule(),
12211
12060
  // maybe convert first text block node to default node
12212
12061
  () => o.command(({ tr: l }) => {
12213
- const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos : v.atStart(c).from === f;
12062
+ const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos : E.atStart(c).from === f;
12214
12063
  return !d || !h.type.isTextblock || h.textContent.length || !y || y && u.parent.type.name === "paragraph" ? !1 : o.clearNodes();
12215
12064
  }),
12216
12065
  () => o.deleteSelection(),
@@ -12265,7 +12114,7 @@ const cf = _.create({
12265
12114
  const r = n.some((m) => m.docChanged) && !e.doc.eq(t.doc), i = n.some((m) => m.getMeta("preventClearDocument"));
12266
12115
  if (!r || i)
12267
12116
  return;
12268
- const { empty: s, from: o, to: l } = e.selection, a = v.atStart(e.doc).from, c = v.atEnd(e.doc).to;
12117
+ const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
12269
12118
  if (s || !(o === a && l === c) || !ni(t.doc))
12270
12119
  return;
12271
12120
  const f = t.tr, h = Ln({
@@ -12281,7 +12130,7 @@ const cf = _.create({
12281
12130
  })
12282
12131
  ];
12283
12132
  }
12284
- }), mf = _.create({
12133
+ }), hf = _.create({
12285
12134
  name: "paste",
12286
12135
  addProseMirrorPlugins() {
12287
12136
  return [
@@ -12299,7 +12148,7 @@ const cf = _.create({
12299
12148
  })
12300
12149
  ];
12301
12150
  }
12302
- }), gf = _.create({
12151
+ }), pf = _.create({
12303
12152
  name: "tabindex",
12304
12153
  addProseMirrorPlugins() {
12305
12154
  return [
@@ -12438,7 +12287,7 @@ class _e {
12438
12287
  }), this.editor.view.dispatch(t);
12439
12288
  }
12440
12289
  }
12441
- const yf = `.ProseMirror {
12290
+ const mf = `.ProseMirror {
12442
12291
  position: relative;
12443
12292
  }
12444
12293
 
@@ -12513,14 +12362,14 @@ img.ProseMirror-separator {
12513
12362
  .tippy-box[data-animation=fade][data-state=hidden] {
12514
12363
  opacity: 0
12515
12364
  }`;
12516
- function bf(n, e, t) {
12365
+ function gf(n, e, t) {
12517
12366
  const r = document.querySelector("style[data-tiptap-style]");
12518
12367
  if (r !== null)
12519
12368
  return r;
12520
12369
  const i = document.createElement("style");
12521
12370
  return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(i), i;
12522
12371
  }
12523
- class kf extends Nd {
12372
+ class yf extends Ed {
12524
12373
  constructor(e = {}) {
12525
12374
  super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
12526
12375
  element: document.createElement("div"),
@@ -12583,7 +12432,7 @@ class kf extends Nd {
12583
12432
  * Inject CSS styles.
12584
12433
  */
12585
12434
  injectCSS() {
12586
- this.options.injectCSS && document && (this.css = bf(yf, this.options.injectNonce));
12435
+ this.options.injectCSS && document && (this.css = gf(mf, this.options.injectNonce));
12587
12436
  }
12588
12437
  /**
12589
12438
  * Update editor options.
@@ -12652,16 +12501,16 @@ class kf extends Nd {
12652
12501
  createExtensionManager() {
12653
12502
  var e, t;
12654
12503
  const i = [...this.options.enableCoreExtensions ? [
12655
- uf,
12656
- jd.configure({
12504
+ cf,
12505
+ Wd.configure({
12657
12506
  blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
12658
12507
  }),
12659
- cf,
12660
- hf,
12508
+ lf,
12509
+ uf,
12510
+ ff,
12661
12511
  pf,
12662
- gf,
12663
- df,
12664
- mf
12512
+ af,
12513
+ hf
12665
12514
  ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
12666
12515
  this.extensionManager = new gt(i, this);
12667
12516
  }
@@ -12686,7 +12535,7 @@ class kf extends Nd {
12686
12535
  var e;
12687
12536
  let t;
12688
12537
  try {
12689
- t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12538
+ t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12690
12539
  } catch (o) {
12691
12540
  if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
12692
12541
  throw o;
@@ -12696,7 +12545,7 @@ class kf extends Nd {
12696
12545
  disableCollaboration: () => {
12697
12546
  this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
12698
12547
  }
12699
- }), t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12548
+ }), t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12700
12549
  }
12701
12550
  const r = Qo(t, this.options.autofocus);
12702
12551
  this.view = new Ro(this.options.element, {
@@ -12787,11 +12636,11 @@ class kf extends Nd {
12787
12636
  * Get attributes of the currently selected node or mark.
12788
12637
  */
12789
12638
  getAttributes(e) {
12790
- return $u(this.state, e);
12639
+ return zu(this.state, e);
12791
12640
  }
12792
12641
  isActive(e, t) {
12793
12642
  const r = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
12794
- return Vu(this.state, r, i);
12643
+ return Fu(this.state, r, i);
12795
12644
  }
12796
12645
  /**
12797
12646
  * Get the document as JSON.
@@ -12812,7 +12661,7 @@ class kf extends Nd {
12812
12661
  const { blockSeparator: t = `
12813
12662
 
12814
12663
  `, textSerializers: r = {} } = e || {};
12815
- return zu(this.state.doc, {
12664
+ return Bu(this.state.doc, {
12816
12665
  blockSeparator: t,
12817
12666
  textSerializers: {
12818
12667
  ...Yo(this.schema),
@@ -12871,7 +12720,7 @@ function at(n) {
12871
12720
  return new $n({
12872
12721
  find: n.find,
12873
12722
  handler: ({ state: e, range: t, match: r }) => {
12874
- const i = E(n.getAttributes, void 0, r);
12723
+ const i = N(n.getAttributes, void 0, r);
12875
12724
  if (i === !1 || i === null)
12876
12725
  return null;
12877
12726
  const { tr: s } = e, o = r[r.length - 1], l = r[0];
@@ -12890,7 +12739,7 @@ function il(n) {
12890
12739
  return new $n({
12891
12740
  find: n.find,
12892
12741
  handler: ({ state: e, range: t, match: r }) => {
12893
- const i = E(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
12742
+ const i = N(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
12894
12743
  let l = t.to;
12895
12744
  const a = n.type.create(i);
12896
12745
  if (r[1]) {
@@ -12911,7 +12760,7 @@ function Ar(n) {
12911
12760
  return new $n({
12912
12761
  find: n.find,
12913
12762
  handler: ({ state: e, range: t, match: r }) => {
12914
- const i = e.doc.resolve(t.from), s = E(n.getAttributes, void 0, r) || {};
12763
+ const i = e.doc.resolve(t.from), s = N(n.getAttributes, void 0, r) || {};
12915
12764
  if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), n.type))
12916
12765
  return null;
12917
12766
  e.tr.delete(t.from, t.to).setBlockType(t.from, t.from, n.type, s);
@@ -12922,7 +12771,7 @@ function Wt(n) {
12922
12771
  return new $n({
12923
12772
  find: n.find,
12924
12773
  handler: ({ state: e, range: t, match: r, chain: i }) => {
12925
- const s = E(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Lr(a, n.type, s);
12774
+ const s = N(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Lr(a, n.type, s);
12926
12775
  if (!c)
12927
12776
  return null;
12928
12777
  if (o.wrap(a, c), n.keepMarks && n.editor) {
@@ -12949,9 +12798,9 @@ class ne {
12949
12798
  }, this.config = {
12950
12799
  ...this.config,
12951
12800
  ...e
12952
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
12801
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = N(x(this, "addOptions", {
12953
12802
  name: this.name
12954
- }))), this.storage = E(x(this, "addStorage", {
12803
+ }))), this.storage = N(x(this, "addStorage", {
12955
12804
  name: this.name,
12956
12805
  options: this.options
12957
12806
  })) || {};
@@ -12968,19 +12817,19 @@ class ne {
12968
12817
  }
12969
12818
  extend(e = {}) {
12970
12819
  const t = new ne(e);
12971
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
12820
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = N(x(t, "addOptions", {
12972
12821
  name: t.name
12973
- })), t.storage = E(x(t, "addStorage", {
12822
+ })), t.storage = N(x(t, "addStorage", {
12974
12823
  name: t.name,
12975
12824
  options: t.options
12976
12825
  })), t;
12977
12826
  }
12978
12827
  }
12979
12828
  function ct(n) {
12980
- return new Fd({
12829
+ return new Ld({
12981
12830
  find: n.find,
12982
12831
  handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
12983
- const s = E(n.getAttributes, void 0, r, i);
12832
+ const s = N(n.getAttributes, void 0, r, i);
12984
12833
  if (s === !1 || s === null)
12985
12834
  return null;
12986
12835
  const { tr: o } = e, l = r[r.length - 1], a = r[0];
@@ -12994,7 +12843,7 @@ function ct(n) {
12994
12843
  }
12995
12844
  });
12996
12845
  }
12997
- function xf(n, e) {
12846
+ function bf(n, e) {
12998
12847
  const { selection: t } = n, { $from: r } = t;
12999
12848
  if (t instanceof S) {
13000
12849
  const s = r.index();
@@ -13009,7 +12858,7 @@ function xf(n, e) {
13009
12858
  }
13010
12859
  return !1;
13011
12860
  }
13012
- const Sf = /^\s*>\s$/, Mf = ne.create({
12861
+ const kf = /^\s*>\s$/, xf = ne.create({
13013
12862
  name: "blockquote",
13014
12863
  addOptions() {
13015
12864
  return {
@@ -13042,12 +12891,12 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13042
12891
  addInputRules() {
13043
12892
  return [
13044
12893
  Wt({
13045
- find: Sf,
12894
+ find: kf,
13046
12895
  type: this.type
13047
12896
  })
13048
12897
  ];
13049
12898
  }
13050
- }), wf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Cf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Tf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Of = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, vf = Me.create({
12899
+ }), Sf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Mf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, wf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Cf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Tf = Me.create({
13051
12900
  name: "bold",
13052
12901
  addOptions() {
13053
12902
  return {
@@ -13092,11 +12941,11 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13092
12941
  addInputRules() {
13093
12942
  return [
13094
12943
  at({
13095
- find: wf,
12944
+ find: Sf,
13096
12945
  type: this.type
13097
12946
  }),
13098
12947
  at({
13099
- find: Tf,
12948
+ find: wf,
13100
12949
  type: this.type
13101
12950
  })
13102
12951
  ];
@@ -13104,16 +12953,16 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13104
12953
  addPasteRules() {
13105
12954
  return [
13106
12955
  ct({
13107
- find: Cf,
12956
+ find: Mf,
13108
12957
  type: this.type
13109
12958
  }),
13110
12959
  ct({
13111
- find: Of,
12960
+ find: Cf,
13112
12961
  type: this.type
13113
12962
  })
13114
12963
  ];
13115
12964
  }
13116
- }), Ef = "listItem", hs = "textStyle", ps = /^\s*([-+*])\s$/, Nf = ne.create({
12965
+ }), Of = "listItem", hs = "textStyle", ps = /^\s*([-+*])\s$/, Ef = ne.create({
13117
12966
  name: "bulletList",
13118
12967
  addOptions() {
13119
12968
  return {
@@ -13137,7 +12986,7 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13137
12986
  },
13138
12987
  addCommands() {
13139
12988
  return {
13140
- toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ef, this.editor.getAttributes(hs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
12989
+ toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Of, this.editor.getAttributes(hs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
13141
12990
  };
13142
12991
  },
13143
12992
  addKeyboardShortcuts() {
@@ -13161,7 +13010,7 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13161
13010
  n
13162
13011
  ];
13163
13012
  }
13164
- }), Af = /(^|[^`])`([^`]+)`(?!`)/, Df = /(^|[^`])`([^`]+)`(?!`)/g, If = Me.create({
13013
+ }), Nf = /(^|[^`])`([^`]+)`(?!`)/, vf = /(^|[^`])`([^`]+)`(?!`)/g, Af = Me.create({
13165
13014
  name: "code",
13166
13015
  addOptions() {
13167
13016
  return {
@@ -13194,7 +13043,7 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13194
13043
  addInputRules() {
13195
13044
  return [
13196
13045
  at({
13197
- find: Af,
13046
+ find: Nf,
13198
13047
  type: this.type
13199
13048
  })
13200
13049
  ];
@@ -13202,12 +13051,12 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13202
13051
  addPasteRules() {
13203
13052
  return [
13204
13053
  ct({
13205
- find: Df,
13054
+ find: vf,
13206
13055
  type: this.type
13207
13056
  })
13208
13057
  ];
13209
13058
  }
13210
- }), Rf = /^```([a-z]+)?[\s\n]$/, Pf = /^~~~([a-z]+)?[\s\n]$/, Bf = ne.create({
13059
+ }), Df = /^```([a-z]+)?[\s\n]$/, If = /^~~~([a-z]+)?[\s\n]$/, Rf = ne.create({
13211
13060
  name: "codeBlock",
13212
13061
  addOptions() {
13213
13062
  return {
@@ -13291,21 +13140,21 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13291
13140
  if (!s || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
13292
13141
  return !1;
13293
13142
  const l = i.after();
13294
- return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(v.near(r.resolve(l))), !0)) : n.commands.exitCode();
13143
+ return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(E.near(r.resolve(l))), !0)) : n.commands.exitCode();
13295
13144
  }
13296
13145
  };
13297
13146
  },
13298
13147
  addInputRules() {
13299
13148
  return [
13300
13149
  Ar({
13301
- find: Rf,
13150
+ find: Df,
13302
13151
  type: this.type,
13303
13152
  getAttributes: (n) => ({
13304
13153
  language: n[1]
13305
13154
  })
13306
13155
  }),
13307
13156
  Ar({
13308
- find: Pf,
13157
+ find: If,
13309
13158
  type: this.type,
13310
13159
  getAttributes: (n) => ({
13311
13160
  language: n[1]
@@ -13334,19 +13183,19 @@ const Sf = /^\s*>\s$/, Mf = ne.create({
13334
13183
  })
13335
13184
  ];
13336
13185
  }
13337
- }), Lf = ne.create({
13186
+ }), Pf = ne.create({
13338
13187
  name: "doc",
13339
13188
  topNode: !0,
13340
13189
  content: "block+"
13341
13190
  });
13342
- function zf(n = {}) {
13191
+ function Bf(n = {}) {
13343
13192
  return new se({
13344
13193
  view(e) {
13345
- return new Ff(e, n);
13194
+ return new Lf(e, n);
13346
13195
  }
13347
13196
  });
13348
13197
  }
13349
- class Ff {
13198
+ class Lf {
13350
13199
  constructor(e, t) {
13351
13200
  var r;
13352
13201
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (r = t.width) !== null && r !== void 0 ? r : 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
@@ -13420,7 +13269,7 @@ class Ff {
13420
13269
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
13421
13270
  }
13422
13271
  }
13423
- const $f = _.create({
13272
+ const zf = _.create({
13424
13273
  name: "dropCursor",
13425
13274
  addOptions() {
13426
13275
  return {
@@ -13431,11 +13280,11 @@ const $f = _.create({
13431
13280
  },
13432
13281
  addProseMirrorPlugins() {
13433
13282
  return [
13434
- zf(this.options)
13283
+ Bf(this.options)
13435
13284
  ];
13436
13285
  }
13437
13286
  });
13438
- class R extends v {
13287
+ class R extends E {
13439
13288
  /**
13440
13289
  Create a gap cursor.
13441
13290
  */
@@ -13444,7 +13293,7 @@ class R extends v {
13444
13293
  }
13445
13294
  map(e, t) {
13446
13295
  let r = e.resolve(t.map(this.head));
13447
- return R.valid(r) ? new R(r) : v.near(r);
13296
+ return R.valid(r) ? new R(r) : E.near(r);
13448
13297
  }
13449
13298
  content() {
13450
13299
  return k.empty;
@@ -13474,7 +13323,7 @@ class R extends v {
13474
13323
  */
13475
13324
  static valid(e) {
13476
13325
  let t = e.parent;
13477
- if (t.inlineContent || !Vf(e) || !Hf(e))
13326
+ if (t.inlineContent || !Ff(e) || !$f(e))
13478
13327
  return !1;
13479
13328
  let r = t.type.spec.allowGapCursor;
13480
13329
  if (r != null)
@@ -13522,7 +13371,7 @@ class R extends v {
13522
13371
  }
13523
13372
  R.prototype.visible = !1;
13524
13373
  R.findFrom = R.findGapCursorFrom;
13525
- v.jsonID("gapcursor", R);
13374
+ E.jsonID("gapcursor", R);
13526
13375
  class ri {
13527
13376
  constructor(e) {
13528
13377
  this.pos = e;
@@ -13532,13 +13381,13 @@ class ri {
13532
13381
  }
13533
13382
  resolve(e) {
13534
13383
  let t = e.resolve(this.pos);
13535
- return R.valid(t) ? new R(t) : v.near(t);
13384
+ return R.valid(t) ? new R(t) : E.near(t);
13536
13385
  }
13537
13386
  }
13538
13387
  function sl(n) {
13539
13388
  return n.isAtom || n.spec.isolating || n.spec.createGapCursor;
13540
13389
  }
13541
- function Vf(n) {
13390
+ function Ff(n) {
13542
13391
  for (let e = n.depth; e >= 0; e--) {
13543
13392
  let t = n.index(e), r = n.node(e);
13544
13393
  if (t == 0) {
@@ -13555,7 +13404,7 @@ function Vf(n) {
13555
13404
  }
13556
13405
  return !0;
13557
13406
  }
13558
- function Hf(n) {
13407
+ function $f(n) {
13559
13408
  for (let e = n.depth; e >= 0; e--) {
13560
13409
  let t = n.indexAfter(e), r = n.node(e);
13561
13410
  if (t == r.childCount) {
@@ -13572,20 +13421,20 @@ function Hf(n) {
13572
13421
  }
13573
13422
  return !0;
13574
13423
  }
13575
- function Wf() {
13424
+ function Vf() {
13576
13425
  return new se({
13577
13426
  props: {
13578
- decorations: Jf,
13427
+ decorations: jf,
13579
13428
  createSelectionBetween(n, e, t) {
13580
13429
  return e.pos == t.pos && R.valid(t) ? new R(t) : null;
13581
13430
  },
13582
- handleClick: jf,
13583
- handleKeyDown: qf,
13584
- handleDOMEvents: { beforeinput: Kf }
13431
+ handleClick: Wf,
13432
+ handleKeyDown: Hf,
13433
+ handleDOMEvents: { beforeinput: qf }
13585
13434
  }
13586
13435
  });
13587
13436
  }
13588
- const qf = Po({
13437
+ const Hf = Po({
13589
13438
  ArrowLeft: sn("horiz", -1),
13590
13439
  ArrowRight: sn("horiz", 1),
13591
13440
  ArrowUp: sn("vert", -1),
@@ -13604,7 +13453,7 @@ function sn(n, e) {
13604
13453
  return c ? (i && i(r.tr.setSelection(new R(c))), !0) : !1;
13605
13454
  };
13606
13455
  }
13607
- function jf(n, e, t) {
13456
+ function Wf(n, e, t) {
13608
13457
  if (!n || !n.editable)
13609
13458
  return !1;
13610
13459
  let r = n.state.doc.resolve(e);
@@ -13613,7 +13462,7 @@ function jf(n, e, t) {
13613
13462
  let i = n.posAtCoords({ left: t.clientX, top: t.clientY });
13614
13463
  return i && i.inside > -1 && S.isSelectable(n.state.doc.nodeAt(i.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new R(r))), !0);
13615
13464
  }
13616
- function Kf(n, e) {
13465
+ function qf(n, e) {
13617
13466
  if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof R))
13618
13467
  return !1;
13619
13468
  let { $from: t } = n.state.selection, r = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
@@ -13625,17 +13474,17 @@ function Kf(n, e) {
13625
13474
  let s = n.state.tr.replace(t.pos, t.pos, new k(i, 0, 0));
13626
13475
  return s.setSelection(M.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
13627
13476
  }
13628
- function Jf(n) {
13477
+ function jf(n) {
13629
13478
  if (!(n.selection instanceof R))
13630
13479
  return null;
13631
13480
  let e = document.createElement("div");
13632
13481
  return e.className = "ProseMirror-gapcursor", z.create(n.doc, [he.widget(n.selection.head, e, { key: "gapcursor" })]);
13633
13482
  }
13634
- const Uf = _.create({
13483
+ const Kf = _.create({
13635
13484
  name: "gapCursor",
13636
13485
  addProseMirrorPlugins() {
13637
13486
  return [
13638
- Wf()
13487
+ Vf()
13639
13488
  ];
13640
13489
  },
13641
13490
  extendNodeSchema(n) {
@@ -13646,10 +13495,10 @@ const Uf = _.create({
13646
13495
  storage: n.storage
13647
13496
  };
13648
13497
  return {
13649
- allowGapCursor: (e = E(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
13498
+ allowGapCursor: (e = N(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
13650
13499
  };
13651
13500
  }
13652
- }), _f = ne.create({
13501
+ }), Jf = ne.create({
13653
13502
  name: "hardBreak",
13654
13503
  addOptions() {
13655
13504
  return {
@@ -13699,7 +13548,7 @@ const Uf = _.create({
13699
13548
  "Shift-Enter": () => this.editor.commands.setHardBreak()
13700
13549
  };
13701
13550
  }
13702
- }), Gf = ne.create({
13551
+ }), Uf = ne.create({
13703
13552
  name: "heading",
13704
13553
  addOptions() {
13705
13554
  return {
@@ -13758,7 +13607,7 @@ $.prototype.prepend = function(e) {
13758
13607
  return e.length ? $.from(e).append(this) : this;
13759
13608
  };
13760
13609
  $.prototype.appendInner = function(e) {
13761
- return new Yf(this, e);
13610
+ return new _f(this, e);
13762
13611
  };
13763
13612
  $.prototype.slice = function(e, t) {
13764
13613
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? $.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -13813,7 +13662,7 @@ var ol = /* @__PURE__ */ function(n) {
13813
13662
  }, Object.defineProperties(e.prototype, t), e;
13814
13663
  }($);
13815
13664
  $.empty = new ol([]);
13816
- var Yf = /* @__PURE__ */ function(n) {
13665
+ var _f = /* @__PURE__ */ function(n) {
13817
13666
  function e(t, r) {
13818
13667
  n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
13819
13668
  }
@@ -13846,7 +13695,7 @@ var Yf = /* @__PURE__ */ function(n) {
13846
13695
  return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
13847
13696
  }, e;
13848
13697
  }($);
13849
- const Xf = 500;
13698
+ const Gf = 500;
13850
13699
  class ge {
13851
13700
  constructor(e, t) {
13852
13701
  this.items = e, this.eventCount = t;
@@ -13888,7 +13737,7 @@ class ge {
13888
13737
  (h = a && a.merge(f)) && (f = h, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
13889
13738
  }
13890
13739
  let c = o - r.depth;
13891
- return c > Qf && (l = Zf(l, c), o -= c), new ge(l.append(s), o);
13740
+ return c > Xf && (l = Yf(l, c), o -= c), new ge(l.append(s), o);
13892
13741
  }
13893
13742
  remapping(e, t) {
13894
13743
  let r = new Bt();
@@ -13928,7 +13777,7 @@ class ge {
13928
13777
  for (let f = t; f < o; f++)
13929
13778
  c.push(new be(s.maps[f]));
13930
13779
  let d = this.items.slice(0, i).append(c).append(r), u = new ge(d, l);
13931
- return u.emptyItemCount() > Xf && (u = u.compress(this.items.length - r.length)), u;
13780
+ return u.emptyItemCount() > Gf && (u = u.compress(this.items.length - r.length)), u;
13932
13781
  }
13933
13782
  emptyItemCount() {
13934
13783
  let e = 0;
@@ -13960,7 +13809,7 @@ class ge {
13960
13809
  }
13961
13810
  }
13962
13811
  ge.empty = new ge($.empty, 0);
13963
- function Zf(n, e) {
13812
+ function Yf(n, e) {
13964
13813
  let t;
13965
13814
  return n.forEach((r, i) => {
13966
13815
  if (r.selection && e-- == 0)
@@ -13984,23 +13833,23 @@ class Re {
13984
13833
  this.done = e, this.undone = t, this.prevRanges = r, this.prevTime = i, this.prevComposition = s;
13985
13834
  }
13986
13835
  }
13987
- const Qf = 20;
13988
- function eh(n, e, t, r) {
13836
+ const Xf = 20;
13837
+ function Zf(n, e, t, r) {
13989
13838
  let i = t.getMeta(rt), s;
13990
13839
  if (i)
13991
13840
  return i.historyState;
13992
- t.getMeta(rh) && (n = new Re(n.done, n.undone, null, 0, -1));
13841
+ t.getMeta(th) && (n = new Re(n.done, n.undone, null, 0, -1));
13993
13842
  let o = t.getMeta("appendedTransaction");
13994
13843
  if (t.steps.length == 0)
13995
13844
  return n;
13996
13845
  if (o && o.getMeta(rt))
13997
13846
  return o.getMeta(rt).redo ? new Re(n.done.addTransform(t, void 0, r, cn(e)), n.undone, ms(t.mapping.maps), n.prevTime, n.prevComposition) : new Re(n.done, n.undone.addTransform(t, void 0, r, cn(e)), null, n.prevTime, n.prevComposition);
13998
13847
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13999
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !th(t, n.prevRanges)), c = o ? lr(n.prevRanges, t.mapping) : ms(t.mapping.maps);
13848
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !Qf(t, n.prevRanges)), c = o ? lr(n.prevRanges, t.mapping) : ms(t.mapping.maps);
14000
13849
  return new Re(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, cn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
14001
13850
  } else return (s = t.getMeta("rebased")) ? new Re(n.done.rebased(t, s), n.undone.rebased(t, s), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Re(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
14002
13851
  }
14003
- function th(n, e) {
13852
+ function Qf(n, e) {
14004
13853
  if (!e)
14005
13854
  return !1;
14006
13855
  if (!n.docChanged)
@@ -14027,7 +13876,7 @@ function lr(n, e) {
14027
13876
  }
14028
13877
  return t;
14029
13878
  }
14030
- function nh(n, e, t) {
13879
+ function eh(n, e, t) {
14031
13880
  let r = cn(e), i = rt.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
14032
13881
  if (!s)
14033
13882
  return null;
@@ -14047,8 +13896,8 @@ function cn(n) {
14047
13896
  }
14048
13897
  return ar;
14049
13898
  }
14050
- const rt = new we("history"), rh = new we("closeHistory");
14051
- function ih(n = {}) {
13899
+ const rt = new we("history"), th = new we("closeHistory");
13900
+ function nh(n = {}) {
14052
13901
  return n = {
14053
13902
  depth: n.depth || 100,
14054
13903
  newGroupDelay: n.newGroupDelay || 500
@@ -14059,7 +13908,7 @@ function ih(n = {}) {
14059
13908
  return new Re(ge.empty, ge.empty, null, 0, -1);
14060
13909
  },
14061
13910
  apply(e, t, r) {
14062
- return eh(t, r, e, n);
13911
+ return Zf(t, r, e, n);
14063
13912
  }
14064
13913
  },
14065
13914
  config: n,
@@ -14079,13 +13928,13 @@ function ll(n, e) {
14079
13928
  if (!i || (n ? i.undone : i.done).eventCount == 0)
14080
13929
  return !1;
14081
13930
  if (r) {
14082
- let s = nh(i, t, n);
13931
+ let s = eh(i, t, n);
14083
13932
  s && r(e ? s.scrollIntoView() : s);
14084
13933
  }
14085
13934
  return !0;
14086
13935
  };
14087
13936
  }
14088
- const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
13937
+ const al = ll(!1, !0), cl = ll(!0, !0), rh = _.create({
14089
13938
  name: "history",
14090
13939
  addOptions() {
14091
13940
  return {
@@ -14101,7 +13950,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14101
13950
  },
14102
13951
  addProseMirrorPlugins() {
14103
13952
  return [
14104
- ih(this.options)
13953
+ nh(this.options)
14105
13954
  ];
14106
13955
  },
14107
13956
  addKeyboardShortcuts() {
@@ -14114,7 +13963,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14114
13963
  "Shift-Mod-я": () => this.editor.commands.redo()
14115
13964
  };
14116
13965
  }
14117
- }), oh = ne.create({
13966
+ }), ih = ne.create({
14118
13967
  name: "horizontalRule",
14119
13968
  addOptions() {
14120
13969
  return {
@@ -14131,7 +13980,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14131
13980
  addCommands() {
14132
13981
  return {
14133
13982
  setHorizontalRule: () => ({ chain: n, state: e }) => {
14134
- if (!xf(e, e.schema.nodes[this.name]))
13983
+ if (!bf(e, e.schema.nodes[this.name]))
14135
13984
  return !1;
14136
13985
  const { selection: t } = e, { $from: r, $to: i } = t, s = n();
14137
13986
  return r.parentOffset === 0 ? s.insertContentAt({
@@ -14139,7 +13988,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14139
13988
  to: i.pos
14140
13989
  }, {
14141
13990
  type: this.name
14142
- }) : Hu(t) ? s.insertContentAt(i.pos, {
13991
+ }) : $u(t) ? s.insertContentAt(i.pos, {
14143
13992
  type: this.name
14144
13993
  }) : s.insertContent({ type: this.name }), s.command(({ tr: o, dispatch: l }) => {
14145
13994
  var a;
@@ -14166,7 +14015,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14166
14015
  })
14167
14016
  ];
14168
14017
  }
14169
- }), lh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, ah = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, ch = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, dh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, uh = Me.create({
14018
+ }), sh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, oh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, lh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, ah = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, ch = Me.create({
14170
14019
  name: "italic",
14171
14020
  addOptions() {
14172
14021
  return {
@@ -14210,11 +14059,11 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14210
14059
  addInputRules() {
14211
14060
  return [
14212
14061
  at({
14213
- find: lh,
14062
+ find: sh,
14214
14063
  type: this.type
14215
14064
  }),
14216
14065
  at({
14217
- find: ch,
14066
+ find: lh,
14218
14067
  type: this.type
14219
14068
  })
14220
14069
  ];
@@ -14222,16 +14071,16 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14222
14071
  addPasteRules() {
14223
14072
  return [
14224
14073
  ct({
14225
- find: ah,
14074
+ find: oh,
14226
14075
  type: this.type
14227
14076
  }),
14228
14077
  ct({
14229
- find: dh,
14078
+ find: ah,
14230
14079
  type: this.type
14231
14080
  })
14232
14081
  ];
14233
14082
  }
14234
- }), fh = ne.create({
14083
+ }), dh = ne.create({
14235
14084
  name: "listItem",
14236
14085
  addOptions() {
14237
14086
  return {
@@ -14259,7 +14108,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14259
14108
  "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
14260
14109
  };
14261
14110
  }
14262
- }), hh = "listItem", ys = "textStyle", bs = /^(\d+)\.\s$/, ph = ne.create({
14111
+ }), uh = "listItem", ys = "textStyle", bs = /^(\d+)\.\s$/, fh = ne.create({
14263
14112
  name: "orderedList",
14264
14113
  addOptions() {
14265
14114
  return {
@@ -14298,7 +14147,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14298
14147
  },
14299
14148
  addCommands() {
14300
14149
  return {
14301
- toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(hh, this.editor.getAttributes(ys)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14150
+ toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(uh, this.editor.getAttributes(ys)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14302
14151
  };
14303
14152
  },
14304
14153
  addKeyboardShortcuts() {
@@ -14325,7 +14174,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14325
14174
  n
14326
14175
  ];
14327
14176
  }
14328
- }), mh = ne.create({
14177
+ }), hh = ne.create({
14329
14178
  name: "paragraph",
14330
14179
  priority: 1e3,
14331
14180
  addOptions() {
@@ -14353,7 +14202,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14353
14202
  "Mod-Alt-0": () => this.editor.commands.setParagraph()
14354
14203
  };
14355
14204
  }
14356
- }), gh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, yh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, bh = Me.create({
14205
+ }), ph = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, mh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, gh = Me.create({
14357
14206
  name: "strike",
14358
14207
  addOptions() {
14359
14208
  return {
@@ -14396,7 +14245,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14396
14245
  addInputRules() {
14397
14246
  return [
14398
14247
  at({
14399
- find: gh,
14248
+ find: ph,
14400
14249
  type: this.type
14401
14250
  })
14402
14251
  ];
@@ -14404,21 +14253,21 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14404
14253
  addPasteRules() {
14405
14254
  return [
14406
14255
  ct({
14407
- find: yh,
14256
+ find: mh,
14408
14257
  type: this.type
14409
14258
  })
14410
14259
  ];
14411
14260
  }
14412
- }), kh = ne.create({
14261
+ }), yh = ne.create({
14413
14262
  name: "text",
14414
14263
  group: "inline"
14415
- }), xh = _.create({
14264
+ }), bh = _.create({
14416
14265
  name: "starterKit",
14417
14266
  addExtensions() {
14418
14267
  const n = [];
14419
- return this.options.bold !== !1 && n.push(vf.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Mf.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Nf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(If.configure(this.options.code)), this.options.codeBlock !== !1 && n.push(Bf.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Lf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push($f.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(Uf.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(_f.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(Gf.configure(this.options.heading)), this.options.history !== !1 && n.push(sh.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(oh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(uh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(fh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(ph.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(mh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(bh.configure(this.options.strike)), this.options.text !== !1 && n.push(kh.configure(this.options.text)), n;
14268
+ return this.options.bold !== !1 && n.push(Tf.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(xf.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Ef.configure(this.options.bulletList)), this.options.code !== !1 && n.push(Af.configure(this.options.code)), this.options.codeBlock !== !1 && n.push(Rf.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Pf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(zf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(Kf.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(Jf.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(Uf.configure(this.options.heading)), this.options.history !== !1 && n.push(rh.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(ih.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(ch.configure(this.options.italic)), this.options.listItem !== !1 && n.push(dh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(fh.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(hh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(gh.configure(this.options.strike)), this.options.text !== !1 && n.push(yh.configure(this.options.text)), n;
14420
14269
  }
14421
- }), Sh = (n) => {
14270
+ }), kh = (n) => {
14422
14271
  if (!n.children.length)
14423
14272
  return;
14424
14273
  const e = n.querySelectorAll("span");
@@ -14427,7 +14276,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14427
14276
  const s = t.getAttribute("style"), o = (i = (r = t.parentElement) === null || r === void 0 ? void 0 : r.closest("span")) === null || i === void 0 ? void 0 : i.getAttribute("style");
14428
14277
  t.setAttribute("style", `${o};${s}`);
14429
14278
  });
14430
- }, Mh = Me.create({
14279
+ }, xh = Me.create({
14431
14280
  name: "textStyle",
14432
14281
  priority: 101,
14433
14282
  addOptions() {
@@ -14440,7 +14289,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14440
14289
  return [
14441
14290
  {
14442
14291
  tag: "span",
14443
- getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && Sh(n), {}) : !1
14292
+ getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && kh(n), {}) : !1
14444
14293
  }
14445
14294
  ];
14446
14295
  },
@@ -14459,7 +14308,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14459
14308
  }
14460
14309
  };
14461
14310
  }
14462
- }), wh = _.create({
14311
+ }), Sh = _.create({
14463
14312
  name: "color",
14464
14313
  addOptions() {
14465
14314
  return {
@@ -14491,7 +14340,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14491
14340
  unsetColor: () => ({ chain: n }) => n().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
14492
14341
  };
14493
14342
  }
14494
- }), Ch = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Th = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Oh = Me.create({
14343
+ }), Mh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, wh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Ch = Me.create({
14495
14344
  name: "highlight",
14496
14345
  addOptions() {
14497
14346
  return {
@@ -14536,7 +14385,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14536
14385
  addInputRules() {
14537
14386
  return [
14538
14387
  at({
14539
- find: Ch,
14388
+ find: Mh,
14540
14389
  type: this.type
14541
14390
  })
14542
14391
  ];
@@ -14544,12 +14393,12 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14544
14393
  addPasteRules() {
14545
14394
  return [
14546
14395
  ct({
14547
- find: Th,
14396
+ find: wh,
14548
14397
  type: this.type
14549
14398
  })
14550
14399
  ];
14551
14400
  }
14552
- }), vh = _.create({
14401
+ }), Th = _.create({
14553
14402
  name: "textAlign",
14554
14403
  addOptions() {
14555
14404
  return {
@@ -14590,7 +14439,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14590
14439
  "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
14591
14440
  };
14592
14441
  }
14593
- }), Eh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Nh = ne.create({
14442
+ }), Oh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Eh = ne.create({
14594
14443
  name: "image",
14595
14444
  addOptions() {
14596
14445
  return {
@@ -14640,7 +14489,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14640
14489
  addInputRules() {
14641
14490
  return [
14642
14491
  il({
14643
- find: Eh,
14492
+ find: Oh,
14644
14493
  type: this.type,
14645
14494
  getAttributes: (n) => {
14646
14495
  const [, , e, t, r] = n;
@@ -14651,7 +14500,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), sh = _.create({
14651
14500
  }
14652
14501
  });
14653
14502
  var re, Jt, Ut, de, Dr, dl, ul, fl, hl;
14654
- class Ah extends Ml {
14503
+ class Nh extends xl {
14655
14504
  constructor() {
14656
14505
  super();
14657
14506
  W(this, de);
@@ -14702,10 +14551,10 @@ Dr = function() {
14702
14551
  r && (r.style.display = t ? "none" : "flex");
14703
14552
  }
14704
14553
  }, dl = function() {
14705
- const t = En.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14554
+ const t = Nn.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14706
14555
  this.shadowRoot.innerHTML = `
14707
14556
  <style>
14708
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.15/dist/css/nineEditor.css";
14557
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.16/dist/css/nineEditor.css";
14709
14558
  ${r}
14710
14559
  </style>
14711
14560
 
@@ -14745,22 +14594,22 @@ Dr = function() {
14745
14594
  console.log(i.target, s), T(this, re).chain().focus().setMark("textStyle", { fontSize: s }).run();
14746
14595
  };
14747
14596
  }, ul = function() {
14748
- oe(this, re, new kf({
14597
+ oe(this, re, new yf({
14749
14598
  element: T(this, Jt),
14750
14599
  editable: !this.readonly,
14751
14600
  // 4. 생성 시 readonly 여부 반영
14752
14601
  extensions: [
14753
- xh,
14602
+ bh,
14754
14603
  // 기본 셋 (Bold, Italic, Strike 등 포함)
14755
14604
  //Underline, // StarterKit에 없으므로 유지
14756
- wh,
14605
+ Sh,
14757
14606
  // StarterKit에 없으므로 유지
14758
- Oh.configure({ multicolor: !0 }),
14759
- vh.configure({ types: ["heading", "paragraph"] }),
14760
- Nh.configure({ inline: !0, allowBase64: !0 }),
14607
+ Ch.configure({ multicolor: !0 }),
14608
+ Th.configure({ types: ["heading", "paragraph"] }),
14609
+ Eh.configure({ inline: !0, allowBase64: !0 }),
14761
14610
  // TextStyle은 여기서 'extend'로 직접 정의하므로
14762
14611
  // 배열에 별도의 TextStyle을 또 넣지 마세요.
14763
- Mh.extend({
14612
+ xh.extend({
14764
14613
  addAttributes() {
14765
14614
  return {
14766
14615
  fontSize: {
@@ -14806,9 +14655,9 @@ Dr = function() {
14806
14655
  r && t.chain().focus().setImage({ src: r }).run();
14807
14656
  };
14808
14657
  };
14809
- typeof window < "u" && (window.nineUx = En, customElements.get("nine-editor") || customElements.define("nine-editor", Ah));
14658
+ typeof window < "u" && (window.nineUx = Nn, customElements.get("nine-editor") || customElements.define("nine-editor", Nh));
14810
14659
  export {
14811
- Ah as nineEditor,
14812
- En as nineUx
14660
+ Nh as nineEditor,
14661
+ Nn as nineUx
14813
14662
  };
14814
14663
  //# sourceMappingURL=nine-ux.es.js.map