@obb871001/api-integration-sdk 1.0.48 → 1.0.50
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 +7 -7
- package/dist/index.js +658 -627
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { QueryClient as
|
|
3
|
-
import
|
|
4
|
-
import { get as
|
|
5
|
-
import
|
|
6
|
-
function
|
|
1
|
+
import be, { createContext as ut, useContext as ct, useMemo as He, useCallback as oe, useRef as fr, useEffect as we } from "react";
|
|
2
|
+
import { QueryClient as it, QueryClientProvider as st, useQueries as kr, useQuery as he } from "@tanstack/react-query";
|
|
3
|
+
import lt from "axios";
|
|
4
|
+
import { get as Ae } from "lodash";
|
|
5
|
+
import ft from "react-dom";
|
|
6
|
+
function vt(r) {
|
|
7
7
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
var r =
|
|
15
|
-
function
|
|
9
|
+
var Pe = { exports: {} }, Ee = {};
|
|
10
|
+
var vr;
|
|
11
|
+
function dt() {
|
|
12
|
+
if (vr) return Ee;
|
|
13
|
+
vr = 1;
|
|
14
|
+
var r = be, S = Symbol.for("react.element"), O = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, f = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function y(E, c, s) {
|
|
16
16
|
var o, a = {}, i = null, t = null;
|
|
17
|
-
|
|
18
|
-
for (o in c)
|
|
19
|
-
if (
|
|
20
|
-
return { $$typeof:
|
|
17
|
+
s !== void 0 && (i = "" + s), c.key !== void 0 && (i = "" + c.key), c.ref !== void 0 && (t = c.ref);
|
|
18
|
+
for (o in c) d.call(c, o) && !_.hasOwnProperty(o) && (a[o] = c[o]);
|
|
19
|
+
if (E && E.defaultProps) for (o in c = E.defaultProps, c) a[o] === void 0 && (a[o] = c[o]);
|
|
20
|
+
return { $$typeof: S, type: E, key: i, ref: t, props: a, _owner: f.current };
|
|
21
21
|
}
|
|
22
|
-
return Ee.Fragment = O, Ee.jsx =
|
|
22
|
+
return Ee.Fragment = O, Ee.jsx = y, Ee.jsxs = y, Ee;
|
|
23
23
|
}
|
|
24
24
|
var _e = {};
|
|
25
|
-
var
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
var r =
|
|
25
|
+
var dr;
|
|
26
|
+
function Et() {
|
|
27
|
+
return dr || (dr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
+
var r = be, S = Symbol.for("react.element"), O = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), E = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), o = Symbol.for("react.suspense_list"), a = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), n = Symbol.iterator, v = "@@iterator";
|
|
29
29
|
function h(e) {
|
|
30
30
|
if (e === null || typeof e != "object")
|
|
31
31
|
return null;
|
|
32
|
-
var
|
|
33
|
-
return typeof
|
|
32
|
+
var l = n && e[n] || e[v];
|
|
33
|
+
return typeof l == "function" ? l : null;
|
|
34
34
|
}
|
|
35
35
|
var u = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36
36
|
function b(e) {
|
|
37
37
|
{
|
|
38
|
-
for (var
|
|
39
|
-
g[
|
|
40
|
-
|
|
38
|
+
for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0), m = 1; m < l; m++)
|
|
39
|
+
g[m - 1] = arguments[m];
|
|
40
|
+
R("error", e, g);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function R(e, l, g) {
|
|
44
44
|
{
|
|
45
|
-
var
|
|
46
|
-
w !== "" && (
|
|
47
|
-
var
|
|
48
|
-
return String(
|
|
45
|
+
var m = u.ReactDebugCurrentFrame, w = m.getStackAddendum();
|
|
46
|
+
w !== "" && (l += "%s", g = g.concat([w]));
|
|
47
|
+
var I = g.map(function(C) {
|
|
48
|
+
return String(C);
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
I.unshift("Warning: " + l), Function.prototype.apply.call(console[e], console, I);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var P = !1,
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
53
|
+
var P = !1, p = !1, A = !1, k = !1, le = !1, fe;
|
|
54
|
+
fe = Symbol.for("react.module.reference");
|
|
55
|
+
function Ne(e) {
|
|
56
|
+
return !!(typeof e == "string" || typeof e == "function" || e === d || e === _ || le || e === f || e === s || e === o || k || e === t || P || p || A || typeof e == "object" && e !== null && (e.$$typeof === i || e.$$typeof === a || e.$$typeof === y || e.$$typeof === E || e.$$typeof === c || // 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.
|
|
60
|
-
e.$$typeof ===
|
|
60
|
+
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
if (
|
|
65
|
-
return
|
|
66
|
-
var w =
|
|
62
|
+
function ge(e, l, g) {
|
|
63
|
+
var m = e.displayName;
|
|
64
|
+
if (m)
|
|
65
|
+
return m;
|
|
66
|
+
var w = l.displayName || l.name || "";
|
|
67
67
|
return w !== "" ? g + "(" + w + ")" : g;
|
|
68
68
|
}
|
|
69
69
|
function J(e) {
|
|
70
70
|
return e.displayName || "Context";
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function D(e) {
|
|
73
73
|
if (e == null)
|
|
74
74
|
return null;
|
|
75
75
|
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -77,7 +77,7 @@ function vt() {
|
|
|
77
77
|
if (typeof e == "string")
|
|
78
78
|
return e;
|
|
79
79
|
switch (e) {
|
|
80
|
-
case
|
|
80
|
+
case d:
|
|
81
81
|
return "Fragment";
|
|
82
82
|
case O:
|
|
83
83
|
return "Portal";
|
|
@@ -85,28 +85,28 @@ function vt() {
|
|
|
85
85
|
return "Profiler";
|
|
86
86
|
case f:
|
|
87
87
|
return "StrictMode";
|
|
88
|
-
case
|
|
88
|
+
case s:
|
|
89
89
|
return "Suspense";
|
|
90
90
|
case o:
|
|
91
91
|
return "SuspenseList";
|
|
92
92
|
}
|
|
93
93
|
if (typeof e == "object")
|
|
94
94
|
switch (e.$$typeof) {
|
|
95
|
-
case
|
|
96
|
-
var
|
|
97
|
-
return J(
|
|
98
|
-
case
|
|
95
|
+
case E:
|
|
96
|
+
var l = e;
|
|
97
|
+
return J(l) + ".Consumer";
|
|
98
|
+
case y:
|
|
99
99
|
var g = e;
|
|
100
100
|
return J(g._context) + ".Provider";
|
|
101
101
|
case c:
|
|
102
|
-
return
|
|
102
|
+
return ge(e, e.render, "ForwardRef");
|
|
103
103
|
case a:
|
|
104
|
-
var
|
|
105
|
-
return
|
|
104
|
+
var m = e.displayName || null;
|
|
105
|
+
return m !== null ? m : D(e.type) || "Memo";
|
|
106
106
|
case i: {
|
|
107
|
-
var w = e,
|
|
107
|
+
var w = e, I = w._payload, C = w._init;
|
|
108
108
|
try {
|
|
109
|
-
return
|
|
109
|
+
return D(C(I));
|
|
110
110
|
} catch {
|
|
111
111
|
return null;
|
|
112
112
|
}
|
|
@@ -114,14 +114,14 @@ function vt() {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var G = Object.assign, X = 0, $,
|
|
117
|
+
var G = Object.assign, X = 0, $, Oe, me, L, j, B, ve;
|
|
118
118
|
function Z() {
|
|
119
119
|
}
|
|
120
120
|
Z.__reactDisabledLog = !0;
|
|
121
121
|
function z() {
|
|
122
122
|
{
|
|
123
123
|
if (X === 0) {
|
|
124
|
-
$ = console.log,
|
|
124
|
+
$ = console.log, Oe = console.info, me = console.warn, L = console.error, j = console.group, B = console.groupCollapsed, ve = console.groupEnd;
|
|
125
125
|
var e = {
|
|
126
126
|
configurable: !0,
|
|
127
127
|
enumerable: !0,
|
|
@@ -154,13 +154,13 @@ function vt() {
|
|
|
154
154
|
value: $
|
|
155
155
|
}),
|
|
156
156
|
info: G({}, e, {
|
|
157
|
-
value:
|
|
157
|
+
value: Oe
|
|
158
158
|
}),
|
|
159
159
|
warn: G({}, e, {
|
|
160
|
-
value:
|
|
160
|
+
value: me
|
|
161
161
|
}),
|
|
162
162
|
error: G({}, e, {
|
|
163
|
-
value:
|
|
163
|
+
value: L
|
|
164
164
|
}),
|
|
165
165
|
group: G({}, e, {
|
|
166
166
|
value: j
|
|
@@ -169,82 +169,82 @@ function vt() {
|
|
|
169
169
|
value: B
|
|
170
170
|
}),
|
|
171
171
|
groupEnd: G({}, e, {
|
|
172
|
-
value:
|
|
172
|
+
value: ve
|
|
173
173
|
})
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
X < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
var
|
|
180
|
-
function
|
|
179
|
+
var ue = u.ReactCurrentDispatcher, Y;
|
|
180
|
+
function ce(e, l, g) {
|
|
181
181
|
{
|
|
182
182
|
if (Y === void 0)
|
|
183
183
|
try {
|
|
184
184
|
throw Error();
|
|
185
185
|
} catch (w) {
|
|
186
|
-
var
|
|
187
|
-
Y =
|
|
186
|
+
var m = w.stack.trim().match(/\n( *(at )?)/);
|
|
187
|
+
Y = m && m[1] || "";
|
|
188
188
|
}
|
|
189
189
|
return `
|
|
190
190
|
` + Y + e;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var ee = !1,
|
|
193
|
+
var ee = !1, Te;
|
|
194
194
|
{
|
|
195
|
-
var
|
|
196
|
-
|
|
195
|
+
var Dr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
196
|
+
Te = new Dr();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Qe(e, l) {
|
|
199
199
|
if (!e || ee)
|
|
200
200
|
return "";
|
|
201
201
|
{
|
|
202
|
-
var g =
|
|
202
|
+
var g = Te.get(e);
|
|
203
203
|
if (g !== void 0)
|
|
204
204
|
return g;
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var m;
|
|
207
207
|
ee = !0;
|
|
208
208
|
var w = Error.prepareStackTrace;
|
|
209
209
|
Error.prepareStackTrace = void 0;
|
|
210
|
-
var
|
|
211
|
-
|
|
210
|
+
var I;
|
|
211
|
+
I = ue.current, ue.current = null, z();
|
|
212
212
|
try {
|
|
213
|
-
if (
|
|
214
|
-
var
|
|
213
|
+
if (l) {
|
|
214
|
+
var C = function() {
|
|
215
215
|
throw Error();
|
|
216
216
|
};
|
|
217
|
-
if (Object.defineProperty(
|
|
217
|
+
if (Object.defineProperty(C.prototype, "props", {
|
|
218
218
|
set: function() {
|
|
219
219
|
throw Error();
|
|
220
220
|
}
|
|
221
221
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
222
222
|
try {
|
|
223
|
-
Reflect.construct(
|
|
223
|
+
Reflect.construct(C, []);
|
|
224
224
|
} catch (W) {
|
|
225
|
-
|
|
225
|
+
m = W;
|
|
226
226
|
}
|
|
227
|
-
Reflect.construct(e, [],
|
|
227
|
+
Reflect.construct(e, [], C);
|
|
228
228
|
} else {
|
|
229
229
|
try {
|
|
230
|
-
|
|
230
|
+
C.call();
|
|
231
231
|
} catch (W) {
|
|
232
|
-
|
|
232
|
+
m = W;
|
|
233
233
|
}
|
|
234
|
-
e.call(
|
|
234
|
+
e.call(C.prototype);
|
|
235
235
|
}
|
|
236
236
|
} else {
|
|
237
237
|
try {
|
|
238
238
|
throw Error();
|
|
239
239
|
} catch (W) {
|
|
240
|
-
|
|
240
|
+
m = W;
|
|
241
241
|
}
|
|
242
242
|
e();
|
|
243
243
|
}
|
|
244
244
|
} catch (W) {
|
|
245
|
-
if (W &&
|
|
245
|
+
if (W && m && typeof W.stack == "string") {
|
|
246
246
|
for (var T = W.stack.split(`
|
|
247
|
-
`), U =
|
|
247
|
+
`), U = m.stack.split(`
|
|
248
248
|
`), N = T.length - 1, M = U.length - 1; N >= 1 && M >= 0 && T[N] !== U[M]; )
|
|
249
249
|
M--;
|
|
250
250
|
for (; N >= 1 && M >= 0; N--, M--)
|
|
@@ -254,134 +254,134 @@ function vt() {
|
|
|
254
254
|
if (N--, M--, M < 0 || T[N] !== U[M]) {
|
|
255
255
|
var q = `
|
|
256
256
|
` + T[N].replace(" at new ", " at ");
|
|
257
|
-
return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
257
|
+
return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" && Te.set(e, q), q;
|
|
258
258
|
}
|
|
259
259
|
while (N >= 1 && M >= 0);
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
} finally {
|
|
264
|
-
ee = !1,
|
|
264
|
+
ee = !1, ue.current = I, pe(), Error.prepareStackTrace = w;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
return typeof e == "function" &&
|
|
266
|
+
var se = e ? e.displayName || e.name : "", re = se ? ce(se) : "";
|
|
267
|
+
return typeof e == "function" && Te.set(e, re), re;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function jr(e, l, g) {
|
|
270
|
+
return Qe(e, !1);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
var
|
|
274
|
-
return !!(
|
|
272
|
+
function Ur(e) {
|
|
273
|
+
var l = e.prototype;
|
|
274
|
+
return !!(l && l.isReactComponent);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Ce(e, l, g) {
|
|
277
277
|
if (e == null)
|
|
278
278
|
return "";
|
|
279
279
|
if (typeof e == "function")
|
|
280
|
-
return
|
|
280
|
+
return Qe(e, Ur(e));
|
|
281
281
|
if (typeof e == "string")
|
|
282
|
-
return
|
|
282
|
+
return ce(e);
|
|
283
283
|
switch (e) {
|
|
284
|
-
case
|
|
285
|
-
return
|
|
284
|
+
case s:
|
|
285
|
+
return ce("Suspense");
|
|
286
286
|
case o:
|
|
287
|
-
return
|
|
287
|
+
return ce("SuspenseList");
|
|
288
288
|
}
|
|
289
289
|
if (typeof e == "object")
|
|
290
290
|
switch (e.$$typeof) {
|
|
291
291
|
case c:
|
|
292
|
-
return
|
|
292
|
+
return jr(e.render);
|
|
293
293
|
case a:
|
|
294
|
-
return
|
|
294
|
+
return Ce(e.type, l, g);
|
|
295
295
|
case i: {
|
|
296
|
-
var
|
|
296
|
+
var m = e, w = m._payload, I = m._init;
|
|
297
297
|
try {
|
|
298
|
-
return
|
|
298
|
+
return Ce(I(w), l, g);
|
|
299
299
|
} catch {
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
return "";
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var de = Object.prototype.hasOwnProperty, ze = {}, Xe = u.ReactDebugCurrentFrame;
|
|
306
306
|
function Re(e) {
|
|
307
307
|
if (e) {
|
|
308
|
-
var
|
|
309
|
-
|
|
308
|
+
var l = e._owner, g = Ce(e.type, e._source, l ? l.type : null);
|
|
309
|
+
Xe.setExtraStackFrame(g);
|
|
310
310
|
} else
|
|
311
|
-
|
|
311
|
+
Xe.setExtraStackFrame(null);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Wr(e, l, g, m, w) {
|
|
314
314
|
{
|
|
315
|
-
var
|
|
316
|
-
for (var
|
|
317
|
-
if (
|
|
315
|
+
var I = Function.call.bind(de);
|
|
316
|
+
for (var C in e)
|
|
317
|
+
if (I(e, C)) {
|
|
318
318
|
var T = void 0;
|
|
319
319
|
try {
|
|
320
|
-
if (typeof e[
|
|
321
|
-
var U = Error((
|
|
320
|
+
if (typeof e[C] != "function") {
|
|
321
|
+
var U = Error((m || "React class") + ": " + g + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
322
322
|
throw U.name = "Invariant Violation", U;
|
|
323
323
|
}
|
|
324
|
-
T = e[
|
|
324
|
+
T = e[C](l, C, m, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
325
325
|
} catch (N) {
|
|
326
326
|
T = N;
|
|
327
327
|
}
|
|
328
|
-
T && !(T instanceof Error) && (Re(w), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",
|
|
328
|
+
T && !(T instanceof Error) && (Re(w), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", g, C, typeof T), Re(null)), T instanceof Error && !(T.message in ze) && (ze[T.message] = !0, Re(w), b("Failed %s type: %s", g, T.message), Re(null));
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
334
|
-
return
|
|
332
|
+
var Fr = Array.isArray;
|
|
333
|
+
function Me(e) {
|
|
334
|
+
return Fr(e);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function qr(e) {
|
|
337
337
|
{
|
|
338
|
-
var
|
|
338
|
+
var l = typeof Symbol == "function" && Symbol.toStringTag, g = l && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
339
339
|
return g;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Gr(e) {
|
|
343
343
|
try {
|
|
344
|
-
return
|
|
344
|
+
return Ze(e), !1;
|
|
345
345
|
} catch {
|
|
346
346
|
return !0;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Ze(e) {
|
|
350
350
|
return "" + e;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
if (
|
|
354
|
-
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
352
|
+
function er(e) {
|
|
353
|
+
if (Gr(e))
|
|
354
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qr(e)), Ze(e);
|
|
355
355
|
}
|
|
356
|
-
var
|
|
356
|
+
var rr = u.ReactCurrentOwner, Jr = {
|
|
357
357
|
key: !0,
|
|
358
358
|
ref: !0,
|
|
359
359
|
__self: !0,
|
|
360
360
|
__source: !0
|
|
361
|
-
},
|
|
362
|
-
function
|
|
363
|
-
if (
|
|
364
|
-
var
|
|
365
|
-
if (
|
|
361
|
+
}, tr, nr;
|
|
362
|
+
function Hr(e) {
|
|
363
|
+
if (de.call(e, "ref")) {
|
|
364
|
+
var l = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
365
|
+
if (l && l.isReactWarning)
|
|
366
366
|
return !1;
|
|
367
367
|
}
|
|
368
368
|
return e.ref !== void 0;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
if (
|
|
372
|
-
var
|
|
373
|
-
if (
|
|
370
|
+
function Vr(e) {
|
|
371
|
+
if (de.call(e, "key")) {
|
|
372
|
+
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
373
|
+
if (l && l.isReactWarning)
|
|
374
374
|
return !1;
|
|
375
375
|
}
|
|
376
376
|
return e.key !== void 0;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
typeof e.ref == "string" &&
|
|
378
|
+
function $r(e, l) {
|
|
379
|
+
typeof e.ref == "string" && rr.current;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Br(e, l) {
|
|
382
382
|
{
|
|
383
383
|
var g = function() {
|
|
384
|
-
|
|
384
|
+
tr || (tr = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", l));
|
|
385
385
|
};
|
|
386
386
|
g.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
387
387
|
get: g,
|
|
@@ -389,10 +389,10 @@ function vt() {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Yr(e, l) {
|
|
393
393
|
{
|
|
394
394
|
var g = function() {
|
|
395
|
-
|
|
395
|
+
nr || (nr = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", l));
|
|
396
396
|
};
|
|
397
397
|
g.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
398
398
|
get: g,
|
|
@@ -400,17 +400,17 @@ function vt() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
var
|
|
403
|
+
var Kr = function(e, l, g, m, w, I, C) {
|
|
404
404
|
var T = {
|
|
405
405
|
// This tag allows us to uniquely identify this as a React Element
|
|
406
|
-
$$typeof:
|
|
406
|
+
$$typeof: S,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: e,
|
|
409
|
-
key:
|
|
409
|
+
key: l,
|
|
410
410
|
ref: g,
|
|
411
|
-
props:
|
|
411
|
+
props: C,
|
|
412
412
|
// Record the component responsible for creating this element.
|
|
413
|
-
_owner:
|
|
413
|
+
_owner: I
|
|
414
414
|
};
|
|
415
415
|
return T._store = {}, Object.defineProperty(T._store, "validated", {
|
|
416
416
|
configurable: !1,
|
|
@@ -421,7 +421,7 @@ function vt() {
|
|
|
421
421
|
configurable: !1,
|
|
422
422
|
enumerable: !1,
|
|
423
423
|
writable: !1,
|
|
424
|
-
value:
|
|
424
|
+
value: m
|
|
425
425
|
}), Object.defineProperty(T, "_source", {
|
|
426
426
|
configurable: !1,
|
|
427
427
|
enumerable: !1,
|
|
@@ -429,41 +429,41 @@ function vt() {
|
|
|
429
429
|
value: w
|
|
430
430
|
}), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
|
|
431
431
|
};
|
|
432
|
-
function
|
|
432
|
+
function xr(e, l, g, m, w) {
|
|
433
433
|
{
|
|
434
|
-
var
|
|
435
|
-
g !== void 0 && (
|
|
436
|
-
for (
|
|
437
|
-
|
|
434
|
+
var I, C = {}, T = null, U = null;
|
|
435
|
+
g !== void 0 && (er(g), T = "" + g), Vr(l) && (er(l.key), T = "" + l.key), Hr(l) && (U = l.ref, $r(l, w));
|
|
436
|
+
for (I in l)
|
|
437
|
+
de.call(l, I) && !Jr.hasOwnProperty(I) && (C[I] = l[I]);
|
|
438
438
|
if (e && e.defaultProps) {
|
|
439
439
|
var N = e.defaultProps;
|
|
440
|
-
for (
|
|
441
|
-
|
|
440
|
+
for (I in N)
|
|
441
|
+
C[I] === void 0 && (C[I] = N[I]);
|
|
442
442
|
}
|
|
443
443
|
if (T || U) {
|
|
444
444
|
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
445
|
-
T &&
|
|
445
|
+
T && Br(C, M), U && Yr(C, M);
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return Kr(e, T, U, w, m, rr.current, C);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
var
|
|
451
|
-
function
|
|
450
|
+
var Le = u.ReactCurrentOwner, ar = u.ReactDebugCurrentFrame;
|
|
451
|
+
function ie(e) {
|
|
452
452
|
if (e) {
|
|
453
|
-
var
|
|
454
|
-
|
|
453
|
+
var l = e._owner, g = Ce(e.type, e._source, l ? l.type : null);
|
|
454
|
+
ar.setExtraStackFrame(g);
|
|
455
455
|
} else
|
|
456
|
-
|
|
456
|
+
ar.setExtraStackFrame(null);
|
|
457
457
|
}
|
|
458
|
-
var
|
|
459
|
-
|
|
460
|
-
function
|
|
461
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
458
|
+
var De;
|
|
459
|
+
De = !1;
|
|
460
|
+
function je(e) {
|
|
461
|
+
return typeof e == "object" && e !== null && e.$$typeof === S;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function or() {
|
|
464
464
|
{
|
|
465
|
-
if (
|
|
466
|
-
var e =
|
|
465
|
+
if (Le.current) {
|
|
466
|
+
var e = D(Le.current.type);
|
|
467
467
|
if (e)
|
|
468
468
|
return `
|
|
469
469
|
|
|
@@ -472,184 +472,185 @@ Check the render method of \`` + e + "`.";
|
|
|
472
472
|
return "";
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Qr(e) {
|
|
476
476
|
return "";
|
|
477
477
|
}
|
|
478
|
-
var
|
|
479
|
-
function
|
|
478
|
+
var ur = {};
|
|
479
|
+
function zr(e) {
|
|
480
480
|
{
|
|
481
|
-
var
|
|
482
|
-
if (!
|
|
481
|
+
var l = or();
|
|
482
|
+
if (!l) {
|
|
483
483
|
var g = typeof e == "string" ? e : e.displayName || e.name;
|
|
484
|
-
g && (
|
|
484
|
+
g && (l = `
|
|
485
485
|
|
|
486
486
|
Check the top-level render call using <` + g + ">.");
|
|
487
487
|
}
|
|
488
|
-
return
|
|
488
|
+
return l;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function cr(e, l) {
|
|
492
492
|
{
|
|
493
493
|
if (!e._store || e._store.validated || e.key != null)
|
|
494
494
|
return;
|
|
495
495
|
e._store.validated = !0;
|
|
496
|
-
var g =
|
|
497
|
-
if (
|
|
496
|
+
var g = zr(l);
|
|
497
|
+
if (ur[g])
|
|
498
498
|
return;
|
|
499
|
-
|
|
500
|
-
var
|
|
501
|
-
e && e._owner && e._owner !==
|
|
499
|
+
ur[g] = !0;
|
|
500
|
+
var m = "";
|
|
501
|
+
e && e._owner && e._owner !== Le.current && (m = " It was passed a child from " + D(e._owner.type) + "."), ie(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, m), ie(null);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function ir(e, l) {
|
|
505
505
|
{
|
|
506
506
|
if (typeof e != "object")
|
|
507
507
|
return;
|
|
508
|
-
if (
|
|
508
|
+
if (Me(e))
|
|
509
509
|
for (var g = 0; g < e.length; g++) {
|
|
510
|
-
var
|
|
511
|
-
|
|
510
|
+
var m = e[g];
|
|
511
|
+
je(m) && cr(m, l);
|
|
512
512
|
}
|
|
513
|
-
else if (
|
|
513
|
+
else if (je(e))
|
|
514
514
|
e._store && (e._store.validated = !0);
|
|
515
515
|
else if (e) {
|
|
516
516
|
var w = h(e);
|
|
517
517
|
if (typeof w == "function" && w !== e.entries)
|
|
518
|
-
for (var
|
|
519
|
-
|
|
518
|
+
for (var I = w.call(e), C; !(C = I.next()).done; )
|
|
519
|
+
je(C.value) && cr(C.value, l);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Xr(e) {
|
|
524
524
|
{
|
|
525
|
-
var
|
|
526
|
-
if (
|
|
525
|
+
var l = e.type;
|
|
526
|
+
if (l == null || typeof l == "string")
|
|
527
527
|
return;
|
|
528
528
|
var g;
|
|
529
|
-
if (typeof
|
|
530
|
-
g =
|
|
531
|
-
else if (typeof
|
|
529
|
+
if (typeof l == "function")
|
|
530
|
+
g = l.propTypes;
|
|
531
|
+
else if (typeof l == "object" && (l.$$typeof === c || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
|
-
|
|
534
|
-
g =
|
|
533
|
+
l.$$typeof === a))
|
|
534
|
+
g = l.propTypes;
|
|
535
535
|
else
|
|
536
536
|
return;
|
|
537
537
|
if (g) {
|
|
538
|
-
var
|
|
539
|
-
|
|
540
|
-
} else if (
|
|
541
|
-
|
|
542
|
-
var w =
|
|
538
|
+
var m = D(l);
|
|
539
|
+
Wr(g, e.props, "prop", m, e);
|
|
540
|
+
} else if (l.PropTypes !== void 0 && !De) {
|
|
541
|
+
De = !0;
|
|
542
|
+
var w = D(l);
|
|
543
543
|
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
544
544
|
}
|
|
545
|
-
typeof
|
|
545
|
+
typeof l.getDefaultProps == "function" && !l.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Zr(e) {
|
|
549
549
|
{
|
|
550
|
-
for (var
|
|
551
|
-
var
|
|
552
|
-
if (
|
|
553
|
-
|
|
550
|
+
for (var l = Object.keys(e.props), g = 0; g < l.length; g++) {
|
|
551
|
+
var m = l[g];
|
|
552
|
+
if (m !== "children" && m !== "key") {
|
|
553
|
+
ie(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), ie(null);
|
|
554
554
|
break;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
e.ref !== null && (
|
|
557
|
+
e.ref !== null && (ie(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), ie(null));
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
var
|
|
561
|
-
function
|
|
560
|
+
var sr = {};
|
|
561
|
+
function lr(e, l, g, m, w, I) {
|
|
562
562
|
{
|
|
563
|
-
var
|
|
564
|
-
if (!
|
|
563
|
+
var C = Ne(e);
|
|
564
|
+
if (!C) {
|
|
565
565
|
var T = "";
|
|
566
566
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
567
|
-
var U =
|
|
568
|
-
U ? T += U : T +=
|
|
567
|
+
var U = Qr();
|
|
568
|
+
U ? T += U : T += or();
|
|
569
569
|
var N;
|
|
570
|
-
e === null ? N = "null" :
|
|
570
|
+
e === null ? N = "null" : Me(e) ? N = "array" : e !== void 0 && e.$$typeof === S ? (N = "<" + (D(e.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, T);
|
|
571
571
|
}
|
|
572
|
-
var M =
|
|
572
|
+
var M = xr(e, l, g, w, I);
|
|
573
573
|
if (M == null)
|
|
574
574
|
return M;
|
|
575
|
-
if (
|
|
576
|
-
var q =
|
|
575
|
+
if (C) {
|
|
576
|
+
var q = l.children;
|
|
577
577
|
if (q !== void 0)
|
|
578
|
-
if (
|
|
579
|
-
if (
|
|
580
|
-
for (var
|
|
581
|
-
|
|
578
|
+
if (m)
|
|
579
|
+
if (Me(q)) {
|
|
580
|
+
for (var se = 0; se < q.length; se++)
|
|
581
|
+
ir(q[se], e);
|
|
582
582
|
Object.freeze && Object.freeze(q);
|
|
583
583
|
} else
|
|
584
584
|
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
585
585
|
else
|
|
586
|
-
|
|
586
|
+
ir(q, e);
|
|
587
587
|
}
|
|
588
|
-
if (
|
|
589
|
-
var re =
|
|
590
|
-
return
|
|
591
|
-
}),
|
|
592
|
-
if (!
|
|
593
|
-
var
|
|
588
|
+
if (de.call(l, "key")) {
|
|
589
|
+
var re = D(e), W = Object.keys(l).filter(function(ot) {
|
|
590
|
+
return ot !== "key";
|
|
591
|
+
}), Ue = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
592
|
+
if (!sr[re + Ue]) {
|
|
593
|
+
var at = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
594
594
|
b(`A props object containing a "key" prop is being spread into JSX:
|
|
595
595
|
let props = %s;
|
|
596
596
|
<%s {...props} />
|
|
597
597
|
React keys must be passed directly to JSX without using spread:
|
|
598
598
|
let props = %s;
|
|
599
|
-
<%s key={someKey} {...props} />`,
|
|
599
|
+
<%s key={someKey} {...props} />`, Ue, re, at, re), sr[re + Ue] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return e ===
|
|
602
|
+
return e === d ? Zr(M) : Xr(M), M;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
return
|
|
605
|
+
function et(e, l, g) {
|
|
606
|
+
return lr(e, l, g, !0);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
608
|
+
function rt(e, l, g) {
|
|
609
|
+
return lr(e, l, g, !1);
|
|
610
610
|
}
|
|
611
|
-
var
|
|
612
|
-
_e.Fragment =
|
|
611
|
+
var tt = rt, nt = et;
|
|
612
|
+
_e.Fragment = d, _e.jsx = tt, _e.jsxs = nt;
|
|
613
613
|
})()), _e;
|
|
614
614
|
}
|
|
615
|
-
var
|
|
616
|
-
function
|
|
617
|
-
return
|
|
615
|
+
var Er;
|
|
616
|
+
function _t() {
|
|
617
|
+
return Er || (Er = 1, process.env.NODE_ENV === "production" ? Pe.exports = dt() : Pe.exports = Et()), Pe.exports;
|
|
618
618
|
}
|
|
619
|
-
var
|
|
620
|
-
const
|
|
621
|
-
const r =
|
|
619
|
+
var _r = _t();
|
|
620
|
+
const Nr = ut(null), ke = () => {
|
|
621
|
+
const r = ct(Nr);
|
|
622
622
|
if (!r)
|
|
623
623
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
624
624
|
return r;
|
|
625
625
|
};
|
|
626
|
-
function
|
|
626
|
+
function yt({
|
|
627
627
|
baseURL: r,
|
|
628
|
-
getToken:
|
|
628
|
+
getToken: S,
|
|
629
629
|
timeoutMs: O = 15e3,
|
|
630
|
-
|
|
631
|
-
|
|
630
|
+
lng: d = "tw",
|
|
631
|
+
store: f,
|
|
632
632
|
onError: _
|
|
633
633
|
} = {}) {
|
|
634
|
-
const
|
|
634
|
+
const y = lt.create({
|
|
635
635
|
baseURL: r,
|
|
636
636
|
timeout: O,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
|
-
return
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
|
|
639
|
+
return y.interceptors.request.use(async (E) => {
|
|
640
|
+
if (E.headers = E.headers || {}, S) {
|
|
641
|
+
const s = await S();
|
|
642
|
+
s && (E.headers.Authorization = `Bearer ${s}`);
|
|
643
643
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
(
|
|
648
|
-
|
|
644
|
+
const c = f?.getState()?.isWalletCurrency;
|
|
645
|
+
return E.headers.Currency = c, E.headers["currency-code"] = c, E.headers.lang = d, E;
|
|
646
|
+
}), y.interceptors.response.use(
|
|
647
|
+
(E) => E.data,
|
|
648
|
+
(E) => _ ? _(E, { instance: y }) : Promise.reject(E)
|
|
649
|
+
), y;
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
-
const O =
|
|
652
|
-
() => new
|
|
651
|
+
function Mt({ children: r, ...S }) {
|
|
652
|
+
const O = He(() => yt(S), [S]), f = He(
|
|
653
|
+
() => new it({
|
|
653
654
|
defaultOptions: {
|
|
654
655
|
queries: {
|
|
655
656
|
refetchOnWindowFocus: !1,
|
|
@@ -659,60 +660,54 @@ function It({ children: r, ...y }) {
|
|
|
659
660
|
}),
|
|
660
661
|
[]
|
|
661
662
|
);
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ _r.jsx(st, { client: f, children: /* @__PURE__ */ _r.jsx(Nr.Provider, { value: { client: O, ...S }, children: r }) });
|
|
663
664
|
}
|
|
664
|
-
const
|
|
665
|
-
const r = (
|
|
665
|
+
const Lt = () => {
|
|
666
|
+
const r = (d, f) => !d && !f, S = (d) => d.startsWith("pc.");
|
|
666
667
|
return {
|
|
667
668
|
executeLogout: ({
|
|
668
|
-
isCallBackInvalid:
|
|
669
|
+
isCallBackInvalid: d = !1,
|
|
669
670
|
hostname: f = "",
|
|
670
671
|
shouldRedirect: _,
|
|
671
|
-
onShowError:
|
|
672
|
-
onCleanup:
|
|
672
|
+
onShowError: y,
|
|
673
|
+
onCleanup: E,
|
|
673
674
|
onRemoveToken: c,
|
|
674
|
-
onRedirect:
|
|
675
|
+
onRedirect: s,
|
|
675
676
|
onGoogleLogout: o
|
|
676
677
|
}) => {
|
|
677
|
-
const a =
|
|
678
|
-
r(
|
|
678
|
+
const a = S(f);
|
|
679
|
+
r(d, a) && y?.(), E?.(), c?.(), _ && s?.("/"), o?.();
|
|
679
680
|
},
|
|
680
681
|
shouldShowErrorNotice: r,
|
|
681
|
-
isMachineDomain:
|
|
682
|
+
isMachineDomain: S
|
|
682
683
|
};
|
|
683
|
-
},
|
|
684
|
-
const { client: r } =
|
|
685
|
-
async (
|
|
686
|
-
const { mac_address:
|
|
687
|
-
mac_address:
|
|
684
|
+
}, Ve = () => {
|
|
685
|
+
const { client: r } = ke(), S = oe(
|
|
686
|
+
async (y) => {
|
|
687
|
+
const { mac_address: E = "", app_version: c = "", anydesk_id: s = "" } = y, { data: o } = await r.post("/cash-register/login", {
|
|
688
|
+
mac_address: E,
|
|
688
689
|
app_version: c,
|
|
689
|
-
anydesk_id:
|
|
690
|
+
anydesk_id: s
|
|
690
691
|
});
|
|
691
692
|
return o;
|
|
692
693
|
},
|
|
693
694
|
[r]
|
|
694
|
-
), O =
|
|
695
|
-
const { data: S } = await r.get("/getGameList");
|
|
696
|
-
return S;
|
|
697
|
-
}, [r]), f = de(async () => await r.get("/member/getNowCurrencyExchange"), [r]), _ = de(async () => {
|
|
698
|
-
const { data: S } = await r.get("/getFavoriteGame");
|
|
699
|
-
return S;
|
|
700
|
-
}, [r]);
|
|
695
|
+
), O = oe(async () => r.get("/member/getMemberInfo"), [r]), d = oe(async () => await r.get("member/getGameList"), [r]), f = oe(async () => await r.get("/member/getNowCurrencyExchange"), [r]), _ = oe(async () => await r.get("member/getFavoriteGame"), [r]);
|
|
701
696
|
return {
|
|
702
|
-
machineLoginApi:
|
|
697
|
+
machineLoginApi: S,
|
|
703
698
|
userInfoApi: O,
|
|
704
|
-
userGameListApi:
|
|
699
|
+
userGameListApi: d,
|
|
705
700
|
userFavoriteGameApi: _,
|
|
706
701
|
userCurrencyExchangeApi: f
|
|
707
702
|
};
|
|
708
|
-
},
|
|
709
|
-
const { userCurrencyExchangeApi: O } =
|
|
710
|
-
return
|
|
703
|
+
}, Dt = ({ otherQueryKey: r = [], options: S = {} } = {}) => {
|
|
704
|
+
const { userCurrencyExchangeApi: O } = Ve(), { getToken: d } = ke(), { enabled: f, ..._ } = S, y = !!d && (f ? f.every((E) => E) : !0);
|
|
705
|
+
return kr({
|
|
711
706
|
queries: [
|
|
712
707
|
{
|
|
713
708
|
queryKey: ["userCurrencyExchange", ...r],
|
|
714
709
|
queryFn: () => O(),
|
|
715
|
-
enabled:
|
|
710
|
+
enabled: y,
|
|
716
711
|
// ← 使用合併後的條件
|
|
717
712
|
..._
|
|
718
713
|
// ← 不包含 enabled
|
|
@@ -720,11 +715,11 @@ const Nt = () => {
|
|
|
720
715
|
]
|
|
721
716
|
});
|
|
722
717
|
};
|
|
723
|
-
var
|
|
718
|
+
var We = {}, F = {}, Fe = {}, yr;
|
|
724
719
|
function V() {
|
|
725
|
-
return
|
|
720
|
+
return yr || (yr = 1, (function(r) {
|
|
726
721
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.isEventSourceSupported = r.isReactNative = r.ReadyState = r.DEFAULT_HEARTBEAT = r.UNPARSABLE_JSON_OBJECT = r.DEFAULT_RECONNECT_INTERVAL_MS = r.DEFAULT_RECONNECT_LIMIT = r.SOCKET_IO_PING_CODE = r.SOCKET_IO_PATH = r.SOCKET_IO_PING_INTERVAL = r.DEFAULT_EVENT_SOURCE_OPTIONS = r.EMPTY_EVENT_HANDLERS = r.DEFAULT_OPTIONS = void 0;
|
|
727
|
-
var
|
|
722
|
+
var S = 1, O = 1e3 * S;
|
|
728
723
|
r.DEFAULT_OPTIONS = {}, r.EMPTY_EVENT_HANDLERS = {}, r.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
729
724
|
withCredentials: !1,
|
|
730
725
|
events: r.EMPTY_EVENT_HANDLERS
|
|
@@ -733,10 +728,10 @@ function V() {
|
|
|
733
728
|
timeout: 6e4,
|
|
734
729
|
interval: 25e3
|
|
735
730
|
};
|
|
736
|
-
var
|
|
731
|
+
var d;
|
|
737
732
|
(function(_) {
|
|
738
733
|
_[_.UNINSTANTIATED = -1] = "UNINSTANTIATED", _[_.CONNECTING = 0] = "CONNECTING", _[_.OPEN = 1] = "OPEN", _[_.CLOSING = 2] = "CLOSING", _[_.CLOSED = 3] = "CLOSED";
|
|
739
|
-
})(
|
|
734
|
+
})(d || (r.ReadyState = d = {}));
|
|
740
735
|
var f = function() {
|
|
741
736
|
try {
|
|
742
737
|
return "EventSource" in globalThis;
|
|
@@ -745,133 +740,133 @@ function V() {
|
|
|
745
740
|
}
|
|
746
741
|
};
|
|
747
742
|
r.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", r.isEventSourceSupported = !r.isReactNative && f();
|
|
748
|
-
})(
|
|
743
|
+
})(Fe)), Fe;
|
|
749
744
|
}
|
|
750
|
-
var
|
|
751
|
-
function
|
|
752
|
-
return
|
|
745
|
+
var ye = {}, qe = {}, Sr;
|
|
746
|
+
function $e() {
|
|
747
|
+
return Sr || (Sr = 1, (function(r) {
|
|
753
748
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetWebSockets = r.sharedWebSockets = void 0, r.sharedWebSockets = {};
|
|
754
|
-
var
|
|
749
|
+
var S = function(O) {
|
|
755
750
|
if (O && r.sharedWebSockets.hasOwnProperty(O))
|
|
756
751
|
delete r.sharedWebSockets[O];
|
|
757
752
|
else
|
|
758
|
-
for (var
|
|
759
|
-
r.sharedWebSockets.hasOwnProperty(
|
|
753
|
+
for (var d in r.sharedWebSockets)
|
|
754
|
+
r.sharedWebSockets.hasOwnProperty(d) && delete r.sharedWebSockets[d];
|
|
760
755
|
};
|
|
761
|
-
r.resetWebSockets =
|
|
762
|
-
})(
|
|
756
|
+
r.resetWebSockets = S;
|
|
757
|
+
})(qe)), qe;
|
|
763
758
|
}
|
|
764
|
-
var te = {}, K = {},
|
|
765
|
-
function
|
|
766
|
-
if (
|
|
767
|
-
|
|
768
|
-
var r = V(),
|
|
759
|
+
var te = {}, K = {}, hr;
|
|
760
|
+
function Be() {
|
|
761
|
+
if (hr) return K;
|
|
762
|
+
hr = 1, Object.defineProperty(K, "__esModule", { value: !0 }), K.setUpSocketIOPing = K.appendQueryParams = K.parseSocketIOUrl = void 0;
|
|
763
|
+
var r = V(), S = function(f) {
|
|
769
764
|
if (f) {
|
|
770
|
-
var _ = /^https|wss/.test(f),
|
|
771
|
-
return "".concat(c, "://").concat(
|
|
765
|
+
var _ = /^https|wss/.test(f), y = f.replace(/^(https?|wss?)(:\/\/)?/, ""), E = y.replace(/\/$/, ""), c = _ ? "wss" : "ws";
|
|
766
|
+
return "".concat(c, "://").concat(E).concat(r.SOCKET_IO_PATH);
|
|
772
767
|
} else if (f === "") {
|
|
773
|
-
var _ = /^https/.test(window.location.protocol), c = _ ? "wss" : "ws",
|
|
774
|
-
return "".concat(c, "://").concat(window.location.hostname).concat(
|
|
768
|
+
var _ = /^https/.test(window.location.protocol), c = _ ? "wss" : "ws", s = window.location.port ? ":".concat(window.location.port) : "";
|
|
769
|
+
return "".concat(c, "://").concat(window.location.hostname).concat(s).concat(r.SOCKET_IO_PATH);
|
|
775
770
|
}
|
|
776
771
|
return f;
|
|
777
772
|
};
|
|
778
|
-
K.parseSocketIOUrl =
|
|
773
|
+
K.parseSocketIOUrl = S;
|
|
779
774
|
var O = function(f, _) {
|
|
780
775
|
_ === void 0 && (_ = {});
|
|
781
|
-
var
|
|
776
|
+
var y = /\?([\w]+=[\w]+)/, E = y.test(f), c = "".concat(Object.entries(_).reduce(function(s, o) {
|
|
782
777
|
var a = o[0], i = o[1];
|
|
783
|
-
return
|
|
778
|
+
return s + "".concat(a, "=").concat(i, "&");
|
|
784
779
|
}, "").slice(0, -1));
|
|
785
|
-
return "".concat(f).concat(
|
|
780
|
+
return "".concat(f).concat(E ? "&" : "?").concat(c);
|
|
786
781
|
};
|
|
787
782
|
K.appendQueryParams = O;
|
|
788
|
-
var
|
|
783
|
+
var d = function(f, _) {
|
|
789
784
|
_ === void 0 && (_ = r.SOCKET_IO_PING_INTERVAL);
|
|
790
|
-
var
|
|
785
|
+
var y = function() {
|
|
791
786
|
return f(r.SOCKET_IO_PING_CODE);
|
|
792
787
|
};
|
|
793
|
-
return window.setInterval(
|
|
788
|
+
return window.setInterval(y, _);
|
|
794
789
|
};
|
|
795
|
-
return K.setUpSocketIOPing =
|
|
790
|
+
return K.setUpSocketIOPing = d, K;
|
|
796
791
|
}
|
|
797
|
-
var
|
|
798
|
-
function
|
|
799
|
-
if (
|
|
800
|
-
|
|
792
|
+
var Ie = {}, br;
|
|
793
|
+
function Mr() {
|
|
794
|
+
if (br) return Ie;
|
|
795
|
+
br = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.heartbeat = O;
|
|
801
796
|
var r = V();
|
|
802
|
-
function
|
|
803
|
-
return Array.isArray(
|
|
797
|
+
function S(d) {
|
|
798
|
+
return Array.isArray(d) ? d.reduce(function(f, _) {
|
|
804
799
|
return f.current > _.current ? f : _;
|
|
805
|
-
}).current :
|
|
800
|
+
}).current : d.current;
|
|
806
801
|
}
|
|
807
|
-
function O(
|
|
808
|
-
var
|
|
809
|
-
var h = Date.now(), u =
|
|
802
|
+
function O(d, f, _) {
|
|
803
|
+
var y = _ || {}, E = y.interval, c = E === void 0 ? r.DEFAULT_HEARTBEAT.interval : E, s = y.timeout, o = s === void 0 ? r.DEFAULT_HEARTBEAT.timeout : s, a = y.message, i = a === void 0 ? r.DEFAULT_HEARTBEAT.message : a, t = Math.max(100, c / 10), n = Date.now(), v = setInterval(function() {
|
|
804
|
+
var h = Date.now(), u = S(f);
|
|
810
805
|
if (u + o <= h)
|
|
811
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(h - u, "ms ago, last ping sent ").concat(h - n, "ms ago")),
|
|
806
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(h - u, "ms ago, last ping sent ").concat(h - n, "ms ago")), d.close();
|
|
812
807
|
else if (u + c <= h && n + c <= h)
|
|
813
808
|
try {
|
|
814
|
-
typeof i == "function" ?
|
|
809
|
+
typeof i == "function" ? d.send(i()) : d.send(i), n = h;
|
|
815
810
|
} catch (b) {
|
|
816
|
-
console.error("Heartbeat failed, closing connection", b instanceof Error ? b.message : b),
|
|
811
|
+
console.error("Heartbeat failed, closing connection", b instanceof Error ? b.message : b), d.close();
|
|
817
812
|
}
|
|
818
813
|
}, t);
|
|
819
|
-
return
|
|
814
|
+
return d.addEventListener("close", function() {
|
|
820
815
|
clearInterval(v);
|
|
821
816
|
}), function() {
|
|
822
817
|
};
|
|
823
818
|
}
|
|
824
|
-
return
|
|
819
|
+
return Ie;
|
|
825
820
|
}
|
|
826
|
-
var
|
|
827
|
-
function
|
|
828
|
-
return
|
|
821
|
+
var Se = {}, Ge = {}, gr;
|
|
822
|
+
function Ye() {
|
|
823
|
+
return gr || (gr = 1, (function(r) {
|
|
829
824
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetSubscribers = r.removeSubscriber = r.addSubscriber = r.hasSubscribers = r.getSubscribers = void 0;
|
|
830
|
-
var
|
|
831
|
-
return (0, r.hasSubscribers)(c) ? Array.from(
|
|
825
|
+
var S = {}, O = [], d = function(c) {
|
|
826
|
+
return (0, r.hasSubscribers)(c) ? Array.from(S[c]) : O;
|
|
832
827
|
};
|
|
833
|
-
r.getSubscribers =
|
|
828
|
+
r.getSubscribers = d;
|
|
834
829
|
var f = function(c) {
|
|
835
|
-
var
|
|
836
|
-
return ((
|
|
830
|
+
var s;
|
|
831
|
+
return ((s = S[c]) === null || s === void 0 ? void 0 : s.size) > 0;
|
|
837
832
|
};
|
|
838
833
|
r.hasSubscribers = f;
|
|
839
|
-
var _ = function(c,
|
|
840
|
-
|
|
834
|
+
var _ = function(c, s) {
|
|
835
|
+
S[c] = S[c] || /* @__PURE__ */ new Set(), S[c].add(s);
|
|
841
836
|
};
|
|
842
837
|
r.addSubscriber = _;
|
|
843
|
-
var
|
|
844
|
-
|
|
838
|
+
var y = function(c, s) {
|
|
839
|
+
S[c].delete(s);
|
|
845
840
|
};
|
|
846
|
-
r.removeSubscriber =
|
|
847
|
-
var
|
|
848
|
-
if (c &&
|
|
849
|
-
delete
|
|
841
|
+
r.removeSubscriber = y;
|
|
842
|
+
var E = function(c) {
|
|
843
|
+
if (c && S.hasOwnProperty(c))
|
|
844
|
+
delete S[c];
|
|
850
845
|
else
|
|
851
|
-
for (var
|
|
852
|
-
|
|
846
|
+
for (var s in S)
|
|
847
|
+
S.hasOwnProperty(s) && delete S[s];
|
|
853
848
|
};
|
|
854
|
-
r.resetSubscribers =
|
|
855
|
-
})(
|
|
849
|
+
r.resetSubscribers = E;
|
|
850
|
+
})(Ge)), Ge;
|
|
856
851
|
}
|
|
857
|
-
var
|
|
858
|
-
function
|
|
859
|
-
if (
|
|
860
|
-
|
|
861
|
-
var r =
|
|
852
|
+
var Or;
|
|
853
|
+
function Ke() {
|
|
854
|
+
if (Or) return Se;
|
|
855
|
+
Or = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.assertIsWebSocket = O, Se.resetGlobalState = d;
|
|
856
|
+
var r = $e(), S = Ye();
|
|
862
857
|
function O(f, _) {
|
|
863
858
|
if (!_ && !(f instanceof WebSocket))
|
|
864
859
|
throw new Error("");
|
|
865
860
|
}
|
|
866
|
-
function
|
|
867
|
-
(0,
|
|
861
|
+
function d(f) {
|
|
862
|
+
(0, S.resetSubscribers)(f), (0, r.resetWebSockets)(f);
|
|
868
863
|
}
|
|
869
|
-
return
|
|
864
|
+
return Se;
|
|
870
865
|
}
|
|
871
|
-
var
|
|
872
|
-
function
|
|
873
|
-
if (
|
|
874
|
-
|
|
866
|
+
var mr;
|
|
867
|
+
function St() {
|
|
868
|
+
if (mr) return te;
|
|
869
|
+
mr = 1;
|
|
875
870
|
var r = te && te.__assign || function() {
|
|
876
871
|
return r = Object.assign || function(o) {
|
|
877
872
|
for (var a, i = 1, t = arguments.length; i < t; i++) {
|
|
@@ -882,33 +877,33 @@ function _t() {
|
|
|
882
877
|
}, r.apply(this, arguments);
|
|
883
878
|
};
|
|
884
879
|
Object.defineProperty(te, "__esModule", { value: !0 }), te.attachListeners = void 0;
|
|
885
|
-
var
|
|
880
|
+
var S = Be(), O = Mr(), d = V(), f = Ke(), _ = function(o, a, i, t) {
|
|
886
881
|
o.onmessage = function(n) {
|
|
887
882
|
var v;
|
|
888
883
|
a.current.onMessage && a.current.onMessage(n), typeof t?.current == "number" && (t.current = Date.now()), !(typeof a.current.filter == "function" && a.current.filter(n) !== !0) && (a.current.heartbeat && typeof a.current.heartbeat != "boolean" && ((v = a.current.heartbeat) === null || v === void 0 ? void 0 : v.returnMessage) === n.data || i(n));
|
|
889
884
|
};
|
|
890
|
-
},
|
|
885
|
+
}, y = function(o, a, i, t, n) {
|
|
891
886
|
o.onopen = function(v) {
|
|
892
|
-
if (a.current.onOpen && a.current.onOpen(v), t.current = 0, i(
|
|
887
|
+
if (a.current.onOpen && a.current.onOpen(v), t.current = 0, i(d.ReadyState.OPEN), a.current.heartbeat && o instanceof WebSocket) {
|
|
893
888
|
var h = typeof a.current.heartbeat == "boolean" ? void 0 : a.current.heartbeat;
|
|
894
889
|
n.current = Date.now(), (0, O.heartbeat)(o, n, h);
|
|
895
890
|
}
|
|
896
891
|
};
|
|
897
|
-
},
|
|
898
|
-
if (
|
|
892
|
+
}, E = function(o, a, i, t, n) {
|
|
893
|
+
if (d.isEventSourceSupported && o instanceof EventSource)
|
|
899
894
|
return function() {
|
|
900
895
|
};
|
|
901
896
|
(0, f.assertIsWebSocket)(o, a.current.skipAssert);
|
|
902
897
|
var v;
|
|
903
898
|
return o.onclose = function(h) {
|
|
904
899
|
var u;
|
|
905
|
-
if (a.current.onClose && a.current.onClose(h), i(
|
|
906
|
-
var b = (u = a.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
900
|
+
if (a.current.onClose && a.current.onClose(h), i(d.ReadyState.CLOSED), a.current.shouldReconnect && a.current.shouldReconnect(h)) {
|
|
901
|
+
var b = (u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : d.DEFAULT_RECONNECT_LIMIT;
|
|
907
902
|
if (n.current < b) {
|
|
908
|
-
var
|
|
903
|
+
var R = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
|
|
909
904
|
v = window.setTimeout(function() {
|
|
910
905
|
n.current++, t();
|
|
911
|
-
},
|
|
906
|
+
}, R ?? d.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
912
907
|
} else
|
|
913
908
|
a.current.onReconnectStop && a.current.onReconnectStop(b), console.warn("Max reconnect attempts of ".concat(b, " exceeded"));
|
|
914
909
|
}
|
|
@@ -919,29 +914,29 @@ function _t() {
|
|
|
919
914
|
var v;
|
|
920
915
|
return o.onerror = function(h) {
|
|
921
916
|
var u;
|
|
922
|
-
if (a.current.onError && a.current.onError(h),
|
|
923
|
-
if (n.current < ((u = a.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
917
|
+
if (a.current.onError && a.current.onError(h), d.isEventSourceSupported && o instanceof EventSource && (a.current.onClose && a.current.onClose(r(r({}, h), { code: 1006, reason: "An error occurred with the EventSource: ".concat(h), wasClean: !1 })), i(d.ReadyState.CLOSED), o.close()), a.current.retryOnError)
|
|
918
|
+
if (n.current < ((u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : d.DEFAULT_RECONNECT_LIMIT)) {
|
|
924
919
|
var b = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
|
|
925
920
|
v = window.setTimeout(function() {
|
|
926
921
|
n.current++, t();
|
|
927
|
-
}, b ??
|
|
922
|
+
}, b ?? d.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
928
923
|
} else
|
|
929
924
|
a.current.onReconnectStop && a.current.onReconnectStop(a.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(a.current.reconnectAttempts, " exceeded"));
|
|
930
925
|
}, function() {
|
|
931
926
|
return v && window.clearTimeout(v);
|
|
932
927
|
};
|
|
933
|
-
},
|
|
934
|
-
var u = a.setLastMessage, b = a.setReadyState,
|
|
935
|
-
return i.current.fromSocketIO && (
|
|
936
|
-
b(
|
|
928
|
+
}, s = function(o, a, i, t, n, v, h) {
|
|
929
|
+
var u = a.setLastMessage, b = a.setReadyState, R, P, p;
|
|
930
|
+
return i.current.fromSocketIO && (R = (0, S.setUpSocketIOPing)(h)), _(o, i, u, v), y(o, i, b, n, v), P = E(o, i, b, t, n), p = c(o, i, b, t, n), function() {
|
|
931
|
+
b(d.ReadyState.CLOSING), P(), p(), o.close(), R && clearInterval(R);
|
|
937
932
|
};
|
|
938
933
|
};
|
|
939
|
-
return te.attachListeners =
|
|
934
|
+
return te.attachListeners = s, te;
|
|
940
935
|
}
|
|
941
|
-
var ne = {},
|
|
942
|
-
function
|
|
943
|
-
if (
|
|
944
|
-
|
|
936
|
+
var ne = {}, pr;
|
|
937
|
+
function ht() {
|
|
938
|
+
if (pr) return ne;
|
|
939
|
+
pr = 1;
|
|
945
940
|
var r = ne && ne.__assign || function() {
|
|
946
941
|
return r = Object.assign || function(a) {
|
|
947
942
|
for (var i, t = 1, n = arguments.length; t < n; t++) {
|
|
@@ -952,16 +947,16 @@ function St() {
|
|
|
952
947
|
}, r.apply(this, arguments);
|
|
953
948
|
};
|
|
954
949
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachSharedListeners = void 0;
|
|
955
|
-
var
|
|
950
|
+
var S = $e(), O = V(), d = Ye(), f = Be(), _ = Mr(), y = function(a, i, t) {
|
|
956
951
|
a.onmessage = function(n) {
|
|
957
|
-
(0,
|
|
952
|
+
(0, d.getSubscribers)(i).forEach(function(v) {
|
|
958
953
|
var h;
|
|
959
954
|
v.optionsRef.current.onMessage && v.optionsRef.current.onMessage(n), typeof ((h = v?.lastMessageTime) === null || h === void 0 ? void 0 : h.current) == "number" && (v.lastMessageTime.current = Date.now()), !(typeof v.optionsRef.current.filter == "function" && v.optionsRef.current.filter(n) !== !0) && (t && typeof t != "boolean" && t?.returnMessage === n.data || v.setLastMessage(n));
|
|
960
955
|
});
|
|
961
956
|
};
|
|
962
|
-
},
|
|
957
|
+
}, E = function(a, i, t) {
|
|
963
958
|
a.onopen = function(n) {
|
|
964
|
-
var v = (0,
|
|
959
|
+
var v = (0, d.getSubscribers)(i);
|
|
965
960
|
v.forEach(function(h) {
|
|
966
961
|
h.reconnectCount.current = 0, h.optionsRef.current.onOpen && h.optionsRef.current.onOpen(n), h.setReadyState(O.ReadyState.OPEN), t && a instanceof WebSocket && (h.lastMessageTime.current = Date.now());
|
|
967
962
|
}), t && a instanceof WebSocket && (0, _.heartbeat)(a, v.map(function(h) {
|
|
@@ -970,9 +965,9 @@ function St() {
|
|
|
970
965
|
};
|
|
971
966
|
}, c = function(a, i) {
|
|
972
967
|
a instanceof WebSocket && (a.onclose = function(t) {
|
|
973
|
-
(0,
|
|
968
|
+
(0, d.getSubscribers)(i).forEach(function(n) {
|
|
974
969
|
n.optionsRef.current.onClose && n.optionsRef.current.onClose(t), n.setReadyState(O.ReadyState.CLOSED);
|
|
975
|
-
}), delete
|
|
970
|
+
}), delete S.sharedWebSockets[i], (0, d.getSubscribers)(i).forEach(function(n) {
|
|
976
971
|
var v;
|
|
977
972
|
if (n.optionsRef.current.shouldReconnect && n.optionsRef.current.shouldReconnect(t)) {
|
|
978
973
|
var h = (v = n.optionsRef.current.reconnectAttempts) !== null && v !== void 0 ? v : O.DEFAULT_RECONNECT_LIMIT;
|
|
@@ -986,67 +981,67 @@ function St() {
|
|
|
986
981
|
}
|
|
987
982
|
});
|
|
988
983
|
});
|
|
989
|
-
},
|
|
984
|
+
}, s = function(a, i) {
|
|
990
985
|
a.onerror = function(t) {
|
|
991
|
-
(0,
|
|
986
|
+
(0, d.getSubscribers)(i).forEach(function(n) {
|
|
992
987
|
n.optionsRef.current.onError && n.optionsRef.current.onError(t), O.isEventSourceSupported && a instanceof EventSource && (n.optionsRef.current.onClose && n.optionsRef.current.onClose(r(r({}, t), { code: 1006, reason: "An error occurred with the EventSource: ".concat(t), wasClean: !1 })), n.setReadyState(O.ReadyState.CLOSED));
|
|
993
988
|
}), O.isEventSourceSupported && a instanceof EventSource && a.close();
|
|
994
989
|
};
|
|
995
990
|
}, o = function(a, i, t, n) {
|
|
996
991
|
var v;
|
|
997
|
-
return t.current.fromSocketIO && (v = (0, f.setUpSocketIOPing)(n)),
|
|
992
|
+
return t.current.fromSocketIO && (v = (0, f.setUpSocketIOPing)(n)), y(a, i, t.current.heartbeat), c(a, i), E(a, i, t.current.heartbeat), s(a, i), function() {
|
|
998
993
|
v && clearInterval(v);
|
|
999
994
|
};
|
|
1000
995
|
};
|
|
1001
996
|
return ne.attachSharedListeners = o, ne;
|
|
1002
997
|
}
|
|
1003
|
-
var
|
|
1004
|
-
function
|
|
1005
|
-
if (
|
|
1006
|
-
|
|
1007
|
-
var r =
|
|
998
|
+
var Tr;
|
|
999
|
+
function bt() {
|
|
1000
|
+
if (Tr) return ye;
|
|
1001
|
+
Tr = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.createOrJoinSocket = void 0;
|
|
1002
|
+
var r = $e(), S = V(), O = St(), d = ht(), f = Ye(), _ = function(E, c, s, o, a) {
|
|
1008
1003
|
return function() {
|
|
1009
|
-
if ((0, f.removeSubscriber)(
|
|
1004
|
+
if ((0, f.removeSubscriber)(E, c), !(0, f.hasSubscribers)(E)) {
|
|
1010
1005
|
try {
|
|
1011
|
-
var i = r.sharedWebSockets[
|
|
1006
|
+
var i = r.sharedWebSockets[E];
|
|
1012
1007
|
i instanceof WebSocket && (i.onclose = function(t) {
|
|
1013
|
-
|
|
1008
|
+
s.current.onClose && s.current.onClose(t), o(S.ReadyState.CLOSED);
|
|
1014
1009
|
}), i.close();
|
|
1015
1010
|
} catch {
|
|
1016
1011
|
}
|
|
1017
|
-
a && a(), delete r.sharedWebSockets[
|
|
1012
|
+
a && a(), delete r.sharedWebSockets[E];
|
|
1018
1013
|
}
|
|
1019
1014
|
};
|
|
1020
|
-
},
|
|
1021
|
-
if (!
|
|
1022
|
-
throw
|
|
1015
|
+
}, y = function(E, c, s, o, a, i, t, n, v) {
|
|
1016
|
+
if (!S.isEventSourceSupported && o.current.eventSourceOptions)
|
|
1017
|
+
throw S.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
1023
1018
|
if (o.current.share) {
|
|
1024
1019
|
var h = null;
|
|
1025
|
-
r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols),
|
|
1020
|
+
r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), E.current = r.sharedWebSockets[c], s(S.ReadyState.CONNECTING), h = (0, d.attachSharedListeners)(r.sharedWebSockets[c], c, o, v)) : (E.current = r.sharedWebSockets[c], s(r.sharedWebSockets[c].readyState));
|
|
1026
1021
|
var u = {
|
|
1027
1022
|
setLastMessage: a,
|
|
1028
|
-
setReadyState:
|
|
1023
|
+
setReadyState: s,
|
|
1029
1024
|
optionsRef: o,
|
|
1030
1025
|
reconnectCount: t,
|
|
1031
1026
|
lastMessageTime: n,
|
|
1032
1027
|
reconnect: i
|
|
1033
1028
|
};
|
|
1034
|
-
return (0, f.addSubscriber)(c, u), _(c, u, o,
|
|
1029
|
+
return (0, f.addSubscriber)(c, u), _(c, u, o, s, h);
|
|
1035
1030
|
} else {
|
|
1036
|
-
if (
|
|
1031
|
+
if (E.current = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), s(S.ReadyState.CONNECTING), !E.current)
|
|
1037
1032
|
throw new Error("WebSocket failed to be created");
|
|
1038
|
-
return (0, O.attachListeners)(
|
|
1033
|
+
return (0, O.attachListeners)(E.current, {
|
|
1039
1034
|
setLastMessage: a,
|
|
1040
|
-
setReadyState:
|
|
1035
|
+
setReadyState: s
|
|
1041
1036
|
}, o, i.current, t, n, v);
|
|
1042
1037
|
}
|
|
1043
1038
|
};
|
|
1044
|
-
return
|
|
1039
|
+
return ye.createOrJoinSocket = y, ye;
|
|
1045
1040
|
}
|
|
1046
|
-
var x = {},
|
|
1047
|
-
function
|
|
1048
|
-
return
|
|
1049
|
-
var
|
|
1041
|
+
var x = {}, Cr;
|
|
1042
|
+
function gt() {
|
|
1043
|
+
return Cr || (Cr = 1, (function(r) {
|
|
1044
|
+
var S = x && x.__awaiter || function(c, s, o, a) {
|
|
1050
1045
|
function i(t) {
|
|
1051
1046
|
return t instanceof o ? t : new o(function(n) {
|
|
1052
1047
|
n(t);
|
|
@@ -1056,23 +1051,23 @@ function yt() {
|
|
|
1056
1051
|
function v(b) {
|
|
1057
1052
|
try {
|
|
1058
1053
|
u(a.next(b));
|
|
1059
|
-
} catch (
|
|
1060
|
-
n(
|
|
1054
|
+
} catch (R) {
|
|
1055
|
+
n(R);
|
|
1061
1056
|
}
|
|
1062
1057
|
}
|
|
1063
1058
|
function h(b) {
|
|
1064
1059
|
try {
|
|
1065
1060
|
u(a.throw(b));
|
|
1066
|
-
} catch (
|
|
1067
|
-
n(
|
|
1061
|
+
} catch (R) {
|
|
1062
|
+
n(R);
|
|
1068
1063
|
}
|
|
1069
1064
|
}
|
|
1070
1065
|
function u(b) {
|
|
1071
1066
|
b.done ? t(b.value) : i(b.value).then(v, h);
|
|
1072
1067
|
}
|
|
1073
|
-
u((a = a.apply(c,
|
|
1068
|
+
u((a = a.apply(c, s || [])).next());
|
|
1074
1069
|
});
|
|
1075
|
-
}, O = x && x.__generator || function(c,
|
|
1070
|
+
}, O = x && x.__generator || function(c, s) {
|
|
1076
1071
|
var o = { label: 0, sent: function() {
|
|
1077
1072
|
if (t[0] & 1) throw t[1];
|
|
1078
1073
|
return t[1];
|
|
@@ -1122,7 +1117,7 @@ function yt() {
|
|
|
1122
1117
|
t[2] && o.ops.pop(), o.trys.pop();
|
|
1123
1118
|
continue;
|
|
1124
1119
|
}
|
|
1125
|
-
u =
|
|
1120
|
+
u = s.call(c, o);
|
|
1126
1121
|
} catch (b) {
|
|
1127
1122
|
u = [6, b], i = 0;
|
|
1128
1123
|
} finally {
|
|
@@ -1131,36 +1126,36 @@ function yt() {
|
|
|
1131
1126
|
if (u[0] & 5) throw u[1];
|
|
1132
1127
|
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
1133
1128
|
}
|
|
1134
|
-
},
|
|
1135
|
-
if (o || arguments.length === 2) for (var a = 0, i =
|
|
1136
|
-
(t || !(a in
|
|
1137
|
-
return c.concat(t || Array.prototype.slice.call(
|
|
1129
|
+
}, d = x && x.__spreadArray || function(c, s, o) {
|
|
1130
|
+
if (o || arguments.length === 2) for (var a = 0, i = s.length, t; a < i; a++)
|
|
1131
|
+
(t || !(a in s)) && (t || (t = Array.prototype.slice.call(s, 0, a)), t[a] = s[a]);
|
|
1132
|
+
return c.concat(t || Array.prototype.slice.call(s));
|
|
1138
1133
|
};
|
|
1139
1134
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.getUrl = void 0;
|
|
1140
|
-
var f =
|
|
1141
|
-
return new Promise(function(
|
|
1142
|
-
return window.setTimeout(
|
|
1135
|
+
var f = Be(), _ = V(), y = function(c) {
|
|
1136
|
+
return new Promise(function(s) {
|
|
1137
|
+
return window.setTimeout(s, c);
|
|
1143
1138
|
});
|
|
1144
|
-
},
|
|
1139
|
+
}, E = function(c, s) {
|
|
1145
1140
|
for (var o = [], a = 2; a < arguments.length; a++)
|
|
1146
1141
|
o[a - 2] = arguments[a];
|
|
1147
|
-
return
|
|
1148
|
-
var v, h, u, b,
|
|
1149
|
-
return n === void 0 && (n = 0), O(this, function(
|
|
1150
|
-
switch (
|
|
1142
|
+
return S(void 0, d([c, s], o, !0), void 0, function(i, t, n) {
|
|
1143
|
+
var v, h, u, b, R, P, p, A;
|
|
1144
|
+
return n === void 0 && (n = 0), O(this, function(k) {
|
|
1145
|
+
switch (k.label) {
|
|
1151
1146
|
case 0:
|
|
1152
1147
|
if (typeof i != "function") return [3, 10];
|
|
1153
|
-
|
|
1148
|
+
k.label = 1;
|
|
1154
1149
|
case 1:
|
|
1155
|
-
return
|
|
1150
|
+
return k.trys.push([1, 3, , 9]), [4, i()];
|
|
1156
1151
|
case 2:
|
|
1157
|
-
return v =
|
|
1152
|
+
return v = k.sent(), [3, 9];
|
|
1158
1153
|
case 3:
|
|
1159
|
-
return
|
|
1154
|
+
return k.sent(), t.current.retryOnError ? (h = (P = t.current.reconnectAttempts) !== null && P !== void 0 ? P : _.DEFAULT_RECONNECT_LIMIT, n < h ? (u = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4, y(u ?? _.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
1160
1155
|
case 4:
|
|
1161
|
-
return
|
|
1156
|
+
return k.sent(), [2, (0, r.getUrl)(i, t, n + 1)];
|
|
1162
1157
|
case 5:
|
|
1163
|
-
return (A = (
|
|
1158
|
+
return (A = (p = t.current).onReconnectStop) === null || A === void 0 || A.call(p, n), [2, null];
|
|
1164
1159
|
case 6:
|
|
1165
1160
|
return [3, 8];
|
|
1166
1161
|
case 7:
|
|
@@ -1170,39 +1165,39 @@ function yt() {
|
|
|
1170
1165
|
case 9:
|
|
1171
1166
|
return [3, 11];
|
|
1172
1167
|
case 10:
|
|
1173
|
-
v = i,
|
|
1168
|
+
v = i, k.label = 11;
|
|
1174
1169
|
case 11:
|
|
1175
|
-
return b = t.current.fromSocketIO ? (0, f.parseSocketIOUrl)(v) : v,
|
|
1170
|
+
return b = t.current.fromSocketIO ? (0, f.parseSocketIOUrl)(v) : v, R = t.current.queryParams ? (0, f.appendQueryParams)(b, t.current.queryParams) : b, [2, R];
|
|
1176
1171
|
}
|
|
1177
1172
|
});
|
|
1178
1173
|
});
|
|
1179
1174
|
};
|
|
1180
|
-
r.getUrl =
|
|
1175
|
+
r.getUrl = E;
|
|
1181
1176
|
})(x)), x;
|
|
1182
1177
|
}
|
|
1183
|
-
var
|
|
1184
|
-
function
|
|
1185
|
-
return
|
|
1178
|
+
var Je = {}, Rr;
|
|
1179
|
+
function Ot() {
|
|
1180
|
+
return Rr || (Rr = 1, (function(r) {
|
|
1186
1181
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.websocketWrapper = void 0;
|
|
1187
|
-
var
|
|
1182
|
+
var S = function(O, d) {
|
|
1188
1183
|
return new Proxy(O, {
|
|
1189
1184
|
get: function(f, _) {
|
|
1190
|
-
var
|
|
1191
|
-
return _ === "reconnect" ?
|
|
1192
|
-
}) :
|
|
1185
|
+
var y = f[_];
|
|
1186
|
+
return _ === "reconnect" ? d : typeof y == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
|
|
1187
|
+
}) : y;
|
|
1193
1188
|
},
|
|
1194
|
-
set: function(f, _,
|
|
1195
|
-
return /^on/.test(_) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (f[_] =
|
|
1189
|
+
set: function(f, _, y) {
|
|
1190
|
+
return /^on/.test(_) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (f[_] = y, !0);
|
|
1196
1191
|
}
|
|
1197
1192
|
});
|
|
1198
1193
|
};
|
|
1199
|
-
r.websocketWrapper =
|
|
1200
|
-
})(
|
|
1194
|
+
r.websocketWrapper = S, r.default = r.websocketWrapper;
|
|
1195
|
+
})(Je)), Je;
|
|
1201
1196
|
}
|
|
1202
|
-
var
|
|
1203
|
-
function
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1197
|
+
var wr;
|
|
1198
|
+
function xe() {
|
|
1199
|
+
if (wr) return F;
|
|
1200
|
+
wr = 1;
|
|
1206
1201
|
var r = F && F.__assign || function() {
|
|
1207
1202
|
return r = Object.assign || function(i) {
|
|
1208
1203
|
for (var t, n = 1, v = arguments.length; n < v; n++) {
|
|
@@ -1211,133 +1206,133 @@ function Ye() {
|
|
|
1211
1206
|
}
|
|
1212
1207
|
return i;
|
|
1213
1208
|
}, r.apply(this, arguments);
|
|
1214
|
-
},
|
|
1209
|
+
}, S = F && F.__awaiter || function(i, t, n, v) {
|
|
1215
1210
|
function h(u) {
|
|
1216
1211
|
return u instanceof n ? u : new n(function(b) {
|
|
1217
1212
|
b(u);
|
|
1218
1213
|
});
|
|
1219
1214
|
}
|
|
1220
1215
|
return new (n || (n = Promise))(function(u, b) {
|
|
1221
|
-
function
|
|
1216
|
+
function R(A) {
|
|
1222
1217
|
try {
|
|
1223
|
-
|
|
1224
|
-
} catch (
|
|
1225
|
-
b(
|
|
1218
|
+
p(v.next(A));
|
|
1219
|
+
} catch (k) {
|
|
1220
|
+
b(k);
|
|
1226
1221
|
}
|
|
1227
1222
|
}
|
|
1228
1223
|
function P(A) {
|
|
1229
1224
|
try {
|
|
1230
|
-
|
|
1231
|
-
} catch (
|
|
1232
|
-
b(
|
|
1225
|
+
p(v.throw(A));
|
|
1226
|
+
} catch (k) {
|
|
1227
|
+
b(k);
|
|
1233
1228
|
}
|
|
1234
1229
|
}
|
|
1235
|
-
function
|
|
1236
|
-
A.done ? u(A.value) : h(A.value).then(
|
|
1230
|
+
function p(A) {
|
|
1231
|
+
A.done ? u(A.value) : h(A.value).then(R, P);
|
|
1237
1232
|
}
|
|
1238
|
-
|
|
1233
|
+
p((v = v.apply(i, t || [])).next());
|
|
1239
1234
|
});
|
|
1240
1235
|
}, O = F && F.__generator || function(i, t) {
|
|
1241
1236
|
var n = { label: 0, sent: function() {
|
|
1242
1237
|
if (u[0] & 1) throw u[1];
|
|
1243
1238
|
return u[1];
|
|
1244
1239
|
}, trys: [], ops: [] }, v, h, u, b = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
1245
|
-
return b.next =
|
|
1240
|
+
return b.next = R(0), b.throw = R(1), b.return = R(2), typeof Symbol == "function" && (b[Symbol.iterator] = function() {
|
|
1246
1241
|
return this;
|
|
1247
1242
|
}), b;
|
|
1248
|
-
function
|
|
1243
|
+
function R(p) {
|
|
1249
1244
|
return function(A) {
|
|
1250
|
-
return P([
|
|
1245
|
+
return P([p, A]);
|
|
1251
1246
|
};
|
|
1252
1247
|
}
|
|
1253
|
-
function P(
|
|
1248
|
+
function P(p) {
|
|
1254
1249
|
if (v) throw new TypeError("Generator is already executing.");
|
|
1255
|
-
for (; b && (b = 0,
|
|
1256
|
-
if (v = 1, h && (u =
|
|
1257
|
-
switch (h = 0, u && (
|
|
1250
|
+
for (; b && (b = 0, p[0] && (n = 0)), n; ) try {
|
|
1251
|
+
if (v = 1, h && (u = p[0] & 2 ? h.return : p[0] ? h.throw || ((u = h.return) && u.call(h), 0) : h.next) && !(u = u.call(h, p[1])).done) return u;
|
|
1252
|
+
switch (h = 0, u && (p = [p[0] & 2, u.value]), p[0]) {
|
|
1258
1253
|
case 0:
|
|
1259
1254
|
case 1:
|
|
1260
|
-
u =
|
|
1255
|
+
u = p;
|
|
1261
1256
|
break;
|
|
1262
1257
|
case 4:
|
|
1263
|
-
return n.label++, { value:
|
|
1258
|
+
return n.label++, { value: p[1], done: !1 };
|
|
1264
1259
|
case 5:
|
|
1265
|
-
n.label++, h =
|
|
1260
|
+
n.label++, h = p[1], p = [0];
|
|
1266
1261
|
continue;
|
|
1267
1262
|
case 7:
|
|
1268
|
-
|
|
1263
|
+
p = n.ops.pop(), n.trys.pop();
|
|
1269
1264
|
continue;
|
|
1270
1265
|
default:
|
|
1271
|
-
if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (
|
|
1266
|
+
if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (p[0] === 6 || p[0] === 2)) {
|
|
1272
1267
|
n = 0;
|
|
1273
1268
|
continue;
|
|
1274
1269
|
}
|
|
1275
|
-
if (
|
|
1276
|
-
n.label =
|
|
1270
|
+
if (p[0] === 3 && (!u || p[1] > u[0] && p[1] < u[3])) {
|
|
1271
|
+
n.label = p[1];
|
|
1277
1272
|
break;
|
|
1278
1273
|
}
|
|
1279
|
-
if (
|
|
1280
|
-
n.label = u[1], u =
|
|
1274
|
+
if (p[0] === 6 && n.label < u[1]) {
|
|
1275
|
+
n.label = u[1], u = p;
|
|
1281
1276
|
break;
|
|
1282
1277
|
}
|
|
1283
1278
|
if (u && n.label < u[2]) {
|
|
1284
|
-
n.label = u[2], n.ops.push(
|
|
1279
|
+
n.label = u[2], n.ops.push(p);
|
|
1285
1280
|
break;
|
|
1286
1281
|
}
|
|
1287
1282
|
u[2] && n.ops.pop(), n.trys.pop();
|
|
1288
1283
|
continue;
|
|
1289
1284
|
}
|
|
1290
|
-
|
|
1285
|
+
p = t.call(i, n);
|
|
1291
1286
|
} catch (A) {
|
|
1292
|
-
|
|
1287
|
+
p = [6, A], h = 0;
|
|
1293
1288
|
} finally {
|
|
1294
1289
|
v = u = 0;
|
|
1295
1290
|
}
|
|
1296
|
-
if (
|
|
1297
|
-
return { value:
|
|
1291
|
+
if (p[0] & 5) throw p[1];
|
|
1292
|
+
return { value: p[0] ? p[1] : void 0, done: !0 };
|
|
1298
1293
|
}
|
|
1299
|
-
},
|
|
1294
|
+
}, d = F && F.__importDefault || function(i) {
|
|
1300
1295
|
return i && i.__esModule ? i : { default: i };
|
|
1301
1296
|
};
|
|
1302
1297
|
Object.defineProperty(F, "__esModule", { value: !0 }), F.useWebSocket = void 0;
|
|
1303
|
-
var f =
|
|
1304
|
-
t === void 0 && (t =
|
|
1305
|
-
var v = (0, f.useState)(null), h = v[0], u = v[1], b = (0, f.useState)({}),
|
|
1298
|
+
var f = be, _ = ft, y = V(), E = bt(), c = gt(), s = d(Ot()), o = Ke(), a = function(i, t, n) {
|
|
1299
|
+
t === void 0 && (t = y.DEFAULT_OPTIONS), n === void 0 && (n = !0);
|
|
1300
|
+
var v = (0, f.useState)(null), h = v[0], u = v[1], b = (0, f.useState)({}), R = b[0], P = b[1], p = (0, f.useMemo)(function() {
|
|
1306
1301
|
if (!t.disableJson && h)
|
|
1307
1302
|
try {
|
|
1308
1303
|
return JSON.parse(h.data);
|
|
1309
1304
|
} catch {
|
|
1310
|
-
return
|
|
1305
|
+
return y.UNPARSABLE_JSON_OBJECT;
|
|
1311
1306
|
}
|
|
1312
1307
|
return null;
|
|
1313
|
-
}, [h, t.disableJson]), A = (0, f.useRef)(null),
|
|
1314
|
-
}),
|
|
1315
|
-
|
|
1316
|
-
var G = A.current &&
|
|
1308
|
+
}, [h, t.disableJson]), A = (0, f.useRef)(null), k = (0, f.useRef)(null), le = (0, f.useRef)(function() {
|
|
1309
|
+
}), fe = (0, f.useRef)(0), Ne = (0, f.useRef)(Date.now()), ge = (0, f.useRef)([]), J = (0, f.useRef)(null), D = (0, f.useRef)(t);
|
|
1310
|
+
D.current = t;
|
|
1311
|
+
var G = A.current && R[A.current] !== void 0 ? R[A.current] : i !== null && n === !0 ? y.ReadyState.CONNECTING : y.ReadyState.UNINSTANTIATED, X = t.queryParams ? JSON.stringify(t.queryParams) : null, $ = (0, f.useCallback)(function(L, j) {
|
|
1317
1312
|
var B;
|
|
1318
|
-
if (j === void 0 && (j = !0),
|
|
1313
|
+
if (j === void 0 && (j = !0), y.isEventSourceSupported && k.current instanceof EventSource) {
|
|
1319
1314
|
console.warn("Unable to send a message from an eventSource");
|
|
1320
1315
|
return;
|
|
1321
1316
|
}
|
|
1322
|
-
((B =
|
|
1323
|
-
}, []),
|
|
1324
|
-
j === void 0 && (j = !0), $(JSON.stringify(
|
|
1325
|
-
}, [$]),
|
|
1326
|
-
return
|
|
1317
|
+
((B = k.current) === null || B === void 0 ? void 0 : B.readyState) === y.ReadyState.OPEN ? ((0, o.assertIsWebSocket)(k.current, D.current.skipAssert), k.current.send(L)) : j && ge.current.push(L);
|
|
1318
|
+
}, []), Oe = (0, f.useCallback)(function(L, j) {
|
|
1319
|
+
j === void 0 && (j = !0), $(JSON.stringify(L), j);
|
|
1320
|
+
}, [$]), me = (0, f.useCallback)(function() {
|
|
1321
|
+
return D.current.share !== !0 || y.isEventSourceSupported && k.current instanceof EventSource ? k.current : (J.current === null && k.current && ((0, o.assertIsWebSocket)(k.current, D.current.skipAssert), J.current = (0, s.default)(k.current, le)), J.current);
|
|
1327
1322
|
}, []);
|
|
1328
1323
|
return (0, f.useEffect)(function() {
|
|
1329
1324
|
if (i !== null && n === !0) {
|
|
1330
|
-
var
|
|
1331
|
-
return
|
|
1325
|
+
var L, j = !1, B = !0, ve = function() {
|
|
1326
|
+
return S(void 0, void 0, void 0, function() {
|
|
1332
1327
|
var Z, z, pe;
|
|
1333
|
-
return O(this, function(
|
|
1334
|
-
switch (
|
|
1328
|
+
return O(this, function(ue) {
|
|
1329
|
+
switch (ue.label) {
|
|
1335
1330
|
case 0:
|
|
1336
|
-
return Z = A, [4, (0, c.getUrl)(i,
|
|
1331
|
+
return Z = A, [4, (0, c.getUrl)(i, D)];
|
|
1337
1332
|
case 1:
|
|
1338
|
-
return Z.current =
|
|
1333
|
+
return Z.current = ue.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0, _.flushSync)(function() {
|
|
1339
1334
|
return P(function(Y) {
|
|
1340
|
-
return r(r({}, Y), { ABORTED:
|
|
1335
|
+
return r(r({}, Y), { ABORTED: y.ReadyState.CLOSED });
|
|
1341
1336
|
});
|
|
1342
1337
|
}), [
|
|
1343
1338
|
2
|
|
@@ -1348,12 +1343,12 @@ function Ye() {
|
|
|
1348
1343
|
});
|
|
1349
1344
|
}, pe = function(Y) {
|
|
1350
1345
|
j || (0, _.flushSync)(function() {
|
|
1351
|
-
return P(function(
|
|
1346
|
+
return P(function(ce) {
|
|
1352
1347
|
var ee;
|
|
1353
|
-
return r(r({},
|
|
1348
|
+
return r(r({}, ce), A.current && (ee = {}, ee[A.current] = Y, ee));
|
|
1354
1349
|
});
|
|
1355
1350
|
});
|
|
1356
|
-
}, B && (
|
|
1351
|
+
}, B && (L = (0, E.createOrJoinSocket)(k, A.current, pe, D, z, le, fe, Ne, $)), [
|
|
1357
1352
|
2
|
|
1358
1353
|
/*return*/
|
|
1359
1354
|
]);
|
|
@@ -1361,63 +1356,63 @@ function Ye() {
|
|
|
1361
1356
|
});
|
|
1362
1357
|
});
|
|
1363
1358
|
};
|
|
1364
|
-
return
|
|
1365
|
-
j || (J.current && (J.current = null),
|
|
1366
|
-
},
|
|
1367
|
-
j = !0, B = !1, J.current && (J.current = null),
|
|
1359
|
+
return le.current = function() {
|
|
1360
|
+
j || (J.current && (J.current = null), L?.(), ve());
|
|
1361
|
+
}, ve(), function() {
|
|
1362
|
+
j = !0, B = !1, J.current && (J.current = null), L?.(), u(null);
|
|
1368
1363
|
};
|
|
1369
|
-
} else (i === null || n === !1) && (
|
|
1364
|
+
} else (i === null || n === !1) && (fe.current = 0, P(function(Z) {
|
|
1370
1365
|
var z;
|
|
1371
|
-
return r(r({}, Z), A.current && (z = {}, z[A.current] =
|
|
1366
|
+
return r(r({}, Z), A.current && (z = {}, z[A.current] = y.ReadyState.CLOSED, z));
|
|
1372
1367
|
}));
|
|
1373
1368
|
}, [i, n, X, $]), (0, f.useEffect)(function() {
|
|
1374
|
-
G ===
|
|
1375
|
-
$(
|
|
1369
|
+
G === y.ReadyState.OPEN && ge.current.splice(0).forEach(function(L) {
|
|
1370
|
+
$(L);
|
|
1376
1371
|
});
|
|
1377
1372
|
}, [G]), {
|
|
1378
1373
|
sendMessage: $,
|
|
1379
|
-
sendJsonMessage:
|
|
1374
|
+
sendJsonMessage: Oe,
|
|
1380
1375
|
lastMessage: h,
|
|
1381
|
-
lastJsonMessage:
|
|
1376
|
+
lastJsonMessage: p,
|
|
1382
1377
|
readyState: G,
|
|
1383
|
-
getWebSocket:
|
|
1378
|
+
getWebSocket: me
|
|
1384
1379
|
};
|
|
1385
1380
|
};
|
|
1386
1381
|
return F.useWebSocket = a, F;
|
|
1387
1382
|
}
|
|
1388
|
-
var ae = {},
|
|
1389
|
-
function
|
|
1390
|
-
if (
|
|
1391
|
-
|
|
1383
|
+
var ae = {}, Ar;
|
|
1384
|
+
function mt() {
|
|
1385
|
+
if (Ar) return ae;
|
|
1386
|
+
Ar = 1;
|
|
1392
1387
|
var r = ae && ae.__assign || function() {
|
|
1393
|
-
return r = Object.assign || function(
|
|
1394
|
-
for (var c,
|
|
1395
|
-
c = arguments[
|
|
1396
|
-
for (var a in c) Object.prototype.hasOwnProperty.call(c, a) && (
|
|
1388
|
+
return r = Object.assign || function(E) {
|
|
1389
|
+
for (var c, s = 1, o = arguments.length; s < o; s++) {
|
|
1390
|
+
c = arguments[s];
|
|
1391
|
+
for (var a in c) Object.prototype.hasOwnProperty.call(c, a) && (E[a] = c[a]);
|
|
1397
1392
|
}
|
|
1398
|
-
return
|
|
1393
|
+
return E;
|
|
1399
1394
|
}, r.apply(this, arguments);
|
|
1400
1395
|
};
|
|
1401
1396
|
Object.defineProperty(ae, "__esModule", { value: !0 }), ae.useSocketIO = void 0;
|
|
1402
|
-
var
|
|
1397
|
+
var S = be, O = xe(), d = V(), f = {
|
|
1403
1398
|
type: "empty",
|
|
1404
1399
|
payload: null
|
|
1405
|
-
}, _ = function(
|
|
1406
|
-
if (!
|
|
1400
|
+
}, _ = function(E) {
|
|
1401
|
+
if (!E || !E.data)
|
|
1407
1402
|
return f;
|
|
1408
|
-
var c =
|
|
1403
|
+
var c = E.data.match(/\[.*]/);
|
|
1409
1404
|
if (!c)
|
|
1410
1405
|
return f;
|
|
1411
|
-
var
|
|
1412
|
-
return !Array.isArray(
|
|
1413
|
-
type:
|
|
1414
|
-
payload:
|
|
1406
|
+
var s = JSON.parse(c);
|
|
1407
|
+
return !Array.isArray(s) || !s[1] ? f : {
|
|
1408
|
+
type: s[0],
|
|
1409
|
+
payload: s[1]
|
|
1415
1410
|
};
|
|
1416
|
-
},
|
|
1417
|
-
c === void 0 && (c =
|
|
1418
|
-
var o = (0,
|
|
1411
|
+
}, y = function(E, c, s) {
|
|
1412
|
+
c === void 0 && (c = d.DEFAULT_OPTIONS), s === void 0 && (s = !0);
|
|
1413
|
+
var o = (0, S.useMemo)(function() {
|
|
1419
1414
|
return r(r({}, c), { fromSocketIO: !0 });
|
|
1420
|
-
}, []), a = (0, O.useWebSocket)(
|
|
1415
|
+
}, []), a = (0, O.useWebSocket)(E, o, s), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, v = a.readyState, h = a.getWebSocket, u = (0, S.useMemo)(function() {
|
|
1421
1416
|
return _(n);
|
|
1422
1417
|
}, [n]);
|
|
1423
1418
|
return {
|
|
@@ -1429,42 +1424,42 @@ function gt() {
|
|
|
1429
1424
|
getWebSocket: h
|
|
1430
1425
|
};
|
|
1431
1426
|
};
|
|
1432
|
-
return ae.useSocketIO =
|
|
1427
|
+
return ae.useSocketIO = y, ae;
|
|
1433
1428
|
}
|
|
1434
|
-
var Q = {},
|
|
1435
|
-
function
|
|
1436
|
-
if (
|
|
1437
|
-
|
|
1429
|
+
var Q = {}, Pr;
|
|
1430
|
+
function pt() {
|
|
1431
|
+
if (Pr) return Q;
|
|
1432
|
+
Pr = 1;
|
|
1438
1433
|
var r = Q && Q.__assign || function() {
|
|
1439
|
-
return r = Object.assign || function(
|
|
1440
|
-
for (var
|
|
1441
|
-
|
|
1442
|
-
for (var o in
|
|
1434
|
+
return r = Object.assign || function(y) {
|
|
1435
|
+
for (var E, c = 1, s = arguments.length; c < s; c++) {
|
|
1436
|
+
E = arguments[c];
|
|
1437
|
+
for (var o in E) Object.prototype.hasOwnProperty.call(E, o) && (y[o] = E[o]);
|
|
1443
1438
|
}
|
|
1444
|
-
return
|
|
1439
|
+
return y;
|
|
1445
1440
|
}, r.apply(this, arguments);
|
|
1446
|
-
},
|
|
1441
|
+
}, S = Q && Q.__rest || function(y, E) {
|
|
1447
1442
|
var c = {};
|
|
1448
|
-
for (var
|
|
1449
|
-
if (
|
|
1450
|
-
for (var o = 0,
|
|
1451
|
-
|
|
1443
|
+
for (var s in y) Object.prototype.hasOwnProperty.call(y, s) && E.indexOf(s) < 0 && (c[s] = y[s]);
|
|
1444
|
+
if (y != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1445
|
+
for (var o = 0, s = Object.getOwnPropertySymbols(y); o < s.length; o++)
|
|
1446
|
+
E.indexOf(s[o]) < 0 && Object.prototype.propertyIsEnumerable.call(y, s[o]) && (c[s[o]] = y[s[o]]);
|
|
1452
1447
|
return c;
|
|
1453
1448
|
};
|
|
1454
1449
|
Object.defineProperty(Q, "__esModule", { value: !0 }), Q.useEventSource = void 0;
|
|
1455
|
-
var O =
|
|
1456
|
-
|
|
1457
|
-
var
|
|
1450
|
+
var O = be, d = xe(), f = V(), _ = function(y, E, c) {
|
|
1451
|
+
E === void 0 && (E = f.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
1452
|
+
var s = E.withCredentials, o = E.events, a = S(E, ["withCredentials", "events"]);
|
|
1458
1453
|
c === void 0 && (c = !0);
|
|
1459
1454
|
var i = r(r({}, a), { eventSourceOptions: {
|
|
1460
|
-
withCredentials:
|
|
1455
|
+
withCredentials: s
|
|
1461
1456
|
} }), t = (0, O.useRef)(f.EMPTY_EVENT_HANDLERS);
|
|
1462
1457
|
o && (t.current = o);
|
|
1463
|
-
var n = (0,
|
|
1458
|
+
var n = (0, d.useWebSocket)(y, i, c), v = n.lastMessage, h = n.readyState, u = n.getWebSocket;
|
|
1464
1459
|
return (0, O.useEffect)(function() {
|
|
1465
1460
|
v?.type && Object.entries(t.current).forEach(function(b) {
|
|
1466
|
-
var
|
|
1467
|
-
|
|
1461
|
+
var R = b[0], P = b[1];
|
|
1462
|
+
R === v.type && P(v);
|
|
1468
1463
|
});
|
|
1469
1464
|
}, [v]), {
|
|
1470
1465
|
lastEvent: v,
|
|
@@ -1474,34 +1469,34 @@ function Ot() {
|
|
|
1474
1469
|
};
|
|
1475
1470
|
return Q.useEventSource = _, Q;
|
|
1476
1471
|
}
|
|
1477
|
-
var
|
|
1478
|
-
function
|
|
1479
|
-
return
|
|
1472
|
+
var Ir;
|
|
1473
|
+
function Tt() {
|
|
1474
|
+
return Ir || (Ir = 1, (function(r) {
|
|
1480
1475
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetGlobalState = r.useEventSource = r.ReadyState = r.useSocketIO = r.default = void 0;
|
|
1481
|
-
var
|
|
1476
|
+
var S = xe();
|
|
1482
1477
|
Object.defineProperty(r, "default", { enumerable: !0, get: function() {
|
|
1483
|
-
return
|
|
1478
|
+
return S.useWebSocket;
|
|
1484
1479
|
} });
|
|
1485
|
-
var O =
|
|
1480
|
+
var O = mt();
|
|
1486
1481
|
Object.defineProperty(r, "useSocketIO", { enumerable: !0, get: function() {
|
|
1487
1482
|
return O.useSocketIO;
|
|
1488
1483
|
} });
|
|
1489
|
-
var
|
|
1484
|
+
var d = V();
|
|
1490
1485
|
Object.defineProperty(r, "ReadyState", { enumerable: !0, get: function() {
|
|
1491
|
-
return
|
|
1486
|
+
return d.ReadyState;
|
|
1492
1487
|
} });
|
|
1493
|
-
var f =
|
|
1488
|
+
var f = pt();
|
|
1494
1489
|
Object.defineProperty(r, "useEventSource", { enumerable: !0, get: function() {
|
|
1495
1490
|
return f.useEventSource;
|
|
1496
1491
|
} });
|
|
1497
|
-
var _ =
|
|
1492
|
+
var _ = Ke();
|
|
1498
1493
|
Object.defineProperty(r, "resetGlobalState", { enumerable: !0, get: function() {
|
|
1499
1494
|
return _.resetGlobalState;
|
|
1500
1495
|
} });
|
|
1501
|
-
})(
|
|
1496
|
+
})(We)), We;
|
|
1502
1497
|
}
|
|
1503
|
-
var
|
|
1504
|
-
const
|
|
1498
|
+
var Ct = Tt();
|
|
1499
|
+
const Rt = /* @__PURE__ */ vt(Ct), H = {
|
|
1505
1500
|
DEPOSIT: "deposit",
|
|
1506
1501
|
TRANS_CODE: "transCode",
|
|
1507
1502
|
ERROR: "error",
|
|
@@ -1512,46 +1507,46 @@ const Tt = /* @__PURE__ */ lt(mt), H = {
|
|
|
1512
1507
|
TRANSFER_IN_GAME: "transfer_in_game",
|
|
1513
1508
|
CHECK_REQUEST: "CHECK_RREQUEST",
|
|
1514
1509
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
1515
|
-
},
|
|
1510
|
+
}, wt = 3e4, jt = ({
|
|
1516
1511
|
socketUrl: r,
|
|
1517
|
-
socketHandlers:
|
|
1512
|
+
socketHandlers: S = {},
|
|
1518
1513
|
options: O = {}
|
|
1519
1514
|
}) => {
|
|
1520
|
-
const
|
|
1515
|
+
const d = fr(!1), f = fr(S), {
|
|
1521
1516
|
sendMessage: _,
|
|
1522
1517
|
// 發送普通訊息
|
|
1523
|
-
sendJsonMessage:
|
|
1518
|
+
sendJsonMessage: y,
|
|
1524
1519
|
// 發送 JSON 訊息
|
|
1525
|
-
lastMessage:
|
|
1520
|
+
lastMessage: E,
|
|
1526
1521
|
// 最後接收到的訊息
|
|
1527
1522
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
1528
1523
|
readyState: c
|
|
1529
1524
|
// WebSocket 連線狀態
|
|
1530
1525
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
1531
|
-
} =
|
|
1526
|
+
} = Rt(r, {
|
|
1532
1527
|
queryParams: { key: "wsky" },
|
|
1533
1528
|
onOpen: () => console.log("連線成功"),
|
|
1534
|
-
shouldReconnect: () =>
|
|
1529
|
+
shouldReconnect: () => d.current === !1,
|
|
1535
1530
|
reconnectAttempts: 9999,
|
|
1536
1531
|
reconnectInterval: 1e3,
|
|
1537
1532
|
...O
|
|
1538
|
-
}),
|
|
1533
|
+
}), s = He(() => {
|
|
1539
1534
|
try {
|
|
1540
|
-
return JSON.parse(
|
|
1535
|
+
return JSON.parse(E?.data);
|
|
1541
1536
|
} catch {
|
|
1542
1537
|
return null;
|
|
1543
1538
|
}
|
|
1544
|
-
}, [
|
|
1545
|
-
return
|
|
1539
|
+
}, [E?.data]);
|
|
1540
|
+
return we(() => {
|
|
1546
1541
|
const o = setInterval(
|
|
1547
1542
|
() => _("ping"),
|
|
1548
|
-
|
|
1543
|
+
wt
|
|
1549
1544
|
);
|
|
1550
1545
|
return () => clearInterval(o);
|
|
1551
|
-
}, [_]),
|
|
1552
|
-
f.current =
|
|
1553
|
-
}, [
|
|
1554
|
-
if (!
|
|
1546
|
+
}, [_]), we(() => {
|
|
1547
|
+
f.current = S;
|
|
1548
|
+
}, [S]), we(() => {
|
|
1549
|
+
if (!s) return;
|
|
1555
1550
|
const {
|
|
1556
1551
|
onDeposit: o,
|
|
1557
1552
|
onTransCode: a,
|
|
@@ -1562,12 +1557,12 @@ const Tt = /* @__PURE__ */ lt(mt), H = {
|
|
|
1562
1557
|
onReload: h,
|
|
1563
1558
|
onTransferInGame: u,
|
|
1564
1559
|
onCashRegisterLimit: b
|
|
1565
|
-
} = f.current,
|
|
1566
|
-
memberInfoUid:
|
|
1567
|
-
data:
|
|
1568
|
-
memo:
|
|
1560
|
+
} = f.current, R = Ae(s, "type", ""), P = {
|
|
1561
|
+
memberInfoUid: Ae(s, "member_info_uid", null),
|
|
1562
|
+
data: Ae(s, "data", null),
|
|
1563
|
+
memo: Ae(s, "memo", null)
|
|
1569
1564
|
};
|
|
1570
|
-
switch (
|
|
1565
|
+
switch (R) {
|
|
1571
1566
|
case H.DEPOSIT:
|
|
1572
1567
|
o?.(P);
|
|
1573
1568
|
break;
|
|
@@ -1597,38 +1592,74 @@ const Tt = /* @__PURE__ */ lt(mt), H = {
|
|
|
1597
1592
|
b?.(P);
|
|
1598
1593
|
break;
|
|
1599
1594
|
default:
|
|
1600
|
-
console.warn("Unknown socket type:",
|
|
1595
|
+
console.warn("Unknown socket type:", R);
|
|
1601
1596
|
break;
|
|
1602
1597
|
}
|
|
1603
|
-
}, [
|
|
1598
|
+
}, [s]), we(() => () => d.current = !0, []), {
|
|
1604
1599
|
sendMessage: _,
|
|
1605
|
-
sendJsonMessage:
|
|
1600
|
+
sendJsonMessage: y,
|
|
1606
1601
|
readyState: c
|
|
1607
1602
|
// WebSocket 連線狀態
|
|
1608
1603
|
};
|
|
1609
|
-
},
|
|
1604
|
+
}, Lr = () => {
|
|
1605
|
+
const { client: r } = ke(), S = oe(async () => {
|
|
1606
|
+
const { data: d } = await r.get("/carousels");
|
|
1607
|
+
return d;
|
|
1608
|
+
}, [r]), O = oe(async () => await r.get("/marquees"), [r]);
|
|
1609
|
+
return { commonCarouselApi: S, commonMarqueeApi: O };
|
|
1610
|
+
}, Ut = () => {
|
|
1611
|
+
const { commonCarouselApi: r } = Lr();
|
|
1612
|
+
return he({
|
|
1613
|
+
queryKey: ["getCarouselList"],
|
|
1614
|
+
queryFn: async () => await r()
|
|
1615
|
+
});
|
|
1616
|
+
}, Wt = () => {
|
|
1617
|
+
const { commonMarqueeApi: r } = Lr();
|
|
1618
|
+
return he({
|
|
1619
|
+
queryKey: ["getMarqueeList"],
|
|
1620
|
+
queryFn: async () => r()
|
|
1621
|
+
});
|
|
1622
|
+
}, Ft = ({
|
|
1610
1623
|
refetchInterval: r = 5e4,
|
|
1611
|
-
trigger:
|
|
1624
|
+
trigger: S = [],
|
|
1612
1625
|
enabled: O = !0
|
|
1613
1626
|
} = {}) => {
|
|
1614
|
-
const { getToken:
|
|
1627
|
+
const { getToken: d } = ke(), { userInfoApi: f } = Ve(), _ = kr({
|
|
1615
1628
|
queries: [
|
|
1616
1629
|
{
|
|
1617
|
-
queryKey: ["getMemberInfo", ...
|
|
1630
|
+
queryKey: ["getMemberInfo", ...S],
|
|
1618
1631
|
queryFn: async () => await f(),
|
|
1619
1632
|
refetchInterval: r,
|
|
1620
|
-
enabled: !!
|
|
1633
|
+
enabled: !!d && O
|
|
1621
1634
|
}
|
|
1622
1635
|
]
|
|
1623
|
-
}), { data:
|
|
1624
|
-
return { data:
|
|
1636
|
+
}), { data: y, isFetching: E, error: c } = _[0] || {};
|
|
1637
|
+
return { data: y, isFetching: E, error: c };
|
|
1638
|
+
}, qt = ({ enabled: r = !0 } = {}) => {
|
|
1639
|
+
const { userInfoApi: S, userFavoriteGameApi: O, userGameListApi: d } = Ve(), f = he({
|
|
1640
|
+
queryKey: ["getMemInfo"],
|
|
1641
|
+
queryFn: async () => S(),
|
|
1642
|
+
enabled: r
|
|
1643
|
+
}), _ = he({
|
|
1644
|
+
queryKey: ["getFavoriteGame"],
|
|
1645
|
+
queryFn: async () => O(),
|
|
1646
|
+
enabled: r && f.isSuccess
|
|
1647
|
+
}), y = he({
|
|
1648
|
+
queryKey: ["getUserGameList"],
|
|
1649
|
+
queryFn: async () => d(),
|
|
1650
|
+
enabled: r && f.isSuccess && _.isSuccess
|
|
1651
|
+
});
|
|
1652
|
+
return [f, _, y];
|
|
1625
1653
|
};
|
|
1626
1654
|
export {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1655
|
+
Nr as ApiCtx,
|
|
1656
|
+
Mt as ApiProvider,
|
|
1657
|
+
Lt as createLogoutHandler,
|
|
1658
|
+
ke as useApiContext,
|
|
1659
|
+
Dt as useBalanceGetter,
|
|
1660
|
+
jt as useClientWebSocket,
|
|
1661
|
+
Ut as useGetCarouseList,
|
|
1662
|
+
Wt as useGetMarquee,
|
|
1663
|
+
Ft as useGetMemberInfo,
|
|
1664
|
+
qt as useInitializeWithToken
|
|
1634
1665
|
};
|