@ikonai/sdk 1.0.73 → 1.0.75
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-DLkTvKgj.js → audio-playback-worker-DDtsnLoq.js} +41 -41
- package/assets/{protocol-worker-BfR3vj38.js → protocol-worker-BoZcMF0x.js} +10 -10
- package/assets/{video-capture-worker-ZDlmU6Ta.js → video-capture-worker-DxgvFTcw.js} +372 -372
- package/assets/{video-playback-worker-BMnMLk3U.js → video-playback-worker-Ca4XVGqt.js} +20 -20
- package/assets/{viseme-worker-BOyyqInI.js → viseme-worker-DVWM4pRh.js} +9 -9
- package/client/ikon-client.d.ts +1 -0
- package/index.js +1831 -1772
- package/package.json +1 -1
|
@@ -4,16 +4,16 @@ function It(t) {
|
|
|
4
4
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
5
5
|
}
|
|
6
6
|
function st(t) {
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
7
|
+
const r = ht(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
8
|
+
if (r.length < 27)
|
|
9
9
|
throw new Error("Protocol payload too short");
|
|
10
|
-
const i =
|
|
11
|
-
if (27 + T * 4 >
|
|
10
|
+
const i = e.getUint32(0, !0), n = e.getUint32(4, !0), E = e.getUint32(8, !0), I = e.getUint32(12, !0), s = e.getUint32(16, !0), T = e.getUint32(20, !0), C = e.getUint8(24), _ = e.getUint8(25), a = e.getUint8(26);
|
|
11
|
+
if (27 + T * 4 > r.length)
|
|
12
12
|
throw new Error("Protocol header exceeds payload length");
|
|
13
13
|
const A = [];
|
|
14
14
|
let o = 27;
|
|
15
15
|
for (let R = 0; R < T; R++)
|
|
16
|
-
A.push(
|
|
16
|
+
A.push(e.getUint32(o, !0)), o += 4;
|
|
17
17
|
return {
|
|
18
18
|
length: i,
|
|
19
19
|
opcode: n,
|
|
@@ -26,203 +26,203 @@ function st(t) {
|
|
|
26
26
|
flags: a
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function K(t,
|
|
30
|
-
const E = n?.trackId ?? 0, I = n?.sequenceId ?? 0, s = n?.flags ?? 0, T = n?.targetIds ?? [], C = n?.payloadType ?? 8, _ = 27 + T.length * 4, a = _ +
|
|
31
|
-
A.setUint32(0, a, !0), A.setUint32(4, t >>> 0, !0), A.setUint32(8, i >>> 0, !0), A.setUint32(12, E >>> 0, !0), A.setUint32(16, I >>> 0, !0), A.setUint32(20, T.length >>> 0, !0), A.setUint8(24,
|
|
29
|
+
function K(t, r, e, i, n) {
|
|
30
|
+
const E = n?.trackId ?? 0, I = n?.sequenceId ?? 0, s = n?.flags ?? 0, T = n?.targetIds ?? [], C = n?.payloadType ?? 8, _ = 27 + T.length * 4, a = _ + r.length, h = new Uint8Array(a), A = new DataView(h.buffer);
|
|
31
|
+
A.setUint32(0, a, !0), A.setUint32(4, t >>> 0, !0), A.setUint32(8, i >>> 0, !0), A.setUint32(12, E >>> 0, !0), A.setUint32(16, I >>> 0, !0), A.setUint32(20, T.length >>> 0, !0), A.setUint8(24, e & 255), A.setUint8(25, C & 255), A.setUint8(26, s & 255);
|
|
32
32
|
let o = 27;
|
|
33
33
|
for (let R = 0; R < T.length; R++)
|
|
34
34
|
A.setUint32(o, T[R] >>> 0, !0), o += 4;
|
|
35
|
-
return h.set(
|
|
35
|
+
return h.set(r, _), h;
|
|
36
36
|
}
|
|
37
37
|
var c = /* @__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))(c || {});
|
|
38
38
|
const Tt = 161, At = 162, m = new TextEncoder();
|
|
39
39
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
40
40
|
class F {
|
|
41
|
-
constructor(
|
|
42
|
-
this.version =
|
|
41
|
+
constructor(r = 1) {
|
|
42
|
+
this.version = r, this.buffer.writeByte(Tt), this.buffer.writeVarUInt(r >>> 0);
|
|
43
43
|
}
|
|
44
44
|
buffer = new O();
|
|
45
45
|
closed = !1;
|
|
46
46
|
cached;
|
|
47
|
-
writeInt32Field(
|
|
48
|
-
this.writeFixedField(
|
|
47
|
+
writeInt32Field(r, e) {
|
|
48
|
+
this.writeFixedField(r, 3, () => this.buffer.writeInt32(e | 0));
|
|
49
49
|
}
|
|
50
|
-
writeUInt32Field(
|
|
51
|
-
this.writeFixedField(
|
|
50
|
+
writeUInt32Field(r, e) {
|
|
51
|
+
this.writeFixedField(r, 5, () => this.buffer.writeUInt32(e >>> 0));
|
|
52
52
|
}
|
|
53
|
-
writeInt64Field(
|
|
54
|
-
this.writeFixedField(
|
|
53
|
+
writeInt64Field(r, e) {
|
|
54
|
+
this.writeFixedField(r, 4, () => this.buffer.writeBigInt64(e));
|
|
55
55
|
}
|
|
56
|
-
writeUInt64Field(
|
|
57
|
-
this.writeFixedField(
|
|
56
|
+
writeUInt64Field(r, e) {
|
|
57
|
+
this.writeFixedField(r, 6, () => this.buffer.writeBigUInt64(e));
|
|
58
58
|
}
|
|
59
|
-
writeFloat32Field(
|
|
60
|
-
this.writeFixedField(
|
|
59
|
+
writeFloat32Field(r, e) {
|
|
60
|
+
this.writeFixedField(r, 7, () => this.buffer.writeFloat32(e));
|
|
61
61
|
}
|
|
62
|
-
writeFloat64Field(
|
|
63
|
-
this.writeFixedField(
|
|
62
|
+
writeFloat64Field(r, e) {
|
|
63
|
+
this.writeFixedField(r, 8, () => this.buffer.writeFloat64(e));
|
|
64
64
|
}
|
|
65
|
-
writeBoolField(
|
|
66
|
-
this.writeFixedField(
|
|
65
|
+
writeBoolField(r, e) {
|
|
66
|
+
this.writeFixedField(r, 2, () => this.buffer.writeByte(e ? 1 : 0));
|
|
67
67
|
}
|
|
68
|
-
writeGuidField(
|
|
69
|
-
const i =
|
|
68
|
+
writeGuidField(r, e) {
|
|
69
|
+
const i = e instanceof N ? e.asBytes() : e;
|
|
70
70
|
if (i.length !== 16)
|
|
71
71
|
throw new Error("Guid payload must be 16 bytes");
|
|
72
|
-
this.writeFixedField(
|
|
72
|
+
this.writeFixedField(r, 14, () => this.buffer.writeBytes(i));
|
|
73
73
|
}
|
|
74
|
-
writeStringField(
|
|
75
|
-
const i = m.encode(
|
|
76
|
-
this.writeVariableField(
|
|
74
|
+
writeStringField(r, e) {
|
|
75
|
+
const i = m.encode(e ?? "");
|
|
76
|
+
this.writeVariableField(r, 12, i);
|
|
77
77
|
}
|
|
78
|
-
writeBinaryField(
|
|
79
|
-
this.writeVariableField(
|
|
78
|
+
writeBinaryField(r, e) {
|
|
79
|
+
this.writeVariableField(r, 13, e);
|
|
80
80
|
}
|
|
81
|
-
writeObjectField(
|
|
82
|
-
const n = new F(
|
|
81
|
+
writeObjectField(r, e, i) {
|
|
82
|
+
const n = new F(e);
|
|
83
83
|
i(n);
|
|
84
84
|
const E = n.finish();
|
|
85
|
-
this.writeVariableField(
|
|
85
|
+
this.writeVariableField(r, 11, E);
|
|
86
86
|
}
|
|
87
|
-
writeArrayField(
|
|
88
|
-
const n = new B(
|
|
87
|
+
writeArrayField(r, e, i) {
|
|
88
|
+
const n = new B(e);
|
|
89
89
|
i(n);
|
|
90
90
|
const E = n.finish();
|
|
91
|
-
this.writeVariableField(
|
|
91
|
+
this.writeVariableField(r, 9, E);
|
|
92
92
|
}
|
|
93
|
-
writeDictionaryField(
|
|
94
|
-
const E = new
|
|
93
|
+
writeDictionaryField(r, e, i, n) {
|
|
94
|
+
const E = new Y(e, i);
|
|
95
95
|
n(E);
|
|
96
96
|
const I = E.finish();
|
|
97
|
-
this.writeVariableField(
|
|
97
|
+
this.writeVariableField(r, 10, I);
|
|
98
98
|
}
|
|
99
99
|
finish() {
|
|
100
100
|
return this.closed || (this.buffer.writeByte(At), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
|
|
101
101
|
}
|
|
102
|
-
writeFixedField(
|
|
103
|
-
this.writeFieldHeader(
|
|
102
|
+
writeFixedField(r, e, i) {
|
|
103
|
+
this.writeFieldHeader(r, e, 0), i();
|
|
104
104
|
}
|
|
105
|
-
writeVariableField(
|
|
106
|
-
this.writeFieldHeader(
|
|
105
|
+
writeVariableField(r, e, i) {
|
|
106
|
+
this.writeFieldHeader(r, e, i.length), this.buffer.writeBytes(i);
|
|
107
107
|
}
|
|
108
|
-
writeFieldHeader(
|
|
109
|
-
this.buffer.writeUInt32(
|
|
108
|
+
writeFieldHeader(r, e, i) {
|
|
109
|
+
this.buffer.writeUInt32(r >>> 0), this.buffer.writeByte(M(e)), Ct(e) && this.buffer.writeVarUInt(i >>> 0);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
class B {
|
|
113
|
-
constructor(
|
|
114
|
-
this.elementType =
|
|
113
|
+
constructor(r) {
|
|
114
|
+
this.elementType = r;
|
|
115
115
|
}
|
|
116
116
|
payload = new O();
|
|
117
117
|
count = 0;
|
|
118
|
-
writeInt32(
|
|
118
|
+
writeInt32(r) {
|
|
119
119
|
this.ensureElementType(
|
|
120
120
|
3
|
|
121
121
|
/* Int32 */
|
|
122
|
-
), this.count++, this.payload.writeInt32(
|
|
122
|
+
), this.count++, this.payload.writeInt32(r | 0);
|
|
123
123
|
}
|
|
124
|
-
writeUInt32(
|
|
124
|
+
writeUInt32(r) {
|
|
125
125
|
this.ensureElementType(
|
|
126
126
|
5
|
|
127
127
|
/* UInt32 */
|
|
128
|
-
), this.count++, this.payload.writeUInt32(
|
|
128
|
+
), this.count++, this.payload.writeUInt32(r >>> 0);
|
|
129
129
|
}
|
|
130
|
-
writeInt64(
|
|
130
|
+
writeInt64(r) {
|
|
131
131
|
this.ensureElementType(
|
|
132
132
|
4
|
|
133
133
|
/* Int64 */
|
|
134
|
-
), this.count++, this.payload.writeBigInt64(
|
|
134
|
+
), this.count++, this.payload.writeBigInt64(r);
|
|
135
135
|
}
|
|
136
|
-
writeUInt64(
|
|
136
|
+
writeUInt64(r) {
|
|
137
137
|
this.ensureElementType(
|
|
138
138
|
6
|
|
139
139
|
/* UInt64 */
|
|
140
|
-
), this.count++, this.payload.writeBigUInt64(
|
|
140
|
+
), this.count++, this.payload.writeBigUInt64(r);
|
|
141
141
|
}
|
|
142
|
-
writeFloat32(
|
|
142
|
+
writeFloat32(r) {
|
|
143
143
|
this.ensureElementType(
|
|
144
144
|
7
|
|
145
145
|
/* Float32 */
|
|
146
|
-
), this.count++, this.payload.writeFloat32(
|
|
146
|
+
), this.count++, this.payload.writeFloat32(r);
|
|
147
147
|
}
|
|
148
|
-
writeFloat64(
|
|
148
|
+
writeFloat64(r) {
|
|
149
149
|
this.ensureElementType(
|
|
150
150
|
8
|
|
151
151
|
/* Float64 */
|
|
152
|
-
), this.count++, this.payload.writeFloat64(
|
|
152
|
+
), this.count++, this.payload.writeFloat64(r);
|
|
153
153
|
}
|
|
154
|
-
writeBool(
|
|
154
|
+
writeBool(r) {
|
|
155
155
|
this.ensureElementType(
|
|
156
156
|
2
|
|
157
157
|
/* Bool */
|
|
158
|
-
), this.count++, this.payload.writeByte(
|
|
158
|
+
), this.count++, this.payload.writeByte(r ? 1 : 0);
|
|
159
159
|
}
|
|
160
|
-
writeGuid(
|
|
160
|
+
writeGuid(r) {
|
|
161
161
|
this.ensureElementType(
|
|
162
162
|
14
|
|
163
163
|
/* Guid */
|
|
164
164
|
), this.count++;
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
165
|
+
const e = r instanceof N ? r.asBytes() : r;
|
|
166
|
+
if (e.length !== 16)
|
|
167
167
|
throw new Error("Guid payload must be 16 bytes");
|
|
168
|
-
this.payload.writeBytes(
|
|
168
|
+
this.payload.writeBytes(e);
|
|
169
169
|
}
|
|
170
|
-
writeString(
|
|
170
|
+
writeString(r) {
|
|
171
171
|
this.ensureElementType(
|
|
172
172
|
12
|
|
173
173
|
/* String */
|
|
174
174
|
), this.count++;
|
|
175
|
-
const
|
|
176
|
-
this.payload.writeVarUInt(
|
|
175
|
+
const e = m.encode(r ?? "");
|
|
176
|
+
this.payload.writeVarUInt(e.length), this.payload.writeBytes(e);
|
|
177
177
|
}
|
|
178
|
-
writeBinary(
|
|
178
|
+
writeBinary(r) {
|
|
179
179
|
this.ensureElementType(
|
|
180
180
|
13
|
|
181
181
|
/* Binary */
|
|
182
|
-
), this.count++, this.payload.writeVarUInt(
|
|
182
|
+
), this.count++, this.payload.writeVarUInt(r.length), this.payload.writeBytes(r);
|
|
183
183
|
}
|
|
184
|
-
writeObject(
|
|
184
|
+
writeObject(r, e) {
|
|
185
185
|
this.ensureElementType(
|
|
186
186
|
11
|
|
187
187
|
/* Object */
|
|
188
188
|
), this.count++;
|
|
189
|
-
const i = new F(
|
|
190
|
-
|
|
189
|
+
const i = new F(r);
|
|
190
|
+
e(i);
|
|
191
191
|
const n = i.finish();
|
|
192
192
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n);
|
|
193
193
|
}
|
|
194
|
-
writeArray(
|
|
194
|
+
writeArray(r, e) {
|
|
195
195
|
this.ensureElementType(
|
|
196
196
|
9
|
|
197
197
|
/* Array */
|
|
198
198
|
), this.count++;
|
|
199
|
-
const i = new B(
|
|
200
|
-
|
|
199
|
+
const i = new B(r);
|
|
200
|
+
e(i);
|
|
201
201
|
const n = i.finish();
|
|
202
202
|
this.payload.writeBytes(n);
|
|
203
203
|
}
|
|
204
|
-
writeDictionary(
|
|
204
|
+
writeDictionary(r, e, i) {
|
|
205
205
|
this.ensureElementType(
|
|
206
206
|
10
|
|
207
207
|
/* Dict */
|
|
208
208
|
), this.count++;
|
|
209
|
-
const n = new
|
|
209
|
+
const n = new Y(r, e);
|
|
210
210
|
i(n);
|
|
211
211
|
const E = n.finish();
|
|
212
212
|
this.payload.writeBytes(E);
|
|
213
213
|
}
|
|
214
214
|
finish() {
|
|
215
|
-
const
|
|
216
|
-
return
|
|
215
|
+
const r = new O();
|
|
216
|
+
return r.writeByte(M(this.elementType)), r.writeVarUInt(this.count), r.writeBytes(this.payload.toUint8Array()), r.toUint8Array();
|
|
217
217
|
}
|
|
218
|
-
ensureElementType(
|
|
219
|
-
if (this.elementType !==
|
|
220
|
-
throw new Error(`Array element type is ${c[this.elementType]}, expected ${c[
|
|
218
|
+
ensureElementType(r) {
|
|
219
|
+
if (this.elementType !== r)
|
|
220
|
+
throw new Error(`Array element type is ${c[this.elementType]}, expected ${c[r]}`);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
class
|
|
224
|
-
constructor(
|
|
225
|
-
this.keyType =
|
|
223
|
+
class Y {
|
|
224
|
+
constructor(r, e) {
|
|
225
|
+
this.keyType = r, this.valueType = e, Rt(r);
|
|
226
226
|
}
|
|
227
227
|
payload = new O();
|
|
228
228
|
count = 0;
|
|
@@ -237,134 +237,134 @@ class v {
|
|
|
237
237
|
finish() {
|
|
238
238
|
if (this.entryOpen)
|
|
239
239
|
throw new Error("Dictionary entry not completed");
|
|
240
|
-
const
|
|
241
|
-
return
|
|
240
|
+
const r = new O();
|
|
241
|
+
return r.writeByte(M(this.keyType)), r.writeByte(M(this.valueType)), r.writeVarUInt(this.count), r.writeBytes(this.payload.toUint8Array()), r.toUint8Array();
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
class Nt {
|
|
245
|
-
constructor(
|
|
246
|
-
this.keyType =
|
|
245
|
+
constructor(r, e, i, n) {
|
|
246
|
+
this.keyType = r, this.valueType = e, this.payload = i, this.onComplete = n;
|
|
247
247
|
}
|
|
248
248
|
keyWritten = !1;
|
|
249
249
|
valueWritten = !1;
|
|
250
250
|
completed = !1;
|
|
251
|
-
writeKeyInt32(
|
|
251
|
+
writeKeyInt32(r) {
|
|
252
252
|
this.ensureKeyType(
|
|
253
253
|
3
|
|
254
254
|
/* Int32 */
|
|
255
|
-
), this.payload.writeInt32(
|
|
255
|
+
), this.payload.writeInt32(r | 0), this.keyWritten = !0;
|
|
256
256
|
}
|
|
257
|
-
writeKeyUInt32(
|
|
257
|
+
writeKeyUInt32(r) {
|
|
258
258
|
this.ensureKeyType(
|
|
259
259
|
5
|
|
260
260
|
/* UInt32 */
|
|
261
|
-
), this.payload.writeUInt32(
|
|
261
|
+
), this.payload.writeUInt32(r >>> 0), this.keyWritten = !0;
|
|
262
262
|
}
|
|
263
|
-
writeKeyInt64(
|
|
263
|
+
writeKeyInt64(r) {
|
|
264
264
|
this.ensureKeyType(
|
|
265
265
|
4
|
|
266
266
|
/* Int64 */
|
|
267
|
-
), this.payload.writeBigInt64(
|
|
267
|
+
), this.payload.writeBigInt64(r), this.keyWritten = !0;
|
|
268
268
|
}
|
|
269
|
-
writeKeyUInt64(
|
|
269
|
+
writeKeyUInt64(r) {
|
|
270
270
|
this.ensureKeyType(
|
|
271
271
|
6
|
|
272
272
|
/* UInt64 */
|
|
273
|
-
), this.payload.writeBigUInt64(
|
|
273
|
+
), this.payload.writeBigUInt64(r), this.keyWritten = !0;
|
|
274
274
|
}
|
|
275
|
-
writeKeyFloat32(
|
|
275
|
+
writeKeyFloat32(r) {
|
|
276
276
|
this.ensureKeyType(
|
|
277
277
|
7
|
|
278
278
|
/* Float32 */
|
|
279
|
-
), this.payload.writeFloat32(
|
|
279
|
+
), this.payload.writeFloat32(r), this.keyWritten = !0;
|
|
280
280
|
}
|
|
281
|
-
writeKeyFloat64(
|
|
281
|
+
writeKeyFloat64(r) {
|
|
282
282
|
this.ensureKeyType(
|
|
283
283
|
8
|
|
284
284
|
/* Float64 */
|
|
285
|
-
), this.payload.writeFloat64(
|
|
285
|
+
), this.payload.writeFloat64(r), this.keyWritten = !0;
|
|
286
286
|
}
|
|
287
|
-
writeKeyBool(
|
|
287
|
+
writeKeyBool(r) {
|
|
288
288
|
this.ensureKeyType(
|
|
289
289
|
2
|
|
290
290
|
/* Bool */
|
|
291
|
-
), this.payload.writeByte(
|
|
291
|
+
), this.payload.writeByte(r ? 1 : 0), this.keyWritten = !0;
|
|
292
292
|
}
|
|
293
|
-
writeKeyGuid(
|
|
293
|
+
writeKeyGuid(r) {
|
|
294
294
|
this.ensureKeyType(
|
|
295
295
|
14
|
|
296
296
|
/* Guid */
|
|
297
297
|
);
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
298
|
+
const e = r instanceof N ? r.asBytes() : r;
|
|
299
|
+
if (e.length !== 16)
|
|
300
300
|
throw new Error("Guid payload must be 16 bytes");
|
|
301
|
-
this.payload.writeBytes(
|
|
301
|
+
this.payload.writeBytes(e), this.keyWritten = !0;
|
|
302
302
|
}
|
|
303
|
-
writeKeyString(
|
|
303
|
+
writeKeyString(r) {
|
|
304
304
|
this.ensureKeyType(
|
|
305
305
|
12
|
|
306
306
|
/* String */
|
|
307
307
|
);
|
|
308
|
-
const
|
|
309
|
-
this.payload.writeVarUInt(
|
|
308
|
+
const e = m.encode(r ?? "");
|
|
309
|
+
this.payload.writeVarUInt(e.length), this.payload.writeBytes(e), this.keyWritten = !0;
|
|
310
310
|
}
|
|
311
|
-
writeKeyBinary(
|
|
311
|
+
writeKeyBinary(r) {
|
|
312
312
|
this.ensureKeyType(
|
|
313
313
|
13
|
|
314
314
|
/* Binary */
|
|
315
|
-
), this.payload.writeVarUInt(
|
|
315
|
+
), this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.keyWritten = !0;
|
|
316
316
|
}
|
|
317
|
-
writeValueInt32(
|
|
317
|
+
writeValueInt32(r) {
|
|
318
318
|
this.ensureValueType(
|
|
319
319
|
3
|
|
320
320
|
/* Int32 */
|
|
321
|
-
), this.payload.writeInt32(
|
|
321
|
+
), this.payload.writeInt32(r | 0), this.valueWritten = !0;
|
|
322
322
|
}
|
|
323
|
-
writeValueUInt32(
|
|
323
|
+
writeValueUInt32(r) {
|
|
324
324
|
this.ensureValueType(
|
|
325
325
|
5
|
|
326
326
|
/* UInt32 */
|
|
327
|
-
), this.payload.writeUInt32(
|
|
327
|
+
), this.payload.writeUInt32(r >>> 0), this.valueWritten = !0;
|
|
328
328
|
}
|
|
329
|
-
writeValueInt64(
|
|
329
|
+
writeValueInt64(r) {
|
|
330
330
|
this.ensureValueType(
|
|
331
331
|
4
|
|
332
332
|
/* Int64 */
|
|
333
|
-
), this.payload.writeBigInt64(
|
|
333
|
+
), this.payload.writeBigInt64(r), this.valueWritten = !0;
|
|
334
334
|
}
|
|
335
|
-
writeValueUInt64(
|
|
335
|
+
writeValueUInt64(r) {
|
|
336
336
|
this.ensureValueType(
|
|
337
337
|
6
|
|
338
338
|
/* UInt64 */
|
|
339
|
-
), this.payload.writeBigUInt64(
|
|
339
|
+
), this.payload.writeBigUInt64(r), this.valueWritten = !0;
|
|
340
340
|
}
|
|
341
|
-
writeValueFloat32(
|
|
341
|
+
writeValueFloat32(r) {
|
|
342
342
|
this.ensureValueType(
|
|
343
343
|
7
|
|
344
344
|
/* Float32 */
|
|
345
|
-
), this.payload.writeFloat32(
|
|
345
|
+
), this.payload.writeFloat32(r), this.valueWritten = !0;
|
|
346
346
|
}
|
|
347
|
-
writeValueFloat64(
|
|
347
|
+
writeValueFloat64(r) {
|
|
348
348
|
this.ensureValueType(
|
|
349
349
|
8
|
|
350
350
|
/* Float64 */
|
|
351
|
-
), this.payload.writeFloat64(
|
|
351
|
+
), this.payload.writeFloat64(r), this.valueWritten = !0;
|
|
352
352
|
}
|
|
353
|
-
writeValueBool(
|
|
353
|
+
writeValueBool(r) {
|
|
354
354
|
this.ensureValueType(
|
|
355
355
|
2
|
|
356
356
|
/* Bool */
|
|
357
|
-
), this.payload.writeByte(
|
|
357
|
+
), this.payload.writeByte(r ? 1 : 0), this.valueWritten = !0;
|
|
358
358
|
}
|
|
359
|
-
writeValueGuid(
|
|
359
|
+
writeValueGuid(r) {
|
|
360
360
|
this.ensureValueType(
|
|
361
361
|
14
|
|
362
362
|
/* Guid */
|
|
363
363
|
);
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
364
|
+
const e = r instanceof N ? r.asBytes() : r;
|
|
365
|
+
if (e.length !== 16)
|
|
366
366
|
throw new Error("Guid payload must be 16 bytes");
|
|
367
|
-
this.payload.writeBytes(
|
|
367
|
+
this.payload.writeBytes(e), this.valueWritten = !0;
|
|
368
368
|
}
|
|
369
369
|
writeNullValue() {
|
|
370
370
|
this.ensureValueType(
|
|
@@ -372,46 +372,46 @@ class Nt {
|
|
|
372
372
|
/* Null */
|
|
373
373
|
), this.valueWritten = !0;
|
|
374
374
|
}
|
|
375
|
-
writeValueBinary(
|
|
375
|
+
writeValueBinary(r) {
|
|
376
376
|
this.ensureValueType(
|
|
377
377
|
13
|
|
378
378
|
/* Binary */
|
|
379
|
-
), this.payload.writeVarUInt(
|
|
379
|
+
), this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.valueWritten = !0;
|
|
380
380
|
}
|
|
381
|
-
writeValueString(
|
|
381
|
+
writeValueString(r) {
|
|
382
382
|
this.ensureValueType(
|
|
383
383
|
12
|
|
384
384
|
/* String */
|
|
385
385
|
);
|
|
386
|
-
const
|
|
387
|
-
this.payload.writeVarUInt(
|
|
386
|
+
const e = m.encode(r ?? "");
|
|
387
|
+
this.payload.writeVarUInt(e.length), this.payload.writeBytes(e), this.valueWritten = !0;
|
|
388
388
|
}
|
|
389
|
-
writeValueObject(
|
|
389
|
+
writeValueObject(r, e) {
|
|
390
390
|
this.ensureValueType(
|
|
391
391
|
11
|
|
392
392
|
/* Object */
|
|
393
393
|
);
|
|
394
|
-
const i = new F(
|
|
395
|
-
|
|
394
|
+
const i = new F(r);
|
|
395
|
+
e(i);
|
|
396
396
|
const n = i.finish();
|
|
397
397
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.valueWritten = !0;
|
|
398
398
|
}
|
|
399
|
-
writeValueArray(
|
|
399
|
+
writeValueArray(r, e) {
|
|
400
400
|
this.ensureValueType(
|
|
401
401
|
9
|
|
402
402
|
/* Array */
|
|
403
403
|
);
|
|
404
|
-
const i = new B(
|
|
405
|
-
|
|
404
|
+
const i = new B(r);
|
|
405
|
+
e(i);
|
|
406
406
|
const n = i.finish();
|
|
407
407
|
this.payload.writeBytes(n), this.valueWritten = !0;
|
|
408
408
|
}
|
|
409
|
-
writeValueDictionary(
|
|
409
|
+
writeValueDictionary(r, e, i) {
|
|
410
410
|
this.ensureValueType(
|
|
411
411
|
10
|
|
412
412
|
/* Dict */
|
|
413
413
|
);
|
|
414
|
-
const n = new
|
|
414
|
+
const n = new Y(r, e);
|
|
415
415
|
i(n);
|
|
416
416
|
const E = n.finish();
|
|
417
417
|
this.payload.writeBytes(E), this.valueWritten = !0;
|
|
@@ -423,83 +423,83 @@ class Nt {
|
|
|
423
423
|
this.completed = !0, this.onComplete();
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
ensureKeyType(
|
|
427
|
-
if (this.keyType !==
|
|
428
|
-
throw new Error(`Dictionary key type is ${c[this.keyType]}, expected ${c[
|
|
426
|
+
ensureKeyType(r) {
|
|
427
|
+
if (this.keyType !== r)
|
|
428
|
+
throw new Error(`Dictionary key type is ${c[this.keyType]}, expected ${c[r]}`);
|
|
429
429
|
}
|
|
430
|
-
ensureValueType(
|
|
431
|
-
if (this.valueType !==
|
|
432
|
-
throw new Error(`Dictionary value type is ${c[this.valueType]}, expected ${c[
|
|
430
|
+
ensureValueType(r) {
|
|
431
|
+
if (this.valueType !== r)
|
|
432
|
+
throw new Error(`Dictionary value type is ${c[this.valueType]}, expected ${c[r]}`);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
class N {
|
|
436
|
-
constructor(
|
|
437
|
-
this.bytes =
|
|
436
|
+
constructor(r) {
|
|
437
|
+
this.bytes = r;
|
|
438
438
|
}
|
|
439
|
-
static fromString(
|
|
440
|
-
if (!
|
|
439
|
+
static fromString(r) {
|
|
440
|
+
if (!r)
|
|
441
441
|
throw new Error("Guid string is empty");
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
442
|
+
const e = r.replace(/-/g, "");
|
|
443
|
+
if (e.length !== 32)
|
|
444
444
|
throw new Error("Guid string must be 32 hex characters");
|
|
445
|
-
const i = new Uint8Array(16), n = N.parseHexSlice(
|
|
445
|
+
const i = new Uint8Array(16), n = N.parseHexSlice(e, 0, 8), E = N.parseHexSlice(e, 8, 4), I = N.parseHexSlice(e, 12, 4);
|
|
446
446
|
N.writeUInt32LE(i, 0, n), N.writeUInt16LE(i, 4, E), N.writeUInt16LE(i, 6, I);
|
|
447
447
|
for (let s = 0; s < 8; s++)
|
|
448
|
-
i[8 + s] = N.parseHexSlice(
|
|
448
|
+
i[8 + s] = N.parseHexSlice(e, 16 + s * 2, 2);
|
|
449
449
|
return new N(i);
|
|
450
450
|
}
|
|
451
|
-
static fromBytes(
|
|
452
|
-
if (
|
|
451
|
+
static fromBytes(r) {
|
|
452
|
+
if (r.length !== 16)
|
|
453
453
|
throw new Error("Guid byte array must be 16 bytes");
|
|
454
|
-
return new N(Uint8Array.from(
|
|
454
|
+
return new N(Uint8Array.from(r));
|
|
455
455
|
}
|
|
456
456
|
static createZero() {
|
|
457
457
|
return new N(new Uint8Array(16));
|
|
458
458
|
}
|
|
459
459
|
static createRandom() {
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
462
|
-
|
|
460
|
+
const r = new Uint8Array(16), e = globalThis.crypto;
|
|
461
|
+
if (e?.getRandomValues)
|
|
462
|
+
e.getRandomValues(r);
|
|
463
463
|
else
|
|
464
|
-
for (let i = 0; i <
|
|
465
|
-
|
|
466
|
-
return
|
|
464
|
+
for (let i = 0; i < r.length; i++)
|
|
465
|
+
r[i] = Math.floor(Math.random() * 256);
|
|
466
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new N(r);
|
|
467
467
|
}
|
|
468
468
|
toString() {
|
|
469
|
-
const
|
|
469
|
+
const r = this.bytes;
|
|
470
470
|
return [
|
|
471
|
-
N.toHex(N.readUInt32LE(
|
|
472
|
-
N.toHex(N.readUInt16LE(
|
|
473
|
-
N.toHex(N.readUInt16LE(
|
|
474
|
-
J(
|
|
475
|
-
J(
|
|
471
|
+
N.toHex(N.readUInt32LE(r, 0), 8),
|
|
472
|
+
N.toHex(N.readUInt16LE(r, 4), 4),
|
|
473
|
+
N.toHex(N.readUInt16LE(r, 6), 4),
|
|
474
|
+
J(r.subarray(8, 10)),
|
|
475
|
+
J(r.subarray(10, 16))
|
|
476
476
|
].join("-");
|
|
477
477
|
}
|
|
478
478
|
asBytes() {
|
|
479
479
|
return this.bytes.slice();
|
|
480
480
|
}
|
|
481
|
-
static parseHexSlice(
|
|
482
|
-
const n =
|
|
481
|
+
static parseHexSlice(r, e, i) {
|
|
482
|
+
const n = r.substr(e, i), E = Number.parseInt(n, 16);
|
|
483
483
|
if (Number.isNaN(E))
|
|
484
484
|
throw new Error("Guid string contains invalid characters");
|
|
485
485
|
return E >>> 0;
|
|
486
486
|
}
|
|
487
|
-
static writeUInt32LE(
|
|
487
|
+
static writeUInt32LE(r, e, i) {
|
|
488
488
|
const n = i >>> 0;
|
|
489
|
-
e
|
|
489
|
+
r[e] = n & 255, r[e + 1] = n >>> 8 & 255, r[e + 2] = n >>> 16 & 255, r[e + 3] = n >>> 24 & 255;
|
|
490
490
|
}
|
|
491
|
-
static writeUInt16LE(
|
|
491
|
+
static writeUInt16LE(r, e, i) {
|
|
492
492
|
const n = i & 65535;
|
|
493
|
-
e
|
|
493
|
+
r[e] = n & 255, r[e + 1] = n >>> 8 & 255;
|
|
494
494
|
}
|
|
495
|
-
static readUInt32LE(
|
|
496
|
-
return (e
|
|
495
|
+
static readUInt32LE(r, e) {
|
|
496
|
+
return (r[e] | r[e + 1] << 8 | r[e + 2] << 16 | r[e + 3] << 24) >>> 0;
|
|
497
497
|
}
|
|
498
|
-
static readUInt16LE(
|
|
499
|
-
return (e
|
|
498
|
+
static readUInt16LE(r, e) {
|
|
499
|
+
return (r[e] | r[e + 1] << 8) & 65535;
|
|
500
500
|
}
|
|
501
|
-
static toHex(
|
|
502
|
-
return (
|
|
501
|
+
static toHex(r, e) {
|
|
502
|
+
return (r >>> 0).toString(16).padStart(e, "0");
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
class O {
|
|
@@ -510,54 +510,54 @@ class O {
|
|
|
510
510
|
constructor() {
|
|
511
511
|
this.buffer = new Uint8Array(O.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
|
|
512
512
|
}
|
|
513
|
-
ensureCapacity(
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
513
|
+
ensureCapacity(r) {
|
|
514
|
+
const e = this.length + r;
|
|
515
|
+
if (e <= this.buffer.length)
|
|
516
516
|
return;
|
|
517
517
|
let i = this.buffer.length;
|
|
518
|
-
for (; i <
|
|
518
|
+
for (; i < e; )
|
|
519
519
|
i *= 2;
|
|
520
520
|
const n = new Uint8Array(i);
|
|
521
521
|
n.set(this.buffer.subarray(0, this.length)), this.buffer = n, this.dataView = new DataView(this.buffer.buffer);
|
|
522
522
|
}
|
|
523
|
-
writeByte(
|
|
524
|
-
this.ensureCapacity(1), this.buffer[this.length++] =
|
|
523
|
+
writeByte(r) {
|
|
524
|
+
this.ensureCapacity(1), this.buffer[this.length++] = r & 255;
|
|
525
525
|
}
|
|
526
|
-
writeBytes(
|
|
527
|
-
this.ensureCapacity(
|
|
526
|
+
writeBytes(r) {
|
|
527
|
+
this.ensureCapacity(r.length), this.buffer.set(r, this.length), this.length += r.length;
|
|
528
528
|
}
|
|
529
|
-
writeUInt32(
|
|
530
|
-
this.ensureCapacity(4), this.dataView.setUint32(this.length,
|
|
529
|
+
writeUInt32(r) {
|
|
530
|
+
this.ensureCapacity(4), this.dataView.setUint32(this.length, r >>> 0, !0), this.length += 4;
|
|
531
531
|
}
|
|
532
|
-
writeInt32(
|
|
533
|
-
this.ensureCapacity(4), this.dataView.setInt32(this.length,
|
|
532
|
+
writeInt32(r) {
|
|
533
|
+
this.ensureCapacity(4), this.dataView.setInt32(this.length, r | 0, !0), this.length += 4;
|
|
534
534
|
}
|
|
535
|
-
writeFloat32(
|
|
536
|
-
this.ensureCapacity(4), this.dataView.setFloat32(this.length,
|
|
535
|
+
writeFloat32(r) {
|
|
536
|
+
this.ensureCapacity(4), this.dataView.setFloat32(this.length, r, !0), this.length += 4;
|
|
537
537
|
}
|
|
538
|
-
writeFloat64(
|
|
539
|
-
this.ensureCapacity(8), this.dataView.setFloat64(this.length,
|
|
538
|
+
writeFloat64(r) {
|
|
539
|
+
this.ensureCapacity(8), this.dataView.setFloat64(this.length, r, !0), this.length += 8;
|
|
540
540
|
}
|
|
541
|
-
writeBigInt64(
|
|
542
|
-
this.ensureCapacity(8), this.dataView.setBigInt64(this.length,
|
|
541
|
+
writeBigInt64(r) {
|
|
542
|
+
this.ensureCapacity(8), this.dataView.setBigInt64(this.length, r, !0), this.length += 8;
|
|
543
543
|
}
|
|
544
|
-
writeBigUInt64(
|
|
545
|
-
this.ensureCapacity(8), this.dataView.setBigUint64(this.length,
|
|
544
|
+
writeBigUInt64(r) {
|
|
545
|
+
this.ensureCapacity(8), this.dataView.setBigUint64(this.length, r, !0), this.length += 8;
|
|
546
546
|
}
|
|
547
|
-
writeVarUInt(
|
|
548
|
-
let
|
|
549
|
-
for (;
|
|
550
|
-
this.ensureCapacity(1), this.buffer[this.length++] =
|
|
551
|
-
this.ensureCapacity(1), this.buffer[this.length++] =
|
|
547
|
+
writeVarUInt(r) {
|
|
548
|
+
let e = r >>> 0;
|
|
549
|
+
for (; e >= 128; )
|
|
550
|
+
this.ensureCapacity(1), this.buffer[this.length++] = e & 127 | 128, e >>>= 7;
|
|
551
|
+
this.ensureCapacity(1), this.buffer[this.length++] = e & 127;
|
|
552
552
|
}
|
|
553
553
|
toUint8Array() {
|
|
554
554
|
return this.buffer.slice(0, this.length);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function M(t,
|
|
558
|
-
if ((
|
|
557
|
+
function M(t, r = 0) {
|
|
558
|
+
if ((r & 240) !== 0)
|
|
559
559
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
560
|
-
return (t & 15) << 4 |
|
|
560
|
+
return (t & 15) << 4 | r & 15;
|
|
561
561
|
}
|
|
562
562
|
function Ct(t) {
|
|
563
563
|
return t === 12 || t === 13 || t === 9 || t === 11 || t === 10;
|
|
@@ -567,65 +567,65 @@ function Rt(t) {
|
|
|
567
567
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
568
568
|
}
|
|
569
569
|
function J(t) {
|
|
570
|
-
return Array.from(t).map((
|
|
570
|
+
return Array.from(t).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
571
571
|
}
|
|
572
572
|
function ht(t) {
|
|
573
573
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
574
574
|
}
|
|
575
|
-
var u = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(u || {}), Z = /* @__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.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))(Z || {});
|
|
576
|
-
const p = 1, ut = 8388611, ot = 271275304,
|
|
577
|
-
function
|
|
578
|
-
const
|
|
579
|
-
return Lt(
|
|
575
|
+
var u = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(u || {}), Z = /* @__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))(Z || {});
|
|
576
|
+
const p = 1, ut = 8388611, ot = 271275304, Ut = 2541432218, lt = 2986785889, ft = 3105403172, St = 3456383222;
|
|
577
|
+
function v(t) {
|
|
578
|
+
const r = {};
|
|
579
|
+
return Lt(r), t && Object.assign(r, t), r;
|
|
580
580
|
}
|
|
581
581
|
function Lt(t) {
|
|
582
582
|
return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
|
|
583
583
|
}
|
|
584
584
|
function Dt(t) {
|
|
585
|
-
const
|
|
586
|
-
return yt(t,
|
|
585
|
+
const r = new F(p);
|
|
586
|
+
return yt(t, r), r.finish();
|
|
587
587
|
}
|
|
588
|
-
function yt(t,
|
|
589
|
-
|
|
588
|
+
function yt(t, r) {
|
|
589
|
+
r.writeUInt64Field(ot, t.TimestampInUs), r.writeUInt32Field(Ut, t.DurationInUs >>> 0), r.writeBinaryField(lt, t.Data), r.writeBoolField(ft, t.IsKey), r.writeInt32Field(St, t.FrameNumber | 0);
|
|
590
590
|
}
|
|
591
|
-
function W(t,
|
|
591
|
+
function W(t, r, e) {
|
|
592
592
|
const i = Dt(t);
|
|
593
|
-
return K(ut, i, p,
|
|
593
|
+
return K(ut, i, p, r, e);
|
|
594
594
|
}
|
|
595
595
|
const tt = 6, wt = 8388609, ct = 161083277, Ot = 164808083, Pt = 1368629611, Ft = 2514959030, gt = 2745379226, Vt = 2950031986, mt = 3282782683, Mt = 3284746250, Bt = 4065070594;
|
|
596
596
|
function k(t) {
|
|
597
|
-
const
|
|
598
|
-
return dt(
|
|
597
|
+
const r = {};
|
|
598
|
+
return dt(r), t && Object.assign(r, t), r;
|
|
599
599
|
}
|
|
600
600
|
function dt(t) {
|
|
601
601
|
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = u.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t.CorrelationId = void 0, t;
|
|
602
602
|
}
|
|
603
603
|
function Gt(t) {
|
|
604
|
-
const
|
|
605
|
-
return bt(t,
|
|
604
|
+
const r = new F(tt);
|
|
605
|
+
return bt(t, r), r.finish();
|
|
606
606
|
}
|
|
607
|
-
function bt(t,
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
|
|
607
|
+
function bt(t, r) {
|
|
608
|
+
r.writeStringField(ct, t.StreamId), r.writeFloat64Field(Ot, t.Framerate), r.writeStringField(Pt, t.Description);
|
|
609
|
+
const e = t.CorrelationId;
|
|
610
|
+
e != null && r.writeStringField(Ft, e), r.writeStringField(gt, t.CodecDetails), r.writeInt32Field(Vt, t.Height | 0), r.writeStringField(mt, t.SourceType), r.writeInt32Field(Mt, t.Codec), r.writeInt32Field(Bt, t.Width | 0);
|
|
611
611
|
}
|
|
612
|
-
function $(t,
|
|
612
|
+
function $(t, r, e) {
|
|
613
613
|
const i = Gt(t);
|
|
614
|
-
return K(wt, i, tt,
|
|
614
|
+
return K(wt, i, tt, r, e);
|
|
615
615
|
}
|
|
616
|
-
const
|
|
616
|
+
const rt = 1, Ht = 8388610;
|
|
617
617
|
function Kt(t) {
|
|
618
|
-
const
|
|
619
|
-
return t && Object.assign(
|
|
618
|
+
const r = {};
|
|
619
|
+
return t && Object.assign(r, t), r;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
return new F(
|
|
621
|
+
function Yt(t) {
|
|
622
|
+
return new F(rt).finish();
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
const i =
|
|
626
|
-
return K(Ht, i,
|
|
624
|
+
function vt(t, r, e) {
|
|
625
|
+
const i = Yt();
|
|
626
|
+
return K(Ht, i, rt, r, e);
|
|
627
627
|
}
|
|
628
|
-
const b = 30, Wt = 90,
|
|
628
|
+
const b = 30, Wt = 90, et = [
|
|
629
629
|
"avc1.42001f",
|
|
630
630
|
// Baseline L3.1 (720p60, 1080p30)
|
|
631
631
|
"avc1.4d001f",
|
|
@@ -639,7 +639,7 @@ const b = 30, Wt = 90, rt = [
|
|
|
639
639
|
"avc1.4d0028"
|
|
640
640
|
// Main L4.0 (1080p)
|
|
641
641
|
];
|
|
642
|
-
|
|
642
|
+
et[0];
|
|
643
643
|
const kt = "vp8", it = [
|
|
644
644
|
"vp09.00.10.08",
|
|
645
645
|
// Profile 0, Level 1.0, 8-bit (most compatible)
|
|
@@ -675,47 +675,47 @@ const q = ["h264", "vp8", "vp9", "av1"], $t = [
|
|
|
675
675
|
// 360p
|
|
676
676
|
], xt = 0.1, Xt = 30, Qt = 5e4, jt = 5e5, zt = 8e6, Jt = 8, qt = 3, w = (t) => self.postMessage(t);
|
|
677
677
|
let S = null, y = null;
|
|
678
|
-
function D(t,
|
|
679
|
-
const
|
|
680
|
-
w({ type: "error", captureId:
|
|
678
|
+
function D(t, r) {
|
|
679
|
+
const e = t instanceof Error ? t : new Error(String(t));
|
|
680
|
+
w({ type: "error", captureId: r, error: { name: e.name, message: e.message, stack: e.stack } });
|
|
681
681
|
}
|
|
682
682
|
function H(t) {
|
|
683
683
|
if (!Array.isArray(t) || t.length === 0)
|
|
684
684
|
return q.slice();
|
|
685
|
-
const
|
|
685
|
+
const r = [];
|
|
686
686
|
for (const i of t)
|
|
687
|
-
(i === "h264" || i === "vp8" || i === "vp9" || i === "av1") &&
|
|
688
|
-
if (
|
|
687
|
+
(i === "h264" || i === "vp8" || i === "vp9" || i === "av1") && r.push(i);
|
|
688
|
+
if (r.length === 0)
|
|
689
689
|
return q.slice();
|
|
690
|
-
const
|
|
691
|
-
for (const i of
|
|
692
|
-
|
|
693
|
-
return Array.from(
|
|
690
|
+
const e = /* @__PURE__ */ new Set();
|
|
691
|
+
for (const i of r)
|
|
692
|
+
e.add(i);
|
|
693
|
+
return Array.from(e);
|
|
694
694
|
}
|
|
695
695
|
function Zt(t) {
|
|
696
696
|
return t === "h264" ? u.H264 : t === "vp8" ? u.Vp8 : t === "vp9" ? u.Vp9 : t === "av1" ? u.Av1 : u.Unknown;
|
|
697
697
|
}
|
|
698
698
|
const pt = {
|
|
699
699
|
[u.Unknown]: [],
|
|
700
|
-
[u.H264]:
|
|
700
|
+
[u.H264]: et,
|
|
701
701
|
[u.Vp8]: [kt],
|
|
702
702
|
[u.Vp9]: it,
|
|
703
703
|
[u.Av1]: nt
|
|
704
704
|
};
|
|
705
|
-
function
|
|
706
|
-
const n = t *
|
|
705
|
+
function tr(t, r, e, i) {
|
|
706
|
+
const n = t * r, E = xt * (e / Xt), I = Math.floor(n * E);
|
|
707
707
|
return Math.max(Qt, Math.floor(i ?? Math.max(jt, Math.min(I, zt))));
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const
|
|
709
|
+
function rr(t, r) {
|
|
710
|
+
const e = [{ width: t, height: r }];
|
|
711
711
|
for (const i of $t)
|
|
712
|
-
(i.width < t || i.height <
|
|
713
|
-
return
|
|
712
|
+
(i.width < t || i.height < r) && (e.some((n) => n.width === i.width && n.height === i.height) || e.push(i));
|
|
713
|
+
return e;
|
|
714
714
|
}
|
|
715
|
-
async function
|
|
715
|
+
async function er(t, r, e, i, n, E, I) {
|
|
716
716
|
const s = {
|
|
717
|
-
codec:
|
|
718
|
-
width:
|
|
717
|
+
codec: r,
|
|
718
|
+
width: e,
|
|
719
719
|
height: i,
|
|
720
720
|
bitrate: n,
|
|
721
721
|
framerate: E,
|
|
@@ -743,8 +743,8 @@ async function re(t, e, r, i, n, E, I) {
|
|
|
743
743
|
}
|
|
744
744
|
return null;
|
|
745
745
|
}
|
|
746
|
-
async function x(t,
|
|
747
|
-
const n = Math.max(1, Math.floor(
|
|
746
|
+
async function x(t, r, e, i) {
|
|
747
|
+
const n = Math.max(1, Math.floor(e?.framerate ?? b)), E = H(e?.preferredCodecs), s = e?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0], T = rr(t, r);
|
|
748
748
|
let C = E;
|
|
749
749
|
if (i) {
|
|
750
750
|
const a = {
|
|
@@ -756,34 +756,34 @@ async function x(t, e, r, i) {
|
|
|
756
756
|
a && !E.includes(a) ? C = [a, ...E] : a && (C = [a, ...E.filter((h) => h !== a)]);
|
|
757
757
|
}
|
|
758
758
|
for (const _ of T) {
|
|
759
|
-
const a =
|
|
759
|
+
const a = tr(_.width, _.height, n, e?.bitrate);
|
|
760
760
|
for (const h of s)
|
|
761
761
|
for (const A of C) {
|
|
762
762
|
const o = Zt(A), R = pt[o] ?? [];
|
|
763
763
|
for (const f of R) {
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
766
|
-
return { codec: o, config:
|
|
764
|
+
const U = await er(o, f, _.width, _.height, a, n, h);
|
|
765
|
+
if (U)
|
|
766
|
+
return { codec: o, config: U.config, isHardwareAccelerated: U.isHardwareAccelerated };
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
770
|
throw new Error("No supported video encoder configuration");
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function ir(t) {
|
|
773
773
|
return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t.buffer : t.slice().buffer;
|
|
774
774
|
}
|
|
775
775
|
function P(t) {
|
|
776
776
|
if (!S)
|
|
777
777
|
return;
|
|
778
|
-
const
|
|
779
|
-
S.postMessage({ type: "send", message:
|
|
778
|
+
const r = ir(t);
|
|
779
|
+
S.postMessage({ type: "send", message: r }, [r]);
|
|
780
780
|
}
|
|
781
|
-
const
|
|
781
|
+
const l = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), V = [];
|
|
782
782
|
function Q(t) {
|
|
783
|
-
for (let
|
|
784
|
-
if (V[
|
|
785
|
-
const
|
|
786
|
-
return V.splice(
|
|
783
|
+
for (let r = 0; r < V.length; r++)
|
|
784
|
+
if (V[r].length >= t) {
|
|
785
|
+
const e = V[r];
|
|
786
|
+
return V.splice(r, 1), e.length === t ? e : new Uint8Array(e.buffer, 0, t);
|
|
787
787
|
}
|
|
788
788
|
return new Uint8Array(t);
|
|
789
789
|
}
|
|
@@ -796,12 +796,12 @@ function z(t) {
|
|
|
796
796
|
} catch {
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function nr(t, r) {
|
|
800
800
|
try {
|
|
801
801
|
if (t.stopped || t.isReconfiguring)
|
|
802
802
|
return;
|
|
803
803
|
if (t.kind === "screen" && t.minFrameIntervalUs > 0) {
|
|
804
|
-
const i =
|
|
804
|
+
const i = r.timestamp ?? 0, n = i - t.lastEncodedTimestamp;
|
|
805
805
|
if (t.lastEncodedTimestamp > 0 && n < t.minFrameIntervalUs)
|
|
806
806
|
return;
|
|
807
807
|
t.lastEncodedTimestamp = i;
|
|
@@ -809,43 +809,43 @@ function ne(t, e) {
|
|
|
809
809
|
if (t.encoder.encodeQueueSize > qt)
|
|
810
810
|
return;
|
|
811
811
|
t.frameCounter += 1;
|
|
812
|
-
const
|
|
813
|
-
t.forceKeyframe = !1, t.encoder.encode(
|
|
814
|
-
} catch (
|
|
815
|
-
D(
|
|
812
|
+
const e = t.forceKeyframe || t.frameCounter > 0 && t.frameCounter % t.keyFrameIntervalFrames === 0;
|
|
813
|
+
t.forceKeyframe = !1, t.encoder.encode(r, { keyFrame: e });
|
|
814
|
+
} catch (e) {
|
|
815
|
+
D(e, t.captureId), t.forceKeyframe = !0;
|
|
816
816
|
} finally {
|
|
817
817
|
try {
|
|
818
|
-
|
|
818
|
+
r.close();
|
|
819
819
|
} catch {
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
|
-
async function
|
|
823
|
+
async function Er(t) {
|
|
824
824
|
try {
|
|
825
825
|
for (; !t.stopped; ) {
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
826
|
+
const r = await t.reader.read();
|
|
827
|
+
if (r.done)
|
|
828
828
|
break;
|
|
829
|
-
const
|
|
830
|
-
|
|
829
|
+
const e = r.value;
|
|
830
|
+
e && nr(t, e);
|
|
831
831
|
}
|
|
832
|
-
} catch (
|
|
833
|
-
t.stopped || D(
|
|
832
|
+
} catch (r) {
|
|
833
|
+
t.stopped || D(r, t.captureId);
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
async function
|
|
836
|
+
async function _r(t) {
|
|
837
837
|
if (!S)
|
|
838
838
|
throw new Error("Video capture worker missing send port");
|
|
839
|
-
if (
|
|
839
|
+
if (l.has(t.captureId))
|
|
840
840
|
return;
|
|
841
|
-
const
|
|
841
|
+
const r = Math.max(1, Math.floor(t.width)), e = Math.max(1, Math.floor(t.height)), i = await x(r, e, t.options), n = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? Wt)), E = i.config.width ?? r, I = i.config.height ?? e, s = i.config.framerate ?? b, T = i.config.bitrate ?? 0, C = t.trackSettings?.frameRate, _ = C ?? s, a = t.options?.framerate ?? b, h = t.kind === "screen" ? Math.floor(1e6 / a) : 0, A = new VideoEncoder({
|
|
842
842
|
output: (L) => {
|
|
843
|
-
const g =
|
|
843
|
+
const g = l.get(t.captureId);
|
|
844
844
|
if (!g || g.stopped)
|
|
845
845
|
return;
|
|
846
846
|
const G = Q(L.byteLength);
|
|
847
847
|
L.copyTo(G);
|
|
848
|
-
const _t =
|
|
848
|
+
const _t = v({
|
|
849
849
|
Data: G,
|
|
850
850
|
FrameNumber: g.frameCounter,
|
|
851
851
|
IsKey: L.type === "key",
|
|
@@ -864,7 +864,7 @@ async function _e(t) {
|
|
|
864
864
|
type: "debug",
|
|
865
865
|
message: `Encoder configured: codec=${i.config.codec}, ${E}x${I}@${R}, bitrate=${T}bps, hw=${o}`
|
|
866
866
|
});
|
|
867
|
-
const f = t.readable.getReader(),
|
|
867
|
+
const f = t.readable.getReader(), U = {
|
|
868
868
|
captureId: t.captureId,
|
|
869
869
|
streamId: t.streamId,
|
|
870
870
|
sourceType: t.sourceType,
|
|
@@ -891,7 +891,7 @@ async function _e(t) {
|
|
|
891
891
|
lastEncodedTimestamp: 0,
|
|
892
892
|
minFrameIntervalUs: h
|
|
893
893
|
};
|
|
894
|
-
|
|
894
|
+
l.set(t.captureId, U), X.set(t.trackId, t.captureId);
|
|
895
895
|
const d = t.kind === "screen" ? a : _;
|
|
896
896
|
P(
|
|
897
897
|
$(
|
|
@@ -899,7 +899,7 @@ async function _e(t) {
|
|
|
899
899
|
StreamId: t.streamId,
|
|
900
900
|
Description: `${t.kind}:${t.streamId}`,
|
|
901
901
|
SourceType: t.sourceType,
|
|
902
|
-
Codec:
|
|
902
|
+
Codec: U.codec,
|
|
903
903
|
CodecDetails: i.config.codec,
|
|
904
904
|
Width: E,
|
|
905
905
|
Height: I,
|
|
@@ -907,47 +907,47 @@ async function _e(t) {
|
|
|
907
907
|
CorrelationId: t.correlationId
|
|
908
908
|
}),
|
|
909
909
|
t.senderId,
|
|
910
|
-
{ trackId: t.trackId, targetIds:
|
|
910
|
+
{ trackId: t.trackId, targetIds: U.targetIds }
|
|
911
911
|
)
|
|
912
|
-
), w({ type: "started", captureId: t.captureId, codec:
|
|
912
|
+
), w({ type: "started", captureId: t.captureId, codec: U.codec, width: E, height: I }), Er(U);
|
|
913
913
|
}
|
|
914
914
|
async function Et(t) {
|
|
915
|
-
const
|
|
916
|
-
if (
|
|
917
|
-
|
|
915
|
+
const r = l.get(t);
|
|
916
|
+
if (r) {
|
|
917
|
+
r.stopped = !0, l.delete(t), X.delete(r.trackId);
|
|
918
918
|
try {
|
|
919
|
-
await
|
|
919
|
+
await r.reader.cancel();
|
|
920
920
|
} catch {
|
|
921
921
|
}
|
|
922
922
|
try {
|
|
923
|
-
await
|
|
923
|
+
await r.encoder.flush();
|
|
924
924
|
} catch {
|
|
925
925
|
}
|
|
926
|
-
z(
|
|
926
|
+
z(r), P(vt(Kt({}), r.senderId, { trackId: r.trackId, targetIds: r.targetIds })), w({ type: "stopped", captureId: r.captureId });
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
async function
|
|
930
|
-
const i =
|
|
931
|
-
if (!i || i.stopped || i.width ===
|
|
929
|
+
async function ar(t, r, e) {
|
|
930
|
+
const i = l.get(t);
|
|
931
|
+
if (!i || i.stopped || i.width === r && i.height === e)
|
|
932
932
|
return;
|
|
933
933
|
i.isReconfiguring = !0, w({
|
|
934
934
|
type: "debug",
|
|
935
|
-
message: `Window resize detected: ${i.width}x${i.height} -> ${
|
|
935
|
+
message: `Window resize detected: ${i.width}x${i.height} -> ${r}x${e}`
|
|
936
936
|
});
|
|
937
937
|
try {
|
|
938
938
|
await i.encoder.flush();
|
|
939
939
|
} catch {
|
|
940
940
|
}
|
|
941
|
-
i.width =
|
|
942
|
-
const n = await x(
|
|
941
|
+
i.width = r, i.height = e;
|
|
942
|
+
const n = await x(r, e, i.options, i.codec);
|
|
943
943
|
z(i), i.codec = n.codec, i.encoderConfig = n.config, i.isHardwareAccelerated = n.isHardwareAccelerated, i.encoder = new VideoEncoder({
|
|
944
944
|
output: (_) => {
|
|
945
|
-
const a =
|
|
945
|
+
const a = l.get(t);
|
|
946
946
|
if (!a || a.stopped)
|
|
947
947
|
return;
|
|
948
948
|
const h = Q(_.byteLength);
|
|
949
949
|
_.copyTo(h);
|
|
950
|
-
const A =
|
|
950
|
+
const A = v({
|
|
951
951
|
Data: h,
|
|
952
952
|
FrameNumber: a.frameCounter,
|
|
953
953
|
IsKey: _.type === "key",
|
|
@@ -960,7 +960,7 @@ async function ae(t, e, r) {
|
|
|
960
960
|
D(_, t);
|
|
961
961
|
}
|
|
962
962
|
}), i.encoder.configure(n.config), i.forceKeyframe = !0;
|
|
963
|
-
const E = n.config.width ??
|
|
963
|
+
const E = n.config.width ?? r, I = n.config.height ?? e, s = i.kind === "screen" ? i.targetFramerate : i.framerate;
|
|
964
964
|
P(
|
|
965
965
|
$(
|
|
966
966
|
k({
|
|
@@ -984,79 +984,79 @@ async function ae(t, e, r) {
|
|
|
984
984
|
message: `Encoder reconfigured: codec=${n.config.codec}, ${E}x${I}@${C}, bitrate=${n.config.bitrate ?? 0}bps, hw=${T}`
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
|
-
async function
|
|
988
|
-
const
|
|
989
|
-
if (!
|
|
987
|
+
async function Ir(t, r) {
|
|
988
|
+
const e = l.get(t);
|
|
989
|
+
if (!e || e.stopped)
|
|
990
990
|
return;
|
|
991
|
-
const i = H(
|
|
991
|
+
const i = H(e.options?.preferredCodecs), n = H(r.preferredCodecs), E = JSON.stringify(i) !== JSON.stringify(n), I = e.options?.bitrate !== r.bitrate, s = e.options?.framerate !== r.framerate, T = r.width !== void 0 && e.options?.width !== r.width, C = r.height !== void 0 && e.options?.height !== r.height;
|
|
992
992
|
if (!E && !I && !s && !T && !C)
|
|
993
993
|
return;
|
|
994
|
-
|
|
994
|
+
e.isReconfiguring = !0, w({
|
|
995
995
|
type: "debug",
|
|
996
996
|
message: `Options update: codec=${E}, bitrate=${I}, framerate=${s}, width=${T}, height=${C}`
|
|
997
|
-
}),
|
|
997
|
+
}), e.options = r, e.kind === "camera" && (T && r.width !== void 0 && (e.width = r.width), C && r.height !== void 0 && (e.height = r.height));
|
|
998
998
|
try {
|
|
999
|
-
await
|
|
999
|
+
await e.encoder.flush();
|
|
1000
1000
|
} catch {
|
|
1001
1001
|
}
|
|
1002
|
-
const _ = await x(
|
|
1003
|
-
z(
|
|
1002
|
+
const _ = await x(e.width, e.height, r);
|
|
1003
|
+
z(e), e.codec = _.codec, e.encoderConfig = _.config, e.isHardwareAccelerated = _.isHardwareAccelerated, e.framerate = _.config.framerate ?? e.framerate, e.encoder = new VideoEncoder({
|
|
1004
1004
|
output: (R) => {
|
|
1005
|
-
const f =
|
|
1005
|
+
const f = l.get(t);
|
|
1006
1006
|
if (!f || f.stopped)
|
|
1007
1007
|
return;
|
|
1008
|
-
const
|
|
1009
|
-
R.copyTo(
|
|
1010
|
-
const d =
|
|
1011
|
-
Data:
|
|
1008
|
+
const U = Q(R.byteLength);
|
|
1009
|
+
R.copyTo(U);
|
|
1010
|
+
const d = v({
|
|
1011
|
+
Data: U,
|
|
1012
1012
|
FrameNumber: f.frameCounter,
|
|
1013
1013
|
IsKey: R.type === "key",
|
|
1014
1014
|
TimestampInUs: BigInt(Math.max(0, Math.round(R.timestamp ?? 0))),
|
|
1015
1015
|
DurationInUs: Math.max(0, Math.round(R.duration ?? 0))
|
|
1016
1016
|
}), L = W(d, f.senderId, { trackId: f.trackId, targetIds: f.targetIds });
|
|
1017
|
-
j(
|
|
1017
|
+
j(U), P(L);
|
|
1018
1018
|
},
|
|
1019
1019
|
error: (R) => {
|
|
1020
1020
|
D(R, t);
|
|
1021
1021
|
}
|
|
1022
|
-
}),
|
|
1023
|
-
const a = _.config.width ??
|
|
1022
|
+
}), e.encoder.configure(_.config), e.forceKeyframe = !0, e.kind === "screen" && s && r.framerate !== void 0 && (e.targetFramerate = r.framerate, e.minFrameIntervalUs = Math.floor(1e6 / r.framerate), e.lastEncodedTimestamp = 0);
|
|
1023
|
+
const a = _.config.width ?? e.width, h = _.config.height ?? e.height;
|
|
1024
1024
|
P(
|
|
1025
1025
|
$(
|
|
1026
1026
|
k({
|
|
1027
|
-
StreamId:
|
|
1028
|
-
Description: `${
|
|
1029
|
-
SourceType:
|
|
1030
|
-
Codec:
|
|
1027
|
+
StreamId: e.streamId,
|
|
1028
|
+
Description: `${e.kind}:${e.streamId}`,
|
|
1029
|
+
SourceType: e.sourceType,
|
|
1030
|
+
Codec: e.codec,
|
|
1031
1031
|
CodecDetails: _.config.codec,
|
|
1032
1032
|
Width: a,
|
|
1033
1033
|
Height: h,
|
|
1034
|
-
Framerate:
|
|
1035
|
-
CorrelationId:
|
|
1034
|
+
Framerate: e.kind === "screen" ? e.targetFramerate : e.framerate,
|
|
1035
|
+
CorrelationId: e.correlationId
|
|
1036
1036
|
}),
|
|
1037
|
-
|
|
1038
|
-
{ trackId:
|
|
1037
|
+
e.senderId,
|
|
1038
|
+
{ trackId: e.trackId, targetIds: e.targetIds }
|
|
1039
1039
|
)
|
|
1040
|
-
),
|
|
1041
|
-
const A = _.isHardwareAccelerated ? "hardware" : "software", o =
|
|
1040
|
+
), e.isReconfiguring = !1;
|
|
1041
|
+
const A = _.isHardwareAccelerated ? "hardware" : "software", o = e.kind === "screen" ? `${Math.round(e.targetFramerate)}fps (throttled)` : `${Math.round(e.framerate)}fps`;
|
|
1042
1042
|
w({
|
|
1043
1043
|
type: "debug",
|
|
1044
1044
|
message: `Encoder reconfigured (options): codec=${_.config.codec}, ${a}x${h}@${o}, bitrate=${_.config.bitrate ?? 0}bps, hw=${A}`
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const
|
|
1049
|
-
if (It(
|
|
1047
|
+
function sr(t) {
|
|
1048
|
+
const r = new Uint8Array(t);
|
|
1049
|
+
if (It(r) !== Z.VIDEO_REQUEST_IDR_FRAME)
|
|
1050
1050
|
return;
|
|
1051
|
-
const i = st(
|
|
1051
|
+
const i = st(r), n = X.get(i.trackId);
|
|
1052
1052
|
if (!n)
|
|
1053
1053
|
return;
|
|
1054
|
-
const E =
|
|
1054
|
+
const E = l.get(n);
|
|
1055
1055
|
E && (E.forceKeyframe = !0);
|
|
1056
1056
|
}
|
|
1057
|
-
async function
|
|
1058
|
-
const t = Array.from(
|
|
1059
|
-
(
|
|
1057
|
+
async function Tr() {
|
|
1058
|
+
const t = Array.from(l.keys()).map(
|
|
1059
|
+
(r) => Et(r).catch(() => {
|
|
1060
1060
|
})
|
|
1061
1061
|
);
|
|
1062
1062
|
if (await Promise.all(t), y) {
|
|
@@ -1075,29 +1075,29 @@ async function Te() {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
1077
|
self.addEventListener("message", (t) => {
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1078
|
+
const r = t.data;
|
|
1079
|
+
if (r.type === "attachSendPort") {
|
|
1080
1080
|
if (S)
|
|
1081
1081
|
try {
|
|
1082
1082
|
S.close();
|
|
1083
1083
|
} catch {
|
|
1084
1084
|
}
|
|
1085
|
-
S =
|
|
1085
|
+
S = r.port;
|
|
1086
1086
|
try {
|
|
1087
1087
|
S.start?.();
|
|
1088
1088
|
} catch {
|
|
1089
1089
|
}
|
|
1090
1090
|
return;
|
|
1091
1091
|
}
|
|
1092
|
-
if (
|
|
1092
|
+
if (r.type === "attachProtocolPort") {
|
|
1093
1093
|
if (y)
|
|
1094
1094
|
try {
|
|
1095
1095
|
y.close();
|
|
1096
1096
|
} catch {
|
|
1097
1097
|
}
|
|
1098
|
-
y =
|
|
1099
|
-
const i =
|
|
1100
|
-
i?.type === "protocol" && i.message instanceof ArrayBuffer &&
|
|
1098
|
+
y = r.port, y.addEventListener("message", (e) => {
|
|
1099
|
+
const i = e.data;
|
|
1100
|
+
i?.type === "protocol" && i.message instanceof ArrayBuffer && sr(i.message);
|
|
1101
1101
|
});
|
|
1102
1102
|
try {
|
|
1103
1103
|
y.start?.();
|
|
@@ -1105,22 +1105,22 @@ self.addEventListener("message", (t) => {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
return;
|
|
1107
1107
|
}
|
|
1108
|
-
if (
|
|
1109
|
-
|
|
1108
|
+
if (r.type === "start") {
|
|
1109
|
+
_r(r).catch((e) => D(e, r.captureId));
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
|
-
if (
|
|
1113
|
-
Et(
|
|
1112
|
+
if (r.type === "stop") {
|
|
1113
|
+
Et(r.captureId).catch((e) => D(e, r.captureId));
|
|
1114
1114
|
return;
|
|
1115
1115
|
}
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
1116
|
+
if (r.type === "updateDimensions") {
|
|
1117
|
+
ar(r.captureId, r.width, r.height).catch((e) => D(e, r.captureId));
|
|
1118
1118
|
return;
|
|
1119
1119
|
}
|
|
1120
|
-
if (
|
|
1121
|
-
|
|
1120
|
+
if (r.type === "updateOptions") {
|
|
1121
|
+
Ir(r.captureId, r.options).catch((e) => D(e, r.captureId));
|
|
1122
1122
|
return;
|
|
1123
1123
|
}
|
|
1124
|
-
|
|
1124
|
+
r.type === "dispose" && Tr().catch(() => {
|
|
1125
1125
|
});
|
|
1126
1126
|
});
|