fansunited-frontend-components 0.0.97 → 0.0.99
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.
- package/Betslip.js +2 -2
- package/ChanceGame.js +958 -1464
- package/ClassicQuizPlay.js +2 -2
- package/CollectLead.js +1 -1
- package/CompetitionStatistics.js +2042 -2215
- package/CompetitorCard.js +4281 -4919
- package/Discussion.js +2 -2
- package/EitherOrPlay.js +2 -2
- package/EventCard.js +6010 -7547
- package/EventGamePlay.js +2 -2
- package/Leaderboard.js +546 -849
- package/List.js +227 -218
- package/MatchQuizPlay.js +2 -2
- package/Odds.js +50 -42
- package/PersonalityQuizPlay.js +2 -2
- package/PickThePair.js +2 -2
- package/PlayerOfTheMatch.js +285 -269
- package/PollVote.js +2 -2
- package/Predictor.js +80 -127
- package/README.md +1 -1
- package/Standings.js +991 -1324
- package/TopX.js +1120 -1167
- package/chunks/{ChanceGameEmbedVariant-CVys-3Zh.js → ChanceGameEmbedVariant-DM9eLG5s.js} +2 -2
- package/chunks/CheckCircle-I1FktW5Y.js +13 -0
- package/chunks/OddsSkeleton-DP5Yfqpr.js +522 -0
- package/chunks/Person-CXRqyF4E.js +11 -0
- package/chunks/PickOneOfX-DET4ZhjV.js +3117 -0
- package/chunks/Search-CIXthh0D.js +17 -0
- package/chunks/TimerOutlined-D-WA_vpE.js +8 -0
- package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +136 -0
- package/chunks/{chevrons-right-CXSpQt9w.js → chevrons-right-HWKW2c4I.js} +24 -4
- package/chunks/index-BENM3N_w.js +4 -0
- package/chunks/index-BRxAV693.js +4 -0
- package/chunks/index-BXYTsvIX.js +4 -0
- package/chunks/index-C0ilols1.js +4 -0
- package/chunks/index-D7VhczXH.js +4 -0
- package/chunks/index-DKwvdw9t.js +4 -0
- package/chunks/index-DZN-AITW.js +4 -0
- package/chunks/main-B2sDRFF4.js +2184 -0
- package/chunks/main-CzfWaEQP.js +4869 -0
- package/chunks/main-DFNl3g_U.js +4910 -0
- package/chunks/{main-65WcUqAl.js → main-DLwnvntz.js} +600 -593
- package/chunks/main-DiBlJBNb.js +1956 -0
- package/chunks/main-DxvBjXsd.js +1775 -0
- package/chunks/main-S8_NDSiY.js +3209 -0
- package/chunks/main-lBgr8Liq.js +6571 -0
- package/chunks/{withVersionStamp-BkiEu_79.js → withVersionStamp-BsLyhvNA.js} +1 -1
- package/package.json +2 -2
- package/chunks/OddsSkeleton-ClJE2xhR.js +0 -26
- package/chunks/OddsStrip-BnSp5TXa.js +0 -383
- package/chunks/PickOneOfX-DaJtkbCw.js +0 -4206
- package/chunks/chevron-left-CxfCSZcr.js +0 -13
- package/chunks/chevron-right-BEQMacFn.js +0 -13
- package/chunks/index-Aq5MbUB9.js +0 -4
- package/chunks/index-BBQm_8LD.js +0 -4
- package/chunks/index-BC_sWWgc.js +0 -4
- package/chunks/index-DXKDJ1Vp.js +0 -4
- package/chunks/index-DjT5NrbA.js +0 -4
- package/chunks/index-DvLRehH6.js +0 -4
- package/chunks/index-aIMaxR-p.js +0 -4
- package/chunks/main-52Wff7qC.js +0 -11441
- package/chunks/main-B58mi9jx.js +0 -5622
- package/chunks/main-BIdXUTZS.js +0 -7308
- package/chunks/main-DD-NEzC7.js +0 -8241
- package/chunks/main-DUnfJPzY.js +0 -3608
- package/chunks/main-DpCBqqg_.js +0 -1950
- package/chunks/main-Drznt1ak.js +0 -1790
- package/chunks/users-wbJRbqW8.js +0 -16
- package/chunks/x-CK4GYo7T.js +0 -14
|
@@ -0,0 +1,1775 @@
|
|
|
1
|
+
import { jsx as s, jsxs as S, Fragment as vt } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { WidgetPortal as wt } from "fansunited-frontend-core/ui/emotion";
|
|
3
|
+
import Y, { useState as k, useRef as M, useEffect as L, createContext as Ct, useMemo as tt, useCallback as X, useContext as Rt } from "react";
|
|
4
|
+
import { css as _, keyframes as U } from "@emotion/react";
|
|
5
|
+
import { isMobile as kt, useColors as _t, useFontFamily as It, useCurrentThemeMode as Et, useSpacingScale as O, useCornerRadius as A, useBorderSize as J, toIntlLocale as et, useDisableCache as Lt, fetchEventsByIds as Tt, getSportsApiCredentials as $t, fetchSearchEntitiesByIds as Ot, betslipApi as j } from "fansunited-frontend-core";
|
|
6
|
+
import { useTranslation as I } from "react-i18next";
|
|
7
|
+
import { MatchOddsFilters as At } from "fansunited-sdk-esm/models";
|
|
8
|
+
import { KeyboardArrowDownIcon as zt, KeyboardArrowUpIcon as Bt } from "fansunited-frontend-core/ui/icons";
|
|
9
|
+
function Dt(t, e, n, o, a, i) {
|
|
10
|
+
const l = o ?? "Away", r = e.toLowerCase(), m = (i == null ? void 0 : i.draw) || a("betslip.outcomes.draw"), b = (i == null ? void 0 : i.yes) || a("betslip.outcomes.yes"), h = (i == null ? void 0 : i.no) || a("betslip.outcomes.no"), c = (i == null ? void 0 : i.over) || a("betslip.outcomes.over"), p = (i == null ? void 0 : i.under) || a("betslip.outcomes.under"), d = (i == null ? void 0 : i.noGoal) || a("betslip.outcomes.noGoal"), f = (i == null ? void 0 : i.nobody) || a("betslip.outcomes.nobody"), g = (i == null ? void 0 : i.or) || a("betslip.outcomes.or");
|
|
11
|
+
switch (t) {
|
|
12
|
+
case "FT_1X2":
|
|
13
|
+
case "HT_1X2":
|
|
14
|
+
if (e === "1") return n;
|
|
15
|
+
if (r === "x") return m;
|
|
16
|
+
if (e === "2") return l;
|
|
17
|
+
break;
|
|
18
|
+
case "DOUBLE_CHANCE": {
|
|
19
|
+
const u = e.toUpperCase();
|
|
20
|
+
if (u === "1X") return `${n} ${g} ${m}`;
|
|
21
|
+
if (u === "12") return `${n} ${g} ${l}`;
|
|
22
|
+
if (u === "X2") return `${m} ${g} ${l}`;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
case "BOTH_TEAMS_SCORE":
|
|
26
|
+
case "RED_CARD_MATCH":
|
|
27
|
+
case "PENALTY_MATCH":
|
|
28
|
+
if (r === "yes") return b;
|
|
29
|
+
if (r === "no") return h;
|
|
30
|
+
break;
|
|
31
|
+
case "CORRECT_SCORE":
|
|
32
|
+
case "CORRECT_SCORE_ADVANCED":
|
|
33
|
+
case "CORRECT_SCORE_HT": {
|
|
34
|
+
const u = e.split(/[-:]/).map(Number);
|
|
35
|
+
return u.length === 2 && !isNaN(u[0]) && !isNaN(u[1]) ? u[0] > u[1] ? n : u[1] > u[0] ? l : m : e;
|
|
36
|
+
}
|
|
37
|
+
case "HT_FT": {
|
|
38
|
+
const u = e.toUpperCase();
|
|
39
|
+
return (u.includes("/") ? u.split("/") : u.split("")).map((w) => w === "1" ? n : w === "2" ? l : m).join(" / ");
|
|
40
|
+
}
|
|
41
|
+
case "DRAW_NO_BET":
|
|
42
|
+
if (e === "1") return n;
|
|
43
|
+
if (e === "2") return l;
|
|
44
|
+
break;
|
|
45
|
+
case "FIRST_TEAM_TO_SCORE":
|
|
46
|
+
case "LAST_TEAM_TO_SCORE":
|
|
47
|
+
if (e === "1") return n;
|
|
48
|
+
if (e === "2") return l;
|
|
49
|
+
if (r === "none" || r === "no goal") return d;
|
|
50
|
+
break;
|
|
51
|
+
case "PLAYER_SCORE_FIRST_GOAL":
|
|
52
|
+
case "PLAYER_SCORE":
|
|
53
|
+
case "PLAYER_SCORE_TWICE":
|
|
54
|
+
case "PLAYER_SCORE_HATTRICK":
|
|
55
|
+
case "PLAYER_RED_CARD":
|
|
56
|
+
case "PLAYER_YELLOW_CARD":
|
|
57
|
+
return r === "none" || r === "no goal" || r === "nobody" ? f : e;
|
|
58
|
+
}
|
|
59
|
+
const y = t.match(/^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i);
|
|
60
|
+
if (y) {
|
|
61
|
+
const w = y[1].toUpperCase() === "OVER" !== (r === "no" || r === "under") ? c : p, C = `${y[3]}.${y[4]}`;
|
|
62
|
+
return `${w} ${C}`;
|
|
63
|
+
}
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
function Ut(t) {
|
|
67
|
+
return `${t.eventId}:${t.market}:${t.outcome}`;
|
|
68
|
+
}
|
|
69
|
+
function Wt(t) {
|
|
70
|
+
var n;
|
|
71
|
+
const e = (n = t.participantTwo) == null ? void 0 : n.name;
|
|
72
|
+
return e ? `${t.participantOne.name} vs ${e}` : t.participantOne.name;
|
|
73
|
+
}
|
|
74
|
+
function Ft(t, e, n) {
|
|
75
|
+
return t.map((o) => {
|
|
76
|
+
var a, i, l;
|
|
77
|
+
return {
|
|
78
|
+
id: Ut(o),
|
|
79
|
+
eventId: o.eventId,
|
|
80
|
+
marketId: o.market,
|
|
81
|
+
event: Wt(o),
|
|
82
|
+
market: o.market,
|
|
83
|
+
name: Dt(
|
|
84
|
+
o.market,
|
|
85
|
+
o.outcome,
|
|
86
|
+
o.participantOne.name,
|
|
87
|
+
(a = o.participantTwo) == null ? void 0 : a.name,
|
|
88
|
+
e,
|
|
89
|
+
n
|
|
90
|
+
),
|
|
91
|
+
odds: 0,
|
|
92
|
+
outcome: o.outcome,
|
|
93
|
+
startAt: o.startAt,
|
|
94
|
+
matchStatus: o.matchStatus,
|
|
95
|
+
participantOne: o.participantOne.name,
|
|
96
|
+
participantTwo: (i = o.participantTwo) == null ? void 0 : i.name,
|
|
97
|
+
participantOneLogo: o.participantOne.logo,
|
|
98
|
+
participantTwoLogo: (l = o.participantTwo) == null ? void 0 : l.logo,
|
|
99
|
+
source: o.source,
|
|
100
|
+
competition: o.competition,
|
|
101
|
+
athlete: o.athlete
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const Ht = {
|
|
106
|
+
HT_FT: ["first_half_and_final_result", "htft", "ht_ft"],
|
|
107
|
+
BOTH_TEAMS_SCORE: ["both_to_score", "btts", "gg"],
|
|
108
|
+
DOUBLE_CHANCE: ["double_chance", "dc"],
|
|
109
|
+
CORRECT_SCORE: ["correct_score", "cs"],
|
|
110
|
+
PLAYER_SCORE_FIRST_GOAL: ["first_goalscorer", "player_score_first_goal"],
|
|
111
|
+
PLAYER_SCORE: ["anytime_goalscorer", "player_score", "anytime_scorer"],
|
|
112
|
+
PLAYER_RED_CARD: ["player_red_card", "red_card"],
|
|
113
|
+
PLAYER_YELLOW_CARD: ["player_yellow_card", "yellow_card"]
|
|
114
|
+
};
|
|
115
|
+
function Pt(t) {
|
|
116
|
+
return t.replace(/^FT_/i, "").toLowerCase();
|
|
117
|
+
}
|
|
118
|
+
const ft = /^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i;
|
|
119
|
+
function Nt(t, e) {
|
|
120
|
+
const n = t.toLowerCase();
|
|
121
|
+
if (n === e.toLowerCase() || n === Pt(e)) return !0;
|
|
122
|
+
const o = Ht[e];
|
|
123
|
+
return !!(o !== void 0 && o.includes(n) || ft.test(e) && n === "over_under");
|
|
124
|
+
}
|
|
125
|
+
function Mt(t) {
|
|
126
|
+
const e = t.split(":");
|
|
127
|
+
return e[e.length - 1];
|
|
128
|
+
}
|
|
129
|
+
function gt(t, e, n) {
|
|
130
|
+
var m, b, h, c, p, d;
|
|
131
|
+
if (!t) return null;
|
|
132
|
+
const o = Mt(n), a = e.match(ft), i = a !== null, l = i ? o.toLowerCase() === "no" ? "under" : o.toLowerCase() === "yes" ? "over" : o.toLowerCase() : null, r = i ? `${a[3]}.${a[4]}` : null;
|
|
133
|
+
for (const f of t.markets ?? []) {
|
|
134
|
+
const g = ((m = f == null ? void 0 : f.type) == null ? void 0 : m.code) ?? "";
|
|
135
|
+
if (!Nt(g, e)) continue;
|
|
136
|
+
const y = g.toLowerCase() !== "over_under";
|
|
137
|
+
for (const u of f.selections ?? [])
|
|
138
|
+
if (i) {
|
|
139
|
+
const x = ((b = u.code) == null ? void 0 : b.toLowerCase()) === l || ((h = u.name) == null ? void 0 : h.toLowerCase()) === l, w = y || r === null || ((c = u.value) == null ? void 0 : c.toString()) === r;
|
|
140
|
+
if (x && w) return u;
|
|
141
|
+
} else if (((p = u.code) == null ? void 0 : p.toLowerCase()) === o.toLowerCase() || ((d = u.name) == null ? void 0 : d.toLowerCase()) === o.toLowerCase())
|
|
142
|
+
return u;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
function jt(t, e, n, o, a) {
|
|
147
|
+
if (!t || !e.includes(o) || !t.has(n)) return !1;
|
|
148
|
+
const i = (t.get(n) ?? [])[0];
|
|
149
|
+
return gt(i, o, a) === null;
|
|
150
|
+
}
|
|
151
|
+
function Yt(t, e) {
|
|
152
|
+
return t.map((n) => {
|
|
153
|
+
var i, l, r;
|
|
154
|
+
const o = (e.get(n.eventId) ?? [])[0], a = gt(o, n.marketId, n.id);
|
|
155
|
+
return a ? {
|
|
156
|
+
...n,
|
|
157
|
+
odds: parseFloat(a.odds ?? "0") || 0,
|
|
158
|
+
movement: a.movement === "UP" || a.movement === "DOWN" ? a.movement : void 0,
|
|
159
|
+
// providerInfo.selectionId is the operator's own id, which is what the CTA
|
|
160
|
+
// deep link needs. selection.id is only the outcome code ("1") now.
|
|
161
|
+
selectionId: ((i = a.providerInfo) == null ? void 0 : i.selectionId) ?? a.id ?? void 0,
|
|
162
|
+
selectionUrl: ((r = (l = a.urls) == null ? void 0 : l[0]) == null ? void 0 : r.url) ?? void 0
|
|
163
|
+
} : n;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function Vt(t, e, n, o = {}) {
|
|
167
|
+
const { operatorId: a, affiliateId: i } = o, [l, r] = k(null), [m, b] = k([]), [h, c] = k(!1), p = M(null), d = async (f) => {
|
|
168
|
+
if (!t || f.length === 0) return;
|
|
169
|
+
const g = [...new Set(f.map((x) => x.eventId))], y = [
|
|
170
|
+
...new Set(f.map((x) => x.market))
|
|
171
|
+
], u = new At({
|
|
172
|
+
marketTypes: y,
|
|
173
|
+
...a ? { operators: [a] } : {},
|
|
174
|
+
...i ? { affiliateId: i } : {}
|
|
175
|
+
});
|
|
176
|
+
c(!0);
|
|
177
|
+
try {
|
|
178
|
+
const x = await t.odds.getByMatchIds(g, u);
|
|
179
|
+
r(x), b(y);
|
|
180
|
+
} catch {
|
|
181
|
+
} finally {
|
|
182
|
+
c(!1);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
return L(() => (d(e), p.current && clearInterval(p.current), t && n > 0 && e.length > 0 && (p.current = setInterval(() => d(e), n)), () => {
|
|
186
|
+
p.current && clearInterval(p.current);
|
|
187
|
+
}), [JSON.stringify(e), n, a, i]), { oddsMap: l, oddsLoading: h, oddsMarkets: m };
|
|
188
|
+
}
|
|
189
|
+
function Gt(t) {
|
|
190
|
+
var e, n, o;
|
|
191
|
+
for (const a of t.values()) {
|
|
192
|
+
const i = a[0];
|
|
193
|
+
if (!i) continue;
|
|
194
|
+
const l = (o = (n = (e = i.bookmaker) == null ? void 0 : e.assets) == null ? void 0 : n[0]) == null ? void 0 : o.transparentBackgroundUrl;
|
|
195
|
+
if (l) return l;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function Xt(t, e) {
|
|
199
|
+
var o;
|
|
200
|
+
const n = e ? "mobile" : "desktop";
|
|
201
|
+
for (const a of t.values()) {
|
|
202
|
+
const i = a[0];
|
|
203
|
+
if (!i) continue;
|
|
204
|
+
const l = ((o = i.bookmaker) == null ? void 0 : o.links) ?? [], r = l.find((m) => m.appType === n) ?? l[0];
|
|
205
|
+
if (r != null && r.homepageUrl) return r.homepageUrl;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function Kt(t, e) {
|
|
209
|
+
var o, a;
|
|
210
|
+
const n = e ? "mobile" : "desktop";
|
|
211
|
+
for (const i of t.values()) {
|
|
212
|
+
const l = ((a = (o = i[0]) == null ? void 0 : o.bookmaker) == null ? void 0 : a.betslipUrlTemplate) ?? [], r = l.find((m) => m.appType === n) ?? l[0];
|
|
213
|
+
if (r != null && r.url) return r.url;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function Jt(t) {
|
|
217
|
+
var e, n;
|
|
218
|
+
for (const o of t.values()) {
|
|
219
|
+
const a = (n = (e = o[0]) == null ? void 0 : e.bookmaker) == null ? void 0 : n.betslipIdSeparator;
|
|
220
|
+
if (a) return a;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function qt(t) {
|
|
224
|
+
var e, n, o, a, i;
|
|
225
|
+
for (const l of t.values()) {
|
|
226
|
+
const r = l[0];
|
|
227
|
+
if (!r) continue;
|
|
228
|
+
const m = ((n = (e = r.bookmaker) == null ? void 0 : e.branding) == null ? void 0 : n.backgroundColor) ?? ((i = (a = (o = r.bookmaker) == null ? void 0 : o.assets) == null ? void 0 : a[0]) == null ? void 0 : i.backgroundColor);
|
|
229
|
+
if (m) return m;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const ht = Ct(null), Qt = ({
|
|
233
|
+
labels: t = {},
|
|
234
|
+
initialSelections: e = [],
|
|
235
|
+
maxSelections: n,
|
|
236
|
+
currency: o = "€",
|
|
237
|
+
stakePresets: a = [5, 10, 20],
|
|
238
|
+
ctaUrlTemplate: i,
|
|
239
|
+
onExternalRemove: l,
|
|
240
|
+
sharedOddsMap: r,
|
|
241
|
+
children: m
|
|
242
|
+
}) => {
|
|
243
|
+
const { t: b } = I(), [h, c] = k(e), [p, d] = k(""), [f, g] = k(!0), y = kt();
|
|
244
|
+
L(() => {
|
|
245
|
+
c(e);
|
|
246
|
+
}, [JSON.stringify(e)]);
|
|
247
|
+
const u = tt(() => {
|
|
248
|
+
if (!r) return !1;
|
|
249
|
+
const R = r.values().next().value;
|
|
250
|
+
return Array.isArray(R) && R[0] !== void 0;
|
|
251
|
+
}, [r]), x = tt(() => {
|
|
252
|
+
const R = Ft(h, b, t.outcomeLabels);
|
|
253
|
+
return r ? Yt(R, r) : R;
|
|
254
|
+
}, [h, r, b, t.outcomeLabels]), w = r ? Gt(r) : void 0, C = r ? Xt(r, y) : void 0, v = r ? qt(r) : void 0, T = r ? Kt(r, y) : void 0, W = r ? Jt(r) : void 0, F = X(
|
|
255
|
+
(R) => {
|
|
256
|
+
c(
|
|
257
|
+
(H) => H.filter((z) => `${z.eventId}:${z.market}:${z.outcome}` !== R)
|
|
258
|
+
), l == null || l(R);
|
|
259
|
+
},
|
|
260
|
+
[l]
|
|
261
|
+
);
|
|
262
|
+
return /* @__PURE__ */ s(
|
|
263
|
+
ht.Provider,
|
|
264
|
+
{
|
|
265
|
+
value: {
|
|
266
|
+
labels: t,
|
|
267
|
+
selectionInputs: h,
|
|
268
|
+
selections: x,
|
|
269
|
+
combStake: p,
|
|
270
|
+
open: f,
|
|
271
|
+
oddsLoading: !1,
|
|
272
|
+
oddsReady: u,
|
|
273
|
+
currency: o,
|
|
274
|
+
stakePresets: a,
|
|
275
|
+
ctaUrlTemplate: i,
|
|
276
|
+
maxSelections: n,
|
|
277
|
+
bookmakerLogoUrl: w,
|
|
278
|
+
bookmakerHomepageUrl: C,
|
|
279
|
+
bookmakerBackgroundColor: v,
|
|
280
|
+
bookmakerBetslipTemplate: T,
|
|
281
|
+
bookmakerIdSeparator: W,
|
|
282
|
+
onRemove: F,
|
|
283
|
+
setCombStake: d,
|
|
284
|
+
setOpen: g
|
|
285
|
+
},
|
|
286
|
+
children: m
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}, E = () => {
|
|
290
|
+
const t = Rt(ht);
|
|
291
|
+
if (!t) throw new Error("useBetslip must be used within BetslipProvider");
|
|
292
|
+
return t;
|
|
293
|
+
};
|
|
294
|
+
function Zt(t) {
|
|
295
|
+
const e = _t(), n = It(), a = Et() === "light";
|
|
296
|
+
return {
|
|
297
|
+
primary: t || e.palette.primary.plainColor,
|
|
298
|
+
primaryHover: e.palette.primary.primaryContainer || t || e.palette.primary.plainColor,
|
|
299
|
+
s1: e.surface,
|
|
300
|
+
s2: e.onSurface,
|
|
301
|
+
s3: a ? e.surfaceVariant : e.onSurface,
|
|
302
|
+
bdr: e.outlineEnabledBorder,
|
|
303
|
+
t1: e.textPrimary,
|
|
304
|
+
t2: e.textSecondary,
|
|
305
|
+
t3: e.textDisabled,
|
|
306
|
+
ok: e.palette.success.plainColor,
|
|
307
|
+
bad: e.palette.danger.plainColor,
|
|
308
|
+
warn: e.palette.warning.plainColor,
|
|
309
|
+
font: n.primary
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const B = {
|
|
313
|
+
primary: "var(--fu-ucrc-bs-primary)",
|
|
314
|
+
primaryHover: "var(--fu-ucrc-bs-primary-hover)",
|
|
315
|
+
s3: "var(--fu-ucrc-bs-s3)",
|
|
316
|
+
t3: "var(--fu-ucrc-bs-t3)"
|
|
317
|
+
}, te = (t) => Y.useMemo(
|
|
318
|
+
() => ({
|
|
319
|
+
"--fu-ucrc-bs-primary": t.primary,
|
|
320
|
+
"--fu-ucrc-bs-primary-hover": t.primaryHover,
|
|
321
|
+
"--fu-ucrc-bs-s3": t.s3,
|
|
322
|
+
"--fu-ucrc-bs-t3": t.t3
|
|
323
|
+
}),
|
|
324
|
+
[t.primary, t.primaryHover, t.s3, t.t3]
|
|
325
|
+
), nt = ({
|
|
326
|
+
tokens: t,
|
|
327
|
+
isSide: e,
|
|
328
|
+
position: n,
|
|
329
|
+
brandingLogoUrl: o
|
|
330
|
+
}) => {
|
|
331
|
+
const { labels: a, selections: i, open: l, setOpen: r, maxSelections: m, bookmakerLogoUrl: b } = E(), { t: h } = I(), c = O(), p = A(), g = e ? "0" : n === "bottom-right" || n === "bottom-left" ? `${p.md} ${p.md} 0 0` : n === "top-right" || n === "top-left" ? `0 0 ${p.md} ${p.md}` : "0", y = o || b, u = {
|
|
332
|
+
background: "none",
|
|
333
|
+
border: "none",
|
|
334
|
+
cursor: "pointer",
|
|
335
|
+
color: "#fff",
|
|
336
|
+
padding: "5px 7px",
|
|
337
|
+
fontSize: "1em",
|
|
338
|
+
lineHeight: 1,
|
|
339
|
+
borderRadius: p.xs,
|
|
340
|
+
display: "flex",
|
|
341
|
+
alignItems: "center",
|
|
342
|
+
justifyContent: "center",
|
|
343
|
+
transition: "background .15s"
|
|
344
|
+
};
|
|
345
|
+
return /* @__PURE__ */ S(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
style: {
|
|
349
|
+
paddingTop: c.sm,
|
|
350
|
+
paddingBottom: c.sm,
|
|
351
|
+
paddingInlineEnd: c.xs,
|
|
352
|
+
paddingInlineStart: y ? c["2xs"] : c.xs,
|
|
353
|
+
background: t.primary,
|
|
354
|
+
display: "flex",
|
|
355
|
+
alignItems: "center",
|
|
356
|
+
justifyContent: "space-between",
|
|
357
|
+
flexShrink: 0,
|
|
358
|
+
color: "#fff",
|
|
359
|
+
borderRadius: g,
|
|
360
|
+
fontFamily: t.font
|
|
361
|
+
},
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ S("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
364
|
+
y ? /* @__PURE__ */ s(
|
|
365
|
+
"img",
|
|
366
|
+
{
|
|
367
|
+
src: y,
|
|
368
|
+
alt: "brand",
|
|
369
|
+
style: {
|
|
370
|
+
height: "24px",
|
|
371
|
+
maxWidth: "88px",
|
|
372
|
+
width: "auto",
|
|
373
|
+
objectFit: "contain",
|
|
374
|
+
display: "block",
|
|
375
|
+
flexShrink: 0
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
) : /* @__PURE__ */ s(
|
|
379
|
+
"span",
|
|
380
|
+
{
|
|
381
|
+
style: {
|
|
382
|
+
fontSize: "1.0625em",
|
|
383
|
+
fontWeight: 800,
|
|
384
|
+
fontStyle: "italic",
|
|
385
|
+
fontFamily: "'Ubuntu', sans-serif",
|
|
386
|
+
letterSpacing: "-0.5px",
|
|
387
|
+
color: "#fff"
|
|
388
|
+
},
|
|
389
|
+
children: a.title || h("betslip.title")
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
i.length > 0 && m != null && /* @__PURE__ */ S(
|
|
393
|
+
"span",
|
|
394
|
+
{
|
|
395
|
+
style: {
|
|
396
|
+
fontSize: "0.875em",
|
|
397
|
+
fontWeight: 600,
|
|
398
|
+
color: "#fff",
|
|
399
|
+
marginInlineStart: y ? 0 : c.sm
|
|
400
|
+
},
|
|
401
|
+
children: [
|
|
402
|
+
i.length,
|
|
403
|
+
"/",
|
|
404
|
+
m
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
] }),
|
|
409
|
+
!e && /* @__PURE__ */ s(
|
|
410
|
+
"button",
|
|
411
|
+
{
|
|
412
|
+
style: u,
|
|
413
|
+
onClick: () => r(!l),
|
|
414
|
+
title: l ? "Collapse" : "Expand",
|
|
415
|
+
onMouseEnter: (x) => x.currentTarget.style.background = "rgba(255,255,255,.18)",
|
|
416
|
+
onMouseLeave: (x) => x.currentTarget.style.background = "none",
|
|
417
|
+
children: l ? /* @__PURE__ */ s(zt, { size: "1.125em" }) : /* @__PURE__ */ s(Bt, { size: "1.125em" })
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
};
|
|
424
|
+
function bt(t) {
|
|
425
|
+
return t.filter((e) => e.status === "active" || !e.status).reduce((e, n) => e * n.odds, 1);
|
|
426
|
+
}
|
|
427
|
+
function ee(t, e, n, o = ",") {
|
|
428
|
+
const a = e.map((h) => h.selectionId).filter((h) => !!h), i = a.join(","), l = a.map(encodeURIComponent).join(o), r = e[0], m = encodeURIComponent(
|
|
429
|
+
typeof window < "u" ? window.location.href : ""
|
|
430
|
+
), b = String(n);
|
|
431
|
+
return t.replace(/\{betslip_ids\}/g, l).replace(/\{selectionIds\}/g, encodeURIComponent(i)).replace(/\{currentUrl\}/g, m).replace(/\{stake\}/g, b).replace(/\{eventId\}/g, (r == null ? void 0 : r.eventId) ?? "").replace(/\{oddsDecimal\}/g, r ? String(r.odds) : "").replace(/\{market\}/g, (r == null ? void 0 : r.marketId) ?? "").replace(/\{outcome\}/g, (r == null ? void 0 : r.name) ?? "");
|
|
432
|
+
}
|
|
433
|
+
const ot = (t) => _({
|
|
434
|
+
display: "flex",
|
|
435
|
+
alignItems: "center",
|
|
436
|
+
justifyContent: "center",
|
|
437
|
+
width: "100%",
|
|
438
|
+
background: B.primary,
|
|
439
|
+
color: "#fff",
|
|
440
|
+
border: "none",
|
|
441
|
+
fontWeight: 600,
|
|
442
|
+
textDecoration: "none",
|
|
443
|
+
boxSizing: "border-box",
|
|
444
|
+
cursor: t ? "not-allowed" : "pointer",
|
|
445
|
+
pointerEvents: t ? "none" : "auto",
|
|
446
|
+
opacity: t ? 0.4 : 1,
|
|
447
|
+
"&:hover": { background: B.primaryHover }
|
|
448
|
+
}), rt = { enabled: ot(!1), disabled: ot(!0) }, yt = ({
|
|
449
|
+
tokens: t,
|
|
450
|
+
brandingLogoUrl: e
|
|
451
|
+
}) => {
|
|
452
|
+
const {
|
|
453
|
+
labels: n,
|
|
454
|
+
ctaUrlTemplate: o,
|
|
455
|
+
selections: a,
|
|
456
|
+
combStake: i,
|
|
457
|
+
bookmakerLogoUrl: l,
|
|
458
|
+
bookmakerHomepageUrl: r,
|
|
459
|
+
bookmakerBetslipTemplate: m,
|
|
460
|
+
bookmakerIdSeparator: b
|
|
461
|
+
} = E(), { t: h } = I(), c = e || l, p = O(), d = A(), f = n.continueLabel || h("betslip.continueLabel"), g = (() => {
|
|
462
|
+
const u = parseFloat(i) || 0, x = o || m;
|
|
463
|
+
if (x)
|
|
464
|
+
return ee(x, a, u, b);
|
|
465
|
+
if (r) return r;
|
|
466
|
+
})(), y = !g;
|
|
467
|
+
return /* @__PURE__ */ s("div", { children: /* @__PURE__ */ S(
|
|
468
|
+
"a",
|
|
469
|
+
{
|
|
470
|
+
href: y ? void 0 : g,
|
|
471
|
+
target: g ? "_blank" : void 0,
|
|
472
|
+
rel: g ? "noopener noreferrer" : void 0,
|
|
473
|
+
css: y ? rt.disabled : rt.enabled,
|
|
474
|
+
style: {
|
|
475
|
+
padding: `${p.xs} ${p.md}`,
|
|
476
|
+
borderRadius: d.full,
|
|
477
|
+
fontSize: "0.875em",
|
|
478
|
+
fontFamily: t.font
|
|
479
|
+
},
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ s("span", { children: f }),
|
|
482
|
+
c && /* @__PURE__ */ s(
|
|
483
|
+
"img",
|
|
484
|
+
{
|
|
485
|
+
src: c,
|
|
486
|
+
alt: "",
|
|
487
|
+
style: {
|
|
488
|
+
height: "20px",
|
|
489
|
+
maxWidth: "72px",
|
|
490
|
+
width: "auto",
|
|
491
|
+
objectFit: "contain",
|
|
492
|
+
verticalAlign: "middle",
|
|
493
|
+
marginInlineStart: p.sm,
|
|
494
|
+
flexShrink: 0
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
) });
|
|
501
|
+
}, it = ({ color: t }) => {
|
|
502
|
+
const e = J();
|
|
503
|
+
return /* @__PURE__ */ s("div", { style: { borderBottom: `${e.size} solid ${t}` } });
|
|
504
|
+
}, ne = ({
|
|
505
|
+
tokens: t,
|
|
506
|
+
brandingLogoUrl: e
|
|
507
|
+
}) => {
|
|
508
|
+
const { labels: n, selections: o, combStake: a, currency: i } = E(), { t: l } = I(), r = O(), m = o.filter(
|
|
509
|
+
(d) => d.status === "active" || !d.status
|
|
510
|
+
), b = bt(m), h = parseFloat(a) || 0, c = h * b, p = {
|
|
511
|
+
display: "flex",
|
|
512
|
+
justifyContent: "space-between",
|
|
513
|
+
alignItems: "center",
|
|
514
|
+
padding: "6px 0"
|
|
515
|
+
};
|
|
516
|
+
return /* @__PURE__ */ S(
|
|
517
|
+
"div",
|
|
518
|
+
{
|
|
519
|
+
style: {
|
|
520
|
+
background: t.s1,
|
|
521
|
+
padding: `10px 14px ${r.sm}`,
|
|
522
|
+
fontFamily: t.font
|
|
523
|
+
},
|
|
524
|
+
children: [
|
|
525
|
+
/* @__PURE__ */ S("div", { style: p, children: [
|
|
526
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.6875em", color: t.t3 }, children: n.combinedOddsLabel || l("betslip.combinedOddsLabel") }),
|
|
527
|
+
/* @__PURE__ */ S(
|
|
528
|
+
"span",
|
|
529
|
+
{
|
|
530
|
+
style: {
|
|
531
|
+
fontSize: "0.6875em",
|
|
532
|
+
color: t.t1,
|
|
533
|
+
fontWeight: 600,
|
|
534
|
+
display: "flex",
|
|
535
|
+
alignItems: "center",
|
|
536
|
+
gap: 3
|
|
537
|
+
},
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.5em", color: t.ok }, children: "▲" }),
|
|
540
|
+
b.toFixed(2)
|
|
541
|
+
]
|
|
542
|
+
}
|
|
543
|
+
)
|
|
544
|
+
] }),
|
|
545
|
+
/* @__PURE__ */ s(it, { color: t.bdr }),
|
|
546
|
+
/* @__PURE__ */ S("div", { style: p, children: [
|
|
547
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.totalStakeLabel || l("betslip.totalStakeLabel") }),
|
|
548
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: h > 0 ? `${h.toFixed(2)}${i}` : "—" })
|
|
549
|
+
] }),
|
|
550
|
+
/* @__PURE__ */ s(it, { color: t.bdr }),
|
|
551
|
+
/* @__PURE__ */ S("div", { style: { ...p, borderBottom: "none", marginBottom: 10 }, children: [
|
|
552
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.potentialWinLabel || l("betslip.potentialWinLabel") }),
|
|
553
|
+
/* @__PURE__ */ s(
|
|
554
|
+
"span",
|
|
555
|
+
{
|
|
556
|
+
style: {
|
|
557
|
+
fontSize: "0.8125em",
|
|
558
|
+
fontWeight: 700,
|
|
559
|
+
color: c > 0 ? t.primary : t.t1
|
|
560
|
+
},
|
|
561
|
+
children: c > 0 ? c.toFixed(2) : "—"
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
] }),
|
|
565
|
+
/* @__PURE__ */ s(
|
|
566
|
+
yt,
|
|
567
|
+
{
|
|
568
|
+
tokens: t,
|
|
569
|
+
brandingLogoUrl: e
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
};
|
|
576
|
+
function oe(t, e, n) {
|
|
577
|
+
if (n != null && n[t]) return n[t];
|
|
578
|
+
const o = `betslip.markets.${t}`, a = e(o);
|
|
579
|
+
if (a !== o) return a;
|
|
580
|
+
const i = t.match(/^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i);
|
|
581
|
+
if (i) {
|
|
582
|
+
const l = i[2].charAt(0) + i[2].slice(1).toLowerCase(), r = `betslip.markets.${i[1].toUpperCase() === "OVER" ? "over" : "under"}${l}`, m = `${i[3]}.${i[4]}`, b = e(r, { line: m });
|
|
583
|
+
if (b !== r) return b;
|
|
584
|
+
}
|
|
585
|
+
return t.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (l) => l.toUpperCase());
|
|
586
|
+
}
|
|
587
|
+
const re = U`
|
|
588
|
+
from { opacity: 0; transform: translateX(8px); }
|
|
589
|
+
to { opacity: 1; transform: translateX(0); }
|
|
590
|
+
`, ie = U`
|
|
591
|
+
from { transform: rotate(0deg); }
|
|
592
|
+
to { transform: rotate(360deg); }
|
|
593
|
+
`, ae = () => /* @__PURE__ */ s("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M7 4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1h3a1 1 0 1 1 0 2h-1l-1.4 13.2A2 2 0 0 1 16.6 22H7.4a2 2 0 0 1-2-1.8L4 7H3a1 1 0 1 1 0-2h3V4zm2 0v1h6V4H9zm-3 3 1.4 12h9.2L18 7H6zm4 2a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1z" }) }), se = U`
|
|
594
|
+
0%, 100% { opacity: 1; }
|
|
595
|
+
50% { opacity: 0.2; }
|
|
596
|
+
`, K = {
|
|
597
|
+
card: _({ animation: `${re} 0.18s ease` }),
|
|
598
|
+
spinner: _({
|
|
599
|
+
width: "12px",
|
|
600
|
+
height: "12px",
|
|
601
|
+
borderRadius: "50%",
|
|
602
|
+
border: "2px solid transparent",
|
|
603
|
+
borderTopColor: B.t3,
|
|
604
|
+
animation: `${ie} 0.7s linear infinite`,
|
|
605
|
+
flexShrink: 0
|
|
606
|
+
}),
|
|
607
|
+
pulseDot: _({
|
|
608
|
+
width: "5px",
|
|
609
|
+
height: "5px",
|
|
610
|
+
borderRadius: "50%",
|
|
611
|
+
background: "#fff",
|
|
612
|
+
flexShrink: 0,
|
|
613
|
+
animation: `${se} 1s ease-in-out infinite`
|
|
614
|
+
})
|
|
615
|
+
};
|
|
616
|
+
function le(t, e, n) {
|
|
617
|
+
if (!t) return "";
|
|
618
|
+
const o = new Date(t);
|
|
619
|
+
if (isNaN(o.getTime())) return "";
|
|
620
|
+
const a = /* @__PURE__ */ new Date(), i = a.toDateString(), l = new Date(a.getTime() + 864e5).toDateString(), r = o.toLocaleTimeString(et(e), {
|
|
621
|
+
hour: "2-digit",
|
|
622
|
+
minute: "2-digit"
|
|
623
|
+
});
|
|
624
|
+
return o.toDateString() === i ? `${n("betslip.today")} ${r}` : o.toDateString() === l ? `${n("betslip.tomorrow")} ${r}` : `${o.toLocaleDateString(et(e), { month: "short", day: "numeric" })} ${r}`;
|
|
625
|
+
}
|
|
626
|
+
const at = ({
|
|
627
|
+
logo: t,
|
|
628
|
+
name: e,
|
|
629
|
+
tokens: n,
|
|
630
|
+
size: o = 18
|
|
631
|
+
}) => /* @__PURE__ */ s(
|
|
632
|
+
"div",
|
|
633
|
+
{
|
|
634
|
+
style: {
|
|
635
|
+
width: o,
|
|
636
|
+
height: o,
|
|
637
|
+
borderRadius: "50%",
|
|
638
|
+
background: n.s2,
|
|
639
|
+
flexShrink: 0,
|
|
640
|
+
display: "flex",
|
|
641
|
+
alignItems: "center",
|
|
642
|
+
justifyContent: "center",
|
|
643
|
+
fontSize: o * 0.55,
|
|
644
|
+
overflow: "hidden"
|
|
645
|
+
},
|
|
646
|
+
children: t ? /* @__PURE__ */ s(
|
|
647
|
+
"img",
|
|
648
|
+
{
|
|
649
|
+
src: t,
|
|
650
|
+
alt: e,
|
|
651
|
+
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
652
|
+
}
|
|
653
|
+
) : /* @__PURE__ */ s("span", { style: { color: n.t2, fontWeight: 700 }, children: e.charAt(0) })
|
|
654
|
+
}
|
|
655
|
+
), ce = ({ avatar: t, name: e, tokens: n }) => /* @__PURE__ */ s(
|
|
656
|
+
"div",
|
|
657
|
+
{
|
|
658
|
+
style: {
|
|
659
|
+
width: 22,
|
|
660
|
+
height: 22,
|
|
661
|
+
borderRadius: "50%",
|
|
662
|
+
flexShrink: 0,
|
|
663
|
+
background: n.s2,
|
|
664
|
+
overflow: "hidden",
|
|
665
|
+
display: "flex",
|
|
666
|
+
alignItems: "center",
|
|
667
|
+
justifyContent: "center",
|
|
668
|
+
fontSize: "0.6875em",
|
|
669
|
+
fontWeight: 700
|
|
670
|
+
},
|
|
671
|
+
children: t ? /* @__PURE__ */ s(
|
|
672
|
+
"img",
|
|
673
|
+
{
|
|
674
|
+
src: t,
|
|
675
|
+
alt: e,
|
|
676
|
+
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
677
|
+
}
|
|
678
|
+
) : /* @__PURE__ */ s("span", { style: { color: n.t2 }, children: e.charAt(0) })
|
|
679
|
+
}
|
|
680
|
+
), de = ({ name: t, logo: e, tokens: n }) => {
|
|
681
|
+
const o = O(), a = A(), [i, l] = Y.useState(!1);
|
|
682
|
+
return e ? /* @__PURE__ */ S(
|
|
683
|
+
"div",
|
|
684
|
+
{
|
|
685
|
+
style: { position: "relative", display: "inline-flex" },
|
|
686
|
+
onMouseEnter: () => l(!0),
|
|
687
|
+
onMouseLeave: () => l(!1),
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ s(
|
|
690
|
+
"div",
|
|
691
|
+
{
|
|
692
|
+
style: {
|
|
693
|
+
width: 20,
|
|
694
|
+
height: 20,
|
|
695
|
+
borderRadius: "50%",
|
|
696
|
+
overflow: "hidden",
|
|
697
|
+
background: n.s2,
|
|
698
|
+
flexShrink: 0
|
|
699
|
+
},
|
|
700
|
+
children: /* @__PURE__ */ s(
|
|
701
|
+
"img",
|
|
702
|
+
{
|
|
703
|
+
src: e,
|
|
704
|
+
alt: t,
|
|
705
|
+
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
706
|
+
}
|
|
707
|
+
)
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
i && /* @__PURE__ */ s(
|
|
711
|
+
"div",
|
|
712
|
+
{
|
|
713
|
+
style: {
|
|
714
|
+
position: "absolute",
|
|
715
|
+
top: "calc(100% + 5px)",
|
|
716
|
+
insetInlineEnd: 0,
|
|
717
|
+
background: "#1e293b",
|
|
718
|
+
color: "#fff",
|
|
719
|
+
fontSize: "0.6875em",
|
|
720
|
+
fontWeight: 500,
|
|
721
|
+
padding: `${o["2xs"]} ${o.xs}`,
|
|
722
|
+
borderRadius: a.xs,
|
|
723
|
+
whiteSpace: "nowrap",
|
|
724
|
+
zIndex: 10,
|
|
725
|
+
pointerEvents: "none",
|
|
726
|
+
boxShadow: "0 2px 8px rgba(0,0,0,.25)"
|
|
727
|
+
},
|
|
728
|
+
children: t
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
) : /* @__PURE__ */ s(
|
|
734
|
+
"span",
|
|
735
|
+
{
|
|
736
|
+
style: { fontSize: "0.625em", color: n.t3, whiteSpace: "nowrap" },
|
|
737
|
+
children: t
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
}, st = ({
|
|
741
|
+
score: t,
|
|
742
|
+
tokens: e
|
|
743
|
+
}) => {
|
|
744
|
+
const n = O(), o = A();
|
|
745
|
+
return /* @__PURE__ */ s(
|
|
746
|
+
"span",
|
|
747
|
+
{
|
|
748
|
+
style: {
|
|
749
|
+
background: e.s1,
|
|
750
|
+
color: e.t1,
|
|
751
|
+
fontWeight: 700,
|
|
752
|
+
fontSize: "0.75em",
|
|
753
|
+
borderRadius: o.xs,
|
|
754
|
+
minWidth: 20,
|
|
755
|
+
height: 20,
|
|
756
|
+
display: "inline-flex",
|
|
757
|
+
alignItems: "center",
|
|
758
|
+
justifyContent: "center",
|
|
759
|
+
flexShrink: 0,
|
|
760
|
+
padding: `0 ${n["2xs"]}`
|
|
761
|
+
},
|
|
762
|
+
children: t
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
}, pe = ({
|
|
766
|
+
sel: t,
|
|
767
|
+
tokens: e
|
|
768
|
+
}) => {
|
|
769
|
+
const { labels: n, oddsLoading: o } = E(), { t: a } = I(), { status: i, odds: l, movement: r } = t;
|
|
770
|
+
return i === "settled_won" ? /* @__PURE__ */ S("span", { style: { color: e.ok, fontSize: "0.8125em", fontWeight: 700 }, children: [
|
|
771
|
+
"✓ ",
|
|
772
|
+
a("betslip.settledWon")
|
|
773
|
+
] }) : i === "settled_lost" ? /* @__PURE__ */ S(
|
|
774
|
+
"span",
|
|
775
|
+
{
|
|
776
|
+
style: { color: e.bad, fontSize: "0.8125em", fontWeight: 700 },
|
|
777
|
+
children: [
|
|
778
|
+
"✗ ",
|
|
779
|
+
a("betslip.settledLost")
|
|
780
|
+
]
|
|
781
|
+
}
|
|
782
|
+
) : i === "settled_void" ? /* @__PURE__ */ s("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: e.t3 }, children: a("betslip.settledVoid") }) : i === "suspended" ? /* @__PURE__ */ s("span", { style: { fontSize: "0.75em", fontWeight: 600, color: e.warn }, children: n.suspendedLabel || a("betslip.suspendedLabel") }) : o ? /* @__PURE__ */ s("div", { css: K.spinner }) : l === 0 ? /* @__PURE__ */ s("span", { style: { fontSize: "0.8125em", fontWeight: 600, color: e.t3 }, children: n.oddsUnavailableLabel || a("betslip.oddsUnavailableLabel") }) : /* @__PURE__ */ S("div", { style: { display: "flex", alignItems: "center", gap: 3 }, children: [
|
|
783
|
+
r && /* @__PURE__ */ s(
|
|
784
|
+
"span",
|
|
785
|
+
{
|
|
786
|
+
style: {
|
|
787
|
+
fontSize: "0.5625em",
|
|
788
|
+
color: r === "UP" ? e.ok : e.bad,
|
|
789
|
+
lineHeight: 1
|
|
790
|
+
},
|
|
791
|
+
children: r === "UP" ? "▲" : "▼"
|
|
792
|
+
}
|
|
793
|
+
),
|
|
794
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.875em", fontWeight: 700, color: e.t1 }, children: l.toFixed(2) })
|
|
795
|
+
] });
|
|
796
|
+
}, ue = ({ sel: t, tokens: e }) => {
|
|
797
|
+
const { onRemove: n, labels: o } = E(), { t: a, i18n: i } = I(), l = O(), r = A(), [m, b] = Y.useState(!1), h = le(t.startAt, i.language, a), c = t.marketId === "CORRECT_SCORE" || t.marketId === "CORRECT_SCORE_ADVANCED" || t.marketId === "CORRECT_SCORE_HT", p = c && t.outcome ? t.outcome.split(/[-:]/) : null, d = p == null ? void 0 : p[0], f = p == null ? void 0 : p[1];
|
|
798
|
+
return /* @__PURE__ */ S(
|
|
799
|
+
"div",
|
|
800
|
+
{
|
|
801
|
+
css: K.card,
|
|
802
|
+
style: {
|
|
803
|
+
fontFamily: e.font,
|
|
804
|
+
padding: "14px 12px"
|
|
805
|
+
},
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ S(
|
|
808
|
+
"div",
|
|
809
|
+
{
|
|
810
|
+
style: {
|
|
811
|
+
display: "flex",
|
|
812
|
+
justifyContent: "space-between",
|
|
813
|
+
alignItems: "flex-start",
|
|
814
|
+
gap: l.xs,
|
|
815
|
+
marginBottom: l["3xs"]
|
|
816
|
+
},
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ S("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
819
|
+
t.athlete && /* @__PURE__ */ s(
|
|
820
|
+
ce,
|
|
821
|
+
{
|
|
822
|
+
avatar: t.athlete.avatar,
|
|
823
|
+
name: t.athlete.name,
|
|
824
|
+
tokens: e
|
|
825
|
+
}
|
|
826
|
+
),
|
|
827
|
+
/* @__PURE__ */ s(
|
|
828
|
+
"span",
|
|
829
|
+
{
|
|
830
|
+
style: {
|
|
831
|
+
fontSize: "0.8125em",
|
|
832
|
+
fontWeight: 700,
|
|
833
|
+
color: e.t1
|
|
834
|
+
},
|
|
835
|
+
children: t.name
|
|
836
|
+
}
|
|
837
|
+
)
|
|
838
|
+
] }),
|
|
839
|
+
/* @__PURE__ */ S(
|
|
840
|
+
"div",
|
|
841
|
+
{
|
|
842
|
+
style: {
|
|
843
|
+
display: "flex",
|
|
844
|
+
alignItems: "center",
|
|
845
|
+
gap: 6,
|
|
846
|
+
flexShrink: 0
|
|
847
|
+
},
|
|
848
|
+
children: [
|
|
849
|
+
/* @__PURE__ */ s(pe, { sel: t, tokens: e }),
|
|
850
|
+
/* @__PURE__ */ s(
|
|
851
|
+
"button",
|
|
852
|
+
{
|
|
853
|
+
onClick: () => n(t.id),
|
|
854
|
+
onMouseEnter: () => b(!0),
|
|
855
|
+
onMouseLeave: () => b(!1),
|
|
856
|
+
title: "Remove",
|
|
857
|
+
style: {
|
|
858
|
+
background: m ? "rgba(239,68,68,.08)" : "none",
|
|
859
|
+
border: "none",
|
|
860
|
+
cursor: "pointer",
|
|
861
|
+
color: m ? e.bad : e.t2,
|
|
862
|
+
fontSize: "0.8125em",
|
|
863
|
+
padding: "3px 5px",
|
|
864
|
+
borderRadius: r.xs,
|
|
865
|
+
transition: "color .15s, background .15s",
|
|
866
|
+
lineHeight: 1,
|
|
867
|
+
display: "flex",
|
|
868
|
+
alignItems: "center"
|
|
869
|
+
},
|
|
870
|
+
children: /* @__PURE__ */ s(ae, {})
|
|
871
|
+
}
|
|
872
|
+
)
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
)
|
|
876
|
+
]
|
|
877
|
+
}
|
|
878
|
+
),
|
|
879
|
+
/* @__PURE__ */ s(
|
|
880
|
+
"div",
|
|
881
|
+
{
|
|
882
|
+
style: {
|
|
883
|
+
fontSize: "0.6875em",
|
|
884
|
+
color: e.t3,
|
|
885
|
+
marginBottom: 6
|
|
886
|
+
},
|
|
887
|
+
children: oe(t.marketId, a, o.marketLabels)
|
|
888
|
+
}
|
|
889
|
+
),
|
|
890
|
+
/* @__PURE__ */ s(
|
|
891
|
+
"div",
|
|
892
|
+
{
|
|
893
|
+
style: {
|
|
894
|
+
background: e.s3,
|
|
895
|
+
borderRadius: r.sm,
|
|
896
|
+
padding: "7px 10px",
|
|
897
|
+
marginTop: 6
|
|
898
|
+
},
|
|
899
|
+
children: /* @__PURE__ */ S(
|
|
900
|
+
"div",
|
|
901
|
+
{
|
|
902
|
+
style: {
|
|
903
|
+
display: "flex",
|
|
904
|
+
alignItems: "stretch",
|
|
905
|
+
gap: 10
|
|
906
|
+
},
|
|
907
|
+
children: [
|
|
908
|
+
/* @__PURE__ */ s(
|
|
909
|
+
"div",
|
|
910
|
+
{
|
|
911
|
+
style: {
|
|
912
|
+
flex: "0 1 auto",
|
|
913
|
+
minWidth: 0,
|
|
914
|
+
display: "flex",
|
|
915
|
+
alignItems: "center"
|
|
916
|
+
},
|
|
917
|
+
children: /* @__PURE__ */ S(
|
|
918
|
+
"div",
|
|
919
|
+
{
|
|
920
|
+
style: {
|
|
921
|
+
display: "grid",
|
|
922
|
+
gridTemplateColumns: c ? "auto minmax(0, auto) auto" : "auto minmax(0, auto)",
|
|
923
|
+
columnGap: 6,
|
|
924
|
+
rowGap: l["2xs"],
|
|
925
|
+
alignItems: "center"
|
|
926
|
+
},
|
|
927
|
+
children: [
|
|
928
|
+
/* @__PURE__ */ s(
|
|
929
|
+
at,
|
|
930
|
+
{
|
|
931
|
+
logo: t.participantOneLogo,
|
|
932
|
+
name: t.participantOne ?? "",
|
|
933
|
+
tokens: e
|
|
934
|
+
}
|
|
935
|
+
),
|
|
936
|
+
/* @__PURE__ */ s(
|
|
937
|
+
"span",
|
|
938
|
+
{
|
|
939
|
+
style: {
|
|
940
|
+
fontSize: "0.75em",
|
|
941
|
+
color: e.t1,
|
|
942
|
+
overflow: "hidden",
|
|
943
|
+
textOverflow: "ellipsis",
|
|
944
|
+
whiteSpace: "nowrap"
|
|
945
|
+
},
|
|
946
|
+
children: t.participantOne
|
|
947
|
+
}
|
|
948
|
+
),
|
|
949
|
+
c && (d !== void 0 ? /* @__PURE__ */ s(st, { score: d, tokens: e }) : /* @__PURE__ */ s("span", {})),
|
|
950
|
+
t.participantTwo && /* @__PURE__ */ s(
|
|
951
|
+
at,
|
|
952
|
+
{
|
|
953
|
+
logo: t.participantTwoLogo,
|
|
954
|
+
name: t.participantTwo,
|
|
955
|
+
tokens: e
|
|
956
|
+
}
|
|
957
|
+
),
|
|
958
|
+
t.participantTwo && /* @__PURE__ */ s(
|
|
959
|
+
"span",
|
|
960
|
+
{
|
|
961
|
+
style: {
|
|
962
|
+
fontSize: "0.75em",
|
|
963
|
+
color: e.t1,
|
|
964
|
+
overflow: "hidden",
|
|
965
|
+
textOverflow: "ellipsis",
|
|
966
|
+
whiteSpace: "nowrap"
|
|
967
|
+
},
|
|
968
|
+
children: t.participantTwo
|
|
969
|
+
}
|
|
970
|
+
),
|
|
971
|
+
t.participantTwo && c && (f !== void 0 ? /* @__PURE__ */ s(st, { score: f, tokens: e }) : /* @__PURE__ */ s("span", {}))
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
)
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
(t.matchStatus === "inprogress" || h || t.competition) && /* @__PURE__ */ S(
|
|
978
|
+
"div",
|
|
979
|
+
{
|
|
980
|
+
style: {
|
|
981
|
+
marginLeft: "auto",
|
|
982
|
+
flexShrink: 0,
|
|
983
|
+
display: "flex",
|
|
984
|
+
flexDirection: "column",
|
|
985
|
+
justifyContent: "space-between",
|
|
986
|
+
alignItems: "flex-end"
|
|
987
|
+
},
|
|
988
|
+
children: [
|
|
989
|
+
t.matchStatus === "inprogress" ? /* @__PURE__ */ S(
|
|
990
|
+
"span",
|
|
991
|
+
{
|
|
992
|
+
style: {
|
|
993
|
+
display: "inline-flex",
|
|
994
|
+
alignItems: "center",
|
|
995
|
+
gap: 3,
|
|
996
|
+
backgroundColor: e.bad,
|
|
997
|
+
color: "#fff",
|
|
998
|
+
fontSize: "0.6em",
|
|
999
|
+
fontWeight: 700,
|
|
1000
|
+
letterSpacing: "0.07em",
|
|
1001
|
+
padding: "2px 5px",
|
|
1002
|
+
borderRadius: 3,
|
|
1003
|
+
textTransform: "uppercase",
|
|
1004
|
+
whiteSpace: "nowrap",
|
|
1005
|
+
fontFamily: e.font
|
|
1006
|
+
},
|
|
1007
|
+
children: [
|
|
1008
|
+
/* @__PURE__ */ s("span", { css: K.pulseDot }),
|
|
1009
|
+
a("betslip.live")
|
|
1010
|
+
]
|
|
1011
|
+
}
|
|
1012
|
+
) : h ? /* @__PURE__ */ s(
|
|
1013
|
+
"span",
|
|
1014
|
+
{
|
|
1015
|
+
style: {
|
|
1016
|
+
fontSize: "0.625em",
|
|
1017
|
+
color: e.t3,
|
|
1018
|
+
whiteSpace: "nowrap"
|
|
1019
|
+
},
|
|
1020
|
+
children: h
|
|
1021
|
+
}
|
|
1022
|
+
) : null,
|
|
1023
|
+
t.competition && /* @__PURE__ */ s(
|
|
1024
|
+
de,
|
|
1025
|
+
{
|
|
1026
|
+
name: t.competition.name,
|
|
1027
|
+
logo: t.competition.logo,
|
|
1028
|
+
tokens: e
|
|
1029
|
+
}
|
|
1030
|
+
)
|
|
1031
|
+
]
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
]
|
|
1035
|
+
}
|
|
1036
|
+
)
|
|
1037
|
+
}
|
|
1038
|
+
)
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
}, me = {
|
|
1043
|
+
scrollBody: _({
|
|
1044
|
+
"&::-webkit-scrollbar": { width: "8px" },
|
|
1045
|
+
"&::-webkit-scrollbar-track": { background: "transparent", margin: "6px 0" },
|
|
1046
|
+
"&::-webkit-scrollbar-thumb": {
|
|
1047
|
+
background: B.s3,
|
|
1048
|
+
borderRadius: "6px",
|
|
1049
|
+
borderRight: "4px solid transparent",
|
|
1050
|
+
backgroundClip: "padding-box"
|
|
1051
|
+
}
|
|
1052
|
+
})
|
|
1053
|
+
}, lt = ({
|
|
1054
|
+
tokens: t,
|
|
1055
|
+
isSide: e
|
|
1056
|
+
}) => {
|
|
1057
|
+
const { labels: n, selections: o } = E(), { t: a } = I();
|
|
1058
|
+
return /* @__PURE__ */ s(
|
|
1059
|
+
"div",
|
|
1060
|
+
{
|
|
1061
|
+
css: me.scrollBody,
|
|
1062
|
+
style: {
|
|
1063
|
+
overflowY: "auto",
|
|
1064
|
+
flex: 1,
|
|
1065
|
+
minHeight: 0,
|
|
1066
|
+
maxHeight: e ? "none" : 300,
|
|
1067
|
+
background: t.s1
|
|
1068
|
+
},
|
|
1069
|
+
children: o.length === 0 ? /* @__PURE__ */ S(
|
|
1070
|
+
"div",
|
|
1071
|
+
{
|
|
1072
|
+
style: {
|
|
1073
|
+
padding: "36px 20px",
|
|
1074
|
+
textAlign: "center",
|
|
1075
|
+
fontFamily: t.font
|
|
1076
|
+
},
|
|
1077
|
+
children: [
|
|
1078
|
+
/* @__PURE__ */ s("div", { style: { fontSize: "2.5em", opacity: 0.25, marginBottom: 14 }, children: "🎯" }),
|
|
1079
|
+
/* @__PURE__ */ s(
|
|
1080
|
+
"div",
|
|
1081
|
+
{
|
|
1082
|
+
style: {
|
|
1083
|
+
fontSize: "0.875em",
|
|
1084
|
+
fontWeight: 600,
|
|
1085
|
+
color: t.t1,
|
|
1086
|
+
marginBottom: 6
|
|
1087
|
+
},
|
|
1088
|
+
children: n.emptyTitle || a("betslip.emptyTitle")
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ s("div", { style: { fontSize: "0.75em", color: t.t2, lineHeight: 1.5 }, children: n.emptyDescription || a("betslip.emptyDescription") })
|
|
1092
|
+
]
|
|
1093
|
+
}
|
|
1094
|
+
) : o.map((i) => /* @__PURE__ */ s(
|
|
1095
|
+
ue,
|
|
1096
|
+
{
|
|
1097
|
+
sel: i,
|
|
1098
|
+
tokens: t
|
|
1099
|
+
},
|
|
1100
|
+
i.id
|
|
1101
|
+
))
|
|
1102
|
+
}
|
|
1103
|
+
);
|
|
1104
|
+
}, fe = 3, ge = 5, ct = (t) => _({
|
|
1105
|
+
background: B.primary,
|
|
1106
|
+
color: "#fff",
|
|
1107
|
+
border: "none",
|
|
1108
|
+
width: t,
|
|
1109
|
+
cursor: "pointer",
|
|
1110
|
+
flexShrink: 0,
|
|
1111
|
+
"&:hover": { background: B.primary, opacity: 0.88 }
|
|
1112
|
+
}), N = {
|
|
1113
|
+
stakeInput: _({
|
|
1114
|
+
"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
|
|
1115
|
+
WebkitAppearance: "none",
|
|
1116
|
+
margin: 0
|
|
1117
|
+
},
|
|
1118
|
+
MozAppearance: "textfield"
|
|
1119
|
+
}),
|
|
1120
|
+
preset: ct("44px"),
|
|
1121
|
+
presetCell: ct("auto"),
|
|
1122
|
+
presetGrid: _({ display: "grid", gap: "6px", marginBottom: "10px" })
|
|
1123
|
+
}, dt = ({ tokens: t, brandingLogoUrl: e }) => {
|
|
1124
|
+
const {
|
|
1125
|
+
labels: n,
|
|
1126
|
+
selections: o,
|
|
1127
|
+
combStake: a,
|
|
1128
|
+
setCombStake: i,
|
|
1129
|
+
currency: l,
|
|
1130
|
+
stakePresets: r
|
|
1131
|
+
} = E(), { t: m } = I(), b = O(), h = A(), c = J(), p = o.filter(
|
|
1132
|
+
(v) => v.status === "active" || !v.status
|
|
1133
|
+
), d = bt(p), f = parseFloat(a) || 0, g = f * d, y = (v) => {
|
|
1134
|
+
i(String(v));
|
|
1135
|
+
}, u = Y.useRef(null), x = r.length <= fe, w = Math.ceil(
|
|
1136
|
+
r.length / Math.ceil(r.length / ge)
|
|
1137
|
+
), C = r.map((v) => /* @__PURE__ */ s(
|
|
1138
|
+
"button",
|
|
1139
|
+
{
|
|
1140
|
+
css: x ? N.preset : N.presetCell,
|
|
1141
|
+
onClick: () => y(v),
|
|
1142
|
+
style: {
|
|
1143
|
+
padding: "10px 0",
|
|
1144
|
+
borderRadius: h.sm,
|
|
1145
|
+
fontSize: "0.8125em",
|
|
1146
|
+
fontWeight: 700,
|
|
1147
|
+
fontFamily: t.font,
|
|
1148
|
+
textAlign: "center"
|
|
1149
|
+
},
|
|
1150
|
+
children: v
|
|
1151
|
+
},
|
|
1152
|
+
v
|
|
1153
|
+
));
|
|
1154
|
+
return /* @__PURE__ */ s(
|
|
1155
|
+
"div",
|
|
1156
|
+
{
|
|
1157
|
+
style: {
|
|
1158
|
+
padding: `${b.sm} 14px`,
|
|
1159
|
+
flexShrink: 0,
|
|
1160
|
+
borderTop: `${c.size} solid ${t.bdr}`,
|
|
1161
|
+
background: t.s3,
|
|
1162
|
+
fontFamily: t.font
|
|
1163
|
+
},
|
|
1164
|
+
children: /* @__PURE__ */ S(vt, { children: [
|
|
1165
|
+
p.length > 0 && /* @__PURE__ */ S(
|
|
1166
|
+
"div",
|
|
1167
|
+
{
|
|
1168
|
+
style: {
|
|
1169
|
+
display: "flex",
|
|
1170
|
+
justifyContent: "space-between",
|
|
1171
|
+
fontSize: "0.75em",
|
|
1172
|
+
color: t.t2,
|
|
1173
|
+
padding: "3px 0",
|
|
1174
|
+
paddingBottom: b.xs
|
|
1175
|
+
},
|
|
1176
|
+
children: [
|
|
1177
|
+
/* @__PURE__ */ s("span", { children: n.combinedOddsLabel || m("betslip.combinedOddsLabel") }),
|
|
1178
|
+
/* @__PURE__ */ S(
|
|
1179
|
+
"span",
|
|
1180
|
+
{
|
|
1181
|
+
style: {
|
|
1182
|
+
display: "flex",
|
|
1183
|
+
alignItems: "center",
|
|
1184
|
+
gap: b["2xs"],
|
|
1185
|
+
fontSize: "0.8125em",
|
|
1186
|
+
fontWeight: 600,
|
|
1187
|
+
color: t.t1
|
|
1188
|
+
},
|
|
1189
|
+
children: [
|
|
1190
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "0.5625em", color: t.ok }, children: "▲" }),
|
|
1191
|
+
d.toFixed(2)
|
|
1192
|
+
]
|
|
1193
|
+
}
|
|
1194
|
+
)
|
|
1195
|
+
]
|
|
1196
|
+
}
|
|
1197
|
+
),
|
|
1198
|
+
/* @__PURE__ */ S(
|
|
1199
|
+
"div",
|
|
1200
|
+
{
|
|
1201
|
+
style: {
|
|
1202
|
+
display: "flex",
|
|
1203
|
+
alignItems: "center",
|
|
1204
|
+
gap: 6,
|
|
1205
|
+
marginBottom: x ? 10 : 6
|
|
1206
|
+
},
|
|
1207
|
+
children: [
|
|
1208
|
+
/* @__PURE__ */ s(
|
|
1209
|
+
"span",
|
|
1210
|
+
{
|
|
1211
|
+
style: { fontSize: "0.75em", color: t.t2, flexShrink: 0 },
|
|
1212
|
+
children: n.stakeLabel || m("betslip.stakeLabel")
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
/* @__PURE__ */ s("div", { style: { flex: 1, position: "relative", marginBottom: 0 }, children: /* @__PURE__ */ s(
|
|
1216
|
+
"input",
|
|
1217
|
+
{
|
|
1218
|
+
ref: u,
|
|
1219
|
+
css: N.stakeInput,
|
|
1220
|
+
type: "number",
|
|
1221
|
+
min: "0",
|
|
1222
|
+
step: "1",
|
|
1223
|
+
value: a,
|
|
1224
|
+
onChange: (v) => i(v.target.value),
|
|
1225
|
+
placeholder: "0",
|
|
1226
|
+
onFocus: (v) => v.currentTarget.style.borderColor = t.primary,
|
|
1227
|
+
onBlur: (v) => v.currentTarget.style.borderColor = t.bdr,
|
|
1228
|
+
style: {
|
|
1229
|
+
width: "100%",
|
|
1230
|
+
background: t.s1,
|
|
1231
|
+
border: `${c.size} solid ${t.bdr}`,
|
|
1232
|
+
color: t.t1,
|
|
1233
|
+
padding: "10px",
|
|
1234
|
+
borderRadius: h.sm,
|
|
1235
|
+
fontSize: "0.875em",
|
|
1236
|
+
fontFamily: t.font,
|
|
1237
|
+
outline: "none",
|
|
1238
|
+
transition: "border-color .15s",
|
|
1239
|
+
boxSizing: "border-box"
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
) }),
|
|
1243
|
+
x && C
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
!x && /* @__PURE__ */ s(
|
|
1248
|
+
"div",
|
|
1249
|
+
{
|
|
1250
|
+
css: N.presetGrid,
|
|
1251
|
+
style: { gridTemplateColumns: `repeat(${w}, 1fr)` },
|
|
1252
|
+
children: C
|
|
1253
|
+
}
|
|
1254
|
+
),
|
|
1255
|
+
/* @__PURE__ */ S("div", { style: { marginBottom: 10 }, children: [
|
|
1256
|
+
/* @__PURE__ */ S(
|
|
1257
|
+
"div",
|
|
1258
|
+
{
|
|
1259
|
+
style: {
|
|
1260
|
+
display: "flex",
|
|
1261
|
+
justifyContent: "space-between",
|
|
1262
|
+
fontSize: "0.8125em",
|
|
1263
|
+
color: t.t1,
|
|
1264
|
+
fontWeight: 600,
|
|
1265
|
+
padding: "3px 0"
|
|
1266
|
+
},
|
|
1267
|
+
children: [
|
|
1268
|
+
/* @__PURE__ */ s("span", { children: n.totalStakeLabel || m("betslip.totalStakeLabel") }),
|
|
1269
|
+
/* @__PURE__ */ s("span", { children: f > 0 ? `${f.toFixed(2)}${l}` : "—" })
|
|
1270
|
+
]
|
|
1271
|
+
}
|
|
1272
|
+
),
|
|
1273
|
+
/* @__PURE__ */ S(
|
|
1274
|
+
"div",
|
|
1275
|
+
{
|
|
1276
|
+
style: {
|
|
1277
|
+
display: "flex",
|
|
1278
|
+
justifyContent: "space-between",
|
|
1279
|
+
fontSize: "0.8125em",
|
|
1280
|
+
color: t.t1,
|
|
1281
|
+
fontWeight: 600,
|
|
1282
|
+
padding: "3px 0",
|
|
1283
|
+
borderTop: `${c.size} solid ${t.bdr}`
|
|
1284
|
+
},
|
|
1285
|
+
children: [
|
|
1286
|
+
/* @__PURE__ */ s("span", { children: n.potentialWinLabel || m("betslip.potentialWinLabel") }),
|
|
1287
|
+
/* @__PURE__ */ s(
|
|
1288
|
+
"span",
|
|
1289
|
+
{
|
|
1290
|
+
style: {
|
|
1291
|
+
color: g > 0 ? t.primary : void 0
|
|
1292
|
+
},
|
|
1293
|
+
children: g > 0 ? g.toFixed(2) : "—"
|
|
1294
|
+
}
|
|
1295
|
+
)
|
|
1296
|
+
]
|
|
1297
|
+
}
|
|
1298
|
+
)
|
|
1299
|
+
] }),
|
|
1300
|
+
/* @__PURE__ */ s(
|
|
1301
|
+
yt,
|
|
1302
|
+
{
|
|
1303
|
+
tokens: t,
|
|
1304
|
+
brandingLogoUrl: e
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
n.disclaimer && /* @__PURE__ */ s(
|
|
1308
|
+
"div",
|
|
1309
|
+
{
|
|
1310
|
+
style: {
|
|
1311
|
+
fontSize: "0.625em",
|
|
1312
|
+
color: t.t3,
|
|
1313
|
+
textAlign: "center",
|
|
1314
|
+
marginTop: b.xs,
|
|
1315
|
+
lineHeight: 1.5,
|
|
1316
|
+
padding: `0 ${b["3xs"]}`
|
|
1317
|
+
},
|
|
1318
|
+
children: n.disclaimer
|
|
1319
|
+
}
|
|
1320
|
+
)
|
|
1321
|
+
] })
|
|
1322
|
+
}
|
|
1323
|
+
);
|
|
1324
|
+
}, V = (t, e) => {
|
|
1325
|
+
var o, a;
|
|
1326
|
+
const n = e.split("-")[0].toUpperCase();
|
|
1327
|
+
return ((a = (o = t == null ? void 0 : t.translations) == null ? void 0 : o.find((i) => {
|
|
1328
|
+
var l;
|
|
1329
|
+
return ((l = i.language) == null ? void 0 : l.toUpperCase()) === n;
|
|
1330
|
+
})) == null ? void 0 : a.name) ?? (t == null ? void 0 : t.name) ?? void 0;
|
|
1331
|
+
}, G = (t) => {
|
|
1332
|
+
var e, n;
|
|
1333
|
+
return (n = (e = t == null ? void 0 : t.assets) == null ? void 0 : e.find((o) => o.key === "LOGO")) == null ? void 0 : n.value;
|
|
1334
|
+
}, he = (t) => {
|
|
1335
|
+
const e = (t ?? "").toUpperCase();
|
|
1336
|
+
return /CANCEL/.test(e) ? "cancelled" : /POSTPON|INTERRUPT|ABANDON|SUSPEND/.test(e) ? "interrupted" : /FINISH|ENDED/.test(e) ? "finished" : /LIVE|PROGRESS|HALF/.test(e) ? "inprogress" : "notstarted";
|
|
1337
|
+
};
|
|
1338
|
+
async function be(t, e, n, o) {
|
|
1339
|
+
var p;
|
|
1340
|
+
const a = /* @__PURE__ */ new Map(), i = (p = t.helpers.getSDKConfiguration()) == null ? void 0 : p.idSchema, l = /* @__PURE__ */ new Map();
|
|
1341
|
+
if (i && i !== "native") {
|
|
1342
|
+
const d = await t.idMapping.getMappedFootballMatchIds(
|
|
1343
|
+
e,
|
|
1344
|
+
i,
|
|
1345
|
+
"native"
|
|
1346
|
+
);
|
|
1347
|
+
((d == null ? void 0 : d.data) ?? []).forEach((f) => {
|
|
1348
|
+
f.input && f.output && l.set(f.output, f.input);
|
|
1349
|
+
});
|
|
1350
|
+
} else
|
|
1351
|
+
e.forEach((d) => l.set(d, d));
|
|
1352
|
+
const r = await Tt(
|
|
1353
|
+
t,
|
|
1354
|
+
[...l.keys()],
|
|
1355
|
+
o
|
|
1356
|
+
);
|
|
1357
|
+
if (!r.length) return a;
|
|
1358
|
+
const m = $t(t), b = r.flatMap((d) => [
|
|
1359
|
+
d.competitor_one,
|
|
1360
|
+
d.competitor_two,
|
|
1361
|
+
d.competition_id
|
|
1362
|
+
]), h = m ? await Ot(m, b, {
|
|
1363
|
+
partial: !0,
|
|
1364
|
+
disableCache: o
|
|
1365
|
+
}) : [], c = new Map(h.map((d) => [d.id, d]));
|
|
1366
|
+
return r.forEach((d) => {
|
|
1367
|
+
var v, T;
|
|
1368
|
+
const f = c.get(d.competitor_one), g = c.get(d.competitor_two), y = V(f, n), u = V(g, n);
|
|
1369
|
+
if (!y || d.competitor_two && !u) {
|
|
1370
|
+
console.warn(
|
|
1371
|
+
`[betslip] Event ${d.id} has no competitor names in the Search API.`
|
|
1372
|
+
);
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
const x = c.get(d.competition_id), w = V(x, n), C = l.get(d.id) ?? d.id;
|
|
1376
|
+
a.set(C, {
|
|
1377
|
+
eventId: C,
|
|
1378
|
+
participantOne: { name: y, logo: G(f) },
|
|
1379
|
+
participantTwo: u ? { name: u, logo: G(g) } : void 0,
|
|
1380
|
+
startAt: ((v = d.timing) == null ? void 0 : v.start_time) ?? d.start_time,
|
|
1381
|
+
matchStatus: he((T = d.status) == null ? void 0 : T.type),
|
|
1382
|
+
competition: w ? { name: w, logo: G(x) } : void 0
|
|
1383
|
+
});
|
|
1384
|
+
}), a;
|
|
1385
|
+
}
|
|
1386
|
+
function ye(t, e, n) {
|
|
1387
|
+
const [o, a] = k([]), [i, l] = k((e == null ? void 0 : e.length) > 0), r = Lt(), m = M(/* @__PURE__ */ new Map()), b = M(/* @__PURE__ */ new Set());
|
|
1388
|
+
return L(() => {
|
|
1389
|
+
if (!(e != null && e.length)) {
|
|
1390
|
+
a([]), l(!1);
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
let h = !1;
|
|
1394
|
+
const c = e.map((d) => {
|
|
1395
|
+
const f = d.split(":"), g = f[f.length - 1], y = f[f.length - 2], u = f.slice(0, f.length - 2).join(":");
|
|
1396
|
+
return { id: d, eventId: u, market: y, outcome: g };
|
|
1397
|
+
}), p = [...new Set(c.map((d) => d.eventId))];
|
|
1398
|
+
return l(!0), (async () => {
|
|
1399
|
+
let d = /* @__PURE__ */ new Map();
|
|
1400
|
+
try {
|
|
1401
|
+
d = await be(
|
|
1402
|
+
t,
|
|
1403
|
+
p,
|
|
1404
|
+
n,
|
|
1405
|
+
r
|
|
1406
|
+
);
|
|
1407
|
+
} catch (g) {
|
|
1408
|
+
console.warn("[betslip] Sports API event lookup failed:", g);
|
|
1409
|
+
}
|
|
1410
|
+
if (h) return;
|
|
1411
|
+
d.forEach((g, y) => m.current.set(y, g));
|
|
1412
|
+
const f = c.flatMap(({ id: g, eventId: y, market: u, outcome: x }) => {
|
|
1413
|
+
const w = d.get(y) ?? m.current.get(y);
|
|
1414
|
+
return w ? (b.current.delete(g), [{ ...w, market: u, outcome: x }]) : (b.current.has(g) || (b.current.add(g), console.warn(
|
|
1415
|
+
`[betslip] Dropping "${g}": event ${y} was not found in the Sports API.`
|
|
1416
|
+
)), []);
|
|
1417
|
+
});
|
|
1418
|
+
a(f), l(!1);
|
|
1419
|
+
})(), () => {
|
|
1420
|
+
h = !0;
|
|
1421
|
+
};
|
|
1422
|
+
}, [JSON.stringify(e), r, n]), { selectionInputs: o, loading: i };
|
|
1423
|
+
}
|
|
1424
|
+
const Se = U`
|
|
1425
|
+
from { transform: translateY(100%); opacity: 0; }
|
|
1426
|
+
to { transform: translateY(0); opacity: 1; }
|
|
1427
|
+
`, xe = U`
|
|
1428
|
+
from { transform: translateY(-100%); opacity: 0; }
|
|
1429
|
+
to { transform: translateY(0); opacity: 1; }
|
|
1430
|
+
`, pt = (t) => _({
|
|
1431
|
+
position: "fixed",
|
|
1432
|
+
zIndex: 999,
|
|
1433
|
+
animation: `${t} 0.22s ease`
|
|
1434
|
+
}), ut = {
|
|
1435
|
+
wrapper: { top: pt(xe), bottom: pt(Se) }
|
|
1436
|
+
}, D = 320, mt = 340;
|
|
1437
|
+
function ve(t) {
|
|
1438
|
+
return t === "bottom-right" ? { bottom: 16, right: 16, width: D } : t === "bottom-left" ? { bottom: 16, left: 16, width: D } : t === "top-right" ? { top: 16, right: 16, width: D } : t === "top-left" ? { top: 16, left: 16, width: D } : { bottom: 16, right: 16, width: D };
|
|
1439
|
+
}
|
|
1440
|
+
const we = () => {
|
|
1441
|
+
const { selectionInputs: t, combStake: e, selections: n } = E(), o = parseFloat(e) || 0, a = n.length ? n.reduce((i, l) => i * l.odds, 1) : 0;
|
|
1442
|
+
return L(() => {
|
|
1443
|
+
j._notify({ selections: t, stake: o, totalOdds: a });
|
|
1444
|
+
}, [t, o, a]), L(() => () => j._notify({ selections: [], stake: 0, totalOdds: 0 }), []), null;
|
|
1445
|
+
}, Ce = ({ props: t }) => {
|
|
1446
|
+
var C, v, T, W, F, R, H, z, q, Q;
|
|
1447
|
+
const { position: e = "bottom-right", brandingLogoUrl: n } = t, {
|
|
1448
|
+
open: o,
|
|
1449
|
+
setOpen: a,
|
|
1450
|
+
selections: i,
|
|
1451
|
+
maxSelections: l,
|
|
1452
|
+
bookmakerLogoUrl: r,
|
|
1453
|
+
bookmakerBackgroundColor: m,
|
|
1454
|
+
oddsReady: b
|
|
1455
|
+
} = E(), h = ((F = (W = (T = (v = (C = t.themeOptions) == null ? void 0 : C.colorSchemes) == null ? void 0 : v.light) == null ? void 0 : T.palette) == null ? void 0 : W.primary) == null ? void 0 : F.plainColor) != null || ((Q = (q = (z = (H = (R = t.themeOptions) == null ? void 0 : R.colorSchemes) == null ? void 0 : H.dark) == null ? void 0 : z.palette) == null ? void 0 : q.primary) == null ? void 0 : Q.plainColor) != null, c = Zt(
|
|
1456
|
+
h ? void 0 : m
|
|
1457
|
+
), p = te(c), d = A(), f = J(), g = e.startsWith("side"), y = e === "top-right" || e === "top-left", { t: u } = I();
|
|
1458
|
+
if (!b) return null;
|
|
1459
|
+
if (g) {
|
|
1460
|
+
const $ = e === "side-right", P = $ ? "right" : "left", Z = n || r, St = o ? mt : 0, xt = o ? "translateX(0)" : `translateX(${$ ? "100%" : "-100%"})`;
|
|
1461
|
+
return /* @__PURE__ */ S(
|
|
1462
|
+
"div",
|
|
1463
|
+
{
|
|
1464
|
+
style: {
|
|
1465
|
+
...p,
|
|
1466
|
+
position: "fixed",
|
|
1467
|
+
top: 0,
|
|
1468
|
+
[P]: 0,
|
|
1469
|
+
zIndex: 999,
|
|
1470
|
+
height: "100vh",
|
|
1471
|
+
width: 0,
|
|
1472
|
+
pointerEvents: "none",
|
|
1473
|
+
overflow: "visible"
|
|
1474
|
+
},
|
|
1475
|
+
children: [
|
|
1476
|
+
/* @__PURE__ */ S(
|
|
1477
|
+
"div",
|
|
1478
|
+
{
|
|
1479
|
+
style: {
|
|
1480
|
+
position: "absolute",
|
|
1481
|
+
[P]: St,
|
|
1482
|
+
top: "33%",
|
|
1483
|
+
transform: "translateY(-50%)",
|
|
1484
|
+
pointerEvents: "all",
|
|
1485
|
+
transition: `${P} 0.3s ease`,
|
|
1486
|
+
display: "flex",
|
|
1487
|
+
flexDirection: "column",
|
|
1488
|
+
alignItems: "center",
|
|
1489
|
+
gap: 6
|
|
1490
|
+
},
|
|
1491
|
+
children: [
|
|
1492
|
+
/* @__PURE__ */ s(
|
|
1493
|
+
"button",
|
|
1494
|
+
{
|
|
1495
|
+
onClick: () => a(!o),
|
|
1496
|
+
title: u(o ? "betslip.hide" : "betslip.show"),
|
|
1497
|
+
style: {
|
|
1498
|
+
position: "relative",
|
|
1499
|
+
display: "flex",
|
|
1500
|
+
alignItems: "center",
|
|
1501
|
+
justifyContent: "center",
|
|
1502
|
+
width: 32,
|
|
1503
|
+
height: 64,
|
|
1504
|
+
background: c.primary,
|
|
1505
|
+
border: "none",
|
|
1506
|
+
cursor: "pointer",
|
|
1507
|
+
borderRadius: $ ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
1508
|
+
boxShadow: $ ? "-4px 0 12px rgba(0,0,0,.22)" : "4px 0 12px rgba(0,0,0,.22)",
|
|
1509
|
+
overflow: "hidden",
|
|
1510
|
+
padding: 0
|
|
1511
|
+
},
|
|
1512
|
+
children: Z ? /* @__PURE__ */ s(
|
|
1513
|
+
"img",
|
|
1514
|
+
{
|
|
1515
|
+
src: Z,
|
|
1516
|
+
alt: "brand",
|
|
1517
|
+
style: {
|
|
1518
|
+
position: "absolute",
|
|
1519
|
+
top: "50%",
|
|
1520
|
+
left: "50%",
|
|
1521
|
+
width: 52,
|
|
1522
|
+
height: 22,
|
|
1523
|
+
objectFit: "contain",
|
|
1524
|
+
transform: `translate(-50%, -50%) rotate(${$ ? "-90" : "90"}deg)`
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
) : /* @__PURE__ */ S("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
1528
|
+
/* @__PURE__ */ s(
|
|
1529
|
+
"div",
|
|
1530
|
+
{
|
|
1531
|
+
style: {
|
|
1532
|
+
width: 12,
|
|
1533
|
+
height: 2,
|
|
1534
|
+
background: "rgba(255,255,255,.7)",
|
|
1535
|
+
borderRadius: 1
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
),
|
|
1539
|
+
/* @__PURE__ */ s(
|
|
1540
|
+
"div",
|
|
1541
|
+
{
|
|
1542
|
+
style: {
|
|
1543
|
+
width: 12,
|
|
1544
|
+
height: 2,
|
|
1545
|
+
background: "rgba(255,255,255,.7)",
|
|
1546
|
+
borderRadius: 1
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
),
|
|
1550
|
+
/* @__PURE__ */ s(
|
|
1551
|
+
"div",
|
|
1552
|
+
{
|
|
1553
|
+
style: {
|
|
1554
|
+
width: 12,
|
|
1555
|
+
height: 2,
|
|
1556
|
+
background: "rgba(255,255,255,.7)",
|
|
1557
|
+
borderRadius: 1
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
)
|
|
1561
|
+
] })
|
|
1562
|
+
}
|
|
1563
|
+
),
|
|
1564
|
+
!o && l != null && /* @__PURE__ */ S(
|
|
1565
|
+
"div",
|
|
1566
|
+
{
|
|
1567
|
+
style: {
|
|
1568
|
+
fontSize: "0.625rem",
|
|
1569
|
+
fontWeight: 700,
|
|
1570
|
+
color: "#fff",
|
|
1571
|
+
fontFamily: c.font,
|
|
1572
|
+
background: c.primary,
|
|
1573
|
+
borderRadius: 4,
|
|
1574
|
+
padding: "2px 5px",
|
|
1575
|
+
whiteSpace: "nowrap",
|
|
1576
|
+
boxShadow: $ ? "-2px 2px 6px rgba(0,0,0,.2)" : "2px 2px 6px rgba(0,0,0,.2)"
|
|
1577
|
+
},
|
|
1578
|
+
children: [
|
|
1579
|
+
i.length,
|
|
1580
|
+
"/",
|
|
1581
|
+
l
|
|
1582
|
+
]
|
|
1583
|
+
}
|
|
1584
|
+
)
|
|
1585
|
+
]
|
|
1586
|
+
}
|
|
1587
|
+
),
|
|
1588
|
+
/* @__PURE__ */ S(
|
|
1589
|
+
"div",
|
|
1590
|
+
{
|
|
1591
|
+
style: {
|
|
1592
|
+
position: "absolute",
|
|
1593
|
+
top: 0,
|
|
1594
|
+
[P]: 0,
|
|
1595
|
+
width: mt,
|
|
1596
|
+
height: "100%",
|
|
1597
|
+
transform: xt,
|
|
1598
|
+
transition: "transform 0.3s ease",
|
|
1599
|
+
pointerEvents: o ? "all" : "none",
|
|
1600
|
+
display: "flex",
|
|
1601
|
+
flexDirection: "column",
|
|
1602
|
+
background: c.s1,
|
|
1603
|
+
boxShadow: $ ? "-6px 0 24px rgba(0,0,0,.18)" : "6px 0 24px rgba(0,0,0,.18)",
|
|
1604
|
+
outline: `${f.size} solid ${c.bdr}`
|
|
1605
|
+
},
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ s(
|
|
1608
|
+
nt,
|
|
1609
|
+
{
|
|
1610
|
+
tokens: c,
|
|
1611
|
+
isSide: g,
|
|
1612
|
+
position: e,
|
|
1613
|
+
brandingLogoUrl: n
|
|
1614
|
+
}
|
|
1615
|
+
),
|
|
1616
|
+
/* @__PURE__ */ S(
|
|
1617
|
+
"div",
|
|
1618
|
+
{
|
|
1619
|
+
style: {
|
|
1620
|
+
display: "flex",
|
|
1621
|
+
flexDirection: "column",
|
|
1622
|
+
flex: 1,
|
|
1623
|
+
minHeight: 0,
|
|
1624
|
+
overflow: "hidden"
|
|
1625
|
+
},
|
|
1626
|
+
children: [
|
|
1627
|
+
/* @__PURE__ */ s(lt, { tokens: c, isSide: g }),
|
|
1628
|
+
/* @__PURE__ */ s(dt, { tokens: c, brandingLogoUrl: n })
|
|
1629
|
+
]
|
|
1630
|
+
}
|
|
1631
|
+
)
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
)
|
|
1635
|
+
]
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1638
|
+
}
|
|
1639
|
+
const x = y ? `0 0 ${d.md} ${d.md}` : `${d.md} ${d.md} 0 0`, w = ve(e);
|
|
1640
|
+
return /* @__PURE__ */ s(
|
|
1641
|
+
"div",
|
|
1642
|
+
{
|
|
1643
|
+
css: e.startsWith("top") ? ut.wrapper.top : ut.wrapper.bottom,
|
|
1644
|
+
style: {
|
|
1645
|
+
...p,
|
|
1646
|
+
fontFamily: c.font,
|
|
1647
|
+
borderRadius: x,
|
|
1648
|
+
overflow: "hidden",
|
|
1649
|
+
boxShadow: y ? "0 4px 16px rgba(0,0,0,.2)" : "0 -4px 16px rgba(0,0,0,.2)",
|
|
1650
|
+
outline: `${f.size} solid ${c.primary}`,
|
|
1651
|
+
...w
|
|
1652
|
+
},
|
|
1653
|
+
children: /* @__PURE__ */ S(
|
|
1654
|
+
"div",
|
|
1655
|
+
{
|
|
1656
|
+
style: {
|
|
1657
|
+
display: "flex",
|
|
1658
|
+
flexDirection: "column",
|
|
1659
|
+
maxHeight: "calc(100vh - 64px)",
|
|
1660
|
+
background: c.s1
|
|
1661
|
+
},
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ s(
|
|
1664
|
+
nt,
|
|
1665
|
+
{
|
|
1666
|
+
tokens: c,
|
|
1667
|
+
isSide: g,
|
|
1668
|
+
position: e,
|
|
1669
|
+
brandingLogoUrl: n
|
|
1670
|
+
}
|
|
1671
|
+
),
|
|
1672
|
+
!o && i.length > 0 && /* @__PURE__ */ s(
|
|
1673
|
+
ne,
|
|
1674
|
+
{
|
|
1675
|
+
tokens: c,
|
|
1676
|
+
brandingLogoUrl: n
|
|
1677
|
+
}
|
|
1678
|
+
),
|
|
1679
|
+
o && /* @__PURE__ */ S(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
style: {
|
|
1683
|
+
display: "flex",
|
|
1684
|
+
flexDirection: "column",
|
|
1685
|
+
flex: 1,
|
|
1686
|
+
minHeight: 0,
|
|
1687
|
+
overflow: "hidden"
|
|
1688
|
+
},
|
|
1689
|
+
children: [
|
|
1690
|
+
/* @__PURE__ */ s(lt, { tokens: c, isSide: g }),
|
|
1691
|
+
/* @__PURE__ */ s(dt, { tokens: c, brandingLogoUrl: n })
|
|
1692
|
+
]
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
]
|
|
1696
|
+
}
|
|
1697
|
+
)
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
}, Re = (t) => {
|
|
1701
|
+
const [e, n] = k([]), o = M(/* @__PURE__ */ new Set()), { selectionInputs: a, loading: i } = ye(
|
|
1702
|
+
t.sdk,
|
|
1703
|
+
e,
|
|
1704
|
+
t.language
|
|
1705
|
+
), l = a.filter(
|
|
1706
|
+
(c) => c.matchStatus !== "finished"
|
|
1707
|
+
), { oddsMap: r, oddsMarkets: m } = Vt(
|
|
1708
|
+
t.sdk,
|
|
1709
|
+
l,
|
|
1710
|
+
t.oddsPollingInterval || 3e4,
|
|
1711
|
+
{ operatorId: t.operatorId, affiliateId: t.affiliateId }
|
|
1712
|
+
), b = X((c) => {
|
|
1713
|
+
o.current.delete(c);
|
|
1714
|
+
const p = c.split(":"), d = p[p.length - 2], f = p.slice(0, p.length - 2).join(":");
|
|
1715
|
+
n((g) => {
|
|
1716
|
+
const y = g.findIndex((u) => {
|
|
1717
|
+
const x = u.split(":");
|
|
1718
|
+
return x.slice(0, x.length - 2).join(":") === f && x[x.length - 2] === d;
|
|
1719
|
+
});
|
|
1720
|
+
if (y !== -1) {
|
|
1721
|
+
const u = [...g];
|
|
1722
|
+
return u[y] = c, u;
|
|
1723
|
+
}
|
|
1724
|
+
return [...g, c];
|
|
1725
|
+
});
|
|
1726
|
+
}, []), h = X((c) => {
|
|
1727
|
+
n((p) => p.filter((d) => d !== c));
|
|
1728
|
+
}, []);
|
|
1729
|
+
return L(() => {
|
|
1730
|
+
a.filter((c) => c.matchStatus === "finished").forEach((c) => h(`${c.eventId}:${c.market}:${c.outcome}`));
|
|
1731
|
+
}, [a, h]), L(() => {
|
|
1732
|
+
l.forEach((c) => {
|
|
1733
|
+
var d, f;
|
|
1734
|
+
const p = `${c.eventId}:${c.market}:${c.outcome}`;
|
|
1735
|
+
if (jt(r, m, c.eventId, c.market, p)) {
|
|
1736
|
+
if (!o.current.has(p)) {
|
|
1737
|
+
o.current.add(p);
|
|
1738
|
+
const g = ((f = (d = ((r == null ? void 0 : r.get(c.eventId)) ?? [])[0]) == null ? void 0 : d.bookmaker) == null ? void 0 : f.name) ?? "the bookmaker";
|
|
1739
|
+
console.warn(
|
|
1740
|
+
`[betslip] Removing "${p}": ${g} returned no ${c.market} odds for this event.`
|
|
1741
|
+
);
|
|
1742
|
+
}
|
|
1743
|
+
h(p);
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
}, [r, m, l, h]), L(() => (j._mount({ setSelection: b, removeSelection: h }), () => j._unmount()), [b, h]), !e.length || !l.length && i ? null : /* @__PURE__ */ S(
|
|
1747
|
+
Qt,
|
|
1748
|
+
{
|
|
1749
|
+
labels: t.labels,
|
|
1750
|
+
initialSelections: l,
|
|
1751
|
+
maxSelections: t.maxSelections,
|
|
1752
|
+
currency: t.currency,
|
|
1753
|
+
stakePresets: t.stakePresets,
|
|
1754
|
+
ctaUrlTemplate: t.ctaUrlTemplate,
|
|
1755
|
+
onExternalRemove: h,
|
|
1756
|
+
sharedOddsMap: r,
|
|
1757
|
+
children: [
|
|
1758
|
+
/* @__PURE__ */ s(we, {}),
|
|
1759
|
+
/* @__PURE__ */ s(Ce, { props: t })
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
);
|
|
1763
|
+
}, Ae = (t) => /* @__PURE__ */ s(
|
|
1764
|
+
wt,
|
|
1765
|
+
{
|
|
1766
|
+
packageName: "betslip",
|
|
1767
|
+
language: t.language,
|
|
1768
|
+
themeOptions: t.themeOptions,
|
|
1769
|
+
disableCache: t.disableCache,
|
|
1770
|
+
children: /* @__PURE__ */ s(Re, { ...t })
|
|
1771
|
+
}
|
|
1772
|
+
);
|
|
1773
|
+
export {
|
|
1774
|
+
Ae as M
|
|
1775
|
+
};
|