@vanira/sdk 0.0.88 → 0.0.91

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.
@@ -81,7 +81,7 @@ class pd {
81
81
  };
82
82
  }
83
83
  }
84
- const js = "https://api.vanira.io", N = {
84
+ const js = "https://api.vanira.io", x = {
85
85
  Form: "vanira_form",
86
86
  Calendar: "vanira_calendar",
87
87
  Navigate: "vanira_navigate",
@@ -108,7 +108,20 @@ const js = "https://api.vanira.io", N = {
108
108
  KycDocumentCapture: "vanira_kyc_document_capture",
109
109
  KycSelfieCapture: "vanira_kyc_selfie_capture",
110
110
  KycSignatureCapture: "vanira_kyc_signature_capture"
111
- }, fd = Object.values(N), md = new Set(fd);
111
+ }, fd = Object.values(x), md = new Set(fd), gd = /* @__PURE__ */ new Set([
112
+ x.KycDocumentCapture,
113
+ x.KycSelfieCapture,
114
+ x.KycSignatureCapture
115
+ ]);
116
+ [
117
+ ...gd,
118
+ x.Form,
119
+ x.Upload,
120
+ x.Camera,
121
+ x.ClipRegion,
122
+ x.ScreenVision,
123
+ x.Navigate
124
+ ];
112
125
  function Sr(i) {
113
126
  return !!i && md.has(i);
114
127
  }
@@ -122,67 +135,67 @@ function Ya(i) {
122
135
  return i && typeof i == "object" ? i : {};
123
136
  }
124
137
  const Cr = {
125
- type_on_whiteboard: N.TypeText,
126
- write_on_whiteboard: N.TypeText,
127
- write_on_white_board: N.TypeText,
128
- dom_typing_simulation: N.TypeText,
129
- write_latex_text: N.WriteLatexText,
130
- write_latex_on_board: N.WriteLatexText,
131
- latex_on_whiteboard: N.WriteLatexText,
132
- show_geogebra: N.GeoGebra,
133
- geogebra_diagram: N.GeoGebra,
134
- geogebra: N.GeoGebra,
135
- erase_text: N.EraseText,
136
- dom_erase: N.EraseText,
137
- open_live_camera: N.LiveVision,
138
- live_vision: N.LiveVision,
139
- close_live_camera: N.CloseLiveCamera,
140
- stop_live_camera: N.CloseLiveCamera,
141
- open_live_screen: N.LiveScreen,
142
- close_live_screen: N.CloseLiveScreen,
143
- screen_vision: N.ScreenVision,
144
- capture_screen_vision: N.ScreenVision,
145
- capture_screen: N.ScreenVision,
146
- tab_screenshot: N.ScreenVision,
147
- capture_tab: N.ScreenVision,
148
- capture_tab_screenshot: N.ScreenVision,
149
- screenshot_tab: N.ScreenVision,
150
- point_at: N.PointAt,
151
- point_at_screen: N.PointAt,
152
- draw_on_screen: N.DrawOnScreen,
153
- screen_draw: N.DrawOnScreen,
154
- clear_screen_draw: N.ClearScreenDraw,
155
- clear_screen_annotations: N.ClearScreenDraw,
156
- highlight_on_screen: N.HighlightOnScreen,
157
- highlight_element_on_screen: N.HighlightOnScreen,
158
- highlight_screen_element: N.HighlightOnScreen,
159
- kyc_document_capture: N.KycDocumentCapture,
160
- capture_id_document: N.KycDocumentCapture,
161
- document_capture: N.KycDocumentCapture,
162
- capture_kyc_document: N.KycDocumentCapture,
163
- kyc_selfie_capture: N.KycSelfieCapture,
164
- capture_selfie: N.KycSelfieCapture,
165
- selfie_capture: N.KycSelfieCapture,
166
- capture_kyc_selfie: N.KycSelfieCapture,
167
- kyc_signature_capture: N.KycSignatureCapture,
168
- capture_kyc_signature: N.KycSignatureCapture,
169
- signature_capture: N.KycSignatureCapture
138
+ type_on_whiteboard: x.TypeText,
139
+ write_on_whiteboard: x.TypeText,
140
+ write_on_white_board: x.TypeText,
141
+ dom_typing_simulation: x.TypeText,
142
+ write_latex_text: x.WriteLatexText,
143
+ write_latex_on_board: x.WriteLatexText,
144
+ latex_on_whiteboard: x.WriteLatexText,
145
+ show_geogebra: x.GeoGebra,
146
+ geogebra_diagram: x.GeoGebra,
147
+ geogebra: x.GeoGebra,
148
+ erase_text: x.EraseText,
149
+ dom_erase: x.EraseText,
150
+ open_live_camera: x.LiveVision,
151
+ live_vision: x.LiveVision,
152
+ close_live_camera: x.CloseLiveCamera,
153
+ stop_live_camera: x.CloseLiveCamera,
154
+ open_live_screen: x.LiveScreen,
155
+ close_live_screen: x.CloseLiveScreen,
156
+ screen_vision: x.ScreenVision,
157
+ capture_screen_vision: x.ScreenVision,
158
+ capture_screen: x.ScreenVision,
159
+ tab_screenshot: x.ScreenVision,
160
+ capture_tab: x.ScreenVision,
161
+ capture_tab_screenshot: x.ScreenVision,
162
+ screenshot_tab: x.ScreenVision,
163
+ point_at: x.PointAt,
164
+ point_at_screen: x.PointAt,
165
+ draw_on_screen: x.DrawOnScreen,
166
+ screen_draw: x.DrawOnScreen,
167
+ clear_screen_draw: x.ClearScreenDraw,
168
+ clear_screen_annotations: x.ClearScreenDraw,
169
+ highlight_on_screen: x.HighlightOnScreen,
170
+ highlight_element_on_screen: x.HighlightOnScreen,
171
+ highlight_screen_element: x.HighlightOnScreen,
172
+ kyc_document_capture: x.KycDocumentCapture,
173
+ capture_id_document: x.KycDocumentCapture,
174
+ document_capture: x.KycDocumentCapture,
175
+ capture_kyc_document: x.KycDocumentCapture,
176
+ kyc_selfie_capture: x.KycSelfieCapture,
177
+ capture_selfie: x.KycSelfieCapture,
178
+ selfie_capture: x.KycSelfieCapture,
179
+ capture_kyc_selfie: x.KycSelfieCapture,
180
+ kyc_signature_capture: x.KycSignatureCapture,
181
+ capture_kyc_signature: x.KycSignatureCapture,
182
+ signature_capture: x.KycSignatureCapture
170
183
  }, _r = {
171
- vanira_tab_screenshot: N.ScreenVision,
172
- vanira_document_capture: N.KycDocumentCapture,
173
- vanira_selfie_capture: N.KycSelfieCapture,
174
- vanira_signature_capture: N.KycSignatureCapture,
175
- vanira_kyc_signature: N.KycSignatureCapture
184
+ vanira_tab_screenshot: x.ScreenVision,
185
+ vanira_document_capture: x.KycDocumentCapture,
186
+ vanira_selfie_capture: x.KycSelfieCapture,
187
+ vanira_signature_capture: x.KycSignatureCapture,
188
+ vanira_kyc_signature: x.KycSignatureCapture
176
189
  };
177
- function gd(i, e) {
190
+ function vd(i, e) {
178
191
  const t = i.commands ?? (e == null ? void 0 : e.commands) ?? i.construction ?? (e == null ? void 0 : e.construction) ?? i.geogebra_commands ?? (e == null ? void 0 : e.geogebra_commands) ?? i.script ?? (e == null ? void 0 : e.script);
179
192
  return Array.isArray(t) ? t.some((n) => String(n).trim().length > 0) : typeof t == "string" && t.trim().length > 0;
180
193
  }
181
- function vd(i, e) {
194
+ function bd(i, e) {
182
195
  const t = i.material_id ?? (e == null ? void 0 : e.material_id) ?? i.materialId ?? (e == null ? void 0 : e.materialId);
183
196
  return typeof t == "string" && t.trim().length > 0;
184
197
  }
185
- function bd(i, e) {
198
+ function yd(i, e) {
186
199
  const t = i.latex_text ?? (e == null ? void 0 : e.latex_text);
187
200
  return typeof t == "string" && t.trim().length > 0;
188
201
  }
@@ -190,11 +203,11 @@ function wr(i, e) {
190
203
  const t = i.text_to_type ?? (e == null ? void 0 : e.text_to_type) ?? i.text ?? (e == null ? void 0 : e.text) ?? i.value ?? (e == null ? void 0 : e.value);
191
204
  return typeof t == "string" && t.trim().length > 0;
192
205
  }
193
- function yd(i, e) {
206
+ function kd(i, e) {
194
207
  const t = i.fields ?? (e == null ? void 0 : e.fields);
195
208
  return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.split(",").map((n) => n.trim()).filter(Boolean).length > 0 : !1;
196
209
  }
197
- function kd(i, e) {
210
+ function Td(i, e) {
198
211
  const t = i == null ? void 0 : i.preset_id;
199
212
  if (typeof t == "string") {
200
213
  if (Sr(t)) return t;
@@ -208,21 +221,21 @@ function kd(i, e) {
208
221
  if (r) return r;
209
222
  }
210
223
  }
211
- function Td(i, e, t) {
224
+ function Sd(i, e, t) {
212
225
  const n = Ya(e);
213
- let s = kd(i, n);
214
- if (s === N.Form && wr(n, i) && !yd(n, i))
215
- return N.TypeText;
226
+ let s = Td(i, n);
227
+ if (s === x.Form && wr(n, i) && !kd(n, i))
228
+ return x.TypeText;
216
229
  if (s) return s;
217
230
  const r = String(t ?? "").trim().toLowerCase();
218
231
  if (r && Cr[r])
219
232
  return Cr[r];
220
- if (gd(n, i) || vd(n, i))
221
- return N.GeoGebra;
222
- if (bd(n, i))
223
- return N.WriteLatexText;
233
+ if (vd(n, i) || bd(n, i))
234
+ return x.GeoGebra;
235
+ if (yd(n, i))
236
+ return x.WriteLatexText;
224
237
  if (wr(n, i))
225
- return N.TypeText;
238
+ return x.TypeText;
226
239
  }
227
240
  const Zn = "vanira_latest_call_id", us = "vanira_prospect_id";
228
241
  function ei(i) {
@@ -272,7 +285,7 @@ function Er(i) {
272
285
  1
273
286
  ), n(ht(window.localStorage, Zn), a, 0), n(ht(window.sessionStorage, Zn), a, 0), e.length ? (e.sort((o, d) => d.updatedAt - o.updatedAt), e[0]) : null;
274
287
  }
275
- function Sd(i, e, t) {
288
+ function Cd(i, e, t) {
276
289
  var s, r, a, o, d, c, l, u, h;
277
290
  if (typeof window > "u" || !i || !e) return;
278
291
  const n = {
@@ -285,17 +298,17 @@ function Sd(i, e, t) {
285
298
  } catch {
286
299
  }
287
300
  }
288
- const ji = 16 * 1024, Cd = 256 * 1024;
301
+ const ji = 16 * 1024, _d = 256 * 1024;
289
302
  function Wi(i, e) {
290
303
  return (i == null ? void 0 : i.readyState) === "open" && (e == null ? void 0 : e.readyState) === "open";
291
304
  }
292
- function _d(i, e) {
305
+ function wd(i, e) {
293
306
  return {
294
307
  control: (i == null ? void 0 : i.readyState) ?? "missing",
295
308
  mediaBytes: (e == null ? void 0 : e.readyState) ?? "missing"
296
309
  };
297
310
  }
298
- async function wd(i, e, t = 8e3) {
311
+ async function Ed(i, e, t = 8e3) {
299
312
  if (Wi(i, e))
300
313
  return !0;
301
314
  const n = Date.now() + t;
@@ -307,10 +320,10 @@ async function wd(i, e, t = 8e3) {
307
320
  return Wi(i, e);
308
321
  }
309
322
  async function Pr(i) {
310
- for (; i.bufferedAmount > Cd; )
323
+ for (; i.bufferedAmount > _d; )
311
324
  await new Promise((e) => setTimeout(e, 10));
312
325
  }
313
- async function Ed(i) {
326
+ async function Pd(i) {
314
327
  const {
315
328
  bytes: e,
316
329
  filename: t,
@@ -353,14 +366,14 @@ async function Ed(i) {
353
366
  }
354
367
  }), { media_id: c, url: "", content_type: n };
355
368
  }
356
- async function Pd(i) {
369
+ async function Rd(i) {
357
370
  return typeof i.arrayBuffer == "function" ? i.arrayBuffer() : new Response(i).arrayBuffer();
358
371
  }
359
- const Rd = 15e3, hs = "vanira-connect-stall-prompt";
372
+ const Id = 15e3, hs = "vanira-connect-stall-prompt";
360
373
  let gn = null;
361
- function Id(i = Rd) {
374
+ function Md(i = Id) {
362
375
  typeof window > "u" || (pn(!1), gn = setTimeout(() => {
363
- gn = null, Md(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
376
+ gn = null, Dd(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
364
377
  }, i));
365
378
  }
366
379
  function pn(i = !0) {
@@ -370,7 +383,7 @@ function ps() {
370
383
  var i;
371
384
  typeof document > "u" || (i = document.getElementById(hs)) == null || i.remove();
372
385
  }
373
- function Md() {
386
+ function Dd() {
374
387
  var t, n;
375
388
  if (typeof document > "u" || document.getElementById(hs)) return;
376
389
  const i = document.createElement("div");
@@ -414,13 +427,13 @@ function Md() {
414
427
  ps(), window.location.reload();
415
428
  }), (n = e.querySelector("#vanira-stall-dismiss")) == null || n.addEventListener("click", () => ps());
416
429
  }
417
- function Dd(i) {
430
+ function Ad(i) {
418
431
  return null;
419
432
  }
420
433
  function Ln() {
421
434
  return typeof window > "u" ? "/" : `${window.location.pathname}${window.location.search}${window.location.hash}` || "/";
422
435
  }
423
- class Ad {
436
+ class Od {
424
437
  constructor(e) {
425
438
  D(this, "active", !1);
426
439
  D(this, "initialSent", !1);
@@ -501,7 +514,7 @@ class Ad {
501
514
  this.scheduleInitialContextSend();
502
515
  return;
503
516
  }
504
- !this.isReady() || Dd() || this.sendRouteContext("route_changed", n, t, "user");
517
+ !this.isReady() || Ad() || this.sendRouteContext("route_changed", n, t, "user");
505
518
  }
506
519
  sendRouteContext(e, t, n, s = "user") {
507
520
  const r = Ln();
@@ -621,7 +634,7 @@ const st = class st {
621
634
  client_fields: l.client_fields || {}
622
635
  };
623
636
  u.name && u.tool_call_id && this.emit("tool_call", u);
624
- }, this.runtime = e.runtime, typeof window < "u" && e.trackRouteContext !== !1 && (this.routeTracker = new Ad({
637
+ }, this.runtime = e.runtime, typeof window < "u" && e.trackRouteContext !== !1 && (this.routeTracker = new Od({
625
638
  sendContext: (c) => this.sendContextUpdate(c),
626
639
  isReady: () => {
627
640
  var c;
@@ -647,7 +660,7 @@ const st = class st {
647
660
  */
648
661
  async connect() {
649
662
  var t;
650
- this._status = "connecting", this.connectStallTimeoutMs > 0 && Id(this.connectStallTimeoutMs);
663
+ this._status = "connecting", this.connectStallTimeoutMs > 0 && Md(this.connectStallTimeoutMs);
651
664
  const e = ++this.connectGeneration;
652
665
  if (await this.loadCallSession(), !this.isConnectCancelled(e)) {
653
666
  if (!this.serverUrl)
@@ -736,8 +749,8 @@ const st = class st {
736
749
  }, this.onRemoteTrack(h, p)) : h.kind === "video" && this.onRemoteTrack(h, p);
737
750
  };
738
751
  const r = () => {
739
- var p, g, m, T, k, S, L, v, y, C, I;
740
- const u = ((p = this.pc) == null ? void 0 : p.connectionState) === "connected" || ((g = this.pc) == null ? void 0 : g.iceConnectionState) === "connected" || ((m = this.pc) == null ? void 0 : m.iceConnectionState) === "completed", h = ((T = this.pc) == null ? void 0 : T.connectionState) === "failed" || ((k = this.pc) == null ? void 0 : k.iceConnectionState) === "failed" || ((S = this.pc) == null ? void 0 : S.connectionState) === "closed" || ((L = this.pc) == null ? void 0 : L.iceConnectionState) === "closed" || ((v = this.pc) == null ? void 0 : v.connectionState) === "disconnected" || ((y = this.pc) == null ? void 0 : y.iceConnectionState) === "disconnected";
752
+ var p, g, m, T, k, S, N, v, y, C, I;
753
+ const u = ((p = this.pc) == null ? void 0 : p.connectionState) === "connected" || ((g = this.pc) == null ? void 0 : g.iceConnectionState) === "connected" || ((m = this.pc) == null ? void 0 : m.iceConnectionState) === "completed", h = ((T = this.pc) == null ? void 0 : T.connectionState) === "failed" || ((k = this.pc) == null ? void 0 : k.iceConnectionState) === "failed" || ((S = this.pc) == null ? void 0 : S.connectionState) === "closed" || ((N = this.pc) == null ? void 0 : N.iceConnectionState) === "closed" || ((v = this.pc) == null ? void 0 : v.connectionState) === "disconnected" || ((y = this.pc) == null ? void 0 : y.iceConnectionState) === "disconnected";
741
754
  ((C = this.pc) == null ? void 0 : C.connectionState) === "connected" && this.stopRemoteIcePolling(), u && !this.connected ? (this.connected = !0, (I = this.routeTracker) == null || I.start(), this.onConnected()) : h && this.connected && (this.connected = !1, this.liveVisionAutoStarted = !1, this.onDisconnected());
742
755
  };
743
756
  this.pc.onconnectionstatechange = r, this.pc.oniceconnectionstatechange = r;
@@ -816,7 +829,7 @@ const st = class st {
816
829
  };
817
830
  }
818
831
  applyCreateCallSession(e) {
819
- if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, Sd(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
832
+ if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, Cd(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
820
833
  try {
821
834
  this.onSessionStarted({ prospectId: this.prospectId, callId: this.callId, serverUrl: this.serverUrl }), this.sessionStartedEmitted = !0;
822
835
  } catch {
@@ -980,7 +993,7 @@ const st = class st {
980
993
  name: "open_live_camera",
981
994
  tool_call_id: `lv_${crypto.randomUUID()}`,
982
995
  execution_mode: "fire_and_forget",
983
- client_fields: { preset_id: N.LiveVision },
996
+ client_fields: { preset_id: x.LiveVision },
984
997
  arguments: {
985
998
  mode: "live",
986
999
  scope: t,
@@ -1008,7 +1021,7 @@ const st = class st {
1008
1021
  this.dispatchBoardAbort(
1009
1022
  "User interrupted while LaTeX was writing",
1010
1023
  void 0,
1011
- N.WriteLatexText
1024
+ x.WriteLatexText
1012
1025
  );
1013
1026
  break;
1014
1027
  case "transcription":
@@ -1032,7 +1045,7 @@ const st = class st {
1032
1045
  event: "client_tool_ack",
1033
1046
  data: { tool_call_id: s }
1034
1047
  }));
1035
- const r = (n == null ? void 0 : n.arguments) || (n == null ? void 0 : n.args) || {}, a = (n == null ? void 0 : n.client_fields) || {}, o = (n == null ? void 0 : n.name) || (n == null ? void 0 : n.tool_name) || "", d = Td(a, r, o);
1048
+ const r = (n == null ? void 0 : n.arguments) || (n == null ? void 0 : n.args) || {}, a = (n == null ? void 0 : n.client_fields) || {}, o = (n == null ? void 0 : n.name) || (n == null ? void 0 : n.tool_name) || "", d = Sd(a, r, o);
1036
1049
  if (o === "end_call") {
1037
1050
  s && this.sendToolResult(s, {
1038
1051
  status: "client_ack_end_call",
@@ -1180,7 +1193,7 @@ const st = class st {
1180
1193
  * @param message Optional user text message about the file
1181
1194
  */
1182
1195
  async uploadMedia(e, t = "general", n = "") {
1183
- return await wd(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, n) : (_d(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, n));
1196
+ return await Ed(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, n) : (wd(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, n));
1184
1197
  }
1185
1198
  /**
1186
1199
  * Upload a live vision / screen frame — HTTP only for now, never sends client_media_update.
@@ -1199,8 +1212,8 @@ const st = class st {
1199
1212
  async _uploadBytesViaDataChannel(e, t, n, s, r) {
1200
1213
  if (!this.callId || !this.mediaBytesChannel)
1201
1214
  throw new Error("Upload failed: call not ready for WebRTC media upload.");
1202
- const a = r || (e instanceof File ? e.name : s === "frame" ? "frame.jpg" : "upload.bin"), o = e.type || (s === "frame" ? "image/jpeg" : "application/octet-stream"), d = await Pd(e);
1203
- return Ed({
1215
+ const a = r || (e instanceof File ? e.name : s === "frame" ? "frame.jpg" : "upload.bin"), o = e.type || (s === "frame" ? "image/jpeg" : "application/octet-stream"), d = await Rd(e);
1216
+ return Pd({
1204
1217
  bytes: d,
1205
1218
  filename: a,
1206
1219
  contentType: o,
@@ -1305,7 +1318,7 @@ const st = class st {
1305
1318
  D(st, "inflightCreates", /* @__PURE__ */ new Map());
1306
1319
  let fs = st;
1307
1320
  var Ja;
1308
- const Od = {
1321
+ const xd = {
1309
1322
  supportsAudioEndedEvent: !0,
1310
1323
  supportsScreenShare: typeof navigator < "u" && typeof ((Ja = navigator.mediaDevices) == null ? void 0 : Ja.getDisplayMedia) == "function",
1311
1324
  supportsDom: typeof document < "u",
@@ -1313,25 +1326,25 @@ const Od = {
1313
1326
  supportsCustomElements: typeof customElements < "u",
1314
1327
  supportsLocalStorage: typeof localStorage < "u",
1315
1328
  supportsBroadcastChannel: typeof BroadcastChannel < "u"
1316
- }, xd = {
1329
+ }, Ld = {
1317
1330
  name: "browser",
1318
1331
  callType: "web",
1319
1332
  runtimeName: "browser",
1320
1333
  callIdPrefix: "web_",
1321
- capabilities: Od,
1334
+ capabilities: xd,
1322
1335
  audio: new dd(),
1323
1336
  media: new ld(),
1324
1337
  peer: new ud(),
1325
1338
  dataChannel: new pd()
1326
1339
  };
1327
- function Ld(i) {
1340
+ function Nd(i) {
1328
1341
  return new fs({
1329
1342
  ...i,
1330
- runtime: xd
1343
+ runtime: Ld
1331
1344
  });
1332
1345
  }
1333
- const jf = Ld;
1334
- function Nd(i, e) {
1346
+ const Wf = Nd;
1347
+ function Ud(i, e) {
1335
1348
  return e.forEach(function(t) {
1336
1349
  t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(n) {
1337
1350
  if (n !== "default" && !(n in i)) {
@@ -1343,12 +1356,12 @@ function Nd(i, e) {
1343
1356
  });
1344
1357
  }), Object.freeze(i);
1345
1358
  }
1346
- var Ud = Object.defineProperty, Fd = (i, e, t) => e in i ? Ud(i, e, {
1359
+ var Fd = Object.defineProperty, Bd = (i, e, t) => e in i ? Fd(i, e, {
1347
1360
  enumerable: !0,
1348
1361
  configurable: !0,
1349
1362
  writable: !0,
1350
1363
  value: t
1351
- }) : i[e] = t, Rr = (i, e, t) => Fd(i, typeof e != "symbol" ? e + "" : e, t);
1364
+ }) : i[e] = t, Rr = (i, e, t) => Bd(i, typeof e != "symbol" ? e + "" : e, t);
1352
1365
  class ge {
1353
1366
  constructor() {
1354
1367
  Rr(this, "_locking"), Rr(this, "_locks"), this._locking = Promise.resolve(), this._locks = 0;
@@ -1369,22 +1382,22 @@ function se(i, e) {
1369
1382
  if (!i)
1370
1383
  throw new Error(e);
1371
1384
  }
1372
- const Bd = 34028234663852886e22, Vd = -34028234663852886e22, qd = 4294967295, jd = 2147483647, Wd = -2147483648;
1385
+ const Vd = 34028234663852886e22, qd = -34028234663852886e22, jd = 4294967295, Wd = 2147483647, Hd = -2147483648;
1373
1386
  function Vn(i) {
1374
1387
  if (typeof i != "number") throw new Error("invalid int 32: " + typeof i);
1375
- if (!Number.isInteger(i) || i > jd || i < Wd) throw new Error("invalid int 32: " + i);
1388
+ if (!Number.isInteger(i) || i > Wd || i < Hd) throw new Error("invalid int 32: " + i);
1376
1389
  }
1377
1390
  function ms(i) {
1378
1391
  if (typeof i != "number") throw new Error("invalid uint 32: " + typeof i);
1379
- if (!Number.isInteger(i) || i > qd || i < 0) throw new Error("invalid uint 32: " + i);
1392
+ if (!Number.isInteger(i) || i > jd || i < 0) throw new Error("invalid uint 32: " + i);
1380
1393
  }
1381
1394
  function Xa(i) {
1382
1395
  if (typeof i != "number") throw new Error("invalid float 32: " + typeof i);
1383
- if (Number.isFinite(i) && (i > Bd || i < Vd))
1396
+ if (Number.isFinite(i) && (i > Vd || i < qd))
1384
1397
  throw new Error("invalid float 32: " + i);
1385
1398
  }
1386
1399
  const Za = Symbol("@bufbuild/protobuf/enum-type");
1387
- function Hd(i) {
1400
+ function Kd(i) {
1388
1401
  const e = i[Za];
1389
1402
  return se(e, "missing enum type on enum object"), e;
1390
1403
  }
@@ -1414,7 +1427,7 @@ function to(i, e, t) {
1414
1427
  }
1415
1428
  };
1416
1429
  }
1417
- function Kd(i, e, t) {
1430
+ function Gd(i, e, t) {
1418
1431
  const n = {};
1419
1432
  for (const s of e) {
1420
1433
  const r = no(s);
@@ -1525,7 +1538,7 @@ class Ws {
1525
1538
  return Object.getPrototypeOf(this).constructor;
1526
1539
  }
1527
1540
  }
1528
- function Gd(i, e, t, n) {
1541
+ function zd(i, e, t, n) {
1529
1542
  var s;
1530
1543
  const r = (s = n == null ? void 0 : n.localName) !== null && s !== void 0 ? s : e.substring(e.lastIndexOf(".") + 1), a = {
1531
1544
  [r]: function(o) {
@@ -1550,7 +1563,7 @@ function Gd(i, e, t, n) {
1550
1563
  }
1551
1564
  }), a;
1552
1565
  }
1553
- function zd() {
1566
+ function Jd() {
1554
1567
  let i = 0, e = 0;
1555
1568
  for (let n = 0; n < 28; n += 7) {
1556
1569
  let s = this.buf[this.pos++];
@@ -1595,7 +1608,7 @@ function Ir(i) {
1595
1608
  }
1596
1609
  return r(-24, -18), r(-18, -12), r(-12, -6), r(-6), e ? so(n, s) : Hs(n, s);
1597
1610
  }
1598
- function Jd(i, e) {
1611
+ function $d(i, e) {
1599
1612
  let t = Hs(i, e);
1600
1613
  const n = t.hi & 2147483648;
1601
1614
  n && (t = so(t.lo, t.hi));
@@ -1603,7 +1616,7 @@ function Jd(i, e) {
1603
1616
  return n ? "-" + s : s;
1604
1617
  }
1605
1618
  function io(i, e) {
1606
- var t = $d(i, e);
1619
+ var t = Yd(i, e);
1607
1620
  if (i = t.lo, e = t.hi, e <= 2097151)
1608
1621
  return String(qn * e + i);
1609
1622
  const n = i & 16777215, s = (i >>> 24 | e << 8) & 16777215, r = e >> 16 & 65535;
@@ -1611,7 +1624,7 @@ function io(i, e) {
1611
1624
  const c = 1e7;
1612
1625
  return a >= c && (o += Math.floor(a / c), a %= c), o >= c && (d += Math.floor(o / c), o %= c), d.toString() + Mr(o) + Mr(a);
1613
1626
  }
1614
- function $d(i, e) {
1627
+ function Yd(i, e) {
1615
1628
  return {
1616
1629
  lo: i >>> 0,
1617
1630
  hi: e >>> 0
@@ -1641,7 +1654,7 @@ function Dr(i, e) {
1641
1654
  e.push(1);
1642
1655
  }
1643
1656
  }
1644
- function Yd() {
1657
+ function Qd() {
1645
1658
  let i = this.buf[this.pos++], e = i & 127;
1646
1659
  if (!(i & 128))
1647
1660
  return this.assertBounds(), e;
@@ -1656,7 +1669,7 @@ function Yd() {
1656
1669
  if (i & 128) throw new Error("invalid varint");
1657
1670
  return this.assertBounds(), e >>> 0;
1658
1671
  }
1659
- function Qd() {
1672
+ function Xd() {
1660
1673
  const i = new DataView(new ArrayBuffer(8));
1661
1674
  if (typeof BigInt == "function" && typeof i.getBigInt64 == "function" && typeof i.getBigUint64 == "function" && typeof i.setBigInt64 == "function" && typeof i.setBigUint64 == "function" && (typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1")) {
1662
1675
  const s = BigInt("-9223372036854775808"), r = BigInt("9223372036854775807"), a = BigInt("0"), o = BigInt("18446744073709551615");
@@ -1712,14 +1725,14 @@ function Qd() {
1712
1725
  return typeof s != "string" && (s = s.toString()), n(s), Ir(s);
1713
1726
  },
1714
1727
  dec(s, r) {
1715
- return Jd(s, r);
1728
+ return $d(s, r);
1716
1729
  },
1717
1730
  uDec(s, r) {
1718
1731
  return io(s, r);
1719
1732
  }
1720
1733
  };
1721
1734
  }
1722
- const te = Qd();
1735
+ const te = Xd();
1723
1736
  var w;
1724
1737
  (function(i) {
1725
1738
  i[i.DOUBLE = 1] = "DOUBLE", i[i.FLOAT = 2] = "FLOAT", i[i.INT64 = 3] = "INT64", i[i.UINT64 = 4] = "UINT64", i[i.INT32 = 5] = "INT32", i[i.FIXED64 = 6] = "FIXED64", i[i.FIXED32 = 7] = "FIXED32", i[i.BOOL = 8] = "BOOL", i[i.STRING = 9] = "STRING", i[i.BYTES = 12] = "BYTES", i[i.UINT32 = 13] = "UINT32", i[i.SFIXED32 = 15] = "SFIXED32", i[i.SFIXED64 = 16] = "SFIXED64", i[i.SINT32 = 17] = "SINT32", i[i.SINT64 = 18] = "SINT64";
@@ -1787,18 +1800,18 @@ function Ar(i, e) {
1787
1800
  for (var t = 0, n = Array(e); t < e; t++) n[t] = i[t];
1788
1801
  return n;
1789
1802
  }
1790
- function Xd(i) {
1803
+ function Zd(i) {
1791
1804
  if (Array.isArray(i)) return i;
1792
1805
  }
1793
1806
  function K(i, e, t) {
1794
- return (e = nl(e)) in i ? Object.defineProperty(i, e, {
1807
+ return (e = il(e)) in i ? Object.defineProperty(i, e, {
1795
1808
  value: t,
1796
1809
  enumerable: !0,
1797
1810
  configurable: !0,
1798
1811
  writable: !0
1799
1812
  }) : i[e] = t, i;
1800
1813
  }
1801
- function Zd(i, e) {
1814
+ function el(i, e) {
1802
1815
  var t = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
1803
1816
  if (t != null) {
1804
1817
  var n, s, r, a, o = [], d = !0, c = !1;
@@ -1819,14 +1832,14 @@ function Zd(i, e) {
1819
1832
  return o;
1820
1833
  }
1821
1834
  }
1822
- function el() {
1835
+ function tl() {
1823
1836
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1824
1837
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1825
1838
  }
1826
1839
  function U(i, e) {
1827
- return Xd(i) || Zd(i, e) || il(i, e) || el();
1840
+ return Zd(i) || el(i, e) || sl(i, e) || tl();
1828
1841
  }
1829
- function tl(i, e) {
1842
+ function nl(i, e) {
1830
1843
  if (typeof i != "object" || !i) return i;
1831
1844
  var t = i[Symbol.toPrimitive];
1832
1845
  if (t !== void 0) {
@@ -1836,11 +1849,11 @@ function tl(i, e) {
1836
1849
  }
1837
1850
  return (e === "string" ? String : Number)(i);
1838
1851
  }
1839
- function nl(i) {
1840
- var e = tl(i, "string");
1852
+ function il(i) {
1853
+ var e = nl(i, "string");
1841
1854
  return typeof e == "symbol" ? e : e + "";
1842
1855
  }
1843
- function il(i, e) {
1856
+ function sl(i, e) {
1844
1857
  if (i) {
1845
1858
  if (typeof i == "string") return Ar(i, e);
1846
1859
  var t = {}.toString.call(i).slice(8, -1);
@@ -1851,7 +1864,7 @@ var ae;
1851
1864
  (function(i) {
1852
1865
  i[i.Varint = 0] = "Varint", i[i.Bit64 = 1] = "Bit64", i[i.LengthDelimited = 2] = "LengthDelimited", i[i.StartGroup = 3] = "StartGroup", i[i.EndGroup = 4] = "EndGroup", i[i.Bit32 = 5] = "Bit32";
1853
1866
  })(ae || (ae = {}));
1854
- class sl {
1867
+ class rl {
1855
1868
  constructor(e) {
1856
1869
  this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
1857
1870
  }
@@ -2010,9 +2023,9 @@ class sl {
2010
2023
  return Hi(t.lo, t.hi, this.buf), this;
2011
2024
  }
2012
2025
  }
2013
- class rl {
2026
+ class al {
2014
2027
  constructor(e, t) {
2015
- this.varint64 = zd, this.uint32 = Yd, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder();
2028
+ this.varint64 = Jd, this.uint32 = Qd, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder();
2016
2029
  }
2017
2030
  /**
2018
2031
  * Reads a tag - field number and wire type.
@@ -2155,7 +2168,7 @@ class rl {
2155
2168
  return this.textDecoder.decode(this.bytes());
2156
2169
  }
2157
2170
  }
2158
- function al(i, e, t, n) {
2171
+ function ol(i, e, t, n) {
2159
2172
  let s;
2160
2173
  return {
2161
2174
  typeName: e,
@@ -2172,9 +2185,9 @@ function al(i, e, t, n) {
2172
2185
  }
2173
2186
  function ao(i) {
2174
2187
  const e = i.field.localName, t = /* @__PURE__ */ Object.create(null);
2175
- return t[e] = ol(i), [t, () => t[e]];
2188
+ return t[e] = cl(i), [t, () => t[e]];
2176
2189
  }
2177
- function ol(i) {
2190
+ function cl(i) {
2178
2191
  const e = i.field;
2179
2192
  if (e.repeated)
2180
2193
  return [];
@@ -2192,7 +2205,7 @@ function ol(i) {
2192
2205
  throw "map fields are not allowed to be extensions";
2193
2206
  }
2194
2207
  }
2195
- function cl(i, e) {
2208
+ function dl(i, e) {
2196
2209
  if (!e.repeated && (e.kind == "enum" || e.kind == "scalar")) {
2197
2210
  for (let t = i.length - 1; t >= 0; --t)
2198
2211
  if (i[t].no == e.no)
@@ -2273,14 +2286,14 @@ const oo = {
2273
2286
  return t && (e += at[s], e += "=", t == 1 && (e += "=")), e;
2274
2287
  }
2275
2288
  };
2276
- function dl(i, e, t) {
2289
+ function ll(i, e, t) {
2277
2290
  lo(e, i);
2278
- const n = e.runtime.bin.makeReadOptions(t), s = cl(i.getType().runtime.bin.listUnknownFields(i), e.field), r = ao(e), a = U(r, 2), o = a[0], d = a[1];
2291
+ const n = e.runtime.bin.makeReadOptions(t), s = dl(i.getType().runtime.bin.listUnknownFields(i), e.field), r = ao(e), a = U(r, 2), o = a[0], d = a[1];
2279
2292
  for (const c of s)
2280
2293
  e.runtime.bin.readField(o, n.readerFactory(c.data), e.field, c.wireType, n);
2281
2294
  return d();
2282
2295
  }
2283
- function ll(i, e, t, n) {
2296
+ function ul(i, e, t, n) {
2284
2297
  lo(e, i);
2285
2298
  const s = e.runtime.bin.makeReadOptions(n), r = e.runtime.bin.makeWriteOptions(n);
2286
2299
  if (co(i, e)) {
@@ -2365,17 +2378,17 @@ const xr = {
2365
2378
  useProtoFieldName: !1,
2366
2379
  prettySpaces: 0
2367
2380
  };
2368
- function ul(i) {
2381
+ function hl(i) {
2369
2382
  return i ? Object.assign(Object.assign({}, xr), i) : xr;
2370
2383
  }
2371
- function hl(i) {
2384
+ function pl(i) {
2372
2385
  return i ? Object.assign(Object.assign({}, Lr), i) : Lr;
2373
2386
  }
2374
2387
  const ni = Symbol(), jn = Symbol();
2375
- function pl() {
2388
+ function fl() {
2376
2389
  return {
2377
- makeReadOptions: ul,
2378
- makeWriteOptions: hl,
2390
+ makeReadOptions: hl,
2391
+ makeWriteOptions: pl,
2379
2392
  readMessage(i, e, t, n) {
2380
2393
  if (e == null || Array.isArray(e) || typeof e != "object")
2381
2394
  throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(Qe(e)));
@@ -2401,7 +2414,7 @@ function pl() {
2401
2414
  if (h && h.extendee.typeName == i.typeName) {
2402
2415
  u = !0;
2403
2416
  const p = ao(h), g = U(p, 2), m = g[0], T = g[1];
2404
- Nr(m, c, h.field, t, h), ll(n, h, T(), t);
2417
+ Nr(m, c, h.field, t, h), ul(n, h, T(), t);
2405
2418
  }
2406
2419
  }
2407
2420
  if (!u && !t.ignoreUnknownFields)
@@ -2418,7 +2431,7 @@ function pl() {
2418
2431
  if (!uo(s, i)) {
2419
2432
  if (s.req)
2420
2433
  throw "required field not set";
2421
- if (!e.emitDefaultValues || !ml(s))
2434
+ if (!e.emitDefaultValues || !gl(s))
2422
2435
  continue;
2423
2436
  }
2424
2437
  const a = s.oneof ? i[s.oneof.localName].value : i[s.localName], o = Ur(s, a, e);
@@ -2429,7 +2442,7 @@ function pl() {
2429
2442
  for (const a of t.runtime.bin.listUnknownFields(i)) {
2430
2443
  const o = r.findExtensionFor(t.typeName, a.no);
2431
2444
  if (o && co(i, o)) {
2432
- const d = dl(i, o, e), c = Ur(o.field, d, e);
2445
+ const d = ll(i, o, e), c = Ur(o.field, d, e);
2433
2446
  c !== void 0 && (n[o.field.jsonName] = c);
2434
2447
  }
2435
2448
  }
@@ -2503,7 +2516,7 @@ function Nr(i, e, t, n, s) {
2503
2516
  throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: map value null"));
2504
2517
  let u;
2505
2518
  try {
2506
- u = fl(t.K, c);
2519
+ u = ml(t.K, c);
2507
2520
  } catch (h) {
2508
2521
  let p = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Qe(e));
2509
2522
  throw h instanceof Error && h.message.length > 0 && (p += ": ".concat(h.message)), new Error(p);
@@ -2568,7 +2581,7 @@ function Nr(i, e, t, n, s) {
2568
2581
  break;
2569
2582
  }
2570
2583
  }
2571
- function fl(i, e) {
2584
+ function ml(i, e) {
2572
2585
  if (i === w.BOOL)
2573
2586
  switch (e) {
2574
2587
  case "true":
@@ -2651,7 +2664,7 @@ function Ki(i, e, t, n) {
2651
2664
  }
2652
2665
  throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(Qe(e)));
2653
2666
  }
2654
- function ml(i) {
2667
+ function gl(i) {
2655
2668
  return i.repeated || i.kind == "map" ? !0 : !(i.oneof || i.kind == "message" || i.opt || i.req);
2656
2669
  }
2657
2670
  function Ur(i, e, t) {
@@ -2748,21 +2761,21 @@ function Wn(i, e) {
2748
2761
  }
2749
2762
  const Ft = Symbol("@bufbuild/protobuf/unknown-fields"), Fr = {
2750
2763
  readUnknownFields: !0,
2751
- readerFactory: (i) => new rl(i)
2764
+ readerFactory: (i) => new al(i)
2752
2765
  }, Br = {
2753
2766
  writeUnknownFields: !0,
2754
- writerFactory: () => new sl()
2767
+ writerFactory: () => new rl()
2755
2768
  };
2756
- function gl(i) {
2769
+ function vl(i) {
2757
2770
  return i ? Object.assign(Object.assign({}, Fr), i) : Fr;
2758
2771
  }
2759
- function vl(i) {
2772
+ function bl(i) {
2760
2773
  return i ? Object.assign(Object.assign({}, Br), i) : Br;
2761
2774
  }
2762
- function bl() {
2775
+ function yl() {
2763
2776
  return {
2764
- makeReadOptions: gl,
2765
- makeWriteOptions: vl,
2777
+ makeReadOptions: vl,
2778
+ makeWriteOptions: bl,
2766
2779
  listUnknownFields(i) {
2767
2780
  var e;
2768
2781
  return (e = i[Ft]) !== null && e !== void 0 ? e : [];
@@ -2829,7 +2842,7 @@ function Vr(i, e, t, n, s) {
2829
2842
  case "enum":
2830
2843
  const o = t.kind == "enum" ? w.INT32 : t.T;
2831
2844
  let d = ii;
2832
- if (t.kind == "scalar" && t.L > 0 && (d = kl), r) {
2845
+ if (t.kind == "scalar" && t.L > 0 && (d = Tl), r) {
2833
2846
  let g = i[a];
2834
2847
  if (n == ae.LengthDelimited && o != w.STRING && o != w.BYTES) {
2835
2848
  let T = e.uint32() + e.pos;
@@ -2845,7 +2858,7 @@ function Vr(i, e, t, n, s) {
2845
2858
  r ? i[a].push(Hn(e, new c(), s, t)) : ot(i[a]) ? Hn(e, i[a], s, t) : (i[a] = Hn(e, new c(), s, t), c.fieldWrapper && !t.oneof && !t.repeated && (i[a] = c.fieldWrapper.unwrapField(i[a])));
2846
2859
  break;
2847
2860
  case "map":
2848
- let l = yl(t, e, s), u = U(l, 2), h = u[0], p = u[1];
2861
+ let l = kl(t, e, s), u = U(l, 2), h = u[0], p = u[1];
2849
2862
  i[a][h] = p;
2850
2863
  break;
2851
2864
  }
@@ -2861,7 +2874,7 @@ function Hn(i, e, t, n) {
2861
2874
  r
2862
2875
  ), e;
2863
2876
  }
2864
- function yl(i, e, t) {
2877
+ function kl(i, e, t) {
2865
2878
  const n = e.uint32(), s = e.pos + n;
2866
2879
  let r, a;
2867
2880
  for (; e.pos < s; ) {
@@ -2899,7 +2912,7 @@ function yl(i, e, t) {
2899
2912
  }
2900
2913
  return [r, a];
2901
2914
  }
2902
- function kl(i, e) {
2915
+ function Tl(i, e) {
2903
2916
  const t = ii(i, e);
2904
2917
  return typeof t == "bigint" ? t.toString() : t;
2905
2918
  }
@@ -2946,7 +2959,7 @@ function qr(i, e, t, n) {
2946
2959
  let a = i.kind == "enum" ? w.INT32 : i.T;
2947
2960
  if (s)
2948
2961
  if (se(Array.isArray(e)), i.packed)
2949
- Sl(t, a, i.no, e);
2962
+ Cl(t, a, i.no, e);
2950
2963
  else
2951
2964
  for (const o of e)
2952
2965
  bn(t, a, i.no, o);
@@ -2966,12 +2979,12 @@ function qr(i, e, t, n) {
2966
2979
  for (const o of Object.entries(e)) {
2967
2980
  var r = U(o, 2);
2968
2981
  const d = r[0], c = r[1];
2969
- Tl(t, n, i, d, c);
2982
+ Sl(t, n, i, d, c);
2970
2983
  }
2971
2984
  break;
2972
2985
  }
2973
2986
  }
2974
- function Tl(i, e, t, n, s) {
2987
+ function Sl(i, e, t, n, s) {
2975
2988
  i.tag(t.no, ae.LengthDelimited), i.fork();
2976
2989
  let r = n;
2977
2990
  switch (t.K) {
@@ -3008,7 +3021,7 @@ function bn(i, e, t, n) {
3008
3021
  let s = po(e), r = U(s, 2), a = r[0], o = r[1];
3009
3022
  i.tag(t, a)[o](n);
3010
3023
  }
3011
- function Sl(i, e, t, n) {
3024
+ function Cl(i, e, t, n) {
3012
3025
  if (!n.length)
3013
3026
  return;
3014
3027
  i.tag(t, ae.LengthDelimited).fork();
@@ -3038,7 +3051,7 @@ function po(i) {
3038
3051
  const t = w[i].toLowerCase();
3039
3052
  return [e, t];
3040
3053
  }
3041
- function Cl() {
3054
+ function _l() {
3042
3055
  return {
3043
3056
  setEnumType: eo,
3044
3057
  initPartial(i, e) {
@@ -3198,27 +3211,27 @@ function Nn(i) {
3198
3211
  function an(i) {
3199
3212
  return i instanceof Uint8Array ? i : new Uint8Array(i);
3200
3213
  }
3201
- function _l(i, e, t) {
3214
+ function wl(i, e, t) {
3202
3215
  return {
3203
3216
  syntax: i,
3204
- json: pl(),
3205
- bin: bl(),
3206
- util: Object.assign(Object.assign({}, Cl()), {
3217
+ json: fl(),
3218
+ bin: yl(),
3219
+ util: Object.assign(Object.assign({}, _l()), {
3207
3220
  newFieldList: e,
3208
3221
  initFields: t
3209
3222
  }),
3210
3223
  makeMessageType(n, s, r) {
3211
- return Gd(this, n, s, r);
3224
+ return zd(this, n, s, r);
3212
3225
  },
3213
- makeEnum: Kd,
3226
+ makeEnum: Gd,
3214
3227
  makeEnumType: to,
3215
- getEnumType: Hd,
3228
+ getEnumType: Kd,
3216
3229
  makeExtension(n, s, r) {
3217
- return al(this, n, s, r);
3230
+ return ol(this, n, s, r);
3218
3231
  }
3219
3232
  };
3220
3233
  }
3221
- class wl {
3234
+ class El {
3222
3235
  constructor(e, t) {
3223
3236
  this._fields = e, this._normalizer = t;
3224
3237
  }
@@ -3259,12 +3272,12 @@ class wl {
3259
3272
  }
3260
3273
  function fo(i, e) {
3261
3274
  const t = mo(i);
3262
- return e ? t : Dl(Ml(t));
3275
+ return e ? t : Al(Dl(t));
3263
3276
  }
3264
- function El(i) {
3277
+ function Pl(i) {
3265
3278
  return fo(i, !1);
3266
3279
  }
3267
- const Pl = mo;
3280
+ const Rl = mo;
3268
3281
  function mo(i) {
3269
3282
  let e = !1;
3270
3283
  const t = [];
@@ -3293,13 +3306,13 @@ function mo(i) {
3293
3306
  }
3294
3307
  return t.join("");
3295
3308
  }
3296
- const Rl = /* @__PURE__ */ new Set([
3309
+ const Il = /* @__PURE__ */ new Set([
3297
3310
  // names reserved by JavaScript
3298
3311
  "constructor",
3299
3312
  "toString",
3300
3313
  "toJSON",
3301
3314
  "valueOf"
3302
- ]), Il = /* @__PURE__ */ new Set([
3315
+ ]), Ml = /* @__PURE__ */ new Set([
3303
3316
  // names reserved by the runtime
3304
3317
  "getType",
3305
3318
  "clone",
@@ -3312,10 +3325,10 @@ const Rl = /* @__PURE__ */ new Set([
3312
3325
  "toJsonString",
3313
3326
  // names reserved by the runtime for the future
3314
3327
  "toObject"
3315
- ]), go = (i) => "".concat(i, "$"), Ml = (i) => Il.has(i) ? go(i) : i, Dl = (i) => Rl.has(i) ? go(i) : i;
3316
- class Al {
3328
+ ]), go = (i) => "".concat(i, "$"), Dl = (i) => Ml.has(i) ? go(i) : i, Al = (i) => Il.has(i) ? go(i) : i;
3329
+ class Ol {
3317
3330
  constructor(e) {
3318
- this.kind = "oneof", this.repeated = !1, this.packed = !1, this.opt = !1, this.req = !1, this.default = void 0, this.fields = [], this.name = e, this.localName = El(e);
3331
+ this.kind = "oneof", this.repeated = !1, this.packed = !1, this.opt = !1, this.req = !1, this.default = void 0, this.fields = [], this.name = e, this.localName = Pl(e);
3319
3332
  }
3320
3333
  addField(e) {
3321
3334
  se(e.oneof === this, "field ".concat(e.name, " not one of ").concat(this.name)), this.fields.push(e);
@@ -3329,23 +3342,23 @@ class Al {
3329
3342
  return this._lookup[e];
3330
3343
  }
3331
3344
  }
3332
- function Ol(i, e) {
3345
+ function xl(i, e) {
3333
3346
  var t, n, s, r, a, o;
3334
3347
  const d = [];
3335
3348
  let c;
3336
3349
  for (const l of typeof i == "function" ? i() : i) {
3337
3350
  const u = l;
3338
- if (u.localName = fo(l.name, l.oneof !== void 0), u.jsonName = (t = l.jsonName) !== null && t !== void 0 ? t : Pl(l.name), u.repeated = (n = l.repeated) !== null && n !== void 0 ? n : !1, l.kind == "scalar" && (u.L = (s = l.L) !== null && s !== void 0 ? s : Tt.BIGINT), u.delimited = (r = l.delimited) !== null && r !== void 0 ? r : !1, u.req = (a = l.req) !== null && a !== void 0 ? a : !1, u.opt = (o = l.opt) !== null && o !== void 0 ? o : !1, l.packed === void 0 && (u.packed = l.kind == "enum" || l.kind == "scalar" && l.T != w.BYTES && l.T != w.STRING), l.oneof !== void 0) {
3351
+ if (u.localName = fo(l.name, l.oneof !== void 0), u.jsonName = (t = l.jsonName) !== null && t !== void 0 ? t : Rl(l.name), u.repeated = (n = l.repeated) !== null && n !== void 0 ? n : !1, l.kind == "scalar" && (u.L = (s = l.L) !== null && s !== void 0 ? s : Tt.BIGINT), u.delimited = (r = l.delimited) !== null && r !== void 0 ? r : !1, u.req = (a = l.req) !== null && a !== void 0 ? a : !1, u.opt = (o = l.opt) !== null && o !== void 0 ? o : !1, l.packed === void 0 && (u.packed = l.kind == "enum" || l.kind == "scalar" && l.T != w.BYTES && l.T != w.STRING), l.oneof !== void 0) {
3339
3352
  const h = typeof l.oneof == "string" ? l.oneof : l.oneof.name;
3340
- (!c || c.name != h) && (c = new Al(h)), u.oneof = c, c.addField(u);
3353
+ (!c || c.name != h) && (c = new Ol(h)), u.oneof = c, c.addField(u);
3341
3354
  }
3342
3355
  d.push(u);
3343
3356
  }
3344
3357
  return d;
3345
3358
  }
3346
- const b = _l(
3359
+ const b = wl(
3347
3360
  "proto3",
3348
- (i) => new wl(i, (e) => Ol(e)),
3361
+ (i) => new El(i, (e) => xl(e)),
3349
3362
  // TODO merge with proto2 and initExtensionField, also see initPartial, equals, clone
3350
3363
  (i) => {
3351
3364
  for (const e of i.getType().fields.byMember()) {
@@ -3446,7 +3459,7 @@ Ee.fields = b.util.newFieldList(() => [{
3446
3459
  T: 5
3447
3460
  /* ScalarType.INT32 */
3448
3461
  }]);
3449
- const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3462
+ const Ll = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3450
3463
  no: 1,
3451
3464
  name: "timestamp_ms",
3452
3465
  kind: "scalar",
@@ -3467,15 +3480,15 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3467
3480
  no: 4,
3468
3481
  name: "time_series",
3469
3482
  kind: "message",
3470
- T: Ll,
3483
+ T: Nl,
3471
3484
  repeated: !0
3472
3485
  }, {
3473
3486
  no: 5,
3474
3487
  name: "events",
3475
3488
  kind: "message",
3476
- T: Ul,
3489
+ T: Fl,
3477
3490
  repeated: !0
3478
- }]), Ll = /* @__PURE__ */ b.makeMessageType("livekit.TimeSeriesMetric", () => [{
3491
+ }]), Nl = /* @__PURE__ */ b.makeMessageType("livekit.TimeSeriesMetric", () => [{
3479
3492
  no: 1,
3480
3493
  name: "label",
3481
3494
  kind: "scalar",
@@ -3497,7 +3510,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3497
3510
  no: 4,
3498
3511
  name: "samples",
3499
3512
  kind: "message",
3500
- T: Nl,
3513
+ T: Ul,
3501
3514
  repeated: !0
3502
3515
  }, {
3503
3516
  no: 5,
@@ -3505,7 +3518,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3505
3518
  kind: "scalar",
3506
3519
  T: 13
3507
3520
  /* ScalarType.UINT32 */
3508
- }]), Nl = /* @__PURE__ */ b.makeMessageType("livekit.MetricSample", () => [{
3521
+ }]), Ul = /* @__PURE__ */ b.makeMessageType("livekit.MetricSample", () => [{
3509
3522
  no: 1,
3510
3523
  name: "timestamp_ms",
3511
3524
  kind: "scalar",
@@ -3522,7 +3535,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3522
3535
  kind: "scalar",
3523
3536
  T: 2
3524
3537
  /* ScalarType.FLOAT */
3525
- }]), Ul = /* @__PURE__ */ b.makeMessageType("livekit.EventMetric", () => [{
3538
+ }]), Fl = /* @__PURE__ */ b.makeMessageType("livekit.EventMetric", () => [{
3526
3539
  no: 1,
3527
3540
  name: "label",
3528
3541
  kind: "scalar",
@@ -3707,7 +3720,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3707
3720
  }, {
3708
3721
  no: 4,
3709
3722
  name: "RR_SWITCH_CANDIDATE"
3710
- }]), Fl = /* @__PURE__ */ b.makeEnum("livekit.SubscriptionError", [{
3723
+ }]), Bl = /* @__PURE__ */ b.makeEnum("livekit.SubscriptionError", [{
3711
3724
  no: 0,
3712
3725
  name: "SE_UNKNOWN"
3713
3726
  }, {
@@ -3838,7 +3851,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3838
3851
  kind: "scalar",
3839
3852
  T: 9
3840
3853
  /* ScalarType.STRING */
3841
- }]), Bl = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantPermission", () => [{
3854
+ }]), Vl = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantPermission", () => [{
3842
3855
  no: 1,
3843
3856
  name: "can_subscribe",
3844
3857
  kind: "scalar",
@@ -3955,7 +3968,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3955
3968
  no: 11,
3956
3969
  name: "permission",
3957
3970
  kind: "message",
3958
- T: Bl
3971
+ T: Vl
3959
3972
  }, {
3960
3973
  no: 12,
3961
3974
  name: "region",
@@ -3992,7 +4005,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3992
4005
  no: 18,
3993
4006
  name: "kind_details",
3994
4007
  kind: "enum",
3995
- T: b.getEnumType(Vl),
4008
+ T: b.getEnumType(ql),
3996
4009
  repeated: !0
3997
4010
  }, {
3998
4011
  no: 19,
@@ -4039,7 +4052,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4039
4052
  }, {
4040
4053
  no: 8,
4041
4054
  name: "BRIDGE"
4042
- }]), Vl = /* @__PURE__ */ b.makeEnum("livekit.ParticipantInfo.KindDetail", [{
4055
+ }]), ql = /* @__PURE__ */ b.makeEnum("livekit.ParticipantInfo.KindDetail", [{
4043
4056
  no: 0,
4044
4057
  name: "CLOUD_AGENT"
4045
4058
  }, {
@@ -4063,7 +4076,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4063
4076
  }, {
4064
4077
  no: 2,
4065
4078
  name: "CUSTOM"
4066
- }]), ql = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodecInfo", () => [{
4079
+ }]), jl = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodecInfo", () => [{
4067
4080
  no: 1,
4068
4081
  name: "mime_type",
4069
4082
  kind: "scalar",
@@ -4172,7 +4185,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4172
4185
  no: 13,
4173
4186
  name: "codecs",
4174
4187
  kind: "message",
4175
- T: ql,
4188
+ T: jl,
4176
4189
  repeated: !0
4177
4190
  }, {
4178
4191
  no: 14,
@@ -4242,7 +4255,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4242
4255
  name: "encryption",
4243
4256
  kind: "enum",
4244
4257
  T: b.getEnumType(X)
4245
- }]), jl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
4258
+ }]), Wl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
4246
4259
  no: 1,
4247
4260
  name: "target_fps",
4248
4261
  kind: "scalar",
@@ -4334,7 +4347,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4334
4347
  no: 3,
4335
4348
  name: "speaker",
4336
4349
  kind: "message",
4337
- T: Wl,
4350
+ T: Hl,
4338
4351
  oneof: "value"
4339
4352
  }, {
4340
4353
  no: 6,
@@ -4346,13 +4359,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4346
4359
  no: 7,
4347
4360
  name: "transcription",
4348
4361
  kind: "message",
4349
- T: Hl,
4362
+ T: Kl,
4350
4363
  oneof: "value"
4351
4364
  }, {
4352
4365
  no: 8,
4353
4366
  name: "metrics",
4354
4367
  kind: "message",
4355
- T: xl,
4368
+ T: Ll,
4356
4369
  oneof: "value"
4357
4370
  }, {
4358
4371
  no: 9,
@@ -4491,7 +4504,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4491
4504
  kind: "message",
4492
4505
  T: ci,
4493
4506
  oneof: "value"
4494
- }]), Wl = /* @__PURE__ */ b.makeMessageType("livekit.ActiveSpeakerUpdate", () => [{
4507
+ }]), Hl = /* @__PURE__ */ b.makeMessageType("livekit.ActiveSpeakerUpdate", () => [{
4495
4508
  no: 1,
4496
4509
  name: "speakers",
4497
4510
  kind: "message",
@@ -4587,7 +4600,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4587
4600
  kind: "scalar",
4588
4601
  T: 9
4589
4602
  /* ScalarType.STRING */
4590
- }]), Hl = /* @__PURE__ */ b.makeMessageType("livekit.Transcription", () => [{
4603
+ }]), Kl = /* @__PURE__ */ b.makeMessageType("livekit.Transcription", () => [{
4591
4604
  no: 2,
4592
4605
  name: "transcribed_participant_identity",
4593
4606
  kind: "scalar",
@@ -4603,9 +4616,9 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4603
4616
  no: 4,
4604
4617
  name: "segments",
4605
4618
  kind: "message",
4606
- T: Kl,
4619
+ T: Gl,
4607
4620
  repeated: !0
4608
- }]), Kl = /* @__PURE__ */ b.makeMessageType("livekit.TranscriptionSegment", () => [{
4621
+ }]), Gl = /* @__PURE__ */ b.makeMessageType("livekit.TranscriptionSegment", () => [{
4609
4622
  no: 1,
4610
4623
  name: "id",
4611
4624
  kind: "scalar",
@@ -4967,7 +4980,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4967
4980
  no: 4,
4968
4981
  name: "disabled_codecs",
4969
4982
  kind: "message",
4970
- T: Gl
4983
+ T: zl
4971
4984
  }, {
4972
4985
  no: 5,
4973
4986
  name: "force_relay",
@@ -4978,7 +4991,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4978
4991
  name: "hardware_encoder",
4979
4992
  kind: "enum",
4980
4993
  T: b.getEnumType(_n)
4981
- }]), Gl = /* @__PURE__ */ b.makeMessageType("livekit.DisabledCodecs", () => [{
4994
+ }]), zl = /* @__PURE__ */ b.makeMessageType("livekit.DisabledCodecs", () => [{
4982
4995
  no: 1,
4983
4996
  name: "codecs",
4984
4997
  kind: "message",
@@ -5168,7 +5181,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5168
5181
  }
5169
5182
  }], {
5170
5183
  localName: "DataStream_Trailer"
5171
- }), zl = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodec", () => [{
5184
+ }), Jl = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodec", () => [{
5172
5185
  no: 1,
5173
5186
  name: "codec",
5174
5187
  kind: "scalar",
@@ -5192,7 +5205,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5192
5205
  }, {
5193
5206
  no: 1,
5194
5207
  name: "PAUSED"
5195
- }]), Jl = /* @__PURE__ */ b.makeEnum("livekit.CandidateProtocol", [{
5208
+ }]), $l = /* @__PURE__ */ b.makeEnum("livekit.CandidateProtocol", [{
5196
5209
  no: 0,
5197
5210
  name: "UDP"
5198
5211
  }, {
@@ -5201,7 +5214,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5201
5214
  }, {
5202
5215
  no: 2,
5203
5216
  name: "TLS"
5204
- }]), $l = /* @__PURE__ */ b.makeMessageType("livekit.SignalRequest", () => [{
5217
+ }]), Yl = /* @__PURE__ */ b.makeMessageType("livekit.SignalRequest", () => [{
5205
5218
  no: 1,
5206
5219
  name: "offer",
5207
5220
  kind: "message",
@@ -5325,7 +5338,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5325
5338
  no: 1,
5326
5339
  name: "join",
5327
5340
  kind: "message",
5328
- T: Zl,
5341
+ T: eu,
5329
5342
  oneof: "message"
5330
5343
  }, {
5331
5344
  no: 2,
@@ -5349,7 +5362,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5349
5362
  no: 5,
5350
5363
  name: "update",
5351
5364
  kind: "message",
5352
- T: nu,
5365
+ T: iu,
5353
5366
  oneof: "message"
5354
5367
  }, {
5355
5368
  no: 6,
@@ -5373,37 +5386,37 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5373
5386
  no: 10,
5374
5387
  name: "speakers_changed",
5375
5388
  kind: "message",
5376
- T: iu,
5389
+ T: su,
5377
5390
  oneof: "message"
5378
5391
  }, {
5379
5392
  no: 11,
5380
5393
  name: "room_update",
5381
5394
  kind: "message",
5382
- T: su,
5395
+ T: ru,
5383
5396
  oneof: "message"
5384
5397
  }, {
5385
5398
  no: 12,
5386
5399
  name: "connection_quality",
5387
5400
  kind: "message",
5388
- T: au,
5401
+ T: ou,
5389
5402
  oneof: "message"
5390
5403
  }, {
5391
5404
  no: 13,
5392
5405
  name: "stream_state_update",
5393
5406
  kind: "message",
5394
- T: cu,
5407
+ T: du,
5395
5408
  oneof: "message"
5396
5409
  }, {
5397
5410
  no: 14,
5398
5411
  name: "subscribed_quality_update",
5399
5412
  kind: "message",
5400
- T: lu,
5413
+ T: uu,
5401
5414
  oneof: "message"
5402
5415
  }, {
5403
5416
  no: 15,
5404
5417
  name: "subscription_permission_update",
5405
5418
  kind: "message",
5406
- T: hu,
5419
+ T: pu,
5407
5420
  oneof: "message"
5408
5421
  }, {
5409
5422
  no: 16,
@@ -5415,7 +5428,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5415
5428
  no: 17,
5416
5429
  name: "track_unpublished",
5417
5430
  kind: "message",
5418
- T: tu,
5431
+ T: nu,
5419
5432
  oneof: "message"
5420
5433
  }, {
5421
5434
  no: 18,
@@ -5427,49 +5440,49 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5427
5440
  no: 19,
5428
5441
  name: "reconnect",
5429
5442
  kind: "message",
5430
- T: eu,
5443
+ T: tu,
5431
5444
  oneof: "message"
5432
5445
  }, {
5433
5446
  no: 20,
5434
5447
  name: "pong_resp",
5435
5448
  kind: "message",
5436
- T: fu,
5449
+ T: mu,
5437
5450
  oneof: "message"
5438
5451
  }, {
5439
5452
  no: 21,
5440
5453
  name: "subscription_response",
5441
5454
  kind: "message",
5442
- T: vu,
5455
+ T: bu,
5443
5456
  oneof: "message"
5444
5457
  }, {
5445
5458
  no: 22,
5446
5459
  name: "request_response",
5447
5460
  kind: "message",
5448
- T: bu,
5461
+ T: yu,
5449
5462
  oneof: "message"
5450
5463
  }, {
5451
5464
  no: 23,
5452
5465
  name: "track_subscribed",
5453
5466
  kind: "message",
5454
- T: yu,
5467
+ T: ku,
5455
5468
  oneof: "message"
5456
5469
  }, {
5457
5470
  no: 24,
5458
5471
  name: "room_moved",
5459
5472
  kind: "message",
5460
- T: pu,
5473
+ T: fu,
5461
5474
  oneof: "message"
5462
5475
  }, {
5463
5476
  no: 25,
5464
5477
  name: "media_sections_requirement",
5465
5478
  kind: "message",
5466
- T: Su,
5479
+ T: Cu,
5467
5480
  oneof: "message"
5468
5481
  }, {
5469
5482
  no: 26,
5470
5483
  name: "subscribed_audio_codec_update",
5471
5484
  kind: "message",
5472
- T: uu,
5485
+ T: hu,
5473
5486
  oneof: "message"
5474
5487
  }, {
5475
5488
  no: 27,
@@ -5481,13 +5494,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5481
5494
  no: 28,
5482
5495
  name: "unpublish_data_track_response",
5483
5496
  kind: "message",
5484
- T: Yl,
5497
+ T: Ql,
5485
5498
  oneof: "message"
5486
5499
  }, {
5487
5500
  no: 29,
5488
5501
  name: "data_track_subscriber_handles",
5489
5502
  kind: "message",
5490
- T: Ql,
5503
+ T: Xl,
5491
5504
  oneof: "message"
5492
5505
  }]), bs = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodec", () => [{
5493
5506
  no: 1,
@@ -5644,21 +5657,21 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5644
5657
  kind: "scalar",
5645
5658
  T: 13
5646
5659
  /* ScalarType.UINT32 */
5647
- }]), Yl = /* @__PURE__ */ b.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
5660
+ }]), Ql = /* @__PURE__ */ b.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
5648
5661
  no: 1,
5649
5662
  name: "info",
5650
5663
  kind: "message",
5651
5664
  T: ki
5652
- }]), Ql = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
5665
+ }]), Xl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
5653
5666
  no: 1,
5654
5667
  name: "sub_handles",
5655
5668
  kind: "map",
5656
5669
  K: 13,
5657
5670
  V: {
5658
5671
  kind: "message",
5659
- T: Xl
5672
+ T: Zl
5660
5673
  }
5661
- }]), Xl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
5674
+ }]), Zl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
5662
5675
  no: 1,
5663
5676
  name: "publisher_identity",
5664
5677
  kind: "scalar",
@@ -5707,7 +5720,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5707
5720
  kind: "scalar",
5708
5721
  T: 8
5709
5722
  /* ScalarType.BOOL */
5710
- }]), Zl = /* @__PURE__ */ b.makeMessageType("livekit.JoinResponse", () => [{
5723
+ }]), eu = /* @__PURE__ */ b.makeMessageType("livekit.JoinResponse", () => [{
5711
5724
  no: 1,
5712
5725
  name: "room",
5713
5726
  kind: "message",
@@ -5793,7 +5806,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5793
5806
  kind: "scalar",
5794
5807
  T: 8
5795
5808
  /* ScalarType.BOOL */
5796
- }]), eu = /* @__PURE__ */ b.makeMessageType("livekit.ReconnectResponse", () => [{
5809
+ }]), tu = /* @__PURE__ */ b.makeMessageType("livekit.ReconnectResponse", () => [{
5797
5810
  no: 1,
5798
5811
  name: "ice_servers",
5799
5812
  kind: "message",
@@ -5826,7 +5839,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5826
5839
  name: "track",
5827
5840
  kind: "message",
5828
5841
  T: Vt
5829
- }]), tu = /* @__PURE__ */ b.makeMessageType("livekit.TrackUnpublishedResponse", () => [{
5842
+ }]), nu = /* @__PURE__ */ b.makeMessageType("livekit.TrackUnpublishedResponse", () => [{
5830
5843
  no: 1,
5831
5844
  name: "track_sid",
5832
5845
  kind: "scalar",
@@ -5860,7 +5873,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5860
5873
  T: 9
5861
5874
  /* ScalarType.STRING */
5862
5875
  }
5863
- }]), nu = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantUpdate", () => [{
5876
+ }]), iu = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantUpdate", () => [{
5864
5877
  no: 1,
5865
5878
  name: "participants",
5866
5879
  kind: "message",
@@ -5906,7 +5919,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5906
5919
  no: 3,
5907
5920
  name: "options",
5908
5921
  kind: "message",
5909
- T: jl
5922
+ T: Wl
5910
5923
  }], {
5911
5924
  localName: "UpdateDataSubscription_Update"
5912
5925
  }), No = /* @__PURE__ */ b.makeMessageType("livekit.UpdateTrackSettings", () => [{
@@ -6000,7 +6013,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6000
6013
  no: 4,
6001
6014
  name: "regions",
6002
6015
  kind: "message",
6003
- T: mu
6016
+ T: gu
6004
6017
  }]), Ht = /* @__PURE__ */ b.makeEnum("livekit.LeaveRequest.Action", [{
6005
6018
  no: 0,
6006
6019
  name: "DISCONNECT"
@@ -6068,18 +6081,18 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6068
6081
  kind: "scalar",
6069
6082
  T: 9
6070
6083
  /* ScalarType.STRING */
6071
- }]), iu = /* @__PURE__ */ b.makeMessageType("livekit.SpeakersChanged", () => [{
6084
+ }]), su = /* @__PURE__ */ b.makeMessageType("livekit.SpeakersChanged", () => [{
6072
6085
  no: 1,
6073
6086
  name: "speakers",
6074
6087
  kind: "message",
6075
6088
  T: To,
6076
6089
  repeated: !0
6077
- }]), su = /* @__PURE__ */ b.makeMessageType("livekit.RoomUpdate", () => [{
6090
+ }]), ru = /* @__PURE__ */ b.makeMessageType("livekit.RoomUpdate", () => [{
6078
6091
  no: 1,
6079
6092
  name: "room",
6080
6093
  kind: "message",
6081
6094
  T: yi
6082
- }]), ru = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityInfo", () => [{
6095
+ }]), au = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityInfo", () => [{
6083
6096
  no: 1,
6084
6097
  name: "participant_sid",
6085
6098
  kind: "scalar",
@@ -6096,13 +6109,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6096
6109
  kind: "scalar",
6097
6110
  T: 2
6098
6111
  /* ScalarType.FLOAT */
6099
- }]), au = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityUpdate", () => [{
6112
+ }]), ou = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityUpdate", () => [{
6100
6113
  no: 1,
6101
6114
  name: "updates",
6102
6115
  kind: "message",
6103
- T: ru,
6116
+ T: au,
6104
6117
  repeated: !0
6105
- }]), ou = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateInfo", () => [{
6118
+ }]), cu = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateInfo", () => [{
6106
6119
  no: 1,
6107
6120
  name: "participant_sid",
6108
6121
  kind: "scalar",
@@ -6119,11 +6132,11 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6119
6132
  name: "state",
6120
6133
  kind: "enum",
6121
6134
  T: b.getEnumType(vs)
6122
- }]), cu = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateUpdate", () => [{
6135
+ }]), du = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateUpdate", () => [{
6123
6136
  no: 1,
6124
6137
  name: "stream_states",
6125
6138
  kind: "message",
6126
- T: ou,
6139
+ T: cu,
6127
6140
  repeated: !0
6128
6141
  }]), tr = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQuality", () => [{
6129
6142
  no: 1,
@@ -6136,7 +6149,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6136
6149
  kind: "scalar",
6137
6150
  T: 8
6138
6151
  /* ScalarType.BOOL */
6139
- }]), du = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedCodec", () => [{
6152
+ }]), lu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedCodec", () => [{
6140
6153
  no: 1,
6141
6154
  name: "codec",
6142
6155
  kind: "scalar",
@@ -6148,7 +6161,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6148
6161
  kind: "message",
6149
6162
  T: tr,
6150
6163
  repeated: !0
6151
- }]), lu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQualityUpdate", () => [{
6164
+ }]), uu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQualityUpdate", () => [{
6152
6165
  no: 1,
6153
6166
  name: "track_sid",
6154
6167
  kind: "scalar",
@@ -6164,9 +6177,9 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6164
6177
  no: 3,
6165
6178
  name: "subscribed_codecs",
6166
6179
  kind: "message",
6167
- T: du,
6180
+ T: lu,
6168
6181
  repeated: !0
6169
- }]), uu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodecUpdate", () => [{
6182
+ }]), hu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodecUpdate", () => [{
6170
6183
  no: 1,
6171
6184
  name: "track_sid",
6172
6185
  kind: "scalar",
@@ -6176,7 +6189,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6176
6189
  no: 2,
6177
6190
  name: "subscribed_audio_codecs",
6178
6191
  kind: "message",
6179
- T: zl,
6192
+ T: Jl,
6180
6193
  repeated: !0
6181
6194
  }]), Vo = /* @__PURE__ */ b.makeMessageType("livekit.TrackPermission", () => [{
6182
6195
  no: 1,
@@ -6214,7 +6227,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6214
6227
  kind: "message",
6215
6228
  T: Vo,
6216
6229
  repeated: !0
6217
- }]), hu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionPermissionUpdate", () => [{
6230
+ }]), pu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionPermissionUpdate", () => [{
6218
6231
  no: 1,
6219
6232
  name: "participant_sid",
6220
6233
  kind: "scalar",
@@ -6232,7 +6245,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6232
6245
  kind: "scalar",
6233
6246
  T: 8
6234
6247
  /* ScalarType.BOOL */
6235
- }]), pu = /* @__PURE__ */ b.makeMessageType("livekit.RoomMovedResponse", () => [{
6248
+ }]), fu = /* @__PURE__ */ b.makeMessageType("livekit.RoomMovedResponse", () => [{
6236
6249
  no: 1,
6237
6250
  name: "room",
6238
6251
  kind: "message",
@@ -6356,7 +6369,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6356
6369
  no: 5,
6357
6370
  name: "switch_candidate_protocol",
6358
6371
  kind: "enum",
6359
- T: b.getEnumType(Jl),
6372
+ T: b.getEnumType($l),
6360
6373
  oneof: "scenario"
6361
6374
  }, {
6362
6375
  no: 6,
@@ -6394,7 +6407,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6394
6407
  kind: "scalar",
6395
6408
  T: 3
6396
6409
  /* ScalarType.INT64 */
6397
- }]), fu = /* @__PURE__ */ b.makeMessageType("livekit.Pong", () => [{
6410
+ }]), mu = /* @__PURE__ */ b.makeMessageType("livekit.Pong", () => [{
6398
6411
  no: 1,
6399
6412
  name: "last_ping_timestamp",
6400
6413
  kind: "scalar",
@@ -6406,13 +6419,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6406
6419
  kind: "scalar",
6407
6420
  T: 3
6408
6421
  /* ScalarType.INT64 */
6409
- }]), mu = /* @__PURE__ */ b.makeMessageType("livekit.RegionSettings", () => [{
6422
+ }]), gu = /* @__PURE__ */ b.makeMessageType("livekit.RegionSettings", () => [{
6410
6423
  no: 1,
6411
6424
  name: "regions",
6412
6425
  kind: "message",
6413
- T: gu,
6426
+ T: vu,
6414
6427
  repeated: !0
6415
- }]), gu = /* @__PURE__ */ b.makeMessageType("livekit.RegionInfo", () => [{
6428
+ }]), vu = /* @__PURE__ */ b.makeMessageType("livekit.RegionInfo", () => [{
6416
6429
  no: 1,
6417
6430
  name: "region",
6418
6431
  kind: "scalar",
@@ -6430,7 +6443,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6430
6443
  kind: "scalar",
6431
6444
  T: 3
6432
6445
  /* ScalarType.INT64 */
6433
- }]), vu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionResponse", () => [{
6446
+ }]), bu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionResponse", () => [{
6434
6447
  no: 1,
6435
6448
  name: "track_sid",
6436
6449
  kind: "scalar",
@@ -6440,8 +6453,8 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6440
6453
  no: 2,
6441
6454
  name: "err",
6442
6455
  kind: "enum",
6443
- T: b.getEnumType(Fl)
6444
- }]), bu = /* @__PURE__ */ b.makeMessageType("livekit.RequestResponse", () => [{
6456
+ T: b.getEnumType(Bl)
6457
+ }]), yu = /* @__PURE__ */ b.makeMessageType("livekit.RequestResponse", () => [{
6445
6458
  no: 1,
6446
6459
  name: "request_id",
6447
6460
  kind: "scalar",
@@ -6539,7 +6552,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6539
6552
  }, {
6540
6553
  no: 10,
6541
6554
  name: "DUPLICATE_NAME"
6542
- }]), yu = /* @__PURE__ */ b.makeMessageType("livekit.TrackSubscribed", () => [{
6555
+ }]), ku = /* @__PURE__ */ b.makeMessageType("livekit.TrackSubscribed", () => [{
6543
6556
  no: 1,
6544
6557
  name: "track_sid",
6545
6558
  kind: "scalar",
@@ -6575,7 +6588,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6575
6588
  kind: "scalar",
6576
6589
  T: 8,
6577
6590
  opt: !0
6578
- }]), ku = /* @__PURE__ */ b.makeMessageType("livekit.JoinRequest", () => [{
6591
+ }]), Tu = /* @__PURE__ */ b.makeMessageType("livekit.JoinRequest", () => [{
6579
6592
  no: 1,
6580
6593
  name: "client_info",
6581
6594
  kind: "message",
@@ -6634,7 +6647,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6634
6647
  name: "sync_state",
6635
6648
  kind: "message",
6636
6649
  T: nr
6637
- }]), Tu = /* @__PURE__ */ b.makeMessageType("livekit.WrappedJoinRequest", () => [{
6650
+ }]), Su = /* @__PURE__ */ b.makeMessageType("livekit.WrappedJoinRequest", () => [{
6638
6651
  no: 1,
6639
6652
  name: "compression",
6640
6653
  kind: "enum",
@@ -6651,7 +6664,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6651
6664
  }, {
6652
6665
  no: 1,
6653
6666
  name: "GZIP"
6654
- }]), Su = /* @__PURE__ */ b.makeMessageType("livekit.MediaSectionsRequirement", () => [{
6667
+ }]), Cu = /* @__PURE__ */ b.makeMessageType("livekit.MediaSectionsRequirement", () => [{
6655
6668
  no: 1,
6656
6669
  name: "num_audios",
6657
6670
  kind: "scalar",
@@ -6664,15 +6677,15 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6664
6677
  T: 13
6665
6678
  /* ScalarType.UINT32 */
6666
6679
  }]);
6667
- function Cu(i) {
6680
+ function _u(i) {
6668
6681
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
6669
6682
  }
6670
- var Kn = { exports: {} }, _u = Kn.exports, Kr;
6671
- function wu() {
6683
+ var Kn = { exports: {} }, wu = Kn.exports, Kr;
6684
+ function Eu() {
6672
6685
  return Kr || (Kr = 1, function(i) {
6673
6686
  (function(e, t) {
6674
6687
  i.exports ? i.exports = t() : e.log = t();
6675
- })(_u, function() {
6688
+ })(wu, function() {
6676
6689
  var e = function() {
6677
6690
  }, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), s = ["trace", "debug", "info", "warn", "error"], r = {}, a = null;
6678
6691
  function o(m, T) {
@@ -6710,7 +6723,7 @@ function wu() {
6710
6723
  return c(m) || u.apply(this, arguments);
6711
6724
  }
6712
6725
  function p(m, T) {
6713
- var k = this, S, L, v, y = "loglevel";
6726
+ var k = this, S, N, v, y = "loglevel";
6714
6727
  typeof m == "string" ? y += ":" + m : typeof m == "symbol" && (y = void 0);
6715
6728
  function C(O) {
6716
6729
  var B = (s[O] || "silent").toUpperCase();
@@ -6742,7 +6755,7 @@ function wu() {
6742
6755
  return k.levels[O] === void 0 && (O = void 0), O;
6743
6756
  }
6744
6757
  }
6745
- function x() {
6758
+ function L() {
6746
6759
  if (!(typeof window === t || !y)) {
6747
6760
  try {
6748
6761
  window.localStorage.removeItem(y);
@@ -6768,13 +6781,13 @@ function wu() {
6768
6781
  ERROR: 4,
6769
6782
  SILENT: 5
6770
6783
  }, k.methodFactory = T || h, k.getLevel = function() {
6771
- return v ?? L ?? S;
6784
+ return v ?? N ?? S;
6772
6785
  }, k.setLevel = function(O, B) {
6773
6786
  return v = V(O), B !== !1 && C(v), l.call(k);
6774
6787
  }, k.setDefaultLevel = function(O) {
6775
- L = V(O), I() || k.setLevel(O, !1);
6788
+ N = V(O), I() || k.setLevel(O, !1);
6776
6789
  }, k.resetLevel = function() {
6777
- v = null, x(), l.call(k);
6790
+ v = null, L(), l.call(k);
6778
6791
  }, k.enableAll = function(O) {
6779
6792
  k.setLevel(k.levels.TRACE, O);
6780
6793
  }, k.disableAll = function(O) {
@@ -6802,7 +6815,7 @@ function wu() {
6802
6815
  });
6803
6816
  }(Kn)), Kn.exports;
6804
6817
  }
6805
- var Ei = wu(), ks;
6818
+ var Ei = Eu(), ks;
6806
6819
  (function(i) {
6807
6820
  i[i.trace = 0] = "trace", i[i.debug = 1] = "debug", i[i.info = 2] = "info", i[i.warn = 3] = "warn", i[i.error = 4] = "error", i[i.silent = 5] = "silent";
6808
6821
  })(ks || (ks = {}));
@@ -6815,19 +6828,19 @@ Object.values(pe).map((i) => Ei.getLogger(i));
6815
6828
  q.setDefaultLevel(ks.info);
6816
6829
  function Re(i, e) {
6817
6830
  const t = Ei.getLogger(i);
6818
- return t.setDefaultLevel(q.getLevel()), e ? Eu(t, e) : t;
6831
+ return t.setDefaultLevel(q.getLevel()), e ? Pu(t, e) : t;
6819
6832
  }
6820
- function Eu(i, e) {
6833
+ function Pu(i, e) {
6821
6834
  const t = (s) => (r, a) => {
6822
6835
  const o = e(), d = o || a ? Object.assign(Object.assign({}, o), a) : void 0;
6823
6836
  i[s](r, d);
6824
6837
  }, n = Object.create(i);
6825
6838
  return n.trace = t("trace"), n.debug = t("debug"), n.info = t("info"), n.warn = t("warn"), n.error = t("error"), n;
6826
6839
  }
6827
- const Pu = Ei.getLogger(pe.E2EE), on = 7e3, Ru = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, on, on, on, on, on];
6828
- class Iu {
6840
+ const Ru = Ei.getLogger(pe.E2EE), on = 7e3, Iu = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, on, on, on, on, on];
6841
+ class Mu {
6829
6842
  constructor(e) {
6830
- this._retryDelays = e !== void 0 ? [...e] : Ru;
6843
+ this._retryDelays = e !== void 0 ? [...e] : Iu;
6831
6844
  }
6832
6845
  nextRetryDelayInMs(e) {
6833
6846
  if (e.retryCount >= this._retryDelays.length) return null;
@@ -6835,7 +6848,7 @@ class Iu {
6835
6848
  return e.retryCount <= 1 ? t : t + Math.random() * 1e3;
6836
6849
  }
6837
6850
  }
6838
- function Mu(i, e) {
6851
+ function Du(i, e) {
6839
6852
  var t = {};
6840
6853
  for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
6841
6854
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
@@ -6883,7 +6896,7 @@ function Gr(i) {
6883
6896
  function Zt(i) {
6884
6897
  return this instanceof Zt ? (this.v = i, this) : new Zt(i);
6885
6898
  }
6886
- function Du(i, e, t) {
6899
+ function Au(i, e, t) {
6887
6900
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6888
6901
  var n = t.apply(i, e || []), s, r = [];
6889
6902
  return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), o("next"), o("throw"), o("return", a), s[Symbol.asyncIterator] = function() {
@@ -6921,7 +6934,7 @@ function Du(i, e, t) {
6921
6934
  p(g), r.shift(), r.length && d(r[0][0], r[0][1]);
6922
6935
  }
6923
6936
  }
6924
- function Au(i) {
6937
+ function Ou(i) {
6925
6938
  var e, t;
6926
6939
  return e = {}, n("next"), n("throw", function(s) {
6927
6940
  throw s;
@@ -6954,7 +6967,7 @@ function Ve(i) {
6954
6967
  }
6955
6968
  }
6956
6969
  var Un = { exports: {} }, zr;
6957
- function Ou() {
6970
+ function xu() {
6958
6971
  if (zr) return Un.exports;
6959
6972
  zr = 1;
6960
6973
  var i = typeof Reflect == "object" ? Reflect : null, e = i && typeof i.apply == "function" ? i.apply : function(y, C, I) {
@@ -7003,10 +7016,10 @@ function Ou() {
7003
7016
  return d(this);
7004
7017
  }, r.prototype.emit = function(y) {
7005
7018
  for (var C = [], I = 1; I < arguments.length; I++) C.push(arguments[I]);
7006
- var x = y === "error", V = this._events;
7007
- if (V !== void 0) x = x && V.error === void 0;
7008
- else if (!x) return !1;
7009
- if (x) {
7019
+ var L = y === "error", V = this._events;
7020
+ if (V !== void 0) L = L && V.error === void 0;
7021
+ else if (!L) return !1;
7022
+ if (L) {
7010
7023
  var A;
7011
7024
  if (C.length > 0 && (A = C[0]), A instanceof Error)
7012
7025
  throw A;
@@ -7022,10 +7035,10 @@ function Ou() {
7022
7035
  return !0;
7023
7036
  };
7024
7037
  function c(v, y, C, I) {
7025
- var x, V, A;
7038
+ var L, V, A;
7026
7039
  if (o(C), V = v._events, V === void 0 ? (V = v._events = /* @__PURE__ */ Object.create(null), v._eventsCount = 0) : (V.newListener !== void 0 && (v.emit("newListener", y, C.listener ? C.listener : C), V = v._events), A = V[y]), A === void 0)
7027
7040
  A = V[y] = C, ++v._eventsCount;
7028
- else if (typeof A == "function" ? A = V[y] = I ? [C, A] : [A, C] : I ? A.unshift(C) : A.push(C), x = d(v), x > 0 && A.length > x && !A.warned) {
7041
+ else if (typeof A == "function" ? A = V[y] = I ? [C, A] : [A, C] : I ? A.unshift(C) : A.push(C), L = d(v), L > 0 && A.length > L && !A.warned) {
7029
7042
  A.warned = !0;
7030
7043
  var O = new Error("Possible EventEmitter memory leak detected. " + A.length + " " + String(y) + " listeners added. Use emitter.setMaxListeners() to increase limit");
7031
7044
  O.name = "MaxListenersExceededWarning", O.emitter = v, O.type = y, O.count = A.length;
@@ -7048,19 +7061,19 @@ function Ou() {
7048
7061
  target: v,
7049
7062
  type: y,
7050
7063
  listener: C
7051
- }, x = l.bind(I);
7052
- return x.listener = C, I.wrapFn = x, x;
7064
+ }, L = l.bind(I);
7065
+ return L.listener = C, I.wrapFn = L, L;
7053
7066
  }
7054
7067
  r.prototype.once = function(y, C) {
7055
7068
  return o(C), this.on(y, u(this, y, C)), this;
7056
7069
  }, r.prototype.prependOnceListener = function(y, C) {
7057
7070
  return o(C), this.prependListener(y, u(this, y, C)), this;
7058
7071
  }, r.prototype.removeListener = function(y, C) {
7059
- var I, x, V, A, O;
7060
- if (o(C), x = this._events, x === void 0) return this;
7061
- if (I = x[y], I === void 0) return this;
7072
+ var I, L, V, A, O;
7073
+ if (o(C), L = this._events, L === void 0) return this;
7074
+ if (I = L[y], I === void 0) return this;
7062
7075
  if (I === C || I.listener === C)
7063
- --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete x[y], x.removeListener && this.emit("removeListener", y, I.listener || C));
7076
+ --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete L[y], L.removeListener && this.emit("removeListener", y, I.listener || C));
7064
7077
  else if (typeof I != "function") {
7065
7078
  for (V = -1, A = I.length - 1; A >= 0; A--)
7066
7079
  if (I[A] === C || I[A].listener === C) {
@@ -7068,32 +7081,32 @@ function Ou() {
7068
7081
  break;
7069
7082
  }
7070
7083
  if (V < 0) return this;
7071
- V === 0 ? I.shift() : m(I, V), I.length === 1 && (x[y] = I[0]), x.removeListener !== void 0 && this.emit("removeListener", y, O || C);
7084
+ V === 0 ? I.shift() : m(I, V), I.length === 1 && (L[y] = I[0]), L.removeListener !== void 0 && this.emit("removeListener", y, O || C);
7072
7085
  }
7073
7086
  return this;
7074
7087
  }, r.prototype.off = r.prototype.removeListener, r.prototype.removeAllListeners = function(y) {
7075
- var C, I, x;
7088
+ var C, I, L;
7076
7089
  if (I = this._events, I === void 0) return this;
7077
7090
  if (I.removeListener === void 0)
7078
7091
  return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : I[y] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete I[y]), this;
7079
7092
  if (arguments.length === 0) {
7080
7093
  var V = Object.keys(I), A;
7081
- for (x = 0; x < V.length; ++x)
7082
- A = V[x], A !== "removeListener" && this.removeAllListeners(A);
7094
+ for (L = 0; L < V.length; ++L)
7095
+ A = V[L], A !== "removeListener" && this.removeAllListeners(A);
7083
7096
  return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
7084
7097
  }
7085
7098
  if (C = I[y], typeof C == "function")
7086
7099
  this.removeListener(y, C);
7087
7100
  else if (C !== void 0)
7088
- for (x = C.length - 1; x >= 0; x--)
7089
- this.removeListener(y, C[x]);
7101
+ for (L = C.length - 1; L >= 0; L--)
7102
+ this.removeListener(y, C[L]);
7090
7103
  return this;
7091
7104
  };
7092
7105
  function h(v, y, C) {
7093
7106
  var I = v._events;
7094
7107
  if (I === void 0) return [];
7095
- var x = I[y];
7096
- return x === void 0 ? [] : typeof x == "function" ? C ? [x.listener || x] : [x] : C ? T(x) : g(x, x.length);
7108
+ var L = I[y];
7109
+ return L === void 0 ? [] : typeof L == "function" ? C ? [L.listener || L] : [L] : C ? T(L) : g(L, L.length);
7097
7110
  }
7098
7111
  r.prototype.listeners = function(y) {
7099
7112
  return h(this, y, !0);
@@ -7131,36 +7144,36 @@ function Ou() {
7131
7144
  }
7132
7145
  function k(v, y) {
7133
7146
  return new Promise(function(C, I) {
7134
- function x(A) {
7147
+ function L(A) {
7135
7148
  v.removeListener(y, V), I(A);
7136
7149
  }
7137
7150
  function V() {
7138
- typeof v.removeListener == "function" && v.removeListener("error", x), C([].slice.call(arguments));
7151
+ typeof v.removeListener == "function" && v.removeListener("error", L), C([].slice.call(arguments));
7139
7152
  }
7140
- L(v, y, V, {
7153
+ N(v, y, V, {
7141
7154
  once: !0
7142
- }), y !== "error" && S(v, x, {
7155
+ }), y !== "error" && S(v, L, {
7143
7156
  once: !0
7144
7157
  });
7145
7158
  });
7146
7159
  }
7147
7160
  function S(v, y, C) {
7148
- typeof v.on == "function" && L(v, "error", y, C);
7161
+ typeof v.on == "function" && N(v, "error", y, C);
7149
7162
  }
7150
- function L(v, y, C, I) {
7163
+ function N(v, y, C, I) {
7151
7164
  if (typeof v.on == "function")
7152
7165
  I.once ? v.once(y, C) : v.on(y, C);
7153
7166
  else if (typeof v.addEventListener == "function")
7154
- v.addEventListener(y, function x(V) {
7155
- I.once && v.removeEventListener(y, x), C(V);
7167
+ v.addEventListener(y, function L(V) {
7168
+ I.once && v.removeEventListener(y, L), C(V);
7156
7169
  });
7157
7170
  else
7158
7171
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof v);
7159
7172
  }
7160
7173
  return Un.exports;
7161
7174
  }
7162
- var Ie = Ou();
7163
- let Go = !0, xu = !0;
7175
+ var Ie = xu();
7176
+ let Go = !0, Lu = !0;
7164
7177
  function mn(i, e, t) {
7165
7178
  const n = i.match(e);
7166
7179
  return n && n.length >= t && parseFloat(n[t], 10);
@@ -7200,15 +7213,15 @@ function Ut(i, e, t) {
7200
7213
  configurable: !0
7201
7214
  });
7202
7215
  }
7203
- function Lu(i) {
7216
+ function Nu(i) {
7204
7217
  return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (Go = i, i ? "adapter.js logging disabled" : "adapter.js logging enabled");
7205
7218
  }
7206
- function Nu(i) {
7207
- return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (xu = !i, "adapter.js deprecation warnings " + (i ? "disabled" : "enabled"));
7219
+ function Uu(i) {
7220
+ return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (Lu = !i, "adapter.js deprecation warnings " + (i ? "disabled" : "enabled"));
7208
7221
  }
7209
7222
  function zo() {
7210
7223
  }
7211
- function Uu(i) {
7224
+ function Fu(i) {
7212
7225
  const e = {
7213
7226
  browser: null,
7214
7227
  version: null
@@ -7693,7 +7706,7 @@ function ic(i, e) {
7693
7706
  }
7694
7707
  }
7695
7708
  }
7696
- function Fu(i, e) {
7709
+ function Bu(i, e) {
7697
7710
  i.navigator.mediaDevices && "getDisplayMedia" in i.navigator.mediaDevices || i.navigator.mediaDevices && (i.navigator.mediaDevices.getDisplayMedia = function(n) {
7698
7711
  if (!(n && n.video)) {
7699
7712
  const s = new DOMException("getDisplayMedia without video constraints is undefined");
@@ -7850,7 +7863,7 @@ function pc(i) {
7850
7863
  }) : e.apply(this, arguments);
7851
7864
  };
7852
7865
  }
7853
- var Xr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAddTransceiver: lc, shimCreateAnswer: pc, shimCreateOffer: hc, shimGetDisplayMedia: Fu, shimGetParameters: uc, shimGetStats: rc, shimGetUserMedia: ic, shimOnTrack: sc, shimPeerConnection: Cs, shimRTCDataChannel: dc, shimReceiverGetStats: oc, shimRemoveStream: cc, shimSenderGetStats: ac });
7866
+ var Xr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAddTransceiver: lc, shimCreateAnswer: pc, shimCreateOffer: hc, shimGetDisplayMedia: Bu, shimGetParameters: uc, shimGetStats: rc, shimGetUserMedia: ic, shimOnTrack: sc, shimPeerConnection: Cs, shimRTCDataChannel: dc, shimReceiverGetStats: oc, shimRemoveStream: cc, shimSenderGetStats: ac });
7854
7867
  function fc(i) {
7855
7868
  if (!(typeof i != "object" || !i.RTCPeerConnection)) {
7856
7869
  if ("getLocalStreams" in i.RTCPeerConnection.prototype || (i.RTCPeerConnection.prototype.getLocalStreams = function() {
@@ -8003,7 +8016,7 @@ function Sc(i) {
8003
8016
  typeof i != "object" || i.AudioContext || (i.AudioContext = i.webkitAudioContext);
8004
8017
  }
8005
8018
  var Zr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAudioContext: Sc, shimCallbacksAPI: gc, shimConstraints: bc, shimCreateOfferLegacy: Tc, shimGetUserMedia: vc, shimLocalStreamsAPI: fc, shimRTCIceServerUrls: yc, shimRemoteStreamsAPI: mc, shimTrackEventTransceiver: kc }), zi = { exports: {} }, ea;
8006
- function Bu() {
8019
+ function Vu() {
8007
8020
  return ea || (ea = 1, function(i) {
8008
8021
  const e = {};
8009
8022
  e.generateIdentifier = function() {
@@ -8374,7 +8387,7 @@ t=0 0\r
8374
8387
  }, i.exports = e;
8375
8388
  }(zi)), zi.exports;
8376
8389
  }
8377
- var Cc = Bu(), Kt = /* @__PURE__ */ Cu(Cc), Vu = /* @__PURE__ */ Nd({ __proto__: null, default: Kt }, [Cc]);
8390
+ var Cc = Vu(), Kt = /* @__PURE__ */ _u(Cc), qu = /* @__PURE__ */ Ud({ __proto__: null, default: Kt }, [Cc]);
8378
8391
  function Gn(i) {
8379
8392
  if (!i.RTCIceCandidate || i.RTCIceCandidate && "foundation" in i.RTCIceCandidate.prototype)
8380
8393
  return;
@@ -8572,21 +8585,21 @@ function Yn(i, e) {
8572
8585
  return s.sdp || s.type !== "offer" && s.type !== "answer" ? t.apply(this, [s]) : (s.type === "offer" ? this.createOffer : this.createAnswer).apply(this).then((a) => t.apply(this, [a]));
8573
8586
  });
8574
8587
  }
8575
- var qu = /* @__PURE__ */ Object.freeze({ __proto__: null, removeExtmapAllowMixed: Es, shimAddIceCandidateNullOrEmpty: $n, shimConnectionState: ws, shimMaxMessageSize: zn, shimParameterlessSetLocalDescription: Yn, shimRTCIceCandidate: Gn, shimRTCIceCandidateRelayProtocol: _s, shimSendThrowTypeError: Jn });
8576
- function ju() {
8588
+ var ju = /* @__PURE__ */ Object.freeze({ __proto__: null, removeExtmapAllowMixed: Es, shimAddIceCandidateNullOrEmpty: $n, shimConnectionState: ws, shimMaxMessageSize: zn, shimParameterlessSetLocalDescription: Yn, shimRTCIceCandidate: Gn, shimRTCIceCandidateRelayProtocol: _s, shimSendThrowTypeError: Jn });
8589
+ function Wu() {
8577
8590
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = i.window, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
8578
8591
  shimChrome: !0,
8579
8592
  shimFirefox: !0,
8580
8593
  shimSafari: !0
8581
8594
  };
8582
- const n = zo, s = Uu(e), r = {
8595
+ const n = zo, s = Fu(e), r = {
8583
8596
  browserDetails: s,
8584
- commonShim: qu,
8597
+ commonShim: ju,
8585
8598
  extractVersion: mn,
8586
- disableLog: Lu,
8587
- disableWarnings: Nu,
8599
+ disableLog: Nu,
8600
+ disableWarnings: Uu,
8588
8601
  // Expose sdp as a convenience. For production apps include directly.
8589
- sdp: Vu
8602
+ sdp: qu
8590
8603
  };
8591
8604
  switch (s.browser) {
8592
8605
  case "chrome":
@@ -8612,7 +8625,7 @@ function ju() {
8612
8625
  }
8613
8626
  return r;
8614
8627
  }
8615
- ju({
8628
+ Wu({
8616
8629
  window: typeof window > "u" ? void 0 : window
8617
8630
  });
8618
8631
  var Ps, _c;
@@ -8636,7 +8649,7 @@ class Se extends (_c = Promise) {
8636
8649
  }
8637
8650
  Ps = Se;
8638
8651
  Se.resolve = (i) => Reflect.get(_c, "resolve", Ps).call(Ps, i);
8639
- const Wu = /version\/(\d+(\.?_?\d+)+)/i;
8652
+ const Hu = /version\/(\d+(\.?_?\d+)+)/i;
8640
8653
  let Ji;
8641
8654
  function Ce(i) {
8642
8655
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
@@ -8644,12 +8657,12 @@ function Ce(i) {
8644
8657
  return;
8645
8658
  const t = navigator.userAgent.toLowerCase();
8646
8659
  if (Ji === void 0 || e) {
8647
- const n = Hu.find((s) => s.test.test(t));
8660
+ const n = Ku.find((s) => s.test.test(t));
8648
8661
  Ji = n == null ? void 0 : n.describe(t);
8649
8662
  }
8650
8663
  return Ji;
8651
8664
  }
8652
- const Hu = [
8665
+ const Ku = [
8653
8666
  {
8654
8667
  test: /firefox|iceweasel|fxios/i,
8655
8668
  describe(i) {
@@ -8678,7 +8691,7 @@ const Hu = [
8678
8691
  describe(i) {
8679
8692
  return {
8680
8693
  name: "Safari",
8681
- version: Qn(Wu, i),
8694
+ version: Qn(Hu, i),
8682
8695
  os: i.includes("mobile/") ? "iOS" : "macOS",
8683
8696
  osVersion: $i(i)
8684
8697
  };
@@ -8693,8 +8706,8 @@ function Qn(i, e) {
8693
8706
  function $i(i) {
8694
8707
  return i.includes("mac os") ? Qn(/\(.+?(\d+_\d+(:?_\d+)?)/, i, 1).replace(/_/g, ".") : void 0;
8695
8708
  }
8696
- var Ku = "2.20.0";
8697
- const Gu = Ku, zu = 17, wc = 0, di = 1, Ju = di;
8709
+ var Gu = "2.20.0";
8710
+ const zu = Gu, Ju = 17, wc = 0, di = 1, $u = di;
8698
8711
  class lt extends Error {
8699
8712
  constructor(e, t, n) {
8700
8713
  super(t || "an error has occurred"), this.name = "LiveKitError", this.code = e, typeof (n == null ? void 0 : n.cause) < "u" && (this.cause = n == null ? void 0 : n.cause);
@@ -8745,7 +8758,7 @@ class ct extends lt {
8745
8758
  super(20, e ?? "track is invalid"), this.name = "TrackInvalidError";
8746
8759
  }
8747
8760
  }
8748
- class $u extends lt {
8761
+ class Yu extends lt {
8749
8762
  constructor(e) {
8750
8763
  super(10, e ?? "unsupported server"), this.name = "UnsupportedServer";
8751
8764
  }
@@ -8760,7 +8773,7 @@ class Dt extends lt {
8760
8773
  super(13, e ?? "unable to negotiate"), this.name = "NegotiationError";
8761
8774
  }
8762
8775
  }
8763
- class Yu extends lt {
8776
+ class Qu extends lt {
8764
8777
  constructor(e) {
8765
8778
  super(14, e ?? "unable to publish data"), this.name = "PublishDataError";
8766
8779
  }
@@ -8831,7 +8844,7 @@ var R;
8831
8844
  (function(i) {
8832
8845
  i.Message = "message", i.Muted = "muted", i.Unmuted = "unmuted", i.Restarted = "restarted", i.Ended = "ended", i.Subscribed = "subscribed", i.Unsubscribed = "unsubscribed", i.CpuConstrained = "cpuConstrained", i.UpdateSettings = "updateSettings", i.UpdateSubscription = "updateSubscription", i.AudioPlaybackStarted = "audioPlaybackStarted", i.AudioPlaybackFailed = "audioPlaybackFailed", i.AudioSilenceDetected = "audioSilenceDetected", i.VisibilityChanged = "visibilityChanged", i.VideoDimensionsChanged = "videoDimensionsChanged", i.VideoPlaybackStarted = "videoPlaybackStarted", i.VideoPlaybackFailed = "videoPlaybackFailed", i.ElementAttached = "elementAttached", i.ElementDetached = "elementDetached", i.UpstreamPaused = "upstreamPaused", i.UpstreamResumed = "upstreamResumed", i.SubscriptionPermissionChanged = "subscriptionPermissionChanged", i.SubscriptionStatusChanged = "subscriptionStatusChanged", i.SubscriptionFailed = "subscriptionFailed", i.TrackProcessorUpdate = "trackProcessorUpdate", i.AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", i.TranscriptionReceived = "transcriptionReceived", i.TimeSyncUpdate = "timeSyncUpdate", i.PreConnectBufferFlushed = "preConnectBufferFlushed";
8833
8846
  })(R || (R = {}));
8834
- function Qu(i) {
8847
+ function Xu(i) {
8835
8848
  return typeof i > "u" ? i : typeof structuredClone == "function" ? typeof i == "object" && i !== null ? structuredClone(Object.assign({}, i)) : structuredClone(i) : JSON.parse(JSON.stringify(i));
8836
8849
  }
8837
8850
  class $ {
@@ -8860,11 +8873,11 @@ class $ {
8860
8873
  };
8861
8874
  }
8862
8875
  }
8863
- const Xu = ["vp8", "h264"], Zu = ["vp8", "h264", "vp9", "av1", "h265"];
8876
+ const Zu = ["vp8", "h264"], eh = ["vp8", "h264", "vp9", "av1", "h265"];
8864
8877
  function Ec(i) {
8865
- return !!Xu.find((e) => e === i);
8878
+ return !!Zu.find((e) => e === i);
8866
8879
  }
8867
- const eh = Ec;
8880
+ const th = Ec;
8868
8881
  var ia;
8869
8882
  (function(i) {
8870
8883
  i[i.PREFER_REGRESSION = 0] = "PREFER_REGRESSION", i[i.SIMULCAST = 1] = "SIMULCAST", i[i.REGRESSION = 2] = "REGRESSION";
@@ -9008,13 +9021,13 @@ function Ic() {
9008
9021
  return t;
9009
9022
  }
9010
9023
  }
9011
- function th(i) {
9024
+ function nh(i) {
9012
9025
  return i === "audioinput" ? _.Source.Microphone : i === "videoinput" ? _.Source.Camera : _.Source.Unknown;
9013
9026
  }
9014
9027
  function Ds(i) {
9015
9028
  return i === _.Source.Microphone ? "audioinput" : i === _.Source.Camera ? "videoinput" : void 0;
9016
9029
  }
9017
- function nh(i) {
9030
+ function ih(i) {
9018
9031
  var e, t;
9019
9032
  let n = (e = i.video) !== null && e !== void 0 ? e : !0;
9020
9033
  return i.resolution && i.resolution.width > 0 && i.resolution.height > 0 && (n = typeof n == "boolean" ? {} : n, Nt() ? n = Object.assign(Object.assign({}, n), {
@@ -9047,7 +9060,7 @@ function nh(i) {
9047
9060
  function yn(i) {
9048
9061
  return i.split("/")[1].toLowerCase();
9049
9062
  }
9050
- function ih(i) {
9063
+ function sh(i) {
9051
9064
  const e = [];
9052
9065
  return i.forEach((t) => {
9053
9066
  t.track !== void 0 && e.push(new Xs({
@@ -9078,10 +9091,10 @@ function H(i) {
9078
9091
  }, i.track ? H(i.track) : {})
9079
9092
  };
9080
9093
  }
9081
- function sh() {
9094
+ function rh() {
9082
9095
  return typeof RTCRtpReceiver < "u" && typeof RTCRtpReceiver.prototype.getSynchronizationSources == "function";
9083
9096
  }
9084
- function rh(i, e) {
9097
+ function ah(i, e) {
9085
9098
  var t;
9086
9099
  i === void 0 && (i = {}), e === void 0 && (e = {});
9087
9100
  const n = [...Object.keys(e), ...Object.keys(i)], s = {};
@@ -9099,10 +9112,10 @@ function Mc(i) {
9099
9112
  })), {
9100
9113
  audioProcessor: t,
9101
9114
  videoProcessor: n,
9102
- optionsWithoutProcessor: Qu(e)
9115
+ optionsWithoutProcessor: Xu(e)
9103
9116
  };
9104
9117
  }
9105
- function ah(i) {
9118
+ function oh(i) {
9106
9119
  switch (i) {
9107
9120
  case oe.CAMERA:
9108
9121
  return _.Source.Camera;
@@ -9119,11 +9132,11 @@ function ah(i) {
9119
9132
  function sa(i, e) {
9120
9133
  return i.width * i.height < e.width * e.height;
9121
9134
  }
9122
- function oh(i, e) {
9135
+ function ch(i, e) {
9123
9136
  var t;
9124
9137
  return (t = i.layers) === null || t === void 0 ? void 0 : t.find((n) => n.quality === e);
9125
9138
  }
9126
- const ch = 5e3, cn = [];
9139
+ const dh = 5e3, cn = [];
9127
9140
  var Me;
9128
9141
  (function(i) {
9129
9142
  i[i.LOW = 0] = "LOW", i[i.MEDIUM = 1] = "MEDIUM", i[i.HIGH = 2] = "HIGH";
@@ -9144,7 +9157,7 @@ class _ extends Ie.EventEmitter {
9144
9157
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
9145
9158
  var s;
9146
9159
  super(), this.attachedElements = [], this.isMuted = !1, this._streamState = _.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = q, this.appVisibilityChangedListener = () => {
9147
- this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), ch) : this.handleAppVisibilityChanged();
9160
+ this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), dh) : this.handleAppVisibilityChanged();
9148
9161
  }, this.log = Re((s = n.loggerName) !== null && s !== void 0 ? s : pe.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = _.Source.Unknown;
9149
9162
  }
9150
9163
  get logContext() {
@@ -9326,9 +9339,9 @@ function Gt(i, e) {
9326
9339
  }
9327
9340
  i.streamStateFromProto = d;
9328
9341
  })(_ || (_ = {}));
9329
- const dh = "|", ra = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
9330
- function lh(i) {
9331
- const e = i.split(dh);
9342
+ const lh = "|", ra = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
9343
+ function uh(i) {
9344
+ const e = i.split(lh);
9332
9345
  return e.length > 1 ? [e[0], i.substr(e[0].length + 1)] : [i, ""];
9333
9346
  }
9334
9347
  function be(i) {
@@ -9340,7 +9353,7 @@ function As() {
9340
9353
  function Os() {
9341
9354
  return "addTrack" in RTCPeerConnection.prototype;
9342
9355
  }
9343
- function uh() {
9356
+ function hh() {
9344
9357
  if (!("getCapabilities" in RTCRtpSender) || Nt() || Lt())
9345
9358
  return !1;
9346
9359
  const i = RTCRtpSender.getCapabilities("video");
@@ -9354,7 +9367,7 @@ function uh() {
9354
9367
  }
9355
9368
  return e;
9356
9369
  }
9357
- function hh() {
9370
+ function ph() {
9358
9371
  if (!("getCapabilities" in RTCRtpSender) || Lt())
9359
9372
  return !1;
9360
9373
  if (Nt()) {
@@ -9379,20 +9392,20 @@ function qe(i) {
9379
9392
  function xs(i) {
9380
9393
  return !document || Rn() ? !1 : (i || (i = document.createElement("audio")), "setSinkId" in i);
9381
9394
  }
9382
- function ph() {
9395
+ function fh() {
9383
9396
  return typeof RTCPeerConnection > "u" ? !1 : As() || Os();
9384
9397
  }
9385
9398
  function Lt() {
9386
9399
  var i;
9387
9400
  return ((i = Ce()) === null || i === void 0 ? void 0 : i.name) === "Firefox";
9388
9401
  }
9389
- function fh() {
9402
+ function mh() {
9390
9403
  const i = Ce();
9391
9404
  return !!i && i.name === "Chrome" && i.os !== "iOS";
9392
9405
  }
9393
9406
  function Ls() {
9394
9407
  return typeof window < "u" && // @ts-ignore
9395
- typeof window.RTCRtpScriptTransform < "u" && !fh();
9408
+ typeof window.RTCRtpScriptTransform < "u" && !mh();
9396
9409
  }
9397
9410
  function Nt() {
9398
9411
  var i;
@@ -9402,11 +9415,11 @@ function Rn() {
9402
9415
  const i = Ce();
9403
9416
  return (i == null ? void 0 : i.name) === "Safari" || (i == null ? void 0 : i.os) === "iOS";
9404
9417
  }
9405
- function mh() {
9418
+ function gh() {
9406
9419
  const i = Ce();
9407
9420
  return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && et(i.osVersion, "17") >= 0;
9408
9421
  }
9409
- function gh(i) {
9422
+ function vh(i) {
9410
9423
  return i || (i = Ce()), (i == null ? void 0 : i.name) === "Safari" && et(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && et(i.osVersion, "18.3") > 0;
9411
9424
  }
9412
9425
  function Dc() {
@@ -9416,7 +9429,7 @@ function Dc() {
9416
9429
  (e = (i = navigator.userAgentData) === null || i === void 0 ? void 0 : i.mobile) !== null && e !== void 0 ? e : /Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent)
9417
9430
  ) : !1;
9418
9431
  }
9419
- function vh() {
9432
+ function bh() {
9420
9433
  const i = Ce(), e = "17.2";
9421
9434
  if (i)
9422
9435
  return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && et(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && et(i.version, e) >= 0;
@@ -9464,29 +9477,29 @@ function et(i, e) {
9464
9477
  }
9465
9478
  return i === "" && e !== "" ? -1 : e === "" ? 1 : t.length == n.length ? 0 : t.length < n.length ? -1 : 1;
9466
9479
  }
9467
- function bh(i) {
9480
+ function yh(i) {
9468
9481
  for (const e of i)
9469
9482
  e.target.handleResize(e);
9470
9483
  }
9471
- function yh(i) {
9484
+ function kh(i) {
9472
9485
  for (const e of i)
9473
9486
  e.target.handleVisibilityChanged(e);
9474
9487
  }
9475
9488
  let Qi = null;
9476
- const oa = () => (Qi || (Qi = new ResizeObserver(bh)), Qi);
9489
+ const oa = () => (Qi || (Qi = new ResizeObserver(yh)), Qi);
9477
9490
  let Xi = null;
9478
- const ca = () => (Xi || (Xi = new IntersectionObserver(yh, {
9491
+ const ca = () => (Xi || (Xi = new IntersectionObserver(kh, {
9479
9492
  root: null,
9480
9493
  rootMargin: "0px"
9481
9494
  })), Xi);
9482
- function kh(i) {
9495
+ function Th(i) {
9483
9496
  var e;
9484
9497
  const t = new Po({
9485
9498
  capabilities: i,
9486
9499
  sdk: Ro.JS,
9487
- protocol: zu,
9488
- clientProtocol: Ju,
9489
- version: Gu
9500
+ protocol: Ju,
9501
+ clientProtocol: $u,
9502
+ version: zu
9490
9503
  });
9491
9504
  return Ge() && (t.os = (e = Oc()) !== null && e !== void 0 ? e : ""), t;
9492
9505
  }
@@ -9528,8 +9541,8 @@ class he {
9528
9541
  });
9529
9542
  }
9530
9543
  }
9531
- function Th(i) {
9532
- return Zu.includes(i);
9544
+ function Sh(i) {
9545
+ return eh.includes(i);
9533
9546
  }
9534
9547
  function At(i) {
9535
9548
  if (typeof i == "string" || typeof i == "number")
@@ -9542,13 +9555,13 @@ function At(i) {
9542
9555
  return Array.isArray(i.ideal) ? i.ideal[0] : i.ideal;
9543
9556
  throw Error("could not unwrap constraint");
9544
9557
  }
9545
- function Sh(i) {
9558
+ function Ch(i) {
9546
9559
  return i.startsWith("http") ? i.replace(/^(http)/, "ws") : i;
9547
9560
  }
9548
9561
  function In(i) {
9549
9562
  return i.startsWith("ws") ? i.replace(/^(ws)/, "http") : i;
9550
9563
  }
9551
- function Ch(i, e) {
9564
+ function _h(i, e) {
9552
9565
  return i.segments.map((t) => {
9553
9566
  let n = t.id, s = t.text, r = t.language, a = t.startTime, o = t.endTime, d = t.final;
9554
9567
  var c;
@@ -9565,7 +9578,7 @@ function Ch(i, e) {
9565
9578
  };
9566
9579
  });
9567
9580
  }
9568
- function _h(i) {
9581
+ function wh(i) {
9569
9582
  const e = i.id, t = i.timestamp, n = i.message, s = i.editTimestamp;
9570
9583
  return {
9571
9584
  id: e,
@@ -9612,16 +9625,16 @@ function nt(i) {
9612
9625
  function Ns(i) {
9613
9626
  return !!i && !i.isLocal;
9614
9627
  }
9615
- function wh(i) {
9628
+ function Eh(i) {
9616
9629
  return !!i && !i.isLocal;
9617
9630
  }
9618
9631
  function es(i) {
9619
9632
  return Ns(i) && dt(i);
9620
9633
  }
9621
- function Eh(i) {
9634
+ function Ph(i) {
9622
9635
  return i.isLocal;
9623
9636
  }
9624
- function Ph(i, e) {
9637
+ function Rh(i, e) {
9625
9638
  const t = [];
9626
9639
  let n = new TextEncoder().encode(i);
9627
9640
  for (; n.length > e; ) {
@@ -9636,7 +9649,7 @@ function Ph(i, e) {
9636
9649
  }
9637
9650
  return n.length > 0 && t.push(n), t;
9638
9651
  }
9639
- function Rh(i) {
9652
+ function Ih(i) {
9640
9653
  var e;
9641
9654
  const t = i.get("Cache-Control");
9642
9655
  if (t) {
@@ -9648,21 +9661,21 @@ function Rh(i) {
9648
9661
  function xc() {
9649
9662
  return typeof CompressionStream < "u";
9650
9663
  }
9651
- function Ih() {
9664
+ function Mh() {
9652
9665
  return xc() && !Lt();
9653
9666
  }
9654
- function Mh(i, e) {
9667
+ function Dh(i, e) {
9655
9668
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
9656
- const n = Dh(i, e);
9669
+ const n = Ah(i, e);
9657
9670
  return t ? n : ar(n, "v1");
9658
9671
  }
9659
- function Dh(i, e) {
9660
- const t = new URL(Sh(i));
9672
+ function Ah(i, e) {
9673
+ const t = new URL(Ch(i));
9661
9674
  return e.forEach((n, s) => {
9662
9675
  t.searchParams.set(s, n);
9663
9676
  }), ar(t, "rtc");
9664
9677
  }
9665
- function Ah(i) {
9678
+ function Oh(i) {
9666
9679
  const e = new URL(In(i));
9667
9680
  return ar(e, "validate");
9668
9681
  }
@@ -9681,7 +9694,7 @@ function ua(i) {
9681
9694
  return Hr.fromBinary(new Uint8Array(i));
9682
9695
  throw new Error("could not decode websocket message: ".concat(typeof i));
9683
9696
  }
9684
- function Oh(i) {
9697
+ function xh(i) {
9685
9698
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Unknown reason";
9686
9699
  if (!(i instanceof AbortSignal))
9687
9700
  return e;
@@ -9695,11 +9708,11 @@ function Oh(i) {
9695
9708
  return "toString" in t ? t.toString() : e;
9696
9709
  }
9697
9710
  }
9698
- const xh = 10, ln = "lk_e2ee", Lh = "LKFrameEncryptionKey", Nh = {
9711
+ const Lh = 10, ln = "lk_e2ee", Nh = "LKFrameEncryptionKey", Uh = {
9699
9712
  sharedKey: !1,
9700
- ratchetSalt: Lh,
9713
+ ratchetSalt: Nh,
9701
9714
  ratchetWindowSize: 8,
9702
- failureTolerance: xh,
9715
+ failureTolerance: Lh,
9703
9716
  keyringSize: 16,
9704
9717
  keySize: 128
9705
9718
  };
@@ -9719,24 +9732,24 @@ var pa;
9719
9732
  (function(i) {
9720
9733
  i.Error = "cryptorError";
9721
9734
  })(pa || (pa = {}));
9722
- function Uh() {
9723
- return or() || Fh();
9724
- }
9725
9735
  function Fh() {
9736
+ return or() || Bh();
9737
+ }
9738
+ function Bh() {
9726
9739
  return typeof window < "u" && typeof window.RTCRtpScriptTransform < "u";
9727
9740
  }
9728
9741
  function or() {
9729
9742
  return typeof window < "u" && typeof window.RTCRtpSender < "u" && // @ts-ignore
9730
9743
  typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
9731
9744
  }
9732
- function Bh(i) {
9745
+ function Vh(i) {
9733
9746
  var e, t, n, s, r;
9734
9747
  if (((e = i.value) === null || e === void 0 ? void 0 : e.case) !== "sipDtmf" && ((t = i.value) === null || t === void 0 ? void 0 : t.case) !== "metrics" && ((n = i.value) === null || n === void 0 ? void 0 : n.case) !== "speaker" && ((s = i.value) === null || s === void 0 ? void 0 : s.case) !== "transcription" && ((r = i.value) === null || r === void 0 ? void 0 : r.case) !== "encryptedPacket")
9735
9748
  return new ko({
9736
9749
  value: i.value
9737
9750
  });
9738
9751
  }
9739
- class Wf extends Ie.EventEmitter {
9752
+ class Hf extends Ie.EventEmitter {
9740
9753
  constructor() {
9741
9754
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9742
9755
  super(), this.latestManuallySetKeyIndex = 0, this.onKeyRatcheted = (t, n, s) => {
@@ -9745,7 +9758,7 @@ class Wf extends Ie.EventEmitter {
9745
9758
  participantId: n,
9746
9759
  keyIndex: s
9747
9760
  });
9748
- }, this.keyInfoMap = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Nh), e), this.on(kt.KeyRatcheted, this.onKeyRatcheted);
9761
+ }, this.keyInfoMap = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Uh), e), this.on(kt.KeyRatcheted, this.onKeyRatcheted);
9749
9762
  }
9750
9763
  /**
9751
9764
  * callback to invoke once a key has been set for a participant
@@ -9789,11 +9802,11 @@ function Dn(i) {
9789
9802
  function ui(i) {
9790
9803
  return !!(i != null && i.timestamp || i != null && i.frameId);
9791
9804
  }
9792
- function Vh(i) {
9805
+ function qh(i) {
9793
9806
  const e = [];
9794
9807
  return i != null && i.timestamp && e.push(Xt.PTF_USER_TIMESTAMP), i != null && i.frameId && e.push(Xt.PTF_FRAME_ID), e;
9795
9808
  }
9796
- function qh(i) {
9809
+ function jh(i) {
9797
9810
  if (!i || i.length === 0)
9798
9811
  return;
9799
9812
  const e = {};
@@ -9818,7 +9831,7 @@ function cr(i) {
9818
9831
  g[m] = arguments[m];
9819
9832
  const T = this;
9820
9833
  return new Promise((k, S) => {
9821
- const L = function() {
9834
+ const N = function() {
9822
9835
  if (r = void 0, c = Date.now(), !a) {
9823
9836
  const y = i.apply(T, g);
9824
9837
  o && o(y), l.forEach((C) => {
@@ -9827,7 +9840,7 @@ function cr(i) {
9827
9840
  }), l = [];
9828
9841
  }
9829
9842
  }, v = a && r === void 0;
9830
- if (r !== void 0 && ce.clearTimeout(r), r = ce.setTimeout(L, u()), v) {
9843
+ if (r !== void 0 && ce.clearTimeout(r), r = ce.setTimeout(N, u()), v) {
9831
9844
  const y = i.apply(T, g);
9832
9845
  return o && o(y), k(y);
9833
9846
  }
@@ -9910,7 +9923,7 @@ class Nc extends _ {
9910
9923
  }
9911
9924
  /* @internal */
9912
9925
  startMonitor() {
9913
- this.monitorInterval || (this.monitorInterval = setInterval(() => this.monitorReceiver(), dr)), sh() && this.registerTimeSyncUpdate();
9926
+ this.monitorInterval || (this.monitorInterval = setInterval(() => this.monitorReceiver(), dr)), rh() && this.registerTimeSyncUpdate();
9914
9927
  }
9915
9928
  registerTimeSyncUpdate() {
9916
9929
  const e = () => {
@@ -9976,7 +9989,7 @@ class lr extends Nc {
9976
9989
  }
9977
9990
  attach(e) {
9978
9991
  if (e ? super.attach(e) : e = super.attach(), this.adaptiveStreamSettings && this.elementInfos.find((t) => t.element === e) === void 0) {
9979
- const t = new jh(e);
9992
+ const t = new Wh(e);
9980
9993
  this.observeElementInfo(t);
9981
9994
  }
9982
9995
  return e;
@@ -10096,7 +10109,7 @@ class lr extends Nc {
10096
10109
  return t === "screen" ? aa() : t || (aa() > 2 ? 2 : 1);
10097
10110
  }
10098
10111
  }
10099
- class jh {
10112
+ class Wh {
10100
10113
  get visible() {
10101
10114
  return this.isPiP || this.isIntersecting;
10102
10115
  }
@@ -10151,7 +10164,7 @@ function Us(i, e) {
10151
10164
  i = i.offsetParent, n += i.offsetTop, s += i.offsetLeft;
10152
10165
  return n < t.pageYOffset + t.innerHeight && s < t.pageXOffset + t.innerWidth && n + a > t.pageYOffset && s + r > t.pageXOffset && !d && l !== "none";
10153
10166
  }
10154
- class Wh extends Ie.EventEmitter {
10167
+ class Hh extends Ie.EventEmitter {
10155
10168
  constructor(e, t) {
10156
10169
  super(), this.decryptDataRequests = /* @__PURE__ */ new Map(), this.encryptDataRequests = /* @__PURE__ */ new Map(), this.onWorkerMessage = (n) => {
10157
10170
  var s, r;
@@ -10220,7 +10233,7 @@ class Wh extends Ie.EventEmitter {
10220
10233
  * @internal
10221
10234
  */
10222
10235
  setup(e) {
10223
- if (!Uh())
10236
+ if (!Fh())
10224
10237
  throw new ir("tried to setup end-to-end encryption on an unsupported browser");
10225
10238
  if (q.info("setting up e2ee"), e !== this.room) {
10226
10239
  this.room = e, this.setupEventListeners(e, this.keyProvider);
@@ -10228,7 +10241,7 @@ class Wh extends Ie.EventEmitter {
10228
10241
  kind: "init",
10229
10242
  data: {
10230
10243
  keyProviderOptions: this.keyProvider.getOptions(),
10231
- loglevel: Pu.getLevel()
10244
+ loglevel: Ru.getLevel()
10232
10245
  }
10233
10246
  };
10234
10247
  this.worker && (q.info("initializing worker", {
@@ -10521,13 +10534,13 @@ class Wh extends Ie.EventEmitter {
10521
10534
  }
10522
10535
  }
10523
10536
  }
10524
- const Hh = 300;
10525
- class Kh {
10537
+ const Kh = 300;
10538
+ class Gh {
10526
10539
  constructor() {
10527
10540
  this.metadataMap = /* @__PURE__ */ new Map(), this.activeSsrc = 0;
10528
10541
  }
10529
10542
  storeMetadata(e, t, n) {
10530
- for (this.activeSsrc !== 0 && this.activeSsrc !== t && this.metadataMap.clear(), this.activeSsrc = t; this.metadataMap.size >= Hh; ) {
10543
+ for (this.activeSsrc !== 0 && this.activeSsrc !== t && this.metadataMap.clear(), this.activeSsrc = t; this.metadataMap.size >= Kh; ) {
10531
10544
  const s = this.metadataMap.keys().next().value;
10532
10545
  this.metadataMap.delete(s);
10533
10546
  }
@@ -10540,7 +10553,7 @@ class Kh {
10540
10553
  this.metadataMap.clear(), this.activeSsrc = 0;
10541
10554
  }
10542
10555
  }
10543
- class Gh {
10556
+ class zh {
10544
10557
  constructor(e) {
10545
10558
  this.extractors = /* @__PURE__ */ new Map(), this.workerPipelines = /* @__PURE__ */ new Map(), this.onWorkerMessage = (t) => {
10546
10559
  const n = t.data;
@@ -10581,7 +10594,7 @@ class Gh {
10581
10594
  q.warn("frame metadata transform not supported; skipping extraction");
10582
10595
  return;
10583
10596
  }
10584
- const d = new Kh(), c = e.mediaStreamID;
10597
+ const d = new Gh(), c = e.mediaStreamID;
10585
10598
  this.extractors.set(c, d), e.frameMetadataExtractor = d, !(!((r = this.room) === null || r === void 0) && r.hasE2EESetup) && this.setupWorkerReceiver(a, c, !0);
10586
10599
  }
10587
10600
  setupPassthroughReceiver(e, t) {
@@ -10657,7 +10670,7 @@ class Gh {
10657
10670
  this.extractors.clear(), this.workerPipelines.clear(), (e = this.worker) === null || e === void 0 || e.terminate();
10658
10671
  }
10659
10672
  }
10660
- const zh = 500, Jh = 15e3;
10673
+ const Jh = 500, $h = 15e3;
10661
10674
  class Jt {
10662
10675
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10663
10676
  constructor() {
@@ -10672,7 +10685,7 @@ class Jt {
10672
10685
  if (!s)
10673
10686
  return;
10674
10687
  let r = (t = this.failedConnectionAttempts.get(s)) !== null && t !== void 0 ? t : 0;
10675
- this.failedConnectionAttempts.set(s, r + 1), this.backOffPromises.set(s, be(Math.min(zh * Math.pow(2, r), Jh)));
10688
+ this.failedConnectionAttempts.set(s, r + 1), this.backOffPromises.set(s, be(Math.min(Jh * Math.pow(2, r), $h)));
10676
10689
  }
10677
10690
  getBackOffPromise(e) {
10678
10691
  const t = new URL(e), n = t && Yi(t);
@@ -10891,7 +10904,7 @@ class tn extends xe {
10891
10904
  return new tn("0x".concat(e.toString(16), " is a reserved value."), Ot.Reserved);
10892
10905
  }
10893
10906
  }
10894
- const $h = {
10907
+ const Yh = {
10895
10908
  fromNumber(i) {
10896
10909
  if (i === 0)
10897
10910
  throw tn.reserved(i);
@@ -10900,7 +10913,7 @@ const $h = {
10900
10913
  return i;
10901
10914
  }
10902
10915
  };
10903
- class Yh {
10916
+ class Qh {
10904
10917
  constructor() {
10905
10918
  this.value = 0;
10906
10919
  }
@@ -10934,7 +10947,7 @@ var kn;
10934
10947
  (function(i) {
10935
10948
  i[i.WAITING = 0] = "WAITING", i[i.RUNNING = 1] = "RUNNING", i[i.COMPLETED = 2] = "COMPLETED";
10936
10949
  })(kn || (kn = {}));
10937
- class Qh {
10950
+ class Xh {
10938
10951
  constructor() {
10939
10952
  this.pendingTasks = /* @__PURE__ */ new Map(), this.taskMutex = new ge(), this.nextTaskIndex = 0;
10940
10953
  }
@@ -10964,7 +10977,7 @@ class Qh {
10964
10977
  return Array.from(this.pendingTasks.values());
10965
10978
  }
10966
10979
  }
10967
- class Xh {
10980
+ class Zh {
10968
10981
  get readyState() {
10969
10982
  return this.ws.readyState;
10970
10983
  }
@@ -11029,9 +11042,9 @@ class Xh {
11029
11042
  }), t.signal && (t.signal.onabort = () => r.close()), this.close = a;
11030
11043
  }
11031
11044
  }
11032
- const Zh = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
11033
- function ep(i) {
11034
- const e = Zh.indexOf(i.case) >= 0;
11045
+ const ep = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
11046
+ function tp(i) {
11047
+ const e = ep.indexOf(i.case) >= 0;
11035
11048
  return q.trace("request allowed to bypass queue:", {
11036
11049
  canPass: e,
11037
11050
  req: i
@@ -11041,7 +11054,7 @@ var Y;
11041
11054
  (function(i) {
11042
11055
  i[i.CONNECTING = 0] = "CONNECTING", i[i.CONNECTED = 1] = "CONNECTED", i[i.RECONNECTING = 2] = "RECONNECTING", i[i.DISCONNECTING = 3] = "DISCONNECTING", i[i.DISCONNECTED = 4] = "DISCONNECTED";
11043
11056
  })(Y || (Y = {}));
11044
- const tp = 250;
11057
+ const np = 250;
11045
11058
  class pr {
11046
11059
  get currentState() {
11047
11060
  return this.state;
@@ -11060,7 +11073,7 @@ class pr {
11060
11073
  var n;
11061
11074
  this.rtt = 0, this.state = Y.DISCONNECTED, this.log = q, this._requestId = 0, this.useV0SignalPath = !1, this.resetCallbacks = () => {
11062
11075
  this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0, this.onMediaSectionsRequirement = void 0;
11063
- }, this.loggerContextCb = t.loggerContextCb, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.Signal, () => this.logContext), this.useJSON = e, this.requestQueue = new Qh(), this.queuedRequests = [], this.closingLock = new ge(), this.connectionLock = new ge(), this.state = Y.DISCONNECTED;
11076
+ }, this.loggerContextCb = t.loggerContextCb, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.Signal, () => this.logContext), this.useJSON = e, this.requestQueue = new Xh(), this.queuedRequests = [], this.closingLock = new ge(), this.connectionLock = new ge(), this.state = Y.DISCONNECTED;
11064
11077
  }
11065
11078
  get logContext() {
11066
11079
  var e, t;
@@ -11095,27 +11108,27 @@ class pr {
11095
11108
  return function* () {
11096
11109
  const h = yield c.connectionLock.lock();
11097
11110
  c.connectOptions = o, c.useV0SignalPath = l;
11098
- const p = kh(o.clientInfoCapabilities), g = l ? np(a, p, o) : yield ip(a, p, o, u), m = Mh(r, g, l).toString(), T = Ah(m).toString();
11111
+ const p = Th(o.clientInfoCapabilities), g = l ? ip(a, p, o) : yield sp(a, p, o, u), m = Dh(r, g, l).toString(), T = Oh(m).toString();
11099
11112
  return new Promise((k, S) => f(c, void 0, void 0, function* () {
11100
- var L, v;
11113
+ var N, v;
11101
11114
  try {
11102
11115
  let y = !1;
11103
11116
  const C = (O) => f(this, void 0, void 0, function* () {
11104
11117
  if (y)
11105
11118
  return;
11106
11119
  y = !0;
11107
- const B = O instanceof Event ? O.currentTarget : O, W = Oh(B, "Abort handler called");
11120
+ const B = O instanceof Event ? O.currentTarget : O, W = xh(B, "Abort handler called");
11108
11121
  this.streamWriter && !this.isDisconnected ? this.sendLeave().then(() => this.close(W)).catch((Z) => {
11109
11122
  this.log.error(Z), this.close();
11110
11123
  }) : this.close(), I(), S(F.cancelled(W));
11111
11124
  });
11112
11125
  d == null || d.addEventListener("abort", C);
11113
11126
  const I = () => {
11114
- clearTimeout(x), d == null || d.removeEventListener("abort", C);
11115
- }, x = setTimeout(() => {
11127
+ clearTimeout(L), d == null || d.removeEventListener("abort", C);
11128
+ }, L = setTimeout(() => {
11116
11129
  C(F.timeout("room connection has timed out (signal)"));
11117
11130
  }, o.websocketTimeout), V = (O, B) => {
11118
- this.handleSignalConnected(O, x, B);
11131
+ this.handleSignalConnected(O, L, B);
11119
11132
  }, A = new URL(m);
11120
11133
  if (A.searchParams.has("access_token") && A.searchParams.set("access_token", "<redacted>"), this.ws) {
11121
11134
  const O = performance.now();
@@ -11124,7 +11137,7 @@ class pr {
11124
11137
  this.log.info("signal connecting to ".concat(A), {
11125
11138
  reconnect: o.reconnect,
11126
11139
  reconnectReason: o.reconnectReason
11127
- }), this.ws = new Xh(m);
11140
+ }), this.ws = new Zh(m);
11128
11141
  try {
11129
11142
  this.ws.closed.then((ye) => {
11130
11143
  var ut;
@@ -11139,21 +11152,21 @@ class pr {
11139
11152
  });
11140
11153
  const O = yield this.ws.opened.catch((ye) => f(this, void 0, void 0, function* () {
11141
11154
  if (this.state !== Y.CONNECTED) {
11142
- this.state = Y.DISCONNECTED, clearTimeout(x);
11155
+ this.state = Y.DISCONNECTED, clearTimeout(L);
11143
11156
  const ut = yield this.handleConnectionError(ye, T);
11144
11157
  S(ut);
11145
11158
  return;
11146
11159
  }
11147
11160
  this.handleWSError(ye), S(ye);
11148
11161
  }));
11149
- if (clearTimeout(x), !O)
11162
+ if (clearTimeout(L), !O)
11150
11163
  return;
11151
11164
  const B = O.readable.getReader();
11152
11165
  this.streamWriter = O.writable.getWriter();
11153
11166
  const W = yield B.read();
11154
11167
  if (B.releaseLock(), !W.value)
11155
11168
  throw F.internal("no message received as first message");
11156
- const Z = ua(W.value), ze = this.validateFirstMessage(Z, (L = o.reconnect) !== null && L !== void 0 ? L : !1);
11169
+ const Z = ua(W.value), ze = this.validateFirstMessage(Z, (N = o.reconnect) !== null && N !== void 0 ? N : !1);
11157
11170
  if (!ze.isValid) {
11158
11171
  S(ze.error);
11159
11172
  return;
@@ -11205,7 +11218,7 @@ class pr {
11205
11218
  reason: n
11206
11219
  });
11207
11220
  const r = e.ws.closed;
11208
- e.ws = void 0, e.streamWriter = void 0, yield Promise.race([r, be(tp)]);
11221
+ e.ws = void 0, e.streamWriter = void 0, yield Promise.race([r, be(np)]);
11209
11222
  }
11210
11223
  } catch (r) {
11211
11224
  e.log.debug("websocket error while closing", {
@@ -11387,7 +11400,7 @@ class pr {
11387
11400
  var n = this;
11388
11401
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
11389
11402
  return function* () {
11390
- if (!s && !ep(t) && n.state === Y.RECONNECTING) {
11403
+ if (!s && !tp(t) && n.state === Y.RECONNECTING) {
11391
11404
  n.queuedRequests.push(() => f(n, void 0, void 0, function* () {
11392
11405
  yield this.sendRequest(t, !0);
11393
11406
  }));
@@ -11401,7 +11414,7 @@ class pr {
11401
11414
  n.log.error("cannot send signal request before connected, type: ".concat(t == null ? void 0 : t.case));
11402
11415
  return;
11403
11416
  }
11404
- const a = new $l({
11417
+ const a = new Yl({
11405
11418
  message: t
11406
11419
  });
11407
11420
  try {
@@ -11581,16 +11594,16 @@ function Rt(i, e) {
11581
11594
  id: e
11582
11595
  });
11583
11596
  }
11584
- function np(i, e, t) {
11597
+ function ip(i, e, t) {
11585
11598
  var n;
11586
11599
  const s = new URLSearchParams();
11587
11600
  return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", Ge() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), s.set("client_protocol", e.clientProtocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
11588
11601
  }
11589
- function ip(i, e, t, n) {
11602
+ function sp(i, e, t, n) {
11590
11603
  return f(this, void 0, void 0, function* () {
11591
11604
  const s = new URLSearchParams();
11592
11605
  s.set("access_token", i);
11593
- const r = new ku({
11606
+ const r = new Tu({
11594
11607
  clientInfo: e,
11595
11608
  connectionSettings: new Ko({
11596
11609
  autoSubscribe: !!t.autoSubscribe,
@@ -11608,18 +11621,18 @@ function ip(i, e, t, n) {
11608
11621
  p.write(new Uint8Array(a)), p.close();
11609
11622
  const g = [], m = h.readable.getReader();
11610
11623
  for (; ; ) {
11611
- const L = yield m.read(), v = L.done, y = L.value;
11624
+ const N = yield m.read(), v = N.done, y = N.value;
11612
11625
  if (v) break;
11613
11626
  g.push(y);
11614
11627
  }
11615
- const T = g.reduce((L, v) => L + v.length, 0), k = new Uint8Array(T);
11628
+ const T = g.reduce((N, v) => N + v.length, 0), k = new Uint8Array(T);
11616
11629
  let S = 0;
11617
- for (const L of g)
11618
- k.set(L, S), S += L.length;
11630
+ for (const N of g)
11631
+ k.set(N, S), S += N.length;
11619
11632
  o = k, d = ys.GZIP;
11620
11633
  } else
11621
11634
  o = a, d = ys.NONE;
11622
- const l = new Tu({
11635
+ const l = new Su({
11623
11636
  joinRequest: o,
11624
11637
  compression: d
11625
11638
  }).toBinary(), u = (h) => {
@@ -11659,7 +11672,7 @@ class ga {
11659
11672
  return this.buffer.length;
11660
11673
  }
11661
11674
  }
11662
- class sp {
11675
+ class rp {
11663
11676
  /**
11664
11677
  * @param ttl ttl of the key (ms)
11665
11678
  */
@@ -12195,7 +12208,7 @@ function fr() {
12195
12208
  }), ss.exports;
12196
12209
  }
12197
12210
  var ba;
12198
- function rp() {
12211
+ function ap() {
12199
12212
  return ba || (ba = 1, function(i) {
12200
12213
  var e = function(o) {
12201
12214
  return String(Number(o)) === o ? Number(o) : o;
@@ -12263,7 +12276,7 @@ function rp() {
12263
12276
  }(is)), is;
12264
12277
  }
12265
12278
  var rs, ya;
12266
- function ap() {
12279
+ function op() {
12267
12280
  if (ya) return rs;
12268
12281
  ya = 1;
12269
12282
  var i = fr(), e = /%[sdv%]/g, t = function(a) {
@@ -12319,14 +12332,14 @@ function ap() {
12319
12332
  }, rs;
12320
12333
  }
12321
12334
  var ka;
12322
- function op() {
12335
+ function cp() {
12323
12336
  if (ka) return Le;
12324
12337
  ka = 1;
12325
- var i = rp(), e = ap(), t = fr();
12338
+ var i = ap(), e = op(), t = fr();
12326
12339
  return Le.grammar = t, Le.write = e, Le.parse = i.parse, Le.parseParams = i.parseParams, Le.parseFmtpConfig = i.parseFmtpConfig, Le.parsePayloads = i.parsePayloads, Le.parseRemoteCandidates = i.parseRemoteCandidates, Le.parseImageAttributes = i.parseImageAttributes, Le.parseSimulcastStreamList = i.parseSimulcastStreamList, Le;
12327
12340
  }
12328
- var De = op();
12329
- const cp = 0.7, dp = 20, gt = {
12341
+ var De = cp();
12342
+ const dp = 0.7, lp = 20, gt = {
12330
12343
  NegotiationStarted: "negotiationStarted",
12331
12344
  NegotiationComplete: "negotiationComplete",
12332
12345
  // Fired with the offerId for every successful publisher answer application,
@@ -12353,7 +12366,7 @@ class Ta extends Ie.EventEmitter {
12353
12366
  else
12354
12367
  throw r;
12355
12368
  }
12356
- }), dp), this.close = () => {
12369
+ }), lp), this.close = () => {
12357
12370
  this._pc && (this.pendingInitialOffer = void 0, this._pc.close(), this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc.onicegatheringstatechange = null, this._pc.ondatachannel = null, this._pc.onnegotiationneeded = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null, this._pc.ondatachannel = null, this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc = null);
12358
12371
  }, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new ge();
12359
12372
  }
@@ -12406,7 +12419,7 @@ class Ta extends Ie.EventEmitter {
12406
12419
  })), !1;
12407
12420
  let r;
12408
12421
  if (e.type === "offer") {
12409
- let a = lp(e), o = a.stereoMids, d = a.nackMids;
12422
+ let a = up(e), o = a.stereoMids, d = a.nackMids;
12410
12423
  this.remoteStereoMids = o, this.remoteNackMids = d;
12411
12424
  } else if (e.type === "answer") {
12412
12425
  if (this.pendingInitialOffer && this._pc) {
@@ -12508,7 +12521,7 @@ class Ta extends Ie.EventEmitter {
12508
12521
  let c = 0;
12509
12522
  if (o.rtp.some((u) => u.codec.toUpperCase() === d.codec.toUpperCase() ? (c = u.payload, !0) : !1), c === 0 || (qe(d.codec) && !Nt() && this.ensureVideoDDExtensionForSVC(o, a), !qe(d.codec)))
12510
12523
  return !0;
12511
- const l = Math.round(d.maxbr * cp);
12524
+ const l = Math.round(d.maxbr * dp);
12512
12525
  for (const u of o.fmtp)
12513
12526
  if (u.payload === c) {
12514
12527
  u.config.includes("x-google-start-bitrate") || (u.config += ";x-google-start-bitrate=".concat(l));
@@ -12689,7 +12702,7 @@ function Sa(i, e, t) {
12689
12702
  type: "nack"
12690
12703
  }), (e.includes(n) || e.length === 1 && e[0] === "all") && i.fmtp.some((r) => r.payload === s ? (r.config.includes("stereo=1") || (r.config += ";stereo=1"), !0) : !1));
12691
12704
  }
12692
- function lp(i) {
12705
+ function up(i) {
12693
12706
  var e;
12694
12707
  const t = [], n = [], s = De.parse((e = i.sdp) !== null && e !== void 0 ? e : "");
12695
12708
  let r = 0;
@@ -12711,7 +12724,7 @@ function Fn(i) {
12711
12724
  function mr(i) {
12712
12725
  return typeof i == "number" ? i.toFixed(0) : i;
12713
12726
  }
12714
- const Fs = "vp8", up = {
12727
+ const Fs = "vp8", hp = {
12715
12728
  audioPreset: Rs.music,
12716
12729
  dtx: !0,
12717
12730
  red: !0,
@@ -12735,11 +12748,11 @@ const Fs = "vp8", up = {
12735
12748
  ideal: "default"
12736
12749
  },
12737
12750
  resolution: Pn.h720.resolution
12738
- }, hp = {
12751
+ }, pp = {
12739
12752
  adaptiveStream: !1,
12740
12753
  dynacast: !1,
12741
12754
  stopLocalTrackOnUnpublish: !0,
12742
- reconnectPolicy: new Iu(),
12755
+ reconnectPolicy: new Mu(),
12743
12756
  disconnectOnPageLeave: !0,
12744
12757
  webAudioMix: !1,
12745
12758
  singlePeerConnection: !0
@@ -12949,13 +12962,13 @@ class Ca {
12949
12962
  }
12950
12963
  }
12951
12964
  const vr = typeof MediaRecorder < "u";
12952
- class pp {
12965
+ class fp {
12953
12966
  constructor() {
12954
12967
  throw new Error("MediaRecorder is not available in this environment");
12955
12968
  }
12956
12969
  }
12957
- const fp = vr ? MediaRecorder : pp;
12958
- class mp extends fp {
12970
+ const mp = vr ? MediaRecorder : fp;
12971
+ class gp extends mp {
12959
12972
  constructor(e, t) {
12960
12973
  if (!vr)
12961
12974
  throw new Error("MediaRecorder is not available in this environment");
@@ -12986,10 +12999,10 @@ class mp extends fp {
12986
12999
  }), this.addEventListener("stop", a), this.addEventListener("error", o);
12987
13000
  }
12988
13001
  }
12989
- function gp() {
13002
+ function vp() {
12990
13003
  return vr;
12991
13004
  }
12992
- const vp = 1e3, bp = 1e4;
13005
+ const bp = 1e3, yp = 1e4;
12993
13006
  class Vc extends _ {
12994
13007
  /** @internal */
12995
13008
  get sender() {
@@ -13088,7 +13101,7 @@ class Vc extends _ {
13088
13101
  waitForDimensions() {
13089
13102
  return f(this, arguments, void 0, function() {
13090
13103
  var e = this;
13091
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : vp;
13104
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bp;
13092
13105
  return function* () {
13093
13106
  var n;
13094
13107
  if (e.kind === _.Kind.Audio)
@@ -13165,7 +13178,7 @@ class Vc extends _ {
13165
13178
  const n = yield this.trackChangeLock.lock();
13166
13179
  try {
13167
13180
  e || (e = this._constraints);
13168
- const s = e, r = s.deviceId, a = s.facingMode, o = Mu(e, ["deviceId", "facingMode"]);
13181
+ const s = e, r = s.deviceId, a = s.facingMode, o = Du(e, ["deviceId", "facingMode"]);
13169
13182
  this.log.debug("restarting track with constraints", Object.assign(Object.assign({}, this.logContext), {
13170
13183
  constraints: e
13171
13184
  }));
@@ -13356,7 +13369,7 @@ class Vc extends _ {
13356
13369
  /** @internal */
13357
13370
  startPreConnectBuffer() {
13358
13371
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 100;
13359
- if (!gp()) {
13372
+ if (!vp()) {
13360
13373
  this.log.warn("MediaRecorder is not available, cannot start preconnect buffer", this.logContext);
13361
13374
  return;
13362
13375
  }
@@ -13365,13 +13378,13 @@ class Vc extends _ {
13365
13378
  return;
13366
13379
  } else {
13367
13380
  let t = "audio/webm;codecs=opus";
13368
- MediaRecorder.isTypeSupported(t) || (t = "video/mp4"), this.localTrackRecorder = new mp(this, {
13381
+ MediaRecorder.isTypeSupported(t) || (t = "video/mp4"), this.localTrackRecorder = new gp(this, {
13369
13382
  mimeType: t
13370
13383
  });
13371
13384
  }
13372
13385
  this.localTrackRecorder.start(e), this.autoStopPreConnectBuffer = setTimeout(() => {
13373
13386
  this.log.warn("preconnect buffer timed out, stopping recording automatically", this.logContext), this.stopPreConnectBuffer();
13374
- }, bp);
13387
+ }, yp);
13375
13388
  }
13376
13389
  /** @internal */
13377
13390
  stopPreConnectBuffer() {
@@ -13538,7 +13551,7 @@ class pi extends Vc {
13538
13551
  });
13539
13552
  }
13540
13553
  }
13541
- function yp(i, e, t) {
13554
+ function kp(i, e, t) {
13542
13555
  switch (i.kind) {
13543
13556
  case "audio":
13544
13557
  return new pi(i, e, !1, void 0, t);
@@ -13548,7 +13561,7 @@ function yp(i, e, t) {
13548
13561
  throw new ct("unsupported track type: ".concat(i.kind));
13549
13562
  }
13550
13563
  }
13551
- const kp = Object.values(Pn), Tp = Object.values(Is), Sp = Object.values(sr), Cp = [Pn.h180, Pn.h360], _p = [Is.h180, Is.h360], wp = (i) => [{
13564
+ const Tp = Object.values(Pn), Sp = Object.values(Is), Cp = Object.values(sr), _p = [Pn.h180, Pn.h360], wp = [Is.h180, Is.h360], Ep = (i) => [{
13552
13565
  scaleResolutionDownBy: 2,
13553
13566
  fps: i.encoding.maxFramerate
13554
13567
  }].map((t) => {
@@ -13562,7 +13575,7 @@ function fi(i, e, t, n) {
13562
13575
  const o = n == null ? void 0 : n.simulcast, d = n == null ? void 0 : n.scalabilityMode, c = n == null ? void 0 : n.videoCodec;
13563
13576
  if (!a && !o && !d || !e || !t)
13564
13577
  return [{}];
13565
- a || (a = Ep(i, e, t, c), q.debug("using video encoding", a));
13578
+ a || (a = Pp(i, e, t, c), q.debug("using video encoding", a));
13566
13579
  const l = a.maxFramerate, u = new $(e, t, a.maxBitrate, a.maxFramerate, a.priority);
13567
13580
  if (d && qe(c)) {
13568
13581
  const T = new jc(d), k = [];
@@ -13573,11 +13586,11 @@ function fi(i, e, t, n) {
13573
13586
  // is provided. So we'll use the legacy SVC specification for now.
13574
13587
  // TODO: when we upstream libwebrtc, this will need additional verification
13575
13588
  Ge() || (S == null ? void 0 : S.name) === "Chrome" && et(S == null ? void 0 : S.version, "113") < 0) {
13576
- const L = T.suffix == "h" ? 2 : 3, v = gh(S);
13589
+ const N = T.suffix == "h" ? 2 : 3, v = vh(S);
13577
13590
  for (let y = 0; y < T.spatial; y += 1)
13578
13591
  k.push({
13579
13592
  rid: Bs[2 - y],
13580
- maxBitrate: a.maxBitrate / Math.pow(L, y),
13593
+ maxBitrate: a.maxBitrate / Math.pow(N, y),
13581
13594
  maxFramerate: u.encoding.maxFramerate,
13582
13595
  scaleResolutionDownBy: v ? Math.pow(2, y) : void 0
13583
13596
  });
@@ -13623,8 +13636,8 @@ function qc(i, e, t) {
13623
13636
  const o = i.mediaStreamTrack.getSettings(), d = (n = o.width) !== null && n !== void 0 ? n : (s = i.dimensions) === null || s === void 0 ? void 0 : s.width, c = (r = o.height) !== null && r !== void 0 ? r : (a = i.dimensions) === null || a === void 0 ? void 0 : a.height;
13624
13637
  return i.source === _.Source.ScreenShare && t.simulcast && (t.simulcast = !1), fi(i.source === _.Source.ScreenShare, d, c, t);
13625
13638
  }
13626
- function Ep(i, e, t, n) {
13627
- const s = Pp(i, e, t);
13639
+ function Pp(i, e, t, n) {
13640
+ const s = Rp(i, e, t);
13628
13641
  let r = s[0].encoding;
13629
13642
  const a = Math.max(e, t);
13630
13643
  for (let o = 0; o < s.length; o += 1) {
@@ -13644,17 +13657,17 @@ function Ep(i, e, t, n) {
13644
13657
  }
13645
13658
  return r;
13646
13659
  }
13647
- function Pp(i, e, t) {
13660
+ function Rp(i, e, t) {
13648
13661
  if (i)
13649
- return Sp;
13662
+ return Cp;
13650
13663
  const n = e > t ? e / t : t / e;
13651
- return Math.abs(n - 16 / 9) < Math.abs(n - 4 / 3) ? kp : Tp;
13664
+ return Math.abs(n - 16 / 9) < Math.abs(n - 4 / 3) ? Tp : Sp;
13652
13665
  }
13653
13666
  function _a(i, e) {
13654
13667
  if (i)
13655
- return wp(e);
13668
+ return Ep(e);
13656
13669
  const t = e.width, n = e.height, s = t > n ? t / n : n / t;
13657
- return Math.abs(s - 16 / 9) < Math.abs(s - 4 / 3) ? Cp : _p;
13670
+ return Math.abs(s - 16 / 9) < Math.abs(s - 4 / 3) ? _p : wp;
13658
13671
  }
13659
13672
  function as(i, e, t, n) {
13660
13673
  const s = [];
@@ -13707,10 +13720,10 @@ class jc {
13707
13720
  return "L".concat(this.spatial, "T").concat(this.temporal).concat((e = this.suffix) !== null && e !== void 0 ? e : "");
13708
13721
  }
13709
13722
  }
13710
- function Rp(i) {
13723
+ function Ip(i) {
13711
13724
  return i.source === _.Source.ScreenShare || i.constraints.height && At(i.constraints.height) >= 1080 ? "maintain-resolution" : "balanced";
13712
13725
  }
13713
- const Ip = 5e3;
13726
+ const Mp = 5e3;
13714
13727
  class mi extends Vc {
13715
13728
  get sender() {
13716
13729
  return this._sender;
@@ -14056,7 +14069,7 @@ class mi extends Vc {
14056
14069
  const n = this.simulcastCodecs.get(e);
14057
14070
  n && (n.sender = t, setTimeout(() => {
14058
14071
  this.subscribedCodecs && this.setPublishingCodecs(this.subscribedCodecs);
14059
- }, Ip));
14072
+ }, Mp));
14060
14073
  }
14061
14074
  /**
14062
14075
  * @internal
@@ -14247,7 +14260,7 @@ function Pa(i, e, t, n) {
14247
14260
  });
14248
14261
  });
14249
14262
  }
14250
- const Ra = "_lossy", Ia = "_reliable", Ma = "_data_track", Mp = 2 * 1e3, os = "leave-reconnect", Dp = 3e4, Ap = 8 * 1024, Op = 256 * 1024, xp = 3, Lp = 3;
14263
+ const Ra = "_lossy", Ia = "_reliable", Ma = "_data_track", Dp = 2 * 1e3, os = "leave-reconnect", Ap = 3e4, Op = 8 * 1024, xp = 256 * 1024, Lp = 3, Np = 3;
14251
14264
  var Ae;
14252
14265
  (function(i) {
14253
14266
  i[i.New = 0] = "New", i[i.Connected = 1] = "Connected", i[i.Disconnected = 2] = "Disconnected", i[i.Reconnecting = 3] = "Reconnecting", i[i.Closed = 4] = "Closed";
@@ -14257,7 +14270,7 @@ var j;
14257
14270
  i[i.RELIABLE = 0] = "RELIABLE", i[i.LOSSY = 1] = "LOSSY", i[i.DATA_TRACK_LOSSY = 2] = "DATA_TRACK_LOSSY";
14258
14271
  })(j || (j = {}));
14259
14272
  const Da = 64e3;
14260
- class Np extends Ie.EventEmitter {
14273
+ class Up extends Ie.EventEmitter {
14261
14274
  get isClosed() {
14262
14275
  return this._isClosed;
14263
14276
  }
@@ -14269,7 +14282,7 @@ class Np extends Ie.EventEmitter {
14269
14282
  }
14270
14283
  constructor(e) {
14271
14284
  var t;
14272
- super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = gr.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Ae.New, this._isClosed = !0, this._isNewlyCreated = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.shouldFailOnV1Path = !1, this.log = q, this.reliableDataSequence = 1, this.reliableMessageBuffer = new ga(), this.reliableReceivedState = new sp(Dp), this.lossyDataStatCurrentBytes = 0, this.lossyDataStatByterate = 0, this.lossyDataDropCount = 0, this.midToTrackId = {}, this.isWaitingForNetworkReconnect = !1, this.bufferStatusLowClosingFuture = new he(), this.handleDataChannel = (n) => f(this, [n], void 0, function(s) {
14285
+ super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = gr.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Ae.New, this._isClosed = !0, this._isNewlyCreated = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.shouldFailOnV1Path = !1, this.log = q, this.reliableDataSequence = 1, this.reliableMessageBuffer = new ga(), this.reliableReceivedState = new rp(Ap), this.lossyDataStatCurrentBytes = 0, this.lossyDataStatByterate = 0, this.lossyDataDropCount = 0, this.midToTrackId = {}, this.isWaitingForNetworkReconnect = !1, this.bufferStatusLowClosingFuture = new he(), this.handleDataChannel = (n) => f(this, [n], void 0, function(s) {
14273
14286
  var r = this;
14274
14287
  let a = s.channel;
14275
14288
  return function* () {
@@ -14398,7 +14411,7 @@ class Np extends Ie.EventEmitter {
14398
14411
  const s = /* @__PURE__ */ new Map();
14399
14412
  n.forEach((r) => {
14400
14413
  const a = r.codec.toLowerCase();
14401
- Th(a) && s.set(r.payload, a);
14414
+ Sh(a) && s.set(r.payload, a);
14402
14415
  }), this.emit(P.RTPVideoMapUpdate, s);
14403
14416
  }, this.handleBrowserOnLine = () => f(this, void 0, void 0, function* () {
14404
14417
  !this.url || !(yield fetch(In(this.url), {
@@ -14447,7 +14460,7 @@ class Np extends Ie.EventEmitter {
14447
14460
  c._isNewlyCreated = !1, c.url = r, c.token = a, c.signalOpts = o, c.maxJoinAttempts = o.maxRetries;
14448
14461
  try {
14449
14462
  c.joinAttempts += 1, c.setupSignalClientCallbacks();
14450
- const g = !l && Ih();
14463
+ const g = !l && Mh();
14451
14464
  let m;
14452
14465
  if (g) {
14453
14466
  c.pcManager || (yield c.configure(), c.applyInitialPublisherLayout());
@@ -14467,7 +14480,7 @@ class Np extends Ie.EventEmitter {
14467
14480
  version: T.serverVersion,
14468
14481
  region: T.serverRegion
14469
14482
  }), c.log.info("connected to Livekit Server ".concat(Object.entries(k).map((S) => {
14470
- let L = U(S, 2), v = L[0], y = L[1];
14483
+ let N = U(S, 2), v = N[0], y = N[1];
14471
14484
  return "".concat(v, ": ").concat(y);
14472
14485
  }).join(", "))), {
14473
14486
  joinResponse: T,
@@ -14695,7 +14708,7 @@ class Np extends Ie.EventEmitter {
14695
14708
  * build a meaningful initial offer. Must be called on a configured pcManager.
14696
14709
  */
14697
14710
  applyInitialPublisherLayout() {
14698
- this.createDataChannels(), Ge() || this.addMediaSections(xp, Lp);
14711
+ this.createDataChannels(), Ge() || this.addMediaSections(Lp, Np);
14699
14712
  }
14700
14713
  addMediaSections(e, t) {
14701
14714
  var n, s;
@@ -14721,7 +14734,7 @@ class Np extends Ie.EventEmitter {
14721
14734
  const e = this.dataChannelForKind(j.LOSSY);
14722
14735
  if (e) {
14723
14736
  const t = this.lossyDataStatByterate / 10;
14724
- e.bufferedAmountLowThreshold = Math.min(Math.max(t, Ap), Op);
14737
+ e.bufferedAmountLowThreshold = Math.min(Math.max(t, Op), xp);
14725
14738
  }
14726
14739
  }, 1e3));
14727
14740
  }
@@ -14919,7 +14932,7 @@ class Np extends Ie.EventEmitter {
14919
14932
  return f(this, void 0, void 0, function* () {
14920
14933
  this.pcState = Ae.Reconnecting, this.log.debug("waiting for peer connection to reconnect");
14921
14934
  try {
14922
- if (yield be(Mp), !this.pcManager)
14935
+ if (yield be(Dp), !this.pcManager)
14923
14936
  throw new ne("PC manager is closed");
14924
14937
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Ae.Connected;
14925
14938
  } catch (e) {
@@ -14948,7 +14961,7 @@ class Np extends Ie.EventEmitter {
14948
14961
  return f(this, void 0, void 0, function* () {
14949
14962
  var n, s;
14950
14963
  if (yield this.ensurePublisherConnected(t), this.e2eeManager && this.e2eeManager.isDataChannelEncryptionEnabled) {
14951
- const o = Bh(e);
14964
+ const o = Vh(e);
14952
14965
  if (o) {
14953
14966
  const d = yield this.e2eeManager.encryptData(o.toBinary());
14954
14967
  e.value = {
@@ -14964,7 +14977,7 @@ class Np extends Ie.EventEmitter {
14964
14977
  t === j.RELIABLE && (e.sequence = this.reliableDataSequence, this.reliableDataSequence += 1);
14965
14978
  const r = e.toBinary(), a = Math.min((s = (n = this.pcManager) === null || n === void 0 ? void 0 : n.getMaxPublisherMessageSize()) !== null && s !== void 0 ? s : Da, Da);
14966
14979
  if (typeof a < "u" && a !== 0 && r.byteLength > a)
14967
- throw new Yu("cannot publish data packet larger than ".concat(a, " bytes (got ").concat(r.byteLength, ")"));
14980
+ throw new Qu("cannot publish data packet larger than ".concat(a, " bytes (got ").concat(r.byteLength, ")"));
14968
14981
  switch (t) {
14969
14982
  case j.LOSSY:
14970
14983
  case j.DATA_TRACK_LOSSY:
@@ -15144,7 +15157,7 @@ class Np extends Ie.EventEmitter {
15144
15157
  subscribe: !h,
15145
15158
  participantTracks: []
15146
15159
  }),
15147
- publishTracks: ih(t),
15160
+ publishTracks: sh(t),
15148
15161
  dataChannels: this.dataChannelsInfo(),
15149
15162
  trackSidsDisabled: g,
15150
15163
  datachannelReceiveStates: this.reliableReceivedState.map((m, T) => new jo({
@@ -15202,20 +15215,20 @@ function Aa(i, e) {
15202
15215
  const n = i.destinationIdentities.length !== 0 ? i.destinationIdentities : e.destinationIdentities;
15203
15216
  i.destinationIdentities = n, e.destinationIdentities = n;
15204
15217
  }
15205
- const Vs = 5e3, Up = 3e4;
15218
+ const Vs = 5e3, Fp = 3e4;
15206
15219
  class G {
15207
15220
  static fetchRegionSettings(e, t, n) {
15208
15221
  return f(this, void 0, void 0, function* () {
15209
15222
  const s = yield G.fetchLock.lock();
15210
15223
  try {
15211
- const r = yield fetch("".concat(Fp(e), "/regions"), {
15224
+ const r = yield fetch("".concat(Bp(e), "/regions"), {
15212
15225
  headers: {
15213
15226
  authorization: "Bearer ".concat(t)
15214
15227
  },
15215
15228
  signal: n
15216
15229
  });
15217
15230
  if (r.ok) {
15218
- const a = Rh(r.headers), o = a ? a * 1e3 : Vs;
15231
+ const a = Ih(r.headers), o = a ? a * 1e3 : Vs;
15219
15232
  return {
15220
15233
  regionSettings: yield r.json(),
15221
15234
  updatedAtInMs: Date.now(),
@@ -15263,7 +15276,7 @@ class G {
15263
15276
  n && n.connectionCount === 0 && (q.debug("stopping region refetch after disconnect delay", {
15264
15277
  hostname: e
15265
15278
  }), G.stopRefetch(e)), n && (n.cleanupTimeout = void 0);
15266
- }, Up));
15279
+ }, Fp));
15267
15280
  }
15268
15281
  static cancelCleanup(e) {
15269
15282
  const t = G.connectionTrackers.get(e);
@@ -15326,7 +15339,7 @@ G.cache = /* @__PURE__ */ new Map();
15326
15339
  G.settingsTimeouts = /* @__PURE__ */ new Map();
15327
15340
  G.connectionTrackers = /* @__PURE__ */ new Map();
15328
15341
  G.fetchLock = new ge();
15329
- function Fp(i) {
15342
+ function Bp(i) {
15330
15343
  return "".concat(i.protocol.replace("ws", "http"), "//").concat(i.host, "/settings");
15331
15344
  }
15332
15345
  class Hc {
@@ -15347,7 +15360,7 @@ class Hc {
15347
15360
  this.reader = t, this.totalByteSize = n, this._info = e, this.bytesReceived = 0;
15348
15361
  }
15349
15362
  }
15350
- class Bp extends Hc {
15363
+ class Vp extends Hc {
15351
15364
  handleChunkReceived(e) {
15352
15365
  var t;
15353
15366
  this.bytesReceived += e.content.byteLength, this.validateBytesReceived();
@@ -15441,7 +15454,7 @@ class Bp extends Hc {
15441
15454
  });
15442
15455
  }
15443
15456
  }
15444
- class Vp extends Hc {
15457
+ class qp extends Hc {
15445
15458
  /**
15446
15459
  * A TextStreamReader instance can be used as an AsyncIterator that returns the entire string
15447
15460
  * that has been received up to the current point in time.
@@ -15559,7 +15572,7 @@ class Vp extends Hc {
15559
15572
  });
15560
15573
  }
15561
15574
  }
15562
- class qp {
15575
+ class jp {
15563
15576
  constructor() {
15564
15577
  this.log = q, this.byteStreamControllers = /* @__PURE__ */ new Map(), this.textStreamControllers = /* @__PURE__ */ new Map(), this.byteStreamHandlers = /* @__PURE__ */ new Map(), this.textStreamHandlers = /* @__PURE__ */ new Map(), this.isConnected = !1, this.bufferedPackets = [];
15565
15578
  }
@@ -15658,7 +15671,7 @@ class qp {
15658
15671
  });
15659
15672
  }
15660
15673
  });
15661
- r(new Bp(o, d, Xn(e.totalLength)), {
15674
+ r(new Vp(o, d, Xn(e.totalLength)), {
15662
15675
  identity: t
15663
15676
  });
15664
15677
  } else if (e.contentHeader.case === "textHeader") {
@@ -15689,7 +15702,7 @@ class qp {
15689
15702
  });
15690
15703
  }
15691
15704
  });
15692
- r(new Vp(o, d, Xn(e.totalLength)), {
15705
+ r(new qp(o, d, Xn(e.totalLength)), {
15693
15706
  identity: t
15694
15707
  });
15695
15708
  }
@@ -15721,12 +15734,12 @@ class Kc {
15721
15734
  });
15722
15735
  }
15723
15736
  }
15724
- class jp extends Kc {
15725
- }
15726
15737
  class Wp extends Kc {
15727
15738
  }
15739
+ class Hp extends Kc {
15740
+ }
15728
15741
  const Oa = 15e3;
15729
- class Hp {
15742
+ class Kp {
15730
15743
  constructor(e, t) {
15731
15744
  this.engine = e, this.log = t;
15732
15745
  }
@@ -15805,7 +15818,7 @@ class Hp {
15805
15818
  // Implement the sink
15806
15819
  write(m) {
15807
15820
  return f(this, void 0, void 0, function* () {
15808
- for (const T of Ph(m, Oa)) {
15821
+ for (const T of Rh(m, Oa)) {
15809
15822
  const k = new oi({
15810
15823
  content: T,
15811
15824
  streamId: r,
@@ -15842,7 +15855,7 @@ class Hp {
15842
15855
  yield g.close();
15843
15856
  });
15844
15857
  u.once(P.Closing, p);
15845
- const g = new jp(h, a, () => this.engine.off(P.Closing, p));
15858
+ const g = new Wp(h, a, () => this.engine.off(P.Closing, p));
15846
15859
  return g;
15847
15860
  });
15848
15861
  }
@@ -15911,7 +15924,7 @@ class Hp {
15911
15924
  const p = new ge(), g = this.engine, m = this.log, T = new WritableStream({
15912
15925
  write(S) {
15913
15926
  return f(this, void 0, void 0, function* () {
15914
- const L = yield p.lock();
15927
+ const N = yield p.lock();
15915
15928
  let v = 0;
15916
15929
  try {
15917
15930
  for (; v < S.byteLength; ) {
@@ -15929,7 +15942,7 @@ class Hp {
15929
15942
  yield g.sendDataPacket(C, j.RELIABLE), h += 1, v += y.byteLength;
15930
15943
  }
15931
15944
  } finally {
15932
- L();
15945
+ N();
15933
15946
  }
15934
15947
  });
15935
15948
  },
@@ -15937,21 +15950,21 @@ class Hp {
15937
15950
  return f(this, void 0, void 0, function* () {
15938
15951
  const S = new ci({
15939
15952
  streamId: o
15940
- }), L = new ve({
15953
+ }), N = new ve({
15941
15954
  destinationIdentities: d,
15942
15955
  value: {
15943
15956
  case: "streamTrailer",
15944
15957
  value: S
15945
15958
  }
15946
15959
  });
15947
- yield g.sendDataPacket(L, j.RELIABLE);
15960
+ yield g.sendDataPacket(N, j.RELIABLE);
15948
15961
  });
15949
15962
  },
15950
15963
  abort(S) {
15951
15964
  m.error("Sink error:", S);
15952
15965
  }
15953
15966
  });
15954
- return new Wp(T, c);
15967
+ return new Hp(T, c);
15955
15968
  });
15956
15969
  }
15957
15970
  }
@@ -15980,7 +15993,7 @@ function zc(i) {
15980
15993
  e.abort(new DOMException("signal timed out after ".concat(i, " ms"), "TimeoutError"));
15981
15994
  }, i), e.signal;
15982
15995
  }
15983
- const re = 1, tt = 2, xa = 4, Kp = 8, La = 0, Na = 12, Ua = 5, Gp = 7, Fa = 3, zp = 3, Ba = 2, Va = 1, qa = 0, ja = 3, Bn = 2, Wa = 2, Jp = 1, $p = 0;
15996
+ const re = 1, tt = 2, xa = 4, Gp = 8, La = 0, Na = 12, Ua = 5, zp = 7, Fa = 3, Jp = 3, Ba = 2, Va = 1, qa = 0, ja = 3, Bn = 2, Wa = 2, $p = 1, Yp = 0;
15984
15997
  var it;
15985
15998
  (function(i) {
15986
15999
  i[i.TooShort = 0] = "TooShort", i[i.HeaderOverrun = 1] = "HeaderOverrun", i[i.MissingExtWords = 2] = "MissingExtWords", i[i.UnsupportedVersion = 3] = "UnsupportedVersion", i[i.InvalidHandle = 4] = "InvalidHandle", i[i.MalformedExt = 5] = "MalformedExt";
@@ -16049,7 +16062,7 @@ class je extends Jc {
16049
16062
  }
16050
16063
  toBinaryInto(e) {
16051
16064
  let t = 0;
16052
- e.setUint8(t, je.tag), t += re, e.setUint8(t, je.lengthBytes), t += re, e.setBigUint64(t, this.timestamp), t += Kp;
16065
+ e.setUint8(t, je.tag), t += re, e.setUint8(t, je.lengthBytes), t += re, e.setBigUint64(t, this.timestamp), t += Gp;
16053
16066
  const n = this.toBinaryLengthBytes();
16054
16067
  if (t !== n)
16055
16068
  throw new Error("DataTrackUserTimestampExtension.toBinaryInto: Wrote ".concat(t, " bytes but expected length was ").concat(n, " bytes"));
@@ -16124,7 +16137,7 @@ class Yt extends Ri {
16124
16137
  const a = t.getUint8(r);
16125
16138
  r += re;
16126
16139
  const o = t.getUint8(r);
16127
- if (r += re, a !== $p)
16140
+ if (r += re, a !== Yp)
16128
16141
  switch (a) {
16129
16142
  case nn.UserTimestamp:
16130
16143
  if (t.byteLength - r < je.lengthBytes)
@@ -16280,11 +16293,11 @@ class On extends Ri {
16280
16293
  let n = 0;
16281
16294
  const s = t.getUint8(n);
16282
16295
  n += re;
16283
- const r = s >> Ua & Gp;
16296
+ const r = s >> Ua & zp;
16284
16297
  if (r > La)
16285
16298
  throw Te.unsupportedVersion(r);
16286
16299
  let a;
16287
- switch (s >> Fa & zp) {
16300
+ switch (s >> Fa & Jp) {
16288
16301
  case Ba:
16289
16302
  a = ee.Start;
16290
16303
  break;
@@ -16299,11 +16312,11 @@ class On extends Ri {
16299
16312
  a = ee.Inter;
16300
16313
  break;
16301
16314
  }
16302
- const o = (s >> Wa & Jp) > 0;
16315
+ const o = (s >> Wa & $p) > 0;
16303
16316
  n += re;
16304
16317
  let d;
16305
16318
  try {
16306
- d = $h.fromNumber(t.getUint16(n));
16319
+ d = Yh.fromNumber(t.getUint16(n));
16307
16320
  } catch (p) {
16308
16321
  throw p instanceof tn && (p.isReason(Ot.Reserved) || p.isReason(Ot.TooLarge)) ? Te.invalidHandle(p) : p;
16309
16322
  }
@@ -16324,8 +16337,8 @@ class On extends Ri {
16324
16337
  if (n + m > t.byteLength)
16325
16338
  throw Te.headerOverrun();
16326
16339
  let T = new DataView(t.buffer, t.byteOffset + n, m);
16327
- const k = Yt.fromBinary(T), S = U(k, 2), L = S[0], v = S[1];
16328
- h = L, n += v;
16340
+ const k = Yt.fromBinary(T), S = U(k, 2), N = S[0], v = S[1];
16341
+ h = N, n += v;
16329
16342
  }
16330
16343
  return [new On({
16331
16344
  marker: a,
@@ -16531,7 +16544,7 @@ class we extends xe {
16531
16544
  }
16532
16545
  }
16533
16546
  const ds = Re(pe.DataTracks);
16534
- class Yp {
16547
+ class Qp {
16535
16548
  /**
16536
16549
  * Creates a new pipeline with the given options.
16537
16550
  */
@@ -16595,8 +16608,8 @@ class Yp {
16595
16608
  });
16596
16609
  }
16597
16610
  }
16598
- const fe = Re(pe.DataTracks), Qp = 1e4, Xp = 16;
16599
- class Zp extends Ie.EventEmitter {
16611
+ const fe = Re(pe.DataTracks), Xp = 1e4, Zp = 16;
16612
+ class ef extends Ie.EventEmitter {
16600
16613
  constructor(e) {
16601
16614
  var t;
16602
16615
  super(), this.descriptors = /* @__PURE__ */ new Map(), this.subscriptionHandles = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
@@ -16625,7 +16638,7 @@ class Zp extends Ie.EventEmitter {
16625
16638
  * @internal
16626
16639
  **/
16627
16640
  openSubscriptionStream(e, t) {
16628
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xp, s = null;
16641
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Zp, s = null;
16629
16642
  const r = new he(), a = () => {
16630
16643
  t == null || t.removeEventListener("abort", d);
16631
16644
  }, o = () => {
@@ -16749,7 +16762,7 @@ class Zp extends Ie.EventEmitter {
16749
16762
  sid: e,
16750
16763
  subscribe: !0
16751
16764
  });
16752
- const r = zc(Qp);
16765
+ const r = zc(Xp);
16753
16766
  yield s(n, t, r);
16754
16767
  return;
16755
16768
  }
@@ -16904,7 +16917,7 @@ class Zp extends Ie.EventEmitter {
16904
16917
  return;
16905
16918
  }
16906
16919
  case "pending": {
16907
- const a = new Yp({
16920
+ const a = new Qp({
16908
16921
  info: r.info,
16909
16922
  publisherIdentity: r.publisherIdentity,
16910
16923
  e2eeManager: this.e2eeManager,
@@ -17248,10 +17261,10 @@ class Oi {
17248
17261
  this.e2eeManager = e;
17249
17262
  }
17250
17263
  processFrame(e) {
17251
- return Du(this, arguments, function* () {
17264
+ return Au(this, arguments, function* () {
17252
17265
  const n = yield Zt(this.encryptIfNeeded(e));
17253
17266
  try {
17254
- yield Zt(yield* Au(Ve(this.packetizer.packetize(n))));
17267
+ yield Zt(yield* Ou(Ve(this.packetizer.packetize(n))));
17255
17268
  } catch (s) {
17256
17269
  throw s instanceof Di ? xn.packetizer(s) : s;
17257
17270
  }
@@ -17291,11 +17304,11 @@ const $e = Re(pe.DataTracks), Ha = {
17291
17304
  unpublishingFuture: new he()
17292
17305
  };
17293
17306
  }
17294
- }, ef = 1e4;
17307
+ }, tf = 1e4;
17295
17308
  class yr extends Ie.EventEmitter {
17296
17309
  constructor(e) {
17297
17310
  var t;
17298
- super(), this.handleAllocator = new Yh(), this.descriptors = /* @__PURE__ */ new Map(), this.inFlightPacketCounter = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
17311
+ super(), this.handleAllocator = new Qh(), this.descriptors = /* @__PURE__ */ new Map(), this.inFlightPacketCounter = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
17299
17312
  }
17300
17313
  static withDescriptors(e) {
17301
17314
  const t = new yr();
@@ -17381,7 +17394,7 @@ class yr extends Ie.EventEmitter {
17381
17394
  const n = this.handleAllocator.get();
17382
17395
  if (!n)
17383
17396
  throw de.limitReached();
17384
- const s = zc(ef), r = t ? Gc([t, s]) : s;
17397
+ const s = zc(tf), r = t ? Gc([t, s]) : s;
17385
17398
  if (this.descriptors.has(n))
17386
17399
  throw new Error("Descriptor for handle already exists");
17387
17400
  const a = Ha.pending();
@@ -17606,7 +17619,7 @@ var me;
17606
17619
  (function(i) {
17607
17620
  i.RPC_REQUEST_ID = "lk.rpc_request_id", i.RPC_REQUEST_METHOD = "lk.rpc_request_method", i.RPC_REQUEST_RESPONSE_TIMEOUT_MS = "lk.rpc_request_response_timeout_ms", i.RPC_REQUEST_VERSION = "lk.rpc_request_version";
17608
17621
  })(me || (me = {}));
17609
- const tf = 1, nd = 2;
17622
+ const nf = 1, nd = 2;
17610
17623
  function kr(i) {
17611
17624
  return new TextEncoder().encode(i).length;
17612
17625
  }
@@ -17621,7 +17634,7 @@ function Ka(i, e) {
17621
17634
  }
17622
17635
  return i.slice(0, t);
17623
17636
  }
17624
- class nf extends Ie.EventEmitter {
17637
+ class sf extends Ie.EventEmitter {
17625
17638
  constructor(e, t, n, s) {
17626
17639
  super(), this.pendingAcks = /* @__PURE__ */ new Map(), this.pendingResponses = /* @__PURE__ */ new Map(), this.log = e, this.outgoingDataStreamManager = t, this.getRemoteParticipantClientProtocol = n, this.getServerVersion = s;
17627
17640
  }
@@ -17654,10 +17667,10 @@ class nf extends Ie.EventEmitter {
17654
17667
  var v;
17655
17668
  n.pendingResponses.delete(m), (v = T.reject) === null || v === void 0 || v.call(T, J.builtIn("RESPONSE_TIMEOUT"));
17656
17669
  }, d);
17657
- const L = T.promise.finally(() => {
17670
+ const N = T.promise.finally(() => {
17658
17671
  clearTimeout(k), n.pendingAcks.has(m) && (n.log.warn("RPC response received before ack", m), n.pendingAcks.delete(m), clearTimeout(S));
17659
17672
  });
17660
- return [m, L];
17673
+ return [m, N];
17661
17674
  }();
17662
17675
  });
17663
17676
  }
@@ -17688,7 +17701,7 @@ class nf extends Ie.EventEmitter {
17688
17701
  method: n,
17689
17702
  payload: s,
17690
17703
  responseTimeoutMs: r,
17691
- version: tf
17704
+ version: nf
17692
17705
  })
17693
17706
  }
17694
17707
  })
@@ -17757,7 +17770,7 @@ class nf extends Ie.EventEmitter {
17757
17770
  }
17758
17771
  }
17759
17772
  }
17760
- class sf extends Ie.EventEmitter {
17773
+ class rf extends Ie.EventEmitter {
17761
17774
  constructor(e, t, n) {
17762
17775
  super(), this.rpcHandlers = /* @__PURE__ */ new Map(), this.log = e, this.outgoingDataStreamManager = t, this.getRemoteParticipantClientProtocol = n;
17763
17776
  }
@@ -17910,7 +17923,7 @@ class sf extends Ie.EventEmitter {
17910
17923
  });
17911
17924
  }
17912
17925
  }
17913
- class rf extends Nc {
17926
+ class af extends Nc {
17914
17927
  constructor(e, t, n, s, r, a) {
17915
17928
  super(e, t, _.Kind.Audio, n, a), this.monitorReceiver = () => f(this, void 0, void 0, function* () {
17916
17929
  if (!this.receiver) {
@@ -18199,7 +18212,7 @@ function xi(i, e) {
18199
18212
  m != null && m.deviceId && At(m.deviceId) !== k ? m.deviceId = k : m || (m = {
18200
18213
  deviceId: k
18201
18214
  });
18202
- const S = yp(p, m, e);
18215
+ const S = kp(p, m, e);
18203
18216
  return S.kind === _.Kind.Video ? S.source = _.Source.Camera : S.kind === _.Kind.Audio && (S.source = _.Source.Microphone), S.mediaStream = h, Ze(S) && s ? yield S.setProcessor(s) : dt(S) && r && (yield S.setProcessor(r)), S;
18204
18217
  })));
18205
18218
  } catch (h) {
@@ -18212,7 +18225,7 @@ function xi(i, e) {
18212
18225
  }
18213
18226
  });
18214
18227
  }
18215
- function af(i) {
18228
+ function of(i) {
18216
18229
  return f(this, void 0, void 0, function* () {
18217
18230
  return (yield xi({
18218
18231
  audio: !1,
@@ -18220,7 +18233,7 @@ function af(i) {
18220
18233
  }))[0];
18221
18234
  });
18222
18235
  }
18223
- function of(i) {
18236
+ function cf(i) {
18224
18237
  return f(this, void 0, void 0, function* () {
18225
18238
  return (yield xi({
18226
18239
  audio: !0,
@@ -18232,7 +18245,7 @@ var ft;
18232
18245
  (function(i) {
18233
18246
  i.Excellent = "excellent", i.Good = "good", i.Poor = "poor", i.Lost = "lost", i.Unknown = "unknown";
18234
18247
  })(ft || (ft = {}));
18235
- function cf(i) {
18248
+ function df(i) {
18236
18249
  switch (i) {
18237
18250
  case fn.EXCELLENT:
18238
18251
  return ft.Excellent;
@@ -18354,7 +18367,7 @@ class id extends Ie.EventEmitter {
18354
18367
  * Updates metadata from server
18355
18368
  **/
18356
18369
  _setAttributes(e) {
18357
- const t = rh(this.attributes, e);
18370
+ const t = ah(this.attributes, e);
18358
18371
  this._attributes = e, Object.keys(t).length > 0 && this.emit(M.AttributesChanged, t);
18359
18372
  }
18360
18373
  /** @internal */
@@ -18373,7 +18386,7 @@ class id extends Ie.EventEmitter {
18373
18386
  /** @internal */
18374
18387
  setConnectionQuality(e) {
18375
18388
  const t = this._connectionQuality;
18376
- this._connectionQuality = cf(e), t !== this._connectionQuality && this.emit(M.ConnectionQualityChanged, this._connectionQuality);
18389
+ this._connectionQuality = df(e), t !== this._connectionQuality && this.emit(M.ConnectionQualityChanged, this._connectionQuality);
18377
18390
  }
18378
18391
  /**
18379
18392
  * @internal
@@ -18405,7 +18418,7 @@ class id extends Ie.EventEmitter {
18405
18418
  }
18406
18419
  }
18407
18420
  }
18408
- function df(i) {
18421
+ function lf(i) {
18409
18422
  var e, t, n;
18410
18423
  if (!i.participantSid && !i.participantIdentity)
18411
18424
  throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");
@@ -18416,7 +18429,7 @@ function df(i) {
18416
18429
  trackSids: i.allowedTrackSids || []
18417
18430
  });
18418
18431
  }
18419
- class lf extends id {
18432
+ class uf extends id {
18420
18433
  /** @internal */
18421
18434
  constructor(e, t, n, s, r, a, o, d) {
18422
18435
  super(e, t, void 0, void 0, void 0, {
@@ -18466,7 +18479,7 @@ class lf extends id {
18466
18479
  this.log.debug("updating track subscription permissions", {
18467
18480
  allParticipantsAllowed: this.allParticipantsAllowedToSubscribe,
18468
18481
  participantTrackPermissions: this.participantTrackPermissions
18469
- }), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((c) => df(c)));
18482
+ }), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((c) => lf(c)));
18470
18483
  }, this.onTrackUnmuted = (c) => {
18471
18484
  this.onTrackMuted(c, c.isUpstreamPaused);
18472
18485
  }, this.onTrackMuted = (c, l) => {
@@ -18503,10 +18516,10 @@ class lf extends id {
18503
18516
  return;
18504
18517
  const T = yield m.videoTrack.setPublishingCodecs(c.subscribedCodecs);
18505
18518
  try {
18506
- for (var k = !0, S = Ve(T), L; L = yield S.next(), l = L.done, !l; k = !0) {
18507
- p = L.value, k = !1;
18519
+ for (var k = !0, S = Ve(T), N; N = yield S.next(), l = N.done, !l; k = !0) {
18520
+ p = N.value, k = !1;
18508
18521
  const v = p;
18509
- eh(v) && (this.log.debug("publish ".concat(v, " for ").concat(m.videoTrack.sid), H(m)), yield this.publishAdditionalCodecForTrack(m.videoTrack, v, m.options));
18522
+ th(v) && (this.log.debug("publish ".concat(v, " for ").concat(m.videoTrack.sid), H(m)), yield this.publishAdditionalCodecForTrack(m.videoTrack, v, m.options));
18510
18523
  }
18511
18524
  } catch (v) {
18512
18525
  u = {
@@ -18824,8 +18837,8 @@ class lf extends id {
18824
18837
  return f(this, void 0, void 0, function* () {
18825
18838
  if (e === void 0 && (e = {}), navigator.mediaDevices.getDisplayMedia === void 0)
18826
18839
  throw new ir("getDisplayMedia not supported");
18827
- e.resolution === void 0 && !mh() && (e.resolution = sr.h1080fps30.resolution);
18828
- const t = nh(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
18840
+ e.resolution === void 0 && !gh() && (e.resolution = sr.h1080fps30.resolution);
18841
+ const t = ih(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
18829
18842
  if (s.length === 0)
18830
18843
  throw new ct("no video track found");
18831
18844
  const r = new mi(s[0], void 0, !1, {
@@ -18930,8 +18943,8 @@ class lf extends id {
18930
18943
  return r.log.warn("track has already been published, skipping", H(p)), p;
18931
18944
  const g = Object.assign(Object.assign({}, r.roomOptions.publishDefaults), s), m = "channelCount" in n.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
18932
18945
  n.mediaStreamTrack.getSettings().channelCount === 2 || n.mediaStreamTrack.getConstraints().channelCount === 2, T = (c = g.forceStereo) !== null && c !== void 0 ? c : m;
18933
- T && (g.dtx === void 0 && r.log.debug("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", H(n)), g.red === void 0 && r.log.debug("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = g.dtx) !== null && l !== void 0 || (g.dtx = !1), (u = g.red) !== null && u !== void 0 || (g.red = !1)), !vh() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2"), g.simulcast = !1), g.source && (n.source = g.source);
18934
- const k = new Promise((S, L) => f(r, void 0, void 0, function* () {
18946
+ T && (g.dtx === void 0 && r.log.debug("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", H(n)), g.red === void 0 && r.log.debug("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = g.dtx) !== null && l !== void 0 || (g.dtx = !1), (u = g.red) !== null && u !== void 0 || (g.red = !1)), !bh() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2"), g.simulcast = !1), g.source && (n.source = g.source);
18947
+ const k = new Promise((S, N) => f(r, void 0, void 0, function* () {
18935
18948
  try {
18936
18949
  if (this.engine.client.currentState !== Y.CONNECTED) {
18937
18950
  this.log.debug("deferring track publication until signal is connected", {
@@ -18939,7 +18952,7 @@ class lf extends id {
18939
18952
  });
18940
18953
  let v = !1;
18941
18954
  const y = setTimeout(() => {
18942
- v = !0, n.stop(), L(new ta("publishing rejected as engine not connected within timeout", 408));
18955
+ v = !0, n.stop(), N(new ta("publishing rejected as engine not connected within timeout", 408));
18943
18956
  }, 15e3);
18944
18957
  if (yield this.waitUntilEngineConnected(), clearTimeout(y), v)
18945
18958
  return;
@@ -18950,10 +18963,10 @@ class lf extends id {
18950
18963
  const v = yield this.publish(n, g, T);
18951
18964
  S(v);
18952
18965
  } catch (v) {
18953
- L(v);
18966
+ N(v);
18954
18967
  }
18955
18968
  } catch (v) {
18956
- L(v);
18969
+ N(v);
18957
18970
  }
18958
18971
  }));
18959
18972
  r.pendingPublishPromises.set(n, k);
@@ -18978,19 +18991,19 @@ class lf extends id {
18978
18991
  if (!this.permissions)
18979
18992
  return this.log.warn("no permissions present for publishing track", H(e)), !1;
18980
18993
  const t = this.permissions, n = t.canPublish, s = t.canPublishSources;
18981
- return n && (s.length === 0 || s.map((r) => ah(r)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", H(e)), !1);
18994
+ return n && (s.length === 0 || s.map((r) => oh(r)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", H(e)), !1);
18982
18995
  }
18983
18996
  publish(e, t, n) {
18984
18997
  return f(this, void 0, void 0, function* () {
18985
18998
  var s, r, a, o, d, c, l, u, h, p;
18986
18999
  if (!this.hasPermissionsToPublish(e))
18987
19000
  throw new ta("failed to publish track, insufficient permissions", 403);
18988
- Array.from(this.trackPublications.values()).find((A) => zt(e) && A.source === e.source) && e.source !== _.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), H(e)), t.stopMicTrackOnMute && Ze(e) && (e.stopOnMute = !0), e.source === _.Source.ScreenShare && Lt() && (t.simulcast = !1), t.videoCodec === "av1" && !uh() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !hh() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Fs), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((A) => t.videoCodec === yn(A.mime)) || (t.videoCodec = yn(this.enabledPublishVideoCodecs[0].mime)));
19001
+ Array.from(this.trackPublications.values()).find((A) => zt(e) && A.source === e.source) && e.source !== _.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), H(e)), t.stopMicTrackOnMute && Ze(e) && (e.stopOnMute = !0), e.source === _.Source.ScreenShare && Lt() && (t.simulcast = !1), t.videoCodec === "av1" && !hh() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !ph() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Fs), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((A) => t.videoCodec === yn(A.mime)) || (t.videoCodec = yn(this.enabledPublishVideoCodecs[0].mime)));
18989
19002
  const m = t.videoCodec;
18990
19003
  e.on(R.Muted, this.onTrackMuted), e.on(R.Unmuted, this.onTrackUnmuted), e.on(R.Ended, this.handleTrackEnded), e.on(R.UpstreamPaused, this.onTrackUpstreamPaused), e.on(R.UpstreamResumed, this.onTrackUpstreamResumed), e.on(R.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
18991
19004
  const T = [], k = !(!((s = t.dtx) !== null && s !== void 0) || s), S = e.getSourceTrackSettings();
18992
19005
  S.autoGainControl && T.push(le.TF_AUTO_GAIN_CONTROL), S.echoCancellation && T.push(le.TF_ECHO_CANCELLATION), S.noiseSuppression && T.push(le.TF_NOISE_SUPPRESSION), S.channelCount && S.channelCount > 1 && T.push(le.TF_STEREO), k && T.push(le.TF_NO_DTX), nt(e) && e.hasPreConnectBuffer && T.push(le.TF_PRECONNECT_BUFFER);
18993
- const L = this.normalizeRequestedFrameMetadataOptions(e, t), v = new En({
19006
+ const N = this.normalizeRequestedFrameMetadataOptions(e, t), v = new En({
18994
19007
  // get local track id for use during publishing
18995
19008
  cid: e.mediaStreamTrack.id,
18996
19009
  name: t.name,
@@ -19004,7 +19017,7 @@ class lf extends id {
19004
19017
  stream: t == null ? void 0 : t.stream,
19005
19018
  backupCodecPolicy: t == null ? void 0 : t.backupCodecPolicy,
19006
19019
  audioFeatures: T,
19007
- packetTrailerFeatures: L
19020
+ packetTrailerFeatures: N
19008
19021
  });
19009
19022
  let y;
19010
19023
  if (e.kind === _.Kind.Video) {
@@ -19041,7 +19054,7 @@ class lf extends id {
19041
19054
  var A, O, B;
19042
19055
  if (!this.engine.pcManager)
19043
19056
  throw new ne("pcManager is not ready");
19044
- if (e.sender = yield this.engine.createSender(e, t, y), Je(e) && (e.publishOptions = t), this.emit(M.LocalSenderCreated, e.sender, e), Je(e) && ((A = t.degradationPreference) !== null && A !== void 0 || (t.degradationPreference = Rp(e)), e.setDegradationPreference(t.degradationPreference)), y)
19057
+ if (e.sender = yield this.engine.createSender(e, t, y), Je(e) && (e.publishOptions = t), this.emit(M.LocalSenderCreated, e.sender, e), Je(e) && ((A = t.degradationPreference) !== null && A !== void 0 || (t.degradationPreference = Ip(e)), e.setDegradationPreference(t.degradationPreference)), y)
19045
19058
  if (Lt() && e.kind === _.Kind.Audio) {
19046
19059
  let W;
19047
19060
  for (const Z of this.engine.pcManager.publisher.getTransceivers())
@@ -19062,7 +19075,7 @@ class lf extends id {
19062
19075
  yield this.engine.negotiate();
19063
19076
  });
19064
19077
  let I;
19065
- const x = new Promise((A, O) => f(this, void 0, void 0, function* () {
19078
+ const L = new Promise((A, O) => f(this, void 0, void 0, function* () {
19066
19079
  var B;
19067
19080
  try {
19068
19081
  I = yield this.engine.addTrack(v), A(I);
@@ -19082,10 +19095,10 @@ class lf extends id {
19082
19095
  O(W);
19083
19096
  }
19084
19097
  }));
19085
- if (this.enabledPublishVideoCodecs.length > 0 && L.length === 0)
19086
- I = (yield Promise.all([x, C()]))[0];
19098
+ if (this.enabledPublishVideoCodecs.length > 0 && N.length === 0)
19099
+ I = (yield Promise.all([L, C()]))[0];
19087
19100
  else {
19088
- I = yield x;
19101
+ I = yield L;
19089
19102
  let A;
19090
19103
  if (I.codecs.forEach((O) => {
19091
19104
  A === void 0 && (A = O.mimeType);
@@ -19179,7 +19192,7 @@ class lf extends id {
19179
19192
  return t.frameMetadata = void 0, t.packetTrailer = void 0, [];
19180
19193
  if (!this.canPublishFrameMetadata())
19181
19194
  return this.log.warn("frame metadata transform not supported; not advertising features", Object.assign(Object.assign({}, this.logContext), H(e))), t.frameMetadata = void 0, t.packetTrailer = void 0, [];
19182
- const r = Vh(s), a = qh(r);
19195
+ const r = qh(s), a = jh(r);
19183
19196
  return t.frameMetadata = a, t.packetTrailer = a, r;
19184
19197
  }
19185
19198
  get isLocal() {
@@ -19556,7 +19569,7 @@ class Ga extends DOMException {
19556
19569
  super(e, "AbortError"), this.reason = t;
19557
19570
  }
19558
19571
  }
19559
- class uf extends Map {
19572
+ class hf extends Map {
19560
19573
  constructor() {
19561
19574
  super(...arguments), this.pending = /* @__PURE__ */ new Map();
19562
19575
  }
@@ -19603,7 +19616,7 @@ class uf extends Map {
19603
19616
  });
19604
19617
  }
19605
19618
  }
19606
- class hf extends rt {
19619
+ class pf extends rt {
19607
19620
  constructor(e, t, n, s) {
19608
19621
  super(e, t.sid, t.name, s), this.track = void 0, this.allowed = !0, this.requestedDisabled = void 0, this.visible = !0, this.handleEnded = (r) => {
19609
19622
  this.setTrack(void 0), this.emit(R.Ended, r);
@@ -19737,7 +19750,7 @@ class hf extends rt {
19737
19750
  if (t)
19738
19751
  sa(this.videoDimensionsAdaptiveStream, t) && (this.log.debug("using adaptive stream dimensions instead of requested", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
19739
19752
  else if (this.requestedMaxQuality !== void 0 && this.trackInfo) {
19740
- const n = oh(this.trackInfo, this.requestedMaxQuality);
19753
+ const n = ch(this.trackInfo, this.requestedMaxQuality);
19741
19754
  n && sa(this.videoDimensionsAdaptiveStream, n) && (this.log.debug("using adaptive stream dimensions instead of max quality layer", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
19742
19755
  } else
19743
19756
  this.log.debug("using adaptive stream dimensions", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream;
@@ -19769,7 +19782,7 @@ class vi extends id {
19769
19782
  /** @internal */
19770
19783
  constructor(e, t, n, s, r, a, o) {
19771
19784
  let d = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : wn.STANDARD, c = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : [], l = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : wc;
19772
- super(t, n || "", s, r, a, o, d), this.signalClient = e, this.trackPublications = /* @__PURE__ */ new Map(), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.dataTracks = new uf(c.map((u) => [u.info.name, u])), this.volumeMap = /* @__PURE__ */ new Map(), this.clientProtocol = l;
19785
+ super(t, n || "", s, r, a, o, d), this.signalClient = e, this.trackPublications = /* @__PURE__ */ new Map(), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.dataTracks = new hf(c.map((u) => [u.info.name, u])), this.volumeMap = /* @__PURE__ */ new Map(), this.clientProtocol = l;
19773
19786
  }
19774
19787
  addTrackPublication(e) {
19775
19788
  super.addTrackPublication(e), e.on(R.UpdateSettings, (t) => {
@@ -19845,7 +19858,7 @@ class vi extends id {
19845
19858
  }
19846
19859
  const d = e.kind === "video";
19847
19860
  let c;
19848
- return d ? c = new lr(e, t, s, r) : c = new rf(e, t, s, this.audioContext, this.audioOutput), c.source = o.source, c.isMuted = o.isMuted, c.setMediaStream(n), c.start(), o.setTrack(c), this.volumeMap.has(o.source) && Ns(c) && Ze(c) && c.setVolume(this.volumeMap.get(o.source)), o;
19861
+ return d ? c = new lr(e, t, s, r) : c = new af(e, t, s, this.audioContext, this.audioOutput), c.source = o.source, c.isMuted = o.isMuted, c.setMediaStream(n), c.start(), o.setTrack(c), this.volumeMap.has(o.source) && Ns(c) && Ze(c) && c.setVolume(this.volumeMap.get(o.source)), o;
19849
19862
  }
19850
19863
  /** @internal */
19851
19864
  get hasMetadata() {
@@ -19871,7 +19884,7 @@ class vi extends id {
19871
19884
  const d = _.kindFromProto(s.type);
19872
19885
  if (!d)
19873
19886
  return;
19874
- o = new hf(d, s, (r = this.signalClient.connectOptions) === null || r === void 0 ? void 0 : r.autoSubscribe, {
19887
+ o = new pf(d, s, (r = this.signalClient.connectOptions) === null || r === void 0 ? void 0 : r.autoSubscribe, {
19875
19888
  loggerContextCb: () => this.logContext,
19876
19889
  loggerName: (a = this.loggerOptions) === null || a === void 0 ? void 0 : a.loggerName
19877
19890
  }), o.updateInfo(s), n.set(s.sid, o);
@@ -19943,7 +19956,7 @@ var z;
19943
19956
  (function(i) {
19944
19957
  i.Disconnected = "disconnected", i.Connecting = "connecting", i.Connected = "connected", i.Reconnecting = "reconnecting", i.SignalReconnecting = "signalReconnecting";
19945
19958
  })(z || (z = {}));
19946
- const pf = 4 * 1e3;
19959
+ const ff = 4 * 1e3;
19947
19960
  class sn extends Ie.EventEmitter {
19948
19961
  get hasE2EESetup() {
19949
19962
  return this.e2eeManager !== void 0;
@@ -19956,7 +19969,7 @@ class sn extends Ie.EventEmitter {
19956
19969
  var t, n, s, r, a, o, d;
19957
19970
  if (super(), t = this, this.state = z.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.e2eeStateMutex = new ge(), this.isVideoPlaybackBlocked = !1, this.log = q, this.bufferedEvents = [], this.isResuming = !1, this.connect = (c, l, u) => f(this, void 0, void 0, function* () {
19958
19971
  var h;
19959
- if (!ph())
19972
+ if (!fh())
19960
19973
  throw Ge() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
19961
19974
  const p = yield this.disconnectLock.lock();
19962
19975
  if (this.state === z.Connected)
@@ -19972,7 +19985,7 @@ class sn extends Ie.EventEmitter {
19972
19985
  });
19973
19986
  }));
19974
19987
  const g = (T, k, S) => f(this, void 0, void 0, function* () {
19975
- var L, v;
19988
+ var N, v;
19976
19989
  this.abortController && this.abortController.abort();
19977
19990
  const y = new AbortController();
19978
19991
  this.abortController = y, p == null || p();
@@ -19984,10 +19997,10 @@ class sn extends Ie.EventEmitter {
19984
19997
  if (this.regionUrlProvider && C instanceof F && C.reason !== Q.Cancelled && C.reason !== Q.NotAllowed) {
19985
19998
  let I = null;
19986
19999
  try {
19987
- this.log.debug("Fetching next region"), I = yield this.regionUrlProvider.getNextBestRegionUrl((L = this.abortController) === null || L === void 0 ? void 0 : L.signal);
19988
- } catch (x) {
19989
- if (x instanceof F && (x.status === 401 || x.reason === Q.Cancelled)) {
19990
- this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), k(x);
20000
+ this.log.debug("Fetching next region"), I = yield this.regionUrlProvider.getNextBestRegionUrl((N = this.abortController) === null || N === void 0 ? void 0 : N.signal);
20001
+ } catch (L) {
20002
+ if (L instanceof F && (L.status === 401 || L.reason === Q.Cancelled)) {
20003
+ this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), k(L);
19991
20004
  return;
19992
20005
  }
19993
20006
  }
@@ -20015,7 +20028,7 @@ class sn extends Ie.EventEmitter {
20015
20028
  websocketTimeout: h.websocketTimeout
20016
20029
  }, g.signal, !p.singlePeerConnection), k = T.joinResponse, S = T.serverInfo;
20017
20030
  if (this.serverInfo = S, !S.version)
20018
- throw new $u("unknown server version");
20031
+ throw new Yu("unknown server version");
20019
20032
  return S.version === "0.15.1" && this.options.dynacast && (this.log.debug("disabling dynacast due to server version"), p.dynacast = !1), k;
20020
20033
  }), this.applyJoinResponse = (c) => {
20021
20034
  const l = c.participant;
@@ -20240,10 +20253,10 @@ class sn extends Ie.EventEmitter {
20240
20253
  }, this.handleSipDtmf = (c, l) => {
20241
20254
  this.emit(E.SipDTMFReceived, l, c), c == null || c.emit(M.SipDTMFReceived, l);
20242
20255
  }, this.handleTranscription = (c, l) => {
20243
- const u = l.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(l.transcribedParticipantIdentity), h = u == null ? void 0 : u.trackPublications.get(l.trackId), p = Ch(l, this.transcriptionReceivedTimes);
20256
+ const u = l.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(l.transcribedParticipantIdentity), h = u == null ? void 0 : u.trackPublications.get(l.trackId), p = _h(l, this.transcriptionReceivedTimes);
20244
20257
  h == null || h.emit(R.TranscriptionReceived, p), u == null || u.emit(M.TranscriptionReceived, p, h), this.emit(E.TranscriptionReceived, p, u, h);
20245
20258
  }, this.handleChatMessage = (c, l) => {
20246
- const u = _h(l);
20259
+ const u = wh(l);
20247
20260
  this.emit(E.ChatMessage, u, c);
20248
20261
  }, this.handleMetrics = (c, l) => {
20249
20262
  this.emit(E.MetricsReceived, c, l);
@@ -20309,7 +20322,7 @@ class sn extends Ie.EventEmitter {
20309
20322
  this.emit(E.ParticipantPermissionsChanged, c, this.localParticipant);
20310
20323
  }, this.onLocalChatMessageSent = (c) => {
20311
20324
  this.emit(E.ChatMessage, c, this.localParticipant);
20312
- }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, hp), e), this.log = Re((n = this.options.loggerName) !== null && n !== void 0 ? n : pe.Room, () => this.logContext), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, Fc), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, Bc), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, up), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new qp(), this.outgoingDataStreamManager = new Hp(this.engine, this.log), this.incomingDataTrackManager = new Zp({
20325
+ }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pp), e), this.log = Re((n = this.options.loggerName) !== null && n !== void 0 ? n : pe.Room, () => this.logContext), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, Fc), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, Bc), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, hp), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new jp(), this.outgoingDataStreamManager = new Kp(this.engine, this.log), this.incomingDataTrackManager = new ef({
20313
20326
  e2eeManager: this.e2eeManager
20314
20327
  }), this.incomingDataTrackManager.on("sfuUpdateSubscription", (c) => {
20315
20328
  this.engine.client.sendUpdateDataSubscription(c.sid, c.subscribe);
@@ -20332,18 +20345,18 @@ class sn extends Ie.EventEmitter {
20332
20345
  }).on("packetAvailable", (c) => {
20333
20346
  let l = c.handle, u = c.bytes;
20334
20347
  this.engine.sendLossyBytes(u, j.DATA_TRACK_LOSSY, "wait").finally(() => this.outgoingDataTrackManager.handlePacketSendComplete(l));
20335
- }), this.registerRpcDataStreamHandler(), this.rpcClientManager = new nf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol, () => {
20348
+ }), this.registerRpcDataStreamHandler(), this.rpcClientManager = new sf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol, () => {
20336
20349
  var c, l;
20337
20350
  return (l = (c = this.engine.latestJoinResponse) === null || c === void 0 ? void 0 : c.serverInfo) === null || l === void 0 ? void 0 : l.version;
20338
20351
  }), this.rpcClientManager.on("sendDataPacket", (c) => {
20339
20352
  let l = c.packet;
20340
20353
  var u;
20341
20354
  (u = this.engine) === null || u === void 0 || u.sendDataPacket(l, j.RELIABLE);
20342
- }), this.rpcServerManager = new sf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol), this.rpcServerManager.on("sendDataPacket", (c) => {
20355
+ }), this.rpcServerManager = new rf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol), this.rpcServerManager.on("sendDataPacket", (c) => {
20343
20356
  let l = c.packet;
20344
20357
  var u;
20345
20358
  (u = this.engine) === null || u === void 0 || u.sendDataPacket(l, j.RELIABLE);
20346
- }), this.disconnectLock = new ge(), this.localParticipant = new lf("", "", this.engine, this.options, this.outgoingDataStreamManager, this.outgoingDataTrackManager, this.rpcClientManager, this.rpcServerManager), this.setupFrameMetadata(), (this.options.e2ee || this.options.encryption) && this.setupE2EE(), this.engine.e2eeManager = this.e2eeManager, this.incomingDataTrackManager.updateE2eeManager((s = this.e2eeManager) !== null && s !== void 0 ? s : null), this.outgoingDataTrackManager.updateE2eeManager((r = this.e2eeManager) !== null && r !== void 0 ? r : null), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", At(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", At(this.options.audioCaptureDefaults.deviceId)), !((a = this.options.audioOutput) === null || a === void 0) && a.deviceId && this.switchActiveDevice("audiooutput", At(this.options.audioOutput.deviceId)).catch((c) => this.log.warn("Could not set audio output: ".concat(c.message))), Pe()) {
20359
+ }), this.disconnectLock = new ge(), this.localParticipant = new uf("", "", this.engine, this.options, this.outgoingDataStreamManager, this.outgoingDataTrackManager, this.rpcClientManager, this.rpcServerManager), this.setupFrameMetadata(), (this.options.e2ee || this.options.encryption) && this.setupE2EE(), this.engine.e2eeManager = this.e2eeManager, this.incomingDataTrackManager.updateE2eeManager((s = this.e2eeManager) !== null && s !== void 0 ? s : null), this.outgoingDataTrackManager.updateE2eeManager((r = this.e2eeManager) !== null && r !== void 0 ? r : null), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", At(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", At(this.options.audioCaptureDefaults.deviceId)), !((a = this.options.audioOutput) === null || a === void 0) && a.deviceId && this.switchActiveDevice("audiooutput", At(this.options.audioOutput.deviceId)).catch((c) => this.log.warn("Could not set audio output: ".concat(c.message))), Pe()) {
20347
20360
  const c = new AbortController();
20348
20361
  let l;
20349
20362
  if (sn.cleanupRegistry) {
@@ -20429,8 +20442,8 @@ class sn extends Ie.EventEmitter {
20429
20442
  setupE2EE() {
20430
20443
  var e, t;
20431
20444
  const n = !!this.options.encryption, s = this.options.encryption || this.options.e2ee;
20432
- s && ("e2eeManager" in s ? (this.e2eeManager = s.e2eeManager, this.e2eeManager.isDataChannelEncryptionEnabled = n) : this.e2eeManager = new Wh(s, n), this.e2eeManager.on(mt.ParticipantEncryptionStatusChanged, (r, a) => {
20433
- Eh(a) && (this.isE2EEEnabled = r), this.emit(E.ParticipantEncryptionStatusChanged, r, a);
20445
+ s && ("e2eeManager" in s ? (this.e2eeManager = s.e2eeManager, this.e2eeManager.isDataChannelEncryptionEnabled = n) : this.e2eeManager = new Hh(s, n), this.e2eeManager.on(mt.ParticipantEncryptionStatusChanged, (r, a) => {
20446
+ Ph(a) && (this.isE2EEEnabled = r), this.emit(E.ParticipantEncryptionStatusChanged, r, a);
20434
20447
  }), this.e2eeManager.on(mt.EncryptionError, (r, a) => {
20435
20448
  const o = a ? this.getParticipantByIdentity(a) : void 0;
20436
20449
  this.emit(E.EncryptionError, r, o);
@@ -20439,7 +20452,7 @@ class sn extends Ie.EventEmitter {
20439
20452
  setupFrameMetadata() {
20440
20453
  var e;
20441
20454
  const t = (e = this.options.frameMetadata) !== null && e !== void 0 ? e : this.options.packetTrailer;
20442
- this.frameMetadataManager = new Gh(t), this.frameMetadataManager.setup(this);
20455
+ this.frameMetadataManager = new zh(t), this.frameMetadataManager.setup(this);
20443
20456
  }
20444
20457
  get logContext() {
20445
20458
  var e, t, n;
@@ -20490,7 +20503,7 @@ class sn extends Ie.EventEmitter {
20490
20503
  return (t = (e = this.roomInfo) === null || e === void 0 ? void 0 : e.numPublishers) !== null && t !== void 0 ? t : 0;
20491
20504
  }
20492
20505
  maybeCreateEngine() {
20493
- this.engine && (this.engine.isNewlyCreated || !this.engine.isClosed) || (this.engine = new Np(this.options), this.engine.e2eeManager = this.e2eeManager, this.engine.on(P.ParticipantUpdate, this.handleParticipantUpdates).on(P.RoomUpdate, this.handleRoomUpdate).on(P.SpeakersChanged, this.handleSpeakersChanged).on(P.StreamStateChanged, this.handleStreamStateUpdate).on(P.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(P.SubscriptionError, this.handleSubscriptionError).on(P.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(P.MediaTrackAdded, (e, t, n) => {
20506
+ this.engine && (this.engine.isNewlyCreated || !this.engine.isClosed) || (this.engine = new Up(this.options), this.engine.e2eeManager = this.e2eeManager, this.engine.on(P.ParticipantUpdate, this.handleParticipantUpdates).on(P.RoomUpdate, this.handleRoomUpdate).on(P.SpeakersChanged, this.handleSpeakersChanged).on(P.StreamStateChanged, this.handleStreamStateUpdate).on(P.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(P.SubscriptionError, this.handleSubscriptionError).on(P.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(P.MediaTrackAdded, (e, t, n) => {
20494
20507
  this.onTrackAdded(e, t, n);
20495
20508
  }).on(P.Disconnected, (e) => {
20496
20509
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, e);
@@ -20778,11 +20791,11 @@ class sn extends Ie.EventEmitter {
20778
20791
  } catch (v) {
20779
20792
  throw r.options.audioCaptureDefaults.deviceId = k, v;
20780
20793
  }
20781
- const L = S.some((v) => {
20794
+ const N = S.some((v) => {
20782
20795
  var y, C;
20783
20796
  return (C = (y = v.track) === null || y === void 0 ? void 0 : y.isMuted) !== null && C !== void 0 ? C : !1;
20784
20797
  });
20785
- g && L && (m = !0);
20798
+ g && N && (m = !0);
20786
20799
  } else if (n === "videoinput") {
20787
20800
  m = r.localParticipant.videoTrackPublications.size === 0;
20788
20801
  const k = (d = r.getActiveDevice(n)) !== null && d !== void 0 ? d : r.options.videoCaptureDefaults.deviceId;
@@ -20796,11 +20809,11 @@ class sn extends Ie.EventEmitter {
20796
20809
  } catch (v) {
20797
20810
  throw r.options.videoCaptureDefaults.deviceId = k, v;
20798
20811
  }
20799
- const L = S.some((v) => {
20812
+ const N = S.some((v) => {
20800
20813
  var y, C;
20801
20814
  return (C = (y = v.track) === null || y === void 0 ? void 0 : y.isMuted) !== null && C !== void 0 ? C : !1;
20802
20815
  });
20803
- g && L && (m = !0);
20816
+ g && N && (m = !0);
20804
20817
  } else if (n === "audiooutput") {
20805
20818
  if (m = !0, !xs() && !r.options.webAudioMix || r.options.webAudioMix && r.audioContext && !("setSinkId" in r.audioContext))
20806
20819
  throw new Error("cannot switch audio output, the current browser does not support it");
@@ -20848,7 +20861,7 @@ class sn extends Ie.EventEmitter {
20848
20861
  this.log.debug("skipping incoming track as it already ended");
20849
20862
  return;
20850
20863
  }
20851
- const s = lh(t.id), r = s[0];
20864
+ const s = uh(t.id), r = s[0];
20852
20865
  let a = s[1], o = e.id;
20853
20866
  if (a && a.startsWith("TR") && (o = a), r === this.localParticipant.sid) {
20854
20867
  this.log.warn("tried to create RemoteParticipant for local participant");
@@ -20942,7 +20955,7 @@ class sn extends Ie.EventEmitter {
20942
20955
  }
20943
20956
  const o = ["audiooutput", "audioinput", "videoinput"];
20944
20957
  for (let d of o) {
20945
- const c = th(d), l = this.localParticipant.getTrackPublication(c);
20958
+ const c = nh(d), l = this.localParticipant.getTrackPublication(c);
20946
20959
  if (l && (!((e = l.track) === null || e === void 0) && e.isUserProvided))
20947
20960
  continue;
20948
20961
  const u = r.filter((p) => p.kind === d), h = this.getActiveDevice(d);
@@ -21030,7 +21043,7 @@ class sn extends Ie.EventEmitter {
21030
21043
  updateSubscriptions() {
21031
21044
  for (const e of this.remoteParticipants.values())
21032
21045
  for (const t of e.videoTrackPublications.values())
21033
- t.isSubscribed && wh(t) && t.emitTrackUpdate();
21046
+ t.isSubscribed && Eh(t) && t.emitTrackUpdate();
21034
21047
  }
21035
21048
  getRemoteParticipantBySid(e) {
21036
21049
  const t = this.sidToIdentity.get(e);
@@ -21070,7 +21083,7 @@ class sn extends Ie.EventEmitter {
21070
21083
  transportsConnectedOrConnecting: this.engine.verifyTransport()
21071
21084
  } : void 0
21072
21085
  }), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, He.STATE_MISMATCH))) : e = 0;
21073
- }, pf);
21086
+ }, ff);
21074
21087
  }
21075
21088
  clearConnectionReconcile() {
21076
21089
  this.connectionReconcileInterval && ce.clearInterval(this.connectionReconcileInterval);
@@ -21304,7 +21317,7 @@ class Ct extends Ie.EventEmitter {
21304
21317
  };
21305
21318
  }
21306
21319
  }
21307
- class ff extends Ct {
21320
+ class mf extends Ct {
21308
21321
  get description() {
21309
21322
  return "Cloud regions";
21310
21323
  }
@@ -21360,7 +21373,7 @@ class ff extends Ct {
21360
21373
  }
21361
21374
  }
21362
21375
  const ls = 1e4;
21363
- class mf extends Ct {
21376
+ class gf extends Ct {
21364
21377
  get description() {
21365
21378
  return "Connection via UDP vs TCP";
21366
21379
  }
@@ -21414,14 +21427,14 @@ class mf extends Ct {
21414
21427
  });
21415
21428
  }
21416
21429
  }
21417
- class gf extends Ct {
21430
+ class vf extends Ct {
21418
21431
  get description() {
21419
21432
  return "Can publish audio";
21420
21433
  }
21421
21434
  perform() {
21422
21435
  return f(this, void 0, void 0, function* () {
21423
21436
  var e;
21424
- const t = yield this.connect(), n = yield of();
21437
+ const t = yield this.connect(), n = yield cf();
21425
21438
  if (yield Rc(n, 1e3))
21426
21439
  throw new Error("unable to detect audio from microphone");
21427
21440
  this.appendMessage("detected audio from microphone"), t.localParticipant.publishTrack(n), yield new Promise((o) => setTimeout(o, 3e3));
@@ -21437,14 +21450,14 @@ class gf extends Ct {
21437
21450
  });
21438
21451
  }
21439
21452
  }
21440
- class vf extends Ct {
21453
+ class bf extends Ct {
21441
21454
  get description() {
21442
21455
  return "Can publish video";
21443
21456
  }
21444
21457
  perform() {
21445
21458
  return f(this, void 0, void 0, function* () {
21446
21459
  var e;
21447
- const t = yield this.connect(), n = yield af();
21460
+ const t = yield this.connect(), n = yield of();
21448
21461
  yield this.checkForVideo(n.mediaStreamTrack), t.localParticipant.publishTrack(n), yield new Promise((a) => setTimeout(a, 5e3));
21449
21462
  const s = yield (e = n.sender) === null || e === void 0 ? void 0 : e.getStats();
21450
21463
  if (!s)
@@ -21484,7 +21497,7 @@ class vf extends Ct {
21484
21497
  });
21485
21498
  }
21486
21499
  }
21487
- class bf extends Ct {
21500
+ class yf extends Ct {
21488
21501
  get description() {
21489
21502
  return "Resuming connection after interruption";
21490
21503
  }
@@ -21509,7 +21522,7 @@ class bf extends Ct {
21509
21522
  });
21510
21523
  }
21511
21524
  }
21512
- class yf extends Ct {
21525
+ class kf extends Ct {
21513
21526
  get description() {
21514
21527
  return "Can connect via TURN";
21515
21528
  }
@@ -21535,7 +21548,7 @@ class yf extends Ct {
21535
21548
  });
21536
21549
  }
21537
21550
  }
21538
- class kf extends Ct {
21551
+ class Tf extends Ct {
21539
21552
  get description() {
21540
21553
  return "Establishing WebRTC connection";
21541
21554
  }
@@ -21549,7 +21562,7 @@ class kf extends Ct {
21549
21562
  if (r.candidate) {
21550
21563
  const o = new RTCIceCandidate(r);
21551
21564
  let d = "".concat(o.protocol, " ").concat(o.address, ":").concat(o.port, " ").concat(o.type);
21552
- o.address && (Tf(o.address) ? d += " (private)" : o.protocol === "tcp" && o.tcpType === "passive" ? (e = !0, d += " (passive)") : o.protocol === "udp" && (t = !0)), this.appendMessage(d);
21565
+ o.address && (Sf(o.address) ? d += " (private)" : o.protocol === "tcp" && o.tcpType === "passive" ? (e = !0, d += " (passive)") : o.protocol === "udp" && (t = !0)), this.appendMessage(d);
21553
21566
  }
21554
21567
  s && s(r, a);
21555
21568
  }, !((n = this.room.engine.pcManager) === null || n === void 0) && n.subscriber && (this.room.engine.pcManager.subscriber.onIceCandidateError = (r) => {
@@ -21565,7 +21578,7 @@ class kf extends Ct {
21565
21578
  });
21566
21579
  }
21567
21580
  }
21568
- function Tf(i) {
21581
+ function Sf(i) {
21569
21582
  const e = i.split(".");
21570
21583
  if (e.length === 4) {
21571
21584
  if (e[0] === "10")
@@ -21580,7 +21593,7 @@ function Tf(i) {
21580
21593
  }
21581
21594
  return !1;
21582
21595
  }
21583
- class Sf extends Ct {
21596
+ class Cf extends Ct {
21584
21597
  get description() {
21585
21598
  return "Connecting to signal connection via WebSocket";
21586
21599
  }
@@ -21612,7 +21625,7 @@ class Sf extends Ct {
21612
21625
  });
21613
21626
  }
21614
21627
  }
21615
- class Hf extends Ie.EventEmitter {
21628
+ class Kf extends Ie.EventEmitter {
21616
21629
  constructor(e, t) {
21617
21630
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
21618
21631
  super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = n;
@@ -21647,37 +21660,37 @@ class Hf extends Ie.EventEmitter {
21647
21660
  }
21648
21661
  checkWebsocket() {
21649
21662
  return f(this, void 0, void 0, function* () {
21650
- return this.createAndRunCheck(Sf);
21663
+ return this.createAndRunCheck(Cf);
21651
21664
  });
21652
21665
  }
21653
21666
  checkWebRTC() {
21654
21667
  return f(this, void 0, void 0, function* () {
21655
- return this.createAndRunCheck(kf);
21668
+ return this.createAndRunCheck(Tf);
21656
21669
  });
21657
21670
  }
21658
21671
  checkTURN() {
21659
21672
  return f(this, void 0, void 0, function* () {
21660
- return this.createAndRunCheck(yf);
21673
+ return this.createAndRunCheck(kf);
21661
21674
  });
21662
21675
  }
21663
21676
  checkReconnect() {
21664
21677
  return f(this, void 0, void 0, function* () {
21665
- return this.createAndRunCheck(bf);
21678
+ return this.createAndRunCheck(yf);
21666
21679
  });
21667
21680
  }
21668
21681
  checkPublishAudio() {
21669
21682
  return f(this, void 0, void 0, function* () {
21670
- return this.createAndRunCheck(gf);
21683
+ return this.createAndRunCheck(vf);
21671
21684
  });
21672
21685
  }
21673
21686
  checkPublishVideo() {
21674
21687
  return f(this, void 0, void 0, function* () {
21675
- return this.createAndRunCheck(vf);
21688
+ return this.createAndRunCheck(bf);
21676
21689
  });
21677
21690
  }
21678
21691
  checkConnectionProtocol() {
21679
21692
  return f(this, void 0, void 0, function* () {
21680
- const e = yield this.createAndRunCheck(mf);
21693
+ const e = yield this.createAndRunCheck(gf);
21681
21694
  if (e.data && "protocol" in e.data) {
21682
21695
  const t = e.data;
21683
21696
  this.options.protocol = t.protocol;
@@ -21687,7 +21700,7 @@ class Hf extends Ie.EventEmitter {
21687
21700
  }
21688
21701
  checkCloudRegion() {
21689
21702
  return f(this, void 0, void 0, function* () {
21690
- return this.createAndRunCheck(ff);
21703
+ return this.createAndRunCheck(mf);
21691
21704
  });
21692
21705
  }
21693
21706
  }
@@ -21700,7 +21713,7 @@ class _e extends Error {
21700
21713
  }
21701
21714
  }
21702
21715
  K(_e, "code", "ERR_JOSE_GENERIC");
21703
- class Cf extends _e {
21716
+ class _f extends _e {
21704
21717
  constructor(e, t) {
21705
21718
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "unspecified", s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unspecified";
21706
21719
  super(e, {
@@ -21712,8 +21725,8 @@ class Cf extends _e {
21712
21725
  }), K(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED"), K(this, "claim", void 0), K(this, "reason", void 0), K(this, "payload", void 0), this.claim = n, this.reason = s, this.payload = t;
21713
21726
  }
21714
21727
  }
21715
- K(Cf, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
21716
- class _f extends _e {
21728
+ K(_f, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
21729
+ class wf extends _e {
21717
21730
  constructor(e, t) {
21718
21731
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "unspecified", s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unspecified";
21719
21732
  super(e, {
@@ -21725,92 +21738,92 @@ class _f extends _e {
21725
21738
  }), K(this, "code", "ERR_JWT_EXPIRED"), K(this, "claim", void 0), K(this, "reason", void 0), K(this, "payload", void 0), this.claim = n, this.reason = s, this.payload = t;
21726
21739
  }
21727
21740
  }
21728
- K(_f, "code", "ERR_JWT_EXPIRED");
21729
- class wf extends _e {
21741
+ K(wf, "code", "ERR_JWT_EXPIRED");
21742
+ class Ef extends _e {
21730
21743
  constructor() {
21731
21744
  super(...arguments), K(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21732
21745
  }
21733
21746
  }
21734
- K(wf, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21735
- class Ef extends _e {
21747
+ K(Ef, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21748
+ class Pf extends _e {
21736
21749
  constructor() {
21737
21750
  super(...arguments), K(this, "code", "ERR_JOSE_NOT_SUPPORTED");
21738
21751
  }
21739
21752
  }
21740
- K(Ef, "code", "ERR_JOSE_NOT_SUPPORTED");
21741
- class Pf extends _e {
21753
+ K(Pf, "code", "ERR_JOSE_NOT_SUPPORTED");
21754
+ class Rf extends _e {
21742
21755
  constructor() {
21743
21756
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "decryption operation failed", t = arguments.length > 1 ? arguments[1] : void 0;
21744
21757
  super(e, t), K(this, "code", "ERR_JWE_DECRYPTION_FAILED");
21745
21758
  }
21746
21759
  }
21747
- K(Pf, "code", "ERR_JWE_DECRYPTION_FAILED");
21748
- class Rf extends _e {
21760
+ K(Rf, "code", "ERR_JWE_DECRYPTION_FAILED");
21761
+ class If extends _e {
21749
21762
  constructor() {
21750
21763
  super(...arguments), K(this, "code", "ERR_JWE_INVALID");
21751
21764
  }
21752
21765
  }
21753
- K(Rf, "code", "ERR_JWE_INVALID");
21754
- class If extends _e {
21766
+ K(If, "code", "ERR_JWE_INVALID");
21767
+ class Mf extends _e {
21755
21768
  constructor() {
21756
21769
  super(...arguments), K(this, "code", "ERR_JWS_INVALID");
21757
21770
  }
21758
21771
  }
21759
- K(If, "code", "ERR_JWS_INVALID");
21760
- class Mf extends _e {
21772
+ K(Mf, "code", "ERR_JWS_INVALID");
21773
+ class Df extends _e {
21761
21774
  constructor() {
21762
21775
  super(...arguments), K(this, "code", "ERR_JWT_INVALID");
21763
21776
  }
21764
21777
  }
21765
- K(Mf, "code", "ERR_JWT_INVALID");
21766
- class Df extends _e {
21778
+ K(Df, "code", "ERR_JWT_INVALID");
21779
+ class Af extends _e {
21767
21780
  constructor() {
21768
21781
  super(...arguments), K(this, "code", "ERR_JWK_INVALID");
21769
21782
  }
21770
21783
  }
21771
- K(Df, "code", "ERR_JWK_INVALID");
21772
- class Af extends _e {
21784
+ K(Af, "code", "ERR_JWK_INVALID");
21785
+ class Of extends _e {
21773
21786
  constructor() {
21774
21787
  super(...arguments), K(this, "code", "ERR_JWKS_INVALID");
21775
21788
  }
21776
21789
  }
21777
- K(Af, "code", "ERR_JWKS_INVALID");
21778
- class Of extends _e {
21790
+ K(Of, "code", "ERR_JWKS_INVALID");
21791
+ class xf extends _e {
21779
21792
  constructor() {
21780
21793
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "no applicable key found in the JSON Web Key Set", t = arguments.length > 1 ? arguments[1] : void 0;
21781
21794
  super(e, t), K(this, "code", "ERR_JWKS_NO_MATCHING_KEY");
21782
21795
  }
21783
21796
  }
21784
- K(Of, "code", "ERR_JWKS_NO_MATCHING_KEY");
21785
- class xf extends _e {
21797
+ K(xf, "code", "ERR_JWKS_NO_MATCHING_KEY");
21798
+ class Lf extends _e {
21786
21799
  constructor() {
21787
21800
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "multiple matching keys found in the JSON Web Key Set", t = arguments.length > 1 ? arguments[1] : void 0;
21788
21801
  super(e, t), K(this, Symbol.asyncIterator, void 0), K(this, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21789
21802
  }
21790
21803
  }
21791
- K(xf, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21792
- class Lf extends _e {
21804
+ K(Lf, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21805
+ class Nf extends _e {
21793
21806
  constructor() {
21794
21807
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "request timed out", t = arguments.length > 1 ? arguments[1] : void 0;
21795
21808
  super(e, t), K(this, "code", "ERR_JWKS_TIMEOUT");
21796
21809
  }
21797
21810
  }
21798
- K(Lf, "code", "ERR_JWKS_TIMEOUT");
21799
- class Nf extends _e {
21811
+ K(Nf, "code", "ERR_JWKS_TIMEOUT");
21812
+ class Uf extends _e {
21800
21813
  constructor() {
21801
21814
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "signature verification failed", t = arguments.length > 1 ? arguments[1] : void 0;
21802
21815
  super(e, t), K(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21803
21816
  }
21804
21817
  }
21805
- K(Nf, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21806
- const Uf = "core-bridge-";
21807
- function Ff(i) {
21818
+ K(Uf, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21819
+ const Ff = "core-bridge-";
21820
+ function Bf(i) {
21808
21821
  return i.replace(/\/$/, "");
21809
21822
  }
21810
- function Bf() {
21823
+ function Vf() {
21811
21824
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `call-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
21812
21825
  }
21813
- class Kf {
21826
+ class Gf {
21814
21827
  constructor(e) {
21815
21828
  D(this, "serverUrl");
21816
21829
  D(this, "agentId");
@@ -21827,7 +21840,7 @@ class Kf {
21827
21840
  D(this, "disconnecting", !1);
21828
21841
  if (!e.serverUrl) throw new Error("serverUrl is required");
21829
21842
  if (!e.agentId) throw new Error("agentId is required");
21830
- this.serverUrl = Ff(e.serverUrl), this.agentId = e.agentId, this.callId = e.callId ?? Bf(), this.authToken = e.token, this.continuedCallId = e.continuedCallId, this.bridgePrefix = e.bridgeIdentityPrefix ?? Uf, this.onConnected = e.onConnected, this.onDisconnected = e.onDisconnected, this.onError = e.onError;
21843
+ this.serverUrl = Bf(e.serverUrl), this.agentId = e.agentId, this.callId = e.callId ?? Vf(), this.authToken = e.token, this.continuedCallId = e.continuedCallId, this.bridgePrefix = e.bridgeIdentityPrefix ?? Ff, this.onConnected = e.onConnected, this.onDisconnected = e.onDisconnected, this.onError = e.onError;
21831
21844
  }
21832
21845
  get isConnected() {
21833
21846
  return this.connected;
@@ -22074,7 +22087,7 @@ const jt = class jt {
22074
22087
  D(jt, "HEARTBEAT_INTERVAL_MS", 5e3), /** How old (ms) a heartbeat must be before we consider the tab dead */
22075
22088
  D(jt, "HEARTBEAT_TIMEOUT_MS", 15e3);
22076
22089
  let za = jt;
22077
- class Gf {
22090
+ class zf {
22078
22091
  static async fetchWidgetConfig(e, t) {
22079
22092
  var s;
22080
22093
  const n = { "Content-Type": "application/json" };
@@ -22094,8 +22107,8 @@ class Gf {
22094
22107
  }
22095
22108
  }
22096
22109
  let hn = "https://inboxapi.vanira.io";
22097
- const Vf = "https://coredb.travelr.club/v1/graphql";
22098
- class zf {
22110
+ const qf = "https://coredb.travelr.club/v1/graphql";
22111
+ class Jf {
22099
22112
  static setChatUrl(e) {
22100
22113
  hn = e;
22101
22114
  }
@@ -22109,7 +22122,7 @@ class zf {
22109
22122
  }
22110
22123
  `;
22111
22124
  try {
22112
- const a = await (await fetch(Vf, {
22125
+ const a = await (await fetch(qf, {
22113
22126
  method: "POST",
22114
22127
  headers: { "Content-Type": "application/json" },
22115
22128
  body: JSON.stringify({
@@ -22166,11 +22179,11 @@ class zf {
22166
22179
  if (!T.ok) throw new Error("Chat request failed");
22167
22180
  const k = (l = T.body) == null ? void 0 : l.getReader(), S = new TextDecoder();
22168
22181
  if (!k) throw new Error("No reader");
22169
- let L = "", v = "", y = null, C = null;
22182
+ let N = "", v = "", y = null, C = null;
22170
22183
  for (; ; ) {
22171
- const { done: I, value: x } = await k.read();
22184
+ const { done: I, value: L } = await k.read();
22172
22185
  if (I) break;
22173
- v += S.decode(x, { stream: !0 });
22186
+ v += S.decode(L, { stream: !0 });
22174
22187
  const V = v.split(`
22175
22188
  `);
22176
22189
  v = V.pop() || "";
@@ -22189,7 +22202,7 @@ class zf {
22189
22202
  continue;
22190
22203
  }
22191
22204
  const Z = (p = (h = (u = W.choices) == null ? void 0 : u[0]) == null ? void 0 : h.delta) == null ? void 0 : p.content;
22192
- Z && (L += Z, r(L)), W.widget && a(W.widget), W.chat_id && !y && (y = W.chat_id), W.conversation_id && !C && (C = W.conversation_id);
22205
+ Z && (N += Z, r(N)), W.widget && a(W.widget), W.chat_id && !y && (y = W.chat_id), W.conversation_id && !C && (C = W.conversation_id);
22193
22206
  } catch {
22194
22207
  }
22195
22208
  }
@@ -22267,15 +22280,15 @@ export {
22267
22280
  pd as BrowserDataChannelAdapter,
22268
22281
  ld as BrowserMediaAdapter,
22269
22282
  ud as BrowserPeerAdapter,
22270
- zf as ChatService,
22271
- Gf as ConfigService,
22272
- Kf as LiveKitVoiceClient,
22283
+ Jf as ChatService,
22284
+ zf as ConfigService,
22285
+ Gf as LiveKitVoiceClient,
22273
22286
  za as SessionManager,
22274
22287
  fs as VaniraAI,
22275
22288
  fs as VaniraClient,
22276
22289
  fs as WebRTCClient,
22277
- Od as browserCapabilities,
22278
- xd as browserRuntime,
22279
- jf as createBrowserAI,
22280
- Ld as createBrowserClient
22290
+ xd as browserCapabilities,
22291
+ Ld as browserRuntime,
22292
+ Wf as createBrowserAI,
22293
+ Nd as createBrowserClient
22281
22294
  };