@d-id/client-sdk 1.1.55-staging.249 → 1.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ class Ct extends Re {
35
35
  super({ kind: "WSError", description: n });
36
36
  }
37
37
  }
38
- var St = /* @__PURE__ */ ((e) => (e.TRIAL = "trial", e.BASIC = "basic", e.ENTERPRISE = "enterprise", e.LITE = "lite", e.ADVANCED = "advanced", e))(St || {}), Rt = /* @__PURE__ */ ((e) => (e.TRIAL = "deid-trial", e.PRO = "deid-pro", e.ENTERPRISE = "deid-enterprise", e.LITE = "deid-lite", e.ADVANCED = "deid-advanced", e.BUILD = "deid-api-build", e.LAUNCH = "deid-api-launch", e.SCALE = "deid-api-scale", e))(Rt || {}), Tt = /* @__PURE__ */ ((e) => (e.Created = "created", e.Started = "started", e.Done = "done", e.Error = "error", e.Rejected = "rejected", e.Ready = "ready", e))(Tt || {}), kt = /* @__PURE__ */ ((e) => (e.Unrated = "Unrated", e.Positive = "Positive", e.Negative = "Negative", e))(kt || {}), N = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e.Off = "Off", e))(N || {}), q = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Transcribe = "transcribe", e.Complete = "done", e))(q || {}), Et = /* @__PURE__ */ ((e) => (e.KnowledgeProcessing = "knowledge/processing", e.KnowledgeIndexing = "knowledge/indexing", e.KnowledgeFailed = "knowledge/error", e.KnowledgeDone = "knowledge/done", e))(Et || {}), Dt = /* @__PURE__ */ ((e) => (e.Knowledge = "knowledge", e.Document = "document", e.Record = "record", e))(Dt || {}), It = /* @__PURE__ */ ((e) => (e.Pdf = "pdf", e.Text = "text", e.Html = "html", e.Word = "word", e.Json = "json", e.Markdown = "markdown", e.Csv = "csv", e.Excel = "excel", e.Powerpoint = "powerpoint", e.Archive = "archive", e.Image = "image", e.Audio = "audio", e.Video = "video", e))(It || {}), Ze = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e.Expressive = "expressive", e))(Ze || {});
38
+ var St = /* @__PURE__ */ ((e) => (e.TRIAL = "trial", e.BASIC = "basic", e.ENTERPRISE = "enterprise", e.LITE = "lite", e.ADVANCED = "advanced", e))(St || {}), Rt = /* @__PURE__ */ ((e) => (e.TRIAL = "deid-trial", e.PRO = "deid-pro", e.ENTERPRISE = "deid-enterprise", e.LITE = "deid-lite", e.ADVANCED = "deid-advanced", e.BUILD = "deid-api-build", e.LAUNCH = "deid-api-launch", e.SCALE = "deid-api-scale", e))(Rt || {}), Tt = /* @__PURE__ */ ((e) => (e.Created = "created", e.Started = "started", e.Done = "done", e.Error = "error", e.Rejected = "rejected", e.Ready = "ready", e))(Tt || {}), kt = /* @__PURE__ */ ((e) => (e.Unrated = "Unrated", e.Positive = "Positive", e.Negative = "Negative", e))(kt || {}), N = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e.Off = "Off", e))(N || {}), q = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Transcribe = "transcribe", e.Complete = "done", e))(q || {}), Et = /* @__PURE__ */ ((e) => (e.KnowledgeProcessing = "knowledge/processing", e.KnowledgeIndexing = "knowledge/indexing", e.KnowledgeFailed = "knowledge/error", e.KnowledgeDone = "knowledge/done", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e.Knowledge = "knowledge", e.Document = "document", e.Record = "record", e))(It || {}), Dt = /* @__PURE__ */ ((e) => (e.Pdf = "pdf", e.Text = "text", e.Html = "html", e.Word = "word", e.Json = "json", e.Markdown = "markdown", e.Csv = "csv", e.Excel = "excel", e.Powerpoint = "powerpoint", e.Archive = "archive", e.Image = "image", e.Audio = "audio", e.Video = "video", e))(Dt || {}), Ze = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e.Expressive = "expressive", e))(Ze || {});
39
39
  const Fn = (e) => {
40
40
  switch (e) {
41
41
  case "clip":
@@ -72,7 +72,7 @@ function Ft(e, n) {
72
72
  clear: () => clearTimeout(i)
73
73
  };
74
74
  }
75
- async function Ie(e, n) {
75
+ async function De(e, n) {
76
76
  const i = {
77
77
  limit: (n == null ? void 0 : n.limit) ?? 3,
78
78
  delayMs: (n == null ? void 0 : n.delayMs) ?? 0,
@@ -116,7 +116,7 @@ function rt(e, n) {
116
116
  return `Client-Key ${e.clientKey}.${Me(n)}_${zt}`;
117
117
  throw new Error(`Unknown auth type: ${e}`);
118
118
  }
119
- const Kt = (e) => Ie(e, {
119
+ const Kt = (e) => De(e, {
120
120
  limit: 3,
121
121
  delayMs: 1e3,
122
122
  timeout: 0,
@@ -517,8 +517,8 @@ function tn(e, n) {
517
517
  a = g, s = l, r = !0, o = setTimeout(t, he);
518
518
  return;
519
519
  }
520
- const v = g - a, I = l - s;
521
- if (a = g, s = l, I > 0 && v > 0) {
520
+ const v = g - a, D = l - s;
521
+ if (a = g, s = l, D > 0 && v > 0) {
522
522
  i = !1, n(d);
523
523
  return;
524
524
  }
@@ -555,12 +555,12 @@ function on() {
555
555
  }
556
556
  function ct(e, n, i, r, o) {
557
557
  let a = null, s = [], d, t = 0, c = !1, p = te.Unknown, g = te.Unknown, l = 0, v = 0;
558
- const I = on();
558
+ const D = on();
559
559
  async function B() {
560
560
  const L = await e();
561
561
  if (!L)
562
562
  return;
563
- const { isReceiving: j, avgJitterDelayInInterval: M, freezeCount: k } = I(L), O = en(L);
563
+ const { isReceiving: j, avgJitterDelayInInterval: M, freezeCount: k } = D(L), O = en(L);
564
564
  if (j)
565
565
  t = 0, l = k - v, g = M < rn ? te.Strong : M > an && l > 1 ? te.Weak : p, g !== p && (o == null || o(g), p = g, v += l, l = 0), c || (r == null || r(T.Start), d = s[s.length - 1], s = [], c = !0), s.push(O);
566
566
  else if (c && (t++, t >= nn)) {
@@ -607,7 +607,7 @@ async function dn(e, n, i) {
607
607
  var ze;
608
608
  const r = ot(i.debug || !1, "LiveKitStreamingManager"), { Room: o, RoomEvent: a, ConnectionState: s, Track: d } = await sn(), { callbacks: t, auth: c, baseURL: p, analytics: g } = i;
609
609
  let l = null, v = !1;
610
- const I = re.Fluent;
610
+ const D = re.Fluent;
611
611
  let B = null;
612
612
  const L = { isPublishing: !1, publication: null }, j = { isPublishing: !1, publication: null };
613
613
  let M = null, k = null, O = null, W = !1;
@@ -643,13 +643,13 @@ async function dn(e, n, i) {
643
643
  ), F = null, g.track("connectivity-error", {
644
644
  error: "Track subscription timeout",
645
645
  sessionId: m
646
- }), (u = t.onError) == null || u.call(t, new Error("Track subscription timeout"), { sessionId: m }), De("internal:track-subscription-timeout");
646
+ }), (u = t.onError) == null || u.call(t, new Error("Track subscription timeout"), { sessionId: m }), Ie("internal:track-subscription-timeout");
647
647
  }, qe);
648
648
  } catch (u) {
649
649
  _e(u, r, t);
650
650
  }
651
651
  g.enrich({
652
- "stream-type": I
652
+ "stream-type": D
653
653
  });
654
654
  function $(u) {
655
655
  var f, w, C, _;
@@ -679,7 +679,7 @@ async function dn(e, n, i) {
679
679
  r("Participant connected:", u.identity);
680
680
  }
681
681
  function Q(u) {
682
- r("Participant disconnected:", u.identity), De("livekit:participant-disconnected");
682
+ r("Participant disconnected:", u.identity), Ie("livekit:participant-disconnected");
683
683
  }
684
684
  function X() {
685
685
  var u;
@@ -746,7 +746,7 @@ async function dn(e, n, i) {
746
746
  }
747
747
  ie && (Y = J.Idle, (H = t.onAgentActivityStateChange) == null || H.call(t, J.Idle));
748
748
  }
749
- function D(u, f) {
749
+ function I(u, f) {
750
750
  var P, H, z, ee;
751
751
  const w = ((H = (P = M == null ? void 0 : M.getReport()) == null ? void 0 : P.webRTCStats) == null ? void 0 : H.avgRtt) ?? 0, C = w > 0 ? Math.round(w / 2 * 1e3) : 0, _ = { ...f, downstreamNetworkLatency: C };
752
752
  i.debug && ((z = f == null ? void 0 : f.metadata) != null && z.sentiment) && (_.sentiment = {
@@ -766,10 +766,10 @@ async function dn(e, n, i) {
766
766
  [E.ChatPartial]: ae,
767
767
  [E.ToolCalling]: y,
768
768
  [E.ToolResult]: y,
769
- [E.StreamVideoCreated]: D,
770
- [E.StreamVideoDone]: D,
771
- [E.StreamVideoError]: D,
772
- [E.StreamVideoRejected]: D,
769
+ [E.StreamVideoCreated]: I,
770
+ [E.StreamVideoDone]: I,
771
+ [E.StreamVideoError]: I,
772
+ [E.StreamVideoRejected]: I,
773
773
  [E.ChatAudioTranscribed]: Z
774
774
  };
775
775
  function ye(u, f, w, C) {
@@ -904,7 +904,7 @@ async function dn(e, n, i) {
904
904
  /* Chat */
905
905
  );
906
906
  }
907
- async function De(u) {
907
+ async function Ie(u) {
908
908
  var f, w;
909
909
  F && (clearTimeout(F), F = null), k == null || k.destroy(), k = null, l && ((f = t.onConnectionStateChange) == null || f.call(t, b.Disconnecting, u), await Promise.all([Te(), ke()]), await l.disconnect()), ft(), v = !1, W = !1, (w = t.onAgentActivityStateChange) == null || w.call(t, J.Idle), Y = J.Idle;
910
910
  }
@@ -917,7 +917,7 @@ async function dn(e, n, i) {
917
917
  /* Speak */
918
918
  );
919
919
  },
920
- disconnect: () => De("user:disconnect"),
920
+ disconnect: () => Ie("user:disconnect"),
921
921
  async reconnect() {
922
922
  var u, f;
923
923
  if ((l == null ? void 0 : l.state) === s.Connected) {
@@ -952,7 +952,7 @@ async function dn(e, n, i) {
952
952
  unpublishCameraStream: ke,
953
953
  sessionId: m,
954
954
  streamId: m,
955
- streamType: I,
955
+ streamType: D,
956
956
  interruptAvailable: !0,
957
957
  isInterruptible: ie,
958
958
  triggersAvailable: !1
@@ -1100,7 +1100,7 @@ function Cn(e, n, i, r, o) {
1100
1100
  mode: n.chatMode
1101
1101
  });
1102
1102
  } else {
1103
- const v = E, I = [v.StreamVideoDone, v.StreamVideoError, v.StreamVideoRejected], B = [v.StreamFailed, v.StreamVideoError, v.StreamVideoRejected], L = Ot(p, r, { mode: n.chatMode });
1103
+ const v = E, D = [v.StreamVideoDone, v.StreamVideoError, v.StreamVideoRejected], B = [v.StreamFailed, v.StreamVideoError, v.StreamVideoRejected], L = Ot(p, r, { mode: n.chatMode });
1104
1104
  if (c = c, c === v.StreamVideoCreated && (e.linkTrack("agent-video", L, v.StreamVideoCreated, ["start"]), p.sentiment)) {
1105
1105
  const j = n.messages[n.messages.length - 1];
1106
1106
  if ((j == null ? void 0 : j.role) === "assistant") {
@@ -1108,7 +1108,7 @@ function Cn(e, n, i, r, o) {
1108
1108
  n.messages[n.messages.length - 1] = M, t == null || t([...n.messages], d);
1109
1109
  }
1110
1110
  }
1111
- if (I.includes(c)) {
1111
+ if (D.includes(c)) {
1112
1112
  const j = c.split("/")[1];
1113
1113
  B.includes(c) ? e.track("agent-video", { ...L, event: j }) : e.linkTrack("agent-video", { ...L, event: j }, c, ["done"]);
1114
1114
  }
@@ -1221,11 +1221,11 @@ function Xe({
1221
1221
  log: s
1222
1222
  });
1223
1223
  }
1224
- async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we, analytics: s }, d) {
1224
+ async function In(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we, analytics: s }, d) {
1225
1225
  var ae;
1226
1226
  const t = ot(i, "WebRTCStreamingManager"), c = Tn(t);
1227
1227
  let p = !1, g = !1, l = T.Stop, v = T.Stop;
1228
- const { startConnection: I, sendStreamRequest: B, close: L, createStream: j, addIceCandidate: M } = Sn(
1228
+ const { startConnection: D, sendStreamRequest: B, close: L, createStream: j, addIceCandidate: M } = Sn(
1229
1229
  o,
1230
1230
  a,
1231
1231
  e,
@@ -1282,8 +1282,8 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1282
1282
  F,
1283
1283
  d
1284
1284
  ) : M(k, { candidate: null }, F, d);
1285
- } catch (D) {
1286
- (h = r.onError) == null || h.call(r, D, { streamId: k });
1285
+ } catch (I) {
1286
+ (h = r.onError) == null || h.call(r, I, { streamId: k });
1287
1287
  }
1288
1288
  }, S.onopen = () => {
1289
1289
  g = !0, (!V || p) && A();
@@ -1294,8 +1294,8 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1294
1294
  };
1295
1295
  function X(y, h) {
1296
1296
  if (y === E.StreamStarted && typeof h == "object" && "metadata" in h) {
1297
- const D = h.metadata;
1298
- Q(D.videoId);
1297
+ const I = h.metadata;
1298
+ Q(I.videoId);
1299
1299
  }
1300
1300
  y === E.StreamDone && Q(null), l = y === E.StreamStarted ? T.Start : T.Stop, Xe({
1301
1301
  statsSignal: R === re.Legacy ? v : void 0,
@@ -1308,8 +1308,8 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1308
1308
  }
1309
1309
  function x(y, h) {
1310
1310
  var Z;
1311
- const D = typeof h == "string" ? h : h == null ? void 0 : h.metadata;
1312
- D && s.enrich({ streamMetadata: D }), (Z = r.onStreamReady) == null || Z.call(r);
1311
+ const I = typeof h == "string" ? h : h == null ? void 0 : h.metadata;
1312
+ I && s.enrich({ streamMetadata: I }), (Z = r.onStreamReady) == null || Z.call(r);
1313
1313
  }
1314
1314
  const K = {
1315
1315
  [E.StreamStarted]: X,
@@ -1318,8 +1318,8 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1318
1318
  };
1319
1319
  S.onmessage = (y) => {
1320
1320
  var Z;
1321
- const { subject: h, data: D } = c(y.data);
1322
- (Z = K[h]) == null || Z.call(K, h, D);
1321
+ const { subject: h, data: I } = c(y.data);
1322
+ (Z = K[h]) == null || Z.call(K, h, I);
1323
1323
  }, m.oniceconnectionstatechange = () => {
1324
1324
  var h;
1325
1325
  t("peerConnection.oniceconnectionstatechange => " + m.iceConnectionState);
@@ -1330,7 +1330,7 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1330
1330
  t("peerConnection.ontrack", y), t("CALLBACK: onSrcObjectReady"), (h = r.onSrcObjectReady) == null || h.call(r, y.streams[0]);
1331
1331
  }, await m.setRemoteDescription(O), t("set remote description OK");
1332
1332
  const G = await m.createAnswer();
1333
- return t("create answer OK"), await m.setLocalDescription(G), t("set local description OK"), await I(k, G, F, d), t("start connection OK"), {
1333
+ return t("create answer OK"), await m.setLocalDescription(G), t("set local description OK"), await D(k, G, F, d), t("start connection OK"), {
1334
1334
  /**
1335
1335
  * Method to send request to server to get clip or talk depend on you payload
1336
1336
  * @param payload
@@ -1353,10 +1353,10 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1353
1353
  m.close(), m.oniceconnectionstatechange = null, m.onnegotiationneeded = null, m.onicecandidate = null, m.ontrack = null;
1354
1354
  }
1355
1355
  try {
1356
- h === b.Connected && await L(k, F).catch((D) => {
1356
+ h === b.Connected && await L(k, F).catch((I) => {
1357
1357
  });
1358
- } catch (D) {
1359
- t("Error on close stream connection", D);
1358
+ } catch (I) {
1359
+ t("Error on close stream connection", I);
1360
1360
  }
1361
1361
  (y = r.onAgentActivityStateChange) == null || y.call(r, J.Idle), U.stop();
1362
1362
  }
@@ -1365,7 +1365,7 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1365
1365
  * Method to send data channel messages to the server
1366
1366
  */
1367
1367
  sendDataChannelMessage(y) {
1368
- var h, D;
1368
+ var h, I;
1369
1369
  if (!p || S.readyState !== "open") {
1370
1370
  t("Data channel is not ready for sending messages"), (h = r.onError) == null || h.call(r, new Error("Data channel is not ready for sending messages"), {
1371
1371
  streamId: k
@@ -1375,7 +1375,7 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1375
1375
  try {
1376
1376
  S.send(y);
1377
1377
  } catch (Z) {
1378
- t("Error sending data channel message", Z), (D = r.onError) == null || D.call(r, Z, { streamId: k });
1378
+ t("Error sending data channel message", Z), (I = r.onError) == null || I.call(r, Z, { streamId: k });
1379
1379
  }
1380
1380
  },
1381
1381
  /**
@@ -1393,12 +1393,12 @@ async function Dn(e, n, { debug: i = !1, callbacks: r, auth: o, baseURL: a = we,
1393
1393
  };
1394
1394
  }
1395
1395
  var be = /* @__PURE__ */ ((e) => (e.V1 = "v1", e.V2 = "v2", e))(be || {});
1396
- async function In(e, n, i, r) {
1396
+ async function Dn(e, n, i, r) {
1397
1397
  const o = e.id;
1398
1398
  switch (n.version) {
1399
1399
  case "v1": {
1400
1400
  const { version: a, ...s } = n;
1401
- return Dn(o, s, i, r);
1401
+ return In(o, s, i, r);
1402
1402
  }
1403
1403
  case "v2": {
1404
1404
  const { version: a, ...s } = n;
@@ -1497,7 +1497,7 @@ function Ge(e, n, i, r) {
1497
1497
  });
1498
1498
  let c = null;
1499
1499
  const p = e.presenter.type === "expressive";
1500
- s = await In(
1500
+ s = await Dn(
1501
1501
  e,
1502
1502
  t,
1503
1503
  {
@@ -1506,12 +1506,12 @@ function Ge(e, n, i, r) {
1506
1506
  callbacks: {
1507
1507
  ...n.callbacks,
1508
1508
  onConnectionStateChange: (g, l) => {
1509
- var v, I;
1510
- (I = (v = n.callbacks).onConnectionStateChange) == null || I.call(v, g), Pn(g, l, i), g === b.Connected && (s ? o(s) : d = !0);
1509
+ var v, D;
1510
+ (D = (v = n.callbacks).onConnectionStateChange) == null || D.call(v, g), Pn(g, l, i), g === b.Connected && (s ? o(s) : d = !0);
1511
1511
  },
1512
1512
  onVideoStateChange: (g, l) => {
1513
- var v, I;
1514
- (I = (v = n.callbacks).onVideoStateChange) == null || I.call(v, g), Ln(
1513
+ var v, D;
1514
+ (D = (v = n.callbacks).onVideoStateChange) == null || D.call(v, g), Ln(
1515
1515
  g,
1516
1516
  e,
1517
1517
  l,
@@ -1521,13 +1521,13 @@ function Ge(e, n, i, r) {
1521
1521
  },
1522
1522
  onAgentActivityStateChange: (g) => {
1523
1523
  var l, v;
1524
- (v = (l = n.callbacks).onAgentActivityStateChange) == null || v.call(l, g), g === J.Talking ? (Ae.update(), c = (I) => {
1524
+ (v = (l = n.callbacks).onAgentActivityStateChange) == null || v.call(l, g), g === J.Talking ? (Ae.update(), c = (D) => {
1525
1525
  Ye(
1526
1526
  T.Start,
1527
1527
  e,
1528
1528
  i,
1529
1529
  s.streamType,
1530
- I
1530
+ D
1531
1531
  ), c = null;
1532
1532
  }, p || c({ latency: ne.get(!0) })) : (Ae.reset(), c = null, Ye(
1533
1533
  T.Stop,
@@ -1556,7 +1556,7 @@ async function xn(e, n, i, r, o) {
1556
1556
  var p, g, l, v;
1557
1557
  const a = async () => {
1558
1558
  if (Le(e.presenter.type)) {
1559
- const I = await Ge(e, n, r), B = `${Mn}_${I.sessionId}`, L = (/* @__PURE__ */ new Date()).toISOString();
1559
+ const D = await Ge(e, n, r), B = `${Mn}_${D.sessionId}`, L = (/* @__PURE__ */ new Date()).toISOString();
1560
1560
  return { chatResult: {
1561
1561
  chatMode: N.Functional,
1562
1562
  chat: {
@@ -1570,9 +1570,9 @@ async function xn(e, n, i, r, o) {
1570
1570
  chat_mode: N.Functional,
1571
1571
  messages: []
1572
1572
  }
1573
- }, streamingManager: I };
1573
+ }, streamingManager: D };
1574
1574
  } else {
1575
- const I = new AbortController(), B = I.signal;
1575
+ const D = new AbortController(), B = D.signal;
1576
1576
  let L;
1577
1577
  try {
1578
1578
  const j = at(
@@ -1585,7 +1585,7 @@ async function xn(e, n, i, r, o) {
1585
1585
  ), M = Ge(e, n, r, B).then((W) => (L = W, W)), [k, O] = await Promise.all([j, M]);
1586
1586
  return { chatResult: k, streamingManager: O };
1587
1587
  } catch (j) {
1588
- throw I.abort(), L && await L.disconnect().catch(() => {
1588
+ throw D.abort(), L && await L.disconnect().catch(() => {
1589
1589
  }), j;
1590
1590
  }
1591
1591
  }
@@ -1612,10 +1612,16 @@ async function zn(e, n) {
1612
1612
  n.debug = n.debug || ((F = l == null ? void 0 : l.advanced_settings) == null ? void 0 : F.ui_debug_mode);
1613
1613
  const v = Le(l.presenter.type);
1614
1614
  c.enrich(Ut(l));
1615
- const { onMessage: I, clearQueue: B } = Cn(c, t, n, l, () => {
1616
- var m, S, R;
1617
- (m = t.socketManager) == null || m.disconnect(), (R = (S = n.callbacks).onConnectionStateChange) == null || R.call(S, b.Disconnected);
1618
- });
1615
+ const { onMessage: D, clearQueue: B } = Cn(
1616
+ c,
1617
+ t,
1618
+ n,
1619
+ l,
1620
+ () => {
1621
+ var m;
1622
+ return (m = t.socketManager) == null ? void 0 : m.disconnect();
1623
+ }
1624
+ );
1619
1625
  t.messages = Qt(n.initialMessages), (ie = (Y = n.callbacks).onNewMessage) == null || ie.call(Y, [...t.messages], "answer");
1620
1626
  const L = (m) => {
1621
1627
  r = m;
@@ -1638,9 +1644,9 @@ async function zn(e, n) {
1638
1644
  const S = d === N.DirectPlayback || v ? Promise.resolve(void 0) : pn(
1639
1645
  n.auth,
1640
1646
  a,
1641
- { onMessage: I, onError: n.callbacks.onError },
1647
+ { onMessage: D, onError: n.callbacks.onError },
1642
1648
  n.externalId
1643
- ), R = Ie(
1649
+ ), R = De(
1644
1650
  () => xn(
1645
1651
  l,
1646
1652
  {
@@ -1649,7 +1655,7 @@ async function zn(e, n) {
1649
1655
  callbacks: {
1650
1656
  ...n.callbacks,
1651
1657
  onVideoIdChange: L,
1652
- onMessage: I,
1658
+ onMessage: D,
1653
1659
  onInterruptDetected: j
1654
1660
  }
1655
1661
  },
@@ -1665,8 +1671,8 @@ async function zn(e, n) {
1665
1671
  delayMs: 1e3
1666
1672
  }
1667
1673
  ).catch((y) => {
1668
- var h, D;
1669
- throw W(N.Maintenance), (D = (h = n.callbacks).onConnectionStateChange) == null || D.call(h, b.Fail), y;
1674
+ var h, I;
1675
+ throw W(N.Maintenance), (I = (h = n.callbacks).onConnectionStateChange) == null || I.call(h, b.Fail), y;
1670
1676
  }), [V, { streamingManager: $, chat: A }] = await Promise.all([S, R]);
1671
1677
  A && A.id !== ((K = t.chat) == null ? void 0 : K.id) && ((ae = (G = n.callbacks).onNewChat) == null || ae.call(G, A.id)), t.streamingManager = $, t.socketManager = V, t.chat = A, i = !1, c.enrich({
1672
1678
  chatId: A == null ? void 0 : A.id,
@@ -1788,18 +1794,18 @@ async function zn(e, n) {
1788
1794
  return t.chat.id;
1789
1795
  }, V = async (x, K) => {
1790
1796
  const G = t.chatMode === N.Playground;
1791
- return Ie(v && !G ? async () => {
1792
- var h, D;
1793
- return await ((D = (h = t.streamingManager) == null ? void 0 : h.sendTextMessage) == null ? void 0 : D.call(h, m)), Promise.resolve({});
1797
+ return De(v && !G ? async () => {
1798
+ var h, I;
1799
+ return await ((I = (h = t.streamingManager) == null ? void 0 : h.sendTextMessage) == null ? void 0 : I.call(h, m)), Promise.resolve({});
1794
1800
  } : async () => {
1795
- var h, D;
1801
+ var h, I;
1796
1802
  return g.chat(
1797
1803
  l.id,
1798
1804
  K,
1799
1805
  {
1800
1806
  chatMode: t.chatMode,
1801
1807
  streamId: (h = t.streamingManager) == null ? void 0 : h.streamId,
1802
- sessionId: (D = t.streamingManager) == null ? void 0 : D.sessionId,
1808
+ sessionId: (I = t.streamingManager) == null ? void 0 : I.sessionId,
1803
1809
  messages: x.map(({ matches: Z, ...ce }) => ce)
1804
1810
  },
1805
1811
  {
@@ -1811,8 +1817,8 @@ async function zn(e, n) {
1811
1817
  limit: 2,
1812
1818
  shouldRetryFn: (h) => {
1813
1819
  var ce, ye, ve, Ce;
1814
- const D = (ce = h == null ? void 0 : h.message) == null ? void 0 : ce.includes("missing or invalid session_id");
1815
- return !((ye = h == null ? void 0 : h.message) == null ? void 0 : ye.includes("Stream Error")) && !D ? ((Ce = (ve = n.callbacks).onError) == null || Ce.call(ve, h), !1) : !0;
1820
+ const I = (ce = h == null ? void 0 : h.message) == null ? void 0 : ce.includes("missing or invalid session_id");
1821
+ return !((ye = h == null ? void 0 : h.message) == null ? void 0 : ye.includes("Stream Error")) && !I ? ((Ce = (ve = n.callbacks).onError) == null || Ce.call(ve, h), !1) : !0;
1816
1822
  },
1817
1823
  onRetry: async () => {
1818
1824
  await O(), await k(!1);
@@ -1935,8 +1941,8 @@ export {
1935
1941
  q as ChatProgress,
1936
1942
  b as ConnectionState,
1937
1943
  te as ConnectivityState,
1938
- It as DocumentType,
1939
- Dt as KnowledgeType,
1944
+ Dt as DocumentType,
1945
+ It as KnowledgeType,
1940
1946
  Rt as PlanGroup,
1941
1947
  Mt as Providers,
1942
1948
  kt as RateState,