@ikonai/sdk 1.0.44 → 1.0.46

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.
@@ -5,7 +5,7 @@ function p(t) {
5
5
  const r = w(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
6
6
  if (r.length < 27)
7
7
  throw new Error("Protocol payload too short");
8
- const n = e.getUint32(0, !0), E = e.getUint32(4, !0), _ = e.getUint32(8, !0), s = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), f = e.getUint8(24), m = e.getUint8(25), J = e.getUint8(26);
8
+ const _ = e.getUint32(0, !0), E = e.getUint32(4, !0), n = e.getUint32(8, !0), s = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), f = e.getUint8(24), m = e.getUint8(25), J = e.getUint8(26);
9
9
  if (27 + N * 4 > r.length)
10
10
  throw new Error("Protocol header exceeds payload length");
11
11
  const H = [];
@@ -13,9 +13,9 @@ function p(t) {
13
13
  for (let Y = 0; Y < N; Y++)
14
14
  H.push(e.getUint32(K, !0)), K += 4;
15
15
  return {
16
- length: n,
16
+ length: _,
17
17
  opcode: E,
18
- senderId: _,
18
+ senderId: n,
19
19
  trackId: s,
20
20
  sequenceId: i,
21
21
  targetIds: H,
@@ -25,40 +25,40 @@ function p(t) {
25
25
  };
26
26
  }
27
27
  async function k(t, r, e) {
28
- const n = w(t), E = p(n);
28
+ const _ = w(t), E = p(_);
29
29
  if (r !== void 0 && E.opcode !== r)
30
30
  throw new Error(`Unexpected opcode ${E.opcode}`);
31
31
  if (E.payloadType !== 8)
32
32
  throw new Error(`Unexpected payload type ${E.payloadType}`);
33
- const _ = 27 + E.targetIds.length * 4;
34
- let s = n.subarray(_, E.length);
33
+ const n = 27 + E.targetIds.length * 4;
34
+ let s = _.subarray(n, E.length);
35
35
  return (E.flags & Z.Compressed) !== 0 && (s = await tt(s)), s;
36
36
  }
37
37
  async function tt(t) {
38
38
  if (typeof DecompressionStream > "u")
39
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 E = r.readable.getReader(), _ = [];
40
+ const r = new DecompressionStream("gzip"), e = r.writable.getWriter(), _ = new Uint8Array(t);
41
+ e.write(_), e.close();
42
+ const E = r.readable.getReader(), n = [];
43
43
  let s = 0;
44
44
  for (; ; ) {
45
45
  const { done: f, value: m } = await E.read();
46
46
  if (f) break;
47
- _.push(m), s += m.length;
47
+ n.push(m), s += m.length;
48
48
  }
49
49
  const i = new Uint8Array(s);
50
50
  let N = 0;
51
- for (let f = 0; f < _.length; f++)
52
- i.set(_[f], N), N += _[f].length;
51
+ for (let f = 0; f < n.length; f++)
52
+ i.set(n[f], N), N += n[f].length;
53
53
  return i;
54
54
  }
55
55
  var l = /* @__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))(l || {});
56
56
  const rt = 161, et = 162;
57
57
  new TextEncoder();
58
- const nt = new TextDecoder("utf-8", { fatal: !0 });
58
+ const _t = new TextDecoder("utf-8", { fatal: !0 });
59
59
  class P {
60
- constructor(r, e, n) {
61
- this.buffer = r, this.version = e, this.offset = n, this.end = r.length - 1;
60
+ constructor(r, e, _) {
61
+ this.buffer = r, this.version = e, this.offset = _, this.end = r.length - 1;
62
62
  }
63
63
  offset;
64
64
  end;
@@ -68,8 +68,8 @@ class P {
68
68
  throw new Error("Teleport payload too short");
69
69
  if (e[0] !== rt || e[e.length - 1] !== et)
70
70
  throw new Error("Teleport object missing markers");
71
- const n = { offset: 1 }, E = A(e, n, "InvalidLength");
72
- return new P(e, E, n.offset);
71
+ const _ = { offset: 1 }, E = A(e, _, "InvalidLength");
72
+ return new P(e, E, _.offset);
73
73
  }
74
74
  next() {
75
75
  if (this.offset >= this.end)
@@ -78,18 +78,18 @@ class P {
78
78
  throw new Error("Teleport object truncated");
79
79
  const r = it(this.buffer, this.offset);
80
80
  this.offset += 4;
81
- const e = this.buffer[this.offset++], n = e >> 4 & 15;
81
+ const e = this.buffer[this.offset++], _ = e >> 4 & 15;
82
82
  if ((e & 15) !== 0)
83
83
  throw new Error("Teleport field flags must be zero");
84
- const E = S(n);
85
- let _;
84
+ const E = S(_);
85
+ let n;
86
86
  if (E >= 0)
87
- a(this.buffer, this.offset, E), _ = this.buffer.subarray(this.offset, this.offset + E), this.offset += E;
87
+ a(this.buffer, this.offset, E), n = this.buffer.subarray(this.offset, this.offset + E), this.offset += E;
88
88
  else {
89
89
  const s = { offset: this.offset }, i = A(this.buffer, s, "InvalidLength");
90
- a(this.buffer, s.offset, i), _ = this.buffer.subarray(s.offset, s.offset + i), this.offset = s.offset + i;
90
+ a(this.buffer, s.offset, i), n = this.buffer.subarray(s.offset, s.offset + i), this.offset = s.offset + i;
91
91
  }
92
- return new Et(r, n, _);
92
+ return new Et(r, _, n);
93
93
  }
94
94
  }
95
95
  class C {
@@ -154,7 +154,7 @@ class C {
154
154
  return this.ensureType(
155
155
  12
156
156
  /* String */
157
- ), nt.decode(this.payload);
157
+ ), _t.decode(this.payload);
158
158
  }
159
159
  asGuid() {
160
160
  return this.ensureType(
@@ -172,13 +172,13 @@ class C {
172
172
  return this.ensureType(
173
173
  9
174
174
  /* Array */
175
- ), V.create(this.payload);
175
+ ), G.create(this.payload);
176
176
  }
177
177
  asDictionary() {
178
178
  return this.ensureType(
179
179
  10
180
180
  /* Dict */
181
- ), G.create(this.payload);
181
+ ), d.create(this.payload);
182
182
  }
183
183
  ensureType(r) {
184
184
  if (this.type !== r)
@@ -186,14 +186,14 @@ class C {
186
186
  }
187
187
  }
188
188
  class Et extends C {
189
- constructor(r, e, n) {
190
- super(e, n), this.fieldId = r;
189
+ constructor(r, e, _) {
190
+ super(e, _), this.fieldId = r;
191
191
  }
192
192
  get isNull() {
193
193
  return this.type === 1;
194
194
  }
195
195
  }
196
- class V {
196
+ class G {
197
197
  payload;
198
198
  elementType;
199
199
  count;
@@ -205,11 +205,11 @@ class V {
205
205
  const e = r[0];
206
206
  if (this.elementType = e >> 4 & 15, (e & 15) !== 0)
207
207
  throw new Error("Array flags must be zero");
208
- const n = { offset: 1 };
209
- this.count = A(r, n, "ArrayMalformed"), this.offset = n.offset;
208
+ const _ = { offset: 1 };
209
+ this.count = A(r, _, "ArrayMalformed"), this.offset = _.offset;
210
210
  }
211
211
  static create(r) {
212
- return new V(w(r));
212
+ return new G(w(r));
213
213
  }
214
214
  next() {
215
215
  if (this.index >= this.count) {
@@ -239,14 +239,14 @@ class V {
239
239
  case 13: {
240
240
  const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
241
241
  a(this.payload, r.offset, e);
242
- const n = this.payload.subarray(r.offset, r.offset + e);
243
- return this.offset = r.offset + e, new L(this.elementType, n);
242
+ const _ = this.payload.subarray(r.offset, r.offset + e);
243
+ return this.offset = r.offset + e, new L(this.elementType, _);
244
244
  }
245
245
  case 11: {
246
246
  const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
247
247
  a(this.payload, r.offset, e);
248
- const n = this.payload.subarray(r.offset, r.offset + e);
249
- return this.offset = r.offset + e, new L(11, n);
248
+ const _ = this.payload.subarray(r.offset, r.offset + e);
249
+ return this.offset = r.offset + e, new L(11, _);
250
250
  }
251
251
  case 9: {
252
252
  const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
@@ -266,7 +266,7 @@ class L extends C {
266
266
  super(r, e);
267
267
  }
268
268
  }
269
- class G {
269
+ class d {
270
270
  payload;
271
271
  keyType;
272
272
  valueType;
@@ -283,7 +283,7 @@ class G {
283
283
  this.count = A(r, e, "DictMalformed"), this.offset = e.offset;
284
284
  }
285
285
  static create(r) {
286
- return new G(w(r));
286
+ return new d(w(r));
287
287
  }
288
288
  next() {
289
289
  if (this.index >= this.count) {
@@ -292,7 +292,7 @@ class G {
292
292
  return null;
293
293
  }
294
294
  const r = this.readKey(), e = this.readValue();
295
- return this.index++, new _t(r, e);
295
+ return this.index++, new nt(r, e);
296
296
  }
297
297
  readKey() {
298
298
  const r = S(this.keyType);
@@ -302,10 +302,10 @@ class G {
302
302
  return this.offset += r, new C(this.keyType, e);
303
303
  }
304
304
  if (this.keyType === 12 || this.keyType === 13) {
305
- const e = { offset: this.offset }, n = A(this.payload, e, "DictMalformed");
306
- a(this.payload, e.offset, n);
307
- const E = this.payload.subarray(e.offset, e.offset + n);
308
- return this.offset = e.offset + n, new C(this.keyType, E);
305
+ const e = { offset: this.offset }, _ = A(this.payload, e, "DictMalformed");
306
+ a(this.payload, e.offset, _);
307
+ const E = this.payload.subarray(e.offset, e.offset + _);
308
+ return this.offset = e.offset + _, new C(this.keyType, E);
309
309
  }
310
310
  throw new Error("Unsupported dictionary key type");
311
311
  }
@@ -315,14 +315,14 @@ class G {
315
315
  case 13: {
316
316
  const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
317
317
  a(this.payload, r.offset, e);
318
- const n = this.payload.subarray(r.offset, r.offset + e);
319
- return this.offset = r.offset + e, new C(this.valueType, n);
318
+ const _ = this.payload.subarray(r.offset, r.offset + e);
319
+ return this.offset = r.offset + e, new C(this.valueType, _);
320
320
  }
321
321
  case 11: {
322
322
  const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
323
323
  a(this.payload, r.offset, e);
324
- const n = this.payload.subarray(r.offset, r.offset + e);
325
- return this.offset = r.offset + e, new C(11, n);
324
+ const _ = this.payload.subarray(r.offset, r.offset + e);
325
+ return this.offset = r.offset + e, new C(11, _);
326
326
  }
327
327
  case 9: {
328
328
  const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
@@ -351,7 +351,7 @@ class G {
351
351
  }
352
352
  }
353
353
  }
354
- class _t {
354
+ class nt {
355
355
  constructor(r, e) {
356
356
  this.key = r, this.value = e;
357
357
  }
@@ -366,11 +366,11 @@ class I {
366
366
  const e = r.replace(/-/g, "");
367
367
  if (e.length !== 32)
368
368
  throw new Error("Guid string must be 32 hex characters");
369
- const n = new Uint8Array(16), E = I.parseHexSlice(e, 0, 8), _ = I.parseHexSlice(e, 8, 4), s = I.parseHexSlice(e, 12, 4);
370
- I.writeUInt32LE(n, 0, E), I.writeUInt16LE(n, 4, _), I.writeUInt16LE(n, 6, s);
369
+ const _ = new Uint8Array(16), E = I.parseHexSlice(e, 0, 8), n = I.parseHexSlice(e, 8, 4), s = I.parseHexSlice(e, 12, 4);
370
+ I.writeUInt32LE(_, 0, E), I.writeUInt16LE(_, 4, n), I.writeUInt16LE(_, 6, s);
371
371
  for (let i = 0; i < 8; i++)
372
- n[8 + i] = I.parseHexSlice(e, 16 + i * 2, 2);
373
- return new I(n);
372
+ _[8 + i] = I.parseHexSlice(e, 16 + i * 2, 2);
373
+ return new I(_);
374
374
  }
375
375
  static fromBytes(r) {
376
376
  if (r.length !== 16)
@@ -385,8 +385,8 @@ class I {
385
385
  if (e?.getRandomValues)
386
386
  e.getRandomValues(r);
387
387
  else
388
- for (let n = 0; n < r.length; n++)
389
- r[n] = Math.floor(Math.random() * 256);
388
+ for (let _ = 0; _ < r.length; _++)
389
+ r[_] = Math.floor(Math.random() * 256);
390
390
  return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new I(r);
391
391
  }
392
392
  toString() {
@@ -402,18 +402,18 @@ class I {
402
402
  asBytes() {
403
403
  return this.bytes.slice();
404
404
  }
405
- static parseHexSlice(r, e, n) {
406
- const E = r.substr(e, n), _ = Number.parseInt(E, 16);
407
- if (Number.isNaN(_))
405
+ static parseHexSlice(r, e, _) {
406
+ const E = r.substr(e, _), n = Number.parseInt(E, 16);
407
+ if (Number.isNaN(n))
408
408
  throw new Error("Guid string contains invalid characters");
409
- return _ >>> 0;
409
+ return n >>> 0;
410
410
  }
411
- static writeUInt32LE(r, e, n) {
412
- const E = n >>> 0;
411
+ static writeUInt32LE(r, e, _) {
412
+ const E = _ >>> 0;
413
413
  r[e] = E & 255, r[e + 1] = E >>> 8 & 255, r[e + 2] = E >>> 16 & 255, r[e + 3] = E >>> 24 & 255;
414
414
  }
415
- static writeUInt16LE(r, e, n) {
416
- const E = n & 65535;
415
+ static writeUInt16LE(r, e, _) {
416
+ const E = _ & 65535;
417
417
  r[e] = E & 255, r[e + 1] = E >>> 8 & 255;
418
418
  }
419
419
  static readUInt32LE(r, e) {
@@ -429,13 +429,13 @@ class I {
429
429
  function A(t, r, e) {
430
430
  if (r.offset >= t.length)
431
431
  throw new Error(e);
432
- let n = 0, E = 0, _ = 0;
432
+ let _ = 0, E = 0, n = 0;
433
433
  for (; r.offset < t.length; ) {
434
434
  const s = t[r.offset++];
435
- if (_++, n |= (s & 127) << E, (s & 128) === 0) {
436
- if (_ !== st(n))
435
+ if (n++, _ |= (s & 127) << E, (s & 128) === 0) {
436
+ if (n !== st(_))
437
437
  throw new Error("Teleport VarUInt is not canonical");
438
- return n >>> 0;
438
+ return _ >>> 0;
439
439
  }
440
440
  if (E += 7, E >= 35)
441
441
  throw new Error("Teleport VarUInt exceeds 32-bit range");
@@ -479,45 +479,45 @@ function it(t, r) {
479
479
  function B(t, r) {
480
480
  if (r >= t.length)
481
481
  throw new Error("Array payload exceeds bounds");
482
- const e = t[r], n = e >> 4 & 15;
482
+ const e = t[r], _ = e >> 4 & 15;
483
483
  if ((e & 15) !== 0)
484
484
  throw new Error("Array flags must be zero");
485
- const E = { offset: r + 1 }, _ = A(t, E, "ArrayMalformed"), s = S(n);
485
+ const E = { offset: r + 1 }, n = A(t, E, "ArrayMalformed"), s = S(_);
486
486
  if (s >= 0) {
487
- const N = s * _;
487
+ const N = s * n;
488
488
  return a(t, E.offset, N), E.offset + N - r;
489
489
  }
490
490
  let i = E.offset;
491
- for (let N = 0; N < _; N++)
492
- i = M(n, t, i, "ArrayMalformed");
491
+ for (let N = 0; N < n; N++)
492
+ i = M(_, t, i, "ArrayMalformed");
493
493
  return i - r;
494
494
  }
495
495
  function b(t, r) {
496
496
  if (r + 2 > t.length)
497
497
  throw new Error("Dictionary payload too short");
498
- const e = t[r] >> 4 & 15, n = t[r + 1] >> 4 & 15;
498
+ const e = t[r] >> 4 & 15, _ = t[r + 1] >> 4 & 15;
499
499
  if ((t[r] & 15) !== 0 || (t[r + 1] & 15) !== 0)
500
500
  throw new Error("Dictionary key/value flags must be zero");
501
501
  W(e);
502
- const E = { offset: r + 2 }, _ = A(t, E, "DictMalformed");
502
+ const E = { offset: r + 2 }, n = A(t, E, "DictMalformed");
503
503
  let s = E.offset;
504
- for (let i = 0; i < _; i++)
505
- s = M(e, t, s, "DictMalformed"), s = M(n, t, s, "DictMalformed");
504
+ for (let i = 0; i < n; i++)
505
+ s = M(e, t, s, "DictMalformed"), s = M(_, t, s, "DictMalformed");
506
506
  return s - r;
507
507
  }
508
- function M(t, r, e, n) {
508
+ function M(t, r, e, _) {
509
509
  const E = S(t);
510
510
  if (E >= 0)
511
511
  return a(r, e, E), e + E;
512
512
  switch (t) {
513
513
  case 12:
514
514
  case 13: {
515
- const _ = { offset: e }, s = A(r, _, n);
516
- return a(r, _.offset, s), _.offset + s;
515
+ const n = { offset: e }, s = A(r, n, _);
516
+ return a(r, n.offset, s), n.offset + s;
517
517
  }
518
518
  case 11: {
519
- const _ = { offset: e }, s = A(r, _, n);
520
- return a(r, _.offset, s), _.offset + s;
519
+ const n = { offset: e }, s = A(r, n, _);
520
+ return a(r, n.offset, s), n.offset + s;
521
521
  }
522
522
  case 9:
523
523
  return e + B(r, e);
@@ -533,127 +533,135 @@ function x(t) {
533
533
  function w(t) {
534
534
  return t instanceof Uint8Array ? t : new Uint8Array(t);
535
535
  }
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 || {}), c = /* @__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_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_RELAY_AGENT_HELLO = 65576] = "CORE_RELAY_AGENT_HELLO", t[t.CORE_RELAY_HELLO = 65577] = "CORE_RELAY_HELLO", 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.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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(c || {});
537
- const It = 8388609, at = 161083277, At = 164808083, Tt = 1368629611, Nt = 2745379226, Ct = 2950031986, ft = 3282782683, ot = 3284746250, Rt = 4065070594;
538
- function ut(t) {
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 || {}), c = /* @__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_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_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.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.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))(c || {});
537
+ const It = 8388611, at = 271275304, At = 2541432218, Tt = 2986785889, Nt = 3105403172, Ct = 3456383222;
538
+ function ft(t) {
539
539
  const r = {};
540
540
  return X(r), r;
541
541
  }
542
542
  function X(t) {
543
- return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = h.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
543
+ return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
544
544
  }
545
- function ht(t, r) {
545
+ function Rt(t, r) {
546
546
  const e = P.create(t);
547
- return Ut(e, r);
547
+ return ot(e, r);
548
548
  }
549
- function Ut(t, r) {
550
- const e = r ?? ut();
551
- return X(e), lt(t, e), e;
549
+ function ot(t, r) {
550
+ const e = r ?? ft();
551
+ return X(e), ut(t, e), e;
552
552
  }
553
- function lt(t, r) {
553
+ function ut(t, r) {
554
554
  let e;
555
555
  for (; (e = t.next()) !== null; )
556
556
  switch (e.fieldId) {
557
557
  case at: {
558
558
  if (e.isNull) throw new Error();
559
- r.StreamId = e.asString();
559
+ r.TimestampInUs = e.asUInt64();
560
560
  break;
561
561
  }
562
562
  case At: {
563
563
  if (e.isNull) throw new Error();
564
- r.Framerate = e.asFloat64();
564
+ r.DurationInUs = e.asUInt32();
565
565
  break;
566
566
  }
567
567
  case Tt: {
568
568
  if (e.isNull) throw new Error();
569
- r.Description = e.asString();
569
+ r.Data = e.asBinary();
570
570
  break;
571
571
  }
572
572
  case Nt: {
573
573
  if (e.isNull) throw new Error();
574
- r.CodecDetails = e.asString();
574
+ r.IsKey = e.asBool();
575
575
  break;
576
576
  }
577
577
  case Ct: {
578
578
  if (e.isNull) throw new Error();
579
- r.Height = e.asInt32();
580
- break;
581
- }
582
- case ft: {
583
- if (e.isNull) throw new Error();
584
- r.SourceType = e.asString();
585
- break;
586
- }
587
- case ot: {
588
- if (e.isNull) throw new Error();
589
- r.Codec = e.asInt32();
590
- break;
591
- }
592
- case Rt: {
593
- if (e.isNull) throw new Error();
594
- r.Width = e.asInt32();
579
+ r.FrameNumber = e.asInt32();
595
580
  break;
596
581
  }
597
582
  }
598
583
  }
599
- async function St(t, r) {
584
+ async function ht(t, r) {
600
585
  const e = await k(t, It);
601
- return ht(e, r);
586
+ return Rt(e, r);
602
587
  }
603
- const Dt = 8388611, Lt = 271275304, ct = 2541432218, yt = 2986785889, Ot = 3105403172, Pt = 3456383222;
604
- function wt(t) {
588
+ const Ut = 8388609, lt = 161083277, St = 164808083, Dt = 1368629611, Lt = 2514959030, ct = 2745379226, yt = 2950031986, Ot = 3282782683, Pt = 3284746250, wt = 4065070594;
589
+ function gt(t) {
605
590
  const r = {};
606
591
  return z(r), r;
607
592
  }
608
593
  function z(t) {
609
- return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
610
- }
611
- function gt(t, r) {
612
- const e = P.create(t);
613
- return mt(e, r);
594
+ return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = h.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t.CorrelationId = void 0, t;
614
595
  }
615
596
  function mt(t, r) {
616
- const e = r ?? wt();
617
- return z(e), Ft(t, e), e;
597
+ const e = P.create(t);
598
+ return Ft(e, r);
618
599
  }
619
600
  function Ft(t, r) {
601
+ const e = r ?? gt();
602
+ return z(e), Mt(t, e), e;
603
+ }
604
+ function Mt(t, r) {
620
605
  let e;
621
606
  for (; (e = t.next()) !== null; )
622
607
  switch (e.fieldId) {
623
- case Lt: {
608
+ case lt: {
624
609
  if (e.isNull) throw new Error();
625
- r.TimestampInUs = e.asUInt64();
610
+ r.StreamId = e.asString();
611
+ break;
612
+ }
613
+ case St: {
614
+ if (e.isNull) throw new Error();
615
+ r.Framerate = e.asFloat64();
616
+ break;
617
+ }
618
+ case Dt: {
619
+ if (e.isNull) throw new Error();
620
+ r.Description = e.asString();
621
+ break;
622
+ }
623
+ case Lt: {
624
+ if (e.isNull) {
625
+ r.CorrelationId = void 0;
626
+ break;
627
+ }
628
+ r.CorrelationId = e.asString();
626
629
  break;
627
630
  }
628
631
  case ct: {
629
632
  if (e.isNull) throw new Error();
630
- r.DurationInUs = e.asUInt32();
633
+ r.CodecDetails = e.asString();
631
634
  break;
632
635
  }
633
636
  case yt: {
634
637
  if (e.isNull) throw new Error();
635
- r.Data = e.asBinary();
638
+ r.Height = e.asInt32();
636
639
  break;
637
640
  }
638
641
  case Ot: {
639
642
  if (e.isNull) throw new Error();
640
- r.IsKey = e.asBool();
643
+ r.SourceType = e.asString();
641
644
  break;
642
645
  }
643
646
  case Pt: {
644
647
  if (e.isNull) throw new Error();
645
- r.FrameNumber = e.asInt32();
648
+ r.Codec = e.asInt32();
649
+ break;
650
+ }
651
+ case wt: {
652
+ if (e.isNull) throw new Error();
653
+ r.Width = e.asInt32();
646
654
  break;
647
655
  }
648
656
  }
649
657
  }
650
- async function Mt(t, r) {
651
- const e = await k(t, Dt);
652
- return gt(e, r);
658
+ async function Vt(t, r) {
659
+ const e = await k(t, Ut);
660
+ return mt(e, r);
653
661
  }
654
- const dt = "avc1.42E01E", Vt = "vp8", Gt = "vp09.00.10.08", Bt = "av01.0.04M.08", bt = 8, D = (t, r) => self.postMessage(t, r ?? []);
662
+ const Gt = "avc1.42E01E", dt = "vp8", Bt = "vp09.00.10.08", bt = "av01.0.04M.08", Ht = 8, D = (t, r) => self.postMessage(t, r ?? []);
655
663
  let U = null, O = !0, $ = !1;
656
- const T = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
664
+ const T = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
657
665
  function u(t) {
658
666
  const r = t instanceof Error ? t : new Error(String(t));
659
667
  D({ type: "error", error: { name: r.name, message: r.message, stack: r.stack } });
@@ -661,7 +669,7 @@ function u(t) {
661
669
  function g(t, r) {
662
670
  return t << 16 | r & 65535;
663
671
  }
664
- function d(t) {
672
+ function V(t) {
665
673
  const r = T.get(t);
666
674
  if (r)
667
675
  return r;
@@ -686,20 +694,20 @@ function d(t) {
686
694
  return T.set(t, e), e;
687
695
  }
688
696
  function v(t) {
689
- if (t === h.H264) return dt;
690
- if (t === h.Vp8) return Vt;
691
- if (t === h.Vp9) return Gt;
692
- if (t === h.Av1) return Bt;
697
+ if (t === h.H264) return Gt;
698
+ if (t === h.Vp8) return dt;
699
+ if (t === h.Vp9) return Bt;
700
+ if (t === h.Av1) return bt;
693
701
  throw new Error(`Unknown codec: ${t}`);
694
702
  }
695
- function R(t) {
703
+ function o(t) {
696
704
  const r = T.get(t);
697
705
  if (!r || r.numericKey === 0)
698
706
  return;
699
- const e = r.numericKey >> 16 & 65535, n = r.numericKey & 65535;
700
- D({ type: "requestIdr", streamId: t, senderId: e, trackId: n });
707
+ const e = r.numericKey >> 16 & 65535, _ = r.numericKey & 65535;
708
+ D({ type: "requestIdr", streamId: t, senderId: e, trackId: _ });
701
709
  }
702
- async function Ht(t, r) {
710
+ async function Kt(t, r) {
703
711
  try {
704
712
  if (!O || !t.watched)
705
713
  return;
@@ -717,26 +725,26 @@ async function Ht(t, r) {
717
725
  }
718
726
  }
719
727
  }
720
- async function Kt(t, r, e) {
721
- const n = {
728
+ async function Yt(t, r, e) {
729
+ const _ = {
722
730
  codec: t,
723
731
  codedWidth: r > 0 ? r : void 0,
724
732
  codedHeight: e > 0 ? e : void 0,
725
733
  optimizeForLatency: !0
726
734
  };
727
735
  if (typeof VideoDecoder?.isConfigSupported != "function")
728
- return { config: { ...n, hardwareAcceleration: "prefer-hardware" }, isHardwareAccelerated: !0 };
729
- const E = { ...n, hardwareAcceleration: "prefer-hardware" };
736
+ return { config: { ..._, hardwareAcceleration: "prefer-hardware" }, isHardwareAccelerated: !0 };
737
+ const E = { ..._, hardwareAcceleration: "prefer-hardware" };
730
738
  try {
731
- const _ = await VideoDecoder.isConfigSupported(E);
732
- if (_.supported)
733
- return { config: _.config ?? E, isHardwareAccelerated: !0 };
739
+ const n = await VideoDecoder.isConfigSupported(E);
740
+ if (n.supported)
741
+ return { config: n.config ?? E, isHardwareAccelerated: !0 };
734
742
  } catch {
735
743
  }
736
744
  try {
737
- const _ = await VideoDecoder.isConfigSupported(n);
738
- if (_.supported)
739
- return { config: _.config ?? n, isHardwareAccelerated: !1 };
745
+ const n = await VideoDecoder.isConfigSupported(_);
746
+ if (n.supported)
747
+ return { config: n.config ?? _, isHardwareAccelerated: !1 };
740
748
  } catch {
741
749
  }
742
750
  return null;
@@ -752,7 +760,7 @@ function F(t) {
752
760
  }
753
761
  return;
754
762
  }
755
- if (t.pendingDecodeCount > bt) {
763
+ if (t.pendingDecodeCount > Ht) {
756
764
  t.pendingDecodeCount--;
757
765
  try {
758
766
  r.close();
@@ -760,10 +768,10 @@ function F(t) {
760
768
  }
761
769
  return;
762
770
  }
763
- const e = t.width, n = t.height;
771
+ const e = t.width, _ = t.height;
764
772
  if (t.ctx2d && t.surface) {
765
773
  try {
766
- t.ctx2d.drawImage(r, 0, 0, e, n);
774
+ t.ctx2d.drawImage(r, 0, 0, e, _);
767
775
  } catch (E) {
768
776
  u(E);
769
777
  } finally {
@@ -775,7 +783,7 @@ function F(t) {
775
783
  }
776
784
  return;
777
785
  }
778
- Ht(t, r);
786
+ Kt(t, r);
779
787
  },
780
788
  error: (r) => {
781
789
  if (u(r), t.isKeyFrameRequired = !0, t.isReconfiguring = !0, t.decoder && t.decoder.state !== "closed")
@@ -783,7 +791,7 @@ function F(t) {
783
791
  t.decoder.close();
784
792
  } catch {
785
793
  }
786
- R(t.streamId);
794
+ o(t.streamId);
787
795
  }
788
796
  });
789
797
  }
@@ -807,7 +815,7 @@ async function y(t) {
807
815
  t.decoder = F(t);
808
816
  }
809
817
  try {
810
- const E = await Kt(r, t.width, t.height);
818
+ const E = await Yt(r, t.width, t.height);
811
819
  if (v(t.codec) !== r) {
812
820
  if (t.decoder && t.decoder.state !== "closed")
813
821
  try {
@@ -823,7 +831,7 @@ async function y(t) {
823
831
  }
824
832
  (!t.decoder || t.decoder.state === "closed") && (t.decoder = F(t)), t.decoderCodec = r, t.decoderWidth = t.width, t.decoderHeight = t.height;
825
833
  try {
826
- t.decoder.configure(E.config), t.isKeyFrameRequired = !0, R(t.streamId);
834
+ t.decoder.configure(E.config), t.isKeyFrameRequired = !0, o(t.streamId);
827
835
  const s = E.isHardwareAccelerated ? "hardware" : "software", i = t.framerate > 0 ? `@${Math.round(t.framerate)}fps` : "";
828
836
  D({ type: "debug", message: `Decoder configured: codec=${r}, ${t.width}x${t.height}${i}, hw=${s}` });
829
837
  } catch (s) {
@@ -834,26 +842,26 @@ async function y(t) {
834
842
  t.isReconfiguring = !1;
835
843
  }
836
844
  }
837
- async function Yt(t, r) {
838
- const e = await St(t), n = e.StreamId, E = g(r.senderId, r.trackId), _ = d(n);
839
- _.numericKey = E, _.codec = e.Codec, _.width = e.Width, _.height = e.Height, _.framerate = e.Framerate, o.set(E, n), D({ type: "streamBegin", streamId: n, width: e.Width, height: e.Height, codec: e.Codec }), _.watched ? (_.surface && _.ctx2d && e.Width > 0 && e.Height > 0 && (_.surface.width !== e.Width || _.surface.height !== e.Height) && (_.surface.width = e.Width, _.surface.height = e.Height), y(_)) : _.isReconfiguring = !1;
845
+ async function xt(t, r) {
846
+ const e = await Vt(t), _ = e.StreamId, E = g(r.senderId, r.trackId), n = V(_);
847
+ n.numericKey = E, n.codec = e.Codec, n.width = e.Width, n.height = e.Height, n.framerate = e.Framerate, R.set(E, _), D({ type: "streamBegin", streamId: _, width: e.Width, height: e.Height, codec: e.Codec }), n.watched ? (n.surface && n.ctx2d && e.Width > 0 && e.Height > 0 && (n.surface.width !== e.Width || n.surface.height !== e.Height) && (n.surface.width = e.Width, n.surface.height = e.Height), y(n)) : n.isReconfiguring = !1;
840
848
  }
841
- function xt(t) {
842
- const r = g(t.senderId, t.trackId), e = o.get(r);
849
+ function vt(t) {
850
+ const r = g(t.senderId, t.trackId), e = R.get(r);
843
851
  if (!e)
844
852
  return;
845
853
  D({ type: "streamEnd", streamId: e });
846
- const n = T.get(e);
847
- if (!n) {
848
- o.delete(r);
854
+ const _ = T.get(e);
855
+ if (!_) {
856
+ R.delete(r);
849
857
  return;
850
858
  }
851
- if (n.decoder)
859
+ if (_.decoder)
852
860
  try {
853
- n.decoder.close();
861
+ _.decoder.close();
854
862
  } catch {
855
863
  }
856
- T.delete(e), o.delete(r);
864
+ T.delete(e), R.delete(r);
857
865
  }
858
866
  function q(t) {
859
867
  const r = T.get(t);
@@ -872,17 +880,17 @@ function j(t) {
872
880
  r.isReconfiguring = !1;
873
881
  }
874
882
  }
875
- async function vt(t, r) {
876
- const e = g(r.senderId, r.trackId), n = o.get(e);
877
- if (!n)
883
+ async function kt(t, r) {
884
+ const e = g(r.senderId, r.trackId), _ = R.get(e);
885
+ if (!_)
878
886
  return;
879
- const E = T.get(n);
887
+ const E = T.get(_);
880
888
  if (!E || !O || !E.watched || E.isReconfiguring || ((!E.decoder || !E.decoderCodec) && y(E), !E.decoder || !E.decoderCodec))
881
889
  return;
882
- const _ = await Mt(t);
890
+ const n = await ht(t);
883
891
  if (!(E.isReconfiguring || !E.decoder || !E.decoderCodec) && E.decoder.state !== "closed") {
884
892
  if (E.isKeyFrameRequired) {
885
- if (!_.IsKey)
893
+ if (!n.IsKey)
886
894
  return;
887
895
  E.isKeyFrameRequired = !1;
888
896
  }
@@ -891,45 +899,45 @@ async function vt(t, r) {
891
899
  return;
892
900
  E.decoder.decode(
893
901
  new EncodedVideoChunk({
894
- type: _.IsKey ? "key" : "delta",
895
- timestamp: Number(_.TimestampInUs),
896
- duration: _.DurationInUs,
897
- data: _.Data
902
+ type: n.IsKey ? "key" : "delta",
903
+ timestamp: Number(n.TimestampInUs),
904
+ duration: n.DurationInUs,
905
+ data: n.Data
898
906
  })
899
907
  );
900
908
  } catch (s) {
901
909
  if (s instanceof DOMException && s.message.includes("closed"))
902
910
  return;
903
- E.isKeyFrameRequired = !0, R(E.streamId), u(s);
911
+ E.isKeyFrameRequired = !0, o(E.streamId), u(s);
904
912
  }
905
913
  }
906
914
  }
907
- function kt(t) {
908
- const r = g(t.senderId, t.trackId), e = o.get(r);
915
+ function Wt(t) {
916
+ const r = g(t.senderId, t.trackId), e = R.get(r);
909
917
  if (!e)
910
918
  return;
911
- const n = T.get(e);
912
- n && (n.isKeyFrameRequired = !0, n.watched && R(n.streamId));
919
+ const _ = T.get(e);
920
+ _ && (_.isKeyFrameRequired = !0, _.watched && o(_.streamId));
913
921
  }
914
- function Wt(t, r) {
922
+ function Xt(t, r) {
915
923
  switch (r.opcode) {
916
924
  case c.VIDEO_STREAM_BEGIN: {
917
- const e = g(r.senderId, r.trackId), n = o.get(e);
918
- if (n) {
919
- const E = T.get(n);
925
+ const e = g(r.senderId, r.trackId), _ = R.get(e);
926
+ if (_) {
927
+ const E = T.get(_);
920
928
  E && (E.isReconfiguring = !0);
921
929
  }
922
- Yt(t, r);
930
+ xt(t, r);
923
931
  return;
924
932
  }
925
933
  case c.VIDEO_STREAM_END:
926
- xt(r);
934
+ vt(r);
927
935
  return;
928
936
  case c.VIDEO_FRAME:
929
- vt(t, r);
937
+ kt(t, r);
930
938
  return;
931
939
  case c.VIDEO_INVALIDATE_FRAME:
932
- kt(r);
940
+ Wt(r);
933
941
  return;
934
942
  default:
935
943
  return;
@@ -944,11 +952,11 @@ function Q() {
944
952
  U = null;
945
953
  }
946
954
  }
947
- function Xt() {
955
+ function zt() {
948
956
  Q();
949
957
  for (const t of T.values())
950
958
  j(t.streamId);
951
- T.clear(), o.clear();
959
+ T.clear(), R.clear();
952
960
  }
953
961
  self.addEventListener("message", (t) => {
954
962
  const r = t.data;
@@ -957,14 +965,14 @@ self.addEventListener("message", (t) => {
957
965
  return;
958
966
  }
959
967
  if (r.type === "attachSurface") {
960
- const e = r.streamId, n = d(e);
961
- n.watched = !0, n.surface = r.canvas;
968
+ const e = r.streamId, _ = V(e);
969
+ _.watched = !0, _.surface = r.canvas;
962
970
  try {
963
- n.ctx2d = n.surface.getContext("2d", { alpha: !1, desynchronized: !0 });
971
+ _.ctx2d = _.surface.getContext("2d", { alpha: !1, desynchronized: !0 });
964
972
  } catch (E) {
965
- u(E), n.ctx2d = null;
973
+ u(E), _.ctx2d = null;
966
974
  }
967
- n.isKeyFrameRequired = !0, y(n), R(e);
975
+ _.isKeyFrameRequired = !0, y(_), o(e);
968
976
  return;
969
977
  }
970
978
  if (r.type === "detachSurface") {
@@ -973,14 +981,14 @@ self.addEventListener("message", (t) => {
973
981
  }
974
982
  if (r.type === "attachProtocolPort") {
975
983
  Q(), U = r.port, U.addEventListener("message", (e) => {
976
- const n = e.data;
977
- n?.type === "protocol" && n.message instanceof ArrayBuffer && n.headers && Wt(new Uint8Array(n.message), n.headers);
984
+ const _ = e.data;
985
+ _?.type === "protocol" && _.message instanceof ArrayBuffer && _.headers && Xt(new Uint8Array(_.message), _.headers);
978
986
  }), U.start?.();
979
987
  return;
980
988
  }
981
989
  if (r.type === "watchStream") {
982
- const e = d(r.streamId);
983
- e.watched = !0, e.isKeyFrameRequired = !0, y(e), R(e.streamId);
990
+ const e = V(r.streamId);
991
+ e.watched = !0, e.isKeyFrameRequired = !0, y(e), o(e.streamId);
984
992
  return;
985
993
  }
986
994
  if (r.type === "unwatchStream") {
@@ -990,8 +998,8 @@ self.addEventListener("message", (t) => {
990
998
  if (r.type === "setEnabled") {
991
999
  if (O = r.enabled, O)
992
1000
  for (const e of T.values())
993
- e.watched && (e.isKeyFrameRequired = !0, y(e), R(e.streamId));
1001
+ e.watched && (e.isKeyFrameRequired = !0, y(e), o(e.streamId));
994
1002
  return;
995
1003
  }
996
- r.type === "dispose" && Xt();
1004
+ r.type === "dispose" && zt();
997
1005
  });