reactjs-tiptap-editor 1.0.6 → 1.0.8
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.
- package/lib/{ActionMenuButton-htJNI0Fa.js → ActionMenuButton-Cc0vy5hy.js} +10 -13
- package/lib/ActionMenuButton-t7e5GCJp.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +23 -25
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +5 -6
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +5 -6
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +11 -12
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +9 -10
- package/lib/CodeBlock.cjs +39 -39
- package/lib/CodeBlock.js +837 -946
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +8 -9
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +18 -19
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +5 -6
- package/lib/{Drawer-1211urKj.js → Drawer-C6WTtcd0.js} +16 -17
- package/lib/Drawer-DRdsK4f_.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +15 -16
- package/lib/{Excalidraw-Du3hBR8t.js → Excalidraw-DjO5sCC_.js} +31 -32
- package/lib/Excalidraw-gJ99kWdS.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +17 -18
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +5 -6
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +15 -15
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +7 -8
- package/lib/History.cjs +1 -1
- package/lib/History.js +8 -10
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +5 -6
- package/lib/Icon-DHNSWrSX.cjs +1 -0
- package/lib/{Icon-C-qYUAS1.js → Icon-prdLEHMN.js} +3 -4
- package/lib/{Iframe-DTYTLQE6.js → Iframe-CERKUXQh.js} +13 -14
- package/lib/Iframe-CvymVtpM.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +48 -49
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +22 -23
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +10 -11
- package/lib/{Indent-jOPn3eUM.js → Indent-BfEOOT5B.js} +24 -25
- package/lib/Indent-CE6kk62r.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +10 -11
- package/lib/{Katex-CERSrcTP.js → Katex-5KNTSK8T.js} +21 -22
- package/lib/Katex-CJ2Fmvut.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +14 -15
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-B5SdhOfa.js → LinkEditBlock-CFkyS2Ze.js} +55 -56
- package/lib/{LinkEditBlock-DaxljgJC.cjs → LinkEditBlock-D6z0Yohc.cjs} +2 -2
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +138 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +20 -20
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +22 -24
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +5 -6
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +18 -19
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +13 -13
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +5 -6
- package/lib/{Table-39OkCQbu.js → Table-CWbY_hqo.js} +7 -8
- package/lib/Table-D9pRzwFU.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +13 -14
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +17 -19
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +17 -19
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +5 -6
- package/lib/{Twitter-D7PhLycr.js → Twitter-BV7HA-MO.js} +566 -525
- package/lib/Twitter-D7NK3MZe.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +24 -25
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +433 -423
- package/lib/{button-Crm67hfl.js → button-0963_Pa8.js} +3 -4
- package/lib/button-Bxfjx9_Y.cjs +1 -0
- package/lib/{checkbox-DViVmgJ6.js → checkbox-D4p6-UMt.js} +1 -1
- package/lib/{checkbox-NQC2MdGT.cjs → checkbox-Q6FcMQW5.cjs} +1 -1
- package/lib/{dialog-Ce9Cjfft.js → dialog-B-9_Z5j2.js} +1 -1
- package/lib/{dialog-DaHBd2zw.cjs → dialog-D-oYxagG.cjs} +1 -1
- package/lib/{dropdown-menu-CQykJhBs.js → dropdown-menu-par18QL5.js} +1 -1
- package/lib/{dropdown-menu-CSCDQtq0.cjs → dropdown-menu-r8XibZQU.cjs} +1 -1
- package/lib/extensions/Mention/Mention.d.ts +3 -1
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
- package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
- package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
- package/lib/index-BFXkgG1P.cjs +7 -0
- package/lib/{index-prphFVsp.js → index-BQ6ZdLsu.js} +1 -1
- package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
- package/lib/{index-D-FhWysc.js → index-BimeTI7q.js} +1 -1
- package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
- package/lib/{index-nFjllrEl.js → index-CbIQPoF6.js} +19 -18
- package/lib/{index-BeUrdBxf.js → index-EKFybgpP.js} +1 -1
- package/lib/{index-DuZCJJSp.js → index-pgx8gyoC.js} +1118 -504
- package/lib/index.cjs +2 -2
- package/lib/index.js +8 -9
- package/lib/{input-tU3H__39.cjs → input-CZUkD6wF.cjs} +1 -1
- package/lib/{input-DfqFAyKo.js → input-cclJoUeC.js} +1 -1
- package/lib/{isNumber-CTm1pIvN.js → isNumber-8HKEgTkA.js} +1 -1
- package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
- package/lib/label-CFaBdRGz.cjs +1 -0
- package/lib/label-aveW7pdK.js +18 -0
- package/lib/{popover-CZWSQZ0q.cjs → popover-BWYZO_fD.cjs} +1 -1
- package/lib/{popover-CoepUobG.js → popover-D5YZPv2r.js} +1 -1
- package/lib/{separator-DCQD8P6s.cjs → separator-B978cwAm.cjs} +1 -1
- package/lib/{separator-6SnwzytZ.js → separator-BHjFVmZr.js} +18 -18
- package/lib/{store-726Zjszt.cjs → store-BsBiawfz.cjs} +1 -1
- package/lib/{store-ibARMQ3h.js → store-BsMMRKFd.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-DrkJL_C2.js → tabs-Bj8EvAkY.js} +1 -1
- package/lib/{tabs-B_ArrG09.cjs → tabs-CUMyiV80.cjs} +1 -1
- package/lib/{textarea-CmZVZKOo.cjs → textarea-BKb7LDw1.cjs} +1 -1
- package/lib/{textarea-CIs52G8B.js → textarea-CClyW-74.js} +1 -1
- package/lib/{throttle-CGM5M2yG.js → throttle-BIkZV3Y_.js} +1 -1
- package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
- package/lib/{updatePosition-DpMKxYdN.js → updatePosition-GLTrgcib.js} +1 -1
- package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
- package/lib/useButtonProps-B0riSJs9.cjs +1 -0
- package/lib/{useButtonProps-D0SrPzuG.js → useButtonProps-StwAz7Ha.js} +35 -47
- package/package.json +58 -54
- package/lib/ActionMenuButton-DYT5chmX.cjs +0 -1
- package/lib/Drawer-DUFUd5BW.cjs +0 -1
- package/lib/Excalidraw-CajgZDjU.cjs +0 -1
- package/lib/Icon-BjR_or8V.cjs +0 -1
- package/lib/Iframe-CM6mRQmv.cjs +0 -1
- package/lib/Indent-BmhiEb0S.cjs +0 -1
- package/lib/Katex-CUd3LxLh.cjs +0 -4
- package/lib/Table-3VstSlg4.cjs +0 -9
- package/lib/Twitter-DuHPeVW1.cjs +0 -1
- package/lib/button-xNppt_aK.cjs +0 -1
- package/lib/index-BQ17A_37.js +0 -393
- package/lib/index-CNzHZDls.cjs +0 -7
- package/lib/index-DmOTQudI.cjs +0 -1
- package/lib/label-DC33TZy_.js +0 -19
- package/lib/label-DkDE77kc.cjs +0 -1
- package/lib/toggle-DVCNvcqp.cjs +0 -1
- package/lib/toggle-xchtz-Kf.js +0 -92
- package/lib/tooltip-BTFcHrd9.js +0 -24
- package/lib/tooltip-DFjcKu9a.cjs +0 -1
- package/lib/useButtonProps-bei1vI37.cjs +0 -1
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { C as U, aa as rt, s as
|
|
2
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
3
|
-
import Be, { useState as se, Fragment as
|
|
4
|
-
import { A as
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { c as
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, an = () => /* @__PURE__ */ r("svg", {
|
|
1
|
+
import { C as U, aa as rt, s as Mt, N as jt, m as Wt, ab as Bt, R as Ft } from "./index-CbIQPoF6.js";
|
|
2
|
+
import { jsx as r, jsxs as h, Fragment as Pt } from "react/jsx-runtime";
|
|
3
|
+
import Be, { useState as se, Fragment as Ut, useEffect as Fe, useMemo as Pe, createContext as zt, useLayoutEffect as Ht, useContext as Gt, useRef as K, useCallback as Te, useDebugValue as Xt } from "react";
|
|
4
|
+
import { A as Kt } from "./index-pgx8gyoC.js";
|
|
5
|
+
import { P as Qt, a as Jt, b as Yt } from "./popover-D5YZPv2r.js";
|
|
6
|
+
import { B as Zt } from "./button-0963_Pa8.js";
|
|
7
|
+
import { I as en } from "./input-cclJoUeC.js";
|
|
8
|
+
import { L as tn } from "./label-aveW7pdK.js";
|
|
9
|
+
import { u as nn } from "./index-0OnGZkVF.js";
|
|
10
|
+
import { c as rn, u as on, a as an } from "./useButtonProps-StwAz7Ha.js";
|
|
11
|
+
import { I as sn } from "./Icon-prdLEHMN.js";
|
|
12
|
+
const cn = "_verified_lvyh0_1", Ue = {
|
|
13
|
+
verified: cn
|
|
14
|
+
}, ln = () => /* @__PURE__ */ r("svg", {
|
|
16
15
|
viewBox: "0 0 24 24",
|
|
17
16
|
"aria-label": "Verified account",
|
|
18
17
|
role: "img",
|
|
@@ -22,7 +21,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
22
21
|
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"
|
|
23
22
|
})
|
|
24
23
|
})
|
|
25
|
-
}),
|
|
24
|
+
}), dn = () => /* @__PURE__ */ r("svg", {
|
|
26
25
|
viewBox: "0 0 22 22",
|
|
27
26
|
"aria-label": "Verified account",
|
|
28
27
|
role: "img",
|
|
@@ -101,7 +100,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
101
100
|
})
|
|
102
101
|
]
|
|
103
102
|
})
|
|
104
|
-
}),
|
|
103
|
+
}), un = () => /* @__PURE__ */ r("svg", {
|
|
105
104
|
viewBox: "0 0 22 22",
|
|
106
105
|
"aria-label": "Verified account",
|
|
107
106
|
role: "img",
|
|
@@ -113,9 +112,9 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
113
112
|
fillRule: "evenodd"
|
|
114
113
|
})
|
|
115
114
|
})
|
|
116
|
-
}),
|
|
117
|
-
root:
|
|
118
|
-
article:
|
|
115
|
+
}), fn = "_root_98iqw_1", hn = "_article_98iqw_21", ot = {
|
|
116
|
+
root: fn,
|
|
117
|
+
article: hn
|
|
119
118
|
}, ze = ({ className: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
120
119
|
className: U("react-tweet-theme", ot.root, e),
|
|
121
120
|
children: /* @__PURE__ */ r("article", {
|
|
@@ -124,46 +123,60 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
124
123
|
})
|
|
125
124
|
}), vt = (e) => /* @__PURE__ */ r("img", {
|
|
126
125
|
...e
|
|
127
|
-
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
avatarSquare: mn,
|
|
132
|
-
avatarShadow: pn,
|
|
133
|
-
author: vn,
|
|
134
|
-
authorLink: gn,
|
|
135
|
-
authorVerified: wn,
|
|
136
|
-
authorLinkText: yn,
|
|
137
|
-
authorMeta: Tn,
|
|
138
|
-
authorFollow: bn,
|
|
139
|
-
username: xn,
|
|
140
|
-
follow: Nn,
|
|
141
|
-
separator: Rn,
|
|
142
|
-
brand: In,
|
|
143
|
-
twitterIcon: kn
|
|
144
|
-
}, Sn = "_verifiedOld_lcna5_1", En = "_verifiedBlue_lcna5_4", Cn = "_verifiedGovernment_lcna5_7", xe = {
|
|
145
|
-
verifiedOld: Sn,
|
|
146
|
-
verifiedBlue: En,
|
|
147
|
-
verifiedGovernment: Cn
|
|
126
|
+
}), _n = "_verifiedOld_lcna5_1", mn = "_verifiedBlue_lcna5_4", pn = "_verifiedGovernment_lcna5_7", xe = {
|
|
127
|
+
verifiedOld: _n,
|
|
128
|
+
verifiedBlue: mn,
|
|
129
|
+
verifiedGovernment: pn
|
|
148
130
|
}, gt = ({ user: e, className: t }) => {
|
|
149
131
|
const n = e.verified || e.is_blue_verified || e.verified_type;
|
|
150
|
-
let o = /* @__PURE__ */ r(
|
|
132
|
+
let o = /* @__PURE__ */ r(ln, {}), a = xe.verifiedBlue;
|
|
151
133
|
if (n)
|
|
152
|
-
switch (e.is_blue_verified || (
|
|
134
|
+
switch (e.is_blue_verified || (a = xe.verifiedOld), e.verified_type) {
|
|
153
135
|
case "Government":
|
|
154
|
-
o = /* @__PURE__ */ r(
|
|
136
|
+
o = /* @__PURE__ */ r(un, {}), a = xe.verifiedGovernment;
|
|
155
137
|
break;
|
|
156
138
|
case "Business":
|
|
157
|
-
o = /* @__PURE__ */ r(
|
|
139
|
+
o = /* @__PURE__ */ r(dn, {}), a = null;
|
|
158
140
|
break;
|
|
159
141
|
}
|
|
160
142
|
return n ? /* @__PURE__ */ r("div", {
|
|
161
|
-
className: U(t,
|
|
143
|
+
className: U(t, a),
|
|
162
144
|
children: o
|
|
163
145
|
}) : null;
|
|
164
|
-
},
|
|
146
|
+
}, vn = "_label_36ucz_1", gn = {
|
|
147
|
+
label: vn
|
|
148
|
+
}, wt = ({ user: e, className: t }) => {
|
|
165
149
|
var n;
|
|
166
|
-
const o =
|
|
150
|
+
const o = e.highlighted_label;
|
|
151
|
+
if (!o) return null;
|
|
152
|
+
const a = (n = o.badge) == null ? void 0 : n.url;
|
|
153
|
+
return a ? /* @__PURE__ */ r("div", {
|
|
154
|
+
className: U(gn.label, t),
|
|
155
|
+
children: /* @__PURE__ */ r("img", {
|
|
156
|
+
src: a,
|
|
157
|
+
alt: o.description
|
|
158
|
+
})
|
|
159
|
+
}) : null;
|
|
160
|
+
}, wn = "_header_nqq4j_1", yn = "_avatar_nqq4j_11", bn = "_avatarOverflow_nqq4j_16", Tn = "_avatarSquare_nqq4j_23", xn = "_avatarShadow_nqq4j_26", Nn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Rn = "_authorVerified_nqq4j_53", Sn = "_authorLinkText_nqq4j_56", kn = "_authorMeta_nqq4j_63", En = "_authorFollow_nqq4j_66", Cn = "_username_nqq4j_69", On = "_follow_nqq4j_74", Ln = "_separator_nqq4j_82", $n = "_brand_nqq4j_86", qn = "_twitterIcon_nqq4j_90", N = {
|
|
161
|
+
header: wn,
|
|
162
|
+
avatar: yn,
|
|
163
|
+
avatarOverflow: bn,
|
|
164
|
+
avatarSquare: Tn,
|
|
165
|
+
avatarShadow: xn,
|
|
166
|
+
author: Nn,
|
|
167
|
+
authorLink: In,
|
|
168
|
+
authorVerified: Rn,
|
|
169
|
+
authorLinkText: Sn,
|
|
170
|
+
authorMeta: kn,
|
|
171
|
+
authorFollow: En,
|
|
172
|
+
username: Cn,
|
|
173
|
+
follow: On,
|
|
174
|
+
separator: Ln,
|
|
175
|
+
brand: $n,
|
|
176
|
+
twitterIcon: qn
|
|
177
|
+
}, Dn = ({ tweet: e, components: t }) => {
|
|
178
|
+
var n;
|
|
179
|
+
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : vt, { user: a } = e;
|
|
167
180
|
return /* @__PURE__ */ h("div", {
|
|
168
181
|
className: N.header,
|
|
169
182
|
children: [
|
|
@@ -174,10 +187,10 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
174
187
|
rel: "noopener noreferrer",
|
|
175
188
|
children: [
|
|
176
189
|
/* @__PURE__ */ r("div", {
|
|
177
|
-
className: U(N.avatarOverflow,
|
|
190
|
+
className: U(N.avatarOverflow, a.profile_image_shape === "Square" && N.avatarSquare),
|
|
178
191
|
children: /* @__PURE__ */ r(o, {
|
|
179
|
-
src:
|
|
180
|
-
alt:
|
|
192
|
+
src: a.profile_image_url_https,
|
|
193
|
+
alt: a.name,
|
|
181
194
|
width: 48,
|
|
182
195
|
height: 48
|
|
183
196
|
})
|
|
@@ -202,13 +215,16 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
202
215
|
/* @__PURE__ */ r("div", {
|
|
203
216
|
className: N.authorLinkText,
|
|
204
217
|
children: /* @__PURE__ */ r("span", {
|
|
205
|
-
title:
|
|
206
|
-
children:
|
|
218
|
+
title: a.name,
|
|
219
|
+
children: a.name
|
|
207
220
|
})
|
|
208
221
|
}),
|
|
209
222
|
/* @__PURE__ */ r(gt, {
|
|
210
|
-
user:
|
|
223
|
+
user: a,
|
|
211
224
|
className: N.authorVerified
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ r(wt, {
|
|
227
|
+
user: a
|
|
212
228
|
})
|
|
213
229
|
]
|
|
214
230
|
}),
|
|
@@ -221,10 +237,10 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
221
237
|
target: "_blank",
|
|
222
238
|
rel: "noopener noreferrer",
|
|
223
239
|
children: /* @__PURE__ */ h("span", {
|
|
224
|
-
title: `@${
|
|
240
|
+
title: `@${a.screen_name}`,
|
|
225
241
|
children: [
|
|
226
242
|
"@",
|
|
227
|
-
|
|
243
|
+
a.screen_name
|
|
228
244
|
]
|
|
229
245
|
})
|
|
230
246
|
}),
|
|
@@ -236,7 +252,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
236
252
|
children: "·"
|
|
237
253
|
}),
|
|
238
254
|
/* @__PURE__ */ r("a", {
|
|
239
|
-
href:
|
|
255
|
+
href: a.follow_url,
|
|
240
256
|
className: N.follow,
|
|
241
257
|
target: "_blank",
|
|
242
258
|
rel: "noopener noreferrer",
|
|
@@ -267,64 +283,97 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
267
283
|
})
|
|
268
284
|
]
|
|
269
285
|
});
|
|
270
|
-
},
|
|
271
|
-
root:
|
|
272
|
-
},
|
|
286
|
+
}, An = "_root_1ec15_1", Vn = {
|
|
287
|
+
root: An
|
|
288
|
+
}, Mn = ({ tweet: e }) => /* @__PURE__ */ h("a", {
|
|
273
289
|
href: e.in_reply_to_url,
|
|
274
|
-
className:
|
|
290
|
+
className: Vn.root,
|
|
275
291
|
target: "_blank",
|
|
276
292
|
rel: "noopener noreferrer",
|
|
277
293
|
children: [
|
|
278
294
|
"Replying to @",
|
|
279
295
|
e.in_reply_to_screen_name
|
|
280
296
|
]
|
|
281
|
-
}),
|
|
282
|
-
root:
|
|
283
|
-
},
|
|
297
|
+
}), jn = "_root_eihfa_1", Wn = {
|
|
298
|
+
root: jn
|
|
299
|
+
}, yt = ({ href: e, children: t }) => /* @__PURE__ */ r("a", {
|
|
284
300
|
href: e,
|
|
285
|
-
className:
|
|
301
|
+
className: Wn.root,
|
|
286
302
|
target: "_blank",
|
|
287
303
|
rel: "noopener noreferrer nofollow",
|
|
288
304
|
children: t
|
|
289
|
-
}),
|
|
290
|
-
root:
|
|
291
|
-
},
|
|
292
|
-
className:
|
|
305
|
+
}), Bn = "_root_1xq52_1", Fn = {
|
|
306
|
+
root: Bn
|
|
307
|
+
}, Pn = ({ tweet: e }) => /* @__PURE__ */ h("p", {
|
|
308
|
+
className: Fn.root,
|
|
293
309
|
lang: e.lang,
|
|
294
310
|
dir: "auto",
|
|
295
|
-
children:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}),
|
|
311
|
+
children: [
|
|
312
|
+
e.entities.map((t, n) => {
|
|
313
|
+
switch (t.type) {
|
|
314
|
+
case "hashtag":
|
|
315
|
+
case "mention":
|
|
316
|
+
case "url":
|
|
317
|
+
case "symbol":
|
|
318
|
+
return /* @__PURE__ */ r(yt, {
|
|
319
|
+
href: t.href,
|
|
320
|
+
children: t.text
|
|
321
|
+
}, n);
|
|
322
|
+
case "media":
|
|
323
|
+
return;
|
|
324
|
+
default:
|
|
325
|
+
return /* @__PURE__ */ r("span", {
|
|
326
|
+
dangerouslySetInnerHTML: {
|
|
327
|
+
__html: t.text
|
|
328
|
+
}
|
|
329
|
+
}, n);
|
|
330
|
+
}
|
|
331
|
+
}),
|
|
332
|
+
e.note_tweet ? /* @__PURE__ */ r(Un, {
|
|
333
|
+
tweet: e
|
|
334
|
+
}) : null
|
|
335
|
+
]
|
|
336
|
+
});
|
|
337
|
+
function Un({ tweet: e }) {
|
|
338
|
+
return /* @__PURE__ */ h(yt, {
|
|
339
|
+
href: e.url,
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ r("span", {
|
|
342
|
+
children: " "
|
|
343
|
+
}),
|
|
344
|
+
"Show more"
|
|
345
|
+
]
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
const zn = {
|
|
349
|
+
hour: "numeric",
|
|
350
|
+
minute: "2-digit",
|
|
351
|
+
hour12: !0,
|
|
352
|
+
weekday: "short",
|
|
353
|
+
month: "short",
|
|
354
|
+
day: "numeric",
|
|
355
|
+
year: "numeric"
|
|
356
|
+
}, Hn = new Intl.DateTimeFormat("en-US", zn), Gn = (e) => {
|
|
357
|
+
const t = {};
|
|
358
|
+
for (const n of e)
|
|
359
|
+
t[n.type] = n.value;
|
|
360
|
+
return t;
|
|
361
|
+
}, Xn = (e) => {
|
|
362
|
+
const t = Gn(Hn.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
|
|
363
|
+
return `${n} · ${o}`;
|
|
364
|
+
}, at = (e) => `https://x.com/${e.user.screen_name}/status/${e.id_str}`, bt = (e) => `https://x.com/${typeof e == "string" ? e : e.user.screen_name}`, Kn = (e) => `https://x.com/intent/like?tweet_id=${e.id_str}`, Qn = (e) => `https://x.com/intent/tweet?in_reply_to=${e.id_str}`, Jn = (e) => `https://x.com/intent/follow?screen_name=${e.user.screen_name}`, Yn = (e) => `https://x.com/hashtag/${e.text}`, Zn = (e) => `https://x.com/search?q=%24${e.text}`, er = (e) => `https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`, Tt = (e, t) => {
|
|
316
365
|
const n = new URL(e.media_url_https), o = n.pathname.split(".").pop();
|
|
317
366
|
return o ? (n.pathname = n.pathname.replace(`.${o}`, ""), n.searchParams.set("format", o), n.searchParams.set("name", t), n.toString()) : e.media_url_https;
|
|
318
|
-
},
|
|
367
|
+
}, tr = (e) => {
|
|
319
368
|
const { variants: t } = e.video_info;
|
|
320
|
-
return t.filter((o) => o.content_type === "video/mp4").sort((o,
|
|
321
|
-
var
|
|
322
|
-
return ((
|
|
369
|
+
return t.filter((o) => o.content_type === "video/mp4").sort((o, a) => {
|
|
370
|
+
var i, s;
|
|
371
|
+
return ((i = a.bitrate) != null ? i : 0) - ((s = o.bitrate) != null ? s : 0);
|
|
323
372
|
});
|
|
324
|
-
},
|
|
325
|
-
const t =
|
|
373
|
+
}, nr = (e) => {
|
|
374
|
+
const t = tr(e);
|
|
326
375
|
return t.length > 1 ? t[1] : t[0];
|
|
327
|
-
},
|
|
376
|
+
}, Le = (e) => e > 999999 ? `${(e / 1e6).toFixed(1)}M` : e > 999 ? `${(e / 1e3).toFixed(1)}K` : e.toString();
|
|
328
377
|
function st(e) {
|
|
329
378
|
const t = Array.from(e.text), n = [
|
|
330
379
|
{
|
|
@@ -332,18 +381,18 @@ function st(e) {
|
|
|
332
381
|
type: "text"
|
|
333
382
|
}
|
|
334
383
|
];
|
|
335
|
-
return de(n, "hashtag", e.entities.hashtags), de(n, "mention", e.entities.user_mentions), de(n, "url", e.entities.urls), de(n, "symbol", e.entities.symbols), e.entities.media && de(n, "media", e.entities.media),
|
|
336
|
-
const
|
|
384
|
+
return de(n, "hashtag", e.entities.hashtags), de(n, "mention", e.entities.user_mentions), de(n, "url", e.entities.urls), de(n, "symbol", e.entities.symbols), e.entities.media && de(n, "media", e.entities.media), rr(e, n), n.map((o) => {
|
|
385
|
+
const a = t.slice(o.indices[0], o.indices[1]).join("");
|
|
337
386
|
switch (o.type) {
|
|
338
387
|
case "hashtag":
|
|
339
388
|
return Object.assign(o, {
|
|
340
|
-
href:
|
|
341
|
-
text:
|
|
389
|
+
href: Yn(o),
|
|
390
|
+
text: a
|
|
342
391
|
});
|
|
343
392
|
case "mention":
|
|
344
393
|
return Object.assign(o, {
|
|
345
|
-
href:
|
|
346
|
-
text:
|
|
394
|
+
href: bt(o.screen_name),
|
|
395
|
+
text: a
|
|
347
396
|
});
|
|
348
397
|
case "url":
|
|
349
398
|
case "media":
|
|
@@ -353,20 +402,20 @@ function st(e) {
|
|
|
353
402
|
});
|
|
354
403
|
case "symbol":
|
|
355
404
|
return Object.assign(o, {
|
|
356
|
-
href:
|
|
357
|
-
text:
|
|
405
|
+
href: Zn(o),
|
|
406
|
+
text: a
|
|
358
407
|
});
|
|
359
408
|
default:
|
|
360
409
|
return Object.assign(o, {
|
|
361
|
-
text:
|
|
410
|
+
text: a
|
|
362
411
|
});
|
|
363
412
|
}
|
|
364
413
|
});
|
|
365
414
|
}
|
|
366
415
|
function de(e, t, n) {
|
|
367
416
|
for (const o of n)
|
|
368
|
-
for (const [
|
|
369
|
-
if (
|
|
417
|
+
for (const [a, i] of e.entries()) {
|
|
418
|
+
if (i.indices[0] > o.indices[0] || i.indices[1] < o.indices[1])
|
|
370
419
|
continue;
|
|
371
420
|
const s = [
|
|
372
421
|
{
|
|
@@ -374,79 +423,79 @@ function de(e, t, n) {
|
|
|
374
423
|
type: t
|
|
375
424
|
}
|
|
376
425
|
];
|
|
377
|
-
|
|
426
|
+
i.indices[0] < o.indices[0] && s.unshift({
|
|
378
427
|
indices: [
|
|
379
|
-
|
|
428
|
+
i.indices[0],
|
|
380
429
|
o.indices[0]
|
|
381
430
|
],
|
|
382
431
|
type: "text"
|
|
383
|
-
}),
|
|
432
|
+
}), i.indices[1] > o.indices[1] && s.push({
|
|
384
433
|
indices: [
|
|
385
434
|
o.indices[1],
|
|
386
|
-
|
|
435
|
+
i.indices[1]
|
|
387
436
|
],
|
|
388
437
|
type: "text"
|
|
389
|
-
}), e.splice(
|
|
438
|
+
}), e.splice(a, 1, ...s);
|
|
390
439
|
break;
|
|
391
440
|
}
|
|
392
441
|
}
|
|
393
|
-
function
|
|
442
|
+
function rr(e, t) {
|
|
394
443
|
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]);
|
|
395
444
|
const n = t.at(-1);
|
|
396
445
|
n && n.indices[1] > e.display_text_range[1] && (n.indices[1] = e.display_text_range[1]);
|
|
397
446
|
}
|
|
398
|
-
const
|
|
447
|
+
const or = (e) => ({
|
|
399
448
|
...e,
|
|
400
|
-
url:
|
|
449
|
+
url: at(e),
|
|
401
450
|
user: {
|
|
402
451
|
...e.user,
|
|
403
|
-
url:
|
|
404
|
-
follow_url:
|
|
452
|
+
url: bt(e),
|
|
453
|
+
follow_url: Jn(e)
|
|
405
454
|
},
|
|
406
|
-
like_url:
|
|
407
|
-
reply_url:
|
|
408
|
-
in_reply_to_url: e.in_reply_to_screen_name ?
|
|
455
|
+
like_url: Kn(e),
|
|
456
|
+
reply_url: Qn(e),
|
|
457
|
+
in_reply_to_url: e.in_reply_to_screen_name ? er(e) : void 0,
|
|
409
458
|
entities: st(e),
|
|
410
459
|
quoted_tweet: e.quoted_tweet ? {
|
|
411
460
|
...e.quoted_tweet,
|
|
412
|
-
url:
|
|
461
|
+
url: at(e.quoted_tweet),
|
|
413
462
|
entities: st(e.quoted_tweet)
|
|
414
463
|
} : void 0
|
|
415
|
-
}),
|
|
416
|
-
root:
|
|
417
|
-
rounded:
|
|
418
|
-
mediaWrapper:
|
|
419
|
-
grid2Columns:
|
|
420
|
-
grid3:
|
|
421
|
-
grid2x2:
|
|
422
|
-
mediaContainer:
|
|
423
|
-
mediaLink:
|
|
424
|
-
skeleton:
|
|
425
|
-
image:
|
|
426
|
-
},
|
|
427
|
-
anchor:
|
|
428
|
-
videoButton:
|
|
429
|
-
videoButtonIcon:
|
|
430
|
-
watchOnTwitter:
|
|
431
|
-
viewReplies:
|
|
432
|
-
},
|
|
433
|
-
const [n, o] = se(!0), [
|
|
464
|
+
}), ar = "_root_g9tkv_1", sr = "_rounded_g9tkv_6", ir = "_mediaWrapper_g9tkv_10", cr = "_grid2Columns_g9tkv_17", lr = "_grid3_g9tkv_20", dr = "_grid2x2_g9tkv_23", ur = "_mediaContainer_g9tkv_26", fr = "_mediaLink_g9tkv_34", hr = "_skeleton_g9tkv_38", _r = "_image_g9tkv_43", C = {
|
|
465
|
+
root: ar,
|
|
466
|
+
rounded: sr,
|
|
467
|
+
mediaWrapper: ir,
|
|
468
|
+
grid2Columns: cr,
|
|
469
|
+
grid3: lr,
|
|
470
|
+
grid2x2: dr,
|
|
471
|
+
mediaContainer: ur,
|
|
472
|
+
mediaLink: fr,
|
|
473
|
+
skeleton: hr,
|
|
474
|
+
image: _r
|
|
475
|
+
}, mr = "_anchor_fp31d_1", pr = "_videoButton_fp31d_17", vr = "_videoButtonIcon_fp31d_35", gr = "_watchOnTwitter_fp31d_44", wr = "_viewReplies_fp31d_60", ae = {
|
|
476
|
+
anchor: mr,
|
|
477
|
+
videoButton: pr,
|
|
478
|
+
videoButtonIcon: vr,
|
|
479
|
+
watchOnTwitter: gr,
|
|
480
|
+
viewReplies: wr
|
|
481
|
+
}, yr = ({ tweet: e, media: t }) => {
|
|
482
|
+
const [n, o] = se(!0), [a, i] = se(!1), [s, c] = se(!1), f = nr(t);
|
|
434
483
|
let d = 0;
|
|
435
|
-
return /* @__PURE__ */ h(
|
|
484
|
+
return /* @__PURE__ */ h(Pt, {
|
|
436
485
|
children: [
|
|
437
486
|
/* @__PURE__ */ r("video", {
|
|
438
487
|
className: C.image,
|
|
439
|
-
poster:
|
|
488
|
+
poster: Tt(t, "small"),
|
|
440
489
|
controls: !n,
|
|
441
490
|
playsInline: !0,
|
|
442
491
|
preload: "none",
|
|
443
492
|
tabIndex: n ? -1 : 0,
|
|
444
493
|
onPlay: () => {
|
|
445
|
-
d && window.clearTimeout(d),
|
|
494
|
+
d && window.clearTimeout(d), a || i(!0), s && c(!1);
|
|
446
495
|
},
|
|
447
496
|
onPause: () => {
|
|
448
497
|
d && window.clearTimeout(d), d = window.setTimeout(() => {
|
|
449
|
-
|
|
498
|
+
a && i(!1), d = 0;
|
|
450
499
|
}, 100);
|
|
451
500
|
},
|
|
452
501
|
onEnded: () => {
|
|
@@ -459,19 +508,19 @@ const Qn = (e) => ({
|
|
|
459
508
|
}),
|
|
460
509
|
n && /* @__PURE__ */ r("button", {
|
|
461
510
|
type: "button",
|
|
462
|
-
className:
|
|
511
|
+
className: ae.videoButton,
|
|
463
512
|
"aria-label": "View video on X",
|
|
464
513
|
onClick: (g) => {
|
|
465
514
|
const m = g.currentTarget.previousSibling;
|
|
466
515
|
g.preventDefault(), o(!1), m.load(), m.play().then(() => {
|
|
467
|
-
|
|
468
|
-
}).catch((
|
|
469
|
-
console.error("Error playing video:",
|
|
516
|
+
i(!0), m.focus();
|
|
517
|
+
}).catch((b) => {
|
|
518
|
+
console.error("Error playing video:", b), o(!0), i(!1);
|
|
470
519
|
});
|
|
471
520
|
},
|
|
472
521
|
children: /* @__PURE__ */ r("svg", {
|
|
473
522
|
viewBox: "0 0 24 24",
|
|
474
|
-
className:
|
|
523
|
+
className: ae.videoButtonIcon,
|
|
475
524
|
"aria-hidden": "true",
|
|
476
525
|
children: /* @__PURE__ */ r("g", {
|
|
477
526
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -480,11 +529,11 @@ const Qn = (e) => ({
|
|
|
480
529
|
})
|
|
481
530
|
})
|
|
482
531
|
}),
|
|
483
|
-
!
|
|
484
|
-
className:
|
|
532
|
+
!a && !s && /* @__PURE__ */ r("div", {
|
|
533
|
+
className: ae.watchOnTwitter,
|
|
485
534
|
children: /* @__PURE__ */ r("a", {
|
|
486
535
|
href: e.url,
|
|
487
|
-
className:
|
|
536
|
+
className: ae.anchor,
|
|
488
537
|
target: "_blank",
|
|
489
538
|
rel: "noopener noreferrer",
|
|
490
539
|
children: n ? "Watch on X" : "Continue watching on X"
|
|
@@ -492,31 +541,31 @@ const Qn = (e) => ({
|
|
|
492
541
|
}),
|
|
493
542
|
s && /* @__PURE__ */ r("a", {
|
|
494
543
|
href: e.url,
|
|
495
|
-
className: U(
|
|
544
|
+
className: U(ae.anchor, ae.viewReplies),
|
|
496
545
|
target: "_blank",
|
|
497
546
|
rel: "noopener noreferrer",
|
|
498
547
|
children: "View replies"
|
|
499
548
|
})
|
|
500
549
|
]
|
|
501
550
|
});
|
|
502
|
-
},
|
|
551
|
+
}, br = (e) => /* @__PURE__ */ r("img", {
|
|
503
552
|
...e
|
|
504
|
-
}),
|
|
553
|
+
}), it = (e, t) => {
|
|
505
554
|
let n = 56.25;
|
|
506
555
|
return t === 1 && (n = 100 / e.original_info.width * e.original_info.height), t === 2 && (n = n * 2), {
|
|
507
556
|
width: e.type === "photo" ? void 0 : "unset",
|
|
508
557
|
paddingBottom: `${n}%`
|
|
509
558
|
};
|
|
510
|
-
},
|
|
511
|
-
var o,
|
|
512
|
-
const s = (
|
|
559
|
+
}, xt = ({ tweet: e, components: t, quoted: n }) => {
|
|
560
|
+
var o, a, i;
|
|
561
|
+
const s = (i = (o = e.mediaDetails) == null ? void 0 : o.length) != null ? i : 0;
|
|
513
562
|
var c;
|
|
514
|
-
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c :
|
|
563
|
+
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c : br;
|
|
515
564
|
return /* @__PURE__ */ r("div", {
|
|
516
565
|
className: U(C.root, !n && C.rounded),
|
|
517
566
|
children: /* @__PURE__ */ r("div", {
|
|
518
567
|
className: U(C.mediaWrapper, s > 1 && C.grid2Columns, s === 3 && C.grid3, s > 4 && C.grid2x2),
|
|
519
|
-
children: (
|
|
568
|
+
children: (a = e.mediaDetails) == null ? void 0 : a.map((d) => /* @__PURE__ */ r(Ut, {
|
|
520
569
|
children: d.type === "photo" ? /* @__PURE__ */ h("a", {
|
|
521
570
|
href: e.url,
|
|
522
571
|
className: U(C.mediaContainer, C.mediaLink),
|
|
@@ -525,10 +574,10 @@ const Qn = (e) => ({
|
|
|
525
574
|
children: [
|
|
526
575
|
/* @__PURE__ */ r("div", {
|
|
527
576
|
className: C.skeleton,
|
|
528
|
-
style:
|
|
577
|
+
style: it(d, s)
|
|
529
578
|
}),
|
|
530
579
|
/* @__PURE__ */ r(f, {
|
|
531
|
-
src:
|
|
580
|
+
src: Tt(d, "small"),
|
|
532
581
|
alt: d.ext_alt_text || "Image",
|
|
533
582
|
className: C.image,
|
|
534
583
|
draggable: !0
|
|
@@ -539,9 +588,9 @@ const Qn = (e) => ({
|
|
|
539
588
|
children: [
|
|
540
589
|
/* @__PURE__ */ r("div", {
|
|
541
590
|
className: C.skeleton,
|
|
542
|
-
style:
|
|
591
|
+
style: it(d, s)
|
|
543
592
|
}),
|
|
544
|
-
/* @__PURE__ */ r(
|
|
593
|
+
/* @__PURE__ */ r(yr, {
|
|
545
594
|
tweet: e,
|
|
546
595
|
media: d
|
|
547
596
|
})
|
|
@@ -550,28 +599,12 @@ const Qn = (e) => ({
|
|
|
550
599
|
}, d.media_url_https))
|
|
551
600
|
})
|
|
552
601
|
});
|
|
553
|
-
},
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
weekday: "short",
|
|
558
|
-
month: "short",
|
|
559
|
-
day: "numeric",
|
|
560
|
-
year: "numeric"
|
|
561
|
-
}, mr = new Intl.DateTimeFormat("en-US", _r), pr = (e) => {
|
|
562
|
-
const t = {};
|
|
563
|
-
for (const n of e)
|
|
564
|
-
t[n.type] = n.value;
|
|
565
|
-
return t;
|
|
566
|
-
}, vr = (e) => {
|
|
567
|
-
const t = pr(mr.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
|
|
568
|
-
return `${n} · ${o}`;
|
|
569
|
-
}, gr = "_root_i24yn_1", wr = {
|
|
570
|
-
root: gr
|
|
571
|
-
}, yr = ({ tweet: e }) => {
|
|
572
|
-
const t = new Date(e.created_at), n = vr(t);
|
|
602
|
+
}, Tr = "_root_i24yn_1", xr = {
|
|
603
|
+
root: Tr
|
|
604
|
+
}, Nr = ({ tweet: e }) => {
|
|
605
|
+
const t = new Date(e.created_at), n = Xn(t);
|
|
573
606
|
return /* @__PURE__ */ r("a", {
|
|
574
|
-
className:
|
|
607
|
+
className: xr.root,
|
|
575
608
|
href: e.url,
|
|
576
609
|
target: "_blank",
|
|
577
610
|
rel: "noopener noreferrer",
|
|
@@ -581,14 +614,14 @@ const Qn = (e) => ({
|
|
|
581
614
|
children: n
|
|
582
615
|
})
|
|
583
616
|
});
|
|
584
|
-
},
|
|
585
|
-
info:
|
|
586
|
-
infoLink:
|
|
587
|
-
infoIcon:
|
|
588
|
-
},
|
|
617
|
+
}, Ir = "_info_19qcj_1", Rr = "_infoLink_19qcj_10", Sr = "_infoIcon_19qcj_30", Ne = {
|
|
618
|
+
info: Ir,
|
|
619
|
+
infoLink: Rr,
|
|
620
|
+
infoIcon: Sr
|
|
621
|
+
}, kr = ({ tweet: e }) => /* @__PURE__ */ h("div", {
|
|
589
622
|
className: Ne.info,
|
|
590
623
|
children: [
|
|
591
|
-
/* @__PURE__ */ r(
|
|
624
|
+
/* @__PURE__ */ r(Nr, {
|
|
592
625
|
tweet: e
|
|
593
626
|
}),
|
|
594
627
|
/* @__PURE__ */ r("a", {
|
|
@@ -609,44 +642,44 @@ const Qn = (e) => ({
|
|
|
609
642
|
})
|
|
610
643
|
})
|
|
611
644
|
]
|
|
612
|
-
}),
|
|
613
|
-
actions:
|
|
614
|
-
like:
|
|
615
|
-
reply:
|
|
616
|
-
copy:
|
|
617
|
-
likeIconWrapper:
|
|
618
|
-
likeCount:
|
|
619
|
-
replyIconWrapper:
|
|
620
|
-
copyIconWrapper:
|
|
621
|
-
likeIcon:
|
|
622
|
-
replyIcon:
|
|
623
|
-
copyIcon:
|
|
624
|
-
replyText:
|
|
625
|
-
copyText:
|
|
626
|
-
},
|
|
645
|
+
}), Er = "_actions_n2anf_1", Cr = "_like_n2anf_13", Or = "_reply_n2anf_14", Lr = "_copy_n2anf_15", $r = "_likeIconWrapper_n2anf_27", qr = "_likeCount_n2anf_30", Dr = "_replyIconWrapper_n2anf_35", Ar = "_copyIconWrapper_n2anf_36", Vr = "_likeIcon_n2anf_27", Mr = "_replyIcon_n2anf_35", jr = "_copyIcon_n2anf_36", Wr = "_replyText_n2anf_56", Br = "_copyText_n2anf_57", k = {
|
|
646
|
+
actions: Er,
|
|
647
|
+
like: Cr,
|
|
648
|
+
reply: Or,
|
|
649
|
+
copy: Lr,
|
|
650
|
+
likeIconWrapper: $r,
|
|
651
|
+
likeCount: qr,
|
|
652
|
+
replyIconWrapper: Dr,
|
|
653
|
+
copyIconWrapper: Ar,
|
|
654
|
+
likeIcon: Vr,
|
|
655
|
+
replyIcon: Mr,
|
|
656
|
+
copyIcon: jr,
|
|
657
|
+
replyText: Wr,
|
|
658
|
+
copyText: Br
|
|
659
|
+
}, Fr = ({ tweet: e }) => {
|
|
627
660
|
const [t, n] = se(!1), o = () => {
|
|
628
661
|
navigator.clipboard.writeText(e.url), n(!0);
|
|
629
662
|
};
|
|
630
663
|
return Fe(() => {
|
|
631
664
|
if (t) {
|
|
632
|
-
const
|
|
665
|
+
const a = setTimeout(() => {
|
|
633
666
|
n(!1);
|
|
634
667
|
}, 6e3);
|
|
635
|
-
return () => clearTimeout(
|
|
668
|
+
return () => clearTimeout(a);
|
|
636
669
|
}
|
|
637
670
|
}, [
|
|
638
671
|
t
|
|
639
672
|
]), /* @__PURE__ */ h("button", {
|
|
640
673
|
type: "button",
|
|
641
|
-
className:
|
|
674
|
+
className: k.copy,
|
|
642
675
|
"aria-label": "Copy link",
|
|
643
676
|
onClick: o,
|
|
644
677
|
children: [
|
|
645
678
|
/* @__PURE__ */ r("div", {
|
|
646
|
-
className:
|
|
679
|
+
className: k.copyIconWrapper,
|
|
647
680
|
children: t ? /* @__PURE__ */ r("svg", {
|
|
648
681
|
viewBox: "0 0 24 24",
|
|
649
|
-
className:
|
|
682
|
+
className: k.copyIcon,
|
|
650
683
|
"aria-hidden": "true",
|
|
651
684
|
children: /* @__PURE__ */ r("g", {
|
|
652
685
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -655,7 +688,7 @@ const Qn = (e) => ({
|
|
|
655
688
|
})
|
|
656
689
|
}) : /* @__PURE__ */ r("svg", {
|
|
657
690
|
viewBox: "0 0 24 24",
|
|
658
|
-
className:
|
|
691
|
+
className: k.copyIcon,
|
|
659
692
|
"aria-hidden": "true",
|
|
660
693
|
children: /* @__PURE__ */ r("g", {
|
|
661
694
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -665,28 +698,28 @@ const Qn = (e) => ({
|
|
|
665
698
|
})
|
|
666
699
|
}),
|
|
667
700
|
/* @__PURE__ */ r("span", {
|
|
668
|
-
className:
|
|
701
|
+
className: k.copyText,
|
|
669
702
|
children: t ? "Copied!" : "Copy link"
|
|
670
703
|
})
|
|
671
704
|
]
|
|
672
705
|
});
|
|
673
|
-
},
|
|
674
|
-
const t =
|
|
706
|
+
}, Pr = ({ tweet: e }) => {
|
|
707
|
+
const t = Le(e.favorite_count);
|
|
675
708
|
return /* @__PURE__ */ h("div", {
|
|
676
|
-
className:
|
|
709
|
+
className: k.actions,
|
|
677
710
|
children: [
|
|
678
711
|
/* @__PURE__ */ h("a", {
|
|
679
|
-
className:
|
|
712
|
+
className: k.like,
|
|
680
713
|
href: e.like_url,
|
|
681
714
|
target: "_blank",
|
|
682
715
|
rel: "noopener noreferrer",
|
|
683
716
|
"aria-label": `Like. This Tweet has ${t} likes`,
|
|
684
717
|
children: [
|
|
685
718
|
/* @__PURE__ */ r("div", {
|
|
686
|
-
className:
|
|
719
|
+
className: k.likeIconWrapper,
|
|
687
720
|
children: /* @__PURE__ */ r("svg", {
|
|
688
721
|
viewBox: "0 0 24 24",
|
|
689
|
-
className:
|
|
722
|
+
className: k.likeIcon,
|
|
690
723
|
"aria-hidden": "true",
|
|
691
724
|
children: /* @__PURE__ */ r("g", {
|
|
692
725
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -696,23 +729,23 @@ const Qn = (e) => ({
|
|
|
696
729
|
})
|
|
697
730
|
}),
|
|
698
731
|
/* @__PURE__ */ r("span", {
|
|
699
|
-
className:
|
|
732
|
+
className: k.likeCount,
|
|
700
733
|
children: t
|
|
701
734
|
})
|
|
702
735
|
]
|
|
703
736
|
}),
|
|
704
737
|
/* @__PURE__ */ h("a", {
|
|
705
|
-
className:
|
|
738
|
+
className: k.reply,
|
|
706
739
|
href: e.reply_url,
|
|
707
740
|
target: "_blank",
|
|
708
741
|
rel: "noopener noreferrer",
|
|
709
742
|
"aria-label": "Reply to this Tweet on Twitter",
|
|
710
743
|
children: [
|
|
711
744
|
/* @__PURE__ */ r("div", {
|
|
712
|
-
className:
|
|
745
|
+
className: k.replyIconWrapper,
|
|
713
746
|
children: /* @__PURE__ */ r("svg", {
|
|
714
747
|
viewBox: "0 0 24 24",
|
|
715
|
-
className:
|
|
748
|
+
className: k.replyIcon,
|
|
716
749
|
"aria-hidden": "true",
|
|
717
750
|
children: /* @__PURE__ */ r("g", {
|
|
718
751
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -722,36 +755,36 @@ const Qn = (e) => ({
|
|
|
722
755
|
})
|
|
723
756
|
}),
|
|
724
757
|
/* @__PURE__ */ r("span", {
|
|
725
|
-
className:
|
|
758
|
+
className: k.replyText,
|
|
726
759
|
children: "Reply"
|
|
727
760
|
})
|
|
728
761
|
]
|
|
729
762
|
}),
|
|
730
|
-
/* @__PURE__ */ r(
|
|
763
|
+
/* @__PURE__ */ r(Fr, {
|
|
731
764
|
tweet: e
|
|
732
765
|
})
|
|
733
766
|
]
|
|
734
767
|
});
|
|
735
|
-
},
|
|
736
|
-
replies:
|
|
737
|
-
link:
|
|
738
|
-
text:
|
|
739
|
-
},
|
|
740
|
-
className:
|
|
768
|
+
}, Ur = "_replies_1cutb_1", zr = "_link_1cutb_4", Hr = "_text_1cutb_23", Ie = {
|
|
769
|
+
replies: Ur,
|
|
770
|
+
link: zr,
|
|
771
|
+
text: Hr
|
|
772
|
+
}, Gr = ({ tweet: e }) => /* @__PURE__ */ r("div", {
|
|
773
|
+
className: Ie.replies,
|
|
741
774
|
children: /* @__PURE__ */ r("a", {
|
|
742
|
-
className:
|
|
775
|
+
className: Ie.link,
|
|
743
776
|
href: e.url,
|
|
744
777
|
target: "_blank",
|
|
745
778
|
rel: "noopener noreferrer",
|
|
746
779
|
children: /* @__PURE__ */ r("span", {
|
|
747
|
-
className:
|
|
748
|
-
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${
|
|
780
|
+
className: Ie.text,
|
|
781
|
+
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${Le(e.conversation_count)} reply` : `Read ${Le(e.conversation_count)} replies`
|
|
749
782
|
})
|
|
750
783
|
})
|
|
751
|
-
}),
|
|
752
|
-
root:
|
|
753
|
-
article:
|
|
754
|
-
},
|
|
784
|
+
}), Xr = "_root_q5799_1", Kr = "_article_q5799_16", ct = {
|
|
785
|
+
root: Xr,
|
|
786
|
+
article: Kr
|
|
787
|
+
}, Qr = ({ tweet: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
755
788
|
className: ct.root,
|
|
756
789
|
onClick: (n) => {
|
|
757
790
|
n.preventDefault(), window.open(e.url, "_blank");
|
|
@@ -760,15 +793,18 @@ const Qn = (e) => ({
|
|
|
760
793
|
className: ct.article,
|
|
761
794
|
children: t
|
|
762
795
|
})
|
|
763
|
-
}),
|
|
764
|
-
header:
|
|
765
|
-
avatar:
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
796
|
+
}), Jr = "_header_f00ab_1", Yr = "_avatar_f00ab_11", Zr = "_avatarOverflow_f00ab_16", eo = "_avatarSquare_f00ab_23", to = "_author_f00ab_27", no = "_authorText_f00ab_33", ro = "_username_f00ab_40", Q = {
|
|
797
|
+
header: Jr,
|
|
798
|
+
avatar: Yr,
|
|
799
|
+
avatarOverflow: Zr,
|
|
800
|
+
avatarSquare: eo,
|
|
801
|
+
author: to,
|
|
802
|
+
authorText: no,
|
|
803
|
+
username: ro
|
|
804
|
+
}, oo = ({ tweet: e, components: t }) => {
|
|
805
|
+
const { user: n } = e;
|
|
806
|
+
var o;
|
|
807
|
+
const a = (o = t == null ? void 0 : t.AvatarImg) != null ? o : vt;
|
|
772
808
|
return /* @__PURE__ */ h("div", {
|
|
773
809
|
className: Q.header,
|
|
774
810
|
children: [
|
|
@@ -778,10 +814,10 @@ const Qn = (e) => ({
|
|
|
778
814
|
target: "_blank",
|
|
779
815
|
rel: "noopener noreferrer",
|
|
780
816
|
children: /* @__PURE__ */ r("div", {
|
|
781
|
-
className: U(Q.avatarOverflow,
|
|
782
|
-
children: /* @__PURE__ */ r(
|
|
783
|
-
src:
|
|
784
|
-
alt:
|
|
817
|
+
className: U(Q.avatarOverflow, n.profile_image_shape === "Square" && Q.avatarSquare),
|
|
818
|
+
children: /* @__PURE__ */ r(a, {
|
|
819
|
+
src: n.profile_image_url_https,
|
|
820
|
+
alt: n.name,
|
|
785
821
|
width: 20,
|
|
786
822
|
height: 20
|
|
787
823
|
})
|
|
@@ -793,20 +829,23 @@ const Qn = (e) => ({
|
|
|
793
829
|
/* @__PURE__ */ r("div", {
|
|
794
830
|
className: Q.authorText,
|
|
795
831
|
children: /* @__PURE__ */ r("span", {
|
|
796
|
-
title:
|
|
797
|
-
children:
|
|
832
|
+
title: n.name,
|
|
833
|
+
children: n.name
|
|
798
834
|
})
|
|
799
835
|
}),
|
|
800
836
|
/* @__PURE__ */ r(gt, {
|
|
801
|
-
user:
|
|
837
|
+
user: n
|
|
838
|
+
}),
|
|
839
|
+
/* @__PURE__ */ r(wt, {
|
|
840
|
+
user: n
|
|
802
841
|
}),
|
|
803
842
|
/* @__PURE__ */ r("div", {
|
|
804
843
|
className: Q.username,
|
|
805
844
|
children: /* @__PURE__ */ h("span", {
|
|
806
|
-
title: `@${
|
|
845
|
+
title: `@${n.screen_name}`,
|
|
807
846
|
children: [
|
|
808
847
|
"@",
|
|
809
|
-
|
|
848
|
+
n.screen_name
|
|
810
849
|
]
|
|
811
850
|
})
|
|
812
851
|
})
|
|
@@ -814,10 +853,10 @@ const Qn = (e) => ({
|
|
|
814
853
|
})
|
|
815
854
|
]
|
|
816
855
|
});
|
|
817
|
-
},
|
|
818
|
-
root:
|
|
819
|
-
},
|
|
820
|
-
className:
|
|
856
|
+
}, ao = "_root_175ot_1", so = {
|
|
857
|
+
root: ao
|
|
858
|
+
}, io = ({ tweet: e }) => /* @__PURE__ */ r("p", {
|
|
859
|
+
className: so.root,
|
|
821
860
|
lang: e.lang,
|
|
822
861
|
dir: "auto",
|
|
823
862
|
children: e.entities.map((t, n) => /* @__PURE__ */ r("span", {
|
|
@@ -825,63 +864,65 @@ const Qn = (e) => ({
|
|
|
825
864
|
__html: t.text
|
|
826
865
|
}
|
|
827
866
|
}, n))
|
|
828
|
-
}),
|
|
829
|
-
var
|
|
830
|
-
return /* @__PURE__ */ h(
|
|
867
|
+
}), co = ({ tweet: e, components: t }) => {
|
|
868
|
+
var n;
|
|
869
|
+
return /* @__PURE__ */ h(Qr, {
|
|
831
870
|
tweet: e,
|
|
832
871
|
children: [
|
|
833
|
-
/* @__PURE__ */ r(
|
|
834
|
-
tweet: e
|
|
872
|
+
/* @__PURE__ */ r(oo, {
|
|
873
|
+
tweet: e,
|
|
874
|
+
components: t
|
|
835
875
|
}),
|
|
836
|
-
/* @__PURE__ */ r(
|
|
876
|
+
/* @__PURE__ */ r(io, {
|
|
837
877
|
tweet: e
|
|
838
878
|
}),
|
|
839
|
-
(
|
|
879
|
+
(n = e.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
|
|
840
880
|
quoted: !0,
|
|
841
881
|
tweet: e
|
|
842
882
|
}) : null
|
|
843
883
|
]
|
|
844
884
|
});
|
|
845
|
-
},
|
|
885
|
+
}, lo = ({ tweet: e, components: t }) => {
|
|
846
886
|
var n;
|
|
847
|
-
const o = Pe(() =>
|
|
887
|
+
const o = Pe(() => or(e), [
|
|
848
888
|
e
|
|
849
889
|
]);
|
|
850
890
|
return /* @__PURE__ */ h(ze, {
|
|
851
891
|
children: [
|
|
852
|
-
/* @__PURE__ */ r(
|
|
892
|
+
/* @__PURE__ */ r(Dn, {
|
|
853
893
|
tweet: o,
|
|
854
894
|
components: t
|
|
855
895
|
}),
|
|
856
|
-
o.in_reply_to_status_id_str && /* @__PURE__ */ r(
|
|
896
|
+
o.in_reply_to_status_id_str && /* @__PURE__ */ r(Mn, {
|
|
857
897
|
tweet: o
|
|
858
898
|
}),
|
|
859
|
-
/* @__PURE__ */ r(
|
|
899
|
+
/* @__PURE__ */ r(Pn, {
|
|
860
900
|
tweet: o
|
|
861
901
|
}),
|
|
862
|
-
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(
|
|
902
|
+
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
|
|
863
903
|
tweet: o,
|
|
864
904
|
components: t
|
|
865
905
|
}) : null,
|
|
866
|
-
o.quoted_tweet && /* @__PURE__ */ r(
|
|
867
|
-
tweet: o.quoted_tweet
|
|
906
|
+
o.quoted_tweet && /* @__PURE__ */ r(co, {
|
|
907
|
+
tweet: o.quoted_tweet,
|
|
908
|
+
components: t
|
|
868
909
|
}),
|
|
869
|
-
/* @__PURE__ */ r(
|
|
910
|
+
/* @__PURE__ */ r(kr, {
|
|
870
911
|
tweet: o
|
|
871
912
|
}),
|
|
872
|
-
/* @__PURE__ */ r(
|
|
913
|
+
/* @__PURE__ */ r(Pr, {
|
|
873
914
|
tweet: o
|
|
874
915
|
}),
|
|
875
|
-
/* @__PURE__ */ r(
|
|
916
|
+
/* @__PURE__ */ r(Gr, {
|
|
876
917
|
tweet: o
|
|
877
918
|
})
|
|
878
919
|
]
|
|
879
920
|
});
|
|
880
|
-
},
|
|
881
|
-
root:
|
|
882
|
-
},
|
|
921
|
+
}, uo = "_root_16yxa_1", fo = {
|
|
922
|
+
root: uo
|
|
923
|
+
}, ho = (e) => /* @__PURE__ */ r(ze, {
|
|
883
924
|
children: /* @__PURE__ */ h("div", {
|
|
884
|
-
className:
|
|
925
|
+
className: fo.root,
|
|
885
926
|
children: [
|
|
886
927
|
/* @__PURE__ */ r("h3", {
|
|
887
928
|
children: "Tweet not found"
|
|
@@ -891,15 +932,15 @@ const Qn = (e) => ({
|
|
|
891
932
|
})
|
|
892
933
|
]
|
|
893
934
|
})
|
|
894
|
-
}),
|
|
895
|
-
skeleton:
|
|
935
|
+
}), _o = "_skeleton_oi7hr_1", mo = {
|
|
936
|
+
skeleton: _o
|
|
896
937
|
}, pe = ({ style: e }) => /* @__PURE__ */ r("span", {
|
|
897
|
-
className:
|
|
938
|
+
className: mo.skeleton,
|
|
898
939
|
style: e
|
|
899
|
-
}),
|
|
900
|
-
root:
|
|
901
|
-
},
|
|
902
|
-
className:
|
|
940
|
+
}), po = "_root_17qqv_1", vo = {
|
|
941
|
+
root: po
|
|
942
|
+
}, go = () => /* @__PURE__ */ h(ze, {
|
|
943
|
+
className: vo.root,
|
|
903
944
|
children: [
|
|
904
945
|
/* @__PURE__ */ r(pe, {
|
|
905
946
|
style: {
|
|
@@ -932,9 +973,9 @@ const Qn = (e) => ({
|
|
|
932
973
|
}
|
|
933
974
|
})
|
|
934
975
|
]
|
|
935
|
-
}),
|
|
976
|
+
}), Nt = 0, It = 1, Rt = 2, lt = 3;
|
|
936
977
|
var dt = Object.prototype.hasOwnProperty;
|
|
937
|
-
function
|
|
978
|
+
function $e(e, t) {
|
|
938
979
|
var n, o;
|
|
939
980
|
if (e === t) return !0;
|
|
940
981
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
@@ -942,56 +983,56 @@ function qe(e, t) {
|
|
|
942
983
|
if (n === RegExp) return e.toString() === t.toString();
|
|
943
984
|
if (n === Array) {
|
|
944
985
|
if ((o = e.length) === t.length)
|
|
945
|
-
for (; o-- &&
|
|
986
|
+
for (; o-- && $e(e[o], t[o]); ) ;
|
|
946
987
|
return o === -1;
|
|
947
988
|
}
|
|
948
989
|
if (!n || typeof e == "object") {
|
|
949
990
|
o = 0;
|
|
950
991
|
for (n in e)
|
|
951
|
-
if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) ||
|
|
992
|
+
if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) || !$e(e[n], t[n])) return !1;
|
|
952
993
|
return Object.keys(t).length === o;
|
|
953
994
|
}
|
|
954
995
|
}
|
|
955
996
|
return e !== e && t !== t;
|
|
956
997
|
}
|
|
957
998
|
const F = /* @__PURE__ */ new WeakMap(), P = () => {
|
|
958
|
-
},
|
|
999
|
+
}, R = (
|
|
959
1000
|
/*#__NOINLINE__*/
|
|
960
1001
|
P()
|
|
961
|
-
),
|
|
1002
|
+
), qe = Object, u = (e) => e === R, j = (e) => typeof e == "function", z = (e, t) => ({
|
|
962
1003
|
...e,
|
|
963
1004
|
...t
|
|
964
|
-
}),
|
|
1005
|
+
}), St = (e) => j(e.then), Re = {}, ve = {}, He = "undefined", ue = typeof window != He, De = typeof document != He, wo = ue && "Deno" in window, yo = () => ue && typeof window.requestAnimationFrame != He, kt = (e, t) => {
|
|
965
1006
|
const n = F.get(e);
|
|
966
1007
|
return [
|
|
967
1008
|
// Getter
|
|
968
|
-
() => !u(t) && e.get(t) ||
|
|
1009
|
+
() => !u(t) && e.get(t) || Re,
|
|
969
1010
|
// Setter
|
|
970
1011
|
(o) => {
|
|
971
1012
|
if (!u(t)) {
|
|
972
|
-
const
|
|
973
|
-
t in ve || (ve[t] =
|
|
1013
|
+
const a = e.get(t);
|
|
1014
|
+
t in ve || (ve[t] = a), n[5](t, z(a, o), a || Re);
|
|
974
1015
|
}
|
|
975
1016
|
},
|
|
976
1017
|
// Subscriber
|
|
977
1018
|
n[6],
|
|
978
1019
|
// Get server cache snapshot
|
|
979
|
-
() => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) ||
|
|
1020
|
+
() => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) || Re
|
|
980
1021
|
];
|
|
981
1022
|
};
|
|
982
1023
|
let Ae = !0;
|
|
983
|
-
const
|
|
1024
|
+
const bo = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
|
|
984
1025
|
window.addEventListener.bind(window),
|
|
985
1026
|
window.removeEventListener.bind(window)
|
|
986
1027
|
] : [
|
|
987
1028
|
P,
|
|
988
1029
|
P
|
|
989
|
-
],
|
|
990
|
-
const e =
|
|
1030
|
+
], To = () => {
|
|
1031
|
+
const e = De && document.visibilityState;
|
|
991
1032
|
return u(e) || e !== "hidden";
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
}),
|
|
1033
|
+
}, xo = (e) => (De && document.addEventListener("visibilitychange", e), Ve("focus", e), () => {
|
|
1034
|
+
De && document.removeEventListener("visibilitychange", e), Me("focus", e);
|
|
1035
|
+
}), No = (e) => {
|
|
995
1036
|
const t = () => {
|
|
996
1037
|
Ae = !0, e();
|
|
997
1038
|
}, n = () => {
|
|
@@ -1000,30 +1041,30 @@ const po = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
|
|
|
1000
1041
|
return Ve("online", t), Ve("offline", n), () => {
|
|
1001
1042
|
Me("online", t), Me("offline", n);
|
|
1002
1043
|
};
|
|
1003
|
-
},
|
|
1004
|
-
isOnline:
|
|
1005
|
-
isVisible:
|
|
1006
|
-
},
|
|
1007
|
-
initFocus:
|
|
1008
|
-
initReconnect:
|
|
1009
|
-
}, ut = !Be.useId,
|
|
1044
|
+
}, Io = {
|
|
1045
|
+
isOnline: bo,
|
|
1046
|
+
isVisible: To
|
|
1047
|
+
}, Ro = {
|
|
1048
|
+
initFocus: xo,
|
|
1049
|
+
initReconnect: No
|
|
1050
|
+
}, ut = !Be.useId, ie = !ue || wo, So = (e) => yo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Se = ie ? Fe : Ht, ke = typeof navigator < "u" && navigator.connection, ft = !ie && ke && ([
|
|
1010
1051
|
"slow-2g",
|
|
1011
1052
|
"2g"
|
|
1012
|
-
].includes(
|
|
1013
|
-
let
|
|
1053
|
+
].includes(ke.effectiveType) || ke.saveData), ge = /* @__PURE__ */ new WeakMap(), ko = (e) => qe.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
|
|
1054
|
+
let Eo = 0;
|
|
1014
1055
|
const je = (e) => {
|
|
1015
|
-
const t = typeof e, n =
|
|
1056
|
+
const t = typeof e, n = ko(e), o = Ee(n, "Date"), a = Ee(n, "RegExp"), i = Ee(n, "Object");
|
|
1016
1057
|
let s, c;
|
|
1017
|
-
if (
|
|
1058
|
+
if (qe(e) === e && !o && !a) {
|
|
1018
1059
|
if (s = ge.get(e), s) return s;
|
|
1019
|
-
if (s = ++
|
|
1060
|
+
if (s = ++Eo + "~", ge.set(e, s), Array.isArray(e)) {
|
|
1020
1061
|
for (s = "@", c = 0; c < e.length; c++)
|
|
1021
1062
|
s += je(e[c]) + ",";
|
|
1022
1063
|
ge.set(e, s);
|
|
1023
1064
|
}
|
|
1024
|
-
if (
|
|
1065
|
+
if (i) {
|
|
1025
1066
|
s = "#";
|
|
1026
|
-
const f =
|
|
1067
|
+
const f = qe.keys(e).sort();
|
|
1027
1068
|
for (; !u(c = f.pop()); )
|
|
1028
1069
|
u(e[c]) || (s += c + ":" + je(e[c]) + ",");
|
|
1029
1070
|
ge.set(e, s);
|
|
@@ -1044,140 +1085,140 @@ const je = (e) => {
|
|
|
1044
1085
|
t
|
|
1045
1086
|
];
|
|
1046
1087
|
};
|
|
1047
|
-
let
|
|
1048
|
-
const We = () => ++
|
|
1049
|
-
async function
|
|
1050
|
-
const [t, n, o,
|
|
1088
|
+
let Co = 0;
|
|
1089
|
+
const We = () => ++Co;
|
|
1090
|
+
async function Et(...e) {
|
|
1091
|
+
const [t, n, o, a] = e, i = z({
|
|
1051
1092
|
populateCache: !0,
|
|
1052
1093
|
throwOnError: !0
|
|
1053
|
-
}, typeof
|
|
1054
|
-
revalidate:
|
|
1055
|
-
} :
|
|
1056
|
-
let s =
|
|
1057
|
-
const c =
|
|
1058
|
-
let f =
|
|
1059
|
-
const d = (
|
|
1094
|
+
}, typeof a == "boolean" ? {
|
|
1095
|
+
revalidate: a
|
|
1096
|
+
} : a || {});
|
|
1097
|
+
let s = i.populateCache;
|
|
1098
|
+
const c = i.rollbackOnError;
|
|
1099
|
+
let f = i.optimisticData;
|
|
1100
|
+
const d = (b) => typeof c == "function" ? c(b) : c !== !1, g = i.throwOnError;
|
|
1060
1101
|
if (j(n)) {
|
|
1061
|
-
const
|
|
1062
|
-
for (const
|
|
1102
|
+
const b = n, I = [], E = t.keys();
|
|
1103
|
+
for (const L of E)
|
|
1063
1104
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
1064
|
-
!/^\$(inf|sub)\$/.test(
|
|
1065
|
-
return Promise.all(
|
|
1105
|
+
!/^\$(inf|sub)\$/.test(L) && b(t.get(L)._k) && I.push(L);
|
|
1106
|
+
return Promise.all(I.map(m));
|
|
1066
1107
|
}
|
|
1067
1108
|
return m(n);
|
|
1068
|
-
async function m(
|
|
1069
|
-
const [
|
|
1070
|
-
if (!
|
|
1071
|
-
const [E,
|
|
1072
|
-
const
|
|
1073
|
-
return (j(
|
|
1109
|
+
async function m(b) {
|
|
1110
|
+
const [I] = Ge(b);
|
|
1111
|
+
if (!I) return;
|
|
1112
|
+
const [E, L] = kt(t, I), [D, ce, l, fe] = F.get(t), J = () => {
|
|
1113
|
+
const $ = D[I];
|
|
1114
|
+
return (j(i.revalidate) ? i.revalidate(E().data, b) : i.revalidate !== !1) && (delete l[I], delete fe[I], $ && $[0]) ? $[0](Rt).then(() => E().data) : E().data;
|
|
1074
1115
|
};
|
|
1075
1116
|
if (e.length < 3)
|
|
1076
1117
|
return J();
|
|
1077
|
-
let
|
|
1118
|
+
let T = o, A, V = !1;
|
|
1078
1119
|
const Y = We();
|
|
1079
|
-
ce[
|
|
1120
|
+
ce[I] = [
|
|
1080
1121
|
Y,
|
|
1081
1122
|
0
|
|
1082
1123
|
];
|
|
1083
1124
|
const p = !u(f), Z = E(), M = Z.data, ee = Z._c, H = u(ee) ? M : ee;
|
|
1084
|
-
if (p && (f = j(f) ? f(H, M) : f,
|
|
1125
|
+
if (p && (f = j(f) ? f(H, M) : f, L({
|
|
1085
1126
|
data: f,
|
|
1086
1127
|
_c: H
|
|
1087
|
-
})), j(
|
|
1128
|
+
})), j(T))
|
|
1088
1129
|
try {
|
|
1089
|
-
|
|
1090
|
-
} catch (
|
|
1091
|
-
A =
|
|
1130
|
+
T = T(H);
|
|
1131
|
+
} catch ($) {
|
|
1132
|
+
A = $, V = !0;
|
|
1092
1133
|
}
|
|
1093
|
-
if (
|
|
1094
|
-
if (
|
|
1095
|
-
A =
|
|
1096
|
-
}), Y !== ce[
|
|
1134
|
+
if (T && St(T))
|
|
1135
|
+
if (T = await T.catch(($) => {
|
|
1136
|
+
A = $, V = !0;
|
|
1137
|
+
}), Y !== ce[I][0]) {
|
|
1097
1138
|
if (V) throw A;
|
|
1098
|
-
return
|
|
1099
|
-
} else V && p && d(A) && (s = !0,
|
|
1139
|
+
return T;
|
|
1140
|
+
} else V && p && d(A) && (s = !0, L({
|
|
1100
1141
|
data: H,
|
|
1101
|
-
_c:
|
|
1142
|
+
_c: R
|
|
1102
1143
|
}));
|
|
1103
1144
|
if (s && !V)
|
|
1104
1145
|
if (j(s)) {
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
data:
|
|
1108
|
-
error:
|
|
1109
|
-
_c:
|
|
1146
|
+
const $ = s(T, H);
|
|
1147
|
+
L({
|
|
1148
|
+
data: $,
|
|
1149
|
+
error: R,
|
|
1150
|
+
_c: R
|
|
1110
1151
|
});
|
|
1111
1152
|
} else
|
|
1112
|
-
|
|
1113
|
-
data:
|
|
1114
|
-
error:
|
|
1115
|
-
_c:
|
|
1153
|
+
L({
|
|
1154
|
+
data: T,
|
|
1155
|
+
error: R,
|
|
1156
|
+
_c: R
|
|
1116
1157
|
});
|
|
1117
|
-
if (ce[
|
|
1118
|
-
|
|
1119
|
-
_c:
|
|
1158
|
+
if (ce[I][1] = We(), Promise.resolve(J()).then(() => {
|
|
1159
|
+
L({
|
|
1160
|
+
_c: R
|
|
1120
1161
|
});
|
|
1121
1162
|
}), V) {
|
|
1122
1163
|
if (g) throw A;
|
|
1123
1164
|
return;
|
|
1124
1165
|
}
|
|
1125
|
-
return
|
|
1166
|
+
return T;
|
|
1126
1167
|
}
|
|
1127
1168
|
}
|
|
1128
1169
|
const ht = (e, t) => {
|
|
1129
1170
|
for (const n in e)
|
|
1130
1171
|
e[n][0] && e[n][0](t);
|
|
1131
|
-
},
|
|
1172
|
+
}, Oo = (e, t) => {
|
|
1132
1173
|
if (!F.has(e)) {
|
|
1133
|
-
const n = z(
|
|
1134
|
-
let
|
|
1174
|
+
const n = z(Ro, t), o = /* @__PURE__ */ Object.create(null), a = Et.bind(R, e);
|
|
1175
|
+
let i = P;
|
|
1135
1176
|
const s = /* @__PURE__ */ Object.create(null), c = (g, m) => {
|
|
1136
|
-
const
|
|
1137
|
-
return s[g] =
|
|
1138
|
-
}, f = (g, m,
|
|
1177
|
+
const b = s[g] || [];
|
|
1178
|
+
return s[g] = b, b.push(m), () => b.splice(b.indexOf(m), 1);
|
|
1179
|
+
}, f = (g, m, b) => {
|
|
1139
1180
|
e.set(g, m);
|
|
1140
|
-
const
|
|
1141
|
-
if (
|
|
1142
|
-
for (const E of
|
|
1143
|
-
E(m,
|
|
1181
|
+
const I = s[g];
|
|
1182
|
+
if (I)
|
|
1183
|
+
for (const E of I)
|
|
1184
|
+
E(m, b);
|
|
1144
1185
|
}, d = () => {
|
|
1145
1186
|
if (!F.has(e) && (F.set(e, [
|
|
1146
1187
|
o,
|
|
1147
1188
|
/* @__PURE__ */ Object.create(null),
|
|
1148
1189
|
/* @__PURE__ */ Object.create(null),
|
|
1149
1190
|
/* @__PURE__ */ Object.create(null),
|
|
1150
|
-
|
|
1191
|
+
a,
|
|
1151
1192
|
f,
|
|
1152
1193
|
c
|
|
1153
|
-
]), !
|
|
1154
|
-
const g = n.initFocus(setTimeout.bind(
|
|
1155
|
-
|
|
1194
|
+
]), !ie)) {
|
|
1195
|
+
const g = n.initFocus(setTimeout.bind(R, ht.bind(R, o, Nt))), m = n.initReconnect(setTimeout.bind(R, ht.bind(R, o, It)));
|
|
1196
|
+
i = () => {
|
|
1156
1197
|
g && g(), m && m(), F.delete(e);
|
|
1157
1198
|
};
|
|
1158
1199
|
}
|
|
1159
1200
|
};
|
|
1160
1201
|
return d(), [
|
|
1161
1202
|
e,
|
|
1162
|
-
|
|
1203
|
+
a,
|
|
1163
1204
|
d,
|
|
1164
|
-
|
|
1205
|
+
i
|
|
1165
1206
|
];
|
|
1166
1207
|
}
|
|
1167
1208
|
return [
|
|
1168
1209
|
e,
|
|
1169
1210
|
F.get(e)[4]
|
|
1170
1211
|
];
|
|
1171
|
-
},
|
|
1172
|
-
const
|
|
1173
|
-
!u(
|
|
1174
|
-
},
|
|
1212
|
+
}, Lo = (e, t, n, o, a) => {
|
|
1213
|
+
const i = n.errorRetryCount, s = a.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
|
|
1214
|
+
!u(i) && s > i || setTimeout(o, c, a);
|
|
1215
|
+
}, $o = $e, [Ct, qo] = Oo(/* @__PURE__ */ new Map()), Do = z(
|
|
1175
1216
|
{
|
|
1176
1217
|
// events
|
|
1177
1218
|
onLoadingSlow: P,
|
|
1178
1219
|
onSuccess: P,
|
|
1179
1220
|
onError: P,
|
|
1180
|
-
onErrorRetry:
|
|
1221
|
+
onErrorRetry: Lo,
|
|
1181
1222
|
onDiscarded: P,
|
|
1182
1223
|
// switches
|
|
1183
1224
|
revalidateOnFocus: !0,
|
|
@@ -1190,24 +1231,24 @@ const ht = (e, t) => {
|
|
|
1190
1231
|
dedupingInterval: 2 * 1e3,
|
|
1191
1232
|
loadingTimeout: ft ? 5e3 : 3e3,
|
|
1192
1233
|
// providers
|
|
1193
|
-
compare:
|
|
1234
|
+
compare: $o,
|
|
1194
1235
|
isPaused: () => !1,
|
|
1195
|
-
cache:
|
|
1196
|
-
mutate:
|
|
1236
|
+
cache: Ct,
|
|
1237
|
+
mutate: qo,
|
|
1197
1238
|
fallback: {}
|
|
1198
1239
|
},
|
|
1199
1240
|
// use web preset by default
|
|
1200
|
-
|
|
1201
|
-
),
|
|
1241
|
+
Io
|
|
1242
|
+
), Ao = (e, t) => {
|
|
1202
1243
|
const n = z(e, t);
|
|
1203
1244
|
if (t) {
|
|
1204
|
-
const { use: o, fallback:
|
|
1205
|
-
o &&
|
|
1245
|
+
const { use: o, fallback: a } = e, { use: i, fallback: s } = t;
|
|
1246
|
+
o && i && (n.use = o.concat(i)), a && s && (n.fallback = z(a, s));
|
|
1206
1247
|
}
|
|
1207
1248
|
return n;
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1210
|
-
},
|
|
1249
|
+
}, Vo = zt({}), Mo = "$inf$", Ot = ue && window.__SWR_DEVTOOLS_USE__, jo = Ot ? window.__SWR_DEVTOOLS_USE__ : [], Wo = () => {
|
|
1250
|
+
Ot && (window.__SWR_DEVTOOLS_REACT__ = Be);
|
|
1251
|
+
}, Bo = (e) => j(e[1]) ? [
|
|
1211
1252
|
e[0],
|
|
1212
1253
|
e[1],
|
|
1213
1254
|
e[2] || {}
|
|
@@ -1215,32 +1256,32 @@ const ht = (e, t) => {
|
|
|
1215
1256
|
e[0],
|
|
1216
1257
|
null,
|
|
1217
1258
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
1218
|
-
],
|
|
1219
|
-
const e =
|
|
1220
|
-
return Pe(() => z(
|
|
1259
|
+
], Fo = () => {
|
|
1260
|
+
const e = Gt(Vo);
|
|
1261
|
+
return Pe(() => z(Do, e), [
|
|
1221
1262
|
e
|
|
1222
1263
|
]);
|
|
1223
|
-
},
|
|
1224
|
-
const [s] = Ge(t), [, , , c] = F.get(
|
|
1225
|
-
if (s.startsWith(
|
|
1226
|
-
return n(...
|
|
1264
|
+
}, Po = (e) => (t, n, o) => e(t, n && ((...i) => {
|
|
1265
|
+
const [s] = Ge(t), [, , , c] = F.get(Ct);
|
|
1266
|
+
if (s.startsWith(Mo))
|
|
1267
|
+
return n(...i);
|
|
1227
1268
|
const f = c[s];
|
|
1228
|
-
return u(f) ? n(...
|
|
1229
|
-
}), o),
|
|
1230
|
-
const o =
|
|
1269
|
+
return u(f) ? n(...i) : (delete c[s], f);
|
|
1270
|
+
}), o), Uo = jo.concat(Po), zo = (e) => function(...n) {
|
|
1271
|
+
const o = Fo(), [a, i, s] = Bo(n), c = Ao(o, s);
|
|
1231
1272
|
let f = e;
|
|
1232
|
-
const { use: d } = c, g = (d || []).concat(
|
|
1273
|
+
const { use: d } = c, g = (d || []).concat(Uo);
|
|
1233
1274
|
for (let m = g.length; m--; )
|
|
1234
1275
|
f = g[m](f);
|
|
1235
|
-
return f(
|
|
1236
|
-
},
|
|
1276
|
+
return f(a, i || c.fetcher || null, c);
|
|
1277
|
+
}, Ho = (e, t, n) => {
|
|
1237
1278
|
const o = t[e] || (t[e] = []);
|
|
1238
1279
|
return o.push(n), () => {
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1280
|
+
const a = o.indexOf(n);
|
|
1281
|
+
a >= 0 && (o[a] = o[o.length - 1], o.pop());
|
|
1241
1282
|
};
|
|
1242
1283
|
};
|
|
1243
|
-
|
|
1284
|
+
Wo();
|
|
1244
1285
|
const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
1245
1286
|
// and emitting an error.
|
|
1246
1287
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
@@ -1260,40 +1301,40 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1260
1301
|
e.status = "rejected", e.reason = t;
|
|
1261
1302
|
}), e;
|
|
1262
1303
|
}
|
|
1263
|
-
}),
|
|
1304
|
+
}), Oe = {
|
|
1264
1305
|
dedupe: !0
|
|
1265
|
-
}, _t = Promise.resolve(
|
|
1266
|
-
const { cache: o, compare:
|
|
1306
|
+
}, _t = Promise.resolve(R), Go = (e, t, n) => {
|
|
1307
|
+
const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: b, strictServerPrefetchWarning: I } = n, [E, L, D, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), T = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, $] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? R : n.fallback[l] : s, Xe = (_, v) => {
|
|
1267
1308
|
for (const y in te) {
|
|
1268
1309
|
const w = y;
|
|
1269
1310
|
if (w === "data") {
|
|
1270
|
-
if (!
|
|
1311
|
+
if (!a(_[w], v[w]) && (!u(_[w]) || !a(me, v[w])))
|
|
1271
1312
|
return !1;
|
|
1272
1313
|
} else if (v[w] !== _[w])
|
|
1273
1314
|
return !1;
|
|
1274
1315
|
}
|
|
1275
1316
|
return !0;
|
|
1276
1317
|
}, Ke = Pe(() => {
|
|
1277
|
-
const _ = !l || !t ? !1 : u(c) ? p().isPaused() ||
|
|
1278
|
-
const W = z(
|
|
1318
|
+
const _ = !l || !t ? !1 : u(c) ? p().isPaused() || i ? !1 : f !== !1 : c, v = (S) => {
|
|
1319
|
+
const W = z(S);
|
|
1279
1320
|
return delete W._k, _ ? {
|
|
1280
1321
|
isValidating: !0,
|
|
1281
1322
|
isLoading: !0,
|
|
1282
1323
|
...W
|
|
1283
1324
|
} : W;
|
|
1284
|
-
}, y = M(), w =
|
|
1285
|
-
let x =
|
|
1325
|
+
}, y = M(), w = $(), q = v(y), oe = y === w ? q : v(w);
|
|
1326
|
+
let x = q;
|
|
1286
1327
|
return [
|
|
1287
1328
|
() => {
|
|
1288
|
-
const
|
|
1289
|
-
return Xe(
|
|
1329
|
+
const S = v(M());
|
|
1330
|
+
return Xe(S, x) ? (x.data = S.data, x.isLoading = S.isLoading, x.isValidating = S.isValidating, x.error = S.error, x) : (x = S, S);
|
|
1290
1331
|
},
|
|
1291
1332
|
() => oe
|
|
1292
1333
|
];
|
|
1293
1334
|
}, [
|
|
1294
1335
|
o,
|
|
1295
1336
|
l
|
|
1296
|
-
]), ne = rt.useSyncExternalStore(
|
|
1337
|
+
]), ne = rt.useSyncExternalStore(Te(
|
|
1297
1338
|
(_) => H(l, (v, y) => {
|
|
1298
1339
|
Xe(y, v) || _();
|
|
1299
1340
|
}),
|
|
@@ -1302,56 +1343,56 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1302
1343
|
o,
|
|
1303
1344
|
l
|
|
1304
1345
|
]
|
|
1305
|
-
), Ke[0], Ke[1]), Qe = !J.current,
|
|
1346
|
+
), Ke[0], Ke[1]), Qe = !J.current, $t = E[l] && E[l].length > 0, re = ne.data, G = u(re) ? he && St(he) ? Ce(he) : he : re, _e = ne.error, we = K(G), me = b ? u(re) ? u(we.current) ? G : we.current : re : G, X = l && u(G), qt = !ie && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1306
1347
|
rt.useSyncExternalStore(() => P, () => !1, () => !0);
|
|
1307
|
-
|
|
1308
|
-
const Je =
|
|
1348
|
+
I && qt && !i && X && console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
|
|
1349
|
+
const Je = $t && !u(_e) ? !1 : Qe && !u(c) ? c : p().isPaused() ? !1 : i ? u(G) ? !1 : f : u(G) || f, Ye = !!(l && t && Qe && Je), Dt = u(ne.isValidating) ? Ye : ne.isValidating, At = u(ne.isLoading) ? Ye : ne.isLoading, le = Te(
|
|
1309
1350
|
async (_) => {
|
|
1310
1351
|
const v = V.current;
|
|
1311
|
-
if (!l || !v ||
|
|
1352
|
+
if (!l || !v || T.current || p().isPaused())
|
|
1312
1353
|
return !1;
|
|
1313
|
-
let y, w,
|
|
1314
|
-
const oe = _ || {}, x =
|
|
1354
|
+
let y, w, q = !0;
|
|
1355
|
+
const oe = _ || {}, x = !D[l] || !oe.dedupe, S = () => ut ? !T.current && l === A.current && J.current : l === A.current, W = {
|
|
1315
1356
|
isValidating: !1,
|
|
1316
1357
|
isLoading: !1
|
|
1317
1358
|
}, et = () => {
|
|
1318
1359
|
ee(W);
|
|
1319
1360
|
}, tt = () => {
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1361
|
+
const O = D[l];
|
|
1362
|
+
O && O[1] === w && delete D[l];
|
|
1322
1363
|
}, nt = {
|
|
1323
1364
|
isValidating: !0
|
|
1324
1365
|
};
|
|
1325
1366
|
u(M().data) && (nt.isLoading = !0);
|
|
1326
1367
|
try {
|
|
1327
1368
|
if (x && (ee(nt), n.loadingTimeout && u(M().data) && setTimeout(() => {
|
|
1328
|
-
|
|
1329
|
-
}, n.loadingTimeout),
|
|
1369
|
+
q && S() && p().onLoadingSlow(l, n);
|
|
1370
|
+
}, n.loadingTimeout), D[l] = [
|
|
1330
1371
|
v(fe),
|
|
1331
1372
|
We()
|
|
1332
|
-
]), [y, w] =
|
|
1333
|
-
return x &&
|
|
1334
|
-
W.error =
|
|
1335
|
-
const
|
|
1336
|
-
if (!u(
|
|
1337
|
-
(w <=
|
|
1338
|
-
w <=
|
|
1339
|
-
|
|
1340
|
-
return et(), x &&
|
|
1373
|
+
]), [y, w] = D[l], y = await y, x && setTimeout(tt, n.dedupingInterval), !D[l] || D[l][1] !== w)
|
|
1374
|
+
return x && S() && p().onDiscarded(l), !1;
|
|
1375
|
+
W.error = R;
|
|
1376
|
+
const O = L[l];
|
|
1377
|
+
if (!u(O) && // case 1
|
|
1378
|
+
(w <= O[0] || // case 2
|
|
1379
|
+
w <= O[1] || // case 3
|
|
1380
|
+
O[1] === 0))
|
|
1381
|
+
return et(), x && S() && p().onDiscarded(l), !1;
|
|
1341
1382
|
const B = M().data;
|
|
1342
|
-
W.data =
|
|
1343
|
-
} catch (
|
|
1383
|
+
W.data = a(B, y) ? B : y, x && S() && p().onSuccess(y, l, n);
|
|
1384
|
+
} catch (O) {
|
|
1344
1385
|
tt();
|
|
1345
1386
|
const B = p(), { shouldRetryOnError: ye } = B;
|
|
1346
|
-
B.isPaused() || (W.error =
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1387
|
+
B.isPaused() || (W.error = O, x && S() && (B.onError(O, l, B), (ye === !0 || j(ye) && ye(O)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(O, l, B, (Vt) => {
|
|
1388
|
+
const be = E[l];
|
|
1389
|
+
be && be[0] && be[0](lt, Vt);
|
|
1349
1390
|
}, {
|
|
1350
1391
|
retryCount: (oe.retryCount || 0) + 1,
|
|
1351
1392
|
dedupe: !0
|
|
1352
1393
|
})));
|
|
1353
1394
|
}
|
|
1354
|
-
return
|
|
1395
|
+
return q = !1, et(), !0;
|
|
1355
1396
|
},
|
|
1356
1397
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
1357
1398
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -1368,47 +1409,47 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1368
1409
|
l,
|
|
1369
1410
|
o
|
|
1370
1411
|
]
|
|
1371
|
-
), Ze =
|
|
1412
|
+
), Ze = Te(
|
|
1372
1413
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
1373
|
-
(..._) =>
|
|
1414
|
+
(..._) => Et(o, A.current, ..._),
|
|
1374
1415
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1375
1416
|
[]
|
|
1376
1417
|
);
|
|
1377
|
-
if (
|
|
1418
|
+
if (Se(() => {
|
|
1378
1419
|
V.current = t, Y.current = n, u(re) || (we.current = re);
|
|
1379
|
-
}),
|
|
1420
|
+
}), Se(() => {
|
|
1380
1421
|
if (!l) return;
|
|
1381
|
-
const _ = le.bind(
|
|
1422
|
+
const _ = le.bind(R, Oe);
|
|
1382
1423
|
let v = 0;
|
|
1383
1424
|
p().revalidateOnFocus && (v = Date.now() + p().focusThrottleInterval);
|
|
1384
|
-
const w =
|
|
1385
|
-
if (
|
|
1425
|
+
const w = Ho(l, E, (q, oe = {}) => {
|
|
1426
|
+
if (q == Nt) {
|
|
1386
1427
|
const x = Date.now();
|
|
1387
1428
|
p().revalidateOnFocus && x > v && Z() && (v = x + p().focusThrottleInterval, _());
|
|
1388
|
-
} else if (
|
|
1429
|
+
} else if (q == It)
|
|
1389
1430
|
p().revalidateOnReconnect && Z() && _();
|
|
1390
1431
|
else {
|
|
1391
|
-
if (
|
|
1432
|
+
if (q == Rt)
|
|
1392
1433
|
return le();
|
|
1393
|
-
if (
|
|
1434
|
+
if (q == lt)
|
|
1394
1435
|
return le(oe);
|
|
1395
1436
|
}
|
|
1396
1437
|
});
|
|
1397
|
-
return
|
|
1438
|
+
return T.current = !1, A.current = l, J.current = !0, ee({
|
|
1398
1439
|
_k: fe
|
|
1399
|
-
}), Je && (
|
|
1400
|
-
|
|
1440
|
+
}), Je && (D[l] || (u(G) || ie ? _() : So(_))), () => {
|
|
1441
|
+
T.current = !0, w();
|
|
1401
1442
|
};
|
|
1402
1443
|
}, [
|
|
1403
1444
|
l
|
|
1404
|
-
]),
|
|
1445
|
+
]), Se(() => {
|
|
1405
1446
|
let _;
|
|
1406
1447
|
function v() {
|
|
1407
1448
|
const w = j(d) ? d(M().data) : d;
|
|
1408
1449
|
w && _ !== -1 && (_ = setTimeout(y, w));
|
|
1409
1450
|
}
|
|
1410
1451
|
function y() {
|
|
1411
|
-
!M().error && (g || p().isVisible()) && (m || p().isOnline()) ? le(
|
|
1452
|
+
!M().error && (g || p().isVisible()) && (m || p().isOnline()) ? le(Oe).then(v) : v();
|
|
1412
1453
|
}
|
|
1413
1454
|
return v(), () => {
|
|
1414
1455
|
_ && (clearTimeout(_), _ = -1);
|
|
@@ -1418,14 +1459,14 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1418
1459
|
g,
|
|
1419
1460
|
m,
|
|
1420
1461
|
l
|
|
1421
|
-
]),
|
|
1422
|
-
if (!ut &&
|
|
1462
|
+
]), Xt(me), i) {
|
|
1463
|
+
if (!ut && ie && X)
|
|
1423
1464
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
1424
|
-
X && (V.current = t, Y.current = n,
|
|
1465
|
+
X && (V.current = t, Y.current = n, T.current = !1);
|
|
1425
1466
|
const _ = ce[l], v = !u(_) && X ? Ze(_) : _t;
|
|
1426
1467
|
if (Ce(v), !u(_e) && X)
|
|
1427
1468
|
throw _e;
|
|
1428
|
-
const y = X ? le(
|
|
1469
|
+
const y = X ? le(Oe) : _t;
|
|
1429
1470
|
!u(me) && X && (y.status = "fulfilled", y.value = !0), Ce(y);
|
|
1430
1471
|
}
|
|
1431
1472
|
return {
|
|
@@ -1437,33 +1478,33 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1437
1478
|
return te.error = !0, _e;
|
|
1438
1479
|
},
|
|
1439
1480
|
get isValidating() {
|
|
1440
|
-
return te.isValidating = !0,
|
|
1481
|
+
return te.isValidating = !0, Dt;
|
|
1441
1482
|
},
|
|
1442
1483
|
get isLoading() {
|
|
1443
|
-
return te.isLoading = !0,
|
|
1484
|
+
return te.isLoading = !0, At;
|
|
1444
1485
|
}
|
|
1445
1486
|
};
|
|
1446
|
-
}, mt =
|
|
1447
|
-
class
|
|
1487
|
+
}, mt = zo(Go);
|
|
1488
|
+
class Xo extends Error {
|
|
1448
1489
|
constructor({ message: t, status: n, data: o }) {
|
|
1449
1490
|
super(t), this.name = "TwitterApiError", this.status = n, this.data = o;
|
|
1450
1491
|
}
|
|
1451
1492
|
}
|
|
1452
|
-
const
|
|
1453
|
-
async function
|
|
1493
|
+
const Ko = mt.default || mt, Qo = "https://react-tweet.vercel.app";
|
|
1494
|
+
async function Jo([e, t]) {
|
|
1454
1495
|
const n = await fetch(e, t), o = await n.json();
|
|
1455
1496
|
if (n.ok) return o.data || null;
|
|
1456
|
-
throw new
|
|
1497
|
+
throw new Xo({
|
|
1457
1498
|
message: `Failed to fetch tweet at "${e}" with "${n.status}".`,
|
|
1458
1499
|
data: o,
|
|
1459
1500
|
status: n.status
|
|
1460
1501
|
});
|
|
1461
1502
|
}
|
|
1462
|
-
const
|
|
1463
|
-
const { isLoading: o, data:
|
|
1464
|
-
t || e && `${
|
|
1503
|
+
const Yo = (e, t, n) => {
|
|
1504
|
+
const { isLoading: o, data: a, error: i } = Ko(() => t || e ? [
|
|
1505
|
+
t || e && `${Qo}/api/tweet/${e}`,
|
|
1465
1506
|
n
|
|
1466
|
-
] : null,
|
|
1507
|
+
] : null, Jo, {
|
|
1467
1508
|
revalidateIfStale: !1,
|
|
1468
1509
|
revalidateOnFocus: !1,
|
|
1469
1510
|
shouldRetryOnError: !1
|
|
@@ -1471,53 +1512,53 @@ const Go = (e, t, n) => {
|
|
|
1471
1512
|
return {
|
|
1472
1513
|
// If data is `undefined` then it might be the first render where SWR hasn't started doing
|
|
1473
1514
|
// any work, so we set `isLoading` to `true`.
|
|
1474
|
-
isLoading: !!(o ||
|
|
1475
|
-
data:
|
|
1476
|
-
error:
|
|
1515
|
+
isLoading: !!(o || a === void 0 && !i),
|
|
1516
|
+
data: a,
|
|
1517
|
+
error: i
|
|
1477
1518
|
};
|
|
1478
|
-
},
|
|
1479
|
-
const { data: s, error: c, isLoading: f } =
|
|
1519
|
+
}, Zo = ({ id: e, apiUrl: t, fallback: n = /* @__PURE__ */ r(go, {}), components: o, fetchOptions: a, onError: i }) => {
|
|
1520
|
+
const { data: s, error: c, isLoading: f } = Yo(e, t, a);
|
|
1480
1521
|
if (f) return n;
|
|
1481
1522
|
if (c || !s) {
|
|
1482
|
-
const d = (o == null ? void 0 : o.TweetNotFound) ||
|
|
1523
|
+
const d = (o == null ? void 0 : o.TweetNotFound) || ho;
|
|
1483
1524
|
return /* @__PURE__ */ r(d, {
|
|
1484
|
-
error:
|
|
1525
|
+
error: i ? i(c) : c
|
|
1485
1526
|
});
|
|
1486
1527
|
}
|
|
1487
|
-
return /* @__PURE__ */ r(
|
|
1528
|
+
return /* @__PURE__ */ r(lo, {
|
|
1488
1529
|
tweet: s,
|
|
1489
1530
|
components: o
|
|
1490
1531
|
});
|
|
1491
1532
|
};
|
|
1492
|
-
function
|
|
1533
|
+
function ea({ node: e }) {
|
|
1493
1534
|
var o;
|
|
1494
1535
|
const t = ((o = e == null ? void 0 : e.attrs) == null ? void 0 : o.src) || "", n = t == null ? void 0 : t.split("/").pop();
|
|
1495
|
-
return n ? /* @__PURE__ */ r(
|
|
1536
|
+
return n ? /* @__PURE__ */ r(Mt, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Zo, { id: n }) }) }) : null;
|
|
1496
1537
|
}
|
|
1497
|
-
function
|
|
1498
|
-
const { t } =
|
|
1538
|
+
function ta(e) {
|
|
1539
|
+
const { t } = nn(), [n, o] = se("");
|
|
1499
1540
|
Fe(() => {
|
|
1500
|
-
var
|
|
1541
|
+
var i;
|
|
1501
1542
|
if (e != null && e.editor) {
|
|
1502
|
-
const { src: s } = (
|
|
1543
|
+
const { src: s } = (i = e.editor) == null ? void 0 : i.getAttributes(Lt.name);
|
|
1503
1544
|
s && o(s);
|
|
1504
1545
|
}
|
|
1505
1546
|
}, [e == null ? void 0 : e.editor]);
|
|
1506
|
-
function i
|
|
1507
|
-
|
|
1547
|
+
function a(i) {
|
|
1548
|
+
i.preventDefault(), i.stopPropagation(), e == null || e.onSetLink(n);
|
|
1508
1549
|
}
|
|
1509
1550
|
return /* @__PURE__ */ h(
|
|
1510
1551
|
"form",
|
|
1511
1552
|
{
|
|
1512
1553
|
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
1513
|
-
onSubmit:
|
|
1554
|
+
onSubmit: a,
|
|
1514
1555
|
children: [
|
|
1515
|
-
/* @__PURE__ */ r(
|
|
1556
|
+
/* @__PURE__ */ r(tn, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
|
|
1516
1557
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
|
|
1517
|
-
|
|
1558
|
+
en,
|
|
1518
1559
|
{
|
|
1519
1560
|
className: "richtext-w-80",
|
|
1520
|
-
onChange: (
|
|
1561
|
+
onChange: (i) => o(i.target.value),
|
|
1521
1562
|
placeholder: "Text",
|
|
1522
1563
|
required: !0,
|
|
1523
1564
|
type: "text",
|
|
@@ -1525,7 +1566,7 @@ function Qo(e) {
|
|
|
1525
1566
|
}
|
|
1526
1567
|
) }) }),
|
|
1527
1568
|
/* @__PURE__ */ r(
|
|
1528
|
-
|
|
1569
|
+
Zt,
|
|
1529
1570
|
{
|
|
1530
1571
|
className: "richtext-mt-2 richtext-self-end",
|
|
1531
1572
|
type: "submit",
|
|
@@ -1536,43 +1577,43 @@ function Qo(e) {
|
|
|
1536
1577
|
}
|
|
1537
1578
|
);
|
|
1538
1579
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const [e, t] = se(!1), n =
|
|
1541
|
-
icon:
|
|
1542
|
-
tooltip:
|
|
1580
|
+
function pa() {
|
|
1581
|
+
const [e, t] = se(!1), n = rn(), o = on(Lt.name), {
|
|
1582
|
+
icon: a = void 0,
|
|
1583
|
+
tooltip: i = void 0,
|
|
1543
1584
|
tooltipOptions: s = {},
|
|
1544
1585
|
action: c = void 0,
|
|
1545
1586
|
isActive: f = void 0
|
|
1546
|
-
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } =
|
|
1587
|
+
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } = an(f);
|
|
1547
1588
|
function g(m) {
|
|
1548
1589
|
d || c && (c(m), t(!1));
|
|
1549
1590
|
}
|
|
1550
1591
|
return /* @__PURE__ */ h(
|
|
1551
|
-
|
|
1592
|
+
Qt,
|
|
1552
1593
|
{
|
|
1553
1594
|
modal: !0,
|
|
1554
1595
|
onOpenChange: t,
|
|
1555
1596
|
open: e,
|
|
1556
1597
|
children: [
|
|
1557
|
-
/* @__PURE__ */ r(
|
|
1558
|
-
|
|
1598
|
+
/* @__PURE__ */ r(Jt, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1599
|
+
Kt,
|
|
1559
1600
|
{
|
|
1560
1601
|
disabled: d,
|
|
1561
1602
|
isActive: f,
|
|
1562
|
-
tooltip:
|
|
1603
|
+
tooltip: i,
|
|
1563
1604
|
tooltipOptions: s,
|
|
1564
|
-
children: /* @__PURE__ */ r(
|
|
1605
|
+
children: /* @__PURE__ */ r(sn, { name: a })
|
|
1565
1606
|
}
|
|
1566
1607
|
) }),
|
|
1567
1608
|
/* @__PURE__ */ r(
|
|
1568
|
-
|
|
1609
|
+
Yt,
|
|
1569
1610
|
{
|
|
1570
1611
|
align: "start",
|
|
1571
1612
|
className: "richtext-w-full",
|
|
1572
1613
|
hideWhenDetached: !0,
|
|
1573
1614
|
side: "bottom",
|
|
1574
1615
|
children: /* @__PURE__ */ r(
|
|
1575
|
-
|
|
1616
|
+
ta,
|
|
1576
1617
|
{
|
|
1577
1618
|
editor: n,
|
|
1578
1619
|
onSetLink: g
|
|
@@ -1584,11 +1625,11 @@ function fi() {
|
|
|
1584
1625
|
}
|
|
1585
1626
|
);
|
|
1586
1627
|
}
|
|
1587
|
-
const
|
|
1628
|
+
const na = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, ra = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
|
|
1588
1629
|
function pt(e) {
|
|
1589
|
-
return e.match(
|
|
1630
|
+
return e.match(ra);
|
|
1590
1631
|
}
|
|
1591
|
-
const
|
|
1632
|
+
const Lt = /* @__PURE__ */ jt.create({
|
|
1592
1633
|
name: "twitter",
|
|
1593
1634
|
draggable: !0,
|
|
1594
1635
|
selectable: !0,
|
|
@@ -1613,7 +1654,7 @@ const Ct = /* @__PURE__ */ Vt.create({
|
|
|
1613
1654
|
};
|
|
1614
1655
|
},
|
|
1615
1656
|
addNodeView() {
|
|
1616
|
-
return
|
|
1657
|
+
return Ft(ea, { attrs: this.options.HTMLAttributes });
|
|
1617
1658
|
},
|
|
1618
1659
|
inline() {
|
|
1619
1660
|
return this.options.inline;
|
|
@@ -1646,19 +1687,19 @@ const Ct = /* @__PURE__ */ Vt.create({
|
|
|
1646
1687
|
},
|
|
1647
1688
|
addPasteRules() {
|
|
1648
1689
|
return this.options.addPasteHandler ? [
|
|
1649
|
-
|
|
1650
|
-
find:
|
|
1690
|
+
Bt({
|
|
1691
|
+
find: na,
|
|
1651
1692
|
type: this.type,
|
|
1652
1693
|
getAttributes: (e) => ({ src: e.input })
|
|
1653
1694
|
})
|
|
1654
1695
|
] : [];
|
|
1655
1696
|
},
|
|
1656
1697
|
renderHTML({ HTMLAttributes: e }) {
|
|
1657
|
-
return ["div",
|
|
1698
|
+
return ["div", Wt({ "data-twitter": "" }, e)];
|
|
1658
1699
|
}
|
|
1659
1700
|
});
|
|
1660
1701
|
export {
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1702
|
+
ta as F,
|
|
1703
|
+
pa as R,
|
|
1704
|
+
Lt as T
|
|
1664
1705
|
};
|