@ikonai/sdk 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,28 +1,28 @@
1
1
  const gs = {
2
2
  Compressed: 8
3
3
  };
4
- function wh(t) {
4
+ function gh(t) {
5
5
  return t;
6
6
  }
7
- function _e(t) {
7
+ function Te(t) {
8
8
  if (t.length < 8)
9
9
  throw new Error("Protocol message too short");
10
10
  return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
11
11
  }
12
- function Ue(t) {
13
- return _e(t) & 4294901760;
12
+ function Oe(t) {
13
+ return Te(t) & 4294901760;
14
14
  }
15
- function ie(t) {
16
- const e = oe(t), n = new DataView(e.buffer, e.byteOffset, e.byteLength);
15
+ function oe(t) {
16
+ const e = ae(t), n = new DataView(e.buffer, e.byteOffset, e.byteLength);
17
17
  if (e.length < 27)
18
18
  throw new Error("Protocol payload too short");
19
19
  const r = n.getUint32(0, !0), s = n.getUint32(4, !0), i = n.getUint32(8, !0), o = n.getUint32(12, !0), a = n.getUint32(16, !0), c = n.getUint32(20, !0), l = n.getUint8(24), h = n.getUint8(25), f = n.getUint8(26);
20
20
  if (27 + c * 4 > e.length)
21
21
  throw new Error("Protocol header exceeds payload length");
22
22
  const p = [];
23
- let T = 27;
24
- for (let _ = 0; _ < c; _++)
25
- p.push(n.getUint32(T, !0)), T += 4;
23
+ let _ = 27;
24
+ for (let T = 0; T < c; T++)
25
+ p.push(n.getUint32(_, !0)), _ += 4;
26
26
  return {
27
27
  length: r,
28
28
  opcode: s,
@@ -35,8 +35,8 @@ function ie(t) {
35
35
  flags: f
36
36
  };
37
37
  }
38
- function Ce(t, e, n) {
39
- const r = oe(t), s = ie(r);
38
+ function ye(t, e, n) {
39
+ const r = ae(t), s = oe(r);
40
40
  if (e !== void 0 && s.opcode !== e)
41
41
  throw new Error(`Unexpected opcode ${s.opcode}`);
42
42
  if (s.payloadType !== 8)
@@ -45,7 +45,7 @@ function Ce(t, e, n) {
45
45
  return r.subarray(i, s.length);
46
46
  }
47
47
  async function at(t, e, n) {
48
- const r = oe(t), s = ie(r);
48
+ const r = ae(t), s = oe(r);
49
49
  if (e !== void 0 && s.opcode !== e)
50
50
  throw new Error(`Unexpected opcode ${s.opcode}`);
51
51
  if (s.payloadType !== 8)
@@ -57,9 +57,9 @@ async function at(t, e, n) {
57
57
  function P(t, e, n, r, s) {
58
58
  const i = s?.trackId ?? 0, o = s?.sequenceId ?? 0, a = s?.flags ?? 0, c = s?.targetIds ?? [], l = s?.payloadType ?? 8, h = 27 + c.length * 4, f = h + e.length, d = new Uint8Array(f), p = new DataView(d.buffer);
59
59
  p.setUint32(0, f, !0), p.setUint32(4, t >>> 0, !0), p.setUint32(8, r >>> 0, !0), p.setUint32(12, i >>> 0, !0), p.setUint32(16, o >>> 0, !0), p.setUint32(20, c.length >>> 0, !0), p.setUint8(24, n & 255), p.setUint8(25, l & 255), p.setUint8(26, a & 255);
60
- let T = 27;
61
- for (let _ = 0; _ < c.length; _++)
62
- p.setUint32(T, c[_] >>> 0, !0), T += 4;
60
+ let _ = 27;
61
+ for (let T = 0; T < c.length; T++)
62
+ p.setUint32(_, c[T] >>> 0, !0), _ += 4;
63
63
  return d.set(e, h), d;
64
64
  }
65
65
  async function Cs(t) {
@@ -81,7 +81,7 @@ async function Cs(t) {
81
81
  return a;
82
82
  }
83
83
  var U = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(U || {});
84
- const jt = 161, zt = 162, Me = new TextEncoder(), ys = new TextDecoder("utf-8", { fatal: !0 });
84
+ const jt = 161, zt = 162, Le = new TextEncoder(), ys = new TextDecoder("utf-8", { fatal: !0 });
85
85
  class v {
86
86
  constructor(e = 1) {
87
87
  this.version = e, this.buffer.writeByte(jt), this.buffer.writeVarUInt(e >>> 0);
@@ -117,7 +117,7 @@ class v {
117
117
  this.writeFixedField(e, 14, () => this.buffer.writeBytes(r));
118
118
  }
119
119
  writeStringField(e, n) {
120
- const r = Me.encode(n ?? "");
120
+ const r = Le.encode(n ?? "");
121
121
  this.writeVariableField(e, 12, r);
122
122
  }
123
123
  writeBinaryField(e, n) {
@@ -151,7 +151,7 @@ class v {
151
151
  this.writeFieldHeader(e, n, r.length), this.buffer.writeBytes(r);
152
152
  }
153
153
  writeFieldHeader(e, n, r) {
154
- this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(Le(n)), ks(n) && this.buffer.writeVarUInt(r >>> 0);
154
+ this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(Fe(n)), ks(n) && this.buffer.writeVarUInt(r >>> 0);
155
155
  }
156
156
  }
157
157
  class We {
@@ -217,7 +217,7 @@ class We {
217
217
  12
218
218
  /* String */
219
219
  ), this.count++;
220
- const n = Me.encode(e ?? "");
220
+ const n = Le.encode(e ?? "");
221
221
  this.payload.writeVarUInt(n.length), this.payload.writeBytes(n);
222
222
  }
223
223
  writeBinary(e) {
@@ -258,7 +258,7 @@ class We {
258
258
  }
259
259
  finish() {
260
260
  const e = new q();
261
- return e.writeByte(Le(this.elementType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
261
+ return e.writeByte(Fe(this.elementType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
262
262
  }
263
263
  ensureElementType(e) {
264
264
  if (this.elementType !== e)
@@ -283,7 +283,7 @@ class ct {
283
283
  if (this.entryOpen)
284
284
  throw new Error("Dictionary entry not completed");
285
285
  const e = new q();
286
- return e.writeByte(Le(this.keyType)), e.writeByte(Le(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
286
+ return e.writeByte(Fe(this.keyType)), e.writeByte(Fe(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
287
287
  }
288
288
  }
289
289
  class As {
@@ -350,7 +350,7 @@ class As {
350
350
  12
351
351
  /* String */
352
352
  );
353
- const n = Me.encode(e ?? "");
353
+ const n = Le.encode(e ?? "");
354
354
  this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.keyWritten = !0;
355
355
  }
356
356
  writeKeyBinary(e) {
@@ -428,7 +428,7 @@ class As {
428
428
  12
429
429
  /* String */
430
430
  );
431
- const n = Me.encode(e ?? "");
431
+ const n = Le.encode(e ?? "");
432
432
  this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.valueWritten = !0;
433
433
  }
434
434
  writeValueObject(e, n) {
@@ -484,7 +484,7 @@ class H {
484
484
  offset;
485
485
  end;
486
486
  static create(e) {
487
- const n = oe(e);
487
+ const n = ae(e);
488
488
  if (n.length < 2)
489
489
  throw new Error("Teleport payload too short");
490
490
  if (n[0] !== jt || n[n.length - 1] !== zt)
@@ -630,7 +630,7 @@ class lt {
630
630
  this.count = G(e, r, "ArrayMalformed"), this.offset = r.offset;
631
631
  }
632
632
  static create(e) {
633
- return new lt(oe(e));
633
+ return new lt(ae(e));
634
634
  }
635
635
  next() {
636
636
  if (this.index >= this.count) {
@@ -654,35 +654,35 @@ class lt {
654
654
  const e = ne(this.elementType);
655
655
  L(this.payload, this.offset, e);
656
656
  const n = this.payload.subarray(this.offset, this.offset + e);
657
- return this.offset += e, new de(this.elementType, n);
657
+ return this.offset += e, new he(this.elementType, n);
658
658
  }
659
659
  case 12:
660
660
  case 13: {
661
661
  const e = { offset: this.offset }, n = G(this.payload, e, "ArrayMalformed");
662
662
  L(this.payload, e.offset, n);
663
663
  const r = this.payload.subarray(e.offset, e.offset + n);
664
- return this.offset = e.offset + n, new de(this.elementType, r);
664
+ return this.offset = e.offset + n, new he(this.elementType, r);
665
665
  }
666
666
  case 11: {
667
667
  const e = { offset: this.offset }, n = G(this.payload, e, "ArrayMalformed");
668
668
  L(this.payload, e.offset, n);
669
669
  const r = this.payload.subarray(e.offset, e.offset + n);
670
- return this.offset = e.offset + n, new de(11, r);
670
+ return this.offset = e.offset + n, new he(11, r);
671
671
  }
672
672
  case 9: {
673
673
  const e = ht(this.payload, this.offset), n = this.payload.subarray(this.offset, this.offset + e);
674
- return this.offset += e, new de(9, n);
674
+ return this.offset += e, new he(9, n);
675
675
  }
676
676
  case 10: {
677
677
  const e = ft(this.payload, this.offset), n = this.payload.subarray(this.offset, this.offset + e);
678
- return this.offset += e, new de(10, n);
678
+ return this.offset += e, new he(10, n);
679
679
  }
680
680
  default:
681
681
  throw new Error(`Unsupported array element type ${U[this.elementType]}`);
682
682
  }
683
683
  }
684
684
  }
685
- class de extends K {
685
+ class he extends K {
686
686
  constructor(e, n) {
687
687
  super(e, n);
688
688
  }
@@ -704,7 +704,7 @@ class ut {
704
704
  this.count = G(e, n, "DictMalformed"), this.offset = n.offset;
705
705
  }
706
706
  static create(e) {
707
- return new ut(oe(e));
707
+ return new ut(ae(e));
708
708
  }
709
709
  next() {
710
710
  if (this.index >= this.count) {
@@ -918,7 +918,7 @@ function G(t, e, n) {
918
918
  function Ns(t) {
919
919
  return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
920
920
  }
921
- function Le(t, e = 0) {
921
+ function Fe(t, e = 0) {
922
922
  if ((e & 240) !== 0)
923
923
  throw new Error("Teleport flags must fit into 4 bits");
924
924
  return (t & 15) << 4 | e & 15;
@@ -1011,10 +1011,10 @@ function ze(t, e, n, r) {
1011
1011
  function bt(t) {
1012
1012
  return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
1013
1013
  }
1014
- function oe(t) {
1014
+ function ae(t) {
1015
1015
  return t instanceof Uint8Array ? t : new Uint8Array(t);
1016
1016
  }
1017
- var Xt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(Xt || {}), ee = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MobileWeb = 1] = "MobileWeb", t[t.MobileApp = 2] = "MobileApp", t[t.DesktopWeb = 3] = "DesktopWeb", t[t.DesktopApp = 4] = "DesktopApp", t))(ee || {}), ae = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Backend = 2] = "Backend", t[t.Server = 4] = "Server", t[t.Plugin = 8] = "Plugin", t[t.Browser = 16] = "Browser", t))(ae || {}), F = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t))(F || {}), Jt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.SendBackToSender = 1] = "SendBackToSender", t[t.Delayable = 2] = "Delayable", t[t.SendToUser = 4] = "SendToUser", t[t.Compressed = 8] = "Compressed", t[t.Unreliable = 16] = "Unreliable", t))(Jt || {}), ce = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MessagePack = 1] = "MessagePack", t[t.MemoryPack = 2] = "MemoryPack", t[t.Json = 4] = "Json", t[t.Teleport = 8] = "Teleport", t[t.All = 15] = "All", t))(ce || {}), Qt = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(Qt || {}), le = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(le || {}), Zt = /* @__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))(Zt || {}), pt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.DotNet = 1] = "DotNet", t[t.TypeScript = 2] = "TypeScript", t[t.Cpp = 3] = "Cpp", t))(pt || {}), qt = /* @__PURE__ */ ((t) => (t[t.Local = 0] = "Local", t[t.Cloud = 1] = "Cloud", t))(qt || {}), en = /* @__PURE__ */ ((t) => (t[t.Bundle = 0] = "Bundle", t[t.GitSource = 1] = "GitSource", t))(en || {}), S = /* @__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.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.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))(S || {});
1017
+ var Xt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(Xt || {}), ee = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MobileWeb = 1] = "MobileWeb", t[t.MobileApp = 2] = "MobileApp", t[t.DesktopWeb = 3] = "DesktopWeb", t[t.DesktopApp = 4] = "DesktopApp", t))(ee || {}), ce = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Backend = 2] = "Backend", t[t.Server = 4] = "Server", t[t.Plugin = 8] = "Plugin", t[t.Browser = 16] = "Browser", t))(ce || {}), F = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t))(F || {}), Jt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.SendBackToSender = 1] = "SendBackToSender", t[t.Delayable = 2] = "Delayable", t[t.SendToUser = 4] = "SendToUser", t[t.Compressed = 8] = "Compressed", t[t.Unreliable = 16] = "Unreliable", t))(Jt || {}), le = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MessagePack = 1] = "MessagePack", t[t.MemoryPack = 2] = "MemoryPack", t[t.Json = 4] = "Json", t[t.Teleport = 8] = "Teleport", t[t.All = 15] = "All", t))(le || {}), Qt = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(Qt || {}), ue = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(ue || {}), Zt = /* @__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))(Zt || {}), pt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.DotNet = 1] = "DotNet", t[t.TypeScript = 2] = "TypeScript", t[t.Cpp = 3] = "Cpp", t))(pt || {}), qt = /* @__PURE__ */ ((t) => (t[t.Local = 0] = "Local", t[t.Cloud = 1] = "Cloud", t))(qt || {}), en = /* @__PURE__ */ ((t) => (t[t.Bundle = 0] = "Bundle", t[t.GitSource = 1] = "GitSource", t))(en || {}), S = /* @__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.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.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))(S || {});
1018
1018
  const tn = 1, vs = 1048637, Us = 727023925, Os = 3395085689;
1019
1019
  function Ms(t) {
1020
1020
  const e = new v(tn);
@@ -1197,7 +1197,7 @@ function Xe(t) {
1197
1197
  return mn(e), e;
1198
1198
  }
1199
1199
  function mn(t) {
1200
- return t.ContextType = ae.Unknown, t.UserType = le.Unknown, t.PayloadType = ce.Unknown, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.SessionId = -1, t.IsInternal = !1, t.IsReady = !1, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.PreciseJoinedAt = 0n, t.UserAgent = "", t.ClientType = ee.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = pt.Unknown, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialUrl = "", t;
1200
+ return t.ContextType = ce.Unknown, t.UserType = ue.Unknown, t.PayloadType = le.Unknown, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.SessionId = -1, t.IsInternal = !1, t.IsReady = !1, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.PreciseJoinedAt = 0n, t.UserAgent = "", t.ClientType = ee.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = pt.Unknown, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialUrl = "", t;
1201
1201
  }
1202
1202
  function Je(t, e) {
1203
1203
  const n = e ?? Xe();
@@ -1518,7 +1518,7 @@ function ho(t) {
1518
1518
  return fo(e), t && Object.assign(e, t), e;
1519
1519
  }
1520
1520
  function fo(t) {
1521
- return t.ServerSessionId = "", t.ContextType = ae.Unknown, t.UserType = le.Unknown, t.PayloadType = ce.Unknown, t.IsInternal = !1, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.OpcodeGroupsFromServer = S.NONE, t.OpcodeGroupsToServer = S.NONE, t.ProtocolVersion = 0, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.UserAgent = "", t.ClientType = ee.Unknown, t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = pt.Unknown, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialUrl = "", t;
1521
+ return t.ServerSessionId = "", t.ContextType = ce.Unknown, t.UserType = ue.Unknown, t.PayloadType = le.Unknown, t.IsInternal = !1, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.OpcodeGroupsFromServer = S.NONE, t.OpcodeGroupsToServer = S.NONE, t.ProtocolVersion = 0, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.UserAgent = "", t.ClientType = ee.Unknown, t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = pt.Unknown, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialUrl = "", t;
1522
1522
  }
1523
1523
  const _n = 1, po = 1048632, mo = 3748161056, Eo = 4289118421;
1524
1524
  function Io(t) {
@@ -1725,7 +1725,7 @@ function Go(t, e, n) {
1725
1725
  return P(Mn, r, On, e, n);
1726
1726
  }
1727
1727
  function Vo(t, e) {
1728
- const n = Ce(t, Mn);
1728
+ const n = ye(t, Mn);
1729
1729
  return Bo(n, e);
1730
1730
  }
1731
1731
  const mt = 1, Ho = 1048600, Vn = 703025676, Hn = 814454131, $n = 972460562, Kn = 976255570, Yn = 1368629611, jn = 1479280922, zn = 1533537016, Xn = 1909301063, Jn = 2274386296, Qn = 2603556958, Zn = 2885165957, qn = 3568439632;
@@ -1988,7 +1988,7 @@ function pa(t, e, n) {
1988
1988
  return P(pr, r, fr, e, n);
1989
1989
  }
1990
1990
  function ma(t, e) {
1991
- const n = Ce(t, pr);
1991
+ const n = ye(t, pr);
1992
1992
  return da(n, e);
1993
1993
  }
1994
1994
  const gr = 1, Ea = 65549;
@@ -2531,7 +2531,7 @@ function ul(t, e) {
2531
2531
  }
2532
2532
  }
2533
2533
  function dl(t, e) {
2534
- const n = Ce(t, xr);
2534
+ const n = ye(t, xr);
2535
2535
  return cl(n, e);
2536
2536
  }
2537
2537
  const Gr = 1, hl = 65570, fl = 2677673673;
@@ -2602,7 +2602,7 @@ function gl(t, e, n) {
2602
2602
  return P(Et, r, Vr, e, n);
2603
2603
  }
2604
2604
  function Cl(t, e) {
2605
- const n = Ce(t, Et);
2605
+ const n = ye(t, Et);
2606
2606
  return Tl(n, e);
2607
2607
  }
2608
2608
  const zr = 1, yl = 65566, Al = 407060584, Rl = 1175184220, bl = 1241248827, Nl = 1455877031, kl = 3419353826, Dl = 3686066300;
@@ -2657,7 +2657,7 @@ function Gl(t, e) {
2657
2657
  }
2658
2658
  }
2659
2659
  function Vl(t, e) {
2660
- const n = Ce(t, Xr);
2660
+ const n = ye(t, Xr);
2661
2661
  return xl(n, e);
2662
2662
  }
2663
2663
  class It extends Error {
@@ -2690,17 +2690,17 @@ class $l extends D {
2690
2690
  super(`Channel provisioning timeout after ${e}ms`), this.name = "ProvisioningTimeoutError";
2691
2691
  }
2692
2692
  }
2693
- class Sh extends D {
2693
+ class Ch extends D {
2694
2694
  constructor(e) {
2695
2695
  super(`Channel not found: ${e}`), this.name = "ChannelNotFoundError";
2696
2696
  }
2697
2697
  }
2698
- class gh extends D {
2698
+ class yh extends D {
2699
2699
  constructor(e) {
2700
2700
  super(`Space not found for domain: ${e}`), this.name = "SpaceNotFoundError";
2701
2701
  }
2702
2702
  }
2703
- class Ch extends D {
2703
+ class Ah extends D {
2704
2704
  constructor() {
2705
2705
  super("No channels available in this space"), this.name = "NoChannelsError";
2706
2706
  }
@@ -2720,21 +2720,21 @@ function Qr(t, e) {
2720
2720
  });
2721
2721
  }
2722
2722
  var Ge = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t[t.NONE = 4] = "NONE", t))(Ge || {});
2723
- let Tt = 1, Fe = null;
2723
+ let Tt = 1, Pe = null;
2724
2724
  const Qe = /* @__PURE__ */ new Map();
2725
2725
  function Zr(t) {
2726
2726
  Tt = t;
2727
2727
  }
2728
- function yh() {
2728
+ function Rh() {
2729
2729
  return Tt;
2730
2730
  }
2731
2731
  function Kl(t) {
2732
- Fe = t;
2732
+ Pe = t;
2733
2733
  }
2734
- function Ah() {
2735
- return Fe;
2734
+ function bh() {
2735
+ return Pe;
2736
2736
  }
2737
- function Rh(t, e) {
2737
+ function Nh(t, e) {
2738
2738
  return Qe.set(t, e ?? {
2739
2739
  minLevel: 2
2740
2740
  /* WARN */
@@ -2752,7 +2752,7 @@ const Yl = {
2752
2752
  function jl(t, e) {
2753
2753
  return `[${t}] ${e}`;
2754
2754
  }
2755
- function Re(t, e, n, r) {
2755
+ function be(t, e, n, r) {
2756
2756
  const s = (/* @__PURE__ */ new Date()).toISOString(), i = Yl[t], o = {
2757
2757
  timestamp: s,
2758
2758
  level: t,
@@ -2761,7 +2761,7 @@ function Re(t, e, n, r) {
2761
2761
  message: n,
2762
2762
  args: r
2763
2763
  };
2764
- Fe && Fe(o);
2764
+ Pe && Pe(o);
2765
2765
  for (const [a, c] of Qe) {
2766
2766
  const l = c?.minLevel ?? 2;
2767
2767
  if (t >= l)
@@ -2791,20 +2791,20 @@ function Re(t, e, n, r) {
2791
2791
  function M(t) {
2792
2792
  return {
2793
2793
  debug(e, ...n) {
2794
- Re(0, t, e, n);
2794
+ be(0, t, e, n);
2795
2795
  },
2796
2796
  info(e, ...n) {
2797
- Re(1, t, e, n);
2797
+ be(1, t, e, n);
2798
2798
  },
2799
2799
  warn(e, ...n) {
2800
- Re(2, t, e, n);
2800
+ be(2, t, e, n);
2801
2801
  },
2802
2802
  error(e, ...n) {
2803
- Re(3, t, e, n);
2803
+ be(3, t, e, n);
2804
2804
  }
2805
2805
  };
2806
2806
  }
2807
- const be = M("WebSocketTransport"), zl = 1e4;
2807
+ const Ne = M("WebSocketTransport"), zl = 1e4;
2808
2808
  class Xl {
2809
2809
  ws = null;
2810
2810
  keepaliveTimeout = null;
@@ -2836,7 +2836,7 @@ class Xl {
2836
2836
  this.ws.onopen = () => {
2837
2837
  i = !0, clearTimeout(c), this.ws.send(n), this.resetKeepaliveTimeout(), o || (o = !0, r());
2838
2838
  }, this.ws.onerror = () => {
2839
- clearTimeout(c), be.error("WebSocket error"), o || (o = !0, a(), s(new Z("WebSocket connection failed")));
2839
+ clearTimeout(c), Ne.error("WebSocket error"), o || (o = !0, a(), s(new Z("WebSocket connection failed")));
2840
2840
  }, this.ws.onclose = (l) => {
2841
2841
  if (this.clearKeepaliveTimeout(), !i && !o) {
2842
2842
  o = !0, a(), s(new Z("WebSocket connection closed before opening"));
@@ -2850,7 +2850,7 @@ class Xl {
2850
2850
  });
2851
2851
  }
2852
2852
  send(e) {
2853
- this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) : be.warn("Cannot send: WebSocket not connected");
2853
+ this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) : Ne.warn("Cannot send: WebSocket not connected");
2854
2854
  }
2855
2855
  close() {
2856
2856
  this.clearKeepaliveTimeout(), this.ws && (this.ws.close(1e3, "Client closing"), this.ws = null);
@@ -2863,18 +2863,18 @@ class Xl {
2863
2863
  }
2864
2864
  handleProtocolMessage(e) {
2865
2865
  try {
2866
- if (ie(e).opcode === S.KEEPALIVE_REQUEST) {
2866
+ if (oe(e).opcode === S.KEEPALIVE_REQUEST) {
2867
2867
  this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
2868
2868
  return;
2869
2869
  }
2870
2870
  this.resetKeepaliveTimeout(), this.callbacks.onProtocolMessage(e);
2871
2871
  } catch (n) {
2872
- be.error("Failed to process protocol message:", n), this.callbacks.onError(n instanceof Error ? n : new Error(String(n)));
2872
+ Ne.error("Failed to process protocol message:", n), this.callbacks.onError(n instanceof Error ? n : new Error(String(n)));
2873
2873
  }
2874
2874
  }
2875
2875
  resetKeepaliveTimeout() {
2876
2876
  this.clearKeepaliveTimeout(), this.keepaliveTimeout = setTimeout(() => {
2877
- be.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new _t(this.keepaliveTimeoutMs)), this.close();
2877
+ Ne.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new _t(this.keepaliveTimeoutMs)), this.close();
2878
2878
  }, this.keepaliveTimeoutMs);
2879
2879
  }
2880
2880
  clearKeepaliveTimeout() {
@@ -3005,7 +3005,7 @@ class Ql {
3005
3005
  */
3006
3006
  handleProtocolMessage(e) {
3007
3007
  try {
3008
- if (ie(e).opcode === S.KEEPALIVE_REQUEST) {
3008
+ if (oe(e).opcode === S.KEEPALIVE_REQUEST) {
3009
3009
  this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
3010
3010
  return;
3011
3011
  }
@@ -3047,7 +3047,7 @@ class Ql {
3047
3047
  }
3048
3048
  }
3049
3049
  }
3050
- const he = M("Channel");
3050
+ const fe = M("Channel");
3051
3051
  class Zl {
3052
3052
  state = "disconnected";
3053
3053
  transport = null;
@@ -3090,7 +3090,7 @@ class Zl {
3090
3090
  try {
3091
3091
  await this.connectTransport(), this.setState("connected");
3092
3092
  } catch (e) {
3093
- throw he.error("Channel connection failed:", e), this.setState("disconnected"), e;
3093
+ throw fe.error("Channel connection failed:", e), this.setState("disconnected"), e;
3094
3094
  }
3095
3095
  }
3096
3096
  /**
@@ -3104,7 +3104,7 @@ class Zl {
3104
3104
  */
3105
3105
  send(e) {
3106
3106
  if (!this.transport?.isConnected) {
3107
- he.warn("Cannot send: channel not connected");
3107
+ fe.warn("Cannot send: channel not connected");
3108
3108
  return;
3109
3109
  }
3110
3110
  this.transport.send(e);
@@ -3144,13 +3144,13 @@ class Zl {
3144
3144
  handleProtocolMessage(e) {
3145
3145
  try {
3146
3146
  const n = e;
3147
- if (_e(n) === S.CORE_ON_SERVER_STOPPING) {
3148
- he.debug("Received server stopping message"), this.setState("stopped"), this.transport?.close();
3147
+ if (Te(n) === S.CORE_ON_SERVER_STOPPING) {
3148
+ fe.debug("Received server stopping message"), this.setState("stopped"), this.transport?.close();
3149
3149
  return;
3150
3150
  }
3151
3151
  this.config.onProtocolMessage?.(n);
3152
3152
  } catch (n) {
3153
- he.error("Failed to handle protocol message:", n), this.config.onError?.(n instanceof Error ? n : new Error(String(n)));
3153
+ fe.error("Failed to handle protocol message:", n), this.config.onError?.(n instanceof Error ? n : new Error(String(n)));
3154
3154
  }
3155
3155
  }
3156
3156
  /**
@@ -3163,7 +3163,7 @@ class Zl {
3163
3163
  * Handle transport error.
3164
3164
  */
3165
3165
  handleError(e) {
3166
- he.error("Channel error:", e), this.config.onError?.(e), e instanceof _t && this.handleClose("Keepalive timeout", !1);
3166
+ fe.error("Channel error:", e), this.config.onError?.(e), e instanceof _t && this.handleClose("Keepalive timeout", !1);
3167
3167
  }
3168
3168
  /**
3169
3169
  * Update and notify state change.
@@ -3217,7 +3217,7 @@ class ql {
3217
3217
  * The opcode group is extracted from the message automatically.
3218
3218
  */
3219
3219
  sendProtocolMessage(e) {
3220
- const n = Ue(e);
3220
+ const n = Oe(e);
3221
3221
  for (const [r, s] of this.channels)
3222
3222
  if (r & n) {
3223
3223
  s.send(e);
@@ -3370,7 +3370,7 @@ class ql {
3370
3370
  this.state !== e && (this.state = e, this.config.onStateChange?.(e));
3371
3371
  }
3372
3372
  }
3373
- const bh = "opus", Nh = 48e3, kh = 2, Dh = 64e3, eu = 150, vh = "H264", tu = 5e6, Uh = 30, nu = "max-bundle", ru = "require", su = [], iu = "ikon-data", ou = !1, au = 0, O = M("WebRTCConnection");
3373
+ const kh = "opus", Dh = 48e3, vh = 2, Uh = 64e3, eu = 150, Oh = "H264", tu = 5e6, Mh = 30, nu = "max-bundle", ru = "require", su = [], iu = "ikon-data", ou = !1, au = 0, O = M("WebRTCConnection");
3374
3374
  class cu {
3375
3375
  pc = null;
3376
3376
  dataChannel = null;
@@ -3574,7 +3574,7 @@ class lu {
3574
3574
  }
3575
3575
  handleProtocolMessage(e) {
3576
3576
  const n = (e instanceof Uint8Array, e), r = n;
3577
- switch (_e(r)) {
3577
+ switch (Te(r)) {
3578
3578
  case xr:
3579
3579
  return this.handleAnswer(r), !0;
3580
3580
  case Et:
@@ -3786,7 +3786,7 @@ class lu {
3786
3786
  }
3787
3787
  }
3788
3788
  }
3789
- const uu = 5e3, du = 3e4, Ot = 35e3, Mt = 500, Lt = 6, es = 6e4, Te = "ikon.theme", we = "ikon.theme-user", hu = "ikon.theme-change";
3789
+ const uu = 5e3, du = 3e4, Ot = 35e3, Mt = 500, Lt = 6, es = 6e4, we = "ikon.theme", Se = "ikon.theme-user", hu = "ikon.theme-change";
3790
3790
  function Ze(t) {
3791
3791
  typeof document < "u" && document.documentElement && document.documentElement.setAttribute("data-theme", t);
3792
3792
  }
@@ -3796,9 +3796,9 @@ function ts() {
3796
3796
  function Ve() {
3797
3797
  if (typeof window > "u" || !window.localStorage)
3798
3798
  return "light";
3799
- const t = window.localStorage.getItem(we);
3799
+ const t = window.localStorage.getItem(Se);
3800
3800
  if (t) return t;
3801
- const e = window.localStorage.getItem(Te);
3801
+ const e = window.localStorage.getItem(we);
3802
3802
  return e || ts();
3803
3803
  }
3804
3804
  function wt() {
@@ -3807,13 +3807,13 @@ function wt() {
3807
3807
  function fu() {
3808
3808
  if (typeof window > "u" || !window.localStorage)
3809
3809
  return "light";
3810
- const t = window.localStorage.getItem(we), e = window.localStorage.getItem(Te);
3810
+ const t = window.localStorage.getItem(Se), e = window.localStorage.getItem(we);
3811
3811
  if (t || e) {
3812
3812
  const r = t ?? e;
3813
3813
  return Ze(r), r;
3814
3814
  }
3815
3815
  const n = ts();
3816
- return window.localStorage.setItem(Te, n), Ze(n), n;
3816
+ return window.localStorage.setItem(we, n), Ze(n), n;
3817
3817
  }
3818
3818
  const pu = {
3819
3819
  name: "ikon.client.getTheme",
@@ -3823,7 +3823,7 @@ const pu = {
3823
3823
  function mu() {
3824
3824
  if (typeof window > "u" || !window.localStorage)
3825
3825
  return null;
3826
- const t = window.localStorage.getItem(we), e = window.localStorage.getItem(Te);
3826
+ const t = window.localStorage.getItem(Se), e = window.localStorage.getItem(we);
3827
3827
  return t ?? e ?? null;
3828
3828
  }
3829
3829
  const Eu = {
@@ -3842,7 +3842,7 @@ function Iu(t, e) {
3842
3842
  if (!n)
3843
3843
  return !1;
3844
3844
  const r = e === void 0 ? !0 : !!e, s = window.localStorage;
3845
- r ? s.setItem(we, n) : s.removeItem(we), s.setItem(Te, n);
3845
+ r ? s.setItem(Se, n) : s.removeItem(Se), s.setItem(we, n);
3846
3846
  try {
3847
3847
  window.dispatchEvent(new CustomEvent(hu, { detail: { mode: n } }));
3848
3848
  } catch {
@@ -3932,7 +3932,7 @@ function bu(t) {
3932
3932
  return !1;
3933
3933
  }
3934
3934
  }
3935
- let Q = null, qe = !1, Ne = !1;
3935
+ let Q = null, qe = !1, ke = !1;
3936
3936
  async function Nu() {
3937
3937
  if (!(typeof navigator > "u" || !("wakeLock" in navigator)))
3938
3938
  try {
@@ -3953,7 +3953,7 @@ async function Du(t) {
3953
3953
  if (typeof navigator > "u" || !("wakeLock" in navigator))
3954
3954
  return !1;
3955
3955
  try {
3956
- return !!t ? (qe = !0, Q || (Q = await navigator.wakeLock.request("screen")), Ne || (document.addEventListener("visibilitychange", Ft), Ne = !0)) : (qe = !1, Ne && (document.removeEventListener("visibilitychange", Ft), Ne = !1), Q && (await Q.release(), Q = null)), !0;
3956
+ return !!t ? (qe = !0, Q || (Q = await navigator.wakeLock.request("screen")), ke || (document.addEventListener("visibilitychange", Ft), ke = !0)) : (qe = !1, ke && (document.removeEventListener("visibilitychange", Ft), ke = !1), Q && (await Q.release(), Q = null)), !0;
3957
3957
  } catch {
3958
3958
  return !1;
3959
3959
  }
@@ -4079,7 +4079,7 @@ function He() {
4079
4079
  return crypto.randomUUID();
4080
4080
  }
4081
4081
  }
4082
- function Oh() {
4082
+ function Lh() {
4083
4083
  if (!(typeof localStorage > "u"))
4084
4084
  try {
4085
4085
  localStorage.removeItem(et);
@@ -4094,23 +4094,23 @@ function Ku(t) {
4094
4094
  return null;
4095
4095
  }
4096
4096
  }
4097
- const Pe = {}, tt = "https://api.prod.ikon.live", nt = "https://api.dev.ikon.live", Pt = "https://auth.ikonai.com", Bt = "https://auth.dev.ikonai.com", Mh = "https://auth.ikonai.com";
4097
+ const Be = {}, tt = "https://api.prod.ikon.live", nt = "https://api.dev.ikon.live", Pt = "https://auth.ikonai.com", Bt = "https://auth.dev.ikonai.com", Fh = "https://auth.ikonai.com";
4098
4098
  function ns(t) {
4099
4099
  return t === "development" ? nt : tt;
4100
4100
  }
4101
- function Lh() {
4102
- const t = typeof import.meta < "u" ? Pe?.VITE_IKON_BACKEND_URL : void 0;
4101
+ function Yu() {
4102
+ const t = typeof import.meta < "u" ? Be?.VITE_IKON_BACKEND_URL : void 0;
4103
4103
  return t || (typeof window > "u" ? tt : !yt() || window.location.hostname.includes(".dev.") ? nt : tt);
4104
4104
  }
4105
- function Fh() {
4106
- const t = typeof import.meta < "u" ? Pe?.VITE_IKON_BACKEND_TYPE : void 0;
4105
+ function Ph() {
4106
+ const t = typeof import.meta < "u" ? Be?.VITE_IKON_BACKEND_TYPE : void 0;
4107
4107
  if (t === "development" || t === "production")
4108
4108
  return t;
4109
- const e = typeof import.meta < "u" ? Pe?.VITE_IKON_BACKEND_URL : void 0;
4109
+ const e = typeof import.meta < "u" ? Be?.VITE_IKON_BACKEND_URL : void 0;
4110
4110
  return e ? e.includes(".dev.") ? "development" : "production" : typeof window > "u" ? "production" : yt() ? window.location.hostname.includes(".dev.") ? "development" : "production" : "development";
4111
4111
  }
4112
- function Yu() {
4113
- const t = typeof import.meta < "u" ? Pe?.VITE_IKON_AUTH_URL : void 0;
4112
+ function ju() {
4113
+ const t = typeof import.meta < "u" ? Be?.VITE_IKON_AUTH_URL : void 0;
4114
4114
  return t || (typeof window > "u" ? Pt : !yt() || window.location.hostname.includes(".dev.") ? Bt : Pt);
4115
4115
  }
4116
4116
  function $e() {
@@ -4121,11 +4121,11 @@ function $e() {
4121
4121
  e[n] = r;
4122
4122
  return e;
4123
4123
  }
4124
- const ju = ["ikon_token", "ikon_provider", "error"], zu = "ikon_server_url";
4125
- function Xu() {
4126
- return typeof window > "u" ? void 0 : new URLSearchParams(window.location.search).get(zu) ?? void 0;
4124
+ const zu = ["ikon_token", "ikon_provider", "error"], Xu = "ikon_server_url";
4125
+ function Ju() {
4126
+ return typeof window > "u" ? void 0 : new URLSearchParams(window.location.search).get(Xu) ?? void 0;
4127
4127
  }
4128
- function Ph() {
4128
+ function Bh() {
4129
4129
  if (typeof window > "u")
4130
4130
  return { parameters: {} };
4131
4131
  const t = window.location.pathname;
@@ -4137,7 +4137,7 @@ function Ph() {
4137
4137
  throw new Error("URL cannot contain both /s/[sessionId] and /c/[channelKey]");
4138
4138
  const i = $e(), o = {};
4139
4139
  for (const [a, c] of Object.entries(i))
4140
- ju.includes(a) || (o[a] = c);
4140
+ zu.includes(a) || (o[a] = c);
4141
4141
  return { sessionId: e, channelKey: n, parameters: o };
4142
4142
  }
4143
4143
  function yt() {
@@ -4152,7 +4152,7 @@ function yt() {
4152
4152
  }
4153
4153
  return !0;
4154
4154
  }
4155
- function Bh() {
4155
+ function xh() {
4156
4156
  if (typeof window > "u") return;
4157
4157
  const t = window.location.pathname, e = t.match(/^\/s\/[^/]+/), n = t.match(/^\/c\/[^/]+/);
4158
4158
  if (e || n) {
@@ -4160,8 +4160,8 @@ function Bh() {
4160
4160
  window.history.replaceState(null, "", r + window.location.search);
4161
4161
  }
4162
4162
  }
4163
- const Be = M("Authenticator"), re = S.GROUP_CORE | S.GROUP_KEEPALIVE | S.GROUP_EVENTS | S.GROUP_ACTIONS | S.GROUP_UI | S.GROUP_AUDIO | S.GROUP_VIDEO | S.GROUP_ANALYTICS, Ju = 1e3, Qu = 5e3;
4164
- async function Zu(t, e, n, r) {
4163
+ const re = M("Authenticator"), se = S.GROUP_CORE | S.GROUP_KEEPALIVE | S.GROUP_EVENTS | S.GROUP_ACTIONS | S.GROUP_UI | S.GROUP_AUDIO | S.GROUP_VIDEO | S.GROUP_ANALYTICS, Qu = 1e3, Zu = 5e3;
4164
+ async function qu(t, e, n, r) {
4165
4165
  if (t)
4166
4166
  try {
4167
4167
  const s = await fetch(`${n}/anonymous`, {
@@ -4173,11 +4173,26 @@ async function Zu(t, e, n, r) {
4173
4173
  if (!s.ok)
4174
4174
  return;
4175
4175
  const i = await s.json();
4176
- return i.token ? Ku(i.token) ?? void 0 : void 0;
4176
+ if (!i.token)
4177
+ return;
4178
+ const o = Ku(i.token);
4179
+ return o ? { userId: o, token: i.token } : void 0;
4177
4180
  } catch {
4178
4181
  return;
4179
4182
  }
4180
4183
  }
4184
+ async function ed(t, e, n, r) {
4185
+ try {
4186
+ const s = await fetch(`${t}/profiles/me?space=${encodeURIComponent(e)}`, {
4187
+ method: "GET",
4188
+ headers: { Authorization: `Bearer ${n}` },
4189
+ signal: r
4190
+ });
4191
+ s.ok || re.warn(`Failed to ensure profile: ${s.status}`);
4192
+ } catch (s) {
4193
+ re.warn("Failed to ensure profile:", s);
4194
+ }
4195
+ }
4181
4196
  function rs(t, e, n) {
4182
4197
  const r = {
4183
4198
  method: "POST",
@@ -4203,7 +4218,7 @@ async function ss(t, e, n, r, s, i, o) {
4203
4218
  }
4204
4219
  return await l.json();
4205
4220
  }
4206
- async function qu(t, e, n, r) {
4221
+ async function td(t, e, n, r) {
4207
4222
  const s = `${t}/rooms/connect`, i = await fetch(s, rs(e, n, r));
4208
4223
  if (!i.ok) {
4209
4224
  const o = await i.text().catch(() => "Unknown error");
@@ -4213,23 +4228,23 @@ async function qu(t, e, n, r) {
4213
4228
  }
4214
4229
  async function is(t, e, n, r, s) {
4215
4230
  const i = Date.now();
4216
- let o = Ju;
4231
+ let o = Qu;
4217
4232
  for (; ; ) {
4218
4233
  if (s?.aborted)
4219
4234
  throw new D("Connection aborted");
4220
4235
  if (Date.now() - i >= n)
4221
4236
  throw new $l(n);
4222
- const c = await qu(t, e, r, s), l = c.state?.toLowerCase();
4237
+ const c = await td(t, e, r, s), l = c.state?.toLowerCase();
4223
4238
  if (l === "running")
4224
4239
  return c;
4225
4240
  if (l === "provisioning") {
4226
- await Qr(o, s), o = Math.min(o * 1.5, Qu);
4241
+ await Qr(o, s), o = Math.min(o * 1.5, Zu);
4227
4242
  continue;
4228
4243
  }
4229
4244
  throw new D(`Unexpected channel state: ${c.state}`);
4230
4245
  }
4231
4246
  }
4232
- async function Se(t, e) {
4247
+ async function ge(t, e) {
4233
4248
  const n = await fetch(t, { signal: e });
4234
4249
  if (!n.ok) {
4235
4250
  const o = await n.text().catch(() => "Unknown error");
@@ -4238,14 +4253,14 @@ async function Se(t, e) {
4238
4253
  const r = await n.arrayBuffer(), s = new Uint8Array(r);
4239
4254
  return { authResponse: await co(s) };
4240
4255
  }
4241
- function ed(t, e) {
4256
+ function nd(t, e) {
4242
4257
  const n = wt();
4243
4258
  return ho({
4244
4259
  ServerSessionId: "",
4245
4260
  // Server will fill this in
4246
- ContextType: ae.Browser,
4247
- UserType: le.Human,
4248
- PayloadType: ce.Teleport,
4261
+ ContextType: ce.Browser,
4262
+ UserType: ue.Human,
4263
+ PayloadType: le.Teleport,
4249
4264
  IsInternal: !1,
4250
4265
  Description: t.description ?? "Ikon SDK TypeScript",
4251
4266
  UserId: e,
@@ -4254,8 +4269,8 @@ function ed(t, e) {
4254
4269
  VersionId: t.versionId ?? "1.0.0",
4255
4270
  InstallId: t.installId ?? "",
4256
4271
  Locale: t.locale ?? (typeof navigator < "u" ? navigator.language : "en-US"),
4257
- OpcodeGroupsFromServer: t.opcodeGroupsFromServer ?? re,
4258
- OpcodeGroupsToServer: t.opcodeGroupsToServer ?? re,
4272
+ OpcodeGroupsFromServer: t.opcodeGroupsFromServer ?? se,
4273
+ OpcodeGroupsToServer: t.opcodeGroupsToServer ?? se,
4259
4274
  ProtocolVersion: 1,
4260
4275
  HasInput: !1,
4261
4276
  ChannelLocale: "",
@@ -4273,7 +4288,7 @@ function ed(t, e) {
4273
4288
  InitialUrl: typeof window < "u" ? window.location.href : ""
4274
4289
  });
4275
4290
  }
4276
- function td(t) {
4291
+ function rd(t) {
4277
4292
  return {
4278
4293
  ServerSessionId: t.ServerSessionId,
4279
4294
  ContextType: t.ContextType,
@@ -4306,35 +4321,39 @@ function td(t) {
4306
4321
  InitialUrl: t.InitialUrl
4307
4322
  };
4308
4323
  }
4309
- async function nd(t, e) {
4324
+ async function sd(t, e) {
4310
4325
  const n = `https://${t.host}:${t.httpsPort}`;
4311
- Be.debug(`Authenticating with local server: ${n}`);
4326
+ re.debug(`Authenticating with local server: ${n}`);
4312
4327
  const s = { ...$e(), ...t.parameters }, i = t.deviceId ?? He();
4313
- let o = t.userId;
4314
- o || (o = await Zu(t.spaceId, i, Yu(), e)), o || (o = i, Be.debug("Using deviceId as userId fallback"));
4315
- const a = ed({ ...t, parameters: s }, o), c = td(a), l = await fetch(`${n}/connect-token`, {
4328
+ let o = t.userId, a = t.token;
4329
+ if (!o) {
4330
+ const _ = await qu(t.spaceId, i, ju(), e);
4331
+ _ && (o = _.userId, a = _.token);
4332
+ }
4333
+ o || (o = i, re.debug("Using deviceId as userId fallback")), t.spaceId && a && await ed(Yu(), t.spaceId, a, e);
4334
+ const c = nd({ ...t, parameters: s }, o), l = rd(c), h = await fetch(`${n}/connect-token`, {
4316
4335
  method: "POST",
4317
4336
  headers: {
4318
4337
  "Content-Type": "application/json"
4319
4338
  },
4320
- body: JSON.stringify(c),
4339
+ body: JSON.stringify(l),
4321
4340
  signal: e
4322
4341
  });
4323
- if (!l.ok) {
4324
- const p = await l.text().catch(() => "Unknown error");
4325
- throw new D(`Failed to get connect token: ${l.status} ${p}`);
4342
+ if (!h.ok) {
4343
+ const _ = await h.text().catch(() => "Unknown error");
4344
+ throw new D(`Failed to get connect token: ${h.status} ${_}`);
4326
4345
  }
4327
- const f = (await l.json()).token;
4328
- if (!f)
4346
+ const d = (await h.json()).token;
4347
+ if (!d)
4329
4348
  throw new D("Server did not return a token");
4330
- const d = `${n}/connect?token=${encodeURIComponent(f)}`;
4331
- return Se(d, e);
4349
+ const p = `${n}/connect?token=${encodeURIComponent(d)}`;
4350
+ return ge(p, e);
4332
4351
  }
4333
- async function rd(t, e) {
4352
+ async function id(t, e) {
4334
4353
  if (t.sessionId && t.channelKey)
4335
4354
  throw new D("Cannot specify both sessionId and channelKey. Use sessionId for precomputed sessions or channelKey to select a channel.");
4336
4355
  const n = ns(t.backendType);
4337
- Be.debug(`Authenticating with cloud server: ${n}, space ID: ${t.spaceId}`);
4356
+ re.debug(`Authenticating with cloud server: ${n}, space ID: ${t.spaceId}`);
4338
4357
  const r = await fetch(`${n}/auth/api-key`, {
4339
4358
  method: "POST",
4340
4359
  headers: {
@@ -4348,8 +4367,8 @@ async function rd(t, e) {
4348
4367
  signal: e
4349
4368
  });
4350
4369
  if (!r.ok) {
4351
- const T = await r.text().catch(() => "Unknown error");
4352
- throw new D(`API key authentication failed: ${r.status} ${T}`);
4370
+ const _ = await r.text().catch(() => "Unknown error");
4371
+ throw new D(`API key authentication failed: ${r.status} ${_}`);
4353
4372
  }
4354
4373
  const i = (await r.json()).token;
4355
4374
  if (!i)
@@ -4362,23 +4381,23 @@ async function rd(t, e) {
4362
4381
  signal: e
4363
4382
  });
4364
4383
  if (!o.ok) {
4365
- const T = await o.text().catch(() => "Unknown error");
4366
- throw new D(`Failed to get or create profile: ${o.status} ${T}`);
4384
+ const _ = await o.text().catch(() => "Unknown error");
4385
+ throw new D(`Failed to get or create profile: ${o.status} ${_}`);
4367
4386
  }
4368
4387
  const a = await ss(n, t.spaceId, t.channelKey, t.parameters, t.sessionId, i, e), c = $e(), l = wt(), h = {
4369
4388
  code: a.code,
4370
- contextType: ae.Plugin,
4371
- userType: t.userType ?? le.Human,
4389
+ contextType: ce.Plugin,
4390
+ userType: t.userType ?? ue.Human,
4372
4391
  clientType: t.clientType ?? Ct(),
4373
- payloadType: ce.Teleport,
4392
+ payloadType: le.Teleport,
4374
4393
  description: t.description ?? "Ikon SDK TypeScript",
4375
4394
  deviceId: t.deviceId ?? He(),
4376
4395
  productId: t.productId ?? "",
4377
4396
  versionId: t.versionId ?? "",
4378
4397
  installId: t.installId ?? "",
4379
4398
  locale: t.locale ?? (typeof navigator < "u" ? navigator.language : "en-US"),
4380
- opcodeGroupsFromServer: t.opcodeGroupsFromServer ?? re,
4381
- opcodeGroupsToServer: t.opcodeGroupsToServer ?? re,
4399
+ opcodeGroupsFromServer: t.opcodeGroupsFromServer ?? se,
4400
+ opcodeGroupsToServer: t.opcodeGroupsToServer ?? se,
4382
4401
  protocolVersion: 1,
4383
4402
  userAgent: typeof navigator < "u" ? navigator.userAgent : "",
4384
4403
  launchParams: { ...c, ...t.parameters },
@@ -4394,13 +4413,13 @@ async function rd(t, e) {
4394
4413
  if (!d.configuration?.url)
4395
4414
  throw new D("Backend did not return a connect URL");
4396
4415
  const p = d.configuration.url;
4397
- return Se(p, e);
4416
+ return ge(p, e);
4398
4417
  }
4399
- async function sd(t, e) {
4418
+ async function od(t, e) {
4400
4419
  if (t.sessionId && t.channelKey)
4401
4420
  throw new D("Cannot specify both sessionId and channelKey. Use sessionId for precomputed sessions or channelKey to select a channel.");
4402
4421
  const n = ns(t.backendType), r = t.token;
4403
- Be.debug(`Authenticating with session token to: ${n}, space ID: ${t.spaceId}`);
4422
+ re.debug(`Authenticating with session token to: ${n}, space ID: ${t.spaceId}`);
4404
4423
  const s = await fetch(`${n}/profiles/me?space=${encodeURIComponent(t.spaceId)}`, {
4405
4424
  method: "GET",
4406
4425
  headers: {
@@ -4414,18 +4433,18 @@ async function sd(t, e) {
4414
4433
  }
4415
4434
  const i = await ss(n, t.spaceId, t.channelKey, t.parameters, t.sessionId, r, e), o = $e(), a = wt(), c = {
4416
4435
  code: i.code,
4417
- contextType: ae.Browser,
4418
- userType: le.Human,
4436
+ contextType: ce.Browser,
4437
+ userType: ue.Human,
4419
4438
  clientType: Ct(),
4420
- payloadType: ce.Teleport,
4439
+ payloadType: le.Teleport,
4421
4440
  description: t.description ?? "Ikon SDK TypeScript",
4422
4441
  deviceId: t.deviceId ?? He(),
4423
4442
  productId: t.productId ?? "",
4424
4443
  versionId: t.versionId ?? "",
4425
4444
  installId: t.installId ?? "",
4426
4445
  locale: t.locale ?? (typeof navigator < "u" ? navigator.language : "en-US"),
4427
- opcodeGroupsFromServer: t.opcodeGroupsFromServer ?? re,
4428
- opcodeGroupsToServer: t.opcodeGroupsToServer ?? re,
4446
+ opcodeGroupsFromServer: t.opcodeGroupsFromServer ?? se,
4447
+ opcodeGroupsToServer: t.opcodeGroupsToServer ?? se,
4429
4448
  protocolVersion: 1,
4430
4449
  userAgent: typeof navigator < "u" ? navigator.userAgent : "",
4431
4450
  launchParams: { ...o, ...t.parameters },
@@ -4441,9 +4460,9 @@ async function sd(t, e) {
4441
4460
  if (!h.configuration?.url)
4442
4461
  throw new D("Backend did not return a connect URL");
4443
4462
  const f = h.configuration.url;
4444
- return Se(f, e);
4463
+ return ge(f, e);
4445
4464
  }
4446
- const id = new Uint8Array(0);
4465
+ const ad = new Uint8Array(0);
4447
4466
  function xe(t) {
4448
4467
  switch (t.kind) {
4449
4468
  case "array":
@@ -4466,7 +4485,7 @@ function xe(t) {
4466
4485
  };
4467
4486
  }
4468
4487
  }
4469
- function ge(t) {
4488
+ function Ce(t) {
4470
4489
  switch (t.kind) {
4471
4490
  case "boolean":
4472
4491
  return "System.Boolean";
@@ -4475,9 +4494,9 @@ function ge(t) {
4475
4494
  case "string":
4476
4495
  return "System.String";
4477
4496
  case "array":
4478
- return `System.Collections.Generic.List\`1[${ge(t.element)}]`;
4497
+ return `System.Collections.Generic.List\`1[${Ce(t.element)}]`;
4479
4498
  case "dictionary":
4480
- return `System.Collections.Generic.Dictionary\`2[${t.keyType === "int" ? "System.Int32" : "System.String"},${ge(t.value)}]`;
4499
+ return `System.Collections.Generic.Dictionary\`2[${t.keyType === "int" ? "System.Int32" : "System.String"},${Ce(t.value)}]`;
4481
4500
  default:
4482
4501
  return t;
4483
4502
  }
@@ -4503,7 +4522,7 @@ function os(t, e) {
4503
4522
  }
4504
4523
  return JSON.stringify(t);
4505
4524
  }
4506
- function od(t, e) {
4525
+ function cd(t, e) {
4507
4526
  const n = (t.parameters ?? []).map((i) => {
4508
4527
  const o = xe(i.type), a = Object.prototype.hasOwnProperty.call(i, "defaultValue"), c = a ? os(i.defaultValue, o) : "";
4509
4528
  return {
@@ -4519,7 +4538,7 @@ function od(t, e) {
4519
4538
  Description: t.description ?? "",
4520
4539
  LlmInlineResult: t.llmInlineResult ?? !1,
4521
4540
  LlmCallOnlyOnce: t.llmCallOnlyOnce ?? !1,
4522
- ResultTypeName: ge(r),
4541
+ ResultTypeName: Ce(r),
4523
4542
  IsEnumerable: !1,
4524
4543
  EnumerableItemTypeName: "",
4525
4544
  IsCancellable: !1,
@@ -4528,10 +4547,10 @@ function od(t, e) {
4528
4547
  Parameters: n.map((i, o) => ({
4529
4548
  ParameterIndex: o,
4530
4549
  ParameterName: i.name,
4531
- TypeName: ge(i.descriptor),
4550
+ TypeName: Ce(i.descriptor),
4532
4551
  HasDefaultValue: i.hasDefaultValue,
4533
4552
  DefaultValueJson: i.defaultValueJson,
4534
- DefaultValueData: id,
4553
+ DefaultValueData: ad,
4535
4554
  IsEnumerable: !1,
4536
4555
  EnumerableItemTypeName: "",
4537
4556
  Description: i.description ?? ""
@@ -4545,19 +4564,19 @@ function od(t, e) {
4545
4564
  returnType: r
4546
4565
  };
4547
4566
  }
4548
- function ad(t, e) {
4567
+ function ld(t, e) {
4549
4568
  return { value: t, data: e };
4550
4569
  }
4551
- class cd extends Error {
4570
+ class ud extends Error {
4552
4571
  constructor(e, n, r) {
4553
4572
  super(e), this.remoteErrorType = n, this.remoteStackTrace = r, this.name = "FunctionCallError";
4554
4573
  }
4555
4574
  }
4556
- const fe = M("FunctionRegistry"), Wt = new Uint8Array(0), Gt = 3e4;
4557
- function ld(t) {
4575
+ const pe = M("FunctionRegistry"), Wt = new Uint8Array(0), Gt = 3e4;
4576
+ function dd(t) {
4558
4577
  return !t || typeof t != "object" ? !1 : t.data instanceof Uint8Array;
4559
4578
  }
4560
- class ud {
4579
+ class hd {
4561
4580
  functions = /* @__PURE__ */ new Map();
4562
4581
  remoteFunctions = /* @__PURE__ */ new Map();
4563
4582
  pendingCalls = /* @__PURE__ */ new Map();
@@ -4584,7 +4603,7 @@ class ud {
4584
4603
  * If already connected, sends registration to server immediately.
4585
4604
  */
4586
4605
  register(e, n) {
4587
- const r = od(e, n);
4606
+ const r = cd(e, n);
4588
4607
  return this.functions.set(e.name, r), this.isConnected && this.config && this.sendRegistration(r), () => this.unregister(e.name);
4589
4608
  }
4590
4609
  /**
@@ -4713,9 +4732,9 @@ class ud {
4713
4732
  */
4714
4733
  handleProtocolMessage(e, n) {
4715
4734
  if (n === S.ACTION_FUNCTION_CALL) {
4716
- const r = ie(e);
4735
+ const r = oe(e);
4717
4736
  return this.handleFunctionCall(e, r.senderId).catch((s) => {
4718
- fe.error("Failed to handle function call:", s);
4737
+ pe.error("Failed to handle function call:", s);
4719
4738
  }), !0;
4720
4739
  }
4721
4740
  return n === S.ACTION_FUNCTION_RESULT ? (this.handleFunctionResult(e), !0) : n === S.ACTION_FUNCTION_ERROR ? (this.handleFunctionError(e), !0) : !1;
@@ -4723,7 +4742,7 @@ class ud {
4723
4742
  handleFunctionResult(e) {
4724
4743
  const n = ma(e), r = n.CallId.toString(), s = this.pendingCalls.get(r);
4725
4744
  if (!s) {
4726
- fe.warn(`Received result for unknown call: ${r}`);
4745
+ pe.warn(`Received result for unknown call: ${r}`);
4727
4746
  return;
4728
4747
  }
4729
4748
  this.pendingCalls.delete(r), clearTimeout(s.timeout);
@@ -4733,10 +4752,10 @@ class ud {
4733
4752
  handleFunctionError(e) {
4734
4753
  const n = Vo(e), r = n.CallId.toString(), s = this.pendingCalls.get(r);
4735
4754
  if (!s) {
4736
- fe.warn(`Received error for unknown call: ${r}`);
4755
+ pe.warn(`Received error for unknown call: ${r}`);
4737
4756
  return;
4738
4757
  }
4739
- this.pendingCalls.delete(r), clearTimeout(s.timeout), s.reject(new cd(n.ErrorMessage, n.ErrorTypeName, n.StackTrace));
4758
+ this.pendingCalls.delete(r), clearTimeout(s.timeout), s.reject(new ud(n.ErrorMessage, n.ErrorTypeName, n.StackTrace));
4740
4759
  }
4741
4760
  inferTypeName(e) {
4742
4761
  if (e == null)
@@ -4777,7 +4796,7 @@ class ud {
4777
4796
  async handleFunctionCall(e, n) {
4778
4797
  const r = await No(e), s = this.functions.get(r.FunctionName);
4779
4798
  if (!s) {
4780
- fe.warn(`Received call for unknown function: ${r.FunctionName}`), this.sendError(r.CallId, r.InstanceId, n, new Error(`Unknown function: ${r.FunctionName}`));
4799
+ pe.warn(`Received call for unknown function: ${r.FunctionName}`), this.sendError(r.CallId, r.InstanceId, n, new Error(`Unknown function: ${r.FunctionName}`));
4781
4800
  return;
4782
4801
  }
4783
4802
  this.sendAck(r.CallId, r.InstanceId, n), this.executeFunction(s, r, n);
@@ -4794,11 +4813,11 @@ class ud {
4794
4813
  }
4795
4814
  const i = await e.handler(...s);
4796
4815
  let o = i, a = Wt;
4797
- ld(i) && (o = i.value, a = new Uint8Array(i.data));
4816
+ dd(i) && (o = i.value, a = new Uint8Array(i.data));
4798
4817
  const c = os(o, e.returnType);
4799
4818
  this.sendResult(n.CallId, n.InstanceId, r, e, c, a);
4800
4819
  } catch (s) {
4801
- fe.error(`Function ${n.FunctionName} execution failed:`, s), this.sendError(n.CallId, n.InstanceId, r, s instanceof Error ? s : new Error(String(s)));
4820
+ pe.error(`Function ${n.FunctionName} execution failed:`, s), this.sendError(n.CallId, n.InstanceId, r, s instanceof Error ? s : new Error(String(s)));
4802
4821
  }
4803
4822
  }
4804
4823
  /**
@@ -4820,7 +4839,7 @@ class ud {
4820
4839
  wr({
4821
4840
  CallId: e,
4822
4841
  InstanceId: n,
4823
- ResultTypeName: ge(s.returnType),
4842
+ ResultTypeName: Ce(s.returnType),
4824
4843
  ResultJson: i,
4825
4844
  ResultData: o
4826
4845
  }),
@@ -4849,7 +4868,7 @@ class ud {
4849
4868
  this.config.sendProtocolMessage(i);
4850
4869
  }
4851
4870
  }
4852
- function pe(t) {
4871
+ function me(t) {
4853
4872
  if (!(typeof t != "string" || !t.trim()))
4854
4873
  try {
4855
4874
  return JSON.parse(t);
@@ -4857,75 +4876,75 @@ function pe(t) {
4857
4876
  return;
4858
4877
  }
4859
4878
  }
4860
- const ye = {
4879
+ const Ae = {
4861
4880
  StartVideoCapture: "ikon.client.startVideoCapture",
4862
4881
  StartAudioCapture: "ikon.client.startAudioCapture",
4863
4882
  StopCapture: "ikon.client.stopCapture",
4864
4883
  CaptureImage: "ikon.client.captureImage",
4865
4884
  GetMediaDevices: "ikon.client.getMediaDevices"
4866
- }, dd = {
4867
- name: ye.StartVideoCapture,
4885
+ }, fd = {
4886
+ name: Ae.StartVideoCapture,
4868
4887
  description: "Start camera or screen capture and stream video frames to the server",
4869
4888
  returnType: { kind: "string" },
4870
4889
  parameters: [
4871
4890
  { name: "source", type: { kind: "string", nullable: !0 }, description: "camera or screen" },
4872
4891
  { name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }
4873
4892
  ]
4874
- }, hd = {
4875
- name: ye.StartAudioCapture,
4893
+ }, pd = {
4894
+ name: Ae.StartAudioCapture,
4876
4895
  description: "Start microphone capture and stream audio frames to the server",
4877
4896
  returnType: { kind: "string" },
4878
4897
  parameters: [{ name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }]
4879
- }, fd = {
4880
- name: ye.StopCapture,
4898
+ }, md = {
4899
+ name: Ae.StopCapture,
4881
4900
  description: "Stop a previously started capture by streamId",
4882
4901
  returnType: { kind: "boolean" },
4883
4902
  parameters: [{ name: "streamId", type: { kind: "string" }, description: "Stream ID to stop" }]
4884
- }, pd = {
4885
- name: ye.CaptureImage,
4903
+ }, Ed = {
4904
+ name: Ae.CaptureImage,
4886
4905
  description: "Capture a single image from the camera and return metadata (JSON) plus binary image data",
4887
4906
  returnType: { kind: "string" },
4888
4907
  parameters: [{ name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }]
4889
- }, md = {
4890
- name: ye.GetMediaDevices,
4908
+ }, Id = {
4909
+ name: Ae.GetMediaDevices,
4891
4910
  description: "Get list of available media input devices",
4892
4911
  returnType: { kind: "string" },
4893
4912
  parameters: []
4894
4913
  };
4895
- function Ed(t, e) {
4914
+ function _d(t, e) {
4896
4915
  const n = [];
4897
4916
  return n.push(
4898
- t.register(dd, async (r, s) => {
4917
+ t.register(fd, async (r, s) => {
4899
4918
  if (e.isWebRtcEnabled) {
4900
4919
  const l = e.webRtcSignaling;
4901
4920
  if (!l)
4902
4921
  throw new Error("WebRTC signaling is not connected");
4903
- const h = pe(s);
4922
+ const h = me(s);
4904
4923
  return await l.startVideoCapture(h?.constraints), "webrtc-video";
4905
4924
  }
4906
4925
  const i = e.mediaCapture;
4907
4926
  if (!i)
4908
4927
  throw new Error("Media capture is not available in this environment");
4909
- const o = pe(s);
4928
+ const o = me(s);
4910
4929
  return ((typeof r == "string" && r.trim().toLowerCase() === "screen" ? "screen" : "camera") === "screen" ? await i.video.startScreen({ userGesture: !1, options: o, constraints: o?.constraints }) : await i.video.startCamera({ userGesture: !1, options: o, constraints: o?.constraints })).streamId;
4911
4930
  })
4912
4931
  ), n.push(
4913
- t.register(hd, async (r) => {
4932
+ t.register(pd, async (r) => {
4914
4933
  if (e.isWebRtcEnabled) {
4915
4934
  const a = e.webRtcSignaling;
4916
4935
  if (!a)
4917
4936
  throw new Error("WebRTC signaling is not connected");
4918
- const c = pe(r);
4937
+ const c = me(r);
4919
4938
  return await a.startAudioCapture(c?.constraints), "webrtc-audio";
4920
4939
  }
4921
4940
  const s = e.mediaCapture;
4922
4941
  if (!s)
4923
4942
  throw new Error("Media capture is not available in this environment");
4924
- const i = pe(r);
4943
+ const i = me(r);
4925
4944
  return (await s.audio.startMic({ userGesture: !1, options: i, constraints: i?.constraints })).streamId;
4926
4945
  })
4927
4946
  ), n.push(
4928
- t.register(fd, async (r) => {
4947
+ t.register(md, async (r) => {
4929
4948
  if (e.isWebRtcEnabled) {
4930
4949
  const a = e.webRtcSignaling;
4931
4950
  return a && await a.stopCapture(), !0;
@@ -4937,11 +4956,11 @@ function Ed(t, e) {
4937
4956
  return i || o;
4938
4957
  })
4939
4958
  ), n.push(
4940
- t.register(pd, async (r) => {
4959
+ t.register(Ed, async (r) => {
4941
4960
  const s = e.mediaCapture;
4942
4961
  if (!s)
4943
4962
  throw new Error("Media capture is not available in this environment");
4944
- const i = pe(r) ?? {}, o = await s.image.captureFromCamera({
4963
+ const i = me(r) ?? {}, o = await s.image.captureFromCamera({
4945
4964
  userGesture: !1,
4946
4965
  constraints: i.constraints,
4947
4966
  mime: i.mime,
@@ -4949,10 +4968,10 @@ function Ed(t, e) {
4949
4968
  width: i.width,
4950
4969
  height: i.height
4951
4970
  }), a = JSON.stringify({ mime: o.mime, width: o.width, height: o.height });
4952
- return ad(a, o.data);
4971
+ return ld(a, o.data);
4953
4972
  })
4954
4973
  ), n.push(
4955
- t.register(md, async () => {
4974
+ t.register(Id, async () => {
4956
4975
  if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices)
4957
4976
  return JSON.stringify([]);
4958
4977
  const s = (await navigator.mediaDevices.enumerateDevices()).filter((i) => i.kind === "audioinput" || i.kind === "videoinput").map((i) => ({
@@ -4971,9 +4990,9 @@ function Ed(t, e) {
4971
4990
  const as = {
4972
4991
  PlaySound: "ikon.client.playSound",
4973
4992
  StopSound: "ikon.client.stopSound"
4974
- }, rt = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map();
4975
- let Id = 1;
4976
- const _d = {
4993
+ }, rt = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map();
4994
+ let Td = 1;
4995
+ const wd = {
4977
4996
  name: as.PlaySound,
4978
4997
  description: "Play a sound effect",
4979
4998
  returnType: { kind: "string", nullable: !0 },
@@ -4984,7 +5003,7 @@ const _d = {
4984
5003
  { name: "loop", type: { kind: "boolean", nullable: !0 }, description: "Loop the sound" }
4985
5004
  ]
4986
5005
  };
4987
- function Td(t, e, n, r) {
5006
+ function Sd(t, e, n, r) {
4988
5007
  if (typeof window > "u" || typeof Audio > "u" || typeof t != "string" || !t.trim())
4989
5008
  return Promise.resolve(null);
4990
5009
  let s = t;
@@ -4998,10 +5017,10 @@ function Td(t, e, n, r) {
4998
5017
  try {
4999
5018
  const o = new Audio(s), a = typeof n == "number" ? Math.max(0, Math.min(1, n)) : 1;
5000
5019
  o.volume = a, r === !0 && (o.loop = !0);
5001
- const c = `sound-${Id++}`, l = () => {
5002
- se.delete(c), o.removeEventListener("ended", l), o.removeEventListener("error", l);
5020
+ const c = `sound-${Td++}`, l = () => {
5021
+ ie.delete(c), o.removeEventListener("ended", l), o.removeEventListener("error", l);
5003
5022
  };
5004
- o.addEventListener("ended", l), o.addEventListener("error", l), se.set(c, o), o.play().then(
5023
+ o.addEventListener("ended", l), o.addEventListener("error", l), ie.set(c, o), o.play().then(
5005
5024
  () => i(c),
5006
5025
  () => {
5007
5026
  l(), i(null);
@@ -5012,42 +5031,42 @@ function Td(t, e, n, r) {
5012
5031
  }
5013
5032
  });
5014
5033
  }
5015
- const wd = {
5034
+ const gd = {
5016
5035
  name: as.StopSound,
5017
5036
  description: "Stop a playing sound by ID",
5018
5037
  returnType: { kind: "boolean" },
5019
5038
  parameters: [{ name: "playbackId", type: { kind: "string" }, description: "Playback ID from playSound" }]
5020
5039
  };
5021
- function Sd(t) {
5040
+ function Cd(t) {
5022
5041
  if (typeof t != "string")
5023
5042
  return !1;
5024
- const e = se.get(t);
5043
+ const e = ie.get(t);
5025
5044
  if (!e)
5026
5045
  return !1;
5027
5046
  try {
5028
- return e.pause(), e.currentTime = 0, se.delete(t), !0;
5047
+ return e.pause(), e.currentTime = 0, ie.delete(t), !0;
5029
5048
  } catch {
5030
5049
  return !1;
5031
5050
  }
5032
5051
  }
5033
- function gd() {
5052
+ function yd() {
5034
5053
  rt.clear();
5035
- for (const [t, e] of se) {
5054
+ for (const [t, e] of ie) {
5036
5055
  try {
5037
5056
  e.pause(), e.currentTime = 0;
5038
5057
  } catch {
5039
5058
  }
5040
- se.delete(t);
5059
+ ie.delete(t);
5041
5060
  }
5042
5061
  }
5043
- const Cd = [
5044
- { definition: _d, handler: Td },
5045
- { definition: wd, handler: Sd }
5062
+ const Ad = [
5063
+ { definition: wd, handler: Sd },
5064
+ { definition: gd, handler: Cd }
5046
5065
  ];
5047
- function yd(t) {
5048
- const e = Cd.map(({ definition: n, handler: r }) => t.register(n, r));
5066
+ function Rd(t) {
5067
+ const e = Ad.map(({ definition: n, handler: r }) => t.register(n, r));
5049
5068
  return () => {
5050
- e.forEach((n) => n()), gd();
5069
+ e.forEach((n) => n()), yd();
5051
5070
  };
5052
5071
  }
5053
5072
  const cs = () => {
@@ -5055,25 +5074,25 @@ const cs = () => {
5055
5074
  return !1;
5056
5075
  const t = navigator.userAgent, e = /iPad|iPhone|iPod/.test(t), n = t.includes("Macintosh") && typeof navigator.maxTouchPoints == "number" && navigator.maxTouchPoints > 1;
5057
5076
  return e || n;
5058
- }, ke = M("Capabilities"), Ad = globalThis;
5059
- function Oe() {
5077
+ }, De = M("Capabilities"), bd = globalThis;
5078
+ function Me() {
5060
5079
  if (typeof SharedArrayBuffer > "u")
5061
- return ke.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
5080
+ return De.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
5062
5081
  if (typeof Atomics > "u")
5063
- return ke.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
5064
- if (Ad.crossOriginIsolated === !1)
5065
- return ke.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
5082
+ return De.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
5083
+ if (bd.crossOriginIsolated === !1)
5084
+ return De.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
5066
5085
  try {
5067
5086
  new SharedArrayBuffer(1);
5068
5087
  } catch (t) {
5069
- return ke.debug(`SharedArrayBuffer not supported: construction failed - ${t instanceof Error ? t.message : String(t)}`), !1;
5088
+ return De.debug(`SharedArrayBuffer not supported: construction failed - ${t instanceof Error ? t.message : String(t)}`), !1;
5070
5089
  }
5071
5090
  return !0;
5072
5091
  }
5073
5092
  function ls(t) {
5074
5093
  return typeof AudioWorkletNode != "function" ? !1 : typeof t.audioWorklet?.addModule == "function";
5075
5094
  }
5076
- function Rd() {
5095
+ function Nd() {
5077
5096
  const r = new ArrayBuffer(882044), s = new DataView(r), i = (a, c) => {
5078
5097
  for (let l = 0; l < c.length; l++)
5079
5098
  s.setUint8(a + l, c.charCodeAt(l));
@@ -5088,7 +5107,7 @@ class us {
5088
5107
  return this._silentAudioElement;
5089
5108
  }
5090
5109
  setup(e, n) {
5091
- if (!(typeof document > "u") && (this._silentAudioElement || (this._silentAudioElement = document.createElement("audio"), this._silentAudioElement.src = Rd(), this._silentAudioElement.loop = !0, this._silentAudioElement.volume = 0.01, this._silentAudioElement.play().catch(() => {
5110
+ if (!(typeof document > "u") && (this._silentAudioElement || (this._silentAudioElement = document.createElement("audio"), this._silentAudioElement.src = Nd(), this._silentAudioElement.loop = !0, this._silentAudioElement.volume = 0.01, this._silentAudioElement.play().catch(() => {
5092
5111
  })), typeof navigator < "u" && "mediaSession" in navigator)) {
5093
5112
  const r = e ?? {};
5094
5113
  navigator.mediaSession.metadata = new MediaMetadata({
@@ -5126,7 +5145,7 @@ class us {
5126
5145
  }
5127
5146
  }
5128
5147
  }
5129
- function bd(t) {
5148
+ function kd(t) {
5130
5149
  return new Worker(
5131
5150
  "" + new URL("assets/audio-playback-worker-B2QUogPo.js", import.meta.url).href,
5132
5151
  {
@@ -5135,7 +5154,7 @@ function bd(t) {
5135
5154
  }
5136
5155
  );
5137
5156
  }
5138
- const De = 48e3, W = 2, ds = 1500, Vt = 512, Ht = "playback", Nd = 120, kd = 300, Dd = 4, vd = 200, Ud = 100, Od = 8e3, Md = 10, hs = 100, st = 50, fs = 128, Ld = 20, Fd = !0, X = 1500, Pd = -20, Bd = -100, xd = 200, b = M("IkonAudioPlayback"), Wd = () => {
5157
+ const ve = 48e3, W = 2, ds = 1500, Vt = 512, Ht = "playback", Dd = 120, vd = 300, Ud = 4, Od = 200, Md = 100, Ld = 8e3, Fd = 10, hs = 100, st = 50, fs = 128, Pd = 20, Bd = !0, X = 1500, xd = -20, Wd = -100, Gd = 200, b = M("IkonAudioPlayback"), Vd = () => {
5139
5158
  if (typeof navigator > "u" || typeof window > "u")
5140
5159
  return !1;
5141
5160
  const t = navigator.userAgent, e = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t), n = t.includes("Macintosh") && typeof navigator.maxTouchPoints == "number" && navigator.maxTouchPoints > 1;
@@ -5147,19 +5166,19 @@ const De = 48e3, W = 2, ds = 1500, Vt = 512, Ht = "playback", Nd = 120, kd = 300
5147
5166
  function J(t) {
5148
5167
  return t instanceof Error ? `${t.name}: ${t.message}` : String(t);
5149
5168
  }
5150
- function Gd(t) {
5169
+ function Hd(t) {
5151
5170
  return `
5152
5171
  // Audio buffer constants
5153
5172
  const OUTPUT_SAMPLE_RATE_HZ = ${t.outputSampleRateHz};
5154
5173
  const DEFAULT_FRAME_SAMPLES_PER_CHANNEL = Math.max(1, Math.round(OUTPUT_SAMPLE_RATE_HZ * 0.02));
5155
- const BUFFER_TARGET_MIN_MS = ${Nd};
5156
- const BUFFER_TARGET_MAX_MS = ${kd};
5157
- const JITTER_MULTIPLIER = ${Dd};
5174
+ const BUFFER_TARGET_MIN_MS = ${Dd};
5175
+ const BUFFER_TARGET_MAX_MS = ${vd};
5176
+ const JITTER_MULTIPLIER = ${Ud};
5158
5177
  const LOCAL_BUFFER_MAX_MS = ${ds};
5159
- const CONTROL_PERIOD_MS = ${vd};
5160
- const UNDERRUN_JUMP_MS = ${Ud};
5161
- const STABLE_TIME_TO_DECREASE_MS = ${Od};
5162
- const DECREASE_STEP_MS = ${Md};
5178
+ const CONTROL_PERIOD_MS = ${Od};
5179
+ const UNDERRUN_JUMP_MS = ${Md};
5180
+ const STABLE_TIME_TO_DECREASE_MS = ${Ld};
5181
+ const DECREASE_STEP_MS = ${Fd};
5163
5182
  const DEFAULT_STATS_INTERVAL_SAMPLES = OUTPUT_SAMPLE_RATE_HZ;
5164
5183
 
5165
5184
  // Pre-computed reciprocals for division-free calculations
@@ -5178,7 +5197,7 @@ const FADE_OUT_INCREMENT = 1.0 / FADE_OUT_DURATION_SAMPLES;
5178
5197
  const RENDER_QUANTUM_SIZE = ${fs};
5179
5198
 
5180
5199
  // Buffer reduction crossfade constants (align to quantum boundary to avoid partial quanta)
5181
- const BUFFER_REDUCTION_CROSSFADE_MS = ${Ld};
5200
+ const BUFFER_REDUCTION_CROSSFADE_MS = ${Pd};
5182
5201
  const BUFFER_REDUCTION_CROSSFADE_SAMPLES_RAW = Math.round(OUTPUT_SAMPLE_RATE_HZ * BUFFER_REDUCTION_CROSSFADE_MS / 1000);
5183
5202
  const BUFFER_REDUCTION_CROSSFADE_SAMPLES = Math.ceil(BUFFER_REDUCTION_CROSSFADE_SAMPLES_RAW / RENDER_QUANTUM_SIZE) * RENDER_QUANTUM_SIZE;
5184
5203
 
@@ -5389,7 +5408,7 @@ class IkonAudioPlayerProcessor extends AudioWorkletProcessor {
5389
5408
  this.statsIntervalSamples = Math.max(1, Math.round((OUTPUT_SAMPLE_RATE_HZ * statusIntervalMs) / 1000));
5390
5409
 
5391
5410
  // Normalization config (hardcoded)
5392
- this.normalizationEnabled = ${Fd};
5411
+ this.normalizationEnabled = ${Bd};
5393
5412
 
5394
5413
  // Stream states for audio buffer
5395
5414
  this.streams = new Map();
@@ -6119,7 +6138,7 @@ class At {
6119
6138
  config;
6120
6139
  enabled = !1;
6121
6140
  stateUnsubscribe = null;
6122
- isMobile = Wd();
6141
+ isMobile = Vd();
6123
6142
  boundVisibilityChange = null;
6124
6143
  boundPageHide = null;
6125
6144
  unlockHandler = null;
@@ -6128,7 +6147,7 @@ class At {
6128
6147
  /** Timeout for AudioContext.resume() - normally resolves instantly, but some browsers hang indefinitely */
6129
6148
  static RESUME_TIMEOUT_MS = 100;
6130
6149
  audioContext = null;
6131
- outputSampleRateHz = De;
6150
+ outputSampleRateHz = ve;
6132
6151
  audioWorkletNode = null;
6133
6152
  scriptProcessorNode = null;
6134
6153
  scriptDiagnosticsTimer = null;
@@ -6234,7 +6253,7 @@ class At {
6234
6253
  this.stopAudioGraph();
6235
6254
  try {
6236
6255
  const e = new AudioContext({
6237
- sampleRate: De,
6256
+ sampleRate: ve,
6238
6257
  latencyHint: Ht
6239
6258
  });
6240
6259
  this.audioContext = e, this.outputSampleRateHz = e.sampleRate, e.resume(), this.setupAudioGraphAfterRecreate();
@@ -6340,14 +6359,14 @@ class At {
6340
6359
  }
6341
6360
  if (!d)
6342
6361
  continue;
6343
- const T = d.samplePosition + Math.max(d.frameSamples, 1);
6344
- if (a > T && !p)
6362
+ const _ = d.samplePosition + Math.max(d.frameSamples, 1);
6363
+ if (a > _ && !p)
6345
6364
  continue;
6346
6365
  if (!p)
6347
6366
  return this._visemeResult.mouthOpenY = d.mouthOpenY, this._visemeResult.mouthForm = d.mouthForm, this._visemeResult;
6348
- const _ = d.samplePosition, I = Math.max(d.frameSamples, 1), m = _ + I;
6349
- if (d !== p && p.samplePosition > d.samplePosition && m > _) {
6350
- const u = Math.min(1, Math.max(0, (a - _) / (m - _)));
6367
+ const T = d.samplePosition, I = Math.max(d.frameSamples, 1), m = T + I;
6368
+ if (d !== p && p.samplePosition > d.samplePosition && m > T) {
6369
+ const u = Math.min(1, Math.max(0, (a - T) / (m - T)));
6351
6370
  this._visemeResult.mouthOpenY = d.mouthOpenY + u * (p.mouthOpenY - d.mouthOpenY), this._visemeResult.mouthForm = d.mouthForm + u * (p.mouthForm - d.mouthForm);
6352
6371
  } else
6353
6372
  this._visemeResult.mouthOpenY = d.mouthOpenY, this._visemeResult.mouthForm = d.mouthForm;
@@ -6373,7 +6392,7 @@ class At {
6373
6392
  if (typeof window > "u")
6374
6393
  return;
6375
6394
  if (!this.audioContext) {
6376
- const a = De, c = Ht;
6395
+ const a = ve, c = Ht;
6377
6396
  try {
6378
6397
  this.audioContext = new AudioContext({ sampleRate: a, latencyHint: c });
6379
6398
  } catch (l) {
@@ -6390,7 +6409,7 @@ class At {
6390
6409
  }
6391
6410
  b.debug(`AudioContext sample rate request unsupported: ${J(l)}`);
6392
6411
  }
6393
- this.outputSampleRateHz = this.audioContext.sampleRate || De, this.outputSampleRateHz !== a && b.debug(`AudioContext running at ${this.outputSampleRateHz}Hz (requested ${a}Hz)`), this.attachAudioContextHealthHandlers(this.audioContext);
6412
+ this.outputSampleRateHz = this.audioContext.sampleRate || ve, this.outputSampleRateHz !== a && b.debug(`AudioContext running at ${this.outputSampleRateHz}Hz (requested ${a}Hz)`), this.attachAudioContextHealthHandlers(this.audioContext);
6394
6413
  }
6395
6414
  const r = this.audioContext, s = this.resolveDiagnosticsConfig();
6396
6415
  if ((this.config.performance?.preferAudioWorklet ?? !0) && ls(r)) {
@@ -6523,7 +6542,7 @@ class At {
6523
6542
  URL.revokeObjectURL(this.workletModuleUrl);
6524
6543
  } catch {
6525
6544
  }
6526
- this.workletModuleKey = i, this.workletReady = null, this.workletModuleUrl = URL.createObjectURL(new Blob([Gd({ outputSampleRateHz: this.outputSampleRateHz, outputChannels: W })], { type: "text/javascript" }));
6545
+ this.workletModuleKey = i, this.workletReady = null, this.workletModuleUrl = URL.createObjectURL(new Blob([Hd({ outputSampleRateHz: this.outputSampleRateHz, outputChannels: W })], { type: "text/javascript" }));
6527
6546
  }
6528
6547
  this.workletReady || (this.workletReady = e.audioWorklet.addModule(this.workletModuleUrl).catch((h) => {
6529
6548
  throw b.warn(`Failed to load AudioWorklet module, falling back: ${J(h)}`), h;
@@ -6535,7 +6554,7 @@ class At {
6535
6554
  return;
6536
6555
  }
6537
6556
  this.stopScriptProcessor();
6538
- const a = (this.config.performance?.preferSharedArrayBuffer ?? !0) && Oe();
6557
+ const a = (this.config.performance?.preferSharedArrayBuffer ?? !0) && Me();
6539
6558
  this.audioWorkletNode = new AudioWorkletNode(e, "ikon-audio-player", {
6540
6559
  numberOfInputs: 0,
6541
6560
  numberOfOutputs: 1,
@@ -6579,26 +6598,26 @@ class At {
6579
6598
  this.stopAudioWorklet(), this.pendingWorkletMessages = [];
6580
6599
  const r = 1024, s = new Float32Array(r * W), i = Math.round(this.outputSampleRateHz * hs / 1e3), o = Math.round(this.outputSampleRateHz * st / 1e3), a = 1 / i, c = 1 / o, l = new Array(W), h = [], f = e.createScriptProcessor(r, 0, W);
6581
6600
  f.onaudioprocess = (d) => {
6582
- const p = d.outputBuffer, T = p.numberOfChannels, _ = p.length;
6583
- for (let m = 0; m < T; m++) {
6601
+ const p = d.outputBuffer, _ = p.numberOfChannels, T = p.length;
6602
+ for (let m = 0; m < _; m++) {
6584
6603
  const u = p.getChannelData(m);
6585
6604
  u.fill(0), l[m] = u;
6586
6605
  }
6587
6606
  let I = 0;
6588
6607
  h.length = 0;
6589
6608
  for (const [m, u] of this.fallbackQueues.entries()) {
6590
- u.totalSamples > 0 && (I += 1), (u.ending || u.inputDrained) && u.fadeDirection !== "out" && u.totalSamples / T * 1e3 / this.outputSampleRateHz <= st * 2 && (u.fadeDirection = "out"), this.readFromFallbackQueue(u, s), (u.totalSamples > 0 || !u.hasLastOut) && ((!u.lastOut || u.lastOut.length !== s.length) && (u.lastOut = new Float32Array(s.length)), u.lastOut.set(s), u.hasLastOut = !0);
6591
- for (let C = 0; C < _; C++) {
6609
+ u.totalSamples > 0 && (I += 1), (u.ending || u.inputDrained) && u.fadeDirection !== "out" && u.totalSamples / _ * 1e3 / this.outputSampleRateHz <= st * 2 && (u.fadeDirection = "out"), this.readFromFallbackQueue(u, s), (u.totalSamples > 0 || !u.hasLastOut) && ((!u.lastOut || u.lastOut.length !== s.length) && (u.lastOut = new Float32Array(s.length)), u.lastOut.set(s), u.hasLastOut = !0);
6610
+ for (let C = 0; C < T; C++) {
6592
6611
  u.fadeDirection === "in" ? (u.fadeGain = Math.min(1, u.fadeGain + a), u.fadeGain >= 1 && (u.fadeDirection = "none")) : u.fadeDirection === "out" && (u.fadeGain = Math.max(0, u.fadeGain - c), u.fadeGain <= 0 && (u.fadeDirection = "none"));
6593
- for (let N = 0; N < T; N++) {
6594
- const E = s[C * T + N];
6612
+ for (let N = 0; N < _; N++) {
6613
+ const E = s[C * _ + N];
6595
6614
  l[N][C] += E * u.fadeGain;
6596
6615
  }
6597
6616
  }
6598
6617
  const k = u.ending || u.inputDrained;
6599
6618
  if (k && u.totalSamples <= 0) {
6600
6619
  if (u.fadeDirection === "out" && u.fadeGain > 1e-3) {
6601
- for (let C = 0; C < _; C++)
6620
+ for (let C = 0; C < T; C++)
6602
6621
  if (u.fadeGain = Math.max(0, u.fadeGain - c), u.fadeGain <= 1e-3) {
6603
6622
  u.fadeGain = 0, u.fadeDirection = "none";
6604
6623
  break;
@@ -6607,11 +6626,11 @@ class At {
6607
6626
  u.fadeGain <= 1e-3 && u.ending && h.push(m);
6608
6627
  } else if (!k && u.totalSamples <= 0 && u.hasLastOut && u.lastOut && u.fadeGain > 1e-3) {
6609
6628
  u.fadeDirection = "out", u.underrunPending = !0;
6610
- const C = u.lastOut, N = _ - 1;
6611
- for (let E = 0; E < _; E++) {
6629
+ const C = u.lastOut, N = T - 1;
6630
+ for (let E = 0; E < T; E++) {
6612
6631
  u.fadeGain = Math.max(0, u.fadeGain - c), u.fadeGain <= 0 && (u.fadeDirection = "none");
6613
- for (let z = 0; z < T; z++) {
6614
- const Rt = C[N * T + z];
6632
+ for (let z = 0; z < _; z++) {
6633
+ const Rt = C[N * _ + z];
6615
6634
  l[z][E] += Rt * u.fadeGain;
6616
6635
  }
6617
6636
  }
@@ -6624,12 +6643,12 @@ class At {
6624
6643
  }
6625
6644
  if (I > 1) {
6626
6645
  const m = 1 / Math.sqrt(I);
6627
- for (let u = 0; u < _; u++)
6628
- for (let k = 0; k < T; k++)
6646
+ for (let u = 0; u < T; u++)
6647
+ for (let k = 0; k < _; k++)
6629
6648
  l[k][u] *= m;
6630
6649
  }
6631
- for (let m = 0; m < _; m++)
6632
- for (let u = 0; u < T; u++) {
6650
+ for (let m = 0; m < T; m++)
6651
+ for (let u = 0; u < _; u++) {
6633
6652
  const k = l[u][m];
6634
6653
  l[u][m] = k > 1 ? 1 : k < -1 ? -1 : k;
6635
6654
  }
@@ -6749,7 +6768,7 @@ class At {
6749
6768
  rebindWorkerTransportIfNeeded() {
6750
6769
  if (!this.audioWorker || !this.audioContext)
6751
6770
  return;
6752
- const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && Oe() ? "sab" : "pcm";
6771
+ const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && Me() ? "sab" : "pcm";
6753
6772
  try {
6754
6773
  this.audioWorker.postMessage({
6755
6774
  type: "rebind",
@@ -6774,7 +6793,7 @@ class At {
6774
6793
  }
6775
6794
  this.protocolPort = e;
6776
6795
  try {
6777
- this.audioWorker = new bd();
6796
+ this.audioWorker = new kd();
6778
6797
  } catch (f) {
6779
6798
  b.warn(`Failed to create audio worker: ${J(f)}`), this.protocolPort.close(), this.protocolPort = null;
6780
6799
  return;
@@ -6784,7 +6803,7 @@ class At {
6784
6803
  const d = [f.message, f.filename, f.lineno, f.colno].filter((p) => p != null && String(p).length > 0);
6785
6804
  b.error(`Audio worker failed: ${d.join(" ")}`.trim());
6786
6805
  });
6787
- const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && Oe(), i = this.config.performance?.preferWebCodecs ?? !0, o = {
6806
+ const s = (this.config.performance?.preferSharedArrayBuffer ?? !0) && !!this.audioWorkletNode && Me(), i = this.config.performance?.preferWebCodecs ?? !0, o = {
6788
6807
  type: "configure",
6789
6808
  transport: s ? "sab" : "pcm",
6790
6809
  outputSampleRate: this.outputSampleRateHz,
@@ -6858,7 +6877,7 @@ class At {
6858
6877
  s.epochTimestampSamples = e.timestampInterleavedSamples;
6859
6878
  const c = this.audioContext;
6860
6879
  if (c) {
6861
- const l = (c.outputLatency ?? 0) + (c.baseLatency ?? 0), h = Pd + l * 1e3, f = Math.min(xd, Math.max(Bd, h));
6880
+ const l = (c.outputLatency ?? 0) + (c.baseLatency ?? 0), h = xd + l * 1e3, f = Math.min(Gd, Math.max(Wd, h));
6862
6881
  s.playbackStartContextTime = c.currentTime + f / 1e3;
6863
6882
  }
6864
6883
  s.timingEstablished = !0;
@@ -6981,7 +7000,7 @@ class At {
6981
7000
  }));
6982
7001
  }
6983
7002
  }
6984
- function Vd(t) {
7003
+ function $d(t) {
6985
7004
  return new Worker(
6986
7005
  "" + new URL("assets/video-playback-worker-DK-XDQMf.js", import.meta.url).href,
6987
7006
  {
@@ -6994,7 +7013,7 @@ const j = M("IkonVideoPlayback");
6994
7013
  function Ye(t) {
6995
7014
  return t instanceof Error ? `${t.name}: ${t.message}` : String(t);
6996
7015
  }
6997
- class Hd {
7016
+ class Kd {
6998
7017
  client;
6999
7018
  config;
7000
7019
  enabled = !0;
@@ -7069,7 +7088,7 @@ class Hd {
7069
7088
  }
7070
7089
  let e;
7071
7090
  try {
7072
- e = new Vd();
7091
+ e = new $d();
7073
7092
  } catch (n) {
7074
7093
  j.warn(`Failed to create video worker: ${Ye(n)}`);
7075
7094
  return;
@@ -7208,11 +7227,11 @@ class Hd {
7208
7227
  }));
7209
7228
  }
7210
7229
  }
7211
- class $d {
7230
+ class Yd {
7212
7231
  audio;
7213
7232
  video;
7214
7233
  constructor(e, n) {
7215
- this.audio = new At(e, n?.audio), this.video = new Hd(e, n?.video), n?.mediaSession && this.audio.setMediaSession(n.mediaSession);
7234
+ this.audio = new At(e, n?.audio), this.video = new Kd(e, n?.video), n?.mediaSession && this.audio.setMediaSession(n.mediaSession);
7216
7235
  }
7217
7236
  /**
7218
7237
  * Releases media resources (workers, audio graph, decoders).
@@ -7223,7 +7242,7 @@ class $d {
7223
7242
  this.audio.dispose(), this.video.dispose();
7224
7243
  }
7225
7244
  }
7226
- class Kd {
7245
+ class jd {
7227
7246
  static getStorageForCapacity(e, n) {
7228
7247
  const r = Int32Array.BYTES_PER_ELEMENT * 2, s = n.BYTES_PER_ELEMENT * e;
7229
7248
  return new SharedArrayBuffer(r + s);
@@ -7277,7 +7296,7 @@ class Kd {
7277
7296
  return r = (r + n) % this.capacity, Atomics.store(this.readWrite, 0, r), n;
7278
7297
  }
7279
7298
  }
7280
- function Yd(t) {
7299
+ function zd(t) {
7281
7300
  return new Worker(
7282
7301
  "" + new URL("assets/audio-capture-worker-DuKZS6HJ.js", import.meta.url).href,
7283
7302
  {
@@ -7286,11 +7305,11 @@ function Yd(t) {
7286
7305
  }
7287
7306
  );
7288
7307
  }
7289
- const R = M("IkonAudioCapture"), ve = 3, jd = 200, zd = 2e3, Xd = 5e3, Kt = 3e3;
7290
- function Jd(t) {
7308
+ const R = M("IkonAudioCapture"), Ue = 3, Xd = 200, Jd = 2e3, Qd = 5e3, Kt = 3e3;
7309
+ function Zd(t) {
7291
7310
  return new Promise((e) => setTimeout(e, t));
7292
7311
  }
7293
- function Qd(t) {
7312
+ function qd(t) {
7294
7313
  switch (t.name) {
7295
7314
  // Transient errors - worth retrying
7296
7315
  case "NotReadableError":
@@ -7315,11 +7334,11 @@ function Qd(t) {
7315
7334
  return { action: "fail", reason: "unknown", canRetry: !1 };
7316
7335
  }
7317
7336
  }
7318
- function Zd() {
7337
+ function eh() {
7319
7338
  const t = globalThis.crypto;
7320
7339
  return t?.randomUUID ? t.randomUUID() : `cap_${Date.now()}_${Math.floor(Math.random() * 1e9)}`;
7321
7340
  }
7322
- function qd() {
7341
+ function th() {
7323
7342
  return `
7324
7343
  class RingBuffer {
7325
7344
  static getStorageForCapacity(capacity, type) {
@@ -7448,7 +7467,7 @@ class IkonAudioCaptureProcessor extends AudioWorkletProcessor {
7448
7467
  registerProcessor('ikon-audio-capture', IkonAudioCaptureProcessor);
7449
7468
  `;
7450
7469
  }
7451
- class eh {
7470
+ class nh {
7452
7471
  constructor(e, n) {
7453
7472
  this.client = e, this.config = n ?? {}, this.setupDeviceChangeListener();
7454
7473
  }
@@ -7539,7 +7558,7 @@ class eh {
7539
7558
  if (e.stopped)
7540
7559
  return;
7541
7560
  const i = Date.now(), o = n.name;
7542
- if (e.lastErrorReason === r && e.lastErrorName === o && i - e.lastErrorTime < Xd)
7561
+ if (e.lastErrorReason === r && e.lastErrorName === o && i - e.lastErrorTime < Qd)
7543
7562
  return;
7544
7563
  e.lastErrorTime = i, e.lastErrorReason = r, e.lastErrorName = o;
7545
7564
  const a = this.config.autoRestartPolicy;
@@ -7562,7 +7581,7 @@ class eh {
7562
7581
  } catch {
7563
7582
  }
7564
7583
  e.pendingRestartTimer && clearTimeout(e.pendingRestartTimer);
7565
- const p = e.restartCount, T = e.onError, _ = {
7584
+ const p = e.restartCount, _ = e.onError, T = {
7566
7585
  ...e.originalRequest,
7567
7586
  constraints: e.currentConstraints,
7568
7587
  options: e.currentOptions,
@@ -7570,16 +7589,16 @@ class eh {
7570
7589
  onStateChange: e.onStateChange
7571
7590
  };
7572
7591
  e.pendingRestartTimer = setTimeout(() => {
7573
- e.pendingRestartTimer = null, !(!e.stopped || e.stoppedReason !== "recoverable-error") && this.startMic(_).then((I) => {
7592
+ e.pendingRestartTimer = null, !(!e.stopped || e.stoppedReason !== "recoverable-error") && this.startMic(T).then((I) => {
7574
7593
  const m = this.captures.get(I.captureId);
7575
7594
  m && (m.restartCount = p, m.lastStableTime = Date.now());
7576
7595
  }).catch((I) => {
7577
7596
  R.warn(`Auto-restart failed: ${I}`);
7578
7597
  const m = I instanceof Error ? I : new Error(String(I));
7579
7598
  let u = "unknown";
7580
- if (m.name === "NotAllowedError" && (u = "permission-revoked"), T)
7599
+ if (m.name === "NotAllowedError" && (u = "permission-revoked"), _)
7581
7600
  try {
7582
- T(
7601
+ _(
7583
7602
  new Error(`Auto-restart failed: ${m.message}`),
7584
7603
  u,
7585
7604
  p < l && u !== "permission-revoked"
@@ -7774,7 +7793,7 @@ class eh {
7774
7793
  ensureWorker() {
7775
7794
  if (this.worker)
7776
7795
  return this.worker;
7777
- const e = new Yd();
7796
+ const e = new zd();
7778
7797
  return this.worker = e, e.addEventListener("message", (n) => {
7779
7798
  const r = n.data;
7780
7799
  if (r?.type === "error") {
@@ -7852,25 +7871,25 @@ class eh {
7852
7871
  */
7853
7872
  async tryGetUserMediaWithRetries(e) {
7854
7873
  let n = new Error("No attempts made"), r = { action: "fail", reason: "unknown", canRetry: !1 };
7855
- for (let s = 0; s < ve; s++)
7874
+ for (let s = 0; s < Ue; s++)
7856
7875
  try {
7857
7876
  return { stream: await navigator.mediaDevices.getUserMedia({ audio: e }), error: n, errorInfo: r };
7858
7877
  } catch (i) {
7859
- if (n = i instanceof Error ? i : new Error(String(i)), r = Qd(n), R.debug(
7860
- `getUserMedia attempt ${s + 1}/${ve} failed: ${n.name} (action: ${r.action})`
7878
+ if (n = i instanceof Error ? i : new Error(String(i)), r = qd(n), R.debug(
7879
+ `getUserMedia attempt ${s + 1}/${Ue} failed: ${n.name} (action: ${r.action})`
7861
7880
  ), this.emitDiagnostic({
7862
7881
  event: "retry",
7863
7882
  details: {
7864
7883
  attempt: s + 1,
7865
- maxAttempts: ve,
7884
+ maxAttempts: Ue,
7866
7885
  errorName: n.name,
7867
7886
  action: r.action
7868
7887
  }
7869
7888
  }), r.action !== "retry")
7870
7889
  break;
7871
- if (s < ve - 1) {
7872
- const o = jd * (s + 1);
7873
- R.debug(`Retrying getUserMedia in ${o}ms`), await Jd(o);
7890
+ if (s < Ue - 1) {
7891
+ const o = Xd * (s + 1);
7892
+ R.debug(`Retrying getUserMedia in ${o}ms`), await Zd(o);
7874
7893
  }
7875
7894
  }
7876
7895
  return { stream: null, error: n, errorInfo: r };
@@ -7882,7 +7901,7 @@ class eh {
7882
7901
  async ensureWorklet(e) {
7883
7902
  if (!ls(e))
7884
7903
  throw new Error("AudioWorklet is not supported in this browser");
7885
- if (this.workletModuleUrl || (this.workletModuleUrl = URL.createObjectURL(new Blob([qd()], { type: "text/javascript" }))), this.workletReady && this.workletContext === e)
7904
+ if (this.workletModuleUrl || (this.workletModuleUrl = URL.createObjectURL(new Blob([th()], { type: "text/javascript" }))), this.workletReady && this.workletContext === e)
7886
7905
  try {
7887
7906
  await this.workletReady;
7888
7907
  return;
@@ -7904,7 +7923,7 @@ class eh {
7904
7923
  throw new Error("Cannot start audio capture before client is connected");
7905
7924
  if (this.client.isWebRtcEnabled)
7906
7925
  return this.startMicWebRtc(e);
7907
- const r = Zd(), s = {
7926
+ const r = eh(), s = {
7908
7927
  captureId: r,
7909
7928
  aborted: !1,
7910
7929
  stream: null,
@@ -7943,11 +7962,11 @@ class eh {
7943
7962
  s.source = f;
7944
7963
  const d = o.createGain();
7945
7964
  d.gain.value = 0, d.connect(o.destination), s.gain = d;
7946
- const _ = Oe() ? "sab" : "pcm";
7965
+ const T = Me() ? "sab" : "pcm";
7947
7966
  let I;
7948
- if (_ === "sab") {
7967
+ if (T === "sab") {
7949
7968
  const A = Math.floor(o.sampleRate * 10);
7950
- I = Kd.getStorageForCapacity(A, Float32Array);
7969
+ I = jd.getStorageForCapacity(A, Float32Array);
7951
7970
  }
7952
7971
  const m = "microphone", u = this.ensureWorker(), k = e.onStopped;
7953
7972
  u.postMessage({
@@ -7963,34 +7982,34 @@ class eh {
7963
7982
  ...e.options,
7964
7983
  preferWebCodecs: this.config.performance?.preferWebCodecs
7965
7984
  },
7966
- transport: _,
7985
+ transport: T,
7967
7986
  sharedArrayBuffer: I
7968
7987
  }), await new Promise((A, B) => {
7969
7988
  const $ = setTimeout(() => {
7970
- u.removeEventListener("message", Ae), B(new Error("Audio capture worker start timeout"));
7971
- }, 1e4), Ae = (ws) => {
7972
- const ue = ws.data;
7973
- if (ue?.type === "started" && ue.captureId === r)
7974
- clearTimeout($), u.removeEventListener("message", Ae), A();
7975
- else if (ue?.type === "error" && ue.captureId === r) {
7976
- clearTimeout($), u.removeEventListener("message", Ae);
7977
- const Ss = ue.error;
7989
+ u.removeEventListener("message", Re), B(new Error("Audio capture worker start timeout"));
7990
+ }, 1e4), Re = (ws) => {
7991
+ const de = ws.data;
7992
+ if (de?.type === "started" && de.captureId === r)
7993
+ clearTimeout($), u.removeEventListener("message", Re), A();
7994
+ else if (de?.type === "error" && de.captureId === r) {
7995
+ clearTimeout($), u.removeEventListener("message", Re);
7996
+ const Ss = de.error;
7978
7997
  B(new Error(Ss?.message ?? "Audio capture failed to start"));
7979
7998
  }
7980
7999
  };
7981
- u.addEventListener("message", Ae);
8000
+ u.addEventListener("message", Re);
7982
8001
  }), i();
7983
8002
  const C = new AudioWorkletNode(o, "ikon-audio-capture", {
7984
8003
  numberOfInputs: 1,
7985
8004
  numberOfOutputs: 1,
7986
8005
  outputChannelCount: [1],
7987
8006
  processorOptions: {
7988
- transport: _,
8007
+ transport: T,
7989
8008
  channels: 1,
7990
8009
  sharedArrayBuffer: I
7991
8010
  }
7992
8011
  });
7993
- s.worklet = C, f.connect(C), C.connect(d), _ === "pcm" && (C.port.onmessage = (A) => {
8012
+ s.worklet = C, f.connect(C), C.connect(d), T === "pcm" && (C.port.onmessage = (A) => {
7994
8013
  const B = A.data;
7995
8014
  if (!(!B || typeof B != "object") && B.type === "pcm" && B.pcm instanceof Float32Array) {
7996
8015
  const $ = B.pcm;
@@ -8082,7 +8101,7 @@ class eh {
8082
8101
  };
8083
8102
  this.setupAudioContextStateListener(o, E), this.setupVisibilityChangeListener(E), this.setupBFCacheHandlers(E), E.healthCheckTimer = setInterval(() => {
8084
8103
  this.performHealthCheck(E);
8085
- }, zd);
8104
+ }, Jd);
8086
8105
  const z = () => {
8087
8106
  E.stopped || (R.warn(`Microphone track ended unexpectedly, captureId=${r.substring(0, 8)}`), this.handleRecoverableError(E, new Error("Microphone track ended unexpectedly"), "track-ended"));
8088
8107
  };
@@ -8293,9 +8312,9 @@ class eh {
8293
8312
  return !n || n.stopped ? !1 : this.attemptResumeAsync(n, "userGesture", !0);
8294
8313
  }
8295
8314
  }
8296
- const Ee = 1280, Ie = 720, th = 30, ps = "image/jpeg", nh = 0.92;
8297
- async function rh(t, e) {
8298
- const n = e.mime ?? ps, r = e.quality ?? nh;
8315
+ const Ie = 1280, _e = 720, rh = 30, ps = "image/jpeg", sh = 0.92;
8316
+ async function ih(t, e) {
8317
+ const n = e.mime ?? ps, r = e.quality ?? sh;
8299
8318
  if (typeof OffscreenCanvas < "u" && t instanceof OffscreenCanvas)
8300
8319
  try {
8301
8320
  return await t.convertToBlob({ type: n, quality: r });
@@ -8312,11 +8331,11 @@ async function rh(t, e) {
8312
8331
  );
8313
8332
  });
8314
8333
  }
8315
- class sh {
8334
+ class oh {
8316
8335
  async acquireCameraStream(e) {
8317
8336
  if (!navigator.mediaDevices)
8318
8337
  throw new Error("Media devices are not available in this environment");
8319
- const n = e.constraints ?? {}, r = e.width ?? Ee, s = e.height ?? Ie, i = {
8338
+ const n = e.constraints ?? {}, r = e.width ?? Ie, s = e.height ?? _e, i = {
8320
8339
  ...n,
8321
8340
  width: n.width ?? { ideal: r },
8322
8341
  height: n.height ?? { ideal: s }
@@ -8334,15 +8353,15 @@ class sh {
8334
8353
  } catch {
8335
8354
  }
8336
8355
  try {
8337
- await new Promise((p, T) => {
8338
- const _ = () => p(), I = () => T(new Error("Failed to load video element"));
8339
- s.addEventListener("loadedmetadata", _, { once: !0 }), s.addEventListener("error", I, { once: !0 });
8356
+ await new Promise((p, _) => {
8357
+ const T = () => p(), I = () => _(new Error("Failed to load video element"));
8358
+ s.addEventListener("loadedmetadata", T, { once: !0 }), s.addEventListener("error", I, { once: !0 });
8340
8359
  });
8341
8360
  try {
8342
8361
  await s.play();
8343
8362
  } catch {
8344
8363
  }
8345
- const i = s.videoWidth || (r.getSettings().width ?? Ee), o = s.videoHeight || (r.getSettings().height ?? Ie), a = e.width ? Math.max(1, Math.floor(e.width)) : i, c = e.height ? Math.max(1, Math.floor(e.height)) : o;
8364
+ const i = s.videoWidth || (r.getSettings().width ?? Ie), o = s.videoHeight || (r.getSettings().height ?? _e), a = e.width ? Math.max(1, Math.floor(e.width)) : i, c = e.height ? Math.max(1, Math.floor(e.height)) : o;
8346
8365
  let l;
8347
8366
  if (typeof OffscreenCanvas < "u")
8348
8367
  l = new OffscreenCanvas(a, c);
@@ -8354,7 +8373,7 @@ class sh {
8354
8373
  if (!h)
8355
8374
  throw new Error("2D canvas context unavailable");
8356
8375
  h.drawImage(s, 0, 0, a, c);
8357
- const f = await rh(l, e), d = await f.arrayBuffer();
8376
+ const f = await ih(l, e), d = await f.arrayBuffer();
8358
8377
  return {
8359
8378
  mime: f.type || e.mime || ps,
8360
8379
  width: a,
@@ -8381,7 +8400,7 @@ class sh {
8381
8400
  }
8382
8401
  }
8383
8402
  }
8384
- function ih(t) {
8403
+ function ah(t) {
8385
8404
  return new Worker(
8386
8405
  "" + new URL("assets/video-capture-worker-DTgsPNGF.js", import.meta.url).href,
8387
8406
  {
@@ -8390,18 +8409,18 @@ function ih(t) {
8390
8409
  }
8391
8410
  );
8392
8411
  }
8393
- const me = M("IkonVideoCapture");
8394
- function oh() {
8412
+ const Ee = M("IkonVideoCapture");
8413
+ function ch() {
8395
8414
  const t = globalThis.crypto;
8396
8415
  return t?.randomUUID ? t.randomUUID() : `cap_${Date.now()}_${Math.floor(Math.random() * 1e9)}`;
8397
8416
  }
8398
- function ah() {
8417
+ function lh() {
8399
8418
  const t = globalThis.MediaStreamTrackProcessor;
8400
8419
  if (!t)
8401
8420
  throw new Error("MediaStreamTrackProcessor is not available in this browser");
8402
8421
  return t;
8403
8422
  }
8404
- class ch {
8423
+ class uh {
8405
8424
  constructor(e) {
8406
8425
  this.client = e;
8407
8426
  }
@@ -8417,13 +8436,13 @@ class ch {
8417
8436
  ensureWorker() {
8418
8437
  if (this.worker)
8419
8438
  return this.worker;
8420
- const e = new ih();
8439
+ const e = new ah();
8421
8440
  return this.worker = e, e.addEventListener("message", (n) => {
8422
8441
  const r = n.data;
8423
8442
  if (r?.type === "error") {
8424
8443
  const s = r.error;
8425
- me.warn(`Video capture worker error: ${s?.name ?? "Error"} ${s?.message ?? ""}`);
8426
- } else r?.type === "log" ? me.info(r.message) : r?.type === "debug" && me.debug(r.message);
8444
+ Ee.warn(`Video capture worker error: ${s?.name ?? "Error"} ${s?.message ?? ""}`);
8445
+ } else r?.type === "log" ? Ee.info(r.message) : r?.type === "debug" && Ee.debug(r.message);
8427
8446
  }), e;
8428
8447
  }
8429
8448
  ensurePorts() {
@@ -8444,7 +8463,7 @@ class ch {
8444
8463
  async getMediaStream(e) {
8445
8464
  if (!navigator.mediaDevices)
8446
8465
  throw new Error("Media devices are not available in this environment");
8447
- const n = e.constraints ?? {}, r = e.options?.framerate ?? th;
8466
+ const n = e.constraints ?? {}, r = e.options?.framerate ?? rh;
8448
8467
  if (e.sourceType === "screen") {
8449
8468
  const a = {
8450
8469
  ...n,
@@ -8452,7 +8471,7 @@ class ch {
8452
8471
  };
8453
8472
  return navigator.mediaDevices.getDisplayMedia({ video: a, audio: !1 });
8454
8473
  }
8455
- const s = e.options?.width ?? Ee, i = e.options?.height ?? Ie, o = {
8474
+ const s = e.options?.width ?? Ie, i = e.options?.height ?? _e, o = {
8456
8475
  ...n,
8457
8476
  frameRate: n.frameRate ?? { ideal: r },
8458
8477
  width: n.width ?? { ideal: s },
@@ -8523,17 +8542,17 @@ class ch {
8523
8542
  if (this.client.isWebRtcEnabled && e.sourceType === "screen")
8524
8543
  return this.startScreenWebRtc(e);
8525
8544
  this.ensurePorts();
8526
- const r = oh(), s = await this.getMediaStream(e), i = s.getVideoTracks()[0];
8545
+ const r = ch(), s = await this.getMediaStream(e), i = s.getVideoTracks()[0];
8527
8546
  if (!i)
8528
8547
  throw s.getTracks().forEach((m) => m.stop()), new Error("No video track available");
8529
8548
  e.sourceType === "screen" && await new Promise((m) => setTimeout(m, 200));
8530
- const o = i.getSettings(), a = e.sourceType === "screen" ? o.width ?? Ee : e.options?.width ?? o.width ?? Ee, c = e.sourceType === "screen" ? o.height ?? Ie : e.options?.height ?? o.height ?? Ie, l = ah(), f = new l({ track: i }).readable, d = this.allocateTrackId(), p = this.ensureWorker(), T = e.sourceType, _ = e.onStopped;
8549
+ const o = i.getSettings(), a = e.sourceType === "screen" ? o.width ?? Ie : e.options?.width ?? o.width ?? Ie, c = e.sourceType === "screen" ? o.height ?? _e : e.options?.height ?? o.height ?? _e, l = lh(), f = new l({ track: i }).readable, d = this.allocateTrackId(), p = this.ensureWorker(), _ = e.sourceType, T = e.onStopped;
8531
8550
  p.postMessage(
8532
8551
  {
8533
8552
  type: "start",
8534
8553
  captureId: r,
8535
8554
  streamId: r,
8536
- sourceType: T,
8555
+ sourceType: _,
8537
8556
  kind: e.sourceType,
8538
8557
  senderId: n,
8539
8558
  trackId: d,
@@ -8564,9 +8583,9 @@ class ch {
8564
8583
  s.getTracks().forEach((m) => m.stop());
8565
8584
  } catch {
8566
8585
  }
8567
- if (p.postMessage({ type: "stop", captureId: r }), _)
8586
+ if (p.postMessage({ type: "stop", captureId: r }), T)
8568
8587
  try {
8569
- _();
8588
+ T();
8570
8589
  } catch {
8571
8590
  }
8572
8591
  }
@@ -8578,9 +8597,9 @@ class ch {
8578
8597
  if (u || k || C)
8579
8598
  try {
8580
8599
  const N = {};
8581
- m.width !== void 0 && (N.width = { ideal: m.width }), m.height !== void 0 && (N.height = { ideal: m.height }), m.framerate !== void 0 && (N.frameRate = { ideal: m.framerate }), await i.applyConstraints(N), me.info(`Camera track constraints updated: ${m.width}x${m.height}@${m.framerate}fps`);
8600
+ m.width !== void 0 && (N.width = { ideal: m.width }), m.height !== void 0 && (N.height = { ideal: m.height }), m.framerate !== void 0 && (N.frameRate = { ideal: m.framerate }), await i.applyConstraints(N), Ee.info(`Camera track constraints updated: ${m.width}x${m.height}@${m.framerate}fps`);
8582
8601
  } catch (N) {
8583
- me.warn(`Failed to apply camera constraints: ${N}`);
8602
+ Ee.warn(`Failed to apply camera constraints: ${N}`);
8584
8603
  }
8585
8604
  }
8586
8605
  I.currentOptions = m, p.postMessage({ type: "updateOptions", captureId: r, options: m });
@@ -8643,12 +8662,12 @@ class ch {
8643
8662
  this.protocolPort?.close(), this.protocolPort = null, this.sendPort?.close(), this.sendPort = null;
8644
8663
  }
8645
8664
  }
8646
- class lh {
8665
+ class dh {
8647
8666
  audio;
8648
8667
  video;
8649
8668
  image;
8650
8669
  constructor(e, n) {
8651
- this.audio = new eh(e, n?.audio), this.video = new ch(e), this.image = new sh();
8670
+ this.audio = new nh(e, n?.audio), this.video = new uh(e), this.image = new oh();
8652
8671
  }
8653
8672
  dispose() {
8654
8673
  this.audio.dispose(), this.video.dispose();
@@ -8656,22 +8675,22 @@ class lh {
8656
8675
  }
8657
8676
  const ms = M("DebugMode");
8658
8677
  let te = !1;
8659
- function uh() {
8678
+ function hh() {
8660
8679
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).get("debug") === "true";
8661
8680
  }
8662
- function dh() {
8663
- return te = uh(), te && (Zr(Ge.DEBUG), ms.warn("Debug mode enabled")), te;
8681
+ function fh() {
8682
+ return te = hh(), te && (Zr(Ge.DEBUG), ms.warn("Debug mode enabled")), te;
8664
8683
  }
8665
- function hh() {
8684
+ function ph() {
8666
8685
  return te;
8667
8686
  }
8668
- function fh() {
8687
+ function mh() {
8669
8688
  if (!te && (te = !0, Zr(Ge.DEBUG), ms.warn("Debug mode enabled"), typeof window < "u")) {
8670
8689
  const t = new URL(window.location.href);
8671
8690
  t.searchParams.get("debug") !== "true" && (t.searchParams.set("debug", "true"), window.history.replaceState(null, "", t.toString()));
8672
8691
  }
8673
8692
  }
8674
- function ph(t) {
8693
+ function Eh(t) {
8675
8694
  return new Worker(
8676
8695
  "" + new URL("assets/protocol-worker-DE8LDJVA.js", import.meta.url).href,
8677
8696
  {
@@ -8686,7 +8705,7 @@ const Yt = {
8686
8705
  [F.WebTransportProxy]: 2,
8687
8706
  [F.WebSocketProxy]: 3
8688
8707
  }, je = "ikon_endpoint_type";
8689
- class mh {
8708
+ class Ih {
8690
8709
  isLocal;
8691
8710
  workingEndpointType = null;
8692
8711
  constructor(e) {
@@ -8748,10 +8767,10 @@ class mh {
8748
8767
  }
8749
8768
  }
8750
8769
  const g = M("IkonClient");
8751
- function Eh() {
8770
+ function _h() {
8752
8771
  return typeof __IKON_WAIT_FOR_EXTERNAL_CONNECT_URL__ < "u" && __IKON_WAIT_FOR_EXTERNAL_CONNECT_URL__;
8753
8772
  }
8754
- class xh {
8773
+ class Wh {
8755
8774
  channelManager = null;
8756
8775
  protocolWorker = null;
8757
8776
  workerManagerState = null;
@@ -8795,7 +8814,7 @@ class xh {
8795
8814
  _webRtcVideoStream = null;
8796
8815
  _webRtcScreenStream = null;
8797
8816
  // External connect URL mode
8798
- _waitForExternalConnectUrl = Eh();
8817
+ _waitForExternalConnectUrl = _h();
8799
8818
  _externalConnectUrlCleanup = null;
8800
8819
  /**
8801
8820
  * SDK-provided media pipelines (audio/video).
@@ -8855,21 +8874,21 @@ class xh {
8855
8874
  throw new Error('IkonClient requires one of: "local", "apiKey", or "sessionToken" configuration');
8856
8875
  if (n > 1)
8857
8876
  throw new Error('IkonClient accepts only one of: "local", "apiKey", or "sessionToken" configuration');
8858
- Ke() && fu(), this.endpointSelector = new mh({
8877
+ Ke() && fu(), this.endpointSelector = new Ih({
8859
8878
  local: e.local
8860
- }), this._functionRegistry = new ud(), Ke() && !e.disableBrowserFunctions && (this.unregisterBrowserFunctions = $u(this._functionRegistry), this.unregisterSoundFunctions = yd(this._functionRegistry));
8879
+ }), this._functionRegistry = new hd(), Ke() && !e.disableBrowserFunctions && (this.unregisterBrowserFunctions = $u(this._functionRegistry), this.unregisterSoundFunctions = Rd(this._functionRegistry));
8861
8880
  const r = e.audio ? {
8862
8881
  performance: e.audio.performance,
8863
8882
  background: e.audio.background,
8864
8883
  diagnostics: e.audio.diagnostics
8865
8884
  } : void 0, s = e.video ? { performance: e.video.performance } : void 0;
8866
- this._media = new $d(this, { audio: r, video: s, mediaSession: e.mediaSession }), e.webRtc?.enabled || (this._media.audio.setEnabled(!0), this._media.video.setEnabled(!0)), Ke() && (this._mediaCapture = new lh(this, {
8885
+ this._media = new Yd(this, { audio: r, video: s, mediaSession: e.mediaSession }), e.webRtc?.enabled || (this._media.audio.setEnabled(!0), this._media.video.setEnabled(!0)), Ke() && (this._mediaCapture = new dh(this, {
8867
8886
  audio: {
8868
8887
  performance: {
8869
8888
  preferWebCodecs: e.audio?.performance?.preferWebCodecs
8870
8889
  }
8871
8890
  }
8872
- }), this.unregisterMediaCaptureFunctions = Ed(this._functionRegistry, this));
8891
+ }), this.unregisterMediaCaptureFunctions = _d(this._functionRegistry, this));
8873
8892
  }
8874
8893
  _lastError = void 0;
8875
8894
  /**
@@ -8914,9 +8933,9 @@ class xh {
8914
8933
  if (this.currentState !== "idle")
8915
8934
  throw new Error(`Cannot connect: already in state ${this.currentState}`);
8916
8935
  this.setupLifecycleHandlers();
8917
- const e = Xu();
8936
+ const e = Ju();
8918
8937
  if (e) {
8919
- g.info("Found external connect URL in query parameter"), await this.executeConnection(() => Se(e, this.abortController.signal));
8938
+ g.info("Found external connect URL in query parameter"), await this.executeConnection(() => ge(e, this.abortController.signal));
8920
8939
  return;
8921
8940
  }
8922
8941
  if (this._waitForExternalConnectUrl) {
@@ -9036,7 +9055,7 @@ class xh {
9036
9055
  s.start?.();
9037
9056
  const i = this.subscribeToProtocolMessages(
9038
9057
  (o) => {
9039
- const a = ie(o), c = o.slice().buffer;
9058
+ const a = oe(o), c = o.slice().buffer;
9040
9059
  s.postMessage({ type: "protocol", message: c, headers: a }, [c]);
9041
9060
  },
9042
9061
  { opcodeGroupsMask: e.opcodeGroupsMask }
@@ -9091,7 +9110,7 @@ class xh {
9091
9110
  if (!(!a || typeof a != "object") && !(a.type !== "send" || !(a.message instanceof ArrayBuffer)))
9092
9111
  try {
9093
9112
  const c = new Uint8Array(a.message);
9094
- if ((Ue(c) & e.opcodeGroupsMask) === 0)
9113
+ if ((Oe(c) & e.opcodeGroupsMask) === 0)
9095
9114
  return;
9096
9115
  this.channelManager?.sendProtocolMessage(c);
9097
9116
  } catch (c) {
@@ -9151,11 +9170,11 @@ class xh {
9151
9170
  async authenticate() {
9152
9171
  const e = this.abortController?.signal;
9153
9172
  if (this.config.local)
9154
- return nd(this.config.local, e);
9173
+ return sd(this.config.local, e);
9155
9174
  if (this.config.apiKey)
9156
- return rd(this.config.apiKey, e);
9175
+ return id(this.config.apiKey, e);
9157
9176
  if (this.config.sessionToken)
9158
- return sd(this.config.sessionToken, e);
9177
+ return od(this.config.sessionToken, e);
9159
9178
  throw new Error("No connection configuration provided (need local, apiKey, or sessionToken)");
9160
9179
  }
9161
9180
  /**
@@ -9164,13 +9183,13 @@ class xh {
9164
9183
  handleProtocolMessage(e) {
9165
9184
  if (this._webRtcSignaling?.handleProtocolMessage(e))
9166
9185
  return;
9167
- const n = _e(e), r = Ue(e);
9186
+ const n = Te(e), r = Oe(e);
9168
9187
  if (this._functionRegistry.handleProtocolMessage(e, n)) {
9169
9188
  this.notifyMessageSubscribers(e, n, r);
9170
9189
  return;
9171
9190
  }
9172
9191
  n === S.CORE_GLOBAL_STATE && cc(e).then((s) => {
9173
- this._globalState = s, this._sessionId !== void 0 && this._functionRegistry.syncFromGlobalState(s, this._sessionId), this._globalState.DebugMode && fh(), hh() && this.protocolWorker && this.protocolWorker.postMessage({ type: "enableDevtools", enabled: !0 }), this._globalStateReceived || (this._globalStateReceived = !0, this.tryHandleJoined());
9192
+ this._globalState = s, this._sessionId !== void 0 && this._functionRegistry.syncFromGlobalState(s, this._sessionId), this._globalState.DebugMode && mh(), ph() && this.protocolWorker && this.protocolWorker.postMessage({ type: "enableDevtools", enabled: !0 }), this._globalStateReceived || (this._globalStateReceived = !0, this.tryHandleJoined());
9174
9193
  }).catch((s) => {
9175
9194
  g.error("Failed to parse GlobalState:", s);
9176
9195
  }), this.notifyMessageSubscribers(e, n, r);
@@ -9194,10 +9213,10 @@ class xh {
9194
9213
  const c = i[a];
9195
9214
  try {
9196
9215
  if (c) {
9197
- if (c.opcodeGroupsMask !== void 0 && ((r ?? Ue(e)) & c.opcodeGroupsMask) === 0)
9216
+ if (c.opcodeGroupsMask !== void 0 && ((r ?? Oe(e)) & c.opcodeGroupsMask) === 0)
9198
9217
  continue;
9199
9218
  if (c.opcodes && c.opcodes.length > 0) {
9200
- const l = n ?? _e(e);
9219
+ const l = n ?? Te(e);
9201
9220
  if (!c.opcodes.includes(l))
9202
9221
  continue;
9203
9222
  }
@@ -9265,7 +9284,7 @@ class xh {
9265
9284
  }
9266
9285
  let n;
9267
9286
  try {
9268
- n = new ph();
9287
+ n = new Eh();
9269
9288
  } catch (h) {
9270
9289
  g.warn(`Failed to create protocol worker, falling back to main thread: ${h}`), await this.connectProtocolOnMainThread(e);
9271
9290
  return;
@@ -9273,30 +9292,30 @@ class xh {
9273
9292
  this.channelManager = null, this.protocolWorker = n, this.workerManagerState = "idle";
9274
9293
  const r = new Promise((h, f) => {
9275
9294
  const d = (p) => {
9276
- const T = p.data;
9277
- if (T?.type === "protocol" && T.message instanceof ArrayBuffer) {
9278
- const _ = new Uint8Array(T.message);
9279
- this.handleProtocolMessage(_);
9295
+ const _ = p.data;
9296
+ if (_?.type === "protocol" && _.message instanceof ArrayBuffer) {
9297
+ const T = new Uint8Array(_.message);
9298
+ this.handleProtocolMessage(T);
9280
9299
  return;
9281
9300
  }
9282
- if (T?.type === "state") {
9283
- const _ = T.state;
9284
- this.workerManagerState = _;
9285
- const I = T.activeType;
9286
- I !== void 0 && this.endpointSelector.rememberWorkingType(I), this.handleChannelManagerStateChange(_), _ === "connected" && h();
9301
+ if (_?.type === "state") {
9302
+ const T = _.state;
9303
+ this.workerManagerState = T;
9304
+ const I = _.activeType;
9305
+ I !== void 0 && this.endpointSelector.rememberWorkingType(I), this.handleChannelManagerStateChange(T), T === "connected" && h();
9287
9306
  return;
9288
9307
  }
9289
- if (T?.type === "error") {
9290
- const _ = T.error, I = new Error(String(_?.message ?? "Worker error"));
9291
- I.name = String(_?.name ?? "Error"), f(I);
9308
+ if (_?.type === "error") {
9309
+ const T = _.error, I = new Error(String(T?.message ?? "Worker error"));
9310
+ I.name = String(T?.name ?? "Error"), f(I);
9292
9311
  }
9293
9312
  };
9294
9313
  n.addEventListener("message", d), n.addEventListener("error", (p) => {
9295
- const T = [p.message, p.filename, p.lineno, p.colno].filter((_) => _ != null && String(_).length > 0);
9296
- f(new Error(`Protocol worker failed: ${T.join(" ")}`.trim()));
9314
+ const _ = [p.message, p.filename, p.lineno, p.colno].filter((T) => T != null && String(T).length > 0);
9315
+ f(new Error(`Protocol worker failed: ${_.join(" ")}`.trim()));
9297
9316
  });
9298
9317
  }), s = this.computeOrderedEndpointTypes(e), i = this.config.timeouts?.keepaliveTimeoutMs ?? Ot, o = this.config.timeouts?.reconnectBackoffMs ?? Mt, a = this.config.timeouts?.maxReconnectAttempts ?? Lt;
9299
- this.updateWorkerInterestMask(), dh() && n.postMessage({ type: "enableDevtools", enabled: !0 });
9318
+ this.updateWorkerInterestMask(), fh() && n.postMessage({ type: "enableDevtools", enabled: !0 });
9300
9319
  const l = this.config.webRtc?.enabled ?? !1;
9301
9320
  n.postMessage({
9302
9321
  type: "connect",
@@ -9566,148 +9585,148 @@ class xh {
9566
9585
  throw new Error(`Cannot connect with external connect URL: already in state ${this.currentState}`);
9567
9586
  g.info("Connecting with external connect URL");
9568
9587
  try {
9569
- await this.executeConnection(() => Se(e, this.abortController.signal));
9588
+ await this.executeConnection(() => ge(e, this.abortController.signal));
9570
9589
  } finally {
9571
9590
  this._externalConnectUrlCleanup && (this._externalConnectUrlCleanup(), this._externalConnectUrlCleanup = null);
9572
9591
  }
9573
9592
  }
9574
9593
  }
9575
- function Wh(t) {
9594
+ function Gh(t) {
9576
9595
  return t === "waitingForExternalConnectUrl" || t === "connecting" || t === "connectingSlow" || t === "reconnecting";
9577
9596
  }
9578
- function Gh(t) {
9597
+ function Vh(t) {
9579
9598
  return t === "connected";
9580
9599
  }
9581
- function Vh(t) {
9600
+ function Hh(t) {
9582
9601
  return t === "offline" || t === "offlineError" || t === "idle";
9583
9602
  }
9584
- function Hh(t) {
9603
+ function $h(t) {
9585
9604
  return t === "offlineError";
9586
9605
  }
9587
9606
  const Es = /* @__PURE__ */ new Map();
9588
9607
  for (const [t, e] of Object.entries(S))
9589
9608
  typeof e == "number" && Es.set(e, t);
9590
- function $h(t) {
9609
+ function Kh(t) {
9591
9610
  return Es.get(t) ?? `UNKNOWN_${t}`;
9592
9611
  }
9593
9612
  const Is = 1e3, _s = Ge.INFO;
9594
9613
  let V = [], it = Is, Ts = _s, ot = null;
9595
- function Ih(t) {
9614
+ function Th(t) {
9596
9615
  t.level < Ts || (V.push(t), V.length > it && (V = V.slice(-it)));
9597
9616
  }
9598
- function _h(t) {
9599
- it = t?.maxBufferSize ?? Is, Ts = t?.minLevel ?? _s, V = [], Kl(Ih);
9617
+ function wh(t) {
9618
+ it = t?.maxBufferSize ?? Is, Ts = t?.minLevel ?? _s, V = [], Kl(Th);
9600
9619
  }
9601
- function Kh(t) {
9620
+ function Yh(t) {
9602
9621
  ot = t;
9603
9622
  }
9604
- function Yh() {
9623
+ function jh() {
9605
9624
  return V;
9606
9625
  }
9607
- function Th() {
9626
+ function Sh() {
9608
9627
  const t = V;
9609
9628
  return V = [], t;
9610
9629
  }
9611
- function jh() {
9630
+ function zh() {
9612
9631
  if (!ot || V.length === 0)
9613
9632
  return 0;
9614
- const t = Th();
9633
+ const t = Sh();
9615
9634
  return ot(t), t.length;
9616
9635
  }
9617
- function zh() {
9636
+ function Xh() {
9618
9637
  V = [];
9619
9638
  }
9620
- function Xh() {
9639
+ function Jh() {
9621
9640
  return V.length;
9622
9641
  }
9623
- _h();
9642
+ wh();
9624
9643
  export {
9625
9644
  D as AuthenticationError,
9626
9645
  Zl as Channel,
9627
9646
  ql as ChannelManager,
9628
- Sh as ChannelNotFoundError,
9647
+ Ch as ChannelNotFoundError,
9629
9648
  ee as ClientType,
9630
9649
  It as ConnectionError,
9631
- ae as ContextType,
9632
- mh as EndpointSelector,
9650
+ ce as ContextType,
9651
+ Ih as EndpointSelector,
9633
9652
  F as EntrypointType,
9634
- cd as FunctionCallError,
9635
- ud as FunctionRegistry,
9636
- Mh as IKON_AUTH_BASE_URL,
9653
+ ud as FunctionCallError,
9654
+ hd as FunctionRegistry,
9655
+ Fh as IKON_AUTH_BASE_URL,
9637
9656
  Bt as IKON_AUTH_URL_DEV,
9638
9657
  Pt as IKON_AUTH_URL_PROD,
9639
9658
  nt as IKON_BACKEND_URL_DEV,
9640
9659
  tt as IKON_BACKEND_URL_PROD,
9641
- eh as IkonAudioCapture,
9660
+ nh as IkonAudioCapture,
9642
9661
  At as IkonAudioPlayback,
9643
- xh as IkonClient,
9644
- sh as IkonImageCapture,
9645
- $d as IkonMedia,
9646
- lh as IkonMediaCapture,
9647
- ch as IkonVideoCapture,
9648
- Hd as IkonVideoPlayback,
9662
+ Wh as IkonClient,
9663
+ oh as IkonImageCapture,
9664
+ Yd as IkonMedia,
9665
+ dh as IkonMediaCapture,
9666
+ uh as IkonVideoCapture,
9667
+ Kd as IkonVideoPlayback,
9649
9668
  _t as KeepaliveTimeoutError,
9650
9669
  Ge as LogLevel,
9651
9670
  Hl as MaxRetriesExceededError,
9652
- Ch as NoChannelsError,
9671
+ Ah as NoChannelsError,
9653
9672
  S as Opcode,
9654
9673
  $l as ProvisioningTimeoutError,
9655
- gh as SpaceNotFoundError,
9674
+ yh as SpaceNotFoundError,
9656
9675
  Z as TransportError,
9657
- le as UserType,
9658
- Dh as WEBRTC_AUDIO_BITRATE,
9659
- kh as WEBRTC_AUDIO_CHANNELS,
9660
- bh as WEBRTC_AUDIO_CODEC,
9676
+ ue as UserType,
9677
+ Uh as WEBRTC_AUDIO_BITRATE,
9678
+ vh as WEBRTC_AUDIO_CHANNELS,
9679
+ kh as WEBRTC_AUDIO_CODEC,
9661
9680
  eu as WEBRTC_AUDIO_JITTER_BUFFER_TARGET_MS,
9662
- Nh as WEBRTC_AUDIO_SAMPLE_RATE,
9681
+ Dh as WEBRTC_AUDIO_SAMPLE_RATE,
9663
9682
  nu as WEBRTC_BUNDLE_POLICY,
9664
9683
  iu as WEBRTC_DATA_CHANNEL_LABEL,
9665
9684
  au as WEBRTC_DATA_CHANNEL_MAX_RETRANSMITS,
9666
9685
  ou as WEBRTC_DATA_CHANNEL_ORDERED,
9667
9686
  su as WEBRTC_ICE_SERVERS,
9668
9687
  ru as WEBRTC_RTCP_MUX_POLICY,
9669
- vh as WEBRTC_VIDEO_CODEC,
9688
+ Oh as WEBRTC_VIDEO_CODEC,
9670
9689
  tu as WEBRTC_VIDEO_MAX_BITRATE,
9671
- Uh as WEBRTC_VIDEO_MAX_FRAMERATE,
9690
+ Mh as WEBRTC_VIDEO_MAX_FRAMERATE,
9672
9691
  cu as WebRTCConnection,
9673
9692
  lu as WebRTCSignaling,
9674
- wh as asProtocolMessage,
9675
- Oh as clearDeviceId,
9676
- zh as clearLogBuffer,
9677
- Bh as clearSessionParamsFromUrl,
9693
+ gh as asProtocolMessage,
9694
+ Lh as clearDeviceId,
9695
+ Xh as clearLogBuffer,
9696
+ xh as clearSessionParamsFromUrl,
9678
9697
  M as createLogger,
9679
- Yu as deriveAuthUrl,
9680
- Fh as deriveBackendType,
9681
- Lh as deriveBackendUrl,
9698
+ ju as deriveAuthUrl,
9699
+ Ph as deriveBackendType,
9700
+ Yu as deriveBackendUrl,
9682
9701
  Ku as extractUserIdFromToken,
9683
- jh as flushLogs,
9684
- Yh as getBufferedLogs,
9685
- Xh as getLogBufferSize,
9686
- yh as getLogLevel,
9687
- Ah as getLogSink,
9688
- $h as getOpcodeName,
9702
+ zh as flushLogs,
9703
+ jh as getBufferedLogs,
9704
+ Jh as getLogBufferSize,
9705
+ Rh as getLogLevel,
9706
+ bh as getLogSink,
9707
+ Kh as getOpcodeName,
9689
9708
  He as getOrCreateDeviceId,
9690
- dh as initializeDebugMode,
9691
- _h as initializeLogSink,
9709
+ fh as initializeDebugMode,
9710
+ wh as initializeLogSink,
9692
9711
  ls as isAudioWorkletSupported,
9693
9712
  Ke as isBrowserEnvironment,
9694
9713
  yt as isCloudEnvironment,
9695
- Gh as isConnected,
9696
- Wh as isConnecting,
9697
- hh as isDebugModeEnabled,
9698
- Hh as isError,
9699
- Vh as isOffline,
9700
- Oe as isSharedArrayBufferSupported,
9714
+ Vh as isConnected,
9715
+ Gh as isConnecting,
9716
+ ph as isDebugModeEnabled,
9717
+ $h as isError,
9718
+ Hh as isOffline,
9719
+ Me as isSharedArrayBufferSupported,
9701
9720
  qr as isWebTransportSupported,
9702
- Ph as parseUrlParams,
9703
- _e as readOpcode,
9704
- Ue as readOpcodeGroup,
9705
- ie as readProtocolMessageHeaders,
9721
+ Bh as parseUrlParams,
9722
+ Te as readOpcode,
9723
+ Oe as readOpcodeGroup,
9724
+ oe as readProtocolMessageHeaders,
9706
9725
  $u as registerBrowserFunctions,
9707
9726
  Zr as setLogLevel,
9708
9727
  Kl as setLogSink,
9709
- Kh as setSendLogsCallback,
9710
- Rh as subscribeToLogEvents,
9711
- Th as takeBufferedLogs,
9712
- ad as withResultData
9728
+ Yh as setSendLogsCallback,
9729
+ Nh as subscribeToLogEvents,
9730
+ Sh as takeBufferedLogs,
9731
+ ld as withResultData
9713
9732
  };