reactjs-tiptap-editor 0.3.11 → 0.3.13

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 (233) hide show
  1. package/lib/{ActionMenuButton-BQ2ojtpo.js → ActionMenuButton-BfH5nAGi.js} +1 -1
  2. package/lib/{ActionMenuButton-OfnmanTP.cjs → ActionMenuButton-Cbbnqd-L.cjs} +1 -1
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.d.cts +17 -17
  5. package/lib/Attachment.d.ts +17 -17
  6. package/lib/Attachment.js +5 -5
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +17 -17
  9. package/lib/Blockquote.d.ts +17 -17
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +17 -17
  13. package/lib/Bold.d.ts +17 -17
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +17 -17
  17. package/lib/BulletList.d.ts +17 -17
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +17 -17
  21. package/lib/Clear.d.ts +17 -17
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +17 -17
  25. package/lib/Code.d.ts +17 -17
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +17 -17
  29. package/lib/CodeBlock.d.ts +17 -17
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +17 -17
  33. package/lib/CodeView.d.ts +17 -17
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +17 -17
  37. package/lib/Color.d.ts +17 -17
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.d.cts +17 -17
  40. package/lib/Document.d.ts +17 -17
  41. package/lib/Document.js +1 -1
  42. package/lib/{Drawer-9QMJnenp.js → Drawer-DUXFBfgE.js} +3 -3
  43. package/lib/{Drawer-BN8H4Zb2.cjs → Drawer-jPHImfyr.cjs} +1 -1
  44. package/lib/Drawer.cjs +1 -1
  45. package/lib/Drawer.d.cts +17 -17
  46. package/lib/Drawer.d.ts +17 -17
  47. package/lib/Drawer.js +4 -4
  48. package/lib/Emoji.cjs +1 -1
  49. package/lib/Emoji.d.cts +17 -17
  50. package/lib/Emoji.d.ts +17 -17
  51. package/lib/Emoji.js +4 -4
  52. package/lib/{Excalidraw-B95hkXm5.js → Excalidraw-BBOIIhij.js} +3 -3
  53. package/lib/{Excalidraw-iG1WleD5.cjs → Excalidraw-CwZ3g3p-.cjs} +1 -1
  54. package/lib/Excalidraw.cjs +1 -1
  55. package/lib/Excalidraw.d.cts +17 -17
  56. package/lib/Excalidraw.d.ts +17 -17
  57. package/lib/Excalidraw.js +3 -3
  58. package/lib/ExportPdf.cjs +1 -1
  59. package/lib/ExportPdf.d.cts +17 -17
  60. package/lib/ExportPdf.d.ts +17 -17
  61. package/lib/ExportPdf.js +2 -2
  62. package/lib/ExportWord.cjs +1 -1
  63. package/lib/ExportWord.d.cts +17 -17
  64. package/lib/ExportWord.d.ts +17 -17
  65. package/lib/ExportWord.js +2 -2
  66. package/lib/FontFamily.cjs +1 -1
  67. package/lib/FontFamily.d.cts +17 -17
  68. package/lib/FontFamily.d.ts +17 -17
  69. package/lib/FontFamily.js +4 -4
  70. package/lib/FontSize.cjs +1 -1
  71. package/lib/FontSize.d.cts +17 -17
  72. package/lib/FontSize.d.ts +17 -17
  73. package/lib/FontSize.js +3 -3
  74. package/lib/FormatPainter.cjs +1 -1
  75. package/lib/FormatPainter.d.cts +17 -17
  76. package/lib/FormatPainter.d.ts +17 -17
  77. package/lib/FormatPainter.js +2 -2
  78. package/lib/Heading.cjs +1 -1
  79. package/lib/Heading.d.cts +17 -17
  80. package/lib/Heading.d.ts +17 -17
  81. package/lib/Heading.js +3 -3
  82. package/lib/Highlight.cjs +1 -1
  83. package/lib/Highlight.d.cts +17 -17
  84. package/lib/Highlight.d.ts +17 -17
  85. package/lib/Highlight.js +2 -2
  86. package/lib/History.cjs +1 -1
  87. package/lib/History.d.cts +17 -17
  88. package/lib/History.d.ts +17 -17
  89. package/lib/History.js +2 -2
  90. package/lib/HorizontalRule.cjs +1 -1
  91. package/lib/HorizontalRule.d.cts +17 -17
  92. package/lib/HorizontalRule.d.ts +17 -17
  93. package/lib/HorizontalRule.js +2 -2
  94. package/lib/Iframe.cjs +1 -1
  95. package/lib/Iframe.d.cts +17 -17
  96. package/lib/Iframe.d.ts +17 -17
  97. package/lib/Iframe.js +3 -3
  98. package/lib/Image.cjs +1 -1
  99. package/lib/Image.d.cts +17 -17
  100. package/lib/Image.d.ts +17 -17
  101. package/lib/Image.js +3 -3
  102. package/lib/ImageGif.cjs +1 -1
  103. package/lib/ImageGif.d.cts +17 -17
  104. package/lib/ImageGif.d.ts +17 -17
  105. package/lib/ImageGif.js +3 -3
  106. package/lib/ImportWord.cjs +1 -1
  107. package/lib/ImportWord.d.cts +17 -17
  108. package/lib/ImportWord.d.ts +17 -17
  109. package/lib/ImportWord.js +2 -2
  110. package/lib/Indent.cjs +1 -1
  111. package/lib/Indent.d.cts +17 -17
  112. package/lib/Indent.d.ts +17 -17
  113. package/lib/Indent.js +2 -2
  114. package/lib/Italic.cjs +1 -1
  115. package/lib/Italic.d.cts +17 -17
  116. package/lib/Italic.d.ts +17 -17
  117. package/lib/Italic.js +2 -2
  118. package/lib/Katex.cjs +1 -1
  119. package/lib/Katex.d.cts +17 -17
  120. package/lib/Katex.d.ts +17 -17
  121. package/lib/Katex.js +4 -4
  122. package/lib/LineHeight.cjs +1 -1
  123. package/lib/LineHeight.d.cts +17 -17
  124. package/lib/LineHeight.d.ts +17 -17
  125. package/lib/LineHeight.js +2 -2
  126. package/lib/Link.cjs +1 -5
  127. package/lib/Link.d.cts +20 -18
  128. package/lib/Link.d.ts +20 -18
  129. package/lib/Link.js +4 -1048
  130. package/lib/ListItem.d.cts +17 -17
  131. package/lib/ListItem.d.ts +17 -17
  132. package/lib/ListItem.js +1 -1
  133. package/lib/Mention.d.cts +17 -17
  134. package/lib/Mention.d.ts +17 -17
  135. package/lib/Mention.js +3 -3
  136. package/lib/Mermaid.cjs +2 -2
  137. package/lib/Mermaid.d.cts +17 -17
  138. package/lib/Mermaid.d.ts +17 -17
  139. package/lib/Mermaid.js +4 -4
  140. package/lib/MoreMark.cjs +1 -1
  141. package/lib/MoreMark.d.cts +17 -17
  142. package/lib/MoreMark.d.ts +17 -17
  143. package/lib/MoreMark.js +3 -3
  144. package/lib/MultiColumn.cjs +1 -1
  145. package/lib/MultiColumn.d.cts +17 -17
  146. package/lib/MultiColumn.d.ts +17 -17
  147. package/lib/MultiColumn.js +2 -2
  148. package/lib/OrderedList.cjs +1 -1
  149. package/lib/OrderedList.d.cts +17 -17
  150. package/lib/OrderedList.d.ts +17 -17
  151. package/lib/OrderedList.js +2 -2
  152. package/lib/RichTextEditor-C3sK_Ys3.cjs +141 -0
  153. package/lib/{RichTextEditor-CFwUKN9i.js → RichTextEditor-OW4s40FH.js} +4817 -3766
  154. package/lib/SearchAndReplace.cjs +1 -1
  155. package/lib/SearchAndReplace.d.cts +17 -17
  156. package/lib/SearchAndReplace.d.ts +17 -17
  157. package/lib/SearchAndReplace.js +2 -2
  158. package/lib/Selection.d.cts +17 -17
  159. package/lib/Selection.d.ts +17 -17
  160. package/lib/Selection.js +1 -1
  161. package/lib/SlashCommand.cjs +1 -1
  162. package/lib/SlashCommand.d.cts +17 -17
  163. package/lib/SlashCommand.d.ts +17 -17
  164. package/lib/SlashCommand.js +18 -18
  165. package/lib/Strike.cjs +1 -1
  166. package/lib/Strike.d.cts +17 -17
  167. package/lib/Strike.d.ts +17 -17
  168. package/lib/Strike.js +2 -2
  169. package/lib/SubAndSuperScript.cjs +1 -1
  170. package/lib/SubAndSuperScript.d.cts +17 -17
  171. package/lib/SubAndSuperScript.d.ts +17 -17
  172. package/lib/SubAndSuperScript.js +3 -3
  173. package/lib/Table.cjs +2 -2
  174. package/lib/Table.d.cts +17 -17
  175. package/lib/Table.d.ts +17 -17
  176. package/lib/Table.js +16 -16
  177. package/lib/TableOfContent.cjs +1 -1
  178. package/lib/TableOfContent.d.cts +17 -17
  179. package/lib/TableOfContent.d.ts +17 -17
  180. package/lib/TableOfContent.js +5 -5
  181. package/lib/TaskList.cjs +1 -1
  182. package/lib/TaskList.d.cts +17 -17
  183. package/lib/TaskList.d.ts +17 -17
  184. package/lib/TaskList.js +2 -2
  185. package/lib/TextAlign.cjs +1 -1
  186. package/lib/TextAlign.d.cts +17 -17
  187. package/lib/TextAlign.d.ts +17 -17
  188. package/lib/TextAlign.js +2 -2
  189. package/lib/TextBubble.cjs +1 -1
  190. package/lib/TextBubble.d.cts +17 -17
  191. package/lib/TextBubble.d.ts +17 -17
  192. package/lib/TextBubble.js +2 -2
  193. package/lib/TextDirection.cjs +1 -1
  194. package/lib/TextDirection.d.cts +17 -17
  195. package/lib/TextDirection.d.ts +17 -17
  196. package/lib/TextDirection.js +2 -2
  197. package/lib/TextUnderline.cjs +1 -1
  198. package/lib/TextUnderline.d.cts +17 -17
  199. package/lib/TextUnderline.d.ts +17 -17
  200. package/lib/TextUnderline.js +2 -2
  201. package/lib/TrailingNode.d.cts +17 -17
  202. package/lib/TrailingNode.d.ts +17 -17
  203. package/lib/TrailingNode.js +1 -1
  204. package/lib/{Twitter-ChRmdJB0.js → Twitter-2LOf4hFb.js} +44 -44
  205. package/lib/{Twitter-DbokWMq-.cjs → Twitter-Cg58uzB-.cjs} +3 -3
  206. package/lib/Twitter.cjs +1 -1
  207. package/lib/Twitter.d.cts +17 -17
  208. package/lib/Twitter.d.ts +17 -17
  209. package/lib/Twitter.js +3 -3
  210. package/lib/Video.cjs +1 -1
  211. package/lib/Video.d.cts +17 -17
  212. package/lib/Video.d.ts +17 -17
  213. package/lib/Video.js +2 -2
  214. package/lib/bubble-extra.cjs +2 -2
  215. package/lib/bubble-extra.d.cts +17 -17
  216. package/lib/bubble-extra.d.ts +17 -17
  217. package/lib/bubble-extra.js +6 -6
  218. package/lib/{dom-dataset-2RXYq9wp.js → dom-dataset-CHDbKz5J.js} +1 -1
  219. package/lib/{index-CXIIg9Sq.js → index-BWx1Mchx.js} +21 -21
  220. package/lib/{index-BGwJ0NfQ.js → index-DEFQHExY.js} +1 -1
  221. package/lib/{index-BkoojfPK.js → index-DIPntess.js} +1 -1
  222. package/lib/{index-fKx6CYUM.js → index-oQutU45z.js} +1 -1
  223. package/lib/index.cjs +1 -1
  224. package/lib/index.d.cts +19 -17
  225. package/lib/index.d.ts +19 -17
  226. package/lib/index.js +43 -43
  227. package/lib/locale-bundle.d.cts +17 -17
  228. package/lib/locale-bundle.d.ts +17 -17
  229. package/lib/style.css +1 -1
  230. package/lib/{textarea-D5VHsW3K.js → textarea-DM-_io94.js} +1 -1
  231. package/lib/{textarea-BfhvC1nW.cjs → textarea-DNz8Tnud.cjs} +1 -1
  232. package/package.json +1 -1
  233. package/lib/RichTextEditor-COwI-b24.cjs +0 -137
@@ -1,8 +1,8 @@
1
- import { N as $t, m as Vt, O as Mt } from "./index-CXIIg9Sq.js";
2
- import { c as H, N as jt, R as Bt } from "./dom-dataset-2RXYq9wp.js";
1
+ import { N as $t, m as Vt, G as Mt } from "./index-BWx1Mchx.js";
2
+ import { c as H, N as jt, R as Bt } from "./dom-dataset-CHDbKz5J.js";
3
3
  import { jsx as r, jsxs as g, Fragment as Wt } from "react/jsx-runtime";
4
4
  import de, { useState as ce, Fragment as Ft, useEffect as Pe, useMemo as gt, createContext as Pt, useLayoutEffect as Ut, useContext as Ht, useRef as X, useCallback as Te, useDebugValue as zt } from "react";
5
- import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-CFwUKN9i.js";
5
+ import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-OW4s40FH.js";
6
6
  import { u as tn } from "./index-D-DR0FPY.js";
7
7
  const nn = "_verified_lvyh0_1", Ue = {
8
8
  verified: nn
@@ -135,10 +135,10 @@ const nn = "_verified_lvyh0_1", Ue = {
135
135
  separator: Tn,
136
136
  brand: xn,
137
137
  twitterIcon: bn
138
- }, En = "_verifiedOld_lcna5_1", Nn = "_verifiedBlue_lcna5_4", On = "_verifiedGovernment_lcna5_7", xe = {
138
+ }, En = "_verifiedOld_lcna5_1", Nn = "_verifiedBlue_lcna5_4", Rn = "_verifiedGovernment_lcna5_7", xe = {
139
139
  verifiedOld: En,
140
140
  verifiedBlue: Nn,
141
- verifiedGovernment: On
141
+ verifiedGovernment: Rn
142
142
  }, yt = ({ user: e, className: t }) => {
143
143
  const n = e.verified || e.is_blue_verified || e.verified_type;
144
144
  let o = /* @__PURE__ */ r(rn, {}), i = xe.verifiedBlue;
@@ -155,7 +155,7 @@ const nn = "_verified_lvyh0_1", Ue = {
155
155
  className: H(t, i),
156
156
  children: o
157
157
  }) : null;
158
- }, Rn = ({ tweet: e, components: t }) => {
158
+ }, On = ({ tweet: e, components: t }) => {
159
159
  var n;
160
160
  const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : wt, { user: i } = e;
161
161
  return /* @__PURE__ */ g("div", {
@@ -603,14 +603,14 @@ const Gn = (e) => ({
603
603
  })
604
604
  })
605
605
  ]
606
- }), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15", Nr = "_likeIconWrapper_n2anf_27", Or = "_likeCount_n2anf_30", Rr = "_replyIconWrapper_n2anf_35", Lr = "_copyIconWrapper_n2anf_36", Ir = "_likeIcon_n2anf_27", kr = "_replyIcon_n2anf_35", Cr = "_copyIcon_n2anf_36", Dr = "_replyText_n2anf_56", qr = "_copyText_n2anf_57", I = {
606
+ }), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15", Nr = "_likeIconWrapper_n2anf_27", Rr = "_likeCount_n2anf_30", Or = "_replyIconWrapper_n2anf_35", Lr = "_copyIconWrapper_n2anf_36", Ir = "_likeIcon_n2anf_27", kr = "_replyIcon_n2anf_35", Cr = "_copyIcon_n2anf_36", Dr = "_replyText_n2anf_56", qr = "_copyText_n2anf_57", I = {
607
607
  actions: Tr,
608
608
  like: xr,
609
609
  reply: br,
610
610
  copy: Er,
611
611
  likeIconWrapper: Nr,
612
- likeCount: Or,
613
- replyIconWrapper: Rr,
612
+ likeCount: Rr,
613
+ replyIconWrapper: Or,
614
614
  copyIconWrapper: Lr,
615
615
  likeIcon: Ir,
616
616
  replyIcon: kr,
@@ -843,7 +843,7 @@ const Gn = (e) => ({
843
843
  ]);
844
844
  return /* @__PURE__ */ g(He, {
845
845
  children: [
846
- /* @__PURE__ */ r(Rn, {
846
+ /* @__PURE__ */ r(On, {
847
847
  tweet: o,
848
848
  components: t
849
849
  }),
@@ -978,7 +978,7 @@ function uo() {
978
978
  var S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : u;
979
979
  return Ne.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : S, Ne;
980
980
  }
981
- var Oe = {};
981
+ var Re = {};
982
982
  /**
983
983
  * @license React
984
984
  * use-sync-external-store-shim.development.js
@@ -1038,8 +1038,8 @@ function fo() {
1038
1038
  }
1039
1039
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1040
1040
  var i = de, a = typeof Object.is == "function" ? Object.is : e, s = i.useState, u = i.useEffect, p = i.useLayoutEffect, _ = i.useDebugValue, S = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : t;
1041
- Oe.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1042
- }()), Oe;
1041
+ Re.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1042
+ }()), Re;
1043
1043
  }
1044
1044
  var dt;
1045
1045
  function _o() {
@@ -1075,22 +1075,22 @@ const W = /* @__PURE__ */ new WeakMap(), U = () => {
1075
1075
  ), $e = Object, m = (e) => e === L, M = (e) => typeof e == "function", z = (e, t) => ({
1076
1076
  ...e,
1077
1077
  ...t
1078
- }), Ot = (e) => M(e.then), Re = {}, ve = {}, ze = "undefined", ue = typeof window != ze, Ve = typeof document != ze, mo = ue && "Deno" in window, po = () => ue && typeof window.requestAnimationFrame != ze, Rt = (e, t) => {
1078
+ }), Rt = (e) => M(e.then), Oe = {}, ve = {}, ze = "undefined", ue = typeof window != ze, Ve = typeof document != ze, mo = ue && "Deno" in window, po = () => ue && typeof window.requestAnimationFrame != ze, Ot = (e, t) => {
1079
1079
  const n = W.get(e);
1080
1080
  return [
1081
1081
  // Getter
1082
- () => !m(t) && e.get(t) || Re,
1082
+ () => !m(t) && e.get(t) || Oe,
1083
1083
  // Setter
1084
1084
  (o) => {
1085
1085
  if (!m(t)) {
1086
1086
  const i = e.get(t);
1087
- t in ve || (ve[t] = i), n[5](t, z(i, o), i || Re);
1087
+ t in ve || (ve[t] = i), n[5](t, z(i, o), i || Oe);
1088
1088
  }
1089
1089
  },
1090
1090
  // Subscriber
1091
1091
  n[6],
1092
1092
  // Get server cache snapshot
1093
- () => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) || Re
1093
+ () => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) || Oe
1094
1094
  ];
1095
1095
  };
1096
1096
  let Me = !0;
@@ -1182,7 +1182,7 @@ async function Lt(...e) {
1182
1182
  async function d(h) {
1183
1183
  const [l] = Ge(h);
1184
1184
  if (!l) return;
1185
- const [v, f] = Rt(t, l), [k, c, F, ie] = W.get(t), P = () => {
1185
+ const [v, f] = Ot(t, l), [k, c, F, ie] = W.get(t), P = () => {
1186
1186
  const A = k[l];
1187
1187
  return (M(a.revalidate) ? a.revalidate(v().data, h) : a.revalidate !== !1) && (delete F[l], delete ie[l], A && A[0]) ? A[0](Nt).then(() => v().data) : v().data;
1188
1188
  };
@@ -1204,7 +1204,7 @@ async function Lt(...e) {
1204
1204
  } catch (A) {
1205
1205
  C = A;
1206
1206
  }
1207
- if (N && Ot(N))
1207
+ if (N && Rt(N))
1208
1208
  if (N = await N.catch((A) => {
1209
1209
  C = A;
1210
1210
  }), J !== c[l][0]) {
@@ -1282,16 +1282,16 @@ const mt = (e, t) => {
1282
1282
  e,
1283
1283
  W.get(e)[4]
1284
1284
  ];
1285
- }, Oo = (e, t, n, o, i) => {
1285
+ }, Ro = (e, t, n, o, i) => {
1286
1286
  const a = n.errorRetryCount, s = i.retryCount, u = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
1287
1287
  !m(a) && s > a || setTimeout(o, u, i);
1288
- }, Ro = Ae, [It, Lo] = No(/* @__PURE__ */ new Map()), Io = z(
1288
+ }, Oo = Ae, [It, Lo] = No(/* @__PURE__ */ new Map()), Io = z(
1289
1289
  {
1290
1290
  // events
1291
1291
  onLoadingSlow: U,
1292
1292
  onSuccess: U,
1293
1293
  onError: U,
1294
- onErrorRetry: Oo,
1294
+ onErrorRetry: Ro,
1295
1295
  onDiscarded: U,
1296
1296
  // switches
1297
1297
  revalidateOnFocus: !0,
@@ -1304,7 +1304,7 @@ const mt = (e, t) => {
1304
1304
  dedupingInterval: 2 * 1e3,
1305
1305
  loadingTimeout: ht ? 5e3 : 3e3,
1306
1306
  // providers
1307
- compare: Ro,
1307
+ compare: Oo,
1308
1308
  isPaused: () => !1,
1309
1309
  cache: It,
1310
1310
  mutate: Lo,
@@ -1372,9 +1372,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
1372
1372
  }), De = {
1373
1373
  dedupe: !0
1374
1374
  }, Fo = (e, t, n) => {
1375
- const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1), N = X(c), C = X(t), J = X(n), x = () => J.current, Y = () => x().isVisible() && x().isOnline(), [$, Z, G, A] = Rt(o, c), ee = X({}).current, fe = m(s) ? m(n.fallback) ? L : n.fallback[c] : s, Ke = (w, y) => {
1376
- for (const O in ee) {
1377
- const T = O;
1375
+ const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1), N = X(c), C = X(t), J = X(n), x = () => J.current, Y = () => x().isVisible() && x().isOnline(), [$, Z, G, A] = Ot(o, c), ee = X({}).current, fe = m(s) ? m(n.fallback) ? L : n.fallback[c] : s, Ke = (w, y) => {
1376
+ for (const R in ee) {
1377
+ const T = R;
1378
1378
  if (T === "data") {
1379
1379
  if (!i(w[T], y[T]) && (!m(w[T]) || !i(he, y[T])))
1380
1380
  return !1;
@@ -1383,19 +1383,19 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
1383
1383
  }
1384
1384
  return !0;
1385
1385
  }, Xe = gt(() => {
1386
- const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (R) => {
1387
- const j = z(R);
1386
+ const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (O) => {
1387
+ const j = z(O);
1388
1388
  return delete j._k, w ? {
1389
1389
  isValidating: !0,
1390
1390
  isLoading: !0,
1391
1391
  ...j
1392
1392
  } : j;
1393
- }, O = $(), T = A(), V = y(O), re = O === T ? V : y(T);
1393
+ }, R = $(), T = A(), V = y(R), re = R === T ? V : y(T);
1394
1394
  let b = V;
1395
1395
  return [
1396
1396
  () => {
1397
- const R = y($());
1398
- return Ke(R, b) ? (b.data = R.data, b.isLoading = R.isLoading, b.isValidating = R.isValidating, b.error = R.error, b) : (b = R, R);
1397
+ const O = y($());
1398
+ return Ke(O, b) ? (b.data = O.data, b.isLoading = O.isLoading, b.isValidating = O.isValidating, b.error = O.error, b) : (b = O, O);
1399
1399
  },
1400
1400
  () => re
1401
1401
  ];
@@ -1403,21 +1403,21 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
1403
1403
  o,
1404
1404
  c
1405
1405
  ]), te = ho.useSyncExternalStore(Te(
1406
- (w) => G(c, (y, O) => {
1407
- Ke(O, y) || w();
1406
+ (w) => G(c, (y, R) => {
1407
+ Ke(R, y) || w();
1408
1408
  }),
1409
1409
  // eslint-disable-next-line react-hooks/exhaustive-deps
1410
1410
  [
1411
1411
  o,
1412
1412
  c
1413
1413
  ]
1414
- ), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe && Ot(fe) ? Ce(fe) : fe : ne, _e = te.error, we = X(K), he = h ? m(ne) ? m(we.current) ? K : we.current : ne : K, Je = Ct && !m(_e) ? !1 : Qe && !m(u) ? u : x().isPaused() ? !1 : a ? m(K) ? !1 : p : m(K) || p, Ye = !!(c && t && Qe && Je), Dt = m(te.isValidating) ? Ye : te.isValidating, qt = m(te.isLoading) ? Ye : te.isLoading, ae = Te(
1414
+ ), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe && Rt(fe) ? Ce(fe) : fe : ne, _e = te.error, we = X(K), he = h ? m(ne) ? m(we.current) ? K : we.current : ne : K, Je = Ct && !m(_e) ? !1 : Qe && !m(u) ? u : x().isPaused() ? !1 : a ? m(K) ? !1 : p : m(K) || p, Ye = !!(c && t && Qe && Je), Dt = m(te.isValidating) ? Ye : te.isValidating, qt = m(te.isLoading) ? Ye : te.isLoading, ae = Te(
1415
1415
  async (w) => {
1416
1416
  const y = C.current;
1417
1417
  if (!c || !y || P.current || x().isPaused())
1418
1418
  return !1;
1419
- let O, T, V = !0;
1420
- const re = w || {}, b = !f[c] || !re.dedupe, R = () => _t ? !P.current && c === N.current && ie.current : c === N.current, j = {
1419
+ let R, T, V = !0;
1420
+ const re = w || {}, b = !f[c] || !re.dedupe, O = () => _t ? !P.current && c === N.current && ie.current : c === N.current, j = {
1421
1421
  isValidating: !1,
1422
1422
  isLoading: !1
1423
1423
  }, et = () => {
@@ -1431,25 +1431,25 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
1431
1431
  m($().data) && (nt.isLoading = !0);
1432
1432
  try {
1433
1433
  if (b && (Z(nt), n.loadingTimeout && m($().data) && setTimeout(() => {
1434
- V && R() && x().onLoadingSlow(c, n);
1434
+ V && O() && x().onLoadingSlow(c, n);
1435
1435
  }, n.loadingTimeout), f[c] = [
1436
1436
  y(F),
1437
1437
  Fe()
1438
- ]), [O, T] = f[c], O = await O, b && setTimeout(tt, n.dedupingInterval), !f[c] || f[c][1] !== T)
1439
- return b && R() && x().onDiscarded(c), !1;
1438
+ ]), [R, T] = f[c], R = await R, b && setTimeout(tt, n.dedupingInterval), !f[c] || f[c][1] !== T)
1439
+ return b && O() && x().onDiscarded(c), !1;
1440
1440
  j.error = L;
1441
1441
  const q = v[c];
1442
1442
  if (!m(q) && // case 1
1443
1443
  (T <= q[0] || // case 2
1444
1444
  T <= q[1] || // case 3
1445
1445
  q[1] === 0))
1446
- return et(), b && R() && x().onDiscarded(c), !1;
1446
+ return et(), b && O() && x().onDiscarded(c), !1;
1447
1447
  const B = $().data;
1448
- j.data = i(B, O) ? B : O, b && R() && x().onSuccess(O, c, n);
1448
+ j.data = i(B, R) ? B : R, b && O() && x().onSuccess(R, c, n);
1449
1449
  } catch (q) {
1450
1450
  tt();
1451
1451
  const B = x(), { shouldRetryOnError: ye } = B;
1452
- B.isPaused() || (j.error = q, b && R() && (B.onError(q, c, B), (ye === !0 || M(ye) && ye(q)) && (!x().revalidateOnFocus || !x().revalidateOnReconnect || Y()) && B.onErrorRetry(q, c, B, (At) => {
1452
+ B.isPaused() || (j.error = q, b && O() && (B.onError(q, c, B), (ye === !0 || M(ye) && ye(q)) && (!x().revalidateOnFocus || !x().revalidateOnReconnect || Y()) && B.onErrorRetry(q, c, B, (At) => {
1453
1453
  const Se = l[c];
1454
1454
  Se && Se[0] && Se[0](ut, At);
1455
1455
  }, {
@@ -1510,9 +1510,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
1510
1510
  let w;
1511
1511
  function y() {
1512
1512
  const T = M(_) ? _($().data) : _;
1513
- T && w !== -1 && (w = setTimeout(O, T));
1513
+ T && w !== -1 && (w = setTimeout(R, T));
1514
1514
  }
1515
- function O() {
1515
+ function R() {
1516
1516
  !$().error && (S || x().isVisible()) && (d || x().isOnline()) ? ae(De).then(y) : y();
1517
1517
  }
1518
1518
  return y(), () => {
@@ -1,4 +1,4 @@
1
- "use strict";const je=require("./index-CSvnpArE.cjs"),M=require("./dom-dataset-Cuy-pIfj.cjs"),n=require("react/jsx-runtime"),x=require("react"),H=require("./RichTextEditor-COwI-b24.cjs"),qt=require("./index-Dz3YxLE7.cjs"),Dt="_verified_lvyh0_1",We={verified:Dt},$t=()=>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"})})}),At=()=>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"})]})]})}),Vt=()=>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"})})}),Mt="_root_98iqw_1",Bt="_article_98iqw_21",et={root:Mt,article:Bt},Fe=({className:e,children:t})=>n.jsx("div",{className:M.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),mt=e=>n.jsx("img",{...e}),Wt="_header_nqq4j_1",Ft="_avatar_nqq4j_11",Pt="_avatarOverflow_nqq4j_16",Ut="_avatarSquare_nqq4j_23",Ht="_avatarShadow_nqq4j_26",zt="_author_nqq4j_37",Gt="_authorLink_nqq4j_44",Kt="_authorVerified_nqq4j_53",Xt="_authorLinkText_nqq4j_56",Qt="_authorMeta_nqq4j_63",Jt="_authorFollow_nqq4j_66",Yt="_username_nqq4j_69",Zt="_follow_nqq4j_74",en="_separator_nqq4j_82",tn="_brand_nqq4j_86",nn="_twitterIcon_nqq4j_90",b={header:Wt,avatar:Ft,avatarOverflow:Pt,avatarSquare:Ut,avatarShadow:Ht,author:zt,authorLink:Gt,authorVerified:Kt,authorLinkText:Xt,authorMeta:Qt,authorFollow:Jt,username:Yt,follow:Zt,separator:en,brand:tn,twitterIcon:nn},rn="_verifiedOld_lcna5_1",sn="_verifiedBlue_lcna5_4",on="_verifiedGovernment_lcna5_7",we={verifiedOld:rn,verifiedBlue:sn,verifiedGovernment:on},pt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx($t,{}),o=we.verifiedBlue;if(r)switch(e.is_blue_verified||(o=we.verifiedOld),e.verified_type){case"Government":s=n.jsx(Vt,{}),o=we.verifiedGovernment;break;case"Business":s=n.jsx(At,{}),o=null;break}return r?n.jsx("div",{className:M.clsx(t,o),children:s}):null},an=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:mt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:M.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(pt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.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"})})})})]})},cn="_root_1ec15_1",ln={root:cn},un=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:ln.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),dn="_root_eihfa_1",fn={root:dn},_n=({href:e,children:t})=>n.jsx("a",{href:e,className:fn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),hn="_root_1xq52_1",mn={root:hn},pn=({tweet:e})=>n.jsx("p",{className:mn.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(_n,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,xn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,vn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,gn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,jn=e=>`https://x.com/hashtag/${e.text}`,wn=e=>`https://x.com/search?q=%24${e.text}`,yn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(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},Sn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var i,a;return((i=o.bitrate)!=null?i:0)-((a=s.bitrate)!=null?a:0)})},Tn=e=>{const t=Sn(e);return t.length>1?t[1]:t[0]},ke=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ae(r,"hashtag",e.entities.hashtags),ae(r,"mention",e.entities.user_mentions),ae(r,"url",e.entities.urls),ae(r,"symbol",e.entities.symbols),e.entities.media&&ae(r,"media",e.entities.media),bn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:jn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:wn(s),text:o});default:return Object.assign(s,{text:o})}})}function ae(e,t,r){for(const s of r)for(const[o,i]of e.entries()){if(i.indices[0]>s.indices[0]||i.indices[1]<s.indices[1])continue;const a=[{...s,type:t}];i.indices[0]<s.indices[0]&&a.unshift({indices:[i.indices[0],s.indices[0]],type:"text"}),i.indices[1]>s.indices[1]&&a.push({indices:[s.indices[1],i.indices[1]],type:"text"}),e.splice(o,1,...a);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 En=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:gn(e)},like_url:xn(e),reply_url:vn(e),in_reply_to_url:e.in_reply_to_screen_name?yn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Rn="_root_g9tkv_1",On="_rounded_g9tkv_6",Nn="_mediaWrapper_g9tkv_10",In="_grid2Columns_g9tkv_17",Ln="_grid3_g9tkv_20",kn="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",qn="_mediaLink_g9tkv_34",Dn="_skeleton_g9tkv_38",$n="_image_g9tkv_43",C={root:Rn,rounded:On,mediaWrapper:Nn,grid2Columns:In,grid3:Ln,grid2x2:kn,mediaContainer:Cn,mediaLink:qn,skeleton:Dn,image:$n},An="_anchor_fp31d_1",Vn="_videoButton_fp31d_17",Mn="_videoButtonIcon_fp31d_35",Bn="_watchOnTwitter_fp31d_44",Wn="_viewReplies_fp31d_60",se={anchor:An,videoButton:Vn,videoButtonIcon:Mn,watchOnTwitter:Bn,viewReplies:Wn},Fn=({tweet:e,media:t})=>{const[r,s]=x.useState(!0),[o,i]=x.useState(!1),[a,d]=x.useState(!1),p=Tn(t);let _=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{_&&window.clearTimeout(_),o||i(!0),a&&d(!1)},onPause:()=>{_&&window.clearTimeout(_),_=window.setTimeout(()=>{o&&i(!1),_=0},100)},onEnded:()=>{d(!0)},children:n.jsx("source",{src:p.url,type:p.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:w=>{const u=w.currentTarget.previousSibling;w.preventDefault(),s(!1),u.load(),u.play().then(()=>{i(!0),u.focus()}).catch(h=>{console.error("Error playing video:",h),s(!0),i(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!a&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),a&&n.jsx("a",{href:e.url,className:M.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Pn=e=>n.jsx("img",{...e}),rt=(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}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,i;const a=(i=(s=e.mediaDetails)==null?void 0:s.length)!=null?i:0;var d;const p=(d=t==null?void 0:t.MediaImg)!=null?d:Pn;return n.jsx("div",{className:M.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:M.clsx(C.mediaWrapper,a>1&&C.grid2Columns,a===3&&C.grid3,a>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(_=>n.jsx(x.Fragment,{children:_.type==="photo"?n.jsxs("a",{href:e.url,className:M.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(p,{src:vt(_,"small"),alt:_.ext_alt_text||"Image",className:C.image,draggable:!0})]},_.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(Fn,{tweet:e,media:_})]},_.media_url_https)},_.media_url_https))})})},Un={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Hn=new Intl.DateTimeFormat("en-US",Un),zn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Gn=e=>{const t=zn(Hn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Kn="_root_i24yn_1",Xn={root:Kn},Qn=({tweet:e})=>{const t=new Date(e.created_at),r=Gn(t);return n.jsx("a",{className:Xn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Jn="_info_19qcj_1",Yn="_infoLink_19qcj_10",Zn="_infoIcon_19qcj_30",ye={info:Jn,infoLink:Yn,infoIcon:Zn},er=({tweet:e})=>n.jsxs("div",{className:ye.info,children:[n.jsx(Qn,{tweet:e}),n.jsx("a",{className:ye.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:ye.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"})})})})]}),tr="_actions_n2anf_1",nr="_like_n2anf_13",rr="_reply_n2anf_14",sr="_copy_n2anf_15",or="_likeIconWrapper_n2anf_27",ir="_likeCount_n2anf_30",ar="_replyIconWrapper_n2anf_35",cr="_copyIconWrapper_n2anf_36",lr="_likeIcon_n2anf_27",ur="_replyIcon_n2anf_35",dr="_copyIcon_n2anf_36",fr="_replyText_n2anf_56",_r="_copyText_n2anf_57",I={actions:tr,like:nr,reply:rr,copy:sr,likeIconWrapper:or,likeCount:ir,replyIconWrapper:ar,copyIconWrapper:cr,likeIcon:lr,replyIcon:ur,copyIcon:dr,replyText:fr,copyText:_r},hr=({tweet:e})=>{const[t,r]=x.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return x.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:I.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:I.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:I.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:I.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:I.copyText,children:t?"Copied!":"Copy link"})]})},mr=({tweet:e})=>{const t=ke(e.favorite_count);return n.jsxs("div",{className:I.actions,children:[n.jsxs("a",{className:I.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:I.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:I.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:I.likeCount,children:t})]}),n.jsxs("a",{className:I.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:I.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:I.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:I.replyText,children:"Reply"})]}),n.jsx(hr,{tweet:e})]})},pr="_replies_1cutb_1",xr="_link_1cutb_4",vr="_text_1cutb_23",Se={replies:pr,link:xr,text:vr},gr=({tweet:e})=>n.jsx("div",{className:Se.replies,children:n.jsx("a",{className:Se.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Se.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${ke(e.conversation_count)} reply`:`Read ${ke(e.conversation_count)} replies`})})}),jr="_root_q5799_1",wr="_article_q5799_16",st={root:jr,article:wr},yr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Sr="_header_r31i5_1",Tr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Rr="_authorText_r31i5_26",Or="_username_r31i5_33",Q={header:Sr,avatar:Tr,avatarSquare:br,author:Er,authorText:Rr,username:Or},Nr=({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:M.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(mt,{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(pt,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Ir="_root_175ot_1",Lr={root:Ir},kr=({tweet:e})=>n.jsx("p",{className:Lr.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(yr,{tweet:e,children:[n.jsx(Nr,{tweet:e}),n.jsx(kr,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},qr=({tweet:e,components:t})=>{var r;const s=x.useMemo(()=>En(e),[e]);return n.jsxs(Fe,{children:[n.jsx(an,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(un,{tweet:s}),n.jsx(pn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(er,{tweet:s}),n.jsx(mr,{tweet:s}),n.jsx(gr,{tweet:s})]})},Dr="_root_16yxa_1",$r={root:Dr},Ar=e=>n.jsx(Fe,{children:n.jsxs("div",{className:$r.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Vr="_skeleton_oi7hr_1",Mr={skeleton:Vr},_e=({style:e})=>n.jsx("span",{className:Mr.skeleton,style:e}),Br="_root_17qqv_1",Wr={root:Br},Fr=()=>n.jsxs(Fe,{className:Wr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var he={exports:{}},Te={};/**
1
+ "use strict";const je=require("./index-CSvnpArE.cjs"),M=require("./dom-dataset-Cuy-pIfj.cjs"),n=require("react/jsx-runtime"),x=require("react"),H=require("./RichTextEditor-C3sK_Ys3.cjs"),qt=require("./index-Dz3YxLE7.cjs"),Dt="_verified_lvyh0_1",We={verified:Dt},$t=()=>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"})})}),At=()=>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"})]})]})}),Vt=()=>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"})})}),Mt="_root_98iqw_1",Bt="_article_98iqw_21",et={root:Mt,article:Bt},Fe=({className:e,children:t})=>n.jsx("div",{className:M.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),mt=e=>n.jsx("img",{...e}),Wt="_header_nqq4j_1",Ft="_avatar_nqq4j_11",Pt="_avatarOverflow_nqq4j_16",Ut="_avatarSquare_nqq4j_23",Ht="_avatarShadow_nqq4j_26",zt="_author_nqq4j_37",Gt="_authorLink_nqq4j_44",Kt="_authorVerified_nqq4j_53",Xt="_authorLinkText_nqq4j_56",Qt="_authorMeta_nqq4j_63",Jt="_authorFollow_nqq4j_66",Yt="_username_nqq4j_69",Zt="_follow_nqq4j_74",en="_separator_nqq4j_82",tn="_brand_nqq4j_86",nn="_twitterIcon_nqq4j_90",b={header:Wt,avatar:Ft,avatarOverflow:Pt,avatarSquare:Ut,avatarShadow:Ht,author:zt,authorLink:Gt,authorVerified:Kt,authorLinkText:Xt,authorMeta:Qt,authorFollow:Jt,username:Yt,follow:Zt,separator:en,brand:tn,twitterIcon:nn},rn="_verifiedOld_lcna5_1",sn="_verifiedBlue_lcna5_4",on="_verifiedGovernment_lcna5_7",we={verifiedOld:rn,verifiedBlue:sn,verifiedGovernment:on},pt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx($t,{}),o=we.verifiedBlue;if(r)switch(e.is_blue_verified||(o=we.verifiedOld),e.verified_type){case"Government":s=n.jsx(Vt,{}),o=we.verifiedGovernment;break;case"Business":s=n.jsx(At,{}),o=null;break}return r?n.jsx("div",{className:M.clsx(t,o),children:s}):null},an=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:mt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:M.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(pt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.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"})})})})]})},cn="_root_1ec15_1",ln={root:cn},un=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:ln.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),dn="_root_eihfa_1",fn={root:dn},_n=({href:e,children:t})=>n.jsx("a",{href:e,className:fn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),hn="_root_1xq52_1",mn={root:hn},pn=({tweet:e})=>n.jsx("p",{className:mn.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(_n,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,xn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,vn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,gn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,jn=e=>`https://x.com/hashtag/${e.text}`,wn=e=>`https://x.com/search?q=%24${e.text}`,yn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(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},Sn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var i,a;return((i=o.bitrate)!=null?i:0)-((a=s.bitrate)!=null?a:0)})},Tn=e=>{const t=Sn(e);return t.length>1?t[1]:t[0]},Ie=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ae(r,"hashtag",e.entities.hashtags),ae(r,"mention",e.entities.user_mentions),ae(r,"url",e.entities.urls),ae(r,"symbol",e.entities.symbols),e.entities.media&&ae(r,"media",e.entities.media),bn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:jn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:wn(s),text:o});default:return Object.assign(s,{text:o})}})}function ae(e,t,r){for(const s of r)for(const[o,i]of e.entries()){if(i.indices[0]>s.indices[0]||i.indices[1]<s.indices[1])continue;const a=[{...s,type:t}];i.indices[0]<s.indices[0]&&a.unshift({indices:[i.indices[0],s.indices[0]],type:"text"}),i.indices[1]>s.indices[1]&&a.push({indices:[s.indices[1],i.indices[1]],type:"text"}),e.splice(o,1,...a);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 En=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:gn(e)},like_url:xn(e),reply_url:vn(e),in_reply_to_url:e.in_reply_to_screen_name?yn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Rn="_root_g9tkv_1",On="_rounded_g9tkv_6",Nn="_mediaWrapper_g9tkv_10",Ln="_grid2Columns_g9tkv_17",kn="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",qn="_mediaLink_g9tkv_34",Dn="_skeleton_g9tkv_38",$n="_image_g9tkv_43",C={root:Rn,rounded:On,mediaWrapper:Nn,grid2Columns:Ln,grid3:kn,grid2x2:In,mediaContainer:Cn,mediaLink:qn,skeleton:Dn,image:$n},An="_anchor_fp31d_1",Vn="_videoButton_fp31d_17",Mn="_videoButtonIcon_fp31d_35",Bn="_watchOnTwitter_fp31d_44",Wn="_viewReplies_fp31d_60",se={anchor:An,videoButton:Vn,videoButtonIcon:Mn,watchOnTwitter:Bn,viewReplies:Wn},Fn=({tweet:e,media:t})=>{const[r,s]=x.useState(!0),[o,i]=x.useState(!1),[a,d]=x.useState(!1),p=Tn(t);let _=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{_&&window.clearTimeout(_),o||i(!0),a&&d(!1)},onPause:()=>{_&&window.clearTimeout(_),_=window.setTimeout(()=>{o&&i(!1),_=0},100)},onEnded:()=>{d(!0)},children:n.jsx("source",{src:p.url,type:p.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:w=>{const u=w.currentTarget.previousSibling;w.preventDefault(),s(!1),u.load(),u.play().then(()=>{i(!0),u.focus()}).catch(h=>{console.error("Error playing video:",h),s(!0),i(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!a&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),a&&n.jsx("a",{href:e.url,className:M.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Pn=e=>n.jsx("img",{...e}),rt=(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}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,i;const a=(i=(s=e.mediaDetails)==null?void 0:s.length)!=null?i:0;var d;const p=(d=t==null?void 0:t.MediaImg)!=null?d:Pn;return n.jsx("div",{className:M.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:M.clsx(C.mediaWrapper,a>1&&C.grid2Columns,a===3&&C.grid3,a>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(_=>n.jsx(x.Fragment,{children:_.type==="photo"?n.jsxs("a",{href:e.url,className:M.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(p,{src:vt(_,"small"),alt:_.ext_alt_text||"Image",className:C.image,draggable:!0})]},_.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(Fn,{tweet:e,media:_})]},_.media_url_https)},_.media_url_https))})})},Un={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Hn=new Intl.DateTimeFormat("en-US",Un),zn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Gn=e=>{const t=zn(Hn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Kn="_root_i24yn_1",Xn={root:Kn},Qn=({tweet:e})=>{const t=new Date(e.created_at),r=Gn(t);return n.jsx("a",{className:Xn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Jn="_info_19qcj_1",Yn="_infoLink_19qcj_10",Zn="_infoIcon_19qcj_30",ye={info:Jn,infoLink:Yn,infoIcon:Zn},er=({tweet:e})=>n.jsxs("div",{className:ye.info,children:[n.jsx(Qn,{tweet:e}),n.jsx("a",{className:ye.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:ye.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"})})})})]}),tr="_actions_n2anf_1",nr="_like_n2anf_13",rr="_reply_n2anf_14",sr="_copy_n2anf_15",or="_likeIconWrapper_n2anf_27",ir="_likeCount_n2anf_30",ar="_replyIconWrapper_n2anf_35",cr="_copyIconWrapper_n2anf_36",lr="_likeIcon_n2anf_27",ur="_replyIcon_n2anf_35",dr="_copyIcon_n2anf_36",fr="_replyText_n2anf_56",_r="_copyText_n2anf_57",L={actions:tr,like:nr,reply:rr,copy:sr,likeIconWrapper:or,likeCount:ir,replyIconWrapper:ar,copyIconWrapper:cr,likeIcon:lr,replyIcon:ur,copyIcon:dr,replyText:fr,copyText:_r},hr=({tweet:e})=>{const[t,r]=x.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return x.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:L.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:L.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.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:L.copyText,children:t?"Copied!":"Copy link"})]})},mr=({tweet:e})=>{const t=Ie(e.favorite_count);return n.jsxs("div",{className:L.actions,children:[n.jsxs("a",{className:L.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:L.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.likeCount,children:t})]}),n.jsxs("a",{className:L.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:L.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.replyText,children:"Reply"})]}),n.jsx(hr,{tweet:e})]})},pr="_replies_1cutb_1",xr="_link_1cutb_4",vr="_text_1cutb_23",Se={replies:pr,link:xr,text:vr},gr=({tweet:e})=>n.jsx("div",{className:Se.replies,children:n.jsx("a",{className:Se.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Se.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ie(e.conversation_count)} reply`:`Read ${Ie(e.conversation_count)} replies`})})}),jr="_root_q5799_1",wr="_article_q5799_16",st={root:jr,article:wr},yr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Sr="_header_r31i5_1",Tr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Rr="_authorText_r31i5_26",Or="_username_r31i5_33",Q={header:Sr,avatar:Tr,avatarSquare:br,author:Er,authorText:Rr,username:Or},Nr=({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:M.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(mt,{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(pt,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Lr="_root_175ot_1",kr={root:Lr},Ir=({tweet:e})=>n.jsx("p",{className:kr.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(yr,{tweet:e,children:[n.jsx(Nr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},qr=({tweet:e,components:t})=>{var r;const s=x.useMemo(()=>En(e),[e]);return n.jsxs(Fe,{children:[n.jsx(an,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(un,{tweet:s}),n.jsx(pn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(er,{tweet:s}),n.jsx(mr,{tweet:s}),n.jsx(gr,{tweet:s})]})},Dr="_root_16yxa_1",$r={root:Dr},Ar=e=>n.jsx(Fe,{children:n.jsxs("div",{className:$r.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Vr="_skeleton_oi7hr_1",Mr={skeleton:Vr},_e=({style:e})=>n.jsx("span",{className:Mr.skeleton,style:e}),Br="_root_17qqv_1",Wr={root:Br},Fr=()=>n.jsxs(Fe,{className:Wr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var he={exports:{}},Te={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ot;function Pr(){if(ot)return Te;ot=1;var e=x;function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function d(u,h){var l=h(),v=s({inst:{value:l,getSnapshot:h}}),f=v[0].inst,L=v[1];return i(function(){f.value=l,f.getSnapshot=h,p(f)&&L({inst:f})},[u,l,h]),o(function(){return p(f)&&L({inst:f}),u(function(){p(f)&&L({inst:f})})},[u]),a(l),l}function p(u){var h=u.getSnapshot;u=u.value;try{var l=h();return!r(u,l)}catch{return!0}}function _(u,h){return h()}var w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_:d;return Te.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w,Te}var be={};/**
9
+ */var ot;function Pr(){if(ot)return Te;ot=1;var e=x;function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function d(u,h){var l=h(),v=s({inst:{value:l,getSnapshot:h}}),f=v[0].inst,k=v[1];return i(function(){f.value=l,f.getSnapshot=h,p(f)&&k({inst:f})},[u,l,h]),o(function(){return p(f)&&k({inst:f}),u(function(){p(f)&&k({inst:f})})},[u]),a(l),l}function p(u){var h=u.getSnapshot;u=u.value;try{var l=h();return!r(u,l)}catch{return!0}}function _(u,h){return h()}var w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_:d;return Te.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w,Te}var be={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,4 +14,4 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var it;function Ur(){return it||(it=1,process.env.NODE_ENV!=="production"&&function(){function e(l,v){return l===v&&(l!==0||1/l===1/v)||l!==l&&v!==v}function t(l,v){w||o.startTransition===void 0||(w=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=v();if(!u){var L=v();i(f,L)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}L=a({inst:{value:f,getSnapshot:v}});var c=L[0].inst,P=L[1];return p(function(){c.value=f,c.getSnapshot=v,r(c)&&P({inst:c})},[l,f,v]),d(function(){return r(c)&&P({inst:c}),l(function(){r(c)&&P({inst:c})})},[l]),_(f),f}function r(l){var v=l.getSnapshot;l=l.value;try{var f=v();return!i(l,f)}catch{return!0}}function s(l,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=x,i=typeof Object.is=="function"?Object.is:e,a=o.useState,d=o.useEffect,p=o.useLayoutEffect,_=o.useDebugValue,w=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;be.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),be}var at;function Hr(){return at||(at=1,process.env.NODE_ENV==="production"?he.exports=Pr():he.exports=Ur()),he.exports}var zr=Hr();const jt=0,wt=1,yt=2,ct=3;var lt=Object.prototype.hasOwnProperty;function Ce(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--&&Ce(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(lt.call(e,r)&&++s&&!lt.call(t,r)||!(r in t)||!Ce(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,z=()=>{},N=z(),qe=Object,m=e=>e===N,V=e=>typeof e=="function",G=(e,t)=>({...e,...t}),St=e=>V(e.then),Ee={},me={},Pe="undefined",le=typeof window!=Pe,De=typeof document!=Pe,Gr=le&&"Deno"in window,Kr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,t)=>{const r=F.get(e);return[()=>!m(t)&&e.get(t)||Ee,s=>{if(!m(t)){const o=e.get(t);t in me||(me[t]=o),r[5](t,G(o,s),o||Ee)}},r[6],()=>!m(t)&&t in me?me[t]:!m(t)&&e.get(t)||Ee]};let $e=!0;const Xr=()=>$e,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[z,z],Qr=()=>{const e=De&&document.visibilityState;return m(e)||e!=="hidden"},Jr=e=>(De&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{De&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),Yr=e=>{const t=()=>{$e=!0,e()},r=()=>{$e=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},Zr={isOnline:Xr,isVisible:Qr},es={initFocus:Jr,initReconnect:Yr},ut=!x.useId,ce=!le||Gr,ts=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=ce?x.useEffect:x.useLayoutEffect,Oe=typeof navigator<"u"&&navigator.connection,dt=!ce&&Oe&&(["slow-2g","2g"].includes(Oe.effectiveType)||Oe.saveData),pe=new WeakMap,Ne=(e,t)=>qe.prototype.toString.call(e)===`[object ${t}]`;let ns=0;const Me=e=>{const t=typeof e,r=Ne(e,"Date"),s=Ne(e,"RegExp"),o=Ne(e,"Object");let i,a;if(qe(e)===e&&!r&&!s){if(i=pe.get(e),i)return i;if(i=++ns+"~",pe.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=Me(e[a])+",";pe.set(e,i)}if(o){i="#";const d=qe.keys(e).sort();for(;!m(a=d.pop());)m(e[a])||(i+=a+":"+Me(e[a])+",");pe.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(V(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let rs=0;const Be=()=>++rs;async function bt(...e){const[t,r,s,o]=e,i=G({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const d=i.rollbackOnError;let p=i.optimisticData;const _=h=>typeof d=="function"?d(h):d!==!1,w=i.throwOnError;if(V(r)){const h=r,l=[],v=t.keys();for(const f of v)!/^\$(inf|sub)\$/.test(f)&&h(t.get(f)._k)&&l.push(f);return Promise.all(l.map(u))}return u(r);async function u(h){const[l]=Ue(h);if(!l)return;const[v,f]=Tt(t,l),[L,c,P,oe]=F.get(t),U=()=>{const D=L[l];return(V(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete P[l],delete oe[l],D&&D[0])?D[0](yt).then(()=>v().data):v().data};if(e.length<3)return U();let E=s,k;const J=Be();c[l]=[J,0];const S=!m(p),Y=v(),$=Y.data,Z=Y._c,K=m(Z)?$:Z;if(S&&(p=V(p)?p(K,$):p,f({data:p,_c:K})),V(E))try{E=E(K)}catch(D){k=D}if(E&&St(E))if(E=await E.catch(D=>{k=D}),J!==c[l][0]){if(k)throw k;return E}else k&&S&&_(k)&&(a=!0,f({data:K,_c:N}));if(a&&!k)if(V(a)){const D=a(E,K);f({data:D,error:N,_c:N})}else f({data:E,error:N,_c:N});if(c[l][1]=Be(),Promise.resolve(U()).then(()=>{f({_c:N})}),k){if(w)throw k;return}return E}}const ft=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=G(es,t),s={},o=bt.bind(N,e);let i=z;const a={},d=(w,u)=>{const h=a[w]||[];return a[w]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},p=(w,u,h)=>{e.set(w,u);const l=a[w];if(l)for(const v of l)v(u,h)},_=()=>{if(!F.has(e)&&(F.set(e,[s,{},{},{},o,p,d]),!ce)){const w=r.initFocus(setTimeout.bind(N,ft.bind(N,s,jt))),u=r.initReconnect(setTimeout.bind(N,ft.bind(N,s,wt)));i=()=>{w&&w(),u&&u(),F.delete(e)}}};return _(),[e,o,_,i]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const i=r.errorRetryCount,a=o.retryCount,d=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!m(i)&&a>i||setTimeout(s,d,o)},is=Ce,[Et,as]=ss(new Map),cs=G({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:os,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:is,isPaused:()=>!1,cache:Et,mutate:as,fallback:{}},Zr),ls=(e,t)=>{const r=G(e,t);if(t){const{use:s,fallback:o}=e,{use:i,fallback:a}=t;s&&i&&(r.use=s.concat(i)),o&&a&&(r.fallback=G(o,a))}return r},us=x.createContext({}),ds="$inf$",Rt=le&&window.__SWR_DEVTOOLS_USE__,fs=Rt?window.__SWR_DEVTOOLS_USE__:[],_s=()=>{Rt&&(window.__SWR_DEVTOOLS_REACT__=x)},hs=e=>V(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ms=()=>G(cs,x.useContext(us)),ps=e=>(t,r,s)=>e(t,r&&((...i)=>{const[a]=Ue(t),[,,,d]=F.get(Et);if(a.startsWith(ds))return r(...i);const p=d[a];return m(p)?r(...i):(delete d[a],p)}),s),xs=fs.concat(ps),vs=e=>function(...r){const s=ms(),[o,i,a]=hs(r),d=ls(s,a);let p=e;const{use:_}=d,w=(_||[]).concat(xs);for(let u=w.length;u--;)p=w[u](p);return p(o,i||d.fetcher||null,d)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};_s();const Ie=x.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}}),Le={dedupe:!0},js=(e,t,r)=>{const{cache:s,compare:o,suspense:i,fallbackData:a,revalidateOnMount:d,revalidateIfStale:p,refreshInterval:_,refreshWhenHidden:w,refreshWhenOffline:u,keepPreviousData:h}=r,[l,v,f,L]=F.get(s),[c,P]=Ue(e),oe=x.useRef(!1),U=x.useRef(!1),E=x.useRef(c),k=x.useRef(t),J=x.useRef(r),S=()=>J.current,Y=()=>S().isVisible()&&S().isOnline(),[$,Z,K,D]=Tt(s,c),ee=x.useRef({}).current,ue=m(a)?m(r.fallback)?N:r.fallback[c]:a,He=(g,j)=>{for(const R in ee){const y=R;if(y==="data"){if(!o(g[y],j[y])&&(!m(g[y])||!o(fe,j[y])))return!1}else if(j[y]!==g[y])return!1}return!0},ze=x.useMemo(()=>{const g=!c||!t?!1:m(d)?S().isPaused()||i?!1:p!==!1:d,j=O=>{const B=G(O);return delete B._k,g?{isValidating:!0,isLoading:!0,...B}:B},R=$(),y=D(),A=j(R),re=R===y?A:j(y);let T=A;return[()=>{const O=j($());return He(O,T)?(T.data=O.data,T.isLoading=O.isLoading,T.isValidating=O.isValidating,T.error=O.error,T):(T=O,O)},()=>re]},[s,c]),te=zr.useSyncExternalStore(x.useCallback(g=>K(c,(j,R)=>{He(R,j)||g()}),[s,c]),ze[0],ze[1]),Ge=!oe.current,It=l[c]&&l[c].length>0,ne=te.data,X=m(ne)?ue&&St(ue)?Ie(ue):ue:ne,de=te.error,xe=x.useRef(X),fe=h?m(ne)?m(xe.current)?X:xe.current:ne:X,Ke=It&&!m(de)?!1:Ge&&!m(d)?d:S().isPaused()?!1:i?m(X)?!1:p:m(X)||p,Xe=!!(c&&t&&Ge&&Ke),Lt=m(te.isValidating)?Xe:te.isValidating,kt=m(te.isLoading)?Xe:te.isLoading,ie=x.useCallback(async g=>{const j=k.current;if(!c||!j||U.current||S().isPaused())return!1;let R,y,A=!0;const re=g||{},T=!f[c]||!re.dedupe,O=()=>ut?!U.current&&c===E.current&&oe.current:c===E.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const q=f[c];q&&q[1]===y&&delete f[c]},Ze={isValidating:!0};m($().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&m($().data)&&setTimeout(()=>{A&&O()&&S().onLoadingSlow(c,r)},r.loadingTimeout),f[c]=[j(P),Be()]),[R,y]=f[c],R=await R,T&&setTimeout(Ye,r.dedupingInterval),!f[c]||f[c][1]!==y)return T&&O()&&S().onDiscarded(c),!1;B.error=N;const q=v[c];if(!m(q)&&(y<=q[0]||y<=q[1]||q[1]===0))return Je(),T&&O()&&S().onDiscarded(c),!1;const W=$().data;B.data=o(W,R)?W:R,T&&O()&&S().onSuccess(R,c,r)}catch(q){Ye();const W=S(),{shouldRetryOnError:ve}=W;W.isPaused()||(B.error=q,T&&O()&&(W.onError(q,c,W),(ve===!0||V(ve)&&ve(q))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||Y())&&W.onErrorRetry(q,c,W,Ct=>{const ge=l[c];ge&&ge[0]&&ge[0](ct,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return A=!1,Je(),!0},[c,s]),Qe=x.useCallback((...g)=>bt(s,E.current,...g),[]);if(Re(()=>{k.current=t,J.current=r,m(ne)||(xe.current=ne)}),Re(()=>{if(!c)return;const g=ie.bind(N,Le);let j=0;const y=gs(c,l,(A,re={})=>{if(A==jt){const T=Date.now();S().revalidateOnFocus&&T>j&&Y()&&(j=T+S().focusThrottleInterval,g())}else if(A==wt)S().revalidateOnReconnect&&Y()&&g();else{if(A==yt)return ie();if(A==ct)return ie(re)}});return U.current=!1,E.current=c,oe.current=!0,Z({_k:P}),Ke&&(m(X)||ce?g():ts(g)),()=>{U.current=!0,y()}},[c]),Re(()=>{let g;function j(){const y=V(_)?_($().data):_;y&&g!==-1&&(g=setTimeout(R,y))}function R(){!$().error&&(w||S().isVisible())&&(u||S().isOnline())?ie(Le).then(j):j()}return j(),()=>{g&&(clearTimeout(g),g=-1)}},[_,w,u,c]),x.useDebugValue(fe),i&&m(X)&&c){if(!ut&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");k.current=t,J.current=r,U.current=!1;const g=L[c];if(!m(g)){const j=Qe(g);Ie(j)}if(m(de)){const j=ie(Le);m(fe)||(j.status="fulfilled",j.value=!0),Ie(j)}else throw de}return{mutate:Qe,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,de},get isValidating(){return ee.isValidating=!0,Lt},get isLoading(){return ee.isLoading=!0,kt}}},_t=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=_t.default||_t,Ss="https://react-tweet.vercel.app";async function Ts([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const bs=(e,t,r)=>{const{isLoading:s,data:o,error:i}=ys(()=>t||e?[t||e&&`${Ss}/api/tweet/${e}`,r]:null,Ts,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!i),data:o,error:i}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Fr,{}),components:s,fetchOptions:o,onError:i})=>{const{data:a,error:d,isLoading:p}=bs(e,t,o);if(p)return r;if(d||!a){const _=(s==null?void 0:s.TweetNotFound)||Ar;return n.jsx(_,{error:i?i(d):d})}return n.jsx(qr,{tweet:a,components:s})};function Rs({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(M.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function Ot(e){const{t}=qt.useLocale(),[r,s]=x.useState("");x.useEffect(()=>{var i;if(e!=null&&e.editor){const{src:a}=(i=e.editor)==null?void 0:i.getAttributes(Nt.name);a&&s(a)}},[e==null?void 0:e.editor]);function o(i){i.preventDefault(),i.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:o,children:[n.jsx(H.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(H.Input,{className:"richtext-w-80",onChange:i=>s(i.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(H.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Os(e){function t(r){e.action&&e.action(r)}return n.jsxs(H.Popover,{modal:!0,children:[n.jsx(H.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(H.ActionButton,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(H.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(H.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Ot,{editor:e.editor,onSetLink:t})})]})}const Ns=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Is=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ht(e){return e.match(Is)}const Nt=je.Node.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:Os,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return M.ReactNodeViewRenderer(Rs,{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})=>ht(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ht(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[je.nodePasteRule({find:Ns,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",je.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Ot;exports.Twitter=Nt;
17
+ */var it;function Ur(){return it||(it=1,process.env.NODE_ENV!=="production"&&function(){function e(l,v){return l===v&&(l!==0||1/l===1/v)||l!==l&&v!==v}function t(l,v){w||o.startTransition===void 0||(w=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=v();if(!u){var k=v();i(f,k)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}k=a({inst:{value:f,getSnapshot:v}});var c=k[0].inst,P=k[1];return p(function(){c.value=f,c.getSnapshot=v,r(c)&&P({inst:c})},[l,f,v]),d(function(){return r(c)&&P({inst:c}),l(function(){r(c)&&P({inst:c})})},[l]),_(f),f}function r(l){var v=l.getSnapshot;l=l.value;try{var f=v();return!i(l,f)}catch{return!0}}function s(l,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=x,i=typeof Object.is=="function"?Object.is:e,a=o.useState,d=o.useEffect,p=o.useLayoutEffect,_=o.useDebugValue,w=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;be.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),be}var at;function Hr(){return at||(at=1,process.env.NODE_ENV==="production"?he.exports=Pr():he.exports=Ur()),he.exports}var zr=Hr();const jt=0,wt=1,yt=2,ct=3;var lt=Object.prototype.hasOwnProperty;function Ce(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--&&Ce(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(lt.call(e,r)&&++s&&!lt.call(t,r)||!(r in t)||!Ce(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,z=()=>{},N=z(),qe=Object,m=e=>e===N,V=e=>typeof e=="function",G=(e,t)=>({...e,...t}),St=e=>V(e.then),Ee={},me={},Pe="undefined",le=typeof window!=Pe,De=typeof document!=Pe,Gr=le&&"Deno"in window,Kr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,t)=>{const r=F.get(e);return[()=>!m(t)&&e.get(t)||Ee,s=>{if(!m(t)){const o=e.get(t);t in me||(me[t]=o),r[5](t,G(o,s),o||Ee)}},r[6],()=>!m(t)&&t in me?me[t]:!m(t)&&e.get(t)||Ee]};let $e=!0;const Xr=()=>$e,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[z,z],Qr=()=>{const e=De&&document.visibilityState;return m(e)||e!=="hidden"},Jr=e=>(De&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{De&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),Yr=e=>{const t=()=>{$e=!0,e()},r=()=>{$e=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},Zr={isOnline:Xr,isVisible:Qr},es={initFocus:Jr,initReconnect:Yr},ut=!x.useId,ce=!le||Gr,ts=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=ce?x.useEffect:x.useLayoutEffect,Oe=typeof navigator<"u"&&navigator.connection,dt=!ce&&Oe&&(["slow-2g","2g"].includes(Oe.effectiveType)||Oe.saveData),pe=new WeakMap,Ne=(e,t)=>qe.prototype.toString.call(e)===`[object ${t}]`;let ns=0;const Me=e=>{const t=typeof e,r=Ne(e,"Date"),s=Ne(e,"RegExp"),o=Ne(e,"Object");let i,a;if(qe(e)===e&&!r&&!s){if(i=pe.get(e),i)return i;if(i=++ns+"~",pe.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=Me(e[a])+",";pe.set(e,i)}if(o){i="#";const d=qe.keys(e).sort();for(;!m(a=d.pop());)m(e[a])||(i+=a+":"+Me(e[a])+",");pe.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(V(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let rs=0;const Be=()=>++rs;async function bt(...e){const[t,r,s,o]=e,i=G({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const d=i.rollbackOnError;let p=i.optimisticData;const _=h=>typeof d=="function"?d(h):d!==!1,w=i.throwOnError;if(V(r)){const h=r,l=[],v=t.keys();for(const f of v)!/^\$(inf|sub)\$/.test(f)&&h(t.get(f)._k)&&l.push(f);return Promise.all(l.map(u))}return u(r);async function u(h){const[l]=Ue(h);if(!l)return;const[v,f]=Tt(t,l),[k,c,P,oe]=F.get(t),U=()=>{const D=k[l];return(V(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete P[l],delete oe[l],D&&D[0])?D[0](yt).then(()=>v().data):v().data};if(e.length<3)return U();let E=s,I;const J=Be();c[l]=[J,0];const S=!m(p),Y=v(),$=Y.data,Z=Y._c,K=m(Z)?$:Z;if(S&&(p=V(p)?p(K,$):p,f({data:p,_c:K})),V(E))try{E=E(K)}catch(D){I=D}if(E&&St(E))if(E=await E.catch(D=>{I=D}),J!==c[l][0]){if(I)throw I;return E}else I&&S&&_(I)&&(a=!0,f({data:K,_c:N}));if(a&&!I)if(V(a)){const D=a(E,K);f({data:D,error:N,_c:N})}else f({data:E,error:N,_c:N});if(c[l][1]=Be(),Promise.resolve(U()).then(()=>{f({_c:N})}),I){if(w)throw I;return}return E}}const ft=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=G(es,t),s={},o=bt.bind(N,e);let i=z;const a={},d=(w,u)=>{const h=a[w]||[];return a[w]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},p=(w,u,h)=>{e.set(w,u);const l=a[w];if(l)for(const v of l)v(u,h)},_=()=>{if(!F.has(e)&&(F.set(e,[s,{},{},{},o,p,d]),!ce)){const w=r.initFocus(setTimeout.bind(N,ft.bind(N,s,jt))),u=r.initReconnect(setTimeout.bind(N,ft.bind(N,s,wt)));i=()=>{w&&w(),u&&u(),F.delete(e)}}};return _(),[e,o,_,i]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const i=r.errorRetryCount,a=o.retryCount,d=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!m(i)&&a>i||setTimeout(s,d,o)},is=Ce,[Et,as]=ss(new Map),cs=G({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:os,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:is,isPaused:()=>!1,cache:Et,mutate:as,fallback:{}},Zr),ls=(e,t)=>{const r=G(e,t);if(t){const{use:s,fallback:o}=e,{use:i,fallback:a}=t;s&&i&&(r.use=s.concat(i)),o&&a&&(r.fallback=G(o,a))}return r},us=x.createContext({}),ds="$inf$",Rt=le&&window.__SWR_DEVTOOLS_USE__,fs=Rt?window.__SWR_DEVTOOLS_USE__:[],_s=()=>{Rt&&(window.__SWR_DEVTOOLS_REACT__=x)},hs=e=>V(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ms=()=>G(cs,x.useContext(us)),ps=e=>(t,r,s)=>e(t,r&&((...i)=>{const[a]=Ue(t),[,,,d]=F.get(Et);if(a.startsWith(ds))return r(...i);const p=d[a];return m(p)?r(...i):(delete d[a],p)}),s),xs=fs.concat(ps),vs=e=>function(...r){const s=ms(),[o,i,a]=hs(r),d=ls(s,a);let p=e;const{use:_}=d,w=(_||[]).concat(xs);for(let u=w.length;u--;)p=w[u](p);return p(o,i||d.fetcher||null,d)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};_s();const Le=x.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}}),ke={dedupe:!0},js=(e,t,r)=>{const{cache:s,compare:o,suspense:i,fallbackData:a,revalidateOnMount:d,revalidateIfStale:p,refreshInterval:_,refreshWhenHidden:w,refreshWhenOffline:u,keepPreviousData:h}=r,[l,v,f,k]=F.get(s),[c,P]=Ue(e),oe=x.useRef(!1),U=x.useRef(!1),E=x.useRef(c),I=x.useRef(t),J=x.useRef(r),S=()=>J.current,Y=()=>S().isVisible()&&S().isOnline(),[$,Z,K,D]=Tt(s,c),ee=x.useRef({}).current,ue=m(a)?m(r.fallback)?N:r.fallback[c]:a,He=(g,j)=>{for(const R in ee){const y=R;if(y==="data"){if(!o(g[y],j[y])&&(!m(g[y])||!o(fe,j[y])))return!1}else if(j[y]!==g[y])return!1}return!0},ze=x.useMemo(()=>{const g=!c||!t?!1:m(d)?S().isPaused()||i?!1:p!==!1:d,j=O=>{const B=G(O);return delete B._k,g?{isValidating:!0,isLoading:!0,...B}:B},R=$(),y=D(),A=j(R),re=R===y?A:j(y);let T=A;return[()=>{const O=j($());return He(O,T)?(T.data=O.data,T.isLoading=O.isLoading,T.isValidating=O.isValidating,T.error=O.error,T):(T=O,O)},()=>re]},[s,c]),te=zr.useSyncExternalStore(x.useCallback(g=>K(c,(j,R)=>{He(R,j)||g()}),[s,c]),ze[0],ze[1]),Ge=!oe.current,Lt=l[c]&&l[c].length>0,ne=te.data,X=m(ne)?ue&&St(ue)?Le(ue):ue:ne,de=te.error,xe=x.useRef(X),fe=h?m(ne)?m(xe.current)?X:xe.current:ne:X,Ke=Lt&&!m(de)?!1:Ge&&!m(d)?d:S().isPaused()?!1:i?m(X)?!1:p:m(X)||p,Xe=!!(c&&t&&Ge&&Ke),kt=m(te.isValidating)?Xe:te.isValidating,It=m(te.isLoading)?Xe:te.isLoading,ie=x.useCallback(async g=>{const j=I.current;if(!c||!j||U.current||S().isPaused())return!1;let R,y,A=!0;const re=g||{},T=!f[c]||!re.dedupe,O=()=>ut?!U.current&&c===E.current&&oe.current:c===E.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const q=f[c];q&&q[1]===y&&delete f[c]},Ze={isValidating:!0};m($().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&m($().data)&&setTimeout(()=>{A&&O()&&S().onLoadingSlow(c,r)},r.loadingTimeout),f[c]=[j(P),Be()]),[R,y]=f[c],R=await R,T&&setTimeout(Ye,r.dedupingInterval),!f[c]||f[c][1]!==y)return T&&O()&&S().onDiscarded(c),!1;B.error=N;const q=v[c];if(!m(q)&&(y<=q[0]||y<=q[1]||q[1]===0))return Je(),T&&O()&&S().onDiscarded(c),!1;const W=$().data;B.data=o(W,R)?W:R,T&&O()&&S().onSuccess(R,c,r)}catch(q){Ye();const W=S(),{shouldRetryOnError:ve}=W;W.isPaused()||(B.error=q,T&&O()&&(W.onError(q,c,W),(ve===!0||V(ve)&&ve(q))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||Y())&&W.onErrorRetry(q,c,W,Ct=>{const ge=l[c];ge&&ge[0]&&ge[0](ct,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return A=!1,Je(),!0},[c,s]),Qe=x.useCallback((...g)=>bt(s,E.current,...g),[]);if(Re(()=>{I.current=t,J.current=r,m(ne)||(xe.current=ne)}),Re(()=>{if(!c)return;const g=ie.bind(N,ke);let j=0;const y=gs(c,l,(A,re={})=>{if(A==jt){const T=Date.now();S().revalidateOnFocus&&T>j&&Y()&&(j=T+S().focusThrottleInterval,g())}else if(A==wt)S().revalidateOnReconnect&&Y()&&g();else{if(A==yt)return ie();if(A==ct)return ie(re)}});return U.current=!1,E.current=c,oe.current=!0,Z({_k:P}),Ke&&(m(X)||ce?g():ts(g)),()=>{U.current=!0,y()}},[c]),Re(()=>{let g;function j(){const y=V(_)?_($().data):_;y&&g!==-1&&(g=setTimeout(R,y))}function R(){!$().error&&(w||S().isVisible())&&(u||S().isOnline())?ie(ke).then(j):j()}return j(),()=>{g&&(clearTimeout(g),g=-1)}},[_,w,u,c]),x.useDebugValue(fe),i&&m(X)&&c){if(!ut&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");I.current=t,J.current=r,U.current=!1;const g=k[c];if(!m(g)){const j=Qe(g);Le(j)}if(m(de)){const j=ie(ke);m(fe)||(j.status="fulfilled",j.value=!0),Le(j)}else throw de}return{mutate:Qe,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,de},get isValidating(){return ee.isValidating=!0,kt},get isLoading(){return ee.isLoading=!0,It}}},_t=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=_t.default||_t,Ss="https://react-tweet.vercel.app";async function Ts([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const bs=(e,t,r)=>{const{isLoading:s,data:o,error:i}=ys(()=>t||e?[t||e&&`${Ss}/api/tweet/${e}`,r]:null,Ts,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!i),data:o,error:i}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Fr,{}),components:s,fetchOptions:o,onError:i})=>{const{data:a,error:d,isLoading:p}=bs(e,t,o);if(p)return r;if(d||!a){const _=(s==null?void 0:s.TweetNotFound)||Ar;return n.jsx(_,{error:i?i(d):d})}return n.jsx(qr,{tweet:a,components:s})};function Rs({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(M.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function Ot(e){const{t}=qt.useLocale(),[r,s]=x.useState("");x.useEffect(()=>{var i;if(e!=null&&e.editor){const{src:a}=(i=e.editor)==null?void 0:i.getAttributes(Nt.name);a&&s(a)}},[e==null?void 0:e.editor]);function o(i){i.preventDefault(),i.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:o,children:[n.jsx(H.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(H.Input,{className:"richtext-w-80",onChange:i=>s(i.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(H.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Os(e){function t(r){e.action&&e.action(r)}return n.jsxs(H.Popover,{modal:!0,children:[n.jsx(H.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(H.ActionButton,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(H.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(H.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Ot,{editor:e.editor,onSetLink:t})})]})}const Ns=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ht(e){return e.match(Ls)}const Nt=je.Node.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:Os,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return M.ReactNodeViewRenderer(Rs,{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})=>ht(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ht(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[je.nodePasteRule({find:Ns,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",je.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Ot;exports.Twitter=Nt;
package/lib/Twitter.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");require("./dom-dataset-Cuy-pIfj.cjs");const e=require("./Twitter-DbokWMq-.cjs");exports.Twitter=e.Twitter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");require("./dom-dataset-Cuy-pIfj.cjs");const e=require("./Twitter-Cg58uzB-.cjs");exports.Twitter=e.Twitter;
package/lib/Twitter.d.cts CHANGED
@@ -62,11 +62,9 @@ declare module '@tiptap/core' {
62
62
 
63
63
  declare module '@tiptap/core' {
64
64
  interface Commands<ReturnType> {
65
- emoji: {
66
- setEmoji: (emoji: {
67
- name: string;
68
- emoji: string;
69
- }) => ReturnType;
65
+ drawer: {
66
+ setDrawer: (options: any, replace?: any) => ReturnType;
67
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
70
68
  };
71
69
  }
72
70
  }
@@ -74,9 +72,11 @@ declare module '@tiptap/core' {
74
72
 
75
73
  declare module '@tiptap/core' {
76
74
  interface Commands<ReturnType> {
77
- drawer: {
78
- setDrawer: (options: any, replace?: any) => ReturnType;
79
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
75
+ emoji: {
76
+ setEmoji: (emoji: {
77
+ name: string;
78
+ emoji: string;
79
+ }) => ReturnType;
80
80
  };
81
81
  }
82
82
  }
@@ -100,15 +100,6 @@ declare module '@tiptap/core' {
100
100
  }
101
101
 
102
102
 
103
- declare module '@tiptap/core' {
104
- interface Commands<ReturnType> {
105
- painter: {
106
- setPainter: (marks: Mark[]) => ReturnType;
107
- };
108
- }
109
- }
110
-
111
-
112
103
  declare module '@tiptap/core' {
113
104
  interface Commands<ReturnType> {
114
105
  fontSize: {
@@ -127,6 +118,15 @@ declare module '@tiptap/core' {
127
118
  }
128
119
 
129
120
 
121
+ declare module '@tiptap/core' {
122
+ interface Commands<ReturnType> {
123
+ painter: {
124
+ setPainter: (marks: Mark[]) => ReturnType;
125
+ };
126
+ }
127
+ }
128
+
129
+
130
130
  declare module '@tiptap/core' {
131
131
  interface Commands<ReturnType> {
132
132
  iframe: {
package/lib/Twitter.d.ts CHANGED
@@ -62,11 +62,9 @@ declare module '@tiptap/core' {
62
62
 
63
63
  declare module '@tiptap/core' {
64
64
  interface Commands<ReturnType> {
65
- emoji: {
66
- setEmoji: (emoji: {
67
- name: string;
68
- emoji: string;
69
- }) => ReturnType;
65
+ drawer: {
66
+ setDrawer: (options: any, replace?: any) => ReturnType;
67
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
70
68
  };
71
69
  }
72
70
  }
@@ -74,9 +72,11 @@ declare module '@tiptap/core' {
74
72
 
75
73
  declare module '@tiptap/core' {
76
74
  interface Commands<ReturnType> {
77
- drawer: {
78
- setDrawer: (options: any, replace?: any) => ReturnType;
79
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
75
+ emoji: {
76
+ setEmoji: (emoji: {
77
+ name: string;
78
+ emoji: string;
79
+ }) => ReturnType;
80
80
  };
81
81
  }
82
82
  }
@@ -100,15 +100,6 @@ declare module '@tiptap/core' {
100
100
  }
101
101
 
102
102
 
103
- declare module '@tiptap/core' {
104
- interface Commands<ReturnType> {
105
- painter: {
106
- setPainter: (marks: Mark[]) => ReturnType;
107
- };
108
- }
109
- }
110
-
111
-
112
103
  declare module '@tiptap/core' {
113
104
  interface Commands<ReturnType> {
114
105
  fontSize: {
@@ -127,6 +118,15 @@ declare module '@tiptap/core' {
127
118
  }
128
119
 
129
120
 
121
+ declare module '@tiptap/core' {
122
+ interface Commands<ReturnType> {
123
+ painter: {
124
+ setPainter: (marks: Mark[]) => ReturnType;
125
+ };
126
+ }
127
+ }
128
+
129
+
130
130
  declare module '@tiptap/core' {
131
131
  interface Commands<ReturnType> {
132
132
  iframe: {
package/lib/Twitter.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./index-CXIIg9Sq.js";
2
- import "./dom-dataset-2RXYq9wp.js";
3
- import { T as m } from "./Twitter-ChRmdJB0.js";
1
+ import "./index-BWx1Mchx.js";
2
+ import "./dom-dataset-CHDbKz5J.js";
3
+ import { T as m } from "./Twitter-2LOf4hFb.js";
4
4
  export {
5
5
  m as Twitter
6
6
  };
package/lib/Video.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");require("./index-Dz3YxLE7.cjs");const e=require("./RichTextEditor-COwI-b24.cjs");exports.Video=e.Video;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");require("./index-Dz3YxLE7.cjs");const e=require("./RichTextEditor-C3sK_Ys3.cjs");exports.Video=e.Video;