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