@jibb-open/jssdk 3.5.12 → 3.5.13

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.
@@ -1,3033 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.promise.js");
4
- require("core-js/modules/web.dom-collections.iterator.js");
5
- require("core-js/modules/es.array.reduce.js");
6
- require("core-js/modules/es.symbol.description.js");
7
- require("core-js/modules/es.regexp.exec.js");
8
- require("core-js/modules/es.string.replace.js");
9
- require("core-js/modules/es.regexp.to-string.js");
10
- require("core-js/modules/es.symbol.async-iterator.js");
11
- require("core-js/modules/es.array.reverse.js");
12
- require("core-js/modules/es.json.stringify.js");
13
- require("core-js/modules/es.regexp.test.js");
14
- require("core-js/modules/es.global-this.js");
15
- /*! For license information please see jibb_WebexXapi.js.LICENSE.txt */
16
- !function (t, e) {
17
- "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(["xapi"], e) : "object" == typeof exports ? exports.JIBB = e() : t.JIBB = e(t.xapi);
18
- }(global, t => (() => {
19
- "use strict";
20
-
21
- var e,
22
- r = {
23
- 9491: t => {
24
- t.exports = require("assert");
25
- },
26
- 4300: t => {
27
- t.exports = require("buffer");
28
- },
29
- 2361: t => {
30
- t.exports = require("events");
31
- },
32
- 7147: t => {
33
- t.exports = require("fs");
34
- },
35
- 8188: t => {
36
- t.exports = require("module");
37
- },
38
- 2037: t => {
39
- t.exports = require("os");
40
- },
41
- 1017: t => {
42
- t.exports = require("path");
43
- },
44
- 2781: t => {
45
- t.exports = require("stream");
46
- },
47
- 1576: t => {
48
- t.exports = require("string_decoder");
49
- },
50
- 6224: t => {
51
- t.exports = require("tty");
52
- },
53
- 7310: t => {
54
- t.exports = require("url");
55
- },
56
- 3837: t => {
57
- t.exports = require("util");
58
- },
59
- 6144: t => {
60
- t.exports = require("vm");
61
- },
62
- 1267: t => {
63
- t.exports = require("worker_threads");
64
- },
65
- 8994: e => {
66
- e.exports = t;
67
- }
68
- },
69
- n = {};
70
- function o(t) {
71
- var e = n[t];
72
- if (void 0 !== e) return e.exports;
73
- var i = n[t] = {
74
- exports: {}
75
- };
76
- return r[t](i, i.exports, o), i.exports;
77
- }
78
- o.m = r, o.n = t => {
79
- var e = t && t.__esModule ? () => t.default : () => t;
80
- return o.d(e, {
81
- a: e
82
- }), e;
83
- }, o.d = (t, e) => {
84
- for (var r in e) o.o(e, r) && !o.o(t, r) && Object.defineProperty(t, r, {
85
- enumerable: !0,
86
- get: e[r]
87
- });
88
- }, o.f = {}, o.e = t => Promise.all(Object.keys(o.f).reduce((e, r) => (o.f[r](t, e), e), [])), o.u = t => t + ".jibb_WebexXapi.js", o.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), o.r = t => {
89
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
90
- value: "Module"
91
- }), Object.defineProperty(t, "__esModule", {
92
- value: !0
93
- });
94
- }, e = {
95
- 179: 1
96
- }, o.f.require = (t, r) => {
97
- e[t] || (t => {
98
- var r = t.modules,
99
- n = t.ids,
100
- i = t.runtime;
101
- for (var a in r) o.o(r, a) && (o.m[a] = r[a]);
102
- i && i(o);
103
- for (var c = 0; c < n.length; c++) e[n[c]] = 1;
104
- })(require("./" + o.u(t)));
105
- };
106
- var i = {};
107
- return (() => {
108
- o.d(i, {
109
- default: () => Se
110
- });
111
- var t = {};
112
- o.r(t), o.d(t, {
113
- createMeeting: () => jt,
114
- createShare: () => $t,
115
- createTemporaryShare: () => Lt,
116
- deleteMeeting: () => Gt,
117
- deleteMeetingImages: () => Ot,
118
- deleteShare: () => te,
119
- deleteShareMe: () => oe,
120
- endMeeting: () => Bt,
121
- getListShare: () => Vt,
122
- getListShareMe: () => re,
123
- getMeetingDetails: () => Jt,
124
- getMeetingImage: () => Ct,
125
- getMeetingImages: () => Ut,
126
- getMeetingList: () => Dt,
127
- getMeetingToken: () => Ft,
128
- getMeetingTokenFromTempShareId: () => Tt,
129
- isMeetingOwner: () => zt,
130
- startMeeting: () => Rt,
131
- updateMeeting: () => Kt
132
- });
133
- var e = {};
134
- function r(t, e) {
135
- for (var r = 0; r < e.length; r++) {
136
- var n = e[r];
137
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
138
- }
139
- }
140
- o.r(e), o.d(e, {
141
- getCameraList: () => pe,
142
- getCameraPreview: () => fe,
143
- getClientStatusList: () => je,
144
- sendMessage: () => ge,
145
- setRuntimeConfig: () => be,
146
- startStream: () => ye,
147
- stopStream: () => de
148
- });
149
- var n = new (function () {
150
- function t() {
151
- !function (t, e) {
152
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
153
- }(this, t), this.apiBaseURL = "https://api.jibb.ai";
154
- }
155
- var e, n;
156
- return e = t, (n = [{
157
- key: "setApiBaseURL",
158
- value: function value(t) {
159
- this.apiBaseURL = t;
160
- }
161
- }]) && r(e.prototype, n), Object.defineProperty(e, "prototype", {
162
- writable: !1
163
- }), t;
164
- }())();
165
- function a(t, e) {
166
- for (var r = 0; r < e.length; r++) {
167
- var n = e[r];
168
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
169
- }
170
- }
171
- var c = new (function () {
172
- function t() {
173
- !function (t, e) {
174
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
175
- }(this, t);
176
- }
177
- var e, r;
178
- return e = t, (r = [{
179
- key: "error",
180
- value: function value() {}
181
- }, {
182
- key: "debug",
183
- value: function value() {}
184
- }, {
185
- key: "warn",
186
- value: function value() {}
187
- }, {
188
- key: "info",
189
- value: function value() {}
190
- }, {
191
- key: "setLevel",
192
- value: function value() {}
193
- }]) && a(e.prototype, r), Object.defineProperty(e, "prototype", {
194
- writable: !1
195
- }), t;
196
- }())();
197
- function u(t) {
198
- this.message = t;
199
- }
200
- u.prototype = new Error(), u.prototype.name = "InvalidCharacterError";
201
- var s = "undefined" != typeof window && window.atob && window.atob.bind(window) || function (t) {
202
- var e = String(t).replace(/=+$/, "");
203
- if (e.length % 4 == 1) throw new u("'atob' failed: The string to be decoded is not correctly encoded.");
204
- for (var r, n, o = 0, i = 0, a = ""; n = e.charAt(i++); ~n && (r = o % 4 ? 64 * r + n : n, o++ % 4) ? a += String.fromCharCode(255 & r >> (-2 * o & 6)) : 0) n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);
205
- return a;
206
- };
207
- function p(t) {
208
- var e = t.replace(/-/g, "+").replace(/_/g, "/");
209
- switch (e.length % 4) {
210
- case 0:
211
- break;
212
- case 2:
213
- e += "==";
214
- break;
215
- case 3:
216
- e += "=";
217
- break;
218
- default:
219
- throw "Illegal base64url string!";
220
- }
221
- try {
222
- return function (t) {
223
- return decodeURIComponent(s(t).replace(/(.)/g, function (t, e) {
224
- var r = e.charCodeAt(0).toString(16).toUpperCase();
225
- return r.length < 2 && (r = "0" + r), "%" + r;
226
- }));
227
- }(e);
228
- } catch (t) {
229
- return s(e);
230
- }
231
- }
232
- function l(t) {
233
- this.message = t;
234
- }
235
- l.prototype = new Error(), l.prototype.name = "InvalidTokenError";
236
- const f = function f(t, e) {
237
- if ("string" != typeof t) throw new l("Invalid token specified");
238
- var r = !0 === (e = e || {}).header ? 0 : 1;
239
- try {
240
- return JSON.parse(p(t.split(".")[r]));
241
- } catch (t) {
242
- throw new l("Invalid token specified: " + t.message);
243
- }
244
- };
245
- function h(t, e) {
246
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
247
- }
248
- function y(t, e) {
249
- for (var r = 0; r < e.length; r++) {
250
- var n = e[r];
251
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
252
- }
253
- }
254
- function v(t, e, r) {
255
- return e && y(t.prototype, e), r && y(t, r), Object.defineProperty(t, "prototype", {
256
- writable: !1
257
- }), t;
258
- }
259
- var d = "USER",
260
- m = "ADMIN",
261
- g = "SUPERADMIN",
262
- w = function () {
263
- function t(e) {
264
- h(this, t), this.claims = f(e), this.expiryTime = new Date(1e3 * this.claims.exp), this.owner = this.claims.data.owner, this.meetindId = this.claims.data.meeting_id, this.title = this.claims.data.title, this.capacity = this.claims.data.capacity, this.permission = this.claims.data.permission, this.meetingType = this.claims.data.meeting_type, this.isTemporary = this.claims.data.is_temporary;
265
- }
266
- return v(t, [{
267
- key: "getSecondsUntilExpiry",
268
- value: function value() {
269
- return this.expiryTime - Date.now() - 60;
270
- }
271
- }, {
272
- key: "isExpired",
273
- value: function value() {
274
- return this.getSecondsUntilExpiry() <= 0;
275
- }
276
- }]), t;
277
- }(),
278
- b = function () {
279
- function t(e) {
280
- var r;
281
- h(this, t), this.token = e, this.claims = f(e), this.expiryTime = new Date(1e3 * this.claims.exp), this.email = null === (r = this.claims.data) || void 0 === r ? void 0 : r.email, this.userId = this.claims.sub;
282
- }
283
- return v(t, [{
284
- key: "getSecondsUntilExpiry",
285
- value: function value() {
286
- return this.expiryTime - Date.now() - 60;
287
- }
288
- }, {
289
- key: "isExpired",
290
- value: function value() {
291
- return this.getSecondsUntilExpiry() <= 0;
292
- }
293
- }, {
294
- key: "getUserId",
295
- value: function value() {
296
- return this.userId;
297
- }
298
- }]), t;
299
- }(),
300
- x = o(8994),
301
- j = o.n(x);
302
- function k(t) {
303
- return k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
304
- return typeof t;
305
- } : function (t) {
306
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
307
- }, k(t);
308
- }
309
- function L(t, e) {
310
- (null == e || e > t.length) && (e = t.length);
311
- for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r];
312
- return n;
313
- }
314
- function E() {
315
- E = function E() {
316
- return t;
317
- };
318
- var t = {},
319
- e = Object.prototype,
320
- r = e.hasOwnProperty,
321
- n = Object.defineProperty || function (t, e, r) {
322
- t[e] = r.value;
323
- },
324
- o = "function" == typeof Symbol ? Symbol : {},
325
- i = o.iterator || "@@iterator",
326
- a = o.asyncIterator || "@@asyncIterator",
327
- c = o.toStringTag || "@@toStringTag";
328
- function u(t, e, r) {
329
- return Object.defineProperty(t, e, {
330
- value: r,
331
- enumerable: !0,
332
- configurable: !0,
333
- writable: !0
334
- }), t[e];
335
- }
336
- try {
337
- u({}, "");
338
- } catch (t) {
339
- u = function u(t, e, r) {
340
- return t[e] = r;
341
- };
342
- }
343
- function s(t, e, r, o) {
344
- var i = e && e.prototype instanceof f ? e : f,
345
- a = Object.create(i.prototype),
346
- c = new S(o || []);
347
- return n(a, "_invoke", {
348
- value: x(t, r, c)
349
- }), a;
350
- }
351
- function p(t, e, r) {
352
- try {
353
- return {
354
- type: "normal",
355
- arg: t.call(e, r)
356
- };
357
- } catch (t) {
358
- return {
359
- type: "throw",
360
- arg: t
361
- };
362
- }
363
- }
364
- t.wrap = s;
365
- var l = {};
366
- function f() {}
367
- function h() {}
368
- function y() {}
369
- var v = {};
370
- u(v, i, function () {
371
- return this;
372
- });
373
- var d = Object.getPrototypeOf,
374
- m = d && d(d(O([])));
375
- m && m !== e && r.call(m, i) && (v = m);
376
- var g = y.prototype = f.prototype = Object.create(v);
377
- function w(t) {
378
- ["next", "throw", "return"].forEach(function (e) {
379
- u(t, e, function (t) {
380
- return this._invoke(e, t);
381
- });
382
- });
383
- }
384
- function b(t, e) {
385
- function o(n, i, a, c) {
386
- var u = p(t[n], t, i);
387
- if ("throw" !== u.type) {
388
- var s = u.arg,
389
- l = s.value;
390
- return l && "object" == k(l) && r.call(l, "__await") ? e.resolve(l.__await).then(function (t) {
391
- o("next", t, a, c);
392
- }, function (t) {
393
- o("throw", t, a, c);
394
- }) : e.resolve(l).then(function (t) {
395
- s.value = t, a(s);
396
- }, function (t) {
397
- return o("throw", t, a, c);
398
- });
399
- }
400
- c(u.arg);
401
- }
402
- var i;
403
- n(this, "_invoke", {
404
- value: function value(t, r) {
405
- function n() {
406
- return new e(function (e, n) {
407
- o(t, r, e, n);
408
- });
409
- }
410
- return i = i ? i.then(n, n) : n();
411
- }
412
- });
413
- }
414
- function x(t, e, r) {
415
- var n = "suspendedStart";
416
- return function (o, i) {
417
- if ("executing" === n) throw new Error("Generator is already running");
418
- if ("completed" === n) {
419
- if ("throw" === o) throw i;
420
- return {
421
- value: void 0,
422
- done: !0
423
- };
424
- }
425
- for (r.method = o, r.arg = i;;) {
426
- var a = r.delegate;
427
- if (a) {
428
- var c = j(a, r);
429
- if (c) {
430
- if (c === l) continue;
431
- return c;
432
- }
433
- }
434
- if ("next" === r.method) r.sent = r._sent = r.arg;else if ("throw" === r.method) {
435
- if ("suspendedStart" === n) throw n = "completed", r.arg;
436
- r.dispatchException(r.arg);
437
- } else "return" === r.method && r.abrupt("return", r.arg);
438
- n = "executing";
439
- var u = p(t, e, r);
440
- if ("normal" === u.type) {
441
- if (n = r.done ? "completed" : "suspendedYield", u.arg === l) continue;
442
- return {
443
- value: u.arg,
444
- done: r.done
445
- };
446
- }
447
- "throw" === u.type && (n = "completed", r.method = "throw", r.arg = u.arg);
448
- }
449
- };
450
- }
451
- function j(t, e) {
452
- var r = t.iterator[e.method];
453
- if (void 0 === r) {
454
- if (e.delegate = null, "throw" === e.method) {
455
- if (t.iterator.return && (e.method = "return", e.arg = void 0, j(t, e), "throw" === e.method)) return l;
456
- e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
457
- }
458
- return l;
459
- }
460
- var n = p(r, t.iterator, e.arg);
461
- if ("throw" === n.type) return e.method = "throw", e.arg = n.arg, e.delegate = null, l;
462
- var o = n.arg;
463
- return o ? o.done ? (e[t.resultName] = o.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = void 0), e.delegate = null, l) : o : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, l);
464
- }
465
- function L(t) {
466
- var e = {
467
- tryLoc: t[0]
468
- };
469
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
470
- }
471
- function T(t) {
472
- var e = t.completion || {};
473
- e.type = "normal", delete e.arg, t.completion = e;
474
- }
475
- function S(t) {
476
- this.tryEntries = [{
477
- tryLoc: "root"
478
- }], t.forEach(L, this), this.reset(!0);
479
- }
480
- function O(t) {
481
- if (t) {
482
- var e = t[i];
483
- if (e) return e.call(t);
484
- if ("function" == typeof t.next) return t;
485
- if (!isNaN(t.length)) {
486
- var n = -1,
487
- o = function e() {
488
- for (; ++n < t.length;) if (r.call(t, n)) return e.value = t[n], e.done = !1, e;
489
- return e.value = void 0, e.done = !0, e;
490
- };
491
- return o.next = o;
492
- }
493
- }
494
- return {
495
- next: _
496
- };
497
- }
498
- function _() {
499
- return {
500
- value: void 0,
501
- done: !0
502
- };
503
- }
504
- return h.prototype = y, n(g, "constructor", {
505
- value: y,
506
- configurable: !0
507
- }), n(y, "constructor", {
508
- value: h,
509
- configurable: !0
510
- }), h.displayName = u(y, c, "GeneratorFunction"), t.isGeneratorFunction = function (t) {
511
- var e = "function" == typeof t && t.constructor;
512
- return !!e && (e === h || "GeneratorFunction" === (e.displayName || e.name));
513
- }, t.mark = function (t) {
514
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, y) : (t.__proto__ = y, u(t, c, "GeneratorFunction")), t.prototype = Object.create(g), t;
515
- }, t.awrap = function (t) {
516
- return {
517
- __await: t
518
- };
519
- }, w(b.prototype), u(b.prototype, a, function () {
520
- return this;
521
- }), t.AsyncIterator = b, t.async = function (e, r, n, o, i) {
522
- void 0 === i && (i = Promise);
523
- var a = new b(s(e, r, n, o), i);
524
- return t.isGeneratorFunction(r) ? a : a.next().then(function (t) {
525
- return t.done ? t.value : a.next();
526
- });
527
- }, w(g), u(g, c, "Generator"), u(g, i, function () {
528
- return this;
529
- }), u(g, "toString", function () {
530
- return "[object Generator]";
531
- }), t.keys = function (t) {
532
- var e = Object(t),
533
- r = [];
534
- for (var n in e) r.push(n);
535
- return r.reverse(), function t() {
536
- for (; r.length;) {
537
- var n = r.pop();
538
- if (n in e) return t.value = n, t.done = !1, t;
539
- }
540
- return t.done = !0, t;
541
- };
542
- }, t.values = O, S.prototype = {
543
- constructor: S,
544
- reset: function reset(t) {
545
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(T), !t) for (var e in this) "t" === e.charAt(0) && r.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0);
546
- },
547
- stop: function stop() {
548
- this.done = !0;
549
- var t = this.tryEntries[0].completion;
550
- if ("throw" === t.type) throw t.arg;
551
- return this.rval;
552
- },
553
- dispatchException: function dispatchException(t) {
554
- if (this.done) throw t;
555
- var e = this;
556
- function n(r, n) {
557
- return a.type = "throw", a.arg = t, e.next = r, n && (e.method = "next", e.arg = void 0), !!n;
558
- }
559
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
560
- var i = this.tryEntries[o],
561
- a = i.completion;
562
- if ("root" === i.tryLoc) return n("end");
563
- if (i.tryLoc <= this.prev) {
564
- var c = r.call(i, "catchLoc"),
565
- u = r.call(i, "finallyLoc");
566
- if (c && u) {
567
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
568
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
569
- } else if (c) {
570
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
571
- } else {
572
- if (!u) throw new Error("try statement without catch or finally");
573
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
574
- }
575
- }
576
- }
577
- },
578
- abrupt: function abrupt(t, e) {
579
- for (var n = this.tryEntries.length - 1; n >= 0; --n) {
580
- var o = this.tryEntries[n];
581
- if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
582
- var i = o;
583
- break;
584
- }
585
- }
586
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
587
- var a = i ? i.completion : {};
588
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, l) : this.complete(a);
589
- },
590
- complete: function complete(t, e) {
591
- if ("throw" === t.type) throw t.arg;
592
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), l;
593
- },
594
- finish: function finish(t) {
595
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
596
- var r = this.tryEntries[e];
597
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), T(r), l;
598
- }
599
- },
600
- catch: function _catch(t) {
601
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
602
- var r = this.tryEntries[e];
603
- if (r.tryLoc === t) {
604
- var n = r.completion;
605
- if ("throw" === n.type) {
606
- var o = n.arg;
607
- T(r);
608
- }
609
- return o;
610
- }
611
- }
612
- throw new Error("illegal catch attempt");
613
- },
614
- delegateYield: function delegateYield(t, e, r) {
615
- return this.delegate = {
616
- iterator: O(t),
617
- resultName: e,
618
- nextLoc: r
619
- }, "next" === this.method && (this.arg = void 0), l;
620
- }
621
- }, t;
622
- }
623
- function T(t, e, r, n, o, i, a) {
624
- try {
625
- var c = t[i](a),
626
- u = c.value;
627
- } catch (t) {
628
- return void r(t);
629
- }
630
- c.done ? e(u) : Promise.resolve(u).then(n, o);
631
- }
632
- function S(t) {
633
- return function () {
634
- var e = this,
635
- r = arguments;
636
- return new Promise(function (n, o) {
637
- var i = t.apply(e, r);
638
- function a(t) {
639
- T(i, n, o, a, c, "next", t);
640
- }
641
- function c(t) {
642
- T(i, n, o, a, c, "throw", t);
643
- }
644
- a(void 0);
645
- });
646
- };
647
- }
648
- function O(t, e) {
649
- for (var r = 0; r < e.length; r++) {
650
- var n = e[r];
651
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
652
- }
653
- }
654
- function _(t, e) {
655
- !function (t, e) {
656
- if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
657
- }(t, e), e.add(t);
658
- }
659
- function U(t, e, r) {
660
- if (!e.has(t)) throw new TypeError("attempted to get private field on non-instance");
661
- return r;
662
- }
663
- var P = new WeakSet(),
664
- C = new WeakSet(),
665
- I = function () {
666
- function t() {
667
- !function (t, e) {
668
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
669
- }(this, t), _(this, C), _(this, P);
670
- }
671
- var e, r, n, o, i, a, c;
672
- return e = t, r = [{
673
- key: "get",
674
- value: (c = S(E().mark(function t(e, r) {
675
- var n;
676
- return E().wrap(function (t) {
677
- for (;;) switch (t.prev = t.next) {
678
- case 0:
679
- return t.next = 2, j().Command.HttpClient.Get({
680
- AllowInsecureHTTPS: "True",
681
- Header: U(this, P, R).call(this, r),
682
- Url: e,
683
- ResultBody: "PlainText"
684
- });
685
- case 2:
686
- return n = t.sent, t.abrupt("return", U(this, C, A).call(this, n));
687
- case 4:
688
- case "end":
689
- return t.stop();
690
- }
691
- }, t, this);
692
- })), function (t, e) {
693
- return c.apply(this, arguments);
694
- })
695
- }, {
696
- key: "post",
697
- value: (a = S(E().mark(function t(e) {
698
- var r,
699
- n,
700
- o,
701
- i = arguments;
702
- return E().wrap(function (t) {
703
- for (;;) switch (t.prev = t.next) {
704
- case 0:
705
- return r = i.length > 1 && void 0 !== i[1] ? i[1] : {}, n = i.length > 2 && void 0 !== i[2] ? i[2] : {}, t.next = 4, j().Command.HttpClient.Post({
706
- AllowInsecureHTTPS: "True",
707
- Header: U(this, P, R).call(this, n),
708
- Url: e,
709
- ResultBody: "PlainText"
710
- }, JSON.stringify(r));
711
- case 4:
712
- return o = t.sent, t.abrupt("return", U(this, C, A).call(this, o));
713
- case 6:
714
- case "end":
715
- return t.stop();
716
- }
717
- }, t, this);
718
- })), function (t) {
719
- return a.apply(this, arguments);
720
- })
721
- }, {
722
- key: "patch",
723
- value: (i = S(E().mark(function t(e) {
724
- var r,
725
- n,
726
- o,
727
- i = arguments;
728
- return E().wrap(function (t) {
729
- for (;;) switch (t.prev = t.next) {
730
- case 0:
731
- return r = i.length > 1 && void 0 !== i[1] ? i[1] : {}, n = i.length > 2 && void 0 !== i[2] ? i[2] : {}, t.next = 4, j().Command.HttpClient.Patch({
732
- AllowInsecureHTTPS: "True",
733
- Header: U(this, P, R).call(this, n),
734
- Url: e,
735
- ResultBody: "PlainText"
736
- }, JSON.stringify(r));
737
- case 4:
738
- return o = t.sent, t.abrupt("return", U(this, C, A).call(this, o));
739
- case 6:
740
- case "end":
741
- return t.stop();
742
- }
743
- }, t, this);
744
- })), function (t) {
745
- return i.apply(this, arguments);
746
- })
747
- }, {
748
- key: "put",
749
- value: (o = S(E().mark(function t(e) {
750
- var r,
751
- n,
752
- o,
753
- i = arguments;
754
- return E().wrap(function (t) {
755
- for (;;) switch (t.prev = t.next) {
756
- case 0:
757
- return r = i.length > 1 && void 0 !== i[1] ? i[1] : {}, n = i.length > 2 && void 0 !== i[2] ? i[2] : {}, t.next = 4, j().Command.HttpClient.Put({
758
- AllowInsecureHTTPS: "True",
759
- Header: U(this, P, R).call(this, n),
760
- Url: e,
761
- ResultBody: "PlainText"
762
- }, JSON.stringify(r));
763
- case 4:
764
- return o = t.sent, t.abrupt("return", U(this, C, A).call(this, o));
765
- case 6:
766
- case "end":
767
- return t.stop();
768
- }
769
- }, t, this);
770
- })), function (t) {
771
- return o.apply(this, arguments);
772
- })
773
- }, {
774
- key: "delete",
775
- value: (n = S(E().mark(function t(e) {
776
- var r,
777
- n,
778
- o = arguments;
779
- return E().wrap(function (t) {
780
- for (;;) switch (t.prev = t.next) {
781
- case 0:
782
- return r = o.length > 1 && void 0 !== o[1] ? o[1] : {}, t.next = 3, j().Command.HttpClient.Delete({
783
- AllowInsecureHTTPS: "True",
784
- Header: U(this, P, R).call(this, r),
785
- Url: e,
786
- ResultBody: "PlainText"
787
- });
788
- case 3:
789
- return n = t.sent, t.abrupt("return", U(this, C, A).call(this, n));
790
- case 5:
791
- case "end":
792
- return t.stop();
793
- }
794
- }, t, this);
795
- })), function (t) {
796
- return n.apply(this, arguments);
797
- })
798
- }], r && O(e.prototype, r), Object.defineProperty(e, "prototype", {
799
- writable: !1
800
- }), t;
801
- }();
802
- function R(t) {
803
- for (var e = [], r = 0, n = Object.entries(t); r < n.length; r++) {
804
- var o = (c = n[r], u = 2, function (t) {
805
- if (Array.isArray(t)) return t;
806
- }(c) || function (t, e) {
807
- var r = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
808
- if (null != r) {
809
- var n,
810
- o,
811
- i = [],
812
- a = !0,
813
- c = !1;
814
- try {
815
- for (r = r.call(t); !(a = (n = r.next()).done) && (i.push(n.value), !e || i.length !== e); a = !0);
816
- } catch (t) {
817
- c = !0, o = t;
818
- } finally {
819
- try {
820
- a || null == r.return || r.return();
821
- } finally {
822
- if (c) throw o;
823
- }
824
- }
825
- return i;
826
- }
827
- }(c, u) || function (t, e) {
828
- if (t) {
829
- if ("string" == typeof t) return L(t, e);
830
- var r = Object.prototype.toString.call(t).slice(8, -1);
831
- return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? L(t, e) : void 0;
832
- }
833
- }(c, u) || function () {
834
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
835
- }()),
836
- i = o[0],
837
- a = o[1];
838
- e.push("".concat(i, ": ").concat(a));
839
- }
840
- var c, u;
841
- return e;
842
- }
843
- function A(t) {
844
- var e = t;
845
- return e.data = JSON.parse(e.Body), delete e.Body, e;
846
- }
847
- global.globalThis = {}, global.globalThis.http = new I();
848
- var B = globalThis.http;
849
- function N(t) {
850
- return N = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
851
- return typeof t;
852
- } : function (t) {
853
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
854
- }, N(t);
855
- }
856
- function G() {
857
- G = function G() {
858
- return t;
859
- };
860
- var t = {},
861
- e = Object.prototype,
862
- r = e.hasOwnProperty,
863
- n = Object.defineProperty || function (t, e, r) {
864
- t[e] = r.value;
865
- },
866
- o = "function" == typeof Symbol ? Symbol : {},
867
- i = o.iterator || "@@iterator",
868
- a = o.asyncIterator || "@@asyncIterator",
869
- c = o.toStringTag || "@@toStringTag";
870
- function u(t, e, r) {
871
- return Object.defineProperty(t, e, {
872
- value: r,
873
- enumerable: !0,
874
- configurable: !0,
875
- writable: !0
876
- }), t[e];
877
- }
878
- try {
879
- u({}, "");
880
- } catch (t) {
881
- u = function u(t, e, r) {
882
- return t[e] = r;
883
- };
884
- }
885
- function s(t, e, r, o) {
886
- var i = e && e.prototype instanceof f ? e : f,
887
- a = Object.create(i.prototype),
888
- c = new E(o || []);
889
- return n(a, "_invoke", {
890
- value: x(t, r, c)
891
- }), a;
892
- }
893
- function p(t, e, r) {
894
- try {
895
- return {
896
- type: "normal",
897
- arg: t.call(e, r)
898
- };
899
- } catch (t) {
900
- return {
901
- type: "throw",
902
- arg: t
903
- };
904
- }
905
- }
906
- t.wrap = s;
907
- var l = {};
908
- function f() {}
909
- function h() {}
910
- function y() {}
911
- var v = {};
912
- u(v, i, function () {
913
- return this;
914
- });
915
- var d = Object.getPrototypeOf,
916
- m = d && d(d(T([])));
917
- m && m !== e && r.call(m, i) && (v = m);
918
- var g = y.prototype = f.prototype = Object.create(v);
919
- function w(t) {
920
- ["next", "throw", "return"].forEach(function (e) {
921
- u(t, e, function (t) {
922
- return this._invoke(e, t);
923
- });
924
- });
925
- }
926
- function b(t, e) {
927
- function o(n, i, a, c) {
928
- var u = p(t[n], t, i);
929
- if ("throw" !== u.type) {
930
- var s = u.arg,
931
- l = s.value;
932
- return l && "object" == N(l) && r.call(l, "__await") ? e.resolve(l.__await).then(function (t) {
933
- o("next", t, a, c);
934
- }, function (t) {
935
- o("throw", t, a, c);
936
- }) : e.resolve(l).then(function (t) {
937
- s.value = t, a(s);
938
- }, function (t) {
939
- return o("throw", t, a, c);
940
- });
941
- }
942
- c(u.arg);
943
- }
944
- var i;
945
- n(this, "_invoke", {
946
- value: function value(t, r) {
947
- function n() {
948
- return new e(function (e, n) {
949
- o(t, r, e, n);
950
- });
951
- }
952
- return i = i ? i.then(n, n) : n();
953
- }
954
- });
955
- }
956
- function x(t, e, r) {
957
- var n = "suspendedStart";
958
- return function (o, i) {
959
- if ("executing" === n) throw new Error("Generator is already running");
960
- if ("completed" === n) {
961
- if ("throw" === o) throw i;
962
- return {
963
- value: void 0,
964
- done: !0
965
- };
966
- }
967
- for (r.method = o, r.arg = i;;) {
968
- var a = r.delegate;
969
- if (a) {
970
- var c = j(a, r);
971
- if (c) {
972
- if (c === l) continue;
973
- return c;
974
- }
975
- }
976
- if ("next" === r.method) r.sent = r._sent = r.arg;else if ("throw" === r.method) {
977
- if ("suspendedStart" === n) throw n = "completed", r.arg;
978
- r.dispatchException(r.arg);
979
- } else "return" === r.method && r.abrupt("return", r.arg);
980
- n = "executing";
981
- var u = p(t, e, r);
982
- if ("normal" === u.type) {
983
- if (n = r.done ? "completed" : "suspendedYield", u.arg === l) continue;
984
- return {
985
- value: u.arg,
986
- done: r.done
987
- };
988
- }
989
- "throw" === u.type && (n = "completed", r.method = "throw", r.arg = u.arg);
990
- }
991
- };
992
- }
993
- function j(t, e) {
994
- var r = t.iterator[e.method];
995
- if (void 0 === r) {
996
- if (e.delegate = null, "throw" === e.method) {
997
- if (t.iterator.return && (e.method = "return", e.arg = void 0, j(t, e), "throw" === e.method)) return l;
998
- e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
999
- }
1000
- return l;
1001
- }
1002
- var n = p(r, t.iterator, e.arg);
1003
- if ("throw" === n.type) return e.method = "throw", e.arg = n.arg, e.delegate = null, l;
1004
- var o = n.arg;
1005
- return o ? o.done ? (e[t.resultName] = o.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = void 0), e.delegate = null, l) : o : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, l);
1006
- }
1007
- function k(t) {
1008
- var e = {
1009
- tryLoc: t[0]
1010
- };
1011
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
1012
- }
1013
- function L(t) {
1014
- var e = t.completion || {};
1015
- e.type = "normal", delete e.arg, t.completion = e;
1016
- }
1017
- function E(t) {
1018
- this.tryEntries = [{
1019
- tryLoc: "root"
1020
- }], t.forEach(k, this), this.reset(!0);
1021
- }
1022
- function T(t) {
1023
- if (t) {
1024
- var e = t[i];
1025
- if (e) return e.call(t);
1026
- if ("function" == typeof t.next) return t;
1027
- if (!isNaN(t.length)) {
1028
- var n = -1,
1029
- o = function e() {
1030
- for (; ++n < t.length;) if (r.call(t, n)) return e.value = t[n], e.done = !1, e;
1031
- return e.value = void 0, e.done = !0, e;
1032
- };
1033
- return o.next = o;
1034
- }
1035
- }
1036
- return {
1037
- next: S
1038
- };
1039
- }
1040
- function S() {
1041
- return {
1042
- value: void 0,
1043
- done: !0
1044
- };
1045
- }
1046
- return h.prototype = y, n(g, "constructor", {
1047
- value: y,
1048
- configurable: !0
1049
- }), n(y, "constructor", {
1050
- value: h,
1051
- configurable: !0
1052
- }), h.displayName = u(y, c, "GeneratorFunction"), t.isGeneratorFunction = function (t) {
1053
- var e = "function" == typeof t && t.constructor;
1054
- return !!e && (e === h || "GeneratorFunction" === (e.displayName || e.name));
1055
- }, t.mark = function (t) {
1056
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, y) : (t.__proto__ = y, u(t, c, "GeneratorFunction")), t.prototype = Object.create(g), t;
1057
- }, t.awrap = function (t) {
1058
- return {
1059
- __await: t
1060
- };
1061
- }, w(b.prototype), u(b.prototype, a, function () {
1062
- return this;
1063
- }), t.AsyncIterator = b, t.async = function (e, r, n, o, i) {
1064
- void 0 === i && (i = Promise);
1065
- var a = new b(s(e, r, n, o), i);
1066
- return t.isGeneratorFunction(r) ? a : a.next().then(function (t) {
1067
- return t.done ? t.value : a.next();
1068
- });
1069
- }, w(g), u(g, c, "Generator"), u(g, i, function () {
1070
- return this;
1071
- }), u(g, "toString", function () {
1072
- return "[object Generator]";
1073
- }), t.keys = function (t) {
1074
- var e = Object(t),
1075
- r = [];
1076
- for (var n in e) r.push(n);
1077
- return r.reverse(), function t() {
1078
- for (; r.length;) {
1079
- var n = r.pop();
1080
- if (n in e) return t.value = n, t.done = !1, t;
1081
- }
1082
- return t.done = !0, t;
1083
- };
1084
- }, t.values = T, E.prototype = {
1085
- constructor: E,
1086
- reset: function reset(t) {
1087
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(L), !t) for (var e in this) "t" === e.charAt(0) && r.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0);
1088
- },
1089
- stop: function stop() {
1090
- this.done = !0;
1091
- var t = this.tryEntries[0].completion;
1092
- if ("throw" === t.type) throw t.arg;
1093
- return this.rval;
1094
- },
1095
- dispatchException: function dispatchException(t) {
1096
- if (this.done) throw t;
1097
- var e = this;
1098
- function n(r, n) {
1099
- return a.type = "throw", a.arg = t, e.next = r, n && (e.method = "next", e.arg = void 0), !!n;
1100
- }
1101
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
1102
- var i = this.tryEntries[o],
1103
- a = i.completion;
1104
- if ("root" === i.tryLoc) return n("end");
1105
- if (i.tryLoc <= this.prev) {
1106
- var c = r.call(i, "catchLoc"),
1107
- u = r.call(i, "finallyLoc");
1108
- if (c && u) {
1109
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
1110
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
1111
- } else if (c) {
1112
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
1113
- } else {
1114
- if (!u) throw new Error("try statement without catch or finally");
1115
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
1116
- }
1117
- }
1118
- }
1119
- },
1120
- abrupt: function abrupt(t, e) {
1121
- for (var n = this.tryEntries.length - 1; n >= 0; --n) {
1122
- var o = this.tryEntries[n];
1123
- if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
1124
- var i = o;
1125
- break;
1126
- }
1127
- }
1128
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
1129
- var a = i ? i.completion : {};
1130
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, l) : this.complete(a);
1131
- },
1132
- complete: function complete(t, e) {
1133
- if ("throw" === t.type) throw t.arg;
1134
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), l;
1135
- },
1136
- finish: function finish(t) {
1137
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1138
- var r = this.tryEntries[e];
1139
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), L(r), l;
1140
- }
1141
- },
1142
- catch: function _catch(t) {
1143
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1144
- var r = this.tryEntries[e];
1145
- if (r.tryLoc === t) {
1146
- var n = r.completion;
1147
- if ("throw" === n.type) {
1148
- var o = n.arg;
1149
- L(r);
1150
- }
1151
- return o;
1152
- }
1153
- }
1154
- throw new Error("illegal catch attempt");
1155
- },
1156
- delegateYield: function delegateYield(t, e, r) {
1157
- return this.delegate = {
1158
- iterator: T(t),
1159
- resultName: e,
1160
- nextLoc: r
1161
- }, "next" === this.method && (this.arg = void 0), l;
1162
- }
1163
- }, t;
1164
- }
1165
- function M(t, e, r, n, o, i, a) {
1166
- try {
1167
- var c = t[i](a),
1168
- u = c.value;
1169
- } catch (t) {
1170
- return void r(t);
1171
- }
1172
- c.done ? e(u) : Promise.resolve(u).then(n, o);
1173
- }
1174
- function F(t) {
1175
- return function () {
1176
- var e = this,
1177
- r = arguments;
1178
- return new Promise(function (n, o) {
1179
- var i = t.apply(e, r);
1180
- function a(t) {
1181
- M(i, n, o, a, c, "next", t);
1182
- }
1183
- function c(t) {
1184
- M(i, n, o, a, c, "throw", t);
1185
- }
1186
- a(void 0);
1187
- });
1188
- };
1189
- }
1190
- function q(t, e) {
1191
- for (var r = 0; r < e.length; r++) {
1192
- var n = e[r];
1193
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
1194
- }
1195
- }
1196
- function D(t, e) {
1197
- H(t, e), e.add(t);
1198
- }
1199
- function H(t, e) {
1200
- if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
1201
- }
1202
- function J(t, e, r) {
1203
- if (!e.has(t)) throw new TypeError("attempted to get private field on non-instance");
1204
- return r;
1205
- }
1206
- function Y(t, e) {
1207
- return function (t, e) {
1208
- return e.get ? e.get.call(t) : e.value;
1209
- }(t, K(t, e, "get"));
1210
- }
1211
- function K(t, e, r) {
1212
- if (!e.has(t)) throw new TypeError("attempted to " + r + " private field on non-instance");
1213
- return e.get(t);
1214
- }
1215
- var W = new WeakMap(),
1216
- z = new WeakSet(),
1217
- X = new WeakSet(),
1218
- $ = new WeakSet();
1219
- function Q(t) {
1220
- return V.apply(this, arguments);
1221
- }
1222
- function V() {
1223
- return (V = F(G().mark(function t(e) {
1224
- var r, o, i, a, c, u;
1225
- return G().wrap(function (t) {
1226
- for (;;) switch (t.prev = t.next) {
1227
- case 0:
1228
- r = e.expiry, o = e.accessLevel, i = {
1229
- "Content-Type": "application/json",
1230
- Accept: "application/json"
1231
- }, a = {
1232
- api_key: this.apiKey,
1233
- expiry: {
1234
- seconds: r
1235
- }
1236
- }, t.t0 = o, t.next = t.t0 === m ? 6 : t.t0 === g ? 8 : 10;
1237
- break;
1238
- case 6:
1239
- return c = "".concat(n.apiBaseURL, "/v1/admin/auth/token"), t.abrupt("break", 12);
1240
- case 8:
1241
- return c = "".concat(n.apiBaseURL, "/v1/superadmin/auth/token"), t.abrupt("break", 12);
1242
- case 10:
1243
- return c = "".concat(n.apiBaseURL, "/v1/auth/token"), t.abrupt("break", 12);
1244
- case 12:
1245
- return t.next = 14, B.post(c, a, i);
1246
- case 14:
1247
- return u = t.sent, t.abrupt("return", u.data.token);
1248
- case 16:
1249
- case "end":
1250
- return t.stop();
1251
- }
1252
- }, t, this);
1253
- }))).apply(this, arguments);
1254
- }
1255
- function Z(t) {
1256
- return tt.apply(this, arguments);
1257
- }
1258
- function tt() {
1259
- return (tt = F(G().mark(function t(e) {
1260
- var r, o, i, a, c, u;
1261
- return G().wrap(function (t) {
1262
- for (;;) switch (t.prev = t.next) {
1263
- case 0:
1264
- return r = e.expiry, o = e.accessLevel, t.next = 3, this.getIdToken();
1265
- case 3:
1266
- t.t0 = t.sent, i = {
1267
- "Content-Type": "application/json",
1268
- Accept: "application/json",
1269
- "x-jibb-id-jwt": t.t0
1270
- }, a = {
1271
- expiry: {
1272
- seconds: r
1273
- }
1274
- }, t.t1 = o, t.next = t.t1 === m ? 9 : t.t1 === g ? 11 : 13;
1275
- break;
1276
- case 9:
1277
- return c = "".concat(n.apiBaseURL, "/v1/admin/auth/token"), t.abrupt("break", 15);
1278
- case 11:
1279
- return c = "".concat(n.apiBaseURL, "/v1/superadmin/auth/token"), t.abrupt("break", 15);
1280
- case 13:
1281
- return c = "".concat(n.apiBaseURL, "/v1/auth/token"), t.abrupt("break", 15);
1282
- case 15:
1283
- return t.next = 17, B.post(c, a, i);
1284
- case 17:
1285
- return u = t.sent, t.abrupt("return", u.data.token);
1286
- case 19:
1287
- case "end":
1288
- return t.stop();
1289
- }
1290
- }, t, this);
1291
- }))).apply(this, arguments);
1292
- }
1293
- function et(t) {
1294
- return rt.apply(this, arguments);
1295
- }
1296
- function rt() {
1297
- return (rt = F(G().mark(function t(e) {
1298
- var r, n, o, i;
1299
- return G().wrap(function (t) {
1300
- for (;;) switch (t.prev = t.next) {
1301
- case 0:
1302
- if (r = e.expiry, n = e.accessLevel, !this.apiKey) {
1303
- t.next = 7;
1304
- break;
1305
- }
1306
- return t.next = 4, J(this, z, Q).call(this, {
1307
- expiry: r,
1308
- accessLevel: n
1309
- });
1310
- case 4:
1311
- return o = t.sent, this.setUserToken(o, n), t.abrupt("return", o);
1312
- case 7:
1313
- return t.prev = 7, t.next = 10, J(this, X, Z).call(this, {
1314
- expiry: r,
1315
- accessLevel: n
1316
- });
1317
- case 10:
1318
- return i = t.sent, this.setUserToken(i, n), t.abrupt("return", i);
1319
- case 15:
1320
- t.prev = 15, t.t0 = t.catch(7), c.error(t.t0);
1321
- case 18:
1322
- case "end":
1323
- return t.stop();
1324
- }
1325
- }, t, this, [[7, 15]]);
1326
- }))).apply(this, arguments);
1327
- }
1328
- var nt = new (function () {
1329
- function t() {
1330
- var e, r;
1331
- !function (t, e) {
1332
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
1333
- }(this, t), D(this, $), D(this, X), D(this, z), r = {
1334
- writable: !0,
1335
- value: void 0
1336
- }, H(this, e = W), e.set(this, r), c.debug("Creating new Auth instance"), this.apiKey = void 0, function (t, e, r) {
1337
- (function (t, e, r) {
1338
- if (e.set) e.set.call(t, r);else {
1339
- if (!e.writable) throw new TypeError("attempted to set read only private field");
1340
- e.value = r;
1341
- }
1342
- })(t, K(t, e, "set"), r);
1343
- }(this, W, new Map()), this.getIdToken = void 0;
1344
- }
1345
- var e, r, o, i, a, u;
1346
- return e = t, r = [{
1347
- key: "setUserToken",
1348
- value: function value(t) {
1349
- var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : d,
1350
- r = new b(t);
1351
- Y(this, W).set(e, r);
1352
- }
1353
- }, {
1354
- key: "setApiKey",
1355
- value: function value(t) {
1356
- this.apiKey = t, Y(this, W).clear();
1357
- }
1358
- }, {
1359
- key: "getUserClaims",
1360
- value: (u = F(G().mark(function t() {
1361
- return G().wrap(function (t) {
1362
- for (;;) switch (t.prev = t.next) {
1363
- case 0:
1364
- return t.next = 2, this.getUserToken();
1365
- case 2:
1366
- return t.abrupt("return", Y(this, W).get(d));
1367
- case 3:
1368
- case "end":
1369
- return t.stop();
1370
- }
1371
- }, t, this);
1372
- })), function () {
1373
- return u.apply(this, arguments);
1374
- })
1375
- }, {
1376
- key: "getUserToken",
1377
- value: (a = F(G().mark(function t() {
1378
- var e,
1379
- r,
1380
- n,
1381
- o,
1382
- i,
1383
- a = arguments;
1384
- return G().wrap(function (t) {
1385
- for (;;) switch (t.prev = t.next) {
1386
- case 0:
1387
- if (e = a.length > 0 && void 0 !== a[0] ? a[0] : {}, r = e.expiry, n = e.refresh, o = e.accessLevel, i = void 0, o = o || d, r = r || 3600, !0 !== (n = n || !1)) {
1388
- t.next = 8;
1389
- break;
1390
- }
1391
- return t.next = 8, J(this, $, et).call(this, {
1392
- expiry: r,
1393
- accessLevel: o
1394
- });
1395
- case 8:
1396
- if (void 0 === (i = Y(this, W).get(o)) || i.isExpired()) {
1397
- t.next = 11;
1398
- break;
1399
- }
1400
- return t.abrupt("return", i.token);
1401
- case 11:
1402
- return t.next = 13, J(this, $, et).call(this, {
1403
- expiry: r,
1404
- accessLevel: o
1405
- });
1406
- case 13:
1407
- if (void 0 === (i = Y(this, W).get(o)) || i.isExpired()) {
1408
- t.next = 16;
1409
- break;
1410
- }
1411
- return t.abrupt("return", i.token);
1412
- case 16:
1413
- throw new Error("could not create user token");
1414
- case 17:
1415
- case "end":
1416
- return t.stop();
1417
- }
1418
- }, t, this);
1419
- })), function () {
1420
- return a.apply(this, arguments);
1421
- })
1422
- }, {
1423
- key: "logout",
1424
- value: function value() {
1425
- Y(this, W).clear();
1426
- }
1427
- }, {
1428
- key: "generateAPIKey",
1429
- value: (i = F(G().mark(function t() {
1430
- var e, r;
1431
- return G().wrap(function (t) {
1432
- for (;;) switch (t.prev = t.next) {
1433
- case 0:
1434
- return t.next = 2, this.getUserToken();
1435
- case 2:
1436
- return t.t0 = t.sent, e = {
1437
- "Content-Type": "application/json",
1438
- Accept: "application/json",
1439
- "x-jibb-user-jwt": t.t0
1440
- }, t.next = 6, B.get("".concat(n.apiBaseURL, "/v1/auth/apikey"), e);
1441
- case 6:
1442
- return r = t.sent, t.abrupt("return", r.data.apiKey);
1443
- case 8:
1444
- case "end":
1445
- return t.stop();
1446
- }
1447
- }, t, this);
1448
- })), function () {
1449
- return i.apply(this, arguments);
1450
- })
1451
- }, {
1452
- key: "generateCustomAuthPassword",
1453
- value: (o = F(G().mark(function t() {
1454
- var e, r;
1455
- return G().wrap(function (t) {
1456
- for (;;) switch (t.prev = t.next) {
1457
- case 0:
1458
- return t.next = 2, this.getIdToken();
1459
- case 2:
1460
- return t.t0 = t.sent, e = {
1461
- "Content-Type": "application/json",
1462
- Accept: "application/json",
1463
- "x-jibb-id-jwt": t.t0
1464
- }, t.next = 6, B.get("".concat(n.apiBaseURL, "/v1/auth/custom"), e);
1465
- case 6:
1466
- return r = t.sent, t.abrupt("return", r.data.password);
1467
- case 8:
1468
- case "end":
1469
- return t.stop();
1470
- }
1471
- }, t, this);
1472
- })), function () {
1473
- return o.apply(this, arguments);
1474
- })
1475
- }], r && q(e.prototype, r), Object.defineProperty(e, "prototype", {
1476
- writable: !1
1477
- }), t;
1478
- }())();
1479
- function ot(t) {
1480
- return ot = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
1481
- return typeof t;
1482
- } : function (t) {
1483
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
1484
- }, ot(t);
1485
- }
1486
- function it(t, e) {
1487
- for (var r = 0; r < e.length; r++) {
1488
- var n = e[r];
1489
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
1490
- }
1491
- }
1492
- function at(t, e, r) {
1493
- return e && it(t.prototype, e), r && it(t, r), Object.defineProperty(t, "prototype", {
1494
- writable: !1
1495
- }), t;
1496
- }
1497
- function ct(t, e) {
1498
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
1499
- }
1500
- function ut(t, e) {
1501
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
1502
- t.prototype = Object.create(e && e.prototype, {
1503
- constructor: {
1504
- value: t,
1505
- writable: !0,
1506
- configurable: !0
1507
- }
1508
- }), Object.defineProperty(t, "prototype", {
1509
- writable: !1
1510
- }), e && yt(t, e);
1511
- }
1512
- function st(t) {
1513
- var e = ht();
1514
- return function () {
1515
- var r,
1516
- n = vt(t);
1517
- if (e) {
1518
- var o = vt(this).constructor;
1519
- r = Reflect.construct(n, arguments, o);
1520
- } else r = n.apply(this, arguments);
1521
- return pt(this, r);
1522
- };
1523
- }
1524
- function pt(t, e) {
1525
- if (e && ("object" === ot(e) || "function" == typeof e)) return e;
1526
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
1527
- return function (t) {
1528
- if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1529
- return t;
1530
- }(t);
1531
- }
1532
- function lt(t) {
1533
- var e = "function" == typeof Map ? new Map() : void 0;
1534
- return lt = function lt(t) {
1535
- if (null === t || (r = t, -1 === Function.toString.call(r).indexOf("[native code]"))) return t;
1536
- var r;
1537
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
1538
- if (void 0 !== e) {
1539
- if (e.has(t)) return e.get(t);
1540
- e.set(t, n);
1541
- }
1542
- function n() {
1543
- return ft(t, arguments, vt(this).constructor);
1544
- }
1545
- return n.prototype = Object.create(t.prototype, {
1546
- constructor: {
1547
- value: n,
1548
- enumerable: !1,
1549
- writable: !0,
1550
- configurable: !0
1551
- }
1552
- }), yt(n, t);
1553
- }, lt(t);
1554
- }
1555
- function ft(t, e, r) {
1556
- return ft = ht() ? Reflect.construct.bind() : function (t, e, r) {
1557
- var n = [null];
1558
- n.push.apply(n, e);
1559
- var o = new (Function.bind.apply(t, n))();
1560
- return r && yt(o, r.prototype), o;
1561
- }, ft.apply(null, arguments);
1562
- }
1563
- function ht() {
1564
- if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
1565
- if (Reflect.construct.sham) return !1;
1566
- if ("function" == typeof Proxy) return !0;
1567
- try {
1568
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
1569
- } catch (t) {
1570
- return !1;
1571
- }
1572
- }
1573
- function yt(t, e) {
1574
- return yt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
1575
- return t.__proto__ = e, t;
1576
- }, yt(t, e);
1577
- }
1578
- function vt(t) {
1579
- return vt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
1580
- return t.__proto__ || Object.getPrototypeOf(t);
1581
- }, vt(t);
1582
- }
1583
- var dt = function (t) {
1584
- ut(r, t);
1585
- var e = st(r);
1586
- function r(t) {
1587
- var n;
1588
- return ct(this, r), (n = e.call(this, t)).name = "NotFoundError", n;
1589
- }
1590
- return at(r);
1591
- }(lt(Error)),
1592
- mt = (Error, Error, Error, Error, function (t) {
1593
- ut(r, t);
1594
- var e = st(r);
1595
- function r(t) {
1596
- var n;
1597
- return ct(this, r), (n = e.call(this, t)).name = "PermissionDeniedError", n;
1598
- }
1599
- return at(r);
1600
- }(lt(Error)));
1601
- function gt(t) {
1602
- return gt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
1603
- return typeof t;
1604
- } : function (t) {
1605
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
1606
- }, gt(t);
1607
- }
1608
- function wt() {
1609
- wt = function wt() {
1610
- return t;
1611
- };
1612
- var t = {},
1613
- e = Object.prototype,
1614
- r = e.hasOwnProperty,
1615
- n = Object.defineProperty || function (t, e, r) {
1616
- t[e] = r.value;
1617
- },
1618
- o = "function" == typeof Symbol ? Symbol : {},
1619
- i = o.iterator || "@@iterator",
1620
- a = o.asyncIterator || "@@asyncIterator",
1621
- c = o.toStringTag || "@@toStringTag";
1622
- function u(t, e, r) {
1623
- return Object.defineProperty(t, e, {
1624
- value: r,
1625
- enumerable: !0,
1626
- configurable: !0,
1627
- writable: !0
1628
- }), t[e];
1629
- }
1630
- try {
1631
- u({}, "");
1632
- } catch (t) {
1633
- u = function u(t, e, r) {
1634
- return t[e] = r;
1635
- };
1636
- }
1637
- function s(t, e, r, o) {
1638
- var i = e && e.prototype instanceof f ? e : f,
1639
- a = Object.create(i.prototype),
1640
- c = new E(o || []);
1641
- return n(a, "_invoke", {
1642
- value: x(t, r, c)
1643
- }), a;
1644
- }
1645
- function p(t, e, r) {
1646
- try {
1647
- return {
1648
- type: "normal",
1649
- arg: t.call(e, r)
1650
- };
1651
- } catch (t) {
1652
- return {
1653
- type: "throw",
1654
- arg: t
1655
- };
1656
- }
1657
- }
1658
- t.wrap = s;
1659
- var l = {};
1660
- function f() {}
1661
- function h() {}
1662
- function y() {}
1663
- var v = {};
1664
- u(v, i, function () {
1665
- return this;
1666
- });
1667
- var d = Object.getPrototypeOf,
1668
- m = d && d(d(T([])));
1669
- m && m !== e && r.call(m, i) && (v = m);
1670
- var g = y.prototype = f.prototype = Object.create(v);
1671
- function w(t) {
1672
- ["next", "throw", "return"].forEach(function (e) {
1673
- u(t, e, function (t) {
1674
- return this._invoke(e, t);
1675
- });
1676
- });
1677
- }
1678
- function b(t, e) {
1679
- function o(n, i, a, c) {
1680
- var u = p(t[n], t, i);
1681
- if ("throw" !== u.type) {
1682
- var s = u.arg,
1683
- l = s.value;
1684
- return l && "object" == gt(l) && r.call(l, "__await") ? e.resolve(l.__await).then(function (t) {
1685
- o("next", t, a, c);
1686
- }, function (t) {
1687
- o("throw", t, a, c);
1688
- }) : e.resolve(l).then(function (t) {
1689
- s.value = t, a(s);
1690
- }, function (t) {
1691
- return o("throw", t, a, c);
1692
- });
1693
- }
1694
- c(u.arg);
1695
- }
1696
- var i;
1697
- n(this, "_invoke", {
1698
- value: function value(t, r) {
1699
- function n() {
1700
- return new e(function (e, n) {
1701
- o(t, r, e, n);
1702
- });
1703
- }
1704
- return i = i ? i.then(n, n) : n();
1705
- }
1706
- });
1707
- }
1708
- function x(t, e, r) {
1709
- var n = "suspendedStart";
1710
- return function (o, i) {
1711
- if ("executing" === n) throw new Error("Generator is already running");
1712
- if ("completed" === n) {
1713
- if ("throw" === o) throw i;
1714
- return {
1715
- value: void 0,
1716
- done: !0
1717
- };
1718
- }
1719
- for (r.method = o, r.arg = i;;) {
1720
- var a = r.delegate;
1721
- if (a) {
1722
- var c = j(a, r);
1723
- if (c) {
1724
- if (c === l) continue;
1725
- return c;
1726
- }
1727
- }
1728
- if ("next" === r.method) r.sent = r._sent = r.arg;else if ("throw" === r.method) {
1729
- if ("suspendedStart" === n) throw n = "completed", r.arg;
1730
- r.dispatchException(r.arg);
1731
- } else "return" === r.method && r.abrupt("return", r.arg);
1732
- n = "executing";
1733
- var u = p(t, e, r);
1734
- if ("normal" === u.type) {
1735
- if (n = r.done ? "completed" : "suspendedYield", u.arg === l) continue;
1736
- return {
1737
- value: u.arg,
1738
- done: r.done
1739
- };
1740
- }
1741
- "throw" === u.type && (n = "completed", r.method = "throw", r.arg = u.arg);
1742
- }
1743
- };
1744
- }
1745
- function j(t, e) {
1746
- var r = t.iterator[e.method];
1747
- if (void 0 === r) {
1748
- if (e.delegate = null, "throw" === e.method) {
1749
- if (t.iterator.return && (e.method = "return", e.arg = void 0, j(t, e), "throw" === e.method)) return l;
1750
- e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
1751
- }
1752
- return l;
1753
- }
1754
- var n = p(r, t.iterator, e.arg);
1755
- if ("throw" === n.type) return e.method = "throw", e.arg = n.arg, e.delegate = null, l;
1756
- var o = n.arg;
1757
- return o ? o.done ? (e[t.resultName] = o.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = void 0), e.delegate = null, l) : o : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, l);
1758
- }
1759
- function k(t) {
1760
- var e = {
1761
- tryLoc: t[0]
1762
- };
1763
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
1764
- }
1765
- function L(t) {
1766
- var e = t.completion || {};
1767
- e.type = "normal", delete e.arg, t.completion = e;
1768
- }
1769
- function E(t) {
1770
- this.tryEntries = [{
1771
- tryLoc: "root"
1772
- }], t.forEach(k, this), this.reset(!0);
1773
- }
1774
- function T(t) {
1775
- if (t) {
1776
- var e = t[i];
1777
- if (e) return e.call(t);
1778
- if ("function" == typeof t.next) return t;
1779
- if (!isNaN(t.length)) {
1780
- var n = -1,
1781
- o = function e() {
1782
- for (; ++n < t.length;) if (r.call(t, n)) return e.value = t[n], e.done = !1, e;
1783
- return e.value = void 0, e.done = !0, e;
1784
- };
1785
- return o.next = o;
1786
- }
1787
- }
1788
- return {
1789
- next: S
1790
- };
1791
- }
1792
- function S() {
1793
- return {
1794
- value: void 0,
1795
- done: !0
1796
- };
1797
- }
1798
- return h.prototype = y, n(g, "constructor", {
1799
- value: y,
1800
- configurable: !0
1801
- }), n(y, "constructor", {
1802
- value: h,
1803
- configurable: !0
1804
- }), h.displayName = u(y, c, "GeneratorFunction"), t.isGeneratorFunction = function (t) {
1805
- var e = "function" == typeof t && t.constructor;
1806
- return !!e && (e === h || "GeneratorFunction" === (e.displayName || e.name));
1807
- }, t.mark = function (t) {
1808
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, y) : (t.__proto__ = y, u(t, c, "GeneratorFunction")), t.prototype = Object.create(g), t;
1809
- }, t.awrap = function (t) {
1810
- return {
1811
- __await: t
1812
- };
1813
- }, w(b.prototype), u(b.prototype, a, function () {
1814
- return this;
1815
- }), t.AsyncIterator = b, t.async = function (e, r, n, o, i) {
1816
- void 0 === i && (i = Promise);
1817
- var a = new b(s(e, r, n, o), i);
1818
- return t.isGeneratorFunction(r) ? a : a.next().then(function (t) {
1819
- return t.done ? t.value : a.next();
1820
- });
1821
- }, w(g), u(g, c, "Generator"), u(g, i, function () {
1822
- return this;
1823
- }), u(g, "toString", function () {
1824
- return "[object Generator]";
1825
- }), t.keys = function (t) {
1826
- var e = Object(t),
1827
- r = [];
1828
- for (var n in e) r.push(n);
1829
- return r.reverse(), function t() {
1830
- for (; r.length;) {
1831
- var n = r.pop();
1832
- if (n in e) return t.value = n, t.done = !1, t;
1833
- }
1834
- return t.done = !0, t;
1835
- };
1836
- }, t.values = T, E.prototype = {
1837
- constructor: E,
1838
- reset: function reset(t) {
1839
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(L), !t) for (var e in this) "t" === e.charAt(0) && r.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0);
1840
- },
1841
- stop: function stop() {
1842
- this.done = !0;
1843
- var t = this.tryEntries[0].completion;
1844
- if ("throw" === t.type) throw t.arg;
1845
- return this.rval;
1846
- },
1847
- dispatchException: function dispatchException(t) {
1848
- if (this.done) throw t;
1849
- var e = this;
1850
- function n(r, n) {
1851
- return a.type = "throw", a.arg = t, e.next = r, n && (e.method = "next", e.arg = void 0), !!n;
1852
- }
1853
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
1854
- var i = this.tryEntries[o],
1855
- a = i.completion;
1856
- if ("root" === i.tryLoc) return n("end");
1857
- if (i.tryLoc <= this.prev) {
1858
- var c = r.call(i, "catchLoc"),
1859
- u = r.call(i, "finallyLoc");
1860
- if (c && u) {
1861
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
1862
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
1863
- } else if (c) {
1864
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
1865
- } else {
1866
- if (!u) throw new Error("try statement without catch or finally");
1867
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
1868
- }
1869
- }
1870
- }
1871
- },
1872
- abrupt: function abrupt(t, e) {
1873
- for (var n = this.tryEntries.length - 1; n >= 0; --n) {
1874
- var o = this.tryEntries[n];
1875
- if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
1876
- var i = o;
1877
- break;
1878
- }
1879
- }
1880
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
1881
- var a = i ? i.completion : {};
1882
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, l) : this.complete(a);
1883
- },
1884
- complete: function complete(t, e) {
1885
- if ("throw" === t.type) throw t.arg;
1886
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), l;
1887
- },
1888
- finish: function finish(t) {
1889
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1890
- var r = this.tryEntries[e];
1891
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), L(r), l;
1892
- }
1893
- },
1894
- catch: function _catch(t) {
1895
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1896
- var r = this.tryEntries[e];
1897
- if (r.tryLoc === t) {
1898
- var n = r.completion;
1899
- if ("throw" === n.type) {
1900
- var o = n.arg;
1901
- L(r);
1902
- }
1903
- return o;
1904
- }
1905
- }
1906
- throw new Error("illegal catch attempt");
1907
- },
1908
- delegateYield: function delegateYield(t, e, r) {
1909
- return this.delegate = {
1910
- iterator: T(t),
1911
- resultName: e,
1912
- nextLoc: r
1913
- }, "next" === this.method && (this.arg = void 0), l;
1914
- }
1915
- }, t;
1916
- }
1917
- function bt(t, e, r, n, o, i, a) {
1918
- try {
1919
- var c = t[i](a),
1920
- u = c.value;
1921
- } catch (t) {
1922
- return void r(t);
1923
- }
1924
- c.done ? e(u) : Promise.resolve(u).then(n, o);
1925
- }
1926
- function xt(t) {
1927
- return function () {
1928
- var e = this,
1929
- r = arguments;
1930
- return new Promise(function (n, o) {
1931
- var i = t.apply(e, r);
1932
- function a(t) {
1933
- bt(i, n, o, a, c, "next", t);
1934
- }
1935
- function c(t) {
1936
- bt(i, n, o, a, c, "throw", t);
1937
- }
1938
- a(void 0);
1939
- });
1940
- };
1941
- }
1942
- function jt(t) {
1943
- return kt.apply(this, arguments);
1944
- }
1945
- function kt() {
1946
- return (kt = xt(wt().mark(function t(e) {
1947
- var r, o, i, a, c, u, s;
1948
- return wt().wrap(function (t) {
1949
- for (;;) switch (t.prev = t.next) {
1950
- case 0:
1951
- return r = e.title, o = e.isTemporary, i = e.capacity, a = e.meetingType, t.next = 3, nt.getUserToken();
1952
- case 3:
1953
- return t.t0 = t.sent, c = {
1954
- "Content-Type": "application/json",
1955
- Accept: "application/json",
1956
- "x-jibb-user-jwt": t.t0
1957
- }, u = {
1958
- title: r || "",
1959
- isTemporary: o || !1,
1960
- capacity: i || 2,
1961
- meetingType: a || 0
1962
- }, t.next = 8, B.post("".concat(n.apiBaseURL, "/v1/meetings"), u, c);
1963
- case 8:
1964
- return s = t.sent, t.abrupt("return", s.data.meetingId);
1965
- case 10:
1966
- case "end":
1967
- return t.stop();
1968
- }
1969
- }, t);
1970
- }))).apply(this, arguments);
1971
- }
1972
- function Lt(t) {
1973
- return Et.apply(this, arguments);
1974
- }
1975
- function Et() {
1976
- return (Et = xt(wt().mark(function t(e) {
1977
- var r, o, i, a, c, u, s;
1978
- return wt().wrap(function (t) {
1979
- for (;;) switch (t.prev = t.next) {
1980
- case 0:
1981
- return r = e.meetingId, o = e.permission, i = e.expiry, a = e.auxData, t.next = 3, nt.getUserToken();
1982
- case 3:
1983
- return t.t0 = t.sent, c = {
1984
- "Content-Type": "application/json",
1985
- Accept: "application/json",
1986
- "x-jibb-user-jwt": t.t0
1987
- }, u = {
1988
- permission: o,
1989
- expiry: {
1990
- seconds: i || 3600
1991
- },
1992
- auxilary: a || {}
1993
- }, t.next = 8, B.post("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/temp-shares"), u, c);
1994
- case 8:
1995
- return s = t.sent, t.abrupt("return", s.data.shareId);
1996
- case 10:
1997
- case "end":
1998
- return t.stop();
1999
- }
2000
- }, t);
2001
- }))).apply(this, arguments);
2002
- }
2003
- function Tt(t) {
2004
- return St.apply(this, arguments);
2005
- }
2006
- function St() {
2007
- return (St = xt(wt().mark(function t(e) {
2008
- var r, o, i, a;
2009
- return wt().wrap(function (t) {
2010
- for (;;) switch (t.prev = t.next) {
2011
- case 0:
2012
- return r = e.meetingId, o = e.shareId, i = {
2013
- "Content-Type": "application/json",
2014
- Accept: "application/json"
2015
- }, t.next = 4, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/temp-shares/").concat(o), i);
2016
- case 4:
2017
- return a = t.sent, t.abrupt("return", a.data.token);
2018
- case 6:
2019
- case "end":
2020
- return t.stop();
2021
- }
2022
- }, t);
2023
- }))).apply(this, arguments);
2024
- }
2025
- function Ot(t) {
2026
- return _t.apply(this, arguments);
2027
- }
2028
- function _t() {
2029
- return (_t = xt(wt().mark(function t(e) {
2030
- var r, o, i;
2031
- return wt().wrap(function (t) {
2032
- for (;;) switch (t.prev = t.next) {
2033
- case 0:
2034
- return r = e.meetingId, o = e.mtoken, t.next = 3, nt.getUserToken();
2035
- case 3:
2036
- return t.t0 = t.sent, t.t1 = o, i = {
2037
- "Content-Type": "application/json",
2038
- Accept: "application/json",
2039
- "x-jibb-user-jwt": t.t0,
2040
- "x-jibb-meeting-jwt": t.t1
2041
- }, t.abrupt("return", B.delete("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/images"), i));
2042
- case 7:
2043
- case "end":
2044
- return t.stop();
2045
- }
2046
- }, t);
2047
- }))).apply(this, arguments);
2048
- }
2049
- function Ut(t) {
2050
- return Pt.apply(this, arguments);
2051
- }
2052
- function Pt() {
2053
- return (Pt = xt(wt().mark(function t(e) {
2054
- var r, o, i, a;
2055
- return wt().wrap(function (t) {
2056
- for (;;) switch (t.prev = t.next) {
2057
- case 0:
2058
- return r = e.meetingId, o = e.meetingToken, t.next = 3, nt.getUserToken();
2059
- case 3:
2060
- return t.t0 = t.sent, t.t1 = o, i = {
2061
- "Content-Type": "application/json",
2062
- Accept: "application/json",
2063
- "x-jibb-user-jwt": t.t0,
2064
- "x-jibb-meeting-jwt": t.t1
2065
- }, t.next = 8, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/images"), i);
2066
- case 8:
2067
- return a = t.sent, t.abrupt("return", a.data);
2068
- case 10:
2069
- case "end":
2070
- return t.stop();
2071
- }
2072
- }, t);
2073
- }))).apply(this, arguments);
2074
- }
2075
- function Ct(t) {
2076
- return It.apply(this, arguments);
2077
- }
2078
- function It() {
2079
- return (It = xt(wt().mark(function t(e) {
2080
- var r, o, i, a, c;
2081
- return wt().wrap(function (t) {
2082
- for (;;) switch (t.prev = t.next) {
2083
- case 0:
2084
- return r = e.meetingId, o = e.meetingToken, i = e.imageId, t.next = 3, nt.getUserToken();
2085
- case 3:
2086
- return t.t0 = t.sent, t.t1 = o, a = {
2087
- "Content-Type": "application/json",
2088
- Accept: "application/json",
2089
- "x-jibb-user-jwt": t.t0,
2090
- "x-jibb-meeting-jwt": t.t1
2091
- }, t.next = 8, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/images/").concat(i), a);
2092
- case 8:
2093
- return c = t.sent, t.abrupt("return", c.data);
2094
- case 10:
2095
- case "end":
2096
- return t.stop();
2097
- }
2098
- }, t);
2099
- }))).apply(this, arguments);
2100
- }
2101
- function Rt(t) {
2102
- return At.apply(this, arguments);
2103
- }
2104
- function At() {
2105
- return (At = xt(wt().mark(function t(e) {
2106
- var r, o, i, a, c;
2107
- return wt().wrap(function (t) {
2108
- for (;;) switch (t.prev = t.next) {
2109
- case 0:
2110
- return r = e.meetingId, o = e.meetingToken, i = {
2111
- "Content-Type": "application/json",
2112
- Accept: "application/json",
2113
- "x-jibb-meeting-jwt": o
2114
- }, t.prev = 2, a = {}, t.next = 6, B.post("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/actions/start"), a, i);
2115
- case 6:
2116
- return t.abrupt("return", t.sent);
2117
- case 9:
2118
- if (t.prev = 9, t.t0 = t.catch(2), 404 != (null === t.t0 || void 0 === t.t0 || null === (c = t.t0.response) || void 0 === c ? void 0 : c.status)) {
2119
- t.next = 15;
2120
- break;
2121
- }
2122
- throw new dt();
2123
- case 15:
2124
- throw t.t0;
2125
- case 16:
2126
- case "end":
2127
- return t.stop();
2128
- }
2129
- }, t, null, [[2, 9]]);
2130
- }))).apply(this, arguments);
2131
- }
2132
- function Bt(t) {
2133
- return Nt.apply(this, arguments);
2134
- }
2135
- function Nt() {
2136
- return (Nt = xt(wt().mark(function t(e) {
2137
- var r, o, i, a;
2138
- return wt().wrap(function (t) {
2139
- for (;;) switch (t.prev = t.next) {
2140
- case 0:
2141
- return r = e.meetingId, o = e.meetingToken, i = {
2142
- "Content-Type": "application/json",
2143
- Accept: "application/json",
2144
- "x-jibb-meeting-jwt": o
2145
- }, a = {}, t.abrupt("return", B.post("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/actions/end"), a, i));
2146
- case 4:
2147
- case "end":
2148
- return t.stop();
2149
- }
2150
- }, t);
2151
- }))).apply(this, arguments);
2152
- }
2153
- function Gt(t) {
2154
- return Mt.apply(this, arguments);
2155
- }
2156
- function Mt() {
2157
- return (Mt = xt(wt().mark(function t(e) {
2158
- var r;
2159
- return wt().wrap(function (t) {
2160
- for (;;) switch (t.prev = t.next) {
2161
- case 0:
2162
- return t.next = 2, nt.getUserToken();
2163
- case 2:
2164
- return t.t0 = t.sent, r = {
2165
- "Content-Type": "application/json",
2166
- Accept: "application/json",
2167
- "x-jibb-user-jwt": t.t0
2168
- }, t.abrupt("return", B.delete("".concat(n.apiBaseURL, "/v1/meetings/").concat(e), r));
2169
- case 5:
2170
- case "end":
2171
- return t.stop();
2172
- }
2173
- }, t);
2174
- }))).apply(this, arguments);
2175
- }
2176
- function Ft(t) {
2177
- return qt.apply(this, arguments);
2178
- }
2179
- function qt() {
2180
- return (qt = xt(wt().mark(function t(e) {
2181
- var r, o, i, a, u, s, p, l;
2182
- return wt().wrap(function (t) {
2183
- for (;;) switch (t.prev = t.next) {
2184
- case 0:
2185
- return r = e.meetingId, o = e.permission, i = e.expiry, a = void 0 === i ? 3600 : i, t.prev = 1, t.next = 4, nt.getUserToken();
2186
- case 4:
2187
- u = t.sent, t.next = 11;
2188
- break;
2189
- case 7:
2190
- throw t.prev = 7, t.t0 = t.catch(1), c.error({
2191
- err: t.t0
2192
- }), new mt("user is not authenticated");
2193
- case 11:
2194
- return t.prev = 11, s = {
2195
- "Content-Type": "application/json",
2196
- Accept: "application/json",
2197
- "x-jibb-user-jwt": u
2198
- }, t.next = 15, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/token/").concat(o, "?expiry.seconds=").concat(a), s);
2199
- case 15:
2200
- return p = t.sent, t.abrupt("return", p.data.token);
2201
- case 19:
2202
- if (t.prev = 19, t.t1 = t.catch(11), 404 != (null === t.t1 || void 0 === t.t1 || null === (l = t.t1.response) || void 0 === l ? void 0 : l.status)) {
2203
- t.next = 25;
2204
- break;
2205
- }
2206
- throw new dt("meeting not found");
2207
- case 25:
2208
- throw t.t1;
2209
- case 26:
2210
- case "end":
2211
- return t.stop();
2212
- }
2213
- }, t, null, [[1, 7], [11, 19]]);
2214
- }))).apply(this, arguments);
2215
- }
2216
- function Dt(t) {
2217
- return Ht.apply(this, arguments);
2218
- }
2219
- function Ht() {
2220
- return (Ht = xt(wt().mark(function t(e) {
2221
- var r, o;
2222
- return wt().wrap(function (t) {
2223
- for (;;) switch (t.prev = t.next) {
2224
- case 0:
2225
- return t.next = 2, nt.getUserToken();
2226
- case 2:
2227
- return t.t0 = t.sent, r = {
2228
- "Content-Type": "application/json",
2229
- Accept: "application/json",
2230
- "x-jibb-user-jwt": t.t0
2231
- }, void 0 !== e && (r["x-jibb-pagination"] = JSON.stringify(e)), t.next = 7, B.get("".concat(n.apiBaseURL, "/v1/meetings"), r);
2232
- case 7:
2233
- return o = t.sent, e = (e = o.headers["x-jibb-pagination"]) && JSON.parse(e), t.abrupt("return", {
2234
- meetings: o.data.meetings,
2235
- pagination: e
2236
- });
2237
- case 11:
2238
- case "end":
2239
- return t.stop();
2240
- }
2241
- }, t);
2242
- }))).apply(this, arguments);
2243
- }
2244
- function Jt(t) {
2245
- return Yt.apply(this, arguments);
2246
- }
2247
- function Yt() {
2248
- return (Yt = xt(wt().mark(function t(e) {
2249
- var r, o;
2250
- return wt().wrap(function (t) {
2251
- for (;;) switch (t.prev = t.next) {
2252
- case 0:
2253
- return t.next = 2, nt.getUserToken();
2254
- case 2:
2255
- return t.t0 = t.sent, r = {
2256
- "Content-Type": "application/json",
2257
- Accept: "application/json",
2258
- "x-jibb-user-jwt": t.t0
2259
- }, t.next = 6, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(e), r);
2260
- case 6:
2261
- return o = t.sent, t.abrupt("return", o.data);
2262
- case 8:
2263
- case "end":
2264
- return t.stop();
2265
- }
2266
- }, t);
2267
- }))).apply(this, arguments);
2268
- }
2269
- function Kt(t) {
2270
- return Wt.apply(this, arguments);
2271
- }
2272
- function Wt() {
2273
- return (Wt = xt(wt().mark(function t(e) {
2274
- var r, o, i, a, c;
2275
- return wt().wrap(function (t) {
2276
- for (;;) switch (t.prev = t.next) {
2277
- case 0:
2278
- return r = e.meetingId, o = e.title, i = e.capacity, t.next = 3, nt.getUserToken();
2279
- case 3:
2280
- return t.t0 = t.sent, a = {
2281
- "Content-Type": "application/json",
2282
- Accept: "application/json",
2283
- "x-jibb-user-jwt": t.t0
2284
- }, c = {}, o && (c.title = o), i && (c.capacity = i), t.abrupt("return", B.post("".concat(n.apiBaseURL, "/v1/meetings/").concat(r), c, a));
2285
- case 9:
2286
- case "end":
2287
- return t.stop();
2288
- }
2289
- }, t);
2290
- }))).apply(this, arguments);
2291
- }
2292
- function zt(t) {
2293
- return Xt.apply(this, arguments);
2294
- }
2295
- function Xt() {
2296
- return (Xt = xt(wt().mark(function t(e) {
2297
- var r, n;
2298
- return wt().wrap(function (t) {
2299
- for (;;) switch (t.prev = t.next) {
2300
- case 0:
2301
- return t.prev = 0, r = new w(e), t.t0 = b, t.next = 5, nt.getUserToken();
2302
- case 5:
2303
- return t.t1 = t.sent, n = new t.t0(t.t1), t.abrupt("return", n.email === r.owner);
2304
- case 10:
2305
- return t.prev = 10, t.t2 = t.catch(0), t.abrupt("return", !1);
2306
- case 13:
2307
- case "end":
2308
- return t.stop();
2309
- }
2310
- }, t, null, [[0, 10]]);
2311
- }))).apply(this, arguments);
2312
- }
2313
- function $t(t) {
2314
- return Qt.apply(this, arguments);
2315
- }
2316
- function Qt() {
2317
- return (Qt = xt(wt().mark(function t(e) {
2318
- var r, o, i, a, c, u, s;
2319
- return wt().wrap(function (t) {
2320
- for (;;) switch (t.prev = t.next) {
2321
- case 0:
2322
- return r = e.email, o = e.meetingId, i = e.permission, a = e.meetingToken, t.next = 3, nt.getUserToken();
2323
- case 3:
2324
- return t.t0 = t.sent, t.t1 = a, c = {
2325
- "Content-Type": "application/json",
2326
- Accept: "application/json",
2327
- "x-jibb-user-jwt": t.t0,
2328
- "x-jibb-meeting-jwt": t.t1
2329
- }, u = {
2330
- email: r,
2331
- permission: i
2332
- }, t.next = 9, B.post("".concat(n.apiBaseURL, "/v1/meetings/").concat(o, "/shares"), u, c);
2333
- case 9:
2334
- return s = t.sent, t.abrupt("return", s.data);
2335
- case 11:
2336
- case "end":
2337
- return t.stop();
2338
- }
2339
- }, t);
2340
- }))).apply(this, arguments);
2341
- }
2342
- function Vt(t) {
2343
- return Zt.apply(this, arguments);
2344
- }
2345
- function Zt() {
2346
- return (Zt = xt(wt().mark(function t(e) {
2347
- var r, o, i, a;
2348
- return wt().wrap(function (t) {
2349
- for (;;) switch (t.prev = t.next) {
2350
- case 0:
2351
- return r = e.meetingId, o = e.meetingToken, t.next = 3, nt.getUserToken();
2352
- case 3:
2353
- return t.t0 = t.sent, t.t1 = o, i = {
2354
- "Content-Type": "application/json",
2355
- Accept: "application/json",
2356
- "x-jibb-user-jwt": t.t0,
2357
- "x-jibb-meeting-jwt": t.t1
2358
- }, t.next = 8, B.get("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/shares"), i);
2359
- case 8:
2360
- return a = t.sent, t.abrupt("return", a.data.shares);
2361
- case 10:
2362
- case "end":
2363
- return t.stop();
2364
- }
2365
- }, t);
2366
- }))).apply(this, arguments);
2367
- }
2368
- function te(t) {
2369
- return ee.apply(this, arguments);
2370
- }
2371
- function ee() {
2372
- return (ee = xt(wt().mark(function t(e) {
2373
- var r, o, i, a;
2374
- return wt().wrap(function (t) {
2375
- for (;;) switch (t.prev = t.next) {
2376
- case 0:
2377
- return r = e.meetingId, o = e.userId, i = e.meetingToken, t.next = 3, nt.getUserToken();
2378
- case 3:
2379
- return t.t0 = t.sent, t.t1 = i, a = {
2380
- "Content-Type": "application/json",
2381
- Accept: "application/json",
2382
- "x-jibb-user-jwt": t.t0,
2383
- "x-jibb-meeting-jwt": t.t1
2384
- }, t.abrupt("return", B.delete("".concat(n.apiBaseURL, "/v1/meetings/").concat(r, "/shares/").concat(o), a));
2385
- case 7:
2386
- case "end":
2387
- return t.stop();
2388
- }
2389
- }, t);
2390
- }))).apply(this, arguments);
2391
- }
2392
- function re() {
2393
- return ne.apply(this, arguments);
2394
- }
2395
- function ne() {
2396
- return (ne = xt(wt().mark(function t() {
2397
- var e, r;
2398
- return wt().wrap(function (t) {
2399
- for (;;) switch (t.prev = t.next) {
2400
- case 0:
2401
- return t.next = 2, nt.getUserToken();
2402
- case 2:
2403
- return t.t0 = t.sent, e = {
2404
- "Content-Type": "application/json",
2405
- Accept: "application/json",
2406
- "x-jibb-user-jwt": t.t0
2407
- }, t.next = 6, B.get("".concat(n.apiBaseURL, "/v1/meetings/shares"), e);
2408
- case 6:
2409
- return r = t.sent, t.abrupt("return", r.data.shares);
2410
- case 8:
2411
- case "end":
2412
- return t.stop();
2413
- }
2414
- }, t);
2415
- }))).apply(this, arguments);
2416
- }
2417
- function oe(t) {
2418
- return ie.apply(this, arguments);
2419
- }
2420
- function ie() {
2421
- return (ie = xt(wt().mark(function t(e) {
2422
- var r;
2423
- return wt().wrap(function (t) {
2424
- for (;;) switch (t.prev = t.next) {
2425
- case 0:
2426
- return t.next = 2, nt.getUserToken();
2427
- case 2:
2428
- return t.t0 = t.sent, r = {
2429
- "Content-Type": "application/json",
2430
- Accept: "application/json",
2431
- "x-jibb-user-jwt": t.t0
2432
- }, t.abrupt("return", B.delete("".concat(n.apiBaseURL, "/v1/meetings/shares/").concat(e), r));
2433
- case 5:
2434
- case "end":
2435
- return t.stop();
2436
- }
2437
- }, t);
2438
- }))).apply(this, arguments);
2439
- }
2440
- function ae(t) {
2441
- return ae = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
2442
- return typeof t;
2443
- } : function (t) {
2444
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
2445
- }, ae(t);
2446
- }
2447
- function ce() {
2448
- ce = function ce() {
2449
- return t;
2450
- };
2451
- var t = {},
2452
- e = Object.prototype,
2453
- r = e.hasOwnProperty,
2454
- n = Object.defineProperty || function (t, e, r) {
2455
- t[e] = r.value;
2456
- },
2457
- o = "function" == typeof Symbol ? Symbol : {},
2458
- i = o.iterator || "@@iterator",
2459
- a = o.asyncIterator || "@@asyncIterator",
2460
- c = o.toStringTag || "@@toStringTag";
2461
- function u(t, e, r) {
2462
- return Object.defineProperty(t, e, {
2463
- value: r,
2464
- enumerable: !0,
2465
- configurable: !0,
2466
- writable: !0
2467
- }), t[e];
2468
- }
2469
- try {
2470
- u({}, "");
2471
- } catch (t) {
2472
- u = function u(t, e, r) {
2473
- return t[e] = r;
2474
- };
2475
- }
2476
- function s(t, e, r, o) {
2477
- var i = e && e.prototype instanceof f ? e : f,
2478
- a = Object.create(i.prototype),
2479
- c = new E(o || []);
2480
- return n(a, "_invoke", {
2481
- value: x(t, r, c)
2482
- }), a;
2483
- }
2484
- function p(t, e, r) {
2485
- try {
2486
- return {
2487
- type: "normal",
2488
- arg: t.call(e, r)
2489
- };
2490
- } catch (t) {
2491
- return {
2492
- type: "throw",
2493
- arg: t
2494
- };
2495
- }
2496
- }
2497
- t.wrap = s;
2498
- var l = {};
2499
- function f() {}
2500
- function h() {}
2501
- function y() {}
2502
- var v = {};
2503
- u(v, i, function () {
2504
- return this;
2505
- });
2506
- var d = Object.getPrototypeOf,
2507
- m = d && d(d(T([])));
2508
- m && m !== e && r.call(m, i) && (v = m);
2509
- var g = y.prototype = f.prototype = Object.create(v);
2510
- function w(t) {
2511
- ["next", "throw", "return"].forEach(function (e) {
2512
- u(t, e, function (t) {
2513
- return this._invoke(e, t);
2514
- });
2515
- });
2516
- }
2517
- function b(t, e) {
2518
- function o(n, i, a, c) {
2519
- var u = p(t[n], t, i);
2520
- if ("throw" !== u.type) {
2521
- var s = u.arg,
2522
- l = s.value;
2523
- return l && "object" == ae(l) && r.call(l, "__await") ? e.resolve(l.__await).then(function (t) {
2524
- o("next", t, a, c);
2525
- }, function (t) {
2526
- o("throw", t, a, c);
2527
- }) : e.resolve(l).then(function (t) {
2528
- s.value = t, a(s);
2529
- }, function (t) {
2530
- return o("throw", t, a, c);
2531
- });
2532
- }
2533
- c(u.arg);
2534
- }
2535
- var i;
2536
- n(this, "_invoke", {
2537
- value: function value(t, r) {
2538
- function n() {
2539
- return new e(function (e, n) {
2540
- o(t, r, e, n);
2541
- });
2542
- }
2543
- return i = i ? i.then(n, n) : n();
2544
- }
2545
- });
2546
- }
2547
- function x(t, e, r) {
2548
- var n = "suspendedStart";
2549
- return function (o, i) {
2550
- if ("executing" === n) throw new Error("Generator is already running");
2551
- if ("completed" === n) {
2552
- if ("throw" === o) throw i;
2553
- return {
2554
- value: void 0,
2555
- done: !0
2556
- };
2557
- }
2558
- for (r.method = o, r.arg = i;;) {
2559
- var a = r.delegate;
2560
- if (a) {
2561
- var c = j(a, r);
2562
- if (c) {
2563
- if (c === l) continue;
2564
- return c;
2565
- }
2566
- }
2567
- if ("next" === r.method) r.sent = r._sent = r.arg;else if ("throw" === r.method) {
2568
- if ("suspendedStart" === n) throw n = "completed", r.arg;
2569
- r.dispatchException(r.arg);
2570
- } else "return" === r.method && r.abrupt("return", r.arg);
2571
- n = "executing";
2572
- var u = p(t, e, r);
2573
- if ("normal" === u.type) {
2574
- if (n = r.done ? "completed" : "suspendedYield", u.arg === l) continue;
2575
- return {
2576
- value: u.arg,
2577
- done: r.done
2578
- };
2579
- }
2580
- "throw" === u.type && (n = "completed", r.method = "throw", r.arg = u.arg);
2581
- }
2582
- };
2583
- }
2584
- function j(t, e) {
2585
- var r = t.iterator[e.method];
2586
- if (void 0 === r) {
2587
- if (e.delegate = null, "throw" === e.method) {
2588
- if (t.iterator.return && (e.method = "return", e.arg = void 0, j(t, e), "throw" === e.method)) return l;
2589
- e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
2590
- }
2591
- return l;
2592
- }
2593
- var n = p(r, t.iterator, e.arg);
2594
- if ("throw" === n.type) return e.method = "throw", e.arg = n.arg, e.delegate = null, l;
2595
- var o = n.arg;
2596
- return o ? o.done ? (e[t.resultName] = o.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = void 0), e.delegate = null, l) : o : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, l);
2597
- }
2598
- function k(t) {
2599
- var e = {
2600
- tryLoc: t[0]
2601
- };
2602
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
2603
- }
2604
- function L(t) {
2605
- var e = t.completion || {};
2606
- e.type = "normal", delete e.arg, t.completion = e;
2607
- }
2608
- function E(t) {
2609
- this.tryEntries = [{
2610
- tryLoc: "root"
2611
- }], t.forEach(k, this), this.reset(!0);
2612
- }
2613
- function T(t) {
2614
- if (t) {
2615
- var e = t[i];
2616
- if (e) return e.call(t);
2617
- if ("function" == typeof t.next) return t;
2618
- if (!isNaN(t.length)) {
2619
- var n = -1,
2620
- o = function e() {
2621
- for (; ++n < t.length;) if (r.call(t, n)) return e.value = t[n], e.done = !1, e;
2622
- return e.value = void 0, e.done = !0, e;
2623
- };
2624
- return o.next = o;
2625
- }
2626
- }
2627
- return {
2628
- next: S
2629
- };
2630
- }
2631
- function S() {
2632
- return {
2633
- value: void 0,
2634
- done: !0
2635
- };
2636
- }
2637
- return h.prototype = y, n(g, "constructor", {
2638
- value: y,
2639
- configurable: !0
2640
- }), n(y, "constructor", {
2641
- value: h,
2642
- configurable: !0
2643
- }), h.displayName = u(y, c, "GeneratorFunction"), t.isGeneratorFunction = function (t) {
2644
- var e = "function" == typeof t && t.constructor;
2645
- return !!e && (e === h || "GeneratorFunction" === (e.displayName || e.name));
2646
- }, t.mark = function (t) {
2647
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, y) : (t.__proto__ = y, u(t, c, "GeneratorFunction")), t.prototype = Object.create(g), t;
2648
- }, t.awrap = function (t) {
2649
- return {
2650
- __await: t
2651
- };
2652
- }, w(b.prototype), u(b.prototype, a, function () {
2653
- return this;
2654
- }), t.AsyncIterator = b, t.async = function (e, r, n, o, i) {
2655
- void 0 === i && (i = Promise);
2656
- var a = new b(s(e, r, n, o), i);
2657
- return t.isGeneratorFunction(r) ? a : a.next().then(function (t) {
2658
- return t.done ? t.value : a.next();
2659
- });
2660
- }, w(g), u(g, c, "Generator"), u(g, i, function () {
2661
- return this;
2662
- }), u(g, "toString", function () {
2663
- return "[object Generator]";
2664
- }), t.keys = function (t) {
2665
- var e = Object(t),
2666
- r = [];
2667
- for (var n in e) r.push(n);
2668
- return r.reverse(), function t() {
2669
- for (; r.length;) {
2670
- var n = r.pop();
2671
- if (n in e) return t.value = n, t.done = !1, t;
2672
- }
2673
- return t.done = !0, t;
2674
- };
2675
- }, t.values = T, E.prototype = {
2676
- constructor: E,
2677
- reset: function reset(t) {
2678
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(L), !t) for (var e in this) "t" === e.charAt(0) && r.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0);
2679
- },
2680
- stop: function stop() {
2681
- this.done = !0;
2682
- var t = this.tryEntries[0].completion;
2683
- if ("throw" === t.type) throw t.arg;
2684
- return this.rval;
2685
- },
2686
- dispatchException: function dispatchException(t) {
2687
- if (this.done) throw t;
2688
- var e = this;
2689
- function n(r, n) {
2690
- return a.type = "throw", a.arg = t, e.next = r, n && (e.method = "next", e.arg = void 0), !!n;
2691
- }
2692
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
2693
- var i = this.tryEntries[o],
2694
- a = i.completion;
2695
- if ("root" === i.tryLoc) return n("end");
2696
- if (i.tryLoc <= this.prev) {
2697
- var c = r.call(i, "catchLoc"),
2698
- u = r.call(i, "finallyLoc");
2699
- if (c && u) {
2700
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
2701
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
2702
- } else if (c) {
2703
- if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
2704
- } else {
2705
- if (!u) throw new Error("try statement without catch or finally");
2706
- if (this.prev < i.finallyLoc) return n(i.finallyLoc);
2707
- }
2708
- }
2709
- }
2710
- },
2711
- abrupt: function abrupt(t, e) {
2712
- for (var n = this.tryEntries.length - 1; n >= 0; --n) {
2713
- var o = this.tryEntries[n];
2714
- if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
2715
- var i = o;
2716
- break;
2717
- }
2718
- }
2719
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
2720
- var a = i ? i.completion : {};
2721
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, l) : this.complete(a);
2722
- },
2723
- complete: function complete(t, e) {
2724
- if ("throw" === t.type) throw t.arg;
2725
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), l;
2726
- },
2727
- finish: function finish(t) {
2728
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2729
- var r = this.tryEntries[e];
2730
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), L(r), l;
2731
- }
2732
- },
2733
- catch: function _catch(t) {
2734
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2735
- var r = this.tryEntries[e];
2736
- if (r.tryLoc === t) {
2737
- var n = r.completion;
2738
- if ("throw" === n.type) {
2739
- var o = n.arg;
2740
- L(r);
2741
- }
2742
- return o;
2743
- }
2744
- }
2745
- throw new Error("illegal catch attempt");
2746
- },
2747
- delegateYield: function delegateYield(t, e, r) {
2748
- return this.delegate = {
2749
- iterator: T(t),
2750
- resultName: e,
2751
- nextLoc: r
2752
- }, "next" === this.method && (this.arg = void 0), l;
2753
- }
2754
- }, t;
2755
- }
2756
- function ue(t, e, r, n, o, i, a) {
2757
- try {
2758
- var c = t[i](a),
2759
- u = c.value;
2760
- } catch (t) {
2761
- return void r(t);
2762
- }
2763
- c.done ? e(u) : Promise.resolve(u).then(n, o);
2764
- }
2765
- function se(t) {
2766
- return function () {
2767
- var e = this,
2768
- r = arguments;
2769
- return new Promise(function (n, o) {
2770
- var i = t.apply(e, r);
2771
- function a(t) {
2772
- ue(i, n, o, a, c, "next", t);
2773
- }
2774
- function c(t) {
2775
- ue(i, n, o, a, c, "throw", t);
2776
- }
2777
- a(void 0);
2778
- });
2779
- };
2780
- }
2781
- function pe(t) {
2782
- return le.apply(this, arguments);
2783
- }
2784
- function le() {
2785
- return (le = se(ce().mark(function t(e) {
2786
- var r;
2787
- return ce().wrap(function (t) {
2788
- for (;;) switch (t.prev = t.next) {
2789
- case 0:
2790
- return t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/clients/").concat(e, "/cameras"), t.next = 4, Le();
2791
- case 4:
2792
- return t.t2 = t.sent, t.next = 7, t.t0.get.call(t.t0, t.t1, t.t2);
2793
- case 7:
2794
- return r = t.sent, t.abrupt("return", r.data.items);
2795
- case 9:
2796
- case "end":
2797
- return t.stop();
2798
- }
2799
- }, t);
2800
- }))).apply(this, arguments);
2801
- }
2802
- function fe(t) {
2803
- return he.apply(this, arguments);
2804
- }
2805
- function he() {
2806
- return (he = se(ce().mark(function t(e) {
2807
- var r, o, i, a;
2808
- return ce().wrap(function (t) {
2809
- for (;;) switch (t.prev = t.next) {
2810
- case 0:
2811
- return r = e.cameraId, o = e.clientId, i = {
2812
- source: {
2813
- id: r
2814
- }
2815
- }, t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/").concat(o, "/preview"), t.t2 = i, t.next = 7, Le();
2816
- case 7:
2817
- return t.t3 = t.sent, t.next = 10, t.t0.post.call(t.t0, t.t1, t.t2, t.t3);
2818
- case 10:
2819
- return a = t.sent, t.abrupt("return", a.data.image);
2820
- case 12:
2821
- case "end":
2822
- return t.stop();
2823
- }
2824
- }, t);
2825
- }))).apply(this, arguments);
2826
- }
2827
- function ye(t) {
2828
- return ve.apply(this, arguments);
2829
- }
2830
- function ve() {
2831
- return (ve = se(ce().mark(function t(e) {
2832
- var r, o, i, a, c, u, s, p, l, f, h, y, v, d, m;
2833
- return ce().wrap(function (t) {
2834
- for (;;) switch (t.prev = t.next) {
2835
- case 0:
2836
- if (r = e.meetingId, o = e.meetingToken, i = e.surfaceType, a = e.cameraId, c = e.sipUri, u = e.flipLeftRight, s = e.flipUpDown, p = e.rotation, l = e.fixedCorners, f = e.clientId, h = e.customCorners, y = e.enableColor, v = e.enableEstimation, d = {
2837
- config: {
2838
- surface_type: i
2839
- },
2840
- app_config: {
2841
- meeting_id: r,
2842
- meeting_token: o
2843
- },
2844
- runtime_config: Te({
2845
- fixedCorners: l,
2846
- flipLeftRight: u,
2847
- flipUpDown: s,
2848
- rotation: p,
2849
- customCorners: h,
2850
- enableColor: y,
2851
- enableEstimation: v
2852
- })
2853
- }, a || c) {
2854
- t.next = 4;
2855
- break;
2856
- }
2857
- return t.abrupt("return", Promise.reject("Invalid request: either sipUri or cameraId should be specified"));
2858
- case 4:
2859
- if (!a || !c) {
2860
- t.next = 8;
2861
- break;
2862
- }
2863
- return t.abrupt("return", Promise.reject("Invalid request: both sipUri (".concat(c, ") and cameraId (").concat(c, ") are specified")));
2864
- case 8:
2865
- c ? d.sip_uri = c : d.camera = {
2866
- id: a
2867
- };
2868
- case 9:
2869
- return m = {
2870
- start_request: d
2871
- }, t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/clients/").concat(f, "/start"), t.t2 = m, t.next = 15, Le();
2872
- case 15:
2873
- return t.t3 = t.sent, t.abrupt("return", t.t0.post.call(t.t0, t.t1, t.t2, t.t3));
2874
- case 17:
2875
- case "end":
2876
- return t.stop();
2877
- }
2878
- }, t);
2879
- }))).apply(this, arguments);
2880
- }
2881
- function de(t) {
2882
- return me.apply(this, arguments);
2883
- }
2884
- function me() {
2885
- return (me = se(ce().mark(function t(e) {
2886
- var r;
2887
- return ce().wrap(function (t) {
2888
- for (;;) switch (t.prev = t.next) {
2889
- case 0:
2890
- return r = {}, t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/").concat(e, "/stop"), t.t2 = r, t.next = 6, Le();
2891
- case 6:
2892
- return t.t3 = t.sent, t.abrupt("return", t.t0.post.call(t.t0, t.t1, t.t2, t.t3));
2893
- case 8:
2894
- case "end":
2895
- return t.stop();
2896
- }
2897
- }, t);
2898
- }))).apply(this, arguments);
2899
- }
2900
- function ge(t) {
2901
- return we.apply(this, arguments);
2902
- }
2903
- function we() {
2904
- return (we = se(ce().mark(function t(e) {
2905
- return ce().wrap(function (t) {
2906
- for (;;) switch (t.prev = t.next) {
2907
- case 0:
2908
- return t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus"), t.t2 = e, t.next = 5, Le();
2909
- case 5:
2910
- return t.t3 = t.sent, t.abrupt("return", t.t0.post.call(t.t0, t.t1, t.t2, t.t3));
2911
- case 7:
2912
- case "end":
2913
- return t.stop();
2914
- }
2915
- }, t);
2916
- }))).apply(this, arguments);
2917
- }
2918
- function be(t) {
2919
- return xe.apply(this, arguments);
2920
- }
2921
- function xe() {
2922
- return (xe = se(ce().mark(function t(e) {
2923
- var r, o, i, a, c, u, s, p, l;
2924
- return ce().wrap(function (t) {
2925
- for (;;) switch (t.prev = t.next) {
2926
- case 0:
2927
- return r = e.flipLeftRight, o = e.flipUpDown, i = e.rotation, a = e.fixedCorners, c = e.customCorners, u = e.clientId, s = e.enableColor, p = e.enableEstimation, l = {
2928
- runtime_config_request: {
2929
- runtime_config: Te({
2930
- fixedCorners: a,
2931
- flipLeftRight: r,
2932
- flipUpDown: o,
2933
- rotation: i,
2934
- customCorners: c,
2935
- enableColor: s,
2936
- enableEstimation: p
2937
- })
2938
- }
2939
- }, t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/").concat(u, "/runtime_config"), t.t2 = l, t.next = 7, Le();
2940
- case 7:
2941
- return t.t3 = t.sent, t.abrupt("return", t.t0.post.call(t.t0, t.t1, t.t2, t.t3));
2942
- case 9:
2943
- case "end":
2944
- return t.stop();
2945
- }
2946
- }, t);
2947
- }))).apply(this, arguments);
2948
- }
2949
- function je() {
2950
- return ke.apply(this, arguments);
2951
- }
2952
- function ke() {
2953
- return (ke = se(ce().mark(function t() {
2954
- var e;
2955
- return ce().wrap(function (t) {
2956
- for (;;) switch (t.prev = t.next) {
2957
- case 0:
2958
- return t.t0 = B, t.t1 = "".concat(n.apiBaseURL, "/v1/eventbus/clients"), t.next = 4, Le();
2959
- case 4:
2960
- return t.t2 = t.sent, t.next = 7, t.t0.get.call(t.t0, t.t1, t.t2);
2961
- case 7:
2962
- return e = t.sent, t.abrupt("return", e.data.clients);
2963
- case 9:
2964
- case "end":
2965
- return t.stop();
2966
- }
2967
- }, t);
2968
- }))).apply(this, arguments);
2969
- }
2970
- function Le() {
2971
- return Ee.apply(this, arguments);
2972
- }
2973
- function Ee() {
2974
- return (Ee = se(ce().mark(function t() {
2975
- return ce().wrap(function (t) {
2976
- for (;;) switch (t.prev = t.next) {
2977
- case 0:
2978
- return t.next = 2, nt.getUserToken();
2979
- case 2:
2980
- return t.t0 = t.sent, t.abrupt("return", {
2981
- "Content-Type": "application/json",
2982
- Accept: "application/json",
2983
- "x-jibb-user-jwt": t.t0
2984
- });
2985
- case 4:
2986
- case "end":
2987
- return t.stop();
2988
- }
2989
- }, t);
2990
- }))).apply(this, arguments);
2991
- }
2992
- function Te(t) {
2993
- var e = t.fixedCorners,
2994
- r = t.flipLeftRight,
2995
- n = t.flipUpDown,
2996
- o = t.rotation,
2997
- i = t.customCorners,
2998
- a = t.enableColor,
2999
- c = t.enableEstimation;
3000
- switch (o) {
3001
- case 90:
3002
- o = "1";
3003
- break;
3004
- case 180:
3005
- case -180:
3006
- o = "2";
3007
- break;
3008
- case -90:
3009
- case 270:
3010
- o = "3";
3011
- break;
3012
- default:
3013
- o = "0";
3014
- }
3015
- return {
3016
- custom_corners: i || [],
3017
- rotation: o,
3018
- enable_color: a || !1,
3019
- fixed_corners: e,
3020
- enable_estimation: c || !1,
3021
- flip_up_down: n || !1,
3022
- flip_left_right: r || !1
3023
- };
3024
- }
3025
- Error;
3026
- const Se = {
3027
- Auth: nt,
3028
- Config: n,
3029
- Meeting: t,
3030
- EventBus: e
3031
- };
3032
- })(), i.default;
3033
- })());