@famibee/skynovel 2.0.2 → 2.0.3

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.
Files changed (121) hide show
  1. package/dist/Button.js +36 -34
  2. package/dist/Button.js.map +1 -1
  3. package/dist/CallStack.js +11 -6
  4. package/dist/CallStack.js.map +1 -1
  5. package/dist/CmnInterface.js +13 -11
  6. package/dist/CmnInterface.js.map +1 -1
  7. package/dist/CmnLib.js +58 -56
  8. package/dist/CmnLib.js.map +1 -1
  9. package/dist/Config.js +9 -7
  10. package/dist/Config.js.map +1 -1
  11. package/dist/ConfigBase.js +52 -49
  12. package/dist/ConfigBase.js.map +1 -1
  13. package/dist/DebugMng.js +9 -6
  14. package/dist/DebugMng.js.map +1 -1
  15. package/dist/EventListenerCtn.js +6 -4
  16. package/dist/EventListenerCtn.js.map +1 -1
  17. package/dist/EventMng.js +522 -417
  18. package/dist/EventMng.js.map +1 -1
  19. package/dist/Grammar.js +22 -20
  20. package/dist/Grammar.js.map +1 -1
  21. package/dist/GrpLayer.js +58 -57
  22. package/dist/GrpLayer.js.map +1 -1
  23. package/dist/Layer.js +66 -64
  24. package/dist/Layer.js.map +1 -1
  25. package/dist/LayerMng.js +461 -441
  26. package/dist/LayerMng.js.map +1 -1
  27. package/dist/Main.js +69 -67
  28. package/dist/Main.js.map +1 -1
  29. package/dist/PropParser.js +23 -19
  30. package/dist/PropParser.js.map +1 -1
  31. package/dist/Reading.js +422 -418
  32. package/dist/Reading.js.map +1 -1
  33. package/dist/RubySpliter.js +4 -2
  34. package/dist/RubySpliter.js.map +1 -1
  35. package/dist/ScriptIterator.js +374 -370
  36. package/dist/ScriptIterator.js.map +1 -1
  37. package/dist/SndBuf.js +643 -622
  38. package/dist/SndBuf.js.map +1 -1
  39. package/dist/SoundMng.js +59 -60
  40. package/dist/SoundMng.js.map +1 -1
  41. package/dist/SpritesMng.js +135 -129
  42. package/dist/SpritesMng.js.map +1 -1
  43. package/dist/SysBase.js +985 -950
  44. package/dist/SysBase.js.map +1 -1
  45. package/dist/TxtLayer.js +558 -551
  46. package/dist/TxtLayer.js.map +1 -1
  47. package/dist/Variable.js +47 -45
  48. package/dist/Variable.js.map +1 -1
  49. package/dist/chunk.js +11 -9
  50. package/dist/gamepad.js +396 -660
  51. package/dist/gamepad.js.map +1 -1
  52. package/dist/pixi.js +2631 -2593
  53. package/dist/pixi.js.map +1 -1
  54. package/dist/platform.js +6 -4
  55. package/dist/platform.js.map +1 -1
  56. package/dist/rolldown-runtime.js +20 -0
  57. package/dist/web.js +418 -418
  58. package/dist/web.js.map +1 -1
  59. package/dist_app/Button.js +36 -34
  60. package/dist_app/Button.js.map +1 -1
  61. package/dist_app/CallStack.js +11 -6
  62. package/dist_app/CallStack.js.map +1 -1
  63. package/dist_app/CmnInterface.js +13 -11
  64. package/dist_app/CmnInterface.js.map +1 -1
  65. package/dist_app/CmnLib.js +58 -56
  66. package/dist_app/CmnLib.js.map +1 -1
  67. package/dist_app/Config.js +9 -7
  68. package/dist_app/Config.js.map +1 -1
  69. package/dist_app/ConfigBase.js +52 -49
  70. package/dist_app/ConfigBase.js.map +1 -1
  71. package/dist_app/DebugMng.js +9 -6
  72. package/dist_app/DebugMng.js.map +1 -1
  73. package/dist_app/EventListenerCtn.js +6 -4
  74. package/dist_app/EventListenerCtn.js.map +1 -1
  75. package/dist_app/EventMng.js +522 -417
  76. package/dist_app/EventMng.js.map +1 -1
  77. package/dist_app/Grammar.js +22 -20
  78. package/dist_app/Grammar.js.map +1 -1
  79. package/dist_app/GrpLayer.js +58 -57
  80. package/dist_app/GrpLayer.js.map +1 -1
  81. package/dist_app/Layer.js +66 -64
  82. package/dist_app/Layer.js.map +1 -1
  83. package/dist_app/LayerMng.js +461 -441
  84. package/dist_app/LayerMng.js.map +1 -1
  85. package/dist_app/Main.js +69 -67
  86. package/dist_app/Main.js.map +1 -1
  87. package/dist_app/PropParser.js +23 -19
  88. package/dist_app/PropParser.js.map +1 -1
  89. package/dist_app/Reading.js +422 -418
  90. package/dist_app/Reading.js.map +1 -1
  91. package/dist_app/RubySpliter.js +4 -2
  92. package/dist_app/RubySpliter.js.map +1 -1
  93. package/dist_app/ScriptIterator.js +374 -370
  94. package/dist_app/ScriptIterator.js.map +1 -1
  95. package/dist_app/SndBuf.js +643 -622
  96. package/dist_app/SndBuf.js.map +1 -1
  97. package/dist_app/SoundMng.js +59 -60
  98. package/dist_app/SoundMng.js.map +1 -1
  99. package/dist_app/SpritesMng.js +135 -129
  100. package/dist_app/SpritesMng.js.map +1 -1
  101. package/dist_app/SysBase.js +985 -950
  102. package/dist_app/SysBase.js.map +1 -1
  103. package/dist_app/TxtLayer.js +558 -551
  104. package/dist_app/TxtLayer.js.map +1 -1
  105. package/dist_app/Variable.js +47 -45
  106. package/dist_app/Variable.js.map +1 -1
  107. package/dist_app/app.js +62 -63
  108. package/dist_app/app.js.map +1 -1
  109. package/dist_app/appMain.js +11 -11
  110. package/dist_app/appMain.js.map +1 -1
  111. package/dist_app/chunk.js +11 -9
  112. package/dist_app/gamepad.js +396 -660
  113. package/dist_app/gamepad.js.map +1 -1
  114. package/dist_app/pixi.js +2028 -1990
  115. package/dist_app/pixi.js.map +1 -1
  116. package/dist_app/platform.js +6 -4
  117. package/dist_app/platform.js.map +1 -1
  118. package/dist_app/preload.js +1 -1
  119. package/dist_app/preload.js.map +1 -1
  120. package/dist_app/rolldown-runtime.js +20 -0
  121. package/package.json +20 -21
package/dist/SysBase.js CHANGED
@@ -1,224 +1,233 @@
1
- import { n as __export } from "./chunk.js";
2
- import { i as EVNM_KEY, s as argChk_Boolean, t as CmnLib } from "./CmnLib.js";
3
- import { n as creSYS_DATA } from "./CmnInterface.js";
4
- import { t as EventListenerCtn } from "./EventListenerCtn.js";
5
- import { n as SEARCH_PATH_ARG_EXT } from "./ConfigBase.js";
6
- var PACKET_TYPES = Object.create(null);
7
- PACKET_TYPES.open = "0", PACKET_TYPES.close = "1", PACKET_TYPES.ping = "2", PACKET_TYPES.pong = "3", PACKET_TYPES.message = "4", PACKET_TYPES.upgrade = "5", PACKET_TYPES.noop = "6";
8
- var PACKET_TYPES_REVERSE = Object.create(null);
9
- Object.keys(PACKET_TYPES).forEach((h) => {
10
- PACKET_TYPES_REVERSE[PACKET_TYPES[h]] = h;
1
+ import { n as e } from "./rolldown-runtime.js";
2
+ import { i as t, s as n, t as r } from "./CmnLib.js";
3
+ import { n as i } from "./CmnInterface.js";
4
+ import { t as a } from "./EventListenerCtn.js";
5
+ import { n as o } from "./ConfigBase.js";
6
+ //#region node_modules/engine.io-parser/build/esm/commons.js
7
+ var s = Object.create(null);
8
+ s.open = "0", s.close = "1", s.ping = "2", s.pong = "3", s.message = "4", s.upgrade = "5", s.noop = "6";
9
+ var c = Object.create(null);
10
+ Object.keys(s).forEach((e) => {
11
+ c[s[e]] = e;
11
12
  });
12
- var ERROR_PACKET = {
13
+ var l = {
13
14
  type: "error",
14
15
  data: "parser error"
15
- }, withNativeBlob$1 = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", withNativeArrayBuffer$2 = typeof ArrayBuffer == "function", isView$1 = (h) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(h) : h && h.buffer instanceof ArrayBuffer, encodePacket = ({ type: h, data: W }, G, K) => withNativeBlob$1 && W instanceof Blob ? G ? K(W) : encodeBlobAsBase64(W, K) : withNativeArrayBuffer$2 && (W instanceof ArrayBuffer || isView$1(W)) ? G ? K(W) : encodeBlobAsBase64(new Blob([W]), K) : K(PACKET_TYPES[h] + (W || "")), encodeBlobAsBase64 = (h, W) => {
16
- let G = new FileReader();
17
- return G.onload = function() {
18
- let h = G.result.split(",")[1];
19
- W("b" + (h || ""));
20
- }, G.readAsDataURL(h);
16
+ }, u = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", d = typeof ArrayBuffer == "function", f = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, p = ({ type: e, data: t }, n, r) => u && t instanceof Blob ? n ? r(t) : m(t, r) : d && (t instanceof ArrayBuffer || f(t)) ? n ? r(t) : m(new Blob([t]), r) : r(s[e] + (t || "")), m = (e, t) => {
17
+ let n = new FileReader();
18
+ return n.onload = function() {
19
+ let e = n.result.split(",")[1];
20
+ t("b" + (e || ""));
21
+ }, n.readAsDataURL(e);
21
22
  };
22
- function toArray(h) {
23
- return h instanceof Uint8Array ? h : h instanceof ArrayBuffer ? new Uint8Array(h) : new Uint8Array(h.buffer, h.byteOffset, h.byteLength);
23
+ function h(e) {
24
+ return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
24
25
  }
25
- var TEXT_ENCODER;
26
- function encodePacketToBinary(h, W) {
27
- if (withNativeBlob$1 && h.data instanceof Blob) return h.data.arrayBuffer().then(toArray).then(W);
28
- if (withNativeArrayBuffer$2 && (h.data instanceof ArrayBuffer || isView$1(h.data))) return W(toArray(h.data));
29
- encodePacket(h, !1, (h) => {
30
- TEXT_ENCODER ||= new TextEncoder(), W(TEXT_ENCODER.encode(h));
26
+ var g;
27
+ function ee(e, t) {
28
+ if (u && e.data instanceof Blob) return e.data.arrayBuffer().then(h).then(t);
29
+ if (d && (e.data instanceof ArrayBuffer || f(e.data))) return t(h(e.data));
30
+ p(e, !1, (e) => {
31
+ g ||= new TextEncoder(), t(g.encode(e));
31
32
  });
32
33
  }
33
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", lookup$1 = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
34
- for (let h = 0; h < 64; h++) lookup$1[chars.charCodeAt(h)] = h;
35
- const decode$1 = (h) => {
36
- let W = h.length * .75, G = h.length, K, q = 0, J, Y, X, Z;
37
- h[h.length - 1] === "=" && (W--, h[h.length - 2] === "=" && W--);
38
- let Q = new ArrayBuffer(W), $ = new Uint8Array(Q);
39
- for (K = 0; K < G; K += 4) J = lookup$1[h.charCodeAt(K)], Y = lookup$1[h.charCodeAt(K + 1)], X = lookup$1[h.charCodeAt(K + 2)], Z = lookup$1[h.charCodeAt(K + 3)], $[q++] = J << 2 | Y >> 4, $[q++] = (Y & 15) << 4 | X >> 2, $[q++] = (X & 3) << 6 | Z & 63;
40
- return Q;
41
- };
42
- var withNativeArrayBuffer$1 = typeof ArrayBuffer == "function";
43
- const decodePacket = (h, W) => {
44
- if (typeof h != "string") return {
34
+ //#endregion
35
+ //#region node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js
36
+ var te = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", _ = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256);
37
+ for (let e = 0; e < 64; e++) _[te.charCodeAt(e)] = e;
38
+ var ne = (e) => {
39
+ let t = e.length * .75, n = e.length, r, i = 0, a, o, s, c;
40
+ e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
41
+ let l = new ArrayBuffer(t), u = new Uint8Array(l);
42
+ for (r = 0; r < n; r += 4) a = _[e.charCodeAt(r)], o = _[e.charCodeAt(r + 1)], s = _[e.charCodeAt(r + 2)], c = _[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
43
+ return l;
44
+ }, re = typeof ArrayBuffer == "function", v = (e, t) => {
45
+ if (typeof e != "string") return {
45
46
  type: "message",
46
- data: mapBinary(h, W)
47
+ data: y(e, t)
47
48
  };
48
- let G = h.charAt(0);
49
- return G === "b" ? {
49
+ let n = e.charAt(0);
50
+ return n === "b" ? {
50
51
  type: "message",
51
- data: decodeBase64Packet(h.substring(1), W)
52
- } : PACKET_TYPES_REVERSE[G] ? h.length > 1 ? {
53
- type: PACKET_TYPES_REVERSE[G],
54
- data: h.substring(1)
55
- } : { type: PACKET_TYPES_REVERSE[G] } : ERROR_PACKET;
56
- };
57
- var decodeBase64Packet = (h, W) => withNativeArrayBuffer$1 ? mapBinary(decode$1(h), W) : {
52
+ data: ie(e.substring(1), t)
53
+ } : c[n] ? e.length > 1 ? {
54
+ type: c[n],
55
+ data: e.substring(1)
56
+ } : { type: c[n] } : l;
57
+ }, ie = (e, t) => re ? y(ne(e), t) : {
58
58
  base64: !0,
59
- data: h
60
- }, mapBinary = (h, W) => {
61
- switch (W) {
62
- case "blob": return h instanceof Blob ? h : new Blob([h]);
63
- case "arraybuffer":
64
- default: return h instanceof ArrayBuffer ? h : h.buffer;
65
- }
66
- }, SEPARATOR = "", encodePayload = (h, W) => {
67
- let G = h.length, K = Array(G), q = 0;
68
- h.forEach((h, J) => {
69
- encodePacket(h, !1, (h) => {
70
- K[J] = h, ++q === G && W(K.join(SEPARATOR));
59
+ data: e
60
+ }, y = (e, t) => {
61
+ switch (t) {
62
+ case "blob": return e instanceof Blob ? e : new Blob([e]);
63
+ default: return e instanceof ArrayBuffer ? e : e.buffer;
64
+ }
65
+ }, b = "", ae = (e, t) => {
66
+ let n = e.length, r = Array(n), i = 0;
67
+ e.forEach((e, a) => {
68
+ p(e, !1, (e) => {
69
+ r[a] = e, ++i === n && t(r.join(b));
71
70
  });
72
71
  });
73
- }, decodePayload = (h, W) => {
74
- let G = h.split(SEPARATOR), K = [];
75
- for (let h = 0; h < G.length; h++) {
76
- let q = decodePacket(G[h], W);
77
- if (K.push(q), q.type === "error") break;
72
+ }, oe = (e, t) => {
73
+ let n = e.split(b), r = [];
74
+ for (let e = 0; e < n.length; e++) {
75
+ let i = v(n[e], t);
76
+ if (r.push(i), i.type === "error") break;
78
77
  }
79
- return K;
78
+ return r;
80
79
  };
81
- function createPacketEncoderStream() {
82
- return new TransformStream({ transform(h, W) {
83
- encodePacketToBinary(h, (G) => {
84
- let K = G.length, q;
85
- if (K < 126) q = new Uint8Array(1), new DataView(q.buffer).setUint8(0, K);
86
- else if (K < 65536) {
87
- q = new Uint8Array(3);
88
- let h = new DataView(q.buffer);
89
- h.setUint8(0, 126), h.setUint16(1, K);
80
+ function se() {
81
+ return new TransformStream({ transform(e, t) {
82
+ ee(e, (n) => {
83
+ let r = n.length, i;
84
+ if (r < 126) i = /* @__PURE__ */ new Uint8Array(1), new DataView(i.buffer).setUint8(0, r);
85
+ else if (r < 65536) {
86
+ i = /* @__PURE__ */ new Uint8Array(3);
87
+ let e = new DataView(i.buffer);
88
+ e.setUint8(0, 126), e.setUint16(1, r);
90
89
  } else {
91
- q = new Uint8Array(9);
92
- let h = new DataView(q.buffer);
93
- h.setUint8(0, 127), h.setBigUint64(1, BigInt(K));
90
+ i = /* @__PURE__ */ new Uint8Array(9);
91
+ let e = new DataView(i.buffer);
92
+ e.setUint8(0, 127), e.setBigUint64(1, BigInt(r));
94
93
  }
95
- h.data && typeof h.data != "string" && (q[0] |= 128), W.enqueue(q), W.enqueue(G);
94
+ e.data && typeof e.data != "string" && (i[0] |= 128), t.enqueue(i), t.enqueue(n);
96
95
  });
97
96
  } });
98
97
  }
99
- var TEXT_DECODER;
100
- function totalLength(h) {
101
- return h.reduce((h, W) => h + W.length, 0);
98
+ var x;
99
+ function S(e) {
100
+ return e.reduce((e, t) => e + t.length, 0);
102
101
  }
103
- function concatChunks(h, W) {
104
- if (h[0].length === W) return h.shift();
105
- let G = new Uint8Array(W), K = 0;
106
- for (let q = 0; q < W; q++) G[q] = h[0][K++], K === h[0].length && (h.shift(), K = 0);
107
- return h.length && K < h[0].length && (h[0] = h[0].slice(K)), G;
102
+ function C(e, t) {
103
+ if (e[0].length === t) return e.shift();
104
+ let n = new Uint8Array(t), r = 0;
105
+ for (let i = 0; i < t; i++) n[i] = e[0][r++], r === e[0].length && (e.shift(), r = 0);
106
+ return e.length && r < e[0].length && (e[0] = e[0].slice(r)), n;
108
107
  }
109
- function createPacketDecoderStream(h, W) {
110
- TEXT_DECODER ||= new TextDecoder();
111
- let G = [], K = 0, q = -1, J = !1;
112
- return new TransformStream({ transform(Y, X) {
113
- for (G.push(Y);;) {
114
- if (K === 0) {
115
- if (totalLength(G) < 1) break;
116
- let h = concatChunks(G, 1);
117
- J = (h[0] & 128) == 128, q = h[0] & 127, K = q < 126 ? 3 : q === 126 ? 1 : 2;
118
- } else if (K === 1) {
119
- if (totalLength(G) < 2) break;
120
- let h = concatChunks(G, 2);
121
- q = new DataView(h.buffer, h.byteOffset, h.length).getUint16(0), K = 3;
122
- } else if (K === 2) {
123
- if (totalLength(G) < 8) break;
124
- let h = concatChunks(G, 8), W = new DataView(h.buffer, h.byteOffset, h.length), J = W.getUint32(0);
125
- if (J > 2 ** 21 - 1) {
126
- X.enqueue(ERROR_PACKET);
108
+ function ce(e, t) {
109
+ x ||= new TextDecoder();
110
+ let n = [], r = 0, i = -1, a = !1;
111
+ return new TransformStream({ transform(o, s) {
112
+ for (n.push(o);;) {
113
+ if (r === 0) {
114
+ if (S(n) < 1) break;
115
+ let e = C(n, 1);
116
+ a = (e[0] & 128) == 128, i = e[0] & 127, r = i < 126 ? 3 : i === 126 ? 1 : 2;
117
+ } else if (r === 1) {
118
+ if (S(n) < 2) break;
119
+ let e = C(n, 2);
120
+ i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
121
+ } else if (r === 2) {
122
+ if (S(n) < 8) break;
123
+ let e = C(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
124
+ if (a > 2 ** 21 - 1) {
125
+ s.enqueue(l);
127
126
  break;
128
127
  }
129
- q = J * 2 ** 32 + W.getUint32(4), K = 3;
128
+ i = a * 2 ** 32 + t.getUint32(4), r = 3;
130
129
  } else {
131
- if (totalLength(G) < q) break;
132
- let h = concatChunks(G, q);
133
- X.enqueue(decodePacket(J ? h : TEXT_DECODER.decode(h), W)), K = 0;
130
+ if (S(n) < i) break;
131
+ let e = C(n, i);
132
+ s.enqueue(v(a ? e : x.decode(e), t)), r = 0;
134
133
  }
135
- if (q === 0 || q > h) {
136
- X.enqueue(ERROR_PACKET);
134
+ if (i === 0 || i > e) {
135
+ s.enqueue(l);
137
136
  break;
138
137
  }
139
138
  }
140
139
  } });
141
140
  }
142
- function Emitter(h) {
143
- if (h) return mixin(h);
141
+ //#endregion
142
+ //#region node_modules/@socket.io/component-emitter/lib/esm/index.js
143
+ function w(e) {
144
+ if (e) return le(e);
144
145
  }
145
- function mixin(h) {
146
- for (var W in Emitter.prototype) h[W] = Emitter.prototype[W];
147
- return h;
146
+ function le(e) {
147
+ for (var t in w.prototype) e[t] = w.prototype[t];
148
+ return e;
148
149
  }
149
- Emitter.prototype.on = Emitter.prototype.addEventListener = function(h, W) {
150
- return this._callbacks = this._callbacks || {}, (this._callbacks["$" + h] = this._callbacks["$" + h] || []).push(W), this;
151
- }, Emitter.prototype.once = function(h, W) {
152
- function G() {
153
- this.off(h, G), W.apply(this, arguments);
154
- }
155
- return G.fn = W, this.on(h, G), this;
156
- }, Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(h, W) {
150
+ w.prototype.on = w.prototype.addEventListener = function(e, t) {
151
+ return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
152
+ }, w.prototype.once = function(e, t) {
153
+ function n() {
154
+ this.off(e, n), t.apply(this, arguments);
155
+ }
156
+ return n.fn = t, this.on(e, n), this;
157
+ }, w.prototype.off = w.prototype.removeListener = w.prototype.removeAllListeners = w.prototype.removeEventListener = function(e, t) {
157
158
  if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this;
158
- var G = this._callbacks["$" + h];
159
- if (!G) return this;
160
- if (arguments.length == 1) return delete this._callbacks["$" + h], this;
161
- for (var K, q = 0; q < G.length; q++) if (K = G[q], K === W || K.fn === W) {
162
- G.splice(q, 1);
159
+ var n = this._callbacks["$" + e];
160
+ if (!n) return this;
161
+ if (arguments.length == 1) return delete this._callbacks["$" + e], this;
162
+ for (var r, i = 0; i < n.length; i++) if (r = n[i], r === t || r.fn === t) {
163
+ n.splice(i, 1);
163
164
  break;
164
165
  }
165
- return G.length === 0 && delete this._callbacks["$" + h], this;
166
- }, Emitter.prototype.emit = function(h) {
166
+ return n.length === 0 && delete this._callbacks["$" + e], this;
167
+ }, w.prototype.emit = function(e) {
167
168
  this._callbacks = this._callbacks || {};
168
- for (var W = Array(arguments.length - 1), G = this._callbacks["$" + h], K = 1; K < arguments.length; K++) W[K - 1] = arguments[K];
169
- if (G) {
170
- G = G.slice(0);
171
- for (var K = 0, q = G.length; K < q; ++K) G[K].apply(this, W);
169
+ for (var t = Array(arguments.length - 1), n = this._callbacks["$" + e], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
170
+ if (n) {
171
+ n = n.slice(0);
172
+ for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, t);
172
173
  }
173
174
  return this;
174
- }, Emitter.prototype.emitReserved = Emitter.prototype.emit, Emitter.prototype.listeners = function(h) {
175
- return this._callbacks = this._callbacks || {}, this._callbacks["$" + h] || [];
176
- }, Emitter.prototype.hasListeners = function(h) {
177
- return !!this.listeners(h).length;
175
+ }, w.prototype.emitReserved = w.prototype.emit, w.prototype.listeners = function(e) {
176
+ return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
177
+ }, w.prototype.hasListeners = function(e) {
178
+ return !!this.listeners(e).length;
178
179
  };
179
- const nextTick = (() => typeof Promise == "function" && typeof Promise.resolve == "function" ? (h) => Promise.resolve().then(h) : (h, W) => W(h, 0))(), globalThisShim = (() => typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")())();
180
- function pick(h, ...W) {
181
- return W.reduce((W, G) => (h.hasOwnProperty(G) && (W[G] = h[G]), W), {});
180
+ //#endregion
181
+ //#region node_modules/engine.io-client/build/esm/globals.js
182
+ var T = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), E = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), ue = "arraybuffer";
183
+ //#endregion
184
+ //#region node_modules/engine.io-client/build/esm/util.js
185
+ function D(e, ...t) {
186
+ return t.reduce((t, n) => (e.hasOwnProperty(n) && (t[n] = e[n]), t), {});
182
187
  }
183
- var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout, NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
184
- function installTimerFunctions(h, W) {
185
- W.useNativeTimers ? (h.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim), h.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)) : (h.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim), h.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim));
188
+ var de = E.setTimeout, fe = E.clearTimeout;
189
+ function O(e, t) {
190
+ t.useNativeTimers ? (e.setTimeoutFn = de.bind(E), e.clearTimeoutFn = fe.bind(E)) : (e.setTimeoutFn = E.setTimeout.bind(E), e.clearTimeoutFn = E.clearTimeout.bind(E));
186
191
  }
187
- var BASE64_OVERHEAD = 1.33;
188
- function byteLength(h) {
189
- return typeof h == "string" ? utf8Length(h) : Math.ceil((h.byteLength || h.size) * BASE64_OVERHEAD);
192
+ var pe = 1.33;
193
+ function me(e) {
194
+ return typeof e == "string" ? he(e) : Math.ceil((e.byteLength || e.size) * pe);
190
195
  }
191
- function utf8Length(h) {
192
- let W = 0, G = 0;
193
- for (let K = 0, q = h.length; K < q; K++) W = h.charCodeAt(K), W < 128 ? G += 1 : W < 2048 ? G += 2 : W < 55296 || W >= 57344 ? G += 3 : (K++, G += 4);
194
- return G;
196
+ function he(e) {
197
+ let t = 0, n = 0;
198
+ for (let r = 0, i = e.length; r < i; r++) t = e.charCodeAt(r), t < 128 ? n += 1 : t < 2048 ? n += 2 : t < 55296 || t >= 57344 ? n += 3 : (r++, n += 4);
199
+ return n;
195
200
  }
196
- function randomString() {
201
+ function ge() {
197
202
  return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
198
203
  }
199
- function encode(h) {
200
- let W = "";
201
- for (let G in h) h.hasOwnProperty(G) && (W.length && (W += "&"), W += encodeURIComponent(G) + "=" + encodeURIComponent(h[G]));
202
- return W;
204
+ //#endregion
205
+ //#region node_modules/engine.io-client/build/esm/contrib/parseqs.js
206
+ function _e(e) {
207
+ let t = "";
208
+ for (let n in e) e.hasOwnProperty(n) && (t.length && (t += "&"), t += encodeURIComponent(n) + "=" + encodeURIComponent(e[n]));
209
+ return t;
203
210
  }
204
- function decode(h) {
205
- let W = {}, G = h.split("&");
206
- for (let h = 0, K = G.length; h < K; h++) {
207
- let K = G[h].split("=");
208
- W[decodeURIComponent(K[0])] = decodeURIComponent(K[1]);
211
+ function ve(e) {
212
+ let t = {}, n = e.split("&");
213
+ for (let e = 0, r = n.length; e < r; e++) {
214
+ let r = n[e].split("=");
215
+ t[decodeURIComponent(r[0])] = decodeURIComponent(r[1]);
209
216
  }
210
- return W;
217
+ return t;
211
218
  }
212
- var TransportError = class extends Error {
213
- constructor(h, W, G) {
214
- super(h), this.description = W, this.context = G, this.type = "TransportError";
219
+ //#endregion
220
+ //#region node_modules/engine.io-client/build/esm/transport.js
221
+ var ye = class extends Error {
222
+ constructor(e, t, n) {
223
+ super(e), this.description = t, this.context = n, this.type = "TransportError";
215
224
  }
216
- }, Transport = class extends Emitter {
217
- constructor(h) {
218
- super(), this.writable = !1, installTimerFunctions(this, h), this.opts = h, this.query = h.query, this.socket = h.socket, this.supportsBinary = !h.forceBase64;
225
+ }, k = class extends w {
226
+ constructor(e) {
227
+ super(), this.writable = !1, O(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
219
228
  }
220
- onError(h, W, G) {
221
- return super.emitReserved("error", new TransportError(h, W, G)), this;
229
+ onError(e, t, n) {
230
+ return super.emitReserved("error", new ye(e, t, n)), this;
222
231
  }
223
232
  open() {
224
233
  return this.readyState = "opening", this.doOpen(), this;
@@ -226,38 +235,38 @@ var TransportError = class extends Error {
226
235
  close() {
227
236
  return (this.readyState === "opening" || this.readyState === "open") && (this.doClose(), this.onClose()), this;
228
237
  }
229
- send(h) {
230
- this.readyState === "open" && this.write(h);
238
+ send(e) {
239
+ this.readyState === "open" && this.write(e);
231
240
  }
232
241
  onOpen() {
233
242
  this.readyState = "open", this.writable = !0, super.emitReserved("open");
234
243
  }
235
- onData(h) {
236
- let W = decodePacket(h, this.socket.binaryType);
237
- this.onPacket(W);
244
+ onData(e) {
245
+ let t = v(e, this.socket.binaryType);
246
+ this.onPacket(t);
238
247
  }
239
- onPacket(h) {
240
- super.emitReserved("packet", h);
248
+ onPacket(e) {
249
+ super.emitReserved("packet", e);
241
250
  }
242
- onClose(h) {
243
- this.readyState = "closed", super.emitReserved("close", h);
251
+ onClose(e) {
252
+ this.readyState = "closed", super.emitReserved("close", e);
244
253
  }
245
- pause(h) {}
246
- createUri(h, W = {}) {
247
- return h + "://" + this._hostname() + this._port() + this.opts.path + this._query(W);
254
+ pause(e) {}
255
+ createUri(e, t = {}) {
256
+ return e + "://" + this._hostname() + this._port() + this.opts.path + this._query(t);
248
257
  }
249
258
  _hostname() {
250
- let h = this.opts.hostname;
251
- return h.indexOf(":") === -1 ? h : "[" + h + "]";
259
+ let e = this.opts.hostname;
260
+ return e.indexOf(":") === -1 ? e : "[" + e + "]";
252
261
  }
253
262
  _port() {
254
263
  return this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
255
264
  }
256
- _query(h) {
257
- let W = encode(h);
258
- return W.length ? "?" + W : "";
265
+ _query(e) {
266
+ let t = _e(e);
267
+ return t.length ? "?" + t : "";
259
268
  }
260
- }, Polling = class extends Transport {
269
+ }, be = class extends k {
261
270
  constructor() {
262
271
  super(...arguments), this._polling = !1;
263
272
  }
@@ -267,190 +276,197 @@ var TransportError = class extends Error {
267
276
  doOpen() {
268
277
  this._poll();
269
278
  }
270
- pause(h) {
279
+ pause(e) {
271
280
  this.readyState = "pausing";
272
- let W = () => {
273
- this.readyState = "paused", h();
281
+ let t = () => {
282
+ this.readyState = "paused", e();
274
283
  };
275
284
  if (this._polling || !this.writable) {
276
- let h = 0;
277
- this._polling && (h++, this.once("pollComplete", function() {
278
- --h || W();
279
- })), this.writable || (h++, this.once("drain", function() {
280
- --h || W();
285
+ let e = 0;
286
+ this._polling && (e++, this.once("pollComplete", function() {
287
+ --e || t();
288
+ })), this.writable || (e++, this.once("drain", function() {
289
+ --e || t();
281
290
  }));
282
- } else W();
291
+ } else t();
283
292
  }
284
293
  _poll() {
285
294
  this._polling = !0, this.doPoll(), this.emitReserved("poll");
286
295
  }
287
- onData(h) {
288
- decodePayload(h, this.socket.binaryType).forEach((h) => {
289
- if (this.readyState === "opening" && h.type === "open" && this.onOpen(), h.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
290
- this.onPacket(h);
296
+ onData(e) {
297
+ oe(e, this.socket.binaryType).forEach((e) => {
298
+ if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
299
+ this.onPacket(e);
291
300
  }), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
292
301
  }
293
302
  doClose() {
294
- let h = () => {
303
+ let e = () => {
295
304
  this.write([{ type: "close" }]);
296
305
  };
297
- this.readyState === "open" ? h() : this.once("open", h);
306
+ this.readyState === "open" ? e() : this.once("open", e);
298
307
  }
299
- write(h) {
300
- this.writable = !1, encodePayload(h, (h) => {
301
- this.doWrite(h, () => {
308
+ write(e) {
309
+ this.writable = !1, ae(e, (e) => {
310
+ this.doWrite(e, () => {
302
311
  this.writable = !0, this.emitReserved("drain");
303
312
  });
304
313
  });
305
314
  }
306
315
  uri() {
307
- let h = this.opts.secure ? "https" : "http", W = this.query || {};
308
- return !1 !== this.opts.timestampRequests && (W[this.opts.timestampParam] = randomString()), !this.supportsBinary && !W.sid && (W.b64 = 1), this.createUri(h, W);
316
+ let e = this.opts.secure ? "https" : "http", t = this.query || {};
317
+ return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = ge()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
309
318
  }
310
- }, value = !1;
319
+ }, A = !1;
311
320
  try {
312
- value = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
321
+ A = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
313
322
  } catch {}
314
- const hasCORS = value;
315
- function empty() {}
316
- var BaseXHR = class extends Polling {
317
- constructor(h) {
318
- if (super(h), typeof location < "u") {
319
- let W = location.protocol === "https:", G = location.port;
320
- G ||= W ? "443" : "80", this.xd = typeof location < "u" && h.hostname !== location.hostname || G !== h.port;
323
+ var xe = A;
324
+ //#endregion
325
+ //#region node_modules/engine.io-client/build/esm/transports/polling-xhr.js
326
+ function Se() {}
327
+ var Ce = class extends be {
328
+ constructor(e) {
329
+ if (super(e), typeof location < "u") {
330
+ let t = location.protocol === "https:", n = location.port;
331
+ n ||= t ? "443" : "80", this.xd = typeof location < "u" && e.hostname !== location.hostname || n !== e.port;
321
332
  }
322
333
  }
323
- doWrite(h, W) {
324
- let G = this.request({
334
+ doWrite(e, t) {
335
+ let n = this.request({
325
336
  method: "POST",
326
- data: h
337
+ data: e
327
338
  });
328
- G.on("success", W), G.on("error", (h, W) => {
329
- this.onError("xhr post error", h, W);
339
+ n.on("success", t), n.on("error", (e, t) => {
340
+ this.onError("xhr post error", e, t);
330
341
  });
331
342
  }
332
343
  doPoll() {
333
- let h = this.request();
334
- h.on("data", this.onData.bind(this)), h.on("error", (h, W) => {
335
- this.onError("xhr poll error", h, W);
336
- }), this.pollXhr = h;
344
+ let e = this.request();
345
+ e.on("data", this.onData.bind(this)), e.on("error", (e, t) => {
346
+ this.onError("xhr poll error", e, t);
347
+ }), this.pollXhr = e;
337
348
  }
338
- }, Request = class h extends Emitter {
339
- constructor(h, W, G) {
340
- super(), this.createRequest = h, installTimerFunctions(this, G), this._opts = G, this._method = G.method || "GET", this._uri = W, this._data = G.data === void 0 ? null : G.data, this._create();
349
+ }, j = class e extends w {
350
+ constructor(e, t, n) {
351
+ super(), this.createRequest = e, O(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
341
352
  }
342
353
  _create() {
343
- var W;
344
- let G = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
345
- G.xdomain = !!this._opts.xd;
346
- let K = this._xhr = this.createRequest(G);
354
+ var t;
355
+ let n = D(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
356
+ n.xdomain = !!this._opts.xd;
357
+ let r = this._xhr = this.createRequest(n);
347
358
  try {
348
- K.open(this._method, this._uri, !0);
359
+ r.open(this._method, this._uri, !0);
349
360
  try {
350
- if (this._opts.extraHeaders) for (let h in K.setDisableHeaderCheck && K.setDisableHeaderCheck(!0), this._opts.extraHeaders) this._opts.extraHeaders.hasOwnProperty(h) && K.setRequestHeader(h, this._opts.extraHeaders[h]);
361
+ if (this._opts.extraHeaders) {
362
+ r.setDisableHeaderCheck && r.setDisableHeaderCheck(!0);
363
+ for (let e in this._opts.extraHeaders) this._opts.extraHeaders.hasOwnProperty(e) && r.setRequestHeader(e, this._opts.extraHeaders[e]);
364
+ }
351
365
  } catch {}
352
366
  if (this._method === "POST") try {
353
- K.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
367
+ r.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
354
368
  } catch {}
355
369
  try {
356
- K.setRequestHeader("Accept", "*/*");
370
+ r.setRequestHeader("Accept", "*/*");
357
371
  } catch {}
358
- (W = this._opts.cookieJar) == null || W.addCookies(K), "withCredentials" in K && (K.withCredentials = this._opts.withCredentials), this._opts.requestTimeout && (K.timeout = this._opts.requestTimeout), K.onreadystatechange = () => {
359
- var h;
360
- K.readyState === 3 && ((h = this._opts.cookieJar) == null || h.parseCookies(K.getResponseHeader("set-cookie"))), K.readyState === 4 && (K.status === 200 || K.status === 1223 ? this._onLoad() : this.setTimeoutFn(() => {
361
- this._onError(typeof K.status == "number" ? K.status : 0);
372
+ (t = this._opts.cookieJar) == null || t.addCookies(r), "withCredentials" in r && (r.withCredentials = this._opts.withCredentials), this._opts.requestTimeout && (r.timeout = this._opts.requestTimeout), r.onreadystatechange = () => {
373
+ var e;
374
+ r.readyState === 3 && ((e = this._opts.cookieJar) == null || e.parseCookies(r.getResponseHeader("set-cookie"))), r.readyState === 4 && (r.status === 200 || r.status === 1223 ? this._onLoad() : this.setTimeoutFn(() => {
375
+ this._onError(typeof r.status == "number" ? r.status : 0);
362
376
  }, 0));
363
- }, K.send(this._data);
364
- } catch (h) {
377
+ }, r.send(this._data);
378
+ } catch (e) {
365
379
  this.setTimeoutFn(() => {
366
- this._onError(h);
380
+ this._onError(e);
367
381
  }, 0);
368
382
  return;
369
383
  }
370
- typeof document < "u" && (this._index = h.requestsCount++, h.requests[this._index] = this);
384
+ typeof document < "u" && (this._index = e.requestsCount++, e.requests[this._index] = this);
371
385
  }
372
- _onError(h) {
373
- this.emitReserved("error", h, this._xhr), this._cleanup(!0);
386
+ _onError(e) {
387
+ this.emitReserved("error", e, this._xhr), this._cleanup(!0);
374
388
  }
375
- _cleanup(W) {
389
+ _cleanup(t) {
376
390
  if (!(this._xhr === void 0 || this._xhr === null)) {
377
- if (this._xhr.onreadystatechange = empty, W) try {
391
+ if (this._xhr.onreadystatechange = Se, t) try {
378
392
  this._xhr.abort();
379
393
  } catch {}
380
- typeof document < "u" && delete h.requests[this._index], this._xhr = null;
394
+ typeof document < "u" && delete e.requests[this._index], this._xhr = null;
381
395
  }
382
396
  }
383
397
  _onLoad() {
384
- let h = this._xhr.responseText;
385
- h !== null && (this.emitReserved("data", h), this.emitReserved("success"), this._cleanup());
398
+ let e = this._xhr.responseText;
399
+ e !== null && (this.emitReserved("data", e), this.emitReserved("success"), this._cleanup());
386
400
  }
387
401
  abort() {
388
402
  this._cleanup();
389
403
  }
390
404
  };
391
- if (Request.requestsCount = 0, Request.requests = {}, typeof document < "u") {
392
- if (typeof attachEvent == "function") attachEvent("onunload", unloadHandler);
405
+ if (j.requestsCount = 0, j.requests = {}, typeof document < "u") {
406
+ if (typeof attachEvent == "function") attachEvent("onunload", M);
393
407
  else if (typeof addEventListener == "function") {
394
- let h = "onpagehide" in globalThisShim ? "pagehide" : "unload";
395
- addEventListener(h, unloadHandler, !1);
408
+ let e = "onpagehide" in E ? "pagehide" : "unload";
409
+ addEventListener(e, M, !1);
396
410
  }
397
411
  }
398
- function unloadHandler() {
399
- for (let h in Request.requests) Request.requests.hasOwnProperty(h) && Request.requests[h].abort();
412
+ function M() {
413
+ for (let e in j.requests) j.requests.hasOwnProperty(e) && j.requests[e].abort();
400
414
  }
401
- var hasXHR2 = (function() {
402
- let h = newRequest({ xdomain: !1 });
403
- return h && h.responseType !== null;
404
- })(), XHR = class extends BaseXHR {
405
- constructor(h) {
406
- super(h);
407
- let W = h && h.forceBase64;
408
- this.supportsBinary = hasXHR2 && !W;
409
- }
410
- request(h = {}) {
411
- return Object.assign(h, { xd: this.xd }, this.opts), new Request(newRequest, this.uri(), h);
415
+ var we = (function() {
416
+ let e = N({ xdomain: !1 });
417
+ return e && e.responseType !== null;
418
+ })(), Te = class extends Ce {
419
+ constructor(e) {
420
+ super(e);
421
+ let t = e && e.forceBase64;
422
+ this.supportsBinary = we && !t;
423
+ }
424
+ request(e = {}) {
425
+ return Object.assign(e, { xd: this.xd }, this.opts), new j(N, this.uri(), e);
412
426
  }
413
427
  };
414
- function newRequest(h) {
415
- let W = h.xdomain;
428
+ function N(e) {
429
+ let t = e.xdomain;
416
430
  try {
417
- if (typeof XMLHttpRequest < "u" && (!W || hasCORS)) return new XMLHttpRequest();
431
+ if (typeof XMLHttpRequest < "u" && (!t || xe)) return new XMLHttpRequest();
418
432
  } catch {}
419
- if (!W) try {
420
- return new globalThisShim[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
433
+ if (!t) try {
434
+ return new E[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
421
435
  } catch {}
422
436
  }
423
- var isReactNative = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", BaseWS = class extends Transport {
437
+ //#endregion
438
+ //#region node_modules/engine.io-client/build/esm/transports/websocket.js
439
+ var P = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", Ee = class extends k {
424
440
  get name() {
425
441
  return "websocket";
426
442
  }
427
443
  doOpen() {
428
- let h = this.uri(), W = this.opts.protocols, G = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
429
- this.opts.extraHeaders && (G.headers = this.opts.extraHeaders);
444
+ let e = this.uri(), t = this.opts.protocols, n = P ? {} : D(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
445
+ this.opts.extraHeaders && (n.headers = this.opts.extraHeaders);
430
446
  try {
431
- this.ws = this.createSocket(h, W, G);
432
- } catch (h) {
433
- return this.emitReserved("error", h);
447
+ this.ws = this.createSocket(e, t, n);
448
+ } catch (e) {
449
+ return this.emitReserved("error", e);
434
450
  }
435
451
  this.ws.binaryType = this.socket.binaryType, this.addEventListeners();
436
452
  }
437
453
  addEventListeners() {
438
454
  this.ws.onopen = () => {
439
455
  this.opts.autoUnref && this.ws._socket.unref(), this.onOpen();
440
- }, this.ws.onclose = (h) => this.onClose({
456
+ }, this.ws.onclose = (e) => this.onClose({
441
457
  description: "websocket connection closed",
442
- context: h
443
- }), this.ws.onmessage = (h) => this.onData(h.data), this.ws.onerror = (h) => this.onError("websocket error", h);
458
+ context: e
459
+ }), this.ws.onmessage = (e) => this.onData(e.data), this.ws.onerror = (e) => this.onError("websocket error", e);
444
460
  }
445
- write(h) {
461
+ write(e) {
446
462
  this.writable = !1;
447
- for (let W = 0; W < h.length; W++) {
448
- let G = h[W], K = W === h.length - 1;
449
- encodePacket(G, this.supportsBinary, (h) => {
463
+ for (let t = 0; t < e.length; t++) {
464
+ let n = e[t], r = t === e.length - 1;
465
+ p(n, this.supportsBinary, (e) => {
450
466
  try {
451
- this.doWrite(G, h);
467
+ this.doWrite(n, e);
452
468
  } catch {}
453
- K && nextTick(() => {
469
+ r && T(() => {
454
470
  this.writable = !0, this.emitReserved("drain");
455
471
  }, this.setTimeoutFn);
456
472
  });
@@ -460,67 +476,65 @@ var isReactNative = typeof navigator < "u" && typeof navigator.product == "strin
460
476
  this.ws !== void 0 && (this.ws.onerror = () => {}, this.ws.close(), this.ws = null);
461
477
  }
462
478
  uri() {
463
- let h = this.opts.secure ? "wss" : "ws", W = this.query || {};
464
- return this.opts.timestampRequests && (W[this.opts.timestampParam] = randomString()), this.supportsBinary || (W.b64 = 1), this.createUri(h, W);
465
- }
466
- }, WebSocketCtor = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
467
- const transports = {
468
- websocket: class extends BaseWS {
469
- createSocket(h, W, G) {
470
- return isReactNative ? new WebSocketCtor(h, W, G) : W ? new WebSocketCtor(h, W) : new WebSocketCtor(h);
479
+ let e = this.opts.secure ? "wss" : "ws", t = this.query || {};
480
+ return this.opts.timestampRequests && (t[this.opts.timestampParam] = ge()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
481
+ }
482
+ }, F = E.WebSocket || E.MozWebSocket, De = {
483
+ websocket: class extends Ee {
484
+ createSocket(e, t, n) {
485
+ return P ? new F(e, t, n) : t ? new F(e, t) : new F(e);
471
486
  }
472
- doWrite(h, W) {
473
- this.ws.send(W);
487
+ doWrite(e, t) {
488
+ this.ws.send(t);
474
489
  }
475
490
  },
476
- webtransport: class extends Transport {
491
+ webtransport: class extends k {
477
492
  get name() {
478
493
  return "webtransport";
479
494
  }
480
495
  doOpen() {
481
496
  try {
482
497
  this._transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]);
483
- } catch (h) {
484
- return this.emitReserved("error", h);
498
+ } catch (e) {
499
+ return this.emitReserved("error", e);
485
500
  }
486
501
  this._transport.closed.then(() => {
487
502
  this.onClose();
488
- }).catch((h) => {
489
- this.onError("webtransport error", h);
503
+ }).catch((e) => {
504
+ this.onError("webtransport error", e);
490
505
  }), this._transport.ready.then(() => {
491
- this._transport.createBidirectionalStream().then((h) => {
492
- let W = createPacketDecoderStream(2 ** 53 - 1, this.socket.binaryType), G = h.readable.pipeThrough(W).getReader(), K = createPacketEncoderStream();
493
- K.readable.pipeTo(h.writable), this._writer = K.writable.getWriter();
494
- let q = () => {
495
- G.read().then(({ done: h, value: W }) => {
496
- h || (this.onPacket(W), q());
497
- }).catch((h) => {});
506
+ this._transport.createBidirectionalStream().then((e) => {
507
+ let t = ce(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = se();
508
+ r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
509
+ let i = () => {
510
+ n.read().then(({ done: e, value: t }) => {
511
+ e || (this.onPacket(t), i());
512
+ }).catch((e) => {});
498
513
  };
499
- q();
500
- let J = { type: "open" };
501
- this.query.sid && (J.data = `{"sid":"${this.query.sid}"}`), this._writer.write(J).then(() => this.onOpen());
514
+ i();
515
+ let a = { type: "open" };
516
+ this.query.sid && (a.data = `{"sid":"${this.query.sid}"}`), this._writer.write(a).then(() => this.onOpen());
502
517
  });
503
518
  });
504
519
  }
505
- write(h) {
520
+ write(e) {
506
521
  this.writable = !1;
507
- for (let W = 0; W < h.length; W++) {
508
- let G = h[W], K = W === h.length - 1;
509
- this._writer.write(G).then(() => {
510
- K && nextTick(() => {
522
+ for (let t = 0; t < e.length; t++) {
523
+ let n = e[t], r = t === e.length - 1;
524
+ this._writer.write(n).then(() => {
525
+ r && T(() => {
511
526
  this.writable = !0, this.emitReserved("drain");
512
527
  }, this.setTimeoutFn);
513
528
  });
514
529
  }
515
530
  }
516
531
  doClose() {
517
- var h;
518
- (h = this._transport) == null || h.close();
532
+ var e;
533
+ (e = this._transport) == null || e.close();
519
534
  }
520
535
  },
521
- polling: XHR
522
- };
523
- var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, parts = [
536
+ polling: Te
537
+ }, Oe = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, ke = [
524
538
  "source",
525
539
  "protocol",
526
540
  "authority",
@@ -536,37 +550,39 @@ var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*
536
550
  "query",
537
551
  "anchor"
538
552
  ];
539
- function parse(h) {
540
- if (h.length > 8e3) throw "URI too long";
541
- let W = h, G = h.indexOf("["), K = h.indexOf("]");
542
- G != -1 && K != -1 && (h = h.substring(0, G) + h.substring(G, K).replace(/:/g, ";") + h.substring(K, h.length));
543
- let q = re.exec(h || ""), J = {}, Y = 14;
544
- for (; Y--;) J[parts[Y]] = q[Y] || "";
545
- return G != -1 && K != -1 && (J.source = W, J.host = J.host.substring(1, J.host.length - 1).replace(/;/g, ":"), J.authority = J.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), J.ipv6uri = !0), J.pathNames = pathNames(J, J.path), J.queryKey = queryKey(J, J.query), J;
553
+ function I(e) {
554
+ if (e.length > 8e3) throw "URI too long";
555
+ let t = e, n = e.indexOf("["), r = e.indexOf("]");
556
+ n != -1 && r != -1 && (e = e.substring(0, n) + e.substring(n, r).replace(/:/g, ";") + e.substring(r, e.length));
557
+ let i = Oe.exec(e || ""), a = {}, o = 14;
558
+ for (; o--;) a[ke[o]] = i[o] || "";
559
+ return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = Ae(a, a.path), a.queryKey = je(a, a.query), a;
546
560
  }
547
- function pathNames(h, W) {
548
- let G = W.replace(/\/{2,9}/g, "/").split("/");
549
- return (W.slice(0, 1) == "/" || W.length === 0) && G.splice(0, 1), W.slice(-1) == "/" && G.splice(G.length - 1, 1), G;
561
+ function Ae(e, t) {
562
+ let n = t.replace(/\/{2,9}/g, "/").split("/");
563
+ return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
550
564
  }
551
- function queryKey(h, W) {
552
- let G = {};
553
- return W.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(h, W, K) {
554
- W && (G[W] = K);
555
- }), G;
565
+ function je(e, t) {
566
+ let n = {};
567
+ return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(e, t, r) {
568
+ t && (n[t] = r);
569
+ }), n;
556
570
  }
557
- var withEventListeners = typeof addEventListener == "function" && typeof removeEventListener == "function", OFFLINE_EVENT_LISTENERS = [];
558
- withEventListeners && addEventListener("offline", () => {
559
- OFFLINE_EVENT_LISTENERS.forEach((h) => h());
571
+ //#endregion
572
+ //#region node_modules/engine.io-client/build/esm/socket.js
573
+ var L = typeof addEventListener == "function" && typeof removeEventListener == "function", R = [];
574
+ L && addEventListener("offline", () => {
575
+ R.forEach((e) => e());
560
576
  }, !1);
561
- var SocketWithoutUpgrade = class h extends Emitter {
562
- constructor(h, W) {
563
- if (super(), this.binaryType = "arraybuffer", this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, h && typeof h == "object" && (W = h, h = null), h) {
564
- let G = parse(h);
565
- W.hostname = G.host, W.secure = G.protocol === "https" || G.protocol === "wss", W.port = G.port, G.query && (W.query = G.query);
566
- } else W.host && (W.hostname = parse(W.host).host);
567
- installTimerFunctions(this, W), this.secure = W.secure == null ? typeof location < "u" && location.protocol === "https:" : W.secure, W.hostname && !W.port && (W.port = this.secure ? "443" : "80"), this.hostname = W.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = W.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, W.transports.forEach((h) => {
568
- let W = h.prototype.name;
569
- this.transports.push(W), this._transportsByName[W] = h;
577
+ var z = class e extends w {
578
+ constructor(e, t) {
579
+ if (super(), this.binaryType = ue, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
580
+ let n = I(e);
581
+ t.hostname = n.host, t.secure = n.protocol === "https" || n.protocol === "wss", t.port = n.port, n.query && (t.query = n.query);
582
+ } else t.host && (t.hostname = I(t.host).host);
583
+ O(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, 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 = [], this._transportsByName = {}, t.transports.forEach((e) => {
584
+ let t = e.prototype.name;
585
+ this.transports.push(t), this._transportsByName[t] = e;
570
586
  }), this.opts = Object.assign({
571
587
  path: "/engine.io",
572
588
  agent: !1,
@@ -579,23 +595,23 @@ var SocketWithoutUpgrade = class h extends Emitter {
579
595
  perMessageDeflate: { threshold: 1024 },
580
596
  transportOptions: {},
581
597
  closeOnBeforeunload: !1
582
- }, W), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = decode(this.opts.query)), withEventListeners && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
598
+ }, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ve(this.opts.query)), L && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
583
599
  this.transport && (this.transport.removeAllListeners(), this.transport.close());
584
600
  }, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
585
601
  this._onClose("transport close", { description: "network connection lost" });
586
- }, OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
602
+ }, R.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
587
603
  }
588
- createTransport(h) {
589
- let W = Object.assign({}, this.opts.query);
590
- W.EIO = 4, W.transport = h, this.id && (W.sid = this.id);
591
- let G = Object.assign({}, this.opts, {
592
- query: W,
604
+ createTransport(e) {
605
+ let t = Object.assign({}, this.opts.query);
606
+ t.EIO = 4, t.transport = e, this.id && (t.sid = this.id);
607
+ let n = Object.assign({}, this.opts, {
608
+ query: t,
593
609
  socket: this,
594
610
  hostname: this.hostname,
595
611
  secure: this.secure,
596
612
  port: this.port
597
- }, this.opts.transportOptions[h]);
598
- return new this._transportsByName[h](G);
613
+ }, this.opts.transportOptions[e]);
614
+ return new this._transportsByName[e](n);
599
615
  }
600
616
  _open() {
601
617
  if (this.transports.length === 0) {
@@ -604,359 +620,367 @@ var SocketWithoutUpgrade = class h extends Emitter {
604
620
  }, 0);
605
621
  return;
606
622
  }
607
- let W = this.opts.rememberUpgrade && h.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0];
623
+ let t = this.opts.rememberUpgrade && e.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0];
608
624
  this.readyState = "opening";
609
- let G = this.createTransport(W);
610
- G.open(), this.setTransport(G);
625
+ let n = this.createTransport(t);
626
+ n.open(), this.setTransport(n);
611
627
  }
612
- setTransport(h) {
613
- this.transport && this.transport.removeAllListeners(), this.transport = h, h.on("drain", this._onDrain.bind(this)).on("packet", this._onPacket.bind(this)).on("error", this._onError.bind(this)).on("close", (h) => this._onClose("transport close", h));
628
+ setTransport(e) {
629
+ 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", (e) => this._onClose("transport close", e));
614
630
  }
615
631
  onOpen() {
616
- this.readyState = "open", h.priorWebsocketSuccess = this.transport.name === "websocket", this.emitReserved("open"), this.flush();
632
+ this.readyState = "open", e.priorWebsocketSuccess = this.transport.name === "websocket", this.emitReserved("open"), this.flush();
617
633
  }
618
- _onPacket(h) {
619
- if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") switch (this.emitReserved("packet", h), this.emitReserved("heartbeat"), h.type) {
634
+ _onPacket(e) {
635
+ if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") switch (this.emitReserved("packet", e), this.emitReserved("heartbeat"), e.type) {
620
636
  case "open":
621
- this.onHandshake(JSON.parse(h.data));
637
+ this.onHandshake(JSON.parse(e.data));
622
638
  break;
623
639
  case "ping":
624
640
  this._sendPacket("pong"), this.emitReserved("ping"), this.emitReserved("pong"), this._resetPingTimeout();
625
641
  break;
626
642
  case "error":
627
- let W = /* @__PURE__ */ Error("server error");
628
- W.code = h.data, this._onError(W);
643
+ let t = /* @__PURE__ */ Error("server error");
644
+ t.code = e.data, this._onError(t);
629
645
  break;
630
646
  case "message":
631
- this.emitReserved("data", h.data), this.emitReserved("message", h.data);
647
+ this.emitReserved("data", e.data), this.emitReserved("message", e.data);
632
648
  break;
633
649
  }
634
650
  }
635
- onHandshake(h) {
636
- this.emitReserved("handshake", h), this.id = h.sid, this.transport.query.sid = h.sid, this._pingInterval = h.pingInterval, this._pingTimeout = h.pingTimeout, this._maxPayload = h.maxPayload, this.onOpen(), this.readyState !== "closed" && this._resetPingTimeout();
651
+ onHandshake(e) {
652
+ this.emitReserved("handshake", e), this.id = e.sid, this.transport.query.sid = e.sid, this._pingInterval = e.pingInterval, this._pingTimeout = e.pingTimeout, this._maxPayload = e.maxPayload, this.onOpen(), this.readyState !== "closed" && this._resetPingTimeout();
637
653
  }
638
654
  _resetPingTimeout() {
639
655
  this.clearTimeoutFn(this._pingTimeoutTimer);
640
- let h = this._pingInterval + this._pingTimeout;
641
- this._pingTimeoutTime = Date.now() + h, this._pingTimeoutTimer = this.setTimeoutFn(() => {
656
+ let e = this._pingInterval + this._pingTimeout;
657
+ this._pingTimeoutTime = Date.now() + e, this._pingTimeoutTimer = this.setTimeoutFn(() => {
642
658
  this._onClose("ping timeout");
643
- }, h), this.opts.autoUnref && this._pingTimeoutTimer.unref();
659
+ }, e), this.opts.autoUnref && this._pingTimeoutTimer.unref();
644
660
  }
645
661
  _onDrain() {
646
662
  this.writeBuffer.splice(0, this._prevBufferLen), this._prevBufferLen = 0, this.writeBuffer.length === 0 ? this.emitReserved("drain") : this.flush();
647
663
  }
648
664
  flush() {
649
665
  if (this.readyState !== "closed" && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
650
- let h = this._getWritablePackets();
651
- this.transport.send(h), this._prevBufferLen = h.length, this.emitReserved("flush");
666
+ let e = this._getWritablePackets();
667
+ this.transport.send(e), this._prevBufferLen = e.length, this.emitReserved("flush");
652
668
  }
653
669
  }
654
670
  _getWritablePackets() {
655
671
  if (!(this._maxPayload && this.transport.name === "polling" && this.writeBuffer.length > 1)) return this.writeBuffer;
656
- let h = 1;
657
- for (let W = 0; W < this.writeBuffer.length; W++) {
658
- let G = this.writeBuffer[W].data;
659
- if (G && (h += byteLength(G)), W > 0 && h > this._maxPayload) return this.writeBuffer.slice(0, W);
660
- h += 2;
672
+ let e = 1;
673
+ for (let t = 0; t < this.writeBuffer.length; t++) {
674
+ let n = this.writeBuffer[t].data;
675
+ if (n && (e += me(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
676
+ e += 2;
661
677
  }
662
678
  return this.writeBuffer;
663
679
  }
664
680
  _hasPingExpired() {
665
681
  if (!this._pingTimeoutTime) return !0;
666
- let h = Date.now() > this._pingTimeoutTime;
667
- return h && (this._pingTimeoutTime = 0, nextTick(() => {
682
+ let e = Date.now() > this._pingTimeoutTime;
683
+ return e && (this._pingTimeoutTime = 0, T(() => {
668
684
  this._onClose("ping timeout");
669
- }, this.setTimeoutFn)), h;
685
+ }, this.setTimeoutFn)), e;
670
686
  }
671
- write(h, W, G) {
672
- return this._sendPacket("message", h, W, G), this;
687
+ write(e, t, n) {
688
+ return this._sendPacket("message", e, t, n), this;
673
689
  }
674
- send(h, W, G) {
675
- return this._sendPacket("message", h, W, G), this;
690
+ send(e, t, n) {
691
+ return this._sendPacket("message", e, t, n), this;
676
692
  }
677
- _sendPacket(h, W, G, K) {
678
- if (typeof W == "function" && (K = W, W = void 0), typeof G == "function" && (K = G, G = null), this.readyState === "closing" || this.readyState === "closed") return;
679
- G ||= {}, G.compress = !1 !== G.compress;
680
- let q = {
681
- type: h,
682
- data: W,
683
- options: G
693
+ _sendPacket(e, t, n, r) {
694
+ if (typeof t == "function" && (r = t, t = void 0), typeof n == "function" && (r = n, n = null), this.readyState === "closing" || this.readyState === "closed") return;
695
+ n ||= {}, n.compress = !1 !== n.compress;
696
+ let i = {
697
+ type: e,
698
+ data: t,
699
+ options: n
684
700
  };
685
- this.emitReserved("packetCreate", q), this.writeBuffer.push(q), K && this.once("flush", K), this.flush();
701
+ this.emitReserved("packetCreate", i), this.writeBuffer.push(i), r && this.once("flush", r), this.flush();
686
702
  }
687
703
  close() {
688
- let h = () => {
704
+ let e = () => {
689
705
  this._onClose("forced close"), this.transport.close();
690
- }, W = () => {
691
- this.off("upgrade", W), this.off("upgradeError", W), h();
692
- }, G = () => {
693
- this.once("upgrade", W), this.once("upgradeError", W);
706
+ }, t = () => {
707
+ this.off("upgrade", t), this.off("upgradeError", t), e();
708
+ }, n = () => {
709
+ this.once("upgrade", t), this.once("upgradeError", t);
694
710
  };
695
711
  return (this.readyState === "opening" || this.readyState === "open") && (this.readyState = "closing", this.writeBuffer.length ? this.once("drain", () => {
696
- this.upgrading ? G() : h();
697
- }) : this.upgrading ? G() : h()), this;
712
+ this.upgrading ? n() : e();
713
+ }) : this.upgrading ? n() : e()), this;
698
714
  }
699
- _onError(W) {
700
- if (h.priorWebsocketSuccess = !1, this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening") return this.transports.shift(), this._open();
701
- this.emitReserved("error", W), this._onClose("transport error", W);
715
+ _onError(t) {
716
+ if (e.priorWebsocketSuccess = !1, this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening") return this.transports.shift(), this._open();
717
+ this.emitReserved("error", t), this._onClose("transport error", t);
702
718
  }
703
- _onClose(h, W) {
719
+ _onClose(e, t) {
704
720
  if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
705
- if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), withEventListeners && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
706
- let h = OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);
707
- h !== -1 && OFFLINE_EVENT_LISTENERS.splice(h, 1);
721
+ if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), L && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
722
+ let e = R.indexOf(this._offlineEventListener);
723
+ e !== -1 && R.splice(e, 1);
708
724
  }
709
- this.readyState = "closed", this.id = null, this.emitReserved("close", h, W), this.writeBuffer = [], this._prevBufferLen = 0;
725
+ this.readyState = "closed", this.id = null, this.emitReserved("close", e, t), this.writeBuffer = [], this._prevBufferLen = 0;
710
726
  }
711
727
  }
712
728
  };
713
- SocketWithoutUpgrade.protocol = 4;
714
- var SocketWithUpgrade = class extends SocketWithoutUpgrade {
729
+ z.protocol = 4;
730
+ var Me = class extends z {
715
731
  constructor() {
716
732
  super(...arguments), this._upgrades = [];
717
733
  }
718
734
  onOpen() {
719
- if (super.onOpen(), this.readyState === "open" && this.opts.upgrade) for (let h = 0; h < this._upgrades.length; h++) this._probe(this._upgrades[h]);
735
+ if (super.onOpen(), this.readyState === "open" && this.opts.upgrade) for (let e = 0; e < this._upgrades.length; e++) this._probe(this._upgrades[e]);
720
736
  }
721
- _probe(h) {
722
- let W = this.createTransport(h), G = !1;
723
- SocketWithoutUpgrade.priorWebsocketSuccess = !1;
724
- let K = () => {
725
- G || (W.send([{
737
+ _probe(e) {
738
+ let t = this.createTransport(e), n = !1;
739
+ z.priorWebsocketSuccess = !1;
740
+ let r = () => {
741
+ n || (t.send([{
726
742
  type: "ping",
727
743
  data: "probe"
728
- }]), W.once("packet", (h) => {
729
- if (!G) if (h.type === "pong" && h.data === "probe") {
730
- if (this.upgrading = !0, this.emitReserved("upgrading", W), !W) return;
731
- SocketWithoutUpgrade.priorWebsocketSuccess = W.name === "websocket", this.transport.pause(() => {
732
- G || this.readyState !== "closed" && (Q(), this.setTransport(W), W.send([{ type: "upgrade" }]), this.emitReserved("upgrade", W), W = null, this.upgrading = !1, this.flush());
744
+ }]), t.once("packet", (e) => {
745
+ if (!n) if (e.type === "pong" && e.data === "probe") {
746
+ if (this.upgrading = !0, this.emitReserved("upgrading", t), !t) return;
747
+ z.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
748
+ n || this.readyState !== "closed" && (l(), this.setTransport(t), t.send([{ type: "upgrade" }]), this.emitReserved("upgrade", t), t = null, this.upgrading = !1, this.flush());
733
749
  });
734
750
  } else {
735
- let h = /* @__PURE__ */ Error("probe error");
736
- h.transport = W.name, this.emitReserved("upgradeError", h);
751
+ let e = /* @__PURE__ */ Error("probe error");
752
+ e.transport = t.name, this.emitReserved("upgradeError", e);
737
753
  }
738
754
  }));
739
755
  };
740
- function q() {
741
- G || (G = !0, Q(), W.close(), W = null);
756
+ function i() {
757
+ n || (n = !0, l(), t.close(), t = null);
742
758
  }
743
- let J = (h) => {
744
- let G = /* @__PURE__ */ Error("probe error: " + h);
745
- G.transport = W.name, q(), this.emitReserved("upgradeError", G);
759
+ let a = (e) => {
760
+ let n = /* @__PURE__ */ Error("probe error: " + e);
761
+ n.transport = t.name, i(), this.emitReserved("upgradeError", n);
746
762
  };
747
- function Y() {
748
- J("transport closed");
763
+ function o() {
764
+ a("transport closed");
749
765
  }
750
- function X() {
751
- J("socket closed");
766
+ function s() {
767
+ a("socket closed");
752
768
  }
753
- function Z(h) {
754
- W && h.name !== W.name && q();
769
+ function c(e) {
770
+ t && e.name !== t.name && i();
755
771
  }
756
- let Q = () => {
757
- W.removeListener("open", K), W.removeListener("error", J), W.removeListener("close", Y), this.off("close", X), this.off("upgrading", Z);
772
+ let l = () => {
773
+ t.removeListener("open", r), t.removeListener("error", a), t.removeListener("close", o), this.off("close", s), this.off("upgrading", c);
758
774
  };
759
- W.once("open", K), W.once("error", J), W.once("close", Y), this.once("close", X), this.once("upgrading", Z), this._upgrades.indexOf("webtransport") !== -1 && h !== "webtransport" ? this.setTimeoutFn(() => {
760
- G || W.open();
761
- }, 200) : W.open();
762
- }
763
- onHandshake(h) {
764
- this._upgrades = this._filterUpgrades(h.upgrades), super.onHandshake(h);
765
- }
766
- _filterUpgrades(h) {
767
- let W = [];
768
- for (let G = 0; G < h.length; G++) ~this.transports.indexOf(h[G]) && W.push(h[G]);
769
- return W;
770
- }
771
- }, Socket$1 = class extends SocketWithUpgrade {
772
- constructor(h, W = {}) {
773
- let G = typeof h == "object" ? h : W;
774
- (!G.transports || G.transports && typeof G.transports[0] == "string") && (G.transports = (G.transports || [
775
+ t.once("open", r), t.once("error", a), t.once("close", o), this.once("close", s), this.once("upgrading", c), this._upgrades.indexOf("webtransport") !== -1 && e !== "webtransport" ? this.setTimeoutFn(() => {
776
+ n || t.open();
777
+ }, 200) : t.open();
778
+ }
779
+ onHandshake(e) {
780
+ this._upgrades = this._filterUpgrades(e.upgrades), super.onHandshake(e);
781
+ }
782
+ _filterUpgrades(e) {
783
+ let t = [];
784
+ for (let n = 0; n < e.length; n++) ~this.transports.indexOf(e[n]) && t.push(e[n]);
785
+ return t;
786
+ }
787
+ }, B = class extends Me {
788
+ constructor(e, t = {}) {
789
+ let n = typeof e == "object" ? e : t;
790
+ (!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || [
775
791
  "polling",
776
792
  "websocket",
777
793
  "webtransport"
778
- ]).map((h) => transports[h]).filter((h) => !!h)), super(h, G);
794
+ ]).map((e) => De[e]).filter((e) => !!e)), super(e, n);
779
795
  }
780
796
  };
781
- Socket$1.protocol;
782
- function url(h, W = "", G) {
783
- let K = h;
784
- G ||= typeof location < "u" && location, h ??= G.protocol + "//" + G.host, typeof h == "string" && (h.charAt(0) === "/" && (h = h.charAt(1) === "/" ? G.protocol + h : G.host + h), /^(https?|wss?):\/\//.test(h) || (h = G === void 0 ? "https://" + h : G.protocol + "//" + h), K = parse(h)), K.port || (/^(http|ws)$/.test(K.protocol) ? K.port = "80" : /^(http|ws)s$/.test(K.protocol) && (K.port = "443")), K.path = K.path || "/";
785
- let q = K.host.indexOf(":") === -1 ? K.host : "[" + K.host + "]";
786
- return K.id = K.protocol + "://" + q + ":" + K.port + W, K.href = K.protocol + "://" + q + (G && G.port === K.port ? "" : ":" + K.port), K;
797
+ B.protocol;
798
+ //#endregion
799
+ //#region node_modules/socket.io-client/build/esm/url.js
800
+ function Ne(e, t = "", n) {
801
+ let r = e;
802
+ n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = I(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
803
+ let i = r.host.indexOf(":") === -1 ? r.host : "[" + r.host + "]";
804
+ return r.id = r.protocol + "://" + i + ":" + r.port + t, r.href = r.protocol + "://" + i + (n && n.port === r.port ? "" : ":" + r.port), r;
787
805
  }
788
- var withNativeArrayBuffer = typeof ArrayBuffer == "function", isView = (h) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(h) : h.buffer instanceof ArrayBuffer, toString = Object.prototype.toString, withNativeBlob = typeof Blob == "function" || typeof Blob < "u" && toString.call(Blob) === "[object BlobConstructor]", withNativeFile = typeof File == "function" || typeof File < "u" && toString.call(File) === "[object FileConstructor]";
789
- function isBinary(h) {
790
- return withNativeArrayBuffer && (h instanceof ArrayBuffer || isView(h)) || withNativeBlob && h instanceof Blob || withNativeFile && h instanceof File;
806
+ //#endregion
807
+ //#region node_modules/socket.io-parser/build/esm/is-binary.js
808
+ var Pe = typeof ArrayBuffer == "function", Fe = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, V = Object.prototype.toString, Ie = typeof Blob == "function" || typeof Blob < "u" && V.call(Blob) === "[object BlobConstructor]", Le = typeof File == "function" || typeof File < "u" && V.call(File) === "[object FileConstructor]";
809
+ function H(e) {
810
+ return Pe && (e instanceof ArrayBuffer || Fe(e)) || Ie && e instanceof Blob || Le && e instanceof File;
791
811
  }
792
- function hasBinary(h, W) {
793
- if (!h || typeof h != "object") return !1;
794
- if (Array.isArray(h)) {
795
- for (let W = 0, G = h.length; W < G; W++) if (hasBinary(h[W])) return !0;
812
+ function U(e, t) {
813
+ if (!e || typeof e != "object") return !1;
814
+ if (Array.isArray(e)) {
815
+ for (let t = 0, n = e.length; t < n; t++) if (U(e[t])) return !0;
796
816
  return !1;
797
817
  }
798
- if (isBinary(h)) return !0;
799
- if (h.toJSON && typeof h.toJSON == "function" && arguments.length === 1) return hasBinary(h.toJSON(), !0);
800
- for (let W in h) if (Object.prototype.hasOwnProperty.call(h, W) && hasBinary(h[W])) return !0;
818
+ if (H(e)) return !0;
819
+ if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return U(e.toJSON(), !0);
820
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && U(e[t])) return !0;
801
821
  return !1;
802
822
  }
803
- function deconstructPacket(h) {
804
- let W = [], G = h.data, K = h;
805
- return K.data = _deconstructPacket(G, W), K.attachments = W.length, {
806
- packet: K,
807
- buffers: W
823
+ //#endregion
824
+ //#region node_modules/socket.io-parser/build/esm/binary.js
825
+ function Re(e) {
826
+ let t = [], n = e.data, r = e;
827
+ return r.data = W(n, t), r.attachments = t.length, {
828
+ packet: r,
829
+ buffers: t
808
830
  };
809
831
  }
810
- function _deconstructPacket(h, W) {
811
- if (!h) return h;
812
- if (isBinary(h)) {
813
- let G = {
832
+ function W(e, t) {
833
+ if (!e) return e;
834
+ if (H(e)) {
835
+ let n = {
814
836
  _placeholder: !0,
815
- num: W.length
837
+ num: t.length
816
838
  };
817
- return W.push(h), G;
818
- } else if (Array.isArray(h)) {
819
- let G = Array(h.length);
820
- for (let K = 0; K < h.length; K++) G[K] = _deconstructPacket(h[K], W);
821
- return G;
822
- } else if (typeof h == "object" && !(h instanceof Date)) {
823
- let G = {};
824
- for (let K in h) Object.prototype.hasOwnProperty.call(h, K) && (G[K] = _deconstructPacket(h[K], W));
825
- return G;
826
- }
827
- return h;
839
+ return t.push(e), n;
840
+ } else if (Array.isArray(e)) {
841
+ let n = Array(e.length);
842
+ for (let r = 0; r < e.length; r++) n[r] = W(e[r], t);
843
+ return n;
844
+ } else if (typeof e == "object" && !(e instanceof Date)) {
845
+ let n = {};
846
+ for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = W(e[r], t));
847
+ return n;
848
+ }
849
+ return e;
828
850
  }
829
- function reconstructPacket(h, W) {
830
- return h.data = _reconstructPacket(h.data, W), delete h.attachments, h;
851
+ function ze(e, t) {
852
+ return e.data = G(e.data, t), delete e.attachments, e;
831
853
  }
832
- function _reconstructPacket(h, W) {
833
- if (!h) return h;
834
- if (h && h._placeholder === !0) {
835
- if (typeof h.num == "number" && h.num >= 0 && h.num < W.length) return W[h.num];
854
+ function G(e, t) {
855
+ if (!e) return e;
856
+ if (e && e._placeholder === !0) {
857
+ if (typeof e.num == "number" && e.num >= 0 && e.num < t.length) return t[e.num];
836
858
  throw Error("illegal attachments");
837
- } else if (Array.isArray(h)) for (let G = 0; G < h.length; G++) h[G] = _reconstructPacket(h[G], W);
838
- else if (typeof h == "object") for (let G in h) Object.prototype.hasOwnProperty.call(h, G) && (h[G] = _reconstructPacket(h[G], W));
839
- return h;
859
+ } else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = G(e[n], t);
860
+ else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = G(e[n], t));
861
+ return e;
840
862
  }
841
- var esm_exports = /* @__PURE__ */ __export({
842
- Decoder: () => Decoder,
843
- Encoder: () => Encoder,
844
- PacketType: () => PacketType,
863
+ //#endregion
864
+ //#region node_modules/socket.io-parser/build/esm/index.js
865
+ var Be = /* @__PURE__ */ e({
866
+ Decoder: () => Ue,
867
+ Encoder: () => He,
868
+ PacketType: () => K,
845
869
  protocol: () => 5
846
- }, 1), RESERVED_EVENTS$1 = [
870
+ }), Ve = [
847
871
  "connect",
848
872
  "connect_error",
849
873
  "disconnect",
850
874
  "disconnecting",
851
875
  "newListener",
852
876
  "removeListener"
853
- ], PacketType;
854
- (function(h) {
855
- h[h.CONNECT = 0] = "CONNECT", h[h.DISCONNECT = 1] = "DISCONNECT", h[h.EVENT = 2] = "EVENT", h[h.ACK = 3] = "ACK", h[h.CONNECT_ERROR = 4] = "CONNECT_ERROR", h[h.BINARY_EVENT = 5] = "BINARY_EVENT", h[h.BINARY_ACK = 6] = "BINARY_ACK";
856
- })(PacketType ||= {});
857
- var Encoder = class {
858
- constructor(h) {
859
- this.replacer = h;
860
- }
861
- encode(h) {
862
- return (h.type === PacketType.EVENT || h.type === PacketType.ACK) && hasBinary(h) ? this.encodeAsBinary({
863
- type: h.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK,
864
- nsp: h.nsp,
865
- data: h.data,
866
- id: h.id
867
- }) : [this.encodeAsString(h)];
868
- }
869
- encodeAsString(h) {
870
- let W = "" + h.type;
871
- return (h.type === PacketType.BINARY_EVENT || h.type === PacketType.BINARY_ACK) && (W += h.attachments + "-"), h.nsp && h.nsp !== "/" && (W += h.nsp + ","), h.id != null && (W += h.id), h.data != null && (W += JSON.stringify(h.data, this.replacer)), W;
872
- }
873
- encodeAsBinary(h) {
874
- let W = deconstructPacket(h), G = this.encodeAsString(W.packet), K = W.buffers;
875
- return K.unshift(G), K;
877
+ ], K;
878
+ (function(e) {
879
+ e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
880
+ })(K ||= {});
881
+ var He = class {
882
+ constructor(e) {
883
+ this.replacer = e;
884
+ }
885
+ encode(e) {
886
+ return (e.type === K.EVENT || e.type === K.ACK) && U(e) ? this.encodeAsBinary({
887
+ type: e.type === K.EVENT ? K.BINARY_EVENT : K.BINARY_ACK,
888
+ nsp: e.nsp,
889
+ data: e.data,
890
+ id: e.id
891
+ }) : [this.encodeAsString(e)];
892
+ }
893
+ encodeAsString(e) {
894
+ let t = "" + e.type;
895
+ return (e.type === K.BINARY_EVENT || e.type === K.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;
896
+ }
897
+ encodeAsBinary(e) {
898
+ let t = Re(e), n = this.encodeAsString(t.packet), r = t.buffers;
899
+ return r.unshift(n), r;
876
900
  }
877
901
  };
878
- function isObject(h) {
879
- return Object.prototype.toString.call(h) === "[object Object]";
902
+ function q(e) {
903
+ return Object.prototype.toString.call(e) === "[object Object]";
880
904
  }
881
- var Decoder = class h extends Emitter {
882
- constructor(h) {
883
- super(), this.reviver = h;
905
+ var Ue = class e extends w {
906
+ constructor(e) {
907
+ super(), this.reviver = e;
884
908
  }
885
- add(h) {
886
- let W;
887
- if (typeof h == "string") {
909
+ add(e) {
910
+ let t;
911
+ if (typeof e == "string") {
888
912
  if (this.reconstructor) throw Error("got plaintext data when reconstructing a packet");
889
- W = this.decodeString(h);
890
- let G = W.type === PacketType.BINARY_EVENT;
891
- G || W.type === PacketType.BINARY_ACK ? (W.type = G ? PacketType.EVENT : PacketType.ACK, this.reconstructor = new BinaryReconstructor(W), W.attachments === 0 && super.emitReserved("decoded", W)) : super.emitReserved("decoded", W);
892
- } else if (isBinary(h) || h.base64) if (this.reconstructor) W = this.reconstructor.takeBinaryData(h), W && (this.reconstructor = null, super.emitReserved("decoded", W));
913
+ t = this.decodeString(e);
914
+ let n = t.type === K.BINARY_EVENT;
915
+ n || t.type === K.BINARY_ACK ? (t.type = n ? K.EVENT : K.ACK, this.reconstructor = new We(t), t.attachments === 0 && super.emitReserved("decoded", t)) : super.emitReserved("decoded", t);
916
+ } else if (H(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
893
917
  else throw Error("got binary data when not reconstructing a packet");
894
- else throw Error("Unknown type: " + h);
895
- }
896
- decodeString(W) {
897
- let G = 0, K = { type: Number(W.charAt(0)) };
898
- if (PacketType[K.type] === void 0) throw Error("unknown packet type " + K.type);
899
- if (K.type === PacketType.BINARY_EVENT || K.type === PacketType.BINARY_ACK) {
900
- let h = G + 1;
901
- for (; W.charAt(++G) !== "-" && G != W.length;);
902
- let q = W.substring(h, G);
903
- if (q != Number(q) || W.charAt(G) !== "-") throw Error("Illegal attachments");
904
- K.attachments = Number(q);
918
+ else throw Error("Unknown type: " + e);
919
+ }
920
+ decodeString(t) {
921
+ let n = 0, r = { type: Number(t.charAt(0)) };
922
+ if (K[r.type] === void 0) throw Error("unknown packet type " + r.type);
923
+ if (r.type === K.BINARY_EVENT || r.type === K.BINARY_ACK) {
924
+ let e = n + 1;
925
+ for (; t.charAt(++n) !== "-" && n != t.length;);
926
+ let i = t.substring(e, n);
927
+ if (i != Number(i) || t.charAt(n) !== "-") throw Error("Illegal attachments");
928
+ r.attachments = Number(i);
905
929
  }
906
- if (W.charAt(G + 1) === "/") {
907
- let h = G + 1;
908
- for (; ++G && !(W.charAt(G) === "," || G === W.length););
909
- K.nsp = W.substring(h, G);
910
- } else K.nsp = "/";
911
- let q = W.charAt(G + 1);
912
- if (q !== "" && Number(q) == q) {
913
- let h = G + 1;
914
- for (; ++G;) {
915
- let h = W.charAt(G);
916
- if (h == null || Number(h) != h) {
917
- --G;
930
+ if (t.charAt(n + 1) === "/") {
931
+ let e = n + 1;
932
+ for (; ++n && !(t.charAt(n) === "," || n === t.length););
933
+ r.nsp = t.substring(e, n);
934
+ } else r.nsp = "/";
935
+ let i = t.charAt(n + 1);
936
+ if (i !== "" && Number(i) == i) {
937
+ let e = n + 1;
938
+ for (; ++n;) {
939
+ let e = t.charAt(n);
940
+ if (e == null || Number(e) != e) {
941
+ --n;
918
942
  break;
919
943
  }
920
- if (G === W.length) break;
944
+ if (n === t.length) break;
921
945
  }
922
- K.id = Number(W.substring(h, G + 1));
946
+ r.id = Number(t.substring(e, n + 1));
923
947
  }
924
- if (W.charAt(++G)) {
925
- let q = this.tryParse(W.substr(G));
926
- if (h.isPayloadValid(K.type, q)) K.data = q;
948
+ if (t.charAt(++n)) {
949
+ let i = this.tryParse(t.substr(n));
950
+ if (e.isPayloadValid(r.type, i)) r.data = i;
927
951
  else throw Error("invalid payload");
928
952
  }
929
- return K;
953
+ return r;
930
954
  }
931
- tryParse(h) {
955
+ tryParse(e) {
932
956
  try {
933
- return JSON.parse(h, this.reviver);
957
+ return JSON.parse(e, this.reviver);
934
958
  } catch {
935
959
  return !1;
936
960
  }
937
961
  }
938
- static isPayloadValid(h, W) {
939
- switch (h) {
940
- case PacketType.CONNECT: return isObject(W);
941
- case PacketType.DISCONNECT: return W === void 0;
942
- case PacketType.CONNECT_ERROR: return typeof W == "string" || isObject(W);
943
- case PacketType.EVENT:
944
- case PacketType.BINARY_EVENT: return Array.isArray(W) && (typeof W[0] == "number" || typeof W[0] == "string" && RESERVED_EVENTS$1.indexOf(W[0]) === -1);
945
- case PacketType.ACK:
946
- case PacketType.BINARY_ACK: return Array.isArray(W);
962
+ static isPayloadValid(e, t) {
963
+ switch (e) {
964
+ case K.CONNECT: return q(t);
965
+ case K.DISCONNECT: return t === void 0;
966
+ case K.CONNECT_ERROR: return typeof t == "string" || q(t);
967
+ case K.EVENT:
968
+ case K.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && Ve.indexOf(t[0]) === -1);
969
+ case K.ACK:
970
+ case K.BINARY_ACK: return Array.isArray(t);
947
971
  }
948
972
  }
949
973
  destroy() {
950
974
  this.reconstructor &&= (this.reconstructor.finishedReconstruction(), null);
951
975
  }
952
- }, BinaryReconstructor = class {
953
- constructor(h) {
954
- this.packet = h, this.buffers = [], this.reconPack = h;
976
+ }, We = class {
977
+ constructor(e) {
978
+ this.packet = e, this.buffers = [], this.reconPack = e;
955
979
  }
956
- takeBinaryData(h) {
957
- if (this.buffers.push(h), this.buffers.length === this.reconPack.attachments) {
958
- let h = reconstructPacket(this.reconPack, this.buffers);
959
- return this.finishedReconstruction(), h;
980
+ takeBinaryData(e) {
981
+ if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
982
+ let e = ze(this.reconPack, this.buffers);
983
+ return this.finishedReconstruction(), e;
960
984
  }
961
985
  return null;
962
986
  }
@@ -964,33 +988,37 @@ var Decoder = class h extends Emitter {
964
988
  this.reconPack = null, this.buffers = [];
965
989
  }
966
990
  };
967
- function on(h, W, G) {
968
- return h.on(W, G), function() {
969
- h.off(W, G);
991
+ //#endregion
992
+ //#region node_modules/socket.io-client/build/esm/on.js
993
+ function J(e, t, n) {
994
+ return e.on(t, n), function() {
995
+ e.off(t, n);
970
996
  };
971
997
  }
972
- var RESERVED_EVENTS = Object.freeze({
998
+ //#endregion
999
+ //#region node_modules/socket.io-client/build/esm/socket.js
1000
+ var Ge = Object.freeze({
973
1001
  connect: 1,
974
1002
  connect_error: 1,
975
1003
  disconnect: 1,
976
1004
  disconnecting: 1,
977
1005
  newListener: 1,
978
1006
  removeListener: 1
979
- }), Socket = class extends Emitter {
980
- constructor(h, W, G) {
981
- 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 = h, this.nsp = W, G && G.auth && (this.auth = G.auth), this._opts = Object.assign({}, G), this.io._autoConnect && this.open();
1007
+ }), Y = class extends w {
1008
+ constructor(e, t, n) {
1009
+ 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, n && n.auth && (this.auth = n.auth), this._opts = Object.assign({}, n), this.io._autoConnect && this.open();
982
1010
  }
983
1011
  get disconnected() {
984
1012
  return !this.connected;
985
1013
  }
986
1014
  subEvents() {
987
1015
  if (this.subs) return;
988
- let h = this.io;
1016
+ let e = this.io;
989
1017
  this.subs = [
990
- on(h, "open", this.onopen.bind(this)),
991
- on(h, "packet", this.onpacket.bind(this)),
992
- on(h, "error", this.onerror.bind(this)),
993
- on(h, "close", this.onclose.bind(this))
1018
+ J(e, "open", this.onopen.bind(this)),
1019
+ J(e, "packet", this.onpacket.bind(this)),
1020
+ J(e, "error", this.onerror.bind(this)),
1021
+ J(e, "close", this.onclose.bind(this))
994
1022
  ];
995
1023
  }
996
1024
  get active() {
@@ -1002,326 +1030,328 @@ var RESERVED_EVENTS = Object.freeze({
1002
1030
  open() {
1003
1031
  return this.connect();
1004
1032
  }
1005
- send(...h) {
1006
- return h.unshift("message"), this.emit.apply(this, h), this;
1033
+ send(...e) {
1034
+ return e.unshift("message"), this.emit.apply(this, e), this;
1007
1035
  }
1008
- emit(h, ...W) {
1009
- if (RESERVED_EVENTS.hasOwnProperty(h)) throw Error("\"" + h.toString() + "\" is a reserved event name");
1010
- if (W.unshift(h), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(W), this;
1011
- let G = {
1012
- type: PacketType.EVENT,
1013
- data: W
1036
+ emit(e, ...t) {
1037
+ if (Ge.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
1038
+ if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(t), this;
1039
+ let n = {
1040
+ type: K.EVENT,
1041
+ data: t
1014
1042
  };
1015
- if (G.options = {}, G.options.compress = this.flags.compress !== !1, typeof W[W.length - 1] == "function") {
1016
- let h = this.ids++, K = W.pop();
1017
- this._registerAckCallback(h, K), G.id = h;
1043
+ if (n.options = {}, n.options.compress = this.flags.compress !== !1, typeof t[t.length - 1] == "function") {
1044
+ let e = this.ids++, r = t.pop();
1045
+ this._registerAckCallback(e, r), n.id = e;
1018
1046
  }
1019
- let K = this.io.engine?.transport?.writable, q = this.connected && !this.io.engine?._hasPingExpired();
1020
- return this.flags.volatile && !K || (q ? (this.notifyOutgoingListeners(G), this.packet(G)) : this.sendBuffer.push(G)), this.flags = {}, this;
1047
+ let r = this.io.engine?.transport?.writable, i = this.connected && !this.io.engine?._hasPingExpired();
1048
+ return this.flags.volatile && !r || (i ? (this.notifyOutgoingListeners(n), this.packet(n)) : this.sendBuffer.push(n)), this.flags = {}, this;
1021
1049
  }
1022
- _registerAckCallback(h, W) {
1023
- let G = this.flags.timeout ?? this._opts.ackTimeout;
1024
- if (G === void 0) {
1025
- this.acks[h] = W;
1050
+ _registerAckCallback(e, t) {
1051
+ let n = this.flags.timeout ?? this._opts.ackTimeout;
1052
+ if (n === void 0) {
1053
+ this.acks[e] = t;
1026
1054
  return;
1027
1055
  }
1028
- let K = this.io.setTimeoutFn(() => {
1029
- delete this.acks[h];
1030
- for (let W = 0; W < this.sendBuffer.length; W++) this.sendBuffer[W].id === h && this.sendBuffer.splice(W, 1);
1031
- W.call(this, /* @__PURE__ */ Error("operation has timed out"));
1032
- }, G), q = (...h) => {
1033
- this.io.clearTimeoutFn(K), W.apply(this, h);
1056
+ let r = this.io.setTimeoutFn(() => {
1057
+ delete this.acks[e];
1058
+ for (let t = 0; t < this.sendBuffer.length; t++) this.sendBuffer[t].id === e && this.sendBuffer.splice(t, 1);
1059
+ t.call(this, /* @__PURE__ */ Error("operation has timed out"));
1060
+ }, n), i = (...e) => {
1061
+ this.io.clearTimeoutFn(r), t.apply(this, e);
1034
1062
  };
1035
- q.withError = !0, this.acks[h] = q;
1063
+ i.withError = !0, this.acks[e] = i;
1036
1064
  }
1037
- emitWithAck(h, ...W) {
1038
- return new Promise((G, K) => {
1039
- let q = (h, W) => h ? K(h) : G(W);
1040
- q.withError = !0, W.push(q), this.emit(h, ...W);
1065
+ emitWithAck(e, ...t) {
1066
+ return new Promise((n, r) => {
1067
+ let i = (e, t) => e ? r(e) : n(t);
1068
+ i.withError = !0, t.push(i), this.emit(e, ...t);
1041
1069
  });
1042
1070
  }
1043
- _addToQueue(h) {
1044
- let W;
1045
- typeof h[h.length - 1] == "function" && (W = h.pop());
1046
- let G = {
1071
+ _addToQueue(e) {
1072
+ let t;
1073
+ typeof e[e.length - 1] == "function" && (t = e.pop());
1074
+ let n = {
1047
1075
  id: this._queueSeq++,
1048
1076
  tryCount: 0,
1049
1077
  pending: !1,
1050
- args: h,
1078
+ args: e,
1051
1079
  flags: Object.assign({ fromQueue: !0 }, this.flags)
1052
1080
  };
1053
- h.push((h, ...K) => {
1054
- if (G === this._queue[0]) return h === null ? (this._queue.shift(), W && W(null, ...K)) : G.tryCount > this._opts.retries && (this._queue.shift(), W && W(h)), G.pending = !1, this._drainQueue();
1055
- }), this._queue.push(G), this._drainQueue();
1081
+ e.push((e, ...r) => (this._queue[0], e === null ? (this._queue.shift(), t && t(null, ...r)) : n.tryCount > this._opts.retries && (this._queue.shift(), t && t(e)), n.pending = !1, this._drainQueue())), this._queue.push(n), this._drainQueue();
1056
1082
  }
1057
- _drainQueue(h = !1) {
1083
+ _drainQueue(e = !1) {
1058
1084
  if (!this.connected || this._queue.length === 0) return;
1059
- let W = this._queue[0];
1060
- W.pending && !h || (W.pending = !0, W.tryCount++, this.flags = W.flags, this.emit.apply(this, W.args));
1085
+ let t = this._queue[0];
1086
+ t.pending && !e || (t.pending = !0, t.tryCount++, this.flags = t.flags, this.emit.apply(this, t.args));
1061
1087
  }
1062
- packet(h) {
1063
- h.nsp = this.nsp, this.io._packet(h);
1088
+ packet(e) {
1089
+ e.nsp = this.nsp, this.io._packet(e);
1064
1090
  }
1065
1091
  onopen() {
1066
- typeof this.auth == "function" ? this.auth((h) => {
1067
- this._sendConnectPacket(h);
1092
+ typeof this.auth == "function" ? this.auth((e) => {
1093
+ this._sendConnectPacket(e);
1068
1094
  }) : this._sendConnectPacket(this.auth);
1069
1095
  }
1070
- _sendConnectPacket(h) {
1096
+ _sendConnectPacket(e) {
1071
1097
  this.packet({
1072
- type: PacketType.CONNECT,
1098
+ type: K.CONNECT,
1073
1099
  data: this._pid ? Object.assign({
1074
1100
  pid: this._pid,
1075
1101
  offset: this._lastOffset
1076
- }, h) : h
1102
+ }, e) : e
1077
1103
  });
1078
1104
  }
1079
- onerror(h) {
1080
- this.connected || this.emitReserved("connect_error", h);
1105
+ onerror(e) {
1106
+ this.connected || this.emitReserved("connect_error", e);
1081
1107
  }
1082
- onclose(h, W) {
1083
- this.connected = !1, delete this.id, this.emitReserved("disconnect", h, W), this._clearAcks();
1108
+ onclose(e, t) {
1109
+ this.connected = !1, delete this.id, this.emitReserved("disconnect", e, t), this._clearAcks();
1084
1110
  }
1085
1111
  _clearAcks() {
1086
- Object.keys(this.acks).forEach((h) => {
1087
- if (!this.sendBuffer.some((W) => String(W.id) === h)) {
1088
- let W = this.acks[h];
1089
- delete this.acks[h], W.withError && W.call(this, /* @__PURE__ */ Error("socket has been disconnected"));
1112
+ Object.keys(this.acks).forEach((e) => {
1113
+ if (!this.sendBuffer.some((t) => String(t.id) === e)) {
1114
+ let t = this.acks[e];
1115
+ delete this.acks[e], t.withError && t.call(this, /* @__PURE__ */ Error("socket has been disconnected"));
1090
1116
  }
1091
1117
  });
1092
1118
  }
1093
- onpacket(h) {
1094
- if (h.nsp === this.nsp) switch (h.type) {
1095
- case PacketType.CONNECT:
1096
- h.data && h.data.sid ? this.onconnect(h.data.sid, h.data.pid) : this.emitReserved("connect_error", /* @__PURE__ */ 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/)"));
1119
+ onpacket(e) {
1120
+ if (e.nsp === this.nsp) switch (e.type) {
1121
+ case K.CONNECT:
1122
+ e.data && e.data.sid ? this.onconnect(e.data.sid, e.data.pid) : this.emitReserved("connect_error", /* @__PURE__ */ 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/)"));
1097
1123
  break;
1098
- case PacketType.EVENT:
1099
- case PacketType.BINARY_EVENT:
1100
- this.onevent(h);
1124
+ case K.EVENT:
1125
+ case K.BINARY_EVENT:
1126
+ this.onevent(e);
1101
1127
  break;
1102
- case PacketType.ACK:
1103
- case PacketType.BINARY_ACK:
1104
- this.onack(h);
1128
+ case K.ACK:
1129
+ case K.BINARY_ACK:
1130
+ this.onack(e);
1105
1131
  break;
1106
- case PacketType.DISCONNECT:
1132
+ case K.DISCONNECT:
1107
1133
  this.ondisconnect();
1108
1134
  break;
1109
- case PacketType.CONNECT_ERROR:
1135
+ case K.CONNECT_ERROR:
1110
1136
  this.destroy();
1111
- let W = Error(h.data.message);
1112
- W.data = h.data.data, this.emitReserved("connect_error", W);
1137
+ let t = Error(e.data.message);
1138
+ t.data = e.data.data, this.emitReserved("connect_error", t);
1113
1139
  break;
1114
1140
  }
1115
1141
  }
1116
- onevent(h) {
1117
- let W = h.data || [];
1118
- h.id != null && W.push(this.ack(h.id)), this.connected ? this.emitEvent(W) : this.receiveBuffer.push(Object.freeze(W));
1142
+ onevent(e) {
1143
+ let t = e.data || [];
1144
+ e.id != null && t.push(this.ack(e.id)), this.connected ? this.emitEvent(t) : this.receiveBuffer.push(Object.freeze(t));
1119
1145
  }
1120
- emitEvent(h) {
1146
+ emitEvent(e) {
1121
1147
  if (this._anyListeners && this._anyListeners.length) {
1122
- let W = this._anyListeners.slice();
1123
- for (let G of W) G.apply(this, h);
1148
+ let t = this._anyListeners.slice();
1149
+ for (let n of t) n.apply(this, e);
1124
1150
  }
1125
- super.emit.apply(this, h), this._pid && h.length && typeof h[h.length - 1] == "string" && (this._lastOffset = h[h.length - 1]);
1126
- }
1127
- ack(h) {
1128
- let W = this, G = !1;
1129
- return function(...K) {
1130
- G || (G = !0, W.packet({
1131
- type: PacketType.ACK,
1132
- id: h,
1133
- data: K
1151
+ super.emit.apply(this, e), this._pid && e.length && typeof e[e.length - 1] == "string" && (this._lastOffset = e[e.length - 1]);
1152
+ }
1153
+ ack(e) {
1154
+ let t = this, n = !1;
1155
+ return function(...r) {
1156
+ n || (n = !0, t.packet({
1157
+ type: K.ACK,
1158
+ id: e,
1159
+ data: r
1134
1160
  }));
1135
1161
  };
1136
1162
  }
1137
- onack(h) {
1138
- let W = this.acks[h.id];
1139
- typeof W == "function" && (delete this.acks[h.id], W.withError && h.data.unshift(null), W.apply(this, h.data));
1163
+ onack(e) {
1164
+ let t = this.acks[e.id];
1165
+ typeof t == "function" && (delete this.acks[e.id], t.withError && e.data.unshift(null), t.apply(this, e.data));
1140
1166
  }
1141
- onconnect(h, W) {
1142
- this.id = h, this.recovered = W && this._pid === W, this._pid = W, this.connected = !0, this.emitBuffered(), this.emitReserved("connect"), this._drainQueue(!0);
1167
+ onconnect(e, t) {
1168
+ this.id = e, this.recovered = t && this._pid === t, this._pid = t, this.connected = !0, this.emitBuffered(), this._drainQueue(!0), this.emitReserved("connect");
1143
1169
  }
1144
1170
  emitBuffered() {
1145
- this.receiveBuffer.forEach((h) => this.emitEvent(h)), this.receiveBuffer = [], this.sendBuffer.forEach((h) => {
1146
- this.notifyOutgoingListeners(h), this.packet(h);
1171
+ this.receiveBuffer.forEach((e) => this.emitEvent(e)), this.receiveBuffer = [], this.sendBuffer.forEach((e) => {
1172
+ this.notifyOutgoingListeners(e), this.packet(e);
1147
1173
  }), this.sendBuffer = [];
1148
1174
  }
1149
1175
  ondisconnect() {
1150
1176
  this.destroy(), this.onclose("io server disconnect");
1151
1177
  }
1152
1178
  destroy() {
1153
- this.subs &&= (this.subs.forEach((h) => h()), void 0), this.io._destroy(this);
1179
+ this.subs &&= (this.subs.forEach((e) => e()), void 0), this.io._destroy(this);
1154
1180
  }
1155
1181
  disconnect() {
1156
- return this.connected && this.packet({ type: PacketType.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
1182
+ return this.connected && this.packet({ type: K.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
1157
1183
  }
1158
1184
  close() {
1159
1185
  return this.disconnect();
1160
1186
  }
1161
- compress(h) {
1162
- return this.flags.compress = h, this;
1187
+ compress(e) {
1188
+ return this.flags.compress = e, this;
1163
1189
  }
1164
1190
  get volatile() {
1165
1191
  return this.flags.volatile = !0, this;
1166
1192
  }
1167
- timeout(h) {
1168
- return this.flags.timeout = h, this;
1193
+ timeout(e) {
1194
+ return this.flags.timeout = e, this;
1169
1195
  }
1170
- onAny(h) {
1171
- return this._anyListeners = this._anyListeners || [], this._anyListeners.push(h), this;
1196
+ onAny(e) {
1197
+ return this._anyListeners = this._anyListeners || [], this._anyListeners.push(e), this;
1172
1198
  }
1173
- prependAny(h) {
1174
- return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(h), this;
1199
+ prependAny(e) {
1200
+ return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(e), this;
1175
1201
  }
1176
- offAny(h) {
1202
+ offAny(e) {
1177
1203
  if (!this._anyListeners) return this;
1178
- if (h) {
1179
- let W = this._anyListeners;
1180
- for (let G = 0; G < W.length; G++) if (h === W[G]) return W.splice(G, 1), this;
1204
+ if (e) {
1205
+ let t = this._anyListeners;
1206
+ for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
1181
1207
  } else this._anyListeners = [];
1182
1208
  return this;
1183
1209
  }
1184
1210
  listenersAny() {
1185
1211
  return this._anyListeners || [];
1186
1212
  }
1187
- onAnyOutgoing(h) {
1188
- return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(h), this;
1213
+ onAnyOutgoing(e) {
1214
+ return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(e), this;
1189
1215
  }
1190
- prependAnyOutgoing(h) {
1191
- return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(h), this;
1216
+ prependAnyOutgoing(e) {
1217
+ return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(e), this;
1192
1218
  }
1193
- offAnyOutgoing(h) {
1219
+ offAnyOutgoing(e) {
1194
1220
  if (!this._anyOutgoingListeners) return this;
1195
- if (h) {
1196
- let W = this._anyOutgoingListeners;
1197
- for (let G = 0; G < W.length; G++) if (h === W[G]) return W.splice(G, 1), this;
1221
+ if (e) {
1222
+ let t = this._anyOutgoingListeners;
1223
+ for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
1198
1224
  } else this._anyOutgoingListeners = [];
1199
1225
  return this;
1200
1226
  }
1201
1227
  listenersAnyOutgoing() {
1202
1228
  return this._anyOutgoingListeners || [];
1203
1229
  }
1204
- notifyOutgoingListeners(h) {
1230
+ notifyOutgoingListeners(e) {
1205
1231
  if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
1206
- let W = this._anyOutgoingListeners.slice();
1207
- for (let G of W) G.apply(this, h.data);
1232
+ let t = this._anyOutgoingListeners.slice();
1233
+ for (let n of t) n.apply(this, e.data);
1208
1234
  }
1209
1235
  }
1210
1236
  };
1211
- function Backoff(h) {
1212
- h ||= {}, this.ms = h.min || 100, this.max = h.max || 1e4, this.factor = h.factor || 2, this.jitter = h.jitter > 0 && h.jitter <= 1 ? h.jitter : 0, this.attempts = 0;
1237
+ //#endregion
1238
+ //#region node_modules/socket.io-client/build/esm/contrib/backo2.js
1239
+ function X(e) {
1240
+ e ||= {}, this.ms = e.min || 100, this.max = e.max || 1e4, this.factor = e.factor || 2, this.jitter = e.jitter > 0 && e.jitter <= 1 ? e.jitter : 0, this.attempts = 0;
1213
1241
  }
1214
- Backoff.prototype.duration = function() {
1215
- var h = this.ms * this.factor ** + this.attempts++;
1242
+ X.prototype.duration = function() {
1243
+ var e = this.ms * this.factor ** +this.attempts++;
1216
1244
  if (this.jitter) {
1217
- var W = Math.random(), G = Math.floor(W * this.jitter * h);
1218
- h = Math.floor(W * 10) & 1 ? h + G : h - G;
1245
+ var t = Math.random(), n = Math.floor(t * this.jitter * e);
1246
+ e = Math.floor(t * 10) & 1 ? e + n : e - n;
1219
1247
  }
1220
- return Math.min(h, this.max) | 0;
1221
- }, Backoff.prototype.reset = function() {
1248
+ return Math.min(e, this.max) | 0;
1249
+ }, X.prototype.reset = function() {
1222
1250
  this.attempts = 0;
1223
- }, Backoff.prototype.setMin = function(h) {
1224
- this.ms = h;
1225
- }, Backoff.prototype.setMax = function(h) {
1226
- this.max = h;
1227
- }, Backoff.prototype.setJitter = function(h) {
1228
- this.jitter = h;
1251
+ }, X.prototype.setMin = function(e) {
1252
+ this.ms = e;
1253
+ }, X.prototype.setMax = function(e) {
1254
+ this.max = e;
1255
+ }, X.prototype.setJitter = function(e) {
1256
+ this.jitter = e;
1229
1257
  };
1230
- var Manager = class extends Emitter {
1231
- constructor(h, W) {
1232
- super(), this.nsps = {}, this.subs = [], h && typeof h == "object" && (W = h, h = void 0), W ||= {}, W.path = W.path || "/socket.io", this.opts = W, installTimerFunctions(this, W), this.reconnection(W.reconnection !== !1), this.reconnectionAttempts(W.reconnectionAttempts || Infinity), this.reconnectionDelay(W.reconnectionDelay || 1e3), this.reconnectionDelayMax(W.reconnectionDelayMax || 5e3), this.randomizationFactor(W.randomizationFactor ?? .5), this.backoff = new Backoff({
1258
+ //#endregion
1259
+ //#region node_modules/socket.io-client/build/esm/manager.js
1260
+ var Z = class extends w {
1261
+ constructor(e, t) {
1262
+ super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, O(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new X({
1233
1263
  min: this.reconnectionDelay(),
1234
1264
  max: this.reconnectionDelayMax(),
1235
1265
  jitter: this.randomizationFactor()
1236
- }), this.timeout(W.timeout == null ? 2e4 : W.timeout), this._readyState = "closed", this.uri = h;
1237
- let G = W.parser || esm_exports;
1238
- this.encoder = new G.Encoder(), this.decoder = new G.Decoder(), this._autoConnect = W.autoConnect !== !1, this._autoConnect && this.open();
1266
+ }), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
1267
+ let n = t.parser || Be;
1268
+ this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
1239
1269
  }
1240
- reconnection(h) {
1241
- return arguments.length ? (this._reconnection = !!h, h || (this.skipReconnect = !0), this) : this._reconnection;
1270
+ reconnection(e) {
1271
+ return arguments.length ? (this._reconnection = !!e, e || (this.skipReconnect = !0), this) : this._reconnection;
1242
1272
  }
1243
- reconnectionAttempts(h) {
1244
- return h === void 0 ? this._reconnectionAttempts : (this._reconnectionAttempts = h, this);
1273
+ reconnectionAttempts(e) {
1274
+ return e === void 0 ? this._reconnectionAttempts : (this._reconnectionAttempts = e, this);
1245
1275
  }
1246
- reconnectionDelay(h) {
1247
- var W;
1248
- return h === void 0 ? this._reconnectionDelay : (this._reconnectionDelay = h, (W = this.backoff) == null || W.setMin(h), this);
1276
+ reconnectionDelay(e) {
1277
+ var t;
1278
+ return e === void 0 ? this._reconnectionDelay : (this._reconnectionDelay = e, (t = this.backoff) == null || t.setMin(e), this);
1249
1279
  }
1250
- randomizationFactor(h) {
1251
- var W;
1252
- return h === void 0 ? this._randomizationFactor : (this._randomizationFactor = h, (W = this.backoff) == null || W.setJitter(h), this);
1280
+ randomizationFactor(e) {
1281
+ var t;
1282
+ return e === void 0 ? this._randomizationFactor : (this._randomizationFactor = e, (t = this.backoff) == null || t.setJitter(e), this);
1253
1283
  }
1254
- reconnectionDelayMax(h) {
1255
- var W;
1256
- return h === void 0 ? this._reconnectionDelayMax : (this._reconnectionDelayMax = h, (W = this.backoff) == null || W.setMax(h), this);
1284
+ reconnectionDelayMax(e) {
1285
+ var t;
1286
+ return e === void 0 ? this._reconnectionDelayMax : (this._reconnectionDelayMax = e, (t = this.backoff) == null || t.setMax(e), this);
1257
1287
  }
1258
- timeout(h) {
1259
- return arguments.length ? (this._timeout = h, this) : this._timeout;
1288
+ timeout(e) {
1289
+ return arguments.length ? (this._timeout = e, this) : this._timeout;
1260
1290
  }
1261
1291
  maybeReconnectOnOpen() {
1262
1292
  !this._reconnecting && this._reconnection && this.backoff.attempts === 0 && this.reconnect();
1263
1293
  }
1264
- open(h) {
1294
+ open(e) {
1265
1295
  if (~this._readyState.indexOf("open")) return this;
1266
- this.engine = new Socket$1(this.uri, this.opts);
1267
- let W = this.engine, G = this;
1296
+ this.engine = new B(this.uri, this.opts);
1297
+ let t = this.engine, n = this;
1268
1298
  this._readyState = "opening", this.skipReconnect = !1;
1269
- let K = on(W, "open", function() {
1270
- G.onopen(), h && h();
1271
- }), q = (W) => {
1272
- this.cleanup(), this._readyState = "closed", this.emitReserved("error", W), h ? h(W) : this.maybeReconnectOnOpen();
1273
- }, J = on(W, "error", q);
1299
+ let r = J(t, "open", function() {
1300
+ n.onopen(), e && e();
1301
+ }), i = (t) => {
1302
+ this.cleanup(), this._readyState = "closed", this.emitReserved("error", t), e ? e(t) : this.maybeReconnectOnOpen();
1303
+ }, a = J(t, "error", i);
1274
1304
  if (!1 !== this._timeout) {
1275
- let h = this._timeout, G = this.setTimeoutFn(() => {
1276
- K(), q(/* @__PURE__ */ Error("timeout")), W.close();
1277
- }, h);
1278
- this.opts.autoUnref && G.unref(), this.subs.push(() => {
1279
- this.clearTimeoutFn(G);
1305
+ let e = this._timeout, n = this.setTimeoutFn(() => {
1306
+ r(), i(/* @__PURE__ */ Error("timeout")), t.close();
1307
+ }, e);
1308
+ this.opts.autoUnref && n.unref(), this.subs.push(() => {
1309
+ this.clearTimeoutFn(n);
1280
1310
  });
1281
1311
  }
1282
- return this.subs.push(K), this.subs.push(J), this;
1312
+ return this.subs.push(r), this.subs.push(a), this;
1283
1313
  }
1284
- connect(h) {
1285
- return this.open(h);
1314
+ connect(e) {
1315
+ return this.open(e);
1286
1316
  }
1287
1317
  onopen() {
1288
1318
  this.cleanup(), this._readyState = "open", this.emitReserved("open");
1289
- let h = this.engine;
1290
- this.subs.push(on(h, "ping", this.onping.bind(this)), on(h, "data", this.ondata.bind(this)), on(h, "error", this.onerror.bind(this)), on(h, "close", this.onclose.bind(this)), on(this.decoder, "decoded", this.ondecoded.bind(this)));
1319
+ let e = this.engine;
1320
+ this.subs.push(J(e, "ping", this.onping.bind(this)), J(e, "data", this.ondata.bind(this)), J(e, "error", this.onerror.bind(this)), J(e, "close", this.onclose.bind(this)), J(this.decoder, "decoded", this.ondecoded.bind(this)));
1291
1321
  }
1292
1322
  onping() {
1293
1323
  this.emitReserved("ping");
1294
1324
  }
1295
- ondata(h) {
1325
+ ondata(e) {
1296
1326
  try {
1297
- this.decoder.add(h);
1298
- } catch (h) {
1299
- this.onclose("parse error", h);
1327
+ this.decoder.add(e);
1328
+ } catch (e) {
1329
+ this.onclose("parse error", e);
1300
1330
  }
1301
1331
  }
1302
- ondecoded(h) {
1303
- nextTick(() => {
1304
- this.emitReserved("packet", h);
1332
+ ondecoded(e) {
1333
+ T(() => {
1334
+ this.emitReserved("packet", e);
1305
1335
  }, this.setTimeoutFn);
1306
1336
  }
1307
- onerror(h) {
1308
- this.emitReserved("error", h);
1337
+ onerror(e) {
1338
+ this.emitReserved("error", e);
1309
1339
  }
1310
- socket(h, W) {
1311
- let G = this.nsps[h];
1312
- return G ? this._autoConnect && !G.active && G.connect() : (G = new Socket(this, h, W), this.nsps[h] = G), G;
1340
+ socket(e, t) {
1341
+ let n = this.nsps[e];
1342
+ return n ? this._autoConnect && !n.active && n.connect() : (n = new Y(this, e, t), this.nsps[e] = n), n;
1313
1343
  }
1314
- _destroy(h) {
1315
- let W = Object.keys(this.nsps);
1316
- for (let h of W) if (this.nsps[h].active) return;
1344
+ _destroy(e) {
1345
+ let t = Object.keys(this.nsps);
1346
+ for (let e of t) if (this.nsps[e].active) return;
1317
1347
  this._close();
1318
1348
  }
1319
- _packet(h) {
1320
- let W = this.encoder.encode(h);
1321
- for (let G = 0; G < W.length; G++) this.engine.write(W[G], h.options);
1349
+ _packet(e) {
1350
+ let t = this.encoder.encode(e);
1351
+ for (let n = 0; n < t.length; n++) this.engine.write(t[n], e.options);
1322
1352
  }
1323
1353
  cleanup() {
1324
- this.subs.forEach((h) => h()), this.subs.length = 0, this.decoder.destroy();
1354
+ this.subs.forEach((e) => e()), this.subs.length = 0, this.decoder.destroy();
1325
1355
  }
1326
1356
  _close() {
1327
1357
  this.skipReconnect = !0, this._reconnecting = !1, this.onclose("forced close");
@@ -1329,55 +1359,59 @@ var Manager = class extends Emitter {
1329
1359
  disconnect() {
1330
1360
  return this._close();
1331
1361
  }
1332
- onclose(h, W) {
1333
- var G;
1334
- this.cleanup(), (G = this.engine) == null || G.close(), this.backoff.reset(), this._readyState = "closed", this.emitReserved("close", h, W), this._reconnection && !this.skipReconnect && this.reconnect();
1362
+ onclose(e, t) {
1363
+ var n;
1364
+ this.cleanup(), (n = this.engine) == null || n.close(), this.backoff.reset(), this._readyState = "closed", this.emitReserved("close", e, t), this._reconnection && !this.skipReconnect && this.reconnect();
1335
1365
  }
1336
1366
  reconnect() {
1337
1367
  if (this._reconnecting || this.skipReconnect) return this;
1338
- let h = this;
1368
+ let e = this;
1339
1369
  if (this.backoff.attempts >= this._reconnectionAttempts) this.backoff.reset(), this.emitReserved("reconnect_failed"), this._reconnecting = !1;
1340
1370
  else {
1341
- let W = this.backoff.duration();
1371
+ let t = this.backoff.duration();
1342
1372
  this._reconnecting = !0;
1343
- let G = this.setTimeoutFn(() => {
1344
- h.skipReconnect || (this.emitReserved("reconnect_attempt", h.backoff.attempts), !h.skipReconnect && h.open((W) => {
1345
- W ? (h._reconnecting = !1, h.reconnect(), this.emitReserved("reconnect_error", W)) : h.onreconnect();
1373
+ let n = this.setTimeoutFn(() => {
1374
+ e.skipReconnect || (this.emitReserved("reconnect_attempt", e.backoff.attempts), !e.skipReconnect && e.open((t) => {
1375
+ t ? (e._reconnecting = !1, e.reconnect(), this.emitReserved("reconnect_error", t)) : e.onreconnect();
1346
1376
  }));
1347
- }, W);
1348
- this.opts.autoUnref && G.unref(), this.subs.push(() => {
1349
- this.clearTimeoutFn(G);
1377
+ }, t);
1378
+ this.opts.autoUnref && n.unref(), this.subs.push(() => {
1379
+ this.clearTimeoutFn(n);
1350
1380
  });
1351
1381
  }
1352
1382
  }
1353
1383
  onreconnect() {
1354
- let h = this.backoff.attempts;
1355
- this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", h);
1356
- }
1357
- }, cache = {};
1358
- function lookup(h, W) {
1359
- typeof h == "object" && (W = h, h = void 0), W ||= {};
1360
- let G = url(h, W.path || "/socket.io"), K = G.source, q = G.id, J = G.path, Y = cache[q] && J in cache[q].nsps, X = W.forceNew || W["force new connection"] || !1 === W.multiplex || Y, Z;
1361
- return X ? Z = new Manager(K, W) : (cache[q] || (cache[q] = new Manager(K, W)), Z = cache[q]), G.query && !W.query && (W.query = G.queryKey), Z.socket(G.path, W);
1384
+ let e = this.backoff.attempts;
1385
+ this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", e);
1386
+ }
1387
+ }, Q = {};
1388
+ function $(e, t) {
1389
+ typeof e == "object" && (t = e, e = void 0), t ||= {};
1390
+ let n = Ne(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = Q[i] && a in Q[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
1391
+ return s ? c = new Z(r, t) : (Q[i] || (Q[i] = new Z(r, t)), c = Q[i]), n.query && !t.query && (t.query = n.queryKey), c.socket(n.path, t);
1362
1392
  }
1363
- Object.assign(lookup, {
1364
- Manager,
1365
- Socket,
1366
- io: lookup,
1367
- connect: lookup
1393
+ Object.assign($, {
1394
+ Manager: Z,
1395
+ Socket: Y,
1396
+ io: $,
1397
+ connect: $
1368
1398
  });
1369
- var SysBase = class h {
1370
- elc = new EventListenerCtn();
1399
+ //#endregion
1400
+ //#region src/sn/SysBase.ts
1401
+ var Ke = class e {
1402
+ hPlg;
1403
+ arg;
1404
+ elc = new a();
1371
1405
  hFactoryCls = {};
1372
- constructor(h = {}, W) {
1373
- this.hPlg = h, this.arg = W;
1406
+ constructor(e = {}, t) {
1407
+ this.hPlg = e, this.arg = t;
1374
1408
  }
1375
1409
  destroy() {
1376
1410
  this.elc.clear();
1377
1411
  }
1378
- async loaded(...[h]) {
1379
- let W = h.snsys_pre;
1380
- return delete h.snsys_pre, W?.init({
1412
+ async loaded(...[e]) {
1413
+ let t = e.snsys_pre;
1414
+ return delete e.snsys_pre, t?.init({
1381
1415
  getInfo: this.#n,
1382
1416
  addTag: () => {},
1383
1417
  addLayCls: () => {},
@@ -1385,51 +1419,51 @@ var SysBase = class h {
1385
1419
  getVal: () => ({}),
1386
1420
  resume: () => {},
1387
1421
  render: () => {},
1388
- setDec: (h) => {
1389
- this.dec = h;
1422
+ setDec: (e) => {
1423
+ this.dec = e;
1390
1424
  },
1391
- setDecAB: (h) => {
1392
- this.#_ = h;
1425
+ setDecAB: (e) => {
1426
+ this.#_ = e;
1393
1427
  },
1394
- setEnc: (h) => {
1395
- this.enc = h;
1428
+ setEnc: (e) => {
1429
+ this.enc = e;
1396
1430
  },
1397
- getStK: (h) => {
1398
- this.stk = h;
1431
+ getStK: (e) => {
1432
+ this.stk = e;
1399
1433
  },
1400
- getHash: (h) => {
1401
- this.hash = h;
1434
+ getHash: (e) => {
1435
+ this.hash = e;
1402
1436
  }
1403
1437
  });
1404
1438
  }
1405
1439
  main = void 0;
1406
1440
  cfg;
1407
- setMain(h, W) {
1408
- this.main = h, this.cfg = W;
1441
+ setMain(e, t) {
1442
+ this.main = e, this.cfg = t;
1409
1443
  }
1410
1444
  async run() {
1411
- let [{ Main: h }, { TxtLayer: W }, { GrpLayer: G }] = await Promise.all([
1445
+ let [{ Main: e }, { TxtLayer: t }, { GrpLayer: n }] = await Promise.all([
1412
1446
  import("./Main.js"),
1413
1447
  import("./TxtLayer.js"),
1414
1448
  import("./GrpLayer.js")
1415
1449
  ]);
1416
1450
  this.hFactoryCls = {
1417
- grp: () => new G(),
1418
- txt: () => new W()
1451
+ grp: () => new n(),
1452
+ txt: () => new t()
1419
1453
  }, this.run = async () => {
1420
- this.main?.destroy(), this.main = await h.generate(this);
1454
+ this.main?.destroy(), this.main = await e.generate(this);
1421
1455
  }, await this.run();
1422
1456
  }
1423
1457
  stop() {
1424
1458
  this.main?.destroy(), this.main = void 0;
1425
1459
  }
1426
- fetch = (h, W) => fetch(h, W);
1460
+ fetch = (e, t) => fetch(e, t);
1427
1461
  data = {
1428
- sys: creSYS_DATA(),
1462
+ sys: i(),
1429
1463
  mark: {},
1430
1464
  kidoku: {}
1431
1465
  };
1432
- async initVal(h, W) {}
1466
+ async initVal(e, t) {}
1433
1467
  flush() {
1434
1468
  if (this.#e) {
1435
1469
  this.#t = !0;
@@ -1443,28 +1477,28 @@ var SysBase = class h {
1443
1477
  #t = !1;
1444
1478
  flushSub() {}
1445
1479
  val;
1446
- init(h, W, G) {
1447
- let q = [];
1448
- this.val = G;
1449
- let J = "";
1450
- return q.push(G.init().then(() => {
1451
- J = "sys", J += String(G.getVal("sys:TextLayer.Back.Alpha", 1)), J = "kidoku", G.saveKidoku();
1452
- }).catch((h) => console.error(`セーブデータ(${J})が壊れています。一度クリアする必要があります(b) %o`, h))), h.close = (h) => this.close(h), h.export = (h) => this._export(h), h.import = (h) => this._import(h), h.navigate_to = (h) => this.navigate_to(h), h.title = (h) => this.title(h), h.toggle_full_screen = (h) => this.#h(h), h.update_check = (h) => this.update_check(h), h.window = (h) => this.window(h), h.title({ text: this.cfg.oCfg.book.title || "SKYNovel" }), G.defTmp("const.sn.isApp", () => this.isApp), G.defTmp("const.sn.isDbg", () => CmnLib.isDbg), G.defTmp("const.sn.isPackaged", () => CmnLib.isPackaged), G.defTmp("const.sn.needClick2Play", () => CmnLib.needClick2Play()), G.defTmp("const.sn.displayState", () => this.isFullScr), G.setVal_Nochk("sys", "const.sn.cfg.ns", this.cfg.oCfg.save_ns), G.flush(), CmnLib.isDbg && this.attach_debug(this.main), [...q, ...Object.values(this.hPlg).map((K) => K.init({
1480
+ init(e, t, n) {
1481
+ let i = [];
1482
+ this.val = n;
1483
+ let a = "";
1484
+ return i.push(n.init().then(() => {
1485
+ a = "sys", a += String(n.getVal("sys:TextLayer.Back.Alpha", 1)), a = "kidoku", n.saveKidoku();
1486
+ }).catch((e) => console.error(`セーブデータ(${a})が壊れています。一度クリアする必要があります(b) %o`, e))), e.close = (e) => this.close(e), e.export = (e) => this._export(e), e.import = (e) => this._import(e), e.navigate_to = (e) => this.navigate_to(e), e.title = (e) => this.title(e), e.toggle_full_screen = (e) => this.#h(e), e.update_check = (e) => this.update_check(e), e.window = (e) => this.window(e), e.title({ text: this.cfg.oCfg.book.title || "SKYNovel" }), n.defTmp("const.sn.isApp", () => this.isApp), n.defTmp("const.sn.isDbg", () => r.isDbg), n.defTmp("const.sn.isPackaged", () => r.isPackaged), n.defTmp("const.sn.needClick2Play", () => r.needClick2Play()), n.defTmp("const.sn.displayState", () => this.isFullScr), n.setVal_Nochk("sys", "const.sn.cfg.ns", this.cfg.oCfg.save_ns), n.flush(), r.isDbg && this.attach_debug(this.main), [...i, ...Object.values(this.hPlg).map((r) => r.init({
1453
1487
  getInfo: this.#n,
1454
- addTag: (W, G) => {
1455
- if (W in h) throw `すでに定義済みのタグ[${W}]です`;
1456
- h[W] = G;
1488
+ addTag: (t, n) => {
1489
+ if (t in e) throw `すでに定義済みのタグ[${t}]です`;
1490
+ e[t] = n;
1457
1491
  },
1458
- addLayCls: (h, W) => {
1459
- if (h in this.hFactoryCls) throw `すでに定義済みのレイヤcls【${h}】です`;
1460
- this.hFactoryCls[h] = W;
1492
+ addLayCls: (e, t) => {
1493
+ if (e in this.hFactoryCls) throw `すでに定義済みのレイヤcls【${e}】です`;
1494
+ this.hFactoryCls[e] = t;
1461
1495
  },
1462
- searchPath: (h, W = SEARCH_PATH_ARG_EXT.DEFAULT) => this.cfg.searchPath(h, W),
1463
- getVal: (h, W) => G.getVal(h, W),
1496
+ searchPath: (e, t = o.DEFAULT) => this.cfg.searchPath(e, t),
1497
+ getVal: (e, t) => n.getVal(e, t),
1464
1498
  resume: () => this.main?.resume(),
1465
- render: (h, G, K = !1) => W.renderer.render(h, {
1466
- ...G ? { renderTexture: G } : {},
1467
- clear: K
1499
+ render: (e, n, r = !1) => t.renderer.render(e, {
1500
+ ...n ? { renderTexture: n } : {},
1501
+ clear: r
1468
1502
  }),
1469
1503
  setDec: () => {},
1470
1504
  setDecAB: () => {},
@@ -1474,8 +1508,8 @@ var SysBase = class h {
1474
1508
  }))];
1475
1509
  }
1476
1510
  #n = () => ({ window: {
1477
- width: CmnLib.stageW,
1478
- height: CmnLib.stageH
1511
+ width: r.stageW,
1512
+ height: r.stageH
1479
1513
  } });
1480
1514
  #r = 0;
1481
1515
  #i = 0;
@@ -1508,37 +1542,37 @@ var SysBase = class h {
1508
1542
  isFullScr = !1;
1509
1543
  cvsResize() {
1510
1544
  if (!this.main) return;
1511
- let h = globalThis.innerWidth, W = globalThis.innerHeight, q = this.main.cvs, J = q.parentElement !== document.body;
1512
- if (J) {
1513
- let G = globalThis.getComputedStyle(q);
1514
- h = parseFloat(G.width), W = parseFloat(G.height);
1545
+ let e = globalThis.innerWidth, t = globalThis.innerHeight, i = this.main.cvs, a = i.parentElement !== document.body;
1546
+ if (a) {
1547
+ let n = globalThis.getComputedStyle(i);
1548
+ e = parseFloat(n.width), t = parseFloat(n.height);
1515
1549
  }
1516
- if (CmnLib.isMobile) {
1517
- let G = screen.orientation.angle % 180 == 0;
1518
- (G && h > W || !G && h < W) && ([h, W] = [W, h]);
1550
+ if (r.isMobile) {
1551
+ let n = screen.orientation.angle % 180 == 0;
1552
+ (n && e > t || !n && e < t) && ([e, t] = [t, e]);
1519
1553
  }
1520
- let Y = q.getBoundingClientRect();
1521
- if (argChk_Boolean(CmnLib.hDip, "expanding", !0) || J || CmnLib.stageW > h || CmnLib.stageH > W) if (CmnLib.stageW / CmnLib.stageH <= h / W ? (this.#i = W, this.#r = CmnLib.stageW / CmnLib.stageH * W) : (this.#r = h, this.#i = CmnLib.stageH / CmnLib.stageW * h), this.#a = this.#r / CmnLib.stageW, J) this.#c = 0, this.#l = 0;
1554
+ let o = i.getBoundingClientRect();
1555
+ if (n(r.hDip, "expanding", !0) || a || r.stageW > e || r.stageH > t) if (r.stageW / r.stageH <= e / t ? (this.#i = t, this.#r = r.stageW / r.stageH * t) : (this.#r = e, this.#i = r.stageH / r.stageW * e), this.#a = this.#r / r.stageW, a) this.#c = 0, this.#l = 0;
1522
1556
  else {
1523
- let G = 1 - this.#a;
1524
- CmnLib.isMobile ? (this.#c = (h - this.#r) / 2 * G, this.#l = (W - this.#i) / 2 * G) : (this.#c = Y.left * G, this.#l = Y.top * G);
1557
+ let n = 1 - this.#a;
1558
+ r.isMobile ? (this.#c = (e - this.#r) / 2 * n, this.#l = (t - this.#i) / 2 * n) : (this.#c = o.left * n, this.#l = o.top * n);
1525
1559
  }
1526
- else this.#r = CmnLib.stageW, this.#i = CmnLib.stageH, this.#a = 1, this.#c = 0, this.#l = 0;
1527
- let X = q.parentElement.style;
1528
- J || (X.position = "relative", X.width = `${String(this.#r)}px`, X.height = `${String(this.#i)}px`);
1529
- let Z = q.style;
1530
- Z.width = X.width, Z.height = X.height, J ? (this.#o = Y.left, this.#s = Y.top) : (this.#o = 0, this.#s = 0), this.isFullScr && (this.#o += (h - this.#r) / 2, this.#s += (W - this.#i) / 2);
1560
+ else this.#r = r.stageW, this.#i = r.stageH, this.#a = 1, this.#c = 0, this.#l = 0;
1561
+ let s = i.parentElement.style;
1562
+ a || (s.position = "relative", s.width = `${String(this.#r)}px`, s.height = `${String(this.#i)}px`);
1563
+ let c = i.style;
1564
+ c.width = s.width, c.height = s.height, a ? (this.#o = o.left, this.#s = o.top) : (this.#o = 0, this.#s = 0), this.isFullScr && (this.#o += (e - this.#r) / 2, this.#s += (t - this.#i) / 2);
1531
1565
  }
1532
- use4ViteElectron(h, W, G, K) {
1566
+ use4ViteElectron(e, t, n, r) {
1533
1567
  return !1;
1534
1568
  }
1535
- attach_debug(h) {
1569
+ attach_debug(e) {
1536
1570
  this.attach_debug = () => {};
1537
- let W = document.createElement("style");
1538
- W.innerHTML = "/* SKYNovel Dbg */\n.sn_BounceInOut { animation: sn_kfBounceInOut linear 1.5s; }\n@keyframes sn_kfBounceInOut{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n10% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n20% { transform: scaleX(0.95) scaleY(0.95);}\n30% { transform: scaleX(1.00) scaleY(1.00);}\n70% {opacity: 1;}\n100%{opacity: 0;}\n}\n.sn_BounceIn { animation: sn_kfBounceIn linear 0.3s; }\n@keyframes sn_kfBounceIn{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n50% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n100%{ transform: scaleX(0.95) scaleY(0.95);}\n}\n.sn_HopIn { animation: sn_kfHopIn linear 0.8s; }\n@keyframes sn_kfHopIn{\n0% {transform: translate(0px, 0px);}\n15% {transform: translate(0px, -25px);}\n30% {transform: translate(0px, 0px);}\n45% {transform: translate(0px, -15px);}\n60% {transform: translate(0px, 0px);}\n75% {transform: translate(0px, -5px);}\n100%{transform: translate(0px, 0px);}\n}", document.getElementsByTagName("head")[0].appendChild(W), this.addHook((h, W) => this.#d[h]?.(W)), this.#u = lookup(`http://localhost:${String(this.extPort)}`), this.#u.on("data", (h, W) => {
1539
- this.callHook(h, W);
1540
- }).on("disconnect", () => h.setLoop(!0)), this.callHook = (h, W) => {
1541
- for (let G of this.#p) G(h, W);
1571
+ let t = document.createElement("style");
1572
+ t.innerHTML = "/* SKYNovel Dbg */\n.sn_BounceInOut { animation: sn_kfBounceInOut linear 1.5s; }\n@keyframes sn_kfBounceInOut{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n10% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n20% { transform: scaleX(0.95) scaleY(0.95);}\n30% { transform: scaleX(1.00) scaleY(1.00);}\n70% {opacity: 1;}\n100%{opacity: 0;}\n}\n.sn_BounceIn { animation: sn_kfBounceIn linear 0.3s; }\n@keyframes sn_kfBounceIn{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n50% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n100%{ transform: scaleX(0.95) scaleY(0.95);}\n}\n.sn_HopIn { animation: sn_kfHopIn linear 0.8s; }\n@keyframes sn_kfHopIn{\n0% {transform: translate(0px, 0px);}\n15% {transform: translate(0px, -25px);}\n30% {transform: translate(0px, 0px);}\n45% {transform: translate(0px, -15px);}\n60% {transform: translate(0px, 0px);}\n75% {transform: translate(0px, -5px);}\n100%{transform: translate(0px, 0px);}\n}", document.getElementsByTagName("head")[0].appendChild(t), this.addHook((e, t) => this.#d[e]?.(t)), this.#u = $(`http://localhost:${String(this.extPort)}`), this.#u.on("data", (e, t) => {
1573
+ this.callHook(e, t);
1574
+ }).on("disconnect", () => e.setLoop(!0)), this.callHook = (e, t) => {
1575
+ for (let n of this.#p) n(e, t);
1542
1576
  };
1543
1577
  }
1544
1578
  extPort = 3776;
@@ -1547,8 +1581,8 @@ var SysBase = class h {
1547
1581
  }
1548
1582
  #u = void 0;
1549
1583
  #d = {
1550
- auth: (h) => {
1551
- if (h.t !== this.cfg.oCfg.debuger_token) {
1584
+ auth: (e) => {
1585
+ if (e.t !== this.cfg.oCfg.debuger_token) {
1552
1586
  this.end();
1553
1587
  return;
1554
1588
  }
@@ -1556,8 +1590,8 @@ var SysBase = class h {
1556
1590
  },
1557
1591
  continue: () => this.toast("再生"),
1558
1592
  disconnect: () => this.toast("切断"),
1559
- restart: (h) => {
1560
- this.send2Dbg(h?.ri ?? "", {}), this.end(), this.run();
1593
+ restart: (e) => {
1594
+ this.send2Dbg(e?.ri ?? "", {}), this.end(), this.run();
1561
1595
  },
1562
1596
  pause: () => this.toast("一時停止"),
1563
1597
  stopOnEntry: () => this.toast("一時停止"),
@@ -1567,22 +1601,22 @@ var SysBase = class h {
1567
1601
  stopOnStepIn: () => this.toast("ステップイン"),
1568
1602
  stopOnStepOut: () => this.toast("ステップアウト"),
1569
1603
  stopOnBackstep: () => this.toast("一歩戻る"),
1570
- _addPath: (h) => this.cfg.addPath(h.fn, h.o)
1604
+ _addPath: (e) => this.cfg.addPath(e.fn, e.o)
1571
1605
  };
1572
- toast(W) {
1606
+ toast(t) {
1573
1607
  if (!this.main) return;
1574
- let G = document.body;
1575
- for (let h of [...Array.from(G.getElementsByClassName("sn_BounceIn")), ...Array.from(G.getElementsByClassName("sn_HopIn"))]) h.remove();
1576
- let q = document.createElement("img"), J = h.#f[W];
1577
- if (!J) throw Error(`toast 名ミス=${W}`);
1578
- q.src = `data:image/svg+xml;base64,${J.dat}`;
1579
- let Y = Math.min(CmnLib.stageW, CmnLib.stageH) / 4 * this.#a;
1580
- q.width = q.height = Y, q.style.cssText = `position: absolute;
1581
- left: ${String((CmnLib.stageW - Y) / 2 * this.#a + Y * (J.dx ?? 0))}px;
1582
- top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.classList.add("sn_toast", J.ease ?? "sn_BounceInOut"), J.ease || q.addEventListener("animationend", () => G.removeChild(q), {
1608
+ let n = document.body;
1609
+ for (let e of [...Array.from(n.getElementsByClassName("sn_BounceIn")), ...Array.from(n.getElementsByClassName("sn_HopIn"))]) e.remove();
1610
+ let i = document.createElement("img"), a = e.#f[t];
1611
+ if (!a) throw Error(`toast 名ミス=${t}`);
1612
+ i.src = `data:image/svg+xml;base64,${a.dat}`;
1613
+ let o = Math.min(r.stageW, r.stageH) / 4 * this.#a;
1614
+ i.width = i.height = o, i.style.cssText = `position: absolute;
1615
+ left: ${String((r.stageW - o) / 2 * this.#a + o * (a.dx ?? 0))}px;
1616
+ top: ${String((r.stageH - o) / 2 * this.#a + o * (a.dy ?? 0))}px;`, i.classList.add("sn_toast", a.ease ?? "sn_BounceInOut"), a.ease || i.addEventListener("animationend", () => n.removeChild(i), {
1583
1617
  once: !0,
1584
1618
  passive: !0
1585
- }), G.insertBefore(q, this.main.cvs);
1619
+ }), n.insertBefore(i, this.main.cvs);
1586
1620
  }
1587
1621
  static #f = {
1588
1622
  接続: {
@@ -1615,100 +1649,100 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
1615
1649
  };
1616
1650
  pathBaseCnvSnPath4Dbg = "";
1617
1651
  fire;
1618
- setFire(h) {
1619
- this.fire = h;
1652
+ setFire(e) {
1653
+ this.fire = e;
1620
1654
  }
1621
1655
  #p = [];
1622
- addHook(h) {
1623
- this.#p.push(h);
1656
+ addHook(e) {
1657
+ this.#p.push(e);
1624
1658
  }
1625
- callHook = (h, W) => {};
1626
- send2Dbg = (h, W) => {
1627
- this.#u?.emit("data", h, W);
1659
+ callHook = (e, t) => {};
1660
+ send2Dbg = (e, t) => {
1661
+ this.#u?.emit("data", e, t);
1628
1662
  };
1629
- copyBMFolder = (h, W) => {};
1630
- eraseBMFolder = (h) => {};
1663
+ copyBMFolder = (e, t) => {};
1664
+ eraseBMFolder = (e) => {};
1631
1665
  close = () => !1;
1632
1666
  _export = () => !1;
1633
1667
  _import = () => !1;
1634
1668
  navigate_to = () => !1;
1635
- title = (h) => {
1636
- let { text: W } = h;
1637
- if (!W) throw "[title] textは必須です";
1638
- return this.#m = W, this.titleSub(this.#m + this.#g), !1;
1669
+ title = (e) => {
1670
+ let { text: t } = e;
1671
+ if (!t) throw "[title] textは必須です";
1672
+ return this.#m = t, this.titleSub(this.#m + this.#g), !1;
1639
1673
  };
1640
1674
  #m = "";
1641
- titleSub(h) {}
1642
- #h = (G) => {
1643
- if (!G.key) return this.tglFlscr_sub().catch((W) => h.tglFlscr_HdrErr(W)), !1;
1644
- let K = G.key.toLowerCase();
1645
- return this.elc.add(document, EVNM_KEY, (W) => {
1646
- h.modKey(W) + W.key.toLowerCase() === K && (W.stopPropagation(), this.tglFlscr_sub().catch((W) => h.tglFlscr_HdrErr(W)));
1675
+ titleSub(e) {}
1676
+ #h = (n) => {
1677
+ if (!n.key) return this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)), !1;
1678
+ let r = n.key.toLowerCase();
1679
+ return this.elc.add(document, t, (t) => {
1680
+ e.modKey(t) + t.key.toLowerCase() === r && (t.stopPropagation(), this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)));
1647
1681
  }, { passive: !0 }), !1;
1648
1682
  };
1649
- static tglFlscr_HdrErr(h) {
1650
- h instanceof TypeError && console.error("フルスクリーン化でエラーです。ブラウザ環境でキー入力きっかけでないと発生します"), console.error(`fn:SysBase.ts tglFlscr ${String(h)}`);
1683
+ static tglFlscr_HdrErr(e) {
1684
+ e instanceof TypeError && console.error("フルスクリーン化でエラーです。ブラウザ環境でキー入力きっかけでないと発生します"), console.error(`fn:SysBase.ts tglFlscr ${String(e)}`);
1651
1685
  }
1652
- static modKey(h) {
1653
- return (h.altKey ? h.key === "Alt" ? "" : "alt+" : "") + (h.ctrlKey ? h.key === "Control" ? "" : "ctrl+" : "") + (h.metaKey ? h.key === "Meta" ? "" : "meta+" : "") + (h.shiftKey ? h.key === "Shift" ? "" : "shift+" : "");
1686
+ static modKey(e) {
1687
+ return (e.altKey ? e.key === "Alt" ? "" : "alt+" : "") + (e.ctrlKey ? e.key === "Control" ? "" : "ctrl+" : "") + (e.metaKey ? e.key === "Meta" ? "" : "meta+" : "") + (e.shiftKey ? e.key === "Shift" ? "" : "shift+" : "");
1654
1688
  }
1655
1689
  async tglFlscr_sub() {}
1656
1690
  update_check = () => !1;
1657
1691
  window = () => !1;
1658
1692
  #g = "";
1659
- setTitleInfo(h) {
1660
- this.#g = h, this.titleSub(this.#m + this.#g);
1693
+ setTitleInfo(e) {
1694
+ this.#g = e, this.titleSub(this.#m + this.#g);
1661
1695
  }
1662
1696
  #_ = () => Promise.resolve({
1663
1697
  ext_num: 0,
1664
1698
  ab: /* @__PURE__ */ new ArrayBuffer(0)
1665
1699
  });
1666
- dec = (h, W) => Promise.resolve(W);
1667
- async decAB(h) {
1668
- let { ext_num: W, ab: G } = await this.#_(h), K = this.#v[W];
1669
- return K?.fnc ? await K.fnc(G) : G;
1700
+ dec = (e, t) => Promise.resolve(t);
1701
+ async decAB(e) {
1702
+ let { ext_num: t, ab: n } = await this.#_(e), r = this.#v[t];
1703
+ return r?.fnc ? await r.fnc(n) : n;
1670
1704
  }
1671
1705
  #v = {
1672
1706
  1: {
1673
1707
  ext: "jpeg",
1674
- fnc: (h) => this.#y(h, "image/jpeg")
1708
+ fnc: (e) => this.#y(e, "image/jpeg")
1675
1709
  },
1676
1710
  2: {
1677
1711
  ext: "png",
1678
- fnc: (h) => this.#y(h, "image/png")
1712
+ fnc: (e) => this.#y(e, "image/png")
1679
1713
  },
1680
1714
  3: {
1681
1715
  ext: "svg",
1682
- fnc: (h) => this.#y(h, "image/svg+xml")
1716
+ fnc: (e) => this.#y(e, "image/svg+xml")
1683
1717
  },
1684
1718
  4: {
1685
1719
  ext: "webp",
1686
- fnc: (h) => this.#y(h, "image/webp")
1720
+ fnc: (e) => this.#y(e, "image/webp")
1687
1721
  },
1688
1722
  20: {
1689
1723
  ext: "mp4",
1690
- fnc: (h) => this.#b(h, "video/mp4")
1724
+ fnc: (e) => this.#b(e, "video/mp4")
1691
1725
  },
1692
1726
  21: {
1693
1727
  ext: "webm",
1694
- fnc: (h) => this.#b(h, "video/webm")
1728
+ fnc: (e) => this.#b(e, "video/webm")
1695
1729
  },
1696
1730
  22: {
1697
1731
  ext: "ogv",
1698
- fnc: (h) => this.#b(h, "video/ogv")
1732
+ fnc: (e) => this.#b(e, "video/ogv")
1699
1733
  }
1700
1734
  };
1701
- #y = (h, W) => new Promise((G, K) => {
1702
- let q = new Blob([h], { type: W }), J = new Image();
1703
- J.onload = () => G(J), J.onerror = (h) => K(Error(h instanceof Event ? h.type : h)), J.src = URL.createObjectURL(q);
1735
+ #y = (e, t) => new Promise((n, r) => {
1736
+ let i = new Blob([e], { type: t }), a = new Image();
1737
+ a.onload = () => n(a), a.onerror = (e) => r(Error(e instanceof Event ? e.type : e)), a.src = URL.createObjectURL(i);
1704
1738
  });
1705
- #b = (h, W) => new Promise((G, K) => {
1706
- let q = new Blob([h], { type: W }), J = document.createElement("video");
1707
- this.elc.add(J, "error", () => K(Error(J.error?.message ?? ""))), this.elc.add(J, "canplay", () => G(J)), J.src = URL.createObjectURL(q);
1739
+ #b = (e, t) => new Promise((n, r) => {
1740
+ let i = new Blob([e], { type: t }), a = document.createElement("video");
1741
+ this.elc.add(a, "error", () => r(Error(a.error?.message ?? ""))), this.elc.add(a, "canplay", () => n(a)), a.src = URL.createObjectURL(i);
1708
1742
  });
1709
- enc = async (h) => h;
1743
+ enc = async (e) => e;
1710
1744
  stk = () => "";
1711
- hash = (h) => "";
1745
+ hash = (e) => "";
1712
1746
  isApp = !1;
1713
1747
  $path_downloads = "";
1714
1748
  get path_downloads() {
@@ -1718,12 +1752,13 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
1718
1752
  get path_userdata() {
1719
1753
  return this.$path_userdata;
1720
1754
  }
1721
- capturePage(h, W, G, K) {}
1722
- async savePic(h, W) {}
1723
- async ensureFile(h) {}
1724
- async appendFile(h, W) {}
1725
- async outputFile(h, W) {}
1755
+ capturePage(e, t, n, r) {}
1756
+ async savePic(e, t) {}
1757
+ async ensureFile(e) {}
1758
+ async appendFile(e, t) {}
1759
+ async outputFile(e, t) {}
1726
1760
  };
1727
- export { SysBase as t };
1761
+ //#endregion
1762
+ export { Ke as t };
1728
1763
 
1729
1764
  //# sourceMappingURL=SysBase.js.map