@streamlayer/react 1.23.0 → 1.23.2

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 (167) hide show
  1. package/lib/app/pause-ad.d.ts +2 -4
  2. package/lib/app/polymarket.d.ts +7 -0
  3. package/lib/cjs/Question.js +1 -1
  4. package/lib/cjs/advertisement.js +28 -223
  5. package/lib/cjs/analytics.js +1 -1
  6. package/lib/cjs/auth.js +1 -1
  7. package/lib/cjs/bet-pack.js +1 -1
  8. package/lib/cjs/feature.js +1 -0
  9. package/lib/cjs/gamification-feature.js +1 -1
  10. package/lib/cjs/gamification-feature2.js +1 -1
  11. package/lib/cjs/hooks-WfHlJH12.js +1 -0
  12. package/lib/cjs/index-eShKGO10.js +1 -5
  13. package/lib/cjs/index.js +1 -1
  14. package/lib/cjs/index10.js +1 -4
  15. package/lib/cjs/index11.js +3 -1
  16. package/lib/cjs/index12.js +1 -1
  17. package/lib/cjs/index13.js +3 -1
  18. package/lib/cjs/index14.js +1 -1
  19. package/lib/cjs/index15.js +1 -5
  20. package/lib/cjs/index16.js +3 -0
  21. package/lib/cjs/index2.js +1 -1
  22. package/lib/cjs/index3.js +1 -1
  23. package/lib/cjs/index4.js +3 -5
  24. package/lib/cjs/index5.js +1 -1
  25. package/lib/cjs/index6.js +1 -1
  26. package/lib/cjs/index7.js +1 -1
  27. package/lib/cjs/index8.js +1 -1
  28. package/lib/cjs/index9.js +1 -1
  29. package/lib/cjs/insight.js +1 -1
  30. package/lib/cjs/masters.js +1 -1
  31. package/lib/cjs/masters2.js +1 -13
  32. package/lib/cjs/notification.js +1 -1
  33. package/lib/cjs/pause-ad.js +1 -1
  34. package/lib/cjs/points.js +1 -1
  35. package/lib/cjs/polymarket.js +9 -0
  36. package/lib/cjs/sl-types.js +1 -15
  37. package/lib/cjs/storage.js +1 -1
  38. package/lib/cjs/style.css +1 -0
  39. package/lib/cjs/theme.js +1 -17
  40. package/lib/cjs/useStreamLayerApp.js +1 -1
  41. package/lib/cjs/useStreamLayerApp2.js +3 -17
  42. package/lib/cjs/utils.js +1 -47
  43. package/lib/classic/app/pause-ad.d.ts +2 -4
  44. package/lib/classic/app/polymarket.d.ts +7 -0
  45. package/lib/classic/cjs/Question.js +1 -1
  46. package/lib/classic/cjs/advertisement.js +28 -223
  47. package/lib/classic/cjs/analytics.js +1 -1
  48. package/lib/classic/cjs/auth.js +1 -1
  49. package/lib/classic/cjs/bet-pack.js +3 -5
  50. package/lib/classic/cjs/feature.js +1 -0
  51. package/lib/classic/cjs/gamification-feature.js +1 -1
  52. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -0
  53. package/lib/classic/cjs/index-eShKGO10.js +1 -5
  54. package/lib/classic/cjs/index.js +1 -1
  55. package/lib/classic/cjs/index10.js +1 -1
  56. package/lib/classic/cjs/index11.js +1 -1
  57. package/lib/classic/cjs/index12.js +1 -4
  58. package/lib/classic/cjs/index13.js +3 -0
  59. package/lib/classic/cjs/index2.js +3 -5
  60. package/lib/classic/cjs/index3.js +1 -1
  61. package/lib/classic/cjs/index4.js +1 -1
  62. package/lib/classic/cjs/index5.js +1 -1
  63. package/lib/classic/cjs/index6.js +1 -1
  64. package/lib/classic/cjs/index7.js +1 -1
  65. package/lib/classic/cjs/index8.js +1 -1
  66. package/lib/classic/cjs/index9.js +3 -1
  67. package/lib/classic/cjs/insight.js +1 -1
  68. package/lib/classic/cjs/notification.js +1 -1
  69. package/lib/classic/cjs/notification2.js +1 -1
  70. package/lib/classic/cjs/pause-ad.js +1 -1
  71. package/lib/classic/cjs/points.js +1 -1
  72. package/lib/classic/cjs/polymarket.js +9 -0
  73. package/lib/classic/cjs/sl-types.js +1 -15
  74. package/lib/classic/cjs/style.css +1 -0
  75. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  76. package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
  77. package/lib/classic/cjs/utils.js +1 -47
  78. package/lib/classic/es/Question.js +277 -264
  79. package/lib/classic/es/advertisement.js +34990 -18881
  80. package/lib/classic/es/analytics.js +58 -56
  81. package/lib/classic/es/auth.js +14 -8
  82. package/lib/classic/es/bet-pack.js +2448 -2418
  83. package/lib/classic/es/feature.js +108 -0
  84. package/lib/classic/es/gamification-feature.js +2 -2
  85. package/lib/classic/es/hooks-WfHlJH12.js +98 -0
  86. package/lib/classic/es/index-eShKGO10.js +948 -948
  87. package/lib/classic/es/index.js +13 -13
  88. package/lib/classic/es/index10.js +83 -2295
  89. package/lib/classic/es/index11.js +3095 -179
  90. package/lib/classic/es/index12.js +174 -821
  91. package/lib/classic/es/index13.js +850 -0
  92. package/lib/classic/es/index2.js +2099 -1763
  93. package/lib/classic/es/index3.js +11 -11
  94. package/lib/classic/es/index4.js +127 -127
  95. package/lib/classic/es/index5.js +3 -5
  96. package/lib/classic/es/index6.js +10 -11
  97. package/lib/classic/es/index7.js +6 -62
  98. package/lib/classic/es/index8.js +9 -316
  99. package/lib/classic/es/index9.js +316 -82
  100. package/lib/classic/es/insight.js +58 -53
  101. package/lib/classic/es/notification.js +5 -5
  102. package/lib/classic/es/notification2.js +765 -722
  103. package/lib/classic/es/pause-ad.js +190 -167
  104. package/lib/classic/es/points.js +55 -47
  105. package/lib/classic/es/polymarket.js +6848 -0
  106. package/lib/classic/es/sl-types.js +193 -125
  107. package/lib/classic/es/useStreamLayerApp.js +2 -2
  108. package/lib/classic/es/useStreamLayerApp2.js +9727 -7592
  109. package/lib/classic/es/utils.js +28 -28
  110. package/lib/classic/index.d.ts +1 -0
  111. package/lib/classic/style.css +1 -0
  112. package/lib/dist/cjs/gamification-feature.js +1 -1
  113. package/lib/dist/cjs/index-eShKGO10.js +1 -5
  114. package/lib/dist/cjs/index.js +1 -1
  115. package/lib/dist/cjs/masters.js +3 -77
  116. package/lib/dist/es/gamification-feature.js +2 -2
  117. package/lib/dist/es/index-eShKGO10.js +948 -948
  118. package/lib/dist/es/index.js +7 -8
  119. package/lib/dist/es/masters.js +18212 -14741
  120. package/lib/dist/index.d.ts +29 -8
  121. package/lib/dist/style.css +1 -1
  122. package/lib/es/Question.js +108 -106
  123. package/lib/es/advertisement.js +34990 -18881
  124. package/lib/es/analytics.js +58 -56
  125. package/lib/es/auth.js +14 -8
  126. package/lib/es/bet-pack.js +29 -17
  127. package/lib/es/feature.js +108 -0
  128. package/lib/es/gamification-feature.js +2 -2
  129. package/lib/es/gamification-feature2.js +2 -2
  130. package/lib/es/hooks-WfHlJH12.js +98 -0
  131. package/lib/es/index-eShKGO10.js +948 -948
  132. package/lib/es/index.js +14 -13
  133. package/lib/es/index10.js +258 -816
  134. package/lib/es/index11.js +837 -170
  135. package/lib/es/index12.js +181 -312
  136. package/lib/es/index13.js +316 -82
  137. package/lib/es/index14.js +83 -2350
  138. package/lib/es/index15.js +3069 -1224
  139. package/lib/es/index16.js +1453 -0
  140. package/lib/es/index2.js +1118 -984
  141. package/lib/es/index3.js +3 -62
  142. package/lib/es/index4.js +2424 -2407
  143. package/lib/es/index5.js +11 -11
  144. package/lib/es/index6.js +127 -127
  145. package/lib/es/index7.js +10 -7
  146. package/lib/es/index8.js +5 -9
  147. package/lib/es/index9.js +10 -265
  148. package/lib/es/insight.js +58 -53
  149. package/lib/es/masters.js +6 -5
  150. package/lib/es/masters2.js +696 -558
  151. package/lib/es/notification.js +697 -655
  152. package/lib/es/pause-ad.js +190 -167
  153. package/lib/es/points.js +56 -48
  154. package/lib/es/polymarket.js +6848 -0
  155. package/lib/es/sl-types.js +200 -132
  156. package/lib/es/storage.js +75 -74
  157. package/lib/es/theme.js +177 -31
  158. package/lib/es/useStreamLayerApp.js +2 -2
  159. package/lib/es/useStreamLayerApp2.js +9727 -7592
  160. package/lib/es/utils.js +28 -28
  161. package/lib/index.d.ts +1 -0
  162. package/lib/style.css +1 -1
  163. package/package.json +33 -20
  164. package/lib/cjs/hooks-B0Qttldg.js +0 -1
  165. package/lib/classic/cjs/hooks-B0Qttldg.js +0 -1
  166. package/lib/classic/es/hooks-B0Qttldg.js +0 -98
  167. package/lib/es/hooks-B0Qttldg.js +0 -98
package/lib/es/index12.js CHANGED
@@ -1,319 +1,188 @@
1
- import { jsxs as S, jsx as e, Fragment as re } from "react/jsx-runtime";
2
- import { s as o, c as X } from "./sl-types.js";
3
- import { useState as I, useEffect as b, useCallback as w, forwardRef as ce, useRef as L } from "react";
4
- import { B as f } from "./index6.js";
5
- import { G as ie, d as ue, O as de } from "./index13.js";
6
- import { C as pe } from "./useStreamLayerApp2.js";
7
- const me = /* @__PURE__ */ o("div")({
8
- name: "CloseIconWrap",
9
- class: "c3v6bv6",
10
- propsAsIs: !1
11
- }), ye = /* @__PURE__ */ o("div")({
12
- name: "TimerWrap",
13
- class: "teuhmro",
14
- propsAsIs: !1
15
- }), he = () => f, fe = /* @__PURE__ */ o(he())({
16
- name: "Icon",
17
- class: "i17rfxv5",
18
- propsAsIs: !0
19
- }), Ye = ({
20
- close: n,
21
- className: a,
22
- timerClassName: s,
23
- skipIcon: l,
24
- isPlaying: u = !0,
25
- duration: i = 0,
26
- autoClose: d
27
- }) => {
28
- const [p, m] = I(i === 0);
29
- b(() => {
30
- m(!i);
31
- }, [i]);
32
- const P = w(() => {
33
- d === pe.ENABLED ? n == null || n() : m(!0);
34
- }, [d, n]);
35
- return p ? /* @__PURE__ */ S(me, {
36
- "data-a": "intr",
37
- onClick: n,
38
- className: a,
39
- style: l ? {
40
- width: "auto"
41
- } : {},
42
- children: [l && /* @__PURE__ */ e("span", {
43
- "data-a": "intr",
44
- children: "Skip"
45
- }), /* @__PURE__ */ e(fe, {
46
- "data-a": "intr",
47
- name: l ? "iconSkip" : "icon-cross"
48
- })]
49
- }) : /* @__PURE__ */ e(ye, {
50
- children: /* @__PURE__ */ e(ie, {
51
- className: s,
52
- isPlaying: u,
53
- duration: i,
54
- onTimerExpired: P
55
- })
56
- });
57
- }, ge = /* @__PURE__ */ o("div")({
1
+ import { s as styled_default } from "./sl-types.js";
2
+ import { Q as QuestionType } from "./useStreamLayerApp2.js";
3
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
4
+ import { memo, useMemo } from "react";
5
+ import { E as Et } from "./index13.js";
6
+ import { B as B1 } from "./index6.js";
7
+ const e$1 = {
8
+ [QuestionType.TWEET]: { label: "Insight", iconName: "icon-insight" },
9
+ [QuestionType.PROMOTION]: { label: "Insight", iconName: "icon-insight" },
10
+ [QuestionType.UNSET]: void 0,
11
+ [QuestionType.FACTOID]: { label: "Insight", iconName: "icon-insight" },
12
+ [QuestionType.POLL]: { label: "Poll", iconName: "icon-poll" },
13
+ [QuestionType.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
14
+ [QuestionType.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
15
+ }, o$1 = {
16
+ [QuestionType.TWEET]: "Learn more",
17
+ [QuestionType.FACTOID]: "Learn more",
18
+ [QuestionType.POLL]: "Answer",
19
+ [QuestionType.TRIVIA]: "Answer",
20
+ [QuestionType.PREDICTION]: "Answer",
21
+ [QuestionType.PROMOTION]: "",
22
+ [QuestionType.UNSET]: ""
23
+ };
24
+ const I = (t2) => t2.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), s = (t2) => t2 ? t2.toLocaleString("en-US") : "0", L = (t2) => {
25
+ const o2 = new Date(t2);
26
+ if (!o2)
27
+ return "";
28
+ const r2 = /* @__PURE__ */ new Date(), e2 = Math.floor(r2.getTime() - o2.getTime());
29
+ return e2 < 6e4 ? `${Math.floor(e2 / 1e3)}s` : e2 < 36e5 ? `${Math.floor(e2 / 6e4)}m` : e2 < 864e5 ? `${Math.floor(e2 / 36e5)}h` : o2.getFullYear() === r2.getFullYear() ? `${o2.toLocaleDateString("en-US", {
30
+ month: "short",
31
+ day: "numeric"
32
+ })}` : `${o2.toLocaleDateString("en-US", {
33
+ month: "2-digit",
34
+ day: "2-digit",
35
+ year: "2-digit"
36
+ })}`;
37
+ };
38
+ const t$1 = /* @__PURE__ */ styled_default("div")({
58
39
  name: "Container",
59
- class: "c1bgb86j",
60
- propsAsIs: !1
61
- }), Ie = /* @__PURE__ */ o("video")({
62
- name: "Player",
63
- class: "p6703cq",
64
- propsAsIs: !1
65
- }), be = /* @__PURE__ */ o("img")({
66
- name: "Poster",
67
- class: "p12ow7zo",
68
- propsAsIs: !1
69
- }), R = /* @__PURE__ */ o("div")({
70
- name: "Control",
71
- class: "cdpal9o",
72
- propsAsIs: !1
73
- }), Pe = "t1xke4ml", ve = "h1yzxv57", Ae = /* @__PURE__ */ o("div")({
74
- name: "VideoControls",
75
- class: "vxo8xch",
76
- propsAsIs: !1
77
- }), $ = /* @__PURE__ */ o("button")({
78
- name: "ControlBtn",
79
- class: "coyuzu0",
80
- propsAsIs: !1
81
- }), Ce = () => $, we = /* @__PURE__ */ o(Ce())({
82
- name: "MuteIcon",
83
- class: "musmi9a",
84
- propsAsIs: !0
85
- }), Me = () => $, ke = /* @__PURE__ */ o(Me())({
86
- name: "PauseIcon",
87
- class: "p1qe7rum",
88
- propsAsIs: !0
89
- }), Ee = () => $, xe = /* @__PURE__ */ o(Ee())({
90
- name: "PlayIcon",
91
- class: "psevery",
92
- propsAsIs: !0
93
- }), Y = /* @__PURE__ */ o("button")({
94
- name: "WebOSIconButton",
95
- class: "w1q3u7py",
96
- propsAsIs: !1
97
- }), Be = () => Y, T = /* @__PURE__ */ o(Be())({
98
- name: "WebOSIconButtonAnimation",
99
- class: "wdlqvum",
100
- propsAsIs: !0
101
- }), Oe = () => T, We = /* @__PURE__ */ o(Oe())({
102
- name: "WebOSIconButtonPlay",
103
- class: "w1ylz9ea",
104
- propsAsIs: !0
105
- }), Ne = () => T, Ve = /* @__PURE__ */ o(Ne())({
106
- name: "WebOSIconButtonPause",
107
- class: "w1iylt55",
108
- propsAsIs: !0
109
- }), Le = () => T, Re = /* @__PURE__ */ o(Le())({
110
- name: "WebOSIconButtonMute",
111
- class: "w8h4h7",
112
- propsAsIs: !0
113
- }), Se = () => T, Te = /* @__PURE__ */ o(Se())({
114
- name: "WebOSIconButtonUnmute",
115
- class: "w12l12kt",
116
- propsAsIs: !0
117
- }), Ue = (n) => {
118
- for (const a of n)
119
- a.isIntersecting ? a.target instanceof HTMLVideoElement && a.target.autoplay && a.target.play() : a.target instanceof HTMLVideoElement && !a.target.paused && a.target.pause();
120
- }, Z = new IntersectionObserver(Ue, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), je = (n) => {
121
- Z.observe(n), D.add(n);
122
- }, qe = (n) => {
123
- Z.unobserve(n), D.delete(n);
124
- }, ze = () => {
125
- for (const n of D)
126
- n instanceof HTMLVideoElement && !n.paused && n.pause();
40
+ class: "cjq447q",
41
+ propsAsIs: false
42
+ }), r$1 = /* @__PURE__ */ styled_default("div")({
43
+ name: "ImageContainer",
44
+ class: "i14egogb",
45
+ propsAsIs: false
46
+ }), c$1 = /* @__PURE__ */ styled_default("img")({
47
+ name: "Image",
48
+ class: "i2g9g4l",
49
+ propsAsIs: false
50
+ }), a$1 = () => B1, m$1 = /* @__PURE__ */ styled_default(a$1())({
51
+ name: "TwitterIcon",
52
+ class: "t1c454nm",
53
+ propsAsIs: true
54
+ }), i$1 = /* @__PURE__ */ styled_default("div")({
55
+ name: "Details",
56
+ class: "d11nigc3",
57
+ propsAsIs: false
58
+ }), p$1 = /* @__PURE__ */ styled_default("div")({
59
+ name: "Name",
60
+ class: "nrxa4k8",
61
+ propsAsIs: false
62
+ }), l$1 = /* @__PURE__ */ styled_default("div")({
63
+ name: "UserNameAndDate",
64
+ class: "u1p051g3",
65
+ propsAsIs: false
66
+ });
67
+ const D$1 = ({ image: r2, name: c2, userName: n, verified: a2, createdTweet: o2 }) => {
68
+ const i2 = o2 && L(o2);
69
+ return /* @__PURE__ */ jsxs(t$1, { children: [
70
+ r2 && /* @__PURE__ */ jsxs(r$1, { children: [
71
+ /* @__PURE__ */ jsx(c$1, { className: "SL_AccountImage", src: r2 }),
72
+ /* @__PURE__ */ jsx(m$1, { name: "twitter" })
73
+ ] }),
74
+ /* @__PURE__ */ jsxs(i$1, { children: [
75
+ c2 && /* @__PURE__ */ jsxs(p$1, { className: "SL_TweetAccountName", children: [
76
+ c2,
77
+ " ",
78
+ a2 && /* @__PURE__ */ jsx(B1, { name: "icon-twitter-verified" })
79
+ ] }),
80
+ n && /* @__PURE__ */ jsxs(l$1, { className: "SL_TweetAccountUserName", children: [
81
+ "@",
82
+ n,
83
+ " ",
84
+ i2 && `・ ${i2}`
85
+ ] })
86
+ ] })
87
+ ] });
127
88
  };
128
- function He(...n) {
129
- return w(
130
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
- (a) => {
132
- for (const s of n)
133
- s !== null && (typeof s == "function" ? s(a) : s && (s.current = a));
134
- },
135
- // Re-run the callback if the array of refs changes
136
- // eslint-disable-next-line react-hooks/exhaustive-deps
137
- [...n]
138
- );
139
- }
140
- const $e = de(ge), De = ({ loading: n, autoPlay: a, played: s, playing: l, isMuted: u, unmute: i, mute: d, togglePlaying: p }) => !n && !a && !s ? /* @__PURE__ */ e(R, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : s ? /* @__PURE__ */ S(Ae, { children: [
141
- l ? /* @__PURE__ */ e(ke, { onClick: p }) : /* @__PURE__ */ e(xe, { onClick: p }),
142
- /* @__PURE__ */ e(we, { className: X(!u && "muted"), onClick: u ? i : d })
143
- ] }) : null, Fe = ({
144
- loading: n,
145
- autoPlay: a,
146
- playMuted: s,
147
- playing: l,
148
- played: u,
149
- unmute: i,
150
- mute: d,
151
- isMuted: p,
152
- hasNotPausedVideo: m,
153
- hasInteractedWithAudio: P
154
- }) => /* @__PURE__ */ S(re, { children: [
155
- !n && !(a && s) && /* @__PURE__ */ e(R, { "data-control-btn": "true", children: l ? m ? null : /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : u ? /* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
- !n && a && s && P && /* @__PURE__ */ e(R, { children: p ? /* @__PURE__ */ e(Re, { onClick: i, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Te, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
- ] }), Ze = ce(
158
- ({
159
- poster: n,
160
- source: a,
161
- aspectRatio: s,
162
- controlVideo: l,
163
- onReplay: u,
164
- onPlay: i,
165
- onPause: d,
166
- onEnd: p,
167
- onRender: m,
168
- onMute: P,
169
- onQuartile: v,
170
- autoPlay: M,
171
- playMuted: k,
172
- className: ee,
173
- muted: E,
174
- webos: B,
175
- hasNotPausedVideo: ne
176
- }, te) => {
177
- const c = L(null), ae = He(c, te), U = L(!1), j = L(!1), y = L(/* @__PURE__ */ new Set()), [F, G] = I(!1), [O, W] = I(!1), [q, Q] = I(!1), [_, N] = I(!0), [z, V] = I(k), [H, oe] = I(!1);
178
- b(() => {
179
- a && (V(k), G(!1));
180
- }, [a]);
181
- const A = w(() => {
182
- l == null || l({ muted: !1 });
183
- }, [l]), J = w(() => {
184
- l == null || l({ muted: !0 });
185
- }, [l]), C = w((t) => {
186
- t == null || t.stopPropagation(), c.current && (c.current.muted = !0), V(!0);
187
- }, []), x = w(
188
- (t) => {
189
- t == null || t.stopPropagation(), c.current && (c.current.muted = !1), V(!1), H || oe(!0);
190
- },
191
- [H]
192
- );
193
- b(() => {
194
- E !== void 0 && (E ? C() : x());
195
- }, [C, E, x]);
196
- const K = (t) => {
197
- var r;
198
- (r = t.stopPropagation) == null || r.call(t);
199
- const g = c == null ? void 0 : c.current;
200
- if (g)
201
- if (O)
202
- g.pause();
203
- else {
204
- const h = c == null ? void 0 : c.current;
205
- if (!h)
206
- return;
207
- ze(), h.play().catch((le) => console.log(le)), N(!1);
89
+ const l = /* @__PURE__ */ styled_default("div")({
90
+ name: "Container",
91
+ class: "c1kzqw87",
92
+ propsAsIs: false
93
+ }), t = /* @__PURE__ */ styled_default("div")({
94
+ name: "Details",
95
+ class: "d9r1hf9",
96
+ propsAsIs: false
97
+ }), i = /* @__PURE__ */ styled_default("div")({
98
+ name: "Body",
99
+ class: "bezygt5",
100
+ propsAsIs: false
101
+ }), m = /* @__PURE__ */ styled_default("div")({
102
+ name: "ImagesContainer",
103
+ class: "i1y8f7ym",
104
+ propsAsIs: false
105
+ }), c = /* @__PURE__ */ styled_default("div")({
106
+ name: "ImagesBlock",
107
+ class: "i18gwonx",
108
+ propsAsIs: false
109
+ }), e = /* @__PURE__ */ styled_default("img")({
110
+ name: "Image",
111
+ class: "i3g0xjd",
112
+ propsAsIs: false
113
+ }), a = () => e, p = /* @__PURE__ */ styled_default(a())({
114
+ name: "ImageFullSize",
115
+ class: "io8rt7p",
116
+ propsAsIs: true
117
+ }), o = () => e, r = /* @__PURE__ */ styled_default(o())({
118
+ name: "ImageHalfSize",
119
+ class: "i4hn3ox",
120
+ propsAsIs: true
121
+ });
122
+ const A = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), D = (c2) => c2 == null ? void 0 : c2.replace(A, ""), b = memo(
123
+ ({ image: c$12, body: y, muted: C, account: z, accountVerified: F, tweet: n, isDetail: d, controlVideo: T }) => {
124
+ var h, g, H, U, f;
125
+ const r$12 = (g = (h = n == null ? void 0 : n.meta) == null ? void 0 : h.extendedEntities) == null ? void 0 : g.media, i$12 = r$12 == null ? void 0 : r$12.find(({ type: e2 }) => e2 === "photo"), m$12 = useMemo(() => {
126
+ var e2, u, v, I2;
127
+ return (I2 = (v = (u = (e2 = r$12 == null ? void 0 : r$12[0]) == null ? void 0 : e2.videoInfo) == null ? void 0 : u.variants) == null ? void 0 : v.findLast(({ contentType: j }) => j === "video/mp4")) == null ? void 0 : I2.url;
128
+ }, [r$12]);
129
+ return /* @__PURE__ */ jsxs(l, { children: [
130
+ /* @__PURE__ */ jsxs(t, { children: [
131
+ /* @__PURE__ */ jsx(
132
+ D$1,
133
+ {
134
+ image: c$12,
135
+ name: (H = n == null ? void 0 : n.meta) == null ? void 0 : H.accountName,
136
+ userName: z,
137
+ verified: F,
138
+ createdTweet: n == null ? void 0 : n.date
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsx(i, { children: D(y) }),
142
+ !d && i$12 && /* @__PURE__ */ jsx(m, { children: /* @__PURE__ */ jsx(p, { src: r$12 == null ? void 0 : r$12[0].mediaUrlHttps }) }),
143
+ d && i$12 && /* @__PURE__ */ jsxs(Fragment, { children: [
144
+ (r$12 == null ? void 0 : r$12.length) === 1 && /* @__PURE__ */ jsx(m, { children: /* @__PURE__ */ jsx(p, { src: r$12[0].mediaUrlHttps }) }),
145
+ (r$12 == null ? void 0 : r$12.length) === 2 && /* @__PURE__ */ jsxs(m, { children: [
146
+ /* @__PURE__ */ jsx(r, { src: r$12[0].mediaUrlHttps }),
147
+ /* @__PURE__ */ jsx(r, { src: r$12[1].mediaUrlHttps })
148
+ ] }),
149
+ (r$12 == null ? void 0 : r$12.length) === 3 && /* @__PURE__ */ jsxs(m, { children: [
150
+ /* @__PURE__ */ jsx(r, { src: r$12[0].mediaUrlHttps }),
151
+ /* @__PURE__ */ jsxs(c, { children: [
152
+ /* @__PURE__ */ jsx(p, { src: r$12[1].mediaUrlHttps }),
153
+ /* @__PURE__ */ jsx(p, { src: r$12[2].mediaUrlHttps })
154
+ ] })
155
+ ] }),
156
+ (r$12 == null ? void 0 : r$12.length) === 4 && /* @__PURE__ */ jsxs(m, { children: [
157
+ /* @__PURE__ */ jsxs(c, { children: [
158
+ /* @__PURE__ */ jsx(p, { src: r$12[0].mediaUrlHttps }),
159
+ /* @__PURE__ */ jsx(p, { src: r$12[1].mediaUrlHttps })
160
+ ] }),
161
+ /* @__PURE__ */ jsxs(c, { children: [
162
+ /* @__PURE__ */ jsx(p, { src: r$12[2].mediaUrlHttps }),
163
+ /* @__PURE__ */ jsx(p, { src: r$12[3].mediaUrlHttps })
164
+ ] })
165
+ ] })
166
+ ] })
167
+ ] }),
168
+ !i$12 && (((U = r$12 == null ? void 0 : r$12[0]) == null ? void 0 : U.type) === "video" || ((f = r$12 == null ? void 0 : r$12[0]) == null ? void 0 : f.type) === "animated_gif") && m$12 && /* @__PURE__ */ jsx(
169
+ Et,
170
+ {
171
+ muted: C,
172
+ source: m$12,
173
+ poster: r$12[0].mediaUrlHttps,
174
+ controlVideo: T
208
175
  }
209
- }, se = () => {
210
- var t;
211
- (t = c == null ? void 0 : c.current) == null || t.load(), N(!0);
212
- };
213
- return b(() => () => {
214
- A();
215
- }, [A]), b(() => {
216
- const t = c.current;
217
- return t ? (j.current = t.muted, V(t.muted), je(t), () => {
218
- qe(t);
219
- }) : () => {
220
- };
221
- }, []), b(() => {
222
- m == null || m();
223
- }, [m]), b(() => {
224
- y.current.clear(), U.current = !1;
225
- }, [a]), /* @__PURE__ */ S(
226
- $e,
227
- {
228
- webos: B,
229
- onClick: M && k ? z ? x : C : K,
230
- "data-a": "intr",
231
- autoFocus: !0,
232
- options: { focusKey: "video-play-btn" },
233
- className: X(O && !B && Pe, M && ve, ee),
234
- style: s ? { aspectRatio: s } : {},
235
- children: [
236
- /* @__PURE__ */ e(
237
- Ie,
238
- {
239
- ref: ae,
240
- src: a,
241
- autoPlay: M,
242
- onPlay: () => {
243
- G(!0), U.current && (u == null || u(), y.current.clear()), W(!0), N(!1), i == null || i(), k ? C() : J();
244
- },
245
- onTimeUpdate: (t) => {
246
- const r = t.target.duration, g = t.target.currentTime;
247
- if (r && g) {
248
- const h = Math.floor(g / r * 100);
249
- h >= 25 && h < 50 && !y.current.has(25) ? (v == null || v(25), y.current.add(25)) : h >= 50 && h < 75 && !y.current.has(50) ? (v == null || v(50), y.current.add(50)) : h >= 75 && !y.current.has(75) && (v == null || v(75), y.current.add(75));
250
- }
251
- },
252
- onVolumeChange: (t) => {
253
- const r = t.target.muted;
254
- j.current !== r && (P == null || P(r), j.current = r, (r !== E || E === void 0) && (r ? A() : J()));
255
- },
256
- onError: async (t) => {
257
- try {
258
- if (t.target instanceof HTMLVideoElement) {
259
- Q(!0);
260
- const r = await (await fetch(t.target.src)).blob(), g = URL.createObjectURL(r);
261
- t.target.src = g;
262
- }
263
- } catch (r) {
264
- console.error("video fallback fetch failed", r), W(!0), N(!0);
265
- } finally {
266
- Q(!1), A();
267
- }
268
- },
269
- onPause: () => {
270
- W(!1), d == null || d(), A();
271
- },
272
- onEnded: () => {
273
- W(!1), U.current = !0, se(), p == null || p(), A();
274
- },
275
- style: { visibility: _ ? "hidden" : "visible" },
276
- controls: !1,
277
- playsInline: !0
278
- }
279
- ),
280
- /* @__PURE__ */ e(be, { src: n, style: { visibility: _ ? "visible" : "hidden" } }),
281
- !B && /* @__PURE__ */ e(
282
- De,
283
- {
284
- loading: q,
285
- autoPlay: M,
286
- played: F,
287
- playing: O,
288
- isMuted: z,
289
- unmute: x,
290
- mute: C,
291
- togglePlaying: K
292
- }
293
- ),
294
- B && /* @__PURE__ */ e(
295
- Fe,
296
- {
297
- loading: q,
298
- autoPlay: M,
299
- playMuted: k,
300
- playing: O,
301
- played: F,
302
- unmute: x,
303
- mute: C,
304
- isMuted: z,
305
- hasNotPausedVideo: ne,
306
- hasInteractedWithAudio: H
307
- }
308
- ),
309
- q && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ue, {}) })
310
- ]
311
- }
312
- );
176
+ )
177
+ ] });
313
178
  }
314
179
  );
315
180
  export {
316
- Ze as E,
317
- ze as w,
318
- Ye as y
181
+ D$1 as D,
182
+ I,
183
+ D as a,
184
+ b,
185
+ e$1 as e,
186
+ o$1 as o,
187
+ s
319
188
  };