@ikonai/sdk-ui 1.0.79 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{audio-playback-worker-DDtsnLoq.js → audio-playback-worker-C9XXiFhK.js} +350 -349
- package/assets/{protocol-worker-BoZcMF0x.js → protocol-worker-1sGaGw11.js} +277 -277
- package/assets/{ui-worker-DzF549yi.js → ui-worker-y-VofSR0.js} +775 -787
- package/assets/video-capture-worker-zOxyU-q3.js +1126 -0
- package/assets/video-playback-worker-DfwfIoRw.js +1005 -0
- package/assets/viseme-worker-CFJdP6of.js +831 -0
- package/ikon-ui-core.d.ts +0 -1
- package/index.js +1500 -1512
- package/package.json +1 -1
- package/assets/video-capture-worker-DxgvFTcw.js +0 -1126
- package/assets/video-playback-worker-Ca4XVGqt.js +0 -1005
- package/assets/viseme-worker-DVWM4pRh.js +0 -831
|
@@ -3,46 +3,46 @@ function z(t) {
|
|
|
3
3
|
throw new Error("Protocol message too short");
|
|
4
4
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function B(t) {
|
|
7
7
|
return z(t) & 4294901760;
|
|
8
8
|
}
|
|
9
9
|
function H(t) {
|
|
10
|
-
const e =
|
|
10
|
+
const e = ft(t), s = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
11
11
|
if (e.length < 27)
|
|
12
12
|
throw new Error("Protocol payload too short");
|
|
13
|
-
const r = s.getUint32(0, !0), n = s.getUint32(4, !0), i = s.getUint32(8, !0),
|
|
14
|
-
if (27 +
|
|
13
|
+
const r = s.getUint32(0, !0), n = s.getUint32(4, !0), i = s.getUint32(8, !0), l = s.getUint32(12, !0), o = s.getUint32(16, !0), a = s.getUint32(20, !0), u = s.getUint8(24), h = s.getUint8(25), E = s.getUint8(26);
|
|
14
|
+
if (27 + a * 4 > e.length)
|
|
15
15
|
throw new Error("Protocol header exceeds payload length");
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
for (let
|
|
19
|
-
|
|
16
|
+
const T = [];
|
|
17
|
+
let g = 27;
|
|
18
|
+
for (let d = 0; d < a; d++)
|
|
19
|
+
T.push(s.getUint32(g, !0)), g += 4;
|
|
20
20
|
return {
|
|
21
21
|
length: r,
|
|
22
22
|
opcode: n,
|
|
23
23
|
senderId: i,
|
|
24
|
-
trackId:
|
|
25
|
-
sequenceId:
|
|
26
|
-
targetIds:
|
|
27
|
-
payloadVersion:
|
|
28
|
-
payloadType:
|
|
29
|
-
flags:
|
|
24
|
+
trackId: l,
|
|
25
|
+
sequenceId: o,
|
|
26
|
+
targetIds: T,
|
|
27
|
+
payloadVersion: u,
|
|
28
|
+
payloadType: h,
|
|
29
|
+
flags: E
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
for (let
|
|
37
|
-
|
|
38
|
-
return
|
|
32
|
+
function Et(t, e, s, r, n) {
|
|
33
|
+
const a = [], h = 27 + a.length * 4, E = h + e.length, _ = new Uint8Array(E), T = new DataView(_.buffer);
|
|
34
|
+
T.setUint32(0, E, !0), T.setUint32(4, t >>> 0, !0), T.setUint32(8, r >>> 0, !0), T.setUint32(12, 0, !0), T.setUint32(16, 0, !0), T.setUint32(20, a.length >>> 0, !0), T.setUint8(24, s & 255), T.setUint8(25, 8), T.setUint8(26, 0);
|
|
35
|
+
let g = 27;
|
|
36
|
+
for (let d = 0; d < a.length; d++)
|
|
37
|
+
T.setUint32(g, a[d] >>> 0, !0), g += 4;
|
|
38
|
+
return _.set(e, h), _;
|
|
39
39
|
}
|
|
40
|
-
var
|
|
41
|
-
const
|
|
40
|
+
var P = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(P || {});
|
|
41
|
+
const ct = 161, _t = 162, K = new TextEncoder();
|
|
42
42
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
43
43
|
class V {
|
|
44
44
|
constructor(e = 1) {
|
|
45
|
-
this.version = e, this.buffer.writeByte(
|
|
45
|
+
this.version = e, this.buffer.writeByte(ct), this.buffer.writeVarUInt(e >>> 0);
|
|
46
46
|
}
|
|
47
47
|
buffer = new O();
|
|
48
48
|
closed = !1;
|
|
@@ -69,7 +69,7 @@ class V {
|
|
|
69
69
|
this.writeFixedField(e, 2, () => this.buffer.writeByte(s ? 1 : 0));
|
|
70
70
|
}
|
|
71
71
|
writeGuidField(e, s) {
|
|
72
|
-
const r = s instanceof
|
|
72
|
+
const r = s instanceof c ? s.asBytes() : s;
|
|
73
73
|
if (r.length !== 16)
|
|
74
74
|
throw new Error("Guid payload must be 16 bytes");
|
|
75
75
|
this.writeFixedField(e, 14, () => this.buffer.writeBytes(r));
|
|
@@ -96,11 +96,11 @@ class V {
|
|
|
96
96
|
writeDictionaryField(e, s, r, n) {
|
|
97
97
|
const i = new Z(s, r);
|
|
98
98
|
n(i);
|
|
99
|
-
const
|
|
100
|
-
this.writeVariableField(e, 10,
|
|
99
|
+
const l = i.finish();
|
|
100
|
+
this.writeVariableField(e, 10, l);
|
|
101
101
|
}
|
|
102
102
|
finish() {
|
|
103
|
-
return this.closed || (this.buffer.writeByte(
|
|
103
|
+
return this.closed || (this.buffer.writeByte(_t), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
|
|
104
104
|
}
|
|
105
105
|
writeFixedField(e, s, r) {
|
|
106
106
|
this.writeFieldHeader(e, s, 0), r();
|
|
@@ -109,7 +109,7 @@ class V {
|
|
|
109
109
|
this.writeFieldHeader(e, s, r.length), this.buffer.writeBytes(r);
|
|
110
110
|
}
|
|
111
111
|
writeFieldHeader(e, s, r) {
|
|
112
|
-
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(Y(s)),
|
|
112
|
+
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(Y(s)), ut(s) && this.buffer.writeVarUInt(r >>> 0);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
class x {
|
|
@@ -165,7 +165,7 @@ class x {
|
|
|
165
165
|
14
|
|
166
166
|
/* Guid */
|
|
167
167
|
), this.count++;
|
|
168
|
-
const s = e instanceof
|
|
168
|
+
const s = e instanceof c ? e.asBytes() : e;
|
|
169
169
|
if (s.length !== 16)
|
|
170
170
|
throw new Error("Guid payload must be 16 bytes");
|
|
171
171
|
this.payload.writeBytes(s);
|
|
@@ -220,7 +220,7 @@ class x {
|
|
|
220
220
|
}
|
|
221
221
|
ensureElementType(e) {
|
|
222
222
|
if (this.elementType !== e)
|
|
223
|
-
throw new Error(`Array element type is ${
|
|
223
|
+
throw new Error(`Array element type is ${P[this.elementType]}, expected ${P[e]}`);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
class Z {
|
|
@@ -233,7 +233,7 @@ class Z {
|
|
|
233
233
|
beginEntry() {
|
|
234
234
|
if (this.entryOpen)
|
|
235
235
|
throw new Error("Previous dictionary entry not completed");
|
|
236
|
-
return this.count++, this.entryOpen = !0, new
|
|
236
|
+
return this.count++, this.entryOpen = !0, new Tt(this.keyType, this.valueType, this.payload, () => {
|
|
237
237
|
this.entryOpen = !1;
|
|
238
238
|
});
|
|
239
239
|
}
|
|
@@ -244,7 +244,7 @@ class Z {
|
|
|
244
244
|
return e.writeByte(Y(this.keyType)), e.writeByte(Y(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
class
|
|
247
|
+
class Tt {
|
|
248
248
|
constructor(e, s, r, n) {
|
|
249
249
|
this.keyType = e, this.valueType = s, this.payload = r, this.onComplete = n;
|
|
250
250
|
}
|
|
@@ -298,7 +298,7 @@ class It {
|
|
|
298
298
|
14
|
|
299
299
|
/* Guid */
|
|
300
300
|
);
|
|
301
|
-
const s = e instanceof
|
|
301
|
+
const s = e instanceof c ? e.asBytes() : e;
|
|
302
302
|
if (s.length !== 16)
|
|
303
303
|
throw new Error("Guid payload must be 16 bytes");
|
|
304
304
|
this.payload.writeBytes(s), this.keyWritten = !0;
|
|
@@ -364,7 +364,7 @@ class It {
|
|
|
364
364
|
14
|
|
365
365
|
/* Guid */
|
|
366
366
|
);
|
|
367
|
-
const s = e instanceof
|
|
367
|
+
const s = e instanceof c ? e.asBytes() : e;
|
|
368
368
|
if (s.length !== 16)
|
|
369
369
|
throw new Error("Guid payload must be 16 bytes");
|
|
370
370
|
this.payload.writeBytes(s), this.valueWritten = !0;
|
|
@@ -428,14 +428,14 @@ class It {
|
|
|
428
428
|
}
|
|
429
429
|
ensureKeyType(e) {
|
|
430
430
|
if (this.keyType !== e)
|
|
431
|
-
throw new Error(`Dictionary key type is ${
|
|
431
|
+
throw new Error(`Dictionary key type is ${P[this.keyType]}, expected ${P[e]}`);
|
|
432
432
|
}
|
|
433
433
|
ensureValueType(e) {
|
|
434
434
|
if (this.valueType !== e)
|
|
435
|
-
throw new Error(`Dictionary value type is ${
|
|
435
|
+
throw new Error(`Dictionary value type is ${P[this.valueType]}, expected ${P[e]}`);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class c {
|
|
439
439
|
constructor(e) {
|
|
440
440
|
this.bytes = e;
|
|
441
441
|
}
|
|
@@ -445,19 +445,19 @@ class h {
|
|
|
445
445
|
const s = e.replace(/-/g, "");
|
|
446
446
|
if (s.length !== 32)
|
|
447
447
|
throw new Error("Guid string must be 32 hex characters");
|
|
448
|
-
const r = new Uint8Array(16), n =
|
|
449
|
-
|
|
450
|
-
for (let
|
|
451
|
-
r[8 +
|
|
452
|
-
return new
|
|
448
|
+
const r = new Uint8Array(16), n = c.parseHexSlice(s, 0, 8), i = c.parseHexSlice(s, 8, 4), l = c.parseHexSlice(s, 12, 4);
|
|
449
|
+
c.writeUInt32LE(r, 0, n), c.writeUInt16LE(r, 4, i), c.writeUInt16LE(r, 6, l);
|
|
450
|
+
for (let o = 0; o < 8; o++)
|
|
451
|
+
r[8 + o] = c.parseHexSlice(s, 16 + o * 2, 2);
|
|
452
|
+
return new c(r);
|
|
453
453
|
}
|
|
454
454
|
static fromBytes(e) {
|
|
455
455
|
if (e.length !== 16)
|
|
456
456
|
throw new Error("Guid byte array must be 16 bytes");
|
|
457
|
-
return new
|
|
457
|
+
return new c(Uint8Array.from(e));
|
|
458
458
|
}
|
|
459
459
|
static createZero() {
|
|
460
|
-
return new
|
|
460
|
+
return new c(new Uint8Array(16));
|
|
461
461
|
}
|
|
462
462
|
static createRandom() {
|
|
463
463
|
const e = new Uint8Array(16), s = globalThis.crypto;
|
|
@@ -466,14 +466,14 @@ class h {
|
|
|
466
466
|
else
|
|
467
467
|
for (let r = 0; r < e.length; r++)
|
|
468
468
|
e[r] = Math.floor(Math.random() * 256);
|
|
469
|
-
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new
|
|
469
|
+
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new c(e);
|
|
470
470
|
}
|
|
471
471
|
toString() {
|
|
472
472
|
const e = this.bytes;
|
|
473
473
|
return [
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
474
|
+
c.toHex(c.readUInt32LE(e, 0), 8),
|
|
475
|
+
c.toHex(c.readUInt16LE(e, 4), 4),
|
|
476
|
+
c.toHex(c.readUInt16LE(e, 6), 4),
|
|
477
477
|
J(e.subarray(8, 10)),
|
|
478
478
|
J(e.subarray(10, 16))
|
|
479
479
|
].join("-");
|
|
@@ -562,7 +562,7 @@ function Y(t, e = 0) {
|
|
|
562
562
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
563
563
|
return (t & 15) << 4 | e & 15;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function ut(t) {
|
|
566
566
|
return t === 12 || t === 13 || t === 9 || t === 11 || t === 10;
|
|
567
567
|
}
|
|
568
568
|
function At(t) {
|
|
@@ -572,37 +572,37 @@ function At(t) {
|
|
|
572
572
|
function J(t) {
|
|
573
573
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function ft(t) {
|
|
576
576
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
577
577
|
}
|
|
578
|
-
var f = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t[t.TcpTls = 256] = "TcpTls", t[t.Udp = 512] = "Udp", t[t.UdpDtls = 1024] = "UdpDtls", t))(f || {}), k = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", t[t.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", t[t.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.ACTION_RESULT = 1048654] = "ACTION_RESULT", t[t.UI_RESYNC_REQUEST = 1048655] = "UI_RESYNC_REQUEST", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(k || {});
|
|
578
|
+
var R = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t[t.TcpTls = 256] = "TcpTls", t[t.Udp = 512] = "Udp", t[t.UdpDtls = 1024] = "UdpDtls", t))(R || {}), k = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", t[t.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", t[t.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.ACTION_RESULT = 1048654] = "ACTION_RESULT", t[t.UI_RESYNC_REQUEST = 1048655] = "UI_RESYNC_REQUEST", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(k || {});
|
|
579
579
|
const st = 1, Ct = 131074;
|
|
580
580
|
function rt(t) {
|
|
581
581
|
return {};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function It(t) {
|
|
584
584
|
return new V(st).finish();
|
|
585
585
|
}
|
|
586
586
|
function nt(t, e, s) {
|
|
587
|
-
const r =
|
|
588
|
-
return
|
|
587
|
+
const r = It();
|
|
588
|
+
return Et(Ct, r, st, e);
|
|
589
589
|
}
|
|
590
590
|
class it extends Error {
|
|
591
591
|
constructor(e, s) {
|
|
592
592
|
super(e), this.cause = s, this.name = "ConnectionError";
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
class
|
|
595
|
+
class w extends it {
|
|
596
596
|
constructor(e, s) {
|
|
597
597
|
super(e, s), this.name = "TransportError";
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
class q extends
|
|
600
|
+
class q extends w {
|
|
601
601
|
constructor(e) {
|
|
602
602
|
super(`No keepalive received within ${e}ms`), this.name = "KeepaliveTimeoutError";
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
class b extends
|
|
605
|
+
class b extends w {
|
|
606
606
|
constructor(e, s) {
|
|
607
607
|
super(e, s), this.name = "AuthRejectedError";
|
|
608
608
|
}
|
|
@@ -612,7 +612,7 @@ class tt extends it {
|
|
|
612
612
|
super(`Maximum reconnection attempts (${e}) exceeded`), this.name = "MaxRetriesExceededError";
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function Rt(t, e) {
|
|
616
616
|
return new Promise((s, r) => {
|
|
617
617
|
const n = () => {
|
|
618
618
|
clearTimeout(i), r(new DOMException("Aborted", "AbortError"));
|
|
@@ -626,23 +626,23 @@ function ft(t, e) {
|
|
|
626
626
|
e?.addEventListener("abort", n, { once: !0 });
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
|
-
let
|
|
630
|
-
const
|
|
631
|
-
function
|
|
632
|
-
|
|
629
|
+
let ot = 1;
|
|
630
|
+
const Nt = /* @__PURE__ */ new Map();
|
|
631
|
+
function yt(t) {
|
|
632
|
+
ot = t;
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const wt = {
|
|
635
635
|
0: "DEBUG",
|
|
636
636
|
1: "INFO",
|
|
637
637
|
2: "WARN",
|
|
638
638
|
3: "ERROR",
|
|
639
639
|
4: "NONE"
|
|
640
640
|
};
|
|
641
|
-
function
|
|
641
|
+
function St(t, e) {
|
|
642
642
|
return `[${t}] ${e}`;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
const n = (/* @__PURE__ */ new Date()).toISOString(), i =
|
|
644
|
+
function W(t, e, s, r) {
|
|
645
|
+
const n = (/* @__PURE__ */ new Date()).toISOString(), i = wt[t], l = {
|
|
646
646
|
timestamp: n,
|
|
647
647
|
level: t,
|
|
648
648
|
levelName: i,
|
|
@@ -650,49 +650,49 @@ function p(t, e, s, r) {
|
|
|
650
650
|
message: s,
|
|
651
651
|
args: r
|
|
652
652
|
};
|
|
653
|
-
for (const [
|
|
654
|
-
const
|
|
655
|
-
if (t >=
|
|
653
|
+
for (const [o, a] of Nt) {
|
|
654
|
+
const u = a?.minLevel ?? 2;
|
|
655
|
+
if (t >= u)
|
|
656
656
|
try {
|
|
657
|
-
|
|
657
|
+
o(l);
|
|
658
658
|
} catch {
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
if (
|
|
662
|
-
const
|
|
661
|
+
if (ot <= t) {
|
|
662
|
+
const o = St(e, s);
|
|
663
663
|
switch (t) {
|
|
664
664
|
case 0:
|
|
665
|
-
console.debug(
|
|
665
|
+
console.debug(o, ...r);
|
|
666
666
|
break;
|
|
667
667
|
case 1:
|
|
668
|
-
console.info(
|
|
668
|
+
console.info(o, ...r);
|
|
669
669
|
break;
|
|
670
670
|
case 2:
|
|
671
|
-
console.warn(
|
|
671
|
+
console.warn(o, ...r);
|
|
672
672
|
break;
|
|
673
673
|
case 3:
|
|
674
|
-
console.error(
|
|
674
|
+
console.error(o, ...r);
|
|
675
675
|
break;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function G(t) {
|
|
680
680
|
return {
|
|
681
681
|
debug(e, ...s) {
|
|
682
|
-
|
|
682
|
+
W(0, t, e, s);
|
|
683
683
|
},
|
|
684
684
|
info(e, ...s) {
|
|
685
|
-
|
|
685
|
+
W(1, t, e, s);
|
|
686
686
|
},
|
|
687
687
|
warn(e, ...s) {
|
|
688
|
-
|
|
688
|
+
W(2, t, e, s);
|
|
689
689
|
},
|
|
690
690
|
error(e, ...s) {
|
|
691
|
-
|
|
691
|
+
W(3, t, e, s);
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
|
-
const
|
|
695
|
+
const gt = "ikon-retry";
|
|
696
696
|
function Lt(t, e) {
|
|
697
697
|
if (typeof window > "u")
|
|
698
698
|
return null;
|
|
@@ -702,14 +702,14 @@ function Lt(t, e) {
|
|
|
702
702
|
const n = s.get(t.replace(/-/g, "_"));
|
|
703
703
|
return n !== null ? n : null;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Ut(t, e) {
|
|
706
706
|
const s = Lt(t);
|
|
707
707
|
return s === "true" ? !0 : s === "false" ? !1 : null;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
return gt
|
|
709
|
+
function mt() {
|
|
710
|
+
return Ut(gt) !== !1;
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const D = G("WebSocketTransport"), Pt = 1e4;
|
|
713
713
|
class Ot {
|
|
714
714
|
ws = null;
|
|
715
715
|
keepaliveTimeout = null;
|
|
@@ -724,7 +724,7 @@ class Ot {
|
|
|
724
724
|
callbacks;
|
|
725
725
|
sessionId;
|
|
726
726
|
constructor(e) {
|
|
727
|
-
this.callbacks = e.callbacks, this.sessionId = e.sessionId, this.keepaliveTimeoutMs = e.keepaliveTimeoutMs, this.connectionTimeoutMs = e.connectionTimeoutMs ??
|
|
727
|
+
this.callbacks = e.callbacks, this.sessionId = e.sessionId, this.keepaliveTimeoutMs = e.keepaliveTimeoutMs, this.connectionTimeoutMs = e.connectionTimeoutMs ?? Pt;
|
|
728
728
|
}
|
|
729
729
|
get isConnected() {
|
|
730
730
|
return this.ws?.readyState === WebSocket.OPEN;
|
|
@@ -735,42 +735,42 @@ class Ot {
|
|
|
735
735
|
return new Promise((n, i) => {
|
|
736
736
|
try {
|
|
737
737
|
this.ws = new WebSocket(e), this.ws.binaryType = "arraybuffer";
|
|
738
|
-
} catch (
|
|
739
|
-
i(new
|
|
738
|
+
} catch (_) {
|
|
739
|
+
i(new w(`Failed to create WebSocket: ${_}`, _ instanceof Error ? _ : void 0));
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
|
-
let
|
|
743
|
-
const
|
|
744
|
-
clearTimeout(
|
|
745
|
-
},
|
|
746
|
-
|
|
747
|
-
},
|
|
748
|
-
|
|
742
|
+
let l = !1, o = !1;
|
|
743
|
+
const a = () => {
|
|
744
|
+
clearTimeout(E), this.ws && (this.ws.onopen = null, this.ws.onerror = null, this.ws.onclose = null, this.ws.onmessage = null);
|
|
745
|
+
}, u = () => {
|
|
746
|
+
o || (o = !0, clearTimeout(E), this.firstMessageResolver = null, D.debug(`WebSocket connected in ${Date.now() - r}ms`), n());
|
|
747
|
+
}, h = (_) => {
|
|
748
|
+
o || (o = !0, this.firstMessageResolver = null, a(), i(_));
|
|
749
749
|
};
|
|
750
|
-
this.firstMessageResolver =
|
|
751
|
-
const
|
|
752
|
-
this.ws?.close(),
|
|
750
|
+
this.firstMessageResolver = u;
|
|
751
|
+
const E = setTimeout(() => {
|
|
752
|
+
this.ws?.close(), D.warn(`WebSocket connection timeout after ${this.connectionTimeoutMs}ms`), h(new w("WebSocket connection timeout"));
|
|
753
753
|
}, this.connectionTimeoutMs);
|
|
754
754
|
this.ws.onopen = () => {
|
|
755
|
-
|
|
755
|
+
l = !0, this.ws.send(s), this.resetKeepaliveTimeout();
|
|
756
756
|
}, this.ws.onerror = () => {
|
|
757
|
-
|
|
758
|
-
}, this.ws.onclose = (
|
|
759
|
-
if (this.clearKeepaliveTimeout(), !
|
|
760
|
-
l
|
|
757
|
+
D.debug(`WebSocket connection failed after ${Date.now() - r}ms`), h(new w("WebSocket connection failed"));
|
|
758
|
+
}, this.ws.onclose = (_) => {
|
|
759
|
+
if (this.clearKeepaliveTimeout(), !o) {
|
|
760
|
+
h(l ? new b("WebSocket closed before first server message") : new w("WebSocket connection closed before opening"));
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
763
|
if (this.isClosed)
|
|
764
764
|
return;
|
|
765
|
-
const
|
|
766
|
-
this.callbacks.onClose(
|
|
767
|
-
}, this.ws.onmessage = (
|
|
768
|
-
this.handleProtocolMessage(new Uint8Array(
|
|
765
|
+
const T = _.wasClean && (_.code === 1e3 || _.code === 1001), g = _.reason || `code=${_.code}`;
|
|
766
|
+
this.callbacks.onClose(g, T);
|
|
767
|
+
}, this.ws.onmessage = (_) => {
|
|
768
|
+
this.handleProtocolMessage(new Uint8Array(_.data));
|
|
769
769
|
};
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
772
|
send(e) {
|
|
773
|
-
this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) :
|
|
773
|
+
this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) : D.warn("Cannot send: WebSocket not connected");
|
|
774
774
|
}
|
|
775
775
|
close() {
|
|
776
776
|
this.isClosed = !0, this.clearKeepaliveTimeout(), this.ws && (this.ws.close(1e3, "Client closing"), this.ws = null);
|
|
@@ -790,20 +790,20 @@ class Ot {
|
|
|
790
790
|
}
|
|
791
791
|
this.resetKeepaliveTimeout(), this.callbacks.onProtocolMessage(e);
|
|
792
792
|
} catch (s) {
|
|
793
|
-
|
|
793
|
+
D.error("Failed to process protocol message:", s), this.callbacks.onError(s instanceof Error ? s : new Error(String(s)));
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
resetKeepaliveTimeout() {
|
|
797
797
|
this.clearKeepaliveTimeout(), !(this.keepaliveTimeoutMs <= 0) && (this.keepaliveTimeout = setTimeout(() => {
|
|
798
|
-
|
|
798
|
+
D.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new q(this.keepaliveTimeoutMs)), this.close();
|
|
799
799
|
}, this.keepaliveTimeoutMs));
|
|
800
800
|
}
|
|
801
801
|
clearKeepaliveTimeout() {
|
|
802
802
|
this.keepaliveTimeout && (clearTimeout(this.keepaliveTimeout), this.keepaliveTimeout = null);
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
const
|
|
806
|
-
function
|
|
805
|
+
const S = G("WebTransportTransport"), dt = 1e4, et = 4, Dt = 65536;
|
|
806
|
+
function at() {
|
|
807
807
|
return typeof WebTransport < "u";
|
|
808
808
|
}
|
|
809
809
|
class bt {
|
|
@@ -815,7 +815,7 @@ class bt {
|
|
|
815
815
|
readLoopActive = !1;
|
|
816
816
|
isClosed = !1;
|
|
817
817
|
// Grow-only receive buffer with offset/length tracking to minimize allocations
|
|
818
|
-
receiveBuffer = new Uint8Array(
|
|
818
|
+
receiveBuffer = new Uint8Array(Dt);
|
|
819
819
|
receiveBufferOffset = 0;
|
|
820
820
|
receiveBufferLength = 0;
|
|
821
821
|
// Cached DataView to avoid allocation per message
|
|
@@ -832,66 +832,66 @@ class bt {
|
|
|
832
832
|
callbacks;
|
|
833
833
|
sessionId;
|
|
834
834
|
constructor(e) {
|
|
835
|
-
this.callbacks = e.callbacks, this.sessionId = e.sessionId, this.keepaliveTimeoutMs = e.keepaliveTimeoutMs, this.connectionTimeoutMs = e.connectionTimeoutMs ??
|
|
835
|
+
this.callbacks = e.callbacks, this.sessionId = e.sessionId, this.keepaliveTimeoutMs = e.keepaliveTimeoutMs, this.connectionTimeoutMs = e.connectionTimeoutMs ?? dt;
|
|
836
836
|
}
|
|
837
837
|
get isConnected() {
|
|
838
838
|
return this.transport !== null && this.writer !== null;
|
|
839
839
|
}
|
|
840
840
|
async connect(e, s) {
|
|
841
|
-
if (!
|
|
842
|
-
throw new
|
|
841
|
+
if (!at())
|
|
842
|
+
throw new w("WebTransport is not supported in this browser");
|
|
843
843
|
this.isClosed = !1;
|
|
844
|
-
const r = Date.now(), n = new Promise((i,
|
|
845
|
-
this.firstMessageResolver = i, this.firstMessageRejecter =
|
|
844
|
+
const r = Date.now(), n = new Promise((i, l) => {
|
|
845
|
+
this.firstMessageResolver = i, this.firstMessageRejecter = l;
|
|
846
846
|
});
|
|
847
847
|
try {
|
|
848
848
|
this.transport = new WebTransport(e);
|
|
849
849
|
let i;
|
|
850
|
-
const
|
|
850
|
+
const l = new Promise((h, E) => {
|
|
851
851
|
i = setTimeout(
|
|
852
|
-
() =>
|
|
852
|
+
() => E(new w("WebTransport connection timeout")),
|
|
853
853
|
this.connectionTimeoutMs
|
|
854
854
|
);
|
|
855
855
|
});
|
|
856
856
|
try {
|
|
857
|
-
await Promise.race([this.transport.ready,
|
|
858
|
-
} catch (
|
|
859
|
-
throw
|
|
857
|
+
await Promise.race([this.transport.ready, l]);
|
|
858
|
+
} catch (h) {
|
|
859
|
+
throw h instanceof w && S.warn(`WebTransport connection timeout after ${this.connectionTimeoutMs}ms`), h;
|
|
860
860
|
} finally {
|
|
861
861
|
clearTimeout(i);
|
|
862
862
|
}
|
|
863
863
|
this.transport.closed.then(() => {
|
|
864
864
|
this.handleClose("Connection closed", !0);
|
|
865
|
-
}).catch((
|
|
866
|
-
|
|
865
|
+
}).catch((h) => {
|
|
866
|
+
S.error("WebTransport connection closed with error:", h), this.handleClose(h.message || "Connection error", !1);
|
|
867
867
|
}), this.stream = await this.transport.createBidirectionalStream(), this.reader = this.stream.readable.getReader(), this.writer = this.stream.writable.getWriter(), await this.writer.write(s), this.resetKeepaliveTimeout(), this.startReadLoop();
|
|
868
|
-
const
|
|
869
|
-
let
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
() =>
|
|
873
|
-
|
|
868
|
+
const o = Math.max(this.connectionTimeoutMs - (Date.now() - r), 1);
|
|
869
|
+
let a;
|
|
870
|
+
const u = new Promise((h, E) => {
|
|
871
|
+
a = setTimeout(
|
|
872
|
+
() => E(new w("WebTransport closed before first server message")),
|
|
873
|
+
o
|
|
874
874
|
);
|
|
875
875
|
});
|
|
876
876
|
try {
|
|
877
|
-
await Promise.race([n,
|
|
877
|
+
await Promise.race([n, u]);
|
|
878
878
|
} finally {
|
|
879
|
-
clearTimeout(
|
|
879
|
+
clearTimeout(a);
|
|
880
880
|
}
|
|
881
|
-
this.firstMessageResolver = null, this.firstMessageRejecter = null,
|
|
881
|
+
this.firstMessageResolver = null, this.firstMessageRejecter = null, S.info(`WebTransport connected in ${Date.now() - r}ms`);
|
|
882
882
|
} catch (i) {
|
|
883
883
|
this.firstMessageResolver = null, this.firstMessageRejecter = null, this.isClosed = !0, this.cleanup();
|
|
884
|
-
const
|
|
885
|
-
throw
|
|
884
|
+
const l = Date.now() - r;
|
|
885
|
+
throw S.warn(`WebTransport connection failed after ${l}ms: ${i}`), new w(`Failed to connect WebTransport: ${i}`, i instanceof Error ? i : void 0);
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
send(e) {
|
|
889
889
|
if (!this.writer) {
|
|
890
|
-
|
|
890
|
+
S.warn("Cannot send: WebTransport not connected");
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
893
|
this.writer.write(e).catch((s) => {
|
|
894
|
-
|
|
894
|
+
S.error("Failed to send protocol message:", s), this.callbacks.onError(s instanceof Error ? s : new Error(String(s)));
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
897
|
close() {
|
|
@@ -912,7 +912,7 @@ class bt {
|
|
|
912
912
|
}
|
|
913
913
|
this.readLoopActive && this.handleClose("Stream ended", !1);
|
|
914
914
|
} catch (e) {
|
|
915
|
-
this.readLoopActive && (
|
|
915
|
+
this.readLoopActive && (S.error("Read loop error:", e), this.callbacks.onError(e instanceof Error ? e : new Error(String(e))));
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
918
|
}
|
|
@@ -953,7 +953,7 @@ class bt {
|
|
|
953
953
|
for (; this.receiveBufferLength >= et; ) {
|
|
954
954
|
const s = e.getUint32(this.receiveBufferOffset, !0);
|
|
955
955
|
if (s < et) {
|
|
956
|
-
|
|
956
|
+
S.error(`Invalid message length: ${s}`), this.callbacks.onError(new Error(`Invalid protocol message length: ${s}`)), this.receiveBufferOffset = 0, this.receiveBufferLength = 0;
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
959
|
if (this.receiveBufferLength < s)
|
|
@@ -975,7 +975,7 @@ class bt {
|
|
|
975
975
|
}
|
|
976
976
|
this.resetKeepaliveTimeout(), this.callbacks.onProtocolMessage(e);
|
|
977
977
|
} catch (s) {
|
|
978
|
-
|
|
978
|
+
S.error("Failed to process protocol message:", s), this.callbacks.onError(s instanceof Error ? s : new Error(String(s)));
|
|
979
979
|
}
|
|
980
980
|
}
|
|
981
981
|
/**
|
|
@@ -995,7 +995,7 @@ class bt {
|
|
|
995
995
|
*/
|
|
996
996
|
resetKeepaliveTimeout() {
|
|
997
997
|
this.clearKeepaliveTimeout(), !(this.keepaliveTimeoutMs <= 0) && (this.keepaliveTimeout = setTimeout(() => {
|
|
998
|
-
|
|
998
|
+
S.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new q(this.keepaliveTimeoutMs)), this.close();
|
|
999
999
|
}, this.keepaliveTimeoutMs));
|
|
1000
1000
|
}
|
|
1001
1001
|
/**
|
|
@@ -1017,8 +1017,8 @@ class bt {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
const $ =
|
|
1021
|
-
class
|
|
1020
|
+
const $ = G("Channel");
|
|
1021
|
+
class Mt {
|
|
1022
1022
|
state = "disconnected";
|
|
1023
1023
|
transport = null;
|
|
1024
1024
|
config;
|
|
@@ -1110,18 +1110,18 @@ class vt {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
};
|
|
1112
1112
|
switch (e.Type) {
|
|
1113
|
-
case
|
|
1114
|
-
case
|
|
1113
|
+
case R.WebSocket:
|
|
1114
|
+
case R.WebSocketProxy:
|
|
1115
1115
|
this.transport = new Ot(s);
|
|
1116
1116
|
break;
|
|
1117
|
-
case
|
|
1118
|
-
case
|
|
1119
|
-
if (!
|
|
1117
|
+
case R.WebTransport:
|
|
1118
|
+
case R.WebTransportProxy:
|
|
1119
|
+
if (!at())
|
|
1120
1120
|
throw new Error("WebTransport is not supported in this browser");
|
|
1121
1121
|
this.transport = new bt(s);
|
|
1122
1122
|
break;
|
|
1123
1123
|
default:
|
|
1124
|
-
throw new Error(`Unsupported entrypoint type: ${
|
|
1124
|
+
throw new Error(`Unsupported entrypoint type: ${R[e.Type]}`);
|
|
1125
1125
|
}
|
|
1126
1126
|
await this.transport.connect(e.Uri, e.AuthTicket);
|
|
1127
1127
|
}
|
|
@@ -1159,8 +1159,8 @@ class vt {
|
|
|
1159
1159
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
const A =
|
|
1163
|
-
class
|
|
1162
|
+
const A = G("ChannelManager"), vt = 5e3;
|
|
1163
|
+
class pt {
|
|
1164
1164
|
channels = /* @__PURE__ */ new Map();
|
|
1165
1165
|
// keyed by opcode group
|
|
1166
1166
|
activeType = null;
|
|
@@ -1210,7 +1210,7 @@ class Ft {
|
|
|
1210
1210
|
* The opcode group is extracted from the message automatically.
|
|
1211
1211
|
*/
|
|
1212
1212
|
sendProtocolMessage(e) {
|
|
1213
|
-
const s =
|
|
1213
|
+
const s = B(e);
|
|
1214
1214
|
for (const [r, n] of this.channels)
|
|
1215
1215
|
if (r & s) {
|
|
1216
1216
|
n.send(e);
|
|
@@ -1255,38 +1255,38 @@ class Ft {
|
|
|
1255
1255
|
*/
|
|
1256
1256
|
async connectInternal(e = !1) {
|
|
1257
1257
|
this.setState("connecting");
|
|
1258
|
-
const s = this.entrypoints.filter((i) => i.Type !==
|
|
1258
|
+
const s = this.entrypoints.filter((i) => i.Type !== R.WebRTC), r = this.groupByType(s);
|
|
1259
1259
|
if (r.size === 0)
|
|
1260
1260
|
throw this.setState("offline"), new Error("No entrypoints available");
|
|
1261
1261
|
let n;
|
|
1262
1262
|
if (this.config.orderedEndpointTypes && this.config.orderedEndpointTypes.length > 0) {
|
|
1263
1263
|
const i = new Set(r.keys());
|
|
1264
|
-
n = this.config.orderedEndpointTypes.filter((
|
|
1264
|
+
n = this.config.orderedEndpointTypes.filter((l) => i.has(l));
|
|
1265
1265
|
} else this.config.endpointSelector ? n = this.config.endpointSelector.getOrderedTypes(r) : n = Array.from(r.keys());
|
|
1266
|
-
this.connectionTimeoutMs = n.length > 1 ? 5e3 : 1e4, A.debug(`Endpoint types to try: [${n.map((i) =>
|
|
1266
|
+
this.connectionTimeoutMs = n.length > 1 ? 5e3 : 1e4, A.debug(`Endpoint types to try: [${n.map((i) => R[i]).join(", ")}], transport timeout: ${this.connectionTimeoutMs}ms`);
|
|
1267
1267
|
for (const i of n) {
|
|
1268
1268
|
if (!this.shouldReconnect)
|
|
1269
1269
|
return;
|
|
1270
|
-
const
|
|
1271
|
-
A.debug(`Trying ${
|
|
1270
|
+
const l = r.get(i), o = Date.now();
|
|
1271
|
+
A.debug(`Trying ${R[i]} (${l.length} channel(s))`);
|
|
1272
1272
|
try {
|
|
1273
|
-
await this.connectAllChannels(
|
|
1273
|
+
await this.connectAllChannels(l), this.config.endpointSelector?.rememberWorkingType(i), this.config.onRememberWorkingType?.(i), this.activeType = i, A.debug(`Connected via ${R[i]} in ${Date.now() - o}ms`), this.setState("connected"), this.startStabilityTimer();
|
|
1274
1274
|
return;
|
|
1275
|
-
} catch (
|
|
1276
|
-
A.warn(`Failed to connect using ${
|
|
1277
|
-
const
|
|
1278
|
-
if (this.disconnectAll(),
|
|
1279
|
-
throw
|
|
1280
|
-
if (
|
|
1275
|
+
} catch (a) {
|
|
1276
|
+
A.warn(`Failed to connect using ${R[i]} after ${Date.now() - o}ms: ${a instanceof Error ? a.message : a}`);
|
|
1277
|
+
const u = this.channels.size > 0;
|
|
1278
|
+
if (this.disconnectAll(), a instanceof b)
|
|
1279
|
+
throw a;
|
|
1280
|
+
if (u && this.config.onRefreshEntrypoints)
|
|
1281
1281
|
try {
|
|
1282
1282
|
A.info("Partial connection detected, refreshing entrypoints");
|
|
1283
|
-
const
|
|
1284
|
-
this.entrypoints =
|
|
1285
|
-
const
|
|
1286
|
-
for (const [
|
|
1287
|
-
r.set(
|
|
1288
|
-
} catch (
|
|
1289
|
-
A.warn(`Failed to refresh entrypoints: ${
|
|
1283
|
+
const h = await this.config.onRefreshEntrypoints();
|
|
1284
|
+
this.entrypoints = h.entrypoints, this.config.sessionId = h.sessionId;
|
|
1285
|
+
const E = h.entrypoints.filter((T) => T.Type !== R.WebRTC), _ = this.groupByType(E);
|
|
1286
|
+
for (const [T, g] of _)
|
|
1287
|
+
r.set(T, g);
|
|
1288
|
+
} catch (h) {
|
|
1289
|
+
A.warn(`Failed to refresh entrypoints: ${h}`);
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
@@ -1308,7 +1308,7 @@ class Ft {
|
|
|
1308
1308
|
* Connect a single channel.
|
|
1309
1309
|
*/
|
|
1310
1310
|
async connectChannel(e) {
|
|
1311
|
-
const s = new
|
|
1311
|
+
const s = new Mt({
|
|
1312
1312
|
entrypoint: e,
|
|
1313
1313
|
sessionId: this.config.sessionId,
|
|
1314
1314
|
keepaliveTimeoutMs: this.config.keepaliveTimeoutMs,
|
|
@@ -1362,7 +1362,7 @@ class Ft {
|
|
|
1362
1362
|
*/
|
|
1363
1363
|
async attemptReconnect() {
|
|
1364
1364
|
if (this.shouldReconnect) {
|
|
1365
|
-
if (!
|
|
1365
|
+
if (!mt()) {
|
|
1366
1366
|
A.warn("Retry disabled via ikon-retry=false, skipping reconnect"), this.setState("offline"), this.config.onError?.(new tt(0));
|
|
1367
1367
|
return;
|
|
1368
1368
|
}
|
|
@@ -1370,7 +1370,7 @@ class Ft {
|
|
|
1370
1370
|
A.warn(`Max reconnect attempts (${this.config.maxReconnectAttempts}) reached`), this.setState("offline"), this.config.onError?.(new tt(this.config.maxReconnectAttempts));
|
|
1371
1371
|
return;
|
|
1372
1372
|
}
|
|
1373
|
-
if (this.setState("reconnecting"), this.reconnectAttempts++, this.reconnectAttempts > 1 ? (A.info(`Reconnecting in ${this.config.reconnectBackoffMs}ms (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`), await
|
|
1373
|
+
if (this.setState("reconnecting"), this.reconnectAttempts++, this.reconnectAttempts > 1 ? (A.info(`Reconnecting in ${this.config.reconnectBackoffMs}ms (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`), await Rt(this.config.reconnectBackoffMs, this.abortController?.signal)) : A.info(`Reconnecting immediately (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`), !!this.shouldReconnect)
|
|
1374
1374
|
try {
|
|
1375
1375
|
await this.connectInternal(!0);
|
|
1376
1376
|
} catch (e) {
|
|
@@ -1399,69 +1399,69 @@ class Ft {
|
|
|
1399
1399
|
startStabilityTimer() {
|
|
1400
1400
|
this.clearStabilityTimer(), this.stabilityTimer = setTimeout(() => {
|
|
1401
1401
|
this.stabilityTimer = null, this.state === "connected" && (this.reconnectAttempts = 0);
|
|
1402
|
-
},
|
|
1402
|
+
}, vt);
|
|
1403
1403
|
}
|
|
1404
1404
|
clearStabilityTimer() {
|
|
1405
1405
|
this.stabilityTimer && (clearTimeout(this.stabilityTimer), this.stabilityTimer = null);
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
|
-
const
|
|
1408
|
+
const lt = G("ProtocolWorker"), U = (t, e) => {
|
|
1409
1409
|
self.postMessage(t, e ?? []);
|
|
1410
1410
|
};
|
|
1411
|
-
let
|
|
1412
|
-
const
|
|
1411
|
+
let f = null, v = null, p = null, X, I = null;
|
|
1412
|
+
const m = [], N = [], F = /* @__PURE__ */ new Map(), y = [], C = [], L = /* @__PURE__ */ new Map(), j = [];
|
|
1413
1413
|
function Q() {
|
|
1414
1414
|
try {
|
|
1415
|
-
|
|
1415
|
+
f?.disconnect();
|
|
1416
1416
|
} catch (t) {
|
|
1417
|
-
|
|
1417
|
+
lt.warn(`Failed to disconnect channel manager: ${t}`);
|
|
1418
1418
|
}
|
|
1419
|
-
|
|
1420
|
-
for (let t = 0; t <
|
|
1419
|
+
f = null;
|
|
1420
|
+
for (let t = 0; t < N.length; t++)
|
|
1421
1421
|
try {
|
|
1422
|
-
|
|
1422
|
+
N[t].port.close();
|
|
1423
1423
|
} catch {
|
|
1424
1424
|
}
|
|
1425
|
-
|
|
1425
|
+
m.length = 0, N.length = 0, F.clear();
|
|
1426
1426
|
for (let t = 0; t < C.length; t++)
|
|
1427
1427
|
try {
|
|
1428
1428
|
C[t].port.close();
|
|
1429
1429
|
} catch {
|
|
1430
1430
|
}
|
|
1431
|
-
|
|
1431
|
+
y.length = 0, C.length = 0, L.clear();
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function M(t) {
|
|
1434
1434
|
const e = t instanceof Error ? t : new Error(String(t));
|
|
1435
|
-
|
|
1435
|
+
U({ type: "error", error: { name: e.name, message: e.message, stack: e.stack } });
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1437
|
+
function Ft() {
|
|
1438
1438
|
let t = 0;
|
|
1439
|
-
for (let e = 0; e <
|
|
1440
|
-
t |=
|
|
1439
|
+
for (let e = 0; e < N.length; e++)
|
|
1440
|
+
t |= N[e].opcodeGroupsMask;
|
|
1441
1441
|
return t;
|
|
1442
1442
|
}
|
|
1443
|
-
function
|
|
1444
|
-
if (
|
|
1443
|
+
function Bt(t) {
|
|
1444
|
+
if (X === void 0)
|
|
1445
1445
|
return !0;
|
|
1446
|
-
const e =
|
|
1447
|
-
if ((e &
|
|
1446
|
+
const e = B(t);
|
|
1447
|
+
if ((e & X) !== 0)
|
|
1448
1448
|
return !0;
|
|
1449
|
-
const s =
|
|
1449
|
+
const s = Ft();
|
|
1450
1450
|
return (e & s) !== 0;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1453
|
-
|
|
1454
|
-
for (let e = 0; e <
|
|
1455
|
-
const s =
|
|
1456
|
-
(s.opcodeGroupsMask & t) !== 0 &&
|
|
1452
|
+
function ht(t) {
|
|
1453
|
+
j.length = 0;
|
|
1454
|
+
for (let e = 0; e < N.length; e++) {
|
|
1455
|
+
const s = N[e];
|
|
1456
|
+
(s.opcodeGroupsMask & t) !== 0 && j.push(s.port);
|
|
1457
1457
|
}
|
|
1458
|
-
return
|
|
1458
|
+
return j;
|
|
1459
1459
|
}
|
|
1460
1460
|
function Vt(t, e) {
|
|
1461
|
-
return (
|
|
1461
|
+
return (B(t) & e) !== 0;
|
|
1462
1462
|
}
|
|
1463
1463
|
function kt(t, e) {
|
|
1464
|
-
if (!
|
|
1464
|
+
if (!f || !e || typeof e != "object")
|
|
1465
1465
|
return;
|
|
1466
1466
|
const s = e;
|
|
1467
1467
|
if (!(s.type !== "send" || !(s.message instanceof ArrayBuffer)))
|
|
@@ -1469,13 +1469,13 @@ function kt(t, e) {
|
|
|
1469
1469
|
const r = new Uint8Array(s.message);
|
|
1470
1470
|
if (!Vt(r, t))
|
|
1471
1471
|
return;
|
|
1472
|
-
|
|
1472
|
+
f.sendProtocolMessage(r), I && I.postMessage({ direction: "sent", message: Array.from(r) });
|
|
1473
1473
|
} catch (r) {
|
|
1474
|
-
|
|
1474
|
+
M(r);
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
async function
|
|
1478
|
-
Q(),
|
|
1477
|
+
async function Gt(t) {
|
|
1478
|
+
Q(), f = new pt({
|
|
1479
1479
|
sessionId: t.sessionId,
|
|
1480
1480
|
keepaliveTimeoutMs: t.keepaliveTimeoutMs,
|
|
1481
1481
|
reconnectBackoffMs: t.reconnectBackoffMs,
|
|
@@ -1483,122 +1483,122 @@ async function Wt(t) {
|
|
|
1483
1483
|
orderedEndpointTypes: t.orderedEndpointTypes,
|
|
1484
1484
|
webRtcEnabled: t.webRtcEnabled,
|
|
1485
1485
|
onStateChange: (e) => {
|
|
1486
|
-
|
|
1486
|
+
U({ type: "state", state: e, activeType: f?.activeEndpointType ?? void 0 });
|
|
1487
1487
|
},
|
|
1488
1488
|
onRememberWorkingType: () => {
|
|
1489
|
-
|
|
1489
|
+
U({ type: "state", state: f?.managerState ?? "idle", activeType: f?.activeEndpointType ?? void 0 });
|
|
1490
1490
|
},
|
|
1491
1491
|
onError: (e) => {
|
|
1492
|
-
|
|
1492
|
+
M(e);
|
|
1493
1493
|
},
|
|
1494
1494
|
onRefreshEntrypoints: () => new Promise((e, s) => {
|
|
1495
|
-
|
|
1495
|
+
v = e, p = s, U({ type: "refreshEntrypoints" });
|
|
1496
1496
|
}),
|
|
1497
1497
|
onProtocolMessage: (e) => {
|
|
1498
|
-
|
|
1499
|
-
const s =
|
|
1498
|
+
I && (I.postMessage({ direction: "received", message: Array.from(e) }), z(e) === k.ANALYTICS_LOGS && I.postMessage({ type: "serverLogs", message: Array.from(e) }));
|
|
1499
|
+
const s = B(e), r = Bt(e), n = ht(s);
|
|
1500
1500
|
if (!(!r && n.length === 0))
|
|
1501
1501
|
try {
|
|
1502
|
-
const i = H(e),
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1505
|
-
n[0].postMessage({ type: "protocol", message:
|
|
1502
|
+
const i = H(e), l = e.buffer instanceof ArrayBuffer && e.byteOffset === 0 && e.byteLength === e.buffer.byteLength, o = n.length > 0;
|
|
1503
|
+
if (o && !r && n.length === 1 && l) {
|
|
1504
|
+
const a = e.buffer;
|
|
1505
|
+
n[0].postMessage({ type: "protocol", message: a, headers: i }, [a]);
|
|
1506
1506
|
return;
|
|
1507
1507
|
}
|
|
1508
|
-
if (!
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1508
|
+
if (!o && r && l) {
|
|
1509
|
+
const a = e.buffer;
|
|
1510
|
+
U({ type: "protocol", message: a, headers: i }, [a]);
|
|
1511
1511
|
return;
|
|
1512
1512
|
}
|
|
1513
|
-
if (
|
|
1514
|
-
const
|
|
1515
|
-
for (let
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
n[0].postMessage({ type: "protocol", message:
|
|
1519
|
-
for (let
|
|
1520
|
-
n[
|
|
1521
|
-
|
|
1513
|
+
if (o && l) {
|
|
1514
|
+
const a = [];
|
|
1515
|
+
for (let E = 1; E < n.length; E++)
|
|
1516
|
+
a.push(e.slice().buffer);
|
|
1517
|
+
const u = r ? e.slice().buffer : null, h = e.buffer;
|
|
1518
|
+
n[0].postMessage({ type: "protocol", message: h, headers: i }, [h]);
|
|
1519
|
+
for (let E = 1; E < n.length; E++)
|
|
1520
|
+
n[E].postMessage({ type: "protocol", message: a[E - 1], headers: i }, [a[E - 1]]);
|
|
1521
|
+
u && U({ type: "protocol", message: u, headers: i }, [u]);
|
|
1522
1522
|
return;
|
|
1523
1523
|
}
|
|
1524
|
-
if (
|
|
1525
|
-
for (const
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1524
|
+
if (o)
|
|
1525
|
+
for (const a of n) {
|
|
1526
|
+
const u = e.slice().buffer;
|
|
1527
|
+
a.postMessage({ type: "protocol", message: u, headers: i }, [u]);
|
|
1528
1528
|
}
|
|
1529
1529
|
if (r) {
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1530
|
+
const a = e.slice().buffer;
|
|
1531
|
+
U({ type: "protocol", message: a, headers: i }, [a]);
|
|
1532
1532
|
}
|
|
1533
1533
|
} catch (i) {
|
|
1534
|
-
|
|
1534
|
+
M(i);
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
}), await
|
|
1537
|
+
}), await f.connect(t.entrypoints, { retry: t.retry });
|
|
1538
1538
|
}
|
|
1539
1539
|
self.addEventListener("message", (t) => {
|
|
1540
1540
|
const e = t.data;
|
|
1541
1541
|
if (e.type === "connect") {
|
|
1542
|
-
|
|
1543
|
-
|
|
1542
|
+
Gt(e).catch((s) => {
|
|
1543
|
+
lt.error(`Failed to connect: ${s}`), M(s), Q();
|
|
1544
1544
|
});
|
|
1545
1545
|
return;
|
|
1546
1546
|
}
|
|
1547
1547
|
if (e.type === "disconnect") {
|
|
1548
|
-
Q(),
|
|
1548
|
+
Q(), U({ type: "state", state: "idle" });
|
|
1549
1549
|
return;
|
|
1550
1550
|
}
|
|
1551
1551
|
if (e.type === "send") {
|
|
1552
|
-
if (!
|
|
1552
|
+
if (!f)
|
|
1553
1553
|
return;
|
|
1554
1554
|
try {
|
|
1555
1555
|
const s = new Uint8Array(e.message);
|
|
1556
|
-
|
|
1556
|
+
f.sendProtocolMessage(s), I && I.postMessage({ direction: "sent", message: Array.from(s) });
|
|
1557
1557
|
} catch (s) {
|
|
1558
|
-
|
|
1558
|
+
M(s);
|
|
1559
1559
|
}
|
|
1560
1560
|
return;
|
|
1561
1561
|
}
|
|
1562
1562
|
if (e.type === "setInterest") {
|
|
1563
|
-
|
|
1563
|
+
X = e.opcodeGroupsMask;
|
|
1564
1564
|
return;
|
|
1565
1565
|
}
|
|
1566
1566
|
if (e.type === "enableDevtools") {
|
|
1567
|
-
e.enabled && !
|
|
1567
|
+
e.enabled && !I ? I = new BroadcastChannel("ikon:devtools") : !e.enabled && I && (I.close(), I = null);
|
|
1568
1568
|
return;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (e.type === "setLogLevel") {
|
|
1571
|
-
|
|
1571
|
+
yt(e.level);
|
|
1572
1572
|
return;
|
|
1573
1573
|
}
|
|
1574
1574
|
if (e.type === "checkHealth") {
|
|
1575
|
-
|
|
1575
|
+
f?.checkHealth();
|
|
1576
1576
|
return;
|
|
1577
1577
|
}
|
|
1578
1578
|
if (e.type === "triggerReconnect") {
|
|
1579
|
-
|
|
1579
|
+
f?.triggerReconnect(e.reason);
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
1582
1582
|
if (e.type === "refreshedEntrypoints") {
|
|
1583
|
-
|
|
1583
|
+
v && (v({ entrypoints: e.entrypoints, sessionId: e.sessionId }), v = null, p = null);
|
|
1584
1584
|
return;
|
|
1585
1585
|
}
|
|
1586
1586
|
if (e.type === "refreshEntrypointsFailed") {
|
|
1587
|
-
|
|
1587
|
+
p && (p(new Error("Failed to refresh entrypoints")), v = null, p = null);
|
|
1588
1588
|
return;
|
|
1589
1589
|
}
|
|
1590
1590
|
if (e.type === "forwardToPorts") {
|
|
1591
1591
|
try {
|
|
1592
|
-
const s = new Uint8Array(e.message), r =
|
|
1592
|
+
const s = new Uint8Array(e.message), r = B(s), n = ht(r);
|
|
1593
1593
|
if (n.length > 0) {
|
|
1594
1594
|
const i = H(s);
|
|
1595
|
-
for (const
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1595
|
+
for (const l of n) {
|
|
1596
|
+
const o = s.slice().buffer;
|
|
1597
|
+
l.postMessage({ type: "protocol", message: o, headers: i }, [o]);
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
1600
|
} catch (s) {
|
|
1601
|
-
|
|
1601
|
+
M(s);
|
|
1602
1602
|
}
|
|
1603
1603
|
return;
|
|
1604
1604
|
}
|
|
@@ -1607,24 +1607,24 @@ self.addEventListener("message", (t) => {
|
|
|
1607
1607
|
e.port.start?.();
|
|
1608
1608
|
} catch {
|
|
1609
1609
|
}
|
|
1610
|
-
const s =
|
|
1611
|
-
|
|
1610
|
+
const s = m.length;
|
|
1611
|
+
m.push(e.portId), N.push({ port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }), F.set(e.portId, s);
|
|
1612
1612
|
return;
|
|
1613
1613
|
}
|
|
1614
1614
|
if (e.type === "detachPort") {
|
|
1615
|
-
const s =
|
|
1615
|
+
const s = F.get(e.portId);
|
|
1616
1616
|
if (s !== void 0) {
|
|
1617
|
-
const r =
|
|
1617
|
+
const r = N[s];
|
|
1618
1618
|
try {
|
|
1619
1619
|
r.port.close();
|
|
1620
1620
|
} catch {
|
|
1621
1621
|
}
|
|
1622
|
-
const n =
|
|
1622
|
+
const n = m.length - 1;
|
|
1623
1623
|
if (s !== n) {
|
|
1624
|
-
const i =
|
|
1625
|
-
|
|
1624
|
+
const i = m[n];
|
|
1625
|
+
m[s] = i, N[s] = N[n], F.set(i, s);
|
|
1626
1626
|
}
|
|
1627
|
-
|
|
1627
|
+
m.length--, N.length--, F.delete(e.portId);
|
|
1628
1628
|
}
|
|
1629
1629
|
return;
|
|
1630
1630
|
}
|
|
@@ -1636,15 +1636,15 @@ self.addEventListener("message", (t) => {
|
|
|
1636
1636
|
i.port.close();
|
|
1637
1637
|
} catch {
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1640
|
-
if (s !==
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1639
|
+
const l = y.length - 1;
|
|
1640
|
+
if (s !== l) {
|
|
1641
|
+
const o = y[l];
|
|
1642
|
+
y[s] = o, C[s] = C[l], L.set(o, s);
|
|
1643
1643
|
}
|
|
1644
|
-
|
|
1644
|
+
y.length--, C.length--, L.delete(e.portId);
|
|
1645
1645
|
}
|
|
1646
|
-
const r = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, n =
|
|
1647
|
-
|
|
1646
|
+
const r = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, n = y.length;
|
|
1647
|
+
y.push(e.portId), C.push(r), L.set(e.portId, n);
|
|
1648
1648
|
try {
|
|
1649
1649
|
r.port.start?.();
|
|
1650
1650
|
} catch {
|
|
@@ -1662,12 +1662,12 @@ self.addEventListener("message", (t) => {
|
|
|
1662
1662
|
r.port.close();
|
|
1663
1663
|
} catch {
|
|
1664
1664
|
}
|
|
1665
|
-
const n =
|
|
1665
|
+
const n = y.length - 1;
|
|
1666
1666
|
if (s !== n) {
|
|
1667
|
-
const i =
|
|
1668
|
-
|
|
1667
|
+
const i = y[n];
|
|
1668
|
+
y[s] = i, C[s] = C[n], L.set(i, s);
|
|
1669
1669
|
}
|
|
1670
|
-
|
|
1670
|
+
y.length--, C.length--, L.delete(e.portId);
|
|
1671
1671
|
}
|
|
1672
1672
|
return;
|
|
1673
1673
|
}
|