@obb871001/api-integration-sdk 1.0.78 → 1.0.80
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 +3 -3
- package/dist/index.js +308 -302
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import he, { createContext as Fa, useContext as Wa, useCallback as X, useMemo as
|
|
1
|
+
import he, { createContext as Fa, useContext as Wa, useCallback as X, useMemo as je, useEffect as ve, useRef as ya } from "react";
|
|
2
2
|
import { useQuery as oe, QueryClient as Ci, QueryClientProvider as vi, useQueries as Ja, useMutation as za } from "@tanstack/react-query";
|
|
3
3
|
import hi from "axios";
|
|
4
|
-
import { find as
|
|
4
|
+
import { find as Qe, isEmpty as O, isObject as Oe, flatMap as Ye, isArray as ee, map as qe, get as Me } from "lodash";
|
|
5
5
|
import ki from "react-dom";
|
|
6
6
|
function Si(e) {
|
|
7
7
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -11,13 +11,13 @@ var ba;
|
|
|
11
11
|
function Ni() {
|
|
12
12
|
if (ba) return ye;
|
|
13
13
|
ba = 1;
|
|
14
|
-
var e = he, n = Symbol.for("react.element"), d = Symbol.for("react.fragment"),
|
|
14
|
+
var e = he, n = Symbol.for("react.element"), d = Symbol.for("react.fragment"), s = 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
15
|
function U(_, r, c) {
|
|
16
|
-
var m, i = {},
|
|
17
|
-
c !== void 0 && (
|
|
18
|
-
for (m in r)
|
|
16
|
+
var m, i = {}, g = null, l = null;
|
|
17
|
+
c !== void 0 && (g = "" + c), r.key !== void 0 && (g = "" + r.key), r.ref !== void 0 && (l = r.ref);
|
|
18
|
+
for (m in r) s.call(r, m) && !p.hasOwnProperty(m) && (i[m] = r[m]);
|
|
19
19
|
if (_ && _.defaultProps) for (m in r = _.defaultProps, r) i[m] === void 0 && (i[m] = r[m]);
|
|
20
|
-
return { $$typeof: n, type: _, key:
|
|
20
|
+
return { $$typeof: n, type: _, key: g, ref: l, props: i, _owner: o.current };
|
|
21
21
|
}
|
|
22
22
|
return ye.Fragment = d, ye.jsx = U, ye.jsxs = U, ye;
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@ var be = {};
|
|
|
25
25
|
var Ta;
|
|
26
26
|
function Di() {
|
|
27
27
|
return Ta || (Ta = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var e = he, n = Symbol.for("react.element"), d = Symbol.for("react.portal"),
|
|
28
|
+
var e = he, n = Symbol.for("react.element"), d = Symbol.for("react.portal"), s = 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"), c = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), g = 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;
|
|
@@ -53,7 +53,7 @@ function Di() {
|
|
|
53
53
|
var D = !1, h = !1, L = !1, M = !1, ce = !1, _e;
|
|
54
54
|
_e = Symbol.for("react.module.reference");
|
|
55
55
|
function we(a) {
|
|
56
|
-
return !!(typeof a == "string" || typeof a == "function" || a ===
|
|
56
|
+
return !!(typeof a == "string" || typeof a == "function" || a === s || a === p || ce || a === o || a === c || a === m || M || a === l || D || h || L || typeof a == "object" && a !== null && (a.$$typeof === g || 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,13 +77,13 @@ function Di() {
|
|
|
77
77
|
if (typeof a == "string")
|
|
78
78
|
return a;
|
|
79
79
|
switch (a) {
|
|
80
|
-
case
|
|
80
|
+
case s:
|
|
81
81
|
return "Fragment";
|
|
82
82
|
case d:
|
|
83
83
|
return "Portal";
|
|
84
|
-
case
|
|
84
|
+
case p:
|
|
85
85
|
return "Profiler";
|
|
86
|
-
case
|
|
86
|
+
case o:
|
|
87
87
|
return "StrictMode";
|
|
88
88
|
case c:
|
|
89
89
|
return "Suspense";
|
|
@@ -103,7 +103,7 @@ function Di() {
|
|
|
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 g: {
|
|
107
107
|
var E = a, G = E._payload, S = E._init;
|
|
108
108
|
try {
|
|
109
109
|
return H(S(G));
|
|
@@ -176,18 +176,18 @@ 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 = u.ReactCurrentDispatcher,
|
|
179
|
+
var se = u.ReactCurrentDispatcher, j;
|
|
180
180
|
function ue(a, f, C) {
|
|
181
181
|
{
|
|
182
|
-
if (
|
|
182
|
+
if (j === void 0)
|
|
183
183
|
try {
|
|
184
184
|
throw Error();
|
|
185
185
|
} catch (E) {
|
|
186
186
|
var v = E.stack.trim().match(/\n( *(at )?)/);
|
|
187
|
-
|
|
187
|
+
j = v && v[1] || "";
|
|
188
188
|
}
|
|
189
189
|
return `
|
|
190
|
-
` +
|
|
190
|
+
` + j + a;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
var le = !1, Ee;
|
|
@@ -292,7 +292,7 @@ function Di() {
|
|
|
292
292
|
return qa(a.render);
|
|
293
293
|
case i:
|
|
294
294
|
return Le(a.type, f, C);
|
|
295
|
-
case
|
|
295
|
+
case g: {
|
|
296
296
|
var v = a, E = v._payload, G = v._init;
|
|
297
297
|
try {
|
|
298
298
|
return Le(G(E), f, C);
|
|
@@ -599,7 +599,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
599
599
|
<%s key={someKey} {...props} />`, Ze, te, bi, te), fa[te + Ze] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return a ===
|
|
602
|
+
return a === s ? 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
|
-
be.Fragment =
|
|
612
|
+
be.Fragment = s, be.jsx = Ui, be.jsxs = yi;
|
|
613
613
|
})()), be;
|
|
614
614
|
}
|
|
615
615
|
var Ca;
|
|
@@ -627,9 +627,9 @@ function Li({
|
|
|
627
627
|
baseURL: e,
|
|
628
628
|
getToken: n,
|
|
629
629
|
timeoutMs: d = 15e3,
|
|
630
|
-
lng:
|
|
631
|
-
store:
|
|
632
|
-
onError:
|
|
630
|
+
lng: s = "tw",
|
|
631
|
+
store: o,
|
|
632
|
+
onError: p
|
|
633
633
|
} = {}) {
|
|
634
634
|
const U = hi.create({
|
|
635
635
|
baseURL: e,
|
|
@@ -641,11 +641,11 @@ function Li({
|
|
|
641
641
|
const c = await n();
|
|
642
642
|
c && (_.headers.Authorization = `Bearer ${c}`);
|
|
643
643
|
}
|
|
644
|
-
const r =
|
|
645
|
-
return _.headers.Currency = r, _.headers["currency-code"] = r, _.headers.lang =
|
|
644
|
+
const r = o?.getState()?.isWalletCurrency;
|
|
645
|
+
return _.headers.Currency = r, _.headers["currency-code"] = r, _.headers.lang = s, _;
|
|
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), ul = () => {
|
|
@@ -656,37 +656,37 @@ const Va = Fa(null), ul = () => {
|
|
|
656
656
|
);
|
|
657
657
|
return e;
|
|
658
658
|
}, pl = () => {
|
|
659
|
-
const e = (
|
|
659
|
+
const e = (s, o) => !s && !o, n = (s) => s.startsWith("pc.");
|
|
660
660
|
return {
|
|
661
661
|
executeLogout: ({
|
|
662
|
-
isCallBackInvalid:
|
|
663
|
-
hostname:
|
|
664
|
-
shouldRedirect:
|
|
662
|
+
isCallBackInvalid: s = !1,
|
|
663
|
+
hostname: o = "",
|
|
664
|
+
shouldRedirect: p,
|
|
665
665
|
onShowError: U,
|
|
666
666
|
onCleanup: _,
|
|
667
667
|
onRemoveToken: r,
|
|
668
668
|
onRedirect: c,
|
|
669
669
|
onGoogleLogout: m
|
|
670
670
|
}) => {
|
|
671
|
-
const i = n(
|
|
672
|
-
e(
|
|
671
|
+
const i = n(o);
|
|
672
|
+
e(s, i) && U?.(), _?.(), r?.(), p && c?.("/"), m?.();
|
|
673
673
|
},
|
|
674
674
|
shouldShowErrorNotice: e,
|
|
675
675
|
isMachineDomain: n
|
|
676
676
|
};
|
|
677
|
-
}, Ia = (e = [], n) =>
|
|
678
|
-
const
|
|
679
|
-
return n[
|
|
677
|
+
}, Ia = (e = [], n) => Qe(e, { gameTypeName: n })?.gameTypeUid, Aa = (e = [], n) => Qe(e, { platform: n })?.platformUid, Ba = (e = [], n) => Qe(e, { SubPlatformEnum: n }), Ka = (e = [], n, d) => O(e) ? [] : e.filter((s) => d ? String(s?.SubPlatformEnumUid) === String(d?.SubPlatformEnumUid) : String(s.platformUid) === String(n)), Gi = (e = []) => O(e) ? {} : e.reduce((n, d) => {
|
|
678
|
+
const s = d?.game_subtype || "UNKNOWN";
|
|
679
|
+
return n[s] || (n[s] = []), n[s].push(d), n;
|
|
680
680
|
}, {}), Mi = ({
|
|
681
681
|
gameTypeName: e,
|
|
682
682
|
platforms: n,
|
|
683
683
|
gameList: d,
|
|
684
|
-
allGameTypes:
|
|
685
|
-
allPlatforms:
|
|
684
|
+
allGameTypes: s,
|
|
685
|
+
allPlatforms: o
|
|
686
686
|
}) => {
|
|
687
|
-
const
|
|
688
|
-
return
|
|
689
|
-
const r = Aa(
|
|
687
|
+
const p = Ia(s, e);
|
|
688
|
+
return p ? n.reduce((U, _) => {
|
|
689
|
+
const r = Aa(o, _), c = Ba(o, _), m = d[p] || [], i = Ka(
|
|
690
690
|
m,
|
|
691
691
|
r,
|
|
692
692
|
c
|
|
@@ -698,60 +698,60 @@ const Va = Fa(null), ul = () => {
|
|
|
698
698
|
gamesOfType: n = [],
|
|
699
699
|
allPlatforms: d = []
|
|
700
700
|
}) => {
|
|
701
|
-
const
|
|
701
|
+
const s = Aa(d, e), o = Ba(d, e), p = Ka(
|
|
702
702
|
n,
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
s,
|
|
704
|
+
o
|
|
705
705
|
);
|
|
706
|
-
return Gi(
|
|
707
|
-
}, Pi = (e = {}) => !Oe(e) || O(e) ? [] : Ye(e), va = (e = []) => !ee(e) || O(e) ? [] : qe(e, "platform"), xi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "gameTypeName"), Oi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "game_subtype"), Hi = (e = {}) => !Oe(e) || O(e) ? [] : Ye(e), wi = (e = [], n = []) => !ee(e) || O(e) ? {} : !ee(n) || O(n) ? {} : e.reduce((d,
|
|
708
|
-
const
|
|
709
|
-
return
|
|
710
|
-
d[
|
|
711
|
-
}),
|
|
706
|
+
return Gi(p);
|
|
707
|
+
}, Pi = (e = {}) => !Oe(e) || O(e) ? [] : Ye(e), va = (e = []) => !ee(e) || O(e) ? [] : qe(e, "platform"), xi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "gameTypeName"), Oi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "game_subtype"), Hi = (e = {}) => !Oe(e) || O(e) ? [] : Ye(e), wi = (e = [], n = []) => !ee(e) || O(e) ? {} : !ee(n) || O(n) ? {} : e.reduce((d, s) => {
|
|
708
|
+
const o = n.map((p) => p.game_subtype);
|
|
709
|
+
return o.forEach((p) => {
|
|
710
|
+
d[p] = d[p] || [];
|
|
711
|
+
}), o.includes(s.game_subtype) && d[s.game_subtype].push(s), d;
|
|
712
712
|
}, {}), Fi = ({
|
|
713
713
|
gameTypes: e = [],
|
|
714
714
|
platforms: n = [],
|
|
715
715
|
gameList: d = {},
|
|
716
|
-
allGameTypes:
|
|
717
|
-
allPlatforms:
|
|
718
|
-
}) => !ee(e) || !ee(n) ? {} : O(d) ? {} : e.reduce((
|
|
716
|
+
allGameTypes: s = [],
|
|
717
|
+
allPlatforms: o = []
|
|
718
|
+
}) => !ee(e) || !ee(n) ? {} : O(d) ? {} : e.reduce((p, U) => {
|
|
719
719
|
const _ = Mi({
|
|
720
720
|
gameTypeName: U,
|
|
721
721
|
platforms: n,
|
|
722
722
|
gameList: d,
|
|
723
|
-
allGameTypes:
|
|
724
|
-
allPlatforms:
|
|
723
|
+
allGameTypes: s,
|
|
724
|
+
allPlatforms: o
|
|
725
725
|
});
|
|
726
|
-
return O(_) || (
|
|
726
|
+
return O(_) || (p[U] = _), p;
|
|
727
727
|
}, {}), gl = ({
|
|
728
728
|
types: e = [],
|
|
729
729
|
platforms: n = [],
|
|
730
730
|
allGameType: d = [],
|
|
731
|
-
allGamePlatform:
|
|
732
|
-
allGameList:
|
|
733
|
-
} = {}) => !Array.isArray(e) || !Array.isArray(n) ? {} : e.reduce((
|
|
731
|
+
allGamePlatform: s = [],
|
|
732
|
+
allGameList: o = {}
|
|
733
|
+
} = {}) => !Array.isArray(e) || !Array.isArray(n) ? {} : e.reduce((p, U) => {
|
|
734
734
|
const _ = Ia(d, U);
|
|
735
|
-
if (!_) return
|
|
736
|
-
const r =
|
|
737
|
-
const
|
|
735
|
+
if (!_) return p;
|
|
736
|
+
const r = o[_] || [], c = n.reduce((m, i) => {
|
|
737
|
+
const g = Ri({
|
|
738
738
|
platformName: i,
|
|
739
739
|
gamesOfType: r,
|
|
740
|
-
allPlatforms:
|
|
740
|
+
allPlatforms: s
|
|
741
741
|
});
|
|
742
|
-
return O(
|
|
742
|
+
return O(g) ? m : { ...m, [i]: g };
|
|
743
743
|
}, {});
|
|
744
|
-
return O(c) || (
|
|
745
|
-
}, {}), Wi = (e = {}) => !Oe(e) || O(e) ? {} : Object.values(e).reduce((d,
|
|
746
|
-
d[
|
|
744
|
+
return O(c) || (p[U] = c), p;
|
|
745
|
+
}, {}), Wi = (e = {}) => !Oe(e) || O(e) ? {} : Object.values(e).reduce((d, s) => (Object.entries(s).forEach(([o, p]) => {
|
|
746
|
+
d[o] ? d[o] = [...d[o], ...p] : d[o] = p;
|
|
747
747
|
}), d), {}), Ji = (e = {}) => {
|
|
748
748
|
if (!Oe(e) || O(e)) return {};
|
|
749
749
|
const n = {};
|
|
750
|
-
for (const [d,
|
|
750
|
+
for (const [d, s] of Object.entries(e)) {
|
|
751
751
|
n[d] = {};
|
|
752
|
-
for (const
|
|
753
|
-
const
|
|
754
|
-
n[d][
|
|
752
|
+
for (const o of s) {
|
|
753
|
+
const p = o.game_subtype;
|
|
754
|
+
n[d][p] || (n[d][p] = []), n[d][p].push(o);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
return n;
|
|
@@ -759,25 +759,25 @@ const Va = Fa(null), ul = () => {
|
|
|
759
759
|
allGameList: e = {},
|
|
760
760
|
allGamePlatform: n = [],
|
|
761
761
|
allGameType: d = [],
|
|
762
|
-
allGame_subtype:
|
|
763
|
-
allNewGameList:
|
|
764
|
-
allTopGameList:
|
|
762
|
+
allGame_subtype: s = [],
|
|
763
|
+
allNewGameList: o = [],
|
|
764
|
+
allTopGameList: p = [],
|
|
765
765
|
randomlySelectedGames: U = [],
|
|
766
766
|
userFavoriteGame: _ = {},
|
|
767
767
|
exclusiveBrandGames: r = [],
|
|
768
768
|
highlightGames: c = [],
|
|
769
769
|
originPlatform: m = []
|
|
770
770
|
}) => {
|
|
771
|
-
const i = Pi(e),
|
|
771
|
+
const i = Pi(e), g = va(n), l = xi(d), t = Oi(s), y = va(m), b = Hi(_), u = Fi({
|
|
772
772
|
gameTypes: l,
|
|
773
|
-
platforms:
|
|
773
|
+
platforms: g,
|
|
774
774
|
gameList: e,
|
|
775
775
|
allGameTypes: d,
|
|
776
776
|
allPlatforms: n
|
|
777
|
-
}), T = wi(i,
|
|
777
|
+
}), T = wi(i, s), N = Wi(u), D = Ji(N);
|
|
778
778
|
return {
|
|
779
779
|
platform: {
|
|
780
|
-
all:
|
|
780
|
+
all: g,
|
|
781
781
|
origin: y
|
|
782
782
|
},
|
|
783
783
|
type: {
|
|
@@ -786,8 +786,8 @@ const Va = Fa(null), ul = () => {
|
|
|
786
786
|
},
|
|
787
787
|
gameList: {
|
|
788
788
|
all: i,
|
|
789
|
-
new:
|
|
790
|
-
top:
|
|
789
|
+
new: o,
|
|
790
|
+
top: p,
|
|
791
791
|
favorite: b,
|
|
792
792
|
highlight: c,
|
|
793
793
|
exclusiveBrand: r,
|
|
@@ -810,15 +810,15 @@ const Va = Fa(null), ul = () => {
|
|
|
810
810
|
}))), de = () => {
|
|
811
811
|
const { client: e } = He(), n = X(
|
|
812
812
|
async (r) => {
|
|
813
|
-
const { mac_address: c = "", app_version: m = "", anydesk_id: i = "" } = r, { data:
|
|
813
|
+
const { mac_address: c = "", app_version: m = "", anydesk_id: i = "" } = r, { data: g } = await e.post("/cash-register/login", {
|
|
814
814
|
mac_address: c,
|
|
815
815
|
app_version: m,
|
|
816
816
|
anydesk_id: i
|
|
817
817
|
});
|
|
818
|
-
return
|
|
818
|
+
return g;
|
|
819
819
|
},
|
|
820
820
|
[e]
|
|
821
|
-
), d = X(async () => e.get("/member/getMemberInfo"), [e]),
|
|
821
|
+
), d = X(async () => e.get("/member/getMemberInfo"), [e]), s = 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(
|
|
822
822
|
async (r) => {
|
|
823
823
|
const { account: c, password: m, trans_code: i } = r;
|
|
824
824
|
return await e.post("/login", {
|
|
@@ -832,9 +832,9 @@ const Va = Fa(null), ul = () => {
|
|
|
832
832
|
return {
|
|
833
833
|
machineLoginApi: n,
|
|
834
834
|
userInfoApi: d,
|
|
835
|
-
userGameListApi:
|
|
836
|
-
userFavoriteGameApi:
|
|
837
|
-
userCurrencyExchangeApi:
|
|
835
|
+
userGameListApi: s,
|
|
836
|
+
userFavoriteGameApi: p,
|
|
837
|
+
userCurrencyExchangeApi: o,
|
|
838
838
|
userLoginApi: U,
|
|
839
839
|
userLogoutApi: _
|
|
840
840
|
};
|
|
@@ -857,7 +857,7 @@ const Va = Fa(null), ul = () => {
|
|
|
857
857
|
},
|
|
858
858
|
user: { favorite: [] }
|
|
859
859
|
}, Vi = ({ enabled: e = !0 } = {}) => {
|
|
860
|
-
const { userFavoriteGameApi: n } = de(), { data: d, isLoading:
|
|
860
|
+
const { userFavoriteGameApi: n } = de(), { data: d, isLoading: s, error: o, refetch: p } = oe({
|
|
861
861
|
queryKey: ["gamesInfo"],
|
|
862
862
|
queryFn: async () => {
|
|
863
863
|
const U = await n();
|
|
@@ -885,9 +885,9 @@ const Va = Fa(null), ul = () => {
|
|
|
885
885
|
});
|
|
886
886
|
return {
|
|
887
887
|
gamesInfo: d || Zi,
|
|
888
|
-
isLoading:
|
|
889
|
-
error:
|
|
890
|
-
refetch:
|
|
888
|
+
isLoading: s,
|
|
889
|
+
error: o,
|
|
890
|
+
refetch: p
|
|
891
891
|
};
|
|
892
892
|
}, Ii = (e = !1) => {
|
|
893
893
|
!e && window.gameTypeGroup || (e || !window.gameTypeGroup) && (window.gameTypeGroup = window.gameTypeGroup || {
|
|
@@ -27420,16 +27420,17 @@ const Va = Fa(null), ul = () => {
|
|
|
27420
27420
|
ve(() => {
|
|
27421
27421
|
d && Ii(!0);
|
|
27422
27422
|
}, [d]);
|
|
27423
|
-
const
|
|
27424
|
-
return /* @__PURE__ */ xe.jsx(Va.Provider, { value:
|
|
27423
|
+
const s = Vi({ enabled: n });
|
|
27424
|
+
return /* @__PURE__ */ xe.jsx(Va.Provider, { value: s, children: e });
|
|
27425
27425
|
};
|
|
27426
27426
|
function cl({
|
|
27427
27427
|
children: e,
|
|
27428
27428
|
autoFetchGamesInfo: n = !1,
|
|
27429
27429
|
useMockData: d = !1,
|
|
27430
|
+
queryClient: s,
|
|
27430
27431
|
...o
|
|
27431
27432
|
}) {
|
|
27432
|
-
const
|
|
27433
|
+
const p = je(() => Li(o), [o]), U = je(
|
|
27433
27434
|
() => new Ci({
|
|
27434
27435
|
defaultOptions: {
|
|
27435
27436
|
queries: {
|
|
@@ -27439,11 +27440,11 @@ function cl({
|
|
|
27439
27440
|
}
|
|
27440
27441
|
}),
|
|
27441
27442
|
[]
|
|
27442
|
-
);
|
|
27443
|
-
return /* @__PURE__ */ xe.jsx(vi, { client:
|
|
27443
|
+
), _ = s || U;
|
|
27444
|
+
return /* @__PURE__ */ xe.jsx(vi, { client: _, children: /* @__PURE__ */ xe.jsx(Za.Provider, { value: { client: p, ...o }, children: /* @__PURE__ */ xe.jsx(Ai, { autoFetch: n, mockData: d, children: e }) }) });
|
|
27444
27445
|
}
|
|
27445
27446
|
const _l = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
27446
|
-
const { userCurrencyExchangeApi: d } = de(), { getToken:
|
|
27447
|
+
const { userCurrencyExchangeApi: d } = de(), { getToken: s } = He(), { enabled: o, ...p } = n, U = !!s && (o ? o.every((_) => _) : !0);
|
|
27447
27448
|
return Ja({
|
|
27448
27449
|
queries: [
|
|
27449
27450
|
{
|
|
@@ -27451,7 +27452,7 @@ const _l = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27451
27452
|
queryFn: () => d(),
|
|
27452
27453
|
enabled: U,
|
|
27453
27454
|
// ← 使用合併後的條件
|
|
27454
|
-
...
|
|
27455
|
+
...p
|
|
27455
27456
|
// ← 不包含 enabled
|
|
27456
27457
|
}
|
|
27457
27458
|
]
|
|
@@ -27461,42 +27462,42 @@ const _l = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27461
27462
|
trigger: n = [],
|
|
27462
27463
|
enabled: d = !0
|
|
27463
27464
|
} = {}) => {
|
|
27464
|
-
const { getToken:
|
|
27465
|
+
const { getToken: s } = He(), { userInfoApi: o } = de(), p = Ja({
|
|
27465
27466
|
queries: [
|
|
27466
27467
|
{
|
|
27467
27468
|
queryKey: ["getMemberInfo", ...n],
|
|
27468
|
-
queryFn: async () => await
|
|
27469
|
+
queryFn: async () => await o(),
|
|
27469
27470
|
refetchInterval: e,
|
|
27470
|
-
enabled: !!
|
|
27471
|
+
enabled: !!s && d
|
|
27471
27472
|
}
|
|
27472
27473
|
]
|
|
27473
|
-
}), { data: U, isFetching: _, error: r } =
|
|
27474
|
+
}), { data: U, isFetching: _, error: r } = p[0] || {};
|
|
27474
27475
|
return { data: U, isFetching: _, error: r };
|
|
27475
27476
|
}, Ul = ({ enabled: e = !0 } = {}) => {
|
|
27476
27477
|
const {
|
|
27477
27478
|
userInfoApi: n,
|
|
27478
27479
|
userFavoriteGameApi: d,
|
|
27479
|
-
userGameListApi:
|
|
27480
|
-
userCurrencyExchangeApi:
|
|
27481
|
-
} = de(),
|
|
27480
|
+
userGameListApi: s,
|
|
27481
|
+
userCurrencyExchangeApi: o
|
|
27482
|
+
} = de(), p = oe({
|
|
27482
27483
|
queryKey: ["getMemInfo"],
|
|
27483
27484
|
queryFn: async () => n(),
|
|
27484
27485
|
enabled: e
|
|
27485
27486
|
}), U = oe({
|
|
27486
27487
|
queryKey: ["getFavoriteGame"],
|
|
27487
27488
|
queryFn: async () => d(),
|
|
27488
|
-
enabled: e &&
|
|
27489
|
+
enabled: e && p.isSuccess
|
|
27489
27490
|
}), _ = oe({
|
|
27490
27491
|
queryKey: ["getUserGameList"],
|
|
27491
|
-
queryFn: async () =>
|
|
27492
|
-
enabled: e &&
|
|
27492
|
+
queryFn: async () => s(),
|
|
27493
|
+
enabled: e && p.isSuccess && U.isSuccess
|
|
27493
27494
|
}), r = oe({
|
|
27494
27495
|
queryKey: ["getUserCurrencyExchange"],
|
|
27495
|
-
queryFn: async () =>
|
|
27496
|
-
enabled: e &&
|
|
27496
|
+
queryFn: async () => o(),
|
|
27497
|
+
enabled: e && p.isSuccess && U.isSuccess && _.isSuccess
|
|
27497
27498
|
});
|
|
27498
27499
|
return [
|
|
27499
|
-
|
|
27500
|
+
p,
|
|
27500
27501
|
U,
|
|
27501
27502
|
_,
|
|
27502
27503
|
r
|
|
@@ -27515,18 +27516,18 @@ function A() {
|
|
|
27515
27516
|
timeout: 6e4,
|
|
27516
27517
|
interval: 25e3
|
|
27517
27518
|
};
|
|
27518
|
-
var
|
|
27519
|
-
(function(
|
|
27520
|
-
|
|
27521
|
-
})(
|
|
27522
|
-
var
|
|
27519
|
+
var s;
|
|
27520
|
+
(function(p) {
|
|
27521
|
+
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";
|
|
27522
|
+
})(s || (e.ReadyState = s = {}));
|
|
27523
|
+
var o = function() {
|
|
27523
27524
|
try {
|
|
27524
27525
|
return "EventSource" in globalThis;
|
|
27525
27526
|
} catch {
|
|
27526
27527
|
return !1;
|
|
27527
27528
|
}
|
|
27528
27529
|
};
|
|
27529
|
-
e.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", e.isEventSourceSupported = !e.isReactNative &&
|
|
27530
|
+
e.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", e.isEventSourceSupported = !e.isReactNative && o();
|
|
27530
27531
|
})(Ie)), Ie;
|
|
27531
27532
|
}
|
|
27532
27533
|
var Te = {}, Ae = {}, ka;
|
|
@@ -27537,68 +27538,68 @@ function Xe() {
|
|
|
27537
27538
|
if (d && e.sharedWebSockets.hasOwnProperty(d))
|
|
27538
27539
|
delete e.sharedWebSockets[d];
|
|
27539
27540
|
else
|
|
27540
|
-
for (var
|
|
27541
|
-
e.sharedWebSockets.hasOwnProperty(
|
|
27541
|
+
for (var s in e.sharedWebSockets)
|
|
27542
|
+
e.sharedWebSockets.hasOwnProperty(s) && delete e.sharedWebSockets[s];
|
|
27542
27543
|
};
|
|
27543
27544
|
e.resetWebSockets = n;
|
|
27544
27545
|
})(Ae)), Ae;
|
|
27545
27546
|
}
|
|
27546
|
-
var ne = {},
|
|
27547
|
+
var ne = {}, Q = {}, Sa;
|
|
27547
27548
|
function $e() {
|
|
27548
|
-
if (Sa) return
|
|
27549
|
-
Sa = 1, Object.defineProperty(
|
|
27550
|
-
var e = A(), n = function(
|
|
27551
|
-
if (
|
|
27552
|
-
var
|
|
27549
|
+
if (Sa) return Q;
|
|
27550
|
+
Sa = 1, Object.defineProperty(Q, "__esModule", { value: !0 }), Q.setUpSocketIOPing = Q.appendQueryParams = Q.parseSocketIOUrl = void 0;
|
|
27551
|
+
var e = A(), n = function(o) {
|
|
27552
|
+
if (o) {
|
|
27553
|
+
var p = /^https|wss/.test(o), U = o.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = U.replace(/\/$/, ""), r = p ? "wss" : "ws";
|
|
27553
27554
|
return "".concat(r, "://").concat(_).concat(e.SOCKET_IO_PATH);
|
|
27554
|
-
} else if (
|
|
27555
|
-
var
|
|
27555
|
+
} else if (o === "") {
|
|
27556
|
+
var p = /^https/.test(window.location.protocol), r = p ? "wss" : "ws", c = window.location.port ? ":".concat(window.location.port) : "";
|
|
27556
27557
|
return "".concat(r, "://").concat(window.location.hostname).concat(c).concat(e.SOCKET_IO_PATH);
|
|
27557
27558
|
}
|
|
27558
|
-
return
|
|
27559
|
+
return o;
|
|
27559
27560
|
};
|
|
27560
|
-
|
|
27561
|
-
var d = function(
|
|
27562
|
-
|
|
27563
|
-
var U = /\?([\w]+=[\w]+)/, _ = U.test(
|
|
27564
|
-
var i = m[0],
|
|
27565
|
-
return c + "".concat(i, "=").concat(
|
|
27561
|
+
Q.parseSocketIOUrl = n;
|
|
27562
|
+
var d = function(o, p) {
|
|
27563
|
+
p === void 0 && (p = {});
|
|
27564
|
+
var U = /\?([\w]+=[\w]+)/, _ = U.test(o), r = "".concat(Object.entries(p).reduce(function(c, m) {
|
|
27565
|
+
var i = m[0], g = m[1];
|
|
27566
|
+
return c + "".concat(i, "=").concat(g, "&");
|
|
27566
27567
|
}, "").slice(0, -1));
|
|
27567
|
-
return "".concat(
|
|
27568
|
+
return "".concat(o).concat(_ ? "&" : "?").concat(r);
|
|
27568
27569
|
};
|
|
27569
|
-
|
|
27570
|
-
var
|
|
27571
|
-
|
|
27570
|
+
Q.appendQueryParams = d;
|
|
27571
|
+
var s = function(o, p) {
|
|
27572
|
+
p === void 0 && (p = e.SOCKET_IO_PING_INTERVAL);
|
|
27572
27573
|
var U = function() {
|
|
27573
|
-
return
|
|
27574
|
+
return o(e.SOCKET_IO_PING_CODE);
|
|
27574
27575
|
};
|
|
27575
|
-
return window.setInterval(U,
|
|
27576
|
+
return window.setInterval(U, p);
|
|
27576
27577
|
};
|
|
27577
|
-
return
|
|
27578
|
+
return Q.setUpSocketIOPing = s, Q;
|
|
27578
27579
|
}
|
|
27579
27580
|
var Pe = {}, Na;
|
|
27580
|
-
function
|
|
27581
|
+
function ja() {
|
|
27581
27582
|
if (Na) return Pe;
|
|
27582
27583
|
Na = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.heartbeat = d;
|
|
27583
27584
|
var e = A();
|
|
27584
|
-
function n(
|
|
27585
|
-
return Array.isArray(
|
|
27586
|
-
return
|
|
27587
|
-
}).current :
|
|
27585
|
+
function n(s) {
|
|
27586
|
+
return Array.isArray(s) ? s.reduce(function(o, p) {
|
|
27587
|
+
return o.current > p.current ? o : p;
|
|
27588
|
+
}).current : s.current;
|
|
27588
27589
|
}
|
|
27589
|
-
function d(
|
|
27590
|
-
var U =
|
|
27591
|
-
var b = Date.now(), u = n(
|
|
27590
|
+
function d(s, o, p) {
|
|
27591
|
+
var U = p || {}, _ = U.interval, r = _ === void 0 ? e.DEFAULT_HEARTBEAT.interval : _, c = U.timeout, m = c === void 0 ? e.DEFAULT_HEARTBEAT.timeout : c, i = U.message, g = i === void 0 ? e.DEFAULT_HEARTBEAT.message : i, l = Math.max(100, r / 10), t = Date.now(), y = setInterval(function() {
|
|
27592
|
+
var b = Date.now(), u = n(o);
|
|
27592
27593
|
if (u + m <= b)
|
|
27593
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - u, "ms ago, last ping sent ").concat(b - t, "ms ago")),
|
|
27594
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - u, "ms ago, last ping sent ").concat(b - t, "ms ago")), s.close();
|
|
27594
27595
|
else if (u + r <= b && t + r <= b)
|
|
27595
27596
|
try {
|
|
27596
|
-
typeof
|
|
27597
|
+
typeof g == "function" ? s.send(g()) : s.send(g), t = b;
|
|
27597
27598
|
} catch (T) {
|
|
27598
|
-
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T),
|
|
27599
|
+
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T), s.close();
|
|
27599
27600
|
}
|
|
27600
27601
|
}, l);
|
|
27601
|
-
return
|
|
27602
|
+
return s.addEventListener("close", function() {
|
|
27602
27603
|
clearInterval(y);
|
|
27603
27604
|
}), function() {
|
|
27604
27605
|
};
|
|
@@ -27609,19 +27610,19 @@ var Ce = {}, Be = {}, Da;
|
|
|
27609
27610
|
function ea() {
|
|
27610
27611
|
return Da || (Da = 1, (function(e) {
|
|
27611
27612
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetSubscribers = e.removeSubscriber = e.addSubscriber = e.hasSubscribers = e.getSubscribers = void 0;
|
|
27612
|
-
var n = {}, d = [],
|
|
27613
|
+
var n = {}, d = [], s = function(r) {
|
|
27613
27614
|
return (0, e.hasSubscribers)(r) ? Array.from(n[r]) : d;
|
|
27614
27615
|
};
|
|
27615
|
-
e.getSubscribers =
|
|
27616
|
-
var
|
|
27616
|
+
e.getSubscribers = s;
|
|
27617
|
+
var o = function(r) {
|
|
27617
27618
|
var c;
|
|
27618
27619
|
return ((c = n[r]) === null || c === void 0 ? void 0 : c.size) > 0;
|
|
27619
27620
|
};
|
|
27620
|
-
e.hasSubscribers =
|
|
27621
|
-
var
|
|
27621
|
+
e.hasSubscribers = o;
|
|
27622
|
+
var p = function(r, c) {
|
|
27622
27623
|
n[r] = n[r] || /* @__PURE__ */ new Set(), n[r].add(c);
|
|
27623
27624
|
};
|
|
27624
|
-
e.addSubscriber =
|
|
27625
|
+
e.addSubscriber = p;
|
|
27625
27626
|
var U = function(r, c) {
|
|
27626
27627
|
n[r].delete(c);
|
|
27627
27628
|
};
|
|
@@ -27639,14 +27640,14 @@ function ea() {
|
|
|
27639
27640
|
var Ea;
|
|
27640
27641
|
function aa() {
|
|
27641
27642
|
if (Ea) return Ce;
|
|
27642
|
-
Ea = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.assertIsWebSocket = d, Ce.resetGlobalState =
|
|
27643
|
+
Ea = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.assertIsWebSocket = d, Ce.resetGlobalState = s;
|
|
27643
27644
|
var e = Xe(), n = ea();
|
|
27644
|
-
function d(
|
|
27645
|
-
if (!
|
|
27645
|
+
function d(o, p) {
|
|
27646
|
+
if (!p && !(o instanceof WebSocket))
|
|
27646
27647
|
throw new Error("");
|
|
27647
27648
|
}
|
|
27648
|
-
function o
|
|
27649
|
-
(0, n.resetSubscribers)(
|
|
27649
|
+
function s(o) {
|
|
27650
|
+
(0, n.resetSubscribers)(o), (0, e.resetWebSockets)(o);
|
|
27650
27651
|
}
|
|
27651
27652
|
return Ce;
|
|
27652
27653
|
}
|
|
@@ -27656,66 +27657,66 @@ function Bi() {
|
|
|
27656
27657
|
La = 1;
|
|
27657
27658
|
var e = ne && ne.__assign || function() {
|
|
27658
27659
|
return e = Object.assign || function(m) {
|
|
27659
|
-
for (var i,
|
|
27660
|
-
i = arguments[
|
|
27660
|
+
for (var i, g = 1, l = arguments.length; g < l; g++) {
|
|
27661
|
+
i = arguments[g];
|
|
27661
27662
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (m[t] = i[t]);
|
|
27662
27663
|
}
|
|
27663
27664
|
return m;
|
|
27664
27665
|
}, e.apply(this, arguments);
|
|
27665
27666
|
};
|
|
27666
27667
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachListeners = void 0;
|
|
27667
|
-
var n = $e(), d =
|
|
27668
|
+
var n = $e(), d = ja(), s = A(), o = aa(), p = function(m, i, g, l) {
|
|
27668
27669
|
m.onmessage = function(t) {
|
|
27669
27670
|
var y;
|
|
27670
|
-
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 ||
|
|
27671
|
+
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 || g(t));
|
|
27671
27672
|
};
|
|
27672
|
-
}, U = function(m, i,
|
|
27673
|
+
}, U = function(m, i, g, l, t) {
|
|
27673
27674
|
m.onopen = function(y) {
|
|
27674
|
-
if (i.current.onOpen && i.current.onOpen(y), l.current = 0,
|
|
27675
|
+
if (i.current.onOpen && i.current.onOpen(y), l.current = 0, g(s.ReadyState.OPEN), i.current.heartbeat && m instanceof WebSocket) {
|
|
27675
27676
|
var b = typeof i.current.heartbeat == "boolean" ? void 0 : i.current.heartbeat;
|
|
27676
27677
|
t.current = Date.now(), (0, d.heartbeat)(m, t, b);
|
|
27677
27678
|
}
|
|
27678
27679
|
};
|
|
27679
|
-
}, _ = function(m, i,
|
|
27680
|
-
if (
|
|
27680
|
+
}, _ = function(m, i, g, l, t) {
|
|
27681
|
+
if (s.isEventSourceSupported && m instanceof EventSource)
|
|
27681
27682
|
return function() {
|
|
27682
27683
|
};
|
|
27683
|
-
(0,
|
|
27684
|
+
(0, o.assertIsWebSocket)(m, i.current.skipAssert);
|
|
27684
27685
|
var y;
|
|
27685
27686
|
return m.onclose = function(b) {
|
|
27686
27687
|
var u;
|
|
27687
|
-
if (i.current.onClose && i.current.onClose(b),
|
|
27688
|
-
var T = (u = i.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
27688
|
+
if (i.current.onClose && i.current.onClose(b), g(s.ReadyState.CLOSED), i.current.shouldReconnect && i.current.shouldReconnect(b)) {
|
|
27689
|
+
var T = (u = i.current.reconnectAttempts) !== null && u !== void 0 ? u : s.DEFAULT_RECONNECT_LIMIT;
|
|
27689
27690
|
if (t.current < T) {
|
|
27690
27691
|
var N = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27691
27692
|
y = window.setTimeout(function() {
|
|
27692
27693
|
t.current++, l();
|
|
27693
|
-
}, N ??
|
|
27694
|
+
}, N ?? s.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27694
27695
|
} else
|
|
27695
27696
|
i.current.onReconnectStop && i.current.onReconnectStop(T), console.warn("Max reconnect attempts of ".concat(T, " exceeded"));
|
|
27696
27697
|
}
|
|
27697
27698
|
}, function() {
|
|
27698
27699
|
return y && window.clearTimeout(y);
|
|
27699
27700
|
};
|
|
27700
|
-
}, r = function(m, i,
|
|
27701
|
+
}, r = function(m, i, g, l, t) {
|
|
27701
27702
|
var y;
|
|
27702
27703
|
return m.onerror = function(b) {
|
|
27703
27704
|
var u;
|
|
27704
|
-
if (i.current.onError && i.current.onError(b),
|
|
27705
|
-
if (t.current < ((u = i.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
27705
|
+
if (i.current.onError && i.current.onError(b), s.isEventSourceSupported && m instanceof EventSource && (i.current.onClose && i.current.onClose(e(e({}, b), { code: 1006, reason: "An error occurred with the EventSource: ".concat(b), wasClean: !1 })), g(s.ReadyState.CLOSED), m.close()), i.current.retryOnError)
|
|
27706
|
+
if (t.current < ((u = i.current.reconnectAttempts) !== null && u !== void 0 ? u : s.DEFAULT_RECONNECT_LIMIT)) {
|
|
27706
27707
|
var T = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27707
27708
|
y = window.setTimeout(function() {
|
|
27708
27709
|
t.current++, l();
|
|
27709
|
-
}, T ??
|
|
27710
|
+
}, T ?? s.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27710
27711
|
} else
|
|
27711
27712
|
i.current.onReconnectStop && i.current.onReconnectStop(i.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(i.current.reconnectAttempts, " exceeded"));
|
|
27712
27713
|
}, function() {
|
|
27713
27714
|
return y && window.clearTimeout(y);
|
|
27714
27715
|
};
|
|
27715
|
-
}, c = function(m, i,
|
|
27716
|
+
}, c = function(m, i, g, l, t, y, b) {
|
|
27716
27717
|
var u = i.setLastMessage, T = i.setReadyState, N, D, h;
|
|
27717
|
-
return
|
|
27718
|
-
T(
|
|
27718
|
+
return g.current.fromSocketIO && (N = (0, n.setUpSocketIOPing)(b)), p(m, g, u, y), U(m, g, T, t, y), D = _(m, g, T, l, t), h = r(m, g, T, l, t), function() {
|
|
27719
|
+
T(s.ReadyState.CLOSING), D(), h(), m.close(), N && clearInterval(N);
|
|
27719
27720
|
};
|
|
27720
27721
|
};
|
|
27721
27722
|
return ne.attachListeners = c, ne;
|
|
@@ -27726,35 +27727,35 @@ function Ki() {
|
|
|
27726
27727
|
Ga = 1;
|
|
27727
27728
|
var e = me && me.__assign || function() {
|
|
27728
27729
|
return e = Object.assign || function(i) {
|
|
27729
|
-
for (var
|
|
27730
|
-
|
|
27731
|
-
for (var y in
|
|
27730
|
+
for (var g, l = 1, t = arguments.length; l < t; l++) {
|
|
27731
|
+
g = arguments[l];
|
|
27732
|
+
for (var y in g) Object.prototype.hasOwnProperty.call(g, y) && (i[y] = g[y]);
|
|
27732
27733
|
}
|
|
27733
27734
|
return i;
|
|
27734
27735
|
}, e.apply(this, arguments);
|
|
27735
27736
|
};
|
|
27736
27737
|
Object.defineProperty(me, "__esModule", { value: !0 }), me.attachSharedListeners = void 0;
|
|
27737
|
-
var n = Xe(), d = A(),
|
|
27738
|
+
var n = Xe(), d = A(), s = ea(), o = $e(), p = ja(), U = function(i, g, l) {
|
|
27738
27739
|
i.onmessage = function(t) {
|
|
27739
|
-
(0,
|
|
27740
|
+
(0, s.getSubscribers)(g).forEach(function(y) {
|
|
27740
27741
|
var b;
|
|
27741
27742
|
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));
|
|
27742
27743
|
});
|
|
27743
27744
|
};
|
|
27744
|
-
}, _ = function(i,
|
|
27745
|
+
}, _ = function(i, g, l) {
|
|
27745
27746
|
i.onopen = function(t) {
|
|
27746
|
-
var y = (0,
|
|
27747
|
+
var y = (0, s.getSubscribers)(g);
|
|
27747
27748
|
y.forEach(function(b) {
|
|
27748
27749
|
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(t), b.setReadyState(d.ReadyState.OPEN), l && i instanceof WebSocket && (b.lastMessageTime.current = Date.now());
|
|
27749
|
-
}), l && i instanceof WebSocket && (0,
|
|
27750
|
+
}), l && i instanceof WebSocket && (0, p.heartbeat)(i, y.map(function(b) {
|
|
27750
27751
|
return b.lastMessageTime;
|
|
27751
27752
|
}), typeof l == "boolean" ? void 0 : l);
|
|
27752
27753
|
};
|
|
27753
|
-
}, r = function(i,
|
|
27754
|
+
}, r = function(i, g) {
|
|
27754
27755
|
i instanceof WebSocket && (i.onclose = function(l) {
|
|
27755
|
-
(0,
|
|
27756
|
+
(0, s.getSubscribers)(g).forEach(function(t) {
|
|
27756
27757
|
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(d.ReadyState.CLOSED);
|
|
27757
|
-
}), delete n.sharedWebSockets[
|
|
27758
|
+
}), delete n.sharedWebSockets[g], (0, s.getSubscribers)(g).forEach(function(t) {
|
|
27758
27759
|
var y;
|
|
27759
27760
|
if (t.optionsRef.current.shouldReconnect && t.optionsRef.current.shouldReconnect(l)) {
|
|
27760
27761
|
var b = (y = t.optionsRef.current.reconnectAttempts) !== null && y !== void 0 ? y : d.DEFAULT_RECONNECT_LIMIT;
|
|
@@ -27768,68 +27769,68 @@ function Ki() {
|
|
|
27768
27769
|
}
|
|
27769
27770
|
});
|
|
27770
27771
|
});
|
|
27771
|
-
}, c = function(i,
|
|
27772
|
+
}, c = function(i, g) {
|
|
27772
27773
|
i.onerror = function(l) {
|
|
27773
|
-
(0,
|
|
27774
|
+
(0, s.getSubscribers)(g).forEach(function(t) {
|
|
27774
27775
|
t.optionsRef.current.onError && t.optionsRef.current.onError(l), d.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(d.ReadyState.CLOSED));
|
|
27775
27776
|
}), d.isEventSourceSupported && i instanceof EventSource && i.close();
|
|
27776
27777
|
};
|
|
27777
|
-
}, m = function(i,
|
|
27778
|
+
}, m = function(i, g, l, t) {
|
|
27778
27779
|
var y;
|
|
27779
|
-
return l.current.fromSocketIO && (y = (0,
|
|
27780
|
+
return l.current.fromSocketIO && (y = (0, o.setUpSocketIOPing)(t)), U(i, g, l.current.heartbeat), r(i, g), _(i, g, l.current.heartbeat), c(i, g), function() {
|
|
27780
27781
|
y && clearInterval(y);
|
|
27781
27782
|
};
|
|
27782
27783
|
};
|
|
27783
27784
|
return me.attachSharedListeners = m, me;
|
|
27784
27785
|
}
|
|
27785
27786
|
var Ma;
|
|
27786
|
-
function
|
|
27787
|
+
function ji() {
|
|
27787
27788
|
if (Ma) return Te;
|
|
27788
27789
|
Ma = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.createOrJoinSocket = void 0;
|
|
27789
|
-
var e = Xe(), n = A(), d = Bi(),
|
|
27790
|
+
var e = Xe(), n = A(), d = Bi(), s = Ki(), o = ea(), p = function(_, r, c, m, i) {
|
|
27790
27791
|
return function() {
|
|
27791
|
-
if ((0,
|
|
27792
|
+
if ((0, o.removeSubscriber)(_, r), !(0, o.hasSubscribers)(_)) {
|
|
27792
27793
|
try {
|
|
27793
|
-
var
|
|
27794
|
-
|
|
27794
|
+
var g = e.sharedWebSockets[_];
|
|
27795
|
+
g instanceof WebSocket && (g.onclose = function(l) {
|
|
27795
27796
|
c.current.onClose && c.current.onClose(l), m(n.ReadyState.CLOSED);
|
|
27796
|
-
}),
|
|
27797
|
+
}), g.close();
|
|
27797
27798
|
} catch {
|
|
27798
27799
|
}
|
|
27799
27800
|
i && i(), delete e.sharedWebSockets[_];
|
|
27800
27801
|
}
|
|
27801
27802
|
};
|
|
27802
|
-
}, U = function(_, r, c, m, i,
|
|
27803
|
+
}, U = function(_, r, c, m, i, g, l, t, y) {
|
|
27803
27804
|
if (!n.isEventSourceSupported && m.current.eventSourceOptions)
|
|
27804
27805
|
throw n.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
27805
27806
|
if (m.current.share) {
|
|
27806
27807
|
var b = null;
|
|
27807
|
-
e.sharedWebSockets[r] === void 0 ? (e.sharedWebSockets[r] = m.current.eventSourceOptions ? new EventSource(r, m.current.eventSourceOptions) : new WebSocket(r, m.current.protocols), _.current = e.sharedWebSockets[r], c(n.ReadyState.CONNECTING), b = (0,
|
|
27808
|
+
e.sharedWebSockets[r] === void 0 ? (e.sharedWebSockets[r] = m.current.eventSourceOptions ? new EventSource(r, m.current.eventSourceOptions) : new WebSocket(r, m.current.protocols), _.current = e.sharedWebSockets[r], c(n.ReadyState.CONNECTING), b = (0, s.attachSharedListeners)(e.sharedWebSockets[r], r, m, y)) : (_.current = e.sharedWebSockets[r], c(e.sharedWebSockets[r].readyState));
|
|
27808
27809
|
var u = {
|
|
27809
27810
|
setLastMessage: i,
|
|
27810
27811
|
setReadyState: c,
|
|
27811
27812
|
optionsRef: m,
|
|
27812
27813
|
reconnectCount: l,
|
|
27813
27814
|
lastMessageTime: t,
|
|
27814
|
-
reconnect:
|
|
27815
|
+
reconnect: g
|
|
27815
27816
|
};
|
|
27816
|
-
return (0,
|
|
27817
|
+
return (0, o.addSubscriber)(r, u), p(r, u, m, c, b);
|
|
27817
27818
|
} else {
|
|
27818
27819
|
if (_.current = m.current.eventSourceOptions ? new EventSource(r, m.current.eventSourceOptions) : new WebSocket(r, m.current.protocols), c(n.ReadyState.CONNECTING), !_.current)
|
|
27819
27820
|
throw new Error("WebSocket failed to be created");
|
|
27820
27821
|
return (0, d.attachListeners)(_.current, {
|
|
27821
27822
|
setLastMessage: i,
|
|
27822
27823
|
setReadyState: c
|
|
27823
|
-
}, m,
|
|
27824
|
+
}, m, g.current, l, t, y);
|
|
27824
27825
|
}
|
|
27825
27826
|
};
|
|
27826
27827
|
return Te.createOrJoinSocket = U, Te;
|
|
27827
27828
|
}
|
|
27828
27829
|
var Y = {}, Ra;
|
|
27829
|
-
function
|
|
27830
|
+
function Qi() {
|
|
27830
27831
|
return Ra || (Ra = 1, (function(e) {
|
|
27831
27832
|
var n = Y && Y.__awaiter || function(r, c, m, i) {
|
|
27832
|
-
function
|
|
27833
|
+
function g(l) {
|
|
27833
27834
|
return l instanceof m ? l : new m(function(t) {
|
|
27834
27835
|
t(l);
|
|
27835
27836
|
});
|
|
@@ -27850,7 +27851,7 @@ function ji() {
|
|
|
27850
27851
|
}
|
|
27851
27852
|
}
|
|
27852
27853
|
function u(T) {
|
|
27853
|
-
T.done ? l(T.value) :
|
|
27854
|
+
T.done ? l(T.value) : g(T.value).then(y, b);
|
|
27854
27855
|
}
|
|
27855
27856
|
u((i = i.apply(r, c || [])).next());
|
|
27856
27857
|
});
|
|
@@ -27858,7 +27859,7 @@ function ji() {
|
|
|
27858
27859
|
var m = { label: 0, sent: function() {
|
|
27859
27860
|
if (l[0] & 1) throw l[1];
|
|
27860
27861
|
return l[1];
|
|
27861
|
-
}, trys: [], ops: [] }, i,
|
|
27862
|
+
}, trys: [], ops: [] }, i, g, l, t = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
27862
27863
|
return t.next = y(0), t.throw = y(1), t.return = y(2), typeof Symbol == "function" && (t[Symbol.iterator] = function() {
|
|
27863
27864
|
return this;
|
|
27864
27865
|
}), t;
|
|
@@ -27870,8 +27871,8 @@ function ji() {
|
|
|
27870
27871
|
function b(u) {
|
|
27871
27872
|
if (i) throw new TypeError("Generator is already executing.");
|
|
27872
27873
|
for (; t && (t = 0, u[0] && (m = 0)), m; ) try {
|
|
27873
|
-
if (i = 1,
|
|
27874
|
-
switch (
|
|
27874
|
+
if (i = 1, g && (l = u[0] & 2 ? g.return : u[0] ? g.throw || ((l = g.return) && l.call(g), 0) : g.next) && !(l = l.call(g, u[1])).done) return l;
|
|
27875
|
+
switch (g = 0, l && (u = [u[0] & 2, l.value]), u[0]) {
|
|
27875
27876
|
case 0:
|
|
27876
27877
|
case 1:
|
|
27877
27878
|
l = u;
|
|
@@ -27879,7 +27880,7 @@ function ji() {
|
|
|
27879
27880
|
case 4:
|
|
27880
27881
|
return m.label++, { value: u[1], done: !1 };
|
|
27881
27882
|
case 5:
|
|
27882
|
-
m.label++,
|
|
27883
|
+
m.label++, g = u[1], u = [0];
|
|
27883
27884
|
continue;
|
|
27884
27885
|
case 7:
|
|
27885
27886
|
u = m.ops.pop(), m.trys.pop();
|
|
@@ -27906,41 +27907,41 @@ function ji() {
|
|
|
27906
27907
|
}
|
|
27907
27908
|
u = c.call(r, m);
|
|
27908
27909
|
} catch (T) {
|
|
27909
|
-
u = [6, T],
|
|
27910
|
+
u = [6, T], g = 0;
|
|
27910
27911
|
} finally {
|
|
27911
27912
|
i = l = 0;
|
|
27912
27913
|
}
|
|
27913
27914
|
if (u[0] & 5) throw u[1];
|
|
27914
27915
|
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
27915
27916
|
}
|
|
27916
|
-
},
|
|
27917
|
-
if (m || arguments.length === 2) for (var i = 0,
|
|
27917
|
+
}, s = Y && Y.__spreadArray || function(r, c, m) {
|
|
27918
|
+
if (m || arguments.length === 2) for (var i = 0, g = c.length, l; i < g; i++)
|
|
27918
27919
|
(l || !(i in c)) && (l || (l = Array.prototype.slice.call(c, 0, i)), l[i] = c[i]);
|
|
27919
27920
|
return r.concat(l || Array.prototype.slice.call(c));
|
|
27920
27921
|
};
|
|
27921
27922
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getUrl = void 0;
|
|
27922
|
-
var
|
|
27923
|
+
var o = $e(), p = A(), U = function(r) {
|
|
27923
27924
|
return new Promise(function(c) {
|
|
27924
27925
|
return window.setTimeout(c, r);
|
|
27925
27926
|
});
|
|
27926
27927
|
}, _ = function(r, c) {
|
|
27927
27928
|
for (var m = [], i = 2; i < arguments.length; i++)
|
|
27928
27929
|
m[i - 2] = arguments[i];
|
|
27929
|
-
return n(void 0,
|
|
27930
|
+
return n(void 0, s([r, c], m, !0), void 0, function(g, l, t) {
|
|
27930
27931
|
var y, b, u, T, N, D, h, L;
|
|
27931
27932
|
return t === void 0 && (t = 0), d(this, function(M) {
|
|
27932
27933
|
switch (M.label) {
|
|
27933
27934
|
case 0:
|
|
27934
|
-
if (typeof
|
|
27935
|
+
if (typeof g != "function") return [3, 10];
|
|
27935
27936
|
M.label = 1;
|
|
27936
27937
|
case 1:
|
|
27937
|
-
return M.trys.push([1, 3, , 9]), [4,
|
|
27938
|
+
return M.trys.push([1, 3, , 9]), [4, g()];
|
|
27938
27939
|
case 2:
|
|
27939
27940
|
return y = M.sent(), [3, 9];
|
|
27940
27941
|
case 3:
|
|
27941
|
-
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D :
|
|
27942
|
+
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D : p.DEFAULT_RECONNECT_LIMIT, t < b ? (u = typeof l.current.reconnectInterval == "function" ? l.current.reconnectInterval(t) : l.current.reconnectInterval, [4, U(u ?? p.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
27942
27943
|
case 4:
|
|
27943
|
-
return M.sent(), [2, (0, e.getUrl)(
|
|
27944
|
+
return M.sent(), [2, (0, e.getUrl)(g, l, t + 1)];
|
|
27944
27945
|
case 5:
|
|
27945
27946
|
return (L = (h = l.current).onReconnectStop) === null || L === void 0 || L.call(h, t), [2, null];
|
|
27946
27947
|
case 6:
|
|
@@ -27952,9 +27953,9 @@ function ji() {
|
|
|
27952
27953
|
case 9:
|
|
27953
27954
|
return [3, 11];
|
|
27954
27955
|
case 10:
|
|
27955
|
-
y =
|
|
27956
|
+
y = g, M.label = 11;
|
|
27956
27957
|
case 11:
|
|
27957
|
-
return T = l.current.fromSocketIO ? (0,
|
|
27958
|
+
return T = l.current.fromSocketIO ? (0, o.parseSocketIOUrl)(y) : y, N = l.current.queryParams ? (0, o.appendQueryParams)(T, l.current.queryParams) : T, [2, N];
|
|
27958
27959
|
}
|
|
27959
27960
|
});
|
|
27960
27961
|
});
|
|
@@ -27966,15 +27967,15 @@ var Ke = {}, Pa;
|
|
|
27966
27967
|
function Yi() {
|
|
27967
27968
|
return Pa || (Pa = 1, (function(e) {
|
|
27968
27969
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.websocketWrapper = void 0;
|
|
27969
|
-
var n = function(d,
|
|
27970
|
+
var n = function(d, s) {
|
|
27970
27971
|
return new Proxy(d, {
|
|
27971
|
-
get: function(
|
|
27972
|
-
var U =
|
|
27973
|
-
return
|
|
27972
|
+
get: function(o, p) {
|
|
27973
|
+
var U = o[p];
|
|
27974
|
+
return p === "reconnect" ? s : 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() {
|
|
27974
27975
|
}) : U;
|
|
27975
27976
|
},
|
|
27976
|
-
set: function(
|
|
27977
|
-
return /^on/.test(
|
|
27977
|
+
set: function(o, p, U) {
|
|
27978
|
+
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);
|
|
27978
27979
|
}
|
|
27979
27980
|
});
|
|
27980
27981
|
};
|
|
@@ -27986,14 +27987,14 @@ function ia() {
|
|
|
27986
27987
|
if (xa) return J;
|
|
27987
27988
|
xa = 1;
|
|
27988
27989
|
var e = J && J.__assign || function() {
|
|
27989
|
-
return e = Object.assign || function(
|
|
27990
|
+
return e = Object.assign || function(g) {
|
|
27990
27991
|
for (var l, t = 1, y = arguments.length; t < y; t++) {
|
|
27991
27992
|
l = arguments[t];
|
|
27992
|
-
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (
|
|
27993
|
+
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (g[b] = l[b]);
|
|
27993
27994
|
}
|
|
27994
|
-
return
|
|
27995
|
+
return g;
|
|
27995
27996
|
}, e.apply(this, arguments);
|
|
27996
|
-
}, n = J && J.__awaiter || function(
|
|
27997
|
+
}, n = J && J.__awaiter || function(g, l, t, y) {
|
|
27997
27998
|
function b(u) {
|
|
27998
27999
|
return u instanceof t ? u : new t(function(T) {
|
|
27999
28000
|
T(u);
|
|
@@ -28017,9 +28018,9 @@ function ia() {
|
|
|
28017
28018
|
function h(L) {
|
|
28018
28019
|
L.done ? u(L.value) : b(L.value).then(N, D);
|
|
28019
28020
|
}
|
|
28020
|
-
h((y = y.apply(
|
|
28021
|
+
h((y = y.apply(g, l || [])).next());
|
|
28021
28022
|
});
|
|
28022
|
-
}, d = J && J.__generator || function(
|
|
28023
|
+
}, d = J && J.__generator || function(g, l) {
|
|
28023
28024
|
var t = { label: 0, sent: function() {
|
|
28024
28025
|
if (u[0] & 1) throw u[1];
|
|
28025
28026
|
return u[1];
|
|
@@ -28069,7 +28070,7 @@ function ia() {
|
|
|
28069
28070
|
u[2] && t.ops.pop(), t.trys.pop();
|
|
28070
28071
|
continue;
|
|
28071
28072
|
}
|
|
28072
|
-
h = l.call(
|
|
28073
|
+
h = l.call(g, t);
|
|
28073
28074
|
} catch (L) {
|
|
28074
28075
|
h = [6, L], b = 0;
|
|
28075
28076
|
} finally {
|
|
@@ -28078,13 +28079,13 @@ function ia() {
|
|
|
28078
28079
|
if (h[0] & 5) throw h[1];
|
|
28079
28080
|
return { value: h[0] ? h[1] : void 0, done: !0 };
|
|
28080
28081
|
}
|
|
28081
|
-
},
|
|
28082
|
-
return
|
|
28082
|
+
}, s = J && J.__importDefault || function(g) {
|
|
28083
|
+
return g && g.__esModule ? g : { default: g };
|
|
28083
28084
|
};
|
|
28084
28085
|
Object.defineProperty(J, "__esModule", { value: !0 }), J.useWebSocket = void 0;
|
|
28085
|
-
var
|
|
28086
|
+
var o = he, p = ki, U = A(), _ = ji(), r = Qi(), c = s(Yi()), m = aa(), i = function(g, l, t) {
|
|
28086
28087
|
l === void 0 && (l = U.DEFAULT_OPTIONS), t === void 0 && (t = !0);
|
|
28087
|
-
var y = (0,
|
|
28088
|
+
var y = (0, o.useState)(null), b = y[0], u = y[1], T = (0, o.useState)({}), N = T[0], D = T[1], h = (0, o.useMemo)(function() {
|
|
28088
28089
|
if (!l.disableJson && b)
|
|
28089
28090
|
try {
|
|
28090
28091
|
return JSON.parse(b.data);
|
|
@@ -28092,47 +28093,47 @@ function ia() {
|
|
|
28092
28093
|
return U.UNPARSABLE_JSON_OBJECT;
|
|
28093
28094
|
}
|
|
28094
28095
|
return null;
|
|
28095
|
-
}, [b, l.disableJson]), L = (0,
|
|
28096
|
-
}), _e = (0,
|
|
28096
|
+
}, [b, l.disableJson]), L = (0, o.useRef)(null), M = (0, o.useRef)(null), ce = (0, o.useRef)(function() {
|
|
28097
|
+
}), _e = (0, o.useRef)(0), we = (0, o.useRef)(Date.now()), ke = (0, o.useRef)([]), V = (0, o.useRef)(null), H = (0, o.useRef)(l);
|
|
28097
28098
|
H.current = l;
|
|
28098
|
-
var Z = L.current && N[L.current] !== void 0 ? N[L.current] :
|
|
28099
|
+
var Z = L.current && N[L.current] !== void 0 ? N[L.current] : g !== null && t === !0 ? U.ReadyState.CONNECTING : U.ReadyState.UNINSTANTIATED, ae = l.queryParams ? JSON.stringify(l.queryParams) : null, B = (0, o.useCallback)(function(x, w) {
|
|
28099
28100
|
var K;
|
|
28100
28101
|
if (w === void 0 && (w = !0), U.isEventSourceSupported && M.current instanceof EventSource) {
|
|
28101
28102
|
console.warn("Unable to send a message from an eventSource");
|
|
28102
28103
|
return;
|
|
28103
28104
|
}
|
|
28104
28105
|
((K = M.current) === null || K === void 0 ? void 0 : K.readyState) === U.ReadyState.OPEN ? ((0, m.assertIsWebSocket)(M.current, H.current.skipAssert), M.current.send(x)) : w && ke.current.push(x);
|
|
28105
|
-
}, []), Se = (0,
|
|
28106
|
+
}, []), Se = (0, o.useCallback)(function(x, w) {
|
|
28106
28107
|
w === void 0 && (w = !0), B(JSON.stringify(x), w);
|
|
28107
|
-
}, [B]), Ne = (0,
|
|
28108
|
+
}, [B]), Ne = (0, o.useCallback)(function() {
|
|
28108
28109
|
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0, m.assertIsWebSocket)(M.current, H.current.skipAssert), V.current = (0, c.default)(M.current, ce)), V.current);
|
|
28109
28110
|
}, []);
|
|
28110
|
-
return (0,
|
|
28111
|
-
if (
|
|
28111
|
+
return (0, o.useEffect)(function() {
|
|
28112
|
+
if (g !== null && t === !0) {
|
|
28112
28113
|
var x, w = !1, K = !0, fe = function() {
|
|
28113
28114
|
return n(void 0, void 0, void 0, function() {
|
|
28114
28115
|
var ie, $, De;
|
|
28115
28116
|
return d(this, function(se) {
|
|
28116
28117
|
switch (se.label) {
|
|
28117
28118
|
case 0:
|
|
28118
|
-
return ie = L, [4, (0, r.getUrl)(
|
|
28119
|
+
return ie = L, [4, (0, r.getUrl)(g, H)];
|
|
28119
28120
|
case 1:
|
|
28120
|
-
return ie.current = se.sent(), L.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), L.current = "ABORTED", (0,
|
|
28121
|
-
return D(function(
|
|
28122
|
-
return e(e({},
|
|
28121
|
+
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() {
|
|
28122
|
+
return D(function(j) {
|
|
28123
|
+
return e(e({}, j), { ABORTED: U.ReadyState.CLOSED });
|
|
28123
28124
|
});
|
|
28124
28125
|
}), [
|
|
28125
28126
|
2
|
|
28126
28127
|
/*return*/
|
|
28127
|
-
]) : ($ = function(
|
|
28128
|
-
w || (0,
|
|
28129
|
-
return u(
|
|
28128
|
+
]) : ($ = function(j) {
|
|
28129
|
+
w || (0, p.flushSync)(function() {
|
|
28130
|
+
return u(j);
|
|
28130
28131
|
});
|
|
28131
|
-
}, De = function(
|
|
28132
|
-
w || (0,
|
|
28132
|
+
}, De = function(j) {
|
|
28133
|
+
w || (0, p.flushSync)(function() {
|
|
28133
28134
|
return D(function(ue) {
|
|
28134
28135
|
var le;
|
|
28135
|
-
return e(e({}, ue), L.current && (le = {}, le[L.current] =
|
|
28136
|
+
return e(e({}, ue), L.current && (le = {}, le[L.current] = j, le));
|
|
28136
28137
|
});
|
|
28137
28138
|
});
|
|
28138
28139
|
}, K && (x = (0, _.createOrJoinSocket)(M, L.current, De, H, $, ce, _e, we, B)), [
|
|
@@ -28148,11 +28149,11 @@ function ia() {
|
|
|
28148
28149
|
}, fe(), function() {
|
|
28149
28150
|
w = !0, K = !1, V.current && (V.current = null), x?.(), u(null);
|
|
28150
28151
|
};
|
|
28151
|
-
} else (
|
|
28152
|
+
} else (g === null || t === !1) && (_e.current = 0, D(function(ie) {
|
|
28152
28153
|
var $;
|
|
28153
28154
|
return e(e({}, ie), L.current && ($ = {}, $[L.current] = U.ReadyState.CLOSED, $));
|
|
28154
28155
|
}));
|
|
28155
|
-
}, [
|
|
28156
|
+
}, [g, t, ae, B]), (0, o.useEffect)(function() {
|
|
28156
28157
|
Z === U.ReadyState.OPEN && ke.current.splice(0).forEach(function(x) {
|
|
28157
28158
|
B(x);
|
|
28158
28159
|
});
|
|
@@ -28181,29 +28182,29 @@ function qi() {
|
|
|
28181
28182
|
}, e.apply(this, arguments);
|
|
28182
28183
|
};
|
|
28183
28184
|
Object.defineProperty(re, "__esModule", { value: !0 }), re.useSocketIO = void 0;
|
|
28184
|
-
var n = he, d = ia(),
|
|
28185
|
+
var n = he, d = ia(), s = A(), o = {
|
|
28185
28186
|
type: "empty",
|
|
28186
28187
|
payload: null
|
|
28187
|
-
},
|
|
28188
|
+
}, p = function(_) {
|
|
28188
28189
|
if (!_ || !_.data)
|
|
28189
|
-
return
|
|
28190
|
+
return o;
|
|
28190
28191
|
var r = _.data.match(/\[.*]/);
|
|
28191
28192
|
if (!r)
|
|
28192
|
-
return
|
|
28193
|
+
return o;
|
|
28193
28194
|
var c = JSON.parse(r);
|
|
28194
|
-
return !Array.isArray(c) || !c[1] ?
|
|
28195
|
+
return !Array.isArray(c) || !c[1] ? o : {
|
|
28195
28196
|
type: c[0],
|
|
28196
28197
|
payload: c[1]
|
|
28197
28198
|
};
|
|
28198
28199
|
}, U = function(_, r, c) {
|
|
28199
|
-
r === void 0 && (r =
|
|
28200
|
+
r === void 0 && (r = s.DEFAULT_OPTIONS), c === void 0 && (c = !0);
|
|
28200
28201
|
var m = (0, n.useMemo)(function() {
|
|
28201
28202
|
return e(e({}, r), { fromSocketIO: !0 });
|
|
28202
|
-
}, []), i = (0, d.useWebSocket)(_, m, c),
|
|
28203
|
-
return
|
|
28203
|
+
}, []), i = (0, d.useWebSocket)(_, m, c), g = i.sendMessage, l = i.sendJsonMessage, t = i.lastMessage, y = i.readyState, b = i.getWebSocket, u = (0, n.useMemo)(function() {
|
|
28204
|
+
return p(t);
|
|
28204
28205
|
}, [t]);
|
|
28205
28206
|
return {
|
|
28206
|
-
sendMessage:
|
|
28207
|
+
sendMessage: g,
|
|
28207
28208
|
sendJsonMessage: l,
|
|
28208
28209
|
lastMessage: u,
|
|
28209
28210
|
lastJsonMessage: u,
|
|
@@ -28234,15 +28235,15 @@ function Xi() {
|
|
|
28234
28235
|
return r;
|
|
28235
28236
|
};
|
|
28236
28237
|
Object.defineProperty(q, "__esModule", { value: !0 }), q.useEventSource = void 0;
|
|
28237
|
-
var d = he,
|
|
28238
|
-
_ === void 0 && (_ =
|
|
28238
|
+
var d = he, s = ia(), o = A(), p = function(U, _, r) {
|
|
28239
|
+
_ === void 0 && (_ = o.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
28239
28240
|
var c = _.withCredentials, m = _.events, i = n(_, ["withCredentials", "events"]);
|
|
28240
28241
|
r === void 0 && (r = !0);
|
|
28241
|
-
var
|
|
28242
|
+
var g = e(e({}, i), { eventSourceOptions: {
|
|
28242
28243
|
withCredentials: c
|
|
28243
|
-
} }), l = (0, d.useRef)(
|
|
28244
|
+
} }), l = (0, d.useRef)(o.EMPTY_EVENT_HANDLERS);
|
|
28244
28245
|
m && (l.current = m);
|
|
28245
|
-
var t = (0,
|
|
28246
|
+
var t = (0, s.useWebSocket)(U, g, r), y = t.lastMessage, b = t.readyState, u = t.getWebSocket;
|
|
28246
28247
|
return (0, d.useEffect)(function() {
|
|
28247
28248
|
y?.type && Object.entries(l.current).forEach(function(T) {
|
|
28248
28249
|
var N = T[0], D = T[1];
|
|
@@ -28254,7 +28255,7 @@ function Xi() {
|
|
|
28254
28255
|
getEventSource: u
|
|
28255
28256
|
};
|
|
28256
28257
|
};
|
|
28257
|
-
return q.useEventSource =
|
|
28258
|
+
return q.useEventSource = p, q;
|
|
28258
28259
|
}
|
|
28259
28260
|
var wa;
|
|
28260
28261
|
function $i() {
|
|
@@ -28268,17 +28269,17 @@ function $i() {
|
|
|
28268
28269
|
Object.defineProperty(e, "useSocketIO", { enumerable: !0, get: function() {
|
|
28269
28270
|
return d.useSocketIO;
|
|
28270
28271
|
} });
|
|
28271
|
-
var
|
|
28272
|
+
var s = A();
|
|
28272
28273
|
Object.defineProperty(e, "ReadyState", { enumerable: !0, get: function() {
|
|
28273
|
-
return
|
|
28274
|
+
return s.ReadyState;
|
|
28274
28275
|
} });
|
|
28275
|
-
var
|
|
28276
|
+
var o = Xi();
|
|
28276
28277
|
Object.defineProperty(e, "useEventSource", { enumerable: !0, get: function() {
|
|
28277
|
-
return
|
|
28278
|
+
return o.useEventSource;
|
|
28278
28279
|
} });
|
|
28279
|
-
var
|
|
28280
|
+
var p = aa();
|
|
28280
28281
|
Object.defineProperty(e, "resetGlobalState", { enumerable: !0, get: function() {
|
|
28281
|
-
return
|
|
28282
|
+
return p.resetGlobalState;
|
|
28282
28283
|
} });
|
|
28283
28284
|
})(Ve)), Ve;
|
|
28284
28285
|
}
|
|
@@ -28299,8 +28300,8 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28299
28300
|
socketHandlers: n = {},
|
|
28300
28301
|
options: d = {}
|
|
28301
28302
|
}) => {
|
|
28302
|
-
const
|
|
28303
|
-
sendMessage:
|
|
28303
|
+
const s = ya(!1), o = ya(n), {
|
|
28304
|
+
sendMessage: p,
|
|
28304
28305
|
// 發送普通訊息
|
|
28305
28306
|
sendJsonMessage: U,
|
|
28306
28307
|
// 發送 JSON 訊息
|
|
@@ -28313,11 +28314,11 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28313
28314
|
} = al(e, {
|
|
28314
28315
|
queryParams: { key: "wsky" },
|
|
28315
28316
|
onOpen: () => console.log("連線成功"),
|
|
28316
|
-
shouldReconnect: () =>
|
|
28317
|
+
shouldReconnect: () => s.current === !1,
|
|
28317
28318
|
reconnectAttempts: 9999,
|
|
28318
28319
|
reconnectInterval: 1e3,
|
|
28319
28320
|
...d
|
|
28320
|
-
}), c =
|
|
28321
|
+
}), c = je(() => {
|
|
28321
28322
|
try {
|
|
28322
28323
|
return JSON.parse(_?.data);
|
|
28323
28324
|
} catch {
|
|
@@ -28326,25 +28327,25 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28326
28327
|
}, [_?.data]);
|
|
28327
28328
|
return ve(() => {
|
|
28328
28329
|
const m = setInterval(
|
|
28329
|
-
() =>
|
|
28330
|
+
() => p("ping"),
|
|
28330
28331
|
il
|
|
28331
28332
|
);
|
|
28332
28333
|
return () => clearInterval(m);
|
|
28333
|
-
}, [
|
|
28334
|
-
|
|
28334
|
+
}, [p]), ve(() => {
|
|
28335
|
+
o.current = n;
|
|
28335
28336
|
}, [n]), ve(() => {
|
|
28336
28337
|
if (!c) return;
|
|
28337
28338
|
const {
|
|
28338
28339
|
onDeposit: m,
|
|
28339
28340
|
onTransCode: i,
|
|
28340
|
-
onError:
|
|
28341
|
+
onError: g,
|
|
28341
28342
|
onUpdateMember: l,
|
|
28342
28343
|
onMaintainNotice: t,
|
|
28343
28344
|
onMaintainNoticeMember: y,
|
|
28344
28345
|
onReload: b,
|
|
28345
28346
|
onTransferInGame: u,
|
|
28346
28347
|
onCashRegisterLimit: T
|
|
28347
|
-
} =
|
|
28348
|
+
} = o.current, N = Me(c, "type", ""), D = {
|
|
28348
28349
|
memberInfoUid: Me(c, "member_info_uid", null),
|
|
28349
28350
|
data: Me(c, "data", null),
|
|
28350
28351
|
memo: Me(c, "memo", null)
|
|
@@ -28357,7 +28358,7 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28357
28358
|
i?.(D);
|
|
28358
28359
|
break;
|
|
28359
28360
|
case I.ERROR:
|
|
28360
|
-
|
|
28361
|
+
g?.(D);
|
|
28361
28362
|
break;
|
|
28362
28363
|
case I.UPDATE_MEMBER:
|
|
28363
28364
|
l?.(D);
|
|
@@ -28382,26 +28383,26 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28382
28383
|
console.warn("Unknown socket type:", N);
|
|
28383
28384
|
break;
|
|
28384
28385
|
}
|
|
28385
|
-
}, [c]), ve(() => () =>
|
|
28386
|
-
sendMessage:
|
|
28386
|
+
}, [c]), ve(() => () => s.current = !0, []), {
|
|
28387
|
+
sendMessage: p,
|
|
28387
28388
|
sendJsonMessage: U,
|
|
28388
28389
|
readyState: r
|
|
28389
28390
|
// WebSocket 連線狀態
|
|
28390
28391
|
};
|
|
28391
|
-
},
|
|
28392
|
+
}, Qa = () => {
|
|
28392
28393
|
const { client: e } = He(), n = X(async () => {
|
|
28393
|
-
const { data:
|
|
28394
|
-
return
|
|
28394
|
+
const { data: s } = await e.get("/carousels");
|
|
28395
|
+
return s;
|
|
28395
28396
|
}, [e]), d = X(async () => await e.get("/marquees"), [e]);
|
|
28396
28397
|
return { commonCarouselApi: n, commonMarqueeApi: d };
|
|
28397
28398
|
}, bl = () => {
|
|
28398
|
-
const { commonCarouselApi: e } =
|
|
28399
|
+
const { commonCarouselApi: e } = Qa();
|
|
28399
28400
|
return oe({
|
|
28400
28401
|
queryKey: ["getCarouselList"],
|
|
28401
28402
|
queryFn: async () => await e()
|
|
28402
28403
|
});
|
|
28403
28404
|
}, Tl = () => {
|
|
28404
|
-
const { commonMarqueeApi: e } =
|
|
28405
|
+
const { commonMarqueeApi: e } = Qa();
|
|
28405
28406
|
return oe({
|
|
28406
28407
|
queryKey: ["getMarqueeList"],
|
|
28407
28408
|
queryFn: async () => e(),
|
|
@@ -28421,9 +28422,14 @@ const al = /* @__PURE__ */ Si(el), I = {
|
|
|
28421
28422
|
mutationFn: async () => n(),
|
|
28422
28423
|
...e
|
|
28423
28424
|
});
|
|
28424
|
-
}, Cl = (
|
|
28425
|
-
|
|
28426
|
-
|
|
28425
|
+
}, Cl = ({
|
|
28426
|
+
options: e = {
|
|
28427
|
+
login: {},
|
|
28428
|
+
logout: {}
|
|
28429
|
+
}
|
|
28430
|
+
} = {}) => {
|
|
28431
|
+
const n = ll({ options: e.login }), d = tl({ options: e.logout });
|
|
28432
|
+
return { login: n, logout: d };
|
|
28427
28433
|
};
|
|
28428
28434
|
export {
|
|
28429
28435
|
Za as ApiCtx,
|