@uva-glass/component-library 3.0.9 → 3.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{Lexical.prod-BqkvGy5o.js → Lexical.prod-CoFvB6ST.js} +1498 -1482
  2. package/dist/Lexical.prod-CoFvB6ST.js.map +1 -0
  3. package/dist/LexicalClipboard.prod-BceK2u8q.js +255 -0
  4. package/dist/LexicalClipboard.prod-BceK2u8q.js.map +1 -0
  5. package/dist/LexicalComposerContext.prod-DLlRM5wP.js +22 -0
  6. package/dist/LexicalComposerContext.prod-DLlRM5wP.js.map +1 -0
  7. package/dist/{LexicalLink.prod-D-CG9yYv.js → LexicalLink.prod-DgAdBBH7.js} +67 -71
  8. package/dist/LexicalLink.prod-DgAdBBH7.js.map +1 -0
  9. package/dist/{LexicalList.prod-CDTuG8cz.js → LexicalList.prod-BsGg0KUo.js} +116 -119
  10. package/dist/LexicalList.prod-BsGg0KUo.js.map +1 -0
  11. package/dist/LexicalSelection.prod-CajyzNb9.js +85 -0
  12. package/dist/LexicalSelection.prod-CajyzNb9.js.map +1 -0
  13. package/dist/{LexicalTable.prod-Ckge-lZb.js → LexicalTable.prod-CNsOdwua.js} +629 -611
  14. package/dist/LexicalTable.prod-CNsOdwua.js.map +1 -0
  15. package/dist/LexicalUtils.prod-CqRL6ZhZ.js +109 -0
  16. package/dist/LexicalUtils.prod-CqRL6ZhZ.js.map +1 -0
  17. package/dist/{TablePlugin-BBgBJKsb.js → TablePlugin-CFD5PSMc.js} +63 -63
  18. package/dist/{TablePlugin-BBgBJKsb.js.map → TablePlugin-CFD5PSMc.js.map} +1 -1
  19. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  20. package/dist/components/FormInput/FormInput.js +1 -1
  21. package/dist/components/InputField/InputField.stories.js +1 -1
  22. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  23. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  24. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  25. package/dist/components/MultiSelect/index.js +1 -1
  26. package/dist/components/OverlayStepBar/OverlayStepBar.js +1 -1
  27. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  28. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  29. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  30. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -11
  31. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +7 -7
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  34. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +39 -39
  35. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  36. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +17 -17
  37. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +12 -12
  38. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  39. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +1 -1
  40. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
  41. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +22 -22
  42. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  43. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
  44. package/dist/components/RteEditor/Plugins/index.js +1 -1
  45. package/dist/components/RteEditor/RteEditor.js +481 -490
  46. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  47. package/dist/components/RteEditor/helpers.js +5 -5
  48. package/dist/components/index.js +1 -1
  49. package/dist/helpers-C-JeRM2f.js +164 -0
  50. package/dist/helpers-C-JeRM2f.js.map +1 -0
  51. package/dist/index.js +1 -1
  52. package/package.json +17 -17
  53. package/dist/Lexical.prod-BqkvGy5o.js.map +0 -1
  54. package/dist/LexicalClipboard.prod-BSR9LEVL.js +0 -258
  55. package/dist/LexicalClipboard.prod-BSR9LEVL.js.map +0 -1
  56. package/dist/LexicalComposerContext.prod--Rm7-Z9o.js +0 -26
  57. package/dist/LexicalComposerContext.prod--Rm7-Z9o.js.map +0 -1
  58. package/dist/LexicalLink.prod-D-CG9yYv.js.map +0 -1
  59. package/dist/LexicalList.prod-CDTuG8cz.js.map +0 -1
  60. package/dist/LexicalSelection.prod-BxYY0fGG.js +0 -86
  61. package/dist/LexicalSelection.prod-BxYY0fGG.js.map +0 -1
  62. package/dist/LexicalTable.prod-Ckge-lZb.js.map +0 -1
  63. package/dist/LexicalUtils.prod-CIQUUsvA.js +0 -112
  64. package/dist/LexicalUtils.prod-CIQUUsvA.js.map +0 -1
  65. package/dist/helpers-CzeCSkV-.js +0 -168
  66. package/dist/helpers-CzeCSkV-.js.map +0 -1
@@ -1,43 +1,43 @@
1
- import { v as x, n as U, M as ht, o as ae, j as Ft, C as Ot, b as dt, x as kt, S as Kt } from "./LexicalUtils.prod-CIQUUsvA.js";
2
- import { f as Pe, e as Ne, U as He, d as P, T as G, D as At, Z as fe, Y as De, _ as Et, i as ft, r as Q, k as $t, l as Oe, u as gt, a as L, c as Mt, n as ce, N as D, m as xe, P as zt, o as Lt, p as Pt, q as Ht, F as ke, O as Dt, y as Wt, x as mt, v as Bt, L as X, A as It, M as Jt, $ as qt, S as Xt, K as Yt, z as Ut, B as jt, C as Vt, G as le, J as Qe, h as Z, Q as ve, R as Zt, g as Ct, W as Gt, w as pt, a0 as Qt, V as en, a1 as tn, a2 as Te, b as nn, a3 as on, a4 as rn } from "./Lexical.prod-BqkvGy5o.js";
3
- import { O as ln, M as sn } from "./LexicalClipboard.prod-BSR9LEVL.js";
4
- const We = /^(\d+(?:\.\d+)?)px$/, I = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
- class ne extends Pe {
1
+ import { h as N, e as X, T as mt, n as ie, $ as kt, A as $t, P as Ct, w as Mt, E as zt } from "./LexicalUtils.prod-CqRL6ZhZ.js";
2
+ import { f as Pe, e as be, U as Be, d as P, T as j, O as Lt, X as de, Q as He, _ as Pt, h as pt, r as V, i as Bt, N as Ke, j as _t, l as z, o as Ht, n as ce, a as L, k as ye, m as Wt, p as Dt, q as It, u as Jt, F as Ae, L as Xt, v as Yt, x as St, y as qt, z as I, A as Ut, B as jt, G as Vt, I as Qt, J as Gt, K as Zt, M as en, P as tn, S as ne, V as Ze, g as q, W as xe, Y as nn, b as wt, Z as on, w as bt, a0 as rn, $ as ln, a1 as Ne, a2 as sn, a3 as an, a4 as et, a5 as cn, a6 as tt, D as un, a7 as nt, s as ot, c as Ce, a8 as hn, C as dn, a9 as fn, aa as gn } from "./Lexical.prod-CoFvB6ST.js";
3
+ import { _ as mn, M as Cn } from "./LexicalClipboard.prod-BceK2u8q.js";
4
+ const We = /^(\d+(?:\.\d+)?)px$/, D = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
+ class Z extends Pe {
6
6
  static getType() {
7
7
  return "tablecell";
8
8
  }
9
9
  static clone(e) {
10
- return new ne(e.__headerState, e.__colSpan, e.__width, e.__key);
10
+ return new Z(e.__headerState, e.__colSpan, e.__width, e.__key);
11
11
  }
12
12
  afterCloneFrom(e) {
13
13
  super.afterCloneFrom(e), this.__rowSpan = e.__rowSpan, this.__backgroundColor = e.__backgroundColor, this.__verticalAlign = e.__verticalAlign;
14
14
  }
15
15
  static importDOM() {
16
- return { td: (e) => ({ conversion: et, priority: 0 }), th: (e) => ({ conversion: et, priority: 0 }) };
16
+ return { td: (e) => ({ conversion: rt, priority: 0 }), th: (e) => ({ conversion: rt, priority: 0 }) };
17
17
  }
18
18
  static importJSON(e) {
19
- return ge().updateFromJSON(e);
19
+ return fe().updateFromJSON(e);
20
20
  }
21
21
  updateFromJSON(e) {
22
22
  return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan || 1).setRowSpan(e.rowSpan || 1).setWidth(e.width || void 0).setBackgroundColor(e.backgroundColor || null).setVerticalAlign(e.verticalAlign || void 0);
23
23
  }
24
- constructor(e = I.NO_STATUS, t = 1, o, r) {
25
- super(r), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null;
24
+ constructor(e = D.NO_STATUS, t = 1, o, r) {
25
+ super(r), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
26
26
  }
27
27
  createDOM(e) {
28
28
  const t = document.createElement(this.getTag());
29
- return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), Ee(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), U(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
29
+ return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), ke(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), X(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
30
30
  }
31
31
  exportDOM(e) {
32
32
  const t = super.exportDOM(e);
33
- if (Ne(t.element)) {
33
+ if (be(t.element)) {
34
34
  const o = t.element;
35
35
  o.setAttribute("data-temporary-table-cell-lexical-key", this.getKey()), o.style.border = "1px solid black", this.__colSpan > 1 && (o.colSpan = this.__colSpan), this.__rowSpan > 1 && (o.rowSpan = this.__rowSpan), o.style.width = `${this.getWidth() || 75}px`, o.style.verticalAlign = this.getVerticalAlign() || "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
36
36
  }
37
37
  return t;
38
38
  }
39
39
  exportJSON() {
40
- return { ...super.exportJSON(), ...Ee(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
40
+ return { ...super.exportJSON(), ...ke(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
41
41
  }
42
42
  getColSpan() {
43
43
  return this.getLatest().__colSpan;
@@ -56,7 +56,7 @@ class ne extends Pe {
56
56
  getTag() {
57
57
  return this.hasHeader() ? "th" : "td";
58
58
  }
59
- setHeaderStyles(e, t = I.BOTH) {
59
+ setHeaderStyles(e, t = D.BOTH) {
60
60
  const o = this.getWritable();
61
61
  return o.__headerState = e & t | o.__headerState & ~t, o;
62
62
  }
@@ -92,7 +92,7 @@ class ne extends Pe {
92
92
  return (this.getHeaderStyles() & e) === e;
93
93
  }
94
94
  hasHeader() {
95
- return this.getLatest().__headerState !== I.NO_STATUS;
95
+ return this.getLatest().__headerState !== D.NO_STATUS;
96
96
  }
97
97
  updateDOM(e) {
98
98
  return e.__headerState !== this.__headerState || e.__width !== this.__width || e.__colSpan !== this.__colSpan || e.__rowSpan !== this.__rowSpan || e.__backgroundColor !== this.__backgroundColor || e.__verticalAlign !== this.__verticalAlign;
@@ -110,57 +110,54 @@ class ne extends Pe {
110
110
  return !1;
111
111
  }
112
112
  }
113
- function Ee(n) {
113
+ function ke(n) {
114
114
  return n === "middle" || n === "bottom";
115
115
  }
116
- function et(n) {
116
+ function rt(n) {
117
117
  const e = n, t = n.nodeName.toLowerCase();
118
118
  let o;
119
119
  We.test(e.style.width) && (o = parseFloat(e.style.width));
120
- const r = ge(t === "th" ? I.ROW : I.NO_STATUS, e.colSpan, o);
120
+ const r = fe(t === "th" ? D.ROW : D.NO_STATUS, e.colSpan, o);
121
121
  r.__rowSpan = e.rowSpan;
122
122
  const s = e.style.backgroundColor;
123
123
  s !== "" && (r.__backgroundColor = s);
124
124
  const l = e.style.verticalAlign;
125
- Ee(l) && (r.__verticalAlign = l);
126
- const a = e.style, c = (a && a.textDecoration || "").split(" "), d = a.fontWeight === "700" || a.fontWeight === "bold", h = c.includes("line-through"), C = a.fontStyle === "italic", p = c.includes("underline");
127
- return { after: (i) => (i.length === 0 && i.push(G()), i), forChild: (i, u) => {
125
+ ke(l) && (r.__verticalAlign = l);
126
+ const a = e.style, c = (a && a.textDecoration || "").split(" "), f = a.fontWeight === "700" || a.fontWeight === "bold", h = c.includes("line-through"), C = a.fontStyle === "italic", p = c.includes("underline");
127
+ return { after: (i) => (i.length === 0 && i.push(j()), i), forChild: (i, u) => {
128
128
  if (S(u) && !P(i)) {
129
- const f = G();
130
- return At(i) && i.getTextContent() === `
131
- ` ? null : (fe(i) && (d && i.toggleFormat("bold"), h && i.toggleFormat("strikethrough"), C && i.toggleFormat("italic"), p && i.toggleFormat("underline")), f.append(i), f);
129
+ const g = j();
130
+ return Lt(i) && i.getTextContent() === `
131
+ ` ? null : (de(i) && (f && i.toggleFormat("bold"), h && i.toggleFormat("strikethrough"), C && i.toggleFormat("italic"), p && i.toggleFormat("underline")), g.append(i), g);
132
132
  }
133
133
  return i;
134
134
  }, node: r };
135
135
  }
136
- function ge(n = I.NO_STATUS, e = 1, t) {
137
- return He(new ne(n, e, t));
136
+ function fe(n = D.NO_STATUS, e = 1, t) {
137
+ return Be(new Z(n, e, t));
138
138
  }
139
139
  function S(n) {
140
- return n instanceof ne;
141
- }
142
- const an = Mt();
143
- function cn(n) {
144
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
145
- }
146
- var b = cn(function(n) {
147
- const e = new URL("https://lexical.dev/docs/error"), t = new URLSearchParams();
148
- t.append("code", n);
149
- for (let o = 1; o < arguments.length; o++) t.append("v", arguments[o]);
150
- throw e.search = t.toString(), Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
151
- });
152
- class me extends Pe {
140
+ return n instanceof Z;
141
+ }
142
+ const pn = Ht();
143
+ function w(n, ...e) {
144
+ const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
145
+ o.append("code", n);
146
+ for (const r of e) o.append("v", r);
147
+ throw t.search = o.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
148
+ }
149
+ class ge extends Pe {
153
150
  static getType() {
154
151
  return "tablerow";
155
152
  }
156
153
  static clone(e) {
157
- return new me(e.__height, e.__key);
154
+ return new ge(e.__height, e.__key);
158
155
  }
159
156
  static importDOM() {
160
- return { tr: (e) => ({ conversion: un, priority: 0 }) };
157
+ return { tr: (e) => ({ conversion: _n, priority: 0 }) };
161
158
  }
162
159
  static importJSON(e) {
163
- return Be().updateFromJSON(e);
160
+ return De().updateFromJSON(e);
164
161
  }
165
162
  updateFromJSON(e) {
166
163
  return super.updateFromJSON(e).setHeight(e.height);
@@ -174,7 +171,7 @@ class me extends Pe {
174
171
  }
175
172
  createDOM(e) {
176
173
  const t = document.createElement("tr");
177
- return this.__height && (t.style.height = `${this.__height}px`), U(t, e.theme.tableRow), t;
174
+ return this.__height && (t.style.height = `${this.__height}px`), X(t, e.theme.tableRow), t;
178
175
  }
179
176
  extractWithChild(e, t, o) {
180
177
  return o === "html";
@@ -199,59 +196,59 @@ class me extends Pe {
199
196
  return !1;
200
197
  }
201
198
  }
202
- function un(n) {
199
+ function _n(n) {
203
200
  const e = n;
204
201
  let t;
205
- return We.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => ht(o, S), node: Be(t) };
202
+ return We.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => mt(o, S), node: De(t) };
206
203
  }
207
- function Be(n) {
208
- return He(new me(n));
204
+ function De(n) {
205
+ return Be(new ge(n));
209
206
  }
210
- function z(n) {
211
- return n instanceof me;
207
+ function k(n) {
208
+ return n instanceof ge;
212
209
  }
213
- const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, hn = Ie && "documentMode" in document ? document.documentMode : null, dn = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
214
- function fn(n, e, t = !0) {
215
- const o = Ye();
210
+ const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Sn = Ie && "documentMode" in document ? document.documentMode : null, wn = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
211
+ function bn(n, e, t = !0) {
212
+ const o = qe();
216
213
  for (let r = 0; r < n; r++) {
217
- const s = Be();
214
+ const s = De();
218
215
  for (let l = 0; l < e; l++) {
219
- let a = I.NO_STATUS;
220
- typeof t == "object" ? (r === 0 && t.rows && (a |= I.ROW), l === 0 && t.columns && (a |= I.COLUMN)) : t && (r === 0 && (a |= I.ROW), l === 0 && (a |= I.COLUMN));
221
- const c = ge(a), d = G();
222
- d.append(De()), c.append(d), s.append(c);
216
+ let a = D.NO_STATUS;
217
+ typeof t == "object" ? (r === 0 && t.rows && (a |= D.ROW), l === 0 && t.columns && (a |= D.COLUMN)) : t && (r === 0 && (a |= D.ROW), l === 0 && (a |= D.COLUMN));
218
+ const c = fe(a), f = j();
219
+ f.append(He()), c.append(f), s.append(c);
223
220
  }
224
221
  o.append(s);
225
222
  }
226
223
  return o;
227
224
  }
228
- function $n(n) {
229
- const e = x(n, (t) => S(t));
225
+ function Jn(n) {
226
+ const e = N(n, (t) => S(t));
230
227
  return S(e) ? e : null;
231
228
  }
232
- function _t(n) {
233
- const e = x(n, (t) => z(t));
234
- if (z(e)) return e;
229
+ function yt(n) {
230
+ const e = N(n, (t) => k(t));
231
+ if (k(e)) return e;
235
232
  throw new Error("Expected table cell to be inside of table row.");
236
233
  }
237
- function gn(n) {
238
- const e = x(n, (t) => $(t));
239
- if ($(e)) return e;
234
+ function yn(n) {
235
+ const e = N(n, (t) => K(t));
236
+ if (K(e)) return e;
240
237
  throw new Error("Expected table cell to be inside of table.");
241
238
  }
242
- function Mn(n) {
243
- const e = _t(n);
244
- return gn(e).getChildren().findIndex((t) => t.is(e));
239
+ function Xn(n) {
240
+ const e = yt(n);
241
+ return yn(e).getChildren().findIndex((t) => t.is(e));
245
242
  }
246
- function zn(n) {
247
- return _t(n).getChildren().findIndex((e) => e.is(n));
243
+ function Yn(n) {
244
+ return yt(n).getChildren().findIndex((e) => e.is(n));
248
245
  }
249
- Ie && "InputEvent" in window && !hn && new window.InputEvent("input");
250
- function Ln(n, e) {
246
+ Ie && "InputEvent" in window && !Sn && new window.InputEvent("input");
247
+ function qn(n, e) {
251
248
  const t = n.getChildren();
252
249
  for (let o = 0; o < t.length; o++) {
253
250
  const r = t[o];
254
- if (z(r)) {
251
+ if (k(r)) {
255
252
  const s = r.getChildren();
256
253
  if (e >= s.length || e < 0) throw new Error("Table column target index out of range");
257
254
  s[e].remove();
@@ -259,93 +256,93 @@ function Ln(n, e) {
259
256
  }
260
257
  return n;
261
258
  }
262
- function V(n, e, t) {
259
+ function U(n, e, t) {
263
260
  const [o, r, s] = Je(n, e, t);
264
- return r === null && b(207), s === null && b(208), [o, r, s];
261
+ return r === null && w(207), s === null && w(208), [o, r, s];
265
262
  }
266
263
  function Je(n, e, t) {
267
264
  const o = [];
268
265
  let r = null, s = null;
269
266
  function l(c) {
270
- let d = o[c];
271
- return d === void 0 && (o[c] = d = []), d;
267
+ let f = o[c];
268
+ return f === void 0 && (o[c] = f = []), f;
272
269
  }
273
270
  const a = n.getChildren();
274
271
  for (let c = 0; c < a.length; c++) {
275
- const d = a[c];
276
- z(d) || b(209);
272
+ const f = a[c];
273
+ k(f) || w(209);
277
274
  const h = l(c);
278
- for (let C = d.getFirstChild(), p = 0; C != null; C = C.getNextSibling()) {
279
- for (S(C) || b(147); h[p] !== void 0; ) p++;
280
- const i = { cell: C, startColumn: p, startRow: c }, { __rowSpan: u, __colSpan: f } = C;
281
- for (let g = 0; g < u && !(c + g >= a.length); g++) {
282
- const m = l(c + g);
283
- for (let _ = 0; _ < f; _++) m[p + _] = i;
275
+ for (let C = f.getFirstChild(), p = 0; C != null; C = C.getNextSibling()) {
276
+ for (S(C) || w(147); h[p] !== void 0; ) p++;
277
+ const i = { cell: C, startColumn: p, startRow: c }, { __rowSpan: u, __colSpan: g } = C;
278
+ for (let d = 0; d < u && !(c + d >= a.length); d++) {
279
+ const m = l(c + d);
280
+ for (let _ = 0; _ < g; _++) m[p + _] = i;
284
281
  }
285
282
  e !== null && r === null && e.is(C) && (r = i), t !== null && s === null && t.is(C) && (s = i);
286
283
  }
287
284
  }
288
285
  return [o, r, s];
289
286
  }
290
- function se(n) {
287
+ function oe(n) {
291
288
  let e;
292
- if (n instanceof ne) e = n;
289
+ if (n instanceof Z) e = n;
293
290
  else if ("__type" in n) {
294
- const r = x(n, S);
295
- S(r) || b(148), e = r;
291
+ const r = N(n, S);
292
+ S(r) || w(148), e = r;
296
293
  } else {
297
- const r = x(n.getNode(), S);
298
- S(r) || b(148), e = r;
294
+ const r = N(n.getNode(), S);
295
+ S(r) || w(148), e = r;
299
296
  }
300
297
  const t = e.getParent();
301
- z(t) || b(149);
298
+ k(t) || w(149);
302
299
  const o = t.getParent();
303
- return $(o) || b(210), [e, t, o];
300
+ return K(o) || w(210), [e, t, o];
304
301
  }
305
302
  function $e(n, e, t) {
306
303
  let o, r = Math.min(e.startColumn, t.startColumn), s = Math.min(e.startRow, t.startRow), l = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), a = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
307
304
  do {
308
305
  o = !1;
309
- for (let c = 0; c < n.length; c++) for (let d = 0; d < n[0].length; d++) {
310
- const h = n[c][d];
306
+ for (let c = 0; c < n.length; c++) for (let f = 0; f < n[0].length; f++) {
307
+ const h = n[c][f];
311
308
  if (!h) continue;
312
309
  const C = h.startColumn + h.cell.__colSpan - 1, p = h.startRow + h.cell.__rowSpan - 1, i = h.startColumn <= l && C >= r, u = h.startRow <= a && p >= s;
313
310
  if (i && u) {
314
- const f = Math.min(r, h.startColumn), g = Math.max(l, C), m = Math.min(s, h.startRow), _ = Math.max(a, p);
315
- f === r && g === l && m === s && _ === a || (r = f, l = g, s = m, a = _, o = !0);
311
+ const g = Math.min(r, h.startColumn), d = Math.max(l, C), m = Math.min(s, h.startRow), _ = Math.max(a, p);
312
+ g === r && d === l && m === s && _ === a || (r = g, l = d, s = m, a = _, o = !0);
316
313
  }
317
314
  }
318
315
  } while (o);
319
316
  return { maxColumn: l, maxRow: a, minColumn: r, minRow: s };
320
317
  }
321
- function tt(n) {
322
- const [e, , t] = se(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
318
+ function lt(n) {
319
+ const [e, , t] = oe(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
323
320
  for (let a = 0; a < r; a++) l[a] = new Array(s);
324
321
  for (let a = 0; a < r; a++) {
325
322
  const c = o[a].getChildren();
326
- let d = 0;
323
+ let f = 0;
327
324
  for (let h = 0; h < c.length; h++) {
328
- for (; l[a][d]; ) d++;
325
+ for (; l[a][f]; ) f++;
329
326
  const C = c[h], p = C.__rowSpan || 1, i = C.__colSpan || 1;
330
- for (let u = 0; u < p; u++) for (let f = 0; f < i; f++) l[a + u][d + f] = C;
331
- if (e === C) return { colSpan: i, columnIndex: d, rowIndex: a, rowSpan: p };
332
- d += i;
327
+ for (let u = 0; u < p; u++) for (let g = 0; g < i; g++) l[a + u][f + g] = C;
328
+ if (e === C) return { colSpan: i, columnIndex: f, rowIndex: a, rowSpan: p };
329
+ f += i;
333
330
  }
334
331
  }
335
332
  return null;
336
333
  }
337
- function nt(n) {
338
- const [[e, t, o, r], [s, l, a, c]] = ["anchor", "focus"].map((d) => {
339
- const h = n[d].getNode(), C = x(h, S);
340
- S(C) || b(238, d, h.getKey(), h.getType());
334
+ function st(n) {
335
+ const [[e, t, o, r], [s, l, a, c]] = ["anchor", "focus"].map((f) => {
336
+ const h = n[f].getNode(), C = N(h, S);
337
+ S(C) || w(238, f, h.getKey(), h.getType());
341
338
  const p = C.getParent();
342
- z(p) || b(239, d);
339
+ k(p) || w(239, f);
343
340
  const i = p.getParent();
344
- return $(i) || b(240, d), [h, C, p, i];
341
+ return K(i) || w(240, f), [h, C, p, i];
345
342
  });
346
- return r.is(c) || b(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: a, focusTable: c };
343
+ return r.is(c) || w(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: a, focusTable: c };
347
344
  }
348
- class Re {
345
+ class Te {
349
346
  constructor(e, t, o) {
350
347
  this.anchor = t, this.focus = o, t._selection = this, o._selection = this, this._cachedNodes = null, this.dirty = !1, this.tableKey = e;
351
348
  }
@@ -365,13 +362,13 @@ class Re {
365
362
  this._cachedNodes = e;
366
363
  }
367
364
  is(e) {
368
- return E(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
365
+ return v(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
369
366
  }
370
367
  set(e, t, o) {
371
368
  this.dirty = this.dirty || e !== this.tableKey || t !== this.anchor.key || o !== this.focus.key, this.tableKey = e, this.anchor.key = t, this.focus.key = o, this._cachedNodes = null;
372
369
  }
373
370
  clone() {
374
- return new Re(this.tableKey, Te(this.anchor.key, this.anchor.offset, this.anchor.type), Te(this.focus.key, this.focus.offset, this.focus.type));
371
+ return new Te(this.tableKey, Ne(this.anchor.key, this.anchor.offset, this.anchor.type), Ne(this.focus.key, this.focus.offset, this.focus.type));
375
372
  }
376
373
  isCollapsed() {
377
374
  return !1;
@@ -387,20 +384,20 @@ class Re {
387
384
  let t = 0;
388
385
  this.getNodes().filter(S).forEach((r) => {
389
386
  const s = r.getFirstChild();
390
- pt(s) && (t |= s.getTextFormat());
387
+ bt(s) && (t |= s.getTextFormat());
391
388
  });
392
- const o = rn[e];
389
+ const o = gn[e];
393
390
  return !!(t & o);
394
391
  }
395
392
  insertNodes(e) {
396
393
  const t = this.focus.getNode();
397
- P(t) || b(151), nn(t.select(0, t.getChildrenSize())).insertNodes(e);
394
+ P(t) || w(151), dn(t.select(0, t.getChildrenSize())).insertNodes(e);
398
395
  }
399
396
  getShape() {
400
- const { anchorCell: e, focusCell: t } = nt(this), o = tt(e);
401
- o === null && b(153);
402
- const r = tt(t);
403
- r === null && b(155);
397
+ const { anchorCell: e, focusCell: t } = st(this), o = lt(e);
398
+ o === null && w(153);
399
+ const r = lt(t);
400
+ r === null && w(155);
404
401
  const s = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), a = Math.min(o.rowIndex, r.rowIndex), c = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
405
402
  return { fromX: Math.min(s, l), fromY: Math.min(a, c), toX: Math.max(s, l), toY: Math.max(a, c) };
406
403
  }
@@ -408,27 +405,27 @@ class Re {
408
405
  if (!this.isValid()) return [];
409
406
  const e = this._cachedNodes;
410
407
  if (e !== null) return e;
411
- const { anchorTable: t, anchorCell: o, focusCell: r } = nt(this), s = r.getParents()[1];
408
+ const { anchorTable: t, anchorCell: o, focusCell: r } = st(this), s = r.getParents()[1];
412
409
  if (s !== t) {
413
410
  if (t.isParentOf(r)) {
414
- const g = s.getParent();
415
- g == null && b(159), this.set(this.tableKey, r.getKey(), g.getKey());
411
+ const d = s.getParent();
412
+ d == null && w(159), this.set(this.tableKey, r.getKey(), d.getKey());
416
413
  } else {
417
- const g = t.getParent();
418
- g == null && b(158), this.set(this.tableKey, g.getKey(), r.getKey());
414
+ const d = t.getParent();
415
+ d == null && w(158), this.set(this.tableKey, d.getKey(), r.getKey());
419
416
  }
420
417
  return this.getNodes();
421
418
  }
422
- const [l, a, c] = V(t, o, r), { minColumn: d, maxColumn: h, minRow: C, maxRow: p } = $e(l, a, c), i = /* @__PURE__ */ new Map([[t.getKey(), t]]);
419
+ const [l, a, c] = U(t, o, r), { minColumn: f, maxColumn: h, minRow: C, maxRow: p } = $e(l, a, c), i = /* @__PURE__ */ new Map([[t.getKey(), t]]);
423
420
  let u = null;
424
- for (let g = C; g <= p; g++) for (let m = d; m <= h; m++) {
425
- const { cell: _ } = l[g][m], w = _.getParent();
426
- z(w) || b(160), w !== u && (i.set(w.getKey(), w), u = w), i.has(_.getKey()) || Cn(_, (y) => {
421
+ for (let d = C; d <= p; d++) for (let m = f; m <= h; m++) {
422
+ const { cell: _ } = l[d][m], b = _.getParent();
423
+ k(b) || w(160), b !== u && (i.set(b.getKey(), b), u = b), i.has(_.getKey()) || xn(_, (y) => {
427
424
  i.set(y.getKey(), y);
428
425
  });
429
426
  }
430
- const f = Array.from(i.values());
431
- return on() || (this._cachedNodes = f), f;
427
+ const g = Array.from(i.values());
428
+ return fn() || (this._cachedNodes = g), g;
432
429
  }
433
430
  getTextContent() {
434
431
  const e = this.getNodes().filter((o) => S(o));
@@ -441,32 +438,32 @@ class Re {
441
438
  return t;
442
439
  }
443
440
  }
444
- function E(n) {
445
- return n instanceof Re;
441
+ function v(n) {
442
+ return n instanceof Te;
446
443
  }
447
- function St() {
448
- const n = Te("root", 0, "element"), e = Te("root", 0, "element");
449
- return new Re("root", n, e);
444
+ function Nt() {
445
+ const n = Ne("root", 0, "element"), e = Ne("root", 0, "element");
446
+ return new Te("root", n, e);
450
447
  }
451
- function mn(n, e, t) {
448
+ function Nn(n, e, t) {
452
449
  n.getKey(), e.getKey(), t.getKey();
453
- const o = D(), r = E(o) ? o.clone() : St();
450
+ const o = L(), r = v(o) ? o.clone() : Nt();
454
451
  return r.set(n.getKey(), e.getKey(), t.getKey()), r;
455
452
  }
456
- function Cn(n, e) {
453
+ function xn(n, e) {
457
454
  const t = [[n]];
458
455
  for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
459
456
  const r = o.pop();
460
457
  r === void 0 ? t.pop() : e(r) !== !1 && P(r) && t.push(r.getChildren());
461
458
  }
462
459
  }
463
- function wt(n, e = ft()) {
464
- const t = xe(n);
465
- $(t) || b(231, n);
466
- const o = ee(t, e.getElementByKey(n));
467
- return o === null && b(232, n), { tableElement: o, tableNode: t };
460
+ function xt(n, e = pt()) {
461
+ const t = ye(n);
462
+ K(t) || w(231, n);
463
+ const o = Q(t, e.getElementByKey(n));
464
+ return o === null && w(232, n), { tableElement: o, tableNode: t };
468
465
  }
469
- class pn {
466
+ class Tn {
470
467
  constructor(e, t) {
471
468
  this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.listenersToRemove = /* @__PURE__ */ new Set(), this.tableNodeKey = t, this.editor = e, this.table = { columns: 0, domRows: [], rows: 0 }, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.isSelecting = !1, this.shouldCheckSelection = !1, this.abortController = new AbortController(), this.listenerOptions = { signal: this.abortController.signal }, this.nextFocus = null, this.trackTable();
472
469
  }
@@ -477,7 +474,7 @@ class pn {
477
474
  this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach((e) => e()), this.listenersToRemove.clear();
478
475
  }
479
476
  $lookup() {
480
- return wt(this.tableNodeKey, this.editor);
477
+ return xt(this.tableNodeKey, this.editor);
481
478
  }
482
479
  trackTable() {
483
480
  const e = new MutationObserver((t) => {
@@ -492,33 +489,33 @@ class pn {
492
489
  }
493
490
  if (!o) return;
494
491
  const { tableNode: r, tableElement: s } = this.$lookup();
495
- this.table = he(r, s);
492
+ this.table = le(r, s);
496
493
  }, { editor: this.editor });
497
494
  });
498
495
  this.editor.getEditorState().read(() => {
499
496
  const { tableNode: t, tableElement: o } = this.$lookup();
500
- this.table = he(t, o), e.observe(o, { attributes: !0, childList: !0, subtree: !0 });
497
+ this.table = le(t, o), e.observe(o, { attributes: !0, childList: !0, subtree: !0 });
501
498
  }, { editor: this.editor });
502
499
  }
503
500
  $clearHighlight() {
504
501
  const e = this.editor;
505
502
  this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.$enableHighlightStyle();
506
503
  const { tableNode: t, tableElement: o } = this.$lookup();
507
- Se(e, he(t, o), null), D() !== null && (Z(null), e.dispatchCommand(le, void 0));
504
+ pe(e, le(t, o), null), L() !== null && (q(null), e.dispatchCommand(ne, void 0));
508
505
  }
509
506
  $enableHighlightStyle() {
510
507
  const e = this.editor, { tableElement: t } = this.$lookup();
511
- ae(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
508
+ ie(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
512
509
  }
513
510
  $disableHighlightStyle() {
514
511
  const { tableElement: e } = this.$lookup();
515
- U(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
512
+ X(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
516
513
  }
517
514
  $updateTableTableSelection(e) {
518
515
  if (e !== null) {
519
- e.tableKey !== this.tableNodeKey && b(233, e.tableKey, this.tableNodeKey);
516
+ e.tableKey !== this.tableNodeKey && w(233, e.tableKey, this.tableNodeKey);
520
517
  const t = this.editor;
521
- this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Se(t, this.table, this.tableSelection);
518
+ this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), pe(t, this.table, this.tableSelection);
522
519
  } else this.$clearHighlight();
523
520
  }
524
521
  setShouldCheckSelection() {
@@ -536,7 +533,7 @@ class pn {
536
533
  }
537
534
  updateDOMSelection() {
538
535
  if (this.anchorCell !== null && this.focusCell !== null) {
539
- const e = ve(this.editor._window);
536
+ const e = xe(this.editor._window);
540
537
  e && e.rangeCount > 0 && e.removeAllRanges();
541
538
  }
542
539
  }
@@ -547,70 +544,70 @@ class pn {
547
544
  } else this.isHighlightingCells = !0, this.$disableHighlightStyle();
548
545
  if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
549
546
  const a = ze(r, e.elem);
550
- if (this.tableSelection != null && this.anchorCellNodeKey != null && a !== null) return this.focusCellNodeKey = a.getKey(), this.tableSelection = mn(r, this.$getAnchorTableCellOrThrow(), a), Z(this.tableSelection), o.dispatchCommand(le, void 0), Se(o, this.table, this.tableSelection), !0;
547
+ if (this.tableSelection != null && this.anchorCellNodeKey != null && a !== null) return this.focusCellNodeKey = a.getKey(), this.tableSelection = Nn(r, this.$getAnchorTableCellOrThrow(), a), q(this.tableSelection), o.dispatchCommand(ne, void 0), pe(o, this.table, this.tableSelection), !0;
551
548
  }
552
549
  return !1;
553
550
  }
554
551
  $getAnchorTableCell() {
555
- return this.anchorCellNodeKey ? xe(this.anchorCellNodeKey) : null;
552
+ return this.anchorCellNodeKey ? ye(this.anchorCellNodeKey) : null;
556
553
  }
557
554
  $getAnchorTableCellOrThrow() {
558
555
  const e = this.$getAnchorTableCell();
559
- return e === null && b(234), e;
556
+ return e === null && w(234), e;
560
557
  }
561
558
  $getFocusTableCell() {
562
- return this.focusCellNodeKey ? xe(this.focusCellNodeKey) : null;
559
+ return this.focusCellNodeKey ? ye(this.focusCellNodeKey) : null;
563
560
  }
564
561
  $getFocusTableCellOrThrow() {
565
562
  const e = this.$getFocusTableCell();
566
- return e === null && b(235), e;
563
+ return e === null && w(235), e;
567
564
  }
568
565
  $setAnchorCellForSelection(e) {
569
566
  this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
570
567
  const { tableNode: t } = this.$lookup(), o = ze(t, e.elem);
571
568
  if (o !== null) {
572
569
  const r = o.getKey();
573
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : St(), this.anchorCellNodeKey = r;
570
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Nt(), this.anchorCellNodeKey = r;
574
571
  }
575
572
  }
576
573
  $formatCells(e) {
577
- const t = D();
578
- E(t) || b(236);
579
- const o = Gt(), r = o.anchor, s = o.focus, l = t.getNodes().filter(S);
580
- l.length > 0 || b(237);
581
- const a = l[0].getFirstChild(), c = pt(a) ? a.getFormatFlags(e, null) : null;
582
- l.forEach((d) => {
583
- r.set(d.getKey(), 0, "element"), s.set(d.getKey(), d.getChildrenSize(), "element"), o.formatText(e, c);
584
- }), Z(t), this.editor.dispatchCommand(le, void 0);
574
+ const t = L();
575
+ v(t) || w(236);
576
+ const o = on(), r = o.anchor, s = o.focus, l = t.getNodes().filter(S);
577
+ l.length > 0 || w(237);
578
+ const a = l[0].getFirstChild(), c = bt(a) ? a.getFormatFlags(e, null) : null;
579
+ l.forEach((f) => {
580
+ r.set(f.getKey(), 0, "element"), s.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(e, c);
581
+ }), q(t), this.editor.dispatchCommand(ne, void 0);
585
582
  }
586
583
  $clearText() {
587
- const { editor: e } = this, t = xe(this.tableNodeKey);
588
- if (!$(t)) throw new Error("Expected TableNode.");
589
- const o = D();
590
- E(o) || b(253);
584
+ const { editor: e } = this, t = ye(this.tableNodeKey);
585
+ if (!K(t)) throw new Error("Expected TableNode.");
586
+ const o = L();
587
+ v(o) || w(253);
591
588
  const r = o.getNodes().filter(S);
592
589
  if (r.length === this.table.columns * this.table.rows) {
593
590
  t.selectPrevious();
594
591
  const s = t.getParent();
595
- return t.remove(), void (Qt(s) && s.isEmpty() && e.dispatchCommand(Ct, void 0));
592
+ return t.remove(), void (rn(s) && s.isEmpty() && e.dispatchCommand(wt, void 0));
596
593
  }
597
594
  r.forEach((s) => {
598
595
  if (P(s)) {
599
- const l = G(), a = De();
596
+ const l = j(), a = He();
600
597
  l.append(a), s.append(l), s.getChildren().forEach((c) => {
601
598
  c !== l && c.remove();
602
599
  });
603
600
  }
604
- }), Se(e, this.table, null), Z(null), e.dispatchCommand(le, void 0);
601
+ }), pe(e, this.table, null), q(null), e.dispatchCommand(ne, void 0);
605
602
  }
606
603
  }
607
- const Me = "__lexicalTableSelection", _n = (n) => !(1 & ~n.buttons);
608
- function ee(n, e) {
604
+ const Me = "__lexicalTableSelection", Fn = (n) => !(1 & ~n.buttons);
605
+ function Q(n, e) {
609
606
  if (!e) return e;
610
607
  const t = e.nodeName === "TABLE" ? e : n.getDOMSlot(e).element;
611
- return t.nodeName !== "TABLE" && b(245, e.nodeName), t;
608
+ return t.nodeName !== "TABLE" && w(245, e.nodeName), t;
612
609
  }
613
- function qe(n) {
610
+ function Xe(n) {
614
611
  return n._window;
615
612
  }
616
613
  function ue(n, e) {
@@ -620,251 +617,251 @@ function ue(n, e) {
620
617
  }
621
618
  return null;
622
619
  }
623
- const Sn = [[zt, "down"], [Lt, "up"], [Pt, "backward"], [Ht, "forward"]], wn = [Wt, mt, Bt], bn = [It, Jt];
624
- function yn(n, e, t, o) {
625
- const r = t.getRootElement(), s = qe(t);
626
- r !== null && s !== null || b(246);
627
- const l = new pn(t, n.getKey()), a = ee(n, e);
620
+ const vn = [[Wt, "down"], [Dt, "up"], [It, "backward"], [Jt, "forward"]], Rn = [Yt, St, qt], Kn = [Ut, jt];
621
+ function An(n, e, t, o) {
622
+ const r = t.getRootElement(), s = Xe(t);
623
+ r !== null && s !== null || w(246);
624
+ const l = new Tn(t, n.getKey()), a = Q(n, e);
628
625
  (function(i, u) {
629
- ot(i) !== null && b(205), i[Me] = u;
626
+ it(i) !== null && w(205), i[Me] = u;
630
627
  })(a, l), l.listenersToRemove.add(() => function(i, u) {
631
- ot(i) === u && delete i[Me];
628
+ it(i) === u && delete i[Me];
632
629
  }(a, l));
633
630
  const c = (i) => {
634
631
  if (i.button !== 0 || !ce(i.target) || !s) return;
635
- const u = _e(i.target);
632
+ const u = re(i.target);
636
633
  u !== null && t.update(() => {
637
- const f = Qe();
638
- if (dn && i.shiftKey && Y(f, n) && (L(f) || E(f))) {
639
- const g = f.anchor.getNode(), m = ue(n, f.anchor.getNode());
640
- m ? (l.$setAnchorCellForSelection(de(l, m)), l.$setFocusCellForSelection(u), j(i)) : (n.isBefore(g) ? n.selectStart() : n.selectEnd()).anchor.set(f.anchor.key, f.anchor.offset, f.anchor.type);
634
+ const g = Ze();
635
+ if (wn && i.shiftKey && J(g, n) && (z(g) || v(g))) {
636
+ const d = g.anchor.getNode(), m = ue(n, g.anchor.getNode());
637
+ m ? (l.$setAnchorCellForSelection(he(l, m)), l.$setFocusCellForSelection(u), Y(i)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(g.anchor.key, g.anchor.offset, g.anchor.type);
641
638
  } else l.$setAnchorCellForSelection(u);
642
639
  }), (() => {
643
640
  if (l.isSelecting) return;
644
- const f = () => {
645
- l.isSelecting = !1, s.removeEventListener("mouseup", f), s.removeEventListener("mousemove", g);
646
- }, g = (m) => {
641
+ const g = () => {
642
+ l.isSelecting = !1, s.removeEventListener("mouseup", g), s.removeEventListener("mousemove", d);
643
+ }, d = (m) => {
647
644
  if (!ce(m.target)) return;
648
- if (!_n(m) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("mouseup", f), void s.removeEventListener("mousemove", g);
645
+ if (!Fn(m) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("mouseup", g), void s.removeEventListener("mousemove", d);
649
646
  const _ = !a.contains(m.target);
650
- let w = null;
647
+ let b = null;
651
648
  if (_) {
652
- for (const y of document.elementsFromPoint(m.clientX, m.clientY)) if (w = a.contains(y) ? _e(y) : null, w) break;
653
- } else w = _e(m.target);
654
- !w || l.focusCell !== null && w.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: w, override: _ }), t.dispatchCommand(le, void 0));
649
+ for (const y of document.elementsFromPoint(m.clientX, m.clientY)) if (b = a.contains(y) ? re(y) : null, b) break;
650
+ } else b = re(m.target);
651
+ !b || l.focusCell !== null && b.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: b, override: _ }), t.dispatchCommand(ne, void 0));
655
652
  };
656
- l.isSelecting = !0, s.addEventListener("mouseup", f, l.listenerOptions), s.addEventListener("mousemove", g, l.listenerOptions);
653
+ l.isSelecting = !0, s.addEventListener("mouseup", g, l.listenerOptions), s.addEventListener("mousemove", d, l.listenerOptions);
657
654
  })();
658
655
  };
659
656
  a.addEventListener("mousedown", c, l.listenerOptions), l.listenersToRemove.add(() => {
660
657
  a.removeEventListener("mousedown", c);
661
658
  });
662
- const d = (i) => {
663
- i.detail >= 3 && ce(i.target) && _e(i.target) !== null && i.preventDefault();
659
+ const f = (i) => {
660
+ i.detail >= 3 && ce(i.target) && re(i.target) !== null && i.preventDefault();
664
661
  };
665
- a.addEventListener("mousedown", d, l.listenerOptions), l.listenersToRemove.add(() => {
666
- a.removeEventListener("mousedown", d);
662
+ a.addEventListener("mousedown", f, l.listenerOptions), l.listenersToRemove.add(() => {
663
+ a.removeEventListener("mousedown", f);
667
664
  });
668
665
  const h = (i) => {
669
666
  const u = i.target;
670
667
  i.button === 0 && ce(u) && t.update(() => {
671
- const f = D();
672
- E(f) && f.tableKey === l.tableNodeKey && r.contains(u) && l.$clearHighlight();
668
+ const g = L();
669
+ v(g) && g.tableKey === l.tableNodeKey && r.contains(u) && l.$clearHighlight();
673
670
  });
674
671
  };
675
672
  s.addEventListener("mousedown", h, l.listenerOptions), l.listenersToRemove.add(() => {
676
673
  s.removeEventListener("mousedown", h);
677
674
  });
678
- for (const [i, u] of Sn) l.listenersToRemove.add(t.registerCommand(i, (f) => Nt(t, f, u, n, l), ke));
679
- l.listenersToRemove.add(t.registerCommand(Dt, (i) => {
680
- const u = D();
681
- if (E(u)) {
682
- const f = ue(n, u.focus.getNode());
683
- if (f !== null) return j(i), f.selectEnd(), !0;
675
+ for (const [i, u] of vn) l.listenersToRemove.add(t.registerCommand(i, (g) => vt(t, g, u, n, l), Ae));
676
+ l.listenersToRemove.add(t.registerCommand(Xt, (i) => {
677
+ const u = L();
678
+ if (v(u)) {
679
+ const g = ue(n, u.focus.getNode());
680
+ if (g !== null) return Y(i), g.selectEnd(), !0;
684
681
  }
685
682
  return !1;
686
- }, ke));
683
+ }, Ae));
687
684
  const C = (i) => () => {
688
- const u = D();
689
- if (!Y(u, n)) return !1;
690
- if (E(u)) return l.$clearText(), !0;
691
- if (L(u)) {
685
+ const u = L();
686
+ if (!J(u, n)) return !1;
687
+ if (v(u)) return l.$clearText(), !0;
688
+ if (z(u)) {
692
689
  if (!S(ue(n, u.anchor.getNode()))) return !1;
693
- const f = u.anchor.getNode(), g = u.focus.getNode(), m = n.isParentOf(f), _ = n.isParentOf(g);
690
+ const g = u.anchor.getNode(), d = u.focus.getNode(), m = n.isParentOf(g), _ = n.isParentOf(d);
694
691
  if (m && !_ || _ && !m) return l.$clearText(), !0;
695
- const w = x(u.anchor.getNode(), (R) => P(R)), y = w && x(w, (R) => P(R) && S(R.getParent()));
696
- if (!P(y) || !P(w)) return !1;
697
- if (i === mt && y.getPreviousSibling() === null) return !0;
692
+ const b = N(u.anchor.getNode(), (F) => P(F)), y = b && N(b, (F) => P(F) && S(F.getParent()));
693
+ if (!P(y) || !P(b)) return !1;
694
+ if (i === St && y.getPreviousSibling() === null) return !0;
698
695
  }
699
696
  return !1;
700
697
  };
701
- for (const i of wn) l.listenersToRemove.add(t.registerCommand(i, C(i), X));
698
+ for (const i of Rn) l.listenersToRemove.add(t.registerCommand(i, C(i), I));
702
699
  const p = (i) => {
703
- const u = D();
704
- if (!E(u) && !L(u)) return !1;
705
- const f = n.isParentOf(u.anchor.getNode());
706
- if (f !== n.isParentOf(u.focus.getNode())) {
707
- const g = f ? "anchor" : "focus", m = f ? "focus" : "anchor", { key: _, offset: w, type: y } = u[m];
708
- return n[u[g].isBefore(u[m]) ? "selectPrevious" : "selectNext"]()[m].set(_, w, y), !1;
700
+ const u = L();
701
+ if (!v(u) && !z(u)) return !1;
702
+ const g = n.isParentOf(u.anchor.getNode());
703
+ if (g !== n.isParentOf(u.focus.getNode())) {
704
+ const d = g ? "anchor" : "focus", m = g ? "focus" : "anchor", { key: _, offset: b, type: y } = u[m];
705
+ return n[u[d].isBefore(u[m]) ? "selectPrevious" : "selectNext"]()[m].set(_, b, y), !1;
709
706
  }
710
- return !!Y(u, n) && !!E(u) && (i && (i.preventDefault(), i.stopPropagation()), l.$clearText(), !0);
707
+ return !!J(u, n) && !!v(u) && (i && (i.preventDefault(), i.stopPropagation()), l.$clearText(), !0);
711
708
  };
712
- for (const i of bn) l.listenersToRemove.add(t.registerCommand(i, p, X));
713
- return l.listenersToRemove.add(t.registerCommand(qt, (i) => {
714
- const u = D();
709
+ for (const i of Kn) l.listenersToRemove.add(t.registerCommand(i, p, I));
710
+ return l.listenersToRemove.add(t.registerCommand(Vt, (i) => {
711
+ const u = L();
715
712
  if (u) {
716
- if (!E(u) && !L(u)) return !1;
717
- ln(t, Kt(i, ClipboardEvent) ? i : null, sn(u));
718
- const f = p(i);
719
- return L(u) ? (u.removeText(), !0) : f;
713
+ if (!v(u) && !z(u)) return !1;
714
+ mn(t, zt(i, ClipboardEvent) ? i : null, Cn(u));
715
+ const g = p(i);
716
+ return z(u) ? (u.removeText(), !0) : g;
720
717
  }
721
718
  return !1;
722
- }, X)), l.listenersToRemove.add(t.registerCommand(Xt, (i) => {
723
- const u = D();
724
- if (!Y(u, n)) return !1;
725
- if (E(u)) return l.$formatCells(i), !0;
726
- if (L(u)) {
727
- const f = x(u.anchor.getNode(), (g) => S(g));
728
- if (!S(f)) return !1;
719
+ }, I)), l.listenersToRemove.add(t.registerCommand(Qt, (i) => {
720
+ const u = L();
721
+ if (!J(u, n)) return !1;
722
+ if (v(u)) return l.$formatCells(i), !0;
723
+ if (z(u)) {
724
+ const g = N(u.anchor.getNode(), (d) => S(d));
725
+ if (!S(g)) return !1;
729
726
  }
730
727
  return !1;
731
- }, X)), l.listenersToRemove.add(t.registerCommand(Yt, (i) => {
732
- const u = D();
733
- if (!E(u) || !Y(u, n)) return !1;
734
- const f = u.anchor.getNode(), g = u.focus.getNode();
735
- if (!S(f) || !S(g)) return !1;
736
- if (function(N, O) {
737
- if (E(N)) {
738
- const k = N.anchor.getNode(), T = N.focus.getNode();
739
- if (O && k && T) {
740
- const [v] = V(O, k, T);
741
- return k.getKey() === v[0][0].cell.getKey() && T.getKey() === v[v.length - 1].at(-1).cell.getKey();
728
+ }, I)), l.listenersToRemove.add(t.registerCommand(Gt, (i) => {
729
+ const u = L();
730
+ if (!v(u) || !J(u, n)) return !1;
731
+ const g = u.anchor.getNode(), d = u.focus.getNode();
732
+ if (!S(g) || !S(d)) return !1;
733
+ if (function(x, O) {
734
+ if (v(x)) {
735
+ const A = x.anchor.getNode(), R = x.focus.getNode();
736
+ if (O && A && R) {
737
+ const [M] = U(O, A, R);
738
+ return A.getKey() === M[0][0].cell.getKey() && R.getKey() === M[M.length - 1].at(-1).cell.getKey();
742
739
  }
743
740
  }
744
741
  return !1;
745
742
  }(u, n)) return n.setFormat(i), !0;
746
- const [m, _, w] = V(n, f, g), y = Math.max(_.startRow + _.cell.__rowSpan - 1, w.startRow + w.cell.__rowSpan - 1), R = Math.max(_.startColumn + _.cell.__colSpan - 1, w.startColumn + w.cell.__colSpan - 1), F = Math.min(_.startRow, w.startRow), A = Math.min(_.startColumn, w.startColumn), K = /* @__PURE__ */ new Set();
747
- for (let N = F; N <= y; N++) for (let O = A; O <= R; O++) {
748
- const k = m[N][O].cell;
749
- if (K.has(k)) continue;
750
- K.add(k), k.setFormat(i);
751
- const T = k.getChildren();
752
- for (let v = 0; v < T.length; v++) {
753
- const M = T[v];
754
- P(M) && !M.isInline() && M.setFormat(i);
743
+ const [m, _, b] = U(n, g, d), y = Math.max(_.startRow + _.cell.__rowSpan - 1, b.startRow + b.cell.__rowSpan - 1), F = Math.max(_.startColumn + _.cell.__colSpan - 1, b.startColumn + b.cell.__colSpan - 1), T = Math.min(_.startRow, b.startRow), $ = Math.min(_.startColumn, b.startColumn), E = /* @__PURE__ */ new Set();
744
+ for (let x = T; x <= y; x++) for (let O = $; O <= F; O++) {
745
+ const A = m[x][O].cell;
746
+ if (E.has(A)) continue;
747
+ E.add(A), A.setFormat(i);
748
+ const R = A.getChildren();
749
+ for (let M = 0; M < R.length; M++) {
750
+ const B = R[M];
751
+ P(B) && !B.isInline() && B.setFormat(i);
755
752
  }
756
753
  }
757
754
  return !0;
758
- }, X)), l.listenersToRemove.add(t.registerCommand(Ut, (i) => {
759
- const u = D();
760
- if (!Y(u, n)) return !1;
761
- if (E(u)) return l.$clearHighlight(), !1;
762
- if (L(u)) {
763
- const f = x(u.anchor.getNode(), (g) => S(g));
764
- if (!S(f)) return !1;
755
+ }, I)), l.listenersToRemove.add(t.registerCommand(Zt, (i) => {
756
+ const u = L();
757
+ if (!J(u, n)) return !1;
758
+ if (v(u)) return l.$clearHighlight(), !1;
759
+ if (z(u)) {
760
+ const g = N(u.anchor.getNode(), (d) => S(d));
761
+ if (!S(g)) return !1;
765
762
  if (typeof i == "string") {
766
- const g = st(t, u, n);
767
- if (g) return lt(g, n, [De(i)]), !0;
763
+ const d = ut(t, u, n);
764
+ if (d) return ct(d, n, [He(i)]), !0;
768
765
  }
769
766
  }
770
767
  return !1;
771
- }, X)), o && l.listenersToRemove.add(t.registerCommand(jt, (i) => {
772
- const u = D();
773
- if (!L(u) || !u.isCollapsed() || !Y(u, n)) return !1;
774
- const f = ye(u.anchor.getNode());
775
- return !(f === null || !n.is(ie(f))) && (j(i), function(g, m) {
776
- const _ = m === "next" ? "getNextSibling" : "getPreviousSibling", w = m === "next" ? "getFirstChild" : "getLastChild", y = g[_]();
768
+ }, I)), o && l.listenersToRemove.add(t.registerCommand(en, (i) => {
769
+ const u = L();
770
+ if (!z(u) || !u.isCollapsed() || !J(u, n)) return !1;
771
+ const g = we(u.anchor.getNode());
772
+ return !(g === null || !n.is(se(g))) && (Y(i), function(d, m) {
773
+ const _ = m === "next" ? "getNextSibling" : "getPreviousSibling", b = m === "next" ? "getFirstChild" : "getLastChild", y = d[_]();
777
774
  if (P(y)) return y.selectEnd();
778
- const R = x(g, z);
779
- R === null && b(247);
780
- for (let A = R[_](); z(A); A = A[_]()) {
781
- const K = A[w]();
782
- if (P(K)) return K.selectEnd();
775
+ const F = N(d, k);
776
+ F === null && w(247);
777
+ for (let $ = F[_](); k($); $ = $[_]()) {
778
+ const E = $[b]();
779
+ if (P(E)) return E.selectEnd();
783
780
  }
784
- const F = x(R, $);
785
- F === null && b(248), m === "next" ? F.selectNext() : F.selectPrevious();
786
- }(f, i.shiftKey ? "previous" : "next"), !0);
787
- }, X)), l.listenersToRemove.add(t.registerCommand(Vt, (i) => n.isSelected(), ke)), l.listenersToRemove.add(t.registerCommand(gt, (i) => {
788
- const { nodes: u, selection: f } = i, g = f.getStartEndPoints(), m = E(f), _ = L(f) && x(f.anchor.getNode(), (B) => S(B)) !== null && x(f.focus.getNode(), (B) => S(B)) !== null || m;
789
- if (u.length !== 1 || !$(u[0]) || !_ || g === null) return !1;
790
- const [w] = g, y = u[0], R = y.getChildren(), F = y.getFirstChildOrThrow().getChildrenSize(), A = y.getChildrenSize(), K = x(w.getNode(), (B) => S(B)), N = K && x(K, (B) => z(B)), O = N && x(N, (B) => $(B));
791
- if (!S(K) || !z(N) || !$(O)) return !1;
792
- const k = N.getIndexWithinParent(), T = Math.min(O.getChildrenSize() - 1, k + A - 1), v = K.getIndexWithinParent(), M = Math.min(N.getChildrenSize() - 1, v + F - 1), W = Math.min(v, M), J = Math.min(k, T), q = Math.max(v, M), H = Math.max(k, T), Ce = O.getChildren();
781
+ const T = N(F, K);
782
+ T === null && w(248), m === "next" ? T.selectNext() : T.selectPrevious();
783
+ }(g, i.shiftKey ? "previous" : "next"), !0);
784
+ }, I)), l.listenersToRemove.add(t.registerCommand(tn, (i) => n.isSelected(), Ae)), l.listenersToRemove.add(t.registerCommand(_t, (i) => {
785
+ const { nodes: u, selection: g } = i, d = g.getStartEndPoints(), m = v(g), _ = z(g) && N(g.anchor.getNode(), (H) => S(H)) !== null && N(g.focus.getNode(), (H) => S(H)) !== null || m;
786
+ if (u.length !== 1 || !K(u[0]) || !_ || d === null) return !1;
787
+ const [b] = d, y = u[0], F = y.getChildren(), T = y.getFirstChildOrThrow().getChildrenSize(), $ = y.getChildrenSize(), E = N(b.getNode(), (H) => S(H)), x = E && N(E, (H) => k(H)), O = x && N(x, (H) => K(H));
788
+ if (!S(E) || !k(x) || !K(O)) return !1;
789
+ const A = x.getIndexWithinParent(), R = Math.min(O.getChildrenSize() - 1, A + $ - 1), M = E.getIndexWithinParent(), B = Math.min(x.getChildrenSize() - 1, M + T - 1), ae = Math.min(M, B), Fe = Math.min(A, R), ve = Math.max(M, B), W = Math.max(A, R), Kt = O.getChildren();
793
790
  let Ue = 0;
794
- for (let B = J; B <= H; B++) {
795
- const je = Ce[B];
796
- if (!z(je)) return !1;
797
- const Ve = R[Ue];
798
- if (!z(Ve)) return !1;
799
- const Tt = je.getChildren(), vt = Ve.getChildren();
800
- let Ze = 0;
801
- for (let Fe = W; Fe <= q; Fe++) {
802
- const pe = Tt[Fe];
803
- if (!S(pe)) return !1;
804
- const Ge = vt[Ze];
791
+ for (let H = Fe; H <= W; H++) {
792
+ const je = Kt[H];
793
+ if (!k(je)) return !1;
794
+ const Ve = F[Ue];
795
+ if (!k(Ve)) return !1;
796
+ const At = je.getChildren(), Ot = Ve.getChildren();
797
+ let Qe = 0;
798
+ for (let Re = ae; Re <= ve; Re++) {
799
+ const me = At[Re];
800
+ if (!S(me)) return !1;
801
+ const Ge = Ot[Qe];
805
802
  if (!S(Ge)) return !1;
806
- const Rt = pe.getChildren();
807
- Ge.getChildren().forEach((oe) => {
808
- fe(oe) && G().append(oe), pe.append(oe);
809
- }), Rt.forEach((oe) => oe.remove()), Ze++;
803
+ const Et = me.getChildren();
804
+ Ge.getChildren().forEach((ee) => {
805
+ de(ee) && j().append(ee), me.append(ee);
806
+ }), Et.forEach((ee) => ee.remove()), Qe++;
810
807
  }
811
808
  Ue++;
812
809
  }
813
810
  return !0;
814
- }, X)), l.listenersToRemove.add(t.registerCommand(le, () => {
815
- const i = D(), u = Qe(), f = l.getAndClearNextFocus();
816
- if (f !== null) {
817
- const { focusCell: g } = f;
818
- if (E(i) && i.tableKey === l.tableNodeKey) return (g.x !== l.focusX || g.y !== l.focusY) && (l.$setFocusCellForSelection(g), !0);
819
- if (g !== l.anchorCell && Y(i, n)) return l.$setFocusCellForSelection(g), !0;
811
+ }, I)), l.listenersToRemove.add(t.registerCommand(ne, () => {
812
+ const i = L(), u = Ze(), g = l.getAndClearNextFocus();
813
+ if (g !== null) {
814
+ const { focusCell: d } = g;
815
+ if (v(i) && i.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
816
+ if (d !== l.anchorCell && J(i, n)) return l.$setFocusCellForSelection(d), !0;
820
817
  }
821
- if (l.getAndClearShouldCheckSelection() && L(u) && L(i) && i.isCollapsed()) {
822
- const g = i.anchor.getNode(), m = n.getFirstChild(), _ = ye(g);
823
- if (_ !== null && z(m)) {
824
- const w = m.getFirstChild();
825
- if (S(w) && n.is(x(_, (y) => y.is(n) || y.is(w)))) return w.selectStart(), !0;
818
+ if (l.getAndClearShouldCheckSelection() && z(u) && z(i) && i.isCollapsed()) {
819
+ const d = i.anchor.getNode(), m = n.getFirstChild(), _ = we(d);
820
+ if (_ !== null && k(m)) {
821
+ const b = m.getFirstChild();
822
+ if (S(b) && n.is(N(_, (y) => y.is(n) || y.is(b)))) return b.selectStart(), !0;
826
823
  }
827
824
  }
828
- if (L(i)) {
829
- const { anchor: g, focus: m } = i, _ = g.getNode(), w = m.getNode(), y = ye(_), R = ye(w), F = !(!y || !n.is(ie(y))), A = !(!R || !n.is(ie(R))), K = F !== A, N = F && A, O = i.isBackward();
830
- if (K) {
831
- const k = i.clone();
832
- if (A) {
833
- const [T] = V(n, R, R), v = T[0][0].cell, M = T[T.length - 1].at(-1).cell;
834
- k.focus.set(O ? v.getKey() : M.getKey(), O ? v.getChildrenSize() : M.getChildrenSize(), "element");
835
- } else if (F) {
836
- const [T] = V(n, y, y), v = T[0][0].cell, M = T[T.length - 1].at(-1).cell;
837
- k.anchor.set(O ? M.getKey() : v.getKey(), O ? M.getChildrenSize() : 0, "element");
825
+ if (z(i)) {
826
+ const { anchor: d, focus: m } = i, _ = d.getNode(), b = m.getNode(), y = we(_), F = we(b), T = !(!y || !n.is(se(y))), $ = !(!F || !n.is(se(F))), E = T !== $, x = T && $, O = i.isBackward();
827
+ if (E) {
828
+ const A = i.clone();
829
+ if ($) {
830
+ const [R] = U(n, F, F), M = R[0][0].cell, B = R[R.length - 1].at(-1).cell;
831
+ A.focus.set(O ? M.getKey() : B.getKey(), O ? M.getChildrenSize() : B.getChildrenSize(), "element");
832
+ } else if (T) {
833
+ const [R] = U(n, y, y), M = R[0][0].cell, B = R[R.length - 1].at(-1).cell;
834
+ A.anchor.set(O ? B.getKey() : M.getKey(), O ? B.getChildrenSize() : 0, "element");
838
835
  }
839
- Z(k), rt(t, l);
840
- } else N && (y.is(R) || (l.$setAnchorCellForSelection(de(l, y)), l.$setFocusCellForSelection(de(l, R), !0)));
841
- } else if (i && E(i) && i.is(u) && i.tableKey === n.getKey()) {
842
- const g = ve(s);
843
- if (g && g.anchorNode && g.focusNode) {
844
- const m = Q(g.focusNode), _ = m && !n.isParentOf(m), w = Q(g.anchorNode), y = w && n.isParentOf(w);
845
- if (_ && y && g.rangeCount > 0) {
846
- const R = Zt(g, t);
847
- R && (R.anchor.set(n.getKey(), i.isBackward() ? n.getChildrenSize() : 0, "element"), g.removeAllRanges(), Z(R));
836
+ q(A), at(t, l);
837
+ } else x && (y.is(F) || (l.$setAnchorCellForSelection(he(l, y)), l.$setFocusCellForSelection(he(l, F), !0)));
838
+ } else if (i && v(i) && i.is(u) && i.tableKey === n.getKey()) {
839
+ const d = xe(s);
840
+ if (d && d.anchorNode && d.focusNode) {
841
+ const m = V(d.focusNode), _ = m && !n.isParentOf(m), b = V(d.anchorNode), y = b && n.isParentOf(b);
842
+ if (_ && y && d.rangeCount > 0) {
843
+ const F = nn(d, t);
844
+ F && (F.anchor.set(n.getKey(), i.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), q(F));
848
845
  }
849
846
  }
850
847
  }
851
- return i && !i.is(u) && (E(i) || E(u)) && l.tableSelection && !l.tableSelection.is(u) ? (E(i) && i.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(i) : !E(i) && E(u) && u.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(g, m) {
852
- m.$enableHighlightStyle(), Xe(m.table, (_) => {
853
- const w = _.elem;
854
- _.highlighted = !1, yt(g, _), w.getAttribute("style") || w.removeAttribute("style");
848
+ return i && !i.is(u) && (v(i) || v(u)) && l.tableSelection && !l.tableSelection.is(u) ? (v(i) && i.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(i) : !v(i) && v(u) && u.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, m) {
849
+ m.$enableHighlightStyle(), Ye(m.table, (_) => {
850
+ const b = _.elem;
851
+ _.highlighted = !1, Ft(d, _), b.getAttribute("style") || b.removeAttribute("style");
855
852
  });
856
- }(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && rt(t, l), !1);
857
- }, X)), l.listenersToRemove.add(t.registerCommand(Ct, () => {
858
- const i = D();
859
- if (!L(i) || !i.isCollapsed() || !Y(i, n)) return !1;
860
- const u = st(t, i, n);
861
- return !!u && (lt(u, n), !0);
862
- }, X)), l;
863
- }
864
- function ot(n) {
853
+ }(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && at(t, l), !1);
854
+ }, I)), l.listenersToRemove.add(t.registerCommand(wt, () => {
855
+ const i = L();
856
+ if (!z(i) || !i.isCollapsed() || !J(i, n)) return !1;
857
+ const u = ut(t, i, n);
858
+ return !!u && (ct(u, n), !0);
859
+ }, I)), l;
860
+ }
861
+ function it(n) {
865
862
  return n[Me] || null;
866
863
  }
867
- function _e(n) {
864
+ function re(n) {
868
865
  let e = n;
869
866
  for (; e != null; ) {
870
867
  const t = e.nodeName;
@@ -876,9 +873,9 @@ function _e(n) {
876
873
  }
877
874
  return null;
878
875
  }
879
- function he(n, e) {
876
+ function le(n, e) {
880
877
  const t = [], o = { columns: 0, domRows: t, rows: 0 };
881
- let r = ee(n, e).querySelector("tr"), s = 0, l = 0;
878
+ let r = Q(n, e).querySelector("tr"), s = 0, l = 0;
882
879
  for (t.length = 0; r != null; ) {
883
880
  const a = r.nodeName;
884
881
  if (a === "TD" || a === "TH") {
@@ -898,54 +895,54 @@ function he(n, e) {
898
895
  s++, r = c;
899
896
  continue;
900
897
  }
901
- const d = r.parentNode;
902
- if (d != null) {
903
- const h = d.nextSibling;
898
+ const f = r.parentNode;
899
+ if (f != null) {
900
+ const h = f.nextSibling;
904
901
  if (h == null) break;
905
902
  l++, s = 0, r = h;
906
903
  }
907
904
  }
908
905
  return o.columns = s + 1, o.rows = l + 1, o;
909
906
  }
910
- function Se(n, e, t) {
907
+ function pe(n, e, t) {
911
908
  const o = new Set(t ? t.getNodes() : []);
912
- Xe(e, (r, s) => {
909
+ Ye(e, (r, s) => {
913
910
  const l = r.elem;
914
- o.has(s) ? (r.highlighted = !0, bt(n, r)) : (r.highlighted = !1, yt(n, r), l.getAttribute("style") || l.removeAttribute("style"));
911
+ o.has(s) ? (r.highlighted = !0, Tt(n, r)) : (r.highlighted = !1, Ft(n, r), l.getAttribute("style") || l.removeAttribute("style"));
915
912
  });
916
913
  }
917
- function Xe(n, e) {
914
+ function Ye(n, e) {
918
915
  const { domRows: t } = n;
919
916
  for (let o = 0; o < t.length; o++) {
920
917
  const r = t[o];
921
918
  if (r) for (let s = 0; s < r.length; s++) {
922
919
  const l = r[s];
923
920
  if (!l) continue;
924
- const a = Q(l.elem);
921
+ const a = V(l.elem);
925
922
  a !== null && e(l, a, { x: s, y: o });
926
923
  }
927
924
  }
928
925
  }
929
- function rt(n, e) {
930
- e.$disableHighlightStyle(), Xe(e.table, (t) => {
931
- t.highlighted = !0, bt(n, t);
926
+ function at(n, e) {
927
+ e.$disableHighlightStyle(), Ye(e.table, (t) => {
928
+ t.highlighted = !0, Tt(n, t);
932
929
  });
933
930
  }
934
- const Nn = (n, e, t, o, r) => {
931
+ const On = (n, e, t, o, r) => {
935
932
  const s = r === "forward";
936
933
  switch (r) {
937
934
  case "backward":
938
935
  case "forward":
939
- return t !== (s ? n.table.columns - 1 : 0) ? be(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? be(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
936
+ return t !== (s ? n.table.columns - 1 : 0) ? Se(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Se(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
940
937
  case "up":
941
- return o !== 0 ? be(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
938
+ return o !== 0 ? Se(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
942
939
  case "down":
943
- return o !== n.table.rows - 1 ? be(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
940
+ return o !== n.table.rows - 1 ? Se(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
944
941
  default:
945
942
  return !1;
946
943
  }
947
944
  };
948
- function Ke(n, e) {
945
+ function Oe(n, e) {
949
946
  let t, o;
950
947
  if (e.startColumn === n.minColumn) t = "minColumn";
951
948
  else {
@@ -959,235 +956,252 @@ function Ke(n, e) {
959
956
  }
960
957
  return [t, o];
961
958
  }
962
- function we([n, e]) {
959
+ function _e([n, e]) {
963
960
  return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
964
961
  }
965
- function re(n, e, [t, o]) {
962
+ function te(n, e, [t, o]) {
966
963
  const r = e[o], s = n[r];
967
- s === void 0 && b(250, o, String(r));
964
+ s === void 0 && w(250, o, String(r));
968
965
  const l = e[t], a = s[l];
969
- return a === void 0 && b(250, t, String(l)), a;
970
- }
971
- function xn(n, e, t, o, r) {
972
- const s = $e(e, t, o), l = function(F, A) {
973
- const { minColumn: K, maxColumn: N, minRow: O, maxRow: k } = A;
974
- let T = 1, v = 1, M = 1, W = 1;
975
- const J = F[O], q = F[k];
976
- for (let H = K; H <= N; H++) T = Math.max(T, J[H].cell.__rowSpan), W = Math.max(W, q[H].cell.__rowSpan);
977
- for (let H = O; H <= k; H++) v = Math.max(v, F[H][K].cell.__colSpan), M = Math.max(M, F[H][N].cell.__colSpan);
978
- return { bottomSpan: W, leftSpan: v, rightSpan: M, topSpan: T };
979
- }(e, s), { topSpan: a, leftSpan: c, bottomSpan: d, rightSpan: h } = l, C = function(F, A) {
980
- const K = Ke(F, A);
981
- return K === null && b(249, A.cell.getKey()), K;
982
- }(s, t), [p, i] = we(C);
983
- let u = s[p], f = s[i];
984
- r === "forward" ? u += p === "maxColumn" ? 1 : c : r === "backward" ? u -= p === "minColumn" ? 1 : h : r === "down" ? f += i === "maxRow" ? 1 : a : r === "up" && (f -= i === "minRow" ? 1 : d);
985
- const g = e[f];
986
- if (g === void 0) return !1;
987
- const m = g[u];
966
+ return a === void 0 && w(250, t, String(l)), a;
967
+ }
968
+ function En(n, e, t, o, r) {
969
+ const s = $e(e, t, o), l = function(T, $) {
970
+ const { minColumn: E, maxColumn: x, minRow: O, maxRow: A } = $;
971
+ let R = 1, M = 1, B = 1, ae = 1;
972
+ const Fe = T[O], ve = T[A];
973
+ for (let W = E; W <= x; W++) R = Math.max(R, Fe[W].cell.__rowSpan), ae = Math.max(ae, ve[W].cell.__rowSpan);
974
+ for (let W = O; W <= A; W++) M = Math.max(M, T[W][E].cell.__colSpan), B = Math.max(B, T[W][x].cell.__colSpan);
975
+ return { bottomSpan: ae, leftSpan: M, rightSpan: B, topSpan: R };
976
+ }(e, s), { topSpan: a, leftSpan: c, bottomSpan: f, rightSpan: h } = l, C = function(T, $) {
977
+ const E = Oe(T, $);
978
+ return E === null && w(249, $.cell.getKey()), E;
979
+ }(s, t), [p, i] = _e(C);
980
+ let u = s[p], g = s[i];
981
+ r === "forward" ? u += p === "maxColumn" ? 1 : c : r === "backward" ? u -= p === "minColumn" ? 1 : h : r === "down" ? g += i === "maxRow" ? 1 : a : r === "up" && (g -= i === "minRow" ? 1 : f);
982
+ const d = e[g];
983
+ if (d === void 0) return !1;
984
+ const m = d[u];
988
985
  if (m === void 0) return !1;
989
- const [_, w] = function(F, A, K) {
990
- const N = $e(F, A, K), O = Ke(N, A);
991
- if (O) return [re(F, N, O), re(F, N, we(O))];
992
- const k = Ke(N, K);
993
- if (k) return [re(F, N, we(k)), re(F, N, k)];
994
- const T = ["minColumn", "minRow"];
995
- return [re(F, N, T), re(F, N, we(T))];
996
- }(e, t, m), y = de(n, _.cell), R = de(n, w.cell);
997
- return n.$setAnchorCellForSelection(y), n.$setFocusCellForSelection(R, !0), !0;
998
- }
999
- function Y(n, e) {
1000
- if (L(n) || E(n)) {
986
+ const [_, b] = function(T, $, E) {
987
+ const x = $e(T, $, E), O = Oe(x, $);
988
+ if (O) return [te(T, x, O), te(T, x, _e(O))];
989
+ const A = Oe(x, E);
990
+ if (A) return [te(T, x, _e(A)), te(T, x, A)];
991
+ const R = ["minColumn", "minRow"];
992
+ return [te(T, x, R), te(T, x, _e(R))];
993
+ }(e, t, m), y = he(n, _.cell), F = he(n, b.cell);
994
+ return n.$setAnchorCellForSelection(y), n.$setFocusCellForSelection(F, !0), !0;
995
+ }
996
+ function J(n, e) {
997
+ if (z(n) || v(n)) {
1001
998
  const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
1002
999
  return t && o;
1003
1000
  }
1004
1001
  return !1;
1005
1002
  }
1006
- function be(n, e) {
1003
+ function Se(n, e) {
1007
1004
  e ? n.selectStart() : n.selectEnd();
1008
1005
  }
1009
- function bt(n, e) {
1006
+ function Tt(n, e) {
1010
1007
  const t = e.elem, o = n._config.theme;
1011
- S(Q(t)) || b(131), U(t, o.tableCellSelected);
1008
+ S(V(t)) || w(131), X(t, o.tableCellSelected);
1012
1009
  }
1013
- function yt(n, e) {
1010
+ function Ft(n, e) {
1014
1011
  const t = e.elem;
1015
- S(Q(t)) || b(131);
1012
+ S(V(t)) || w(131);
1016
1013
  const o = n._config.theme;
1017
- ae(t, o.tableCellSelected);
1014
+ ie(t, o.tableCellSelected);
1018
1015
  }
1019
- function ye(n) {
1020
- const e = x(n, S);
1016
+ function we(n) {
1017
+ const e = N(n, S);
1021
1018
  return S(e) ? e : null;
1022
1019
  }
1023
- function ie(n) {
1024
- const e = x(n, $);
1025
- return $(e) ? e : null;
1020
+ function se(n) {
1021
+ const e = N(n, K);
1022
+ return K(e) ? e : null;
1023
+ }
1024
+ function kn(n, e, t, o, r, s, l) {
1025
+ const a = sn(t.focus, r ? "previous" : "next");
1026
+ if (an(a)) return !1;
1027
+ let c = a;
1028
+ for (const d of et(a).iterNodeCarets("shadowRoot")) {
1029
+ if (!cn(d) || !P(d.origin)) return !1;
1030
+ c = d;
1031
+ }
1032
+ const f = c.getParentAtCaret();
1033
+ if (!S(f)) return !1;
1034
+ const h = f, C = function(d) {
1035
+ for (const m of et(d).iterNodeCarets("root")) {
1036
+ const { origin: _ } = m;
1037
+ if (S(_)) {
1038
+ if (tt(m)) return un(_, d.direction);
1039
+ } else if (!k(_)) break;
1040
+ }
1041
+ return null;
1042
+ }(nt(h, c.direction)), p = N(h, K);
1043
+ if (!p || !p.is(s)) return !1;
1044
+ const i = n.getElementByKey(h.getKey()), u = re(i);
1045
+ if (!i || !u) return !1;
1046
+ const g = $n(n, p);
1047
+ if (l.table = g, C) if (o === "extend") {
1048
+ const d = re(n.getElementByKey(C.origin.getKey()));
1049
+ if (!d) return !1;
1050
+ l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(d, !0);
1051
+ } else {
1052
+ const d = ot(C);
1053
+ Ce(t.anchor, d), Ce(t.focus, d);
1054
+ }
1055
+ else if (o === "extend") l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(u, !0);
1056
+ else {
1057
+ const d = function(m) {
1058
+ const _ = hn(m);
1059
+ return tt(_) ? ot(_) : m;
1060
+ }(nt(p, a.direction));
1061
+ Ce(t.anchor, d), Ce(t.focus, d);
1062
+ }
1063
+ return Y(e), !0;
1026
1064
  }
1027
- function Nt(n, e, t, o, r) {
1065
+ function vt(n, e, t, o, r) {
1028
1066
  if ((t === "up" || t === "down") && function(l) {
1029
1067
  const a = l.getRootElement();
1030
1068
  return a ? a.hasAttribute("aria-controls") && a.getAttribute("aria-controls") === "typeahead-menu" : !1;
1031
1069
  }(n)) return !1;
1032
- const s = D();
1033
- if (!Y(s, o)) {
1034
- if (L(s)) {
1070
+ const s = L();
1071
+ if (!J(s, o)) {
1072
+ if (z(s)) {
1035
1073
  if (t === "backward") {
1036
1074
  if (s.focus.offset > 0) return !1;
1037
1075
  const l = function(c) {
1038
- for (let d = c, h = c; h !== null; d = h, h = h.getParent()) if (P(h)) {
1039
- if (h !== d && h.getFirstChild() !== d) return null;
1076
+ for (let f = c, h = c; h !== null; f = h, h = h.getParent()) if (P(h)) {
1077
+ if (h !== f && h.getFirstChild() !== f) return null;
1040
1078
  if (!h.isInline()) return h;
1041
1079
  }
1042
1080
  return null;
1043
1081
  }(s.focus.getNode());
1044
1082
  if (!l) return !1;
1045
1083
  const a = l.getPreviousSibling();
1046
- return !!$(a) && (j(e), e.shiftKey ? s.focus.set(a.getParentOrThrow().getKey(), a.getIndexWithinParent(), "element") : a.selectEnd(), !0);
1084
+ return !!K(a) && (Y(e), e.shiftKey ? s.focus.set(a.getParentOrThrow().getKey(), a.getIndexWithinParent(), "element") : a.selectEnd(), !0);
1047
1085
  }
1048
1086
  if (e.shiftKey && (t === "up" || t === "down")) {
1049
1087
  const l = s.focus.getNode();
1050
1088
  if (!s.isCollapsed() && (t === "up" && !s.isBackward() || t === "down" && s.isBackward())) {
1051
- let a = x(l, (p) => $(p));
1052
- if (S(a) && (a = x(a, $)), a !== o || !a) return !1;
1089
+ let a = N(l, (p) => K(p));
1090
+ if (S(a) && (a = N(a, K)), a !== o || !a) return !1;
1053
1091
  const c = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
1054
1092
  if (!c) return !1;
1055
- let d = 0;
1056
- t === "up" && P(c) && (d = c.getChildrenSize());
1093
+ let f = 0;
1094
+ t === "up" && P(c) && (f = c.getChildrenSize());
1057
1095
  let h = c;
1058
- t === "up" && P(c) && (h = c.getLastChild() || c, d = fe(h) ? h.getTextContentSize() : 0);
1096
+ t === "up" && P(c) && (h = c.getLastChild() || c, f = de(h) ? h.getTextContentSize() : 0);
1059
1097
  const C = s.clone();
1060
- return C.focus.set(h.getKey(), d, fe(h) ? "text" : "element"), Z(C), j(e), !0;
1098
+ return C.focus.set(h.getKey(), f, de(h) ? "text" : "element"), q(C), Y(e), !0;
1061
1099
  }
1062
- if (en(l)) {
1100
+ if (ln(l)) {
1063
1101
  const a = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
1064
1102
  if (a && ue(o, a) !== null) {
1065
- const c = o.getFirstDescendant(), d = o.getLastDescendant();
1066
- if (!c || !d) return !1;
1067
- const [h] = se(c), [C] = se(d), p = o.getCordsFromCellNode(h, r.table), i = o.getCordsFromCellNode(C, r.table), u = o.getDOMCellFromCordsOrThrow(p.x, p.y, r.table), f = o.getDOMCellFromCordsOrThrow(i.x, i.y, r.table);
1068
- return r.$setAnchorCellForSelection(u), r.$setFocusCellForSelection(f, !0), !0;
1103
+ const c = o.getFirstDescendant(), f = o.getLastDescendant();
1104
+ if (!c || !f) return !1;
1105
+ const [h] = oe(c), [C] = oe(f), p = o.getCordsFromCellNode(h, r.table), i = o.getCordsFromCellNode(C, r.table), u = o.getDOMCellFromCordsOrThrow(p.x, p.y, r.table), g = o.getDOMCellFromCordsOrThrow(i.x, i.y, r.table);
1106
+ return r.$setAnchorCellForSelection(u), r.$setFocusCellForSelection(g, !0), !0;
1069
1107
  }
1070
1108
  return !1;
1071
1109
  }
1072
1110
  {
1073
- let a = x(l, (d) => P(d) && !d.isInline());
1074
- if (S(a) && (a = x(a, $)), !a) return !1;
1111
+ let a = N(l, (f) => P(f) && !f.isInline());
1112
+ if (S(a) && (a = N(a, K)), !a) return !1;
1075
1113
  const c = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
1076
- if ($(c) && r.tableNodeKey === c.getKey()) {
1077
- const d = c.getFirstDescendant(), h = c.getLastDescendant();
1078
- if (!d || !h) return !1;
1079
- const [C] = se(d), [p] = se(h), i = s.clone();
1080
- return i.focus.set((t === "up" ? C : p).getKey(), t === "up" ? 0 : p.getChildrenSize(), "element"), j(e), Z(i), !0;
1114
+ if (K(c) && r.tableNodeKey === c.getKey()) {
1115
+ const f = c.getFirstDescendant(), h = c.getLastDescendant();
1116
+ if (!f || !h) return !1;
1117
+ const [C] = oe(f), [p] = oe(h), i = s.clone();
1118
+ return i.focus.set((t === "up" ? C : p).getKey(), t === "up" ? 0 : p.getChildrenSize(), "element"), Y(e), q(i), !0;
1081
1119
  }
1082
1120
  }
1083
1121
  }
1084
1122
  }
1085
- return t === "down" && xt(n) && r.setShouldCheckSelection(), !1;
1086
- }
1087
- if (L(s) && s.isCollapsed()) {
1088
- const { anchor: l, focus: a } = s, c = x(l.getNode(), S), d = x(a.getNode(), S);
1089
- if (!S(c) || !c.is(d)) return !1;
1090
- const h = ie(c);
1091
- if (h !== o && h != null) {
1092
- const m = ee(h, n.getElementByKey(h.getKey()));
1093
- if (m != null) return r.table = he(h, m), Nt(n, e, t, h, r);
1094
- }
1095
- if (t === "backward" || t === "forward") {
1096
- const m = l.type, _ = l.offset, w = l.getNode();
1097
- if (!w) return !1;
1098
- const y = s.getNodes();
1099
- return (y.length !== 1 || !tn(y[0])) && !!function(R, F, A, K) {
1100
- return function(N, O, k) {
1101
- return N === "element" && (k === "backward" ? O.getPreviousSibling() === null : O.getNextSibling() === null);
1102
- }(R, A, K) || function(N, O, k, T) {
1103
- const v = x(k, (W) => P(W) && !W.isInline());
1104
- if (!v) return !1;
1105
- const M = T === "backward" ? O === 0 : O === k.getTextContentSize();
1106
- return N === "text" && M && (T === "backward" ? v.getPreviousSibling() === null : v.getNextSibling() === null);
1107
- }(R, F, A, K);
1108
- }(m, _, w, t) && function(R, F, A, K, N) {
1109
- const [O, k] = V(K, A, A);
1110
- if (!function(v, M, W) {
1111
- const J = v[0][0], q = v[v.length - 1][v[0].length - 1], { startColumn: H, startRow: Ce } = M;
1112
- return W === "backward" ? H === J.startColumn && Ce === J.startRow : H === q.startColumn && Ce === q.startRow;
1113
- }(O, k, N)) return !1;
1114
- const T = function(v, M, W) {
1115
- const J = x(v, (H) => P(H) && !H.isInline());
1116
- if (!J) return;
1117
- const q = M === "backward" ? J.getPreviousSibling() : J.getNextSibling();
1118
- return q && $(q) ? q : M === "backward" ? W.getPreviousSibling() : W.getNextSibling();
1119
- }(F, N, K);
1120
- return !T || $(T) ? !1 : (j(R), N === "backward" ? T.selectEnd() : T.selectStart(), !0);
1121
- }(e, w, c, o, t);
1122
- }
1123
- const C = n.getElementByKey(c.__key), p = n.getElementByKey(l.key);
1124
- if (p == null || C == null) return !1;
1125
- let i;
1126
- if (l.type === "element") i = p.getBoundingClientRect();
1127
- else {
1128
- const m = ve(qe(n));
1129
- if (m === null || m.rangeCount === 0) return !1;
1130
- i = m.getRangeAt(0).getBoundingClientRect();
1131
- }
1132
- const u = t === "up" ? c.getFirstChild() : c.getLastChild();
1133
- if (u == null) return !1;
1134
- const f = n.getElementByKey(u.__key);
1135
- if (f == null) return !1;
1136
- const g = f.getBoundingClientRect();
1137
- if (t === "up" ? g.top > i.top - i.height : i.bottom + i.height > g.bottom) {
1138
- j(e);
1139
- const m = o.getCordsFromCellNode(c, r.table);
1140
- if (!e.shiftKey) return Nn(r, o, m.x, m.y, t);
1141
- {
1142
- const _ = o.getDOMCellFromCordsOrThrow(m.x, m.y, r.table);
1143
- r.$setAnchorCellForSelection(_), r.$setFocusCellForSelection(_, !0);
1123
+ return t === "down" && Rt(n) && r.setShouldCheckSelection(), !1;
1124
+ }
1125
+ if (z(s)) {
1126
+ if (t === "backward" || t === "forward")
1127
+ return kn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
1128
+ if (s.isCollapsed()) {
1129
+ const { anchor: l, focus: a } = s, c = N(l.getNode(), S), f = N(a.getNode(), S);
1130
+ if (!S(c) || !c.is(f)) return !1;
1131
+ const h = se(c);
1132
+ if (h !== o && h != null) {
1133
+ const m = Q(h, n.getElementByKey(h.getKey()));
1134
+ if (m != null) return r.table = le(h, m), vt(n, e, t, h, r);
1135
+ }
1136
+ const C = n.getElementByKey(c.__key), p = n.getElementByKey(l.key);
1137
+ if (p == null || C == null) return !1;
1138
+ let i;
1139
+ if (l.type === "element") i = p.getBoundingClientRect();
1140
+ else {
1141
+ const m = xe(Xe(n));
1142
+ if (m === null || m.rangeCount === 0) return !1;
1143
+ i = m.getRangeAt(0).getBoundingClientRect();
1144
+ }
1145
+ const u = t === "up" ? c.getFirstChild() : c.getLastChild();
1146
+ if (u == null) return !1;
1147
+ const g = n.getElementByKey(u.__key);
1148
+ if (g == null) return !1;
1149
+ const d = g.getBoundingClientRect();
1150
+ if (t === "up" ? d.top > i.top - i.height : i.bottom + i.height > d.bottom) {
1151
+ Y(e);
1152
+ const m = o.getCordsFromCellNode(c, r.table);
1153
+ if (!e.shiftKey) return On(r, o, m.x, m.y, t);
1154
+ {
1155
+ const _ = o.getDOMCellFromCordsOrThrow(m.x, m.y, r.table);
1156
+ r.$setAnchorCellForSelection(_), r.$setFocusCellForSelection(_, !0);
1157
+ }
1158
+ return !0;
1144
1159
  }
1145
- return !0;
1146
1160
  }
1147
- } else if (E(s)) {
1148
- const { anchor: l, focus: a } = s, c = x(l.getNode(), S), d = x(a.getNode(), S), [h] = s.getNodes();
1149
- $(h) || b(251);
1150
- const C = ee(h, n.getElementByKey(h.getKey()));
1151
- if (!S(c) || !S(d) || !$(h) || C == null) return !1;
1161
+ } else if (v(s)) {
1162
+ const { anchor: l, focus: a } = s, c = N(l.getNode(), S), f = N(a.getNode(), S), [h] = s.getNodes();
1163
+ K(h) || w(251);
1164
+ const C = Q(h, n.getElementByKey(h.getKey()));
1165
+ if (!S(c) || !S(f) || !K(h) || C == null) return !1;
1152
1166
  r.$updateTableTableSelection(s);
1153
- const p = he(h, C), i = o.getCordsFromCellNode(c, p), u = o.getDOMCellFromCordsOrThrow(i.x, i.y, p);
1154
- if (r.$setAnchorCellForSelection(u), j(e), e.shiftKey) {
1155
- const [f, g, m] = V(o, c, d);
1156
- return xn(r, f, g, m, t);
1167
+ const p = le(h, C), i = o.getCordsFromCellNode(c, p), u = o.getDOMCellFromCordsOrThrow(i.x, i.y, p);
1168
+ if (r.$setAnchorCellForSelection(u), Y(e), e.shiftKey) {
1169
+ const [g, d, m] = U(o, c, f);
1170
+ return En(r, g, d, m, t);
1157
1171
  }
1158
- return d.selectEnd(), !0;
1172
+ return f.selectEnd(), !0;
1159
1173
  }
1160
1174
  return !1;
1161
1175
  }
1162
- function j(n) {
1176
+ function Y(n) {
1163
1177
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1164
1178
  }
1165
- function lt(n, e, t) {
1166
- const o = G();
1179
+ function ct(n, e, t) {
1180
+ const o = j();
1167
1181
  n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
1168
1182
  }
1169
- function st(n, e, t) {
1183
+ function ut(n, e, t) {
1170
1184
  const o = t.getParent();
1171
1185
  if (!o) return;
1172
- const r = ve(qe(n));
1186
+ const r = xe(Xe(n));
1173
1187
  if (!r) return;
1174
- const s = r.anchorNode, l = n.getElementByKey(o.getKey()), a = ee(t, n.getElementByKey(t.getKey()));
1188
+ const s = r.anchorNode, l = n.getElementByKey(o.getKey()), a = Q(t, n.getElementByKey(t.getKey()));
1175
1189
  if (!s || !l || !a || !l.contains(s) || a.contains(s)) return;
1176
- const c = x(e.anchor.getNode(), (_) => S(_));
1190
+ const c = N(e.anchor.getNode(), (_) => S(_));
1177
1191
  if (!c) return;
1178
- const d = x(c, (_) => $(_));
1179
- if (!$(d) || !d.is(t)) return;
1180
- const [h, C] = V(t, c, c), p = h[0][0], i = h[h.length - 1][h[0].length - 1], { startRow: u, startColumn: f } = C, g = u === p.startRow && f === p.startColumn, m = u === i.startRow && f === i.startColumn;
1181
- return g ? "first" : m ? "last" : void 0;
1192
+ const f = N(c, (_) => K(_));
1193
+ if (!K(f) || !f.is(t)) return;
1194
+ const [h, C] = U(t, c, c), p = h[0][0], i = h[h.length - 1][h[0].length - 1], { startRow: u, startColumn: g } = C, d = u === p.startRow && g === p.startColumn, m = u === i.startRow && g === i.startColumn;
1195
+ return d ? "first" : m ? "last" : void 0;
1182
1196
  }
1183
- function de(n, e) {
1197
+ function he(n, e) {
1184
1198
  const { tableNode: t } = n.$lookup(), o = t.getCordsFromCellNode(e, n.table);
1185
1199
  return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
1186
1200
  }
1187
1201
  function ze(n, e, t) {
1188
- return ue(n, Q(e, t));
1202
+ return ue(n, V(e, t));
1189
1203
  }
1190
- function it(n, e, t, o) {
1204
+ function ht(n, e, t, o) {
1191
1205
  const r = n.querySelector("colgroup");
1192
1206
  if (!r) return;
1193
1207
  const s = [];
@@ -1197,32 +1211,32 @@ function it(n, e, t, o) {
1197
1211
  }
1198
1212
  r.replaceChildren(...s);
1199
1213
  }
1200
- function at(n, e, t) {
1201
- t ? (U(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (ae(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1214
+ function dt(n, e, t) {
1215
+ t ? (X(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (ie(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1202
1216
  }
1203
- function ct(n, e, t) {
1204
- t > 0 ? (U(n, e.theme.tableFrozenColumn), n.setAttribute("data-lexical-frozen-column", "true")) : (ae(n, e.theme.tableFrozenColumn), n.removeAttribute("data-lexical-frozen-column"));
1217
+ function ft(n, e, t) {
1218
+ t > 0 ? (X(n, e.theme.tableFrozenColumn), n.setAttribute("data-lexical-frozen-column", "true")) : (ie(n, e.theme.tableFrozenColumn), n.removeAttribute("data-lexical-frozen-column"));
1205
1219
  }
1206
- function ut(n, e, t) {
1207
- t > 0 ? (U(n, e.theme.tableFrozenRow), n.setAttribute("data-lexical-frozen-row", "true")) : (ae(n, e.theme.tableFrozenRow), n.removeAttribute("data-lexical-frozen-row"));
1220
+ function gt(n, e, t) {
1221
+ t > 0 ? (X(n, e.theme.tableFrozenRow), n.setAttribute("data-lexical-frozen-row", "true")) : (ie(n, e.theme.tableFrozenRow), n.removeAttribute("data-lexical-frozen-row"));
1208
1222
  }
1209
- function Ae(n, e, t) {
1223
+ function Ee(n, e, t) {
1210
1224
  if (!e.theme.tableAlignment) return;
1211
1225
  const o = [], r = [];
1212
1226
  for (const s of ["center", "right"]) {
1213
1227
  const l = e.theme.tableAlignment[s];
1214
1228
  l && (s === t ? r : o).push(l);
1215
1229
  }
1216
- ae(n, ...o), U(n, ...r);
1230
+ ie(n, ...o), X(n, ...r);
1217
1231
  }
1218
1232
  const Le = /* @__PURE__ */ new WeakSet();
1219
- function xt(n = ft()) {
1233
+ function Rt(n = pt()) {
1220
1234
  return Le.has(n);
1221
1235
  }
1222
- function Pn(n, e) {
1236
+ function Un(n, e) {
1223
1237
  e ? Le.add(n) : Le.delete(n);
1224
1238
  }
1225
- class te extends Pe {
1239
+ class G extends Pe {
1226
1240
  static getType() {
1227
1241
  return "table";
1228
1242
  }
@@ -1234,16 +1248,16 @@ class te extends Pe {
1234
1248
  return t.__colWidths = e, t;
1235
1249
  }
1236
1250
  static clone(e) {
1237
- return new te(e.__key);
1251
+ return new G(e.__key);
1238
1252
  }
1239
1253
  afterCloneFrom(e) {
1240
1254
  super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
1241
1255
  }
1242
1256
  static importDOM() {
1243
- return { table: (e) => ({ conversion: Tn, priority: 1 }) };
1257
+ return { table: (e) => ({ conversion: Mn, priority: 1 }) };
1244
1258
  }
1245
1259
  static importJSON(e) {
1246
- return Ye().updateFromJSON(e);
1260
+ return qe().updateFromJSON(e);
1247
1261
  }
1248
1262
  updateFromJSON(e) {
1249
1263
  return super.updateFromJSON(e).setRowStriping(e.rowStriping || !1).setFrozenColumns(e.frozenColumnCount || 0).setFrozenRows(e.frozenRowCount || 0).setColWidths(e.colWidths);
@@ -1259,27 +1273,27 @@ class te extends Pe {
1259
1273
  }
1260
1274
  getDOMSlot(e) {
1261
1275
  const t = e.nodeName !== "TABLE" && e.querySelector("table") || e;
1262
- return t.nodeName !== "TABLE" && b(229), super.getDOMSlot(t).withAfter(t.querySelector("colgroup"));
1276
+ return t.nodeName !== "TABLE" && w(229), super.getDOMSlot(t).withAfter(t.querySelector("colgroup"));
1263
1277
  }
1264
1278
  createDOM(e, t) {
1265
1279
  const o = document.createElement("table");
1266
1280
  this.__style && (o.style.cssText = this.__style);
1267
1281
  const r = document.createElement("colgroup");
1268
- if (o.appendChild(r), it(o, 0, this.getColumnCount(), this.getColWidths()), Et(r), U(o, e.theme.table), Ae(o, e, this.getFormatType()), this.__frozenColumnCount && ct(o, e, this.__frozenColumnCount), this.__frozenRowCount && ut(o, e, this.__frozenRowCount), this.__rowStriping && at(o, e, !0), xt(t)) {
1282
+ if (o.appendChild(r), ht(o, 0, this.getColumnCount(), this.getColWidths()), Pt(r), X(o, e.theme.table), Ee(o, e, this.getFormatType()), this.__frozenColumnCount && ft(o, e, this.__frozenColumnCount), this.__frozenRowCount && gt(o, e, this.__frozenRowCount), this.__rowStriping && dt(o, e, !0), Rt(t)) {
1269
1283
  const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
1270
- return l ? U(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), s;
1284
+ return l ? X(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), s;
1271
1285
  }
1272
1286
  return o;
1273
1287
  }
1274
1288
  updateDOM(e, t, o) {
1275
- e.__rowStriping !== this.__rowStriping && at(t, o, this.__rowStriping), e.__frozenColumnCount !== this.__frozenColumnCount && ct(t, o, this.__frozenColumnCount), e.__frozenRowCount !== this.__frozenRowCount && ut(t, o, this.__frozenRowCount), it(t, 0, this.getColumnCount(), this.getColWidths());
1289
+ e.__rowStriping !== this.__rowStriping && dt(t, o, this.__rowStriping), e.__frozenColumnCount !== this.__frozenColumnCount && ft(t, o, this.__frozenColumnCount), e.__frozenRowCount !== this.__frozenRowCount && gt(t, o, this.__frozenRowCount), ht(t, 0, this.getColumnCount(), this.getColWidths());
1276
1290
  const r = this.getDOMSlot(t).element;
1277
- return e.__style !== this.__style && (r.style.cssText = this.__style), Ae(r, o, this.getFormatType()), !1;
1291
+ return e.__style !== this.__style && (r.style.cssText = this.__style), Ee(r, o, this.getFormatType()), !1;
1278
1292
  }
1279
1293
  exportDOM(e) {
1280
1294
  const t = super.exportDOM(e), { element: o } = t;
1281
1295
  return { after: (r) => {
1282
- if (t.after && (r = t.after(r), this.__format && Ae(r, e._config, this.getFormatType())), Ne(r) && r.nodeName !== "TABLE" && (r = r.querySelector("table")), !Ne(r)) return null;
1296
+ if (t.after && (r = t.after(r), this.__format && Ee(r, e._config, this.getFormatType())), be(r) && r.nodeName !== "TABLE" && (r = r.querySelector("table")), !be(r)) return null;
1283
1297
  const [s] = Je(this, null, null), l = /* @__PURE__ */ new Map();
1284
1298
  for (const h of s) for (const C of h) {
1285
1299
  const p = C.cell.getKey();
@@ -1301,14 +1315,14 @@ class te extends Pe {
1301
1315
  const h = Array.from(r.querySelectorAll(":scope > colgroup > col")).filter((C, p) => a.has(p));
1302
1316
  c.replaceChildren(...h);
1303
1317
  }
1304
- const d = r.querySelectorAll(":scope > tr");
1305
- if (d.length > 0) {
1318
+ const f = r.querySelectorAll(":scope > tr");
1319
+ if (f.length > 0) {
1306
1320
  const h = document.createElement("tbody");
1307
- for (const C of d) h.appendChild(C);
1321
+ for (const C of f) h.appendChild(C);
1308
1322
  r.append(h);
1309
1323
  }
1310
1324
  return r;
1311
- }, element: Ne(o) && o.nodeName !== "TABLE" ? o.querySelector("table") : o };
1325
+ }, element: be(o) && o.nodeName !== "TABLE" ? o.querySelector("table") : o };
1312
1326
  }
1313
1327
  canBeEmpty() {
1314
1328
  return !1;
@@ -1323,7 +1337,7 @@ class te extends Pe {
1323
1337
  if (l != null) for (let a = 0; a < l.length; a++) {
1324
1338
  const c = l[a];
1325
1339
  if (c == null) continue;
1326
- const { elem: d } = c, h = ze(this, d);
1340
+ const { elem: f } = c, h = ze(this, f);
1327
1341
  if (h !== null && e.is(h)) return { x: a, y: s };
1328
1342
  }
1329
1343
  }
@@ -1343,7 +1357,7 @@ class te extends Pe {
1343
1357
  getCellNodeFromCords(e, t, o) {
1344
1358
  const r = this.getDOMCellFromCords(e, t, o);
1345
1359
  if (r == null) return null;
1346
- const s = Q(r.elem);
1360
+ const s = V(r.elem);
1347
1361
  return S(s) ? s : null;
1348
1362
  }
1349
1363
  getCellNodeFromCordsOrThrow(e, t, o) {
@@ -1387,8 +1401,12 @@ class te extends Pe {
1387
1401
  }), t;
1388
1402
  }
1389
1403
  }
1390
- function Tn(n) {
1391
- const e = Ye();
1404
+ function $n(n, e) {
1405
+ const t = n.getElementByKey(e.getKey());
1406
+ return t === null && w(230), le(e, t);
1407
+ }
1408
+ function Mn(n) {
1409
+ const e = qe();
1392
1410
  n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
1393
1411
  const t = n.querySelector(":scope > colgroup");
1394
1412
  if (t) {
@@ -1403,66 +1421,66 @@ function Tn(n) {
1403
1421
  }
1404
1422
  o && e.setColWidths(o);
1405
1423
  }
1406
- return { after: (o) => ht(o, z), node: e };
1424
+ return { after: (o) => mt(o, k), node: e };
1407
1425
  }
1408
- function Ye() {
1409
- return He(new te());
1426
+ function qe() {
1427
+ return Be(new G());
1410
1428
  }
1411
- function $(n) {
1412
- return n instanceof te;
1429
+ function K(n) {
1430
+ return n instanceof G;
1413
1431
  }
1414
- function vn({ rows: n, columns: e, includeHeaders: t }) {
1415
- const o = D();
1416
- if (!o || !L(o) || ie(o.anchor.getNode())) return !1;
1417
- const r = fn(Number(n), Number(e), t);
1418
- kt(r);
1432
+ function zn({ rows: n, columns: e, includeHeaders: t }) {
1433
+ const o = L();
1434
+ if (!o || !z(o) || se(o.anchor.getNode())) return !1;
1435
+ const r = bn(Number(n), Number(e), t);
1436
+ Mt(r);
1419
1437
  const s = r.getFirstDescendant();
1420
- return fe(s) && s.select(), !0;
1438
+ return de(s) && s.select(), !0;
1421
1439
  }
1422
- function Rn(n) {
1423
- z(n.getParent()) ? n.isEmpty() && n.append(G()) : n.remove();
1440
+ function Ln(n) {
1441
+ k(n.getParent()) ? n.isEmpty() && n.append(j()) : n.remove();
1424
1442
  }
1425
- function Fn(n) {
1426
- $(n.getParent()) ? dt(n, S) : n.remove();
1443
+ function Pn(n) {
1444
+ K(n.getParent()) ? Ct(n, S) : n.remove();
1427
1445
  }
1428
- function On(n) {
1429
- dt(n, z);
1446
+ function Bn(n) {
1447
+ Ct(n, k);
1430
1448
  const [e] = Je(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
1431
1449
  for (let r = 0; r < e.length; ++r) {
1432
1450
  const s = o[r];
1433
1451
  if (!s) continue;
1434
- z(s) || b(254, s.constructor.name, s.getType());
1452
+ k(s) || w(254, s.constructor.name, s.getType());
1435
1453
  const l = e[r].reduce((a, c) => c ? 1 + a : a, 0);
1436
1454
  if (l !== t) for (let a = l; a < t; ++a) {
1437
- const c = ge();
1438
- c.append(G()), s.append(c);
1455
+ const c = fe();
1456
+ c.append(j()), s.append(c);
1439
1457
  }
1440
1458
  }
1441
1459
  }
1442
- function kn(n) {
1460
+ function Hn(n) {
1443
1461
  if (n.detail < 3 || !ce(n.target)) return !1;
1444
- const e = Q(n.target);
1462
+ const e = V(n.target);
1445
1463
  if (e === null) return !1;
1446
- const t = x(e, (o) => P(o) && !o.isInline());
1464
+ const t = N(e, (o) => P(o) && !o.isInline());
1447
1465
  return t === null ? !1 : !!S(t.getParent()) && (t.select(0), !0);
1448
1466
  }
1449
- function Hn(n) {
1450
- return n.registerNodeTransform(ne, (e) => {
1467
+ function jn(n) {
1468
+ return n.registerNodeTransform(Z, (e) => {
1451
1469
  if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
1452
- const [, , t] = se(e), [o] = V(t, e, e), r = o.length, s = o[0].length;
1470
+ const [, , t] = oe(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
1453
1471
  let l = t.getFirstChild();
1454
- z(l) || b(175);
1472
+ k(l) || w(175);
1455
1473
  const a = [];
1456
1474
  for (let c = 0; c < r; c++) {
1457
- c !== 0 && (l = l.getNextSibling(), z(l) || b(175));
1458
- let d = null;
1475
+ c !== 0 && (l = l.getNextSibling(), k(l) || w(175));
1476
+ let f = null;
1459
1477
  for (let h = 0; h < s; h++) {
1460
1478
  const C = o[c][h], p = C.cell;
1461
- if (C.startRow === c && C.startColumn === h) d = p, a.push(p);
1479
+ if (C.startRow === c && C.startColumn === h) f = p, a.push(p);
1462
1480
  else if (p.getColSpan() > 1 || p.getRowSpan() > 1) {
1463
- S(p) || b(176);
1464
- const i = ge(p.__headerState);
1465
- d !== null ? d.insertAfter(i) : Ot(l, i);
1481
+ S(p) || w(176);
1482
+ const i = fe(p.__headerState);
1483
+ f !== null ? f.insertAfter(i) : $t(l, i);
1466
1484
  }
1467
1485
  }
1468
1486
  }
@@ -1470,17 +1488,17 @@ function Hn(n) {
1470
1488
  }
1471
1489
  });
1472
1490
  }
1473
- function Dn(n, e = !0) {
1491
+ function Vn(n, e = !0) {
1474
1492
  const t = /* @__PURE__ */ new Map(), o = (s, l, a) => {
1475
- const c = ee(s, a), d = yn(s, c, n, e);
1476
- t.set(l, [d, c]);
1477
- }, r = n.registerMutationListener(te, (s) => {
1493
+ const c = Q(s, a), f = An(s, c, n, e);
1494
+ t.set(l, [f, c]);
1495
+ }, r = n.registerMutationListener(G, (s) => {
1478
1496
  n.getEditorState().read(() => {
1479
1497
  for (const [l, a] of s) {
1480
1498
  const c = t.get(l);
1481
1499
  if (a === "created" || a === "updated") {
1482
- const { tableNode: d, tableElement: h } = wt(l);
1483
- c === void 0 ? o(d, l, h) : h !== c[1] && (c[0].removeListeners(), t.delete(l), o(d, l, h));
1500
+ const { tableNode: f, tableElement: h } = xt(l);
1501
+ c === void 0 ? o(f, l, h) : h !== c[1] && (c[0].removeListeners(), t.delete(l), o(f, l, h));
1484
1502
  } else a === "destroyed" && c !== void 0 && (c[0].removeListeners(), t.delete(l));
1485
1503
  }
1486
1504
  }, { editor: n });
@@ -1490,26 +1508,26 @@ function Dn(n, e = !0) {
1490
1508
  for (const [, [s]] of t) s.removeListeners();
1491
1509
  };
1492
1510
  }
1493
- function Wn(n) {
1494
- return n.hasNodes([te]) || b(255), Ft(n.registerCommand(an, vn, Oe), n.registerCommand(gt, ({ nodes: e, selection: t }) => L(t) ? ie(t.anchor.getNode()) !== null && e.some($) : !1, Oe), n.registerCommand($t, kn, Oe), n.registerNodeTransform(te, On), n.registerNodeTransform(me, Fn), n.registerNodeTransform(ne, Rn));
1511
+ function Qn(n) {
1512
+ return n.hasNodes([G]) || w(255), kt(n.registerCommand(pn, zn, Ke), n.registerCommand(_t, ({ nodes: e, selection: t }) => z(t) ? se(t.anchor.getNode()) !== null && e.some(K) : !1, Ke), n.registerCommand(Bt, Hn, Ke), n.registerNodeTransform(G, Bn), n.registerNodeTransform(ge, Pn), n.registerNodeTransform(Z, Ln));
1495
1513
  }
1496
1514
  export {
1497
- gn as A,
1498
- Mn as E,
1499
- $n as F,
1500
- Ln as H,
1501
- te as J,
1502
- _t as O,
1503
- fn as T,
1504
- Pn as U,
1505
- ne as d,
1506
- zn as k,
1507
- ge as m,
1508
- Dn as n,
1509
- Wn as o,
1510
- S as p,
1511
- Hn as t,
1512
- me as w,
1513
- Be as y
1515
+ bn as $,
1516
+ De as A,
1517
+ Yn as B,
1518
+ ge as F,
1519
+ Xn as H,
1520
+ Jn as L,
1521
+ yn as W,
1522
+ qn as X,
1523
+ Un as Z,
1524
+ Z as b,
1525
+ Vn as d,
1526
+ G as e,
1527
+ Qn as f,
1528
+ jn as h,
1529
+ S as v,
1530
+ fe as x,
1531
+ yt as z
1514
1532
  };
1515
- //# sourceMappingURL=LexicalTable.prod-Ckge-lZb.js.map
1533
+ //# sourceMappingURL=LexicalTable.prod-CNsOdwua.js.map