@pstdio/ui 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/{MermaidComponent-CatfVUxA.js → MermaidComponent-BCMQqPqu.js} +11 -11
  2. package/dist/{MermaidComponent-CatfVUxA.js.map → MermaidComponent-BCMQqPqu.js.map} +1 -1
  3. package/dist/browser-storage-BinyFNJX.js +40 -0
  4. package/dist/browser-storage-BinyFNJX.js.map +1 -0
  5. package/dist/chat-ui.js +1160 -1120
  6. package/dist/chat-ui.js.map +1 -1
  7. package/dist/checkbox-D5AzFRlb.js +70 -0
  8. package/dist/checkbox-D5AzFRlb.js.map +1 -0
  9. package/dist/components/chat-ui/components/ai-conversation.d.ts +1 -1
  10. package/dist/components/chat-ui/components/ai-message.d.ts +1 -1
  11. package/dist/components/chat-ui/components/ai-response.d.ts +0 -1
  12. package/dist/components/chat-ui/components/attachment-list.d.ts +1 -1
  13. package/dist/components/chat-ui/components/auto-scroll.d.ts +27 -0
  14. package/dist/components/chat-ui/components/chat-message-animation.d.ts +22 -0
  15. package/dist/components/chat-ui/components/timeline.d.ts +0 -2
  16. package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +0 -1
  17. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -12
  18. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  19. package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -2
  20. package/dist/components/command-palette/index.d.ts +4 -0
  21. package/dist/components/data-renderer/data-renderer-board.d.ts +1 -1
  22. package/dist/components/data-renderer/data-renderer-card.d.ts +1 -1
  23. package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
  24. package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
  25. package/dist/components/data-renderer/data-renderer-list.d.ts +1 -1
  26. package/dist/components/data-renderer/data-renderer.d.ts +1 -1
  27. package/dist/components/data-renderer/index.d.ts +18 -0
  28. package/dist/components/data-renderer/types.d.ts +0 -6
  29. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  30. package/dist/components/diff-viewer/diff-drawer-scroll.d.ts +0 -19
  31. package/dist/components/diff-viewer/diff-drawer.d.ts +1 -0
  32. package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
  33. package/dist/components/diff-viewer/index.d.ts +2 -0
  34. package/dist/components/diff-viewer/use-selected-diff-scroll.d.ts +7 -3
  35. package/dist/components/internal/style-guide.d.ts +14 -0
  36. package/dist/components/internal/token-editor-controls.d.ts +8 -0
  37. package/dist/components/internal/token-editor-data.d.ts +40 -0
  38. package/dist/components/internal/token-editor-state.d.ts +22 -0
  39. package/dist/components/layout/index.d.ts +6 -0
  40. package/dist/components/list-row/list-row.types.d.ts +1 -1
  41. package/dist/components/notification-center/index.d.ts +2 -0
  42. package/dist/components/notification-center/notification-center.d.ts +2 -0
  43. package/dist/components/notification-center/notification-center.types.d.ts +37 -0
  44. package/dist/components/{bubble-button.d.ts → overlays/bubble-button.d.ts} +1 -1
  45. package/dist/components/overlays/index.d.ts +12 -0
  46. package/dist/components/overlays/search-modal-content.d.ts +20 -0
  47. package/dist/components/{searchable-menu.d.ts → overlays/searchable-menu.d.ts} +1 -1
  48. package/dist/components/param-editor/index.d.ts +23 -0
  49. package/dist/components/param-editor/inputs/action-input.d.ts +13 -0
  50. package/dist/components/param-editor/inputs/anchor-grid-input.d.ts +12 -0
  51. package/dist/components/param-editor/inputs/anchor-grid.d.ts +4 -0
  52. package/dist/components/param-editor/inputs/file-accept.d.ts +22 -0
  53. package/dist/components/param-editor/inputs/file-drop-input.d.ts +14 -0
  54. package/dist/components/param-editor/inputs/numeric-value.d.ts +6 -0
  55. package/dist/components/param-editor/inputs/range-input.d.ts +17 -0
  56. package/dist/components/param-editor/inputs/range-value.d.ts +5 -0
  57. package/dist/components/param-editor/inputs/resource-input-chips.d.ts +15 -0
  58. package/dist/components/param-editor/inputs/resource-input.d.ts +18 -0
  59. package/dist/components/param-editor/inputs/segmented-input.d.ts +14 -0
  60. package/dist/components/param-editor/inputs/slider-marks.d.ts +5 -0
  61. package/dist/components/param-editor/inputs/vector-input.d.ts +17 -0
  62. package/dist/components/param-editor/inputs/vector-value.d.ts +7 -0
  63. package/dist/components/param-editor/param-editor-control-item.d.ts +15 -0
  64. package/dist/components/param-editor/param-editor-control-list.d.ts +5 -0
  65. package/dist/components/param-editor/param-editor-field-label.d.ts +1 -0
  66. package/dist/components/param-editor/param-editor-field.d.ts +11 -0
  67. package/dist/components/param-editor/param-editor-inline-group.d.ts +5 -0
  68. package/dist/components/param-editor/param-editor-section.d.ts +16 -0
  69. package/dist/components/param-editor/param-editor.d.ts +2 -1
  70. package/dist/components/param-editor/param-editor.types.d.ts +101 -19
  71. package/dist/components/{breadcrumb.d.ts → primitives/breadcrumb.d.ts} +1 -1
  72. package/dist/components/{icon-color-picker.d.ts → primitives/icon-color-picker.d.ts} +2 -6
  73. package/dist/components/primitives/index.d.ts +28 -0
  74. package/dist/components/{number-input.d.ts → primitives/number-input.d.ts} +0 -2
  75. package/dist/components/{session-indicator.d.ts → primitives/session-indicator.d.ts} +2 -1
  76. package/dist/components/{tooltip.d.ts → primitives/tooltip.d.ts} +0 -1
  77. package/dist/components/rich-text/prompt-input/commands.d.ts +0 -17
  78. package/dist/components/rich-text/prompt-input/events.d.ts +0 -13
  79. package/dist/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.d.ts +1 -2
  80. package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +1 -2
  81. package/dist/components/rich-text/prompt-input/utils.d.ts +1 -2
  82. package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.d.ts +0 -1
  83. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
  84. package/dist/components/sidebar/sidebar.types.d.ts +1 -1
  85. package/dist/components/tab-strip/tab-visibility-filter.d.ts +5 -3
  86. package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
  87. package/dist/components/tag-editor/tag-editor.types.d.ts +1 -1
  88. package/dist/components/terminal/bind-session.d.ts +33 -0
  89. package/dist/components/terminal/index.d.ts +6 -0
  90. package/dist/components/terminal/scripted-bridge.d.ts +35 -0
  91. package/dist/components/terminal/terminal-contract.d.ts +22 -0
  92. package/dist/components/terminal/terminal-theme.d.ts +12 -0
  93. package/dist/components/terminal/terminal.d.ts +45 -0
  94. package/dist/components/terminal/types.d.ts +35 -0
  95. package/dist/components/terminal/use-terminal-session.d.ts +21 -0
  96. package/dist/components/tree-list/tree-list-order-filter.d.ts +1 -2
  97. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +12 -4
  98. package/dist/components/tree-list/tree-list.d.ts +1 -1
  99. package/dist/components/tree-list/tree-list.types.d.ts +7 -2
  100. package/dist/data-renderer.js +1669 -0
  101. package/dist/data-renderer.js.map +1 -0
  102. package/dist/diff-editor-BnfV8cYB.js +182 -0
  103. package/dist/diff-editor-BnfV8cYB.js.map +1 -0
  104. package/dist/diff.js +1313 -0
  105. package/dist/diff.js.map +1 -0
  106. package/dist/empty-state-Bo4HVrgr.js +34 -0
  107. package/dist/empty-state-Bo4HVrgr.js.map +1 -0
  108. package/dist/foundations/gallery/gallery-frame.d.ts +21 -0
  109. package/dist/foundations/gallery/sections/badges-section.d.ts +1 -0
  110. package/dist/foundations/gallery/sections/buttons-section.d.ts +1 -0
  111. package/dist/foundations/gallery/sections/composite-chat-section.d.ts +1 -0
  112. package/dist/foundations/gallery/sections/composites-section.d.ts +1 -0
  113. package/dist/foundations/gallery/sections/feedback-section.d.ts +1 -0
  114. package/dist/foundations/gallery/sections/input-authoring-card.d.ts +1 -0
  115. package/dist/foundations/gallery/sections/inputs-section.d.ts +1 -0
  116. package/dist/foundations/gallery/sections/layout-section.d.ts +1 -0
  117. package/dist/foundations/gallery/sections/navigation-identity-section.d.ts +1 -0
  118. package/dist/foundations/gallery/sections/overlays-section.d.ts +1 -0
  119. package/dist/foundations/gallery/sections/panels-section.d.ts +1 -0
  120. package/dist/foundations/gallery/sections/param-editor-composite-card.d.ts +1 -0
  121. package/dist/foundations/gallery/sections/settings-composite-cards.d.ts +1 -0
  122. package/dist/index.d.ts +15 -84
  123. package/dist/index.js +3594 -7450
  124. package/dist/index.js.map +1 -1
  125. package/dist/list-row-mi3Hn-Um.js +740 -0
  126. package/dist/list-row-mi3Hn-Um.js.map +1 -0
  127. package/dist/mermaid-renderer-DZo3qj6D.js +425 -0
  128. package/dist/mermaid-renderer-DZo3qj6D.js.map +1 -0
  129. package/dist/mermaid.js +5 -0
  130. package/dist/mermaid.js.map +1 -0
  131. package/dist/radio-cLMEBBZk.js +76 -0
  132. package/dist/radio-cLMEBBZk.js.map +1 -0
  133. package/dist/resource-badge-qCWHP-wQ.js +99 -0
  134. package/dist/resource-badge-qCWHP-wQ.js.map +1 -0
  135. package/dist/{rich-message-BFtvH9H7.js → rich-message-DBf_5YlW.js} +462 -481
  136. package/dist/rich-message-DBf_5YlW.js.map +1 -0
  137. package/dist/rich-text.js +397 -390
  138. package/dist/rich-text.js.map +1 -1
  139. package/dist/scroll-area-BMbg1WcD.js +91 -0
  140. package/dist/scroll-area-BMbg1WcD.js.map +1 -0
  141. package/dist/style.css +1 -1
  142. package/dist/terminal.js +339 -0
  143. package/dist/terminal.js.map +1 -0
  144. package/dist/theme/global.d.ts +3 -0
  145. package/dist/theme/recipes/badge.d.ts +50 -0
  146. package/dist/theme/recipes/button.d.ts +24 -19
  147. package/dist/theme/recipes/color-picker.d.ts +1 -0
  148. package/dist/theme/recipes/dialog.d.ts +1 -1
  149. package/dist/theme/recipes/drawer.d.ts +1 -1
  150. package/dist/theme/recipes/input.d.ts +55 -0
  151. package/dist/theme/recipes/number-input.d.ts +98 -0
  152. package/dist/theme/recipes/tabs.d.ts +49 -28
  153. package/dist/theme/recipes/textarea.d.ts +62 -1
  154. package/dist/theme/recipes/timeline.d.ts +74 -0
  155. package/dist/theme/shadowless-default-config.d.ts +2 -0
  156. package/dist/theme/tokens/borders.d.ts +0 -3
  157. package/dist/theme/tokens/colors.d.ts +100 -70
  158. package/dist/{theme-C5qHTCU9.js → theme-CJBYBJaA.js} +1264 -415
  159. package/dist/theme-CJBYBJaA.js.map +1 -0
  160. package/dist/theme-preference-DOzHx64J.js +123 -0
  161. package/dist/theme-preference-DOzHx64J.js.map +1 -0
  162. package/dist/theme.js +1 -1
  163. package/dist/tree-list-CcuZMLS5.js +930 -0
  164. package/dist/tree-list-CcuZMLS5.js.map +1 -0
  165. package/dist/workspace-badge-Fuo-1zPj.js +314 -0
  166. package/dist/workspace-badge-Fuo-1zPj.js.map +1 -0
  167. package/package.json +23 -3
  168. package/dist/components/file-tree-helpers.d.ts +0 -8
  169. package/dist/components/open-source-notices-screen.d.ts +0 -20
  170. package/dist/components/param-editor/input-group.d.ts +0 -10
  171. package/dist/components/rich-text/shared/plugins/MermaidPlugin/index.d.ts +0 -1
  172. package/dist/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.d.ts +0 -5
  173. package/dist/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.d.ts +0 -2
  174. package/dist/components/rich-text/theme/report-theme.d.ts +0 -3
  175. package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
  176. package/dist/components/style-guide-data.d.ts +0 -46
  177. package/dist/components/style-guide.d.ts +0 -1
  178. package/dist/mermaid-renderer-DYEiYmYQ.js +0 -411
  179. package/dist/mermaid-renderer-DYEiYmYQ.js.map +0 -1
  180. package/dist/radio-DJtQY9po.js +0 -286
  181. package/dist/radio-DJtQY9po.js.map +0 -1
  182. package/dist/resource-badge-D33IFv74.js +0 -188
  183. package/dist/resource-badge-D33IFv74.js.map +0 -1
  184. package/dist/rich-message-BFtvH9H7.js.map +0 -1
  185. package/dist/theme/tokens/shadows.d.ts +0 -64
  186. package/dist/theme-C5qHTCU9.js.map +0 -1
  187. package/dist/utils/formats.d.ts +0 -7
  188. /package/dist/components/{palette-filter.d.ts → command-palette/palette-filter.d.ts} +0 -0
  189. /package/dist/components/{palette-list.d.ts → command-palette/palette-list.d.ts} +0 -0
  190. /package/dist/components/{palette-shortcut.d.ts → command-palette/palette-shortcut.d.ts} +0 -0
  191. /package/dist/components/{palette.d.ts → command-palette/palette.d.ts} +0 -0
  192. /package/dist/components/{code-editor.d.ts → diff-viewer/code-editor.d.ts} +0 -0
  193. /package/dist/components/{column-file-browser.d.ts → file-browser/column-file-browser.d.ts} +0 -0
  194. /package/dist/components/{performance-panel.d.ts → internal/performance-panel.d.ts} +0 -0
  195. /package/dist/components/{header.d.ts → layout/header.d.ts} +0 -0
  196. /package/dist/components/{horizontal-menu-stack.d.ts → layout/horizontal-menu-stack.d.ts} +0 -0
  197. /package/dist/components/{item-section.d.ts → layout/item-section.d.ts} +0 -0
  198. /package/dist/components/{panel-header.constants.d.ts → layout/panel-header.constants.d.ts} +0 -0
  199. /package/dist/components/{resizable-split-layout.d.ts → layout/resizable-split-layout.d.ts} +0 -0
  200. /package/dist/components/{resizable-split-layout.handle.d.ts → layout/resizable-split-layout.handle.d.ts} +0 -0
  201. /package/dist/components/{attached-panel.d.ts → overlays/attached-panel.d.ts} +0 -0
  202. /package/dist/components/{bubble-panel.d.ts → overlays/bubble-panel.d.ts} +0 -0
  203. /package/dist/components/{delete-confirmation-modal.d.ts → overlays/delete-confirmation-modal.d.ts} +0 -0
  204. /package/dist/components/{repo-picker-dialog.d.ts → overlays/repo-picker-dialog.d.ts} +0 -0
  205. /package/dist/components/{resource-context-menu.d.ts → overlays/resource-context-menu.d.ts} +0 -0
  206. /package/dist/components/param-editor/{color-input.d.ts → inputs/color-input.d.ts} +0 -0
  207. /package/dist/components/param-editor/{date-input.d.ts → inputs/date-input.d.ts} +0 -0
  208. /package/dist/components/param-editor/{horizontal-text-input.d.ts → inputs/horizontal-text-input.d.ts} +0 -0
  209. /package/dist/components/param-editor/{number-input.d.ts → inputs/number-input.d.ts} +0 -0
  210. /package/dist/components/param-editor/{selection-input.d.ts → inputs/selection-input.d.ts} +0 -0
  211. /package/dist/components/param-editor/{text-input.d.ts → inputs/text-input.d.ts} +0 -0
  212. /package/dist/components/{alert.d.ts → primitives/alert.d.ts} +0 -0
  213. /package/dist/components/{checkbox.d.ts → primitives/checkbox.d.ts} +0 -0
  214. /package/dist/components/{content-placeholder.d.ts → primitives/content-placeholder.d.ts} +0 -0
  215. /package/dist/components/{empty-state.d.ts → primitives/empty-state.d.ts} +0 -0
  216. /package/dist/components/{error-boundary.d.ts → primitives/error-boundary.d.ts} +0 -0
  217. /package/dist/components/{info-card.d.ts → primitives/info-card.d.ts} +0 -0
  218. /package/dist/components/{integration-card.d.ts → primitives/integration-card.d.ts} +0 -0
  219. /package/dist/components/{radio.d.ts → primitives/radio.d.ts} +0 -0
  220. /package/dist/components/{resource-badge.d.ts → primitives/resource-badge.d.ts} +0 -0
  221. /package/dist/components/{scroll-area.d.ts → primitives/scroll-area.d.ts} +0 -0
  222. /package/dist/components/{simple-card.d.ts → primitives/simple-card.d.ts} +0 -0
  223. /package/dist/components/{slider.d.ts → primitives/slider.d.ts} +0 -0
  224. /package/dist/components/{switch.d.ts → primitives/switch.d.ts} +0 -0
  225. /package/dist/components/{toaster.d.ts → primitives/toaster.d.ts} +0 -0
  226. /package/dist/components/{workspace-badge.d.ts → primitives/workspace-badge.d.ts} +0 -0
package/dist/rich-text.js CHANGED
@@ -1,102 +1,103 @@
1
- import { jsx as n, jsxs as ie, Fragment as ft } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as le, Fragment as ft } from "react/jsx-runtime";
2
2
  import { c as te } from "react/compiler-runtime";
3
- import { T as Ke, e as We, a as Ve, C as Ge, I as qe, E as Ye, b as Xe, s as mt, n as ut, c as He, d as pt, f as ht } from "./rich-message-BFtvH9H7.js";
4
- import { D as co, g as fo, R as mo, P as uo, R as po, h as ho, i as go } from "./rich-message-BFtvH9H7.js";
5
- import { IconButton as F, Text as me, Stack as Pe, Box as $e, Flex as Ae, Input as gt, Link as bt } from "@chakra-ui/react";
3
+ import { e as Ke, a as We, C as Ge, I as Ve, E as qe, b as Ye, s as mt, n as ut, c as Te, T as ht, d as pt } from "./rich-message-DBf_5YlW.js";
4
+ import { D as uo, f as ho, R as po, P as go, R as bo, g as vo, h as Co } from "./rich-message-DBf_5YlW.js";
5
+ import { IconButton as K, Text as ue, Stack as Ae, Box as ze, Flex as Me, Input as gt, Link as bt } from "@chakra-ui/react";
6
6
  import { LexicalCollaboration as vt } from "@lexical/react/LexicalCollaborationContext";
7
7
  import { CollaborationPluginV2__EXPERIMENTAL as Ct } from "@lexical/react/LexicalCollaborationPlugin";
8
- import { LexicalComposer as Qe } from "@lexical/react/LexicalComposer";
9
- import { LexicalErrorBoundary as Ze } from "@lexical/react/LexicalErrorBoundary";
10
- import { HorizontalRulePlugin as Je } from "@lexical/react/LexicalHorizontalRulePlugin";
11
- import { LinkPlugin as et } from "@lexical/react/LexicalLinkPlugin";
12
- import { ListPlugin as tt } from "@lexical/react/LexicalListPlugin";
13
- import { RichTextPlugin as nt } from "@lexical/react/LexicalRichTextPlugin";
14
- import { TabIndentationPlugin as ot } from "@lexical/react/LexicalTabIndentationPlugin";
15
- import { useState as B, useRef as oe, useEffect as q, useLayoutEffect as _t } from "react";
8
+ import { LexicalComposer as Xe } from "@lexical/react/LexicalComposer";
9
+ import { LexicalErrorBoundary as Qe } from "@lexical/react/LexicalErrorBoundary";
10
+ import { HorizontalRulePlugin as Ze } from "@lexical/react/LexicalHorizontalRulePlugin";
11
+ import { LinkPlugin as Je } from "@lexical/react/LexicalLinkPlugin";
12
+ import { ListPlugin as et } from "@lexical/react/LexicalListPlugin";
13
+ import { RichTextPlugin as tt } from "@lexical/react/LexicalRichTextPlugin";
14
+ import { TabIndentationPlugin as nt } from "@lexical/react/LexicalTabIndentationPlugin";
15
+ import { useState as A, useRef as ie, useEffect as Y, useLayoutEffect as _t } from "react";
16
16
  import { WebsocketProvider as Et } from "y-websocket";
17
17
  import * as kt from "yjs";
18
- import { useLexicalComposerContext as De } from "@lexical/react/LexicalComposerContext";
18
+ import { useLexicalComposerContext as $e } from "@lexical/react/LexicalComposerContext";
19
19
  import { mergeRegister as Le, $findMatchingParent as Z } from "@lexical/utils";
20
- import { SELECTION_CHANGE_COMMAND as Se, COMMAND_PRIORITY_CRITICAL as Oe, $getSelection as ee, $isRangeSelection as Q, FORMAT_TEXT_COMMAND as Te, $isRootOrShadowRoot as Lt, CLICK_COMMAND as it, COMMAND_PRIORITY_HIGH as lt, $createParagraphNode as Fe, COMMAND_PRIORITY_LOW as Be, KEY_ESCAPE_COMMAND as St, $isLineBreakNode as yt, $setSelection as xt, $getRoot as Tt } from "lexical";
21
- import { Check as rt, Copy as Rt, Link as wt, Code2 as Nt, List as It, ListOrdered as Pt, ListTodo as At, X as Bt, Pencil as zt, Trash2 as Mt } from "lucide-react";
22
- import { createPortal as Ue } from "react-dom";
23
- import { T as j } from "./resource-badge-D33IFv74.js";
24
- import { $isCodeNode as Re, $createCodeNode as $t } from "@lexical/code";
25
- import { $isLinkNode as le, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as ze, $createLinkNode as Dt } from "@lexical/link";
26
- import { $isListNode as we, REMOVE_LIST_COMMAND as Ot, INSERT_CHECK_LIST_COMMAND as Ut, INSERT_ORDERED_LIST_COMMAND as Ht, INSERT_UNORDERED_LIST_COMMAND as Ft } from "@lexical/list";
27
- import { $isHeadingNode as jt, $createHeadingNode as Kt } from "@lexical/rich-text";
20
+ import { SELECTION_CHANGE_COMMAND as Se, COMMAND_PRIORITY_CRITICAL as Ue, $getSelection as ee, $isRangeSelection as Q, createCommand as Lt, FORMAT_TEXT_COMMAND as Re, $isRootOrShadowRoot as St, CLICK_COMMAND as ot, COMMAND_PRIORITY_HIGH as it, $createParagraphNode as Fe, COMMAND_PRIORITY_LOW as Be, KEY_ESCAPE_COMMAND as yt, $isLineBreakNode as xt, $setSelection as Tt, $getRoot as Rt } from "lexical";
21
+ import { Check as lt, Copy as wt, Link as Nt, Code2 as It, List as Pt, ListOrdered as At, ListTodo as Mt, X as Bt, Pencil as Dt, Trash2 as Ot } from "lucide-react";
22
+ import { createPortal as He } from "react-dom";
23
+ import { T as W } from "./scroll-area-BMbg1WcD.js";
24
+ import { $isCodeNode as we, $createCodeNode as zt } from "@lexical/code";
25
+ import { $isLinkNode as re, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as De, $createLinkNode as $t } from "@lexical/link";
26
+ import { $isListNode as Ne, REMOVE_LIST_COMMAND as Ut, INSERT_CHECK_LIST_COMMAND as Ht, INSERT_ORDERED_LIST_COMMAND as Ft, INSERT_UNORDERED_LIST_COMMAND as jt } from "@lexical/list";
27
+ import { $isHeadingNode as Kt, $createHeadingNode as Wt } from "@lexical/rich-text";
28
28
  import { $isAtNodeEnd as je, $setBlocksType as _e } from "@lexical/selection";
29
- import { $convertFromMarkdownString as Wt, $convertToMarkdownString as Vt } from "@lexical/markdown";
30
- import { AutoFocusPlugin as Gt } from "@lexical/react/LexicalAutoFocusPlugin";
31
- import { CheckListPlugin as qt } from "@lexical/react/LexicalCheckListPlugin";
32
- import { HistoryPlugin as Yt } from "@lexical/react/LexicalHistoryPlugin";
33
- import { OnChangePlugin as Xt } from "@lexical/react/LexicalOnChangePlugin";
34
- function Ne(t) {
29
+ import { $convertFromMarkdownString as Gt, $convertToMarkdownString as Vt } from "@lexical/markdown";
30
+ import { AutoFocusPlugin as qt } from "@lexical/react/LexicalAutoFocusPlugin";
31
+ import { CheckListPlugin as Yt } from "@lexical/react/LexicalCheckListPlugin";
32
+ import { HistoryPlugin as Xt } from "@lexical/react/LexicalHistoryPlugin";
33
+ import { MarkdownShortcutPlugin as Qt } from "@lexical/react/LexicalMarkdownShortcutPlugin";
34
+ import { OnChangePlugin as Zt } from "@lexical/react/LexicalOnChangePlugin";
35
+ function Ie(t) {
35
36
  const e = ee();
36
37
  if (!Q(e))
37
38
  return null;
38
- const r = e.anchor.getNode(), o = Re(r) ? r : Z(r, (m) => Re(m));
39
- if (!Re(o))
39
+ const r = e.anchor.getNode(), o = we(r) ? r : Z(r, (u) => we(u));
40
+ if (!we(o))
40
41
  return null;
41
42
  const l = t.getElementByKey(o.getKey());
42
43
  return l instanceof HTMLElement ? l : null;
43
44
  }
44
- function Qt(t) {
45
+ function Jt(t) {
45
46
  return t instanceof HTMLElement ? t.closest(".rich-text__code") : null;
46
47
  }
47
- function Zt(t, e) {
48
+ function en(t, e) {
48
49
  const r = t.getBoundingClientRect(), o = e.getBoundingClientRect();
49
50
  return {
50
51
  top: o.top - r.top + 6,
51
52
  left: o.right - r.left - 30
52
53
  };
53
54
  }
54
- function st(t) {
55
+ function rt(t) {
55
56
  const e = te(31), {
56
57
  anchorElem: r
57
- } = t, [o] = De(), [l, m] = B(null), [L, u] = B(!1), a = oe(null);
58
+ } = t, [o] = $e(), [l, u] = A(null), [L, h] = A(!1), a = ie(null);
58
59
  let p, E;
59
60
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => () => {
60
61
  a.current !== null && window.clearTimeout(a.current);
61
- }, E = [], e[0] = p, e[1] = E) : (p = e[0], E = e[1]), q(p, E);
62
- let b, h;
62
+ }, E = [], e[0] = p, e[1] = E) : (p = e[0], E = e[1]), Y(p, E);
63
+ let b, d;
63
64
  e[2] !== o ? (b = () => {
64
65
  const _ = o.getRootElement();
65
66
  if (!_)
66
67
  return;
67
68
  const k = (I) => {
68
- const z = Qt(I.target);
69
- m(z instanceof HTMLElement ? z : null);
69
+ const M = Jt(I.target);
70
+ u(M instanceof HTMLElement ? M : null);
70
71
  }, N = () => {
71
72
  o.getEditorState().read(() => {
72
- const I = Ne(o);
73
- m(I);
73
+ const I = Ie(o);
74
+ u(I);
74
75
  });
75
76
  };
76
77
  return _.addEventListener("pointermove", k), _.addEventListener("pointerleave", N), () => {
77
78
  _.removeEventListener("pointermove", k), _.removeEventListener("pointerleave", N);
78
79
  };
79
- }, h = [o], e[2] = o, e[3] = b, e[4] = h) : (b = e[3], h = e[4]), q(b, h);
80
+ }, d = [o], e[2] = o, e[3] = b, e[4] = d) : (b = e[3], d = e[4]), Y(b, d);
80
81
  let C, R;
81
82
  if (e[5] !== o ? (C = () => Le(o.registerUpdateListener((_) => {
82
83
  const {
83
84
  editorState: k
84
85
  } = _;
85
86
  k.read(() => {
86
- const N = Ne(o);
87
- N && m(N);
87
+ const N = Ie(o);
88
+ N && u(N);
88
89
  });
89
90
  }), o.registerCommand(Se, () => (o.getEditorState().read(() => {
90
- const _ = Ne(o);
91
+ const _ = Ie(o);
91
92
  if (!_) {
92
- m(Jt);
93
+ u(tn);
93
94
  return;
94
95
  }
95
- m(_);
96
- }), !1), Oe)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), q(C, R), !r || !l)
96
+ u(_);
97
+ }), !1), Ue)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), Y(C, R), !r || !l)
97
98
  return null;
98
99
  let c;
99
- e[8] !== l || e[9] !== r ? (c = Zt(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
100
+ e[8] !== l || e[9] !== r ? (c = en(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
100
101
  const w = c;
101
102
  let v;
102
103
  e[11] !== w.left || e[12] !== w.top ? (v = {
@@ -104,169 +105,170 @@ function st(t) {
104
105
  top: w.top,
105
106
  left: w.left
106
107
  }, e[11] = w.left, e[12] = w.top, e[13] = v) : v = e[13];
107
- const S = v, g = L ? "Copied" : "Copy code", d = L ? "Copied" : "Copy code";
108
+ const S = v, g = L ? "Copied" : "Copy code", f = L ? "Copied" : "Copy code";
108
109
  let i;
109
110
  e[14] !== l.textContent ? (i = async () => {
110
111
  const _ = l.textContent ?? "";
111
112
  try {
112
- await navigator.clipboard.writeText(_), u(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
113
- u(!1);
113
+ await navigator.clipboard.writeText(_), h(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
114
+ h(!1);
114
115
  }, 1200);
115
116
  } catch {
116
- u(!1);
117
+ h(!1);
117
118
  }
118
119
  }, e[14] = l.textContent, e[15] = i) : i = e[15];
119
120
  let s;
120
- e[16] !== L ? (s = L ? /* @__PURE__ */ n(rt, { size: 14 }) : /* @__PURE__ */ n(Rt, { size: 14 }), e[16] = L, e[17] = s) : s = e[17];
121
- let f;
122
- e[18] !== d || e[19] !== i || e[20] !== s ? (f = /* @__PURE__ */ n(F, { "aria-label": d, variant: "surface", size: "xs", onClick: i, children: s }), e[18] = d, e[19] = i, e[20] = s, e[21] = f) : f = e[21];
121
+ e[16] !== L ? (s = L ? /* @__PURE__ */ n(lt, { size: 14 }) : /* @__PURE__ */ n(wt, { size: 14 }), e[16] = L, e[17] = s) : s = e[17];
122
+ let m;
123
+ e[18] !== f || e[19] !== i || e[20] !== s ? (m = /* @__PURE__ */ n(K, { "aria-label": f, variant: "subtle", size: "xs", onClick: i, children: s }), e[18] = f, e[19] = i, e[20] = s, e[21] = m) : m = e[21];
123
124
  let y;
124
- e[22] !== f || e[23] !== g ? (y = /* @__PURE__ */ n(j, { content: g, children: f }), e[22] = f, e[23] = g, e[24] = y) : y = e[24];
125
+ e[22] !== m || e[23] !== g ? (y = /* @__PURE__ */ n(W, { content: g, children: m }), e[22] = m, e[23] = g, e[24] = y) : y = e[24];
125
126
  let x;
126
127
  e[25] !== S || e[26] !== y ? (x = /* @__PURE__ */ n("div", { className: "code-block-actions", style: S, children: y }), e[25] = S, e[26] = y, e[27] = x) : x = e[27];
127
128
  let T;
128
- return e[28] !== r || e[29] !== x ? (T = Ue(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
129
+ return e[28] !== r || e[29] !== x ? (T = He(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
129
130
  }
130
- function Jt(t) {
131
+ function tn(t) {
131
132
  return t?.matches(":hover") ? t : null;
132
133
  }
133
- function he(t) {
134
+ const st = Lt("TOGGLE_LINK_EDIT_MODE_COMMAND");
135
+ function ge(t) {
134
136
  const e = t.anchor, r = t.focus, o = t.anchor.getNode(), l = t.focus.getNode();
135
137
  return o === l ? o : t.isBackward() ? je(r) ? o : l : je(e) ? o : l;
136
138
  }
137
- const en = 10, tn = 5;
138
- function ke(t, e, r, o = en, l = tn, m = "legacy") {
139
+ const nn = 10, on = 5;
140
+ function ke(t, e, r, o = nn, l = on, u = "legacy") {
139
141
  const L = r.parentElement;
140
142
  if (t === null || !L) {
141
143
  e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
142
144
  return;
143
145
  }
144
- const u = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = L.getBoundingClientRect();
145
- let E = m === "above" ? t.top - u.height - o : t.top - o, b = t.left - l;
146
- E < p.top && (E = m === "above" ? t.bottom + o : E + u.height + t.height + o * 2), b + u.width > p.right && (b = p.right - u.width - l), E -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${E}px)`;
146
+ const h = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = L.getBoundingClientRect();
147
+ let E = u === "above" ? t.top - h.height - o : t.top - o, b = t.left - l;
148
+ E < p.top && (E = u === "above" ? t.bottom + o : E + h.height + t.height + o * 2), b + h.width > p.right && (b = p.right - h.width - l), E -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${E}px)`;
147
149
  }
148
- function Ie() {
150
+ function Pe() {
149
151
  const t = te(1);
150
152
  let e;
151
153
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("span", { style: {
152
154
  display: "inline-flex",
153
155
  height: "1rem",
154
156
  margin: "0 0.25rem",
155
- borderLeft: "1px solid var(--chakra-colors-border-muted)"
157
+ borderLeft: "1px solid var(--chakra-colors-border-subtle)"
156
158
  } }), t[0] = e) : e = t[0], e;
157
159
  }
158
- function nn(t) {
160
+ function ln(t) {
159
161
  const e = te(81), {
160
162
  editor: r,
161
163
  blockType: o,
162
164
  isBold: l,
163
- isItalic: m,
165
+ isItalic: u,
164
166
  isUnderline: L,
165
- isLink: u,
167
+ isLink: h,
166
168
  formatHeading: a,
167
169
  formatList: p,
168
170
  formatCodeBlock: E,
169
171
  insertLink: b
170
- } = t, h = l || void 0;
172
+ } = t, d = l || void 0;
171
173
  let C;
172
- e[0] !== r ? (C = () => r.dispatchCommand(Te, "bold"), e[0] = r, e[1] = C) : C = e[1];
174
+ e[0] !== r ? (C = () => r.dispatchCommand(Re, "bold"), e[0] = r, e[1] = C) : C = e[1];
173
175
  let R;
174
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(me, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
176
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(ue, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
175
177
  let c;
176
- e[3] !== h || e[4] !== C ? (c = /* @__PURE__ */ n(j, { content: "Bold", children: /* @__PURE__ */ n(F, { "data-active": h, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = h, e[4] = C, e[5] = c) : c = e[5];
177
- const w = m || void 0;
178
+ e[3] !== d || e[4] !== C ? (c = /* @__PURE__ */ n(W, { content: "Bold", children: /* @__PURE__ */ n(K, { "data-active": d, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = d, e[4] = C, e[5] = c) : c = e[5];
179
+ const w = u || void 0;
178
180
  let v;
179
- e[6] !== r ? (v = () => r.dispatchCommand(Te, "italic"), e[6] = r, e[7] = v) : v = e[7];
181
+ e[6] !== r ? (v = () => r.dispatchCommand(Re, "italic"), e[6] = r, e[7] = v) : v = e[7];
180
182
  let S;
181
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(me, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = S) : S = e[8];
183
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(ue, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = S) : S = e[8];
182
184
  let g;
183
- e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(j, { content: "Italic", children: /* @__PURE__ */ n(F, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: S }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
184
- const d = L || void 0;
185
+ e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(W, { content: "Italic", children: /* @__PURE__ */ n(K, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: S }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
186
+ const f = L || void 0;
185
187
  let i;
186
- e[12] !== r ? (i = () => r.dispatchCommand(Te, "underline"), e[12] = r, e[13] = i) : i = e[13];
188
+ e[12] !== r ? (i = () => r.dispatchCommand(Re, "underline"), e[12] = r, e[13] = i) : i = e[13];
187
189
  let s;
188
- e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(me, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
189
- let f;
190
- e[15] !== d || e[16] !== i ? (f = /* @__PURE__ */ n(j, { content: "Underline", children: /* @__PURE__ */ n(F, { "data-active": d, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = d, e[16] = i, e[17] = f) : f = e[17];
191
- const y = u ? "Remove Link" : "Insert Link", x = u || void 0, T = u ? "Remove Link" : "Insert Link";
190
+ e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(ue, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
191
+ let m;
192
+ e[15] !== f || e[16] !== i ? (m = /* @__PURE__ */ n(W, { content: "Underline", children: /* @__PURE__ */ n(K, { "data-active": f, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = f, e[16] = i, e[17] = m) : m = e[17];
193
+ const y = h ? "Remove Link" : "Insert Link", x = h || void 0, T = h ? "Remove Link" : "Insert Link";
192
194
  let _;
193
- e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(wt, { size: 14 }), e[18] = _) : _ = e[18];
195
+ e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(Nt, { size: 14 }), e[18] = _) : _ = e[18];
194
196
  let k;
195
- e[19] !== b || e[20] !== x || e[21] !== T ? (k = /* @__PURE__ */ n(F, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = k) : k = e[22];
197
+ e[19] !== b || e[20] !== x || e[21] !== T ? (k = /* @__PURE__ */ n(K, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = k) : k = e[22];
196
198
  let N;
197
- e[23] !== y || e[24] !== k ? (N = /* @__PURE__ */ n(j, { content: y, children: k }), e[23] = y, e[24] = k, e[25] = N) : N = e[25];
199
+ e[23] !== y || e[24] !== k ? (N = /* @__PURE__ */ n(W, { content: y, children: k }), e[23] = y, e[24] = k, e[25] = N) : N = e[25];
198
200
  let I;
199
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Ie, {}), e[26] = I) : I = e[26];
200
- const z = o === "h1" || void 0;
201
- let D;
202
- e[27] !== a ? (D = () => a("h1"), e[27] = a, e[28] = D) : D = e[28];
203
- let W;
204
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = W) : W = e[29];
201
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Pe, {}), e[26] = I) : I = e[26];
202
+ const M = o === "h1" || void 0;
205
203
  let O;
206
- e[30] !== z || e[31] !== D ? (O = /* @__PURE__ */ n(j, { content: "Heading 1", children: /* @__PURE__ */ n(F, { "data-active": z, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: D, children: W }) }), e[30] = z, e[31] = D, e[32] = O) : O = e[32];
207
- const K = o === "h2" || void 0;
208
- let M;
209
- e[33] !== a ? (M = () => a("h2"), e[33] = a, e[34] = M) : M = e[34];
210
- let V;
211
- e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = V) : V = e[35];
212
- let P;
213
- e[36] !== K || e[37] !== M ? (P = /* @__PURE__ */ n(j, { content: "Heading 2", children: /* @__PURE__ */ n(F, { "data-active": K, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: M, children: V }) }), e[36] = K, e[37] = M, e[38] = P) : P = e[38];
214
- const $ = o === "h3" || void 0;
215
- let A;
216
- e[39] !== a ? (A = () => a("h3"), e[39] = a, e[40] = A) : A = e[40];
204
+ e[27] !== a ? (O = () => a("h1"), e[27] = a, e[28] = O) : O = e[28];
205
+ let z;
206
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = z) : z = e[29];
207
+ let $;
208
+ e[30] !== M || e[31] !== O ? ($ = /* @__PURE__ */ n(W, { content: "Heading 1", children: /* @__PURE__ */ n(K, { "data-active": M, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: O, children: z }) }), e[30] = M, e[31] = O, e[32] = $) : $ = e[32];
209
+ const G = o === "h2" || void 0;
217
210
  let U;
218
- e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = U) : U = e[41];
211
+ e[33] !== a ? (U = () => a("h2"), e[33] = a, e[34] = U) : U = e[34];
219
212
  let H;
220
- e[42] !== $ || e[43] !== A ? (H = /* @__PURE__ */ n(j, { content: "Heading 3", children: /* @__PURE__ */ n(F, { "data-active": $, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: A, children: U }) }), e[42] = $, e[43] = A, e[44] = H) : H = e[44];
221
- let G;
222
- e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n(Ie, {}), e[45] = G) : G = e[45];
213
+ e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = H) : H = e[35];
214
+ let B;
215
+ e[36] !== G || e[37] !== U ? (B = /* @__PURE__ */ n(W, { content: "Heading 2", children: /* @__PURE__ */ n(K, { "data-active": G, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: U, children: H }) }), e[36] = G, e[37] = U, e[38] = B) : B = e[38];
216
+ const D = o === "h3" || void 0;
217
+ let P;
218
+ e[39] !== a ? (P = () => a("h3"), e[39] = a, e[40] = P) : P = e[40];
219
+ let F;
220
+ e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = F) : F = e[41];
221
+ let j;
222
+ e[42] !== D || e[43] !== P ? (j = /* @__PURE__ */ n(W, { content: "Heading 3", children: /* @__PURE__ */ n(K, { "data-active": D, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: P, children: F }) }), e[42] = D, e[43] = P, e[44] = j) : j = e[44];
223
+ let V;
224
+ e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Pe, {}), e[45] = V) : V = e[45];
223
225
  const J = o === "code" || void 0;
224
- let Y;
225
- e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Y = /* @__PURE__ */ n(Nt, { size: 14 }), e[46] = Y) : Y = e[46];
226
226
  let X;
227
- e[47] !== E || e[48] !== J ? (X = /* @__PURE__ */ n(j, { content: "Code Block", children: /* @__PURE__ */ n(F, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: E, children: Y }) }), e[47] = E, e[48] = J, e[49] = X) : X = e[49];
228
- let re;
229
- e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = /* @__PURE__ */ n(Ie, {}), e[50] = re) : re = e[50];
230
- const ue = o === "bullet" || void 0;
227
+ e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n(It, { size: 14 }), e[46] = X) : X = e[46];
228
+ let q;
229
+ e[47] !== E || e[48] !== J ? (q = /* @__PURE__ */ n(W, { content: "Code Block", children: /* @__PURE__ */ n(K, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: E, children: X }) }), e[47] = E, e[48] = J, e[49] = q) : q = e[49];
231
230
  let ne;
232
- e[51] !== p ? (ne = () => p("bullet"), e[51] = p, e[52] = ne) : ne = e[52];
233
- let ge;
234
- e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = /* @__PURE__ */ n(It, { size: 14 }), e[53] = ge) : ge = e[53];
231
+ e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ n(Pe, {}), e[50] = ne) : ne = e[50];
232
+ const he = o === "bullet" || void 0;
233
+ let oe;
234
+ e[51] !== p ? (oe = () => p("bullet"), e[51] = p, e[52] = oe) : oe = e[52];
235
235
  let se;
236
- e[54] !== ue || e[55] !== ne ? (se = /* @__PURE__ */ n(j, { content: "Bulleted List", children: /* @__PURE__ */ n(F, { "data-active": ue, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: ne, children: ge }) }), e[54] = ue, e[55] = ne, e[56] = se) : se = e[56];
237
- const ye = o === "number" || void 0;
236
+ e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ n(Pt, { size: 14 }), e[53] = se) : se = e[53];
238
237
  let ae;
239
- e[57] !== p ? (ae = () => p("number"), e[57] = p, e[58] = ae) : ae = e[58];
240
- let be;
241
- e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ n(Pt, { size: 14 }), e[59] = be) : be = e[59];
238
+ e[54] !== he || e[55] !== oe ? (ae = /* @__PURE__ */ n(W, { content: "Bulleted List", children: /* @__PURE__ */ n(K, { "data-active": he, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: oe, children: se }) }), e[54] = he, e[55] = oe, e[56] = ae) : ae = e[56];
239
+ const ye = o === "number" || void 0;
242
240
  let ce;
243
- e[60] !== ye || e[61] !== ae ? (ce = /* @__PURE__ */ n(j, { content: "Numbered List", children: /* @__PURE__ */ n(F, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ae, children: be }) }), e[60] = ye, e[61] = ae, e[62] = ce) : ce = e[62];
244
- const xe = o === "check" || void 0;
241
+ e[57] !== p ? (ce = () => p("number"), e[57] = p, e[58] = ce) : ce = e[58];
242
+ let be;
243
+ e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ n(At, { size: 14 }), e[59] = be) : be = e[59];
245
244
  let de;
246
- e[63] !== p ? (de = () => p("check"), e[63] = p, e[64] = de) : de = e[64];
247
- let ve;
248
- e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ n(At, { size: 14 }), e[65] = ve) : ve = e[65];
245
+ e[60] !== ye || e[61] !== ce ? (de = /* @__PURE__ */ n(W, { content: "Numbered List", children: /* @__PURE__ */ n(K, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ce, children: be }) }), e[60] = ye, e[61] = ce, e[62] = de) : de = e[62];
246
+ const xe = o === "check" || void 0;
249
247
  let fe;
250
- e[66] !== xe || e[67] !== de ? (fe = /* @__PURE__ */ n(j, { content: "Check List", children: /* @__PURE__ */ n(F, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: de, children: ve }) }), e[66] = xe, e[67] = de, e[68] = fe) : fe = e[68];
248
+ e[63] !== p ? (fe = () => p("check"), e[63] = p, e[64] = fe) : fe = e[64];
249
+ let ve;
250
+ e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ n(Mt, { size: 14 }), e[65] = ve) : ve = e[65];
251
+ let me;
252
+ e[66] !== xe || e[67] !== fe ? (me = /* @__PURE__ */ n(W, { content: "Check List", children: /* @__PURE__ */ n(K, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: fe, children: ve }) }), e[66] = xe, e[67] = fe, e[68] = me) : me = e[68];
251
253
  let Ce;
252
- return e[69] !== f || e[70] !== N || e[71] !== O || e[72] !== P || e[73] !== c || e[74] !== H || e[75] !== X || e[76] !== se || e[77] !== ce || e[78] !== fe || e[79] !== g ? (Ce = /* @__PURE__ */ ie(Pe, { direction: "row", gap: "0.5", alignItems: "center", children: [
254
+ return e[69] !== m || e[70] !== N || e[71] !== $ || e[72] !== B || e[73] !== c || e[74] !== j || e[75] !== q || e[76] !== ae || e[77] !== de || e[78] !== me || e[79] !== g ? (Ce = /* @__PURE__ */ le(Ae, { direction: "row", gap: "0.5", alignItems: "center", children: [
253
255
  c,
254
256
  g,
255
- f,
257
+ m,
256
258
  N,
257
259
  I,
258
- O,
259
- P,
260
- H,
261
- G,
262
- X,
263
- re,
264
- se,
265
- ce,
266
- fe
267
- ] }), e[69] = f, e[70] = N, e[71] = O, e[72] = P, e[73] = c, e[74] = H, e[75] = X, e[76] = se, e[77] = ce, e[78] = fe, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
268
- }
269
- const on = {
260
+ $,
261
+ B,
262
+ j,
263
+ V,
264
+ q,
265
+ ne,
266
+ ae,
267
+ de,
268
+ me
269
+ ] }), e[69] = m, e[70] = N, e[71] = $, e[72] = B, e[73] = c, e[74] = j, e[75] = q, e[76] = ae, e[77] = de, e[78] = me, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
270
+ }
271
+ const rn = {
270
272
  bullet: "Bulleted List",
271
273
  check: "Check List",
272
274
  code: "Code Block",
@@ -279,93 +281,93 @@ const on = {
279
281
  number: "Numbered List",
280
282
  paragraph: "Normal",
281
283
  quote: "Quote"
282
- }, ln = (t) => t in on ? t : null, rn = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
284
+ }, sn = (t) => t in rn ? t : null, an = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
283
285
  const o = r.getParent();
284
- return o !== null && Lt(o);
285
- })) ?? t.getTopLevelElementOrThrow(), sn = (t) => {
286
- const e = rn(t);
287
- if (we(e))
286
+ return o !== null && St(o);
287
+ })) ?? t.getTopLevelElementOrThrow(), cn = (t) => {
288
+ const e = an(t);
289
+ if (Ne(e))
288
290
  return e.getListType();
289
- const r = Z(t, (l) => we(l));
290
- if (r !== null && we(r))
291
+ const r = Z(t, (l) => Ne(l));
292
+ if (r !== null && Ne(r))
291
293
  return r.getListType();
292
- const o = jt(e) ? e.getTag() : e.getType();
293
- return ln(o);
294
+ const o = Kt(e) ? e.getTag() : e.getType();
295
+ return sn(o);
294
296
  };
295
- function an(t) {
297
+ function dn(t) {
296
298
  const {
297
299
  hasSelection: e,
298
300
  isRangeSelection: r,
299
301
  isCollapsed: o,
300
302
  hasNativeSelection: l,
301
- hasNativeRange: m,
303
+ hasNativeRange: u,
302
304
  isAnchorInsideEditor: L,
303
- isEditorEditable: u
305
+ isEditorEditable: h
304
306
  } = t;
305
- return e && r && !o && l && m && L && u;
307
+ return e && r && !o && l && u && L && h;
306
308
  }
307
- const cn = -4;
308
- function dn({
309
+ const fn = -4;
310
+ function mn({
309
311
  editor: t,
310
312
  anchorElem: e,
311
313
  isToolbarActive: r,
312
314
  setIsToolbarActive: o
313
315
  }) {
314
- const l = oe(null), [m, L] = B("paragraph"), [u, a] = B(!1), [p, E] = B(!1), [b, h] = B(!1), [C, R] = B(!1), c = oe(() => {
316
+ const l = ie(null), [u, L] = A("paragraph"), [h, a] = A(!1), [p, E] = A(!1), [b, d] = A(!1), [C, R] = A(!1), c = ie(() => {
315
317
  }), w = (i) => {
316
318
  t.update(() => {
317
319
  const s = ee();
318
320
  if (Q(s)) {
319
- if (m === i) {
321
+ if (u === i) {
320
322
  _e(s, Fe);
321
323
  return;
322
324
  }
323
- _e(s, () => Kt(i));
325
+ _e(s, () => Wt(i));
324
326
  }
325
327
  });
326
328
  }, v = (i) => {
327
- if (m === i) {
328
- t.dispatchCommand(Ot, void 0);
329
+ if (u === i) {
330
+ t.dispatchCommand(Ut, void 0);
329
331
  return;
330
332
  }
331
333
  const s = {
332
- bullet: Ft,
333
- number: Ht,
334
- check: Ut
334
+ bullet: jt,
335
+ number: Ft,
336
+ check: Ht
335
337
  }[i];
336
338
  t.dispatchCommand(s, void 0);
337
339
  }, S = () => {
338
340
  t.update(() => {
339
341
  const i = ee();
340
342
  if (Q(i)) {
341
- if (m === "code") {
343
+ if (u === "code") {
342
344
  _e(i, Fe);
343
345
  return;
344
346
  }
345
- _e(i, () => $t());
347
+ _e(i, () => zt());
346
348
  }
347
349
  });
348
350
  }, g = () => {
349
351
  if (C) {
350
- t.dispatchCommand(ze, null);
352
+ t.dispatchCommand(De, null);
351
353
  return;
352
354
  }
353
- t.dispatchCommand(Ke, !0);
354
- }, d = () => {
355
+ t.dispatchCommand(st, !0);
356
+ }, f = () => {
355
357
  const i = ee();
356
358
  if (!Q(i)) return;
357
- a(i.hasFormat("bold")), E(i.hasFormat("italic")), h(i.hasFormat("underline"));
358
- const s = he(i), f = Z(s, le), y = Z(s, pe);
359
- R(f !== null || y !== null);
360
- const x = sn(i.anchor.getNode());
359
+ a(i.hasFormat("bold")), E(i.hasFormat("italic")), d(i.hasFormat("underline"));
360
+ const s = ge(i), m = Z(s, re), y = Z(s, pe);
361
+ R(m !== null || y !== null);
362
+ const x = cn(i.anchor.getNode());
361
363
  x && L(x);
362
364
  };
363
365
  return c.current = () => {
364
- const i = ee(), s = l.current, f = window.getSelection();
366
+ const i = ee(), s = l.current, m = window.getSelection();
365
367
  if (s === null)
366
368
  return;
367
- const y = t.getRootElement(), x = f !== null, T = x && f.rangeCount > 0, _ = !!y?.contains(x ? f.anchorNode : null);
368
- if (an({
369
+ const y = t.getRootElement(), x = m !== null, T = x && m.rangeCount > 0, _ = !!y?.contains(x ? m.anchorNode : null);
370
+ if (dn({
369
371
  hasSelection: i !== null,
370
372
  isRangeSelection: Q(i),
371
373
  isCollapsed: Q(i) ? i.isCollapsed() : !1,
@@ -373,17 +375,17 @@ function dn({
373
375
  hasNativeRange: T,
374
376
  isAnchorInsideEditor: _,
375
377
  isEditorEditable: t.isEditable()
376
- }) && f) {
377
- const k = f.getRangeAt(0).getBoundingClientRect();
378
+ }) && m) {
379
+ const k = m.getRangeAt(0).getBoundingClientRect();
378
380
  if (k) {
379
381
  const N = new DOMRect(k.left, k.bottom, 0, 0);
380
- ke(N, s, e, cn);
382
+ ke(N, s, e, fn);
381
383
  }
382
384
  o(!0);
383
385
  } else
384
386
  y !== null && ke(null, s, e), o(!1);
385
- return d(), !0;
386
- }, q(() => {
387
+ return f(), !0;
388
+ }, Y(() => {
387
389
  const i = e.parentElement, s = () => {
388
390
  t.getEditorState().read(() => {
389
391
  c.current();
@@ -392,27 +394,27 @@ function dn({
392
394
  return window.addEventListener("resize", s), i && i.addEventListener("scroll", s), () => {
393
395
  window.removeEventListener("resize", s), i && i.removeEventListener("scroll", s);
394
396
  };
395
- }, [e, t]), q(() => Le(t.registerUpdateListener(({
397
+ }, [e, t]), Y(() => Le(t.registerUpdateListener(({
396
398
  editorState: i
397
399
  }) => {
398
400
  i.read(() => {
399
401
  c.current();
400
402
  });
401
- }), t.registerCommand(Se, (i) => (c.current(), !1), Oe), t.registerCommand(it, (i) => {
403
+ }), t.registerCommand(Se, (i) => (c.current(), !1), Ue), t.registerCommand(ot, (i) => {
402
404
  const s = ee();
403
405
  return Q(s) && c.current(), !1;
404
- }, lt)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(nn, { editor: t, blockType: m, isBold: u, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: S, insertLink: g }) });
406
+ }, it)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(ln, { editor: t, blockType: u, isBold: h, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: S, insertLink: g }) });
405
407
  }
406
408
  function at(t) {
407
409
  const e = te(7), {
408
410
  anchorElem: r
409
- } = t, o = r === void 0 ? document.body : r, [l] = De(), [m, L] = B(!1);
410
- let u;
411
- e[0] !== o || e[1] !== l || e[2] !== m ? (u = /* @__PURE__ */ n(dn, { editor: l, anchorElem: o, isToolbarActive: m, setIsToolbarActive: L }), e[0] = o, e[1] = l, e[2] = m, e[3] = u) : u = e[3];
411
+ } = t, o = r === void 0 ? document.body : r, [l] = $e(), [u, L] = A(!1);
412
+ let h;
413
+ e[0] !== o || e[1] !== l || e[2] !== u ? (h = /* @__PURE__ */ n(mn, { editor: l, anchorElem: o, isToolbarActive: u, setIsToolbarActive: L }), e[0] = o, e[1] = l, e[2] = u, e[3] = h) : h = e[3];
412
414
  let a;
413
- return e[4] !== o || e[5] !== u ? (a = Ue(u, o), e[4] = o, e[5] = u, e[6] = a) : a = e[6], a;
415
+ return e[4] !== o || e[5] !== h ? (a = He(h, o), e[4] = o, e[5] = h, e[6] = a) : a = e[6], a;
414
416
  }
415
- function fn() {
417
+ function un() {
416
418
  const t = te(1);
417
419
  let e;
418
420
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("style", { children: `
@@ -451,161 +453,161 @@ function fn() {
451
453
  }
452
454
  ` }), t[0] = e) : e = t[0], e;
453
455
  }
454
- function oo(t) {
456
+ function ro(t) {
455
457
  const e = te(42), {
456
458
  roomId: r,
457
459
  wsUrl: o,
458
460
  wsParams: l,
459
- userName: m,
461
+ userName: u,
460
462
  userColor: L,
461
- placeholder: u
463
+ placeholder: h
462
464
  } = t;
463
465
  let a;
464
466
  e[0] !== l ? (a = l === void 0 ? {} : l, e[0] = l, e[1] = a) : a = e[1];
465
- const p = a, E = m === void 0 ? "Anonymous" : m, b = L === void 0 ? "#30bced" : L, h = oe(null), [C, R] = B(null), [c, w] = B(!1), [v] = B(un);
467
+ const p = a, E = u === void 0 ? "Anonymous" : u, b = L === void 0 ? "#30bced" : L, d = ie(null), [C, R] = A(null), [c, w] = A(!1), [v] = A(pn);
466
468
  let S;
467
469
  e[2] !== v || e[3] !== r || e[4] !== p || e[5] !== o ? (S = () => {
468
- const H = new Et(o, r, v, {
470
+ const j = new Et(o, r, v, {
469
471
  params: p,
470
472
  connect: !1
471
473
  });
472
- return H.on("sync", (G) => {
473
- G && w(!0);
474
- }), H;
474
+ return j.on("sync", (V) => {
475
+ V && w(!0);
476
+ }), j;
475
477
  }, e[2] = v, e[3] = r, e[4] = p, e[5] = o, e[6] = S) : S = e[6];
476
- const [g] = B(S);
477
- let d, i;
478
- e[7] !== g ? (d = () => (g.connect(), () => {
478
+ const [g] = A(S);
479
+ let f, i;
480
+ e[7] !== g ? (f = () => (g.connect(), () => {
479
481
  g.disconnect();
480
- }), i = [g], e[7] = g, e[8] = d, e[9] = i) : (d = e[8], i = e[9]), q(d, i);
481
- let s, f;
482
+ }), i = [g], e[7] = g, e[8] = f, e[9] = i) : (f = e[8], i = e[9]), Y(f, i);
483
+ let s, m;
482
484
  e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
483
- R(h.current);
484
- }, f = [], e[10] = s, e[11] = f) : (s = e[10], f = e[11]), q(s, f);
485
+ R(d.current);
486
+ }, m = [], e[10] = s, e[11] = m) : (s = e[10], m = e[11]), Y(s, m);
485
487
  let y;
486
488
  e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = {
487
489
  namespace: "COLLABORATIVE_EDITOR",
488
- nodes: Ve,
490
+ nodes: We,
489
491
  editorState: null,
490
- onError: mn,
492
+ onError: hn,
491
493
  editable: !0,
492
- theme: We
494
+ theme: Ke
493
495
  }, e[12] = y) : y = e[12];
494
496
  const x = y;
495
497
  let T;
496
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(fn, {}), e[13] = T) : T = e[13];
498
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(un, {}), e[13] = T) : T = e[13];
497
499
  const _ = g;
498
500
  let k;
499
501
  e[14] !== v || e[15] !== r || e[16] !== _ || e[17] !== b || e[18] !== E ? (k = /* @__PURE__ */ n(Ct, { id: r, doc: v, provider: _, __shouldBootstrapUnsafe: !1, username: E, cursorColor: b }), e[14] = v, e[15] = r, e[16] = _, e[17] = b, e[18] = E, e[19] = k) : k = e[19];
500
- let N, I, z, D, W, O;
501
- e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(et, {}), I = /* @__PURE__ */ n(tt, {}), z = /* @__PURE__ */ n(ot, { maxIndent: 7 }), D = /* @__PURE__ */ n(Je, {}), W = /* @__PURE__ */ n(Ge, {}), O = /* @__PURE__ */ n(qe, {}), e[20] = N, e[21] = I, e[22] = z, e[23] = D, e[24] = W, e[25] = O) : (N = e[20], I = e[21], z = e[22], D = e[23], W = e[24], O = e[25]);
502
- let K;
503
- e[26] !== C ? (K = /* @__PURE__ */ n(st, { anchorElem: C }), e[26] = C, e[27] = K) : K = e[27];
504
- let M;
505
- e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ n(Ye, {}), e[28] = M) : M = e[28];
506
- let V;
507
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Xe, { fullWidth: !1 }), e[29] = V) : V = e[29];
508
- let P;
509
- e[30] !== u || e[31] !== c ? (P = c && u ? /* @__PURE__ */ n($e, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: u }) : null, e[30] = u, e[31] = c, e[32] = P) : P = e[32];
510
- let $;
511
- e[33] !== P ? ($ = /* @__PURE__ */ n(nt, { contentEditable: V, placeholder: P, ErrorBoundary: Ze }), e[33] = P, e[34] = $) : $ = e[34];
512
- let A;
513
- e[35] !== C ? (A = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = A) : A = e[36];
502
+ let N, I, M, O, z, $;
503
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(Je, {}), I = /* @__PURE__ */ n(et, {}), M = /* @__PURE__ */ n(nt, { maxIndent: 7 }), O = /* @__PURE__ */ n(Ze, {}), z = /* @__PURE__ */ n(Ge, {}), $ = /* @__PURE__ */ n(Ve, {}), e[20] = N, e[21] = I, e[22] = M, e[23] = O, e[24] = z, e[25] = $) : (N = e[20], I = e[21], M = e[22], O = e[23], z = e[24], $ = e[25]);
504
+ let G;
505
+ e[26] !== C ? (G = /* @__PURE__ */ n(rt, { anchorElem: C }), e[26] = C, e[27] = G) : G = e[27];
514
506
  let U;
515
- return e[37] !== k || e[38] !== K || e[39] !== $ || e[40] !== A ? (U = /* @__PURE__ */ ie(Ae, { ref: h, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
507
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ n(qe, {}), e[28] = U) : U = e[28];
508
+ let H;
509
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(Ye, { fullWidth: !1 }), e[29] = H) : H = e[29];
510
+ let B;
511
+ e[30] !== h || e[31] !== c ? (B = c && h ? /* @__PURE__ */ n(ze, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: h }) : null, e[30] = h, e[31] = c, e[32] = B) : B = e[32];
512
+ let D;
513
+ e[33] !== B ? (D = /* @__PURE__ */ n(tt, { contentEditable: H, placeholder: B, ErrorBoundary: Qe }), e[33] = B, e[34] = D) : D = e[34];
514
+ let P;
515
+ e[35] !== C ? (P = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = P) : P = e[36];
516
+ let F;
517
+ return e[37] !== k || e[38] !== G || e[39] !== D || e[40] !== P ? (F = /* @__PURE__ */ le(Me, { ref: d, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
516
518
  T,
517
- /* @__PURE__ */ n(Qe, { initialConfig: x, children: /* @__PURE__ */ ie(vt, { children: [
519
+ /* @__PURE__ */ n(Xe, { initialConfig: x, children: /* @__PURE__ */ le(vt, { children: [
518
520
  k,
519
521
  N,
520
522
  I,
521
- z,
522
- D,
523
- W,
524
- O,
525
- K,
526
523
  M,
524
+ O,
525
+ z,
527
526
  $,
528
- A
527
+ G,
528
+ U,
529
+ D,
530
+ P
529
531
  ] }) })
530
- ] }), e[37] = k, e[38] = K, e[39] = $, e[40] = A, e[41] = U) : U = e[41], U;
532
+ ] }), e[37] = k, e[38] = G, e[39] = D, e[40] = P, e[41] = F) : F = e[41], F;
531
533
  }
532
- function mn(t) {
534
+ function hn(t) {
533
535
  return console.error(t);
534
536
  }
535
- function un() {
537
+ function pn() {
536
538
  return new kt.Doc();
537
539
  }
538
- function pn(t) {
540
+ function gn(t) {
539
541
  const e = te(32), {
540
542
  isActive: r,
541
543
  isLinkEditMode: o,
542
544
  editedLinkUrl: l,
543
- editedLinkUrlIsValid: m,
545
+ editedLinkUrlIsValid: u,
544
546
  linkUrl: L,
545
- href: u,
547
+ href: h,
546
548
  inputRef: a,
547
549
  onEditedLinkUrlChange: p,
548
550
  onInputKeyDown: E,
549
551
  onClose: b,
550
- onSubmit: h,
552
+ onSubmit: d,
551
553
  onEdit: C,
552
554
  onRemove: R
553
555
  } = t;
554
556
  if (!r)
555
557
  return null;
556
558
  if (o) {
557
- const i = !m;
559
+ const i = !u;
558
560
  let s;
559
561
  e[0] !== p ? (s = (I) => {
560
562
  p(I.target.value);
561
563
  }, e[0] = p, e[1] = s) : s = e[1];
562
- let f;
563
- e[2] !== l || e[3] !== a || e[4] !== E || e[5] !== i || e[6] !== s ? (f = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: E }), e[2] = l, e[3] = a, e[4] = E, e[5] = i, e[6] = s, e[7] = f) : f = e[7];
564
+ let m;
565
+ e[2] !== l || e[3] !== a || e[4] !== E || e[5] !== i || e[6] !== s ? (m = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: E }), e[2] = l, e[3] = a, e[4] = E, e[5] = i, e[6] = s, e[7] = m) : m = e[7];
564
566
  let y;
565
567
  e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(Bt, { size: 14 }), e[8] = y) : y = e[8];
566
568
  let x;
567
- e[9] !== b ? (x = /* @__PURE__ */ n(j, { content: "Cancel", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: Ee, onClick: b, children: y }) }), e[9] = b, e[10] = x) : x = e[10];
568
- const T = !m;
569
+ e[9] !== b ? (x = /* @__PURE__ */ n(W, { content: "Cancel", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: Ee, onClick: b, children: y }) }), e[9] = b, e[10] = x) : x = e[10];
570
+ const T = !u;
569
571
  let _;
570
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(rt, { size: 14 }), e[11] = _) : _ = e[11];
572
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(lt, { size: 14 }), e[11] = _) : _ = e[11];
571
573
  let k;
572
- e[12] !== h || e[13] !== T ? (k = /* @__PURE__ */ n(j, { content: "Confirm", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: Ee, onClick: h, children: _ }) }), e[12] = h, e[13] = T, e[14] = k) : k = e[14];
574
+ e[12] !== d || e[13] !== T ? (k = /* @__PURE__ */ n(W, { content: "Confirm", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: Ee, onClick: d, children: _ }) }), e[12] = d, e[13] = T, e[14] = k) : k = e[14];
573
575
  let N;
574
- return e[15] !== f || e[16] !== x || e[17] !== k ? (N = /* @__PURE__ */ ie(Pe, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
575
- f,
576
+ return e[15] !== m || e[16] !== x || e[17] !== k ? (N = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
577
+ m,
576
578
  x,
577
579
  k
578
- ] }), e[15] = f, e[16] = x, e[17] = k, e[18] = N) : N = e[18], N;
580
+ ] }), e[15] = m, e[16] = x, e[17] = k, e[18] = N) : N = e[18], N;
579
581
  }
580
582
  let c;
581
- e[19] !== u || e[20] !== L ? (c = /* @__PURE__ */ n(bt, { href: u, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: L }), e[19] = u, e[20] = L, e[21] = c) : c = e[21];
583
+ e[19] !== h || e[20] !== L ? (c = /* @__PURE__ */ n(bt, { href: h, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: L }), e[19] = h, e[20] = L, e[21] = c) : c = e[21];
582
584
  let w;
583
- e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(zt, { size: 14 }), e[22] = w) : w = e[22];
585
+ e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(Dt, { size: 14 }), e[22] = w) : w = e[22];
584
586
  let v;
585
- e[23] !== C ? (v = /* @__PURE__ */ n(j, { content: "Edit link", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: Ee, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
587
+ e[23] !== C ? (v = /* @__PURE__ */ n(W, { content: "Edit link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: Ee, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
586
588
  let S;
587
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(Mt, { size: 14 }), e[25] = S) : S = e[25];
589
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(Ot, { size: 14 }), e[25] = S) : S = e[25];
588
590
  let g;
589
- e[26] !== R ? (g = /* @__PURE__ */ n(j, { content: "Remove link", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: Ee, onClick: R, children: S }) }), e[26] = R, e[27] = g) : g = e[27];
590
- let d;
591
- return e[28] !== c || e[29] !== v || e[30] !== g ? (d = /* @__PURE__ */ ie(Pe, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
591
+ e[26] !== R ? (g = /* @__PURE__ */ n(W, { content: "Remove link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: Ee, onClick: R, children: S }) }), e[26] = R, e[27] = g) : g = e[27];
592
+ let f;
593
+ return e[28] !== c || e[29] !== v || e[30] !== g ? (f = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
592
594
  c,
593
595
  v,
594
596
  g
595
- ] }), e[28] = c, e[29] = v, e[30] = g, e[31] = d) : d = e[31], d;
597
+ ] }), e[28] = c, e[29] = v, e[30] = g, e[31] = f) : f = e[31], f;
596
598
  }
597
599
  function Ee(t) {
598
600
  t.preventDefault();
599
601
  }
600
- function hn(t, e, r) {
602
+ function bn(t, e, r) {
601
603
  return t && e && r === "";
602
604
  }
603
- function gn(t) {
604
- const e = he(t), r = Z(e, le);
605
- return r ? r.getURL() : le(e) ? e.getURL() : "";
605
+ function vn(t) {
606
+ const e = ge(t), r = Z(e, re);
607
+ return r ? r.getURL() : re(e) ? e.getURL() : "";
606
608
  }
607
609
  const ct = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
608
- function Me(t) {
610
+ function Oe(t) {
609
611
  try {
610
612
  const e = new URL(t);
611
613
  if (!ct.has(e.protocol))
@@ -623,47 +625,47 @@ function dt(t) {
623
625
  return !1;
624
626
  }
625
627
  }
626
- const bn = 8;
627
- function vn({
628
+ const Cn = 8;
629
+ function _n({
628
630
  editor: t,
629
631
  isLink: e,
630
632
  setIsLink: r,
631
633
  anchorElem: o,
632
634
  isLinkEditMode: l,
633
- setIsLinkEditMode: m
635
+ setIsLinkEditMode: u
634
636
  }) {
635
- const L = oe(null), u = oe(null), a = oe(() => {
636
- }), [p, E] = B(""), [b, h] = B("https://"), [C, R] = B(null), c = e || l, w = dt(b);
637
+ const L = ie(null), h = ie(null), a = ie(() => {
638
+ }), [p, E] = A(""), [b, d] = A("https://"), [C, R] = A(null), c = e || l, w = dt(b);
637
639
  a.current = () => {
638
- const d = ee();
639
- if (Q(d)) {
640
- const T = gn(d);
641
- E(T), hn(l, e, T) && S(), l && T !== "" && h(T);
640
+ const f = ee();
641
+ if (Q(f)) {
642
+ const T = vn(f);
643
+ E(T), bn(l, e, T) && S(), l && T !== "" && d(T);
642
644
  }
643
- const i = L.current, s = window.getSelection(), f = document.activeElement;
645
+ const i = L.current, s = window.getSelection(), m = document.activeElement;
644
646
  if (i === null)
645
647
  return;
646
648
  const y = t.getRootElement(), x = s !== null && s.rangeCount > 0;
647
- if (d !== null && s !== null && x && y?.contains(s.anchorNode) && t.isEditable()) {
649
+ if (f !== null && s !== null && x && y?.contains(s.anchorNode) && t.isEditable()) {
648
650
  const T = s.getRangeAt(0).getBoundingClientRect(), _ = new DOMRect(T.left, T.top, 0, T.height);
649
- ke(_, i, o, bn, void 0, "above"), R(d);
650
- } else i.contains(f) || (y !== null && ke(null, i, o), R(null), m(!1), E(""));
651
- }, q(() => {
652
- const d = o.parentElement, i = () => {
651
+ ke(_, i, o, Cn, void 0, "above"), R(f);
652
+ } else i.contains(m) || (y !== null && ke(null, i, o), R(null), u(!1), E(""));
653
+ }, Y(() => {
654
+ const f = o.parentElement, i = () => {
653
655
  t.getEditorState().read(() => {
654
656
  a.current();
655
657
  });
656
658
  };
657
- return window.addEventListener("resize", i), d && d.addEventListener("scroll", i), () => {
658
- window.removeEventListener("resize", i), d && d.removeEventListener("scroll", i);
659
+ return window.addEventListener("resize", i), f && f.addEventListener("scroll", i), () => {
660
+ window.removeEventListener("resize", i), f && f.removeEventListener("scroll", i);
659
661
  };
660
- }, [o.parentElement, t]), q(() => Le(t.registerUpdateListener(({
661
- editorState: d
662
+ }, [o.parentElement, t]), Y(() => Le(t.registerUpdateListener(({
663
+ editorState: f
662
664
  }) => {
663
- d.read(() => {
665
+ f.read(() => {
664
666
  a.current();
665
667
  });
666
- }), t.registerCommand(Se, () => (a.current(), !0), Be), t.registerCommand(St, () => e ? (r(!1), !0) : !1, lt)), [t, r, e]), q(() => {
668
+ }), t.registerCommand(Se, () => (a.current(), !0), Be), t.registerCommand(yt, () => e ? (r(!1), !0) : !1, it)), [t, r, e]), Y(() => {
667
669
  t.getEditorState().read(() => {
668
670
  a.current();
669
671
  });
@@ -671,22 +673,22 @@ function vn({
671
673
  c && t.getEditorState().read(() => {
672
674
  a.current();
673
675
  });
674
- }, [t, c]), q(() => {
675
- l && u.current && u.current.focus();
676
+ }, [t, c]), Y(() => {
677
+ l && h.current && h.current.focus();
676
678
  }, [l]);
677
- const v = (d) => {
678
- d.key === "Enter" ? (d.preventDefault(), g()) : d.key === "Escape" && (d.preventDefault(), S());
679
+ const v = (f) => {
680
+ f.key === "Enter" ? (f.preventDefault(), g()) : f.key === "Escape" && (f.preventDefault(), S());
679
681
  }, S = () => {
680
- h("https://"), m(!1);
682
+ d("https://"), u(!1);
681
683
  }, g = () => {
682
684
  C === null || !w || (t.update(() => {
683
- xt(C);
684
- }), t.dispatchCommand(ze, Me(b)), t.update(() => {
685
- const d = ee();
686
- if (Q(d)) {
687
- const i = he(d).getParent();
685
+ Tt(C);
686
+ }), t.dispatchCommand(De, Oe(b)), t.update(() => {
687
+ const f = ee();
688
+ if (Q(f)) {
689
+ const i = ge(f).getParent();
688
690
  if (pe(i)) {
689
- const s = Dt(i.getURL(), {
691
+ const s = $t(i.getURL(), {
690
692
  rel: i.__rel,
691
693
  target: i.__target,
692
694
  title: i.__title
@@ -696,27 +698,27 @@ function vn({
696
698
  }
697
699
  }), S());
698
700
  };
699
- return /* @__PURE__ */ n($e, { ref: L, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(pn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: Me(p), inputRef: u, onEditedLinkUrlChange: h, onInputKeyDown: v, onClose: S, onSubmit: g, onEdit: () => {
700
- h(p), m(!0);
701
+ return /* @__PURE__ */ n(ze, { ref: L, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(gn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: Oe(p), inputRef: h, onEditedLinkUrlChange: d, onInputKeyDown: v, onClose: S, onSubmit: g, onEdit: () => {
702
+ d(p), u(!0);
701
703
  }, onRemove: () => {
702
- t.dispatchCommand(ze, null);
704
+ t.dispatchCommand(De, null);
703
705
  } }) });
704
706
  }
705
- function Cn(t, e, r, o) {
706
- const l = te(13), [m, L] = B(t), [u, a] = B(!1);
707
+ function En(t, e, r, o) {
708
+ const l = te(13), [u, L] = A(t), [h, a] = A(!1);
707
709
  let p, E;
708
710
  l[0] !== t || l[1] !== o ? (p = () => {
709
711
  const C = function() {
710
712
  const c = ee();
711
713
  if (Q(c)) {
712
- const w = he(c), v = Z(w, le), S = Z(w, pe);
714
+ const w = ge(c), v = Z(w, re), S = Z(w, pe);
713
715
  if (!(v || S)) {
714
716
  a(!1);
715
717
  return;
716
718
  }
717
- const g = c.getNodes().filter(En).find((d) => {
718
- const i = Z(d, le), s = Z(d, pe), f = pe(s) && s.getIsUnlinked();
719
- return v && !v.is(i) || i && !i.is(v) || S && !S.is(s) || s && (!s.is(S) || f);
719
+ const g = c.getNodes().filter(Ln).find((f) => {
720
+ const i = Z(f, re), s = Z(f, pe), m = pe(s) && s.getIsUnlinked();
721
+ return v && !v.is(i) || i && !i.is(v) || S && !S.is(s) || s && (!s.is(S) || m);
720
722
  });
721
723
  a(!g);
722
724
  }
@@ -728,132 +730,137 @@ function Cn(t, e, r, o) {
728
730
  c.read(() => {
729
731
  C();
730
732
  });
731
- }), t.registerCommand(Se, (R, c) => (C(), L(c), !1), Oe), t.registerCommand(it, _n, Be), t.registerCommand(Ke, (R) => (o(R), !0), Be));
732
- }, E = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = E) : (p = l[2], E = l[3]), q(p, E);
733
+ }), t.registerCommand(Se, (R, c) => (C(), L(c), !1), Ue), t.registerCommand(ot, kn, Be), t.registerCommand(st, (R) => (o(R), !0), Be));
734
+ }, E = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = E) : (p = l[2], E = l[3]), Y(p, E);
733
735
  let b;
734
- l[4] !== m || l[5] !== e || l[6] !== u || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(vn, { editor: m, isLink: u, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = m, l[5] = e, l[6] = u, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
735
- let h;
736
- return l[10] !== e || l[11] !== b ? (h = Ue(b, e), l[10] = e, l[11] = b, l[12] = h) : h = l[12], h;
736
+ l[4] !== u || l[5] !== e || l[6] !== h || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(_n, { editor: u, isLink: h, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = u, l[5] = e, l[6] = h, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
737
+ let d;
738
+ return l[10] !== e || l[11] !== b ? (d = He(b, e), l[10] = e, l[11] = b, l[12] = d) : d = l[12], d;
737
739
  }
738
- function _n(t) {
740
+ function kn(t) {
739
741
  const e = ee();
740
742
  if (Q(e)) {
741
- const r = he(e), o = Z(r, le);
742
- if (le(o) && (t.metaKey || t.ctrlKey))
743
- return window.open(Me(o.getURL()), "_blank", "noopener,noreferrer"), !0;
743
+ const r = ge(e), o = Z(r, re);
744
+ if (re(o) && (t.metaKey || t.ctrlKey))
745
+ return window.open(Oe(o.getURL()), "_blank", "noopener,noreferrer"), !0;
744
746
  }
745
747
  return !1;
746
748
  }
747
- function En(t) {
748
- return !yt(t);
749
+ function Ln(t) {
750
+ return !xt(t);
749
751
  }
750
- function kn(t) {
752
+ function Sn(t) {
751
753
  const {
752
754
  anchorElem: e
753
- } = t, r = e === void 0 ? document.body : e, [o, l] = B(!1), [m] = De();
754
- return Cn(m, r, o, l);
755
+ } = t, r = e === void 0 ? document.body : e, [o, l] = A(!1), [u] = $e();
756
+ return En(u, r, o, l);
755
757
  }
756
- function Ln() {
758
+ function yn() {
757
759
  const t = te(1);
758
760
  let e;
759
- return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(et, { validateUrl: dt }), t[0] = e) : e = t[0], e;
761
+ return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(Je, { validateUrl: dt }), t[0] = e) : e = t[0], e;
760
762
  }
761
- function io(t) {
762
- const e = te(54), {
763
+ function so(t) {
764
+ const e = te(57), {
763
765
  autoFocus: r,
764
766
  debug: o,
765
767
  defaultState: l,
766
- isEditable: m,
768
+ isEditable: u,
767
769
  placeholder: L,
768
- scrollable: u,
770
+ scrollable: h,
769
771
  onChange: a
770
- } = t, p = r === void 0 ? !1 : r, E = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, h = m === void 0 ? !1 : m, C = u === void 0 ? !0 : u;
772
+ } = t, p = r === void 0 ? !1 : r, E = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, d = u === void 0 ? !1 : u, C = h === void 0 ? !0 : h;
771
773
  let R;
772
774
  e[0] !== b ? (R = mt(b), e[0] = b, e[1] = R) : R = e[1];
773
775
  const {
774
776
  frontmatter: c,
775
777
  body: w
776
- } = R, v = h && !!a, S = oe(null), [g, d] = B(null);
778
+ } = R, v = d && !!a, S = ie(null), [g, f] = A(null);
777
779
  let i, s;
778
780
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
779
- d(S.current);
780
- }, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), q(i, s);
781
- let f;
782
- e[4] !== w ? (f = () => Wt(ut(w), He, void 0, !1), e[4] = w, e[5] = f) : f = e[5];
781
+ f(S.current);
782
+ }, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), Y(i, s);
783
+ let m;
784
+ e[4] !== w ? (m = () => Gt(ut(w), Te, void 0, !1), e[4] = w, e[5] = m) : m = e[5];
783
785
  let y;
784
- e[6] !== h || e[7] !== f ? (y = {
786
+ e[6] !== d || e[7] !== m ? (y = {
785
787
  namespace: "MARKDOWN_EDITOR",
786
- nodes: Ve,
787
- editorState: f,
788
- onError: Sn,
789
- editable: h,
790
- theme: We
791
- }, e[6] = h, e[7] = f, e[8] = y) : y = e[8];
788
+ nodes: We,
789
+ editorState: m,
790
+ onError: xn,
791
+ editable: d,
792
+ theme: Ke
793
+ }, e[6] = d, e[7] = m, e[8] = y) : y = e[8];
792
794
  const x = y, T = C ? "100%" : "auto";
793
795
  let _;
794
- e[9] !== p ? (_ = p ? /* @__PURE__ */ n(Gt, {}) : null, e[9] = p, e[10] = _) : _ = e[10];
796
+ e[9] !== p ? (_ = p ? /* @__PURE__ */ n(qt, {}) : null, e[9] = p, e[10] = _) : _ = e[10];
795
797
  let k, N, I;
796
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n(Yt, {}), N = /* @__PURE__ */ n(Ln, {}), I = /* @__PURE__ */ n(tt, {}), e[11] = k, e[12] = N, e[13] = I) : (k = e[11], N = e[12], I = e[13]);
797
- let z;
798
- e[14] !== h ? (z = h ? /* @__PURE__ */ n(ot, { maxIndent: 7 }) : null, e[14] = h, e[15] = z) : z = e[15];
799
- let D, W, O, K;
800
- e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ n(qt, {}), W = /* @__PURE__ */ n(Je, {}), O = /* @__PURE__ */ n(Ge, {}), K = /* @__PURE__ */ n(qe, {}), e[16] = D, e[17] = W, e[18] = O, e[19] = K) : (D = e[16], W = e[17], O = e[18], K = e[19]);
798
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n(Xt, {}), N = /* @__PURE__ */ n(yn, {}), I = /* @__PURE__ */ n(et, {}), e[11] = k, e[12] = N, e[13] = I) : (k = e[11], N = e[12], I = e[13]);
801
799
  let M;
802
- e[20] !== g ? (M = /* @__PURE__ */ n(st, { anchorElem: g }), e[20] = g, e[21] = M) : M = e[21];
803
- let V;
804
- e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Ye, {}), e[22] = V) : V = e[22];
800
+ e[14] !== d ? (M = d ? /* @__PURE__ */ n(nt, { maxIndent: 7 }) : null, e[14] = d, e[15] = M) : M = e[15];
801
+ let O;
802
+ e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n(Yt, {}), e[16] = O) : O = e[16];
803
+ let z;
804
+ e[17] !== d ? (z = d ? /* @__PURE__ */ n(Qt, { transformers: Te }) : null, e[17] = d, e[18] = z) : z = e[18];
805
+ let $, G, U;
806
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ n(Ze, {}), G = /* @__PURE__ */ n(Ge, {}), U = /* @__PURE__ */ n(Ve, {}), e[19] = $, e[20] = G, e[21] = U) : ($ = e[19], G = e[20], U = e[21]);
807
+ let H;
808
+ e[22] !== g ? (H = /* @__PURE__ */ n(rt, { anchorElem: g }), e[22] = g, e[23] = H) : H = e[23];
809
+ let B;
810
+ e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n(qe, {}), e[24] = B) : B = e[24];
811
+ let D;
812
+ e[25] !== C ? (D = /* @__PURE__ */ n(Ye, { fullWidth: !1, padding: "sm", scrollable: C }), e[25] = C, e[26] = D) : D = e[26];
805
813
  let P;
806
- e[23] !== C ? (P = /* @__PURE__ */ n(Xe, { fullWidth: !1, padding: "sm", scrollable: C }), e[23] = C, e[24] = P) : P = e[24];
807
- let $;
808
- e[25] !== L ? ($ = L ? /* @__PURE__ */ n(Ae, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n($e, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: L }) }) : null, e[25] = L, e[26] = $) : $ = e[26];
809
- let A;
810
- e[27] !== P || e[28] !== $ ? (A = /* @__PURE__ */ n(nt, { contentEditable: P, placeholder: $, ErrorBoundary: Ze }), e[27] = P, e[28] = $, e[29] = A) : A = e[29];
811
- let U;
812
- e[30] !== g || e[31] !== h ? (U = h && g ? /* @__PURE__ */ ie(ft, { children: [
814
+ e[27] !== L ? (P = L ? /* @__PURE__ */ n(Me, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n(ze, { width: "100%", maxWidth: "45rem", color: "fg.muted", textStyle: "paragraph/M/regular", children: L }) }) : null, e[27] = L, e[28] = P) : P = e[28];
815
+ let F;
816
+ e[29] !== D || e[30] !== P ? (F = /* @__PURE__ */ n(tt, { contentEditable: D, placeholder: P, ErrorBoundary: Qe }), e[29] = D, e[30] = P, e[31] = F) : F = e[31];
817
+ let j;
818
+ e[32] !== g || e[33] !== d ? (j = d && g ? /* @__PURE__ */ le(ft, { children: [
813
819
  /* @__PURE__ */ n(at, { anchorElem: g }),
814
- /* @__PURE__ */ n(kn, { anchorElem: g })
815
- ] }) : null, e[30] = g, e[31] = h, e[32] = U) : U = e[32];
816
- let H;
817
- e[33] !== c || e[34] !== a || e[35] !== v ? (H = v ? /* @__PURE__ */ n(Xt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (re) => {
818
- re.read(() => {
819
- const ue = Tt(), ne = Vt(He, ue);
820
- a?.(c + ne);
820
+ /* @__PURE__ */ n(Sn, { anchorElem: g })
821
+ ] }) : null, e[32] = g, e[33] = d, e[34] = j) : j = e[34];
822
+ let V;
823
+ e[35] !== c || e[36] !== a || e[37] !== v ? (V = v ? /* @__PURE__ */ n(Zt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (he) => {
824
+ he.read(() => {
825
+ const oe = Rt(), se = Vt(Te, oe);
826
+ a?.(c + se);
821
827
  });
822
- } }) : null, e[33] = c, e[34] = a, e[35] = v, e[36] = H) : H = e[36];
823
- let G;
824
- e[37] !== h ? (G = /* @__PURE__ */ n(pt, { isEditable: h }), e[37] = h, e[38] = G) : G = e[38];
828
+ } }) : null, e[35] = c, e[36] = a, e[37] = v, e[38] = V) : V = e[38];
825
829
  let J;
826
- e[39] !== E ? (J = E && /* @__PURE__ */ n(ht, {}), e[39] = E, e[40] = J) : J = e[40];
827
- let Y;
828
- e[41] !== x || e[42] !== _ || e[43] !== z || e[44] !== M || e[45] !== A || e[46] !== U || e[47] !== H || e[48] !== G || e[49] !== J ? (Y = /* @__PURE__ */ ie(Qe, { initialConfig: x, children: [
830
+ e[39] !== d ? (J = /* @__PURE__ */ n(ht, { isEditable: d }), e[39] = d, e[40] = J) : J = e[40];
831
+ let X;
832
+ e[41] !== E ? (X = E && /* @__PURE__ */ n(pt, {}), e[41] = E, e[42] = X) : X = e[42];
833
+ let q;
834
+ e[43] !== x || e[44] !== _ || e[45] !== M || e[46] !== z || e[47] !== H || e[48] !== F || e[49] !== j || e[50] !== V || e[51] !== J || e[52] !== X ? (q = /* @__PURE__ */ le(Xe, { initialConfig: x, children: [
829
835
  _,
830
836
  k,
831
837
  N,
832
838
  I,
833
- z,
834
- D,
835
- W,
836
- O,
837
- K,
838
839
  M,
839
- V,
840
- A,
840
+ O,
841
+ z,
842
+ $,
843
+ G,
841
844
  U,
842
845
  H,
843
- G,
844
- J
845
- ] }), e[41] = x, e[42] = _, e[43] = z, e[44] = M, e[45] = A, e[46] = U, e[47] = H, e[48] = G, e[49] = J, e[50] = Y) : Y = e[50];
846
- let X;
847
- return e[51] !== T || e[52] !== Y ? (X = /* @__PURE__ */ n(Ae, { ref: S, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: Y }), e[51] = T, e[52] = Y, e[53] = X) : X = e[53], X;
846
+ B,
847
+ F,
848
+ j,
849
+ V,
850
+ J,
851
+ X
852
+ ] }), e[43] = x, e[44] = _, e[45] = M, e[46] = z, e[47] = H, e[48] = F, e[49] = j, e[50] = V, e[51] = J, e[52] = X, e[53] = q) : q = e[53];
853
+ let ne;
854
+ return e[54] !== T || e[55] !== q ? (ne = /* @__PURE__ */ n(Me, { ref: S, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: q }), e[54] = T, e[55] = q, e[56] = ne) : ne = e[56], ne;
848
855
  }
849
- function Sn(t) {
856
+ function xn(t) {
850
857
  return console.error(t);
851
858
  }
852
- function lo(t) {
859
+ function ao(t) {
853
860
  const e = t.toLowerCase().trim();
854
861
  return e ? e.startsWith("image/") ? "image" : e === "application/pdf" ? "pdf" : e === "text/markdown" ? "markdown" : e === "text/csv" || e === "text/tab-separated-values" ? "table" : e === "application/json" ? "json" : (e.startsWith("text/") || e.startsWith("application/"), "text") : "text";
855
862
  }
856
- const yn = {
863
+ const Tn = {
857
864
  csv: "text/csv",
858
865
  tsv: "text/tab-separated-values",
859
866
  json: "application/json",
@@ -877,21 +884,21 @@ const yn = {
877
884
  yml: "text/yaml",
878
885
  yaml: "text/yaml"
879
886
  };
880
- function ro(t) {
887
+ function co(t) {
881
888
  const r = (t.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
882
- return r ? yn[r] ?? null : null;
889
+ return r ? Tn[r] ?? null : null;
883
890
  }
884
891
  export {
885
- oo as CollaborativeMarkdownEditor,
886
- co as DefaultRichTextCodeEditor,
887
- fo as DefaultRichTextDataTable,
888
- io as MarkdownEditor,
889
- mo as MarkdownPreview,
890
- uo as PromptEditor,
891
- po as RichMessage,
892
- ho as generateEditorStateFromString,
893
- go as getTextFromSerializedEditorState,
894
- lo as inferResourceTypeFromMediaType,
895
- ro as mediaTypeFromPath
892
+ ro as CollaborativeMarkdownEditor,
893
+ uo as DefaultRichTextCodeEditor,
894
+ ho as DefaultRichTextDataTable,
895
+ so as MarkdownEditor,
896
+ po as MarkdownPreview,
897
+ go as PromptEditor,
898
+ bo as RichMessage,
899
+ vo as generateEditorStateFromString,
900
+ Co as getTextFromSerializedEditorState,
901
+ ao as inferResourceTypeFromMediaType,
902
+ co as mediaTypeFromPath
896
903
  };
897
904
  //# sourceMappingURL=rich-text.js.map