@uva-glass/component-library 3.52.11 → 3.53.1

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 (185) hide show
  1. package/dist/{Lexical.prod-sd_e2sqT.js → Lexical.prod-CNQPQ6W-.js} +1428 -1410
  2. package/dist/Lexical.prod-CNQPQ6W-.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-Co2PF1UJ.js → LexicalClipboard.prod-BdghxvkJ.js} +75 -75
  4. package/dist/{LexicalClipboard.prod-Co2PF1UJ.js.map → LexicalClipboard.prod-BdghxvkJ.js.map} +1 -1
  5. package/dist/LexicalExtension.prod-qYTg6Mah.js +551 -0
  6. package/dist/LexicalExtension.prod-qYTg6Mah.js.map +1 -0
  7. package/dist/LexicalLink.prod-DjG5QZHP.js +502 -0
  8. package/dist/LexicalLink.prod-DjG5QZHP.js.map +1 -0
  9. package/dist/{LexicalList.prod-CIB0K0ja.js → LexicalList.prod-CzxWmBG3.js} +65 -65
  10. package/dist/LexicalList.prod-CzxWmBG3.js.map +1 -0
  11. package/dist/{LexicalSelection.prod-CCmcTP6S.js → LexicalSelection.prod-CqTp0hfr.js} +44 -44
  12. package/dist/LexicalSelection.prod-CqTp0hfr.js.map +1 -0
  13. package/dist/{LexicalTable.prod-Oa2YPHLl.js → LexicalTable.prod-C97KnedB.js} +331 -319
  14. package/dist/LexicalTable.prod-C97KnedB.js.map +1 -0
  15. package/dist/{LexicalUtils.prod-CjKjgnmx.js → LexicalUtils.prod-lqA_upYF.js} +39 -39
  16. package/dist/LexicalUtils.prod-lqA_upYF.js.map +1 -0
  17. package/dist/RteEditor.module-DaBh86FK.js +41 -0
  18. package/dist/RteEditor.module-DaBh86FK.js.map +1 -0
  19. package/dist/{TableCellResizerPlugin-DATbSzfg.js → TableCellResizerPlugin-BdgrIlKp.js} +57 -57
  20. package/dist/{TableCellResizerPlugin-DATbSzfg.js.map → TableCellResizerPlugin-BdgrIlKp.js.map} +1 -1
  21. package/dist/{TablePlugin-CqCjNBW_.js → TablePlugin-DBKzGTIm.js} +70 -70
  22. package/dist/{TablePlugin-CqCjNBW_.js.map → TablePlugin-DBKzGTIm.js.map} +1 -1
  23. package/dist/assets/AddCatalogueLinkForm.css +1 -0
  24. package/dist/assets/Flyout.css +1 -1
  25. package/dist/assets/RteEditor.css +1 -1
  26. package/dist/assets/variables.css +72 -72
  27. package/dist/chunk-GPBRNGY5-UqVYj0H5.js +4507 -0
  28. package/dist/chunk-GPBRNGY5-UqVYj0H5.js.map +1 -0
  29. package/dist/{client-CFLMKOFW.js → client-DkvV9jg_.js} +90 -90
  30. package/dist/{client-CFLMKOFW.js.map → client-DkvV9jg_.js.map} +1 -1
  31. package/dist/components/Accordion/Accordion.test.js +2 -2
  32. package/dist/components/AccordionCard/AccordionCard.test.js +2 -2
  33. package/dist/components/ActionList/ActionList.test.js +2 -2
  34. package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
  35. package/dist/components/Attention/Attention.test.js +1 -1
  36. package/dist/components/Backdrop/Backdrop.test.js +1 -1
  37. package/dist/components/Buttons/Button.stories.js +1 -1
  38. package/dist/components/Buttons/Button.test.js +1 -1
  39. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  40. package/dist/components/Buttons/LinkButton.test.js +1 -1
  41. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  42. package/dist/components/Buttons/MenuButton.test.js +1 -1
  43. package/dist/components/Card/Card.test.js +1 -1
  44. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  45. package/dist/components/Checkbox/Checkbox.test.js +2 -2
  46. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  47. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
  48. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  49. package/dist/components/CheckboxTree/CheckboxTree.stories.js +111 -55
  50. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  51. package/dist/components/Chip/Chip.stories.js +1 -1
  52. package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
  53. package/dist/components/Drawer/Drawer.stories.js +1 -1
  54. package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
  55. package/dist/components/FormInput/FormInput.js +1 -1
  56. package/dist/components/FormInput/FormInput.stories.js +1 -1
  57. package/dist/components/IconButton/IconButton.stories.js +1 -1
  58. package/dist/components/InputField/InputField.stories.js +2 -2
  59. package/dist/components/Label/Label.test.js +1 -1
  60. package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
  61. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  62. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  63. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
  64. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  65. package/dist/components/MultiSelect/index.js +1 -1
  66. package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
  67. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +1 -1
  68. package/dist/components/Notification/Notification.stories.js +1 -1
  69. package/dist/components/Notification/Notification.test.js +1 -1
  70. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
  71. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  72. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  73. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  74. package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
  75. package/dist/components/RadioGroup/Radiogroup.test.js +1 -1
  76. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  77. package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
  78. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  79. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  80. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.d.ts +22 -0
  81. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js +108 -0
  82. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js.map +1 -0
  83. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.d.ts +1 -0
  84. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js +5 -0
  85. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js.map +1 -0
  86. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.d.ts +8 -0
  87. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +182 -0
  88. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -0
  89. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.d.ts +1 -0
  90. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js +5 -0
  91. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js.map +1 -0
  92. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +6 -6
  93. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  94. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +0 -2
  95. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +108 -128
  96. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  97. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  98. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +2 -3
  99. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +52 -57
  100. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  101. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +7 -7
  102. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
  103. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  104. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  105. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -6
  106. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +25 -24
  107. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
  108. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  109. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -1
  110. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +66 -53
  111. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  112. package/dist/components/RteEditor/Plugins/index.js +8 -9
  113. package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +2 -2
  114. package/dist/components/RteEditor/Providers/LanguageProvider.js +4 -4
  115. package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -1
  116. package/dist/components/RteEditor/RteEditor.d.ts +8 -3
  117. package/dist/components/RteEditor/RteEditor.js +375 -347
  118. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  119. package/dist/components/RteEditor/RteEditor.stories.js +69 -33
  120. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  121. package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
  122. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +3 -2
  123. package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
  124. package/dist/components/RteEditor/helpers.js +26 -23
  125. package/dist/components/RteEditor/helpers.js.map +1 -1
  126. package/dist/components/RteEditor/hooks/components/Flyout.js +6 -16
  127. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  128. package/dist/components/RteEditor/hooks/useTranslation.d.ts +39 -1
  129. package/dist/components/RteEditor/hooks/useTranslation.js +6 -6
  130. package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -1
  131. package/dist/components/RteEditor/mockCatalogueSearchData.d.ts +18 -0
  132. package/dist/components/RteEditor/mockCatalogueSearchData.js +485 -0
  133. package/dist/components/RteEditor/mockCatalogueSearchData.js.map +1 -0
  134. package/dist/components/RteEditor/mockRteContent.d.ts +1 -1
  135. package/dist/components/RteEditor/mockRteContent.js +8 -6
  136. package/dist/components/RteEditor/mockRteContent.js.map +1 -1
  137. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.d.ts +29 -0
  138. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +126 -0
  139. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js.map +1 -0
  140. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.d.ts +1 -0
  141. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js +11 -0
  142. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js.map +1 -0
  143. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +58 -52
  144. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js.map +1 -1
  145. package/dist/components/RteEditor/nodes/index.d.ts +1 -0
  146. package/dist/components/RteEditor/nodes/index.js +14 -6
  147. package/dist/components/RteEditor/nodes/index.js.map +1 -1
  148. package/dist/components/RteEditor/translations.d.ts +41 -3
  149. package/dist/components/RteEditor/translations.js +44 -6
  150. package/dist/components/RteEditor/translations.js.map +1 -1
  151. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  152. package/dist/components/Sortable/Sortable.stories.js +1 -1
  153. package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
  154. package/dist/components/TextArea/TextArea.stories.js +1 -1
  155. package/dist/components/TextArea/TextArea.test.js +2 -2
  156. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
  157. package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
  158. package/dist/components/VarIndicator/VarIndicator.test.js +2 -2
  159. package/dist/components/index.js +1 -1
  160. package/dist/{index-DRQMriwT.js → index-BmvI9fji.js} +8665 -10000
  161. package/dist/index-BmvI9fji.js.map +1 -0
  162. package/dist/{index-BKK3EWVW.js → index-Daa6JVq6.js} +2 -2
  163. package/dist/{index-BKK3EWVW.js.map → index-Daa6JVq6.js.map} +1 -1
  164. package/dist/index.js +1 -1
  165. package/dist/react-18-vQ75Numl.js +41 -0
  166. package/dist/react-18-vQ75Numl.js.map +1 -0
  167. package/dist/{react.esm-BjO203QT.js → react.esm-CzkD5JmE.js} +2 -2
  168. package/dist/{react.esm-BjO203QT.js.map → react.esm-CzkD5JmE.js.map} +1 -1
  169. package/dist/storybook__react.d.js +4252 -4509
  170. package/dist/storybook__react.d.js.map +1 -1
  171. package/package.json +27 -27
  172. package/dist/Lexical.prod-sd_e2sqT.js.map +0 -1
  173. package/dist/LexicalLink.prod-BCE6Bg2N.js +0 -1047
  174. package/dist/LexicalLink.prod-BCE6Bg2N.js.map +0 -1
  175. package/dist/LexicalList.prod-CIB0K0ja.js.map +0 -1
  176. package/dist/LexicalSelection.prod-CCmcTP6S.js.map +0 -1
  177. package/dist/LexicalTable.prod-Oa2YPHLl.js.map +0 -1
  178. package/dist/LexicalUtils.prod-CjKjgnmx.js.map +0 -1
  179. package/dist/RteEditor.module-CUi7Vqe8.js +0 -37
  180. package/dist/RteEditor.module-CUi7Vqe8.js.map +0 -1
  181. package/dist/chunk-HERDX7MO-DaYu-eWo.js +0 -11320
  182. package/dist/chunk-HERDX7MO-DaYu-eWo.js.map +0 -1
  183. package/dist/index-DRQMriwT.js.map +0 -1
  184. package/dist/react-18-C6foUf2n.js +0 -42
  185. package/dist/react-18-C6foUf2n.js.map +0 -1
@@ -1,1047 +0,0 @@
1
- import { U as Z, l as jt, L as Kt } from "./LexicalUtils.prod-CjKjgnmx.js";
2
- import { aK as Wt, aL as zt, aM as Ft, aN as Jt, X as wt, aO as Bt, aP as Gt, ac as Vt, aQ as Zt, aR as Ht, ah as Xt, L as Qt, aS as qt, C as Yt, aT as dt, y as w, S as O, f as Rt, r as te, b as U, z as st, l as $, u as ee, aU as ne, v as ie, d as I, s as pt, aV as rt, k as Ut, o as mt, a0 as se, ad as re } from "./Lexical.prod-sd_e2sqT.js";
3
- const oe = Symbol.for("preact-signals");
4
- function X() {
5
- if (R > 1) return void R--;
6
- let n, t = !1;
7
- for (; P !== void 0; ) {
8
- let e = P;
9
- for (P = void 0, ot++; e !== void 0; ) {
10
- const i = e.o;
11
- if (e.o = void 0, e.f &= -3, !(8 & e.f) && Ot(e)) try {
12
- e.c();
13
- } catch (o) {
14
- t || (n = o, t = !0);
15
- }
16
- e = i;
17
- }
18
- }
19
- if (ot = 0, R--, t) throw n;
20
- }
21
- function Re(n) {
22
- if (R > 0) return n();
23
- R++;
24
- try {
25
- return n();
26
- } finally {
27
- X();
28
- }
29
- }
30
- let p, P;
31
- function vt(n) {
32
- const t = p;
33
- p = void 0;
34
- try {
35
- return n();
36
- } finally {
37
- p = t;
38
- }
39
- }
40
- let R = 0, ot = 0, G = 0;
41
- function xt(n) {
42
- if (p === void 0) return;
43
- let t = n.n;
44
- return t === void 0 || t.t !== p ? (t = { i: 0, S: n, p: p.s, n: void 0, t: p, e: void 0, x: void 0, r: t }, p.s !== void 0 && (p.s.n = t), p.s = t, n.n = t, 32 & p.f && n.S(t), t) : t.i === -1 ? (t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = p.s, t.n = void 0, p.s.n = t, p.s = t), t) : void 0;
45
- }
46
- function E(n, t) {
47
- this.v = n, this.i = 0, this.n = void 0, this.t = void 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
48
- }
49
- function le(n, t) {
50
- return new E(n, t);
51
- }
52
- function Ot(n) {
53
- for (let t = n.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
54
- return !1;
55
- }
56
- function St(n) {
57
- for (let t = n.s; t !== void 0; t = t.n) {
58
- const e = t.S.n;
59
- if (e !== void 0 && (t.r = e), t.S.n = t, t.i = -1, t.n === void 0) {
60
- n.s = t;
61
- break;
62
- }
63
- }
64
- }
65
- function kt(n) {
66
- let t, e = n.s;
67
- for (; e !== void 0; ) {
68
- const i = e.p;
69
- e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
70
- }
71
- n.s = t;
72
- }
73
- function C(n, t) {
74
- E.call(this, void 0), this.x = n, this.s = void 0, this.g = G - 1, this.f = 4, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
75
- }
76
- function Ct(n) {
77
- const t = n.u;
78
- if (n.u = void 0, typeof t == "function") {
79
- R++;
80
- const e = p;
81
- p = void 0;
82
- try {
83
- t();
84
- } catch (i) {
85
- throw n.f &= -2, n.f |= 8, ht(n), i;
86
- } finally {
87
- p = e, X();
88
- }
89
- }
90
- }
91
- function ht(n) {
92
- for (let t = n.s; t !== void 0; t = t.n) t.S.U(t);
93
- n.x = void 0, n.s = void 0, Ct(n);
94
- }
95
- function ae(n) {
96
- if (p !== this) throw new Error("Out-of-order effect");
97
- kt(this), p = n, this.f &= -2, 8 & this.f && ht(this), X();
98
- }
99
- function T(n, t) {
100
- this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = t?.name;
101
- }
102
- function lt(n, t) {
103
- const e = new T(n, t);
104
- try {
105
- e.c();
106
- } catch (o) {
107
- throw e.d(), o;
108
- }
109
- const i = e.d.bind(e);
110
- return i[Symbol.dispose] = i, i;
111
- }
112
- function Ue(n, t = {}) {
113
- const e = {};
114
- for (const i in n) {
115
- const o = t[i], s = le(o === void 0 ? n[i] : o);
116
- e[i] = s;
117
- }
118
- return e;
119
- }
120
- E.prototype.brand = oe, E.prototype.h = function() {
121
- return !0;
122
- }, E.prototype.S = function(n) {
123
- const t = this.t;
124
- t !== n && n.e === void 0 && (n.x = t, this.t = n, t !== void 0 ? t.e = n : vt(() => {
125
- var e;
126
- (e = this.W) == null || e.call(this);
127
- }));
128
- }, E.prototype.U = function(n) {
129
- if (this.t !== void 0) {
130
- const t = n.e, e = n.x;
131
- t !== void 0 && (t.x = e, n.e = void 0), e !== void 0 && (e.e = t, n.x = void 0), n === this.t && (this.t = e, e === void 0 && vt(() => {
132
- var i;
133
- (i = this.Z) == null || i.call(this);
134
- }));
135
- }
136
- }, E.prototype.subscribe = function(n) {
137
- return lt(() => {
138
- const t = this.value, e = p;
139
- p = void 0;
140
- try {
141
- n(t);
142
- } finally {
143
- p = e;
144
- }
145
- }, { name: "sub" });
146
- }, E.prototype.valueOf = function() {
147
- return this.value;
148
- }, E.prototype.toString = function() {
149
- return this.value + "";
150
- }, E.prototype.toJSON = function() {
151
- return this.value;
152
- }, E.prototype.peek = function() {
153
- const n = p;
154
- p = void 0;
155
- try {
156
- return this.value;
157
- } finally {
158
- p = n;
159
- }
160
- }, Object.defineProperty(E.prototype, "value", { get() {
161
- const n = xt(this);
162
- return n !== void 0 && (n.i = this.i), this.v;
163
- }, set(n) {
164
- if (n !== this.v) {
165
- if (ot > 100) throw new Error("Cycle detected");
166
- this.v = n, this.i++, G++, R++;
167
- try {
168
- for (let t = this.t; t !== void 0; t = t.x) t.t.N();
169
- } finally {
170
- X();
171
- }
172
- }
173
- } }), C.prototype = new E(), C.prototype.h = function() {
174
- if (this.f &= -3, 1 & this.f) return !1;
175
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === G)) return !0;
176
- if (this.g = G, this.f |= 1, this.i > 0 && !Ot(this)) return this.f &= -2, !0;
177
- const n = p;
178
- try {
179
- St(this), p = this;
180
- const t = this.x();
181
- (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
182
- } catch (t) {
183
- this.v = t, this.f |= 16, this.i++;
184
- }
185
- return p = n, kt(this), this.f &= -2, !0;
186
- }, C.prototype.S = function(n) {
187
- if (this.t === void 0) {
188
- this.f |= 36;
189
- for (let t = this.s; t !== void 0; t = t.n) t.S.S(t);
190
- }
191
- E.prototype.S.call(this, n);
192
- }, C.prototype.U = function(n) {
193
- if (this.t !== void 0 && (E.prototype.U.call(this, n), this.t === void 0)) {
194
- this.f &= -33;
195
- for (let t = this.s; t !== void 0; t = t.n) t.S.U(t);
196
- }
197
- }, C.prototype.N = function() {
198
- if (!(2 & this.f)) {
199
- this.f |= 6;
200
- for (let n = this.t; n !== void 0; n = n.x) n.t.N();
201
- }
202
- }, Object.defineProperty(C.prototype, "value", { get() {
203
- if (1 & this.f) throw new Error("Cycle detected");
204
- const n = xt(this);
205
- if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f) throw this.v;
206
- return this.v;
207
- } }), T.prototype.c = function() {
208
- const n = this.S();
209
- try {
210
- if (8 & this.f || this.x === void 0) return;
211
- const t = this.x();
212
- typeof t == "function" && (this.u = t);
213
- } finally {
214
- n();
215
- }
216
- }, T.prototype.S = function() {
217
- if (1 & this.f) throw new Error("Cycle detected");
218
- this.f |= 1, this.f &= -9, Ct(this), St(this), R++;
219
- const n = p;
220
- return p = this, ae.bind(this, n);
221
- }, T.prototype.N = function() {
222
- 2 & this.f || (this.f |= 2, this.o = P, P = this);
223
- }, T.prototype.d = function() {
224
- this.f |= 8, 1 & this.f || ht(this);
225
- }, T.prototype.dispose = function() {
226
- this.d();
227
- };
228
- function ue(n) {
229
- return (typeof n.nodes == "function" ? n.nodes() : n.nodes) || [];
230
- }
231
- function m(n, ...t) {
232
- const e = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
233
- i.append("code", n);
234
- for (const o of t) i.append("v", o);
235
- throw e.search = i.toString(), Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
236
- }
237
- function Dt(n, t) {
238
- if (n && t && !Array.isArray(t) && typeof n == "object" && typeof t == "object") {
239
- const e = n, i = t;
240
- for (const o in i) e[o] = Dt(e[o], i[o]);
241
- return n;
242
- }
243
- return t;
244
- }
245
- const gt = 0, at = 1, Tt = 2, q = 3, J = 4, D = 5, Y = 6, M = 7;
246
- function tt(n) {
247
- return n.id === gt;
248
- }
249
- function Lt(n) {
250
- return n.id === Tt;
251
- }
252
- function ce(n) {
253
- return (function(t) {
254
- return t.id === at;
255
- })(n) || m(305, String(n.id), String(at)), Object.assign(n, { id: Tt });
256
- }
257
- const fe = /* @__PURE__ */ new Set();
258
- class de {
259
- builder;
260
- configs;
261
- _dependency;
262
- _peerNameSet;
263
- extension;
264
- state;
265
- _signal;
266
- constructor(t, e) {
267
- this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: gt };
268
- }
269
- mergeConfigs() {
270
- let t = this.extension.config || {};
271
- const e = this.extension.mergeConfig ? this.extension.mergeConfig.bind(this.extension) : zt;
272
- for (const i of this.configs) t = e(t, i);
273
- return t;
274
- }
275
- init(t) {
276
- const e = this.state;
277
- Lt(e) || m(306, String(e.id));
278
- const i = { getDependency: this.getInitDependency.bind(this), getDirectDependentNames: this.getDirectDependentNames.bind(this), getPeer: this.getInitPeer.bind(this), getPeerNameSet: this.getPeerNameSet.bind(this) }, o = { ...i, getDependency: this.getDependency.bind(this), getInitResult: this.getInitResult.bind(this), getPeer: this.getPeer.bind(this) }, s = (function(a, f, h) {
279
- return Object.assign(a, { config: f, id: q, registerState: h });
280
- })(e, this.mergeConfigs(), i);
281
- let r;
282
- this.state = s, this.extension.init && (r = this.extension.init(t, s.config, i)), this.state = (function(a, f, h) {
283
- return Object.assign(a, { id: J, initResult: f, registerState: h });
284
- })(s, r, o);
285
- }
286
- build(t) {
287
- const e = this.state;
288
- let i;
289
- e.id !== J && m(307, String(e.id), String(D)), this.extension.build && (i = this.extension.build(t, e.config, e.registerState));
290
- const o = { ...e.registerState, getOutput: () => i, getSignal: this.getSignal.bind(this) };
291
- this.state = (function(s, r, a) {
292
- return Object.assign(s, { id: D, output: r, registerState: a });
293
- })(e, i, o);
294
- }
295
- register(t, e) {
296
- this._signal = e;
297
- const i = this.state;
298
- i.id !== D && m(308, String(i.id), String(D));
299
- const o = this.extension.register && this.extension.register(t, i.config, i.registerState);
300
- return this.state = (function(s) {
301
- return Object.assign(s, { id: Y });
302
- })(i), () => {
303
- const s = this.state;
304
- s.id !== M && m(309, String(i.id), String(M)), this.state = (function(r) {
305
- return Object.assign(r, { id: D });
306
- })(s), o && o();
307
- };
308
- }
309
- afterRegistration(t) {
310
- const e = this.state;
311
- let i;
312
- return e.id !== Y && m(310, String(e.id), String(Y)), this.extension.afterRegistration && (i = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = (function(o) {
313
- return Object.assign(o, { id: M });
314
- })(e), i;
315
- }
316
- getSignal() {
317
- return this._signal === void 0 && m(311), this._signal;
318
- }
319
- getInitResult() {
320
- this.extension.init === void 0 && m(312, this.extension.name);
321
- const t = this.state;
322
- return (function(e) {
323
- return e.id >= J;
324
- })(t) || m(313, String(t.id), String(J)), t.initResult;
325
- }
326
- getInitPeer(t) {
327
- const e = this.builder.extensionNameMap.get(t);
328
- return e ? e.getExtensionInitDependency() : void 0;
329
- }
330
- getExtensionInitDependency() {
331
- const t = this.state;
332
- return (function(e) {
333
- return e.id >= q;
334
- })(t) || m(314, String(t.id), String(q)), { config: t.config };
335
- }
336
- getPeer(t) {
337
- const e = this.builder.extensionNameMap.get(t);
338
- return e ? e.getExtensionDependency() : void 0;
339
- }
340
- getInitDependency(t) {
341
- const e = this.builder.getExtensionRep(t);
342
- return e === void 0 && m(315, this.extension.name, t.name), e.getExtensionInitDependency();
343
- }
344
- getDependency(t) {
345
- const e = this.builder.getExtensionRep(t);
346
- return e === void 0 && m(315, this.extension.name, t.name), e.getExtensionDependency();
347
- }
348
- getState() {
349
- const t = this.state;
350
- return (function(e) {
351
- return e.id >= M;
352
- })(t) || m(316, String(t.id), String(M)), t;
353
- }
354
- getDirectDependentNames() {
355
- return this.builder.incomingEdges.get(this.extension.name) || fe;
356
- }
357
- getPeerNameSet() {
358
- let t = this._peerNameSet;
359
- return t || (t = new Set((this.extension.peerDependencies || []).map(([e]) => e)), this._peerNameSet = t), t;
360
- }
361
- getExtensionDependency() {
362
- if (!this._dependency) {
363
- const t = this.state;
364
- (function(e) {
365
- return e.id >= D;
366
- })(t) || m(317, this.extension.name), this._dependency = { config: t.config, init: t.initResult, output: t.output };
367
- }
368
- return this._dependency;
369
- }
370
- }
371
- const _t = { tag: qt };
372
- function he() {
373
- const n = Xt();
374
- n.isEmpty() && n.append(Qt());
375
- }
376
- const ge = Ft({ config: Zt({ setOptions: _t, updateOptions: _t }), init: ({ $initialEditorState: n = he }) => ({ $initialEditorState: n, initialized: !1 }), afterRegistration(n, { updateOptions: t, setOptions: e }, i) {
377
- const o = i.getInitResult();
378
- if (!o.initialized) {
379
- o.initialized = !0;
380
- const { $initialEditorState: s } = o;
381
- if (Ht(s)) n.setEditorState(s, e);
382
- else if (typeof s == "function") n.update(() => {
383
- s(n);
384
- }, t);
385
- else if (s && (typeof s == "string" || typeof s == "object")) {
386
- const r = n.parseEditorState(s);
387
- n.setEditorState(r, e);
388
- }
389
- }
390
- return () => {
391
- };
392
- }, name: "@lexical/extension/InitialState", nodes: [Jt, wt, Bt, Gt, Vt] }), yt = Symbol.for("@lexical/extension/LexicalBuilder");
393
- function Et() {
394
- }
395
- function pe(n) {
396
- throw n;
397
- }
398
- function B(n) {
399
- return Array.isArray(n) ? n : [n];
400
- }
401
- const et = "0.38.2+prod.esm";
402
- class A {
403
- roots;
404
- extensionNameMap;
405
- outgoingConfigEdges;
406
- incomingEdges;
407
- conflicts;
408
- _sortedExtensionReps;
409
- PACKAGE_VERSION;
410
- constructor(t) {
411
- this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = et, this.roots = t;
412
- for (const e of t) this.addExtension(e);
413
- }
414
- static fromExtensions(t) {
415
- const e = [B(ge)];
416
- for (const i of t) e.push(B(i));
417
- return new A(e);
418
- }
419
- static maybeFromEditor(t) {
420
- const e = t[yt];
421
- return e && (e.PACKAGE_VERSION !== et && m(292, e.PACKAGE_VERSION, et), e instanceof A || m(293)), e;
422
- }
423
- static fromEditor(t) {
424
- const e = A.maybeFromEditor(t);
425
- return e === void 0 && m(294), e;
426
- }
427
- constructEditor() {
428
- const { $initialEditorState: t, onError: e, ...i } = this.buildCreateEditorArgs(), o = Object.assign(Wt({ ...i, ...e ? { onError: (s) => {
429
- e(s, o);
430
- } } : {} }), { [yt]: this });
431
- for (const s of this.sortedExtensionReps()) s.build(o);
432
- return o;
433
- }
434
- buildEditor() {
435
- let t = Et;
436
- function e() {
437
- try {
438
- t();
439
- } finally {
440
- t = Et;
441
- }
442
- }
443
- const i = Object.assign(this.constructEditor(), { dispose: e, [Symbol.dispose]: e });
444
- return t = Z(this.registerEditor(i), () => i.setRootElement(null)), i;
445
- }
446
- hasExtensionByName(t) {
447
- return this.extensionNameMap.has(t);
448
- }
449
- getExtensionRep(t) {
450
- const e = this.extensionNameMap.get(t.name);
451
- if (e) return e.extension !== t && m(295, t.name), e;
452
- }
453
- addEdge(t, e, i) {
454
- const o = this.outgoingConfigEdges.get(t);
455
- o ? o.set(e, i) : this.outgoingConfigEdges.set(t, /* @__PURE__ */ new Map([[e, i]]));
456
- const s = this.incomingEdges.get(e);
457
- s ? s.add(t) : this.incomingEdges.set(e, /* @__PURE__ */ new Set([t]));
458
- }
459
- addExtension(t) {
460
- this._sortedExtensionReps !== void 0 && m(296);
461
- const e = B(t), [i] = e;
462
- typeof i.name != "string" && m(297, typeof i.name);
463
- let o = this.extensionNameMap.get(i.name);
464
- if (o !== void 0 && o.extension !== i && m(298, i.name), !o) {
465
- o = new de(this, i), this.extensionNameMap.set(i.name, o);
466
- const s = this.conflicts.get(i.name);
467
- typeof s == "string" && m(299, i.name, s);
468
- for (const r of i.conflictsWith || []) this.extensionNameMap.has(r) && m(299, i.name, r), this.conflicts.set(r, i.name);
469
- for (const r of i.dependencies || []) {
470
- const a = B(r);
471
- this.addEdge(i.name, a[0].name, a.slice(1)), this.addExtension(a);
472
- }
473
- for (const [r, a] of i.peerDependencies || []) this.addEdge(i.name, r, a ? [a] : []);
474
- }
475
- }
476
- sortedExtensionReps() {
477
- if (this._sortedExtensionReps) return this._sortedExtensionReps;
478
- const t = [], e = (i, o) => {
479
- let s = i.state;
480
- if (Lt(s)) return;
481
- const r = i.extension.name;
482
- var a;
483
- tt(s) || m(300, r, o || "[unknown]"), tt(a = s) || m(304, String(a.id), String(gt)), s = Object.assign(a, { id: at }), i.state = s;
484
- const f = this.outgoingConfigEdges.get(r);
485
- if (f) for (const h of f.keys()) {
486
- const u = this.extensionNameMap.get(h);
487
- u && e(u, r);
488
- }
489
- s = ce(s), i.state = s, t.push(i);
490
- };
491
- for (const i of this.extensionNameMap.values()) tt(i.state) && e(i);
492
- for (const i of t) for (const [o, s] of this.outgoingConfigEdges.get(i.extension.name) || []) if (s.length > 0) {
493
- const r = this.extensionNameMap.get(o);
494
- if (r) for (const a of s) r.configs.add(a);
495
- }
496
- for (const [i, ...o] of this.roots) if (o.length > 0) {
497
- const s = this.extensionNameMap.get(i.name);
498
- s === void 0 && m(301, i.name);
499
- for (const r of o) s.configs.add(r);
500
- }
501
- return this._sortedExtensionReps = t, this._sortedExtensionReps;
502
- }
503
- registerEditor(t) {
504
- const e = this.sortedExtensionReps(), i = new AbortController(), o = [() => i.abort()], s = i.signal;
505
- for (const r of e) {
506
- const a = r.register(t, s);
507
- a && o.push(a);
508
- }
509
- for (const r of e) {
510
- const a = r.afterRegistration(t);
511
- a && o.push(a);
512
- }
513
- return Z(...o);
514
- }
515
- buildCreateEditorArgs() {
516
- const t = {}, e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = {}, r = {}, a = this.sortedExtensionReps();
517
- for (const u of a) {
518
- const { extension: l } = u;
519
- if (l.onError !== void 0 && (t.onError = l.onError), l.disableEvents !== void 0 && (t.disableEvents = l.disableEvents), l.parentEditor !== void 0 && (t.parentEditor = l.parentEditor), l.editable !== void 0 && (t.editable = l.editable), l.namespace !== void 0 && (t.namespace = l.namespace), l.$initialEditorState !== void 0 && (t.$initialEditorState = l.$initialEditorState), l.nodes) for (const c of ue(l)) {
520
- if (typeof c != "function") {
521
- const d = i.get(c.replace);
522
- d && m(302, l.name, c.replace.name, d.extension.name), i.set(c.replace, u);
523
- }
524
- e.add(c);
525
- }
526
- if (l.html) {
527
- if (l.html.export) for (const [c, d] of l.html.export.entries()) o.set(c, d);
528
- l.html.import && Object.assign(s, l.html.import);
529
- }
530
- l.theme && Dt(r, l.theme);
531
- }
532
- Object.keys(r).length > 0 && (t.theme = r), e.size && (t.nodes = [...e]);
533
- const f = Object.keys(s).length > 0, h = o.size > 0;
534
- (f || h) && (t.html = {}, f && (t.html.import = s), h && (t.html.export = o));
535
- for (const u of a) u.init(t);
536
- return t.onError || (t.onError = pe), t;
537
- }
538
- }
539
- function Oe(n, t) {
540
- const e = A.fromEditor(n).extensionNameMap.get(t);
541
- return e ? e.getExtensionDependency() : void 0;
542
- }
543
- const me = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
544
- class j extends Yt {
545
- __url;
546
- __target;
547
- __rel;
548
- __title;
549
- static getType() {
550
- return "link";
551
- }
552
- static clone(t) {
553
- return new j(t.__url, { rel: t.__rel, target: t.__target, title: t.__title }, t.__key);
554
- }
555
- constructor(t = "", e = {}, i) {
556
- super(i);
557
- const { target: o = null, rel: s = null, title: r = null } = e;
558
- this.__url = t, this.__target = o, this.__rel = s, this.__title = r;
559
- }
560
- createDOM(t) {
561
- const e = document.createElement("a");
562
- return this.updateLinkDOM(null, e, t), jt(e, t.theme.link), e;
563
- }
564
- updateLinkDOM(t, e, i) {
565
- if (dt(e)) {
566
- t && t.__url === this.__url || (e.href = this.sanitizeUrl(this.__url));
567
- for (const o of ["target", "rel", "title"]) {
568
- const s = `__${o}`, r = this[s];
569
- t && t[s] === r || (r ? e[o] = r : e.removeAttribute(o));
570
- }
571
- }
572
- }
573
- updateDOM(t, e, i) {
574
- return this.updateLinkDOM(t, e, i), !1;
575
- }
576
- static importDOM() {
577
- return { a: (t) => ({ conversion: ve, priority: 1 }) };
578
- }
579
- static importJSON(t) {
580
- return L().updateFromJSON(t);
581
- }
582
- updateFromJSON(t) {
583
- return super.updateFromJSON(t).setURL(t.url).setRel(t.rel || null).setTarget(t.target || null).setTitle(t.title || null);
584
- }
585
- sanitizeUrl(t) {
586
- t = Nt(t);
587
- try {
588
- const e = new URL(Nt(t));
589
- if (!me.has(e.protocol)) return "about:blank";
590
- } catch {
591
- return t;
592
- }
593
- return t;
594
- }
595
- exportJSON() {
596
- return { ...super.exportJSON(), rel: this.getRel(), target: this.getTarget(), title: this.getTitle(), url: this.getURL() };
597
- }
598
- getURL() {
599
- return this.getLatest().__url;
600
- }
601
- setURL(t) {
602
- const e = this.getWritable();
603
- return e.__url = t, e;
604
- }
605
- getTarget() {
606
- return this.getLatest().__target;
607
- }
608
- setTarget(t) {
609
- const e = this.getWritable();
610
- return e.__target = t, e;
611
- }
612
- getRel() {
613
- return this.getLatest().__rel;
614
- }
615
- setRel(t) {
616
- const e = this.getWritable();
617
- return e.__rel = t, e;
618
- }
619
- getTitle() {
620
- return this.getLatest().__title;
621
- }
622
- setTitle(t) {
623
- const e = this.getWritable();
624
- return e.__title = t, e;
625
- }
626
- insertNewAfter(t, e = !0) {
627
- const i = L(this.__url, { rel: this.__rel, target: this.__target, title: this.__title });
628
- return this.insertAfter(i, e), i;
629
- }
630
- canInsertTextBefore() {
631
- return !1;
632
- }
633
- canInsertTextAfter() {
634
- return !1;
635
- }
636
- canBeEmpty() {
637
- return !1;
638
- }
639
- isInline() {
640
- return !0;
641
- }
642
- extractWithChild(t, e, i) {
643
- if (!w(e)) return !1;
644
- const o = e.anchor.getNode(), s = e.focus.getNode();
645
- return this.isParentOf(o) && this.isParentOf(s) && e.getTextContent().length > 0;
646
- }
647
- isEmailURI() {
648
- return this.__url.startsWith("mailto:");
649
- }
650
- isWebSiteURI() {
651
- return this.__url.startsWith("https://") || this.__url.startsWith("http://");
652
- }
653
- }
654
- function ve(n) {
655
- let t = null;
656
- if (dt(n)) {
657
- const e = n.textContent;
658
- (e !== null && e !== "" || n.children.length > 0) && (t = L(n.getAttribute("href") || "", { rel: n.getAttribute("rel"), target: n.getAttribute("target"), title: n.getAttribute("title") }));
659
- }
660
- return { node: t };
661
- }
662
- function L(n = "", t) {
663
- return Rt(new j(n, t));
664
- }
665
- function b(n) {
666
- return n instanceof j;
667
- }
668
- class Q extends j {
669
- __isUnlinked;
670
- constructor(t = "", e = {}, i) {
671
- super(t, e, i), this.__isUnlinked = e.isUnlinked !== void 0 && e.isUnlinked !== null && e.isUnlinked;
672
- }
673
- static getType() {
674
- return "autolink";
675
- }
676
- static clone(t) {
677
- return new Q(t.__url, { isUnlinked: t.__isUnlinked, rel: t.__rel, target: t.__target, title: t.__title }, t.__key);
678
- }
679
- getIsUnlinked() {
680
- return this.__isUnlinked;
681
- }
682
- setIsUnlinked(t) {
683
- const e = this.getWritable();
684
- return e.__isUnlinked = t, e;
685
- }
686
- createDOM(t) {
687
- return this.__isUnlinked ? document.createElement("span") : super.createDOM(t);
688
- }
689
- updateDOM(t, e, i) {
690
- return super.updateDOM(t, e, i) || t.__isUnlinked !== this.__isUnlinked;
691
- }
692
- static importJSON(t) {
693
- return ut().updateFromJSON(t);
694
- }
695
- updateFromJSON(t) {
696
- return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked || !1);
697
- }
698
- static importDOM() {
699
- return null;
700
- }
701
- exportJSON() {
702
- return { ...super.exportJSON(), isUnlinked: this.__isUnlinked };
703
- }
704
- insertNewAfter(t, e = !0) {
705
- const i = this.getParentOrThrow().insertNewAfter(t, e);
706
- if (O(i)) {
707
- const o = ut(this.__url, { isUnlinked: this.__isUnlinked, rel: this.__rel, target: this.__target, title: this.__title });
708
- return i.append(o), o;
709
- }
710
- return null;
711
- }
712
- }
713
- function ut(n = "", t) {
714
- return Rt(new Q(n, t));
715
- }
716
- function N(n) {
717
- return n instanceof Q;
718
- }
719
- const ct = te("TOGGLE_LINK_COMMAND");
720
- function bt(n, t) {
721
- if (n.type === "element") {
722
- const e = n.getNode();
723
- return O(e) || (function(i, ...o) {
724
- const s = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
725
- r.append("code", i);
726
- for (const a of o) r.append("v", a);
727
- throw s.search = r.toString(), Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
728
- })(252), e.getChildren()[n.offset + t] || null;
729
- }
730
- return null;
731
- }
732
- function nt(n, t = {}) {
733
- let e;
734
- if (n && typeof n == "object") {
735
- const { url: u, ...l } = n;
736
- e = u, t = { ...l, ...t };
737
- } else e = n;
738
- const { target: i, title: o } = t, s = t.rel === void 0 ? "noreferrer" : t.rel, r = U();
739
- if (r === null || !w(r) && !rt(r)) return;
740
- if (rt(r)) {
741
- const u = r.getNodes();
742
- return u.length === 0 ? void 0 : void u.forEach((l) => {
743
- if (e === null) {
744
- const c = I(l, (d) => !N(d) && b(d));
745
- c && (c.insertBefore(l), c.getChildren().length === 0 && c.remove());
746
- } else {
747
- const c = I(l, (d) => !N(d) && b(d));
748
- if (c) c.setURL(e), i !== void 0 && c.setTarget(i), s !== void 0 && c.setRel(s);
749
- else {
750
- const d = L(e, { rel: s, target: i });
751
- l.insertBefore(d), d.append(l);
752
- }
753
- }
754
- });
755
- }
756
- const a = r.extract();
757
- if (e === null) {
758
- const u = /* @__PURE__ */ new Set();
759
- return void a.forEach((l) => {
760
- const c = l.getParent();
761
- if (b(c) && !N(c)) {
762
- const d = c.getKey();
763
- if (u.has(d)) return;
764
- (function(g, y) {
765
- const S = new Set(y.filter((_) => g.isParentOf(_)).map((_) => _.getKey())), v = g.getChildren(), x = v.filter((_) => S.has(_.getKey()));
766
- if (x.length === v.length) return v.forEach((_) => g.insertBefore(_)), void g.remove();
767
- const K = v.findIndex((_) => S.has(_.getKey())), W = v.findLastIndex((_) => S.has(_.getKey())), z = K === 0, F = W === v.length - 1;
768
- if (z) x.forEach((_) => g.insertBefore(_));
769
- else if (F) for (let _ = x.length - 1; _ >= 0; _--) g.insertAfter(x[_]);
770
- else {
771
- for (let k = x.length - 1; k >= 0; k--) g.insertAfter(x[k]);
772
- const _ = v.slice(W + 1);
773
- if (_.length > 0) {
774
- const k = L(g.getURL(), { rel: g.getRel(), target: g.getTarget(), title: g.getTitle() });
775
- x[x.length - 1].insertAfter(k), _.forEach(($t) => k.append($t));
776
- }
777
- }
778
- })(c, a), u.add(d);
779
- }
780
- });
781
- }
782
- const f = /* @__PURE__ */ new Set(), h = (u) => {
783
- f.has(u.getKey()) || (f.add(u.getKey()), u.setURL(e), i !== void 0 && u.setTarget(i), s !== void 0 && u.setRel(s), o !== void 0 && u.setTitle(o));
784
- };
785
- if (a.length === 1) {
786
- const u = a[0], l = I(u, b);
787
- if (l !== null) return h(l);
788
- }
789
- (function(u) {
790
- const l = U();
791
- if (!w(l)) return u();
792
- const c = mt(l), d = c.isBackward(), g = bt(c.anchor, d ? -1 : 0), y = bt(c.focus, d ? 0 : -1);
793
- if (u(), g || y) {
794
- const S = U();
795
- if (w(S)) {
796
- const v = S.clone();
797
- if (g) {
798
- const x = g.getParent();
799
- x && v.anchor.set(x.getKey(), g.getIndexWithinParent() + (d ? 1 : 0), "element");
800
- }
801
- if (y) {
802
- const x = y.getParent();
803
- x && v.focus.set(x.getKey(), y.getIndexWithinParent() + (d ? 0 : 1), "element");
804
- }
805
- se(mt(v));
806
- }
807
- }
808
- })(() => {
809
- let u = null;
810
- for (const l of a) {
811
- if (!l.isAttached()) continue;
812
- const c = I(l, b);
813
- if (c) {
814
- h(c);
815
- continue;
816
- }
817
- if (O(l)) {
818
- if (!l.isInline()) continue;
819
- if (b(l)) {
820
- if (!(N(l) || u !== null && u.getParentOrThrow().isParentOf(l))) {
821
- h(l), u = l;
822
- continue;
823
- }
824
- for (const g of l.getChildren()) l.insertBefore(g);
825
- l.remove();
826
- continue;
827
- }
828
- }
829
- const d = l.getPreviousSibling();
830
- b(d) && d.is(u) ? d.append(l) : (u = L(e, { rel: s, target: i, title: o }), l.insertAfter(u), u.append(l));
831
- }
832
- });
833
- }
834
- const xe = /^\+?[0-9\s()-]{5,}$/;
835
- function Nt(n) {
836
- return n.match(/^[a-z][a-z0-9+.-]*:/i) || n.match(/^[/#.]/) ? n : n.includes("@") ? `mailto:${n}` : xe.test(n) ? `tel:${n}` : `https://${n}`;
837
- }
838
- function ke(n, t) {
839
- return Z(lt(() => n.registerCommand(ct, (e) => {
840
- const i = t.validateUrl.peek(), o = t.attributes.peek();
841
- if (e === null) return nt(null), !0;
842
- if (typeof e == "string") return !(i !== void 0 && !i(e)) && (nt(e, o), !0);
843
- {
844
- const { url: s, target: r, rel: a, title: f } = e;
845
- return nt(s, { ...o, rel: a, target: r, title: f }), !0;
846
- }
847
- }, st)), lt(() => {
848
- const e = t.validateUrl.value;
849
- if (!e) return;
850
- const i = t.attributes.value;
851
- return n.registerCommand(re, (o) => {
852
- const s = U();
853
- if (!w(s) || s.isCollapsed() || !Kt(o, ClipboardEvent) || o.clipboardData === null) return !1;
854
- const r = o.clipboardData.getData("text");
855
- return !!e(r) && !s.getNodes().some((a) => O(a)) && (n.dispatchCommand(ct, { ...i, url: r }), o.preventDefault(), !0);
856
- }, st);
857
- }));
858
- }
859
- function Ce(n, t, e = {}) {
860
- const i = (s) => {
861
- const r = s.target;
862
- if (!ee(r)) return;
863
- const a = ne(r);
864
- if (a === null) return;
865
- let f = null, h = null;
866
- if (a.update(() => {
867
- const c = ie(r);
868
- if (c !== null) {
869
- const d = I(c, O);
870
- if (!t.disabled.peek()) if (b(d)) f = d.sanitizeUrl(d.getURL()), h = d.getTarget();
871
- else {
872
- const g = (function(y, S) {
873
- let v = y;
874
- for (; v != null; ) {
875
- if (S(v)) return v;
876
- v = v.parentNode;
877
- }
878
- return null;
879
- })(r, dt);
880
- g !== null && (f = g.href, h = g.target);
881
- }
882
- }
883
- }), f === null || f === "") return;
884
- const u = n.getEditorState().read(U);
885
- if (w(u) && !u.isCollapsed()) return void s.preventDefault();
886
- const l = s.type === "auxclick" && s.button === 1;
887
- window.open(f, t.newTab.peek() || l || s.metaKey || s.ctrlKey || h === "_blank" ? "_blank" : "_self"), s.preventDefault();
888
- }, o = (s) => {
889
- s.button === 1 && i(s);
890
- };
891
- return n.registerRootListener((s, r) => {
892
- r !== null && (r.removeEventListener("click", i), r.removeEventListener("mouseup", o)), s !== null && (s.addEventListener("click", i, e), s.addEventListener("mouseup", o, e));
893
- });
894
- }
895
- function De(n, t = (e) => e) {
896
- return (e) => {
897
- const i = n.exec(e);
898
- return i === null ? null : { index: i.index, length: i[0].length, text: i[0], url: t(i[0]) };
899
- };
900
- }
901
- function Mt(n, t) {
902
- for (let e = 0; e < t.length; e++) {
903
- const i = t[e](n);
904
- if (i) return i;
905
- }
906
- return null;
907
- }
908
- const Se = /[.,;\s]/;
909
- function H(n) {
910
- return Se.test(n);
911
- }
912
- function It(n) {
913
- return H(n[n.length - 1]);
914
- }
915
- function ft(n) {
916
- return H(n[0]);
917
- }
918
- function Pt(n) {
919
- let t = n.getPreviousSibling();
920
- return O(t) && (t = t.getLastDescendant()), t === null || Ut(t) || $(t) && It(t.getTextContent());
921
- }
922
- function At(n) {
923
- let t = n.getNextSibling();
924
- return O(t) && (t = t.getFirstDescendant()), t === null || Ut(t) || $(t) && ft(t.getTextContent());
925
- }
926
- function _e(n, t, e, i) {
927
- return (n > 0 ? H(e[n - 1]) : Pt(i[0])) ? t < e.length ? H(e[t]) : At(i[i.length - 1]) : !1;
928
- }
929
- function ye(n, t, e) {
930
- const i = [], o = [], s = [];
931
- let r = 0, a = 0;
932
- const f = [...n];
933
- for (; f.length > 0; ) {
934
- const h = f[0], u = h.getTextContent().length, l = a;
935
- a + u <= t ? (i.push(h), r += u) : l >= e ? s.push(h) : o.push(h), a += u, f.shift();
936
- }
937
- return [r, i, o, s];
938
- }
939
- function Ee(n, t, e, i) {
940
- const o = ut(i.url, i.attributes);
941
- if (n.length === 1) {
942
- let s, r = n[0];
943
- t === 0 ? [s, r] = r.splitText(e) : [, s, r] = r.splitText(t, e);
944
- const a = pt(i.text);
945
- return a.setFormat(s.getFormat()), a.setDetail(s.getDetail()), a.setStyle(s.getStyle()), o.append(a), s.replace(o), r;
946
- }
947
- if (n.length > 1) {
948
- const s = n[0];
949
- let r, a = s.getTextContent().length;
950
- t === 0 ? r = s : [, r] = s.splitText(t);
951
- const f = [];
952
- let h;
953
- for (let d = 1; d < n.length; d++) {
954
- const g = n[d], y = g.getTextContent().length, S = a;
955
- if (S < e) if (a + y <= e) f.push(g);
956
- else {
957
- const [v, x] = g.splitText(e - S);
958
- f.push(v), h = x;
959
- }
960
- a += y;
961
- }
962
- const u = U(), l = u ? u.getNodes().find($) : void 0, c = pt(r.getTextContent());
963
- return c.setFormat(r.getFormat()), c.setDetail(r.getDetail()), c.setStyle(r.getStyle()), o.append(c, ...f), l && l === r && (w(u) ? c.select(u.anchor.offset, u.focus.offset) : rt(u) && c.select(0, c.getTextContent().length)), r.replace(o), h;
964
- }
965
- }
966
- function it(n, t, e) {
967
- const i = n.getChildren(), o = i.length;
968
- for (let f = 0; f < o; f++) {
969
- const h = i[f];
970
- if (!$(h) || !h.isSimpleText()) return V(n), void e(null, n.getURL());
971
- }
972
- const s = n.getTextContent(), r = Mt(s, t);
973
- if (r === null || r.text !== s || !Pt(n) || !At(n)) return V(n), void e(null, n.getURL());
974
- const a = n.getURL();
975
- if (a !== r.url && (n.setURL(r.url), e(r.url, a)), r.attributes) {
976
- const f = n.getRel();
977
- f !== r.attributes.rel && (n.setRel(r.attributes.rel || null), e(r.attributes.rel || null, f));
978
- const h = n.getTarget();
979
- h !== r.attributes.target && (n.setTarget(r.attributes.target || null), e(r.attributes.target || null, h));
980
- }
981
- }
982
- function V(n) {
983
- const t = n.getChildren();
984
- for (let e = t.length - 1; e >= 0; e--) n.insertAfter(t[e]);
985
- return n.remove(), t.map((e) => e.getLatest());
986
- }
987
- const be = { changeHandlers: [], matchers: [] };
988
- function Te(n, t = be) {
989
- const { matchers: e, changeHandlers: i } = t, o = (s, r) => {
990
- for (const a of i) a(s, r);
991
- };
992
- return Z(n.registerNodeTransform(wt, (s) => {
993
- const r = s.getParentOrThrow(), a = s.getPreviousSibling();
994
- if (N(r) && !r.getIsUnlinked()) it(r, e, o);
995
- else if (!b(r)) {
996
- if (s.isSimpleText() && (ft(s.getTextContent()) || !N(a))) {
997
- const f = (function(h) {
998
- const u = [h];
999
- let l = h.getNextSibling();
1000
- for (; l !== null && $(l) && l.isSimpleText() && (u.push(l), !/[\s]/.test(l.getTextContent())); ) l = l.getNextSibling();
1001
- return u;
1002
- })(s);
1003
- (function(h, u, l) {
1004
- let c = [...h];
1005
- const d = c.map((v) => v.getTextContent()).join("");
1006
- let g, y = d, S = 0;
1007
- for (; (g = Mt(y, u)) && g !== null; ) {
1008
- const v = g.index, x = v + g.length;
1009
- if (_e(S + v, S + x, d, c)) {
1010
- const [K, , W, z] = ye(c, S + v, S + x), F = Ee(W, S + v - K, S + x - K, g);
1011
- c = F ? [F, ...z] : z, l(g.url, null), S = 0;
1012
- } else S += x;
1013
- y = y.substring(x);
1014
- }
1015
- })(f, e, o);
1016
- }
1017
- (function(f, h, u) {
1018
- const l = f.getPreviousSibling(), c = f.getNextSibling(), d = f.getTextContent();
1019
- var g;
1020
- !N(l) || l.getIsUnlinked() || ft(d) && (g = d, !(l.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(g) : /^\.[a-zA-Z0-9]{1,}/.test(g))) || (l.append(f), it(l, h, u), u(null, l.getURL())), !N(c) || c.getIsUnlinked() || It(d) || (V(c), it(c, h, u), u(null, c.getURL()));
1021
- })(s, e, o);
1022
- }
1023
- }), n.registerCommand(ct, (s) => {
1024
- const r = U();
1025
- return s !== null || !w(r) || r.extract().forEach((a) => {
1026
- const f = a.getParent();
1027
- N(f) && (f.setIsUnlinked(!f.getIsUnlinked()), f.markDirty());
1028
- }), !1;
1029
- }, st));
1030
- }
1031
- export {
1032
- Q as A,
1033
- A as B,
1034
- ke as F,
1035
- Oe as G,
1036
- De as H,
1037
- nt as J,
1038
- ct as P,
1039
- Ue as a,
1040
- Re as b,
1041
- lt as d,
1042
- Te as l,
1043
- b as w,
1044
- j as y,
1045
- Ce as z
1046
- };
1047
- //# sourceMappingURL=LexicalLink.prod-BCE6Bg2N.js.map