frappe-react-sdk 1.3.10 → 1.3.11
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.
|
@@ -494,7 +494,7 @@ var Ke = {}, Gr = { exports: {} }, Fn = { exports: {} }, Xr = function(e, t) {
|
|
|
494
494
|
s[i] = arguments[i];
|
|
495
495
|
return e.apply(t, s);
|
|
496
496
|
};
|
|
497
|
-
}, ai = Xr,
|
|
497
|
+
}, ai = Xr, Le = Object.prototype.toString;
|
|
498
498
|
function Un(n) {
|
|
499
499
|
return Array.isArray(n);
|
|
500
500
|
}
|
|
@@ -505,10 +505,10 @@ function ui(n) {
|
|
|
505
505
|
return n !== null && !En(n) && n.constructor !== null && !En(n.constructor) && typeof n.constructor.isBuffer == "function" && n.constructor.isBuffer(n);
|
|
506
506
|
}
|
|
507
507
|
function Qr(n) {
|
|
508
|
-
return
|
|
508
|
+
return Le.call(n) === "[object ArrayBuffer]";
|
|
509
509
|
}
|
|
510
510
|
function ci(n) {
|
|
511
|
-
return
|
|
511
|
+
return Le.call(n) === "[object FormData]";
|
|
512
512
|
}
|
|
513
513
|
function li(n) {
|
|
514
514
|
var e;
|
|
@@ -523,29 +523,29 @@ function hi(n) {
|
|
|
523
523
|
function Zr(n) {
|
|
524
524
|
return n !== null && typeof n == "object";
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
if (
|
|
526
|
+
function Lt(n) {
|
|
527
|
+
if (Le.call(n) !== "[object Object]")
|
|
528
528
|
return !1;
|
|
529
529
|
var e = Object.getPrototypeOf(n);
|
|
530
530
|
return e === null || e === Object.prototype;
|
|
531
531
|
}
|
|
532
532
|
function di(n) {
|
|
533
|
-
return
|
|
533
|
+
return Le.call(n) === "[object Date]";
|
|
534
534
|
}
|
|
535
535
|
function pi(n) {
|
|
536
|
-
return
|
|
536
|
+
return Le.call(n) === "[object File]";
|
|
537
537
|
}
|
|
538
538
|
function vi(n) {
|
|
539
|
-
return
|
|
539
|
+
return Le.call(n) === "[object Blob]";
|
|
540
540
|
}
|
|
541
541
|
function es(n) {
|
|
542
|
-
return
|
|
542
|
+
return Le.call(n) === "[object Function]";
|
|
543
543
|
}
|
|
544
544
|
function yi(n) {
|
|
545
545
|
return Zr(n) && es(n.pipe);
|
|
546
546
|
}
|
|
547
547
|
function mi(n) {
|
|
548
|
-
return
|
|
548
|
+
return Le.call(n) === "[object URLSearchParams]";
|
|
549
549
|
}
|
|
550
550
|
function gi(n) {
|
|
551
551
|
return n.trim ? n.trim() : n.replace(/^\s+|\s+$/g, "");
|
|
@@ -565,7 +565,7 @@ function qn(n, e) {
|
|
|
565
565
|
function Rn() {
|
|
566
566
|
var n = {};
|
|
567
567
|
function e(s, i) {
|
|
568
|
-
|
|
568
|
+
Lt(n[i]) && Lt(s) ? n[i] = Rn(n[i], s) : Lt(s) ? n[i] = Rn({}, s) : Un(s) ? n[i] = s.slice() : n[i] = s;
|
|
569
569
|
}
|
|
570
570
|
for (var t = 0, r = arguments.length; t < r; t++)
|
|
571
571
|
qn(arguments[t], e);
|
|
@@ -588,7 +588,7 @@ var ae = {
|
|
|
588
588
|
isString: fi,
|
|
589
589
|
isNumber: hi,
|
|
590
590
|
isObject: Zr,
|
|
591
|
-
isPlainObject:
|
|
591
|
+
isPlainObject: Lt,
|
|
592
592
|
isUndefined: En,
|
|
593
593
|
isDate: di,
|
|
594
594
|
isFile: pi,
|
|
@@ -754,7 +754,7 @@ function Di() {
|
|
|
754
754
|
}, en;
|
|
755
755
|
}
|
|
756
756
|
var tn, fr;
|
|
757
|
-
function
|
|
757
|
+
function Li() {
|
|
758
758
|
if (fr)
|
|
759
759
|
return tn;
|
|
760
760
|
fr = 1;
|
|
@@ -790,7 +790,7 @@ function ki() {
|
|
|
790
790
|
}, tn;
|
|
791
791
|
}
|
|
792
792
|
var nn, hr;
|
|
793
|
-
function
|
|
793
|
+
function ki() {
|
|
794
794
|
if (hr)
|
|
795
795
|
return nn;
|
|
796
796
|
hr = 1;
|
|
@@ -837,11 +837,11 @@ function vr() {
|
|
|
837
837
|
if (pr)
|
|
838
838
|
return sn;
|
|
839
839
|
pr = 1;
|
|
840
|
-
var n = ae, e = Oi(), t = xi(), r = ts, s = Di(), i =
|
|
840
|
+
var n = ae, e = Oi(), t = xi(), r = ts, s = Di(), i = Li(), o = ki(), c = ss(), l = rs, a = qt();
|
|
841
841
|
return sn = function(f) {
|
|
842
842
|
return new Promise(function(m, g) {
|
|
843
843
|
var b = f.data, E = f.headers, _ = f.responseType, S;
|
|
844
|
-
function
|
|
844
|
+
function L() {
|
|
845
845
|
f.cancelToken && f.cancelToken.unsubscribe(S), f.signal && f.signal.removeEventListener("abort", S);
|
|
846
846
|
}
|
|
847
847
|
n.isFormData(b) && delete E["Content-Type"];
|
|
@@ -854,18 +854,18 @@ function vr() {
|
|
|
854
854
|
y.open(f.method.toUpperCase(), r(V, f.params, f.paramsSerializer), !0), y.timeout = f.timeout;
|
|
855
855
|
function D() {
|
|
856
856
|
if (!!y) {
|
|
857
|
-
var
|
|
857
|
+
var k = "getAllResponseHeaders" in y ? i(y.getAllResponseHeaders()) : null, Q = !_ || _ === "text" || _ === "json" ? y.responseText : y.response, ne = {
|
|
858
858
|
data: Q,
|
|
859
859
|
status: y.status,
|
|
860
860
|
statusText: y.statusText,
|
|
861
|
-
headers:
|
|
861
|
+
headers: k,
|
|
862
862
|
config: f,
|
|
863
863
|
request: y
|
|
864
864
|
};
|
|
865
865
|
e(function(F) {
|
|
866
|
-
m(F),
|
|
866
|
+
m(F), L();
|
|
867
867
|
}, function(F) {
|
|
868
|
-
g(F),
|
|
868
|
+
g(F), L();
|
|
869
869
|
}, ne), y = null;
|
|
870
870
|
}
|
|
871
871
|
}
|
|
@@ -889,8 +889,8 @@ function vr() {
|
|
|
889
889
|
}
|
|
890
890
|
"setRequestHeader" in y && n.forEach(E, function(Q, ne) {
|
|
891
891
|
typeof b > "u" && ne.toLowerCase() === "content-type" ? delete E[ne] : y.setRequestHeader(ne, Q);
|
|
892
|
-
}), n.isUndefined(f.withCredentials) || (y.withCredentials = !!f.withCredentials), _ && _ !== "json" && (y.responseType = f.responseType), typeof f.onDownloadProgress == "function" && y.addEventListener("progress", f.onDownloadProgress), typeof f.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", f.onUploadProgress), (f.cancelToken || f.signal) && (S = function(
|
|
893
|
-
!y || (g(!
|
|
892
|
+
}), n.isUndefined(f.withCredentials) || (y.withCredentials = !!f.withCredentials), _ && _ !== "json" && (y.responseType = f.responseType), typeof f.onDownloadProgress == "function" && y.addEventListener("progress", f.onDownloadProgress), typeof f.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", f.onUploadProgress), (f.cancelToken || f.signal) && (S = function(k) {
|
|
893
|
+
!y || (g(!k || k && k.type ? new a("canceled") : k), y.abort(), y = null);
|
|
894
894
|
}, f.cancelToken && f.cancelToken.subscribe(S), f.signal && (f.signal.aborted ? S() : f.signal.addEventListener("abort", S))), b || (b = null), y.send(b);
|
|
895
895
|
});
|
|
896
896
|
}, sn;
|
|
@@ -1251,15 +1251,15 @@ function Qi() {
|
|
|
1251
1251
|
return n.isObject(t) && t.isAxiosError === !0;
|
|
1252
1252
|
}, hn;
|
|
1253
1253
|
}
|
|
1254
|
-
var xr = ae, Zi = Xr,
|
|
1254
|
+
var xr = ae, Zi = Xr, kt = Ki, eo = os, to = In;
|
|
1255
1255
|
function ls(n) {
|
|
1256
|
-
var e = new
|
|
1257
|
-
return xr.extend(t,
|
|
1256
|
+
var e = new kt(n), t = Zi(kt.prototype.request, e);
|
|
1257
|
+
return xr.extend(t, kt.prototype, e), xr.extend(t, e), t.create = function(s) {
|
|
1258
1258
|
return ls(eo(n, s));
|
|
1259
1259
|
}, t;
|
|
1260
1260
|
}
|
|
1261
1261
|
var _e = ls(to);
|
|
1262
|
-
_e.Axios =
|
|
1262
|
+
_e.Axios = kt;
|
|
1263
1263
|
_e.Cancel = qt();
|
|
1264
1264
|
_e.CancelToken = Gi();
|
|
1265
1265
|
_e.isCancel = is();
|
|
@@ -1550,33 +1550,33 @@ var pn = {};
|
|
|
1550
1550
|
* This source code is licensed under the MIT license found in the
|
|
1551
1551
|
* LICENSE file in the root directory of this source tree.
|
|
1552
1552
|
*/
|
|
1553
|
-
var
|
|
1553
|
+
var Lr;
|
|
1554
1554
|
function uo() {
|
|
1555
|
-
return
|
|
1555
|
+
return Lr || (Lr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1556
1556
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
1557
1557
|
var n = qe, e = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1558
|
-
function t(
|
|
1558
|
+
function t(L) {
|
|
1559
1559
|
{
|
|
1560
1560
|
for (var y = arguments.length, M = new Array(y > 1 ? y - 1 : 0), T = 1; T < y; T++)
|
|
1561
1561
|
M[T - 1] = arguments[T];
|
|
1562
|
-
r("error",
|
|
1562
|
+
r("error", L, M);
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
function r(
|
|
1565
|
+
function r(L, y, M) {
|
|
1566
1566
|
{
|
|
1567
1567
|
var T = e.ReactDebugCurrentFrame, V = T.getStackAddendum();
|
|
1568
1568
|
V !== "" && (y += "%s", M = M.concat([V]));
|
|
1569
1569
|
var D = M.map(function(j) {
|
|
1570
1570
|
return String(j);
|
|
1571
1571
|
});
|
|
1572
|
-
D.unshift("Warning: " + y), Function.prototype.apply.call(console[
|
|
1572
|
+
D.unshift("Warning: " + y), Function.prototype.apply.call(console[L], console, D);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function s(
|
|
1576
|
-
return
|
|
1575
|
+
function s(L, y) {
|
|
1576
|
+
return L === y && (L !== 0 || 1 / L === 1 / y) || L !== L && y !== y;
|
|
1577
1577
|
}
|
|
1578
1578
|
var i = typeof Object.is == "function" ? Object.is : s, o = n.useState, c = n.useEffect, l = n.useLayoutEffect, a = n.useDebugValue, h = !1, f = !1;
|
|
1579
|
-
function p(
|
|
1579
|
+
function p(L, y, M) {
|
|
1580
1580
|
h || n.startTransition !== void 0 && (h = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
1581
1581
|
var T = y();
|
|
1582
1582
|
if (!f) {
|
|
@@ -1588,25 +1588,25 @@ function uo() {
|
|
|
1588
1588
|
value: T,
|
|
1589
1589
|
getSnapshot: y
|
|
1590
1590
|
}
|
|
1591
|
-
}), j = D[0].inst,
|
|
1591
|
+
}), j = D[0].inst, k = D[1];
|
|
1592
1592
|
return l(function() {
|
|
1593
|
-
j.value = T, j.getSnapshot = y, m(j) &&
|
|
1593
|
+
j.value = T, j.getSnapshot = y, m(j) && k({
|
|
1594
1594
|
inst: j
|
|
1595
1595
|
});
|
|
1596
|
-
}, [
|
|
1597
|
-
m(j) &&
|
|
1596
|
+
}, [L, T, y]), c(function() {
|
|
1597
|
+
m(j) && k({
|
|
1598
1598
|
inst: j
|
|
1599
1599
|
});
|
|
1600
1600
|
var Q = function() {
|
|
1601
|
-
m(j) &&
|
|
1601
|
+
m(j) && k({
|
|
1602
1602
|
inst: j
|
|
1603
1603
|
});
|
|
1604
1604
|
};
|
|
1605
|
-
return
|
|
1606
|
-
}, [
|
|
1605
|
+
return L(Q);
|
|
1606
|
+
}, [L]), a(T), T;
|
|
1607
1607
|
}
|
|
1608
|
-
function m(
|
|
1609
|
-
var y =
|
|
1608
|
+
function m(L) {
|
|
1609
|
+
var y = L.getSnapshot, M = L.value;
|
|
1610
1610
|
try {
|
|
1611
1611
|
var T = y();
|
|
1612
1612
|
return !i(M, T);
|
|
@@ -1614,7 +1614,7 @@ function uo() {
|
|
|
1614
1614
|
return !0;
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
|
-
function g(
|
|
1617
|
+
function g(L, y, M) {
|
|
1618
1618
|
return y();
|
|
1619
1619
|
}
|
|
1620
1620
|
var b = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", E = !b, _ = E ? g : p, S = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : _;
|
|
@@ -1692,7 +1692,7 @@ const ho = () => Tn, [On, xn] = $t && window.addEventListener ? [
|
|
|
1692
1692
|
}, go = {
|
|
1693
1693
|
initFocus: vo,
|
|
1694
1694
|
initReconnect: yo
|
|
1695
|
-
},
|
|
1695
|
+
}, kr = !qe.useId, lt = !$t || "Deno" in window, _o = (n) => fo() ? window.requestAnimationFrame(n) : setTimeout(n, 1), mn = lt ? Ge : ei, gn = typeof navigator < "u" && navigator.connection, Nr = !lt && gn && ([
|
|
1696
1696
|
"slow-2g",
|
|
1697
1697
|
"2g"
|
|
1698
1698
|
].includes(gn.effectiveType) || gn.saveData), $n = (n) => {
|
|
@@ -1739,9 +1739,9 @@ async function gs(...n) {
|
|
|
1739
1739
|
const [g] = $n(m);
|
|
1740
1740
|
if (!g)
|
|
1741
1741
|
return;
|
|
1742
|
-
const [b, E] = ps(e, g), [_, S,
|
|
1742
|
+
const [b, E] = ps(e, g), [_, S, L, y] = Te.get(e), M = () => {
|
|
1743
1743
|
const F = _[g];
|
|
1744
|
-
return a && (delete
|
|
1744
|
+
return a && (delete L[g], delete y[g], F && F[0]) ? F[0](ms).then(() => b().data) : b().data;
|
|
1745
1745
|
};
|
|
1746
1746
|
if (n.length < 3)
|
|
1747
1747
|
return M();
|
|
@@ -1751,7 +1751,7 @@ async function gs(...n) {
|
|
|
1751
1751
|
D,
|
|
1752
1752
|
0
|
|
1753
1753
|
];
|
|
1754
|
-
const j = !C(l),
|
|
1754
|
+
const j = !C(l), k = b(), Q = k.data, ne = k._c, G = C(ne) ? Q : ne;
|
|
1755
1755
|
if (j && (l = Oe(l) ? l(G, Q) : l, E({
|
|
1756
1756
|
data: l,
|
|
1757
1757
|
_c: G
|
|
@@ -1874,9 +1874,9 @@ const Pr = (n, e) => {
|
|
|
1874
1874
|
r && i && (t.use = r.concat(i)), s && o && (t.fallback = De(s, o));
|
|
1875
1875
|
}
|
|
1876
1876
|
return t;
|
|
1877
|
-
}, Co = zr({}), Ao = "$inf$", bs = $t && window.__SWR_DEVTOOLS_USE__, Do = bs ? window.__SWR_DEVTOOLS_USE__ : [],
|
|
1877
|
+
}, Co = zr({}), Ao = "$inf$", bs = $t && window.__SWR_DEVTOOLS_USE__, Do = bs ? window.__SWR_DEVTOOLS_USE__ : [], Lo = () => {
|
|
1878
1878
|
bs && (window.__SWR_DEVTOOLS_REACT__ = qe);
|
|
1879
|
-
},
|
|
1879
|
+
}, ko = (n) => Oe(n[1]) ? [
|
|
1880
1880
|
n[0],
|
|
1881
1881
|
n[1],
|
|
1882
1882
|
n[2] || {}
|
|
@@ -1891,7 +1891,7 @@ const Pr = (n, e) => {
|
|
|
1891
1891
|
const l = c[o];
|
|
1892
1892
|
return C(l) ? t(...i) : (delete c[o], l);
|
|
1893
1893
|
}), r), Bo = Do.concat(Po), Fo = (n) => function(...t) {
|
|
1894
|
-
const r = No(), [s, i, o] =
|
|
1894
|
+
const r = No(), [s, i, o] = ko(t), c = xo(r, o);
|
|
1895
1895
|
let l = n;
|
|
1896
1896
|
const { use: a } = c, h = (a || []).concat(Bo);
|
|
1897
1897
|
for (let f = h.length; f--; )
|
|
@@ -1904,7 +1904,7 @@ const Pr = (n, e) => {
|
|
|
1904
1904
|
s >= 0 && (r[s] = r[r.length - 1], r.pop());
|
|
1905
1905
|
};
|
|
1906
1906
|
};
|
|
1907
|
-
|
|
1907
|
+
Lo();
|
|
1908
1908
|
const Br = qe.use || ((n) => {
|
|
1909
1909
|
if (n.status === "pending")
|
|
1910
1910
|
throw n;
|
|
@@ -1918,7 +1918,7 @@ const Br = qe.use || ((n) => {
|
|
|
1918
1918
|
}), _n = {
|
|
1919
1919
|
dedupe: !0
|
|
1920
1920
|
}, qo = (n, e, t) => {
|
|
1921
|
-
const { cache: r, compare: s, suspense: i, fallbackData: o, revalidateOnMount: c, revalidateIfStale: l, refreshInterval: a, refreshWhenHidden: h, refreshWhenOffline: f, keepPreviousData: p } = t, [m, g, b, E] = Te.get(r), [_, S] = $n(n),
|
|
1921
|
+
const { cache: r, compare: s, suspense: i, fallbackData: o, revalidateOnMount: c, revalidateIfStale: l, refreshInterval: a, refreshWhenHidden: h, refreshWhenOffline: f, keepPreviousData: p } = t, [m, g, b, E] = Te.get(r), [_, S] = $n(n), L = Be(!1), y = Be(!1), M = Be(_), T = Be(e), V = Be(t), D = () => V.current, j = () => D().isVisible() && D().isOnline(), [k, Q, ne, G] = ps(r, _), F = Be({}).current, ke = C(o) ? t.fallback[_] : o, Qe = (N, U) => {
|
|
1922
1922
|
for (const X in F) {
|
|
1923
1923
|
const I = X;
|
|
1924
1924
|
if (I === "data") {
|
|
@@ -1936,11 +1936,11 @@ const Br = qe.use || ((n) => {
|
|
|
1936
1936
|
isLoading: !0,
|
|
1937
1937
|
...de
|
|
1938
1938
|
} : de;
|
|
1939
|
-
}, X =
|
|
1939
|
+
}, X = k(), I = G(), re = U(X), Re = X === I ? re : U(I);
|
|
1940
1940
|
let H = re;
|
|
1941
1941
|
return [
|
|
1942
1942
|
() => {
|
|
1943
|
-
const J = U(
|
|
1943
|
+
const J = U(k());
|
|
1944
1944
|
return Qe(J, H) ? (H.data = J.data, H.isLoading = J.isLoading, H.isValidating = J.isValidating, H.error = J.error, H) : (H = J, J);
|
|
1945
1945
|
},
|
|
1946
1946
|
() => Re
|
|
@@ -1956,13 +1956,13 @@ const Br = qe.use || ((n) => {
|
|
|
1956
1956
|
r,
|
|
1957
1957
|
_
|
|
1958
1958
|
]
|
|
1959
|
-
), Ze[0], Ze[1]), et = !
|
|
1959
|
+
), Ze[0], Ze[1]), et = !L.current, yt = m[_] && m[_].length > 0, we = be.data, Ee = C(we) ? ke : we, Ne = be.error, mt = Be(Ee), Ie = p ? C(we) ? mt.current : we : Ee, Ve = (() => yt && !C(Ne) ? !1 : et && !C(c) ? c : D().isPaused() ? !1 : i ? C(Ee) ? !1 : l : C(Ee) || l)(), je = !!(_ && e && et && Ve), $e = C(be.isValidating) ? je : be.isValidating, tt = C(be.isLoading) ? je : be.isLoading, ve = $(
|
|
1960
1960
|
async (N) => {
|
|
1961
1961
|
const U = T.current;
|
|
1962
1962
|
if (!_ || !U || y.current || D().isPaused())
|
|
1963
1963
|
return !1;
|
|
1964
1964
|
let X, I, re = !0;
|
|
1965
|
-
const Re = N || {}, H = !b[_] || !Re.dedupe, J = () =>
|
|
1965
|
+
const Re = N || {}, H = !b[_] || !Re.dedupe, J = () => kr ? !y.current && _ === M.current && L.current : _ === M.current, de = {
|
|
1966
1966
|
isValidating: !1,
|
|
1967
1967
|
isLoading: !1
|
|
1968
1968
|
}, _t = () => {
|
|
@@ -1973,9 +1973,9 @@ const Br = qe.use || ((n) => {
|
|
|
1973
1973
|
}, bt = {
|
|
1974
1974
|
isValidating: !0
|
|
1975
1975
|
};
|
|
1976
|
-
C(
|
|
1976
|
+
C(k().data) && (bt.isLoading = !0);
|
|
1977
1977
|
try {
|
|
1978
|
-
if (H && (Q(bt), t.loadingTimeout && C(
|
|
1978
|
+
if (H && (Q(bt), t.loadingTimeout && C(k().data) && setTimeout(() => {
|
|
1979
1979
|
re && J() && D().onLoadingSlow(_, t);
|
|
1980
1980
|
}, t.loadingTimeout), b[_] = [
|
|
1981
1981
|
U(S),
|
|
@@ -1986,7 +1986,7 @@ const Br = qe.use || ((n) => {
|
|
|
1986
1986
|
const ie = g[_];
|
|
1987
1987
|
if (!C(ie) && (I <= ie[0] || I <= ie[1] || ie[1] === 0))
|
|
1988
1988
|
return _t(), H && J() && D().onDiscarded(_), !1;
|
|
1989
|
-
const ce =
|
|
1989
|
+
const ce = k().data;
|
|
1990
1990
|
de.data = s(ce, X) ? ce : X, H && J() && D().onSuccess(X, _, t);
|
|
1991
1991
|
} catch (ie) {
|
|
1992
1992
|
Me();
|
|
@@ -2029,7 +2029,7 @@ const Br = qe.use || ((n) => {
|
|
|
2029
2029
|
return ve(Re);
|
|
2030
2030
|
}
|
|
2031
2031
|
});
|
|
2032
|
-
return y.current = !1, M.current = _,
|
|
2032
|
+
return y.current = !1, M.current = _, L.current = !0, Q({
|
|
2033
2033
|
_k: S
|
|
2034
2034
|
}), Ve && (C(Ee) || lt ? N() : _o(N)), () => {
|
|
2035
2035
|
y.current = !0, I();
|
|
@@ -2039,11 +2039,11 @@ const Br = qe.use || ((n) => {
|
|
|
2039
2039
|
]), mn(() => {
|
|
2040
2040
|
let N;
|
|
2041
2041
|
function U() {
|
|
2042
|
-
const I = Oe(a) ? a(
|
|
2042
|
+
const I = Oe(a) ? a(k().data) : a;
|
|
2043
2043
|
I && N !== -1 && (N = setTimeout(X, I));
|
|
2044
2044
|
}
|
|
2045
2045
|
function X() {
|
|
2046
|
-
!
|
|
2046
|
+
!k().error && (h || D().isVisible()) && (f || D().isOnline()) ? ve(_n).then(U) : U();
|
|
2047
2047
|
}
|
|
2048
2048
|
return U(), () => {
|
|
2049
2049
|
N && (clearTimeout(N), N = -1);
|
|
@@ -2054,7 +2054,7 @@ const Br = qe.use || ((n) => {
|
|
|
2054
2054
|
f,
|
|
2055
2055
|
_
|
|
2056
2056
|
]), ti(Ie), i && C(Ee) && _) {
|
|
2057
|
-
if (!
|
|
2057
|
+
if (!kr && lt)
|
|
2058
2058
|
throw new Error("Fallback data is required when using suspense in SSR.");
|
|
2059
2059
|
T.current = e, V.current = t, y.current = !1;
|
|
2060
2060
|
const N = E[_];
|
|
@@ -2403,7 +2403,7 @@ try {
|
|
|
2403
2403
|
} catch {
|
|
2404
2404
|
}
|
|
2405
2405
|
const ra = Ds;
|
|
2406
|
-
function
|
|
2406
|
+
function Ls(n) {
|
|
2407
2407
|
const e = n.xdomain;
|
|
2408
2408
|
try {
|
|
2409
2409
|
if (typeof XMLHttpRequest < "u" && (!e || ra))
|
|
@@ -2419,7 +2419,7 @@ function ks(n) {
|
|
|
2419
2419
|
function sa() {
|
|
2420
2420
|
}
|
|
2421
2421
|
const ia = function() {
|
|
2422
|
-
return new
|
|
2422
|
+
return new Ls({
|
|
2423
2423
|
xdomain: !1
|
|
2424
2424
|
}).responseType != null;
|
|
2425
2425
|
}();
|
|
@@ -2509,7 +2509,7 @@ class me extends K {
|
|
|
2509
2509
|
var e;
|
|
2510
2510
|
const t = xs(this.opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
2511
2511
|
t.xdomain = !!this.opts.xd;
|
|
2512
|
-
const r = this.xhr = new
|
|
2512
|
+
const r = this.xhr = new Ls(t);
|
|
2513
2513
|
try {
|
|
2514
2514
|
r.open(this.method, this.uri, !0);
|
|
2515
2515
|
try {
|
|
@@ -2694,7 +2694,7 @@ const la = {
|
|
|
2694
2694
|
"query",
|
|
2695
2695
|
"anchor"
|
|
2696
2696
|
];
|
|
2697
|
-
function
|
|
2697
|
+
function Ln(n) {
|
|
2698
2698
|
const e = n, t = n.indexOf("["), r = n.indexOf("]");
|
|
2699
2699
|
t != -1 && r != -1 && (n = n.substring(0, t) + n.substring(t, r).replace(/:/g, ";") + n.substring(r, n.length));
|
|
2700
2700
|
let s = fa.exec(n || ""), i = {}, o = 14;
|
|
@@ -2714,7 +2714,7 @@ function pa(n, e) {
|
|
|
2714
2714
|
}
|
|
2715
2715
|
class Ce extends K {
|
|
2716
2716
|
constructor(e, t = {}) {
|
|
2717
|
-
super(), this.binaryType = aa, this.writeBuffer = [], e && typeof e == "object" && (t = e, e = null), e ? (e =
|
|
2717
|
+
super(), this.binaryType = aa, this.writeBuffer = [], e && typeof e == "object" && (t = e, e = null), e ? (e = Ln(e), t.hostname = e.host, t.secure = e.protocol === "https" || e.protocol === "wss", t.port = e.port, e.query && (t.query = e.query)) : t.host && (t.hostname = Ln(t.host).host), Mt(this, t), this.secure = t.secure != null ? t.secure : typeof location < "u" && location.protocol === "https:", t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = t.transports || [
|
|
2718
2718
|
"polling",
|
|
2719
2719
|
"websocket",
|
|
2720
2720
|
"webtransport"
|
|
@@ -2918,11 +2918,11 @@ class Ce extends K {
|
|
|
2918
2918
|
Ce.protocol = Os;
|
|
2919
2919
|
function va(n, e = "", t) {
|
|
2920
2920
|
let r = n;
|
|
2921
|
-
t = t || typeof location < "u" && location, n == null && (n = t.protocol + "//" + t.host), typeof n == "string" && (n.charAt(0) === "/" && (n.charAt(1) === "/" ? n = t.protocol + n : n = t.host + n), /^(https?|wss?):\/\//.test(n) || (typeof t < "u" ? n = t.protocol + "//" + n : n = "https://" + n), r =
|
|
2921
|
+
t = t || typeof location < "u" && location, n == null && (n = t.protocol + "//" + t.host), typeof n == "string" && (n.charAt(0) === "/" && (n.charAt(1) === "/" ? n = t.protocol + n : n = t.host + n), /^(https?|wss?):\/\//.test(n) || (typeof t < "u" ? n = t.protocol + "//" + n : n = "https://" + n), r = Ln(n)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
|
|
2922
2922
|
const i = r.host.indexOf(":") !== -1 ? "[" + r.host + "]" : r.host;
|
|
2923
2923
|
return r.id = r.protocol + "://" + i + ":" + r.port + e, r.href = r.protocol + "://" + i + (t && t.port === r.port ? "" : ":" + r.port), r;
|
|
2924
2924
|
}
|
|
2925
|
-
const ya = typeof ArrayBuffer == "function", ma = (n) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(n) : n.buffer instanceof ArrayBuffer,
|
|
2925
|
+
const ya = typeof ArrayBuffer == "function", ma = (n) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(n) : n.buffer instanceof ArrayBuffer, ks = Object.prototype.toString, ga = typeof Blob == "function" || typeof Blob < "u" && ks.call(Blob) === "[object BlobConstructor]", _a = typeof File == "function" || typeof File < "u" && ks.call(File) === "[object FileConstructor]";
|
|
2926
2926
|
function Yn(n) {
|
|
2927
2927
|
return ya && (n instanceof ArrayBuffer || ma(n)) || ga && n instanceof Blob || _a && n instanceof File;
|
|
2928
2928
|
}
|
|
@@ -2946,9 +2946,9 @@ function Pt(n, e) {
|
|
|
2946
2946
|
}
|
|
2947
2947
|
function ba(n) {
|
|
2948
2948
|
const e = [], t = n.data, r = n;
|
|
2949
|
-
return r.data =
|
|
2949
|
+
return r.data = kn(t, e), r.attachments = e.length, { packet: r, buffers: e };
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2951
|
+
function kn(n, e) {
|
|
2952
2952
|
if (!n)
|
|
2953
2953
|
return n;
|
|
2954
2954
|
if (Yn(n)) {
|
|
@@ -2957,12 +2957,12 @@ function Ln(n, e) {
|
|
|
2957
2957
|
} else if (Array.isArray(n)) {
|
|
2958
2958
|
const t = new Array(n.length);
|
|
2959
2959
|
for (let r = 0; r < n.length; r++)
|
|
2960
|
-
t[r] =
|
|
2960
|
+
t[r] = kn(n[r], e);
|
|
2961
2961
|
return t;
|
|
2962
2962
|
} else if (typeof n == "object" && !(n instanceof Date)) {
|
|
2963
2963
|
const t = {};
|
|
2964
2964
|
for (const r in n)
|
|
2965
|
-
Object.prototype.hasOwnProperty.call(n, r) && (t[r] =
|
|
2965
|
+
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = kn(n[r], e));
|
|
2966
2966
|
return t;
|
|
2967
2967
|
}
|
|
2968
2968
|
return n;
|
|
@@ -3567,17 +3567,17 @@ class Ca {
|
|
|
3567
3567
|
xe(this, "url");
|
|
3568
3568
|
xe(this, "site_name");
|
|
3569
3569
|
xe(this, "socket");
|
|
3570
|
-
var i, o;
|
|
3570
|
+
var i, o, c;
|
|
3571
3571
|
if (this.socket_port = r != null ? r : "9000", this.host = (i = window.location) == null ? void 0 : i.hostname, this.port = (o = window.location) != null && o.port ? `:${this.socket_port}` : "", this.protocol = this.port ? "http" : "https", e) {
|
|
3572
|
-
let
|
|
3573
|
-
|
|
3572
|
+
let l = new URL(e);
|
|
3573
|
+
l.port = "", r ? (l.port = r, this.url = l.toString()) : this.url = l.toString();
|
|
3574
3574
|
} else
|
|
3575
3575
|
this.url = `${this.protocol}://${this.host}${this.port}/`;
|
|
3576
3576
|
t && (this.url = `${this.url}${t}`), this.site_name = t, this.socket = Bt(`${this.url}`, {
|
|
3577
3577
|
withCredentials: !0,
|
|
3578
3578
|
secure: this.protocol === "https",
|
|
3579
3579
|
extraHeaders: s && s.useToken === !0 ? {
|
|
3580
|
-
Authorization: `${s.type} ${s.token}`
|
|
3580
|
+
Authorization: `${s.type} ${(c = s.token) == null ? void 0 : c.call(s)}`
|
|
3581
3581
|
} : {}
|
|
3582
3582
|
});
|
|
3583
3583
|
}
|
|
@@ -3635,10 +3635,10 @@ function Da() {
|
|
|
3635
3635
|
{
|
|
3636
3636
|
for (var d = arguments.length, v = new Array(d > 1 ? d - 1 : 0), w = 1; w < d; w++)
|
|
3637
3637
|
v[w - 1] = arguments[w];
|
|
3638
|
-
|
|
3638
|
+
L("error", u, v);
|
|
3639
3639
|
}
|
|
3640
3640
|
}
|
|
3641
|
-
function
|
|
3641
|
+
function L(u, d, v) {
|
|
3642
3642
|
{
|
|
3643
3643
|
var w = _.ReactDebugCurrentFrame, A = w.getStackAddendum();
|
|
3644
3644
|
A !== "" && (d += "%s", v = v.concat([A]));
|
|
@@ -3650,7 +3650,7 @@ function Da() {
|
|
|
3650
3650
|
}
|
|
3651
3651
|
var y = !1, M = !1, T = !1, V = !1, D = !1, j;
|
|
3652
3652
|
j = Symbol.for("react.module.reference");
|
|
3653
|
-
function
|
|
3653
|
+
function k(u) {
|
|
3654
3654
|
return !!(typeof u == "string" || typeof u == "function" || u === r || u === i || D || u === s || u === a || u === h || V || u === m || y || M || T || typeof u == "object" && u !== null && (u.$$typeof === p || u.$$typeof === f || u.$$typeof === o || u.$$typeof === c || u.$$typeof === l || u.$$typeof === j || u.getModuleId !== void 0));
|
|
3655
3655
|
}
|
|
3656
3656
|
function Q(u, d, v) {
|
|
@@ -3708,13 +3708,13 @@ function Da() {
|
|
|
3708
3708
|
}
|
|
3709
3709
|
return null;
|
|
3710
3710
|
}
|
|
3711
|
-
var F = Object.assign,
|
|
3711
|
+
var F = Object.assign, ke = 0, Qe, Ze, be, et, yt, we, Ee;
|
|
3712
3712
|
function Ne() {
|
|
3713
3713
|
}
|
|
3714
3714
|
Ne.__reactDisabledLog = !0;
|
|
3715
3715
|
function mt() {
|
|
3716
3716
|
{
|
|
3717
|
-
if (
|
|
3717
|
+
if (ke === 0) {
|
|
3718
3718
|
Qe = console.log, Ze = console.info, be = console.warn, et = console.error, yt = console.group, we = console.groupCollapsed, Ee = console.groupEnd;
|
|
3719
3719
|
var u = {
|
|
3720
3720
|
configurable: !0,
|
|
@@ -3732,12 +3732,12 @@ function Da() {
|
|
|
3732
3732
|
groupEnd: u
|
|
3733
3733
|
});
|
|
3734
3734
|
}
|
|
3735
|
-
|
|
3735
|
+
ke++;
|
|
3736
3736
|
}
|
|
3737
3737
|
}
|
|
3738
3738
|
function Ie() {
|
|
3739
3739
|
{
|
|
3740
|
-
if (
|
|
3740
|
+
if (ke--, ke === 0) {
|
|
3741
3741
|
var u = {
|
|
3742
3742
|
configurable: !0,
|
|
3743
3743
|
enumerable: !0,
|
|
@@ -3767,7 +3767,7 @@ function Da() {
|
|
|
3767
3767
|
})
|
|
3768
3768
|
});
|
|
3769
3769
|
}
|
|
3770
|
-
|
|
3770
|
+
ke < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
3771
3771
|
}
|
|
3772
3772
|
}
|
|
3773
3773
|
var Ve = _.ReactCurrentDispatcher, je;
|
|
@@ -4160,7 +4160,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
4160
4160
|
}
|
|
4161
4161
|
function nr(u, d, v, w, A, q) {
|
|
4162
4162
|
{
|
|
4163
|
-
var x =
|
|
4163
|
+
var x = k(u);
|
|
4164
4164
|
if (!x) {
|
|
4165
4165
|
var R = "";
|
|
4166
4166
|
(u === void 0 || typeof u == "object" && u !== null && Object.keys(u).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.");
|
|
@@ -4201,7 +4201,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
4201
4201
|
(function(n) {
|
|
4202
4202
|
process.env.NODE_ENV === "production" ? n.exports = Aa() : n.exports = Da();
|
|
4203
4203
|
})(Ps);
|
|
4204
|
-
const
|
|
4204
|
+
const La = Ps.exports.jsx, te = zr(null), Ua = ({
|
|
4205
4205
|
url: n = "",
|
|
4206
4206
|
tokenParams: e,
|
|
4207
4207
|
socketPort: t,
|
|
@@ -4224,7 +4224,7 @@ const ka = Ps.exports.jsx, te = zr(null), Ua = ({
|
|
|
4224
4224
|
socketPort: t
|
|
4225
4225
|
};
|
|
4226
4226
|
}, [n, e, t, s]);
|
|
4227
|
-
return /* @__PURE__ */
|
|
4227
|
+
return /* @__PURE__ */ La(te.Provider, {
|
|
4228
4228
|
value: o,
|
|
4229
4229
|
children: i
|
|
4230
4230
|
});
|
|
@@ -4279,7 +4279,7 @@ const ka = Ps.exports.jsx, te = zr(null), Ua = ({
|
|
|
4279
4279
|
return {
|
|
4280
4280
|
...vt(t === void 0 ? Bs(n, s, e) : t, () => i.getDoc(n, e), r)
|
|
4281
4281
|
};
|
|
4282
|
-
},
|
|
4282
|
+
}, ka = (n) => {
|
|
4283
4283
|
var t, r, s;
|
|
4284
4284
|
let e = "";
|
|
4285
4285
|
if (n != null && n.fields && (e += "fields=" + JSON.stringify(n == null ? void 0 : n.fields) + "&"), n != null && n.filters && (e += "filters=" + JSON.stringify(n == null ? void 0 : n.filters) + "&"), n != null && n.orFilters && (e += "or_filters=" + JSON.stringify(n == null ? void 0 : n.orFilters) + "&"), n != null && n.limit_start && (e += "limit_start=" + JSON.stringify(n == null ? void 0 : n.limit_start) + "&"), n != null && n.limit && (e += "limit=" + JSON.stringify(n == null ? void 0 : n.limit) + "&"), n != null && n.groupBy && (e += "group_by=" + String(n.groupBy) + "&"), n != null && n.orderBy) {
|
|
@@ -4293,7 +4293,7 @@ const ka = Ps.exports.jsx, te = zr(null), Ua = ({
|
|
|
4293
4293
|
db: i
|
|
4294
4294
|
} = ee(te);
|
|
4295
4295
|
return {
|
|
4296
|
-
...vt(t === void 0 ? `${Bs(n, s)}?${
|
|
4296
|
+
...vt(t === void 0 ? `${Bs(n, s)}?${ka(e)}` : t, () => i.getDocList(n, e), r)
|
|
4297
4297
|
};
|
|
4298
4298
|
}, ja = () => {
|
|
4299
4299
|
const {
|
|
@@ -4497,7 +4497,7 @@ const Wa = (n, e, t = !1, r = !1, s, i) => {
|
|
|
4497
4497
|
export {
|
|
4498
4498
|
te as FrappeContext,
|
|
4499
4499
|
Ua as FrappeProvider,
|
|
4500
|
-
|
|
4500
|
+
ka as getDocListQueryString,
|
|
4501
4501
|
Bs as getRequestURL,
|
|
4502
4502
|
qa as useFrappeAuth,
|
|
4503
4503
|
ja as useFrappeCreateDoc,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Vr;function qi(){return Vr||(Vr=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=De.default,e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(F){{for(var m=arguments.length,W=new Array(m>1?m-1:0),O=1;O<m;O++)W[O-1]=arguments[O];r("error",F,W)}}function r(F,m,W){{var O=e.ReactDebugCurrentFrame,M=O.getStackAddendum();M!==""&&(m+="%s",W=W.concat([M]));var L=W.map(function(q){return String(q)});L.unshift("Warning: "+m),Function.prototype.apply.call(console[F],console,L)}}function s(F,m){return F===m&&(F!==0||1/F===1/m)||F!==F&&m!==m}var i=typeof Object.is=="function"?Object.is:s,o=n.useState,c=n.useEffect,l=n.useLayoutEffect,a=n.useDebugValue,h=!1,f=!1;function v(F,m,W){h||n.startTransition!==void 0&&(h=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=m();if(!f){var M=m();i(O,M)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=o({inst:{value:O,getSnapshot:m}}),q=L[0].inst,P=L[1];return l(function(){q.value=O,q.getSnapshot=m,g(q)&&P({inst:q})},[F,O,m]),c(function(){g(q)&&P({inst:q});var ee=function(){g(q)&&P({inst:q})};return F(ee)},[F]),a(O),O}function g(F){var m=F.getSnapshot,W=F.value;try{var O=m();return!i(W,O)}catch{return!0}}function b(F,m,W){return m()}var w=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",S=!w,_=S?b:v,C=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:_;yn.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),yn}(function(n){process.env.NODE_ENV==="production"?n.exports=Mi():n.exports=qi()})(Ur);const Oe=()=>{},ie=Oe(),mn=Object,k=n=>n===ie,be=n=>typeof n=="function",xe=(n,e)=>({...n,...e}),Wi=n=>be(n.then),Ct=new WeakMap;let Hi=0;const nt=n=>{const e=typeof n,t=n&&n.constructor,r=t==Date;let s,i;if(mn(n)===n&&!r&&t!=RegExp){if(s=Ct.get(n),s)return s;if(s=++Hi+"~",Ct.set(n,s),t==Array){for(s="@",i=0;i<n.length;i++)s+=nt(n[i])+",";Ct.set(n,s)}if(t==mn){s="#";const o=mn.keys(n).sort();for(;!k(i=o.pop());)k(n[i])||(s+=i+":"+nt(n[i])+",");Ct.set(n,s)}}else s=r?n.toJSON():e=="symbol"?n.toString():e=="string"?JSON.stringify(n):""+n;return s},_e=new WeakMap,gn={},Ot={},bn="undefined",xt=typeof window!=bn,_n=typeof document!=bn,Ji=()=>xt&&typeof window.requestAnimationFrame!=bn,jr=(n,e)=>{const t=_e.get(n);return[()=>!k(e)&&n.get(e)||gn,r=>{if(!k(e)){const s=n.get(e);e in Ot||(Ot[e]=s),t[5](e,xe(s,r),s||gn)}},t[6],()=>!k(e)&&e in Ot?Ot[e]:!k(e)&&n.get(e)||gn]};let wn=!0;const Yi=()=>wn,[En,Sn]=xt&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Oe,Oe],zi=()=>{const n=_n&&document.visibilityState;return k(n)||n!=="hidden"},Ki=n=>(_n&&document.addEventListener("visibilitychange",n),En("focus",n),()=>{_n&&document.removeEventListener("visibilitychange",n),Sn("focus",n)}),Gi=n=>{const e=()=>{wn=!0,n()},t=()=>{wn=!1};return En("online",e),En("offline",t),()=>{Sn("online",e),Sn("offline",t)}},Xi={isOnline:Yi,isVisible:zi},Qi={initFocus:Ki,initReconnect:Gi},Mr=!De.default.useId,rt=!xt||"Deno"in window,Zi=n=>Ji()?window.requestAnimationFrame(n):setTimeout(n,1),Rn=rt?d.useEffect:d.useLayoutEffect,Tn=typeof navigator<"u"&&navigator.connection,qr=!rt&&Tn&&(["slow-2g","2g"].includes(Tn.effectiveType)||Tn.saveData),Cn=n=>{if(be(n))try{n=n()}catch{n=""}const e=n;return n=typeof n=="string"?n:(Array.isArray(n)?n.length:n)?nt(n):"",[n,e]};let $i=0;const On=()=>++$i,Wr=0,Hr=1,Jr=2;var st={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:Wr,MUTATE_EVENT:Jr,RECONNECT_EVENT:Hr};async function Yr(...n){const[e,t,r,s]=n,i=xe({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=i.populateCache;const c=i.rollbackOnError;let l=i.optimisticData;const a=i.revalidate!==!1,h=g=>typeof c=="function"?c(g):c!==!1,f=i.throwOnError;if(be(t)){const g=t,b=[],w=e.keys();for(const S of w)!/^\$(inf|sub)\$/.test(S)&&g(e.get(S)._k)&&b.push(S);return Promise.all(b.map(v))}return v(t);async function v(g){const[b]=Cn(g);if(!b)return;const[w,S]=jr(e,b),[_,C,F,m]=_e.get(e),W=()=>{const U=_[b];return a&&(delete F[b],delete m[b],U&&U[0])?U[0](Jr).then(()=>w().data):w().data};if(n.length<3)return W();let O=r,M;const L=On();C[b]=[L,0];const q=!k(l),P=w(),ee=P.data,te=P._c,X=k(te)?ee:te;if(q&&(l=be(l)?l(X,ee):l,S({data:l,_c:X})),be(O))try{O=O(X)}catch(U){M=U}if(O&&Wi(O))if(O=await O.catch(U=>{M=U}),L!==C[b][0]){if(M)throw M;return O}else M&&q&&h(M)&&(o=!0,S({data:X,_c:ie}));if(o&&!M)if(be(o)){const U=o(O,X);S({data:U,error:ie,_c:ie})}else S({data:O,error:ie,_c:ie});if(C[b][1]=On(),Promise.resolve(W()).then(()=>{S({_c:ie})}),M){if(f)throw M;return}return O}}const zr=(n,e)=>{for(const t in n)n[t][0]&&n[t][0](e)},eo=(n,e)=>{if(!_e.has(n)){const t=xe(Qi,e),r={},s=Yr.bind(ie,n);let i=Oe;const o={},c=(h,f)=>{const v=o[h]||[];return o[h]=v,v.push(f),()=>v.splice(v.indexOf(f),1)},l=(h,f,v)=>{n.set(h,f);const g=o[h];if(g)for(const b of g)b(f,v)},a=()=>{if(!_e.has(n)&&(_e.set(n,[r,{},{},{},s,l,c]),!rt)){const h=t.initFocus(setTimeout.bind(ie,zr.bind(ie,r,Wr))),f=t.initReconnect(setTimeout.bind(ie,zr.bind(ie,r,Hr)));i=()=>{h&&h(),f&&f(),_e.delete(n)}}};return a(),[n,s,a,i]}return[n,_e.get(n)[4]]},to=(n,e,t,r,s)=>{const i=t.errorRetryCount,o=s.retryCount,c=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!k(i)&&o>i||setTimeout(r,c,s)},no=(n,e)=>nt(n)==nt(e),[Kr,ro]=eo(new Map),so=xe({onLoadingSlow:Oe,onSuccess:Oe,onError:Oe,onErrorRetry:to,onDiscarded:Oe,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:no,isPaused:()=>!1,cache:Kr,mutate:ro,fallback:{}},Xi),io=(n,e)=>{const t=xe(n,e);if(e){const{use:r,fallback:s}=n,{use:i,fallback:o}=e;r&&i&&(t.use=r.concat(i)),s&&o&&(t.fallback=xe(s,o))}return t},oo=d.createContext({}),ao="$inf$",Gr=xt&&window.__SWR_DEVTOOLS_USE__,uo=Gr?window.__SWR_DEVTOOLS_USE__:[],co=()=>{Gr&&(window.__SWR_DEVTOOLS_REACT__=De.default)},lo=n=>be(n[1])?[n[0],n[1],n[2]||{}]:[n[0],null,(n[1]===null?n[2]:n[1])||{}],Xr=()=>xe(so,d.useContext(oo)),fo=n=>(e,t,r)=>n(e,t&&((...i)=>{const[o]=Cn(e),[,,,c]=_e.get(Kr);if(o.startsWith(ao))return t(...i);const l=c[o];return k(l)?t(...i):(delete c[o],l)}),r),ho=uo.concat(fo),po=n=>function(...t){const r=Xr(),[s,i,o]=lo(t),c=io(r,o);let l=n;const{use:a}=c,h=(a||[]).concat(ho);for(let f=h.length;f--;)l=h[f](l);return l(s,i||c.fetcher||null,c)},vo=(n,e,t)=>{const r=e[n]||(e[n]=[]);return r.push(t),()=>{const s=r.indexOf(t);s>=0&&(r[s]=r[r.length-1],r.pop())}};co();const Qr=De.default.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)}),xn={dedupe:!0},Me=po((n,e,t)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:c,revalidateIfStale:l,refreshInterval:a,refreshWhenHidden:h,refreshWhenOffline:f,keepPreviousData:v}=t,[g,b,w,S]=_e.get(r),[_,C]=Cn(n),F=d.useRef(!1),m=d.useRef(!1),W=d.useRef(_),O=d.useRef(e),M=d.useRef(t),L=()=>M.current,q=()=>L().isVisible()&&L().isOnline(),[P,ee,te,X]=jr(r,_),U=d.useRef({}).current,Fe=k(o)?t.fallback[_]:o,ct=(B,I)=>{for(const Q in U){const j=Q;if(j==="data"){if(!s(B[j],I[j])&&(!k(B[j])||!s(We,I[j])))return!1}else if(I[j]!==B[j])return!1}return!0},lt=d.useMemo(()=>{const B=(()=>!_||!e?!1:k(c)?L().isPaused()||i?!1:k(l)?!0:l:c)(),I=K=>{const de=xe(K);return delete de._k,B?{isValidating:!0,isLoading:!0,...de}:de},Q=P(),j=X(),ne=I(Q),Re=Q===j?ne:I(j);let z=ne;return[()=>{const K=I(P());return ct(K,z)?(z.data=K.data,z.isLoading=K.isLoading,z.isValidating=K.isValidating,z.error=K.error,z):(z=K,K)},()=>Re]},[r,_]),we=Ur.exports.useSyncExternalStore(d.useCallback(B=>te(_,(I,Q)=>{ct(Q,I)||B()}),[r,_]),lt[0],lt[1]),ft=!F.current,It=g[_]&&g[_].length>0,Ee=we.data,Se=k(Ee)?Fe:Ee,Pe=we.error,Vt=d.useRef(Se),We=v?k(Ee)?Vt.current:Ee:Se,He=(()=>It&&!k(Pe)?!1:ft&&!k(c)?c:L().isPaused()?!1:i?k(Se)?!1:l:k(Se)||l)(),Je=!!(_&&e&&ft&&He),Ye=k(we.isValidating)?Je:we.isValidating,ht=k(we.isLoading)?Je:we.isLoading,ge=d.useCallback(async B=>{const I=O.current;if(!_||!I||m.current||L().isPaused())return!1;let Q,j,ne=!0;const Re=B||{},z=!w[_]||!Re.dedupe,K=()=>Mr?!m.current&&_===W.current&&F.current:_===W.current,de={isValidating:!1,isLoading:!1},Mt=()=>{ee(de)},ze=()=>{const oe=w[_];oe&&oe[1]===j&&delete w[_]},qt={isValidating:!0};k(P().data)&&(qt.isLoading=!0);try{if(z&&(ee(qt),t.loadingTimeout&&k(P().data)&&setTimeout(()=>{ne&&K()&&L().onLoadingSlow(_,t)},t.loadingTimeout),w[_]=[I(C),On()]),[Q,j]=w[_],Q=await Q,z&&setTimeout(ze,t.dedupingInterval),!w[_]||w[_][1]!==j)return z&&K()&&L().onDiscarded(_),!1;de.error=ie;const oe=b[_];if(!k(oe)&&(j<=oe[0]||j<=oe[1]||oe[1]===0))return Mt(),z&&K()&&L().onDiscarded(_),!1;const le=P().data;de.data=s(le,Q)?le:Q,z&&K()&&L().onSuccess(Q,_,t)}catch(oe){ze();const le=L(),{shouldRetryOnError:Ke}=le;le.isPaused()||(de.error=oe,z&&K()&&(le.onError(oe,_,le),(Ke===!0||be(Ke)&&Ke(oe))&&q()&&le.onErrorRetry(oe,_,le,Be=>{const dt=g[_];dt&&dt[0]&&dt[0](st.ERROR_REVALIDATE_EVENT,Be)},{retryCount:(Re.retryCount||0)+1,dedupe:!0})))}return ne=!1,Mt(),!0},[_,r]),jt=d.useCallback((...B)=>Yr(r,W.current,...B),[]);if(Rn(()=>{O.current=e,M.current=t,k(Ee)||(Vt.current=Ee)}),Rn(()=>{if(!_)return;const B=ge.bind(ie,xn);let I=0;const j=vo(_,g,(ne,Re={})=>{if(ne==st.FOCUS_EVENT){const z=Date.now();L().revalidateOnFocus&&z>I&&q()&&(I=z+L().focusThrottleInterval,B())}else if(ne==st.RECONNECT_EVENT)L().revalidateOnReconnect&&q()&&B();else{if(ne==st.MUTATE_EVENT)return ge();if(ne==st.ERROR_REVALIDATE_EVENT)return ge(Re)}});return m.current=!1,W.current=_,F.current=!0,ee({_k:C}),He&&(k(Se)||rt?B():Zi(B)),()=>{m.current=!0,j()}},[_]),Rn(()=>{let B;function I(){const j=be(a)?a(P().data):a;j&&B!==-1&&(B=setTimeout(Q,j))}function Q(){!P().error&&(h||L().isVisible())&&(f||L().isOnline())?ge(xn).then(I):I()}return I(),()=>{B&&(clearTimeout(B),B=-1)}},[a,h,f,_]),d.useDebugValue(We),i&&k(Se)&&_){if(!Mr&&rt)throw new Error("Fallback data is required when using suspense in SSR.");O.current=e,M.current=t,m.current=!1;const B=S[_];if(!k(B)){const I=jt(B);Qr(I)}if(k(Pe)){const I=ge(xn);k(We)||(I.status="fulfilled",I.value=!0),Qr(I)}else throw Pe}return{mutate:jt,get data(){return U.data=!0,We},get error(){return U.error=!0,Pe},get isValidating(){return U.isValidating=!0,Ye},get isLoading(){return U.isLoading=!0,ht}}}),ye=Object.create(null);ye.open="0",ye.close="1",ye.ping="2",ye.pong="3",ye.message="4",ye.upgrade="5",ye.noop="6";const At=Object.create(null);Object.keys(ye).forEach(n=>{At[ye[n]]=n});const An={type:"error",data:"parser error"},Zr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$r=typeof ArrayBuffer=="function",es=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,kn=({type:n,data:e},t,r)=>Zr&&e instanceof Blob?t?r(e):ts(e,r):$r&&(e instanceof ArrayBuffer||es(e))?t?r(e):ts(new Blob([e]),r):r(ye[n]+(e||"")),ts=(n,e)=>{const t=new FileReader;return t.onload=function(){const r=t.result.split(",")[1];e("b"+(r||""))},t.readAsDataURL(n)};function ns(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Dn;function yo(n,e){if(Zr&&n.data instanceof Blob)return n.data.arrayBuffer().then(ns).then(e);if($r&&(n.data instanceof ArrayBuffer||es(n.data)))return e(ns(n.data));kn(n,!1,t=>{Dn||(Dn=new TextEncoder),e(Dn.encode(t))})}const rs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<rs.length;n++)it[rs.charCodeAt(n)]=n;const mo=n=>{let e=n.length*.75,t=n.length,r,s=0,i,o,c,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const a=new ArrayBuffer(e),h=new Uint8Array(a);for(r=0;r<t;r+=4)i=it[n.charCodeAt(r)],o=it[n.charCodeAt(r+1)],c=it[n.charCodeAt(r+2)],l=it[n.charCodeAt(r+3)],h[s++]=i<<2|o>>4,h[s++]=(o&15)<<4|c>>2,h[s++]=(c&3)<<6|l&63;return a},go=typeof ArrayBuffer=="function",Ln=(n,e)=>{if(typeof n!="string")return{type:"message",data:ss(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:bo(n.substring(1),e)}:At[t]?n.length>1?{type:At[t],data:n.substring(1)}:{type:At[t]}:An},bo=(n,e)=>{if(go){const t=mo(n);return ss(t,e)}else return{base64:!0,data:n}},ss=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},is=String.fromCharCode(30),_o=(n,e)=>{const t=n.length,r=new Array(t);let s=0;n.forEach((i,o)=>{kn(i,!1,c=>{r[o]=c,++s===t&&e(r.join(is))})})},wo=(n,e)=>{const t=n.split(is),r=[];for(let s=0;s<t.length;s++){const i=Ln(t[s],e);if(r.push(i),i.type==="error")break}return r};function Eo(){return new TransformStream({transform(n,e){yo(n,t=>{const r=t.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}n.data&&typeof n.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let Nn;function kt(n){return n.reduce((e,t)=>e+t.length,0)}function Dt(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)t[s]=n[0][r++],r===n[0].length&&(n.shift(),r=0);return n.length&&r<n[0].length&&(n[0]=n[0].slice(r)),t}function So(n,e){Nn||(Nn=new TextDecoder);const t=[];let r=0,s=-1,i=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(r===0){if(kt(t)<1)break;const l=Dt(t,1);i=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(kt(t)<2)break;const l=Dt(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kt(t)<8)break;const l=Dt(t,8),a=new DataView(l.buffer,l.byteOffset,l.length),h=a.getUint32(0);if(h>Math.pow(2,53-32)-1){c.enqueue(An);break}s=h*Math.pow(2,32)+a.getUint32(4),r=3}else{if(kt(t)<s)break;const l=Dt(t,s);c.enqueue(Ln(i?l:Nn.decode(l),e)),r=0}if(s===0||s>n){c.enqueue(An);break}}}})}const os=4;function Y(n){if(n)return Ro(n)}function Ro(n){for(var e in Y.prototype)n[e]=Y.prototype[e];return n}Y.prototype.on=Y.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this},Y.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var r,s=0;s<t.length;s++)if(r=t[s],r===e||r.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this},Y.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,s=t.length;r<s;++r)t[r].apply(this,e)}return this},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},Y.prototype.hasListeners=function(n){return!!this.listeners(n).length};const ce=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function as(n,...e){return e.reduce((t,r)=>(n.hasOwnProperty(r)&&(t[r]=n[r]),t),{})}const To=ce.setTimeout,Co=ce.clearTimeout;function Lt(n,e){e.useNativeTimers?(n.setTimeoutFn=To.bind(ce),n.clearTimeoutFn=Co.bind(ce)):(n.setTimeoutFn=ce.setTimeout.bind(ce),n.clearTimeoutFn=ce.clearTimeout.bind(ce))}const Oo=1.33;function xo(n){return typeof n=="string"?Ao(n):Math.ceil((n.byteLength||n.size)*Oo)}function Ao(n){let e=0,t=0;for(let r=0,s=n.length;r<s;r++)e=n.charCodeAt(r),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(r++,t+=4);return t}function ko(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Do(n){let e={},t=n.split("&");for(let r=0,s=t.length;r<s;r++){let i=t[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Lo extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Fn extends Y{constructor(e){super(),this.writable=!1,Lt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new Lo(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Ln(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=ko(e);return t.length?"?"+t:""}}const us="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Pn=64,No={};let cs=0,Nt=0,ls;function fs(n){let e="";do e=us[n%Pn]+e,n=Math.floor(n/Pn);while(n>0);return e}function hs(){const n=fs(+new Date);return n!==ls?(cs=0,ls=n):n+"."+fs(cs++)}for(;Nt<Pn;Nt++)No[us[Nt]]=Nt;let ds=!1;try{ds=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Fo=ds;function ps(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Fo))return new XMLHttpRequest}catch{}if(!e)try{return new ce[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Ha(){}function Po(){}const Bo=function(){return new ps({xdomain:!1}).responseType!=null}();class Uo extends Fn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}const t=e&&e.forceBase64;this.supportsBinary=Bo&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wo(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_o(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=hs()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new me(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}}class me extends Y{constructor(e,t){super(),Lt(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=t.data!==void 0?t.data:null,this.create()}create(){var e;const t=as(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new ps(t);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=me.requestsCount++,me.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Po,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete me.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(me.requestsCount=0,me.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vs);else if(typeof addEventListener=="function"){const n="onpagehide"in ce?"pagehide":"unload";addEventListener(n,vs,!1)}}function vs(){for(let n in me.requests)me.requests.hasOwnProperty(n)&&me.requests[n].abort()}const Bn=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ft=ce.WebSocket||ce.MozWebSocket,ys=!0,Io="arraybuffer",ms=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vo extends Fn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=ms?{}:as(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=ys&&!ms?t?new Ft(e,t):new Ft(e):new Ft(e,t,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;kn(r,this.supportsBinary,i=>{const o={};try{ys&&this.ws.send(i)}catch{}s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=hs()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Ft}}class jo extends Fn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=So(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),s=Eo();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{r.read().then(({done:c,value:l})=>{c||(this.onPacket(l),i())}).catch(c=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;this.writer.write(r).then(()=>{s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Mo={websocket:Vo,webtransport:jo,polling:Uo},qo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Un(n){const e=n,t=n.indexOf("["),r=n.indexOf("]");t!=-1&&r!=-1&&(n=n.substring(0,t)+n.substring(t,r).replace(/:/g,";")+n.substring(r,n.length));let s=qo.exec(n||""),i={},o=14;for(;o--;)i[Wo[o]]=s[o]||"";return t!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ho(i,i.path),i.queryKey=Jo(i,i.query),i}function Ho(n,e){const t=/\/{2,9}/g,r=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jo(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(t[s]=i)}),t}class Ae extends Y{constructor(e,t={}){super(),this.binaryType=Io,this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Un(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Un(t.host).host),Lt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Do(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=os,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Mo[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Ae.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),r=!1;Ae.priorWebsocketSuccess=!1;const s=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ae.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=t.name,this.emitReserved("upgradeError",v)}}))};function i(){r||(r=!0,h(),t.close(),t=null)}const o=f=>{const v=new Error("probe error: "+f);v.transport=t.name,i(),this.emitReserved("upgradeError",v)};function c(){o("transport closed")}function l(){o("socket closed")}function a(f){t&&f.name!==t.name&&i()}const h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",c),this.off("close",l),this.off("upgrading",a)};t.once("open",s),t.once("error",o),t.once("close",c),this.once("close",l),this.once("upgrading",a),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onOpen(){if(this.readyState="open",Ae.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(t+=xo(s)),r>0&&t>this.maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if(typeof t=="function"&&(s=t,t=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Ae.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const s=e.length;for(;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}Ae.protocol=os;function Yo(n,e="",t){let r=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),r=Un(n)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(t&&t.port===r.port?"":":"+r.port),r}const zo=typeof ArrayBuffer=="function",Ko=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,gs=Object.prototype.toString,Go=typeof Blob=="function"||typeof Blob<"u"&&gs.call(Blob)==="[object BlobConstructor]",Xo=typeof File=="function"||typeof File<"u"&&gs.call(File)==="[object FileConstructor]";function In(n){return zo&&(n instanceof ArrayBuffer||Ko(n))||Go&&n instanceof Blob||Xo&&n instanceof File}function Pt(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;t++)if(Pt(n[t]))return!0;return!1}if(In(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Pt(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Pt(n[t]))return!0;return!1}function Qo(n){const e=[],t=n.data,r=n;return r.data=Vn(t,e),r.attachments=e.length,{packet:r,buffers:e}}function Vn(n,e){if(!n)return n;if(In(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let r=0;r<n.length;r++)t[r]=Vn(n[r],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Vn(n[r],e));return t}return n}function Zo(n,e){return n.data=jn(n.data,e),delete n.attachments,n}function jn(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=jn(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=jn(n[t],e));return n}const $o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ea=5;var T;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(T||(T={}));class ta{constructor(e){this.replacer=e}encode(e){return(e.type===T.EVENT||e.type===T.ACK)&&Pt(e)?this.encodeAsBinary({type:e.type===T.EVENT?T.BINARY_EVENT:T.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===T.BINARY_EVENT||e.type===T.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Qo(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}}function bs(n){return Object.prototype.toString.call(n)==="[object Object]"}class Mn extends Y{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===T.BINARY_EVENT;r||t.type===T.BINARY_ACK?(t.type=r?T.EVENT:T.ACK,this.reconstructor=new na(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(In(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(T[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===T.BINARY_EVENT||r.type===T.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(i,t)}else r.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Mn.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case T.CONNECT:return bs(t);case T.DISCONNECT:return t===void 0;case T.CONNECT_ERROR:return typeof t=="string"||bs(t);case T.EVENT:case T.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&$o.indexOf(t[0])===-1);case T.ACK:case T.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class na{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Zo(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ra=Object.freeze(Object.defineProperty({__proto__:null,protocol:ea,get PacketType(){return T},Encoder:ta,Decoder:Mn},Symbol.toStringTag,{value:"Module"}));function he(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const sa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _s extends Y{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[he(e,"open",this.onopen.bind(this)),he(e,"packet",this.onpacket.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(sa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:T.EVENT,data:t};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,c=t.pop();this._registerAckCallback(o,c),r.id=o}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,i)=>{t.push((o,c)=>r?o?i(o):s(c):s(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:T.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case T.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case T.EVENT:case T.BINARY_EVENT:this.onevent(e);break;case T.ACK:case T.BINARY_ACK:this.onack(e);break;case T.DISCONNECT:this.ondisconnect();break;case T.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...s){r||(r=!0,t.packet({type:T.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:T.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function qe(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}qe.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0},qe.prototype.reset=function(){this.attempts=0},qe.prototype.setMin=function(n){this.ms=n},qe.prototype.setMax=function(n){this.max=n},qe.prototype.setJitter=function(n){this.jitter=n};class qn extends Y{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Lt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new qe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||ra;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ae(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=he(t,"open",function(){r.onopen(),e&&e()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=he(t,"error",i);if(this._timeout!==!1){const c=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),t.close()},c);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(he(e,"ping",this.onping.bind(this)),he(e,"data",this.ondata.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this)),he(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Bn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new _s(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ot={};function Bt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Yo(n,e.path||"/socket.io"),r=t.source,s=t.id,i=t.path,o=ot[s]&&i in ot[s].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return c?l=new qn(r,e):(ot[s]||(ot[s]=new qn(r,e)),l=ot[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Bt,{Manager:qn,Socket:_s,io:Bt,connect:Bt});class ia{constructor(e,t,r,s){ke(this,"socket_port");ke(this,"host");ke(this,"port");ke(this,"protocol");ke(this,"url");ke(this,"site_name");ke(this,"socket");var i,o;if(this.socket_port=r!=null?r:"9000",this.host=(i=window.location)==null?void 0:i.hostname,this.port=(o=window.location)!=null&&o.port?`:${this.socket_port}`:"",this.protocol=this.port?"http":"https",e){let c=new URL(e);c.port="",r?(c.port=r,this.url=c.toString()):this.url=c.toString()}else this.url=`${this.protocol}://${this.host}${this.port}/`;t&&(this.url=`${this.url}${t}`),this.site_name=t,this.socket=Bt(`${this.url}`,{withCredentials:!0,secure:this.protocol==="https",extraHeaders:s&&s.useToken===!0?{Authorization:`${s.type} ${s.token}`}:{}})}}var ws={exports:{}},at={};/**
|
|
18
|
+
*/var Vr;function qi(){return Vr||(Vr=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=De.default,e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(F){{for(var m=arguments.length,W=new Array(m>1?m-1:0),O=1;O<m;O++)W[O-1]=arguments[O];r("error",F,W)}}function r(F,m,W){{var O=e.ReactDebugCurrentFrame,M=O.getStackAddendum();M!==""&&(m+="%s",W=W.concat([M]));var L=W.map(function(q){return String(q)});L.unshift("Warning: "+m),Function.prototype.apply.call(console[F],console,L)}}function s(F,m){return F===m&&(F!==0||1/F===1/m)||F!==F&&m!==m}var i=typeof Object.is=="function"?Object.is:s,o=n.useState,c=n.useEffect,l=n.useLayoutEffect,a=n.useDebugValue,h=!1,f=!1;function v(F,m,W){h||n.startTransition!==void 0&&(h=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=m();if(!f){var M=m();i(O,M)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=o({inst:{value:O,getSnapshot:m}}),q=L[0].inst,P=L[1];return l(function(){q.value=O,q.getSnapshot=m,g(q)&&P({inst:q})},[F,O,m]),c(function(){g(q)&&P({inst:q});var ee=function(){g(q)&&P({inst:q})};return F(ee)},[F]),a(O),O}function g(F){var m=F.getSnapshot,W=F.value;try{var O=m();return!i(W,O)}catch{return!0}}function b(F,m,W){return m()}var w=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",S=!w,_=S?b:v,C=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:_;yn.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),yn}(function(n){process.env.NODE_ENV==="production"?n.exports=Mi():n.exports=qi()})(Ur);const Oe=()=>{},ie=Oe(),mn=Object,k=n=>n===ie,be=n=>typeof n=="function",xe=(n,e)=>({...n,...e}),Wi=n=>be(n.then),Ct=new WeakMap;let Hi=0;const nt=n=>{const e=typeof n,t=n&&n.constructor,r=t==Date;let s,i;if(mn(n)===n&&!r&&t!=RegExp){if(s=Ct.get(n),s)return s;if(s=++Hi+"~",Ct.set(n,s),t==Array){for(s="@",i=0;i<n.length;i++)s+=nt(n[i])+",";Ct.set(n,s)}if(t==mn){s="#";const o=mn.keys(n).sort();for(;!k(i=o.pop());)k(n[i])||(s+=i+":"+nt(n[i])+",");Ct.set(n,s)}}else s=r?n.toJSON():e=="symbol"?n.toString():e=="string"?JSON.stringify(n):""+n;return s},_e=new WeakMap,gn={},Ot={},bn="undefined",xt=typeof window!=bn,_n=typeof document!=bn,Ji=()=>xt&&typeof window.requestAnimationFrame!=bn,jr=(n,e)=>{const t=_e.get(n);return[()=>!k(e)&&n.get(e)||gn,r=>{if(!k(e)){const s=n.get(e);e in Ot||(Ot[e]=s),t[5](e,xe(s,r),s||gn)}},t[6],()=>!k(e)&&e in Ot?Ot[e]:!k(e)&&n.get(e)||gn]};let wn=!0;const Yi=()=>wn,[En,Sn]=xt&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Oe,Oe],zi=()=>{const n=_n&&document.visibilityState;return k(n)||n!=="hidden"},Ki=n=>(_n&&document.addEventListener("visibilitychange",n),En("focus",n),()=>{_n&&document.removeEventListener("visibilitychange",n),Sn("focus",n)}),Gi=n=>{const e=()=>{wn=!0,n()},t=()=>{wn=!1};return En("online",e),En("offline",t),()=>{Sn("online",e),Sn("offline",t)}},Xi={isOnline:Yi,isVisible:zi},Qi={initFocus:Ki,initReconnect:Gi},Mr=!De.default.useId,rt=!xt||"Deno"in window,Zi=n=>Ji()?window.requestAnimationFrame(n):setTimeout(n,1),Rn=rt?d.useEffect:d.useLayoutEffect,Tn=typeof navigator<"u"&&navigator.connection,qr=!rt&&Tn&&(["slow-2g","2g"].includes(Tn.effectiveType)||Tn.saveData),Cn=n=>{if(be(n))try{n=n()}catch{n=""}const e=n;return n=typeof n=="string"?n:(Array.isArray(n)?n.length:n)?nt(n):"",[n,e]};let $i=0;const On=()=>++$i,Wr=0,Hr=1,Jr=2;var st={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:Wr,MUTATE_EVENT:Jr,RECONNECT_EVENT:Hr};async function Yr(...n){const[e,t,r,s]=n,i=xe({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=i.populateCache;const c=i.rollbackOnError;let l=i.optimisticData;const a=i.revalidate!==!1,h=g=>typeof c=="function"?c(g):c!==!1,f=i.throwOnError;if(be(t)){const g=t,b=[],w=e.keys();for(const S of w)!/^\$(inf|sub)\$/.test(S)&&g(e.get(S)._k)&&b.push(S);return Promise.all(b.map(v))}return v(t);async function v(g){const[b]=Cn(g);if(!b)return;const[w,S]=jr(e,b),[_,C,F,m]=_e.get(e),W=()=>{const U=_[b];return a&&(delete F[b],delete m[b],U&&U[0])?U[0](Jr).then(()=>w().data):w().data};if(n.length<3)return W();let O=r,M;const L=On();C[b]=[L,0];const q=!k(l),P=w(),ee=P.data,te=P._c,X=k(te)?ee:te;if(q&&(l=be(l)?l(X,ee):l,S({data:l,_c:X})),be(O))try{O=O(X)}catch(U){M=U}if(O&&Wi(O))if(O=await O.catch(U=>{M=U}),L!==C[b][0]){if(M)throw M;return O}else M&&q&&h(M)&&(o=!0,S({data:X,_c:ie}));if(o&&!M)if(be(o)){const U=o(O,X);S({data:U,error:ie,_c:ie})}else S({data:O,error:ie,_c:ie});if(C[b][1]=On(),Promise.resolve(W()).then(()=>{S({_c:ie})}),M){if(f)throw M;return}return O}}const zr=(n,e)=>{for(const t in n)n[t][0]&&n[t][0](e)},eo=(n,e)=>{if(!_e.has(n)){const t=xe(Qi,e),r={},s=Yr.bind(ie,n);let i=Oe;const o={},c=(h,f)=>{const v=o[h]||[];return o[h]=v,v.push(f),()=>v.splice(v.indexOf(f),1)},l=(h,f,v)=>{n.set(h,f);const g=o[h];if(g)for(const b of g)b(f,v)},a=()=>{if(!_e.has(n)&&(_e.set(n,[r,{},{},{},s,l,c]),!rt)){const h=t.initFocus(setTimeout.bind(ie,zr.bind(ie,r,Wr))),f=t.initReconnect(setTimeout.bind(ie,zr.bind(ie,r,Hr)));i=()=>{h&&h(),f&&f(),_e.delete(n)}}};return a(),[n,s,a,i]}return[n,_e.get(n)[4]]},to=(n,e,t,r,s)=>{const i=t.errorRetryCount,o=s.retryCount,c=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!k(i)&&o>i||setTimeout(r,c,s)},no=(n,e)=>nt(n)==nt(e),[Kr,ro]=eo(new Map),so=xe({onLoadingSlow:Oe,onSuccess:Oe,onError:Oe,onErrorRetry:to,onDiscarded:Oe,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:no,isPaused:()=>!1,cache:Kr,mutate:ro,fallback:{}},Xi),io=(n,e)=>{const t=xe(n,e);if(e){const{use:r,fallback:s}=n,{use:i,fallback:o}=e;r&&i&&(t.use=r.concat(i)),s&&o&&(t.fallback=xe(s,o))}return t},oo=d.createContext({}),ao="$inf$",Gr=xt&&window.__SWR_DEVTOOLS_USE__,uo=Gr?window.__SWR_DEVTOOLS_USE__:[],co=()=>{Gr&&(window.__SWR_DEVTOOLS_REACT__=De.default)},lo=n=>be(n[1])?[n[0],n[1],n[2]||{}]:[n[0],null,(n[1]===null?n[2]:n[1])||{}],Xr=()=>xe(so,d.useContext(oo)),fo=n=>(e,t,r)=>n(e,t&&((...i)=>{const[o]=Cn(e),[,,,c]=_e.get(Kr);if(o.startsWith(ao))return t(...i);const l=c[o];return k(l)?t(...i):(delete c[o],l)}),r),ho=uo.concat(fo),po=n=>function(...t){const r=Xr(),[s,i,o]=lo(t),c=io(r,o);let l=n;const{use:a}=c,h=(a||[]).concat(ho);for(let f=h.length;f--;)l=h[f](l);return l(s,i||c.fetcher||null,c)},vo=(n,e,t)=>{const r=e[n]||(e[n]=[]);return r.push(t),()=>{const s=r.indexOf(t);s>=0&&(r[s]=r[r.length-1],r.pop())}};co();const Qr=De.default.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)}),xn={dedupe:!0},Me=po((n,e,t)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:c,revalidateIfStale:l,refreshInterval:a,refreshWhenHidden:h,refreshWhenOffline:f,keepPreviousData:v}=t,[g,b,w,S]=_e.get(r),[_,C]=Cn(n),F=d.useRef(!1),m=d.useRef(!1),W=d.useRef(_),O=d.useRef(e),M=d.useRef(t),L=()=>M.current,q=()=>L().isVisible()&&L().isOnline(),[P,ee,te,X]=jr(r,_),U=d.useRef({}).current,Fe=k(o)?t.fallback[_]:o,ct=(B,I)=>{for(const Q in U){const j=Q;if(j==="data"){if(!s(B[j],I[j])&&(!k(B[j])||!s(We,I[j])))return!1}else if(I[j]!==B[j])return!1}return!0},lt=d.useMemo(()=>{const B=(()=>!_||!e?!1:k(c)?L().isPaused()||i?!1:k(l)?!0:l:c)(),I=K=>{const de=xe(K);return delete de._k,B?{isValidating:!0,isLoading:!0,...de}:de},Q=P(),j=X(),ne=I(Q),Re=Q===j?ne:I(j);let z=ne;return[()=>{const K=I(P());return ct(K,z)?(z.data=K.data,z.isLoading=K.isLoading,z.isValidating=K.isValidating,z.error=K.error,z):(z=K,K)},()=>Re]},[r,_]),we=Ur.exports.useSyncExternalStore(d.useCallback(B=>te(_,(I,Q)=>{ct(Q,I)||B()}),[r,_]),lt[0],lt[1]),ft=!F.current,It=g[_]&&g[_].length>0,Ee=we.data,Se=k(Ee)?Fe:Ee,Pe=we.error,Vt=d.useRef(Se),We=v?k(Ee)?Vt.current:Ee:Se,He=(()=>It&&!k(Pe)?!1:ft&&!k(c)?c:L().isPaused()?!1:i?k(Se)?!1:l:k(Se)||l)(),Je=!!(_&&e&&ft&&He),Ye=k(we.isValidating)?Je:we.isValidating,ht=k(we.isLoading)?Je:we.isLoading,ge=d.useCallback(async B=>{const I=O.current;if(!_||!I||m.current||L().isPaused())return!1;let Q,j,ne=!0;const Re=B||{},z=!w[_]||!Re.dedupe,K=()=>Mr?!m.current&&_===W.current&&F.current:_===W.current,de={isValidating:!1,isLoading:!1},Mt=()=>{ee(de)},ze=()=>{const oe=w[_];oe&&oe[1]===j&&delete w[_]},qt={isValidating:!0};k(P().data)&&(qt.isLoading=!0);try{if(z&&(ee(qt),t.loadingTimeout&&k(P().data)&&setTimeout(()=>{ne&&K()&&L().onLoadingSlow(_,t)},t.loadingTimeout),w[_]=[I(C),On()]),[Q,j]=w[_],Q=await Q,z&&setTimeout(ze,t.dedupingInterval),!w[_]||w[_][1]!==j)return z&&K()&&L().onDiscarded(_),!1;de.error=ie;const oe=b[_];if(!k(oe)&&(j<=oe[0]||j<=oe[1]||oe[1]===0))return Mt(),z&&K()&&L().onDiscarded(_),!1;const le=P().data;de.data=s(le,Q)?le:Q,z&&K()&&L().onSuccess(Q,_,t)}catch(oe){ze();const le=L(),{shouldRetryOnError:Ke}=le;le.isPaused()||(de.error=oe,z&&K()&&(le.onError(oe,_,le),(Ke===!0||be(Ke)&&Ke(oe))&&q()&&le.onErrorRetry(oe,_,le,Be=>{const dt=g[_];dt&&dt[0]&&dt[0](st.ERROR_REVALIDATE_EVENT,Be)},{retryCount:(Re.retryCount||0)+1,dedupe:!0})))}return ne=!1,Mt(),!0},[_,r]),jt=d.useCallback((...B)=>Yr(r,W.current,...B),[]);if(Rn(()=>{O.current=e,M.current=t,k(Ee)||(Vt.current=Ee)}),Rn(()=>{if(!_)return;const B=ge.bind(ie,xn);let I=0;const j=vo(_,g,(ne,Re={})=>{if(ne==st.FOCUS_EVENT){const z=Date.now();L().revalidateOnFocus&&z>I&&q()&&(I=z+L().focusThrottleInterval,B())}else if(ne==st.RECONNECT_EVENT)L().revalidateOnReconnect&&q()&&B();else{if(ne==st.MUTATE_EVENT)return ge();if(ne==st.ERROR_REVALIDATE_EVENT)return ge(Re)}});return m.current=!1,W.current=_,F.current=!0,ee({_k:C}),He&&(k(Se)||rt?B():Zi(B)),()=>{m.current=!0,j()}},[_]),Rn(()=>{let B;function I(){const j=be(a)?a(P().data):a;j&&B!==-1&&(B=setTimeout(Q,j))}function Q(){!P().error&&(h||L().isVisible())&&(f||L().isOnline())?ge(xn).then(I):I()}return I(),()=>{B&&(clearTimeout(B),B=-1)}},[a,h,f,_]),d.useDebugValue(We),i&&k(Se)&&_){if(!Mr&&rt)throw new Error("Fallback data is required when using suspense in SSR.");O.current=e,M.current=t,m.current=!1;const B=S[_];if(!k(B)){const I=jt(B);Qr(I)}if(k(Pe)){const I=ge(xn);k(We)||(I.status="fulfilled",I.value=!0),Qr(I)}else throw Pe}return{mutate:jt,get data(){return U.data=!0,We},get error(){return U.error=!0,Pe},get isValidating(){return U.isValidating=!0,Ye},get isLoading(){return U.isLoading=!0,ht}}}),ye=Object.create(null);ye.open="0",ye.close="1",ye.ping="2",ye.pong="3",ye.message="4",ye.upgrade="5",ye.noop="6";const At=Object.create(null);Object.keys(ye).forEach(n=>{At[ye[n]]=n});const An={type:"error",data:"parser error"},Zr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$r=typeof ArrayBuffer=="function",es=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,kn=({type:n,data:e},t,r)=>Zr&&e instanceof Blob?t?r(e):ts(e,r):$r&&(e instanceof ArrayBuffer||es(e))?t?r(e):ts(new Blob([e]),r):r(ye[n]+(e||"")),ts=(n,e)=>{const t=new FileReader;return t.onload=function(){const r=t.result.split(",")[1];e("b"+(r||""))},t.readAsDataURL(n)};function ns(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Dn;function yo(n,e){if(Zr&&n.data instanceof Blob)return n.data.arrayBuffer().then(ns).then(e);if($r&&(n.data instanceof ArrayBuffer||es(n.data)))return e(ns(n.data));kn(n,!1,t=>{Dn||(Dn=new TextEncoder),e(Dn.encode(t))})}const rs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<rs.length;n++)it[rs.charCodeAt(n)]=n;const mo=n=>{let e=n.length*.75,t=n.length,r,s=0,i,o,c,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const a=new ArrayBuffer(e),h=new Uint8Array(a);for(r=0;r<t;r+=4)i=it[n.charCodeAt(r)],o=it[n.charCodeAt(r+1)],c=it[n.charCodeAt(r+2)],l=it[n.charCodeAt(r+3)],h[s++]=i<<2|o>>4,h[s++]=(o&15)<<4|c>>2,h[s++]=(c&3)<<6|l&63;return a},go=typeof ArrayBuffer=="function",Ln=(n,e)=>{if(typeof n!="string")return{type:"message",data:ss(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:bo(n.substring(1),e)}:At[t]?n.length>1?{type:At[t],data:n.substring(1)}:{type:At[t]}:An},bo=(n,e)=>{if(go){const t=mo(n);return ss(t,e)}else return{base64:!0,data:n}},ss=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},is=String.fromCharCode(30),_o=(n,e)=>{const t=n.length,r=new Array(t);let s=0;n.forEach((i,o)=>{kn(i,!1,c=>{r[o]=c,++s===t&&e(r.join(is))})})},wo=(n,e)=>{const t=n.split(is),r=[];for(let s=0;s<t.length;s++){const i=Ln(t[s],e);if(r.push(i),i.type==="error")break}return r};function Eo(){return new TransformStream({transform(n,e){yo(n,t=>{const r=t.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}n.data&&typeof n.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let Nn;function kt(n){return n.reduce((e,t)=>e+t.length,0)}function Dt(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)t[s]=n[0][r++],r===n[0].length&&(n.shift(),r=0);return n.length&&r<n[0].length&&(n[0]=n[0].slice(r)),t}function So(n,e){Nn||(Nn=new TextDecoder);const t=[];let r=0,s=-1,i=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(r===0){if(kt(t)<1)break;const l=Dt(t,1);i=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(kt(t)<2)break;const l=Dt(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kt(t)<8)break;const l=Dt(t,8),a=new DataView(l.buffer,l.byteOffset,l.length),h=a.getUint32(0);if(h>Math.pow(2,53-32)-1){c.enqueue(An);break}s=h*Math.pow(2,32)+a.getUint32(4),r=3}else{if(kt(t)<s)break;const l=Dt(t,s);c.enqueue(Ln(i?l:Nn.decode(l),e)),r=0}if(s===0||s>n){c.enqueue(An);break}}}})}const os=4;function Y(n){if(n)return Ro(n)}function Ro(n){for(var e in Y.prototype)n[e]=Y.prototype[e];return n}Y.prototype.on=Y.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this},Y.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var r,s=0;s<t.length;s++)if(r=t[s],r===e||r.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this},Y.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,s=t.length;r<s;++r)t[r].apply(this,e)}return this},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},Y.prototype.hasListeners=function(n){return!!this.listeners(n).length};const ce=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function as(n,...e){return e.reduce((t,r)=>(n.hasOwnProperty(r)&&(t[r]=n[r]),t),{})}const To=ce.setTimeout,Co=ce.clearTimeout;function Lt(n,e){e.useNativeTimers?(n.setTimeoutFn=To.bind(ce),n.clearTimeoutFn=Co.bind(ce)):(n.setTimeoutFn=ce.setTimeout.bind(ce),n.clearTimeoutFn=ce.clearTimeout.bind(ce))}const Oo=1.33;function xo(n){return typeof n=="string"?Ao(n):Math.ceil((n.byteLength||n.size)*Oo)}function Ao(n){let e=0,t=0;for(let r=0,s=n.length;r<s;r++)e=n.charCodeAt(r),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(r++,t+=4);return t}function ko(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Do(n){let e={},t=n.split("&");for(let r=0,s=t.length;r<s;r++){let i=t[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Lo extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Fn extends Y{constructor(e){super(),this.writable=!1,Lt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new Lo(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Ln(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=ko(e);return t.length?"?"+t:""}}const us="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Pn=64,No={};let cs=0,Nt=0,ls;function fs(n){let e="";do e=us[n%Pn]+e,n=Math.floor(n/Pn);while(n>0);return e}function hs(){const n=fs(+new Date);return n!==ls?(cs=0,ls=n):n+"."+fs(cs++)}for(;Nt<Pn;Nt++)No[us[Nt]]=Nt;let ds=!1;try{ds=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Fo=ds;function ps(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Fo))return new XMLHttpRequest}catch{}if(!e)try{return new ce[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Ha(){}function Po(){}const Bo=function(){return new ps({xdomain:!1}).responseType!=null}();class Uo extends Fn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}const t=e&&e.forceBase64;this.supportsBinary=Bo&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wo(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_o(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=hs()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new me(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}}class me extends Y{constructor(e,t){super(),Lt(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=t.data!==void 0?t.data:null,this.create()}create(){var e;const t=as(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new ps(t);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=me.requestsCount++,me.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Po,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete me.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(me.requestsCount=0,me.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vs);else if(typeof addEventListener=="function"){const n="onpagehide"in ce?"pagehide":"unload";addEventListener(n,vs,!1)}}function vs(){for(let n in me.requests)me.requests.hasOwnProperty(n)&&me.requests[n].abort()}const Bn=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ft=ce.WebSocket||ce.MozWebSocket,ys=!0,Io="arraybuffer",ms=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vo extends Fn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=ms?{}:as(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=ys&&!ms?t?new Ft(e,t):new Ft(e):new Ft(e,t,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;kn(r,this.supportsBinary,i=>{const o={};try{ys&&this.ws.send(i)}catch{}s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=hs()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Ft}}class jo extends Fn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=So(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),s=Eo();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{r.read().then(({done:c,value:l})=>{c||(this.onPacket(l),i())}).catch(c=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;this.writer.write(r).then(()=>{s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Mo={websocket:Vo,webtransport:jo,polling:Uo},qo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Un(n){const e=n,t=n.indexOf("["),r=n.indexOf("]");t!=-1&&r!=-1&&(n=n.substring(0,t)+n.substring(t,r).replace(/:/g,";")+n.substring(r,n.length));let s=qo.exec(n||""),i={},o=14;for(;o--;)i[Wo[o]]=s[o]||"";return t!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ho(i,i.path),i.queryKey=Jo(i,i.query),i}function Ho(n,e){const t=/\/{2,9}/g,r=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jo(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(t[s]=i)}),t}class Ae extends Y{constructor(e,t={}){super(),this.binaryType=Io,this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Un(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Un(t.host).host),Lt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Do(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=os,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Mo[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Ae.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),r=!1;Ae.priorWebsocketSuccess=!1;const s=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ae.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=t.name,this.emitReserved("upgradeError",v)}}))};function i(){r||(r=!0,h(),t.close(),t=null)}const o=f=>{const v=new Error("probe error: "+f);v.transport=t.name,i(),this.emitReserved("upgradeError",v)};function c(){o("transport closed")}function l(){o("socket closed")}function a(f){t&&f.name!==t.name&&i()}const h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",c),this.off("close",l),this.off("upgrading",a)};t.once("open",s),t.once("error",o),t.once("close",c),this.once("close",l),this.once("upgrading",a),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onOpen(){if(this.readyState="open",Ae.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(t+=xo(s)),r>0&&t>this.maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if(typeof t=="function"&&(s=t,t=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Ae.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const s=e.length;for(;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}Ae.protocol=os;function Yo(n,e="",t){let r=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),r=Un(n)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(t&&t.port===r.port?"":":"+r.port),r}const zo=typeof ArrayBuffer=="function",Ko=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,gs=Object.prototype.toString,Go=typeof Blob=="function"||typeof Blob<"u"&&gs.call(Blob)==="[object BlobConstructor]",Xo=typeof File=="function"||typeof File<"u"&&gs.call(File)==="[object FileConstructor]";function In(n){return zo&&(n instanceof ArrayBuffer||Ko(n))||Go&&n instanceof Blob||Xo&&n instanceof File}function Pt(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;t++)if(Pt(n[t]))return!0;return!1}if(In(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Pt(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Pt(n[t]))return!0;return!1}function Qo(n){const e=[],t=n.data,r=n;return r.data=Vn(t,e),r.attachments=e.length,{packet:r,buffers:e}}function Vn(n,e){if(!n)return n;if(In(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let r=0;r<n.length;r++)t[r]=Vn(n[r],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Vn(n[r],e));return t}return n}function Zo(n,e){return n.data=jn(n.data,e),delete n.attachments,n}function jn(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=jn(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=jn(n[t],e));return n}const $o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ea=5;var T;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(T||(T={}));class ta{constructor(e){this.replacer=e}encode(e){return(e.type===T.EVENT||e.type===T.ACK)&&Pt(e)?this.encodeAsBinary({type:e.type===T.EVENT?T.BINARY_EVENT:T.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===T.BINARY_EVENT||e.type===T.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Qo(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}}function bs(n){return Object.prototype.toString.call(n)==="[object Object]"}class Mn extends Y{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===T.BINARY_EVENT;r||t.type===T.BINARY_ACK?(t.type=r?T.EVENT:T.ACK,this.reconstructor=new na(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(In(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(T[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===T.BINARY_EVENT||r.type===T.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(i,t)}else r.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Mn.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case T.CONNECT:return bs(t);case T.DISCONNECT:return t===void 0;case T.CONNECT_ERROR:return typeof t=="string"||bs(t);case T.EVENT:case T.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&$o.indexOf(t[0])===-1);case T.ACK:case T.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class na{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Zo(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ra=Object.freeze(Object.defineProperty({__proto__:null,protocol:ea,get PacketType(){return T},Encoder:ta,Decoder:Mn},Symbol.toStringTag,{value:"Module"}));function he(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const sa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _s extends Y{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[he(e,"open",this.onopen.bind(this)),he(e,"packet",this.onpacket.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(sa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:T.EVENT,data:t};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,c=t.pop();this._registerAckCallback(o,c),r.id=o}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,i)=>{t.push((o,c)=>r?o?i(o):s(c):s(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:T.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case T.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case T.EVENT:case T.BINARY_EVENT:this.onevent(e);break;case T.ACK:case T.BINARY_ACK:this.onack(e);break;case T.DISCONNECT:this.ondisconnect();break;case T.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...s){r||(r=!0,t.packet({type:T.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:T.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function qe(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}qe.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0},qe.prototype.reset=function(){this.attempts=0},qe.prototype.setMin=function(n){this.ms=n},qe.prototype.setMax=function(n){this.max=n},qe.prototype.setJitter=function(n){this.jitter=n};class qn extends Y{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Lt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new qe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||ra;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ae(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=he(t,"open",function(){r.onopen(),e&&e()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=he(t,"error",i);if(this._timeout!==!1){const c=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),t.close()},c);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(he(e,"ping",this.onping.bind(this)),he(e,"data",this.ondata.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this)),he(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Bn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new _s(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ot={};function Bt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Yo(n,e.path||"/socket.io"),r=t.source,s=t.id,i=t.path,o=ot[s]&&i in ot[s].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return c?l=new qn(r,e):(ot[s]||(ot[s]=new qn(r,e)),l=ot[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Bt,{Manager:qn,Socket:_s,io:Bt,connect:Bt});class ia{constructor(e,t,r,s){ke(this,"socket_port");ke(this,"host");ke(this,"port");ke(this,"protocol");ke(this,"url");ke(this,"site_name");ke(this,"socket");var i,o,c;if(this.socket_port=r!=null?r:"9000",this.host=(i=window.location)==null?void 0:i.hostname,this.port=(o=window.location)!=null&&o.port?`:${this.socket_port}`:"",this.protocol=this.port?"http":"https",e){let l=new URL(e);l.port="",r?(l.port=r,this.url=l.toString()):this.url=l.toString()}else this.url=`${this.protocol}://${this.host}${this.port}/`;t&&(this.url=`${this.url}${t}`),this.site_name=t,this.socket=Bt(`${this.url}`,{withCredentials:!0,secure:this.protocol==="https",extraHeaders:s&&s.useToken===!0?{Authorization:`${s.type} ${(c=s.token)==null?void 0:c.call(s)}`}:{}})}}var ws={exports:{}},at={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* react-jsx-runtime.production.min.js
|
|
21
21
|
*
|