@sps-woodland/core 8.56.2 → 8.56.3

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 (262) hide show
  1. package/lib/action-bar/action-bar/ActionBar.js +44 -59
  2. package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
  3. package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
  4. package/lib/action-bar/index.js +54 -74
  5. package/lib/action-bar/index.umd.cjs +1 -1
  6. package/lib/action-bar/style.css +2 -1
  7. package/lib/add-to-list/add-to-list/AddToList.js +220 -302
  8. package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
  9. package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
  10. package/lib/add-to-list/add-to-list/ListItem.js +24 -50
  11. package/lib/add-to-list/index.js +393 -453
  12. package/lib/add-to-list/index.umd.cjs +1 -1
  13. package/lib/add-to-list/style.css +2 -1
  14. package/lib/buttons/button/Button.js +95 -121
  15. package/lib/buttons/button/Button.ve.js +150 -9
  16. package/lib/buttons/index.js +281 -171
  17. package/lib/buttons/index.umd.cjs +1 -1
  18. package/lib/buttons/style.css +2 -1
  19. package/lib/cards/card/Card.js +19 -27
  20. package/lib/cards/card/Card.ve.js +4 -4
  21. package/lib/cards/card-footer/CardFooter.js +12 -13
  22. package/lib/cards/card-footer/CardFooter.ve.js +4 -4
  23. package/lib/cards/card-header/CardHeader.js +12 -13
  24. package/lib/cards/card-header/CardHeader.ve.js +4 -4
  25. package/lib/cards/card-title/CardTitle.js +11 -12
  26. package/lib/cards/card-title/CardTitle.ve.js +4 -4
  27. package/lib/cards/index.js +52 -52
  28. package/lib/cards/index.umd.cjs +1 -1
  29. package/lib/cards/style.css +2 -1
  30. package/lib/column-manager/column-manager/ColumnManager.js +95 -112
  31. package/lib/column-manager/column-manager/useColumnManager.js +59 -48
  32. package/lib/column-manager/index.js +2 -5
  33. package/lib/components/icon/Icon.ve.js +15 -5
  34. package/lib/components/icon/icons/sprite.svg.js +4 -4
  35. package/lib/content-row/content-row/ContentRow.js +146 -173
  36. package/lib/content-row/content-row/ContentRow.ve.js +105 -18
  37. package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
  38. package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
  39. package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
  40. package/lib/content-row/index.js +407 -318
  41. package/lib/content-row/index.umd.cjs +1 -1
  42. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
  43. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
  44. package/lib/content-row/style.css +2 -1
  45. package/lib/content-tiles/content-tile/ContentTile.js +71 -60
  46. package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
  47. package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
  48. package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
  49. package/lib/content-tiles/index.js +156 -118
  50. package/lib/content-tiles/index.umd.cjs +1 -1
  51. package/lib/content-tiles/style.css +2 -1
  52. package/lib/core.css +2 -1
  53. package/lib/dropdowns/dropdown/Dropdown.js +56 -68
  54. package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
  55. package/lib/dropdowns/index.js +171 -171
  56. package/lib/dropdowns/index.umd.cjs +1 -1
  57. package/lib/dropdowns/option-list/Option.js +14 -18
  58. package/lib/dropdowns/option-list/Option.ve.js +4 -5
  59. package/lib/dropdowns/option-list/OptionList.js +28 -44
  60. package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
  61. package/lib/dropdowns/style.css +2 -1
  62. package/lib/editable-table/EditableTable.js +68 -85
  63. package/lib/editable-table/index.js +1 -4
  64. package/lib/feedback-block/FeedbackBlock.js +40 -35
  65. package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
  66. package/lib/feedback-block/index.js +132 -85
  67. package/lib/feedback-block/index.umd.cjs +1 -1
  68. package/lib/feedback-block/style.css +2 -1
  69. package/lib/file-upload/file-upload/FileUpload.js +164 -202
  70. package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
  71. package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
  72. package/lib/file-upload/index.js +390 -353
  73. package/lib/file-upload/index.umd.cjs +1 -1
  74. package/lib/file-upload/style.css +2 -1
  75. package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
  76. package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
  77. package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
  78. package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
  79. package/lib/filter-tiles/index.js +142 -107
  80. package/lib/filter-tiles/index.umd.cjs +1 -1
  81. package/lib/filter-tiles/style.css +2 -1
  82. package/lib/focused-task/focused-task/FocusedTask.js +52 -74
  83. package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
  84. package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
  85. package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
  86. package/lib/focused-task/index.js +127 -144
  87. package/lib/focused-task/index.umd.cjs +1 -1
  88. package/lib/focused-task/style.css +2 -1
  89. package/lib/growler/Growler.js +78 -90
  90. package/lib/growler/Growler.ve.js +23 -12
  91. package/lib/growler/GrowlerListProvider.js +38 -39
  92. package/lib/growler/Sonner.ve.js +17 -12
  93. package/lib/growler/index.js +249 -274
  94. package/lib/growler/index.umd.cjs +1 -1
  95. package/lib/growler/sonner.js +73 -102
  96. package/lib/growler/style.css +2 -1
  97. package/lib/index.js +520 -501
  98. package/lib/index.umd.cjs +4 -4
  99. package/lib/insight-card/InsightCard.js +90 -84
  100. package/lib/insight-card/InsightCard.ve.js +148 -15
  101. package/lib/insight-card/InsightCardSet.js +12 -12
  102. package/lib/insight-card/index.js +269 -141
  103. package/lib/insight-card/index.umd.cjs +1 -1
  104. package/lib/insight-card/style.css +2 -1
  105. package/lib/key-value-set/index.js +97 -87
  106. package/lib/key-value-set/index.umd.cjs +1 -1
  107. package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
  108. package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
  109. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
  110. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
  111. package/lib/key-value-set/style.css +2 -1
  112. package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
  113. package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
  114. package/lib/list-bar/index.js +305 -301
  115. package/lib/list-bar/index.umd.cjs +1 -1
  116. package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
  117. package/lib/list-bar/list-bar/ListBar.js +105 -121
  118. package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
  119. package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
  120. package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
  121. package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
  122. package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
  123. package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
  124. package/lib/list-bar/style.css +2 -1
  125. package/lib/matrix/index.js +79 -87
  126. package/lib/matrix/index.umd.cjs +1 -1
  127. package/lib/matrix/matrix/Matrix.js +18 -26
  128. package/lib/matrix/matrix/Matrix.ve.js +4 -7
  129. package/lib/matrix/matrix-body/MatrixBody.js +10 -13
  130. package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
  131. package/lib/matrix/matrix-head/MatrixHead.js +10 -13
  132. package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
  133. package/lib/matrix/matrix-row/MatrixRow.js +10 -13
  134. package/lib/matrix/style.css +2 -1
  135. package/lib/modal/index.js +197 -187
  136. package/lib/modal/index.umd.cjs +1 -1
  137. package/lib/modal/modal/Modal.js +90 -108
  138. package/lib/modal/modal/Modal.ve.js +43 -13
  139. package/lib/modal/modal/useModal.js +19 -24
  140. package/lib/modal/modal-footer/ModalFooter.js +11 -12
  141. package/lib/modal/style.css +2 -1
  142. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
  143. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
  144. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
  145. package/lib/page-title/heading-level/HeadingLevel.js +8 -12
  146. package/lib/page-title/index.js +33 -40
  147. package/lib/page-title/index.umd.cjs +1 -1
  148. package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
  149. package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
  150. package/lib/page-title/page-title/PageTitle.js +15 -19
  151. package/lib/page-title/page-title/PageTitle.ve.js +4 -7
  152. package/lib/page-title/style.css +2 -1
  153. package/lib/photo/index.js +174 -177
  154. package/lib/photo/index.umd.cjs +1 -1
  155. package/lib/photo/photo/Photo.js +72 -81
  156. package/lib/photo/photo/Photo.ve.js +21 -7
  157. package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
  158. package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
  159. package/lib/photo/style.css +2 -1
  160. package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
  161. package/lib/product-bar/index.js +372 -395
  162. package/lib/product-bar/index.umd.cjs +1 -1
  163. package/lib/product-bar/product-bar/ProductBar.js +77 -103
  164. package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
  165. package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
  166. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
  167. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
  168. package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
  169. package/lib/product-bar/slack-link/SlackLink.js +26 -30
  170. package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
  171. package/lib/product-bar/style.css +2 -1
  172. package/lib/product-bar-vertical/index.js +240 -251
  173. package/lib/product-bar-vertical/index.umd.cjs +1 -1
  174. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
  175. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
  176. package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
  177. package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
  178. package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
  179. package/lib/product-bar-vertical/style.css +2 -1
  180. package/lib/progress-indicators/index.js +372 -255
  181. package/lib/progress-indicators/index.umd.cjs +1 -1
  182. package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
  183. package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
  184. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
  185. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
  186. package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
  187. package/lib/progress-indicators/style.css +2 -1
  188. package/lib/rich-text-editor/index.js +556 -582
  189. package/lib/rich-text-editor/index.umd.cjs +11 -11
  190. package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
  191. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
  192. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
  193. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
  194. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
  195. package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
  196. package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
  197. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
  198. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
  199. package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
  200. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
  201. package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
  202. package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
  203. package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
  204. package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
  205. package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
  206. package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
  207. package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
  208. package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
  209. package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
  210. package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
  211. package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
  212. package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
  213. package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
  214. package/lib/rich-text-editor/style.css +2 -1
  215. package/lib/scrollable-container/ScrollableContainer.js +18 -27
  216. package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
  217. package/lib/scrollable-container/index.js +20 -27
  218. package/lib/scrollable-container/index.umd.cjs +1 -1
  219. package/lib/scrollable-container/style.css +2 -1
  220. package/lib/side-nav/index.js +190 -228
  221. package/lib/side-nav/index.umd.cjs +1 -1
  222. package/lib/side-nav/side-nav/SideNav.js +43 -60
  223. package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
  224. package/lib/side-nav/side-nav/navContext.js +7 -7
  225. package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
  226. package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
  227. package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
  228. package/lib/side-nav/style.css +2 -1
  229. package/lib/sorting-header/caret/caret.ve.js +13 -5
  230. package/lib/sorting-header/index.js +269 -251
  231. package/lib/sorting-header/index.umd.cjs +1 -1
  232. package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
  233. package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
  234. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
  235. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
  236. package/lib/sorting-header/style.css +2 -1
  237. package/lib/style.css +2 -1
  238. package/lib/tabs/index.js +255 -201
  239. package/lib/tabs/index.umd.cjs +1 -1
  240. package/lib/tabs/style.css +2 -1
  241. package/lib/tabs/tab/Tab.js +24 -27
  242. package/lib/tabs/tab/Tab.ve.js +76 -6
  243. package/lib/tabs/tab-panel/TabPanel.js +16 -25
  244. package/lib/tabs/tabs/Tabs.js +101 -112
  245. package/lib/tabs/tabs/Tabs.ve.js +13 -11
  246. package/lib/tags/clickable-tag/ClickableTag.js +86 -90
  247. package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
  248. package/lib/tags/index.js +342 -199
  249. package/lib/tags/index.umd.cjs +1 -1
  250. package/lib/tags/split-tag/SplitTag.js +49 -30
  251. package/lib/tags/split-tag/SplitTag.ve.js +35 -9
  252. package/lib/tags/style.css +2 -1
  253. package/lib/tags/tag/Tag.js +42 -38
  254. package/lib/tags/tag/Tag.ve.js +41 -6
  255. package/lib/utils/cl.js +5 -5
  256. package/lib/zero-state/ZeroState.js +36 -29
  257. package/lib/zero-state/ZeroState.ve.js +29 -11
  258. package/lib/zero-state/index.js +103 -78
  259. package/lib/zero-state/index.umd.cjs +1 -1
  260. package/lib/zero-state/style.css +2 -1
  261. package/package.json +12 -12
  262. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
@@ -1,606 +1,580 @@
1
- import { Metadata as P, useChildTestIdAttrBuilder as V, cl as H } from "@sps-woodland/core";
2
- import * as d from "react";
3
- import { useMemo as C, useState as v, useCallback as x, useEffect as L, useRef as F } from "react";
4
- import { useSpsForm as $, SpsModal as Z, SpsLabel as S, SpsTextInput as M, SpsModalFooter as G } from "@spscommerce/ds-react";
5
- import { Button as j } from "@sps-woodland/core/button";
6
- import { useWoodlandLanguage as z } from "@spscommerce/i18n";
7
- import { Tokens as p } from "@sps-woodland/tokens";
8
- import K from "remark-parse";
9
- import q from "remark-rehype";
10
- import W from "rehype-sanitize";
11
- import J from "rehype-stringify";
12
- import { unified as B } from "unified";
13
- import { visit as Q } from "unist-util-visit";
14
- import X from "rehype-parse";
15
- import Y from "rehype-remark";
16
- import e0 from "remark-stringify";
17
- function t0({
18
- onClose: t,
19
- selectionDOMContextFind: n,
20
- selectionRange: e
21
- }) {
22
- const { t: r } = z(), o = d.useRef(e), c = d.useRef(!1), { formValue: i, formMeta: a, updateForm: s } = $({
23
- text: e?.toString() || "",
24
- link: ""
25
- });
26
- return d.useEffect(() => {
27
- if (!c.current) {
28
- const l = n((g) => g.tagName === "A");
29
- l && (s({
30
- text: l.textContent || "",
31
- link: l.getAttribute("href") || ""
32
- }), c.current = !0);
33
- }
34
- }, [n]), /* @__PURE__ */ d.createElement(
35
- Z,
36
- {
37
- title: "Add Link",
38
- onClose: () => t(o.current)
39
- },
40
- /* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(S, { for: a.fields.text }, r("richTextEditor.linkModal.text", { defaultValue: "Text" })), /* @__PURE__ */ d.createElement(M, { formMeta: a.fields.text, value: i.text }))),
41
- /* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(S, { for: a.fields.link }, r("richTextEditor.linkModal.link", { defaultValue: "Link" })), /* @__PURE__ */ d.createElement(M, { formMeta: a.fields.link, value: i.link }))),
42
- /* @__PURE__ */ d.createElement(G, null, /* @__PURE__ */ d.createElement(j, { onClick: () => t(o.current, i) }, r("richTextEditor.linkModal.ok", { defaultValue: "OK" })))
43
- );
1
+ import { Metadata as e, cl as t, useChildTestIdAttrBuilder as n } from "@sps-woodland/core";
2
+ import * as r from "react";
3
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
4
+ import { SpsLabel as l, SpsModal as u, SpsModalFooter as d, SpsTextInput as f, useSpsForm as p } from "@spscommerce/ds-react";
5
+ import { Button as m } from "@sps-woodland/core/button";
6
+ import { useWoodlandLanguage as h } from "@spscommerce/i18n";
7
+ import { Tokens as g } from "@sps-woodland/tokens";
8
+ import _ from "remark-parse";
9
+ import v from "remark-rehype";
10
+ import y from "rehype-sanitize";
11
+ import b from "rehype-stringify";
12
+ import { unified as x } from "unified";
13
+ import { visit as S } from "unist-util-visit";
14
+ import C from "rehype-parse";
15
+ import ee from "rehype-remark";
16
+ import te from "remark-stringify";
17
+ //#region src/rich-text-editor/rich-text-editor/RTELinkModal.tsx
18
+ function w({ onClose: e, selectionDOMContextFind: t, selectionRange: n }) {
19
+ let { t: i } = h(), a = r.useRef(n), o = r.useRef(!1), { formValue: s, formMeta: c, updateForm: g } = p({
20
+ text: n?.toString() || "",
21
+ link: ""
22
+ });
23
+ return r.useEffect(() => {
24
+ if (!o.current) {
25
+ let e = t((e) => e.tagName === "A");
26
+ e && (g({
27
+ text: e.textContent || "",
28
+ link: e.getAttribute("href") || ""
29
+ }), o.current = !0);
30
+ }
31
+ }, [t]), /* @__PURE__ */ r.createElement(u, {
32
+ title: "Add Link",
33
+ onClose: () => e(a.current)
34
+ }, /* @__PURE__ */ r.createElement("div", { className: "sg-row" }, /* @__PURE__ */ r.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ r.createElement(l, { for: c.fields.text }, i("richTextEditor.linkModal.text", { defaultValue: "Text" })), /* @__PURE__ */ r.createElement(f, {
35
+ formMeta: c.fields.text,
36
+ value: s.text
37
+ }))), /* @__PURE__ */ r.createElement("div", { className: "sg-row" }, /* @__PURE__ */ r.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ r.createElement(l, { for: c.fields.link }, i("richTextEditor.linkModal.link", { defaultValue: "Link" })), /* @__PURE__ */ r.createElement(f, {
38
+ formMeta: c.fields.link,
39
+ value: s.link
40
+ }))), /* @__PURE__ */ r.createElement(d, null, /* @__PURE__ */ r.createElement(m, { onClick: () => e(a.current, s) }, i("richTextEditor.linkModal.ok", { defaultValue: "OK" }))));
44
41
  }
45
- function n0(t, n, e) {
46
- return n in t ? Object.defineProperty(t, n, {
47
- value: e,
48
- enumerable: !0,
49
- configurable: !0,
50
- writable: !0
51
- }) : t[n] = e, t;
42
+ //#endregion
43
+ //#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
44
+ function T(e, t, n) {
45
+ return t in e ? Object.defineProperty(e, t, {
46
+ value: n,
47
+ enumerable: !0,
48
+ configurable: !0,
49
+ writable: !0
50
+ }) : e[t] = n, e;
52
51
  }
53
- function b(t, n) {
54
- var e = Object.keys(t);
55
- if (Object.getOwnPropertySymbols) {
56
- var r = Object.getOwnPropertySymbols(t);
57
- n && (r = r.filter(function(o) {
58
- return Object.getOwnPropertyDescriptor(t, o).enumerable;
59
- })), e.push.apply(e, r);
60
- }
61
- return e;
52
+ function E(e, t) {
53
+ var n = Object.keys(e);
54
+ if (Object.getOwnPropertySymbols) {
55
+ var r = Object.getOwnPropertySymbols(e);
56
+ t && (r = r.filter(function(t) {
57
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
58
+ })), n.push.apply(n, r);
59
+ }
60
+ return n;
62
61
  }
63
- function I(t) {
64
- for (var n = 1; n < arguments.length; n++) {
65
- var e = arguments[n] != null ? arguments[n] : {};
66
- n % 2 ? b(Object(e), !0).forEach(function(r) {
67
- n0(t, r, e[r]);
68
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : b(Object(e)).forEach(function(r) {
69
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
70
- });
71
- }
72
- return t;
62
+ function D(e) {
63
+ for (var t = 1; t < arguments.length; t++) {
64
+ var n = arguments[t] == null ? {} : arguments[t];
65
+ t % 2 ? E(Object(n), !0).forEach(function(t) {
66
+ T(e, t, n[t]);
67
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : E(Object(n)).forEach(function(t) {
68
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
69
+ });
70
+ }
71
+ return e;
73
72
  }
74
- var r0 = (t, n, e) => {
75
- for (var r of Object.keys(t)) {
76
- var o;
77
- if (t[r] !== ((o = n[r]) !== null && o !== void 0 ? o : e[r]))
78
- return !1;
79
- }
80
- return !0;
81
- }, y = (t) => (n) => {
82
- var e = t.defaultClassName, r = I(I({}, t.defaultVariants), n);
83
- for (var o in r) {
84
- var c, i = (c = r[o]) !== null && c !== void 0 ? c : t.defaultVariants[o];
85
- if (i != null) {
86
- var a = i;
87
- typeof a == "boolean" && (a = a === !0 ? "true" : "false");
88
- var s = (
89
- // @ts-expect-error
90
- t.variantClassNames[o][a]
91
- );
92
- s && (e += " " + s);
93
- }
94
- }
95
- for (var [l, g] of t.compoundVariants)
96
- r0(l, r, t.defaultVariants) && (e += " " + g);
97
- return e;
98
- }, o0 = y({ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n0", variantClassNames: { active: { true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n1", false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n2" } }, defaultVariants: {}, compoundVariants: [] }), i0 = { icon: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n3" };
99
- function c0({
100
- icon: t,
101
- onClick: n,
102
- selectionDOMContextFind: e,
103
- activeTest: r,
104
- isSimpleToggle: o = !1,
105
- ...c
106
- }) {
107
- const [i, a] = d.useState(!1);
108
- d.useEffect(() => {
109
- r && a(!!e(r));
110
- }, [e]);
111
- const s = d.useCallback(() => {
112
- n && n(i), o && a(!i);
113
- }, [n, i]);
114
- return /* @__PURE__ */ d.createElement(
115
- "button",
116
- {
117
- className: o0({ active: i }),
118
- onClick: s,
119
- onMouseDown: (l) => l.preventDefault(),
120
- ...c
121
- },
122
- /* @__PURE__ */ d.createElement(
123
- "span",
124
- {
125
- className: i0.icon,
126
- style: { backgroundImage: `url("${t}")` },
127
- "aria-hidden": "true"
128
- }
129
- )
130
- );
73
+ var ne = (e, t, n) => {
74
+ for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
75
+ return !0;
76
+ }, O = (e) => (t) => {
77
+ var n = e.defaultClassName, r = D(D({}, e.defaultVariants), t);
78
+ for (var i in r) {
79
+ var a = r[i] ?? e.defaultVariants[i];
80
+ if (a != null) {
81
+ var o = a;
82
+ typeof o == "boolean" && (o = o === !0 ? "true" : "false");
83
+ var s = e.variantClassNames[i][o];
84
+ s && (n += " " + s);
85
+ }
86
+ }
87
+ for (var [c, l] of e.compoundVariants) ne(c, r, e.defaultVariants) && (n += " " + l);
88
+ return n;
89
+ }, re = O({
90
+ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n0",
91
+ variantClassNames: { active: {
92
+ true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n1",
93
+ false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n2"
94
+ } },
95
+ defaultVariants: {},
96
+ compoundVariants: []
97
+ }), k = { icon: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n3" };
98
+ //#endregion
99
+ //#region src/rich-text-editor/rich-text-editor/RTEToolbarButton.tsx
100
+ function A({ icon: e, onClick: t, selectionDOMContextFind: n, activeTest: i, isSimpleToggle: a = !1, ...o }) {
101
+ let [s, c] = r.useState(!1);
102
+ r.useEffect(() => {
103
+ i && c(!!n(i));
104
+ }, [n]);
105
+ let l = r.useCallback(() => {
106
+ t && t(s), a && c(!s);
107
+ }, [t, s]);
108
+ return /* @__PURE__ */ r.createElement("button", {
109
+ className: re({ active: s }),
110
+ onClick: l,
111
+ onMouseDown: (e) => e.preventDefault(),
112
+ ...o
113
+ }, /* @__PURE__ */ r.createElement("span", {
114
+ className: k.icon,
115
+ style: { backgroundImage: `url("${e}")` },
116
+ "aria-hidden": "true"
117
+ }));
131
118
  }
132
- var a0 = y({ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss0", variantClassNames: { disabled: { true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss1", false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss2" } }, defaultVariants: { disabled: !1 }, compoundVariants: [] }), s0 = y({ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss3", variantClassNames: { disabled: { true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss4", false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss5" } }, defaultVariants: {}, compoundVariants: [] }), l0 = "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss6", d0 = "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss7";
133
- function g0() {
134
- return (t) => (Q(t, "listItem", (n) => {
135
- const e = Array.from(n.children);
136
- if (e.length > 0 && e[0].type === "paragraph") {
137
- const r = e[0], c = Array.from(r.children).concat(e.slice(1));
138
- n.children = c;
139
- }
140
- }), t);
119
+ //#endregion
120
+ //#region src/rich-text-editor/rich-text-editor/RichTextEditor.css.ts
121
+ var j = O({
122
+ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss0",
123
+ variantClassNames: { disabled: {
124
+ true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss1",
125
+ false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss2"
126
+ } },
127
+ defaultVariants: { disabled: !1 },
128
+ compoundVariants: []
129
+ }), M = O({
130
+ defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss3",
131
+ variantClassNames: { disabled: {
132
+ true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss4",
133
+ false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss5"
134
+ } },
135
+ defaultVariants: {},
136
+ compoundVariants: []
137
+ });
138
+ //#endregion
139
+ //#region src/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.ts
140
+ function N() {
141
+ return (e) => (S(e, "listItem", (e) => {
142
+ let t = Array.from(e.children);
143
+ if (t.length > 0 && t[0].type === "paragraph") {
144
+ let n = t[0];
145
+ e.children = Array.from(n.children).concat(t.slice(1));
146
+ }
147
+ }), e);
141
148
  }
142
- function m0() {
143
- const t = C(
144
- () => B().use(K).use(g0).use(q).use(W).use(J),
145
- []
146
- );
147
- return C(
148
- () => function(e) {
149
- return t.process(e).then(String);
150
- },
151
- [t]
152
- );
149
+ //#endregion
150
+ //#region src/rich-text-editor/rich-text-editor/hooks/useMdToHtml.ts
151
+ function P() {
152
+ let e = o(() => x().use(_).use(N).use(v).use(y).use(b), []);
153
+ return o(() => function(t) {
154
+ return e.process(t).then(String);
155
+ }, [e]);
153
156
  }
154
- const U = /* @__PURE__ */ new Set(["strong", "emphasis", "delete", "link", "linkReference"]), f0 = /* @__PURE__ */ new Set([...U, "paragraph"]);
155
- function A(t) {
156
- return "children" in t;
157
+ //#endregion
158
+ //#region src/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.ts
159
+ var F = /* @__PURE__ */ new Set([
160
+ "strong",
161
+ "emphasis",
162
+ "delete",
163
+ "link",
164
+ "linkReference"
165
+ ]), I = /* @__PURE__ */ new Set([...F, "paragraph"]);
166
+ function L(e) {
167
+ return "children" in e;
157
168
  }
158
- function h0() {
159
- return (t) => {
160
- function n(e) {
161
- for (const r of e.children)
162
- A(r) && n(r);
163
- if (e.children = e.children.filter(
164
- (r) => !(f0.has(r.type) && A(r) && r.children.length === 0)
165
- ), U.has(e.type))
166
- for (; e.children.at(-1)?.type === "break"; )
167
- e.children.pop();
168
- }
169
- return n(t), t;
170
- };
169
+ function R() {
170
+ return (e) => {
171
+ function t(e) {
172
+ for (let n of e.children) L(n) && t(n);
173
+ if (e.children = e.children.filter((e) => !(I.has(e.type) && L(e) && e.children.length === 0)), F.has(e.type)) for (; e.children.at(-1)?.type === "break";) e.children.pop();
174
+ }
175
+ return t(e), e;
176
+ };
171
177
  }
172
- function u0() {
173
- const t = C(
174
- () => B().use(X).use(Y).use(h0).use(e0),
175
- []
176
- );
177
- return C(
178
- () => function(e) {
179
- return t.process(e).then(String);
180
- },
181
- [t]
182
- );
178
+ //#endregion
179
+ //#region src/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.ts
180
+ function z() {
181
+ let e = o(() => x().use(C).use(ee).use(R).use(te), []);
182
+ return o(() => function(t) {
183
+ return e.process(t).then(String);
184
+ }, [e]);
183
185
  }
184
- function C0(t = "", n = "") {
185
- const [e, r] = v(), [o, c] = v({ html: n }), i = u0(), a = m0(), s = x(async (m) => {
186
- const f = await a(m), h = { md: m, html: f };
187
- return r(h), h;
188
- }, [a]), l = x(async (m) => {
189
- const h = { md: await i(m), html: m };
190
- return r(h), h;
191
- }, [i]);
192
- L(() => {
193
- !n && t !== e?.md ? s(t).then(({ html: m }) => {
194
- c({ html: m });
195
- }) : !t && n && n !== e?.html && l(n);
196
- }, [t, n]);
197
- function g(m) {
198
- m.current && l(m.current.innerHTML);
199
- }
200
- return {
201
- aggValue: e,
202
- editableDivInnerHtml: o,
203
- updateStateFromDiv: g
204
- };
186
+ //#endregion
187
+ //#region src/rich-text-editor/rich-text-editor/hooks/useRTEContent.ts
188
+ function B(e = "", t = "") {
189
+ let [n, r] = c(), [o, s] = c({ html: t }), l = z(), u = P(), d = i(async (e) => {
190
+ let t = {
191
+ md: e,
192
+ html: await u(e)
193
+ };
194
+ return r(t), t;
195
+ }, [u]), f = i(async (e) => {
196
+ let t = {
197
+ md: await l(e),
198
+ html: e
199
+ };
200
+ return r(t), t;
201
+ }, [l]);
202
+ a(() => {
203
+ !t && e !== n?.md ? d(e).then(({ html: e }) => {
204
+ s({ html: e });
205
+ }) : !e && t && t !== n?.html && f(t);
206
+ }, [e, t]);
207
+ function p(e) {
208
+ e.current && f(e.current.innerHTML);
209
+ }
210
+ return {
211
+ aggValue: n,
212
+ editableDivInnerHtml: o,
213
+ updateStateFromDiv: p
214
+ };
205
215
  }
206
- function p0(t) {
207
- if (t instanceof HTMLElement) {
208
- for (const n of Array.from(t.attributes))
209
- /(style|class|data-[^=]+)/.test(n.name) && t.removeAttribute(n.name);
210
- t.innerHTML = t.innerHTML.replace(/(style|class|data-[^=]+)="[^"]+"/g, "");
211
- }
216
+ //#endregion
217
+ //#region src/rich-text-editor/rich-text-editor/hooks/useRTEObserver.ts
218
+ function V(e) {
219
+ if (e instanceof HTMLElement) {
220
+ for (let t of Array.from(e.attributes)) /(style|class|data-[^=]+)/.test(t.name) && e.removeAttribute(t.name);
221
+ e.innerHTML = e.innerHTML.replace(/(style|class|data-[^=]+)="[^"]+"/g, "");
222
+ }
212
223
  }
213
- const w0 = [
214
- // Bold
215
- {
216
- regex: /\*\*([^*]+)\*\*/,
217
- command: "bold"
218
- },
219
- // Italic
220
- {
221
- regex: new RegExp("(?<!\\*)\\*([^*]+)\\*"),
222
- command: "italic"
223
- },
224
- // Bulleted list
225
- {
226
- regex: /^\*[ \u00a0]/,
227
- command: "insertUnorderedList"
228
- },
229
- // Numbered list
230
- {
231
- regex: /^1\.[ \u00a0]/,
232
- command: "insertOrderedList"
233
- },
234
- // Link
235
- {
236
- regex: /\[([^\]]+)\]\(([^)]+)\)/,
237
- command: "createLink",
238
- getCommandArg: ([, , t]) => /^https?:\/\//.test(t) ? t : `https://${t}`
239
- }
224
+ var H = [
225
+ {
226
+ regex: /\*\*([^*]+)\*\*/,
227
+ command: "bold"
228
+ },
229
+ {
230
+ regex: /(?<!\*)\*([^*]+)\*/,
231
+ command: "italic"
232
+ },
233
+ {
234
+ regex: /^\*[ \u00a0]/,
235
+ command: "insertUnorderedList"
236
+ },
237
+ {
238
+ regex: /^1\.[ \u00a0]/,
239
+ command: "insertOrderedList"
240
+ },
241
+ {
242
+ regex: /\[([^\]]+)\]\(([^)]+)\)/,
243
+ command: "createLink",
244
+ getCommandArg: ([, , e]) => /^https?:\/\//.test(e) ? e : `https://${e}`
245
+ }
240
246
  ];
241
- function v0(t, n, e) {
242
- const r = document.createRange();
243
- r.setStart(t, n), r.setEnd(t, e);
244
- const o = window.getSelection();
245
- o?.removeAllRanges(), o?.addRange(r);
247
+ function U(e, t, n) {
248
+ let r = document.createRange();
249
+ r.setStart(e, t), r.setEnd(e, n);
250
+ let i = window.getSelection();
251
+ i?.removeAllRanges(), i?.addRange(r);
246
252
  }
247
- function N(t) {
248
- const n = document.createRange();
249
- n.setStartAfter(t), n.setEndAfter(t);
250
- const e = window.getSelection();
251
- e?.removeAllRanges(), e?.addRange(n);
253
+ function W(e) {
254
+ let t = document.createRange();
255
+ t.setStartAfter(e), t.setEndAfter(e);
256
+ let n = window.getSelection();
257
+ n?.removeAllRanges(), n?.addRange(t);
252
258
  }
253
- function x0(t) {
254
- const n = document.createRange();
255
- n.setStartBefore(t), n.setEndBefore(t);
256
- const e = window.getSelection();
257
- e?.removeAllRanges(), e?.addRange(n);
259
+ function G(e) {
260
+ let t = document.createRange();
261
+ t.setStartBefore(e), t.setEndBefore(e);
262
+ let n = window.getSelection();
263
+ n?.removeAllRanges(), n?.addRange(t);
258
264
  }
259
- function L0(t) {
260
- const n = F(null), e = C(() => new MutationObserver(([r]) => {
261
- if (r.type === "characterData" && r.oldValue && r.target.textContent) {
262
- for (const o of w0)
263
- if (!o.regex.test(r.oldValue) && o.regex.test(r.target.textContent)) {
264
- const c = o.regex.exec(r.target.textContent), [i, a = ""] = c, s = r.target.textContent.indexOf(i);
265
- r.target.textContent = r.target.textContent.replace(i, a);
266
- const l = s + a.length;
267
- v0(r.target, s, l);
268
- const g = o.getCommandArg ? o.getCommandArg(c) : void 0;
269
- document.execCommand(o.command, void 0, g), a && (N(r.target.parentNode), document.execCommand(o.command));
270
- }
271
- } else r.type === "childList" && Array.from(r.addedNodes).forEach((o) => {
272
- let c;
273
- if (o instanceof HTMLElement && o.tagName === "LI" ? c = o : o?.parentElement?.tagName === "LI" && (c = o?.parentElement), c) {
274
- const i = c.nextElementSibling, a = i?.childNodes?.[0];
275
- if (a instanceof HTMLElement && ["UL", "OL"].includes(a.tagName)) {
276
- const l = document.createElement("br");
277
- i.insertBefore(l, a), x0(l);
278
- }
279
- }
280
- p0(o);
281
- });
282
- t(n);
283
- }), []);
284
- return L(() => () => {
285
- e && e.disconnect();
286
- }, []), L(() => {
287
- n.current !== null && e.observe(n.current, {
288
- childList: !0,
289
- subtree: !0,
290
- characterDataOldValue: !0
291
- });
292
- }, [e, n]), n;
265
+ function K(e) {
266
+ let t = s(null), n = o(() => new MutationObserver(([n]) => {
267
+ if (n.type === "characterData" && n.oldValue && n.target.textContent) {
268
+ for (let e of H) if (!e.regex.test(n.oldValue) && e.regex.test(n.target.textContent)) {
269
+ let t = e.regex.exec(n.target.textContent), [r, i = ""] = t, a = n.target.textContent.indexOf(r);
270
+ n.target.textContent = n.target.textContent.replace(r, i);
271
+ let o = a + i.length;
272
+ U(n.target, a, o);
273
+ let s = e.getCommandArg ? e.getCommandArg(t) : void 0;
274
+ document.execCommand(e.command, void 0, s), i && (W(n.target.parentNode), document.execCommand(e.command));
275
+ }
276
+ } else n.type === "childList" && Array.from(n.addedNodes).forEach((e) => {
277
+ let t;
278
+ if (e instanceof HTMLElement && e.tagName === "LI" ? t = e : e?.parentElement?.tagName === "LI" && (t = e?.parentElement), t) {
279
+ let e = t.nextElementSibling, n = e?.childNodes?.[0];
280
+ if (n instanceof HTMLElement && ["UL", "OL"].includes(n.tagName)) {
281
+ let t = document.createElement("br");
282
+ e.insertBefore(t, n), G(t);
283
+ }
284
+ }
285
+ V(e);
286
+ });
287
+ e(t);
288
+ }), []);
289
+ return a(() => () => {
290
+ n && n.disconnect();
291
+ }, []), a(() => {
292
+ t.current !== null && n.observe(t.current, {
293
+ childList: !0,
294
+ subtree: !0,
295
+ characterDataOldValue: !0
296
+ });
297
+ }, [n, t]), t;
293
298
  }
294
- function E0(t) {
295
- const [n, e] = v();
296
- L(() => {
297
- function o() {
298
- const c = window.getSelection();
299
- Number(c?.rangeCount) > 0 && e(c?.getRangeAt(0));
300
- }
301
- return document.addEventListener("selectionchange", o), () => {
302
- document.removeEventListener("selectionchange", o);
303
- };
304
- }, []);
305
- const r = x(
306
- (o) => {
307
- if (!n)
308
- return null;
309
- const c = n.commonAncestorContainer;
310
- if (!t.current || !t.current.contains(c))
311
- return null;
312
- let i = c instanceof HTMLElement ? c : c.parentElement;
313
- for (; i && i !== t.current; ) {
314
- if (o(i))
315
- return i;
316
- i = i.parentElement;
317
- }
318
- return null;
319
- },
320
- [n]
321
- );
322
- return {
323
- selectionRange: n,
324
- selectionDOMContextFind: r
325
- };
299
+ //#endregion
300
+ //#region src/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.ts
301
+ function q(e) {
302
+ let [t, n] = c();
303
+ return a(() => {
304
+ function e() {
305
+ let e = window.getSelection();
306
+ Number(e?.rangeCount) > 0 && n(e?.getRangeAt(0));
307
+ }
308
+ return document.addEventListener("selectionchange", e), () => {
309
+ document.removeEventListener("selectionchange", e);
310
+ };
311
+ }, []), {
312
+ selectionRange: t,
313
+ selectionDOMContextFind: i((n) => {
314
+ if (!t) return null;
315
+ let r = t.commonAncestorContainer;
316
+ if (!e.current || !e.current.contains(r)) return null;
317
+ let i = r instanceof HTMLElement ? r : r.parentElement;
318
+ for (; i && i !== e.current;) {
319
+ if (n(i)) return i;
320
+ i = i.parentElement;
321
+ }
322
+ return null;
323
+ }, [t])
324
+ };
326
325
  }
327
- const _0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", k0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", y0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", N0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", T0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", R0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", S0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", M0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", b0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", I0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", w = (t, n) => {
328
- let e = t;
329
- for (; e.parentElement && !n.includes(e.parentElement.tagName); )
330
- e = e.parentElement;
331
- return e.parentElement && n.includes(e.parentElement.tagName) ? e.parentElement : null;
332
- }, O = (t) => {
333
- const n = [];
334
- let e = t;
335
- for (; e.nextElementSibling; )
336
- n.push(e.nextElementSibling), e = e.nextElementSibling;
337
- return n;
338
- }, A0 = {
339
- key: "bold",
340
- icon: _0,
341
- onClick: () => document.execCommand("bold"),
342
- activeTest: (t) => ["B", "STRONG"].includes(t.tagName),
343
- isSimpleToggle: !0
344
- }, O0 = {
345
- key: "italics",
346
- icon: y0,
347
- onClick: () => document.execCommand("italic"),
348
- activeTest: (t) => ["I", "EM"].includes(t.tagName),
349
- isSimpleToggle: !0
350
- }, B0 = {
351
- key: "ul",
352
- icon: I0,
353
- onClick: () => document.execCommand("insertUnorderedList"),
354
- activeTest: (t) => t.tagName === "UL"
355
- }, U0 = {
356
- key: "ol",
357
- icon: T0,
358
- onClick: () => document.execCommand("insertOrderedList"),
359
- activeTest: (t) => t.tagName === "OL"
360
- }, D0 = {
361
- key: "indent",
362
- icon: k0,
363
- onClick: () => {
364
- try {
365
- const t = window.getSelection();
366
- if (t?.type === "Range") {
367
- const n = t.getRangeAt(0), e = n.commonAncestorContainer;
368
- if (!(e instanceof HTMLElement) || (e.tagName === "UL" || e.tagName === "OL" || e.tagName === "LI") && e.firstElementChild && n.intersectsNode(e.firstElementChild))
369
- return;
370
- const r = [];
371
- let o;
372
- if (e.childNodes.forEach((c) => {
373
- n.intersectsNode(c) && c instanceof HTMLElement && c.tagName === "LI" && (r.length === 0 && (o = c.previousSibling), r.push(c));
374
- }), o instanceof HTMLElement && o.tagName === "LI") {
375
- r.forEach((i) => i.remove());
376
- const c = o.parentElement?.tagName.toLowerCase();
377
- if (c) {
378
- const i = document.createElement(c);
379
- r.forEach((a) => i.appendChild(a)), o.appendChild(i);
380
- }
381
- return;
382
- }
383
- } else if (t) {
384
- const { anchorNode: n } = t;
385
- let e;
386
- if (n instanceof HTMLElement && n.tagName === "LI" ? e = n : n && (e = w(n, ["LI"])), e) {
387
- const r = e.previousElementSibling, o = e.parentElement.tagName.toLowerCase();
388
- if (r && r.tagName === "LI") {
389
- e.remove();
390
- const c = r.querySelector(o);
391
- if (c)
392
- c.appendChild(e);
393
- else {
394
- const i = document.createElement(o);
395
- i.appendChild(e), r.appendChild(i);
396
- }
397
- n && N(n.childNodes?.[0] || n);
398
- }
399
- return;
400
- }
401
- }
402
- } catch {
403
- }
404
- document.execCommand("indent");
405
- }
406
- }, P0 = {
407
- key: "outdent",
408
- icon: R0,
409
- onClick: () => {
410
- try {
411
- const t = window.getSelection();
412
- if (t?.type === "Range") {
413
- const n = t.getRangeAt(0), e = n.commonAncestorContainer;
414
- if (!(e instanceof HTMLElement))
415
- return;
416
- const r = [];
417
- let o;
418
- if (e.tagName === "UL" || e.tagName === "OL" ? o = e : e.tagName === "LI" && (o = e.parentElement), o) {
419
- o.childNodes.forEach((i) => {
420
- n.intersectsNode(i) && i instanceof HTMLElement && i.tagName === "LI" && r.push(i);
421
- });
422
- const c = o.parentElement;
423
- c?.tagName === "LI" && (r.forEach((i, a) => {
424
- if (a === r.length - 1) {
425
- const s = O(i);
426
- if (s.length > 0) {
427
- const l = o.tagName.toLowerCase(), g = i.querySelector(l);
428
- if (g)
429
- for (const m of s)
430
- m.remove(), g.appendChild(m);
431
- else {
432
- const m = document.createElement(l);
433
- i.appendChild(m);
434
- for (const f of s)
435
- f.remove(), m.appendChild(f);
436
- }
437
- }
438
- }
439
- i.remove();
440
- }), o.childElementCount === 0 && o.remove(), r.reverse().forEach((i) => c.after(i)));
441
- return;
442
- }
443
- } else if (t) {
444
- const { anchorNode: n } = t;
445
- let e = null, r = null;
446
- n instanceof HTMLElement && (n.tagName === "UL" || n.tagName === "OL") ? (e = n, r = n.querySelector("li")) : n && (e = w(n, ["UL", "OL"]), r = n instanceof HTMLElement && n.tagName === "LI" ? n : w(n, ["LI"]));
447
- const o = e ? w(e, ["UL", "OL"]) : null;
448
- if (e && o) {
449
- const c = w(e, ["LI"]);
450
- if (e.childElementCount === 1 && e.remove(), r) {
451
- const i = O(r);
452
- if (i.length > 0) {
453
- const a = document.createElement(e.tagName.toLowerCase());
454
- r.appendChild(a);
455
- for (const s of i)
456
- s.remove(), a.appendChild(s);
457
- }
458
- c?.after(r), r.lastChild && N(r.lastChild);
459
- }
460
- return;
461
- }
462
- }
463
- } catch {
464
- }
465
- document.execCommand("outdent");
466
- }
467
- }, V0 = {
468
- key: "undo",
469
- icon: M0,
470
- onClick: () => document.execCommand("undo")
471
- }, H0 = {
472
- key: "redo",
473
- icon: S0,
474
- onClick: () => document.execCommand("redo")
326
+ //#endregion
327
+ //#region src/rich-text-editor/rich-text-editor/icons/BOLD.svg
328
+ var J = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ie = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Y = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ae = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", oe = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", se = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ce = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", le = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ue = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", de = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", X = (e, t) => {
329
+ let n = e;
330
+ for (; n.parentElement && !t.includes(n.parentElement.tagName);) n = n.parentElement;
331
+ return n.parentElement && t.includes(n.parentElement.tagName) ? n.parentElement : null;
332
+ }, Z = (e) => {
333
+ let t = [], n = e;
334
+ for (; n.nextElementSibling;) t.push(n.nextElementSibling), n = n.nextElementSibling;
335
+ return t;
336
+ }, fe = {
337
+ key: "bold",
338
+ icon: J,
339
+ onClick: () => document.execCommand("bold"),
340
+ activeTest: (e) => ["B", "STRONG"].includes(e.tagName),
341
+ isSimpleToggle: !0
342
+ }, pe = {
343
+ key: "italics",
344
+ icon: Y,
345
+ onClick: () => document.execCommand("italic"),
346
+ activeTest: (e) => ["I", "EM"].includes(e.tagName),
347
+ isSimpleToggle: !0
348
+ }, me = {
349
+ key: "ul",
350
+ icon: de,
351
+ onClick: () => document.execCommand("insertUnorderedList"),
352
+ activeTest: (e) => e.tagName === "UL"
353
+ }, he = {
354
+ key: "ol",
355
+ icon: oe,
356
+ onClick: () => document.execCommand("insertOrderedList"),
357
+ activeTest: (e) => e.tagName === "OL"
358
+ }, ge = {
359
+ key: "indent",
360
+ icon: ie,
361
+ onClick: () => {
362
+ try {
363
+ let e = window.getSelection();
364
+ if (e?.type === "Range") {
365
+ let t = e.getRangeAt(0), n = t.commonAncestorContainer;
366
+ if (!(n instanceof HTMLElement) || (n.tagName === "UL" || n.tagName === "OL" || n.tagName === "LI") && n.firstElementChild && t.intersectsNode(n.firstElementChild)) return;
367
+ let r = [], i;
368
+ if (n.childNodes.forEach((e) => {
369
+ t.intersectsNode(e) && e instanceof HTMLElement && e.tagName === "LI" && (r.length === 0 && (i = e.previousSibling), r.push(e));
370
+ }), i instanceof HTMLElement && i.tagName === "LI") {
371
+ r.forEach((e) => e.remove());
372
+ let e = i.parentElement?.tagName.toLowerCase();
373
+ if (e) {
374
+ let t = document.createElement(e);
375
+ r.forEach((e) => t.appendChild(e)), i.appendChild(t);
376
+ }
377
+ return;
378
+ }
379
+ } else if (e) {
380
+ let { anchorNode: t } = e, n;
381
+ if (t instanceof HTMLElement && t.tagName === "LI" ? n = t : t && (n = X(t, ["LI"])), n) {
382
+ let e = n.previousElementSibling, r = n.parentElement.tagName.toLowerCase();
383
+ if (e && e.tagName === "LI") {
384
+ n.remove();
385
+ let i = e.querySelector(r);
386
+ if (i) i.appendChild(n);
387
+ else {
388
+ let t = document.createElement(r);
389
+ t.appendChild(n), e.appendChild(t);
390
+ }
391
+ t && W(t.childNodes?.[0] || t);
392
+ }
393
+ return;
394
+ }
395
+ }
396
+ } catch {}
397
+ document.execCommand("indent");
398
+ }
399
+ }, _e = {
400
+ key: "outdent",
401
+ icon: se,
402
+ onClick: () => {
403
+ try {
404
+ let e = window.getSelection();
405
+ if (e?.type === "Range") {
406
+ let t = e.getRangeAt(0), n = t.commonAncestorContainer;
407
+ if (!(n instanceof HTMLElement)) return;
408
+ let r = [], i;
409
+ if (n.tagName === "UL" || n.tagName === "OL" ? i = n : n.tagName === "LI" && (i = n.parentElement), i) {
410
+ i.childNodes.forEach((e) => {
411
+ t.intersectsNode(e) && e instanceof HTMLElement && e.tagName === "LI" && r.push(e);
412
+ });
413
+ let e = i.parentElement;
414
+ e?.tagName === "LI" && (r.forEach((e, t) => {
415
+ if (t === r.length - 1) {
416
+ let t = Z(e);
417
+ if (t.length > 0) {
418
+ let n = i.tagName.toLowerCase(), r = e.querySelector(n);
419
+ if (r) for (let e of t) e.remove(), r.appendChild(e);
420
+ else {
421
+ let r = document.createElement(n);
422
+ e.appendChild(r);
423
+ for (let e of t) e.remove(), r.appendChild(e);
424
+ }
425
+ }
426
+ }
427
+ e.remove();
428
+ }), i.childElementCount === 0 && i.remove(), r.reverse().forEach((t) => e.after(t)));
429
+ return;
430
+ }
431
+ } else if (e) {
432
+ let { anchorNode: t } = e, n = null, r = null;
433
+ t instanceof HTMLElement && (t.tagName === "UL" || t.tagName === "OL") ? (n = t, r = t.querySelector("li")) : t && (n = X(t, ["UL", "OL"]), r = t instanceof HTMLElement && t.tagName === "LI" ? t : X(t, ["LI"]));
434
+ let i = n ? X(n, ["UL", "OL"]) : null;
435
+ if (n && i) {
436
+ let e = X(n, ["LI"]);
437
+ if (n.childElementCount === 1 && n.remove(), r) {
438
+ let t = Z(r);
439
+ if (t.length > 0) {
440
+ let e = document.createElement(n.tagName.toLowerCase());
441
+ r.appendChild(e);
442
+ for (let n of t) n.remove(), e.appendChild(n);
443
+ }
444
+ e?.after(r), r.lastChild && W(r.lastChild);
445
+ }
446
+ return;
447
+ }
448
+ }
449
+ } catch {}
450
+ document.execCommand("outdent");
451
+ }
452
+ }, Q = {
453
+ key: "undo",
454
+ icon: le,
455
+ onClick: () => document.execCommand("undo")
456
+ }, ve = {
457
+ key: "redo",
458
+ icon: ce,
459
+ onClick: () => document.execCommand("redo")
475
460
  };
476
- function F0(t, n) {
477
- const [e, r] = v(!1), o = x((s, l) => {
478
- r(!1);
479
- const g = s.cloneRange(), m = window.getSelection();
480
- if ((m?.rangeCount ?? 0) > 0 && m?.removeAllRanges(), m?.addRange(g), !g?.toString() && l?.text && m) {
481
- const f = document.createTextNode(l.text), { anchorNode: h } = m;
482
- if (h instanceof HTMLElement) {
483
- const u = h.lastElementChild;
484
- u && u.tagName === "BR" ? h.insertBefore(f, u) : h.appendChild(f);
485
- } else if (h) {
486
- const u = g.cloneRange();
487
- u.selectNodeContents(h), u.setEnd(g.endContainer, g.endOffset);
488
- const E = u.toString().length;
489
- h.parentElement?.insertBefore(
490
- f,
491
- h.splitText(E)
492
- );
493
- }
494
- g.setStart(f, 0), g.setEnd(f, l.text.length);
495
- }
496
- if (l) {
497
- const f = g?.startContainer?.parentElement;
498
- f && f.tagName === "A" ? (f.setAttribute("href", l.link), f.textContent = l.text, window.getSelection()?.getRangeAt(0)?.selectNodeContents(f)) : document.execCommand("createLink", void 0, l.link);
499
- }
500
- }, []), c = C(() => ({
501
- key: "link",
502
- icon: N0,
503
- onClick: () => {
504
- const s = window.getSelection(), l = (s?.rangeCount ?? 0) > 0 ? s?.getRangeAt(0).commonAncestorContainer : null;
505
- n.current && l && n.current.contains(l) && r(!0);
506
- },
507
- activeTest: (s) => s.tagName === "A"
508
- }), []), i = C(() => ({
509
- key: "unlink",
510
- icon: b0,
511
- onClick: () => {
512
- const s = t(c.activeTest);
513
- s && (window.getSelection()?.getRangeAt(0).selectNodeContents(s), document.execCommand("unlink"));
514
- }
515
- }), [t]);
516
- return {
517
- toolbarButtons: [
518
- A0,
519
- O0,
520
- "vr",
521
- B0,
522
- U0,
523
- D0,
524
- P0,
525
- "vr",
526
- c,
527
- i,
528
- "vr",
529
- V0,
530
- H0
531
- ],
532
- showLinkModal: e,
533
- handleLinkModalClose: o
534
- };
461
+ function ye(e, t) {
462
+ let [n, r] = c(!1), a = i((e, t) => {
463
+ r(!1);
464
+ let n = e.cloneRange(), i = window.getSelection();
465
+ if ((i?.rangeCount ?? 0) > 0 && i?.removeAllRanges(), i?.addRange(n), !n?.toString() && t?.text && i) {
466
+ let e = document.createTextNode(t.text), { anchorNode: r } = i;
467
+ if (r instanceof HTMLElement) {
468
+ let t = r.lastElementChild;
469
+ t && t.tagName === "BR" ? r.insertBefore(e, t) : r.appendChild(e);
470
+ } else if (r) {
471
+ let t = n.cloneRange();
472
+ t.selectNodeContents(r), t.setEnd(n.endContainer, n.endOffset);
473
+ let i = t.toString().length;
474
+ r.parentElement?.insertBefore(e, r.splitText(i));
475
+ }
476
+ n.setStart(e, 0), n.setEnd(e, t.text.length);
477
+ }
478
+ if (t) {
479
+ let e = n?.startContainer?.parentElement;
480
+ e && e.tagName === "A" ? (e.setAttribute("href", t.link), e.textContent = t.text, (window.getSelection()?.getRangeAt(0))?.selectNodeContents(e)) : document.execCommand("createLink", void 0, t.link);
481
+ }
482
+ }, []), s = o(() => ({
483
+ key: "link",
484
+ icon: ae,
485
+ onClick: () => {
486
+ let e = window.getSelection(), n = (e?.rangeCount ?? 0) > 0 ? e?.getRangeAt(0).commonAncestorContainer : null;
487
+ t.current && n && t.current.contains(n) && r(!0);
488
+ },
489
+ activeTest: (e) => e.tagName === "A"
490
+ }), []);
491
+ return {
492
+ toolbarButtons: [
493
+ fe,
494
+ pe,
495
+ "vr",
496
+ me,
497
+ he,
498
+ ge,
499
+ _e,
500
+ "vr",
501
+ s,
502
+ o(() => ({
503
+ key: "unlink",
504
+ icon: ue,
505
+ onClick: () => {
506
+ let t = e(s.activeTest);
507
+ t && (window.getSelection()?.getRangeAt(0).selectNodeContents(t), document.execCommand("unlink"));
508
+ }
509
+ }), [e]),
510
+ "vr",
511
+ Q,
512
+ ve
513
+ ],
514
+ showLinkModal: n,
515
+ handleLinkModalClose: a
516
+ };
535
517
  }
536
- function $0({
537
- className: t,
538
- md: n,
539
- html: e,
540
- disabled: r,
541
- onChange: o,
542
- ...c
543
- }) {
544
- const i = V(c), { aggValue: a, editableDivInnerHtml: s, updateStateFromDiv: l } = C0(n, e);
545
- d.useEffect(() => {
546
- o && a && o(a);
547
- }, [a]);
548
- const g = L0(l);
549
- d.useEffect(() => {
550
- s && g.current && (g.current.innerHTML = s.html);
551
- }, [s]);
552
- const { selectionRange: m, selectionDOMContextFind: f } = E0(g), { toolbarButtons: h, showLinkModal: u, handleLinkModalClose: E } = F0(
553
- f,
554
- g
555
- ), { height: T, minHeight: R } = c.style ?? {}, _ = {};
556
- return T ? _.height = `
518
+ //#endregion
519
+ //#region src/rich-text-editor/rich-text-editor/RichTextEditor.tsx
520
+ function $({ className: e, md: i, html: a, disabled: o, onChange: s, ...c }) {
521
+ let l = n(c), { aggValue: u, editableDivInnerHtml: d, updateStateFromDiv: f } = B(i, a);
522
+ r.useEffect(() => {
523
+ s && u && s(u);
524
+ }, [u]);
525
+ let p = K(f);
526
+ r.useEffect(() => {
527
+ d && p.current && (p.current.innerHTML = d.html);
528
+ }, [d]);
529
+ let { selectionRange: m, selectionDOMContextFind: h } = q(p), { toolbarButtons: _, showLinkModal: v, handleLinkModalClose: y } = ye(h, p), { height: b, minHeight: x } = c.style ?? {}, S = {};
530
+ return b ? S.height = `
557
531
  calc(
558
- ${T}
559
- - ${p.component["rich-text-editor"].vr.height}
560
- - (2 * ${p.component["rich-text-editor"].border.width})
561
- - (2 * ${p.component["rich-text-editor"].padding.input.y})
562
- )` : R && (_.minHeight = `
532
+ ${b}
533
+ - ${g.component["rich-text-editor"].vr.height}
534
+ - (2 * ${g.component["rich-text-editor"].border.width})
535
+ - (2 * ${g.component["rich-text-editor"].padding.input.y})
536
+ )` : x && (S.minHeight = `
563
537
  calc(
564
- ${R}
565
- - ${p.component["rich-text-editor"].vr.height}
566
- - (2 * ${p.component["rich-text-editor"].border.width})
567
- - (2 * ${p.component["rich-text-editor"].padding.input.y})
568
- )`), /* @__PURE__ */ d.createElement("div", { className: H(a0({ disabled: r }), t), ...c }, !r && /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", { className: l0, ...i("toolbar") }, h.map(
569
- (k, D) => k === "vr" ? /* @__PURE__ */ d.createElement("div", { className: d0, key: `vr-${D}` }) : /* @__PURE__ */ d.createElement(
570
- c0,
571
- {
572
- ...k,
573
- selectionDOMContextFind: f,
574
- ...i(`button-${k.key}`)
575
- }
576
- )
577
- )), u && /* @__PURE__ */ d.createElement(
578
- t0,
579
- {
580
- onClose: E,
581
- selectionDOMContextFind: f,
582
- selectionRange: m
583
- }
584
- )), /* @__PURE__ */ d.createElement(
585
- "div",
586
- {
587
- className: s0({ disabled: r }),
588
- ref: g,
589
- contentEditable: !r,
590
- ...i("input"),
591
- style: _
592
- }
593
- ));
538
+ ${x}
539
+ - ${g.component["rich-text-editor"].vr.height}
540
+ - (2 * ${g.component["rich-text-editor"].border.width})
541
+ - (2 * ${g.component["rich-text-editor"].padding.input.y})
542
+ )`), /* @__PURE__ */ r.createElement("div", {
543
+ className: t(j({ disabled: o }), e),
544
+ ...c
545
+ }, !o && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
546
+ className: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss6",
547
+ ...l("toolbar")
548
+ }, _.map((e, t) => e === "vr" ? /* @__PURE__ */ r.createElement("div", {
549
+ className: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss7",
550
+ key: `vr-${t}`
551
+ }) : /* @__PURE__ */ r.createElement(A, {
552
+ ...e,
553
+ selectionDOMContextFind: h,
554
+ ...l(`button-${e.key}`)
555
+ }))), v && /* @__PURE__ */ r.createElement(w, {
556
+ onClose: y,
557
+ selectionDOMContextFind: h,
558
+ selectionRange: m
559
+ })), /* @__PURE__ */ r.createElement("div", {
560
+ className: M({ disabled: o }),
561
+ ref: p,
562
+ contentEditable: !o,
563
+ ...l("input"),
564
+ style: S
565
+ }));
594
566
  }
595
- P.set($0, {
596
- name: "RichTextEditor",
597
- props: {
598
- md: "string",
599
- html: "string",
600
- disabled: { type: "boolean", default: "false" },
601
- onChange: "(newValue: RichTextEditorAggregateValue) => void"
602
- }
567
+ e.set($, {
568
+ name: "RichTextEditor",
569
+ props: {
570
+ md: "string",
571
+ html: "string",
572
+ disabled: {
573
+ type: "boolean",
574
+ default: "false"
575
+ },
576
+ onChange: "(newValue: RichTextEditorAggregateValue) => void"
577
+ }
603
578
  });
604
- export {
605
- $0 as RichTextEditor
606
- };
579
+ //#endregion
580
+ export { $ as RichTextEditor };