@everymatrix/tournament-details-page 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,421 +0,0 @@
1
- var ge = (A, p, m) => new Promise((te, H) => {
2
- var L = (f) => {
3
- try {
4
- w(m.next(f));
5
- } catch (B) {
6
- H(B);
7
- }
8
- }, R = (f) => {
9
- try {
10
- w(m.throw(f));
11
- } catch (B) {
12
- H(B);
13
- }
14
- }, w = (f) => f.done ? te(f.value) : Promise.resolve(f.value).then(L, R);
15
- w((m = m.apply(A, p)).next());
16
- });
17
- import { a as Je, $ as Ke, p as Xe, b as Qe, d as y, u as Ve, e as be, j as C, L as Ye, P as Ze, w as k, i as E, g as a, t as D, y as P, H as M, f as u, h as $e, C as et, D as tt, s as at, k as x, m as T, n as l, v as Y, z as Z, q as $, r as ee, x as _, l as pe, A as nt, B as ot, E as i, N as he } from "./TournamentDetailsPage-C08JNvqr.js";
18
- function xe(A, p) {
19
- Je(A, p);
20
- }
21
- function _e(A) {
22
- Ke.set(A);
23
- }
24
- const we = {
25
- en: {
26
- previousButton: "Previous",
27
- nextButton: "Next",
28
- casinoTab: "Casino",
29
- sportsbookTab: "Sportsbook",
30
- gamesDescriptionTitle: "Participating games",
31
- gamesDescriptionSubtitle: "Discover the games",
32
- sportsRulesParseError: "Error parsing tournament rules",
33
- noAvailableGames: "No games have been configured yet!"
34
- },
35
- tr: {
36
- previousButton: "Önceki",
37
- nextButton: "Sonraki",
38
- casinoTab: "Casino",
39
- sportsbookTab: "Spor Bahisleri",
40
- gamesDescriptionTitle: "Katılımcı oyunlar",
41
- gamesDescriptionSubtitle: "Oyunları keşfedin",
42
- sportsRulesParseError: "Turnuva kuralları ayrıştırma hatası",
43
- noAvailableGames: "Henüz oyun yapılandırılmamış!"
44
- },
45
- da: {
46
- previousButton: "Forrige",
47
- nextButton: "Næste",
48
- casinoTab: "Casino",
49
- sportsbookTab: "Sportsbook",
50
- gamesDescriptionTitle: "Deltagende spil",
51
- gamesDescriptionSubtitle: "Opdag spillene",
52
- sportsRulesParseError: "Fejl ved parsing af turneringsregler",
53
- noAvailableGames: "Der er endnu ikke konfigureret nogen spil!"
54
- }
55
- }, rt = () => typeof window == "undefined";
56
- var st = _('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), it = _('<p class="svelte-p7mf8l"> </p>'), lt = _("<div></div>"), pt = _('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), mt = _("<p> </p>"), ut = _('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'), ct = _('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'), vt = _("<button> </button>"), dt = _('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'), ft = _('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationSkeletonButton svelte-p7mf8l"></div></div>'), gt = _('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');
57
- const bt = {
58
- hash: "svelte-p7mf8l",
59
- code: `.svelte-p7mf8l,
60
- .svelte-p7mf8l::before,
61
- .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;min-height:150px;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fill, minmax(min(170px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
62
- to top,
63
- var(--emw-color-primary, #FF1D4E),
64
- transparent
65
- );background-size:100% 200%;
66
- animation: svelte-p7mf8l-pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
67
- animation: svelte-p7mf8l-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
68
- animation: svelte-p7mf8l-pulse 1s infinite;}}
69
-
70
- @keyframes svelte-p7mf8l-pulse {
71
- 0% {
72
- opacity: 0;
73
- }
74
- 50% {
75
- opacity: 1;
76
- }
77
- 100% {
78
- opacity: 0;
79
- }
80
- }
81
-
82
-
83
- @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
84
-
85
- }
86
-
87
- @media (max-width: 475px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(150px, 100%), 1fr));}.PaginationWrapper.svelte-p7mf8l {& .PaginationButton:where(.svelte-p7mf8l) {font-size:11px;&.Number {font-size:11px;}}}.TournamentGamesTabs.svelte-p7mf8l {font-size:12px;}
88
- }
89
-
90
- @media (max-width: 380px) {.TournamentGamesContainer.svelte-p7mf8l {grid-template-columns:repeat(auto-fill, minmax(min(145px, 100%), 1fr));}
91
- }
92
-
93
- @media (min-width: 1500px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(215px, 100%), 1fr));}
94
- }.Hidden.svelte-p7mf8l {display:none;}`
95
- };
96
- function ht(A, p) {
97
- var fe;
98
- Xe(p, !0), Qe(A, bt);
99
- const m = () => et(tt, "$_", te), [te, H] = at(), L = y(p, "initialGames"), R = y(p, "endpoint"), w = y(p, "language", 7, "en"), f = y(p, "session"), B = y(p, "tournamentid"), g = y(p, "gamesLimit", 7, 6), O = y(p, "totalGames"), ae = y(p, "platformProp", 7, null), z = y(p, "tournamentMetadata"), F = y(p, "translationurl"), ye = () => {
100
- let e = new URL(F());
101
- fetch(e.href).then((t) => t.json()).then((t) => {
102
- Object.keys(t).forEach((n) => {
103
- xe(n, t[n]);
104
- });
105
- }).catch((t) => {
106
- console.log(t);
107
- });
108
- };
109
- Object.keys(we).forEach((e) => {
110
- xe(e, we[e]);
111
- }), _e(w());
112
- const ke = () => {
113
- _e(w());
114
- };
115
- Ve(() => {
116
- F() && ye();
117
- }), be(() => {
118
- ke();
119
- });
120
- let ne = C(Ye(L() || [])), I = C(!1), b = C(0), U = C(void 0), q = C(!0);
121
- const Pe = rt() ? (fe = ae()) != null ? fe : "dk" : Ze(window.navigator.userAgent), oe = () => ge(this, null, function* () {
122
- if (re.has(a(J)))
123
- return;
124
- x(I, !0);
125
- const e = new URL(`${R()}/v1/tournaments/${B()}`), t = new Headers();
126
- f() && t.append("X-SessionId", f());
127
- const n = { method: "GET", headers: t };
128
- e.searchParams.append("filter", `id=${B()}`), e.searchParams.append("language", w()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${g()},offset=${a(b)})`), e.searchParams.append("platform", Pe), fetch(e, n).then((o) => o.json()).then((o) => {
129
- var d, r;
130
- x(ne, (r = (d = o == null ? void 0 : o.item) == null ? void 0 : d.games) == null ? void 0 : r.items, !0), re.set(a(J), a(ne)), a(q) || x(q, !0);
131
- }).catch((o) => console.log(o)).finally(() => x(I, !1));
132
- }), Te = () => {
133
- const e = Math.ceil(O() / g()), t = Math.floor(a(b) / g()) + 1;
134
- if (e <= 5)
135
- return Array.from({ length: e }, (o, d) => d + 1);
136
- const n = [];
137
- return n.push(1), t <= 3 ? (n.push(2, 3), n.push("..."), n.push(e)) : t >= e - 2 ? (n.push("..."), n.push(e - 2, e - 1, e)) : (n.push("..."), n.push(t - 1, t, t + 1), n.push("..."), n.push(e)), n;
138
- }, Ge = () => {
139
- a(b) < O() && (x(b, a(b) + g()), oe());
140
- }, Se = () => {
141
- a(b) !== 0 && (x(b, a(b) - g()), oe());
142
- }, Ae = (e) => {
143
- x(b, (e - 1) * g()), oe();
144
- }, Be = pe(Te), J = pe(() => Math.floor(a(b) / g()) + 1);
145
- let re = /* @__PURE__ */ new Map([[1, L()]]), Ne = pe(() => {
146
- var e;
147
- return (e = re.get(a(J))) != null ? e : [];
148
- }), N = C("casino");
149
- const De = () => {
150
- var n;
151
- if (!z()) return;
152
- const e = (n = z().sports) == null ? void 0 : n.rules;
153
- let t;
154
- if (e)
155
- try {
156
- t = JSON.parse(e), x(U, t[w()] || t["*"], !0);
157
- } catch (o) {
158
- console.log(o), x(U, `${m()("sportsRulesParseError")}`);
159
- }
160
- }, je = (e) => {
161
- window.postMessage(
162
- {
163
- type: "Tournaments:PlayGame",
164
- launchUrl: e.launchUrl,
165
- id: e.gameId,
166
- thumbnail: e.thumbnail,
167
- name: e.name
168
- },
169
- window.location.href
170
- );
171
- };
172
- be(() => {
173
- Object.keys(z()).length !== 0 && De();
174
- });
175
- var Ee = {
176
- get initialGames() {
177
- return L();
178
- },
179
- set initialGames(e) {
180
- L(e), T();
181
- },
182
- get endpoint() {
183
- return R();
184
- },
185
- set endpoint(e) {
186
- R(e), T();
187
- },
188
- get language() {
189
- return w();
190
- },
191
- set language(e = "en") {
192
- w(e), T();
193
- },
194
- get session() {
195
- return f();
196
- },
197
- set session(e) {
198
- f(e), T();
199
- },
200
- get tournamentid() {
201
- return B();
202
- },
203
- set tournamentid(e) {
204
- B(e), T();
205
- },
206
- get gamesLimit() {
207
- return g();
208
- },
209
- set gamesLimit(e = 6) {
210
- g(e), T();
211
- },
212
- get totalGames() {
213
- return O();
214
- },
215
- set totalGames(e) {
216
- O(e), T();
217
- },
218
- get platformProp() {
219
- return ae();
220
- },
221
- set platformProp(e = null) {
222
- ae(e), T();
223
- },
224
- get tournamentMetadata() {
225
- return z();
226
- },
227
- set tournamentMetadata(e) {
228
- z(e), T();
229
- },
230
- get translationurl() {
231
- return F();
232
- },
233
- set translationurl(e) {
234
- F(e), T();
235
- }
236
- }, se = gt(), ie = l(se), le = l(ie), Me = l(le, !0);
237
- i(le);
238
- var me = k(le, 2), Le = l(me, !0);
239
- i(me), i(ie);
240
- var ue = k(ie, 2);
241
- {
242
- var Oe = (e) => {
243
- var t = st(), n = l(t);
244
- let o;
245
- n.__click = () => x(N, "casino");
246
- var d = l(n, !0);
247
- i(n);
248
- var r = k(n, 2);
249
- let s;
250
- r.__click = () => x(N, "sports");
251
- var c = l(r, !0);
252
- i(r), i(t), D(
253
- (h, v) => {
254
- o = M(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(N) === "casino" }), P(d, h), s = M(r, 1, "Tab svelte-p7mf8l", null, s, { Active: a(N) === "sports" }), P(c, v);
255
- },
256
- [() => m()("casinoTab"), () => m()("sportsbookTab")]
257
- ), u(e, t);
258
- };
259
- E(ue, (e) => {
260
- Object.keys(z()).length !== 0 && e(Oe);
261
- });
262
- }
263
- var ce = k(ue, 2);
264
- {
265
- var ze = (e) => {
266
- var t = lt();
267
- let n;
268
- Y(t, 21, () => a(U), Z, (o, d) => {
269
- var r = it(), s = l(r);
270
- i(r), D((c) => {
271
- var h;
272
- return P(s, `${(h = a(d).rule) != null ? h : ""} ${c != null ? c : ""}`);
273
- }, [() => m()("contribution")]), u(o, r);
274
- }), i(t), D(() => n = M(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(N) === "casino" })), u(e, t);
275
- };
276
- E(ce, (e) => {
277
- a(U) && e(ze);
278
- });
279
- }
280
- var K = k(ce, 2);
281
- let ve;
282
- var Ce = l(K);
283
- {
284
- var Re = (e) => {
285
- var t = $(), n = ee(t);
286
- Y(n, 17, () => Array(g()), Z, (o, d, r, s) => {
287
- var c = pt();
288
- u(o, c);
289
- }), u(e, t);
290
- }, We = (e) => {
291
- var t = $(), n = ee(t);
292
- {
293
- var o = (r) => {
294
- var s = mt();
295
- let c;
296
- var h = l(s, !0);
297
- i(s), D(
298
- (v) => {
299
- c = M(s, 1, "NoGamesAvailable svelte-p7mf8l", null, c, { Hidden: a(N) === "sports" }), P(h, v);
300
- },
301
- [() => m()("noAvailableGames")]
302
- ), u(r, s);
303
- }, d = (r) => {
304
- var s = $(), c = ee(s);
305
- Y(c, 17, () => a(Ne), Z, (h, v) => {
306
- var j = ut();
307
- j.__click = () => je(a(v));
308
- var X = l(j), W = l(X), Q = k(W, 2), G = l(Q), S = l(G, !0);
309
- i(G), i(Q), i(X), i(j), D(
310
- (V) => {
311
- he(W, "src", `https:${a(v).thumbnail}`), he(W, "alt", a(v).name), P(S, V);
312
- },
313
- [() => m()("play")]
314
- ), u(h, j);
315
- }), u(r, s);
316
- };
317
- E(
318
- n,
319
- (r) => {
320
- var s;
321
- !a(I) && ((s = a(ne)) == null ? void 0 : s.length) === 0 ? r(o) : r(d, !1);
322
- },
323
- !0
324
- );
325
- }
326
- u(e, t);
327
- };
328
- E(Ce, (e) => {
329
- a(I) ? e(Re) : e(We, !1);
330
- });
331
- }
332
- i(K);
333
- var de = k(K, 2);
334
- {
335
- var He = (e) => {
336
- var t = dt();
337
- let n;
338
- var o = l(t);
339
- o.__click = Se;
340
- var d = l(o, !0);
341
- i(o);
342
- var r = k(o, 2);
343
- Y(r, 21, () => a(Be), Z, (h, v) => {
344
- var j = $(), X = ee(j);
345
- {
346
- var W = (G) => {
347
- var S = ct();
348
- u(G, S);
349
- }, Q = (G) => {
350
- var S = vt();
351
- let V;
352
- S.__click = () => Ae(a(v));
353
- var qe = l(S, !0);
354
- i(S), D(() => {
355
- V = M(S, 1, "PaginationButton Number svelte-p7mf8l", null, V, { Active: a(v) === a(J) }), P(qe, a(v));
356
- }), u(G, S);
357
- };
358
- E(X, (G) => {
359
- typeof a(v) != "number" ? G(W) : G(Q, !1);
360
- });
361
- }
362
- u(h, j);
363
- }), i(r);
364
- var s = k(r, 2);
365
- s.__click = Ge;
366
- var c = l(s, !0);
367
- i(s), i(t), D(
368
- (h, v) => {
369
- n = M(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(N) === "sports" }), o.disabled = a(b) === 0, P(d, h), s.disabled = a(b) >= O() - g(), P(c, v);
370
- },
371
- [() => m()("previousButton"), () => m()("nextButton")]
372
- ), u(e, t);
373
- };
374
- E(de, (e) => {
375
- a(q) && O() > g() && e(He);
376
- });
377
- }
378
- var Fe = k(de, 2);
379
- {
380
- var Ie = (e) => {
381
- var t = ft();
382
- u(e, t);
383
- };
384
- E(Fe, (e) => {
385
- a(q) || e(Ie);
386
- });
387
- }
388
- i(se), D(
389
- (e, t) => {
390
- P(Me, e), P(Le, t), ve = M(K, 1, "TournamentGamesContainer svelte-p7mf8l", null, ve, { Hidden: a(N) === "sports" });
391
- },
392
- [
393
- () => m()("gamesDescriptionTitle"),
394
- () => m()("gamesDescriptionSubtitle")
395
- ]
396
- ), u(A, se);
397
- var Ue = $e(Ee);
398
- return H(), Ue;
399
- }
400
- nt(["click"]);
401
- customElements.define("tournament-games", ot(
402
- ht,
403
- {
404
- initialGames: {},
405
- endpoint: {},
406
- language: {},
407
- session: {},
408
- tournamentid: {},
409
- gamesLimit: {},
410
- totalGames: {},
411
- platformProp: {},
412
- tournamentMetadata: {},
413
- translationurl: {}
414
- },
415
- [],
416
- [],
417
- !1
418
- ));
419
- export {
420
- ht as default
421
- };
@@ -1,36 +0,0 @@
1
- "use strict";var Z=(_,l,i)=>new Promise((C,A)=>{var k=f=>{try{g(i.next(f))}catch(x){A(x)}},S=f=>{try{g(i.throw(f))}catch(x){A(x)}},g=f=>f.done?C(f.value):Promise.resolve(f.value).then(k,S);g((i=i.apply(_,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetailsPage-BZaRRP7T.cjs");function $(_,l){e.addMessages(_,l)}function ee(_){e.$locale.set(_)}const te={en:{previousButton:"Previous",nextButton:"Next",casinoTab:"Casino",sportsbookTab:"Sportsbook",gamesDescriptionTitle:"Participating games",gamesDescriptionSubtitle:"Discover the games",sportsRulesParseError:"Error parsing tournament rules",noAvailableGames:"No games have been configured yet!"},tr:{previousButton:"Önceki",nextButton:"Sonraki",casinoTab:"Casino",sportsbookTab:"Spor Bahisleri",gamesDescriptionTitle:"Katılımcı oyunlar",gamesDescriptionSubtitle:"Oyunları keşfedin",sportsRulesParseError:"Turnuva kuralları ayrıştırma hatası",noAvailableGames:"Henüz oyun yapılandırılmamış!"},da:{previousButton:"Forrige",nextButton:"Næste",casinoTab:"Casino",sportsbookTab:"Sportsbook",gamesDescriptionTitle:"Deltagende spil",gamesDescriptionSubtitle:"Opdag spillene",sportsRulesParseError:"Fejl ved parsing af turneringsregler",noAvailableGames:"Der er endnu ikke konfigureret nogen spil!"}},Ge=()=>typeof window=="undefined";var Ae=e.from_html('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'),Be=e.from_html('<p class="svelte-p7mf8l"> </p>'),Ne=e.from_html("<div></div>"),De=e.from_html('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'),je=e.from_html("<p> </p>"),Me=e.from_html('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'),Ee=e.from_html('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'),Oe=e.from_html("<button> </button>"),Le=e.from_html('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'),ze=e.from_html('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationSkeletonButton svelte-p7mf8l"></div></div>'),Ce=e.from_html('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');const Re={hash:"svelte-p7mf8l",code:`.svelte-p7mf8l,
2
- .svelte-p7mf8l::before,
3
- .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;min-height:150px;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fill, minmax(min(170px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
4
- to top,
5
- var(--emw-color-primary, #FF1D4E),
6
- transparent
7
- );background-size:100% 200%;
8
- animation: svelte-p7mf8l-pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
9
- animation: svelte-p7mf8l-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
10
- animation: svelte-p7mf8l-pulse 1s infinite;}}
11
-
12
- @keyframes svelte-p7mf8l-pulse {
13
- 0% {
14
- opacity: 0;
15
- }
16
- 50% {
17
- opacity: 1;
18
- }
19
- 100% {
20
- opacity: 0;
21
- }
22
- }
23
-
24
-
25
- @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
26
-
27
- }
28
-
29
- @media (max-width: 475px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(150px, 100%), 1fr));}.PaginationWrapper.svelte-p7mf8l {& .PaginationButton:where(.svelte-p7mf8l) {font-size:11px;&.Number {font-size:11px;}}}.TournamentGamesTabs.svelte-p7mf8l {font-size:12px;}
30
- }
31
-
32
- @media (max-width: 380px) {.TournamentGamesContainer.svelte-p7mf8l {grid-template-columns:repeat(auto-fill, minmax(min(145px, 100%), 1fr));}
33
- }
34
-
35
- @media (min-width: 1500px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(215px, 100%), 1fr));}
36
- }.Hidden.svelte-p7mf8l {display:none;}`};function ae(_,l){var Y;e.push(l,!0),e.append_styles(_,Re);const i=()=>e.store_get(e.$format,"$_",C),[C,A]=e.setup_stores(),k=e.prop(l,"initialGames"),S=e.prop(l,"endpoint"),g=e.prop(l,"language",7,"en"),f=e.prop(l,"session"),x=e.prop(l,"tournamentid"),d=e.prop(l,"gamesLimit",7,6),P=e.prop(l,"totalGames"),R=e.prop(l,"platformProp",7,null),T=e.prop(l,"tournamentMetadata"),B=e.prop(l,"translationurl"),ne=()=>{let t=new URL(B());fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(n=>{$(n,a[n])})}).catch(a=>{console.log(a)})};Object.keys(te).forEach(t=>{$(t,te[t])}),ee(g());const re=()=>{ee(g())};e.user_pre_effect(()=>{B()&&ne()}),e.user_effect(()=>{re()});let W=e.state(e.proxy(k()||[])),N=e.state(!1),u=e.state(0),D=e.state(void 0),j=e.state(!0);const se=Ge()?(Y=R())!=null?Y:"dk":e.getDevice(window.navigator.userAgent),H=()=>Z(this,null,function*(){if(F.has(e.get(M)))return;e.set(N,!0);const t=new URL(`${S()}/v1/tournaments/${x()}`),a=new Headers;f()&&a.append("X-SessionId",f());const n={method:"GET",headers:a};t.searchParams.append("filter",`id=${x()}`),t.searchParams.append("language",g()),t.searchParams.append("expand","games"),t.searchParams.append("pagination",`games(limit=${d()},offset=${e.get(u)})`),t.searchParams.append("platform",se),fetch(t,n).then(r=>r.json()).then(r=>{var c,s;e.set(W,(s=(c=r==null?void 0:r.item)==null?void 0:c.games)==null?void 0:s.items,!0),F.set(e.get(M),e.get(W)),e.get(j)||e.set(j,!0)}).catch(r=>console.log(r)).finally(()=>e.set(N,!1))}),oe=()=>{const t=Math.ceil(P()/d()),a=Math.floor(e.get(u)/d())+1;if(t<=5)return Array.from({length:t},(r,c)=>c+1);const n=[];return n.push(1),a<=3?(n.push(2,3),n.push("..."),n.push(t)):a>=t-2?(n.push("..."),n.push(t-2,t-1,t)):(n.push("..."),n.push(a-1,a,a+1),n.push("..."),n.push(t)),n},le=()=>{e.get(u)<P()&&(e.set(u,e.get(u)+d()),H())},ie=()=>{e.get(u)!==0&&(e.set(u,e.get(u)-d()),H())},pe=t=>{e.set(u,(t-1)*d()),H()},me=e.user_derived(oe),M=e.user_derived(()=>Math.floor(e.get(u)/d())+1);let F=new Map([[1,k()]]),ce=e.user_derived(()=>{var t;return(t=F.get(e.get(M)))!=null?t:[]}),y=e.state("casino");const fe=()=>{var n;if(!T())return;const t=(n=T().sports)==null?void 0:n.rules;let a;if(t)try{a=JSON.parse(t),e.set(D,a[g()]||a["*"],!0)}catch(r){console.log(r),e.set(D,`${i()("sportsRulesParseError")}`)}},de=t=>{window.postMessage({type:"Tournaments:PlayGame",launchUrl:t.launchUrl,id:t.gameId,thumbnail:t.thumbnail,name:t.name},window.location.href)};e.user_effect(()=>{Object.keys(T()).length!==0&&fe()});var ue={get initialGames(){return k()},set initialGames(t){k(t),e.flushSync()},get endpoint(){return S()},set endpoint(t){S(t),e.flushSync()},get language(){return g()},set language(t="en"){g(t),e.flushSync()},get session(){return f()},set session(t){f(t),e.flushSync()},get tournamentid(){return x()},set tournamentid(t){x(t),e.flushSync()},get gamesLimit(){return d()},set gamesLimit(t=6){d(t),e.flushSync()},get totalGames(){return P()},set totalGames(t){P(t),e.flushSync()},get platformProp(){return R()},set platformProp(t=null){R(t),e.flushSync()},get tournamentMetadata(){return T()},set tournamentMetadata(t){T(t),e.flushSync()},get translationurl(){return B()},set translationurl(t){B(t),e.flushSync()}},I=Ce(),U=e.child(I),q=e.child(U),ve=e.child(q,!0);e.reset(q);var J=e.sibling(q,2),ge=e.child(J,!0);e.reset(J),e.reset(U);var K=e.sibling(U,2);{var he=t=>{var a=Ae(),n=e.child(a);let r;n.__click=()=>e.set(y,"casino");var c=e.child(n,!0);e.reset(n);var s=e.sibling(n,2);let o;s.__click=()=>e.set(y,"sports");var p=e.child(s,!0);e.reset(s),e.reset(a),e.template_effect((v,m)=>{r=e.set_class(n,1,"Tab svelte-p7mf8l",null,r,{Active:e.get(y)==="casino"}),e.set_text(c,v),o=e.set_class(s,1,"Tab svelte-p7mf8l",null,o,{Active:e.get(y)==="sports"}),e.set_text(p,m)},[()=>i()("casinoTab"),()=>i()("sportsbookTab")]),e.append(t,a)};e.if_block(K,t=>{Object.keys(T()).length!==0&&t(he)})}var X=e.sibling(K,2);{var be=t=>{var a=Ne();let n;e.each(a,21,()=>e.get(D),e.index,(r,c)=>{var s=Be(),o=e.child(s);e.reset(s),e.template_effect(p=>{var v;return e.set_text(o,`${(v=e.get(c).rule)!=null?v:""} ${p!=null?p:""}`)},[()=>i()("contribution")]),e.append(r,s)}),e.reset(a),e.template_effect(()=>n=e.set_class(a,1,"TournamentRulesWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="casino"})),e.append(t,a)};e.if_block(X,t=>{e.get(D)&&t(be)})}var E=e.sibling(X,2);let Q;var _e=e.child(E);{var xe=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(d()),e.index,(r,c,s,o)=>{var p=De();e.append(r,p)}),e.append(t,a)},ye=t=>{var a=e.comment(),n=e.first_child(a);{var r=s=>{var o=je();let p;var v=e.child(o,!0);e.reset(o),e.template_effect(m=>{p=e.set_class(o,1,"NoGamesAvailable svelte-p7mf8l",null,p,{Hidden:e.get(y)==="sports"}),e.set_text(v,m)},[()=>i()("noAvailableGames")]),e.append(s,o)},c=s=>{var o=e.comment(),p=e.first_child(o);e.each(p,17,()=>e.get(ce),e.index,(v,m)=>{var w=Me();w.__click=()=>de(e.get(m));var O=e.child(w),G=e.child(O),L=e.sibling(G,2),h=e.child(L),b=e.child(h,!0);e.reset(h),e.reset(L),e.reset(O),e.reset(w),e.template_effect(z=>{e.set_attribute(G,"src",`https:${e.get(m).thumbnail}`),e.set_attribute(G,"alt",e.get(m).name),e.set_text(b,z)},[()=>i()("play")]),e.append(v,w)}),e.append(s,o)};e.if_block(n,s=>{var o;!e.get(N)&&((o=e.get(W))==null?void 0:o.length)===0?s(r):s(c,!1)},!0)}e.append(t,a)};e.if_block(_e,t=>{e.get(N)?t(xe):t(ye,!1)})}e.reset(E);var V=e.sibling(E,2);{var we=t=>{var a=Le();let n;var r=e.child(a);r.__click=ie;var c=e.child(r,!0);e.reset(r);var s=e.sibling(r,2);e.each(s,21,()=>e.get(me),e.index,(v,m)=>{var w=e.comment(),O=e.first_child(w);{var G=h=>{var b=Ee();e.append(h,b)},L=h=>{var b=Oe();let z;b.__click=()=>pe(e.get(m));var Se=e.child(b,!0);e.reset(b),e.template_effect(()=>{z=e.set_class(b,1,"PaginationButton Number svelte-p7mf8l",null,z,{Active:e.get(m)===e.get(M)}),e.set_text(Se,e.get(m))}),e.append(h,b)};e.if_block(O,h=>{typeof e.get(m)!="number"?h(G):h(L,!1)})}e.append(v,w)}),e.reset(s);var o=e.sibling(s,2);o.__click=le;var p=e.child(o,!0);e.reset(o),e.reset(a),e.template_effect((v,m)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="sports"}),r.disabled=e.get(u)===0,e.set_text(c,v),o.disabled=e.get(u)>=P()-d(),e.set_text(p,m)},[()=>i()("previousButton"),()=>i()("nextButton")]),e.append(t,a)};e.if_block(V,t=>{e.get(j)&&P()>d()&&t(we)})}var ke=e.sibling(V,2);{var Pe=t=>{var a=ze();e.append(t,a)};e.if_block(ke,t=>{e.get(j)||t(Pe)})}e.reset(I),e.template_effect((t,a)=>{e.set_text(ve,t),e.set_text(ge,a),Q=e.set_class(E,1,"TournamentGamesContainer svelte-p7mf8l",null,Q,{Hidden:e.get(y)==="sports"})},[()=>i()("gamesDescriptionTitle"),()=>i()("gamesDescriptionSubtitle")]),e.append(_,I);var Te=e.pop(ue);return A(),Te}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(ae,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{},translationurl:{}},[],[],!1));exports.default=ae;