@streamlayer/react 1.23.2 → 1.24.1

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 +23 -26
  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,8 +1,181 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as cx_default } from "./sl-types.js";
3
- const m = "StreamLayerCSSReset", h$1 = "ttkj0ah";
4
- const h = ({ children: r, customTheme: m2, themeMode: o, style: a }) => /* @__PURE__ */ jsx("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ jsx("div", { className: cx_default(h$1, o, m2), style: a, children: r }) });
1
+ import { jsx as F } from "react/jsx-runtime";
2
+ import { d as n } from "./index10.js";
3
+ import { useEffect as D, useState as S, useCallback as C } from "react";
4
+ import { s as I } from "./sl-types.js";
5
+ import { CountdownCircleTimer as t } from "react-countdown-circle-timer";
6
+ import { B as a } from "./index6.js";
7
+ const f = {
8
+ BLUE_QUESTION_ACTION_BTN: "#1589ee",
9
+ WHITE: "#FFFFFF",
10
+ BLUE: "#2d6ffd",
11
+ GREY_PRIMARY: "#909395",
12
+ GREY_PRIMARY_ONBOARDING_INAPP: "#B5B7B8",
13
+ PRIMARY_1: "#1D7BFF",
14
+ // main
15
+ PRIMARY_2: "#095CD1",
16
+ // hover, active, ...etc (darken 10%)
17
+ PRIMARY_TEXT: "#090E13",
18
+ SECONDARY_TEXT: "rgba(10, 14, 19, 0.70)",
19
+ QUESTION_TYPE_ICON: "#1D7BFF",
20
+ QUESTION_BODY_TEXT: "#090E13",
21
+ PRESENTED_BY_TEXT: "#090E13",
22
+ SUCCESS: "#107D57",
23
+ UNSUCCESS: "#DF2F3B",
24
+ SECONDARY_RED1: "#DF2F3B",
25
+ NEUTRALS_WHITE: "#FFFFFF",
26
+ NEUTRALS_WHITE1: "#FFFFFF",
27
+ NEUTRALS_GRAY1: "#F7F7F7",
28
+ NEUTRALS_GRAY2: "#F2F2F1",
29
+ NEUTRALS_GRAY3: "#E8E8E8",
30
+ NEUTRALS_GRAY4: "#D9D9D6",
31
+ NEUTRALS_GRAY5: "#B1B3B3",
32
+ NEUTRALS_GRAY6: "#888B8D",
33
+ NEUTRALS_GRAY7: "#6B6F73",
34
+ NEUTRALS_GRAY9: "#25282A",
35
+ SDK_CONTAINER_BG: "#F7F7F7",
36
+ SDK_WHITE_CONTAINER_BG: "#fff",
37
+ SDK_DARK_CONTAINER_BG: "#fff",
38
+ SDK_PREDICTION_RESULT_SUCCESS_BG: "#fff",
39
+ SDK_PREDICTION_RESULT_INCORRECT_BG: "#fff",
40
+ SDK_PREDICTION_RESULT_SUCCESS_TEXT: "#107D57",
41
+ SDK_PREDICTION_RESULT_ERROR_TITLE: "#090E13",
42
+ SDK_PREDICTION_RESULT_ERROR_SUBTITLE: "#DF2F3B",
43
+ SDK_PREDICTION_RESULT_CLOSE_ICON: "#6B6F73",
44
+ SDK_PREDICTION_FEEDBACK_SUCCESS_ICON: "#107D57",
45
+ SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1: "#CD2525",
46
+ SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2: "#fff",
47
+ PREDICTION_BG_LINES_CORRECT: "#01AB58",
48
+ PREDICTION_BG_LINES_INCORRECT: "#888B8D",
49
+ SKELETON_COLOR_1: "#f1efef",
50
+ SKELETON_COLOR_2: "#f9f8f8",
51
+ TABS_CONTAINER_BG: "#F2F2F1",
52
+ TABS_ACTIVE_BG: "#FFFFFF",
53
+ TABS_COLOR: "#6B6F73",
54
+ TABS_ACTIVE_COLOR: "#1D7BFF",
55
+ CARD_BG: "#FFFFFF",
56
+ CARD_BORDER: "#fff",
57
+ BORDER: "#E8E8E8",
58
+ VOTE_BTN_BG: "#F7F7F7",
59
+ VOTE_BTN_BORDER: "rgb(232, 232, 232)",
60
+ VOTE_BTN_DISABLED_BORDER: "#B1B3B3",
61
+ VOTE_BTN_SELECTED_BORDER: "#25282A",
62
+ VOTE_BTN_NOT_SELECTED_BORDER: "#E8E8E8",
63
+ VOTE_BTN_SELECTED_BG: "#FFFFFF",
64
+ VOTE_BTN_SELECTED_BG_AD_UNIT: "#FFFFFF",
65
+ VOTE_BTN_NOT_SELECTED_BG: "#FFFFFF",
66
+ VOTE_BTN_NOT_SELECTED_BG_UNSET: "rgb(196, 196, 196)",
67
+ VOTED_ANSWER_BG: "#FFFFFF",
68
+ VOTED_BTN_RCT_BG: "#2d5694",
69
+ IN_APP_BG: "rgba(255, 255, 255, 0.90)",
70
+ IN_APP_QUESTION_TYPE_ICON: "#1D7BFF",
71
+ IN_APP_QUESTION_TYPE_LABEL: "#82899E",
72
+ IN_APP_QUESTION_QUOTE: "rgba(10, 14, 19, 0.70)",
73
+ IN_APP_QUESTION_RESULT_SUBTITLE_BG: "#1D7BFF",
74
+ IN_APP_QUESTION_RESULT_LINE: "#babfc5",
75
+ QUOTE_BORDER: "#E8E8E8",
76
+ QUOTE_TEXT: "rgba(10, 14, 19, 0.70)"
77
+ }, c = {
78
+ BG_PRIMARY: "#13212b",
79
+ BG_SECONDARY: "#152430",
80
+ BG_SECONDARY1: "#435059",
81
+ BORDER_PRIMARY: "rgba(255, 255, 255, 0.1)",
82
+ TEXT_PRIMARY: "#f9f9f9",
83
+ TEXT_PRIMARY1: "#f9f9f9",
84
+ TEXT_SECONDARY: "rgba(255, 255, 255, 0.8)",
85
+ TEXT_SECONDARY1: "#878787",
86
+ WHITE: "#fff"
87
+ }, l = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"], L = "#cee5de", P = "#f9d6d8", U = "#E8E8E8", x = {
88
+ xs: 324,
89
+ sm: 576,
90
+ md: 768,
91
+ lg: 992,
92
+ xl: 1200,
93
+ xxl: 1440
94
+ };
95
+ Object.entries(f).reduce((_, [E, T]) => `
96
+ ${_}
97
+ --color-${E.toLowerCase().replaceAll("_", "-")}: ${T};
98
+ `, "");
99
+ Object.entries(c).reduce((_, [E, T]) => `
100
+ ${_}
101
+ --color-adv-${E.toLowerCase().replaceAll("_", "-")}: ${T};
102
+ `, "");
103
+ const d = (_) => {
104
+ const { Component: E, options: T, customOptions: e, autoFocus: R, ...O } = _, N = n.useFocusable({
105
+ ...T,
106
+ ...e,
107
+ onEnterPress: () => _.onClick?.({ currentTarget: N.ref.current, stopPropagation: () => {
108
+ } })
109
+ });
110
+ return D(() => {
111
+ R && N.focusSelf();
112
+ }, []), /* @__PURE__ */ F(E, { ...O, ...N, "data-is-with-focus": "true" });
113
+ };
114
+ function Q(_, E) {
115
+ return ({ webos: T, options: e, ...R }) => T ? /* @__PURE__ */ F(d, { Component: _, options: E, customOptions: e, ...R }) : /* @__PURE__ */ F(_, { ...R });
116
+ }
117
+ const m = [10, 10, 1, 0], G = /* @__PURE__ */ I("div")({
118
+ name: "RemainingTimeCircle",
119
+ class: "r165427",
120
+ propsAsIs: !1
121
+ }), p = /* @__PURE__ */ I("div")({
122
+ name: "RemainingTime",
123
+ class: "r17garf3",
124
+ propsAsIs: !1
125
+ }), Y = L, B = P, o = U, X = ({
126
+ className: _,
127
+ duration: E = 30,
128
+ onTimerExpired: T,
129
+ isPlaying: e = !0
130
+ }) => /* @__PURE__ */ F(t, {
131
+ isPlaying: e,
132
+ strokeWidth: 0,
133
+ duration: E,
134
+ colors: B,
135
+ size: 24,
136
+ onComplete: T,
137
+ children: ({
138
+ remainingTime: R
139
+ }) => /* @__PURE__ */ F(p, {
140
+ className: _,
141
+ children: E === 0 ? 0 : R
142
+ })
143
+ }), M = ({
144
+ isPlaying: _ = !0,
145
+ duration: E = 30,
146
+ onTimerExpired: T
147
+ }) => {
148
+ const [e, R] = S(E > 10 ? Y : B), [O, N] = S(2);
149
+ D(() => {
150
+ E === 0 && (N(0), R(o));
151
+ }, [E]);
152
+ const i = ({
153
+ remainingTime: r
154
+ }) => /* @__PURE__ */ F(G, {
155
+ children: E === 0 ? 0 : r
156
+ }), s = C(() => {
157
+ T?.(), R(o);
158
+ }, [T, R]), A = C((r) => {
159
+ r === 10 && R(B);
160
+ }, [R]);
161
+ return /* @__PURE__ */ F(t, {
162
+ isPlaying: _,
163
+ duration: E,
164
+ colors: l,
165
+ colorsTime: m,
166
+ size: 32,
167
+ strokeWidth: O,
168
+ trailStrokeWidth: 2,
169
+ trailColor: e,
170
+ onComplete: s,
171
+ onUpdate: A,
172
+ children: i
173
+ });
174
+ }, W = ({ height: _ = "37px", width: E = "37px" }) => /* @__PURE__ */ F("div", { style: { height: _, width: E }, children: /* @__PURE__ */ F(a, { name: "loader" }) });
5
175
  export {
6
- h,
7
- m
176
+ x as A,
177
+ X as G,
178
+ M as L,
179
+ Q as b,
180
+ W as d
8
181
  };
@@ -1,12 +1,7 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { s as styled_default } from "./sl-types.js";
3
- const e = /* @__PURE__ */ styled_default("div")({
4
- name: "Container",
5
- class: "cqg02m",
6
- propsAsIs: false
7
- });
8
- const i = ({ children: r, style: o, loading: t }) => t ? /* @__PURE__ */ jsx(e, { style: o, children: r }) : r;
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { c as a } from "./sl-types.js";
3
+ const l = "StreamLayerCSSReset", c = "ttkj0ah", d = ({ children: t, customTheme: m, themeMode: r, style: s }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: a(c, r, m), style: s, children: t }) });
9
4
  export {
10
- e,
11
- i
5
+ d as h,
6
+ l as m
12
7
  };
@@ -1,321 +1,11 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { s as styled_default, c as cx_default } from "./sl-types.js";
3
- import { useState, useEffect, useCallback, forwardRef, useRef } from "react";
4
- import { B as B1 } from "./index4.js";
5
- import { G, d as d$1, O as O$1 } from "./index10.js";
6
- import { C as CloseTimerAuto } from "./useStreamLayerApp2.js";
7
- const g = /* @__PURE__ */ styled_default("div")({
8
- name: "CloseIconWrap",
9
- class: "c3v6bv6",
10
- propsAsIs: false
11
- }), h = /* @__PURE__ */ styled_default("div")({
12
- name: "TimerWrap",
13
- class: "teuhmro",
14
- propsAsIs: false
15
- }), A$1 = () => B1, C$1 = /* @__PURE__ */ styled_default(A$1())({
16
- name: "Icon",
17
- class: "i17rfxv5",
18
- propsAsIs: true
19
- }), y$1 = ({
20
- close: r2,
21
- className: a2,
22
- timerClassName: m,
23
- skipIcon: o2,
24
- isPlaying: c2 = true,
25
- duration: e2 = 0,
26
- autoClose: n2
27
- }) => {
28
- const [p2, i2] = useState(e2 === 0);
29
- useEffect(() => {
30
- i2(!e2);
31
- }, [e2]);
32
- const l2 = useCallback(() => {
33
- n2 === CloseTimerAuto.ENABLED ? r2 == null || r2() : i2(true);
34
- }, [n2, r2]);
35
- return p2 ? /* @__PURE__ */ jsxs(g, {
36
- "data-a": "intr",
37
- onClick: r2,
38
- className: a2,
39
- style: o2 ? {
40
- width: "auto"
41
- } : {},
42
- children: [o2 && /* @__PURE__ */ jsx("span", {
43
- "data-a": "intr",
44
- children: "Skip"
45
- }), /* @__PURE__ */ jsx(C$1, {
46
- "data-a": "intr",
47
- name: o2 ? "iconSkip" : "icon-cross"
48
- })]
49
- }) : /* @__PURE__ */ jsx(h, {
50
- children: /* @__PURE__ */ jsx(G, {
51
- className: m,
52
- isPlaying: c2,
53
- duration: e2,
54
- onTimerExpired: l2
55
- })
56
- });
57
- };
58
- const i = /* @__PURE__ */ styled_default("div")({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { s as l } from "./sl-types.js";
3
+ const i = /* @__PURE__ */ l("div")({
59
4
  name: "Container",
60
- class: "c1bgb86j",
61
- propsAsIs: false
62
- }), A = /* @__PURE__ */ styled_default("video")({
63
- name: "Player",
64
- class: "p6703cq",
65
- propsAsIs: false
66
- }), b = /* @__PURE__ */ styled_default("img")({
67
- name: "Poster",
68
- class: "p12ow7zo",
69
- propsAsIs: false
70
- }), B = /* @__PURE__ */ styled_default("div")({
71
- name: "Control",
72
- class: "cdpal9o",
73
- propsAsIs: false
74
- }), x = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ styled_default("div")({
75
- name: "VideoControls",
76
- class: "vxo8xch",
77
- propsAsIs: false
78
- }), n = /* @__PURE__ */ styled_default("button")({
79
- name: "ControlBtn",
80
- class: "coyuzu0",
81
- propsAsIs: false
82
- }), t = () => n, O = /* @__PURE__ */ styled_default(t())({
83
- name: "MuteIcon",
84
- class: "musmi9a",
85
- propsAsIs: true
86
- }), e = () => n, S = /* @__PURE__ */ styled_default(e())({
87
- name: "PauseIcon",
88
- class: "p1qe7rum",
89
- propsAsIs: true
90
- }), c = () => n, W = /* @__PURE__ */ styled_default(c())({
91
- name: "PlayIcon",
92
- class: "psevery",
93
- propsAsIs: true
94
- }), a = /* @__PURE__ */ styled_default("button")({
95
- name: "WebOSIconButton",
96
- class: "w1q3u7py",
97
- propsAsIs: false
98
- }), p = () => a, o = /* @__PURE__ */ styled_default(p())({
99
- name: "WebOSIconButtonAnimation",
100
- class: "wdlqvum",
101
- propsAsIs: true
102
- }), l = () => o, d = /* @__PURE__ */ styled_default(l())({
103
- name: "WebOSIconButtonPlay",
104
- class: "w1ylz9ea",
105
- propsAsIs: true
106
- }), r = () => o, C = /* @__PURE__ */ styled_default(r())({
107
- name: "WebOSIconButtonPause",
108
- class: "w1iylt55",
109
- propsAsIs: true
110
- }), u = () => o, f = /* @__PURE__ */ styled_default(u())({
111
- name: "WebOSIconButtonMute",
112
- class: "w8h4h7",
113
- propsAsIs: true
114
- }), I = () => o, v = /* @__PURE__ */ styled_default(I())({
115
- name: "WebOSIconButtonUnmute",
116
- class: "w12l12kt",
117
- propsAsIs: true
118
- });
119
- const It = (r2) => {
120
- for (const s of r2)
121
- s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
122
- }, $ = new IntersectionObserver(It, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), Bt = (r2) => {
123
- $.observe(r2), D.add(r2);
124
- }, Ot = (r2) => {
125
- $.unobserve(r2), D.delete(r2);
126
- }, wt = () => {
127
- for (const r2 of D)
128
- r2 instanceof HTMLVideoElement && !r2.paused && r2.pause();
129
- };
130
- function yt(...r2) {
131
- return useCallback(
132
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
- (s) => {
134
- for (const c2 of r2)
135
- c2 !== null && (typeof c2 == "function" ? c2(s) : c2 && (c2.current = s));
136
- },
137
- // Re-run the callback if the array of refs changes
138
- // eslint-disable-next-line react-hooks/exhaustive-deps
139
- [...r2]
140
- );
141
- }
142
- const Lt = O$1(i), Pt = ({ loading: r2, autoPlay: s, played: c2, playing: i2, isMuted: f2, unmute: d2, mute: h2, togglePlaying: l2 }) => !r2 && !s && !c2 ? /* @__PURE__ */ jsx(B, { children: i2 ? /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) : /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : c2 ? /* @__PURE__ */ jsxs(P, { children: [
143
- i2 ? /* @__PURE__ */ jsx(S, { onClick: l2 }) : /* @__PURE__ */ jsx(W, { onClick: l2 }),
144
- /* @__PURE__ */ jsx(O, { className: cx_default(!f2 && "muted"), onClick: f2 ? d2 : h2 })
145
- ] }) : null, Tt = ({
146
- loading: r2,
147
- autoPlay: s,
148
- playMuted: c2,
149
- playing: i2,
150
- played: f$1,
151
- unmute: d$12,
152
- mute: h2,
153
- isMuted: l2,
154
- hasNotPausedVideo: p2,
155
- hasInteractedWithAudio: w
156
- }) => /* @__PURE__ */ jsxs(Fragment, { children: [
157
- !r2 && !(s && c2) && /* @__PURE__ */ jsx(B, { "data-control-btn": "true", children: i2 ? p2 ? null : /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : f$1 ? /* @__PURE__ */ jsx(C, { children: /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) }) : /* @__PURE__ */ jsx(a, { "data-control-icon": "true", children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) }),
158
- !r2 && s && c2 && w && /* @__PURE__ */ jsx(B, { children: l2 ? /* @__PURE__ */ jsx(f, { onClick: d$12, children: /* @__PURE__ */ jsx(B1, { name: "iconMute" }) }) : /* @__PURE__ */ jsx(v, { onClick: h2, children: /* @__PURE__ */ jsx(B1, { name: "iconUnMute" }) }) })
159
- ] }), Et = forwardRef(
160
- ({
161
- poster: r2,
162
- source: s,
163
- aspectRatio: c2,
164
- controlVideo: i2,
165
- onReplay: f2,
166
- onPlay: d2,
167
- onPause: h2,
168
- onEnd: l2,
169
- onRender: p2,
170
- onMute: w,
171
- onQuartile: u2,
172
- autoPlay: v2,
173
- playMuted: S2,
174
- className: K,
175
- muted: y$12,
176
- webos: T,
177
- hasNotPausedVideo: V
178
- }, R) => {
179
- const n2 = useRef(null), Q = yt(n2, R), x$1 = useRef(false), E = useRef(false), m = useRef(/* @__PURE__ */ new Set()), [z, G2] = useState(false), [W2, k] = useState(false), [j, J] = useState(false), [X, H] = useState(true), [A$12, U] = useState(S2), [q, tt] = useState(false);
180
- useEffect(() => {
181
- s && (U(S2), G2(false));
182
- }, [s]);
183
- const C2 = useCallback(() => {
184
- i2 == null || i2({ muted: false });
185
- }, [i2]), Y = useCallback(() => {
186
- i2 == null || i2({ muted: true });
187
- }, [i2]), I2 = useCallback((t2) => {
188
- t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = true), U(true);
189
- }, []), L = useCallback(
190
- (t2) => {
191
- t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = false), U(false), q || tt(true);
192
- },
193
- [q]
194
- );
195
- useEffect(() => {
196
- y$12 !== void 0 && (y$12 ? I2() : L());
197
- }, [I2, y$12, L]);
198
- const Z = (t2) => {
199
- var b2;
200
- (b2 = t2.stopPropagation) == null || b2.call(t2);
201
- const o2 = n2 == null ? void 0 : n2.current;
202
- if (o2)
203
- if (W2)
204
- o2.pause();
205
- else {
206
- const a2 = n2 == null ? void 0 : n2.current;
207
- if (!a2)
208
- return;
209
- wt(), a2.play().catch((rt) => console.log(rt)), H(false);
210
- }
211
- }, et = () => {
212
- var t2;
213
- (t2 = n2 == null ? void 0 : n2.current) == null || t2.load(), H(true);
214
- };
215
- return useEffect(() => () => {
216
- C2();
217
- }, [C2]), useEffect(() => {
218
- const t2 = n2.current;
219
- return t2 ? (E.current = t2.muted, U(t2.muted), Bt(t2), () => {
220
- Ot(t2);
221
- }) : () => {
222
- };
223
- }, []), useEffect(() => {
224
- p2 == null || p2();
225
- }, [p2]), useEffect(() => {
226
- m.current.clear(), x$1.current = false;
227
- }, [s]), /* @__PURE__ */ jsxs(
228
- Lt,
229
- {
230
- webos: T,
231
- onClick: v2 && S2 ? A$12 ? L : I2 : Z,
232
- "data-a": "intr",
233
- autoFocus: true,
234
- options: { focusKey: "video-play-btn" },
235
- className: cx_default(W2 && !T && x, v2 && y, K),
236
- style: c2 ? { aspectRatio: c2 } : {},
237
- children: [
238
- /* @__PURE__ */ jsx(
239
- A,
240
- {
241
- ref: Q,
242
- src: s,
243
- autoPlay: v2,
244
- onPlay: () => {
245
- G2(true), x$1.current && (f2 == null || f2(), m.current.clear()), k(true), H(false), d2 == null || d2(), S2 ? I2() : Y();
246
- },
247
- onTimeUpdate: (t2) => {
248
- const o2 = t2.target.duration, b2 = t2.target.currentTime;
249
- if (o2 && b2) {
250
- const a2 = Math.floor(b2 / o2 * 100);
251
- a2 >= 25 && a2 < 50 && !m.current.has(25) ? (u2 == null || u2(25), m.current.add(25)) : a2 >= 50 && a2 < 75 && !m.current.has(50) ? (u2 == null || u2(50), m.current.add(50)) : a2 >= 75 && !m.current.has(75) && (u2 == null || u2(75), m.current.add(75));
252
- }
253
- },
254
- onVolumeChange: (t2) => {
255
- const o2 = t2.target.muted;
256
- E.current !== o2 && (w == null || w(o2), E.current = o2, (o2 !== y$12 || y$12 === void 0) && (o2 ? C2() : Y()));
257
- },
258
- onError: async (t2) => {
259
- try {
260
- if (t2.target instanceof HTMLVideoElement) {
261
- J(true);
262
- const b2 = await (await fetch(t2.target.src)).blob(), a2 = URL.createObjectURL(b2);
263
- t2.target.src = a2;
264
- }
265
- } catch (o2) {
266
- console.error("video fallback fetch failed", o2), k(true), H(true);
267
- } finally {
268
- J(false), C2();
269
- }
270
- },
271
- onPause: () => {
272
- k(false), h2 == null || h2(), C2();
273
- },
274
- onEnded: () => {
275
- k(false), x$1.current = true, et(), l2 == null || l2(), C2();
276
- },
277
- style: { visibility: X ? "hidden" : "visible" },
278
- controls: false,
279
- playsInline: true
280
- }
281
- ),
282
- /* @__PURE__ */ jsx(b, { src: r2, style: { visibility: X ? "visible" : "hidden" } }),
283
- !T && /* @__PURE__ */ jsx(
284
- Pt,
285
- {
286
- loading: j,
287
- autoPlay: v2,
288
- played: z,
289
- playing: W2,
290
- isMuted: A$12,
291
- unmute: L,
292
- mute: I2,
293
- togglePlaying: Z
294
- }
295
- ),
296
- T && /* @__PURE__ */ jsx(
297
- Tt,
298
- {
299
- loading: j,
300
- autoPlay: v2,
301
- playMuted: S2,
302
- playing: W2,
303
- played: z,
304
- unmute: L,
305
- mute: I2,
306
- isMuted: A$12,
307
- hasNotPausedVideo: V,
308
- hasInteractedWithAudio: q
309
- }
310
- ),
311
- j && /* @__PURE__ */ jsx(B, { children: /* @__PURE__ */ jsx(d$1, {}) })
312
- ]
313
- }
314
- );
315
- }
316
- );
5
+ class: "cqg02m",
6
+ propsAsIs: !1
7
+ }), a = ({ children: s, style: e, loading: o }) => o ? /* @__PURE__ */ t(i, { style: e, children: s }) : s;
317
8
  export {
318
- Et as E,
319
- wt as w,
320
- y$1 as y
9
+ i as e,
10
+ a as i
321
11
  };
@@ -1,86 +1,79 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { h } from "./index7.js";
3
- import { u as useStore, s as styled_default } from "./sl-types.js";
4
- import { useRef, useEffect } from "react";
5
- import { h as ht } from "./Question.js";
6
- import { S as SdkOverlayType } from "./useStreamLayerApp2.js";
7
- import { B, z, j } from "./hooks-WfHlJH12.js";
8
- const b = () => ht, v = /* @__PURE__ */ styled_default(b())({
1
+ import { jsx as u, jsxs as c } from "react/jsx-runtime";
2
+ import { h as p } from "./index8.js";
3
+ import { u as a, s as h } from "./sl-types.js";
4
+ import { useRef as f, useEffect as l } from "react";
5
+ import { _ as I } from "./Question.js";
6
+ import { S as g } from "./useStreamLayerApp2.js";
7
+ import { Y as S, _ as k, g as Q } from "./hooks-n9ax4LRT.js";
8
+ const y = () => I, A = /* @__PURE__ */ h(y())({
9
9
  name: "QuestionWrap",
10
10
  class: "q10hhsxv",
11
- propsAsIs: true
12
- }), w = ({
11
+ propsAsIs: !0
12
+ }), b = ({
13
13
  gamification: e,
14
- sdk: n,
15
- persistent: o,
16
- skipAutoClose: p,
17
- hideHeader: f,
14
+ sdk: o,
15
+ persistent: i,
16
+ skipAutoClose: n,
17
+ hideHeader: d,
18
18
  insightId: t
19
19
  }) => {
20
- const r = useRef(""), i = useStore(e.openedQuestion.$store);
21
- return useEffect(() => t ? (!o || e.isOpenedQuestion(t) || (r.current = t, e.getFeedItem(t).then((u) => {
22
- var c;
23
- r.current === t && ((c = u == null ? void 0 : u.attributes) == null ? void 0 : c.attributes.case) === "insight" && e.openQuestion(t, u);
20
+ const r = f(""), m = a(e.openedQuestion.$store);
21
+ return l(() => t ? (!i || e.isOpenedQuestion(t) || (r.current = t, e.getFeedItem(t).then((s) => {
22
+ r.current === t && s?.attributes?.attributes.case === "insight" && e.openQuestion(t, s);
24
23
  })), () => {
25
24
  r.current = "";
26
25
  }) : (e.activeQuestionId.subscribe(({
27
26
  data: s
28
27
  }) => {
29
- var u;
30
- s && ((u = s.feedItem) == null ? void 0 : u.type) === "insight" && (!o || e.isOpenedQuestion(s.feedItem.id) || (r.current = s.feedItem.id, e.openQuestion(s.feedItem.id, s.feedItem))), !s && r.current && (e.closeQuestion(r.current), r.current = "");
28
+ s && s.feedItem?.type === "insight" && (!i || e.isOpenedQuestion(s.feedItem.id) || (r.current = s.feedItem.id, e.openQuestion(s.feedItem.id, s.feedItem))), !s && r.current && (e.closeQuestion(r.current), r.current = "");
31
29
  }), () => {
32
- }), [e, o, t]), i ? /* @__PURE__ */ jsx(v, {
33
- sdk: n,
34
- skipAutoClose: p,
35
- hideHeader: f,
30
+ }), [e, i, t]), m ? /* @__PURE__ */ u(A, {
31
+ sdk: o,
32
+ skipAutoClose: n,
33
+ hideHeader: d,
36
34
  gamification: e,
37
- hideSponsor: true
35
+ hideSponsor: !0
38
36
  }) : null;
39
- }, D = ({
37
+ }, v = ({
40
38
  sdk: e,
41
- persistent: n,
42
- skipAutoClose: o,
43
- insightId: p,
44
- hideHeader: f
39
+ persistent: o,
40
+ skipAutoClose: i,
41
+ insightId: n,
42
+ hideHeader: d
45
43
  }) => {
46
- if (!useStore(e.featuresList.getStore()))
44
+ if (!a(e.featuresList.getStore()))
47
45
  return null;
48
- const r = e.getFeature(SdkOverlayType.GAMES);
49
- return r ? /* @__PURE__ */ jsx(w, {
50
- insightId: p,
46
+ const t = e.getFeature(g.GAMES);
47
+ return t ? /* @__PURE__ */ u(b, {
48
+ insightId: n,
51
49
  sdk: e,
52
- persistent: n,
53
- hideHeader: f,
54
- gamification: r,
55
- skipAutoClose: o
50
+ persistent: o,
51
+ hideHeader: d,
52
+ gamification: t,
53
+ skipAutoClose: i
56
54
  }) : null;
57
- };
58
- const StreamLayerSDKInsight = ({
59
- event,
60
- theme,
61
- hideHeader,
62
- skipAutoClose,
63
- persistent
55
+ }, M = ({
56
+ event: e,
57
+ theme: o,
58
+ hideHeader: i,
59
+ skipAutoClose: n,
60
+ persistent: d
64
61
  }) => {
65
- const sdk = B();
66
- const baseTheme = z();
67
- if (!sdk) {
68
- return null;
69
- }
70
- return /* @__PURE__ */ jsxs("div", { className: "StreamLayerSDK", children: [
71
- /* @__PURE__ */ jsx(h, { customTheme: theme ?? baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(
72
- D,
62
+ const t = S(), r = k();
63
+ return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
64
+ /* @__PURE__ */ u(p, { customTheme: o ?? r.theme, themeMode: r.themeMode, children: /* @__PURE__ */ u(
65
+ v,
73
66
  {
74
- skipAutoClose,
75
- sdk,
76
- hideHeader,
77
- persistent
67
+ skipAutoClose: n,
68
+ sdk: t,
69
+ hideHeader: i,
70
+ persistent: d
78
71
  }
79
72
  ) }),
80
- event !== void 0 && /* @__PURE__ */ jsx(j, { event })
81
- ] });
73
+ e !== void 0 && /* @__PURE__ */ u(Q, { event: e })
74
+ ] }) : null;
82
75
  };
83
76
  export {
84
- StreamLayerSDKInsight,
85
- D as StreamLayerSDKInsightUI
77
+ M as StreamLayerSDKInsight,
78
+ v as StreamLayerSDKInsightUI
86
79
  };