@streamlayer/web-os 0.3.0 → 0.3.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.
@@ -0,0 +1,643 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { t as tsEnum, e as enumDesc, f as fileDesc, b as file_streamlayer_analytics_v1_common_analytics_common, c as file_google_protobuf_timestamp, A as A$2, s as styled_default, i as i$5, I as I$4, d as s$3, B as B1, D as Df, j as f$2, u as useStore, r as r$5, S as S$1, O, k as b$2, R as R$1, l as D, w as wt, p as p$6, m as l$6, n as cx_default, o as S$2, q as m$6, v as d$3, x as n$4, C as C$2, y as useTransition } from "./index3.js";
3
+ import "@nanostores/react";
4
+ import { useRef, useState, useCallback, useEffect } from "react";
5
+ import "nanostores";
6
+ import "@noriginmedia/norigin-spatial-navigation";
7
+ import "react-countdown-circle-timer";
8
+ import "react-countup";
9
+ import "lodash.throttle";
10
+ import m$5 from "react-infinite-scroller";
11
+ const file_streamlayer_analytics_v1_invitations_invitations = /* @__PURE__ */ fileDesc("CjZzdHJlYW1sYXllci9hbmFseXRpY3MvdjEvaW52aXRhdGlvbnMvaW52aXRhdGlvbnMucHJvdG8SJHN0cmVhbWxheWVyLmFuYWx5dGljcy52MS5pbnZpdGF0aW9ucyLhAgoXVG90YWxJbnZpdGF0aW9uc1JlcXVlc3QSYAoGZmlsdGVyGAEgASgLMlAuc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLnYxLmludml0YXRpb25zLlRvdGFsSW52aXRhdGlvbnNSZXF1ZXN0LlRvdGFsUmVxdWVzdEZpbHRlchrjAQoSVG90YWxSZXF1ZXN0RmlsdGVyEjcKBnBlcmlvZBgBIAEoCzInLnN0cmVhbWxheWVyLmFuYWx5dGljcy52MS5jb21tb24uUGVyaW9kEhEKCWV2ZW50X2lkcxgCIAMoBBJMCgpjYXRlZ29yaWVzGAMgAygOMjguc3RyZWFtbGF5ZXIuYW5hbHl0aWNz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ZJVEFUSU9OX0NBVEVHT1JZX1dBVENISU5HEAESIQodSU5WSVRBVElPTl9DQVRFR09SWV9NRVNTQUdJTkcQAhIfChtJTlZJVEFUSU9OX0NBVEVHT1JZX1ZPSUNJTkcQAxIdChlJTlZJVEFUSU9OX0NBVEVHT1JZX0dBTUVTEAQqZQoOSW52aXRhdGlvbkZyb20SGQoVSU5WSVRBVElPTl9GUk9NX1VOU0VUEAASHgoaSU5WSVRBVElPTl9GUk9NX1RJVExFX0NBUkQQARIYChRJTlZJVEFUSU9OX0ZST01fTUVOVRACQrYBCihjb20uc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLmludml0YXRpb25zLnYxQhtTdHJlYW1MYXllckludml0YXRpb25zUHJvdG9QAVpiZ2l0aHViLmNvbS9zdHJlYW1sYXllci9zbC1wcm90b2ZpbGVzLy5idWlsZC9nby9zdHJlYW1sYXllci9hbmFseXRpY3MvdjEvaW52aXRhdGlvbnM7c2xfaW52aXRhdGlvbnOiAgZTTF9BUEliBnByb3RvMw", [file_streamlayer_analytics_v1_common_analytics_common, file_google_protobuf_timestamp]);
12
+ const InvitationFromSchema = /* @__PURE__ */ enumDesc(file_streamlayer_analytics_v1_invitations_invitations, 1);
13
+ const InvitationFrom = /* @__PURE__ */ tsEnum(InvitationFromSchema);
14
+ const I$3 = (o2, e2, n2) => {
15
+ const t2 = e2 >= A$2.lg && e2 < A$2.xl ? 75 : 52;
16
+ o2.current && window.scrollTo({
17
+ top: o2.current.offsetTop - t2,
18
+ ...n2
19
+ });
20
+ };
21
+ const n$3 = /* @__PURE__ */ styled_default("div")({
22
+ name: "Container",
23
+ class: "c1zy8a",
24
+ propsAsIs: false
25
+ }), o$5 = /* @__PURE__ */ styled_default("div")({
26
+ name: "Title",
27
+ class: "t1vih9p5",
28
+ propsAsIs: false
29
+ }), t$4 = /* @__PURE__ */ styled_default("div")({
30
+ name: "Indicator",
31
+ class: "i1fbnvpb",
32
+ propsAsIs: false
33
+ });
34
+ const m$4 = ({ indicator: i2, title: n2 }) => /* @__PURE__ */ jsxs(n$3, { children: [
35
+ /* @__PURE__ */ jsx(o$5, { children: n2 }),
36
+ /* @__PURE__ */ jsx(t$4, { children: i2 })
37
+ ] });
38
+ const t$3 = /* @__PURE__ */ styled_default("div")({
39
+ name: "Container",
40
+ class: "ctmhwyc",
41
+ propsAsIs: false
42
+ }), a$5 = /* @__PURE__ */ styled_default("div")({
43
+ name: "Indicator",
44
+ class: "i1jri200",
45
+ propsAsIs: false
46
+ }), e$8 = /* @__PURE__ */ styled_default("div")({
47
+ name: "Title",
48
+ class: "t8s05oq",
49
+ propsAsIs: false
50
+ });
51
+ const l$5 = ({ indicator: r2, title: t2 }) => /* @__PURE__ */ jsxs(t$3, { children: [
52
+ /* @__PURE__ */ jsx(a$5, { children: r2 }),
53
+ /* @__PURE__ */ jsx(e$8, { children: t2 })
54
+ ] });
55
+ const o$4 = /* @__PURE__ */ styled_default("div")({
56
+ name: "Container",
57
+ class: "c1yrpn9o",
58
+ propsAsIs: false
59
+ }), n$2 = /* @__PURE__ */ styled_default("div")({
60
+ name: "TopInfo",
61
+ class: "t17fwahh",
62
+ propsAsIs: false
63
+ }), e$7 = /* @__PURE__ */ styled_default("div")({
64
+ name: "BottomInfo",
65
+ class: "by6w7e9",
66
+ propsAsIs: false
67
+ }), t$2 = /* @__PURE__ */ styled_default("div")({
68
+ name: "User",
69
+ class: "u1g7arbm",
70
+ propsAsIs: false
71
+ }), r$4 = /* @__PURE__ */ styled_default("img")({
72
+ name: "Avatar",
73
+ class: "a1ldeata",
74
+ propsAsIs: false
75
+ }), c$4 = /* @__PURE__ */ styled_default("div")({
76
+ name: "UserInfo",
77
+ class: "u10d4koz",
78
+ propsAsIs: false
79
+ }), l$4 = /* @__PURE__ */ styled_default("div")({
80
+ name: "UserName",
81
+ class: "u1q6roj0",
82
+ propsAsIs: false
83
+ }), p$5 = /* @__PURE__ */ styled_default("div")({
84
+ name: "UserRating",
85
+ class: "ui0m425",
86
+ propsAsIs: false
87
+ }), i$4 = /* @__PURE__ */ styled_default("img")({
88
+ name: "TrophyIcon",
89
+ class: "t1el3mrn",
90
+ propsAsIs: false
91
+ }), m$3 = /* @__PURE__ */ styled_default("div")({
92
+ name: "RtsContainer",
93
+ class: "r2vgnxv",
94
+ propsAsIs: false
95
+ }), d$2 = /* @__PURE__ */ styled_default("div")({
96
+ name: "RtsDivider",
97
+ class: "roqn06j",
98
+ propsAsIs: false
99
+ }), f$1 = /* @__PURE__ */ styled_default("div")({
100
+ name: "Rts",
101
+ class: "r15adx7c",
102
+ propsAsIs: false
103
+ }), I$2 = /* @__PURE__ */ styled_default("div")({
104
+ name: "RtsIndicator",
105
+ class: "rv59lta",
106
+ propsAsIs: false
107
+ }), v$1 = /* @__PURE__ */ styled_default("div")({
108
+ name: "RtsLabel",
109
+ class: "r55lotb",
110
+ propsAsIs: false
111
+ }), A$1 = /* @__PURE__ */ styled_default("div")({
112
+ name: "Divider",
113
+ class: "d1knfgqt",
114
+ propsAsIs: false
115
+ }), R = /* @__PURE__ */ styled_default("div")({
116
+ name: "Ranks",
117
+ class: "r1mqo824",
118
+ propsAsIs: false
119
+ }), U = /* @__PURE__ */ styled_default("div")({
120
+ name: "Statistics",
121
+ class: "sxareh6",
122
+ propsAsIs: false
123
+ }), u$1 = /* @__PURE__ */ styled_default("div")({
124
+ name: "AvatarPlaceholder",
125
+ class: "amcu48h",
126
+ propsAsIs: false
127
+ }), h = /* @__PURE__ */ styled_default("button")({
128
+ name: "UserAccountBtn",
129
+ class: "u32nfkp",
130
+ propsAsIs: false
131
+ });
132
+ const F = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", z$1 = ({
133
+ loading: t2,
134
+ hideFriendsRank: n2,
135
+ avatar: l2,
136
+ name: o2,
137
+ points: s2,
138
+ friendsRank: m2,
139
+ rank: C2,
140
+ streak: p2,
141
+ correct: f2,
142
+ incorrect: v2,
143
+ inTop: L,
144
+ successRate: g2
145
+ }) => /* @__PURE__ */ jsxs(o$4, { "data-loading": t2, children: [
146
+ /* @__PURE__ */ jsx(n$2, { children: /* @__PURE__ */ jsx(i$5, { loading: t2, children: /* @__PURE__ */ jsxs(t$2, { children: [
147
+ /* @__PURE__ */ jsxs(h, { children: [
148
+ l2 && /* @__PURE__ */ jsx(r$4, { alt: "avatar", src: l2 }),
149
+ !l2 && /* @__PURE__ */ jsx(u$1, { children: I$4(o2 || "") })
150
+ ] }),
151
+ /* @__PURE__ */ jsxs(c$4, { children: [
152
+ /* @__PURE__ */ jsx(l$4, { children: o2 }),
153
+ /* @__PURE__ */ jsxs(p$5, { children: [
154
+ /* @__PURE__ */ jsxs(m$3, { children: [
155
+ /* @__PURE__ */ jsxs(f$1, { children: [
156
+ /* @__PURE__ */ jsx(i$4, { alt: "rank-icon", src: F }),
157
+ /* @__PURE__ */ jsxs(I$2, { children: [
158
+ s$3(s2),
159
+ /* @__PURE__ */ jsx(v$1, { children: "PTS" })
160
+ ] })
161
+ ] }),
162
+ n2 && /* @__PURE__ */ jsxs(I$2, { children: [
163
+ /* @__PURE__ */ jsx(d$2, {}),
164
+ C2 || 0,
165
+ /* @__PURE__ */ jsx(v$1, { children: "global rank" })
166
+ ] })
167
+ ] }),
168
+ !n2 && /* @__PURE__ */ jsxs(Fragment, { children: [
169
+ /* @__PURE__ */ jsx(A$1, {}),
170
+ /* @__PURE__ */ jsxs("div", { children: [
171
+ "TOP ",
172
+ L || 0,
173
+ "%"
174
+ ] })
175
+ ] })
176
+ ] })
177
+ ] })
178
+ ] }) }) }),
179
+ /* @__PURE__ */ jsxs(e$7, { children: [
180
+ !n2 && /* @__PURE__ */ jsxs(R, { children: [
181
+ /* @__PURE__ */ jsx(i$5, { loading: t2, style: { width: "100%" }, children: /* @__PURE__ */ jsx(m$4, { indicator: m2 || 0, title: "Friends rank" }) }),
182
+ /* @__PURE__ */ jsx(i$5, { loading: t2, style: { width: "100%" }, children: /* @__PURE__ */ jsx(m$4, { indicator: C2 || 0, title: "Global rank" }) })
183
+ ] }),
184
+ /* @__PURE__ */ jsx(i$5, { loading: t2, children: /* @__PURE__ */ jsxs(U, { children: [
185
+ /* @__PURE__ */ jsx(l$5, { indicator: p2 || 0, title: "Win streak" }),
186
+ /* @__PURE__ */ jsx(l$5, { indicator: f2 || 0, title: "Correct" }),
187
+ /* @__PURE__ */ jsx(l$5, { indicator: v2 || 0, title: "Incorrect" }),
188
+ /* @__PURE__ */ jsx(l$5, { indicator: `${g2 || 0}%`, title: "Succ. rate" })
189
+ ] }) })
190
+ ] })
191
+ ] });
192
+ const t$1 = /* @__PURE__ */ styled_default("div")({
193
+ name: "Container",
194
+ class: "c115qtkr",
195
+ propsAsIs: false
196
+ }), n$1 = /* @__PURE__ */ styled_default("div")({
197
+ name: "STabs",
198
+ class: "sxnslc8",
199
+ propsAsIs: false
200
+ }), o$3 = /* @__PURE__ */ styled_default("button")({
201
+ name: "Button",
202
+ class: "b1umzux0",
203
+ propsAsIs: false
204
+ }), e$6 = /* @__PURE__ */ styled_default("span")({
205
+ name: "Title",
206
+ class: "tspsaas",
207
+ propsAsIs: false
208
+ });
209
+ var m$2 = /* @__PURE__ */ ((r2) => (r2.HOME = "home", r2.LEADERBOARD = "leaderboard", r2))(m$2 || {});
210
+ const o$2 = ({ title: r2, active: e2, onClick: n2 }) => /* @__PURE__ */ jsx(o$3, { "data-a": "intr", onClick: n2, "data-selected": e2, children: /* @__PURE__ */ jsx(e$6, { "data-a": "intr", children: r2 }) }), b$1 = ({ activePage: r2 = "home", toggleActivePage: e2 }) => /* @__PURE__ */ jsx(t$1, { children: /* @__PURE__ */ jsxs(n$1, { "data-position": r2 === "home" ? "left" : "right", children: [
211
+ /* @__PURE__ */ jsx(o$2, { title: "Home", active: r2 === "home", onClick: () => e2(
212
+ "home"
213
+ /* HOME */
214
+ ) }),
215
+ /* @__PURE__ */ jsx(
216
+ o$2,
217
+ {
218
+ title: "Friends",
219
+ active: r2 === "leaderboard",
220
+ onClick: () => e2(
221
+ "leaderboard"
222
+ /* LEADERBOARD */
223
+ )
224
+ }
225
+ )
226
+ ] }) });
227
+ const n = /* @__PURE__ */ styled_default("button")({
228
+ name: "Container",
229
+ class: "cpjnajb",
230
+ propsAsIs: false
231
+ }), a$4 = /* @__PURE__ */ styled_default("div")({
232
+ name: "Content",
233
+ class: "c4m6kaz",
234
+ propsAsIs: false
235
+ }), e$5 = /* @__PURE__ */ styled_default("span")({
236
+ name: "Title",
237
+ class: "t1h8t9cc",
238
+ propsAsIs: false
239
+ });
240
+ const s$2 = () => /* @__PURE__ */ jsx(n, { children: /* @__PURE__ */ jsxs(a$4, { children: [
241
+ /* @__PURE__ */ jsx(B1, { name: "iconCopySuccess" }),
242
+ /* @__PURE__ */ jsx(e$5, { children: "Link Copied to Clipboard" })
243
+ ] }) });
244
+ const T = (r2) => {
245
+ const t2 = useRef(), [i2, o2] = useState(null), a2 = useCallback(
246
+ async (e2) => {
247
+ var c2;
248
+ if (e2 && ((c2 = navigator == null ? void 0 : navigator.clipboard) != null && c2.writeText)) {
249
+ t2.current && (clearTimeout(t2.current), o2(null));
250
+ try {
251
+ await navigator.clipboard.writeText(e2), r2.current && (o2(Df.createPortal(/* @__PURE__ */ jsx(s$2, {}), r2.current)), t2.current = setTimeout(() => {
252
+ o2(null);
253
+ }, 1e3));
254
+ } catch (n2) {
255
+ console.error("Unable to copy to clipboard", n2);
256
+ }
257
+ }
258
+ },
259
+ [r2]
260
+ );
261
+ return useEffect(() => () => {
262
+ clearTimeout(t2.current);
263
+ }, []), [a2, i2];
264
+ };
265
+ const r$3 = /* @__PURE__ */ styled_default("div")({
266
+ name: "Container",
267
+ class: "c1ux29ft",
268
+ propsAsIs: false
269
+ }), o$1 = () => B1, a$3 = /* @__PURE__ */ styled_default(o$1())({
270
+ name: "FriendsIcon",
271
+ class: "f10ncfg2",
272
+ propsAsIs: true
273
+ }), p$4 = /* @__PURE__ */ styled_default("div")({
274
+ name: "Content",
275
+ class: "c1yc07bd",
276
+ propsAsIs: false
277
+ }), i$3 = /* @__PURE__ */ styled_default("div")({
278
+ name: "Title",
279
+ class: "tj6cq7w",
280
+ propsAsIs: false
281
+ }), l$3 = /* @__PURE__ */ styled_default("div")({
282
+ name: "Description",
283
+ class: "d1ag78xo",
284
+ propsAsIs: false
285
+ }), e$4 = () => B1, I$1 = /* @__PURE__ */ styled_default(e$4())({
286
+ name: "ArrowInviteIcon",
287
+ class: "awohrz6",
288
+ propsAsIs: true
289
+ });
290
+ const C$1 = ({ title: o2, description: t2, onClick: r2, className: e2 }) => {
291
+ const [c2] = f$2({
292
+ type: "invitation",
293
+ action: "sent",
294
+ payload: {
295
+ from: InvitationFrom.TITLE_CARD
296
+ }
297
+ });
298
+ return /* @__PURE__ */ jsxs(r$3, { "data-a": "intr", onClick: c2(r2), className: e2, children: [
299
+ /* @__PURE__ */ jsx(a$3, { name: "icon-friends" }),
300
+ /* @__PURE__ */ jsxs(p$4, { children: [
301
+ /* @__PURE__ */ jsx(i$3, { children: o2 }),
302
+ /* @__PURE__ */ jsx(l$3, { children: t2 })
303
+ ] }),
304
+ /* @__PURE__ */ jsx(I$1, { name: "icon-copy" })
305
+ ] });
306
+ };
307
+ const r$2 = /* @__PURE__ */ styled_default("div")({
308
+ name: "Container",
309
+ class: "culdu4a",
310
+ propsAsIs: false
311
+ }), t = /* @__PURE__ */ styled_default("div")({
312
+ name: "Position",
313
+ class: "pwf8e69",
314
+ propsAsIs: false
315
+ }), c$3 = /* @__PURE__ */ styled_default("img")({
316
+ name: "Avatar",
317
+ class: "atf4yh4",
318
+ propsAsIs: false
319
+ }), p$3 = /* @__PURE__ */ styled_default("div")({
320
+ name: "AvatarPlaceholder",
321
+ class: "a1dg29ja",
322
+ propsAsIs: false
323
+ }), l$2 = /* @__PURE__ */ styled_default("div")({
324
+ name: "Content",
325
+ class: "c10a68rc",
326
+ propsAsIs: false
327
+ }), m$1 = /* @__PURE__ */ styled_default("div")({
328
+ name: "NameContainer",
329
+ class: "nc4kck5",
330
+ propsAsIs: false
331
+ }), i$2 = /* @__PURE__ */ styled_default("span")({
332
+ name: "Name",
333
+ class: "njsrqgr",
334
+ propsAsIs: false
335
+ }), e$3 = () => B1, d$1 = /* @__PURE__ */ styled_default(e$3())({
336
+ name: "CurrentUserBadge",
337
+ class: "c17uc4zr",
338
+ propsAsIs: true
339
+ });
340
+ const N = ({
341
+ friendsRank: i2,
342
+ avatar: a2,
343
+ name: t$12,
344
+ userId: n2,
345
+ points: o2,
346
+ isCurrentUser: d2,
347
+ style: m2
348
+ }) => /* @__PURE__ */ jsxs(r$2, { "data-name": n2, style: m2, children: [
349
+ /* @__PURE__ */ jsx(t, { children: i2 || 0 }),
350
+ /* @__PURE__ */ jsxs(l$2, { children: [
351
+ a2 ? /* @__PURE__ */ jsx(c$3, { alt: "leaderboard-item-avatar", src: a2 }) : /* @__PURE__ */ jsx(p$3, { children: I$4(t$12 || "") }),
352
+ /* @__PURE__ */ jsxs(m$1, { children: [
353
+ /* @__PURE__ */ jsx(i$2, { children: t$12 || "" }),
354
+ d2 && /* @__PURE__ */ jsx(d$1, { name: "icon-star" })
355
+ ] })
356
+ ] }),
357
+ /* @__PURE__ */ jsx("div", { children: s$3(o2) })
358
+ ] });
359
+ const u = /* @__PURE__ */ styled_default("div")({
360
+ name: "Container",
361
+ class: "c16btbfp",
362
+ propsAsIs: false
363
+ }), S = ({
364
+ items: s2,
365
+ currentUserId: e2,
366
+ openItemDetail: o2,
367
+ fetchMore: n2,
368
+ scrollNode: i2,
369
+ hasMore: d2
370
+ }) => {
371
+ const l2 = useCallback((r2) => {
372
+ const a2 = r2.target.getAttribute("data-name");
373
+ a2 && o2(a2);
374
+ }, [o2]);
375
+ return /* @__PURE__ */ jsx(m$5, {
376
+ loadMore: n2,
377
+ initialLoad: false,
378
+ hasMore: d2,
379
+ useWindow: false,
380
+ getScrollParent: () => i2.current,
381
+ children: /* @__PURE__ */ jsx(u, {
382
+ "data-a": "intr",
383
+ onClick: l2,
384
+ children: s2.map((r2) => /* @__PURE__ */ jsx(N, {
385
+ ...r2,
386
+ isCurrentUser: !!e2 && e2 === r2.userId
387
+ }, r2.userId))
388
+ })
389
+ });
390
+ };
391
+ const i$1 = /* @__PURE__ */ styled_default("div")({
392
+ name: "Container",
393
+ class: "c1itm4k7",
394
+ propsAsIs: false
395
+ }), c$2 = /* @__PURE__ */ styled_default("div")({
396
+ name: "IconContainer",
397
+ class: "i1w4fsni",
398
+ propsAsIs: false
399
+ }), e$2 = () => B1, l$1 = /* @__PURE__ */ styled_default(e$2())({
400
+ name: "InviteGameIcon",
401
+ class: "i19m85r1",
402
+ propsAsIs: true
403
+ }), p$2 = /* @__PURE__ */ styled_default("div")({
404
+ name: "Content",
405
+ class: "c1mbu204",
406
+ propsAsIs: false
407
+ }), r$1 = /* @__PURE__ */ styled_default("div")({
408
+ name: "Heading",
409
+ class: "h1amdqtv",
410
+ propsAsIs: false
411
+ }), m = /* @__PURE__ */ styled_default("div")({
412
+ name: "Subtext",
413
+ class: "s1lhlj9j",
414
+ propsAsIs: false
415
+ }), I = /* @__PURE__ */ styled_default("div")({
416
+ name: "LinkContainer",
417
+ class: "l1wot35e",
418
+ propsAsIs: false
419
+ }), d = /* @__PURE__ */ styled_default("div")({
420
+ name: "LinkInfo",
421
+ class: "l1jdw39q",
422
+ propsAsIs: false
423
+ }), f = /* @__PURE__ */ styled_default("span")({
424
+ name: "LinkTitle",
425
+ class: "l1cr5mk",
426
+ propsAsIs: false
427
+ }), v = /* @__PURE__ */ styled_default("span")({
428
+ name: "LinkAddress",
429
+ class: "lvi87q4",
430
+ propsAsIs: false
431
+ }), o = () => B1, A = /* @__PURE__ */ styled_default(o())({
432
+ name: "LinkIcon",
433
+ class: "l1pqlvw3",
434
+ propsAsIs: true
435
+ });
436
+ const M = ({
437
+ inviteLink: i2,
438
+ inviteCardTitle: e2,
439
+ inviteCardSubtext: t2,
440
+ primaryColor: c2,
441
+ className: a2
442
+ }) => {
443
+ const r2 = useRef(null), [l2, d$12] = T(r2), [m$12] = f$2({
444
+ type: "invitation",
445
+ action: "sent",
446
+ payload: {
447
+ from: InvitationFrom.MENU
448
+ }
449
+ });
450
+ return /* @__PURE__ */ jsxs(i$1, { className: a2, children: [
451
+ /* @__PURE__ */ jsx(c$2, { style: { backgroundColor: c2 }, children: /* @__PURE__ */ jsx(l$1, { name: "invite-game-icon" }) }),
452
+ /* @__PURE__ */ jsxs(p$2, { children: [
453
+ /* @__PURE__ */ jsx(r$1, { children: e2 || "" }),
454
+ /* @__PURE__ */ jsx(m, { children: t2 || "" })
455
+ ] }),
456
+ i2 && /* @__PURE__ */ jsxs(I, { ref: r2, "data-a": "intr", onClick: m$12(() => l2(i2)), children: [
457
+ /* @__PURE__ */ jsxs(d, { children: [
458
+ /* @__PURE__ */ jsx(f, { children: "Invite link" }),
459
+ /* @__PURE__ */ jsx(v, { children: i2 })
460
+ ] }),
461
+ /* @__PURE__ */ jsx(A, { name: "icon-copy" })
462
+ ] }),
463
+ d$12
464
+ ] });
465
+ };
466
+ const r = /* @__PURE__ */ styled_default("div")({
467
+ name: "InviteFriendsContainer",
468
+ class: "i1c9dygq",
469
+ propsAsIs: false
470
+ }), a$2 = ({
471
+ deepLink: i2
472
+ }) => /* @__PURE__ */ jsx(r, {
473
+ children: /* @__PURE__ */ jsx(M, {
474
+ inviteLink: i2,
475
+ inviteCardTitle: "It’s More Fun With Friends",
476
+ inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
477
+ })
478
+ });
479
+ const C = /* @__PURE__ */ styled_default("div")({
480
+ name: "InviteLinkContainer",
481
+ class: "i1odbhm4",
482
+ propsAsIs: false
483
+ }), z = ({
484
+ gamification: e2,
485
+ scrollNode: s2,
486
+ scrollStore: p2
487
+ }) => {
488
+ const o2 = useRef(null), {
489
+ data: i2,
490
+ hasMore: d2,
491
+ loading: m2,
492
+ key: a2
493
+ } = useStore(e2.leaderboardList.$store), {
494
+ data: t2
495
+ } = useStore(e2.deepLink.$store), [l2, c2] = T(o2);
496
+ return !i2.length && !m2 ? /* @__PURE__ */ jsx(a$2, {
497
+ deepLink: t2
498
+ }) : /* @__PURE__ */ jsxs(Fragment, {
499
+ children: [/* @__PURE__ */ jsx(S, {
500
+ items: i2,
501
+ scrollNode: s2,
502
+ scrollStore: p2,
503
+ fetchMore: e2.leaderboardList.fetchMore,
504
+ hasMore: d2,
505
+ openItemDetail: e2.openUser,
506
+ currentUserId: e2.currentUserId.get()
507
+ }, a2), t2 && /* @__PURE__ */ jsx(C, {
508
+ ref: o2,
509
+ children: /* @__PURE__ */ jsx(C$1, {
510
+ "data-a": "intr",
511
+ onClick: () => l2(t2),
512
+ title: "Invite Friends",
513
+ description: "Challenge them now!"
514
+ })
515
+ }), c2]
516
+ });
517
+ };
518
+ const s$1 = () => r$5, i = /* @__PURE__ */ styled_default(s$1())({
519
+ name: "Container",
520
+ class: "cll3md7",
521
+ propsAsIs: true
522
+ }), e$1 = () => S$1, p$1 = /* @__PURE__ */ styled_default(e$1())({
523
+ name: "ActionBtn",
524
+ class: "a10g1iik",
525
+ propsAsIs: true
526
+ });
527
+ const c$1 = ({ questionId: t2, ...r2 }) => /* @__PURE__ */ jsxs(i, { "data-a": "intr", "data-name": t2, children: [
528
+ /* @__PURE__ */ jsx(O, { questionId: t2, ...r2 }),
529
+ /* @__PURE__ */ jsx(p$1, { "data-a": "intr", "data-name": t2, children: "View Insight" })
530
+ ] });
531
+ const s = () => r$5, a$1 = /* @__PURE__ */ styled_default(s())({
532
+ name: "Container",
533
+ class: "cl56x6b",
534
+ propsAsIs: true
535
+ }), c = /* @__PURE__ */ styled_default("button")({
536
+ name: "ActionButton",
537
+ class: "a11pzf92",
538
+ propsAsIs: false
539
+ }), p = /* @__PURE__ */ styled_default("blockquote")({
540
+ name: "Quote",
541
+ class: "q1hbaleq",
542
+ propsAsIs: false
543
+ });
544
+ const l = ({ ...t2 }) => /* @__PURE__ */ jsxs(a$1, { "data-a": "intr", "data-name": t2.tweetId, children: [
545
+ t2.title && /* @__PURE__ */ jsx(p, { children: t2.title }),
546
+ /* @__PURE__ */ jsx(b$2, { ...t2 }),
547
+ /* @__PURE__ */ jsx(c, { "data-a": "intr", "data-name": t2.tweetId, children: "View Insight" })
548
+ ] });
549
+ const e = /* @__PURE__ */ styled_default("div")({
550
+ name: "QuestionsContainer",
551
+ class: "qvghv3l",
552
+ propsAsIs: false
553
+ });
554
+ const k = ({ questions: n2, openQuestion: b2, controlVideo: a2 }) => {
555
+ const l$12 = (t2) => {
556
+ const e2 = t2.target.getAttribute("data-name");
557
+ e2 && (wt(), b2(e2, { openedFrom: "list" }));
558
+ };
559
+ return n2 ? /* @__PURE__ */ jsx(e, { "data-a": "intr", onClick: l$12, children: n2 == null ? void 0 : n2.map((t2) => {
560
+ var e2, u2, s2;
561
+ if (t2.type === "question" && ((e2 = t2.attributes) == null ? void 0 : e2.attributes.case) === "question") {
562
+ const i2 = t2.attributes.attributes.value;
563
+ return /* @__PURE__ */ jsx(R$1, { ...i2 }, i2.questionId);
564
+ }
565
+ if (t2.type === "insight" && ((u2 = t2.attributes) == null ? void 0 : u2.attributes.case) === "insight") {
566
+ const i2 = t2.attributes.attributes.value;
567
+ return /* @__PURE__ */ jsx(c$1, { controlVideo: a2, ...i2 }, i2.questionId);
568
+ }
569
+ if (t2.type === "tweet" && ((s2 = t2.attributes) == null ? void 0 : s2.attributes.case) === "tweet") {
570
+ const i2 = t2.attributes.attributes.value, o2 = t2.attributes.id;
571
+ return /* @__PURE__ */ jsx(l, { controlVideo: a2, ...i2, tweetId: o2 }, o2);
572
+ }
573
+ return null;
574
+ }) }) : /* @__PURE__ */ jsx(e, { children: Array.from({ length: 5 }).map((t2, e2) => /* @__PURE__ */ jsx(D, {}, e2)) });
575
+ };
576
+ const a = ({ store: t2, openQuestion: r2 }) => {
577
+ const { sdk: o2 } = p$6(), e2 = useStore(t2);
578
+ return /* @__PURE__ */ jsx(k, { openQuestion: r2, questions: e2.data, controlVideo: o2 == null ? void 0 : o2.controlVideoPlayer });
579
+ };
580
+ const b = ({ userSummary: r2 }) => {
581
+ var e2;
582
+ const [t2, s2] = useState(void 0);
583
+ return useEffect(() => {
584
+ const c2 = r2.$store.subscribe((o2) => {
585
+ o2 && s2(o2);
586
+ });
587
+ return () => {
588
+ c2();
589
+ };
590
+ }, [r2]), /* @__PURE__ */ jsx(z$1, { loading: !(t2 != null && t2.summary), ...t2 == null ? void 0 : t2.summary, successRate: (e2 = t2 == null ? void 0 : t2.percentage) == null ? void 0 : e2.correct });
591
+ };
592
+ const W = ({ gamification: s2, className: w, scrollStore: t2, scrollNode: y, appNode: c2, style: k2, responsiveStore: i2 }) => {
593
+ const { tabsShown: u2 } = useStore(t2, { keys: ["tabsShown"] }), o2 = useStore(s2.friendsTabEnabled), [a$12, h2] = useState(m$2.HOME), [, T2] = useTransition(), { sdkInDesktopView: l2, screen: g2 } = useStore(i2, { keys: ["sdkInDesktopView"] }), x = (r2) => {
594
+ T2(() => {
595
+ var b2;
596
+ h2(r2), l2 === false && (((b2 = c2.current) == null ? void 0 : b2.getBoundingClientRect().y) || 0) < 0 && I$3(c2, g2.size, { behavior: "instant" });
597
+ });
598
+ };
599
+ useEffect(() => t2.subscribe((r2) => {
600
+ if (r2.scrollPosition === 0) {
601
+ t2.setKey("tabsShown", true);
602
+ return;
603
+ }
604
+ i2.get().sdkInDesktopView ? t2.setKey("tabsShown", r2.scrollDirection === "backward") : t2.setKey("tabsShown", r2.scrollDirection === "forward");
605
+ }), [t2, i2]), useEffect(() => {
606
+ o2 || h2(m$2.HOME);
607
+ }, [o2]);
608
+ let m2 = "0px";
609
+ return l2 ? m2 = u2 ? "0px" : "calc(0px - var(--header-height))" : m2 = u2 ? "var(--header-height)" : "0px", /* @__PURE__ */ jsxs(l$6, { className: cx_default(w, "SL-Tabs", "sl-hide-on-modal"), style: k2, children: [
610
+ o2 && /* @__PURE__ */ jsx(
611
+ S$2,
612
+ {
613
+ style: {
614
+ top: m2
615
+ },
616
+ children: /* @__PURE__ */ jsx(b$1, { activePage: a$12, toggleActivePage: x })
617
+ }
618
+ ),
619
+ a$12 === m$2.HOME && /* @__PURE__ */ jsxs(Fragment, { children: [
620
+ /* @__PURE__ */ jsx(m$6, { children: /* @__PURE__ */ jsx(d$3, { children: /* @__PURE__ */ jsx(b, { userSummary: s2.userSummary }) }) }),
621
+ /* @__PURE__ */ jsx(n$4, { style: { flex: 1 }, children: /* @__PURE__ */ jsx(a, { openQuestion: s2.openQuestion, store: s2.feedList.getStore() }) })
622
+ ] }),
623
+ a$12 === m$2.LEADERBOARD && /* @__PURE__ */ jsx(C$2, { children: /* @__PURE__ */ jsx(z, { scrollStore: t2, scrollNode: y, gamification: s2 }) })
624
+ ] });
625
+ };
626
+ const g = ({
627
+ gamification: e2,
628
+ scrollStore: t2,
629
+ className: n2,
630
+ appNode: r2,
631
+ scrollNode: p2,
632
+ responsiveStore: a2
633
+ }) => /* @__PURE__ */ jsx(W, {
634
+ appNode: r2,
635
+ scrollStore: t2,
636
+ scrollNode: p2,
637
+ className: n2,
638
+ gamification: e2,
639
+ responsiveStore: a2
640
+ });
641
+ export {
642
+ g as default
643
+ };
@@ -1,13 +1,14 @@
1
1
  import "react/jsx-runtime";
2
- import { x, y, Z, G } from "./index2.js";
2
+ import "./index3.js";
3
3
  import "nanostores";
4
+ import { S, a, c, p } from "./index2.js";
4
5
  import "react";
5
6
  import "@nanostores/react";
6
7
  import "lodash.throttle";
7
8
  import "react-countup";
8
9
  export {
9
- x as StreamLayerProvider,
10
- y as StreamLayerSDKTv,
11
- Z as useStreamLayer,
12
- G as useStreamLayerUI
10
+ S as StreamLayerProvider,
11
+ a as StreamLayerSDKTv,
12
+ c as useStreamLayer,
13
+ p as useStreamLayerUI
13
14
  };