@streamlayer/react-ui 1.28.1 → 1.28.3

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.
@@ -17,6 +17,5 @@ export declare const AdvertisementUI: React.FC<{
17
17
  fireEvent: Advertisement['fireEvent'];
18
18
  muted?: boolean;
19
19
  toggleMute: (flag: boolean) => void;
20
- isMuted?: boolean;
21
20
  isNotification?: boolean;
22
21
  }>;
@@ -1,9 +1,9 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { TVSidebar as S } from "../ui/Sidebar/index.js";
3
- import { Banner as b } from "../../../ui/advertisement/banner/index.js";
4
- import { Notification as g } from "../../../ui/advertisement/notification/index.js";
5
- import { Sidebar as s } from "../../../ui/advertisement/sidebar/index.js";
6
- const B = ({
2
+ import { TVSidebar as N } from "../ui/Sidebar/index.js";
3
+ import { Banner as S } from "../../../ui/advertisement/banner/index.js";
4
+ import { Notification as b } from "../../../ui/advertisement/notification/index.js";
5
+ import { Sidebar as g } from "../../../ui/advertisement/sidebar/index.js";
6
+ const A = ({
7
7
  advertisement: o,
8
8
  close: t,
9
9
  skipAutoClose: p,
@@ -18,10 +18,9 @@ const B = ({
18
18
  fireEvent: u,
19
19
  muted: I,
20
20
  toggleMute: h,
21
- isMuted: q,
22
- isNotification: N
23
- }) => o.promotion ? N && o.notification ? /* @__PURE__ */ r(
24
- g,
21
+ isNotification: q
22
+ }) => o.promotion ? q && o.notification ? /* @__PURE__ */ r(
23
+ b,
25
24
  {
26
25
  open: () => i == null ? void 0 : i({ fromNotification: !0 }),
27
26
  notification: o.notification,
@@ -29,8 +28,8 @@ const B = ({
29
28
  close: t,
30
29
  webos: !0
31
30
  }
32
- ) : n ? /* @__PURE__ */ r(s, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ r(
33
- S,
31
+ ) : n ? /* @__PURE__ */ r(g, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ r(
32
+ N,
34
33
  {
35
34
  markAsViewed: c,
36
35
  promotionId: o.question.id,
@@ -44,11 +43,10 @@ const B = ({
44
43
  isEventFired: m,
45
44
  fireEvent: u,
46
45
  muted: I,
47
- toggleMute: h,
48
- isMuted: q
46
+ toggleMute: h
49
47
  }
50
48
  ) }) : f ? /* @__PURE__ */ r(
51
- b,
49
+ S,
52
50
  {
53
51
  promotionId: o.question.id,
54
52
  hiding: !1,
@@ -59,5 +57,5 @@ const B = ({
59
57
  }
60
58
  ) : null : null;
61
59
  export {
62
- B as AdvertisementUI
60
+ A as AdvertisementUI
63
61
  };
@@ -1,15 +1,15 @@
1
- import { jsxs as M, jsx as P } from "react/jsx-runtime";
2
- import { cx as T } from "@linaria/core";
3
- import { styled as V } from "@linaria/react";
4
- import { useAnalyticsListener as x } from "../../../hooks/analytics.js";
5
- import { useHideTransition as F } from "../../../hooks/showIn.js";
1
+ import { jsxs as T, jsx as P } from "react/jsx-runtime";
2
+ import { cx as V } from "@linaria/core";
3
+ import { styled as x } from "@linaria/react";
4
+ import { useAnalyticsListener as F } from "../../../hooks/analytics.js";
5
+ import { useHideTransition as M } from "../../../hooks/showIn.js";
6
6
  import { forwardRef as O, useEffect as B, useRef as j } from "react";
7
7
  import { useStore as u } from "@streamlayer/react-polyfills";
8
8
  import { eventBus as E } from "@streamlayer/sdk-web-interfaces";
9
9
  import { PromotionType as q, FeatureType as D } from "@streamlayer/sdk-web-types";
10
10
  import { useAdvertisementBackground as H } from "../../../ui/theme/utils.js";
11
11
  import { AdvertisementUI as K } from "./AdvertisementUI.js";
12
- const N = /* @__PURE__ */ V("div")({
12
+ const N = /* @__PURE__ */ x("div")({
13
13
  name: "AdvertisementUIWrap",
14
14
  class: "a17b2u9w",
15
15
  propsAsIs: !1
@@ -45,8 +45,8 @@ const N = /* @__PURE__ */ V("div")({
45
45
  var p, f, g, v, A, b, S, y, U, I;
46
46
  const e = u(t.advertisement.$store), {
47
47
  finished: c
48
- } = F();
49
- x(d, {
48
+ } = M();
49
+ F(d, {
50
50
  enabled: !!e.data,
51
51
  event: "click",
52
52
  listener: R
@@ -59,12 +59,12 @@ const N = /* @__PURE__ */ V("div")({
59
59
  landscapeUrl: W,
60
60
  portraitUrl: h
61
61
  });
62
- return e.data === void 0 || !m && e.isViewed ? null : /* @__PURE__ */ M(N, {
62
+ return e.data === void 0 || !m && e.isViewed ? null : /* @__PURE__ */ T(N, {
63
63
  ref: d,
64
64
  style: {
65
65
  height: k ? "auto" : "100%"
66
66
  },
67
- className: T("SL-AdvertisementUIWrap", "SL-AdvertisementWebOs", "SL-AdvertisementUIWrap--lower-third"),
67
+ className: V("SL-AdvertisementUIWrap", "SL-AdvertisementWebOs", "SL-AdvertisementUIWrap--lower-third"),
68
68
  children: [!n && w, /* @__PURE__ */ P(K, {
69
69
  sidebar: s,
70
70
  banner: i,
@@ -74,7 +74,6 @@ const N = /* @__PURE__ */ V("div")({
74
74
  }),
75
75
  toggleMute: e.toggleMute || (() => {
76
76
  }),
77
- isMuted: e.isMuted,
78
77
  close: e.close,
79
78
  isEventFired: e.isEventFired,
80
79
  fireEvent: e.fireEvent,
@@ -1,32 +1,33 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import i from "hls.js";
1
+ import { jsx as a, jsxs as p, Fragment as f } from "react/jsx-runtime";
2
+ import c from "hls.js";
3
3
  import { useRef as m, useState as d, useEffect as u } from "react";
4
- import { StreamLayerProvider as p, useStreamLayer as l, useStreamLayerUI as f } from "@streamlayer/react";
5
- import { useStreamLayerDebug as y } from "../../utils/debug/index.js";
6
- import { StreamLayerSDKTv as S } from "./index.js";
7
- const h = ({ src: r }) => {
8
- const e = m(), s = m(), [t, o] = d(r);
4
+ import { StreamLayerProvider as y, useStreamLayer as l, useStreamLayerUI as S } from "@streamlayer/react";
5
+ import { anonymous as h } from "@streamlayer/sdk-web-anonymous-auth";
6
+ import { useStreamLayerDebug as b } from "../../utils/debug/index.js";
7
+ import { StreamLayerSDKTv as g } from "./index.js";
8
+ const w = ({ src: t }) => {
9
+ const e = m(), n = m(), [r, o] = d(t);
9
10
  return u(() => {
10
- o(r);
11
- }, [r]), u(() => () => {
12
- s.current && clearTimeout(s.current);
11
+ o(t);
12
+ }, [t]), u(() => () => {
13
+ n.current && clearTimeout(n.current);
13
14
  }, []), u(() => {
14
- if (t && t.includes("m3u8"))
15
- if (i.isSupported() && e.current) {
16
- const a = new i({
15
+ if (r && r.includes("m3u8"))
16
+ if (c.isSupported() && e.current) {
17
+ const s = new c({
17
18
  debug: !1
18
19
  });
19
- a.loadSource(t), a.attachMedia(e.current);
20
+ s.loadSource(r), s.attachMedia(e.current);
20
21
  } else
21
22
  o("");
22
- e.current && (e.current.volume = 0.1, e.current.play().catch((a) => {
23
- var c;
24
- console.error(a), (c = e.current) == null || c.play();
23
+ e.current && (e.current.volume = 0.1, e.current.play().catch((s) => {
24
+ var i;
25
+ console.error(s), (i = e.current) == null || i.play();
25
26
  }));
26
- }, [t]), /* @__PURE__ */ n(
27
+ }, [r]), /* @__PURE__ */ a(
27
28
  "video",
28
29
  {
29
- src: t || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
30
+ src: r || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
30
31
  ref: e,
31
32
  style: { width: "100%", height: "100%", borderRadius: 10, objectFit: "contain" },
32
33
  autoPlay: !0,
@@ -37,38 +38,44 @@ const h = ({ src: r }) => {
37
38
  controls: !0
38
39
  }
39
40
  );
40
- }, b = () => {
41
- const r = l(), [e, s] = d("");
42
- return u(() => r ? r.streamSummary().subscribe((t) => {
43
- var o, a;
44
- (a = (o = t.data) == null ? void 0 : o.summary) != null && a.stream && s(t.data.summary.stream);
41
+ }, v = () => {
42
+ const t = l(), [e, n] = d("");
43
+ return u(() => t ? t.streamSummary().subscribe((r) => {
44
+ var o, s;
45
+ (s = (o = r.data) == null ? void 0 : o.summary) != null && s.stream && n(r.data.summary.stream);
45
46
  }) : () => {
46
- }, [r]), /* @__PURE__ */ n(
47
- h,
47
+ }, [t]), /* @__PURE__ */ a(
48
+ w,
48
49
  {
49
50
  src: e || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4"
50
51
  }
51
52
  );
52
- }, g = ({ persistent: r }) => {
53
- const e = l(), s = f();
54
- return e ? /* @__PURE__ */ n(S, { sdk: e, persistent: r, uiState: s, children: /* @__PURE__ */ n(b, {}) }) : null;
55
- }, T = ({ sdkKey: r, eventId: e, persistent: s, production: t }) => {
56
- const o = y({ sdkKey: r, eventId: e, production: t });
57
- return /* @__PURE__ */ n(
58
- p,
53
+ }, L = ({ sdk: t }) => (u(() => {
54
+ t.anonymousAuthorization();
55
+ }, [t]), null), k = ({ persistent: t }) => {
56
+ const e = l(), n = S();
57
+ return e ? /* @__PURE__ */ p(f, { children: [
58
+ /* @__PURE__ */ a(L, { sdk: e }),
59
+ /* @__PURE__ */ a(g, { sdk: e, persistent: t, uiState: n, children: /* @__PURE__ */ a(v, {}) })
60
+ ] }) : null;
61
+ }, R = /* @__PURE__ */ new Set([h]), P = ({ sdkKey: t, eventId: e, persistent: n, production: r }) => {
62
+ const o = b({ sdkKey: t, eventId: e, production: r });
63
+ return /* @__PURE__ */ a(
64
+ y,
59
65
  {
60
66
  event: o.event,
61
67
  sdkKey: o.sdkKey,
62
68
  production: o.env === "production",
69
+ plugins: R,
63
70
  autoEnable: !0,
64
71
  withAd: !0,
65
72
  withAdNotification: !0,
66
73
  webOS: !0,
67
- children: /* @__PURE__ */ n(g, { persistent: s })
74
+ children: /* @__PURE__ */ a(k, { persistent: n })
68
75
  }
69
76
  );
70
77
  };
71
78
  export {
72
- h as Player,
73
- T as WebOSStory
79
+ w as Player,
80
+ P as WebOSStory
74
81
  };
@@ -16,6 +16,5 @@ export type OverlayProps = {
16
16
  fireEvent: Advertisement['fireEvent'];
17
17
  muted?: boolean;
18
18
  toggleMute: (flag: boolean) => void;
19
- isMuted?: boolean;
20
19
  };
21
20
  export declare const TVSidebar: React.FC<OverlayProps>;
@@ -1,57 +1,56 @@
1
- import { jsx as d, jsxs as l, Fragment as X } from "react/jsx-runtime";
2
- import { updateAllLayouts as Y } from "@noriginmedia/norigin-spatial-navigation";
3
- import { withFocusable as Z } from "../../useTvButton.js";
4
- import { useRef as k, useState as E, useEffect as h } from "react";
1
+ import { jsx as d, jsxs as l, Fragment as F } from "react/jsx-runtime";
2
+ import { updateAllLayouts as ee } from "@noriginmedia/norigin-spatial-navigation";
3
+ import { withFocusable as oe } from "../../useTvButton.js";
4
+ import { useRef as T, useState as I, useEffect as h } from "react";
5
5
  import { eventBus as p } from "@streamlayer/sdk-web-interfaces";
6
- import { PromotionType as r, AutoPlayVideo as F, PlayVideoMuted as ee } from "@streamlayer/sdk-web-types";
7
- import { SvgIcon as T } from "../../../../ui/icons/index.js";
8
- import { PromoAction as oe } from "./PromoAction.js";
9
- import { Container as te, Header as de, BrandBlock as ae, LogoIcon as ne, BrandText as ie, BrandNameContainer as re, BrandName as le, Sponsored as pe, CloseIcon as ce, VideoBlock as se, VideoWrapper as ye, FocusableVideo as me, VideoStatus as W, Title as ue, Description as he, CloseButton as Ae } from "./styles.js";
10
- const Be = Z(Ae, {
6
+ import { PromotionType as r, AutoPlayVideo as te, PlayVideoMuted as de } from "@streamlayer/sdk-web-types";
7
+ import { SvgIcon as W } from "../../../../ui/icons/index.js";
8
+ import { PromoAction as ae } from "./PromoAction.js";
9
+ import { Container as ne, Header as ie, BrandBlock as re, LogoIcon as le, BrandText as pe, BrandNameContainer as se, BrandName as ce, Sponsored as ye, CloseIcon as me, VideoBlock as ue, VideoWrapper as he, FocusableVideo as Ae, VideoStatus as O, Title as Be, Description as Ie, CloseButton as be } from "./styles.js";
10
+ const Me = oe(be, {
11
11
  isFocusBoundary: !0
12
- }), Se = (O) => {
13
- var _, V, N, w, S, g, L, P, C, G, D, v, x, U;
12
+ }), Le = (j) => {
13
+ var N, _, w, P, S, g, L, C, G, D, v, x, U, k;
14
14
  const {
15
15
  promotion: e,
16
- open: y,
16
+ open: c,
17
17
  togglePause: a,
18
- controlVideo: c,
19
- promotionId: n,
18
+ controlVideo: s,
19
+ promotionId: i,
20
20
  onClose: b,
21
21
  markAsViewed: A,
22
- advertisementPaused: j,
22
+ advertisementPaused: H,
23
23
  isEventFired: o,
24
24
  fireEvent: t,
25
- muted: $,
26
- isMuted: I
27
- } = O, H = k(null), B = k(null), [M, q] = E(0), z = e.type === r.INGAME_IAB11_LBAR ? M : M / 2, R = !!((V = (_ = e.banner) == null ? void 0 : _.video) != null && V.url), s = e.autoPlayVideo === F.ENABLED, f = e.playVideoMuted === ee.ENABLED, K = f && s, Q = e.type === r.INGAME_IAB11_LBAR || e.type === r.INGAME_IAB11 || e.type === r.INGAME_IAB11_SIDEBAR;
28
- let m = (N = e.banner) == null ? void 0 : N.url;
25
+ muted: $
26
+ } = j, q = T(null), B = T(null), [M, z] = I(0), K = e.type === r.INGAME_IAB11_LBAR ? M : M / 2, R = !!((_ = (N = e.banner) == null ? void 0 : N.video) != null && _.url), y = e.autoPlayVideo === te.ENABLED, V = e.playVideoMuted === de.ENABLED, Q = V && y, J = e.type === r.INGAME_IAB11_LBAR || e.type === r.INGAME_IAB11 || e.type === r.INGAME_IAB11_SIDEBAR, [f, X] = I(!0), [Y, Z] = I(void 0);
27
+ let m = (w = e.banner) == null ? void 0 : w.url;
29
28
  return m && !m.startsWith("http") && (m = `https://${m}`), h(() => {
30
29
  if (!B.current) return;
31
- const i = new ResizeObserver(([u]) => {
32
- const J = u.contentRect.width;
33
- q(J);
30
+ const n = new ResizeObserver(([u]) => {
31
+ const E = u.contentRect.width;
32
+ z(E);
34
33
  });
35
- return i.observe(B.current), Y(), () => {
36
- i.disconnect();
34
+ return n.observe(B.current), ee(), () => {
35
+ n.disconnect();
37
36
  };
38
37
  }, []), h(() => {
39
- a == null || a(R || s), y == null || y();
40
- }, [R, s, y, a]), h(() => {
41
- n && e.type && A && A();
42
- }, [n, e.type, A]), h(() => () => {
43
- c == null || c({ muted: !1 });
44
- }, [c]), /* @__PURE__ */ d("div", { children: /* @__PURE__ */ l(te, { ref: B, children: [
45
- /* @__PURE__ */ l(de, { children: [
46
- e.logoMode === 1 && /* @__PURE__ */ l(ae, { children: [
47
- /* @__PURE__ */ d(ne, { src: (w = e.sponsor) == null ? void 0 : w.logo, alt: "Logo" }),
48
- /* @__PURE__ */ l(ie, { children: [
49
- /* @__PURE__ */ d(re, { children: /* @__PURE__ */ d(le, { children: (S = e.sponsor) == null ? void 0 : S.name }) }),
50
- /* @__PURE__ */ d(pe, { children: "SPONSORED" })
38
+ a == null || a(R || y), c == null || c();
39
+ }, [R, y, c, a]), h(() => {
40
+ i && e.type && A && A();
41
+ }, [i, e.type, A]), h(() => () => {
42
+ s == null || s({ muted: !1 });
43
+ }, [s]), /* @__PURE__ */ d("div", { children: /* @__PURE__ */ l(ne, { ref: B, children: [
44
+ /* @__PURE__ */ l(ie, { children: [
45
+ e.logoMode === 1 && /* @__PURE__ */ l(re, { children: [
46
+ /* @__PURE__ */ d(le, { src: (P = e.sponsor) == null ? void 0 : P.logo, alt: "Logo" }),
47
+ /* @__PURE__ */ l(pe, { children: [
48
+ /* @__PURE__ */ d(se, { children: /* @__PURE__ */ d(ce, { children: (S = e.sponsor) == null ? void 0 : S.name }) }),
49
+ /* @__PURE__ */ d(ye, { children: "SPONSORED" })
51
50
  ] })
52
51
  ] }),
53
52
  e.logoMode === 2 && e.type === r.INGAME_IAB11_LBAR && /* @__PURE__ */ d("img", { src: (g = e.sponsor) == null ? void 0 : g.logo, alt: "Video paused preview", style: { height: "56px" } }),
54
- /* @__PURE__ */ d(Be, { options: { focusKey: "close-ad-button" }, webos: !0, onClick: b, "data-close-btn": "true", children: /* @__PURE__ */ d(ce, {}) })
53
+ /* @__PURE__ */ d(Me, { options: { focusKey: "close-ad-button" }, webos: !0, onClick: b, "data-close-btn": "true", children: /* @__PURE__ */ d(me, {}) })
55
54
  ] }),
56
55
  e.logoMode === 2 && e.type !== r.INGAME_IAB11_LBAR && /* @__PURE__ */ d(
57
56
  "img",
@@ -66,60 +65,60 @@ const Be = Z(Ae, {
66
65
  }
67
66
  }
68
67
  ),
69
- ((P = e.banner) == null ? void 0 : P.imageUrl) && /* @__PURE__ */ d(se, { style: { height: z }, children: /* @__PURE__ */ d(
68
+ ((C = e.banner) == null ? void 0 : C.imageUrl) && /* @__PURE__ */ d(ue, { style: { height: K }, children: /* @__PURE__ */ d(
70
69
  "img",
71
70
  {
72
- src: (C = e.banner) == null ? void 0 : C.imageUrl,
71
+ src: (G = e.banner) == null ? void 0 : G.imageUrl,
73
72
  alt: "Video paused preview",
74
73
  style: { width: "100%", height: "100%", objectFit: "cover" }
75
74
  }
76
75
  ) }),
77
- ((G = e.banner) == null ? void 0 : G.video) && /* @__PURE__ */ l(ye, { children: [
76
+ ((D = e.banner) == null ? void 0 : D.video) && /* @__PURE__ */ l(he, { children: [
78
77
  /* @__PURE__ */ d(
79
- me,
78
+ Ae,
80
79
  {
81
80
  source: e.banner.video.url,
82
- poster: (v = (D = e.banner) == null ? void 0 : D.video) == null ? void 0 : v.thumbnailUrl,
81
+ poster: (x = (v = e.banner) == null ? void 0 : v.video) == null ? void 0 : x.thumbnailUrl,
83
82
  webos: !0,
84
- aspectRatio: Q ? "1/1" : "2/1",
85
- ref: H,
83
+ aspectRatio: J ? "1/1" : "2/1",
84
+ ref: q,
86
85
  onRender: () => {
87
86
  o != null && o("video-rendered") || (p.emit("advertisement", {
88
87
  action: "videoRendered",
89
88
  payload: {
90
- id: n,
89
+ id: i,
91
90
  type: e.type
92
91
  }
93
92
  }), t == null || t("video-rendered"));
94
93
  },
95
- onQuartile: (i) => {
96
- o != null && o(`video-quartile-${i}`) || (p.emit("advertisement", {
94
+ onQuartile: (n) => {
95
+ o != null && o(`video-quartile-${n}`) || (p.emit("advertisement", {
97
96
  action: "quartileCompleted",
98
97
  payload: {
99
- id: n,
98
+ id: i,
100
99
  type: e.type,
101
- quartile: i
100
+ quartile: n
102
101
  }
103
- }), t == null || t(`video-quartile-${i}`));
102
+ }), t == null || t(`video-quartile-${n}`));
104
103
  },
105
- onMute: (i) => {
106
- const u = i ? "muted" : "unmuted";
104
+ onMute: (n) => {
105
+ const u = n ? "muted" : "unmuted";
107
106
  o != null && o(u) || (p.emit("advertisement", {
108
- action: i ? "videoMuted" : "videoUnmuted",
107
+ action: n ? "videoMuted" : "videoUnmuted",
109
108
  payload: {
110
- id: n,
109
+ id: i,
111
110
  type: e.type
112
111
  }
113
- }), t == null || t(u));
112
+ }), t == null || t(u)), Z(n);
114
113
  },
115
114
  onPause: () => {
116
- s && (a == null || a(!0));
115
+ a == null || a(!0), X(!1);
117
116
  },
118
117
  onReplay: () => {
119
118
  o != null && o("replayed") || (p.emit("advertisement", {
120
119
  action: "videoReplayed",
121
120
  payload: {
122
- id: n,
121
+ id: i,
123
122
  type: e.type
124
123
  }
125
124
  }), t == null || t("replayed"));
@@ -128,13 +127,13 @@ const Be = Z(Ae, {
128
127
  o != null && o("played") || (p.emit("advertisement", {
129
128
  action: "videoPlay",
130
129
  payload: {
131
- id: n,
130
+ id: i,
132
131
  type: e.type
133
132
  }
134
133
  }), t == null || t("played")), a == null || a(!1), o != null && o("played") && (o != null && o("ended")) && !(o != null && o("replayed")) && (p.emit("advertisement", {
135
134
  action: "videoReplayed",
136
135
  payload: {
137
- id: n,
136
+ id: i,
138
137
  type: e.type
139
138
  }
140
139
  }), t == null || t("replayed"));
@@ -143,34 +142,34 @@ const Be = Z(Ae, {
143
142
  o != null && o("ended") || (p.emit("advertisement", {
144
143
  action: "videoEnd",
145
144
  payload: {
146
- id: n,
145
+ id: i,
147
146
  type: e.type
148
147
  }
149
148
  }), t == null || t("ended"));
150
149
  },
151
150
  muted: $,
152
- autoPlay: s,
153
- playMuted: f,
154
- controlVideo: c
151
+ autoPlay: y,
152
+ playMuted: V,
153
+ controlVideo: s,
154
+ hasNotPausedVideo: f
155
155
  }
156
156
  ),
157
- j && /* @__PURE__ */ l(W, { children: [
158
- /* @__PURE__ */ d(T, { name: "icon-pause" }),
157
+ H && !f && /* @__PURE__ */ l(O, { children: [
158
+ /* @__PURE__ */ d(W, { name: "icon-pause" }),
159
159
  "PAUSED"
160
160
  ] }),
161
- (I || K && I === void 0) && /* @__PURE__ */ l(W, { children: [
162
- /* @__PURE__ */ d(T, { name: "iconMute" }),
161
+ Y && Q && /* @__PURE__ */ l(O, { children: [
162
+ /* @__PURE__ */ d(W, { name: "iconMute" }),
163
163
  "MUTED"
164
- ] }),
165
- " "
164
+ ] })
166
165
  ] }),
167
- e.type !== r.INGAME_IAB11 && e.type !== r.INGAME_IAB11_LBAR && e.type !== r.INGAME_IAB11_SIDEBAR && /* @__PURE__ */ l(X, { children: [
168
- /* @__PURE__ */ d(ue, { children: (x = e.banner) == null ? void 0 : x.title }),
169
- /* @__PURE__ */ d(he, { children: (U = e.banner) == null ? void 0 : U.body })
166
+ e.type !== r.INGAME_IAB11 && e.type !== r.INGAME_IAB11_LBAR && e.type !== r.INGAME_IAB11_SIDEBAR && /* @__PURE__ */ l(F, { children: [
167
+ /* @__PURE__ */ d(Be, { children: (U = e.banner) == null ? void 0 : U.title }),
168
+ /* @__PURE__ */ d(Ie, { children: (k = e.banner) == null ? void 0 : k.body })
170
169
  ] }),
171
- /* @__PURE__ */ d(oe, { promotion: e, onClose: b })
170
+ /* @__PURE__ */ d(ae, { promotion: e, onClose: b })
172
171
  ] }) });
173
172
  };
174
173
  export {
175
- Se as TVSidebar
174
+ Le as TVSidebar
176
175
  };
@@ -1,100 +1,66 @@
1
- import { jsxs as a, jsx as c } from "react/jsx-runtime";
2
- import { useKeyboardNavigation as Q } from "../../../../hooks/useKeyboardNavigation.js";
3
- import { useRef as T, useState as b, useCallback as A, useEffect as W } from "react";
4
- import { PlayVideoMuted as z, AutoPlayVideo as v, QuestionImages as G } from "@streamlayer/sdk-web-types";
5
- import { SvgIcon as D } from "../../../../ui/icons/index.js";
6
- import { Container as H, VideoWrapper as J, FocusableVideo as X, contentContainerClassName as S, VideoStatus as U, ImageContainer as Y, Image as Z, Content as _, Title as $, Description as n } from "./styles.js";
7
- const ue = ({
8
- instantView: e,
9
- isDetail: d,
10
- notification: l,
11
- controlVideo: k,
12
- muted: x
1
+ import { jsxs as l, jsx as d } from "react/jsx-runtime";
2
+ import { useRef as j, useState as c } from "react";
3
+ import { PlayVideoMuted as F, AutoPlayVideo as P, QuestionImages as H } from "@streamlayer/sdk-web-types";
4
+ import { SvgIcon as v } from "../../../../ui/icons/index.js";
5
+ import { Container as O, VideoWrapper as Q, FocusableVideo as W, contentContainerClassName as C, VideoStatus as A, ImageContainer as k, Image as q, Content as s, Title as z, Description as G } from "./styles.js";
6
+ const _ = ({
7
+ instantView: o,
8
+ isDetail: u,
9
+ notification: r,
10
+ controlVideo: B,
11
+ muted: D
13
12
  }) => {
14
- var I, P;
15
- const p = T(null), [L, o] = b(!1), [f, M] = b(void 0), [R, N] = b(!1), m = (e == null ? void 0 : e.playVideoMuted) === z.ENABLED, s = d && (e == null ? void 0 : e.autoPlayVideo) === v.ENABLED, F = m && s, E = T(), g = e == null ? void 0 : e.heading, B = e == null ? void 0 : e.body, C = g || B, O = l == null ? void 0 : l.title, j = l == null ? void 0 : l.body, y = A(() => {
16
- const r = [];
17
- p.current && r.push(p.current);
18
- const t = document.querySelector(".webos"), h = t == null ? void 0 : t.querySelector('[data-close-btn="true"]');
19
- return h && r.push(h), r;
20
- }, []), q = A(
21
- (r) => {
22
- const t = document.activeElement;
23
- if (y().includes(t))
24
- switch (r.tagName) {
25
- case "BUTTON":
26
- r.click();
27
- break;
28
- case "VIDEO":
29
- E.current = setTimeout(() => {
30
- const u = r;
31
- m && s ? u.muted ? (M(!1), u.muted = !1) : (M(!0), u.muted = !0) : u.paused || u.ended ? (o(!1), N(!0), u.play().then(() => {
32
- }).catch((K) => console.warn("⛔ start failed:", K))) : (o(!0), u.pause(), N(!0));
33
- }, 0);
34
- break;
35
- }
36
- },
37
- [s, m, y]
38
- );
39
- return W(() => () => {
40
- E.current && clearTimeout(E.current);
41
- }, []), Q({
42
- containerSelector: ".webos",
43
- getElements: y,
44
- onEscape: () => {
45
- },
46
- onEnter: q,
47
- initialFocusPriority: s ? 0 : 1,
48
- enabled: !0,
49
- dependencies: [s, m]
50
- }), /* @__PURE__ */ a(H, { children: [
51
- ((I = e == null ? void 0 : e.video) == null ? void 0 : I.url) && /* @__PURE__ */ a(J, { children: [
52
- /* @__PURE__ */ c(
53
- X,
13
+ var E, N;
14
+ const I = j(null), [b, e] = c(!1), [f, g] = c(void 0), m = (o == null ? void 0 : o.playVideoMuted) === F.ENABLED, T = u && (o == null ? void 0 : o.autoPlayVideo) === P.ENABLED, S = m && T, p = o == null ? void 0 : o.heading, y = o == null ? void 0 : o.body, h = p || y, [M, U] = c(!0), x = r == null ? void 0 : r.title, L = r == null ? void 0 : r.body;
15
+ return /* @__PURE__ */ l(O, { children: [
16
+ ((E = o == null ? void 0 : o.video) == null ? void 0 : E.url) && /* @__PURE__ */ l(Q, { children: [
17
+ /* @__PURE__ */ d(
18
+ W,
54
19
  {
55
- className: S,
56
- source: e.video.url,
57
- poster: e.video.thumbnailUrl,
58
- controlVideo: k,
59
- muted: x,
60
- autoPlay: d && e.autoPlayVideo === v.ENABLED,
61
- tabIndex: 0,
62
- ref: p,
20
+ className: C,
21
+ source: o.video.url,
22
+ poster: o.video.thumbnailUrl,
23
+ controlVideo: B,
24
+ muted: D,
25
+ autoPlay: u && o.autoPlayVideo === P.ENABLED,
26
+ ref: I,
63
27
  onPause: () => {
64
- d && e.autoPlayVideo === v.ENABLED && (o == null || o(!0));
28
+ e == null || e(!0), U(!1);
29
+ },
30
+ onMute: (R) => {
31
+ g(R);
65
32
  },
66
33
  onPlay: () => {
67
- o == null || o(!1);
34
+ e == null || e(!1);
68
35
  },
69
36
  playMuted: m,
70
- noControlsButtons: !0,
71
- isMutedMediaVideo: f,
37
+ hasNotPausedVideo: M,
72
38
  webos: !0
73
39
  }
74
40
  ),
75
- L && R && /* @__PURE__ */ a(U, { children: [
76
- /* @__PURE__ */ c(D, { name: "icon-pause" }),
41
+ b && !M && /* @__PURE__ */ l(A, { children: [
42
+ /* @__PURE__ */ d(v, { name: "icon-pause" }),
77
43
  "PAUSED"
78
44
  ] }),
79
- (f || F && f === void 0) && /* @__PURE__ */ a(U, { children: [
80
- /* @__PURE__ */ c(D, { name: "iconMute" }),
45
+ f && S && /* @__PURE__ */ l(A, { children: [
46
+ /* @__PURE__ */ d(v, { name: "iconMute" }),
81
47
  "MUTED"
82
48
  ] })
83
49
  ] }),
84
- (e == null ? void 0 : e.image) && !((P = e == null ? void 0 : e.video) != null && P.url) && /* @__PURE__ */ c(
85
- Y,
50
+ (o == null ? void 0 : o.image) && !((N = o == null ? void 0 : o.video) != null && N.url) && /* @__PURE__ */ d(
51
+ k,
86
52
  {
87
- className: S,
88
- "data-rounded": e.imageMode === G.ROUNDED,
89
- children: /* @__PURE__ */ c(Z, { src: e == null ? void 0 : e.image })
53
+ className: C,
54
+ "data-rounded": o.imageMode === H.ROUNDED,
55
+ children: /* @__PURE__ */ d(q, { src: o == null ? void 0 : o.image })
90
56
  }
91
57
  ),
92
- /* @__PURE__ */ a(_, { children: [
93
- /* @__PURE__ */ c($, { children: d && C ? g : O }),
94
- /* @__PURE__ */ c(n, { children: d && C ? B : j })
58
+ /* @__PURE__ */ l(s, { children: [
59
+ /* @__PURE__ */ d(z, { children: u && h ? p : x }),
60
+ /* @__PURE__ */ d(G, { children: u && h ? y : L })
95
61
  ] })
96
62
  ] });
97
63
  };
98
64
  export {
99
- ue as InsightContentTV
65
+ _ as InsightContentTV
100
66
  };