@ikonai/sdk 1.0.4 → 1.0.5
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-CGBVb9zd.js → audio-playback-worker-DPybcm1k.js} +235 -213
- package/assets/{protocol-worker-BnPqA34K.js → protocol-worker-DIKCgk1A.js} +69 -73
- package/assets/{video-capture-worker-y4Nlx7f9.js → video-capture-worker-DP3lFDjq.js} +62 -62
- package/assets/{video-playback-worker-Dylqg54c.js → video-playback-worker-qauTQ7Et.js} +274 -252
- package/index.js +824 -802
- package/package.json +1 -1
|
@@ -1,40 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
const J = {
|
|
2
|
+
Compressed: 8
|
|
3
|
+
};
|
|
4
|
+
function Z(t) {
|
|
2
5
|
const r = O(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
3
6
|
if (r.length < 27)
|
|
4
7
|
throw new Error("Protocol payload too short");
|
|
5
|
-
const n = e.getUint32(0, !0), s = e.getUint32(4, !0), E = e.getUint32(8, !0), _ = e.getUint32(12, !0),
|
|
6
|
-
if (27 +
|
|
8
|
+
const n = e.getUint32(0, !0), s = e.getUint32(4, !0), E = e.getUint32(8, !0), _ = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), o = e.getUint8(24), m = e.getUint8(25), Q = e.getUint8(26);
|
|
9
|
+
if (27 + N * 4 > r.length)
|
|
7
10
|
throw new Error("Protocol header exceeds payload length");
|
|
8
|
-
const
|
|
9
|
-
let
|
|
10
|
-
for (let
|
|
11
|
-
|
|
11
|
+
const d = [];
|
|
12
|
+
let b = 27;
|
|
13
|
+
for (let H = 0; H < N; H++)
|
|
14
|
+
d.push(e.getUint32(b, !0)), b += 4;
|
|
12
15
|
return {
|
|
13
16
|
length: n,
|
|
14
17
|
opcode: s,
|
|
15
18
|
senderId: E,
|
|
16
19
|
trackId: _,
|
|
17
|
-
sequenceId:
|
|
18
|
-
targetIds:
|
|
19
|
-
payloadVersion:
|
|
20
|
-
payloadType:
|
|
20
|
+
sequenceId: i,
|
|
21
|
+
targetIds: d,
|
|
22
|
+
payloadVersion: o,
|
|
23
|
+
payloadType: m,
|
|
21
24
|
flags: Q
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
|
-
function
|
|
25
|
-
const n = O(t), s =
|
|
27
|
+
async function x(t, r, e) {
|
|
28
|
+
const n = O(t), s = Z(n);
|
|
26
29
|
if (r !== void 0 && s.opcode !== r)
|
|
27
30
|
throw new Error(`Unexpected opcode ${s.opcode}`);
|
|
28
31
|
if (s.payloadType !== 8)
|
|
29
32
|
throw new Error(`Unexpected payload type ${s.payloadType}`);
|
|
30
33
|
const E = 27 + s.targetIds.length * 4;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
let _ = n.subarray(E, s.length);
|
|
35
|
+
return (s.flags & J.Compressed) !== 0 && (_ = await p(_)), _;
|
|
36
|
+
}
|
|
37
|
+
async function p(t) {
|
|
38
|
+
if (typeof DecompressionStream > "u")
|
|
39
|
+
throw new Error("DecompressionStream not supported");
|
|
40
|
+
const r = new DecompressionStream("gzip"), e = r.writable.getWriter(), n = new Uint8Array(t);
|
|
41
|
+
e.write(n), e.close();
|
|
42
|
+
const s = r.readable.getReader(), E = [];
|
|
43
|
+
let _ = 0;
|
|
44
|
+
for (; ; ) {
|
|
45
|
+
const { done: o, value: m } = await s.read();
|
|
46
|
+
if (o) break;
|
|
47
|
+
E.push(m), _ += m.length;
|
|
48
|
+
}
|
|
49
|
+
const i = new Uint8Array(_);
|
|
50
|
+
let N = 0;
|
|
51
|
+
for (let o = 0; o < E.length; o++)
|
|
52
|
+
i.set(E[o], N), N += E[o].length;
|
|
53
|
+
return i;
|
|
54
|
+
}
|
|
55
|
+
var U = /* @__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))(U || {});
|
|
56
|
+
const tt = 161, rt = 162;
|
|
35
57
|
new TextEncoder();
|
|
36
|
-
const
|
|
37
|
-
class
|
|
58
|
+
const et = new TextDecoder("utf-8", { fatal: !0 });
|
|
59
|
+
class P {
|
|
38
60
|
constructor(r, e, n) {
|
|
39
61
|
this.buffer = r, this.version = e, this.offset = n, this.end = r.length - 1;
|
|
40
62
|
}
|
|
@@ -44,33 +66,33 @@ class w {
|
|
|
44
66
|
const e = O(r);
|
|
45
67
|
if (e.length < 2)
|
|
46
68
|
throw new Error("Teleport payload too short");
|
|
47
|
-
if (e[0] !==
|
|
69
|
+
if (e[0] !== tt || e[e.length - 1] !== rt)
|
|
48
70
|
throw new Error("Teleport object missing markers");
|
|
49
|
-
const n = { offset: 1 }, s =
|
|
50
|
-
return new
|
|
71
|
+
const n = { offset: 1 }, s = A(e, n, "InvalidLength");
|
|
72
|
+
return new P(e, s, n.offset);
|
|
51
73
|
}
|
|
52
74
|
next() {
|
|
53
75
|
if (this.offset >= this.end)
|
|
54
76
|
return null;
|
|
55
77
|
if (this.offset + 5 > this.buffer.length)
|
|
56
78
|
throw new Error("Teleport object truncated");
|
|
57
|
-
const r =
|
|
79
|
+
const r = _t(this.buffer, this.offset);
|
|
58
80
|
this.offset += 4;
|
|
59
81
|
const e = this.buffer[this.offset++], n = e >> 4 & 15;
|
|
60
82
|
if ((e & 15) !== 0)
|
|
61
83
|
throw new Error("Teleport field flags must be zero");
|
|
62
|
-
const s =
|
|
84
|
+
const s = l(n);
|
|
63
85
|
let E;
|
|
64
86
|
if (s >= 0)
|
|
65
|
-
|
|
87
|
+
I(this.buffer, this.offset, s), E = this.buffer.subarray(this.offset, this.offset + s), this.offset += s;
|
|
66
88
|
else {
|
|
67
|
-
const _ = { offset: this.offset },
|
|
68
|
-
|
|
89
|
+
const _ = { offset: this.offset }, i = A(this.buffer, _, "InvalidLength");
|
|
90
|
+
I(this.buffer, _.offset, i), E = this.buffer.subarray(_.offset, _.offset + i), this.offset = _.offset + i;
|
|
69
91
|
}
|
|
70
|
-
return new
|
|
92
|
+
return new nt(r, n, E);
|
|
71
93
|
}
|
|
72
94
|
}
|
|
73
|
-
class
|
|
95
|
+
class f {
|
|
74
96
|
constructor(r, e) {
|
|
75
97
|
this.type = r, this.payload = e;
|
|
76
98
|
}
|
|
@@ -132,38 +154,38 @@ class N {
|
|
|
132
154
|
return this.ensureType(
|
|
133
155
|
12
|
|
134
156
|
/* String */
|
|
135
|
-
),
|
|
157
|
+
), et.decode(this.payload);
|
|
136
158
|
}
|
|
137
159
|
asGuid() {
|
|
138
160
|
return this.ensureType(
|
|
139
161
|
14
|
|
140
162
|
/* Guid */
|
|
141
|
-
),
|
|
163
|
+
), a.fromBytes(this.payload);
|
|
142
164
|
}
|
|
143
165
|
asObject() {
|
|
144
166
|
return this.ensureType(
|
|
145
167
|
11
|
|
146
168
|
/* Object */
|
|
147
|
-
),
|
|
169
|
+
), P.create(this.payload);
|
|
148
170
|
}
|
|
149
171
|
asArray() {
|
|
150
172
|
return this.ensureType(
|
|
151
173
|
9
|
|
152
174
|
/* Array */
|
|
153
|
-
),
|
|
175
|
+
), V.create(this.payload);
|
|
154
176
|
}
|
|
155
177
|
asDictionary() {
|
|
156
178
|
return this.ensureType(
|
|
157
179
|
10
|
|
158
180
|
/* Dict */
|
|
159
|
-
),
|
|
181
|
+
), M.create(this.payload);
|
|
160
182
|
}
|
|
161
183
|
ensureType(r) {
|
|
162
184
|
if (this.type !== r)
|
|
163
|
-
throw new Error(`Teleport value has type ${
|
|
185
|
+
throw new Error(`Teleport value has type ${U[this.type]}, expected ${U[r]}`);
|
|
164
186
|
}
|
|
165
187
|
}
|
|
166
|
-
class
|
|
188
|
+
class nt extends f {
|
|
167
189
|
constructor(r, e, n) {
|
|
168
190
|
super(e, n), this.fieldId = r;
|
|
169
191
|
}
|
|
@@ -171,7 +193,7 @@ class rt extends N {
|
|
|
171
193
|
return this.type === 1;
|
|
172
194
|
}
|
|
173
195
|
}
|
|
174
|
-
class
|
|
196
|
+
class V {
|
|
175
197
|
payload;
|
|
176
198
|
elementType;
|
|
177
199
|
count;
|
|
@@ -184,10 +206,10 @@ class m {
|
|
|
184
206
|
if (this.elementType = e >> 4 & 15, (e & 15) !== 0)
|
|
185
207
|
throw new Error("Array flags must be zero");
|
|
186
208
|
const n = { offset: 1 };
|
|
187
|
-
this.count =
|
|
209
|
+
this.count = A(r, n, "ArrayMalformed"), this.offset = n.offset;
|
|
188
210
|
}
|
|
189
211
|
static create(r) {
|
|
190
|
-
return new
|
|
212
|
+
return new V(O(r));
|
|
191
213
|
}
|
|
192
214
|
next() {
|
|
193
215
|
if (this.index >= this.count) {
|
|
@@ -208,43 +230,43 @@ class m {
|
|
|
208
230
|
case 4:
|
|
209
231
|
case 6:
|
|
210
232
|
case 14: {
|
|
211
|
-
const r =
|
|
212
|
-
|
|
233
|
+
const r = l(this.elementType);
|
|
234
|
+
I(this.payload, this.offset, r);
|
|
213
235
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
214
236
|
return this.offset += r, new D(this.elementType, e);
|
|
215
237
|
}
|
|
216
238
|
case 12:
|
|
217
239
|
case 13: {
|
|
218
|
-
const r = { offset: this.offset }, e =
|
|
219
|
-
|
|
240
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
241
|
+
I(this.payload, r.offset, e);
|
|
220
242
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
221
243
|
return this.offset = r.offset + e, new D(this.elementType, n);
|
|
222
244
|
}
|
|
223
245
|
case 11: {
|
|
224
|
-
const r = { offset: this.offset }, e =
|
|
225
|
-
|
|
246
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
247
|
+
I(this.payload, r.offset, e);
|
|
226
248
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
227
249
|
return this.offset = r.offset + e, new D(11, n);
|
|
228
250
|
}
|
|
229
251
|
case 9: {
|
|
230
|
-
const r =
|
|
252
|
+
const r = G(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
231
253
|
return this.offset += r, new D(9, e);
|
|
232
254
|
}
|
|
233
255
|
case 10: {
|
|
234
|
-
const r =
|
|
256
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
235
257
|
return this.offset += r, new D(10, e);
|
|
236
258
|
}
|
|
237
259
|
default:
|
|
238
|
-
throw new Error(`Unsupported array element type ${
|
|
260
|
+
throw new Error(`Unsupported array element type ${U[this.elementType]}`);
|
|
239
261
|
}
|
|
240
262
|
}
|
|
241
263
|
}
|
|
242
|
-
class D extends
|
|
264
|
+
class D extends f {
|
|
243
265
|
constructor(r, e) {
|
|
244
266
|
super(r, e);
|
|
245
267
|
}
|
|
246
268
|
}
|
|
247
|
-
class
|
|
269
|
+
class M {
|
|
248
270
|
payload;
|
|
249
271
|
keyType;
|
|
250
272
|
valueType;
|
|
@@ -256,12 +278,12 @@ class F {
|
|
|
256
278
|
throw new Error("Dictionary payload too short");
|
|
257
279
|
if (this.keyType = r[0] >> 4 & 15, this.valueType = r[1] >> 4 & 15, (r[0] & 15) !== 0 || (r[1] & 15) !== 0)
|
|
258
280
|
throw new Error("Dictionary key/value flags must be zero");
|
|
259
|
-
|
|
281
|
+
k(this.keyType);
|
|
260
282
|
const e = { offset: 2 };
|
|
261
|
-
this.count =
|
|
283
|
+
this.count = A(r, e, "DictMalformed"), this.offset = e.offset;
|
|
262
284
|
}
|
|
263
285
|
static create(r) {
|
|
264
|
-
return new
|
|
286
|
+
return new M(O(r));
|
|
265
287
|
}
|
|
266
288
|
next() {
|
|
267
289
|
if (this.index >= this.count) {
|
|
@@ -270,20 +292,20 @@ class F {
|
|
|
270
292
|
return null;
|
|
271
293
|
}
|
|
272
294
|
const r = this.readKey(), e = this.readValue();
|
|
273
|
-
return this.index++, new
|
|
295
|
+
return this.index++, new st(r, e);
|
|
274
296
|
}
|
|
275
297
|
readKey() {
|
|
276
|
-
const r =
|
|
298
|
+
const r = l(this.keyType);
|
|
277
299
|
if (r >= 0) {
|
|
278
|
-
|
|
300
|
+
I(this.payload, this.offset, r);
|
|
279
301
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
280
|
-
return this.offset += r, new
|
|
302
|
+
return this.offset += r, new f(this.keyType, e);
|
|
281
303
|
}
|
|
282
304
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
283
|
-
const e = { offset: this.offset }, n =
|
|
284
|
-
|
|
305
|
+
const e = { offset: this.offset }, n = A(this.payload, e, "DictMalformed");
|
|
306
|
+
I(this.payload, e.offset, n);
|
|
285
307
|
const s = this.payload.subarray(e.offset, e.offset + n);
|
|
286
|
-
return this.offset = e.offset + n, new
|
|
308
|
+
return this.offset = e.offset + n, new f(this.keyType, s);
|
|
287
309
|
}
|
|
288
310
|
throw new Error("Unsupported dictionary key type");
|
|
289
311
|
}
|
|
@@ -291,24 +313,24 @@ class F {
|
|
|
291
313
|
switch (this.valueType) {
|
|
292
314
|
case 12:
|
|
293
315
|
case 13: {
|
|
294
|
-
const r = { offset: this.offset }, e =
|
|
295
|
-
|
|
316
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
|
|
317
|
+
I(this.payload, r.offset, e);
|
|
296
318
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
297
|
-
return this.offset = r.offset + e, new
|
|
319
|
+
return this.offset = r.offset + e, new f(this.valueType, n);
|
|
298
320
|
}
|
|
299
321
|
case 11: {
|
|
300
|
-
const r = { offset: this.offset }, e =
|
|
301
|
-
|
|
322
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
|
|
323
|
+
I(this.payload, r.offset, e);
|
|
302
324
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
303
|
-
return this.offset = r.offset + e, new
|
|
325
|
+
return this.offset = r.offset + e, new f(11, n);
|
|
304
326
|
}
|
|
305
327
|
case 9: {
|
|
306
|
-
const r =
|
|
307
|
-
return this.offset += r, new
|
|
328
|
+
const r = G(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
329
|
+
return this.offset += r, new f(9, e);
|
|
308
330
|
}
|
|
309
331
|
case 10: {
|
|
310
|
-
const r =
|
|
311
|
-
return this.offset += r, new
|
|
332
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
333
|
+
return this.offset += r, new f(10, e);
|
|
312
334
|
}
|
|
313
335
|
case 3:
|
|
314
336
|
case 5:
|
|
@@ -319,22 +341,22 @@ class F {
|
|
|
319
341
|
case 6:
|
|
320
342
|
case 14:
|
|
321
343
|
case 1: {
|
|
322
|
-
const r =
|
|
323
|
-
|
|
344
|
+
const r = l(this.valueType);
|
|
345
|
+
I(this.payload, this.offset, r);
|
|
324
346
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
325
|
-
return this.offset += r, new
|
|
347
|
+
return this.offset += r, new f(this.valueType, e);
|
|
326
348
|
}
|
|
327
349
|
default:
|
|
328
|
-
throw new Error(`Unsupported dictionary value type ${
|
|
350
|
+
throw new Error(`Unsupported dictionary value type ${U[this.valueType]}`);
|
|
329
351
|
}
|
|
330
352
|
}
|
|
331
353
|
}
|
|
332
|
-
class
|
|
354
|
+
class st {
|
|
333
355
|
constructor(r, e) {
|
|
334
356
|
this.key = r, this.value = e;
|
|
335
357
|
}
|
|
336
358
|
}
|
|
337
|
-
class
|
|
359
|
+
class a {
|
|
338
360
|
constructor(r) {
|
|
339
361
|
this.bytes = r;
|
|
340
362
|
}
|
|
@@ -344,19 +366,19 @@ class i {
|
|
|
344
366
|
const e = r.replace(/-/g, "");
|
|
345
367
|
if (e.length !== 32)
|
|
346
368
|
throw new Error("Guid string must be 32 hex characters");
|
|
347
|
-
const n = new Uint8Array(16), s =
|
|
348
|
-
|
|
349
|
-
for (let
|
|
350
|
-
n[8 +
|
|
351
|
-
return new
|
|
369
|
+
const n = new Uint8Array(16), s = a.parseHexSlice(e, 0, 8), E = a.parseHexSlice(e, 8, 4), _ = a.parseHexSlice(e, 12, 4);
|
|
370
|
+
a.writeUInt32LE(n, 0, s), a.writeUInt16LE(n, 4, E), a.writeUInt16LE(n, 6, _);
|
|
371
|
+
for (let i = 0; i < 8; i++)
|
|
372
|
+
n[8 + i] = a.parseHexSlice(e, 16 + i * 2, 2);
|
|
373
|
+
return new a(n);
|
|
352
374
|
}
|
|
353
375
|
static fromBytes(r) {
|
|
354
376
|
if (r.length !== 16)
|
|
355
377
|
throw new Error("Guid byte array must be 16 bytes");
|
|
356
|
-
return new
|
|
378
|
+
return new a(Uint8Array.from(r));
|
|
357
379
|
}
|
|
358
380
|
static createZero() {
|
|
359
|
-
return new
|
|
381
|
+
return new a(new Uint8Array(16));
|
|
360
382
|
}
|
|
361
383
|
static createRandom() {
|
|
362
384
|
const r = new Uint8Array(16), e = globalThis.crypto;
|
|
@@ -365,16 +387,16 @@ class i {
|
|
|
365
387
|
else
|
|
366
388
|
for (let n = 0; n < r.length; n++)
|
|
367
389
|
r[n] = Math.floor(Math.random() * 256);
|
|
368
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new
|
|
390
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new a(r);
|
|
369
391
|
}
|
|
370
392
|
toString() {
|
|
371
393
|
const r = this.bytes;
|
|
372
394
|
return [
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
395
|
+
a.toHex(a.readUInt32LE(r, 0), 8),
|
|
396
|
+
a.toHex(a.readUInt16LE(r, 4), 4),
|
|
397
|
+
a.toHex(a.readUInt16LE(r, 6), 4),
|
|
398
|
+
K(r.subarray(8, 10)),
|
|
399
|
+
K(r.subarray(10, 16))
|
|
378
400
|
].join("-");
|
|
379
401
|
}
|
|
380
402
|
asBytes() {
|
|
@@ -404,14 +426,14 @@ class i {
|
|
|
404
426
|
return (r >>> 0).toString(16).padStart(e, "0");
|
|
405
427
|
}
|
|
406
428
|
}
|
|
407
|
-
function
|
|
429
|
+
function A(t, r, e) {
|
|
408
430
|
if (r.offset >= t.length)
|
|
409
431
|
throw new Error(e);
|
|
410
432
|
let n = 0, s = 0, E = 0;
|
|
411
433
|
for (; r.offset < t.length; ) {
|
|
412
434
|
const _ = t[r.offset++];
|
|
413
435
|
if (E++, n |= (_ & 127) << s, (_ & 128) === 0) {
|
|
414
|
-
if (E !==
|
|
436
|
+
if (E !== Et(n))
|
|
415
437
|
throw new Error("Teleport VarUInt is not canonical");
|
|
416
438
|
return n >>> 0;
|
|
417
439
|
}
|
|
@@ -420,10 +442,10 @@ function T(t, r, e) {
|
|
|
420
442
|
}
|
|
421
443
|
throw new Error(e);
|
|
422
444
|
}
|
|
423
|
-
function
|
|
445
|
+
function Et(t) {
|
|
424
446
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
425
447
|
}
|
|
426
|
-
function
|
|
448
|
+
function l(t) {
|
|
427
449
|
switch (t) {
|
|
428
450
|
case 3:
|
|
429
451
|
case 5:
|
|
@@ -443,202 +465,202 @@ function U(t) {
|
|
|
443
465
|
return -1;
|
|
444
466
|
}
|
|
445
467
|
}
|
|
446
|
-
function
|
|
468
|
+
function k(t) {
|
|
447
469
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
448
470
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
449
471
|
}
|
|
450
|
-
function
|
|
472
|
+
function I(t, r, e) {
|
|
451
473
|
if (r < 0 || e < 0 || r + e > t.length)
|
|
452
474
|
throw new Error("Teleport payload exceeds bounds");
|
|
453
475
|
}
|
|
454
|
-
function
|
|
476
|
+
function _t(t, r) {
|
|
455
477
|
return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
|
|
456
478
|
}
|
|
457
|
-
function
|
|
479
|
+
function G(t, r) {
|
|
458
480
|
if (r >= t.length)
|
|
459
481
|
throw new Error("Array payload exceeds bounds");
|
|
460
482
|
const e = t[r], n = e >> 4 & 15;
|
|
461
483
|
if ((e & 15) !== 0)
|
|
462
484
|
throw new Error("Array flags must be zero");
|
|
463
|
-
const s = { offset: r + 1 }, E =
|
|
485
|
+
const s = { offset: r + 1 }, E = A(t, s, "ArrayMalformed"), _ = l(n);
|
|
464
486
|
if (_ >= 0) {
|
|
465
|
-
const
|
|
466
|
-
return
|
|
487
|
+
const N = _ * E;
|
|
488
|
+
return I(t, s.offset, N), s.offset + N - r;
|
|
467
489
|
}
|
|
468
|
-
let
|
|
469
|
-
for (let
|
|
470
|
-
|
|
471
|
-
return
|
|
490
|
+
let i = s.offset;
|
|
491
|
+
for (let N = 0; N < E; N++)
|
|
492
|
+
i = F(n, t, i, "ArrayMalformed");
|
|
493
|
+
return i - r;
|
|
472
494
|
}
|
|
473
|
-
function
|
|
495
|
+
function B(t, r) {
|
|
474
496
|
if (r + 2 > t.length)
|
|
475
497
|
throw new Error("Dictionary payload too short");
|
|
476
498
|
const e = t[r] >> 4 & 15, n = t[r + 1] >> 4 & 15;
|
|
477
499
|
if ((t[r] & 15) !== 0 || (t[r + 1] & 15) !== 0)
|
|
478
500
|
throw new Error("Dictionary key/value flags must be zero");
|
|
479
|
-
|
|
480
|
-
const s = { offset: r + 2 }, E =
|
|
501
|
+
k(e);
|
|
502
|
+
const s = { offset: r + 2 }, E = A(t, s, "DictMalformed");
|
|
481
503
|
let _ = s.offset;
|
|
482
|
-
for (let
|
|
483
|
-
_ =
|
|
504
|
+
for (let i = 0; i < E; i++)
|
|
505
|
+
_ = F(e, t, _, "DictMalformed"), _ = F(n, t, _, "DictMalformed");
|
|
484
506
|
return _ - r;
|
|
485
507
|
}
|
|
486
|
-
function
|
|
487
|
-
const s =
|
|
508
|
+
function F(t, r, e, n) {
|
|
509
|
+
const s = l(t);
|
|
488
510
|
if (s >= 0)
|
|
489
|
-
return
|
|
511
|
+
return I(r, e, s), e + s;
|
|
490
512
|
switch (t) {
|
|
491
513
|
case 12:
|
|
492
514
|
case 13: {
|
|
493
|
-
const E = { offset: e }, _ =
|
|
494
|
-
return
|
|
515
|
+
const E = { offset: e }, _ = A(r, E, n);
|
|
516
|
+
return I(r, E.offset, _), E.offset + _;
|
|
495
517
|
}
|
|
496
518
|
case 11: {
|
|
497
|
-
const E = { offset: e }, _ =
|
|
498
|
-
return
|
|
519
|
+
const E = { offset: e }, _ = A(r, E, n);
|
|
520
|
+
return I(r, E.offset, _), E.offset + _;
|
|
499
521
|
}
|
|
500
522
|
case 9:
|
|
501
|
-
return e + V(r, e);
|
|
502
|
-
case 10:
|
|
503
523
|
return e + G(r, e);
|
|
524
|
+
case 10:
|
|
525
|
+
return e + B(r, e);
|
|
504
526
|
default:
|
|
505
|
-
throw new Error(`Unsupported Teleport type ${
|
|
527
|
+
throw new Error(`Unsupported Teleport type ${U[t]}`);
|
|
506
528
|
}
|
|
507
529
|
}
|
|
508
|
-
function
|
|
530
|
+
function K(t) {
|
|
509
531
|
return Array.from(t).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
510
532
|
}
|
|
511
533
|
function O(t) {
|
|
512
534
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
513
535
|
}
|
|
514
|
-
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 || {}), L = /* @__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.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_DEVTOOLS_CONSOLE_OUTPUT = 524297] = "ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT", 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_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", 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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
515
|
-
const
|
|
516
|
-
function
|
|
536
|
+
var h = /* @__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))(h || {}), L = /* @__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.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.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_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", 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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
537
|
+
const it = 8388609, at = 164808083, It = 1368629611, At = 2739413426, Tt = 2768375929, Nt = 2950031986, ft = 3284746250, ot = 4065070594;
|
|
538
|
+
function Ct(t) {
|
|
517
539
|
const r = {};
|
|
518
|
-
return
|
|
540
|
+
return Y(r), r;
|
|
519
541
|
}
|
|
520
|
-
function
|
|
521
|
-
return t.Description = "", t.Codec =
|
|
542
|
+
function Y(t) {
|
|
543
|
+
return t.Description = "", t.Codec = h.H264, t.Width = 0, t.Height = 0, t.Framerate = 30, t.Bitrate = 0, t.IsHardwareAccelerated = !1, t;
|
|
522
544
|
}
|
|
523
|
-
function
|
|
524
|
-
const e =
|
|
525
|
-
return
|
|
545
|
+
function ut(t, r) {
|
|
546
|
+
const e = P.create(t);
|
|
547
|
+
return ht(e, r);
|
|
526
548
|
}
|
|
527
|
-
function
|
|
528
|
-
const e = r ??
|
|
529
|
-
return
|
|
549
|
+
function ht(t, r) {
|
|
550
|
+
const e = r ?? Ct();
|
|
551
|
+
return Y(e), Rt(t, e), e;
|
|
530
552
|
}
|
|
531
|
-
function
|
|
553
|
+
function Rt(t, r) {
|
|
532
554
|
let e;
|
|
533
555
|
for (; (e = t.next()) !== null; )
|
|
534
556
|
switch (e.fieldId) {
|
|
535
|
-
case
|
|
557
|
+
case at: {
|
|
536
558
|
if (e.isNull) throw new Error();
|
|
537
559
|
r.Framerate = e.asInt32();
|
|
538
560
|
break;
|
|
539
561
|
}
|
|
540
|
-
case
|
|
562
|
+
case It: {
|
|
541
563
|
if (e.isNull) throw new Error();
|
|
542
564
|
r.Description = e.asString();
|
|
543
565
|
break;
|
|
544
566
|
}
|
|
545
|
-
case
|
|
567
|
+
case At: {
|
|
546
568
|
if (e.isNull) throw new Error();
|
|
547
569
|
r.IsHardwareAccelerated = e.asBool();
|
|
548
570
|
break;
|
|
549
571
|
}
|
|
550
|
-
case
|
|
572
|
+
case Tt: {
|
|
551
573
|
if (e.isNull) throw new Error();
|
|
552
574
|
r.Bitrate = e.asInt32();
|
|
553
575
|
break;
|
|
554
576
|
}
|
|
555
|
-
case
|
|
577
|
+
case Nt: {
|
|
556
578
|
if (e.isNull) throw new Error();
|
|
557
579
|
r.Height = e.asInt32();
|
|
558
580
|
break;
|
|
559
581
|
}
|
|
560
|
-
case
|
|
582
|
+
case ft: {
|
|
561
583
|
if (e.isNull) throw new Error();
|
|
562
584
|
r.Codec = e.asInt32();
|
|
563
585
|
break;
|
|
564
586
|
}
|
|
565
|
-
case
|
|
587
|
+
case ot: {
|
|
566
588
|
if (e.isNull) throw new Error();
|
|
567
589
|
r.Width = e.asInt32();
|
|
568
590
|
break;
|
|
569
591
|
}
|
|
570
592
|
}
|
|
571
593
|
}
|
|
572
|
-
function
|
|
573
|
-
const e =
|
|
574
|
-
return
|
|
594
|
+
async function Ut(t, r) {
|
|
595
|
+
const e = await x(t, it);
|
|
596
|
+
return ut(e, r);
|
|
575
597
|
}
|
|
576
|
-
const
|
|
577
|
-
function
|
|
598
|
+
const lt = 8388611, St = 271275304, ct = 2541432218, Dt = 2986785889, Lt = 3105403172, yt = 3456383222;
|
|
599
|
+
function wt(t) {
|
|
578
600
|
const r = {};
|
|
579
|
-
return
|
|
601
|
+
return X(r), r;
|
|
580
602
|
}
|
|
581
|
-
function
|
|
603
|
+
function X(t) {
|
|
582
604
|
return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
|
|
583
605
|
}
|
|
584
|
-
function
|
|
585
|
-
const e =
|
|
586
|
-
return
|
|
587
|
-
}
|
|
588
|
-
function wt(t, r) {
|
|
589
|
-
const e = r ?? ct();
|
|
590
|
-
return Y(e), Ot(t, e), e;
|
|
606
|
+
function Pt(t, r) {
|
|
607
|
+
const e = P.create(t);
|
|
608
|
+
return Ot(e, r);
|
|
591
609
|
}
|
|
592
610
|
function Ot(t, r) {
|
|
611
|
+
const e = r ?? wt();
|
|
612
|
+
return X(e), gt(t, e), e;
|
|
613
|
+
}
|
|
614
|
+
function gt(t, r) {
|
|
593
615
|
let e;
|
|
594
616
|
for (; (e = t.next()) !== null; )
|
|
595
617
|
switch (e.fieldId) {
|
|
596
|
-
case
|
|
618
|
+
case St: {
|
|
597
619
|
if (e.isNull) throw new Error();
|
|
598
620
|
r.TimestampInUs = e.asUInt64();
|
|
599
621
|
break;
|
|
600
622
|
}
|
|
601
|
-
case
|
|
623
|
+
case ct: {
|
|
602
624
|
if (e.isNull) throw new Error();
|
|
603
625
|
r.DurationInUs = e.asUInt32();
|
|
604
626
|
break;
|
|
605
627
|
}
|
|
606
|
-
case
|
|
628
|
+
case Dt: {
|
|
607
629
|
if (e.isNull) throw new Error();
|
|
608
630
|
r.Data = e.asBinary();
|
|
609
631
|
break;
|
|
610
632
|
}
|
|
611
|
-
case
|
|
633
|
+
case Lt: {
|
|
612
634
|
if (e.isNull) throw new Error();
|
|
613
635
|
r.IsKey = e.asBool();
|
|
614
636
|
break;
|
|
615
637
|
}
|
|
616
|
-
case
|
|
638
|
+
case yt: {
|
|
617
639
|
if (e.isNull) throw new Error();
|
|
618
640
|
r.FrameNumber = e.asInt32();
|
|
619
641
|
break;
|
|
620
642
|
}
|
|
621
643
|
}
|
|
622
644
|
}
|
|
623
|
-
function
|
|
624
|
-
const e =
|
|
625
|
-
return
|
|
645
|
+
async function mt(t, r) {
|
|
646
|
+
const e = await x(t, lt);
|
|
647
|
+
return Pt(e, r);
|
|
626
648
|
}
|
|
627
|
-
const
|
|
628
|
-
let
|
|
629
|
-
const
|
|
630
|
-
function
|
|
649
|
+
const Ft = "avc1.42E01E", Vt = "vp8", Mt = "vp09.00.10.08", Gt = "av01.0.04M.08", Bt = 3, S = (t, r) => self.postMessage(t, r ?? []);
|
|
650
|
+
let R = null, w = !0;
|
|
651
|
+
const T = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
652
|
+
function C(t) {
|
|
631
653
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
632
|
-
|
|
654
|
+
S({ type: "error", error: { name: r.name, message: r.message, stack: r.stack } });
|
|
633
655
|
}
|
|
634
|
-
function
|
|
656
|
+
function g(t, r) {
|
|
635
657
|
return t << 16 | r & 65535;
|
|
636
658
|
}
|
|
637
|
-
function
|
|
659
|
+
function W(t, r) {
|
|
638
660
|
return `${t}_${r}`;
|
|
639
661
|
}
|
|
640
|
-
function
|
|
641
|
-
const e =
|
|
662
|
+
function z(t, r) {
|
|
663
|
+
const e = T.get(t);
|
|
642
664
|
if (e)
|
|
643
665
|
return e;
|
|
644
666
|
const n = {
|
|
@@ -657,38 +679,38 @@ function X(t, r) {
|
|
|
657
679
|
isKeyFrameRequired: !0,
|
|
658
680
|
pendingDecodeCount: 0
|
|
659
681
|
};
|
|
660
|
-
return
|
|
682
|
+
return T.set(t, n), c.set(r, t), n;
|
|
661
683
|
}
|
|
662
|
-
function
|
|
663
|
-
const r =
|
|
684
|
+
function v(t) {
|
|
685
|
+
const r = c.get(t);
|
|
664
686
|
if (r !== void 0) {
|
|
665
|
-
const _ =
|
|
687
|
+
const _ = T.get(r);
|
|
666
688
|
if (_)
|
|
667
689
|
return _;
|
|
668
690
|
}
|
|
669
|
-
const e = t.split("_"), n = Number(e[0]) || 0, s = Number(e[1]) || 0, E =
|
|
670
|
-
return
|
|
691
|
+
const e = t.split("_"), n = Number(e[0]) || 0, s = Number(e[1]) || 0, E = g(n, s);
|
|
692
|
+
return z(E, t);
|
|
671
693
|
}
|
|
672
|
-
function
|
|
673
|
-
if (t ===
|
|
674
|
-
if (t ===
|
|
675
|
-
if (t ===
|
|
676
|
-
if (t ===
|
|
694
|
+
function dt(t) {
|
|
695
|
+
if (t === h.H264) return Ft;
|
|
696
|
+
if (t === h.Vp8) return Vt;
|
|
697
|
+
if (t === h.Vp9) return Mt;
|
|
698
|
+
if (t === h.Av1) return Gt;
|
|
677
699
|
throw new Error(`Unknown codec: ${t}`);
|
|
678
700
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
701
|
+
function u(t) {
|
|
702
|
+
S({ type: "requestIdr", streamId: t });
|
|
681
703
|
}
|
|
682
|
-
async function
|
|
704
|
+
async function bt(t, r) {
|
|
683
705
|
try {
|
|
684
|
-
if (!
|
|
706
|
+
if (!w || !t.watched)
|
|
685
707
|
return;
|
|
686
708
|
if (typeof createImageBitmap == "function") {
|
|
687
709
|
const e = await createImageBitmap(r);
|
|
688
|
-
|
|
710
|
+
S({ type: "frame", streamId: t.streamId, width: t.width, height: t.height, bitmap: e }, [e]);
|
|
689
711
|
}
|
|
690
712
|
} catch (e) {
|
|
691
|
-
|
|
713
|
+
C(e);
|
|
692
714
|
} finally {
|
|
693
715
|
t.pendingDecodeCount--;
|
|
694
716
|
try {
|
|
@@ -697,7 +719,7 @@ async function Bt(t, r) {
|
|
|
697
719
|
}
|
|
698
720
|
}
|
|
699
721
|
}
|
|
700
|
-
async function
|
|
722
|
+
async function Ht(t, r, e) {
|
|
701
723
|
const n = {
|
|
702
724
|
codec: t,
|
|
703
725
|
codedWidth: r > 0 ? r : void 0,
|
|
@@ -721,13 +743,13 @@ async function bt(t, r, e) {
|
|
|
721
743
|
}
|
|
722
744
|
return null;
|
|
723
745
|
}
|
|
724
|
-
async function
|
|
746
|
+
async function y(t) {
|
|
725
747
|
if (t.codec == null)
|
|
726
748
|
return;
|
|
727
|
-
const r =
|
|
749
|
+
const r = dt(t.codec);
|
|
728
750
|
if (t.decoder || (t.decoder = new VideoDecoder({
|
|
729
751
|
output: (e) => {
|
|
730
|
-
if (t.pendingDecodeCount++, !
|
|
752
|
+
if (t.pendingDecodeCount++, !w || !t.watched) {
|
|
731
753
|
t.pendingDecodeCount--;
|
|
732
754
|
try {
|
|
733
755
|
e.close();
|
|
@@ -735,7 +757,7 @@ async function c(t) {
|
|
|
735
757
|
}
|
|
736
758
|
return;
|
|
737
759
|
}
|
|
738
|
-
if (t.pendingDecodeCount >
|
|
760
|
+
if (t.pendingDecodeCount > Bt) {
|
|
739
761
|
t.pendingDecodeCount--;
|
|
740
762
|
try {
|
|
741
763
|
e.close();
|
|
@@ -748,7 +770,7 @@ async function c(t) {
|
|
|
748
770
|
try {
|
|
749
771
|
t.ctx2d.drawImage(e, 0, 0, n, s);
|
|
750
772
|
} catch (E) {
|
|
751
|
-
|
|
773
|
+
C(E);
|
|
752
774
|
} finally {
|
|
753
775
|
t.pendingDecodeCount--;
|
|
754
776
|
try {
|
|
@@ -758,58 +780,58 @@ async function c(t) {
|
|
|
758
780
|
}
|
|
759
781
|
return;
|
|
760
782
|
}
|
|
761
|
-
|
|
783
|
+
bt(t, e);
|
|
762
784
|
},
|
|
763
785
|
error: (e) => {
|
|
764
|
-
|
|
786
|
+
C(e), t.isKeyFrameRequired = !0, u(t.streamId);
|
|
765
787
|
}
|
|
766
788
|
})), t.decoderCodec !== r) {
|
|
767
|
-
const e = await
|
|
789
|
+
const e = await Ht(r, t.width, t.height);
|
|
768
790
|
if (!e) {
|
|
769
|
-
|
|
791
|
+
C(new Error(`Decoder not supported for codec ${r}`));
|
|
770
792
|
return;
|
|
771
793
|
}
|
|
772
794
|
t.decoderCodec = r;
|
|
773
795
|
try {
|
|
774
|
-
t.decoder.configure(e.config), t.isKeyFrameRequired = !0,
|
|
796
|
+
t.decoder.configure(e.config), t.isKeyFrameRequired = !0, u(t.streamId);
|
|
775
797
|
const n = e.isHardwareAccelerated ? "hardware" : "software", s = t.framerate > 0 ? `@${Math.round(t.framerate)}fps` : "";
|
|
776
|
-
|
|
798
|
+
S({ type: "log", message: `Decoder configured: codec=${r}, ${t.width}x${t.height}${s}, hw=${n}` });
|
|
777
799
|
} catch (n) {
|
|
778
|
-
|
|
800
|
+
C(n);
|
|
779
801
|
}
|
|
780
802
|
t.surface && t.ctx2d && t.width > 0 && t.height > 0 && (t.surface.width !== t.width || t.surface.height !== t.height) && (t.surface.width = t.width, t.surface.height = t.height);
|
|
781
803
|
}
|
|
782
804
|
}
|
|
783
|
-
function
|
|
784
|
-
const e =
|
|
785
|
-
E.codec = s.Codec, E.width = s.Width, E.height = s.Height, E.framerate = s.Framerate, E.bitrate = s.Bitrate,
|
|
805
|
+
async function Kt(t, r) {
|
|
806
|
+
const e = g(r.senderId, r.trackId), n = W(r.senderId, r.trackId), s = await Ut(t), E = z(e, n);
|
|
807
|
+
E.codec = s.Codec, E.width = s.Width, E.height = s.Height, E.framerate = s.Framerate, E.bitrate = s.Bitrate, S({ type: "streamBegin", streamId: n, width: s.Width, height: s.Height, codec: s.Codec }), E.watched && (E.surface && E.ctx2d && s.Width > 0 && s.Height > 0 && (E.surface.width !== s.Width || E.surface.height !== s.Height) && (E.surface.width = s.Width, E.surface.height = s.Height), y(E));
|
|
786
808
|
}
|
|
787
|
-
function
|
|
788
|
-
const r =
|
|
789
|
-
|
|
790
|
-
const n =
|
|
809
|
+
function vt(t) {
|
|
810
|
+
const r = g(t.senderId, t.trackId), e = W(t.senderId, t.trackId);
|
|
811
|
+
S({ type: "streamEnd", streamId: e });
|
|
812
|
+
const n = T.get(r);
|
|
791
813
|
if (n) {
|
|
792
814
|
if (n.decoder)
|
|
793
815
|
try {
|
|
794
816
|
n.decoder.close();
|
|
795
817
|
} catch {
|
|
796
818
|
}
|
|
797
|
-
|
|
819
|
+
T.delete(r), c.delete(e);
|
|
798
820
|
}
|
|
799
821
|
}
|
|
800
|
-
function
|
|
801
|
-
const r =
|
|
822
|
+
function $(t) {
|
|
823
|
+
const r = c.get(t);
|
|
802
824
|
if (r === void 0)
|
|
803
825
|
return;
|
|
804
|
-
const e =
|
|
826
|
+
const e = T.get(r);
|
|
805
827
|
e && (e.surface = null, e.ctx2d = null);
|
|
806
828
|
}
|
|
807
|
-
function
|
|
808
|
-
const r =
|
|
829
|
+
function q(t) {
|
|
830
|
+
const r = c.get(t);
|
|
809
831
|
if (r === void 0)
|
|
810
832
|
return;
|
|
811
|
-
const e =
|
|
812
|
-
if (e && (e.watched = !1, e.isKeyFrameRequired = !0,
|
|
833
|
+
const e = T.get(r);
|
|
834
|
+
if (e && (e.watched = !1, e.isKeyFrameRequired = !0, $(t), e.decoder)) {
|
|
813
835
|
try {
|
|
814
836
|
e.decoder.close();
|
|
815
837
|
} catch {
|
|
@@ -817,11 +839,11 @@ function z(t) {
|
|
|
817
839
|
e.decoder = null, e.decoderCodec = null;
|
|
818
840
|
}
|
|
819
841
|
}
|
|
820
|
-
function
|
|
821
|
-
const e =
|
|
822
|
-
if (!n || !
|
|
842
|
+
async function xt(t, r) {
|
|
843
|
+
const e = g(r.senderId, r.trackId), n = T.get(e);
|
|
844
|
+
if (!n || !w || !n.watched || ((!n.decoder || !n.decoderCodec) && y(n), !n.decoder || !n.decoderCodec))
|
|
823
845
|
return;
|
|
824
|
-
const s =
|
|
846
|
+
const s = await mt(t);
|
|
825
847
|
if (n.isKeyFrameRequired) {
|
|
826
848
|
if (!s.IsKey)
|
|
827
849
|
return;
|
|
@@ -837,86 +859,86 @@ function Kt(t, r) {
|
|
|
837
859
|
})
|
|
838
860
|
);
|
|
839
861
|
} catch (E) {
|
|
840
|
-
n.isKeyFrameRequired = !0,
|
|
862
|
+
n.isKeyFrameRequired = !0, u(n.streamId), C(E);
|
|
841
863
|
}
|
|
842
864
|
}
|
|
843
|
-
function
|
|
844
|
-
const r =
|
|
845
|
-
e && (e.isKeyFrameRequired = !0, e.watched &&
|
|
865
|
+
function kt(t) {
|
|
866
|
+
const r = g(t.senderId, t.trackId), e = T.get(r);
|
|
867
|
+
e && (e.isKeyFrameRequired = !0, e.watched && u(e.streamId));
|
|
846
868
|
}
|
|
847
|
-
function
|
|
869
|
+
function Yt(t, r) {
|
|
848
870
|
switch (r.opcode) {
|
|
849
871
|
case L.VIDEO_STREAM_BEGIN:
|
|
850
|
-
|
|
872
|
+
Kt(t, r);
|
|
851
873
|
return;
|
|
852
874
|
case L.VIDEO_STREAM_END:
|
|
853
|
-
|
|
875
|
+
vt(r);
|
|
854
876
|
return;
|
|
855
877
|
case L.VIDEO_FRAME:
|
|
856
|
-
|
|
878
|
+
xt(t, r);
|
|
857
879
|
return;
|
|
858
880
|
case L.VIDEO_INVALIDATE_FRAME:
|
|
859
|
-
|
|
881
|
+
kt(r);
|
|
860
882
|
return;
|
|
861
883
|
default:
|
|
862
884
|
return;
|
|
863
885
|
}
|
|
864
886
|
}
|
|
865
|
-
function
|
|
866
|
-
if (
|
|
887
|
+
function j() {
|
|
888
|
+
if (R) {
|
|
867
889
|
try {
|
|
868
|
-
|
|
890
|
+
R.close();
|
|
869
891
|
} catch {
|
|
870
892
|
}
|
|
871
|
-
|
|
893
|
+
R = null;
|
|
872
894
|
}
|
|
873
895
|
}
|
|
874
|
-
function
|
|
875
|
-
|
|
876
|
-
for (const t of
|
|
877
|
-
|
|
878
|
-
|
|
896
|
+
function Xt() {
|
|
897
|
+
j();
|
|
898
|
+
for (const t of T.values())
|
|
899
|
+
q(t.streamId);
|
|
900
|
+
T.clear(), c.clear();
|
|
879
901
|
}
|
|
880
902
|
self.addEventListener("message", (t) => {
|
|
881
903
|
const r = t.data;
|
|
882
904
|
if (r.type !== "configure") {
|
|
883
905
|
if (r.type === "attachSurface") {
|
|
884
|
-
const e = r.streamId, n =
|
|
906
|
+
const e = r.streamId, n = v(e);
|
|
885
907
|
n.watched = !0, n.surface = r.canvas;
|
|
886
908
|
try {
|
|
887
909
|
n.ctx2d = n.surface.getContext("2d", { alpha: !1, desynchronized: !0 });
|
|
888
910
|
} catch (s) {
|
|
889
|
-
|
|
911
|
+
C(s), n.ctx2d = null;
|
|
890
912
|
}
|
|
891
|
-
n.isKeyFrameRequired = !0,
|
|
913
|
+
n.isKeyFrameRequired = !0, y(n), u(e);
|
|
892
914
|
return;
|
|
893
915
|
}
|
|
894
916
|
if (r.type === "detachSurface") {
|
|
895
|
-
|
|
917
|
+
$(r.streamId);
|
|
896
918
|
return;
|
|
897
919
|
}
|
|
898
920
|
if (r.type === "attachProtocolPort") {
|
|
899
|
-
|
|
921
|
+
j(), R = r.port, R.addEventListener("message", (e) => {
|
|
900
922
|
const n = e.data;
|
|
901
|
-
n?.type === "protocol" && n.message instanceof ArrayBuffer && n.headers &&
|
|
902
|
-
}),
|
|
923
|
+
n?.type === "protocol" && n.message instanceof ArrayBuffer && n.headers && Yt(new Uint8Array(n.message), n.headers);
|
|
924
|
+
}), R.start?.();
|
|
903
925
|
return;
|
|
904
926
|
}
|
|
905
927
|
if (r.type === "watchStream") {
|
|
906
|
-
const e =
|
|
907
|
-
e.watched = !0, e.isKeyFrameRequired = !0,
|
|
928
|
+
const e = v(r.streamId);
|
|
929
|
+
e.watched = !0, e.isKeyFrameRequired = !0, y(e), u(e.streamId);
|
|
908
930
|
return;
|
|
909
931
|
}
|
|
910
932
|
if (r.type === "unwatchStream") {
|
|
911
|
-
|
|
933
|
+
q(r.streamId);
|
|
912
934
|
return;
|
|
913
935
|
}
|
|
914
936
|
if (r.type === "setEnabled") {
|
|
915
|
-
if (
|
|
916
|
-
for (const e of
|
|
917
|
-
e.watched && (e.isKeyFrameRequired = !0,
|
|
937
|
+
if (w = r.enabled, w)
|
|
938
|
+
for (const e of T.values())
|
|
939
|
+
e.watched && (e.isKeyFrameRequired = !0, y(e), u(e.streamId));
|
|
918
940
|
return;
|
|
919
941
|
}
|
|
920
|
-
r.type === "dispose" &&
|
|
942
|
+
r.type === "dispose" && Xt();
|
|
921
943
|
}
|
|
922
944
|
});
|