@streamlayer/react-ui 1.17.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/lib/app/app/story/settings/login.js +18 -14
  2. package/lib/app/login/demo.d.ts +1 -4
  3. package/lib/app/login/demo.js +38 -24
  4. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +4 -0
  5. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +4 -0
  7. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +25 -0
  8. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +5 -0
  9. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -0
  10. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +7 -0
  11. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +41 -0
  12. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +1 -0
  13. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +13 -0
  14. package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +6 -0
  15. package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.js +7 -0
  16. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +4 -0
  17. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +6 -0
  18. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.d.ts +1 -0
  19. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.js +9 -0
  20. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +5 -0
  21. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +33 -0
  22. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -0
  23. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +41 -0
  24. package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +13 -0
  25. package/lib/app/masters/BetPack/BetPackContent/constants.js +22 -0
  26. package/lib/app/masters/BetPack/BetPackContent/index.d.ts +11 -0
  27. package/lib/app/masters/BetPack/BetPackContent/index.js +116 -0
  28. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +3 -0
  29. package/lib/app/masters/BetPack/BetPackContent/styles.js +20 -0
  30. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +12 -0
  31. package/lib/app/masters/BetPack/BetPackOverlay/index.js +9 -0
  32. package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +10 -0
  33. package/lib/app/masters/BetPack/BetPackOverlay/styles.js +51 -0
  34. package/lib/app/masters/BetPack/index.d.ts +14 -0
  35. package/lib/app/masters/BetPack/index.js +84 -0
  36. package/lib/app/masters/BetPack/styles.d.ts +4 -0
  37. package/lib/app/masters/BetPack/styles.js +24 -0
  38. package/lib/app/masters/BetPack/typings.d.js +1 -0
  39. package/lib/app/masters/BetPack/utils.d.ts +19 -0
  40. package/lib/app/masters/BetPack/utils.js +10 -0
  41. package/lib/app/masters/masters.d.ts +0 -2
  42. package/lib/app/masters/masters.js +89 -85
  43. package/lib/app/masters/story/components.d.ts +11 -0
  44. package/lib/app/masters/story/components.js +151 -0
  45. package/lib/app/masters/story/index.d.ts +3 -0
  46. package/lib/app/masters/story/index.js +53 -0
  47. package/lib/assets/style.css +1 -1
  48. package/lib/ui/gamification/vote/feedback/index.d.ts +3 -1
  49. package/lib/ui/gamification/vote/feedback/index.js +52 -50
  50. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  51. package/lib/ui/gamification/vote/feedback/styles.js +5 -0
  52. package/lib/ui/gamification/vote/index.d.ts +1 -0
  53. package/lib/ui/gamification/vote/index.js +150 -126
  54. package/lib/ui/gamification/vote/styles.d.ts +5 -0
  55. package/lib/ui/gamification/vote/styles.js +40 -14
  56. package/lib/ui/gamification/vote/vote-option/index.js +43 -40
  57. package/lib/ui/icons/index.d.ts +5 -0
  58. package/lib/ui/icons/index.js +87 -66
  59. package/lib/ui/loader/index.d.ts +4 -0
  60. package/lib/ui/loader/index.js +5 -0
  61. package/lib/ui/theme/masters-theme.js +4 -4
  62. package/lib/ui/theme/masters.js +3 -2
  63. package/lib/utils/decorators/container.js +11 -9
  64. package/package.json +22 -16
@@ -1,19 +1,19 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { useState as h, useEffect as u } from "react";
3
- import { useStreamLayer as i } from "@streamlayer/react";
2
+ import { useState as u, useEffect as h } from "react";
3
+ import { useStreamLayer as c } from "@streamlayer/react";
4
4
  import { storage as s } from "@streamlayer/sdk-web-core";
5
- const d = ({ token: o, schema: n }) => {
6
- const t = i();
7
- return u(() => {
8
- o && n && t && t.authorizationBypass(n, o);
9
- }, [o, n, t]), null;
10
- }, x = () => {
11
- const [o, n] = h({ token: s.getExternalToken(), schema: s.getSchema() }), t = i();
5
+ const d = ({ token: t, schema: o }) => {
6
+ const n = c();
7
+ return h(() => {
8
+ t && o && n && n.authorizationBypass(o, t);
9
+ }, [t, o, n]), null;
10
+ }, v = () => {
11
+ const [t, o] = u({ token: s.getExternalToken(), schema: s.getSchema() }), n = c();
12
12
  return /* @__PURE__ */ r("div", { children: [
13
13
  /* @__PURE__ */ r("form", { className: "auth-form", onSubmit: (a) => {
14
14
  a.preventDefault();
15
- const c = new FormData(a.currentTarget), m = c.get("token"), l = c.get("schema");
16
- n({ token: m, schema: l });
15
+ const i = new FormData(a.currentTarget), m = i.get("token"), l = i.get("schema");
16
+ o({ token: m, schema: l });
17
17
  }, children: [
18
18
  /* @__PURE__ */ r("div", { children: [
19
19
  /* @__PURE__ */ e("label", { htmlFor: "token", children: "token" }),
@@ -25,10 +25,14 @@ const d = ({ token: o, schema: n }) => {
25
25
  ] }),
26
26
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("button", { type: "submit", children: "submit" }) })
27
27
  ] }),
28
- /* @__PURE__ */ e(d, { token: o.token, schema: o.schema }),
29
- /* @__PURE__ */ e("button", { onClick: () => t == null ? void 0 : t.logout(), children: "logout" })
28
+ /* @__PURE__ */ e(d, { token: t.token, schema: t.schema }),
29
+ /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.logout(), children: "logout" }),
30
+ /* @__PURE__ */ r("div", { children: [
31
+ "current user: ",
32
+ /* @__PURE__ */ e("input", { value: t.token })
33
+ ] })
30
34
  ] });
31
35
  };
32
36
  export {
33
- x as AppLogin
37
+ v as AppLogin
34
38
  };
@@ -1,4 +1 @@
1
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
- export declare const LoginComponent: React.FC<{
3
- sdk: StreamLayerSDK;
4
- }>;
1
+ export declare const LoginComponent: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,28 +1,42 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { useStore as a } from "@streamlayer/react-polyfills";
1
+ import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
+ import { useStreamLayer as i } from "@streamlayer/react";
3
+ import { useStore as s } from "@streamlayer/react-polyfills";
4
+ import { storage as u } from "@streamlayer/sdk-web-core";
3
5
  import "@streamlayer/sdk-web-anonymous-auth";
4
- import { Login as s } from "./index.js";
5
- const y = ({ sdk: o }) => a(o.getUserStore()).data ? /* @__PURE__ */ i("div", { children: [
6
- /* @__PURE__ */ t(
7
- "a",
8
- {
9
- href: "#",
10
- onClick: () => {
11
- window.history.go(-1);
12
- },
13
- children: "go back"
6
+ import { Login as l } from "./index.js";
7
+ const w = () => {
8
+ const o = i();
9
+ if (!o)
10
+ return null;
11
+ o == null || o.closeFeature(12);
12
+ const r = s(o.getUserStore());
13
+ return r.data ? /* @__PURE__ */ e("div", { children: [
14
+ /* @__PURE__ */ t(
15
+ "a",
16
+ {
17
+ href: "#",
18
+ onClick: () => {
19
+ window.history.go(-1);
20
+ },
21
+ children: "go back"
22
+ }
23
+ ),
24
+ /* @__PURE__ */ t("button", { onClick: o.logout, children: "logout" }),
25
+ /* @__PURE__ */ e("div", { children: [
26
+ "current user: ",
27
+ r.data.data.attributes.name,
28
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("textarea", { style: { width: "100%" }, value: u.getToken(), rows: 10 }) })
29
+ ] })
30
+ ] }) : /* @__PURE__ */ t(l, { login: async (a) => {
31
+ try {
32
+ await o.authorizationBypass("streamlayer:streamlayer", a);
33
+ } catch (n) {
34
+ throw console.log("login err", n), n;
14
35
  }
15
- ),
16
- /* @__PURE__ */ t("button", { onClick: o.logout, children: "logout" })
17
- ] }) : /* @__PURE__ */ t(s, { login: async (r) => {
18
- try {
19
- await o.authorizationBypass("streamlayer:streamlayer", r), window.history.go(-1);
20
- } catch (n) {
21
- throw console.log("login err", n), n;
22
- }
23
- }, anonymousLogin: async () => {
24
- await o.anonymousAuthorization(), window.history.go(-1);
25
- }, host: o.host });
36
+ }, anonymousLogin: async () => {
37
+ await o.anonymousAuthorization();
38
+ }, host: o.host });
39
+ };
26
40
  export {
27
- y as LoginComponent
41
+ w as LoginComponent
28
42
  };
@@ -0,0 +1,4 @@
1
+ export declare const EmergencyScreen: React.FC<{
2
+ actionFn: () => void;
3
+ description: string;
4
+ }>;
@@ -0,0 +1,10 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { EmergencyContainer as i, EmergencyScreenTitle as o, EmergencyScreenDescription as t, EmergencyScreenButton as m } from "./styles.js";
3
+ const y = ({ actionFn: n, description: r }) => /* @__PURE__ */ c(i, { children: [
4
+ /* @__PURE__ */ e(o, { children: "Something went wrong." }),
5
+ /* @__PURE__ */ e(t, { children: r }),
6
+ /* @__PURE__ */ e(m, { onClick: n, children: "Try again" })
7
+ ] });
8
+ export {
9
+ y as EmergencyScreen
10
+ };
@@ -0,0 +1,4 @@
1
+ export declare const EmergencyContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const EmergencyScreenTitle: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const EmergencyScreenDescription: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const EmergencyScreenButton: any;
@@ -0,0 +1,25 @@
1
+ import { styled as e } from "@linaria/react";
2
+ import { ScreenButton as n } from "../../styles.js";
3
+ const o = /* @__PURE__ */ e("div")({
4
+ name: "EmergencyContainer",
5
+ class: "e1f9mu2m",
6
+ propsAsIs: !1
7
+ }), t = /* @__PURE__ */ e("div")({
8
+ name: "EmergencyScreenTitle",
9
+ class: "e1n10yo1",
10
+ propsAsIs: !1
11
+ }), m = /* @__PURE__ */ e("div")({
12
+ name: "EmergencyScreenDescription",
13
+ class: "e1xecypc",
14
+ propsAsIs: !1
15
+ }), s = () => n, p = /* @__PURE__ */ e(s())({
16
+ name: "EmergencyScreenButton",
17
+ class: "e1k6zoyu",
18
+ propsAsIs: !0
19
+ });
20
+ export {
21
+ o as EmergencyContainer,
22
+ p as EmergencyScreenButton,
23
+ m as EmergencyScreenDescription,
24
+ t as EmergencyScreenTitle
25
+ };
@@ -0,0 +1,5 @@
1
+ import { BetPackEventCb } from '../..';
2
+ export declare const EndScreen: React.FC<{
3
+ height: number | undefined;
4
+ onEvent: BetPackEventCb;
5
+ }>;
@@ -0,0 +1,18 @@
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { ScreenContainer as c } from "../ScreenContainer/index.js";
3
+ import { ScreenWrap as t, EndScreenWrap as o, EndScreenMain as d, SponsorIcon as s, EndScreenTitle as a, EndScreenDescription as l, EndScreenButton as p } from "./styles.js";
4
+ const E = ({ height: r, onEvent: i }) => /* @__PURE__ */ e(c, { height: r, children: /* @__PURE__ */ e(t, { children: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ n(d, { children: [
5
+ /* @__PURE__ */ e(s, { name: "icon-masters-logo" }),
6
+ /* @__PURE__ */ e(a, { children: "Great picks!" }),
7
+ /* @__PURE__ */ n(l, { children: [
8
+ "Stay in the Enhanced Stream for",
9
+ /* @__PURE__ */ e("br", {}),
10
+ "live results, predictions, trivia,",
11
+ /* @__PURE__ */ e("br", {}),
12
+ "polls, and match insights."
13
+ ] }),
14
+ /* @__PURE__ */ e(p, { onClick: () => i({ type: "slOpenGameCenter" }), children: "Open Game Center" })
15
+ ] }) }) }) }, "end");
16
+ export {
17
+ E as EndScreen
18
+ };
@@ -0,0 +1,7 @@
1
+ export declare const ScreenWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const SponsorIcon: any;
3
+ export declare const EndScreenWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const EndScreenMain: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const EndScreenTitle: any;
6
+ export declare const EndScreenDescription: any;
7
+ export declare const EndScreenButton: any;
@@ -0,0 +1,41 @@
1
+ import { styled as e } from "@linaria/react";
2
+ import { ScreenTitle as s, ScreenDescription as n, ScreenButton as r } from "../../styles.js";
3
+ import { SvgIcon as c } from "../../../../../ui/icons/index.js";
4
+ const l = /* @__PURE__ */ e("div")({
5
+ name: "ScreenWrap",
6
+ class: "s8s3kc9",
7
+ propsAsIs: !1
8
+ }), o = () => c, m = /* @__PURE__ */ e(o())({
9
+ name: "SponsorIcon",
10
+ class: "s1uswib2",
11
+ propsAsIs: !0
12
+ }), E = /* @__PURE__ */ e("div")({
13
+ name: "EndScreenWrap",
14
+ class: "el0dbzn",
15
+ propsAsIs: !1
16
+ }), I = /* @__PURE__ */ e("div")({
17
+ name: "EndScreenMain",
18
+ class: "e11do4i1",
19
+ propsAsIs: !1
20
+ }), t = () => s, u = /* @__PURE__ */ e(t())({
21
+ name: "EndScreenTitle",
22
+ class: "ef67yx9",
23
+ propsAsIs: !0
24
+ }), p = () => n, f = /* @__PURE__ */ e(p())({
25
+ name: "EndScreenDescription",
26
+ class: "enw6fxs",
27
+ propsAsIs: !0
28
+ }), a = () => r, x = /* @__PURE__ */ e(a())({
29
+ name: "EndScreenButton",
30
+ class: "euaws9b",
31
+ propsAsIs: !0
32
+ });
33
+ export {
34
+ x as EndScreenButton,
35
+ f as EndScreenDescription,
36
+ I as EndScreenMain,
37
+ u as EndScreenTitle,
38
+ E as EndScreenWrap,
39
+ l as ScreenWrap,
40
+ m as SponsorIcon
41
+ };
@@ -0,0 +1 @@
1
+ export declare const LoaderScreen: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { styled as r } from "@linaria/react";
3
+ import { Loader as e } from "../../../../../ui/loader/index.js";
4
+ const t = /* @__PURE__ */ r("div")({
5
+ name: "Container",
6
+ class: "cv31tt7",
7
+ propsAsIs: !1
8
+ }), i = () => /* @__PURE__ */ o(t, {
9
+ children: /* @__PURE__ */ o(e, {})
10
+ });
11
+ export {
12
+ i as LoaderScreen
13
+ };
@@ -0,0 +1,6 @@
1
+ import { Gamification } from '@streamlayer/feature-gamification';
2
+ import { ExtendedQuestion } from '@streamlayer/sdk-web-types';
3
+ export declare const QuestionScreen: React.FC<{
4
+ question: ExtendedQuestion;
5
+ vote: Gamification['submitAnswer'];
6
+ }>;
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Vote as t } from "../../../../../ui/gamification/vote/index.js";
3
+ const s = ({ question: e, vote: r }) => e ? /* @__PURE__ */ o(t, { close: () => {
4
+ }, openedQuestion: e, vote: r, isLoading: !1, isEarlyPrediction: !0 }) : null;
5
+ export {
6
+ s as QuestionScreen
7
+ };
@@ -0,0 +1,4 @@
1
+ export declare const ScreenContainer: React.FC<{
2
+ children: React.ReactNode;
3
+ height?: number;
4
+ }>;
@@ -0,0 +1,6 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { ScreenContainerBox as n } from "./styles.js";
3
+ const c = ({ children: e, height: o }) => /* @__PURE__ */ r(n, { style: { height: o }, children: /* @__PURE__ */ r("div", { children: e }) });
4
+ export {
5
+ c as ScreenContainer
6
+ };
@@ -0,0 +1 @@
1
+ export declare const ScreenContainerBox: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,9 @@
1
+ import { styled as o } from "@linaria/react";
2
+ const s = /* @__PURE__ */ o("div")({
3
+ name: "ScreenContainerBox",
4
+ class: "s28ooi9",
5
+ propsAsIs: !1
6
+ });
7
+ export {
8
+ s as ScreenContainerBox
9
+ };
@@ -0,0 +1,5 @@
1
+ export declare const StartScreen: React.FC<{
2
+ height: number | undefined;
3
+ countQuestionsAvailable: number;
4
+ sliderRef: React.MutableRefObject<null>;
5
+ }>;
@@ -0,0 +1,33 @@
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import { ScreenContainer as c } from "../ScreenContainer/index.js";
3
+ import { ScreenWrap as s, SponsorIcon as S, StartScreenSponsor as a, StartScreenTitle as l, StartScreenDescription as p, StartScreenButton as m, IconArrowRight as d } from "./styles.js";
4
+ const w = ({ height: o, countQuestionsAvailable: t, sliderRef: i }) => /* @__PURE__ */ r(c, { height: o, children: /* @__PURE__ */ e(s, { children: [
5
+ /* @__PURE__ */ r(S, { name: "icon-masters-logo" }),
6
+ /* @__PURE__ */ r(a, { children: "MASTERS PRESENTS" }),
7
+ /* @__PURE__ */ e(l, { children: [
8
+ "Tee time predictions:",
9
+ /* @__PURE__ */ r("br", {}),
10
+ "share your expertise"
11
+ ] }),
12
+ /* @__PURE__ */ e(p, { children: [
13
+ "Swipe to answer today’s",
14
+ /* @__PURE__ */ r("br", {}),
15
+ "question cards."
16
+ ] }),
17
+ /* @__PURE__ */ e(
18
+ m,
19
+ {
20
+ onClick: () => {
21
+ var n;
22
+ (n = i.current) == null || n.slickNext();
23
+ },
24
+ children: [
25
+ t ? `${t} questions available` : "See all questions",
26
+ /* @__PURE__ */ r(d, { name: "iconArrowRight" })
27
+ ]
28
+ }
29
+ )
30
+ ] }) }, "start");
31
+ export {
32
+ w as StartScreen
33
+ };
@@ -0,0 +1,7 @@
1
+ export declare const ScreenWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const IconArrowRight: any;
3
+ export declare const SponsorIcon: any;
4
+ export declare const StartScreenSponsor: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const StartScreenTitle: any;
6
+ export declare const StartScreenDescription: any;
7
+ export declare const StartScreenButton: any;
@@ -0,0 +1,41 @@
1
+ import { styled as s } from "@linaria/react";
2
+ import { ScreenTitle as r, ScreenDescription as t, ScreenButton as n } from "../../styles.js";
3
+ import { SvgIcon as e } from "../../../../../ui/icons/index.js";
4
+ const I = /* @__PURE__ */ s("div")({
5
+ name: "ScreenWrap",
6
+ class: "s991vvm",
7
+ propsAsIs: !1
8
+ }), o = () => e, u = /* @__PURE__ */ s(o())({
9
+ name: "IconArrowRight",
10
+ class: "inbj36g",
11
+ propsAsIs: !0
12
+ }), c = () => e, A = /* @__PURE__ */ s(c())({
13
+ name: "SponsorIcon",
14
+ class: "szrvgt",
15
+ propsAsIs: !0
16
+ }), f = /* @__PURE__ */ s("div")({
17
+ name: "StartScreenSponsor",
18
+ class: "swqs2ju",
19
+ propsAsIs: !1
20
+ }), p = () => r, g = /* @__PURE__ */ s(p())({
21
+ name: "StartScreenTitle",
22
+ class: "s1oq8jlq",
23
+ propsAsIs: !0
24
+ }), a = () => t, v = /* @__PURE__ */ s(a())({
25
+ name: "StartScreenDescription",
26
+ class: "se4nn9a",
27
+ propsAsIs: !0
28
+ }), S = () => n, x = /* @__PURE__ */ s(S())({
29
+ name: "StartScreenButton",
30
+ class: "sofug8s",
31
+ propsAsIs: !0
32
+ });
33
+ export {
34
+ u as IconArrowRight,
35
+ I as ScreenWrap,
36
+ A as SponsorIcon,
37
+ x as StartScreenButton,
38
+ v as StartScreenDescription,
39
+ f as StartScreenSponsor,
40
+ g as StartScreenTitle
41
+ };
@@ -0,0 +1,13 @@
1
+ export declare const settings: {
2
+ dots: boolean;
3
+ infinite: boolean;
4
+ arrows: boolean;
5
+ centerMode: boolean;
6
+ centerPadding: string;
7
+ speed: number;
8
+ rows: number;
9
+ slidesToShow: number;
10
+ slidesToScroll: number;
11
+ appendDots: (dots: React.ReactElement) => import("react/jsx-runtime").JSX.Element;
12
+ customPaging: (i: number) => import("react/jsx-runtime").JSX.Element;
13
+ };
@@ -0,0 +1,22 @@
1
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
+ import { Dots as t, Dot as r } from "./styles.js";
3
+ const n = {
4
+ dots: !0,
5
+ infinite: !1,
6
+ arrows: !1,
7
+ centerMode: !0,
8
+ centerPadding: "19px",
9
+ speed: 500,
10
+ rows: 1,
11
+ slidesToShow: 1,
12
+ slidesToScroll: 1,
13
+ appendDots: (e) => /* @__PURE__ */ o(t, { children: [
14
+ " ",
15
+ e,
16
+ " "
17
+ ] }),
18
+ customPaging: (e) => /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s("div", {}) }, e)
19
+ };
20
+ export {
21
+ n as settings
22
+ };
@@ -0,0 +1,11 @@
1
+ import { Gamification } from '@streamlayer/feature-gamification';
2
+ import { BetPackEventCb } from '../';
3
+ export declare const BetPackContent: React.FC<{
4
+ gamification: Gamification;
5
+ height?: number;
6
+ swipeable?: boolean;
7
+ autoplay?: boolean;
8
+ centerPadding?: string;
9
+ changeHeightOnInit: () => void;
10
+ onEvent: BetPackEventCb;
11
+ }>;
@@ -0,0 +1,116 @@
1
+ import { jsx as a, jsxs as j } from "react/jsx-runtime";
2
+ import { useCallback as v, useSyncExternalStore as C, useRef as b, useMemo as h, useEffect as S } from "react";
3
+ import { EmergencyScreen as R } from "./EmergencyScreen/index.js";
4
+ import { EndScreen as w } from "./EndScreen/index.js";
5
+ import { LoaderScreen as N } from "./LoaderScreen/index.js";
6
+ import { QuestionScreen as T } from "./QuestionScreen/index.js";
7
+ import { ScreenContainer as A } from "./ScreenContainer/index.js";
8
+ import { StartScreen as B } from "./StartScreen/index.js";
9
+ import { settings as P } from "./constants.js";
10
+ import { Carousel as F } from "./styles.js";
11
+ function I(t, n, f) {
12
+ let u = /* @__PURE__ */ new Set([...n, void 0]);
13
+ return t.listen((c, s, m) => {
14
+ u.has(m) && f(c, s, m);
15
+ });
16
+ }
17
+ function L(t, n = {}) {
18
+ let f = v(
19
+ (c) => n.keys ? I(t, n.keys, c) : t.listen(c),
20
+ [n.keys, t]
21
+ ), u = t.get.bind(t);
22
+ return C(f, u, u);
23
+ }
24
+ const W = ({ gamification: t, autoplay: n, swipeable: f, changeHeightOnInit: u, height: c, onEvent: s, centerPadding: m }) => {
25
+ const o = b(), i = b(null), { data: r, error: d, loading: k } = L(t.betPack.getStore()), { listOfQuestions: p, countQuestionsAvailable: x } = h(() => {
26
+ const e = r ? Object.values(r) : [];
27
+ return {
28
+ listOfQuestions: e,
29
+ countQuestionsAvailable: e.filter(({ marketClosed: l }) => !l).length
30
+ };
31
+ }, [r]);
32
+ S(() => {
33
+ !d && !k && r !== void 0 && s({
34
+ type: "slBetPackReady",
35
+ payload: {
36
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
37
+ // @ts-expect-error
38
+ next: () => {
39
+ var e;
40
+ return (e = i.current) == null ? void 0 : e.slickNext();
41
+ },
42
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43
+ // @ts-expect-error
44
+ prev: () => {
45
+ var e;
46
+ return (e = i.current) == null ? void 0 : e.slickPrev();
47
+ },
48
+ current: 0,
49
+ canNext: !0,
50
+ canPrev: !1
51
+ }
52
+ });
53
+ }, [r, d, k, s]);
54
+ const O = v(
55
+ async (e, l) => {
56
+ try {
57
+ await t.betPackVote(e, l);
58
+ } finally {
59
+ o.current && clearTimeout(o.current), n && (o.current = setTimeout(() => {
60
+ var y;
61
+ (y = i.current) == null || y.slickNext();
62
+ }, 2e3));
63
+ }
64
+ },
65
+ [t, i, n]
66
+ );
67
+ if (S(() => () => {
68
+ o.current && clearTimeout(o.current);
69
+ }, []), k || r === void 0)
70
+ return /* @__PURE__ */ a(N, {});
71
+ if (d || r === null || !Object.keys(r).length)
72
+ return /* @__PURE__ */ a(
73
+ R,
74
+ {
75
+ actionFn: () => s({ type: "slHardRefresh" }),
76
+ description: "It looks like we couldn't load the questions."
77
+ }
78
+ );
79
+ const Q = (e) => {
80
+ var l;
81
+ if (s({
82
+ type: "slBetPackChangeCard",
83
+ payload: {
84
+ current: e,
85
+ canNext: e < Object.keys(r).length + 1,
86
+ canPrev: e >= 1
87
+ }
88
+ }), e !== 0 && e !== Object.keys(r).length + 1 && ((l = p[e - 1]) != null && l.id)) {
89
+ t.openQuestion(p[e - 1].id);
90
+ return;
91
+ }
92
+ t.closeQuestion();
93
+ }, g = (e) => e ? /* @__PURE__ */ a(A, { height: c, children: /* @__PURE__ */ a(T, { question: e, vote: O }) }, e.id) : null;
94
+ return /* @__PURE__ */ j(
95
+ F,
96
+ {
97
+ ...P,
98
+ swipe: f,
99
+ onInit: u,
100
+ centerPadding: m || P.centerPadding,
101
+ afterChange: Q,
102
+ beforeChange: () => {
103
+ o.current && clearTimeout(o.current);
104
+ },
105
+ ref: i,
106
+ children: [
107
+ /* @__PURE__ */ a(B, { height: c, sliderRef: i, countQuestionsAvailable: x }),
108
+ Object.values(r).map(g),
109
+ /* @__PURE__ */ a(w, { onEvent: s, height: c })
110
+ ]
111
+ }
112
+ );
113
+ };
114
+ export {
115
+ W as BetPackContent
116
+ };
@@ -0,0 +1,3 @@
1
+ export declare const Carousel: any;
2
+ export declare const Dot: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Dots: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,20 @@
1
+ import { styled as s } from "@linaria/react";
2
+ import o from "react-slick";
3
+ const r = () => o, a = /* @__PURE__ */ s(r())({
4
+ name: "Carousel",
5
+ class: "c1f9jjsn",
6
+ propsAsIs: !0
7
+ }), l = /* @__PURE__ */ s("div")({
8
+ name: "Dot",
9
+ class: "d25r51y",
10
+ propsAsIs: !1
11
+ }), p = /* @__PURE__ */ s("div")({
12
+ name: "Dots",
13
+ class: "d1lvrmx8",
14
+ propsAsIs: !1
15
+ });
16
+ export {
17
+ a as Carousel,
18
+ l as Dot,
19
+ p as Dots
20
+ };
@@ -0,0 +1,12 @@
1
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
+ import { AllowedMessageType } from '../utils';
3
+ export type BetPackOverlayProps = {
4
+ sdk: StreamLayerSDK;
5
+ close: () => void;
6
+ isMobile?: boolean;
7
+ onEvent?: (event: {
8
+ type: AllowedMessageType;
9
+ payload?: unknown;
10
+ }) => void;
11
+ };
12
+ export declare const BetPackOverlay: React.FC<BetPackOverlayProps>;
@@ -0,0 +1,9 @@
1
+ import "react/jsx-runtime";
2
+ import "@linaria/core";
3
+ import "react";
4
+ import { BetPackOverlay as a } from "../index.js";
5
+ import "../../../../ui/icons/index.js";
6
+ import "./styles.js";
7
+ export {
8
+ a as BetPackOverlay
9
+ };
@@ -0,0 +1,10 @@
1
+ export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const CloseButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
3
+ export declare const buttonAvailable: import('@linaria/core').LinariaClassName;
4
+ export declare const IconArrowPrev: any;
5
+ export declare const IconArrowNext: any;
6
+ export declare const Header: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const HeaderTitle: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
8
+ export declare const Main: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
+ export declare const Footer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
10
+ export declare const SlideSwitchButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;