testaugnitoambientsdk2 2.1.67 → 2.1.68
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/augnitoambientsdk.js +648 -627
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function e(e, t,
|
|
2
|
-
return new (
|
|
1
|
+
function e(e, t, n, i) {
|
|
2
|
+
return new (n || (n = Promise))(function (r, o) {
|
|
3
3
|
function s(e) {
|
|
4
4
|
try {
|
|
5
|
-
c(
|
|
5
|
+
c(i.next(e));
|
|
6
6
|
} catch (e) {
|
|
7
7
|
o(e);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
function a(e) {
|
|
11
11
|
try {
|
|
12
|
-
c(
|
|
12
|
+
c(i.throw(e));
|
|
13
13
|
} catch (e) {
|
|
14
14
|
o(e);
|
|
15
15
|
}
|
|
@@ -19,13 +19,13 @@ function e(e, t, i, n) {
|
|
|
19
19
|
e.done
|
|
20
20
|
? r(e.value)
|
|
21
21
|
: ((t = e.value),
|
|
22
|
-
t instanceof
|
|
22
|
+
t instanceof n
|
|
23
23
|
? t
|
|
24
|
-
: new
|
|
24
|
+
: new n(function (e) {
|
|
25
25
|
e(t);
|
|
26
26
|
})).then(s, a);
|
|
27
27
|
}
|
|
28
|
-
c((
|
|
28
|
+
c((i = i.apply(e, t || [])).next());
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
"function" == typeof SuppressedError && SuppressedError;
|
|
@@ -57,7 +57,7 @@ class t {
|
|
|
57
57
|
}),
|
|
58
58
|
(this.wssBaseURL = `wss://${e.server}/ambient/v1/stream-job`);
|
|
59
59
|
}
|
|
60
|
-
prepareWSSURL(e, t,
|
|
60
|
+
prepareWSSURL(e, t, n, i, r, o) {
|
|
61
61
|
let s = this.wssBaseURL;
|
|
62
62
|
return (
|
|
63
63
|
(s += `?filetype=${e}`),
|
|
@@ -65,18 +65,18 @@ class t {
|
|
|
65
65
|
(s += `&subscriptioncode=${this._config.subscriptionCode}`),
|
|
66
66
|
(s += `&accesskey=${this._config.accessKey}`),
|
|
67
67
|
(s += `&usertag=${this._config.userTag}`),
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
n && "" !== n && (s += `&filename=${n}`),
|
|
69
|
+
i && "" !== i && (s += `&jobid=${i}`),
|
|
70
70
|
r && "" !== r && (s += `&parentjobid=${r}`),
|
|
71
71
|
void 0 !== o && (s += `&inheritparentconfig=${o}`),
|
|
72
72
|
s
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
class
|
|
76
|
+
class n {
|
|
77
77
|
constructor() {}
|
|
78
78
|
static get Against() {
|
|
79
|
-
return
|
|
79
|
+
return n.instance || (n.instance = new n()), n.instance;
|
|
80
80
|
}
|
|
81
81
|
NullOrUndefined(e, t) {
|
|
82
82
|
if (null === e) throw new TypeError(`${t} is null`);
|
|
@@ -84,12 +84,12 @@ class i {
|
|
|
84
84
|
return e;
|
|
85
85
|
}
|
|
86
86
|
NullOrEmpty(e, t) {
|
|
87
|
-
if (!(e =
|
|
87
|
+
if (!(e = n.Against.NullOrUndefined(e, t)))
|
|
88
88
|
throw new TypeError(`${t} is empty`);
|
|
89
89
|
return e;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
var
|
|
92
|
+
var i, r, o, s, a;
|
|
93
93
|
!(function (e) {
|
|
94
94
|
(e[(e.SPECIALITY = 1)] = "SPECIALITY"),
|
|
95
95
|
(e[(e.VISIT_TYPE = 2)] = "VISIT_TYPE"),
|
|
@@ -97,7 +97,7 @@ var n, r, o, s, a;
|
|
|
97
97
|
(e[(e.CLINICAL_CODE = 4)] = "CLINICAL_CODE"),
|
|
98
98
|
(e[(e.LANGUAGE = 5)] = "LANGUAGE"),
|
|
99
99
|
(e[(e.CDIVersion = 7)] = "CDIVersion");
|
|
100
|
-
})(
|
|
100
|
+
})(i || (i = {})),
|
|
101
101
|
(function (e) {
|
|
102
102
|
(e[(e.SoapNote = 1)] = "SoapNote"),
|
|
103
103
|
(e[(e.PatientNote = 2)] = "PatientNote"),
|
|
@@ -153,40 +153,40 @@ class c extends Error {
|
|
|
153
153
|
(function (e) {
|
|
154
154
|
(e.DashFormat = "Dash-format"), (e.Paragraph = "Paragraph");
|
|
155
155
|
})(a || (a = {}));
|
|
156
|
-
class
|
|
157
|
-
makePostRequest(t,
|
|
156
|
+
class u {
|
|
157
|
+
makePostRequest(t, n) {
|
|
158
158
|
return e(this, void 0, void 0, function* () {
|
|
159
159
|
try {
|
|
160
|
-
const
|
|
160
|
+
const i = yield fetch(t, {
|
|
161
161
|
method: "POST",
|
|
162
162
|
headers: { "Content-Type": "application/json" },
|
|
163
|
-
body: JSON.stringify(
|
|
163
|
+
body: JSON.stringify(n),
|
|
164
164
|
});
|
|
165
|
-
if (!
|
|
166
|
-
const t = yield
|
|
165
|
+
if (!i.ok) {
|
|
166
|
+
const t = yield i.text();
|
|
167
167
|
var e = JSON.parse(t);
|
|
168
168
|
throw new c(e.message, e.code.toString());
|
|
169
169
|
}
|
|
170
|
-
return yield
|
|
170
|
+
return yield i.json();
|
|
171
171
|
} catch (e) {
|
|
172
172
|
throw e;
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
makePatchRequest(t,
|
|
176
|
+
makePatchRequest(t, n) {
|
|
177
177
|
return e(this, void 0, void 0, function* () {
|
|
178
178
|
try {
|
|
179
|
-
const
|
|
179
|
+
const i = yield fetch(t, {
|
|
180
180
|
method: "PATCH",
|
|
181
181
|
headers: { "Content-Type": "application/json" },
|
|
182
|
-
body: JSON.stringify(
|
|
182
|
+
body: JSON.stringify(n),
|
|
183
183
|
});
|
|
184
|
-
if (!
|
|
185
|
-
const t = yield
|
|
184
|
+
if (!i.ok) {
|
|
185
|
+
const t = yield i.text();
|
|
186
186
|
var e = JSON.parse(t);
|
|
187
|
-
throw new c(e.message,
|
|
187
|
+
throw new c(e.message, i.status.toString());
|
|
188
188
|
}
|
|
189
|
-
return yield
|
|
189
|
+
return yield i.json();
|
|
190
190
|
} catch (e) {
|
|
191
191
|
throw e instanceof c
|
|
192
192
|
? e
|
|
@@ -195,7 +195,7 @@ class l {
|
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
class
|
|
198
|
+
class l extends u {
|
|
199
199
|
constructor(e) {
|
|
200
200
|
super(),
|
|
201
201
|
Object.defineProperty(this, "_config", {
|
|
@@ -226,16 +226,16 @@ class u extends l {
|
|
|
226
226
|
return yield this.makePostRequest(e, t);
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
ListJobs(t,
|
|
229
|
+
ListJobs(t, i, r) {
|
|
230
230
|
return e(this, void 0, void 0, function* () {
|
|
231
|
-
|
|
231
|
+
n.Against.NullOrEmpty(t, "Page Size");
|
|
232
232
|
const e = this.getURL("/list-jobs"),
|
|
233
233
|
o = {
|
|
234
234
|
SubscriptionCode: this._config.subscriptionCode,
|
|
235
235
|
AccessKey: this._config.accessKey,
|
|
236
236
|
UserTag: this._config.userTag,
|
|
237
237
|
PageSize: t,
|
|
238
|
-
PageID:
|
|
238
|
+
PageID: i,
|
|
239
239
|
Collapse: r,
|
|
240
240
|
};
|
|
241
241
|
return yield this.makePostRequest(e, o);
|
|
@@ -243,113 +243,113 @@ class u extends l {
|
|
|
243
243
|
}
|
|
244
244
|
FetchJob(t) {
|
|
245
245
|
return e(this, void 0, void 0, function* () {
|
|
246
|
-
|
|
246
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
247
247
|
const e = this.getURL("/fetch-job"),
|
|
248
|
-
|
|
248
|
+
i = {
|
|
249
249
|
SubscriptionCode: this._config.subscriptionCode,
|
|
250
250
|
AccessKey: this._config.accessKey,
|
|
251
251
|
UserTag: this._config.userTag,
|
|
252
252
|
JobID: t,
|
|
253
253
|
};
|
|
254
|
-
return yield this.makePostRequest(e,
|
|
254
|
+
return yield this.makePostRequest(e, i);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
SendFinalNote(t,
|
|
257
|
+
SendFinalNote(t, i) {
|
|
258
258
|
return e(this, void 0, void 0, function* () {
|
|
259
|
-
|
|
259
|
+
n.Against.NullOrEmpty(t, "Job Id"), n.Against.NullOrEmpty(i, "Note Data");
|
|
260
260
|
const e = this.getURL("/send-final-note"),
|
|
261
261
|
r = {
|
|
262
262
|
SubscriptionCode: this._config.subscriptionCode,
|
|
263
263
|
AccessKey: this._config.accessKey,
|
|
264
264
|
UserTag: this._config.userTag,
|
|
265
265
|
JobID: t,
|
|
266
|
-
SoapData:
|
|
266
|
+
SoapData: i,
|
|
267
267
|
};
|
|
268
268
|
return yield this.makePostRequest(e, r);
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
|
-
DeleteNotes(t,
|
|
271
|
+
DeleteNotes(t, i) {
|
|
272
272
|
return e(this, void 0, void 0, function* () {
|
|
273
|
-
|
|
273
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
274
274
|
const e = this.getURL("/delete-job"),
|
|
275
275
|
r = {
|
|
276
276
|
SubscriptionCode: this._config.subscriptionCode,
|
|
277
277
|
AccessKey: this._config.accessKey,
|
|
278
278
|
UserTag: this._config.userTag,
|
|
279
279
|
JobIDs: t,
|
|
280
|
-
DeleteParent:
|
|
280
|
+
DeleteParent: i,
|
|
281
281
|
};
|
|
282
282
|
return yield this.makePostRequest(e, r);
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
RenameNoteTitle(t,
|
|
285
|
+
RenameNoteTitle(t, i) {
|
|
286
286
|
return e(this, void 0, void 0, function* () {
|
|
287
|
-
|
|
287
|
+
n.Against.NullOrEmpty(t, "Job Id"), n.Against.NullOrEmpty(i, "Job Name");
|
|
288
288
|
const e = this.getURL("/rename-job"),
|
|
289
289
|
r = {
|
|
290
290
|
SubscriptionCode: this._config.subscriptionCode,
|
|
291
291
|
AccessKey: this._config.accessKey,
|
|
292
292
|
UserTag: this._config.userTag,
|
|
293
293
|
JobID: t,
|
|
294
|
-
JobName:
|
|
294
|
+
JobName: i,
|
|
295
295
|
};
|
|
296
296
|
return yield this.makePostRequest(e, r);
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
DownloadNotePDF(t,
|
|
299
|
+
DownloadNotePDF(t, i, r, o, s, a) {
|
|
300
300
|
return e(this, void 0, void 0, function* () {
|
|
301
|
-
|
|
301
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
302
302
|
const e = this.getURL("/download-pdf");
|
|
303
303
|
var c = s;
|
|
304
304
|
(c && "" != c) ||
|
|
305
305
|
(c =
|
|
306
306
|
'{"PatientName":"","PatientID":"","Age":"","Gender":"","ReceivingDoctor":"","DoctorName":"","DoctorDesignation":"","DoctorEmail":""}');
|
|
307
|
-
const
|
|
307
|
+
const u = {
|
|
308
308
|
SubscriptionCode: this._config.subscriptionCode,
|
|
309
309
|
AccessKey: this._config.accessKey,
|
|
310
310
|
UserTag: this._config.userTag,
|
|
311
311
|
JobID: t,
|
|
312
|
-
NoteType:
|
|
312
|
+
NoteType: i,
|
|
313
313
|
Language: null != o ? o : "English",
|
|
314
314
|
SpecialityID: r,
|
|
315
315
|
Regenerate: null != a && a,
|
|
316
316
|
PersonnelInfo: c,
|
|
317
317
|
};
|
|
318
|
-
return yield this.makePostRequest(e,
|
|
318
|
+
return yield this.makePostRequest(e, u);
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
321
|
EndJob(t) {
|
|
322
322
|
return e(this, void 0, void 0, function* () {
|
|
323
|
-
|
|
323
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
324
324
|
const e = this.getURL("/end-job"),
|
|
325
|
-
|
|
325
|
+
i = {
|
|
326
326
|
SubscriptionCode: this._config.subscriptionCode,
|
|
327
327
|
AccessKey: this._config.accessKey,
|
|
328
328
|
UserTag: this._config.userTag,
|
|
329
329
|
JobID: t,
|
|
330
330
|
};
|
|
331
|
-
return yield this.makePostRequest(e,
|
|
331
|
+
return yield this.makePostRequest(e, i);
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
UpdatePatientContext(t,
|
|
334
|
+
UpdatePatientContext(t, i, r) {
|
|
335
335
|
return e(this, void 0, void 0, function* () {
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
n.Against.NullOrEmpty(t, "Job Id"),
|
|
337
|
+
n.Against.NullOrEmpty(i, "Patient Context");
|
|
338
338
|
const e = this.getURL("/patient-context"),
|
|
339
339
|
o = {
|
|
340
340
|
SubscriptionCode: this._config.subscriptionCode,
|
|
341
341
|
AccessKey: this._config.accessKey,
|
|
342
342
|
UserTag: this._config.userTag,
|
|
343
343
|
JobID: t,
|
|
344
|
-
NewContext:
|
|
344
|
+
NewContext: i,
|
|
345
345
|
Replace: r,
|
|
346
346
|
};
|
|
347
347
|
return yield this.makePostRequest(e, o);
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
GenerateSuggestions(t,
|
|
350
|
+
GenerateSuggestions(t, i, r, o, s, a) {
|
|
351
351
|
return e(this, void 0, void 0, function* () {
|
|
352
|
-
|
|
352
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
353
353
|
var e = this.getURL("/cdi");
|
|
354
354
|
a && 2 === a && (e = this.getURL("/cdi").replace("/v1", "/v2"));
|
|
355
355
|
const c = {
|
|
@@ -357,7 +357,7 @@ class u extends l {
|
|
|
357
357
|
AccessKey: this._config.accessKey,
|
|
358
358
|
UserTag: this._config.userTag,
|
|
359
359
|
JobID: t,
|
|
360
|
-
Regenerate:
|
|
360
|
+
Regenerate: i,
|
|
361
361
|
SoapData: r,
|
|
362
362
|
PatientContext: o,
|
|
363
363
|
Codes: s,
|
|
@@ -365,16 +365,16 @@ class u extends l {
|
|
|
365
365
|
return yield this.makePostRequest(e, c);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
ModifyGeneratedNote(t,
|
|
368
|
+
ModifyGeneratedNote(t, i, r) {
|
|
369
369
|
return e(this, void 0, void 0, function* () {
|
|
370
|
-
|
|
370
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
371
371
|
const e = this.getURL("/modify-note"),
|
|
372
372
|
o = {
|
|
373
373
|
SubscriptionCode: this._config.subscriptionCode,
|
|
374
374
|
AccessKey: this._config.accessKey,
|
|
375
375
|
UserTag: this._config.userTag,
|
|
376
376
|
JobID: t,
|
|
377
|
-
NoteType:
|
|
377
|
+
NoteType: i,
|
|
378
378
|
NewNote: null != r ? r : "",
|
|
379
379
|
};
|
|
380
380
|
return yield this.makePostRequest(e, o);
|
|
@@ -382,28 +382,28 @@ class u extends l {
|
|
|
382
382
|
}
|
|
383
383
|
FetchTranscription(t) {
|
|
384
384
|
return e(this, void 0, void 0, function* () {
|
|
385
|
-
|
|
385
|
+
n.Against.NullOrEmpty(t, "Job Id");
|
|
386
386
|
const e = this.getURL("/fetch-transcript"),
|
|
387
|
-
|
|
387
|
+
i = {
|
|
388
388
|
SubscriptionCode: this._config.subscriptionCode,
|
|
389
389
|
AccessKey: this._config.accessKey,
|
|
390
390
|
UserTag: this._config.userTag,
|
|
391
391
|
JobID: t,
|
|
392
392
|
};
|
|
393
|
-
return yield this.makePostRequest(e,
|
|
393
|
+
return yield this.makePostRequest(e, i);
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
SendFeedback(t,
|
|
396
|
+
SendFeedback(t, i, r, o) {
|
|
397
397
|
return e(this, void 0, void 0, function* () {
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
n.Against.NullOrEmpty(t, "Job Id"),
|
|
399
|
+
n.Against.NullOrUndefined(i, "Rating");
|
|
400
400
|
const e = this.getURL("/feedback").replace("/v1", "/v2"),
|
|
401
401
|
s = {
|
|
402
402
|
SubscriptionCode: this._config.subscriptionCode,
|
|
403
403
|
AccessKey: this._config.accessKey,
|
|
404
404
|
UserTag: this._config.userTag,
|
|
405
405
|
JobID: t,
|
|
406
|
-
Rating:
|
|
406
|
+
Rating: i,
|
|
407
407
|
FeedBack: null != r ? r : "",
|
|
408
408
|
Type: null != o ? o : "",
|
|
409
409
|
};
|
|
@@ -413,12 +413,12 @@ class u extends l {
|
|
|
413
413
|
}
|
|
414
414
|
class d {
|
|
415
415
|
static log(e, t) {
|
|
416
|
-
const
|
|
417
|
-
console.log(`${
|
|
416
|
+
const n = null != t ? t : this.defaultTag;
|
|
417
|
+
console.log(`${n}:`, e);
|
|
418
418
|
}
|
|
419
419
|
static error(e, t) {
|
|
420
|
-
const
|
|
421
|
-
console.error(`${
|
|
420
|
+
const n = null != t ? t : this.defaultTag;
|
|
421
|
+
console.error(`${n}:`, e);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
function h() {
|
|
@@ -427,21 +427,21 @@ function h() {
|
|
|
427
427
|
};
|
|
428
428
|
var e,
|
|
429
429
|
t = {},
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
n = Object.prototype,
|
|
431
|
+
i = n.hasOwnProperty,
|
|
432
432
|
r =
|
|
433
433
|
Object.defineProperty ||
|
|
434
|
-
function (e, t,
|
|
435
|
-
e[t] =
|
|
434
|
+
function (e, t, n) {
|
|
435
|
+
e[t] = n.value;
|
|
436
436
|
},
|
|
437
437
|
o = "function" == typeof Symbol ? Symbol : {},
|
|
438
438
|
s = o.iterator || "@@iterator",
|
|
439
439
|
a = o.asyncIterator || "@@asyncIterator",
|
|
440
440
|
c = o.toStringTag || "@@toStringTag";
|
|
441
|
-
function
|
|
441
|
+
function u(e, t, n) {
|
|
442
442
|
return (
|
|
443
443
|
Object.defineProperty(e, t, {
|
|
444
|
-
value:
|
|
444
|
+
value: n,
|
|
445
445
|
enumerable: !0,
|
|
446
446
|
configurable: !0,
|
|
447
447
|
writable: !0,
|
|
@@ -450,70 +450,70 @@ function h() {
|
|
|
450
450
|
);
|
|
451
451
|
}
|
|
452
452
|
try {
|
|
453
|
-
|
|
453
|
+
u({}, "");
|
|
454
454
|
} catch (e) {
|
|
455
|
-
|
|
456
|
-
return (e[t] =
|
|
455
|
+
u = function (e, t, n) {
|
|
456
|
+
return (e[t] = n);
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function l(e, t, n, i) {
|
|
460
460
|
var o = t && t.prototype instanceof m ? t : m,
|
|
461
461
|
s = Object.create(o.prototype),
|
|
462
|
-
a = new _(
|
|
463
|
-
return r(s, "_invoke", { value: w(e,
|
|
462
|
+
a = new _(i || []);
|
|
463
|
+
return r(s, "_invoke", { value: w(e, n, a) }), s;
|
|
464
464
|
}
|
|
465
|
-
function d(e, t,
|
|
465
|
+
function d(e, t, n) {
|
|
466
466
|
try {
|
|
467
|
-
return { type: "normal", arg: e.call(t,
|
|
467
|
+
return { type: "normal", arg: e.call(t, n) };
|
|
468
468
|
} catch (e) {
|
|
469
469
|
return { type: "throw", arg: e };
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
t.wrap =
|
|
472
|
+
t.wrap = l;
|
|
473
473
|
var f = "suspendedStart",
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
p = "suspendedYield",
|
|
475
|
+
g = "executing",
|
|
476
476
|
v = "completed",
|
|
477
477
|
b = {};
|
|
478
478
|
function m() {}
|
|
479
479
|
function y() {}
|
|
480
480
|
function S() {}
|
|
481
481
|
var C = {};
|
|
482
|
-
|
|
482
|
+
u(C, s, function () {
|
|
483
483
|
return this;
|
|
484
484
|
});
|
|
485
485
|
var k = Object.getPrototypeOf,
|
|
486
486
|
E = k && k(k(O([])));
|
|
487
|
-
E && E !==
|
|
487
|
+
E && E !== n && i.call(E, s) && (C = E);
|
|
488
488
|
var I = (S.prototype = m.prototype = Object.create(C));
|
|
489
489
|
function A(e) {
|
|
490
490
|
["next", "throw", "return"].forEach(function (t) {
|
|
491
|
-
|
|
491
|
+
u(e, t, function (e) {
|
|
492
492
|
return this._invoke(t, e);
|
|
493
493
|
});
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
function R(e, t) {
|
|
497
|
-
function
|
|
497
|
+
function n(r, o, s, a) {
|
|
498
498
|
var c = d(e[r], e, o);
|
|
499
499
|
if ("throw" !== c.type) {
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
return
|
|
503
|
-
? t.resolve(
|
|
500
|
+
var u = c.arg,
|
|
501
|
+
l = u.value;
|
|
502
|
+
return l && "object" == typeof l && i.call(l, "__await")
|
|
503
|
+
? t.resolve(l.__await).then(
|
|
504
504
|
function (e) {
|
|
505
|
-
|
|
505
|
+
n("next", e, s, a);
|
|
506
506
|
},
|
|
507
507
|
function (e) {
|
|
508
|
-
|
|
508
|
+
n("throw", e, s, a);
|
|
509
509
|
},
|
|
510
510
|
)
|
|
511
|
-
: t.resolve(
|
|
511
|
+
: t.resolve(l).then(
|
|
512
512
|
function (e) {
|
|
513
|
-
(
|
|
513
|
+
(u.value = e), s(u);
|
|
514
514
|
},
|
|
515
515
|
function (e) {
|
|
516
|
-
return
|
|
516
|
+
return n("throw", e, s, a);
|
|
517
517
|
},
|
|
518
518
|
);
|
|
519
519
|
}
|
|
@@ -521,82 +521,82 @@ function h() {
|
|
|
521
521
|
}
|
|
522
522
|
var o;
|
|
523
523
|
r(this, "_invoke", {
|
|
524
|
-
value: function (e,
|
|
524
|
+
value: function (e, i) {
|
|
525
525
|
function r() {
|
|
526
526
|
return new t(function (t, r) {
|
|
527
|
-
|
|
527
|
+
n(e, i, t, r);
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
530
|
return (o = o ? o.then(r, r) : r());
|
|
531
531
|
},
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
function w(t,
|
|
534
|
+
function w(t, n, i) {
|
|
535
535
|
var r = f;
|
|
536
536
|
return function (o, s) {
|
|
537
|
-
if (r ===
|
|
537
|
+
if (r === g) throw Error("Generator is already running");
|
|
538
538
|
if (r === v) {
|
|
539
539
|
if ("throw" === o) throw s;
|
|
540
540
|
return { value: e, done: !0 };
|
|
541
541
|
}
|
|
542
|
-
for (
|
|
543
|
-
var a =
|
|
542
|
+
for (i.method = o, i.arg = s; ; ) {
|
|
543
|
+
var a = i.delegate;
|
|
544
544
|
if (a) {
|
|
545
|
-
var c = P(a,
|
|
545
|
+
var c = P(a, i);
|
|
546
546
|
if (c) {
|
|
547
547
|
if (c === b) continue;
|
|
548
548
|
return c;
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
if ("next" ===
|
|
552
|
-
else if ("throw" ===
|
|
553
|
-
if (r === f) throw ((r = v),
|
|
554
|
-
|
|
555
|
-
} else "return" ===
|
|
556
|
-
r =
|
|
557
|
-
var
|
|
558
|
-
if ("normal" ===
|
|
559
|
-
if (((r =
|
|
560
|
-
return { value:
|
|
551
|
+
if ("next" === i.method) i.sent = i._sent = i.arg;
|
|
552
|
+
else if ("throw" === i.method) {
|
|
553
|
+
if (r === f) throw ((r = v), i.arg);
|
|
554
|
+
i.dispatchException(i.arg);
|
|
555
|
+
} else "return" === i.method && i.abrupt("return", i.arg);
|
|
556
|
+
r = g;
|
|
557
|
+
var u = d(t, n, i);
|
|
558
|
+
if ("normal" === u.type) {
|
|
559
|
+
if (((r = i.done ? v : p), u.arg === b)) continue;
|
|
560
|
+
return { value: u.arg, done: i.done };
|
|
561
561
|
}
|
|
562
|
-
"throw" ===
|
|
562
|
+
"throw" === u.type && ((r = v), (i.method = "throw"), (i.arg = u.arg));
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
-
function P(t,
|
|
567
|
-
var
|
|
568
|
-
r = t.iterator[
|
|
566
|
+
function P(t, n) {
|
|
567
|
+
var i = n.method,
|
|
568
|
+
r = t.iterator[i];
|
|
569
569
|
if (r === e)
|
|
570
570
|
return (
|
|
571
|
-
(
|
|
572
|
-
("throw" ===
|
|
571
|
+
(n.delegate = null),
|
|
572
|
+
("throw" === i &&
|
|
573
573
|
t.iterator.return &&
|
|
574
|
-
((
|
|
575
|
-
(
|
|
576
|
-
P(t,
|
|
577
|
-
"throw" ===
|
|
578
|
-
("return" !==
|
|
579
|
-
((
|
|
580
|
-
(
|
|
581
|
-
"The iterator does not provide a '" +
|
|
574
|
+
((n.method = "return"),
|
|
575
|
+
(n.arg = e),
|
|
576
|
+
P(t, n),
|
|
577
|
+
"throw" === n.method)) ||
|
|
578
|
+
("return" !== i &&
|
|
579
|
+
((n.method = "throw"),
|
|
580
|
+
(n.arg = new TypeError(
|
|
581
|
+
"The iterator does not provide a '" + i + "' method",
|
|
582
582
|
)))),
|
|
583
583
|
b
|
|
584
584
|
);
|
|
585
|
-
var o = d(r, t.iterator,
|
|
585
|
+
var o = d(r, t.iterator, n.arg);
|
|
586
586
|
if ("throw" === o.type)
|
|
587
|
-
return (
|
|
587
|
+
return (n.method = "throw"), (n.arg = o.arg), (n.delegate = null), b;
|
|
588
588
|
var s = o.arg;
|
|
589
589
|
return s
|
|
590
590
|
? s.done
|
|
591
|
-
? ((
|
|
592
|
-
(
|
|
593
|
-
"return" !==
|
|
594
|
-
(
|
|
591
|
+
? ((n[t.resultName] = s.value),
|
|
592
|
+
(n.next = t.nextLoc),
|
|
593
|
+
"return" !== n.method && ((n.method = "next"), (n.arg = e)),
|
|
594
|
+
(n.delegate = null),
|
|
595
595
|
b)
|
|
596
596
|
: s
|
|
597
|
-
: ((
|
|
598
|
-
(
|
|
599
|
-
(
|
|
597
|
+
: ((n.method = "throw"),
|
|
598
|
+
(n.arg = new TypeError("iterator result is not an object")),
|
|
599
|
+
(n.delegate = null),
|
|
600
600
|
b);
|
|
601
601
|
}
|
|
602
602
|
function D(e) {
|
|
@@ -616,15 +616,15 @@ function h() {
|
|
|
616
616
|
}
|
|
617
617
|
function O(t) {
|
|
618
618
|
if (t || "" === t) {
|
|
619
|
-
var
|
|
620
|
-
if (
|
|
619
|
+
var n = t[s];
|
|
620
|
+
if (n) return n.call(t);
|
|
621
621
|
if ("function" == typeof t.next) return t;
|
|
622
622
|
if (!isNaN(t.length)) {
|
|
623
623
|
var r = -1,
|
|
624
|
-
o = function
|
|
624
|
+
o = function n() {
|
|
625
625
|
for (; ++r < t.length; )
|
|
626
|
-
if (
|
|
627
|
-
return (
|
|
626
|
+
if (i.call(t, r)) return (n.value = t[r]), (n.done = !1), n;
|
|
627
|
+
return (n.value = e), (n.done = !0), n;
|
|
628
628
|
};
|
|
629
629
|
return (o.next = o);
|
|
630
630
|
}
|
|
@@ -635,7 +635,7 @@ function h() {
|
|
|
635
635
|
(y.prototype = S),
|
|
636
636
|
r(I, "constructor", { value: S, configurable: !0 }),
|
|
637
637
|
r(S, "constructor", { value: y, configurable: !0 }),
|
|
638
|
-
(y.displayName =
|
|
638
|
+
(y.displayName = u(S, c, "GeneratorFunction")),
|
|
639
639
|
(t.isGeneratorFunction = function (e) {
|
|
640
640
|
var t = "function" == typeof e && e.constructor;
|
|
641
641
|
return (
|
|
@@ -646,7 +646,7 @@ function h() {
|
|
|
646
646
|
return (
|
|
647
647
|
Object.setPrototypeOf
|
|
648
648
|
? Object.setPrototypeOf(e, S)
|
|
649
|
-
: ((e.__proto__ = S),
|
|
649
|
+
: ((e.__proto__ = S), u(e, c, "GeneratorFunction")),
|
|
650
650
|
(e.prototype = Object.create(I)),
|
|
651
651
|
e
|
|
652
652
|
);
|
|
@@ -655,37 +655,37 @@ function h() {
|
|
|
655
655
|
return { __await: e };
|
|
656
656
|
}),
|
|
657
657
|
A(R.prototype),
|
|
658
|
-
|
|
658
|
+
u(R.prototype, a, function () {
|
|
659
659
|
return this;
|
|
660
660
|
}),
|
|
661
661
|
(t.AsyncIterator = R),
|
|
662
|
-
(t.async = function (e,
|
|
662
|
+
(t.async = function (e, n, i, r, o) {
|
|
663
663
|
void 0 === o && (o = Promise);
|
|
664
|
-
var s = new R(
|
|
665
|
-
return t.isGeneratorFunction(
|
|
664
|
+
var s = new R(l(e, n, i, r), o);
|
|
665
|
+
return t.isGeneratorFunction(n)
|
|
666
666
|
? s
|
|
667
667
|
: s.next().then(function (e) {
|
|
668
668
|
return e.done ? e.value : s.next();
|
|
669
669
|
});
|
|
670
670
|
}),
|
|
671
671
|
A(I),
|
|
672
|
-
|
|
673
|
-
|
|
672
|
+
u(I, c, "Generator"),
|
|
673
|
+
u(I, s, function () {
|
|
674
674
|
return this;
|
|
675
675
|
}),
|
|
676
|
-
|
|
676
|
+
u(I, "toString", function () {
|
|
677
677
|
return "[object Generator]";
|
|
678
678
|
}),
|
|
679
679
|
(t.keys = function (e) {
|
|
680
680
|
var t = Object(e),
|
|
681
|
-
|
|
682
|
-
for (var
|
|
681
|
+
n = [];
|
|
682
|
+
for (var i in t) n.push(i);
|
|
683
683
|
return (
|
|
684
|
-
|
|
684
|
+
n.reverse(),
|
|
685
685
|
function e() {
|
|
686
|
-
for (;
|
|
687
|
-
var
|
|
688
|
-
if (
|
|
686
|
+
for (; n.length; ) {
|
|
687
|
+
var i = n.pop();
|
|
688
|
+
if (i in t) return (e.value = i), (e.done = !1), e;
|
|
689
689
|
}
|
|
690
690
|
return (e.done = !0), e;
|
|
691
691
|
}
|
|
@@ -706,11 +706,11 @@ function h() {
|
|
|
706
706
|
this.tryEntries.forEach(T),
|
|
707
707
|
!t)
|
|
708
708
|
)
|
|
709
|
-
for (var
|
|
710
|
-
"t" ===
|
|
711
|
-
|
|
712
|
-
!isNaN(+
|
|
713
|
-
(this[
|
|
709
|
+
for (var n in this)
|
|
710
|
+
"t" === n.charAt(0) &&
|
|
711
|
+
i.call(this, n) &&
|
|
712
|
+
!isNaN(+n.slice(1)) &&
|
|
713
|
+
(this[n] = e);
|
|
714
714
|
},
|
|
715
715
|
stop: function () {
|
|
716
716
|
this.done = !0;
|
|
@@ -720,13 +720,13 @@ function h() {
|
|
|
720
720
|
},
|
|
721
721
|
dispatchException: function (t) {
|
|
722
722
|
if (this.done) throw t;
|
|
723
|
-
var
|
|
724
|
-
function r(
|
|
723
|
+
var n = this;
|
|
724
|
+
function r(i, r) {
|
|
725
725
|
return (
|
|
726
726
|
(a.type = "throw"),
|
|
727
727
|
(a.arg = t),
|
|
728
|
-
(
|
|
729
|
-
r && ((
|
|
728
|
+
(n.next = i),
|
|
729
|
+
r && ((n.method = "next"), (n.arg = e)),
|
|
730
730
|
!!r
|
|
731
731
|
);
|
|
732
732
|
}
|
|
@@ -735,26 +735,26 @@ function h() {
|
|
|
735
735
|
a = s.completion;
|
|
736
736
|
if ("root" === s.tryLoc) return r("end");
|
|
737
737
|
if (s.tryLoc <= this.prev) {
|
|
738
|
-
var c =
|
|
739
|
-
|
|
740
|
-
if (c &&
|
|
738
|
+
var c = i.call(s, "catchLoc"),
|
|
739
|
+
u = i.call(s, "finallyLoc");
|
|
740
|
+
if (c && u) {
|
|
741
741
|
if (this.prev < s.catchLoc) return r(s.catchLoc, !0);
|
|
742
742
|
if (this.prev < s.finallyLoc) return r(s.finallyLoc);
|
|
743
743
|
} else if (c) {
|
|
744
744
|
if (this.prev < s.catchLoc) return r(s.catchLoc, !0);
|
|
745
745
|
} else {
|
|
746
|
-
if (!
|
|
746
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
747
747
|
if (this.prev < s.finallyLoc) return r(s.finallyLoc);
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
},
|
|
752
752
|
abrupt: function (e, t) {
|
|
753
|
-
for (var
|
|
754
|
-
var r = this.tryEntries[
|
|
753
|
+
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
|
|
754
|
+
var r = this.tryEntries[n];
|
|
755
755
|
if (
|
|
756
756
|
r.tryLoc <= this.prev &&
|
|
757
|
-
|
|
757
|
+
i.call(r, "finallyLoc") &&
|
|
758
758
|
this.prev < r.finallyLoc
|
|
759
759
|
) {
|
|
760
760
|
var o = r;
|
|
@@ -790,28 +790,28 @@ function h() {
|
|
|
790
790
|
},
|
|
791
791
|
finish: function (e) {
|
|
792
792
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
793
|
-
var
|
|
794
|
-
if (
|
|
795
|
-
return this.complete(
|
|
793
|
+
var n = this.tryEntries[t];
|
|
794
|
+
if (n.finallyLoc === e)
|
|
795
|
+
return this.complete(n.completion, n.afterLoc), T(n), b;
|
|
796
796
|
}
|
|
797
797
|
},
|
|
798
798
|
catch: function (e) {
|
|
799
799
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
800
|
-
var
|
|
801
|
-
if (
|
|
802
|
-
var
|
|
803
|
-
if ("throw" ===
|
|
804
|
-
var r =
|
|
805
|
-
T(
|
|
800
|
+
var n = this.tryEntries[t];
|
|
801
|
+
if (n.tryLoc === e) {
|
|
802
|
+
var i = n.completion;
|
|
803
|
+
if ("throw" === i.type) {
|
|
804
|
+
var r = i.arg;
|
|
805
|
+
T(n);
|
|
806
806
|
}
|
|
807
807
|
return r;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
throw Error("illegal catch attempt");
|
|
811
811
|
},
|
|
812
|
-
delegateYield: function (t,
|
|
812
|
+
delegateYield: function (t, n, i) {
|
|
813
813
|
return (
|
|
814
|
-
(this.delegate = { iterator: O(t), resultName:
|
|
814
|
+
(this.delegate = { iterator: O(t), resultName: n, nextLoc: i }),
|
|
815
815
|
"next" === this.method && (this.arg = e),
|
|
816
816
|
b
|
|
817
817
|
);
|
|
@@ -823,36 +823,36 @@ function h() {
|
|
|
823
823
|
function f(e) {
|
|
824
824
|
var t = (function (e, t) {
|
|
825
825
|
if ("object" != typeof e || !e) return e;
|
|
826
|
-
var
|
|
827
|
-
if (void 0 !==
|
|
828
|
-
var
|
|
829
|
-
if ("object" != typeof
|
|
826
|
+
var n = e[Symbol.toPrimitive];
|
|
827
|
+
if (void 0 !== n) {
|
|
828
|
+
var i = n.call(e, t || "default");
|
|
829
|
+
if ("object" != typeof i) return i;
|
|
830
830
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
831
831
|
}
|
|
832
832
|
return ("string" === t ? String : Number)(e);
|
|
833
833
|
})(e, "string");
|
|
834
834
|
return "symbol" == typeof t ? t : t + "";
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function p(e, t, n, i, r, o, s) {
|
|
837
837
|
try {
|
|
838
838
|
var a = e[o](s),
|
|
839
839
|
c = a.value;
|
|
840
840
|
} catch (e) {
|
|
841
|
-
return void
|
|
841
|
+
return void n(e);
|
|
842
842
|
}
|
|
843
|
-
a.done ? t(c) : Promise.resolve(c).then(
|
|
843
|
+
a.done ? t(c) : Promise.resolve(c).then(i, r);
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function g(e) {
|
|
846
846
|
return function () {
|
|
847
847
|
var t = this,
|
|
848
|
-
|
|
849
|
-
return new Promise(function (
|
|
850
|
-
var o = e.apply(t,
|
|
848
|
+
n = arguments;
|
|
849
|
+
return new Promise(function (i, r) {
|
|
850
|
+
var o = e.apply(t, n);
|
|
851
851
|
function s(e) {
|
|
852
|
-
|
|
852
|
+
p(o, i, r, s, a, "next", e);
|
|
853
853
|
}
|
|
854
854
|
function a(e) {
|
|
855
|
-
|
|
855
|
+
p(o, i, r, s, a, "throw", e);
|
|
856
856
|
}
|
|
857
857
|
s(void 0);
|
|
858
858
|
});
|
|
@@ -863,43 +863,43 @@ function v(e, t) {
|
|
|
863
863
|
throw new TypeError("Cannot call a class as a function");
|
|
864
864
|
}
|
|
865
865
|
function b(e, t) {
|
|
866
|
-
for (var
|
|
867
|
-
var
|
|
868
|
-
(
|
|
869
|
-
(
|
|
870
|
-
"value" in
|
|
871
|
-
Object.defineProperty(e, f(
|
|
866
|
+
for (var n = 0; n < t.length; n++) {
|
|
867
|
+
var i = t[n];
|
|
868
|
+
(i.enumerable = i.enumerable || !1),
|
|
869
|
+
(i.configurable = !0),
|
|
870
|
+
"value" in i && (i.writable = !0),
|
|
871
|
+
Object.defineProperty(e, f(i.key), i);
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
function m(e, t,
|
|
874
|
+
function m(e, t, n) {
|
|
875
875
|
return (
|
|
876
876
|
t && b(e.prototype, t),
|
|
877
|
-
|
|
877
|
+
n && b(e, n),
|
|
878
878
|
Object.defineProperty(e, "prototype", { writable: !1 }),
|
|
879
879
|
e
|
|
880
880
|
);
|
|
881
881
|
}
|
|
882
882
|
function y(e, t) {
|
|
883
883
|
(null == t || t > e.length) && (t = e.length);
|
|
884
|
-
for (var
|
|
885
|
-
return
|
|
884
|
+
for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
|
|
885
|
+
return i;
|
|
886
886
|
}
|
|
887
887
|
function S(e, t) {
|
|
888
|
-
var
|
|
888
|
+
var n =
|
|
889
889
|
("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
|
|
890
|
-
if (!
|
|
890
|
+
if (!n) {
|
|
891
891
|
if (
|
|
892
892
|
Array.isArray(e) ||
|
|
893
|
-
(
|
|
893
|
+
(n = (function (e, t) {
|
|
894
894
|
if (e) {
|
|
895
895
|
if ("string" == typeof e) return y(e, t);
|
|
896
|
-
var
|
|
896
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
897
897
|
return (
|
|
898
|
-
"Object" ===
|
|
899
|
-
"Map" ===
|
|
898
|
+
"Object" === n && e.constructor && (n = e.constructor.name),
|
|
899
|
+
"Map" === n || "Set" === n
|
|
900
900
|
? Array.from(e)
|
|
901
|
-
: "Arguments" ===
|
|
902
|
-
/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(
|
|
901
|
+
: "Arguments" === n ||
|
|
902
|
+
/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
|
|
903
903
|
? y(e, t)
|
|
904
904
|
: void 0
|
|
905
905
|
);
|
|
@@ -907,13 +907,13 @@ function S(e, t) {
|
|
|
907
907
|
})(e)) ||
|
|
908
908
|
(t && e && "number" == typeof e.length)
|
|
909
909
|
) {
|
|
910
|
-
|
|
911
|
-
var
|
|
910
|
+
n && (e = n);
|
|
911
|
+
var i = 0,
|
|
912
912
|
r = function () {};
|
|
913
913
|
return {
|
|
914
914
|
s: r,
|
|
915
915
|
n: function () {
|
|
916
|
-
return
|
|
916
|
+
return i >= e.length ? { done: !0 } : { done: !1, value: e[i++] };
|
|
917
917
|
},
|
|
918
918
|
e: function (e) {
|
|
919
919
|
throw e;
|
|
@@ -930,10 +930,10 @@ function S(e, t) {
|
|
|
930
930
|
a = !1;
|
|
931
931
|
return {
|
|
932
932
|
s: function () {
|
|
933
|
-
|
|
933
|
+
n = n.call(e);
|
|
934
934
|
},
|
|
935
935
|
n: function () {
|
|
936
|
-
var e =
|
|
936
|
+
var e = n.next();
|
|
937
937
|
return (s = e.done), e;
|
|
938
938
|
},
|
|
939
939
|
e: function (e) {
|
|
@@ -941,7 +941,7 @@ function S(e, t) {
|
|
|
941
941
|
},
|
|
942
942
|
f: function () {
|
|
943
943
|
try {
|
|
944
|
-
s || null ==
|
|
944
|
+
s || null == n.return || n.return();
|
|
945
945
|
} finally {
|
|
946
946
|
if (a) throw o;
|
|
947
947
|
}
|
|
@@ -960,15 +960,15 @@ var C = "DONE",
|
|
|
960
960
|
I = "INTENT_START_STREAM",
|
|
961
961
|
A = "CLOSE",
|
|
962
962
|
R = m(
|
|
963
|
-
function e(t,
|
|
963
|
+
function e(t, n, i, r, o, s, a, c, u, l, d, h, f) {
|
|
964
964
|
v(this, e),
|
|
965
965
|
this.worker,
|
|
966
966
|
(this.onFinalResultCallback = o),
|
|
967
967
|
(this.onErrorCallback = a),
|
|
968
968
|
(this.onPartialResultCallback = s),
|
|
969
969
|
(this.onSessionEventCallback = c),
|
|
970
|
-
(this.onOtherResultsCallback =
|
|
971
|
-
(this.onSpeechResponseCallback =
|
|
970
|
+
(this.onOtherResultsCallback = u),
|
|
971
|
+
(this.onSpeechResponseCallback = l),
|
|
972
972
|
(this.onJobStatusCallback = d),
|
|
973
973
|
(this.packetSeqId = 0),
|
|
974
974
|
(this.audioDuration = 0),
|
|
@@ -977,16 +977,16 @@ var C = "DONE",
|
|
|
977
977
|
this.idleLoop,
|
|
978
978
|
this.lastSent,
|
|
979
979
|
(this.enableLogs = t),
|
|
980
|
-
(this.eosMessage =
|
|
981
|
-
(this.socketTimeoutInterval =
|
|
980
|
+
(this.eosMessage = n || "EOS"),
|
|
981
|
+
(this.socketTimeoutInterval = i || 1e4),
|
|
982
982
|
(this.bufferSizeInterval = h),
|
|
983
983
|
(this.switchToRegularSpeech = f);
|
|
984
984
|
},
|
|
985
985
|
[
|
|
986
986
|
{
|
|
987
987
|
key: "Start",
|
|
988
|
-
value: function (e, t,
|
|
989
|
-
var
|
|
988
|
+
value: function (e, t, n) {
|
|
989
|
+
var i = this;
|
|
990
990
|
this.audioDuration = e;
|
|
991
991
|
var r = "\n (() => {\n ("
|
|
992
992
|
.concat(w.toString(), ")(")
|
|
@@ -1006,7 +1006,7 @@ var C = "DONE",
|
|
|
1006
1006
|
.concat(JSON.stringify(E), ", ")
|
|
1007
1007
|
.concat(JSON.stringify(I), ", ")
|
|
1008
1008
|
.concat(JSON.stringify(this.switchToRegularSpeech), ", ")
|
|
1009
|
-
.concat(JSON.stringify(
|
|
1009
|
+
.concat(JSON.stringify(n), ", ")
|
|
1010
1010
|
.concat(JSON.stringify(this.heavyOp), ");\n })();\n");
|
|
1011
1011
|
(this.worker = new Worker(
|
|
1012
1012
|
URL.createObjectURL(
|
|
@@ -1014,23 +1014,23 @@ var C = "DONE",
|
|
|
1014
1014
|
),
|
|
1015
1015
|
)),
|
|
1016
1016
|
(this.worker.onmessage = function (e) {
|
|
1017
|
-
|
|
1017
|
+
i.enableLogs &&
|
|
1018
1018
|
console.log("Augnito [MAIN]: " + JSON.stringify(e.data));
|
|
1019
1019
|
var t = e.data;
|
|
1020
1020
|
"final" == t.type
|
|
1021
|
-
?
|
|
1021
|
+
? i.onFinalResultCallback(t.data)
|
|
1022
1022
|
: "partial" == t.type
|
|
1023
|
-
?
|
|
1023
|
+
? i.onPartialResultCallback(t.data)
|
|
1024
1024
|
: "meta" == t.type
|
|
1025
|
-
?
|
|
1025
|
+
? i.onSessionEventCallback(t.data)
|
|
1026
1026
|
: "error" == t.type
|
|
1027
|
-
?
|
|
1027
|
+
? i.onErrorCallback(t.data)
|
|
1028
1028
|
: "other" == t.type
|
|
1029
|
-
?
|
|
1029
|
+
? i.onOtherResultsCallback(t.data)
|
|
1030
1030
|
: "jobstatus" == t.type
|
|
1031
|
-
?
|
|
1031
|
+
? i.onJobStatusCallback(t.data.status)
|
|
1032
1032
|
: "speechResponse" == t.type &&
|
|
1033
|
-
|
|
1033
|
+
i.onSpeechResponseCallback(t.data);
|
|
1034
1034
|
});
|
|
1035
1035
|
},
|
|
1036
1036
|
},
|
|
@@ -1043,14 +1043,14 @@ var C = "DONE",
|
|
|
1043
1043
|
(this.audioDuration = 0)),
|
|
1044
1044
|
this.packetSeqId++;
|
|
1045
1045
|
for (
|
|
1046
|
-
var t = new ArrayBuffer(16),
|
|
1047
|
-
|
|
1048
|
-
|
|
1046
|
+
var t = new ArrayBuffer(16), n = new DataView(t), i = 0;
|
|
1047
|
+
i < 4;
|
|
1048
|
+
i++
|
|
1049
1049
|
)
|
|
1050
|
-
|
|
1050
|
+
n.setUint8(i, "@BSR".charCodeAt(i));
|
|
1051
1051
|
return (
|
|
1052
|
-
|
|
1053
|
-
|
|
1052
|
+
n.setBigInt64(4, BigInt(this.packetSeqId), !1),
|
|
1053
|
+
n.setUint8(12, e ? 1 : 0),
|
|
1054
1054
|
t
|
|
1055
1055
|
);
|
|
1056
1056
|
},
|
|
@@ -1058,13 +1058,13 @@ var C = "DONE",
|
|
|
1058
1058
|
{
|
|
1059
1059
|
key: "appendAudioData",
|
|
1060
1060
|
value: function (e, t) {
|
|
1061
|
-
var
|
|
1062
|
-
|
|
1063
|
-
r = new Uint8Array(
|
|
1061
|
+
var n = e.byteLength + t.byteLength,
|
|
1062
|
+
i = new ArrayBuffer(n),
|
|
1063
|
+
r = new Uint8Array(i);
|
|
1064
1064
|
return (
|
|
1065
1065
|
r.set(new Uint8Array(e), 0),
|
|
1066
1066
|
r.set(new Uint8Array(t), e.byteLength),
|
|
1067
|
-
|
|
1067
|
+
i
|
|
1068
1068
|
);
|
|
1069
1069
|
},
|
|
1070
1070
|
},
|
|
@@ -1076,9 +1076,9 @@ var C = "DONE",
|
|
|
1076
1076
|
null === (t = this.worker) || void 0 === t || t.postMessage(A);
|
|
1077
1077
|
else if (e === C)
|
|
1078
1078
|
if (this.shouldSendAudioDataSequence) {
|
|
1079
|
-
var
|
|
1080
|
-
|
|
1081
|
-
null === (
|
|
1079
|
+
var n,
|
|
1080
|
+
i = this.createAudioPacketHeader(!0);
|
|
1081
|
+
null === (n = this.worker) || void 0 === n || n.postMessage(i);
|
|
1082
1082
|
} else {
|
|
1083
1083
|
var r;
|
|
1084
1084
|
null === (r = this.worker) || void 0 === r || r.postMessage(C);
|
|
@@ -1099,16 +1099,16 @@ var C = "DONE",
|
|
|
1099
1099
|
void 0 === c ||
|
|
1100
1100
|
c.postMessage(e);
|
|
1101
1101
|
} else {
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1102
|
+
var u,
|
|
1103
|
+
l = [];
|
|
1104
1104
|
this.shouldSendAudioDataSequence
|
|
1105
|
-
? ((
|
|
1106
|
-
(
|
|
1107
|
-
: (
|
|
1108
|
-
void 0 !==
|
|
1109
|
-
(null === (
|
|
1110
|
-
void 0 ===
|
|
1111
|
-
|
|
1105
|
+
? ((i = this.createAudioPacketHeader(!1)),
|
|
1106
|
+
(l = this.appendAudioData(i, e)))
|
|
1107
|
+
: (l = e),
|
|
1108
|
+
void 0 !== l &&
|
|
1109
|
+
(null === (u = this.worker) ||
|
|
1110
|
+
void 0 === u ||
|
|
1111
|
+
u.postMessage(l, [l]));
|
|
1112
1112
|
}
|
|
1113
1113
|
},
|
|
1114
1114
|
},
|
|
@@ -1120,7 +1120,7 @@ var C = "DONE",
|
|
|
1120
1120
|
},
|
|
1121
1121
|
],
|
|
1122
1122
|
);
|
|
1123
|
-
function w(e, t,
|
|
1123
|
+
function w(e, t, n, i, r, o, s, a, c, u, l, d, h, f, p, g, v, b) {
|
|
1124
1124
|
var m,
|
|
1125
1125
|
y,
|
|
1126
1126
|
S,
|
|
@@ -1136,15 +1136,15 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1136
1136
|
T = [],
|
|
1137
1137
|
_ = !1,
|
|
1138
1138
|
O = !1,
|
|
1139
|
-
|
|
1140
|
-
|
|
1139
|
+
x = !1,
|
|
1140
|
+
N = "",
|
|
1141
1141
|
U = v;
|
|
1142
1142
|
function L() {
|
|
1143
1143
|
(m = +new Date()),
|
|
1144
1144
|
((E =
|
|
1145
|
-
"" !=
|
|
1145
|
+
"" != N ? new WebSocket(u + "&jobid=" + N) : new WebSocket(u)).onopen =
|
|
1146
1146
|
function (e) {
|
|
1147
|
-
|
|
1147
|
+
l &&
|
|
1148
1148
|
console.log(
|
|
1149
1149
|
"Augnito: WebSocket connection established - " +
|
|
1150
1150
|
JSON.stringify(e),
|
|
@@ -1152,7 +1152,7 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1152
1152
|
T.length > 0 && (O = !0);
|
|
1153
1153
|
}),
|
|
1154
1154
|
(E.onmessage = function (e) {
|
|
1155
|
-
|
|
1155
|
+
l &&
|
|
1156
1156
|
console.log(
|
|
1157
1157
|
"Augnito: Message from server - " + JSON.stringify(e.data),
|
|
1158
1158
|
),
|
|
@@ -1165,19 +1165,19 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1165
1165
|
else {
|
|
1166
1166
|
var t = JSON.parse(e.data);
|
|
1167
1167
|
if (
|
|
1168
|
-
(
|
|
1168
|
+
(l && console.log("Augnito [WORKER]: " + JSON.stringify(t)),
|
|
1169
1169
|
"meta" == t.Type)
|
|
1170
1170
|
) {
|
|
1171
|
-
t.JobID && ((
|
|
1171
|
+
t.JobID && ((N = t.JobID), console.log("Augnito JobID:", N)),
|
|
1172
1172
|
self.postMessage({ type: "meta", data: e.data });
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
!
|
|
1173
|
+
var n = JSON.parse(e.data);
|
|
1174
|
+
x = !(
|
|
1175
|
+
!n.Event || "INVALID_AUTH_CREDENTIALS" !== n.Event.Type
|
|
1176
1176
|
);
|
|
1177
1177
|
} else if (t.Result && t.Result.Final) {
|
|
1178
|
-
var
|
|
1179
|
-
b && ((
|
|
1180
|
-
self.postMessage({ type: "final", data:
|
|
1178
|
+
var i = JSON.stringify(t.Result);
|
|
1179
|
+
b && ((i = b(JSON.stringify(t.Result))), console.log(i)),
|
|
1180
|
+
self.postMessage({ type: "final", data: i });
|
|
1181
1181
|
} else
|
|
1182
1182
|
t.Result && !t.Result.Final
|
|
1183
1183
|
? self.postMessage({
|
|
@@ -1214,7 +1214,7 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1214
1214
|
self.postMessage({ type: "error", data: JSON.stringify(e) });
|
|
1215
1215
|
}),
|
|
1216
1216
|
(E.onclose = function (e) {
|
|
1217
|
-
|
|
1217
|
+
l &&
|
|
1218
1218
|
console.log(
|
|
1219
1219
|
"Augnito: WebSocket connection closed - " + JSON.stringify(e),
|
|
1220
1220
|
),
|
|
@@ -1227,17 +1227,17 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1227
1227
|
function M(e) {
|
|
1228
1228
|
if (E && E.readyState === WebSocket.OPEN) {
|
|
1229
1229
|
E.send(e);
|
|
1230
|
-
var
|
|
1231
|
-
return y <= S && (S =
|
|
1230
|
+
var n = +new Date();
|
|
1231
|
+
return y <= S && (S = n - 1), (y = n), !0;
|
|
1232
1232
|
}
|
|
1233
1233
|
return e === t
|
|
1234
|
-
? (
|
|
1234
|
+
? (l &&
|
|
1235
1235
|
console.warn(
|
|
1236
1236
|
"Gulping ".concat(t, " as socket seems already closed..."),
|
|
1237
1237
|
),
|
|
1238
1238
|
K(),
|
|
1239
1239
|
!0)
|
|
1240
|
-
: (+new Date() - m >
|
|
1240
|
+
: (+new Date() - m > i && !x && L(), !1);
|
|
1241
1241
|
}
|
|
1242
1242
|
function J(e) {
|
|
1243
1243
|
w.push(e);
|
|
@@ -1268,17 +1268,17 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
if (d) {
|
|
1270
1270
|
if (!(t instanceof ArrayBuffer)) continue;
|
|
1271
|
-
var
|
|
1272
|
-
|
|
1273
|
-
T.push(
|
|
1271
|
+
var n = new DataView(t),
|
|
1272
|
+
i = { packetNumber: Number(n.getBigInt64(4)), packetData: t };
|
|
1273
|
+
T.push(i);
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
}, a)),
|
|
1277
1277
|
(A = setInterval(function () {
|
|
1278
1278
|
if (E && E.readyState === WebSocket.OPEN) {
|
|
1279
1279
|
var e = +new Date();
|
|
1280
|
-
(
|
|
1281
|
-
(
|
|
1280
|
+
(g ? y > S && e - S > r : e - C > r) &&
|
|
1281
|
+
(l &&
|
|
1282
1282
|
console.error(
|
|
1283
1283
|
"No data received since more than ".concat(
|
|
1284
1284
|
r / 1e3,
|
|
@@ -1293,7 +1293,7 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1293
1293
|
var e = +new Date();
|
|
1294
1294
|
y &&
|
|
1295
1295
|
e - y > o &&
|
|
1296
|
-
(
|
|
1296
|
+
(l &&
|
|
1297
1297
|
console.warn(
|
|
1298
1298
|
"No data sent since more than ".concat(
|
|
1299
1299
|
o / 1e3,
|
|
@@ -1303,21 +1303,21 @@ function w(e, t, i, n, r, o, s, a, c, l, u, d, h, f, g, p, v, b) {
|
|
|
1303
1303
|
E.close());
|
|
1304
1304
|
}
|
|
1305
1305
|
}, c)),
|
|
1306
|
-
(self.onmessage = function (
|
|
1307
|
-
if (
|
|
1308
|
-
else if (
|
|
1306
|
+
(self.onmessage = function (i) {
|
|
1307
|
+
if (i.data === n) (N = ""), (_ = !0), (x = !0), E.close();
|
|
1308
|
+
else if (i.data === e)
|
|
1309
1309
|
J(t),
|
|
1310
|
-
(
|
|
1311
|
-
|
|
1310
|
+
(N = ""),
|
|
1311
|
+
l &&
|
|
1312
1312
|
console.log("Augnito: Worker received DONE, time to terminate..."),
|
|
1313
1313
|
(_ = !0);
|
|
1314
|
-
else if (
|
|
1315
|
-
else if (
|
|
1316
|
-
else if (
|
|
1314
|
+
else if (i.data === h) U = !0;
|
|
1315
|
+
else if (i.data === p) D = !0;
|
|
1316
|
+
else if (i.data === f) {
|
|
1317
1317
|
if ((k instanceof ArrayBuffer && J(k), P.length > 0))
|
|
1318
1318
|
for (var r = 0; r < P.length; r++) J(P[r]);
|
|
1319
1319
|
(P = []), (D = !1), (U = !1), (k = []);
|
|
1320
|
-
} else U && !D ? (k =
|
|
1320
|
+
} else U && !D ? (k = i.data) : U && D ? P.push(i.data) : J(i.data);
|
|
1321
1321
|
});
|
|
1322
1322
|
}
|
|
1323
1323
|
var P,
|
|
@@ -1325,28 +1325,28 @@ var P,
|
|
|
1325
1325
|
T,
|
|
1326
1326
|
_,
|
|
1327
1327
|
O,
|
|
1328
|
-
N,
|
|
1329
1328
|
x,
|
|
1329
|
+
N,
|
|
1330
1330
|
U,
|
|
1331
1331
|
L,
|
|
1332
1332
|
M,
|
|
1333
1333
|
J = m(
|
|
1334
1334
|
function e(
|
|
1335
1335
|
t,
|
|
1336
|
-
i,
|
|
1337
1336
|
n,
|
|
1337
|
+
i,
|
|
1338
1338
|
r,
|
|
1339
1339
|
o,
|
|
1340
1340
|
s,
|
|
1341
1341
|
a,
|
|
1342
1342
|
c,
|
|
1343
|
-
l,
|
|
1344
1343
|
u,
|
|
1344
|
+
l,
|
|
1345
1345
|
d,
|
|
1346
1346
|
h,
|
|
1347
1347
|
f,
|
|
1348
|
-
g,
|
|
1349
1348
|
p,
|
|
1349
|
+
g,
|
|
1350
1350
|
b,
|
|
1351
1351
|
m,
|
|
1352
1352
|
y,
|
|
@@ -1362,15 +1362,15 @@ var P,
|
|
|
1362
1362
|
v(this, e),
|
|
1363
1363
|
this.audioContext,
|
|
1364
1364
|
this.audioStream,
|
|
1365
|
-
(this.executor = new R(
|
|
1365
|
+
(this.executor = new R(n, s, a, c, m, y, S, k, E, I, w, r, h)),
|
|
1366
1366
|
(this.executor.HeavyOp = b),
|
|
1367
1367
|
this.source,
|
|
1368
1368
|
this.processorNode,
|
|
1369
1369
|
(this.isPaused = !1),
|
|
1370
1370
|
(this.isStreaming = !1),
|
|
1371
1371
|
(this.audioData = []),
|
|
1372
|
-
(this.isDebug =
|
|
1373
|
-
(this.enableLogs =
|
|
1372
|
+
(this.isDebug = i),
|
|
1373
|
+
(this.enableLogs = n),
|
|
1374
1374
|
(this.onStateChanged = C),
|
|
1375
1375
|
(this.onIntensity = A),
|
|
1376
1376
|
(this.onError = S),
|
|
@@ -1378,10 +1378,10 @@ var P,
|
|
|
1378
1378
|
(this.pausedBufferInterval = null != o ? o : 1),
|
|
1379
1379
|
(this.shouldReadIntensity = d),
|
|
1380
1380
|
(this.closeSocketWithoutEOS = !1),
|
|
1381
|
-
(this.shouldPreIntialiseRecorder = null !=
|
|
1381
|
+
(this.shouldPreIntialiseRecorder = null != l && l),
|
|
1382
1382
|
(this.echoCancellation = f),
|
|
1383
|
-
(this.noiseSuppression =
|
|
1384
|
-
(this.autoGainControl =
|
|
1383
|
+
(this.noiseSuppression = p),
|
|
1384
|
+
(this.autoGainControl = g),
|
|
1385
1385
|
(this.micNeedsRecovery = !1),
|
|
1386
1386
|
(this.trackEndedHandler = null),
|
|
1387
1387
|
(this.isRecovering = !1),
|
|
@@ -1392,15 +1392,15 @@ var P,
|
|
|
1392
1392
|
(this.onMicReady = P),
|
|
1393
1393
|
(this._originalDeviceId = null),
|
|
1394
1394
|
(this._originalDeviceLabel = null),
|
|
1395
|
-
this.shouldPreIntialiseRecorder && this.InitialiseMediaStream(
|
|
1395
|
+
this.shouldPreIntialiseRecorder && this.InitialiseMediaStream(u, t);
|
|
1396
1396
|
},
|
|
1397
1397
|
[
|
|
1398
1398
|
{
|
|
1399
1399
|
key: "InitialiseMediaStream",
|
|
1400
1400
|
value:
|
|
1401
|
-
((M =
|
|
1402
|
-
h().mark(function e(t,
|
|
1403
|
-
var
|
|
1401
|
+
((M = g(
|
|
1402
|
+
h().mark(function e(t, n) {
|
|
1403
|
+
var i = this;
|
|
1404
1404
|
return h().wrap(
|
|
1405
1405
|
function (e) {
|
|
1406
1406
|
for (;;)
|
|
@@ -1408,7 +1408,7 @@ var P,
|
|
|
1408
1408
|
case 0:
|
|
1409
1409
|
return (
|
|
1410
1410
|
(this.currentDuration = t),
|
|
1411
|
-
(this.currentWsUrl =
|
|
1411
|
+
(this.currentWsUrl = n),
|
|
1412
1412
|
(e.next = 4),
|
|
1413
1413
|
this.createMediaStreamSourceNode()
|
|
1414
1414
|
);
|
|
@@ -1442,37 +1442,37 @@ var P,
|
|
|
1442
1442
|
"AudioContext Sample Rate: " +
|
|
1443
1443
|
this.audioContext.sampleRate,
|
|
1444
1444
|
),
|
|
1445
|
-
"" !==
|
|
1445
|
+
"" !== n &&
|
|
1446
1446
|
this.executor.Start(
|
|
1447
1447
|
t,
|
|
1448
|
-
|
|
1448
|
+
n,
|
|
1449
1449
|
this.shouldPreIntialiseRecorder,
|
|
1450
1450
|
),
|
|
1451
1451
|
this.deviceChangeHandler ||
|
|
1452
|
-
((this.deviceChangeHandler =
|
|
1452
|
+
((this.deviceChangeHandler = g(
|
|
1453
1453
|
h().mark(function e() {
|
|
1454
|
-
var t,
|
|
1454
|
+
var t, n, r, o, s, a, c;
|
|
1455
1455
|
return h().wrap(function (e) {
|
|
1456
1456
|
for (;;)
|
|
1457
1457
|
switch ((e.prev = e.next)) {
|
|
1458
1458
|
case 0:
|
|
1459
1459
|
if (
|
|
1460
1460
|
(s =
|
|
1461
|
-
null === (t =
|
|
1461
|
+
null === (t = i.audioStream) ||
|
|
1462
1462
|
void 0 === t ||
|
|
1463
|
-
null === (
|
|
1464
|
-
void 0 ===
|
|
1463
|
+
null === (n = t.getAudioTracks) ||
|
|
1464
|
+
void 0 === n
|
|
1465
1465
|
? void 0
|
|
1466
|
-
:
|
|
1466
|
+
: n.call(t)[0]) &&
|
|
1467
1467
|
"ended" !== s.readyState
|
|
1468
1468
|
) {
|
|
1469
1469
|
e.next = 7;
|
|
1470
1470
|
break;
|
|
1471
1471
|
}
|
|
1472
1472
|
return (
|
|
1473
|
-
(
|
|
1473
|
+
(i.micNeedsRecovery = !0),
|
|
1474
1474
|
(e.next = 6),
|
|
1475
|
-
|
|
1475
|
+
i.recoverAudioGraph()
|
|
1476
1476
|
);
|
|
1477
1477
|
case 6:
|
|
1478
1478
|
return e.abrupt("return");
|
|
@@ -1489,7 +1489,7 @@ var P,
|
|
|
1489
1489
|
: o.deviceId) && void 0 !== r
|
|
1490
1490
|
? r
|
|
1491
1491
|
: s.label),
|
|
1492
|
-
|
|
1492
|
+
i.log(
|
|
1493
1493
|
'Device change detected. Probing current device: "'.concat(
|
|
1494
1494
|
s.label,
|
|
1495
1495
|
'"',
|
|
@@ -1504,32 +1504,32 @@ var P,
|
|
|
1504
1504
|
break;
|
|
1505
1505
|
}
|
|
1506
1506
|
return (
|
|
1507
|
-
|
|
1507
|
+
i.log(
|
|
1508
1508
|
'Current device "'.concat(
|
|
1509
1509
|
s.label,
|
|
1510
1510
|
'" appears silent/virtual. Searching for a real input device...',
|
|
1511
1511
|
),
|
|
1512
1512
|
),
|
|
1513
|
-
(
|
|
1513
|
+
(i.micNeedsRecovery = !0),
|
|
1514
1514
|
(e.next = 17),
|
|
1515
|
-
W(a,
|
|
1515
|
+
W(a, i.enableLogs)
|
|
1516
1516
|
);
|
|
1517
1517
|
case 17:
|
|
1518
1518
|
return (
|
|
1519
1519
|
(c = e.sent)
|
|
1520
|
-
? (
|
|
1521
|
-
: (
|
|
1520
|
+
? (i._preferredDeviceId = c)
|
|
1521
|
+
: (i.log(
|
|
1522
1522
|
"No active audio input device found after device change",
|
|
1523
1523
|
),
|
|
1524
|
-
(
|
|
1524
|
+
(i._preferredDeviceId = null)),
|
|
1525
1525
|
(e.next = 21),
|
|
1526
|
-
|
|
1526
|
+
i.recoverAudioGraph()
|
|
1527
1527
|
);
|
|
1528
1528
|
case 21:
|
|
1529
1529
|
e.next = 24;
|
|
1530
1530
|
break;
|
|
1531
1531
|
case 23:
|
|
1532
|
-
|
|
1532
|
+
i.log(
|
|
1533
1533
|
'Current device "'.concat(
|
|
1534
1534
|
s.label,
|
|
1535
1535
|
'" is producing audio — no switch needed',
|
|
@@ -1563,9 +1563,9 @@ var P,
|
|
|
1563
1563
|
{
|
|
1564
1564
|
key: "StartStream",
|
|
1565
1565
|
value:
|
|
1566
|
-
((L =
|
|
1567
|
-
h().mark(function e(t,
|
|
1568
|
-
var
|
|
1566
|
+
((L = g(
|
|
1567
|
+
h().mark(function e(t, n) {
|
|
1568
|
+
var i, r;
|
|
1569
1569
|
return h().wrap(
|
|
1570
1570
|
function (e) {
|
|
1571
1571
|
for (;;)
|
|
@@ -1579,7 +1579,7 @@ var P,
|
|
|
1579
1579
|
break;
|
|
1580
1580
|
}
|
|
1581
1581
|
return (
|
|
1582
|
-
(e.next = 4), this.InitialiseMediaStream(t,
|
|
1582
|
+
(e.next = 4), this.InitialiseMediaStream(t, n, !1)
|
|
1583
1583
|
);
|
|
1584
1584
|
case 4:
|
|
1585
1585
|
e.next = 7;
|
|
@@ -1602,11 +1602,11 @@ var P,
|
|
|
1602
1602
|
return (e.next = 11), this.audioContext.suspend();
|
|
1603
1603
|
case 11:
|
|
1604
1604
|
return (
|
|
1605
|
-
null === (
|
|
1606
|
-
void 0 ===
|
|
1607
|
-
null === (r =
|
|
1605
|
+
null === (i = this.audioStream) ||
|
|
1606
|
+
void 0 === i ||
|
|
1607
|
+
null === (r = i.getTracks) ||
|
|
1608
1608
|
void 0 === r ||
|
|
1609
|
-
null === (r = r.call(
|
|
1609
|
+
null === (r = r.call(i)) ||
|
|
1610
1610
|
void 0 === r ||
|
|
1611
1611
|
r.forEach(function (e) {
|
|
1612
1612
|
try {
|
|
@@ -1645,7 +1645,7 @@ var P,
|
|
|
1645
1645
|
{
|
|
1646
1646
|
key: "createBufferedSourceNode",
|
|
1647
1647
|
value:
|
|
1648
|
-
((U =
|
|
1648
|
+
((U = g(
|
|
1649
1649
|
h().mark(function e() {
|
|
1650
1650
|
var t;
|
|
1651
1651
|
return h().wrap(
|
|
@@ -1685,17 +1685,17 @@ var P,
|
|
|
1685
1685
|
{
|
|
1686
1686
|
key: "createMediaStreamSourceNode",
|
|
1687
1687
|
value:
|
|
1688
|
-
((
|
|
1688
|
+
((N = g(
|
|
1689
1689
|
h().mark(function e() {
|
|
1690
1690
|
var t,
|
|
1691
|
-
i,
|
|
1692
1691
|
n,
|
|
1692
|
+
i,
|
|
1693
1693
|
r,
|
|
1694
1694
|
o,
|
|
1695
1695
|
s,
|
|
1696
1696
|
a,
|
|
1697
1697
|
c,
|
|
1698
|
-
|
|
1698
|
+
u = this;
|
|
1699
1699
|
return h().wrap(
|
|
1700
1700
|
function (e) {
|
|
1701
1701
|
for (;;)
|
|
@@ -1735,23 +1735,23 @@ var P,
|
|
|
1735
1735
|
(s =
|
|
1736
1736
|
null !==
|
|
1737
1737
|
(t =
|
|
1738
|
-
null === (
|
|
1739
|
-
void 0 ===
|
|
1740
|
-
null === (
|
|
1741
|
-
void 0 ===
|
|
1738
|
+
null === (n = o.getSettings) ||
|
|
1739
|
+
void 0 === n ||
|
|
1740
|
+
null === (n = n.call(o)) ||
|
|
1741
|
+
void 0 === n
|
|
1742
1742
|
? void 0
|
|
1743
|
-
:
|
|
1743
|
+
: n.deviceId) && void 0 !== t
|
|
1744
1744
|
? t
|
|
1745
1745
|
: ""),
|
|
1746
|
-
(a = null !== (
|
|
1746
|
+
(a = null !== (i = o.label) && void 0 !== i ? i : ""),
|
|
1747
1747
|
this._originalDeviceId ||
|
|
1748
1748
|
((this._originalDeviceId = s),
|
|
1749
1749
|
(this._originalDeviceLabel = a)),
|
|
1750
1750
|
this.trackEndedHandler &&
|
|
1751
1751
|
(this.trackEndedHandler = null),
|
|
1752
1752
|
(this.trackEndedHandler = function () {
|
|
1753
|
-
(
|
|
1754
|
-
|
|
1753
|
+
(u.micNeedsRecovery = !0),
|
|
1754
|
+
u.onError(
|
|
1755
1755
|
JSON.stringify({
|
|
1756
1756
|
Type: "ERROR",
|
|
1757
1757
|
Data: "Audio track ended. Possibly the mic was unplugged.",
|
|
@@ -1787,15 +1787,15 @@ var P,
|
|
|
1787
1787
|
}),
|
|
1788
1788
|
)),
|
|
1789
1789
|
function () {
|
|
1790
|
-
return
|
|
1790
|
+
return N.apply(this, arguments);
|
|
1791
1791
|
}),
|
|
1792
1792
|
},
|
|
1793
1793
|
{
|
|
1794
1794
|
key: "loadAudio",
|
|
1795
1795
|
value:
|
|
1796
|
-
((
|
|
1796
|
+
((x = g(
|
|
1797
1797
|
h().mark(function e() {
|
|
1798
|
-
var t,
|
|
1798
|
+
var t, n, i;
|
|
1799
1799
|
return h().wrap(
|
|
1800
1800
|
function (e) {
|
|
1801
1801
|
for (;;)
|
|
@@ -1810,12 +1810,12 @@ var P,
|
|
|
1810
1810
|
return (t = e.sent), (e.next = 6), t.arrayBuffer();
|
|
1811
1811
|
case 6:
|
|
1812
1812
|
return (
|
|
1813
|
-
(
|
|
1813
|
+
(n = e.sent),
|
|
1814
1814
|
(e.next = 9),
|
|
1815
|
-
this.audioContext.decodeAudioData(
|
|
1815
|
+
this.audioContext.decodeAudioData(n)
|
|
1816
1816
|
);
|
|
1817
1817
|
case 9:
|
|
1818
|
-
return (
|
|
1818
|
+
return (i = e.sent), e.abrupt("return", i);
|
|
1819
1819
|
case 13:
|
|
1820
1820
|
return (
|
|
1821
1821
|
(e.prev = 13),
|
|
@@ -1839,16 +1839,16 @@ var P,
|
|
|
1839
1839
|
}),
|
|
1840
1840
|
)),
|
|
1841
1841
|
function () {
|
|
1842
|
-
return
|
|
1842
|
+
return x.apply(this, arguments);
|
|
1843
1843
|
}),
|
|
1844
1844
|
},
|
|
1845
1845
|
{
|
|
1846
1846
|
key: "createProcessorNode",
|
|
1847
1847
|
value:
|
|
1848
|
-
((O =
|
|
1848
|
+
((O = g(
|
|
1849
1849
|
h().mark(function e() {
|
|
1850
1850
|
var t,
|
|
1851
|
-
|
|
1851
|
+
n = this;
|
|
1852
1852
|
return h().wrap(
|
|
1853
1853
|
function (e) {
|
|
1854
1854
|
for (;;)
|
|
@@ -1898,33 +1898,33 @@ var P,
|
|
|
1898
1898
|
),
|
|
1899
1899
|
(this.processorNode.port.onmessage = function (e) {
|
|
1900
1900
|
var t = e.data,
|
|
1901
|
-
|
|
1901
|
+
i = t.type,
|
|
1902
1902
|
r = t.value;
|
|
1903
|
-
if (
|
|
1904
|
-
|
|
1903
|
+
if (i == C)
|
|
1904
|
+
n.log(
|
|
1905
1905
|
"Worklet processing done, clearing resources...",
|
|
1906
1906
|
),
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
else if (e.data == k)
|
|
1907
|
+
n.isDebug && n.saveAudio(),
|
|
1908
|
+
n.cleanup();
|
|
1909
|
+
else if (e.data == k) n.executor.Send(k);
|
|
1910
1910
|
else {
|
|
1911
1911
|
var o;
|
|
1912
|
-
"intensity" ===
|
|
1913
|
-
? null === (o =
|
|
1912
|
+
"intensity" === i
|
|
1913
|
+
? null === (o = n.onIntensity) ||
|
|
1914
1914
|
void 0 === o ||
|
|
1915
|
-
o.call(
|
|
1916
|
-
: "audioData" ===
|
|
1917
|
-
|
|
1915
|
+
o.call(n, r)
|
|
1916
|
+
: "audioData" === i &&
|
|
1917
|
+
n.isDebug &&
|
|
1918
1918
|
new Int16Array(r).forEach(function (e) {
|
|
1919
|
-
|
|
1920
|
-
|
|
1919
|
+
n.audioData.length <= 288e5 &&
|
|
1920
|
+
n.audioData.push(e);
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
|
-
|
|
1924
|
-
(
|
|
1925
|
-
? (
|
|
1926
|
-
(
|
|
1927
|
-
: "intensity" !==
|
|
1923
|
+
n.executor &&
|
|
1924
|
+
(n.closeSocketWithoutEOS
|
|
1925
|
+
? (n.executor.Send(A),
|
|
1926
|
+
(n.closeSocketWithoutEOS = !1))
|
|
1927
|
+
: "intensity" !== i && n.executor.Send(r));
|
|
1928
1928
|
}),
|
|
1929
1929
|
(e.next = 18);
|
|
1930
1930
|
break;
|
|
@@ -1953,7 +1953,7 @@ var P,
|
|
|
1953
1953
|
{
|
|
1954
1954
|
key: "PauseStream",
|
|
1955
1955
|
value:
|
|
1956
|
-
((_ =
|
|
1956
|
+
((_ = g(
|
|
1957
1957
|
h().mark(function e() {
|
|
1958
1958
|
return h().wrap(
|
|
1959
1959
|
function (e) {
|
|
@@ -1997,23 +1997,23 @@ var P,
|
|
|
1997
1997
|
{
|
|
1998
1998
|
key: "ResumeStream",
|
|
1999
1999
|
value:
|
|
2000
|
-
((T =
|
|
2000
|
+
((T = g(
|
|
2001
2001
|
h().mark(function e() {
|
|
2002
|
-
var t,
|
|
2002
|
+
var t, n, i;
|
|
2003
2003
|
return h().wrap(
|
|
2004
2004
|
function (e) {
|
|
2005
2005
|
for (;;)
|
|
2006
2006
|
switch ((e.prev = e.next)) {
|
|
2007
2007
|
case 0:
|
|
2008
2008
|
if (
|
|
2009
|
-
(
|
|
2009
|
+
(i =
|
|
2010
2010
|
null === (t = this.audioStream) ||
|
|
2011
2011
|
void 0 === t ||
|
|
2012
|
-
null === (
|
|
2013
|
-
void 0 ===
|
|
2012
|
+
null === (n = t.getAudioTracks) ||
|
|
2013
|
+
void 0 === n
|
|
2014
2014
|
? void 0
|
|
2015
|
-
:
|
|
2016
|
-
"ended" !==
|
|
2015
|
+
: n.call(t)[0]) &&
|
|
2016
|
+
"ended" !== i.readyState &&
|
|
2017
2017
|
!this.micNeedsRecovery
|
|
2018
2018
|
) {
|
|
2019
2019
|
e.next = 5;
|
|
@@ -2095,22 +2095,22 @@ var P,
|
|
|
2095
2095
|
get: function () {
|
|
2096
2096
|
var e,
|
|
2097
2097
|
t,
|
|
2098
|
-
|
|
2098
|
+
n =
|
|
2099
2099
|
null === (e = this.audioStream) ||
|
|
2100
2100
|
void 0 === e ||
|
|
2101
2101
|
null === (t = e.getAudioTracks) ||
|
|
2102
2102
|
void 0 === t
|
|
2103
2103
|
? void 0
|
|
2104
2104
|
: t.call(e)[0];
|
|
2105
|
-
return !
|
|
2105
|
+
return !n || n.muted || "ended" === n.readyState;
|
|
2106
2106
|
},
|
|
2107
2107
|
},
|
|
2108
2108
|
{
|
|
2109
2109
|
key: "StopStream",
|
|
2110
2110
|
value:
|
|
2111
|
-
((D =
|
|
2111
|
+
((D = g(
|
|
2112
2112
|
h().mark(function e(t) {
|
|
2113
|
-
var
|
|
2113
|
+
var n, i, r, o, s, a, c, u;
|
|
2114
2114
|
return h().wrap(
|
|
2115
2115
|
function (e) {
|
|
2116
2116
|
for (;;)
|
|
@@ -2118,9 +2118,9 @@ var P,
|
|
|
2118
2118
|
case 0:
|
|
2119
2119
|
if (
|
|
2120
2120
|
"suspended" ===
|
|
2121
|
-
(null === (
|
|
2121
|
+
(null === (n = this.audioContext) || void 0 === n
|
|
2122
2122
|
? void 0
|
|
2123
|
-
:
|
|
2123
|
+
: n.state)
|
|
2124
2124
|
) {
|
|
2125
2125
|
e.next = 4;
|
|
2126
2126
|
break;
|
|
@@ -2144,15 +2144,15 @@ var P,
|
|
|
2144
2144
|
this.deviceChangeHandler,
|
|
2145
2145
|
),
|
|
2146
2146
|
(this.deviceChangeHandler = null)),
|
|
2147
|
-
(
|
|
2148
|
-
null === (
|
|
2149
|
-
void 0 ===
|
|
2150
|
-
null === (r =
|
|
2147
|
+
(u =
|
|
2148
|
+
null === (i = this.audioStream) ||
|
|
2149
|
+
void 0 === i ||
|
|
2150
|
+
null === (r = i.getAudioTracks) ||
|
|
2151
2151
|
void 0 === r
|
|
2152
2152
|
? void 0
|
|
2153
|
-
: r.call(
|
|
2153
|
+
: r.call(i)[0]) &&
|
|
2154
2154
|
this.trackEndedHandler &&
|
|
2155
|
-
|
|
2155
|
+
u.removeEventListener(
|
|
2156
2156
|
"ended",
|
|
2157
2157
|
this.trackEndedHandler,
|
|
2158
2158
|
),
|
|
@@ -2190,20 +2190,23 @@ var P,
|
|
|
2190
2190
|
{
|
|
2191
2191
|
key: "recoverAudioGraph",
|
|
2192
2192
|
value:
|
|
2193
|
-
((P =
|
|
2193
|
+
((P = g(
|
|
2194
2194
|
h().mark(function e() {
|
|
2195
2195
|
var t,
|
|
2196
|
-
i,
|
|
2197
2196
|
n,
|
|
2197
|
+
i,
|
|
2198
2198
|
r,
|
|
2199
2199
|
o,
|
|
2200
2200
|
s,
|
|
2201
2201
|
a,
|
|
2202
2202
|
c,
|
|
2203
|
-
l,
|
|
2204
2203
|
u,
|
|
2204
|
+
l,
|
|
2205
2205
|
d,
|
|
2206
|
-
f
|
|
2206
|
+
f,
|
|
2207
|
+
p,
|
|
2208
|
+
g,
|
|
2209
|
+
v = this;
|
|
2207
2210
|
return h().wrap(
|
|
2208
2211
|
function (e) {
|
|
2209
2212
|
for (;;)
|
|
@@ -2272,68 +2275,86 @@ var P,
|
|
|
2272
2275
|
}
|
|
2273
2276
|
return (e.next = 22), this.audioContext.suspend();
|
|
2274
2277
|
case 22:
|
|
2275
|
-
(
|
|
2276
|
-
(
|
|
2277
|
-
null === (i = this.audioStream) ||
|
|
2278
|
-
void 0 === i ||
|
|
2279
|
-
null === (n = i.getAudioTracks) ||
|
|
2280
|
-
void 0 === n
|
|
2281
|
-
? void 0
|
|
2282
|
-
: n.call(i)[0]),
|
|
2278
|
+
return (
|
|
2279
|
+
(this.micNeedsRecovery = !1),
|
|
2283
2280
|
(u =
|
|
2281
|
+
null === (n = this.audioStream) ||
|
|
2282
|
+
void 0 === n ||
|
|
2283
|
+
null === (i = n.getAudioTracks) ||
|
|
2284
|
+
void 0 === i
|
|
2285
|
+
? void 0
|
|
2286
|
+
: i.call(n)[0]),
|
|
2287
|
+
(l =
|
|
2284
2288
|
null !==
|
|
2285
2289
|
(r =
|
|
2286
|
-
null ==
|
|
2287
|
-
null === (o =
|
|
2290
|
+
null == u ||
|
|
2291
|
+
null === (o = u.getSettings) ||
|
|
2288
2292
|
void 0 === o ||
|
|
2289
|
-
null === (o = o.call(
|
|
2293
|
+
null === (o = o.call(u)) ||
|
|
2290
2294
|
void 0 === o
|
|
2291
2295
|
? void 0
|
|
2292
2296
|
: o.deviceId) && void 0 !== r
|
|
2293
2297
|
? r
|
|
2294
2298
|
: ""),
|
|
2295
2299
|
(d =
|
|
2296
|
-
null !== (s = null ==
|
|
2300
|
+
null !== (s = null == u ? void 0 : u.label) &&
|
|
2297
2301
|
void 0 !== s
|
|
2298
2302
|
? s
|
|
2299
2303
|
: ""),
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2304
|
+
(e.next = 28),
|
|
2305
|
+
navigator.mediaDevices.enumerateDevices()
|
|
2306
|
+
);
|
|
2307
|
+
case 28:
|
|
2308
|
+
if (
|
|
2309
|
+
((f = e.sent),
|
|
2310
|
+
(p = f.some(function (e) {
|
|
2311
|
+
return (
|
|
2312
|
+
"audioinput" === e.kind &&
|
|
2313
|
+
e.label &&
|
|
2314
|
+
e.label === v._originalDeviceLabel
|
|
2315
|
+
);
|
|
2316
|
+
})),
|
|
2317
|
+
console.log("Original device present:", p),
|
|
2318
|
+
console.log("Recovered device:", d),
|
|
2319
|
+
(e.t0 = l),
|
|
2320
|
+
!e.t0)
|
|
2321
|
+
) {
|
|
2322
|
+
e.next = 37;
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
return (e.next = 36), K(l);
|
|
2326
|
+
case 36:
|
|
2327
|
+
e.t0 = e.sent;
|
|
2328
|
+
case 37:
|
|
2329
|
+
(g = e.t0),
|
|
2309
2330
|
this.isPaused &&
|
|
2310
|
-
|
|
2331
|
+
(g || p) &&
|
|
2311
2332
|
this.onMicReady &&
|
|
2312
2333
|
!this._micReadyFired &&
|
|
2313
2334
|
((this._micReadyFired = !0),
|
|
2314
2335
|
setTimeout(function () {
|
|
2315
|
-
|
|
2336
|
+
v._micReadyFired = !1;
|
|
2316
2337
|
}, 300),
|
|
2317
2338
|
this.onMicReady()),
|
|
2318
2339
|
this.log("Audio graph recovery completed"),
|
|
2319
|
-
(e.next =
|
|
2340
|
+
(e.next = 45);
|
|
2320
2341
|
break;
|
|
2321
|
-
case
|
|
2322
|
-
(e.prev =
|
|
2323
|
-
(e.
|
|
2324
|
-
console.error("Recovery failed", e.
|
|
2325
|
-
case
|
|
2342
|
+
case 42:
|
|
2343
|
+
(e.prev = 42),
|
|
2344
|
+
(e.t1 = e.catch(3)),
|
|
2345
|
+
console.error("Recovery failed", e.t1);
|
|
2346
|
+
case 45:
|
|
2326
2347
|
return (
|
|
2327
|
-
(e.prev =
|
|
2348
|
+
(e.prev = 45), (this.isRecovering = !1), e.finish(45)
|
|
2328
2349
|
);
|
|
2329
|
-
case
|
|
2350
|
+
case 48:
|
|
2330
2351
|
case "end":
|
|
2331
2352
|
return e.stop();
|
|
2332
2353
|
}
|
|
2333
2354
|
},
|
|
2334
2355
|
e,
|
|
2335
2356
|
this,
|
|
2336
|
-
[[3,
|
|
2357
|
+
[[3, 42, 45, 48]],
|
|
2337
2358
|
);
|
|
2338
2359
|
}),
|
|
2339
2360
|
)),
|
|
@@ -2386,27 +2407,27 @@ var P,
|
|
|
2386
2407
|
key: "encodeWAV",
|
|
2387
2408
|
value: function () {
|
|
2388
2409
|
var e = new DataView(new ArrayBuffer(2 * this.audioData.length));
|
|
2389
|
-
this.audioData.forEach(function (t,
|
|
2390
|
-
e.setInt16(2 *
|
|
2410
|
+
this.audioData.forEach(function (t, n) {
|
|
2411
|
+
e.setInt16(2 * n, t, !0);
|
|
2391
2412
|
});
|
|
2392
2413
|
var t = e.buffer.byteLength,
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
for (var r = 0; r < t; r++)
|
|
2409
|
-
return
|
|
2414
|
+
n = 44 + t,
|
|
2415
|
+
i = new DataView(new ArrayBuffer(n));
|
|
2416
|
+
i.setUint32(0, 1380533830, !1),
|
|
2417
|
+
i.setUint32(4, n - 8, !0),
|
|
2418
|
+
i.setUint32(8, 1463899717, !1),
|
|
2419
|
+
i.setUint32(12, 1718449184, !1),
|
|
2420
|
+
i.setUint32(16, 16, !0),
|
|
2421
|
+
i.setUint16(20, 1, !0),
|
|
2422
|
+
i.setUint16(22, 1, !0),
|
|
2423
|
+
i.setUint32(24, 16e3, !0),
|
|
2424
|
+
i.setUint32(28, 32e3, !0),
|
|
2425
|
+
i.setUint16(32, 2, !0),
|
|
2426
|
+
i.setUint16(34, 16, !0),
|
|
2427
|
+
i.setUint32(36, 1684108385, !1),
|
|
2428
|
+
i.setUint32(40, t, !0);
|
|
2429
|
+
for (var r = 0; r < t; r++) i.setInt8(44 + r, e.getInt8(r));
|
|
2430
|
+
return i;
|
|
2410
2431
|
},
|
|
2411
2432
|
},
|
|
2412
2433
|
{
|
|
@@ -2427,17 +2448,17 @@ function K(e) {
|
|
|
2427
2448
|
}
|
|
2428
2449
|
function j() {
|
|
2429
2450
|
return (
|
|
2430
|
-
(j =
|
|
2451
|
+
(j = g(
|
|
2431
2452
|
h().mark(function e(t) {
|
|
2432
|
-
var
|
|
2433
|
-
|
|
2453
|
+
var n,
|
|
2454
|
+
i,
|
|
2434
2455
|
r,
|
|
2435
2456
|
o,
|
|
2436
2457
|
s,
|
|
2437
2458
|
a,
|
|
2438
2459
|
c,
|
|
2439
|
-
l,
|
|
2440
2460
|
u,
|
|
2461
|
+
l,
|
|
2441
2462
|
d = arguments;
|
|
2442
2463
|
return h().wrap(
|
|
2443
2464
|
function (e) {
|
|
@@ -2445,8 +2466,8 @@ function j() {
|
|
|
2445
2466
|
switch ((e.prev = e.next)) {
|
|
2446
2467
|
case 0:
|
|
2447
2468
|
return (
|
|
2448
|
-
(
|
|
2449
|
-
(
|
|
2469
|
+
(n = d.length > 1 && void 0 !== d[1] ? d[1] : 350),
|
|
2470
|
+
(i = d.length > 2 && void 0 !== d[2] ? d[2] : 0.01),
|
|
2450
2471
|
(r = null),
|
|
2451
2472
|
(o = null),
|
|
2452
2473
|
(e.prev = 4),
|
|
@@ -2463,19 +2484,19 @@ function j() {
|
|
|
2463
2484
|
((a = o.createAnalyser()).fftSize = 256),
|
|
2464
2485
|
s.connect(a),
|
|
2465
2486
|
(c = a.frequencyBinCount),
|
|
2466
|
-
(
|
|
2487
|
+
(u = new Float32Array(c)),
|
|
2467
2488
|
(e.next = 17),
|
|
2468
2489
|
new Promise(function (e) {
|
|
2469
2490
|
var t = 0,
|
|
2470
2491
|
r = performance.now();
|
|
2471
2492
|
requestAnimationFrame(function o() {
|
|
2472
|
-
a.getFloatTimeDomainData(
|
|
2473
|
-
for (var s = 0,
|
|
2493
|
+
a.getFloatTimeDomainData(u);
|
|
2494
|
+
for (var s = 0, l = 0; l < c; l++) s += u[l] * u[l];
|
|
2474
2495
|
var d = Math.sqrt(s / c);
|
|
2475
2496
|
d > t && (t = d),
|
|
2476
|
-
performance.now() - r <
|
|
2497
|
+
performance.now() - r < n
|
|
2477
2498
|
? requestAnimationFrame(o)
|
|
2478
|
-
: e(t >
|
|
2499
|
+
: e(t > i);
|
|
2479
2500
|
});
|
|
2480
2501
|
})
|
|
2481
2502
|
);
|
|
@@ -2488,9 +2509,9 @@ function j() {
|
|
|
2488
2509
|
case 23:
|
|
2489
2510
|
return (
|
|
2490
2511
|
(e.prev = 23),
|
|
2491
|
-
null === (
|
|
2492
|
-
void 0 ===
|
|
2493
|
-
|
|
2512
|
+
null === (l = r) ||
|
|
2513
|
+
void 0 === l ||
|
|
2514
|
+
l.getTracks().forEach(function (e) {
|
|
2494
2515
|
return e.stop();
|
|
2495
2516
|
}),
|
|
2496
2517
|
o &&
|
|
@@ -2516,9 +2537,9 @@ function W(e) {
|
|
|
2516
2537
|
return G.apply(this, arguments);
|
|
2517
2538
|
}
|
|
2518
2539
|
function G() {
|
|
2519
|
-
return (G =
|
|
2540
|
+
return (G = g(
|
|
2520
2541
|
h().mark(function e(t) {
|
|
2521
|
-
var
|
|
2542
|
+
var n, i, r, o, s;
|
|
2522
2543
|
return h().wrap(
|
|
2523
2544
|
function (e) {
|
|
2524
2545
|
for (;;)
|
|
@@ -2530,17 +2551,17 @@ function G() {
|
|
|
2530
2551
|
navigator.mediaDevices.enumerateDevices()
|
|
2531
2552
|
);
|
|
2532
2553
|
case 4:
|
|
2533
|
-
(
|
|
2554
|
+
(n = e.sent), (e.next = 10);
|
|
2534
2555
|
break;
|
|
2535
2556
|
case 7:
|
|
2536
2557
|
return (
|
|
2537
2558
|
(e.prev = 7), (e.t0 = e.catch(1)), e.abrupt("return", null)
|
|
2538
2559
|
);
|
|
2539
2560
|
case 10:
|
|
2540
|
-
(
|
|
2561
|
+
(i = n.filter(function (e) {
|
|
2541
2562
|
return "audioinput" === e.kind && e.deviceId !== t;
|
|
2542
2563
|
})),
|
|
2543
|
-
(r = S(
|
|
2564
|
+
(r = S(i)),
|
|
2544
2565
|
(e.prev = 12),
|
|
2545
2566
|
r.s();
|
|
2546
2567
|
case 14:
|
|
@@ -2585,8 +2606,8 @@ function G() {
|
|
|
2585
2606
|
var F = (function () {
|
|
2586
2607
|
function e() {
|
|
2587
2608
|
var t,
|
|
2588
|
-
i,
|
|
2589
2609
|
n,
|
|
2610
|
+
i,
|
|
2590
2611
|
r,
|
|
2591
2612
|
o =
|
|
2592
2613
|
arguments.length > 0 && void 0 !== arguments[0]
|
|
@@ -2625,10 +2646,10 @@ var F = (function () {
|
|
|
2625
2646
|
(this.socketTimeoutInterval = o.socketTimeoutInterval),
|
|
2626
2647
|
(this.shouldSendAudioDataSequence = o.shouldSendAudioDataSequence),
|
|
2627
2648
|
(this.reconnectAudioDuration =
|
|
2628
|
-
null !== (
|
|
2649
|
+
null !== (n = o.reconnectAudioDuration) && void 0 !== n ? n : 0),
|
|
2629
2650
|
(this.shouldPreIntialiseRecorder = o.shouldPreIntialiseRecorder),
|
|
2630
2651
|
(this.switchToRegularSpeechProfile =
|
|
2631
|
-
null !== (
|
|
2652
|
+
null !== (i = o.switchToRegularSpeechProfile) && void 0 !== i && i),
|
|
2632
2653
|
(this._echoCancellation = o.echoCancellation),
|
|
2633
2654
|
(this._noiseSuppression = o.noiseSuppression),
|
|
2634
2655
|
(this._autoGainControl = o.autoGainControl),
|
|
@@ -2752,7 +2773,7 @@ var F = (function () {
|
|
|
2752
2773
|
{
|
|
2753
2774
|
key: "startAudio",
|
|
2754
2775
|
value:
|
|
2755
|
-
((t =
|
|
2776
|
+
((t = g(
|
|
2756
2777
|
h().mark(function e(t) {
|
|
2757
2778
|
return h().wrap(
|
|
2758
2779
|
function (e) {
|
|
@@ -2817,20 +2838,20 @@ var F = (function () {
|
|
|
2817
2838
|
value: function () {
|
|
2818
2839
|
var e,
|
|
2819
2840
|
t,
|
|
2820
|
-
|
|
2821
|
-
|
|
2841
|
+
n = this,
|
|
2842
|
+
i =
|
|
2822
2843
|
!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],
|
|
2823
2844
|
r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
2824
2845
|
((null !== (e = this.streamer) && void 0 !== e && e.IsStreaming) ||
|
|
2825
2846
|
r) &&
|
|
2826
|
-
(null === (t = this.streamer) || void 0 === t || t.StopStream(
|
|
2847
|
+
(null === (t = this.streamer) || void 0 === t || t.StopStream(i),
|
|
2827
2848
|
(this.streamer = null),
|
|
2828
2849
|
this.log("Stream Stopped..."),
|
|
2829
2850
|
this.shouldPreIntialiseRecorder &&
|
|
2830
2851
|
setTimeout(function () {
|
|
2831
|
-
|
|
2832
|
-
? (
|
|
2833
|
-
: (
|
|
2852
|
+
n.needsDispose
|
|
2853
|
+
? (n.needsDispose = !1)
|
|
2854
|
+
: (n.initialiseStreamer(), (n.streamerNotStarted = !0));
|
|
2834
2855
|
}, 500));
|
|
2835
2856
|
},
|
|
2836
2857
|
},
|
|
@@ -2932,21 +2953,21 @@ var F = (function () {
|
|
|
2932
2953
|
var t;
|
|
2933
2954
|
})();
|
|
2934
2955
|
function B(e, t) {
|
|
2935
|
-
var
|
|
2956
|
+
var n;
|
|
2936
2957
|
return function () {
|
|
2937
2958
|
for (
|
|
2938
|
-
var
|
|
2959
|
+
var i = this, r = arguments.length, o = new Array(r), s = 0;
|
|
2939
2960
|
s < r;
|
|
2940
2961
|
s++
|
|
2941
2962
|
)
|
|
2942
2963
|
o[s] = arguments[s];
|
|
2943
|
-
|
|
2944
|
-
(
|
|
2945
|
-
return e.apply(
|
|
2964
|
+
n && clearTimeout(n),
|
|
2965
|
+
(n = setTimeout(function () {
|
|
2966
|
+
return e.apply(i, o);
|
|
2946
2967
|
}, t));
|
|
2947
2968
|
};
|
|
2948
2969
|
}
|
|
2949
|
-
class V extends
|
|
2970
|
+
class V extends u {
|
|
2950
2971
|
constructor(e) {
|
|
2951
2972
|
super(),
|
|
2952
2973
|
Object.defineProperty(this, "_config", {
|
|
@@ -2980,49 +3001,49 @@ class V extends l {
|
|
|
2980
3001
|
getSettingsConfigMaster(t) {
|
|
2981
3002
|
return e(this, void 0, void 0, function* () {
|
|
2982
3003
|
const e = this.getURL("/configmaster"),
|
|
2983
|
-
|
|
3004
|
+
n = {
|
|
2984
3005
|
SubscriptionCode: this._config.subscriptionCode,
|
|
2985
3006
|
AccessKey: this._config.accessKey,
|
|
2986
3007
|
UserTag: this._config.userTag,
|
|
2987
3008
|
ConfigTypeId: t,
|
|
2988
3009
|
};
|
|
2989
|
-
return yield this.makePostRequest(e,
|
|
3010
|
+
return yield this.makePostRequest(e, n);
|
|
2990
3011
|
});
|
|
2991
3012
|
}
|
|
2992
3013
|
getOrgConfigMapping(t) {
|
|
2993
3014
|
return e(this, void 0, void 0, function* () {
|
|
2994
3015
|
const e = this.getURL("/configmapping").replace("/v1", "/v2"),
|
|
2995
|
-
|
|
3016
|
+
n = {
|
|
2996
3017
|
SubscriptionCode: this._config.subscriptionCode,
|
|
2997
3018
|
AccessKey: this._config.accessKey,
|
|
2998
3019
|
UserTag: this._config.userTag,
|
|
2999
3020
|
ConfigTypeId: t,
|
|
3000
3021
|
};
|
|
3001
|
-
return yield this.makePostRequest(e,
|
|
3022
|
+
return yield this.makePostRequest(e, n);
|
|
3002
3023
|
});
|
|
3003
3024
|
}
|
|
3004
3025
|
getUserConfigSettings(t) {
|
|
3005
3026
|
return e(this, void 0, void 0, function* () {
|
|
3006
3027
|
const e = this.getURL("/userconfigmapping"),
|
|
3007
|
-
|
|
3028
|
+
n = {
|
|
3008
3029
|
SubscriptionCode: this._config.subscriptionCode,
|
|
3009
3030
|
AccessKey: this._config.accessKey,
|
|
3010
3031
|
UserTag: this._config.userTag,
|
|
3011
3032
|
ConfigTypeId: t,
|
|
3012
3033
|
};
|
|
3013
|
-
return yield this.makePostRequest(e,
|
|
3034
|
+
return yield this.makePostRequest(e, n);
|
|
3014
3035
|
});
|
|
3015
3036
|
}
|
|
3016
3037
|
updateUserConfig(t) {
|
|
3017
3038
|
return e(this, void 0, void 0, function* () {
|
|
3018
3039
|
const e = this.getURL("/userconfigmapping"),
|
|
3019
|
-
|
|
3040
|
+
n = {
|
|
3020
3041
|
SubscriptionCode: this._config.subscriptionCode,
|
|
3021
3042
|
AccessKey: this._config.accessKey,
|
|
3022
3043
|
UserTag: this._config.userTag,
|
|
3023
3044
|
UserConfigMapping: t,
|
|
3024
3045
|
};
|
|
3025
|
-
return yield this.makePatchRequest(e,
|
|
3046
|
+
return yield this.makePatchRequest(e, n);
|
|
3026
3047
|
});
|
|
3027
3048
|
}
|
|
3028
3049
|
getUserPreferences() {
|
|
@@ -3036,7 +3057,7 @@ class V extends l {
|
|
|
3036
3057
|
return yield this.makePostRequest(e, t);
|
|
3037
3058
|
});
|
|
3038
3059
|
}
|
|
3039
|
-
updateUserPreference(t,
|
|
3060
|
+
updateUserPreference(t, n, i, r, o, s) {
|
|
3040
3061
|
return e(this, void 0, void 0, function* () {
|
|
3041
3062
|
const e = this.getURL("/postuserpreferences"),
|
|
3042
3063
|
a = {
|
|
@@ -3045,8 +3066,8 @@ class V extends l {
|
|
|
3045
3066
|
UserTag: this._config.userTag,
|
|
3046
3067
|
UserPreferences: {
|
|
3047
3068
|
AutomaticallyGenerateTranscript: t,
|
|
3048
|
-
PreferredTranscriptionLanguage:
|
|
3049
|
-
HighlightMedicalTerms:
|
|
3069
|
+
PreferredTranscriptionLanguage: n,
|
|
3070
|
+
HighlightMedicalTerms: i,
|
|
3050
3071
|
DisplayPatientContext: r,
|
|
3051
3072
|
NoteOutputStyle: o,
|
|
3052
3073
|
NoteOutputVerbosity: s,
|
|
@@ -3067,20 +3088,20 @@ const H = "Invalid user details, please check again",
|
|
|
3067
3088
|
Z = "Timeout exceeded",
|
|
3068
3089
|
ee = "Rate Limit Exceeded, Please try again in sometime!",
|
|
3069
3090
|
te = "Audio Signal is power very LOW, Mic might be muted",
|
|
3070
|
-
|
|
3071
|
-
|
|
3091
|
+
ne = "Job Id is empty",
|
|
3092
|
+
ie = "Page Size is undefined",
|
|
3072
3093
|
re = "Note Data is empty",
|
|
3073
3094
|
oe = "Job Name is empty",
|
|
3074
3095
|
se = "Patient Context is empty",
|
|
3075
3096
|
ae = "Mic permission denied",
|
|
3076
3097
|
ce = "Microphone is muted",
|
|
3077
|
-
|
|
3078
|
-
|
|
3098
|
+
ue = "Audio track ended. Possibly the mic was unplugged",
|
|
3099
|
+
le = "Internet is not available. Try again later.",
|
|
3079
3100
|
de =
|
|
3080
3101
|
"Feedback is not enabled. Please contact administrator for more details.",
|
|
3081
3102
|
he = "Automatic Transcription is not enabled for the organisation",
|
|
3082
3103
|
fe = "Resume job is not enabled for the organisation";
|
|
3083
|
-
class
|
|
3104
|
+
class pe {
|
|
3084
3105
|
static isBrowserOnline() {
|
|
3085
3106
|
return "undefined" != typeof navigator && !0 === navigator.onLine;
|
|
3086
3107
|
}
|
|
@@ -3103,19 +3124,19 @@ class ge {
|
|
|
3103
3124
|
arguments,
|
|
3104
3125
|
void 0,
|
|
3105
3126
|
function* (e = { url: null, timeoutMs: null }) {
|
|
3106
|
-
var t = e.url ||
|
|
3107
|
-
const
|
|
3108
|
-
if (!
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
r = setTimeout(() =>
|
|
3127
|
+
var t = e.url || pe.DEFAULT_URL;
|
|
3128
|
+
const n = e.timeoutMs || pe.DEFAULT_TIMEOUT;
|
|
3129
|
+
if (!pe.isBrowserOnline()) return !1;
|
|
3130
|
+
pe.isValidHttpUrl(t) || (t = pe.DEFAULT_URL);
|
|
3131
|
+
const i = new AbortController(),
|
|
3132
|
+
r = setTimeout(() => i.abort(), n);
|
|
3112
3133
|
try {
|
|
3113
3134
|
return (
|
|
3114
3135
|
yield fetch(t, {
|
|
3115
3136
|
method: "HEAD",
|
|
3116
3137
|
mode: "no-cors",
|
|
3117
3138
|
cache: "no-cache",
|
|
3118
|
-
signal:
|
|
3139
|
+
signal: i.signal,
|
|
3119
3140
|
}),
|
|
3120
3141
|
!0
|
|
3121
3142
|
);
|
|
@@ -3129,23 +3150,23 @@ class ge {
|
|
|
3129
3150
|
}
|
|
3130
3151
|
static isOnline(t) {
|
|
3131
3152
|
return e(this, void 0, void 0, function* () {
|
|
3132
|
-
return
|
|
3153
|
+
return pe.hasInternetConnection(t);
|
|
3133
3154
|
});
|
|
3134
3155
|
}
|
|
3135
3156
|
}
|
|
3136
|
-
Object.defineProperty(
|
|
3157
|
+
Object.defineProperty(pe, "DEFAULT_URL", {
|
|
3137
3158
|
enumerable: !0,
|
|
3138
3159
|
configurable: !0,
|
|
3139
3160
|
writable: !0,
|
|
3140
3161
|
value: "https://www.google.com/favicon.ico",
|
|
3141
3162
|
}),
|
|
3142
|
-
Object.defineProperty(
|
|
3163
|
+
Object.defineProperty(pe, "DEFAULT_TIMEOUT", {
|
|
3143
3164
|
enumerable: !0,
|
|
3144
3165
|
configurable: !0,
|
|
3145
3166
|
writable: !0,
|
|
3146
3167
|
value: 5e3,
|
|
3147
3168
|
});
|
|
3148
|
-
class
|
|
3169
|
+
class ge {
|
|
3149
3170
|
constructor(e) {
|
|
3150
3171
|
Object.defineProperty(this, "_logTag", {
|
|
3151
3172
|
enumerable: !0,
|
|
@@ -3285,7 +3306,7 @@ class pe {
|
|
|
3285
3306
|
writable: !0,
|
|
3286
3307
|
value: void 0,
|
|
3287
3308
|
}),
|
|
3288
|
-
(this._ambientRestAPI = new
|
|
3309
|
+
(this._ambientRestAPI = new l(this.validateConfig(e))),
|
|
3289
3310
|
(this._ambientPaceAPI = new V(e)),
|
|
3290
3311
|
(this.config = this.createSocketConfig(e)),
|
|
3291
3312
|
(this.enableLog = e.enableLogs),
|
|
@@ -3295,11 +3316,11 @@ class pe {
|
|
|
3295
3316
|
(this.autoGainControl = e.autoGainControl);
|
|
3296
3317
|
}
|
|
3297
3318
|
initRecorder(e) {
|
|
3298
|
-
var t,
|
|
3319
|
+
var t, n, i, r, o;
|
|
3299
3320
|
(this.recorderIns = new F({
|
|
3300
3321
|
serverURL: e,
|
|
3301
3322
|
enableLogs: null !== (t = this.enableLog) && void 0 !== t && t,
|
|
3302
|
-
isDebug: null !== (
|
|
3323
|
+
isDebug: null !== (n = this.enableLog) && void 0 !== n && n,
|
|
3303
3324
|
bufferInterval: 15,
|
|
3304
3325
|
EOS_Message: '{"JobAction": "EOS","Status": 0,"Type": "meta"}',
|
|
3305
3326
|
socketTimeoutInterval: 2e4,
|
|
@@ -3310,7 +3331,7 @@ class pe {
|
|
|
3310
3331
|
autoGainControl: this.autoGainControl,
|
|
3311
3332
|
})),
|
|
3312
3333
|
(this.recorderIns.echoCancellation =
|
|
3313
|
-
null !== (
|
|
3334
|
+
null !== (i = this.echoCancellation) && void 0 !== i && i),
|
|
3314
3335
|
(this.recorderIns.noiseSuppression =
|
|
3315
3336
|
null !== (r = this.noiseSuppression) && void 0 !== r && r),
|
|
3316
3337
|
(this.recorderIns.autoGainControl =
|
|
@@ -3343,12 +3364,12 @@ class pe {
|
|
|
3343
3364
|
}
|
|
3344
3365
|
});
|
|
3345
3366
|
}
|
|
3346
|
-
getAllNotes(t,
|
|
3367
|
+
getAllNotes(t, n, i) {
|
|
3347
3368
|
return e(this, void 0, void 0, function* () {
|
|
3348
3369
|
try {
|
|
3349
3370
|
if (!this._ambientRestAPI)
|
|
3350
3371
|
return void d.error("SDK not initialized", this._logTag);
|
|
3351
|
-
var e = yield this._ambientRestAPI.ListJobs(t,
|
|
3372
|
+
var e = yield this._ambientRestAPI.ListJobs(t, n, null == i || i);
|
|
3352
3373
|
if (e) {
|
|
3353
3374
|
if (200 === e.Status) return e;
|
|
3354
3375
|
this.onErrorCallback(e.ServerMessage);
|
|
@@ -3373,61 +3394,61 @@ class pe {
|
|
|
3373
3394
|
}
|
|
3374
3395
|
});
|
|
3375
3396
|
}
|
|
3376
|
-
sendSummarizedNote(t,
|
|
3397
|
+
sendSummarizedNote(t, n) {
|
|
3377
3398
|
return e(this, void 0, void 0, function* () {
|
|
3378
3399
|
try {
|
|
3379
3400
|
return this._ambientRestAPI
|
|
3380
|
-
? yield this._ambientRestAPI.SendFinalNote(t,
|
|
3401
|
+
? yield this._ambientRestAPI.SendFinalNote(t, n)
|
|
3381
3402
|
: void d.error("SDK not initialized", this._logTag);
|
|
3382
3403
|
} catch (e) {
|
|
3383
3404
|
this.handleException(e);
|
|
3384
3405
|
}
|
|
3385
3406
|
});
|
|
3386
3407
|
}
|
|
3387
|
-
toggleListening(t,
|
|
3408
|
+
toggleListening(t, n, r, o, s, a, c) {
|
|
3388
3409
|
return e(this, void 0, void 0, function* () {
|
|
3389
|
-
var e,
|
|
3410
|
+
var e, u;
|
|
3390
3411
|
if (void 0 !== a && "" !== a.trim()) {
|
|
3391
|
-
var
|
|
3412
|
+
var l = yield this._ambientPaceAPI.getOrgConfigMapping(i.CDIVersion);
|
|
3392
3413
|
if (
|
|
3393
|
-
(null ==
|
|
3394
|
-
|
|
3395
|
-
|
|
3414
|
+
(null == l ? void 0 : l.Items) &&
|
|
3415
|
+
l.Items.length > 0 &&
|
|
3416
|
+
l.Items[0].Settings
|
|
3396
3417
|
)
|
|
3397
|
-
if (!
|
|
3418
|
+
if (!l.Items[0].Settings.find((e) => 300 === e.ID))
|
|
3398
3419
|
return void this.onErrorCallback(fe);
|
|
3399
3420
|
}
|
|
3400
3421
|
var d =
|
|
3401
3422
|
(null === (e = this.config) || void 0 === e
|
|
3402
3423
|
? void 0
|
|
3403
|
-
: e.prepareWSSURL(t,
|
|
3424
|
+
: e.prepareWSSURL(t, n, r, o, a, c)) || "";
|
|
3404
3425
|
this.recorderIns || this.initRecorder(d),
|
|
3405
|
-
null === (
|
|
3406
|
-
void 0 ===
|
|
3407
|
-
|
|
3426
|
+
null === (u = this.recorderIns) ||
|
|
3427
|
+
void 0 === u ||
|
|
3428
|
+
u.toggleStartStopAudioStream(s, d);
|
|
3408
3429
|
});
|
|
3409
3430
|
}
|
|
3410
|
-
togglePauseResumeListening(t,
|
|
3431
|
+
togglePauseResumeListening(t, n, r, o, s, a, c) {
|
|
3411
3432
|
return e(this, void 0, void 0, function* () {
|
|
3412
|
-
var e,
|
|
3433
|
+
var e, u;
|
|
3413
3434
|
if (void 0 !== a && "" !== a.trim()) {
|
|
3414
|
-
var
|
|
3435
|
+
var l = yield this._ambientPaceAPI.getOrgConfigMapping(i.CDIVersion);
|
|
3415
3436
|
if (
|
|
3416
|
-
(null ==
|
|
3417
|
-
|
|
3418
|
-
|
|
3437
|
+
(null == l ? void 0 : l.Items) &&
|
|
3438
|
+
l.Items.length > 0 &&
|
|
3439
|
+
l.Items[0].Settings
|
|
3419
3440
|
)
|
|
3420
|
-
if (!
|
|
3441
|
+
if (!l.Items[0].Settings.find((e) => 300 === e.ID))
|
|
3421
3442
|
return void this.onErrorCallback(fe);
|
|
3422
3443
|
}
|
|
3423
3444
|
var d =
|
|
3424
3445
|
(null === (e = this.config) || void 0 === e
|
|
3425
3446
|
? void 0
|
|
3426
|
-
: e.prepareWSSURL(t,
|
|
3447
|
+
: e.prepareWSSURL(t, n, r, o, a, c)) || "";
|
|
3427
3448
|
this.recorderIns || this.initRecorder(d),
|
|
3428
|
-
null === (
|
|
3429
|
-
void 0 ===
|
|
3430
|
-
|
|
3449
|
+
null === (u = this.recorderIns) ||
|
|
3450
|
+
void 0 === u ||
|
|
3451
|
+
u.togglePauseResumeAudioStream(s, d);
|
|
3431
3452
|
});
|
|
3432
3453
|
}
|
|
3433
3454
|
startListening() {
|
|
@@ -3438,34 +3459,34 @@ class pe {
|
|
|
3438
3459
|
var e;
|
|
3439
3460
|
null === (e = this.recorderIns) || void 0 === e || e.stopAudio(!0, !0);
|
|
3440
3461
|
}
|
|
3441
|
-
deleteNotes(t,
|
|
3462
|
+
deleteNotes(t, n) {
|
|
3442
3463
|
return e(this, void 0, void 0, function* () {
|
|
3443
3464
|
var e;
|
|
3444
3465
|
try {
|
|
3445
3466
|
if (!this._ambientRestAPI)
|
|
3446
3467
|
return void d.error("SDK not initialized", this._logTag);
|
|
3447
|
-
var
|
|
3448
|
-
if (
|
|
3449
|
-
if (200 ===
|
|
3468
|
+
var i = yield this._ambientRestAPI.DeleteNotes(t, n);
|
|
3469
|
+
if (i) {
|
|
3470
|
+
if (200 === i.Status)
|
|
3450
3471
|
return (
|
|
3451
3472
|
null === (e = this.recorderIns) ||
|
|
3452
3473
|
void 0 === e ||
|
|
3453
3474
|
e.stopAudio(!1, !0),
|
|
3454
|
-
|
|
3475
|
+
i
|
|
3455
3476
|
);
|
|
3456
|
-
this.onErrorCallback(
|
|
3477
|
+
this.onErrorCallback(i.ServerMessage);
|
|
3457
3478
|
} else this.onErrorCallback("Unknown Error!");
|
|
3458
3479
|
} catch (e) {
|
|
3459
3480
|
this.handleException(e);
|
|
3460
3481
|
}
|
|
3461
3482
|
});
|
|
3462
3483
|
}
|
|
3463
|
-
renameNoteTitle(t,
|
|
3484
|
+
renameNoteTitle(t, n) {
|
|
3464
3485
|
return e(this, void 0, void 0, function* () {
|
|
3465
3486
|
try {
|
|
3466
3487
|
if (!this._ambientRestAPI)
|
|
3467
3488
|
return void d.error("SDK not initialized", this._logTag);
|
|
3468
|
-
var e = yield this._ambientRestAPI.RenameNoteTitle(t,
|
|
3489
|
+
var e = yield this._ambientRestAPI.RenameNoteTitle(t, n);
|
|
3469
3490
|
if (e) {
|
|
3470
3491
|
if (200 === e.Status) return e;
|
|
3471
3492
|
this.onErrorCallback(e.ServerMessage);
|
|
@@ -3475,12 +3496,12 @@ class pe {
|
|
|
3475
3496
|
}
|
|
3476
3497
|
});
|
|
3477
3498
|
}
|
|
3478
|
-
getNotePDF(t,
|
|
3499
|
+
getNotePDF(t, n, i, r, o, s) {
|
|
3479
3500
|
return e(this, void 0, void 0, function* () {
|
|
3480
3501
|
try {
|
|
3481
3502
|
if (!this._ambientRestAPI)
|
|
3482
3503
|
return void d.error("SDK not initialized", this._logTag);
|
|
3483
|
-
var e = yield this._ambientRestAPI.DownloadNotePDF(t,
|
|
3504
|
+
var e = yield this._ambientRestAPI.DownloadNotePDF(t, n, i, r, o, s);
|
|
3484
3505
|
if (e) {
|
|
3485
3506
|
if (200 === e.Status) return e;
|
|
3486
3507
|
this.onErrorCallback(e.ServerMessage);
|
|
@@ -3505,13 +3526,13 @@ class pe {
|
|
|
3505
3526
|
}
|
|
3506
3527
|
});
|
|
3507
3528
|
}
|
|
3508
|
-
generateCDISuggestions(t,
|
|
3529
|
+
generateCDISuggestions(t, n, r, o, s) {
|
|
3509
3530
|
return e(this, void 0, void 0, function* () {
|
|
3510
3531
|
try {
|
|
3511
3532
|
if (!this._ambientRestAPI)
|
|
3512
3533
|
return void d.error("SDK not initialized", this._logTag);
|
|
3513
3534
|
var e = 1,
|
|
3514
|
-
a = yield this._ambientPaceAPI.getOrgConfigMapping(
|
|
3535
|
+
a = yield this._ambientPaceAPI.getOrgConfigMapping(i.CDIVersion);
|
|
3515
3536
|
if (
|
|
3516
3537
|
(null == a ? void 0 : a.Items) &&
|
|
3517
3538
|
a.Items.length > 0 &&
|
|
@@ -3520,29 +3541,29 @@ class pe {
|
|
|
3520
3541
|
var c = a.Items[0].Settings.find((e) => 209 === e.ID);
|
|
3521
3542
|
c && (e = Number.parseInt(c.ConfigValue));
|
|
3522
3543
|
}
|
|
3523
|
-
var
|
|
3544
|
+
var u = yield this._ambientRestAPI.GenerateSuggestions(
|
|
3524
3545
|
t,
|
|
3525
|
-
|
|
3546
|
+
n,
|
|
3526
3547
|
r,
|
|
3527
3548
|
s,
|
|
3528
3549
|
o,
|
|
3529
3550
|
e,
|
|
3530
3551
|
);
|
|
3531
|
-
if (
|
|
3532
|
-
if (200 ===
|
|
3533
|
-
this.onErrorCallback(
|
|
3552
|
+
if (u) {
|
|
3553
|
+
if (200 === u.Status) return u;
|
|
3554
|
+
this.onErrorCallback(u.ServerMessage);
|
|
3534
3555
|
} else this.onErrorCallback("Unknown Error!");
|
|
3535
3556
|
} catch (e) {
|
|
3536
3557
|
this.handleException(e);
|
|
3537
3558
|
}
|
|
3538
3559
|
});
|
|
3539
3560
|
}
|
|
3540
|
-
updatePatientContext(t,
|
|
3561
|
+
updatePatientContext(t, n, i) {
|
|
3541
3562
|
return e(this, void 0, void 0, function* () {
|
|
3542
3563
|
try {
|
|
3543
3564
|
if (!this._ambientRestAPI)
|
|
3544
3565
|
return void d.error("SDK not initialized", this._logTag);
|
|
3545
|
-
var e = yield this._ambientRestAPI.UpdatePatientContext(t,
|
|
3566
|
+
var e = yield this._ambientRestAPI.UpdatePatientContext(t, n, i);
|
|
3546
3567
|
if (e) {
|
|
3547
3568
|
if (200 === e.Status) return e;
|
|
3548
3569
|
this.onErrorCallback(e.ServerMessage);
|
|
@@ -3552,12 +3573,12 @@ class pe {
|
|
|
3552
3573
|
}
|
|
3553
3574
|
});
|
|
3554
3575
|
}
|
|
3555
|
-
modifyGeneratedNote(t,
|
|
3576
|
+
modifyGeneratedNote(t, n, i) {
|
|
3556
3577
|
return e(this, void 0, void 0, function* () {
|
|
3557
3578
|
try {
|
|
3558
3579
|
if (!this._ambientRestAPI)
|
|
3559
3580
|
return void d.error("SDK not initialized", this._logTag);
|
|
3560
|
-
var e = yield this._ambientRestAPI.ModifyGeneratedNote(t,
|
|
3581
|
+
var e = yield this._ambientRestAPI.ModifyGeneratedNote(t, n, i);
|
|
3561
3582
|
if (e) {
|
|
3562
3583
|
if (200 === e.Status) return e;
|
|
3563
3584
|
this.onErrorCallback(e.ServerMessage);
|
|
@@ -3587,7 +3608,7 @@ class pe {
|
|
|
3587
3608
|
}
|
|
3588
3609
|
});
|
|
3589
3610
|
}
|
|
3590
|
-
sendFeedback(t,
|
|
3611
|
+
sendFeedback(t, n, i, r) {
|
|
3591
3612
|
return e(this, void 0, void 0, function* () {
|
|
3592
3613
|
var e, o;
|
|
3593
3614
|
try {
|
|
@@ -3604,8 +3625,8 @@ class pe {
|
|
|
3604
3625
|
) {
|
|
3605
3626
|
var a = yield this._ambientRestAPI.SendFeedback(
|
|
3606
3627
|
t,
|
|
3607
|
-
|
|
3608
|
-
null !=
|
|
3628
|
+
n,
|
|
3629
|
+
null != i ? i : "",
|
|
3609
3630
|
null != r ? r : "SOAPFeedBack",
|
|
3610
3631
|
);
|
|
3611
3632
|
if (a) {
|
|
@@ -3665,23 +3686,23 @@ class pe {
|
|
|
3665
3686
|
}
|
|
3666
3687
|
updateUserPreferenceSettings(t) {
|
|
3667
3688
|
return e(this, void 0, void 0, function* () {
|
|
3668
|
-
var e,
|
|
3689
|
+
var e, n, i, r, o, c;
|
|
3669
3690
|
try {
|
|
3670
3691
|
if (!this._ambientPaceAPI)
|
|
3671
3692
|
return void d.error("SDK not initialized", this._logTag);
|
|
3672
|
-
var
|
|
3693
|
+
var u = yield this._ambientPaceAPI.updateUserPreference(
|
|
3673
3694
|
null !== (e = t.AutomaticallyGenerateTranscript) && void 0 !== e && e,
|
|
3674
|
-
null !== (
|
|
3675
|
-
?
|
|
3695
|
+
null !== (n = t.PreferredTranscriptionLanguage) && void 0 !== n
|
|
3696
|
+
? n
|
|
3676
3697
|
: "English",
|
|
3677
|
-
null !== (
|
|
3698
|
+
null !== (i = t.HighlightMedicalTerms) && void 0 !== i && i,
|
|
3678
3699
|
null !== (r = t.DisplayPatientContext) && void 0 !== r && r,
|
|
3679
3700
|
null !== (o = t.NoteOutputStyle) && void 0 !== o ? o : a.DashFormat,
|
|
3680
3701
|
null !== (c = t.NoteOutputVerbosity) && void 0 !== c ? c : s.Detailed,
|
|
3681
3702
|
);
|
|
3682
|
-
if (
|
|
3683
|
-
if (200 ===
|
|
3684
|
-
this.onErrorCallback(
|
|
3703
|
+
if (u) {
|
|
3704
|
+
if (200 === u.Status) return u;
|
|
3705
|
+
this.onErrorCallback(u.ServerMessage);
|
|
3685
3706
|
} else this.onErrorCallback("Unknown Error!");
|
|
3686
3707
|
} catch (e) {
|
|
3687
3708
|
this.handleException(e);
|
|
@@ -3690,8 +3711,8 @@ class pe {
|
|
|
3690
3711
|
}
|
|
3691
3712
|
isInternetAvailable(t) {
|
|
3692
3713
|
return e(this, void 0, void 0, function* () {
|
|
3693
|
-
const e = yield
|
|
3694
|
-
return e || this.onErrorCallback(
|
|
3714
|
+
const e = yield pe.isOnline(t);
|
|
3715
|
+
return e || this.onErrorCallback(le), e;
|
|
3695
3716
|
});
|
|
3696
3717
|
}
|
|
3697
3718
|
onEventCallback(e) {
|
|
@@ -3714,18 +3735,18 @@ class pe {
|
|
|
3714
3735
|
}
|
|
3715
3736
|
}
|
|
3716
3737
|
onErrorCallback(e, t) {
|
|
3717
|
-
var
|
|
3718
|
-
|
|
3738
|
+
var n,
|
|
3739
|
+
i,
|
|
3719
3740
|
r,
|
|
3720
3741
|
s,
|
|
3721
3742
|
a,
|
|
3722
3743
|
c,
|
|
3723
|
-
l,
|
|
3724
3744
|
u,
|
|
3745
|
+
l,
|
|
3725
3746
|
h,
|
|
3726
3747
|
f,
|
|
3727
|
-
g,
|
|
3728
3748
|
p,
|
|
3749
|
+
g,
|
|
3729
3750
|
v,
|
|
3730
3751
|
b,
|
|
3731
3752
|
m,
|
|
@@ -3740,9 +3761,9 @@ class pe {
|
|
|
3740
3761
|
(S.ErrorCode = o.WSJOB05))
|
|
3741
3762
|
: C.Data === H
|
|
3742
3763
|
? (this._isRecording
|
|
3743
|
-
? null === (
|
|
3744
|
-
void 0 ===
|
|
3745
|
-
|
|
3764
|
+
? null === (n = this.recorderIns) ||
|
|
3765
|
+
void 0 === n ||
|
|
3766
|
+
n.stopAudio(!1, !0)
|
|
3746
3767
|
: (this.forceStopAudio = !0),
|
|
3747
3768
|
(S.ErrorCode = o.WSAUTH03))
|
|
3748
3769
|
: C.Data.includes(Y)
|
|
@@ -3755,12 +3776,12 @@ class pe {
|
|
|
3755
3776
|
? (S.ErrorCode = o.WSACC01)
|
|
3756
3777
|
: C.Data.includes(te) && (S.ErrorCode = o.WSAUD01);
|
|
3757
3778
|
} catch (e) {}
|
|
3758
|
-
(null === (
|
|
3779
|
+
(null === (i = S.ErrorMessage) || void 0 === i ? void 0 : i.includes(ne))
|
|
3759
3780
|
? (S.ErrorCode = o.SDK01)
|
|
3760
3781
|
: (
|
|
3761
3782
|
null === (r = S.ErrorMessage) || void 0 === r
|
|
3762
3783
|
? void 0
|
|
3763
|
-
: r.includes(
|
|
3784
|
+
: r.includes(ie)
|
|
3764
3785
|
)
|
|
3765
3786
|
? (S.ErrorCode = o.SDK02)
|
|
3766
3787
|
: (
|
|
@@ -3782,34 +3803,34 @@ class pe {
|
|
|
3782
3803
|
)
|
|
3783
3804
|
? (S.ErrorCode = o.SDK05)
|
|
3784
3805
|
: (
|
|
3785
|
-
null === (
|
|
3806
|
+
null === (u = S.ErrorMessage) || void 0 === u
|
|
3786
3807
|
? void 0
|
|
3787
|
-
:
|
|
3808
|
+
: u.includes(ae)
|
|
3788
3809
|
)
|
|
3789
3810
|
? (S.ErrorCode = o.SDK06)
|
|
3790
3811
|
: (
|
|
3791
|
-
null === (
|
|
3812
|
+
null === (l = S.ErrorMessage) || void 0 === l
|
|
3792
3813
|
? void 0
|
|
3793
|
-
:
|
|
3814
|
+
: l.includes(ce)
|
|
3794
3815
|
)
|
|
3795
3816
|
? (S.ErrorCode = o.SDK07)
|
|
3796
3817
|
: (
|
|
3797
3818
|
null === (h = S.ErrorMessage) || void 0 === h
|
|
3798
3819
|
? void 0
|
|
3799
|
-
: h.includes(
|
|
3820
|
+
: h.includes(ue)
|
|
3800
3821
|
)
|
|
3801
3822
|
? (S.ErrorCode = o.SDK08)
|
|
3802
3823
|
: (null === (f = S.ErrorMessage) || void 0 === f
|
|
3803
3824
|
? void 0
|
|
3804
3825
|
: f.includes(q)) ||
|
|
3805
|
-
(null === (
|
|
3826
|
+
(null === (p = S.ErrorMessage) || void 0 === p ? void 0 : p.includes(z))
|
|
3806
3827
|
? (S.ErrorCode = o.AUTH01)
|
|
3807
|
-
: (null === (
|
|
3828
|
+
: (null === (g = S.ErrorMessage) || void 0 === g ? void 0 : g.includes($))
|
|
3808
3829
|
? (S.ErrorCode = o.AUTH02)
|
|
3809
3830
|
: (
|
|
3810
3831
|
null === (v = S.ErrorMessage) || void 0 === v
|
|
3811
3832
|
? void 0
|
|
3812
|
-
: v.includes(
|
|
3833
|
+
: v.includes(le)
|
|
3813
3834
|
)
|
|
3814
3835
|
? (S.ErrorCode = o.SDK12)
|
|
3815
3836
|
: (
|
|
@@ -3857,66 +3878,66 @@ class pe {
|
|
|
3857
3878
|
onSessionEventCallback(e) {
|
|
3858
3879
|
var t;
|
|
3859
3880
|
if (!e) return;
|
|
3860
|
-
let
|
|
3881
|
+
let n;
|
|
3861
3882
|
try {
|
|
3862
|
-
|
|
3883
|
+
n = "string" == typeof e ? JSON.parse(e) : e;
|
|
3863
3884
|
} catch (e) {
|
|
3864
3885
|
return void d.error(
|
|
3865
3886
|
`Error parsing session event data: ${e}`,
|
|
3866
3887
|
this._logTag,
|
|
3867
3888
|
);
|
|
3868
3889
|
}
|
|
3869
|
-
if (!
|
|
3890
|
+
if (!n || !("Type" in n)) return;
|
|
3870
3891
|
if (
|
|
3871
|
-
"meta" ===
|
|
3892
|
+
"meta" === n.Type.toLowerCase() &&
|
|
3872
3893
|
(null === (t = this.config) || void 0 === t ? void 0 : t.onMetaEvent)
|
|
3873
3894
|
) {
|
|
3874
|
-
if (!
|
|
3895
|
+
if (!n.JobID)
|
|
3875
3896
|
return void d.error("JobID is missing in meta event", this._logTag);
|
|
3876
|
-
this.config.onMetaEvent(
|
|
3897
|
+
this.config.onMetaEvent(n.JobID);
|
|
3877
3898
|
} else
|
|
3878
|
-
"error" ===
|
|
3879
|
-
|
|
3880
|
-
this.onErrorCallback(
|
|
3881
|
-
if ("object" != typeof
|
|
3882
|
-
const { Type:
|
|
3883
|
-
|
|
3884
|
-
("SESSION_CREATED" ===
|
|
3899
|
+
"error" === n.Type.toLowerCase() &&
|
|
3900
|
+
n.Data &&
|
|
3901
|
+
this.onErrorCallback(n.Data);
|
|
3902
|
+
if ("object" != typeof n.Event || null === n.Event) return;
|
|
3903
|
+
const { Type: i, Value: r } = n.Event;
|
|
3904
|
+
i &&
|
|
3905
|
+
("SESSION_CREATED" === i && r
|
|
3885
3906
|
? d.log(`session Token ${r}`, this._logTag)
|
|
3886
|
-
: "SERVICE_DOWN" ===
|
|
3887
|
-
? d.error(
|
|
3888
|
-
: "NO_DICTATION_STOP_MIC" ===
|
|
3907
|
+
: "SERVICE_DOWN" === i
|
|
3908
|
+
? d.error(i, this._logTag)
|
|
3909
|
+
: "NO_DICTATION_STOP_MIC" === i
|
|
3889
3910
|
? (d.log("NO_DICTATION_STOP_MIC", this._logTag),
|
|
3890
3911
|
this.onIdleMicCallback())
|
|
3891
|
-
: "INVALID_AUTH_CREDENTIALS" ===
|
|
3912
|
+
: "INVALID_AUTH_CREDENTIALS" === i
|
|
3892
3913
|
? d.error("INVALID_AUTH_CREDENTIALS", this._logTag)
|
|
3893
|
-
: "LOW_BANDWIDTH" ===
|
|
3914
|
+
: "LOW_BANDWIDTH" === i &&
|
|
3894
3915
|
d.log("LOW_BANDWIDTH: Check internet connection", this._logTag));
|
|
3895
3916
|
}
|
|
3896
3917
|
validateConfig(e) {
|
|
3897
3918
|
return (
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3919
|
+
n.Against.NullOrEmpty(e.server, "Server"),
|
|
3920
|
+
n.Against.NullOrEmpty(e.subscriptionCode, "SubscriptionCode"),
|
|
3921
|
+
n.Against.NullOrEmpty(e.accessKey, "AccessKey"),
|
|
3922
|
+
n.Against.NullOrEmpty(e.userTag, "UserTag"),
|
|
3902
3923
|
e
|
|
3903
3924
|
);
|
|
3904
3925
|
}
|
|
3905
3926
|
createSocketConfig(e) {
|
|
3906
|
-
const
|
|
3927
|
+
const n = new t(e);
|
|
3907
3928
|
return (
|
|
3908
|
-
(
|
|
3909
|
-
(
|
|
3910
|
-
|
|
3929
|
+
(n.onError = this.onErrorCallback.bind(this)),
|
|
3930
|
+
(n.onMetaEvent = this.onEventCallback.bind(this)),
|
|
3931
|
+
n
|
|
3911
3932
|
);
|
|
3912
3933
|
}
|
|
3913
3934
|
}
|
|
3914
3935
|
export {
|
|
3915
|
-
|
|
3936
|
+
ge as AugnitoAmbient,
|
|
3916
3937
|
o as ErrorCodes,
|
|
3917
3938
|
c as HttpCodedError,
|
|
3918
3939
|
a as NoteOutputStyleConfig,
|
|
3919
3940
|
r as NoteTypeConfig,
|
|
3920
3941
|
s as NoteVerbosityConfig,
|
|
3921
|
-
|
|
3942
|
+
i as SettingsConfigType,
|
|
3922
3943
|
};
|