@uva-glass/component-library 1.59.2 → 1.61.0

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