@uva-glass/component-library 3.0.9 → 3.0.11

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