@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/index2.js CHANGED
@@ -1,933 +1,1062 @@
1
- var Ce = Object.defineProperty;
2
- var Ee = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var k = (e, t, n) => Ee(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { useState as S, useEffect as y, useRef as L, PureComponent as Re, useCallback as j, lazy as xe, useMemo as C, Suspense as Le, forwardRef as be, useLayoutEffect as Te, useContext as Y } from "react";
5
- import { c as Z, F as De, z as Oe, Y as X } from "./hooks-B0Qttldg.js";
6
- import { jsx as i, jsxs as f, Fragment as T } from "react/jsx-runtime";
7
- import { I as _e, S as N, f as x, h as ee, Q as w } from "./useStreamLayerApp2.js";
8
- import { h as Me } from "./index7.js";
9
- import { A as O, u as v, s as u, b as Ue, c as E, a as P } from "./sl-types.js";
10
- import { l as Be, a as Fe, m as ze, d as Pe, n as Ve, C as qe, S as je, b as Ke, f as W, p as Qe, c as We } from "./index10.js";
11
- import { M as Ge, a as He, k as Je, z as ke, c as ye, T as Ne, I as Ye, t as Ze, f as Xe, w as te, D as et, p as tt } from "./index15.js";
12
- import K from "lodash.throttle";
13
- import { f as Se, a as nt, b as st, A as ot } from "./analytics.js";
14
- import { m as F } from "./theme.js";
15
- import { F as it, c as U, e as at } from "./index3.js";
16
- import "nanostores";
17
- import { p as G, h as rt, e as lt } from "./Question.js";
18
- import { y as dt } from "./index9.js";
19
- import { B as D } from "./index6.js";
20
- import ct from "react-infinite-scroller";
21
- import { I as pt, s as ut, e as mt } from "./index11.js";
22
- import "uuid";
23
- import "@nanostores/query";
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { M as M$1, a as T$1, k, z as z$3, c as createSingleStore, T as T$2, I as I$4, t as tn, f as f$6, w as w$2, D as D$2, p as p$5 } from "./index16.js";
5
+ import { useState, useEffect, useRef, PureComponent, useCallback, lazy, useMemo, Suspense, forwardRef, useLayoutEffect, useContext } from "react";
6
+ import { i as i$7, F as F$2, z as z$4, Y } from "./hooks-WfHlJH12.js";
7
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
8
+ import { I as InvitationFrom, S as SdkOverlayType, f as Code, i as createContextKey, Q as QuestionType } from "./useStreamLayerApp2.js";
9
+ import { h as h$1 } from "./index8.js";
10
+ import { A as A$2, u as useStore, s as styled_default, b as useTransition, c as cx_default, a as NotificationType } from "./sl-types.js";
11
+ import { l as l$3, a as S$1, m as m$5, d as d$4, n as n$4, C as C$2, S as S$2, b as a$5, f as f$5, p as p$4, c as c$5 } from "./index11.js";
12
+ import i$6 from "lodash.throttle";
13
+ import { f as f$3, a as f$4, b as b$3, A as A$3 } from "./analytics.js";
14
+ import { m as m$6 } from "./theme.js";
15
+ import { F as FeatureStatus, c as createLogger } from "./feature.js";
16
+ import { p as p$3, h as ht, e as e$8 } from "./Question.js";
17
+ import { y as y$1 } from "./index10.js";
18
+ import { B as B1 } from "./index6.js";
19
+ import m$4 from "react-infinite-scroller";
20
+ import { I as I$3, s, e as e$7 } from "./index12.js";
24
21
  import "./storage.js";
25
- import { createPortal as ht } from "react-dom";
22
+ import "./index7.js";
23
+ import { createPortal } from "react-dom";
24
+ import { e as eventBus } from "./index3.js";
26
25
  import "./notification.js";
27
- const ne = Object.keys(O), se = () => {
28
- const e = window.innerWidth;
29
- let t = "sm";
30
- for (let n = ne.length - 1; n > 0; n--) {
31
- const o = ne[n];
32
- if (!(e < O[o]) && e >= O[o]) {
33
- t = o;
26
+ const o$5 = Object.keys(A$2), c$4 = () => {
27
+ const t2 = window.innerWidth;
28
+ let e2 = "sm";
29
+ for (let n2 = o$5.length - 1; n2 > 0; n2--) {
30
+ const s2 = o$5[n2];
31
+ if (!(t2 < A$2[s2]) && t2 >= A$2[s2]) {
32
+ e2 = s2;
34
33
  break;
35
34
  }
36
35
  }
37
36
  return {
38
- name: t,
39
- size: O[t]
37
+ name: e2,
38
+ size: A$2[e2]
40
39
  };
41
- }, oe = (e) => {
42
- var t;
43
- return (((t = e.current) == null ? void 0 : t.getBoundingClientRect().y) || 0) < -68;
44
- }, V = () => window.matchMedia("(orientation: landscape)").matches, vt = (e) => {
45
- const [t] = S(() => Se({
46
- screen: se(),
47
- sdkInView: oe(e),
48
- sdkInDesktopView: V()
40
+ }, d$3 = (t2) => {
41
+ var e2;
42
+ return (((e2 = t2.current) == null ? void 0 : e2.getBoundingClientRect().y) || 0) < -68;
43
+ }, w$1 = () => window.matchMedia("(orientation: landscape)").matches, h = (t2) => {
44
+ const [e2] = useState(() => f$3({
45
+ screen: c$4(),
46
+ sdkInView: d$3(t2),
47
+ sdkInDesktopView: w$1()
49
48
  }));
50
- return y(() => {
51
- const n = K(() => {
52
- t.setKey("sdkInView", oe(e));
53
- }, 200), o = K(() => {
54
- const s = se();
55
- t.setKey("screen", s), t.setKey("sdkInDesktopView", V());
49
+ return useEffect(() => {
50
+ const n2 = i$6(() => {
51
+ e2.setKey("sdkInView", d$3(t2));
52
+ }, 200), s2 = i$6(() => {
53
+ const k2 = c$4();
54
+ e2.setKey("screen", k2), e2.setKey("sdkInDesktopView", w$1());
56
55
  }, 200);
57
- return window.addEventListener("scroll", n), window.addEventListener("resize", o), () => {
58
- window.removeEventListener("scroll", n), window.removeEventListener("resize", o);
56
+ return window.addEventListener("scroll", n2), window.addEventListener("resize", s2), () => {
57
+ window.removeEventListener("scroll", n2), window.removeEventListener("resize", s2);
59
58
  };
60
- }, [t, e]), [t];
61
- }, H = (e, t, n) => {
62
- const o = t >= O.lg && t < O.xl ? 75 : 52;
63
- e.current && window.scrollTo({
64
- top: e.current.offsetTop - o,
65
- ...n
59
+ }, [e2, t2]), [e2];
60
+ };
61
+ const I$2 = (o2, e2, n2) => {
62
+ const t2 = e2 >= A$2.lg && e2 < A$2.xl ? 75 : 52;
63
+ o2.current && window.scrollTo({
64
+ top: o2.current.offsetTop - t2,
65
+ ...n2
66
66
  });
67
- }, ft = 15, gt = (e, t) => {
68
- const n = L(null), o = L(0), [s] = S(
69
- Se({
67
+ }, T = 15, L = (o2, e2) => {
68
+ const n2 = useRef(null), t2 = useRef(0), [s2] = useState(
69
+ f$3({
70
70
  scrollPosition: 0,
71
- tabsShown: !0,
71
+ tabsShown: true,
72
72
  scrollDirection: "forward"
73
73
  })
74
- ), r = v(t);
75
- return y(() => {
76
- const l = V() ? n.current : window;
77
- if (!l)
74
+ ), d2 = useStore(e2);
75
+ return useEffect(() => {
76
+ const c2 = w$1() ? n2.current : window;
77
+ if (!c2)
78
78
  return () => {
79
79
  };
80
- const d = K((a) => {
81
- var c;
82
- const m = a.target;
83
- if (!m)
80
+ const l2 = i$6((p2) => {
81
+ var f2;
82
+ const i2 = p2.target;
83
+ if (!i2)
84
84
  return;
85
- let p = 0;
86
- V() ? p = m.scrollTop : p = ((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0;
87
- const h = o.current - p;
88
- if (ft > Math.abs(h))
85
+ let r2 = 0;
86
+ w$1() ? r2 = i2.scrollTop : r2 = ((f2 = o2.current) == null ? void 0 : f2.getBoundingClientRect().y) || 0;
87
+ const w2 = t2.current - r2;
88
+ if (T > Math.abs(w2))
89
89
  return;
90
- const g = o.current < p ? "forward" : "backward";
91
- o.current = p, s.set({
92
- scrollPosition: Math.round(p),
93
- scrollDirection: g,
94
- tabsShown: s.get().tabsShown
90
+ const S2 = t2.current < r2 ? "forward" : "backward";
91
+ t2.current = r2, s2.set({
92
+ scrollPosition: Math.round(r2),
93
+ scrollDirection: S2,
94
+ tabsShown: s2.get().tabsShown
95
95
  });
96
96
  }, 200);
97
- return l.addEventListener("scroll", d), () => {
98
- l.removeEventListener("scroll", d);
97
+ return c2.addEventListener("scroll", l2), () => {
98
+ c2.removeEventListener("scroll", l2);
99
99
  };
100
- }, [s, e, r.screen]), [n, s];
101
- }, q = /* @__PURE__ */ u("div")({
100
+ }, [s2, o2, d2.screen]), [n2, s2];
101
+ };
102
+ const o$4 = /* @__PURE__ */ styled_default("div")({
102
103
  name: "LoadingContainer",
103
104
  class: "lclc0ej",
104
- propsAsIs: !1
105
- }), It = ({
106
- feature: e,
107
- sdk: t,
108
- children: n,
109
- className: o,
110
- noWait: s
105
+ propsAsIs: false
106
+ }), v$2 = ({
107
+ feature: n2,
108
+ sdk: a2,
109
+ children: s2,
110
+ className: r2,
111
+ noWait: d2
111
112
  }) => {
112
- const r = v(e.status), l = v(t.sdkStore.slStreamId);
113
- if (!s) {
114
- if (l != null && l.loading && !l.data)
115
- return /* @__PURE__ */ i(q, {
116
- className: o,
113
+ const f2 = useStore(n2.status), t2 = useStore(a2.sdkStore.slStreamId);
114
+ if (!d2) {
115
+ if (t2 != null && t2.loading && !t2.data)
116
+ return /* @__PURE__ */ jsx(o$4, {
117
+ className: r2,
117
118
  children: "Event is loading..."
118
119
  });
119
- if (!(l != null && l.data))
120
- return /* @__PURE__ */ i(q, {
121
- className: o,
120
+ if (!(t2 != null && t2.data))
121
+ return /* @__PURE__ */ jsx(o$4, {
122
+ className: r2,
122
123
  children: "Event is forbidden..."
123
124
  });
124
- if (r !== it.Ready)
125
- return /* @__PURE__ */ i(q, {
126
- className: o,
125
+ if (f2 !== FeatureStatus.Ready)
126
+ return /* @__PURE__ */ jsx(o$4, {
127
+ className: r2,
127
128
  children: "Wait feature..."
128
129
  });
129
130
  }
130
- return n;
131
- }, bt = /* @__PURE__ */ u("div")({
131
+ return s2;
132
+ };
133
+ const t$3 = /* @__PURE__ */ styled_default("div")({
132
134
  name: "Container",
133
135
  class: "c115qtkr",
134
- propsAsIs: !1
135
- }), kt = /* @__PURE__ */ u("div")({
136
+ propsAsIs: false
137
+ }), n$3 = /* @__PURE__ */ styled_default("div")({
136
138
  name: "STabs",
137
139
  class: "sxnslc8",
138
- propsAsIs: !1
139
- }), yt = /* @__PURE__ */ u("button")({
140
+ propsAsIs: false
141
+ }), o$3 = /* @__PURE__ */ styled_default("button")({
140
142
  name: "Button",
141
143
  class: "b1umzux0",
142
- propsAsIs: !1
143
- }), Nt = /* @__PURE__ */ u("span")({
144
+ propsAsIs: false
145
+ }), e$6 = /* @__PURE__ */ styled_default("span")({
144
146
  name: "Title",
145
147
  class: "tspsaas",
146
- propsAsIs: !1
148
+ propsAsIs: false
147
149
  });
148
- var M = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(M || {});
149
- const ie = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ i(yt, { "data-a": "intr", onClick: n, "data-selected": t, children: /* @__PURE__ */ i(Nt, { "data-a": "intr", children: e }) }), St = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ i(bt, { children: /* @__PURE__ */ f(kt, { "data-position": e === "home" ? "left" : "right", children: [
150
- /* @__PURE__ */ i(ie, { title: "Home", active: e === "home", onClick: () => t(
150
+ var m$3 = /* @__PURE__ */ ((r2) => (r2.HOME = "home", r2.LEADERBOARD = "leaderboard", r2))(m$3 || {});
151
+ 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$2 = ({ activePage: r2 = "home", toggleActivePage: e2 }) => /* @__PURE__ */ jsx(t$3, { children: /* @__PURE__ */ jsxs(n$3, { "data-position": r2 === "home" ? "left" : "right", children: [
152
+ /* @__PURE__ */ jsx(o$2, { title: "Home", active: r2 === "home", onClick: () => e2(
151
153
  "home"
152
154
  /* HOME */
153
155
  ) }),
154
- /* @__PURE__ */ i(
155
- ie,
156
+ /* @__PURE__ */ jsx(
157
+ o$2,
156
158
  {
157
159
  title: "Friends",
158
- active: e === "leaderboard",
159
- onClick: () => t(
160
+ active: r2 === "leaderboard",
161
+ onClick: () => e2(
160
162
  "leaderboard"
161
163
  /* LEADERBOARD */
162
164
  )
163
165
  }
164
166
  )
165
- ] }) }), $t = /* @__PURE__ */ u("div")({
167
+ ] }) });
168
+ const r$5 = /* @__PURE__ */ styled_default("div")({
166
169
  name: "Container",
167
170
  class: "c1ux29ft",
168
- propsAsIs: !1
169
- }), At = () => D, wt = /* @__PURE__ */ u(At())({
171
+ propsAsIs: false
172
+ }), o$1 = () => B1, a$4 = /* @__PURE__ */ styled_default(o$1())({
170
173
  name: "FriendsIcon",
171
174
  class: "f10ncfg2",
172
- propsAsIs: !0
173
- }), Ct = /* @__PURE__ */ u("div")({
175
+ propsAsIs: true
176
+ }), p$2 = /* @__PURE__ */ styled_default("div")({
174
177
  name: "Content",
175
178
  class: "c1yc07bd",
176
- propsAsIs: !1
177
- }), Et = /* @__PURE__ */ u("div")({
179
+ propsAsIs: false
180
+ }), i$5 = /* @__PURE__ */ styled_default("div")({
178
181
  name: "Title",
179
182
  class: "tj6cq7w",
180
- propsAsIs: !1
181
- }), Rt = /* @__PURE__ */ u("div")({
183
+ propsAsIs: false
184
+ }), l$2 = /* @__PURE__ */ styled_default("div")({
182
185
  name: "Description",
183
186
  class: "d1ag78xo",
184
- propsAsIs: !1
185
- }), xt = () => D, Lt = /* @__PURE__ */ u(xt())({
187
+ propsAsIs: false
188
+ }), e$5 = () => B1, I$1 = /* @__PURE__ */ styled_default(e$5())({
186
189
  name: "ArrowInviteIcon",
187
190
  class: "awohrz6",
188
- propsAsIs: !0
189
- }), Tt = ({ title: e, description: t, onClick: n, className: o }) => {
190
- const [s] = nt({
191
+ propsAsIs: true
192
+ });
193
+ const C$1 = ({ title: o2, description: t2, onClick: r2, className: e2 }) => {
194
+ const [c2] = f$4({
191
195
  type: "invitation",
192
196
  action: "sent",
193
197
  payload: {
194
- from: _e.TITLE_CARD
198
+ from: InvitationFrom.TITLE_CARD
195
199
  }
196
200
  });
197
- return /* @__PURE__ */ f($t, { "data-a": "intr", onClick: s(n), className: o, children: [
198
- /* @__PURE__ */ i(wt, { name: "icon-friends" }),
199
- /* @__PURE__ */ f(Ct, { children: [
200
- /* @__PURE__ */ i(Et, { children: e }),
201
- /* @__PURE__ */ i(Rt, { children: t })
201
+ return /* @__PURE__ */ jsxs(r$5, { "data-a": "intr", onClick: c2(r2), className: e2, children: [
202
+ /* @__PURE__ */ jsx(a$4, { name: "icon-friends" }),
203
+ /* @__PURE__ */ jsxs(p$2, { children: [
204
+ /* @__PURE__ */ jsx(i$5, { children: o2 }),
205
+ /* @__PURE__ */ jsx(l$2, { children: t2 })
202
206
  ] }),
203
- /* @__PURE__ */ i(Lt, { name: "icon-copy" })
207
+ /* @__PURE__ */ jsx(I$1, { name: "icon-copy" })
204
208
  ] });
205
209
  };
206
- function Dt(e) {
207
- var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, o = e.startIndex, s = e.stopIndex;
208
- return !(o > n || s < t);
210
+ function isRangeVisible(_ref) {
211
+ var lastRenderedStartIndex = _ref.lastRenderedStartIndex, lastRenderedStopIndex = _ref.lastRenderedStopIndex, startIndex = _ref.startIndex, stopIndex = _ref.stopIndex;
212
+ return !(startIndex > lastRenderedStopIndex || stopIndex < lastRenderedStartIndex);
209
213
  }
210
- function Ot(e) {
211
- for (var t = e.isItemLoaded, n = e.itemCount, o = e.minimumBatchSize, s = e.startIndex, r = e.stopIndex, l = [], d = null, a = null, c = s; c <= r; c++) {
212
- var m = t(c);
213
- m ? a !== null && (l.push(d, a), d = a = null) : (a = c, d === null && (d = c));
214
+ function scanForUnloadedRanges(_ref) {
215
+ var isItemLoaded = _ref.isItemLoaded, itemCount = _ref.itemCount, minimumBatchSize = _ref.minimumBatchSize, startIndex = _ref.startIndex, stopIndex = _ref.stopIndex;
216
+ var unloadedRanges = [];
217
+ var rangeStartIndex = null;
218
+ var rangeStopIndex = null;
219
+ for (var _index = startIndex; _index <= stopIndex; _index++) {
220
+ var loaded = isItemLoaded(_index);
221
+ if (!loaded) {
222
+ rangeStopIndex = _index;
223
+ if (rangeStartIndex === null) {
224
+ rangeStartIndex = _index;
225
+ }
226
+ } else if (rangeStopIndex !== null) {
227
+ unloadedRanges.push(rangeStartIndex, rangeStopIndex);
228
+ rangeStartIndex = rangeStopIndex = null;
229
+ }
214
230
  }
215
- if (a !== null) {
216
- for (var p = Math.min(Math.max(a, d + o - 1), n - 1), h = a + 1; h <= p && !t(h); h++)
217
- a = h;
218
- l.push(d, a);
231
+ if (rangeStopIndex !== null) {
232
+ var potentialStopIndex = Math.min(Math.max(rangeStopIndex, rangeStartIndex + minimumBatchSize - 1), itemCount - 1);
233
+ for (var _index2 = rangeStopIndex + 1; _index2 <= potentialStopIndex; _index2++) {
234
+ if (!isItemLoaded(_index2)) {
235
+ rangeStopIndex = _index2;
236
+ } else {
237
+ break;
238
+ }
239
+ }
240
+ unloadedRanges.push(rangeStartIndex, rangeStopIndex);
219
241
  }
220
- if (l.length)
221
- for (; l[1] - l[0] + 1 < o && l[0] > 0; ) {
222
- var g = l[0] - 1;
223
- if (!t(g))
224
- l[0] = g;
225
- else
242
+ if (unloadedRanges.length) {
243
+ while (unloadedRanges[1] - unloadedRanges[0] + 1 < minimumBatchSize && unloadedRanges[0] > 0) {
244
+ var _index3 = unloadedRanges[0] - 1;
245
+ if (!isItemLoaded(_index3)) {
246
+ unloadedRanges[0] = _index3;
247
+ } else {
226
248
  break;
249
+ }
227
250
  }
228
- return l;
251
+ }
252
+ return unloadedRanges;
229
253
  }
230
- var _t = function(e, t) {
231
- if (!(e instanceof t))
254
+ var classCallCheck = function(instance, Constructor) {
255
+ if (!(instance instanceof Constructor)) {
232
256
  throw new TypeError("Cannot call a class as a function");
233
- }, Mt = /* @__PURE__ */ function() {
234
- function e(t, n) {
235
- for (var o = 0; o < n.length; o++) {
236
- var s = n[o];
237
- s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
257
+ }
258
+ };
259
+ var createClass = /* @__PURE__ */ function() {
260
+ function defineProperties(target, props) {
261
+ for (var i2 = 0; i2 < props.length; i2++) {
262
+ var descriptor = props[i2];
263
+ descriptor.enumerable = descriptor.enumerable || false;
264
+ descriptor.configurable = true;
265
+ if ("value" in descriptor) descriptor.writable = true;
266
+ Object.defineProperty(target, descriptor.key, descriptor);
238
267
  }
239
268
  }
240
- return function(t, n, o) {
241
- return n && e(t.prototype, n), o && e(t, o), t;
269
+ return function(Constructor, protoProps, staticProps) {
270
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
271
+ if (staticProps) defineProperties(Constructor, staticProps);
272
+ return Constructor;
242
273
  };
243
- }(), Ut = function(e, t) {
244
- if (typeof t != "function" && t !== null)
245
- throw new TypeError("Super expression must either be null or a function, not " + typeof t);
246
- e.prototype = Object.create(t && t.prototype, {
274
+ }();
275
+ var inherits = function(subClass, superClass) {
276
+ if (typeof superClass !== "function" && superClass !== null) {
277
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
278
+ }
279
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
247
280
  constructor: {
248
- value: e,
249
- enumerable: !1,
250
- writable: !0,
251
- configurable: !0
281
+ value: subClass,
282
+ enumerable: false,
283
+ writable: true,
284
+ configurable: true
252
285
  }
253
- }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
254
- }, ae = function(e, t) {
255
- if (!e)
286
+ });
287
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
288
+ };
289
+ var possibleConstructorReturn = function(self, call) {
290
+ if (!self) {
256
291
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
257
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
292
+ }
293
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
258
294
  };
259
- (function(e) {
260
- Ut(t, e);
261
- function t() {
262
- var n, o, s, r;
263
- _t(this, t);
264
- for (var l = arguments.length, d = Array(l), a = 0; a < l; a++)
265
- d[a] = arguments[a];
266
- return r = (o = (s = ae(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(d))), s), s._lastRenderedStartIndex = -1, s._lastRenderedStopIndex = -1, s._memoizedUnloadedRanges = [], s._onItemsRendered = function(c) {
267
- var m = c.visibleStartIndex, p = c.visibleStopIndex;
268
- s._lastRenderedStartIndex = m, s._lastRenderedStopIndex = p, s._ensureRowsLoaded(m, p);
269
- }, s._setRef = function(c) {
270
- s._listRef = c;
271
- }, o), ae(s, r);
295
+ (function(_PureComponent) {
296
+ inherits(InfiniteLoader2, _PureComponent);
297
+ function InfiniteLoader2() {
298
+ var _ref;
299
+ var _temp, _this, _ret;
300
+ classCallCheck(this, InfiniteLoader2);
301
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
302
+ args[_key] = arguments[_key];
303
+ }
304
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = InfiniteLoader2.__proto__ || Object.getPrototypeOf(InfiniteLoader2)).call.apply(_ref, [this].concat(args))), _this), _this._lastRenderedStartIndex = -1, _this._lastRenderedStopIndex = -1, _this._memoizedUnloadedRanges = [], _this._onItemsRendered = function(_ref2) {
305
+ var visibleStartIndex = _ref2.visibleStartIndex, visibleStopIndex = _ref2.visibleStopIndex;
306
+ _this._lastRenderedStartIndex = visibleStartIndex;
307
+ _this._lastRenderedStopIndex = visibleStopIndex;
308
+ _this._ensureRowsLoaded(visibleStartIndex, visibleStopIndex);
309
+ }, _this._setRef = function(listRef) {
310
+ _this._listRef = listRef;
311
+ }, _temp), possibleConstructorReturn(_this, _ret);
272
312
  }
273
- return Mt(t, [{
313
+ createClass(InfiniteLoader2, [{
274
314
  key: "resetloadMoreItemsCache",
275
- value: function() {
276
- var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
277
- this._memoizedUnloadedRanges = [], o && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
315
+ value: function resetloadMoreItemsCache() {
316
+ var autoReload = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
317
+ this._memoizedUnloadedRanges = [];
318
+ if (autoReload) {
319
+ this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
320
+ }
278
321
  }
279
322
  }, {
280
323
  key: "componentDidMount",
281
- value: function() {
324
+ value: function componentDidMount() {
282
325
  }
283
326
  }, {
284
327
  key: "render",
285
- value: function() {
286
- var o = this.props.children;
287
- return o({
328
+ value: function render() {
329
+ var children = this.props.children;
330
+ return children({
288
331
  onItemsRendered: this._onItemsRendered,
289
332
  ref: this._setRef
290
333
  });
291
334
  }
292
335
  }, {
293
336
  key: "_ensureRowsLoaded",
294
- value: function(o, s) {
295
- var r = this.props, l = r.isItemLoaded, d = r.itemCount, a = r.minimumBatchSize, c = a === void 0 ? 10 : a, m = r.threshold, p = m === void 0 ? 15 : m, h = Ot({
296
- isItemLoaded: l,
297
- itemCount: d,
298
- minimumBatchSize: c,
299
- startIndex: Math.max(0, o - p),
300
- stopIndex: Math.min(d - 1, s + p)
337
+ value: function _ensureRowsLoaded(startIndex, stopIndex) {
338
+ var _props = this.props, isItemLoaded = _props.isItemLoaded, itemCount = _props.itemCount, _props$minimumBatchSi = _props.minimumBatchSize, minimumBatchSize = _props$minimumBatchSi === void 0 ? 10 : _props$minimumBatchSi, _props$threshold = _props.threshold, threshold = _props$threshold === void 0 ? 15 : _props$threshold;
339
+ var unloadedRanges = scanForUnloadedRanges({
340
+ isItemLoaded,
341
+ itemCount,
342
+ minimumBatchSize,
343
+ startIndex: Math.max(0, startIndex - threshold),
344
+ stopIndex: Math.min(itemCount - 1, stopIndex + threshold)
301
345
  });
302
- (this._memoizedUnloadedRanges.length !== h.length || this._memoizedUnloadedRanges.some(function(g, b) {
303
- return h[b] !== g;
304
- })) && (this._memoizedUnloadedRanges = h, this._loadUnloadedRanges(h));
346
+ if (this._memoizedUnloadedRanges.length !== unloadedRanges.length || this._memoizedUnloadedRanges.some(function(startOrStop, index) {
347
+ return unloadedRanges[index] !== startOrStop;
348
+ })) {
349
+ this._memoizedUnloadedRanges = unloadedRanges;
350
+ this._loadUnloadedRanges(unloadedRanges);
351
+ }
305
352
  }
306
353
  }, {
307
354
  key: "_loadUnloadedRanges",
308
- value: function(o) {
309
- for (var s = this, r = this.props.loadMoreItems || this.props.loadMoreRows, l = function(c) {
310
- var m = o[c], p = o[c + 1], h = r(m, p);
311
- h != null && h.then(function() {
312
- if (Dt({
313
- lastRenderedStartIndex: s._lastRenderedStartIndex,
314
- lastRenderedStopIndex: s._lastRenderedStopIndex,
315
- startIndex: m,
316
- stopIndex: p
317
- })) {
318
- if (s._listRef == null)
319
- return;
320
- typeof s._listRef.resetAfterIndex == "function" ? s._listRef.resetAfterIndex(m, !0) : (typeof s._listRef._getItemStyleCache == "function" && s._listRef._getItemStyleCache(-1), s._listRef.forceUpdate());
321
- }
322
- });
323
- }, d = 0; d < o.length; d += 2)
324
- l(d);
355
+ value: function _loadUnloadedRanges(unloadedRanges) {
356
+ var _this2 = this;
357
+ var loadMoreItems = this.props.loadMoreItems || this.props.loadMoreRows;
358
+ var _loop = function _loop2(i22) {
359
+ var startIndex = unloadedRanges[i22];
360
+ var stopIndex = unloadedRanges[i22 + 1];
361
+ var promise = loadMoreItems(startIndex, stopIndex);
362
+ if (promise != null) {
363
+ promise.then(function() {
364
+ if (isRangeVisible({
365
+ lastRenderedStartIndex: _this2._lastRenderedStartIndex,
366
+ lastRenderedStopIndex: _this2._lastRenderedStopIndex,
367
+ startIndex,
368
+ stopIndex
369
+ })) {
370
+ if (_this2._listRef == null) {
371
+ return;
372
+ }
373
+ if (typeof _this2._listRef.resetAfterIndex === "function") {
374
+ _this2._listRef.resetAfterIndex(startIndex, true);
375
+ } else {
376
+ if (typeof _this2._listRef._getItemStyleCache === "function") {
377
+ _this2._listRef._getItemStyleCache(-1);
378
+ }
379
+ _this2._listRef.forceUpdate();
380
+ }
381
+ }
382
+ });
383
+ }
384
+ };
385
+ for (var i2 = 0; i2 < unloadedRanges.length; i2 += 2) {
386
+ _loop(i2);
387
+ }
325
388
  }
326
- }]), t;
327
- })(Re);
328
- const Bt = /* @__PURE__ */ u("div")({
389
+ }]);
390
+ return InfiniteLoader2;
391
+ })(PureComponent);
392
+ const r$4 = /* @__PURE__ */ styled_default("div")({
329
393
  name: "Container",
330
394
  class: "culdu4a",
331
- propsAsIs: !1
332
- }), Ft = /* @__PURE__ */ u("div")({
395
+ propsAsIs: false
396
+ }), t$2 = /* @__PURE__ */ styled_default("div")({
333
397
  name: "Position",
334
398
  class: "pwf8e69",
335
- propsAsIs: !1
336
- }), zt = /* @__PURE__ */ u("img")({
399
+ propsAsIs: false
400
+ }), c$3 = /* @__PURE__ */ styled_default("img")({
337
401
  name: "Avatar",
338
402
  class: "atf4yh4",
339
- propsAsIs: !1
340
- }), Pt = /* @__PURE__ */ u("div")({
403
+ propsAsIs: false
404
+ }), p$1 = /* @__PURE__ */ styled_default("div")({
341
405
  name: "AvatarPlaceholder",
342
406
  class: "a1dg29ja",
343
- propsAsIs: !1
344
- }), Vt = /* @__PURE__ */ u("div")({
407
+ propsAsIs: false
408
+ }), l$1 = /* @__PURE__ */ styled_default("div")({
345
409
  name: "Content",
346
410
  class: "c10a68rc",
347
- propsAsIs: !1
348
- }), qt = /* @__PURE__ */ u("div")({
411
+ propsAsIs: false
412
+ }), m$2 = /* @__PURE__ */ styled_default("div")({
349
413
  name: "NameContainer",
350
414
  class: "nc4kck5",
351
- propsAsIs: !1
352
- }), jt = /* @__PURE__ */ u("span")({
415
+ propsAsIs: false
416
+ }), i$4 = /* @__PURE__ */ styled_default("span")({
353
417
  name: "Name",
354
418
  class: "njsrqgr",
355
- propsAsIs: !1
356
- }), Kt = () => D, Qt = /* @__PURE__ */ u(Kt())({
419
+ propsAsIs: false
420
+ }), e$4 = () => B1, d$2 = /* @__PURE__ */ styled_default(e$4())({
357
421
  name: "CurrentUserBadge",
358
422
  class: "c17uc4zr",
359
- propsAsIs: !0
360
- }), Wt = ({
361
- friendsRank: e,
362
- avatar: t,
363
- name: n,
364
- userId: o,
365
- points: s,
366
- isCurrentUser: r,
367
- style: l
368
- }) => /* @__PURE__ */ f(Bt, { "data-name": o, style: l, children: [
369
- /* @__PURE__ */ i(Ft, { children: e || 0 }),
370
- /* @__PURE__ */ f(Vt, { children: [
371
- t ? /* @__PURE__ */ i(zt, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ i(Pt, { children: pt(n || "") }),
372
- /* @__PURE__ */ f(qt, { children: [
373
- /* @__PURE__ */ i(jt, { children: n || "" }),
374
- r && /* @__PURE__ */ i(Qt, { name: "icon-star" })
423
+ propsAsIs: true
424
+ });
425
+ const N$1 = ({
426
+ friendsRank: i2,
427
+ avatar: a2,
428
+ name: t2,
429
+ userId: n2,
430
+ points: o2,
431
+ isCurrentUser: d2,
432
+ style: m2
433
+ }) => /* @__PURE__ */ jsxs(r$4, { "data-name": n2, style: m2, children: [
434
+ /* @__PURE__ */ jsx(t$2, { children: i2 || 0 }),
435
+ /* @__PURE__ */ jsxs(l$1, { children: [
436
+ a2 ? /* @__PURE__ */ jsx(c$3, { alt: "leaderboard-item-avatar", src: a2 }) : /* @__PURE__ */ jsx(p$1, { children: I$3(t2 || "") }),
437
+ /* @__PURE__ */ jsxs(m$2, { children: [
438
+ /* @__PURE__ */ jsx(i$4, { children: t2 || "" }),
439
+ d2 && /* @__PURE__ */ jsx(d$2, { name: "icon-star" })
375
440
  ] })
376
441
  ] }),
377
- /* @__PURE__ */ i("div", { children: ut(s) })
378
- ] }), Gt = /* @__PURE__ */ u("div")({
442
+ /* @__PURE__ */ jsx("div", { children: s(o2) })
443
+ ] });
444
+ const u$1 = /* @__PURE__ */ styled_default("div")({
379
445
  name: "Container",
380
446
  class: "c16btbfp",
381
- propsAsIs: !1
382
- }), Ht = ({
383
- items: e,
384
- currentUserId: t,
385
- openItemDetail: n,
386
- fetchMore: o,
387
- scrollNode: s,
388
- hasMore: r
447
+ propsAsIs: false
448
+ }), S = ({
449
+ items: s2,
450
+ currentUserId: e2,
451
+ openItemDetail: o2,
452
+ fetchMore: n2,
453
+ scrollNode: i2,
454
+ hasMore: d2
389
455
  }) => {
390
- const l = j((d) => {
391
- const a = d.target.getAttribute("data-name");
392
- a && n(a);
393
- }, [n]);
394
- return /* @__PURE__ */ i(ct, {
395
- loadMore: o,
396
- initialLoad: !1,
397
- hasMore: r,
398
- useWindow: !1,
399
- getScrollParent: () => s.current,
400
- children: /* @__PURE__ */ i(Gt, {
456
+ const l2 = useCallback((r2) => {
457
+ const a2 = r2.target.getAttribute("data-name");
458
+ a2 && o2(a2);
459
+ }, [o2]);
460
+ return /* @__PURE__ */ jsx(m$4, {
461
+ loadMore: n2,
462
+ initialLoad: false,
463
+ hasMore: d2,
464
+ useWindow: false,
465
+ getScrollParent: () => i2.current,
466
+ children: /* @__PURE__ */ jsx(u$1, {
401
467
  "data-a": "intr",
402
- onClick: l,
403
- children: e.map((d) => /* @__PURE__ */ i(Wt, {
404
- ...d,
405
- isCurrentUser: !!t && t === d.userId
406
- }, d.userId))
468
+ onClick: l2,
469
+ children: s2.map((r2) => /* @__PURE__ */ jsx(N$1, {
470
+ ...r2,
471
+ isCurrentUser: !!e2 && e2 === r2.userId
472
+ }, r2.userId))
407
473
  })
408
474
  });
409
- }, Jt = /* @__PURE__ */ u("div")({
475
+ };
476
+ const r$3 = /* @__PURE__ */ styled_default("div")({
410
477
  name: "InviteFriendsContainer",
411
478
  class: "i1c9dygq",
412
- propsAsIs: !1
413
- }), Yt = ({
414
- deepLink: e
415
- }) => /* @__PURE__ */ i(Jt, {
416
- children: /* @__PURE__ */ i(Ge, {
417
- inviteLink: e,
479
+ propsAsIs: false
480
+ }), a$3 = ({
481
+ deepLink: i2
482
+ }) => /* @__PURE__ */ jsx(r$3, {
483
+ children: /* @__PURE__ */ jsx(M$1, {
484
+ inviteLink: i2,
418
485
  inviteCardTitle: "It’s More Fun With Friends",
419
486
  inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
420
487
  })
421
- }), Zt = /* @__PURE__ */ u("div")({
488
+ });
489
+ const v$1 = /* @__PURE__ */ styled_default("div")({
422
490
  name: "InviteLinkContainer",
423
491
  class: "i1odbhm4",
424
- propsAsIs: !1
425
- }), Xt = ({
426
- gamification: e,
427
- scrollNode: t,
428
- scrollStore: n,
429
- leaderboardList: o
492
+ propsAsIs: false
493
+ }), x$3 = ({
494
+ gamification: r2,
495
+ scrollNode: t2,
496
+ scrollStore: o2,
497
+ leaderboardList: i2
430
498
  }) => {
431
- const s = L(null), {
432
- data: r,
433
- hasMore: l,
434
- loading: d,
435
- key: a
436
- } = v(o.$store), {
437
- data: c
438
- } = v(e.deepLink.$store), [m, p] = He(s);
439
- return !r.length && !d ? /* @__PURE__ */ i(Yt, {
440
- deepLink: c
441
- }) : /* @__PURE__ */ f(T, {
442
- children: [/* @__PURE__ */ i(Ht, {
443
- items: r,
444
- scrollNode: t,
445
- scrollStore: n,
446
- fetchMore: o.fetchMore,
447
- hasMore: l,
448
- openItemDetail: e.openUser,
449
- currentUserId: e.currentUserId.get()
450
- }, a), c && /* @__PURE__ */ i(Zt, {
451
- ref: s,
452
- children: /* @__PURE__ */ i(Tt, {
499
+ const s2 = useRef(null), {
500
+ data: d2,
501
+ hasMore: m2,
502
+ loading: a2,
503
+ key: l2
504
+ } = useStore(i2.$store), {
505
+ data: n2
506
+ } = useStore(r2.deepLink.$store), [c2, f2] = T$1(s2);
507
+ return !d2.length && !a2 ? /* @__PURE__ */ jsx(a$3, {
508
+ deepLink: n2
509
+ }) : /* @__PURE__ */ jsxs(Fragment, {
510
+ children: [/* @__PURE__ */ jsx(S, {
511
+ items: d2,
512
+ scrollNode: t2,
513
+ scrollStore: o2,
514
+ fetchMore: i2.fetchMore,
515
+ hasMore: m2,
516
+ openItemDetail: r2.openUser,
517
+ currentUserId: r2.currentUserId.get()
518
+ }, l2), n2 && /* @__PURE__ */ jsx(v$1, {
519
+ ref: s2,
520
+ children: /* @__PURE__ */ jsx(C$1, {
453
521
  "data-a": "intr",
454
- onClick: () => m(c),
522
+ onClick: () => c2(n2),
455
523
  title: "Invite Friends",
456
524
  description: "Challenge them now!"
457
525
  })
458
- }), p]
526
+ }), f2]
459
527
  });
460
- }, en = ({
461
- gamification: e,
462
- scrollNode: t,
463
- scrollStore: n
464
- }) => e.leaderboardList ? /* @__PURE__ */ i(Xt, {
465
- leaderboardList: e.leaderboardList,
466
- gamification: e,
467
- scrollNode: t,
468
- scrollStore: n
469
- }) : null, tn = ({ store: e, openQuestion: t }) => {
470
- const { sdk: n } = G(), o = v(e);
471
- return /* @__PURE__ */ i(Je, { openQuestion: t, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
472
- }, nn = ({ userSummary: e }) => {
473
- var t;
474
- const [n, o] = S(void 0);
475
- return y(() => {
476
- const s = e.$store.subscribe((r) => {
477
- r && o(r);
528
+ }, E = ({
529
+ gamification: r2,
530
+ scrollNode: t2,
531
+ scrollStore: o2
532
+ }) => r2.leaderboardList ? /* @__PURE__ */ jsx(x$3, {
533
+ leaderboardList: r2.leaderboardList,
534
+ gamification: r2,
535
+ scrollNode: t2,
536
+ scrollStore: o2
537
+ }) : null;
538
+ const a$2 = ({ store: t2, openQuestion: r2 }) => {
539
+ const { sdk: o2 } = p$3(), e2 = useStore(t2);
540
+ return /* @__PURE__ */ jsx(k, { openQuestion: r2, questions: e2.data, controlVideo: o2 == null ? void 0 : o2.controlVideoPlayer });
541
+ };
542
+ const b$1 = ({ userSummary: r2 }) => {
543
+ var e2;
544
+ const [t2, s2] = useState(void 0);
545
+ return useEffect(() => {
546
+ const c2 = r2.$store.subscribe((o2) => {
547
+ o2 && s2(o2);
478
548
  });
479
549
  return () => {
480
- s();
550
+ c2();
481
551
  };
482
- }, [e]), /* @__PURE__ */ i(ke, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (t = n == null ? void 0 : n.percentage) == null ? void 0 : t.correct });
483
- }, sn = ({ gamification: e, className: t, scrollStore: n, scrollNode: o, appNode: s, style: r, responsiveStore: l }) => {
484
- const { tabsShown: d } = v(n, { keys: ["tabsShown"] }), a = v(e.friendsTabEnabled), [c, m] = S(M.HOME), [, p] = Ue(), { sdkInDesktopView: h, screen: g } = v(l, { keys: ["sdkInDesktopView"] }), b = (I) => {
485
- p(() => {
486
- var B;
487
- m(I), h === !1 && (((B = s.current) == null ? void 0 : B.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, { behavior: "instant" });
552
+ }, [r2]), /* @__PURE__ */ jsx(z$3, { loading: !(t2 != null && t2.summary), ...t2 == null ? void 0 : t2.summary, successRate: (e2 = t2 == null ? void 0 : t2.percentage) == null ? void 0 : e2.correct });
553
+ };
554
+ const W = ({ gamification: s2, className: w2, scrollStore: t2, scrollNode: y2, appNode: c2, style: k2, responsiveStore: i2 }) => {
555
+ const { tabsShown: u2 } = useStore(t2, { keys: ["tabsShown"] }), o2 = useStore(s2.friendsTabEnabled), [a2, h2] = useState(m$3.HOME), [, T2] = useTransition(), { sdkInDesktopView: l2, screen: g2 } = useStore(i2, { keys: ["sdkInDesktopView"] }), x2 = (r2) => {
556
+ T2(() => {
557
+ var b2;
558
+ h2(r2), l2 === false && (((b2 = c2.current) == null ? void 0 : b2.getBoundingClientRect().y) || 0) < 0 && I$2(c2, g2.size, { behavior: "instant" });
488
559
  });
489
560
  };
490
- y(() => n.subscribe((I) => {
491
- if (I.scrollPosition === 0) {
492
- n.setKey("tabsShown", !0);
561
+ useEffect(() => t2.subscribe((r2) => {
562
+ if (r2.scrollPosition === 0) {
563
+ t2.setKey("tabsShown", true);
493
564
  return;
494
565
  }
495
- l.get().sdkInDesktopView ? n.setKey("tabsShown", I.scrollDirection === "backward") : n.setKey("tabsShown", I.scrollDirection === "forward");
496
- }), [n, l]), y(() => {
497
- a || m(M.HOME);
498
- }, [a]);
499
- let $ = "0px";
500
- return h ? $ = d ? "0px" : "calc(0px - var(--header-height))" : $ = d ? "var(--header-height)" : "0px", /* @__PURE__ */ f(Be, { className: E(t, "SL-Tabs", "sl-hide-on-modal"), style: r, children: [
501
- a && /* @__PURE__ */ i(
502
- Fe,
566
+ i2.get().sdkInDesktopView ? t2.setKey("tabsShown", r2.scrollDirection === "backward") : t2.setKey("tabsShown", r2.scrollDirection === "forward");
567
+ }), [t2, i2]), useEffect(() => {
568
+ o2 || h2(m$3.HOME);
569
+ }, [o2]);
570
+ let m2 = "0px";
571
+ return l2 ? m2 = u2 ? "0px" : "calc(0px - var(--header-height))" : m2 = u2 ? "var(--header-height)" : "0px", /* @__PURE__ */ jsxs(l$3, { className: cx_default(w2, "SL-Tabs", "sl-hide-on-modal"), style: k2, children: [
572
+ o2 && /* @__PURE__ */ jsx(
573
+ S$1,
503
574
  {
504
575
  style: {
505
- top: $
576
+ top: m2
506
577
  },
507
- children: /* @__PURE__ */ i(St, { activePage: c, toggleActivePage: b })
578
+ children: /* @__PURE__ */ jsx(b$2, { activePage: a2, toggleActivePage: x2 })
508
579
  }
509
580
  ),
510
- c === M.HOME && /* @__PURE__ */ f(T, { children: [
511
- /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(Pe, { children: /* @__PURE__ */ i(nn, { userSummary: e.userSummary }) }) }),
512
- /* @__PURE__ */ i(Ve, { style: { flex: 1 }, children: /* @__PURE__ */ i(tn, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
581
+ a2 === m$3.HOME && /* @__PURE__ */ jsxs(Fragment, { children: [
582
+ /* @__PURE__ */ jsx(m$5, { children: /* @__PURE__ */ jsx(d$4, { children: /* @__PURE__ */ jsx(b$1, { userSummary: s2.userSummary }) }) }),
583
+ /* @__PURE__ */ jsx(n$4, { style: { flex: 1 }, children: /* @__PURE__ */ jsx(a$2, { openQuestion: s2.openQuestion, store: s2.feedList.getStore() }) })
513
584
  ] }),
514
- c === M.LEADERBOARD && /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(en, { scrollStore: n, scrollNode: o, gamification: e }) })
585
+ a2 === m$3.LEADERBOARD && /* @__PURE__ */ jsx(C$2, { children: /* @__PURE__ */ jsx(E, { scrollStore: t2, scrollNode: y2, gamification: s2 }) })
515
586
  ] });
516
- }, on = () => W, re = /* @__PURE__ */ u(on())({
587
+ };
588
+ const R = () => f$5, u = /* @__PURE__ */ styled_default(R())({
517
589
  name: "OpenedContainer",
518
590
  class: "ouvguos",
519
- propsAsIs: !0
520
- }), le = "t1eu4lbg", an = /* @__PURE__ */ u("div")({
591
+ propsAsIs: true
592
+ }), f$2 = "t1eu4lbg", V = /* @__PURE__ */ styled_default("div")({
521
593
  name: "UserContainer",
522
594
  class: "uuv2xqo",
523
- propsAsIs: !1
524
- }), rn = ({
525
- correct: e,
526
- incorrect: t
595
+ propsAsIs: false
596
+ }), j$1 = ({
597
+ correct: e2,
598
+ incorrect: t2
527
599
  }) => {
528
- const n = e + t;
529
- return n === 0 ? 0 : Math.round(e / n * 100);
530
- }, Fs = ({
531
- gamification: e,
532
- scrollStore: t,
533
- className: n,
534
- appNode: o,
535
- scrollNode: s,
536
- responsiveStore: r
537
- }) => /* @__PURE__ */ i(sn, {
538
- appNode: o,
539
- scrollStore: t,
540
- scrollNode: s,
541
- className: n,
542
- gamification: e,
543
- responsiveStore: r
544
- }), ln = ({
545
- gamification: e,
546
- muted: t,
547
- sdk: n,
548
- className: o,
549
- appNode: s,
550
- responsiveStore: r
600
+ const n2 = e2 + t2;
601
+ return n2 === 0 ? 0 : Math.round(e2 / n2 * 100);
602
+ }, B$2 = ({
603
+ gamification: e2,
604
+ scrollStore: t2,
605
+ className: n2,
606
+ appNode: r2,
607
+ scrollNode: p2,
608
+ responsiveStore: a2
609
+ }) => /* @__PURE__ */ jsx(W, {
610
+ appNode: r2,
611
+ scrollStore: t2,
612
+ scrollNode: p2,
613
+ className: n2,
614
+ gamification: e2,
615
+ responsiveStore: a2
616
+ }), J$2 = ({
617
+ gamification: e2,
618
+ muted: t2,
619
+ sdk: n2,
620
+ className: r2,
621
+ appNode: p2,
622
+ responsiveStore: a2
551
623
  }) => {
552
624
  const {
553
- topNavigation: l
554
- } = G(), d = v(e.openedQuestionId), a = v(e.openedQuestion.$store), c = v(e.openedUser || ye(void 0)), {
555
- sdkInDesktopView: m
556
- } = v(r, {
625
+ topNavigation: c2
626
+ } = p$3(), C2 = useStore(e2.openedQuestionId), S2 = useStore(e2.openedQuestion.$store), s2 = useStore(e2.openedUser || createSingleStore(void 0)), {
627
+ sdkInDesktopView: v2
628
+ } = useStore(a2, {
557
629
  keys: ["sdkInDesktopView"]
558
630
  }), {
559
- hiding: p,
560
- onAnimationEnd: h
561
- } = je();
562
- if (!d && !c)
631
+ hiding: m2,
632
+ onAnimationEnd: d2
633
+ } = S$2();
634
+ if (!C2 && !s2)
563
635
  return null;
564
- const g = a ? /* @__PURE__ */ i(re, {
565
- className: E(o, !l && le),
566
- hiding: p,
567
- onAnimationEnd: h,
568
- children: /* @__PURE__ */ i(rt, {
569
- muted: t,
570
- sdk: n,
571
- gamification: e
636
+ const x2 = S2 ? /* @__PURE__ */ jsx(u, {
637
+ className: cx_default(r2, !c2 && f$2),
638
+ hiding: m2,
639
+ onAnimationEnd: d2,
640
+ children: /* @__PURE__ */ jsx(ht, {
641
+ muted: t2,
642
+ sdk: n2,
643
+ gamification: e2
572
644
  })
573
- }) : c ? /* @__PURE__ */ i(re, {
574
- className: E(o, !l && le),
575
- hiding: p,
576
- onAnimationEnd: h,
577
- children: /* @__PURE__ */ f(an, {
578
- children: [/* @__PURE__ */ i(dt, {
645
+ }) : s2 ? /* @__PURE__ */ jsx(u, {
646
+ className: cx_default(r2, !c2 && f$2),
647
+ hiding: m2,
648
+ onAnimationEnd: d2,
649
+ children: /* @__PURE__ */ jsxs(V, {
650
+ children: [/* @__PURE__ */ jsx(y$1, {
579
651
  label: "Friend's Rank",
580
- close: e.closeUser
581
- }), /* @__PURE__ */ i(Ke, {
582
- children: /* @__PURE__ */ i(ke, {
583
- ...c,
584
- successRate: rn(c)
652
+ close: e2.closeUser
653
+ }), /* @__PURE__ */ jsx(a$5, {
654
+ children: /* @__PURE__ */ jsx(z$3, {
655
+ ...s2,
656
+ successRate: j$1(s2)
585
657
  })
586
658
  })]
587
659
  })
588
660
  }) : null;
589
- return /* @__PURE__ */ i(Ne, {
590
- container: s,
591
- useContainer: !m,
592
- children: g
661
+ return /* @__PURE__ */ jsx(T$2, {
662
+ container: p2,
663
+ useContainer: !v2,
664
+ children: x2
593
665
  });
594
- }, dn = xe(() => import("./gamification-feature.js")), cn = ({ sdk: e, feature: t, className: n, scrollStore: o, appNode: s, scrollNode: r, responsiveStore: l }) => {
595
- const d = C(() => t && t.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(It, { className: n, sdk: e, feature: t, children: /* @__PURE__ */ i(
596
- dn,
666
+ };
667
+ const d$1 = lazy(() => import("./gamification-feature.js")), x$2 = ({ sdk: i2, feature: t2, className: n2, scrollStore: e2, appNode: o2, scrollNode: a2, responsiveStore: l2 }) => {
668
+ const u2 = useMemo(() => t2 && t2.featureConfig.get().type === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(v$2, { className: n2, sdk: i2, feature: t2, children: /* @__PURE__ */ jsx(
669
+ d$1,
597
670
  {
598
- appNode: s,
599
- scrollStore: o,
600
- scrollNode: r,
601
- className: n,
602
- responsiveStore: l,
603
- gamification: t
671
+ appNode: o2,
672
+ scrollStore: e2,
673
+ scrollNode: a2,
674
+ className: n2,
675
+ responsiveStore: l2,
676
+ gamification: t2
604
677
  }
605
- ) }) : null, [e, t, n, l, o, r, s]);
606
- return /* @__PURE__ */ i(
607
- Le,
678
+ ) }) : null, [i2, t2, n2, l2, e2, a2, o2]);
679
+ return /* @__PURE__ */ jsx(
680
+ Suspense,
608
681
  {
609
- fallback: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
610
- children: d
682
+ fallback: /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
683
+ children: u2
611
684
  }
612
685
  );
613
- }, pn = ({ feature: e, sdk: t, muted: n, className: o, appNode: s, responsiveStore: r }) => e && e.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(
614
- ln,
686
+ }, A$1 = ({ feature: i2, sdk: t2, muted: n2, className: e2, appNode: o2, responsiveStore: a2 }) => i2 && i2.featureConfig.get().type === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(
687
+ J$2,
615
688
  {
616
- className: o,
617
- appNode: s,
618
- muted: n,
619
- sdk: t,
620
- responsiveStore: r,
621
- gamification: e
689
+ className: e2,
690
+ appNode: o2,
691
+ muted: n2,
692
+ sdk: t2,
693
+ responsiveStore: a2,
694
+ gamification: i2
622
695
  }
623
696
  ) : null;
624
697
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
625
- function un(e) {
626
- return e instanceof DOMException && // everything except Firefox
627
- (e.code === 22 || // Firefox
628
- e.code === 1014 || // test name field too, because code might not be present
698
+ function isQuotaExceededError(err) {
699
+ return err instanceof DOMException && // everything except Firefox
700
+ (err.code === 22 || // Firefox
701
+ err.code === 1014 || // test name field too, because code might not be present
629
702
  // everything except Firefox
630
- e.name === "QuotaExceededError" || // Firefox
631
- e.name === "NS_ERROR_DOM_QUOTA_REACHED");
703
+ err.name === "QuotaExceededError" || // Firefox
704
+ err.name === "NS_ERROR_DOM_QUOTA_REACHED");
632
705
  }
633
- class mn {
634
- constructor(t = "main", n = window.localStorage) {
635
- k(this, "delimiter", ":");
636
- k(this, "prefix");
637
- k(this, "storage");
638
- k(this, "clear", () => {
639
- for (const t in window.localStorage)
640
- t.startsWith(this.prefix) && this.storage.removeItem(t);
706
+ class Storage {
707
+ constructor(prefix = "main", storage = window.localStorage) {
708
+ __publicField(this, "delimiter", ":");
709
+ __publicField(this, "prefix");
710
+ __publicField(this, "storage");
711
+ __publicField(this, "clear", () => {
712
+ for (const key in window.localStorage) {
713
+ if (key.startsWith(this.prefix)) {
714
+ this.storage.removeItem(key);
715
+ }
716
+ }
641
717
  });
642
- k(this, "generateKey", (t) => `${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);
643
- k(this, "write", (...t) => {
644
- const n = t.pop() || "", o = this.generateKey(t);
718
+ __publicField(this, "generateKey", (keyParts) => `${this.prefix}${this.delimiter}${keyParts.join(this.delimiter)}`);
719
+ __publicField(this, "write", (...keyParts) => {
720
+ const value = keyParts.pop() || "";
721
+ const key = this.generateKey(keyParts);
645
722
  try {
646
- this.storage.setItem(o, n);
647
- } catch (s) {
648
- un(s) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
723
+ this.storage.setItem(key, value);
724
+ } catch (err) {
725
+ if (isQuotaExceededError(err) && this.storage === window.sessionStorage) {
726
+ window.sessionStorage.removeItem("slstreamlogs");
727
+ this.storage.setItem(key, value);
728
+ }
649
729
  }
650
730
  });
651
- k(this, "read", (...t) => {
652
- const n = this.storage.getItem(this.generateKey(t));
653
- return n === null ? void 0 : n;
731
+ __publicField(this, "read", (...keyParts) => {
732
+ const value = this.storage.getItem(this.generateKey(keyParts));
733
+ return value === null ? void 0 : value;
654
734
  });
655
- k(this, "remove", (...t) => {
656
- this.storage.removeItem(this.generateKey(t));
735
+ __publicField(this, "remove", (...keyParts) => {
736
+ this.storage.removeItem(this.generateKey(keyParts));
657
737
  });
658
- this.prefix = `sl-sdk${this.delimiter}${t}`, this.storage = n;
738
+ this.prefix = `sl-sdk${this.delimiter}${prefix}`;
739
+ this.storage = storage;
659
740
  }
660
741
  }
661
- var de;
662
- (function(e) {
663
- e.Init = "init", e.Ready = "ready", e.Connecting = "connecting", e.Connected = "connected", e.Disconnected = "disconnected", e.Failed = "failed", e.Reconnect = "reconnect", e.Reconnecting = "reconnecting";
664
- })(de || (de = {}));
665
- U("grpc:stream");
666
- x.Unknown, x.Internal, x.DeadlineExceeded, x.ResourceExhausted, x.FailedPrecondition, x.Unavailable, x.DataLoss;
667
- U("grpc:retry");
668
- ee(10, { description: "Number of attempts to retry" }), ee(3e4, { description: "Max delay between retries in milliseconds" });
669
- var A;
670
- (function(e) {
671
- e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
672
- })(A || (A = {}));
673
- class hn extends mn {
742
+ var ServerStreamSubscriptionStatus;
743
+ (function(ServerStreamSubscriptionStatus2) {
744
+ ServerStreamSubscriptionStatus2["Init"] = "init";
745
+ ServerStreamSubscriptionStatus2["Ready"] = "ready";
746
+ ServerStreamSubscriptionStatus2["Connecting"] = "connecting";
747
+ ServerStreamSubscriptionStatus2["Connected"] = "connected";
748
+ ServerStreamSubscriptionStatus2["Disconnected"] = "disconnected";
749
+ ServerStreamSubscriptionStatus2["Failed"] = "failed";
750
+ ServerStreamSubscriptionStatus2["Reconnect"] = "reconnect";
751
+ ServerStreamSubscriptionStatus2["Reconnecting"] = "reconnecting";
752
+ })(ServerStreamSubscriptionStatus || (ServerStreamSubscriptionStatus = {}));
753
+ createLogger("grpc:stream");
754
+ /* @__PURE__ */ new Set([
755
+ Code.Unknown,
756
+ Code.Internal,
757
+ Code.DeadlineExceeded,
758
+ Code.ResourceExhausted,
759
+ Code.FailedPrecondition,
760
+ Code.Unavailable,
761
+ Code.DataLoss
762
+ ]);
763
+ createLogger("grpc:retry");
764
+ ({
765
+ retryAttempts: createContextKey(10, { description: "Number of attempts to retry" }),
766
+ retryDelay: createContextKey(3e4, { description: "Max delay between retries in milliseconds" })
767
+ });
768
+ var KEY_PREFIX$2;
769
+ (function(KEY_PREFIX2) {
770
+ KEY_PREFIX2["SCHEMA"] = "schema";
771
+ KEY_PREFIX2["EXTERNAL_TOKEN"] = "eToken";
772
+ KEY_PREFIX2["TOKEN"] = "token";
773
+ })(KEY_PREFIX$2 || (KEY_PREFIX$2 = {}));
774
+ class UserStorage extends Storage {
674
775
  constructor() {
675
776
  super("user");
676
777
  // Schema
677
- k(this, "setSchema", (n) => {
678
- this.write(A.SCHEMA, n);
778
+ __publicField(this, "setSchema", (value) => {
779
+ this.write(KEY_PREFIX$2.SCHEMA, value);
780
+ });
781
+ __publicField(this, "getSchema", () => {
782
+ return this.read(KEY_PREFIX$2.SCHEMA);
679
783
  });
680
- k(this, "getSchema", () => this.read(A.SCHEMA));
681
784
  // Token
682
- k(this, "setToken", (n) => {
683
- this.write(A.TOKEN, n);
785
+ __publicField(this, "setToken", (value) => {
786
+ this.write(KEY_PREFIX$2.TOKEN, value);
787
+ });
788
+ __publicField(this, "getToken", () => {
789
+ return this.read(KEY_PREFIX$2.TOKEN);
684
790
  });
685
- k(this, "getToken", () => this.read(A.TOKEN));
686
791
  // External Token
687
- k(this, "setExternalToken", (n) => {
688
- this.write(A.EXTERNAL_TOKEN, n);
792
+ __publicField(this, "setExternalToken", (value) => {
793
+ this.write(KEY_PREFIX$2.EXTERNAL_TOKEN, value);
794
+ });
795
+ __publicField(this, "getExternalToken", () => {
796
+ return this.read(KEY_PREFIX$2.EXTERNAL_TOKEN);
689
797
  });
690
- k(this, "getExternalToken", () => this.read(A.EXTERNAL_TOKEN));
691
- k(this, "removeToken", () => {
692
- this.remove(A.TOKEN);
798
+ __publicField(this, "removeToken", () => {
799
+ this.remove(KEY_PREFIX$2.TOKEN);
693
800
  });
694
801
  }
695
802
  }
696
- var ce;
697
- (function(e) {
698
- e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended";
699
- })(ce || (ce = {}));
700
- var pe;
701
- (function(e) {
702
- e.SHOWED = "showed", e.EVENT = "ev";
703
- })(pe || (pe = {}));
704
- var ue;
705
- (function(e) {
706
- e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io", e.QUESTION_RECEIVED = "q-received", e.QUESTION_OPENED = "q-opened";
707
- })(ue || (ue = {}));
708
- var me;
709
- (function(e) {
710
- e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
711
- })(me || (me = {}));
712
- var he;
713
- (function(e) {
714
- e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
715
- })(he || (he = {}));
716
- U("deep_link");
717
- U("bypass");
718
- new hn();
719
- U("video_player");
720
- w.FACTOID + "", w.POLL + "", w.TRIVIA + "", w.PREDICTION + "", w.TWEET + "";
721
- var ve;
722
- (function(e) {
723
- e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
724
- })(ve || (ve = {}));
725
- w.POLL, w.PREDICTION, w.TRIVIA;
726
- const vn = {
727
- [N.GAMES]: !0
728
- }, fn = /* @__PURE__ */ u("div")({
803
+ var CoreStatus;
804
+ (function(CoreStatus2) {
805
+ CoreStatus2["DISABLED"] = "disabled";
806
+ CoreStatus2["INITIALIZATION"] = "initialization";
807
+ CoreStatus2["READY"] = "ready";
808
+ CoreStatus2["FAILED"] = "failed";
809
+ CoreStatus2["SUSPENDED"] = "suspended";
810
+ })(CoreStatus || (CoreStatus = {}));
811
+ var KEY_PREFIX$1;
812
+ (function(KEY_PREFIX2) {
813
+ KEY_PREFIX2["SHOWED"] = "showed";
814
+ KEY_PREFIX2["EVENT"] = "ev";
815
+ })(KEY_PREFIX$1 || (KEY_PREFIX$1 = {}));
816
+ var KEY_PREFIX;
817
+ (function(KEY_PREFIX2) {
818
+ KEY_PREFIX2["ONBOARDING"] = "onboarding";
819
+ KEY_PREFIX2["ONBOARDING_IO"] = "onboarding_io";
820
+ KEY_PREFIX2["QUESTION_RECEIVED"] = "q-received";
821
+ KEY_PREFIX2["QUESTION_OPENED"] = "q-opened";
822
+ })(KEY_PREFIX || (KEY_PREFIX = {}));
823
+ var InteractiveAllowed;
824
+ (function(InteractiveAllowed2) {
825
+ InteractiveAllowed2["ALLOWED"] = "allowed";
826
+ InteractiveAllowed2["DISALLOWED"] = "disallowed";
827
+ })(InteractiveAllowed || (InteractiveAllowed = {}));
828
+ var ERROR;
829
+ (function(ERROR2) {
830
+ ERROR2["UNKNOWN"] = "unknown";
831
+ ERROR2["ALREADY_VOTED"] = "already_voted";
832
+ })(ERROR || (ERROR = {}));
833
+ createLogger("deep_link");
834
+ createLogger("bypass");
835
+ new UserStorage();
836
+ createLogger("video_player");
837
+ var OnboardingStatus;
838
+ (function(OnboardingStatus2) {
839
+ OnboardingStatus2["Unset"] = "unset";
840
+ OnboardingStatus2["Required"] = "required";
841
+ OnboardingStatus2["Optional"] = "optional";
842
+ OnboardingStatus2["Completed"] = "completed";
843
+ OnboardingStatus2["Disabled"] = "disabled";
844
+ OnboardingStatus2["Unavailable"] = "unavailable";
845
+ })(OnboardingStatus || (OnboardingStatus = {}));
846
+ /* @__PURE__ */ new Set([QuestionType.POLL, QuestionType.PREDICTION, QuestionType.TRIVIA]);
847
+ const AvailableFeatures = {
848
+ [SdkOverlayType.GAMES]: true
849
+ };
850
+ const n$2 = /* @__PURE__ */ styled_default("div")({
729
851
  name: "Buttons",
730
852
  class: "b5o8qbl",
731
- propsAsIs: !1
732
- }), gn = ({
733
- children: e,
734
- className: t
735
- }) => /* @__PURE__ */ i(fn, {
736
- className: t,
737
- children: e
738
- }), $e = /* @__PURE__ */ u("div")({
853
+ propsAsIs: false
854
+ }), i$3 = ({
855
+ children: o2,
856
+ className: s2
857
+ }) => /* @__PURE__ */ jsx(n$2, {
858
+ className: s2,
859
+ children: o2
860
+ });
861
+ const n$1 = /* @__PURE__ */ styled_default("div")({
739
862
  name: "Navigation",
740
863
  class: "n6tbwuy",
741
- propsAsIs: !1
742
- }), In = () => gn, fe = /* @__PURE__ */ u(In())({
864
+ propsAsIs: false
865
+ }), t$1 = () => i$3, e$3 = /* @__PURE__ */ styled_default(t$1())({
743
866
  name: "NavigationItems",
744
867
  class: "n1up4z7v",
745
- propsAsIs: !0
746
- }), bn = /* @__PURE__ */ u("button")({
868
+ propsAsIs: true
869
+ });
870
+ const o = /* @__PURE__ */ styled_default("button")({
747
871
  name: "SButton",
748
872
  class: "sxxa0c",
749
- propsAsIs: !1
750
- }), kn = /* @__PURE__ */ u("span")({
873
+ propsAsIs: false
874
+ }), n = /* @__PURE__ */ styled_default("span")({
751
875
  name: "ButtonIcon",
752
876
  class: "b193dcyu",
753
- propsAsIs: !1
754
- }), yn = /* @__PURE__ */ u("span")({
877
+ propsAsIs: false
878
+ }), a$1 = /* @__PURE__ */ styled_default("span")({
755
879
  name: "ButtonLabel",
756
880
  class: "b40tuix",
757
- propsAsIs: !1
758
- }), Nn = "s14xk0af", Sn = "ha3mg7c", $n = "h103yr45", z = ({ disabled: e, active: t, onClick: n, label: o, icon: s, id: r }) => /* @__PURE__ */ i(
759
- bn,
881
+ propsAsIs: false
882
+ }), e$2 = "s14xk0af", c$2 = "ha3mg7c", r$2 = "h103yr45";
883
+ const i$2 = ({ disabled: n$12, active: r2, onClick: a2, label: c2, icon: o$12, id: t2 }) => /* @__PURE__ */ jsx(
884
+ o,
760
885
  {
761
- onClick: n,
886
+ onClick: a2,
762
887
  "data-a": "intr",
763
- disabled: e,
764
- className: E(
765
- t && Nn,
766
- !t && (r === "channels" || r === "featuredGroups") && Sn,
767
- !t && r === "leaderboard" && $n
888
+ disabled: n$12,
889
+ className: cx_default(
890
+ r2 && e$2,
891
+ !r2 && (t2 === "channels" || t2 === "featuredGroups") && c$2,
892
+ !r2 && t2 === "leaderboard" && r$2
768
893
  ),
769
- children: /* @__PURE__ */ f(T, { children: [
770
- s && /* @__PURE__ */ i(kn, { children: s }),
771
- /* @__PURE__ */ i(yn, { children: o })
894
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
895
+ o$12 && /* @__PURE__ */ jsx(n, { children: o$12 }),
896
+ /* @__PURE__ */ jsx(a$1, { children: c2 })
772
897
  ] })
773
898
  }
774
- ), An = () => D, wn = /* @__PURE__ */ u(An())({
899
+ );
900
+ const g = () => B1, x$1 = /* @__PURE__ */ styled_default(g())({
775
901
  name: "ButtonIcon",
776
902
  class: "b11wpe79",
777
- propsAsIs: !0
778
- }), Cn = /* @__PURE__ */ u("div")({
903
+ propsAsIs: true
904
+ }), F$1 = /* @__PURE__ */ styled_default("div")({
779
905
  name: "Container",
780
906
  class: "calnblm",
781
- propsAsIs: !1
782
- }), En = /* @__PURE__ */ u("div")({
907
+ propsAsIs: false
908
+ }), D$1 = /* @__PURE__ */ styled_default("div")({
783
909
  name: "Title",
784
910
  class: "t1438p52",
785
- propsAsIs: !1
786
- }), Rn = /* @__PURE__ */ u("div")({
911
+ propsAsIs: false
912
+ }), N = /* @__PURE__ */ styled_default("div")({
787
913
  name: "CloseIconWrap",
788
914
  class: "c17srj38",
789
- propsAsIs: !1
790
- }), xn = () => D, Ln = /* @__PURE__ */ u(xn())({
915
+ propsAsIs: false
916
+ }), B$1 = () => B1, j = /* @__PURE__ */ styled_default(B$1())({
791
917
  name: "CloseIcon",
792
918
  class: "clqia8k",
793
- propsAsIs: !0
794
- }), Tn = () => D, Dn = /* @__PURE__ */ u(Tn())({
919
+ propsAsIs: true
920
+ }), w = () => B1, G$1 = /* @__PURE__ */ styled_default(w())({
795
921
  name: "DashboardIcon",
796
922
  class: "df5w958",
797
- propsAsIs: !0
798
- }), On = "h12x6aiv", _n = be(({
799
- sdk: e,
800
- className: t
801
- }, n) => {
802
- const o = () => {
803
- e.closeFeature();
923
+ propsAsIs: true
924
+ }), M = "h12x6aiv", z$2 = forwardRef(({
925
+ sdk: s2,
926
+ className: l2
927
+ }, p2) => {
928
+ const a2 = () => {
929
+ s2.closeFeature();
804
930
  };
805
- return /* @__PURE__ */ f($e, {
806
- className: E(t, On),
807
- children: [/* @__PURE__ */ f(Cn, {
808
- children: [/* @__PURE__ */ f(En, {
809
- children: [/* @__PURE__ */ i(Dn, {
931
+ return /* @__PURE__ */ jsxs(n$1, {
932
+ className: cx_default(l2, M),
933
+ children: [/* @__PURE__ */ jsxs(F$1, {
934
+ children: [/* @__PURE__ */ jsxs(D$1, {
935
+ children: [/* @__PURE__ */ jsx(G$1, {
810
936
  name: "dashboard"
811
937
  }), "Dashboard"]
812
- }), /* @__PURE__ */ i(Rn, {
938
+ }), /* @__PURE__ */ jsx(N, {
813
939
  "data-a": "intr",
814
- onClick: o,
815
- children: /* @__PURE__ */ i(Ln, {
940
+ onClick: a2,
941
+ children: /* @__PURE__ */ jsx(j, {
816
942
  name: "icon-cross"
817
943
  })
818
944
  })]
819
- }), /* @__PURE__ */ i("div", {
820
- ref: n
945
+ }), /* @__PURE__ */ jsx("div", {
946
+ ref: p2
821
947
  })]
822
948
  });
823
- }), Mn = be(({
824
- sdk: e,
825
- className: t
826
- }, n) => {
827
- const o = v(e.sdkStore.organizationSettings), s = v(e.sdkStore.streamSettings), r = v(e.getActiveFeature()), l = C(() => {
828
- const a = (s == null ? void 0 : s.data) || (o == null ? void 0 : o.data);
829
- return a != null && a.overlays ? a.overlays : [];
830
- }, [o, s]), d = C(() => [...l.filter(({
831
- enableSdkButton: a,
832
- type: c
833
- }) => c === N.GAMES || a).map((a) => ({
834
- id: a.type,
835
- onClick: () => e.openFeature(a.type),
836
- disabled: !(a.type in vn),
837
- label: a.name,
838
- icon: /* @__PURE__ */ i("img", {
839
- src: a.icon,
949
+ }), J$1 = forwardRef(({
950
+ sdk: s2,
951
+ className: l2
952
+ }, p2) => {
953
+ const a2 = useStore(s2.sdkStore.organizationSettings), r2 = useStore(s2.sdkStore.streamSettings), i2 = useStore(s2.getActiveFeature()), f2 = useMemo(() => {
954
+ const o2 = (r2 == null ? void 0 : r2.data) || (a2 == null ? void 0 : a2.data);
955
+ return o2 != null && o2.overlays ? o2.overlays : [];
956
+ }, [a2, r2]), d2 = useMemo(() => [...f2.filter(({
957
+ enableSdkButton: o2,
958
+ type: m2
959
+ }) => m2 === SdkOverlayType.GAMES || o2).map((o2) => ({
960
+ id: o2.type,
961
+ onClick: () => s2.openFeature(o2.type),
962
+ disabled: !(o2.type in AvailableFeatures),
963
+ label: o2.name,
964
+ icon: /* @__PURE__ */ jsx("img", {
965
+ src: o2.icon,
840
966
  alt: ""
841
967
  }),
842
968
  /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
843
- position: a.position * 10
844
- }))].sort((a, c) => a.position - c.position), [l, e]);
845
- return /* @__PURE__ */ f($e, {
846
- className: t,
847
- children: [d.length !== 0 && /* @__PURE__ */ i(fe, {
848
- children: [/* @__PURE__ */ i(z, {
969
+ position: o2.position * 10
970
+ }))].sort((o2, m2) => o2.position - m2.position), [f2, s2]);
971
+ return /* @__PURE__ */ jsxs(n$1, {
972
+ className: l2,
973
+ children: [d2.length !== 0 && /* @__PURE__ */ jsx(e$3, {
974
+ children: [/* @__PURE__ */ jsx(i$2, {
849
975
  id: "Channels",
850
- onClick: () => e.closeFeature(),
976
+ onClick: () => s2.closeFeature(),
851
977
  label: "Channels",
852
- active: r === 0
853
- }, "Channels"), ...d.map((a) => a.id === N.GAMES ? /* @__PURE__ */ i(z, {
854
- ...a,
855
- active: a.id === r,
978
+ active: i2 === 0
979
+ }, "Channels"), ...d2.map((o2) => o2.id === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(i$2, {
980
+ ...o2,
981
+ active: o2.id === i2,
856
982
  label: "StreamLayer +",
857
983
  id: "featuredGroups",
858
- icon: /* @__PURE__ */ i(wn, {
984
+ icon: /* @__PURE__ */ jsx(x$1, {
859
985
  name: "icon-btn-feature-groups",
860
- "data-selected": a.id === r
986
+ "data-selected": o2.id === i2
861
987
  })
862
- }, a.id) : /* @__PURE__ */ i(z, {
863
- ...a,
988
+ }, o2.id) : /* @__PURE__ */ jsx(i$2, {
989
+ ...o2,
864
990
  icon: void 0,
865
- active: a.id === r
866
- }, a.id))]
867
- }), !d.length && /* @__PURE__ */ i(fe, {
868
- children: [/* @__PURE__ */ i(z, {
991
+ active: o2.id === i2
992
+ }, o2.id))]
993
+ }), !d2.length && /* @__PURE__ */ jsx(e$3, {
994
+ children: [/* @__PURE__ */ jsx(i$2, {
869
995
  id: "empty",
870
996
  label: "No Features...",
871
- active: !1,
872
- disabled: !0
997
+ active: false,
998
+ disabled: true
873
999
  }, "empty")]
874
- }), /* @__PURE__ */ i("div", {
875
- ref: n
1000
+ }), /* @__PURE__ */ jsx("div", {
1001
+ ref: p2
876
1002
  })]
877
1003
  });
878
- }), Un = /* @__PURE__ */ u("div")({
1004
+ });
1005
+ const a = /* @__PURE__ */ styled_default("div")({
879
1006
  name: "Container",
880
1007
  class: "c1qjj4d4",
881
- propsAsIs: !1
882
- }), Bn = /* @__PURE__ */ u("div")({
1008
+ propsAsIs: false
1009
+ }), c$1 = /* @__PURE__ */ styled_default("div")({
883
1010
  name: "CloseIconWrap",
884
1011
  class: "c1lg6b8a",
885
- propsAsIs: !1
886
- }), Fn = () => D, zn = /* @__PURE__ */ u(Fn())({
1012
+ propsAsIs: false
1013
+ }), e$1 = () => B1, l = /* @__PURE__ */ styled_default(e$1())({
887
1014
  name: "CloseIcon",
888
1015
  class: "c159el66",
889
- propsAsIs: !0
890
- }), Pn = /* @__PURE__ */ u("div")({
1016
+ propsAsIs: true
1017
+ }), p = /* @__PURE__ */ styled_default("div")({
891
1018
  name: "Title",
892
1019
  class: "t16xmufv",
893
- propsAsIs: !1
894
- }), Vn = /* @__PURE__ */ u("img")({
1020
+ propsAsIs: false
1021
+ }), i$1 = /* @__PURE__ */ styled_default("img")({
895
1022
  name: "SponsorLogo",
896
1023
  class: "s83lc21",
897
- propsAsIs: !1
898
- }), qn = /* @__PURE__ */ u("div")({
1024
+ propsAsIs: false
1025
+ }), r$1 = /* @__PURE__ */ styled_default("div")({
899
1026
  name: "PresentsTitle",
900
1027
  class: "p1p7igia",
901
- propsAsIs: !1
902
- }), jn = /* @__PURE__ */ u("div")({
1028
+ propsAsIs: false
1029
+ }), m$1 = /* @__PURE__ */ styled_default("div")({
903
1030
  name: "Subtitle",
904
1031
  class: "s1eftsbu",
905
- propsAsIs: !1
906
- }), Kn = /* @__PURE__ */ u("div")({
1032
+ propsAsIs: false
1033
+ }), I = /* @__PURE__ */ styled_default("div")({
907
1034
  name: "Description",
908
1035
  class: "d8uezec",
909
- propsAsIs: !1
910
- }), Qn = /* @__PURE__ */ u("button")({
1036
+ propsAsIs: false
1037
+ }), f$1 = /* @__PURE__ */ styled_default("button")({
911
1038
  name: "ActionButton",
912
1039
  class: "a1h1bk90",
913
- propsAsIs: !1
914
- }), ge = ({ close: e, action: t, onboarding: n }) => {
915
- var o, s, r, l, d, a, c, m;
916
- return /* @__PURE__ */ f(Un, { children: [
917
- /* @__PURE__ */ i(Bn, { "data-a": "intr", onClick: e, children: /* @__PURE__ */ i(zn, { name: "icon-cross" }) }),
918
- ((s = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ f(Pn, { children: [
919
- /* @__PURE__ */ i(Vn, { alt: "sponsor-logo", src: (l = (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.media) == null ? void 0 : l.sponsorLogo }),
920
- /* @__PURE__ */ i(qn, { children: "PRESENTS" })
1040
+ propsAsIs: false
1041
+ });
1042
+ const y = ({ close: r2, action: S2, onboarding: t2 }) => {
1043
+ var l$12, s2, c2, C2, p$12, h2, m2, i2;
1044
+ return /* @__PURE__ */ jsxs(a, { children: [
1045
+ /* @__PURE__ */ jsx(c$1, { "data-a": "intr", onClick: r2, children: /* @__PURE__ */ jsx(l, { name: "icon-cross" }) }),
1046
+ ((s2 = (l$12 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : l$12.media) == null ? void 0 : s2.sponsorLogo) && /* @__PURE__ */ jsxs(p, { children: [
1047
+ /* @__PURE__ */ jsx(i$1, { alt: "sponsor-logo", src: (C2 = (c2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : c2.media) == null ? void 0 : C2.sponsorLogo }),
1048
+ /* @__PURE__ */ jsx(r$1, { children: "PRESENTS" })
921
1049
  ] }),
922
- ((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ i(jn, { children: (a = n == null ? void 0 : n.titleCard) == null ? void 0 : a.title }),
923
- ((c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.subtitle) && /* @__PURE__ */ i(Kn, { children: (m = n == null ? void 0 : n.titleCard) == null ? void 0 : m.subtitle }),
924
- /* @__PURE__ */ i(Qn, { "data-a": "intr", onClick: t, children: "Play Now" })
1050
+ ((p$12 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : p$12.title) && /* @__PURE__ */ jsx(m$1, { children: (h2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : h2.title }),
1051
+ ((m2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : m2.subtitle) && /* @__PURE__ */ jsx(I, { children: (i2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : i2.subtitle }),
1052
+ /* @__PURE__ */ jsx(f$1, { "data-a": "intr", onClick: S2, children: "Play Now" })
925
1053
  ] });
926
- }, Q = [{
1054
+ };
1055
+ const C = [{
927
1056
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_1.png",
928
1057
  tagline: "",
929
- headline: /* @__PURE__ */ f(T, {
930
- children: ["Welcome to ", /* @__PURE__ */ i("br", {}), " Live Challenge"]
1058
+ headline: /* @__PURE__ */ jsxs(Fragment, {
1059
+ children: ["Welcome to ", /* @__PURE__ */ jsx("br", {}), " Live Challenge"]
931
1060
  })
932
1061
  }, {
933
1062
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_2.png",
@@ -935,51 +1064,51 @@ const vn = {
935
1064
  }, {
936
1065
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_3.png",
937
1066
  headline: "Win points and play against friends."
938
- }], Wn = /* @__PURE__ */ u("div")({
1067
+ }], z$1 = /* @__PURE__ */ styled_default("div")({
939
1068
  name: "OnboardingContainer",
940
1069
  class: "o1xni1kr",
941
- propsAsIs: !1
942
- }), Gn = () => W, Hn = /* @__PURE__ */ u(Gn())({
1070
+ propsAsIs: false
1071
+ }), D = () => f$5, G = /* @__PURE__ */ styled_default(D())({
943
1072
  name: "OnboardingNotificationContainer",
944
1073
  class: "o1vnouv7",
945
- propsAsIs: !0
946
- }), Ie = /* @__PURE__ */ u("div")({
1074
+ propsAsIs: true
1075
+ }), x = /* @__PURE__ */ styled_default("div")({
947
1076
  name: "InnerContainer",
948
1077
  class: "i59uefw",
949
- propsAsIs: !1
950
- }), Jn = /* @__PURE__ */ u("div")({
1078
+ propsAsIs: false
1079
+ }), U$1 = /* @__PURE__ */ styled_default("div")({
951
1080
  name: "OnboardingOverlap",
952
1081
  class: "ovnr8ov",
953
- propsAsIs: !1
954
- }), Yn = ({
955
- deepLink: e,
956
- onboardingOpts: t,
957
- notification: n,
958
- gamification: o,
959
- loading: s,
960
- sdk: r,
961
- throttled: l
1082
+ propsAsIs: false
1083
+ }), J = ({
1084
+ deepLink: l2,
1085
+ onboardingOpts: e2,
1086
+ notification: o2,
1087
+ gamification: d2,
1088
+ loading: s2,
1089
+ sdk: c2,
1090
+ throttled: I2
962
1091
  }) => {
963
- var d, a, c, m, p, h, g;
964
- const b = v(o.friends ? o.friends.getStore() : ye({
1092
+ var a2, b2, h2, f2, v2, t2, m2;
1093
+ const u2 = useStore(d2.friends ? d2.friends.getStore() : createSingleStore({
965
1094
  data: []
966
- })), [$, I] = S(void 0), B = C(() => {
967
- var R, _;
968
- const J = r.getInviter();
969
- return J ? (_ = (R = b.data) == null ? void 0 : R.find(({
970
- slId: we
971
- }) => we === J)) == null ? void 0 : _.name : "";
972
- }, [b.data, r]);
973
- return y(() => {
974
- const R = e.$store.subscribe((_) => {
975
- _ && I(_.data);
1095
+ })), [r2, S2] = useState(void 0), g2 = useMemo(() => {
1096
+ var p2, w2;
1097
+ const i2 = c2.getInviter();
1098
+ return i2 ? (w2 = (p2 = u2.data) == null ? void 0 : p2.find(({
1099
+ slId: B2
1100
+ }) => B2 === i2)) == null ? void 0 : w2.name : "";
1101
+ }, [u2.data, c2]);
1102
+ return useEffect(() => {
1103
+ const i2 = l2.$store.subscribe((p2) => {
1104
+ p2 && S2(p2.data);
976
1105
  });
977
1106
  return () => {
978
- R();
1107
+ i2();
979
1108
  };
980
- }, [e.$store]), /* @__PURE__ */ f(Wn, {
981
- children: [/* @__PURE__ */ i(Ze, {
982
- loading: s,
1109
+ }, [l2.$store]), /* @__PURE__ */ jsxs(z$1, {
1110
+ children: [/* @__PURE__ */ jsx(tn, {
1111
+ loading: s2,
983
1112
  rules: [{
984
1113
  label: "Answer as many questions as you like.",
985
1114
  icon: "icon-btn-feature-groups"
@@ -990,392 +1119,396 @@ const vn = {
990
1119
  label: "Top the leader board and best your friends.",
991
1120
  icon: "icon-trophy"
992
1121
  }],
993
- rulesBtnLabel: (d = t.rules) == null ? void 0 : d.buttonLabel,
994
- rulesTitle: (a = t.rules) == null ? void 0 : a.heading,
1122
+ rulesBtnLabel: (a2 = e2.rules) == null ? void 0 : a2.buttonLabel,
1123
+ rulesTitle: (b2 = e2.rules) == null ? void 0 : b2.heading,
995
1124
  termsTitle: "Terms and Conditions",
996
- termsText: (c = t.rules) == null ? void 0 : c.terms,
997
- steps: Q,
998
- primaryColor: (m = t.inviteCard) == null ? void 0 : m.iconColor,
999
- inviteLink: $,
1000
- inviteCardTitle: (p = t.inviteCard) == null ? void 0 : p.heading,
1001
- inviteCardSubtext: (h = t.inviteCard) == null ? void 0 : h.subtext,
1002
- inviteCardBtnLabel: (g = t.inviteCard) == null ? void 0 : g.buttonLabel,
1125
+ termsText: (h2 = e2.rules) == null ? void 0 : h2.terms,
1126
+ steps: C,
1127
+ primaryColor: (f2 = e2.inviteCard) == null ? void 0 : f2.iconColor,
1128
+ inviteLink: r2,
1129
+ inviteCardTitle: (v2 = e2.inviteCard) == null ? void 0 : v2.heading,
1130
+ inviteCardSubtext: (t2 = e2.inviteCard) == null ? void 0 : t2.subtext,
1131
+ inviteCardBtnLabel: (m2 = e2.inviteCard) == null ? void 0 : m2.buttonLabel,
1003
1132
  onClose: () => {
1004
- var R;
1005
- (R = n.close) == null || R.call(n);
1133
+ var i2;
1134
+ (i2 = o2.close) == null || i2.call(o2);
1006
1135
  },
1007
- gamification: o,
1008
- sdk: r,
1009
- inviterName: B
1010
- }), l && /* @__PURE__ */ i(Jn, {})]
1136
+ gamification: d2,
1137
+ sdk: c2,
1138
+ inviterName: g2
1139
+ }), I2 && /* @__PURE__ */ jsx(U$1, {})]
1011
1140
  });
1012
- }, Zn = ({
1013
- sdk: e,
1014
- notification: t,
1015
- saveHeight: n,
1016
- style: o,
1017
- appNode: s,
1018
- sdkInDesktopView: r,
1019
- responsiveStore: l
1141
+ }, ie = ({
1142
+ sdk: l2,
1143
+ notification: e2,
1144
+ saveHeight: o2,
1145
+ style: d2,
1146
+ appNode: s2,
1147
+ sdkInDesktopView: c2,
1148
+ responsiveStore: I2
1020
1149
  }) => {
1021
- const d = L(null), a = t.data.onboarding, [c, m] = S(a == null ? void 0 : a.instantOpen), p = e.getFeature(N.GAMES), h = C(() => Q == null ? void 0 : Q.map(({
1022
- graphicSrc: I
1023
- }) => I), []), {
1024
- screen: g
1025
- } = v(l, {
1150
+ const u2 = useRef(null), r2 = e2.data.onboarding, [S2, g2] = useState(r2 == null ? void 0 : r2.instantOpen), a2 = l2.getFeature(SdkOverlayType.GAMES), b2 = useMemo(() => C == null ? void 0 : C.map(({
1151
+ graphicSrc: t2
1152
+ }) => t2), []), {
1153
+ screen: h2
1154
+ } = useStore(I2, {
1026
1155
  keys: ["screen"]
1027
1156
  });
1028
- Te(() => {
1029
- var I;
1030
- n(((I = d.current) == null ? void 0 : I.getBoundingClientRect().height) || 0);
1031
- }, [n]);
1157
+ useLayoutEffect(() => {
1158
+ var t2;
1159
+ o2(((t2 = u2.current) == null ? void 0 : t2.getBoundingClientRect().height) || 0);
1160
+ }, [o2]);
1032
1161
  const {
1033
- loading: b,
1034
- throttled: $
1035
- } = Ye(h);
1036
- return c && p && a && s.current ? /* @__PURE__ */ i(Ne, {
1037
- container: s,
1038
- useContainer: !r,
1039
- children: /* @__PURE__ */ i(Yn, {
1040
- throttled: $,
1041
- notification: t,
1042
- setOpened: m,
1043
- gamification: p,
1044
- onboardingOpts: a,
1045
- deepLink: p.deepLink,
1046
- loading: b,
1047
- renderToNode: s,
1048
- sdk: e
1162
+ loading: f2,
1163
+ throttled: v2
1164
+ } = I$4(b2);
1165
+ return S2 && a2 && r2 && s2.current ? /* @__PURE__ */ jsx(T$2, {
1166
+ container: s2,
1167
+ useContainer: !c2,
1168
+ children: /* @__PURE__ */ jsx(J, {
1169
+ throttled: v2,
1170
+ notification: e2,
1171
+ setOpened: g2,
1172
+ gamification: a2,
1173
+ onboardingOpts: r2,
1174
+ deepLink: a2.deepLink,
1175
+ loading: f2,
1176
+ renderToNode: s2,
1177
+ sdk: l2
1049
1178
  })
1050
- }) : /* @__PURE__ */ f(T, {
1051
- children: [/* @__PURE__ */ i(Ie, {
1052
- ref: d,
1179
+ }) : /* @__PURE__ */ jsxs(Fragment, {
1180
+ children: [/* @__PURE__ */ jsx(x, {
1181
+ ref: u2,
1053
1182
  style: {
1054
1183
  position: "absolute",
1055
1184
  visibility: "hidden"
1056
1185
  },
1057
- children: /* @__PURE__ */ i(ge, {
1186
+ children: /* @__PURE__ */ jsx(y, {
1058
1187
  close: () => {
1059
1188
  },
1060
1189
  action: () => {
1061
1190
  },
1062
- onboarding: a
1191
+ onboarding: r2
1063
1192
  })
1064
- }), /* @__PURE__ */ i(Hn, {
1065
- style: o,
1066
- hiding: t.hiding,
1067
- children: /* @__PURE__ */ i(Ie, {
1068
- children: /* @__PURE__ */ i(ge, {
1069
- close: t.close,
1193
+ }), /* @__PURE__ */ jsx(G, {
1194
+ style: d2,
1195
+ hiding: e2.hiding,
1196
+ children: /* @__PURE__ */ jsx(x, {
1197
+ children: /* @__PURE__ */ jsx(y, {
1198
+ close: e2.close,
1070
1199
  action: () => {
1071
- var I;
1072
- m(!0), (((I = s.current) == null ? void 0 : I.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, {
1200
+ var m2;
1201
+ g2(true), (((m2 = s2.current) == null ? void 0 : m2.getBoundingClientRect().y) || 0) < 0 && I$2(s2, h2.size, {
1073
1202
  behavior: "smooth"
1074
1203
  });
1075
1204
  },
1076
- onboarding: a
1205
+ onboarding: r2
1077
1206
  })
1078
1207
  })
1079
1208
  })]
1080
1209
  });
1081
- }, Xn = () => W, es = /* @__PURE__ */ u(Xn())({
1210
+ };
1211
+ const e = () => f$5, c = /* @__PURE__ */ styled_default(e())({
1082
1212
  name: "Container",
1083
1213
  class: "c8ol1ve",
1084
- propsAsIs: !0
1085
- }), Ae = /* @__PURE__ */ u("div")({
1214
+ propsAsIs: true
1215
+ }), t = /* @__PURE__ */ styled_default("div")({
1086
1216
  name: "InnerContainer",
1087
1217
  class: "iqfywam",
1088
- propsAsIs: !1
1089
- }), ts = () => Ae, ns = /* @__PURE__ */ u(ts())({
1218
+ propsAsIs: false
1219
+ }), i = () => t, m = /* @__PURE__ */ styled_default(i())({
1090
1220
  name: "HiddenContainer",
1091
1221
  class: "hokmtod",
1092
- propsAsIs: !0
1093
- }), ss = /* @__PURE__ */ u("div")({
1222
+ propsAsIs: true
1223
+ }), f = /* @__PURE__ */ styled_default("div")({
1094
1224
  name: "NotificationRefreshing",
1095
1225
  class: "n192d1q8",
1096
- propsAsIs: !1
1097
- }), os = () => Xe, is = /* @__PURE__ */ u(os())({
1226
+ propsAsIs: false
1227
+ }), r = () => f$6, d = /* @__PURE__ */ styled_default(r())({
1098
1228
  name: "Pill",
1099
1229
  class: "p1lha68t",
1100
- propsAsIs: !0
1101
- }), as = (e) => {
1102
- const [t, n] = S(0), o = L(null), s = C(() => new ResizeObserver((d) => {
1230
+ propsAsIs: true
1231
+ });
1232
+ const v = (r2) => {
1233
+ const [e2, d2] = useState(0), i2 = useRef(null), l2 = useMemo(() => new ResizeObserver((n2) => {
1103
1234
  window.requestAnimationFrame(() => {
1104
- var a;
1105
- if (Array.isArray(d)) {
1106
- for (const c of d)
1107
- if (c.contentBoxSize) {
1108
- const m = (a = o.current) == null ? void 0 : a.getBoundingClientRect();
1109
- m && n(m.height);
1235
+ var f2;
1236
+ if (Array.isArray(n2)) {
1237
+ for (const c2 of n2)
1238
+ if (c2.contentBoxSize) {
1239
+ const o2 = (f2 = i2.current) == null ? void 0 : f2.getBoundingClientRect();
1240
+ o2 && d2(o2.height);
1110
1241
  }
1111
1242
  }
1112
1243
  });
1113
- }), []), r = j((d) => {
1114
- o.current = d;
1115
- }, []), l = j((d) => {
1116
- n(d);
1244
+ }), []), s2 = useCallback((n2) => {
1245
+ i2.current = n2;
1246
+ }, []), a2 = useCallback((n2) => {
1247
+ d2(n2);
1117
1248
  }, []);
1118
- return y(() => {
1119
- const d = o.current;
1120
- return d ? (s.observe(d), () => {
1121
- s.unobserve(d);
1249
+ return useEffect(() => {
1250
+ const n2 = i2.current;
1251
+ return n2 ? (l2.observe(n2), () => {
1252
+ l2.unobserve(n2);
1122
1253
  }) : () => {
1123
1254
  };
1124
- }, [e]), y(() => () => {
1125
- s.disconnect();
1126
- }), [r, t, l];
1127
- }, rs = ({
1128
- sdk: e,
1129
- notification: t,
1130
- appNode: n,
1131
- responsiveStore: o,
1132
- hasActiveFeature: s
1255
+ }, [r2]), useEffect(() => () => {
1256
+ l2.disconnect();
1257
+ }), [s2, e2, a2];
1258
+ }, Q = ({
1259
+ sdk: r2,
1260
+ notification: e2,
1261
+ appNode: d2,
1262
+ responsiveStore: i2,
1263
+ hasActiveFeature: l2
1133
1264
  }) => {
1134
- var r, l;
1265
+ var t$12, m$12;
1135
1266
  const {
1136
- sdkInDesktopView: d
1137
- } = v(o, {
1267
+ sdkInDesktopView: s2
1268
+ } = useStore(i2, {
1138
1269
  keys: ["sdkInDesktopView"]
1139
1270
  }), {
1140
- sdk: a
1141
- } = G(), [c, m, p] = as(t.id);
1142
- let h = m;
1143
- return s || (h = "auto"), t.type === P.QUESTION ? /* @__PURE__ */ f(T, {
1144
- children: [/* @__PURE__ */ i(ns, {
1145
- ref: c,
1146
- children: /* @__PURE__ */ i(te, {
1147
- ...t
1271
+ sdk: a2
1272
+ } = p$3(), [n2, f$12, c$12] = v(e2.id);
1273
+ let o2 = f$12;
1274
+ return l2 || (o2 = "auto"), e2.type === NotificationType.QUESTION ? /* @__PURE__ */ jsxs(Fragment, {
1275
+ children: [/* @__PURE__ */ jsx(m, {
1276
+ ref: n2,
1277
+ children: /* @__PURE__ */ jsx(w$2, {
1278
+ ...e2
1148
1279
  })
1149
- }), /* @__PURE__ */ f(es, {
1280
+ }), /* @__PURE__ */ jsxs(c, {
1150
1281
  style: {
1151
- height: t.hiding ? 0 : h
1282
+ height: e2.hiding ? 0 : o2
1152
1283
  },
1153
- hiding: t.hiding,
1154
- children: [/* @__PURE__ */ i(Ae, {
1284
+ hiding: e2.hiding,
1285
+ children: [/* @__PURE__ */ jsx(t, {
1155
1286
  style: {
1156
1287
  height: "100%"
1157
1288
  },
1158
- children: /* @__PURE__ */ i(te, {
1159
- ...t,
1160
- controlVideo: a == null ? void 0 : a.controlVideoPlayer
1289
+ children: /* @__PURE__ */ jsx(w$2, {
1290
+ ...e2,
1291
+ controlVideo: a2 == null ? void 0 : a2.controlVideoPlayer
1161
1292
  })
1162
- }), /* @__PURE__ */ i(ss, {}, t.id)]
1293
+ }), /* @__PURE__ */ jsx(f, {}, e2.id)]
1163
1294
  })]
1164
- }) : t.type === P.QUESTION_RESOLVED && (l = (r = t.data) == null ? void 0 : r.question) != null && l.predictionResult ? /* @__PURE__ */ i(et, {
1295
+ }) : e2.type === NotificationType.QUESTION_RESOLVED && ((m$12 = (t$12 = e2.data) == null ? void 0 : t$12.question) != null && m$12.predictionResult) ? /* @__PURE__ */ jsx(D$2, {
1165
1296
  style: {
1166
- height: t.hiding ? 0 : m
1297
+ height: e2.hiding ? 0 : f$12
1167
1298
  },
1168
- saveHeight: p,
1169
- close: t.close,
1170
- hiding: t.hiding,
1171
- ...t.data.question
1172
- }) : t.type === P.ONBOARDING ? /* @__PURE__ */ i(Zn, {
1299
+ saveHeight: c$12,
1300
+ close: e2.close,
1301
+ hiding: e2.hiding,
1302
+ ...e2.data.question
1303
+ }) : e2.type === NotificationType.ONBOARDING ? /* @__PURE__ */ jsx(ie, {
1173
1304
  style: {
1174
- height: t.hiding ? 0 : h
1305
+ height: e2.hiding ? 0 : o2
1175
1306
  },
1176
- saveHeight: p,
1177
- sdk: e,
1178
- notification: t,
1179
- sdkInDesktopView: d,
1180
- appNode: n,
1181
- responsiveStore: o
1307
+ saveHeight: c$12,
1308
+ sdk: r2,
1309
+ notification: e2,
1310
+ sdkInDesktopView: s2,
1311
+ appNode: d2,
1312
+ responsiveStore: i2
1182
1313
  }) : null;
1183
- }, ls = "p7vfi6t", ds = ({
1184
- pill: e,
1185
- setPill: t,
1186
- appNode: n,
1187
- headerNode: o,
1188
- scrollNode: s,
1189
- responsiveStore: r,
1190
- scrollStore: l
1314
+ }, F = "p7vfi6t", U = ({
1315
+ pill: r2,
1316
+ setPill: e2,
1317
+ appNode: d$12,
1318
+ headerNode: i2,
1319
+ scrollNode: l2,
1320
+ responsiveStore: s2,
1321
+ scrollStore: a2
1191
1322
  }) => {
1192
- var d, a;
1323
+ var t2, m2;
1193
1324
  const {
1194
- screen: c
1195
- } = v(r, {
1325
+ screen: n2
1326
+ } = useStore(s2, {
1196
1327
  keys: ["screen"]
1197
1328
  }), {
1198
- tabsShown: m,
1199
- scrollPosition: p
1200
- } = v(l, {
1329
+ tabsShown: f2,
1330
+ scrollPosition: c2
1331
+ } = useStore(a2, {
1201
1332
  keys: ["tabsShown", "scrollPosition"]
1202
1333
  });
1203
- y(() => {
1204
- r.get().sdkInDesktopView ? p < 50 && t(null) : p > -50 && t(null);
1205
- }, [p, r, t]);
1206
- const h = r.get().sdkInDesktopView ? n : o;
1207
- return !e || !h.current ? null : ht(/* @__PURE__ */ i(is, {
1208
- title: e.type === P.QUESTION_RESOLVED ? "Prediction result" : `New ${((a = mt[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : a.label) || "notification"}`,
1334
+ useEffect(() => {
1335
+ s2.get().sdkInDesktopView ? c2 < 50 && e2(null) : c2 > -50 && e2(null);
1336
+ }, [c2, s2, e2]);
1337
+ const o2 = s2.get().sdkInDesktopView ? d$12 : i2;
1338
+ return !r2 || !o2.current ? null : createPortal(/* @__PURE__ */ jsx(d, {
1339
+ title: r2.type === NotificationType.QUESTION_RESOLVED ? "Prediction result" : `New ${((m2 = e$7[(t2 = r2.data) == null ? void 0 : t2.questionType]) == null ? void 0 : m2.label) || "notification"}`,
1209
1340
  "data-a": "intr",
1210
1341
  onClick: () => {
1211
- var g;
1212
- r.get().sdkInDesktopView ? (g = s.current) == null || g.scrollTo({
1342
+ var g2;
1343
+ s2.get().sdkInDesktopView ? (g2 = l2.current) == null || g2.scrollTo({
1213
1344
  top: 0,
1214
1345
  behavior: "smooth"
1215
- }) : H(n, c.size, {
1346
+ }) : I$2(d$12, n2.size, {
1216
1347
  behavior: "smooth"
1217
- }), t(null);
1348
+ }), e2(null);
1218
1349
  },
1219
- className: E(m && ls, "sl-pill-button")
1220
- }), h.current);
1221
- }, cs = ({
1222
- sdk: e,
1223
- headerNode: t,
1224
- scrollNode: n,
1225
- responsiveStore: o,
1226
- appNode: s,
1227
- scrollStore: r,
1228
- hasActiveFeature: l
1350
+ className: cx_default(f2 && F, "sl-pill-button")
1351
+ }), o2.current);
1352
+ }, ne = ({
1353
+ sdk: r2,
1354
+ headerNode: e2,
1355
+ scrollNode: d2,
1356
+ responsiveStore: i2,
1357
+ appNode: l2,
1358
+ scrollStore: s2,
1359
+ hasActiveFeature: a2
1229
1360
  }) => {
1230
- const [d] = S(e.getNotificationsStore()), a = v(d), [c, m] = S(null), p = C(() => e.getActiveNotification(), [e, a]);
1231
- return y(() => {
1232
- p && at.emit("notification", {
1361
+ const [n2] = useState(r2.getNotificationsStore()), f2 = useStore(n2), [c2, o2] = useState(null), t2 = useMemo(() => r2.getActiveNotification(), [r2, f2]);
1362
+ return useEffect(() => {
1363
+ t2 && eventBus.emit("notification", {
1233
1364
  action: "rendered",
1234
1365
  payload: {
1235
- questionId: p.data.questionId,
1236
- questionType: p.data.questionType
1366
+ questionId: t2.data.questionId,
1367
+ questionType: t2.data.questionType
1237
1368
  }
1238
1369
  });
1239
- }, [p]), y(() => {
1370
+ }, [t2]), useEffect(() => {
1240
1371
  const {
1241
- sdkInDesktopView: h,
1242
- sdkInView: g
1243
- } = o.get();
1244
- p && (h || g) && (!h && g && m(p), h && window.requestAnimationFrame(() => {
1245
- r.get().scrollPosition !== 0 && m(p);
1372
+ sdkInDesktopView: m2,
1373
+ sdkInView: g2
1374
+ } = i2.get();
1375
+ t2 && (m2 || g2) && (!m2 && g2 && o2(t2), m2 && window.requestAnimationFrame(() => {
1376
+ s2.get().scrollPosition !== 0 && o2(t2);
1246
1377
  }));
1247
- }, [p]), y(() => {
1248
- p || m(null);
1249
- }, [p]), /* @__PURE__ */ f(T, {
1250
- children: [!c && p && /* @__PURE__ */ i(rs, {
1251
- appNode: s,
1252
- sdk: e,
1253
- hasActiveFeature: l,
1254
- notification: p,
1255
- responsiveStore: o
1256
- }), c && /* @__PURE__ */ i(ds, {
1257
- pill: c,
1258
- setPill: m,
1259
- appNode: s,
1260
- notification: p,
1261
- headerNode: t,
1262
- scrollNode: n,
1263
- scrollStore: r,
1264
- responsiveStore: o
1378
+ }, [t2]), useEffect(() => {
1379
+ t2 || o2(null);
1380
+ }, [t2]), /* @__PURE__ */ jsxs(Fragment, {
1381
+ children: [!c2 && t2 && /* @__PURE__ */ jsx(Q, {
1382
+ appNode: l2,
1383
+ sdk: r2,
1384
+ hasActiveFeature: a2,
1385
+ notification: t2,
1386
+ responsiveStore: i2
1387
+ }), c2 && /* @__PURE__ */ jsx(U, {
1388
+ pill: c2,
1389
+ setPill: o2,
1390
+ appNode: l2,
1391
+ notification: t2,
1392
+ headerNode: e2,
1393
+ scrollNode: d2,
1394
+ scrollStore: s2,
1395
+ responsiveStore: i2
1265
1396
  })]
1266
1397
  });
1267
- }, ps = (e) => {
1268
- const t = v(e.status), n = v(e.sdkStore.slStreamId), o = v(e.userId()), s = v(e.getActiveFeature()), r = t === "ready" && !!n.data;
1269
- return y(() => {
1270
- const l = e.getFeature(N.GAMES);
1271
- l && s !== N.GAMES && (l.closeQuestion(), l.closeUser()), l == null || l.openedQuestionId.subscribe((d) => {
1272
- d && s !== N.GAMES && e.openFeature(N.GAMES);
1398
+ };
1399
+ const A = (e2) => {
1400
+ const u2 = useStore(e2.status), a2 = useStore(e2.sdkStore.slStreamId), c2 = useStore(e2.userId()), r2 = useStore(e2.getActiveFeature()), n2 = u2 === "ready" && !!a2.data;
1401
+ return useEffect(() => {
1402
+ const t2 = e2.getFeature(SdkOverlayType.GAMES);
1403
+ t2 && r2 !== SdkOverlayType.GAMES && (t2.closeQuestion(), t2.closeUser()), t2 == null || t2.openedQuestionId.subscribe((p2) => {
1404
+ p2 && r2 !== SdkOverlayType.GAMES && e2.openFeature(SdkOverlayType.GAMES);
1273
1405
  });
1274
- }, [s, e]), {
1275
- sdkReady: r,
1276
- activeFeature: s,
1277
- isLogged: !!o
1406
+ }, [r2, e2]), {
1407
+ sdkReady: n2,
1408
+ activeFeature: r2,
1409
+ isLogged: !!c2
1278
1410
  };
1279
- }, us = ({
1280
- sdk: e,
1281
- className: t,
1282
- scrollStore: n,
1283
- appNode: o,
1284
- scrollNode: s,
1285
- responsiveStore: r
1411
+ };
1412
+ const z = ({
1413
+ sdk: e2,
1414
+ className: l2,
1415
+ scrollStore: o2,
1416
+ appNode: a2,
1417
+ scrollNode: m2,
1418
+ responsiveStore: r2
1286
1419
  }) => {
1287
- const [, l] = tt(e);
1288
- return /* @__PURE__ */ i(cn, {
1289
- className: t,
1290
- scrollNode: s,
1291
- appNode: o,
1292
- scrollStore: n,
1293
- feature: l,
1294
- responsiveStore: r,
1295
- sdk: e
1420
+ const [, t2] = p$5(e2);
1421
+ return /* @__PURE__ */ jsx(x$2, {
1422
+ className: l2,
1423
+ scrollNode: m2,
1424
+ appNode: a2,
1425
+ scrollStore: o2,
1426
+ feature: t2,
1427
+ responsiveStore: r2,
1428
+ sdk: e2
1296
1429
  });
1297
- }, ms = ({
1298
- sdk: e,
1299
- muted: t,
1300
- className: n,
1301
- appNode: o,
1302
- responsiveStore: s
1430
+ }, B = ({
1431
+ sdk: e2,
1432
+ muted: l2,
1433
+ className: o2,
1434
+ appNode: a2,
1435
+ responsiveStore: m2
1303
1436
  }) => {
1304
- const r = v(e.featuresList.getStore());
1305
- return r ? Array.from(r, (l) => {
1306
- const d = e.getFeature(l);
1307
- return d ? /* @__PURE__ */ i(pn, {
1308
- className: n,
1309
- muted: t,
1310
- appNode: o,
1311
- feature: d,
1312
- responsiveStore: s,
1313
- sdk: e
1314
- }, l) : null;
1437
+ const r2 = useStore(e2.featuresList.getStore());
1438
+ return r2 ? Array.from(r2, (t2) => {
1439
+ const i2 = e2.getFeature(t2);
1440
+ return i2 ? /* @__PURE__ */ jsx(A$1, {
1441
+ className: o2,
1442
+ muted: l2,
1443
+ appNode: a2,
1444
+ feature: i2,
1445
+ responsiveStore: m2,
1446
+ sdk: e2
1447
+ }, t2) : null;
1315
1448
  }) : null;
1316
- }, hs = ({
1317
- sdk: e,
1318
- muted: t,
1319
- topNavigation: n
1449
+ }, oe = ({
1450
+ sdk: e2,
1451
+ muted: l2,
1452
+ topNavigation: o2
1320
1453
  }) => {
1321
- const [o, s] = S(!0), r = L(null), l = v(e.uiState), d = L(null), [a] = vt(r), [c, m] = gt(r, a), {
1322
- sdkReady: p,
1323
- activeFeature: h,
1324
- isLogged: g
1325
- } = ps(e), b = !!p;
1326
- st(r, {
1327
- enabled: b,
1454
+ const [a2, m2] = useState(true), r2 = useRef(null), t2 = useStore(e2.uiState), i2 = useRef(null), [c2] = h(r2), [p2, d2] = L(r2, c2), {
1455
+ sdkReady: x2,
1456
+ activeFeature: f2,
1457
+ isLogged: N2
1458
+ } = A(e2), s2 = !!x2;
1459
+ b$3(r2, {
1460
+ enabled: s2,
1328
1461
  event: "click",
1329
- listener: ot
1462
+ listener: A$3
1330
1463
  });
1331
- const $ = C(() => ({
1332
- sdk: e,
1333
- topNavigation: n
1334
- }), [e, n]);
1335
- return y(() => {
1464
+ const g2 = useMemo(() => ({
1465
+ sdk: e2,
1466
+ topNavigation: o2
1467
+ }), [e2, o2]);
1468
+ return useEffect(() => {
1336
1469
  import("./gamification-feature.js");
1337
- }, []), /* @__PURE__ */ i(lt.Provider, {
1338
- value: $,
1339
- children: /* @__PURE__ */ f(Qe, {
1340
- ref: (I) => {
1341
- r.current = I, s(!!I);
1470
+ }, []), /* @__PURE__ */ jsx(e$8.Provider, {
1471
+ value: g2,
1472
+ children: /* @__PURE__ */ jsxs(p$4, {
1473
+ ref: (S2) => {
1474
+ r2.current = S2, m2(!!S2);
1342
1475
  },
1343
- className: n ? "" : "c10llmat",
1344
- children: [b && n && l.app && /* @__PURE__ */ i(Mn, {
1345
- className: E(F, "sl-hide-on-modal"),
1346
- sdk: e,
1347
- ref: d
1348
- }), b && !n && !!h && l.app && /* @__PURE__ */ i(_n, {
1349
- className: E(F, "sl-hide-on-modal"),
1350
- sdk: e,
1351
- ref: d
1352
- }), /* @__PURE__ */ f(We, {
1476
+ className: o2 ? "" : "c10llmat",
1477
+ children: [s2 && o2 && t2.app && /* @__PURE__ */ jsx(J$1, {
1478
+ className: cx_default(m$6, "sl-hide-on-modal"),
1479
+ sdk: e2,
1480
+ ref: i2
1481
+ }), s2 && !o2 && !!f2 && t2.app && /* @__PURE__ */ jsx(z$2, {
1482
+ className: cx_default(m$6, "sl-hide-on-modal"),
1483
+ sdk: e2,
1484
+ ref: i2
1485
+ }), /* @__PURE__ */ jsxs(c$5, {
1353
1486
  className: "sl-hide-on-modal",
1354
- ref: c,
1355
- "data-nav": (!!h && b).toString(),
1356
- children: [b && l.app && /* @__PURE__ */ i(cs, {
1357
- sdk: e,
1358
- scrollNode: c,
1359
- headerNode: d,
1360
- appNode: r,
1361
- scrollStore: m,
1362
- responsiveStore: a,
1363
- hasActiveFeature: !!h
1364
- }), b && l.app && /* @__PURE__ */ i(us, {
1365
- scrollStore: m,
1366
- responsiveStore: a,
1367
- scrollNode: c,
1368
- appNode: r,
1369
- className: F,
1370
- sdk: e
1371
- }), b && o && /* @__PURE__ */ i(ms, {
1372
- muted: t,
1373
- responsiveStore: a,
1374
- appNode: r,
1375
- className: F,
1376
- sdk: e
1487
+ ref: p2,
1488
+ "data-nav": (!!f2 && s2).toString(),
1489
+ children: [s2 && t2.app && /* @__PURE__ */ jsx(ne, {
1490
+ sdk: e2,
1491
+ scrollNode: p2,
1492
+ headerNode: i2,
1493
+ appNode: r2,
1494
+ scrollStore: d2,
1495
+ responsiveStore: c2,
1496
+ hasActiveFeature: !!f2
1497
+ }), s2 && t2.app && /* @__PURE__ */ jsx(z, {
1498
+ scrollStore: d2,
1499
+ responsiveStore: c2,
1500
+ scrollNode: p2,
1501
+ appNode: r2,
1502
+ className: m$6,
1503
+ sdk: e2
1504
+ }), s2 && a2 && /* @__PURE__ */ jsx(B, {
1505
+ muted: l2,
1506
+ responsiveStore: c2,
1507
+ appNode: r2,
1508
+ className: m$6,
1509
+ sdk: e2
1377
1510
  })]
1378
- }), b && !g && o && l.app && /* @__PURE__ */ i("div", {
1511
+ }), s2 && !N2 && a2 && t2.app && /* @__PURE__ */ jsx("div", {
1379
1512
  style: {
1380
1513
  display: "flex",
1381
1514
  alignItems: "center",
@@ -1387,13 +1520,14 @@ const vn = {
1387
1520
  })]
1388
1521
  })
1389
1522
  });
1390
- }, zs = ({ event: e, topNavigation: t, theme: n, muted: o, withSidebarNotification: s = !0 }) => {
1391
- const { sdk: r, status: l } = Y(Z), d = De(), a = Oe(), { event: c } = Y(Z);
1392
- if (l === X.UNSET)
1523
+ };
1524
+ const b = ({ event: p2, topNavigation: S2, theme: c2, muted: u2, withSidebarNotification: d2 = true }) => {
1525
+ const { sdk: t2, status: i2 } = useContext(i$7), e2 = F$2(), m2 = z$4(), { event: a2 } = useContext(i$7);
1526
+ if (i2 === Y.UNSET)
1393
1527
  throw new Error("Wrap app in `StreamLayerProvider`");
1394
- return l === X.CONNECTED ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "wait" }) : r === null ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !d.app && !d.appNotification && !d.appSidebar || !d.app && !d.appSidebar && d.appNotification && !s ? null : /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ i(Me, { customTheme: n ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ i(hs, { sdk: r, muted: o, event: (c == null ? void 0 : c.current) || e, topNavigation: t }) }) });
1528
+ return i2 === Y.CONNECTED ? /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: "wait" }) : t2 === null ? /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !e2.app && !e2.appNotification && !e2.appSidebar || !e2.app && !e2.appSidebar && e2.appNotification && !d2 ? null : /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h$1, { customTheme: c2 ?? m2.theme, themeMode: m2.themeMode, children: /* @__PURE__ */ jsx(oe, { sdk: t2, muted: u2, event: (a2 == null ? void 0 : a2.current) || p2, topNavigation: S2 }) }) });
1395
1529
  };
1396
1530
  export {
1397
- Fs as B,
1398
- zs as b
1531
+ B$2 as B,
1532
+ b
1399
1533
  };