@uva-glass/component-library 2.6.1 → 2.6.2

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 (61) hide show
  1. package/dist/Lexical.prod-BAr6tzpa.js +4236 -0
  2. package/dist/Lexical.prod-BAr6tzpa.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-Dg23ixPD.js → LexicalClipboard.prod-CLCBYtDj.js} +56 -56
  4. package/dist/LexicalClipboard.prod-CLCBYtDj.js.map +1 -0
  5. package/dist/LexicalLink.prod-CBgZ4B3x.js +263 -0
  6. package/dist/LexicalLink.prod-CBgZ4B3x.js.map +1 -0
  7. package/dist/LexicalList.prod-haeqjypw.js +576 -0
  8. package/dist/LexicalList.prod-haeqjypw.js.map +1 -0
  9. package/dist/{LexicalSelection.prod-CNWFGVlh.js → LexicalSelection.prod-C8x7KK4L.js} +38 -38
  10. package/dist/LexicalSelection.prod-C8x7KK4L.js.map +1 -0
  11. package/dist/LexicalTable.prod-8RqiGUG-.js +1447 -0
  12. package/dist/LexicalTable.prod-8RqiGUG-.js.map +1 -0
  13. package/dist/LexicalUtils.prod-Dsec_Kl-.js +122 -0
  14. package/dist/LexicalUtils.prod-Dsec_Kl-.js.map +1 -0
  15. package/dist/{TablePlugin-E6UFlCgy.js → TablePlugin-sPSGmCno.js} +69 -69
  16. package/dist/{TablePlugin-E6UFlCgy.js.map → TablePlugin-sPSGmCno.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 +3 -3
  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 +37 -37
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  34. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +23 -23
  35. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +13 -13
  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 +26 -26
  39. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  40. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
  41. package/dist/components/RteEditor/Plugins/index.js +1 -1
  42. package/dist/components/RteEditor/RteEditor.js +501 -557
  43. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  44. package/dist/components/RteEditor/helpers.js +11 -11
  45. package/dist/components/index.js +1 -1
  46. package/dist/{helpers-BVGma1u6.js → helpers-DHHQR5ys.js} +44 -44
  47. package/dist/{helpers-BVGma1u6.js.map → helpers-DHHQR5ys.js.map} +1 -1
  48. package/dist/index.js +1 -1
  49. package/package.json +14 -14
  50. package/dist/Lexical.prod-Bzma_w4s.js +0 -4216
  51. package/dist/Lexical.prod-Bzma_w4s.js.map +0 -1
  52. package/dist/LexicalClipboard.prod-Dg23ixPD.js.map +0 -1
  53. package/dist/LexicalLink.prod-C1RDJLfo.js +0 -208
  54. package/dist/LexicalLink.prod-C1RDJLfo.js.map +0 -1
  55. package/dist/LexicalList.prod-BGzfDPU0.js +0 -568
  56. package/dist/LexicalList.prod-BGzfDPU0.js.map +0 -1
  57. package/dist/LexicalSelection.prod-CNWFGVlh.js.map +0 -1
  58. package/dist/LexicalTable.prod-D-4NN9o5.js +0 -1366
  59. package/dist/LexicalTable.prod-D-4NN9o5.js.map +0 -1
  60. package/dist/LexicalUtils.prod-Cg2siy-c.js +0 -94
  61. package/dist/LexicalUtils.prod-Cg2siy-c.js.map +0 -1
@@ -1,22 +1,22 @@
1
- import { jsx as y, jsxs as F, Fragment as Ke } from "react/jsx-runtime";
2
- import { l as Ze, o as Ge, u as R } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
- import { ao as Fe, u as z, z as me, R as v, E as W, b as J, W as Qe, h as P, a as C, a0 as Ae, ap as et, a6 as g, B as tt, an as K, al as nt, aq as rt, ar as ot, as as it, f as ie, at as st, au as at, A as lt, V as ct, F as dt, l as ut, av as ft, aw as ge, o as he, M as mt, J as se, L as pt, a4 as ze, ax as ve, y as gt, x as ht, S as vt, a3 as Ce, w as Ct, ay as yt, az as Et, aA as wt, aj as bt, O as St, m as $t, aB as _t, n as xt, H as kt, D as Nt, a7 as Lt, e as Dt, K as ye, aC as Pt, C as Rt, a9 as Y, a8 as Z, aD as Tt, aE as Mt, ab as Ot, aa as It } from "../../Lexical.prod-Bzma_w4s.js";
4
- import * as ae from "react";
5
- import { useMemo as q, useLayoutEffect as H, useEffect as x, useState as O, useRef as Be, Suspense as Kt, forwardRef as Ue, useCallback as Ft } from "react";
6
- import { N as B, u as A, n as At, o as pe, i as zt, d as Bt } from "../../LexicalUtils.prod-Cg2siy-c.js";
7
- import { r as Ut } from "../../index-B9BWML6P.js";
8
- import { N as Ee, O as we, h as Ht, m as jt } from "../../LexicalClipboard.prod-Dg23ixPD.js";
9
- import { L as be, $ as Se } from "../../LexicalSelection.prod-CNWFGVlh.js";
10
- import { J as He, I as je, Z as Wt } from "../../LexicalList.prod-BGzfDPU0.js";
11
- import { a as We, U as $e, m as le, g as Jt, f as qt } from "../../LexicalLink.prod-C1RDJLfo.js";
12
- import { k as Vt, K as re, r as oe, f as Je, P as Xt, s as _e, c as Yt, S as Zt, X as Gt, B as Qt, H as en, C as xe, i as tn, V as nn, n as rn } from "../../LexicalTable.prod-D-4NN9o5.js";
13
- import { a as on, F as sn, M as an } from "../../helpers-BVGma1u6.js";
14
- import { c as ln } from "../../clsx-OuTLNxxd.js";
15
- import { exportMap as cn, isStartingWithHtmlTag as dn, mergeBoldStrongTags as un } from "./helpers.js";
16
- import { s as M } from "../../RteEditor.module-oFMKEW6f.js";
17
- import { ToolBarPlugin as fn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
18
- import { useTranslation as mn } from "./hooks/useTranslation.js";
19
- import "../../TablePlugin-E6UFlCgy.js";
1
+ import { jsx as h, jsxs as K, Fragment as Te } from "react/jsx-runtime";
2
+ import { l as Je, o as Xe, u as P } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
+ import { ap as Re, a2 as A, V as Me, H as p, I as H, L as V, j as Ge, v as M, a as g, N as Ye, f as m, aq as Ze, a1 as Ie, F as Oe, ar as Qe, B as et, ao as F, am as tt, as as nt, at as rt, au as ot, d as ne, av as it, aw as at, w as st, i as lt, M as ct, k as ut, ax as dt, ay as fe, o as me, U as ft, R as re, T as mt, a6 as Fe, az as pe, D as pt, C as gt, S as ht, a5 as ge, z as vt, aA as Ct, aB as yt, aC as Et, ak as wt, m as bt, l as $t, aD as St, p as _t, K as kt, G as xt, a8 as Nt, e as Lt, q as he, aE as Dt, E as Pt, aa as G, a9 as Y, aF as Tt, aG as Rt, ac as Mt, ab as It } from "../../Lexical.prod-BAr6tzpa.js";
4
+ import * as oe from "react";
5
+ import { useMemo as W, useLayoutEffect as j, useEffect as _, useState as I, useRef as Ke, Suspense as Ot, forwardRef as ze, useCallback as Ft } from "react";
6
+ import { N as U, c as z, o as Kt, r as de } from "../../LexicalUtils.prod-Dsec_Kl-.js";
7
+ import { r as zt } from "../../index-B9BWML6P.js";
8
+ import { N as ve, O as Ce, h as At, m as Bt } from "../../LexicalClipboard.prod-CLCBYtDj.js";
9
+ import { M as ye, j as Ee } from "../../LexicalSelection.prod-C8x7KK4L.js";
10
+ import { V as Ae, I as Be, Z as jt } from "../../LexicalList.prod-haeqjypw.js";
11
+ import { f as je, N as we, x as ie, m as Ut, O as qt } from "../../LexicalLink.prod-CBgZ4B3x.js";
12
+ import { a as Ht, j as Vt, X as Wt, q as Jt, u as Ue, S as Xt, P as Gt } from "../../LexicalTable.prod-8RqiGUG-.js";
13
+ import { a as Yt, F as Zt, M as Qt } from "../../helpers-DHHQR5ys.js";
14
+ import { c as en } from "../../clsx-OuTLNxxd.js";
15
+ import { exportMap as tn, isStartingWithHtmlTag as nn, mergeBoldStrongTags as rn } from "./helpers.js";
16
+ import { s as R } from "../../RteEditor.module-oFMKEW6f.js";
17
+ import { ToolBarPlugin as on } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
18
+ import { useTranslation as an } from "./hooks/useTranslation.js";
19
+ import "../../TablePlugin-sPSGmCno.js";
20
20
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
21
21
  import "./hooks/components/Flyout.js";
22
22
  import "../Buttons/Button.js";
@@ -26,7 +26,7 @@ import "@react-aria/dialog";
26
26
  import "@react-aria/focus";
27
27
  import "@react-aria/overlays";
28
28
  import "../OverlayCloseButton/OverlayCloseButton.js";
29
- import { FeedbackBox as pn } from "../FeedbackBox/FeedbackBox.js";
29
+ import { FeedbackBox as sn } from "../FeedbackBox/FeedbackBox.js";
30
30
  import "../GridRow/GridRow.js";
31
31
  import "../IconButton/IconButton.js";
32
32
  import "../Input/Input.js";
@@ -36,129 +36,129 @@ import "../SelectListbox/SelectListbox.js";
36
36
  import "../SelectListbox/SelectProvider.js";
37
37
  import "../Sortable/components/SortableItem.js";
38
38
  import "../../SortableProvider-BUsvniX7.js";
39
- import { UvaTheme as gn } from "./UvaTheme/UvaTheme.js";
40
- import { EditorHeader as hn } from "./EditorHeader/EditorHeader.js";
41
- import { useLanguage as vn, LanguageProvider as Cn } from "./Providers/LanguageProvider.js";
42
- import { PasteHandlerPlugin as yn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
- const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, En = qe ? H : x, G = { tag: "history-merge" };
44
- function wn({ initialConfig: t, children: e }) {
45
- const n = q(() => {
46
- const { theme: o, namespace: i, nodes: r, onError: s, editorState: a, html: l } = t, c = Ge(null, o), d = Fe({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (f) => s(f, d), theme: o });
47
- return function(f, u) {
48
- if (u !== null) {
49
- if (u === void 0) f.update(() => {
50
- const m = z();
51
- if (m.isEmpty()) {
52
- const p = me();
53
- m.append(p);
54
- const E = qe ? document.activeElement : null;
55
- (v() !== null || E !== null && E === f.getRootElement()) && p.select();
39
+ import { UvaTheme as ln } from "./UvaTheme/UvaTheme.js";
40
+ import { EditorHeader as cn } from "./EditorHeader/EditorHeader.js";
41
+ import { useLanguage as un, LanguageProvider as dn } from "./Providers/LanguageProvider.js";
42
+ import { PasteHandlerPlugin as fn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
+ const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = qe ? j : _, Z = { tag: "history-merge" };
44
+ function pn({ initialConfig: t, children: e }) {
45
+ const n = W(() => {
46
+ const { theme: o, namespace: i, nodes: r, onError: a, editorState: s, html: l } = t, c = Xe(null, o), u = Re({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (d) => a(d, u), theme: o });
47
+ return function(d, f) {
48
+ if (f !== null) {
49
+ if (f === void 0) d.update(() => {
50
+ const v = A();
51
+ if (v.isEmpty()) {
52
+ const C = Me();
53
+ v.append(C);
54
+ const w = qe ? document.activeElement : null;
55
+ (p() !== null || w !== null && w === d.getRootElement()) && C.select();
56
56
  }
57
- }, G);
58
- else if (u !== null) switch (typeof u) {
57
+ }, Z);
58
+ else if (f !== null) switch (typeof f) {
59
59
  case "string": {
60
- const m = f.parseEditorState(u);
61
- f.setEditorState(m, G);
60
+ const v = d.parseEditorState(f);
61
+ d.setEditorState(v, Z);
62
62
  break;
63
63
  }
64
64
  case "object":
65
- f.setEditorState(u, G);
65
+ d.setEditorState(f, Z);
66
66
  break;
67
67
  case "function":
68
- f.update(() => {
69
- z().isEmpty() && u(f);
70
- }, G);
68
+ d.update(() => {
69
+ A().isEmpty() && f(d);
70
+ }, Z);
71
71
  }
72
72
  }
73
- }(d, a), [d, c];
73
+ }(u, s), [u, c];
74
74
  }, []);
75
- return En(() => {
75
+ return mn(() => {
76
76
  const o = t.editable, [i] = n;
77
77
  i.setEditable(o === void 0 || o);
78
- }, []), y(Ze.Provider, { value: n, children: e });
78
+ }, []), h(Je.Provider, { value: n, children: e });
79
79
  }
80
- const bn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? H : x;
81
- function Sn(t) {
80
+ const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
81
+ function hn(t) {
82
82
  return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
83
83
  }
84
- function $n() {
84
+ function vn() {
85
85
  return function(t) {
86
- const [e] = R(), n = q(() => t(e), [e, t]), [o, i] = O(() => n.initialValueFn()), r = Be(o);
87
- return bn(() => {
88
- const { initialValueFn: s, subscribe: a } = n, l = s();
89
- return r.current !== l && (r.current = l, i(l)), a((c) => {
86
+ const [e] = P(), n = W(() => t(e), [e, t]), [o, i] = I(() => n.initialValueFn()), r = Ke(o);
87
+ return gn(() => {
88
+ const { initialValueFn: a, subscribe: s } = n, l = a();
89
+ return r.current !== l && (r.current = l, i(l)), s((c) => {
90
90
  r.current = c, i(c);
91
91
  });
92
92
  }, [n, t]), o;
93
- }(Sn);
93
+ }(hn);
94
94
  }
95
- function _n() {
96
- return z().getTextContent();
95
+ function Cn() {
96
+ return A().getTextContent();
97
97
  }
98
- function xn(t, e = !0) {
98
+ function yn(t, e = !0) {
99
99
  if (t) return !1;
100
- let n = _n();
100
+ let n = Cn();
101
101
  return e && (n = n.trim()), n === "";
102
102
  }
103
- function kn(t) {
104
- if (!xn(t, !1)) return !1;
105
- const e = z().getChildren(), n = e.length;
103
+ function En(t) {
104
+ if (!yn(t, !1)) return !1;
105
+ const e = A().getChildren(), n = e.length;
106
106
  if (n > 1) return !1;
107
107
  for (let o = 0; o < n; o++) {
108
108
  const i = e[o];
109
- if (W(i)) return !1;
110
- if (J(i)) {
111
- if (!Qe(i) || i.__indent !== 0) return !1;
112
- const r = i.getChildren(), s = r.length;
113
- for (let a = 0; a < s; a++) {
109
+ if (H(i)) return !1;
110
+ if (V(i)) {
111
+ if (!Ge(i) || i.__indent !== 0) return !1;
112
+ const r = i.getChildren(), a = r.length;
113
+ for (let s = 0; s < a; s++) {
114
114
  const l = r[o];
115
- if (!P(l)) return !1;
115
+ if (!M(l)) return !1;
116
116
  }
117
117
  }
118
118
  }
119
119
  return !0;
120
120
  }
121
- function Ve(t) {
122
- return () => kn(t);
121
+ function He(t) {
122
+ return () => En(t);
123
123
  }
124
- function Nn(t) {
124
+ function wn(t) {
125
125
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
126
126
  }
127
- Nn(function(t) {
127
+ wn(function(t) {
128
128
  const e = new URLSearchParams();
129
129
  e.append("code", t);
130
130
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
131
131
  throw Error(`Minified Lexical error #${t}; 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.`);
132
132
  });
133
- var ke = Ut();
134
- function Ln(t) {
133
+ var be = zt();
134
+ function bn(t) {
135
135
  const e = window.location.origin, n = (o) => {
136
136
  if (o.origin !== e) return;
137
137
  const i = t.getRootElement();
138
138
  if (document.activeElement !== i) return;
139
139
  const r = o.data;
140
140
  if (typeof r == "string") {
141
- let s;
141
+ let a;
142
142
  try {
143
- s = JSON.parse(r);
143
+ a = JSON.parse(r);
144
144
  } catch {
145
145
  return;
146
146
  }
147
- if (s && s.protocol === "nuanria_messaging" && s.type === "request") {
148
- const a = s.payload;
149
- if (a && a.functionId === "makeChanges") {
150
- const l = a.args;
147
+ if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
148
+ const s = a.payload;
149
+ if (s && s.functionId === "makeChanges") {
150
+ const l = s.args;
151
151
  if (l) {
152
- const [c, d, f, u, m, p] = l;
152
+ const [c, u, d, f, v, C] = l;
153
153
  t.update(() => {
154
- const E = v();
155
- if (C(E)) {
156
- const w = E.anchor;
157
- let h = w.getNode(), b = 0, $ = 0;
158
- if (P(h) && c >= 0 && d >= 0 && (b = c, $ = c + d, E.setTextNodeRange(h, b, h, $)), b === $ && f === "" || (E.insertRawText(f), h = w.getNode()), P(h)) {
159
- b = u, $ = u + m;
160
- const k = h.getTextContentSize();
161
- b = b > k ? k : b, $ = $ > k ? k : $, E.setTextNodeRange(h, b, h, $);
154
+ const w = p();
155
+ if (g(w)) {
156
+ const k = w.anchor;
157
+ let y = k.getNode(), E = 0, $ = 0;
158
+ if (M(y) && c >= 0 && u >= 0 && (E = c, $ = c + u, w.setTextNodeRange(y, E, y, $)), E === $ && d === "" || (w.insertRawText(d), y = k.getNode()), M(y)) {
159
+ E = f, $ = f + v;
160
+ const x = y.getTextContentSize();
161
+ E = E > x ? x : E, $ = $ > x ? x : $, w.setTextNodeRange(y, E, y, $);
162
162
  }
163
163
  o.stopImmediatePropagation();
164
164
  }
@@ -172,7 +172,7 @@ function Ln(t) {
172
172
  window.removeEventListener("message", n, !0);
173
173
  };
174
174
  }
175
- function Ne(t, e) {
175
+ function $e(t, e) {
176
176
  if (document.caretRangeFromPoint !== void 0) {
177
177
  const n = document.caretRangeFromPoint(t, e);
178
178
  return n === null ? null : { node: n.startContainer, offset: n.startOffset };
@@ -183,679 +183,623 @@ function Ne(t, e) {
183
183
  }
184
184
  return null;
185
185
  }
186
- const j = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dn = j && "documentMode" in document ? document.documentMode : null, Pn = !(!j || !("InputEvent" in window) || Dn) && "getTargetRanges" in new window.InputEvent("input"), Rn = j && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Le = j && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Tn = j && /^(?=.*Chrome).*/i.test(navigator.userAgent), Mn = j && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Tn, De = Dt();
186
+ const q = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = q && "documentMode" in document ? document.documentMode : null, Sn = !(!q || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = q && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = q && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = q && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = q && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, _e = Lt();
187
187
  function Q(t) {
188
188
  let e = null;
189
- if (A(t, DragEvent) ? e = t.dataTransfer : A(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
189
+ if (z(t, DragEvent) ? e = t.dataTransfer : z(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
190
190
  const n = e.types, o = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
191
191
  return [o, Array.from(e.files), i];
192
192
  }
193
- function Pe(t) {
194
- const e = v();
195
- if (!C(e)) return !1;
193
+ function ke(t) {
194
+ const e = p();
195
+ if (!g(e)) return !1;
196
196
  const n = /* @__PURE__ */ new Set(), o = e.getNodes();
197
197
  for (let i = 0; i < o.length; i++) {
198
- const r = o[i], s = r.getKey();
199
- if (n.has(s)) continue;
200
- const a = pe(r, (c) => J(c) && !c.isInline());
201
- if (a === null) continue;
202
- const l = a.getKey();
203
- a.canIndent() && !n.has(l) && (n.add(l), t(a));
198
+ const r = o[i], a = r.getKey();
199
+ if (n.has(a)) continue;
200
+ const s = de(r, (c) => V(c) && !c.isInline());
201
+ if (s === null) continue;
202
+ const l = s.getKey();
203
+ s.canIndent() && !n.has(l) && (n.add(l), t(s));
204
204
  }
205
205
  return n.size > 0;
206
206
  }
207
207
  function ee(t) {
208
- const e = ie(t);
209
- return W(e);
210
- }
211
- function On(t) {
212
- return B(t.registerCommand(Lt, (e) => {
213
- const n = v();
214
- return !!K(n) && (n.clear(), !0);
215
- }, 0), t.registerCommand(se, (e) => {
216
- const n = v();
217
- return !!C(n) && (n.deleteCharacter(e), !0);
218
- }, g), t.registerCommand(Nt, (e) => {
219
- const n = v();
220
- return !!C(n) && (n.deleteWord(e), !0);
221
- }, g), t.registerCommand(kt, (e) => {
222
- const n = v();
223
- return !!C(n) && (n.deleteLine(e), !0);
224
- }, g), t.registerCommand(xt, (e) => {
225
- const n = v();
208
+ const e = ne(t);
209
+ return H(e);
210
+ }
211
+ function ae(t) {
212
+ for (const e of ["lowercase", "uppercase", "capitalize"]) t.hasFormat(e) && t.toggleFormat(e);
213
+ }
214
+ function Nn(t) {
215
+ return U(t.registerCommand(Nt, (e) => {
216
+ const n = p();
217
+ return !!F(n) && (n.clear(), !0);
218
+ }, 0), t.registerCommand(re, (e) => {
219
+ const n = p();
220
+ return !!g(n) && (n.deleteCharacter(e), !0);
221
+ }, m), t.registerCommand(xt, (e) => {
222
+ const n = p();
223
+ return !!g(n) && (n.deleteWord(e), !0);
224
+ }, m), t.registerCommand(kt, (e) => {
225
+ const n = p();
226
+ return !!g(n) && (n.deleteLine(e), !0);
227
+ }, m), t.registerCommand(_t, (e) => {
228
+ const n = p();
226
229
  if (typeof e == "string") n !== null && n.insertText(e);
227
230
  else {
228
231
  if (n === null) return !1;
229
232
  const o = e.dataTransfer;
230
- if (o != null) Ee(o, n, t);
231
- else if (C(n)) {
233
+ if (o != null) ve(o, n, t);
234
+ else if (g(n)) {
232
235
  const i = e.data;
233
236
  return i && n.insertText(i), !0;
234
237
  }
235
238
  }
236
239
  return !0;
237
- }, g), t.registerCommand(_t, () => {
238
- const e = v();
239
- return !!C(e) && (e.removeText(), !0);
240
- }, g), t.registerCommand($t, (e) => {
241
- const n = v();
242
- return !!C(n) && (n.formatText(e), !0);
243
- }, g), t.registerCommand(St, (e) => {
244
- const n = v();
245
- if (!C(n) && !K(n)) return !1;
240
+ }, m), t.registerCommand(St, () => {
241
+ const e = p();
242
+ return !!g(e) && (e.removeText(), !0);
243
+ }, m), t.registerCommand($t, (e) => {
244
+ const n = p();
245
+ return !!g(n) && (n.formatText(e), !0);
246
+ }, m), t.registerCommand(bt, (e) => {
247
+ const n = p();
248
+ if (!g(n) && !F(n)) return !1;
246
249
  const o = n.getNodes();
247
250
  for (const i of o) {
248
- const r = pe(i, (s) => J(s) && !s.isInline());
251
+ const r = de(i, (a) => V(a) && !a.isInline());
249
252
  r !== null && r.setFormat(e);
250
253
  }
251
254
  return !0;
252
- }, g), t.registerCommand(ge, (e) => {
253
- const n = v();
254
- return !!C(n) && (n.insertLineBreak(e), !0);
255
- }, g), t.registerCommand(he, () => {
256
- const e = v();
257
- return !!C(e) && (e.insertParagraph(), !0);
258
- }, g), t.registerCommand(Et, () => (wt([bt()]), !0), g), t.registerCommand(yt, () => Pe((e) => {
255
+ }, m), t.registerCommand(fe, (e) => {
256
+ const n = p();
257
+ return !!g(n) && (n.insertLineBreak(e), !0);
258
+ }, m), t.registerCommand(me, () => {
259
+ const e = p();
260
+ return !!g(e) && (e.insertParagraph(), !0);
261
+ }, m), t.registerCommand(yt, () => (Et([wt()]), !0), m), t.registerCommand(Ct, () => ke((e) => {
259
262
  const n = e.getIndent();
260
263
  e.setIndent(n + 1);
261
- }), g), t.registerCommand(ve, () => Pe((e) => {
264
+ }), m), t.registerCommand(pe, () => ke((e) => {
262
265
  const n = e.getIndent();
263
266
  n > 0 && e.setIndent(n - 1);
264
- }), g), t.registerCommand(Ct, (e) => {
265
- const n = v();
266
- if (K(n) && !ee(e.target)) {
267
+ }), m), t.registerCommand(vt, (e) => {
268
+ const n = p();
269
+ if (F(n) && !ee(e.target)) {
267
270
  const o = n.getNodes();
268
271
  if (o.length > 0) return o[0].selectPrevious(), !0;
269
- } else if (C(n)) {
270
- const o = Ce(n.focus, !0);
271
- if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
272
+ } else if (g(n)) {
273
+ const o = ge(n.focus, !0);
274
+ if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
272
275
  }
273
276
  return !1;
274
- }, g), t.registerCommand(vt, (e) => {
275
- const n = v();
276
- if (K(n)) {
277
+ }, m), t.registerCommand(ht, (e) => {
278
+ const n = p();
279
+ if (F(n)) {
277
280
  const o = n.getNodes();
278
281
  if (o.length > 0) return o[0].selectNext(0, 0), !0;
279
- } else if (C(n)) {
282
+ } else if (g(n)) {
280
283
  if (function(i) {
281
284
  const r = i.focus;
282
- return r.key === "root" && r.offset === z().getChildrenSize();
285
+ return r.key === "root" && r.offset === A().getChildrenSize();
283
286
  }(n)) return e.preventDefault(), !0;
284
- const o = Ce(n.focus, !1);
285
- if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
287
+ const o = ge(n.focus, !1);
288
+ if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
286
289
  }
287
290
  return !1;
288
- }, g), t.registerCommand(ht, (e) => {
289
- const n = v();
290
- if (K(n)) {
291
+ }, m), t.registerCommand(gt, (e) => {
292
+ const n = p();
293
+ if (F(n)) {
291
294
  const o = n.getNodes();
292
295
  if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
293
296
  }
294
- if (!C(n)) return !1;
295
- if (be(n, !0)) {
297
+ if (!g(n)) return !1;
298
+ if (ye(n, !0)) {
296
299
  const o = e.shiftKey;
297
- return e.preventDefault(), Se(n, o, !0), !0;
300
+ return e.preventDefault(), Ee(n, o, !0), !0;
298
301
  }
299
302
  return !1;
300
- }, g), t.registerCommand(gt, (e) => {
301
- const n = v();
302
- if (K(n) && !ee(e.target)) {
303
+ }, m), t.registerCommand(pt, (e) => {
304
+ const n = p();
305
+ if (F(n) && !ee(e.target)) {
303
306
  const i = n.getNodes();
304
307
  if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
305
308
  }
306
- if (!C(n)) return !1;
309
+ if (!g(n)) return !1;
307
310
  const o = e.shiftKey;
308
- return !!be(n, !1) && (e.preventDefault(), Se(n, o, !1), !0);
309
- }, g), t.registerCommand(pt, (e) => {
311
+ return !!ye(n, !1) && (e.preventDefault(), Ee(n, o, !1), !0);
312
+ }, m), t.registerCommand(mt, (e) => {
310
313
  if (ee(e.target)) return !1;
311
- const n = v();
312
- if (!C(n)) return !1;
314
+ const n = p();
315
+ if (!g(n)) return !1;
313
316
  const { anchor: o } = n, i = o.getNode();
314
- return n.isCollapsed() && o.offset === 0 && !ze(i) && At(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(ve, void 0)) : (!Le || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(se, !0));
315
- }, g), t.registerCommand(mt, (e) => {
317
+ return n.isCollapsed() && o.offset === 0 && !Fe(i) && Kt(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(pe, void 0)) : (!Se || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(re, !0));
318
+ }, m), t.registerCommand(ft, (e) => {
316
319
  if (ee(e.target)) return !1;
317
- const n = v();
318
- return !!C(n) && (e.preventDefault(), t.dispatchCommand(se, !1));
319
- }, g), t.registerCommand(ft, (e) => {
320
- const n = v();
321
- if (!C(n)) return !1;
322
- if (e !== null) {
323
- if ((Le || Rn || Mn) && Pn) return !1;
324
- if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(ge, !1);
320
+ const n = p();
321
+ return !!g(n) && (e.preventDefault(), t.dispatchCommand(re, !1));
322
+ }, m), t.registerCommand(dt, (e) => {
323
+ const n = p();
324
+ if (!g(n)) return !1;
325
+ if (ae(n), e !== null) {
326
+ if ((Se || _n || xn) && Sn) return !1;
327
+ if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(fe, !1);
325
328
  }
326
- return t.dispatchCommand(he, void 0);
327
- }, g), t.registerCommand(ut, () => {
328
- const e = v();
329
- return !!C(e) && (t.blur(), !0);
330
- }, g), t.registerCommand(at, (e) => {
329
+ return t.dispatchCommand(me, void 0);
330
+ }, m), t.registerCommand(ut, () => {
331
+ const e = p();
332
+ return !!g(e) && (t.blur(), !0);
333
+ }, m), t.registerCommand(at, (e) => {
331
334
  const [, n] = Q(e);
332
335
  if (n.length > 0) {
333
- const i = Ne(e.clientX, e.clientY);
336
+ const i = $e(e.clientX, e.clientY);
334
337
  if (i !== null) {
335
- const { offset: r, node: s } = i, a = ie(s);
336
- if (a !== null) {
337
- const l = lt();
338
- if (P(a)) l.anchor.set(a.getKey(), r, "text"), l.focus.set(a.getKey(), r, "text");
338
+ const { offset: r, node: a } = i, s = ne(a);
339
+ if (s !== null) {
340
+ const l = st();
341
+ if (M(s)) l.anchor.set(s.getKey(), r, "text"), l.focus.set(s.getKey(), r, "text");
339
342
  else {
340
- const d = a.getParentOrThrow().getKey(), f = a.getIndexWithinParent() + 1;
341
- l.anchor.set(d, f, "element"), l.focus.set(d, f, "element");
343
+ const u = s.getParentOrThrow().getKey(), d = s.getIndexWithinParent() + 1;
344
+ l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
342
345
  }
343
- const c = ct(l);
344
- dt(c);
346
+ const c = lt(l);
347
+ ct(c);
345
348
  }
346
- t.dispatchCommand(De, n);
349
+ t.dispatchCommand(_e, n);
347
350
  }
348
351
  return e.preventDefault(), !0;
349
352
  }
350
- const o = v();
351
- return !!C(o);
352
- }, g), t.registerCommand(st, (e) => {
353
- const [n] = Q(e), o = v();
354
- return !(n && !C(o));
355
- }, g), t.registerCommand(it, (e) => {
356
- const [n] = Q(e), o = v();
357
- if (n && !C(o)) return !1;
358
- const i = Ne(e.clientX, e.clientY);
353
+ const o = p();
354
+ return !!g(o);
355
+ }, m), t.registerCommand(it, (e) => {
356
+ const [n] = Q(e), o = p();
357
+ return !(n && !g(o));
358
+ }, m), t.registerCommand(ot, (e) => {
359
+ const [n] = Q(e), o = p();
360
+ if (n && !g(o)) return !1;
361
+ const i = $e(e.clientX, e.clientY);
359
362
  if (i !== null) {
360
- const r = ie(i.node);
361
- W(r) && e.preventDefault();
363
+ const r = ne(i.node);
364
+ H(r) && e.preventDefault();
362
365
  }
363
366
  return !0;
364
- }, g), t.registerCommand(rt, () => (ot(), !0), g), t.registerCommand(nt, (e) => (we(t, A(e, ClipboardEvent) ? e : null), !0), g), t.registerCommand(tt, (e) => (async function(n, o) {
365
- await we(o, A(n, ClipboardEvent) ? n : null), o.update(() => {
366
- const i = v();
367
- C(i) ? i.removeText() : K(i) && i.getNodes().forEach((r) => r.remove());
367
+ }, m), t.registerCommand(nt, () => (rt(), !0), m), t.registerCommand(tt, (e) => (Ce(t, z(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(et, (e) => (async function(n, o) {
368
+ await Ce(o, z(n, ClipboardEvent) ? n : null), o.update(() => {
369
+ const i = p();
370
+ g(i) ? i.removeText() : F(i) && i.getNodes().forEach((r) => r.remove());
368
371
  });
369
- }(e, t), !0), g), t.registerCommand(Ae, (e) => {
372
+ }(e, t), !0), m), t.registerCommand(Ie, (e) => {
370
373
  const [, n, o] = Q(e);
371
- return n.length > 0 && !o ? (t.dispatchCommand(De, n), !0) : et(e.target) ? !1 : v() !== null && (function(i, r) {
374
+ return n.length > 0 && !o ? (t.dispatchCommand(_e, n), !0) : Oe(e.target) && Qe(e.target) ? !1 : p() !== null && (function(i, r) {
372
375
  i.preventDefault(), r.update(() => {
373
- const s = v(), a = A(i, InputEvent) || A(i, KeyboardEvent) ? null : i.clipboardData;
374
- a != null && s !== null && Ee(a, s, r);
376
+ const a = p(), s = z(i, InputEvent) || z(i, KeyboardEvent) ? null : i.clipboardData;
377
+ s != null && a !== null && ve(s, a, r);
375
378
  }, { tag: "paste" });
376
379
  }(e, t), !0);
377
- }, g));
378
- }
379
- const ce = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? H : x;
380
- function Re(t) {
381
- return t.getEditorState().read(Ve(t.isComposing()));
382
- }
383
- function In({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
384
- const [o] = R(), i = function(r, s) {
385
- const [a, l] = O(() => r.getDecorators());
386
- return ce(() => r.registerDecoratorListener((c) => {
387
- ke.flushSync(() => {
380
+ }, m), t.registerCommand(Ze, (e) => {
381
+ const n = p();
382
+ return g(n) && ae(n), !1;
383
+ }, m), t.registerCommand(Ye, (e) => {
384
+ const n = p();
385
+ return g(n) && ae(n), !1;
386
+ }, m));
387
+ }
388
+ const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
389
+ function xe(t) {
390
+ return t.getEditorState().read(He(t.isComposing()));
391
+ }
392
+ function Ln({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
393
+ const [o] = P(), i = function(r, a) {
394
+ const [s, l] = I(() => r.getDecorators());
395
+ return se(() => r.registerDecoratorListener((c) => {
396
+ be.flushSync(() => {
388
397
  l(c);
389
398
  });
390
- }), [r]), x(() => {
399
+ }), [r]), _(() => {
391
400
  l(r.getDecorators());
392
- }, [r]), q(() => {
393
- const c = [], d = Object.keys(a);
394
- for (let f = 0; f < d.length; f++) {
395
- const u = d[f], m = y(s, { onError: (E) => r._onError(E), children: y(Kt, { fallback: null, children: a[u] }) }), p = r.getElementByKey(u);
396
- p !== null && c.push(ke.createPortal(m, p, u));
401
+ }, [r]), W(() => {
402
+ const c = [], u = Object.keys(s);
403
+ for (let d = 0; d < u.length; d++) {
404
+ const f = u[d], v = h(a, { onError: (w) => r._onError(w), children: h(Ot, { fallback: null, children: s[f] }) }), C = r.getElementByKey(f);
405
+ C !== null && c.push(be.createPortal(v, C, f));
397
406
  }
398
407
  return c;
399
- }, [s, a, r]);
408
+ }, [a, s, r]);
400
409
  }(o, n);
401
410
  return function(r) {
402
- ce(() => B(On(r), Ln(r)), [r]);
403
- }(o), F(Ke, { children: [t, y(Kn, { content: e }), i] });
404
- }
405
- function Kn({ content: t }) {
406
- const [e] = R(), n = function(i) {
407
- const [r, s] = O(() => Re(i));
408
- return ce(() => {
409
- function a() {
410
- const l = Re(i);
411
- s(l);
411
+ se(() => U(Nn(r), bn(r)), [r]);
412
+ }(o), K(Te, { children: [t, h(Dn, { content: e }), i] });
413
+ }
414
+ function Dn({ content: t }) {
415
+ const [e] = P(), n = function(i) {
416
+ const [r, a] = I(() => xe(i));
417
+ return se(() => {
418
+ function s() {
419
+ const l = xe(i);
420
+ a(l);
412
421
  }
413
- return a(), B(i.registerUpdateListener(() => {
414
- a();
422
+ return s(), U(i.registerUpdateListener(() => {
423
+ s();
415
424
  }), i.registerEditableListener(() => {
416
- a();
425
+ s();
417
426
  }));
418
427
  }, [i]), r;
419
- }(e), o = $n();
428
+ }(e), o = vn();
420
429
  return n ? typeof t == "function" ? t(o) : t : null;
421
430
  }
422
- const Xe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? H : x;
423
- function Fn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: d, ariaOwns: f, ariaRequired: u, autoCapitalize: m, className: p, id: E, role: w = "textbox", spellCheck: h = !0, style: b, tabIndex: $, "data-testid": k, ...S }, N) {
424
- const [_, T] = O(t.isEditable()), I = Ft((L) => {
431
+ const Ve = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
432
+ function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: a, ariaInvalid: s, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: k = "textbox", spellCheck: y = !0, style: E, tabIndex: $, "data-testid": x, ...b }, N) {
433
+ const [S, T] = I(t.isEditable()), O = Ft((L) => {
425
434
  L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
426
- }, [t]), U = q(() => /* @__PURE__ */ function(...L) {
427
- return (V) => {
435
+ }, [t]), B = W(() => /* @__PURE__ */ function(...L) {
436
+ return (J) => {
428
437
  L.forEach((X) => {
429
- typeof X == "function" ? X(V) : X != null && (X.current = V);
438
+ typeof X == "function" ? X(J) : X != null && (X.current = J);
430
439
  });
431
440
  };
432
- }(N, I), [I, N]);
433
- return Xe(() => (T(t.isEditable()), t.registerEditableListener((L) => {
441
+ }(N, O), [O, N]);
442
+ return Ve(() => (T(t.isEditable()), t.registerEditableListener((L) => {
434
443
  T(L);
435
- })), [t]), y("div", { "aria-activedescendant": _ ? e : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": _ && w === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": d, "aria-owns": _ ? f : void 0, "aria-readonly": !_ || void 0, "aria-required": u, autoCapitalize: m, className: p, contentEditable: _, "data-testid": k, id: E, ref: U, role: _ ? w : void 0, spellCheck: h, style: b, tabIndex: $, ...S });
444
+ })), [t]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": S && k === "combobox" ? !!a : void 0, ...s != null ? { "aria-invalid": s } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: S, "data-testid": x, id: w, ref: B, role: S ? k : void 0, spellCheck: y, style: E, tabIndex: $, ...b });
436
445
  }
437
- const An = Ue(Fn);
438
- function Te(t) {
439
- return t.getEditorState().read(Ve(t.isComposing()));
446
+ const Tn = ze(Pn);
447
+ function Ne(t) {
448
+ return t.getEditorState().read(He(t.isComposing()));
440
449
  }
441
- const zn = Ue(Bn);
442
- function Bn(t, e) {
443
- const { placeholder: n, ...o } = t, [i] = R();
444
- return F(Ke, { children: [y(An, { editor: i, ...o, ref: e }), n != null && y(Un, { editor: i, content: n })] });
450
+ const Rn = ze(Mn);
451
+ function Mn(t, e) {
452
+ const { placeholder: n, ...o } = t, [i] = P();
453
+ return K(Te, { children: [h(Tn, { editor: i, ...o, ref: e }), n != null && h(In, { editor: i, content: n })] });
445
454
  }
446
- function Un({ content: t, editor: e }) {
447
- const n = function(s) {
448
- const [a, l] = O(() => Te(s));
449
- return Xe(() => {
455
+ function In({ content: t, editor: e }) {
456
+ const n = function(a) {
457
+ const [s, l] = I(() => Ne(a));
458
+ return Ve(() => {
450
459
  function c() {
451
- const d = Te(s);
452
- l(d);
460
+ const u = Ne(a);
461
+ l(u);
453
462
  }
454
- return c(), B(s.registerUpdateListener(() => {
463
+ return c(), U(a.registerUpdateListener(() => {
455
464
  c();
456
- }), s.registerEditableListener(() => {
465
+ }), a.registerEditableListener(() => {
457
466
  c();
458
467
  }));
459
- }, [s]), a;
460
- }(e), [o, i] = O(e.isEditable());
461
- if (H(() => (i(e.isEditable()), e.registerEditableListener((s) => {
462
- i(s);
468
+ }, [a]), s;
469
+ }(e), [o, i] = I(e.isEditable());
470
+ if (j(() => (i(e.isEditable()), e.registerEditableListener((a) => {
471
+ i(a);
463
472
  })), [e]), !n) return null;
464
473
  let r = null;
465
- return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : y("div", { "aria-hidden": !0, children: r });
474
+ return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : h("div", { "aria-hidden": !0, children: r });
466
475
  }
467
- function de(t, e) {
468
- return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
476
+ function le(t, e) {
477
+ return le = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
469
478
  return n.__proto__ = o, n;
470
- }, de(t, e);
479
+ }, le(t, e);
471
480
  }
472
- var Me = { error: null }, Hn = function(t) {
481
+ var Le = { error: null }, On = function(t) {
473
482
  var e, n;
474
483
  function o() {
475
- for (var r, s = arguments.length, a = new Array(s), l = 0; l < s; l++) a[l] = arguments[l];
476
- return (r = t.call.apply(t, [this].concat(a)) || this).state = Me, r.resetErrorBoundary = function() {
477
- for (var c, d = arguments.length, f = new Array(d), u = 0; u < d; u++) f[u] = arguments[u];
478
- r.props.onReset == null || (c = r.props).onReset.apply(c, f), r.reset();
484
+ for (var r, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
485
+ return (r = t.call.apply(t, [this].concat(s)) || this).state = Le, r.resetErrorBoundary = function() {
486
+ for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
487
+ r.props.onReset == null || (c = r.props).onReset.apply(c, d), r.reset();
479
488
  }, r;
480
489
  }
481
- n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, de(e, n), o.getDerivedStateFromError = function(r) {
490
+ n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, le(e, n), o.getDerivedStateFromError = function(r) {
482
491
  return { error: r };
483
492
  };
484
493
  var i = o.prototype;
485
494
  return i.reset = function() {
486
- this.setState(Me);
487
- }, i.componentDidCatch = function(r, s) {
488
- var a, l;
489
- (a = (l = this.props).onError) == null || a.call(l, r, s);
490
- }, i.componentDidUpdate = function(r, s) {
491
- var a, l, c, d, f = this.state.error, u = this.props.resetKeys;
492
- f !== null && s.error !== null && ((c = r.resetKeys) === void 0 && (c = []), (d = u) === void 0 && (d = []), c.length !== d.length || c.some(function(m, p) {
493
- return !Object.is(m, d[p]);
494
- })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, r.resetKeys, u), this.reset());
495
+ this.setState(Le);
496
+ }, i.componentDidCatch = function(r, a) {
497
+ var s, l;
498
+ (s = (l = this.props).onError) == null || s.call(l, r, a);
499
+ }, i.componentDidUpdate = function(r, a) {
500
+ var s, l, c, u, d = this.state.error, f = this.props.resetKeys;
501
+ d !== null && a.error !== null && ((c = r.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(v, C) {
502
+ return !Object.is(v, u[C]);
503
+ })) && ((s = (l = this.props).onResetKeysChange) == null || s.call(l, r.resetKeys, f), this.reset());
495
504
  }, i.render = function() {
496
- var r = this.state.error, s = this.props, a = s.fallbackRender, l = s.FallbackComponent, c = s.fallback;
505
+ var r = this.state.error, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, c = a.fallback;
497
506
  if (r !== null) {
498
- var d = { error: r, resetErrorBoundary: this.resetErrorBoundary };
499
- if (ae.isValidElement(c)) return c;
500
- if (typeof a == "function") return a(d);
501
- if (l) return ae.createElement(l, d);
507
+ var u = { error: r, resetErrorBoundary: this.resetErrorBoundary };
508
+ if (oe.isValidElement(c)) return c;
509
+ if (typeof s == "function") return s(u);
510
+ if (l) return oe.createElement(l, u);
502
511
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
503
512
  }
504
513
  return this.props.children;
505
514
  }, o;
506
- }(ae.Component);
507
- function jn({ children: t, onError: e }) {
508
- return y(Hn, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
509
- }
510
- const Wn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? H : x;
511
- function Jn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
512
- const [o] = R();
513
- return Wn(() => {
514
- if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: s, prevEditorState: a, tags: l }) => {
515
- e && r.size === 0 && s.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(i, o, l);
515
+ }(oe.Component);
516
+ function Fn({ children: t, onError: e }) {
517
+ return h(On, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
518
+ }
519
+ const Kn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
520
+ function zn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
521
+ const [o] = P();
522
+ return Kn(() => {
523
+ if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
524
+ e && r.size === 0 && a.size === 0 || t && l.has("history-merge") || s.isEmpty() || n(i, o, l);
516
525
  });
517
526
  }, [o, t, e, n]), null;
518
527
  }
519
- function qn() {
520
- const [t] = R();
521
- return x(() => {
522
- if (!t.hasNodes([He, je])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
528
+ function An() {
529
+ const [t] = P();
530
+ return _(() => {
531
+ if (!t.hasNodes([Ae, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
523
532
  }, [t]), function(e) {
524
- x(() => Wt(e), [e]);
533
+ _(() => jt(e), [e]);
525
534
  }(t), null;
526
535
  }
527
- function Vn({ validateUrl: t, attributes: e }) {
528
- const [n] = R();
529
- return x(() => {
530
- if (!n.hasNodes([We])) throw new Error("LinkPlugin: LinkNode not registered on editor");
531
- return B(n.registerCommand($e, (o) => {
532
- if (o === null) return le(o), !0;
533
- if (typeof o == "string") return !(t !== void 0 && !t(o)) && (le(o, e), !0);
536
+ function Bn({ validateUrl: t, attributes: e }) {
537
+ const [n] = P();
538
+ return _(() => {
539
+ if (!n.hasNodes([je])) throw new Error("LinkPlugin: LinkNode not registered on editor");
540
+ return U(n.registerCommand(we, (o) => {
541
+ if (o === null) return ie(o), !0;
542
+ if (typeof o == "string") return !(t !== void 0 && !t(o)) && (ie(o, e), !0);
534
543
  {
535
- const { url: i, target: r, rel: s, title: a } = o;
536
- return le(i, { ...e, rel: s, target: r, title: a }), !0;
544
+ const { url: i, target: r, rel: a, title: s } = o;
545
+ return ie(i, { ...e, rel: a, target: r, title: s }), !0;
537
546
  }
538
- }, ye), t !== void 0 ? n.registerCommand(Ae, (o) => {
539
- const i = v();
540
- if (!C(i) || i.isCollapsed() || !A(o, ClipboardEvent)) return !1;
547
+ }, he), t !== void 0 ? n.registerCommand(Ie, (o) => {
548
+ const i = p();
549
+ if (!g(i) || i.isCollapsed() || !z(o, ClipboardEvent)) return !1;
541
550
  const r = o;
542
551
  if (r.clipboardData === null) return !1;
543
- const s = r.clipboardData.getData("text");
544
- return !!t(s) && !i.getNodes().some((a) => J(a)) && (n.dispatchCommand($e, { ...e, url: s }), o.preventDefault(), !0);
545
- }, ye) : () => {
552
+ const a = r.clipboardData.getData("text");
553
+ return !!t(a) && !i.getNodes().some((s) => V(s)) && (n.dispatchCommand(we, { ...e, url: a }), o.preventDefault(), !0);
554
+ }, he) : () => {
546
555
  });
547
556
  }, [n, t, e]), null;
548
557
  }
549
- function Xn({ newTab: t = !0, disabled: e = !1 }) {
550
- const [n] = R();
551
- return x(() => {
558
+ function jn({ newTab: t = !0, disabled: e = !1 }) {
559
+ const [n] = P();
560
+ return _(() => {
552
561
  const o = (r) => {
553
- const s = r.target;
554
- if (!(s instanceof Node)) return;
555
- const a = Pt(s);
556
- if (a === null) return;
562
+ const a = r.target;
563
+ if (!Oe(a)) return;
564
+ const s = Dt(a);
565
+ if (s === null) return;
557
566
  let l = null, c = null;
558
- if (a.update(() => {
559
- const u = ie(s);
560
- if (u !== null) {
561
- const m = pe(u, J);
562
- if (!e) if (Jt(m)) l = m.sanitizeUrl(m.getURL()), c = m.getTarget();
567
+ if (s.update(() => {
568
+ const f = ne(a);
569
+ if (f !== null) {
570
+ const v = de(f, V);
571
+ if (!e) if (Ut(v)) l = v.sanitizeUrl(v.getURL()), c = v.getTarget();
563
572
  else {
564
- const p = function(E, w) {
565
- let h = E;
566
- for (; h != null; ) {
567
- if (w(h)) return h;
568
- h = h.parentNode;
573
+ const C = function(w, k) {
574
+ let y = w;
575
+ for (; y != null; ) {
576
+ if (k(y)) return y;
577
+ y = y.parentNode;
569
578
  }
570
579
  return null;
571
- }(s, Rt);
572
- p !== null && (l = p.href, c = p.target);
580
+ }(a, Pt);
581
+ C !== null && (l = C.href, c = C.target);
573
582
  }
574
583
  }
575
584
  }), l === null || l === "") return;
576
- const d = n.getEditorState().read(v);
577
- if (C(d) && !d.isCollapsed()) return void r.preventDefault();
578
- const f = r.type === "auxclick" && r.button === 1;
579
- window.open(l, t || f || r.metaKey || r.ctrlKey || c === "_blank" ? "_blank" : "_self"), r.preventDefault();
585
+ const u = n.getEditorState().read(p);
586
+ if (g(u) && !u.isCollapsed()) return void r.preventDefault();
587
+ const d = r.type === "auxclick" && r.button === 1;
588
+ window.open(l, t || d || r.metaKey || r.ctrlKey || c === "_blank" ? "_blank" : "_self"), r.preventDefault();
580
589
  }, i = (r) => {
581
590
  r.button === 1 && o(r);
582
591
  };
583
- return n.registerRootListener((r, s) => {
584
- s !== null && (s.removeEventListener("click", o), s.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
592
+ return n.registerRootListener((r, a) => {
593
+ a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
585
594
  });
586
595
  }, [n, t, e]), null;
587
596
  }
588
- const te = 0, ue = 1, fe = 2, D = 0, Yn = 1, Oe = 2, Zn = 3, Gn = 4;
589
- function Qn(t, e, n, o, i) {
597
+ const te = 0, ce = 1, ue = 2, D = 0, Un = 1, De = 2, qn = 3, Hn = 4;
598
+ function Vn(t, e, n, o, i) {
590
599
  if (t === null || n.size === 0 && o.size === 0 && !i) return D;
591
- const r = e._selection, s = t._selection;
592
- if (i) return Yn;
593
- if (!(C(r) && C(s) && s.isCollapsed() && r.isCollapsed())) return D;
594
- const a = function(h, b, $) {
595
- const k = h._nodeMap, S = [];
596
- for (const N of b) {
597
- const _ = k.get(N);
598
- _ !== void 0 && S.push(_);
600
+ const r = e._selection, a = t._selection;
601
+ if (i) return Un;
602
+ if (!(g(r) && g(a) && a.isCollapsed() && r.isCollapsed())) return D;
603
+ const s = function(y, E, $) {
604
+ const x = y._nodeMap, b = [];
605
+ for (const N of E) {
606
+ const S = x.get(N);
607
+ S !== void 0 && b.push(S);
599
608
  }
600
- for (const [N, _] of $) {
601
- if (!_) continue;
602
- const T = k.get(N);
603
- T === void 0 || ze(T) || S.push(T);
609
+ for (const [N, S] of $) {
610
+ if (!S) continue;
611
+ const T = x.get(N);
612
+ T === void 0 || Fe(T) || b.push(T);
604
613
  }
605
- return S;
614
+ return b;
606
615
  }(e, n, o);
607
- if (a.length === 0) return D;
608
- if (a.length > 1) {
609
- const h = e._nodeMap, b = h.get(r.anchor.key), $ = h.get(s.anchor.key);
610
- return b && $ && !t._nodeMap.has(b.__key) && P(b) && b.__text.length === 1 && r.anchor.offset === 1 ? Oe : D;
616
+ if (s.length === 0) return D;
617
+ if (s.length > 1) {
618
+ const y = e._nodeMap, E = y.get(r.anchor.key), $ = y.get(a.anchor.key);
619
+ return E && $ && !t._nodeMap.has(E.__key) && M(E) && E.__text.length === 1 && r.anchor.offset === 1 ? De : D;
611
620
  }
612
- const l = a[0], c = t._nodeMap.get(l.__key);
613
- if (!P(c) || !P(l) || c.__mode !== l.__mode) return D;
614
- const d = c.__text, f = l.__text;
615
- if (d === f) return D;
616
- const u = r.anchor, m = s.anchor;
617
- if (u.key !== m.key || u.type !== "text") return D;
618
- const p = u.offset, E = m.offset, w = f.length - d.length;
619
- return w === 1 && E === p - 1 ? Oe : w === -1 && E === p + 1 ? Zn : w === -1 && E === p ? Gn : D;
620
- }
621
- function er(t, e) {
621
+ const l = s[0], c = t._nodeMap.get(l.__key);
622
+ if (!M(c) || !M(l) || c.__mode !== l.__mode) return D;
623
+ const u = c.__text, d = l.__text;
624
+ if (u === d) return D;
625
+ const f = r.anchor, v = a.anchor;
626
+ if (f.key !== v.key || f.type !== "text") return D;
627
+ const C = f.offset, w = v.offset, k = d.length - u.length;
628
+ return k === 1 && w === C - 1 ? De : k === -1 && w === C + 1 ? qn : k === -1 && w === C ? Hn : D;
629
+ }
630
+ function Wn(t, e) {
622
631
  let n = Date.now(), o = D;
623
- return (i, r, s, a, l, c) => {
624
- const d = Date.now();
625
- if (c.has("historic")) return o = D, n = d, fe;
626
- const f = Qn(i, r, a, l, t.isComposing()), u = (() => {
627
- const m = s === null || s.editor === t, p = c.has("history-push");
628
- if (!p && m && c.has("history-merge")) return te;
629
- if (i === null) return ue;
630
- const E = r._selection;
631
- return a.size > 0 || l.size > 0 ? p === !1 && f !== D && f === o && d < n + e && m || a.size === 1 && function(w, h, b) {
632
- const $ = h._nodeMap.get(w), k = b._nodeMap.get(w), S = h._selection, N = b._selection;
633
- return !(C(S) && C(N) && S.anchor.type === "element" && S.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !P($) || !P(k) || $.__parent !== k.__parent) && JSON.stringify(h.read(() => $.exportJSON())) === JSON.stringify(b.read(() => k.exportJSON()));
634
- }(Array.from(a)[0], i, r) ? te : ue : E !== null ? te : fe;
632
+ return (i, r, a, s, l, c) => {
633
+ const u = Date.now();
634
+ if (c.has("historic")) return o = D, n = u, ue;
635
+ const d = Vn(i, r, s, l, t.isComposing()), f = (() => {
636
+ const v = a === null || a.editor === t, C = c.has("history-push");
637
+ if (!C && v && c.has("history-merge")) return te;
638
+ if (i === null) return ce;
639
+ const w = r._selection;
640
+ return s.size > 0 || l.size > 0 ? C === !1 && d !== D && d === o && u < n + e && v || s.size === 1 && function(k, y, E) {
641
+ const $ = y._nodeMap.get(k), x = E._nodeMap.get(k), b = y._selection, N = E._selection;
642
+ return !(g(b) && g(N) && b.anchor.type === "element" && b.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !M($) || !M(x) || $.__parent !== x.__parent) && JSON.stringify(y.read(() => $.exportJSON())) === JSON.stringify(E.read(() => x.exportJSON()));
643
+ }(Array.from(s)[0], i, r) ? te : ce : w !== null ? te : ue;
635
644
  })();
636
- return n = d, o = f, u;
645
+ return n = u, o = d, f;
637
646
  };
638
647
  }
639
- function Ie(t) {
648
+ function Pe(t) {
640
649
  t.undoStack = [], t.redoStack = [], t.current = null;
641
650
  }
642
- function tr(t, e, n) {
643
- const o = er(t, n);
644
- return B(t.registerCommand(It, () => (function(r, s) {
645
- const a = s.redoStack, l = s.undoStack;
651
+ function Jn(t, e, n) {
652
+ const o = Wn(t, n);
653
+ return U(t.registerCommand(It, () => (function(r, a) {
654
+ const s = a.redoStack, l = a.undoStack;
646
655
  if (l.length !== 0) {
647
- const c = s.current, d = l.pop();
648
- c !== null && (a.push(c), r.dispatchCommand(Y, !0)), l.length === 0 && r.dispatchCommand(Z, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
656
+ const c = a.current, u = l.pop();
657
+ c !== null && (s.push(c), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Y, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
649
658
  }
650
- }(t, e), !0), g), t.registerCommand(Ot, () => (function(r, s) {
651
- const a = s.redoStack, l = s.undoStack;
652
- if (a.length !== 0) {
653
- const c = s.current;
654
- c !== null && (l.push(c), r.dispatchCommand(Z, !0));
655
- const d = a.pop();
656
- a.length === 0 && r.dispatchCommand(Y, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
659
+ }(t, e), !0), m), t.registerCommand(Mt, () => (function(r, a) {
660
+ const s = a.redoStack, l = a.undoStack;
661
+ if (s.length !== 0) {
662
+ const c = a.current;
663
+ c !== null && (l.push(c), r.dispatchCommand(Y, !0));
664
+ const u = s.pop();
665
+ s.length === 0 && r.dispatchCommand(G, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
657
666
  }
658
- }(t, e), !0), g), t.registerCommand(Mt, () => (Ie(e), !1), g), t.registerCommand(Tt, () => (Ie(e), t.dispatchCommand(Y, !1), t.dispatchCommand(Z, !1), !0), g), t.registerUpdateListener(({ editorState: r, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
659
- const d = e.current, f = e.redoStack, u = e.undoStack, m = d === null ? null : d.editorState;
660
- if (d !== null && r === m) return;
661
- const p = o(s, r, d, a, l, c);
662
- if (p === ue) f.length !== 0 && (e.redoStack = [], t.dispatchCommand(Y, !1)), d !== null && (u.push({ ...d }), t.dispatchCommand(Z, !0));
663
- else if (p === fe) return;
667
+ }(t, e), !0), m), t.registerCommand(Rt, () => (Pe(e), !1), m), t.registerCommand(Tt, () => (Pe(e), t.dispatchCommand(G, !1), t.dispatchCommand(Y, !1), !0), m), t.registerUpdateListener(({ editorState: r, prevEditorState: a, dirtyLeaves: s, dirtyElements: l, tags: c }) => {
668
+ const u = e.current, d = e.redoStack, f = e.undoStack, v = u === null ? null : u.editorState;
669
+ if (u !== null && r === v) return;
670
+ const C = o(a, r, u, s, l, c);
671
+ if (C === ce) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(G, !1)), u !== null && (f.push({ ...u }), t.dispatchCommand(Y, !0));
672
+ else if (C === ue) return;
664
673
  e.current = { editor: t, editorState: r };
665
674
  }));
666
675
  }
667
- function nr() {
676
+ function Xn() {
668
677
  return { current: null, redoStack: [], undoStack: [] };
669
678
  }
670
- function rr({ delay: t, externalHistoryState: e }) {
671
- const [n] = R();
679
+ function Gn({ delay: t, externalHistoryState: e }) {
680
+ const [n] = P();
672
681
  return function(o, i, r = 1e3) {
673
- const s = q(() => i || nr(), [i]);
674
- x(() => tr(o, s, r), [r, o, s]);
682
+ const a = W(() => i || Xn(), [i]);
683
+ _(() => Jn(o, a, r), [r, o, a]);
675
684
  }(n, e, t), null;
676
685
  }
677
- function or(t) {
678
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
679
- }
680
- var ne = or(function(t) {
681
- const e = new URLSearchParams();
682
- e.append("code", t);
683
- for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
684
- throw Error(`Minified Lexical error #${t}; 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.`);
685
- });
686
- function ir({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
687
- const [i] = R();
688
- return x(() => {
689
- Vt(i, o);
690
- }, [i, o]), x(() => (i.hasNodes([re, oe, Je]) || ne(10), B(i.registerCommand(Yt, ({ columns: r, rows: s, includeHeaders: a }) => {
691
- const l = Zt(Number(s), Number(r), a);
692
- zt(l);
693
- const c = l.getFirstDescendant();
694
- return P(c) && c.select(), !0;
695
- }, g), i.registerNodeTransform(re, (r) => {
696
- const [s] = Xt(r, null, null), a = s.reduce((c, d) => Math.max(c, d.length), 0), l = r.getChildren();
697
- for (let c = 0; c < s.length; ++c) {
698
- const d = l[c];
699
- if (!d) continue;
700
- const f = s[c].reduce((u, m) => m ? 1 + u : u, 0);
701
- if (f !== a) for (let u = f; u < a; ++u) {
702
- const m = _e(0);
703
- m.append(me()), d.append(m);
704
- }
705
- }
706
- }))), [i]), x(() => {
707
- const r = /* @__PURE__ */ new Map(), s = (l, c, d) => {
708
- const f = nn(l, d), u = rn(l, f, i, n);
709
- r.set(c, [u, f]);
710
- }, a = i.registerMutationListener(re, (l) => {
711
- i.getEditorState().read(() => {
712
- for (const [c, d] of l) {
713
- const f = r.get(c);
714
- if (d === "created" || d === "updated") {
715
- const { tableNode: u, tableElement: m } = Gt(c);
716
- f === void 0 ? s(u, c, m) : m !== f[1] && (f[0].removeListeners(), r.delete(c), s(u, c, m));
717
- } else d === "destroyed" && f !== void 0 && (f[0].removeListeners(), r.delete(c));
718
- }
719
- }, { editor: i });
720
- }, { skipInitialization: !1 });
721
- return () => {
722
- a();
723
- for (const [, [l]] of r) l.removeListeners();
724
- };
725
- }, [i, n]), x(() => {
726
- if (!t) return i.registerNodeTransform(oe, (r) => {
727
- if (r.getColSpan() > 1 || r.getRowSpan() > 1) {
728
- const [, , s] = Qt(r), [a] = en(s, r, r), l = a.length, c = a[0].length;
729
- let d = s.getFirstChild();
730
- xe(d) || ne(175);
731
- const f = [];
732
- for (let u = 0; u < l; u++) {
733
- u !== 0 && (d = d.getNextSibling(), xe(d) || ne(175));
734
- let m = null;
735
- for (let p = 0; p < c; p++) {
736
- const E = a[u][p], w = E.cell;
737
- if (E.startRow === u && E.startColumn === p) m = w, f.push(w);
738
- else if (w.getColSpan() > 1 || w.getRowSpan() > 1) {
739
- tn(w) || ne(176);
740
- const h = _e(w.__headerState);
741
- m !== null ? m.insertAfter(h) : Bt(d, h);
742
- }
743
- }
744
- }
745
- for (const u of f) u.setColSpan(1), u.setRowSpan(1);
746
- }
747
- });
748
- }, [i, t]), x(() => {
749
- if (!e) return i.registerNodeTransform(oe, (r) => {
686
+ function Yn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
687
+ const [i] = P();
688
+ return _(() => {
689
+ Ht(i, o);
690
+ }, [i, o]), _(() => Vt(i), [i]), _(() => Wt(i, n), [i, n]), _(() => {
691
+ if (!t) return Jt(i);
692
+ }, [i, t]), _(() => {
693
+ if (!e) return i.registerNodeTransform(Ue, (r) => {
750
694
  r.getBackgroundColor() !== null && r.setBackgroundColor(null);
751
695
  });
752
696
  }, [i, e, t]), null;
753
697
  }
754
- const Ye = 200, sr = ({
698
+ const We = 200, Zn = ({
755
699
  currentLanguage: t = "NL",
756
700
  initialValue: e = "",
757
701
  placeholder: n = "",
758
702
  label: o = "",
759
703
  info: i = "",
760
704
  required: r = !1,
761
- notValidatedText: s = "",
762
- maxHeightInRem: a = "20rem",
763
- maxWords: l = Ye,
705
+ notValidatedText: a = "",
706
+ maxHeightInRem: s = "20rem",
707
+ maxWords: l = We,
764
708
  onChange: c
765
709
  }) => {
766
- const { switchLanguage: d } = vn(), f = mn(), [u] = O(() => Fe()), [m, p] = O(0), [E, w] = O(0), h = Be(null), b = {
710
+ const { switchLanguage: u } = un(), d = an(), [f] = I(() => Re()), [v, C] = I(0), [w, k] = I(0), y = Ke(null), E = {
767
711
  html: {
768
- export: cn
712
+ export: tn
769
713
  },
770
714
  namespace: "UvaRte",
771
- editor: u,
772
- theme: gn,
773
- onError(S) {
774
- throw S;
715
+ editor: f,
716
+ theme: ln,
717
+ onError(b) {
718
+ throw b;
775
719
  },
776
- nodes: [He, je, We, qt, oe, Je, re],
777
- editorState: (S) => {
778
- const _ = new DOMParser().parseFromString(e, "text/html"), T = Ht(S, _), I = z();
779
- if (I.clear(), dn(e))
780
- T.forEach((U) => {
781
- I.append(U);
720
+ nodes: [Ae, Be, je, qt, Ue, Xt, Gt],
721
+ editorState: (b) => {
722
+ const S = new DOMParser().parseFromString(e, "text/html"), T = At(b, S), O = A();
723
+ if (O.clear(), nn(e))
724
+ T.forEach((B) => {
725
+ O.append(B);
782
726
  });
783
727
  else {
784
- const U = me();
785
- T.forEach((L, V) => {
786
- V === 0 ? (U.append(L), I.append(U)) : I.append(L);
728
+ const B = Me();
729
+ T.forEach((L, J) => {
730
+ J === 0 ? (B.append(L), O.append(B)) : O.append(L);
787
731
  });
788
732
  }
789
733
  }
790
- }, $ = (S) => S.trim().length === 0 ? 0 : S.split(" ").length, k = (S, N) => {
791
- S.read(() => {
792
- let _ = "";
793
- p($(z().getTextContent().replace(/\s+/g, " ").trim())), _ = un(jt(N)), c(_);
734
+ }, $ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, x = (b, N) => {
735
+ b.read(() => {
736
+ let S = "";
737
+ C($(A().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(N)), c(S);
794
738
  });
795
739
  };
796
- return x(() => {
797
- d(t.toLocaleLowerCase());
798
- }, [t, d]), x(() => {
799
- const S = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
800
- p($(S));
801
- }, []), /* @__PURE__ */ F("div", { className: M.editor__container, children: [
802
- /* @__PURE__ */ F("div", { className: M.editor__header, children: [
803
- /* @__PURE__ */ y(hn, { label: o, info: i, required: r }),
804
- /* @__PURE__ */ F("div", { className: M["editor__header-word-count"], children: [
805
- /* @__PURE__ */ y("span", { className: ln({ [M["editor__header-word-count--alert"]]: m > l }), children: m }),
740
+ return _(() => {
741
+ u(t.toLocaleLowerCase());
742
+ }, [t, u]), _(() => {
743
+ const b = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
744
+ C($(b));
745
+ }, []), /* @__PURE__ */ K("div", { className: R.editor__container, children: [
746
+ /* @__PURE__ */ K("div", { className: R.editor__header, children: [
747
+ /* @__PURE__ */ h(cn, { label: o, info: i, required: r }),
748
+ /* @__PURE__ */ K("div", { className: R["editor__header-word-count"], children: [
749
+ /* @__PURE__ */ h("span", { className: en({ [R["editor__header-word-count--alert"]]: v > l }), children: v }),
806
750
  " / ",
807
751
  l
808
752
  ] })
809
753
  ] }),
810
- /* @__PURE__ */ y("div", { className: M.editor, children: /* @__PURE__ */ F(wn, { initialConfig: b, children: [
811
- /* @__PURE__ */ y(fn, { editorScrollPosition: E }),
812
- /* @__PURE__ */ F("div", { className: M["editor__field-wrapper"], children: [
813
- /* @__PURE__ */ y(
814
- In,
754
+ /* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ K(pn, { initialConfig: E, children: [
755
+ /* @__PURE__ */ h(on, { editorScrollPosition: w }),
756
+ /* @__PURE__ */ K("div", { className: R["editor__field-wrapper"], children: [
757
+ /* @__PURE__ */ h(
758
+ Ln,
815
759
  {
816
- contentEditable: /* @__PURE__ */ y(
817
- zn,
760
+ contentEditable: /* @__PURE__ */ h(
761
+ Rn,
818
762
  {
819
- className: M.editor__field,
820
- "aria-label": f.common.rteAriaLabel,
763
+ className: R.editor__field,
764
+ "aria-label": d.common.rteAriaLabel,
821
765
  "aria-placeholder": n,
822
- title: f.common.rteTitle,
823
- placeholder: /* @__PURE__ */ y("div", { className: M.editor__placeholder, children: n }),
766
+ title: d.common.rteTitle,
767
+ placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
824
768
  spellCheck: !1,
825
769
  id: "rteEditor",
826
- style: { height: `${a}`, maxHeight: `${a}` },
827
- onScroll: (S) => w(S.currentTarget.scrollTop),
828
- ref: h
770
+ style: { height: `${s}`, maxHeight: `${s}` },
771
+ onScroll: (b) => k(b.currentTarget.scrollTop),
772
+ ref: y
829
773
  }
830
774
  ),
831
- placeholder: /* @__PURE__ */ y("div", { className: M.editor__placeholder, children: n }),
832
- ErrorBoundary: jn
775
+ placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
776
+ ErrorBoundary: Fn
833
777
  }
834
778
  ),
835
- /* @__PURE__ */ y(ir, {}),
836
- /* @__PURE__ */ y(rr, {}),
837
- /* @__PURE__ */ y(qn, {}),
838
- /* @__PURE__ */ y(Vn, { validateUrl: on }),
839
- /* @__PURE__ */ y(sn, { matchers: an }),
840
- /* @__PURE__ */ y(Xn, {}),
841
- /* @__PURE__ */ y(Jn, { onChange: k }),
842
- /* @__PURE__ */ y(yn, {})
779
+ /* @__PURE__ */ h(Yn, {}),
780
+ /* @__PURE__ */ h(Gn, {}),
781
+ /* @__PURE__ */ h(An, {}),
782
+ /* @__PURE__ */ h(Bn, { validateUrl: Yt }),
783
+ /* @__PURE__ */ h(Zt, { matchers: Qt }),
784
+ /* @__PURE__ */ h(jn, {}),
785
+ /* @__PURE__ */ h(zn, { onChange: x }),
786
+ /* @__PURE__ */ h(fn, {})
843
787
  ] })
844
788
  ] }) }),
845
- s !== "" && /* @__PURE__ */ y(pn, { level: "error", feedback: s })
789
+ a !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: a })
846
790
  ] });
847
- }, Vr = ({
791
+ }, Ar = ({
848
792
  currentLanguage: t = "NL",
849
793
  initialValue: e = "",
850
794
  placeholder: n = "",
851
795
  label: o = "",
852
796
  info: i = "",
853
797
  required: r = !1,
854
- notValidatedText: s = "",
855
- maxWords: a = Ye,
798
+ notValidatedText: a = "",
799
+ maxWords: s = We,
856
800
  onChange: l
857
- }) => /* @__PURE__ */ y(Cn, { children: /* @__PURE__ */ y(
858
- sr,
801
+ }) => /* @__PURE__ */ h(dn, { children: /* @__PURE__ */ h(
802
+ Zn,
859
803
  {
860
804
  currentLanguage: t,
861
805
  initialValue: e,
@@ -863,13 +807,13 @@ const Ye = 200, sr = ({
863
807
  label: o,
864
808
  info: i,
865
809
  required: r,
866
- notValidatedText: s,
867
- maxWords: a,
810
+ notValidatedText: a,
811
+ maxWords: s,
868
812
  onChange: l
869
813
  }
870
814
  ) });
871
815
  export {
872
- sr as Rte,
873
- Vr as RteEditor
816
+ Zn as Rte,
817
+ Ar as RteEditor
874
818
  };
875
819
  //# sourceMappingURL=RteEditor.js.map