@streamlayer/react 1.4.1 → 1.5.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.
@@ -1,44 +1,39 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { useEffect as Q, useRef as J, useMemo as V } from "react";
3
- import { c as f, s as n, a as K, Q as X, e as $, u as N, L as Y } from "./provider.js";
4
- import { F as Z, u as oo, d as eo } from "./index2.js";
5
- import { N as g, a as no, b as so, C as io, P as I, c as h, S as ao } from "./useStreamLayerApp2.js";
6
- const to = /* @__PURE__ */ n("div")({
1
+ import { jsx as n, jsxs as p } from "react/jsx-runtime";
2
+ import { useRef as Q } from "react";
3
+ import { f, s as e, c as K, Q as V, g as N, a as H, L as J, u as X, d as Y, S as Z } from "./index2.js";
4
+ import { N as g, a as oo, b as no, C as eo, P as v, c as h, d as so, S as ao } from "./useStreamLayerApp2.js";
5
+ const to = /* @__PURE__ */ e("div")({
7
6
  name: "Container",
8
7
  class: "c5b6wdg",
9
8
  propsAsIs: !1
10
- }), ro = "a1rlj479", lo = "s35f1di", co = "sj4471g", mo = "b12050d8", po = "b1d5ybek", uo = (o) => o === "left" || o === "right" ? lo : mo, vo = (o) => o === "left" || o === "right" ? co : po, Io = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", C = ({
9
+ }), io = "a1rlj479", ro = "s35f1di", lo = "sj4471g", co = "b12050d8", po = "b1d5ybek", mo = (o) => o === "left" || o === "right" ? ro : co, uo = (o) => o === "left" || o === "right" ? lo : po, vo = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", $ = ({
11
10
  children: o,
12
11
  style: s,
13
- className: r,
12
+ className: t,
14
13
  enabled: i = !0,
15
14
  hiding: a,
16
- direction: l = "left",
17
- onAnimationEnd: t
18
- }) => /* @__PURE__ */ e(to, {
15
+ direction: r = "left",
16
+ onAnimationEnd: l
17
+ }) => /* @__PURE__ */ n(to, {
19
18
  style: s,
20
- className: f(r, ro, Io(l), i && !a && uo(l), i && a && vo(l)),
21
- onAnimationEnd: t,
19
+ className: f(t, io, vo(r), i && !a && mo(r), i && a && uo(r)),
20
+ onAnimationEnd: l,
22
21
  children: o
23
- }), go = /* @__PURE__ */ n("a")({
22
+ }), Io = /* @__PURE__ */ e("a")({
24
23
  name: "Link",
25
24
  class: "l1sgte8c",
26
25
  propsAsIs: !1
27
- }), ho = /* @__PURE__ */ n("div")({
26
+ }), go = /* @__PURE__ */ e("div")({
28
27
  name: "BannerContainer",
29
28
  class: "b7yfc72",
30
29
  propsAsIs: !1
31
- }), Ao = () => go, bo = /* @__PURE__ */ n(Ao())({
30
+ }), ho = () => Io, bo = /* @__PURE__ */ e(ho())({
32
31
  name: "BannerLink",
33
32
  class: "bejjq94",
34
33
  propsAsIs: !0
35
- }), yo = /* @__PURE__ */ n("img")({
36
- name: "BannerImg",
37
- class: "b1j94hdr",
38
- propsAsIs: !1
39
- }), fo = ({ promotion: o, promotionId: s, hiding: r, direction: i = "bottom" }) => {
34
+ }), Ao = ({ promotion: o, promotionId: s, hiding: t, direction: i = "bottom" }) => {
40
35
  var a;
41
- return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ e(C, { direction: i, hiding: r, children: /* @__PURE__ */ e(ho, { className: "BannerContainer", children: /* @__PURE__ */ e(
36
+ return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ n($, { direction: i, hiding: t, children: /* @__PURE__ */ n(go, { className: "BannerContainer", children: /* @__PURE__ */ n(
42
37
  bo,
43
38
  {
44
39
  className: "BannerLink",
@@ -47,210 +42,209 @@ const to = /* @__PURE__ */ n("div")({
47
42
  "data-promo-id": s,
48
43
  "data-promo-type": o.type,
49
44
  "data-analytics": "banner",
50
- target: "_blank",
51
- children: /* @__PURE__ */ e(yo, { src: o.additionalBanner.imageUrl, alt: "promo" })
45
+ target: "_blank"
52
46
  }
53
47
  ) }) }) : null;
54
- }, $o = /* @__PURE__ */ n("div")({
48
+ }, yo = /* @__PURE__ */ e("div")({
55
49
  name: "NotificationContent",
56
50
  class: "n1ku6hz",
57
51
  propsAsIs: !1
58
- }), No = /* @__PURE__ */ n("div")({
52
+ }), fo = /* @__PURE__ */ e("div")({
59
53
  name: "NotificationContainer",
60
54
  class: "nbxqmol",
61
55
  propsAsIs: !1
62
- }), Co = /* @__PURE__ */ n("div")({
56
+ }), No = /* @__PURE__ */ e("div")({
63
57
  name: "Body",
64
58
  class: "b1gu3eml",
65
59
  propsAsIs: !1
66
- }), Mo = /* @__PURE__ */ n("div")({
60
+ }), $o = /* @__PURE__ */ e("div")({
67
61
  name: "Title",
68
62
  class: "t1u17zva",
69
63
  propsAsIs: !1
70
- }), So = /* @__PURE__ */ n("div")({
64
+ }), Co = /* @__PURE__ */ e("div")({
71
65
  name: "Text",
72
66
  class: "t10ko1g",
73
67
  propsAsIs: !1
74
- }), A = /* @__PURE__ */ n("div")({
68
+ }), b = /* @__PURE__ */ e("div")({
75
69
  name: "Media",
76
70
  class: "mntc42e",
77
71
  propsAsIs: !1
78
- }), To = () => A, w = /* @__PURE__ */ n(To())({
72
+ }), So = () => b, w = /* @__PURE__ */ e(So())({
79
73
  name: "MediaImgFit",
80
74
  class: "ml060eo",
81
75
  propsAsIs: !0
82
- }), ko = () => A, W = /* @__PURE__ */ n(ko())({
76
+ }), To = () => b, W = /* @__PURE__ */ e(To())({
83
77
  name: "MediaImgCentered",
84
78
  class: "m1vqlvig",
85
79
  propsAsIs: !0
86
- }), Bo = () => W, Eo = /* @__PURE__ */ n(Bo())({
80
+ }), Mo = () => W, ko = /* @__PURE__ */ e(Mo())({
87
81
  name: "MediaImgBottom",
88
82
  class: "m1e7tvi5",
89
83
  propsAsIs: !0
90
- }), Lo = () => A, Oo = /* @__PURE__ */ n(Lo())({
84
+ }), Bo = () => b, Lo = /* @__PURE__ */ e(Bo())({
91
85
  name: "MediaImgSolid",
92
86
  class: "mqvntt2",
93
87
  propsAsIs: !0
94
- }), xo = () => A, _o = /* @__PURE__ */ n(xo())({
88
+ }), Eo = () => b, Oo = /* @__PURE__ */ e(Eo())({
95
89
  name: "MediaImgMiddle",
96
90
  class: "m12jtj3u",
97
91
  propsAsIs: !0
98
- }), Po = /* @__PURE__ */ n("img")({
92
+ }), xo = /* @__PURE__ */ e("img")({
99
93
  name: "CtaIcon",
100
94
  class: "ckq1frv",
101
95
  propsAsIs: !1
102
- }), jo = /* @__PURE__ */ n("button")({
96
+ }), _o = /* @__PURE__ */ e("button")({
103
97
  name: "Button",
104
98
  class: "bis90pl",
105
99
  propsAsIs: !1
106
- }), Ro = () => K, Do = /* @__PURE__ */ n(Ro())({
100
+ }), Po = () => K, jo = /* @__PURE__ */ e(Po())({
107
101
  name: "StyledChevronRight",
108
102
  class: "s9mjmz3",
109
103
  propsAsIs: !0
110
- }), qo = /* @__PURE__ */ n("div")({
104
+ }), qo = /* @__PURE__ */ e("div")({
111
105
  name: "Logo",
112
106
  class: "l1cf50a7",
113
107
  propsAsIs: !1
114
- }), Fo = {
108
+ }), Do = {
115
109
  [g.UNSET]: w,
116
110
  [g.FIT]: w,
117
111
  [g.CENTERED]: W,
118
- [g.BOTTOM]: Eo,
119
- [g.SOLID]: Oo,
120
- [g.MIDDLE]: _o
121
- }, Uo = ({ src: o, imagePosition: s }) => {
122
- const r = Fo[s];
123
- return /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("img", { src: o, alt: "" }) });
124
- }, wo = ({ notification: o, promotionId: s, hiding: r, direction: i = "left" }) => {
125
- if (!o || !o.promotion || o.enabled !== no.NOTIFICATION_ENABLED)
112
+ [g.BOTTOM]: ko,
113
+ [g.SOLID]: Lo,
114
+ [g.MIDDLE]: Oo
115
+ }, Ro = ({ src: o, imagePosition: s }) => {
116
+ const t = Do[s];
117
+ return /* @__PURE__ */ n(t, { children: /* @__PURE__ */ n("img", { src: o, alt: "" }) });
118
+ }, Uo = ({ notification: o, promotionId: s, hiding: t, direction: i = "left" }) => {
119
+ if (!o || !o.promotion || o.enabled !== oo.NOTIFICATION_ENABLED)
126
120
  return null;
127
- const { title: a, body: l, image: t, promotion: p } = o, { sponsorLogo: u, sponsorLogoMode: v, imagePosition: m, ctaButton: d } = p;
128
- return /* @__PURE__ */ e(C, { direction: i, hiding: r, children: /* @__PURE__ */ c(No, { children: [
129
- v !== so.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(qo, { children: /* @__PURE__ */ e("img", { src: u, alt: a }) }),
130
- /* @__PURE__ */ c($o, { children: [
131
- /* @__PURE__ */ e(Uo, { src: t, imagePosition: m }),
132
- /* @__PURE__ */ c(Co, { children: [
133
- a && /* @__PURE__ */ e(Mo, { children: a }),
134
- l && /* @__PURE__ */ e(So, { children: l })
121
+ const { title: a, body: r, image: l, promotion: m } = o, { sponsorLogo: u, sponsorLogoMode: c, imagePosition: I, ctaButton: d } = m;
122
+ return /* @__PURE__ */ n($, { direction: i, hiding: t, children: /* @__PURE__ */ p(fo, { children: [
123
+ c !== no.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ n(qo, { children: /* @__PURE__ */ n("img", { src: u, alt: a }) }),
124
+ /* @__PURE__ */ p(yo, { children: [
125
+ /* @__PURE__ */ n(Ro, { src: l, imagePosition: I }),
126
+ /* @__PURE__ */ p(No, { children: [
127
+ a && /* @__PURE__ */ n($o, { children: a }),
128
+ r && /* @__PURE__ */ n(Co, { children: r })
135
129
  ] }),
136
- /* @__PURE__ */ c(jo, { name: "promo-button", style: { color: d == null ? void 0 : d.textColor, backgroundColor: d == null ? void 0 : d.color }, children: [
137
- (d == null ? void 0 : d.ctaIcon) && (d == null ? void 0 : d.ctaIconMode) === io.CTA_ICON_TRANSPARENT && /* @__PURE__ */ e(Po, { src: d == null ? void 0 : d.ctaIcon, alt: "cta-icon" }),
130
+ /* @__PURE__ */ p(_o, { name: "promo-button", style: { color: d == null ? void 0 : d.textColor, backgroundColor: d == null ? void 0 : d.color }, children: [
131
+ (d == null ? void 0 : d.ctaIcon) && (d == null ? void 0 : d.ctaIconMode) === eo.CTA_ICON_TRANSPARENT && /* @__PURE__ */ n(xo, { src: d == null ? void 0 : d.ctaIcon, alt: "cta-icon" }),
138
132
  (d == null ? void 0 : d.label) || "Open"
139
133
  ] }),
140
- /* @__PURE__ */ e(Do, { name: "chevronRight" })
134
+ /* @__PURE__ */ n(jo, { name: "chevronRight" })
141
135
  ] })
142
136
  ] }) });
143
- }, Go = /* @__PURE__ */ n("div")({
137
+ }, wo = /* @__PURE__ */ e("div")({
144
138
  name: "OverlayContainer",
145
139
  class: "okzhq2w",
146
140
  propsAsIs: !1
147
- }), zo = /* @__PURE__ */ n("div")({
141
+ }), Fo = /* @__PURE__ */ e("div")({
148
142
  name: "PromoOverlay",
149
143
  class: "pmgz5i",
150
144
  propsAsIs: !1
151
- }), Ho = /* @__PURE__ */ n("div")({
145
+ }), Go = /* @__PURE__ */ e("div")({
152
146
  name: "Header",
153
147
  class: "hyxi3jt",
154
148
  propsAsIs: !1
155
- }), Ko = /* @__PURE__ */ n("div")({
149
+ }), zo = /* @__PURE__ */ e("div")({
156
150
  name: "HeaderContent",
157
151
  class: "h149e3gp",
158
152
  propsAsIs: !1
159
- }), Wo = "h10toh7", G = /* @__PURE__ */ n("img")({
153
+ }), Ko = "h10toh7", F = /* @__PURE__ */ e("img")({
160
154
  name: "SponsorLogo",
161
155
  class: "s1jyea6t",
162
156
  propsAsIs: !1
163
- }), Qo = /* @__PURE__ */ n("div")({
157
+ }), Ho = /* @__PURE__ */ e("div")({
164
158
  name: "SponsorName",
165
159
  class: "szpfa3h",
166
160
  propsAsIs: !1
167
- }), Jo = /* @__PURE__ */ n("div")({
161
+ }), Wo = /* @__PURE__ */ e("div")({
168
162
  name: "Media",
169
163
  class: "m1crmu01",
170
164
  propsAsIs: !1
171
- }), Vo = /* @__PURE__ */ n("img")({
165
+ }), Qo = /* @__PURE__ */ e("img")({
172
166
  name: "PromoImg",
173
167
  class: "p1l37r8s",
174
168
  propsAsIs: !1
175
- }), Xo = "s1nmch9k", z = /* @__PURE__ */ n("div")({
169
+ }), Vo = "s1nmch9k", G = /* @__PURE__ */ e("div")({
176
170
  name: "Content",
177
171
  class: "c1er0ljd",
178
172
  propsAsIs: !1
179
- }), Yo = /* @__PURE__ */ n("div")({
173
+ }), Jo = /* @__PURE__ */ e("div")({
180
174
  name: "Description",
181
175
  class: "dydopmr",
182
176
  propsAsIs: !1
183
- }), Zo = /* @__PURE__ */ n("div")({
177
+ }), Xo = /* @__PURE__ */ e("div")({
184
178
  name: "Sponsor",
185
179
  class: "s1w6nt04",
186
180
  propsAsIs: !1
187
- }), oe = /* @__PURE__ */ n("div")({
181
+ }), Yo = /* @__PURE__ */ e("div")({
188
182
  name: "SponsorText",
189
183
  class: "s1evcmtq",
190
184
  propsAsIs: !1
191
- }), ee = /* @__PURE__ */ n("div")({
185
+ }), Zo = /* @__PURE__ */ e("div")({
192
186
  name: "ADLogo",
193
187
  class: "awodx0x",
194
188
  propsAsIs: !1
195
- }), ne = /* @__PURE__ */ n("span")({
189
+ }), on = /* @__PURE__ */ e("span")({
196
190
  name: "SponsoredText",
197
191
  class: "s1q3n6oi",
198
192
  propsAsIs: !1
199
- }), se = /* @__PURE__ */ n("div")({
193
+ }), nn = /* @__PURE__ */ e("div")({
200
194
  name: "CloseIconWrap",
201
195
  class: "c8d4xfk",
202
196
  propsAsIs: !1
203
- }), ie = () => K, ae = /* @__PURE__ */ n(ie())({
197
+ }), en = () => K, sn = /* @__PURE__ */ e(en())({
204
198
  name: "CloseIcon",
205
199
  class: "ct6oobh",
206
200
  propsAsIs: !0
207
- }), te = /* @__PURE__ */ n("div")({
201
+ }), an = /* @__PURE__ */ e("div")({
208
202
  name: "ActionBtnWrap",
209
203
  class: "a1gyg7tt",
210
204
  propsAsIs: !1
211
- }), re = /* @__PURE__ */ n("a")({
205
+ }), tn = /* @__PURE__ */ e("a")({
212
206
  name: "ActionButton",
213
207
  class: "a17rwbtk",
214
208
  propsAsIs: !1
215
- }), le = /* @__PURE__ */ n("div")({
209
+ }), rn = /* @__PURE__ */ e("div")({
216
210
  name: "Title",
217
211
  class: "t3vxzaw",
218
212
  propsAsIs: !1
219
- }), de = "h10f3u0j", H = ({ promotion: o, promotionId: s, onClose: r }) => {
220
- var i, a, l, t, p, u, v, m, d, M, S, T, k, B, E, L, O, x, _, P, j, R, D, q, F, U;
221
- const b = o.type === I.INGAME_IAB11_LBAR || o.type === I.INGAME_IAB11, y = ((i = o.sponsor) == null ? void 0 : i.logo) && o.logoMode === h.CENTER;
222
- return /* @__PURE__ */ c(zo, { className: "PromoOverlay", children: [
223
- /* @__PURE__ */ c(Ho, { children: [
224
- /* @__PURE__ */ c(Ko, { className: f(!y && Wo), children: [
225
- ((a = o.sponsor) == null ? void 0 : a.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ e(G, { src: (l = o.sponsor) == null ? void 0 : l.logo, alt: "promo" }),
226
- /* @__PURE__ */ c(
227
- Zo,
213
+ }), ln = "h10f3u0j", z = ({ promotion: o, promotionId: s, onClose: t }) => {
214
+ var i, a, r, l, m, u, c, I, d, C, S, T, M, k, B, L, E, O, x, _, P, j, q, D, R, U;
215
+ const A = o.type === v.INGAME_IAB11_LBAR || o.type === v.INGAME_IAB11, y = ((i = o.sponsor) == null ? void 0 : i.logo) && o.logoMode === h.CENTER;
216
+ return /* @__PURE__ */ p(Fo, { className: "PromoOverlay", children: [
217
+ /* @__PURE__ */ p(Go, { children: [
218
+ /* @__PURE__ */ p(zo, { className: f(!y && Ko), children: [
219
+ ((a = o.sponsor) == null ? void 0 : a.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ n(F, { src: (r = o.sponsor) == null ? void 0 : r.logo, alt: "promo" }),
220
+ /* @__PURE__ */ p(
221
+ Xo,
228
222
  {
229
223
  style: {
230
- paddingLeft: (t = o.sponsor) != null && t.logo && o.logoMode === h.LEFT ? "0px" : "8px"
224
+ paddingLeft: (l = o.sponsor) != null && l.logo && o.logoMode === h.LEFT ? "0px" : "8px"
231
225
  },
232
226
  children: [
233
- ((p = o.sponsor) == null ? void 0 : p.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ e(Qo, { children: (u = o.sponsor) == null ? void 0 : u.name }),
234
- /* @__PURE__ */ c(oe, { className: "SponsorText", children: [
235
- /* @__PURE__ */ e(ee, { children: "AD" }),
236
- /* @__PURE__ */ e(ne, { children: "SPONSORED" })
227
+ ((m = o.sponsor) == null ? void 0 : m.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ n(Ho, { children: (u = o.sponsor) == null ? void 0 : u.name }),
228
+ /* @__PURE__ */ p(Yo, { className: "SponsorText", children: [
229
+ /* @__PURE__ */ n(Zo, { children: "AD" }),
230
+ /* @__PURE__ */ n(on, { children: "SPONSORED" })
237
231
  ] })
238
232
  ]
239
233
  }
240
234
  )
241
235
  ] }),
242
- /* @__PURE__ */ e(se, { className: "ClosePromoIcon", onClick: r, children: /* @__PURE__ */ e(ae, { name: "icon-cross" }) })
236
+ /* @__PURE__ */ n(nn, { className: "ClosePromoIcon", onClick: t, children: /* @__PURE__ */ n(sn, { name: "icon-cross" }) })
243
237
  ] }),
244
- /* @__PURE__ */ c(Jo, { children: [
245
- y && /* @__PURE__ */ e(G, { className: Xo, src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
246
- /* @__PURE__ */ e(z, { children: (d = (m = o.banner) == null ? void 0 : m.video) != null && d.url ? /* @__PURE__ */ e(
247
- X,
238
+ /* @__PURE__ */ p(Wo, { children: [
239
+ y && /* @__PURE__ */ n(F, { className: Vo, src: (c = o.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
240
+ /* @__PURE__ */ n(G, { children: (d = (I = o.banner) == null ? void 0 : I.video) != null && d.url ? /* @__PURE__ */ n(
241
+ V,
248
242
  {
249
- source: (S = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : S.url,
250
- poster: (k = (T = o.banner) == null ? void 0 : T.video) == null ? void 0 : k.thumbnailUrl,
251
- aspectRatio: b ? "1/1" : "16/9",
243
+ source: (S = (C = o.banner) == null ? void 0 : C.video) == null ? void 0 : S.url,
244
+ poster: (M = (T = o.banner) == null ? void 0 : T.video) == null ? void 0 : M.thumbnailUrl,
245
+ aspectRatio: A ? "1/1" : "16/9",
252
246
  onPlay: () => {
253
- $.emit("advertisement", {
247
+ N.emit("advertisement", {
254
248
  action: "videoPlay",
255
249
  payload: {
256
250
  advertisementId: s,
@@ -259,182 +253,175 @@ const to = /* @__PURE__ */ n("div")({
259
253
  });
260
254
  }
261
255
  }
262
- ) : (B = o.banner) != null && B.imageUrl ? /* @__PURE__ */ e(Vo, { style: b ? { aspectRatio: "1/1" } : {}, src: (E = o.banner) == null ? void 0 : E.imageUrl, alt: "promo" }) : null }),
263
- !b && /* @__PURE__ */ c(z, { children: [
264
- ((L = o.banner) == null ? void 0 : L.title) && /* @__PURE__ */ e(le, { className: f("AdvTitle", y && de), children: (O = o.banner) == null ? void 0 : O.title }),
265
- ((x = o.banner) == null ? void 0 : x.body) && /* @__PURE__ */ e(Yo, { className: "AdvDescription", children: (_ = o.banner) == null ? void 0 : _.body })
256
+ ) : (k = o.banner) != null && k.imageUrl ? /* @__PURE__ */ n(Qo, { style: A ? { aspectRatio: "1/1" } : {}, src: (B = o.banner) == null ? void 0 : B.imageUrl, alt: "promo" }) : null }),
257
+ !A && /* @__PURE__ */ p(G, { children: [
258
+ ((L = o.banner) == null ? void 0 : L.title) && /* @__PURE__ */ n(rn, { className: f("AdvTitle", y && ln), children: (E = o.banner) == null ? void 0 : E.title }),
259
+ ((O = o.banner) == null ? void 0 : O.body) && /* @__PURE__ */ n(Jo, { className: "AdvDescription", children: (x = o.banner) == null ? void 0 : x.body })
266
260
  ] })
267
261
  ] }),
268
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
269
- re,
262
+ o.buttonType !== so.NO_BUTTON && /* @__PURE__ */ n(an, { children: /* @__PURE__ */ n(
263
+ tn,
270
264
  {
271
- href: (P = o.banner) == null ? void 0 : P.url,
265
+ href: (_ = o.banner) == null ? void 0 : _.url,
272
266
  style: {
273
- backgroundColor: ((R = (j = o.banner) == null ? void 0 : j.ctaButton) == null ? void 0 : R.color) || "#009dc4",
274
- color: ((q = (D = o.banner) == null ? void 0 : D.ctaButton) == null ? void 0 : q.textColor) || "#fff"
267
+ backgroundColor: ((j = (P = o.banner) == null ? void 0 : P.ctaButton) == null ? void 0 : j.color) || "#009dc4",
268
+ color: ((D = (q = o.banner) == null ? void 0 : q.ctaButton) == null ? void 0 : D.textColor) || "#fff"
275
269
  },
276
270
  "data-analytics": "button",
277
271
  "data-promo-id": s,
278
272
  "data-promo-type": o.type,
279
273
  target: "_blank",
280
- children: (U = (F = o.banner) == null ? void 0 : F.ctaButton) == null ? void 0 : U.label
274
+ children: (U = (R = o.banner) == null ? void 0 : R.ctaButton) == null ? void 0 : U.label
281
275
  }
282
276
  ) })
283
277
  ] });
284
- }, ce = /* @__PURE__ */ n("div")({
278
+ }, dn = /* @__PURE__ */ e("div")({
285
279
  name: "SidebarContainer",
286
280
  class: "s1abskp8",
287
281
  propsAsIs: !1
288
- }), me = ({
282
+ }), cn = ({
289
283
  children: o,
290
284
  direction: s,
291
- style: r,
285
+ style: t,
292
286
  className: i,
293
287
  hiding: a
294
- }) => /* @__PURE__ */ e(C, {
288
+ }) => /* @__PURE__ */ n($, {
295
289
  direction: s,
296
- style: r,
290
+ style: t,
297
291
  hiding: a,
298
292
  className: i,
299
- children: /* @__PURE__ */ e(ce, {
293
+ children: /* @__PURE__ */ n(dn, {
300
294
  children: o
301
295
  })
302
- }), pe = (o) => (o == null ? void 0 : o.type) === I.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === I.INGAME_IAB21_LBAR, ue = (o) => (o == null ? void 0 : o.type) === I.INGAME_IAB11 || (o == null ? void 0 : o.type) === I.INGAME_IAB21, ve = ({ advertisement: o, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: i, isNotification: a, banner: l }) => {
303
- const t = N(o.data);
304
- return !t.data && t.loading ? null : t.error ? /* @__PURE__ */ c("div", { children: [
305
- "error ",
306
- /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
307
- ] }) : t.data ? a ? /* @__PURE__ */ e(wo, { notification: t.data.notification, promotionId: o.id }) : !i && !l && (s || ue(t.data.promotions)) ? /* @__PURE__ */ e(Go, { className: "PromoOverlayContainer", children: /* @__PURE__ */ e(H, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : i && (s || pe(t.data.promotions)) ? /* @__PURE__ */ e(me, { className: "PromoSidebarContainer", direction: i, hiding: o.hiding, children: /* @__PURE__ */ e(H, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : l ? /* @__PURE__ */ e(
308
- fo,
309
- {
310
- promotionId: o.id,
311
- hiding: o.hiding,
312
- promotion: t.data.promotions,
313
- direction: l
314
- }
315
- ) : null : /* @__PURE__ */ c("div", { children: [
316
- "empty promo ",
317
- /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
318
- ] });
319
- }, Ie = /* @__PURE__ */ n("div")({
296
+ }), pn = (o) => (o == null ? void 0 : o.type) === v.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === v.INGAME_IAB21_LBAR, mn = (o) => (o == null ? void 0 : o.type) === v.INGAME_IAB11 || (o == null ? void 0 : o.type) === v.INGAME_IAB21, un = ({
297
+ advertisement: o,
298
+ close: s,
299
+ skipTypeCheck: t,
300
+ layoutMode: i = "side-by-side",
301
+ sidebar: a,
302
+ isNotification: r,
303
+ banner: l
304
+ }) => o.promotion ? r && o.notification ? /* @__PURE__ */ n(Uo, { notification: o.notification, promotionId: o.question.id }) : !a && !l && (t || mn(o.promotion)) ? /* @__PURE__ */ n(wo, { className: "PromoOverlayContainer", children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : a && (t || pn(o.promotion)) ? /* @__PURE__ */ n(cn, { className: "PromoSidebarContainer", direction: a, hiding: !1, children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : l ? /* @__PURE__ */ n(
305
+ Ao,
306
+ {
307
+ promotionId: o.question.id,
308
+ hiding: !1,
309
+ promotion: o.promotion,
310
+ direction: l
311
+ }
312
+ ) : null : null, vn = /* @__PURE__ */ e("div")({
320
313
  name: "AdvertisementUIWrap",
321
314
  class: "aa6pjif",
322
315
  propsAsIs: !1
323
- }), ge = (o) => {
316
+ }), In = (o) => {
324
317
  const s = o.target;
325
318
  if (s instanceof HTMLAnchorElement && s.target === "_blank") {
326
- const r = s.getAttribute("data-promo-id") || "", i = s.getAttribute("data-promo-type") || I.UNSET;
327
- s.getAttribute("data-analytics") === "button" && $.emit("advertisement", {
319
+ const t = s.getAttribute("data-promo-id") || "", i = s.getAttribute("data-promo-type") || v.UNSET;
320
+ s.getAttribute("data-analytics") === "button" && N.emit("advertisement", {
328
321
  action: "buttonSelect",
329
322
  payload: {
330
- advertisementId: r,
323
+ advertisementId: t,
331
324
  advertisementType: i
332
325
  }
333
- }), s.getAttribute("data-analytics") === "banner" && $.emit("advertisement", {
326
+ }), s.getAttribute("data-analytics") === "banner" && N.emit("advertisement", {
334
327
  action: "bannerSelect",
335
328
  payload: {
336
- advertisementId: r,
329
+ advertisementId: t,
337
330
  advertisementType: i
338
331
  }
339
332
  });
340
333
  }
341
- }, he = ({
334
+ }, gn = ({
342
335
  gamification: o,
343
336
  layoutMode: s,
344
- skipTypeCheck: r,
337
+ skipTypeCheck: t,
345
338
  sidebar: i,
346
339
  banner: a,
347
- notification: l,
348
- isMobileScreen: t,
349
- persistent: p
340
+ notification: r,
341
+ isMobileScreen: l,
342
+ persistent: m
350
343
  }) => {
351
- const u = J(null), v = N(o.advertisement.$list), m = V(
352
- () => o.advertisement.getActiveAdvertisement(p),
353
- // fire getActiveNotification when notifications were updated
354
- // eslint-disable-next-line react-hooks/exhaustive-deps
355
- [v, p]
356
- );
357
- return Y(u, {
358
- enabled: !!m,
344
+ const u = Q(null), c = H(o.advertisement.$store);
345
+ J(u, {
346
+ enabled: !!c.data,
359
347
  event: "click",
360
- listener: ge
361
- }), m ? /* @__PURE__ */ e(Ie, {
348
+ listener: In
349
+ });
350
+ const I = !a && !i;
351
+ return c.data === void 0 || !m && c.isViewed ? null : /* @__PURE__ */ n(vn, {
362
352
  ref: u,
363
353
  style: {
364
- height: !a && !i ? "auto" : "100%"
354
+ height: I ? "auto" : "100%"
365
355
  },
366
- className: t ? "mobile-view" : "",
367
- children: /* @__PURE__ */ e(ve, {
368
- skipTypeCheck: r,
356
+ className: l ? "mobile-view" : "",
357
+ children: /* @__PURE__ */ n(un, {
358
+ skipTypeCheck: t,
369
359
  sidebar: i,
370
360
  banner: a,
371
- advertisement: m,
361
+ advertisement: c.data,
362
+ close: c.close,
372
363
  layoutMode: s,
373
- isNotification: l
364
+ isNotification: r
374
365
  })
375
- }) : null;
376
- }, Ae = ({
366
+ });
367
+ }, hn = ({
377
368
  sdk: o,
378
369
  sidebar: s,
379
- banner: r,
370
+ banner: t,
380
371
  skipTypeCheck: i,
381
- event: a,
382
- layoutMode: l,
383
- isMobileScreen: t,
384
- persistent: p,
385
- notification: u
372
+ layoutMode: a,
373
+ isMobileScreen: r,
374
+ persistent: l,
375
+ notification: m
386
376
  }) => {
387
- const {
388
- deactivate: v
389
- } = Z(o);
390
- Q(() => {
391
- a ? o.createEventSession(a) : v();
392
- }, [a, v, o]);
393
- const m = N(o.featuresList.getStore());
394
- if (s && r)
395
- return /* @__PURE__ */ e("div", {
377
+ const u = H(o.featuresList.getStore());
378
+ if (s && t)
379
+ return /* @__PURE__ */ n("div", {
396
380
  style: {
397
381
  color: "red"
398
382
  },
399
383
  children: "define either sidebar or banner, not both."
400
384
  });
401
- if (!m)
385
+ if (!u)
402
386
  return null;
403
- const d = o.getFeature(ao.GAMES);
404
- return d ? /* @__PURE__ */ e(he, {
405
- gamification: d,
387
+ const c = o.getFeature(ao.GAMES);
388
+ return c ? /* @__PURE__ */ n(gn, {
389
+ gamification: c,
406
390
  sidebar: s,
407
- banner: r,
408
- layoutMode: l,
409
- isMobileScreen: t,
410
- persistent: p,
411
- notification: u,
391
+ banner: t,
392
+ layoutMode: a,
393
+ isMobileScreen: r,
394
+ persistent: l,
395
+ notification: m,
412
396
  skipTypeCheck: i
413
397
  }) : null;
414
- }, Ce = ({
398
+ }, Nn = ({
415
399
  event: o,
416
400
  sidebar: s,
417
- banner: r,
401
+ banner: t,
418
402
  isMobileScreen: i,
419
403
  persistent: a,
404
+ theme: r,
420
405
  notification: l
421
406
  }) => {
422
- const t = oo();
423
- return t ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(eo, { children: /* @__PURE__ */ e(
424
- Ae,
425
- {
426
- sdk: t,
427
- event: o,
428
- sidebar: s,
429
- banner: r,
430
- isMobileScreen: i,
431
- persistent: a,
432
- notification: l,
433
- layoutMode: "side-by-side"
434
- }
435
- ) }) }) : null;
407
+ const m = X();
408
+ return m ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
409
+ /* @__PURE__ */ n(Y, { customTheme: r, children: /* @__PURE__ */ n(
410
+ hn,
411
+ {
412
+ sdk: m,
413
+ sidebar: s,
414
+ banner: t,
415
+ isMobileScreen: i,
416
+ persistent: a,
417
+ notification: l,
418
+ layoutMode: "side-by-side"
419
+ }
420
+ ) }),
421
+ o !== void 0 && /* @__PURE__ */ n(Z, { event: o })
422
+ ] }) : null;
436
423
  };
437
424
  export {
438
- Ce as StreamLayerSDKAdvertisement,
439
- Ae as StreamLayerSDKAdvertisementUI
425
+ Nn as StreamLayerSDKAdvertisement,
426
+ hn as StreamLayerSDKAdvertisementUI
440
427
  };