reactjs-tiptap-editor 0.4.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/lib/ActionMenuButton-BKOg7hkq.js +38 -0
  2. package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.d.cts +27 -39
  5. package/lib/Attachment.d.ts +27 -39
  6. package/lib/Attachment.js +129 -99
  7. package/lib/Blockquote.cjs +3 -3
  8. package/lib/Blockquote.d.cts +27 -39
  9. package/lib/Blockquote.d.ts +27 -39
  10. package/lib/Blockquote.js +50 -22
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +27 -39
  13. package/lib/Bold.d.ts +27 -39
  14. package/lib/Bold.js +48 -20
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +27 -39
  17. package/lib/BulletList.d.ts +27 -39
  18. package/lib/BulletList.js +38 -9
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +27 -39
  21. package/lib/Clear.d.ts +27 -39
  22. package/lib/Clear.js +32 -6
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +27 -39
  25. package/lib/Code.d.ts +27 -39
  26. package/lib/Code.js +53 -25
  27. package/lib/CodeBlock.cjs +35 -35
  28. package/lib/CodeBlock.d.cts +27 -39
  29. package/lib/CodeBlock.d.ts +27 -39
  30. package/lib/CodeBlock.js +605 -590
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -40
  33. package/lib/CodeView.d.ts +28 -40
  34. package/lib/CodeView.js +49 -21
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +31 -39
  37. package/lib/Color.d.ts +31 -39
  38. package/lib/Color.js +123 -79
  39. package/lib/Column.cjs +1 -0
  40. package/lib/{Document.d.cts → Column.d.cts} +33 -42
  41. package/lib/{Document.d.ts → Column.d.ts} +33 -42
  42. package/lib/Column.js +217 -0
  43. package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
  44. package/lib/Drawer-SRhwOc6T.cjs +1 -0
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +27 -39
  47. package/lib/Drawer.d.ts +27 -39
  48. package/lib/Drawer.js +6 -5
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +27 -44
  51. package/lib/Emoji.d.ts +27 -44
  52. package/lib/Emoji.js +377 -392
  53. package/lib/Excalidraw-DwBRXEtC.js +345 -0
  54. package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +27 -39
  57. package/lib/Excalidraw.d.ts +27 -39
  58. package/lib/Excalidraw.js +6 -4
  59. package/lib/ExportPdf.cjs +5 -5
  60. package/lib/ExportPdf.d.cts +27 -39
  61. package/lib/ExportPdf.d.ts +27 -39
  62. package/lib/ExportPdf.js +60 -32
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +28 -40
  65. package/lib/ExportWord.d.ts +28 -40
  66. package/lib/ExportWord.js +84 -21
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +41 -42
  69. package/lib/FontFamily.d.ts +41 -42
  70. package/lib/FontFamily.js +72 -74
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +38 -42
  73. package/lib/FontSize.d.ts +38 -42
  74. package/lib/FontSize.js +72 -64
  75. package/lib/Heading.cjs +1 -1
  76. package/lib/Heading.d.cts +41 -39
  77. package/lib/Heading.d.ts +41 -39
  78. package/lib/Heading.js +91 -73
  79. package/lib/Highlight.cjs +1 -1
  80. package/lib/Highlight.d.cts +31 -39
  81. package/lib/Highlight.d.ts +31 -39
  82. package/lib/Highlight.js +150 -19
  83. package/lib/History.cjs +1 -1
  84. package/lib/History.d.cts +29 -39
  85. package/lib/History.d.ts +29 -39
  86. package/lib/History.js +976 -53
  87. package/lib/HorizontalRule.cjs +1 -1
  88. package/lib/HorizontalRule.d.cts +27 -39
  89. package/lib/HorizontalRule.d.ts +27 -39
  90. package/lib/HorizontalRule.js +97 -17
  91. package/lib/Icon-DUpv2cI6.cjs +1 -0
  92. package/lib/Icon-jKs8Hr6p.js +11 -0
  93. package/lib/Iframe-CmXkEqOd.js +431 -0
  94. package/lib/Iframe-Cvca2G7X.cjs +1 -0
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +26 -45
  97. package/lib/Iframe.d.ts +26 -45
  98. package/lib/Iframe.js +6 -4
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +27 -40
  101. package/lib/Image.d.ts +27 -40
  102. package/lib/Image.js +848 -5
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +28 -42
  105. package/lib/ImageGif.d.ts +28 -42
  106. package/lib/ImageGif.js +424 -5
  107. package/lib/ImportWord.cjs +48 -48
  108. package/lib/ImportWord.d.cts +28 -40
  109. package/lib/ImportWord.d.ts +28 -40
  110. package/lib/ImportWord.js +2759 -2751
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +27 -39
  113. package/lib/Indent.d.ts +27 -39
  114. package/lib/Indent.js +97 -27
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +27 -39
  117. package/lib/Italic.d.ts +27 -39
  118. package/lib/Italic.js +47 -19
  119. package/lib/Katex-DsYXsjSS.js +2740 -0
  120. package/lib/Katex-XfrNne6U.cjs +4 -0
  121. package/lib/Katex.cjs +1 -1
  122. package/lib/Katex.d.cts +27 -39
  123. package/lib/Katex.d.ts +27 -39
  124. package/lib/Katex.js +5 -196
  125. package/lib/LineHeight.cjs +1 -1
  126. package/lib/LineHeight.d.cts +29 -45
  127. package/lib/LineHeight.d.ts +29 -45
  128. package/lib/LineHeight.js +71 -112
  129. package/lib/Link.cjs +1 -1
  130. package/lib/Link.d.cts +28 -42
  131. package/lib/Link.d.ts +28 -42
  132. package/lib/Link.js +3 -3
  133. package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
  134. package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +24 -39
  137. package/lib/Mention.d.ts +24 -39
  138. package/lib/Mention.js +112 -124
  139. package/lib/Mermaid.cjs +2 -2
  140. package/lib/Mermaid.d.cts +27 -39
  141. package/lib/Mermaid.d.ts +27 -39
  142. package/lib/Mermaid.js +177 -165
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +42 -41
  145. package/lib/MoreMark.d.ts +42 -41
  146. package/lib/MoreMark.js +125 -55
  147. package/lib/OrderedList.cjs +1 -1
  148. package/lib/OrderedList.d.cts +27 -39
  149. package/lib/OrderedList.d.ts +27 -39
  150. package/lib/OrderedList.js +37 -9
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +27 -42
  153. package/lib/SearchAndReplace.d.ts +27 -42
  154. package/lib/SearchAndReplace.js +221 -197
  155. package/lib/SlashCommand.cjs +1 -1
  156. package/lib/SlashCommand.d.cts +39 -46
  157. package/lib/SlashCommand.d.ts +39 -46
  158. package/lib/SlashCommand.js +235 -249
  159. package/lib/Strike.cjs +1 -1
  160. package/lib/Strike.d.cts +27 -39
  161. package/lib/Strike.d.ts +27 -39
  162. package/lib/Strike.js +39 -11
  163. package/lib/Table-B1j1Ebmh.cjs +9 -0
  164. package/lib/Table-Db8TcQX8.js +1984 -0
  165. package/lib/Table.cjs +1 -9
  166. package/lib/Table.d.cts +28 -42
  167. package/lib/Table.d.ts +28 -42
  168. package/lib/Table.js +3 -558
  169. package/lib/TaskList.cjs +1 -1
  170. package/lib/TaskList.d.cts +27 -39
  171. package/lib/TaskList.d.ts +27 -39
  172. package/lib/TaskList.js +38 -10
  173. package/lib/TextAlign.cjs +1 -1
  174. package/lib/TextAlign.d.cts +40 -39
  175. package/lib/TextAlign.d.ts +40 -39
  176. package/lib/TextAlign.js +108 -101
  177. package/lib/TextDirection.cjs +1 -1
  178. package/lib/TextDirection.d.cts +56 -39
  179. package/lib/TextDirection.d.ts +56 -39
  180. package/lib/TextDirection.js +105 -112
  181. package/lib/TextUnderline.cjs +1 -1
  182. package/lib/TextUnderline.d.cts +27 -39
  183. package/lib/TextUnderline.d.ts +27 -39
  184. package/lib/TextUnderline.js +46 -18
  185. package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
  186. package/lib/Twitter-CtVTIWJW.cjs +1 -0
  187. package/lib/Twitter.cjs +1 -1
  188. package/lib/Twitter.d.cts +27 -39
  189. package/lib/Twitter.d.ts +27 -39
  190. package/lib/Twitter.js +5 -4
  191. package/lib/Video.cjs +1 -1
  192. package/lib/Video.d.cts +27 -39
  193. package/lib/Video.d.ts +27 -39
  194. package/lib/Video.js +261 -4
  195. package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
  196. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  197. package/lib/bubble.cjs +2 -0
  198. package/lib/{bubble-extra.d.cts → bubble.d.cts} +53 -54
  199. package/lib/{bubble-extra.d.ts → bubble.d.ts} +53 -54
  200. package/lib/bubble.js +1925 -0
  201. package/lib/button-B12K7BJ4.cjs +1 -0
  202. package/lib/button-DXMsXUEn.js +43 -0
  203. package/lib/clsx-C11secjj.cjs +1 -0
  204. package/lib/clsx-OuTLNxxd.js +16 -0
  205. package/lib/delete-node-CosiBes5.cjs +1 -0
  206. package/lib/delete-node-IyVmiRbI.js +22 -0
  207. package/lib/dialog-CaCS-W5S.cjs +1 -0
  208. package/lib/dialog-PtQivpHS.js +100 -0
  209. package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
  210. package/lib/dom-dataset-CIEeltF6.js +47 -0
  211. package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
  212. package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
  213. package/lib/file-BLas99n7.js +43 -0
  214. package/lib/file-i7e4nQY2.cjs +1 -0
  215. package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
  216. package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
  217. package/lib/icons-Cllpys39.js +362 -0
  218. package/lib/icons-CqHjeW5T.cjs +1 -0
  219. package/lib/index-BH4bc3jN.cjs +33 -0
  220. package/lib/index-BPfVXs5_.js +2380 -0
  221. package/lib/index-Bnmd0WvY.js +1631 -0
  222. package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
  223. package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
  224. package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
  225. package/lib/index-DV5kbgRU.cjs +1 -0
  226. package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
  227. package/lib/index-Dfmm6FTT.cjs +1 -0
  228. package/lib/index-DnWWK9F_.js +6374 -0
  229. package/lib/index-DzcKxutn.js +632 -0
  230. package/lib/index-DzvuNTxo.cjs +4 -0
  231. package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
  232. package/lib/index-RfTlOzIr.cjs +22 -0
  233. package/lib/index.cjs +132 -1
  234. package/lib/index.d.cts +29 -280
  235. package/lib/index.d.ts +29 -280
  236. package/lib/index.js +243 -2
  237. package/lib/input-_ECRfn3Y.cjs +1 -0
  238. package/lib/input-wJ9PDEzZ.js +21 -0
  239. package/lib/isNumber-ClPupm7P.cjs +1 -0
  240. package/lib/isNumber-fpLGS0AZ.js +15 -0
  241. package/lib/label-BkgAe7IY.cjs +1 -0
  242. package/lib/label-CGdLYWv7.js +19 -0
  243. package/lib/locale-bundle.cjs +1 -1
  244. package/lib/locale-bundle.d.cts +5405 -57
  245. package/lib/locale-bundle.d.ts +5405 -57
  246. package/lib/locale-bundle.js +9 -7
  247. package/lib/popover-BgmUNMHj.cjs +1 -0
  248. package/lib/popover-CAuEW0Mr.js +23 -0
  249. package/lib/separator-CuBW_w98.js +328 -0
  250. package/lib/separator-DRIrVZ2N.cjs +1 -0
  251. package/lib/store-DX599H5W.js +10 -0
  252. package/lib/store-WStcMOiW.cjs +1 -0
  253. package/lib/style.css +1 -1
  254. package/lib/switch-CnLJ7Y-b.cjs +1 -0
  255. package/lib/switch-Coix_FA1.js +27 -0
  256. package/lib/tabs-B5mVSN1I.js +46 -0
  257. package/lib/tabs-BoLCMcCI.cjs +1 -0
  258. package/lib/textarea-B-6zTKQz.cjs +1 -0
  259. package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
  260. package/lib/theme-B7aAsK_T.js +15 -0
  261. package/lib/theme-D8_cxGqB.cjs +1 -0
  262. package/lib/throttle-CdwDrFpn.js +249 -0
  263. package/lib/throttle-qX7Yjtsg.cjs +1 -0
  264. package/lib/toggle-Cdp4IT2U.js +85 -0
  265. package/lib/toggle-D41PzQLJ.cjs +1 -0
  266. package/lib/tooltip-BuEiE96N.cjs +1 -0
  267. package/lib/tooltip-CopwsU8q.js +23 -0
  268. package/lib/updatePosition-8Sdem5jb.cjs +1 -0
  269. package/lib/updatePosition-BPmcE0YD.js +215 -0
  270. package/lib/use-toast-Bz3QCOtE.cjs +1 -0
  271. package/lib/use-toast-Crf7-q5H.js +98 -0
  272. package/lib/useButtonProps-BsEd4zYM.js +141 -0
  273. package/lib/useButtonProps-C6Vpn190.cjs +1 -0
  274. package/package.json +22 -105
  275. package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
  276. package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
  277. package/lib/BaseKit.cjs +0 -3
  278. package/lib/BaseKit.d.cts +0 -481
  279. package/lib/BaseKit.d.ts +0 -481
  280. package/lib/BaseKit.js +0 -132
  281. package/lib/Document.cjs +0 -1
  282. package/lib/Document.js +0 -9
  283. package/lib/Drawer-CdvCMSzN.cjs +0 -1
  284. package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
  285. package/lib/Excalidraw-CVWz2Vyn.js +0 -290
  286. package/lib/FormatPainter.cjs +0 -1
  287. package/lib/FormatPainter.d.cts +0 -372
  288. package/lib/FormatPainter.d.ts +0 -372
  289. package/lib/FormatPainter.js +0 -76
  290. package/lib/ListItem.cjs +0 -1
  291. package/lib/ListItem.d.cts +0 -290
  292. package/lib/ListItem.d.ts +0 -290
  293. package/lib/ListItem.js +0 -7
  294. package/lib/MultiColumn.cjs +0 -1
  295. package/lib/MultiColumn.d.cts +0 -294
  296. package/lib/MultiColumn.d.ts +0 -294
  297. package/lib/MultiColumn.js +0 -8
  298. package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
  299. package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
  300. package/lib/Selection.cjs +0 -1
  301. package/lib/Selection.d.cts +0 -289
  302. package/lib/Selection.d.ts +0 -289
  303. package/lib/Selection.js +0 -25
  304. package/lib/SubAndSuperScript.cjs +0 -1
  305. package/lib/SubAndSuperScript.d.cts +0 -377
  306. package/lib/SubAndSuperScript.d.ts +0 -377
  307. package/lib/SubAndSuperScript.js +0 -43
  308. package/lib/TableOfContent.cjs +0 -1
  309. package/lib/TableOfContent.d.cts +0 -291
  310. package/lib/TableOfContent.d.ts +0 -291
  311. package/lib/TableOfContent.js +0 -185
  312. package/lib/TextBubble.cjs +0 -1
  313. package/lib/TextBubble.d.cts +0 -362
  314. package/lib/TextBubble.d.ts +0 -362
  315. package/lib/TextBubble.js +0 -133
  316. package/lib/TrailingNode.cjs +0 -1
  317. package/lib/TrailingNode.d.cts +0 -297
  318. package/lib/TrailingNode.d.ts +0 -297
  319. package/lib/TrailingNode.js +0 -41
  320. package/lib/Twitter-Cutpkh3h.cjs +0 -1
  321. package/lib/bubble-extra.cjs +0 -2
  322. package/lib/bubble-extra.js +0 -631
  323. package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
  324. package/lib/dom-dataset-lYeH6gfI.js +0 -2361
  325. package/lib/index-6D1J-A-o.cjs +0 -1
  326. package/lib/index-B96Cclrj.cjs +0 -3
  327. package/lib/index-BBz7Nmv9.js +0 -55
  328. package/lib/index-CUogRI7j.cjs +0 -1
  329. package/lib/index-DF2Lp4HZ.cjs +0 -100
  330. package/lib/index-D_L6n8O8.js +0 -76
  331. package/lib/index-Dbvi-Bvh.cjs +0 -1
  332. package/lib/index-DpCrt7xs.cjs +0 -1
  333. package/lib/index-DsAX1Vq8.cjs +0 -1
  334. package/lib/index-Dy4DlW9o.js +0 -12
  335. package/lib/index-J3jHHZ4d.js +0 -200
  336. package/lib/index-VvXaaKe3.js +0 -898
  337. package/lib/index-kbO3iWqL.js +0 -13432
  338. package/lib/textarea-DFo_aXnj.cjs +0 -1
@@ -1,297 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
-
3
- export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
4
-
5
- /**
6
- * Extension based on:
7
- * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
8
- * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
9
- */
10
- export declare interface TrailingNodeOptions {
11
- node: string;
12
- notAfter: string[];
13
- }
14
-
15
- export { }
16
-
17
-
18
- declare module '@tiptap/core' {
19
- interface Commands<ReturnType> {
20
- attachment: {
21
- setAttachment: (attrs?: unknown) => ReturnType;
22
- };
23
- }
24
- }
25
-
26
-
27
- declare module '@tiptap/core' {
28
- interface Commands<ReturnType> {
29
- setCodeBlock: {
30
- setCodeBlock: (options?: any) => ReturnType;
31
- };
32
- }
33
- }
34
-
35
-
36
- declare module '@tiptap/core' {
37
- interface Commands<ReturnType> {
38
- codeView: {
39
- /**
40
- * Toggle code view mode
41
- */
42
- toggleCodeView: () => ReturnType;
43
- };
44
- }
45
- }
46
-
47
-
48
- declare module '@tiptap/core' {
49
- interface Commands<ReturnType> {
50
- drawer: {
51
- setDrawer: (options: any, replace?: any) => ReturnType;
52
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
53
- };
54
- }
55
- }
56
-
57
-
58
- declare module '@tiptap/core' {
59
- interface Commands<ReturnType> {
60
- excalidraw: {
61
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
62
- };
63
- }
64
- }
65
-
66
-
67
- declare module '@tiptap/core' {
68
- interface Commands<ReturnType> {
69
- exportPdf: {
70
- exportToPdf: () => ReturnType;
71
- };
72
- }
73
- }
74
-
75
-
76
- declare module '@tiptap/core' {
77
- interface Commands<ReturnType> {
78
- exportWord: {
79
- exportToWord: () => ReturnType;
80
- };
81
- }
82
- }
83
-
84
-
85
- declare module '@tiptap/core' {
86
- interface Commands<ReturnType> {
87
- fontSize: {
88
- /**
89
- * Set the text font size. ex: "12px", "2em", or "small". Must be a valid
90
- * CSS font-size
91
- * (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
92
- */
93
- setFontSize: (fontSize: string) => ReturnType;
94
- /**
95
- * Unset the font size
96
- */
97
- unsetFontSize: () => ReturnType;
98
- };
99
- }
100
- }
101
-
102
-
103
- declare module '@tiptap/core' {
104
- interface Commands<ReturnType> {
105
- painter: {
106
- setPainter: (marks: Mark[]) => ReturnType;
107
- };
108
- }
109
- }
110
-
111
-
112
- declare module '@tiptap/core' {
113
- interface Commands<ReturnType> {
114
- iframe: {
115
- /**
116
- * Add an iframe
117
- */
118
- setIframe: (options: {
119
- src: string;
120
- service: string;
121
- }) => ReturnType;
122
- };
123
- }
124
- }
125
-
126
-
127
- declare module '@tiptap/core' {
128
- interface Commands<ReturnType> {
129
- imageUpload: {
130
- /**
131
- * Add an image
132
- */
133
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
134
- /**
135
- * Update an image
136
- */
137
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
138
- /**
139
- * Set image alignment
140
- */
141
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
142
- };
143
- }
144
- }
145
-
146
-
147
- declare module '@tiptap/core' {
148
- interface Commands<ReturnType> {
149
- imageGifUpload: {
150
- /**
151
- * Add an image gif
152
- */
153
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
154
- /**
155
- * Update an image gif
156
- */
157
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
158
- /**
159
- * Set image alignment
160
- */
161
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
162
- };
163
- }
164
- }
165
-
166
-
167
- declare module '@tiptap/core' {
168
- interface Commands<ReturnType> {
169
- indent: {
170
- /**
171
- * Set the indent attribute
172
- */
173
- indent: () => ReturnType;
174
- /**
175
- * Set the outdent attribute
176
- */
177
- outdent: () => ReturnType;
178
- };
179
- }
180
- }
181
-
182
-
183
- declare module '@tiptap/core' {
184
- interface Commands<ReturnType> {
185
- katex: {
186
- setKatex: (arg?: IKatexAttrs) => ReturnType;
187
- };
188
- }
189
- }
190
-
191
-
192
- declare module '@tiptap/core' {
193
- interface Commands<ReturnType> {
194
- lineHeight: {
195
- setLineHeight: (lineHeight: string) => ReturnType;
196
- unsetLineHeight: () => ReturnType;
197
- };
198
- }
199
- }
200
-
201
-
202
- declare module '@tiptap/core' {
203
- interface Commands<ReturnType> {
204
- mermaid: {
205
- setMermaid: (options: any, replace?: any) => ReturnType;
206
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
207
- };
208
- }
209
- }
210
-
211
-
212
- declare module '@tiptap/core' {
213
- interface Commands<ReturnType> {
214
- columns: {
215
- insertColumns: (attrs?: {
216
- cols: number;
217
- }) => ReturnType;
218
- addColBefore: () => ReturnType;
219
- addColAfter: () => ReturnType;
220
- deleteCol: () => ReturnType;
221
- };
222
- }
223
- }
224
-
225
-
226
- declare module '@tiptap/core' {
227
- interface Commands<ReturnType> {
228
- search: {
229
- setSearchTerm: (searchTerm: string) => ReturnType;
230
- setReplaceTerm: (replaceTerm: string) => ReturnType;
231
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
232
- resetIndex: () => ReturnType;
233
- nextSearchResult: () => ReturnType;
234
- previousSearchResult: () => ReturnType;
235
- replace: () => ReturnType;
236
- replaceAll: () => ReturnType;
237
- };
238
- }
239
- }
240
-
241
-
242
- declare module '@tiptap/core' {
243
- interface Storage {
244
- searchAndReplace: SearchAndReplaceStorage;
245
- }
246
- }
247
-
248
-
249
- declare module '@tiptap/core' {
250
- interface Commands<ReturnType> {
251
- tableOfContents: {
252
- setTableOfContents: () => ReturnType;
253
- removeTableOfContents: () => ReturnType;
254
- };
255
- }
256
- }
257
-
258
-
259
- declare module '@tiptap/core' {
260
- interface Commands<ReturnType> {
261
- twitter: {
262
- /**
263
- * Insert a tweet
264
- * @param options The tweet attributes
265
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
266
- */
267
- setTweet: (options: SetTweetOptions) => ReturnType;
268
- updateTweet: (options: SetTweetOptions) => ReturnType;
269
- };
270
- }
271
- }
272
-
273
-
274
- declare module '@tiptap/core' {
275
- interface Commands<ReturnType> {
276
- video: {
277
- /**
278
- * Add an video
279
- */
280
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
281
- /**
282
- * Update an video
283
- */
284
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
285
- };
286
- }
287
- }
288
-
289
-
290
- declare module '@tiptap/core' {
291
- interface Commands<ReturnType> {
292
- tableCellBackground: {
293
- setTableCellBackground: (color: string) => ReturnType;
294
- unsetTableCellBackground: () => ReturnType;
295
- };
296
- }
297
- }
@@ -1,41 +0,0 @@
1
- import { E as u, a as h, P as g } from "./index-kbO3iWqL.js";
2
- function s({ types: n, node: o }) {
3
- return Array.isArray(n) && n.includes(o.type) || o.type === n;
4
- }
5
- const m = /* @__PURE__ */ u.create({
6
- name: "trailingNode",
7
- addOptions() {
8
- return {
9
- node: "paragraph",
10
- notAfter: ["paragraph"]
11
- };
12
- },
13
- addProseMirrorPlugins() {
14
- const n = new h(this.name), o = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => this.options.notAfter.includes(e.name));
15
- return [
16
- new g({
17
- key: n,
18
- appendTransaction: (e, r, t) => {
19
- const { doc: i, tr: a, schema: d } = t, c = n.getState(t), l = i.content.size, p = d.nodes[this.options.node];
20
- if (c)
21
- return a.insert(l, p.create());
22
- },
23
- state: {
24
- init: (e, r) => {
25
- const t = r.tr.doc.lastChild;
26
- return !s({ node: t, types: o });
27
- },
28
- apply: (e, r) => {
29
- if (!e.docChanged)
30
- return r;
31
- const t = e.doc.lastChild;
32
- return !s({ node: t, types: o });
33
- }
34
- }
35
- })
36
- ];
37
- }
38
- });
39
- export {
40
- m as TrailingNode
41
- };
@@ -1 +0,0 @@
1
- "use strict";const we=require("./index-DF2Lp4HZ.cjs"),L=require("./dom-dataset-_6-diIRQ.cjs"),n=require("react/jsx-runtime"),f=require("react"),z=require("./RichTextEditor-CxvwGvQG.cjs"),Lt=require("./index-6D1J-A-o.cjs"),Ot="_verified_lvyh0_1",We={verified:Ot},qt=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Dt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),$t=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),At="_root_98iqw_1",Vt="_article_98iqw_21",Ze={root:At,article:Vt},Be=({className:e,children:t})=>n.jsx("div",{className:L.clsx("react-tweet-theme",Ze.root,e),children:n.jsx("article",{className:Ze.article,children:t})}),ft=e=>n.jsx("img",{...e}),Mt="_header_nqq4j_1",Wt="_avatar_nqq4j_11",Bt="_avatarOverflow_nqq4j_16",Ft="_avatarSquare_nqq4j_23",Pt="_avatarShadow_nqq4j_26",Ut="_author_nqq4j_37",zt="_authorLink_nqq4j_44",Ht="_authorVerified_nqq4j_53",Gt="_authorLinkText_nqq4j_56",Xt="_authorMeta_nqq4j_63",Kt="_authorFollow_nqq4j_66",Qt="_username_nqq4j_69",Jt="_follow_nqq4j_74",Yt="_separator_nqq4j_82",Zt="_brand_nqq4j_86",en="_twitterIcon_nqq4j_90",T={header:Mt,avatar:Wt,avatarOverflow:Bt,avatarSquare:Ft,avatarShadow:Pt,author:Ut,authorLink:zt,authorVerified:Ht,authorLinkText:Gt,authorMeta:Xt,authorFollow:Kt,username:Qt,follow:Jt,separator:Yt,brand:Zt,twitterIcon:en},tn="_verifiedOld_lcna5_1",nn="_verifiedBlue_lcna5_4",rn="_verifiedGovernment_lcna5_7",ye={verifiedOld:tn,verifiedBlue:nn,verifiedGovernment:rn},ht=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx(qt,{}),i=ye.verifiedBlue;if(r)switch(e.is_blue_verified||(i=ye.verifiedOld),e.verified_type){case"Government":s=n.jsx($t,{}),i=ye.verifiedGovernment;break;case"Business":s=n.jsx(Dt,{}),i=null;break}return r?n.jsx("div",{className:L.clsx(t,i),children:s}):null},sn=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:ft,{user:i}=e;return n.jsxs("div",{className:T.header,children:[n.jsxs("a",{href:e.url,className:T.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:L.clsx(T.avatarOverflow,i.profile_image_shape==="Square"&&T.avatarSquare),children:n.jsx(s,{src:i.profile_image_url_https,alt:i.name,width:48,height:48})}),n.jsx("div",{className:T.avatarOverflow,children:n.jsx("div",{className:T.avatarShadow})})]}),n.jsxs("div",{className:T.author,children:[n.jsxs("a",{href:e.url,className:T.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:T.authorLinkText,children:n.jsx("span",{title:i.name,children:i.name})}),n.jsx(ht,{user:i,className:T.authorVerified})]}),n.jsxs("div",{className:T.authorMeta,children:[n.jsx("a",{href:e.url,className:T.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${i.screen_name}`,children:["@",i.screen_name]})}),n.jsxs("div",{className:T.authorFollow,children:[n.jsx("span",{className:T.separator,children:"·"}),n.jsx("a",{href:i.follow_url,className:T.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:T.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},on="_root_1ec15_1",an={root:on},cn=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:an.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),ln="_root_eihfa_1",dn={root:ln},un=({href:e,children:t})=>n.jsx("a",{href:e,className:dn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),fn="_root_1xq52_1",hn={root:fn},_n=({tweet:e})=>n.jsx("p",{className:hn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(un,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),et=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,_t=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,mn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,xn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,pn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,vn=e=>`https://x.com/hashtag/${e.text}`,gn=e=>`https://x.com/search?q=%24${e.text}`,jn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,mt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},wn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,i)=>{var a,o;return((a=i.bitrate)!=null?a:0)-((o=s.bitrate)!=null?o:0)})},yn=e=>{const t=wn(e);return t.length>1?t[1]:t[0]},Ce=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function tt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return le(r,"hashtag",e.entities.hashtags),le(r,"mention",e.entities.user_mentions),le(r,"url",e.entities.urls),le(r,"symbol",e.entities.symbols),e.entities.media&&le(r,"media",e.entities.media),bn(e,r),r.map(s=>{const i=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:vn(s),text:i});case"mention":return Object.assign(s,{href:_t(s.screen_name),text:i});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:gn(s),text:i});default:return Object.assign(s,{text:i})}})}function le(e,t,r){for(const s of r)for(const[i,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const o=[{...s,type:t}];a.indices[0]<s.indices[0]&&o.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&o.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(i,1,...o);break}}function bn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const Tn=e=>({...e,url:et(e),user:{...e.user,url:_t(e),follow_url:pn(e)},like_url:mn(e),reply_url:xn(e),in_reply_to_url:e.in_reply_to_screen_name?jn(e):void 0,entities:tt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:et(e.quoted_tweet),entities:tt(e.quoted_tweet)}:void 0}),Nn="_root_g9tkv_1",Rn="_rounded_g9tkv_6",kn="_mediaWrapper_g9tkv_10",Sn="_grid2Columns_g9tkv_17",En="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",Ln="_mediaLink_g9tkv_34",On="_skeleton_g9tkv_38",qn="_image_g9tkv_43",I={root:Nn,rounded:Rn,mediaWrapper:kn,grid2Columns:Sn,grid3:En,grid2x2:In,mediaContainer:Cn,mediaLink:Ln,skeleton:On,image:qn},Dn="_anchor_fp31d_1",$n="_videoButton_fp31d_17",An="_videoButtonIcon_fp31d_35",Vn="_watchOnTwitter_fp31d_44",Mn="_viewReplies_fp31d_60",ie={anchor:Dn,videoButton:$n,videoButtonIcon:An,watchOnTwitter:Vn,viewReplies:Mn},Wn=({tweet:e,media:t})=>{const[r,s]=f.useState(!0),[i,a]=f.useState(!1),[o,l]=f.useState(!1),h=yn(t);let u=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:I.image,poster:mt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{u&&window.clearTimeout(u),i||a(!0),o&&l(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{i&&a(!1),u=0},100)},onEnded:()=>{l(!0)},children:n.jsx("source",{src:h.url,type:h.content_type})}),r&&n.jsx("button",{type:"button",className:ie.videoButton,"aria-label":"View video on X",onClick:j=>{const p=j.currentTarget.previousSibling;j.preventDefault(),s(!1),p.load(),p.play().then(()=>{a(!0),p.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:ie.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!i&&!o&&n.jsx("div",{className:ie.watchOnTwitter,children:n.jsx("a",{href:e.url,className:ie.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),o&&n.jsx("a",{href:e.url,className:L.clsx(ie.anchor,ie.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Bn=e=>n.jsx("img",{...e}),nt=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},xt=({tweet:e,components:t,quoted:r})=>{var s,i,a;const o=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var l;const h=(l=t==null?void 0:t.MediaImg)!=null?l:Bn;return n.jsx("div",{className:L.clsx(I.root,!r&&I.rounded),children:n.jsx("div",{className:L.clsx(I.mediaWrapper,o>1&&I.grid2Columns,o===3&&I.grid3,o>4&&I.grid2x2),children:(i=e.mediaDetails)==null?void 0:i.map(u=>n.jsx(f.Fragment,{children:u.type==="photo"?n.jsxs("a",{href:e.url,className:L.clsx(I.mediaContainer,I.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:I.skeleton,style:nt(u,o)}),n.jsx(h,{src:mt(u,"small"),alt:u.ext_alt_text||"Image",className:I.image,draggable:!0})]},u.media_url_https):n.jsxs("div",{className:I.mediaContainer,children:[n.jsx("div",{className:I.skeleton,style:nt(u,o)}),n.jsx(Wn,{tweet:e,media:u})]},u.media_url_https)},u.media_url_https))})})},Fn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Pn=new Intl.DateTimeFormat("en-US",Fn),Un=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},zn=e=>{const t=Un(Pn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Hn="_root_i24yn_1",Gn={root:Hn},Xn=({tweet:e})=>{const t=new Date(e.created_at),r=zn(t);return n.jsx("a",{className:Gn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Kn="_info_19qcj_1",Qn="_infoLink_19qcj_10",Jn="_infoIcon_19qcj_30",be={info:Kn,infoLink:Qn,infoIcon:Jn},Yn=({tweet:e})=>n.jsxs("div",{className:be.info,children:[n.jsx(Xn,{tweet:e}),n.jsx("a",{className:be.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:be.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),Zn="_actions_n2anf_1",er="_like_n2anf_13",tr="_reply_n2anf_14",nr="_copy_n2anf_15",rr="_likeIconWrapper_n2anf_27",sr="_likeCount_n2anf_30",ir="_replyIconWrapper_n2anf_35",or="_copyIconWrapper_n2anf_36",ar="_likeIcon_n2anf_27",cr="_replyIcon_n2anf_35",lr="_copyIcon_n2anf_36",dr="_replyText_n2anf_56",ur="_copyText_n2anf_57",S={actions:Zn,like:er,reply:tr,copy:nr,likeIconWrapper:rr,likeCount:sr,replyIconWrapper:ir,copyIconWrapper:or,likeIcon:ar,replyIcon:cr,copyIcon:lr,replyText:dr,copyText:ur},fr=({tweet:e})=>{const[t,r]=f.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return f.useEffect(()=>{if(t){const i=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(i)}},[t]),n.jsxs("button",{type:"button",className:S.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:S.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:S.copyText,children:t?"Copied!":"Copy link"})]})},hr=({tweet:e})=>{const t=Ce(e.favorite_count);return n.jsxs("div",{className:S.actions,children:[n.jsxs("a",{className:S.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:S.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:S.likeCount,children:t})]}),n.jsxs("a",{className:S.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:S.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:S.replyText,children:"Reply"})]}),n.jsx(fr,{tweet:e})]})},_r="_replies_1cutb_1",mr="_link_1cutb_4",xr="_text_1cutb_23",Te={replies:_r,link:mr,text:xr},pr=({tweet:e})=>n.jsx("div",{className:Te.replies,children:n.jsx("a",{className:Te.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Te.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ce(e.conversation_count)} reply`:`Read ${Ce(e.conversation_count)} replies`})})}),vr="_root_q5799_1",gr="_article_q5799_16",rt={root:vr,article:gr},jr=({tweet:e,children:t})=>n.jsx("div",{className:rt.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:rt.article,children:t})}),wr="_header_r31i5_1",yr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Tr="_author_r31i5_21",Nr="_authorText_r31i5_26",Rr="_username_r31i5_33",Q={header:wr,avatar:yr,avatarSquare:br,author:Tr,authorText:Nr,username:Rr},kr=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:Q.header,children:[n.jsx("a",{href:e.url,className:Q.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:L.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(ft,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:Q.author,children:[n.jsx("div",{className:Q.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(ht,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Sr="_root_175ot_1",Er={root:Sr},Ir=({tweet:e})=>n.jsx("p",{className:Er.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Cr=({tweet:e})=>{var t;return n.jsxs(jr,{tweet:e,children:[n.jsx(kr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(xt,{quoted:!0,tweet:e}):null]})},Lr=({tweet:e,components:t})=>{var r;const s=f.useMemo(()=>Tn(e),[e]);return n.jsxs(Be,{children:[n.jsx(sn,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(cn,{tweet:s}),n.jsx(_n,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(xt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(Yn,{tweet:s}),n.jsx(hr,{tweet:s}),n.jsx(pr,{tweet:s})]})},Or="_root_16yxa_1",qr={root:Or},Dr=e=>n.jsx(Be,{children:n.jsxs("div",{className:qr.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),$r="_skeleton_oi7hr_1",Ar={skeleton:$r},me=({style:e})=>n.jsx("span",{className:Ar.skeleton,style:e}),Vr="_root_17qqv_1",Mr={root:Vr},Wr=()=>n.jsxs(Be,{className:Mr.root,children:[n.jsx(me,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(me,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(me,{style:{height:"2rem"}}),n.jsx(me,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),pt=0,vt=1,gt=2,st=3;var it=Object.prototype.hasOwnProperty;function Le(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Le(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(it.call(e,r)&&++s&&!it.call(t,r)||!(r in t)||!Le(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const P=new WeakMap,U=()=>{},R=U(),Oe=Object,d=e=>e===R,W=e=>typeof e=="function",H=(e,t)=>({...e,...t}),jt=e=>W(e.then),Ne={},xe={},Fe="undefined",de=typeof window!=Fe,qe=typeof document!=Fe,Br=de&&"Deno"in window,Fr=()=>de&&typeof window.requestAnimationFrame!=Fe,wt=(e,t)=>{const r=P.get(e);return[()=>!d(t)&&e.get(t)||Ne,s=>{if(!d(t)){const i=e.get(t);t in xe||(xe[t]=i),r[5](t,H(i,s),i||Ne)}},r[6],()=>!d(t)&&t in xe?xe[t]:!d(t)&&e.get(t)||Ne]};let De=!0;const Pr=()=>De,[$e,Ae]=de&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],Ur=()=>{const e=qe&&document.visibilityState;return d(e)||e!=="hidden"},zr=e=>(qe&&document.addEventListener("visibilitychange",e),$e("focus",e),()=>{qe&&document.removeEventListener("visibilitychange",e),Ae("focus",e)}),Hr=e=>{const t=()=>{De=!0,e()},r=()=>{De=!1};return $e("online",t),$e("offline",r),()=>{Ae("online",t),Ae("offline",r)}},Gr={isOnline:Pr,isVisible:Ur},Xr={initFocus:zr,initReconnect:Hr},ot=!f.useId,oe=!de||Br,Kr=e=>Fr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=oe?f.useEffect:f.useLayoutEffect,ke=typeof navigator<"u"&&navigator.connection,at=!oe&&ke&&(["slow-2g","2g"].includes(ke.effectiveType)||ke.saveData),pe=new WeakMap,Qr=e=>Oe.prototype.toString.call(e),Se=(e,t)=>e===`[object ${t}]`;let Jr=0;const Ve=e=>{const t=typeof e,r=Qr(e),s=Se(r,"Date"),i=Se(r,"RegExp"),a=Se(r,"Object");let o,l;if(Oe(e)===e&&!s&&!i){if(o=pe.get(e),o)return o;if(o=++Jr+"~",pe.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=Ve(e[l])+",";pe.set(e,o)}if(a){o="#";const h=Oe.keys(e).sort();for(;!d(l=h.pop());)d(e[l])||(o+=l+":"+Ve(e[l])+",");pe.set(e,o)}}else o=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Pe=e=>{if(W(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ve(e):"",[e,t]};let Yr=0;const Me=()=>++Yr;async function yt(...e){const[t,r,s,i]=e,a=H({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const l=a.rollbackOnError;let h=a.optimisticData;const u=w=>typeof l=="function"?l(w):l!==!1,j=a.throwOnError;if(W(r)){const w=r,N=[],E=t.keys();for(const O of E)!/^\$(inf|sub)\$/.test(O)&&w(t.get(O)._k)&&N.push(O);return Promise.all(N.map(p))}return p(r);async function p(w){const[N]=Pe(w);if(!N)return;const[E,O]=wt(t,N),[$,ae,c,ue]=P.get(t),J=()=>{const q=$[N];return(W(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete c[N],delete ue[N],q&&q[0])?q[0](gt).then(()=>E().data):E().data};if(e.length<3)return J();let y=s,A,V=!1;const Y=Me();ae[N]=[Y,0];const m=!d(h),Z=E(),M=Z.data,ee=Z._c,G=d(ee)?M:ee;if(m&&(h=W(h)?h(G,M):h,O({data:h,_c:G})),W(y))try{y=y(G)}catch(q){A=q,V=!0}if(y&&jt(y))if(y=await y.catch(q=>{A=q,V=!0}),Y!==ae[N][0]){if(V)throw A;return y}else V&&m&&u(A)&&(o=!0,O({data:G,_c:R}));if(o&&!V)if(W(o)){const q=o(y,G);O({data:q,error:R,_c:R})}else O({data:y,error:R,_c:R});if(ae[N][1]=Me(),Promise.resolve(J()).then(()=>{O({_c:R})}),V){if(j)throw A;return}return y}}const ct=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},Zr=(e,t)=>{if(!P.has(e)){const r=H(Xr,t),s=Object.create(null),i=yt.bind(R,e);let a=U;const o=Object.create(null),l=(j,p)=>{const w=o[j]||[];return o[j]=w,w.push(p),()=>w.splice(w.indexOf(p),1)},h=(j,p,w)=>{e.set(j,p);const N=o[j];if(N)for(const E of N)E(p,w)},u=()=>{if(!P.has(e)&&(P.set(e,[s,Object.create(null),Object.create(null),Object.create(null),i,h,l]),!oe)){const j=r.initFocus(setTimeout.bind(R,ct.bind(R,s,pt))),p=r.initReconnect(setTimeout.bind(R,ct.bind(R,s,vt)));a=()=>{j&&j(),p&&p(),P.delete(e)}}};return u(),[e,i,u,a]}return[e,P.get(e)[4]]},es=(e,t,r,s,i)=>{const a=r.errorRetryCount,o=i.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!d(a)&&o>a||setTimeout(s,l,i)},ts=Le,[bt,ns]=Zr(new Map),rs=H({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:es,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:at?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:at?5e3:3e3,compare:ts,isPaused:()=>!1,cache:bt,mutate:ns,fallback:{}},Gr),ss=(e,t)=>{const r=H(e,t);if(t){const{use:s,fallback:i}=e,{use:a,fallback:o}=t;s&&a&&(r.use=s.concat(a)),i&&o&&(r.fallback=H(i,o))}return r},is=f.createContext({}),os="$inf$",Tt=de&&window.__SWR_DEVTOOLS_USE__,as=Tt?window.__SWR_DEVTOOLS_USE__:[],cs=()=>{Tt&&(window.__SWR_DEVTOOLS_REACT__=f)},ls=e=>W(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ds=()=>{const e=f.useContext(is);return f.useMemo(()=>H(rs,e),[e])},us=e=>(t,r,s)=>e(t,r&&((...a)=>{const[o]=Pe(t),[,,,l]=P.get(bt);if(o.startsWith(os))return r(...a);const h=l[o];return d(h)?r(...a):(delete l[o],h)}),s),fs=as.concat(us),hs=e=>function(...r){const s=ds(),[i,a,o]=ls(r),l=ss(s,o);let h=e;const{use:u}=l,j=(u||[]).concat(fs);for(let p=j.length;p--;)h=j[p](h);return h(i,a||l.fetcher||null,l)},_s=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const i=s.indexOf(r);i>=0&&(s[i]=s[s.length-1],s.pop())}};cs();const Ee=f.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ie={dedupe:!0},lt=Promise.resolve(R),ms=(e,t,r)=>{const{cache:s,compare:i,suspense:a,fallbackData:o,revalidateOnMount:l,revalidateIfStale:h,refreshInterval:u,refreshWhenHidden:j,refreshWhenOffline:p,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,O,$,ae]=P.get(s),[c,ue]=Pe(e),J=f.useRef(!1),y=f.useRef(!1),A=f.useRef(c),V=f.useRef(t),Y=f.useRef(r),m=()=>Y.current,Z=()=>m().isVisible()&&m().isOnline(),[M,ee,G,q]=wt(s,c),te=f.useRef({}).current,fe=d(o)?d(r.fallback)?R:r.fallback[c]:o,Ue=(_,x)=>{for(const g in te){const v=g;if(v==="data"){if(!i(_[v],x[v])&&(!d(_[v])||!i(_e,x[v])))return!1}else if(x[v]!==_[v])return!1}return!0},ze=f.useMemo(()=>{const _=!c||!t?!1:d(l)?m().isPaused()||a?!1:h!==!1:l,x=k=>{const B=H(k);return delete B._k,_?{isValidating:!0,isLoading:!0,...B}:B},g=M(),v=q(),D=x(g),se=g===v?D:x(v);let b=D;return[()=>{const k=x(M());return Ue(k,b)?(b.data=k.data,b.isLoading=k.isLoading,b.isValidating=k.isValidating,b.error=k.error,b):(b=k,k)},()=>se]},[s,c]),ne=L.shimExports.useSyncExternalStore(f.useCallback(_=>G(c,(x,g)=>{Ue(g,x)||_()}),[s,c]),ze[0],ze[1]),He=!J.current,kt=E[c]&&E[c].length>0,re=ne.data,X=d(re)?fe&&jt(fe)?Ee(fe):fe:re,he=ne.error,ve=f.useRef(X),_e=w?d(re)?d(ve.current)?X:ve.current:re:X,K=c&&d(X),St=!oe&&L.shimExports.useSyncExternalStore(()=>U,()=>!1,()=>!0);N&&St&&!a&&K&&console.warn(`Missing pre-initiated data for serialized key "${c}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ge=kt&&!d(he)?!1:He&&!d(l)?l:m().isPaused()?!1:a?d(X)?!1:h:d(X)||h,Xe=!!(c&&t&&He&&Ge),Et=d(ne.isValidating)?Xe:ne.isValidating,It=d(ne.isLoading)?Xe:ne.isLoading,ce=f.useCallback(async _=>{const x=V.current;if(!c||!x||y.current||m().isPaused())return!1;let g,v,D=!0;const se=_||{},b=!$[c]||!se.dedupe,k=()=>ot?!y.current&&c===A.current&&J.current:c===A.current,B={isValidating:!1,isLoading:!1},Qe=()=>{ee(B)},Je=()=>{const C=$[c];C&&C[1]===v&&delete $[c]},Ye={isValidating:!0};d(M().data)&&(Ye.isLoading=!0);try{if(b&&(ee(Ye),r.loadingTimeout&&d(M().data)&&setTimeout(()=>{D&&k()&&m().onLoadingSlow(c,r)},r.loadingTimeout),$[c]=[x(ue),Me()]),[g,v]=$[c],g=await g,b&&setTimeout(Je,r.dedupingInterval),!$[c]||$[c][1]!==v)return b&&k()&&m().onDiscarded(c),!1;B.error=R;const C=O[c];if(!d(C)&&(v<=C[0]||v<=C[1]||C[1]===0))return Qe(),b&&k()&&m().onDiscarded(c),!1;const F=M().data;B.data=i(F,g)?F:g,b&&k()&&m().onSuccess(g,c,r)}catch(C){Je();const F=m(),{shouldRetryOnError:ge}=F;F.isPaused()||(B.error=C,b&&k()&&(F.onError(C,c,F),(ge===!0||W(ge)&&ge(C))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||Z())&&F.onErrorRetry(C,c,F,Ct=>{const je=E[c];je&&je[0]&&je[0](st,Ct)},{retryCount:(se.retryCount||0)+1,dedupe:!0})))}return D=!1,Qe(),!0},[c,s]),Ke=f.useCallback((..._)=>yt(s,A.current,..._),[]);if(Re(()=>{V.current=t,Y.current=r,d(re)||(ve.current=re)}),Re(()=>{if(!c)return;const _=ce.bind(R,Ie);let x=0;m().revalidateOnFocus&&(x=Date.now()+m().focusThrottleInterval);const v=_s(c,E,(D,se={})=>{if(D==pt){const b=Date.now();m().revalidateOnFocus&&b>x&&Z()&&(x=b+m().focusThrottleInterval,_())}else if(D==vt)m().revalidateOnReconnect&&Z()&&_();else{if(D==gt)return ce();if(D==st)return ce(se)}});return y.current=!1,A.current=c,J.current=!0,ee({_k:ue}),Ge&&($[c]||(d(X)||oe?_():Kr(_))),()=>{y.current=!0,v()}},[c]),Re(()=>{let _;function x(){const v=W(u)?u(M().data):u;v&&_!==-1&&(_=setTimeout(g,v))}function g(){!M().error&&(j||m().isVisible())&&(p||m().isOnline())?ce(Ie).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[u,j,p,c]),f.useDebugValue(_e),a){if(!ot&&oe&&K)throw new Error("Fallback data is required when using Suspense in SSR.");K&&(V.current=t,Y.current=r,y.current=!1);const _=ae[c],x=!d(_)&&K?Ke(_):lt;if(Ee(x),!d(he)&&K)throw he;const g=K?ce(Ie):lt;!d(_e)&&K&&(g.status="fulfilled",g.value=!0),Ee(g)}return{mutate:Ke,get data(){return te.data=!0,_e},get error(){return te.error=!0,he},get isValidating(){return te.isValidating=!0,Et},get isLoading(){return te.isLoading=!0,It}}},dt=hs(ms);class xs extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ps=dt.default||dt,vs="https://react-tweet.vercel.app";async function gs([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new xs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const js=(e,t,r)=>{const{isLoading:s,data:i,error:a}=ps(()=>t||e?[t||e&&`${vs}/api/tweet/${e}`,r]:null,gs,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||i===void 0&&!a),data:i,error:a}},ws=({id:e,apiUrl:t,fallback:r=n.jsx(Wr,{}),components:s,fetchOptions:i,onError:a})=>{const{data:o,error:l,isLoading:h}=js(e,t,i);if(h)return r;if(l||!o){const u=(s==null?void 0:s.TweetNotFound)||Dr;return n.jsx(u,{error:a?a(l):l})}return n.jsx(Lr,{tweet:o,components:s})};function ys({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(L.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(ws,{id:r})})}):null}function Nt(e){const{t}=Lt.useLocale(),[r,s]=f.useState("");f.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:o}=(a=e.editor)==null?void 0:a.getAttributes(Rt.name);o&&s(o)}},[e==null?void 0:e.editor]);function i(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return n.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:i,children:[n.jsx(z.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(z.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(z.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function bs(e){function t(r){e.action&&e.action(r)}return n.jsxs(z.Popover,{modal:!0,children:[n.jsx(z.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(z.ActionButton,{tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(z.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(z.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Nt,{editor:e.editor,onSetLink:t})})]})}const Ts=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ns=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ut(e){return e.match(Ns)}const Rt=we.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:bs,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return L.ReactNodeViewRenderer(ys,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>ut(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ut(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[we.nodePasteRule({find:Ts,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",we.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Nt;exports.Twitter=Rt;
@@ -1,2 +0,0 @@
1
- "use strict";var H=Object.create;var q=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var J=(e,i,o,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of _(i))!Z.call(e,s)&&s!==o&&q(e,s,{get:()=>i[s],enumerable:!(a=V(i,s))||a.enumerable});return e};var Q=(e,i,o)=>(o=e!=null?H(G(e)):{},J(i||!e||!e.__esModule?q(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),n=require("./RichTextEditor-CxvwGvQG.cjs"),L=require("./Mermaid.cjs"),B=require("./shortId-Bfj8TyNr.cjs"),K=require("./textarea-DFo_aXnj.cjs"),E=require("./index-6D1J-A-o.cjs"),M=require("./Excalidraw-BbMQhNvs.cjs"),F=require("./Twitter-Cutpkh3h.cjs"),X=require("katex"),W=require("lucide-react"),T=require("./Katex.cjs"),z=require("./Drawer-CdvCMSzN.cjs"),R=require("easydrawer"),O=`graph TB
2
- a-->b`,Y=({editor:e,attrs:i,extension:o})=>{const{alt:a,align:s}=i,[r,l]=c.useState(decodeURIComponent(a??O)),[u,x]=c.useState(""),[f,g]=c.useState(!1),w=c.useRef(null),[b,y]=c.useState(null),S=o==null?void 0:o.options.upload,A=c.useCallback(p=>{p&&import("mermaid").then(j=>{y(j.default)})},[]),k=async p=>{try{const{svg:j}=await b.render("mermaid-svg",p);x(j)}catch{x("")}},D=()=>{b.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),k(r)};c.useEffect(()=>{b&&f&&D()},[b,f]),c.useEffect(()=>{b&&f&&k(r)},[b,r]);const N=async()=>{if(r!==""){if(r){const p=w.current.querySelector("svg"),{width:j,height:I}=p.getBoundingClientRect(),m=`mermaid-${B.shortId()}.svg`;let d=B.i(p.outerHTML);if(S){const h=n.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:I},!!r).run(),e==null||e.commands.setAlignImageMermaid(s)}g(!1)}};return t.jsxs(n.Dialog,{onOpenChange:g,open:f,children:[t.jsx(n.DialogTrigger,{asChild:!0,children:t.jsx(n.ActionButton,{action:()=>g(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(n.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(n.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:A,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(K.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:O,onChange:p=>l(p.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:w,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(n.DialogFooter,{children:t.jsx(n.Button,{onClick:N,type:"button",children:"Save changes"})})]})]})};function U(e,i){const[o,a]=c.useState(void 0);return c.useEffect(()=>{const s=()=>{const r=e.extensionManager.extensions.find(l=>l.name===i);r&&a(r)};return e.on("selectionUpdate",s),e.on("transaction",s),()=>{e.off("selectionUpdate",s),e.off("transaction",s)}},[e,i]),o}function ee({item:e,disabled:i,editor:o}){var s;const a=e.component;return a?t.jsx(c.Fragment,{children:e.type==="divider"?t.jsx(n.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(a,{...e.componentProps,disabled:i||((s=e==null?void 0:e.componentProps)==null?void 0:s.disabled),editor:o})}):t.jsx(t.Fragment,{})}function te(e){return e.type.name==="mermaid"}function re(e){const{lang:i}=E.useLocale(),o=n.useAttributes(e.editor,L.Mermaid.name),a=U(e.editor,L.Mermaid.name),s=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let g=!1;return l.view.state.doc.nodesBetween(x.pos,f,w=>{if(te(w))return g=!0,!1}),g},r=c.useMemo(()=>e.disabled?[]:n.getBubbleMermaid(e.editor),[e.disabled,e.editor,i]);return t.jsx(t.Fragment,{children:t.jsx(n.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:s,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(o!=null&&o.src)?t.jsx(Y,{attrs:o,editor:e.editor,extension:a},`bubbleMenu-mermaid-${u}`):t.jsx(ee,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function ne(e){const i=e.options.element;v.has("width")||v.set("width",i.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",i.clientWidth);const o={attributes:!0,childList:!0,subtree:!0},a=function(){v.set("width",i.clientWidth)},s=new MutationObserver(a);return s.observe(i,o),e.on("destroy",()=>{s.disconnect()}),{width:v.get("width")}}function ie({editor:e}){const{t:i}=E.useLocale(),{width:o}=ne(e),a=n.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:s,createUser:r,width:l,height:u}=a,x=c.useCallback(b=>{e.chain().updateAttributes(M.Excalidraw.name,b).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=c.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...a,editor:e})},[e,a]),g=c.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),w=c.useCallback(()=>n.deleteNode(M.Excalidraw.name,e),[e]);return c.useEffect(()=>{s&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,s,e,f]),t.jsx(n.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:g,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:t.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[t.jsx(n.ActionButton,{action:f,icon:"Pencil",tooltip:i("editor.edit")}),t.jsx(n.SizeSetter,{height:u,maxWidth:o,onOk:x,width:l,children:t.jsx(n.ActionButton,{icon:"Settings",tooltip:i("editor.settings")})}),t.jsx(n.ActionButton,{action:w,icon:"Trash2",tooltip:i("editor.delete")})]})})}function se({editor:e,disabled:i}){const[o,a]=c.useState(!1),{t:s}=E.useLocale(),r=c.useCallback(({editor:x})=>x.isActive(F.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),a(!1)},u=c.useCallback(()=>n.deleteNode(F.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(n.BubbleMenu,{editor:e,shouldShow:r,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:i?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:o?t.jsx(F.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(n.ActionButton,{icon:"Pencil",tooltip:s("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{a(!0)}}),t.jsx(n.ActionButton,{action:u,icon:"Trash",tooltip:s("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function oe({editor:e,...i}){const o=n.useAttributes(e,T.Katex.name,{text:"",defaultShowPicker:!1}),{text:a,defaultShowPicker:s}=o,[r,l]=c.useState(""),[u,x]=c.useState(!1),f=c.useCallback(()=>e.isActive(T.Katex.name),[e]),g=c.useCallback(()=>n.deleteNode(T.Katex.name,e),[e]),w=c.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);c.useEffect(()=>{s&&(x(!0),e.chain().updateAttributes(T.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,s,x]),c.useEffect(()=>{u&&l(a||"")},[u]);const b=c.useMemo(()=>{try{return X.renderToString(`${r}`)}catch{return r}},[r]),y=c.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:b||""}}):null,[r,b]);return t.jsx(n.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:i!=null&&i.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(K.Textarea,{autoFocus:!0,defaultValue:a,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(n.Button,{className:"richtext-flex-1",onClick:w,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(W.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(n.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(W.Pencil,{size:16})}),t.jsx(n.ActionButton,{action:g,tooltip:"Delete",children:t.jsx(W.Trash2,{size:16})})]})})})}let C=!1;function ce({editor:e,attrs:i,extension:o}){const[a,s]=c.useState(!1),r=c.useRef(null),l=c.useRef(null),{alt:u,align:x}=i,f=o==null?void 0:o.options.upload,g=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};c.useEffect(()=>{a&&setTimeout(()=>{g()},200)},[a]);const w=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${B.shortId()}.svg`;let P=B.i(m.outerHTML);if(f){const $=n.dataURLtoFile(P,h);P=await f($)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}s(!1)},b=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},A=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},k=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},D=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},p=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},I=()=>{if(!C){for(;r.current.history.undoStackSize>0;)p();C=!0}};return t.jsxs(n.Dialog,{onOpenChange:s,open:a,children:[t.jsx(n.DialogTrigger,{asChild:!0,children:t.jsx(n.ActionButton,{action:()=>s(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(n.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(n.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(z.ControlDrawer,{changeBorderColorShape:N,changeColorShape:k,changeShape:A,onClear:I,onRedo:j,onThicknessChange:D,onUndo:p,refEditor:r,setColorHighlight:S,setColorPen:b,setThicknessPen:y})]}),t.jsx(n.DialogFooter,{children:t.jsx(n.Button,{onClick:w,type:"button",children:"Save changes"})})]})]})}function ae({item:e,disabled:i,editor:o}){var s;const a=e.component;return a?t.jsx(c.Fragment,{children:e.type==="divider"?t.jsx(n.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(a,{...e.componentProps,disabled:i||((s=e==null?void 0:e.componentProps)==null?void 0:s.disabled),editor:o})}):t.jsx(t.Fragment,{})}function le(e){return e.type.name==="drawer"}function de(e){const{lang:i}=E.useLocale(),o=n.useAttributes(e.editor,z.Drawer.name),a=U(e.editor,z.Drawer.name),s=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let g=!1;return l.view.state.doc.nodesBetween(x.pos,f,w=>{if(le(w))return g=!0,!1}),g},r=c.useMemo(()=>e.disabled?[]:n.getBubbleDrawer(e.editor),[e.disabled,e.editor,i]);return t.jsx(n.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:s,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(o!=null&&o.src)?t.jsx(ce,{attrs:o,editor:e.editor,extension:a},`bubbleMenu-drawer-${u}`):t.jsx(ae,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})}exports.BubbleMenuDrawer=de;exports.BubbleMenuExcalidraw=ie;exports.BubbleMenuKatex=oe;exports.BubbleMenuMermaid=re;exports.BubbleMenuTwitter=se;