@uva-glass/component-library 1.62.8 → 1.62.10

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