@streamlayer/react 1.24.4 → 1.24.6

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 (103) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +26 -26
  3. package/lib/cjs/bet-pack.js +1 -1
  4. package/lib/cjs/feature.js +1 -1
  5. package/lib/cjs/{index-ByUNFvMk.js → index-CfSdnrfA.js} +1 -1
  6. package/lib/cjs/index10.js +1 -1
  7. package/lib/cjs/index11.js +1 -1
  8. package/lib/cjs/index12.js +1 -1
  9. package/lib/cjs/index13.js +4 -1
  10. package/lib/cjs/index14.js +1 -4
  11. package/lib/cjs/index15.js +1 -1
  12. package/lib/cjs/index16.js +2 -2
  13. package/lib/cjs/index2.js +1 -1
  14. package/lib/cjs/index4.js +3 -3
  15. package/lib/cjs/index6.js +1 -1
  16. package/lib/cjs/index7.js +1 -1
  17. package/lib/cjs/index9.js +2 -2
  18. package/lib/cjs/insight.js +1 -1
  19. package/lib/cjs/masters2.js +3 -3
  20. package/lib/cjs/notification.js +1 -1
  21. package/lib/cjs/pause-ad.js +1 -1
  22. package/lib/cjs/points.js +1 -1
  23. package/lib/cjs/polymarket.js +1 -1
  24. package/lib/cjs/storage.js +1 -1
  25. package/lib/cjs/useStreamLayerApp2.js +13 -13
  26. package/lib/classic/cjs/Question.js +1 -1
  27. package/lib/classic/cjs/advertisement.js +26 -26
  28. package/lib/classic/cjs/bet-pack.js +3 -3
  29. package/lib/classic/cjs/feature.js +1 -1
  30. package/lib/classic/cjs/{index-ByUNFvMk.js → index-CfSdnrfA.js} +1 -1
  31. package/lib/classic/cjs/index10.js +1 -1
  32. package/lib/classic/cjs/index11.js +1 -1
  33. package/lib/classic/cjs/index12.js +1 -1
  34. package/lib/classic/cjs/index13.js +1 -1
  35. package/lib/classic/cjs/index2.js +2 -2
  36. package/lib/classic/cjs/index5.js +1 -1
  37. package/lib/classic/cjs/index7.js +2 -2
  38. package/lib/classic/cjs/index8.js +1 -1
  39. package/lib/classic/cjs/index9.js +1 -1
  40. package/lib/classic/cjs/insight.js +1 -1
  41. package/lib/classic/cjs/notification2.js +1 -1
  42. package/lib/classic/cjs/pause-ad.js +1 -1
  43. package/lib/classic/cjs/points.js +1 -1
  44. package/lib/classic/cjs/polymarket.js +1 -1
  45. package/lib/classic/cjs/useStreamLayerApp2.js +13 -13
  46. package/lib/classic/es/Question.js +313 -198
  47. package/lib/classic/es/advertisement.js +1988 -1955
  48. package/lib/classic/es/bet-pack.js +12 -13
  49. package/lib/classic/es/feature.js +188 -37
  50. package/lib/{es/index-ByUNFvMk.js → classic/es/index-CfSdnrfA.js} +1 -1
  51. package/lib/classic/es/index10.js +309 -2580
  52. package/lib/classic/es/index11.js +2580 -305
  53. package/lib/classic/es/index12.js +12 -12
  54. package/lib/classic/es/index13.js +2 -2
  55. package/lib/classic/es/index2.js +129 -121
  56. package/lib/classic/es/index5.js +0 -1
  57. package/lib/classic/es/index7.js +2 -2
  58. package/lib/classic/es/index8.js +1 -1
  59. package/lib/classic/es/index9.js +1 -1
  60. package/lib/classic/es/insight.js +1 -1
  61. package/lib/classic/es/notification2.js +137 -138
  62. package/lib/classic/es/pause-ad.js +124 -149
  63. package/lib/classic/es/points.js +3 -4
  64. package/lib/classic/es/polymarket.js +1 -1
  65. package/lib/classic/es/useStreamLayerApp2.js +2932 -2876
  66. package/lib/classic/source.css +1 -1
  67. package/lib/dist/cjs/{index-ByUNFvMk.js → index-CfSdnrfA.js} +1 -1
  68. package/lib/dist/cjs/masters.js +31 -31
  69. package/lib/dist/es/{index-ByUNFvMk.js → index-CfSdnrfA.js} +1 -1
  70. package/lib/dist/es/masters.js +7958 -7773
  71. package/lib/dist/index.d.ts +2 -0
  72. package/lib/es/Question.js +66 -65
  73. package/lib/es/advertisement.js +1988 -1955
  74. package/lib/es/bet-pack.js +1 -1
  75. package/lib/es/feature.js +188 -37
  76. package/lib/{classic/es/index-ByUNFvMk.js → es/index-CfSdnrfA.js} +1 -1
  77. package/lib/es/index10.js +1 -1
  78. package/lib/es/index11.js +12 -12
  79. package/lib/es/index12.js +366 -2579
  80. package/lib/es/index13.js +789 -234
  81. package/lib/es/index14.js +293 -792
  82. package/lib/es/index15.js +2580 -305
  83. package/lib/es/index16.js +41 -42
  84. package/lib/es/index2.js +279 -271
  85. package/lib/es/index4.js +15 -16
  86. package/lib/es/index6.js +0 -1
  87. package/lib/es/index7.js +1 -1
  88. package/lib/es/index9.js +2 -2
  89. package/lib/es/insight.js +1 -1
  90. package/lib/es/masters2.js +194 -183
  91. package/lib/es/notification.js +22 -23
  92. package/lib/es/pause-ad.js +124 -149
  93. package/lib/es/points.js +20 -21
  94. package/lib/es/polymarket.js +1 -1
  95. package/lib/es/storage.js +1 -1
  96. package/lib/es/useStreamLayerApp2.js +2932 -2876
  97. package/lib/source.css +1 -1
  98. package/lib/style.css +1 -1
  99. package/package.json +72 -53
  100. package/lib/cjs/sl-types.js +0 -1
  101. package/lib/classic/cjs/sl-types.js +0 -1
  102. package/lib/classic/es/sl-types.js +0 -156
  103. package/lib/es/sl-types.js +0 -156
@@ -1,15 +1,14 @@
1
1
  import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
2
  import { h as us } from "./index7.js";
3
3
  import { useState as I, useRef as Q, useEffect as $, useCallback as As, useMemo as fs } from "react";
4
- import { s as e, c as hs, u as Is, N as M } from "./sl-types.js";
4
+ import { s as e, c as hs, u as Is, N as M } from "./feature.js";
5
5
  import { e as $s } from "./index3.js";
6
- import "./feature.js";
7
6
  import { x as W } from "./storage.js";
8
7
  import { D as vs, j as gs, e as K, o as ws } from "./index11.js";
9
8
  import { B as A } from "./index8.js";
10
9
  import { d, Q as f, a as G, N as x, S as bs, A as R } from "./useStreamLayerApp2.js";
11
10
  import { b as S } from "./index9.js";
12
- import { F as Ts, y as ys } from "./index15.js";
11
+ import { V as Ts, y as ys } from "./index14.js";
13
12
  import { p as Cs } from "./index5.js";
14
13
  import { Y as Ns, _ as ks, q as qs } from "./hooks-n9ax4LRT.js";
15
14
  const w = /* @__PURE__ */ e("div")({
@@ -78,11 +77,11 @@ const w = /* @__PURE__ */ e("div")({
78
77
  name: "Body",
79
78
  class: "b1j59nzs",
80
79
  propsAsIs: !1
81
- }), Fs = /* @__PURE__ */ e("div")({
80
+ }), Vs = /* @__PURE__ */ e("div")({
82
81
  name: "Title",
83
82
  class: "t9vmnpp",
84
83
  propsAsIs: !1
85
- }), Vs = /* @__PURE__ */ e("button")({
84
+ }), Fs = /* @__PURE__ */ e("button")({
86
85
  name: "Button",
87
86
  class: "b14ivj5k",
88
87
  propsAsIs: !1
@@ -128,7 +127,7 @@ const w = /* @__PURE__ */ e("div")({
128
127
  questionStatus: G.UNSET
129
128
  }
130
129
  ),
131
- n && /* @__PURE__ */ s(Fs, { children: n })
130
+ n && /* @__PURE__ */ s(Vs, { children: n })
132
131
  ] }), Hs = ({ tweet: n }) => n ? /* @__PURE__ */ s(X, { children: /* @__PURE__ */ s(Xs, { ...n, controlVideo: () => {
133
132
  } }) }) : null, Js = ({ action: n, questionType: o, inApp: i, insight: a, tweet: r }) => {
134
133
  const t = K[o], p = ws[o];
@@ -142,7 +141,7 @@ const w = /* @__PURE__ */ e("div")({
142
141
  h && !g && /* @__PURE__ */ s(j, { src: h, imageMode: u, withVideo: !!b }),
143
142
  g && /* @__PURE__ */ s(j, { src: g, fromInsight: !0, withVideo: !!b }),
144
143
  o === f.TWEET ? /* @__PURE__ */ s(Hs, { tweet: r }) : /* @__PURE__ */ s(Zs, { questionTypeData: t, questionType: o, title: c }),
145
- /* @__PURE__ */ s(Vs, { name: "inapp-button", children: p || "Open" }),
144
+ /* @__PURE__ */ s(Fs, { name: "inapp-button", children: p || "Open" }),
146
145
  /* @__PURE__ */ s(_s, { name: "chevronRight" })
147
146
  ] }) });
148
147
  }, se = () => ({
@@ -320,7 +319,7 @@ const w = /* @__PURE__ */ e("div")({
320
319
  ),
321
320
  n && /* @__PURE__ */ s(qe, { webos: t, children: n }),
322
321
  a && /* @__PURE__ */ s(xe, { children: a })
323
- ] }), Pe = S(De), ze = S(Re), Ue = S(Oe), Fe = ({
322
+ ] }), Pe = S(De), ze = S(Re), Ue = S(Oe), Ve = ({
324
323
  className: n,
325
324
  sponsorLogo: o,
326
325
  onClick: i,
@@ -335,7 +334,7 @@ const w = /* @__PURE__ */ e("div")({
335
334
  "data-webos": a,
336
335
  children: /* @__PURE__ */ s(Z, { withoutPadding: !0, children: /* @__PURE__ */ s(J, { src: o }) })
337
336
  }
338
- ), Ve = ({
337
+ ), Fe = ({
339
338
  action: n,
340
339
  close: o,
341
340
  questionType: i,
@@ -354,7 +353,7 @@ const w = /* @__PURE__ */ e("div")({
354
353
  return null;
355
354
  const { title: b, image: ls, imageMode: y, useContentMedia: C } = a.notification, ps = i === f.FACTOID ? r?.heading : b, ds = i === f.FACTOID ? r?.body : "", ms = ls, N = i === f.FACTOID && r?.video?.url && a?.isVideo && C === x.ENABLED, k = C === x.ENABLED ? N ? r?.video?.url : r?.image : "";
356
355
  return a?.sponsorLogo && m ? /* @__PURE__ */ s(
357
- Fe,
356
+ Ve,
358
357
  {
359
358
  className: c,
360
359
  sponsorLogo: a?.sponsorLogo,
@@ -684,7 +683,7 @@ const w = /* @__PURE__ */ e("div")({
684
683
  name: "Body",
685
684
  class: "b16qj0do",
686
685
  propsAsIs: !1
687
- }), F = {
686
+ }), V = {
688
687
  1: 3e3,
689
688
  2: 4e3,
690
689
  3: 4e3,
@@ -693,8 +692,8 @@ const w = /* @__PURE__ */ e("div")({
693
692
  if ($(() => {
694
693
  if (i) {
695
694
  const u = setTimeout(() => {
696
- F[c + 1] && (r || c < 3) ? i(c + 1) : n?.();
697
- }, F[c]);
695
+ V[c + 1] && (r || c < 3) ? i(c + 1) : n?.();
696
+ }, V[c]);
698
697
  return () => {
699
698
  u && clearTimeout(u);
700
699
  };
@@ -733,11 +732,11 @@ const w = /* @__PURE__ */ e("div")({
733
732
  name: "NotificationContainer",
734
733
  class: "n1i4h28u",
735
734
  propsAsIs: !1
736
- }), Un = ({ className: n, ...o }) => /* @__PURE__ */ s(zn, { className: n, children: /* @__PURE__ */ s(Pn, { ...o }) }), Fn = /* @__PURE__ */ e("div")({
735
+ }), Un = ({ className: n, ...o }) => /* @__PURE__ */ s(zn, { className: n, children: /* @__PURE__ */ s(Pn, { ...o }) }), Vn = /* @__PURE__ */ e("div")({
737
736
  name: "Container",
738
737
  class: "cwa9tgs",
739
738
  propsAsIs: !1
740
- }), Vn = /* @__PURE__ */ e("div")({
739
+ }), Fn = /* @__PURE__ */ e("div")({
741
740
  name: "BodyContainer",
742
741
  class: "b1xx7swj",
743
742
  propsAsIs: !1
@@ -761,11 +760,11 @@ const w = /* @__PURE__ */ e("div")({
761
760
  return () => {
762
761
  t.disconnect();
763
762
  };
764
- }, []), /* @__PURE__ */ s(Fn, {
763
+ }, []), /* @__PURE__ */ s(Vn, {
765
764
  style: {
766
765
  padding: `${n === 3 && i === "incorrect" || n === 1 ? "5px 100px" : "5px 40px"}`
767
766
  },
768
- children: /* @__PURE__ */ s(Vn, {
767
+ children: /* @__PURE__ */ s(Fn, {
769
768
  style: {
770
769
  minWidth: `${a}px`
771
770
  },
@@ -876,7 +875,7 @@ const w = /* @__PURE__ */ e("div")({
876
875
  }), /* @__PURE__ */ l(is, {
877
876
  children: ["Your Pick: ", o]
878
877
  })]
879
- }), V = /* @__PURE__ */ e("div")({
878
+ }), F = /* @__PURE__ */ e("div")({
880
879
  name: "Container",
881
880
  class: "cmox3ot",
882
881
  propsAsIs: !1
@@ -901,9 +900,9 @@ const w = /* @__PURE__ */ e("div")({
901
900
  return () => {
902
901
  };
903
902
  }, [i, c, n, r]), c === 1)
904
- return /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(Y, { children: /* @__PURE__ */ s(oo, {}) }) });
903
+ return /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(Y, { children: /* @__PURE__ */ s(oo, {}) }) });
905
904
  let m = "pending";
906
- return c === 3 && (m = r ? "correct" : "incorrect"), /* @__PURE__ */ s(V, { "data-a": "intr", onClick: () => o?.(), children: /* @__PURE__ */ l(Y, { children: [
905
+ return c === 3 && (m = r ? "correct" : "incorrect"), /* @__PURE__ */ s(F, { "data-a": "intr", onClick: () => o?.(), children: /* @__PURE__ */ l(Y, { children: [
907
906
  c !== 1 && /* @__PURE__ */ s(Jn, {}, c),
908
907
  /* @__PURE__ */ l(_n, { state: m, step: c, children: [
909
908
  c === 2 && /* @__PURE__ */ s(lo, { title: p || "unknown", answer: a?.title || "unknown" }),
@@ -1004,7 +1003,7 @@ const w = /* @__PURE__ */ e("div")({
1004
1003
  ...t.data.onboarding
1005
1004
  }
1006
1005
  ) : null : t && t.data.inApp?.adUnit === R.STANDART ? /* @__PURE__ */ s(
1007
- Ve,
1006
+ Fe,
1008
1007
  {
1009
1008
  ...t.data,
1010
1009
  action: t.action,
@@ -1013,11 +1012,11 @@ const w = /* @__PURE__ */ e("div")({
1013
1012
  webos: o
1014
1013
  }
1015
1014
  ) : t && /* @__PURE__ */ s(Js, { ...t.data, action: t.action });
1016
- }, Po = ({ theme: n }) => {
1015
+ }, Bo = ({ theme: n }) => {
1017
1016
  const o = Ns(), i = ks(), a = qs();
1018
1017
  return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(us, { customTheme: n ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ s(yo, { sdk: o }) }) }) : null;
1019
1018
  };
1020
1019
  export {
1021
- Po as StreamLayerSDKNotification,
1020
+ Bo as StreamLayerSDKNotification,
1022
1021
  yo as StreamLayerSDKNotificationUI
1023
1022
  };
@@ -1,71 +1,55 @@
1
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
2
- import { h as M } from "./index7.js";
3
- import { s as d, u as q, c as V } from "./sl-types.js";
4
- import { d as j } from "./index12.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 "./index3.js";
7
- import { Y as z, _ as G } from "./hooks-n9ax4LRT.js";
8
- const O = /* @__PURE__ */ d("div")({
1
+ import { jsx as a, jsxs as B } from "react/jsx-runtime";
2
+ import { h as F } from "./index7.js";
3
+ import { useEffect as i, useState as _, useRef as g, useCallback as R, Component as M } from "react";
4
+ import { s as h, c as w, u as j } from "./feature.js";
5
+ import { e as k } from "./index3.js";
6
+ import { d as K } from "./index15.js";
7
+ import { Y as V, _ as z } from "./hooks-n9ax4LRT.js";
8
+ const G = /* @__PURE__ */ h("div")({
9
9
  name: "PauseAdOverlay",
10
10
  class: "pw9gih8",
11
11
  propsAsIs: !1
12
- }), W = /* @__PURE__ */ d("div")({
12
+ }), H = /* @__PURE__ */ h("div")({
13
13
  name: "PauseAdContent",
14
14
  class: "p8lpomy",
15
15
  propsAsIs: !1
16
- }), X = /* @__PURE__ */ d("div")({
17
- name: "PauseAdTopLeft",
18
- class: "pv7u167",
19
- propsAsIs: !1
20
- }), Y = /* @__PURE__ */ d("h2")({
21
- name: "PauseAdTitle",
22
- class: "p1kh2yb0",
23
- propsAsIs: !1
24
- }), H = /* @__PURE__ */ d("p")({
25
- name: "PauseAdCaption",
26
- class: "pl8f94x",
27
- propsAsIs: !1
28
- }), J = /* @__PURE__ */ d("div")({
16
+ }), O = /* @__PURE__ */ h("div")({
29
17
  name: "PauseAdBottomLeft",
30
- class: "p1m6zmrt",
18
+ class: "pv7u167",
31
19
  propsAsIs: !1
32
- }), Q = /* @__PURE__ */ d("button")({
20
+ }), Y = /* @__PURE__ */ h("button")({
33
21
  name: "PauseAdPlayButton",
34
- class: "pm3vwfa",
22
+ class: "p1kh2yb0",
35
23
  propsAsIs: !1
36
- }), Z = /* @__PURE__ */ d("div")({
24
+ }), q = /* @__PURE__ */ h("div")({
37
25
  name: "PauseAdSidebarGradient",
38
- class: "p1tibuhw",
26
+ class: "pl8f94x",
39
27
  propsAsIs: !1
40
- }), $ = /* @__PURE__ */ d("div")({
28
+ }), J = /* @__PURE__ */ h("div")({
41
29
  name: "PauseAdSidebar",
42
- class: "ptqqrqd",
43
- propsAsIs: !1
44
- }), ee = /* @__PURE__ */ d("span")({
45
- name: "PauseAdTitleDescription",
46
- class: "p14estxv",
30
+ class: "p1m6zmrt",
47
31
  propsAsIs: !1
48
- }), N = /* @__PURE__ */ d("img")({
32
+ }), U = /* @__PURE__ */ h("img")({
49
33
  name: "ExternalAdContainer",
50
- class: "e1dpvfl1",
34
+ class: "em3vwfa",
51
35
  propsAsIs: !1
52
- }), re = ({
53
- vastUrl: i,
54
- isDesktop: a,
36
+ }), Q = ({
37
+ vastUrl: d,
38
+ isDesktop: n,
55
39
  content: e
56
- }) => (c(() => {
57
- e.imageSrc && e.id && T.emit("exposedPauseAd", {
40
+ }) => (i(() => {
41
+ e.imageSrc && e.id && k.emit("exposedPauseAd", {
58
42
  action: "rendered",
59
43
  payload: {
60
44
  id: e.id,
61
45
  parentId: e.parentId
62
46
  }
63
47
  });
64
- }, [e, i]), e?.imageSrc ? !e.adUrl || !a ? /* @__PURE__ */ r(N, { src: e.imageSrc }) : /* @__PURE__ */ r(
48
+ }, [e, d]), e?.imageSrc ? !e.adUrl || !n ? /* @__PURE__ */ a(U, { src: e.imageSrc }) : /* @__PURE__ */ a(
65
49
  "a",
66
50
  {
67
51
  onClick: () => {
68
- T.emit("exposedPauseAd", {
52
+ k.emit("exposedPauseAd", {
69
53
  action: "navigated",
70
54
  payload: {
71
55
  id: e.id,
@@ -76,182 +60,173 @@ const O = /* @__PURE__ */ d("div")({
76
60
  href: e.adUrl,
77
61
  target: "_blank",
78
62
  rel: "noopener noreferrer",
79
- children: /* @__PURE__ */ r(N, { src: e.imageSrc })
63
+ children: /* @__PURE__ */ a(U, { src: e.imageSrc })
80
64
  }
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({
65
+ ) : null), W = ({ isClosing: d, content: n, externalPauseAdStore: e, onPlay: l, onClose: u, vastUrl: c, options: v, isDesktop: r }) => {
66
+ const m = v?.showPauseButton ?? !0, { ref: t, focusSelf: y } = K.useFocusable({
83
67
  focusKey: "sl-pause-ad-play",
84
68
  onEnterRelease: l,
85
69
  isFocusBoundary: !0,
86
70
  forceFocus: !0
87
71
  });
88
- return c(() => () => {
72
+ return i(() => () => {
89
73
  e.revalidate();
90
- }, [e]), c(() => {
91
- p.current && I();
92
- }, [p, I]), c(() => {
74
+ }, [e]), i(() => {
75
+ t.current && y();
76
+ }, [t, y]), i(() => {
93
77
  if (!u)
94
78
  return () => {
95
79
  };
96
- const C = (A) => {
97
- const s = A.keyCode;
80
+ const b = (f) => {
81
+ const s = f.keyCode;
98
82
  if (s === 461 || s === 10009 || s === 27 || s === 8) {
99
- A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), u();
83
+ f.preventDefault(), f.stopPropagation(), f.stopImmediatePropagation(), u();
100
84
  return;
101
85
  }
102
86
  };
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 })
108
- ] }),
109
- b && /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(
110
- Q,
87
+ return window.addEventListener("keydown", b, { capture: !0 }), () => window.removeEventListener("keydown", b, { capture: !0 });
88
+ }, [u]), /* @__PURE__ */ a(G, { className: w("SL_PauseAd", d && "pause-ad-closing"), children: /* @__PURE__ */ B(H, { children: [
89
+ m && /* @__PURE__ */ a(O, { children: /* @__PURE__ */ a(
90
+ Y,
111
91
  {
112
- ref: p,
92
+ ref: t,
113
93
  onClick: l,
114
- onMouseEnter: () => p.current.focus(),
94
+ onMouseEnter: () => t.current.focus(),
115
95
  "aria-label": "Resume playback"
116
96
  }
117
97
  ) }),
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" })
121
- ] }) })
98
+ /* @__PURE__ */ a(q, { className: w("SL_PauseAdSidebar", r && "SL_PauseAdSidebar--desktop"), children: /* @__PURE__ */ a(J, { className: w(r && "SL_PauseAdSidebar__content--desktop"), children: c && /* @__PURE__ */ a(Q, { content: n, isDesktop: r, vastUrl: c }) }) })
122
99
  ] }) });
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 = _(() => {
100
+ }, X = ({ showPauseAd: d, vastUrls: n, sdk: e, onClose: l, onRender: u, options: c, isDesktop: v }) => {
101
+ const r = c?.pauseAdDelay ?? 0, m = c?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [t, y] = _(!1), [b, f] = _(!1), s = g(), P = n?.[0].url, A = g(P), S = g(""), I = g("");
102
+ A.current = P;
103
+ const [p, L] = e.advertisement.getExternalPauseAd(P, {
104
+ refetchInterval: m,
105
+ $enabled: r === 0 || !!d,
106
+ prefetch: r === 0 && m > 0
107
+ }), x = j(p), C = R(() => {
131
108
  if (l) {
132
- S.current = P.current;
133
- const o = m.get().data;
134
- T.emit("exposedPauseAd", {
109
+ I.current = A.current;
110
+ const o = p.get().data;
111
+ k.emit("exposedPauseAd", {
135
112
  action: "closed",
136
- payload: o?.url === S.current ? {
113
+ payload: o?.url === I.current ? {
137
114
  id: o?.id,
138
115
  parentId: o?.parentId
139
116
  } : {}
140
117
  }), l();
141
118
  }
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", {
119
+ }, [l, p]), N = R(() => {
120
+ e.controlVideoPlayer({ play: !0 });
121
+ }, [e]);
122
+ return i(() => {
123
+ L === A.current && x.error && (clearTimeout(s.current), C?.());
124
+ }, [x, C, L]), i(() => {
125
+ if (d && P) {
126
+ S.current = A.current, I.current = "";
127
+ const o = p.get().data;
128
+ k.emit("exposedPauseAd", {
152
129
  action: "enabled",
153
- payload: o?.url === g.current ? {
130
+ payload: o?.url === S.current ? {
154
131
  id: o?.id,
155
132
  parentId: o?.parentId
156
133
  } : {}
157
134
  });
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();
135
+ const T = () => {
136
+ const E = p.get(), D = E.data;
137
+ (!D || D?.url === A.current) && (!E.loading && D?.imageSrc ? (clearTimeout(s.current), f(!1), y(!0)) : E.loading && (s.current = setTimeout(() => {
138
+ T();
162
139
  }, 200)));
163
140
  };
164
141
  clearTimeout(s.current), s.current = setTimeout(() => {
165
- U();
166
- }, n);
142
+ T();
143
+ }, r);
167
144
  } else {
168
- if (S.current !== P.current) {
169
- const o = m.get().data;
170
- S.current = "", g.current !== "" && (T.emit("exposedPauseAd", {
145
+ if (I.current !== A.current) {
146
+ const o = p.get().data;
147
+ I.current = "", S.current !== "" && (k.emit("exposedPauseAd", {
171
148
  action: "disabled",
172
- payload: g.current === o?.url ? {
149
+ payload: S.current === o?.url ? {
173
150
  id: o?.id,
174
151
  parentId: o?.parentId
175
152
  } : {}
176
- }), g.current = "");
153
+ }), S.current = "");
177
154
  }
178
- A(!0), s.current = setTimeout(() => {
179
- I(!1);
155
+ f(!0), s.current = setTimeout(() => {
156
+ y(!1);
180
157
  }, 400);
181
158
  }
182
159
  return () => {
183
160
  s.current && clearTimeout(s.current);
184
161
  };
185
- }, [m, E, n, i, v]), c(() => {
186
- u?.({ rendered: p });
187
- }, [p, u]), c(() => () => {
162
+ }, [p, C, r, d, P]), i(() => {
163
+ u?.({ rendered: t });
164
+ }, [t, u]), i(() => () => {
188
165
  u?.({ rendered: !1 });
189
- }, [u]), !p || !k.data ? null : /* @__PURE__ */ r(
190
- te,
166
+ }, [u]), !t || !x.data ? null : /* @__PURE__ */ a(
167
+ W,
191
168
  {
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
169
+ onClose: C,
170
+ isClosing: b,
171
+ onPlay: N,
172
+ vastUrl: P,
173
+ options: c,
174
+ isDesktop: v,
175
+ externalPauseAdStore: p,
176
+ content: x.data
202
177
  }
203
178
  );
204
- }, ae = ({
205
- showPauseAd: i,
206
- pauseAdVastUrl: a,
179
+ }, Z = ({
180
+ showPauseAd: d,
181
+ pauseAdVastUrl: n,
207
182
  videoPlayerController: e,
208
- onRenderPauseAd: y,
209
- onClosePauseAd: f,
210
- children: l,
211
- options: u
183
+ onRenderPauseAd: l,
184
+ onClosePauseAd: u,
185
+ children: c,
186
+ options: v
212
187
  }) => {
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);
188
+ const r = V(), m = z(), t = g();
189
+ return i(() => r ? (e && (t.current = e, r.addVideoPlayerController(t.current)), () => {
190
+ t.current && r.removeVideoPlayerController(t.current);
216
191
  }) : () => {
217
- }, [t, e]), t ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
218
- M,
192
+ }, [r, e]), r ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ B(
193
+ F,
219
194
  {
220
- style: l ? { position: "relative" } : {},
221
- customTheme: h.theme,
222
- themeMode: h.themeMode,
195
+ style: c ? { position: "relative" } : {},
196
+ customTheme: m.theme,
197
+ themeMode: m.themeMode,
223
198
  children: [
224
- l,
225
- a && /* @__PURE__ */ r(
226
- se,
199
+ c,
200
+ n && /* @__PURE__ */ a(
201
+ X,
227
202
  {
228
- sdk: t,
229
- showPauseAd: i,
230
- vastUrls: a,
231
- onClose: f,
232
- onRender: y,
233
- options: u,
203
+ sdk: r,
204
+ showPauseAd: d,
205
+ vastUrls: n,
206
+ onClose: u,
207
+ onRender: l,
208
+ options: v,
234
209
  isDesktop: !0
235
210
  }
236
211
  )
237
212
  ]
238
213
  }
239
- ) }) : l;
214
+ ) }) : c;
240
215
  };
241
- class pe extends K {
242
- constructor(a) {
243
- super(a), this.state = { hasError: !1 };
216
+ class oe extends M {
217
+ constructor(n) {
218
+ super(n), this.state = { hasError: !1 };
244
219
  }
245
220
  static getDerivedStateFromError() {
246
221
  return { hasError: !0 };
247
222
  }
248
- componentDidCatch(a, e) {
249
- console.error(a, e.componentStack);
223
+ componentDidCatch(n, e) {
224
+ console.error(n, e.componentStack);
250
225
  }
251
226
  render() {
252
- return this.state.hasError ? this.props.children : /* @__PURE__ */ r(ae, { ...this.props });
227
+ return this.state.hasError ? this.props.children : /* @__PURE__ */ a(Z, { ...this.props });
253
228
  }
254
229
  }
255
230
  export {
256
- pe as StreamLayerPauseAd
231
+ oe as StreamLayerPauseAd
257
232
  };
package/lib/es/points.js CHANGED
@@ -1,43 +1,42 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
2
  import { h as c } from "./index7.js";
3
3
  import { useState as u, useEffect as d } from "react";
4
- import { s as t, u as f } from "./sl-types.js";
4
+ import { s as o, u as f, F as m } from "./feature.js";
5
5
  import { e as n } from "./index3.js";
6
6
  import { p as h } from "./index5.js";
7
7
  import { m as y } from "./theme.js";
8
8
  import { B as S } from "./index8.js";
9
- import { F as p } from "./feature.js";
10
9
  import { S as v } from "./useStreamLayerApp2.js";
11
10
  import { Y as g, _ as A } from "./hooks-n9ax4LRT.js";
12
- const I = /* @__PURE__ */ t("div")({
11
+ const I = /* @__PURE__ */ o("div")({
13
12
  name: "PointsContainer",
14
13
  class: "psiob9b",
15
14
  propsAsIs: !1
16
- }), P = /* @__PURE__ */ t("div")({
15
+ }), P = /* @__PURE__ */ o("div")({
17
16
  name: "PointsIcon",
18
17
  class: "p1gqe4lh",
19
18
  propsAsIs: !1
20
- }), b = () => S, k = /* @__PURE__ */ t(b())({
19
+ }), b = () => S, k = /* @__PURE__ */ o(b())({
21
20
  name: "PointsSvg",
22
21
  class: "p15syg2y",
23
22
  propsAsIs: !0
24
- }), F = /* @__PURE__ */ t("div")({
23
+ }), F = /* @__PURE__ */ o("div")({
25
24
  name: "PointsBody",
26
25
  class: "p12n4f2h",
27
26
  propsAsIs: !1
28
- }), T = /* @__PURE__ */ t("div")({
27
+ }), T = /* @__PURE__ */ o("div")({
29
28
  name: "PointsTitle",
30
29
  class: "poqmx89",
31
30
  propsAsIs: !1
32
- }), x = /* @__PURE__ */ t("div")({
31
+ }), x = /* @__PURE__ */ o("div")({
33
32
  name: "PointsValue",
34
33
  class: "prj9b3v",
35
34
  propsAsIs: !1
36
- }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: y, onClick: e, children: [
37
- /* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(k, { name: "icon-trophy-solid" }) }),
38
- /* @__PURE__ */ m(F, { children: [
39
- /* @__PURE__ */ o(T, { children: "Total points" }),
40
- /* @__PURE__ */ o(x, { children: /* @__PURE__ */ o(h, { value: s }) })
35
+ }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ p(I, { className: y, 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(h, { value: s }) })
41
40
  ] })
42
41
  ] }), C = ({ gamification: s }) => {
43
42
  const e = s.userSummary.$store, [a, l] = u(0);
@@ -48,15 +47,15 @@ const I = /* @__PURE__ */ t("div")({
48
47
  return () => {
49
48
  r();
50
49
  };
51
- }, [e]), /* @__PURE__ */ o(B, { points: a, onClick: () => {
50
+ }, [e]), /* @__PURE__ */ t(B, { points: a, onClick: () => {
52
51
  const r = s.status.get();
53
- r === p.Suspended ? (s.openFeature(), n.emit("app", {
52
+ r === m.Suspended ? (s.openFeature(), n.emit("app", {
54
53
  action: "open",
55
54
  payload: {}
56
55
  }), n.emit("interactions", {
57
56
  action: "tap",
58
57
  payload: {}
59
- })) : r === p.Ready && (s.closeFeature(!1), n.emit("app", {
58
+ })) : r === m.Ready && (s.closeFeature(!1), n.emit("app", {
60
59
  action: "close",
61
60
  payload: {}
62
61
  }), n.emit("interactions", {
@@ -68,11 +67,11 @@ const I = /* @__PURE__ */ t("div")({
68
67
  if (!f(s.featuresList.getStore()))
69
68
  return null;
70
69
  const e = s.getFeature(v.GAMES);
71
- return e ? /* @__PURE__ */ o(C, { gamification: e }) : null;
72
- }, R = ({ theme: s }) => {
70
+ return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
71
+ }, O = ({ theme: s }) => {
73
72
  const e = g(), a = A();
74
- return e ? /* @__PURE__ */ o("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ o(c, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ o($, { sdk: e }) }) }) : null;
73
+ return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(c, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ t($, { sdk: e }) }) }) : null;
75
74
  };
76
75
  export {
77
- R as StreamLayerSDKPoints
76
+ O as StreamLayerSDKPoints
78
77
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as K, jsx as E } from "react/jsx-runtime";
2
2
  import { h as fs } from "./index7.js";
3
- import { s as k, u as js, c as Vs } from "./sl-types.js";
3
+ import { s as k, u as js, c as Vs } from "./feature.js";
4
4
  import { q as ds, Y as ms, _ as ps } from "./hooks-n9ax4LRT.js";
5
5
  import { useRef as Ds, useEffect as Ks } from "react";
6
6
  import "./index6.js";
package/lib/es/storage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
- import { s as e } from "./sl-types.js";
2
+ import { s as e } from "./feature.js";
3
3
  import { e as f } from "./index11.js";
4
4
  import { e as A, i as c } from "./index10.js";
5
5
  import { B as m } from "./index8.js";