@everymatrix/casino-header-controller-nd 1.72.1 → 1.73.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.
- package/components/{CasinoHeaderControllerNd-HxHgjp2M.cjs → CasinoHeaderControllerNd-C59JkD6c.cjs} +1 -1
- package/components/{CasinoHeaderControllerNd-B0bAQaCY.js → CasinoHeaderControllerNd-C5dFDHA0.js} +466 -445
- package/components/{CasinoHeaderControllerNd-UcryA1Kq.js → CasinoHeaderControllerNd-hJyHQkbi.js} +476 -455
- package/components/{PlayerAccountBalanceModalNd-ChQMG2EM.js → PlayerAccountBalanceModalNd-C3hEBggB.js} +67 -73
- package/components/{PlayerAccountBalanceModalNd-BxY0Gcer.cjs → PlayerAccountBalanceModalNd-DdxFQZsQ.cjs} +1 -1
- package/components/{PlayerAccountBalanceModalNd-ByFMRCSL.js → PlayerAccountBalanceModalNd-DnL9uImY.js} +66 -72
- package/es2015/casino-header-controller-nd.cjs +1 -1
- package/es2015/casino-header-controller-nd.js +1 -1
- package/esnext/casino-header-controller-nd.js +1 -1
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ var $e = (i, t, a) => new Promise((g, h) => {
|
|
|
26
26
|
}, m = (v) => v.done ? g(v.value) : Promise.resolve(v.value).then(d, B);
|
|
27
27
|
m((a = a.apply(i, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import { b as yt, $ as vt, N as wt, S as bt, i as Bt, s as Tt, f as G, d as St, A as Ke, g as me, k as C, o as ge, p as _, r as I, v as ye, w as Ct, x as _t, y as At, q as je, B as
|
|
29
|
+
import { b as yt, $ as vt, N as wt, S as bt, i as Bt, s as Tt, f as G, d as St, A as Ke, g as me, k as C, o as ge, p as _, r as I, v as ye, w as Ct, x as _t, y as At, q as je, B as xt, D as Be, E as Te, F as et, z as Rt, G as He, H as ct, C as Et, K as Dt, L as Mt, M as Lt, c as kt, J as Ot } from "./CasinoHamburgerMenuNd-D5qHcIAM.js";
|
|
30
30
|
function tt(i, t) {
|
|
31
31
|
yt(i, t);
|
|
32
32
|
}
|
|
@@ -241,7 +241,7 @@ var qe = { exports: {} };
|
|
|
241
241
|
*/
|
|
242
242
|
(function(i, t) {
|
|
243
243
|
(function(a) {
|
|
244
|
-
var g = a.setTimeout, h = a.clearTimeout, d = a.XMLHttpRequest, B = a.XDomainRequest, m = a.ActiveXObject, v = a.EventSource, b = a.document, M = a.Promise, k = a.fetch, L = a.Response, A = a.TextDecoder, T = a.TextEncoder,
|
|
244
|
+
var g = a.setTimeout, h = a.clearTimeout, d = a.XMLHttpRequest, B = a.XDomainRequest, m = a.ActiveXObject, v = a.EventSource, b = a.document, M = a.Promise, k = a.fetch, L = a.Response, A = a.TextDecoder, T = a.TextEncoder, x = a.AbortController;
|
|
245
245
|
if (typeof window != "undefined" && typeof b != "undefined" && !("readyState" in b) && b.body == null && (b.readyState = "loading", window.addEventListener("load", function(n) {
|
|
246
246
|
b.readyState = "complete";
|
|
247
247
|
}, !1)), d == null && m != null && (d = function() {
|
|
@@ -252,7 +252,7 @@ var qe = { exports: {} };
|
|
|
252
252
|
return c.prototype = n, new c();
|
|
253
253
|
}), Date.now || (Date.now = function() {
|
|
254
254
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
255
|
-
}),
|
|
255
|
+
}), x == null) {
|
|
256
256
|
var j = k;
|
|
257
257
|
k = function(n, c) {
|
|
258
258
|
var u = c.signal;
|
|
@@ -269,7 +269,7 @@ var qe = { exports: {} };
|
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
271
|
});
|
|
272
|
-
},
|
|
272
|
+
}, x = function() {
|
|
273
273
|
this.signal = {
|
|
274
274
|
_reader: null,
|
|
275
275
|
_aborted: !1
|
|
@@ -328,16 +328,16 @@ var qe = { exports: {} };
|
|
|
328
328
|
};
|
|
329
329
|
var s = function() {
|
|
330
330
|
if (r === 1) {
|
|
331
|
-
var y = 0,
|
|
331
|
+
var y = 0, R = "", ne = void 0;
|
|
332
332
|
if ("contentType" in e)
|
|
333
|
-
y = 200,
|
|
333
|
+
y = 200, R = "OK", ne = e.contentType;
|
|
334
334
|
else
|
|
335
335
|
try {
|
|
336
|
-
y = e.status,
|
|
336
|
+
y = e.status, R = e.statusText, ne = e.getResponseHeader("Content-Type");
|
|
337
337
|
} catch (re) {
|
|
338
|
-
y = 0,
|
|
338
|
+
y = 0, R = "", ne = void 0;
|
|
339
339
|
}
|
|
340
|
-
y !== 0 && (r = 2, u.readyState = 2, u.status = y, u.statusText =
|
|
340
|
+
y !== 0 && (r = 2, u.readyState = 2, u.status = y, u.statusText = R, u._contentType = ne, u.onreadystatechange());
|
|
341
341
|
}
|
|
342
342
|
}, w = function() {
|
|
343
343
|
if (s(), r === 2 || r === 3) {
|
|
@@ -345,20 +345,20 @@ var qe = { exports: {} };
|
|
|
345
345
|
var y = "";
|
|
346
346
|
try {
|
|
347
347
|
y = e.responseText;
|
|
348
|
-
} catch (
|
|
348
|
+
} catch (R) {
|
|
349
349
|
}
|
|
350
350
|
u.readyState = 3, u.responseText = y, u.onprogress();
|
|
351
351
|
}
|
|
352
|
-
}, p = function(y,
|
|
353
|
-
if ((
|
|
352
|
+
}, p = function(y, R) {
|
|
353
|
+
if ((R == null || R.preventDefault == null) && (R = {
|
|
354
354
|
preventDefault: F
|
|
355
355
|
}), w(), r === 1 || r === 2 || r === 3) {
|
|
356
356
|
if (r = 4, o !== 0 && (h(o), o = 0), u.readyState = 4, y === "load")
|
|
357
|
-
u.onload(
|
|
357
|
+
u.onload(R);
|
|
358
358
|
else if (y === "error")
|
|
359
|
-
u.onerror(
|
|
359
|
+
u.onerror(R);
|
|
360
360
|
else if (y === "abort")
|
|
361
|
-
u.onabort(
|
|
361
|
+
u.onabort(R);
|
|
362
362
|
else
|
|
363
363
|
throw new TypeError();
|
|
364
364
|
u.onreadystatechange();
|
|
@@ -438,8 +438,8 @@ var qe = { exports: {} };
|
|
|
438
438
|
e(null);
|
|
439
439
|
}, n.onreadystatechange = function() {
|
|
440
440
|
if (n.readyState === d.HEADERS_RECEIVED) {
|
|
441
|
-
var l = n.status, S = n.statusText, y = n.getResponseHeader("Content-Type"),
|
|
442
|
-
c(l, S, y, new ce(
|
|
441
|
+
var l = n.status, S = n.statusText, y = n.getResponseHeader("Content-Type"), R = n.getAllResponseHeaders();
|
|
442
|
+
c(l, S, y, new ce(R));
|
|
443
443
|
}
|
|
444
444
|
}, n.withCredentials = o;
|
|
445
445
|
for (var p in s)
|
|
@@ -455,18 +455,18 @@ var qe = { exports: {} };
|
|
|
455
455
|
function E() {
|
|
456
456
|
}
|
|
457
457
|
E.prototype.open = function(n, c, u, e, r, o, s) {
|
|
458
|
-
var w = null, p = new
|
|
458
|
+
var w = null, p = new x(), l = p.signal, S = new A();
|
|
459
459
|
return k(r, {
|
|
460
460
|
headers: s,
|
|
461
461
|
credentials: o ? "include" : "same-origin",
|
|
462
462
|
signal: l,
|
|
463
463
|
cache: "no-store"
|
|
464
464
|
}).then(function(y) {
|
|
465
|
-
return w = y.body.getReader(), c(y.status, y.statusText, y.headers.get("Content-Type"), new N(y.headers)), new M(function(
|
|
465
|
+
return w = y.body.getReader(), c(y.status, y.statusText, y.headers.get("Content-Type"), new N(y.headers)), new M(function(R, ne) {
|
|
466
466
|
var re = function() {
|
|
467
467
|
w.read().then(function(Q) {
|
|
468
468
|
if (Q.done)
|
|
469
|
-
|
|
469
|
+
R(void 0);
|
|
470
470
|
else {
|
|
471
471
|
var K = S.decode(Q.value, { stream: !0 });
|
|
472
472
|
u(K), re();
|
|
@@ -539,7 +539,7 @@ var qe = { exports: {} };
|
|
|
539
539
|
P.call(this, n), this.error = c.error;
|
|
540
540
|
}
|
|
541
541
|
f.prototype = Object.create(P.prototype);
|
|
542
|
-
var ue = -1, le = 0, ae = 1, we = 2,
|
|
542
|
+
var ue = -1, le = 0, ae = 1, we = 2, xe = -1, se = 0, Re = 1, Se = 2, Le = 3, ze = /^text\/event\-stream(;.*)?$/i, Ee = 1e3, ke = 18e6, De = function(n, c) {
|
|
543
543
|
var u = n == null ? c : parseInt(n, 10);
|
|
544
544
|
return u !== u && (u = c), Ce(u);
|
|
545
545
|
}, Ce = function(n) {
|
|
@@ -560,7 +560,7 @@ var qe = { exports: {} };
|
|
|
560
560
|
var Ve = k != null && L != null && "body" in L.prototype;
|
|
561
561
|
function Ue(n, c, u) {
|
|
562
562
|
c = String(c);
|
|
563
|
-
var e = !!u.withCredentials, r = u.lastEventIdQueryParameterName || "lastEventId", o = Ce(1e3), s = De(u.heartbeatTimeout, 45e3), w = "", p = o, l = !1, S = 0, y = u.headers || {},
|
|
563
|
+
var e = !!u.withCredentials, r = u.lastEventIdQueryParameterName || "lastEventId", o = Ce(1e3), s = De(u.heartbeatTimeout, 45e3), w = "", p = o, l = !1, S = 0, y = u.headers || {}, R = u.Transport, ne = Ve && R == null ? void 0 : new O(R != null ? new R() : Oe()), re = R != null && typeof R != "string" ? new R() : ne == null ? new E() : new X(), Q = void 0, K = 0, ie = ue, _e = "", Fe = "", fe = "", Ie = "", q = se, Pe = 0, be = 0, dt = function(V, H, Z, $) {
|
|
564
564
|
if (ie === le)
|
|
565
565
|
if (V === 200 && Z != null && ze.test(Z)) {
|
|
566
566
|
ie = ae, l = Date.now(), p = o, n.readyState = ae;
|
|
@@ -590,11 +590,11 @@ var qe = { exports: {} };
|
|
|
590
590
|
Ie = (H === -1 ? Ie : "") + V.slice(H + 1), V !== "" && (l = Date.now(), S += V.length);
|
|
591
591
|
for (var U = 0; U < W.length; U += 1) {
|
|
592
592
|
var $ = W.charCodeAt(U);
|
|
593
|
-
if (q ===
|
|
593
|
+
if (q === xe && $ === 10)
|
|
594
594
|
q = se;
|
|
595
|
-
else if (q ===
|
|
595
|
+
else if (q === xe && (q = se), $ === 13 || $ === 10) {
|
|
596
596
|
if (q !== se) {
|
|
597
|
-
q ===
|
|
597
|
+
q === Re && (be = U + 1);
|
|
598
598
|
var pe = W.slice(Pe, be - 1), he = W.slice(be + (be < U && W.charCodeAt(be) === 32 ? 1 : 0), U);
|
|
599
599
|
pe === "data" ? (_e += `
|
|
600
600
|
`, _e += he) : pe === "id" ? Fe = he : pe === "event" ? fe = he : pe === "retry" ? (o = De(he, o), p = o) : pe === "heartbeatTimeout" && (s = De(he, s), K !== 0 && (h(K), K = g(function() {
|
|
@@ -613,9 +613,9 @@ var qe = { exports: {} };
|
|
|
613
613
|
}
|
|
614
614
|
_e = "", fe = "";
|
|
615
615
|
}
|
|
616
|
-
q = $ === 13 ?
|
|
616
|
+
q = $ === 13 ? xe : se;
|
|
617
617
|
} else
|
|
618
|
-
q === se && (Pe = U, q =
|
|
618
|
+
q === se && (Pe = U, q = Re), q === Re ? $ === 58 && (be = U + 1, q = Se) : q === Se && (q = Le);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
}, We = function(V) {
|
|
@@ -706,33 +706,33 @@ function jt(i) {
|
|
|
706
706
|
);
|
|
707
707
|
return {
|
|
708
708
|
c() {
|
|
709
|
-
t = I("button"), a = I("p"), h = Te(g), d = ye(), B = I("span"), m = et("svg"), v = et("path"), M = ye(), T && T.c(), k =
|
|
709
|
+
t = I("button"), a = I("p"), h = Te(g), d = ye(), B = I("span"), m = et("svg"), v = et("path"), M = ye(), T && T.c(), k = Rt(), C(v, "id", "arrow"), C(v, "d", "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z"), C(v, "transform", "translate(-274.511 -441.088)"), C(v, "fill", "#d1d1d1"), C(m, "xmlns", "http://www.w3.org/2000/svg"), C(m, "width", "14"), C(m, "height", "6.835"), C(m, "viewBox", "0 0 14 6.835"), C(B, "class", b = /*isModalDisplayed*/
|
|
710
710
|
i[3] ? "TriangleActive" : "TriangleInactive"), C(t, "class", "BalanceValue");
|
|
711
711
|
},
|
|
712
|
-
m(
|
|
713
|
-
ge(
|
|
712
|
+
m(x, j) {
|
|
713
|
+
ge(x, t, j), _(t, a), _(a, h), _(t, d), _(t, B), _(B, m), _(m, v), ge(x, M, j), T && T.m(x, j), ge(x, k, j), L || (A = je(
|
|
714
714
|
t,
|
|
715
715
|
"click",
|
|
716
716
|
/*click_handler*/
|
|
717
717
|
i[26]
|
|
718
718
|
), L = !0);
|
|
719
719
|
},
|
|
720
|
-
p(
|
|
720
|
+
p(x, j) {
|
|
721
721
|
j[0] & /*balances*/
|
|
722
722
|
2 && g !== (g = /*balances*/
|
|
723
|
-
(
|
|
723
|
+
(x[1].Total ? (
|
|
724
724
|
/*formatBalance*/
|
|
725
|
-
|
|
725
|
+
x[8](
|
|
726
726
|
/*balances*/
|
|
727
|
-
|
|
727
|
+
x[1].Total[0].amount
|
|
728
728
|
)
|
|
729
729
|
) : "0") + "") && Be(h, g), j[0] & /*isModalDisplayed*/
|
|
730
730
|
8 && b !== (b = /*isModalDisplayed*/
|
|
731
|
-
|
|
732
|
-
|
|
731
|
+
x[3] ? "TriangleActive" : "TriangleInactive") && C(B, "class", b), /*showBalance*/
|
|
732
|
+
x[4] ? T ? T.p(x, j) : (T = rt(x), T.c(), T.m(k.parentNode, k)) : T && (T.d(1), T = null);
|
|
733
733
|
},
|
|
734
|
-
d(
|
|
735
|
-
|
|
734
|
+
d(x) {
|
|
735
|
+
x && (me(t), me(M), me(k)), T && T.d(x), L = !1, A();
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
}
|
|
@@ -762,7 +762,7 @@ function rt(i) {
|
|
|
762
762
|
let t, a, g, h, d, B, m, v, b = (
|
|
763
763
|
/*$_*/
|
|
764
764
|
i[6]("Title") + ""
|
|
765
|
-
), M, k, L, A, T,
|
|
765
|
+
), M, k, L, A, T, x, j = (
|
|
766
766
|
/*$_*/
|
|
767
767
|
i[6]("DepositButton") + ""
|
|
768
768
|
), ee, te, F, O, Y, ce, X = He(Object.keys(
|
|
@@ -776,8 +776,8 @@ function rt(i) {
|
|
|
776
776
|
t = I("div"), a = I("button"), h = ye(), d = I("div"), B = I("div"), m = I("div"), v = I("p"), M = Te(b), k = ye(), L = I("div");
|
|
777
777
|
for (let E = 0; E < N.length; E += 1)
|
|
778
778
|
N[E].c();
|
|
779
|
-
A = ye(), T = I("div"),
|
|
780
|
-
(i[3] ? "Open" : "")), C(v, "class", "BalanceModalTitle"), C(m, "class", "BalanceModalHeader"), C(L, "class", "BalanceModalBody"), C(
|
|
779
|
+
A = ye(), T = I("div"), x = I("button"), ee = Te(j), C(a, "class", g = "BalanceModalClose " + /*isModalDisplayed*/
|
|
780
|
+
(i[3] ? "Open" : "")), C(v, "class", "BalanceModalTitle"), C(m, "class", "BalanceModalHeader"), C(L, "class", "BalanceModalBody"), C(x, "class", "BalanceModalAction"), C(T, "class", "BalanceModalFooter"), C(B, "class", te = "ModalContent " + /*isModalDisplayed*/
|
|
781
781
|
(i[3] ? "Open" : "")), C(d, "class", F = "BalanceModal " + /*isModalDisplayed*/
|
|
782
782
|
(i[3] ? "Open" : "")), C(t, "class", O = "BalanceModalWrapper " + /*isModalDisplayed*/
|
|
783
783
|
(i[3] ? "Open" : ""));
|
|
@@ -786,7 +786,7 @@ function rt(i) {
|
|
|
786
786
|
ge(E, t, z), _(t, a), _(t, h), _(t, d), _(d, B), _(B, m), _(m, v), _(v, M), _(B, k), _(B, L);
|
|
787
787
|
for (let D = 0; D < N.length; D += 1)
|
|
788
788
|
N[D] && N[D].m(L, null);
|
|
789
|
-
_(B, A), _(B, T), _(T,
|
|
789
|
+
_(B, A), _(B, T), _(T, x), _(x, ee), Y || (ce = [
|
|
790
790
|
je(
|
|
791
791
|
a,
|
|
792
792
|
"click",
|
|
@@ -794,7 +794,7 @@ function rt(i) {
|
|
|
794
794
|
i[27]
|
|
795
795
|
),
|
|
796
796
|
je(
|
|
797
|
-
|
|
797
|
+
x,
|
|
798
798
|
"click",
|
|
799
799
|
/*click_handler_2*/
|
|
800
800
|
i[28]
|
|
@@ -853,14 +853,11 @@ function it(i) {
|
|
|
853
853
|
)
|
|
854
854
|
) : "") + ""
|
|
855
855
|
), m, v, b, M, k = (
|
|
856
|
-
/*
|
|
857
|
-
|
|
858
|
-
/*
|
|
859
|
-
i[
|
|
860
|
-
|
|
861
|
-
i[56].amount
|
|
862
|
-
)
|
|
863
|
-
) : "0") + ""
|
|
856
|
+
/*formatBalance*/
|
|
857
|
+
i[8](
|
|
858
|
+
/*b*/
|
|
859
|
+
i[56].amount
|
|
860
|
+
) + ""
|
|
864
861
|
), L;
|
|
865
862
|
return {
|
|
866
863
|
c() {
|
|
@@ -884,14 +881,11 @@ function it(i) {
|
|
|
884
881
|
A[56].productType
|
|
885
882
|
)
|
|
886
883
|
) : "") + "") && Be(m, B), T[0] & /*balances*/
|
|
887
|
-
2 && k !== (k = /*
|
|
888
|
-
|
|
889
|
-
/*
|
|
890
|
-
A[
|
|
891
|
-
|
|
892
|
-
A[56].amount
|
|
893
|
-
)
|
|
894
|
-
) : "0") + "") && Be(L, k);
|
|
884
|
+
2 && k !== (k = /*formatBalance*/
|
|
885
|
+
A[8](
|
|
886
|
+
/*b*/
|
|
887
|
+
A[56].amount
|
|
888
|
+
) + "") && Be(L, k);
|
|
895
889
|
},
|
|
896
890
|
d(A) {
|
|
897
891
|
A && me(t);
|
|
@@ -922,7 +916,7 @@ function lt(i) {
|
|
|
922
916
|
_(t, a);
|
|
923
917
|
},
|
|
924
918
|
p(d, B) {
|
|
925
|
-
if (B[0] & /*
|
|
919
|
+
if (B[0] & /*formatBalance, balances, $_*/
|
|
926
920
|
322) {
|
|
927
921
|
g = He(
|
|
928
922
|
/*balances*/
|
|
@@ -1002,7 +996,7 @@ function zt(i) {
|
|
|
1002
996
|
function Vt(i, t, a) {
|
|
1003
997
|
let g;
|
|
1004
998
|
Ct(i, Ot, (e) => a(6, g = e));
|
|
1005
|
-
let { userid: h = "" } = t, { session: d = "" } = t, { endpoint: B = "" } = t, { lang: m = "en" } = t, { mbsource: v } = t, { clientstyling: b = "" } = t, { clientstylingurl: M = "" } = t, { translationurl: k = "" } = t, { gmversion: L = "gm16" } = t, { displaybalanceoption: A = "All" } = t, { totalcalculationmode: T = "totalCashAmount" } = t, { currencylocale:
|
|
999
|
+
let { userid: h = "" } = t, { session: d = "" } = t, { endpoint: B = "" } = t, { lang: m = "en" } = t, { mbsource: v } = t, { clientstyling: b = "" } = t, { clientstylingurl: M = "" } = t, { translationurl: k = "" } = t, { gmversion: L = "gm16" } = t, { displaybalanceoption: A = "All" } = t, { totalcalculationmode: T = "totalCashAmount" } = t, { currencylocale: x = "en" } = t, { currencydisplay: j = "symbol" } = t, { maximumfractiondigits: ee = "2" } = t, { minimumfractiondigits: te = "0" } = t, { customdisplayformat: F = "" } = t, O, Y = !0, ce = !1, X = !1, N = !1, E = !1, z = window.navigator.userAgent, D, P = "", oe = [], de;
|
|
1006
1000
|
const f = {}, ue = ["totalCashAmount", "totalRealAmount"], le = () => {
|
|
1007
1001
|
fetch(k).then((e) => e.json()).then((e) => Object.keys(e).forEach((r) => tt(r, e[r]))).catch((e) => console.log(e));
|
|
1008
1002
|
};
|
|
@@ -1035,8 +1029,8 @@ function Vt(i, t, a) {
|
|
|
1035
1029
|
}
|
|
1036
1030
|
}, we = (e) => {
|
|
1037
1031
|
if (F)
|
|
1038
|
-
return
|
|
1039
|
-
const r =
|
|
1032
|
+
return xe(e);
|
|
1033
|
+
const r = x || m, o = {
|
|
1040
1034
|
style: "currency",
|
|
1041
1035
|
currency: P,
|
|
1042
1036
|
useGrouping: !0,
|
|
@@ -1045,7 +1039,7 @@ function Vt(i, t, a) {
|
|
|
1045
1039
|
minimumFractionDigits: te === "" || isNaN(Number(te)) ? 0 : Number(te)
|
|
1046
1040
|
};
|
|
1047
1041
|
return new Intl.NumberFormat(r, o).format(e);
|
|
1048
|
-
},
|
|
1042
|
+
}, xe = (e) => {
|
|
1049
1043
|
const r = [];
|
|
1050
1044
|
let o = "";
|
|
1051
1045
|
for (const s of F)
|
|
@@ -1063,10 +1057,10 @@ function Vt(i, t, a) {
|
|
|
1063
1057
|
else if (w.toLowerCase() === "amount") {
|
|
1064
1058
|
let l = ",", S = ".", y = 2;
|
|
1065
1059
|
p && (p[0] !== " " && (l = p[0]), p[1] !== " " && (S = p[1]), p[2] !== " " && !isNaN(Number(p[2])) && (y = Number(p[2])));
|
|
1066
|
-
let [
|
|
1067
|
-
o +=
|
|
1068
|
-
for (let re = 1; re <
|
|
1069
|
-
(
|
|
1060
|
+
let [R, ne] = String(Math.floor(e * Xe(10, y)) / Xe(10, y)).split(".");
|
|
1061
|
+
o += R[0];
|
|
1062
|
+
for (let re = 1; re < R.length; ++re)
|
|
1063
|
+
(R.length - re) % 3 === 0 ? o += l + R[re] : o += R[re];
|
|
1070
1064
|
ne && (o += S + ne);
|
|
1071
1065
|
}
|
|
1072
1066
|
o && r.push(o), o = "";
|
|
@@ -1107,7 +1101,7 @@ function Vt(i, t, a) {
|
|
|
1107
1101
|
} finally {
|
|
1108
1102
|
a(2, Y = !1);
|
|
1109
1103
|
}
|
|
1110
|
-
}),
|
|
1104
|
+
}), Re = () => {
|
|
1111
1105
|
a(2, Y = !0);
|
|
1112
1106
|
const e = new URL(`${B}/v2/player/${h}/balance`), r = new Headers();
|
|
1113
1107
|
r.append("X-SessionID", d), fetch(e, { method: "GET", headers: r }).then((s) => s.json()).then((s) => {
|
|
@@ -1270,7 +1264,7 @@ function Vt(i, t, a) {
|
|
|
1270
1264
|
se();
|
|
1271
1265
|
break;
|
|
1272
1266
|
case "gm16":
|
|
1273
|
-
|
|
1267
|
+
Re();
|
|
1274
1268
|
break;
|
|
1275
1269
|
default:
|
|
1276
1270
|
throw Error(`Invalid apiversion attribute: ${L}`);
|
|
@@ -1283,12 +1277,12 @@ function Vt(i, t, a) {
|
|
|
1283
1277
|
}));
|
|
1284
1278
|
const Ue = () => ae("balance"), Ne = () => ae("closebalance"), n = () => Ce(), c = () => ae("closeBalance");
|
|
1285
1279
|
function u(e) {
|
|
1286
|
-
|
|
1280
|
+
xt[e ? "unshift" : "push"](() => {
|
|
1287
1281
|
O = e, a(0, O);
|
|
1288
1282
|
});
|
|
1289
1283
|
}
|
|
1290
1284
|
return i.$$set = (e) => {
|
|
1291
|
-
"userid" in e && a(11, h = e.userid), "session" in e && a(12, d = e.session), "endpoint" in e && a(13, B = e.endpoint), "lang" in e && a(14, m = e.lang), "mbsource" in e && a(15, v = e.mbsource), "clientstyling" in e && a(16, b = e.clientstyling), "clientstylingurl" in e && a(17, M = e.clientstylingurl), "translationurl" in e && a(18, k = e.translationurl), "gmversion" in e && a(19, L = e.gmversion), "displaybalanceoption" in e && a(20, A = e.displaybalanceoption), "totalcalculationmode" in e && a(10, T = e.totalcalculationmode), "currencylocale" in e && a(21,
|
|
1285
|
+
"userid" in e && a(11, h = e.userid), "session" in e && a(12, d = e.session), "endpoint" in e && a(13, B = e.endpoint), "lang" in e && a(14, m = e.lang), "mbsource" in e && a(15, v = e.mbsource), "clientstyling" in e && a(16, b = e.clientstyling), "clientstylingurl" in e && a(17, M = e.clientstylingurl), "translationurl" in e && a(18, k = e.translationurl), "gmversion" in e && a(19, L = e.gmversion), "displaybalanceoption" in e && a(20, A = e.displaybalanceoption), "totalcalculationmode" in e && a(10, T = e.totalcalculationmode), "currencylocale" in e && a(21, x = e.currencylocale), "currencydisplay" in e && a(22, j = e.currencydisplay), "maximumfractiondigits" in e && a(23, ee = e.maximumfractiondigits), "minimumfractiondigits" in e && a(24, te = e.minimumfractiondigits), "customdisplayformat" in e && a(25, F = e.customdisplayformat);
|
|
1292
1286
|
}, i.$$.update = () => {
|
|
1293
1287
|
i.$$.dirty[0] & /*endpoint, userid, session, lang, gmversion, displaybalanceoption*/
|
|
1294
1288
|
1603584 && B && h && d && m && L && A && J(), i.$$.dirty[0] & /*endpoint, userid, session, gmversion*/
|
|
@@ -1320,7 +1314,7 @@ function Vt(i, t, a) {
|
|
|
1320
1314
|
k,
|
|
1321
1315
|
L,
|
|
1322
1316
|
A,
|
|
1323
|
-
|
|
1317
|
+
x,
|
|
1324
1318
|
j,
|
|
1325
1319
|
ee,
|
|
1326
1320
|
te,
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* https://github.com/Yaffle/EventSource/
|
|
5
5
|
*/(function(l,a){(function(n){var y=n.setTimeout,m=n.clearTimeout,u=n.XMLHttpRequest,T=n.XDomainRequest,g=n.ActiveXObject,w=n.EventSource,B=n.document,D=n.Promise,k=n.fetch,M=n.Response,_=n.TextDecoder,S=n.TextEncoder,A=n.AbortController;if(typeof window!="undefined"&&typeof B!="undefined"&&!("readyState"in B)&&B.body==null&&(B.readyState="loading",window.addEventListener("load",function(o){B.readyState="complete"},!1)),u==null&&g!=null&&(u=function(){return new g("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(o){function d(){}return d.prototype=o,new d}),Date.now||(Date.now=function(){return new Date().getTime()}),A==null){var F=k;k=function(o,d){var f=d.signal;return F(o,{headers:d.headers,credentials:d.credentials,cache:d.cache}).then(function(t){var i=t.body.getReader();return f._reader=i,f._aborted&&f._reader.cancel(),{status:t.status,statusText:t.statusText,headers:t.headers,body:{getReader:function(){return i}}}})},A=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function Z(){this.bitsNeeded=0,this.codePoint=0}Z.prototype.decode=function(o){function d(s,C,v){if(v===1)return s>=128>>C&&s<<C<=2047;if(v===2)return s>=2048>>C&&s<<C<=55295||s>=57344>>C&&s<<C<=65535;if(v===3)return s>=65536>>C&&s<<C<=1114111;throw new Error}function f(s,C){if(s===6*1)return C>>6>15?3:C>31?2:1;if(s===6*2)return C>15?3:2;if(s===6*3)return 3;throw new Error}for(var t=65533,i="",r=this.bitsNeeded,c=this.codePoint,b=0;b<o.length;b+=1){var h=o[b];r!==0&&(h<128||h>191||!d(c<<6|h&63,r-6,f(r,c)))&&(r=0,c=t,i+=String.fromCharCode(c)),r===0?(h>=0&&h<=127?(r=0,c=h):h>=192&&h<=223?(r=6*1,c=h&31):h>=224&&h<=239?(r=6*2,c=h&15):h>=240&&h<=247?(r=6*3,c=h&7):(r=0,c=t),r!==0&&!d(c,r,f(r,c))&&(r=0,c=t)):(r-=6,c=c<<6|h&63),r===0&&(c<=65535?i+=String.fromCharCode(c):(i+=String.fromCharCode(55296+(c-65535-1>>10)),i+=String.fromCharCode(56320+(c-65535-1&1023))))}return this.bitsNeeded=r,this.codePoint=c,i};var J=function(){try{return new _().decode(new S().encode("test"),{stream:!0})==="test"}catch(o){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+o)}return!1};(_==null||S==null||!J())&&(_=Z);var N=function(){};function L(o){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=N,this.onload=N,this.onerror=N,this.onreadystatechange=N,this._contentType="",this._xhr=o,this._sendTimeout=0,this._abort=N}L.prototype.open=function(o,d){this._abort(!0);var f=this,t=this._xhr,i=1,r=0;this._abort=function(v){f._sendTimeout!==0&&(m(f._sendTimeout),f._sendTimeout=0),(i===1||i===2||i===3)&&(i=4,t.onload=N,t.onerror=N,t.onabort=N,t.onprogress=N,t.onreadystatechange=N,t.abort(),r!==0&&(m(r),r=0),v||(f.readyState=4,f.onabort(null),f.onreadystatechange())),i=0};var c=function(){if(i===1){var v=0,x="",ee=void 0;if("contentType"in t)v=200,x="OK",ee=t.contentType;else try{v=t.status,x=t.statusText,ee=t.getResponseHeader("Content-Type")}catch(ae){v=0,x="",ee=void 0}v!==0&&(i=2,f.readyState=2,f.status=v,f.statusText=x,f._contentType=ee,f.onreadystatechange())}},b=function(){if(c(),i===2||i===3){i=3;var v="";try{v=t.responseText}catch(x){}f.readyState=3,f.responseText=v,f.onprogress()}},h=function(v,x){if((x==null||x.preventDefault==null)&&(x={preventDefault:N}),b(),i===1||i===2||i===3){if(i=4,r!==0&&(m(r),r=0),f.readyState=4,v==="load")f.onload(x);else if(v==="error")f.onerror(x);else if(v==="abort")f.onabort(x);else throw new TypeError;f.onreadystatechange()}},s=function(v){t!=null&&(t.readyState===4?(!("onload"in t)||!("onerror"in t)||!("onabort"in t))&&h(t.responseText===""?"error":"load",v):t.readyState===3?"onprogress"in t||b():t.readyState===2&&c())},C=function(){r=y(function(){C()},500),t.readyState===3&&b()};"onload"in t&&(t.onload=function(v){h("load",v)}),"onerror"in t&&(t.onerror=function(v){h("error",v)}),"onabort"in t&&(t.onabort=function(v){h("abort",v)}),"onprogress"in t&&(t.onprogress=b),"onreadystatechange"in t&&(t.onreadystatechange=function(v){s(v)}),("contentType"in t||!("ontimeout"in u.prototype))&&(d+=(d.indexOf("?")===-1?"?":"&")+"padding=true"),t.open(o,d,!0),"readyState"in t&&(r=y(function(){C()},0))},L.prototype.abort=function(){this._abort(!1)},L.prototype.getResponseHeader=function(o){return this._contentType},L.prototype.setRequestHeader=function(o,d){var f=this._xhr;"setRequestHeader"in f&&f.setRequestHeader(o,d)},L.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},L.prototype.send=function(){if((!("ontimeout"in u.prototype)||!("sendAsBinary"in u.prototype)&&!("mozAnon"in u.prototype))&&B!=null&&B.readyState!=null&&B.readyState!=="complete"){var o=this;o._sendTimeout=y(function(){o._sendTimeout=0,o.send()},4);return}var d=this._xhr;"withCredentials"in d&&(d.withCredentials=this.withCredentials);try{d.send(void 0)}catch(f){throw f}};function q(o){return o.replace(/[A-Z]/g,function(d){return String.fromCharCode(d.charCodeAt(0)+32)})}function ie(o){for(var d=Object.create(null),f=o.split(`\r
|
|
6
6
|
`),t=0;t<f.length;t+=1){var i=f[t],r=i.split(": "),c=r.shift(),b=r.join(": ");d[q(c)]=b}this._map=d}ie.prototype.get=function(o){return this._map[q(o)]},u!=null&&u.HEADERS_RECEIVED==null&&(u.HEADERS_RECEIVED=2);function U(){}U.prototype.open=function(o,d,f,t,i,r,c){o.open("GET",i);var b=0;o.onprogress=function(){var s=o.responseText,C=s.slice(b);b+=C.length,f(C)},o.onerror=function(s){s.preventDefault(),t(new Error("NetworkError"))},o.onload=function(){t(null)},o.onabort=function(){t(null)},o.onreadystatechange=function(){if(o.readyState===u.HEADERS_RECEIVED){var s=o.status,C=o.statusText,v=o.getResponseHeader("Content-Type"),x=o.getAllResponseHeaders();d(s,C,v,new ie(x))}},o.withCredentials=r;for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&o.setRequestHeader(h,c[h]);return o.send(),o};function O(o){this._headers=o}O.prototype.get=function(o){return this._headers.get(o)};function R(){}R.prototype.open=function(o,d,f,t,i,r,c){var b=null,h=new A,s=h.signal,C=new _;return k(i,{headers:c,credentials:r?"include":"same-origin",signal:s,cache:"no-store"}).then(function(v){return b=v.body.getReader(),d(v.status,v.statusText,v.headers.get("Content-Type"),new O(v.headers)),new D(function(x,ee){var ae=function(){b.read().then(function(W){if(W.done)x(void 0);else{var P=C.decode(W.value,{stream:!0});f(P),ae()}}).catch(function(W){ee(W)})};ae()})}).catch(function(v){if(v.name!=="AbortError")return v}).then(function(v){t(v)}),{abort:function(){b!=null&&b.cancel(),h.abort()}}};function j(){this._listeners=Object.create(null)}function E(o){y(function(){throw o},0)}j.prototype.dispatchEvent=function(o){o.target=this;var d=this._listeners[o.type];if(d!=null)for(var f=d.length,t=0;t<f;t+=1){var i=d[t];try{typeof i.handleEvent=="function"?i.handleEvent(o):i.call(this,o)}catch(r){E(r)}}},j.prototype.addEventListener=function(o,d){o=String(o);var f=this._listeners,t=f[o];t==null&&(t=[],f[o]=t);for(var i=!1,r=0;r<t.length;r+=1)t[r]===d&&(i=!0);i||t.push(d)},j.prototype.removeEventListener=function(o,d){o=String(o);var f=this._listeners,t=f[o];if(t!=null){for(var i=[],r=0;r<t.length;r+=1)t[r]!==d&&i.push(t[r]);i.length===0?delete f[o]:f[o]=i}};function V(o){this.type=o,this.target=void 0}function te(o,d){V.call(this,o),this.data=d.data,this.lastEventId=d.lastEventId}te.prototype=Object.create(V.prototype);function le(o,d){V.call(this,o),this.status=d.status,this.statusText=d.statusText,this.headers=d.headers}le.prototype=Object.create(V.prototype);function p(o,d){V.call(this,o),this.error=d.error}p.prototype=Object.create(V.prototype);var se=-1,oe=0,$=1,pe=2,we=-1,re=0,be=1,me=2,Ce=3,De=/^text\/event\-stream(;.*)?$/i,Be=1e3,_e=18e6,Te=function(o,d){var f=o==null?d:parseInt(o,10);return f!==f&&(f=d),ge(f)},ge=function(o){return Math.min(Math.max(o,Be),_e)},fe=function(o,d,f){try{typeof d=="function"&&d.call(o,f)}catch(t){E(t)}};function K(o,d){j.call(this),d=d||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,ke(this,o,d)}function Ae(){return u!=null&&"withCredentials"in u.prototype||T==null?new u:new T}var Me=k!=null&&M!=null&&"body"in M.prototype;function ke(o,d,f){d=String(d);var t=!!f.withCredentials,i=f.lastEventIdQueryParameterName||"lastEventId",r=ge(1e3),c=Te(f.heartbeatTimeout,45e3),b="",h=r,s=!1,C=0,v=f.headers||{},x=f.Transport,ee=Me&&x==null?void 0:new L(x!=null?new x:Ae()),ae=x!=null&&typeof x!="string"?new x:ee==null?new R:new U,W=void 0,P=0,ne=se,ye="",Re="",ce="",Ee="",X=re,Le=0,he=0,Je=function(H,I,Y,Q){if(ne===oe)if(H===200&&Y!=null&&De.test(Y)){ne=$,s=Date.now(),h=r,o.readyState=$;var G=new le("open",{status:H,statusText:I,headers:Q});o.dispatchEvent(G),fe(o,o.onopen,G)}else{var z="";H!==200?(I&&(I=I.replace(/\s+/g," ")),z="EventSource's response has a status "+H+" "+I+" that is not 200. Aborting the connection."):z="EventSource's response has a Content-Type specifying an unsupported type: "+(Y==null?"-":Y.replace(/\s+/g," "))+". Aborting the connection.",Oe();var G=new le("error",{status:H,statusText:I,headers:Q});o.dispatchEvent(G),fe(o,o.onerror,G),console.error(z)}},$e=function(H){if(ne===$){for(var I=-1,Y=0;Y<H.length;Y+=1){var Q=H.charCodeAt(Y);(Q===10||Q===13)&&(I=Y)}var G=(I!==-1?Ee:"")+H.slice(0,I+1);Ee=(I===-1?Ee:"")+H.slice(I+1),H!==""&&(s=Date.now(),C+=H.length);for(var z=0;z<G.length;z+=1){var Q=G.charCodeAt(z);if(X===we&&Q===10)X=re;else if(X===we&&(X=re),Q===13||Q===10){if(X!==re){X===be&&(he=z+1);var de=G.slice(Le,he-1),ue=G.slice(he+(he<z&&G.charCodeAt(he)===32?1:0),z);de==="data"?(ye+=`
|
|
7
|
-
`,ye+=ue):de==="id"?Re=ue:de==="event"?ce=ue:de==="retry"?(r=Te(ue,r),h=r):de==="heartbeatTimeout"&&(c=Te(ue,c),P!==0&&(m(P),P=y(function(){Se()},c)))}if(X===re){if(ye!==""){b=Re,ce===""&&(ce="message");var ve=new te(ce,{data:ye.slice(1),lastEventId:Re});if(o.dispatchEvent(ve),ce==="open"?fe(o,o.onopen,ve):ce==="message"?fe(o,o.onmessage,ve):ce==="error"&&fe(o,o.onerror,ve),ne===pe)return}ye="",ce=""}X=Q===13?we:re}else X===re&&(Le=z,X=be),X===be?Q===58&&(he=z+1,X=me):X===me&&(X=Ce)}}},Ie=function(H){if(ne===$||ne===oe){ne=se,P!==0&&(m(P),P=0),P=y(function(){Se()},h),h=ge(Math.min(r*16,h*2)),o.readyState=oe;var I=new p("error",{error:H});o.dispatchEvent(I),fe(o,o.onerror,I),H!=null&&console.error(H)}},Oe=function(){ne=pe,W!=null&&(W.abort(),W=void 0),P!==0&&(m(P),P=0),o.readyState=pe},Se=function(){if(P=0,ne!==se){if(!s&&W!=null)Ie(new Error("No activity within "+c+" milliseconds. "+(ne===oe?"No response received.":C+" chars received.")+" Reconnecting.")),W!=null&&(W.abort(),W=void 0);else{var H=Math.max((s||Date.now())+c-Date.now(),1);s=!1,P=y(function(){Se()},H)}return}s=!1,C=0,P=y(function(){Se()},c),ne=oe,ye="",ce="",Re=b,Ee="",Le=0,he=0,X=re;var I=d;if(d.slice(0,5)!=="data:"&&d.slice(0,5)!=="blob:"&&b!==""){var Y=d.indexOf("?");I=Y===-1?d:d.slice(0,Y+1)+d.slice(Y+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(ue,ve){return ve===i?"":ue}),I+=(d.indexOf("?")===-1?"?":"&")+i+"="+encodeURIComponent(b)}var Q=o.withCredentials,G={};G.Accept="text/event-stream";var z=o.headers;if(z!=null)for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(G[de]=z[de]);try{W=ae.open(ee,Je,$e,Ie,I,Q,G)}catch(ue){throw Oe(),ue}};o.url=d,o.readyState=oe,o.withCredentials=t,o.headers=v,o._close=Oe,Se()}K.prototype=Object.create(j.prototype),K.prototype.CONNECTING=oe,K.prototype.OPEN=$,K.prototype.CLOSED=pe,K.prototype.close=function(){this._close()},K.CONNECTING=oe,K.OPEN=$,K.CLOSED=pe,K.prototype.withCredentials=void 0;var xe=w;u!=null&&(w==null||!("withCredentials"in w.prototype))&&(xe=K),function(o){{var d=o(a);d!==void 0&&(l.exports=d)}}(function(o){o.EventSourcePolyfill=K,o.NativeEventSource=w,o.EventSource=xe})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Fe,Fe.exports);var it=Fe.exports;function lt(l){e.append_styles(l,"svelte-lfsn3o",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}@keyframes growWidthPercent{from{height:0}to{height:100%}}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;background:transparent;border:none;font:inherit;color:inherit;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px;fill:black}.ShowBalance .BalanceValue span{padding-left:5px}.ShowBalance .BalanceValue .TriangleActive,.ShowBalance .BalanceValue .TriangleInactive{display:block;margin:0 3px;transition:all 0.2s}.ShowBalance .BalanceValue .TriangleActive:hover,.ShowBalance .BalanceValue .TriangleInactive:hover{transform:scale(1.2)}.ShowBalance .BalanceValue .TriangleActive svg,.ShowBalance .BalanceValue .TriangleInactive svg{margin:2px 0px}.ShowBalance .BalanceValue .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px)}.ShowBalance .BalanceValue .TriangleActive:hover{transform:scale(1.1) rotateX(180deg) translateY(3px)}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);position:absolute;top:40px;padding:10px;transform:translateX(-45%);box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919;transition:all 0.2s ease-in;opacity:0}.BalanceModalWrapper:before{content:"";background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:50%;width:25px;height:10px;z-index:1}.BalanceModalWrapper.Open{opacity:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;transition:all 0.3s ease;background:transparent;border:none;font:inherit;opacity:0}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModalClose:hover{transform:scale(1.1)}.BalanceModalClose.Open{opacity:1}.BalanceModal{transition:all 0.2s ease-in;width:270px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, white));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--color-primary);font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:30px;border:none;padding:10px 0;cursor:pointer;transition:all 0.2s ease-in;box-shadow:0px 3px 7px 0px rgba(0, 0, 0, 0.2)}.BalanceModalFooter .BalanceModalAction:hover{background:rgba(255, 255, 255, 0.1);color:var(--emw--color-primary);box-shadow:0px 0px 0px 2px inset var(--emw--color-primary);font-size:14px}.BalanceModalFooter .BalanceModalAction:active{background:rgba(255, 255, 255, 0.5)}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16;opacity:0;transition:all 0.2s linear}.ShowBalanceModalOverlay.Open{opacity:1}')}function Ge(l,a,n){const y=l.slice();return y[53]=a[n],y}function qe(l,a,n){const y=l.slice();return y[56]=a[n],y}function st(l){let a,n,y=(l[1].Total?l[8](l[1].Total[0].amount):"0")+"",m,u,T,g,w,B,D,k,M,_,S=l[4]&&Ke(l);return{c(){a=e.element("button"),n=e.element("p"),m=e.text(y),u=e.space(),T=e.element("span"),g=e.svg_element("svg"),w=e.svg_element("path"),D=e.space(),S&&S.c(),k=e.empty(),e.attr(w,"id","arrow"),e.attr(w,"d","M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z"),e.attr(w,"transform","translate(-274.511 -441.088)"),e.attr(w,"fill","#d1d1d1"),e.attr(g,"xmlns","http://www.w3.org/2000/svg"),e.attr(g,"width","14"),e.attr(g,"height","6.835"),e.attr(g,"viewBox","0 0 14 6.835"),e.attr(T,"class",B=l[3]?"TriangleActive":"TriangleInactive"),e.attr(a,"class","BalanceValue")},m(A,F){e.insert(A,a,F),e.append(a,n),e.append(n,m),e.append(a,u),e.append(a,T),e.append(T,g),e.append(g,w),e.insert(A,D,F),S&&S.m(A,F),e.insert(A,k,F),M||(_=e.listen(a,"click",l[26]),M=!0)},p(A,F){F[0]&2&&y!==(y=(A[1].Total?A[8](A[1].Total[0].amount):"0")+"")&&e.set_data(m,y),F[0]&8&&B!==(B=A[3]?"TriangleActive":"TriangleInactive")&&e.attr(T,"class",B),A[4]?S?S.p(A,F):(S=Ke(A),S.c(),S.m(k.parentNode,k)):S&&(S.d(1),S=null)},d(A){A&&(e.detach(a),e.detach(D),e.detach(k)),S&&S.d(A),M=!1,_()}}}function ct(l){let a,n=l[6]("Loading")+"",y;return{c(){a=e.element("p"),y=e.text(n),e.attr(a,"class","Loading")},m(m,u){e.insert(m,a,u),e.append(a,y)},p(m,u){u[0]&64&&n!==(n=m[6]("Loading")+"")&&e.set_data(y,n)},d(m){m&&e.detach(a)}}}function Ke(l){let a,n,y,m,u,T,g,w,B=l[6]("Title")+"",D,k,M,_,S,A,F=l[6]("DepositButton")+"",Z,J,N,L,q,ie,U=e.ensure_array_like(Object.keys(l[1])),O=[];for(let R=0;R<U.length;R+=1)O[R]=Ye(Ge(l,U,R));return{c(){a=e.element("div"),n=e.element("button"),m=e.space(),u=e.element("div"),T=e.element("div"),g=e.element("div"),w=e.element("p"),D=e.text(B),k=e.space(),M=e.element("div");for(let R=0;R<O.length;R+=1)O[R].c();_=e.space(),S=e.element("div"),A=e.element("button"),Z=e.text(F),e.attr(n,"class",y="BalanceModalClose "+(l[3]?"Open":"")),e.attr(w,"class","BalanceModalTitle"),e.attr(g,"class","BalanceModalHeader"),e.attr(M,"class","BalanceModalBody"),e.attr(A,"class","BalanceModalAction"),e.attr(S,"class","BalanceModalFooter"),e.attr(T,"class",J="ModalContent "+(l[3]?"Open":"")),e.attr(u,"class",N="BalanceModal "+(l[3]?"Open":"")),e.attr(a,"class",L="BalanceModalWrapper "+(l[3]?"Open":""))},m(R,j){e.insert(R,a,j),e.append(a,n),e.append(a,m),e.append(a,u),e.append(u,T),e.append(T,g),e.append(g,w),e.append(w,D),e.append(T,k),e.append(T,M);for(let E=0;E<O.length;E+=1)O[E]&&O[E].m(M,null);e.append(T,_),e.append(T,S),e.append(S,A),e.append(A,Z),q||(ie=[e.listen(n,"click",l[27]),e.listen(A,"click",l[28])],q=!0)},p(R,j){if(j[0]&8&&y!==(y="BalanceModalClose "+(R[3]?"Open":""))&&e.attr(n,"class",y),j[0]&64&&B!==(B=R[6]("Title")+"")&&e.set_data(D,B),j[0]&322){U=e.ensure_array_like(Object.keys(R[1]));let E;for(E=0;E<U.length;E+=1){const V=Ge(R,U,E);O[E]?O[E].p(V,j):(O[E]=Ye(V),O[E].c(),O[E].m(M,null))}for(;E<O.length;E+=1)O[E].d(1);O.length=U.length}j[0]&64&&F!==(F=R[6]("DepositButton")+"")&&e.set_data(Z,F),j[0]&8&&J!==(J="ModalContent "+(R[3]?"Open":""))&&e.attr(T,"class",J),j[0]&8&&N!==(N="BalanceModal "+(R[3]?"Open":""))&&e.attr(u,"class",N),j[0]&8&&L!==(L="BalanceModalWrapper "+(R[3]?"Open":""))&&e.attr(a,"class",L)},d(R){R&&e.detach(a),e.destroy_each(O,R),q=!1,e.run_all(ie)}}}function We(l){let a,n,y=l[6](l[53])+"",m,u,T=(l[56].productType?l[6](l[56].productType):"")+"",g,w,B,D,k=(l[56].amount?l[8](l[56].amount):"0")+"",M;return{c(){a=e.element("div"),n=e.element("p"),m=e.text(y),u=e.space(),g=e.text(T),w=e.space(),B=e.element("p"),D=e.element("span"),M=e.text(k),e.attr(n,"class","BalanceModalText"),e.attr(D,"class","BalanceModalAmount"),e.attr(B,"class","BalanceModalValue"),e.attr(a,"class","BalanceModalRowLine")},m(_,S){e.insert(_,a,S),e.append(a,n),e.append(n,m),e.append(n,u),e.append(n,g),e.append(a,w),e.append(a,B),e.append(B,D),e.append(D,M)},p(_,S){S[0]&66&&y!==(y=_[6](_[53])+"")&&e.set_data(m,y),S[0]&66&&T!==(T=(_[56].productType?_[6](_[56].productType):"")+"")&&e.set_data(g,T),S[0]&2&&k!==(k=(_[56].amount?_[8](_[56].amount):"0")+"")&&e.set_data(M,k)},d(_){_&&e.detach(a)}}}function Ye(l){let a,n,y=e.ensure_array_like(l[1][l[53]]),m=[];for(let u=0;u<y.length;u+=1)m[u]=We(qe(l,y,u));return{c(){a=e.element("div");for(let u=0;u<m.length;u+=1)m[u].c();n=e.space(),e.attr(a,"class","BalanceModalRowBoth")},m(u,T){e.insert(u,a,T);for(let g=0;g<m.length;g+=1)m[g]&&m[g].m(a,null);e.append(a,n)},p(u,T){if(T[0]&322){y=e.ensure_array_like(u[1][u[53]]);let g;for(g=0;g<y.length;g+=1){const w=qe(u,y,g);m[g]?m[g].p(w,T):(m[g]=We(w),m[g].c(),m[g].m(a,n))}for(;g<m.length;g+=1)m[g].d(1);m.length=y.length}},d(u){u&&e.detach(a),e.destroy_each(m,u)}}}function Qe(l){let a,n,y;return{c(){a=e.element("button"),e.attr(a,"class","ShowBalanceModalOverlay")},m(m,u){e.insert(m,a,u),n||(y=e.listen(a,"click",l[29]),n=!0)},p:e.noop,d(m){m&&e.detach(a),n=!1,y()}}}function dt(l){let a,n,y,m;function u(B,D){return B[2]?ct:st}let T=u(l),g=T(l),w=l[4]&&Qe(l);return{c(){a=e.element("div"),n=e.element("div"),g.c(),m=e.space(),w&&w.c(),e.attr(n,"class",y="ShowBalance "+(l[5]?"Mobile":""))},m(B,D){e.insert(B,a,D),e.append(a,n),g.m(n,null),e.append(a,m),w&&w.m(a,null),l[30](a)},p(B,D){T===(T=u(B))&&g?g.p(B,D):(g.d(1),g=T(B),g&&(g.c(),g.m(n,null))),D[0]&32&&y!==(y="ShowBalance "+(B[5]?"Mobile":""))&&e.attr(n,"class",y),B[4]?w?w.p(B,D):(w=Qe(B),w.c(),w.m(a,null)):w&&(w.d(1),w=null)},i:e.noop,o:e.noop,d(B){B&&e.detach(a),g.d(),w&&w.d(),l[30](null)}}}function ut(l,a,n){let y;e.component_subscribe(l,e.$format,t=>n(6,y=t));let{userid:m=""}=a,{session:u=""}=a,{endpoint:T=""}=a,{lang:g="en"}=a,{mbsource:w}=a,{clientstyling:B=""}=a,{clientstylingurl:D=""}=a,{translationurl:k=""}=a,{gmversion:M="gm16"}=a,{displaybalanceoption:_="All"}=a,{totalcalculationmode:S="totalCashAmount"}=a,{currencylocale:A="en"}=a,{currencydisplay:F="symbol"}=a,{maximumfractiondigits:Z="2"}=a,{minimumfractiondigits:J="0"}=a,{customdisplayformat:N=""}=a,L,q=!0,ie=!1,U=!1,O=!1,R=!1,j=window.navigator.userAgent,E,V="",te=[],le;const p={},se=["totalCashAmount","totalRealAmount"],oe=()=>{fetch(k).then(t=>t.json()).then(t=>Object.keys(t).forEach(i=>Pe(i,t[i]))).catch(t=>console.log(t))};Object.keys(Xe).forEach(t=>Pe(t,Xe[t]));const $=t=>{switch(t){case"balance":window.postMessage({type:"BalanceModalStatus",status:"open"},window.location.href),n(4,O=!0),setTimeout(()=>n(3,ie=!0),150);break;case"closebalance":n(3,ie=!1),window.postMessage({type:"BalanceModalStatus",status:"close"},window.location.href),setTimeout(()=>{n(4,O=!1)},150);break}},pe=t=>{if(N)return we(t);const i=A||g,r={style:"currency",currency:V,useGrouping:!0,currencyDisplay:F||"code",maximumFractionDigits:Z===""||isNaN(Number(Z))?2:Number(Z),minimumFractionDigits:J===""||isNaN(Number(J))?0:Number(J)};return new Intl.NumberFormat(i,r).format(t)},we=t=>{const i=[];let r="";for(const c of N)switch(c){default:r+=c;break;case"{":r&&i.push(r),r="";break;case"}":const[b,h]=r.split("|");if(r="",b.toLowerCase()==="currency")r=V;else if(b.toLowerCase()==="amount"){let s=",",C=".",v=2;h&&(h[0]!==" "&&(s=h[0]),h[1]!==" "&&(C=h[1]),h[2]!==" "&&!isNaN(Number(h[2]))&&(v=Number(h[2])));let[x,ee]=String(Math.floor(t*Ne(10,v))/Ne(10,v)).split(".");r+=x[0];for(let ae=1;ae<x.length;++ae)(x.length-ae)%3===0?r+=s+x[ae]:r+=x[ae];ee&&(r+=C+ee)}r&&i.push(r),r="";break}return i.push(r),i.join("")},re=()=>Ue(this,null,function*(){var i,r,c;n(2,q=!0);const t=new URL(`${T}/v1/player/${m}/account`);try{const b=yield fetch(t,{method:"GET",headers:{"X-SessionID":u}}),h=yield b.json();if(b.ok)window.postMessage({type:"BalancedFetched"},window.location.href),te=h.items,V=(i=te.find(s=>s.displayName==="Casino"))==null?void 0:i.currency,n(1,p.Total=[{amount:h.totalAmount[V]}],p),n(1,p.Real=[{amount:(r=te.find(s=>s.displayName==="Casino"))==null?void 0:r.balanceAmount}],p),n(1,p.Bonus=[{amount:(c=te.find(s=>s.displayName==="UBS"))==null?void 0:c.balanceAmount}],p);else throw new Error("Failed to fetch balance data !")}catch(b){console.log("Balance error: ",b)}finally{n(2,q=!1)}}),be=()=>{n(2,q=!0);const t=new URL(`${T}/v2/player/${m}/balance`),i=new Headers;i.append("X-SessionID",u),fetch(t,{method:"GET",headers:i}).then(c=>c.json()).then(c=>{c[S]||n(10,S=se[0]);const b=c.items.find(s=>s.type==="Real"&&s.walletAccountType==="Ordinary");if(V=b.currency,U=!!b.productType,n(1,p.Total=[{amount:0}],p),n(1,p.Real=[],p),n(1,p.Bonus=[],p),n(1,p.Credit=[],p),!U){le={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},n(1,p.Total[0].amount=c[S][V],p);for(const s of c.items)switch(s.type){case"Bonus":p.Bonus.length===0?p.Bonus.push({amount:s.amount}):n(1,p.Bonus[0].amount+=s.amount,p);break;case"Real":if(s.creditLine&&p.Credit.length===0&&p.Credit.push({amount:s.creditLine}),S==="totalRealAmount")continue;p.Real.length===0?p.Real.push({amount:s.amount}):n(1,p.Real[0].amount+=s.amount,p);break}for(const[s,C]of Object.entries(p))C.length<1&&delete p[s];n(2,q=!1);return}le={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let h=c.items;_&&_!=="All"&&(h=c.items.filter(s=>s.productType===_));for(const s of h){let C;switch(s.type){case"Bonus":C=p.Bonus.findIndex(v=>v.productType===s.productType),C>0?n(1,p.Bonus[C].amount+=s.amount,p):p.Bonus.push({amount:s.amount,productType:s.productType});break;case"Real":s.creditLine&&p.Credit.push({amount:s.creditLine,productType:s.productType}),C=p.Real.findIndex(v=>v.productType===s.productType),C>0?n(1,p.Real[C].amount+=s.amount,p):p.Real.push({amount:s.amount,productType:s.productType});break}}_e();for(const[s,C]of Object.entries(p))C.length<1&&delete p[s];n(2,q=!1)}).catch(c=>{throw n(2,q=!1),console.log("Balance fetch error",c),new Error("Failed to fetch balance data!")})},me=()=>{if(E&&E.close(),u.length<1)return;let t,i;switch(M){case"gm16":t=new URL(`${T}/v2/player/${m}/information/updates`),i=b=>Te(b);break;case"gmcore":t=new URL(`${T}/v1/player/${m}/balance/updates`),i=b=>De(b);break}const r={accept:"text/event-stream","X-SessionId":u},c=new it.EventSourcePolyfill(t,{headers:r});E=c,c.addEventListener("message",i)},Ce=t=>{let i;try{i=JSON.parse(t)}catch(r){console.log("Balance stream failed: ",r);return}return i},De=t=>{var b,h;const i=Ce(t.data);if(!i){me();return}let r="0";const c=i.balanceChange;te=te.map(s=>(c&&c[s.id]&&(s=Ve(ze({},s),{balanceAmount:c[s.id].afterAmount})),r=(parseFloat(s==null?void 0:s.balanceAmount)+parseFloat(r)).toString(),s)),n(1,p.Real=[{amount:(b=te[0])==null?void 0:b.balanceAmount}],p),n(1,p.Bonus=[{amount:(h=te[1])==null?void 0:h.balanceAmount}],p),n(1,p.Total=[{amount:Number(r)}],p)},Be=(t,i,r)=>{let c=null;switch(r.walletAccountType){case"Ordinary":(r.afterAmount!==r.affectedAmount||i.lastOrdinaryAfterAmount===0)&&(i.lastOrdinaryAfterAmount=r.afterAmount,i.showCreditLineAfterAmount||(c=r.afterAmount));break;case"CreditLine":r.afterAmount!==0?(c=r.afterAmount,i.showCreditLineAfterAmount=!0):(c=i.lastOrdinaryAfterAmount,i.showCreditLineAfterAmount=!1);break;default:c=r.afterAmount}return c===null?t:c},_e=()=>{switch(S){case"totalCashAmount":let t=0;for(const r of["Real","Bonus"])for(const c of p[r])t+=Math.max(c.amount,0);n(1,p.Total[0].amount=t,p);break;case"totalRealAmount":if(!U)return;let i=0;for(const r of p.Real)i+=r.amount;n(1,p.Total[0].amount=i,p)}},Te=t=>{const i=Ce(t.data);if(!i){me();return}if(i.type!=="BALANCE_UPDATE_V2")return;const r=i.body.balanceChange;for(const[c,b]of Object.entries(r))if(S==="totalRealAmount"&&c==="Real"&&!U&&n(1,p.Total[0].amount=Be(p.Total[0].amount,le,b),p),!!p[c])for(const h of p[c]){if(!U){h.amount=c==="Real"?Be(h.amount,le,b):b.afterAmount;continue}b.productType===h.productType&&(h.amount=c==="Real"?Be(h.amount,le[h.productType],b):b.afterAmount)}_e()},ge=()=>{$("closebalance"),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&>ag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},fe=()=>{se.includes(S)||(console.error(`Unsupported value ('${S}') for totalcalculationmode parameter. Only the following values are supported ${se}. Using default value ('${se[0]}').`),n(10,S=se[0]))},K=()=>{switch(rt(g),fe(),M){case"gmcore":re();break;case"gm16":be();break;default:throw Error(`Invalid apiversion attribute: ${M}`)}},Ae=t=>t.data&&t.data.type==="LogoutSuccessfull"&&E.close(),Me=()=>{window.postMessage({type:"UpdateBalanceBackground"},window.location.href)};e.onMount(()=>(window.addEventListener("message",Ae,!1),n(5,R=e.isMobile(j)),()=>{window.removeEventListener("message",Ae),E&&E.close()}));const ke=()=>$("balance"),xe=()=>$("closebalance"),o=()=>ge(),d=()=>$("closeBalance");function f(t){e.binding_callbacks[t?"unshift":"push"](()=>{L=t,n(0,L)})}return l.$$set=t=>{"userid"in t&&n(11,m=t.userid),"session"in t&&n(12,u=t.session),"endpoint"in t&&n(13,T=t.endpoint),"lang"in t&&n(14,g=t.lang),"mbsource"in t&&n(15,w=t.mbsource),"clientstyling"in t&&n(16,B=t.clientstyling),"clientstylingurl"in t&&n(17,D=t.clientstylingurl),"translationurl"in t&&n(18,k=t.translationurl),"gmversion"in t&&n(19,M=t.gmversion),"displaybalanceoption"in t&&n(20,_=t.displaybalanceoption),"totalcalculationmode"in t&&n(10,S=t.totalcalculationmode),"currencylocale"in t&&n(21,A=t.currencylocale),"currencydisplay"in t&&n(22,F=t.currencydisplay),"maximumfractiondigits"in t&&n(23,Z=t.maximumfractiondigits),"minimumfractiondigits"in t&&n(24,J=t.minimumfractiondigits),"customdisplayformat"in t&&n(25,N=t.customdisplayformat)},l.$$.update=()=>{l.$$.dirty[0]&1603584&&T&&m&&u&&g&&M&&_&&K(),l.$$.dirty[0]&538624&&T&&m&&u&&M&&me(),l.$$.dirty[0]&262144&&k&&oe(),l.$$.dirty[0]&2&&p.Total&&Me(),l.$$.dirty[0]&65537&&B&&L&&e.setClientStyling(L,B),l.$$.dirty[0]&131073&&D&&L&&e.setClientStylingURL(L,D),l.$$.dirty[0]&32769&&w&&L&&e.setStreamStyling(L,`${w}.Style`)},[L,p,q,ie,O,R,y,$,pe,ge,S,m,u,T,g,w,B,D,k,M,_,A,F,Z,J,N,ke,xe,o,d,f]}class Ze extends e.SvelteComponent{constructor(a){super(),e.init(this,a,ut,dt,e.safe_not_equal,{userid:11,session:12,endpoint:13,lang:14,mbsource:15,clientstyling:16,clientstylingurl:17,translationurl:18,gmversion:19,displaybalanceoption:20,totalcalculationmode:10,currencylocale:21,currencydisplay:22,maximumfractiondigits:23,minimumfractiondigits:24,customdisplayformat:25},lt,[-1,-1])}get userid(){return this.$$.ctx[11]}set userid(a){this.$$set({userid:a}),e.flush()}get session(){return this.$$.ctx[12]}set session(a){this.$$set({session:a}),e.flush()}get endpoint(){return this.$$.ctx[13]}set endpoint(a){this.$$set({endpoint:a}),e.flush()}get lang(){return this.$$.ctx[14]}set lang(a){this.$$set({lang:a}),e.flush()}get mbsource(){return this.$$.ctx[15]}set mbsource(a){this.$$set({mbsource:a}),e.flush()}get clientstyling(){return this.$$.ctx[16]}set clientstyling(a){this.$$set({clientstyling:a}),e.flush()}get clientstylingurl(){return this.$$.ctx[17]}set clientstylingurl(a){this.$$set({clientstylingurl:a}),e.flush()}get translationurl(){return this.$$.ctx[18]}set translationurl(a){this.$$set({translationurl:a}),e.flush()}get gmversion(){return this.$$.ctx[19]}set gmversion(a){this.$$set({gmversion:a}),e.flush()}get displaybalanceoption(){return this.$$.ctx[20]}set displaybalanceoption(a){this.$$set({displaybalanceoption:a}),e.flush()}get totalcalculationmode(){return this.$$.ctx[10]}set totalcalculationmode(a){this.$$set({totalcalculationmode:a}),e.flush()}get currencylocale(){return this.$$.ctx[21]}set currencylocale(a){this.$$set({currencylocale:a}),e.flush()}get currencydisplay(){return this.$$.ctx[22]}set currencydisplay(a){this.$$set({currencydisplay:a}),e.flush()}get maximumfractiondigits(){return this.$$.ctx[23]}set maximumfractiondigits(a){this.$$set({maximumfractiondigits:a}),e.flush()}get minimumfractiondigits(){return this.$$.ctx[24]}set minimumfractiondigits(a){this.$$set({minimumfractiondigits:a}),e.flush()}get customdisplayformat(){return this.$$.ctx[25]}set customdisplayformat(a){this.$$set({customdisplayformat:a}),e.flush()}}e.create_custom_element(Ze,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Ze;
|
|
7
|
+
`,ye+=ue):de==="id"?Re=ue:de==="event"?ce=ue:de==="retry"?(r=Te(ue,r),h=r):de==="heartbeatTimeout"&&(c=Te(ue,c),P!==0&&(m(P),P=y(function(){Se()},c)))}if(X===re){if(ye!==""){b=Re,ce===""&&(ce="message");var ve=new te(ce,{data:ye.slice(1),lastEventId:Re});if(o.dispatchEvent(ve),ce==="open"?fe(o,o.onopen,ve):ce==="message"?fe(o,o.onmessage,ve):ce==="error"&&fe(o,o.onerror,ve),ne===pe)return}ye="",ce=""}X=Q===13?we:re}else X===re&&(Le=z,X=be),X===be?Q===58&&(he=z+1,X=me):X===me&&(X=Ce)}}},Ie=function(H){if(ne===$||ne===oe){ne=se,P!==0&&(m(P),P=0),P=y(function(){Se()},h),h=ge(Math.min(r*16,h*2)),o.readyState=oe;var I=new p("error",{error:H});o.dispatchEvent(I),fe(o,o.onerror,I),H!=null&&console.error(H)}},Oe=function(){ne=pe,W!=null&&(W.abort(),W=void 0),P!==0&&(m(P),P=0),o.readyState=pe},Se=function(){if(P=0,ne!==se){if(!s&&W!=null)Ie(new Error("No activity within "+c+" milliseconds. "+(ne===oe?"No response received.":C+" chars received.")+" Reconnecting.")),W!=null&&(W.abort(),W=void 0);else{var H=Math.max((s||Date.now())+c-Date.now(),1);s=!1,P=y(function(){Se()},H)}return}s=!1,C=0,P=y(function(){Se()},c),ne=oe,ye="",ce="",Re=b,Ee="",Le=0,he=0,X=re;var I=d;if(d.slice(0,5)!=="data:"&&d.slice(0,5)!=="blob:"&&b!==""){var Y=d.indexOf("?");I=Y===-1?d:d.slice(0,Y+1)+d.slice(Y+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(ue,ve){return ve===i?"":ue}),I+=(d.indexOf("?")===-1?"?":"&")+i+"="+encodeURIComponent(b)}var Q=o.withCredentials,G={};G.Accept="text/event-stream";var z=o.headers;if(z!=null)for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(G[de]=z[de]);try{W=ae.open(ee,Je,$e,Ie,I,Q,G)}catch(ue){throw Oe(),ue}};o.url=d,o.readyState=oe,o.withCredentials=t,o.headers=v,o._close=Oe,Se()}K.prototype=Object.create(j.prototype),K.prototype.CONNECTING=oe,K.prototype.OPEN=$,K.prototype.CLOSED=pe,K.prototype.close=function(){this._close()},K.CONNECTING=oe,K.OPEN=$,K.CLOSED=pe,K.prototype.withCredentials=void 0;var xe=w;u!=null&&(w==null||!("withCredentials"in w.prototype))&&(xe=K),function(o){{var d=o(a);d!==void 0&&(l.exports=d)}}(function(o){o.EventSourcePolyfill=K,o.NativeEventSource=w,o.EventSource=xe})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Fe,Fe.exports);var it=Fe.exports;function lt(l){e.append_styles(l,"svelte-lfsn3o",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}@keyframes growWidthPercent{from{height:0}to{height:100%}}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;background:transparent;border:none;font:inherit;color:inherit;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px;fill:black}.ShowBalance .BalanceValue span{padding-left:5px}.ShowBalance .BalanceValue .TriangleActive,.ShowBalance .BalanceValue .TriangleInactive{display:block;margin:0 3px;transition:all 0.2s}.ShowBalance .BalanceValue .TriangleActive:hover,.ShowBalance .BalanceValue .TriangleInactive:hover{transform:scale(1.2)}.ShowBalance .BalanceValue .TriangleActive svg,.ShowBalance .BalanceValue .TriangleInactive svg{margin:2px 0px}.ShowBalance .BalanceValue .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px)}.ShowBalance .BalanceValue .TriangleActive:hover{transform:scale(1.1) rotateX(180deg) translateY(3px)}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);position:absolute;top:40px;padding:10px;transform:translateX(-45%);box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919;transition:all 0.2s ease-in;opacity:0}.BalanceModalWrapper:before{content:"";background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:50%;width:25px;height:10px;z-index:1}.BalanceModalWrapper.Open{opacity:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;transition:all 0.3s ease;background:transparent;border:none;font:inherit;opacity:0}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModalClose:hover{transform:scale(1.1)}.BalanceModalClose.Open{opacity:1}.BalanceModal{transition:all 0.2s ease-in;width:270px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, white));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--color-primary);font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:30px;border:none;padding:10px 0;cursor:pointer;transition:all 0.2s ease-in;box-shadow:0px 3px 7px 0px rgba(0, 0, 0, 0.2)}.BalanceModalFooter .BalanceModalAction:hover{background:rgba(255, 255, 255, 0.1);color:var(--emw--color-primary);box-shadow:0px 0px 0px 2px inset var(--emw--color-primary);font-size:14px}.BalanceModalFooter .BalanceModalAction:active{background:rgba(255, 255, 255, 0.5)}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16;opacity:0;transition:all 0.2s linear}.ShowBalanceModalOverlay.Open{opacity:1}')}function Ge(l,a,n){const y=l.slice();return y[53]=a[n],y}function qe(l,a,n){const y=l.slice();return y[56]=a[n],y}function st(l){let a,n,y=(l[1].Total?l[8](l[1].Total[0].amount):"0")+"",m,u,T,g,w,B,D,k,M,_,S=l[4]&&Ke(l);return{c(){a=e.element("button"),n=e.element("p"),m=e.text(y),u=e.space(),T=e.element("span"),g=e.svg_element("svg"),w=e.svg_element("path"),D=e.space(),S&&S.c(),k=e.empty(),e.attr(w,"id","arrow"),e.attr(w,"d","M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z"),e.attr(w,"transform","translate(-274.511 -441.088)"),e.attr(w,"fill","#d1d1d1"),e.attr(g,"xmlns","http://www.w3.org/2000/svg"),e.attr(g,"width","14"),e.attr(g,"height","6.835"),e.attr(g,"viewBox","0 0 14 6.835"),e.attr(T,"class",B=l[3]?"TriangleActive":"TriangleInactive"),e.attr(a,"class","BalanceValue")},m(A,F){e.insert(A,a,F),e.append(a,n),e.append(n,m),e.append(a,u),e.append(a,T),e.append(T,g),e.append(g,w),e.insert(A,D,F),S&&S.m(A,F),e.insert(A,k,F),M||(_=e.listen(a,"click",l[26]),M=!0)},p(A,F){F[0]&2&&y!==(y=(A[1].Total?A[8](A[1].Total[0].amount):"0")+"")&&e.set_data(m,y),F[0]&8&&B!==(B=A[3]?"TriangleActive":"TriangleInactive")&&e.attr(T,"class",B),A[4]?S?S.p(A,F):(S=Ke(A),S.c(),S.m(k.parentNode,k)):S&&(S.d(1),S=null)},d(A){A&&(e.detach(a),e.detach(D),e.detach(k)),S&&S.d(A),M=!1,_()}}}function ct(l){let a,n=l[6]("Loading")+"",y;return{c(){a=e.element("p"),y=e.text(n),e.attr(a,"class","Loading")},m(m,u){e.insert(m,a,u),e.append(a,y)},p(m,u){u[0]&64&&n!==(n=m[6]("Loading")+"")&&e.set_data(y,n)},d(m){m&&e.detach(a)}}}function Ke(l){let a,n,y,m,u,T,g,w,B=l[6]("Title")+"",D,k,M,_,S,A,F=l[6]("DepositButton")+"",Z,J,N,L,q,ie,U=e.ensure_array_like(Object.keys(l[1])),O=[];for(let R=0;R<U.length;R+=1)O[R]=Ye(Ge(l,U,R));return{c(){a=e.element("div"),n=e.element("button"),m=e.space(),u=e.element("div"),T=e.element("div"),g=e.element("div"),w=e.element("p"),D=e.text(B),k=e.space(),M=e.element("div");for(let R=0;R<O.length;R+=1)O[R].c();_=e.space(),S=e.element("div"),A=e.element("button"),Z=e.text(F),e.attr(n,"class",y="BalanceModalClose "+(l[3]?"Open":"")),e.attr(w,"class","BalanceModalTitle"),e.attr(g,"class","BalanceModalHeader"),e.attr(M,"class","BalanceModalBody"),e.attr(A,"class","BalanceModalAction"),e.attr(S,"class","BalanceModalFooter"),e.attr(T,"class",J="ModalContent "+(l[3]?"Open":"")),e.attr(u,"class",N="BalanceModal "+(l[3]?"Open":"")),e.attr(a,"class",L="BalanceModalWrapper "+(l[3]?"Open":""))},m(R,j){e.insert(R,a,j),e.append(a,n),e.append(a,m),e.append(a,u),e.append(u,T),e.append(T,g),e.append(g,w),e.append(w,D),e.append(T,k),e.append(T,M);for(let E=0;E<O.length;E+=1)O[E]&&O[E].m(M,null);e.append(T,_),e.append(T,S),e.append(S,A),e.append(A,Z),q||(ie=[e.listen(n,"click",l[27]),e.listen(A,"click",l[28])],q=!0)},p(R,j){if(j[0]&8&&y!==(y="BalanceModalClose "+(R[3]?"Open":""))&&e.attr(n,"class",y),j[0]&64&&B!==(B=R[6]("Title")+"")&&e.set_data(D,B),j[0]&322){U=e.ensure_array_like(Object.keys(R[1]));let E;for(E=0;E<U.length;E+=1){const V=Ge(R,U,E);O[E]?O[E].p(V,j):(O[E]=Ye(V),O[E].c(),O[E].m(M,null))}for(;E<O.length;E+=1)O[E].d(1);O.length=U.length}j[0]&64&&F!==(F=R[6]("DepositButton")+"")&&e.set_data(Z,F),j[0]&8&&J!==(J="ModalContent "+(R[3]?"Open":""))&&e.attr(T,"class",J),j[0]&8&&N!==(N="BalanceModal "+(R[3]?"Open":""))&&e.attr(u,"class",N),j[0]&8&&L!==(L="BalanceModalWrapper "+(R[3]?"Open":""))&&e.attr(a,"class",L)},d(R){R&&e.detach(a),e.destroy_each(O,R),q=!1,e.run_all(ie)}}}function We(l){let a,n,y=l[6](l[53])+"",m,u,T=(l[56].productType?l[6](l[56].productType):"")+"",g,w,B,D,k=l[8](l[56].amount)+"",M;return{c(){a=e.element("div"),n=e.element("p"),m=e.text(y),u=e.space(),g=e.text(T),w=e.space(),B=e.element("p"),D=e.element("span"),M=e.text(k),e.attr(n,"class","BalanceModalText"),e.attr(D,"class","BalanceModalAmount"),e.attr(B,"class","BalanceModalValue"),e.attr(a,"class","BalanceModalRowLine")},m(_,S){e.insert(_,a,S),e.append(a,n),e.append(n,m),e.append(n,u),e.append(n,g),e.append(a,w),e.append(a,B),e.append(B,D),e.append(D,M)},p(_,S){S[0]&66&&y!==(y=_[6](_[53])+"")&&e.set_data(m,y),S[0]&66&&T!==(T=(_[56].productType?_[6](_[56].productType):"")+"")&&e.set_data(g,T),S[0]&2&&k!==(k=_[8](_[56].amount)+"")&&e.set_data(M,k)},d(_){_&&e.detach(a)}}}function Ye(l){let a,n,y=e.ensure_array_like(l[1][l[53]]),m=[];for(let u=0;u<y.length;u+=1)m[u]=We(qe(l,y,u));return{c(){a=e.element("div");for(let u=0;u<m.length;u+=1)m[u].c();n=e.space(),e.attr(a,"class","BalanceModalRowBoth")},m(u,T){e.insert(u,a,T);for(let g=0;g<m.length;g+=1)m[g]&&m[g].m(a,null);e.append(a,n)},p(u,T){if(T[0]&322){y=e.ensure_array_like(u[1][u[53]]);let g;for(g=0;g<y.length;g+=1){const w=qe(u,y,g);m[g]?m[g].p(w,T):(m[g]=We(w),m[g].c(),m[g].m(a,n))}for(;g<m.length;g+=1)m[g].d(1);m.length=y.length}},d(u){u&&e.detach(a),e.destroy_each(m,u)}}}function Qe(l){let a,n,y;return{c(){a=e.element("button"),e.attr(a,"class","ShowBalanceModalOverlay")},m(m,u){e.insert(m,a,u),n||(y=e.listen(a,"click",l[29]),n=!0)},p:e.noop,d(m){m&&e.detach(a),n=!1,y()}}}function dt(l){let a,n,y,m;function u(B,D){return B[2]?ct:st}let T=u(l),g=T(l),w=l[4]&&Qe(l);return{c(){a=e.element("div"),n=e.element("div"),g.c(),m=e.space(),w&&w.c(),e.attr(n,"class",y="ShowBalance "+(l[5]?"Mobile":""))},m(B,D){e.insert(B,a,D),e.append(a,n),g.m(n,null),e.append(a,m),w&&w.m(a,null),l[30](a)},p(B,D){T===(T=u(B))&&g?g.p(B,D):(g.d(1),g=T(B),g&&(g.c(),g.m(n,null))),D[0]&32&&y!==(y="ShowBalance "+(B[5]?"Mobile":""))&&e.attr(n,"class",y),B[4]?w?w.p(B,D):(w=Qe(B),w.c(),w.m(a,null)):w&&(w.d(1),w=null)},i:e.noop,o:e.noop,d(B){B&&e.detach(a),g.d(),w&&w.d(),l[30](null)}}}function ut(l,a,n){let y;e.component_subscribe(l,e.$format,t=>n(6,y=t));let{userid:m=""}=a,{session:u=""}=a,{endpoint:T=""}=a,{lang:g="en"}=a,{mbsource:w}=a,{clientstyling:B=""}=a,{clientstylingurl:D=""}=a,{translationurl:k=""}=a,{gmversion:M="gm16"}=a,{displaybalanceoption:_="All"}=a,{totalcalculationmode:S="totalCashAmount"}=a,{currencylocale:A="en"}=a,{currencydisplay:F="symbol"}=a,{maximumfractiondigits:Z="2"}=a,{minimumfractiondigits:J="0"}=a,{customdisplayformat:N=""}=a,L,q=!0,ie=!1,U=!1,O=!1,R=!1,j=window.navigator.userAgent,E,V="",te=[],le;const p={},se=["totalCashAmount","totalRealAmount"],oe=()=>{fetch(k).then(t=>t.json()).then(t=>Object.keys(t).forEach(i=>Pe(i,t[i]))).catch(t=>console.log(t))};Object.keys(Xe).forEach(t=>Pe(t,Xe[t]));const $=t=>{switch(t){case"balance":window.postMessage({type:"BalanceModalStatus",status:"open"},window.location.href),n(4,O=!0),setTimeout(()=>n(3,ie=!0),150);break;case"closebalance":n(3,ie=!1),window.postMessage({type:"BalanceModalStatus",status:"close"},window.location.href),setTimeout(()=>{n(4,O=!1)},150);break}},pe=t=>{if(N)return we(t);const i=A||g,r={style:"currency",currency:V,useGrouping:!0,currencyDisplay:F||"code",maximumFractionDigits:Z===""||isNaN(Number(Z))?2:Number(Z),minimumFractionDigits:J===""||isNaN(Number(J))?0:Number(J)};return new Intl.NumberFormat(i,r).format(t)},we=t=>{const i=[];let r="";for(const c of N)switch(c){default:r+=c;break;case"{":r&&i.push(r),r="";break;case"}":const[b,h]=r.split("|");if(r="",b.toLowerCase()==="currency")r=V;else if(b.toLowerCase()==="amount"){let s=",",C=".",v=2;h&&(h[0]!==" "&&(s=h[0]),h[1]!==" "&&(C=h[1]),h[2]!==" "&&!isNaN(Number(h[2]))&&(v=Number(h[2])));let[x,ee]=String(Math.floor(t*Ne(10,v))/Ne(10,v)).split(".");r+=x[0];for(let ae=1;ae<x.length;++ae)(x.length-ae)%3===0?r+=s+x[ae]:r+=x[ae];ee&&(r+=C+ee)}r&&i.push(r),r="";break}return i.push(r),i.join("")},re=()=>Ue(this,null,function*(){var i,r,c;n(2,q=!0);const t=new URL(`${T}/v1/player/${m}/account`);try{const b=yield fetch(t,{method:"GET",headers:{"X-SessionID":u}}),h=yield b.json();if(b.ok)window.postMessage({type:"BalancedFetched"},window.location.href),te=h.items,V=(i=te.find(s=>s.displayName==="Casino"))==null?void 0:i.currency,n(1,p.Total=[{amount:h.totalAmount[V]}],p),n(1,p.Real=[{amount:(r=te.find(s=>s.displayName==="Casino"))==null?void 0:r.balanceAmount}],p),n(1,p.Bonus=[{amount:(c=te.find(s=>s.displayName==="UBS"))==null?void 0:c.balanceAmount}],p);else throw new Error("Failed to fetch balance data !")}catch(b){console.log("Balance error: ",b)}finally{n(2,q=!1)}}),be=()=>{n(2,q=!0);const t=new URL(`${T}/v2/player/${m}/balance`),i=new Headers;i.append("X-SessionID",u),fetch(t,{method:"GET",headers:i}).then(c=>c.json()).then(c=>{c[S]||n(10,S=se[0]);const b=c.items.find(s=>s.type==="Real"&&s.walletAccountType==="Ordinary");if(V=b.currency,U=!!b.productType,n(1,p.Total=[{amount:0}],p),n(1,p.Real=[],p),n(1,p.Bonus=[],p),n(1,p.Credit=[],p),!U){le={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},n(1,p.Total[0].amount=c[S][V],p);for(const s of c.items)switch(s.type){case"Bonus":p.Bonus.length===0?p.Bonus.push({amount:s.amount}):n(1,p.Bonus[0].amount+=s.amount,p);break;case"Real":if(s.creditLine&&p.Credit.length===0&&p.Credit.push({amount:s.creditLine}),S==="totalRealAmount")continue;p.Real.length===0?p.Real.push({amount:s.amount}):n(1,p.Real[0].amount+=s.amount,p);break}for(const[s,C]of Object.entries(p))C.length<1&&delete p[s];n(2,q=!1);return}le={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let h=c.items;_&&_!=="All"&&(h=c.items.filter(s=>s.productType===_));for(const s of h){let C;switch(s.type){case"Bonus":C=p.Bonus.findIndex(v=>v.productType===s.productType),C>0?n(1,p.Bonus[C].amount+=s.amount,p):p.Bonus.push({amount:s.amount,productType:s.productType});break;case"Real":s.creditLine&&p.Credit.push({amount:s.creditLine,productType:s.productType}),C=p.Real.findIndex(v=>v.productType===s.productType),C>0?n(1,p.Real[C].amount+=s.amount,p):p.Real.push({amount:s.amount,productType:s.productType});break}}_e();for(const[s,C]of Object.entries(p))C.length<1&&delete p[s];n(2,q=!1)}).catch(c=>{throw n(2,q=!1),console.log("Balance fetch error",c),new Error("Failed to fetch balance data!")})},me=()=>{if(E&&E.close(),u.length<1)return;let t,i;switch(M){case"gm16":t=new URL(`${T}/v2/player/${m}/information/updates`),i=b=>Te(b);break;case"gmcore":t=new URL(`${T}/v1/player/${m}/balance/updates`),i=b=>De(b);break}const r={accept:"text/event-stream","X-SessionId":u},c=new it.EventSourcePolyfill(t,{headers:r});E=c,c.addEventListener("message",i)},Ce=t=>{let i;try{i=JSON.parse(t)}catch(r){console.log("Balance stream failed: ",r);return}return i},De=t=>{var b,h;const i=Ce(t.data);if(!i){me();return}let r="0";const c=i.balanceChange;te=te.map(s=>(c&&c[s.id]&&(s=Ve(ze({},s),{balanceAmount:c[s.id].afterAmount})),r=(parseFloat(s==null?void 0:s.balanceAmount)+parseFloat(r)).toString(),s)),n(1,p.Real=[{amount:(b=te[0])==null?void 0:b.balanceAmount}],p),n(1,p.Bonus=[{amount:(h=te[1])==null?void 0:h.balanceAmount}],p),n(1,p.Total=[{amount:Number(r)}],p)},Be=(t,i,r)=>{let c=null;switch(r.walletAccountType){case"Ordinary":(r.afterAmount!==r.affectedAmount||i.lastOrdinaryAfterAmount===0)&&(i.lastOrdinaryAfterAmount=r.afterAmount,i.showCreditLineAfterAmount||(c=r.afterAmount));break;case"CreditLine":r.afterAmount!==0?(c=r.afterAmount,i.showCreditLineAfterAmount=!0):(c=i.lastOrdinaryAfterAmount,i.showCreditLineAfterAmount=!1);break;default:c=r.afterAmount}return c===null?t:c},_e=()=>{switch(S){case"totalCashAmount":let t=0;for(const r of["Real","Bonus"])for(const c of p[r])t+=Math.max(c.amount,0);n(1,p.Total[0].amount=t,p);break;case"totalRealAmount":if(!U)return;let i=0;for(const r of p.Real)i+=r.amount;n(1,p.Total[0].amount=i,p)}},Te=t=>{const i=Ce(t.data);if(!i){me();return}if(i.type!=="BALANCE_UPDATE_V2")return;const r=i.body.balanceChange;for(const[c,b]of Object.entries(r))if(S==="totalRealAmount"&&c==="Real"&&!U&&n(1,p.Total[0].amount=Be(p.Total[0].amount,le,b),p),!!p[c])for(const h of p[c]){if(!U){h.amount=c==="Real"?Be(h.amount,le,b):b.afterAmount;continue}b.productType===h.productType&&(h.amount=c==="Real"?Be(h.amount,le[h.productType],b):b.afterAmount)}_e()},ge=()=>{$("closebalance"),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&>ag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},fe=()=>{se.includes(S)||(console.error(`Unsupported value ('${S}') for totalcalculationmode parameter. Only the following values are supported ${se}. Using default value ('${se[0]}').`),n(10,S=se[0]))},K=()=>{switch(rt(g),fe(),M){case"gmcore":re();break;case"gm16":be();break;default:throw Error(`Invalid apiversion attribute: ${M}`)}},Ae=t=>t.data&&t.data.type==="LogoutSuccessfull"&&E.close(),Me=()=>{window.postMessage({type:"UpdateBalanceBackground"},window.location.href)};e.onMount(()=>(window.addEventListener("message",Ae,!1),n(5,R=e.isMobile(j)),()=>{window.removeEventListener("message",Ae),E&&E.close()}));const ke=()=>$("balance"),xe=()=>$("closebalance"),o=()=>ge(),d=()=>$("closeBalance");function f(t){e.binding_callbacks[t?"unshift":"push"](()=>{L=t,n(0,L)})}return l.$$set=t=>{"userid"in t&&n(11,m=t.userid),"session"in t&&n(12,u=t.session),"endpoint"in t&&n(13,T=t.endpoint),"lang"in t&&n(14,g=t.lang),"mbsource"in t&&n(15,w=t.mbsource),"clientstyling"in t&&n(16,B=t.clientstyling),"clientstylingurl"in t&&n(17,D=t.clientstylingurl),"translationurl"in t&&n(18,k=t.translationurl),"gmversion"in t&&n(19,M=t.gmversion),"displaybalanceoption"in t&&n(20,_=t.displaybalanceoption),"totalcalculationmode"in t&&n(10,S=t.totalcalculationmode),"currencylocale"in t&&n(21,A=t.currencylocale),"currencydisplay"in t&&n(22,F=t.currencydisplay),"maximumfractiondigits"in t&&n(23,Z=t.maximumfractiondigits),"minimumfractiondigits"in t&&n(24,J=t.minimumfractiondigits),"customdisplayformat"in t&&n(25,N=t.customdisplayformat)},l.$$.update=()=>{l.$$.dirty[0]&1603584&&T&&m&&u&&g&&M&&_&&K(),l.$$.dirty[0]&538624&&T&&m&&u&&M&&me(),l.$$.dirty[0]&262144&&k&&oe(),l.$$.dirty[0]&2&&p.Total&&Me(),l.$$.dirty[0]&65537&&B&&L&&e.setClientStyling(L,B),l.$$.dirty[0]&131073&&D&&L&&e.setClientStylingURL(L,D),l.$$.dirty[0]&32769&&w&&L&&e.setStreamStyling(L,`${w}.Style`)},[L,p,q,ie,O,R,y,$,pe,ge,S,m,u,T,g,w,B,D,k,M,_,A,F,Z,J,N,ke,xe,o,d,f]}class Ze extends e.SvelteComponent{constructor(a){super(),e.init(this,a,ut,dt,e.safe_not_equal,{userid:11,session:12,endpoint:13,lang:14,mbsource:15,clientstyling:16,clientstylingurl:17,translationurl:18,gmversion:19,displaybalanceoption:20,totalcalculationmode:10,currencylocale:21,currencydisplay:22,maximumfractiondigits:23,minimumfractiondigits:24,customdisplayformat:25},lt,[-1,-1])}get userid(){return this.$$.ctx[11]}set userid(a){this.$$set({userid:a}),e.flush()}get session(){return this.$$.ctx[12]}set session(a){this.$$set({session:a}),e.flush()}get endpoint(){return this.$$.ctx[13]}set endpoint(a){this.$$set({endpoint:a}),e.flush()}get lang(){return this.$$.ctx[14]}set lang(a){this.$$set({lang:a}),e.flush()}get mbsource(){return this.$$.ctx[15]}set mbsource(a){this.$$set({mbsource:a}),e.flush()}get clientstyling(){return this.$$.ctx[16]}set clientstyling(a){this.$$set({clientstyling:a}),e.flush()}get clientstylingurl(){return this.$$.ctx[17]}set clientstylingurl(a){this.$$set({clientstylingurl:a}),e.flush()}get translationurl(){return this.$$.ctx[18]}set translationurl(a){this.$$set({translationurl:a}),e.flush()}get gmversion(){return this.$$.ctx[19]}set gmversion(a){this.$$set({gmversion:a}),e.flush()}get displaybalanceoption(){return this.$$.ctx[20]}set displaybalanceoption(a){this.$$set({displaybalanceoption:a}),e.flush()}get totalcalculationmode(){return this.$$.ctx[10]}set totalcalculationmode(a){this.$$set({totalcalculationmode:a}),e.flush()}get currencylocale(){return this.$$.ctx[21]}set currencylocale(a){this.$$set({currencylocale:a}),e.flush()}get currencydisplay(){return this.$$.ctx[22]}set currencydisplay(a){this.$$set({currencydisplay:a}),e.flush()}get maximumfractiondigits(){return this.$$.ctx[23]}set maximumfractiondigits(a){this.$$set({maximumfractiondigits:a}),e.flush()}get minimumfractiondigits(){return this.$$.ctx[24]}set minimumfractiondigits(a){this.$$set({minimumfractiondigits:a}),e.flush()}get customdisplayformat(){return this.$$.ctx[25]}set customdisplayformat(a){this.$$set({customdisplayformat:a}),e.flush()}}e.create_custom_element(Ze,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Ze;
|