@obb871001/api-integration-sdk 1.0.88 → 1.0.89
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/dist/index.cjs +4 -4
- package/dist/index.js +531 -531
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,28 +11,28 @@ var ba;
|
|
|
11
11
|
function Ni() {
|
|
12
12
|
if (ba) return be;
|
|
13
13
|
ba = 1;
|
|
14
|
-
var e = ke,
|
|
15
|
-
function U(_,
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
for (
|
|
19
|
-
if (_ && _.defaultProps) for (
|
|
20
|
-
return { $$typeof:
|
|
14
|
+
var e = ke, m = Symbol.for("react.element"), c = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function U(_, r, s) {
|
|
16
|
+
var n, i = {}, d = null, l = null;
|
|
17
|
+
s !== void 0 && (d = "" + s), r.key !== void 0 && (d = "" + r.key), r.ref !== void 0 && (l = r.ref);
|
|
18
|
+
for (n in r) u.call(r, n) && !p.hasOwnProperty(n) && (i[n] = r[n]);
|
|
19
|
+
if (_ && _.defaultProps) for (n in r = _.defaultProps, r) i[n] === void 0 && (i[n] = r[n]);
|
|
20
|
+
return { $$typeof: m, type: _, key: d, ref: l, props: i, _owner: o.current };
|
|
21
21
|
}
|
|
22
|
-
return be.Fragment =
|
|
22
|
+
return be.Fragment = c, be.jsx = U, be.jsxs = U, be;
|
|
23
23
|
}
|
|
24
24
|
var Te = {};
|
|
25
25
|
var Ta;
|
|
26
26
|
function Di() {
|
|
27
27
|
return Ta || (Ta = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var e = ke,
|
|
28
|
+
var e = ke, m = Symbol.for("react.element"), c = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), U = Symbol.for("react.provider"), _ = Symbol.for("react.context"), r = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), t = Symbol.iterator, y = "@@iterator";
|
|
29
29
|
function b(a) {
|
|
30
30
|
if (a === null || typeof a != "object")
|
|
31
31
|
return null;
|
|
32
32
|
var f = t && a[t] || a[y];
|
|
33
33
|
return typeof f == "function" ? f : null;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36
36
|
function T(a) {
|
|
37
37
|
{
|
|
38
38
|
for (var f = arguments.length, C = new Array(f > 1 ? f - 1 : 0), v = 1; v < f; v++)
|
|
@@ -42,7 +42,7 @@ function Di() {
|
|
|
42
42
|
}
|
|
43
43
|
function N(a, f, C) {
|
|
44
44
|
{
|
|
45
|
-
var v =
|
|
45
|
+
var v = g.ReactDebugCurrentFrame, E = v.getStackAddendum();
|
|
46
46
|
E !== "" && (f += "%s", C = C.concat([E]));
|
|
47
47
|
var G = C.map(function(S) {
|
|
48
48
|
return String(S);
|
|
@@ -53,7 +53,7 @@ function Di() {
|
|
|
53
53
|
var D = !1, h = !1, L = !1, M = !1, _e = !1, fe;
|
|
54
54
|
fe = Symbol.for("react.module.reference");
|
|
55
55
|
function Fe(a) {
|
|
56
|
-
return !!(typeof a == "string" || typeof a == "function" || a ===
|
|
56
|
+
return !!(typeof a == "string" || typeof a == "function" || a === u || a === p || _e || a === o || a === s || a === n || M || a === l || D || h || L || typeof a == "object" && a !== null && (a.$$typeof === d || a.$$typeof === i || a.$$typeof === U || a.$$typeof === _ || a.$$typeof === r || // This needs to include all possible module reference object
|
|
57
57
|
// types supported by any Flight configuration anywhere since
|
|
58
58
|
// we don't know which Flight build this will end up being used
|
|
59
59
|
// with.
|
|
@@ -77,17 +77,17 @@ function Di() {
|
|
|
77
77
|
if (typeof a == "string")
|
|
78
78
|
return a;
|
|
79
79
|
switch (a) {
|
|
80
|
-
case
|
|
80
|
+
case u:
|
|
81
81
|
return "Fragment";
|
|
82
|
-
case
|
|
82
|
+
case c:
|
|
83
83
|
return "Portal";
|
|
84
|
-
case
|
|
84
|
+
case p:
|
|
85
85
|
return "Profiler";
|
|
86
86
|
case o:
|
|
87
87
|
return "StrictMode";
|
|
88
|
-
case
|
|
88
|
+
case s:
|
|
89
89
|
return "Suspense";
|
|
90
|
-
case
|
|
90
|
+
case n:
|
|
91
91
|
return "SuspenseList";
|
|
92
92
|
}
|
|
93
93
|
if (typeof a == "object")
|
|
@@ -98,12 +98,12 @@ function Di() {
|
|
|
98
98
|
case U:
|
|
99
99
|
var C = a;
|
|
100
100
|
return V(C._context) + ".Provider";
|
|
101
|
-
case
|
|
101
|
+
case r:
|
|
102
102
|
return Se(a, a.render, "ForwardRef");
|
|
103
103
|
case i:
|
|
104
104
|
var v = a.displayName || null;
|
|
105
105
|
return v !== null ? v : H(a.type) || "Memo";
|
|
106
|
-
case
|
|
106
|
+
case d: {
|
|
107
107
|
var E = a, G = E._payload, S = E._init;
|
|
108
108
|
try {
|
|
109
109
|
return H(S(G));
|
|
@@ -176,7 +176,7 @@ function Di() {
|
|
|
176
176
|
ae < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
var se =
|
|
179
|
+
var se = g.ReactCurrentDispatcher, j;
|
|
180
180
|
function ue(a, f, C) {
|
|
181
181
|
{
|
|
182
182
|
if (j === void 0)
|
|
@@ -281,18 +281,18 @@ function Di() {
|
|
|
281
281
|
if (typeof a == "string")
|
|
282
282
|
return ue(a);
|
|
283
283
|
switch (a) {
|
|
284
|
-
case
|
|
284
|
+
case s:
|
|
285
285
|
return ue("Suspense");
|
|
286
|
-
case
|
|
286
|
+
case n:
|
|
287
287
|
return ue("SuspenseList");
|
|
288
288
|
}
|
|
289
289
|
if (typeof a == "object")
|
|
290
290
|
switch (a.$$typeof) {
|
|
291
|
-
case
|
|
291
|
+
case r:
|
|
292
292
|
return qa(a.render);
|
|
293
293
|
case i:
|
|
294
294
|
return Ge(a.type, f, C);
|
|
295
|
-
case
|
|
295
|
+
case d: {
|
|
296
296
|
var v = a, E = v._payload, G = v._init;
|
|
297
297
|
try {
|
|
298
298
|
return Ge(G(E), f, C);
|
|
@@ -302,7 +302,7 @@ function Di() {
|
|
|
302
302
|
}
|
|
303
303
|
return "";
|
|
304
304
|
}
|
|
305
|
-
var ye = Object.prototype.hasOwnProperty, ta = {}, na =
|
|
305
|
+
var ye = Object.prototype.hasOwnProperty, ta = {}, na = g.ReactDebugCurrentFrame;
|
|
306
306
|
function Me(a) {
|
|
307
307
|
if (a) {
|
|
308
308
|
var f = a._owner, C = Ge(a.type, a._source, f ? f.type : null);
|
|
@@ -353,7 +353,7 @@ function Di() {
|
|
|
353
353
|
if (ii(a))
|
|
354
354
|
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ai(a)), ma(a);
|
|
355
355
|
}
|
|
356
|
-
var oa =
|
|
356
|
+
var oa = g.ReactCurrentOwner, li = {
|
|
357
357
|
key: !0,
|
|
358
358
|
ref: !0,
|
|
359
359
|
__self: !0,
|
|
@@ -403,7 +403,7 @@ function Di() {
|
|
|
403
403
|
var si = function(a, f, C, v, E, G, S) {
|
|
404
404
|
var k = {
|
|
405
405
|
// This tag allows us to uniquely identify this as a React Element
|
|
406
|
-
$$typeof:
|
|
406
|
+
$$typeof: m,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: a,
|
|
409
409
|
key: f,
|
|
@@ -447,7 +447,7 @@ function Di() {
|
|
|
447
447
|
return si(a, k, F, E, v, oa.current, S);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
var Je =
|
|
450
|
+
var Je = g.ReactCurrentOwner, pa = g.ReactDebugCurrentFrame;
|
|
451
451
|
function pe(a) {
|
|
452
452
|
if (a) {
|
|
453
453
|
var f = a._owner, C = Ge(a.type, a._source, f ? f.type : null);
|
|
@@ -458,7 +458,7 @@ function Di() {
|
|
|
458
458
|
var ze;
|
|
459
459
|
ze = !1;
|
|
460
460
|
function Ze(a) {
|
|
461
|
-
return typeof a == "object" && a !== null && a.$$typeof ===
|
|
461
|
+
return typeof a == "object" && a !== null && a.$$typeof === m;
|
|
462
462
|
}
|
|
463
463
|
function ga() {
|
|
464
464
|
{
|
|
@@ -528,7 +528,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
528
528
|
var C;
|
|
529
529
|
if (typeof f == "function")
|
|
530
530
|
C = f.propTypes;
|
|
531
|
-
else if (typeof f == "object" && (f.$$typeof ===
|
|
531
|
+
else if (typeof f == "object" && (f.$$typeof === r || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
533
|
f.$$typeof === i))
|
|
534
534
|
C = f.propTypes;
|
|
@@ -567,7 +567,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
567
567
|
var F = pi();
|
|
568
568
|
F ? k += F : k += ga();
|
|
569
569
|
var R;
|
|
570
|
-
a === null ? R = "null" : We(a) ? R = "array" : a !== void 0 && a.$$typeof ===
|
|
570
|
+
a === null ? R = "null" : We(a) ? R = "array" : a !== void 0 && a.$$typeof === m ? (R = "<" + (H(a.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : R = typeof a, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, k);
|
|
571
571
|
}
|
|
572
572
|
var P = ui(a, f, C, E, G);
|
|
573
573
|
if (P == null)
|
|
@@ -599,7 +599,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
599
599
|
<%s key={someKey} {...props} />`, Ve, te, bi, te), fa[te + Ve] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return a ===
|
|
602
|
+
return a === u ? ci(P) : di(P), P;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
function _i(a, f, C) {
|
|
@@ -609,7 +609,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
609
609
|
return Ua(a, f, C, !1);
|
|
610
610
|
}
|
|
611
611
|
var Ui = fi, yi = _i;
|
|
612
|
-
Te.Fragment =
|
|
612
|
+
Te.Fragment = u, Te.jsx = Ui, Te.jsxs = yi;
|
|
613
613
|
})()), Te;
|
|
614
614
|
}
|
|
615
615
|
var Ca;
|
|
@@ -625,27 +625,27 @@ const Za = Fa(null), de = () => {
|
|
|
625
625
|
};
|
|
626
626
|
function Li({
|
|
627
627
|
baseURL: e,
|
|
628
|
-
getToken:
|
|
629
|
-
timeoutMs:
|
|
630
|
-
lng:
|
|
628
|
+
getToken: m,
|
|
629
|
+
timeoutMs: c = 15e3,
|
|
630
|
+
lng: u = "tw",
|
|
631
631
|
store: o,
|
|
632
|
-
onError:
|
|
632
|
+
onError: p
|
|
633
633
|
} = {}) {
|
|
634
634
|
const U = hi.create({
|
|
635
635
|
baseURL: e,
|
|
636
|
-
timeout:
|
|
636
|
+
timeout: c,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
639
|
return U.interceptors.request.use(async (_) => {
|
|
640
|
-
if (_.headers = _.headers || {},
|
|
641
|
-
const
|
|
642
|
-
|
|
640
|
+
if (_.headers = _.headers || {}, m) {
|
|
641
|
+
const s = await m();
|
|
642
|
+
s && (_.headers.Authorization = `Bearer ${s}`);
|
|
643
643
|
}
|
|
644
|
-
const
|
|
645
|
-
return _.headers.Currency =
|
|
644
|
+
const r = o?.getState()?.isWalletCurrency || o?.getState()?.currency?.currentCurrency || "TWD";
|
|
645
|
+
return _.headers.Currency = r, _.headers["currency-code"] = r, _.headers.lang = u, _;
|
|
646
646
|
}), U.interceptors.response.use(
|
|
647
647
|
(_) => _.data,
|
|
648
|
-
(_) =>
|
|
648
|
+
(_) => p ? p(_, { instance: U }) : Promise.reject(_)
|
|
649
649
|
), U;
|
|
650
650
|
}
|
|
651
651
|
const Va = Fa(null), pl = () => {
|
|
@@ -656,128 +656,128 @@ const Va = Fa(null), pl = () => {
|
|
|
656
656
|
);
|
|
657
657
|
return e;
|
|
658
658
|
}, gl = () => {
|
|
659
|
-
const e = (
|
|
659
|
+
const e = (u, o) => !u && !o, m = (u) => u.startsWith("pc.");
|
|
660
660
|
return {
|
|
661
661
|
executeLogout: ({
|
|
662
|
-
isCallBackInvalid:
|
|
662
|
+
isCallBackInvalid: u = !1,
|
|
663
663
|
hostname: o = "",
|
|
664
|
-
shouldRedirect:
|
|
664
|
+
shouldRedirect: p,
|
|
665
665
|
onShowError: U,
|
|
666
666
|
onCleanup: _,
|
|
667
|
-
onRemoveToken:
|
|
668
|
-
onRedirect:
|
|
669
|
-
onGoogleLogout:
|
|
667
|
+
onRemoveToken: r,
|
|
668
|
+
onRedirect: s,
|
|
669
|
+
onGoogleLogout: n
|
|
670
670
|
}) => {
|
|
671
|
-
const i =
|
|
672
|
-
e(
|
|
671
|
+
const i = m(o);
|
|
672
|
+
e(u, i) && U?.(), _?.(), r?.(), p && s?.("/"), n?.();
|
|
673
673
|
},
|
|
674
674
|
shouldShowErrorNotice: e,
|
|
675
|
-
isMachineDomain:
|
|
675
|
+
isMachineDomain: m
|
|
676
676
|
};
|
|
677
|
-
}, Ia = (e = [],
|
|
678
|
-
const
|
|
679
|
-
return
|
|
677
|
+
}, Ia = (e = [], m) => Ye(e, { gameTypeName: m })?.gameTypeUid, Aa = (e = [], m) => Ye(e, { platform: m })?.platformUid, Ba = (e = [], m) => Ye(e, { SubPlatformEnum: m }), Ka = (e = [], m, c) => O(e) ? [] : e.filter((u) => c ? String(u?.SubPlatformEnumUid) === String(c?.SubPlatformEnumUid) : String(u.platformUid) === String(m)), Gi = (e = []) => O(e) ? {} : e.reduce((m, c) => {
|
|
678
|
+
const u = c?.game_subtype || "UNKNOWN";
|
|
679
|
+
return m[u] || (m[u] = []), m[u].push(c), m;
|
|
680
680
|
}, {}), Mi = ({
|
|
681
681
|
gameTypeName: e,
|
|
682
|
-
platforms:
|
|
683
|
-
gameList:
|
|
684
|
-
allGameTypes:
|
|
682
|
+
platforms: m,
|
|
683
|
+
gameList: c,
|
|
684
|
+
allGameTypes: u,
|
|
685
685
|
allPlatforms: o
|
|
686
686
|
}) => {
|
|
687
|
-
const
|
|
688
|
-
return
|
|
689
|
-
const
|
|
687
|
+
const p = Ia(u, e);
|
|
688
|
+
return p ? m.reduce((U, _) => {
|
|
689
|
+
const r = Aa(o, _), s = Ba(o, _), n = c[p] || [], i = Ka(
|
|
690
|
+
n,
|
|
690
691
|
r,
|
|
691
|
-
|
|
692
|
-
c
|
|
692
|
+
s
|
|
693
693
|
);
|
|
694
694
|
return O(i) || (U[_] = i), U;
|
|
695
695
|
}, {}) : {};
|
|
696
696
|
}, Ri = ({
|
|
697
697
|
platformName: e,
|
|
698
|
-
gamesOfType:
|
|
699
|
-
allPlatforms:
|
|
698
|
+
gamesOfType: m = [],
|
|
699
|
+
allPlatforms: c = []
|
|
700
700
|
}) => {
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
|
|
701
|
+
const u = Aa(c, e), o = Ba(c, e), p = Ka(
|
|
702
|
+
m,
|
|
703
|
+
u,
|
|
704
704
|
o
|
|
705
705
|
);
|
|
706
|
-
return Gi(
|
|
707
|
-
}, Pi = (e = {}) => !He(e) || O(e) ? [] : qe(e), va = (e = []) => !ee(e) || O(e) ? [] : we(e, "platform"), xi = (e = []) => !ee(e) || O(e) ? [] : we(e, "gameTypeName"), Oi = (e = []) => !ee(e) || O(e) ? [] : we(e, "game_subtype"), Hi = (e = {}) => !He(e) || O(e) ? [] : qe(e), wi = (e = [],
|
|
708
|
-
const o =
|
|
709
|
-
return o.forEach((
|
|
710
|
-
|
|
711
|
-
}), o.includes(
|
|
706
|
+
return Gi(p);
|
|
707
|
+
}, Pi = (e = {}) => !He(e) || O(e) ? [] : qe(e), va = (e = []) => !ee(e) || O(e) ? [] : we(e, "platform"), xi = (e = []) => !ee(e) || O(e) ? [] : we(e, "gameTypeName"), Oi = (e = []) => !ee(e) || O(e) ? [] : we(e, "game_subtype"), Hi = (e = {}) => !He(e) || O(e) ? [] : qe(e), wi = (e = [], m = []) => !ee(e) || O(e) ? {} : !ee(m) || O(m) ? {} : e.reduce((c, u) => {
|
|
708
|
+
const o = m.map((p) => p.game_subtype);
|
|
709
|
+
return o.forEach((p) => {
|
|
710
|
+
c[p] = c[p] || [];
|
|
711
|
+
}), o.includes(u.game_subtype) && c[u.game_subtype].push(u), c;
|
|
712
712
|
}, {}), Fi = ({
|
|
713
713
|
gameTypes: e = [],
|
|
714
|
-
platforms:
|
|
715
|
-
gameList:
|
|
716
|
-
allGameTypes:
|
|
714
|
+
platforms: m = [],
|
|
715
|
+
gameList: c = {},
|
|
716
|
+
allGameTypes: u = [],
|
|
717
717
|
allPlatforms: o = []
|
|
718
|
-
}) => !ee(e) || !ee(
|
|
718
|
+
}) => !ee(e) || !ee(m) ? {} : O(c) ? {} : e.reduce((p, U) => {
|
|
719
719
|
const _ = Mi({
|
|
720
720
|
gameTypeName: U,
|
|
721
|
-
platforms:
|
|
722
|
-
gameList:
|
|
723
|
-
allGameTypes:
|
|
721
|
+
platforms: m,
|
|
722
|
+
gameList: c,
|
|
723
|
+
allGameTypes: u,
|
|
724
724
|
allPlatforms: o
|
|
725
725
|
});
|
|
726
|
-
return O(_) || (
|
|
726
|
+
return O(_) || (p[U] = _), p;
|
|
727
727
|
}, {}), dl = ({
|
|
728
728
|
types: e = [],
|
|
729
|
-
platforms:
|
|
730
|
-
allGameType:
|
|
731
|
-
allGamePlatform:
|
|
729
|
+
platforms: m = [],
|
|
730
|
+
allGameType: c = [],
|
|
731
|
+
allGamePlatform: u = [],
|
|
732
732
|
allGameList: o = {}
|
|
733
|
-
} = {}) => !Array.isArray(e) || !Array.isArray(
|
|
734
|
-
const _ = Ia(
|
|
735
|
-
if (!_) return
|
|
736
|
-
const
|
|
737
|
-
const
|
|
733
|
+
} = {}) => !Array.isArray(e) || !Array.isArray(m) ? {} : e.reduce((p, U) => {
|
|
734
|
+
const _ = Ia(c, U);
|
|
735
|
+
if (!_) return p;
|
|
736
|
+
const r = o[_] || [], s = m.reduce((n, i) => {
|
|
737
|
+
const d = Ri({
|
|
738
738
|
platformName: i,
|
|
739
|
-
gamesOfType:
|
|
740
|
-
allPlatforms:
|
|
739
|
+
gamesOfType: r,
|
|
740
|
+
allPlatforms: u
|
|
741
741
|
});
|
|
742
|
-
return O(
|
|
742
|
+
return O(d) ? n : { ...n, [i]: d };
|
|
743
743
|
}, {});
|
|
744
|
-
return O(
|
|
745
|
-
}, {}), Wi = (e = {}) => !He(e) || O(e) ? {} : Object.values(e).reduce((
|
|
746
|
-
|
|
747
|
-
}),
|
|
744
|
+
return O(s) || (p[U] = s), p;
|
|
745
|
+
}, {}), Wi = (e = {}) => !He(e) || O(e) ? {} : Object.values(e).reduce((c, u) => (Object.entries(u).forEach(([o, p]) => {
|
|
746
|
+
c[o] ? c[o] = [...c[o], ...p] : c[o] = p;
|
|
747
|
+
}), c), {}), Ji = (e = {}) => {
|
|
748
748
|
if (!He(e) || O(e)) return {};
|
|
749
|
-
const
|
|
750
|
-
for (const [
|
|
751
|
-
|
|
752
|
-
for (const o of
|
|
753
|
-
const
|
|
754
|
-
|
|
749
|
+
const m = {};
|
|
750
|
+
for (const [c, u] of Object.entries(e)) {
|
|
751
|
+
m[c] = {};
|
|
752
|
+
for (const o of u) {
|
|
753
|
+
const p = o.game_subtype;
|
|
754
|
+
m[c][p] || (m[c][p] = []), m[c][p].push(o);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
return
|
|
757
|
+
return m;
|
|
758
758
|
}, zi = ({
|
|
759
759
|
allGameList: e = {},
|
|
760
|
-
allGamePlatform:
|
|
761
|
-
allGameType:
|
|
762
|
-
allGame_subtype:
|
|
760
|
+
allGamePlatform: m = [],
|
|
761
|
+
allGameType: c = [],
|
|
762
|
+
allGame_subtype: u = [],
|
|
763
763
|
allNewGameList: o = [],
|
|
764
|
-
allTopGameList:
|
|
764
|
+
allTopGameList: p = [],
|
|
765
765
|
randomlySelectedGames: U = [],
|
|
766
766
|
userFavoriteGame: _ = {},
|
|
767
|
-
exclusiveBrandGames:
|
|
768
|
-
highlightGames:
|
|
769
|
-
originPlatform:
|
|
767
|
+
exclusiveBrandGames: r = [],
|
|
768
|
+
highlightGames: s = [],
|
|
769
|
+
originPlatform: n = []
|
|
770
770
|
}) => {
|
|
771
|
-
const i = Pi(e),
|
|
771
|
+
const i = Pi(e), d = va(m), l = xi(c), t = Oi(u), y = va(n), b = Hi(_), g = Fi({
|
|
772
772
|
gameTypes: l,
|
|
773
|
-
platforms:
|
|
773
|
+
platforms: d,
|
|
774
774
|
gameList: e,
|
|
775
|
-
allGameTypes:
|
|
776
|
-
allPlatforms:
|
|
777
|
-
}), T = wi(i,
|
|
775
|
+
allGameTypes: c,
|
|
776
|
+
allPlatforms: m
|
|
777
|
+
}), T = wi(i, u), N = Wi(g), D = Ji(N);
|
|
778
778
|
return {
|
|
779
779
|
platform: {
|
|
780
|
-
all:
|
|
780
|
+
all: d,
|
|
781
781
|
origin: y
|
|
782
782
|
},
|
|
783
783
|
type: {
|
|
@@ -787,10 +787,10 @@ const Va = Fa(null), pl = () => {
|
|
|
787
787
|
gameList: {
|
|
788
788
|
all: i,
|
|
789
789
|
new: o,
|
|
790
|
-
top:
|
|
790
|
+
top: p,
|
|
791
791
|
favorite: b,
|
|
792
|
-
highlight:
|
|
793
|
-
exclusiveBrand:
|
|
792
|
+
highlight: s,
|
|
793
|
+
exclusiveBrand: r,
|
|
794
794
|
randomlySelected: U
|
|
795
795
|
},
|
|
796
796
|
categorized: {
|
|
@@ -802,11 +802,11 @@ const Va = Fa(null), pl = () => {
|
|
|
802
802
|
favorite: b
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
|
-
}, cl = (e = []) => !ee(e) || O(e) ? [] : qe(e, (
|
|
806
|
-
...
|
|
807
|
-
...
|
|
808
|
-
platform:
|
|
809
|
-
platformEnum:
|
|
805
|
+
}, cl = (e = []) => !ee(e) || O(e) ? [] : qe(e, (m) => O(m.SubPlatformEnum) ? m : m.SubPlatformEnum.map((c) => ({
|
|
806
|
+
...m,
|
|
807
|
+
...c,
|
|
808
|
+
platform: c.SubPlatformEnum,
|
|
809
|
+
platformEnum: c.SubPlatformEnum
|
|
810
810
|
}))), Zi = (e) => {
|
|
811
811
|
switch (e) {
|
|
812
812
|
case "tw":
|
|
@@ -827,32 +827,32 @@ const Va = Fa(null), pl = () => {
|
|
|
827
827
|
return e;
|
|
828
828
|
}
|
|
829
829
|
}, ce = () => {
|
|
830
|
-
const { client: e } = de(),
|
|
831
|
-
async (
|
|
832
|
-
const { mac_address:
|
|
833
|
-
mac_address:
|
|
834
|
-
app_version:
|
|
830
|
+
const { client: e } = de(), m = X(
|
|
831
|
+
async (r) => {
|
|
832
|
+
const { mac_address: s = "", app_version: n = "", anydesk_id: i = "" } = r, { data: d } = await e.post("/cash-register/login", {
|
|
833
|
+
mac_address: s,
|
|
834
|
+
app_version: n,
|
|
835
835
|
anydesk_id: i
|
|
836
836
|
});
|
|
837
|
-
return
|
|
837
|
+
return d;
|
|
838
838
|
},
|
|
839
839
|
[e]
|
|
840
|
-
),
|
|
841
|
-
async (
|
|
842
|
-
const { account:
|
|
840
|
+
), c = X(async () => e.get("/member/getMemberInfo"), [e]), u = X(async () => await e.get("/member/getGameList"), [e]), o = X(async () => await e.get("/member/getNowCurrencyExchange"), [e]), p = X(async () => await e.get("member/getFavoriteGame"), [e]), U = X(
|
|
841
|
+
async (r) => {
|
|
842
|
+
const { account: s, password: n, trans_code: i } = r;
|
|
843
843
|
return await e.post("/login", {
|
|
844
|
-
memId:
|
|
845
|
-
passwd:
|
|
844
|
+
memId: s,
|
|
845
|
+
passwd: n,
|
|
846
846
|
trans_code: i
|
|
847
847
|
});
|
|
848
848
|
},
|
|
849
849
|
[e]
|
|
850
850
|
), _ = X(async () => await e.post("/logout"), [e]);
|
|
851
851
|
return {
|
|
852
|
-
machineLoginApi:
|
|
853
|
-
userInfoApi:
|
|
854
|
-
userGameListApi:
|
|
855
|
-
userFavoriteGameApi:
|
|
852
|
+
machineLoginApi: m,
|
|
853
|
+
userInfoApi: c,
|
|
854
|
+
userGameListApi: u,
|
|
855
|
+
userFavoriteGameApi: p,
|
|
856
856
|
userCurrencyExchangeApi: o,
|
|
857
857
|
userLoginApi: U,
|
|
858
858
|
userLogoutApi: _
|
|
@@ -876,26 +876,26 @@ const Va = Fa(null), pl = () => {
|
|
|
876
876
|
},
|
|
877
877
|
user: { favorite: [] }
|
|
878
878
|
}, Ii = ({ enabled: e = !0 } = {}) => {
|
|
879
|
-
const { getToken:
|
|
879
|
+
const { getToken: m } = de(), { userFavoriteGameApi: c, userGameListApi: u } = ce(), { data: o, isLoading: p, error: U, refetch: _ } = oe({
|
|
880
880
|
queryKey: ["gamesInfo"],
|
|
881
881
|
queryFn: async () => {
|
|
882
|
-
let
|
|
882
|
+
let r = {}, s = {};
|
|
883
883
|
try {
|
|
884
|
-
await
|
|
885
|
-
} catch (
|
|
886
|
-
console.warn("Failed to fetch favorite games:",
|
|
884
|
+
await m?.() && (r = await c(), s = await u(), console.log("userGameListApi data:", s));
|
|
885
|
+
} catch (n) {
|
|
886
|
+
console.warn("Failed to fetch favorite games:", n);
|
|
887
887
|
}
|
|
888
888
|
return zi({
|
|
889
889
|
allGameList: window.gameTypeGroup || {},
|
|
890
|
-
allGamePlatform: window.platforms || [],
|
|
891
|
-
allGameType: window.gameType || [],
|
|
892
|
-
allGame_subtype: window.gameSubType || [],
|
|
893
|
-
allNewGameList: window.newGames || [],
|
|
894
|
-
allTopGameList: window.topGames || [],
|
|
895
|
-
userFavoriteGame:
|
|
896
|
-
randomlySelectedGames: window.randomlySelectedGames || [],
|
|
897
|
-
exclusiveBrandGames: window.exclusiveBrandGames || [],
|
|
898
|
-
highlightGames: window.highlightGames || [],
|
|
890
|
+
allGamePlatform: s.platforms || window.platforms || [],
|
|
891
|
+
allGameType: s.gameType || window.gameType || [],
|
|
892
|
+
allGame_subtype: s.gameSubType || window.gameSubType || [],
|
|
893
|
+
allNewGameList: s.newGames || window.newGames || [],
|
|
894
|
+
allTopGameList: s.topGames || window.topGames || [],
|
|
895
|
+
userFavoriteGame: r || {},
|
|
896
|
+
randomlySelectedGames: s.randomlySelectedGames || window.randomlySelectedGames || [],
|
|
897
|
+
exclusiveBrandGames: s.exclusiveBrandGames || window.exclusiveBrandGames || [],
|
|
898
|
+
highlightGames: s.highlightGames || window.highlightGames || [],
|
|
899
899
|
originPlatform: window.originPlatform || []
|
|
900
900
|
});
|
|
901
901
|
},
|
|
@@ -908,10 +908,10 @@ const Va = Fa(null), pl = () => {
|
|
|
908
908
|
refetchOnWindowFocus: !1
|
|
909
909
|
});
|
|
910
910
|
return {
|
|
911
|
-
gamesInfo:
|
|
912
|
-
isLoading:
|
|
913
|
-
error:
|
|
914
|
-
refetch:
|
|
911
|
+
gamesInfo: o || Vi,
|
|
912
|
+
isLoading: p,
|
|
913
|
+
error: U,
|
|
914
|
+
refetch: _
|
|
915
915
|
};
|
|
916
916
|
}, Ai = (e = !1) => {
|
|
917
917
|
if (!e && window.gameTypeGroup) {
|
|
@@ -27442,23 +27442,23 @@ const Va = Fa(null), pl = () => {
|
|
|
27442
27442
|
});
|
|
27443
27443
|
}, Bi = ({
|
|
27444
27444
|
children: e,
|
|
27445
|
-
autoFetch:
|
|
27446
|
-
mockData:
|
|
27445
|
+
autoFetch: m = !1,
|
|
27446
|
+
mockData: c = !1
|
|
27447
27447
|
}) => {
|
|
27448
27448
|
he(() => {
|
|
27449
|
-
|
|
27450
|
-
}, [
|
|
27451
|
-
const
|
|
27452
|
-
return /* @__PURE__ */ Oe.jsx(Va.Provider, { value:
|
|
27449
|
+
c && Ai(!0);
|
|
27450
|
+
}, [c]);
|
|
27451
|
+
const u = Ii({ enabled: m });
|
|
27452
|
+
return /* @__PURE__ */ Oe.jsx(Va.Provider, { value: u, children: e });
|
|
27453
27453
|
};
|
|
27454
27454
|
function _l({
|
|
27455
27455
|
children: e,
|
|
27456
|
-
autoFetchGamesInfo:
|
|
27457
|
-
useMockData:
|
|
27458
|
-
queryClient:
|
|
27456
|
+
autoFetchGamesInfo: m = !1,
|
|
27457
|
+
useMockData: c = !1,
|
|
27458
|
+
queryClient: u,
|
|
27459
27459
|
...o
|
|
27460
27460
|
}) {
|
|
27461
|
-
const
|
|
27461
|
+
const p = Qe(() => Li(o), [o]), U = Qe(
|
|
27462
27462
|
() => new Ci({
|
|
27463
27463
|
defaultOptions: {
|
|
27464
27464
|
queries: {
|
|
@@ -27468,86 +27468,86 @@ function _l({
|
|
|
27468
27468
|
}
|
|
27469
27469
|
}),
|
|
27470
27470
|
[]
|
|
27471
|
-
), _ =
|
|
27472
|
-
return /* @__PURE__ */ Oe.jsx(vi, { client: _, children: /* @__PURE__ */ Oe.jsx(Za.Provider, { value: { client:
|
|
27471
|
+
), _ = u || U;
|
|
27472
|
+
return /* @__PURE__ */ Oe.jsx(vi, { client: _, children: /* @__PURE__ */ Oe.jsx(Za.Provider, { value: { client: p, ...o }, children: /* @__PURE__ */ Oe.jsx(Bi, { autoFetch: m, mockData: c, children: e }) }) });
|
|
27473
27473
|
}
|
|
27474
|
-
const fl = ({ otherQueryKey: e = [], options:
|
|
27475
|
-
const { userCurrencyExchangeApi:
|
|
27474
|
+
const fl = ({ otherQueryKey: e = [], options: m = {} } = {}) => {
|
|
27475
|
+
const { userCurrencyExchangeApi: c } = ce(), { getToken: u } = de(), { enabled: o, ...p } = m, U = !!u && (o ? o.every((_) => _) : !0);
|
|
27476
27476
|
return Ja({
|
|
27477
27477
|
queries: [
|
|
27478
27478
|
{
|
|
27479
27479
|
queryKey: ["userCurrencyExchange", ...e],
|
|
27480
|
-
queryFn: () =>
|
|
27480
|
+
queryFn: () => c(),
|
|
27481
27481
|
enabled: U,
|
|
27482
27482
|
// ← 使用合併後的條件
|
|
27483
|
-
...
|
|
27483
|
+
...p
|
|
27484
27484
|
// ← 不包含 enabled
|
|
27485
27485
|
}
|
|
27486
27486
|
]
|
|
27487
27487
|
});
|
|
27488
27488
|
}, Ul = ({
|
|
27489
27489
|
refetchInterval: e = 5e4,
|
|
27490
|
-
trigger:
|
|
27491
|
-
enabled:
|
|
27490
|
+
trigger: m = [],
|
|
27491
|
+
enabled: c = !0
|
|
27492
27492
|
} = {}) => {
|
|
27493
|
-
const { getToken:
|
|
27493
|
+
const { getToken: u } = de(), { userInfoApi: o } = ce(), p = Ja({
|
|
27494
27494
|
queries: [
|
|
27495
27495
|
{
|
|
27496
|
-
queryKey: ["getMemberInfo", ...
|
|
27496
|
+
queryKey: ["getMemberInfo", ...m],
|
|
27497
27497
|
queryFn: async () => await o(),
|
|
27498
27498
|
refetchInterval: e,
|
|
27499
|
-
enabled: !!
|
|
27499
|
+
enabled: !!u && c
|
|
27500
27500
|
}
|
|
27501
27501
|
]
|
|
27502
|
-
}), { data: U, isFetching: _, error:
|
|
27503
|
-
return { data: U, isFetching: _, error:
|
|
27502
|
+
}), { data: U, isFetching: _, error: r } = p[0] || {};
|
|
27503
|
+
return { data: U, isFetching: _, error: r };
|
|
27504
27504
|
}, yl = ({ enabled: e = !0 } = {}) => {
|
|
27505
27505
|
const {
|
|
27506
|
-
userInfoApi:
|
|
27507
|
-
userFavoriteGameApi:
|
|
27508
|
-
userGameListApi:
|
|
27506
|
+
userInfoApi: m,
|
|
27507
|
+
userFavoriteGameApi: c,
|
|
27508
|
+
userGameListApi: u,
|
|
27509
27509
|
userCurrencyExchangeApi: o
|
|
27510
|
-
} = ce(),
|
|
27510
|
+
} = ce(), p = oe({
|
|
27511
27511
|
queryKey: ["getMemInfo"],
|
|
27512
|
-
queryFn: async () =>
|
|
27512
|
+
queryFn: async () => m(),
|
|
27513
27513
|
enabled: e
|
|
27514
27514
|
}), U = oe({
|
|
27515
27515
|
queryKey: ["getFavoriteGame"],
|
|
27516
|
-
queryFn: async () =>
|
|
27517
|
-
enabled: e &&
|
|
27516
|
+
queryFn: async () => c(),
|
|
27517
|
+
enabled: e && p.isSuccess
|
|
27518
27518
|
}), _ = oe({
|
|
27519
27519
|
queryKey: ["getUserGameList"],
|
|
27520
|
-
queryFn: async () =>
|
|
27521
|
-
enabled: e &&
|
|
27522
|
-
}),
|
|
27520
|
+
queryFn: async () => u(),
|
|
27521
|
+
enabled: e && p.isSuccess && U.isSuccess
|
|
27522
|
+
}), r = oe({
|
|
27523
27523
|
queryKey: ["getUserCurrencyExchange"],
|
|
27524
27524
|
queryFn: async () => o(),
|
|
27525
|
-
enabled: e &&
|
|
27525
|
+
enabled: e && p.isSuccess && U.isSuccess && _.isSuccess
|
|
27526
27526
|
});
|
|
27527
27527
|
return [
|
|
27528
|
-
|
|
27528
|
+
p,
|
|
27529
27529
|
U,
|
|
27530
27530
|
_,
|
|
27531
|
-
|
|
27531
|
+
r
|
|
27532
27532
|
];
|
|
27533
27533
|
};
|
|
27534
27534
|
var Ie = {}, J = {}, Ae = {}, ha;
|
|
27535
27535
|
function A() {
|
|
27536
27536
|
return ha || (ha = 1, (function(e) {
|
|
27537
27537
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.isEventSourceSupported = e.isReactNative = e.ReadyState = e.DEFAULT_HEARTBEAT = e.UNPARSABLE_JSON_OBJECT = e.DEFAULT_RECONNECT_INTERVAL_MS = e.DEFAULT_RECONNECT_LIMIT = e.SOCKET_IO_PING_CODE = e.SOCKET_IO_PATH = e.SOCKET_IO_PING_INTERVAL = e.DEFAULT_EVENT_SOURCE_OPTIONS = e.EMPTY_EVENT_HANDLERS = e.DEFAULT_OPTIONS = void 0;
|
|
27538
|
-
var
|
|
27538
|
+
var m = 1, c = 1e3 * m;
|
|
27539
27539
|
e.DEFAULT_OPTIONS = {}, e.EMPTY_EVENT_HANDLERS = {}, e.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
27540
27540
|
withCredentials: !1,
|
|
27541
27541
|
events: e.EMPTY_EVENT_HANDLERS
|
|
27542
|
-
}, e.SOCKET_IO_PING_INTERVAL = 25 *
|
|
27542
|
+
}, e.SOCKET_IO_PING_INTERVAL = 25 * c, e.SOCKET_IO_PATH = "/socket.io/?EIO=3&transport=websocket", e.SOCKET_IO_PING_CODE = "2", e.DEFAULT_RECONNECT_LIMIT = 20, e.DEFAULT_RECONNECT_INTERVAL_MS = 5e3, e.UNPARSABLE_JSON_OBJECT = {}, e.DEFAULT_HEARTBEAT = {
|
|
27543
27543
|
message: "ping",
|
|
27544
27544
|
timeout: 6e4,
|
|
27545
27545
|
interval: 25e3
|
|
27546
27546
|
};
|
|
27547
|
-
var
|
|
27548
|
-
(function(
|
|
27549
|
-
|
|
27550
|
-
})(
|
|
27547
|
+
var u;
|
|
27548
|
+
(function(p) {
|
|
27549
|
+
p[p.UNINSTANTIATED = -1] = "UNINSTANTIATED", p[p.CONNECTING = 0] = "CONNECTING", p[p.OPEN = 1] = "OPEN", p[p.CLOSING = 2] = "CLOSING", p[p.CLOSED = 3] = "CLOSED";
|
|
27550
|
+
})(u || (e.ReadyState = u = {}));
|
|
27551
27551
|
var o = function() {
|
|
27552
27552
|
try {
|
|
27553
27553
|
return "EventSource" in globalThis;
|
|
@@ -27562,72 +27562,72 @@ var Ce = {}, Be = {}, ka;
|
|
|
27562
27562
|
function Xe() {
|
|
27563
27563
|
return ka || (ka = 1, (function(e) {
|
|
27564
27564
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetWebSockets = e.sharedWebSockets = void 0, e.sharedWebSockets = {};
|
|
27565
|
-
var
|
|
27566
|
-
if (
|
|
27567
|
-
delete e.sharedWebSockets[
|
|
27565
|
+
var m = function(c) {
|
|
27566
|
+
if (c && e.sharedWebSockets.hasOwnProperty(c))
|
|
27567
|
+
delete e.sharedWebSockets[c];
|
|
27568
27568
|
else
|
|
27569
|
-
for (var
|
|
27570
|
-
e.sharedWebSockets.hasOwnProperty(
|
|
27569
|
+
for (var u in e.sharedWebSockets)
|
|
27570
|
+
e.sharedWebSockets.hasOwnProperty(u) && delete e.sharedWebSockets[u];
|
|
27571
27571
|
};
|
|
27572
|
-
e.resetWebSockets =
|
|
27572
|
+
e.resetWebSockets = m;
|
|
27573
27573
|
})(Be)), Be;
|
|
27574
27574
|
}
|
|
27575
27575
|
var ne = {}, Q = {}, Sa;
|
|
27576
27576
|
function $e() {
|
|
27577
27577
|
if (Sa) return Q;
|
|
27578
27578
|
Sa = 1, Object.defineProperty(Q, "__esModule", { value: !0 }), Q.setUpSocketIOPing = Q.appendQueryParams = Q.parseSocketIOUrl = void 0;
|
|
27579
|
-
var e = A(),
|
|
27579
|
+
var e = A(), m = function(o) {
|
|
27580
27580
|
if (o) {
|
|
27581
|
-
var
|
|
27582
|
-
return "".concat(
|
|
27581
|
+
var p = /^https|wss/.test(o), U = o.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = U.replace(/\/$/, ""), r = p ? "wss" : "ws";
|
|
27582
|
+
return "".concat(r, "://").concat(_).concat(e.SOCKET_IO_PATH);
|
|
27583
27583
|
} else if (o === "") {
|
|
27584
|
-
var
|
|
27585
|
-
return "".concat(
|
|
27584
|
+
var p = /^https/.test(window.location.protocol), r = p ? "wss" : "ws", s = window.location.port ? ":".concat(window.location.port) : "";
|
|
27585
|
+
return "".concat(r, "://").concat(window.location.hostname).concat(s).concat(e.SOCKET_IO_PATH);
|
|
27586
27586
|
}
|
|
27587
27587
|
return o;
|
|
27588
27588
|
};
|
|
27589
|
-
Q.parseSocketIOUrl =
|
|
27590
|
-
var
|
|
27591
|
-
|
|
27592
|
-
var U = /\?([\w]+=[\w]+)/, _ = U.test(o),
|
|
27593
|
-
var i =
|
|
27594
|
-
return
|
|
27589
|
+
Q.parseSocketIOUrl = m;
|
|
27590
|
+
var c = function(o, p) {
|
|
27591
|
+
p === void 0 && (p = {});
|
|
27592
|
+
var U = /\?([\w]+=[\w]+)/, _ = U.test(o), r = "".concat(Object.entries(p).reduce(function(s, n) {
|
|
27593
|
+
var i = n[0], d = n[1];
|
|
27594
|
+
return s + "".concat(i, "=").concat(d, "&");
|
|
27595
27595
|
}, "").slice(0, -1));
|
|
27596
|
-
return "".concat(o).concat(_ ? "&" : "?").concat(
|
|
27596
|
+
return "".concat(o).concat(_ ? "&" : "?").concat(r);
|
|
27597
27597
|
};
|
|
27598
|
-
Q.appendQueryParams =
|
|
27599
|
-
var
|
|
27600
|
-
|
|
27598
|
+
Q.appendQueryParams = c;
|
|
27599
|
+
var u = function(o, p) {
|
|
27600
|
+
p === void 0 && (p = e.SOCKET_IO_PING_INTERVAL);
|
|
27601
27601
|
var U = function() {
|
|
27602
27602
|
return o(e.SOCKET_IO_PING_CODE);
|
|
27603
27603
|
};
|
|
27604
|
-
return window.setInterval(U,
|
|
27604
|
+
return window.setInterval(U, p);
|
|
27605
27605
|
};
|
|
27606
|
-
return Q.setUpSocketIOPing =
|
|
27606
|
+
return Q.setUpSocketIOPing = u, Q;
|
|
27607
27607
|
}
|
|
27608
27608
|
var xe = {}, Na;
|
|
27609
27609
|
function ja() {
|
|
27610
27610
|
if (Na) return xe;
|
|
27611
|
-
Na = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.heartbeat =
|
|
27611
|
+
Na = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.heartbeat = c;
|
|
27612
27612
|
var e = A();
|
|
27613
|
-
function
|
|
27614
|
-
return Array.isArray(
|
|
27615
|
-
return o.current >
|
|
27616
|
-
}).current :
|
|
27613
|
+
function m(u) {
|
|
27614
|
+
return Array.isArray(u) ? u.reduce(function(o, p) {
|
|
27615
|
+
return o.current > p.current ? o : p;
|
|
27616
|
+
}).current : u.current;
|
|
27617
27617
|
}
|
|
27618
|
-
function
|
|
27619
|
-
var U =
|
|
27620
|
-
var b = Date.now(),
|
|
27621
|
-
if (
|
|
27622
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b -
|
|
27623
|
-
else if (
|
|
27618
|
+
function c(u, o, p) {
|
|
27619
|
+
var U = p || {}, _ = U.interval, r = _ === void 0 ? e.DEFAULT_HEARTBEAT.interval : _, s = U.timeout, n = s === void 0 ? e.DEFAULT_HEARTBEAT.timeout : s, i = U.message, d = i === void 0 ? e.DEFAULT_HEARTBEAT.message : i, l = Math.max(100, r / 10), t = Date.now(), y = setInterval(function() {
|
|
27620
|
+
var b = Date.now(), g = m(o);
|
|
27621
|
+
if (g + n <= b)
|
|
27622
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - g, "ms ago, last ping sent ").concat(b - t, "ms ago")), u.close();
|
|
27623
|
+
else if (g + r <= b && t + r <= b)
|
|
27624
27624
|
try {
|
|
27625
|
-
typeof
|
|
27625
|
+
typeof d == "function" ? u.send(d()) : u.send(d), t = b;
|
|
27626
27626
|
} catch (T) {
|
|
27627
|
-
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T),
|
|
27627
|
+
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T), u.close();
|
|
27628
27628
|
}
|
|
27629
27629
|
}, l);
|
|
27630
|
-
return
|
|
27630
|
+
return u.addEventListener("close", function() {
|
|
27631
27631
|
clearInterval(y);
|
|
27632
27632
|
}), function() {
|
|
27633
27633
|
};
|
|
@@ -27638,29 +27638,29 @@ var ve = {}, Ke = {}, Da;
|
|
|
27638
27638
|
function ea() {
|
|
27639
27639
|
return Da || (Da = 1, (function(e) {
|
|
27640
27640
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetSubscribers = e.removeSubscriber = e.addSubscriber = e.hasSubscribers = e.getSubscribers = void 0;
|
|
27641
|
-
var
|
|
27642
|
-
return (0, e.hasSubscribers)(
|
|
27641
|
+
var m = {}, c = [], u = function(r) {
|
|
27642
|
+
return (0, e.hasSubscribers)(r) ? Array.from(m[r]) : c;
|
|
27643
27643
|
};
|
|
27644
|
-
e.getSubscribers =
|
|
27645
|
-
var o = function(
|
|
27646
|
-
var
|
|
27647
|
-
return ((
|
|
27644
|
+
e.getSubscribers = u;
|
|
27645
|
+
var o = function(r) {
|
|
27646
|
+
var s;
|
|
27647
|
+
return ((s = m[r]) === null || s === void 0 ? void 0 : s.size) > 0;
|
|
27648
27648
|
};
|
|
27649
27649
|
e.hasSubscribers = o;
|
|
27650
|
-
var
|
|
27651
|
-
|
|
27650
|
+
var p = function(r, s) {
|
|
27651
|
+
m[r] = m[r] || /* @__PURE__ */ new Set(), m[r].add(s);
|
|
27652
27652
|
};
|
|
27653
|
-
e.addSubscriber =
|
|
27654
|
-
var U = function(
|
|
27655
|
-
|
|
27653
|
+
e.addSubscriber = p;
|
|
27654
|
+
var U = function(r, s) {
|
|
27655
|
+
m[r].delete(s);
|
|
27656
27656
|
};
|
|
27657
27657
|
e.removeSubscriber = U;
|
|
27658
|
-
var _ = function(
|
|
27659
|
-
if (
|
|
27660
|
-
delete
|
|
27658
|
+
var _ = function(r) {
|
|
27659
|
+
if (r && m.hasOwnProperty(r))
|
|
27660
|
+
delete m[r];
|
|
27661
27661
|
else
|
|
27662
|
-
for (var
|
|
27663
|
-
|
|
27662
|
+
for (var s in m)
|
|
27663
|
+
m.hasOwnProperty(s) && delete m[s];
|
|
27664
27664
|
};
|
|
27665
27665
|
e.resetSubscribers = _;
|
|
27666
27666
|
})(Ke)), Ke;
|
|
@@ -27668,14 +27668,14 @@ function ea() {
|
|
|
27668
27668
|
var Ea;
|
|
27669
27669
|
function aa() {
|
|
27670
27670
|
if (Ea) return ve;
|
|
27671
|
-
Ea = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.assertIsWebSocket =
|
|
27672
|
-
var e = Xe(),
|
|
27673
|
-
function
|
|
27674
|
-
if (!
|
|
27671
|
+
Ea = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.assertIsWebSocket = c, ve.resetGlobalState = u;
|
|
27672
|
+
var e = Xe(), m = ea();
|
|
27673
|
+
function c(o, p) {
|
|
27674
|
+
if (!p && !(o instanceof WebSocket))
|
|
27675
27675
|
throw new Error("");
|
|
27676
27676
|
}
|
|
27677
|
-
function
|
|
27678
|
-
(0,
|
|
27677
|
+
function u(o) {
|
|
27678
|
+
(0, m.resetSubscribers)(o), (0, e.resetWebSockets)(o);
|
|
27679
27679
|
}
|
|
27680
27680
|
return ve;
|
|
27681
27681
|
}
|
|
@@ -27684,70 +27684,70 @@ function Ki() {
|
|
|
27684
27684
|
if (La) return ne;
|
|
27685
27685
|
La = 1;
|
|
27686
27686
|
var e = ne && ne.__assign || function() {
|
|
27687
|
-
return e = Object.assign || function(
|
|
27688
|
-
for (var i,
|
|
27689
|
-
i = arguments[
|
|
27690
|
-
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (
|
|
27687
|
+
return e = Object.assign || function(n) {
|
|
27688
|
+
for (var i, d = 1, l = arguments.length; d < l; d++) {
|
|
27689
|
+
i = arguments[d];
|
|
27690
|
+
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (n[t] = i[t]);
|
|
27691
27691
|
}
|
|
27692
|
-
return
|
|
27692
|
+
return n;
|
|
27693
27693
|
}, e.apply(this, arguments);
|
|
27694
27694
|
};
|
|
27695
27695
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachListeners = void 0;
|
|
27696
|
-
var
|
|
27697
|
-
|
|
27696
|
+
var m = $e(), c = ja(), u = A(), o = aa(), p = function(n, i, d, l) {
|
|
27697
|
+
n.onmessage = function(t) {
|
|
27698
27698
|
var y;
|
|
27699
|
-
i.current.onMessage && i.current.onMessage(t), typeof l?.current == "number" && (l.current = Date.now()), !(typeof i.current.filter == "function" && i.current.filter(t) !== !0) && (i.current.heartbeat && typeof i.current.heartbeat != "boolean" && ((y = i.current.heartbeat) === null || y === void 0 ? void 0 : y.returnMessage) === t.data ||
|
|
27699
|
+
i.current.onMessage && i.current.onMessage(t), typeof l?.current == "number" && (l.current = Date.now()), !(typeof i.current.filter == "function" && i.current.filter(t) !== !0) && (i.current.heartbeat && typeof i.current.heartbeat != "boolean" && ((y = i.current.heartbeat) === null || y === void 0 ? void 0 : y.returnMessage) === t.data || d(t));
|
|
27700
27700
|
};
|
|
27701
|
-
}, U = function(
|
|
27702
|
-
|
|
27703
|
-
if (i.current.onOpen && i.current.onOpen(y), l.current = 0,
|
|
27701
|
+
}, U = function(n, i, d, l, t) {
|
|
27702
|
+
n.onopen = function(y) {
|
|
27703
|
+
if (i.current.onOpen && i.current.onOpen(y), l.current = 0, d(u.ReadyState.OPEN), i.current.heartbeat && n instanceof WebSocket) {
|
|
27704
27704
|
var b = typeof i.current.heartbeat == "boolean" ? void 0 : i.current.heartbeat;
|
|
27705
|
-
t.current = Date.now(), (0,
|
|
27705
|
+
t.current = Date.now(), (0, c.heartbeat)(n, t, b);
|
|
27706
27706
|
}
|
|
27707
27707
|
};
|
|
27708
|
-
}, _ = function(
|
|
27709
|
-
if (
|
|
27708
|
+
}, _ = function(n, i, d, l, t) {
|
|
27709
|
+
if (u.isEventSourceSupported && n instanceof EventSource)
|
|
27710
27710
|
return function() {
|
|
27711
27711
|
};
|
|
27712
|
-
(0, o.assertIsWebSocket)(
|
|
27712
|
+
(0, o.assertIsWebSocket)(n, i.current.skipAssert);
|
|
27713
27713
|
var y;
|
|
27714
|
-
return
|
|
27715
|
-
var
|
|
27716
|
-
if (i.current.onClose && i.current.onClose(b),
|
|
27717
|
-
var T = (
|
|
27714
|
+
return n.onclose = function(b) {
|
|
27715
|
+
var g;
|
|
27716
|
+
if (i.current.onClose && i.current.onClose(b), d(u.ReadyState.CLOSED), i.current.shouldReconnect && i.current.shouldReconnect(b)) {
|
|
27717
|
+
var T = (g = i.current.reconnectAttempts) !== null && g !== void 0 ? g : u.DEFAULT_RECONNECT_LIMIT;
|
|
27718
27718
|
if (t.current < T) {
|
|
27719
27719
|
var N = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27720
27720
|
y = window.setTimeout(function() {
|
|
27721
27721
|
t.current++, l();
|
|
27722
|
-
}, N ??
|
|
27722
|
+
}, N ?? u.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27723
27723
|
} else
|
|
27724
27724
|
i.current.onReconnectStop && i.current.onReconnectStop(T), console.warn("Max reconnect attempts of ".concat(T, " exceeded"));
|
|
27725
27725
|
}
|
|
27726
27726
|
}, function() {
|
|
27727
27727
|
return y && window.clearTimeout(y);
|
|
27728
27728
|
};
|
|
27729
|
-
},
|
|
27729
|
+
}, r = function(n, i, d, l, t) {
|
|
27730
27730
|
var y;
|
|
27731
|
-
return
|
|
27732
|
-
var
|
|
27733
|
-
if (i.current.onError && i.current.onError(b),
|
|
27734
|
-
if (t.current < ((
|
|
27731
|
+
return n.onerror = function(b) {
|
|
27732
|
+
var g;
|
|
27733
|
+
if (i.current.onError && i.current.onError(b), u.isEventSourceSupported && n instanceof EventSource && (i.current.onClose && i.current.onClose(e(e({}, b), { code: 1006, reason: "An error occurred with the EventSource: ".concat(b), wasClean: !1 })), d(u.ReadyState.CLOSED), n.close()), i.current.retryOnError)
|
|
27734
|
+
if (t.current < ((g = i.current.reconnectAttempts) !== null && g !== void 0 ? g : u.DEFAULT_RECONNECT_LIMIT)) {
|
|
27735
27735
|
var T = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27736
27736
|
y = window.setTimeout(function() {
|
|
27737
27737
|
t.current++, l();
|
|
27738
|
-
}, T ??
|
|
27738
|
+
}, T ?? u.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27739
27739
|
} else
|
|
27740
27740
|
i.current.onReconnectStop && i.current.onReconnectStop(i.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(i.current.reconnectAttempts, " exceeded"));
|
|
27741
27741
|
}, function() {
|
|
27742
27742
|
return y && window.clearTimeout(y);
|
|
27743
27743
|
};
|
|
27744
|
-
},
|
|
27745
|
-
var
|
|
27746
|
-
return
|
|
27747
|
-
T(
|
|
27744
|
+
}, s = function(n, i, d, l, t, y, b) {
|
|
27745
|
+
var g = i.setLastMessage, T = i.setReadyState, N, D, h;
|
|
27746
|
+
return d.current.fromSocketIO && (N = (0, m.setUpSocketIOPing)(b)), p(n, d, g, y), U(n, d, T, t, y), D = _(n, d, T, l, t), h = r(n, d, T, l, t), function() {
|
|
27747
|
+
T(u.ReadyState.CLOSING), D(), h(), n.close(), N && clearInterval(N);
|
|
27748
27748
|
};
|
|
27749
27749
|
};
|
|
27750
|
-
return ne.attachListeners =
|
|
27750
|
+
return ne.attachListeners = s, ne;
|
|
27751
27751
|
}
|
|
27752
27752
|
var me = {}, Ga;
|
|
27753
27753
|
function ji() {
|
|
@@ -27755,101 +27755,101 @@ function ji() {
|
|
|
27755
27755
|
Ga = 1;
|
|
27756
27756
|
var e = me && me.__assign || function() {
|
|
27757
27757
|
return e = Object.assign || function(i) {
|
|
27758
|
-
for (var
|
|
27759
|
-
|
|
27760
|
-
for (var y in
|
|
27758
|
+
for (var d, l = 1, t = arguments.length; l < t; l++) {
|
|
27759
|
+
d = arguments[l];
|
|
27760
|
+
for (var y in d) Object.prototype.hasOwnProperty.call(d, y) && (i[y] = d[y]);
|
|
27761
27761
|
}
|
|
27762
27762
|
return i;
|
|
27763
27763
|
}, e.apply(this, arguments);
|
|
27764
27764
|
};
|
|
27765
27765
|
Object.defineProperty(me, "__esModule", { value: !0 }), me.attachSharedListeners = void 0;
|
|
27766
|
-
var
|
|
27766
|
+
var m = Xe(), c = A(), u = ea(), o = $e(), p = ja(), U = function(i, d, l) {
|
|
27767
27767
|
i.onmessage = function(t) {
|
|
27768
|
-
(0,
|
|
27768
|
+
(0, u.getSubscribers)(d).forEach(function(y) {
|
|
27769
27769
|
var b;
|
|
27770
27770
|
y.optionsRef.current.onMessage && y.optionsRef.current.onMessage(t), typeof ((b = y?.lastMessageTime) === null || b === void 0 ? void 0 : b.current) == "number" && (y.lastMessageTime.current = Date.now()), !(typeof y.optionsRef.current.filter == "function" && y.optionsRef.current.filter(t) !== !0) && (l && typeof l != "boolean" && l?.returnMessage === t.data || y.setLastMessage(t));
|
|
27771
27771
|
});
|
|
27772
27772
|
};
|
|
27773
|
-
}, _ = function(i,
|
|
27773
|
+
}, _ = function(i, d, l) {
|
|
27774
27774
|
i.onopen = function(t) {
|
|
27775
|
-
var y = (0,
|
|
27775
|
+
var y = (0, u.getSubscribers)(d);
|
|
27776
27776
|
y.forEach(function(b) {
|
|
27777
|
-
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(t), b.setReadyState(
|
|
27778
|
-
}), l && i instanceof WebSocket && (0,
|
|
27777
|
+
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(t), b.setReadyState(c.ReadyState.OPEN), l && i instanceof WebSocket && (b.lastMessageTime.current = Date.now());
|
|
27778
|
+
}), l && i instanceof WebSocket && (0, p.heartbeat)(i, y.map(function(b) {
|
|
27779
27779
|
return b.lastMessageTime;
|
|
27780
27780
|
}), typeof l == "boolean" ? void 0 : l);
|
|
27781
27781
|
};
|
|
27782
|
-
},
|
|
27782
|
+
}, r = function(i, d) {
|
|
27783
27783
|
i instanceof WebSocket && (i.onclose = function(l) {
|
|
27784
|
-
(0,
|
|
27785
|
-
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(
|
|
27786
|
-
}), delete
|
|
27784
|
+
(0, u.getSubscribers)(d).forEach(function(t) {
|
|
27785
|
+
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(c.ReadyState.CLOSED);
|
|
27786
|
+
}), delete m.sharedWebSockets[d], (0, u.getSubscribers)(d).forEach(function(t) {
|
|
27787
27787
|
var y;
|
|
27788
27788
|
if (t.optionsRef.current.shouldReconnect && t.optionsRef.current.shouldReconnect(l)) {
|
|
27789
|
-
var b = (y = t.optionsRef.current.reconnectAttempts) !== null && y !== void 0 ? y :
|
|
27789
|
+
var b = (y = t.optionsRef.current.reconnectAttempts) !== null && y !== void 0 ? y : c.DEFAULT_RECONNECT_LIMIT;
|
|
27790
27790
|
if (t.reconnectCount.current < b) {
|
|
27791
|
-
var
|
|
27791
|
+
var g = typeof t.optionsRef.current.reconnectInterval == "function" ? t.optionsRef.current.reconnectInterval(t.reconnectCount.current) : t.optionsRef.current.reconnectInterval;
|
|
27792
27792
|
setTimeout(function() {
|
|
27793
27793
|
t.reconnectCount.current++, t.reconnect.current();
|
|
27794
|
-
},
|
|
27794
|
+
}, g ?? c.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27795
27795
|
} else
|
|
27796
27796
|
t.optionsRef.current.onReconnectStop && t.optionsRef.current.onReconnectStop(t.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(b, " exceeded"));
|
|
27797
27797
|
}
|
|
27798
27798
|
});
|
|
27799
27799
|
});
|
|
27800
|
-
},
|
|
27800
|
+
}, s = function(i, d) {
|
|
27801
27801
|
i.onerror = function(l) {
|
|
27802
|
-
(0,
|
|
27803
|
-
t.optionsRef.current.onError && t.optionsRef.current.onError(l),
|
|
27804
|
-
}),
|
|
27802
|
+
(0, u.getSubscribers)(d).forEach(function(t) {
|
|
27803
|
+
t.optionsRef.current.onError && t.optionsRef.current.onError(l), c.isEventSourceSupported && i instanceof EventSource && (t.optionsRef.current.onClose && t.optionsRef.current.onClose(e(e({}, l), { code: 1006, reason: "An error occurred with the EventSource: ".concat(l), wasClean: !1 })), t.setReadyState(c.ReadyState.CLOSED));
|
|
27804
|
+
}), c.isEventSourceSupported && i instanceof EventSource && i.close();
|
|
27805
27805
|
};
|
|
27806
|
-
},
|
|
27806
|
+
}, n = function(i, d, l, t) {
|
|
27807
27807
|
var y;
|
|
27808
|
-
return l.current.fromSocketIO && (y = (0, o.setUpSocketIOPing)(t)), U(i,
|
|
27808
|
+
return l.current.fromSocketIO && (y = (0, o.setUpSocketIOPing)(t)), U(i, d, l.current.heartbeat), r(i, d), _(i, d, l.current.heartbeat), s(i, d), function() {
|
|
27809
27809
|
y && clearInterval(y);
|
|
27810
27810
|
};
|
|
27811
27811
|
};
|
|
27812
|
-
return me.attachSharedListeners =
|
|
27812
|
+
return me.attachSharedListeners = n, me;
|
|
27813
27813
|
}
|
|
27814
27814
|
var Ma;
|
|
27815
27815
|
function Qi() {
|
|
27816
27816
|
if (Ma) return Ce;
|
|
27817
27817
|
Ma = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.createOrJoinSocket = void 0;
|
|
27818
|
-
var e = Xe(),
|
|
27818
|
+
var e = Xe(), m = A(), c = Ki(), u = ji(), o = ea(), p = function(_, r, s, n, i) {
|
|
27819
27819
|
return function() {
|
|
27820
|
-
if ((0, o.removeSubscriber)(_,
|
|
27820
|
+
if ((0, o.removeSubscriber)(_, r), !(0, o.hasSubscribers)(_)) {
|
|
27821
27821
|
try {
|
|
27822
|
-
var
|
|
27823
|
-
|
|
27824
|
-
|
|
27825
|
-
}),
|
|
27822
|
+
var d = e.sharedWebSockets[_];
|
|
27823
|
+
d instanceof WebSocket && (d.onclose = function(l) {
|
|
27824
|
+
s.current.onClose && s.current.onClose(l), n(m.ReadyState.CLOSED);
|
|
27825
|
+
}), d.close();
|
|
27826
27826
|
} catch {
|
|
27827
27827
|
}
|
|
27828
27828
|
i && i(), delete e.sharedWebSockets[_];
|
|
27829
27829
|
}
|
|
27830
27830
|
};
|
|
27831
|
-
}, U = function(_,
|
|
27832
|
-
if (!
|
|
27833
|
-
throw
|
|
27834
|
-
if (
|
|
27831
|
+
}, U = function(_, r, s, n, i, d, l, t, y) {
|
|
27832
|
+
if (!m.isEventSourceSupported && n.current.eventSourceOptions)
|
|
27833
|
+
throw m.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
27834
|
+
if (n.current.share) {
|
|
27835
27835
|
var b = null;
|
|
27836
|
-
e.sharedWebSockets[
|
|
27837
|
-
var
|
|
27836
|
+
e.sharedWebSockets[r] === void 0 ? (e.sharedWebSockets[r] = n.current.eventSourceOptions ? new EventSource(r, n.current.eventSourceOptions) : new WebSocket(r, n.current.protocols), _.current = e.sharedWebSockets[r], s(m.ReadyState.CONNECTING), b = (0, u.attachSharedListeners)(e.sharedWebSockets[r], r, n, y)) : (_.current = e.sharedWebSockets[r], s(e.sharedWebSockets[r].readyState));
|
|
27837
|
+
var g = {
|
|
27838
27838
|
setLastMessage: i,
|
|
27839
|
-
setReadyState:
|
|
27840
|
-
optionsRef:
|
|
27839
|
+
setReadyState: s,
|
|
27840
|
+
optionsRef: n,
|
|
27841
27841
|
reconnectCount: l,
|
|
27842
27842
|
lastMessageTime: t,
|
|
27843
|
-
reconnect:
|
|
27843
|
+
reconnect: d
|
|
27844
27844
|
};
|
|
27845
|
-
return (0, o.addSubscriber)(
|
|
27845
|
+
return (0, o.addSubscriber)(r, g), p(r, g, n, s, b);
|
|
27846
27846
|
} else {
|
|
27847
|
-
if (_.current =
|
|
27847
|
+
if (_.current = n.current.eventSourceOptions ? new EventSource(r, n.current.eventSourceOptions) : new WebSocket(r, n.current.protocols), s(m.ReadyState.CONNECTING), !_.current)
|
|
27848
27848
|
throw new Error("WebSocket failed to be created");
|
|
27849
|
-
return (0,
|
|
27849
|
+
return (0, c.attachListeners)(_.current, {
|
|
27850
27850
|
setLastMessage: i,
|
|
27851
|
-
setReadyState:
|
|
27852
|
-
},
|
|
27851
|
+
setReadyState: s
|
|
27852
|
+
}, n, d.current, l, t, y);
|
|
27853
27853
|
}
|
|
27854
27854
|
};
|
|
27855
27855
|
return Ce.createOrJoinSocket = U, Ce;
|
|
@@ -27857,119 +27857,119 @@ function Qi() {
|
|
|
27857
27857
|
var Y = {}, Ra;
|
|
27858
27858
|
function Yi() {
|
|
27859
27859
|
return Ra || (Ra = 1, (function(e) {
|
|
27860
|
-
var
|
|
27861
|
-
function
|
|
27862
|
-
return l instanceof
|
|
27860
|
+
var m = Y && Y.__awaiter || function(r, s, n, i) {
|
|
27861
|
+
function d(l) {
|
|
27862
|
+
return l instanceof n ? l : new n(function(t) {
|
|
27863
27863
|
t(l);
|
|
27864
27864
|
});
|
|
27865
27865
|
}
|
|
27866
|
-
return new (
|
|
27866
|
+
return new (n || (n = Promise))(function(l, t) {
|
|
27867
27867
|
function y(T) {
|
|
27868
27868
|
try {
|
|
27869
|
-
|
|
27869
|
+
g(i.next(T));
|
|
27870
27870
|
} catch (N) {
|
|
27871
27871
|
t(N);
|
|
27872
27872
|
}
|
|
27873
27873
|
}
|
|
27874
27874
|
function b(T) {
|
|
27875
27875
|
try {
|
|
27876
|
-
|
|
27876
|
+
g(i.throw(T));
|
|
27877
27877
|
} catch (N) {
|
|
27878
27878
|
t(N);
|
|
27879
27879
|
}
|
|
27880
27880
|
}
|
|
27881
|
-
function
|
|
27882
|
-
T.done ? l(T.value) :
|
|
27881
|
+
function g(T) {
|
|
27882
|
+
T.done ? l(T.value) : d(T.value).then(y, b);
|
|
27883
27883
|
}
|
|
27884
|
-
|
|
27884
|
+
g((i = i.apply(r, s || [])).next());
|
|
27885
27885
|
});
|
|
27886
|
-
},
|
|
27887
|
-
var
|
|
27886
|
+
}, c = Y && Y.__generator || function(r, s) {
|
|
27887
|
+
var n = { label: 0, sent: function() {
|
|
27888
27888
|
if (l[0] & 1) throw l[1];
|
|
27889
27889
|
return l[1];
|
|
27890
|
-
}, trys: [], ops: [] }, i,
|
|
27890
|
+
}, trys: [], ops: [] }, i, d, l, t = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
27891
27891
|
return t.next = y(0), t.throw = y(1), t.return = y(2), typeof Symbol == "function" && (t[Symbol.iterator] = function() {
|
|
27892
27892
|
return this;
|
|
27893
27893
|
}), t;
|
|
27894
|
-
function y(
|
|
27894
|
+
function y(g) {
|
|
27895
27895
|
return function(T) {
|
|
27896
|
-
return b([
|
|
27896
|
+
return b([g, T]);
|
|
27897
27897
|
};
|
|
27898
27898
|
}
|
|
27899
|
-
function b(
|
|
27899
|
+
function b(g) {
|
|
27900
27900
|
if (i) throw new TypeError("Generator is already executing.");
|
|
27901
|
-
for (; t && (t = 0,
|
|
27902
|
-
if (i = 1,
|
|
27903
|
-
switch (
|
|
27901
|
+
for (; t && (t = 0, g[0] && (n = 0)), n; ) try {
|
|
27902
|
+
if (i = 1, d && (l = g[0] & 2 ? d.return : g[0] ? d.throw || ((l = d.return) && l.call(d), 0) : d.next) && !(l = l.call(d, g[1])).done) return l;
|
|
27903
|
+
switch (d = 0, l && (g = [g[0] & 2, l.value]), g[0]) {
|
|
27904
27904
|
case 0:
|
|
27905
27905
|
case 1:
|
|
27906
|
-
l =
|
|
27906
|
+
l = g;
|
|
27907
27907
|
break;
|
|
27908
27908
|
case 4:
|
|
27909
|
-
return
|
|
27909
|
+
return n.label++, { value: g[1], done: !1 };
|
|
27910
27910
|
case 5:
|
|
27911
|
-
|
|
27911
|
+
n.label++, d = g[1], g = [0];
|
|
27912
27912
|
continue;
|
|
27913
27913
|
case 7:
|
|
27914
|
-
|
|
27914
|
+
g = n.ops.pop(), n.trys.pop();
|
|
27915
27915
|
continue;
|
|
27916
27916
|
default:
|
|
27917
|
-
if (l =
|
|
27918
|
-
|
|
27917
|
+
if (l = n.trys, !(l = l.length > 0 && l[l.length - 1]) && (g[0] === 6 || g[0] === 2)) {
|
|
27918
|
+
n = 0;
|
|
27919
27919
|
continue;
|
|
27920
27920
|
}
|
|
27921
|
-
if (
|
|
27922
|
-
|
|
27921
|
+
if (g[0] === 3 && (!l || g[1] > l[0] && g[1] < l[3])) {
|
|
27922
|
+
n.label = g[1];
|
|
27923
27923
|
break;
|
|
27924
27924
|
}
|
|
27925
|
-
if (
|
|
27926
|
-
|
|
27925
|
+
if (g[0] === 6 && n.label < l[1]) {
|
|
27926
|
+
n.label = l[1], l = g;
|
|
27927
27927
|
break;
|
|
27928
27928
|
}
|
|
27929
|
-
if (l &&
|
|
27930
|
-
|
|
27929
|
+
if (l && n.label < l[2]) {
|
|
27930
|
+
n.label = l[2], n.ops.push(g);
|
|
27931
27931
|
break;
|
|
27932
27932
|
}
|
|
27933
|
-
l[2] &&
|
|
27933
|
+
l[2] && n.ops.pop(), n.trys.pop();
|
|
27934
27934
|
continue;
|
|
27935
27935
|
}
|
|
27936
|
-
|
|
27936
|
+
g = s.call(r, n);
|
|
27937
27937
|
} catch (T) {
|
|
27938
|
-
|
|
27938
|
+
g = [6, T], d = 0;
|
|
27939
27939
|
} finally {
|
|
27940
27940
|
i = l = 0;
|
|
27941
27941
|
}
|
|
27942
|
-
if (
|
|
27943
|
-
return { value:
|
|
27942
|
+
if (g[0] & 5) throw g[1];
|
|
27943
|
+
return { value: g[0] ? g[1] : void 0, done: !0 };
|
|
27944
27944
|
}
|
|
27945
|
-
},
|
|
27946
|
-
if (
|
|
27947
|
-
(l || !(i in
|
|
27948
|
-
return
|
|
27945
|
+
}, u = Y && Y.__spreadArray || function(r, s, n) {
|
|
27946
|
+
if (n || arguments.length === 2) for (var i = 0, d = s.length, l; i < d; i++)
|
|
27947
|
+
(l || !(i in s)) && (l || (l = Array.prototype.slice.call(s, 0, i)), l[i] = s[i]);
|
|
27948
|
+
return r.concat(l || Array.prototype.slice.call(s));
|
|
27949
27949
|
};
|
|
27950
27950
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getUrl = void 0;
|
|
27951
|
-
var o = $e(),
|
|
27952
|
-
return new Promise(function(
|
|
27953
|
-
return window.setTimeout(
|
|
27951
|
+
var o = $e(), p = A(), U = function(r) {
|
|
27952
|
+
return new Promise(function(s) {
|
|
27953
|
+
return window.setTimeout(s, r);
|
|
27954
27954
|
});
|
|
27955
|
-
}, _ = function(
|
|
27956
|
-
for (var
|
|
27957
|
-
|
|
27958
|
-
return
|
|
27959
|
-
var y, b,
|
|
27960
|
-
return t === void 0 && (t = 0),
|
|
27955
|
+
}, _ = function(r, s) {
|
|
27956
|
+
for (var n = [], i = 2; i < arguments.length; i++)
|
|
27957
|
+
n[i - 2] = arguments[i];
|
|
27958
|
+
return m(void 0, u([r, s], n, !0), void 0, function(d, l, t) {
|
|
27959
|
+
var y, b, g, T, N, D, h, L;
|
|
27960
|
+
return t === void 0 && (t = 0), c(this, function(M) {
|
|
27961
27961
|
switch (M.label) {
|
|
27962
27962
|
case 0:
|
|
27963
|
-
if (typeof
|
|
27963
|
+
if (typeof d != "function") return [3, 10];
|
|
27964
27964
|
M.label = 1;
|
|
27965
27965
|
case 1:
|
|
27966
|
-
return M.trys.push([1, 3, , 9]), [4,
|
|
27966
|
+
return M.trys.push([1, 3, , 9]), [4, d()];
|
|
27967
27967
|
case 2:
|
|
27968
27968
|
return y = M.sent(), [3, 9];
|
|
27969
27969
|
case 3:
|
|
27970
|
-
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D :
|
|
27970
|
+
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D : p.DEFAULT_RECONNECT_LIMIT, t < b ? (g = typeof l.current.reconnectInterval == "function" ? l.current.reconnectInterval(t) : l.current.reconnectInterval, [4, U(g ?? p.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
27971
27971
|
case 4:
|
|
27972
|
-
return M.sent(), [2, (0, e.getUrl)(
|
|
27972
|
+
return M.sent(), [2, (0, e.getUrl)(d, l, t + 1)];
|
|
27973
27973
|
case 5:
|
|
27974
27974
|
return (L = (h = l.current).onReconnectStop) === null || L === void 0 || L.call(h, t), [2, null];
|
|
27975
27975
|
case 6:
|
|
@@ -27981,7 +27981,7 @@ function Yi() {
|
|
|
27981
27981
|
case 9:
|
|
27982
27982
|
return [3, 11];
|
|
27983
27983
|
case 10:
|
|
27984
|
-
y =
|
|
27984
|
+
y = d, M.label = 11;
|
|
27985
27985
|
case 11:
|
|
27986
27986
|
return T = l.current.fromSocketIO ? (0, o.parseSocketIOUrl)(y) : y, N = l.current.queryParams ? (0, o.appendQueryParams)(T, l.current.queryParams) : T, [2, N];
|
|
27987
27987
|
}
|
|
@@ -27995,19 +27995,19 @@ var je = {}, Pa;
|
|
|
27995
27995
|
function qi() {
|
|
27996
27996
|
return Pa || (Pa = 1, (function(e) {
|
|
27997
27997
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.websocketWrapper = void 0;
|
|
27998
|
-
var
|
|
27999
|
-
return new Proxy(
|
|
28000
|
-
get: function(o,
|
|
28001
|
-
var U = o[
|
|
28002
|
-
return
|
|
27998
|
+
var m = function(c, u) {
|
|
27999
|
+
return new Proxy(c, {
|
|
28000
|
+
get: function(o, p) {
|
|
28001
|
+
var U = o[p];
|
|
28002
|
+
return p === "reconnect" ? u : typeof U == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
|
|
28003
28003
|
}) : U;
|
|
28004
28004
|
},
|
|
28005
|
-
set: function(o,
|
|
28006
|
-
return /^on/.test(
|
|
28005
|
+
set: function(o, p, U) {
|
|
28006
|
+
return /^on/.test(p) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (o[p] = U, !0);
|
|
28007
28007
|
}
|
|
28008
28008
|
});
|
|
28009
28009
|
};
|
|
28010
|
-
e.websocketWrapper =
|
|
28010
|
+
e.websocketWrapper = m, e.default = e.websocketWrapper;
|
|
28011
28011
|
})(je)), je;
|
|
28012
28012
|
}
|
|
28013
28013
|
var xa;
|
|
@@ -28015,20 +28015,20 @@ function ia() {
|
|
|
28015
28015
|
if (xa) return J;
|
|
28016
28016
|
xa = 1;
|
|
28017
28017
|
var e = J && J.__assign || function() {
|
|
28018
|
-
return e = Object.assign || function(
|
|
28018
|
+
return e = Object.assign || function(d) {
|
|
28019
28019
|
for (var l, t = 1, y = arguments.length; t < y; t++) {
|
|
28020
28020
|
l = arguments[t];
|
|
28021
|
-
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (
|
|
28021
|
+
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (d[b] = l[b]);
|
|
28022
28022
|
}
|
|
28023
|
-
return
|
|
28023
|
+
return d;
|
|
28024
28024
|
}, e.apply(this, arguments);
|
|
28025
|
-
},
|
|
28026
|
-
function b(
|
|
28027
|
-
return
|
|
28028
|
-
T(
|
|
28025
|
+
}, m = J && J.__awaiter || function(d, l, t, y) {
|
|
28026
|
+
function b(g) {
|
|
28027
|
+
return g instanceof t ? g : new t(function(T) {
|
|
28028
|
+
T(g);
|
|
28029
28029
|
});
|
|
28030
28030
|
}
|
|
28031
|
-
return new (t || (t = Promise))(function(
|
|
28031
|
+
return new (t || (t = Promise))(function(g, T) {
|
|
28032
28032
|
function N(L) {
|
|
28033
28033
|
try {
|
|
28034
28034
|
h(y.next(L));
|
|
@@ -28044,15 +28044,15 @@ function ia() {
|
|
|
28044
28044
|
}
|
|
28045
28045
|
}
|
|
28046
28046
|
function h(L) {
|
|
28047
|
-
L.done ?
|
|
28047
|
+
L.done ? g(L.value) : b(L.value).then(N, D);
|
|
28048
28048
|
}
|
|
28049
|
-
h((y = y.apply(
|
|
28049
|
+
h((y = y.apply(d, l || [])).next());
|
|
28050
28050
|
});
|
|
28051
|
-
},
|
|
28051
|
+
}, c = J && J.__generator || function(d, l) {
|
|
28052
28052
|
var t = { label: 0, sent: function() {
|
|
28053
|
-
if (
|
|
28054
|
-
return
|
|
28055
|
-
}, trys: [], ops: [] }, y, b,
|
|
28053
|
+
if (g[0] & 1) throw g[1];
|
|
28054
|
+
return g[1];
|
|
28055
|
+
}, trys: [], ops: [] }, y, b, g, T = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
28056
28056
|
return T.next = N(0), T.throw = N(1), T.return = N(2), typeof Symbol == "function" && (T[Symbol.iterator] = function() {
|
|
28057
28057
|
return this;
|
|
28058
28058
|
}), T;
|
|
@@ -28064,11 +28064,11 @@ function ia() {
|
|
|
28064
28064
|
function D(h) {
|
|
28065
28065
|
if (y) throw new TypeError("Generator is already executing.");
|
|
28066
28066
|
for (; T && (T = 0, h[0] && (t = 0)), t; ) try {
|
|
28067
|
-
if (y = 1, b && (
|
|
28068
|
-
switch (b = 0,
|
|
28067
|
+
if (y = 1, b && (g = h[0] & 2 ? b.return : h[0] ? b.throw || ((g = b.return) && g.call(b), 0) : b.next) && !(g = g.call(b, h[1])).done) return g;
|
|
28068
|
+
switch (b = 0, g && (h = [h[0] & 2, g.value]), h[0]) {
|
|
28069
28069
|
case 0:
|
|
28070
28070
|
case 1:
|
|
28071
|
-
|
|
28071
|
+
g = h;
|
|
28072
28072
|
break;
|
|
28073
28073
|
case 4:
|
|
28074
28074
|
return t.label++, { value: h[1], done: !1 };
|
|
@@ -28079,41 +28079,41 @@ function ia() {
|
|
|
28079
28079
|
h = t.ops.pop(), t.trys.pop();
|
|
28080
28080
|
continue;
|
|
28081
28081
|
default:
|
|
28082
|
-
if (
|
|
28082
|
+
if (g = t.trys, !(g = g.length > 0 && g[g.length - 1]) && (h[0] === 6 || h[0] === 2)) {
|
|
28083
28083
|
t = 0;
|
|
28084
28084
|
continue;
|
|
28085
28085
|
}
|
|
28086
|
-
if (h[0] === 3 && (!
|
|
28086
|
+
if (h[0] === 3 && (!g || h[1] > g[0] && h[1] < g[3])) {
|
|
28087
28087
|
t.label = h[1];
|
|
28088
28088
|
break;
|
|
28089
28089
|
}
|
|
28090
|
-
if (h[0] === 6 && t.label <
|
|
28091
|
-
t.label =
|
|
28090
|
+
if (h[0] === 6 && t.label < g[1]) {
|
|
28091
|
+
t.label = g[1], g = h;
|
|
28092
28092
|
break;
|
|
28093
28093
|
}
|
|
28094
|
-
if (
|
|
28095
|
-
t.label =
|
|
28094
|
+
if (g && t.label < g[2]) {
|
|
28095
|
+
t.label = g[2], t.ops.push(h);
|
|
28096
28096
|
break;
|
|
28097
28097
|
}
|
|
28098
|
-
|
|
28098
|
+
g[2] && t.ops.pop(), t.trys.pop();
|
|
28099
28099
|
continue;
|
|
28100
28100
|
}
|
|
28101
|
-
h = l.call(
|
|
28101
|
+
h = l.call(d, t);
|
|
28102
28102
|
} catch (L) {
|
|
28103
28103
|
h = [6, L], b = 0;
|
|
28104
28104
|
} finally {
|
|
28105
|
-
y =
|
|
28105
|
+
y = g = 0;
|
|
28106
28106
|
}
|
|
28107
28107
|
if (h[0] & 5) throw h[1];
|
|
28108
28108
|
return { value: h[0] ? h[1] : void 0, done: !0 };
|
|
28109
28109
|
}
|
|
28110
|
-
},
|
|
28111
|
-
return
|
|
28110
|
+
}, u = J && J.__importDefault || function(d) {
|
|
28111
|
+
return d && d.__esModule ? d : { default: d };
|
|
28112
28112
|
};
|
|
28113
28113
|
Object.defineProperty(J, "__esModule", { value: !0 }), J.useWebSocket = void 0;
|
|
28114
|
-
var o = ke,
|
|
28114
|
+
var o = ke, p = ki, U = A(), _ = Qi(), r = Yi(), s = u(qi()), n = aa(), i = function(d, l, t) {
|
|
28115
28115
|
l === void 0 && (l = U.DEFAULT_OPTIONS), t === void 0 && (t = !0);
|
|
28116
|
-
var y = (0, o.useState)(null), b = y[0],
|
|
28116
|
+
var y = (0, o.useState)(null), b = y[0], g = y[1], T = (0, o.useState)({}), N = T[0], D = T[1], h = (0, o.useMemo)(function() {
|
|
28117
28117
|
if (!l.disableJson && b)
|
|
28118
28118
|
try {
|
|
28119
28119
|
return JSON.parse(b.data);
|
|
@@ -28124,29 +28124,29 @@ function ia() {
|
|
|
28124
28124
|
}, [b, l.disableJson]), L = (0, o.useRef)(null), M = (0, o.useRef)(null), _e = (0, o.useRef)(function() {
|
|
28125
28125
|
}), fe = (0, o.useRef)(0), Fe = (0, o.useRef)(Date.now()), Se = (0, o.useRef)([]), V = (0, o.useRef)(null), H = (0, o.useRef)(l);
|
|
28126
28126
|
H.current = l;
|
|
28127
|
-
var Z = L.current && N[L.current] !== void 0 ? N[L.current] :
|
|
28127
|
+
var Z = L.current && N[L.current] !== void 0 ? N[L.current] : d !== null && t === !0 ? U.ReadyState.CONNECTING : U.ReadyState.UNINSTANTIATED, ae = l.queryParams ? JSON.stringify(l.queryParams) : null, B = (0, o.useCallback)(function(x, w) {
|
|
28128
28128
|
var K;
|
|
28129
28129
|
if (w === void 0 && (w = !0), U.isEventSourceSupported && M.current instanceof EventSource) {
|
|
28130
28130
|
console.warn("Unable to send a message from an eventSource");
|
|
28131
28131
|
return;
|
|
28132
28132
|
}
|
|
28133
|
-
((K = M.current) === null || K === void 0 ? void 0 : K.readyState) === U.ReadyState.OPEN ? ((0,
|
|
28133
|
+
((K = M.current) === null || K === void 0 ? void 0 : K.readyState) === U.ReadyState.OPEN ? ((0, n.assertIsWebSocket)(M.current, H.current.skipAssert), M.current.send(x)) : w && Se.current.push(x);
|
|
28134
28134
|
}, []), Ne = (0, o.useCallback)(function(x, w) {
|
|
28135
28135
|
w === void 0 && (w = !0), B(JSON.stringify(x), w);
|
|
28136
28136
|
}, [B]), De = (0, o.useCallback)(function() {
|
|
28137
|
-
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0,
|
|
28137
|
+
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0, n.assertIsWebSocket)(M.current, H.current.skipAssert), V.current = (0, s.default)(M.current, _e)), V.current);
|
|
28138
28138
|
}, []);
|
|
28139
28139
|
return (0, o.useEffect)(function() {
|
|
28140
|
-
if (
|
|
28140
|
+
if (d !== null && t === !0) {
|
|
28141
28141
|
var x, w = !1, K = !0, Ue = function() {
|
|
28142
|
-
return
|
|
28142
|
+
return m(void 0, void 0, void 0, function() {
|
|
28143
28143
|
var ie, $, Ee;
|
|
28144
|
-
return
|
|
28144
|
+
return c(this, function(se) {
|
|
28145
28145
|
switch (se.label) {
|
|
28146
28146
|
case 0:
|
|
28147
|
-
return ie = L, [4, (0,
|
|
28147
|
+
return ie = L, [4, (0, r.getUrl)(d, H)];
|
|
28148
28148
|
case 1:
|
|
28149
|
-
return ie.current = se.sent(), L.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), L.current = "ABORTED", (0,
|
|
28149
|
+
return ie.current = se.sent(), L.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), L.current = "ABORTED", (0, p.flushSync)(function() {
|
|
28150
28150
|
return D(function(j) {
|
|
28151
28151
|
return e(e({}, j), { ABORTED: U.ReadyState.CLOSED });
|
|
28152
28152
|
});
|
|
@@ -28154,11 +28154,11 @@ function ia() {
|
|
|
28154
28154
|
2
|
|
28155
28155
|
/*return*/
|
|
28156
28156
|
]) : ($ = function(j) {
|
|
28157
|
-
w || (0,
|
|
28158
|
-
return
|
|
28157
|
+
w || (0, p.flushSync)(function() {
|
|
28158
|
+
return g(j);
|
|
28159
28159
|
});
|
|
28160
28160
|
}, Ee = function(j) {
|
|
28161
|
-
w || (0,
|
|
28161
|
+
w || (0, p.flushSync)(function() {
|
|
28162
28162
|
return D(function(ue) {
|
|
28163
28163
|
var le;
|
|
28164
28164
|
return e(e({}, ue), L.current && (le = {}, le[L.current] = j, le));
|
|
@@ -28175,13 +28175,13 @@ function ia() {
|
|
|
28175
28175
|
return _e.current = function() {
|
|
28176
28176
|
w || (V.current && (V.current = null), x?.(), Ue());
|
|
28177
28177
|
}, Ue(), function() {
|
|
28178
|
-
w = !0, K = !1, V.current && (V.current = null), x?.(),
|
|
28178
|
+
w = !0, K = !1, V.current && (V.current = null), x?.(), g(null);
|
|
28179
28179
|
};
|
|
28180
|
-
} else (
|
|
28180
|
+
} else (d === null || t === !1) && (fe.current = 0, D(function(ie) {
|
|
28181
28181
|
var $;
|
|
28182
28182
|
return e(e({}, ie), L.current && ($ = {}, $[L.current] = U.ReadyState.CLOSED, $));
|
|
28183
28183
|
}));
|
|
28184
|
-
}, [
|
|
28184
|
+
}, [d, t, ae, B]), (0, o.useEffect)(function() {
|
|
28185
28185
|
Z === U.ReadyState.OPEN && Se.current.splice(0).forEach(function(x) {
|
|
28186
28186
|
B(x);
|
|
28187
28187
|
});
|
|
@@ -28202,40 +28202,40 @@ function Xi() {
|
|
|
28202
28202
|
Oa = 1;
|
|
28203
28203
|
var e = re && re.__assign || function() {
|
|
28204
28204
|
return e = Object.assign || function(_) {
|
|
28205
|
-
for (var
|
|
28206
|
-
|
|
28207
|
-
for (var i in
|
|
28205
|
+
for (var r, s = 1, n = arguments.length; s < n; s++) {
|
|
28206
|
+
r = arguments[s];
|
|
28207
|
+
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (_[i] = r[i]);
|
|
28208
28208
|
}
|
|
28209
28209
|
return _;
|
|
28210
28210
|
}, e.apply(this, arguments);
|
|
28211
28211
|
};
|
|
28212
28212
|
Object.defineProperty(re, "__esModule", { value: !0 }), re.useSocketIO = void 0;
|
|
28213
|
-
var
|
|
28213
|
+
var m = ke, c = ia(), u = A(), o = {
|
|
28214
28214
|
type: "empty",
|
|
28215
28215
|
payload: null
|
|
28216
|
-
},
|
|
28216
|
+
}, p = function(_) {
|
|
28217
28217
|
if (!_ || !_.data)
|
|
28218
28218
|
return o;
|
|
28219
|
-
var
|
|
28220
|
-
if (!
|
|
28219
|
+
var r = _.data.match(/\[.*]/);
|
|
28220
|
+
if (!r)
|
|
28221
28221
|
return o;
|
|
28222
|
-
var
|
|
28223
|
-
return !Array.isArray(
|
|
28224
|
-
type:
|
|
28225
|
-
payload:
|
|
28222
|
+
var s = JSON.parse(r);
|
|
28223
|
+
return !Array.isArray(s) || !s[1] ? o : {
|
|
28224
|
+
type: s[0],
|
|
28225
|
+
payload: s[1]
|
|
28226
28226
|
};
|
|
28227
|
-
}, U = function(_,
|
|
28228
|
-
|
|
28229
|
-
var
|
|
28230
|
-
return e(e({},
|
|
28231
|
-
}, []), i = (0,
|
|
28232
|
-
return
|
|
28227
|
+
}, U = function(_, r, s) {
|
|
28228
|
+
r === void 0 && (r = u.DEFAULT_OPTIONS), s === void 0 && (s = !0);
|
|
28229
|
+
var n = (0, m.useMemo)(function() {
|
|
28230
|
+
return e(e({}, r), { fromSocketIO: !0 });
|
|
28231
|
+
}, []), i = (0, c.useWebSocket)(_, n, s), d = i.sendMessage, l = i.sendJsonMessage, t = i.lastMessage, y = i.readyState, b = i.getWebSocket, g = (0, m.useMemo)(function() {
|
|
28232
|
+
return p(t);
|
|
28233
28233
|
}, [t]);
|
|
28234
28234
|
return {
|
|
28235
|
-
sendMessage:
|
|
28235
|
+
sendMessage: d,
|
|
28236
28236
|
sendJsonMessage: l,
|
|
28237
|
-
lastMessage:
|
|
28238
|
-
lastJsonMessage:
|
|
28237
|
+
lastMessage: g,
|
|
28238
|
+
lastJsonMessage: g,
|
|
28239
28239
|
readyState: y,
|
|
28240
28240
|
getWebSocket: b
|
|
28241
28241
|
};
|
|
@@ -28248,31 +28248,31 @@ function $i() {
|
|
|
28248
28248
|
Ha = 1;
|
|
28249
28249
|
var e = q && q.__assign || function() {
|
|
28250
28250
|
return e = Object.assign || function(U) {
|
|
28251
|
-
for (var _,
|
|
28252
|
-
_ = arguments[
|
|
28253
|
-
for (var
|
|
28251
|
+
for (var _, r = 1, s = arguments.length; r < s; r++) {
|
|
28252
|
+
_ = arguments[r];
|
|
28253
|
+
for (var n in _) Object.prototype.hasOwnProperty.call(_, n) && (U[n] = _[n]);
|
|
28254
28254
|
}
|
|
28255
28255
|
return U;
|
|
28256
28256
|
}, e.apply(this, arguments);
|
|
28257
|
-
},
|
|
28258
|
-
var
|
|
28259
|
-
for (var
|
|
28257
|
+
}, m = q && q.__rest || function(U, _) {
|
|
28258
|
+
var r = {};
|
|
28259
|
+
for (var s in U) Object.prototype.hasOwnProperty.call(U, s) && _.indexOf(s) < 0 && (r[s] = U[s]);
|
|
28260
28260
|
if (U != null && typeof Object.getOwnPropertySymbols == "function")
|
|
28261
|
-
for (var
|
|
28262
|
-
_.indexOf(
|
|
28263
|
-
return
|
|
28261
|
+
for (var n = 0, s = Object.getOwnPropertySymbols(U); n < s.length; n++)
|
|
28262
|
+
_.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(U, s[n]) && (r[s[n]] = U[s[n]]);
|
|
28263
|
+
return r;
|
|
28264
28264
|
};
|
|
28265
28265
|
Object.defineProperty(q, "__esModule", { value: !0 }), q.useEventSource = void 0;
|
|
28266
|
-
var
|
|
28266
|
+
var c = ke, u = ia(), o = A(), p = function(U, _, r) {
|
|
28267
28267
|
_ === void 0 && (_ = o.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
28268
|
-
var
|
|
28269
|
-
|
|
28270
|
-
var
|
|
28271
|
-
withCredentials:
|
|
28272
|
-
} }), l = (0,
|
|
28273
|
-
|
|
28274
|
-
var t = (0,
|
|
28275
|
-
return (0,
|
|
28268
|
+
var s = _.withCredentials, n = _.events, i = m(_, ["withCredentials", "events"]);
|
|
28269
|
+
r === void 0 && (r = !0);
|
|
28270
|
+
var d = e(e({}, i), { eventSourceOptions: {
|
|
28271
|
+
withCredentials: s
|
|
28272
|
+
} }), l = (0, c.useRef)(o.EMPTY_EVENT_HANDLERS);
|
|
28273
|
+
n && (l.current = n);
|
|
28274
|
+
var t = (0, u.useWebSocket)(U, d, r), y = t.lastMessage, b = t.readyState, g = t.getWebSocket;
|
|
28275
|
+
return (0, c.useEffect)(function() {
|
|
28276
28276
|
y?.type && Object.entries(l.current).forEach(function(T) {
|
|
28277
28277
|
var N = T[0], D = T[1];
|
|
28278
28278
|
N === y.type && D(y);
|
|
@@ -28280,34 +28280,34 @@ function $i() {
|
|
|
28280
28280
|
}, [y]), {
|
|
28281
28281
|
lastEvent: y,
|
|
28282
28282
|
readyState: b,
|
|
28283
|
-
getEventSource:
|
|
28283
|
+
getEventSource: g
|
|
28284
28284
|
};
|
|
28285
28285
|
};
|
|
28286
|
-
return q.useEventSource =
|
|
28286
|
+
return q.useEventSource = p, q;
|
|
28287
28287
|
}
|
|
28288
28288
|
var wa;
|
|
28289
28289
|
function el() {
|
|
28290
28290
|
return wa || (wa = 1, (function(e) {
|
|
28291
28291
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetGlobalState = e.useEventSource = e.ReadyState = e.useSocketIO = e.default = void 0;
|
|
28292
|
-
var
|
|
28292
|
+
var m = ia();
|
|
28293
28293
|
Object.defineProperty(e, "default", { enumerable: !0, get: function() {
|
|
28294
|
-
return
|
|
28294
|
+
return m.useWebSocket;
|
|
28295
28295
|
} });
|
|
28296
|
-
var
|
|
28296
|
+
var c = Xi();
|
|
28297
28297
|
Object.defineProperty(e, "useSocketIO", { enumerable: !0, get: function() {
|
|
28298
|
-
return
|
|
28298
|
+
return c.useSocketIO;
|
|
28299
28299
|
} });
|
|
28300
|
-
var
|
|
28300
|
+
var u = A();
|
|
28301
28301
|
Object.defineProperty(e, "ReadyState", { enumerable: !0, get: function() {
|
|
28302
|
-
return
|
|
28302
|
+
return u.ReadyState;
|
|
28303
28303
|
} });
|
|
28304
28304
|
var o = $i();
|
|
28305
28305
|
Object.defineProperty(e, "useEventSource", { enumerable: !0, get: function() {
|
|
28306
28306
|
return o.useEventSource;
|
|
28307
28307
|
} });
|
|
28308
|
-
var
|
|
28308
|
+
var p = aa();
|
|
28309
28309
|
Object.defineProperty(e, "resetGlobalState", { enumerable: !0, get: function() {
|
|
28310
|
-
return
|
|
28310
|
+
return p.resetGlobalState;
|
|
28311
28311
|
} });
|
|
28312
28312
|
})(Ie)), Ie;
|
|
28313
28313
|
}
|
|
@@ -28325,28 +28325,28 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28325
28325
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
28326
28326
|
}, ll = 3e4, bl = ({
|
|
28327
28327
|
socketUrl: e,
|
|
28328
|
-
socketHandlers:
|
|
28329
|
-
options:
|
|
28328
|
+
socketHandlers: m = {},
|
|
28329
|
+
options: c = {}
|
|
28330
28330
|
}) => {
|
|
28331
|
-
const
|
|
28332
|
-
sendMessage:
|
|
28331
|
+
const u = ya(!1), o = ya(m), {
|
|
28332
|
+
sendMessage: p,
|
|
28333
28333
|
// 發送普通訊息
|
|
28334
28334
|
sendJsonMessage: U,
|
|
28335
28335
|
// 發送 JSON 訊息
|
|
28336
28336
|
lastMessage: _,
|
|
28337
28337
|
// 最後接收到的訊息
|
|
28338
28338
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
28339
|
-
readyState:
|
|
28339
|
+
readyState: r
|
|
28340
28340
|
// WebSocket 連線狀態
|
|
28341
28341
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
28342
28342
|
} = il(e, {
|
|
28343
28343
|
queryParams: { key: "wsky" },
|
|
28344
28344
|
onOpen: () => console.log("連線成功"),
|
|
28345
|
-
shouldReconnect: () =>
|
|
28345
|
+
shouldReconnect: () => u.current === !1,
|
|
28346
28346
|
reconnectAttempts: 9999,
|
|
28347
28347
|
reconnectInterval: 1e3,
|
|
28348
|
-
...
|
|
28349
|
-
}),
|
|
28348
|
+
...c
|
|
28349
|
+
}), s = Qe(() => {
|
|
28350
28350
|
try {
|
|
28351
28351
|
return JSON.parse(_?.data);
|
|
28352
28352
|
} catch {
|
|
@@ -28354,39 +28354,39 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28354
28354
|
}
|
|
28355
28355
|
}, [_?.data]);
|
|
28356
28356
|
return he(() => {
|
|
28357
|
-
const
|
|
28358
|
-
() =>
|
|
28357
|
+
const n = setInterval(
|
|
28358
|
+
() => p("ping"),
|
|
28359
28359
|
ll
|
|
28360
28360
|
);
|
|
28361
|
-
return () => clearInterval(
|
|
28362
|
-
}, [
|
|
28363
|
-
o.current =
|
|
28364
|
-
}, [
|
|
28365
|
-
if (!
|
|
28361
|
+
return () => clearInterval(n);
|
|
28362
|
+
}, [p]), he(() => {
|
|
28363
|
+
o.current = m;
|
|
28364
|
+
}, [m]), he(() => {
|
|
28365
|
+
if (!s) return;
|
|
28366
28366
|
const {
|
|
28367
|
-
onDeposit:
|
|
28367
|
+
onDeposit: n,
|
|
28368
28368
|
onTransCode: i,
|
|
28369
|
-
onError:
|
|
28369
|
+
onError: d,
|
|
28370
28370
|
onUpdateMember: l,
|
|
28371
28371
|
onMaintainNotice: t,
|
|
28372
28372
|
onMaintainNoticeMember: y,
|
|
28373
28373
|
onReload: b,
|
|
28374
|
-
onTransferInGame:
|
|
28374
|
+
onTransferInGame: g,
|
|
28375
28375
|
onCashRegisterLimit: T
|
|
28376
|
-
} = o.current, N = Re(
|
|
28377
|
-
memberInfoUid: Re(
|
|
28378
|
-
data: Re(
|
|
28379
|
-
memo: Re(
|
|
28376
|
+
} = o.current, N = Re(s, "type", ""), D = {
|
|
28377
|
+
memberInfoUid: Re(s, "member_info_uid", null),
|
|
28378
|
+
data: Re(s, "data", null),
|
|
28379
|
+
memo: Re(s, "memo", null)
|
|
28380
28380
|
};
|
|
28381
28381
|
switch (N) {
|
|
28382
28382
|
case I.DEPOSIT:
|
|
28383
|
-
|
|
28383
|
+
n?.(D);
|
|
28384
28384
|
break;
|
|
28385
28385
|
case I.TRANS_CODE:
|
|
28386
28386
|
i?.(D);
|
|
28387
28387
|
break;
|
|
28388
28388
|
case I.ERROR:
|
|
28389
|
-
|
|
28389
|
+
d?.(D);
|
|
28390
28390
|
break;
|
|
28391
28391
|
case I.UPDATE_MEMBER:
|
|
28392
28392
|
l?.(D);
|
|
@@ -28402,7 +28402,7 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28402
28402
|
break;
|
|
28403
28403
|
case I.TRANSFER_IN_GAME:
|
|
28404
28404
|
case I.CHECK_REQUEST:
|
|
28405
|
-
|
|
28405
|
+
g?.(D);
|
|
28406
28406
|
break;
|
|
28407
28407
|
case I.CASH_REGISTER_LIMIT:
|
|
28408
28408
|
T?.(D);
|
|
@@ -28411,18 +28411,18 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28411
28411
|
console.warn("Unknown socket type:", N);
|
|
28412
28412
|
break;
|
|
28413
28413
|
}
|
|
28414
|
-
}, [
|
|
28415
|
-
sendMessage:
|
|
28414
|
+
}, [s]), he(() => () => u.current = !0, []), {
|
|
28415
|
+
sendMessage: p,
|
|
28416
28416
|
sendJsonMessage: U,
|
|
28417
|
-
readyState:
|
|
28417
|
+
readyState: r
|
|
28418
28418
|
// WebSocket 連線狀態
|
|
28419
28419
|
};
|
|
28420
28420
|
}, Qa = () => {
|
|
28421
|
-
const { client: e } = de(),
|
|
28422
|
-
const { data:
|
|
28423
|
-
return
|
|
28424
|
-
}, [e]),
|
|
28425
|
-
return { commonCarouselApi:
|
|
28421
|
+
const { client: e } = de(), m = X(async () => {
|
|
28422
|
+
const { data: u } = await e.get("/carousels");
|
|
28423
|
+
return u;
|
|
28424
|
+
}, [e]), c = X(async () => await e.get("/marquees"), [e]);
|
|
28425
|
+
return { commonCarouselApi: m, commonMarqueeApi: c };
|
|
28426
28426
|
}, Tl = () => {
|
|
28427
28427
|
const { commonCarouselApi: e } = Qa();
|
|
28428
28428
|
return oe({
|
|
@@ -28430,27 +28430,27 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28430
28430
|
queryFn: async () => await e()
|
|
28431
28431
|
});
|
|
28432
28432
|
}, Cl = () => {
|
|
28433
|
-
const { lng: e } = de(), { commonMarqueeApi:
|
|
28433
|
+
const { lng: e } = de(), { commonMarqueeApi: m } = Qa(), c = Zi(e);
|
|
28434
28434
|
return oe({
|
|
28435
28435
|
queryKey: ["getMarqueeList"],
|
|
28436
|
-
queryFn: async () =>
|
|
28437
|
-
select: (
|
|
28438
|
-
const o =
|
|
28439
|
-
return we(o, (U) => U[
|
|
28436
|
+
queryFn: async () => m(),
|
|
28437
|
+
select: (u) => {
|
|
28438
|
+
const o = u.Marquees;
|
|
28439
|
+
return we(o, (U) => U[c] || U["en-US"]);
|
|
28440
28440
|
}
|
|
28441
28441
|
});
|
|
28442
28442
|
}, tl = ({ options: e } = {}) => {
|
|
28443
|
-
const { userLoginApi:
|
|
28443
|
+
const { userLoginApi: m } = ce();
|
|
28444
28444
|
return za({
|
|
28445
28445
|
mutationKey: ["userLogin"],
|
|
28446
|
-
mutationFn: async (
|
|
28446
|
+
mutationFn: async (c) => m(c),
|
|
28447
28447
|
...e
|
|
28448
28448
|
});
|
|
28449
28449
|
}, nl = ({ options: e } = {}) => {
|
|
28450
|
-
const { userLogoutApi:
|
|
28450
|
+
const { userLogoutApi: m } = ce();
|
|
28451
28451
|
return za({
|
|
28452
28452
|
mutationKey: ["userLogout"],
|
|
28453
|
-
mutationFn: async () =>
|
|
28453
|
+
mutationFn: async () => m(),
|
|
28454
28454
|
...e
|
|
28455
28455
|
});
|
|
28456
28456
|
}, vl = ({
|
|
@@ -28459,8 +28459,8 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28459
28459
|
logout: {}
|
|
28460
28460
|
}
|
|
28461
28461
|
} = {}) => {
|
|
28462
|
-
const
|
|
28463
|
-
return { login:
|
|
28462
|
+
const m = tl({ options: e.login }), c = nl({ options: e.logout });
|
|
28463
|
+
return { login: m, logout: c };
|
|
28464
28464
|
};
|
|
28465
28465
|
export {
|
|
28466
28466
|
Za as ApiCtx,
|