@vonage/client-sdk 0.1.4-alpha.3 → 0.1.4-alpha.5

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.
Files changed (35) hide show
  1. package/dist/Client.d.ts +24 -25
  2. package/dist/HttpClient.d.ts +8 -8
  3. package/dist/MediaClient.d.ts +19 -19
  4. package/dist/SocketClient.d.ts +12 -12
  5. package/dist/coreExtend.d.ts +13 -13
  6. package/dist/global.d.ts +7 -7
  7. package/dist/index.cjs.js +45493 -0
  8. package/dist/index.d.ts +4 -3
  9. package/dist/index.js +45468 -11
  10. package/dist/utils/createRtcAudioConnection.d.ts +5 -5
  11. package/dist/vonageClientSDK.esm.js +56181 -0
  12. package/dist/vonageClientSDK.esm.min.js +2 -0
  13. package/dist/vonageClientSDK.js +56193 -0
  14. package/dist/vonageClientSDK.min.js +2 -0
  15. package/package.json +19 -7
  16. package/rollup.config.js +94 -0
  17. package/dist/Client.js +0 -40
  18. package/dist/HttpClient.js +0 -59
  19. package/dist/MediaClient.js +0 -130
  20. package/dist/SocketClient.js +0 -79
  21. package/dist/coreExtend.js +0 -3
  22. package/dist/global.js +0 -2
  23. package/dist/kotlin/Kermit-kermit-js-ir.js +0 -300
  24. package/dist/kotlin/Kermit-kermit-js-ir.js.map +0 -1
  25. package/dist/kotlin/clientsdk-clientcore.js +0 -22413
  26. package/dist/kotlin/clientsdk-clientcore.js.map +0 -1
  27. package/dist/kotlin/clientsdk-clientcore_js.js +0 -1403
  28. package/dist/kotlin/clientsdk-clientcore_js.js.map +0 -1
  29. package/dist/kotlin/kotlin-kotlin-stdlib-js-ir.js +0 -11107
  30. package/dist/kotlin/kotlin-kotlin-stdlib-js-ir.js.map +0 -1
  31. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +0 -5857
  32. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +0 -1
  33. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +0 -5341
  34. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +0 -1
  35. package/dist/utils/createRtcAudioConnection.js +0 -85
@@ -1,1403 +0,0 @@
1
- (function (root, factory) {
2
- if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './clientsdk-clientcore.js'], factory);
4
- else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./clientsdk-clientcore.js'));
6
- else {
7
- if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
8
- throw new Error("Error loading module 'clientsdk-clientcore_js'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'clientsdk-clientcore_js'.");
9
- }
10
- if (typeof this['clientsdk-clientcore'] === 'undefined') {
11
- throw new Error("Error loading module 'clientsdk-clientcore_js'. Its dependency 'clientsdk-clientcore' was not found. Please, check whether 'clientsdk-clientcore' is loaded prior to 'clientsdk-clientcore_js'.");
12
- }
13
- root['clientsdk-clientcore_js'] = factory(typeof this['clientsdk-clientcore_js'] === 'undefined' ? {} : this['clientsdk-clientcore_js'], this['kotlin-kotlin-stdlib-js-ir'], this['clientsdk-clientcore']);
14
- }
15
- }(this, function (_, kotlin_kotlin, kotlin_com_vonage_clientcore) {
16
- 'use strict';
17
- //region block: imports
18
- var imul = Math.imul;
19
- var THROW_ISE = kotlin_kotlin.$_$.z7;
20
- var Unit_getInstance = kotlin_kotlin.$_$.p2;
21
- var ClientConfigRegion_AP_getInstance = kotlin_com_vonage_clientcore.$_$.r;
22
- var ClientConfigRegion_EU_getInstance = kotlin_com_vonage_clientcore.$_$.s;
23
- var ClientConfigRegion_US_getInstance = kotlin_com_vonage_clientcore.$_$.t;
24
- var Enum = kotlin_kotlin.$_$.s7;
25
- var classMeta = kotlin_kotlin.$_$.j5;
26
- var Companion_getInstance = kotlin_com_vonage_clientcore.$_$.u;
27
- var ILoggingLevel = kotlin_com_vonage_clientcore.$_$.b;
28
- var setDefaultLoggingLevel = kotlin_com_vonage_clientcore.$_$.e;
29
- var newThrowable = kotlin_kotlin.$_$.g6;
30
- var SessionListener = kotlin_com_vonage_clientcore.$_$.c;
31
- var VoiceClientDelegate = kotlin_com_vonage_clientcore.$_$.d;
32
- var Builder = kotlin_com_vonage_clientcore.$_$.j;
33
- var SetConfig = kotlin_com_vonage_clientcore.$_$.i;
34
- var emptyMap = kotlin_kotlin.$_$.v3;
35
- var THROW_CCE = kotlin_kotlin.$_$.y7;
36
- var getStringHashCode = kotlin_kotlin.$_$.o5;
37
- var equals = kotlin_kotlin.$_$.k5;
38
- var Exception_init_$Create$ = kotlin_kotlin.$_$.z;
39
- var HTTPClient = kotlin_com_vonage_clientcore.$_$.f;
40
- var SocketClient = kotlin_com_vonage_clientcore.$_$.h;
41
- var UnknownSocketEvent = kotlin_com_vonage_clientcore.$_$.a;
42
- var SocketConnectionStatus_Connected_getInstance = kotlin_com_vonage_clientcore.$_$.o;
43
- var SocketConnectionStatus_Reconnecting_getInstance = kotlin_com_vonage_clientcore.$_$.q;
44
- var SocketConnectionStatus_Disconnected_getInstance = kotlin_com_vonage_clientcore.$_$.p;
45
- var SocketConnectionFailedReason_ServerDisconnected_getInstance = kotlin_com_vonage_clientcore.$_$.n;
46
- var SocketConnectionFailedReason_ClientDisconnected_getInstance = kotlin_com_vonage_clientcore.$_$.k;
47
- var SocketConnectionFailedReason_ClientNetworkError_getInstance = kotlin_com_vonage_clientcore.$_$.l;
48
- var SocketConnectionFailedReason_PingTimeout_getInstance = kotlin_com_vonage_clientcore.$_$.m;
49
- var MediaClient = kotlin_com_vonage_clientcore.$_$.g;
50
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j;
51
- var to = kotlin_kotlin.$_$.s8;
52
- var toMap = kotlin_kotlin.$_$.u4;
53
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.t;
54
- var Map = kotlin_kotlin.$_$.b3;
55
- var isInterface = kotlin_kotlin.$_$.y5;
56
- var Exception = kotlin_kotlin.$_$.u7;
57
- var Pair = kotlin_kotlin.$_$.x7;
58
- var copyToArray = kotlin_kotlin.$_$.t3;
59
- var json = kotlin_kotlin.$_$.e6;
60
- //endregion
61
- //region block: pre-declaration
62
- CoreClientConfigRegionJS.prototype = Object.create(Enum.prototype);
63
- CoreClientConfigRegionJS.prototype.constructor = CoreClientConfigRegionJS;
64
- LoggingLevelJS.prototype = Object.create(Enum.prototype);
65
- LoggingLevelJS.prototype.constructor = LoggingLevelJS;
66
- //endregion
67
- var CoreClientConfigRegionJS_AP_instance;
68
- var CoreClientConfigRegionJS_EU_instance;
69
- var CoreClientConfigRegionJS_US_instance;
70
- function values() {
71
- return [CoreClientConfigRegionJS_AP_getInstance(), CoreClientConfigRegionJS_EU_getInstance(), CoreClientConfigRegionJS_US_getInstance()];
72
- }
73
- function valueOf(value) {
74
- switch (value) {
75
- case 'AP':
76
- return CoreClientConfigRegionJS_AP_getInstance();
77
- case 'EU':
78
- return CoreClientConfigRegionJS_EU_getInstance();
79
- case 'US':
80
- return CoreClientConfigRegionJS_US_getInstance();
81
- default:
82
- CoreClientConfigRegionJS_initEntries();
83
- THROW_ISE();
84
- break;
85
- }
86
- }
87
- var CoreClientConfigRegionJS_entriesInitialized;
88
- function CoreClientConfigRegionJS_initEntries() {
89
- if (CoreClientConfigRegionJS_entriesInitialized)
90
- return Unit_getInstance();
91
- CoreClientConfigRegionJS_entriesInitialized = true;
92
- CoreClientConfigRegionJS_AP_instance = new CoreClientConfigRegionJS('AP', 0, ClientConfigRegion_AP_getInstance());
93
- CoreClientConfigRegionJS_EU_instance = new CoreClientConfigRegionJS('EU', 1, ClientConfigRegion_EU_getInstance());
94
- CoreClientConfigRegionJS_US_instance = new CoreClientConfigRegionJS('US', 2, ClientConfigRegion_US_getInstance());
95
- }
96
- function CoreClientConfigRegionJS(name, ordinal, coreRegion) {
97
- Enum.call(this, name, ordinal);
98
- this.j2e_1 = coreRegion;
99
- }
100
- CoreClientConfigRegionJS.prototype.k2e = function () {
101
- return this.j2e_1;
102
- };
103
- CoreClientConfigRegionJS.$metadata$ = classMeta('CoreClientConfigRegionJS', undefined, undefined, undefined, undefined, Enum.prototype);
104
- Object.defineProperty(CoreClientConfigRegionJS.prototype, 'coreRegion', {
105
- configurable: true,
106
- get: CoreClientConfigRegionJS.prototype.k2e
107
- });
108
- Object.defineProperty(CoreClientConfigRegionJS.prototype, 'name', {
109
- configurable: true,
110
- get: CoreClientConfigRegionJS.prototype.r3
111
- });
112
- Object.defineProperty(CoreClientConfigRegionJS.prototype, 'ordinal', {
113
- configurable: true,
114
- get: CoreClientConfigRegionJS.prototype.qe
115
- });
116
- function CoreClientConfigJS(region) {
117
- this.l2e_1 = Companion_getInstance().h1z(region.j2e_1);
118
- this.m2e_1 = this.l2e_1.i1z_1;
119
- this.n2e_1 = this.l2e_1.j1z_1;
120
- this.o2e_1 = this.l2e_1.k1z_1;
121
- this.p2e_1 = this.l2e_1.l1z_1;
122
- }
123
- CoreClientConfigJS.prototype.q2e = function (_set____db54di) {
124
- this.m2e_1 = _set____db54di;
125
- };
126
- CoreClientConfigJS.prototype.r2e = function () {
127
- return this.m2e_1;
128
- };
129
- CoreClientConfigJS.prototype.s2e = function (_set____db54di) {
130
- this.n2e_1 = _set____db54di;
131
- };
132
- CoreClientConfigJS.prototype.t2e = function () {
133
- return this.n2e_1;
134
- };
135
- CoreClientConfigJS.prototype.u2e = function (_set____db54di) {
136
- this.o2e_1 = _set____db54di;
137
- };
138
- CoreClientConfigJS.prototype.v2e = function () {
139
- return this.o2e_1;
140
- };
141
- CoreClientConfigJS.prototype.w2e = function (_set____db54di) {
142
- this.p2e_1 = _set____db54di;
143
- };
144
- CoreClientConfigJS.prototype.x2e = function () {
145
- return this.p2e_1;
146
- };
147
- CoreClientConfigJS.$metadata$ = classMeta('CoreClientConfigJS');
148
- Object.defineProperty(CoreClientConfigJS.prototype, 'apiUrl', {
149
- configurable: true,
150
- get: CoreClientConfigJS.prototype.r2e,
151
- set: CoreClientConfigJS.prototype.q2e
152
- });
153
- Object.defineProperty(CoreClientConfigJS.prototype, 'websocketUrl', {
154
- configurable: true,
155
- get: CoreClientConfigJS.prototype.t2e,
156
- set: CoreClientConfigJS.prototype.s2e
157
- });
158
- Object.defineProperty(CoreClientConfigJS.prototype, 'websocketPath', {
159
- configurable: true,
160
- get: CoreClientConfigJS.prototype.v2e,
161
- set: CoreClientConfigJS.prototype.u2e
162
- });
163
- Object.defineProperty(CoreClientConfigJS.prototype, 'autoMediaReoffer', {
164
- configurable: true,
165
- get: CoreClientConfigJS.prototype.x2e,
166
- set: CoreClientConfigJS.prototype.w2e
167
- });
168
- var LoggingLevelJS_Verbose_instance;
169
- var LoggingLevelJS_Debug_instance;
170
- var LoggingLevelJS_Info_instance;
171
- var LoggingLevelJS_Warn_instance;
172
- var LoggingLevelJS_Error_instance;
173
- var LoggingLevelJS_Assert_instance;
174
- function values_0() {
175
- return [LoggingLevelJS_Verbose_getInstance(), LoggingLevelJS_Debug_getInstance(), LoggingLevelJS_Info_getInstance(), LoggingLevelJS_Warn_getInstance(), LoggingLevelJS_Error_getInstance(), LoggingLevelJS_Assert_getInstance()];
176
- }
177
- function valueOf_0(value) {
178
- switch (value) {
179
- case 'Verbose':
180
- return LoggingLevelJS_Verbose_getInstance();
181
- case 'Debug':
182
- return LoggingLevelJS_Debug_getInstance();
183
- case 'Info':
184
- return LoggingLevelJS_Info_getInstance();
185
- case 'Warn':
186
- return LoggingLevelJS_Warn_getInstance();
187
- case 'Error':
188
- return LoggingLevelJS_Error_getInstance();
189
- case 'Assert':
190
- return LoggingLevelJS_Assert_getInstance();
191
- default:
192
- LoggingLevelJS_initEntries();
193
- THROW_ISE();
194
- break;
195
- }
196
- }
197
- var LoggingLevelJS_entriesInitialized;
198
- function LoggingLevelJS_initEntries() {
199
- if (LoggingLevelJS_entriesInitialized)
200
- return Unit_getInstance();
201
- LoggingLevelJS_entriesInitialized = true;
202
- LoggingLevelJS_Verbose_instance = new LoggingLevelJS('Verbose', 0, 'Verbose');
203
- LoggingLevelJS_Debug_instance = new LoggingLevelJS('Debug', 1, 'Debug');
204
- LoggingLevelJS_Info_instance = new LoggingLevelJS('Info', 2, 'Info');
205
- LoggingLevelJS_Warn_instance = new LoggingLevelJS('Warn', 3, 'Warn');
206
- LoggingLevelJS_Error_instance = new LoggingLevelJS('Error', 4, 'Error');
207
- LoggingLevelJS_Assert_instance = new LoggingLevelJS('Assert', 5, 'Assert');
208
- }
209
- function LoggingLevelJS(name, ordinal, sev) {
210
- Enum.call(this, name, ordinal);
211
- this.a2f_1 = sev;
212
- }
213
- LoggingLevelJS.prototype.a1c = function () {
214
- return this.a2f_1;
215
- };
216
- LoggingLevelJS.$metadata$ = classMeta('LoggingLevelJS', [ILoggingLevel], undefined, undefined, undefined, Enum.prototype);
217
- Object.defineProperty(LoggingLevelJS.prototype, 'name', {
218
- configurable: true,
219
- get: LoggingLevelJS.prototype.r3
220
- });
221
- Object.defineProperty(LoggingLevelJS.prototype, 'ordinal', {
222
- configurable: true,
223
- get: LoggingLevelJS.prototype.qe
224
- });
225
- function setDefaultLoggingLevel_0(level) {
226
- setDefaultLoggingLevel(level);
227
- }
228
- function CoreClientJS$createSession$lambda$lambda($reject, $resolve) {
229
- return function (err, sessionId) {
230
- if (!(err == null))
231
- $reject(err);
232
- else if (!(sessionId == null))
233
- $resolve(sessionId);
234
- else
235
- $reject(newThrowable('', void 1));
236
- return Unit_getInstance();
237
- };
238
- }
239
- function CoreClientJS$createSession$lambda(this$0, $token, $sessionId) {
240
- return function (resolve, reject) {
241
- this$0.d2f_1.w1a($token, $sessionId, CoreClientJS$createSession$lambda$lambda(reject, resolve));
242
- return Unit_getInstance();
243
- };
244
- }
245
- function CoreClientJS$deleteSession$lambda$lambda($reject, $resolve) {
246
- return function (err) {
247
- if (!(err == null))
248
- $reject(err);
249
- else
250
- $resolve(null);
251
- return Unit_getInstance();
252
- };
253
- }
254
- function CoreClientJS$deleteSession$lambda(this$0) {
255
- return function (resolve, reject) {
256
- this$0.d2f_1.x1a(CoreClientJS$deleteSession$lambda$lambda(reject, resolve));
257
- return Unit_getInstance();
258
- };
259
- }
260
- function CoreClientJS$refreshSession$lambda$lambda($reject, $resolve) {
261
- return function (err) {
262
- if (!(err == null))
263
- $reject(err);
264
- else
265
- $resolve(null);
266
- return Unit_getInstance();
267
- };
268
- }
269
- function CoreClientJS$refreshSession$lambda(this$0, $token) {
270
- return function (resolve, reject) {
271
- this$0.d2f_1.y1a($token, CoreClientJS$refreshSession$lambda$lambda(reject, resolve));
272
- return Unit_getInstance();
273
- };
274
- }
275
- function CoreClientJS$serverCall$lambda$lambda($resolve, $reject) {
276
- return function (err, call) {
277
- var tmp;
278
- if (!(call == null)) {
279
- tmp = $resolve(new VoiceCallJS(call));
280
- } else {
281
- var tmp0_elvis_lhs = err;
282
- tmp = $reject(tmp0_elvis_lhs == null ? newThrowable('', void 1) : tmp0_elvis_lhs);
283
- }
284
- return Unit_getInstance();
285
- };
286
- }
287
- function CoreClientJS$serverCall$lambda(this$0, $typedContext) {
288
- return function (resolve, reject) {
289
- this$0.d2f_1.b1b($typedContext, CoreClientJS$serverCall$lambda$lambda(resolve, reject));
290
- return Unit_getInstance();
291
- };
292
- }
293
- function CoreClientJS$reconnectCall$lambda$lambda($resolve, $reject) {
294
- return function (err, call) {
295
- var tmp;
296
- if (!(call == null)) {
297
- tmp = $resolve(new VoiceCallJS(call));
298
- } else {
299
- var tmp0_elvis_lhs = err;
300
- tmp = $reject(tmp0_elvis_lhs == null ? newThrowable('', void 1) : tmp0_elvis_lhs);
301
- }
302
- return Unit_getInstance();
303
- };
304
- }
305
- function CoreClientJS$reconnectCall$lambda(this$0, $legId) {
306
- return function (resolve, reject) {
307
- this$0.d2f_1.c1b($legId, CoreClientJS$reconnectCall$lambda$lambda(resolve, reject));
308
- return Unit_getInstance();
309
- };
310
- }
311
- function CoreClientJS$1(this$0) {
312
- this.e2f_1 = this$0;
313
- }
314
- CoreClientJS$1.prototype.b21 = function () {
315
- var tmp0_safe_receiver = this.e2f_1.c2f_1;
316
- if (tmp0_safe_receiver == null)
317
- null;
318
- else {
319
- tmp0_safe_receiver.reconnecting();
320
- }
321
- };
322
- CoreClientJS$1.prototype.c21 = function () {
323
- var tmp0_safe_receiver = this.e2f_1.c2f_1;
324
- if (tmp0_safe_receiver == null)
325
- null;
326
- else {
327
- tmp0_safe_receiver.reconnection();
328
- }
329
- };
330
- CoreClientJS$1.prototype.d21 = function (reason) {
331
- var tmp0_safe_receiver = this.e2f_1.c2f_1;
332
- if (tmp0_safe_receiver == null)
333
- null;
334
- else {
335
- tmp0_safe_receiver.sessionError(reason);
336
- }
337
- };
338
- CoreClientJS$1.$metadata$ = classMeta(undefined, [SessionListener]);
339
- function CoreClientJS$2(this$0) {
340
- this.f2f_1 = this$0;
341
- }
342
- CoreClientJS$2.prototype.l22 = function (invite) {
343
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
344
- if (tmp0_safe_receiver == null)
345
- null;
346
- else {
347
- tmp0_safe_receiver.callInvite(VoiceInviteJS_init_$Create$(invite, null, 2, null));
348
- }
349
- };
350
- CoreClientJS$2.prototype.m22 = function (call, newConversation, prevConversation) {
351
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
352
- if (tmp0_safe_receiver == null)
353
- null;
354
- else {
355
- tmp0_safe_receiver.callTransfer(new VoiceCallJS(call), new ConversationJS(newConversation), new ConversationJS(prevConversation));
356
- }
357
- };
358
- CoreClientJS$2.prototype.n22 = function (call, legId, isMuted) {
359
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
360
- if (tmp0_safe_receiver == null)
361
- null;
362
- else {
363
- tmp0_safe_receiver.mute(new VoiceCallJS(call), legId, isMuted);
364
- }
365
- };
366
- CoreClientJS$2.prototype.o22 = function (call, legId, earmuffStatus) {
367
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
368
- if (tmp0_safe_receiver == null)
369
- null;
370
- else {
371
- tmp0_safe_receiver.earmuff(new VoiceCallJS(call), legId, earmuffStatus);
372
- }
373
- };
374
- CoreClientJS$2.prototype.p22 = function (call, legId, digits) {
375
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
376
- if (tmp0_safe_receiver == null)
377
- null;
378
- else {
379
- tmp0_safe_receiver.dtmf(new VoiceCallJS(call), legId, digits);
380
- }
381
- };
382
- CoreClientJS$2.prototype.q22 = function (call, legId, callQuality) {
383
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
384
- if (tmp0_safe_receiver == null)
385
- null;
386
- else {
387
- tmp0_safe_receiver.rtcHangup(new VoiceCallJS(call), legId, new RTCQualityJS(callQuality));
388
- }
389
- };
390
- CoreClientJS$2.prototype.r22 = function (call, legId, status) {
391
- var tmp0_safe_receiver = this.f2f_1.c2f_1;
392
- if (tmp0_safe_receiver == null)
393
- null;
394
- else {
395
- tmp0_safe_receiver.legStatusUpdate(new VoiceCallJS(call), legId, status);
396
- }
397
- };
398
- CoreClientJS$2.$metadata$ = classMeta(undefined, [VoiceClientDelegate]);
399
- function CoreClientJS(http, socket, media) {
400
- this.b2f_1 = media;
401
- this.c2f_1 = null;
402
- this.d2f_1 = (new Builder()).b1c(HttpClientJSAdapter(http)).c1c(SocketClientJSAdapter(socket)).d1c(MediaClientJSAdapter(media));
403
- this.d2f_1.z1a(new CoreClientJS$1(this));
404
- this.d2f_1.a1b(new CoreClientJS$2(this));
405
- }
406
- CoreClientJS.prototype.g2f = function (_set____db54di) {
407
- this.c2f_1 = _set____db54di;
408
- };
409
- CoreClientJS.prototype.h2f = function () {
410
- return this.c2f_1;
411
- };
412
- CoreClientJS.prototype.setConfig = function (config) {
413
- this.d2f_1.v1a(new SetConfig(config.n2e_1, config.o2e_1, config.m2e_1));
414
- };
415
- CoreClientJS.prototype.createSession = function (token, sessionId) {
416
- return new Promise(CoreClientJS$createSession$lambda(this, token, sessionId));
417
- };
418
- CoreClientJS.prototype.deleteSession = function () {
419
- return new Promise(CoreClientJS$deleteSession$lambda(this));
420
- };
421
- CoreClientJS.prototype.refreshSession = function (token) {
422
- return new Promise(CoreClientJS$refreshSession$lambda(this, token));
423
- };
424
- CoreClientJS.prototype.getPeerConnection = function (id) {
425
- return this.b2f_1.getPeerConnection(id);
426
- };
427
- CoreClientJS.prototype.serverCall = function (context) {
428
- var tmp0_safe_receiver = get_jsonNullable(context);
429
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : toMap_0(tmp0_safe_receiver);
430
- var tmp;
431
- if (tmp1_elvis_lhs == null) {
432
- var tmp$ret$0;
433
- // Inline function 'kotlin.collections.mapOf' call
434
- tmp$ret$0 = emptyMap();
435
- tmp = tmp$ret$0;
436
- } else {
437
- tmp = tmp1_elvis_lhs;
438
- }
439
- var typedContext = tmp;
440
- return new Promise(CoreClientJS$serverCall$lambda(this, typedContext));
441
- };
442
- CoreClientJS.prototype.reconnectCall = function (legId) {
443
- return new Promise(CoreClientJS$reconnectCall$lambda(this, legId));
444
- };
445
- CoreClientJS.$metadata$ = classMeta('CoreClientJS');
446
- Object.defineProperty(CoreClientJS.prototype, 'emitter', {
447
- configurable: true,
448
- get: CoreClientJS.prototype.h2f,
449
- set: CoreClientJS.prototype.g2f
450
- });
451
- function VoiceCallJS$hangup$lambda$lambda($resolve, $reject) {
452
- return function (it) {
453
- var tmp0_subject = it;
454
- var tmp;
455
- if (tmp0_subject == null) {
456
- tmp = $resolve(null);
457
- } else {
458
- tmp = $reject(it instanceof Error ? it : THROW_CCE());
459
- }
460
- return Unit_getInstance();
461
- };
462
- }
463
- function VoiceCallJS$hangup$lambda(this$0, $reasonText, $reasonCode) {
464
- return function (resolve, reject) {
465
- this$0.i2f_1.u21($reasonText, $reasonCode, VoiceCallJS$hangup$lambda$lambda(resolve, reject));
466
- return Unit_getInstance();
467
- };
468
- }
469
- function VoiceCallJS$say$lambda$lambda($reject, $resolve) {
470
- return function (it) {
471
- var tmp;
472
- if (!(it == null)) {
473
- tmp = $reject(it instanceof Error ? it : THROW_CCE());
474
- } else {
475
- tmp = $resolve(null);
476
- }
477
- return Unit_getInstance();
478
- };
479
- }
480
- function VoiceCallJS$say$lambda(this$0, $params) {
481
- return function (resolve, reject) {
482
- var tmp = $params.text;
483
- var tmp0_elvis_lhs = get_jsonNullable($params.level);
484
- var tmp_0 = tmp0_elvis_lhs == null ? 1 : tmp0_elvis_lhs;
485
- var tmp1_elvis_lhs = get_jsonNullable($params.loop);
486
- var tmp_1 = tmp1_elvis_lhs == null ? 1 : tmp1_elvis_lhs;
487
- var tmp2_elvis_lhs = get_jsonNullable($params.queue);
488
- var tmp_2 = tmp2_elvis_lhs == null ? true : tmp2_elvis_lhs;
489
- var tmp3_elvis_lhs = get_jsonNullable($params.voiceName);
490
- var tmp_3 = tmp3_elvis_lhs == null ? 'amy' : tmp3_elvis_lhs;
491
- var tmp4_elvis_lhs = get_jsonNullable($params.ssml);
492
- var tmp_4 = tmp4_elvis_lhs == null ? true : tmp4_elvis_lhs;
493
- this$0.i2f_1.k22(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, VoiceCallJS$say$lambda$lambda(reject, resolve));
494
- return Unit_getInstance();
495
- };
496
- }
497
- function VoiceCallJS$mute$lambda$lambda($reject, $resolve) {
498
- return function (it) {
499
- var tmp;
500
- if (!(it == null)) {
501
- tmp = $reject(it instanceof Error ? it : THROW_CCE());
502
- } else {
503
- tmp = $resolve(null);
504
- }
505
- return Unit_getInstance();
506
- };
507
- }
508
- function VoiceCallJS$mute$lambda(this$0) {
509
- return function (resolve, reject) {
510
- this$0.i2f_1.f22(VoiceCallJS$mute$lambda$lambda(reject, resolve));
511
- return Unit_getInstance();
512
- };
513
- }
514
- function VoiceCallJS$unmute$lambda$lambda($reject, $resolve) {
515
- return function (it) {
516
- if (!(it == null))
517
- $reject(it);
518
- else
519
- $resolve(null);
520
- return Unit_getInstance();
521
- };
522
- }
523
- function VoiceCallJS$unmute$lambda(this$0) {
524
- return function (resolve, reject) {
525
- this$0.i2f_1.g22(VoiceCallJS$unmute$lambda$lambda(reject, resolve));
526
- return Unit_getInstance();
527
- };
528
- }
529
- function VoiceCallJS$enableEarmuff$lambda$lambda($reject, $resolve) {
530
- return function (it) {
531
- if (!(it == null))
532
- $reject(it);
533
- else
534
- $resolve(null);
535
- return Unit_getInstance();
536
- };
537
- }
538
- function VoiceCallJS$enableEarmuff$lambda(this$0) {
539
- return function (resolve, reject) {
540
- this$0.i2f_1.h22(VoiceCallJS$enableEarmuff$lambda$lambda(reject, resolve));
541
- return Unit_getInstance();
542
- };
543
- }
544
- function VoiceCallJS$disableEarmuff$lambda$lambda($reject, $resolve) {
545
- return function (it) {
546
- if (!(it == null))
547
- $reject(it);
548
- else
549
- $resolve(null);
550
- return Unit_getInstance();
551
- };
552
- }
553
- function VoiceCallJS$disableEarmuff$lambda(this$0) {
554
- return function (resolve, reject) {
555
- this$0.i2f_1.i22(VoiceCallJS$disableEarmuff$lambda$lambda(reject, resolve));
556
- return Unit_getInstance();
557
- };
558
- }
559
- function VoiceCallJS$sendDTMF$lambda$lambda($reject, $resolve) {
560
- return function (it) {
561
- if (!(it == null))
562
- $reject(it);
563
- else
564
- $resolve(null);
565
- return Unit_getInstance();
566
- };
567
- }
568
- function VoiceCallJS$sendDTMF$lambda(this$0, $digits) {
569
- return function (resolve, reject) {
570
- this$0.i2f_1.j22($digits, VoiceCallJS$sendDTMF$lambda$lambda(reject, resolve));
571
- return Unit_getInstance();
572
- };
573
- }
574
- function VoiceCallJS(call) {
575
- this.i2f_1 = call;
576
- this.j2f_1 = this.i2f_1.p21_1;
577
- }
578
- VoiceCallJS.prototype.u1n = function () {
579
- return this.j2f_1;
580
- };
581
- VoiceCallJS.prototype.hangup = function (reasonText, reasonCode) {
582
- return this.k2f(reasonText === void 1 ? null : reasonText, reasonCode === void 1 ? null : reasonCode);
583
- };
584
- VoiceCallJS.prototype.k2f = function (reasonText, reasonCode) {
585
- return new Promise(VoiceCallJS$hangup$lambda(this, reasonText, reasonCode));
586
- };
587
- VoiceCallJS.prototype.l2f = function (reasonText, reasonCode, $mask0, $handler) {
588
- if (!(($mask0 & 1) === 0))
589
- reasonText = null;
590
- if (!(($mask0 & 2) === 0))
591
- reasonCode = null;
592
- return this.k2f(reasonText, reasonCode);
593
- };
594
- VoiceCallJS.prototype.say = function (params) {
595
- return new Promise(VoiceCallJS$say$lambda(this, params));
596
- };
597
- VoiceCallJS.prototype.mute = function () {
598
- return new Promise(VoiceCallJS$mute$lambda(this));
599
- };
600
- VoiceCallJS.prototype.unmute = function () {
601
- return new Promise(VoiceCallJS$unmute$lambda(this));
602
- };
603
- VoiceCallJS.prototype.enableEarmuff = function () {
604
- return new Promise(VoiceCallJS$enableEarmuff$lambda(this));
605
- };
606
- VoiceCallJS.prototype.disableEarmuff = function () {
607
- return new Promise(VoiceCallJS$disableEarmuff$lambda(this));
608
- };
609
- VoiceCallJS.prototype.sendDTMF = function (digits) {
610
- return new Promise(VoiceCallJS$sendDTMF$lambda(this, digits));
611
- };
612
- VoiceCallJS.$metadata$ = classMeta('VoiceCallJS');
613
- Object.defineProperty(VoiceCallJS.prototype, 'id', {
614
- configurable: true,
615
- get: VoiceCallJS.prototype.u1n
616
- });
617
- function VoiceInviteFromInfoJS(id, type) {
618
- this.m2f_1 = id;
619
- this.n2f_1 = type;
620
- }
621
- VoiceInviteFromInfoJS.prototype.u1n = function () {
622
- return this.m2f_1;
623
- };
624
- VoiceInviteFromInfoJS.prototype.o2f = function () {
625
- return this.n2f_1;
626
- };
627
- VoiceInviteFromInfoJS.prototype.component1 = function () {
628
- return this.m2f_1;
629
- };
630
- VoiceInviteFromInfoJS.prototype.component2 = function () {
631
- return this.n2f_1;
632
- };
633
- VoiceInviteFromInfoJS.prototype.copy = function (id, type) {
634
- return this.p2f(id === void 1 ? this.m2f_1 : id, type === void 1 ? this.n2f_1 : type);
635
- };
636
- VoiceInviteFromInfoJS.prototype.p2f = function (id, type) {
637
- return new VoiceInviteFromInfoJS(id, type);
638
- };
639
- VoiceInviteFromInfoJS.prototype.q2f = function (id, type, $mask0, $handler) {
640
- if (!(($mask0 & 1) === 0))
641
- id = this.m2f_1;
642
- if (!(($mask0 & 2) === 0))
643
- type = this.n2f_1;
644
- return this.p2f(id, type);
645
- };
646
- VoiceInviteFromInfoJS.prototype.toString = function () {
647
- return 'VoiceInviteFromInfoJS(id=' + this.m2f_1 + ', type=' + this.n2f_1 + ')';
648
- };
649
- VoiceInviteFromInfoJS.prototype.hashCode = function () {
650
- var result = this.m2f_1 == null ? 0 : getStringHashCode(this.m2f_1);
651
- result = imul(result, 31) + getStringHashCode(this.n2f_1) | 0;
652
- return result;
653
- };
654
- VoiceInviteFromInfoJS.prototype.equals = function (other) {
655
- if (this === other)
656
- return true;
657
- if (!(other instanceof VoiceInviteFromInfoJS))
658
- return false;
659
- var tmp0_other_with_cast = other instanceof VoiceInviteFromInfoJS ? other : THROW_CCE();
660
- if (!(this.m2f_1 == tmp0_other_with_cast.m2f_1))
661
- return false;
662
- if (!(this.n2f_1 === tmp0_other_with_cast.n2f_1))
663
- return false;
664
- return true;
665
- };
666
- VoiceInviteFromInfoJS.$metadata$ = classMeta('VoiceInviteFromInfoJS');
667
- Object.defineProperty(VoiceInviteFromInfoJS.prototype, 'id', {
668
- configurable: true,
669
- get: VoiceInviteFromInfoJS.prototype.u1n
670
- });
671
- Object.defineProperty(VoiceInviteFromInfoJS.prototype, 'type', {
672
- configurable: true,
673
- get: VoiceInviteFromInfoJS.prototype.o2f
674
- });
675
- function VoiceInviteJS_init_$Init$(invite, from, $mask0, $marker, $this) {
676
- if (!(($mask0 & 2) === 0))
677
- from = new VoiceInviteFromInfoJS(invite.t22_1.j23_1, invite.t22_1.k23_1);
678
- VoiceInviteJS.call($this, invite, from);
679
- return $this;
680
- }
681
- function VoiceInviteJS_init_$Create$(invite, from, $mask0, $marker) {
682
- return VoiceInviteJS_init_$Init$(invite, from, $mask0, $marker, Object.create(VoiceInviteJS.prototype));
683
- }
684
- function VoiceInviteJS$answerCall$lambda$lambda($reject, $resolve) {
685
- return function (err, call) {
686
- var tmp;
687
- if (!(err == null)) {
688
- tmp = $reject(err instanceof Error ? err : THROW_CCE());
689
- } else if (!(call == null)) {
690
- tmp = $resolve(new VoiceCallJS(call));
691
- } else {
692
- tmp = $reject(newThrowable('', void 1));
693
- }
694
- return Unit_getInstance();
695
- };
696
- }
697
- function VoiceInviteJS$answerCall$lambda(this$0) {
698
- return function (resolve, reject) {
699
- this$0.r2f_1.g23(VoiceInviteJS$answerCall$lambda$lambda(reject, resolve));
700
- return Unit_getInstance();
701
- };
702
- }
703
- function VoiceInviteJS$rejectCall$lambda$lambda($reject, $resolve) {
704
- return function (it) {
705
- var tmp;
706
- if (!(it == null)) {
707
- tmp = $reject(it instanceof Error ? it : THROW_CCE());
708
- } else {
709
- tmp = $resolve(null);
710
- }
711
- return Unit_getInstance();
712
- };
713
- }
714
- function VoiceInviteJS$rejectCall$lambda(this$0) {
715
- return function (resolve, reject) {
716
- this$0.r2f_1.h23(VoiceInviteJS$rejectCall$lambda$lambda(reject, resolve));
717
- return Unit_getInstance();
718
- };
719
- }
720
- function VoiceInviteJS(invite, from) {
721
- this.r2f_1 = invite;
722
- this.s2f_1 = from;
723
- }
724
- VoiceInviteJS.prototype.j1i = function () {
725
- return this.s2f_1;
726
- };
727
- VoiceInviteJS.prototype.answerCall = function () {
728
- return new Promise(VoiceInviteJS$answerCall$lambda(this));
729
- };
730
- VoiceInviteJS.prototype.rejectCall = function () {
731
- return new Promise(VoiceInviteJS$rejectCall$lambda(this));
732
- };
733
- VoiceInviteJS.$metadata$ = classMeta('VoiceInviteJS');
734
- Object.defineProperty(VoiceInviteJS.prototype, 'from', {
735
- configurable: true,
736
- get: VoiceInviteJS.prototype.j1i
737
- });
738
- function ConversationJS(conversation) {
739
- this.t2f_1 = conversation;
740
- this.u2f_1 = this.t2f_1.n1z_1;
741
- }
742
- ConversationJS.prototype.v2f = function (_set____db54di) {
743
- this.u2f_1 = _set____db54di;
744
- };
745
- ConversationJS.prototype.u1n = function () {
746
- return this.u2f_1;
747
- };
748
- ConversationJS.prototype.copy = function (conversation) {
749
- return this.w2f(conversation === void 1 ? this.t2f_1 : conversation);
750
- };
751
- ConversationJS.prototype.w2f = function (conversation) {
752
- return new ConversationJS(conversation);
753
- };
754
- ConversationJS.prototype.x2f = function (conversation, $mask0, $handler) {
755
- if (!(($mask0 & 1) === 0))
756
- conversation = this.t2f_1;
757
- return this.w2f(conversation);
758
- };
759
- ConversationJS.prototype.toString = function () {
760
- return 'ConversationJS(conversation=' + this.t2f_1 + ')';
761
- };
762
- ConversationJS.prototype.hashCode = function () {
763
- return this.t2f_1.hashCode();
764
- };
765
- ConversationJS.prototype.equals = function (other) {
766
- if (this === other)
767
- return true;
768
- if (!(other instanceof ConversationJS))
769
- return false;
770
- var tmp0_other_with_cast = other instanceof ConversationJS ? other : THROW_CCE();
771
- if (!this.t2f_1.equals(tmp0_other_with_cast.t2f_1))
772
- return false;
773
- return true;
774
- };
775
- ConversationJS.$metadata$ = classMeta('ConversationJS');
776
- Object.defineProperty(ConversationJS.prototype, 'id', {
777
- configurable: true,
778
- get: ConversationJS.prototype.u1n,
779
- set: ConversationJS.prototype.v2f
780
- });
781
- function get_jsonNullable(_this__u8e3s4) {
782
- var tmp0_subject = _this__u8e3s4;
783
- return tmp0_subject == null ? null : equals(tmp0_subject, undefined) ? null : _this__u8e3s4;
784
- }
785
- function CoreClientConfigRegionJS_AP_getInstance() {
786
- CoreClientConfigRegionJS_initEntries();
787
- return CoreClientConfigRegionJS_AP_instance;
788
- }
789
- function CoreClientConfigRegionJS_EU_getInstance() {
790
- CoreClientConfigRegionJS_initEntries();
791
- return CoreClientConfigRegionJS_EU_instance;
792
- }
793
- function CoreClientConfigRegionJS_US_getInstance() {
794
- CoreClientConfigRegionJS_initEntries();
795
- return CoreClientConfigRegionJS_US_instance;
796
- }
797
- function LoggingLevelJS_Verbose_getInstance() {
798
- LoggingLevelJS_initEntries();
799
- return LoggingLevelJS_Verbose_instance;
800
- }
801
- function LoggingLevelJS_Debug_getInstance() {
802
- LoggingLevelJS_initEntries();
803
- return LoggingLevelJS_Debug_instance;
804
- }
805
- function LoggingLevelJS_Info_getInstance() {
806
- LoggingLevelJS_initEntries();
807
- return LoggingLevelJS_Info_instance;
808
- }
809
- function LoggingLevelJS_Warn_getInstance() {
810
- LoggingLevelJS_initEntries();
811
- return LoggingLevelJS_Warn_instance;
812
- }
813
- function LoggingLevelJS_Error_getInstance() {
814
- LoggingLevelJS_initEntries();
815
- return LoggingLevelJS_Error_instance;
816
- }
817
- function LoggingLevelJS_Assert_getInstance() {
818
- LoggingLevelJS_initEntries();
819
- return LoggingLevelJS_Assert_instance;
820
- }
821
- function get_SOCKET_CONNECTED() {
822
- return SOCKET_CONNECTED;
823
- }
824
- var SOCKET_CONNECTED;
825
- function get_SOCKET_RECONNECTING() {
826
- return SOCKET_RECONNECTING;
827
- }
828
- var SOCKET_RECONNECTING;
829
- function get_SOCKET_DISCONNECTED() {
830
- return SOCKET_DISCONNECTED;
831
- }
832
- var SOCKET_DISCONNECTED;
833
- function get_REASON_SERVER_DISCONNECTED() {
834
- return REASON_SERVER_DISCONNECTED;
835
- }
836
- var REASON_SERVER_DISCONNECTED;
837
- function get_REASON_CLIENT_DISCONNECTED() {
838
- return REASON_CLIENT_DISCONNECTED;
839
- }
840
- var REASON_CLIENT_DISCONNECTED;
841
- function get_REASON_CLIENT_NETWORK_ERROR() {
842
- return REASON_CLIENT_NETWORK_ERROR;
843
- }
844
- var REASON_CLIENT_NETWORK_ERROR;
845
- function get_REASON_PING_TIMEOUT() {
846
- return REASON_PING_TIMEOUT;
847
- }
848
- var REASON_PING_TIMEOUT;
849
- function RTCQualityJS(callQuality) {
850
- this.y2f_1 = callQuality;
851
- this.z2f_1 = this.y2f_1.t26_1;
852
- this.a2g_1 = this.y2f_1.u26_1;
853
- this.b2g_1 = this.y2f_1.v26_1;
854
- this.c2g_1 = this.y2f_1.w26_1;
855
- this.d2g_1 = this.y2f_1.x26_1;
856
- this.e2g_1 = this.y2f_1.y26_1;
857
- this.f2g_1 = this.y2f_1.z26_1;
858
- this.g2g_1 = this.y2f_1.a27_1;
859
- this.h2g_1 = this.y2f_1.b27_1;
860
- }
861
- RTCQualityJS.prototype.i2g = function () {
862
- return this.z2f_1;
863
- };
864
- RTCQualityJS.prototype.j2g = function () {
865
- return this.a2g_1;
866
- };
867
- RTCQualityJS.prototype.k2g = function () {
868
- return this.b2g_1;
869
- };
870
- RTCQualityJS.prototype.l2g = function () {
871
- return this.c2g_1;
872
- };
873
- RTCQualityJS.prototype.m2g = function () {
874
- return this.d2g_1;
875
- };
876
- RTCQualityJS.prototype.n2g = function () {
877
- return this.e2g_1;
878
- };
879
- RTCQualityJS.prototype.o2g = function () {
880
- return this.f2g_1;
881
- };
882
- RTCQualityJS.prototype.p2g = function () {
883
- return this.g2g_1;
884
- };
885
- RTCQualityJS.prototype.q2g = function () {
886
- return this.h2g_1;
887
- };
888
- RTCQualityJS.prototype.copy = function (callQuality) {
889
- return this.r2g(callQuality === void 1 ? this.y2f_1 : callQuality);
890
- };
891
- RTCQualityJS.prototype.r2g = function (callQuality) {
892
- return new RTCQualityJS(callQuality);
893
- };
894
- RTCQualityJS.prototype.s2g = function (callQuality, $mask0, $handler) {
895
- if (!(($mask0 & 1) === 0))
896
- callQuality = this.y2f_1;
897
- return this.r2g(callQuality);
898
- };
899
- RTCQualityJS.prototype.toString = function () {
900
- return 'RTCQualityJS(callQuality=' + this.y2f_1 + ')';
901
- };
902
- RTCQualityJS.prototype.hashCode = function () {
903
- return this.y2f_1.hashCode();
904
- };
905
- RTCQualityJS.prototype.equals = function (other) {
906
- if (this === other)
907
- return true;
908
- if (!(other instanceof RTCQualityJS))
909
- return false;
910
- var tmp0_other_with_cast = other instanceof RTCQualityJS ? other : THROW_CCE();
911
- if (!this.y2f_1.equals(tmp0_other_with_cast.y2f_1))
912
- return false;
913
- return true;
914
- };
915
- RTCQualityJS.$metadata$ = classMeta('RTCQualityJS');
916
- Object.defineProperty(RTCQualityJS.prototype, 'mos_score', {
917
- configurable: true,
918
- get: RTCQualityJS.prototype.i2g
919
- });
920
- Object.defineProperty(RTCQualityJS.prototype, 'quality_percentage', {
921
- configurable: true,
922
- get: RTCQualityJS.prototype.j2g
923
- });
924
- Object.defineProperty(RTCQualityJS.prototype, 'jitter_min_var', {
925
- configurable: true,
926
- get: RTCQualityJS.prototype.k2g
927
- });
928
- Object.defineProperty(RTCQualityJS.prototype, 'jitter_max_var', {
929
- configurable: true,
930
- get: RTCQualityJS.prototype.l2g
931
- });
932
- Object.defineProperty(RTCQualityJS.prototype, 'jitter_loss_rate', {
933
- configurable: true,
934
- get: RTCQualityJS.prototype.m2g
935
- });
936
- Object.defineProperty(RTCQualityJS.prototype, 'jitter_burst_rate', {
937
- configurable: true,
938
- get: RTCQualityJS.prototype.n2g
939
- });
940
- Object.defineProperty(RTCQualityJS.prototype, 'flaw_total', {
941
- configurable: true,
942
- get: RTCQualityJS.prototype.o2g
943
- });
944
- Object.defineProperty(RTCQualityJS.prototype, 'packet_cnt', {
945
- configurable: true,
946
- get: RTCQualityJS.prototype.p2g
947
- });
948
- Object.defineProperty(RTCQualityJS.prototype, 'packet_loss_perc', {
949
- configurable: true,
950
- get: RTCQualityJS.prototype.q2g
951
- });
952
- function HttpClientJSAdapter(js) {
953
- return new HttpClientJSAdapter$1(js);
954
- }
955
- function SocketClientJSAdapter(js) {
956
- var adapter = new SocketClientJSAdapter$adapter$1(js);
957
- js.delegate = new SocketClientJSAdapter$1(adapter);
958
- return adapter;
959
- }
960
- function MediaClientJSAdapter(js) {
961
- var adapter = new MediaClientJSAdapter$adapter$1(js);
962
- return adapter;
963
- }
964
- function HttpClientJSAdapter$o$request$lambda($callback) {
965
- return function (err, response) {
966
- if (err == null)
967
- $callback(null, response);
968
- else
969
- $callback(Exception_init_$Create$(err), null);
970
- return Unit_getInstance();
971
- };
972
- }
973
- function HttpClientJSAdapter$1($js) {
974
- this.t2g_1 = $js;
975
- }
976
- HttpClientJSAdapter$1.prototype.j1b = function (verb, url, headers, body, callback) {
977
- var tmp = verb.toString();
978
- var tmp$ret$1;
979
- // Inline function 'kotlin.let' call
980
- // Inline function 'kotlin.contracts.contract' call
981
- var tmp$ret$0;
982
- // Inline function 'vonage.<no name provided>.request.<anonymous>' call
983
- tmp$ret$0 = fromMap(JSON, headers);
984
- tmp$ret$1 = tmp$ret$0;
985
- var tmp_0 = tmp$ret$1;
986
- this.t2g_1.request(tmp, url, tmp_0, body, HttpClientJSAdapter$o$request$lambda(callback));
987
- };
988
- HttpClientJSAdapter$1.$metadata$ = classMeta(undefined, [HTTPClient]);
989
- function SocketClientJSAdapter$o$emit$lambda($callback) {
990
- return function (err, response) {
991
- var tmp0_safe_receiver = err;
992
- var tmp;
993
- if (tmp0_safe_receiver == null) {
994
- tmp = null;
995
- } else {
996
- var tmp$ret$1;
997
- // Inline function 'kotlin.let' call
998
- // Inline function 'kotlin.contracts.contract' call
999
- var tmp$ret$0;
1000
- // Inline function 'vonage.<no name provided>.emit.<anonymous>.<anonymous>' call
1001
- tmp$ret$0 = Exception_init_$Create$(err);
1002
- tmp$ret$1 = tmp$ret$0;
1003
- tmp = tmp$ret$1;
1004
- }
1005
- $callback(tmp, response);
1006
- return Unit_getInstance();
1007
- };
1008
- }
1009
- function SocketClientJSAdapter$adapter$1($js) {
1010
- this.v2g_1 = $js;
1011
- this.u2g_1 = null;
1012
- }
1013
- SocketClientJSAdapter$adapter$1.prototype.m1b = function (_set____db54di) {
1014
- this.u2g_1 = _set____db54di;
1015
- };
1016
- SocketClientJSAdapter$adapter$1.prototype.a24 = function () {
1017
- return this.u2g_1;
1018
- };
1019
- SocketClientJSAdapter$adapter$1.prototype.n1b = function (type, msg, callback) {
1020
- var tmp0_safe_receiver = msg;
1021
- var tmp;
1022
- if (tmp0_safe_receiver == null) {
1023
- tmp = null;
1024
- } else {
1025
- var tmp$ret$1;
1026
- // Inline function 'kotlin.let' call
1027
- // Inline function 'kotlin.contracts.contract' call
1028
- var tmp$ret$0;
1029
- // Inline function 'vonage.<no name provided>.emit.<anonymous>' call
1030
- tmp$ret$0 = fromMap(JSON, tmp0_safe_receiver);
1031
- tmp$ret$1 = tmp$ret$0;
1032
- tmp = tmp$ret$1;
1033
- }
1034
- var tmp_0 = tmp;
1035
- this.v2g_1.emit(type, tmp_0, SocketClientJSAdapter$o$emit$lambda(callback));
1036
- };
1037
- SocketClientJSAdapter$adapter$1.prototype.o1b = function (host, path, reconnectionAttempts, reconnectionDelay, randomizationFactor, token, session_id, query) {
1038
- this.v2g_1.connect(host, path, reconnectionAttempts, reconnectionDelay, randomizationFactor, query);
1039
- };
1040
- SocketClientJSAdapter$adapter$1.prototype.p1b = function () {
1041
- this.v2g_1.disconnect();
1042
- };
1043
- SocketClientJSAdapter$adapter$1.prototype.q1b = function (token) {
1044
- this.v2g_1.setConnectParamsSocketConfig(token);
1045
- };
1046
- SocketClientJSAdapter$adapter$1.prototype.r1b = function (milliseconds, callback) {
1047
- this.v2g_1.startVerifyResponseTimer(milliseconds, callback);
1048
- };
1049
- SocketClientJSAdapter$adapter$1.$metadata$ = classMeta(undefined, [SocketClient]);
1050
- function SocketClientJSAdapter$1($adapter) {
1051
- this.w2g_1 = $adapter;
1052
- }
1053
- SocketClientJSAdapter$1.prototype.didReceiveNewSocketEvent = function (type, body) {
1054
- var tmp0_safe_receiver = this.w2g_1.u2g_1;
1055
- if (tmp0_safe_receiver == null)
1056
- null;
1057
- else {
1058
- tmp0_safe_receiver.e29(new UnknownSocketEvent(body, type));
1059
- }
1060
- };
1061
- SocketClientJSAdapter$1.prototype.didReceiveNewSocketConnectionStatusEvent = function (type, reason) {
1062
- var tmp0_subject = type;
1063
- {
1064
- var tmp1_safe_receiver;
1065
- switch (tmp0_subject) {
1066
- case 'NXMCORE_SOCKET_CONNECTED':
1067
- tmp1_safe_receiver = SocketConnectionStatus_Connected_getInstance();
1068
- break;
1069
- case 'NXMCORE_SOCKET_RECONNECTING':
1070
- tmp1_safe_receiver = SocketConnectionStatus_Reconnecting_getInstance();
1071
- break;
1072
- case 'NXMCORE_SOCKET_DISCONNECTED':
1073
- tmp1_safe_receiver = SocketConnectionStatus_Disconnected_getInstance();
1074
- break;
1075
- default:
1076
- tmp1_safe_receiver = null;
1077
- break;
1078
- }
1079
- }
1080
- if (tmp1_safe_receiver == null)
1081
- null;
1082
- else {
1083
- var tmp$ret$1;
1084
- // Inline function 'kotlin.let' call
1085
- // Inline function 'kotlin.contracts.contract' call
1086
- var tmp$ret$0;
1087
- // Inline function 'vonage.<no name provided>.didReceiveNewSocketConnectionStatusEvent.<anonymous>' call
1088
- var tmp0_subject_0 = reason;
1089
- var tmp;
1090
- switch (tmp0_subject_0) {
1091
- case 'NXMCORE_REASON_SERVER_DISCONNECTED':
1092
- var tmp1_safe_receiver_0 = this.w2g_1.u2g_1;
1093
- var tmp_0;
1094
- if (tmp1_safe_receiver_0 == null) {
1095
- tmp_0 = null;
1096
- } else {
1097
- tmp1_safe_receiver_0.f29(tmp1_safe_receiver, SocketConnectionFailedReason_ServerDisconnected_getInstance());
1098
- tmp_0 = Unit_getInstance();
1099
- }
1100
-
1101
- tmp = tmp_0;
1102
- break;
1103
- case 'NXMCORE_REASON_CLIENT_DISCONNECTED':
1104
- var tmp2_safe_receiver = this.w2g_1.u2g_1;
1105
- var tmp_1;
1106
- if (tmp2_safe_receiver == null) {
1107
- tmp_1 = null;
1108
- } else {
1109
- tmp2_safe_receiver.f29(tmp1_safe_receiver, SocketConnectionFailedReason_ClientDisconnected_getInstance());
1110
- tmp_1 = Unit_getInstance();
1111
- }
1112
-
1113
- tmp = tmp_1;
1114
- break;
1115
- case 'NXMCORE_CLIENT_NETWORK_ERROR':
1116
- var tmp3_safe_receiver = this.w2g_1.u2g_1;
1117
- var tmp_2;
1118
- if (tmp3_safe_receiver == null) {
1119
- tmp_2 = null;
1120
- } else {
1121
- tmp3_safe_receiver.f29(tmp1_safe_receiver, SocketConnectionFailedReason_ClientNetworkError_getInstance());
1122
- tmp_2 = Unit_getInstance();
1123
- }
1124
-
1125
- tmp = tmp_2;
1126
- break;
1127
- case 'NXMCORE_REASON_PING_TIMEOUT':
1128
- var tmp4_safe_receiver = this.w2g_1.u2g_1;
1129
- var tmp_3;
1130
- if (tmp4_safe_receiver == null) {
1131
- tmp_3 = null;
1132
- } else {
1133
- tmp4_safe_receiver.f29(tmp1_safe_receiver, SocketConnectionFailedReason_PingTimeout_getInstance());
1134
- tmp_3 = Unit_getInstance();
1135
- }
1136
-
1137
- tmp = tmp_3;
1138
- break;
1139
- default:
1140
- var tmp5_safe_receiver = this.w2g_1.u2g_1;
1141
- var tmp_4;
1142
- if (tmp5_safe_receiver == null) {
1143
- tmp_4 = null;
1144
- } else {
1145
- tmp5_safe_receiver.f29(tmp1_safe_receiver, null);
1146
- tmp_4 = Unit_getInstance();
1147
- }
1148
-
1149
- tmp = tmp_4;
1150
- break;
1151
- }
1152
- tmp$ret$0 = tmp;
1153
- tmp$ret$1 = tmp$ret$0;
1154
- }
1155
- };
1156
- SocketClientJSAdapter$1.$metadata$ = classMeta();
1157
- function MediaClientJSAdapter$adapter$1($js) {
1158
- this.x2g_1 = $js;
1159
- }
1160
- MediaClientJSAdapter$adapter$1.prototype.u1b = function (closure) {
1161
- this.x2g_1.enableMediaOutbound(closure);
1162
- };
1163
- MediaClientJSAdapter$adapter$1.prototype.y2g = function (closure, offerSDP, rtcId) {
1164
- this.x2g_1.enableMediaInbound(closure, offerSDP, rtcId);
1165
- };
1166
- MediaClientJSAdapter$adapter$1.prototype.v1b = function (closure, offerSDP, rtcId) {
1167
- return this.y2g(closure, offerSDP, rtcId);
1168
- };
1169
- MediaClientJSAdapter$adapter$1.prototype.w1b = function (id, sdp) {
1170
- this.x2g_1.processAnswer(id, sdp);
1171
- };
1172
- MediaClientJSAdapter$adapter$1.prototype.x1b = function (id) {
1173
- this.x2g_1.disableMedia(id);
1174
- };
1175
- MediaClientJSAdapter$adapter$1.prototype.y1b = function (id) {
1176
- this.x2g_1.mute(id);
1177
- };
1178
- MediaClientJSAdapter$adapter$1.prototype.z1b = function (id) {
1179
- this.x2g_1.unmute(id);
1180
- };
1181
- MediaClientJSAdapter$adapter$1.$metadata$ = classMeta(undefined, [MediaClient]);
1182
- function entriesOf(jsObject) {
1183
- var tmp$ret$2;
1184
- // Inline function 'kotlin.collections.map' call
1185
- var tmp = Object.entries;
1186
- var tmp0_map = ((!(tmp == null) ? typeof tmp === 'function' : false) ? tmp : THROW_CCE())(jsObject);
1187
- var tmp$ret$1;
1188
- // Inline function 'kotlin.collections.mapTo' call
1189
- var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
1190
- var indexedObject = tmp0_map;
1191
- var inductionVariable = 0;
1192
- var last = indexedObject.length;
1193
- while (inductionVariable < last) {
1194
- var item = indexedObject[inductionVariable];
1195
- inductionVariable = inductionVariable + 1 | 0;
1196
- var tmp$ret$0;
1197
- // Inline function 'vonage.utils.entriesOf.<anonymous>' call
1198
- var tmp_0 = item[0];
1199
- tmp$ret$0 = to((!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(), item[1]);
1200
- tmp0_mapTo.a(tmp$ret$0);
1201
- }
1202
- tmp$ret$1 = tmp0_mapTo;
1203
- tmp$ret$2 = tmp$ret$1;
1204
- return tmp$ret$2;
1205
- }
1206
- function toMap_0(_this__u8e3s4) {
1207
- return toMap(entriesOf(_this__u8e3s4));
1208
- }
1209
- function fromMap(_this__u8e3s4, m) {
1210
- var tmp$ret$9;
1211
- // Inline function 'kotlin.collections.toTypedArray' call
1212
- var tmp$ret$8;
1213
- // Inline function 'kotlin.collections.map' call
1214
- var tmp$ret$4;
1215
- // Inline function 'kotlin.apply' call
1216
- var tmp$ret$0;
1217
- // Inline function 'kotlin.collections.mutableMapOf' call
1218
- tmp$ret$0 = LinkedHashMap_init_$Create$();
1219
- var tmp0_apply = tmp$ret$0;
1220
- // Inline function 'kotlin.contracts.contract' call
1221
- // Inline function 'vonage.utils.fromMap.<anonymous>' call
1222
- // Inline function 'kotlin.collections.forEach' call
1223
- var tmp$ret$1;
1224
- // Inline function 'kotlin.collections.iterator' call
1225
- tmp$ret$1 = m.q().g();
1226
- var tmp0_iterator = tmp$ret$1;
1227
- while (tmp0_iterator.h()) {
1228
- var element = tmp0_iterator.i();
1229
- // Inline function 'vonage.utils.fromMap.<anonymous>.<anonymous>' call
1230
- var tmp$ret$2;
1231
- // Inline function 'kotlin.collections.component1' call
1232
- tmp$ret$2 = element.m1();
1233
- var k = tmp$ret$2;
1234
- var tmp$ret$3;
1235
- // Inline function 'kotlin.collections.component2' call
1236
- tmp$ret$3 = element.o1();
1237
- var v = tmp$ret$3;
1238
- var tmp0_subject = k;
1239
- if (!(tmp0_subject == null) ? typeof tmp0_subject === 'string' : false) {
1240
- // Inline function 'kotlin.collections.set' call
1241
- var tmp0_set = k;
1242
- tmp0_apply.l(tmp0_set, v);
1243
- } else {
1244
- }
1245
- }
1246
- tmp$ret$4 = tmp0_apply;
1247
- var tmp1_map = tmp$ret$4;
1248
- var tmp$ret$7;
1249
- // Inline function 'kotlin.collections.mapTo' call
1250
- var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.f());
1251
- var tmp$ret$5;
1252
- // Inline function 'kotlin.collections.iterator' call
1253
- tmp$ret$5 = tmp1_map.q().g();
1254
- var tmp0_iterator_0 = tmp$ret$5;
1255
- while (tmp0_iterator_0.h()) {
1256
- var item = tmp0_iterator_0.i();
1257
- var tmp$ret$6;
1258
- // Inline function 'vonage.utils.fromMap.<anonymous>' call
1259
- var tmp = item.m1();
1260
- var tmp0_subject_0 = item.o1();
1261
- var tmp_0;
1262
- var tmp_1;
1263
- var tmp_2;
1264
- if (!(tmp0_subject_0 == null) ? typeof tmp0_subject_0 === 'string' : false) {
1265
- tmp_2 = true;
1266
- } else {
1267
- tmp_2 = !(tmp0_subject_0 == null) ? typeof tmp0_subject_0 === 'boolean' : false;
1268
- }
1269
- if (tmp_2) {
1270
- tmp_1 = true;
1271
- } else {
1272
- tmp_1 = !(tmp0_subject_0 == null) ? typeof tmp0_subject_0 === 'number' : false;
1273
- }
1274
- if (tmp_1) {
1275
- tmp_0 = item.o1();
1276
- } else {
1277
- if (!(tmp0_subject_0 == null) ? isInterface(tmp0_subject_0, Map) : false) {
1278
- var tmp_3;
1279
- try {
1280
- var tmp_4 = JSON;
1281
- var tmp_5 = item.o1();
1282
- tmp_3 = fromMap(tmp_4, (!(tmp_5 == null) ? isInterface(tmp_5, Map) : false) ? tmp_5 : THROW_CCE());
1283
- } catch ($p) {
1284
- var tmp_6;
1285
- if ($p instanceof Exception) {
1286
- tmp_6 = null;
1287
- } else {
1288
- throw $p;
1289
- }
1290
- tmp_3 = tmp_6;
1291
- }
1292
- tmp_0 = tmp_3;
1293
- } else {
1294
- tmp_0 = null;
1295
- }
1296
- }
1297
- tmp$ret$6 = new Pair(tmp, tmp_0);
1298
- tmp0_mapTo.a(tmp$ret$6);
1299
- }
1300
- tmp$ret$7 = tmp0_mapTo;
1301
- tmp$ret$8 = tmp$ret$7;
1302
- var tmp2_toTypedArray = tmp$ret$8;
1303
- tmp$ret$9 = copyToArray(tmp2_toTypedArray);
1304
- return json(tmp$ret$9.slice());
1305
- }
1306
- //region block: init
1307
- SOCKET_CONNECTED = 'NXMCORE_SOCKET_CONNECTED';
1308
- SOCKET_RECONNECTING = 'NXMCORE_SOCKET_RECONNECTING';
1309
- SOCKET_DISCONNECTED = 'NXMCORE_SOCKET_DISCONNECTED';
1310
- REASON_SERVER_DISCONNECTED = 'NXMCORE_REASON_SERVER_DISCONNECTED';
1311
- REASON_CLIENT_DISCONNECTED = 'NXMCORE_REASON_CLIENT_DISCONNECTED';
1312
- REASON_CLIENT_NETWORK_ERROR = 'NXMCORE_CLIENT_NETWORK_ERROR';
1313
- REASON_PING_TIMEOUT = 'NXMCORE_REASON_PING_TIMEOUT';
1314
- //endregion
1315
- //region block: exports
1316
- function $jsExportAll$(_) {
1317
- var $vonage = _.vonage || (_.vonage = {});
1318
- $vonage.CoreClientConfigRegionJS = CoreClientConfigRegionJS;
1319
- $vonage.CoreClientConfigRegionJS.values = values;
1320
- $vonage.CoreClientConfigRegionJS.valueOf = valueOf;
1321
- Object.defineProperty($vonage.CoreClientConfigRegionJS, 'AP', {
1322
- configurable: true,
1323
- get: CoreClientConfigRegionJS_AP_getInstance
1324
- });
1325
- Object.defineProperty($vonage.CoreClientConfigRegionJS, 'EU', {
1326
- configurable: true,
1327
- get: CoreClientConfigRegionJS_EU_getInstance
1328
- });
1329
- Object.defineProperty($vonage.CoreClientConfigRegionJS, 'US', {
1330
- configurable: true,
1331
- get: CoreClientConfigRegionJS_US_getInstance
1332
- });
1333
- $vonage.CoreClientConfigJS = CoreClientConfigJS;
1334
- $vonage.LoggingLevelJS = LoggingLevelJS;
1335
- $vonage.LoggingLevelJS.values = values_0;
1336
- $vonage.LoggingLevelJS.valueOf = valueOf_0;
1337
- Object.defineProperty($vonage.LoggingLevelJS, 'Verbose', {
1338
- configurable: true,
1339
- get: LoggingLevelJS_Verbose_getInstance
1340
- });
1341
- Object.defineProperty($vonage.LoggingLevelJS, 'Debug', {
1342
- configurable: true,
1343
- get: LoggingLevelJS_Debug_getInstance
1344
- });
1345
- Object.defineProperty($vonage.LoggingLevelJS, 'Info', {
1346
- configurable: true,
1347
- get: LoggingLevelJS_Info_getInstance
1348
- });
1349
- Object.defineProperty($vonage.LoggingLevelJS, 'Warn', {
1350
- configurable: true,
1351
- get: LoggingLevelJS_Warn_getInstance
1352
- });
1353
- Object.defineProperty($vonage.LoggingLevelJS, 'Error', {
1354
- configurable: true,
1355
- get: LoggingLevelJS_Error_getInstance
1356
- });
1357
- Object.defineProperty($vonage.LoggingLevelJS, 'Assert', {
1358
- configurable: true,
1359
- get: LoggingLevelJS_Assert_getInstance
1360
- });
1361
- $vonage.setDefaultLoggingLevel = setDefaultLoggingLevel_0;
1362
- $vonage.CoreClientJS = CoreClientJS;
1363
- $vonage.VoiceCallJS = VoiceCallJS;
1364
- $vonage.VoiceInviteFromInfoJS = VoiceInviteFromInfoJS;
1365
- $vonage.VoiceInviteJS = VoiceInviteJS;
1366
- $vonage.ConversationJS = ConversationJS;
1367
- var $vonage = _.vonage || (_.vonage = {});
1368
- Object.defineProperty($vonage, 'SOCKET_CONNECTED', {
1369
- configurable: true,
1370
- get: get_SOCKET_CONNECTED
1371
- });
1372
- Object.defineProperty($vonage, 'SOCKET_RECONNECTING', {
1373
- configurable: true,
1374
- get: get_SOCKET_RECONNECTING
1375
- });
1376
- Object.defineProperty($vonage, 'SOCKET_DISCONNECTED', {
1377
- configurable: true,
1378
- get: get_SOCKET_DISCONNECTED
1379
- });
1380
- Object.defineProperty($vonage, 'REASON_SERVER_DISCONNECTED', {
1381
- configurable: true,
1382
- get: get_REASON_SERVER_DISCONNECTED
1383
- });
1384
- Object.defineProperty($vonage, 'REASON_CLIENT_DISCONNECTED', {
1385
- configurable: true,
1386
- get: get_REASON_CLIENT_DISCONNECTED
1387
- });
1388
- Object.defineProperty($vonage, 'REASON_CLIENT_NETWORK_ERROR', {
1389
- configurable: true,
1390
- get: get_REASON_CLIENT_NETWORK_ERROR
1391
- });
1392
- Object.defineProperty($vonage, 'REASON_PING_TIMEOUT', {
1393
- configurable: true,
1394
- get: get_REASON_PING_TIMEOUT
1395
- });
1396
- $vonage.RTCQualityJS = RTCQualityJS;
1397
- }
1398
- $jsExportAll$(_);
1399
- //endregion
1400
- return _;
1401
- }));
1402
-
1403
- //# sourceMappingURL=clientsdk-clientcore_js.js.map