@uva-glass/component-library 3.0.13 → 3.0.14

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