fansunited-frontend-components 0.0.98 → 1.0.0

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