@uva-glass/component-library 3.14.1 → 3.15.0

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 (58) hide show
  1. package/dist/{Lexical.prod-D8x7Ii0F.js → Lexical.prod-qoFV025v.js} +1831 -1858
  2. package/dist/Lexical.prod-qoFV025v.js.map +1 -0
  3. package/dist/LexicalClipboard.prod-BFJoO5qv.js +255 -0
  4. package/dist/LexicalClipboard.prod-BFJoO5qv.js.map +1 -0
  5. package/dist/{LexicalLink.prod-CkldFE8u.js → LexicalLink.prod-BIN12UMz.js} +47 -47
  6. package/dist/{LexicalLink.prod-CkldFE8u.js.map → LexicalLink.prod-BIN12UMz.js.map} +1 -1
  7. package/dist/{LexicalList.prod-CsVDXdmw.js → LexicalList.prod-WlGaeo0L.js} +71 -71
  8. package/dist/LexicalList.prod-WlGaeo0L.js.map +1 -0
  9. package/dist/LexicalSelection.prod-B5grbYgk.js +97 -0
  10. package/dist/LexicalSelection.prod-B5grbYgk.js.map +1 -0
  11. package/dist/{LexicalTable.prod-rZbTmo9K.js → LexicalTable.prod-osQj1CQX.js} +551 -550
  12. package/dist/LexicalTable.prod-osQj1CQX.js.map +1 -0
  13. package/dist/{LexicalUtils.prod-CpMJ4I9h.js → LexicalUtils.prod-BpZsS7jD.js} +29 -29
  14. package/dist/{LexicalUtils.prod-CpMJ4I9h.js.map → LexicalUtils.prod-BpZsS7jD.js.map} +1 -1
  15. package/dist/{TablePlugin-WOgWan8s.js → TablePlugin-6tDdOCQy.js} +10 -10
  16. package/dist/{TablePlugin-WOgWan8s.js.map → TablePlugin-6tDdOCQy.js.map} +1 -1
  17. package/dist/assets/PageOverlay.css +1 -1
  18. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  19. package/dist/components/FormInput/FormInput.js +1 -1
  20. package/dist/components/InputField/InputField.stories.js +1 -1
  21. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  22. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  23. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  24. package/dist/components/MultiSelect/index.js +1 -1
  25. package/dist/components/PageOverlay/PageOverlay.js +31 -31
  26. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  27. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  28. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  29. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
  30. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +4 -4
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +33 -33
  34. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  35. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +24 -24
  36. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
  37. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  38. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
  39. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +14 -14
  40. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  41. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +20 -20
  42. package/dist/components/RteEditor/Plugins/index.js +1 -1
  43. package/dist/components/RteEditor/RteEditor.js +451 -450
  44. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  45. package/dist/components/RteEditor/helpers.js +4 -4
  46. package/dist/components/Timeline/Timeline.test.js +1 -1
  47. package/dist/components/index.js +1 -1
  48. package/dist/{helpers-E_SsILnP.js → helpers-5RvdadYU.js} +25 -25
  49. package/dist/{helpers-E_SsILnP.js.map → helpers-5RvdadYU.js.map} +1 -1
  50. package/dist/index.js +1 -1
  51. package/package.json +7 -7
  52. package/dist/Lexical.prod-D8x7Ii0F.js.map +0 -1
  53. package/dist/LexicalClipboard.prod-D5GjiArS.js +0 -255
  54. package/dist/LexicalClipboard.prod-D5GjiArS.js.map +0 -1
  55. package/dist/LexicalList.prod-CsVDXdmw.js.map +0 -1
  56. package/dist/LexicalSelection.prod-JQDTaUpX.js +0 -90
  57. package/dist/LexicalSelection.prod-JQDTaUpX.js.map +0 -1
  58. package/dist/LexicalTable.prod-rZbTmo9K.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { w as x, r as Q, i as ge, _ as yt, j as Jt, N as Yt, T as Nt, S as Xt, L as qt } from "./LexicalUtils.prod-CpMJ4I9h.js";
2
- import { f as Ve, n as ye, q as Ze, $ as jt, Y as Ce, M as it, T as I, X as Qe, p as Vt, h as vt, i as re, j as Zt, N as Be, k as xt, c as z, o as Qt, r as be, d as D, a as B, m as Ue, s as Ke, t as Gt, v as en, x as tn, y as nn, F as De, L as on, A as rn, B as Tt, D as ln, H as V, I as sn, K as an, O as cn, P as un, Q as hn, R as dn, S as fn, V as gn, W as fe, g as ne, _ as $e, a0 as mn, b as Rt, a1 as pn, w as Ge, a2 as Cn, U as _n, a3 as Ae, a4 as Sn, a5 as wn, a6 as at, a7 as bn, a8 as ct, z as yn, a9 as ut, l as ht, Z as Te, aa as Nn, C as vn, ab as xn, ac as Tn } from "./Lexical.prod-D8x7Ii0F.js";
3
- import { _ as Rn, M as Fn } from "./LexicalClipboard.prod-D5GjiArS.js";
4
- const et = /^(\d+(?:\.\d+)?)px$/, W = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
- class ce extends Ve {
1
+ import { w as x, r as Q, i as ge, _ as Nt, j as Ut, N as Xt, T as vt, S as Yt, L as qt } from "./LexicalUtils.prod-BpZsS7jD.js";
2
+ import { f as Ze, u as be, e as Qe, h as jt, Q as Ce, i as at, P as I, X as Ge, T as Vt, m as xt, k as re, n as Zt, L as Be, p as Tt, c as z, o as Qt, q as ye, d as D, N as B, w as Je, s as Oe, t as Gt, x as en, z as tn, A as nn, K as De, O as on, B as rn, C as Rt, D as ln, E as V, G as sn, H as an, U as cn, M as un, R as hn, S as dn, V as fn, W as gn, Y as fe, y as ne, $ as $e, a0 as mn, a as Ft, a1 as pn, F as et, a2 as Cn, Z as _n, a3 as Ae, a4 as Sn, a5 as wn, a6 as ct, a7 as yn, a8 as ut, j as bn, a9 as ht, _ as dt, l as Te, aa as Nn, v as vn, ab as xn, ac as Tn } from "./Lexical.prod-qoFV025v.js";
3
+ import { _ as Rn, M as Fn } from "./LexicalClipboard.prod-BFJoO5qv.js";
4
+ const tt = /^(\d+(?:\.\d+)?)px$/, W = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
+ class ce extends Ze {
6
6
  static getType() {
7
7
  return "tablecell";
8
8
  }
@@ -13,31 +13,31 @@ class ce extends Ve {
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: dt, priority: 0 }), th: (e) => ({ conversion: dt, priority: 0 }) };
16
+ return { td: (e) => ({ conversion: ft, priority: 0 }), th: (e) => ({ conversion: ft, priority: 0 }) };
17
17
  }
18
18
  static importJSON(e) {
19
- return Y().updateFromJSON(e);
19
+ return X().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 = W.NO_STATUS, t = 1, o, l) {
25
- super(l), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
24
+ constructor(e = W.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), Je(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Q(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), Ue(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Q(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 (ye(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(), ...Je(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
40
+ return { ...super.exportJSON(), ...Ue(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;
@@ -110,19 +110,19 @@ class ce extends Ve {
110
110
  return !1;
111
111
  }
112
112
  }
113
- function Je(n) {
113
+ function Ue(n) {
114
114
  return n === "middle" || n === "bottom";
115
115
  }
116
- function dt(n) {
116
+ function ft(n) {
117
117
  const e = n, t = n.nodeName.toLowerCase();
118
118
  let o;
119
- et.test(e.style.width) && (o = parseFloat(e.style.width));
120
- const l = Y(t === "th" ? W.ROW : W.NO_STATUS, e.colSpan, o);
121
- l.__rowSpan = e.rowSpan;
119
+ tt.test(e.style.width) && (o = parseFloat(e.style.width));
120
+ const r = X(t === "th" ? W.ROW : W.NO_STATUS, e.colSpan, o);
121
+ r.__rowSpan = e.rowSpan;
122
122
  const s = e.style.backgroundColor;
123
- s !== "" && (l.__backgroundColor = s);
124
- const r = e.style.verticalAlign;
125
- Je(r) && (l.__verticalAlign = r);
123
+ s !== "" && (r.__backgroundColor = s);
124
+ const l = e.style.verticalAlign;
125
+ Ue(l) && (r.__verticalAlign = l);
126
126
  const i = e.style, u = (i && i.textDecoration || "").split(" "), m = i.fontWeight === "700" || i.fontWeight === "bold", h = u.includes("line-through"), p = i.fontStyle === "italic", C = u.includes("underline");
127
127
  return { after: (a) => {
128
128
  const c = [];
@@ -130,27 +130,27 @@ function dt(n) {
130
130
  const d = () => {
131
131
  if (f) {
132
132
  const g = f.getFirstChild();
133
- it(g) && f.getChildrenSize() === 1 && g.remove();
133
+ at(g) && f.getChildrenSize() === 1 && g.remove();
134
134
  }
135
135
  };
136
- for (const g of a) jt(g) || Ce(g) || it(g) ? (Ce(g) && (m && g.toggleFormat("bold"), h && g.toggleFormat("strikethrough"), p && g.toggleFormat("italic"), C && g.toggleFormat("underline")), f ? f.append(g) : (f = I().append(g), c.push(f))) : (c.push(g), d(), f = null);
136
+ for (const g of a) jt(g) || Ce(g) || at(g) ? (Ce(g) && (m && g.toggleFormat("bold"), h && g.toggleFormat("strikethrough"), p && g.toggleFormat("italic"), C && g.toggleFormat("underline")), f ? f.append(g) : (f = I().append(g), c.push(f))) : (c.push(g), d(), f = null);
137
137
  return d(), c.length === 0 && c.push(I()), c;
138
- }, node: l };
138
+ }, node: r };
139
139
  }
140
- function Y(n = W.NO_STATUS, e = 1, t) {
141
- return Ze(new ce(n, e, t));
140
+ function X(n = W.NO_STATUS, e = 1, t) {
141
+ return Qe(new ce(n, e, t));
142
142
  }
143
143
  function w(n) {
144
144
  return n instanceof ce;
145
145
  }
146
- const On = Qt();
147
- function b(n, ...e) {
146
+ const Kn = Qt("INSERT_TABLE_COMMAND");
147
+ function y(n, ...e) {
148
148
  const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
149
149
  o.append("code", n);
150
- for (const l of e) o.append("v", l);
150
+ for (const r of e) o.append("v", r);
151
151
  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.`);
152
152
  }
153
- class xe extends Ve {
153
+ class xe extends Ze {
154
154
  static getType() {
155
155
  return "tablerow";
156
156
  }
@@ -158,7 +158,7 @@ class xe extends Ve {
158
158
  return new xe(e.__height, e.__key);
159
159
  }
160
160
  static importDOM() {
161
- return { tr: (e) => ({ conversion: Kn, priority: 0 }) };
161
+ return { tr: (e) => ({ conversion: On, priority: 0 }) };
162
162
  }
163
163
  static importJSON(e) {
164
164
  return ve().updateFromJSON(e);
@@ -200,27 +200,27 @@ class xe extends Ve {
200
200
  return !1;
201
201
  }
202
202
  }
203
- function Kn(n) {
203
+ function On(n) {
204
204
  const e = n;
205
205
  let t;
206
- return et.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => yt(o, w), node: ve(t) };
206
+ return tt.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => Nt(o, w), node: ve(t) };
207
207
  }
208
208
  function ve(n) {
209
- return Ze(new xe(n));
209
+ return Qe(new xe(n));
210
210
  }
211
- function $(n) {
211
+ function A(n) {
212
212
  return n instanceof xe;
213
213
  }
214
- const tt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, An = tt && "documentMode" in document ? document.documentMode : null, ft = tt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
214
+ const nt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, An = nt && "documentMode" in document ? document.documentMode : null, gt = nt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
215
215
  function En(n, e, t = !0) {
216
- const o = rt();
217
- for (let l = 0; l < n; l++) {
216
+ const o = lt();
217
+ for (let r = 0; r < n; r++) {
218
218
  const s = ve();
219
- for (let r = 0; r < e; r++) {
219
+ for (let l = 0; l < e; l++) {
220
220
  let i = W.NO_STATUS;
221
- typeof t == "object" ? (l === 0 && t.rows && (i |= W.ROW), r === 0 && t.columns && (i |= W.COLUMN)) : t && (l === 0 && (i |= W.ROW), r === 0 && (i |= W.COLUMN));
222
- const u = Y(i), m = I();
223
- m.append(Qe()), u.append(m), s.append(u);
221
+ typeof t == "object" ? (r === 0 && t.rows && (i |= W.ROW), l === 0 && t.columns && (i |= W.COLUMN)) : t && (r === 0 && (i |= W.ROW), l === 0 && (i |= W.COLUMN));
222
+ const u = X(i), m = I();
223
+ m.append(Ge()), u.append(m), s.append(u);
224
224
  }
225
225
  o.append(s);
226
226
  }
@@ -230,86 +230,86 @@ function so(n) {
230
230
  const e = x(n, (t) => w(t));
231
231
  return w(e) ? e : null;
232
232
  }
233
- function Ft(n) {
234
- const e = x(n, (t) => $(t));
235
- if ($(e)) return e;
233
+ function Kt(n) {
234
+ const e = x(n, (t) => A(t));
235
+ if (A(e)) return e;
236
236
  throw new Error("Expected table cell to be inside of table row.");
237
237
  }
238
238
  function Ot(n) {
239
- const e = x(n, (t) => k(t));
240
- if (k(e)) return e;
239
+ const e = x(n, (t) => $(t));
240
+ if ($(e)) return e;
241
241
  throw new Error("Expected table cell to be inside of table.");
242
242
  }
243
243
  function io(n) {
244
- const e = Ft(n);
244
+ const e = Kt(n);
245
245
  return Ot(e).getChildren().findIndex((t) => t.is(e));
246
246
  }
247
247
  function ao(n) {
248
- return Ft(n).getChildren().findIndex((e) => e.is(n));
248
+ return Kt(n).getChildren().findIndex((e) => e.is(n));
249
249
  }
250
- tt && "InputEvent" in window && !An && new window.InputEvent("input");
251
- const Ye = (n, e) => n === W.BOTH || n === e ? e : W.NO_STATUS;
250
+ nt && "InputEvent" in window && !An && new window.InputEvent("input");
251
+ const Xe = (n, e) => n === W.BOTH || n === e ? e : W.NO_STATUS;
252
252
  function kn(n, e = !0) {
253
- const [, , t] = G(n), [o, l] = J(t, n, n), s = o[0].length, { startRow: r } = l;
253
+ const [, , t] = G(n), [o, r] = U(t, n, n), s = o[0].length, { startRow: l } = r;
254
254
  let i = null;
255
255
  if (e) {
256
- const u = r + n.__rowSpan - 1, m = o[u], h = ve();
256
+ const u = l + n.__rowSpan - 1, m = o[u], h = ve();
257
257
  for (let C = 0; C < s; C++) {
258
258
  const { cell: a, startRow: c } = m[C];
259
259
  if (c + a.__rowSpan - 1 <= u) {
260
- const f = m[C].cell.__headerState, d = Ye(f, W.COLUMN);
261
- h.append(Y(d).append(I()));
260
+ const f = m[C].cell.__headerState, d = Xe(f, W.COLUMN);
261
+ h.append(X(d).append(I()));
262
262
  } else a.setRowSpan(a.__rowSpan + 1);
263
263
  }
264
264
  const p = t.getChildAtIndex(u);
265
- $(p) || b(256), p.insertAfter(h), i = h;
265
+ A(p) || y(256), p.insertAfter(h), i = h;
266
266
  } else {
267
- const u = r, m = o[u], h = ve();
267
+ const u = l, m = o[u], h = ve();
268
268
  for (let C = 0; C < s; C++) {
269
269
  const { cell: a, startRow: c } = m[C];
270
270
  if (c === u) {
271
- const f = m[C].cell.__headerState, d = Ye(f, W.COLUMN);
272
- h.append(Y(d).append(I()));
271
+ const f = m[C].cell.__headerState, d = Xe(f, W.COLUMN);
272
+ h.append(X(d).append(I()));
273
273
  } else a.setRowSpan(a.__rowSpan + 1);
274
274
  }
275
275
  const p = t.getChildAtIndex(u);
276
- $(p) || b(257), p.insertBefore(h), i = h;
276
+ A(p) || y(257), p.insertBefore(h), i = h;
277
277
  }
278
278
  return i;
279
279
  }
280
280
  function $n(n, e = !0, t = !0) {
281
- const [, , o] = G(n), [l, s] = J(o, n, n), r = l.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, m = o.getFirstChild();
282
- $(m) || b(120);
281
+ const [, , o] = G(n), [r, s] = U(o, n, n), l = r.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, m = o.getFirstChild();
282
+ A(m) || y(120);
283
283
  let h = null;
284
284
  function p(c = W.NO_STATUS) {
285
- const f = Y(c).append(I());
285
+ const f = X(c).append(I());
286
286
  return h === null && (h = f), f;
287
287
  }
288
288
  let C = m;
289
- e: for (let c = 0; c < r; c++) {
289
+ e: for (let c = 0; c < l; c++) {
290
290
  if (c !== 0) {
291
- const y = C.getNextSibling();
292
- $(y) || b(121), C = y;
291
+ const b = C.getNextSibling();
292
+ A(b) || y(121), C = b;
293
293
  }
294
- const f = l[c], d = f[u < 0 ? 0 : u].cell.__headerState, g = Ye(d, W.ROW);
294
+ const f = r[c], d = f[u < 0 ? 0 : u].cell.__headerState, g = Xe(d, W.ROW);
295
295
  if (u < 0) {
296
- Kt(C, p(g));
296
+ At(C, p(g));
297
297
  continue;
298
298
  }
299
299
  const { cell: _, startColumn: S, startRow: N } = f[u];
300
300
  if (S + _.__colSpan - 1 <= u) {
301
- let y = _, T = N, F = u;
302
- for (; T !== c && y.__rowSpan > 1; ) {
301
+ let b = _, T = N, F = u;
302
+ for (; T !== c && b.__rowSpan > 1; ) {
303
303
  if (F -= _.__colSpan, !(F >= 0)) {
304
304
  C.append(p(g));
305
305
  continue e;
306
306
  }
307
307
  {
308
- const { cell: M, startRow: O } = f[F];
309
- y = M, T = O;
308
+ const { cell: M, startRow: K } = f[F];
309
+ b = M, T = K;
310
310
  }
311
311
  }
312
- y.insertAfter(p(g));
312
+ b.insertAfter(p(g));
313
313
  } else _.setColSpan(_.__colSpan + 1);
314
314
  }
315
315
  h !== null && t && Mn(h);
@@ -323,9 +323,9 @@ function $n(n, e = !0, t = !0) {
323
323
  function co(n, e) {
324
324
  const t = n.getChildren();
325
325
  for (let o = 0; o < t.length; o++) {
326
- const l = t[o];
327
- if ($(l)) {
328
- const s = l.getChildren();
326
+ const r = t[o];
327
+ if (A(r)) {
328
+ const s = r.getChildren();
329
329
  if (e >= s.length || e < 0) throw new Error("Table column target index out of range");
330
330
  s[e].remove();
331
331
  }
@@ -336,14 +336,14 @@ function Mn(n) {
336
336
  const e = n.getFirstDescendant();
337
337
  e == null ? n.selectStart() : e.getParentOrThrow().selectStart();
338
338
  }
339
- function Kt(n, e) {
339
+ function At(n, e) {
340
340
  const t = n.getFirstChild();
341
341
  t !== null ? t.insertBefore(e) : n.append(e);
342
342
  }
343
343
  function Ln(n) {
344
344
  if (n.length === 0) return null;
345
345
  const e = Ot(n[0]), [t] = oe(e, null, null);
346
- let o = 1 / 0, l = -1 / 0, s = 1 / 0, r = -1 / 0;
346
+ let o = 1 / 0, r = -1 / 0, s = 1 / 0, l = -1 / 0;
347
347
  const i = /* @__PURE__ */ new Set();
348
348
  for (const a of t) for (const c of a) {
349
349
  if (!c || !c.cell) continue;
@@ -351,16 +351,16 @@ function Ln(n) {
351
351
  if (!i.has(f) && n.some((d) => d.is(c.cell))) {
352
352
  i.add(f);
353
353
  const d = c.startRow, g = c.startColumn, _ = c.cell.__rowSpan || 1, S = c.cell.__colSpan || 1;
354
- o = Math.min(o, d), l = Math.max(l, d + _ - 1), s = Math.min(s, g), r = Math.max(r, g + S - 1);
354
+ o = Math.min(o, d), r = Math.max(r, d + _ - 1), s = Math.min(s, g), l = Math.max(l, g + S - 1);
355
355
  }
356
356
  }
357
357
  if (o === 1 / 0 || s === 1 / 0) return null;
358
- const u = l - o + 1, m = r - s + 1, h = t[o][s];
358
+ const u = r - o + 1, m = l - s + 1, h = t[o][s];
359
359
  if (!h.cell) return null;
360
360
  const p = h.cell;
361
361
  p.setColSpan(m), p.setRowSpan(u);
362
362
  const C = /* @__PURE__ */ new Set([p.getKey()]);
363
- for (let a = o; a <= l; a++) for (let c = s; c <= r; c++) {
363
+ for (let a = o; a <= r; a++) for (let c = s; c <= l; c++) {
364
364
  const f = t[a][c];
365
365
  if (!f.cell) continue;
366
366
  const d = f.cell, g = d.getKey();
@@ -371,125 +371,125 @@ function Ln(n) {
371
371
  function zn(n) {
372
372
  if (n.getChildrenSize() !== 1) return !1;
373
373
  const e = n.getFirstChildOrThrow();
374
- return !(!Ge(e) || !e.isEmpty());
374
+ return !(!et(e) || !e.isEmpty());
375
375
  }
376
376
  function Wn(n) {
377
- const [e, t, o] = G(n), l = e.__colSpan, s = e.__rowSpan;
378
- if (l === 1 && s === 1) return;
379
- const [r, i] = J(o, e, e), { startColumn: u, startRow: m } = i, h = e.__headerState & W.COLUMN, p = Array.from({ length: l }, (c, f) => {
377
+ const [e, t, o] = G(n), r = e.__colSpan, s = e.__rowSpan;
378
+ if (r === 1 && s === 1) return;
379
+ const [l, i] = U(o, e, e), { startColumn: u, startRow: m } = i, h = e.__headerState & W.COLUMN, p = Array.from({ length: r }, (c, f) => {
380
380
  let d = h;
381
- for (let g = 0; d !== 0 && g < r.length; g++) d &= r[g][f + u].cell.__headerState;
381
+ for (let g = 0; d !== 0 && g < l.length; g++) d &= l[g][f + u].cell.__headerState;
382
382
  return d;
383
383
  }), C = e.__headerState & W.ROW, a = Array.from({ length: s }, (c, f) => {
384
384
  let d = C;
385
- for (let g = 0; d !== 0 && g < r[0].length; g++) d &= r[f + m][g].cell.__headerState;
385
+ for (let g = 0; d !== 0 && g < l[0].length; g++) d &= l[f + m][g].cell.__headerState;
386
386
  return d;
387
387
  });
388
- if (l > 1) {
389
- for (let c = 1; c < l; c++) e.insertAfter(Y(p[c] | a[0]).append(I()));
388
+ if (r > 1) {
389
+ for (let c = 1; c < r; c++) e.insertAfter(X(p[c] | a[0]).append(I()));
390
390
  e.setColSpan(1);
391
391
  }
392
392
  if (s > 1) {
393
393
  let c;
394
394
  for (let f = 1; f < s; f++) {
395
- const d = m + f, g = r[d];
396
- c = (c || t).getNextSibling(), $(c) || b(125);
395
+ const d = m + f, g = l[d];
396
+ c = (c || t).getNextSibling(), A(c) || y(125);
397
397
  let _ = null;
398
398
  for (let S = 0; S < u; S++) {
399
- const N = g[S], y = N.cell;
400
- N.startRow === d && (_ = y), y.__colSpan > 1 && (S += y.__colSpan - 1);
399
+ const N = g[S], b = N.cell;
400
+ N.startRow === d && (_ = b), b.__colSpan > 1 && (S += b.__colSpan - 1);
401
401
  }
402
- if (_ === null) for (let S = l - 1; S >= 0; S--) Kt(c, Y(p[S] | a[f]).append(I()));
403
- else for (let S = l - 1; S >= 0; S--) _.insertAfter(Y(p[S] | a[f]).append(I()));
402
+ if (_ === null) for (let S = r - 1; S >= 0; S--) At(c, X(p[S] | a[f]).append(I()));
403
+ else for (let S = r - 1; S >= 0; S--) _.insertAfter(X(p[S] | a[f]).append(I()));
404
404
  }
405
405
  e.setRowSpan(1);
406
406
  }
407
407
  }
408
- function J(n, e, t) {
409
- const [o, l, s] = oe(n, e, t);
410
- return l === null && b(207), s === null && b(208), [o, l, s];
408
+ function U(n, e, t) {
409
+ const [o, r, s] = oe(n, e, t);
410
+ return r === null && y(207), s === null && y(208), [o, r, s];
411
411
  }
412
412
  function oe(n, e, t) {
413
413
  const o = [];
414
- let l = null, s = null;
415
- function r(u) {
414
+ let r = null, s = null;
415
+ function l(u) {
416
416
  let m = o[u];
417
417
  return m === void 0 && (o[u] = m = []), m;
418
418
  }
419
419
  const i = n.getChildren();
420
420
  for (let u = 0; u < i.length; u++) {
421
421
  const m = i[u];
422
- $(m) || b(209);
423
- const h = r(u);
422
+ A(m) || y(209);
423
+ const h = l(u);
424
424
  for (let p = m.getFirstChild(), C = 0; p != null; p = p.getNextSibling()) {
425
- for (w(p) || b(147); h[C] !== void 0; ) C++;
425
+ for (w(p) || y(147); h[C] !== void 0; ) C++;
426
426
  const a = { cell: p, startColumn: C, startRow: u }, { __rowSpan: c, __colSpan: f } = p;
427
427
  for (let d = 0; d < c && !(u + d >= i.length); d++) {
428
- const g = r(u + d);
428
+ const g = l(u + d);
429
429
  for (let _ = 0; _ < f; _++) g[C + _] = a;
430
430
  }
431
- e !== null && l === null && e.is(p) && (l = a), t !== null && s === null && t.is(p) && (s = a);
431
+ e !== null && r === null && e.is(p) && (r = a), t !== null && s === null && t.is(p) && (s = a);
432
432
  }
433
433
  }
434
- return [o, l, s];
434
+ return [o, r, s];
435
435
  }
436
436
  function G(n) {
437
437
  let e;
438
438
  if (n instanceof ce) e = n;
439
439
  else if ("__type" in n) {
440
- const l = x(n, w);
441
- w(l) || b(148), e = l;
440
+ const r = x(n, w);
441
+ w(r) || y(148), e = r;
442
442
  } else {
443
- const l = x(n.getNode(), w);
444
- w(l) || b(148), e = l;
443
+ const r = x(n.getNode(), w);
444
+ w(r) || y(148), e = r;
445
445
  }
446
446
  const t = e.getParent();
447
- $(t) || b(149);
447
+ A(t) || y(149);
448
448
  const o = t.getParent();
449
- return k(o) || b(210), [e, t, o];
449
+ return $(o) || y(210), [e, t, o];
450
450
  }
451
451
  function Ee(n, e, t) {
452
- let o, l = Math.min(e.startColumn, t.startColumn), s = Math.min(e.startRow, t.startRow), r = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), i = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
452
+ 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), i = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
453
453
  do {
454
454
  o = !1;
455
455
  for (let u = 0; u < n.length; u++) for (let m = 0; m < n[0].length; m++) {
456
456
  const h = n[u][m];
457
457
  if (!h) continue;
458
- const p = h.startColumn + h.cell.__colSpan - 1, C = h.startRow + h.cell.__rowSpan - 1, a = h.startColumn <= r && p >= l, c = h.startRow <= i && C >= s;
458
+ const p = h.startColumn + h.cell.__colSpan - 1, C = h.startRow + h.cell.__rowSpan - 1, a = h.startColumn <= l && p >= r, c = h.startRow <= i && C >= s;
459
459
  if (a && c) {
460
- const f = Math.min(l, h.startColumn), d = Math.max(r, p), g = Math.min(s, h.startRow), _ = Math.max(i, C);
461
- f === l && d === r && g === s && _ === i || (l = f, r = d, s = g, i = _, o = !0);
460
+ const f = Math.min(r, h.startColumn), d = Math.max(l, p), g = Math.min(s, h.startRow), _ = Math.max(i, C);
461
+ f === r && d === l && g === s && _ === i || (r = f, l = d, s = g, i = _, o = !0);
462
462
  }
463
463
  }
464
464
  } while (o);
465
- return { maxColumn: r, maxRow: i, minColumn: l, minRow: s };
465
+ return { maxColumn: l, maxRow: i, minColumn: r, minRow: s };
466
466
  }
467
- function gt(n) {
468
- const [e, , t] = G(n), o = t.getChildren(), l = o.length, s = o[0].getChildren().length, r = new Array(l);
469
- for (let i = 0; i < l; i++) r[i] = new Array(s);
470
- for (let i = 0; i < l; i++) {
467
+ function mt(n) {
468
+ const [e, , t] = G(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
469
+ for (let i = 0; i < r; i++) l[i] = new Array(s);
470
+ for (let i = 0; i < r; i++) {
471
471
  const u = o[i].getChildren();
472
472
  let m = 0;
473
473
  for (let h = 0; h < u.length; h++) {
474
- for (; r[i][m]; ) m++;
474
+ for (; l[i][m]; ) m++;
475
475
  const p = u[h], C = p.__rowSpan || 1, a = p.__colSpan || 1;
476
- for (let c = 0; c < C; c++) for (let f = 0; f < a; f++) r[i + c][m + f] = p;
476
+ for (let c = 0; c < C; c++) for (let f = 0; f < a; f++) l[i + c][m + f] = p;
477
477
  if (e === p) return { colSpan: a, columnIndex: m, rowIndex: i, rowSpan: C };
478
478
  m += a;
479
479
  }
480
480
  }
481
481
  return null;
482
482
  }
483
- function mt(n) {
484
- const [[e, t, o, l], [s, r, i, u]] = ["anchor", "focus"].map((m) => {
483
+ function pt(n) {
484
+ const [[e, t, o, r], [s, l, i, u]] = ["anchor", "focus"].map((m) => {
485
485
  const h = n[m].getNode(), p = x(h, w);
486
- w(p) || b(238, m, h.getKey(), h.getType());
486
+ w(p) || y(238, m, h.getKey(), h.getType());
487
487
  const C = p.getParent();
488
- $(C) || b(239, m);
488
+ A(C) || y(239, m);
489
489
  const a = C.getParent();
490
- return k(a) || b(240, m), [h, p, C, a];
490
+ return $(a) || y(240, m), [h, p, C, a];
491
491
  });
492
- return l.is(u) || b(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: l, focusCell: r, focusNode: s, focusRow: i, focusTable: u };
492
+ return r.is(u) || y(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: u };
493
493
  }
494
494
  class Me {
495
495
  constructor(e, t, o) {
@@ -511,7 +511,7 @@ class Me {
511
511
  this._cachedNodes = e;
512
512
  }
513
513
  is(e) {
514
- return K(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
514
+ return O(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
515
515
  }
516
516
  set(e, t, o) {
517
517
  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;
@@ -531,45 +531,45 @@ class Me {
531
531
  }
532
532
  hasFormat(e) {
533
533
  let t = 0;
534
- this.getNodes().filter(w).forEach((l) => {
535
- const s = l.getFirstChild();
536
- Ge(s) && (t |= s.getTextFormat());
534
+ this.getNodes().filter(w).forEach((r) => {
535
+ const s = r.getFirstChild();
536
+ et(s) && (t |= s.getTextFormat());
537
537
  });
538
538
  const o = Tn[e];
539
539
  return !!(t & o);
540
540
  }
541
541
  insertNodes(e) {
542
542
  const t = this.focus.getNode();
543
- D(t) || b(151), vn(t.select(0, t.getChildrenSize())).insertNodes(e);
543
+ D(t) || y(151), vn(t.select(0, t.getChildrenSize())).insertNodes(e);
544
544
  }
545
545
  getShape() {
546
- const { anchorCell: e, focusCell: t } = mt(this), o = gt(e);
547
- o === null && b(153);
548
- const l = gt(t);
549
- l === null && b(155);
550
- const s = Math.min(o.columnIndex, l.columnIndex), r = Math.max(o.columnIndex + o.colSpan - 1, l.columnIndex + l.colSpan - 1), i = Math.min(o.rowIndex, l.rowIndex), u = Math.max(o.rowIndex + o.rowSpan - 1, l.rowIndex + l.rowSpan - 1);
551
- return { fromX: Math.min(s, r), fromY: Math.min(i, u), toX: Math.max(s, r), toY: Math.max(i, u) };
546
+ const { anchorCell: e, focusCell: t } = pt(this), o = mt(e);
547
+ o === null && y(153);
548
+ const r = mt(t);
549
+ r === null && y(155);
550
+ const s = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), i = Math.min(o.rowIndex, r.rowIndex), u = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
551
+ return { fromX: Math.min(s, l), fromY: Math.min(i, u), toX: Math.max(s, l), toY: Math.max(i, u) };
552
552
  }
553
553
  getNodes() {
554
554
  if (!this.isValid()) return [];
555
555
  const e = this._cachedNodes;
556
556
  if (e !== null) return e;
557
- const { anchorTable: t, anchorCell: o, focusCell: l } = mt(this), s = l.getParents()[1];
557
+ const { anchorTable: t, anchorCell: o, focusCell: r } = pt(this), s = r.getParents()[1];
558
558
  if (s !== t) {
559
- if (t.isParentOf(l)) {
559
+ if (t.isParentOf(r)) {
560
560
  const d = s.getParent();
561
- d == null && b(159), this.set(this.tableKey, l.getKey(), d.getKey());
561
+ d == null && y(159), this.set(this.tableKey, r.getKey(), d.getKey());
562
562
  } else {
563
563
  const d = t.getParent();
564
- d == null && b(158), this.set(this.tableKey, d.getKey(), l.getKey());
564
+ d == null && y(158), this.set(this.tableKey, d.getKey(), r.getKey());
565
565
  }
566
566
  return this.getNodes();
567
567
  }
568
- const [r, i, u] = J(t, o, l), { minColumn: m, maxColumn: h, minRow: p, maxRow: C } = Ee(r, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
568
+ const [l, i, u] = U(t, o, r), { minColumn: m, maxColumn: h, minRow: p, maxRow: C } = Ee(l, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
569
569
  let c = null;
570
570
  for (let d = p; d <= C; d++) for (let g = m; g <= h; g++) {
571
- const { cell: _ } = r[d][g], S = _.getParent();
572
- $(S) || b(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(_.getKey()) || Pn(_, (N) => {
571
+ const { cell: _ } = l[d][g], S = _.getParent();
572
+ A(S) || y(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(_.getKey()) || Hn(_, (N) => {
573
573
  a.set(N.getKey(), N);
574
574
  });
575
575
  }
@@ -580,37 +580,37 @@ class Me {
580
580
  const e = this.getNodes().filter((o) => w(o));
581
581
  let t = "";
582
582
  for (let o = 0; o < e.length; o++) {
583
- const l = e[o], s = l.__parent, r = (e[o + 1] || {}).__parent;
584
- t += l.getTextContent() + (r !== s ? `
583
+ const r = e[o], s = r.__parent, l = (e[o + 1] || {}).__parent;
584
+ t += r.getTextContent() + (l !== s ? `
585
585
  ` : " ");
586
586
  }
587
587
  return t;
588
588
  }
589
589
  }
590
- function K(n) {
590
+ function O(n) {
591
591
  return n instanceof Me;
592
592
  }
593
- function At() {
593
+ function Et() {
594
594
  const n = Ae("root", 0, "element"), e = Ae("root", 0, "element");
595
595
  return new Me("root", n, e);
596
596
  }
597
- function Hn(n, e, t) {
597
+ function Pn(n, e, t) {
598
598
  n.getKey(), e.getKey(), t.getKey();
599
- const o = B(), l = K(o) ? o.clone() : At();
600
- return l.set(n.getKey(), e.getKey(), t.getKey()), l;
599
+ const o = B(), r = O(o) ? o.clone() : Et();
600
+ return r.set(n.getKey(), e.getKey(), t.getKey()), r;
601
601
  }
602
- function Pn(n, e) {
602
+ function Hn(n, e) {
603
603
  const t = [[n]];
604
604
  for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
605
- const l = o.pop();
606
- l === void 0 ? t.pop() : e(l) !== !1 && D(l) && t.push(l.getChildren());
605
+ const r = o.pop();
606
+ r === void 0 ? t.pop() : e(r) !== !1 && D(r) && t.push(r.getChildren());
607
607
  }
608
608
  }
609
- function Et(n, e = vt()) {
610
- const t = Ke(n);
611
- k(t) || b(231, n);
609
+ function kt(n, e = xt()) {
610
+ const t = Oe(n);
611
+ $(t) || y(231, n);
612
612
  const o = ie(t, e.getElementByKey(n));
613
- return o === null && b(232, n), { tableElement: o, tableNode: t };
613
+ return o === null && y(232, n), { tableElement: o, tableNode: t };
614
614
  }
615
615
  class Bn {
616
616
  constructor(e, t) {
@@ -623,22 +623,22 @@ class Bn {
623
623
  this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach((e) => e()), this.listenersToRemove.clear();
624
624
  }
625
625
  $lookup() {
626
- return Et(this.tableNodeKey, this.editor);
626
+ return kt(this.tableNodeKey, this.editor);
627
627
  }
628
628
  trackTable() {
629
629
  const e = new MutationObserver((t) => {
630
630
  this.editor.getEditorState().read(() => {
631
631
  let o = !1;
632
- for (let r = 0; r < t.length; r++) {
633
- const i = t[r].target.nodeName;
632
+ for (let l = 0; l < t.length; l++) {
633
+ const i = t[l].target.nodeName;
634
634
  if (i === "TABLE" || i === "TBODY" || i === "THEAD" || i === "TR") {
635
635
  o = !0;
636
636
  break;
637
637
  }
638
638
  }
639
639
  if (!o) return;
640
- const { tableNode: l, tableElement: s } = this.$lookup();
641
- this.table = me(l, s);
640
+ const { tableNode: r, tableElement: s } = this.$lookup();
641
+ this.table = me(r, s);
642
642
  }, { editor: this.editor });
643
643
  });
644
644
  this.editor.getEditorState().read(() => {
@@ -662,7 +662,7 @@ class Bn {
662
662
  }
663
663
  $updateTableTableSelection(e) {
664
664
  if (e !== null) {
665
- e.tableKey !== this.tableNodeKey && b(233, e.tableKey, this.tableNodeKey);
665
+ e.tableKey !== this.tableNodeKey && y(233, e.tableKey, this.tableNodeKey);
666
666
  const t = this.editor;
667
667
  this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Re(t, this.table, this.tableSelection);
668
668
  } else this.$clearHighlight();
@@ -687,79 +687,79 @@ class Bn {
687
687
  }
688
688
  }
689
689
  $setFocusCellForSelection(e, t = !1) {
690
- const o = this.editor, { tableNode: l } = this.$lookup(), s = e.x, r = e.y;
691
- if (this.focusCell = e, this.isHighlightingCells || this.anchorX === s && this.anchorY === r && !t) {
692
- if (s === this.focusX && r === this.focusY) return !1;
690
+ const o = this.editor, { tableNode: r } = this.$lookup(), s = e.x, l = e.y;
691
+ if (this.focusCell = e, this.isHighlightingCells || this.anchorX === s && this.anchorY === l && !t) {
692
+ if (s === this.focusX && l === this.focusY) return !1;
693
693
  } else this.isHighlightingCells = !0, this.$disableHighlightStyle();
694
- if (this.focusX = s, this.focusY = r, this.isHighlightingCells) {
695
- const i = qe(l, e.elem);
696
- if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = Hn(l, this.$getAnchorTableCellOrThrow(), i), ne(this.tableSelection), o.dispatchCommand(fe, void 0), Re(o, this.table, this.tableSelection), !0;
694
+ if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
695
+ const i = qe(r, e.elem);
696
+ if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = Pn(r, this.$getAnchorTableCellOrThrow(), i), ne(this.tableSelection), o.dispatchCommand(fe, void 0), Re(o, this.table, this.tableSelection), !0;
697
697
  }
698
698
  return !1;
699
699
  }
700
700
  $getAnchorTableCell() {
701
- return this.anchorCellNodeKey ? Ke(this.anchorCellNodeKey) : null;
701
+ return this.anchorCellNodeKey ? Oe(this.anchorCellNodeKey) : null;
702
702
  }
703
703
  $getAnchorTableCellOrThrow() {
704
704
  const e = this.$getAnchorTableCell();
705
- return e === null && b(234), e;
705
+ return e === null && y(234), e;
706
706
  }
707
707
  $getFocusTableCell() {
708
- return this.focusCellNodeKey ? Ke(this.focusCellNodeKey) : null;
708
+ return this.focusCellNodeKey ? Oe(this.focusCellNodeKey) : null;
709
709
  }
710
710
  $getFocusTableCellOrThrow() {
711
711
  const e = this.$getFocusTableCell();
712
- return e === null && b(235), e;
712
+ return e === null && y(235), e;
713
713
  }
714
714
  $setAnchorCellForSelection(e) {
715
715
  this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
716
716
  const { tableNode: t } = this.$lookup(), o = qe(t, e.elem);
717
717
  if (o !== null) {
718
- const l = o.getKey();
719
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : At(), this.anchorCellNodeKey = l;
718
+ const r = o.getKey();
719
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Et(), this.anchorCellNodeKey = r;
720
720
  }
721
721
  }
722
722
  $formatCells(e) {
723
723
  const t = B();
724
- K(t) || b(236);
725
- const o = pn(), l = o.anchor, s = o.focus, r = t.getNodes().filter(w);
726
- r.length > 0 || b(237);
727
- const i = r[0].getFirstChild(), u = Ge(i) ? i.getFormatFlags(e, null) : null;
728
- r.forEach((m) => {
729
- l.set(m.getKey(), 0, "element"), s.set(m.getKey(), m.getChildrenSize(), "element"), o.formatText(e, u);
724
+ O(t) || y(236);
725
+ const o = pn(), r = o.anchor, s = o.focus, l = t.getNodes().filter(w);
726
+ l.length > 0 || y(237);
727
+ const i = l[0].getFirstChild(), u = et(i) ? i.getFormatFlags(e, null) : null;
728
+ l.forEach((m) => {
729
+ r.set(m.getKey(), 0, "element"), s.set(m.getKey(), m.getChildrenSize(), "element"), o.formatText(e, u);
730
730
  }), ne(t), this.editor.dispatchCommand(fe, void 0);
731
731
  }
732
732
  $clearText() {
733
- const { editor: e } = this, t = Ke(this.tableNodeKey);
734
- if (!k(t)) throw new Error("Expected TableNode.");
733
+ const { editor: e } = this, t = Oe(this.tableNodeKey);
734
+ if (!$(t)) throw new Error("Expected TableNode.");
735
735
  const o = B();
736
- K(o) || b(253);
737
- const l = o.getNodes().filter(w);
738
- if (l.length === this.table.columns * this.table.rows) {
736
+ O(o) || y(253);
737
+ const r = o.getNodes().filter(w), s = t.getFirstChild(), l = t.getLastChild();
738
+ if (r.length > 0 && s !== null && l !== null && A(s) && A(l) && r[0] === s.getFirstChild() && r[r.length - 1] === l.getLastChild()) {
739
739
  t.selectPrevious();
740
- const s = t.getParent();
741
- return t.remove(), void (Cn(s) && s.isEmpty() && e.dispatchCommand(Rt, void 0));
740
+ const i = t.getParent();
741
+ return t.remove(), void (Cn(i) && i.isEmpty() && e.dispatchCommand(Ft, void 0));
742
742
  }
743
- l.forEach((s) => {
744
- if (D(s)) {
745
- const r = I(), i = Qe();
746
- r.append(i), s.append(r), s.getChildren().forEach((u) => {
747
- u !== r && u.remove();
743
+ r.forEach((i) => {
744
+ if (D(i)) {
745
+ const u = I(), m = Ge();
746
+ u.append(m), i.append(u), i.getChildren().forEach((h) => {
747
+ h !== u && h.remove();
748
748
  });
749
749
  }
750
750
  }), Re(e, this.table, null), ne(null), e.dispatchCommand(fe, void 0);
751
751
  }
752
752
  }
753
- const Xe = "__lexicalTableSelection", Dn = (n) => !(1 & ~n.buttons);
753
+ const Ye = "__lexicalTableSelection", Dn = (n) => !(1 & ~n.buttons);
754
754
  function de(n) {
755
- return ye(n) && n.nodeName === "TABLE";
755
+ return be(n) && n.nodeName === "TABLE";
756
756
  }
757
757
  function ie(n, e) {
758
758
  if (!e) return e;
759
759
  const t = de(e) ? e : n.getDOMSlot(e).element;
760
- return t.nodeName !== "TABLE" && b(245, e.nodeName), t;
760
+ return t.nodeName !== "TABLE" && y(245, e.nodeName), t;
761
761
  }
762
- function nt(n) {
762
+ function ot(n) {
763
763
  return n._window;
764
764
  }
765
765
  function Ne(n, e) {
@@ -769,64 +769,64 @@ function Ne(n, e) {
769
769
  }
770
770
  return null;
771
771
  }
772
- const In = [[Gt, "down"], [en, "up"], [tn, "backward"], [nn, "forward"]], Un = [rn, Tt, ln], Jn = [sn, an];
773
- function Yn(n, e, t, o) {
774
- const l = t.getRootElement(), s = nt(t);
775
- l !== null && s !== null || b(246);
776
- const r = new Bn(t, n.getKey()), i = ie(n, e);
772
+ const In = [[Gt, "down"], [en, "up"], [tn, "backward"], [nn, "forward"]], Jn = [rn, Rt, ln], Un = [sn, an];
773
+ function Xn(n, e, t, o) {
774
+ const r = t.getRootElement(), s = ot(t);
775
+ r !== null && s !== null || y(246);
776
+ const l = new Bn(t, n.getKey()), i = ie(n, e);
777
777
  (function(a, c) {
778
- pt(a) !== null && b(205), a[Xe] = c;
779
- })(i, r), r.listenersToRemove.add(() => function(a, c) {
780
- pt(a) === c && delete a[Xe];
781
- }(i, r));
778
+ Ct(a) !== null && y(205), a[Ye] = c;
779
+ })(i, l), l.listenersToRemove.add(() => function(a, c) {
780
+ Ct(a) === c && delete a[Ye];
781
+ }(i, l));
782
782
  const u = (a) => {
783
- if (r.pointerType = a.pointerType, a.button !== 0 || !be(a.target) || !s) return;
783
+ if (l.pointerType = a.pointerType, a.button !== 0 || !ye(a.target) || !s) return;
784
784
  const c = ke(a.target);
785
785
  c !== null && t.update(() => {
786
- const f = Ue();
787
- if (ft && a.shiftKey && Z(f, n) && (z(f) || K(f))) {
786
+ const f = Je();
787
+ if (gt && a.shiftKey && Z(f, n) && (z(f) || O(f))) {
788
788
  const d = f.anchor.getNode(), g = Ne(n, f.anchor.getNode());
789
- g ? (r.$setAnchorCellForSelection(se(r, g)), r.$setFocusCellForSelection(c), te(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(f.anchor.key, f.anchor.offset, f.anchor.type);
790
- } else r.$setAnchorCellForSelection(c);
789
+ g ? (l.$setAnchorCellForSelection(se(l, g)), l.$setFocusCellForSelection(c), te(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(f.anchor.key, f.anchor.offset, f.anchor.type);
790
+ } else l.$setAnchorCellForSelection(c);
791
791
  }), (() => {
792
- if (r.isSelecting) return;
792
+ if (l.isSelecting) return;
793
793
  const f = () => {
794
- r.isSelecting = !1, s.removeEventListener("pointerup", f), s.removeEventListener("pointermove", d);
794
+ l.isSelecting = !1, s.removeEventListener("pointerup", f), s.removeEventListener("pointermove", d);
795
795
  }, d = (g) => {
796
- if (!Dn(g) && r.isSelecting) return r.isSelecting = !1, s.removeEventListener("pointerup", f), void s.removeEventListener("pointermove", d);
797
- if (!be(g.target)) return;
796
+ if (!Dn(g) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("pointerup", f), void s.removeEventListener("pointermove", d);
797
+ if (!ye(g.target)) return;
798
798
  let _ = null;
799
- const S = !(ft || i.contains(g.target));
800
- if (S) _ = Ct(i, g.target);
801
- else for (const N of document.elementsFromPoint(g.clientX, g.clientY)) if (_ = Ct(i, N), _) break;
802
- !_ || r.focusCell !== null && _.elem === r.focusCell.elem || (r.setNextFocus({ focusCell: _, override: S }), t.dispatchCommand(fe, void 0));
799
+ const S = !(gt || i.contains(g.target));
800
+ if (S) _ = _t(i, g.target);
801
+ else for (const N of document.elementsFromPoint(g.clientX, g.clientY)) if (_ = _t(i, N), _) break;
802
+ !_ || l.focusCell !== null && _.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: _, override: S }), t.dispatchCommand(fe, void 0));
803
803
  };
804
- r.isSelecting = !0, s.addEventListener("pointerup", f, r.listenerOptions), s.addEventListener("pointermove", d, r.listenerOptions);
804
+ l.isSelecting = !0, s.addEventListener("pointerup", f, l.listenerOptions), s.addEventListener("pointermove", d, l.listenerOptions);
805
805
  })();
806
806
  };
807
- i.addEventListener("pointerdown", u, r.listenerOptions), r.listenersToRemove.add(() => {
807
+ i.addEventListener("pointerdown", u, l.listenerOptions), l.listenersToRemove.add(() => {
808
808
  i.removeEventListener("pointerdown", u);
809
809
  });
810
810
  const m = (a) => {
811
- a.detail >= 3 && be(a.target) && ke(a.target) !== null && a.preventDefault();
811
+ a.detail >= 3 && ye(a.target) && ke(a.target) !== null && a.preventDefault();
812
812
  };
813
- i.addEventListener("mousedown", m, r.listenerOptions), r.listenersToRemove.add(() => {
813
+ i.addEventListener("mousedown", m, l.listenerOptions), l.listenersToRemove.add(() => {
814
814
  i.removeEventListener("mousedown", m);
815
815
  });
816
816
  const h = (a) => {
817
817
  const c = a.target;
818
- a.button === 0 && be(c) && t.update(() => {
818
+ a.button === 0 && ye(c) && t.update(() => {
819
819
  const f = B();
820
- K(f) && f.tableKey === r.tableNodeKey && l.contains(c) && r.$clearHighlight();
820
+ O(f) && f.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
821
821
  });
822
822
  };
823
- s.addEventListener("pointerdown", h, r.listenerOptions), r.listenersToRemove.add(() => {
823
+ s.addEventListener("pointerdown", h, l.listenerOptions), l.listenersToRemove.add(() => {
824
824
  s.removeEventListener("pointerdown", h);
825
825
  });
826
- for (const [a, c] of In) r.listenersToRemove.add(t.registerCommand(a, (f) => Mt(t, f, c, n, r), De));
827
- r.listenersToRemove.add(t.registerCommand(on, (a) => {
826
+ for (const [a, c] of In) l.listenersToRemove.add(t.registerCommand(a, (f) => Lt(t, f, c, n, l), De));
827
+ l.listenersToRemove.add(t.registerCommand(on, (a) => {
828
828
  const c = B();
829
- if (K(c)) {
829
+ if (O(c)) {
830
830
  const f = Ne(n, c.focus.getNode());
831
831
  if (f !== null) return te(a), f.selectEnd(), !0;
832
832
  }
@@ -835,141 +835,141 @@ function Yn(n, e, t, o) {
835
835
  const p = (a) => () => {
836
836
  const c = B();
837
837
  if (!Z(c, n)) return !1;
838
- if (K(c)) return r.$clearText(), !0;
838
+ if (O(c)) return l.$clearText(), !0;
839
839
  if (z(c)) {
840
840
  if (!w(Ne(n, c.anchor.getNode()))) return !1;
841
841
  const f = c.anchor.getNode(), d = c.focus.getNode(), g = n.isParentOf(f), _ = n.isParentOf(d);
842
- if (g && !_ || _ && !g) return r.$clearText(), !0;
843
- const S = x(c.anchor.getNode(), (y) => D(y)), N = S && x(S, (y) => D(y) && w(y.getParent()));
842
+ if (g && !_ || _ && !g) return l.$clearText(), !0;
843
+ const S = x(c.anchor.getNode(), (b) => D(b)), N = S && x(S, (b) => D(b) && w(b.getParent()));
844
844
  if (!D(N) || !D(S)) return !1;
845
- if (a === Tt && N.getPreviousSibling() === null) return !0;
845
+ if (a === Rt && N.getPreviousSibling() === null) return !0;
846
846
  }
847
847
  return !1;
848
848
  };
849
- for (const a of Un) r.listenersToRemove.add(t.registerCommand(a, p(a), V));
849
+ for (const a of Jn) l.listenersToRemove.add(t.registerCommand(a, p(a), V));
850
850
  const C = (a) => {
851
851
  const c = B();
852
- if (!K(c) && !z(c)) return !1;
852
+ if (!O(c) && !z(c)) return !1;
853
853
  const f = n.isParentOf(c.anchor.getNode());
854
854
  if (f !== n.isParentOf(c.focus.getNode())) {
855
855
  const d = f ? "anchor" : "focus", g = f ? "focus" : "anchor", { key: _, offset: S, type: N } = c[g];
856
856
  return n[c[d].isBefore(c[g]) ? "selectPrevious" : "selectNext"]()[g].set(_, S, N), !1;
857
857
  }
858
- return !!Z(c, n) && !!K(c) && (a && (a.preventDefault(), a.stopPropagation()), r.$clearText(), !0);
858
+ return !!Z(c, n) && !!O(c) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
859
859
  };
860
- for (const a of Jn) r.listenersToRemove.add(t.registerCommand(a, C, V));
861
- return r.listenersToRemove.add(t.registerCommand(cn, (a) => {
860
+ for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, C, V));
861
+ return l.listenersToRemove.add(t.registerCommand(cn, (a) => {
862
862
  const c = B();
863
863
  if (c) {
864
- if (!K(c) && !z(c)) return !1;
864
+ if (!O(c) && !z(c)) return !1;
865
865
  Rn(t, qt(a, ClipboardEvent) ? a : null, Fn(c));
866
866
  const f = C(a);
867
867
  return z(c) ? (c.removeText(), !0) : f;
868
868
  }
869
869
  return !1;
870
- }, V)), r.listenersToRemove.add(t.registerCommand(un, (a) => {
870
+ }, V)), l.listenersToRemove.add(t.registerCommand(un, (a) => {
871
871
  const c = B();
872
872
  if (!Z(c, n)) return !1;
873
- if (K(c)) return r.$formatCells(a), !0;
873
+ if (O(c)) return l.$formatCells(a), !0;
874
874
  if (z(c)) {
875
875
  const f = x(c.anchor.getNode(), (d) => w(d));
876
876
  if (!w(f)) return !1;
877
877
  }
878
878
  return !1;
879
- }, V)), r.listenersToRemove.add(t.registerCommand(hn, (a) => {
879
+ }, V)), l.listenersToRemove.add(t.registerCommand(hn, (a) => {
880
880
  const c = B();
881
- if (!K(c) || !Z(c, n)) return !1;
881
+ if (!O(c) || !Z(c, n)) return !1;
882
882
  const f = c.anchor.getNode(), d = c.focus.getNode();
883
883
  if (!w(f) || !w(d)) return !1;
884
- if (function(O, A) {
885
- if (K(O)) {
886
- const R = O.anchor.getNode(), E = O.focus.getNode();
887
- if (A && R && E) {
888
- const [L] = J(A, R, E);
889
- return R.getKey() === L[0][0].cell.getKey() && E.getKey() === L[L.length - 1].at(-1).cell.getKey();
884
+ if (function(K, E) {
885
+ if (O(K)) {
886
+ const R = K.anchor.getNode(), k = K.focus.getNode();
887
+ if (E && R && k) {
888
+ const [L] = U(E, R, k);
889
+ return R.getKey() === L[0][0].cell.getKey() && k.getKey() === L[L.length - 1].at(-1).cell.getKey();
890
890
  }
891
891
  }
892
892
  return !1;
893
893
  }(c, n)) return n.setFormat(a), !0;
894
- const [g, _, S] = J(n, f, d), N = Math.max(_.startRow + _.cell.__rowSpan - 1, S.startRow + S.cell.__rowSpan - 1), y = Math.max(_.startColumn + _.cell.__colSpan - 1, S.startColumn + S.cell.__colSpan - 1), T = Math.min(_.startRow, S.startRow), F = Math.min(_.startColumn, S.startColumn), M = /* @__PURE__ */ new Set();
895
- for (let O = T; O <= N; O++) for (let A = F; A <= y; A++) {
896
- const R = g[O][A].cell;
894
+ const [g, _, S] = U(n, f, d), N = Math.max(_.startRow + _.cell.__rowSpan - 1, S.startRow + S.cell.__rowSpan - 1), b = Math.max(_.startColumn + _.cell.__colSpan - 1, S.startColumn + S.cell.__colSpan - 1), T = Math.min(_.startRow, S.startRow), F = Math.min(_.startColumn, S.startColumn), M = /* @__PURE__ */ new Set();
895
+ for (let K = T; K <= N; K++) for (let E = F; E <= b; E++) {
896
+ const R = g[K][E].cell;
897
897
  if (M.has(R)) continue;
898
898
  M.add(R), R.setFormat(a);
899
- const E = R.getChildren();
900
- for (let L = 0; L < E.length; L++) {
901
- const H = E[L];
902
- D(H) && !H.isInline() && H.setFormat(a);
899
+ const k = R.getChildren();
900
+ for (let L = 0; L < k.length; L++) {
901
+ const P = k[L];
902
+ D(P) && !P.isInline() && P.setFormat(a);
903
903
  }
904
904
  }
905
905
  return !0;
906
- }, V)), r.listenersToRemove.add(t.registerCommand(dn, (a) => {
906
+ }, V)), l.listenersToRemove.add(t.registerCommand(dn, (a) => {
907
907
  const c = B();
908
908
  if (!Z(c, n)) return !1;
909
- if (K(c)) return r.$clearHighlight(), !1;
909
+ if (O(c)) return l.$clearHighlight(), !1;
910
910
  if (z(c)) {
911
911
  const f = x(c.anchor.getNode(), (d) => w(d));
912
912
  if (!w(f)) return !1;
913
913
  if (typeof a == "string") {
914
- const d = wt(t, c, n);
915
- if (d) return St(d, n, [Qe(a)]), !0;
914
+ const d = yt(t, c, n);
915
+ if (d) return wt(d, n, [Ge(a)]), !0;
916
916
  }
917
917
  }
918
918
  return !1;
919
- }, V)), o && r.listenersToRemove.add(t.registerCommand(fn, (a) => {
919
+ }, V)), o && l.listenersToRemove.add(t.registerCommand(fn, (a) => {
920
920
  const c = B();
921
921
  if (!z(c) || !c.isCollapsed() || !Z(c, n)) return !1;
922
922
  const f = we(c.anchor.getNode());
923
923
  return !(f === null || !n.is(pe(f))) && (te(a), function(d, g) {
924
924
  const _ = g === "next" ? "getNextSibling" : "getPreviousSibling", S = g === "next" ? "getFirstChild" : "getLastChild", N = d[_]();
925
925
  if (D(N)) return N.selectEnd();
926
- const y = x(d, $);
927
- y === null && b(247);
928
- for (let F = y[_](); $(F); F = F[_]()) {
926
+ const b = x(d, A);
927
+ b === null && y(247);
928
+ for (let F = b[_](); A(F); F = F[_]()) {
929
929
  const M = F[S]();
930
930
  if (D(M)) return M.selectEnd();
931
931
  }
932
- const T = x(y, k);
933
- T === null && b(248), g === "next" ? T.selectNext() : T.selectPrevious();
932
+ const T = x(b, $);
933
+ T === null && y(248), g === "next" ? T.selectNext() : T.selectPrevious();
934
934
  }(f, a.shiftKey ? "previous" : "next"), !0);
935
- }, V)), r.listenersToRemove.add(t.registerCommand(gn, (a) => n.isSelected(), De)), r.listenersToRemove.add(t.registerCommand(xt, (a) => {
936
- const { nodes: c, selection: f } = a, d = f.getStartEndPoints(), g = K(f), _ = z(f) && x(f.anchor.getNode(), (v) => w(v)) !== null && x(f.focus.getNode(), (v) => w(v)) !== null || g;
937
- if (c.length !== 1 || !k(c[0]) || !_ || d === null) return !1;
938
- const [S, N] = d, [y, T, F] = G(S), M = x(N.getNode(), (v) => w(v));
939
- if (!(w(y) && w(M) && $(T) && k(F))) return !1;
940
- const O = c[0], [A, R, E] = J(F, y, M), [L] = oe(O, null, null), H = A.length, le = H > 0 ? A[0].length : 0;
941
- let X = R.startRow, q = R.startColumn, P = L.length, ue = P > 0 ? L[0].length : 0;
935
+ }, V)), l.listenersToRemove.add(t.registerCommand(gn, (a) => n.isSelected(), De)), l.listenersToRemove.add(t.registerCommand(Tt, (a) => {
936
+ const { nodes: c, selection: f } = a, d = f.getStartEndPoints(), g = O(f), _ = z(f) && x(f.anchor.getNode(), (v) => w(v)) !== null && x(f.focus.getNode(), (v) => w(v)) !== null || g;
937
+ if (c.length !== 1 || !$(c[0]) || !_ || d === null) return !1;
938
+ const [S, N] = d, [b, T, F] = G(S), M = x(N.getNode(), (v) => w(v));
939
+ if (!(w(b) && w(M) && A(T) && $(F))) return !1;
940
+ const K = c[0], [E, R, k] = U(F, b, M), [L] = oe(K, null, null), P = E.length, le = P > 0 ? E[0].length : 0;
941
+ let Y = R.startRow, q = R.startColumn, H = L.length, ue = H > 0 ? L[0].length : 0;
942
942
  if (g) {
943
- const v = Ee(A, R, E), U = v.maxRow - v.minRow + 1, j = v.maxColumn - v.minColumn + 1;
944
- X = v.minRow, q = v.minColumn, P = Math.min(P, U), ue = Math.min(ue, j);
943
+ const v = Ee(E, R, k), J = v.maxRow - v.minRow + 1, j = v.maxColumn - v.minColumn + 1;
944
+ Y = v.minRow, q = v.minColumn, H = Math.min(H, J), ue = Math.min(ue, j);
945
945
  }
946
946
  let Le = !1;
947
- const zt = Math.min(H, X + P) - 1, Wt = Math.min(le, q + ue) - 1, lt = /* @__PURE__ */ new Set();
948
- for (let v = X; v <= zt; v++) for (let U = q; U <= Wt; U++) {
949
- const j = A[v][U];
950
- lt.has(j.cell.getKey()) || j.cell.__rowSpan === 1 && j.cell.__colSpan === 1 || (Wn(j.cell), lt.add(j.cell.getKey()), Le = !0);
947
+ const zt = Math.min(P, Y + H) - 1, Wt = Math.min(le, q + ue) - 1, st = /* @__PURE__ */ new Set();
948
+ for (let v = Y; v <= zt; v++) for (let J = q; J <= Wt; J++) {
949
+ const j = E[v][J];
950
+ st.has(j.cell.getKey()) || j.cell.__rowSpan === 1 && j.cell.__colSpan === 1 || (Wn(j.cell), st.add(j.cell.getKey()), Le = !0);
951
951
  }
952
952
  let [_e] = oe(F.getWritable(), null, null);
953
- const Ht = P - H + X;
954
- for (let v = 0; v < Ht; v++)
955
- kn(_e[H - 1][0].cell);
956
- const Pt = ue - le + q;
953
+ const Pt = H - P + Y;
957
954
  for (let v = 0; v < Pt; v++)
955
+ kn(_e[P - 1][0].cell);
956
+ const Ht = ue - le + q;
957
+ for (let v = 0; v < Ht; v++)
958
958
  $n(_e[0][le - 1].cell, !0, !1);
959
959
  [_e] = oe(F.getWritable(), null, null);
960
- for (let v = X; v < X + P; v++) for (let U = q; U < q + ue; U++) {
961
- const j = v - X, st = U - q, ze = L[j][st];
962
- if (ze.startRow !== j || ze.startColumn !== st) continue;
960
+ for (let v = Y; v < Y + H; v++) for (let J = q; J < q + ue; J++) {
961
+ const j = v - Y, it = J - q, ze = L[j][it];
962
+ if (ze.startRow !== j || ze.startColumn !== it) continue;
963
963
  const Se = ze.cell;
964
964
  if (Se.__rowSpan !== 1 || Se.__colSpan !== 1) {
965
- const ee = [], Dt = Math.min(v + Se.__rowSpan, X + P) - 1, It = Math.min(U + Se.__colSpan, q + ue) - 1;
966
- for (let He = v; He <= Dt; He++) for (let Pe = U; Pe <= It; Pe++) {
967
- const Ut = _e[He][Pe];
968
- ee.push(Ut.cell);
965
+ const ee = [], Dt = Math.min(v + Se.__rowSpan, Y + H) - 1, It = Math.min(J + Se.__colSpan, q + ue) - 1;
966
+ for (let Pe = v; Pe <= Dt; Pe++) for (let He = J; He <= It; He++) {
967
+ const Jt = _e[Pe][He];
968
+ ee.push(Jt.cell);
969
969
  }
970
970
  Ln(ee), Le = !0;
971
971
  }
972
- const { cell: We } = _e[v][U], Bt = We.getChildren();
972
+ const { cell: We } = _e[v][J], Bt = We.getChildren();
973
973
  Se.getChildren().forEach((ee) => {
974
974
  Ce(ee) && I().append(ee), We.append(ee);
975
975
  }), Bt.forEach((ee) => ee.remove());
@@ -979,61 +979,61 @@ function Yn(n, e, t, o) {
979
979
  v[R.startRow][R.startColumn].cell.selectEnd();
980
980
  }
981
981
  return !0;
982
- }, V)), r.listenersToRemove.add(t.registerCommand(fe, () => {
983
- const a = B(), c = Ue(), f = r.getAndClearNextFocus();
982
+ }, V)), l.listenersToRemove.add(t.registerCommand(fe, () => {
983
+ const a = B(), c = Je(), f = l.getAndClearNextFocus();
984
984
  if (f !== null) {
985
985
  const { focusCell: d } = f;
986
- if (K(a) && a.tableKey === r.tableNodeKey) return (d.x !== r.focusX || d.y !== r.focusY) && (r.$setFocusCellForSelection(d), !0);
987
- if (d !== r.anchorCell && Z(a, n)) return r.$setFocusCellForSelection(d), !0;
986
+ if (O(a) && a.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
987
+ if (d !== l.anchorCell && Z(a, n)) return l.$setFocusCellForSelection(d), !0;
988
988
  }
989
- if (r.getAndClearShouldCheckSelection() && z(c) && z(a) && a.isCollapsed()) {
989
+ if (l.getAndClearShouldCheckSelection() && z(c) && z(a) && a.isCollapsed()) {
990
990
  const d = a.anchor.getNode(), g = n.getFirstChild(), _ = we(d);
991
- if (_ !== null && $(g)) {
991
+ if (_ !== null && A(g)) {
992
992
  const S = g.getFirstChild();
993
993
  if (w(S) && n.is(x(_, (N) => N.is(n) || N.is(S)))) return S.selectStart(), !0;
994
994
  }
995
995
  }
996
996
  if (z(a)) {
997
- const { anchor: d, focus: g } = a, _ = d.getNode(), S = g.getNode(), N = we(_), y = we(S), T = !(!N || !n.is(pe(N))), F = !(!y || !n.is(pe(y))), M = T !== F, O = T && F, A = a.isBackward();
997
+ const { anchor: d, focus: g } = a, _ = d.getNode(), S = g.getNode(), N = we(_), b = we(S), T = !(!N || !n.is(pe(N))), F = !(!b || !n.is(pe(b))), M = T !== F, K = T && F, E = a.isBackward();
998
998
  if (M) {
999
999
  const R = a.clone();
1000
1000
  if (F) {
1001
- const [E] = J(n, y, y), L = E[0][0].cell, H = E[E.length - 1].at(-1).cell;
1002
- R.focus.set(A ? L.getKey() : H.getKey(), A ? L.getChildrenSize() : H.getChildrenSize(), "element");
1001
+ const [k] = U(n, b, b), L = k[0][0].cell, P = k[k.length - 1].at(-1).cell;
1002
+ R.focus.set(E ? L.getKey() : P.getKey(), E ? L.getChildrenSize() : P.getChildrenSize(), "element");
1003
1003
  } else if (T) {
1004
- const [E] = J(n, N, N), L = E[0][0].cell, H = E[E.length - 1].at(-1).cell;
1005
- R.anchor.set(A ? H.getKey() : L.getKey(), A ? H.getChildrenSize() : 0, "element");
1004
+ const [k] = U(n, N, N), L = k[0][0].cell, P = k[k.length - 1].at(-1).cell;
1005
+ R.anchor.set(E ? P.getKey() : L.getKey(), E ? P.getChildrenSize() : 0, "element");
1006
1006
  }
1007
- ne(R), _t(t, r);
1008
- } else if (O && (N.is(y) || (r.$setAnchorCellForSelection(se(r, N)), r.$setFocusCellForSelection(se(r, y), !0)), r.pointerType === "touch" && a.isCollapsed() && z(c) && c.isCollapsed())) {
1007
+ ne(R), St(t, l);
1008
+ } else if (K && (N.is(b) || (l.$setAnchorCellForSelection(se(l, N)), l.$setFocusCellForSelection(se(l, b), !0)), l.pointerType === "touch" && a.isCollapsed() && z(c) && c.isCollapsed())) {
1009
1009
  const R = we(c.anchor.getNode());
1010
- R && !R.is(y) && (r.$setAnchorCellForSelection(se(r, R)), r.$setFocusCellForSelection(se(r, y), !0), r.pointerType = null);
1010
+ R && !R.is(b) && (l.$setAnchorCellForSelection(se(l, R)), l.$setFocusCellForSelection(se(l, b), !0), l.pointerType = null);
1011
1011
  }
1012
- } else if (a && K(a) && a.is(c) && a.tableKey === n.getKey()) {
1012
+ } else if (a && O(a) && a.is(c) && a.tableKey === n.getKey()) {
1013
1013
  const d = $e(s);
1014
1014
  if (d && d.anchorNode && d.focusNode) {
1015
1015
  const g = re(d.focusNode), _ = g && !n.isParentOf(g), S = re(d.anchorNode), N = S && n.isParentOf(S);
1016
1016
  if (_ && N && d.rangeCount > 0) {
1017
- const y = mn(d, t);
1018
- y && (y.anchor.set(n.getKey(), a.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), ne(y));
1017
+ const b = mn(d, t);
1018
+ b && (b.anchor.set(n.getKey(), a.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), ne(b));
1019
1019
  }
1020
1020
  }
1021
1021
  }
1022
- return a && !a.is(c) && (K(a) || K(c)) && r.tableSelection && !r.tableSelection.is(c) ? (K(a) && a.tableKey === r.tableNodeKey ? r.$updateTableTableSelection(a) : !K(a) && K(c) && c.tableKey === r.tableNodeKey && r.$updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(d, g) {
1023
- g.$enableHighlightStyle(), ot(g.table, (_) => {
1022
+ return a && !a.is(c) && (O(a) || O(c)) && l.tableSelection && !l.tableSelection.is(c) ? (O(a) && a.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(a) : !O(a) && O(c) && c.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, g) {
1023
+ g.$enableHighlightStyle(), rt(g.table, (_) => {
1024
1024
  const S = _.elem;
1025
- _.highlighted = !1, $t(d, _), S.getAttribute("style") || S.removeAttribute("style");
1025
+ _.highlighted = !1, Mt(d, _), S.getAttribute("style") || S.removeAttribute("style");
1026
1026
  });
1027
- }(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() && _t(t, r), !1);
1028
- }, V)), r.listenersToRemove.add(t.registerCommand(Rt, () => {
1027
+ }(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && St(t, l), !1);
1028
+ }, V)), l.listenersToRemove.add(t.registerCommand(Ft, () => {
1029
1029
  const a = B();
1030
1030
  if (!z(a) || !a.isCollapsed() || !Z(a, n)) return !1;
1031
- const c = wt(t, a, n);
1032
- return !!c && (St(c, n), !0);
1033
- }, V)), r;
1031
+ const c = yt(t, a, n);
1032
+ return !!c && (wt(c, n), !0);
1033
+ }, V)), l;
1034
1034
  }
1035
- function pt(n) {
1036
- return n[Xe] || null;
1035
+ function Ct(n) {
1036
+ return n[Ye] || null;
1037
1037
  }
1038
1038
  function ke(n) {
1039
1039
  let e = n;
@@ -1047,81 +1047,81 @@ function ke(n) {
1047
1047
  }
1048
1048
  return null;
1049
1049
  }
1050
- function Ct(n, e) {
1050
+ function _t(n, e) {
1051
1051
  if (!n.contains(e)) return null;
1052
1052
  let t = null;
1053
1053
  for (let o = e; o != null; o = o.parentNode) {
1054
1054
  if (o === n) return t;
1055
- const l = o.nodeName;
1056
- l !== "TD" && l !== "TH" || (t = o._cell || null);
1055
+ const r = o.nodeName;
1056
+ r !== "TD" && r !== "TH" || (t = o._cell || null);
1057
1057
  }
1058
1058
  return null;
1059
1059
  }
1060
1060
  function me(n, e) {
1061
1061
  const t = [], o = { columns: 0, domRows: t, rows: 0 };
1062
- let l = ie(n, e).querySelector("tr"), s = 0, r = 0;
1063
- for (t.length = 0; l != null; ) {
1064
- const i = l.nodeName;
1062
+ let r = ie(n, e).querySelector("tr"), s = 0, l = 0;
1063
+ for (t.length = 0; r != null; ) {
1064
+ const i = r.nodeName;
1065
1065
  if (i === "TD" || i === "TH") {
1066
- const h = { elem: l, hasBackgroundColor: l.style.backgroundColor !== "", highlighted: !1, x: s, y: r };
1067
- l._cell = h;
1068
- let p = t[r];
1069
- p === void 0 && (p = t[r] = []), p[s] = h;
1066
+ const h = { elem: r, hasBackgroundColor: r.style.backgroundColor !== "", highlighted: !1, x: s, y: l };
1067
+ r._cell = h;
1068
+ let p = t[l];
1069
+ p === void 0 && (p = t[l] = []), p[s] = h;
1070
1070
  } else {
1071
- const h = l.firstChild;
1071
+ const h = r.firstChild;
1072
1072
  if (h != null) {
1073
- l = h;
1073
+ r = h;
1074
1074
  continue;
1075
1075
  }
1076
1076
  }
1077
- const u = l.nextSibling;
1077
+ const u = r.nextSibling;
1078
1078
  if (u != null) {
1079
- s++, l = u;
1079
+ s++, r = u;
1080
1080
  continue;
1081
1081
  }
1082
- const m = l.parentNode;
1082
+ const m = r.parentNode;
1083
1083
  if (m != null) {
1084
1084
  const h = m.nextSibling;
1085
1085
  if (h == null) break;
1086
- r++, s = 0, l = h;
1086
+ l++, s = 0, r = h;
1087
1087
  }
1088
1088
  }
1089
- return o.columns = s + 1, o.rows = r + 1, o;
1089
+ return o.columns = s + 1, o.rows = l + 1, o;
1090
1090
  }
1091
1091
  function Re(n, e, t) {
1092
1092
  const o = new Set(t ? t.getNodes() : []);
1093
- ot(e, (l, s) => {
1094
- const r = l.elem;
1095
- o.has(s) ? (l.highlighted = !0, kt(n, l)) : (l.highlighted = !1, $t(n, l), r.getAttribute("style") || r.removeAttribute("style"));
1093
+ rt(e, (r, s) => {
1094
+ const l = r.elem;
1095
+ o.has(s) ? (r.highlighted = !0, $t(n, r)) : (r.highlighted = !1, Mt(n, r), l.getAttribute("style") || l.removeAttribute("style"));
1096
1096
  });
1097
1097
  }
1098
- function ot(n, e) {
1098
+ function rt(n, e) {
1099
1099
  const { domRows: t } = n;
1100
1100
  for (let o = 0; o < t.length; o++) {
1101
- const l = t[o];
1102
- if (l) for (let s = 0; s < l.length; s++) {
1103
- const r = l[s];
1104
- if (!r) continue;
1105
- const i = re(r.elem);
1106
- i !== null && e(r, i, { x: s, y: o });
1101
+ const r = t[o];
1102
+ if (r) for (let s = 0; s < r.length; s++) {
1103
+ const l = r[s];
1104
+ if (!l) continue;
1105
+ const i = re(l.elem);
1106
+ i !== null && e(l, i, { x: s, y: o });
1107
1107
  }
1108
1108
  }
1109
1109
  }
1110
- function _t(n, e) {
1111
- e.$disableHighlightStyle(), ot(e.table, (t) => {
1112
- t.highlighted = !0, kt(n, t);
1110
+ function St(n, e) {
1111
+ e.$disableHighlightStyle(), rt(e.table, (t) => {
1112
+ t.highlighted = !0, $t(n, t);
1113
1113
  });
1114
1114
  }
1115
- const Xn = (n, e, t, o, l) => {
1116
- const s = l === "forward";
1117
- switch (l) {
1115
+ const Yn = (n, e, t, o, r) => {
1116
+ const s = r === "forward";
1117
+ switch (r) {
1118
1118
  case "backward":
1119
1119
  case "forward":
1120
- return t !== (s ? n.table.columns - 1 : 0) ? Oe(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Oe(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
1120
+ return t !== (s ? n.table.columns - 1 : 0) ? Ke(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Ke(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
1121
1121
  case "up":
1122
- return o !== 0 ? Oe(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1122
+ return o !== 0 ? Ke(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1123
1123
  case "down":
1124
- return o !== n.table.rows - 1 ? Oe(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1124
+ return o !== n.table.rows - 1 ? Ke(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1125
1125
  default:
1126
1126
  return !1;
1127
1127
  }
@@ -1144,56 +1144,56 @@ function Fe([n, e]) {
1144
1144
  return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
1145
1145
  }
1146
1146
  function he(n, e, [t, o]) {
1147
- const l = e[o], s = n[l];
1148
- s === void 0 && b(250, o, String(l));
1149
- const r = e[t], i = s[r];
1150
- return i === void 0 && b(250, t, String(r)), i;
1151
- }
1152
- function qn(n, e, t, o, l) {
1153
- const s = Ee(e, t, o), r = function(T, F) {
1154
- const { minColumn: M, maxColumn: O, minRow: A, maxRow: R } = F;
1155
- let E = 1, L = 1, H = 1, le = 1;
1156
- const X = T[A], q = T[R];
1157
- for (let P = M; P <= O; P++) E = Math.max(E, X[P].cell.__rowSpan), le = Math.max(le, q[P].cell.__rowSpan);
1158
- for (let P = A; P <= R; P++) L = Math.max(L, T[P][M].cell.__colSpan), H = Math.max(H, T[P][O].cell.__colSpan);
1159
- return { bottomSpan: le, leftSpan: L, rightSpan: H, topSpan: E };
1160
- }(e, s), { topSpan: i, leftSpan: u, bottomSpan: m, rightSpan: h } = r, p = function(T, F) {
1147
+ const r = e[o], s = n[r];
1148
+ s === void 0 && y(250, o, String(r));
1149
+ const l = e[t], i = s[l];
1150
+ return i === void 0 && y(250, t, String(l)), i;
1151
+ }
1152
+ function qn(n, e, t, o, r) {
1153
+ const s = Ee(e, t, o), l = function(T, F) {
1154
+ const { minColumn: M, maxColumn: K, minRow: E, maxRow: R } = F;
1155
+ let k = 1, L = 1, P = 1, le = 1;
1156
+ const Y = T[E], q = T[R];
1157
+ for (let H = M; H <= K; H++) k = Math.max(k, Y[H].cell.__rowSpan), le = Math.max(le, q[H].cell.__rowSpan);
1158
+ for (let H = E; H <= R; H++) L = Math.max(L, T[H][M].cell.__colSpan), P = Math.max(P, T[H][K].cell.__colSpan);
1159
+ return { bottomSpan: le, leftSpan: L, rightSpan: P, topSpan: k };
1160
+ }(e, s), { topSpan: i, leftSpan: u, bottomSpan: m, rightSpan: h } = l, p = function(T, F) {
1161
1161
  const M = Ie(T, F);
1162
- return M === null && b(249, F.cell.getKey()), M;
1162
+ return M === null && y(249, F.cell.getKey()), M;
1163
1163
  }(s, t), [C, a] = Fe(p);
1164
1164
  let c = s[C], f = s[a];
1165
- l === "forward" ? c += C === "maxColumn" ? 1 : u : l === "backward" ? c -= C === "minColumn" ? 1 : h : l === "down" ? f += a === "maxRow" ? 1 : i : l === "up" && (f -= a === "minRow" ? 1 : m);
1165
+ r === "forward" ? c += C === "maxColumn" ? 1 : u : r === "backward" ? c -= C === "minColumn" ? 1 : h : r === "down" ? f += a === "maxRow" ? 1 : i : r === "up" && (f -= a === "minRow" ? 1 : m);
1166
1166
  const d = e[f];
1167
1167
  if (d === void 0) return !1;
1168
1168
  const g = d[c];
1169
1169
  if (g === void 0) return !1;
1170
1170
  const [_, S] = function(T, F, M) {
1171
- const O = Ee(T, F, M), A = Ie(O, F);
1172
- if (A) return [he(T, O, A), he(T, O, Fe(A))];
1173
- const R = Ie(O, M);
1174
- if (R) return [he(T, O, Fe(R)), he(T, O, R)];
1175
- const E = ["minColumn", "minRow"];
1176
- return [he(T, O, E), he(T, O, Fe(E))];
1177
- }(e, t, g), N = se(n, _.cell), y = se(n, S.cell);
1178
- return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(y, !0), !0;
1171
+ const K = Ee(T, F, M), E = Ie(K, F);
1172
+ if (E) return [he(T, K, E), he(T, K, Fe(E))];
1173
+ const R = Ie(K, M);
1174
+ if (R) return [he(T, K, Fe(R)), he(T, K, R)];
1175
+ const k = ["minColumn", "minRow"];
1176
+ return [he(T, K, k), he(T, K, Fe(k))];
1177
+ }(e, t, g), N = se(n, _.cell), b = se(n, S.cell);
1178
+ return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(b, !0), !0;
1179
1179
  }
1180
1180
  function Z(n, e) {
1181
- if (z(n) || K(n)) {
1181
+ if (z(n) || O(n)) {
1182
1182
  const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
1183
1183
  return t && o;
1184
1184
  }
1185
1185
  return !1;
1186
1186
  }
1187
- function Oe(n, e) {
1187
+ function Ke(n, e) {
1188
1188
  e ? n.selectStart() : n.selectEnd();
1189
1189
  }
1190
- function kt(n, e) {
1190
+ function $t(n, e) {
1191
1191
  const t = e.elem, o = n._config.theme;
1192
- w(re(t)) || b(131), Q(t, o.tableCellSelected);
1192
+ w(re(t)) || y(131), Q(t, o.tableCellSelected);
1193
1193
  }
1194
- function $t(n, e) {
1194
+ function Mt(n, e) {
1195
1195
  const t = e.elem;
1196
- w(re(t)) || b(131);
1196
+ w(re(t)) || y(131);
1197
1197
  const o = n._config.theme;
1198
1198
  ge(t, o.tableCellSelected);
1199
1199
  }
@@ -1202,53 +1202,53 @@ function we(n) {
1202
1202
  return w(e) ? e : null;
1203
1203
  }
1204
1204
  function pe(n) {
1205
- const e = x(n, k);
1206
- return k(e) ? e : null;
1205
+ const e = x(n, $);
1206
+ return $(e) ? e : null;
1207
1207
  }
1208
- function jn(n, e, t, o, l, s, r) {
1209
- const i = Sn(t.focus, l ? "previous" : "next");
1208
+ function jn(n, e, t, o, r, s, l) {
1209
+ const i = Sn(t.focus, r ? "previous" : "next");
1210
1210
  if (wn(i)) return !1;
1211
1211
  let u = i;
1212
- for (const d of at(i).iterNodeCarets("shadowRoot")) {
1213
- if (!bn(d) || !D(d.origin)) return !1;
1212
+ for (const d of ct(i).iterNodeCarets("shadowRoot")) {
1213
+ if (!yn(d) || !D(d.origin)) return !1;
1214
1214
  u = d;
1215
1215
  }
1216
1216
  const m = u.getParentAtCaret();
1217
1217
  if (!w(m)) return !1;
1218
1218
  const h = m, p = function(d) {
1219
- for (const g of at(d).iterNodeCarets("root")) {
1219
+ for (const g of ct(d).iterNodeCarets("root")) {
1220
1220
  const { origin: _ } = g;
1221
1221
  if (w(_)) {
1222
- if (ct(g)) return yn(_, d.direction);
1223
- } else if (!$(_)) break;
1222
+ if (ut(g)) return bn(_, d.direction);
1223
+ } else if (!A(_)) break;
1224
1224
  }
1225
1225
  return null;
1226
- }(ut(h, u.direction)), C = x(h, k);
1226
+ }(ht(h, u.direction)), C = x(h, $);
1227
1227
  if (!C || !C.is(s)) return !1;
1228
1228
  const a = n.getElementByKey(h.getKey()), c = ke(a);
1229
1229
  if (!a || !c) return !1;
1230
1230
  const f = Vn(n, C);
1231
- if (r.table = f, p) if (o === "extend") {
1231
+ if (l.table = f, p) if (o === "extend") {
1232
1232
  const d = ke(n.getElementByKey(p.origin.getKey()));
1233
1233
  if (!d) return !1;
1234
- r.$setAnchorCellForSelection(c), r.$setFocusCellForSelection(d, !0);
1234
+ l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(d, !0);
1235
1235
  } else {
1236
- const d = ht(p);
1236
+ const d = dt(p);
1237
1237
  Te(t.anchor, d), Te(t.focus, d);
1238
1238
  }
1239
- else if (o === "extend") r.$setAnchorCellForSelection(c), r.$setFocusCellForSelection(c, !0);
1239
+ else if (o === "extend") l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(c, !0);
1240
1240
  else {
1241
1241
  const d = function(g) {
1242
1242
  const _ = Nn(g);
1243
- return ct(_) ? ht(_) : g;
1244
- }(ut(C, i.direction));
1243
+ return ut(_) ? dt(_) : g;
1244
+ }(ht(C, i.direction));
1245
1245
  Te(t.anchor, d), Te(t.focus, d);
1246
1246
  }
1247
1247
  return te(e), !0;
1248
1248
  }
1249
- function Mt(n, e, t, o, l) {
1250
- if ((t === "up" || t === "down") && function(r) {
1251
- const i = r.getRootElement();
1249
+ function Lt(n, e, t, o, r) {
1250
+ if ((t === "up" || t === "down") && function(l) {
1251
+ const i = l.getRootElement();
1252
1252
  return i ? i.hasAttribute("aria-controls") && i.getAttribute("aria-controls") === "typeahead-menu" : !1;
1253
1253
  }(n)) return !1;
1254
1254
  const s = B();
@@ -1256,22 +1256,22 @@ function Mt(n, e, t, o, l) {
1256
1256
  if (z(s)) {
1257
1257
  if (t === "backward") {
1258
1258
  if (s.focus.offset > 0) return !1;
1259
- const r = function(u) {
1259
+ const l = function(u) {
1260
1260
  for (let m = u, h = u; h !== null; m = h, h = h.getParent()) if (D(h)) {
1261
1261
  if (h !== m && h.getFirstChild() !== m) return null;
1262
1262
  if (!h.isInline()) return h;
1263
1263
  }
1264
1264
  return null;
1265
1265
  }(s.focus.getNode());
1266
- if (!r) return !1;
1267
- const i = r.getPreviousSibling();
1268
- return !!k(i) && (te(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1266
+ if (!l) return !1;
1267
+ const i = l.getPreviousSibling();
1268
+ return !!$(i) && (te(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1269
1269
  }
1270
1270
  if (e.shiftKey && (t === "up" || t === "down")) {
1271
- const r = s.focus.getNode();
1271
+ const l = s.focus.getNode();
1272
1272
  if (!s.isCollapsed() && (t === "up" && !s.isBackward() || t === "down" && s.isBackward())) {
1273
- let i = x(r, (C) => k(C));
1274
- if (w(i) && (i = x(i, k)), i !== o || !i) return !1;
1273
+ let i = x(l, (C) => $(C));
1274
+ if (w(i) && (i = x(i, $)), i !== o || !i) return !1;
1275
1275
  const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1276
1276
  if (!u) return !1;
1277
1277
  let m = 0;
@@ -1281,21 +1281,21 @@ function Mt(n, e, t, o, l) {
1281
1281
  const p = s.clone();
1282
1282
  return p.focus.set(h.getKey(), m, Ce(h) ? "text" : "element"), ne(p), te(e), !0;
1283
1283
  }
1284
- if (_n(r)) {
1284
+ if (_n(l)) {
1285
1285
  const i = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
1286
1286
  if (i && Ne(o, i) !== null) {
1287
1287
  const u = o.getFirstDescendant(), m = o.getLastDescendant();
1288
1288
  if (!u || !m) return !1;
1289
- const [h] = G(u), [p] = G(m), C = o.getCordsFromCellNode(h, l.table), a = o.getCordsFromCellNode(p, l.table), c = o.getDOMCellFromCordsOrThrow(C.x, C.y, l.table), f = o.getDOMCellFromCordsOrThrow(a.x, a.y, l.table);
1290
- return l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(f, !0), !0;
1289
+ const [h] = G(u), [p] = G(m), C = o.getCordsFromCellNode(h, r.table), a = o.getCordsFromCellNode(p, r.table), c = o.getDOMCellFromCordsOrThrow(C.x, C.y, r.table), f = o.getDOMCellFromCordsOrThrow(a.x, a.y, r.table);
1290
+ return r.$setAnchorCellForSelection(c), r.$setFocusCellForSelection(f, !0), !0;
1291
1291
  }
1292
1292
  return !1;
1293
1293
  }
1294
1294
  {
1295
- let i = x(r, (m) => D(m) && !m.isInline());
1296
- if (w(i) && (i = x(i, k)), !i) return !1;
1295
+ let i = x(l, (m) => D(m) && !m.isInline());
1296
+ if (w(i) && (i = x(i, $)), !i) return !1;
1297
1297
  const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1298
- if (k(u) && l.tableNodeKey === u.getKey()) {
1298
+ if ($(u) && r.tableNodeKey === u.getKey()) {
1299
1299
  const m = u.getFirstDescendant(), h = u.getLastDescendant();
1300
1300
  if (!m || !h) return !1;
1301
1301
  const [p] = G(m), [C] = G(h), a = s.clone();
@@ -1304,25 +1304,25 @@ function Mt(n, e, t, o, l) {
1304
1304
  }
1305
1305
  }
1306
1306
  }
1307
- return t === "down" && Lt(n) && l.setShouldCheckSelection(), !1;
1307
+ return t === "down" && Ve(n) && r.setShouldCheckSelection(), !1;
1308
1308
  }
1309
1309
  if (z(s)) {
1310
1310
  if (t === "backward" || t === "forward")
1311
- return jn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, l);
1311
+ return jn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
1312
1312
  if (s.isCollapsed()) {
1313
- const { anchor: r, focus: i } = s, u = x(r.getNode(), w), m = x(i.getNode(), w);
1313
+ const { anchor: l, focus: i } = s, u = x(l.getNode(), w), m = x(i.getNode(), w);
1314
1314
  if (!w(u) || !u.is(m)) return !1;
1315
1315
  const h = pe(u);
1316
1316
  if (h !== o && h != null) {
1317
1317
  const g = ie(h, n.getElementByKey(h.getKey()));
1318
- if (g != null) return l.table = me(h, g), Mt(n, e, t, h, l);
1318
+ if (g != null) return r.table = me(h, g), Lt(n, e, t, h, r);
1319
1319
  }
1320
- const p = n.getElementByKey(u.__key), C = n.getElementByKey(r.key);
1320
+ const p = n.getElementByKey(u.__key), C = n.getElementByKey(l.key);
1321
1321
  if (C == null || p == null) return !1;
1322
1322
  let a;
1323
- if (r.type === "element") a = C.getBoundingClientRect();
1323
+ if (l.type === "element") a = C.getBoundingClientRect();
1324
1324
  else {
1325
- const g = $e(nt(n));
1325
+ const g = $e(ot(n));
1326
1326
  if (g === null || g.rangeCount === 0) return !1;
1327
1327
  a = g.getRangeAt(0).getBoundingClientRect();
1328
1328
  }
@@ -1333,25 +1333,25 @@ function Mt(n, e, t, o, l) {
1333
1333
  const d = f.getBoundingClientRect();
1334
1334
  if (t === "up" ? d.top > a.top - a.height : a.bottom + a.height > d.bottom) {
1335
1335
  te(e);
1336
- const g = o.getCordsFromCellNode(u, l.table);
1337
- if (!e.shiftKey) return Xn(l, o, g.x, g.y, t);
1336
+ const g = o.getCordsFromCellNode(u, r.table);
1337
+ if (!e.shiftKey) return Yn(r, o, g.x, g.y, t);
1338
1338
  {
1339
- const _ = o.getDOMCellFromCordsOrThrow(g.x, g.y, l.table);
1340
- l.$setAnchorCellForSelection(_), l.$setFocusCellForSelection(_, !0);
1339
+ const _ = o.getDOMCellFromCordsOrThrow(g.x, g.y, r.table);
1340
+ r.$setAnchorCellForSelection(_), r.$setFocusCellForSelection(_, !0);
1341
1341
  }
1342
1342
  return !0;
1343
1343
  }
1344
1344
  }
1345
- } else if (K(s)) {
1346
- const { anchor: r, focus: i } = s, u = x(r.getNode(), w), m = x(i.getNode(), w), [h] = s.getNodes();
1347
- k(h) || b(251);
1345
+ } else if (O(s)) {
1346
+ const { anchor: l, focus: i } = s, u = x(l.getNode(), w), m = x(i.getNode(), w), [h] = s.getNodes();
1347
+ $(h) || y(251);
1348
1348
  const p = ie(h, n.getElementByKey(h.getKey()));
1349
- if (!w(u) || !w(m) || !k(h) || p == null) return !1;
1350
- l.$updateTableTableSelection(s);
1349
+ if (!w(u) || !w(m) || !$(h) || p == null) return !1;
1350
+ r.$updateTableTableSelection(s);
1351
1351
  const C = me(h, p), a = o.getCordsFromCellNode(u, C), c = o.getDOMCellFromCordsOrThrow(a.x, a.y, C);
1352
- if (l.$setAnchorCellForSelection(c), te(e), e.shiftKey) {
1353
- const [f, d, g] = J(o, u, m);
1354
- return qn(l, f, d, g, t);
1352
+ if (r.$setAnchorCellForSelection(c), te(e), e.shiftKey) {
1353
+ const [f, d, g] = U(o, u, m);
1354
+ return qn(r, f, d, g, t);
1355
1355
  }
1356
1356
  return m.selectEnd(), !0;
1357
1357
  }
@@ -1360,22 +1360,22 @@ function Mt(n, e, t, o, l) {
1360
1360
  function te(n) {
1361
1361
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1362
1362
  }
1363
- function St(n, e, t) {
1363
+ function wt(n, e, t) {
1364
1364
  const o = I();
1365
1365
  n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
1366
1366
  }
1367
- function wt(n, e, t) {
1367
+ function yt(n, e, t) {
1368
1368
  const o = t.getParent();
1369
1369
  if (!o) return;
1370
- const l = $e(nt(n));
1371
- if (!l) return;
1372
- const s = l.anchorNode, r = n.getElementByKey(o.getKey()), i = ie(t, n.getElementByKey(t.getKey()));
1373
- if (!s || !r || !i || !r.contains(s) || i.contains(s)) return;
1370
+ const r = $e(ot(n));
1371
+ if (!r) return;
1372
+ const s = r.anchorNode, l = n.getElementByKey(o.getKey()), i = ie(t, n.getElementByKey(t.getKey()));
1373
+ if (!s || !l || !i || !l.contains(s) || i.contains(s)) return;
1374
1374
  const u = x(e.anchor.getNode(), (_) => w(_));
1375
1375
  if (!u) return;
1376
- const m = x(u, (_) => k(_));
1377
- if (!k(m) || !m.is(t)) return;
1378
- const [h, p] = J(t, u, u), C = h[0][0], a = h[h.length - 1][h[0].length - 1], { startRow: c, startColumn: f } = p, d = c === C.startRow && f === C.startColumn, g = c === a.startRow && f === a.startColumn;
1376
+ const m = x(u, (_) => $(_));
1377
+ if (!$(m) || !m.is(t)) return;
1378
+ const [h, p] = U(t, u, u), C = h[0][0], a = h[h.length - 1][h[0].length - 1], { startRow: c, startColumn: f } = p, d = c === C.startRow && f === C.startColumn, g = c === a.startRow && f === a.startColumn;
1379
1379
  return d ? "first" : g ? "last" : void 0;
1380
1380
  }
1381
1381
  function se(n, e) {
@@ -1387,21 +1387,21 @@ function qe(n, e, t) {
1387
1387
  }
1388
1388
  function bt(n, e, t) {
1389
1389
  if (!e.theme.tableAlignment) return;
1390
- const o = [], l = [];
1390
+ const o = [], r = [];
1391
1391
  for (const s of ["center", "right"]) {
1392
- const r = e.theme.tableAlignment[s];
1393
- r && (s === t ? l : o).push(r);
1392
+ const l = e.theme.tableAlignment[s];
1393
+ l && (s === t ? r : o).push(l);
1394
1394
  }
1395
- ge(n, ...o), Q(n, ...l);
1395
+ ge(n, ...o), Q(n, ...r);
1396
1396
  }
1397
1397
  const je = /* @__PURE__ */ new WeakSet();
1398
- function Lt(n = vt()) {
1398
+ function Ve(n = xt()) {
1399
1399
  return je.has(n);
1400
1400
  }
1401
1401
  function uo(n, e) {
1402
1402
  e ? je.add(n) : je.delete(n);
1403
1403
  }
1404
- class ae extends Ve {
1404
+ class ae extends Ze {
1405
1405
  static getType() {
1406
1406
  return "table";
1407
1407
  }
@@ -1422,7 +1422,7 @@ class ae extends Ve {
1422
1422
  return { table: (e) => ({ conversion: Zn, priority: 1 }) };
1423
1423
  }
1424
1424
  static importJSON(e) {
1425
- return rt().updateFromJSON(e);
1425
+ return lt().updateFromJSON(e);
1426
1426
  }
1427
1427
  updateFromJSON(e) {
1428
1428
  return super.updateFromJSON(e).setRowStriping(e.rowStriping || !1).setFrozenColumns(e.frozenColumnCount || 0).setFrozenRows(e.frozenRowCount || 0).setColWidths(e.colWidths);
@@ -1438,33 +1438,33 @@ class ae extends Ve {
1438
1438
  }
1439
1439
  getDOMSlot(e) {
1440
1440
  const t = de(e) ? e : e.querySelector("table");
1441
- return de(t) || b(229), super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"));
1441
+ return de(t) || y(229), super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"));
1442
1442
  }
1443
1443
  createDOM(e, t) {
1444
1444
  const o = document.createElement("table");
1445
1445
  this.__style && (o.style.cssText = this.__style);
1446
- const l = document.createElement("colgroup");
1447
- if (o.appendChild(l), Vt(l), Q(o, e.theme.table), this.updateTableElement(null, o, e), Lt(t)) {
1448
- const s = document.createElement("div"), r = e.theme.tableScrollableWrapper;
1449
- return r ? Q(s, r) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
1446
+ const r = document.createElement("colgroup");
1447
+ if (o.appendChild(r), Vt(r), Q(o, e.theme.table), this.updateTableElement(null, o, e), Ve(t)) {
1448
+ const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
1449
+ return l ? Q(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
1450
1450
  }
1451
1451
  return o;
1452
1452
  }
1453
- updateTableWrapper(e, t, o, l) {
1454
- this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function(s, r, i, u) {
1455
- u > 0 ? (Q(s, i.theme.tableFrozenColumn), r.setAttribute("data-lexical-frozen-column", "true")) : (ge(s, i.theme.tableFrozenColumn), r.removeAttribute("data-lexical-frozen-column"));
1456
- }(t, o, l, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function(s, r, i, u) {
1457
- u > 0 ? (Q(s, i.theme.tableFrozenRow), r.setAttribute("data-lexical-frozen-row", "true")) : (ge(s, i.theme.tableFrozenRow), r.removeAttribute("data-lexical-frozen-row"));
1458
- }(t, o, l, this.__frozenRowCount);
1453
+ updateTableWrapper(e, t, o, r) {
1454
+ this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function(s, l, i, u) {
1455
+ u > 0 ? (Q(s, i.theme.tableFrozenColumn), l.setAttribute("data-lexical-frozen-column", "true")) : (ge(s, i.theme.tableFrozenColumn), l.removeAttribute("data-lexical-frozen-column"));
1456
+ }(t, o, r, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function(s, l, i, u) {
1457
+ u > 0 ? (Q(s, i.theme.tableFrozenRow), l.setAttribute("data-lexical-frozen-row", "true")) : (ge(s, i.theme.tableFrozenRow), l.removeAttribute("data-lexical-frozen-row"));
1458
+ }(t, o, r, this.__frozenRowCount);
1459
1459
  }
1460
1460
  updateTableElement(e, t, o) {
1461
- this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function(l, s, r) {
1462
- r ? (Q(l, s.theme.tableRowStriping), l.setAttribute("data-lexical-row-striping", "true")) : (ge(l, s.theme.tableRowStriping), l.removeAttribute("data-lexical-row-striping"));
1463
- }(t, o, this.__rowStriping), function(l, s, r, i) {
1464
- const u = l.querySelector("colgroup");
1461
+ this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function(r, s, l) {
1462
+ l ? (Q(r, s.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (ge(r, s.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
1463
+ }(t, o, this.__rowStriping), function(r, s, l, i) {
1464
+ const u = r.querySelector("colgroup");
1465
1465
  if (!u) return;
1466
1466
  const m = [];
1467
- for (let h = 0; h < r; h++) {
1467
+ for (let h = 0; h < l; h++) {
1468
1468
  const p = document.createElement("col"), C = i && i[h];
1469
1469
  C && (p.style.width = `${C}px`), m.push(p);
1470
1470
  }
@@ -1472,44 +1472,44 @@ class ae extends Ve {
1472
1472
  }(t, 0, this.getColumnCount(), this.getColWidths()), bt(t, o, this.getFormatType());
1473
1473
  }
1474
1474
  updateDOM(e, t, o) {
1475
- const l = this.getDOMSlot(t).element;
1475
+ const r = this.getDOMSlot(t).element;
1476
+ return t === r === Ve() || (be(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, r, o), this.updateTableElement(e, r, o), !1);
1476
1477
  var s;
1477
- return ye(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, l, o), this.updateTableElement(e, this.getDOMSlot(t).element, o), !1;
1478
1478
  }
1479
1479
  exportDOM(e) {
1480
1480
  const t = super.exportDOM(e), { element: o } = t;
1481
- return { after: (l) => {
1482
- if (t.after && (l = t.after(l)), !de(l) && ye(l) && (l = l.querySelector("table")), !de(l)) return null;
1483
- bt(l, e._config, this.getFormatType());
1484
- const [s] = oe(this, null, null), r = /* @__PURE__ */ new Map();
1481
+ return { after: (r) => {
1482
+ if (t.after && (r = t.after(r)), !de(r) && be(r) && (r = r.querySelector("table")), !de(r)) return null;
1483
+ bt(r, e._config, this.getFormatType());
1484
+ const [s] = oe(this, null, null), l = /* @__PURE__ */ new Map();
1485
1485
  for (const h of s) for (const p of h) {
1486
1486
  const C = p.cell.getKey();
1487
- r.has(C) || r.set(C, { colSpan: p.cell.getColSpan(), startColumn: p.startColumn });
1487
+ l.has(C) || l.set(C, { colSpan: p.cell.getColSpan(), startColumn: p.startColumn });
1488
1488
  }
1489
1489
  const i = /* @__PURE__ */ new Set();
1490
- for (const h of l.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
1490
+ for (const h of r.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
1491
1491
  const p = h.getAttribute("data-temporary-table-cell-lexical-key");
1492
1492
  if (p) {
1493
- const C = r.get(p);
1493
+ const C = l.get(p);
1494
1494
  if (h.removeAttribute("data-temporary-table-cell-lexical-key"), C) {
1495
- r.delete(p);
1495
+ l.delete(p);
1496
1496
  for (let a = 0; a < C.colSpan; a++) i.add(a + C.startColumn);
1497
1497
  }
1498
1498
  }
1499
1499
  }
1500
- const u = l.querySelector(":scope > colgroup");
1500
+ const u = r.querySelector(":scope > colgroup");
1501
1501
  if (u) {
1502
- const h = Array.from(l.querySelectorAll(":scope > colgroup > col")).filter((p, C) => i.has(C));
1502
+ const h = Array.from(r.querySelectorAll(":scope > colgroup > col")).filter((p, C) => i.has(C));
1503
1503
  u.replaceChildren(...h);
1504
1504
  }
1505
- const m = l.querySelectorAll(":scope > tr");
1505
+ const m = r.querySelectorAll(":scope > tr");
1506
1506
  if (m.length > 0) {
1507
1507
  const h = document.createElement("tbody");
1508
1508
  for (const p of m) h.appendChild(p);
1509
- l.append(h);
1509
+ r.append(h);
1510
1510
  }
1511
- return l;
1512
- }, element: !de(o) && ye(o) ? o.querySelector("table") : o };
1511
+ return r;
1512
+ }, element: !de(o) && be(o) ? o.querySelector("table") : o };
1513
1513
  }
1514
1514
  canBeEmpty() {
1515
1515
  return !1;
@@ -1518,11 +1518,11 @@ class ae extends Ve {
1518
1518
  return !0;
1519
1519
  }
1520
1520
  getCordsFromCellNode(e, t) {
1521
- const { rows: o, domRows: l } = t;
1521
+ const { rows: o, domRows: r } = t;
1522
1522
  for (let s = 0; s < o; s++) {
1523
- const r = l[s];
1524
- if (r != null) for (let i = 0; i < r.length; i++) {
1525
- const u = r[i];
1523
+ const l = r[s];
1524
+ if (l != null) for (let i = 0; i < l.length; i++) {
1525
+ const u = l[i];
1526
1526
  if (u == null) continue;
1527
1527
  const { elem: m } = u, h = qe(this, m);
1528
1528
  if (h !== null && e.is(h)) return { x: i, y: s };
@@ -1531,26 +1531,26 @@ class ae extends Ve {
1531
1531
  throw new Error("Cell not found in table.");
1532
1532
  }
1533
1533
  getDOMCellFromCords(e, t, o) {
1534
- const { domRows: l } = o, s = l[t];
1534
+ const { domRows: r } = o, s = r[t];
1535
1535
  if (s == null) return null;
1536
- const r = s[e < s.length ? e : s.length - 1];
1537
- return r ?? null;
1536
+ const l = s[e < s.length ? e : s.length - 1];
1537
+ return l ?? null;
1538
1538
  }
1539
1539
  getDOMCellFromCordsOrThrow(e, t, o) {
1540
- const l = this.getDOMCellFromCords(e, t, o);
1541
- if (!l) throw new Error("Cell not found at cords.");
1542
- return l;
1540
+ const r = this.getDOMCellFromCords(e, t, o);
1541
+ if (!r) throw new Error("Cell not found at cords.");
1542
+ return r;
1543
1543
  }
1544
1544
  getCellNodeFromCords(e, t, o) {
1545
- const l = this.getDOMCellFromCords(e, t, o);
1546
- if (l == null) return null;
1547
- const s = re(l.elem);
1545
+ const r = this.getDOMCellFromCords(e, t, o);
1546
+ if (r == null) return null;
1547
+ const s = re(r.elem);
1548
1548
  return w(s) ? s : null;
1549
1549
  }
1550
1550
  getCellNodeFromCordsOrThrow(e, t, o) {
1551
- const l = this.getCellNodeFromCords(e, t, o);
1552
- if (!l) throw new Error("Node at cords not TableCellNode.");
1553
- return l;
1551
+ const r = this.getCellNodeFromCords(e, t, o);
1552
+ if (!r) throw new Error("Node at cords not TableCellNode.");
1553
+ return r;
1554
1554
  }
1555
1555
  getRowStriping() {
1556
1556
  return !!this.getLatest().__rowStriping;
@@ -1590,17 +1590,17 @@ class ae extends Ve {
1590
1590
  }
1591
1591
  function Vn(n, e) {
1592
1592
  const t = n.getElementByKey(e.getKey());
1593
- return t === null && b(230), me(e, t);
1593
+ return t === null && y(230), me(e, t);
1594
1594
  }
1595
1595
  function Zn(n) {
1596
- const e = rt();
1596
+ const e = lt();
1597
1597
  n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
1598
1598
  const t = n.querySelector(":scope > colgroup");
1599
1599
  if (t) {
1600
1600
  let o = [];
1601
- for (const l of t.querySelectorAll(":scope > col")) {
1602
- let s = l.style.width || "";
1603
- if (!et.test(s) && (s = l.getAttribute("width") || "", !/^\d+$/.test(s))) {
1601
+ for (const r of t.querySelectorAll(":scope > col")) {
1602
+ let s = r.style.width || "";
1603
+ if (!tt.test(s) && (s = r.getAttribute("width") || "", !/^\d+$/.test(s))) {
1604
1604
  o = void 0;
1605
1605
  break;
1606
1606
  }
@@ -1608,44 +1608,44 @@ function Zn(n) {
1608
1608
  }
1609
1609
  o && e.setColWidths(o);
1610
1610
  }
1611
- return { after: (o) => yt(o, $), node: e };
1611
+ return { after: (o) => Nt(o, A), node: e };
1612
1612
  }
1613
- function rt() {
1614
- return Ze(new ae());
1613
+ function lt() {
1614
+ return Qe(new ae());
1615
1615
  }
1616
- function k(n) {
1616
+ function $(n) {
1617
1617
  return n instanceof ae;
1618
1618
  }
1619
1619
  function Qn({ rows: n, columns: e, includeHeaders: t }) {
1620
- const o = B() || Ue();
1620
+ const o = B() || Je();
1621
1621
  if (!o || !z(o) || pe(o.anchor.getNode())) return !1;
1622
- const l = En(Number(n), Number(e), t);
1623
- Xt(l);
1624
- const s = l.getFirstDescendant();
1622
+ const r = En(Number(n), Number(e), t);
1623
+ Yt(r);
1624
+ const s = r.getFirstDescendant();
1625
1625
  return Ce(s) && s.select(), !0;
1626
1626
  }
1627
1627
  function Gn(n) {
1628
- $(n.getParent()) ? n.isEmpty() && n.append(I()) : n.remove();
1628
+ A(n.getParent()) ? n.isEmpty() && n.append(I()) : n.remove();
1629
1629
  }
1630
1630
  function eo(n) {
1631
- k(n.getParent()) ? Nt(n, w) : n.remove();
1631
+ $(n.getParent()) ? vt(n, w) : n.remove();
1632
1632
  }
1633
1633
  function to(n) {
1634
- Nt(n, $);
1635
- const [e] = oe(n, null, null), t = e.reduce((l, s) => Math.max(l, s.length), 0), o = n.getChildren();
1636
- for (let l = 0; l < e.length; ++l) {
1637
- const s = o[l];
1634
+ vt(n, A);
1635
+ const [e] = oe(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
1636
+ for (let r = 0; r < e.length; ++r) {
1637
+ const s = o[r];
1638
1638
  if (!s) continue;
1639
- $(s) || b(254, s.constructor.name, s.getType());
1640
- const r = e[l].reduce((i, u) => u ? 1 + i : i, 0);
1641
- if (r !== t) for (let i = r; i < t; ++i) {
1642
- const u = Y();
1639
+ A(s) || y(254, s.constructor.name, s.getType());
1640
+ const l = e[r].reduce((i, u) => u ? 1 + i : i, 0);
1641
+ if (l !== t) for (let i = l; i < t; ++i) {
1642
+ const u = X();
1643
1643
  u.append(I()), s.append(u);
1644
1644
  }
1645
1645
  }
1646
1646
  }
1647
1647
  function no(n) {
1648
- if (n.detail < 3 || !be(n.target)) return !1;
1648
+ if (n.detail < 3 || !ye(n.target)) return !1;
1649
1649
  const e = re(n.target);
1650
1650
  if (e === null) return !1;
1651
1651
  const t = x(e, (o) => D(o) && !o.isInline());
@@ -1654,20 +1654,20 @@ function no(n) {
1654
1654
  function ho(n) {
1655
1655
  return n.registerNodeTransform(ce, (e) => {
1656
1656
  if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
1657
- const [, , t] = G(e), [o] = J(t, e, e), l = o.length, s = o[0].length;
1658
- let r = t.getFirstChild();
1659
- $(r) || b(175);
1657
+ const [, , t] = G(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
1658
+ let l = t.getFirstChild();
1659
+ A(l) || y(175);
1660
1660
  const i = [];
1661
- for (let u = 0; u < l; u++) {
1662
- u !== 0 && (r = r.getNextSibling(), $(r) || b(175));
1661
+ for (let u = 0; u < r; u++) {
1662
+ u !== 0 && (l = l.getNextSibling(), A(l) || y(175));
1663
1663
  let m = null;
1664
1664
  for (let h = 0; h < s; h++) {
1665
1665
  const p = o[u][h], C = p.cell;
1666
1666
  if (p.startRow === u && p.startColumn === h) m = C, i.push(C);
1667
1667
  else if (C.getColSpan() > 1 || C.getRowSpan() > 1) {
1668
- w(C) || b(176);
1669
- const a = Y(C.__headerState);
1670
- m !== null ? m.insertAfter(a) : Yt(r, a);
1668
+ w(C) || y(176);
1669
+ const a = X(C.__headerState);
1670
+ m !== null ? m.insertAfter(a) : Xt(l, a);
1671
1671
  }
1672
1672
  }
1673
1673
  }
@@ -1676,45 +1676,46 @@ function ho(n) {
1676
1676
  });
1677
1677
  }
1678
1678
  function fo(n, e = !0) {
1679
- const t = /* @__PURE__ */ new Map(), o = (s, r, i) => {
1680
- const u = ie(s, i), m = Yn(s, u, n, e);
1681
- t.set(r, [m, u]);
1682
- }, l = n.registerMutationListener(ae, (s) => {
1679
+ const t = /* @__PURE__ */ new Map(), o = (s, l, i) => {
1680
+ const u = ie(s, i), m = Xn(s, u, n, e);
1681
+ t.set(l, [m, u]);
1682
+ }, r = n.registerMutationListener(ae, (s) => {
1683
1683
  n.getEditorState().read(() => {
1684
- for (const [r, i] of s) {
1685
- const u = t.get(r);
1684
+ for (const [l, i] of s) {
1685
+ const u = t.get(l);
1686
1686
  if (i === "created" || i === "updated") {
1687
- const { tableNode: m, tableElement: h } = Et(r);
1688
- u === void 0 ? o(m, r, h) : h !== u[1] && (u[0].removeListeners(), t.delete(r), o(m, r, h));
1689
- } else i === "destroyed" && u !== void 0 && (u[0].removeListeners(), t.delete(r));
1687
+ const { tableNode: m, tableElement: h } = kt(l);
1688
+ u === void 0 ? o(m, l, h) : h !== u[1] && (u[0].removeListeners(), t.delete(l), o(m, l, h));
1689
+ } else i === "destroyed" && u !== void 0 && (u[0].removeListeners(), t.delete(l));
1690
1690
  }
1691
1691
  }, { editor: n });
1692
1692
  }, { skipInitialization: !1 });
1693
1693
  return () => {
1694
- l();
1694
+ r();
1695
1695
  for (const [, [s]] of t) s.removeListeners();
1696
1696
  };
1697
1697
  }
1698
1698
  function go(n) {
1699
- return n.hasNodes([ae]) || b(255), Jt(n.registerCommand(On, Qn, Be), n.registerCommand(xt, ({ nodes: e, selection: t }) => z(t) ? pe(t.anchor.getNode()) !== null && e.some(k) : !1, Be), n.registerCommand(Zt, no, Be), n.registerNodeTransform(ae, to), n.registerNodeTransform(xe, eo), n.registerNodeTransform(ce, Gn));
1699
+ return n.hasNodes([ae]) || y(255), Ut(n.registerCommand(Kn, Qn, Be), n.registerCommand(Tt, ({ nodes: e, selection: t }) => z(t) ? pe(t.anchor.getNode()) !== null && e.some($) : !1, Be), n.registerCommand(Zt, no, Be), n.registerNodeTransform(ae, to), n.registerNodeTransform(xe, eo), n.registerNodeTransform(ce, Gn));
1700
1700
  }
1701
1701
  export {
1702
1702
  ao as B,
1703
- Ft as H,
1703
+ Kt as H,
1704
1704
  ve as K,
1705
- so as L,
1705
+ En as L,
1706
1706
  xe as O,
1707
1707
  io as P,
1708
1708
  w as R,
1709
1709
  ho as S,
1710
- En as W,
1710
+ so as W,
1711
1711
  co as Z,
1712
1712
  ae as a,
1713
1713
  go as b,
1714
1714
  uo as c,
1715
+ Ve as s,
1715
1716
  fo as w,
1716
- Y as x,
1717
+ X as x,
1717
1718
  ce as y,
1718
1719
  Ot as z
1719
1720
  };
1720
- //# sourceMappingURL=LexicalTable.prod-rZbTmo9K.js.map
1721
+ //# sourceMappingURL=LexicalTable.prod-osQj1CQX.js.map