@ikonai/sdk 1.0.34 → 1.0.36

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.
@@ -1,47 +1,47 @@
1
- function _t(t) {
1
+ function st(t) {
2
2
  if (t.length < 8)
3
3
  throw new Error("Protocol message too short");
4
4
  return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
5
5
  }
6
6
  function It(t) {
7
- const e = Ct(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
7
+ const e = ot(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
8
8
  if (e.length < 27)
9
9
  throw new Error("Protocol payload too short");
10
- const i = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), _ = r.getUint32(12, !0), I = r.getUint32(16, !0), T = r.getUint32(20, !0), N = r.getUint8(24), s = r.getUint8(25), E = r.getUint8(26);
10
+ const i = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), s = r.getUint32(12, !0), I = r.getUint32(16, !0), T = r.getUint32(20, !0), h = r.getUint8(24), _ = r.getUint8(25), E = r.getUint8(26);
11
11
  if (27 + T * 4 > e.length)
12
12
  throw new Error("Protocol header exceeds payload length");
13
13
  const A = [];
14
- let l = 27;
15
- for (let o = 0; o < T; o++)
16
- A.push(r.getUint32(l, !0)), l += 4;
14
+ let R = 27;
15
+ for (let C = 0; C < T; C++)
16
+ A.push(r.getUint32(R, !0)), R += 4;
17
17
  return {
18
18
  length: i,
19
19
  opcode: n,
20
20
  senderId: a,
21
- trackId: _,
21
+ trackId: s,
22
22
  sequenceId: I,
23
23
  targetIds: A,
24
- payloadVersion: N,
25
- payloadType: s,
24
+ payloadVersion: h,
25
+ payloadType: _,
26
26
  flags: E
27
27
  };
28
28
  }
29
29
  function v(t, e, r, i, n) {
30
- const a = n?.trackId ?? 0, _ = n?.sequenceId ?? 0, I = n?.flags ?? 0, T = n?.targetIds ?? [], N = n?.payloadType ?? 8, s = 27 + T.length * 4, E = s + e.length, C = new Uint8Array(E), A = new DataView(C.buffer);
31
- A.setUint32(0, E, !0), A.setUint32(4, t >>> 0, !0), A.setUint32(8, i >>> 0, !0), A.setUint32(12, a >>> 0, !0), A.setUint32(16, _ >>> 0, !0), A.setUint32(20, T.length >>> 0, !0), A.setUint8(24, r & 255), A.setUint8(25, N & 255), A.setUint8(26, I & 255);
32
- let l = 27;
33
- for (let o = 0; o < T.length; o++)
34
- A.setUint32(l, T[o] >>> 0, !0), l += 4;
35
- return C.set(e, s), C;
30
+ const a = n?.trackId ?? 0, s = n?.sequenceId ?? 0, I = n?.flags ?? 0, T = n?.targetIds ?? [], h = n?.payloadType ?? 8, _ = 27 + T.length * 4, E = _ + e.length, o = new Uint8Array(E), A = new DataView(o.buffer);
31
+ A.setUint32(0, E, !0), A.setUint32(4, t >>> 0, !0), A.setUint32(8, i >>> 0, !0), A.setUint32(12, a >>> 0, !0), A.setUint32(16, s >>> 0, !0), A.setUint32(20, T.length >>> 0, !0), A.setUint8(24, r & 255), A.setUint8(25, h & 255), A.setUint8(26, I & 255);
32
+ let R = 27;
33
+ for (let C = 0; C < T.length; C++)
34
+ A.setUint32(R, T[C] >>> 0, !0), R += 4;
35
+ return o.set(e, _), o;
36
36
  }
37
- 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 || {});
37
+ var D = /* @__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))(D || {});
38
38
  const Tt = 161, At = 162, m = new TextEncoder();
39
39
  new TextDecoder("utf-8", { fatal: !0 });
40
40
  class F {
41
41
  constructor(e = 1) {
42
42
  this.version = e, this.buffer.writeByte(Tt), this.buffer.writeVarUInt(e >>> 0);
43
43
  }
44
- buffer = new g();
44
+ buffer = new P();
45
45
  closed = !1;
46
46
  cached;
47
47
  writeInt32Field(e, r) {
@@ -66,7 +66,7 @@ class F {
66
66
  this.writeFixedField(e, 2, () => this.buffer.writeByte(r ? 1 : 0));
67
67
  }
68
68
  writeGuidField(e, r) {
69
- const i = r instanceof h ? r.asBytes() : r;
69
+ const i = r instanceof N ? r.asBytes() : r;
70
70
  if (i.length !== 16)
71
71
  throw new Error("Guid payload must be 16 bytes");
72
72
  this.writeFixedField(e, 14, () => this.buffer.writeBytes(i));
@@ -93,8 +93,8 @@ class F {
93
93
  writeDictionaryField(e, r, i, n) {
94
94
  const a = new k(r, i);
95
95
  n(a);
96
- const _ = a.finish();
97
- this.writeVariableField(e, 10, _);
96
+ const s = a.finish();
97
+ this.writeVariableField(e, 10, s);
98
98
  }
99
99
  finish() {
100
100
  return this.closed || (this.buffer.writeByte(At), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
@@ -106,14 +106,14 @@ class F {
106
106
  this.writeFieldHeader(e, r, i.length), this.buffer.writeBytes(i);
107
107
  }
108
108
  writeFieldHeader(e, r, i) {
109
- this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(V(r)), Nt(r) && this.buffer.writeVarUInt(i >>> 0);
109
+ this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(V(r)), ht(r) && this.buffer.writeVarUInt(i >>> 0);
110
110
  }
111
111
  }
112
112
  class M {
113
113
  constructor(e) {
114
114
  this.elementType = e;
115
115
  }
116
- payload = new g();
116
+ payload = new P();
117
117
  count = 0;
118
118
  writeInt32(e) {
119
119
  this.ensureElementType(
@@ -162,7 +162,7 @@ class M {
162
162
  14
163
163
  /* Guid */
164
164
  ), this.count++;
165
- const r = e instanceof h ? e.asBytes() : e;
165
+ const r = e instanceof N ? e.asBytes() : e;
166
166
  if (r.length !== 16)
167
167
  throw new Error("Guid payload must be 16 bytes");
168
168
  this.payload.writeBytes(r);
@@ -212,36 +212,36 @@ class M {
212
212
  this.payload.writeBytes(a);
213
213
  }
214
214
  finish() {
215
- const e = new g();
215
+ const e = new P();
216
216
  return e.writeByte(V(this.elementType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
217
217
  }
218
218
  ensureElementType(e) {
219
219
  if (this.elementType !== e)
220
- throw new Error(`Array element type is ${L[this.elementType]}, expected ${L[e]}`);
220
+ throw new Error(`Array element type is ${D[this.elementType]}, expected ${D[e]}`);
221
221
  }
222
222
  }
223
223
  class k {
224
224
  constructor(e, r) {
225
- this.keyType = e, this.valueType = r, ot(e);
225
+ this.keyType = e, this.valueType = r, Ct(e);
226
226
  }
227
- payload = new g();
227
+ payload = new P();
228
228
  count = 0;
229
229
  entryOpen = !1;
230
230
  beginEntry() {
231
231
  if (this.entryOpen)
232
232
  throw new Error("Previous dictionary entry not completed");
233
- return this.count++, this.entryOpen = !0, new ht(this.keyType, this.valueType, this.payload, () => {
233
+ return this.count++, this.entryOpen = !0, new Nt(this.keyType, this.valueType, this.payload, () => {
234
234
  this.entryOpen = !1;
235
235
  });
236
236
  }
237
237
  finish() {
238
238
  if (this.entryOpen)
239
239
  throw new Error("Dictionary entry not completed");
240
- const e = new g();
240
+ const e = new P();
241
241
  return e.writeByte(V(this.keyType)), e.writeByte(V(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
242
242
  }
243
243
  }
244
- class ht {
244
+ class Nt {
245
245
  constructor(e, r, i, n) {
246
246
  this.keyType = e, this.valueType = r, this.payload = i, this.onComplete = n;
247
247
  }
@@ -295,7 +295,7 @@ class ht {
295
295
  14
296
296
  /* Guid */
297
297
  );
298
- const r = e instanceof h ? e.asBytes() : e;
298
+ const r = e instanceof N ? e.asBytes() : e;
299
299
  if (r.length !== 16)
300
300
  throw new Error("Guid payload must be 16 bytes");
301
301
  this.payload.writeBytes(r), this.keyWritten = !0;
@@ -361,7 +361,7 @@ class ht {
361
361
  14
362
362
  /* Guid */
363
363
  );
364
- const r = e instanceof h ? e.asBytes() : e;
364
+ const r = e instanceof N ? e.asBytes() : e;
365
365
  if (r.length !== 16)
366
366
  throw new Error("Guid payload must be 16 bytes");
367
367
  this.payload.writeBytes(r), this.valueWritten = !0;
@@ -425,14 +425,14 @@ class ht {
425
425
  }
426
426
  ensureKeyType(e) {
427
427
  if (this.keyType !== e)
428
- throw new Error(`Dictionary key type is ${L[this.keyType]}, expected ${L[e]}`);
428
+ throw new Error(`Dictionary key type is ${D[this.keyType]}, expected ${D[e]}`);
429
429
  }
430
430
  ensureValueType(e) {
431
431
  if (this.valueType !== e)
432
- throw new Error(`Dictionary value type is ${L[this.valueType]}, expected ${L[e]}`);
432
+ throw new Error(`Dictionary value type is ${D[this.valueType]}, expected ${D[e]}`);
433
433
  }
434
434
  }
435
- class h {
435
+ class N {
436
436
  constructor(e) {
437
437
  this.bytes = e;
438
438
  }
@@ -442,19 +442,19 @@ class h {
442
442
  const r = e.replace(/-/g, "");
443
443
  if (r.length !== 32)
444
444
  throw new Error("Guid string must be 32 hex characters");
445
- const i = new Uint8Array(16), n = h.parseHexSlice(r, 0, 8), a = h.parseHexSlice(r, 8, 4), _ = h.parseHexSlice(r, 12, 4);
446
- h.writeUInt32LE(i, 0, n), h.writeUInt16LE(i, 4, a), h.writeUInt16LE(i, 6, _);
445
+ const i = new Uint8Array(16), n = N.parseHexSlice(r, 0, 8), a = N.parseHexSlice(r, 8, 4), s = N.parseHexSlice(r, 12, 4);
446
+ N.writeUInt32LE(i, 0, n), N.writeUInt16LE(i, 4, a), N.writeUInt16LE(i, 6, s);
447
447
  for (let I = 0; I < 8; I++)
448
- i[8 + I] = h.parseHexSlice(r, 16 + I * 2, 2);
449
- return new h(i);
448
+ i[8 + I] = N.parseHexSlice(r, 16 + I * 2, 2);
449
+ return new N(i);
450
450
  }
451
451
  static fromBytes(e) {
452
452
  if (e.length !== 16)
453
453
  throw new Error("Guid byte array must be 16 bytes");
454
- return new h(Uint8Array.from(e));
454
+ return new N(Uint8Array.from(e));
455
455
  }
456
456
  static createZero() {
457
- return new h(new Uint8Array(16));
457
+ return new N(new Uint8Array(16));
458
458
  }
459
459
  static createRandom() {
460
460
  const e = new Uint8Array(16), r = globalThis.crypto;
@@ -463,14 +463,14 @@ class h {
463
463
  else
464
464
  for (let i = 0; i < e.length; i++)
465
465
  e[i] = Math.floor(Math.random() * 256);
466
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new h(e);
466
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new N(e);
467
467
  }
468
468
  toString() {
469
469
  const e = this.bytes;
470
470
  return [
471
- h.toHex(h.readUInt32LE(e, 0), 8),
472
- h.toHex(h.readUInt16LE(e, 4), 4),
473
- h.toHex(h.readUInt16LE(e, 6), 4),
471
+ N.toHex(N.readUInt32LE(e, 0), 8),
472
+ N.toHex(N.readUInt16LE(e, 4), 4),
473
+ N.toHex(N.readUInt16LE(e, 6), 4),
474
474
  J(e.subarray(8, 10)),
475
475
  J(e.subarray(10, 16))
476
476
  ].join("-");
@@ -502,13 +502,13 @@ class h {
502
502
  return (e >>> 0).toString(16).padStart(r, "0");
503
503
  }
504
504
  }
505
- class g {
505
+ class P {
506
506
  static INITIAL_CAPACITY = 256;
507
507
  buffer;
508
508
  dataView;
509
509
  length = 0;
510
510
  constructor() {
511
- this.buffer = new Uint8Array(g.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
511
+ this.buffer = new Uint8Array(P.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
512
512
  }
513
513
  ensureCapacity(e) {
514
514
  const r = this.length + e;
@@ -559,40 +559,40 @@ function V(t, e = 0) {
559
559
  throw new Error("Teleport flags must fit into 4 bits");
560
560
  return (t & 15) << 4 | e & 15;
561
561
  }
562
- function Nt(t) {
562
+ function ht(t) {
563
563
  return t === 12 || t === 13 || t === 9 || t === 11 || t === 10;
564
564
  }
565
- function ot(t) {
565
+ function Ct(t) {
566
566
  if (t === 9 || t === 11 || t === 10 || t === 1)
567
567
  throw new Error("Dictionary keys must be primitive Teleport types");
568
568
  }
569
569
  function J(t) {
570
570
  return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
571
571
  }
572
- function Ct(t) {
572
+ function ot(t) {
573
573
  return t instanceof Uint8Array ? t : new Uint8Array(t);
574
574
  }
575
- var u = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(u || {}), Z = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_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.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.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", 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))(Z || {});
576
- const p = 5, ut = 8388609, lt = 161083277, Rt = 164808083, ft = 1368629611, Ut = 2745379226, ct = 2950031986, St = 3282782683, yt = 3284746250, wt = 4065070594;
575
+ var u = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(u || {}), Z = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_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.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.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.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))(Z || {});
576
+ const p = 5, ut = 8388609, Rt = 161083277, lt = 164808083, Ut = 1368629611, ft = 2745379226, ct = 2950031986, St = 3282782683, yt = 3284746250, wt = 4065070594;
577
577
  function W(t) {
578
578
  const e = {};
579
- return Dt(e), t && Object.assign(e, t), e;
579
+ return Lt(e), t && Object.assign(e, t), e;
580
580
  }
581
- function Dt(t) {
581
+ function Lt(t) {
582
582
  return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = u.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
583
583
  }
584
- function Lt(t) {
584
+ function Dt(t) {
585
585
  const e = new F(p);
586
- return gt(t, e), e.finish();
586
+ return Pt(t, e), e.finish();
587
587
  }
588
- function gt(t, e) {
589
- e.writeStringField(lt, t.StreamId), e.writeFloat64Field(Rt, t.Framerate), e.writeStringField(ft, t.Description), e.writeStringField(Ut, t.CodecDetails), e.writeInt32Field(ct, t.Height | 0), e.writeStringField(St, t.SourceType), e.writeInt32Field(yt, t.Codec), e.writeInt32Field(wt, t.Width | 0);
588
+ function Pt(t, e) {
589
+ e.writeStringField(Rt, t.StreamId), e.writeFloat64Field(lt, t.Framerate), e.writeStringField(Ut, t.Description), e.writeStringField(ft, t.CodecDetails), e.writeInt32Field(ct, t.Height | 0), e.writeStringField(St, t.SourceType), e.writeInt32Field(yt, t.Codec), e.writeInt32Field(wt, t.Width | 0);
590
590
  }
591
591
  function Y(t, e, r) {
592
- const i = Lt(t);
592
+ const i = Dt(t);
593
593
  return v(ut, i, p, e, r);
594
594
  }
595
- const tt = 1, dt = 8388611, Ft = 271275304, Pt = 2541432218, Ot = 2986785889, mt = 3105403172, Vt = 3456383222;
595
+ const tt = 1, gt = 8388611, Ft = 271275304, Ot = 2541432218, dt = 2986785889, mt = 3105403172, Vt = 3456383222;
596
596
  function $(t) {
597
597
  const e = {};
598
598
  return Mt(e), t && Object.assign(e, t), e;
@@ -605,11 +605,11 @@ function Bt(t) {
605
605
  return Gt(t, e), e.finish();
606
606
  }
607
607
  function Gt(t, e) {
608
- e.writeUInt64Field(Ft, t.TimestampInUs), e.writeUInt32Field(Pt, t.DurationInUs >>> 0), e.writeBinaryField(Ot, t.Data), e.writeBoolField(mt, t.IsKey), e.writeInt32Field(Vt, t.FrameNumber | 0);
608
+ e.writeUInt64Field(Ft, t.TimestampInUs), e.writeUInt32Field(Ot, t.DurationInUs >>> 0), e.writeBinaryField(dt, t.Data), e.writeBoolField(mt, t.IsKey), e.writeInt32Field(Vt, t.FrameNumber | 0);
609
609
  }
610
610
  function x(t, e, r) {
611
611
  const i = Bt(t);
612
- return v(dt, i, tt, e, r);
612
+ return v(gt, i, tt, e, r);
613
613
  }
614
614
  const et = 1, bt = 8388610;
615
615
  function Ht(t) {
@@ -671,11 +671,11 @@ const q = ["h264", "vp8", "vp9", "av1"], Yt = [
671
671
  // 480p (VGA)
672
672
  { width: 640, height: 360 }
673
673
  // 360p
674
- ], $t = 0.1, xt = 30, Xt = 5e4, jt = 5e5, Qt = 8e6, zt = 8, Jt = 3, D = (t) => self.postMessage(t);
674
+ ], $t = 0.1, xt = 30, Xt = 5e4, jt = 5e5, Qt = 8e6, zt = 8, Jt = 3, L = (t) => self.postMessage(t);
675
675
  let c = null, w = null;
676
676
  function y(t, e) {
677
677
  const r = t instanceof Error ? t : new Error(String(t));
678
- D({ type: "error", captureId: e, error: { name: r.name, message: r.message, stack: r.stack } });
678
+ L({ type: "error", captureId: e, error: { name: r.name, message: r.message, stack: r.stack } });
679
679
  }
680
680
  function K(t) {
681
681
  if (!Array.isArray(t) || t.length === 0)
@@ -701,8 +701,8 @@ const Zt = {
701
701
  [u.Av1]: nt
702
702
  };
703
703
  function pt(t, e, r, i) {
704
- const n = t * e, a = $t * (r / xt), _ = Math.floor(n * a);
705
- return Math.max(Xt, Math.floor(i ?? Math.max(jt, Math.min(_, Qt))));
704
+ const n = t * e, a = $t * (r / xt), s = Math.floor(n * a);
705
+ return Math.max(Xt, Math.floor(i ?? Math.max(jt, Math.min(s, Qt))));
706
706
  }
707
707
  function te(t, e) {
708
708
  const r = [{ width: t, height: e }];
@@ -710,7 +710,7 @@ function te(t, e) {
710
710
  (i.width < t || i.height < e) && (r.some((n) => n.width === i.width && n.height === i.height) || r.push(i));
711
711
  return r;
712
712
  }
713
- async function ee(t, e, r, i, n, a, _) {
713
+ async function ee(t, e, r, i, n, a, s) {
714
714
  const I = {
715
715
  codec: e,
716
716
  width: r,
@@ -722,13 +722,13 @@ async function ee(t, e, r, i, n, a, _) {
722
722
  };
723
723
  if (typeof VideoEncoder?.isConfigSupported != "function")
724
724
  return null;
725
- if (_) {
726
- const T = { ...I, hardwareAcceleration: _ };
725
+ if (s) {
726
+ const T = { ...I, hardwareAcceleration: s };
727
727
  try {
728
- const N = await VideoEncoder.isConfigSupported(T);
729
- if (N.supported) {
730
- const s = N.config ?? T;
731
- return { config: s, isHardwareAccelerated: s.hardwareAcceleration === "prefer-hardware" };
728
+ const h = await VideoEncoder.isConfigSupported(T);
729
+ if (h.supported) {
730
+ const _ = h.config ?? T;
731
+ return { config: _, isHardwareAccelerated: _.hardwareAcceleration === "prefer-hardware" };
732
732
  }
733
733
  } catch {
734
734
  }
@@ -743,7 +743,7 @@ async function ee(t, e, r, i, n, a, _) {
743
743
  }
744
744
  async function X(t, e, r, i) {
745
745
  const n = Math.max(1, Math.floor(r?.framerate ?? H)), a = K(r?.preferredCodecs), I = r?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0], T = te(t, e);
746
- let N = a;
746
+ let h = a;
747
747
  if (i) {
748
748
  const E = {
749
749
  [u.H264]: "h264",
@@ -751,17 +751,17 @@ async function X(t, e, r, i) {
751
751
  [u.Vp9]: "vp9",
752
752
  [u.Av1]: "av1"
753
753
  }[i];
754
- E && !a.includes(E) ? N = [E, ...a] : E && (N = [E, ...a.filter((C) => C !== E)]);
755
- }
756
- for (const s of T) {
757
- const E = pt(s.width, s.height, n, r?.bitrate);
758
- for (const C of I)
759
- for (const A of N) {
760
- const l = qt(A), o = Zt[l] ?? [];
761
- for (const U of o) {
762
- const R = await ee(l, U, s.width, s.height, E, n, C);
763
- if (R)
764
- return { codec: l, config: R.config, isHardwareAccelerated: R.isHardwareAccelerated };
754
+ E && !a.includes(E) ? h = [E, ...a] : E && (h = [E, ...a.filter((o) => o !== E)]);
755
+ }
756
+ for (const _ of T) {
757
+ const E = pt(_.width, _.height, n, r?.bitrate);
758
+ for (const o of I)
759
+ for (const A of h) {
760
+ const R = qt(A), C = Zt[R] ?? [];
761
+ for (const f of C) {
762
+ const l = await ee(R, f, _.width, _.height, E, n, o);
763
+ if (l)
764
+ return { codec: R, config: l.config, isHardwareAccelerated: l.isHardwareAccelerated };
765
765
  }
766
766
  }
767
767
  }
@@ -770,23 +770,23 @@ async function X(t, e, r, i) {
770
770
  function re(t) {
771
771
  return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t.buffer : t.slice().buffer;
772
772
  }
773
- function d(t) {
773
+ function g(t) {
774
774
  if (!c)
775
775
  return;
776
776
  const e = re(t);
777
777
  c.postMessage({ type: "send", message: e }, [e]);
778
778
  }
779
- const f = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), O = [];
779
+ const U = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), d = [];
780
780
  function j(t) {
781
- for (let e = 0; e < O.length; e++)
782
- if (O[e].length >= t) {
783
- const r = O[e];
784
- return O.splice(e, 1), r.length === t ? r : new Uint8Array(r.buffer, 0, t);
781
+ for (let e = 0; e < d.length; e++)
782
+ if (d[e].length >= t) {
783
+ const r = d[e];
784
+ return d.splice(e, 1), r.length === t ? r : new Uint8Array(r.buffer, 0, t);
785
785
  }
786
786
  return new Uint8Array(t);
787
787
  }
788
788
  function Q(t) {
789
- O.length < zt && t.buffer.byteLength > 0 && O.push(new Uint8Array(t.buffer));
789
+ d.length < zt && t.buffer.byteLength > 0 && d.push(new Uint8Array(t.buffer));
790
790
  }
791
791
  function z(t) {
792
792
  try {
@@ -834,35 +834,35 @@ async function ne(t) {
834
834
  async function ae(t) {
835
835
  if (!c)
836
836
  throw new Error("Video capture worker missing send port");
837
- if (f.has(t.captureId))
837
+ if (U.has(t.captureId))
838
838
  return;
839
- const e = Math.max(1, Math.floor(t.width)), r = Math.max(1, Math.floor(t.height)), i = await X(e, r, t.options), n = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? kt)), a = i.config.width ?? e, _ = i.config.height ?? r, I = i.config.framerate ?? H, T = i.config.bitrate ?? 0, N = t.trackSettings?.frameRate, s = N ?? I, E = t.options?.framerate ?? H, C = t.kind === "screen" ? Math.floor(1e6 / E) : 0, A = new VideoEncoder({
839
+ const e = Math.max(1, Math.floor(t.width)), r = Math.max(1, Math.floor(t.height)), i = await X(e, r, t.options), n = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? kt)), a = i.config.width ?? e, s = i.config.height ?? r, I = i.config.framerate ?? H, T = i.config.bitrate ?? 0, h = t.trackSettings?.frameRate, _ = h ?? I, E = t.options?.framerate ?? H, o = t.kind === "screen" ? Math.floor(1e6 / E) : 0, A = new VideoEncoder({
840
840
  output: (S) => {
841
- const P = f.get(t.captureId);
842
- if (!P || P.stopped)
841
+ const O = U.get(t.captureId);
842
+ if (!O || O.stopped)
843
843
  return;
844
844
  const b = j(S.byteLength);
845
845
  S.copyTo(b);
846
- const st = $({
846
+ const _t = $({
847
847
  Data: b,
848
- FrameNumber: P.frameCounter,
848
+ FrameNumber: O.frameCounter,
849
849
  IsKey: S.type === "key",
850
850
  TimestampInUs: BigInt(Math.max(0, Math.round(S.timestamp ?? 0))),
851
851
  DurationInUs: Math.max(0, Math.round(S.duration ?? 0))
852
- }), Et = x(st, P.senderId, { trackId: P.trackId, targetIds: P.targetIds });
853
- Q(b), d(Et);
852
+ }), Et = x(_t, O.senderId, { trackId: O.trackId, targetIds: O.targetIds });
853
+ Q(b), g(Et);
854
854
  },
855
855
  error: (S) => {
856
856
  y(S, t.captureId);
857
857
  }
858
858
  });
859
859
  A.configure(i.config);
860
- const l = i.isHardwareAccelerated ? "hardware" : "software", o = t.kind === "screen" ? `${Math.round(E)}fps (throttled from ${N !== void 0 ? Math.round(N) : "?"}fps)` : N !== void 0 ? `${Math.round(s)}fps (track)` : `${Math.round(I)}fps (configured)`;
861
- D({
860
+ const R = i.isHardwareAccelerated ? "hardware" : "software", C = t.kind === "screen" ? `${Math.round(E)}fps (throttled from ${h !== void 0 ? Math.round(h) : "?"}fps)` : h !== void 0 ? `${Math.round(_)}fps (track)` : `${Math.round(I)}fps (configured)`;
861
+ L({
862
862
  type: "debug",
863
- message: `Encoder configured: codec=${i.config.codec}, ${a}x${_}@${o}, bitrate=${T}bps, hw=${l}`
863
+ message: `Encoder configured: codec=${i.config.codec}, ${a}x${s}@${C}, bitrate=${T}bps, hw=${R}`
864
864
  });
865
- const U = t.readable.getReader(), R = {
865
+ const f = t.readable.getReader(), l = {
866
866
  captureId: t.captureId,
867
867
  streamId: t.streamId,
868
868
  sourceType: t.sourceType,
@@ -870,13 +870,13 @@ async function ae(t) {
870
870
  senderId: t.senderId,
871
871
  trackId: t.trackId,
872
872
  width: a,
873
- height: _,
874
- framerate: s,
873
+ height: s,
874
+ framerate: _,
875
875
  codec: i.codec,
876
876
  encoder: A,
877
877
  encoderConfig: i.config,
878
878
  options: t.options,
879
- reader: U,
879
+ reader: f,
880
880
  frameCounter: 0,
881
881
  keyFrameIntervalFrames: n,
882
882
  forceKeyframe: !0,
@@ -886,31 +886,31 @@ async function ae(t) {
886
886
  targetIds: t.options?.targetIds,
887
887
  targetFramerate: E,
888
888
  lastEncodedTimestamp: 0,
889
- minFrameIntervalUs: C
889
+ minFrameIntervalUs: o
890
890
  };
891
- f.set(t.captureId, R), B.set(t.trackId, t.captureId);
892
- const G = t.kind === "screen" ? E : s;
893
- d(
891
+ U.set(t.captureId, l), B.set(t.trackId, t.captureId);
892
+ const G = t.kind === "screen" ? E : _;
893
+ g(
894
894
  Y(
895
895
  W({
896
896
  StreamId: t.streamId,
897
897
  Description: `${t.kind}:${t.streamId}`,
898
898
  SourceType: t.sourceType,
899
- Codec: R.codec,
899
+ Codec: l.codec,
900
900
  CodecDetails: i.config.codec,
901
901
  Width: a,
902
- Height: _,
902
+ Height: s,
903
903
  Framerate: G
904
904
  }),
905
905
  t.senderId,
906
- { trackId: t.trackId, targetIds: R.targetIds }
906
+ { trackId: t.trackId, targetIds: l.targetIds }
907
907
  )
908
- ), D({ type: "started", captureId: t.captureId, codec: R.codec, width: a, height: _ }), ne(R);
908
+ ), L({ type: "started", captureId: t.captureId, codec: l.codec, width: a, height: s }), ne(l);
909
909
  }
910
910
  async function at(t) {
911
- const e = f.get(t);
911
+ const e = U.get(t);
912
912
  if (e) {
913
- e.stopped = !0, f.delete(t), B.delete(e.trackId);
913
+ e.stopped = !0, U.delete(t), B.delete(e.trackId);
914
914
  try {
915
915
  await e.reader.cancel();
916
916
  } catch {
@@ -919,14 +919,14 @@ async function at(t) {
919
919
  await e.encoder.flush();
920
920
  } catch {
921
921
  }
922
- z(e), d(vt(Ht({}), e.senderId, { trackId: e.trackId, targetIds: e.targetIds })), D({ type: "stopped", captureId: e.captureId });
922
+ z(e), g(vt(Ht({}), e.senderId, { trackId: e.trackId, targetIds: e.targetIds })), L({ type: "stopped", captureId: e.captureId });
923
923
  }
924
924
  }
925
- async function se(t, e, r) {
926
- const i = f.get(t);
925
+ async function _e(t, e, r) {
926
+ const i = U.get(t);
927
927
  if (!i || i.stopped || i.width === e && i.height === r)
928
928
  return;
929
- i.isReconfiguring = !0, D({
929
+ i.isReconfiguring = !0, L({
930
930
  type: "debug",
931
931
  message: `Window resize detected: ${i.width}x${i.height} -> ${e}x${r}`
932
932
  });
@@ -937,27 +937,27 @@ async function se(t, e, r) {
937
937
  i.width = e, i.height = r;
938
938
  const n = await X(e, r, i.options, i.codec);
939
939
  z(i), i.codec = n.codec, i.encoderConfig = n.config, i.isHardwareAccelerated = n.isHardwareAccelerated, i.encoder = new VideoEncoder({
940
- output: (s) => {
941
- const E = f.get(t);
940
+ output: (_) => {
941
+ const E = U.get(t);
942
942
  if (!E || E.stopped)
943
943
  return;
944
- const C = j(s.byteLength);
945
- s.copyTo(C);
944
+ const o = j(_.byteLength);
945
+ _.copyTo(o);
946
946
  const A = $({
947
- Data: C,
947
+ Data: o,
948
948
  FrameNumber: E.frameCounter,
949
- IsKey: s.type === "key",
950
- TimestampInUs: BigInt(Math.max(0, Math.round(s.timestamp ?? 0))),
951
- DurationInUs: Math.max(0, Math.round(s.duration ?? 0))
952
- }), l = x(A, E.senderId, { trackId: E.trackId, targetIds: E.targetIds });
953
- Q(C), d(l);
949
+ IsKey: _.type === "key",
950
+ TimestampInUs: BigInt(Math.max(0, Math.round(_.timestamp ?? 0))),
951
+ DurationInUs: Math.max(0, Math.round(_.duration ?? 0))
952
+ }), R = x(A, E.senderId, { trackId: E.trackId, targetIds: E.targetIds });
953
+ Q(o), g(R);
954
954
  },
955
- error: (s) => {
956
- y(s, t);
955
+ error: (_) => {
956
+ y(_, t);
957
957
  }
958
958
  }), i.encoder.configure(n.config), i.forceKeyframe = !0;
959
- const a = n.config.width ?? e, _ = n.config.height ?? r, I = i.kind === "screen" ? i.targetFramerate : i.framerate;
960
- d(
959
+ const a = n.config.width ?? e, s = n.config.height ?? r, I = i.kind === "screen" ? i.targetFramerate : i.framerate;
960
+ g(
961
961
  Y(
962
962
  W({
963
963
  StreamId: i.streamId,
@@ -966,92 +966,92 @@ async function se(t, e, r) {
966
966
  Codec: i.codec,
967
967
  CodecDetails: n.config.codec,
968
968
  Width: a,
969
- Height: _,
969
+ Height: s,
970
970
  Framerate: I
971
971
  }),
972
972
  i.senderId,
973
973
  { trackId: i.trackId, targetIds: i.targetIds }
974
974
  )
975
975
  ), i.isReconfiguring = !1;
976
- const T = n.isHardwareAccelerated ? "hardware" : "software", N = i.kind === "screen" ? `${Math.round(i.targetFramerate)}fps (throttled)` : `${Math.round(i.framerate)}fps`;
977
- D({
976
+ const T = n.isHardwareAccelerated ? "hardware" : "software", h = i.kind === "screen" ? `${Math.round(i.targetFramerate)}fps (throttled)` : `${Math.round(i.framerate)}fps`;
977
+ L({
978
978
  type: "debug",
979
- message: `Encoder reconfigured: codec=${n.config.codec}, ${a}x${_}@${N}, bitrate=${n.config.bitrate ?? 0}bps, hw=${T}`
979
+ message: `Encoder reconfigured: codec=${n.config.codec}, ${a}x${s}@${h}, bitrate=${n.config.bitrate ?? 0}bps, hw=${T}`
980
980
  });
981
981
  }
982
982
  async function Ee(t, e) {
983
- const r = f.get(t);
983
+ const r = U.get(t);
984
984
  if (!r || r.stopped)
985
985
  return;
986
- const i = K(r.options?.preferredCodecs), n = K(e.preferredCodecs), a = JSON.stringify(i) !== JSON.stringify(n), _ = r.options?.bitrate !== e.bitrate, I = r.options?.framerate !== e.framerate, T = e.width !== void 0 && r.options?.width !== e.width, N = e.height !== void 0 && r.options?.height !== e.height;
987
- if (!a && !_ && !I && !T && !N)
986
+ const i = K(r.options?.preferredCodecs), n = K(e.preferredCodecs), a = JSON.stringify(i) !== JSON.stringify(n), s = r.options?.bitrate !== e.bitrate, I = r.options?.framerate !== e.framerate, T = e.width !== void 0 && r.options?.width !== e.width, h = e.height !== void 0 && r.options?.height !== e.height;
987
+ if (!a && !s && !I && !T && !h)
988
988
  return;
989
- r.isReconfiguring = !0, D({
989
+ r.isReconfiguring = !0, L({
990
990
  type: "debug",
991
- message: `Options update: codec=${a}, bitrate=${_}, framerate=${I}, width=${T}, height=${N}`
992
- }), r.options = e, r.kind === "camera" && (T && e.width !== void 0 && (r.width = e.width), N && e.height !== void 0 && (r.height = e.height));
991
+ message: `Options update: codec=${a}, bitrate=${s}, framerate=${I}, width=${T}, height=${h}`
992
+ }), r.options = e, r.kind === "camera" && (T && e.width !== void 0 && (r.width = e.width), h && e.height !== void 0 && (r.height = e.height));
993
993
  try {
994
994
  await r.encoder.flush();
995
995
  } catch {
996
996
  }
997
- const s = await X(r.width, r.height, e);
998
- z(r), r.codec = s.codec, r.encoderConfig = s.config, r.isHardwareAccelerated = s.isHardwareAccelerated, r.framerate = s.config.framerate ?? r.framerate, r.encoder = new VideoEncoder({
999
- output: (o) => {
1000
- const U = f.get(t);
1001
- if (!U || U.stopped)
997
+ const _ = await X(r.width, r.height, e);
998
+ z(r), r.codec = _.codec, r.encoderConfig = _.config, r.isHardwareAccelerated = _.isHardwareAccelerated, r.framerate = _.config.framerate ?? r.framerate, r.encoder = new VideoEncoder({
999
+ output: (C) => {
1000
+ const f = U.get(t);
1001
+ if (!f || f.stopped)
1002
1002
  return;
1003
- const R = j(o.byteLength);
1004
- o.copyTo(R);
1003
+ const l = j(C.byteLength);
1004
+ C.copyTo(l);
1005
1005
  const G = $({
1006
- Data: R,
1007
- FrameNumber: U.frameCounter,
1008
- IsKey: o.type === "key",
1009
- TimestampInUs: BigInt(Math.max(0, Math.round(o.timestamp ?? 0))),
1010
- DurationInUs: Math.max(0, Math.round(o.duration ?? 0))
1011
- }), S = x(G, U.senderId, { trackId: U.trackId, targetIds: U.targetIds });
1012
- Q(R), d(S);
1006
+ Data: l,
1007
+ FrameNumber: f.frameCounter,
1008
+ IsKey: C.type === "key",
1009
+ TimestampInUs: BigInt(Math.max(0, Math.round(C.timestamp ?? 0))),
1010
+ DurationInUs: Math.max(0, Math.round(C.duration ?? 0))
1011
+ }), S = x(G, f.senderId, { trackId: f.trackId, targetIds: f.targetIds });
1012
+ Q(l), g(S);
1013
1013
  },
1014
- error: (o) => {
1015
- y(o, t);
1014
+ error: (C) => {
1015
+ y(C, t);
1016
1016
  }
1017
- }), r.encoder.configure(s.config), r.forceKeyframe = !0, r.kind === "screen" && I && e.framerate !== void 0 && (r.targetFramerate = e.framerate, r.minFrameIntervalUs = Math.floor(1e6 / e.framerate), r.lastEncodedTimestamp = 0);
1018
- const E = s.config.width ?? r.width, C = s.config.height ?? r.height;
1019
- d(
1017
+ }), r.encoder.configure(_.config), r.forceKeyframe = !0, r.kind === "screen" && I && e.framerate !== void 0 && (r.targetFramerate = e.framerate, r.minFrameIntervalUs = Math.floor(1e6 / e.framerate), r.lastEncodedTimestamp = 0);
1018
+ const E = _.config.width ?? r.width, o = _.config.height ?? r.height;
1019
+ g(
1020
1020
  Y(
1021
1021
  W({
1022
1022
  StreamId: r.streamId,
1023
1023
  Description: `${r.kind}:${r.streamId}`,
1024
1024
  SourceType: r.sourceType,
1025
1025
  Codec: r.codec,
1026
- CodecDetails: s.config.codec,
1026
+ CodecDetails: _.config.codec,
1027
1027
  Width: E,
1028
- Height: C,
1028
+ Height: o,
1029
1029
  Framerate: r.kind === "screen" ? r.targetFramerate : r.framerate
1030
1030
  }),
1031
1031
  r.senderId,
1032
1032
  { trackId: r.trackId, targetIds: r.targetIds }
1033
1033
  )
1034
1034
  ), r.isReconfiguring = !1;
1035
- const A = s.isHardwareAccelerated ? "hardware" : "software", l = r.kind === "screen" ? `${Math.round(r.targetFramerate)}fps (throttled)` : `${Math.round(r.framerate)}fps`;
1036
- D({
1035
+ const A = _.isHardwareAccelerated ? "hardware" : "software", R = r.kind === "screen" ? `${Math.round(r.targetFramerate)}fps (throttled)` : `${Math.round(r.framerate)}fps`;
1036
+ L({
1037
1037
  type: "debug",
1038
- message: `Encoder reconfigured (options): codec=${s.config.codec}, ${E}x${C}@${l}, bitrate=${s.config.bitrate ?? 0}bps, hw=${A}`
1038
+ message: `Encoder reconfigured (options): codec=${_.config.codec}, ${E}x${o}@${R}, bitrate=${_.config.bitrate ?? 0}bps, hw=${A}`
1039
1039
  });
1040
1040
  }
1041
- function _e(t) {
1041
+ function se(t) {
1042
1042
  const e = new Uint8Array(t);
1043
- if (_t(e) !== Z.VIDEO_REQUEST_IDR_FRAME)
1043
+ if (st(e) !== Z.VIDEO_REQUEST_IDR_FRAME)
1044
1044
  return;
1045
1045
  const i = It(e), n = B.get(i.trackId);
1046
1046
  if (!n)
1047
1047
  return;
1048
- const a = f.get(n);
1048
+ const a = U.get(n);
1049
1049
  a && (a.forceKeyframe = !0);
1050
1050
  }
1051
1051
  function Ie() {
1052
- for (const t of f.keys())
1052
+ for (const t of U.keys())
1053
1053
  at(t);
1054
- if (f.clear(), B.clear(), w) {
1054
+ if (U.clear(), B.clear(), w) {
1055
1055
  try {
1056
1056
  w.close();
1057
1057
  } catch {
@@ -1089,7 +1089,7 @@ self.addEventListener("message", (t) => {
1089
1089
  }
1090
1090
  w = e.port, w.addEventListener("message", (r) => {
1091
1091
  const i = r.data;
1092
- i?.type === "protocol" && i.message instanceof ArrayBuffer && _e(i.message);
1092
+ i?.type === "protocol" && i.message instanceof ArrayBuffer && se(i.message);
1093
1093
  });
1094
1094
  try {
1095
1095
  w.start?.();
@@ -1106,7 +1106,7 @@ self.addEventListener("message", (t) => {
1106
1106
  return;
1107
1107
  }
1108
1108
  if (e.type === "updateDimensions") {
1109
- se(e.captureId, e.width, e.height).catch((r) => y(r, e.captureId));
1109
+ _e(e.captureId, e.width, e.height).catch((r) => y(r, e.captureId));
1110
1110
  return;
1111
1111
  }
1112
1112
  if (e.type === "updateOptions") {