@acrobits/ipc-sdk 0.11.2-alpha.8 → 0.12.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/IPCManager.html +50 -31
- package/docs/classes/InvalidParameterError.html +9 -0
- package/docs/classes/UnsupportedVersionError.html +7 -0
- package/docs/enums/IPCEvents.html +7 -5
- package/docs/interfaces/CallInfoItem.html +16 -0
- package/docs/interfaces/DetailedContactURI.html +3 -3
- package/docs/interfaces/ILogger.html +2 -2
- package/docs/interfaces/RemoteUser.html +6 -0
- package/docs/modules.html +1 -1
- package/docs/types/BaseContactItem.html +7 -7
- package/docs/types/CallState.html +26 -0
- package/docs/types/CloudUsernameContactItem.html +2 -2
- package/docs/types/ContactItem.html +1 -1
- package/docs/types/ContactLabel.html +1 -1
- package/docs/types/ContactType.html +1 -1
- package/docs/types/ContactURI.html +1 -1
- package/docs/types/DetailedContactItem.html +8 -8
- package/docs/types/HostType.html +1 -1
- package/docs/types/IPCContext.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/docs/types/UnsubscribeCallback.html +1 -1
- package/docs/types/UriContactItem.html +1 -1
- package/lib/index.d.ts +354 -210
- package/lib/ipc-sdk.js +858 -698
- package/lib/ipc-sdk.js.map +1 -1
- package/lib/ipc-sdk.umd.cjs +4 -4
- package/lib/ipc-sdk.umd.cjs.map +1 -1
- package/package.json +3 -3
package/lib/ipc-sdk.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Pe = (n, t, e) => t in n ? Ae(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var I = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var G = function(n, t) {
|
|
5
|
+
return G = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
8
|
-
for (var
|
|
9
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
10
|
-
},
|
|
8
|
+
for (var s in r)
|
|
9
|
+
Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
10
|
+
}, G(n, t);
|
|
11
11
|
};
|
|
12
|
-
function U(
|
|
12
|
+
function U(n, t) {
|
|
13
13
|
if (typeof t != "function" && t !== null)
|
|
14
14
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
15
|
-
|
|
15
|
+
G(n, t);
|
|
16
16
|
function e() {
|
|
17
|
-
this.constructor =
|
|
17
|
+
this.constructor = n;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
20
20
|
}
|
|
21
|
-
function Q(
|
|
22
|
-
var t = typeof Symbol == "function" && Symbol.iterator, e = t &&
|
|
21
|
+
function Q(n) {
|
|
22
|
+
var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
|
|
23
23
|
if (e)
|
|
24
|
-
return e.call(
|
|
25
|
-
if (
|
|
24
|
+
return e.call(n);
|
|
25
|
+
if (n && typeof n.length == "number")
|
|
26
26
|
return {
|
|
27
27
|
next: function() {
|
|
28
|
-
return
|
|
28
|
+
return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
32
32
|
}
|
|
33
|
-
function $(
|
|
34
|
-
var e = typeof Symbol == "function" &&
|
|
33
|
+
function $(n, t) {
|
|
34
|
+
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
|
-
return
|
|
37
|
-
var r = e.call(
|
|
36
|
+
return n;
|
|
37
|
+
var r = e.call(n), s, i = [], o;
|
|
38
38
|
try {
|
|
39
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
40
|
-
i.push(
|
|
39
|
+
for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
|
|
40
|
+
i.push(s.value);
|
|
41
41
|
} catch (a) {
|
|
42
42
|
o = { error: a };
|
|
43
43
|
} finally {
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
s && !s.done && (e = r.return) && e.call(r);
|
|
46
46
|
} finally {
|
|
47
47
|
if (o)
|
|
48
48
|
throw o.error;
|
|
@@ -50,42 +50,42 @@ function $(s, t) {
|
|
|
50
50
|
}
|
|
51
51
|
return i;
|
|
52
52
|
}
|
|
53
|
-
function k(
|
|
53
|
+
function k(n, t, e) {
|
|
54
54
|
if (e || arguments.length === 2)
|
|
55
|
-
for (var r = 0,
|
|
55
|
+
for (var r = 0, s = t.length, i; r < s; r++)
|
|
56
56
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
57
|
-
return
|
|
57
|
+
return n.concat(i || Array.prototype.slice.call(t));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return typeof
|
|
59
|
+
function S(n) {
|
|
60
|
+
return typeof n == "function";
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Z(n) {
|
|
63
63
|
var t = function(r) {
|
|
64
64
|
Error.call(r), r.stack = new Error().stack;
|
|
65
|
-
}, e =
|
|
65
|
+
}, e = n(t);
|
|
66
66
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var H = Z(function(n) {
|
|
69
69
|
return function(e) {
|
|
70
|
-
|
|
71
|
-
` + e.map(function(r,
|
|
72
|
-
return
|
|
70
|
+
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
71
|
+
` + e.map(function(r, s) {
|
|
72
|
+
return s + 1 + ") " + r.toString();
|
|
73
73
|
}).join(`
|
|
74
74
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
var e =
|
|
80
|
-
0 <= e &&
|
|
77
|
+
function N(n, t) {
|
|
78
|
+
if (n) {
|
|
79
|
+
var e = n.indexOf(t);
|
|
80
|
+
0 <= e && n.splice(e, 1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
var x = function() {
|
|
84
|
-
function
|
|
84
|
+
function n(t) {
|
|
85
85
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
86
86
|
}
|
|
87
|
-
return
|
|
88
|
-
var t, e, r,
|
|
87
|
+
return n.prototype.unsubscribe = function() {
|
|
88
|
+
var t, e, r, s, i;
|
|
89
89
|
if (!this.closed) {
|
|
90
90
|
this.closed = !0;
|
|
91
91
|
var o = this._parentage;
|
|
@@ -108,12 +108,12 @@ var x = function() {
|
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
110
|
o.remove(this);
|
|
111
|
-
var
|
|
112
|
-
if (
|
|
111
|
+
var d = this.initialTeardown;
|
|
112
|
+
if (S(d))
|
|
113
113
|
try {
|
|
114
|
-
|
|
114
|
+
d();
|
|
115
115
|
} catch (v) {
|
|
116
|
-
i = v instanceof
|
|
116
|
+
i = v instanceof H ? v.errors : [v];
|
|
117
117
|
}
|
|
118
118
|
var u = this._finalizers;
|
|
119
119
|
if (u) {
|
|
@@ -122,16 +122,16 @@ var x = function() {
|
|
|
122
122
|
for (var b = Q(u), p = b.next(); !p.done; p = b.next()) {
|
|
123
123
|
var F = p.value;
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
ne(F);
|
|
126
126
|
} catch (v) {
|
|
127
|
-
i = i ?? [], v instanceof
|
|
127
|
+
i = i ?? [], v instanceof H ? i = k(k([], $(i)), $(v.errors)) : i.push(v);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} catch (v) {
|
|
131
131
|
r = { error: v };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
p && !p.done && (
|
|
134
|
+
p && !p.done && (s = b.return) && s.call(b);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -139,43 +139,43 @@ var x = function() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (i)
|
|
142
|
-
throw new
|
|
142
|
+
throw new H(i);
|
|
143
143
|
}
|
|
144
|
-
},
|
|
144
|
+
}, n.prototype.add = function(t) {
|
|
145
145
|
var e;
|
|
146
146
|
if (t && t !== this)
|
|
147
147
|
if (this.closed)
|
|
148
|
-
|
|
148
|
+
ne(t);
|
|
149
149
|
else {
|
|
150
|
-
if (t instanceof
|
|
150
|
+
if (t instanceof n) {
|
|
151
151
|
if (t.closed || t._hasParent(this))
|
|
152
152
|
return;
|
|
153
153
|
t._addParent(this);
|
|
154
154
|
}
|
|
155
155
|
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, n.prototype._hasParent = function(t) {
|
|
158
158
|
var e = this._parentage;
|
|
159
159
|
return e === t || Array.isArray(e) && e.includes(t);
|
|
160
|
-
},
|
|
160
|
+
}, n.prototype._addParent = function(t) {
|
|
161
161
|
var e = this._parentage;
|
|
162
162
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
163
|
-
},
|
|
163
|
+
}, n.prototype._removeParent = function(t) {
|
|
164
164
|
var e = this._parentage;
|
|
165
|
-
e === t ? this._parentage = null : Array.isArray(e) &&
|
|
166
|
-
},
|
|
165
|
+
e === t ? this._parentage = null : Array.isArray(e) && N(e, t);
|
|
166
|
+
}, n.prototype.remove = function(t) {
|
|
167
167
|
var e = this._finalizers;
|
|
168
|
-
e &&
|
|
169
|
-
},
|
|
170
|
-
var t = new
|
|
168
|
+
e && N(e, t), t instanceof n && t._removeParent(this);
|
|
169
|
+
}, n.EMPTY = function() {
|
|
170
|
+
var t = new n();
|
|
171
171
|
return t.closed = !0, t;
|
|
172
|
-
}(),
|
|
172
|
+
}(), n;
|
|
173
173
|
}(), ve = x.EMPTY;
|
|
174
|
-
function be(
|
|
175
|
-
return
|
|
174
|
+
function be(n) {
|
|
175
|
+
return n instanceof x || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
177
|
+
function ne(n) {
|
|
178
|
+
S(n) ? n() : n.unsubscribe();
|
|
179
179
|
}
|
|
180
180
|
var we = {
|
|
181
181
|
onUnhandledError: null,
|
|
@@ -183,36 +183,36 @@ var we = {
|
|
|
183
183
|
Promise: void 0,
|
|
184
184
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
185
185
|
useDeprecatedNextContext: !1
|
|
186
|
-
},
|
|
187
|
-
setTimeout: function(
|
|
186
|
+
}, Ce = {
|
|
187
|
+
setTimeout: function(n, t) {
|
|
188
188
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
189
189
|
e[r - 2] = arguments[r];
|
|
190
|
-
return setTimeout.apply(void 0, k([
|
|
190
|
+
return setTimeout.apply(void 0, k([n, t], $(e)));
|
|
191
191
|
},
|
|
192
|
-
clearTimeout: function(
|
|
193
|
-
var t =
|
|
194
|
-
return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(
|
|
192
|
+
clearTimeout: function(n) {
|
|
193
|
+
var t = Ce.delegate;
|
|
194
|
+
return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);
|
|
195
195
|
},
|
|
196
196
|
delegate: void 0
|
|
197
197
|
};
|
|
198
|
-
function _e(
|
|
199
|
-
|
|
200
|
-
throw
|
|
198
|
+
function _e(n) {
|
|
199
|
+
Ce.setTimeout(function() {
|
|
200
|
+
throw n;
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ie() {
|
|
204
204
|
}
|
|
205
|
-
function O(
|
|
206
|
-
|
|
205
|
+
function O(n) {
|
|
206
|
+
n();
|
|
207
207
|
}
|
|
208
|
-
var
|
|
209
|
-
U(t,
|
|
208
|
+
var ee = function(n) {
|
|
209
|
+
U(t, n);
|
|
210
210
|
function t(e) {
|
|
211
|
-
var r =
|
|
211
|
+
var r = n.call(this) || this;
|
|
212
212
|
return r.isStopped = !1, e ? (r.destination = e, be(e) && e.add(r)) : r.destination = ke, r;
|
|
213
213
|
}
|
|
214
|
-
return t.create = function(e, r,
|
|
215
|
-
return new
|
|
214
|
+
return t.create = function(e, r, s) {
|
|
215
|
+
return new D(e, r, s);
|
|
216
216
|
}, t.prototype.next = function(e) {
|
|
217
217
|
this.isStopped || this._next(e);
|
|
218
218
|
}, t.prototype.error = function(e) {
|
|
@@ -220,7 +220,7 @@ var Z = function(s) {
|
|
|
220
220
|
}, t.prototype.complete = function() {
|
|
221
221
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
222
222
|
}, t.prototype.unsubscribe = function() {
|
|
223
|
-
this.closed || (this.isStopped = !0,
|
|
223
|
+
this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
|
|
224
224
|
}, t.prototype._next = function(e) {
|
|
225
225
|
this.destination.next(e);
|
|
226
226
|
}, t.prototype._error = function(e) {
|
|
@@ -237,111 +237,111 @@ var Z = function(s) {
|
|
|
237
237
|
}
|
|
238
238
|
}, t;
|
|
239
239
|
}(x), Le = Function.prototype.bind;
|
|
240
|
-
function
|
|
241
|
-
return Le.call(
|
|
240
|
+
function q(n, t) {
|
|
241
|
+
return Le.call(n, t);
|
|
242
242
|
}
|
|
243
243
|
var Oe = function() {
|
|
244
|
-
function
|
|
244
|
+
function n(t) {
|
|
245
245
|
this.partialObserver = t;
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return n.prototype.next = function(t) {
|
|
248
248
|
var e = this.partialObserver;
|
|
249
249
|
if (e.next)
|
|
250
250
|
try {
|
|
251
251
|
e.next(t);
|
|
252
252
|
} catch (r) {
|
|
253
|
-
|
|
253
|
+
_(r);
|
|
254
254
|
}
|
|
255
|
-
},
|
|
255
|
+
}, n.prototype.error = function(t) {
|
|
256
256
|
var e = this.partialObserver;
|
|
257
257
|
if (e.error)
|
|
258
258
|
try {
|
|
259
259
|
e.error(t);
|
|
260
260
|
} catch (r) {
|
|
261
|
-
|
|
261
|
+
_(r);
|
|
262
262
|
}
|
|
263
263
|
else
|
|
264
|
-
|
|
265
|
-
},
|
|
264
|
+
_(t);
|
|
265
|
+
}, n.prototype.complete = function() {
|
|
266
266
|
var t = this.partialObserver;
|
|
267
267
|
if (t.complete)
|
|
268
268
|
try {
|
|
269
269
|
t.complete();
|
|
270
270
|
} catch (e) {
|
|
271
|
-
|
|
271
|
+
_(e);
|
|
272
272
|
}
|
|
273
|
-
},
|
|
274
|
-
}(),
|
|
275
|
-
U(t,
|
|
276
|
-
function t(e, r,
|
|
277
|
-
var i =
|
|
278
|
-
if (
|
|
273
|
+
}, n;
|
|
274
|
+
}(), D = function(n) {
|
|
275
|
+
U(t, n);
|
|
276
|
+
function t(e, r, s) {
|
|
277
|
+
var i = n.call(this) || this, o;
|
|
278
|
+
if (S(e) || !e)
|
|
279
279
|
o = {
|
|
280
280
|
next: e ?? void 0,
|
|
281
281
|
error: r ?? void 0,
|
|
282
|
-
complete:
|
|
282
|
+
complete: s ?? void 0
|
|
283
283
|
};
|
|
284
284
|
else {
|
|
285
285
|
var a;
|
|
286
286
|
i && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
287
287
|
return i.unsubscribe();
|
|
288
288
|
}, o = {
|
|
289
|
-
next: e.next &&
|
|
290
|
-
error: e.error &&
|
|
291
|
-
complete: e.complete &&
|
|
289
|
+
next: e.next && q(e.next, a),
|
|
290
|
+
error: e.error && q(e.error, a),
|
|
291
|
+
complete: e.complete && q(e.complete, a)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return i.destination = new Oe(o), i;
|
|
295
295
|
}
|
|
296
296
|
return t;
|
|
297
|
-
}(
|
|
298
|
-
function
|
|
299
|
-
_e(
|
|
297
|
+
}(ee);
|
|
298
|
+
function _(n) {
|
|
299
|
+
_e(n);
|
|
300
300
|
}
|
|
301
|
-
function $e(
|
|
302
|
-
throw
|
|
301
|
+
function $e(n) {
|
|
302
|
+
throw n;
|
|
303
303
|
}
|
|
304
304
|
var ke = {
|
|
305
305
|
closed: !0,
|
|
306
|
-
next:
|
|
306
|
+
next: ie,
|
|
307
307
|
error: $e,
|
|
308
|
-
complete:
|
|
309
|
-
},
|
|
308
|
+
complete: ie
|
|
309
|
+
}, Ne = function() {
|
|
310
310
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
311
311
|
}();
|
|
312
|
-
function
|
|
313
|
-
return
|
|
312
|
+
function Se(n) {
|
|
313
|
+
return n;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
317
|
-
return
|
|
318
|
-
return
|
|
315
|
+
function De(n) {
|
|
316
|
+
return n.length === 0 ? Se : n.length === 1 ? n[0] : function(e) {
|
|
317
|
+
return n.reduce(function(r, s) {
|
|
318
|
+
return s(r);
|
|
319
319
|
}, e);
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
function
|
|
322
|
+
var Y = function() {
|
|
323
|
+
function n(t) {
|
|
324
324
|
t && (this._subscribe = t);
|
|
325
325
|
}
|
|
326
|
-
return
|
|
327
|
-
var e = new
|
|
326
|
+
return n.prototype.lift = function(t) {
|
|
327
|
+
var e = new n();
|
|
328
328
|
return e.source = this, e.operator = t, e;
|
|
329
|
-
},
|
|
330
|
-
var
|
|
329
|
+
}, n.prototype.subscribe = function(t, e, r) {
|
|
330
|
+
var s = this, i = Fe(t) ? t : new D(t, e, r);
|
|
331
331
|
return O(function() {
|
|
332
|
-
var o =
|
|
333
|
-
i.add(a ? a.call(i, c) : c ?
|
|
332
|
+
var o = s, a = o.operator, c = o.source;
|
|
333
|
+
i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
|
|
334
334
|
}), i;
|
|
335
|
-
},
|
|
335
|
+
}, n.prototype._trySubscribe = function(t) {
|
|
336
336
|
try {
|
|
337
337
|
return this._subscribe(t);
|
|
338
338
|
} catch (e) {
|
|
339
339
|
t.error(e);
|
|
340
340
|
}
|
|
341
|
-
},
|
|
341
|
+
}, n.prototype.forEach = function(t, e) {
|
|
342
342
|
var r = this;
|
|
343
|
-
return e =
|
|
344
|
-
var o = new
|
|
343
|
+
return e = oe(e), new e(function(s, i) {
|
|
344
|
+
var o = new D({
|
|
345
345
|
next: function(a) {
|
|
346
346
|
try {
|
|
347
347
|
t(a);
|
|
@@ -350,54 +350,54 @@ var G = function() {
|
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
error: i,
|
|
353
|
-
complete:
|
|
353
|
+
complete: s
|
|
354
354
|
});
|
|
355
355
|
r.subscribe(o);
|
|
356
356
|
});
|
|
357
|
-
},
|
|
357
|
+
}, n.prototype._subscribe = function(t) {
|
|
358
358
|
var e;
|
|
359
359
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
360
|
-
},
|
|
360
|
+
}, n.prototype[Ne] = function() {
|
|
361
361
|
return this;
|
|
362
|
-
},
|
|
362
|
+
}, n.prototype.pipe = function() {
|
|
363
363
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
364
364
|
t[e] = arguments[e];
|
|
365
|
-
return
|
|
366
|
-
},
|
|
365
|
+
return De(t)(this);
|
|
366
|
+
}, n.prototype.toPromise = function(t) {
|
|
367
367
|
var e = this;
|
|
368
|
-
return t =
|
|
368
|
+
return t = oe(t), new t(function(r, s) {
|
|
369
369
|
var i;
|
|
370
370
|
e.subscribe(function(o) {
|
|
371
371
|
return i = o;
|
|
372
372
|
}, function(o) {
|
|
373
|
-
return
|
|
373
|
+
return s(o);
|
|
374
374
|
}, function() {
|
|
375
375
|
return r(i);
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
|
-
},
|
|
379
|
-
return new
|
|
380
|
-
},
|
|
378
|
+
}, n.create = function(t) {
|
|
379
|
+
return new n(t);
|
|
380
|
+
}, n;
|
|
381
381
|
}();
|
|
382
|
-
function
|
|
382
|
+
function oe(n) {
|
|
383
383
|
var t;
|
|
384
|
-
return (t =
|
|
384
|
+
return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
386
|
+
function Ve(n) {
|
|
387
|
+
return n && S(n.next) && S(n.error) && S(n.complete);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
return
|
|
389
|
+
function Fe(n) {
|
|
390
|
+
return n && n instanceof ee || Ve(n) && be(n);
|
|
391
391
|
}
|
|
392
|
-
function He(
|
|
393
|
-
return
|
|
392
|
+
function He(n) {
|
|
393
|
+
return S(n == null ? void 0 : n.lift);
|
|
394
394
|
}
|
|
395
|
-
function Ee(
|
|
395
|
+
function Ee(n) {
|
|
396
396
|
return function(t) {
|
|
397
397
|
if (He(t))
|
|
398
398
|
return t.lift(function(e) {
|
|
399
399
|
try {
|
|
400
|
-
return
|
|
400
|
+
return n(e, this);
|
|
401
401
|
} catch (r) {
|
|
402
402
|
this.error(r);
|
|
403
403
|
}
|
|
@@ -405,64 +405,64 @@ function Ee(s) {
|
|
|
405
405
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
return new
|
|
408
|
+
function Ie(n, t, e, r, s) {
|
|
409
|
+
return new qe(n, t, e, r, s);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
412
|
-
U(t,
|
|
413
|
-
function t(e, r,
|
|
414
|
-
var c =
|
|
411
|
+
var qe = function(n) {
|
|
412
|
+
U(t, n);
|
|
413
|
+
function t(e, r, s, i, o, a) {
|
|
414
|
+
var c = n.call(this, e) || this;
|
|
415
415
|
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
416
416
|
try {
|
|
417
417
|
r(l);
|
|
418
|
-
} catch (
|
|
419
|
-
e.error(
|
|
418
|
+
} catch (d) {
|
|
419
|
+
e.error(d);
|
|
420
420
|
}
|
|
421
|
-
} :
|
|
421
|
+
} : n.prototype._next, c._error = i ? function(l) {
|
|
422
422
|
try {
|
|
423
423
|
i(l);
|
|
424
|
-
} catch (
|
|
425
|
-
e.error(
|
|
424
|
+
} catch (d) {
|
|
425
|
+
e.error(d);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} :
|
|
429
|
+
} : n.prototype._error, c._complete = s ? function() {
|
|
430
430
|
try {
|
|
431
|
-
|
|
431
|
+
s();
|
|
432
432
|
} catch (l) {
|
|
433
433
|
e.error(l);
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} :
|
|
437
|
+
} : n.prototype._complete, c;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
441
441
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
442
442
|
var r = this.closed;
|
|
443
|
-
|
|
443
|
+
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
444
444
|
}
|
|
445
445
|
}, t;
|
|
446
|
-
}(
|
|
446
|
+
}(ee), je = Z(function(n) {
|
|
447
447
|
return function() {
|
|
448
|
-
|
|
448
|
+
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
449
449
|
};
|
|
450
|
-
}),
|
|
451
|
-
U(t,
|
|
450
|
+
}), Me = function(n) {
|
|
451
|
+
U(t, n);
|
|
452
452
|
function t() {
|
|
453
|
-
var e =
|
|
453
|
+
var e = n.call(this) || this;
|
|
454
454
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
455
455
|
}
|
|
456
456
|
return t.prototype.lift = function(e) {
|
|
457
|
-
var r = new
|
|
457
|
+
var r = new ce(this, this);
|
|
458
458
|
return r.operator = e, r;
|
|
459
459
|
}, t.prototype._throwIfClosed = function() {
|
|
460
460
|
if (this.closed)
|
|
461
|
-
throw new
|
|
461
|
+
throw new je();
|
|
462
462
|
}, t.prototype.next = function(e) {
|
|
463
463
|
var r = this;
|
|
464
464
|
O(function() {
|
|
465
|
-
var
|
|
465
|
+
var s, i;
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
@@ -471,13 +471,13 @@ var je = function(s) {
|
|
|
471
471
|
c.next(e);
|
|
472
472
|
}
|
|
473
473
|
} catch (l) {
|
|
474
|
-
|
|
474
|
+
s = { error: l };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
477
|
a && !a.done && (i = o.return) && i.call(o);
|
|
478
478
|
} finally {
|
|
479
|
-
if (
|
|
480
|
-
throw
|
|
479
|
+
if (s)
|
|
480
|
+
throw s.error;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
@@ -487,8 +487,8 @@ var je = function(s) {
|
|
|
487
487
|
O(function() {
|
|
488
488
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
489
489
|
r.hasError = r.isStopped = !0, r.thrownError = e;
|
|
490
|
-
for (var
|
|
491
|
-
|
|
490
|
+
for (var s = r.observers; s.length; )
|
|
491
|
+
s.shift().error(e);
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
494
|
}, t.prototype.complete = function() {
|
|
@@ -510,121 +510,121 @@ var je = function(s) {
|
|
|
510
510
|
enumerable: !1,
|
|
511
511
|
configurable: !0
|
|
512
512
|
}), t.prototype._trySubscribe = function(e) {
|
|
513
|
-
return this._throwIfClosed(),
|
|
513
|
+
return this._throwIfClosed(), n.prototype._trySubscribe.call(this, e);
|
|
514
514
|
}, t.prototype._subscribe = function(e) {
|
|
515
515
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
|
-
var r = this,
|
|
517
|
+
var r = this, s = this, i = s.hasError, o = s.isStopped, a = s.observers;
|
|
518
518
|
return i || o ? ve : (this.currentObservers = null, a.push(e), new x(function() {
|
|
519
|
-
r.currentObservers = null,
|
|
519
|
+
r.currentObservers = null, N(a, e);
|
|
520
520
|
}));
|
|
521
521
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
522
|
-
var r = this,
|
|
523
|
-
|
|
522
|
+
var r = this, s = r.hasError, i = r.thrownError, o = r.isStopped;
|
|
523
|
+
s ? e.error(i) : o && e.complete();
|
|
524
524
|
}, t.prototype.asObservable = function() {
|
|
525
|
-
var e = new
|
|
525
|
+
var e = new Y();
|
|
526
526
|
return e.source = this, e;
|
|
527
527
|
}, t.create = function(e, r) {
|
|
528
|
-
return new
|
|
528
|
+
return new ce(e, r);
|
|
529
529
|
}, t;
|
|
530
|
-
}(
|
|
531
|
-
U(t,
|
|
530
|
+
}(Y), ce = function(n) {
|
|
531
|
+
U(t, n);
|
|
532
532
|
function t(e, r) {
|
|
533
|
-
var
|
|
534
|
-
return
|
|
533
|
+
var s = n.call(this) || this;
|
|
534
|
+
return s.destination = e, s.source = r, s;
|
|
535
535
|
}
|
|
536
536
|
return t.prototype.next = function(e) {
|
|
537
|
-
var r,
|
|
538
|
-
(
|
|
537
|
+
var r, s;
|
|
538
|
+
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || s === void 0 || s.call(r, e);
|
|
539
539
|
}, t.prototype.error = function(e) {
|
|
540
|
-
var r,
|
|
541
|
-
(
|
|
540
|
+
var r, s;
|
|
541
|
+
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || s === void 0 || s.call(r, e);
|
|
542
542
|
}, t.prototype.complete = function() {
|
|
543
543
|
var e, r;
|
|
544
544
|
(r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
|
|
545
545
|
}, t.prototype._subscribe = function(e) {
|
|
546
|
-
var r,
|
|
547
|
-
return (
|
|
546
|
+
var r, s;
|
|
547
|
+
return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && s !== void 0 ? s : ve;
|
|
548
548
|
}, t;
|
|
549
|
-
}(
|
|
549
|
+
}(Me), Be = {
|
|
550
550
|
now: function() {
|
|
551
551
|
return Date.now();
|
|
552
552
|
},
|
|
553
553
|
delegate: void 0
|
|
554
|
-
},
|
|
555
|
-
U(t,
|
|
554
|
+
}, Ge = function(n) {
|
|
555
|
+
U(t, n);
|
|
556
556
|
function t(e, r) {
|
|
557
|
-
return
|
|
557
|
+
return n.call(this) || this;
|
|
558
558
|
}
|
|
559
559
|
return t.prototype.schedule = function(e, r) {
|
|
560
560
|
return this;
|
|
561
561
|
}, t;
|
|
562
|
-
}(x),
|
|
563
|
-
setInterval: function(
|
|
562
|
+
}(x), z = {
|
|
563
|
+
setInterval: function(n, t) {
|
|
564
564
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
565
565
|
e[r - 2] = arguments[r];
|
|
566
|
-
return setInterval.apply(void 0, k([
|
|
566
|
+
return setInterval.apply(void 0, k([n, t], $(e)));
|
|
567
567
|
},
|
|
568
|
-
clearInterval: function(
|
|
569
|
-
var t =
|
|
570
|
-
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(
|
|
568
|
+
clearInterval: function(n) {
|
|
569
|
+
var t = z.delegate;
|
|
570
|
+
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
571
571
|
},
|
|
572
572
|
delegate: void 0
|
|
573
|
-
},
|
|
574
|
-
U(t,
|
|
573
|
+
}, Qe = function(n) {
|
|
574
|
+
U(t, n);
|
|
575
575
|
function t(e, r) {
|
|
576
|
-
var
|
|
577
|
-
return
|
|
576
|
+
var s = n.call(this, e, r) || this;
|
|
577
|
+
return s.scheduler = e, s.work = r, s.pending = !1, s;
|
|
578
578
|
}
|
|
579
579
|
return t.prototype.schedule = function(e, r) {
|
|
580
|
-
var
|
|
580
|
+
var s;
|
|
581
581
|
if (r === void 0 && (r = 0), this.closed)
|
|
582
582
|
return this;
|
|
583
583
|
this.state = e;
|
|
584
584
|
var i = this.id, o = this.scheduler;
|
|
585
|
-
return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (
|
|
586
|
-
}, t.prototype.requestAsyncId = function(e, r,
|
|
587
|
-
return
|
|
588
|
-
}, t.prototype.recycleAsyncId = function(e, r,
|
|
589
|
-
if (
|
|
585
|
+
return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(o, this.id, r), this;
|
|
586
|
+
}, t.prototype.requestAsyncId = function(e, r, s) {
|
|
587
|
+
return s === void 0 && (s = 0), z.setInterval(e.flush.bind(e, this), s);
|
|
588
|
+
}, t.prototype.recycleAsyncId = function(e, r, s) {
|
|
589
|
+
if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
|
|
590
590
|
return r;
|
|
591
|
-
r != null &&
|
|
591
|
+
r != null && z.clearInterval(r);
|
|
592
592
|
}, t.prototype.execute = function(e, r) {
|
|
593
593
|
if (this.closed)
|
|
594
594
|
return new Error("executing a cancelled action");
|
|
595
595
|
this.pending = !1;
|
|
596
|
-
var
|
|
597
|
-
if (
|
|
598
|
-
return
|
|
596
|
+
var s = this._execute(e, r);
|
|
597
|
+
if (s)
|
|
598
|
+
return s;
|
|
599
599
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
600
600
|
}, t.prototype._execute = function(e, r) {
|
|
601
|
-
var
|
|
601
|
+
var s = !1, i;
|
|
602
602
|
try {
|
|
603
603
|
this.work(e);
|
|
604
604
|
} catch (o) {
|
|
605
|
-
|
|
605
|
+
s = !0, i = o || new Error("Scheduled action threw falsy error");
|
|
606
606
|
}
|
|
607
|
-
if (
|
|
607
|
+
if (s)
|
|
608
608
|
return this.unsubscribe(), i;
|
|
609
609
|
}, t.prototype.unsubscribe = function() {
|
|
610
610
|
if (!this.closed) {
|
|
611
|
-
var e = this, r = e.id,
|
|
612
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
611
|
+
var e = this, r = e.id, s = e.scheduler, i = s.actions;
|
|
612
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, N(i, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
613
613
|
}
|
|
614
614
|
}, t;
|
|
615
|
-
}(
|
|
616
|
-
function
|
|
617
|
-
e === void 0 && (e =
|
|
615
|
+
}(Ge), ae = function() {
|
|
616
|
+
function n(t, e) {
|
|
617
|
+
e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
|
|
618
618
|
}
|
|
619
|
-
return
|
|
619
|
+
return n.prototype.schedule = function(t, e, r) {
|
|
620
620
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
621
|
-
},
|
|
622
|
-
}(), Ye = function(
|
|
623
|
-
U(t,
|
|
621
|
+
}, n.now = Be.now, n;
|
|
622
|
+
}(), Ye = function(n) {
|
|
623
|
+
U(t, n);
|
|
624
624
|
function t(e, r) {
|
|
625
|
-
r === void 0 && (r =
|
|
626
|
-
var
|
|
627
|
-
return
|
|
625
|
+
r === void 0 && (r = ae.now);
|
|
626
|
+
var s = n.call(this, e, r) || this;
|
|
627
|
+
return s.actions = [], s._active = !1, s;
|
|
628
628
|
}
|
|
629
629
|
return t.prototype.flush = function(e) {
|
|
630
630
|
var r = this.actions;
|
|
@@ -632,72 +632,72 @@ var je = function(s) {
|
|
|
632
632
|
r.push(e);
|
|
633
633
|
return;
|
|
634
634
|
}
|
|
635
|
-
var
|
|
635
|
+
var s;
|
|
636
636
|
this._active = !0;
|
|
637
637
|
do
|
|
638
|
-
if (
|
|
638
|
+
if (s = e.execute(e.state, e.delay))
|
|
639
639
|
break;
|
|
640
640
|
while (e = r.shift());
|
|
641
|
-
if (this._active = !1,
|
|
641
|
+
if (this._active = !1, s) {
|
|
642
642
|
for (; e = r.shift(); )
|
|
643
643
|
e.unsubscribe();
|
|
644
|
-
throw
|
|
644
|
+
throw s;
|
|
645
645
|
}
|
|
646
646
|
}, t;
|
|
647
|
-
}(
|
|
648
|
-
function We(
|
|
649
|
-
return
|
|
647
|
+
}(ae), ze = new Ye(Qe), Je = ze;
|
|
648
|
+
function We(n) {
|
|
649
|
+
return n && S(n.schedule);
|
|
650
650
|
}
|
|
651
|
-
var Ke =
|
|
651
|
+
var Ke = Z(function(n) {
|
|
652
652
|
return function() {
|
|
653
|
-
|
|
653
|
+
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
654
654
|
};
|
|
655
655
|
});
|
|
656
|
-
function T(
|
|
656
|
+
function T(n, t) {
|
|
657
657
|
var e = typeof t == "object";
|
|
658
|
-
return new Promise(function(r,
|
|
659
|
-
var i = new
|
|
658
|
+
return new Promise(function(r, s) {
|
|
659
|
+
var i = new D({
|
|
660
660
|
next: function(o) {
|
|
661
661
|
r(o), i.unsubscribe();
|
|
662
662
|
},
|
|
663
|
-
error:
|
|
663
|
+
error: s,
|
|
664
664
|
complete: function() {
|
|
665
|
-
e ? r(t.defaultValue) :
|
|
665
|
+
e ? r(t.defaultValue) : s(new Ke());
|
|
666
666
|
}
|
|
667
667
|
});
|
|
668
|
-
|
|
668
|
+
n.subscribe(i);
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
|
-
function Xe(
|
|
672
|
-
return
|
|
671
|
+
function Xe(n) {
|
|
672
|
+
return n instanceof Date && !isNaN(n);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function R(n, t) {
|
|
675
675
|
return Ee(function(e, r) {
|
|
676
|
-
var
|
|
677
|
-
e.subscribe(
|
|
678
|
-
r.next(
|
|
676
|
+
var s = 0;
|
|
677
|
+
e.subscribe(Ie(r, function(i) {
|
|
678
|
+
r.next(n.call(t, i, s++));
|
|
679
679
|
}));
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
|
-
function Ze(
|
|
683
|
-
|
|
682
|
+
function Ze(n, t, e) {
|
|
683
|
+
n === void 0 && (n = 0), e === void 0 && (e = Je);
|
|
684
684
|
var r = -1;
|
|
685
|
-
return t != null && (We(t) ? e = t : r = t), new
|
|
686
|
-
var i = Xe(
|
|
685
|
+
return t != null && (We(t) ? e = t : r = t), new Y(function(s) {
|
|
686
|
+
var i = Xe(n) ? +n - e.now() : n;
|
|
687
687
|
i < 0 && (i = 0);
|
|
688
688
|
var o = 0;
|
|
689
689
|
return e.schedule(function() {
|
|
690
|
-
|
|
690
|
+
s.closed || (s.next(o++), 0 <= r ? this.schedule(void 0, r) : s.complete());
|
|
691
691
|
}, i);
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
|
-
function et(
|
|
695
|
-
var r =
|
|
696
|
-
return r ? Ee(function(
|
|
694
|
+
function et(n, t, e) {
|
|
695
|
+
var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
696
|
+
return r ? Ee(function(s, i) {
|
|
697
697
|
var o;
|
|
698
698
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
699
699
|
var a = !0;
|
|
700
|
-
|
|
700
|
+
s.subscribe(Ie(i, function(c) {
|
|
701
701
|
var l;
|
|
702
702
|
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
703
703
|
}, function() {
|
|
@@ -710,12 +710,12 @@ function et(s, t, e) {
|
|
|
710
710
|
var c, l;
|
|
711
711
|
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
712
712
|
}));
|
|
713
|
-
}) :
|
|
713
|
+
}) : Se;
|
|
714
714
|
}
|
|
715
|
-
var tt = Object.defineProperty, rt = (
|
|
716
|
-
class
|
|
715
|
+
var tt = Object.defineProperty, rt = (n, t, e) => t in n ? tt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, M = (n, t, e) => (rt(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
716
|
+
class h extends Error {
|
|
717
717
|
constructor(t) {
|
|
718
|
-
super(`Incorrect context (${t}). Cannot perform the requested operation.`),
|
|
718
|
+
super(`Incorrect context (${t}). Cannot perform the requested operation.`), M(this, "context"), this.context = t;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
class m extends Error {
|
|
@@ -723,7 +723,7 @@ class m extends Error {
|
|
|
723
723
|
super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
class
|
|
726
|
+
class le extends Error {
|
|
727
727
|
constructor(t, e) {
|
|
728
728
|
super(
|
|
729
729
|
`'streamId' value of "${t}" is different from what we expected ("${e}")`
|
|
@@ -735,29 +735,29 @@ class st extends Error {
|
|
|
735
735
|
super(`Invalid version format: ${t}`);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
class
|
|
738
|
+
class ue extends Error {
|
|
739
739
|
constructor(t) {
|
|
740
740
|
super(`${t} needs to be initialized before it can be used.`);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
class
|
|
743
|
+
class V extends Error {
|
|
744
744
|
constructor(t, e) {
|
|
745
745
|
let r = `Unsupported Protocol ${Array.isArray(t) ? "versions" : "version"}: (${t}).`;
|
|
746
746
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
function E(
|
|
750
|
-
return typeof
|
|
749
|
+
function E(n) {
|
|
750
|
+
return typeof n == "function";
|
|
751
751
|
}
|
|
752
|
-
function nt(
|
|
753
|
-
return E(
|
|
752
|
+
function nt(n) {
|
|
753
|
+
return E(n == null ? void 0 : n.lift);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function A(n) {
|
|
756
756
|
return function(t) {
|
|
757
757
|
if (nt(t))
|
|
758
758
|
return t.lift(function(e) {
|
|
759
759
|
try {
|
|
760
|
-
return
|
|
760
|
+
return n(e, this);
|
|
761
761
|
} catch (r) {
|
|
762
762
|
this.error(r);
|
|
763
763
|
}
|
|
@@ -765,48 +765,48 @@ function R(s) {
|
|
|
765
765
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
return
|
|
768
|
+
var J = function(n, t) {
|
|
769
|
+
return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
770
770
|
e.__proto__ = r;
|
|
771
771
|
} || function(e, r) {
|
|
772
|
-
for (var
|
|
773
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
774
|
-
},
|
|
772
|
+
for (var s in r)
|
|
773
|
+
Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
774
|
+
}, J(n, t);
|
|
775
775
|
};
|
|
776
|
-
function
|
|
776
|
+
function te(n, t) {
|
|
777
777
|
if (typeof t != "function" && t !== null)
|
|
778
778
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
779
|
-
|
|
779
|
+
J(n, t);
|
|
780
780
|
function e() {
|
|
781
|
-
this.constructor =
|
|
781
|
+
this.constructor = n;
|
|
782
782
|
}
|
|
783
|
-
|
|
783
|
+
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
784
784
|
}
|
|
785
|
-
function he(
|
|
786
|
-
var t = typeof Symbol == "function" && Symbol.iterator, e = t &&
|
|
785
|
+
function he(n) {
|
|
786
|
+
var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
|
|
787
787
|
if (e)
|
|
788
|
-
return e.call(
|
|
789
|
-
if (
|
|
788
|
+
return e.call(n);
|
|
789
|
+
if (n && typeof n.length == "number")
|
|
790
790
|
return {
|
|
791
791
|
next: function() {
|
|
792
|
-
return
|
|
792
|
+
return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
|
|
793
793
|
}
|
|
794
794
|
};
|
|
795
795
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
var e = typeof Symbol == "function" &&
|
|
797
|
+
function W(n, t) {
|
|
798
|
+
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
799
799
|
if (!e)
|
|
800
|
-
return
|
|
801
|
-
var r = e.call(
|
|
800
|
+
return n;
|
|
801
|
+
var r = e.call(n), s, i = [], o;
|
|
802
802
|
try {
|
|
803
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
804
|
-
i.push(
|
|
803
|
+
for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
|
|
804
|
+
i.push(s.value);
|
|
805
805
|
} catch (a) {
|
|
806
806
|
o = { error: a };
|
|
807
807
|
} finally {
|
|
808
808
|
try {
|
|
809
|
-
|
|
809
|
+
s && !s.done && (e = r.return) && e.call(r);
|
|
810
810
|
} finally {
|
|
811
811
|
if (o)
|
|
812
812
|
throw o.error;
|
|
@@ -814,39 +814,39 @@ function J(s, t) {
|
|
|
814
814
|
}
|
|
815
815
|
return i;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function K(n, t, e) {
|
|
818
818
|
if (e || arguments.length === 2)
|
|
819
|
-
for (var r = 0,
|
|
819
|
+
for (var r = 0, s = t.length, i; r < s; r++)
|
|
820
820
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
821
|
-
return
|
|
821
|
+
return n.concat(i || Array.prototype.slice.call(t));
|
|
822
822
|
}
|
|
823
|
-
function it(
|
|
823
|
+
function it(n) {
|
|
824
824
|
var t = function(r) {
|
|
825
825
|
Error.call(r), r.stack = new Error().stack;
|
|
826
|
-
}, e =
|
|
826
|
+
}, e = n(t);
|
|
827
827
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
828
828
|
}
|
|
829
|
-
var j = it(function(
|
|
829
|
+
var j = it(function(n) {
|
|
830
830
|
return function(t) {
|
|
831
|
-
|
|
831
|
+
n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
832
832
|
` + t.map(function(e, r) {
|
|
833
833
|
return r + 1 + ") " + e.toString();
|
|
834
834
|
}).join(`
|
|
835
835
|
`) : "", this.name = "UnsubscriptionError", this.errors = t;
|
|
836
836
|
};
|
|
837
837
|
});
|
|
838
|
-
function de(
|
|
839
|
-
if (
|
|
840
|
-
var e =
|
|
841
|
-
0 <= e &&
|
|
838
|
+
function de(n, t) {
|
|
839
|
+
if (n) {
|
|
840
|
+
var e = n.indexOf(t);
|
|
841
|
+
0 <= e && n.splice(e, 1);
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
var
|
|
845
|
-
function
|
|
844
|
+
var re = function() {
|
|
845
|
+
function n(t) {
|
|
846
846
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
847
847
|
}
|
|
848
|
-
return
|
|
849
|
-
var t, e, r,
|
|
848
|
+
return n.prototype.unsubscribe = function() {
|
|
849
|
+
var t, e, r, s, i;
|
|
850
850
|
if (!this.closed) {
|
|
851
851
|
this.closed = !0;
|
|
852
852
|
var o = this._parentage;
|
|
@@ -869,10 +869,10 @@ var te = function() {
|
|
|
869
869
|
}
|
|
870
870
|
else
|
|
871
871
|
o.remove(this);
|
|
872
|
-
var
|
|
873
|
-
if (E(
|
|
872
|
+
var d = this.initialTeardown;
|
|
873
|
+
if (E(d))
|
|
874
874
|
try {
|
|
875
|
-
|
|
875
|
+
d();
|
|
876
876
|
} catch (v) {
|
|
877
877
|
i = v instanceof j ? v.errors : [v];
|
|
878
878
|
}
|
|
@@ -885,14 +885,14 @@ var te = function() {
|
|
|
885
885
|
try {
|
|
886
886
|
pe(F);
|
|
887
887
|
} catch (v) {
|
|
888
|
-
i = i ?? [], v instanceof j ? i =
|
|
888
|
+
i = i ?? [], v instanceof j ? i = K(K([], W(i)), W(v.errors)) : i.push(v);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
} catch (v) {
|
|
892
892
|
r = { error: v };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
p && !p.done && (
|
|
895
|
+
p && !p.done && (s = b.return) && s.call(b);
|
|
896
896
|
} finally {
|
|
897
897
|
if (r)
|
|
898
898
|
throw r.error;
|
|
@@ -902,42 +902,42 @@ var te = function() {
|
|
|
902
902
|
if (i)
|
|
903
903
|
throw new j(i);
|
|
904
904
|
}
|
|
905
|
-
},
|
|
905
|
+
}, n.prototype.add = function(t) {
|
|
906
906
|
var e;
|
|
907
907
|
if (t && t !== this)
|
|
908
908
|
if (this.closed)
|
|
909
909
|
pe(t);
|
|
910
910
|
else {
|
|
911
|
-
if (t instanceof
|
|
911
|
+
if (t instanceof n) {
|
|
912
912
|
if (t.closed || t._hasParent(this))
|
|
913
913
|
return;
|
|
914
914
|
t._addParent(this);
|
|
915
915
|
}
|
|
916
916
|
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, n.prototype._hasParent = function(t) {
|
|
919
919
|
var e = this._parentage;
|
|
920
920
|
return e === t || Array.isArray(e) && e.includes(t);
|
|
921
|
-
},
|
|
921
|
+
}, n.prototype._addParent = function(t) {
|
|
922
922
|
var e = this._parentage;
|
|
923
923
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
924
|
-
},
|
|
924
|
+
}, n.prototype._removeParent = function(t) {
|
|
925
925
|
var e = this._parentage;
|
|
926
926
|
e === t ? this._parentage = null : Array.isArray(e) && de(e, t);
|
|
927
|
-
},
|
|
927
|
+
}, n.prototype.remove = function(t) {
|
|
928
928
|
var e = this._finalizers;
|
|
929
|
-
e && de(e, t), t instanceof
|
|
930
|
-
},
|
|
931
|
-
var t = new
|
|
929
|
+
e && de(e, t), t instanceof n && t._removeParent(this);
|
|
930
|
+
}, n.EMPTY = function() {
|
|
931
|
+
var t = new n();
|
|
932
932
|
return t.closed = !0, t;
|
|
933
|
-
}(),
|
|
933
|
+
}(), n;
|
|
934
934
|
}();
|
|
935
|
-
|
|
936
|
-
function Ue(
|
|
937
|
-
return
|
|
935
|
+
re.EMPTY;
|
|
936
|
+
function Ue(n) {
|
|
937
|
+
return n instanceof re || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
|
|
938
938
|
}
|
|
939
|
-
function pe(
|
|
940
|
-
E(
|
|
939
|
+
function pe(n) {
|
|
940
|
+
E(n) ? n() : n.unsubscribe();
|
|
941
941
|
}
|
|
942
942
|
var Te = {
|
|
943
943
|
onUnhandledError: null,
|
|
@@ -946,34 +946,34 @@ var Te = {
|
|
|
946
946
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
947
947
|
useDeprecatedNextContext: !1
|
|
948
948
|
}, ot = {
|
|
949
|
-
setTimeout: function(
|
|
949
|
+
setTimeout: function(n, t) {
|
|
950
950
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
951
951
|
e[r - 2] = arguments[r];
|
|
952
|
-
return setTimeout.apply(void 0,
|
|
952
|
+
return setTimeout.apply(void 0, K([n, t], W(e)));
|
|
953
953
|
},
|
|
954
|
-
clearTimeout: function(
|
|
955
|
-
return clearTimeout(
|
|
954
|
+
clearTimeout: function(n) {
|
|
955
|
+
return clearTimeout(n);
|
|
956
956
|
},
|
|
957
957
|
delegate: void 0
|
|
958
958
|
};
|
|
959
|
-
function ct(
|
|
959
|
+
function ct(n) {
|
|
960
960
|
ot.setTimeout(function() {
|
|
961
|
-
throw
|
|
961
|
+
throw n;
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
964
|
function fe() {
|
|
965
965
|
}
|
|
966
|
-
function at(
|
|
967
|
-
|
|
966
|
+
function at(n) {
|
|
967
|
+
n();
|
|
968
968
|
}
|
|
969
|
-
var
|
|
970
|
-
|
|
969
|
+
var se = function(n) {
|
|
970
|
+
te(t, n);
|
|
971
971
|
function t(e) {
|
|
972
|
-
var r =
|
|
972
|
+
var r = n.call(this) || this;
|
|
973
973
|
return r.isStopped = !1, e ? (r.destination = e, Ue(e) && e.add(r)) : r.destination = dt, r;
|
|
974
974
|
}
|
|
975
|
-
return t.create = function(e, r,
|
|
976
|
-
return new
|
|
975
|
+
return t.create = function(e, r, s) {
|
|
976
|
+
return new X(e, r, s);
|
|
977
977
|
}, t.prototype.next = function(e) {
|
|
978
978
|
this.isStopped || this._next(e);
|
|
979
979
|
}, t.prototype.error = function(e) {
|
|
@@ -981,7 +981,7 @@ var re = function(s) {
|
|
|
981
981
|
}, t.prototype.complete = function() {
|
|
982
982
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
983
983
|
}, t.prototype.unsubscribe = function() {
|
|
984
|
-
this.closed || (this.isStopped = !0,
|
|
984
|
+
this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
|
|
985
985
|
}, t.prototype._next = function(e) {
|
|
986
986
|
this.destination.next(e);
|
|
987
987
|
}, t.prototype._error = function(e) {
|
|
@@ -997,15 +997,15 @@ var re = function(s) {
|
|
|
997
997
|
this.unsubscribe();
|
|
998
998
|
}
|
|
999
999
|
}, t;
|
|
1000
|
-
}(
|
|
1001
|
-
function
|
|
1002
|
-
return lt.call(
|
|
1000
|
+
}(re), lt = Function.prototype.bind;
|
|
1001
|
+
function B(n, t) {
|
|
1002
|
+
return lt.call(n, t);
|
|
1003
1003
|
}
|
|
1004
1004
|
var ut = function() {
|
|
1005
|
-
function
|
|
1005
|
+
function n(t) {
|
|
1006
1006
|
this.partialObserver = t;
|
|
1007
1007
|
}
|
|
1008
|
-
return
|
|
1008
|
+
return n.prototype.next = function(t) {
|
|
1009
1009
|
var e = this.partialObserver;
|
|
1010
1010
|
if (e.next)
|
|
1011
1011
|
try {
|
|
@@ -1013,7 +1013,7 @@ var ut = function() {
|
|
|
1013
1013
|
} catch (r) {
|
|
1014
1014
|
L(r);
|
|
1015
1015
|
}
|
|
1016
|
-
},
|
|
1016
|
+
}, n.prototype.error = function(t) {
|
|
1017
1017
|
var e = this.partialObserver;
|
|
1018
1018
|
if (e.error)
|
|
1019
1019
|
try {
|
|
@@ -1023,7 +1023,7 @@ var ut = function() {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
else
|
|
1025
1025
|
L(t);
|
|
1026
|
-
},
|
|
1026
|
+
}, n.prototype.complete = function() {
|
|
1027
1027
|
var t = this.partialObserver;
|
|
1028
1028
|
if (t.complete)
|
|
1029
1029
|
try {
|
|
@@ -1031,36 +1031,36 @@ var ut = function() {
|
|
|
1031
1031
|
} catch (e) {
|
|
1032
1032
|
L(e);
|
|
1033
1033
|
}
|
|
1034
|
-
},
|
|
1035
|
-
}(),
|
|
1036
|
-
|
|
1037
|
-
function t(e, r,
|
|
1038
|
-
var i =
|
|
1034
|
+
}, n;
|
|
1035
|
+
}(), X = function(n) {
|
|
1036
|
+
te(t, n);
|
|
1037
|
+
function t(e, r, s) {
|
|
1038
|
+
var i = n.call(this) || this, o;
|
|
1039
1039
|
if (E(e) || !e)
|
|
1040
1040
|
o = {
|
|
1041
1041
|
next: e ?? void 0,
|
|
1042
1042
|
error: r ?? void 0,
|
|
1043
|
-
complete:
|
|
1043
|
+
complete: s ?? void 0
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
1046
|
var a;
|
|
1047
1047
|
i && Te.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
1048
1048
|
return i.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
|
-
next: e.next &&
|
|
1051
|
-
error: e.error &&
|
|
1052
|
-
complete: e.complete &&
|
|
1050
|
+
next: e.next && B(e.next, a),
|
|
1051
|
+
error: e.error && B(e.error, a),
|
|
1052
|
+
complete: e.complete && B(e.complete, a)
|
|
1053
1053
|
}) : o = e;
|
|
1054
1054
|
}
|
|
1055
1055
|
return i.destination = new ut(o), i;
|
|
1056
1056
|
}
|
|
1057
1057
|
return t;
|
|
1058
|
-
}(
|
|
1059
|
-
function L(
|
|
1060
|
-
ct(
|
|
1058
|
+
}(se);
|
|
1059
|
+
function L(n) {
|
|
1060
|
+
ct(n);
|
|
1061
1061
|
}
|
|
1062
|
-
function ht(
|
|
1063
|
-
throw
|
|
1062
|
+
function ht(n) {
|
|
1063
|
+
throw n;
|
|
1064
1064
|
}
|
|
1065
1065
|
var dt = {
|
|
1066
1066
|
closed: !0,
|
|
@@ -1070,39 +1070,39 @@ var dt = {
|
|
|
1070
1070
|
}, pt = function() {
|
|
1071
1071
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
1072
1072
|
}();
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1073
|
+
function Re(n) {
|
|
1074
|
+
return n;
|
|
1075
1075
|
}
|
|
1076
|
-
function ft(
|
|
1077
|
-
return
|
|
1078
|
-
return
|
|
1076
|
+
function ft(n) {
|
|
1077
|
+
return n.length === 0 ? Re : n.length === 1 ? n[0] : function(t) {
|
|
1078
|
+
return n.reduce(function(e, r) {
|
|
1079
1079
|
return r(e);
|
|
1080
1080
|
}, t);
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
1083
|
var gt = function() {
|
|
1084
|
-
function
|
|
1084
|
+
function n(t) {
|
|
1085
1085
|
t && (this._subscribe = t);
|
|
1086
1086
|
}
|
|
1087
|
-
return
|
|
1088
|
-
var e = new
|
|
1087
|
+
return n.prototype.lift = function(t) {
|
|
1088
|
+
var e = new n();
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
|
-
},
|
|
1091
|
-
var
|
|
1090
|
+
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
|
+
var s = this, i = mt(t) ? t : new X(t, e, r);
|
|
1092
1092
|
return at(function() {
|
|
1093
|
-
var o =
|
|
1094
|
-
i.add(a ? a.call(i, c) : c ?
|
|
1093
|
+
var o = s, a = o.operator, c = o.source;
|
|
1094
|
+
i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
|
|
1095
1095
|
}), i;
|
|
1096
|
-
},
|
|
1096
|
+
}, n.prototype._trySubscribe = function(t) {
|
|
1097
1097
|
try {
|
|
1098
1098
|
return this._subscribe(t);
|
|
1099
1099
|
} catch (e) {
|
|
1100
1100
|
t.error(e);
|
|
1101
1101
|
}
|
|
1102
|
-
},
|
|
1102
|
+
}, n.prototype.forEach = function(t, e) {
|
|
1103
1103
|
var r = this;
|
|
1104
|
-
return e = ge(e), new e(function(
|
|
1105
|
-
var o = new
|
|
1104
|
+
return e = ge(e), new e(function(s, i) {
|
|
1105
|
+
var o = new X({
|
|
1106
1106
|
next: function(a) {
|
|
1107
1107
|
try {
|
|
1108
1108
|
t(a);
|
|
@@ -1111,129 +1111,129 @@ var gt = function() {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: i,
|
|
1114
|
-
complete:
|
|
1114
|
+
complete: s
|
|
1115
1115
|
});
|
|
1116
1116
|
r.subscribe(o);
|
|
1117
1117
|
});
|
|
1118
|
-
},
|
|
1118
|
+
}, n.prototype._subscribe = function(t) {
|
|
1119
1119
|
var e;
|
|
1120
1120
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
1121
|
-
},
|
|
1121
|
+
}, n.prototype[pt] = function() {
|
|
1122
1122
|
return this;
|
|
1123
|
-
},
|
|
1123
|
+
}, n.prototype.pipe = function() {
|
|
1124
1124
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1125
1125
|
t[e] = arguments[e];
|
|
1126
1126
|
return ft(t)(this);
|
|
1127
|
-
},
|
|
1127
|
+
}, n.prototype.toPromise = function(t) {
|
|
1128
1128
|
var e = this;
|
|
1129
|
-
return t = ge(t), new t(function(r,
|
|
1129
|
+
return t = ge(t), new t(function(r, s) {
|
|
1130
1130
|
var i;
|
|
1131
1131
|
e.subscribe(function(o) {
|
|
1132
1132
|
return i = o;
|
|
1133
1133
|
}, function(o) {
|
|
1134
|
-
return
|
|
1134
|
+
return s(o);
|
|
1135
1135
|
}, function() {
|
|
1136
1136
|
return r(i);
|
|
1137
1137
|
});
|
|
1138
1138
|
});
|
|
1139
|
-
},
|
|
1140
|
-
return new
|
|
1141
|
-
},
|
|
1139
|
+
}, n.create = function(t) {
|
|
1140
|
+
return new n(t);
|
|
1141
|
+
}, n;
|
|
1142
1142
|
}();
|
|
1143
|
-
function ge(
|
|
1143
|
+
function ge(n) {
|
|
1144
1144
|
var t;
|
|
1145
|
-
return (t =
|
|
1145
|
+
return (t = n ?? Te.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
|
-
function yt(
|
|
1148
|
-
return
|
|
1147
|
+
function yt(n) {
|
|
1148
|
+
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
|
-
function mt(
|
|
1151
|
-
return
|
|
1150
|
+
function mt(n) {
|
|
1151
|
+
return n && n instanceof se || yt(n) && Ue(n);
|
|
1152
1152
|
}
|
|
1153
|
-
function P(
|
|
1154
|
-
return new vt(
|
|
1153
|
+
function P(n, t, e, r, s) {
|
|
1154
|
+
return new vt(n, t, e, r, s);
|
|
1155
1155
|
}
|
|
1156
|
-
var vt = function(
|
|
1157
|
-
|
|
1158
|
-
function t(e, r,
|
|
1159
|
-
var c =
|
|
1156
|
+
var vt = function(n) {
|
|
1157
|
+
te(t, n);
|
|
1158
|
+
function t(e, r, s, i, o, a) {
|
|
1159
|
+
var c = n.call(this, e) || this;
|
|
1160
1160
|
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
1161
1161
|
try {
|
|
1162
1162
|
r(l);
|
|
1163
|
-
} catch (
|
|
1164
|
-
e.error(
|
|
1163
|
+
} catch (d) {
|
|
1164
|
+
e.error(d);
|
|
1165
1165
|
}
|
|
1166
|
-
} :
|
|
1166
|
+
} : n.prototype._next, c._error = i ? function(l) {
|
|
1167
1167
|
try {
|
|
1168
1168
|
i(l);
|
|
1169
|
-
} catch (
|
|
1170
|
-
e.error(
|
|
1169
|
+
} catch (d) {
|
|
1170
|
+
e.error(d);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} :
|
|
1174
|
+
} : n.prototype._error, c._complete = s ? function() {
|
|
1175
1175
|
try {
|
|
1176
|
-
|
|
1176
|
+
s();
|
|
1177
1177
|
} catch (l) {
|
|
1178
1178
|
e.error(l);
|
|
1179
1179
|
} finally {
|
|
1180
1180
|
this.unsubscribe();
|
|
1181
1181
|
}
|
|
1182
|
-
} :
|
|
1182
|
+
} : n.prototype._complete, c;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
1186
1186
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
1187
1187
|
var r = this.closed;
|
|
1188
|
-
|
|
1188
|
+
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
1189
1189
|
}
|
|
1190
1190
|
}, t;
|
|
1191
|
-
}(
|
|
1192
|
-
function f(
|
|
1193
|
-
return
|
|
1194
|
-
var
|
|
1191
|
+
}(se);
|
|
1192
|
+
function f(n, t) {
|
|
1193
|
+
return A(function(e, r) {
|
|
1194
|
+
var s = 0;
|
|
1195
1195
|
e.subscribe(P(r, function(i) {
|
|
1196
|
-
r.next(
|
|
1196
|
+
r.next(n.call(t, i, s++));
|
|
1197
1197
|
}));
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
|
-
var bt = new gt(function(
|
|
1201
|
-
return
|
|
1200
|
+
var bt = new gt(function(n) {
|
|
1201
|
+
return n.complete();
|
|
1202
1202
|
});
|
|
1203
|
-
function
|
|
1204
|
-
return
|
|
1203
|
+
function C(n) {
|
|
1204
|
+
return n <= 0 ? function() {
|
|
1205
1205
|
return bt;
|
|
1206
|
-
} :
|
|
1206
|
+
} : A(function(t, e) {
|
|
1207
1207
|
var r = 0;
|
|
1208
|
-
t.subscribe(P(e, function(
|
|
1209
|
-
++r <=
|
|
1208
|
+
t.subscribe(P(e, function(s) {
|
|
1209
|
+
++r <= n && (e.next(s), n <= r && e.complete());
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function y(
|
|
1214
|
-
return
|
|
1215
|
-
var
|
|
1213
|
+
function y(n, t) {
|
|
1214
|
+
return A(function(e, r) {
|
|
1215
|
+
var s = 0;
|
|
1216
1216
|
e.subscribe(P(r, function(i) {
|
|
1217
|
-
return
|
|
1217
|
+
return n.call(t, i, s++) && r.next(i);
|
|
1218
1218
|
}));
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
-
function wt(
|
|
1222
|
-
return t === void 0 && (t = !1),
|
|
1223
|
-
var
|
|
1221
|
+
function wt(n, t) {
|
|
1222
|
+
return t === void 0 && (t = !1), A(function(e, r) {
|
|
1223
|
+
var s = 0;
|
|
1224
1224
|
e.subscribe(P(r, function(i) {
|
|
1225
|
-
var o =
|
|
1225
|
+
var o = n(i, s++);
|
|
1226
1226
|
(o || t) && r.next(i), !o && r.complete();
|
|
1227
1227
|
}));
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
function g(
|
|
1231
|
-
var r = E(
|
|
1232
|
-
return r ?
|
|
1230
|
+
function g(n, t, e) {
|
|
1231
|
+
var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
|
+
return r ? A(function(s, i) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
1235
|
var a = !0;
|
|
1236
|
-
|
|
1236
|
+
s.subscribe(P(i, function(c) {
|
|
1237
1237
|
var l;
|
|
1238
1238
|
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
1239
1239
|
}, function() {
|
|
@@ -1246,30 +1246,30 @@ function g(s, t, e) {
|
|
|
1246
1246
|
var c, l;
|
|
1247
1247
|
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
1248
1248
|
}));
|
|
1249
|
-
}) :
|
|
1249
|
+
}) : Re;
|
|
1250
1250
|
}
|
|
1251
|
-
const
|
|
1252
|
-
function
|
|
1253
|
-
if (typeof
|
|
1254
|
-
const t =
|
|
1251
|
+
const Ct = /^(\d+)\.(\d+)$/;
|
|
1252
|
+
function St(n) {
|
|
1253
|
+
if (typeof n == "string") {
|
|
1254
|
+
const t = n.match(Ct);
|
|
1255
1255
|
if (t)
|
|
1256
1256
|
return `${t[1]}.${t[2]}`;
|
|
1257
1257
|
}
|
|
1258
|
-
throw new st(
|
|
1258
|
+
throw new st(n);
|
|
1259
1259
|
}
|
|
1260
|
-
function ye(
|
|
1261
|
-
const t =
|
|
1262
|
-
return [
|
|
1260
|
+
function ye(n) {
|
|
1261
|
+
const t = St(n), [e, r] = t.split("."), [s, i] = [parseInt(e), parseInt(r)];
|
|
1262
|
+
return [s, i];
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const [e, r] = ye(
|
|
1266
|
-
return e <
|
|
1264
|
+
function xe(n, t) {
|
|
1265
|
+
const [e, r] = ye(n), [s, i] = ye(t);
|
|
1266
|
+
return e < s ? -1 : e > s ? 1 : r < i ? -1 : r > i ? 1 : 0;
|
|
1267
1267
|
}
|
|
1268
|
-
function Et(
|
|
1269
|
-
return
|
|
1268
|
+
function Et(n, t) {
|
|
1269
|
+
return xe(n, t) >= 0;
|
|
1270
1270
|
}
|
|
1271
1271
|
const me = "2.0";
|
|
1272
|
-
class
|
|
1272
|
+
class It {
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
|
|
1275
1275
|
*
|
|
@@ -1280,8 +1280,8 @@ class Mt {
|
|
|
1280
1280
|
* @param logService - An instance of a logging service or utility
|
|
1281
1281
|
*/
|
|
1282
1282
|
constructor(t, e) {
|
|
1283
|
-
if (
|
|
1284
|
-
throw new
|
|
1283
|
+
if (M(this, "negotiatedProtocolVersion"), M(this, "currentContext"), M(this, "incomingMessages$"), M(this, "inIframe", !1), M(this, "embeddedResult"), M(this, "iframePort1"), M(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Me(), this.supportedVersions = t.filter((r) => Et(r, me)), !this.supportedVersions.length)
|
|
1284
|
+
throw new V(t, me);
|
|
1285
1285
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1286
1286
|
}
|
|
1287
1287
|
get parent() {
|
|
@@ -1300,15 +1300,15 @@ class Mt {
|
|
|
1300
1300
|
return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;
|
|
1301
1301
|
}
|
|
1302
1302
|
get port2() {
|
|
1303
|
-
var t, e, r,
|
|
1303
|
+
var t, e, r, s;
|
|
1304
1304
|
if (this.inIframe) {
|
|
1305
1305
|
if (!this.iframePort2)
|
|
1306
|
-
throw new
|
|
1306
|
+
throw new ue("port2");
|
|
1307
1307
|
return this.iframePort2;
|
|
1308
1308
|
} else {
|
|
1309
1309
|
if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
|
|
1310
|
-
throw new
|
|
1311
|
-
return (
|
|
1310
|
+
throw new ue("port2");
|
|
1311
|
+
return (s = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : s.port2;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
1314
|
/**
|
|
@@ -1319,7 +1319,7 @@ class Mt {
|
|
|
1319
1319
|
determineContext() {
|
|
1320
1320
|
return Ze(1e3).pipe(
|
|
1321
1321
|
f(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1322
|
-
|
|
1322
|
+
C(1)
|
|
1323
1323
|
);
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
@@ -1330,26 +1330,26 @@ class Mt {
|
|
|
1330
1330
|
*/
|
|
1331
1331
|
openBridge() {
|
|
1332
1332
|
if (!this.isEmbedded())
|
|
1333
|
-
throw new
|
|
1333
|
+
throw new h(this.currentContext);
|
|
1334
1334
|
const t = "HELLO", e = this.createMessage(t);
|
|
1335
1335
|
e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
|
|
1336
1336
|
const r = this.incomingMessages$.pipe(
|
|
1337
|
-
y((
|
|
1338
|
-
f((
|
|
1337
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1338
|
+
f((s) => s),
|
|
1339
1339
|
g(this.logReceived()),
|
|
1340
|
-
f((
|
|
1341
|
-
if (!this.supportedVersions.includes(
|
|
1342
|
-
throw new
|
|
1343
|
-
return
|
|
1340
|
+
f((s) => {
|
|
1341
|
+
if (!this.supportedVersions.includes(s.protocolVersion))
|
|
1342
|
+
throw new V(s.protocolVersion, this.supportedVersions[0]);
|
|
1343
|
+
return s.displayName || (s.displayName = s.cloudUsername), s;
|
|
1344
1344
|
}),
|
|
1345
|
-
g((
|
|
1346
|
-
this.negotiatedProtocolVersion =
|
|
1345
|
+
g((s) => {
|
|
1346
|
+
this.negotiatedProtocolVersion = s.protocolVersion, this.logService.info(
|
|
1347
1347
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1348
|
-
), !
|
|
1348
|
+
), !s.networkId && this.compareVersion("2.2") >= 0 && this.logService.error(
|
|
1349
1349
|
`[IPC] Network ID is not set in the HELLO message reply. 'networkId' is required for protocol version ${this.negotiatedProtocolVersion}, and the client may derive an incorrect network ID from the cloudId.`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
|
|
1352
|
+
C(1)
|
|
1353
1353
|
);
|
|
1354
1354
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1355
1355
|
}
|
|
@@ -1362,14 +1362,14 @@ class Mt {
|
|
|
1362
1362
|
*/
|
|
1363
1363
|
requestSSOToken() {
|
|
1364
1364
|
if (!this.isEmbedded())
|
|
1365
|
-
throw new
|
|
1365
|
+
throw new h(this.currentContext);
|
|
1366
1366
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1367
1367
|
this.logCreated(t, e);
|
|
1368
1368
|
const r = this.incomingMessages$.pipe(
|
|
1369
|
-
y((
|
|
1370
|
-
f((
|
|
1369
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1370
|
+
f((s) => s),
|
|
1371
1371
|
g(this.logReceived()),
|
|
1372
|
-
|
|
1372
|
+
C(1)
|
|
1373
1373
|
);
|
|
1374
1374
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1375
1375
|
}
|
|
@@ -1388,18 +1388,18 @@ class Mt {
|
|
|
1388
1388
|
*/
|
|
1389
1389
|
sendJoiningRoomMessage(t) {
|
|
1390
1390
|
if (!this.isEmbedded())
|
|
1391
|
-
throw new
|
|
1391
|
+
throw new h(this.currentContext);
|
|
1392
1392
|
const {
|
|
1393
1393
|
roomName: e,
|
|
1394
1394
|
roomInvite: r,
|
|
1395
|
-
displayName:
|
|
1395
|
+
displayName: s,
|
|
1396
1396
|
jwtToken: i,
|
|
1397
1397
|
serverUrl: o,
|
|
1398
1398
|
region: a,
|
|
1399
1399
|
joinMicMuted: c,
|
|
1400
1400
|
joinWithoutCamera: l
|
|
1401
|
-
} = t,
|
|
1402
|
-
u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName =
|
|
1401
|
+
} = t, d = "JOINING ROOM", u = this.createMessage(d, !1);
|
|
1402
|
+
u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName = s, this.logCreated(d, u), this.port2.postMessage(u), this.logSent(d, u);
|
|
1403
1403
|
}
|
|
1404
1404
|
/**
|
|
1405
1405
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1414,7 +1414,7 @@ class Mt {
|
|
|
1414
1414
|
*/
|
|
1415
1415
|
sendLeavingRoomMessage(t) {
|
|
1416
1416
|
if (!this.isEmbedded())
|
|
1417
|
-
throw new
|
|
1417
|
+
throw new h(this.currentContext);
|
|
1418
1418
|
const e = "LEAVING ROOM", r = this.createMessage(e, !1);
|
|
1419
1419
|
r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
1420
1420
|
}
|
|
@@ -1446,7 +1446,7 @@ class Mt {
|
|
|
1446
1446
|
*/
|
|
1447
1447
|
onJoinRoomMessage() {
|
|
1448
1448
|
if (!this.isEmbedded())
|
|
1449
|
-
throw new
|
|
1449
|
+
throw new h(this.currentContext);
|
|
1450
1450
|
const t = "JOIN ROOM";
|
|
1451
1451
|
return this.incomingMessages$.pipe(
|
|
1452
1452
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -1482,7 +1482,7 @@ class Mt {
|
|
|
1482
1482
|
*/
|
|
1483
1483
|
onLeaveRoomMessage() {
|
|
1484
1484
|
if (!this.isEmbedded())
|
|
1485
|
-
throw new
|
|
1485
|
+
throw new h(this.currentContext);
|
|
1486
1486
|
const t = "LEAVE ROOM";
|
|
1487
1487
|
return this.incomingMessages$.pipe(
|
|
1488
1488
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -1519,7 +1519,7 @@ class Mt {
|
|
|
1519
1519
|
*/
|
|
1520
1520
|
onConfigMessage() {
|
|
1521
1521
|
if (!this.isEmbedded())
|
|
1522
|
-
throw new
|
|
1522
|
+
throw new h(this.currentContext);
|
|
1523
1523
|
const t = "CONFIG";
|
|
1524
1524
|
return this.incomingMessages$.pipe(
|
|
1525
1525
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -1542,30 +1542,30 @@ class Mt {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
sendScreenshareSourceMessage(t) {
|
|
1544
1544
|
if (!this.isEmbedded())
|
|
1545
|
-
throw new
|
|
1545
|
+
throw new h(this.currentContext);
|
|
1546
1546
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1547
1547
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1548
|
-
const
|
|
1548
|
+
const s = this.incomingMessages$.pipe(
|
|
1549
1549
|
y((i) => i.type === e && i.replyTo === r.id),
|
|
1550
1550
|
f((i) => i),
|
|
1551
1551
|
g(this.logReceived()),
|
|
1552
1552
|
f((i) => i),
|
|
1553
|
-
|
|
1553
|
+
C(1)
|
|
1554
1554
|
);
|
|
1555
|
-
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r),
|
|
1555
|
+
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
|
|
1556
1556
|
}
|
|
1557
1557
|
layoutChange(t, e, r) {
|
|
1558
1558
|
if (!this.isEmbedded())
|
|
1559
|
-
throw new
|
|
1560
|
-
const
|
|
1559
|
+
throw new h(this.currentContext);
|
|
1560
|
+
const s = "LAYOUT CHANGE";
|
|
1561
1561
|
let i, o;
|
|
1562
|
-
if (e && r ? (i = this.createMessage(
|
|
1563
|
-
y((a) => a.type ===
|
|
1562
|
+
if (e && r ? (i = this.createMessage(s, !1, r), i.result = e) : (i = this.createMessage(s), o = this.incomingMessages$.pipe(
|
|
1563
|
+
y((a) => a.type === s && a.replyTo === i.id),
|
|
1564
1564
|
f((a) => a),
|
|
1565
1565
|
g(this.logReceived()),
|
|
1566
1566
|
f((a) => a),
|
|
1567
|
-
|
|
1568
|
-
), this.logService.debug(`Created ${
|
|
1567
|
+
C(1)
|
|
1568
|
+
), this.logService.debug(`Created ${s} Reply handler`)), i.layout = t, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i), o)
|
|
1569
1569
|
return o;
|
|
1570
1570
|
}
|
|
1571
1571
|
/**
|
|
@@ -1601,7 +1601,7 @@ class Mt {
|
|
|
1601
1601
|
*/
|
|
1602
1602
|
onLayoutChangeMessage() {
|
|
1603
1603
|
if (!this.isEmbedded())
|
|
1604
|
-
throw new
|
|
1604
|
+
throw new h(this.currentContext);
|
|
1605
1605
|
const t = "LAYOUT CHANGE";
|
|
1606
1606
|
return this.incomingMessages$.pipe(
|
|
1607
1607
|
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
@@ -1612,27 +1612,27 @@ class Mt {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
requestOAuthToken(t) {
|
|
1614
1614
|
if (!this.isEmbedded())
|
|
1615
|
-
throw new
|
|
1615
|
+
throw new h(this.currentContext);
|
|
1616
1616
|
Array.isArray(t) || (t = [t]);
|
|
1617
1617
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1618
1618
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1619
|
-
const
|
|
1619
|
+
const s = this.incomingMessages$.pipe(
|
|
1620
1620
|
y((i) => i.type === e && i.replyTo === r.id),
|
|
1621
1621
|
f((i) => i),
|
|
1622
1622
|
g(this.logReceived()),
|
|
1623
|
-
|
|
1623
|
+
C(1)
|
|
1624
1624
|
);
|
|
1625
|
-
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r),
|
|
1625
|
+
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
|
|
1626
1626
|
}
|
|
1627
1627
|
openUrl(t, e) {
|
|
1628
1628
|
if (!this.isEmbedded())
|
|
1629
|
-
throw new
|
|
1630
|
-
const r = "OPEN URL",
|
|
1631
|
-
|
|
1629
|
+
throw new h(this.currentContext);
|
|
1630
|
+
const r = "OPEN URL", s = this.createMessage(r, !1);
|
|
1631
|
+
s.url = t, s.data = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
1632
1632
|
}
|
|
1633
|
-
selectContacts(t, e, r,
|
|
1633
|
+
selectContacts(t, e, r, s) {
|
|
1634
1634
|
if (!this.isEmbedded())
|
|
1635
|
-
throw new
|
|
1635
|
+
throw new h(this.currentContext);
|
|
1636
1636
|
if (this.negotiatedProtocolVersion === "2.0") {
|
|
1637
1637
|
if (e === void 0 || typeof e == "object")
|
|
1638
1638
|
throw new m(
|
|
@@ -1650,7 +1650,7 @@ class Mt {
|
|
|
1650
1650
|
t,
|
|
1651
1651
|
e,
|
|
1652
1652
|
r,
|
|
1653
|
-
|
|
1653
|
+
s
|
|
1654
1654
|
);
|
|
1655
1655
|
}
|
|
1656
1656
|
if (typeof e < "u" && typeof e != "object")
|
|
@@ -1663,17 +1663,17 @@ class Mt {
|
|
|
1663
1663
|
);
|
|
1664
1664
|
return this.selectContactsV2_1(t, e, r);
|
|
1665
1665
|
}
|
|
1666
|
-
selectContactsV2_0(t, e, r,
|
|
1666
|
+
selectContactsV2_0(t, e, r, s) {
|
|
1667
1667
|
if (!this.isEmbedded())
|
|
1668
|
-
throw new
|
|
1669
|
-
|
|
1668
|
+
throw new h(this.currentContext);
|
|
1669
|
+
s && s.length > 0 && (s = s.map((c) => c.type === "cloudUsername" && c.contactUser ? {
|
|
1670
1670
|
...c,
|
|
1671
1671
|
cloudId: c.cloudId || c.contactUser.cloudId,
|
|
1672
1672
|
networkId: c.networkId || c.contactUser.networkId,
|
|
1673
1673
|
cloudUsername: c.cloudUsername || c.contactUser.cloudUsername
|
|
1674
1674
|
} : c));
|
|
1675
1675
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1676
|
-
o.streamId = t, o.streamType = e, o.contactType = r, o.resultTypes = [r], o.currentContacts =
|
|
1676
|
+
o.streamId = t, o.streamType = e, o.contactType = r, o.resultTypes = [r], o.currentContacts = s, this.logCreated(i, o);
|
|
1677
1677
|
const a = this.incomingMessages$.pipe(
|
|
1678
1678
|
y((c) => c.type === i && c.replyTo === o.id),
|
|
1679
1679
|
g(this.logReceived()),
|
|
@@ -1681,32 +1681,32 @@ class Mt {
|
|
|
1681
1681
|
const l = c;
|
|
1682
1682
|
if (l.result === "success") {
|
|
1683
1683
|
if (l.streamId !== t)
|
|
1684
|
-
throw new
|
|
1684
|
+
throw new le(l.streamId, t);
|
|
1685
1685
|
e === "direct" && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]);
|
|
1686
1686
|
}
|
|
1687
1687
|
return l;
|
|
1688
1688
|
}),
|
|
1689
|
-
|
|
1689
|
+
C(1)
|
|
1690
1690
|
);
|
|
1691
1691
|
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1692
1692
|
}
|
|
1693
1693
|
selectContactsV2_1(t, e, r) {
|
|
1694
1694
|
if (!this.isEmbedded())
|
|
1695
|
-
throw new
|
|
1696
|
-
const
|
|
1695
|
+
throw new h(this.currentContext);
|
|
1696
|
+
const s = {
|
|
1697
1697
|
allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,
|
|
1698
1698
|
filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,
|
|
1699
1699
|
resultTypes: (e == null ? void 0 : e.resultTypes) ?? ["cloudUsername"],
|
|
1700
1700
|
streamName: e == null ? void 0 : e.streamName
|
|
1701
1701
|
};
|
|
1702
|
-
if (
|
|
1703
|
-
if (!
|
|
1702
|
+
if (s.filterToSelectedType) {
|
|
1703
|
+
if (!s.allowMultipleSelection)
|
|
1704
1704
|
throw new m(
|
|
1705
1705
|
"filterToSelectedType",
|
|
1706
|
-
|
|
1706
|
+
s.filterToSelectedType,
|
|
1707
1707
|
"filterToSelectedType can only be set when allowMultipleSelection is true"
|
|
1708
1708
|
);
|
|
1709
|
-
if (
|
|
1709
|
+
if (s.resultTypes.length === 1 && this.logService.warn(
|
|
1710
1710
|
"[IPC] [SelectContacts] filterToSelectedType is redundant when resultTypes contains only one type"
|
|
1711
1711
|
), r && r.length > 0) {
|
|
1712
1712
|
const c = r[0].type;
|
|
@@ -1742,7 +1742,7 @@ class Mt {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
1744
1744
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1745
|
-
o.streamId = t, o.streamName =
|
|
1745
|
+
o.streamId = t, o.streamName = s.streamName, o.resultTypes = s.resultTypes, o.currentContacts = r, o.allowMultipleSelection = s.allowMultipleSelection, o.filterToSelectedType = s.filterToSelectedType, this.logCreated(i, o);
|
|
1746
1746
|
const a = this.incomingMessages$.pipe(
|
|
1747
1747
|
y((c) => c.type === i && c.replyTo === o.id),
|
|
1748
1748
|
g(this.logReceived()),
|
|
@@ -1750,13 +1750,13 @@ class Mt {
|
|
|
1750
1750
|
const l = c;
|
|
1751
1751
|
if (l.result === "success") {
|
|
1752
1752
|
if (l.streamId !== t)
|
|
1753
|
-
throw new
|
|
1754
|
-
const
|
|
1753
|
+
throw new le(l.streamId, t);
|
|
1754
|
+
const d = l.contacts.length;
|
|
1755
1755
|
if (l.contacts = l.contacts.filter(
|
|
1756
|
-
(u) =>
|
|
1757
|
-
), l.contacts.length !==
|
|
1758
|
-
`[IPC] [SelectContactsReply] Filtered ${
|
|
1759
|
-
), !
|
|
1756
|
+
(u) => s.resultTypes.includes(u.type)
|
|
1757
|
+
), l.contacts.length !== d && this.logService.debug(
|
|
1758
|
+
`[IPC] [SelectContactsReply] Filtered ${d - l.contacts.length} contacts from reply`
|
|
1759
|
+
), !s.allowMultipleSelection && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), s.filterToSelectedType && l.contacts.length > 1) {
|
|
1760
1760
|
const u = l.contacts[0].type;
|
|
1761
1761
|
if (l.contacts.some(
|
|
1762
1762
|
(b) => b.type !== u
|
|
@@ -1785,46 +1785,46 @@ class Mt {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
return l;
|
|
1787
1787
|
}),
|
|
1788
|
-
|
|
1788
|
+
C(1)
|
|
1789
1789
|
);
|
|
1790
1790
|
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1791
1791
|
}
|
|
1792
1792
|
matchContacts(t) {
|
|
1793
1793
|
if (!this.isEmbedded())
|
|
1794
|
-
throw new
|
|
1794
|
+
throw new h(this.currentContext);
|
|
1795
1795
|
if (!Array.isArray(t))
|
|
1796
1796
|
throw new m("contacts", t, "contacts is not an array");
|
|
1797
1797
|
if (!t.length)
|
|
1798
1798
|
throw new m("contacts", t, "At least one contact is required");
|
|
1799
1799
|
const e = this.createMessage("MATCH CONTACTS");
|
|
1800
1800
|
if (this.compareVersion("2.1") >= 0) {
|
|
1801
|
-
for (const
|
|
1802
|
-
if (
|
|
1803
|
-
if (!
|
|
1801
|
+
for (const s of t)
|
|
1802
|
+
if (s.type === "cloudUsername") {
|
|
1803
|
+
if (!s.contactUser)
|
|
1804
1804
|
throw new m(
|
|
1805
1805
|
"contacts",
|
|
1806
|
-
|
|
1806
|
+
s,
|
|
1807
1807
|
"CloudUsername contact must include contactUser"
|
|
1808
1808
|
);
|
|
1809
|
-
if (!
|
|
1809
|
+
if (!s.contactUser.cloudUsername || !s.contactUser.cloudId || !s.contactUser.networkId)
|
|
1810
1810
|
throw new m(
|
|
1811
1811
|
"contacts",
|
|
1812
|
-
|
|
1812
|
+
s,
|
|
1813
1813
|
"CloudContact must define cloudUsername, cloudId, and networkId"
|
|
1814
1814
|
);
|
|
1815
1815
|
}
|
|
1816
1816
|
e.contacts = [...t];
|
|
1817
1817
|
} else {
|
|
1818
|
-
for (const
|
|
1819
|
-
|
|
1818
|
+
for (const s of t)
|
|
1819
|
+
s.type === "cloudUsername" && s.contactUser && (s.cloudId = s.contactUser.cloudId, s.networkId = s.contactUser.networkId, s.cloudUsername = s.contactUser.cloudUsername);
|
|
1820
1820
|
e.contacts = [...t];
|
|
1821
1821
|
}
|
|
1822
1822
|
this.logCreated(e.type, e);
|
|
1823
1823
|
const r = this.incomingMessages$.pipe(
|
|
1824
|
-
y((
|
|
1824
|
+
y((s) => s.type === e.type && s.replyTo === e.id),
|
|
1825
1825
|
g(this.logReceived()),
|
|
1826
|
-
f((
|
|
1827
|
-
const i =
|
|
1826
|
+
f((s) => {
|
|
1827
|
+
const i = s;
|
|
1828
1828
|
if (this.compareVersion("2.1") >= 0) {
|
|
1829
1829
|
if (Array.isArray(i.contacts))
|
|
1830
1830
|
throw new Error(
|
|
@@ -1883,7 +1883,7 @@ class Mt {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
return i;
|
|
1885
1885
|
}),
|
|
1886
|
-
|
|
1886
|
+
C(1)
|
|
1887
1887
|
);
|
|
1888
1888
|
return this.logService.debug(`Created ${e.type} Reply handler`), this.port2.postMessage(e), this.logSent(e.type, e), r;
|
|
1889
1889
|
}
|
|
@@ -1915,7 +1915,7 @@ class Mt {
|
|
|
1915
1915
|
*/
|
|
1916
1916
|
onPushMessageMessage() {
|
|
1917
1917
|
if (!this.isEmbedded())
|
|
1918
|
-
throw new
|
|
1918
|
+
throw new h(this.currentContext);
|
|
1919
1919
|
const t = "PUSH MESSAGE";
|
|
1920
1920
|
return this.incomingMessages$.pipe(
|
|
1921
1921
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -1923,6 +1923,48 @@ class Mt {
|
|
|
1923
1923
|
g(this.logReceived())
|
|
1924
1924
|
);
|
|
1925
1925
|
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Setup listener for {@link DirectChannelCreateAndNavigateMessage}, which can be sent by a Host app to
|
|
1928
|
+
* instruct the Client to create (if needed) and navigate to a direct channel.
|
|
1929
|
+
*
|
|
1930
|
+
* @remarks
|
|
1931
|
+
* The Host app does not expect a reply to this message.
|
|
1932
|
+
*
|
|
1933
|
+
* @returns An observable that emits whenever {@link DirectChannelCreateAndNavigateMessage} is received so it
|
|
1934
|
+
* can be subscribed to indefinitely.
|
|
1935
|
+
*/
|
|
1936
|
+
onDirectChannelCreateAndNavigateMessage() {
|
|
1937
|
+
if (!this.isEmbedded())
|
|
1938
|
+
throw new h(this.currentContext);
|
|
1939
|
+
const t = "DIRECT CHANNEL CREATE AND NAVIGATE";
|
|
1940
|
+
return this.incomingMessages$.pipe(
|
|
1941
|
+
y(
|
|
1942
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1943
|
+
),
|
|
1944
|
+
g(this.logReceived())
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* Setup listener for {@link NavigateToRouteMessage}, which can be sent by a Host app to instruct the
|
|
1949
|
+
* Client application to navigate to a specific in-app route.
|
|
1950
|
+
*
|
|
1951
|
+
* @remarks
|
|
1952
|
+
* The Host app does not expect a reply to this message.
|
|
1953
|
+
*
|
|
1954
|
+
* @returns An observable that emits whenever {@link NavigateToRouteMessage} is received so it can be
|
|
1955
|
+
* subscribed to indefinitely.
|
|
1956
|
+
*/
|
|
1957
|
+
onNavigateToRouteMessage() {
|
|
1958
|
+
if (!this.isEmbedded())
|
|
1959
|
+
throw new h(this.currentContext);
|
|
1960
|
+
const t = "NAVIGATE TO ROUTE";
|
|
1961
|
+
return this.incomingMessages$.pipe(
|
|
1962
|
+
y(
|
|
1963
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1964
|
+
),
|
|
1965
|
+
g(this.logReceived())
|
|
1966
|
+
);
|
|
1967
|
+
}
|
|
1926
1968
|
/**
|
|
1927
1969
|
* Sends a {@link PushTokenMessage} to the Host app, to request the Push Token for the current
|
|
1928
1970
|
* device.
|
|
@@ -1934,14 +1976,14 @@ class Mt {
|
|
|
1934
1976
|
*/
|
|
1935
1977
|
requestPushToken() {
|
|
1936
1978
|
if (!this.isEmbedded())
|
|
1937
|
-
throw new
|
|
1979
|
+
throw new h(this.currentContext);
|
|
1938
1980
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1939
1981
|
this.logCreated(t, e);
|
|
1940
1982
|
const r = this.incomingMessages$.pipe(
|
|
1941
|
-
y((
|
|
1983
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1942
1984
|
g(this.logReceived()),
|
|
1943
|
-
f((
|
|
1944
|
-
|
|
1985
|
+
f((s) => s),
|
|
1986
|
+
C(1)
|
|
1945
1987
|
);
|
|
1946
1988
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1947
1989
|
}
|
|
@@ -1974,7 +2016,7 @@ class Mt {
|
|
|
1974
2016
|
*/
|
|
1975
2017
|
onPushTokenMessage() {
|
|
1976
2018
|
if (!this.isEmbedded())
|
|
1977
|
-
throw new
|
|
2019
|
+
throw new h(this.currentContext);
|
|
1978
2020
|
const t = "PUSH TOKEN";
|
|
1979
2021
|
return this.incomingMessages$.pipe(
|
|
1980
2022
|
y(
|
|
@@ -1989,6 +2031,66 @@ class Mt {
|
|
|
1989
2031
|
g(this.logReceived())
|
|
1990
2032
|
);
|
|
1991
2033
|
}
|
|
2034
|
+
/**
|
|
2035
|
+
* Request current call information from the `Host` app.
|
|
2036
|
+
*
|
|
2037
|
+
* @remarks
|
|
2038
|
+
* The Host app should reply with a {@link CallInfoMessageReply} containing the current call
|
|
2039
|
+
* information.
|
|
2040
|
+
*
|
|
2041
|
+
* @returns Observable with a {@link CallInfoMessageReply} instance containing the call info.
|
|
2042
|
+
*/
|
|
2043
|
+
requestCallInfo() {
|
|
2044
|
+
if (!this.isEmbedded())
|
|
2045
|
+
throw new h(this.currentContext);
|
|
2046
|
+
const t = "CALL INFO", e = this.createMessage(t);
|
|
2047
|
+
this.logCreated(t, e);
|
|
2048
|
+
const r = this.incomingMessages$.pipe(
|
|
2049
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
2050
|
+
g(this.logReceived()),
|
|
2051
|
+
f((s) => s),
|
|
2052
|
+
C(1)
|
|
2053
|
+
);
|
|
2054
|
+
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* Setup a listener for {@link CallInfoMessageReply}, which can be sent by a Host app to notify
|
|
2058
|
+
* of call information changes.
|
|
2059
|
+
*
|
|
2060
|
+
* @remarks
|
|
2061
|
+
* The Host app should send this message whenever call properties change. The Client app can
|
|
2062
|
+
* use this to update its call state accordingly.
|
|
2063
|
+
*
|
|
2064
|
+
* The Host app does not expect a reply to this message.
|
|
2065
|
+
*
|
|
2066
|
+
* @example
|
|
2067
|
+
* Here is an example of how a listener can be setup:
|
|
2068
|
+
*
|
|
2069
|
+
* ```ts
|
|
2070
|
+
* const ipcHelper = new IpcHelper(['2.0'], console);
|
|
2071
|
+
*
|
|
2072
|
+
* const callInfoSubscription = ipcHelper.onCallInfoMessage().subscribe((msg) => {
|
|
2073
|
+
* // your logic for handling call info updates goes here
|
|
2074
|
+
* });
|
|
2075
|
+
*
|
|
2076
|
+
* // don't forget to unsubscribe when you're cleaning up
|
|
2077
|
+
* callInfoSubscription.unsubscribe();
|
|
2078
|
+
* ```
|
|
2079
|
+
*
|
|
2080
|
+
* @returns An observable that emits whenever {@link CallInfoMessageReply} is received so it can
|
|
2081
|
+
* be subscribed to indefinitely.
|
|
2082
|
+
*/
|
|
2083
|
+
onCallInfoMessage() {
|
|
2084
|
+
if (!this.isEmbedded())
|
|
2085
|
+
throw new h(this.currentContext);
|
|
2086
|
+
const t = "CALL INFO";
|
|
2087
|
+
return this.incomingMessages$.pipe(
|
|
2088
|
+
y(
|
|
2089
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2090
|
+
),
|
|
2091
|
+
g(this.logReceived())
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
1992
2094
|
/**
|
|
1993
2095
|
* Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the
|
|
1994
2096
|
* current badge counter from the `Client` app.
|
|
@@ -1998,7 +2100,7 @@ class Mt {
|
|
|
1998
2100
|
*/
|
|
1999
2101
|
onBadgeQueryMessage() {
|
|
2000
2102
|
if (!this.isEmbedded())
|
|
2001
|
-
throw new
|
|
2103
|
+
throw new h(this.currentContext);
|
|
2002
2104
|
const t = "BADGE QUERY";
|
|
2003
2105
|
return this.incomingMessages$.pipe(
|
|
2004
2106
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -2020,9 +2122,9 @@ class Mt {
|
|
|
2020
2122
|
*/
|
|
2021
2123
|
sendBadgeUpdateMessage(t, e, r) {
|
|
2022
2124
|
if (!this.isEmbedded())
|
|
2023
|
-
throw new
|
|
2024
|
-
const
|
|
2025
|
-
i.count = t, i.activity = e ?? !1, this.logCreated(
|
|
2125
|
+
throw new h(this.currentContext);
|
|
2126
|
+
const s = "BADGE UPDATE", i = this.createMessage(s, !1, r);
|
|
2127
|
+
i.count = t, i.activity = e ?? !1, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i);
|
|
2026
2128
|
}
|
|
2027
2129
|
/**
|
|
2028
2130
|
* Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.
|
|
@@ -2039,9 +2141,9 @@ class Mt {
|
|
|
2039
2141
|
*/
|
|
2040
2142
|
sendLifecycleMessage(t, e) {
|
|
2041
2143
|
if (!this.isEmbedded())
|
|
2042
|
-
throw new
|
|
2043
|
-
const r = "LIFECYCLE",
|
|
2044
|
-
|
|
2144
|
+
throw new h(this.currentContext);
|
|
2145
|
+
const r = "LIFECYCLE", s = this.createMessage(r, !1);
|
|
2146
|
+
s.eventName = t, s.payload = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2045
2147
|
}
|
|
2046
2148
|
/**
|
|
2047
2149
|
* Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the
|
|
@@ -2056,7 +2158,7 @@ class Mt {
|
|
|
2056
2158
|
*/
|
|
2057
2159
|
onLifecycleMessage() {
|
|
2058
2160
|
if (!this.isEmbedded())
|
|
2059
|
-
throw new
|
|
2161
|
+
throw new h(this.currentContext);
|
|
2060
2162
|
const t = "LIFECYCLE";
|
|
2061
2163
|
return this.incomingMessages$.pipe(
|
|
2062
2164
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -2078,9 +2180,9 @@ class Mt {
|
|
|
2078
2180
|
*/
|
|
2079
2181
|
sendLogMessage(t, e) {
|
|
2080
2182
|
if (!this.isEmbedded())
|
|
2081
|
-
throw new
|
|
2082
|
-
const r = "LOG",
|
|
2083
|
-
|
|
2183
|
+
throw new h(this.currentContext);
|
|
2184
|
+
const r = "LOG", s = this.createMessage(r, !1);
|
|
2185
|
+
s.level = t, s.message = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2084
2186
|
}
|
|
2085
2187
|
/**
|
|
2086
2188
|
* Setup listener for {@link RequestLogsMessage}, which can be sent by a `Host` app to request
|
|
@@ -2096,7 +2198,7 @@ class Mt {
|
|
|
2096
2198
|
*/
|
|
2097
2199
|
onRequestLogsMessage() {
|
|
2098
2200
|
if (!this.isEmbedded())
|
|
2099
|
-
throw new
|
|
2201
|
+
throw new h(this.currentContext);
|
|
2100
2202
|
const t = "REQUEST LOGS";
|
|
2101
2203
|
return this.incomingMessages$.pipe(
|
|
2102
2204
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -2114,11 +2216,11 @@ class Mt {
|
|
|
2114
2216
|
* @param format - Format of the file. Can be either `gzip` or `text`
|
|
2115
2217
|
* @param replyTo - The message ID to which the reply should be sent
|
|
2116
2218
|
*/
|
|
2117
|
-
sendRequestLogsMessageReply(t, e, r,
|
|
2219
|
+
sendRequestLogsMessageReply(t, e, r, s, i) {
|
|
2118
2220
|
if (!this.isEmbedded())
|
|
2119
|
-
throw new
|
|
2221
|
+
throw new h(this.currentContext);
|
|
2120
2222
|
const o = "REQUEST LOGS", a = this.createMessage(o, !1, i);
|
|
2121
|
-
a.fileId = t, a.fileHash = e, a.fileSize = r, a.format =
|
|
2223
|
+
a.fileId = t, a.fileHash = e, a.fileSize = r, a.format = s, this.logCreated(o, a), this.port2.postMessage(a), this.logSent(o, a);
|
|
2122
2224
|
}
|
|
2123
2225
|
/**
|
|
2124
2226
|
* Send a {@link ViewTransitionMessage} to the `Host` app, notifying it of a view transition
|
|
@@ -2135,9 +2237,9 @@ class Mt {
|
|
|
2135
2237
|
*/
|
|
2136
2238
|
sendViewTransitionMessage(t, e) {
|
|
2137
2239
|
if (!this.isEmbedded())
|
|
2138
|
-
throw new
|
|
2139
|
-
const r = "VIEW TRANSITION",
|
|
2140
|
-
|
|
2240
|
+
throw new h(this.currentContext);
|
|
2241
|
+
const r = "VIEW TRANSITION", s = this.createMessage(r, !1);
|
|
2242
|
+
s.transitionType = t, s.targetView = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2141
2243
|
}
|
|
2142
2244
|
/**
|
|
2143
2245
|
* Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
|
|
@@ -2180,29 +2282,29 @@ class Mt {
|
|
|
2180
2282
|
* @returns An observable that either emits once if the result is `error` or `not found` or
|
|
2181
2283
|
* emits as many times as the number of chunks in the file if the result is `success`.
|
|
2182
2284
|
*/
|
|
2183
|
-
sendFileRequestMessage(t, e, r,
|
|
2285
|
+
sendFileRequestMessage(t, e, r, s, i) {
|
|
2184
2286
|
if (!this.isEmbedded())
|
|
2185
|
-
throw new
|
|
2287
|
+
throw new h(this.currentContext);
|
|
2186
2288
|
const o = "FILE REQUEST", a = this.createMessage(o);
|
|
2187
2289
|
if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = i, r === "attachment") {
|
|
2188
|
-
if (!
|
|
2290
|
+
if (!s)
|
|
2189
2291
|
throw new m(
|
|
2190
2292
|
"streamId",
|
|
2191
|
-
|
|
2293
|
+
s,
|
|
2192
2294
|
"streamId is required for attachment intent"
|
|
2193
2295
|
);
|
|
2194
|
-
a.streamId =
|
|
2296
|
+
a.streamId = s;
|
|
2195
2297
|
}
|
|
2196
2298
|
this.logCreated(o, a);
|
|
2197
2299
|
let c = 0;
|
|
2198
2300
|
const l = this.incomingMessages$.pipe(
|
|
2199
2301
|
y(
|
|
2200
|
-
(
|
|
2302
|
+
(d) => d.type === o && d.replyTo === a.id
|
|
2201
2303
|
),
|
|
2202
2304
|
g(this.logReceived()),
|
|
2203
2305
|
g(() => c++),
|
|
2204
|
-
f((
|
|
2205
|
-
wt((
|
|
2306
|
+
f((d) => (d.result === "success" && (d.chunkHash = d.chunkHash.toLowerCase(), d.fileHash = d.fileHash.toLowerCase()), d)),
|
|
2307
|
+
wt((d) => d.result === "success" && c < d.totalChunks, !0)
|
|
2206
2308
|
);
|
|
2207
2309
|
return this.port2.postMessage(a), this.logSent(o, a), l;
|
|
2208
2310
|
}
|
|
@@ -2227,12 +2329,12 @@ class Mt {
|
|
|
2227
2329
|
*/
|
|
2228
2330
|
sendFileRequestMessageReply(t, e) {
|
|
2229
2331
|
if (!this.isEmbedded())
|
|
2230
|
-
throw new
|
|
2231
|
-
const r = "FILE REQUEST",
|
|
2332
|
+
throw new h(this.currentContext);
|
|
2333
|
+
const r = "FILE REQUEST", s = Object.assign(
|
|
2232
2334
|
e,
|
|
2233
2335
|
this.createMessage(r, !1, t.id)
|
|
2234
2336
|
);
|
|
2235
|
-
this.logCreated(r,
|
|
2337
|
+
this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2236
2338
|
}
|
|
2237
2339
|
/**
|
|
2238
2340
|
* Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
|
|
@@ -2248,7 +2350,7 @@ class Mt {
|
|
|
2248
2350
|
*/
|
|
2249
2351
|
onFileRequestMessage() {
|
|
2250
2352
|
if (!this.isEmbedded())
|
|
2251
|
-
throw new
|
|
2353
|
+
throw new h(this.currentContext);
|
|
2252
2354
|
const t = "FILE REQUEST";
|
|
2253
2355
|
return this.incomingMessages$.pipe(
|
|
2254
2356
|
y(
|
|
@@ -2280,11 +2382,11 @@ class Mt {
|
|
|
2280
2382
|
*
|
|
2281
2383
|
* @returns This method returns void.
|
|
2282
2384
|
*/
|
|
2283
|
-
sendFileSelectionMessage(t = "attachment", e, r,
|
|
2385
|
+
sendFileSelectionMessage(t = "attachment", e, r, s, i, o) {
|
|
2284
2386
|
if (!this.isEmbedded())
|
|
2285
|
-
throw new
|
|
2387
|
+
throw new h(this.currentContext);
|
|
2286
2388
|
const a = "FILE SELECTION", c = this.createMessage(a);
|
|
2287
|
-
if (c.intent = t, c.maxCount =
|
|
2389
|
+
if (c.intent = t, c.maxCount = s, c.maxFileSizeInBytes = i, c.mimeTypes = o, t === "attachment") {
|
|
2288
2390
|
if (!e)
|
|
2289
2391
|
throw new m(
|
|
2290
2392
|
"streamId",
|
|
@@ -2302,14 +2404,14 @@ class Mt {
|
|
|
2302
2404
|
this.logCreated(a, c);
|
|
2303
2405
|
const l = this.incomingMessages$.pipe(
|
|
2304
2406
|
y(
|
|
2305
|
-
(
|
|
2407
|
+
(d) => d.type === a && d.replyTo === c.id
|
|
2306
2408
|
),
|
|
2307
|
-
f((
|
|
2409
|
+
f((d) => {
|
|
2308
2410
|
var u;
|
|
2309
|
-
return
|
|
2411
|
+
return d.result === "success" && (d.files = (u = d.files) == null ? void 0 : u.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b))), d;
|
|
2310
2412
|
}),
|
|
2311
2413
|
g(this.logReceived()),
|
|
2312
|
-
|
|
2414
|
+
C(1)
|
|
2313
2415
|
);
|
|
2314
2416
|
return this.port2.postMessage(c), this.logSent(a, c), l;
|
|
2315
2417
|
}
|
|
@@ -2334,21 +2436,21 @@ class Mt {
|
|
|
2334
2436
|
*/
|
|
2335
2437
|
sendFileDownloadProgressQueryMessage(t, e, r) {
|
|
2336
2438
|
if (!this.isEmbedded())
|
|
2337
|
-
throw new
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2439
|
+
throw new h(this.currentContext);
|
|
2440
|
+
const s = "FILE DOWNLOAD PROGRESS QUERY", i = this.createMessage(
|
|
2441
|
+
s,
|
|
2340
2442
|
!0
|
|
2341
2443
|
);
|
|
2342
|
-
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(
|
|
2444
|
+
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(s, i);
|
|
2343
2445
|
const o = this.incomingMessages$.pipe(
|
|
2344
2446
|
y(
|
|
2345
2447
|
(a) => a.type === "FILE DOWNLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2346
2448
|
),
|
|
2347
2449
|
g((a) => this.logReceived(a)),
|
|
2348
2450
|
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2349
|
-
|
|
2451
|
+
C(1)
|
|
2350
2452
|
);
|
|
2351
|
-
return this.port2.postMessage(i), this.logSent(
|
|
2453
|
+
return this.port2.postMessage(i), this.logSent(s, i), o;
|
|
2352
2454
|
}
|
|
2353
2455
|
/**
|
|
2354
2456
|
* Setup listener for {@link FileDownloadProgressQueryMessage}, which can be sent by a `Host` app
|
|
@@ -2359,7 +2461,7 @@ class Mt {
|
|
|
2359
2461
|
*/
|
|
2360
2462
|
onFileDownloadProgressUpdateMessage() {
|
|
2361
2463
|
if (!this.isEmbedded())
|
|
2362
|
-
throw new
|
|
2464
|
+
throw new h(this.currentContext);
|
|
2363
2465
|
const t = "FILE DOWNLOAD PROGRESS UPDATE";
|
|
2364
2466
|
return this.incomingMessages$.pipe(
|
|
2365
2467
|
y(
|
|
@@ -2385,21 +2487,21 @@ class Mt {
|
|
|
2385
2487
|
*/
|
|
2386
2488
|
sendFileUploadProgressQueryMessage(t, e, r) {
|
|
2387
2489
|
if (!this.isEmbedded())
|
|
2388
|
-
throw new
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2490
|
+
throw new h(this.currentContext);
|
|
2491
|
+
const s = "FILE UPLOAD PROGRESS QUERY", i = this.createMessage(
|
|
2492
|
+
s,
|
|
2391
2493
|
!0
|
|
2392
2494
|
);
|
|
2393
|
-
i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = r, this.logCreated(
|
|
2495
|
+
i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = r, this.logCreated(s, i);
|
|
2394
2496
|
const o = this.incomingMessages$.pipe(
|
|
2395
2497
|
y(
|
|
2396
2498
|
(a) => a.type === "FILE UPLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2397
2499
|
),
|
|
2398
2500
|
g(this.logReceived()),
|
|
2399
2501
|
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2400
|
-
|
|
2502
|
+
C(1)
|
|
2401
2503
|
);
|
|
2402
|
-
return this.port2.postMessage(i), this.logSent(
|
|
2504
|
+
return this.port2.postMessage(i), this.logSent(s, i), o;
|
|
2403
2505
|
}
|
|
2404
2506
|
/**
|
|
2405
2507
|
* Setup listener for {@link FileUploadProgressQueryMessage}, which can be sent by a `Host` app to
|
|
@@ -2414,7 +2516,7 @@ class Mt {
|
|
|
2414
2516
|
*/
|
|
2415
2517
|
onFileUploadProgressUpdateMessage() {
|
|
2416
2518
|
if (!this.isEmbedded())
|
|
2417
|
-
throw new
|
|
2519
|
+
throw new h(this.currentContext);
|
|
2418
2520
|
const t = "FILE UPLOAD PROGRESS UPDATE";
|
|
2419
2521
|
return this.incomingMessages$.pipe(
|
|
2420
2522
|
y(
|
|
@@ -2449,9 +2551,9 @@ class Mt {
|
|
|
2449
2551
|
* @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the
|
|
2450
2552
|
* result of the request. Emits once.
|
|
2451
2553
|
*/
|
|
2452
|
-
sendFileDownloadMessage(t, e, r,
|
|
2554
|
+
sendFileDownloadMessage(t, e, r, s, i, o, a, c, l) {
|
|
2453
2555
|
if (!this.isEmbedded())
|
|
2454
|
-
throw new
|
|
2556
|
+
throw new h(this.currentContext);
|
|
2455
2557
|
if (c && this.compareVersion("2.1") < 0)
|
|
2456
2558
|
c.type === "cloudUsername" && c.contactUser && (c = {
|
|
2457
2559
|
...c,
|
|
@@ -2473,15 +2575,15 @@ class Mt {
|
|
|
2473
2575
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
2474
2576
|
);
|
|
2475
2577
|
}
|
|
2476
|
-
const
|
|
2477
|
-
u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType =
|
|
2578
|
+
const d = "FILE DOWNLOAD", u = this.createMessage(d, !0);
|
|
2579
|
+
u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = s, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(d, u);
|
|
2478
2580
|
const b = this.incomingMessages$.pipe(
|
|
2479
|
-
y((p) => p.type ===
|
|
2581
|
+
y((p) => p.type === d && p.replyTo === u.id),
|
|
2480
2582
|
g(this.logReceived()),
|
|
2481
2583
|
f((p) => p),
|
|
2482
|
-
|
|
2584
|
+
C(1)
|
|
2483
2585
|
);
|
|
2484
|
-
return this.port2.postMessage(u), this.logSent(
|
|
2586
|
+
return this.port2.postMessage(u), this.logSent(d, u), b;
|
|
2485
2587
|
}
|
|
2486
2588
|
/**
|
|
2487
2589
|
* Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file
|
|
@@ -2493,9 +2595,9 @@ class Mt {
|
|
|
2493
2595
|
*/
|
|
2494
2596
|
sendCancelFileDownloadMessage(t, e, r) {
|
|
2495
2597
|
if (!this.isEmbedded())
|
|
2496
|
-
throw new
|
|
2497
|
-
const
|
|
2498
|
-
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(
|
|
2598
|
+
throw new h(this.currentContext);
|
|
2599
|
+
const s = "CANCEL FILE DOWNLOAD", i = this.createMessage(s, !1);
|
|
2600
|
+
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i);
|
|
2499
2601
|
}
|
|
2500
2602
|
/**
|
|
2501
2603
|
* Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
|
|
@@ -2514,16 +2616,16 @@ class Mt {
|
|
|
2514
2616
|
*/
|
|
2515
2617
|
sendFileRemoveMessage(t, e) {
|
|
2516
2618
|
if (!this.isEmbedded())
|
|
2517
|
-
throw new
|
|
2518
|
-
const r = "FILE REMOVE",
|
|
2519
|
-
|
|
2619
|
+
throw new h(this.currentContext);
|
|
2620
|
+
const r = "FILE REMOVE", s = this.createMessage(r, !0);
|
|
2621
|
+
s.hash = t.toLowerCase(), s.streamId = e, this.logCreated(r, s);
|
|
2520
2622
|
const i = this.incomingMessages$.pipe(
|
|
2521
|
-
y((o) => o.type === r && o.replyTo ===
|
|
2623
|
+
y((o) => o.type === r && o.replyTo === s.id),
|
|
2522
2624
|
g(this.logReceived()),
|
|
2523
2625
|
f((o) => o),
|
|
2524
|
-
|
|
2626
|
+
C(1)
|
|
2525
2627
|
);
|
|
2526
|
-
return this.port2.postMessage(
|
|
2628
|
+
return this.port2.postMessage(s), this.logSent(r, s), i;
|
|
2527
2629
|
}
|
|
2528
2630
|
/**
|
|
2529
2631
|
* Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting
|
|
@@ -2540,7 +2642,7 @@ class Mt {
|
|
|
2540
2642
|
*/
|
|
2541
2643
|
sendAppResetMessage() {
|
|
2542
2644
|
if (!this.isEmbedded())
|
|
2543
|
-
throw new
|
|
2645
|
+
throw new h(this.currentContext);
|
|
2544
2646
|
const t = "APP RESET", e = this.createMessage(t, !1);
|
|
2545
2647
|
this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
|
|
2546
2648
|
}
|
|
@@ -2564,9 +2666,9 @@ class Mt {
|
|
|
2564
2666
|
*/
|
|
2565
2667
|
sendMessageSentMessage(t, e) {
|
|
2566
2668
|
if (!this.isEmbedded())
|
|
2567
|
-
throw new
|
|
2568
|
-
const r = "MESSAGE SENT",
|
|
2569
|
-
|
|
2669
|
+
throw new h(this.currentContext);
|
|
2670
|
+
const r = "MESSAGE SENT", s = this.createMessage(r, !1);
|
|
2671
|
+
s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2570
2672
|
}
|
|
2571
2673
|
/**
|
|
2572
2674
|
* Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.
|
|
@@ -2586,11 +2688,11 @@ class Mt {
|
|
|
2586
2688
|
* @returns An observable which emits a {@link SendMessageMessageReply} instance containing the
|
|
2587
2689
|
* result of the request. Emits once.
|
|
2588
2690
|
*/
|
|
2589
|
-
sendSendMessageMessage(t, e, r,
|
|
2691
|
+
sendSendMessageMessage(t, e, r, s = "TEXT", i, o, a, c = !0, l) {
|
|
2590
2692
|
if (!this.isEmbedded())
|
|
2591
|
-
throw new
|
|
2592
|
-
const
|
|
2593
|
-
if (u.streamId = t, u.correlationId = e, u.body = r, u.messageType =
|
|
2693
|
+
throw new h(this.currentContext);
|
|
2694
|
+
const d = "SEND MESSAGE", u = this.createMessage(d, !0);
|
|
2695
|
+
if (u.streamId = t, u.correlationId = e, u.body = r, u.messageType = s, i && i.length > 0)
|
|
2594
2696
|
if (this.compareVersion("2.1") < 0)
|
|
2595
2697
|
u.mentions = i.map((p) => p.contactUser ? {
|
|
2596
2698
|
...p,
|
|
@@ -2617,14 +2719,14 @@ class Mt {
|
|
|
2617
2719
|
}
|
|
2618
2720
|
else
|
|
2619
2721
|
u.mentions = [];
|
|
2620
|
-
u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(
|
|
2722
|
+
u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(d, u);
|
|
2621
2723
|
const b = this.incomingMessages$.pipe(
|
|
2622
|
-
y((p) => p.type ===
|
|
2724
|
+
y((p) => p.type === d && p.replyTo === u.id),
|
|
2623
2725
|
g(this.logReceived()),
|
|
2624
2726
|
f((p) => p),
|
|
2625
|
-
|
|
2727
|
+
C(1)
|
|
2626
2728
|
);
|
|
2627
|
-
return this.port2.postMessage(u), this.logSent(
|
|
2729
|
+
return this.port2.postMessage(u), this.logSent(d, u), b;
|
|
2628
2730
|
}
|
|
2629
2731
|
/**
|
|
2630
2732
|
* Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
|
|
@@ -2637,9 +2739,9 @@ class Mt {
|
|
|
2637
2739
|
*/
|
|
2638
2740
|
sendCancelSendMessageMessage(t, e) {
|
|
2639
2741
|
if (!this.isEmbedded())
|
|
2640
|
-
throw new
|
|
2641
|
-
const r = "CANCEL SEND MESSAGE",
|
|
2642
|
-
|
|
2742
|
+
throw new h(this.currentContext);
|
|
2743
|
+
const r = "CANCEL SEND MESSAGE", s = this.createMessage(r, !1);
|
|
2744
|
+
s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2643
2745
|
}
|
|
2644
2746
|
/**
|
|
2645
2747
|
* Sends a {@link MessageDeletedMessage} to the Host app, to notify deletion of a message from the
|
|
@@ -2650,9 +2752,9 @@ class Mt {
|
|
|
2650
2752
|
*/
|
|
2651
2753
|
sendMessageDeletedMessage(t, e) {
|
|
2652
2754
|
if (!this.isEmbedded())
|
|
2653
|
-
throw new
|
|
2654
|
-
const r = "MESSAGE DELETED",
|
|
2655
|
-
|
|
2755
|
+
throw new h(this.currentContext);
|
|
2756
|
+
const r = "MESSAGE DELETED", s = this.createMessage(r, !1);
|
|
2757
|
+
s.correlationId = t, s.streamId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2656
2758
|
}
|
|
2657
2759
|
/**
|
|
2658
2760
|
* Sends a {@link SendMessageStatusQueryMessage} to the Host app, to query the status of a message
|
|
@@ -2669,18 +2771,18 @@ class Mt {
|
|
|
2669
2771
|
*/
|
|
2670
2772
|
sendSendMessageStatusQueryMessage(t, e) {
|
|
2671
2773
|
if (!this.isEmbedded())
|
|
2672
|
-
throw new
|
|
2673
|
-
const r = "SEND MESSAGE STATUS QUERY",
|
|
2674
|
-
|
|
2774
|
+
throw new h(this.currentContext);
|
|
2775
|
+
const r = "SEND MESSAGE STATUS QUERY", s = this.createMessage(r, !0);
|
|
2776
|
+
s.correlationId = t, s.streamId = e, this.logCreated(r, s);
|
|
2675
2777
|
const i = this.incomingMessages$.pipe(
|
|
2676
2778
|
y(
|
|
2677
|
-
(o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo ===
|
|
2779
|
+
(o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo === s.id
|
|
2678
2780
|
),
|
|
2679
2781
|
g(this.logReceived()),
|
|
2680
2782
|
f((o) => o),
|
|
2681
|
-
|
|
2783
|
+
C(1)
|
|
2682
2784
|
);
|
|
2683
|
-
return this.port2.postMessage(
|
|
2785
|
+
return this.port2.postMessage(s), this.logSent(r, s), i;
|
|
2684
2786
|
}
|
|
2685
2787
|
/**
|
|
2686
2788
|
* Setup a listener for {@link SendMessageStatusUpdateMessage}, which can be sent by a Host app to
|
|
@@ -2691,7 +2793,7 @@ class Mt {
|
|
|
2691
2793
|
*/
|
|
2692
2794
|
onSendMessageStatusUpdateMessage() {
|
|
2693
2795
|
if (!this.isEmbedded())
|
|
2694
|
-
throw new
|
|
2796
|
+
throw new h(this.currentContext);
|
|
2695
2797
|
const t = "SEND MESSAGE STATUS UPDATE";
|
|
2696
2798
|
return this.incomingMessages$.pipe(
|
|
2697
2799
|
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
@@ -2709,7 +2811,7 @@ class Mt {
|
|
|
2709
2811
|
*/
|
|
2710
2812
|
sendSipCallMessage(t) {
|
|
2711
2813
|
if (!this.isEmbedded())
|
|
2712
|
-
throw new
|
|
2814
|
+
throw new h(this.currentContext);
|
|
2713
2815
|
if (this.compareVersion("2.1") < 0)
|
|
2714
2816
|
t.type === "cloudUsername" && t.contactUser && (t = {
|
|
2715
2817
|
...t,
|
|
@@ -2736,9 +2838,9 @@ class Mt {
|
|
|
2736
2838
|
}
|
|
2737
2839
|
sendCustomFunctionMessage(t, e) {
|
|
2738
2840
|
if (!this.isEmbedded())
|
|
2739
|
-
throw new
|
|
2740
|
-
const r = "CUSTOM FUNCTION",
|
|
2741
|
-
|
|
2841
|
+
throw new h(this.currentContext);
|
|
2842
|
+
const r = "CUSTOM FUNCTION", s = this.createMessage(r, !1);
|
|
2843
|
+
s.customFunctionId = t, s.context = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2742
2844
|
}
|
|
2743
2845
|
/**
|
|
2744
2846
|
* Sends a {@link SubscribeButtonsMessage} to the Host app to subscribe to button updates for
|
|
@@ -2754,7 +2856,7 @@ class Mt {
|
|
|
2754
2856
|
*/
|
|
2755
2857
|
sendSubscribeButtonsMessage(t) {
|
|
2756
2858
|
if (!this.isEmbedded())
|
|
2757
|
-
throw new
|
|
2859
|
+
throw new h(this.currentContext);
|
|
2758
2860
|
const e = "SUBSCRIBE BUTTONS", r = this.createMessage(e, !1);
|
|
2759
2861
|
r.subscribe = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
2760
2862
|
}
|
|
@@ -2785,7 +2887,7 @@ class Mt {
|
|
|
2785
2887
|
*/
|
|
2786
2888
|
onButtonsMessage() {
|
|
2787
2889
|
if (!this.isEmbedded())
|
|
2788
|
-
throw new
|
|
2890
|
+
throw new h(this.currentContext);
|
|
2789
2891
|
const t = "BUTTONS";
|
|
2790
2892
|
return this.incomingMessages$.pipe(
|
|
2791
2893
|
y((e) => e.type === t && e.target === "client"),
|
|
@@ -2830,7 +2932,7 @@ class Mt {
|
|
|
2830
2932
|
* version.
|
|
2831
2933
|
*/
|
|
2832
2934
|
compareVersion(t) {
|
|
2833
|
-
return
|
|
2935
|
+
return xe(this.negotiatedProtocolVersion, t);
|
|
2834
2936
|
}
|
|
2835
2937
|
logReceived(t) {
|
|
2836
2938
|
const e = (r) => this.logService.debug(
|
|
@@ -2838,7 +2940,7 @@ class Mt {
|
|
|
2838
2940
|
r
|
|
2839
2941
|
);
|
|
2840
2942
|
if (t) {
|
|
2841
|
-
|
|
2943
|
+
Mt(t) && (t = { ...t, data: "..." }), e(t);
|
|
2842
2944
|
return;
|
|
2843
2945
|
} else
|
|
2844
2946
|
return e;
|
|
@@ -2875,18 +2977,19 @@ class Mt {
|
|
|
2875
2977
|
}
|
|
2876
2978
|
generateId(t = 8, e = !1) {
|
|
2877
2979
|
let r = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
|
|
2878
|
-
const
|
|
2980
|
+
const s = [];
|
|
2879
2981
|
e && (r = r.substr(0, r.indexOf("Q")));
|
|
2880
2982
|
for (let i = 0; i < t; i++)
|
|
2881
|
-
|
|
2882
|
-
return
|
|
2983
|
+
s.push(r[Math.floor(Math.random() * r.length)]);
|
|
2984
|
+
return s.join("");
|
|
2883
2985
|
}
|
|
2884
2986
|
}
|
|
2885
|
-
function
|
|
2886
|
-
return
|
|
2987
|
+
function Mt(n) {
|
|
2988
|
+
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2887
2989
|
}
|
|
2888
|
-
|
|
2889
|
-
|
|
2990
|
+
var w = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n.RequestLogs = "REQUEST LOGS", n.CallInfo = "CALL INFO", n))(w || {});
|
|
2991
|
+
const Ut = ["2.2", "2.1", "2.0"];
|
|
2992
|
+
class Rt {
|
|
2890
2993
|
/**
|
|
2891
2994
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2892
2995
|
*
|
|
@@ -2901,23 +3004,23 @@ class xt {
|
|
|
2901
3004
|
/**
|
|
2902
3005
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2903
3006
|
*/
|
|
2904
|
-
|
|
3007
|
+
I(this, "host");
|
|
2905
3008
|
/**
|
|
2906
3009
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2907
3010
|
*/
|
|
2908
|
-
|
|
3011
|
+
I(this, "cloudId");
|
|
2909
3012
|
/**
|
|
2910
3013
|
* The cloud username of the logged in user.
|
|
2911
3014
|
*/
|
|
2912
|
-
|
|
3015
|
+
I(this, "cloudUsername");
|
|
2913
3016
|
/**
|
|
2914
3017
|
* The display name of the logged in user.
|
|
2915
3018
|
*/
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
this.logger = t ?? console, this.helper = new
|
|
3019
|
+
I(this, "displayName");
|
|
3020
|
+
I(this, "logger");
|
|
3021
|
+
I(this, "helper");
|
|
3022
|
+
I(this, "listeners");
|
|
3023
|
+
this.logger = t ?? console, this.helper = new It(Ut, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(w.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(w.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(w.PushToken, /* @__PURE__ */ new Set()), this.listeners.set(w.RequestLogs, /* @__PURE__ */ new Set()), this.listeners.set(w.CallInfo, /* @__PURE__ */ new Set());
|
|
2921
3024
|
}
|
|
2922
3025
|
/**
|
|
2923
3026
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2959,57 +3062,73 @@ class xt {
|
|
|
2959
3062
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2960
3063
|
var r;
|
|
2961
3064
|
this.logger.debug("Received Badge Query: ", e);
|
|
2962
|
-
for (const
|
|
2963
|
-
|
|
3065
|
+
for (const s of ((r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
3066
|
+
s();
|
|
2964
3067
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2965
3068
|
var r;
|
|
2966
3069
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2967
|
-
for (const
|
|
2968
|
-
|
|
3070
|
+
for (const s of ((r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
3071
|
+
s(e.eventName, e.payload);
|
|
2969
3072
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2970
3073
|
var r;
|
|
2971
3074
|
this.logger.debug("Received Push Token: ", e);
|
|
2972
|
-
for (const
|
|
2973
|
-
|
|
3075
|
+
for (const s of ((r = this.listeners.get(w.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
3076
|
+
s(e.pushToken, e.appId, e.selector);
|
|
2974
3077
|
}), this.helper.onRequestLogsMessage().subscribe((e) => {
|
|
2975
3078
|
var r;
|
|
2976
3079
|
if (this.logger.debug("Received Request Logs Message: ", e), e.responseType === "file")
|
|
2977
3080
|
throw this.logger.error("File response type not supported"), new Error("File response type not supported");
|
|
2978
|
-
for (const
|
|
2979
|
-
|
|
3081
|
+
for (const s of ((r = this.listeners.get(w.RequestLogs)) == null ? void 0 : r.values()) ?? [])
|
|
3082
|
+
s(e.skipCompression);
|
|
3083
|
+
}), this.helper.onCallInfoMessage().subscribe((e) => {
|
|
3084
|
+
var r;
|
|
3085
|
+
this.logger.debug("Received Call Info update: ", e);
|
|
3086
|
+
for (const s of ((r = this.listeners.get(w.CallInfo)) == null ? void 0 : r.values()) ?? [])
|
|
3087
|
+
s(e.calls);
|
|
2980
3088
|
}), this.cloudId = t.cloudId, this.cloudUsername = t.cloudUsername, this.displayName = t.displayName, this.host = t.host;
|
|
2981
3089
|
}),
|
|
2982
|
-
|
|
3090
|
+
R(() => {
|
|
2983
3091
|
})
|
|
2984
3092
|
)
|
|
2985
3093
|
);
|
|
2986
3094
|
}
|
|
2987
|
-
selectContacts(t, e, r,
|
|
3095
|
+
selectContacts(t, e, r, s) {
|
|
2988
3096
|
this.logger.debug("Selecting Contacts: ", ...arguments);
|
|
2989
3097
|
let i;
|
|
2990
3098
|
if (this.negotiatedVersion === "2.0") {
|
|
2991
|
-
if (typeof e
|
|
3099
|
+
if (typeof e == "object")
|
|
3100
|
+
throw new V("2.1", this.negotiatedVersion);
|
|
3101
|
+
if (typeof e != "string" && e !== void 0)
|
|
2992
3102
|
throw new m("mode", e, 'mode must be "single" or "multi"');
|
|
2993
|
-
if (
|
|
3103
|
+
if (s === "number")
|
|
2994
3104
|
throw new m(
|
|
2995
3105
|
"contactType",
|
|
2996
|
-
|
|
3106
|
+
s,
|
|
2997
3107
|
'contactType cannot be "number" for version 2.0 of the IPC protocol'
|
|
2998
3108
|
);
|
|
2999
3109
|
i = this.selectContacts_V2_0(
|
|
3000
3110
|
t,
|
|
3001
3111
|
e ?? "single",
|
|
3002
3112
|
e === "multi" ? r : void 0,
|
|
3003
|
-
e === "multi" ?
|
|
3113
|
+
e === "multi" ? s : r
|
|
3004
3114
|
);
|
|
3005
|
-
} else
|
|
3006
|
-
if (typeof e != "object")
|
|
3007
|
-
throw new m("options", e, "options must be an object");
|
|
3115
|
+
} else if (typeof e == "object")
|
|
3008
3116
|
i = this.selectContacts_V2_1(t, e);
|
|
3117
|
+
else {
|
|
3118
|
+
this.logger.warn(
|
|
3119
|
+
"The string-based selectContacts API is deprecated. Please use the options object API instead."
|
|
3120
|
+
);
|
|
3121
|
+
const o = e ?? "single", a = o === "multi" ? r : void 0, c = o === "multi" ? s : r, l = {
|
|
3122
|
+
mode: o,
|
|
3123
|
+
filterToSelectedType: !1,
|
|
3124
|
+
currentContacts: a,
|
|
3125
|
+
resultTypes: c ? [c] : ["cloudUsername"]
|
|
3126
|
+
};
|
|
3127
|
+
i = this.selectContacts_V2_1(t, l);
|
|
3009
3128
|
}
|
|
3010
3129
|
return T(
|
|
3011
3130
|
i.pipe(
|
|
3012
|
-
|
|
3131
|
+
R((o) => o.result === "error" ? {
|
|
3013
3132
|
result: "error",
|
|
3014
3133
|
errorMessage: o.errorMessage
|
|
3015
3134
|
} : o.result === "cancelled" ? {
|
|
@@ -3018,7 +3137,7 @@ class xt {
|
|
|
3018
3137
|
)
|
|
3019
3138
|
);
|
|
3020
3139
|
}
|
|
3021
|
-
selectContacts_V2_0(t, e, r,
|
|
3140
|
+
selectContacts_V2_0(t, e, r, s) {
|
|
3022
3141
|
if (this.logger.debug("Selecting Contacts: ", ...arguments), e === "multi") {
|
|
3023
3142
|
if (!r || !Array.isArray(r))
|
|
3024
3143
|
throw new m(
|
|
@@ -3026,22 +3145,22 @@ class xt {
|
|
|
3026
3145
|
r,
|
|
3027
3146
|
"currentContacts is required for group streams"
|
|
3028
3147
|
);
|
|
3029
|
-
return
|
|
3148
|
+
return s || (s = "cloudUsername"), this.helper.selectContacts(
|
|
3030
3149
|
t.toString(),
|
|
3031
3150
|
"group",
|
|
3032
|
-
|
|
3151
|
+
s,
|
|
3033
3152
|
r
|
|
3034
3153
|
);
|
|
3035
3154
|
} else
|
|
3036
|
-
return
|
|
3155
|
+
return s || (s = "cloudUsername"), this.helper.selectContacts(t.toString(), "direct", s);
|
|
3037
3156
|
}
|
|
3038
3157
|
selectContacts_V2_1(t, e) {
|
|
3039
3158
|
this.logger.debug("Selecting Contacts: ", e);
|
|
3040
|
-
const r = t.toString(),
|
|
3159
|
+
const r = t.toString(), s = e.resultTypes ?? ["cloudUsername"];
|
|
3041
3160
|
if (e.mode === "single")
|
|
3042
3161
|
return this.helper.selectContacts(r, {
|
|
3043
3162
|
allowMultipleSelection: !1,
|
|
3044
|
-
resultTypes:
|
|
3163
|
+
resultTypes: s
|
|
3045
3164
|
});
|
|
3046
3165
|
if (!e.currentContacts || !Array.isArray(e.currentContacts))
|
|
3047
3166
|
throw new m(
|
|
@@ -3054,7 +3173,7 @@ class xt {
|
|
|
3054
3173
|
{
|
|
3055
3174
|
allowMultipleSelection: !0,
|
|
3056
3175
|
filterToSelectedType: !0,
|
|
3057
|
-
resultTypes:
|
|
3176
|
+
resultTypes: s
|
|
3058
3177
|
},
|
|
3059
3178
|
e.currentContacts
|
|
3060
3179
|
) : this.helper.selectContacts(
|
|
@@ -3062,7 +3181,7 @@ class xt {
|
|
|
3062
3181
|
{
|
|
3063
3182
|
allowMultipleSelection: !0,
|
|
3064
3183
|
filterToSelectedType: !1,
|
|
3065
|
-
resultTypes:
|
|
3184
|
+
resultTypes: s
|
|
3066
3185
|
},
|
|
3067
3186
|
e.currentContacts
|
|
3068
3187
|
);
|
|
@@ -3077,7 +3196,7 @@ class xt {
|
|
|
3077
3196
|
* Host's contact list.
|
|
3078
3197
|
*/
|
|
3079
3198
|
matchContacts(t) {
|
|
3080
|
-
return this.logger.debug("Match Contacts: ", t), T(this.helper.matchContacts(t).pipe(
|
|
3199
|
+
return this.logger.debug("Match Contacts: ", t), T(this.helper.matchContacts(t).pipe(R((e) => e.contacts)));
|
|
3081
3200
|
}
|
|
3082
3201
|
/**
|
|
3083
3202
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -3085,7 +3204,7 @@ class xt {
|
|
|
3085
3204
|
* @returns A promise with the Push Token as `string`.
|
|
3086
3205
|
*/
|
|
3087
3206
|
requestPushToken() {
|
|
3088
|
-
return this.logger.debug("Requesting Push Token"), T(this.helper.requestPushToken().pipe(
|
|
3207
|
+
return this.logger.debug("Requesting Push Token"), T(this.helper.requestPushToken().pipe(R((t) => t.pushToken)));
|
|
3089
3208
|
}
|
|
3090
3209
|
/**
|
|
3091
3210
|
* Sends the current badge count to the `Host` app.
|
|
@@ -3154,9 +3273,9 @@ class xt {
|
|
|
3154
3273
|
*/
|
|
3155
3274
|
onBadgeQueryRequest(t) {
|
|
3156
3275
|
var e;
|
|
3157
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
3276
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(w.BadgeQuery)) == null || e.add(t), () => {
|
|
3158
3277
|
var r;
|
|
3159
|
-
return (r = this.listeners.get(
|
|
3278
|
+
return (r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
3160
3279
|
};
|
|
3161
3280
|
}
|
|
3162
3281
|
/**
|
|
@@ -3173,9 +3292,9 @@ class xt {
|
|
|
3173
3292
|
*/
|
|
3174
3293
|
onLifecycleEvent(t) {
|
|
3175
3294
|
var e;
|
|
3176
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
3295
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(w.Lifecycle)) == null || e.add(t), () => {
|
|
3177
3296
|
var r;
|
|
3178
|
-
return (r = this.listeners.get(
|
|
3297
|
+
return (r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
3179
3298
|
};
|
|
3180
3299
|
}
|
|
3181
3300
|
/**
|
|
@@ -3191,9 +3310,9 @@ class xt {
|
|
|
3191
3310
|
*/
|
|
3192
3311
|
onPushToken(t) {
|
|
3193
3312
|
var e;
|
|
3194
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(
|
|
3313
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(w.PushToken)) == null || e.add(t), () => {
|
|
3195
3314
|
var r;
|
|
3196
|
-
return (r = this.listeners.get(
|
|
3315
|
+
return (r = this.listeners.get(w.PushToken)) == null ? void 0 : r.delete(t);
|
|
3197
3316
|
};
|
|
3198
3317
|
}
|
|
3199
3318
|
/**
|
|
@@ -3213,9 +3332,48 @@ class xt {
|
|
|
3213
3332
|
*/
|
|
3214
3333
|
onRequestLogsMessage(t) {
|
|
3215
3334
|
var e;
|
|
3216
|
-
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(
|
|
3335
|
+
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(w.RequestLogs)) == null || e.add(t), () => {
|
|
3336
|
+
var r;
|
|
3337
|
+
return (r = this.listeners.get(w.RequestLogs)) == null ? void 0 : r.delete(t);
|
|
3338
|
+
};
|
|
3339
|
+
}
|
|
3340
|
+
/**
|
|
3341
|
+
* Requests the current call information from the `Host` app.
|
|
3342
|
+
*
|
|
3343
|
+
* @remarks
|
|
3344
|
+
* This method requires protocol version 2.2 or higher. If the negotiated version
|
|
3345
|
+
* is lower, an {@link UnsupportedVersionError} will be thrown.
|
|
3346
|
+
*
|
|
3347
|
+
* @returns A promise with an array of {@link CallInfoItem} objects representing
|
|
3348
|
+
* the current calls.
|
|
3349
|
+
*
|
|
3350
|
+
* @throws {@link UnsupportedVersionError} if the negotiated version is below 2.2.
|
|
3351
|
+
*/
|
|
3352
|
+
requestCallInfo() {
|
|
3353
|
+
if (this.logger.debug("Requesting Call Info"), this.negotiatedVersion === "2.0" || this.negotiatedVersion === "2.1")
|
|
3354
|
+
throw new V("2.2", this.negotiatedVersion);
|
|
3355
|
+
return T(this.helper.requestCallInfo().pipe(R((t) => t.calls)));
|
|
3356
|
+
}
|
|
3357
|
+
/**
|
|
3358
|
+
* Registers a callback to be invoked when a {@link IPCEvents.CallInfo} event is received.
|
|
3359
|
+
*
|
|
3360
|
+
* @remarks
|
|
3361
|
+
* The Host app sends CALL INFO updates when call state changes occur. This includes
|
|
3362
|
+
* new calls, call state transitions, and call terminations.
|
|
3363
|
+
*
|
|
3364
|
+
* Note: This event is only available on protocol version 2.2 or higher. On lower versions,
|
|
3365
|
+
* the callback will never be invoked.
|
|
3366
|
+
*
|
|
3367
|
+
* @param callback - A callback function to be invoked when a {@link IPCEvents.CallInfo} event
|
|
3368
|
+
* is received. The callback receives an array of {@link CallInfoItem} objects.
|
|
3369
|
+
*
|
|
3370
|
+
* @returns An unsubscribe callback to remove the listener.
|
|
3371
|
+
*/
|
|
3372
|
+
onCallInfo(t) {
|
|
3373
|
+
var e;
|
|
3374
|
+
return this.logger.debug("Registering for Call Info updates"), (e = this.listeners.get(w.CallInfo)) == null || e.add(t), () => {
|
|
3217
3375
|
var r;
|
|
3218
|
-
return (r = this.listeners.get(
|
|
3376
|
+
return (r = this.listeners.get(w.CallInfo)) == null ? void 0 : r.delete(t);
|
|
3219
3377
|
};
|
|
3220
3378
|
}
|
|
3221
3379
|
evaluateContext(t) {
|
|
@@ -3226,6 +3384,8 @@ class xt {
|
|
|
3226
3384
|
}
|
|
3227
3385
|
}
|
|
3228
3386
|
export {
|
|
3229
|
-
|
|
3230
|
-
|
|
3387
|
+
w as IPCEvents,
|
|
3388
|
+
Rt as IPCManager,
|
|
3389
|
+
m as InvalidParameterError,
|
|
3390
|
+
V as UnsupportedVersionError
|
|
3231
3391
|
};
|