ct-rich-text-editor 1.3.21 → 1.3.23

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 (228) hide show
  1. package/README.md +233 -233
  2. package/dist/App.d.ts +3 -2
  3. package/dist/Provider/EditorProvider.d.ts +27 -26
  4. package/dist/Provider/LexicalProvider.d.ts +6 -5
  5. package/dist/api/ai/index.d.ts +31 -31
  6. package/dist/api/auth.d.ts +108 -108
  7. package/dist/api/config/axios.d.ts +2 -1
  8. package/dist/api/config/endpoints.d.ts +18 -18
  9. package/dist/api/featureSuggestion.d.ts +23 -23
  10. package/dist/api/transcript/index.d.ts +1 -1
  11. package/dist/assets/style.css +5211 -5194
  12. package/dist/{babel-d3085146.js → babel-d155920e.js} +3278 -3551
  13. package/dist/babel-d155920e.js.map +1 -0
  14. package/dist/components/AiPlugin/index.d.ts +6 -6
  15. package/dist/components/AlignMenu/AlignMenu.d.ts +9 -8
  16. package/dist/components/AlignMenu/AlignMenuDrop.d.ts +3 -2
  17. package/dist/components/AlignMenu/index.d.ts +1 -1
  18. package/dist/components/AutoExpandingDemo.d.ts +6 -5
  19. package/dist/components/BlockFormatMenu/BlockFormatMenu.d.ts +3 -2
  20. package/dist/components/BlockFormatMenu/constants.d.ts +14 -14
  21. package/dist/components/BlockFormatMenu/index.d.ts +1 -1
  22. package/dist/components/ChartEditDialog.d.ts +9 -8
  23. package/dist/components/ChartInsertDialog.d.ts +8 -7
  24. package/dist/components/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -6
  25. package/dist/components/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -8
  26. package/dist/components/CodeActionMenuPlugin/index.d.ts +5 -4
  27. package/dist/components/CodeActionMenuPlugin/utils.d.ts +1 -1
  28. package/dist/components/ColorPicker/ColorPicker.d.ts +3 -2
  29. package/dist/components/ColorPicker/index.d.ts +1 -1
  30. package/dist/components/CommentSidebar/CommentSidebar.d.ts +8 -7
  31. package/dist/components/CommentSidebar/index.d.ts +1 -1
  32. package/dist/components/CommentToggle/CommentToggle.d.ts +8 -7
  33. package/dist/components/CommentToggle/index.d.ts +1 -1
  34. package/dist/components/CommentView/CommentView.d.ts +9 -8
  35. package/dist/components/CommentView/index.d.ts +1 -1
  36. package/dist/components/ConfigurableEditorWithAuth.d.ts +13 -12
  37. package/dist/components/DatePicker/DatePickerWidget.d.ts +7 -6
  38. package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +3 -2
  39. package/dist/components/EmojiPickerWidget/index.d.ts +1 -1
  40. package/dist/components/FeatureSuggestionDialog/index.d.ts +6 -6
  41. package/dist/components/FileUpload/InsertFileDialog.d.ts +7 -7
  42. package/dist/components/FileUpload/InsertFileUploadedDialogBody.d.ts +5 -4
  43. package/dist/components/FileView/index.d.ts +9 -8
  44. package/dist/components/FontFamilySelect/FontFamilyMenu.d.ts +7 -6
  45. package/dist/components/FontSizePicker/FontSizeControl.d.ts +3 -2
  46. package/dist/components/FormatTextMenu/FormatTextMenu.d.ts +3 -2
  47. package/dist/components/FormatTextMenu/FormatTextMenuDrop.d.ts +3 -2
  48. package/dist/components/FormatTextMenu/index.d.ts +1 -1
  49. package/dist/components/HighlightColorPicker/HighlightColorPicker.d.ts +7 -6
  50. package/dist/components/HtmlViewDisplay.d.ts +3 -2
  51. package/dist/components/ImageComparisonDialog/index.d.ts +11 -10
  52. package/dist/components/ImageGenerationDialog/ImageGenerationManager.d.ts +11 -10
  53. package/dist/components/ImageGenerationDialog/index.d.ts +11 -10
  54. package/dist/components/ImageInsertTest.d.ts +3 -2
  55. package/dist/components/ImageView/ImageDialog/ImageUploadDialogBody.d.ts +9 -8
  56. package/dist/components/ImageView/ImageDialog/index.d.ts +6 -5
  57. package/dist/components/ImageView/ImageResizer.d.ts +16 -15
  58. package/dist/components/ImageView/index.d.ts +16 -15
  59. package/dist/components/InsertMenu/InsertMenu.d.ts +9 -8
  60. package/dist/components/InsertMenu/InsertMenuDrop.d.ts +9 -8
  61. package/dist/components/InsertMenu/index.d.ts +1 -1
  62. package/dist/components/LanguageSelectorDialog/index.d.ts +8 -7
  63. package/dist/components/NotePanelMenu/NotePanelMenu.d.ts +6 -5
  64. package/dist/components/NotePanelMenu/index.d.ts +1 -1
  65. package/dist/components/NotePanelView/NotePanelView.d.ts +9 -8
  66. package/dist/components/NotePanelView/index.d.ts +1 -1
  67. package/dist/components/Placeholder/Placeholder.d.ts +3 -2
  68. package/dist/components/Placeholder/index.d.ts +1 -1
  69. package/dist/components/Placeholder/styles.d.ts +1 -1
  70. package/dist/components/ScopedEditor.d.ts +8 -8
  71. package/dist/components/SignatureCaption/index.d.ts +6 -5
  72. package/dist/components/TableColorPicker/index.d.ts +8 -7
  73. package/dist/components/TableModal/TableModal.d.ts +10 -9
  74. package/dist/components/TextEnhanceDialog/index.d.ts +10 -9
  75. package/dist/components/ToneAdjustDialog/index.d.ts +8 -7
  76. package/dist/components/Toolbar/Toolbar.d.ts +3 -2
  77. package/dist/components/Toolbar/index.d.ts +1 -1
  78. package/dist/components/Toolbar/styles.d.ts +6 -6
  79. package/dist/components/ui/avatar.d.ts +6 -6
  80. package/dist/components/ui/badge.d.ts +9 -8
  81. package/dist/components/ui/button.d.ts +11 -10
  82. package/dist/components/ui/calendar.d.ts +8 -7
  83. package/dist/components/ui/card.d.ts +8 -8
  84. package/dist/components/ui/checkbox.d.ts +4 -4
  85. package/dist/components/ui/dialog.d.ts +19 -19
  86. package/dist/components/ui/dropdown-menu.d.ts +27 -27
  87. package/dist/components/ui/input.d.ts +3 -3
  88. package/dist/components/ui/label.d.ts +4 -4
  89. package/dist/components/ui/popover.d.ts +7 -7
  90. package/dist/components/ui/select.d.ts +13 -13
  91. package/dist/components/ui/separator.d.ts +4 -4
  92. package/dist/components/ui/sheet.d.ts +24 -24
  93. package/dist/components/ui/skeleton.d.ts +3 -3
  94. package/dist/components/ui/tabs.d.ts +7 -7
  95. package/dist/components/ui/textarea.d.ts +3 -3
  96. package/dist/components/ui/tooltip.d.ts +7 -7
  97. package/dist/constants.d.ts +22 -21
  98. package/dist/context/CommentContext.d.ts +43 -42
  99. package/dist/context/HtmlViewContext.d.ts +17 -16
  100. package/dist/context/ToolbarContext.d.ts +56 -55
  101. package/dist/editorConfig.d.ts +48 -48
  102. package/dist/{estree-164983f6.js → estree-b1fff53b.js} +1778 -1763
  103. package/dist/estree-b1fff53b.js.map +1 -0
  104. package/dist/hooks/useAutoExpandingHeight.d.ts +15 -15
  105. package/dist/hooks/useBlockFormat.d.ts +17 -16
  106. package/dist/hooks/useColorPicker.d.ts +6 -6
  107. package/dist/hooks/useCustomCommands.d.ts +3 -2
  108. package/dist/hooks/useDebounce.d.ts +1 -1
  109. package/dist/hooks/useEditorToolbar.d.ts +10 -9
  110. package/dist/hooks/useInsertMenu.d.ts +9 -9
  111. package/dist/hooks/useModal.d.ts +5 -5
  112. package/dist/hooks/useS3Uploader.d.ts +11 -11
  113. package/dist/hooks/useVoiceToText.d.ts +15 -15
  114. package/dist/{html-5586dbf6.js → html-f95ee5dc.js} +656 -701
  115. package/dist/html-f95ee5dc.js.map +1 -0
  116. package/dist/{html2pdf.bundle-0b180070.js → html2pdf.bundle-026397bd.js} +2 -2
  117. package/dist/html2pdf.bundle-026397bd.js.map +1 -0
  118. package/dist/{html2pdf.bundle.min-08b31c1f.js → html2pdf.bundle.min-49ff1939.js} +2 -2
  119. package/dist/html2pdf.bundle.min-49ff1939.js.map +1 -0
  120. package/dist/{index-68135c09.js → index-b8db2529.js} +2 -2
  121. package/dist/index-b8db2529.js.map +1 -0
  122. package/dist/{index-6360d552.js → index-b9ad2974.js} +469 -825
  123. package/dist/index-b9ad2974.js.map +1 -0
  124. package/dist/{index-8bcb5b47.js → index-cea164e5.js} +4 -4
  125. package/dist/index-cea164e5.js.map +1 -0
  126. package/dist/index.d.ts +8 -8
  127. package/dist/index.js +1 -1
  128. package/dist/lib/utils.d.ts +2 -1
  129. package/dist/main.d.ts +1 -0
  130. package/dist/{markdown-d513479b.js → markdown-1d9e6c3f.js} +1789 -1836
  131. package/dist/markdown-1d9e6c3f.js.map +1 -0
  132. package/dist/nodes/ChartNode.d.ts +41 -40
  133. package/dist/nodes/CommentNode.d.ts +34 -33
  134. package/dist/nodes/CommentedTextNode.d.ts +29 -28
  135. package/dist/nodes/EmbedNode.d.ts +26 -25
  136. package/dist/nodes/FileNode.d.ts +32 -31
  137. package/dist/nodes/ImageNode.d.ts +59 -58
  138. package/dist/nodes/MentionNode.d.ts +75 -74
  139. package/dist/nodes/NotePanelNode.d.ts +31 -30
  140. package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +25 -24
  141. package/dist/pages/ConfigurableEditor/index.d.ts +2 -2
  142. package/dist/pages/NotFound.d.ts +2 -2
  143. package/dist/pages/RichTextEditor.d.ts +6 -6
  144. package/dist/pages/TextareaEditor.d.ts +6 -6
  145. package/dist/pages/styles.d.ts +5 -5
  146. package/dist/plugins/AIChatPlugin.d.ts +11 -10
  147. package/dist/plugins/AndroidKeyboardFixPlugin.d.ts +16 -16
  148. package/dist/plugins/AutocompletePlugin.d.ts +22 -22
  149. package/dist/plugins/CodeBlockNormalizerPlugin.d.ts +8 -8
  150. package/dist/plugins/CodeBlockSelectAllPlugin.d.ts +8 -8
  151. package/dist/plugins/CodeHighlightPlugin.d.ts +3 -2
  152. package/dist/plugins/CombinedAutocompletGrammarPlugin.d.ts +21 -20
  153. package/dist/plugins/CommentBubblePlugin.d.ts +3 -2
  154. package/dist/plugins/CommentPlugin.d.ts +7 -6
  155. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +29 -28
  156. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +3 -3
  157. package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +7 -6
  158. package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +3 -3
  159. package/dist/plugins/DragDropPastePlugin/index.d.ts +8 -8
  160. package/dist/plugins/EmbedPreviewPlugin/FloatingEmbedMenuPlugin.d.ts +4 -3
  161. package/dist/plugins/EmbedPreviewPlugin/index.d.ts +6 -5
  162. package/dist/plugins/FilePlugin.d.ts +8 -7
  163. package/dist/plugins/FloatingEnhanceButton/index.d.ts +4 -3
  164. package/dist/plugins/FloatingLinkEditorPlugin/index.d.ts +6 -5
  165. package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +26 -25
  166. package/dist/plugins/GrammarCheckPlugin.d.ts +2 -1
  167. package/dist/plugins/HtmlCodeViewPlugin/index.d.ts +2 -2
  168. package/dist/plugins/HtmlImportPlugin.d.ts +5 -5
  169. package/dist/plugins/HtmlSyncPlugin.d.ts +3 -3
  170. package/dist/plugins/ImagePlugin.d.ts +7 -6
  171. package/dist/plugins/LinkPlugin/index.d.ts +6 -5
  172. package/dist/plugins/LinkPreviewPlugin/index.d.ts +2 -2
  173. package/dist/plugins/LocalStoragePlugin.d.ts +7 -6
  174. package/dist/plugins/MentionsPlugin/index.d.ts +7 -6
  175. package/dist/plugins/NotePanelPlugin.d.ts +7 -6
  176. package/dist/plugins/RichTextPastePlugin/index.d.ts +15 -15
  177. package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasDialog.d.ts +6 -5
  178. package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +9 -9
  179. package/dist/plugins/SignatureCanvasPlugin/index.d.ts +2 -2
  180. package/dist/plugins/SlashCommandPlugin/index.d.ts +2 -2
  181. package/dist/plugins/TableActionMenuPlugin/index.d.ts +6 -5
  182. package/dist/plugins/TableCellResizer/index.d.ts +2 -1
  183. package/dist/plugins/TableHoverActionsPlugin/index.d.ts +4 -4
  184. package/dist/plugins/TablePlugin.d.ts +3 -2
  185. package/dist/plugins/Tableimageautoresizeplugin.d.ts +1 -1
  186. package/dist/plugins/TextEnhancePlugin.d.ts +6 -6
  187. package/dist/plugins/TreeViewPlugin.d.ts +3 -2
  188. package/dist/plugins/UsageTrackingPlugin.d.ts +15 -15
  189. package/dist/plugins/VoiceTranscriptPlugin.d.ts +21 -21
  190. package/dist/plugins/WordCountPlugin.d.ts +3 -2
  191. package/dist/{postcss-f084f74d.js → postcss-c2592f3f.js} +1357 -1378
  192. package/dist/postcss-c2592f3f.js.map +1 -0
  193. package/dist/standalone-bcc7f37a.js +2649 -0
  194. package/dist/standalone-bcc7f37a.js.map +1 -0
  195. package/dist/styles/PlaygroundEditorTheme.d.ts +3 -2
  196. package/dist/types.d.ts +148 -147
  197. package/dist/typescript-48c10f50.js +13601 -0
  198. package/dist/typescript-48c10f50.js.map +1 -0
  199. package/dist/ui/ColorPicker.d.ts +14 -13
  200. package/dist/ui/Icons.d.ts +47 -47
  201. package/dist/ui/TextInput.d.ts +11 -10
  202. package/dist/utils/dateFormats.d.ts +33 -33
  203. package/dist/utils/debounce.d.ts +6 -5
  204. package/dist/utils/editorStyleConverter.d.ts +17 -16
  205. package/dist/utils/export.d.ts +2 -1
  206. package/dist/utils/getDOMRangeRect.d.ts +13 -13
  207. package/dist/utils/getSelectedNode.d.ts +3 -2
  208. package/dist/utils/helper.d.ts +3 -3
  209. package/dist/utils/index.d.ts +4 -3
  210. package/dist/utils/invarient.d.ts +1 -1
  211. package/dist/utils/setFloatingElemPosition.d.ts +8 -8
  212. package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -1
  213. package/dist/utils/url.d.ts +9 -9
  214. package/package.json +127 -127
  215. package/dist/babel-d3085146.js.map +0 -1
  216. package/dist/estree-164983f6.js.map +0 -1
  217. package/dist/html-5586dbf6.js.map +0 -1
  218. package/dist/html2pdf.bundle-0b180070.js.map +0 -1
  219. package/dist/html2pdf.bundle.min-08b31c1f.js.map +0 -1
  220. package/dist/index-6360d552.js.map +0 -1
  221. package/dist/index-68135c09.js.map +0 -1
  222. package/dist/index-8bcb5b47.js.map +0 -1
  223. package/dist/markdown-d513479b.js.map +0 -1
  224. package/dist/postcss-f084f74d.js.map +0 -1
  225. package/dist/standalone-5a8c6b7e.js +0 -2518
  226. package/dist/standalone-5a8c6b7e.js.map +0 -1
  227. package/dist/typescript-b1005db4.js +0 -13705
  228. package/dist/typescript-b1005db4.js.map +0 -1
@@ -24,7 +24,7 @@ import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
24
24
  import { TableNode, TableCellNode, TableRowNode, $createTableNodeWithDimensions, $isTableRowNode, $isTableCellNode, TableCellHeaderStates, $isTableNode, $isTableSelection, $getTableCellNodeFromLexicalNode, $getTableNodeFromLexicalNodeOrThrow, getTableElement, getTableObserverFromTableElement, $getTableRowIndexFromTableCellNode, $getNodeTriplet, $insertTableRow__EXPERIMENTAL, $getTableColumnIndexFromTableCellNode, $insertTableColumn__EXPERIMENTAL, $deleteTableRow__EXPERIMENTAL, $deleteTableColumn__EXPERIMENTAL, $unmergeCell, $computeTableMapSkipCellCheck, getDOMCellFromTarget, $getTableAndElementByKey } from "@lexical/table";
25
25
  import { mergeRegister, $wrapNodeInElement, $findMatchingParent, $getNearestNodeOfType, $getNearestBlockElementAncestorOrThrow, $insertNodeToNearestRoot, $isEditorIsNestedEditor, mediaFileReader, isMimeType, calculateZoomLevel, CAN_USE_DOM } from "@lexical/utils";
26
26
  import Stack from "@mui/material/Stack";
27
- import { createCommand, DecoratorNode, createEditor, $applyNodeReplacement, $insertNodes, $isRootOrShadowRoot, $createParagraphNode, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_LOW, $getSelection, $isRangeSelection, $getNearestNodeFromDOMNode, $setSelection, isHTMLElement as isHTMLElement$1, TextNode, $getRoot, $createTextNode, $getNodeByKey, $isParagraphNode, $isTextNode, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, KEY_DOWN_COMMAND, COMMAND_PRIORITY_CRITICAL, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, $isElementNode, SELECTION_CHANGE_COMMAND, UNDO_COMMAND, REDO_COMMAND, KEY_SPACE_COMMAND, $isLineBreakNode, $createRangeSelection, COMMAND_PRIORITY_HIGH, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, $createNodeSelection, $isNodeSelection, getDOMSelection, CLICK_COMMAND, PASTE_COMMAND, ParagraphNode, $createLineBreakNode, isDOMNode } from "lexical";
27
+ import { createCommand, DecoratorNode, createEditor, $applyNodeReplacement, $insertNodes, $isRootOrShadowRoot, $createParagraphNode, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_LOW, $getSelection, $isRangeSelection, $getNearestNodeFromDOMNode, isHTMLElement as isHTMLElement$1, TextNode, $getRoot, $createTextNode, $getNodeByKey, $isParagraphNode, $isTextNode, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, KEY_DOWN_COMMAND, COMMAND_PRIORITY_CRITICAL, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, $isElementNode, SELECTION_CHANGE_COMMAND, UNDO_COMMAND, REDO_COMMAND, KEY_SPACE_COMMAND, $isLineBreakNode, $createRangeSelection, $setSelection, COMMAND_PRIORITY_HIGH, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, $createNodeSelection, $isNodeSelection, getDOMSelection, CLICK_COMMAND, PASTE_COMMAND, ParagraphNode, $createLineBreakNode, isDOMNode } from "lexical";
28
28
  import * as ReactDOM from "react-dom";
29
29
  import ReactDOM__default, { createPortal } from "react-dom";
30
30
  import { $isCodeNode, CodeNode, normalizeCodeLang, getLanguageFriendlyName, CodeHighlightNode, CODE_LANGUAGE_MAP, $createCodeNode, registerCodeHighlighting, $isCodeHighlightNode } from "@lexical/code";
@@ -83,6 +83,7 @@ const getApiEndpoint = () => {
83
83
  return DEFAULT_API_ENDPOINT;
84
84
  };
85
85
  const verifyApiKey = async (apiKey) => {
86
+ var _a;
86
87
  try {
87
88
  const endpoint = getApiEndpoint();
88
89
  const response = await axios.post(
@@ -96,6 +97,12 @@ const verifyApiKey = async (apiKey) => {
96
97
  );
97
98
  return response.data;
98
99
  } catch (error) {
100
+ if ((_a = error.response) == null ? void 0 : _a.data) {
101
+ const customError = new Error(error.response.data.message || "Failed to verify API key");
102
+ customError.response = error.response;
103
+ customError.code = error.response.data.code;
104
+ throw customError;
105
+ }
99
106
  throw new Error("Failed to verify API key");
100
107
  }
101
108
  };
@@ -1471,7 +1478,7 @@ const AiTextTransform = async ({ content, apiKey }) => {
1471
1478
  const AI_ACTION_COMMAND = createCommand(
1472
1479
  "AI_ACTION_COMMAND"
1473
1480
  );
1474
- const ImageView = React__default.lazy(() => import("./index-8bcb5b47.js"));
1481
+ const ImageView = React__default.lazy(() => import("./index-cea164e5.js"));
1475
1482
  function isGoogleDocCheckboxImg(img) {
1476
1483
  return img.parentElement != null && img.parentElement.tagName === "LI" && img.previousSibling === null && img.getAttribute("aria-roledescription") === "checkbox";
1477
1484
  }
@@ -1743,18 +1750,18 @@ const ImagePlugin = ({
1743
1750
  }, [captionsEnabled, editor]);
1744
1751
  return null;
1745
1752
  };
1746
- function setRef(ref, value) {
1753
+ function setRef$1(ref, value) {
1747
1754
  if (typeof ref === "function") {
1748
1755
  return ref(value);
1749
1756
  } else if (ref !== null && ref !== void 0) {
1750
1757
  ref.current = value;
1751
1758
  }
1752
1759
  }
1753
- function composeRefs(...refs) {
1760
+ function composeRefs$1(...refs) {
1754
1761
  return (node) => {
1755
1762
  let hasCleanup = false;
1756
1763
  const cleanups = refs.map((ref) => {
1757
- const cleanup = setRef(ref, node);
1764
+ const cleanup = setRef$1(ref, node);
1758
1765
  if (!hasCleanup && typeof cleanup == "function") {
1759
1766
  hasCleanup = true;
1760
1767
  }
@@ -1767,34 +1774,31 @@ function composeRefs(...refs) {
1767
1774
  if (typeof cleanup == "function") {
1768
1775
  cleanup();
1769
1776
  } else {
1770
- setRef(refs[i2], null);
1777
+ setRef$1(refs[i2], null);
1771
1778
  }
1772
1779
  }
1773
1780
  };
1774
1781
  }
1775
1782
  };
1776
1783
  }
1777
- function useComposedRefs(...refs) {
1778
- return React$1.useCallback(composeRefs(...refs), refs);
1779
- }
1780
- var REACT_LAZY_TYPE$3 = Symbol.for("react.lazy");
1781
- var use$3 = React$1[" use ".trim().toString()];
1782
- function isPromiseLike$3(value) {
1784
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
1785
+ var use = React$1[" use ".trim().toString()];
1786
+ function isPromiseLike(value) {
1783
1787
  return typeof value === "object" && value !== null && "then" in value;
1784
1788
  }
1785
- function isLazyComponent$3(element) {
1786
- return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$3 && "_payload" in element && isPromiseLike$3(element._payload);
1789
+ function isLazyComponent(element) {
1790
+ return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
1787
1791
  }
1788
1792
  // @__NO_SIDE_EFFECTS__
1789
- function createSlot$4(ownerName) {
1790
- const SlotClone = /* @__PURE__ */ createSlotClone$4(ownerName);
1793
+ function createSlot$1(ownerName) {
1794
+ const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
1791
1795
  const Slot2 = React$1.forwardRef((props, forwardedRef) => {
1792
1796
  let { children, ...slotProps } = props;
1793
- if (isLazyComponent$3(children) && typeof use$3 === "function") {
1794
- children = use$3(children._payload);
1797
+ if (isLazyComponent(children) && typeof use === "function") {
1798
+ children = use(children._payload);
1795
1799
  }
1796
1800
  const childrenArray = React$1.Children.toArray(children);
1797
- const slottable = childrenArray.find(isSlottable$4);
1801
+ const slottable = childrenArray.find(isSlottable$1);
1798
1802
  if (slottable) {
1799
1803
  const newElement = slottable.props.children;
1800
1804
  const newChildren = childrenArray.map((child) => {
@@ -1813,19 +1817,19 @@ function createSlot$4(ownerName) {
1813
1817
  Slot2.displayName = `${ownerName}.Slot`;
1814
1818
  return Slot2;
1815
1819
  }
1816
- var Slot$4 = /* @__PURE__ */ createSlot$4("Slot");
1820
+ var Slot$4 = /* @__PURE__ */ createSlot$1("Slot");
1817
1821
  // @__NO_SIDE_EFFECTS__
1818
- function createSlotClone$4(ownerName) {
1822
+ function createSlotClone$1(ownerName) {
1819
1823
  const SlotClone = React$1.forwardRef((props, forwardedRef) => {
1820
1824
  let { children, ...slotProps } = props;
1821
- if (isLazyComponent$3(children) && typeof use$3 === "function") {
1822
- children = use$3(children._payload);
1825
+ if (isLazyComponent(children) && typeof use === "function") {
1826
+ children = use(children._payload);
1823
1827
  }
1824
1828
  if (React$1.isValidElement(children)) {
1825
- const childrenRef = getElementRef$5(children);
1826
- const props2 = mergeProps$4(slotProps, children.props);
1829
+ const childrenRef = getElementRef$2(children);
1830
+ const props2 = mergeProps$1(slotProps, children.props);
1827
1831
  if (children.type !== React$1.Fragment) {
1828
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
1832
+ props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
1829
1833
  }
1830
1834
  return React$1.cloneElement(children, props2);
1831
1835
  }
@@ -1834,11 +1838,11 @@ function createSlotClone$4(ownerName) {
1834
1838
  SlotClone.displayName = `${ownerName}.SlotClone`;
1835
1839
  return SlotClone;
1836
1840
  }
1837
- var SLOTTABLE_IDENTIFIER$4 = Symbol("radix.slottable");
1838
- function isSlottable$4(child) {
1839
- return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$4;
1841
+ var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
1842
+ function isSlottable$1(child) {
1843
+ return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
1840
1844
  }
1841
- function mergeProps$4(slotProps, childProps) {
1845
+ function mergeProps$1(slotProps, childProps) {
1842
1846
  const overrideProps = { ...childProps };
1843
1847
  for (const propName in childProps) {
1844
1848
  const slotPropValue = slotProps[propName];
@@ -1862,7 +1866,7 @@ function mergeProps$4(slotProps, childProps) {
1862
1866
  }
1863
1867
  return { ...slotProps, ...overrideProps };
1864
1868
  }
1865
- function getElementRef$5(element) {
1869
+ function getElementRef$2(element) {
1866
1870
  var _a, _b;
1867
1871
  let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
1868
1872
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
@@ -1937,28 +1941,7 @@ const cva = (base, config) => (props) => {
1937
1941
  }, []);
1938
1942
  return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
1939
1943
  };
1940
- const concatArrays = (array1, array2) => {
1941
- const combinedArray = new Array(array1.length + array2.length);
1942
- for (let i2 = 0; i2 < array1.length; i2++) {
1943
- combinedArray[i2] = array1[i2];
1944
- }
1945
- for (let i2 = 0; i2 < array2.length; i2++) {
1946
- combinedArray[array1.length + i2] = array2[i2];
1947
- }
1948
- return combinedArray;
1949
- };
1950
- const createClassValidatorObject = (classGroupId, validator) => ({
1951
- classGroupId,
1952
- validator
1953
- });
1954
- const createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
1955
- nextPart,
1956
- validators,
1957
- classGroupId
1958
- });
1959
1944
  const CLASS_PART_SEPARATOR = "-";
1960
- const EMPTY_CONFLICTS = [];
1961
- const ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
1962
1945
  const createClassGroupUtils = (config) => {
1963
1946
  const classMap = createClassMap(config);
1964
1947
  const {
@@ -1966,135 +1949,104 @@ const createClassGroupUtils = (config) => {
1966
1949
  conflictingClassGroupModifiers
1967
1950
  } = config;
1968
1951
  const getClassGroupId = (className) => {
1969
- if (className.startsWith("[") && className.endsWith("]")) {
1970
- return getGroupIdForArbitraryProperty(className);
1971
- }
1972
1952
  const classParts = className.split(CLASS_PART_SEPARATOR);
1973
- const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
1974
- return getGroupRecursive(classParts, startIndex, classMap);
1953
+ if (classParts[0] === "" && classParts.length !== 1) {
1954
+ classParts.shift();
1955
+ }
1956
+ return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
1975
1957
  };
1976
1958
  const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
1977
- if (hasPostfixModifier) {
1978
- const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
1979
- const baseConflicts = conflictingClassGroups[classGroupId];
1980
- if (modifierConflicts) {
1981
- if (baseConflicts) {
1982
- return concatArrays(baseConflicts, modifierConflicts);
1983
- }
1984
- return modifierConflicts;
1985
- }
1986
- return baseConflicts || EMPTY_CONFLICTS;
1959
+ const conflicts = conflictingClassGroups[classGroupId] || [];
1960
+ if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
1961
+ return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
1987
1962
  }
1988
- return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
1963
+ return conflicts;
1989
1964
  };
1990
1965
  return {
1991
1966
  getClassGroupId,
1992
1967
  getConflictingClassGroupIds
1993
1968
  };
1994
1969
  };
1995
- const getGroupRecursive = (classParts, startIndex, classPartObject) => {
1996
- const classPathsLength = classParts.length - startIndex;
1997
- if (classPathsLength === 0) {
1970
+ const getGroupRecursive = (classParts, classPartObject) => {
1971
+ var _a;
1972
+ if (classParts.length === 0) {
1998
1973
  return classPartObject.classGroupId;
1999
1974
  }
2000
- const currentClassPart = classParts[startIndex];
1975
+ const currentClassPart = classParts[0];
2001
1976
  const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
2002
- if (nextClassPartObject) {
2003
- const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
2004
- if (result)
2005
- return result;
1977
+ const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
1978
+ if (classGroupFromNextClassPart) {
1979
+ return classGroupFromNextClassPart;
2006
1980
  }
2007
- const validators = classPartObject.validators;
2008
- if (validators === null) {
1981
+ if (classPartObject.validators.length === 0) {
2009
1982
  return void 0;
2010
1983
  }
2011
- const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
2012
- const validatorsLength = validators.length;
2013
- for (let i2 = 0; i2 < validatorsLength; i2++) {
2014
- const validatorObj = validators[i2];
2015
- if (validatorObj.validator(classRest)) {
2016
- return validatorObj.classGroupId;
1984
+ const classRest = classParts.join(CLASS_PART_SEPARATOR);
1985
+ return (_a = classPartObject.validators.find(({
1986
+ validator
1987
+ }) => validator(classRest))) == null ? void 0 : _a.classGroupId;
1988
+ };
1989
+ const arbitraryPropertyRegex = /^\[(.+)\]$/;
1990
+ const getGroupIdForArbitraryProperty = (className) => {
1991
+ if (arbitraryPropertyRegex.test(className)) {
1992
+ const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
1993
+ const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
1994
+ if (property) {
1995
+ return "arbitrary.." + property;
2017
1996
  }
2018
1997
  }
2019
- return void 0;
2020
1998
  };
2021
- const getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
2022
- const content = className.slice(1, -1);
2023
- const colonIndex = content.indexOf(":");
2024
- const property = content.slice(0, colonIndex);
2025
- return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
2026
- })();
2027
1999
  const createClassMap = (config) => {
2028
2000
  const {
2029
2001
  theme: theme2,
2030
2002
  classGroups
2031
2003
  } = config;
2032
- return processClassGroups(classGroups, theme2);
2033
- };
2034
- const processClassGroups = (classGroups, theme2) => {
2035
- const classMap = createClassPartObject();
2004
+ const classMap = {
2005
+ nextPart: /* @__PURE__ */ new Map(),
2006
+ validators: []
2007
+ };
2036
2008
  for (const classGroupId in classGroups) {
2037
- const group = classGroups[classGroupId];
2038
- processClassesRecursively(group, classMap, classGroupId, theme2);
2009
+ processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme2);
2039
2010
  }
2040
2011
  return classMap;
2041
2012
  };
2042
2013
  const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme2) => {
2043
- const len = classGroup.length;
2044
- for (let i2 = 0; i2 < len; i2++) {
2045
- const classDefinition = classGroup[i2];
2046
- processClassDefinition(classDefinition, classPartObject, classGroupId, theme2);
2047
- }
2048
- };
2049
- const processClassDefinition = (classDefinition, classPartObject, classGroupId, theme2) => {
2050
- if (typeof classDefinition === "string") {
2051
- processStringDefinition(classDefinition, classPartObject, classGroupId);
2052
- return;
2053
- }
2054
- if (typeof classDefinition === "function") {
2055
- processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme2);
2056
- return;
2057
- }
2058
- processObjectDefinition(classDefinition, classPartObject, classGroupId, theme2);
2059
- };
2060
- const processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
2061
- const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
2062
- classPartObjectToEdit.classGroupId = classGroupId;
2063
- };
2064
- const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme2) => {
2065
- if (isThemeGetter(classDefinition)) {
2066
- processClassesRecursively(classDefinition(theme2), classPartObject, classGroupId, theme2);
2067
- return;
2068
- }
2069
- if (classPartObject.validators === null) {
2070
- classPartObject.validators = [];
2071
- }
2072
- classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
2073
- };
2074
- const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme2) => {
2075
- const entries = Object.entries(classDefinition);
2076
- const len = entries.length;
2077
- for (let i2 = 0; i2 < len; i2++) {
2078
- const [key, value] = entries[i2];
2079
- processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme2);
2080
- }
2014
+ classGroup.forEach((classDefinition) => {
2015
+ if (typeof classDefinition === "string") {
2016
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
2017
+ classPartObjectToEdit.classGroupId = classGroupId;
2018
+ return;
2019
+ }
2020
+ if (typeof classDefinition === "function") {
2021
+ if (isThemeGetter(classDefinition)) {
2022
+ processClassesRecursively(classDefinition(theme2), classPartObject, classGroupId, theme2);
2023
+ return;
2024
+ }
2025
+ classPartObject.validators.push({
2026
+ validator: classDefinition,
2027
+ classGroupId
2028
+ });
2029
+ return;
2030
+ }
2031
+ Object.entries(classDefinition).forEach(([key, classGroup2]) => {
2032
+ processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme2);
2033
+ });
2034
+ });
2081
2035
  };
2082
2036
  const getPart = (classPartObject, path) => {
2083
- let current = classPartObject;
2084
- const parts = path.split(CLASS_PART_SEPARATOR);
2085
- const len = parts.length;
2086
- for (let i2 = 0; i2 < len; i2++) {
2087
- const part = parts[i2];
2088
- let next = current.nextPart.get(part);
2089
- if (!next) {
2090
- next = createClassPartObject();
2091
- current.nextPart.set(part, next);
2037
+ let currentClassPartObject = classPartObject;
2038
+ path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
2039
+ if (!currentClassPartObject.nextPart.has(pathPart)) {
2040
+ currentClassPartObject.nextPart.set(pathPart, {
2041
+ nextPart: /* @__PURE__ */ new Map(),
2042
+ validators: []
2043
+ });
2092
2044
  }
2093
- current = next;
2094
- }
2095
- return current;
2045
+ currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
2046
+ });
2047
+ return currentClassPartObject;
2096
2048
  };
2097
- const isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
2049
+ const isThemeGetter = (func) => func.isThemeGetter;
2098
2050
  const createLruCache = (maxCacheSize) => {
2099
2051
  if (maxCacheSize < 1) {
2100
2052
  return {
@@ -2104,31 +2056,31 @@ const createLruCache = (maxCacheSize) => {
2104
2056
  };
2105
2057
  }
2106
2058
  let cacheSize = 0;
2107
- let cache = /* @__PURE__ */ Object.create(null);
2108
- let previousCache = /* @__PURE__ */ Object.create(null);
2059
+ let cache = /* @__PURE__ */ new Map();
2060
+ let previousCache = /* @__PURE__ */ new Map();
2109
2061
  const update = (key, value) => {
2110
- cache[key] = value;
2062
+ cache.set(key, value);
2111
2063
  cacheSize++;
2112
2064
  if (cacheSize > maxCacheSize) {
2113
2065
  cacheSize = 0;
2114
2066
  previousCache = cache;
2115
- cache = /* @__PURE__ */ Object.create(null);
2067
+ cache = /* @__PURE__ */ new Map();
2116
2068
  }
2117
2069
  };
2118
2070
  return {
2119
2071
  get(key) {
2120
- let value = cache[key];
2072
+ let value = cache.get(key);
2121
2073
  if (value !== void 0) {
2122
2074
  return value;
2123
2075
  }
2124
- if ((value = previousCache[key]) !== void 0) {
2076
+ if ((value = previousCache.get(key)) !== void 0) {
2125
2077
  update(key, value);
2126
2078
  return value;
2127
2079
  }
2128
2080
  },
2129
2081
  set(key, value) {
2130
- if (key in cache) {
2131
- cache[key] = value;
2082
+ if (cache.has(key)) {
2083
+ cache.set(key, value);
2132
2084
  } else {
2133
2085
  update(key, value);
2134
2086
  }
@@ -2137,14 +2089,7 @@ const createLruCache = (maxCacheSize) => {
2137
2089
  };
2138
2090
  const IMPORTANT_MODIFIER = "!";
2139
2091
  const MODIFIER_SEPARATOR = ":";
2140
- const EMPTY_MODIFIERS = [];
2141
- const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
2142
- modifiers,
2143
- hasImportantModifier,
2144
- baseClassName,
2145
- maybePostfixModifierPosition,
2146
- isExternal
2147
- });
2092
+ const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
2148
2093
  const createParseClassName = (config) => {
2149
2094
  const {
2150
2095
  prefix,
@@ -2156,13 +2101,12 @@ const createParseClassName = (config) => {
2156
2101
  let parenDepth = 0;
2157
2102
  let modifierStart = 0;
2158
2103
  let postfixModifierPosition;
2159
- const len = className.length;
2160
- for (let index2 = 0; index2 < len; index2++) {
2161
- const currentCharacter = className[index2];
2104
+ for (let index2 = 0; index2 < className.length; index2++) {
2105
+ let currentCharacter = className[index2];
2162
2106
  if (bracketDepth === 0 && parenDepth === 0) {
2163
2107
  if (currentCharacter === MODIFIER_SEPARATOR) {
2164
2108
  modifiers.push(className.slice(modifierStart, index2));
2165
- modifierStart = index2 + 1;
2109
+ modifierStart = index2 + MODIFIER_SEPARATOR_LENGTH;
2166
2110
  continue;
2167
2111
  }
2168
2112
  if (currentCharacter === "/") {
@@ -2170,38 +2114,37 @@ const createParseClassName = (config) => {
2170
2114
  continue;
2171
2115
  }
2172
2116
  }
2173
- if (currentCharacter === "[")
2117
+ if (currentCharacter === "[") {
2174
2118
  bracketDepth++;
2175
- else if (currentCharacter === "]")
2119
+ } else if (currentCharacter === "]") {
2176
2120
  bracketDepth--;
2177
- else if (currentCharacter === "(")
2121
+ } else if (currentCharacter === "(") {
2178
2122
  parenDepth++;
2179
- else if (currentCharacter === ")")
2123
+ } else if (currentCharacter === ")") {
2180
2124
  parenDepth--;
2125
+ }
2181
2126
  }
2182
- const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
2183
- let baseClassName = baseClassNameWithImportantModifier;
2184
- let hasImportantModifier = false;
2185
- if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
2186
- baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
2187
- hasImportantModifier = true;
2188
- } else if (
2189
- /**
2190
- * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
2191
- * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
2192
- */
2193
- baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)
2194
- ) {
2195
- baseClassName = baseClassNameWithImportantModifier.slice(1);
2196
- hasImportantModifier = true;
2197
- }
2127
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
2128
+ const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
2129
+ const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
2198
2130
  const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
2199
- return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
2131
+ return {
2132
+ modifiers,
2133
+ hasImportantModifier,
2134
+ baseClassName,
2135
+ maybePostfixModifierPosition
2136
+ };
2200
2137
  };
2201
2138
  if (prefix) {
2202
2139
  const fullPrefix = prefix + MODIFIER_SEPARATOR;
2203
2140
  const parseClassNameOriginal = parseClassName;
2204
- parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
2141
+ parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
2142
+ isExternal: true,
2143
+ modifiers: [],
2144
+ hasImportantModifier: false,
2145
+ baseClassName: className,
2146
+ maybePostfixModifierPosition: void 0
2147
+ };
2205
2148
  }
2206
2149
  if (experimentalParseClassName) {
2207
2150
  const parseClassNameOriginal = parseClassName;
@@ -2212,35 +2155,36 @@ const createParseClassName = (config) => {
2212
2155
  }
2213
2156
  return parseClassName;
2214
2157
  };
2158
+ const stripImportantModifier = (baseClassName) => {
2159
+ if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
2160
+ return baseClassName.substring(0, baseClassName.length - 1);
2161
+ }
2162
+ if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
2163
+ return baseClassName.substring(1);
2164
+ }
2165
+ return baseClassName;
2166
+ };
2215
2167
  const createSortModifiers = (config) => {
2216
- const modifierWeights = /* @__PURE__ */ new Map();
2217
- config.orderSensitiveModifiers.forEach((mod, index2) => {
2218
- modifierWeights.set(mod, 1e6 + index2);
2219
- });
2220
- return (modifiers) => {
2221
- const result = [];
2222
- let currentSegment = [];
2223
- for (let i2 = 0; i2 < modifiers.length; i2++) {
2224
- const modifier = modifiers[i2];
2225
- const isArbitrary = modifier[0] === "[";
2226
- const isOrderSensitive = modifierWeights.has(modifier);
2227
- if (isArbitrary || isOrderSensitive) {
2228
- if (currentSegment.length > 0) {
2229
- currentSegment.sort();
2230
- result.push(...currentSegment);
2231
- currentSegment = [];
2232
- }
2233
- result.push(modifier);
2168
+ const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map((modifier) => [modifier, true]));
2169
+ const sortModifiers = (modifiers) => {
2170
+ if (modifiers.length <= 1) {
2171
+ return modifiers;
2172
+ }
2173
+ const sortedModifiers = [];
2174
+ let unsortedModifiers = [];
2175
+ modifiers.forEach((modifier) => {
2176
+ const isPositionSensitive = modifier[0] === "[" || orderSensitiveModifiers[modifier];
2177
+ if (isPositionSensitive) {
2178
+ sortedModifiers.push(...unsortedModifiers.sort(), modifier);
2179
+ unsortedModifiers = [];
2234
2180
  } else {
2235
- currentSegment.push(modifier);
2181
+ unsortedModifiers.push(modifier);
2236
2182
  }
2237
- }
2238
- if (currentSegment.length > 0) {
2239
- currentSegment.sort();
2240
- result.push(...currentSegment);
2241
- }
2242
- return result;
2183
+ });
2184
+ sortedModifiers.push(...unsortedModifiers.sort());
2185
+ return sortedModifiers;
2243
2186
  };
2187
+ return sortModifiers;
2244
2188
  };
2245
2189
  const createConfigUtils = (config) => ({
2246
2190
  cache: createLruCache(config.cacheSize),
@@ -2286,10 +2230,10 @@ const mergeClassList = (classList, configUtils) => {
2286
2230
  }
2287
2231
  hasPostfixModifier = false;
2288
2232
  }
2289
- const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
2233
+ const variantModifier = sortModifiers(modifiers).join(":");
2290
2234
  const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
2291
2235
  const classId = modifierId + classGroupId;
2292
- if (classGroupsInConflict.indexOf(classId) > -1) {
2236
+ if (classGroupsInConflict.includes(classId)) {
2293
2237
  continue;
2294
2238
  }
2295
2239
  classGroupsInConflict.push(classId);
@@ -2302,13 +2246,13 @@ const mergeClassList = (classList, configUtils) => {
2302
2246
  }
2303
2247
  return result;
2304
2248
  };
2305
- const twJoin = (...classLists) => {
2249
+ function twJoin() {
2306
2250
  let index2 = 0;
2307
2251
  let argument;
2308
2252
  let resolvedValue;
2309
2253
  let string = "";
2310
- while (index2 < classLists.length) {
2311
- if (argument = classLists[index2++]) {
2254
+ while (index2 < arguments.length) {
2255
+ if (argument = arguments[index2++]) {
2312
2256
  if (resolvedValue = toValue(argument)) {
2313
2257
  string && (string += " ");
2314
2258
  string += resolvedValue;
@@ -2316,7 +2260,7 @@ const twJoin = (...classLists) => {
2316
2260
  }
2317
2261
  }
2318
2262
  return string;
2319
- };
2263
+ }
2320
2264
  const toValue = (mix) => {
2321
2265
  if (typeof mix === "string") {
2322
2266
  return mix;
@@ -2333,20 +2277,20 @@ const toValue = (mix) => {
2333
2277
  }
2334
2278
  return string;
2335
2279
  };
2336
- const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
2280
+ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
2337
2281
  let configUtils;
2338
2282
  let cacheGet;
2339
2283
  let cacheSet;
2340
- let functionToCall;
2341
- const initTailwindMerge = (classList) => {
2284
+ let functionToCall = initTailwindMerge;
2285
+ function initTailwindMerge(classList) {
2342
2286
  const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
2343
2287
  configUtils = createConfigUtils(config);
2344
2288
  cacheGet = configUtils.cache.get;
2345
2289
  cacheSet = configUtils.cache.set;
2346
2290
  functionToCall = tailwindMerge;
2347
2291
  return tailwindMerge(classList);
2348
- };
2349
- const tailwindMerge = (classList) => {
2292
+ }
2293
+ function tailwindMerge(classList) {
2350
2294
  const cachedResult = cacheGet(classList);
2351
2295
  if (cachedResult) {
2352
2296
  return cachedResult;
@@ -2354,13 +2298,13 @@ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
2354
2298
  const result = mergeClassList(classList, configUtils);
2355
2299
  cacheSet(classList, result);
2356
2300
  return result;
2301
+ }
2302
+ return function callTailwindMerge() {
2303
+ return functionToCall(twJoin.apply(null, arguments));
2357
2304
  };
2358
- functionToCall = initTailwindMerge;
2359
- return (...args) => functionToCall(twJoin(...args));
2360
- };
2361
- const fallbackThemeArr = [];
2305
+ }
2362
2306
  const fromTheme = (key) => {
2363
- const themeGetter = (theme2) => theme2[key] || fallbackThemeArr;
2307
+ const themeGetter = (theme2) => theme2[key] || [];
2364
2308
  themeGetter.isThemeGetter = true;
2365
2309
  return themeGetter;
2366
2310
  };
@@ -5002,6 +4946,40 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
5002
4946
  }
5003
4947
  };
5004
4948
  }
4949
+ function setRef(ref, value) {
4950
+ if (typeof ref === "function") {
4951
+ return ref(value);
4952
+ } else if (ref !== null && ref !== void 0) {
4953
+ ref.current = value;
4954
+ }
4955
+ }
4956
+ function composeRefs(...refs) {
4957
+ return (node) => {
4958
+ let hasCleanup = false;
4959
+ const cleanups = refs.map((ref) => {
4960
+ const cleanup = setRef(ref, node);
4961
+ if (!hasCleanup && typeof cleanup == "function") {
4962
+ hasCleanup = true;
4963
+ }
4964
+ return cleanup;
4965
+ });
4966
+ if (hasCleanup) {
4967
+ return () => {
4968
+ for (let i2 = 0; i2 < cleanups.length; i2++) {
4969
+ const cleanup = cleanups[i2];
4970
+ if (typeof cleanup == "function") {
4971
+ cleanup();
4972
+ } else {
4973
+ setRef(refs[i2], null);
4974
+ }
4975
+ }
4976
+ };
4977
+ }
4978
+ };
4979
+ }
4980
+ function useComposedRefs(...refs) {
4981
+ return React$1.useCallback(composeRefs(...refs), refs);
4982
+ }
5005
4983
  function createContext2(rootComponentName, defaultContext) {
5006
4984
  const Context2 = React$1.createContext(defaultContext);
5007
4985
  const Provider2 = (props) => {
@@ -5020,7 +4998,7 @@ function createContext2(rootComponentName, defaultContext) {
5020
4998
  }
5021
4999
  return [Provider2, useContext2];
5022
5000
  }
5023
- function createContextScope$1(scopeName, createContextScopeDeps = []) {
5001
+ function createContextScope(scopeName, createContextScopeDeps = []) {
5024
5002
  let defaultContexts = [];
5025
5003
  function createContext3(rootComponentName, defaultContext) {
5026
5004
  const BaseContext = React$1.createContext(defaultContext);
@@ -5059,9 +5037,9 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
5059
5037
  };
5060
5038
  };
5061
5039
  createScope.scopeName = scopeName;
5062
- return [createContext3, composeContextScopes$1(createScope, ...createContextScopeDeps)];
5040
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
5063
5041
  }
5064
- function composeContextScopes$1(...scopes) {
5042
+ function composeContextScopes(...scopes) {
5065
5043
  const baseScope = scopes[0];
5066
5044
  if (scopes.length === 1)
5067
5045
  return baseScope;
@@ -5161,12 +5139,12 @@ function isFunction(value) {
5161
5139
  return typeof value === "function";
5162
5140
  }
5163
5141
  // @__NO_SIDE_EFFECTS__
5164
- function createSlot$3(ownerName) {
5165
- const SlotClone = /* @__PURE__ */ createSlotClone$3(ownerName);
5142
+ function createSlot(ownerName) {
5143
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
5166
5144
  const Slot2 = React$1.forwardRef((props, forwardedRef) => {
5167
5145
  const { children, ...slotProps } = props;
5168
5146
  const childrenArray = React$1.Children.toArray(children);
5169
- const slottable = childrenArray.find(isSlottable$3);
5147
+ const slottable = childrenArray.find(isSlottable);
5170
5148
  if (slottable) {
5171
5149
  const newElement = slottable.props.children;
5172
5150
  const newChildren = childrenArray.map((child) => {
@@ -5186,12 +5164,12 @@ function createSlot$3(ownerName) {
5186
5164
  return Slot2;
5187
5165
  }
5188
5166
  // @__NO_SIDE_EFFECTS__
5189
- function createSlotClone$3(ownerName) {
5167
+ function createSlotClone(ownerName) {
5190
5168
  const SlotClone = React$1.forwardRef((props, forwardedRef) => {
5191
5169
  const { children, ...slotProps } = props;
5192
5170
  if (React$1.isValidElement(children)) {
5193
- const childrenRef = getElementRef$4(children);
5194
- const props2 = mergeProps$3(slotProps, children.props);
5171
+ const childrenRef = getElementRef$1(children);
5172
+ const props2 = mergeProps(slotProps, children.props);
5195
5173
  if (children.type !== React$1.Fragment) {
5196
5174
  props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
5197
5175
  }
@@ -5202,20 +5180,20 @@ function createSlotClone$3(ownerName) {
5202
5180
  SlotClone.displayName = `${ownerName}.SlotClone`;
5203
5181
  return SlotClone;
5204
5182
  }
5205
- var SLOTTABLE_IDENTIFIER$3 = Symbol("radix.slottable");
5183
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
5206
5184
  // @__NO_SIDE_EFFECTS__
5207
5185
  function createSlottable(ownerName) {
5208
5186
  const Slottable2 = ({ children }) => {
5209
5187
  return /* @__PURE__ */ jsx(Fragment, { children });
5210
5188
  };
5211
5189
  Slottable2.displayName = `${ownerName}.Slottable`;
5212
- Slottable2.__radixId = SLOTTABLE_IDENTIFIER$3;
5190
+ Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
5213
5191
  return Slottable2;
5214
5192
  }
5215
- function isSlottable$3(child) {
5216
- return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$3;
5193
+ function isSlottable(child) {
5194
+ return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
5217
5195
  }
5218
- function mergeProps$3(slotProps, childProps) {
5196
+ function mergeProps(slotProps, childProps) {
5219
5197
  const overrideProps = { ...childProps };
5220
5198
  for (const propName in childProps) {
5221
5199
  const slotPropValue = slotProps[propName];
@@ -5239,7 +5217,7 @@ function mergeProps$3(slotProps, childProps) {
5239
5217
  }
5240
5218
  return { ...slotProps, ...overrideProps };
5241
5219
  }
5242
- function getElementRef$4(element) {
5220
+ function getElementRef$1(element) {
5243
5221
  var _a, _b;
5244
5222
  let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
5245
5223
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
@@ -5253,7 +5231,7 @@ function getElementRef$4(element) {
5253
5231
  }
5254
5232
  return element.props.ref || element.ref;
5255
5233
  }
5256
- var NODES$3 = [
5234
+ var NODES = [
5257
5235
  "a",
5258
5236
  "button",
5259
5237
  "div",
@@ -5272,8 +5250,8 @@ var NODES$3 = [
5272
5250
  "svg",
5273
5251
  "ul"
5274
5252
  ];
5275
- var Primitive$3 = NODES$3.reduce((primitive, node) => {
5276
- const Slot2 = /* @__PURE__ */ createSlot$3(`Primitive.${node}`);
5253
+ var Primitive = NODES.reduce((primitive, node) => {
5254
+ const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
5277
5255
  const Node2 = React$1.forwardRef((props, forwardedRef) => {
5278
5256
  const { asChild, ...primitiveProps } = props;
5279
5257
  const Comp = asChild ? Slot2 : node;
@@ -5406,7 +5384,7 @@ var DismissableLayer = React$1.forwardRef(
5406
5384
  return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
5407
5385
  }, []);
5408
5386
  return /* @__PURE__ */ jsx(
5409
- Primitive$3.div,
5387
+ Primitive.div,
5410
5388
  {
5411
5389
  ...layerProps,
5412
5390
  ref: composedRefs,
@@ -5439,7 +5417,7 @@ var DismissableLayerBranch = React$1.forwardRef((props, forwardedRef) => {
5439
5417
  };
5440
5418
  }
5441
5419
  }, [context.branches]);
5442
- return /* @__PURE__ */ jsx(Primitive$3.div, { ...props, ref: composedRefs });
5420
+ return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
5443
5421
  });
5444
5422
  DismissableLayerBranch.displayName = BRANCH_NAME;
5445
5423
  function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
@@ -5648,7 +5626,7 @@ var FocusScope = React$1.forwardRef((props, forwardedRef) => {
5648
5626
  },
5649
5627
  [loop, trapped, focusScope.paused]
5650
5628
  );
5651
- return /* @__PURE__ */ jsx(Primitive$3.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
5629
+ return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
5652
5630
  });
5653
5631
  FocusScope.displayName = FOCUS_SCOPE_NAME;
5654
5632
  function focusFirst$2(candidates, { select = false } = {}) {
@@ -5745,7 +5723,7 @@ var Portal$5 = React$1.forwardRef((props, forwardedRef) => {
5745
5723
  const [mounted, setMounted] = React$1.useState(false);
5746
5724
  useLayoutEffect2(() => setMounted(true), []);
5747
5725
  const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
5748
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive$3.div, { ...portalProps, ref: forwardedRef }), container) : null;
5726
+ return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
5749
5727
  });
5750
5728
  Portal$5.displayName = PORTAL_NAME$6;
5751
5729
  function useStateMachine(initialState, machine) {
@@ -5758,7 +5736,7 @@ var Presence = (props) => {
5758
5736
  const { present, children } = props;
5759
5737
  const presence = usePresence(present);
5760
5738
  const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
5761
- const ref = useComposedRefs(presence.ref, getElementRef$3(child));
5739
+ const ref = useComposedRefs(presence.ref, getElementRef(child));
5762
5740
  const forceMount = typeof children === "function";
5763
5741
  return forceMount || presence.isPresent ? React$1.cloneElement(child, { ref }) : null;
5764
5742
  };
@@ -5857,7 +5835,7 @@ function usePresence(present) {
5857
5835
  function getAnimationName(styles) {
5858
5836
  return (styles == null ? void 0 : styles.animationName) || "none";
5859
5837
  }
5860
- function getElementRef$3(element) {
5838
+ function getElementRef(element) {
5861
5839
  var _a, _b;
5862
5840
  let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
5863
5841
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
@@ -6680,7 +6658,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
6680
6658
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
6681
6659
  };
6682
6660
  var DIALOG_NAME = "Dialog";
6683
- var [createDialogContext, createDialogScope] = createContextScope$1(DIALOG_NAME);
6661
+ var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
6684
6662
  var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
6685
6663
  var Dialog$1 = (props) => {
6686
6664
  const {
@@ -6724,7 +6702,7 @@ var DialogTrigger = React$1.forwardRef(
6724
6702
  const context = useDialogContext(TRIGGER_NAME$5, __scopeDialog);
6725
6703
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
6726
6704
  return /* @__PURE__ */ jsx(
6727
- Primitive$3.button,
6705
+ Primitive.button,
6728
6706
  {
6729
6707
  type: "button",
6730
6708
  "aria-haspopup": "dialog",
@@ -6759,7 +6737,7 @@ var DialogOverlay$1 = React$1.forwardRef(
6759
6737
  }
6760
6738
  );
6761
6739
  DialogOverlay$1.displayName = OVERLAY_NAME;
6762
- var Slot$3 = /* @__PURE__ */ createSlot$3("DialogOverlay.RemoveScroll");
6740
+ var Slot$3 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
6763
6741
  var DialogOverlayImpl = React$1.forwardRef(
6764
6742
  (props, forwardedRef) => {
6765
6743
  const { __scopeDialog, ...overlayProps } = props;
@@ -6768,7 +6746,7 @@ var DialogOverlayImpl = React$1.forwardRef(
6768
6746
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
6769
6747
  // ie. when `Overlay` and `Content` are siblings
6770
6748
  /* @__PURE__ */ jsx(RemoveScroll, { as: Slot$3, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
6771
- Primitive$3.div,
6749
+ Primitive.div,
6772
6750
  {
6773
6751
  "data-state": getState$1(context.open),
6774
6752
  ...overlayProps,
@@ -6913,7 +6891,7 @@ var DialogTitle$1 = React$1.forwardRef(
6913
6891
  (props, forwardedRef) => {
6914
6892
  const { __scopeDialog, ...titleProps } = props;
6915
6893
  const context = useDialogContext(TITLE_NAME, __scopeDialog);
6916
- return /* @__PURE__ */ jsx(Primitive$3.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
6894
+ return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
6917
6895
  }
6918
6896
  );
6919
6897
  DialogTitle$1.displayName = TITLE_NAME;
@@ -6922,7 +6900,7 @@ var DialogDescription$1 = React$1.forwardRef(
6922
6900
  (props, forwardedRef) => {
6923
6901
  const { __scopeDialog, ...descriptionProps } = props;
6924
6902
  const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
6925
- return /* @__PURE__ */ jsx(Primitive$3.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
6903
+ return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
6926
6904
  }
6927
6905
  );
6928
6906
  DialogDescription$1.displayName = DESCRIPTION_NAME;
@@ -6932,7 +6910,7 @@ var DialogClose = React$1.forwardRef(
6932
6910
  const { __scopeDialog, ...closeProps } = props;
6933
6911
  const context = useDialogContext(CLOSE_NAME$1, __scopeDialog);
6934
6912
  return /* @__PURE__ */ jsx(
6935
- Primitive$3.button,
6913
+ Primitive.button,
6936
6914
  {
6937
6915
  type: "button",
6938
6916
  ...closeProps,
@@ -7928,7 +7906,7 @@ const DialogContent = React$1.forwardRef(({ className, children, ...props }, ref
7928
7906
  /* @__PURE__ */ jsxs(
7929
7907
  Close,
7930
7908
  {
7931
- className: "closeDialog cteditor-absolute cteditor-right-4 cteditor-top-4 cteditor-rounded-full cteditor-bg-secondary cteditor-p-1 cteditor-opacity-70 cteditor-transition-opacity focus:cteditor-outline-none cteditor-disabled:pointer-events-none data-[state=open]:cteditor-bg-accent data-[state=open]:cteditor-text-muted-foreground hover:cteditor-opacity-100\n",
7909
+ className: "closeDialog cteditor-absolute cteditor-right-4 cteditor-top-4 cteditor-rounded-full cteditor-bg-secondary cteditor-p-1 cteditor-opacity-70 cteditor-transition-opacity focus:cteditor-outline-none cteditor-disabled:pointer-events-none data-[state=open]:cteditor-bg-accent data-[state=open]:cteditor-text-muted-foreground hover:cteditor-opacity-100\r\n",
7932
7910
  children: [
7933
7911
  /* @__PURE__ */ jsx(X$1, { className: "cteditor-h-4 cteditor-w-4" }),
7934
7912
  /* @__PURE__ */ jsx("span", { className: "!cteditor-sr-only", children: "Close" })
@@ -8006,140 +7984,10 @@ const Input$1 = React$1.forwardRef(
8006
7984
  }
8007
7985
  );
8008
7986
  Input$1.displayName = "Input";
8009
- var REACT_LAZY_TYPE$2 = Symbol.for("react.lazy");
8010
- var use$2 = React$1[" use ".trim().toString()];
8011
- function isPromiseLike$2(value) {
8012
- return typeof value === "object" && value !== null && "then" in value;
8013
- }
8014
- function isLazyComponent$2(element) {
8015
- return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$2 && "_payload" in element && isPromiseLike$2(element._payload);
8016
- }
8017
- // @__NO_SIDE_EFFECTS__
8018
- function createSlot$2(ownerName) {
8019
- const SlotClone = /* @__PURE__ */ createSlotClone$2(ownerName);
8020
- const Slot2 = React$1.forwardRef((props, forwardedRef) => {
8021
- let { children, ...slotProps } = props;
8022
- if (isLazyComponent$2(children) && typeof use$2 === "function") {
8023
- children = use$2(children._payload);
8024
- }
8025
- const childrenArray = React$1.Children.toArray(children);
8026
- const slottable = childrenArray.find(isSlottable$2);
8027
- if (slottable) {
8028
- const newElement = slottable.props.children;
8029
- const newChildren = childrenArray.map((child) => {
8030
- if (child === slottable) {
8031
- if (React$1.Children.count(newElement) > 1)
8032
- return React$1.Children.only(null);
8033
- return React$1.isValidElement(newElement) ? newElement.props.children : null;
8034
- } else {
8035
- return child;
8036
- }
8037
- });
8038
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
8039
- }
8040
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
8041
- });
8042
- Slot2.displayName = `${ownerName}.Slot`;
8043
- return Slot2;
8044
- }
8045
- // @__NO_SIDE_EFFECTS__
8046
- function createSlotClone$2(ownerName) {
8047
- const SlotClone = React$1.forwardRef((props, forwardedRef) => {
8048
- let { children, ...slotProps } = props;
8049
- if (isLazyComponent$2(children) && typeof use$2 === "function") {
8050
- children = use$2(children._payload);
8051
- }
8052
- if (React$1.isValidElement(children)) {
8053
- const childrenRef = getElementRef$2(children);
8054
- const props2 = mergeProps$2(slotProps, children.props);
8055
- if (children.type !== React$1.Fragment) {
8056
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
8057
- }
8058
- return React$1.cloneElement(children, props2);
8059
- }
8060
- return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
8061
- });
8062
- SlotClone.displayName = `${ownerName}.SlotClone`;
8063
- return SlotClone;
8064
- }
8065
- var SLOTTABLE_IDENTIFIER$2 = Symbol("radix.slottable");
8066
- function isSlottable$2(child) {
8067
- return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$2;
8068
- }
8069
- function mergeProps$2(slotProps, childProps) {
8070
- const overrideProps = { ...childProps };
8071
- for (const propName in childProps) {
8072
- const slotPropValue = slotProps[propName];
8073
- const childPropValue = childProps[propName];
8074
- const isHandler = /^on[A-Z]/.test(propName);
8075
- if (isHandler) {
8076
- if (slotPropValue && childPropValue) {
8077
- overrideProps[propName] = (...args) => {
8078
- const result = childPropValue(...args);
8079
- slotPropValue(...args);
8080
- return result;
8081
- };
8082
- } else if (slotPropValue) {
8083
- overrideProps[propName] = slotPropValue;
8084
- }
8085
- } else if (propName === "style") {
8086
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
8087
- } else if (propName === "className") {
8088
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
8089
- }
8090
- }
8091
- return { ...slotProps, ...overrideProps };
8092
- }
8093
- function getElementRef$2(element) {
8094
- var _a, _b;
8095
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
8096
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
8097
- if (mayWarn) {
8098
- return element.ref;
8099
- }
8100
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
8101
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
8102
- if (mayWarn) {
8103
- return element.props.ref;
8104
- }
8105
- return element.props.ref || element.ref;
8106
- }
8107
- var NODES$2 = [
8108
- "a",
8109
- "button",
8110
- "div",
8111
- "form",
8112
- "h2",
8113
- "h3",
8114
- "img",
8115
- "input",
8116
- "label",
8117
- "li",
8118
- "nav",
8119
- "ol",
8120
- "p",
8121
- "select",
8122
- "span",
8123
- "svg",
8124
- "ul"
8125
- ];
8126
- var Primitive$2 = NODES$2.reduce((primitive, node) => {
8127
- const Slot2 = /* @__PURE__ */ createSlot$2(`Primitive.${node}`);
8128
- const Node2 = React$1.forwardRef((props, forwardedRef) => {
8129
- const { asChild, ...primitiveProps } = props;
8130
- const Comp = asChild ? Slot2 : node;
8131
- if (typeof window !== "undefined") {
8132
- window[Symbol.for("radix-ui")] = true;
8133
- }
8134
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
8135
- });
8136
- Node2.displayName = `Primitive.${node}`;
8137
- return { ...primitive, [node]: Node2 };
8138
- }, {});
8139
7987
  var NAME$4 = "Label";
8140
7988
  var Label$3 = React$1.forwardRef((props, forwardedRef) => {
8141
7989
  return /* @__PURE__ */ jsx(
8142
- Primitive$2.label,
7990
+ Primitive.label,
8143
7991
  {
8144
7992
  ...props,
8145
7993
  ref: forwardedRef,
@@ -9178,19 +9026,19 @@ function CopyButton({ editor, getCodeDOMNode }) {
9178
9026
  const removeSuccessIcon = useDebounce$1(() => {
9179
9027
  setCopyCompleted(false);
9180
9028
  }, 1e3);
9181
- async function handleClick() {
9029
+ async function handleClick(e) {
9030
+ e.preventDefault();
9031
+ e.stopPropagation();
9182
9032
  const codeDOMNode = getCodeDOMNode();
9183
9033
  if (!codeDOMNode) {
9184
9034
  return;
9185
9035
  }
9186
9036
  let content = "";
9187
- editor.update(() => {
9037
+ editor.read(() => {
9188
9038
  const codeNode = $getNearestNodeFromDOMNode(codeDOMNode);
9189
9039
  if ($isCodeNode(codeNode)) {
9190
9040
  content = codeNode.getTextContent();
9191
9041
  }
9192
- const selection = $getSelection();
9193
- $setSelection(selection);
9194
9042
  });
9195
9043
  try {
9196
9044
  await navigator.clipboard.writeText(content);
@@ -9200,20 +9048,29 @@ function CopyButton({ editor, getCodeDOMNode }) {
9200
9048
  console.error("Failed to copy: ", err);
9201
9049
  }
9202
9050
  }
9203
- return /* @__PURE__ */ jsx("button", { className: "menu-item", onClick: handleClick, "aria-label": "copy", children: isCopyCompleted ? /* @__PURE__ */ jsx("i", { className: "format success" }) : /* @__PURE__ */ jsx("i", { className: "format copy" }) });
9051
+ return /* @__PURE__ */ jsx(
9052
+ "button",
9053
+ {
9054
+ className: "menu-item",
9055
+ onClick: handleClick,
9056
+ onMouseDown: (e) => e.preventDefault(),
9057
+ "aria-label": "copy",
9058
+ children: isCopyCompleted ? /* @__PURE__ */ jsx("i", { className: "format success" }) : /* @__PURE__ */ jsx("i", { className: "format copy" })
9059
+ }
9060
+ );
9204
9061
  }
9205
9062
  const index$7 = "";
9206
9063
  const PRETTIER_PARSER_MODULES = {
9207
- css: [() => import("./postcss-f084f74d.js")],
9208
- html: [() => import("./html-5586dbf6.js")],
9064
+ css: [() => import("./postcss-c2592f3f.js")],
9065
+ html: [() => import("./html-f95ee5dc.js")],
9209
9066
  js: [
9210
- () => import("./babel-d3085146.js"),
9211
- () => import("./estree-164983f6.js")
9067
+ () => import("./babel-d155920e.js"),
9068
+ () => import("./estree-b1fff53b.js")
9212
9069
  ],
9213
- markdown: [() => import("./markdown-d513479b.js")],
9070
+ markdown: [() => import("./markdown-1d9e6c3f.js")],
9214
9071
  typescript: [
9215
- () => import("./typescript-b1005db4.js"),
9216
- () => import("./estree-164983f6.js")
9072
+ () => import("./typescript-48c10f50.js"),
9073
+ () => import("./estree-b1fff53b.js")
9217
9074
  ]
9218
9075
  };
9219
9076
  async function loadPrettierParserByLang(lang) {
@@ -9224,7 +9081,7 @@ async function loadPrettierParserByLang(lang) {
9224
9081
  return modules;
9225
9082
  }
9226
9083
  async function loadPrettierFormat() {
9227
- const { format } = await import("./standalone-5a8c6b7e.js");
9084
+ const { format } = await import("./standalone-bcc7f37a.js");
9228
9085
  return format;
9229
9086
  }
9230
9087
  const PRETTIER_OPTIONS_BY_LANG = {
@@ -9250,13 +9107,15 @@ function getPrettierOptions(lang) {
9250
9107
  function PrettierButton({ lang, editor, getCodeDOMNode }) {
9251
9108
  const [syntaxError, setSyntaxError] = useState$1("");
9252
9109
  const [tipsVisible, setTipsVisible] = useState$1(false);
9253
- async function handleClick() {
9110
+ async function handleClick(e) {
9111
+ e.preventDefault();
9112
+ e.stopPropagation();
9254
9113
  const codeDOMNode = getCodeDOMNode();
9255
9114
  if (!codeDOMNode) {
9256
9115
  return;
9257
9116
  }
9258
9117
  let content = "";
9259
- editor.update(() => {
9118
+ editor.read(() => {
9260
9119
  const codeNode = $getNearestNodeFromDOMNode(codeDOMNode);
9261
9120
  if ($isCodeNode(codeNode)) {
9262
9121
  content = codeNode.getTextContent();
@@ -9267,12 +9126,26 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
9267
9126
  }
9268
9127
  try {
9269
9128
  const format = await loadPrettierFormat();
9270
- const options = getPrettierOptions(lang);
9271
- const prettierParsers = await loadPrettierParserByLang(lang);
9129
+ let options = getPrettierOptions(lang);
9130
+ let prettierParsers = await loadPrettierParserByLang(lang);
9272
9131
  options.plugins = prettierParsers.map(
9273
9132
  (parser) => parser.default || parser
9274
9133
  );
9275
- const formattedCode = await format(content, options);
9134
+ let formattedCode;
9135
+ try {
9136
+ formattedCode = await format(content, options);
9137
+ } catch (firstError) {
9138
+ if (lang === "js" && firstError instanceof Error && (firstError.message.includes("Unexpected token") || firstError.message.includes("expected"))) {
9139
+ options = getPrettierOptions("typescript");
9140
+ prettierParsers = await loadPrettierParserByLang("typescript");
9141
+ options.plugins = prettierParsers.map(
9142
+ (parser) => parser.default || parser
9143
+ );
9144
+ formattedCode = await format(content, options);
9145
+ } else {
9146
+ throw firstError;
9147
+ }
9148
+ }
9276
9149
  editor.update(() => {
9277
9150
  const codeNode = $getNearestNodeFromDOMNode(codeDOMNode);
9278
9151
  if ($isCodeNode(codeNode)) {
@@ -9281,7 +9154,7 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
9281
9154
  setSyntaxError("");
9282
9155
  setTipsVisible(false);
9283
9156
  }
9284
- });
9157
+ }, { discrete: true, tag: "prettier-format" });
9285
9158
  } catch (error) {
9286
9159
  setError(error);
9287
9160
  }
@@ -9310,6 +9183,7 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
9310
9183
  {
9311
9184
  className: "menu-item",
9312
9185
  onClick: handleClick,
9186
+ onMouseDown: (e) => e.preventDefault(),
9313
9187
  onMouseEnter: handleMouseEnter,
9314
9188
  onMouseLeave: handleMouseLeave,
9315
9189
  "aria-label": "prettier",
@@ -9684,199 +9558,6 @@ function $createCommentedTextNode(text, commentId, commentText, commentAuthor, c
9684
9558
  function $isCommentedTextNode(node) {
9685
9559
  return node instanceof CommentedTextNode;
9686
9560
  }
9687
- function createContextScope(scopeName, createContextScopeDeps = []) {
9688
- let defaultContexts = [];
9689
- function createContext3(rootComponentName, defaultContext) {
9690
- const BaseContext = React$1.createContext(defaultContext);
9691
- BaseContext.displayName = rootComponentName + "Context";
9692
- const index2 = defaultContexts.length;
9693
- defaultContexts = [...defaultContexts, defaultContext];
9694
- const Provider2 = (props) => {
9695
- var _a;
9696
- const { scope, children, ...context } = props;
9697
- const Context2 = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
9698
- const value = React$1.useMemo(() => context, Object.values(context));
9699
- return /* @__PURE__ */ jsx(Context2.Provider, { value, children });
9700
- };
9701
- Provider2.displayName = rootComponentName + "Provider";
9702
- function useContext2(consumerName, scope) {
9703
- var _a;
9704
- const Context2 = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
9705
- const context = React$1.useContext(Context2);
9706
- if (context)
9707
- return context;
9708
- if (defaultContext !== void 0)
9709
- return defaultContext;
9710
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
9711
- }
9712
- return [Provider2, useContext2];
9713
- }
9714
- const createScope = () => {
9715
- const scopeContexts = defaultContexts.map((defaultContext) => {
9716
- return React$1.createContext(defaultContext);
9717
- });
9718
- return function useScope(scope) {
9719
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
9720
- return React$1.useMemo(
9721
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
9722
- [scope, contexts]
9723
- );
9724
- };
9725
- };
9726
- createScope.scopeName = scopeName;
9727
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
9728
- }
9729
- function composeContextScopes(...scopes) {
9730
- const baseScope = scopes[0];
9731
- if (scopes.length === 1)
9732
- return baseScope;
9733
- const createScope = () => {
9734
- const scopeHooks = scopes.map((createScope2) => ({
9735
- useScope: createScope2(),
9736
- scopeName: createScope2.scopeName
9737
- }));
9738
- return function useComposedScopes(overrideScopes) {
9739
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
9740
- const scopeProps = useScope(overrideScopes);
9741
- const currentScope = scopeProps[`__scope${scopeName}`];
9742
- return { ...nextScopes2, ...currentScope };
9743
- }, {});
9744
- return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
9745
- };
9746
- };
9747
- createScope.scopeName = baseScope.scopeName;
9748
- return createScope;
9749
- }
9750
- var REACT_LAZY_TYPE$1 = Symbol.for("react.lazy");
9751
- var use$1 = React$1[" use ".trim().toString()];
9752
- function isPromiseLike$1(value) {
9753
- return typeof value === "object" && value !== null && "then" in value;
9754
- }
9755
- function isLazyComponent$1(element) {
9756
- return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$1 && "_payload" in element && isPromiseLike$1(element._payload);
9757
- }
9758
- // @__NO_SIDE_EFFECTS__
9759
- function createSlot$1(ownerName) {
9760
- const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
9761
- const Slot2 = React$1.forwardRef((props, forwardedRef) => {
9762
- let { children, ...slotProps } = props;
9763
- if (isLazyComponent$1(children) && typeof use$1 === "function") {
9764
- children = use$1(children._payload);
9765
- }
9766
- const childrenArray = React$1.Children.toArray(children);
9767
- const slottable = childrenArray.find(isSlottable$1);
9768
- if (slottable) {
9769
- const newElement = slottable.props.children;
9770
- const newChildren = childrenArray.map((child) => {
9771
- if (child === slottable) {
9772
- if (React$1.Children.count(newElement) > 1)
9773
- return React$1.Children.only(null);
9774
- return React$1.isValidElement(newElement) ? newElement.props.children : null;
9775
- } else {
9776
- return child;
9777
- }
9778
- });
9779
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
9780
- }
9781
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
9782
- });
9783
- Slot2.displayName = `${ownerName}.Slot`;
9784
- return Slot2;
9785
- }
9786
- // @__NO_SIDE_EFFECTS__
9787
- function createSlotClone$1(ownerName) {
9788
- const SlotClone = React$1.forwardRef((props, forwardedRef) => {
9789
- let { children, ...slotProps } = props;
9790
- if (isLazyComponent$1(children) && typeof use$1 === "function") {
9791
- children = use$1(children._payload);
9792
- }
9793
- if (React$1.isValidElement(children)) {
9794
- const childrenRef = getElementRef$1(children);
9795
- const props2 = mergeProps$1(slotProps, children.props);
9796
- if (children.type !== React$1.Fragment) {
9797
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
9798
- }
9799
- return React$1.cloneElement(children, props2);
9800
- }
9801
- return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
9802
- });
9803
- SlotClone.displayName = `${ownerName}.SlotClone`;
9804
- return SlotClone;
9805
- }
9806
- var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
9807
- function isSlottable$1(child) {
9808
- return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
9809
- }
9810
- function mergeProps$1(slotProps, childProps) {
9811
- const overrideProps = { ...childProps };
9812
- for (const propName in childProps) {
9813
- const slotPropValue = slotProps[propName];
9814
- const childPropValue = childProps[propName];
9815
- const isHandler = /^on[A-Z]/.test(propName);
9816
- if (isHandler) {
9817
- if (slotPropValue && childPropValue) {
9818
- overrideProps[propName] = (...args) => {
9819
- const result = childPropValue(...args);
9820
- slotPropValue(...args);
9821
- return result;
9822
- };
9823
- } else if (slotPropValue) {
9824
- overrideProps[propName] = slotPropValue;
9825
- }
9826
- } else if (propName === "style") {
9827
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
9828
- } else if (propName === "className") {
9829
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
9830
- }
9831
- }
9832
- return { ...slotProps, ...overrideProps };
9833
- }
9834
- function getElementRef$1(element) {
9835
- var _a, _b;
9836
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
9837
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
9838
- if (mayWarn) {
9839
- return element.ref;
9840
- }
9841
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
9842
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
9843
- if (mayWarn) {
9844
- return element.props.ref;
9845
- }
9846
- return element.props.ref || element.ref;
9847
- }
9848
- var NODES$1 = [
9849
- "a",
9850
- "button",
9851
- "div",
9852
- "form",
9853
- "h2",
9854
- "h3",
9855
- "img",
9856
- "input",
9857
- "label",
9858
- "li",
9859
- "nav",
9860
- "ol",
9861
- "p",
9862
- "select",
9863
- "span",
9864
- "svg",
9865
- "ul"
9866
- ];
9867
- var Primitive$1 = NODES$1.reduce((primitive, node) => {
9868
- const Slot2 = /* @__PURE__ */ createSlot$1(`Primitive.${node}`);
9869
- const Node2 = React$1.forwardRef((props, forwardedRef) => {
9870
- const { asChild, ...primitiveProps } = props;
9871
- const Comp = asChild ? Slot2 : node;
9872
- if (typeof window !== "undefined") {
9873
- window[Symbol.for("radix-ui")] = true;
9874
- }
9875
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
9876
- });
9877
- Node2.displayName = `Primitive.${node}`;
9878
- return { ...primitive, [node]: Node2 };
9879
- }, {});
9880
9561
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
9881
9562
  function getDefaultExportFromCjs(x2) {
9882
9563
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -9962,7 +9643,7 @@ var Avatar$1 = React$1.forwardRef(
9962
9643
  scope: __scopeAvatar,
9963
9644
  imageLoadingStatus,
9964
9645
  onImageLoadingStatusChange: setImageLoadingStatus,
9965
- children: /* @__PURE__ */ jsx(Primitive$1.span, { ...avatarProps, ref: forwardedRef })
9646
+ children: /* @__PURE__ */ jsx(Primitive.span, { ...avatarProps, ref: forwardedRef })
9966
9647
  }
9967
9648
  );
9968
9649
  }
@@ -9984,7 +9665,7 @@ var AvatarImage$1 = React$1.forwardRef(
9984
9665
  handleLoadingStatusChange(imageLoadingStatus);
9985
9666
  }
9986
9667
  }, [imageLoadingStatus, handleLoadingStatusChange]);
9987
- return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive$1.img, { ...imageProps, ref: forwardedRef, src }) : null;
9668
+ return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
9988
9669
  }
9989
9670
  );
9990
9671
  AvatarImage$1.displayName = IMAGE_NAME;
@@ -10000,7 +9681,7 @@ var AvatarFallback$1 = React$1.forwardRef(
10000
9681
  return () => window.clearTimeout(timerId);
10001
9682
  }
10002
9683
  }, [delayMs]);
10003
- return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive$1.span, { ...fallbackProps, ref: forwardedRef }) : null;
9684
+ return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
10004
9685
  }
10005
9686
  );
10006
9687
  AvatarFallback$1.displayName = FALLBACK_NAME;
@@ -10145,136 +9826,6 @@ const CardFooter = React$1.forwardRef(({ className, ...props }, ref) => /* @__PU
10145
9826
  }
10146
9827
  ));
10147
9828
  CardFooter.displayName = "CardFooter";
10148
- var REACT_LAZY_TYPE = Symbol.for("react.lazy");
10149
- var use = React$1[" use ".trim().toString()];
10150
- function isPromiseLike(value) {
10151
- return typeof value === "object" && value !== null && "then" in value;
10152
- }
10153
- function isLazyComponent(element) {
10154
- return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
10155
- }
10156
- // @__NO_SIDE_EFFECTS__
10157
- function createSlot(ownerName) {
10158
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
10159
- const Slot2 = React$1.forwardRef((props, forwardedRef) => {
10160
- let { children, ...slotProps } = props;
10161
- if (isLazyComponent(children) && typeof use === "function") {
10162
- children = use(children._payload);
10163
- }
10164
- const childrenArray = React$1.Children.toArray(children);
10165
- const slottable = childrenArray.find(isSlottable);
10166
- if (slottable) {
10167
- const newElement = slottable.props.children;
10168
- const newChildren = childrenArray.map((child) => {
10169
- if (child === slottable) {
10170
- if (React$1.Children.count(newElement) > 1)
10171
- return React$1.Children.only(null);
10172
- return React$1.isValidElement(newElement) ? newElement.props.children : null;
10173
- } else {
10174
- return child;
10175
- }
10176
- });
10177
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null });
10178
- }
10179
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
10180
- });
10181
- Slot2.displayName = `${ownerName}.Slot`;
10182
- return Slot2;
10183
- }
10184
- // @__NO_SIDE_EFFECTS__
10185
- function createSlotClone(ownerName) {
10186
- const SlotClone = React$1.forwardRef((props, forwardedRef) => {
10187
- let { children, ...slotProps } = props;
10188
- if (isLazyComponent(children) && typeof use === "function") {
10189
- children = use(children._payload);
10190
- }
10191
- if (React$1.isValidElement(children)) {
10192
- const childrenRef = getElementRef(children);
10193
- const props2 = mergeProps(slotProps, children.props);
10194
- if (children.type !== React$1.Fragment) {
10195
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
10196
- }
10197
- return React$1.cloneElement(children, props2);
10198
- }
10199
- return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
10200
- });
10201
- SlotClone.displayName = `${ownerName}.SlotClone`;
10202
- return SlotClone;
10203
- }
10204
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
10205
- function isSlottable(child) {
10206
- return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
10207
- }
10208
- function mergeProps(slotProps, childProps) {
10209
- const overrideProps = { ...childProps };
10210
- for (const propName in childProps) {
10211
- const slotPropValue = slotProps[propName];
10212
- const childPropValue = childProps[propName];
10213
- const isHandler = /^on[A-Z]/.test(propName);
10214
- if (isHandler) {
10215
- if (slotPropValue && childPropValue) {
10216
- overrideProps[propName] = (...args) => {
10217
- const result = childPropValue(...args);
10218
- slotPropValue(...args);
10219
- return result;
10220
- };
10221
- } else if (slotPropValue) {
10222
- overrideProps[propName] = slotPropValue;
10223
- }
10224
- } else if (propName === "style") {
10225
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
10226
- } else if (propName === "className") {
10227
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
10228
- }
10229
- }
10230
- return { ...slotProps, ...overrideProps };
10231
- }
10232
- function getElementRef(element) {
10233
- var _a, _b;
10234
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
10235
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10236
- if (mayWarn) {
10237
- return element.ref;
10238
- }
10239
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
10240
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10241
- if (mayWarn) {
10242
- return element.props.ref;
10243
- }
10244
- return element.props.ref || element.ref;
10245
- }
10246
- var NODES = [
10247
- "a",
10248
- "button",
10249
- "div",
10250
- "form",
10251
- "h2",
10252
- "h3",
10253
- "img",
10254
- "input",
10255
- "label",
10256
- "li",
10257
- "nav",
10258
- "ol",
10259
- "p",
10260
- "select",
10261
- "span",
10262
- "svg",
10263
- "ul"
10264
- ];
10265
- var Primitive = NODES.reduce((primitive, node) => {
10266
- const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
10267
- const Node2 = React$1.forwardRef((props, forwardedRef) => {
10268
- const { asChild, ...primitiveProps } = props;
10269
- const Comp = asChild ? Slot2 : node;
10270
- if (typeof window !== "undefined") {
10271
- window[Symbol.for("radix-ui")] = true;
10272
- }
10273
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
10274
- });
10275
- Node2.displayName = `Primitive.${node}`;
10276
- return { ...primitive, [node]: Node2 };
10277
- }, {});
10278
9829
  var NAME$3 = "Separator";
10279
9830
  var DEFAULT_ORIENTATION = "horizontal";
10280
9831
  var ORIENTATIONS = ["horizontal", "vertical"];
@@ -10401,7 +9952,7 @@ const SheetDescription = React$1.forwardRef(({ className, ...props }, ref) => /*
10401
9952
  SheetDescription.displayName = Description.displayName;
10402
9953
  function createCollection(name) {
10403
9954
  const PROVIDER_NAME2 = name + "CollectionProvider";
10404
- const [createCollectionContext, createCollectionScope2] = createContextScope$1(PROVIDER_NAME2);
9955
+ const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
10405
9956
  const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
10406
9957
  PROVIDER_NAME2,
10407
9958
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
@@ -10414,7 +9965,7 @@ function createCollection(name) {
10414
9965
  };
10415
9966
  CollectionProvider.displayName = PROVIDER_NAME2;
10416
9967
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
10417
- const CollectionSlotImpl = /* @__PURE__ */ createSlot$3(COLLECTION_SLOT_NAME);
9968
+ const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
10418
9969
  const CollectionSlot = React__default.forwardRef(
10419
9970
  (props, forwardedRef) => {
10420
9971
  const { scope, children } = props;
@@ -10426,7 +9977,7 @@ function createCollection(name) {
10426
9977
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
10427
9978
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
10428
9979
  const ITEM_DATA_ATTR = "data-radix-collection-item";
10429
- const CollectionItemSlotImpl = /* @__PURE__ */ createSlot$3(ITEM_SLOT_NAME);
9980
+ const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
10430
9981
  const CollectionItemSlot = React__default.forwardRef(
10431
9982
  (props, forwardedRef) => {
10432
9983
  const { scope, children, ...itemData } = props;
@@ -10471,7 +10022,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
10471
10022
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
10472
10023
  var GROUP_NAME$3 = "RovingFocusGroup";
10473
10024
  var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(GROUP_NAME$3);
10474
- var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$1(
10025
+ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
10475
10026
  GROUP_NAME$3,
10476
10027
  [createCollectionScope$2]
10477
10028
  );
@@ -10538,7 +10089,7 @@ var RovingFocusGroupImpl = React$1.forwardRef((props, forwardedRef) => {
10538
10089
  []
10539
10090
  ),
10540
10091
  children: /* @__PURE__ */ jsx(
10541
- Primitive$3.div,
10092
+ Primitive.div,
10542
10093
  {
10543
10094
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
10544
10095
  "data-orientation": orientation,
@@ -10603,7 +10154,7 @@ var RovingFocusGroupItem = React$1.forwardRef(
10603
10154
  focusable,
10604
10155
  active,
10605
10156
  children: /* @__PURE__ */ jsx(
10606
- Primitive$3.span,
10157
+ Primitive.span,
10607
10158
  {
10608
10159
  tabIndex: isCurrentTabStop ? 0 : -1,
10609
10160
  "data-orientation": context.orientation,
@@ -10688,7 +10239,7 @@ function wrapArray$2(array, startIndex) {
10688
10239
  var Root$2 = RovingFocusGroup;
10689
10240
  var Item$1 = RovingFocusGroupItem;
10690
10241
  var TABS_NAME = "Tabs";
10691
- var [createTabsContext, createTabsScope] = createContextScope$1(TABS_NAME, [
10242
+ var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
10692
10243
  createRovingFocusGroupScope
10693
10244
  ]);
10694
10245
  var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
@@ -10723,7 +10274,7 @@ var Tabs$1 = React$1.forwardRef(
10723
10274
  dir: direction,
10724
10275
  activationMode,
10725
10276
  children: /* @__PURE__ */ jsx(
10726
- Primitive$3.div,
10277
+ Primitive.div,
10727
10278
  {
10728
10279
  dir: direction,
10729
10280
  "data-orientation": orientation,
@@ -10751,7 +10302,7 @@ var TabsList$1 = React$1.forwardRef(
10751
10302
  dir: context.dir,
10752
10303
  loop,
10753
10304
  children: /* @__PURE__ */ jsx(
10754
- Primitive$3.div,
10305
+ Primitive.div,
10755
10306
  {
10756
10307
  role: "tablist",
10757
10308
  "aria-orientation": context.orientation,
@@ -10781,7 +10332,7 @@ var TabsTrigger$1 = React$1.forwardRef(
10781
10332
  focusable: !disabled,
10782
10333
  active: isSelected,
10783
10334
  children: /* @__PURE__ */ jsx(
10784
- Primitive$3.button,
10335
+ Primitive.button,
10785
10336
  {
10786
10337
  type: "button",
10787
10338
  role: "tab",
@@ -10831,7 +10382,7 @@ var TabsContent$1 = React$1.forwardRef(
10831
10382
  return () => cancelAnimationFrame(rAF);
10832
10383
  }, []);
10833
10384
  return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
10834
- Primitive$3.div,
10385
+ Primitive.div,
10835
10386
  {
10836
10387
  "data-state": isSelected ? "active" : "inactive",
10837
10388
  "data-orientation": context.orientation,
@@ -13253,7 +12804,7 @@ var NAME$2 = "Arrow";
13253
12804
  var Arrow$1 = React$1.forwardRef((props, forwardedRef) => {
13254
12805
  const { children, width = 10, height = 5, ...arrowProps } = props;
13255
12806
  return /* @__PURE__ */ jsx(
13256
- Primitive$3.svg,
12807
+ Primitive.svg,
13257
12808
  {
13258
12809
  ...arrowProps,
13259
12810
  ref: forwardedRef,
@@ -13302,7 +12853,7 @@ function useSize(element) {
13302
12853
  return size2;
13303
12854
  }
13304
12855
  var POPPER_NAME = "Popper";
13305
- var [createPopperContext, createPopperScope] = createContextScope$1(POPPER_NAME);
12856
+ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
13306
12857
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
13307
12858
  var Popper = (props) => {
13308
12859
  const { __scopePopper, children } = props;
@@ -13325,7 +12876,7 @@ var PopperAnchor = React$1.forwardRef(
13325
12876
  context.onAnchorChange(anchorRef.current);
13326
12877
  }
13327
12878
  });
13328
- return virtualRef ? null : /* @__PURE__ */ jsx(Primitive$3.div, { ...anchorProps, ref: composedRefs });
12879
+ return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
13329
12880
  }
13330
12881
  );
13331
12882
  PopperAnchor.displayName = ANCHOR_NAME$2;
@@ -13454,7 +13005,7 @@ var PopperContent = React$1.forwardRef(
13454
13005
  arrowY,
13455
13006
  shouldHideArrow: cannotCenterArrow,
13456
13007
  children: /* @__PURE__ */ jsx(
13457
- Primitive$3.div,
13008
+ Primitive.div,
13458
13009
  {
13459
13010
  "data-side": placedSide,
13460
13011
  "data-align": placedAlign,
@@ -13590,7 +13141,7 @@ var NAME$1 = "VisuallyHidden";
13590
13141
  var VisuallyHidden = React$1.forwardRef(
13591
13142
  (props, forwardedRef) => {
13592
13143
  return /* @__PURE__ */ jsx(
13593
- Primitive$3.span,
13144
+ Primitive.span,
13594
13145
  {
13595
13146
  ...props,
13596
13147
  ref: forwardedRef,
@@ -13601,7 +13152,7 @@ var VisuallyHidden = React$1.forwardRef(
13601
13152
  );
13602
13153
  VisuallyHidden.displayName = NAME$1;
13603
13154
  var Root = VisuallyHidden;
13604
- var [createTooltipContext, createTooltipScope] = createContextScope$1("Tooltip", [
13155
+ var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
13605
13156
  createPopperScope
13606
13157
  ]);
13607
13158
  var usePopperScope$3 = createPopperScope();
@@ -13762,7 +13313,7 @@ var TooltipTrigger$1 = React$1.forwardRef(
13762
13313
  return () => document.removeEventListener("pointerup", handlePointerUp);
13763
13314
  }, [handlePointerUp]);
13764
13315
  return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
13765
- Primitive$3.button,
13316
+ Primitive.button,
13766
13317
  {
13767
13318
  "aria-describedby": context.open ? context.contentId : void 0,
13768
13319
  "data-state": context.stateAttribute,
@@ -14114,7 +13665,7 @@ const CommentToggle = ({
14114
13665
  return /* @__PURE__ */ jsx(
14115
13666
  "div",
14116
13667
  {
14117
- className: "cteditor-flex cteditor-bg-background cteditor-text-foreground cteditor-px-2.5 cteditor-py-[7px] cteditor-rounded-lg cteditor-h-11 cteditor-items-center cteditor-justify-center cteditor-ml-2\n",
13668
+ className: "cteditor-flex cteditor-bg-background cteditor-text-foreground cteditor-px-2.5 cteditor-py-[7px] cteditor-rounded-lg cteditor-h-11 cteditor-items-center cteditor-justify-center cteditor-ml-2\r\n",
14118
13669
  children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
14119
13670
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
14120
13671
  Button,
@@ -14385,7 +13936,7 @@ const HtmlViewDisplay = () => {
14385
13936
  onBlur: handleTextareaBlur,
14386
13937
  onClick: handleTextareaClick,
14387
13938
  onKeyDown: handleTextareaKeyDown,
14388
- className: " cteditor-w-full cteditor-flex-1\n cteditor-font-mono cteditor-text-[13px] \n cteditor-p-3 \n cteditor-border cteditor-rounded-lg \n cteditor-resize-y cteditor-leading-[1.4] \n cteditor-outline-none cteditor-transition-colors cteditor-duration-200 \n cteditor-whitespace-pre-wrap cteditor-break-words\n",
13939
+ className: " cteditor-w-full cteditor-flex-1\r\n cteditor-font-mono cteditor-text-[13px] \r\n cteditor-p-3 \r\n cteditor-border cteditor-rounded-lg \r\n cteditor-resize-y cteditor-leading-[1.4] \r\n cteditor-outline-none cteditor-transition-colors cteditor-duration-200 \r\n cteditor-whitespace-pre-wrap cteditor-break-words\r\n",
14389
13940
  placeholder: "HTML content will appear here... Edit and click 'Sync to Editor' to apply changes."
14390
13941
  }
14391
13942
  )
@@ -15337,7 +14888,7 @@ const EmbedComponent = ({ url, displayType, alignment, nodeKey }) => {
15337
14888
  }
15338
14889
  );
15339
14890
  };
15340
- const FileComponent = React$1.lazy(() => import("./index-68135c09.js"));
14891
+ const FileComponent = React$1.lazy(() => import("./index-b8db2529.js"));
15341
14892
  function convertFileElement(domNode) {
15342
14893
  if (domNode instanceof HTMLDivElement) {
15343
14894
  const dataUrl = domNode.getAttribute("data-lexical-file-src");
@@ -15820,7 +15371,7 @@ var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
15820
15371
  var SELECTION_KEYS$1 = [" ", "Enter"];
15821
15372
  var SELECT_NAME = "Select";
15822
15373
  var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(SELECT_NAME);
15823
- var [createSelectContext, createSelectScope] = createContextScope$1(SELECT_NAME, [
15374
+ var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
15824
15375
  createCollectionScope$1,
15825
15376
  createPopperScope
15826
15377
  ]);
@@ -15957,7 +15508,7 @@ var SelectTrigger$1 = React$1.forwardRef(
15957
15508
  }
15958
15509
  };
15959
15510
  return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
15960
- Primitive$3.button,
15511
+ Primitive.button,
15961
15512
  {
15962
15513
  type: "button",
15963
15514
  role: "combobox",
@@ -16018,7 +15569,7 @@ var SelectValue$1 = React$1.forwardRef(
16018
15569
  onValueNodeHasChildrenChange(hasChildren);
16019
15570
  }, [onValueNodeHasChildrenChange, hasChildren]);
16020
15571
  return /* @__PURE__ */ jsx(
16021
- Primitive$3.span,
15572
+ Primitive.span,
16022
15573
  {
16023
15574
  ...valueProps,
16024
15575
  ref: composedRefs,
@@ -16033,7 +15584,7 @@ var ICON_NAME = "SelectIcon";
16033
15584
  var SelectIcon = React$1.forwardRef(
16034
15585
  (props, forwardedRef) => {
16035
15586
  const { __scopeSelect, children, ...iconProps } = props;
16036
- return /* @__PURE__ */ jsx(Primitive$3.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
15587
+ return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
16037
15588
  }
16038
15589
  );
16039
15590
  SelectIcon.displayName = ICON_NAME;
@@ -16064,7 +15615,7 @@ SelectContent$1.displayName = CONTENT_NAME$3;
16064
15615
  var CONTENT_MARGIN = 10;
16065
15616
  var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$3);
16066
15617
  var CONTENT_IMPL_NAME = "SelectContentImpl";
16067
- var Slot$2 = /* @__PURE__ */ createSlot$3("SelectContent.RemoveScroll");
15618
+ var Slot$2 = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
16068
15619
  var SelectContentImpl = React$1.forwardRef(
16069
15620
  (props, forwardedRef) => {
16070
15621
  const {
@@ -16453,7 +16004,7 @@ var SelectItemAlignedPosition = React$1.forwardRef((props, forwardedRef) => {
16453
16004
  zIndex: contentZIndex
16454
16005
  },
16455
16006
  children: /* @__PURE__ */ jsx(
16456
- Primitive$3.div,
16007
+ Primitive.div,
16457
16008
  {
16458
16009
  ...popperProps,
16459
16010
  ref: composedRefs,
@@ -16527,7 +16078,7 @@ var SelectViewport = React$1.forwardRef(
16527
16078
  }
16528
16079
  ),
16529
16080
  /* @__PURE__ */ jsx(Collection$1.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
16530
- Primitive$3.div,
16081
+ Primitive.div,
16531
16082
  {
16532
16083
  "data-radix-select-viewport": "",
16533
16084
  role: "presentation",
@@ -16582,7 +16133,7 @@ var SelectGroup = React$1.forwardRef(
16582
16133
  (props, forwardedRef) => {
16583
16134
  const { __scopeSelect, ...groupProps } = props;
16584
16135
  const groupId = useId();
16585
- return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive$3.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
16136
+ return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
16586
16137
  }
16587
16138
  );
16588
16139
  SelectGroup.displayName = GROUP_NAME$2;
@@ -16591,7 +16142,7 @@ var SelectLabel$1 = React$1.forwardRef(
16591
16142
  (props, forwardedRef) => {
16592
16143
  const { __scopeSelect, ...labelProps } = props;
16593
16144
  const groupContext = useSelectGroupContext(LABEL_NAME$2, __scopeSelect);
16594
- return /* @__PURE__ */ jsx(Primitive$3.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
16145
+ return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
16595
16146
  }
16596
16147
  );
16597
16148
  SelectLabel$1.displayName = LABEL_NAME$2;
@@ -16650,7 +16201,7 @@ var SelectItem$1 = React$1.forwardRef(
16650
16201
  disabled,
16651
16202
  textValue,
16652
16203
  children: /* @__PURE__ */ jsx(
16653
- Primitive$3.div,
16204
+ Primitive.div,
16654
16205
  {
16655
16206
  role: "option",
16656
16207
  "aria-labelledby": textId,
@@ -16738,7 +16289,7 @@ var SelectItemText = React$1.forwardRef(
16738
16289
  return () => onNativeOptionRemove(nativeOption);
16739
16290
  }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
16740
16291
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16741
- /* @__PURE__ */ jsx(Primitive$3.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
16292
+ /* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
16742
16293
  itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null
16743
16294
  ] });
16744
16295
  }
@@ -16749,7 +16300,7 @@ var SelectItemIndicator = React$1.forwardRef(
16749
16300
  (props, forwardedRef) => {
16750
16301
  const { __scopeSelect, ...itemIndicatorProps } = props;
16751
16302
  const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME$1, __scopeSelect);
16752
- return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive$3.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
16303
+ return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
16753
16304
  }
16754
16305
  );
16755
16306
  SelectItemIndicator.displayName = ITEM_INDICATOR_NAME$1;
@@ -16840,7 +16391,7 @@ var SelectScrollButtonImpl = React$1.forwardRef((props, forwardedRef) => {
16840
16391
  (_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
16841
16392
  }, [getItems]);
16842
16393
  return /* @__PURE__ */ jsx(
16843
- Primitive$3.div,
16394
+ Primitive.div,
16844
16395
  {
16845
16396
  "aria-hidden": true,
16846
16397
  ...scrollIndicatorProps,
@@ -16868,7 +16419,7 @@ var SEPARATOR_NAME$2 = "SelectSeparator";
16868
16419
  var SelectSeparator$1 = React$1.forwardRef(
16869
16420
  (props, forwardedRef) => {
16870
16421
  const { __scopeSelect, ...separatorProps } = props;
16871
- return /* @__PURE__ */ jsx(Primitive$3.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
16422
+ return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
16872
16423
  }
16873
16424
  );
16874
16425
  SelectSeparator$1.displayName = SEPARATOR_NAME$2;
@@ -16906,7 +16457,7 @@ var SelectBubbleInput = React$1.forwardRef(
16906
16457
  }
16907
16458
  }, [prevValue, value]);
16908
16459
  return /* @__PURE__ */ jsx(
16909
- Primitive$3.select,
16460
+ Primitive.select,
16910
16461
  {
16911
16462
  ...props,
16912
16463
  style: { ...VISUALLY_HIDDEN_STYLES, ...props.style },
@@ -19132,6 +18683,7 @@ function AIChatDialog({
19132
18683
  const [provider, setProvider] = useState$1("chatgpt");
19133
18684
  const [costPerPrompt, setCostPerPrompt] = useState$1(1);
19134
18685
  const [remainingCredits, setRemainingCredits] = useState$1(0);
18686
+ const [purchasedCredits, setPurchasedCredits] = useState$1(0);
19135
18687
  useEffect$1(() => {
19136
18688
  if (open && initialText) {
19137
18689
  setInputValue(initialText);
@@ -19164,11 +18716,13 @@ function AIChatDialog({
19164
18716
  if (isMounted && info) {
19165
18717
  setCostPerPrompt(Number(info.costPerPrompt ?? 1));
19166
18718
  setRemainingCredits(Number(info.remainingCredits ?? 0));
18719
+ setPurchasedCredits(Number(info.purchasedCredits ?? 0));
19167
18720
  }
19168
18721
  } catch (_) {
19169
18722
  if (isMounted) {
19170
18723
  setCostPerPrompt(1);
19171
18724
  setRemainingCredits(0);
18725
+ setPurchasedCredits(0);
19172
18726
  }
19173
18727
  }
19174
18728
  };
@@ -19177,24 +18731,58 @@ function AIChatDialog({
19177
18731
  isMounted = false;
19178
18732
  };
19179
18733
  }, [apiKey]);
18734
+ const isImageGenerationRequest = (prompt) => {
18735
+ const lowerPrompt = prompt.toLowerCase();
18736
+ const imageKeywords = [
18737
+ "generate image",
18738
+ "generate an image",
18739
+ "create image",
18740
+ "create an image",
18741
+ "make image",
18742
+ "make an image",
18743
+ "draw",
18744
+ "illustration",
18745
+ "picture of",
18746
+ "image of",
18747
+ "photo of",
18748
+ "generate picture",
18749
+ "create picture",
18750
+ "visualize",
18751
+ "render image",
18752
+ "design image",
18753
+ "produce image"
18754
+ ];
18755
+ return imageKeywords.some((keyword) => lowerPrompt.includes(keyword));
18756
+ };
19180
18757
  const handleSubmit = async () => {
19181
18758
  var _a, _b;
19182
18759
  if (!inputValue.trim() || isLoading)
19183
18760
  return;
19184
18761
  setIsLoading(true);
19185
18762
  setErrorMessage(null);
18763
+ const isImageRequest = isImageGenerationRequest(inputValue);
19186
18764
  try {
19187
18765
  const response = await AiEditorAction({ content: inputValue, provider, apiKey });
19188
18766
  const htmlString = response.data;
19189
- editor.update(() => {
19190
- const parser = new DOMParser();
19191
- const dom = parser.parseFromString(htmlString.trim(), "text/html");
19192
- const nodes = $generateNodesFromDOM(editor, dom);
19193
- const currentSelection = $getSelection();
19194
- if (currentSelection) {
19195
- $insertNodes(nodes);
19196
- }
19197
- });
18767
+ const parser = new DOMParser();
18768
+ const dom = parser.parseFromString(htmlString.trim(), "text/html");
18769
+ const imgElement = dom.querySelector("img");
18770
+ if (isImageRequest && imgElement && imgElement.src) {
18771
+ editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
18772
+ src: imgElement.src,
18773
+ altText: imgElement.alt || "AI generated image",
18774
+ originalPrompt: inputValue
18775
+ // Store the prompt for refinement
18776
+ });
18777
+ } else {
18778
+ editor.update(() => {
18779
+ const nodes = $generateNodesFromDOM(editor, dom);
18780
+ const currentSelection = $getSelection();
18781
+ if (currentSelection) {
18782
+ $insertNodes(nodes);
18783
+ }
18784
+ });
18785
+ }
19198
18786
  handleClose();
19199
18787
  setIsLoading(false);
19200
18788
  } catch (error) {
@@ -19253,8 +18841,12 @@ function AIChatDialog({
19253
18841
  ] })
19254
18842
  ] }),
19255
18843
  /* @__PURE__ */ jsxs("span", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-1 cteditor-rounded-md cteditor-bg-accent cteditor-px-2 cteditor-py-0.5", children: [
19256
- /* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "Remaining" }),
19257
- /* @__PURE__ */ jsx("span", { className: "cteditor-font-medium", children: remainingCredits })
18844
+ /* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "Total" }),
18845
+ /* @__PURE__ */ jsx("span", { className: "cteditor-font-medium", children: remainingCredits + purchasedCredits })
18846
+ ] }),
18847
+ purchasedCredits > 0 && /* @__PURE__ */ jsxs("span", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-1 cteditor-rounded-md cteditor-bg-green-500/10 cteditor-px-2 cteditor-py-0.5", children: [
18848
+ /* @__PURE__ */ jsx("span", { className: "cteditor-opacity-70", children: "Purchased" }),
18849
+ /* @__PURE__ */ jsx("span", { className: "cteditor-font-medium cteditor-text-green-600", children: purchasedCredits })
19258
18850
  ] })
19259
18851
  ] })
19260
18852
  ] }),
@@ -19434,6 +19026,7 @@ function InlineAIPrompt({
19434
19026
  const [provider, setProvider] = useState$1(initialProvider);
19435
19027
  const [inputValue, setInputValue] = useState$1("");
19436
19028
  const [isLoading, setIsLoading] = useState$1(false);
19029
+ const [status, setStatus] = useState$1("idle");
19437
19030
  const inputRef = useRef(null);
19438
19031
  const [selectedText, setSelectedText] = useState$1(initialSelectedText);
19439
19032
  useEffect$1(() => {
@@ -19444,6 +19037,7 @@ function InlineAIPrompt({
19444
19037
  const newSelectedText = selection.getTextContent();
19445
19038
  if (newSelectedText.trim() !== "") {
19446
19039
  setSelectedText(newSelectedText);
19040
+ setStatus("idle");
19447
19041
  }
19448
19042
  }
19449
19043
  });
@@ -19457,23 +19051,56 @@ function InlineAIPrompt({
19457
19051
  inputRef.current.focus();
19458
19052
  }
19459
19053
  }, []);
19054
+ const isImageGenerationRequest = (prompt) => {
19055
+ const lowerPrompt = prompt.toLowerCase();
19056
+ const imageKeywords = [
19057
+ "generate image",
19058
+ "generate an image",
19059
+ "create image",
19060
+ "create an image",
19061
+ "make image",
19062
+ "make an image",
19063
+ "draw",
19064
+ "illustration",
19065
+ "picture of",
19066
+ "image of",
19067
+ "photo of",
19068
+ "generate picture",
19069
+ "create picture",
19070
+ "visualize",
19071
+ "render image",
19072
+ "design image",
19073
+ "produce image"
19074
+ ];
19075
+ return imageKeywords.some((keyword) => lowerPrompt.includes(keyword));
19076
+ };
19460
19077
  const handleSubmit = async () => {
19461
19078
  var _a, _b;
19462
19079
  if (!inputValue.trim() || isLoading)
19463
19080
  return;
19464
- if (!selectedText || selectedText.trim() === "") {
19081
+ const isImageRequest = isImageGenerationRequest(inputValue) || selectedText && isImageGenerationRequest(selectedText);
19082
+ if (!isImageRequest && (!selectedText || selectedText.trim() === "")) {
19465
19083
  toast.error("Please select some text first");
19466
19084
  return;
19467
19085
  }
19468
19086
  setIsLoading(true);
19469
- const fullPrompt = `${inputValue}
19087
+ let finalPrompt;
19088
+ if (isImageRequest) {
19089
+ if (selectedText && selectedText.trim()) {
19090
+ finalPrompt = `${inputValue}: ${selectedText}`;
19091
+ } else {
19092
+ finalPrompt = inputValue;
19093
+ }
19094
+ } else {
19095
+ finalPrompt = `${inputValue}
19470
19096
 
19471
19097
  IMPORTANT: Return ONLY the modified/transformed text. Do NOT include any labels, prefixes, explanations, or formatting like "Simplified:", "Result:", "Here is", etc. Just return the pure result text.
19472
19098
 
19473
19099
  Text to transform:
19474
19100
  "${selectedText}"`;
19101
+ }
19475
19102
  try {
19476
- const response = await AiEditorAction({ content: fullPrompt, provider, apiKey });
19103
+ const response = await AiEditorAction({ content: finalPrompt, provider, apiKey });
19477
19104
  let htmlString = response.data;
19478
19105
  if (typeof htmlString === "string") {
19479
19106
  htmlString = htmlString.trim();
@@ -19481,22 +19108,34 @@ Text to transform:
19481
19108
  htmlString = htmlString.slice(1, -1);
19482
19109
  }
19483
19110
  }
19484
- editor.update(() => {
19485
- const parser = new DOMParser();
19486
- const dom = parser.parseFromString(htmlString.trim(), "text/html");
19487
- const nodes = $generateNodesFromDOM(editor, dom);
19488
- const currentSelection = $getSelection();
19489
- if (currentSelection) {
19490
- $insertNodes(nodes);
19491
- }
19492
- });
19111
+ const parser = new DOMParser();
19112
+ const dom = parser.parseFromString(htmlString.trim(), "text/html");
19113
+ const imgElement = dom.querySelector("img");
19114
+ if (isImageRequest && imgElement && imgElement.src) {
19115
+ editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
19116
+ src: imgElement.src,
19117
+ altText: imgElement.alt || "AI generated image",
19118
+ originalPrompt: finalPrompt
19119
+ // Store the prompt for refinement
19120
+ });
19121
+ } else {
19122
+ editor.update(() => {
19123
+ const nodes = $generateNodesFromDOM(editor, dom);
19124
+ const currentSelection = $getSelection();
19125
+ if (currentSelection) {
19126
+ $insertNodes(nodes);
19127
+ }
19128
+ });
19129
+ }
19493
19130
  setInputValue("");
19494
19131
  setSelectedText("");
19132
+ setStatus("success");
19495
19133
  } catch (error) {
19496
19134
  console.error("Error processing AI action:", error);
19497
19135
  const apiMessage = ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) ?? (error instanceof Error ? error.message : null);
19498
19136
  const safeMessage = apiMessage && !/^Request failed with status code \d+/.test(apiMessage) ? apiMessage : "Error processing your request. Please try again.";
19499
19137
  toast.error(safeMessage);
19138
+ setStatus("error");
19500
19139
  } finally {
19501
19140
  setIsLoading(false);
19502
19141
  }
@@ -19511,6 +19150,7 @@ Text to transform:
19511
19150
  }
19512
19151
  };
19513
19152
  const hasSelectedText = selectedText && selectedText.trim() !== "";
19153
+ const isCurrentInputImageRequest = isImageGenerationRequest(inputValue);
19514
19154
  const displayText = hasSelectedText ? selectedText.length > 50 ? selectedText.substring(0, 50) + "..." : selectedText : "";
19515
19155
  return /* @__PURE__ */ jsxs(
19516
19156
  "div",
@@ -19540,20 +19180,20 @@ Text to transform:
19540
19180
  alignItems: "center",
19541
19181
  gap: "8px",
19542
19182
  padding: "6px 10px",
19543
- backgroundColor: hasSelectedText ? "#2a2a2a" : "#3a2a2a",
19183
+ backgroundColor: status === "success" ? "#1a2e1a" : status === "error" ? "#2e1a1a" : hasSelectedText ? "#2a2a2a" : isCurrentInputImageRequest ? "#2a3a2a" : "#3a2a2a",
19544
19184
  borderRadius: "6px",
19545
19185
  fontSize: "12px",
19546
19186
  color: "#999",
19547
- border: hasSelectedText ? "none" : "1px solid #5a3a3a"
19187
+ border: status === "success" ? "1px solid #3a5a3a" : status === "error" ? "1px solid #5a3a3a" : hasSelectedText ? "none" : isCurrentInputImageRequest ? "1px solid #3a5a3a" : "1px solid #5a3a3a"
19548
19188
  },
19549
- children: hasSelectedText ? /* @__PURE__ */ jsxs(Fragment, { children: [
19189
+ children: status === "success" ? /* @__PURE__ */ jsx("span", { style: { color: "#4ade80" }, children: "✓ Content inserted! Select new text or enter another prompt" }) : status === "error" ? /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "✗ Request failed. Try again or select different text" }) : hasSelectedText ? /* @__PURE__ */ jsxs(Fragment, { children: [
19550
19190
  /* @__PURE__ */ jsx("span", { style: { color: "#666" }, children: "Selected:" }),
19551
19191
  /* @__PURE__ */ jsxs("span", { style: { color: "#ccc", fontStyle: "italic" }, children: [
19552
19192
  '"',
19553
19193
  displayText,
19554
19194
  '"'
19555
19195
  ] })
19556
- ] }) : /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "⚠ Please select some text in the editor first" })
19196
+ ] }) : isCurrentInputImageRequest ? /* @__PURE__ */ jsx("span", { style: { color: "#4ade80" }, children: "🖼️ Image generation mode - no text selection required" }) : /* @__PURE__ */ jsx("span", { style: { color: "#f87171" }, children: "⚠ Please select some text or enter an image generation prompt" })
19557
19197
  }
19558
19198
  ),
19559
19199
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
@@ -19589,9 +19229,13 @@ Text to transform:
19589
19229
  ref: inputRef,
19590
19230
  type: "text",
19591
19231
  value: inputValue,
19592
- onChange: (e) => setInputValue(e.target.value),
19232
+ onChange: (e) => {
19233
+ setInputValue(e.target.value);
19234
+ if (status !== "idle")
19235
+ setStatus("idle");
19236
+ },
19593
19237
  onKeyDown: handleKeyDown,
19594
- placeholder: hasSelectedText ? "What do you want to do with this text?" : "Select text first...",
19238
+ placeholder: hasSelectedText ? "What do you want to do with this text?" : "Generate image of... or select text",
19595
19239
  disabled: isLoading,
19596
19240
  style: {
19597
19241
  width: "280px",
@@ -20360,10 +20004,10 @@ const PDF_CONFIG = {
20360
20004
  };
20361
20005
  const loadHtml2Pdf = async () => {
20362
20006
  try {
20363
- const mod = await import("./html2pdf.bundle.min-08b31c1f.js").then((n) => n.h);
20007
+ const mod = await import("./html2pdf.bundle.min-49ff1939.js").then((n) => n.h);
20364
20008
  return (mod == null ? void 0 : mod.default) || mod;
20365
20009
  } catch {
20366
- const mod2 = await import("./html2pdf.bundle-0b180070.js").then((n) => n.h);
20010
+ const mod2 = await import("./html2pdf.bundle-026397bd.js").then((n) => n.h);
20367
20011
  return (mod2 == null ? void 0 : mod2.default) || mod2;
20368
20012
  }
20369
20013
  };
@@ -21115,7 +20759,7 @@ var SUB_CLOSE_KEYS = {
21115
20759
  };
21116
20760
  var MENU_NAME = "Menu";
21117
20761
  var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
21118
- var [createMenuContext, createMenuScope] = createContextScope$1(MENU_NAME, [
20762
+ var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
21119
20763
  createCollectionScope,
21120
20764
  createPopperScope,
21121
20765
  createRovingFocusGroupScope
@@ -21240,7 +20884,7 @@ var MenuRootContentNonModal = React$1.forwardRef((props, forwardedRef) => {
21240
20884
  }
21241
20885
  );
21242
20886
  });
21243
- var Slot$1 = /* @__PURE__ */ createSlot$3("MenuContent.ScrollLock");
20887
+ var Slot$1 = /* @__PURE__ */ createSlot("MenuContent.ScrollLock");
21244
20888
  var MenuContentImpl = React$1.forwardRef(
21245
20889
  (props, forwardedRef) => {
21246
20890
  const {
@@ -21442,7 +21086,7 @@ var GROUP_NAME$1 = "MenuGroup";
21442
21086
  var MenuGroup = React$1.forwardRef(
21443
21087
  (props, forwardedRef) => {
21444
21088
  const { __scopeMenu, ...groupProps } = props;
21445
- return /* @__PURE__ */ jsx(Primitive$3.div, { role: "group", ...groupProps, ref: forwardedRef });
21089
+ return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
21446
21090
  }
21447
21091
  );
21448
21092
  MenuGroup.displayName = GROUP_NAME$1;
@@ -21450,7 +21094,7 @@ var LABEL_NAME$1 = "MenuLabel";
21450
21094
  var MenuLabel = React$1.forwardRef(
21451
21095
  (props, forwardedRef) => {
21452
21096
  const { __scopeMenu, ...labelProps } = props;
21453
- return /* @__PURE__ */ jsx(Primitive$3.div, { ...labelProps, ref: forwardedRef });
21097
+ return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
21454
21098
  }
21455
21099
  );
21456
21100
  MenuLabel.displayName = LABEL_NAME$1;
@@ -21530,7 +21174,7 @@ var MenuItemImpl = React$1.forwardRef(
21530
21174
  disabled,
21531
21175
  textValue: textValue ?? textContent,
21532
21176
  children: /* @__PURE__ */ jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
21533
- Primitive$3.div,
21177
+ Primitive.div,
21534
21178
  {
21535
21179
  role: "menuitem",
21536
21180
  "data-highlighted": isFocused ? "" : void 0,
@@ -21641,7 +21285,7 @@ var MenuItemIndicator = React$1.forwardRef(
21641
21285
  {
21642
21286
  present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
21643
21287
  children: /* @__PURE__ */ jsx(
21644
- Primitive$3.span,
21288
+ Primitive.span,
21645
21289
  {
21646
21290
  ...itemIndicatorProps,
21647
21291
  ref: forwardedRef,
@@ -21658,7 +21302,7 @@ var MenuSeparator = React$1.forwardRef(
21658
21302
  (props, forwardedRef) => {
21659
21303
  const { __scopeMenu, ...separatorProps } = props;
21660
21304
  return /* @__PURE__ */ jsx(
21661
- Primitive$3.div,
21305
+ Primitive.div,
21662
21306
  {
21663
21307
  role: "separator",
21664
21308
  "aria-orientation": "horizontal",
@@ -21918,7 +21562,7 @@ var Arrow2 = MenuArrow;
21918
21562
  var SubTrigger = MenuSubTrigger;
21919
21563
  var SubContent = MenuSubContent;
21920
21564
  var DROPDOWN_MENU_NAME = "DropdownMenu";
21921
- var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope$1(
21565
+ var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
21922
21566
  DROPDOWN_MENU_NAME,
21923
21567
  [createMenuScope]
21924
21568
  );
@@ -21965,7 +21609,7 @@ var DropdownMenuTrigger$1 = React$1.forwardRef(
21965
21609
  const context = useDropdownMenuContext(TRIGGER_NAME$1, __scopeDropdownMenu);
21966
21610
  const menuScope = useMenuScope(__scopeDropdownMenu);
21967
21611
  return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
21968
- Primitive$3.button,
21612
+ Primitive.button,
21969
21613
  {
21970
21614
  type: "button",
21971
21615
  id: context.triggerId,
@@ -22302,13 +21946,13 @@ const AlignMenu = () => {
22302
21946
  {
22303
21947
  variant: "ghost",
22304
21948
  size: "sm",
22305
- className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-h-7 cteditor-rounded-sm cteditor-px-2\n",
21949
+ className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-h-7 cteditor-rounded-sm cteditor-px-2\r\n",
22306
21950
  children: [
22307
21951
  /* @__PURE__ */ jsx(AlignLeft, { className: "!cteditor-size-4" }),
22308
21952
  /* @__PURE__ */ jsx(
22309
21953
  ChevronDown,
22310
21954
  {
22311
- className: "!cteditor-size-4 cteditor-opacity-50\n"
21955
+ className: "!cteditor-size-4 cteditor-opacity-50\r\n"
22312
21956
  }
22313
21957
  )
22314
21958
  ]
@@ -22803,7 +22447,7 @@ var V = "undefined" != typeof window ? useLayoutEffect$1 : useEffect$1, $ = func
22803
22447
  return React__default.createElement(U, u({}, r2, { colorModel: W }));
22804
22448
  };
22805
22449
  var POPOVER_NAME = "Popover";
22806
- var [createPopoverContext, createPopoverScope] = createContextScope$1(POPOVER_NAME, [
22450
+ var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
22807
22451
  createPopperScope
22808
22452
  ]);
22809
22453
  var usePopperScope = createPopperScope();
@@ -22867,7 +22511,7 @@ var PopoverTrigger$1 = React$1.forwardRef(
22867
22511
  const popperScope = usePopperScope(__scopePopover);
22868
22512
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
22869
22513
  const trigger = /* @__PURE__ */ jsx(
22870
- Primitive$3.button,
22514
+ Primitive.button,
22871
22515
  {
22872
22516
  type: "button",
22873
22517
  "aria-haspopup": "dialog",
@@ -22903,7 +22547,7 @@ var PopoverContent$1 = React$1.forwardRef(
22903
22547
  }
22904
22548
  );
22905
22549
  PopoverContent$1.displayName = CONTENT_NAME;
22906
- var Slot = /* @__PURE__ */ createSlot$3("PopoverContent.RemoveScroll");
22550
+ var Slot = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
22907
22551
  var PopoverContentModal = React$1.forwardRef(
22908
22552
  (props, forwardedRef) => {
22909
22553
  const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
@@ -23060,7 +22704,7 @@ var PopoverClose = React$1.forwardRef(
23060
22704
  const { __scopePopover, ...closeProps } = props;
23061
22705
  const context = usePopoverContext(CLOSE_NAME, __scopePopover);
23062
22706
  return /* @__PURE__ */ jsx(
23063
- Primitive$3.button,
22707
+ Primitive.button,
23064
22708
  {
23065
22709
  type: "button",
23066
22710
  ...closeProps,
@@ -23296,7 +22940,7 @@ const ColorPicker$2 = ({
23296
22940
  "button",
23297
22941
  {
23298
22942
  onClick: () => setShowAdvanced(!showAdvanced),
23299
- className: "cteditor-text-xs cteditor-text-primary/90 hover:cteditor-text-primary cteditor-transition-colors cteditor-flex cteditor-items-center cteditor-gap-2\n",
22943
+ className: "cteditor-text-xs cteditor-text-primary/90 hover:cteditor-text-primary cteditor-transition-colors cteditor-flex cteditor-items-center cteditor-gap-2\r\n",
23300
22944
  children: [
23301
22945
  /* @__PURE__ */ jsx("span", { className: "cteditor-text-xs", children: showAdvanced ? "▼" : "▶" }),
23302
22946
  showAdvanced ? "Hide Advanced" : "Show Advanced"
@@ -34477,7 +34121,7 @@ function TableActionMenu({
34477
34121
  /* @__PURE__ */ jsxs(
34478
34122
  "div",
34479
34123
  {
34480
- className: "dropdown table-drop cteditor-z-[100]\n cteditor-flex\n cteditor-flex-col\n cteditor-fixed\n cteditor-min-h-[40px]\n cteditor-min-w-[200px]\n cteditor-p-[6px]\n cteditor-overflow-y-auto\n cteditor-overflow-x-hidden \n cteditor-shadow-xl\n cteditor-rounded-lg\n cteditor-border\n cteditor-border-border\n cteditor-bg-background \n cteditor-backdrop-blur-md\n cteditor-space-y-0.5\n ",
34124
+ className: "dropdown table-drop cteditor-z-[100]\r\n cteditor-flex\r\n cteditor-flex-col\r\n cteditor-fixed\r\n cteditor-min-h-[40px]\r\n cteditor-min-w-[200px]\r\n cteditor-p-[6px]\r\n cteditor-overflow-y-auto\r\n cteditor-overflow-x-hidden \r\n cteditor-shadow-xl\r\n cteditor-rounded-lg\r\n cteditor-border\r\n cteditor-border-border\r\n cteditor-bg-background \r\n cteditor-backdrop-blur-md\r\n cteditor-space-y-0.5\r\n ",
34481
34125
  ref: dropDownRef,
34482
34126
  onClick: (e) => {
34483
34127
  e.stopPropagation();
@@ -37232,7 +36876,7 @@ function applyGenericSafeStyles(container, codeBlockStyles) {
37232
36876
  addStyle(allSelectors, "line-height: 1.5;");
37233
36877
  addStyleIfNotSetOnElementOrChildren(blockSelectors, "font-family", defaultFontFamily);
37234
36878
  addStyleIfNotSet("table, p, li, td, th, div", "font-size", "16px");
37235
- addStyle("p", "margin: 0 0 1em 0;");
36879
+ addStyle("p", "margin: 0;");
37236
36880
  addStyle("th p, td p", "margin: 0; padding: 0;");
37237
36881
  addStyle(
37238
36882
  "table",
@@ -38545,4 +38189,4 @@ export {
38545
38189
  useHtmlView as u,
38546
38190
  verifyApiKey as v
38547
38191
  };
38548
- //# sourceMappingURL=index-6360d552.js.map
38192
+ //# sourceMappingURL=index-b9ad2974.js.map