@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
@@ -1,280 +1,257 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { h } from "./index7.js";
3
- import { s as styled_default, u as useStore, c as cx_default } from "./sl-types.js";
4
- import { d as distExports } from "./index11.js";
5
- import { useState, useRef, useCallback, useEffect, Component } from "react";
6
- import { e as eventBus } from "./index5.js";
7
- import { B, z } from "./hooks-WfHlJH12.js";
8
- const e = /* @__PURE__ */ styled_default("div")({
1
+ import { jsx as r, jsxs as D } from "react/jsx-runtime";
2
+ import { h as M } from "./index8.js";
3
+ import { s as d, u as q, c as V } from "./sl-types.js";
4
+ import { d as j } from "./index10.js";
5
+ import { useState as B, useRef as x, useCallback as _, useEffect as c, Component as K } from "react";
6
+ import { e as T } from "./index4.js";
7
+ import { Y as z, _ as G } from "./hooks-n9ax4LRT.js";
8
+ const O = /* @__PURE__ */ d("div")({
9
9
  name: "PauseAdOverlay",
10
10
  class: "pw9gih8",
11
- propsAsIs: false
12
- }), t = /* @__PURE__ */ styled_default("div")({
11
+ propsAsIs: !1
12
+ }), W = /* @__PURE__ */ d("div")({
13
13
  name: "PauseAdContent",
14
14
  class: "p8lpomy",
15
- propsAsIs: false
16
- }), p = /* @__PURE__ */ styled_default("div")({
15
+ propsAsIs: !1
16
+ }), X = /* @__PURE__ */ d("div")({
17
17
  name: "PauseAdTopLeft",
18
18
  class: "pv7u167",
19
- propsAsIs: false
20
- }), o = /* @__PURE__ */ styled_default("h2")({
19
+ propsAsIs: !1
20
+ }), Y = /* @__PURE__ */ d("h2")({
21
21
  name: "PauseAdTitle",
22
22
  class: "p1kh2yb0",
23
- propsAsIs: false
24
- }), n = /* @__PURE__ */ styled_default("p")({
23
+ propsAsIs: !1
24
+ }), H = /* @__PURE__ */ d("p")({
25
25
  name: "PauseAdCaption",
26
26
  class: "pl8f94x",
27
- propsAsIs: false
28
- }), d = /* @__PURE__ */ styled_default("div")({
27
+ propsAsIs: !1
28
+ }), J = /* @__PURE__ */ d("div")({
29
29
  name: "PauseAdBottomLeft",
30
30
  class: "p1m6zmrt",
31
- propsAsIs: false
32
- }), l = /* @__PURE__ */ styled_default("button")({
31
+ propsAsIs: !1
32
+ }), Q = /* @__PURE__ */ d("button")({
33
33
  name: "PauseAdPlayButton",
34
34
  class: "pm3vwfa",
35
- propsAsIs: false
36
- }), A = /* @__PURE__ */ styled_default("div")({
35
+ propsAsIs: !1
36
+ }), Z = /* @__PURE__ */ d("div")({
37
37
  name: "PauseAdSidebarGradient",
38
38
  class: "p1tibuhw",
39
- propsAsIs: false
40
- }), r = /* @__PURE__ */ styled_default("div")({
39
+ propsAsIs: !1
40
+ }), $ = /* @__PURE__ */ d("div")({
41
41
  name: "PauseAdSidebar",
42
42
  class: "ptqqrqd",
43
- propsAsIs: false
44
- }), i = /* @__PURE__ */ styled_default("span")({
43
+ propsAsIs: !1
44
+ }), ee = /* @__PURE__ */ d("span")({
45
45
  name: "PauseAdTitleDescription",
46
46
  class: "p14estxv",
47
- propsAsIs: false
48
- }), u = /* @__PURE__ */ styled_default("img")({
47
+ propsAsIs: !1
48
+ }), N = /* @__PURE__ */ d("img")({
49
49
  name: "ExternalAdContainer",
50
50
  class: "e1dpvfl1",
51
- propsAsIs: false
52
- });
53
- const W = ({
54
- vastUrl: l2,
55
- isDesktop: o2,
56
- content: r2
57
- }) => (useEffect(() => {
58
- r2.imageSrc && r2.id && eventBus.emit("exposedPauseAd", {
51
+ propsAsIs: !1
52
+ }), re = ({
53
+ vastUrl: i,
54
+ isDesktop: a,
55
+ content: e
56
+ }) => (c(() => {
57
+ e.imageSrc && e.id && T.emit("exposedPauseAd", {
59
58
  action: "rendered",
60
59
  payload: {
61
- id: r2.id,
62
- parentId: r2.parentId
60
+ id: e.id,
61
+ parentId: e.parentId
63
62
  }
64
63
  });
65
- }, [r2, l2]), r2 != null && r2.imageSrc ? !r2.adUrl || !o2 ? /* @__PURE__ */ jsx(u, { src: r2.imageSrc }) : /* @__PURE__ */ jsx(
64
+ }, [e, i]), e?.imageSrc ? !e.adUrl || !a ? /* @__PURE__ */ r(N, { src: e.imageSrc }) : /* @__PURE__ */ r(
66
65
  "a",
67
66
  {
68
67
  onClick: () => {
69
- eventBus.emit("exposedPauseAd", {
68
+ T.emit("exposedPauseAd", {
70
69
  action: "navigated",
71
70
  payload: {
72
- id: r2.id,
73
- parentId: r2.parentId
71
+ id: e.id,
72
+ parentId: e.parentId
74
73
  }
75
74
  });
76
75
  },
77
- href: r2.adUrl,
76
+ href: e.adUrl,
78
77
  target: "_blank",
79
78
  rel: "noopener noreferrer",
80
- children: /* @__PURE__ */ jsx(u, { src: r2.imageSrc })
79
+ children: /* @__PURE__ */ r(N, { src: e.imageSrc })
81
80
  }
82
- ) : null), X = ({ isClosing: l$1, content: o$1, externalPauseAdStore: r$1, title: k, caption: y, onPlay: f, onClose: a, vastUrl: c, options: A$1, isDesktop: m }) => {
83
- const v = (A$1 == null ? void 0 : A$1.showPauseButton) ?? true, { ref: s, focusSelf: I } = distExports.useFocusable({
81
+ ) : null), te = ({ isClosing: i, content: a, externalPauseAdStore: e, title: y, caption: f, onPlay: l, onClose: u, vastUrl: t, options: h, isDesktop: n }) => {
82
+ const b = h?.showPauseButton ?? !0, { ref: p, focusSelf: I } = j.useFocusable({
84
83
  focusKey: "sl-pause-ad-play",
85
- onEnterRelease: f,
86
- isFocusBoundary: true,
87
- forceFocus: true
84
+ onEnterRelease: l,
85
+ isFocusBoundary: !0,
86
+ forceFocus: !0
88
87
  });
89
- return useEffect(() => () => {
90
- r$1.revalidate();
91
- }, [r$1]), useEffect(() => {
92
- s.current && I();
93
- }, [s, I]), useEffect(() => {
94
- if (!a)
88
+ return c(() => () => {
89
+ e.revalidate();
90
+ }, [e]), c(() => {
91
+ p.current && I();
92
+ }, [p, I]), c(() => {
93
+ if (!u)
95
94
  return () => {
96
95
  };
97
- const E = (d2) => {
98
- const t2 = d2.keyCode;
99
- if (t2 === 461 || t2 === 10009 || t2 === 27 || t2 === 8) {
100
- d2.preventDefault(), d2.stopPropagation(), d2.stopImmediatePropagation(), a();
96
+ const C = (A) => {
97
+ const s = A.keyCode;
98
+ if (s === 461 || s === 10009 || s === 27 || s === 8) {
99
+ A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), u();
101
100
  return;
102
101
  }
103
102
  };
104
- return window.addEventListener("keydown", E, { capture: true }), () => window.removeEventListener("keydown", E, { capture: true });
105
- }, [a]), /* @__PURE__ */ jsx(e, { className: cx_default("SL_PauseAd", l$1 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t, { children: [
106
- /* @__PURE__ */ jsxs(p, { children: [
107
- /* @__PURE__ */ jsx(o, { children: k }),
108
- /* @__PURE__ */ jsx(n, { children: y })
103
+ return window.addEventListener("keydown", C, { capture: !0 }), () => window.removeEventListener("keydown", C, { capture: !0 });
104
+ }, [u]), /* @__PURE__ */ r(O, { className: V("SL_PauseAd", i && "pause-ad-closing"), children: /* @__PURE__ */ D(W, { children: [
105
+ /* @__PURE__ */ D(X, { children: [
106
+ /* @__PURE__ */ r(Y, { children: y }),
107
+ /* @__PURE__ */ r(H, { children: f })
109
108
  ] }),
110
- v && /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(
111
- l,
109
+ b && /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(
110
+ Q,
112
111
  {
113
- ref: s,
114
- onClick: f,
115
- onMouseEnter: () => s.current.focus(),
112
+ ref: p,
113
+ onClick: l,
114
+ onMouseEnter: () => p.current.focus(),
116
115
  "aria-label": "Resume playback"
117
116
  }
118
117
  ) }),
119
- /* @__PURE__ */ jsx(A, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ jsxs(r, { children: [
120
- c && /* @__PURE__ */ jsx(W, { content: o$1, isDesktop: m, vastUrl: c }),
121
- /* @__PURE__ */ jsx(i, { children: "ADVERTISEMENT" })
118
+ /* @__PURE__ */ r(Z, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ D($, { children: [
119
+ t && /* @__PURE__ */ r(re, { content: a, isDesktop: n, vastUrl: t }),
120
+ /* @__PURE__ */ r(ee, { children: "ADVERTISEMENT" })
122
121
  ] }) })
123
122
  ] }) });
124
- }, se = ({ showPauseAd: l2, vastUrls: o2, title: r2, caption: k, sdk: y, onClose: f, onRender: a, options: c, isDesktop: A2 }) => {
125
- const m = (c == null ? void 0 : c.pauseAdDelay) ?? 0, v = (c == null ? void 0 : c.pauseAdRefetchInterval) ?? 1e3 * 60 * 50, [s, I] = useState(false), [E, d2] = useState(false), t2 = useRef(), p2 = o2 == null ? void 0 : o2[0].url, P = useRef(p2), S = useRef(""), T = useRef("");
126
- P.current = p2;
127
- const [i2, D] = y.advertisement.getExternalPauseAd(p2, {
128
- refetchInterval: v,
129
- $enabled: m === 0 || !!l2,
130
- prefetch: m === 0 && v > 0
131
- }), x = useStore(i2), g = useCallback(() => {
132
- if (f) {
133
- T.current = P.current;
134
- const e2 = i2.get().data;
135
- eventBus.emit("exposedPauseAd", {
123
+ }, se = ({ showPauseAd: i, vastUrls: a, title: e, caption: y, sdk: f, onClose: l, onRender: u, options: t, isDesktop: h }) => {
124
+ const n = t?.pauseAdDelay ?? 0, b = t?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [p, I] = B(!1), [C, A] = B(!1), s = x(), v = a?.[0].url, P = x(v), g = x(""), S = x("");
125
+ P.current = v;
126
+ const [m, R] = f.advertisement.getExternalPauseAd(v, {
127
+ refetchInterval: b,
128
+ $enabled: n === 0 || !!i,
129
+ prefetch: n === 0 && b > 0
130
+ }), k = q(m), E = _(() => {
131
+ if (l) {
132
+ S.current = P.current;
133
+ const o = m.get().data;
134
+ T.emit("exposedPauseAd", {
136
135
  action: "closed",
137
- payload: (e2 == null ? void 0 : e2.url) === T.current ? {
138
- id: e2 == null ? void 0 : e2.id,
139
- parentId: e2 == null ? void 0 : e2.parentId
136
+ payload: o?.url === S.current ? {
137
+ id: o?.id,
138
+ parentId: o?.parentId
140
139
  } : {}
141
- }), f();
140
+ }), l();
142
141
  }
143
- }, [f, i2]), j = useCallback(() => {
144
- y.controlVideoPlayer({ play: true });
145
- }, [y]);
146
- return useEffect(() => {
147
- D === P.current && x.error && (console.log("error", x.error), clearTimeout(t2.current), g == null || g());
148
- }, [x, g, D]), useEffect(() => {
149
- if (l2 && p2) {
150
- S.current = P.current, T.current = "";
151
- const e2 = i2.get().data;
152
- eventBus.emit("exposedPauseAd", {
142
+ }, [l, m]), F = _(() => {
143
+ f.controlVideoPlayer({ play: !0 });
144
+ }, [f]);
145
+ return c(() => {
146
+ R === P.current && k.error && (console.log("error", k.error), clearTimeout(s.current), E?.());
147
+ }, [k, E, R]), c(() => {
148
+ if (i && v) {
149
+ g.current = P.current, S.current = "";
150
+ const o = m.get().data;
151
+ T.emit("exposedPauseAd", {
153
152
  action: "enabled",
154
- payload: (e2 == null ? void 0 : e2.url) === S.current ? {
155
- id: e2 == null ? void 0 : e2.id,
156
- parentId: e2 == null ? void 0 : e2.parentId
153
+ payload: o?.url === g.current ? {
154
+ id: o?.id,
155
+ parentId: o?.parentId
157
156
  } : {}
158
157
  });
159
- const L = () => {
160
- const C = i2.get(), h2 = C.data;
161
- (h2 == null ? void 0 : h2.url) === P.current && (!C.loading && (h2 != null && h2.imageSrc) ? (clearTimeout(t2.current), d2(false), I(true)) : C.loading && (t2.current = setTimeout(() => {
162
- console.log("checkAndAllowRender timeout"), L();
158
+ const U = () => {
159
+ const w = m.get(), L = w.data;
160
+ (!L || L?.url === P.current) && (!w.loading && L?.imageSrc ? (clearTimeout(s.current), A(!1), I(!0)) : w.loading && (s.current = setTimeout(() => {
161
+ U();
163
162
  }, 200)));
164
163
  };
165
- clearTimeout(t2.current), t2.current = setTimeout(() => {
166
- L();
167
- }, m);
164
+ clearTimeout(s.current), s.current = setTimeout(() => {
165
+ U();
166
+ }, n);
168
167
  } else {
169
- if (T.current !== P.current) {
170
- const e2 = i2.get().data;
171
- T.current = "", S.current !== "" && (eventBus.emit("exposedPauseAd", {
168
+ if (S.current !== P.current) {
169
+ const o = m.get().data;
170
+ S.current = "", g.current !== "" && (T.emit("exposedPauseAd", {
172
171
  action: "disabled",
173
- payload: S.current === (e2 == null ? void 0 : e2.url) ? {
174
- id: e2 == null ? void 0 : e2.id,
175
- parentId: e2 == null ? void 0 : e2.parentId
172
+ payload: g.current === o?.url ? {
173
+ id: o?.id,
174
+ parentId: o?.parentId
176
175
  } : {}
177
- }), S.current = "");
176
+ }), g.current = "");
178
177
  }
179
- d2(true), t2.current = setTimeout(() => {
180
- I(false);
178
+ A(!0), s.current = setTimeout(() => {
179
+ I(!1);
181
180
  }, 400);
182
181
  }
183
182
  return () => {
184
- t2.current && clearTimeout(t2.current);
183
+ s.current && clearTimeout(s.current);
185
184
  };
186
- }, [i2, g, m, l2, p2]), useEffect(() => {
187
- a == null || a({ rendered: s });
188
- }, [s, a]), useEffect(() => () => {
189
- a == null || a({ rendered: false });
190
- }, [a]), !s || !x.data ? null : /* @__PURE__ */ jsx(
191
- X,
185
+ }, [m, E, n, i, v]), c(() => {
186
+ u?.({ rendered: p });
187
+ }, [p, u]), c(() => () => {
188
+ u?.({ rendered: !1 });
189
+ }, [u]), !p || !k.data ? null : /* @__PURE__ */ r(
190
+ te,
192
191
  {
193
- onClose: g,
194
- isClosing: E,
195
- title: r2,
196
- caption: k,
197
- onPlay: j,
198
- vastUrl: p2,
199
- options: c,
200
- isDesktop: A2,
201
- externalPauseAdStore: i2,
202
- content: x.data
192
+ onClose: E,
193
+ isClosing: C,
194
+ title: e,
195
+ caption: y,
196
+ onPlay: F,
197
+ vastUrl: v,
198
+ options: t,
199
+ isDesktop: h,
200
+ externalPauseAdStore: m,
201
+ content: k.data
203
202
  }
204
203
  );
205
- };
206
- const PureStreamLayerPauseAd = ({
207
- showPauseAd,
208
- pauseAdVastUrl,
209
- videoPlayerController,
210
- onRenderPauseAd,
211
- onClosePauseAd,
212
- children,
213
- options
204
+ }, ae = ({
205
+ showPauseAd: i,
206
+ pauseAdVastUrl: a,
207
+ videoPlayerController: e,
208
+ onRenderPauseAd: y,
209
+ onClosePauseAd: f,
210
+ children: l,
211
+ options: u
214
212
  }) => {
215
- const sdk = B();
216
- const baseTheme = z();
217
- const ref = useRef();
218
- useEffect(() => {
219
- if (sdk) {
220
- if (videoPlayerController) {
221
- ref.current = videoPlayerController;
222
- sdk.addVideoPlayerController(ref.current);
223
- }
224
- return () => {
225
- if (ref.current) {
226
- sdk.removeVideoPlayerController(ref.current);
227
- }
228
- };
229
- }
230
- return () => {
231
- };
232
- }, [sdk, videoPlayerController]);
233
- if (!sdk) {
234
- return children;
235
- }
236
- return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(
237
- h,
213
+ const t = z(), h = G(), n = x();
214
+ return c(() => t ? (e && (n.current = e, t.addVideoPlayerController(n.current)), () => {
215
+ n.current && t.removeVideoPlayerController(n.current);
216
+ }) : () => {
217
+ }, [t, e]), t ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
218
+ M,
238
219
  {
239
- style: children ? { position: "relative" } : {},
240
- customTheme: baseTheme.theme,
241
- themeMode: baseTheme.themeMode,
220
+ style: l ? { position: "relative" } : {},
221
+ customTheme: h.theme,
222
+ themeMode: h.themeMode,
242
223
  children: [
243
- children,
244
- pauseAdVastUrl && /* @__PURE__ */ jsx(
224
+ l,
225
+ a && /* @__PURE__ */ r(
245
226
  se,
246
227
  {
247
- sdk,
248
- showPauseAd,
249
- vastUrls: pauseAdVastUrl,
250
- onClose: onClosePauseAd,
251
- onRender: onRenderPauseAd,
252
- options,
253
- isDesktop: true
228
+ sdk: t,
229
+ showPauseAd: i,
230
+ vastUrls: a,
231
+ onClose: f,
232
+ onRender: y,
233
+ options: u,
234
+ isDesktop: !0
254
235
  }
255
236
  )
256
237
  ]
257
238
  }
258
- ) });
239
+ ) }) : l;
259
240
  };
260
- class StreamLayerPauseAd extends Component {
261
- constructor(props) {
262
- super(props);
263
- this.state = { hasError: false };
241
+ class pe extends K {
242
+ constructor(a) {
243
+ super(a), this.state = { hasError: !1 };
264
244
  }
265
245
  static getDerivedStateFromError() {
266
- return { hasError: true };
246
+ return { hasError: !0 };
267
247
  }
268
- componentDidCatch(error, info) {
269
- console.error(error, info.componentStack);
248
+ componentDidCatch(a, e) {
249
+ console.error(a, e.componentStack);
270
250
  }
271
251
  render() {
272
- if (this.state.hasError) {
273
- return this.props.children;
274
- }
275
- return /* @__PURE__ */ jsx(PureStreamLayerPauseAd, { ...this.props });
252
+ return this.state.hasError ? this.props.children : /* @__PURE__ */ r(ae, { ...this.props });
276
253
  }
277
254
  }
278
255
  export {
279
- StreamLayerPauseAd
256
+ pe as StreamLayerPauseAd
280
257
  };
@@ -1,85 +1,77 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { m, h } from "./index7.js";
3
- import { useState, useEffect } from "react";
4
- import { s as styled_default, u as useStore } from "./sl-types.js";
5
- import { e as eventBus } from "./index5.js";
6
- import { d } from "./index3.js";
7
- import { B as B1 } from "./index4.js";
8
- import { F as FeatureStatus } from "./feature.js";
9
- import { S as SdkOverlayType } from "./useStreamLayerApp2.js";
10
- import { B, z } from "./hooks-WfHlJH12.js";
11
- const e = /* @__PURE__ */ styled_default("div")({
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { m as c, h as u } from "./index8.js";
3
+ import { useState as d, useEffect as f } from "react";
4
+ import { s as o, u as h } from "./sl-types.js";
5
+ import { e as n } from "./index4.js";
6
+ import { p as y } from "./index3.js";
7
+ import { B as S } from "./index6.js";
8
+ import { F as m } from "./feature.js";
9
+ import { S as v } from "./useStreamLayerApp2.js";
10
+ import { Y as g, _ as A } from "./hooks-n9ax4LRT.js";
11
+ const I = /* @__PURE__ */ o("div")({
12
12
  name: "PointsContainer",
13
13
  class: "psiob9b",
14
- propsAsIs: false
15
- }), p = /* @__PURE__ */ styled_default("div")({
14
+ propsAsIs: !1
15
+ }), P = /* @__PURE__ */ o("div")({
16
16
  name: "PointsIcon",
17
17
  class: "p1gqe4lh",
18
- propsAsIs: false
19
- }), n = () => B1, a = /* @__PURE__ */ styled_default(n())({
18
+ propsAsIs: !1
19
+ }), b = () => S, k = /* @__PURE__ */ o(b())({
20
20
  name: "PointsSvg",
21
21
  class: "p15syg2y",
22
- propsAsIs: true
23
- }), l = /* @__PURE__ */ styled_default("div")({
22
+ propsAsIs: !0
23
+ }), F = /* @__PURE__ */ o("div")({
24
24
  name: "PointsBody",
25
25
  class: "p12n4f2h",
26
- propsAsIs: false
27
- }), c = /* @__PURE__ */ styled_default("div")({
26
+ propsAsIs: !1
27
+ }), T = /* @__PURE__ */ o("div")({
28
28
  name: "PointsTitle",
29
29
  class: "poqmx89",
30
- propsAsIs: false
31
- }), r = /* @__PURE__ */ styled_default("div")({
30
+ propsAsIs: !1
31
+ }), x = /* @__PURE__ */ o("div")({
32
32
  name: "PointsValue",
33
33
  class: "prj9b3v",
34
- propsAsIs: false
35
- });
36
- const u = ({ points: n2, onClick: t }) => /* @__PURE__ */ jsxs(e, { className: m, onClick: t, children: [
37
- /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(a, { name: "icon-trophy-solid" }) }),
38
- /* @__PURE__ */ jsxs(l, { children: [
39
- /* @__PURE__ */ jsx(c, { children: "Total points" }),
40
- /* @__PURE__ */ jsx(r, { children: /* @__PURE__ */ jsx(d, { value: n2 }) })
34
+ propsAsIs: !1
35
+ }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ p(I, { className: c, onClick: e, children: [
36
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(k, { name: "icon-trophy-solid" }) }),
37
+ /* @__PURE__ */ p(F, { children: [
38
+ /* @__PURE__ */ t(T, { children: "Total points" }),
39
+ /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(y, { value: s }) })
41
40
  ] })
42
- ] });
43
- const S = ({ gamification: e2 }) => {
44
- const n2 = e2.userSummary.$store, [t, m2] = useState(0);
45
- return useEffect(() => {
46
- const r2 = n2.subscribe((o) => {
47
- var i;
48
- (i = o == null ? void 0 : o.summary) != null && i.points && m2(o.summary.points);
41
+ ] }), C = ({ gamification: s }) => {
42
+ const e = s.userSummary.$store, [a, l] = d(0);
43
+ return f(() => {
44
+ const r = e.subscribe((i) => {
45
+ i?.summary?.points && l(i.summary.points);
49
46
  });
50
47
  return () => {
51
- r2();
48
+ r();
52
49
  };
53
- }, [n2]), /* @__PURE__ */ jsx(u, { points: t, onClick: () => {
54
- const r2 = e2.status.get();
55
- r2 === FeatureStatus.Suspended ? (e2.openFeature(), eventBus.emit("app", {
50
+ }, [e]), /* @__PURE__ */ t(B, { points: a, onClick: () => {
51
+ const r = s.status.get();
52
+ r === m.Suspended ? (s.openFeature(), n.emit("app", {
56
53
  action: "open",
57
54
  payload: {}
58
- }), eventBus.emit("interactions", {
55
+ }), n.emit("interactions", {
59
56
  action: "tap",
60
57
  payload: {}
61
- })) : r2 === FeatureStatus.Ready && (e2.closeFeature(false), eventBus.emit("app", {
58
+ })) : r === m.Ready && (s.closeFeature(!1), n.emit("app", {
62
59
  action: "close",
63
60
  payload: {}
64
- }), eventBus.emit("interactions", {
61
+ }), n.emit("interactions", {
65
62
  action: "tap",
66
63
  payload: {}
67
64
  }));
68
65
  } });
69
- }, k = ({ sdk: e2 }) => {
70
- if (!useStore(e2.featuresList.getStore()))
66
+ }, $ = ({ sdk: s }) => {
67
+ if (!h(s.featuresList.getStore()))
71
68
  return null;
72
- const t = e2.getFeature(SdkOverlayType.GAMES);
73
- return t ? /* @__PURE__ */ jsx(S, { gamification: t }) : null;
74
- };
75
- const StreamLayerSDKPoints = ({ theme }) => {
76
- const sdk = B();
77
- const baseTheme = z();
78
- if (!sdk) {
79
- return null;
80
- }
81
- return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h, { customTheme: theme ?? baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(k, { sdk }) }) });
69
+ const e = s.getFeature(v.GAMES);
70
+ return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
71
+ }, O = ({ theme: s }) => {
72
+ const e = g(), a = A();
73
+ return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(u, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ t($, { sdk: e }) }) }) : null;
82
74
  };
83
75
  export {
84
- StreamLayerSDKPoints
76
+ O as StreamLayerSDKPoints
85
77
  };