@streamlayer/react 1.23.2 → 1.24.0

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