@uva-glass/component-library 1.59.3 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{Lexical.prod-BhH9TCLN.js → Lexical.prod-qM_1BY0u.js} +63 -62
  2. package/dist/{Lexical.prod-BhH9TCLN.js.map → Lexical.prod-qM_1BY0u.js.map} +1 -1
  3. package/dist/{LexicalUtils.prod-Bsuvahba.js → LexicalUtils.prod-BFSPHHi1.js} +2 -2
  4. package/dist/{LexicalUtils.prod-Bsuvahba.js.map → LexicalUtils.prod-BFSPHHi1.js.map} +1 -1
  5. package/dist/ListPlugin-Bhkh3IBK.js +625 -0
  6. package/dist/ListPlugin-Bhkh3IBK.js.map +1 -0
  7. package/dist/RteEditor.module-Cku3JY-0.js +29 -0
  8. package/dist/RteEditor.module-Cku3JY-0.js.map +1 -0
  9. package/dist/TablePlugin-CLPV2OjO.js +294 -0
  10. package/dist/TablePlugin-CLPV2OjO.js.map +1 -0
  11. package/dist/assets/EditorHeader.css +1 -1
  12. package/dist/assets/Periods.css +1 -1
  13. package/dist/assets/RteEditor.css +1 -1
  14. package/dist/assets/TableCellContextMenu.css +1 -1
  15. package/dist/assets/TablePlugin.css +1 -1
  16. package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
  17. package/dist/components/InputField/InputField.stories.js +2 -2
  18. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  19. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  20. package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
  21. package/dist/components/MultiSelect/index.js +1 -1
  22. package/dist/components/Periods/Periods.js +19 -19
  23. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
  24. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +19 -19
  25. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
  26. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.d.ts +1 -6
  27. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +34 -20
  28. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
  29. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +36 -31
  30. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +3 -3
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +4 -4
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +7 -6
  34. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +157 -54
  35. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  36. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +1 -3
  37. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +5 -6
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
  39. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +3 -2
  40. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.d.ts +1 -6
  41. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +10 -31
  42. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  43. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  44. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  45. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +2 -1
  46. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +104 -31
  47. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
  48. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -5
  49. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  50. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +1 -1
  51. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  52. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +6 -7
  53. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +43 -47
  54. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  55. package/dist/components/RteEditor/Plugins/index.js +13 -12
  56. package/dist/components/RteEditor/RteEditor.d.ts +13 -4
  57. package/dist/components/RteEditor/RteEditor.js +408 -416
  58. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  59. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  60. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  61. package/dist/components/RteEditor/hooks/useTranslation.d.ts +98 -6
  62. package/dist/components/RteEditor/translations.d.ts +98 -6
  63. package/dist/components/RteEditor/translations.js +104 -12
  64. package/dist/components/RteEditor/translations.js.map +1 -1
  65. package/dist/components/index.js +1 -1
  66. package/dist/{helpers-BRIyyVa6.js → helpers-BB6Byf50.js} +88 -99
  67. package/dist/helpers-BB6Byf50.js.map +1 -0
  68. package/dist/{helpers-CaU5T9i-.js → helpers-D9T1Tgkj.js} +454 -427
  69. package/dist/helpers-D9T1Tgkj.js.map +1 -0
  70. package/dist/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/LexicalList.prod-Czb3Osbz.js +0 -564
  73. package/dist/LexicalList.prod-Czb3Osbz.js.map +0 -1
  74. package/dist/RteEditor.module-Dz9a8vaK.js +0 -29
  75. package/dist/RteEditor.module-Dz9a8vaK.js.map +0 -1
  76. package/dist/TablePlugin-deK-rcE1.js +0 -249
  77. package/dist/TablePlugin-deK-rcE1.js.map +0 -1
  78. package/dist/helpers-BRIyyVa6.js.map +0 -1
  79. package/dist/helpers-CaU5T9i-.js.map +0 -1
@@ -1,16 +1,16 @@
1
- import { i as Ze, $ as ue, t as N, U as Qe } from "./LexicalUtils.prod-Bsuvahba.js";
2
- import { C as Nt, X as xt, i as et, m as T, j as vt, N as tt, J as nt, w as ve, k as ot, c as $, v as rt, n as De, a as st, P as Ne, p as Ae, T as Le, F as V, x as A, A as P, q as Tt, s as lt, u as Ot, z as Et, B, E as Mt, G as Ft, f as Te, l as Oe, y as Ee, U as Rt, t as Kt, H as Y, I as kt, L as Q, Q as Pt, R as Dt, V as At, W as Lt, Y as Ht, a0 as He, a1 as Bt, a2 as Wt, a3 as It, a4 as zt, d as Ut, a5 as Jt, a6 as Yt, a7 as Xt, a8 as jt, a9 as se, M as qt, aa as q, ab as $t, o as Gt, ac as ae, ad as Vt, D as it, ae as Zt, af as Qt, ag as en, ah as Be } from "./Lexical.prod-BhH9TCLN.js";
3
- function tn(n) {
1
+ import { i as et, t as _, $ as ue, U as tt } from "./LexicalUtils.prod-BFSPHHi1.js";
2
+ import { C as Tt, X as Et, k as nt, b as T, n as Ot, N as ot, J as rt, w as Ee, p as st, c as $, v as lt, q as Le, a as it, P as ve, s as He, T as Be, F as V, x as A, A as D, u as Mt, z as at, B as Ft, E as Rt, G as B, H as Kt, I as kt, f as Oe, l as Me, y as Fe, U as Dt, t as Pt, Q as Y, R as At, V as Q, W as Lt, Y as Ht, a0 as Bt, a1 as Wt, a2 as It, a3 as We, a4 as zt, a5 as Ut, a6 as Jt, a7 as Yt, d as Xt, a8 as jt, a9 as qt, aa as $t, ab as Gt, e as se, M as Vt, ac as q, ad as Zt, o as Qt, ae, af as en, D as ct, ag as tn, ah as nn, ai as on, aj as Ie } from "./Lexical.prod-qM_1BY0u.js";
3
+ function rn(n) {
4
4
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
5
5
  }
6
- tn(function(n) {
6
+ rn(function(n) {
7
7
  const e = new URLSearchParams();
8
8
  e.append("code", n);
9
9
  for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
10
10
  throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
11
11
  });
12
- const nn = /* @__PURE__ */ new Map();
13
- function on(n) {
12
+ const sn = /* @__PURE__ */ new Map();
13
+ function ln(n) {
14
14
  const e = {};
15
15
  if (!n) return e;
16
16
  const t = n.split(";");
@@ -20,50 +20,50 @@ function on(n) {
20
20
  }
21
21
  return e;
22
22
  }
23
- function at(n, e) {
23
+ function ut(n, e) {
24
24
  const t = n.getStartEndPoints();
25
25
  if (e.isSelected(n) && !e.isSegmented() && !e.isToken() && t !== null) {
26
26
  const [o, s] = t, r = n.isBackward(), l = o.getNode(), a = s.getNode(), d = e.is(l), h = e.is(a);
27
27
  if (d || h) {
28
- const [i, c] = Nt(n), u = l.is(a), g = e.is(r ? a : l), f = e.is(r ? l : a);
28
+ const [i, c] = Tt(n), u = l.is(a), g = e.is(r ? a : l), f = e.is(r ? l : a);
29
29
  let p, w = 0;
30
30
  return u ? (w = i > c ? c : i, p = i > c ? i : c) : g ? (w = r ? c : i, p = void 0) : f && (w = 0, p = r ? i : c), e.__text = e.__text.slice(w, p), e;
31
31
  }
32
32
  }
33
33
  return e;
34
34
  }
35
- function rn(n) {
36
- const e = n.getStyle(), t = on(e);
37
- nn.set(e, t);
35
+ function an(n) {
36
+ const e = n.getStyle(), t = ln(e);
37
+ sn.set(e, t);
38
38
  }
39
- function kn(n, e) {
40
- const t = xt(n.focus, e);
41
- return et(t) && !t.isIsolated() || T(t) && !t.isInline() && !t.canBeEmpty();
39
+ function Ln(n, e) {
40
+ const t = Et(n.focus, e);
41
+ return nt(t) && !t.isIsolated() || T(t) && !t.isInline() && !t.canBeEmpty();
42
42
  }
43
- function sn(n, e, t, o) {
43
+ function cn(n, e, t, o) {
44
44
  n.modify(e ? "extend" : "move", t, o);
45
45
  }
46
- function ln(n) {
46
+ function un(n) {
47
47
  const e = n.anchor.getNode();
48
- return (vt(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
48
+ return (Ot(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
49
49
  }
50
- function Pn(n, e, t) {
51
- const o = ln(n);
52
- sn(n, e, t ? !o : o, "character");
50
+ function Hn(n, e, t) {
51
+ const o = un(n);
52
+ cn(n, e, t ? !o : o, "character");
53
53
  }
54
- function an(n, e) {
54
+ function dn(n, e) {
55
55
  const t = e.body ? e.body.childNodes : [];
56
56
  let o = [];
57
57
  const s = [];
58
58
  for (let r = 0; r < t.length; r++) {
59
59
  const l = t[r];
60
- if (!ut.has(l.nodeName)) {
61
- const a = dt(l, n, s, !1);
60
+ if (!ht.has(l.nodeName)) {
61
+ const a = gt(l, n, s, !1);
62
62
  a !== null && (o = o.concat(a));
63
63
  }
64
64
  }
65
65
  return function(r) {
66
- for (const l of r) l.getNextSibling() instanceof tt && l.insertAfter(nt());
66
+ for (const l of r) l.getNextSibling() instanceof ot && l.insertAfter(rt());
67
67
  for (const l of r) {
68
68
  const a = l.getChildren();
69
69
  for (const d of a) l.insertBefore(d);
@@ -71,20 +71,20 @@ function an(n, e) {
71
71
  }
72
72
  }(s), o;
73
73
  }
74
- function cn(n, e) {
74
+ function hn(n, e) {
75
75
  if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
76
- const t = document.createElement("div"), o = ve().getChildren();
76
+ const t = document.createElement("div"), o = Ee().getChildren();
77
77
  for (let s = 0; s < o.length; s++)
78
- ct(n, o[s], t, e);
78
+ dt(n, o[s], t, e);
79
79
  return t.innerHTML;
80
80
  }
81
- function ct(n, e, t, o = null) {
81
+ function dt(n, e, t, o = null) {
82
82
  let s = o === null || e.isSelected(o);
83
83
  const r = T(e) && e.excludeFromCopy("html");
84
84
  let l = e;
85
85
  if (o !== null) {
86
- let g = ot(e);
87
- g = $(g) && o !== null ? at(o, g) : g, l = g;
86
+ let g = st(e);
87
+ g = $(g) && o !== null ? ut(o, g) : g, l = g;
88
88
  }
89
89
  const a = T(l) ? l.getChildren() : [], d = n._nodes.get(l.getType());
90
90
  let h;
@@ -93,30 +93,30 @@ function ct(n, e, t, o = null) {
93
93
  if (!i) return !1;
94
94
  const u = document.createDocumentFragment();
95
95
  for (let g = 0; g < a.length; g++) {
96
- const f = a[g], p = ct(n, f, u, o);
96
+ const f = a[g], p = dt(n, f, u, o);
97
97
  !s && T(e) && p && e.extractWithChild(f, o, "html") && (s = !0);
98
98
  }
99
99
  if (s && !r) {
100
- if ((rt(i) || De(i)) && i.append(u), t.append(i), c) {
100
+ if ((lt(i) || Le(i)) && i.append(u), t.append(i), c) {
101
101
  const g = c.call(l, i);
102
- g && (De(i) ? i.replaceChildren(g) : i.replaceWith(g));
102
+ g && (Le(i) ? i.replaceChildren(g) : i.replaceWith(g));
103
103
  }
104
104
  } else t.append(u);
105
105
  return s;
106
106
  }
107
- const ut = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
108
- function dt(n, e, t, o, s = /* @__PURE__ */ new Map(), r) {
107
+ const ht = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
108
+ function gt(n, e, t, o, s = /* @__PURE__ */ new Map(), r) {
109
109
  let l = [];
110
- if (ut.has(n.nodeName)) return l;
110
+ if (ht.has(n.nodeName)) return l;
111
111
  let a = null;
112
112
  const d = function(f, p) {
113
113
  const { nodeName: w } = f, C = p._htmlConversions.get(w.toLowerCase());
114
- let _ = null;
115
- if (C !== void 0) for (const O of C) {
116
- const v = O(f);
117
- v !== null && (_ === null || (_.priority || 0) < (v.priority || 0)) && (_ = v);
114
+ let x = null;
115
+ if (C !== void 0) for (const E of C) {
116
+ const v = E(f);
117
+ v !== null && (x === null || (x.priority || 0) < (v.priority || 0)) && (x = v);
118
118
  }
119
- return _ !== null ? _.conversion : null;
119
+ return x !== null ? x.conversion : null;
120
120
  }(n, e), h = d ? d(n) : null;
121
121
  let i = null;
122
122
  if (h !== null) {
@@ -130,50 +130,50 @@ function dt(n, e, t, o, s = /* @__PURE__ */ new Map(), r) {
130
130
  }
131
131
  const c = n.childNodes;
132
132
  let u = [];
133
- const g = (a == null || !st(a)) && (a != null && Ne(a) || o);
134
- for (let f = 0; f < c.length; f++) u.push(...dt(c[f], e, t, g, new Map(s), a));
135
- return i != null && (u = i(u)), Ae(n) && (u = un(n, u, g ? () => {
136
- const f = new tt();
133
+ const g = (a == null || !it(a)) && (a != null && ve(a) || o);
134
+ for (let f = 0; f < c.length; f++) u.push(...gt(c[f], e, t, g, new Map(s), a));
135
+ return i != null && (u = i(u)), He(n) && (u = gn(n, u, g ? () => {
136
+ const f = new ot();
137
137
  return t.push(f), f;
138
- } : V)), a == null ? u.length > 0 ? l = l.concat(u) : Ae(n) && function(f) {
139
- return f.nextSibling == null || f.previousSibling == null ? !1 : Le(f.nextSibling) && Le(f.previousSibling);
140
- }(n) && (l = l.concat(nt())) : T(a) && a.append(...u), l;
138
+ } : V)), a == null ? u.length > 0 ? l = l.concat(u) : He(n) && function(f) {
139
+ return f.nextSibling == null || f.previousSibling == null ? !1 : Be(f.nextSibling) && Be(f.previousSibling);
140
+ }(n) && (l = l.concat(rt())) : T(a) && a.append(...u), l;
141
141
  }
142
- function un(n, e, t) {
142
+ function gn(n, e, t) {
143
143
  const o = n.style.textAlign, s = [];
144
144
  let r = [];
145
145
  for (let l = 0; l < e.length; l++) {
146
146
  const a = e[l];
147
- if (Ne(a)) o && !a.getFormat() && a.setFormat(o), s.push(a);
148
- else if (r.push(a), l === e.length - 1 || l < e.length - 1 && Ne(e[l + 1])) {
147
+ if (ve(a)) o && !a.getFormat() && a.setFormat(o), s.push(a);
148
+ else if (r.push(a), l === e.length - 1 || l < e.length - 1 && ve(e[l + 1])) {
149
149
  const d = t();
150
150
  d.setFormat(o), d.append(...r), s.push(d), r = [];
151
151
  }
152
152
  }
153
153
  return s;
154
154
  }
155
- function dn(n) {
155
+ function fn(n) {
156
156
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
157
157
  }
158
- var pe = dn(function(n) {
158
+ var we = fn(function(n) {
159
159
  const e = new URLSearchParams();
160
160
  e.append("code", n);
161
161
  for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
162
162
  throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
163
163
  });
164
- const hn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, ht = (n) => hn ? (n || window).getSelection() : null;
165
- function gn(n, e = P()) {
166
- return e == null && pe(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : cn(n, e);
164
+ const mn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, ft = (n) => mn ? (n || window).getSelection() : null;
165
+ function pn(n, e = D()) {
166
+ return e == null && we(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : hn(n, e);
167
167
  }
168
- function fn(n, e = P()) {
169
- return e == null && pe(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(mn(n, e));
168
+ function wn(n, e = D()) {
169
+ return e == null && we(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(Cn(n, e));
170
170
  }
171
- function Dn(n, e, t) {
171
+ function Bn(n, e, t) {
172
172
  const o = n.getData("application/x-lexical-editor");
173
173
  if (o) try {
174
174
  const l = JSON.parse(o);
175
175
  if (l.namespace === t._config.namespace && Array.isArray(l.nodes))
176
- return We(t, pn(l.nodes), e);
176
+ return ze(t, Sn(l.nodes), e);
177
177
  } catch {
178
178
  }
179
179
  const s = n.getData("text/html");
@@ -181,7 +181,7 @@ function Dn(n, e, t) {
181
181
  const l = new DOMParser().parseFromString(function(a) {
182
182
  return window.trustedTypes && window.trustedTypes.createPolicy ? window.trustedTypes.createPolicy("lexical", { createHTML: (d) => d }).createHTML(a) : a;
183
183
  }(s), "text/html");
184
- return We(t, an(t, l), e);
184
+ return ze(t, dn(t, l), e);
185
185
  } catch {
186
186
  }
187
187
  const r = n.getData("text/plain") || n.getData("text/uri-list");
@@ -189,32 +189,32 @@ function Dn(n, e, t) {
189
189
  const l = r.split(/(\r?\n|\t)/);
190
190
  l[l.length - 1] === "" && l.pop();
191
191
  for (let a = 0; a < l.length; a++) {
192
- const d = P();
192
+ const d = D();
193
193
  if (A(d)) {
194
194
  const h = l[a];
195
195
  h === `
196
196
  ` || h === `\r
197
- ` ? d.insertParagraph() : h === " " ? d.insertNodes([Tt()]) : d.insertText(h);
197
+ ` ? d.insertParagraph() : h === " " ? d.insertNodes([Mt()]) : d.insertText(h);
198
198
  }
199
199
  }
200
200
  } else e.insertRawText(r);
201
201
  }
202
- function We(n, e, t) {
203
- n.dispatchCommand(lt, { nodes: e, selection: t }) || t.insertNodes(e);
202
+ function ze(n, e, t) {
203
+ n.dispatchCommand(at, { nodes: e, selection: t }) || t.insertNodes(e);
204
204
  }
205
- function gt(n, e, t, o = []) {
205
+ function mt(n, e, t, o = []) {
206
206
  let s = e === null || t.isSelected(e);
207
207
  const r = T(t) && t.excludeFromCopy("html");
208
208
  let l = t;
209
209
  if (e !== null) {
210
- let h = ot(t);
211
- h = $(h) && e !== null ? at(e, h) : h, l = h;
210
+ let h = st(t);
211
+ h = $(h) && e !== null ? ut(e, h) : h, l = h;
212
212
  }
213
213
  const a = T(l) ? l.getChildren() : [], d = function(h) {
214
214
  const i = h.exportJSON(), c = h.constructor;
215
- if (i.type !== c.getType() && pe(58, c.name), T(h)) {
215
+ if (i.type !== c.getType() && we(58, c.name), T(h)) {
216
216
  const u = i.children;
217
- Array.isArray(u) || pe(59, c.name);
217
+ Array.isArray(u) || we(59, c.name);
218
218
  }
219
219
  return i;
220
220
  }(l);
@@ -223,7 +223,7 @@ function gt(n, e, t, o = []) {
223
223
  h.length > 0 ? d.text = h : s = !1;
224
224
  }
225
225
  for (let h = 0; h < a.length; h++) {
226
- const i = a[h], c = gt(n, e, i, d.children);
226
+ const i = a[h], c = mt(n, e, i, d.children);
227
227
  !s && T(t) && c && t.extractWithChild(i, e, "clone") && (s = !0);
228
228
  }
229
229
  if (s && !r) o.push(d);
@@ -233,74 +233,74 @@ function gt(n, e, t, o = []) {
233
233
  }
234
234
  return s;
235
235
  }
236
- function mn(n, e) {
237
- const t = [], o = ve().getChildren();
236
+ function Cn(n, e) {
237
+ const t = [], o = Ee().getChildren();
238
238
  for (let s = 0; s < o.length; s++)
239
- gt(n, e, o[s], t);
239
+ mt(n, e, o[s], t);
240
240
  return { namespace: n._config.namespace, nodes: t };
241
241
  }
242
- function pn(n) {
242
+ function Sn(n) {
243
243
  const e = [];
244
244
  for (let t = 0; t < n.length; t++) {
245
- const o = n[t], s = Ot(o);
246
- $(s) && rn(s), e.push(s);
245
+ const o = n[t], s = Ft(o);
246
+ $(s) && an(s), e.push(s);
247
247
  }
248
248
  return e;
249
249
  }
250
250
  let ee = null;
251
- async function wn(n, e, t) {
251
+ async function bn(n, e, t) {
252
252
  if (ee !== null) return !1;
253
253
  if (e !== null) return new Promise((d, h) => {
254
254
  n.update(() => {
255
- d(Ie(n, e, t));
255
+ d(Ue(n, e, t));
256
256
  });
257
257
  });
258
- const o = n.getRootElement(), s = n._window == null ? window.document : n._window.document, r = ht(n._window);
258
+ const o = n.getRootElement(), s = n._window == null ? window.document : n._window.document, r = ft(n._window);
259
259
  if (o === null || r === null) return !1;
260
260
  const l = s.createElement("span");
261
261
  l.style.cssText = "position: fixed; top: -1000px;", l.append(s.createTextNode("#")), o.append(l);
262
262
  const a = new Range();
263
263
  return a.setStart(l, 0), a.setEnd(l, 1), r.removeAllRanges(), r.addRange(a), new Promise((d, h) => {
264
- const i = n.registerCommand(Et, (c) => (Ze(c, ClipboardEvent) && (i(), ee !== null && (window.clearTimeout(ee), ee = null), d(Ie(n, c, t))), !0), B);
264
+ const i = n.registerCommand(Rt, (c) => (et(c, ClipboardEvent) && (i(), ee !== null && (window.clearTimeout(ee), ee = null), d(Ue(n, c, t))), !0), B);
265
265
  ee = window.setTimeout(() => {
266
266
  i(), ee = null, d(!1);
267
267
  }, 50), s.execCommand("copy"), l.remove();
268
268
  });
269
269
  }
270
- function Ie(n, e, t) {
270
+ function Ue(n, e, t) {
271
271
  if (t === void 0) {
272
- const s = ht(n._window);
272
+ const s = ft(n._window);
273
273
  if (!s) return !1;
274
274
  const r = s.anchorNode, l = s.focusNode;
275
- if (r !== null && l !== null && !Mt(n, r, l)) return !1;
276
- const a = P();
275
+ if (r !== null && l !== null && !Kt(n, r, l)) return !1;
276
+ const a = D();
277
277
  if (a === null) return !1;
278
- t = ft(a);
278
+ t = pt(a);
279
279
  }
280
280
  e.preventDefault();
281
281
  const o = e.clipboardData;
282
- return o !== null && (Sn(o, t), !0);
282
+ return o !== null && (_n(o, t), !0);
283
283
  }
284
- const Cn = [["text/html", gn], ["application/x-lexical-editor", fn]];
285
- function ft(n = P()) {
284
+ const yn = [["text/html", pn], ["application/x-lexical-editor", wn]];
285
+ function pt(n = D()) {
286
286
  const e = { "text/plain": n ? n.getTextContent() : "" };
287
287
  if (n) {
288
- const t = Ft();
289
- for (const [o, s] of Cn) {
288
+ const t = kt();
289
+ for (const [o, s] of yn) {
290
290
  const r = s(t, n);
291
291
  r !== null && (e[o] = r);
292
292
  }
293
293
  }
294
294
  return e;
295
295
  }
296
- function Sn(n, e) {
296
+ function _n(n, e) {
297
297
  for (const t in e) {
298
298
  const o = e[t];
299
299
  o !== void 0 && n.setData(t, o);
300
300
  }
301
301
  }
302
- const Me = /^(\d+(?:\.\d+)?)px$/, W = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
303
- class de extends Ee {
302
+ const Re = /^(\d+(?:\.\d+)?)px$/, I = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
303
+ class de extends Fe {
304
304
  static getType() {
305
305
  return "tablecell";
306
306
  }
@@ -311,13 +311,13 @@ class de extends Ee {
311
311
  super.afterCloneFrom(e), this.__rowSpan = e.__rowSpan, this.__backgroundColor = e.__backgroundColor;
312
312
  }
313
313
  static importDOM() {
314
- return { td: (e) => ({ conversion: ze, priority: 0 }), th: (e) => ({ conversion: ze, priority: 0 }) };
314
+ return { td: (e) => ({ conversion: Je, priority: 0 }), th: (e) => ({ conversion: Je, priority: 0 }) };
315
315
  }
316
316
  static importJSON(e) {
317
317
  const t = e.colSpan || 1, o = e.rowSpan || 1;
318
318
  return oe(e.headerState, t, e.width || void 0).setRowSpan(o).setBackgroundColor(e.backgroundColor || null);
319
319
  }
320
- constructor(e = W.NO_STATUS, t = 1, o, s) {
320
+ constructor(e = I.NO_STATUS, t = 1, o, s) {
321
321
  super(s), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null;
322
322
  }
323
323
  createDOM(e) {
@@ -354,7 +354,7 @@ class de extends Ee {
354
354
  getTag() {
355
355
  return this.hasHeader() ? "th" : "td";
356
356
  }
357
- setHeaderStyles(e, t = W.BOTH) {
357
+ setHeaderStyles(e, t = I.BOTH) {
358
358
  const o = this.getWritable();
359
359
  return o.__headerState = e & t | o.__headerState & ~t, o;
360
360
  }
@@ -383,7 +383,7 @@ class de extends Ee {
383
383
  return (this.getHeaderStyles() & e) === e;
384
384
  }
385
385
  hasHeader() {
386
- return this.getLatest().__headerState !== W.NO_STATUS;
386
+ return this.getLatest().__headerState !== I.NO_STATUS;
387
387
  }
388
388
  updateDOM(e) {
389
389
  return e.__headerState !== this.__headerState || e.__width !== this.__width || e.__colSpan !== this.__colSpan || e.__rowSpan !== this.__rowSpan || e.__backgroundColor !== this.__backgroundColor;
@@ -401,11 +401,11 @@ class de extends Ee {
401
401
  return !1;
402
402
  }
403
403
  }
404
- function ze(n) {
404
+ function Je(n) {
405
405
  const e = n, t = n.nodeName.toLowerCase();
406
406
  let o;
407
- Me.test(e.style.width) && (o = parseFloat(e.style.width));
408
- const s = oe(t === "th" ? W.ROW : W.NO_STATUS, e.colSpan, o);
407
+ Re.test(e.style.width) && (o = parseFloat(e.style.width));
408
+ const s = oe(t === "th" ? I.ROW : I.NO_STATUS, e.colSpan, o);
409
409
  s.__rowSpan = e.rowSpan;
410
410
  const r = e.style.backgroundColor;
411
411
  r !== "" && (s.__backgroundColor = r);
@@ -413,38 +413,38 @@ function ze(n) {
413
413
  return { after: (u) => (u.length === 0 && u.push(V()), u), forChild: (u, g) => {
414
414
  if (m(g) && !T(u)) {
415
415
  const f = V();
416
- return Rt(u) && u.getTextContent() === `
416
+ return Dt(u) && u.getTextContent() === `
417
417
  ` ? null : ($(u) && (d && u.toggleFormat("bold"), h && u.toggleFormat("strikethrough"), i && u.toggleFormat("italic"), c && u.toggleFormat("underline")), f.append(u), f);
418
418
  }
419
419
  return u;
420
420
  }, node: s };
421
421
  }
422
422
  function oe(n, e = 1, t) {
423
- return Te(new de(n, e, t));
423
+ return Oe(new de(n, e, t));
424
424
  }
425
425
  function m(n) {
426
426
  return n instanceof de;
427
427
  }
428
- const An = Kt();
429
- function bn(n) {
428
+ const Wn = Pt();
429
+ function xn(n) {
430
430
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
431
431
  }
432
- var x = bn(function(n) {
432
+ var N = xn(function(n) {
433
433
  const e = new URLSearchParams();
434
434
  e.append("code", n);
435
435
  for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
436
436
  throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
437
437
  });
438
- const yn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
439
- class we extends Ee {
438
+ const Nn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
439
+ class Ce extends Fe {
440
440
  static getType() {
441
441
  return "tablerow";
442
442
  }
443
443
  static clone(e) {
444
- return new we(e.__height, e.__key);
444
+ return new Ce(e.__height, e.__key);
445
445
  }
446
446
  static importDOM() {
447
- return { tr: (e) => ({ conversion: _n, priority: 0 }) };
447
+ return { tr: (e) => ({ conversion: vn, priority: 0 }) };
448
448
  }
449
449
  static importJSON(e) {
450
450
  return he(e.height);
@@ -478,36 +478,57 @@ class we extends Ee {
478
478
  return !1;
479
479
  }
480
480
  }
481
- function _n(n) {
481
+ function vn(n) {
482
482
  const e = n;
483
483
  let t;
484
- return Me.test(e.style.height) && (t = parseFloat(e.style.height)), { node: he(t) };
484
+ return Re.test(e.style.height) && (t = parseFloat(e.style.height)), { node: he(t) };
485
485
  }
486
486
  function he(n) {
487
- return Te(new we(n));
487
+ return Oe(new Ce(n));
488
488
  }
489
- function J(n) {
490
- return n instanceof we;
489
+ function W(n) {
490
+ return n instanceof Ce;
491
491
  }
492
- function Nn(n, e, t = !0) {
493
- const o = Re();
492
+ function Tn(n, e, t = !0) {
493
+ const o = ke();
494
494
  for (let s = 0; s < n; s++) {
495
495
  const r = he();
496
496
  for (let l = 0; l < e; l++) {
497
- let a = W.NO_STATUS;
498
- typeof t == "object" ? (s === 0 && t.rows && (a |= W.ROW), l === 0 && t.columns && (a |= W.COLUMN)) : t && (s === 0 && (a |= W.ROW), l === 0 && (a |= W.COLUMN));
497
+ let a = I.NO_STATUS;
498
+ typeof t == "object" ? (s === 0 && t.rows && (a |= I.ROW), l === 0 && t.columns && (a |= I.COLUMN)) : t && (s === 0 && (a |= I.ROW), l === 0 && (a |= I.COLUMN));
499
499
  const d = oe(a), h = V();
500
- h.append(Oe()), d.append(h), r.append(d);
500
+ h.append(Me()), d.append(h), r.append(d);
501
501
  }
502
502
  o.append(r);
503
503
  }
504
504
  return o;
505
505
  }
506
- function xn(n, e) {
506
+ function In(n) {
507
+ const e = _(n, (t) => m(t));
508
+ return m(e) ? e : null;
509
+ }
510
+ function ge(n) {
511
+ const e = _(n, (t) => W(t));
512
+ if (W(e)) return e;
513
+ throw new Error("Expected table cell to be inside of table row.");
514
+ }
515
+ function Se(n) {
516
+ const e = _(n, (t) => M(t));
517
+ if (M(e)) return e;
518
+ throw new Error("Expected table cell to be inside of table.");
519
+ }
520
+ function En(n) {
521
+ const e = ge(n);
522
+ return Se(e).getChildren().findIndex((t) => t.is(e));
523
+ }
524
+ function wt(n) {
525
+ return ge(n).getChildren().findIndex((e) => e.is(n));
526
+ }
527
+ function On(n, e) {
507
528
  const t = n.getChildren();
508
529
  for (let o = 0; o < t.length; o++) {
509
530
  const s = t[o];
510
- if (J(s)) {
531
+ if (W(s)) {
511
532
  const r = s.getChildren();
512
533
  if (e >= r.length || e < 0) throw new Error("Table column target index out of range");
513
534
  r[e].remove();
@@ -516,10 +537,10 @@ function xn(n, e) {
516
537
  return n;
517
538
  }
518
539
  function ne(n, e, t) {
519
- const [o, s, r] = vn(n, e, t);
520
- return s === null && x(207), r === null && x(208), [o, s, r];
540
+ const [o, s, r] = Mn(n, e, t);
541
+ return s === null && N(207), r === null && N(208), [o, s, r];
521
542
  }
522
- function vn(n, e, t) {
543
+ function Mn(n, e, t) {
523
544
  const o = [];
524
545
  let s = null, r = null;
525
546
  function l(d) {
@@ -529,15 +550,15 @@ function vn(n, e, t) {
529
550
  const a = n.getChildren();
530
551
  for (let d = 0; d < a.length; d++) {
531
552
  const h = a[d];
532
- J(h) || x(209);
553
+ W(h) || N(209);
533
554
  for (let i = h.getFirstChild(), c = 0; i != null; i = i.getNextSibling()) {
534
- m(i) || x(147);
555
+ m(i) || N(147);
535
556
  const u = l(d);
536
557
  for (; u[c] !== void 0; ) c++;
537
558
  const g = { cell: i, startColumn: c, startRow: d }, { __rowSpan: f, __colSpan: p } = i;
538
559
  for (let w = 0; w < f && !(d + w >= a.length); w++) {
539
560
  const C = l(d + w);
540
- for (let _ = 0; _ < p; _++) C[c + _] = g;
561
+ for (let x = 0; x < p; x++) C[c + x] = g;
541
562
  }
542
563
  e !== null && s === null && e.is(i) && (s = g), t !== null && r === null && t.is(i) && (r = g);
543
564
  }
@@ -548,18 +569,18 @@ function le(n) {
548
569
  let e;
549
570
  if (n instanceof de) e = n;
550
571
  else if ("__type" in n) {
551
- const s = N(n, m);
552
- m(s) || x(148), e = s;
572
+ const s = _(n, m);
573
+ m(s) || N(148), e = s;
553
574
  } else {
554
- const s = N(n.getNode(), m);
555
- m(s) || x(148), e = s;
575
+ const s = _(n.getNode(), m);
576
+ m(s) || N(148), e = s;
556
577
  }
557
578
  const t = e.getParent();
558
- J(t) || x(149);
579
+ W(t) || N(149);
559
580
  const o = t.getParent();
560
- return K(o) || x(210), [e, t, o];
581
+ return M(o) || N(210), [e, t, o];
561
582
  }
562
- function Ue(n) {
583
+ function Ye(n) {
563
584
  const [e, , t] = le(n), o = t.getChildren(), s = o.length, r = o[0].getChildren().length, l = new Array(s);
564
585
  for (let a = 0; a < s; a++) l[a] = new Array(r);
565
586
  for (let a = 0; a < s; a++) {
@@ -575,7 +596,7 @@ function Ue(n) {
575
596
  }
576
597
  return null;
577
598
  }
578
- class Ce {
599
+ class be {
579
600
  constructor(e, t, o) {
580
601
  this.anchor = t, this.focus = o, t._selection = this, o._selection = this, this._cachedNodes = null, this.dirty = !1, this.tableKey = e;
581
602
  }
@@ -592,13 +613,13 @@ class Ce {
592
613
  this._cachedNodes = e;
593
614
  }
594
615
  is(e) {
595
- return !!F(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
616
+ return !!R(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
596
617
  }
597
618
  set(e, t, o) {
598
619
  this.dirty = !0, this.tableKey = e, this.anchor.key = t, this.focus.key = o, this._cachedNodes = null;
599
620
  }
600
621
  clone() {
601
- return new Ce(this.tableKey, this.anchor, this.focus);
622
+ return new be(this.tableKey, this.anchor, this.focus);
602
623
  }
603
624
  isCollapsed() {
604
625
  return !1;
@@ -614,85 +635,85 @@ class Ce {
614
635
  let t = 0;
615
636
  this.getNodes().filter(m).forEach((s) => {
616
637
  const r = s.getFirstChild();
617
- it(r) && (t |= r.getTextFormat());
638
+ ct(r) && (t |= r.getTextFormat());
618
639
  });
619
- const o = Zt[e];
640
+ const o = tn[e];
620
641
  return !!(t & o);
621
642
  }
622
643
  insertNodes(e) {
623
644
  const t = this.focus.getNode();
624
- T(t) || x(151), Qt(t.select(0, t.getChildrenSize())).insertNodes(e);
645
+ T(t) || N(151), nn(t.select(0, t.getChildrenSize())).insertNodes(e);
625
646
  }
626
647
  getShape() {
627
648
  const e = ae(this.anchor.key);
628
- m(e) || x(152);
629
- const t = Ue(e);
630
- t === null && x(153);
649
+ m(e) || N(152);
650
+ const t = Ye(e);
651
+ t === null && N(153);
631
652
  const o = ae(this.focus.key);
632
- m(o) || x(154);
633
- const s = Ue(o);
634
- s === null && x(155);
653
+ m(o) || N(154);
654
+ const s = Ye(o);
655
+ s === null && N(155);
635
656
  const r = Math.min(t.columnIndex, s.columnIndex), l = Math.max(t.columnIndex + t.colSpan - 1, s.columnIndex + s.colSpan - 1), a = Math.min(t.rowIndex, s.rowIndex), d = Math.max(t.rowIndex + t.rowSpan - 1, s.rowIndex + s.rowSpan - 1);
636
657
  return { fromX: Math.min(r, l), fromY: Math.min(a, d), toX: Math.max(r, l), toY: Math.max(a, d) };
637
658
  }
638
659
  getNodes() {
639
660
  const e = this._cachedNodes;
640
661
  if (e !== null) return e;
641
- const t = this.anchor.getNode(), o = this.focus.getNode(), s = N(t, m), r = N(o, m);
642
- m(s) || x(152), m(r) || x(154);
662
+ const t = this.anchor.getNode(), o = this.focus.getNode(), s = _(t, m), r = _(o, m);
663
+ m(s) || N(152), m(r) || N(154);
643
664
  const l = s.getParent();
644
- J(l) || x(156);
665
+ W(l) || N(156);
645
666
  const a = l.getParent();
646
- K(a) || x(157);
667
+ M(a) || N(157);
647
668
  const d = r.getParents()[1];
648
669
  if (d !== a) {
649
670
  if (a.isParentOf(r)) {
650
671
  const b = d.getParent();
651
- b == null && x(159), this.set(this.tableKey, r.getKey(), b.getKey());
672
+ b == null && N(159), this.set(this.tableKey, r.getKey(), b.getKey());
652
673
  } else {
653
674
  const b = a.getParent();
654
- b == null && x(158), this.set(this.tableKey, b.getKey(), r.getKey());
675
+ b == null && N(158), this.set(this.tableKey, b.getKey(), r.getKey());
655
676
  }
656
677
  return this.getNodes();
657
678
  }
658
679
  const [h, i, c] = ne(a, s, r);
659
- let u = Math.min(i.startColumn, c.startColumn), g = Math.min(i.startRow, c.startRow), f = Math.max(i.startColumn + i.cell.__colSpan - 1, c.startColumn + c.cell.__colSpan - 1), p = Math.max(i.startRow + i.cell.__rowSpan - 1, c.startRow + c.cell.__rowSpan - 1), w = u, C = g, _ = u, O = g;
680
+ let u = Math.min(i.startColumn, c.startColumn), g = Math.min(i.startRow, c.startRow), f = Math.max(i.startColumn + i.cell.__colSpan - 1, c.startColumn + c.cell.__colSpan - 1), p = Math.max(i.startRow + i.cell.__rowSpan - 1, c.startRow + c.cell.__rowSpan - 1), w = u, C = g, x = u, E = g;
660
681
  function v(b) {
661
- const { cell: y, startColumn: S, startRow: D } = b;
662
- u = Math.min(u, S), g = Math.min(g, D), f = Math.max(f, S + y.__colSpan - 1), p = Math.max(p, D + y.__rowSpan - 1);
682
+ const { cell: y, startColumn: S, startRow: P } = b;
683
+ u = Math.min(u, S), g = Math.min(g, P), f = Math.max(f, S + y.__colSpan - 1), p = Math.max(p, P + y.__rowSpan - 1);
663
684
  }
664
- for (; u < w || g < C || f > _ || p > O; ) {
685
+ for (; u < w || g < C || f > x || p > E; ) {
665
686
  if (u < w) {
666
- const b = O - C, y = w - 1;
687
+ const b = E - C, y = w - 1;
667
688
  for (let S = 0; S <= b; S++) v(h[C + S][y]);
668
689
  w = y;
669
690
  }
670
691
  if (g < C) {
671
- const b = _ - w, y = C - 1;
692
+ const b = x - w, y = C - 1;
672
693
  for (let S = 0; S <= b; S++) v(h[y][w + S]);
673
694
  C = y;
674
695
  }
675
- if (f > _) {
676
- const b = O - C, y = _ + 1;
696
+ if (f > x) {
697
+ const b = E - C, y = x + 1;
677
698
  for (let S = 0; S <= b; S++) v(h[C + S][y]);
678
- _ = y;
699
+ x = y;
679
700
  }
680
- if (p > O) {
681
- const b = _ - w, y = O + 1;
701
+ if (p > E) {
702
+ const b = x - w, y = E + 1;
682
703
  for (let S = 0; S <= b; S++) v(h[y][w + S]);
683
- O = y;
704
+ E = y;
684
705
  }
685
706
  }
686
- const R = /* @__PURE__ */ new Map([[a.getKey(), a]]);
687
- let E = null;
707
+ const K = /* @__PURE__ */ new Map([[a.getKey(), a]]);
708
+ let O = null;
688
709
  for (let b = g; b <= p; b++) for (let y = u; y <= f; y++) {
689
- const { cell: S } = h[b][y], D = S.getParent();
690
- J(D) || x(160), D !== E && R.set(D.getKey(), D), R.set(S.getKey(), S);
691
- for (const L of Tn(S)) R.set(L.getKey(), L);
692
- E = D;
710
+ const { cell: S } = h[b][y], P = S.getParent();
711
+ W(P) || N(160), P !== O && K.set(P.getKey(), P), K.set(S.getKey(), S);
712
+ for (const L of Fn(S)) K.set(L.getKey(), L);
713
+ O = P;
693
714
  }
694
- const M = Array.from(R.values());
695
- return en() || (this._cachedNodes = M), M;
715
+ const F = Array.from(K.values());
716
+ return on() || (this._cachedNodes = F), F;
696
717
  }
697
718
  getTextContent() {
698
719
  const e = this.getNodes().filter((o) => m(o));
@@ -705,22 +726,22 @@ class Ce {
705
726
  return t;
706
727
  }
707
728
  }
708
- function F(n) {
709
- return n instanceof Ce;
729
+ function R(n) {
730
+ return n instanceof be;
710
731
  }
711
- function Je() {
712
- const n = Be("root", 0, "element"), e = Be("root", 0, "element");
713
- return new Ce("root", n, e);
732
+ function Xe() {
733
+ const n = Ie("root", 0, "element"), e = Ie("root", 0, "element");
734
+ return new be("root", n, e);
714
735
  }
715
- function Tn(n) {
736
+ function Fn(n) {
716
737
  const e = [], t = [n];
717
738
  for (; t.length > 0; ) {
718
739
  const o = t.pop();
719
- o === void 0 && x(112), T(o) && t.unshift(...o.getChildren()), o !== n && e.push(o);
740
+ o === void 0 && N(112), T(o) && t.unshift(...o.getChildren()), o !== n && e.push(o);
720
741
  }
721
742
  return e;
722
743
  }
723
- class On {
744
+ class Rn {
724
745
  constructor(e, t) {
725
746
  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.trackTable(), this.isSelecting = !1, this.abortController = new AbortController(), this.listenerOptions = { signal: this.abortController.signal };
726
747
  }
@@ -756,11 +777,11 @@ class On {
756
777
  clearHighlight() {
757
778
  const e = this.editor;
758
779
  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(), e.update(() => {
759
- if (!K(ae(this.tableNodeKey))) throw new Error("Expected TableNode.");
780
+ if (!M(ae(this.tableNodeKey))) throw new Error("Expected TableNode.");
760
781
  const t = e.getElementByKey(this.tableNodeKey);
761
782
  if (!t) throw new Error("Expected to find TableElement in DOM");
762
783
  const o = ce(t);
763
- fe(e, o, null), q(null), e.dispatchCommand(se, void 0);
784
+ me(e, o, null), q(null), e.dispatchCommand(se, void 0);
764
785
  });
765
786
  }
766
787
  enableHighlightStyle() {
@@ -768,7 +789,7 @@ class On {
768
789
  e.update(() => {
769
790
  const t = e.getElementByKey(this.tableNodeKey);
770
791
  if (!t) throw new Error("Expected to find TableElement in DOM");
771
- Qe(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
792
+ tt(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
772
793
  });
773
794
  }
774
795
  disableHighlightStyle() {
@@ -782,18 +803,18 @@ class On {
782
803
  updateTableTableSelection(e) {
783
804
  if (e !== null && e.tableKey === this.tableNodeKey) {
784
805
  const t = this.editor;
785
- this.tableSelection = e, this.isHighlightingCells = !0, this.disableHighlightStyle(), fe(t, this.table, this.tableSelection);
806
+ this.tableSelection = e, this.isHighlightingCells = !0, this.disableHighlightStyle(), me(t, this.table, this.tableSelection);
786
807
  } else e == null ? this.clearHighlight() : (this.tableNodeKey = e.tableKey, this.updateTableTableSelection(e));
787
808
  }
788
809
  setFocusCellForSelection(e, t = !1) {
789
810
  const o = this.editor;
790
811
  o.update(() => {
791
812
  const s = ae(this.tableNodeKey);
792
- if (!K(s)) throw new Error("Expected TableNode.");
813
+ if (!M(s)) throw new Error("Expected TableNode.");
793
814
  if (!o.getElementByKey(this.tableNodeKey)) throw new Error("Expected to find TableElement in DOM");
794
815
  const r = e.x, l = e.y;
795
816
  if (this.focusCell = e, this.anchorCell !== null) {
796
- const a = mt(o._window);
817
+ const a = Ct(o._window);
797
818
  a && a.setBaseAndExtent(this.anchorCell.elem, 0, this.focusCell.elem, 0);
798
819
  }
799
820
  if (this.isHighlightingCells || this.anchorX === r && this.anchorY === l && !t) {
@@ -803,7 +824,7 @@ class On {
803
824
  const a = Y(e.elem);
804
825
  if (this.tableSelection != null && this.anchorCellNodeKey != null && m(a) && s.is(te(a))) {
805
826
  const d = a.getKey();
806
- this.tableSelection = this.tableSelection.clone() || Je(), this.focusCellNodeKey = d, this.tableSelection.set(this.tableNodeKey, this.anchorCellNodeKey, this.focusCellNodeKey), q(this.tableSelection), o.dispatchCommand(se, void 0), fe(o, this.table, this.tableSelection);
827
+ this.tableSelection = this.tableSelection.clone() || Xe(), this.focusCellNodeKey = d, this.tableSelection.set(this.tableNodeKey, this.anchorCellNodeKey, this.focusCellNodeKey), q(this.tableSelection), o.dispatchCommand(se, void 0), me(o, this.table, this.tableSelection);
807
828
  }
808
829
  }
809
830
  });
@@ -813,15 +834,15 @@ class On {
813
834
  const t = Y(e.elem);
814
835
  if (m(t)) {
815
836
  const o = t.getKey();
816
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Je(), this.anchorCellNodeKey = o;
837
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Xe(), this.anchorCellNodeKey = o;
817
838
  }
818
839
  });
819
840
  }
820
841
  formatCells(e) {
821
842
  this.editor.update(() => {
822
- const t = P();
823
- F(t) || x(11);
824
- const o = Vt(), s = o.anchor, r = o.focus, l = t.getNodes().filter(m), a = l[0].getFirstChild(), d = it(a) ? a.getFormatFlags(e, null) : null;
843
+ const t = D();
844
+ R(t) || N(11);
845
+ const o = en(), s = o.anchor, r = o.focus, l = t.getNodes().filter(m), a = l[0].getFirstChild(), d = ct(a) ? a.getFormatFlags(e, null) : null;
825
846
  l.forEach((h) => {
826
847
  s.set(h.getKey(), 0, "element"), r.set(h.getKey(), h.getChildrenSize(), "element"), o.formatText(e, d);
827
848
  }), q(t), this.editor.dispatchCommand(se, void 0);
@@ -831,30 +852,30 @@ class On {
831
852
  const e = this.editor;
832
853
  e.update(() => {
833
854
  const t = ae(this.tableNodeKey);
834
- if (!K(t)) throw new Error("Expected TableNode.");
835
- const o = P();
836
- F(o) || x(11);
855
+ if (!M(t)) throw new Error("Expected TableNode.");
856
+ const o = D();
857
+ R(o) || N(11);
837
858
  const s = o.getNodes().filter(m);
838
859
  s.length !== this.table.columns * this.table.rows ? (s.forEach((r) => {
839
860
  if (T(r)) {
840
- const l = V(), a = Oe();
861
+ const l = V(), a = Me();
841
862
  l.append(a), r.append(l), r.getChildren().forEach((d) => {
842
863
  d !== l && d.remove();
843
864
  });
844
865
  }
845
- }), fe(e, this.table, null), q(null), e.dispatchCommand(se, void 0)) : (t.selectPrevious(), t.remove(), ve().selectStart());
866
+ }), me(e, this.table, null), q(null), e.dispatchCommand(se, void 0)) : (t.selectPrevious(), t.remove(), Ee().selectStart());
846
867
  });
847
868
  }
848
869
  }
849
- const xe = "__lexicalTableSelection", mt = (n) => yn ? (n || window).getSelection() : null;
850
- function Ln(n, e, t, o) {
870
+ const Te = "__lexicalTableSelection", Ct = (n) => Nn ? (n || window).getSelection() : null;
871
+ function zn(n, e, t, o) {
851
872
  const s = t.getRootElement();
852
873
  if (s === null) throw new Error("No root element.");
853
- const r = new On(t, n.getKey()), l = t._window || window;
874
+ const r = new Rn(t, n.getKey()), l = t._window || window;
854
875
  (function(i, c) {
855
- Ye(i) !== null && x(205), i[xe] = c;
876
+ je(i) !== null && N(205), i[Te] = c;
856
877
  })(e, r), r.listenersToRemove.add(() => function(i, c) {
857
- Ye(i) === c && delete i[xe];
878
+ je(i) === c && delete i[Te];
858
879
  }(e, r));
859
880
  const a = () => {
860
881
  const i = () => {
@@ -862,7 +883,7 @@ function Ln(n, e, t, o) {
862
883
  }, c = (u) => {
863
884
  setTimeout(() => {
864
885
  if (1 & ~u.buttons && r.isSelecting) return r.isSelecting = !1, l.removeEventListener("mouseup", i), void l.removeEventListener("mousemove", c);
865
- const g = Xe(u.target);
886
+ const g = qe(u.target);
866
887
  g === null || r.anchorX === g.x && r.anchorY === g.y || (u.preventDefault(), r.setFocusCellForSelection(g));
867
888
  }, 0);
868
889
  };
@@ -871,181 +892,181 @@ function Ln(n, e, t, o) {
871
892
  e.addEventListener("mousedown", (i) => {
872
893
  setTimeout(() => {
873
894
  if (i.button !== 0 || !l) return;
874
- const c = Xe(i.target);
875
- c !== null && (U(i), r.setAnchorCellForSelection(c));
895
+ const c = qe(i.target);
896
+ c !== null && (J(i), r.setAnchorCellForSelection(c));
876
897
  const { onMouseUp: u, onMouseMove: g } = a();
877
898
  r.isSelecting = !0, l.addEventListener("mouseup", u, r.listenerOptions), l.addEventListener("mousemove", g, r.listenerOptions);
878
899
  }, 0);
879
900
  }, r.listenerOptions), l.addEventListener("mousedown", (i) => {
880
901
  i.button === 0 && t.update(() => {
881
- const c = P(), u = i.target;
882
- F(c) && c.tableKey === r.tableNodeKey && s.contains(u) && r.clearHighlight();
902
+ const c = D(), u = i.target;
903
+ R(c) && c.tableKey === r.tableNodeKey && s.contains(u) && r.clearHighlight();
883
904
  });
884
- }, r.listenerOptions), r.listenersToRemove.add(t.registerCommand(kt, (i) => ie(t, i, "down", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Pt, (i) => ie(t, i, "up", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Dt, (i) => ie(t, i, "backward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(At, (i) => ie(t, i, "forward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Lt, (i) => {
885
- const c = P();
886
- if (F(c)) {
887
- const u = N(c.focus.getNode(), m);
888
- if (m(u)) return U(i), u.selectEnd(), !0;
905
+ }, r.listenerOptions), r.listenersToRemove.add(t.registerCommand(At, (i) => ie(t, i, "down", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Lt, (i) => ie(t, i, "up", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Ht, (i) => ie(t, i, "backward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Bt, (i) => ie(t, i, "forward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Wt, (i) => {
906
+ const c = D();
907
+ if (R(c)) {
908
+ const u = _(c.focus.getNode(), m);
909
+ if (m(u)) return J(i), u.selectEnd(), !0;
889
910
  }
890
911
  return !1;
891
- }, Q)), [Ht, He, Bt].forEach((i) => {
912
+ }, Q)), [It, We, zt].forEach((i) => {
892
913
  r.listenersToRemove.add(t.registerCommand(i, /* @__PURE__ */ ((c) => () => {
893
- const u = P();
914
+ const u = D();
894
915
  if (!G(u, n)) return !1;
895
- if (F(u)) return r.clearText(), !0;
916
+ if (R(u)) return r.clearText(), !0;
896
917
  if (A(u)) {
897
- const g = N(u.anchor.getNode(), (v) => m(v));
918
+ const g = _(u.anchor.getNode(), (v) => m(v));
898
919
  if (!m(g)) return !1;
899
920
  const f = u.anchor.getNode(), p = u.focus.getNode(), w = n.isParentOf(f), C = n.isParentOf(p);
900
921
  if (w && !C || C && !w) return r.clearText(), !0;
901
- const _ = N(u.anchor.getNode(), (v) => T(v)), O = _ && N(_, (v) => T(v) && m(v.getParent()));
902
- if (!T(O) || !T(_)) return !1;
903
- if (c === He && O.getPreviousSibling() === null) return !0;
922
+ const x = _(u.anchor.getNode(), (v) => T(v)), E = x && _(x, (v) => T(v) && m(v.getParent()));
923
+ if (!T(E) || !T(x)) return !1;
924
+ if (c === We && E.getPreviousSibling() === null) return !0;
904
925
  }
905
926
  return !1;
906
927
  })(i), B));
907
928
  });
908
929
  const d = (i) => {
909
- const c = P();
910
- if (!F(c) && !A(c)) return !1;
930
+ const c = D();
931
+ if (!R(c) && !A(c)) return !1;
911
932
  const u = n.isParentOf(c.anchor.getNode());
912
933
  if (u !== n.isParentOf(c.focus.getNode())) {
913
934
  const g = u ? "anchor" : "focus", f = u ? "focus" : "anchor", { key: p, offset: w, type: C } = c[f];
914
935
  return n[c[g].isBefore(c[f]) ? "selectPrevious" : "selectNext"]()[f].set(p, w, C), !1;
915
936
  }
916
- return !!F(c) && (i && (i.preventDefault(), i.stopPropagation()), r.clearText(), !0);
937
+ return !!R(c) && (i && (i.preventDefault(), i.stopPropagation()), r.clearText(), !0);
917
938
  };
918
939
  function h(i) {
919
940
  const c = n.getCordsFromCellNode(i, r.table);
920
941
  return n.getDOMCellFromCordsOrThrow(c.x, c.y, r.table);
921
942
  }
922
- return r.listenersToRemove.add(t.registerCommand(Wt, d, B)), r.listenersToRemove.add(t.registerCommand(It, d, B)), r.listenersToRemove.add(t.registerCommand(zt, (i) => {
923
- const c = P();
943
+ return r.listenersToRemove.add(t.registerCommand(Ut, d, B)), r.listenersToRemove.add(t.registerCommand(Jt, d, B)), r.listenersToRemove.add(t.registerCommand(Yt, (i) => {
944
+ const c = D();
924
945
  if (c) {
925
- if (!F(c) && !A(c)) return !1;
926
- wn(t, Ze(i, ClipboardEvent) ? i : null, ft(c));
946
+ if (!R(c) && !A(c)) return !1;
947
+ bn(t, et(i, ClipboardEvent) ? i : null, pt(c));
927
948
  const u = d(i);
928
949
  return A(c) ? (c.removeText(), !0) : u;
929
950
  }
930
951
  return !1;
931
- }, B)), r.listenersToRemove.add(t.registerCommand(Ut, (i) => {
932
- const c = P();
952
+ }, B)), r.listenersToRemove.add(t.registerCommand(Xt, (i) => {
953
+ const c = D();
933
954
  if (!G(c, n)) return !1;
934
- if (F(c)) return r.formatCells(i), !0;
955
+ if (R(c)) return r.formatCells(i), !0;
935
956
  if (A(c)) {
936
- const u = N(c.anchor.getNode(), (g) => m(g));
957
+ const u = _(c.anchor.getNode(), (g) => m(g));
937
958
  if (!m(u)) return !1;
938
959
  }
939
960
  return !1;
940
- }, B)), r.listenersToRemove.add(t.registerCommand(Jt, (i) => {
941
- const c = P();
942
- if (!F(c) || !G(c, n)) return !1;
961
+ }, B)), r.listenersToRemove.add(t.registerCommand(jt, (i) => {
962
+ const c = D();
963
+ if (!R(c) || !G(c, n)) return !1;
943
964
  const u = c.anchor.getNode(), g = c.focus.getNode();
944
965
  if (!m(u) || !m(g)) return !1;
945
- const [f, p, w] = ne(n, u, g), C = Math.max(p.startRow, w.startRow), _ = Math.max(p.startColumn, w.startColumn), O = Math.min(p.startRow, w.startRow), v = Math.min(p.startColumn, w.startColumn);
946
- for (let R = O; R <= C; R++) for (let E = v; E <= _; E++) {
947
- const M = f[R][E].cell;
948
- M.setFormat(i);
949
- const b = M.getChildren();
966
+ const [f, p, w] = ne(n, u, g), C = Math.max(p.startRow, w.startRow), x = Math.max(p.startColumn, w.startColumn), E = Math.min(p.startRow, w.startRow), v = Math.min(p.startColumn, w.startColumn);
967
+ for (let K = E; K <= C; K++) for (let O = v; O <= x; O++) {
968
+ const F = f[K][O].cell;
969
+ F.setFormat(i);
970
+ const b = F.getChildren();
950
971
  for (let y = 0; y < b.length; y++) {
951
972
  const S = b[y];
952
973
  T(S) && !S.isInline() && S.setFormat(i);
953
974
  }
954
975
  }
955
976
  return !0;
956
- }, B)), r.listenersToRemove.add(t.registerCommand(Yt, (i) => {
957
- const c = P();
977
+ }, B)), r.listenersToRemove.add(t.registerCommand(qt, (i) => {
978
+ const c = D();
958
979
  if (!G(c, n)) return !1;
959
- if (F(c)) return r.clearHighlight(), !1;
980
+ if (R(c)) return r.clearHighlight(), !1;
960
981
  if (A(c)) {
961
- const u = N(c.anchor.getNode(), (g) => m(g));
982
+ const u = _(c.anchor.getNode(), (g) => m(g));
962
983
  if (!m(u)) return !1;
963
984
  if (typeof i == "string") {
964
- const g = $e(t, c, n);
965
- if (g) return qe(g, n, [Oe(i)]), !0;
985
+ const g = Ve(t, c, n);
986
+ if (g) return Ge(g, n, [Me(i)]), !0;
966
987
  }
967
988
  }
968
989
  return !1;
969
- }, B)), o && r.listenersToRemove.add(t.registerCommand(Xt, (i) => {
970
- const c = P();
990
+ }, B)), o && r.listenersToRemove.add(t.registerCommand($t, (i) => {
991
+ const c = D();
971
992
  if (!A(c) || !c.isCollapsed() || !G(c, n)) return !1;
972
- const u = _e(c.anchor.getNode());
993
+ const u = Ne(c.anchor.getNode());
973
994
  if (u === null) return !1;
974
- U(i);
995
+ J(i);
975
996
  const g = n.getCordsFromCellNode(u, r.table);
976
- return pt(r, n, g.x, g.y, i.shiftKey ? "backward" : "forward"), !0;
977
- }, B)), r.listenersToRemove.add(t.registerCommand(jt, (i) => n.isSelected(), Q)), r.listenersToRemove.add(t.registerCommand(lt, (i) => {
978
- const { nodes: c, selection: u } = i, g = u.getStartEndPoints(), f = F(u), p = A(u) && N(u.anchor.getNode(), (k) => m(k)) !== null && N(u.focus.getNode(), (k) => m(k)) !== null || f;
979
- if (c.length !== 1 || !K(c[0]) || !p || g === null) return !1;
980
- const [w] = g, C = c[0], _ = C.getChildren(), O = C.getFirstChildOrThrow().getChildrenSize(), v = C.getChildrenSize(), R = N(w.getNode(), (k) => m(k)), E = R && N(R, (k) => J(k)), M = E && N(E, (k) => K(k));
981
- if (!m(R) || !J(E) || !K(M)) return !1;
982
- const b = E.getIndexWithinParent(), y = Math.min(M.getChildrenSize() - 1, b + v - 1), S = R.getIndexWithinParent(), D = Math.min(E.getChildrenSize() - 1, S + O - 1), L = Math.min(S, D), H = Math.min(b, y), X = Math.max(S, D), I = Math.max(b, y), j = M.getChildren();
983
- let z = 0;
984
- for (let k = H; k <= I; k++) {
997
+ return St(r, n, g.x, g.y, i.shiftKey ? "backward" : "forward"), !0;
998
+ }, B)), r.listenersToRemove.add(t.registerCommand(Gt, (i) => n.isSelected(), Q)), r.listenersToRemove.add(t.registerCommand(at, (i) => {
999
+ const { nodes: c, selection: u } = i, g = u.getStartEndPoints(), f = R(u), p = A(u) && _(u.anchor.getNode(), (k) => m(k)) !== null && _(u.focus.getNode(), (k) => m(k)) !== null || f;
1000
+ if (c.length !== 1 || !M(c[0]) || !p || g === null) return !1;
1001
+ const [w] = g, C = c[0], x = C.getChildren(), E = C.getFirstChildOrThrow().getChildrenSize(), v = C.getChildrenSize(), K = _(w.getNode(), (k) => m(k)), O = K && _(K, (k) => W(k)), F = O && _(O, (k) => M(k));
1002
+ if (!m(K) || !W(O) || !M(F)) return !1;
1003
+ const b = O.getIndexWithinParent(), y = Math.min(F.getChildrenSize() - 1, b + v - 1), S = K.getIndexWithinParent(), P = Math.min(O.getChildrenSize() - 1, S + E - 1), L = Math.min(S, P), H = Math.min(b, y), X = Math.max(S, P), z = Math.max(b, y), j = F.getChildren();
1004
+ let U = 0;
1005
+ for (let k = H; k <= z; k++) {
985
1006
  const re = j[k];
986
- if (!J(re)) return !1;
987
- const Ke = _[z];
988
- if (!J(Ke)) return !1;
989
- const bt = re.getChildren(), yt = Ke.getChildren();
990
- let ke = 0;
991
- for (let be = L; be <= X; be++) {
992
- const ge = bt[be];
993
- if (!m(ge)) return !1;
994
- const Pe = yt[ke];
995
- if (!m(Pe)) return !1;
996
- const _t = ge.getChildren();
997
- Pe.getChildren().forEach((Z) => {
998
- $(Z) && V().append(Z), ge.append(Z);
999
- }), _t.forEach((Z) => Z.remove()), ke++;
1007
+ if (!W(re)) return !1;
1008
+ const De = x[U];
1009
+ if (!W(De)) return !1;
1010
+ const xt = re.getChildren(), Nt = De.getChildren();
1011
+ let Pe = 0;
1012
+ for (let _e = L; _e <= X; _e++) {
1013
+ const fe = xt[_e];
1014
+ if (!m(fe)) return !1;
1015
+ const Ae = Nt[Pe];
1016
+ if (!m(Ae)) return !1;
1017
+ const vt = fe.getChildren();
1018
+ Ae.getChildren().forEach((Z) => {
1019
+ $(Z) && V().append(Z), fe.append(Z);
1020
+ }), vt.forEach((Z) => Z.remove()), Pe++;
1000
1021
  }
1001
- z++;
1022
+ U++;
1002
1023
  }
1003
1024
  return !0;
1004
1025
  }, B)), r.listenersToRemove.add(t.registerCommand(se, () => {
1005
- const i = P(), c = qt();
1026
+ const i = D(), c = Vt();
1006
1027
  if (A(i)) {
1007
- const { anchor: u, focus: g } = i, f = u.getNode(), p = g.getNode(), w = _e(f), C = _e(p), _ = !(!w || !n.is(te(w))), O = !(!C || !n.is(te(C))), v = _ !== O, R = _ && O, E = i.isBackward();
1028
+ const { anchor: u, focus: g } = i, f = u.getNode(), p = g.getNode(), w = Ne(f), C = Ne(p), x = !(!w || !n.is(te(w))), E = !(!C || !n.is(te(C))), v = x !== E, K = x && E, O = i.isBackward();
1008
1029
  if (v) {
1009
- const M = i.clone();
1010
- if (O) {
1030
+ const F = i.clone();
1031
+ if (E) {
1011
1032
  const [b] = ne(n, C, C), y = b[0][0].cell, S = b[b.length - 1].at(-1).cell;
1012
- M.focus.set(E ? y.getKey() : S.getKey(), E ? y.getChildrenSize() : S.getChildrenSize(), "element");
1013
- } else if (_) {
1033
+ F.focus.set(O ? y.getKey() : S.getKey(), O ? y.getChildrenSize() : S.getChildrenSize(), "element");
1034
+ } else if (x) {
1014
1035
  const [b] = ne(n, w, w), y = b[0][0].cell, S = b[b.length - 1].at(-1).cell;
1015
- M.anchor.set(E ? S.getKey() : y.getKey(), E ? S.getChildrenSize() : 0, "element");
1036
+ F.anchor.set(O ? S.getKey() : y.getKey(), O ? S.getChildrenSize() : 0, "element");
1016
1037
  }
1017
- q(M), je(t, r);
1018
- } else R && (w.is(C) || (r.setAnchorCellForSelection(h(w)), r.setFocusCellForSelection(h(C), !0), r.isSelecting || setTimeout(() => {
1019
- const { onMouseUp: M, onMouseMove: b } = a();
1020
- r.isSelecting = !0, l.addEventListener("mouseup", M), l.addEventListener("mousemove", b);
1038
+ q(F), $e(t, r);
1039
+ } else K && (w.is(C) || (r.setAnchorCellForSelection(h(w)), r.setFocusCellForSelection(h(C), !0), r.isSelecting || setTimeout(() => {
1040
+ const { onMouseUp: F, onMouseMove: b } = a();
1041
+ r.isSelecting = !0, l.addEventListener("mouseup", F), l.addEventListener("mousemove", b);
1021
1042
  }, 0)));
1022
- } else if (i && F(i) && i.is(c) && i.tableKey === n.getKey()) {
1023
- const u = mt(t._window);
1043
+ } else if (i && R(i) && i.is(c) && i.tableKey === n.getKey()) {
1044
+ const u = Ct(t._window);
1024
1045
  if (u && u.anchorNode && u.focusNode) {
1025
1046
  const g = Y(u.focusNode), f = g && !n.is(te(g)), p = Y(u.anchorNode), w = p && n.is(te(p));
1026
1047
  if (f && w && u.rangeCount > 0) {
1027
- const C = $t(u, t);
1048
+ const C = Zt(u, t);
1028
1049
  C && (C.anchor.set(n.getKey(), i.isBackward() ? n.getChildrenSize() : 0, "element"), u.removeAllRanges(), q(C));
1029
1050
  }
1030
1051
  }
1031
1052
  }
1032
- return i && !i.is(c) && (F(i) || F(c)) && r.tableSelection && !r.tableSelection.is(c) ? (F(i) && i.tableKey === r.tableNodeKey ? r.updateTableTableSelection(i) : !F(i) && F(c) && c.tableKey === r.tableNodeKey && r.updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(u, g) {
1033
- g.enableHighlightStyle(), Fe(g.table, (f) => {
1053
+ return i && !i.is(c) && (R(i) || R(c)) && r.tableSelection && !r.tableSelection.is(c) ? (R(i) && i.tableKey === r.tableNodeKey ? r.updateTableTableSelection(i) : !R(i) && R(c) && c.tableKey === r.tableNodeKey && r.updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(u, g) {
1054
+ g.enableHighlightStyle(), Ke(g.table, (f) => {
1034
1055
  const p = f.elem;
1035
- f.highlighted = !1, Ct(u, f), p.getAttribute("style") || p.removeAttribute("style");
1056
+ f.highlighted = !1, yt(u, f), p.getAttribute("style") || p.removeAttribute("style");
1036
1057
  });
1037
- }(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() && je(t, r), !1);
1038
- }, B)), r.listenersToRemove.add(t.registerCommand(Gt, () => {
1039
- const i = P();
1058
+ }(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() && $e(t, r), !1);
1059
+ }, B)), r.listenersToRemove.add(t.registerCommand(Qt, () => {
1060
+ const i = D();
1040
1061
  if (!A(i) || !i.isCollapsed() || !G(i, n)) return !1;
1041
- const c = $e(t, i, n);
1042
- return !!c && (qe(c, n), !0);
1062
+ const c = Ve(t, i, n);
1063
+ return !!c && (Ge(c, n), !0);
1043
1064
  }, B)), r;
1044
1065
  }
1045
- function Ye(n) {
1046
- return n[xe] || null;
1066
+ function je(n) {
1067
+ return n[Te] || null;
1047
1068
  }
1048
- function Xe(n) {
1069
+ function qe(n) {
1049
1070
  let e = n;
1050
1071
  for (; e != null; ) {
1051
1072
  const t = e.nodeName;
@@ -1088,14 +1109,14 @@ function ce(n) {
1088
1109
  }
1089
1110
  return t.columns = s + 1, t.rows = r + 1, t;
1090
1111
  }
1091
- function fe(n, e, t) {
1112
+ function me(n, e, t) {
1092
1113
  const o = new Set(t ? t.getNodes() : []);
1093
- Fe(e, (s, r) => {
1114
+ Ke(e, (s, r) => {
1094
1115
  const l = s.elem;
1095
- o.has(r) ? (s.highlighted = !0, wt(n, s)) : (s.highlighted = !1, Ct(n, s), l.getAttribute("style") || l.removeAttribute("style"));
1116
+ o.has(r) ? (s.highlighted = !0, bt(n, s)) : (s.highlighted = !1, yt(n, s), l.getAttribute("style") || l.removeAttribute("style"));
1096
1117
  });
1097
1118
  }
1098
- function Fe(n, e) {
1119
+ function Ke(n, e) {
1099
1120
  const { domRows: t } = n;
1100
1121
  for (let o = 0; o < t.length; o++) {
1101
1122
  const s = t[o];
@@ -1107,25 +1128,25 @@ function Fe(n, e) {
1107
1128
  }
1108
1129
  }
1109
1130
  }
1110
- function je(n, e) {
1111
- e.disableHighlightStyle(), Fe(e.table, (t) => {
1112
- t.highlighted = !0, wt(n, t);
1131
+ function $e(n, e) {
1132
+ e.disableHighlightStyle(), Ke(e.table, (t) => {
1133
+ t.highlighted = !0, bt(n, t);
1113
1134
  });
1114
1135
  }
1115
- const pt = (n, e, t, o, s) => {
1136
+ const St = (n, e, t, o, s) => {
1116
1137
  const r = s === "forward";
1117
1138
  switch (s) {
1118
1139
  case "backward":
1119
1140
  case "forward":
1120
- return t !== (r ? n.table.columns - 1 : 0) ? me(e.getCellNodeFromCordsOrThrow(t + (r ? 1 : -1), o, n.table), r) : o !== (r ? n.table.rows - 1 : 0) ? me(e.getCellNodeFromCordsOrThrow(r ? 0 : n.table.columns - 1, o + (r ? 1 : -1), n.table), r) : r ? e.selectNext() : e.selectPrevious(), !0;
1141
+ return t !== (r ? n.table.columns - 1 : 0) ? pe(e.getCellNodeFromCordsOrThrow(t + (r ? 1 : -1), o, n.table), r) : o !== (r ? n.table.rows - 1 : 0) ? pe(e.getCellNodeFromCordsOrThrow(r ? 0 : n.table.columns - 1, o + (r ? 1 : -1), n.table), r) : r ? e.selectNext() : e.selectPrevious(), !0;
1121
1142
  case "up":
1122
- return o !== 0 ? me(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1143
+ return o !== 0 ? pe(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1123
1144
  case "down":
1124
- return o !== n.table.rows - 1 ? me(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1145
+ return o !== n.table.rows - 1 ? pe(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1125
1146
  default:
1126
1147
  return !1;
1127
1148
  }
1128
- }, En = (n, e, t, o, s) => {
1149
+ }, Kn = (n, e, t, o, s) => {
1129
1150
  const r = s === "forward";
1130
1151
  switch (s) {
1131
1152
  case "backward":
@@ -1140,38 +1161,38 @@ const pt = (n, e, t, o, s) => {
1140
1161
  }
1141
1162
  };
1142
1163
  function G(n, e) {
1143
- if (A(n) || F(n)) {
1164
+ if (A(n) || R(n)) {
1144
1165
  const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
1145
1166
  return t && o;
1146
1167
  }
1147
1168
  return !1;
1148
1169
  }
1149
- function me(n, e) {
1170
+ function pe(n, e) {
1150
1171
  e ? n.selectStart() : n.selectEnd();
1151
1172
  }
1152
- const ye = "172,206,247";
1153
- function wt(n, e) {
1173
+ const xe = "172,206,247";
1174
+ function bt(n, e) {
1154
1175
  const t = e.elem, o = Y(t);
1155
- m(o) || x(131), o.getBackgroundColor() === null ? t.style.setProperty("background-color", `rgb(${ye})`) : t.style.setProperty("background-image", `linear-gradient(to right, rgba(${ye},0.85), rgba(${ye},0.85))`), t.style.setProperty("caret-color", "transparent");
1176
+ m(o) || N(131), o.getBackgroundColor() === null ? t.style.setProperty("background-color", `rgb(${xe})`) : t.style.setProperty("background-image", `linear-gradient(to right, rgba(${xe},0.85), rgba(${xe},0.85))`), t.style.setProperty("caret-color", "transparent");
1156
1177
  }
1157
- function Ct(n, e) {
1178
+ function yt(n, e) {
1158
1179
  const t = e.elem, o = Y(t);
1159
- m(o) || x(131), o.getBackgroundColor() === null && t.style.removeProperty("background-color"), t.style.removeProperty("background-image"), t.style.removeProperty("caret-color");
1180
+ m(o) || N(131), o.getBackgroundColor() === null && t.style.removeProperty("background-color"), t.style.removeProperty("background-image"), t.style.removeProperty("caret-color");
1160
1181
  }
1161
- function _e(n) {
1162
- const e = N(n, m);
1182
+ function Ne(n) {
1183
+ const e = _(n, m);
1163
1184
  return m(e) ? e : null;
1164
1185
  }
1165
1186
  function te(n) {
1166
- const e = N(n, K);
1167
- return K(e) ? e : null;
1187
+ const e = _(n, M);
1188
+ return M(e) ? e : null;
1168
1189
  }
1169
1190
  function ie(n, e, t, o, s) {
1170
1191
  if ((t === "up" || t === "down") && function(l) {
1171
1192
  const a = l.getRootElement();
1172
1193
  return a ? a.hasAttribute("aria-controls") && a.getAttribute("aria-controls") === "typeahead-menu" : !1;
1173
1194
  }(n)) return !1;
1174
- const r = P();
1195
+ const r = D();
1175
1196
  if (!G(r, o)) {
1176
1197
  if (A(r)) {
1177
1198
  if (r.isCollapsed() && t === "backward") {
@@ -1179,16 +1200,16 @@ function ie(n, e, t, o, s) {
1179
1200
  if (l !== "element" && (l !== "text" || a !== 0)) return !1;
1180
1201
  const d = r.anchor.getNode();
1181
1202
  if (!d) return !1;
1182
- const h = N(d, (c) => T(c) && !c.isInline());
1203
+ const h = _(d, (c) => T(c) && !c.isInline());
1183
1204
  if (!h) return !1;
1184
1205
  const i = h.getPreviousSibling();
1185
- return !(!i || !K(i)) && (U(e), i.selectEnd(), !0);
1206
+ return !(!i || !M(i)) && (J(e), i.selectEnd(), !0);
1186
1207
  }
1187
1208
  if (e.shiftKey && (t === "up" || t === "down")) {
1188
1209
  const l = r.focus.getNode();
1189
1210
  if (!r.isCollapsed() && (t === "up" && !r.isBackward() || t === "down" && r.isBackward())) {
1190
- let a = N(l, (u) => K(u));
1191
- if (m(a) && (a = N(a, K)), a !== o || !a) return !1;
1211
+ let a = _(l, (u) => M(u));
1212
+ if (m(a) && (a = _(a, M)), a !== o || !a) return !1;
1192
1213
  const d = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
1193
1214
  if (!d) return !1;
1194
1215
  let h = 0;
@@ -1196,12 +1217,12 @@ function ie(n, e, t, o, s) {
1196
1217
  let i = d;
1197
1218
  t === "up" && T(d) && (i = d.getLastChild() || d, h = $(i) ? i.getTextContentSize() : 0);
1198
1219
  const c = r.clone();
1199
- return c.focus.set(i.getKey(), h, $(i) ? "text" : "element"), q(c), U(e), !0;
1220
+ return c.focus.set(i.getKey(), h, $(i) ? "text" : "element"), q(c), J(e), !0;
1200
1221
  }
1201
- if (st(l)) {
1222
+ if (it(l)) {
1202
1223
  const a = t === "up" ? r.getNodes()[r.getNodes().length - 1] : r.getNodes()[0];
1203
1224
  if (a) {
1204
- const d = N(a, m);
1225
+ const d = _(a, m);
1205
1226
  if (d && o.isParentOf(d)) {
1206
1227
  const h = o.getFirstDescendant(), i = o.getLastDescendant();
1207
1228
  if (!h || !i) return !1;
@@ -1212,14 +1233,14 @@ function ie(n, e, t, o, s) {
1212
1233
  return !1;
1213
1234
  }
1214
1235
  {
1215
- let a = N(l, (h) => T(h) && !h.isInline());
1216
- if (m(a) && (a = N(a, K)), !a) return !1;
1236
+ let a = _(l, (h) => T(h) && !h.isInline());
1237
+ if (m(a) && (a = _(a, M)), !a) return !1;
1217
1238
  const d = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
1218
- if (K(d) && s.tableNodeKey === d.getKey()) {
1239
+ if (M(d) && s.tableNodeKey === d.getKey()) {
1219
1240
  const h = d.getFirstDescendant(), i = d.getLastDescendant();
1220
1241
  if (!h || !i) return !1;
1221
1242
  const [c] = le(h), [u] = le(i), g = r.clone();
1222
- return g.focus.set((t === "up" ? c : u).getKey(), t === "up" ? 0 : u.getChildrenSize(), "element"), U(e), q(g), !0;
1243
+ return g.focus.set((t === "up" ? c : u).getKey(), t === "up" ? 0 : u.getChildrenSize(), "element"), J(e), q(g), !0;
1223
1244
  }
1224
1245
  }
1225
1246
  }
@@ -1227,7 +1248,7 @@ function ie(n, e, t, o, s) {
1227
1248
  return !1;
1228
1249
  }
1229
1250
  if (A(r) && r.isCollapsed()) {
1230
- const { anchor: l, focus: a } = r, d = N(l.getNode(), m), h = N(a.getNode(), m);
1251
+ const { anchor: l, focus: a } = r, d = _(l.getNode(), m), h = _(a.getNode(), m);
1231
1252
  if (!m(d) || !d.is(h)) return !1;
1232
1253
  const i = te(d);
1233
1254
  if (i !== o && i != null) {
@@ -1235,34 +1256,34 @@ function ie(n, e, t, o, s) {
1235
1256
  if (C != null) return s.table = ce(C), ie(n, e, t, i, s);
1236
1257
  }
1237
1258
  if (t === "backward" || t === "forward") {
1238
- const C = l.type, _ = l.offset, O = l.getNode();
1239
- if (!O) return !1;
1259
+ const C = l.type, x = l.offset, E = l.getNode();
1260
+ if (!E) return !1;
1240
1261
  const v = r.getNodes();
1241
- return (v.length !== 1 || !et(v[0])) && !!function(R, E, M, b) {
1242
- return function(y, S, D) {
1243
- return y === "element" && (D === "backward" ? S.getPreviousSibling() === null : S.getNextSibling() === null);
1244
- }(R, M, b) || function(y, S, D, L) {
1245
- const H = N(D, (I) => T(I) && !I.isInline());
1262
+ return (v.length !== 1 || !nt(v[0])) && !!function(K, O, F, b) {
1263
+ return function(y, S, P) {
1264
+ return y === "element" && (P === "backward" ? S.getPreviousSibling() === null : S.getNextSibling() === null);
1265
+ }(K, F, b) || function(y, S, P, L) {
1266
+ const H = _(P, (z) => T(z) && !z.isInline());
1246
1267
  if (!H) return !1;
1247
- const X = L === "backward" ? S === 0 : S === D.getTextContentSize();
1268
+ const X = L === "backward" ? S === 0 : S === P.getTextContentSize();
1248
1269
  return y === "text" && X && (L === "backward" ? H.getPreviousSibling() === null : H.getNextSibling() === null);
1249
- }(R, E, M, b);
1250
- }(C, _, O, t) && function(R, E, M, b) {
1251
- const y = N(E, m);
1270
+ }(K, O, F, b);
1271
+ }(C, x, E, t) && function(K, O, F, b) {
1272
+ const y = _(O, m);
1252
1273
  if (!m(y)) return !1;
1253
- const [S, D] = ne(M, y, y);
1254
- if (!function(H, X, I) {
1255
- const j = H[0][0], z = H[H.length - 1][H[0].length - 1], { startColumn: k, startRow: re } = X;
1256
- return I === "backward" ? k === j.startColumn && re === j.startRow : k === z.startColumn && re === z.startRow;
1257
- }(S, D, b)) return !1;
1258
- const L = function(H, X, I) {
1259
- const j = N(H, (k) => T(k) && !k.isInline());
1274
+ const [S, P] = ne(F, y, y);
1275
+ if (!function(H, X, z) {
1276
+ const j = H[0][0], U = H[H.length - 1][H[0].length - 1], { startColumn: k, startRow: re } = X;
1277
+ return z === "backward" ? k === j.startColumn && re === j.startRow : k === U.startColumn && re === U.startRow;
1278
+ }(S, P, b)) return !1;
1279
+ const L = function(H, X, z) {
1280
+ const j = _(H, (k) => T(k) && !k.isInline());
1260
1281
  if (!j) return;
1261
- const z = X === "backward" ? j.getPreviousSibling() : j.getNextSibling();
1262
- return z && K(z) ? z : X === "backward" ? I.getPreviousSibling() : I.getNextSibling();
1263
- }(E, b, M);
1264
- return !L || K(L) ? !1 : (U(R), b === "backward" ? L.selectEnd() : L.selectStart(), !0);
1265
- }(e, O, o, t);
1282
+ const U = X === "backward" ? j.getPreviousSibling() : j.getNextSibling();
1283
+ return U && M(U) ? U : X === "backward" ? z.getPreviousSibling() : z.getNextSibling();
1284
+ }(O, b, F);
1285
+ return !L || M(L) ? !1 : (J(K), b === "backward" ? L.selectEnd() : L.selectStart(), !0);
1286
+ }(e, E, o, t);
1266
1287
  }
1267
1288
  const c = n.getElementByKey(d.__key), u = n.getElementByKey(l.key);
1268
1289
  if (u == null || c == null) return !1;
@@ -1279,50 +1300,50 @@ function ie(n, e, t, o, s) {
1279
1300
  if (p == null) return !1;
1280
1301
  const w = p.getBoundingClientRect();
1281
1302
  if (t === "up" ? w.top > g.top - g.height : g.bottom + g.height > w.bottom) {
1282
- U(e);
1303
+ J(e);
1283
1304
  const C = o.getCordsFromCellNode(d, s.table);
1284
- if (!e.shiftKey) return pt(s, o, C.x, C.y, t);
1305
+ if (!e.shiftKey) return St(s, o, C.x, C.y, t);
1285
1306
  {
1286
- const _ = o.getDOMCellFromCordsOrThrow(C.x, C.y, s.table);
1287
- s.setAnchorCellForSelection(_), s.setFocusCellForSelection(_, !0);
1307
+ const x = o.getDOMCellFromCordsOrThrow(C.x, C.y, s.table);
1308
+ s.setAnchorCellForSelection(x), s.setFocusCellForSelection(x, !0);
1288
1309
  }
1289
1310
  return !0;
1290
1311
  }
1291
- } else if (F(r)) {
1292
- const { anchor: l, focus: a } = r, d = N(l.getNode(), m), h = N(a.getNode(), m), [i] = r.getNodes(), c = n.getElementByKey(i.getKey());
1293
- if (!m(d) || !m(h) || !K(i) || c == null) return !1;
1312
+ } else if (R(r)) {
1313
+ const { anchor: l, focus: a } = r, d = _(l.getNode(), m), h = _(a.getNode(), m), [i] = r.getNodes(), c = n.getElementByKey(i.getKey());
1314
+ if (!m(d) || !m(h) || !M(i) || c == null) return !1;
1294
1315
  s.updateTableTableSelection(r);
1295
1316
  const u = ce(c), g = o.getCordsFromCellNode(d, u), f = o.getDOMCellFromCordsOrThrow(g.x, g.y, u);
1296
- if (s.setAnchorCellForSelection(f), U(e), e.shiftKey) {
1317
+ if (s.setAnchorCellForSelection(f), J(e), e.shiftKey) {
1297
1318
  const p = o.getCordsFromCellNode(h, u);
1298
- return En(s, i, p.x, p.y, t);
1319
+ return Kn(s, i, p.x, p.y, t);
1299
1320
  }
1300
1321
  return h.selectEnd(), !0;
1301
1322
  }
1302
1323
  return !1;
1303
1324
  }
1304
- function U(n) {
1325
+ function J(n) {
1305
1326
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1306
1327
  }
1307
- function qe(n, e, t) {
1328
+ function Ge(n, e, t) {
1308
1329
  const o = V();
1309
1330
  n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
1310
1331
  }
1311
- function $e(n, e, t) {
1332
+ function Ve(n, e, t) {
1312
1333
  const o = t.getParent();
1313
1334
  if (!o) return;
1314
1335
  const s = n.getElementByKey(o.getKey());
1315
1336
  if (!s) return;
1316
1337
  const r = window.getSelection();
1317
1338
  if (!r || r.anchorNode !== s) return;
1318
- const l = N(e.anchor.getNode(), (w) => m(w));
1339
+ const l = _(e.anchor.getNode(), (w) => m(w));
1319
1340
  if (!l) return;
1320
- const a = N(l, (w) => K(w));
1321
- if (!K(a) || !a.is(t)) return;
1341
+ const a = _(l, (w) => M(w));
1342
+ if (!M(a) || !a.is(t)) return;
1322
1343
  const [d, h] = ne(t, l, l), i = d[0][0], c = d[d.length - 1][d[0].length - 1], { startRow: u, startColumn: g } = h, f = u === i.startRow && g === i.startColumn, p = u === c.startRow && g === c.startColumn;
1323
1344
  return f ? "first" : p ? "last" : void 0;
1324
1345
  }
1325
- function Ge(n, e, t, o) {
1346
+ function Ze(n, e, t, o) {
1326
1347
  const s = n.querySelector("colgroup");
1327
1348
  if (!s) return;
1328
1349
  const r = [];
@@ -1332,10 +1353,10 @@ function Ge(n, e, t, o) {
1332
1353
  }
1333
1354
  s.replaceChildren(...r);
1334
1355
  }
1335
- function Ve(n, e, t) {
1336
- t ? (ue(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (Qe(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1356
+ function Qe(n, e, t) {
1357
+ t ? (ue(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (tt(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1337
1358
  }
1338
- class Se extends Ee {
1359
+ class ye extends Fe {
1339
1360
  static getType() {
1340
1361
  return "table";
1341
1362
  }
@@ -1347,16 +1368,16 @@ class Se extends Ee {
1347
1368
  return t.__colWidths = e, t;
1348
1369
  }
1349
1370
  static clone(e) {
1350
- return new Se(e.__key);
1371
+ return new ye(e.__key);
1351
1372
  }
1352
1373
  afterCloneFrom(e) {
1353
1374
  super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping;
1354
1375
  }
1355
1376
  static importDOM() {
1356
- return { table: (e) => ({ conversion: Mn, priority: 1 }) };
1377
+ return { table: (e) => ({ conversion: kn, priority: 1 }) };
1357
1378
  }
1358
1379
  static importJSON(e) {
1359
- const t = Re();
1380
+ const t = ke();
1360
1381
  return t.__rowStriping = e.rowStriping || !1, t.__colWidths = e.colWidths, t;
1361
1382
  }
1362
1383
  constructor(e) {
@@ -1367,16 +1388,16 @@ class Se extends Ee {
1367
1388
  }
1368
1389
  createDOM(e, t) {
1369
1390
  const o = document.createElement("table"), s = document.createElement("colgroup");
1370
- return o.appendChild(s), Ge(o, 0, this.getColumnCount(), this.getColWidths()), ue(o, e.theme.table), this.__rowStriping && Ve(o, e, !0), o;
1391
+ return o.appendChild(s), Ze(o, 0, this.getColumnCount(), this.getColWidths()), ue(o, e.theme.table), this.__rowStriping && Qe(o, e, !0), o;
1371
1392
  }
1372
1393
  updateDOM(e, t, o) {
1373
- return e.__rowStriping !== this.__rowStriping && Ve(t, o, this.__rowStriping), Ge(t, 0, this.getColumnCount(), this.getColWidths()), !1;
1394
+ return e.__rowStriping !== this.__rowStriping && Qe(t, o, this.__rowStriping), Ze(t, 0, this.getColumnCount(), this.getColWidths()), !1;
1374
1395
  }
1375
1396
  exportDOM(e) {
1376
1397
  return { ...super.exportDOM(e), after: (t) => {
1377
1398
  if (t) {
1378
1399
  const o = t.cloneNode(), s = document.createElement("colgroup"), r = document.createElement("tbody");
1379
- if (rt(t)) {
1400
+ if (lt(t)) {
1380
1401
  const l = t.querySelectorAll("col");
1381
1402
  s.append(...l);
1382
1403
  const a = t.querySelectorAll("tr");
@@ -1449,15 +1470,15 @@ class Se extends Ee {
1449
1470
  }), t;
1450
1471
  }
1451
1472
  }
1452
- function Mn(n) {
1453
- const e = Re();
1473
+ function kn(n) {
1474
+ const e = ke();
1454
1475
  n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
1455
1476
  const t = n.querySelector(":scope > colgroup");
1456
1477
  if (t) {
1457
1478
  let o = [];
1458
1479
  for (const s of t.querySelectorAll(":scope > col")) {
1459
1480
  const r = s.style.width;
1460
- if (!r || !Me.test(r)) {
1481
+ if (!r || !Re.test(r)) {
1461
1482
  o = void 0;
1462
1483
  break;
1463
1484
  }
@@ -1467,33 +1488,33 @@ function Mn(n) {
1467
1488
  }
1468
1489
  return { node: e };
1469
1490
  }
1470
- function Re() {
1471
- return Te(new Se());
1491
+ function ke() {
1492
+ return Oe(new ye());
1472
1493
  }
1473
- function K(n) {
1474
- return n instanceof Se;
1494
+ function M(n) {
1495
+ return n instanceof ye;
1475
1496
  }
1476
- const St = 100, Hn = (n, e) => {
1477
- const t = Nn(0, 0, !1);
1497
+ const _t = 100, Un = (n, e) => {
1498
+ const t = Tn(0, 0, !1);
1478
1499
  for (let o = 0; o < n; o++) {
1479
1500
  const s = he();
1480
1501
  for (let r = 0; r < e; r++) {
1481
- const l = oe(0, void 0, St / e);
1502
+ const l = oe(0, void 0, _t / e);
1482
1503
  s.append(l);
1483
1504
  }
1484
1505
  t.append(s);
1485
1506
  }
1486
1507
  return t;
1487
- }, Bn = (n) => {
1488
- const e = n.getParentOrThrow(), t = e.getNextSibling() || e.getPreviousSibling(), o = e.getParentOrThrow();
1508
+ }, Jn = (n) => {
1509
+ const e = ge(n), t = e.getNextSibling() || e.getPreviousSibling(), o = e.getParentOrThrow();
1489
1510
  if (o.getChildrenSize() > 1 ? e.remove() : o.remove(), t !== null) {
1490
1511
  const s = t.getFirstDescendant();
1491
1512
  s && s.select();
1492
1513
  }
1493
- }, Fn = (n) => {
1494
- n.getParentOrThrow().getParentOrThrow().remove();
1495
- }, Wn = (n, e) => {
1496
- const t = he(), o = n.getParentOrThrow(), s = o.getChildrenSize();
1514
+ }, Dn = (n) => {
1515
+ Se(n).remove();
1516
+ }, Yn = (n, e) => {
1517
+ const t = he(), o = ge(n), s = o.getChildrenSize();
1497
1518
  for (let l = 0; l < s; l++) {
1498
1519
  const a = oe(0);
1499
1520
  t.append(a);
@@ -1501,51 +1522,57 @@ const St = 100, Hn = (n, e) => {
1501
1522
  e === "insertRowAbove" ? o.insertBefore(t) : o.insertAfter(t);
1502
1523
  const r = t.getFirstDescendant();
1503
1524
  r && r.select();
1504
- }, In = (n, e) => {
1505
- const t = n.getParentOrThrow(), o = t.getParentOrThrow().getChildren().indexOf(t), s = t.getChildren().length, r = t.getParentOrThrow();
1506
- let l = t.getChildren().indexOf(n);
1525
+ }, Xn = (n, e) => {
1526
+ const t = ge(n);
1527
+ if (!m(n))
1528
+ throw new Error("Selected node is not a TableCellNode");
1529
+ const o = En(n), s = t.getChildren().length, r = Se(n);
1530
+ let l = wt(n);
1507
1531
  const a = r.getChildren(), d = a.length;
1508
1532
  for (let i = 0; i < d; i++) {
1509
1533
  const c = oe(0), u = a[i].getChildren()[l];
1510
1534
  u && (e === "insertColumnLeft" ? u.insertBefore(c) : u.insertAfter(c)), a.forEach((g) => {
1511
1535
  g.getChildren().forEach((f) => {
1512
- f.setWidth(St / s);
1536
+ f.setWidth(_t / s);
1513
1537
  });
1514
1538
  });
1515
1539
  }
1516
1540
  l = e === "insertColumnLeft" ? l : l + 1;
1517
1541
  const h = a[o].getChildren()[l];
1518
1542
  h && h.select();
1519
- }, zn = (n) => {
1520
- var r;
1521
- const e = n.getParentOrThrow(), t = e.getParentOrThrow(), o = ((r = t.getFirstChild()) == null ? void 0 : r.getChildrenSize()) || 0, s = e.getChildren().indexOf(n);
1522
- o === 1 ? Fn(n) : xn(t, s);
1543
+ }, jn = (n) => {
1544
+ var s;
1545
+ if (!m(n))
1546
+ throw new Error("Selected node is not a TableCellNode");
1547
+ const e = Se(n), t = ((s = e.getFirstChild()) == null ? void 0 : s.getChildrenSize()) || 0, o = wt(n);
1548
+ t === 1 ? Dn(n) : On(e, o);
1523
1549
  };
1524
1550
  export {
1525
- Pn as $,
1551
+ Hn as $,
1526
1552
  ne as F,
1527
- vn as K,
1528
- kn as L,
1529
- wn as O,
1530
- Ln as U,
1531
- Dn as _,
1532
- zn as a,
1533
- Bn as b,
1534
- Wn as c,
1535
- Fn as d,
1536
- Hn as e,
1553
+ Mn as K,
1554
+ Ln as L,
1555
+ bn as O,
1556
+ zn as U,
1557
+ Bn as _,
1558
+ jn as a,
1559
+ Jn as b,
1560
+ Yn as c,
1561
+ Dn as d,
1562
+ Un as e,
1537
1563
  de as f,
1538
- we as g,
1539
- Nn as h,
1540
- In as i,
1541
- K as j,
1542
- le as k,
1543
- J as l,
1544
- an as m,
1564
+ In as g,
1565
+ Ce as h,
1566
+ Xn as i,
1567
+ Tn as j,
1568
+ M as k,
1569
+ le as l,
1570
+ W as m,
1545
1571
  oe as n,
1546
1572
  m as o,
1547
- cn as p,
1548
- An as r,
1549
- Se as u
1573
+ dn as p,
1574
+ hn as q,
1575
+ Wn as r,
1576
+ ye as u
1550
1577
  };
1551
- //# sourceMappingURL=helpers-CaU5T9i-.js.map
1578
+ //# sourceMappingURL=helpers-D9T1Tgkj.js.map