@streamlayer/react-ui 1.22.3 → 1.22.4

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,5 +1,5 @@
1
1
  import { styled as e } from "@linaria/react";
2
- import { ScreenButton as n } from "../styles.js";
2
+ import { d as n } from "../../../../../styles-BfnMua4o.js";
3
3
  const o = /* @__PURE__ */ e("div")({
4
4
  name: "EmergencyContainer",
5
5
  class: "e1f9mu2m",
@@ -1,15 +1,15 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
2
  import { useState as l } from "react";
3
3
  import { ScreenContainer as t } from "../ScreenContainer/index.js";
4
- import { ScreenWrap as i, ScreenTextBlock as m, ScreenTitle as p, ScreenDescription as c, ScreenButton as o } from "../styles.js";
5
- import { EndScreenSponsorIcon as h, EndScreenMedia as S } from "./styles.js";
4
+ import { S as i, a as m, b as p, c, d as o } from "../../../../../styles-BfnMua4o.js";
5
+ import { EndScreenSponsorIcon as S, EndScreenMedia as h } from "./styles.js";
6
6
  const E = ({ onEvent: s, height: r }) => {
7
- const [d, a] = l(
7
+ const [a, d] = l(
8
8
  0
9
9
  /* FIRST */
10
10
  );
11
- return d === 0 ? /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
12
- /* @__PURE__ */ e(h, {}),
11
+ return a === 0 ? /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
12
+ /* @__PURE__ */ e(S, {}),
13
13
  /* @__PURE__ */ n(m, { children: [
14
14
  /* @__PURE__ */ e(p, { children: "Great picks!" }),
15
15
  /* @__PURE__ */ e(c, { children: "Stay in the Enhanced Stream for live results, predictions, trivia, polls, and match insights." })
@@ -18,7 +18,7 @@ const E = ({ onEvent: s, height: r }) => {
18
18
  o,
19
19
  {
20
20
  onClick: () => {
21
- a(
21
+ d(
22
22
  1
23
23
  /* LAST */
24
24
  );
@@ -28,7 +28,7 @@ const E = ({ onEvent: s, height: r }) => {
28
28
  }
29
29
  )
30
30
  ] }) }, "end") : /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
31
- /* @__PURE__ */ e(S, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
31
+ /* @__PURE__ */ e(h, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
32
32
  /* @__PURE__ */ e(c, { children: "Look for more live match insights, predictions and more." }),
33
33
  /* @__PURE__ */ e(o, { onClick: () => s({ type: "slOpenGameCenter" }), children: "Open Game Center" })
34
34
  ] }) }, "end");
@@ -1,5 +1,5 @@
1
1
  import { styled as s } from "@linaria/react";
2
- import { SponsorIcon as e } from "../styles.js";
2
+ import { e } from "../../../../../styles-BfnMua4o.js";
3
3
  const c = /* @__PURE__ */ s("img")({
4
4
  name: "EndScreenMedia",
5
5
  class: "e8s3kc9",
@@ -1,4 +1,3 @@
1
1
  export declare const ScreenContainer: React.FC<{
2
2
  children: React.ReactNode;
3
- height?: number;
4
3
  }>;
@@ -1,6 +1,6 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { ScreenContainerBox as o } from "./styles.js";
3
- const i = ({ children: n, height: r }) => /* @__PURE__ */ e(o, { className: "ScreenContainer", children: /* @__PURE__ */ e("div", { style: r ? { height: r } : {}, children: n }) });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { ScreenContainerBox as n } from "./styles.js";
3
+ const i = ({ children: e }) => /* @__PURE__ */ r(n, { className: "ScreenContainer", children: /* @__PURE__ */ r("div", { children: e }) });
4
4
  export {
5
5
  i as ScreenContainer
6
6
  };
@@ -1,4 +1,5 @@
1
- export declare const StartScreen: import('react').ForwardRefExoticComponent<{
1
+ import { SwiperClass } from 'swiper/react';
2
+ export declare const StartScreen: React.FC<{
2
3
  countQuestionsAvailable: number;
3
- sliderRef: React.MutableRefObject<null>;
4
- } & import('react').RefAttributes<HTMLDivElement>>;
4
+ sliderRef: React.MutableRefObject<SwiperClass | undefined>;
5
+ }>;
@@ -1,30 +1,29 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import { ScreenContainer as s } from "../ScreenContainer/index.js";
4
- import { ScreenWrap as l, SponsorIcon as a, ScreenTextBlock as S, ScreenTitle as h, ScreenDescription as d, ScreenButton as m } from "../styles.js";
5
- import { StartScreenSponsor as p, NextButton as f, IconArrowRight as x, StartScreenNote as u } from "./styles.js";
6
- const N = c(({ countQuestionsAvailable: o, sliderRef: n }, i) => /* @__PURE__ */ e(s, { children: /* @__PURE__ */ r(l, { ref: i, children: [
7
- /* @__PURE__ */ e(a, {}),
8
- /* @__PURE__ */ r(S, { children: [
9
- /* @__PURE__ */ e(p, { children: "FEATURED GROUPS+" }),
10
- /* @__PURE__ */ e(h, { children: "The First Five" })
2
+ import { ScreenContainer as i } from "../ScreenContainer/index.js";
3
+ import { S as c, e as s, a, b as l, c as S, d } from "../../../../../styles-BfnMua4o.js";
4
+ import { StartScreenSponsor as h, NextButton as p, IconArrowRight as m, StartScreenNote as f } from "./styles.js";
5
+ const v = ({ countQuestionsAvailable: t, sliderRef: o }) => /* @__PURE__ */ e(i, { children: /* @__PURE__ */ r(c, { children: [
6
+ /* @__PURE__ */ e(s, {}),
7
+ /* @__PURE__ */ r(a, { children: [
8
+ /* @__PURE__ */ e(h, { children: "FEATURED GROUPS+" }),
9
+ /* @__PURE__ */ e(l, { children: "The First Five" })
11
10
  ] }),
12
- /* @__PURE__ */ e(d, { children: "Tee off with these five initial predictions for today’s play." }),
11
+ /* @__PURE__ */ e(S, { children: "Tee off with these five initial predictions for today’s play." }),
13
12
  /* @__PURE__ */ r(
14
- m,
13
+ d,
15
14
  {
16
15
  onClick: () => {
17
- var t;
18
- (t = n.current) == null || t.slickNext();
16
+ var n;
17
+ (n = o.current) == null || n.slideNext();
19
18
  },
20
19
  children: [
21
- o ? `${o} questions available` : "See all questions",
22
- /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(x, { name: "iconArrowRight" }) })
20
+ t ? `${t} questions available` : "See all questions",
21
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(m, { name: "iconArrowRight" }) })
23
22
  ]
24
23
  }
25
24
  ),
26
- /* @__PURE__ */ e(u, { children: "Note: Some questions may have been resolved as a result of today’s play." })
27
- ] }) }, "start"));
25
+ /* @__PURE__ */ e(f, { children: "Note: Some questions may have been resolved as a result of today’s play." })
26
+ ] }) }, "start");
28
27
  export {
29
- N as StartScreen
28
+ v as StartScreen
30
29
  };
@@ -1,93 +1,322 @@
1
- import { jsx as u, jsxs as O } from "react/jsx-runtime";
2
- import { ConnectError as P, Code as Q } from "@connectrpc/connect";
3
- import { useCallback as k, useSyncExternalStore as j, useRef as p, useState as R, useMemo as T, useEffect as y } from "react";
4
- import { EmergencyScreen as b } from "./EmergencyScreen/index.js";
5
- import { EndScreen as v } from "./EndScreen/index.js";
6
- import { LoaderScreen as w } from "./LoaderScreen/index.js";
7
- import { QuestionScreen as F } from "./QuestionScreen/index.js";
8
- import { ScreenContainer as H } from "./ScreenContainer/index.js";
9
- import { StartScreen as A } from "./StartScreen/index.js";
10
- import { settings as B } from "./constants.js";
11
- import { Carousel as N } from "./styles.js";
12
- function V(t, s, c) {
13
- let o = new Set(s).add(void 0);
14
- return t.listen((n, a, r) => {
15
- o.has(r) && c(n, a, r);
1
+ import { jsx as L, jsxs as N } from "react/jsx-runtime";
2
+ import { ConnectError as Q, Code as q } from "@connectrpc/connect";
3
+ import { useCallback as G, useSyncExternalStore as V, useRef as H, useMemo as X, useEffect as j, useState as Y } from "react";
4
+ import K from "lodash.throttle";
5
+ import { f as U, g as _, m as k, h as J, i as R, j as W, C as Z, k as F } from "../../../../styles-BfnMua4o.js";
6
+ import { EmergencyScreen as E } from "./EmergencyScreen/index.js";
7
+ import { EndScreen as ee } from "./EndScreen/index.js";
8
+ import { LoaderScreen as te } from "./LoaderScreen/index.js";
9
+ import { QuestionScreen as ae } from "./QuestionScreen/index.js";
10
+ import { ScreenContainer as ie } from "./ScreenContainer/index.js";
11
+ import { StartScreen as se } from "./StartScreen/index.js";
12
+ function le(o, e, u) {
13
+ let c = new Set(e).add(void 0);
14
+ return o.listen((n, s, f) => {
15
+ c.has(f) && u(n, s, f);
16
16
  });
17
17
  }
18
- function D(t, s = {}) {
19
- let c = k(
20
- (n) => s.keys ? V(t, s.keys, n) : t.listen(n),
21
- [s.keys, t]
22
- ), o = t.get.bind(t);
23
- return j(c, o, o);
18
+ function ne(o, e = {}) {
19
+ let u = G(
20
+ (n) => e.keys ? le(o, e.keys, n) : o.listen(n),
21
+ [e.keys, o]
22
+ ), c = o.get.bind(o);
23
+ return V(u, c, c);
24
24
  }
25
- const I = ({ data: t, gamification: s, onEvent: c, swipeable: o, overlay: n, autoplay: a }) => {
26
- const r = p(), l = p(null), i = p(null), [d, S] = R(0), { listOfQuestions: m, countQuestionsAvailable: g } = T(() => {
27
- const e = t ? Object.values(t) : [];
25
+ function re(o, e, u, c) {
26
+ return o.params.createElements && Object.keys(c).forEach((n) => {
27
+ if (!u[n] && u.auto === !0) {
28
+ let s = U(o.el, `.${c[n]}`)[0];
29
+ s || (s = _("div", c[n]), s.className = c[n], o.el.append(s)), u[n] = s, e[n] = s;
30
+ }
31
+ }), u;
32
+ }
33
+ function P(o) {
34
+ return o === void 0 && (o = ""), `.${o.trim().replace(/([\.:!+\/])/g, "\\$1").replace(/ /g, ".")}`;
35
+ }
36
+ function oe(o) {
37
+ let {
38
+ swiper: e,
39
+ extendParams: u,
40
+ on: c,
41
+ emit: n
42
+ } = o;
43
+ const s = "swiper-pagination";
44
+ u({
45
+ pagination: {
46
+ el: null,
47
+ bulletElement: "span",
48
+ clickable: !1,
49
+ hideOnClick: !1,
50
+ renderBullet: null,
51
+ renderProgressbar: null,
52
+ renderFraction: null,
53
+ renderCustom: null,
54
+ progressbarOpposite: !1,
55
+ type: "bullets",
56
+ // 'bullets' or 'progressbar' or 'fraction' or 'custom'
57
+ dynamicBullets: !1,
58
+ dynamicMainBullets: 1,
59
+ formatFractionCurrent: (t) => t,
60
+ formatFractionTotal: (t) => t,
61
+ bulletClass: `${s}-bullet`,
62
+ bulletActiveClass: `${s}-bullet-active`,
63
+ modifierClass: `${s}-`,
64
+ currentClass: `${s}-current`,
65
+ totalClass: `${s}-total`,
66
+ hiddenClass: `${s}-hidden`,
67
+ progressbarFillClass: `${s}-progressbar-fill`,
68
+ progressbarOppositeClass: `${s}-progressbar-opposite`,
69
+ clickableClass: `${s}-clickable`,
70
+ lockClass: `${s}-lock`,
71
+ horizontalClass: `${s}-horizontal`,
72
+ verticalClass: `${s}-vertical`,
73
+ paginationDisabledClass: `${s}-disabled`
74
+ }
75
+ }), e.pagination = {
76
+ el: null,
77
+ bullets: []
78
+ };
79
+ let f, g = 0;
80
+ function v() {
81
+ return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
82
+ }
83
+ function A(t, a) {
84
+ const {
85
+ bulletActiveClass: i
86
+ } = e.params.pagination;
87
+ t && (t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && (t.classList.add(`${i}-${a}`), t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && t.classList.add(`${i}-${a}-${a}`)));
88
+ }
89
+ function I(t, a, i) {
90
+ if (t = t % i, a = a % i, a === t + 1)
91
+ return "next";
92
+ if (a === t - 1)
93
+ return "previous";
94
+ }
95
+ function z(t) {
96
+ const a = t.target.closest(P(e.params.pagination.bulletClass));
97
+ if (!a)
98
+ return;
99
+ t.preventDefault();
100
+ const i = R(a) * e.params.slidesPerGroup;
101
+ if (e.params.loop) {
102
+ if (e.realIndex === i) return;
103
+ const r = I(e.realIndex, i, e.slides.length);
104
+ r === "next" ? e.slideNext() : r === "previous" ? e.slidePrev() : e.slideToLoop(i);
105
+ } else
106
+ e.slideTo(i);
107
+ }
108
+ function S() {
109
+ const t = e.rtl, a = e.params.pagination;
110
+ if (v()) return;
111
+ let i = e.pagination.el;
112
+ i = k(i);
113
+ let r, y;
114
+ const B = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, T = e.params.loop ? Math.ceil(B / e.params.slidesPerGroup) : e.snapGrid.length;
115
+ if (e.params.loop ? (y = e.previousRealIndex || 0, r = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (r = e.snapIndex, y = e.previousSnapIndex) : (y = e.previousIndex || 0, r = e.activeIndex || 0), a.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
116
+ const d = e.pagination.bullets;
117
+ let x, C, O;
118
+ if (a.dynamicBullets && (f = J(d[0], e.isHorizontal() ? "width" : "height"), i.forEach((m) => {
119
+ m.style[e.isHorizontal() ? "width" : "height"] = `${f * (a.dynamicMainBullets + 4)}px`;
120
+ }), a.dynamicMainBullets > 1 && y !== void 0 && (g += r - (y || 0), g > a.dynamicMainBullets - 1 ? g = a.dynamicMainBullets - 1 : g < 0 && (g = 0)), x = Math.max(r - g, 0), C = x + (Math.min(d.length, a.dynamicMainBullets) - 1), O = (C + x) / 2), d.forEach((m) => {
121
+ const h = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((b) => `${a.bulletActiveClass}${b}`)].map((b) => typeof b == "string" && b.includes(" ") ? b.split(" ") : b).flat();
122
+ m.classList.remove(...h);
123
+ }), i.length > 1)
124
+ d.forEach((m) => {
125
+ const h = R(m);
126
+ h === r ? m.classList.add(...a.bulletActiveClass.split(" ")) : e.isElement && m.setAttribute("part", "bullet"), a.dynamicBullets && (h >= x && h <= C && m.classList.add(...`${a.bulletActiveClass}-main`.split(" ")), h === x && A(m, "prev"), h === C && A(m, "next"));
127
+ });
128
+ else {
129
+ const m = d[r];
130
+ if (m && m.classList.add(...a.bulletActiveClass.split(" ")), e.isElement && d.forEach((h, b) => {
131
+ h.setAttribute("part", b === r ? "bullet-active" : "bullet");
132
+ }), a.dynamicBullets) {
133
+ const h = d[x], b = d[C];
134
+ for (let M = x; M <= C; M += 1)
135
+ d[M] && d[M].classList.add(...`${a.bulletActiveClass}-main`.split(" "));
136
+ A(h, "prev"), A(b, "next");
137
+ }
138
+ }
139
+ if (a.dynamicBullets) {
140
+ const m = Math.min(d.length, a.dynamicMainBullets + 4), h = (f * m - f) / 2 - O * f, b = t ? "right" : "left";
141
+ d.forEach((M) => {
142
+ M.style[e.isHorizontal() ? b : "top"] = `${h}px`;
143
+ });
144
+ }
145
+ }
146
+ i.forEach((d, x) => {
147
+ if (a.type === "fraction" && (d.querySelectorAll(P(a.currentClass)).forEach((C) => {
148
+ C.textContent = a.formatFractionCurrent(r + 1);
149
+ }), d.querySelectorAll(P(a.totalClass)).forEach((C) => {
150
+ C.textContent = a.formatFractionTotal(T);
151
+ })), a.type === "progressbar") {
152
+ let C;
153
+ a.progressbarOpposite ? C = e.isHorizontal() ? "vertical" : "horizontal" : C = e.isHorizontal() ? "horizontal" : "vertical";
154
+ const O = (r + 1) / T;
155
+ let m = 1, h = 1;
156
+ C === "horizontal" ? m = O : h = O, d.querySelectorAll(P(a.progressbarFillClass)).forEach((b) => {
157
+ b.style.transform = `translate3d(0,0,0) scaleX(${m}) scaleY(${h})`, b.style.transitionDuration = `${e.params.speed}ms`;
158
+ });
159
+ }
160
+ a.type === "custom" && a.renderCustom ? (d.innerHTML = a.renderCustom(e, r + 1, T), x === 0 && n("paginationRender", d)) : (x === 0 && n("paginationRender", d), n("paginationUpdate", d)), e.params.watchOverflow && e.enabled && d.classList[e.isLocked ? "add" : "remove"](a.lockClass);
161
+ });
162
+ }
163
+ function l() {
164
+ const t = e.params.pagination;
165
+ if (v()) return;
166
+ const a = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
167
+ let i = e.pagination.el;
168
+ i = k(i);
169
+ let r = "";
170
+ if (t.type === "bullets") {
171
+ let y = e.params.loop ? Math.ceil(a / e.params.slidesPerGroup) : e.snapGrid.length;
172
+ e.params.freeMode && e.params.freeMode.enabled && y > a && (y = a);
173
+ for (let B = 0; B < y; B += 1)
174
+ t.renderBullet ? r += t.renderBullet.call(e, B, t.bulletClass) : r += `<${t.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${t.bulletClass}"></${t.bulletElement}>`;
175
+ }
176
+ t.type === "fraction" && (t.renderFraction ? r = t.renderFraction.call(e, t.currentClass, t.totalClass) : r = `<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`), t.type === "progressbar" && (t.renderProgressbar ? r = t.renderProgressbar.call(e, t.progressbarFillClass) : r = `<span class="${t.progressbarFillClass}"></span>`), e.pagination.bullets = [], i.forEach((y) => {
177
+ t.type !== "custom" && (y.innerHTML = r || ""), t.type === "bullets" && e.pagination.bullets.push(...y.querySelectorAll(P(t.bulletClass)));
178
+ }), t.type !== "custom" && n("paginationRender", i[0]);
179
+ }
180
+ function p() {
181
+ e.params.pagination = re(e, e.originalParams.pagination, e.params.pagination, {
182
+ el: "swiper-pagination"
183
+ });
184
+ const t = e.params.pagination;
185
+ if (!t.el) return;
186
+ let a;
187
+ typeof t.el == "string" && e.isElement && (a = e.el.querySelector(t.el)), !a && typeof t.el == "string" && (a = [...document.querySelectorAll(t.el)]), a || (a = t.el), !(!a || a.length === 0) && (e.params.uniqueNavElements && typeof t.el == "string" && Array.isArray(a) && a.length > 1 && (a = [...e.el.querySelectorAll(t.el)], a.length > 1 && (a = a.find((i) => W(i, ".swiper")[0] === e.el))), Array.isArray(a) && a.length === 1 && (a = a[0]), Object.assign(e.pagination, {
188
+ el: a
189
+ }), a = k(a), a.forEach((i) => {
190
+ t.type === "bullets" && t.clickable && i.classList.add(...(t.clickableClass || "").split(" ")), i.classList.add(t.modifierClass + t.type), i.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.type === "bullets" && t.dynamicBullets && (i.classList.add(`${t.modifierClass}${t.type}-dynamic`), g = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), t.type === "progressbar" && t.progressbarOpposite && i.classList.add(t.progressbarOppositeClass), t.clickable && i.addEventListener("click", z), e.enabled || i.classList.add(t.lockClass);
191
+ }));
192
+ }
193
+ function $() {
194
+ const t = e.params.pagination;
195
+ if (v()) return;
196
+ let a = e.pagination.el;
197
+ a && (a = k(a), a.forEach((i) => {
198
+ i.classList.remove(t.hiddenClass), i.classList.remove(t.modifierClass + t.type), i.classList.remove(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.clickable && (i.classList.remove(...(t.clickableClass || "").split(" ")), i.removeEventListener("click", z));
199
+ })), e.pagination.bullets && e.pagination.bullets.forEach((i) => i.classList.remove(...t.bulletActiveClass.split(" ")));
200
+ }
201
+ c("changeDirection", () => {
202
+ if (!e.pagination || !e.pagination.el) return;
203
+ const t = e.params.pagination;
204
+ let {
205
+ el: a
206
+ } = e.pagination;
207
+ a = k(a), a.forEach((i) => {
208
+ i.classList.remove(t.horizontalClass, t.verticalClass), i.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass);
209
+ });
210
+ }), c("init", () => {
211
+ e.params.pagination.enabled === !1 ? w() : (p(), l(), S());
212
+ }), c("activeIndexChange", () => {
213
+ typeof e.snapIndex > "u" && S();
214
+ }), c("snapIndexChange", () => {
215
+ S();
216
+ }), c("snapGridLengthChange", () => {
217
+ l(), S();
218
+ }), c("destroy", () => {
219
+ $();
220
+ }), c("enable disable", () => {
221
+ let {
222
+ el: t
223
+ } = e.pagination;
224
+ t && (t = k(t), t.forEach((a) => a.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
225
+ }), c("lock unlock", () => {
226
+ S();
227
+ }), c("click", (t, a) => {
228
+ const i = a.target, r = k(e.pagination.el);
229
+ if (e.params.pagination.el && e.params.pagination.hideOnClick && r && r.length > 0 && !i.classList.contains(e.params.pagination.bulletClass)) {
230
+ if (e.navigation && (e.navigation.nextEl && i === e.navigation.nextEl || e.navigation.prevEl && i === e.navigation.prevEl)) return;
231
+ const y = r[0].classList.contains(e.params.pagination.hiddenClass);
232
+ n(y === !0 ? "paginationShow" : "paginationHide"), r.forEach((B) => B.classList.toggle(e.params.pagination.hiddenClass));
233
+ }
234
+ });
235
+ const D = () => {
236
+ e.el.classList.remove(e.params.pagination.paginationDisabledClass);
237
+ let {
238
+ el: t
239
+ } = e.pagination;
240
+ t && (t = k(t), t.forEach((a) => a.classList.remove(e.params.pagination.paginationDisabledClass))), p(), l(), S();
241
+ }, w = () => {
242
+ e.el.classList.add(e.params.pagination.paginationDisabledClass);
243
+ let {
244
+ el: t
245
+ } = e.pagination;
246
+ t && (t = k(t), t.forEach((a) => a.classList.add(e.params.pagination.paginationDisabledClass))), $();
247
+ };
248
+ Object.assign(e.pagination, {
249
+ enable: D,
250
+ disable: w,
251
+ render: l,
252
+ update: S,
253
+ init: p,
254
+ destroy: $
255
+ });
256
+ }
257
+ const ce = ({ data: o, gamification: e, onEvent: u, swipeable: c, autoplay: n }) => {
258
+ const s = H(), f = H(), { listOfQuestions: g, countQuestionsAvailable: v } = X(() => {
259
+ const l = o ? Object.values(o) : [];
28
260
  return {
29
- listOfQuestions: e,
30
- countQuestionsAvailable: e.filter(({ marketClosed: f }) => !f).length
261
+ listOfQuestions: l,
262
+ countQuestionsAvailable: l.filter(({ marketClosed: p }) => !p).length
31
263
  };
32
- }, [t]), x = k(
33
- async (e, f) => {
264
+ }, [o]), A = G(
265
+ async (l, p) => {
34
266
  try {
35
- await s.betPackVote(e, f), c({
267
+ await e.betPackVote(l, p), u({
36
268
  type: "slVoted",
37
269
  payload: {
38
- questionId: e,
39
- answerId: f
270
+ questionId: l,
271
+ answerId: p
40
272
  }
41
273
  });
42
274
  } finally {
43
- r.current && clearTimeout(r.current), a && (r.current = setTimeout(() => {
44
- var h;
45
- (h = l.current) == null || h.slickNext();
275
+ s.current && clearTimeout(s.current), n && (s.current = setTimeout(() => {
276
+ var $;
277
+ ($ = f.current) == null || $.slideNext();
46
278
  }, 2e3));
47
279
  }
48
280
  },
49
- [s, c, a]
281
+ [e, u, n]
50
282
  );
51
- y(() => (c({
283
+ j(() => (u({
52
284
  type: "slBetPackReady",
53
285
  payload: {
54
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55
- // @ts-expect-error
56
286
  next: () => {
57
- var e;
58
- return (e = l.current) == null ? void 0 : e.slickNext();
287
+ var l;
288
+ return (l = f.current) == null ? void 0 : l.slideNext();
59
289
  },
60
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
61
- // @ts-expect-error
62
290
  prev: () => {
63
- var e;
64
- return (e = l.current) == null ? void 0 : e.slickPrev();
291
+ var l;
292
+ return (l = f.current) == null ? void 0 : l.slidePrev();
65
293
  },
66
294
  current: 0,
67
295
  canNext: !0,
68
296
  canPrev: !1
69
297
  }
70
298
  }), () => {
71
- r.current && clearTimeout(r.current);
72
- }), [c]);
73
- const C = (e) => {
74
- var f;
75
- if (c({
299
+ s.current && clearTimeout(s.current);
300
+ }), [u]);
301
+ const I = (l) => {
302
+ var $;
303
+ const p = l.realIndex;
304
+ if (u({
76
305
  type: "slBetPackChangeCard",
77
306
  payload: {
78
- current: e,
79
- canNext: e < Object.keys(t).length + 1,
80
- canPrev: e >= 1
307
+ current: p,
308
+ canNext: p < Object.keys(o).length + 1,
309
+ canPrev: p >= 1
81
310
  }
82
- }), e !== 0 && e !== Object.keys(t).length + 1 && ((f = m[e - 1]) != null && f.id)) {
83
- s.openQuestion(m[e - 1].id, {
311
+ }), p !== 0 && p !== Object.keys(o).length + 1 && (($ = g[p - 1]) != null && $.id)) {
312
+ e.openQuestion(g[p - 1].id, {
84
313
  openedFrom: "bet-pack",
85
314
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
86
315
  // @ts-expect-error
87
316
  attributes: {
88
- id: m[e - 1].id,
89
- type: m[e - 1].type,
90
- status: m[e - 1].status,
317
+ id: g[p - 1].id,
318
+ type: g[p - 1].type,
319
+ status: g[p - 1].status,
91
320
  attributes: {
92
321
  case: void 0
93
322
  }
@@ -95,58 +324,77 @@ const I = ({ data: t, gamification: s, onEvent: c, swipeable: o, overlay: n, aut
95
324
  });
96
325
  return;
97
326
  }
98
- s.closeQuestion();
99
- };
100
- return y(() => {
101
- n && i.current && S(i.current.clientHeight);
102
- }, [n]), /* @__PURE__ */ O(
103
- N,
327
+ e.closeQuestion();
328
+ }, [z, S] = Y(1.1);
329
+ return j(() => {
330
+ const l = K(() => {
331
+ var w;
332
+ const p = (w = f.current) == null ? void 0 : w.size;
333
+ if (!p)
334
+ return;
335
+ const D = 1 + 30 / (p / 100) / 100 * 2;
336
+ S(Math.ceil(D * 1e3) / 1e3);
337
+ }, 200);
338
+ return window.addEventListener("resize", l), l(), () => {
339
+ window.removeEventListener("resize", l);
340
+ };
341
+ }, []), /* @__PURE__ */ N(
342
+ Z,
104
343
  {
105
- ...B,
106
- swipe: o,
107
- afterChange: C,
108
- beforeChange: () => {
109
- r.current && clearTimeout(r.current);
344
+ slidesPerView: z,
345
+ spaceBetween: 12,
346
+ centeredSlides: !0,
347
+ centerInsufficientSlides: !0,
348
+ allowTouchMove: c,
349
+ pagination: {
350
+ clickable: !0
351
+ },
352
+ modules: [oe],
353
+ onSlideChange: I,
354
+ onBeforeSlideChangeStart: () => {
355
+ s.current && clearTimeout(s.current);
356
+ },
357
+ onSwiper: (l) => {
358
+ f.current = l;
110
359
  },
111
- ref: l,
112
360
  children: [
113
- /* @__PURE__ */ u(A, { ref: i, sliderRef: l, countQuestionsAvailable: g }),
114
- m.map((e) => e ? /* @__PURE__ */ u(H, { height: d, children: /* @__PURE__ */ u(F, { question: e, vote: x }) }, e.id) : null),
115
- /* @__PURE__ */ u(v, { height: d, onEvent: c })
361
+ /* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(se, { sliderRef: f, countQuestionsAvailable: v }) }),
362
+ g.map((l) => l ? /* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(ie, { children: /* @__PURE__ */ L(ae, { question: l, vote: A }) }, l.id) }) : null),
363
+ /* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(ee, { onEvent: u }) })
116
364
  ]
117
365
  }
118
366
  );
119
- }, _ = ({ gamification: t, autoplay: s, overlay: c, swipeable: o, onEvent: n }) => {
120
- const a = D(t.betPack.getStore()), { error: r, loading: l, data: i } = a;
121
- return l || !Object.hasOwn(a, "data") ? /* @__PURE__ */ u(w, {}) : r ? /* @__PURE__ */ u(
122
- b,
367
+ }, Le = ({ gamification: o, autoplay: e, overlay: u, swipeable: c, onEvent: n }) => {
368
+ const s = ne(o.betPack.getStore()), { error: f, loading: g, data: v } = s;
369
+ return g || !Object.hasOwn(s, "data") ? /* @__PURE__ */ L(te, {}) : f ? /* @__PURE__ */ L(
370
+ E,
123
371
  {
124
372
  onEvent: n,
125
373
  actionFn: () => n({ type: "slHardRefresh" }),
126
- description: r instanceof P && r.code !== Q.InvalidArgument ? `The event ID was not
374
+ description: f instanceof Q && f.code !== q.InvalidArgument ? `The event ID was not
127
375
  specified or is invalid.` : `The server is unable to
128
376
  handle this request.`
129
377
  }
130
- ) : !i || !i.timestamp || !i.data || !Object.keys(i.data).length ? /* @__PURE__ */ u(
131
- b,
378
+ ) : !v || !v.timestamp || !v.data || !Object.keys(v.data).length ? /* @__PURE__ */ L(
379
+ E,
132
380
  {
133
381
  onEvent: n,
134
382
  actionFn: () => n({ type: "slHardRefresh" }),
135
383
  description: `It looks like we couldn't
136
384
  load the questions.`
137
385
  }
138
- ) : /* @__PURE__ */ u(
139
- I,
386
+ ) : /* @__PURE__ */ L(
387
+ ce,
140
388
  {
141
- data: i.data,
142
- gamification: t,
389
+ data: v.data,
390
+ gamification: o,
143
391
  onEvent: n,
144
- swipeable: o,
145
- autoplay: s,
146
- overlay: c
392
+ swipeable: c,
393
+ autoplay: e,
394
+ overlay: u
147
395
  }
148
396
  );
149
397
  };
150
398
  export {
151
- _ as BetPackContent
399
+ Le as BetPackContent
152
400
  };