@uva-glass/component-library 3.0.8 → 3.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/Lexical.prod-CoFvB6ST.js +4895 -0
  2. package/dist/Lexical.prod-CoFvB6ST.js.map +1 -0
  3. package/dist/LexicalClipboard.prod-BceK2u8q.js +255 -0
  4. package/dist/LexicalClipboard.prod-BceK2u8q.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-__08uNAw.js → LexicalLink.prod-DgAdBBH7.js} +73 -77
  8. package/dist/LexicalLink.prod-DgAdBBH7.js.map +1 -0
  9. package/dist/LexicalList.prod-BsGg0KUo.js +597 -0
  10. package/dist/LexicalList.prod-BsGg0KUo.js.map +1 -0
  11. package/dist/LexicalSelection.prod-CajyzNb9.js +85 -0
  12. package/dist/LexicalSelection.prod-CajyzNb9.js.map +1 -0
  13. package/dist/LexicalTable.prod-CNsOdwua.js +1533 -0
  14. package/dist/LexicalTable.prod-CNsOdwua.js.map +1 -0
  15. package/dist/LexicalUtils.prod-CqRL6ZhZ.js +109 -0
  16. package/dist/LexicalUtils.prod-CqRL6ZhZ.js.map +1 -0
  17. package/dist/{TablePlugin-BHY7_5Z8.js → TablePlugin-CFD5PSMc.js} +41 -41
  18. package/dist/{TablePlugin-BHY7_5Z8.js.map → TablePlugin-CFD5PSMc.js.map} +1 -1
  19. package/dist/assets/VarIndicator.css +1 -0
  20. package/dist/components/Accordion/Accordion.stories.d.ts +2 -2
  21. package/dist/components/Accordion/Accordion.test.js +3 -3
  22. package/dist/components/AccordionCard/AccordionCard.stories.d.ts +1 -1
  23. package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
  24. package/dist/components/ActionList/ActionList.stories.d.ts +1 -1
  25. package/dist/components/ActionList/ActionList.test.js +3 -3
  26. package/dist/components/AppStatusBar/AppStatusBar.stories.d.ts +1 -1
  27. package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
  28. package/dist/components/Attention/Attention.stories.d.ts +1 -1
  29. package/dist/components/Attention/Attention.test.js +2 -2
  30. package/dist/components/Backdrop/Backdrop.stories.d.ts +1 -1
  31. package/dist/components/Backdrop/Backdrop.test.js +2 -2
  32. package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +1 -1
  33. package/dist/components/Buttons/Button.stories.d.ts +2 -2
  34. package/dist/components/Buttons/Button.stories.js +1 -1
  35. package/dist/components/Buttons/Button.test.js +2 -2
  36. package/dist/components/Buttons/LinkButton.stories.d.ts +2 -2
  37. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  38. package/dist/components/Buttons/LinkButton.test.js +2 -2
  39. package/dist/components/Buttons/MenuButton.stories.d.ts +3 -3
  40. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  41. package/dist/components/Buttons/MenuButton.test.js +2 -2
  42. package/dist/components/Card/Card.stories.d.ts +3 -3
  43. package/dist/components/Checkbox/Checkbox.stories.d.ts +2 -2
  44. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  45. package/dist/components/CheckboxButton/CheckboxButton.stories.d.ts +1 -1
  46. package/dist/components/CheckboxButton/CheckboxButton.stories.js +1 -1
  47. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.d.ts +1 -1
  48. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  49. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  50. package/dist/components/CheckboxTree/CheckboxTree.stories.d.ts +1 -1
  51. package/dist/components/CheckboxTree/CheckboxTree.stories.js +109 -87
  52. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  53. package/dist/components/Chip/Chip.stories.d.ts +2 -2
  54. package/dist/components/Chip/Chip.stories.js +1 -1
  55. package/dist/components/Drawer/Drawer.stories.d.ts +2 -2
  56. package/dist/components/Drawer/Drawer.stories.js +1 -1
  57. package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.d.ts +1 -1
  58. package/dist/components/FeedbackBox/FeedbackBox.stories.d.ts +1 -1
  59. package/dist/components/FieldHint/FieldHint.stories.d.ts +2 -2
  60. package/dist/components/Fieldset/Fieldset.stories.d.ts +2 -2
  61. package/dist/components/FormField/FormField.stories.d.ts +1 -1
  62. package/dist/components/FormInput/FormInput.js +1 -1
  63. package/dist/components/FormInput/FormInput.stories.d.ts +2 -2
  64. package/dist/components/FormInput/FormInput.stories.js +1 -1
  65. package/dist/components/GridRow/GridRow.stories.d.ts +2 -2
  66. package/dist/components/HorizontalList/HorizontalList.stories.d.ts +2 -2
  67. package/dist/components/Icon/Icon.stories.d.ts +1 -1
  68. package/dist/components/Icon/icons/index.d.ts +30 -0
  69. package/dist/components/Icon/icons/index.js +160 -135
  70. package/dist/components/Icon/icons/index.js.map +1 -1
  71. package/dist/components/IconButton/IconButton.stories.d.ts +1 -1
  72. package/dist/components/IconButton/IconButton.stories.js +1 -1
  73. package/dist/components/InfoMessage/InfoMessage.stories.d.ts +1 -1
  74. package/dist/components/Input/Input.stories.d.ts +4 -4
  75. package/dist/components/InputField/InputField.stories.d.ts +3 -3
  76. package/dist/components/InputField/InputField.stories.js +2 -2
  77. package/dist/components/Label/Label.stories.d.ts +2 -2
  78. package/dist/components/Label/Label.test.js +2 -2
  79. package/dist/components/MenuLink/MenuLink.stories.d.ts +2 -2
  80. package/dist/components/MetaDataList/MetaDataList.stories.d.ts +1 -1
  81. package/dist/components/ModalDialog/ModalDialog.stories.d.ts +3 -3
  82. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  83. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  84. package/dist/components/MultiSelect/MultiSelect.stories.d.ts +3 -3
  85. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
  86. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  87. package/dist/components/MultiSelect/index.js +1 -1
  88. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.d.ts +1 -1
  89. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
  90. package/dist/components/OverlayStepBar/OverlayStepBar.js +1 -1
  91. package/dist/components/OverlayStepBar/OverlayStepBar.stories.d.ts +1 -1
  92. package/dist/components/PageOverlay/PageOverlay.stories.d.ts +3 -3
  93. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  94. package/dist/components/PeriodSelector/PeriodSelector.stories.d.ts +1 -1
  95. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  96. package/dist/components/Periods/Periods.stories.d.ts +1 -1
  97. package/dist/components/ProgrammeCard/ProgrammeCard.stories.d.ts +3 -3
  98. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
  99. package/dist/components/RadioButton/RadioButton.stories.d.ts +1 -1
  100. package/dist/components/Repeater/Repeater.stories.d.ts +1 -1
  101. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  102. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +13 -13
  103. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +5 -5
  104. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  105. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  106. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +54 -54
  107. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  108. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +28 -28
  109. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +17 -17
  110. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  111. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +1 -1
  112. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
  113. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +24 -24
  114. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  115. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +13 -13
  116. package/dist/components/RteEditor/Plugins/index.js +1 -1
  117. package/dist/components/RteEditor/RteEditor.js +528 -537
  118. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  119. package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -1
  120. package/dist/components/RteEditor/helpers.js +13 -13
  121. package/dist/components/SectionNotification/SectionNotification.stories.d.ts +1 -1
  122. package/dist/components/SelectListbox/SelectListBox.stories.d.ts +2 -2
  123. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  124. package/dist/components/Sortable/Sortable.stories.d.ts +3 -3
  125. package/dist/components/Sortable/Sortable.stories.js +7 -7
  126. package/dist/components/Spinner/Spinner.stories.d.ts +1 -1
  127. package/dist/components/StatusPill/StatusPill.stories.d.ts +1 -1
  128. package/dist/components/ToggleSwitch/ToggleSwitch.stories.d.ts +1 -1
  129. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +5 -5
  130. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -1
  131. package/dist/components/VarIndicator/VarIndicator.d.ts +9 -0
  132. package/dist/components/VarIndicator/VarIndicator.js +32 -0
  133. package/dist/components/VarIndicator/VarIndicator.js.map +1 -0
  134. package/dist/components/VarIndicator/VarIndicator.stories.d.ts +5 -0
  135. package/dist/components/VarIndicator/VarIndicator.stories.js +30 -0
  136. package/dist/components/VarIndicator/VarIndicator.stories.js.map +1 -0
  137. package/dist/components/VarIndicator/VarIndicator.test.d.ts +0 -0
  138. package/dist/components/VarIndicator/VarIndicator.test.js +58 -0
  139. package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -0
  140. package/dist/components/VarIndicator/index.d.ts +1 -0
  141. package/dist/components/VarIndicator/index.js +5 -0
  142. package/dist/components/VarIndicator/index.js.map +1 -0
  143. package/dist/components/index.d.ts +1 -0
  144. package/dist/components/index.js +32 -30
  145. package/dist/components/index.js.map +1 -1
  146. package/dist/helpers-C-JeRM2f.js +164 -0
  147. package/dist/helpers-C-JeRM2f.js.map +1 -0
  148. package/dist/index-BldK5xU9.js +9513 -0
  149. package/dist/index-BldK5xU9.js.map +1 -0
  150. package/dist/{index-OJvb7CGo.js → index-DMVXQIB9.js} +2 -2
  151. package/dist/{index-OJvb7CGo.js.map → index-DMVXQIB9.js.map} +1 -1
  152. package/dist/index-DpyOH4wL.js +14735 -0
  153. package/dist/index-DpyOH4wL.js.map +1 -0
  154. package/dist/{index-BqHyOZsF.js → index-Z7qwJmRM.js} +2 -2
  155. package/dist/{index-BqHyOZsF.js.map → index-Z7qwJmRM.js.map} +1 -1
  156. package/dist/index.js +32 -30
  157. package/dist/index.js.map +1 -1
  158. package/dist/{react.esm-BZoQ2TxA.js → react.esm-BOUd0cvD.js} +3 -3
  159. package/dist/{react.esm-BZoQ2TxA.js.map → react.esm-BOUd0cvD.js.map} +1 -1
  160. package/dist/setupTests.js +1 -1
  161. package/dist/storybook__react.d.js +8528 -537
  162. package/dist/storybook__react.d.js.map +1 -1
  163. package/dist/{test-utils-CTqdUiUm.js → test-utils-uaSbIYda.js} +2 -2
  164. package/dist/{test-utils-CTqdUiUm.js.map → test-utils-uaSbIYda.js.map} +1 -1
  165. package/package.json +26 -26
  166. package/dist/Lexical.prod-D0woeN3R.js +0 -4770
  167. package/dist/Lexical.prod-D0woeN3R.js.map +0 -1
  168. package/dist/LexicalClipboard.prod-D9CvlqSO.js +0 -258
  169. package/dist/LexicalClipboard.prod-D9CvlqSO.js.map +0 -1
  170. package/dist/LexicalComposerContext.prod--Rm7-Z9o.js +0 -26
  171. package/dist/LexicalComposerContext.prod--Rm7-Z9o.js.map +0 -1
  172. package/dist/LexicalLink.prod-__08uNAw.js.map +0 -1
  173. package/dist/LexicalList.prod-BgI8r9BS.js +0 -579
  174. package/dist/LexicalList.prod-BgI8r9BS.js.map +0 -1
  175. package/dist/LexicalSelection.prod-B-SXpOS9.js +0 -86
  176. package/dist/LexicalSelection.prod-B-SXpOS9.js.map +0 -1
  177. package/dist/LexicalTable.prod-DJWDvnB3.js +0 -1494
  178. package/dist/LexicalTable.prod-DJWDvnB3.js.map +0 -1
  179. package/dist/LexicalUtils.prod-BYrJ1Iih.js +0 -112
  180. package/dist/LexicalUtils.prod-BYrJ1Iih.js.map +0 -1
  181. package/dist/helpers-Cgw7V6LR.js +0 -168
  182. package/dist/helpers-Cgw7V6LR.js.map +0 -1
  183. package/dist/index-2mUSc_Ki.js +0 -8
  184. package/dist/index-2mUSc_Ki.js.map +0 -1
  185. package/dist/index-CcK2jjMp.js +0 -23343
  186. package/dist/index-CcK2jjMp.js.map +0 -1
@@ -1,22 +1,22 @@
1
- import { jsx as h, jsxs as A, Fragment as Pe } from "react/jsx-runtime";
2
- import { o as We, l as Ve, u as P } from "../../LexicalComposerContext.prod--Rm7-Z9o.js";
3
- import { au as Te, a3 as O, f as Re, h as p, Q as q, Y as J, d as Xe, W as I, G as g, A as Ye, e as m, av as Ge, a2 as Ie, a as Ze, J as Me, aw as Qe, w as et, at as z, aq as tt, ax as nt, ay as rt, az as ot, j as ne, aA as it, aB as at, L as st, b as lt, q as ut, S as ct, aC as dt, aD as fe, r as me, T as ft, s as re, v as mt, N as Fe, aE as pe, l as pt, _ as gt, y as ht, a9 as ge, m as Ct, aF as yt, aG as vt, aH as wt, ap as Et, P as bt, x as St, aI as _t, z as xt, o as kt, n as Nt, ad as Lt, g as he, aJ as $t, R as Dt, af as Y, ae as G, aK as Pt, aL as Tt, ah as Rt, ag as It } from "../../Lexical.prod-D0woeN3R.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 Ze, ac as Ie, o as Ye, n as Me, aD as Qe, 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 Z, aS as Pt, aT as Tt, ao as Rt, an as It } from "../../Lexical.prod-CoFvB6ST.js";
4
4
  import * as oe from "react";
5
- import { useMemo as W, useLayoutEffect as U, useEffect as x, useState as M, useRef as ze, Suspense as Mt, forwardRef as Ae, useCallback as Ft } from "react";
6
- import { j, x as K, p as zt, m as de } from "../../LexicalUtils.prod-BYrJ1Iih.js";
7
- import { flushSync as At, createPortal as Kt } from "react-dom";
8
- import { N as Ce, O as ye, h as Ot, m as Bt } from "../../LexicalClipboard.prod-D9CvlqSO.js";
9
- import { H as ve, q as we } from "../../LexicalSelection.prod-B-SXpOS9.js";
10
- import { V as Ke, I as Oe, Z as Ut } from "../../LexicalList.prod-BgI8r9BS.js";
11
- import { f as Be, N as Ee, w as ie, m as jt, U as Ht } from "../../LexicalLink.prod-__08uNAw.js";
12
- import { I as qt, t as Jt, e as Wt, Z as Vt, h as Ue, S as Xt, U as Yt } from "../../LexicalTable.prod-DJWDvnB3.js";
13
- import { a as Gt, F as Zt, M as Qt } from "../../helpers-Cgw7V6LR.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-CqRL6ZhZ.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-BceK2u8q.js";
9
+ import { W as Ee, G as we } from "../../LexicalSelection.prod-CajyzNb9.js";
10
+ import { q as Ae, W as ze, n as Ut } from "../../LexicalList.prod-BsGg0KUo.js";
11
+ import { h as Be, O as ve, N as ie, d as Ht, p as Wt } from "../../LexicalLink.prod-DgAdBBH7.js";
12
+ import { Z as jt, f as qt, d as Jt, h as Vt, b as Ue, F as Xt, e as Gt } from "../../LexicalTable.prod-CNsOdwua.js";
13
+ import { a as Zt, w as Yt, M as Qt } from "../../helpers-C-JeRM2f.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
- import { useTranslation as an } from "./hooks/useTranslation.js";
19
- import "../../TablePlugin-BHY7_5Z8.js";
18
+ import { useTranslation as sn } from "./hooks/useTranslation.js";
19
+ import "../../TablePlugin-CFD5PSMc.js";
20
20
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
21
21
  import "./hooks/components/Flyout.js";
22
22
  import "../Buttons/Button.js";
@@ -27,7 +27,7 @@ import "@react-aria/dialog";
27
27
  import "@react-aria/focus";
28
28
  import "@react-aria/overlays";
29
29
  import "../OverlayCloseButton/OverlayCloseButton.js";
30
- import { FeedbackBox as sn } from "../FeedbackBox/FeedbackBox.js";
30
+ import { FeedbackBox as an } from "../FeedbackBox/FeedbackBox.js";
31
31
  import "../GridRow/GridRow.js";
32
32
  import "../IconButton/IconButton.js";
33
33
  import "../Input/Input.js";
@@ -41,126 +41,117 @@ 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 ? U : x, Z = { tag: "history-merge" };
45
- function pn({ initialConfig: t, children: e }) {
46
- const n = W(() => {
47
- const { theme: r, namespace: i, nodes: o, onError: a, editorState: s, html: l } = t, u = We(null, r), c = Te({ editable: t.editable, html: l, namespace: i, nodes: o, onError: (d) => a(d, c), theme: r });
44
+ const He = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = He ? U : k, Y = { 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 = O();
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
+ }, Y);
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, Y);
63
63
  break;
64
64
  }
65
65
  case "object":
66
- d.setEditorState(f, Z);
66
+ d.setEditorState(f, Y);
67
67
  break;
68
68
  case "function":
69
69
  d.update(() => {
70
- O().isEmpty() && f(d);
71
- }, Z);
70
+ z().isEmpty() && f(d);
71
+ }, Y);
72
72
  }
73
73
  }
74
- }(c, s), [c, u];
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 ? U : x;
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 = W(() => t(e), [e, t]), [r, i] = M(() => n.initialValueFn()), o = ze(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: a, subscribe: s } = n, l = a();
90
- return o.current !== l && (o.current = l, i(l)), s((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 O().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 = O().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 (q(i)) return !1;
111
- if (J(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(), a = o.length;
114
- for (let s = 0; s < a; s++) {
115
- const l = o[r];
113
+ const r = i.getChildren(), s = r.length;
114
+ for (let a = 0; a < s; a++) {
115
+ const l = r[o];
116
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") {
141
- let a;
130
+ const r = o.data;
131
+ if (typeof r == "string") {
132
+ let s;
142
133
  try {
143
- a = JSON.parse(o);
134
+ s = JSON.parse(r);
144
135
  } catch {
145
136
  return;
146
137
  }
147
- if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
148
- const s = a.payload;
149
- if (s && s.functionId === "makeChanges") {
150
- const l = s.args;
138
+ if (s && s.protocol === "nuanria_messaging" && s.type === "request") {
139
+ const a = s.payload;
140
+ if (a && a.functionId === "makeChanges") {
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 k = E.anchor;
157
- let v = k.getNode(), w = 0, S = 0;
158
- if (I(v) && u >= 0 && c >= 0 && (w = u, S = u + c, E.setTextNodeRange(v, w, v, S)), w === S && d === "" || (E.insertRawText(d), v = k.getNode()), I(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,546 +159,546 @@ 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"), xn = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), Nn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, _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 = Ye();
178
+ function Q(n) {
188
179
  let e = null;
189
- if (K(t, DragEvent) ? e = t.dataTransfer : K(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 xe(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], a = o.getKey();
199
- if (n.has(a)) continue;
200
- const s = de(o, (u) => J(u) && !u.isInline());
201
- if (s === null) continue;
202
- const l = s.getKey();
203
- s.canIndent() && !n.has(l) && (n.add(l), t(s));
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());
192
+ if (a === null) continue;
193
+ const l = a.getKey();
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 q(e);
210
- }
211
- function ae(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 !!z(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(kt, (e) => {
225
- const n = p();
226
- return !!g(n) && (n.deleteLine(e), !0);
227
- }, m), t.registerCommand(xt, (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) && !z(n)) return !1;
249
- const r = n.getNodes();
250
- for (const i of r) {
251
- const o = de(i, (a) => J(a) && !a.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, () => xe((e) => {
262
- const n = e.getIndent();
263
- e.setIndent(n + 1);
264
- }), m), t.registerCommand(pe, () => xe((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 (z(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 && q(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 (z(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 === O().getChildrenSize();
286
- }(n)) return e.preventDefault(), !0;
287
- const r = ge(n.focus, !1);
288
- if (!e.shiftKey && q(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 (z(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 (z(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 && !Fe(i) && zt(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 (ae(n), e !== null) {
326
- if ((Se || xn || 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(at, (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] = Q(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: a } = i, s = ne(a);
339
- if (s !== null) {
340
- const l = st();
341
- if (I(s)) l.anchor.set(s.getKey(), o, "text"), l.focus.set(s.getKey(), o, "text");
329
+ const { offset: r, node: s } = i, a = ne(s);
330
+ if (a !== null) {
331
+ const l = at();
332
+ if (I(a)) l.anchor.set(a.getKey(), r, "text"), l.focus.set(a.getKey(), r, "text");
342
333
  else {
343
- const c = s.getParentOrThrow().getKey(), d = s.getIndexWithinParent() + 1;
334
+ const c = a.getParentOrThrow().getKey(), d = a.getIndexWithinParent() + 1;
344
335
  l.anchor.set(c, d, "element"), l.focus.set(c, d, "element");
345
336
  }
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] = Q(e), o = p();
348
+ return !(t && !g(o));
349
+ }, m), n.registerCommand(ot, (e) => {
350
+ const [t] = Q(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
- q(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, K(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(et, (e) => (async function(n, r) {
368
- await ye(r, K(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() : z(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(Ie, (e) => {
373
- const [, n, r] = Q(e);
374
- return n.length > 0 && !r ? (t.dispatchCommand(_e, n), !0) : Me(e.target) && Qe(e.target) ? !1 : p() !== null && (function(i, o) {
375
- i.preventDefault(), o.update(() => {
376
- const a = p(), s = K(i, InputEvent) || K(i, KeyboardEvent) ? null : i.clipboardData;
377
- s != null && a !== null && Ce(s, a, o);
363
+ }(e, n), !0), m), n.registerCommand(Ie, (e) => {
364
+ const [, t, o] = Q(e);
365
+ return t.length > 0 && !o ? (n.dispatchCommand(Se, t), !0) : Me(e.target) && Qe(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(Ge, (e) => {
381
- const n = p();
382
- return g(n) && ae(n), !1;
383
- }, m), t.registerCommand(Ye, (e) => {
384
- const n = p();
385
- return g(n) && ae(n), !1;
370
+ }(e, n), !0);
371
+ }, m), n.registerCommand(Ze, (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 se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : x;
389
- function ke(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, a) {
394
- const [s, l] = M(() => o.getDecorators());
395
- return se(() => o.registerDecoratorListener((u) => {
396
- At(() => {
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]), x(() => {
400
- l(o.getDecorators());
401
- }, [o]), W(() => {
402
- const u = [], c = Object.keys(s);
390
+ }), [r]), k(() => {
391
+ l(r.getDecorators());
392
+ }, [r]), J(() => {
393
+ const u = [], c = Object.keys(a);
403
394
  for (let d = 0; d < c.length; d++) {
404
- const f = c[d], C = h(a, { onError: (E) => o._onError(E), children: h(Mt, { fallback: null, children: s[f] }) }), y = o.getElementByKey(f);
405
- y !== null && u.push(Kt(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
- }, [a, s, o]);
409
- }(r, n);
410
- return function(o) {
411
- se(() => j(Ln(o), bn(o)), [o]);
412
- }(r), A(Pe, { children: [t, h(Dn, { content: e }), i] });
413
- }
414
- function Dn({ content: t }) {
415
- const [e] = P(), n = function(i) {
416
- const [o, a] = M(() => ke(i));
417
- return se(() => {
418
- function s() {
419
- const l = ke(i);
420
- a(l);
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));
408
+ return ae(() => {
409
+ function a() {
410
+ const l = xe(i);
411
+ s(l);
421
412
  }
422
- return s(), j(i.registerUpdateListener(() => {
423
- s();
413
+ return a(), H(i.registerUpdateListener(() => {
414
+ a();
424
415
  }), i.registerEditableListener(() => {
425
- s();
416
+ a();
426
417
  }));
427
- }, [i]), o;
428
- }(e), r = Cn();
429
- return n ? typeof t == "function" ? t(r) : t : null;
430
- }
431
- const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : x;
432
- function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: a, ariaInvalid: s, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: C, className: y, id: E, role: k = "textbox", spellCheck: v = !0, style: w, tabIndex: S, "data-testid": N, ...b }, L) {
433
- const [_, T] = M(t.isEditable()), F = Ft(($) => {
434
- $ && $.ownerDocument && $.ownerDocument.defaultView ? t.setRootElement($) : t.setRootElement(null);
435
- }, [t]), B = W(() => /* @__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
432
  }(L, F), [F, L]);
442
- return qe(() => (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": _ && k === "combobox" ? !!a : void 0, ...s != null ? { "aria-invalid": s } : {}, "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: B, role: _ ? k : void 0, spellCheck: v, style: w, tabIndex: S, ...b });
445
- }
446
- const Tn = Ae(Pn);
447
- function Ne(t) {
448
- return t.getEditorState().read(He(t.isComposing()));
449
- }
450
- const Rn = Ae(In);
451
- function In(t, e) {
452
- const { placeholder: n, ...r } = t, [i] = P();
453
- return A(Pe, { children: [h(Tn, { editor: i, ...r, ref: e }), n != null && h(Mn, { editor: i, content: n })] });
454
- }
455
- function Mn({ content: t, editor: e }) {
456
- const n = function(a) {
457
- const [s, l] = M(() => Ne(a));
458
- return qe(() => {
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
- const c = Ne(a);
451
+ const c = Ne(s);
461
452
  l(c);
462
453
  }
463
- return u(), j(a.registerUpdateListener(() => {
454
+ return u(), H(s.registerUpdateListener(() => {
464
455
  u();
465
- }), a.registerEditableListener(() => {
456
+ }), s.registerEditableListener(() => {
466
457
  u();
467
458
  }));
468
- }, [a]), s;
469
- }(e), [r, i] = M(e.isEditable());
470
- if (U(() => (i(e.isEditable()), e.registerEditableListener((a) => {
471
- i(a);
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 }, Fn = function(t) {
482
- var e, n;
483
- function r() {
484
- for (var o, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
485
- return (o = t.call.apply(t, [this].concat(s)) || this).state = Le, o.resetErrorBoundary = function() {
459
+ }, [s]), a;
460
+ }(e), [o, i] = M(e.isEditable());
461
+ if (U(() => (i(e.isEditable()), e.registerEditableListener((s) => {
462
+ i(s);
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, a) {
497
- var s, l;
498
- (s = (l = this.props).onError) == null || s.call(l, o, a);
499
- }, i.componentDidUpdate = function(o, a) {
500
- var s, l, u, c, d = this.state.error, f = this.props.resetKeys;
501
- d !== null && a.error !== null && ((u = o.resetKeys) === void 0 && (u = []), (c = f) === void 0 && (c = []), u.length !== c.length || u.some(function(C, y) {
487
+ }, i.componentDidCatch = function(r, s) {
488
+ var a, l;
489
+ (a = (l = this.props).onError) == null || a.call(l, r, s);
490
+ }, i.componentDidUpdate = function(r, s) {
491
+ var a, l, u, c, d = this.state.error, f = this.props.resetKeys;
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
- })) && ((s = (l = this.props).onResetKeysChange) == null || s.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, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, u = a.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
- if (typeof s == "function") return s(c);
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 zn({ children: t, onError: e }) {
517
- return h(Fn, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
518
- }
519
- const An = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : x;
520
- function Kn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
521
- const [r] = P();
522
- return An(() => {
523
- if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
524
- e && o.size === 0 && a.size === 0 || t && l.has("history-merge") || s.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;
527
- }
528
- function On() {
529
- const [t] = P();
530
- return x(() => {
531
- if (!t.hasNodes([Ke, Oe])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
532
- }, [t]), function(e) {
533
- x(() => Ut(e), [e]);
534
- }(t), null;
517
+ }, [o, n, e, t]), null;
535
518
  }
536
- function Bn({ validateUrl: t, attributes: e }) {
519
+ function An() {
537
520
  const [n] = P();
538
- return x(() => {
539
- if (!n.hasNodes([Be])) 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);
521
+ return k(() => {
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;
526
+ }
527
+ function zn({ validateUrl: n, attributes: e }) {
528
+ const [t] = P();
529
+ return k(() => {
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: a, title: s } = r;
545
- return ie(i, { ...e, rel: a, target: o, title: s }), !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(Ie, (r) => {
538
+ }, he), n !== void 0 ? t.registerCommand(Ie, (o) => {
548
539
  const i = p();
549
- if (!g(i) || i.isCollapsed() || !K(r, ClipboardEvent)) return !1;
550
- const o = r;
551
- if (o.clipboardData === null) return !1;
552
- const a = o.clipboardData.getData("text");
553
- return !!t(a) && !i.getNodes().some((s) => J(s)) && (n.dispatchCommand(Ee, { ...e, url: a }), 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 Un({ newTab: t = !0, disabled: e = !1 }) {
559
- const [n] = P();
560
- return x(() => {
561
- const r = (o) => {
562
- const a = o.target;
563
- if (!Me(a)) return;
564
- const s = $t(a);
565
- if (s === null) return;
549
+ function Bn({ newTab: n = !0, disabled: e = !1 }) {
550
+ const [t] = P();
551
+ return k(() => {
552
+ const o = (r) => {
553
+ const s = r.target;
554
+ if (!Me(s)) return;
555
+ const a = Dt(s);
556
+ if (a === null) return;
566
557
  let l = null, u = null;
567
- if (s.update(() => {
568
- const f = ne(a);
558
+ if (a.update(() => {
559
+ const f = ne(s);
569
560
  if (f !== null) {
570
- const C = de(f, J);
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, k) {
574
- let v = E;
575
- for (; v != null; ) {
576
- if (k(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
- }(a, 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, a) => {
593
- a !== null && (a.removeEventListener("click", r), a.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, qn = 4;
598
- function Jn(t, e, n, r, i) {
599
- if (t === null || n.size === 0 && r.size === 0 && !i) return D;
600
- const o = e._selection, a = t._selection;
601
- if (i) return jn;
602
- if (!(g(o) && g(a) && a.isCollapsed() && o.isCollapsed())) return D;
603
- const s = 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
603
  T === void 0 || Fe(T) || b.push(T);
613
604
  }
614
605
  return b;
615
- }(e, n, r);
616
- if (s.length === 0) return D;
617
- if (s.length > 1) {
618
- const v = e._nodeMap, w = v.get(o.anchor.key), S = v.get(a.anchor.key);
619
- return w && S && !t._nodeMap.has(w.__key) && I(w) && w.__text.length === 1 && o.anchor.offset === 1 ? $e : D;
606
+ }(e, t, o);
607
+ if (a.length === 0) return $;
608
+ if (a.length > 1) {
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 = s[0], u = t._nodeMap.get(l.__key);
622
- if (!I(u) || !I(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 = a.anchor;
626
- if (f.key !== C.key || f.type !== "text") return D;
627
- const y = f.offset, E = C.offset, k = d.length - c.length;
628
- return k === 1 && E === y - 1 ? $e : k === -1 && E === y + 1 ? Hn : k === -1 && E === y ? qn : D;
629
- }
630
- function Wn(t, e) {
631
- let n = Date.now(), r = D;
632
- return (i, o, a, s, 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 = Jn(i, o, s, l, t.isComposing()), f = (() => {
636
- const C = a === null || a.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 s.size > 0 || l.size > 0 ? y === !1 && d !== D && d === r && c < n + e && C || s.size === 1 && function(k, v, w) {
641
- const S = v._nodeMap.get(k), N = w._nodeMap.get(k), 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" || !I(S) || !I(N) || S.__parent !== N.__parent) && JSON.stringify(v.read(() => S.exportJSON())) === JSON.stringify(w.read(() => N.exportJSON()));
643
- }(Array.from(s)[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 = Wn(t, n);
653
- return j(t.registerCommand(It, () => (function(o, a) {
654
- const s = a.redoStack, l = a.undoStack;
642
+ function Jn(n, e, t) {
643
+ const o = qn(n, t);
644
+ return H(n.registerCommand(It, () => (function(r, s) {
645
+ const a = s.redoStack, l = s.undoStack;
655
646
  if (l.length !== 0) {
656
- const u = a.current, c = l.pop();
657
- u !== null && (s.push(u), o.dispatchCommand(Y, !0)), l.length === 0 && o.dispatchCommand(G, !1), a.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
647
+ const u = s.current, c = l.pop();
648
+ u !== null && (a.push(u), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Z, !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, a) {
660
- const s = a.redoStack, l = a.undoStack;
661
- if (s.length !== 0) {
662
- const u = a.current;
663
- u !== null && (l.push(u), o.dispatchCommand(G, !0));
664
- const c = s.pop();
665
- s.length === 0 && o.dispatchCommand(Y, !1), a.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
650
+ }(n, e), !0), m), n.registerCommand(Rt, () => (function(r, s) {
651
+ const a = s.redoStack, l = s.undoStack;
652
+ if (a.length !== 0) {
653
+ const u = s.current;
654
+ u !== null && (l.push(u), r.dispatchCommand(Z, !0));
655
+ const c = a.pop();
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(Y, !1), t.dispatchCommand(G, !1), !0), m), t.registerUpdateListener(({ editorState: o, prevEditorState: a, dirtyLeaves: s, 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(Z, !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(a, o, c, s, l, u);
671
- if (y === ue) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(Y, !1)), c !== null && (f.push({ ...c }), t.dispatchCommand(G, !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(Z, !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 Yn({ delay: t, externalHistoryState: e }) {
680
- const [n] = P();
681
- return function(r, i, o = 1e3) {
682
- const a = W(() => i || Xn(), [i]);
683
- x(() => Vn(r, a, o), [o, r, a]);
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 Gn({ 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
- return x(() => {
689
- qt(i, r);
690
- }, [i, r]), x(() => Jt(i), [i]), x(() => Wt(i, n), [i, n]), x(() => {
691
- if (!t) return Vt(i);
692
- }, [i, t]), x(() => {
693
- if (!e) return i.registerNodeTransform(Ue, (o) => {
694
- o.getBackgroundColor() !== null && o.setBackgroundColor(null);
679
+ return k(() => {
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 Je = 200, Zn = ({
699
- currentLanguage: t = "NL",
689
+ const qe = 200, Zn = ({
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,
705
- notValidatedText: a = "",
706
- maxHeightInRem: s = "20rem",
707
- maxWords: l = Je,
695
+ required: r = !1,
696
+ notValidatedText: s = "",
697
+ maxHeightInRem: a = "20rem",
698
+ maxWords: l = qe,
708
699
  onChange: u
709
700
  }) => {
710
- const { switchLanguage: c } = dn(), d = an(), [f] = M(() => Te()), [C, y] = M(0), [E, k] = M(0), v = ze(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 Je = 200, Zn = ({
717
708
  onError(b) {
718
709
  throw b;
719
710
  },
720
- nodes: [Ke, Oe, Be, Ht, Ue, Xt, Yt],
711
+ nodes: [Ae, ze, Be, Wt, Ue, Xt, Gt],
721
712
  editorState: (b) => {
722
- const _ = new DOMParser().parseFromString(e, "text/html"), T = Ot(b, _), F = O();
713
+ const S = new DOMParser().parseFromString(e, "text/html"), T = zt(b, S), F = z();
723
714
  if (F.clear(), nn(e))
724
715
  T.forEach((B) => {
725
716
  F.append(B);
726
717
  });
727
718
  else {
728
719
  const B = Re();
729
- T.forEach(($, V) => {
730
- V === 0 ? (B.append($), F.append(B)) : F.append($);
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(O().getTextContent().replace(/\s+/g, " ").trim())), _ = rn(Bt(L)), u(_);
727
+ let S = "";
728
+ y(_(z().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(L)), u(S);
738
729
  });
739
730
  };
740
- return x(() => {
741
- c(t.toLocaleLowerCase());
742
- }, [t, c]), x(() => {
731
+ return 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__ */ A("div", { className: R.editor__container, children: [
746
- /* @__PURE__ */ A("div", { className: R.editor__header, children: [
747
- /* @__PURE__ */ h(un, { label: r, info: i, required: o }),
748
- /* @__PURE__ */ A("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__ */ A(pn, { initialConfig: w, children: [
755
- /* @__PURE__ */ h(on, { editorScrollPosition: E }),
756
- /* @__PURE__ */ A("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
- style: { height: `${s}`, maxHeight: `${s}` },
771
- onScroll: (b) => k(b.currentTarget.scrollTop),
772
- ref: v
761
+ style: { height: `${a}`, maxHeight: `${a}` },
762
+ onScroll: (b) => x(b.currentTarget.scrollTop),
763
+ ref: E
773
764
  }
774
765
  ),
775
- placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
776
- ErrorBoundary: zn
766
+ placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: t }),
767
+ ErrorBoundary: Fn
777
768
  }
778
769
  ),
779
770
  /* @__PURE__ */ h(Gn, {}),
780
- /* @__PURE__ */ h(Yn, {}),
781
- /* @__PURE__ */ h(On, {}),
782
- /* @__PURE__ */ h(Bn, { validateUrl: Gt }),
783
- /* @__PURE__ */ h(Zt, { matchers: Qt }),
784
- /* @__PURE__ */ h(Un, {}),
785
- /* @__PURE__ */ h(Kn, { onChange: N }),
771
+ /* @__PURE__ */ h(Xn, {}),
772
+ /* @__PURE__ */ h(An, {}),
773
+ /* @__PURE__ */ h(zn, { validateUrl: Zt }),
774
+ /* @__PURE__ */ h(Yt, { matchers: Qt }),
775
+ /* @__PURE__ */ h(Bn, {}),
776
+ /* @__PURE__ */ h(On, { onChange: N }),
786
777
  /* @__PURE__ */ h(fn, {})
787
778
  ] })
788
779
  ] }) }),
789
- a !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: a })
780
+ s !== "" && /* @__PURE__ */ h(an, { level: "error", feedback: s })
790
781
  ] });
791
- }, Br = ({
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,
798
- notValidatedText: a = "",
799
- maxWords: s = Je,
788
+ required: r = !1,
789
+ notValidatedText: s = "",
790
+ maxWords: a = qe,
800
791
  onChange: l
801
792
  }) => /* @__PURE__ */ h(cn, { children: /* @__PURE__ */ h(
802
793
  Zn,
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,
810
- notValidatedText: a,
811
- maxWords: s,
800
+ required: r,
801
+ notValidatedText: s,
802
+ maxWords: a,
812
803
  onChange: l
813
804
  }
814
805
  ) });
815
806
  export {
816
807
  Zn as Rte,
817
- Br as RteEditor
808
+ zr as RteEditor
818
809
  };
819
810
  //# sourceMappingURL=RteEditor.js.map