@d-id/client-sdk 1.1.0-beta.16 → 1.1.0-beta.17
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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var ke = (e, t, a) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var Y = (e, t, a) => (ke(e, typeof t != "symbol" ? t + "" : t, a), a);
|
|
4
|
+
class Z extends Error {
|
|
5
5
|
constructor({
|
|
6
6
|
kind: a,
|
|
7
7
|
description: r,
|
|
@@ -11,13 +11,13 @@ class O extends Error {
|
|
|
11
11
|
kind: a,
|
|
12
12
|
description: r
|
|
13
13
|
}));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Y(this, "kind");
|
|
15
|
+
Y(this, "description");
|
|
16
|
+
Y(this, "error");
|
|
17
17
|
this.kind = a, this.description = r, this.error = s;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
class
|
|
20
|
+
class Ce extends Z {
|
|
21
21
|
constructor(t, a) {
|
|
22
22
|
super({
|
|
23
23
|
kind: "ChatCreationFailed",
|
|
@@ -25,7 +25,7 @@ class ke extends O {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class De extends
|
|
28
|
+
class De extends Z {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super({
|
|
31
31
|
kind: "ChatModeDowngraded",
|
|
@@ -33,17 +33,17 @@ class De extends O {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class K extends
|
|
36
|
+
class K extends Z {
|
|
37
37
|
constructor(a, r) {
|
|
38
38
|
super({
|
|
39
39
|
kind: "ValidationError",
|
|
40
40
|
description: a
|
|
41
41
|
});
|
|
42
|
-
|
|
42
|
+
Y(this, "key");
|
|
43
43
|
this.key = r;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
class
|
|
46
|
+
class Re extends Z {
|
|
47
47
|
constructor(t) {
|
|
48
48
|
super({
|
|
49
49
|
kind: "WSError",
|
|
@@ -51,8 +51,8 @@ class Ce extends O {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
const
|
|
54
|
+
var Ee = /* @__PURE__ */ ((e) => (e.TRIAL = "trial", e.BASIC = "basic", e.ENTERPRISE = "enterprise", e.LITE = "lite", e.ADVANCED = "advanced", e))(Ee || {}), Se = /* @__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))(Se || {}), _e = /* @__PURE__ */ ((e) => (e.Created = "created", e.Started = "started", e.Done = "done", e.Error = "error", e.Rejected = "rejected", e.Ready = "ready", e))(_e || {}), Ie = /* @__PURE__ */ ((e) => (e.Unrated = "Unrated", e.Positive = "Positive", e.Negative = "Negative", e))(Ie || {}), P = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e.OuterControl = "OuterControl", e))(P || {}), H = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Complete = "done", e))(H || {}), Me = /* @__PURE__ */ ((e) => (e.KnowledgeProcessing = "knowledge/processing", e.KnowledgeIndexing = "knowledge/indexing", e.KnowledgeFailed = "knowledge/error", e.KnowledgeDone = "knowledge/done", e))(Me || {}), Te = /* @__PURE__ */ ((e) => (e.Knowledge = "knowledge", e.Document = "document", e.Record = "record", e))(Te || {}), je = /* @__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))(je || {}), de = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e))(de || {});
|
|
55
|
+
const be = (e) => {
|
|
56
56
|
switch (e) {
|
|
57
57
|
case "clip":
|
|
58
58
|
return "clip";
|
|
@@ -62,12 +62,12 @@ const je = (e) => {
|
|
|
62
62
|
throw new Error(`Unknown video type: ${e}`);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
var p = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(p || {}),
|
|
66
|
-
const
|
|
65
|
+
var p = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(p || {}), Q = /* @__PURE__ */ ((e) => (e.Strong = "STRONG", e.Weak = "WEAK", e.Unknown = "UNKNOWN", e))(Q || {}), V = /* @__PURE__ */ ((e) => (e.Idle = "IDLE", e.Talking = "TALKING", e))(V || {}), J = /* @__PURE__ */ ((e) => (e.ChatAnswer = "chat/answer", e.ChatPartial = "chat/partial", e.StreamDone = "stream/done", e.StreamStarted = "stream/started", e.StreamFailed = "stream/error", e.StreamReady = "stream/ready", e.StreamCreated = "stream/created", e.StreamInterrupt = "stream/interrupt", e.StreamVideoCreated = "stream-video/started", e.StreamVideoDone = "stream-video/done", e.StreamVideoError = "stream-video/error", e.StreamVideoRejected = "stream-video/rejected", e))(J || {}), T = /* @__PURE__ */ ((e) => (e.New = "new", e.Fail = "fail", e.Connected = "connected", e.Connecting = "connecting", e.Closed = "closed", e.Completed = "completed", e.Disconnected = "disconnected", e))(T || {}), U = /* @__PURE__ */ ((e) => (e.Legacy = "legacy", e.Fluent = "fluent", e))(U || {}), Pe = /* @__PURE__ */ ((e) => (e.Amazon = "amazon", e.Microsoft = "microsoft", e.Afflorithmics = "afflorithmics", e.Elevenlabs = "elevenlabs", e))(Pe || {}), $e = /* @__PURE__ */ ((e) => (e.Public = "public", e.Premium = "premium", e.Private = "private", e))($e || {});
|
|
66
|
+
const Ae = 45 * 1e3, Be = "X-Playground-Chat", O = "https://api.d-id.com", Le = "wss://notifications.d-id.com", ze = "79f81a83a67430be2bc0fd61042b8faa", ue = (e) => new Promise((t) => setTimeout(t, e)), q = (e = 16) => {
|
|
67
67
|
const t = new Uint8Array(e);
|
|
68
68
|
return window.crypto.getRandomValues(t), Array.from(t, (a) => a.toString(16).padStart(2, "0")).join("").slice(0, 13);
|
|
69
|
-
},
|
|
70
|
-
function
|
|
69
|
+
}, Ne = (e) => [P.TextOnly, P.Playground, P.Maintenance].includes(e), ee = (e) => e && [P.DirectPlayback, P.OuterControl].includes(e);
|
|
70
|
+
function xe(e, t) {
|
|
71
71
|
let a;
|
|
72
72
|
return {
|
|
73
73
|
promise: new Promise((s, i) => {
|
|
@@ -76,7 +76,7 @@ function Ne(e, t) {
|
|
|
76
76
|
clear: () => clearTimeout(a)
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
async function
|
|
79
|
+
async function te(e, t) {
|
|
80
80
|
const a = {
|
|
81
81
|
limit: (t == null ? void 0 : t.limit) ?? 3,
|
|
82
82
|
delayMs: (t == null ? void 0 : t.delayMs) ?? 0,
|
|
@@ -94,16 +94,16 @@ async function ee(e, t) {
|
|
|
94
94
|
const {
|
|
95
95
|
promise: i,
|
|
96
96
|
clear: c
|
|
97
|
-
} =
|
|
97
|
+
} = xe(a.timeout, a.timeoutErrorMessage), n = e().finally(c);
|
|
98
98
|
return await Promise.race([n, i]);
|
|
99
99
|
} catch (i) {
|
|
100
100
|
if (r = i, !a.shouldRetryFn(i) || s >= a.limit)
|
|
101
101
|
throw i;
|
|
102
|
-
await
|
|
102
|
+
await ue(a.delayMs), a.onRetry(i);
|
|
103
103
|
}
|
|
104
104
|
throw r;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function le() {
|
|
107
107
|
let e = window.localStorage.getItem("did_external_key_id");
|
|
108
108
|
if (!e) {
|
|
109
109
|
let t = q();
|
|
@@ -111,32 +111,32 @@ function ue() {
|
|
|
111
111
|
}
|
|
112
112
|
return e;
|
|
113
113
|
}
|
|
114
|
-
let
|
|
115
|
-
function
|
|
114
|
+
let Fe = q();
|
|
115
|
+
function fe(e) {
|
|
116
116
|
if (e.type === "bearer")
|
|
117
117
|
return `Bearer ${e.token}`;
|
|
118
118
|
if (e.type === "basic")
|
|
119
119
|
return `Basic ${btoa(`${e.username}:${e.password}`)}`;
|
|
120
120
|
if (e.type === "key")
|
|
121
|
-
return `Client-Key ${e.clientKey}.${
|
|
121
|
+
return `Client-Key ${e.clientKey}.${le()}_${Fe}`;
|
|
122
122
|
throw new Error(`Unknown auth type: ${e}`);
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const Je = (e) => te(e, {
|
|
125
125
|
limit: 3,
|
|
126
126
|
delayMs: 1e3,
|
|
127
127
|
timeout: 0,
|
|
128
128
|
shouldRetryFn: (t) => t.status === 429
|
|
129
129
|
});
|
|
130
|
-
function
|
|
130
|
+
function ae(e, t = O, a) {
|
|
131
131
|
const r = async (s, i) => {
|
|
132
132
|
const {
|
|
133
133
|
skipErrorHandler: c,
|
|
134
134
|
...n
|
|
135
|
-
} = i || {}, o = await
|
|
135
|
+
} = i || {}, o = await Je(() => fetch(t + (s != null && s.startsWith("/") ? s : `/${s}`), {
|
|
136
136
|
...n,
|
|
137
137
|
headers: {
|
|
138
138
|
...n.headers,
|
|
139
|
-
Authorization:
|
|
139
|
+
Authorization: fe(e),
|
|
140
140
|
"Content-Type": "application/json"
|
|
141
141
|
}
|
|
142
142
|
}));
|
|
@@ -181,8 +181,8 @@ function ne(e, t = Q, a) {
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const r =
|
|
184
|
+
function me(e, t = O, a) {
|
|
185
|
+
const r = ae(e, `${t}/agents`, a);
|
|
186
186
|
return {
|
|
187
187
|
create(s, i) {
|
|
188
188
|
return r.post("/", s, i);
|
|
@@ -219,8 +219,8 @@ function fe(e, t = Q, a) {
|
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
222
|
+
const ge = (e) => e.type === "clip" && e.presenter_id.startsWith("v2_") ? "clip_v2" : e.type;
|
|
223
|
+
function We(e) {
|
|
224
224
|
var s, i, c, n;
|
|
225
225
|
const t = () => /Mobi|Android/i.test(navigator.userAgent) ? "Mobile" : "Desktop", a = () => {
|
|
226
226
|
const o = navigator.platform;
|
|
@@ -231,15 +231,15 @@ function Je(e) {
|
|
|
231
231
|
isMobile: `${t() == "Mobile"}`,
|
|
232
232
|
browser: navigator.userAgent,
|
|
233
233
|
origin: window.location.origin,
|
|
234
|
-
agentType:
|
|
234
|
+
agentType: ge(r),
|
|
235
235
|
agentVoice: {
|
|
236
236
|
voiceId: (i = (s = e.presenter) == null ? void 0 : s.voice) == null ? void 0 : i.voice_id,
|
|
237
237
|
provider: (n = (c = e.presenter) == null ? void 0 : c.voice) == null ? void 0 : n.type
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
function
|
|
241
|
+
const Ue = (e) => e.reduce((t, a) => t + a, 0), ie = (e) => Ue(e) / e.length;
|
|
242
|
+
function Ke(e, t, a) {
|
|
243
243
|
var o, d, l;
|
|
244
244
|
const {
|
|
245
245
|
event: r,
|
|
@@ -266,15 +266,15 @@ function Ue(e, t, a) {
|
|
|
266
266
|
...a
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
let
|
|
270
|
-
const
|
|
271
|
-
function
|
|
269
|
+
let G = {};
|
|
270
|
+
const He = "https://api-js.mixpanel.com/track/?verbose=1&ip=1";
|
|
271
|
+
function qe(e) {
|
|
272
272
|
var i, c, n, o, d, l;
|
|
273
273
|
const t = window != null && window.hasOwnProperty("DID_AGENTS_API") ? "agents-ui" : "agents-sdk", a = e.agent.presenter, r = (i = e.agent.llm) == null ? void 0 : i.prompt_customization, s = {
|
|
274
274
|
token: e.token || "testKey",
|
|
275
|
-
distinct_id: e.distinctId ||
|
|
275
|
+
distinct_id: e.distinctId || le(),
|
|
276
276
|
agentId: e.agent.id,
|
|
277
|
-
agentType:
|
|
277
|
+
agentType: ge(a),
|
|
278
278
|
owner_id: e.agent.owner_id ?? "",
|
|
279
279
|
promptVersion: (c = e.agent.llm) == null ? void 0 : c.prompt_version,
|
|
280
280
|
behavior: {
|
|
@@ -304,7 +304,7 @@ function He(e) {
|
|
|
304
304
|
return Promise.resolve();
|
|
305
305
|
const {
|
|
306
306
|
audioPath: R,
|
|
307
|
-
...
|
|
307
|
+
...C
|
|
308
308
|
} = j || {}, D = {
|
|
309
309
|
method: "POST",
|
|
310
310
|
headers: {
|
|
@@ -315,7 +315,7 @@ function He(e) {
|
|
|
315
315
|
event: w,
|
|
316
316
|
properties: {
|
|
317
317
|
...this.additionalProperties,
|
|
318
|
-
...
|
|
318
|
+
...C,
|
|
319
319
|
...s,
|
|
320
320
|
source: t,
|
|
321
321
|
time: Date.now(),
|
|
@@ -329,32 +329,32 @@ function He(e) {
|
|
|
329
329
|
})
|
|
330
330
|
};
|
|
331
331
|
try {
|
|
332
|
-
return await fetch(
|
|
333
|
-
} catch (
|
|
334
|
-
return console.error(
|
|
332
|
+
return await fetch(He, D).then((k) => k.json());
|
|
333
|
+
} catch (k) {
|
|
334
|
+
return console.error(k);
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
|
-
linkTrack(w, j, R,
|
|
338
|
-
|
|
337
|
+
linkTrack(w, j, R, C) {
|
|
338
|
+
G[w] || (G[w] = {
|
|
339
339
|
events: {},
|
|
340
340
|
resolvedDependencies: []
|
|
341
|
-
}),
|
|
342
|
-
const D =
|
|
341
|
+
}), C.includes(R) || C.push(R);
|
|
342
|
+
const D = G[w];
|
|
343
343
|
if (D.events[R] = {
|
|
344
344
|
props: j
|
|
345
|
-
}, D.resolvedDependencies.push(R),
|
|
346
|
-
const L =
|
|
345
|
+
}, D.resolvedDependencies.push(R), C.every((L) => D.resolvedDependencies.includes(L))) {
|
|
346
|
+
const L = C.reduce(($, u) => D.events[u] ? {
|
|
347
347
|
...$,
|
|
348
348
|
...D.events[u].props
|
|
349
349
|
} : $, {});
|
|
350
|
-
this.track(w, L), D.resolvedDependencies = D.resolvedDependencies.filter(($) => !
|
|
350
|
+
this.track(w, L), D.resolvedDependencies = D.resolvedDependencies.filter(($) => !C.includes($)), C.forEach(($) => {
|
|
351
351
|
delete D.events[$];
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function he() {
|
|
358
358
|
let e = 0;
|
|
359
359
|
return {
|
|
360
360
|
reset: () => e = 0,
|
|
@@ -362,19 +362,19 @@ function ge() {
|
|
|
362
362
|
get: (t = !1) => t ? Date.now() - e : e
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
const F =
|
|
366
|
-
function
|
|
365
|
+
const F = he(), re = he();
|
|
366
|
+
function we(e) {
|
|
367
367
|
return e === P.Playground ? {
|
|
368
368
|
headers: {
|
|
369
|
-
[
|
|
369
|
+
[Be]: "true"
|
|
370
370
|
}
|
|
371
371
|
} : {};
|
|
372
372
|
}
|
|
373
|
-
async function
|
|
373
|
+
async function pe(e, t, a, r, s = !1, i) {
|
|
374
374
|
try {
|
|
375
|
-
return !i && !
|
|
375
|
+
return !i && !ee(r) && (i = await t.newChat(e.id, {
|
|
376
376
|
persist: s
|
|
377
|
-
},
|
|
377
|
+
}, we(r)), a.track("agent-chat", {
|
|
378
378
|
event: "created",
|
|
379
379
|
chat_id: i.id,
|
|
380
380
|
agent_id: e.id,
|
|
@@ -394,20 +394,20 @@ async function we(e, t, a, r, s = !1, i) {
|
|
|
394
394
|
throw new Error("Cannot create new chat");
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Ve(e) {
|
|
398
398
|
return e && e.length > 0 ? e : [];
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function Xe(e, t, a, r, s) {
|
|
401
401
|
if (!e || !t)
|
|
402
402
|
throw new Error("Please connect to the agent first");
|
|
403
403
|
if (!e.interruptEnabled)
|
|
404
404
|
throw new Error("Interrupt is not enabled for this stream");
|
|
405
|
-
if (a !==
|
|
405
|
+
if (a !== U.Fluent)
|
|
406
406
|
throw new Error("Interrupt only available for Fluent streams");
|
|
407
407
|
if (!r && !s)
|
|
408
408
|
throw new Error("No active video to interrupt");
|
|
409
409
|
}
|
|
410
|
-
async function
|
|
410
|
+
async function se(e, t) {
|
|
411
411
|
const a = {
|
|
412
412
|
type: J.StreamInterrupt,
|
|
413
413
|
videoId: t,
|
|
@@ -415,7 +415,7 @@ async function ie(e, t) {
|
|
|
415
415
|
};
|
|
416
416
|
e.sendDataChannelMessage(JSON.stringify(a));
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ye(e) {
|
|
419
419
|
return new Promise((t, a) => {
|
|
420
420
|
const {
|
|
421
421
|
callbacks: r,
|
|
@@ -426,7 +426,7 @@ function Xe(e) {
|
|
|
426
426
|
onOpen: n = null,
|
|
427
427
|
onClose: o = null,
|
|
428
428
|
onError: d = null
|
|
429
|
-
} = r || {}, l = new WebSocket(`${s}?authorization=${
|
|
429
|
+
} = r || {}, l = new WebSocket(`${s}?authorization=${fe(i)}`);
|
|
430
430
|
l.onmessage = c, l.onclose = o, l.onerror = (w) => {
|
|
431
431
|
console.error(w), d == null || d("Websocket failed to connect", w), a(w);
|
|
432
432
|
}, l.onopen = (w) => {
|
|
@@ -434,29 +434,29 @@ function Xe(e) {
|
|
|
434
434
|
};
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
|
-
async function
|
|
437
|
+
async function Qe(e) {
|
|
438
438
|
const {
|
|
439
439
|
retries: t = 1
|
|
440
440
|
} = e;
|
|
441
441
|
let a = null;
|
|
442
442
|
for (let r = 0; (a == null ? void 0 : a.readyState) !== WebSocket.OPEN; r++)
|
|
443
443
|
try {
|
|
444
|
-
a = await
|
|
444
|
+
a = await Ye(e);
|
|
445
445
|
} catch (s) {
|
|
446
446
|
if (r === t)
|
|
447
447
|
throw s;
|
|
448
|
-
await
|
|
448
|
+
await ue(r * 500);
|
|
449
449
|
}
|
|
450
450
|
return a;
|
|
451
451
|
}
|
|
452
|
-
async function
|
|
453
|
-
const r = a != null && a.onMessage ? [a.onMessage] : [], s = await
|
|
452
|
+
async function Oe(e, t, a) {
|
|
453
|
+
const r = a != null && a.onMessage ? [a.onMessage] : [], s = await Qe({
|
|
454
454
|
auth: e,
|
|
455
455
|
host: t,
|
|
456
456
|
callbacks: {
|
|
457
457
|
onError: (i) => {
|
|
458
458
|
var c;
|
|
459
|
-
return (c = a.onError) == null ? void 0 : c.call(a, new
|
|
459
|
+
return (c = a.onError) == null ? void 0 : c.call(a, new Re(i));
|
|
460
460
|
},
|
|
461
461
|
onMessage(i) {
|
|
462
462
|
const c = JSON.parse(i.data);
|
|
@@ -470,7 +470,7 @@ async function Qe(e, t, a) {
|
|
|
470
470
|
subscribeToEvents: (i) => r.push(i)
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Ze(e) {
|
|
474
474
|
if (e.answer !== void 0)
|
|
475
475
|
return e.answer;
|
|
476
476
|
let t = 0, a = "";
|
|
@@ -478,7 +478,7 @@ function Oe(e) {
|
|
|
478
478
|
a += e[t++];
|
|
479
479
|
return a;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Ge(e, t, a, r, s) {
|
|
482
482
|
const i = r.messages[r.messages.length - 1];
|
|
483
483
|
if (!(e === H.Partial || e === H.Answer) || (i == null ? void 0 : i.role) !== "assistant")
|
|
484
484
|
return;
|
|
@@ -487,34 +487,34 @@ function Ze(e, t, a, r, s) {
|
|
|
487
487
|
sequence: n
|
|
488
488
|
} = t;
|
|
489
489
|
e === H.Partial ? a[n] = c : a.answer = c;
|
|
490
|
-
const o =
|
|
490
|
+
const o = Ze(a);
|
|
491
491
|
(i.content !== o || e === H.Answer) && (i.content = o, s == null || s([...r.messages], e));
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function et(e, t, a, r, s) {
|
|
494
494
|
let i = {};
|
|
495
495
|
return {
|
|
496
496
|
clearQueue: () => i = {},
|
|
497
497
|
onMessage: (c, n) => {
|
|
498
498
|
var o, d;
|
|
499
499
|
if ("content" in n)
|
|
500
|
-
|
|
500
|
+
Ge(c, n, i, t, a.callbacks.onNewMessage), c === H.Answer && e.track("agent-message-received", {
|
|
501
501
|
messages: t.messages.length,
|
|
502
502
|
mode: t.chatMode
|
|
503
503
|
});
|
|
504
504
|
else {
|
|
505
|
-
const l = J, w = [l.StreamVideoDone, l.StreamVideoError, l.StreamVideoRejected], j = [l.StreamFailed, l.StreamVideoError, l.StreamVideoRejected], R =
|
|
505
|
+
const l = J, w = [l.StreamVideoDone, l.StreamVideoError, l.StreamVideoRejected], j = [l.StreamFailed, l.StreamVideoError, l.StreamVideoRejected], R = Ke(n, r, {
|
|
506
506
|
mode: t.chatMode
|
|
507
507
|
});
|
|
508
508
|
if (c = c, c === l.StreamVideoCreated)
|
|
509
509
|
e.linkTrack("agent-video", R, l.StreamVideoCreated, ["start"]);
|
|
510
510
|
else if (w.includes(c)) {
|
|
511
|
-
const
|
|
511
|
+
const C = c.split("/")[1];
|
|
512
512
|
j.includes(c) ? e.track("agent-video", {
|
|
513
513
|
...R,
|
|
514
|
-
event:
|
|
514
|
+
event: C
|
|
515
515
|
}) : e.linkTrack("agent-video", {
|
|
516
516
|
...R,
|
|
517
|
-
event:
|
|
517
|
+
event: C
|
|
518
518
|
}, c, ["done"]);
|
|
519
519
|
}
|
|
520
520
|
j.includes(c) && ((d = (o = a.callbacks).onError) == null || d.call(o, new Error(`Stream failed with event ${c}`), {
|
|
@@ -524,8 +524,8 @@ function Ge(e, t, a, r, s) {
|
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
const s =
|
|
527
|
+
function tt(e, t, a, r) {
|
|
528
|
+
const s = ae(e, `${t}/agents/${a}`, r);
|
|
529
529
|
return {
|
|
530
530
|
createStream(i) {
|
|
531
531
|
return s.post("/streams", {
|
|
@@ -561,8 +561,8 @@ function et(e, t, a, r) {
|
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
const s =
|
|
564
|
+
function rt(e, t, a, r) {
|
|
565
|
+
const s = ae(e, `${t}/agents/${a}`, r);
|
|
566
566
|
return {
|
|
567
567
|
createStream(i, c) {
|
|
568
568
|
return s.post("/streams", {
|
|
@@ -601,7 +601,7 @@ function tt(e, t, a, r) {
|
|
|
601
601
|
}
|
|
602
602
|
};
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function nt(e, t, a) {
|
|
605
605
|
const r = (t.timestamp - e.timestamp) / 1e3;
|
|
606
606
|
return {
|
|
607
607
|
duration: r,
|
|
@@ -621,7 +621,7 @@ function rt(e, t, a) {
|
|
|
621
621
|
lowFpsCount: a
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function at(e) {
|
|
625
625
|
return e.filter((t) => t.freezeCount > 0 || t.framesPerSecond < 21 || t.framesDropped > 0 || t.packetsLost > 0).map((t) => {
|
|
626
626
|
const {
|
|
627
627
|
timestamp: a,
|
|
@@ -633,7 +633,7 @@ function nt(e) {
|
|
|
633
633
|
};
|
|
634
634
|
});
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function it(e) {
|
|
637
637
|
let t = "", a = 0;
|
|
638
638
|
for (const r of e.values())
|
|
639
639
|
if (r && r.type === "codec" && r.mimeType.startsWith("video") && (t = r.mimeType.split("/")[1]), r && r.type === "candidate-pair" && (a = r.currentRoundTripTime), r && r.type === "inbound-rtp" && r.kind === "video")
|
|
@@ -658,7 +658,7 @@ function at(e) {
|
|
|
658
658
|
};
|
|
659
659
|
return {};
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function st(e, t, a) {
|
|
662
662
|
const r = e.map((o, d) => d === 0 ? a ? {
|
|
663
663
|
timestamp: o.timestamp,
|
|
664
664
|
duration: 0,
|
|
@@ -710,24 +710,24 @@ function it(e, t, a) {
|
|
|
710
710
|
framesPerSecond: o.framesPerSecond,
|
|
711
711
|
freezeCount: o.freezeCount - e[d - 1].freezeCount,
|
|
712
712
|
freezeDuration: o.freezeDuration - e[d - 1].freezeDuration
|
|
713
|
-
}), s =
|
|
713
|
+
}), s = at(r), i = s.reduce((o, d) => o + (d.causes.includes("low fps") ? 1 : 0), 0), c = r.filter((o) => !!o.avgJitterDelayInInterval).map((o) => o.avgJitterDelayInInterval), n = r.filter((o) => !!o.rtt).map((o) => o.rtt);
|
|
714
714
|
return {
|
|
715
715
|
webRTCStats: {
|
|
716
716
|
anomalies: s,
|
|
717
717
|
minRtt: Math.min(...n),
|
|
718
|
-
avgRtt:
|
|
718
|
+
avgRtt: ie(n),
|
|
719
719
|
maxRtt: Math.max(...n),
|
|
720
|
-
aggregateReport:
|
|
720
|
+
aggregateReport: nt(e[0], e[e.length - 1], i),
|
|
721
721
|
minJitterDelayInInterval: Math.min(...c),
|
|
722
722
|
maxJitterDelayInInterval: Math.max(...c),
|
|
723
|
-
avgJitterDelayInInterval:
|
|
723
|
+
avgJitterDelayInInterval: ie(c)
|
|
724
724
|
},
|
|
725
725
|
codec: e[0].codec,
|
|
726
726
|
resolution: `${e[0].frameWidth}x${e[0].frameHeight}`
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
|
-
const
|
|
730
|
-
function
|
|
729
|
+
const ne = 100, ot = Math.max(Math.ceil(400 / ne), 1), ct = 0.25, dt = 0.28;
|
|
730
|
+
function ut() {
|
|
731
731
|
let e = 0, t, a, r = 0;
|
|
732
732
|
return (s) => {
|
|
733
733
|
for (const i of s.values())
|
|
@@ -751,26 +751,26 @@ function dt() {
|
|
|
751
751
|
};
|
|
752
752
|
};
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
let c = [], n, o = 0, d = !1, l =
|
|
756
|
-
const
|
|
754
|
+
function lt(e, t, a, r, s, i = !1) {
|
|
755
|
+
let c = [], n, o = 0, d = !1, l = Q.Unknown, w = Q.Unknown, j = 0, R = 0;
|
|
756
|
+
const C = ut();
|
|
757
757
|
return setInterval(async () => {
|
|
758
758
|
const D = await e.getStats(), {
|
|
759
|
-
isReceiving:
|
|
759
|
+
isReceiving: k,
|
|
760
760
|
avgJitterDelayInInterval: L,
|
|
761
761
|
freezeCount: $
|
|
762
|
-
} =
|
|
763
|
-
if (
|
|
764
|
-
o = 0, j = $ - R, w = L <
|
|
765
|
-
else if (d && (o++, o >=
|
|
766
|
-
const
|
|
767
|
-
r == null || r(p.Stop,
|
|
762
|
+
} = C(D), u = it(D);
|
|
763
|
+
if (k)
|
|
764
|
+
o = 0, j = $ - R, w = L < ct ? Q.Strong : L > dt && j > 1 ? Q.Weak : l, w !== l && (s == null || s(w), l = w, R += j, j = 0), d || (r == null || r(p.Start), n = c[c.length - 1], c = [], d = !0), c.push(u);
|
|
765
|
+
else if (d && (o++, o >= ot)) {
|
|
766
|
+
const m = st(c, ne, n);
|
|
767
|
+
r == null || r(p.Stop, m), t() || a(), R = $, d = !1;
|
|
768
768
|
}
|
|
769
|
-
},
|
|
769
|
+
}, ne);
|
|
770
770
|
}
|
|
771
|
-
let
|
|
772
|
-
const B = (e, t) =>
|
|
773
|
-
function
|
|
771
|
+
let ye = !1;
|
|
772
|
+
const B = (e, t) => ye && console.log(e, t), ft = (window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection).bind(window);
|
|
773
|
+
function oe(e) {
|
|
774
774
|
switch (e) {
|
|
775
775
|
case "connected":
|
|
776
776
|
return T.Connected;
|
|
@@ -790,7 +790,7 @@ function se(e) {
|
|
|
790
790
|
return T.New;
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function mt(e) {
|
|
794
794
|
const [t, a = ""] = e.split(/:(.+)/);
|
|
795
795
|
try {
|
|
796
796
|
const r = JSON.parse(a);
|
|
@@ -812,7 +812,7 @@ function ft(e) {
|
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function gt({
|
|
816
816
|
statsSignal: e,
|
|
817
817
|
dataChannelSignal: t,
|
|
818
818
|
onVideoStateChange: a,
|
|
@@ -820,7 +820,7 @@ function mt({
|
|
|
820
820
|
}) {
|
|
821
821
|
e === p.Start && t === p.Start ? a == null || a(p.Start) : e === p.Stop && t === p.Stop && (a == null || a(p.Stop, r));
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function ht({
|
|
824
824
|
statsSignal: e,
|
|
825
825
|
dataChannelSignal: t,
|
|
826
826
|
onVideoStateChange: a,
|
|
@@ -829,7 +829,7 @@ function gt({
|
|
|
829
829
|
}) {
|
|
830
830
|
e === p.Start ? a == null || a(p.Start) : e === p.Stop && (a == null || a(p.Stop, s)), t === p.Start ? r == null || r(V.Talking) : t === p.Stop && (r == null || r(V.Idle));
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function ce({
|
|
833
833
|
statsSignal: e,
|
|
834
834
|
dataChannelSignal: t,
|
|
835
835
|
onVideoStateChange: a,
|
|
@@ -837,12 +837,12 @@ function oe({
|
|
|
837
837
|
streamType: s,
|
|
838
838
|
report: i
|
|
839
839
|
}) {
|
|
840
|
-
s ===
|
|
840
|
+
s === U.Legacy ? gt({
|
|
841
841
|
statsSignal: e,
|
|
842
842
|
dataChannelSignal: t,
|
|
843
843
|
onVideoStateChange: a,
|
|
844
844
|
report: i
|
|
845
|
-
}) : s ===
|
|
845
|
+
}) : s === U.Fluent && ht({
|
|
846
846
|
statsSignal: e,
|
|
847
847
|
dataChannelSignal: t,
|
|
848
848
|
onVideoStateChange: a,
|
|
@@ -850,81 +850,88 @@ function oe({
|
|
|
850
850
|
report: i
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
|
-
async function
|
|
853
|
+
async function wt(e, t, {
|
|
854
854
|
debug: a = !1,
|
|
855
855
|
callbacks: r,
|
|
856
856
|
auth: s,
|
|
857
|
-
baseURL: i =
|
|
857
|
+
baseURL: i = O,
|
|
858
858
|
analytics: c
|
|
859
859
|
}) {
|
|
860
|
-
|
|
860
|
+
var W;
|
|
861
|
+
ye = a;
|
|
861
862
|
let n = !1, o = !1, d = p.Stop, l = p.Stop;
|
|
862
863
|
const {
|
|
863
864
|
startConnection: w,
|
|
864
865
|
sendStreamRequest: j,
|
|
865
866
|
close: R,
|
|
866
|
-
createStream:
|
|
867
|
+
createStream: C,
|
|
867
868
|
addIceCandidate: D
|
|
868
|
-
} = t.videoType ===
|
|
869
|
-
id:
|
|
869
|
+
} = t.videoType === de.Clip ? tt(s, i, e, r.onError) : rt(s, i, e, r.onError), {
|
|
870
|
+
id: k,
|
|
870
871
|
offer: L,
|
|
871
872
|
ice_servers: $,
|
|
872
873
|
session_id: u,
|
|
873
|
-
fluent:
|
|
874
|
+
fluent: m,
|
|
874
875
|
interrupt_enabled: v
|
|
875
|
-
} = await
|
|
876
|
+
} = await C(t);
|
|
877
|
+
(W = r.onStreamCreated) == null || W.call(r, {
|
|
878
|
+
stream_id: k,
|
|
879
|
+
session_id: u,
|
|
880
|
+
agent_id: e
|
|
881
|
+
});
|
|
882
|
+
const g = new ft({
|
|
876
883
|
iceServers: $
|
|
877
|
-
}), E =
|
|
884
|
+
}), E = g.createDataChannel("JanusDataChannel");
|
|
878
885
|
if (!u)
|
|
879
886
|
throw new Error("Could not create session_id");
|
|
880
|
-
const y =
|
|
887
|
+
const y = m ? U.Fluent : U.Legacy;
|
|
881
888
|
c.enrich({
|
|
882
889
|
"stream-type": y
|
|
883
890
|
});
|
|
884
|
-
const M = t.stream_warmup && !
|
|
891
|
+
const M = t.stream_warmup && !m, A = () => n, z = () => {
|
|
885
892
|
var f;
|
|
886
893
|
n = !0, o && ((f = r.onConnectionStateChange) == null || f.call(r, T.Connected));
|
|
887
|
-
}, S =
|
|
894
|
+
}, S = lt(g, A, z, (f, h) => ce({
|
|
888
895
|
statsSignal: l = f,
|
|
889
|
-
dataChannelSignal: y ===
|
|
896
|
+
dataChannelSignal: y === U.Legacy ? d : void 0,
|
|
890
897
|
onVideoStateChange: r.onVideoStateChange,
|
|
891
898
|
onAgentActivityStateChange: r.onAgentActivityStateChange,
|
|
892
|
-
report:
|
|
899
|
+
report: h,
|
|
893
900
|
streamType: y
|
|
894
901
|
}), (f) => {
|
|
895
|
-
var
|
|
896
|
-
return (
|
|
902
|
+
var h;
|
|
903
|
+
return (h = r.onConnectivityStateChange) == null ? void 0 : h.call(r, f);
|
|
897
904
|
}, M);
|
|
898
|
-
|
|
899
|
-
var
|
|
905
|
+
g.onicecandidate = (f) => {
|
|
906
|
+
var h;
|
|
900
907
|
B("peerConnection.onicecandidate", f);
|
|
901
908
|
try {
|
|
902
|
-
f.candidate && f.candidate.sdpMid && f.candidate.sdpMLineIndex !== null ? D(
|
|
909
|
+
f.candidate && f.candidate.sdpMid && f.candidate.sdpMLineIndex !== null ? D(k, {
|
|
903
910
|
candidate: f.candidate.candidate,
|
|
904
911
|
sdpMid: f.candidate.sdpMid,
|
|
905
912
|
sdpMLineIndex: f.candidate.sdpMLineIndex
|
|
906
|
-
}, u) : D(
|
|
913
|
+
}, u) : D(k, {
|
|
907
914
|
candidate: null
|
|
908
915
|
}, u);
|
|
909
916
|
} catch (b) {
|
|
910
|
-
(
|
|
911
|
-
streamId:
|
|
917
|
+
(h = r.onError) == null || h.call(r, b, {
|
|
918
|
+
streamId: k
|
|
912
919
|
});
|
|
913
920
|
}
|
|
914
921
|
}, E.onopen = () => {
|
|
915
922
|
o = !0, (!M || n) && z();
|
|
916
923
|
};
|
|
917
|
-
function
|
|
918
|
-
d = f === J.StreamStarted ? p.Start : p.Stop,
|
|
919
|
-
statsSignal: y ===
|
|
924
|
+
function _(f) {
|
|
925
|
+
d = f === J.StreamStarted ? p.Start : p.Stop, ce({
|
|
926
|
+
statsSignal: y === U.Legacy ? l : void 0,
|
|
920
927
|
dataChannelSignal: d,
|
|
921
928
|
onVideoStateChange: r.onVideoStateChange,
|
|
922
929
|
onAgentActivityStateChange: r.onAgentActivityStateChange,
|
|
923
930
|
streamType: y
|
|
924
931
|
});
|
|
925
932
|
}
|
|
926
|
-
function
|
|
927
|
-
const b = typeof
|
|
933
|
+
function I(f, h) {
|
|
934
|
+
const b = typeof h == "string" ? h : h == null ? void 0 : h.metadata;
|
|
928
935
|
b && c.enrich({
|
|
929
936
|
streamMetadata: b
|
|
930
937
|
}), c.track("agent-chat", {
|
|
@@ -932,51 +939,51 @@ async function ht(e, t, {
|
|
|
932
939
|
});
|
|
933
940
|
}
|
|
934
941
|
const N = {
|
|
935
|
-
[J.StreamStarted]:
|
|
936
|
-
[J.StreamDone]:
|
|
937
|
-
[J.StreamReady]:
|
|
942
|
+
[J.StreamStarted]: _,
|
|
943
|
+
[J.StreamDone]: _,
|
|
944
|
+
[J.StreamReady]: I
|
|
938
945
|
};
|
|
939
946
|
E.onmessage = (f) => {
|
|
940
|
-
var
|
|
947
|
+
var X;
|
|
941
948
|
const {
|
|
942
|
-
subject:
|
|
949
|
+
subject: h,
|
|
943
950
|
data: b
|
|
944
|
-
} =
|
|
945
|
-
(
|
|
946
|
-
},
|
|
947
|
-
var
|
|
948
|
-
B("peerConnection.oniceconnectionstatechange => " +
|
|
949
|
-
const f =
|
|
950
|
-
f !== T.Connected && ((
|
|
951
|
-
},
|
|
952
|
-
var
|
|
953
|
-
B("peerConnection.ontrack", f), (
|
|
954
|
-
}, await
|
|
955
|
-
const x = await
|
|
956
|
-
return B("create answer OK"), await
|
|
951
|
+
} = mt(f.data);
|
|
952
|
+
(X = N[h]) == null || X.call(N, h, b);
|
|
953
|
+
}, g.oniceconnectionstatechange = () => {
|
|
954
|
+
var h;
|
|
955
|
+
B("peerConnection.oniceconnectionstatechange => " + g.iceConnectionState);
|
|
956
|
+
const f = oe(g.iceConnectionState);
|
|
957
|
+
f !== T.Connected && ((h = r.onConnectionStateChange) == null || h.call(r, f));
|
|
958
|
+
}, g.ontrack = (f) => {
|
|
959
|
+
var h;
|
|
960
|
+
B("peerConnection.ontrack", f), (h = r.onSrcObjectReady) == null || h.call(r, f.streams[0]);
|
|
961
|
+
}, await g.setRemoteDescription(L), B("set remote description OK");
|
|
962
|
+
const x = await g.createAnswer();
|
|
963
|
+
return B("create answer OK"), await g.setLocalDescription(x), B("set local description OK"), await w(k, x, u), B("start connection OK"), {
|
|
957
964
|
/**
|
|
958
965
|
* Method to send request to server to get clip or talk depend on you payload
|
|
959
966
|
* @param payload
|
|
960
967
|
*/
|
|
961
968
|
speak(f) {
|
|
962
|
-
return j(
|
|
969
|
+
return j(k, u, f);
|
|
963
970
|
},
|
|
964
971
|
/**
|
|
965
972
|
* Method to close RTC connection
|
|
966
973
|
*/
|
|
967
974
|
async disconnect() {
|
|
968
975
|
var f;
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
if (
|
|
972
|
-
if (
|
|
976
|
+
if (k) {
|
|
977
|
+
const h = oe(g.iceConnectionState);
|
|
978
|
+
if (g) {
|
|
979
|
+
if (h === T.New) {
|
|
973
980
|
clearInterval(S);
|
|
974
981
|
return;
|
|
975
982
|
}
|
|
976
|
-
|
|
983
|
+
g.close(), g.oniceconnectionstatechange = null, g.onnegotiationneeded = null, g.onicecandidate = null, g.ontrack = null;
|
|
977
984
|
}
|
|
978
985
|
try {
|
|
979
|
-
|
|
986
|
+
h === T.Connected && await R(k, u).catch((b) => {
|
|
980
987
|
});
|
|
981
988
|
} catch (b) {
|
|
982
989
|
B("Error on close stream connection", b);
|
|
@@ -988,18 +995,18 @@ async function ht(e, t, {
|
|
|
988
995
|
* Method to send data channel messages to the server
|
|
989
996
|
*/
|
|
990
997
|
sendDataChannelMessage(f) {
|
|
991
|
-
var
|
|
998
|
+
var h, b;
|
|
992
999
|
if (!n || E.readyState !== "open") {
|
|
993
|
-
B("Data channel is not ready for sending messages"), (
|
|
994
|
-
streamId:
|
|
1000
|
+
B("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"), {
|
|
1001
|
+
streamId: k
|
|
995
1002
|
});
|
|
996
1003
|
return;
|
|
997
1004
|
}
|
|
998
1005
|
try {
|
|
999
1006
|
E.send(f);
|
|
1000
|
-
} catch (
|
|
1001
|
-
B("Error sending data channel message",
|
|
1002
|
-
streamId:
|
|
1007
|
+
} catch (X) {
|
|
1008
|
+
B("Error sending data channel message", X), (b = r.onError) == null || b.call(r, X, {
|
|
1009
|
+
streamId: k
|
|
1003
1010
|
});
|
|
1004
1011
|
}
|
|
1005
1012
|
},
|
|
@@ -1010,17 +1017,17 @@ async function ht(e, t, {
|
|
|
1010
1017
|
/**
|
|
1011
1018
|
* Id of current RTC stream
|
|
1012
1019
|
*/
|
|
1013
|
-
streamId:
|
|
1020
|
+
streamId: k,
|
|
1014
1021
|
streamType: y,
|
|
1015
1022
|
interruptEnabled: v
|
|
1016
1023
|
};
|
|
1017
1024
|
}
|
|
1018
|
-
function
|
|
1025
|
+
function pt(e, t) {
|
|
1019
1026
|
const {
|
|
1020
1027
|
streamOptions: a
|
|
1021
1028
|
} = t ?? {};
|
|
1022
1029
|
return {
|
|
1023
|
-
videoType:
|
|
1030
|
+
videoType: be(e.presenter.type),
|
|
1024
1031
|
output_resolution: a == null ? void 0 : a.outputResolution,
|
|
1025
1032
|
session_timeout: a == null ? void 0 : a.sessionTimeout,
|
|
1026
1033
|
stream_warmup: a == null ? void 0 : a.streamWarmup,
|
|
@@ -1028,10 +1035,10 @@ function wt(e, t) {
|
|
|
1028
1035
|
fluent: a == null ? void 0 : a.fluent
|
|
1029
1036
|
};
|
|
1030
1037
|
}
|
|
1031
|
-
function pt(e, t, a, r, s) {
|
|
1032
|
-
s === W.Fluent ? yt(e, t, a, r, s) : kt(e, t, a, r, s);
|
|
1033
|
-
}
|
|
1034
1038
|
function yt(e, t, a, r, s) {
|
|
1039
|
+
s === U.Fluent ? vt(e, t, a, r, s) : Ct(e, t, a, r, s);
|
|
1040
|
+
}
|
|
1041
|
+
function vt(e, t, a, r, s) {
|
|
1035
1042
|
e === p.Start ? r.track("stream-session", {
|
|
1036
1043
|
event: "start",
|
|
1037
1044
|
"stream-type": s
|
|
@@ -1043,7 +1050,7 @@ function yt(e, t, a, r, s) {
|
|
|
1043
1050
|
...a
|
|
1044
1051
|
});
|
|
1045
1052
|
}
|
|
1046
|
-
function
|
|
1053
|
+
function kt(e, t, a, r) {
|
|
1047
1054
|
F.get() <= 0 || (e === p.Start ? a.linkTrack("agent-video", {
|
|
1048
1055
|
event: "start",
|
|
1049
1056
|
latency: F.get(!0),
|
|
@@ -1055,7 +1062,7 @@ function vt(e, t, a, r) {
|
|
|
1055
1062
|
"stream-type": r
|
|
1056
1063
|
}, "done", [J.StreamVideoDone]));
|
|
1057
1064
|
}
|
|
1058
|
-
function
|
|
1065
|
+
function Ct(e, t, a, r, s) {
|
|
1059
1066
|
F.get() <= 0 || (e === p.Start ? r.linkTrack("agent-video", {
|
|
1060
1067
|
event: "start",
|
|
1061
1068
|
latency: F.get(!0),
|
|
@@ -1071,7 +1078,7 @@ function kt(e, t, a, r, s) {
|
|
|
1071
1078
|
function Dt(e, t, a) {
|
|
1072
1079
|
return F.reset(), new Promise(async (r, s) => {
|
|
1073
1080
|
try {
|
|
1074
|
-
const i = await
|
|
1081
|
+
const i = await wt(e.id, pt(e, t), {
|
|
1075
1082
|
...t,
|
|
1076
1083
|
analytics: a,
|
|
1077
1084
|
callbacks: {
|
|
@@ -1082,11 +1089,11 @@ function Dt(e, t, a) {
|
|
|
1082
1089
|
},
|
|
1083
1090
|
onVideoStateChange: (c, n) => {
|
|
1084
1091
|
var o, d;
|
|
1085
|
-
(d = (o = t.callbacks).onVideoStateChange) == null || d.call(o, c),
|
|
1092
|
+
(d = (o = t.callbacks).onVideoStateChange) == null || d.call(o, c), yt(c, e, n, a, i.streamType);
|
|
1086
1093
|
},
|
|
1087
1094
|
onAgentActivityStateChange: (c) => {
|
|
1088
1095
|
var n, o;
|
|
1089
|
-
(o = (n = t.callbacks).onAgentActivityStateChange) == null || o.call(n, c), c === V.Talking ?
|
|
1096
|
+
(o = (n = t.callbacks).onAgentActivityStateChange) == null || o.call(n, c), c === V.Talking ? re.update() : re.reset(), kt(c === V.Talking ? p.Start : p.Stop, e, a, i.streamType);
|
|
1090
1097
|
}
|
|
1091
1098
|
}
|
|
1092
1099
|
});
|
|
@@ -1095,12 +1102,12 @@ function Dt(e, t, a) {
|
|
|
1095
1102
|
}
|
|
1096
1103
|
});
|
|
1097
1104
|
}
|
|
1098
|
-
async function
|
|
1105
|
+
async function Rt(e, t, a, r, s) {
|
|
1099
1106
|
var o, d, l, w;
|
|
1100
1107
|
const {
|
|
1101
1108
|
chat: i,
|
|
1102
1109
|
chatMode: c
|
|
1103
|
-
} = await
|
|
1110
|
+
} = await pe(e, a, r, t.mode, t.persistentChat, s);
|
|
1104
1111
|
if (c && c !== t.mode && (t.mode = c, (d = (o = t.callbacks).onModeChange) == null || d.call(o, c), c === P.TextOnly))
|
|
1105
1112
|
return (w = (l = t.callbacks).onError) == null || w.call(l, new De(c)), {
|
|
1106
1113
|
chat: i
|
|
@@ -1111,13 +1118,13 @@ async function Ct(e, t, a, r, s) {
|
|
|
1111
1118
|
streamingManager: n
|
|
1112
1119
|
};
|
|
1113
1120
|
}
|
|
1114
|
-
async function
|
|
1115
|
-
var
|
|
1121
|
+
async function St(e, t) {
|
|
1122
|
+
var k, L, $;
|
|
1116
1123
|
let a = !0, r = !1;
|
|
1117
|
-
const s = t.mixpanelKey ||
|
|
1124
|
+
const s = t.mixpanelKey || ze, i = t.wsURL || Le, c = t.baseURL || O, n = {
|
|
1118
1125
|
messages: [],
|
|
1119
1126
|
chatMode: t.mode || P.Functional
|
|
1120
|
-
}, o =
|
|
1127
|
+
}, o = me(t.auth, c, t.callbacks.onError), d = await o.getById(e), l = qe({
|
|
1121
1128
|
token: s,
|
|
1122
1129
|
agent: d,
|
|
1123
1130
|
isEnabled: t.enableAnalitics,
|
|
@@ -1125,45 +1132,45 @@ async function Et(e, t) {
|
|
|
1125
1132
|
}), {
|
|
1126
1133
|
onMessage: w,
|
|
1127
1134
|
clearQueue: j
|
|
1128
|
-
} =
|
|
1135
|
+
} = et(l, n, t, d, () => {
|
|
1129
1136
|
var u;
|
|
1130
1137
|
return (u = n.socketManager) == null ? void 0 : u.disconnect();
|
|
1131
1138
|
});
|
|
1132
|
-
n.messages =
|
|
1139
|
+
n.messages = Ve(t.initialMessages), (L = (k = t.callbacks).onNewMessage) == null || L.call(k, [...n.messages], "answer"), l.track("agent-sdk", {
|
|
1133
1140
|
event: "loaded",
|
|
1134
|
-
...
|
|
1141
|
+
...We(d)
|
|
1135
1142
|
});
|
|
1136
1143
|
async function R(u) {
|
|
1137
|
-
var M, A, z, S,
|
|
1144
|
+
var M, A, z, S, _, I, N;
|
|
1138
1145
|
(A = (M = t.callbacks).onConnectionStateChange) == null || A.call(M, T.Connecting), F.reset(), r = !1, u && !a && (delete n.chat, (S = (z = t.callbacks).onNewMessage) == null || S.call(z, [...n.messages], "answer"));
|
|
1139
|
-
const
|
|
1146
|
+
const m = ee(t.mode) ? Promise.resolve(void 0) : Oe(t.auth, i, {
|
|
1140
1147
|
onMessage: w,
|
|
1141
1148
|
onError: t.callbacks.onError
|
|
1142
|
-
}), v =
|
|
1149
|
+
}), v = te(() => Rt(d, t, o, l, n.chat), {
|
|
1143
1150
|
limit: 3,
|
|
1144
|
-
timeout:
|
|
1151
|
+
timeout: Ae,
|
|
1145
1152
|
timeoutErrorMessage: "Timeout initializing the stream",
|
|
1146
1153
|
// Retry on all errors except for connection errors and rate limit errors, these are already handled in client level.
|
|
1147
1154
|
shouldRetryFn: (x) => (x == null ? void 0 : x.message) !== "Could not connect" && x.status !== 429,
|
|
1148
1155
|
delayMs: 1e3
|
|
1149
1156
|
}).catch((x) => {
|
|
1150
|
-
var
|
|
1151
|
-
throw D(P.Maintenance), (
|
|
1152
|
-
}), [
|
|
1157
|
+
var W, f;
|
|
1158
|
+
throw D(P.Maintenance), (f = (W = t.callbacks).onConnectionStateChange) == null || f.call(W, T.Fail), x;
|
|
1159
|
+
}), [g, {
|
|
1153
1160
|
streamingManager: E,
|
|
1154
1161
|
chat: y
|
|
1155
|
-
}] = await Promise.all([
|
|
1156
|
-
y && y.id !== ((
|
|
1162
|
+
}] = await Promise.all([m, v]);
|
|
1163
|
+
y && y.id !== ((_ = n.chat) == null ? void 0 : _.id) && ((N = (I = t.callbacks).onNewChat) == null || N.call(I, y.id)), n.streamingManager = E, n.socketManager = g, n.chat = y, a = !1, D((y == null ? void 0 : y.chat_mode) ?? t.mode ?? P.Functional);
|
|
1157
1164
|
}
|
|
1158
|
-
async function
|
|
1159
|
-
var u,
|
|
1160
|
-
(u = n.socketManager) == null || u.disconnect(), await ((
|
|
1165
|
+
async function C() {
|
|
1166
|
+
var u, m, v, g;
|
|
1167
|
+
(u = n.socketManager) == null || u.disconnect(), await ((m = n.streamingManager) == null ? void 0 : m.disconnect()), r = !1, delete n.streamingManager, delete n.socketManager, (g = (v = t.callbacks).onConnectionStateChange) == null || g.call(v, T.Disconnected);
|
|
1161
1168
|
}
|
|
1162
1169
|
async function D(u) {
|
|
1163
|
-
var
|
|
1170
|
+
var m, v;
|
|
1164
1171
|
u !== n.chatMode && (l.track("agent-mode-change", {
|
|
1165
1172
|
mode: u
|
|
1166
|
-
}), n.chatMode = u, n.chatMode !== P.Functional && await
|
|
1173
|
+
}), n.chatMode = u, n.chatMode !== P.Functional && await C(), (v = (m = t.callbacks).onModeChange) == null || v.call(m, u));
|
|
1167
1174
|
}
|
|
1168
1175
|
return {
|
|
1169
1176
|
agent: d,
|
|
@@ -1190,7 +1197,7 @@ async function Et(e, t) {
|
|
|
1190
1197
|
},
|
|
1191
1198
|
async reconnect() {
|
|
1192
1199
|
var u;
|
|
1193
|
-
await
|
|
1200
|
+
await C(), await R(!1), l.track("agent-chat", {
|
|
1194
1201
|
event: "reconnect",
|
|
1195
1202
|
chatId: (u = n.chat) == null ? void 0 : u.id,
|
|
1196
1203
|
agentId: d.id,
|
|
@@ -1199,7 +1206,7 @@ async function Et(e, t) {
|
|
|
1199
1206
|
},
|
|
1200
1207
|
async disconnect() {
|
|
1201
1208
|
var u;
|
|
1202
|
-
await
|
|
1209
|
+
await C(), l.track("agent-chat", {
|
|
1203
1210
|
event: "disconnect",
|
|
1204
1211
|
chatId: (u = n.chat) == null ? void 0 : u.id,
|
|
1205
1212
|
agentId: d.id,
|
|
@@ -1208,8 +1215,8 @@ async function Et(e, t) {
|
|
|
1208
1215
|
},
|
|
1209
1216
|
async chat(u) {
|
|
1210
1217
|
var E, y, M, A, z;
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1218
|
+
const m = () => {
|
|
1219
|
+
if (ee(t.mode))
|
|
1213
1220
|
throw new K(`${t.mode} is enabled, chat is disabled`);
|
|
1214
1221
|
if (u.length >= 800)
|
|
1215
1222
|
throw new K("Message cannot be more than 800 characters");
|
|
@@ -1224,64 +1231,64 @@ async function Et(e, t) {
|
|
|
1224
1231
|
throw new K("Chat is not initialized");
|
|
1225
1232
|
}
|
|
1226
1233
|
}, v = async () => {
|
|
1227
|
-
var S,
|
|
1234
|
+
var S, _;
|
|
1228
1235
|
if (!n.chat) {
|
|
1229
|
-
const
|
|
1230
|
-
if (!
|
|
1231
|
-
throw new
|
|
1232
|
-
n.chat =
|
|
1236
|
+
const I = await pe(d, o, l, n.chatMode, t.persistentChat);
|
|
1237
|
+
if (!I.chat)
|
|
1238
|
+
throw new Ce(n.chatMode, !!t.persistentChat);
|
|
1239
|
+
n.chat = I.chat, (_ = (S = t.callbacks).onNewChat) == null || _.call(S, n.chat.id);
|
|
1233
1240
|
}
|
|
1234
1241
|
return n.chat.id;
|
|
1235
|
-
},
|
|
1236
|
-
var
|
|
1237
|
-
return o.chat(d.id,
|
|
1242
|
+
}, g = async (S, _) => te(() => {
|
|
1243
|
+
var I, N;
|
|
1244
|
+
return o.chat(d.id, _, {
|
|
1238
1245
|
chatMode: n.chatMode,
|
|
1239
|
-
streamId: (
|
|
1246
|
+
streamId: (I = n.streamingManager) == null ? void 0 : I.streamId,
|
|
1240
1247
|
sessionId: (N = n.streamingManager) == null ? void 0 : N.sessionId,
|
|
1241
1248
|
messages: S.map(({
|
|
1242
1249
|
matches: x,
|
|
1243
|
-
...
|
|
1244
|
-
}) =>
|
|
1250
|
+
...W
|
|
1251
|
+
}) => W)
|
|
1245
1252
|
}, {
|
|
1246
|
-
...
|
|
1253
|
+
...we(n.chatMode),
|
|
1247
1254
|
skipErrorHandler: !0
|
|
1248
1255
|
});
|
|
1249
1256
|
}, {
|
|
1250
1257
|
limit: 2,
|
|
1251
|
-
shouldRetryFn: (
|
|
1252
|
-
var f,
|
|
1253
|
-
const N = (
|
|
1254
|
-
return !((
|
|
1258
|
+
shouldRetryFn: (I) => {
|
|
1259
|
+
var W, f, h, b;
|
|
1260
|
+
const N = (W = I == null ? void 0 : I.message) == null ? void 0 : W.includes("missing or invalid session_id");
|
|
1261
|
+
return !((f = I == null ? void 0 : I.message) == null ? void 0 : f.includes("Stream Error")) && !N ? ((b = (h = t.callbacks).onError) == null || b.call(h, I), !1) : !0;
|
|
1255
1262
|
},
|
|
1256
1263
|
onRetry: async () => {
|
|
1257
|
-
await
|
|
1264
|
+
await C(), await R(!1);
|
|
1258
1265
|
}
|
|
1259
1266
|
});
|
|
1260
1267
|
try {
|
|
1261
|
-
j(),
|
|
1268
|
+
j(), m(), n.messages.push({
|
|
1262
1269
|
id: q(),
|
|
1263
1270
|
role: "user",
|
|
1264
1271
|
content: u,
|
|
1265
1272
|
created_at: new Date(F.update()).toISOString()
|
|
1266
1273
|
}), (y = (E = t.callbacks).onNewMessage) == null || y.call(E, [...n.messages], "user");
|
|
1267
|
-
const S = await v(),
|
|
1274
|
+
const S = await v(), _ = await g([...n.messages], S);
|
|
1268
1275
|
return n.messages.push({
|
|
1269
1276
|
id: q(),
|
|
1270
1277
|
role: "assistant",
|
|
1271
|
-
content:
|
|
1278
|
+
content: _.result || "",
|
|
1272
1279
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1273
|
-
context:
|
|
1274
|
-
matches:
|
|
1275
|
-
videoId:
|
|
1276
|
-
}), r &&
|
|
1280
|
+
context: _.context,
|
|
1281
|
+
matches: _.matches,
|
|
1282
|
+
videoId: _.videoId
|
|
1283
|
+
}), r && _.videoId && n.streamingManager && (r = !1, n.messages[n.messages.length - 1].interrupted = !0, await se(n.streamingManager, _.videoId)), l.track("agent-message-send", {
|
|
1277
1284
|
event: "success",
|
|
1278
1285
|
mode: n.chatMode,
|
|
1279
1286
|
messages: n.messages.length + 1
|
|
1280
|
-
}),
|
|
1287
|
+
}), _.result && ((A = (M = t.callbacks).onNewMessage) == null || A.call(M, [...n.messages], "answer"), l.track("agent-message-received", {
|
|
1281
1288
|
latency: F.get(!0),
|
|
1282
1289
|
mode: n.chatMode,
|
|
1283
1290
|
messages: n.messages.length
|
|
1284
|
-
})),
|
|
1291
|
+
})), _;
|
|
1285
1292
|
} catch (S) {
|
|
1286
1293
|
throw r = !1, ((z = n.messages[n.messages.length - 1]) == null ? void 0 : z.role) === "assistant" && n.messages.pop(), l.track("agent-message-send", {
|
|
1287
1294
|
event: "error",
|
|
@@ -1290,48 +1297,48 @@ async function Et(e, t) {
|
|
|
1290
1297
|
}), S;
|
|
1291
1298
|
}
|
|
1292
1299
|
},
|
|
1293
|
-
rate(u,
|
|
1300
|
+
rate(u, m, v) {
|
|
1294
1301
|
var y, M, A, z;
|
|
1295
|
-
const
|
|
1302
|
+
const g = n.messages.find((S) => S.id === u);
|
|
1296
1303
|
if (n.chat) {
|
|
1297
|
-
if (!
|
|
1304
|
+
if (!g)
|
|
1298
1305
|
throw new Error("Message not found");
|
|
1299
1306
|
} else
|
|
1300
1307
|
throw new Error("Chat is not initialized");
|
|
1301
|
-
const E = ((y =
|
|
1308
|
+
const E = ((y = g.matches) == null ? void 0 : y.map((S) => [S.document_id, S.id])) ?? [];
|
|
1302
1309
|
return l.track("agent-rate", {
|
|
1303
1310
|
event: v ? "update" : "create",
|
|
1304
|
-
thumb:
|
|
1311
|
+
thumb: m === 1 ? "up" : "down",
|
|
1305
1312
|
knowledge_id: ((M = d.knowledge) == null ? void 0 : M.id) ?? "",
|
|
1306
1313
|
mode: n.chatMode,
|
|
1307
1314
|
matches: E,
|
|
1308
|
-
score:
|
|
1315
|
+
score: m
|
|
1309
1316
|
}), v ? o.updateRating(d.id, n.chat.id, v, {
|
|
1310
1317
|
knowledge_id: ((A = d.knowledge) == null ? void 0 : A.id) ?? "",
|
|
1311
1318
|
message_id: u,
|
|
1312
1319
|
matches: E,
|
|
1313
|
-
score:
|
|
1320
|
+
score: m
|
|
1314
1321
|
}) : o.createRating(d.id, n.chat.id, {
|
|
1315
1322
|
knowledge_id: ((z = d.knowledge) == null ? void 0 : z.id) ?? "",
|
|
1316
1323
|
message_id: u,
|
|
1317
1324
|
matches: E,
|
|
1318
|
-
score:
|
|
1325
|
+
score: m
|
|
1319
1326
|
});
|
|
1320
1327
|
},
|
|
1321
1328
|
deleteRate(u) {
|
|
1322
|
-
var
|
|
1329
|
+
var m;
|
|
1323
1330
|
if (!n.chat)
|
|
1324
1331
|
throw new Error("Chat is not initialized");
|
|
1325
1332
|
return l.track("agent-rate-delete", {
|
|
1326
1333
|
type: "text",
|
|
1327
|
-
chat_id: (
|
|
1334
|
+
chat_id: (m = n.chat) == null ? void 0 : m.id,
|
|
1328
1335
|
id: u,
|
|
1329
1336
|
mode: n.chatMode
|
|
1330
1337
|
}), o.deleteRating(d.id, n.chat.id, u);
|
|
1331
1338
|
},
|
|
1332
1339
|
async speak(u) {
|
|
1333
1340
|
var E, y, M;
|
|
1334
|
-
function
|
|
1341
|
+
function m() {
|
|
1335
1342
|
if (typeof u == "string") {
|
|
1336
1343
|
if (!d.presenter.voice)
|
|
1337
1344
|
throw new Error("Presenter voice is not initialized");
|
|
@@ -1354,13 +1361,13 @@ async function Et(e, t) {
|
|
|
1354
1361
|
}
|
|
1355
1362
|
return u;
|
|
1356
1363
|
}
|
|
1357
|
-
const v =
|
|
1364
|
+
const v = m();
|
|
1358
1365
|
if (l.track("agent-speak", v), F.update(), n.messages && v.type === "text" && (n.messages.push({
|
|
1359
1366
|
id: q(),
|
|
1360
1367
|
role: "assistant",
|
|
1361
1368
|
content: v.input,
|
|
1362
1369
|
created_at: new Date(F.get(!0)).toISOString()
|
|
1363
|
-
}), (y = (E = t.callbacks).onNewMessage) == null || y.call(E, [...n.messages], "answer")),
|
|
1370
|
+
}), (y = (E = t.callbacks).onNewMessage) == null || y.call(E, [...n.messages], "answer")), Ne(n.chatMode))
|
|
1364
1371
|
return {
|
|
1365
1372
|
duration: 0,
|
|
1366
1373
|
status: "success"
|
|
@@ -1378,14 +1385,14 @@ async function Et(e, t) {
|
|
|
1378
1385
|
async interrupt({
|
|
1379
1386
|
type: u
|
|
1380
1387
|
}) {
|
|
1381
|
-
var
|
|
1382
|
-
const
|
|
1383
|
-
if (
|
|
1388
|
+
var g, E, y, M, A;
|
|
1389
|
+
const m = n.messages[n.messages.length - 1], v = (m == null ? void 0 : m.role) === "user";
|
|
1390
|
+
if (Xe(n.streamingManager, n.chat, (g = n.streamingManager) == null ? void 0 : g.streamType, v, !!(m != null && m.videoId)), l.track("agent-video-interrupt", {
|
|
1384
1391
|
type: u || "click",
|
|
1385
1392
|
stream_id: (E = n.streamingManager) == null ? void 0 : E.streamId,
|
|
1386
1393
|
agent_id: d.id,
|
|
1387
1394
|
owner_id: d.owner_id,
|
|
1388
|
-
video_duration_to_interrupt:
|
|
1395
|
+
video_duration_to_interrupt: re.get(!0),
|
|
1389
1396
|
message_duration_to_interrupt: F.get(!0),
|
|
1390
1397
|
chat_id: (y = n.chat) == null ? void 0 : y.id,
|
|
1391
1398
|
mode: n.chatMode,
|
|
@@ -1394,40 +1401,40 @@ async function Et(e, t) {
|
|
|
1394
1401
|
r = !0;
|
|
1395
1402
|
return;
|
|
1396
1403
|
}
|
|
1397
|
-
|
|
1404
|
+
m.interrupted = !0, (A = (M = t.callbacks).onNewMessage) == null || A.call(M, [...n.messages], "answer"), se(n.streamingManager, m.videoId);
|
|
1398
1405
|
}
|
|
1399
1406
|
};
|
|
1400
1407
|
}
|
|
1401
|
-
function
|
|
1408
|
+
function _t(e, t, a) {
|
|
1402
1409
|
const {
|
|
1403
1410
|
getById: r
|
|
1404
|
-
} =
|
|
1411
|
+
} = me(t, a || O);
|
|
1405
1412
|
return r(e);
|
|
1406
1413
|
}
|
|
1407
1414
|
export {
|
|
1408
1415
|
V as AgentActivityState,
|
|
1409
|
-
|
|
1410
|
-
|
|
1416
|
+
_e as AgentStatus,
|
|
1417
|
+
Ce as ChatCreationFailed,
|
|
1411
1418
|
P as ChatMode,
|
|
1412
1419
|
De as ChatModeDowngraded,
|
|
1413
1420
|
H as ChatProgress,
|
|
1414
1421
|
T as ConnectionState,
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1422
|
+
Q as ConnectivityState,
|
|
1423
|
+
je as DocumentType,
|
|
1424
|
+
Te as KnowledgeType,
|
|
1425
|
+
Se as PlanGroup,
|
|
1426
|
+
Pe as Providers,
|
|
1420
1427
|
Ie as RateState,
|
|
1421
1428
|
J as StreamEvents,
|
|
1422
|
-
|
|
1429
|
+
U as StreamType,
|
|
1423
1430
|
p as StreamingState,
|
|
1424
|
-
|
|
1425
|
-
|
|
1431
|
+
Me as Subject,
|
|
1432
|
+
Ee as UserPlan,
|
|
1426
1433
|
K as ValidationError,
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1434
|
+
de as VideoType,
|
|
1435
|
+
$e as VoiceAccess,
|
|
1436
|
+
Re as WsError,
|
|
1437
|
+
St as createAgentManager,
|
|
1438
|
+
_t as getAgent,
|
|
1439
|
+
be as mapVideoType
|
|
1433
1440
|
};
|