@asgard-js/core 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/enum.d.ts +4 -0
- package/dist/constants/enum.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +803 -755
- package/dist/index.mjs.map +1 -1
- package/dist/lib/client.d.ts +7 -3
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/conversation.d.ts +1 -4
- package/dist/lib/conversation.d.ts.map +1 -1
- package/dist/lib/create-sse-observable.d.ts +2 -1
- package/dist/lib/create-sse-observable.d.ts.map +1 -1
- package/dist/lib/event-emitter.d.ts +8 -0
- package/dist/lib/event-emitter.d.ts.map +1 -0
- package/dist/types/client.d.ts +24 -4
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/event-emitter.d.ts +5 -0
- package/dist/types/event-emitter.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var De = (r, t, e) => t in r ? Le(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var m = (r, t, e) => De(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
var K = /* @__PURE__ */ ((r) => (r.RESET_CHANNEL = "RESET_CHANNEL", r.NONE = "NONE", r))(K || {}), y = /* @__PURE__ */ ((r) => (r.INIT = "asgard.run.init", r.PROCESS = "asgard.process", r.PROCESS_START = "asgard.process.start", r.PROCESS_COMPLETE = "asgard.process.complete", r.MESSAGE = "asgard.message", r.MESSAGE_START = "asgard.message.start", r.MESSAGE_DELTA = "asgard.message.delta", r.MESSAGE_COMPLETE = "asgard.message.complete", r.DONE = "asgard.run.done", r.ERROR = "asgard.run.error", r))(y || {}), Ue = /* @__PURE__ */ ((r) => (r.TEXT = "TEXT", r.HINT = "HINT", r.BUTTON = "BUTTON", r.IMAGE = "IMAGE", r.VIDEO = "VIDEO", r.AUDIO = "AUDIO", r.LOCATION = "LOCATION", r.CAROUSEL = "CAROUSEL", r))(Ue || {}), Y = function(r, t) {
|
|
5
|
+
return Y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
|
|
6
6
|
e.__proto__ = n;
|
|
7
7
|
} || function(e, n) {
|
|
8
8
|
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
9
|
-
},
|
|
9
|
+
}, Y(r, t);
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
if (typeof
|
|
13
|
-
throw new TypeError("Class extends value " + String(
|
|
14
|
-
|
|
11
|
+
function O(r, t) {
|
|
12
|
+
if (typeof t != "function" && t !== null)
|
|
13
|
+
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
14
|
+
Y(r, t);
|
|
15
15
|
function e() {
|
|
16
|
-
this.constructor =
|
|
16
|
+
this.constructor = r;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Ne(r, t, e, n) {
|
|
21
21
|
function i(o) {
|
|
22
22
|
return o instanceof e ? o : new e(function(s) {
|
|
23
23
|
s(o);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
return new (e || (e = Promise))(function(o, s) {
|
|
27
|
-
function c(
|
|
27
|
+
function c(l) {
|
|
28
28
|
try {
|
|
29
|
-
a(n.next(
|
|
29
|
+
a(n.next(l));
|
|
30
30
|
} catch (d) {
|
|
31
31
|
s(d);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function u(
|
|
34
|
+
function u(l) {
|
|
35
35
|
try {
|
|
36
|
-
a(n.throw(
|
|
36
|
+
a(n.throw(l));
|
|
37
37
|
} catch (d) {
|
|
38
38
|
s(d);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function a(
|
|
42
|
-
|
|
41
|
+
function a(l) {
|
|
42
|
+
l.done ? o(l.value) : i(l.value).then(c, u);
|
|
43
43
|
}
|
|
44
|
-
a((n = n.apply(
|
|
44
|
+
a((n = n.apply(r, t || [])).next());
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ce(r, t) {
|
|
48
48
|
var e = { label: 0, sent: function() {
|
|
49
49
|
if (o[0] & 1) throw o[1];
|
|
50
50
|
return o[1];
|
|
@@ -53,8 +53,8 @@ function ue(t, r) {
|
|
|
53
53
|
return this;
|
|
54
54
|
}), s;
|
|
55
55
|
function c(a) {
|
|
56
|
-
return function(
|
|
57
|
-
return u([a,
|
|
56
|
+
return function(l) {
|
|
57
|
+
return u([a, l]);
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
function u(a) {
|
|
@@ -94,9 +94,9 @@ function ue(t, r) {
|
|
|
94
94
|
o[2] && e.ops.pop(), e.trys.pop();
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
97
|
-
a =
|
|
98
|
-
} catch (
|
|
99
|
-
a = [6,
|
|
97
|
+
a = t.call(r, e);
|
|
98
|
+
} catch (l) {
|
|
99
|
+
a = [6, l], i = 0;
|
|
100
100
|
} finally {
|
|
101
101
|
n = o = 0;
|
|
102
102
|
}
|
|
@@ -104,22 +104,22 @@ function ue(t, r) {
|
|
|
104
104
|
return { value: a[0] ? a[1] : void 0, done: !0 };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
var
|
|
109
|
-
if (e) return e.call(
|
|
110
|
-
if (
|
|
107
|
+
function M(r) {
|
|
108
|
+
var t = typeof Symbol == "function" && Symbol.iterator, e = t && r[t], n = 0;
|
|
109
|
+
if (e) return e.call(r);
|
|
110
|
+
if (r && typeof r.length == "number") return {
|
|
111
111
|
next: function() {
|
|
112
|
-
return
|
|
112
|
+
return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
throw new TypeError(
|
|
115
|
+
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var e = typeof Symbol == "function" &&
|
|
119
|
-
if (!e) return
|
|
120
|
-
var n = e.call(
|
|
117
|
+
function R(r, t) {
|
|
118
|
+
var e = typeof Symbol == "function" && r[Symbol.iterator];
|
|
119
|
+
if (!e) return r;
|
|
120
|
+
var n = e.call(r), i, o = [], s;
|
|
121
121
|
try {
|
|
122
|
-
for (; (
|
|
122
|
+
for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; ) o.push(i.value);
|
|
123
123
|
} catch (c) {
|
|
124
124
|
s = { error: c };
|
|
125
125
|
} finally {
|
|
@@ -131,62 +131,62 @@ function M(t, r) {
|
|
|
131
131
|
}
|
|
132
132
|
return o;
|
|
133
133
|
}
|
|
134
|
-
function k(
|
|
135
|
-
if (e || arguments.length === 2) for (var n = 0, i =
|
|
136
|
-
(o || !(n in
|
|
137
|
-
return
|
|
134
|
+
function k(r, t, e) {
|
|
135
|
+
if (e || arguments.length === 2) for (var n = 0, i = t.length, o; n < i; n++)
|
|
136
|
+
(o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
|
|
137
|
+
return r.concat(o || Array.prototype.slice.call(t));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return this instanceof
|
|
139
|
+
function C(r) {
|
|
140
|
+
return this instanceof C ? (this.v = r, this) : new C(r);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function $e(r, t, e) {
|
|
143
143
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
144
|
-
var n = e.apply(
|
|
144
|
+
var n = e.apply(r, t || []), i, o = [];
|
|
145
145
|
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", s), i[Symbol.asyncIterator] = function() {
|
|
146
146
|
return this;
|
|
147
147
|
}, i;
|
|
148
|
-
function s(
|
|
148
|
+
function s(f) {
|
|
149
149
|
return function(v) {
|
|
150
|
-
return Promise.resolve(v).then(
|
|
150
|
+
return Promise.resolve(v).then(f, d);
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function c(
|
|
154
|
-
n[
|
|
155
|
-
return new Promise(function(
|
|
156
|
-
o.push([
|
|
153
|
+
function c(f, v) {
|
|
154
|
+
n[f] && (i[f] = function(h) {
|
|
155
|
+
return new Promise(function(S, w) {
|
|
156
|
+
o.push([f, h, S, w]) > 1 || u(f, h);
|
|
157
157
|
});
|
|
158
|
-
}, v && (i[
|
|
158
|
+
}, v && (i[f] = v(i[f])));
|
|
159
159
|
}
|
|
160
|
-
function u(
|
|
160
|
+
function u(f, v) {
|
|
161
161
|
try {
|
|
162
|
-
a(n[
|
|
162
|
+
a(n[f](v));
|
|
163
163
|
} catch (h) {
|
|
164
|
-
|
|
164
|
+
b(o[0][3], h);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function a(
|
|
168
|
-
|
|
167
|
+
function a(f) {
|
|
168
|
+
f.value instanceof C ? Promise.resolve(f.value.v).then(l, d) : b(o[0][2], f);
|
|
169
169
|
}
|
|
170
|
-
function f
|
|
171
|
-
u("next",
|
|
170
|
+
function l(f) {
|
|
171
|
+
u("next", f);
|
|
172
172
|
}
|
|
173
|
-
function d(
|
|
174
|
-
u("throw",
|
|
173
|
+
function d(f) {
|
|
174
|
+
u("throw", f);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
|
|
176
|
+
function b(f, v) {
|
|
177
|
+
f(v), o.shift(), o.length && u(o[0][0], o[0][1]);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
function Ge(
|
|
180
|
+
function Ge(r) {
|
|
181
181
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
182
|
-
var
|
|
183
|
-
return
|
|
182
|
+
var t = r[Symbol.asyncIterator], e;
|
|
183
|
+
return t ? t.call(r) : (r = typeof M == "function" ? M(r) : r[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
|
|
184
184
|
return this;
|
|
185
185
|
}, e);
|
|
186
186
|
function n(o) {
|
|
187
|
-
e[o] =
|
|
187
|
+
e[o] = r[o] && function(s) {
|
|
188
188
|
return new Promise(function(c, u) {
|
|
189
|
-
s =
|
|
189
|
+
s = r[o](s), i(c, u, s.done, s.value);
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -196,272 +196,272 @@ function Ge(t) {
|
|
|
196
196
|
}, s);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return typeof
|
|
199
|
+
function p(r) {
|
|
200
|
+
return typeof r == "function";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
var
|
|
202
|
+
function le(r) {
|
|
203
|
+
var t = function(n) {
|
|
204
204
|
Error.call(n), n.stack = new Error().stack;
|
|
205
|
-
}, e = t
|
|
205
|
+
}, e = r(t);
|
|
206
206
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var B = le(function(r) {
|
|
209
209
|
return function(e) {
|
|
210
|
-
|
|
210
|
+
r(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
211
211
|
` + e.map(function(n, i) {
|
|
212
212
|
return i + 1 + ") " + n.toString();
|
|
213
213
|
}).join(`
|
|
214
214
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
|
-
function
|
|
218
|
-
if (
|
|
219
|
-
var e =
|
|
220
|
-
0 <= e &&
|
|
217
|
+
function N(r, t) {
|
|
218
|
+
if (r) {
|
|
219
|
+
var e = r.indexOf(t);
|
|
220
|
+
0 <= e && r.splice(e, 1);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
function t
|
|
225
|
-
this.initialTeardown =
|
|
223
|
+
var j = function() {
|
|
224
|
+
function r(t) {
|
|
225
|
+
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
226
226
|
}
|
|
227
|
-
return
|
|
228
|
-
var
|
|
227
|
+
return r.prototype.unsubscribe = function() {
|
|
228
|
+
var t, e, n, i, o;
|
|
229
229
|
if (!this.closed) {
|
|
230
230
|
this.closed = !0;
|
|
231
231
|
var s = this._parentage;
|
|
232
232
|
if (s)
|
|
233
233
|
if (this._parentage = null, Array.isArray(s))
|
|
234
234
|
try {
|
|
235
|
-
for (var c =
|
|
235
|
+
for (var c = M(s), u = c.next(); !u.done; u = c.next()) {
|
|
236
236
|
var a = u.value;
|
|
237
237
|
a.remove(this);
|
|
238
238
|
}
|
|
239
239
|
} catch (h) {
|
|
240
|
-
|
|
240
|
+
t = { error: h };
|
|
241
241
|
} finally {
|
|
242
242
|
try {
|
|
243
243
|
u && !u.done && (e = c.return) && e.call(c);
|
|
244
244
|
} finally {
|
|
245
|
-
if (
|
|
245
|
+
if (t) throw t.error;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
else
|
|
249
249
|
s.remove(this);
|
|
250
|
-
var
|
|
251
|
-
if (
|
|
250
|
+
var l = this.initialTeardown;
|
|
251
|
+
if (p(l))
|
|
252
252
|
try {
|
|
253
|
-
|
|
253
|
+
l();
|
|
254
254
|
} catch (h) {
|
|
255
|
-
o = h instanceof
|
|
255
|
+
o = h instanceof B ? h.errors : [h];
|
|
256
256
|
}
|
|
257
257
|
var d = this._finalizers;
|
|
258
258
|
if (d) {
|
|
259
259
|
this._finalizers = null;
|
|
260
260
|
try {
|
|
261
|
-
for (var
|
|
262
|
-
var v =
|
|
261
|
+
for (var b = M(d), f = b.next(); !f.done; f = b.next()) {
|
|
262
|
+
var v = f.value;
|
|
263
263
|
try {
|
|
264
|
-
|
|
264
|
+
ee(v);
|
|
265
265
|
} catch (h) {
|
|
266
|
-
o = o ?? [], h instanceof
|
|
266
|
+
o = o ?? [], h instanceof B ? o = k(k([], R(o)), R(h.errors)) : o.push(h);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
} catch (h) {
|
|
270
270
|
n = { error: h };
|
|
271
271
|
} finally {
|
|
272
272
|
try {
|
|
273
|
-
|
|
273
|
+
f && !f.done && (i = b.return) && i.call(b);
|
|
274
274
|
} finally {
|
|
275
275
|
if (n) throw n.error;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
if (o)
|
|
280
|
-
throw new
|
|
280
|
+
throw new B(o);
|
|
281
281
|
}
|
|
282
|
-
},
|
|
282
|
+
}, r.prototype.add = function(t) {
|
|
283
283
|
var e;
|
|
284
|
-
if (
|
|
284
|
+
if (t && t !== this)
|
|
285
285
|
if (this.closed)
|
|
286
|
-
|
|
286
|
+
ee(t);
|
|
287
287
|
else {
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
288
|
+
if (t instanceof r) {
|
|
289
|
+
if (t.closed || t._hasParent(this))
|
|
290
290
|
return;
|
|
291
|
-
|
|
291
|
+
t._addParent(this);
|
|
292
292
|
}
|
|
293
|
-
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(
|
|
293
|
+
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, r.prototype._hasParent = function(t) {
|
|
296
296
|
var e = this._parentage;
|
|
297
|
-
return e ===
|
|
298
|
-
},
|
|
297
|
+
return e === t || Array.isArray(e) && e.includes(t);
|
|
298
|
+
}, r.prototype._addParent = function(t) {
|
|
299
299
|
var e = this._parentage;
|
|
300
|
-
this._parentage = Array.isArray(e) ? (e.push(
|
|
301
|
-
},
|
|
300
|
+
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
301
|
+
}, r.prototype._removeParent = function(t) {
|
|
302
302
|
var e = this._parentage;
|
|
303
|
-
e ===
|
|
304
|
-
},
|
|
303
|
+
e === t ? this._parentage = null : Array.isArray(e) && N(e, t);
|
|
304
|
+
}, r.prototype.remove = function(t) {
|
|
305
305
|
var e = this._finalizers;
|
|
306
|
-
e &&
|
|
307
|
-
},
|
|
308
|
-
var
|
|
309
|
-
return
|
|
310
|
-
}(),
|
|
311
|
-
}(),
|
|
312
|
-
function
|
|
313
|
-
return
|
|
314
|
-
}
|
|
315
|
-
function
|
|
316
|
-
|
|
306
|
+
e && N(e, t), t instanceof r && t._removeParent(this);
|
|
307
|
+
}, r.EMPTY = function() {
|
|
308
|
+
var t = new r();
|
|
309
|
+
return t.closed = !0, t;
|
|
310
|
+
}(), r;
|
|
311
|
+
}(), fe = j.EMPTY;
|
|
312
|
+
function he(r) {
|
|
313
|
+
return r instanceof j || r && "closed" in r && p(r.remove) && p(r.add) && p(r.unsubscribe);
|
|
314
|
+
}
|
|
315
|
+
function ee(r) {
|
|
316
|
+
p(r) ? r() : r.unsubscribe();
|
|
317
317
|
}
|
|
318
318
|
var Fe = {
|
|
319
319
|
Promise: void 0
|
|
320
320
|
}, Ve = {
|
|
321
|
-
setTimeout: function(
|
|
321
|
+
setTimeout: function(r, t) {
|
|
322
322
|
for (var e = [], n = 2; n < arguments.length; n++)
|
|
323
323
|
e[n - 2] = arguments[n];
|
|
324
|
-
return setTimeout.apply(void 0, k([
|
|
324
|
+
return setTimeout.apply(void 0, k([r, t], R(e)));
|
|
325
325
|
},
|
|
326
|
-
clearTimeout: function(
|
|
327
|
-
return clearTimeout(
|
|
326
|
+
clearTimeout: function(r) {
|
|
327
|
+
return clearTimeout(r);
|
|
328
328
|
},
|
|
329
329
|
delegate: void 0
|
|
330
330
|
};
|
|
331
|
-
function
|
|
331
|
+
function de(r) {
|
|
332
332
|
Ve.setTimeout(function() {
|
|
333
|
-
throw
|
|
333
|
+
throw r;
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function q() {
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
338
|
+
function U(r) {
|
|
339
|
+
r();
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
function
|
|
344
|
-
var n =
|
|
345
|
-
return n.isStopped = !1, e ? (n.destination = e,
|
|
341
|
+
var X = function(r) {
|
|
342
|
+
O(t, r);
|
|
343
|
+
function t(e) {
|
|
344
|
+
var n = r.call(this) || this;
|
|
345
|
+
return n.isStopped = !1, e ? (n.destination = e, he(e) && e.add(n)) : n.destination = Ke, n;
|
|
346
346
|
}
|
|
347
|
-
return
|
|
348
|
-
return new
|
|
349
|
-
},
|
|
347
|
+
return t.create = function(e, n, i) {
|
|
348
|
+
return new W(e, n, i);
|
|
349
|
+
}, t.prototype.next = function(e) {
|
|
350
350
|
this.isStopped || this._next(e);
|
|
351
|
-
},
|
|
351
|
+
}, t.prototype.error = function(e) {
|
|
352
352
|
this.isStopped || (this.isStopped = !0, this._error(e));
|
|
353
|
-
},
|
|
353
|
+
}, t.prototype.complete = function() {
|
|
354
354
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
355
|
-
},
|
|
356
|
-
this.closed || (this.isStopped = !0,
|
|
357
|
-
},
|
|
355
|
+
}, t.prototype.unsubscribe = function() {
|
|
356
|
+
this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
|
|
357
|
+
}, t.prototype._next = function(e) {
|
|
358
358
|
this.destination.next(e);
|
|
359
|
-
},
|
|
359
|
+
}, t.prototype._error = function(e) {
|
|
360
360
|
try {
|
|
361
361
|
this.destination.error(e);
|
|
362
362
|
} finally {
|
|
363
363
|
this.unsubscribe();
|
|
364
364
|
}
|
|
365
|
-
},
|
|
365
|
+
}, t.prototype._complete = function() {
|
|
366
366
|
try {
|
|
367
367
|
this.destination.complete();
|
|
368
368
|
} finally {
|
|
369
369
|
this.unsubscribe();
|
|
370
370
|
}
|
|
371
|
-
},
|
|
372
|
-
}(
|
|
373
|
-
function t
|
|
374
|
-
this.partialObserver =
|
|
371
|
+
}, t;
|
|
372
|
+
}(j), He = function() {
|
|
373
|
+
function r(t) {
|
|
374
|
+
this.partialObserver = t;
|
|
375
375
|
}
|
|
376
|
-
return
|
|
376
|
+
return r.prototype.next = function(t) {
|
|
377
377
|
var e = this.partialObserver;
|
|
378
378
|
if (e.next)
|
|
379
379
|
try {
|
|
380
|
-
e.next(
|
|
380
|
+
e.next(t);
|
|
381
381
|
} catch (n) {
|
|
382
|
-
|
|
382
|
+
D(n);
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, r.prototype.error = function(t) {
|
|
385
385
|
var e = this.partialObserver;
|
|
386
386
|
if (e.error)
|
|
387
387
|
try {
|
|
388
|
-
e.error(
|
|
388
|
+
e.error(t);
|
|
389
389
|
} catch (n) {
|
|
390
|
-
|
|
390
|
+
D(n);
|
|
391
391
|
}
|
|
392
392
|
else
|
|
393
|
-
|
|
394
|
-
},
|
|
395
|
-
var
|
|
396
|
-
if (
|
|
393
|
+
D(t);
|
|
394
|
+
}, r.prototype.complete = function() {
|
|
395
|
+
var t = this.partialObserver;
|
|
396
|
+
if (t.complete)
|
|
397
397
|
try {
|
|
398
|
-
|
|
398
|
+
t.complete();
|
|
399
399
|
} catch (e) {
|
|
400
|
-
|
|
400
|
+
D(e);
|
|
401
401
|
}
|
|
402
|
-
},
|
|
403
|
-
}(),
|
|
404
|
-
|
|
405
|
-
function
|
|
406
|
-
var o =
|
|
407
|
-
return
|
|
402
|
+
}, r;
|
|
403
|
+
}(), W = function(r) {
|
|
404
|
+
O(t, r);
|
|
405
|
+
function t(e, n, i) {
|
|
406
|
+
var o = r.call(this) || this, s;
|
|
407
|
+
return p(e) || !e ? s = {
|
|
408
408
|
next: e ?? void 0,
|
|
409
409
|
error: n ?? void 0,
|
|
410
410
|
complete: i ?? void 0
|
|
411
|
-
} : s = e, o.destination = new
|
|
411
|
+
} : s = e, o.destination = new He(s), o;
|
|
412
412
|
}
|
|
413
|
-
return
|
|
414
|
-
}(
|
|
415
|
-
function
|
|
416
|
-
|
|
413
|
+
return t;
|
|
414
|
+
}(X);
|
|
415
|
+
function D(r) {
|
|
416
|
+
de(r);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
throw
|
|
418
|
+
function Be(r) {
|
|
419
|
+
throw r;
|
|
420
420
|
}
|
|
421
|
-
var
|
|
421
|
+
var Ke = {
|
|
422
422
|
closed: !0,
|
|
423
|
-
next:
|
|
424
|
-
error:
|
|
425
|
-
complete:
|
|
426
|
-
},
|
|
423
|
+
next: q,
|
|
424
|
+
error: Be,
|
|
425
|
+
complete: q
|
|
426
|
+
}, z = function() {
|
|
427
427
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
428
428
|
}();
|
|
429
|
-
function
|
|
430
|
-
return
|
|
429
|
+
function G(r) {
|
|
430
|
+
return r;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return
|
|
434
|
-
return
|
|
432
|
+
function Ye(r) {
|
|
433
|
+
return r.length === 0 ? G : r.length === 1 ? r[0] : function(e) {
|
|
434
|
+
return r.reduce(function(n, i) {
|
|
435
435
|
return i(n);
|
|
436
436
|
}, e);
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
var
|
|
440
|
-
function t
|
|
441
|
-
|
|
439
|
+
var g = function() {
|
|
440
|
+
function r(t) {
|
|
441
|
+
t && (this._subscribe = t);
|
|
442
442
|
}
|
|
443
|
-
return
|
|
444
|
-
var e = new
|
|
445
|
-
return e.source = this, e.operator =
|
|
446
|
-
},
|
|
447
|
-
var i = this, o = We(
|
|
448
|
-
return
|
|
443
|
+
return r.prototype.lift = function(t) {
|
|
444
|
+
var e = new r();
|
|
445
|
+
return e.source = this, e.operator = t, e;
|
|
446
|
+
}, r.prototype.subscribe = function(t, e, n) {
|
|
447
|
+
var i = this, o = We(t) ? t : new W(t, e, n);
|
|
448
|
+
return U(function() {
|
|
449
449
|
var s = i, c = s.operator, u = s.source;
|
|
450
450
|
o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
|
|
451
451
|
}), o;
|
|
452
|
-
},
|
|
452
|
+
}, r.prototype._trySubscribe = function(t) {
|
|
453
453
|
try {
|
|
454
|
-
return this._subscribe(
|
|
454
|
+
return this._subscribe(t);
|
|
455
455
|
} catch (e) {
|
|
456
|
-
|
|
456
|
+
t.error(e);
|
|
457
457
|
}
|
|
458
|
-
},
|
|
458
|
+
}, r.prototype.forEach = function(t, e) {
|
|
459
459
|
var n = this;
|
|
460
|
-
return e =
|
|
461
|
-
var s = new
|
|
460
|
+
return e = te(e), new e(function(i, o) {
|
|
461
|
+
var s = new W({
|
|
462
462
|
next: function(c) {
|
|
463
463
|
try {
|
|
464
|
-
|
|
464
|
+
t(c);
|
|
465
465
|
} catch (u) {
|
|
466
466
|
o(u), s.unsubscribe();
|
|
467
467
|
}
|
|
@@ -471,18 +471,18 @@ var m = function() {
|
|
|
471
471
|
});
|
|
472
472
|
n.subscribe(s);
|
|
473
473
|
});
|
|
474
|
-
},
|
|
474
|
+
}, r.prototype._subscribe = function(t) {
|
|
475
475
|
var e;
|
|
476
|
-
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(
|
|
477
|
-
},
|
|
476
|
+
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
477
|
+
}, r.prototype[z] = function() {
|
|
478
478
|
return this;
|
|
479
|
-
},
|
|
480
|
-
for (var
|
|
481
|
-
|
|
482
|
-
return
|
|
483
|
-
},
|
|
479
|
+
}, r.prototype.pipe = function() {
|
|
480
|
+
for (var t = [], e = 0; e < arguments.length; e++)
|
|
481
|
+
t[e] = arguments[e];
|
|
482
|
+
return Ye(t)(this);
|
|
483
|
+
}, r.prototype.toPromise = function(t) {
|
|
484
484
|
var e = this;
|
|
485
|
-
return
|
|
485
|
+
return t = te(t), new t(function(n, i) {
|
|
486
486
|
var o;
|
|
487
487
|
e.subscribe(function(s) {
|
|
488
488
|
return o = s;
|
|
@@ -492,29 +492,29 @@ var m = function() {
|
|
|
492
492
|
return n(o);
|
|
493
493
|
});
|
|
494
494
|
});
|
|
495
|
-
},
|
|
496
|
-
return new t
|
|
497
|
-
},
|
|
495
|
+
}, r.create = function(t) {
|
|
496
|
+
return new r(t);
|
|
497
|
+
}, r;
|
|
498
498
|
}();
|
|
499
|
-
function
|
|
500
|
-
var
|
|
501
|
-
return (
|
|
499
|
+
function te(r) {
|
|
500
|
+
var t;
|
|
501
|
+
return (t = r ?? Fe.Promise) !== null && t !== void 0 ? t : Promise;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
return
|
|
503
|
+
function qe(r) {
|
|
504
|
+
return r && p(r.next) && p(r.error) && p(r.complete);
|
|
505
505
|
}
|
|
506
|
-
function We(
|
|
507
|
-
return
|
|
506
|
+
function We(r) {
|
|
507
|
+
return r && r instanceof X || qe(r) && he(r);
|
|
508
508
|
}
|
|
509
|
-
function Je(
|
|
510
|
-
return
|
|
509
|
+
function Je(r) {
|
|
510
|
+
return p(r == null ? void 0 : r.lift);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
return function(
|
|
514
|
-
if (Je(
|
|
515
|
-
return
|
|
512
|
+
function P(r) {
|
|
513
|
+
return function(t) {
|
|
514
|
+
if (Je(t))
|
|
515
|
+
return t.lift(function(e) {
|
|
516
516
|
try {
|
|
517
|
-
return
|
|
517
|
+
return r(e, this);
|
|
518
518
|
} catch (n) {
|
|
519
519
|
this.error(n);
|
|
520
520
|
}
|
|
@@ -522,28 +522,28 @@ function C(t) {
|
|
|
522
522
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function E(
|
|
526
|
-
return new Xe(
|
|
525
|
+
function E(r, t, e, n, i) {
|
|
526
|
+
return new Xe(r, t, e, n, i);
|
|
527
527
|
}
|
|
528
|
-
var Xe = function(
|
|
529
|
-
|
|
530
|
-
function
|
|
531
|
-
var u =
|
|
528
|
+
var Xe = function(r) {
|
|
529
|
+
O(t, r);
|
|
530
|
+
function t(e, n, i, o, s, c) {
|
|
531
|
+
var u = r.call(this, e) || this;
|
|
532
532
|
return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
|
|
533
533
|
try {
|
|
534
534
|
n(a);
|
|
535
|
-
} catch (
|
|
536
|
-
e.error(
|
|
535
|
+
} catch (l) {
|
|
536
|
+
e.error(l);
|
|
537
537
|
}
|
|
538
|
-
} :
|
|
538
|
+
} : r.prototype._next, u._error = o ? function(a) {
|
|
539
539
|
try {
|
|
540
540
|
o(a);
|
|
541
|
-
} catch (
|
|
542
|
-
e.error(
|
|
541
|
+
} catch (l) {
|
|
542
|
+
e.error(l);
|
|
543
543
|
} finally {
|
|
544
544
|
this.unsubscribe();
|
|
545
545
|
}
|
|
546
|
-
} :
|
|
546
|
+
} : r.prototype._error, u._complete = i ? function() {
|
|
547
547
|
try {
|
|
548
548
|
i();
|
|
549
549
|
} catch (a) {
|
|
@@ -551,39 +551,39 @@ var Xe = function(t) {
|
|
|
551
551
|
} finally {
|
|
552
552
|
this.unsubscribe();
|
|
553
553
|
}
|
|
554
|
-
} :
|
|
554
|
+
} : r.prototype._complete, u;
|
|
555
555
|
}
|
|
556
|
-
return
|
|
556
|
+
return t.prototype.unsubscribe = function() {
|
|
557
557
|
var e;
|
|
558
558
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
559
559
|
var n = this.closed;
|
|
560
|
-
|
|
560
|
+
r.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
561
561
|
}
|
|
562
|
-
},
|
|
563
|
-
}(
|
|
562
|
+
}, t;
|
|
563
|
+
}(X), ze = le(function(r) {
|
|
564
564
|
return function() {
|
|
565
|
-
|
|
565
|
+
r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
566
566
|
};
|
|
567
|
-
}),
|
|
568
|
-
|
|
569
|
-
function
|
|
570
|
-
var e =
|
|
567
|
+
}), Q = function(r) {
|
|
568
|
+
O(t, r);
|
|
569
|
+
function t() {
|
|
570
|
+
var e = r.call(this) || this;
|
|
571
571
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
572
572
|
}
|
|
573
|
-
return
|
|
574
|
-
var n = new
|
|
573
|
+
return t.prototype.lift = function(e) {
|
|
574
|
+
var n = new re(this, this);
|
|
575
575
|
return n.operator = e, n;
|
|
576
|
-
},
|
|
576
|
+
}, t.prototype._throwIfClosed = function() {
|
|
577
577
|
if (this.closed)
|
|
578
578
|
throw new ze();
|
|
579
|
-
},
|
|
579
|
+
}, t.prototype.next = function(e) {
|
|
580
580
|
var n = this;
|
|
581
|
-
|
|
581
|
+
U(function() {
|
|
582
582
|
var i, o;
|
|
583
583
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
584
584
|
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
585
585
|
try {
|
|
586
|
-
for (var s =
|
|
586
|
+
for (var s = M(n.currentObservers), c = s.next(); !c.done; c = s.next()) {
|
|
587
587
|
var u = c.value;
|
|
588
588
|
u.next(e);
|
|
589
589
|
}
|
|
@@ -598,135 +598,135 @@ var Xe = function(t) {
|
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
600
|
});
|
|
601
|
-
},
|
|
601
|
+
}, t.prototype.error = function(e) {
|
|
602
602
|
var n = this;
|
|
603
|
-
|
|
603
|
+
U(function() {
|
|
604
604
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
605
605
|
n.hasError = n.isStopped = !0, n.thrownError = e;
|
|
606
606
|
for (var i = n.observers; i.length; )
|
|
607
607
|
i.shift().error(e);
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
|
-
},
|
|
610
|
+
}, t.prototype.complete = function() {
|
|
611
611
|
var e = this;
|
|
612
|
-
|
|
612
|
+
U(function() {
|
|
613
613
|
if (e._throwIfClosed(), !e.isStopped) {
|
|
614
614
|
e.isStopped = !0;
|
|
615
615
|
for (var n = e.observers; n.length; )
|
|
616
616
|
n.shift().complete();
|
|
617
617
|
}
|
|
618
618
|
});
|
|
619
|
-
},
|
|
619
|
+
}, t.prototype.unsubscribe = function() {
|
|
620
620
|
this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
|
|
621
|
-
}, Object.defineProperty(
|
|
621
|
+
}, Object.defineProperty(t.prototype, "observed", {
|
|
622
622
|
get: function() {
|
|
623
623
|
var e;
|
|
624
624
|
return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
|
|
625
625
|
},
|
|
626
626
|
enumerable: !1,
|
|
627
627
|
configurable: !0
|
|
628
|
-
}),
|
|
629
|
-
return this._throwIfClosed(),
|
|
630
|
-
},
|
|
628
|
+
}), t.prototype._trySubscribe = function(e) {
|
|
629
|
+
return this._throwIfClosed(), r.prototype._trySubscribe.call(this, e);
|
|
630
|
+
}, t.prototype._subscribe = function(e) {
|
|
631
631
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
632
|
-
},
|
|
632
|
+
}, t.prototype._innerSubscribe = function(e) {
|
|
633
633
|
var n = this, i = this, o = i.hasError, s = i.isStopped, c = i.observers;
|
|
634
|
-
return o || s ?
|
|
635
|
-
n.currentObservers = null,
|
|
634
|
+
return o || s ? fe : (this.currentObservers = null, c.push(e), new j(function() {
|
|
635
|
+
n.currentObservers = null, N(c, e);
|
|
636
636
|
}));
|
|
637
|
-
},
|
|
637
|
+
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
638
638
|
var n = this, i = n.hasError, o = n.thrownError, s = n.isStopped;
|
|
639
639
|
i ? e.error(o) : s && e.complete();
|
|
640
|
-
},
|
|
641
|
-
var e = new
|
|
640
|
+
}, t.prototype.asObservable = function() {
|
|
641
|
+
var e = new g();
|
|
642
642
|
return e.source = this, e;
|
|
643
|
-
},
|
|
644
|
-
return new
|
|
645
|
-
},
|
|
646
|
-
}(
|
|
647
|
-
|
|
648
|
-
function
|
|
649
|
-
var i =
|
|
643
|
+
}, t.create = function(e, n) {
|
|
644
|
+
return new re(e, n);
|
|
645
|
+
}, t;
|
|
646
|
+
}(g), re = function(r) {
|
|
647
|
+
O(t, r);
|
|
648
|
+
function t(e, n) {
|
|
649
|
+
var i = r.call(this) || this;
|
|
650
650
|
return i.destination = e, i.source = n, i;
|
|
651
651
|
}
|
|
652
|
-
return
|
|
652
|
+
return t.prototype.next = function(e) {
|
|
653
653
|
var n, i;
|
|
654
654
|
(i = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || i === void 0 || i.call(n, e);
|
|
655
|
-
},
|
|
655
|
+
}, t.prototype.error = function(e) {
|
|
656
656
|
var n, i;
|
|
657
657
|
(i = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || i === void 0 || i.call(n, e);
|
|
658
|
-
},
|
|
658
|
+
}, t.prototype.complete = function() {
|
|
659
659
|
var e, n;
|
|
660
660
|
(n = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || n === void 0 || n.call(e);
|
|
661
|
-
},
|
|
661
|
+
}, t.prototype._subscribe = function(e) {
|
|
662
662
|
var n, i;
|
|
663
|
-
return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && i !== void 0 ? i :
|
|
664
|
-
},
|
|
665
|
-
}(
|
|
666
|
-
|
|
667
|
-
function
|
|
668
|
-
var n =
|
|
663
|
+
return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && i !== void 0 ? i : fe;
|
|
664
|
+
}, t;
|
|
665
|
+
}(Q), ne = function(r) {
|
|
666
|
+
O(t, r);
|
|
667
|
+
function t(e) {
|
|
668
|
+
var n = r.call(this) || this;
|
|
669
669
|
return n._value = e, n;
|
|
670
670
|
}
|
|
671
|
-
return Object.defineProperty(
|
|
671
|
+
return Object.defineProperty(t.prototype, "value", {
|
|
672
672
|
get: function() {
|
|
673
673
|
return this.getValue();
|
|
674
674
|
},
|
|
675
675
|
enumerable: !1,
|
|
676
676
|
configurable: !0
|
|
677
|
-
}),
|
|
678
|
-
var n =
|
|
677
|
+
}), t.prototype._subscribe = function(e) {
|
|
678
|
+
var n = r.prototype._subscribe.call(this, e);
|
|
679
679
|
return !n.closed && e.next(this._value), n;
|
|
680
|
-
},
|
|
680
|
+
}, t.prototype.getValue = function() {
|
|
681
681
|
var e = this, n = e.hasError, i = e.thrownError, o = e._value;
|
|
682
682
|
if (n)
|
|
683
683
|
throw i;
|
|
684
684
|
return this._throwIfClosed(), o;
|
|
685
|
-
},
|
|
686
|
-
|
|
687
|
-
},
|
|
688
|
-
}(
|
|
685
|
+
}, t.prototype.next = function(e) {
|
|
686
|
+
r.prototype.next.call(this, this._value = e);
|
|
687
|
+
}, t;
|
|
688
|
+
}(Q), Qe = {
|
|
689
689
|
now: function() {
|
|
690
690
|
return Date.now();
|
|
691
691
|
}
|
|
692
|
-
}, Ze = function(
|
|
693
|
-
|
|
694
|
-
function
|
|
695
|
-
return
|
|
692
|
+
}, Ze = function(r) {
|
|
693
|
+
O(t, r);
|
|
694
|
+
function t(e, n) {
|
|
695
|
+
return r.call(this) || this;
|
|
696
696
|
}
|
|
697
|
-
return
|
|
697
|
+
return t.prototype.schedule = function(e, n) {
|
|
698
698
|
return this;
|
|
699
|
-
},
|
|
700
|
-
}(
|
|
701
|
-
setInterval: function(
|
|
699
|
+
}, t;
|
|
700
|
+
}(j), ie = {
|
|
701
|
+
setInterval: function(r, t) {
|
|
702
702
|
for (var e = [], n = 2; n < arguments.length; n++)
|
|
703
703
|
e[n - 2] = arguments[n];
|
|
704
|
-
return setInterval.apply(void 0, k([
|
|
704
|
+
return setInterval.apply(void 0, k([r, t], R(e)));
|
|
705
705
|
},
|
|
706
|
-
clearInterval: function(
|
|
707
|
-
return clearInterval(
|
|
706
|
+
clearInterval: function(r) {
|
|
707
|
+
return clearInterval(r);
|
|
708
708
|
},
|
|
709
709
|
delegate: void 0
|
|
710
|
-
}, et = function(
|
|
711
|
-
|
|
712
|
-
function
|
|
713
|
-
var i =
|
|
710
|
+
}, et = function(r) {
|
|
711
|
+
O(t, r);
|
|
712
|
+
function t(e, n) {
|
|
713
|
+
var i = r.call(this, e, n) || this;
|
|
714
714
|
return i.scheduler = e, i.work = n, i.pending = !1, i;
|
|
715
715
|
}
|
|
716
|
-
return
|
|
716
|
+
return t.prototype.schedule = function(e, n) {
|
|
717
717
|
var i;
|
|
718
718
|
if (n === void 0 && (n = 0), this.closed)
|
|
719
719
|
return this;
|
|
720
720
|
this.state = e;
|
|
721
721
|
var o = this.id, s = this.scheduler;
|
|
722
722
|
return o != null && (this.id = this.recycleAsyncId(s, o, n)), this.pending = !0, this.delay = n, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(s, this.id, n), this;
|
|
723
|
-
},
|
|
724
|
-
return i === void 0 && (i = 0),
|
|
725
|
-
},
|
|
723
|
+
}, t.prototype.requestAsyncId = function(e, n, i) {
|
|
724
|
+
return i === void 0 && (i = 0), ie.setInterval(e.flush.bind(e, this), i);
|
|
725
|
+
}, t.prototype.recycleAsyncId = function(e, n, i) {
|
|
726
726
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
727
727
|
return n;
|
|
728
|
-
n != null &&
|
|
729
|
-
},
|
|
728
|
+
n != null && ie.clearInterval(n);
|
|
729
|
+
}, t.prototype.execute = function(e, n) {
|
|
730
730
|
if (this.closed)
|
|
731
731
|
return new Error("executing a cancelled action");
|
|
732
732
|
this.pending = !1;
|
|
@@ -734,7 +734,7 @@ var Xe = function(t) {
|
|
|
734
734
|
if (i)
|
|
735
735
|
return i;
|
|
736
736
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
737
|
-
},
|
|
737
|
+
}, t.prototype._execute = function(e, n) {
|
|
738
738
|
var i = !1, o;
|
|
739
739
|
try {
|
|
740
740
|
this.work(e);
|
|
@@ -743,27 +743,27 @@ var Xe = function(t) {
|
|
|
743
743
|
}
|
|
744
744
|
if (i)
|
|
745
745
|
return this.unsubscribe(), o;
|
|
746
|
-
},
|
|
746
|
+
}, t.prototype.unsubscribe = function() {
|
|
747
747
|
if (!this.closed) {
|
|
748
748
|
var e = this, n = e.id, i = e.scheduler, o = i.actions;
|
|
749
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
749
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, N(o, this), n != null && (this.id = this.recycleAsyncId(i, n, null)), this.delay = null, r.prototype.unsubscribe.call(this);
|
|
750
750
|
}
|
|
751
|
-
},
|
|
752
|
-
}(Ze),
|
|
753
|
-
function t
|
|
754
|
-
e === void 0 && (e =
|
|
751
|
+
}, t;
|
|
752
|
+
}(Ze), oe = function() {
|
|
753
|
+
function r(t, e) {
|
|
754
|
+
e === void 0 && (e = r.now), this.schedulerActionCtor = t, this.now = e;
|
|
755
755
|
}
|
|
756
|
-
return
|
|
757
|
-
return e === void 0 && (e = 0), new this.schedulerActionCtor(this,
|
|
758
|
-
},
|
|
759
|
-
}(), tt = function(
|
|
760
|
-
|
|
761
|
-
function
|
|
762
|
-
n === void 0 && (n =
|
|
763
|
-
var i =
|
|
756
|
+
return r.prototype.schedule = function(t, e, n) {
|
|
757
|
+
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(n, e);
|
|
758
|
+
}, r.now = Qe.now, r;
|
|
759
|
+
}(), tt = function(r) {
|
|
760
|
+
O(t, r);
|
|
761
|
+
function t(e, n) {
|
|
762
|
+
n === void 0 && (n = oe.now);
|
|
763
|
+
var i = r.call(this, e, n) || this;
|
|
764
764
|
return i.actions = [], i._active = !1, i;
|
|
765
765
|
}
|
|
766
|
-
return
|
|
766
|
+
return t.prototype.flush = function(e) {
|
|
767
767
|
var n = this.actions;
|
|
768
768
|
if (this._active) {
|
|
769
769
|
n.push(e);
|
|
@@ -780,61 +780,61 @@ var Xe = function(t) {
|
|
|
780
780
|
e.unsubscribe();
|
|
781
781
|
throw i;
|
|
782
782
|
}
|
|
783
|
-
},
|
|
784
|
-
}(
|
|
785
|
-
return
|
|
783
|
+
}, t;
|
|
784
|
+
}(oe), ve = new tt(et), rt = ve, nt = new g(function(r) {
|
|
785
|
+
return r.complete();
|
|
786
786
|
});
|
|
787
|
-
function
|
|
788
|
-
return
|
|
787
|
+
function ye(r) {
|
|
788
|
+
return r && p(r.schedule);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
791
|
-
return
|
|
790
|
+
function pe(r) {
|
|
791
|
+
return r[r.length - 1];
|
|
792
792
|
}
|
|
793
|
-
function it(
|
|
794
|
-
return
|
|
793
|
+
function it(r) {
|
|
794
|
+
return p(pe(r)) ? r.pop() : void 0;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
return
|
|
796
|
+
function be(r) {
|
|
797
|
+
return ye(pe(r)) ? r.pop() : void 0;
|
|
798
798
|
}
|
|
799
|
-
var
|
|
800
|
-
return
|
|
799
|
+
var me = function(r) {
|
|
800
|
+
return r && typeof r.length == "number" && typeof r != "function";
|
|
801
801
|
};
|
|
802
|
-
function
|
|
803
|
-
return
|
|
802
|
+
function ge(r) {
|
|
803
|
+
return p(r == null ? void 0 : r.then);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
805
|
+
function Se(r) {
|
|
806
|
+
return p(r[z]);
|
|
807
807
|
}
|
|
808
|
-
function we(
|
|
809
|
-
return Symbol.asyncIterator &&
|
|
808
|
+
function we(r) {
|
|
809
|
+
return Symbol.asyncIterator && p(r == null ? void 0 : r[Symbol.asyncIterator]);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
return new TypeError("You provided " + (
|
|
811
|
+
function Ee(r) {
|
|
812
|
+
return new TypeError("You provided " + (r !== null && typeof r == "object" ? "an invalid object" : "'" + r + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
813
813
|
}
|
|
814
814
|
function ot() {
|
|
815
815
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
816
816
|
}
|
|
817
|
-
var
|
|
818
|
-
function Ie(
|
|
819
|
-
return
|
|
817
|
+
var Oe = ot();
|
|
818
|
+
function Ie(r) {
|
|
819
|
+
return p(r == null ? void 0 : r[Oe]);
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
return
|
|
821
|
+
function Ae(r) {
|
|
822
|
+
return $e(this, arguments, function() {
|
|
823
823
|
var e, n, i, o;
|
|
824
|
-
return
|
|
824
|
+
return ce(this, function(s) {
|
|
825
825
|
switch (s.label) {
|
|
826
826
|
case 0:
|
|
827
|
-
e =
|
|
827
|
+
e = r.getReader(), s.label = 1;
|
|
828
828
|
case 1:
|
|
829
829
|
s.trys.push([1, , 9, 10]), s.label = 2;
|
|
830
830
|
case 2:
|
|
831
|
-
return [4,
|
|
831
|
+
return [4, C(e.read())];
|
|
832
832
|
case 3:
|
|
833
|
-
return n = s.sent(), i = n.value, o = n.done, o ? [4,
|
|
833
|
+
return n = s.sent(), i = n.value, o = n.done, o ? [4, C(void 0)] : [3, 5];
|
|
834
834
|
case 4:
|
|
835
835
|
return [2, s.sent()];
|
|
836
836
|
case 5:
|
|
837
|
-
return [4,
|
|
837
|
+
return [4, C(i)];
|
|
838
838
|
case 6:
|
|
839
839
|
return [4, s.sent()];
|
|
840
840
|
case 7:
|
|
@@ -849,59 +849,59 @@ function Oe(t) {
|
|
|
849
849
|
});
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
function xe(
|
|
853
|
-
return
|
|
854
|
-
}
|
|
855
|
-
function
|
|
856
|
-
if (
|
|
857
|
-
return
|
|
858
|
-
if (
|
|
859
|
-
if (
|
|
860
|
-
return st(
|
|
861
|
-
if (
|
|
862
|
-
return at(
|
|
863
|
-
if (
|
|
864
|
-
return ut(
|
|
865
|
-
if (we(
|
|
866
|
-
return
|
|
867
|
-
if (Ie(
|
|
868
|
-
return ct(
|
|
869
|
-
if (xe(
|
|
870
|
-
return lt(
|
|
852
|
+
function xe(r) {
|
|
853
|
+
return p(r == null ? void 0 : r.getReader);
|
|
854
|
+
}
|
|
855
|
+
function x(r) {
|
|
856
|
+
if (r instanceof g)
|
|
857
|
+
return r;
|
|
858
|
+
if (r != null) {
|
|
859
|
+
if (Se(r))
|
|
860
|
+
return st(r);
|
|
861
|
+
if (me(r))
|
|
862
|
+
return at(r);
|
|
863
|
+
if (ge(r))
|
|
864
|
+
return ut(r);
|
|
865
|
+
if (we(r))
|
|
866
|
+
return _e(r);
|
|
867
|
+
if (Ie(r))
|
|
868
|
+
return ct(r);
|
|
869
|
+
if (xe(r))
|
|
870
|
+
return lt(r);
|
|
871
871
|
}
|
|
872
|
-
throw
|
|
872
|
+
throw Ee(r);
|
|
873
873
|
}
|
|
874
|
-
function st(
|
|
875
|
-
return new
|
|
876
|
-
var e =
|
|
877
|
-
if (
|
|
878
|
-
return e.subscribe(
|
|
874
|
+
function st(r) {
|
|
875
|
+
return new g(function(t) {
|
|
876
|
+
var e = r[z]();
|
|
877
|
+
if (p(e.subscribe))
|
|
878
|
+
return e.subscribe(t);
|
|
879
879
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
880
880
|
});
|
|
881
881
|
}
|
|
882
|
-
function at(
|
|
883
|
-
return new
|
|
884
|
-
for (var e = 0; e <
|
|
885
|
-
|
|
886
|
-
|
|
882
|
+
function at(r) {
|
|
883
|
+
return new g(function(t) {
|
|
884
|
+
for (var e = 0; e < r.length && !t.closed; e++)
|
|
885
|
+
t.next(r[e]);
|
|
886
|
+
t.complete();
|
|
887
887
|
});
|
|
888
888
|
}
|
|
889
|
-
function ut(
|
|
890
|
-
return new
|
|
891
|
-
|
|
892
|
-
|
|
889
|
+
function ut(r) {
|
|
890
|
+
return new g(function(t) {
|
|
891
|
+
r.then(function(e) {
|
|
892
|
+
t.closed || (t.next(e), t.complete());
|
|
893
893
|
}, function(e) {
|
|
894
|
-
return
|
|
895
|
-
}).then(null,
|
|
894
|
+
return t.error(e);
|
|
895
|
+
}).then(null, de);
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
|
-
function ct(
|
|
899
|
-
return new
|
|
898
|
+
function ct(r) {
|
|
899
|
+
return new g(function(t) {
|
|
900
900
|
var e, n;
|
|
901
901
|
try {
|
|
902
|
-
for (var i =
|
|
902
|
+
for (var i = M(r), o = i.next(); !o.done; o = i.next()) {
|
|
903
903
|
var s = o.value;
|
|
904
|
-
if (
|
|
904
|
+
if (t.next(s), t.closed)
|
|
905
905
|
return;
|
|
906
906
|
}
|
|
907
907
|
} catch (c) {
|
|
@@ -913,32 +913,32 @@ function ct(t) {
|
|
|
913
913
|
if (e) throw e.error;
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
|
|
916
|
+
t.complete();
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
|
-
function
|
|
920
|
-
return new
|
|
921
|
-
ft(
|
|
922
|
-
return
|
|
919
|
+
function _e(r) {
|
|
920
|
+
return new g(function(t) {
|
|
921
|
+
ft(r, t).catch(function(e) {
|
|
922
|
+
return t.error(e);
|
|
923
923
|
});
|
|
924
924
|
});
|
|
925
925
|
}
|
|
926
|
-
function lt(
|
|
927
|
-
return Ae(
|
|
926
|
+
function lt(r) {
|
|
927
|
+
return _e(Ae(r));
|
|
928
928
|
}
|
|
929
|
-
function ft(
|
|
929
|
+
function ft(r, t) {
|
|
930
930
|
var e, n, i, o;
|
|
931
|
-
return
|
|
931
|
+
return Ne(this, void 0, void 0, function() {
|
|
932
932
|
var s, c;
|
|
933
|
-
return
|
|
933
|
+
return ce(this, function(u) {
|
|
934
934
|
switch (u.label) {
|
|
935
935
|
case 0:
|
|
936
|
-
u.trys.push([0, 5, 6, 11]), e = Ge(
|
|
936
|
+
u.trys.push([0, 5, 6, 11]), e = Ge(r), u.label = 1;
|
|
937
937
|
case 1:
|
|
938
938
|
return [4, e.next()];
|
|
939
939
|
case 2:
|
|
940
940
|
if (n = u.sent(), !!n.done) return [3, 4];
|
|
941
|
-
if (s = n.value,
|
|
941
|
+
if (s = n.value, t.next(s), t.closed)
|
|
942
942
|
return [2];
|
|
943
943
|
u.label = 3;
|
|
944
944
|
case 3:
|
|
@@ -959,62 +959,62 @@ function ft(t, r) {
|
|
|
959
959
|
case 10:
|
|
960
960
|
return [7];
|
|
961
961
|
case 11:
|
|
962
|
-
return
|
|
962
|
+
return t.complete(), [2];
|
|
963
963
|
}
|
|
964
964
|
});
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function A(r, t, e, n, i) {
|
|
968
968
|
n === void 0 && (n = 0), i === void 0 && (i = !1);
|
|
969
|
-
var o =
|
|
970
|
-
e(), i ?
|
|
969
|
+
var o = t.schedule(function() {
|
|
970
|
+
e(), i ? r.add(this.schedule(null, n)) : this.unsubscribe();
|
|
971
971
|
}, n);
|
|
972
|
-
if (
|
|
972
|
+
if (r.add(o), !i)
|
|
973
973
|
return o;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return
|
|
975
|
+
function Pe(r, t) {
|
|
976
|
+
return t === void 0 && (t = 0), P(function(e, n) {
|
|
977
977
|
e.subscribe(E(n, function(i) {
|
|
978
|
-
return
|
|
978
|
+
return A(n, r, function() {
|
|
979
979
|
return n.next(i);
|
|
980
|
-
},
|
|
980
|
+
}, t);
|
|
981
981
|
}, function() {
|
|
982
|
-
return
|
|
982
|
+
return A(n, r, function() {
|
|
983
983
|
return n.complete();
|
|
984
|
-
},
|
|
984
|
+
}, t);
|
|
985
985
|
}, function(i) {
|
|
986
|
-
return
|
|
986
|
+
return A(n, r, function() {
|
|
987
987
|
return n.error(i);
|
|
988
|
-
},
|
|
988
|
+
}, t);
|
|
989
989
|
}));
|
|
990
990
|
});
|
|
991
991
|
}
|
|
992
|
-
function
|
|
993
|
-
return
|
|
994
|
-
n.add(
|
|
992
|
+
function Te(r, t) {
|
|
993
|
+
return t === void 0 && (t = 0), P(function(e, n) {
|
|
994
|
+
n.add(r.schedule(function() {
|
|
995
995
|
return e.subscribe(n);
|
|
996
|
-
},
|
|
996
|
+
}, t));
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
|
-
function ht(
|
|
1000
|
-
return
|
|
999
|
+
function ht(r, t) {
|
|
1000
|
+
return x(r).pipe(Te(t), Pe(t));
|
|
1001
1001
|
}
|
|
1002
|
-
function dt(
|
|
1003
|
-
return
|
|
1002
|
+
function dt(r, t) {
|
|
1003
|
+
return x(r).pipe(Te(t), Pe(t));
|
|
1004
1004
|
}
|
|
1005
|
-
function vt(
|
|
1006
|
-
return new
|
|
1005
|
+
function vt(r, t) {
|
|
1006
|
+
return new g(function(e) {
|
|
1007
1007
|
var n = 0;
|
|
1008
|
-
return
|
|
1009
|
-
n ===
|
|
1008
|
+
return t.schedule(function() {
|
|
1009
|
+
n === r.length ? e.complete() : (e.next(r[n++]), e.closed || this.schedule());
|
|
1010
1010
|
});
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
|
-
function yt(
|
|
1014
|
-
return new
|
|
1013
|
+
function yt(r, t) {
|
|
1014
|
+
return new g(function(e) {
|
|
1015
1015
|
var n;
|
|
1016
|
-
return
|
|
1017
|
-
n =
|
|
1016
|
+
return A(e, t, function() {
|
|
1017
|
+
n = r[Oe](), A(e, t, function() {
|
|
1018
1018
|
var i, o, s;
|
|
1019
1019
|
try {
|
|
1020
1020
|
i = n.next(), o = i.value, s = i.done;
|
|
@@ -1025,17 +1025,17 @@ function yt(t, r) {
|
|
|
1025
1025
|
s ? e.complete() : e.next(o);
|
|
1026
1026
|
}, 0, !0);
|
|
1027
1027
|
}), function() {
|
|
1028
|
-
return
|
|
1028
|
+
return p(n == null ? void 0 : n.return) && n.return();
|
|
1029
1029
|
};
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1033
|
-
if (!
|
|
1032
|
+
function Ce(r, t) {
|
|
1033
|
+
if (!r)
|
|
1034
1034
|
throw new Error("Iterable cannot be null");
|
|
1035
|
-
return new
|
|
1036
|
-
|
|
1037
|
-
var n =
|
|
1038
|
-
|
|
1035
|
+
return new g(function(e) {
|
|
1036
|
+
A(e, t, function() {
|
|
1037
|
+
var n = r[Symbol.asyncIterator]();
|
|
1038
|
+
A(e, t, function() {
|
|
1039
1039
|
n.next().then(function(i) {
|
|
1040
1040
|
i.done ? e.complete() : e.next(i.value);
|
|
1041
1041
|
});
|
|
@@ -1043,100 +1043,100 @@ function Te(t, r) {
|
|
|
1043
1043
|
});
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
|
-
function pt(
|
|
1047
|
-
return
|
|
1048
|
-
}
|
|
1049
|
-
function bt(
|
|
1050
|
-
if (
|
|
1051
|
-
if (
|
|
1052
|
-
return ht(
|
|
1053
|
-
if (
|
|
1054
|
-
return vt(
|
|
1055
|
-
if (
|
|
1056
|
-
return dt(
|
|
1057
|
-
if (we(
|
|
1058
|
-
return
|
|
1059
|
-
if (Ie(
|
|
1060
|
-
return yt(
|
|
1061
|
-
if (xe(
|
|
1062
|
-
return pt(
|
|
1046
|
+
function pt(r, t) {
|
|
1047
|
+
return Ce(Ae(r), t);
|
|
1048
|
+
}
|
|
1049
|
+
function bt(r, t) {
|
|
1050
|
+
if (r != null) {
|
|
1051
|
+
if (Se(r))
|
|
1052
|
+
return ht(r, t);
|
|
1053
|
+
if (me(r))
|
|
1054
|
+
return vt(r, t);
|
|
1055
|
+
if (ge(r))
|
|
1056
|
+
return dt(r, t);
|
|
1057
|
+
if (we(r))
|
|
1058
|
+
return Ce(r, t);
|
|
1059
|
+
if (Ie(r))
|
|
1060
|
+
return yt(r, t);
|
|
1061
|
+
if (xe(r))
|
|
1062
|
+
return pt(r, t);
|
|
1063
1063
|
}
|
|
1064
|
-
throw
|
|
1064
|
+
throw Ee(r);
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1067
|
-
return
|
|
1066
|
+
function Z(r, t) {
|
|
1067
|
+
return t ? bt(r, t) : x(r);
|
|
1068
1068
|
}
|
|
1069
1069
|
function mt() {
|
|
1070
|
-
for (var
|
|
1071
|
-
t
|
|
1072
|
-
var e =
|
|
1073
|
-
return
|
|
1070
|
+
for (var r = [], t = 0; t < arguments.length; t++)
|
|
1071
|
+
r[t] = arguments[t];
|
|
1072
|
+
var e = be(r);
|
|
1073
|
+
return Z(r, e);
|
|
1074
1074
|
}
|
|
1075
|
-
function gt(
|
|
1076
|
-
return
|
|
1075
|
+
function gt(r) {
|
|
1076
|
+
return r instanceof Date && !isNaN(r);
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return
|
|
1078
|
+
function F(r, t) {
|
|
1079
|
+
return P(function(e, n) {
|
|
1080
1080
|
var i = 0;
|
|
1081
1081
|
e.subscribe(E(n, function(o) {
|
|
1082
|
-
n.next(
|
|
1082
|
+
n.next(r.call(t, o, i++));
|
|
1083
1083
|
}));
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
|
-
var
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1086
|
+
var St = Array.isArray;
|
|
1087
|
+
function wt(r, t) {
|
|
1088
|
+
return St(t) ? r.apply(void 0, k([], R(t))) : r(t);
|
|
1089
1089
|
}
|
|
1090
|
-
function Et(
|
|
1091
|
-
return
|
|
1092
|
-
return
|
|
1090
|
+
function Et(r) {
|
|
1091
|
+
return F(function(t) {
|
|
1092
|
+
return wt(r, t);
|
|
1093
1093
|
});
|
|
1094
1094
|
}
|
|
1095
|
-
var
|
|
1096
|
-
function _t(
|
|
1097
|
-
if (
|
|
1098
|
-
var
|
|
1099
|
-
if (
|
|
1100
|
-
return { args:
|
|
1101
|
-
if (
|
|
1102
|
-
var e =
|
|
1095
|
+
var Ot = Array.isArray, It = Object.getPrototypeOf, At = Object.prototype, xt = Object.keys;
|
|
1096
|
+
function _t(r) {
|
|
1097
|
+
if (r.length === 1) {
|
|
1098
|
+
var t = r[0];
|
|
1099
|
+
if (Ot(t))
|
|
1100
|
+
return { args: t, keys: null };
|
|
1101
|
+
if (Pt(t)) {
|
|
1102
|
+
var e = xt(t);
|
|
1103
1103
|
return {
|
|
1104
1104
|
args: e.map(function(n) {
|
|
1105
|
-
return
|
|
1105
|
+
return t[n];
|
|
1106
1106
|
}),
|
|
1107
1107
|
keys: e
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
return { args:
|
|
1111
|
+
return { args: r, keys: null };
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1113
|
+
function Pt(r) {
|
|
1114
|
+
return r && typeof r == "object" && It(r) === At;
|
|
1115
1115
|
}
|
|
1116
|
-
function Tt(
|
|
1117
|
-
return
|
|
1118
|
-
return e[n] =
|
|
1116
|
+
function Tt(r, t) {
|
|
1117
|
+
return r.reduce(function(e, n, i) {
|
|
1118
|
+
return e[n] = t[i], e;
|
|
1119
1119
|
}, {});
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1122
|
-
for (var
|
|
1123
|
-
t
|
|
1124
|
-
var e =
|
|
1121
|
+
function Ct() {
|
|
1122
|
+
for (var r = [], t = 0; t < arguments.length; t++)
|
|
1123
|
+
r[t] = arguments[t];
|
|
1124
|
+
var e = be(r), n = it(r), i = _t(r), o = i.args, s = i.keys;
|
|
1125
1125
|
if (o.length === 0)
|
|
1126
|
-
return
|
|
1127
|
-
var c = new
|
|
1126
|
+
return Z([], e);
|
|
1127
|
+
var c = new g(Mt(o, e, s ? function(u) {
|
|
1128
1128
|
return Tt(s, u);
|
|
1129
|
-
} :
|
|
1129
|
+
} : G));
|
|
1130
1130
|
return n ? c.pipe(Et(n)) : c;
|
|
1131
1131
|
}
|
|
1132
|
-
function Mt(
|
|
1133
|
-
return e === void 0 && (e =
|
|
1134
|
-
|
|
1135
|
-
for (var i =
|
|
1136
|
-
|
|
1137
|
-
var d =
|
|
1138
|
-
d.subscribe(E(n, function(
|
|
1139
|
-
o[
|
|
1132
|
+
function Mt(r, t, e) {
|
|
1133
|
+
return e === void 0 && (e = G), function(n) {
|
|
1134
|
+
se(t, function() {
|
|
1135
|
+
for (var i = r.length, o = new Array(i), s = i, c = i, u = function(l) {
|
|
1136
|
+
se(t, function() {
|
|
1137
|
+
var d = Z(r[l], t), b = !1;
|
|
1138
|
+
d.subscribe(E(n, function(f) {
|
|
1139
|
+
o[l] = f, b || (b = !0, c--), c || n.next(e(o.slice()));
|
|
1140
1140
|
}, function() {
|
|
1141
1141
|
--s || n.complete();
|
|
1142
1142
|
}));
|
|
@@ -1146,55 +1146,55 @@ function Mt(t, r, e) {
|
|
|
1146
1146
|
}, n);
|
|
1147
1147
|
};
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1150
|
-
|
|
1149
|
+
function se(r, t, e) {
|
|
1150
|
+
r ? A(e, r, t) : t();
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1153
|
-
var u = [], a = 0,
|
|
1154
|
-
d && !u.length && !a &&
|
|
1155
|
-
},
|
|
1152
|
+
function Rt(r, t, e, n, i, o, s, c) {
|
|
1153
|
+
var u = [], a = 0, l = 0, d = !1, b = function() {
|
|
1154
|
+
d && !u.length && !a && t.complete();
|
|
1155
|
+
}, f = function(h) {
|
|
1156
1156
|
return a < n ? v(h) : u.push(h);
|
|
1157
1157
|
}, v = function(h) {
|
|
1158
1158
|
a++;
|
|
1159
|
-
var
|
|
1160
|
-
|
|
1161
|
-
|
|
1159
|
+
var S = !1;
|
|
1160
|
+
x(e(h, l++)).subscribe(E(t, function(w) {
|
|
1161
|
+
t.next(w);
|
|
1162
1162
|
}, function() {
|
|
1163
|
-
|
|
1163
|
+
S = !0;
|
|
1164
1164
|
}, void 0, function() {
|
|
1165
|
-
if (
|
|
1165
|
+
if (S)
|
|
1166
1166
|
try {
|
|
1167
1167
|
a--;
|
|
1168
|
-
for (var
|
|
1168
|
+
for (var w = function() {
|
|
1169
1169
|
var _ = u.shift();
|
|
1170
1170
|
s || v(_);
|
|
1171
1171
|
}; u.length && a < n; )
|
|
1172
|
-
|
|
1173
|
-
|
|
1172
|
+
w();
|
|
1173
|
+
b();
|
|
1174
1174
|
} catch (_) {
|
|
1175
|
-
|
|
1175
|
+
t.error(_);
|
|
1176
1176
|
}
|
|
1177
1177
|
}));
|
|
1178
1178
|
};
|
|
1179
|
-
return
|
|
1180
|
-
d = !0,
|
|
1179
|
+
return r.subscribe(E(t, f, function() {
|
|
1180
|
+
d = !0, b();
|
|
1181
1181
|
})), function() {
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
function $(
|
|
1185
|
-
return e === void 0 && (e = 1 / 0),
|
|
1186
|
-
return
|
|
1187
|
-
return
|
|
1188
|
-
})(
|
|
1189
|
-
}, e) : (typeof
|
|
1190
|
-
return
|
|
1184
|
+
function $(r, t, e) {
|
|
1185
|
+
return e === void 0 && (e = 1 / 0), p(t) ? $(function(n, i) {
|
|
1186
|
+
return F(function(o, s) {
|
|
1187
|
+
return t(n, o, i, s);
|
|
1188
|
+
})(x(r(n, i)));
|
|
1189
|
+
}, e) : (typeof t == "number" && (e = t), P(function(n, i) {
|
|
1190
|
+
return Rt(n, i, r, e);
|
|
1191
1191
|
}));
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1194
|
-
|
|
1193
|
+
function Me(r, t, e) {
|
|
1194
|
+
r === void 0 && (r = 0), e === void 0 && (e = rt);
|
|
1195
1195
|
var n = -1;
|
|
1196
|
-
return
|
|
1197
|
-
var o = gt(
|
|
1196
|
+
return t != null && (ye(t) ? e = t : n = t), new g(function(i) {
|
|
1197
|
+
var o = gt(r) ? +r - e.now() : r;
|
|
1198
1198
|
o < 0 && (o = 0);
|
|
1199
1199
|
var s = 0;
|
|
1200
1200
|
return e.schedule(function() {
|
|
@@ -1202,92 +1202,92 @@ function Pe(t, r, e) {
|
|
|
1202
1202
|
}, o);
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return
|
|
1205
|
+
function kt(r, t) {
|
|
1206
|
+
return p(t) ? $(r, t, 1) : $(r, 1);
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return
|
|
1208
|
+
function jt(r) {
|
|
1209
|
+
return r <= 0 ? function() {
|
|
1210
1210
|
return nt;
|
|
1211
|
-
} :
|
|
1211
|
+
} : P(function(t, e) {
|
|
1212
1212
|
var n = 0;
|
|
1213
|
-
|
|
1214
|
-
++n <=
|
|
1213
|
+
t.subscribe(E(e, function(i) {
|
|
1214
|
+
++n <= r && (e.next(i), r <= n && e.complete());
|
|
1215
1215
|
}));
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return
|
|
1220
|
-
return
|
|
1218
|
+
function Lt(r) {
|
|
1219
|
+
return F(function() {
|
|
1220
|
+
return r;
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function Dt(r, t) {
|
|
1224
1224
|
return $(function(e, n) {
|
|
1225
|
-
return
|
|
1225
|
+
return x(r(e, n)).pipe(jt(1), Lt(e));
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
|
-
function Ut(
|
|
1229
|
-
|
|
1230
|
-
var e =
|
|
1231
|
-
return
|
|
1228
|
+
function Ut(r, t) {
|
|
1229
|
+
t === void 0 && (t = ve);
|
|
1230
|
+
var e = Me(r, t);
|
|
1231
|
+
return Dt(function() {
|
|
1232
1232
|
return e;
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1236
|
-
var
|
|
1237
|
-
|
|
1238
|
-
count:
|
|
1235
|
+
function Nt(r) {
|
|
1236
|
+
var t;
|
|
1237
|
+
t = {
|
|
1238
|
+
count: r
|
|
1239
1239
|
};
|
|
1240
|
-
var e =
|
|
1241
|
-
return n <= 0 ?
|
|
1242
|
-
var a = 0,
|
|
1243
|
-
var
|
|
1244
|
-
|
|
1245
|
-
s && (a = 0), u.next(
|
|
1246
|
-
}, void 0, function(
|
|
1240
|
+
var e = t.count, n = e === void 0 ? 1 / 0 : e, i = t.delay, o = t.resetOnSuccess, s = o === void 0 ? !1 : o;
|
|
1241
|
+
return n <= 0 ? G : P(function(c, u) {
|
|
1242
|
+
var a = 0, l, d = function() {
|
|
1243
|
+
var b = !1;
|
|
1244
|
+
l = c.subscribe(E(u, function(f) {
|
|
1245
|
+
s && (a = 0), u.next(f);
|
|
1246
|
+
}, void 0, function(f) {
|
|
1247
1247
|
if (a++ < n) {
|
|
1248
1248
|
var v = function() {
|
|
1249
|
-
|
|
1249
|
+
l ? (l.unsubscribe(), l = null, d()) : b = !0;
|
|
1250
1250
|
};
|
|
1251
1251
|
if (i != null) {
|
|
1252
|
-
var h = typeof i == "number" ?
|
|
1253
|
-
|
|
1252
|
+
var h = typeof i == "number" ? Me(i) : x(i(f, a)), S = E(u, function() {
|
|
1253
|
+
S.unsubscribe(), v();
|
|
1254
1254
|
}, function() {
|
|
1255
1255
|
u.complete();
|
|
1256
1256
|
});
|
|
1257
|
-
h.subscribe(
|
|
1257
|
+
h.subscribe(S);
|
|
1258
1258
|
} else
|
|
1259
1259
|
v();
|
|
1260
1260
|
} else
|
|
1261
|
-
u.error(
|
|
1262
|
-
})),
|
|
1261
|
+
u.error(f);
|
|
1262
|
+
})), b && (l.unsubscribe(), l = null, d());
|
|
1263
1263
|
};
|
|
1264
1264
|
d();
|
|
1265
1265
|
});
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1268
|
-
return
|
|
1269
|
-
|
|
1267
|
+
function $t(r) {
|
|
1268
|
+
return P(function(t, e) {
|
|
1269
|
+
x(r).subscribe(E(e, function() {
|
|
1270
1270
|
return e.complete();
|
|
1271
|
-
},
|
|
1271
|
+
}, q)), !e.closed && t.subscribe(e);
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
|
-
async function Gt(
|
|
1275
|
-
const e =
|
|
1274
|
+
async function Gt(r, t) {
|
|
1275
|
+
const e = r.getReader();
|
|
1276
1276
|
let n;
|
|
1277
1277
|
for (; !(n = await e.read()).done; )
|
|
1278
|
-
|
|
1278
|
+
t(n.value);
|
|
1279
1279
|
}
|
|
1280
|
-
function Ft(
|
|
1281
|
-
let
|
|
1280
|
+
function Ft(r) {
|
|
1281
|
+
let t, e, n, i = !1;
|
|
1282
1282
|
return function(s) {
|
|
1283
|
-
|
|
1284
|
-
const c =
|
|
1283
|
+
t === void 0 ? (t = s, e = 0, n = -1) : t = Ht(t, s);
|
|
1284
|
+
const c = t.length;
|
|
1285
1285
|
let u = 0;
|
|
1286
1286
|
for (; e < c; ) {
|
|
1287
|
-
i && (
|
|
1287
|
+
i && (t[e] === 10 && (u = ++e), i = !1);
|
|
1288
1288
|
let a = -1;
|
|
1289
1289
|
for (; e < c && a === -1; ++e)
|
|
1290
|
-
switch (
|
|
1290
|
+
switch (t[e]) {
|
|
1291
1291
|
case 58:
|
|
1292
1292
|
n === -1 && (n = e - u);
|
|
1293
1293
|
break;
|
|
@@ -1299,43 +1299,43 @@ function Ft(t) {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
if (a === -1)
|
|
1301
1301
|
break;
|
|
1302
|
-
t
|
|
1302
|
+
r(t.subarray(u, a), n), u = e, n = -1;
|
|
1303
1303
|
}
|
|
1304
|
-
u === c ?
|
|
1304
|
+
u === c ? t = void 0 : u !== 0 && (t = t.subarray(u), e -= u);
|
|
1305
1305
|
};
|
|
1306
1306
|
}
|
|
1307
|
-
function Vt(
|
|
1308
|
-
let n =
|
|
1307
|
+
function Vt(r, t, e) {
|
|
1308
|
+
let n = ae();
|
|
1309
1309
|
const i = new TextDecoder();
|
|
1310
1310
|
return function(s, c) {
|
|
1311
1311
|
if (s.length === 0)
|
|
1312
|
-
e == null || e(n), n =
|
|
1312
|
+
e == null || e(n), n = ae();
|
|
1313
1313
|
else if (c > 0) {
|
|
1314
|
-
const u = i.decode(s.subarray(0, c)), a = c + (s[c + 1] === 32 ? 2 : 1),
|
|
1314
|
+
const u = i.decode(s.subarray(0, c)), a = c + (s[c + 1] === 32 ? 2 : 1), l = i.decode(s.subarray(a));
|
|
1315
1315
|
switch (u) {
|
|
1316
1316
|
case "data":
|
|
1317
1317
|
n.data = n.data ? n.data + `
|
|
1318
|
-
` +
|
|
1318
|
+
` + l : l;
|
|
1319
1319
|
break;
|
|
1320
1320
|
case "event":
|
|
1321
|
-
n.event =
|
|
1321
|
+
n.event = l;
|
|
1322
1322
|
break;
|
|
1323
1323
|
case "id":
|
|
1324
|
-
|
|
1324
|
+
r(n.id = l);
|
|
1325
1325
|
break;
|
|
1326
1326
|
case "retry":
|
|
1327
|
-
const d = parseInt(
|
|
1328
|
-
isNaN(d) ||
|
|
1327
|
+
const d = parseInt(l, 10);
|
|
1328
|
+
isNaN(d) || t(n.retry = d);
|
|
1329
1329
|
break;
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1335
|
-
const e = new Uint8Array(
|
|
1336
|
-
return e.set(
|
|
1334
|
+
function Ht(r, t) {
|
|
1335
|
+
const e = new Uint8Array(r.length + t.length);
|
|
1336
|
+
return e.set(r), e.set(t, r.length), e;
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function ae() {
|
|
1339
1339
|
return {
|
|
1340
1340
|
data: "",
|
|
1341
1341
|
event: "",
|
|
@@ -1343,124 +1343,181 @@ function se() {
|
|
|
1343
1343
|
retry: void 0
|
|
1344
1344
|
};
|
|
1345
1345
|
}
|
|
1346
|
-
var
|
|
1346
|
+
var Bt = function(r, t) {
|
|
1347
1347
|
var e = {};
|
|
1348
|
-
for (var n in
|
|
1349
|
-
if (
|
|
1350
|
-
for (var i = 0, n = Object.getOwnPropertySymbols(
|
|
1351
|
-
|
|
1348
|
+
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && t.indexOf(n) < 0 && (e[n] = r[n]);
|
|
1349
|
+
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1350
|
+
for (var i = 0, n = Object.getOwnPropertySymbols(r); i < n.length; i++)
|
|
1351
|
+
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (e[n[i]] = r[n[i]]);
|
|
1352
1352
|
return e;
|
|
1353
1353
|
};
|
|
1354
|
-
const
|
|
1355
|
-
function
|
|
1356
|
-
var { signal: e, headers: n, onopen: i, onmessage: o, onclose: s, onerror: c, openWhenHidden: u, fetch: a } =
|
|
1357
|
-
return new Promise((d,
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1354
|
+
const J = "text/event-stream", Kt = 1e3, ue = "last-event-id";
|
|
1355
|
+
function Yt(r, t) {
|
|
1356
|
+
var { signal: e, headers: n, onopen: i, onmessage: o, onclose: s, onerror: c, openWhenHidden: u, fetch: a } = t, l = Bt(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1357
|
+
return new Promise((d, b) => {
|
|
1358
|
+
const f = Object.assign({}, n);
|
|
1359
|
+
f.accept || (f.accept = J);
|
|
1360
1360
|
let v;
|
|
1361
1361
|
function h() {
|
|
1362
|
-
v.abort(), document.hidden ||
|
|
1362
|
+
v.abort(), document.hidden || V();
|
|
1363
1363
|
}
|
|
1364
1364
|
u || document.addEventListener("visibilitychange", h);
|
|
1365
|
-
let
|
|
1365
|
+
let S = Kt, w = 0;
|
|
1366
1366
|
function _() {
|
|
1367
|
-
document.removeEventListener("visibilitychange", h), window.clearTimeout(
|
|
1367
|
+
document.removeEventListener("visibilitychange", h), window.clearTimeout(w), v.abort();
|
|
1368
1368
|
}
|
|
1369
1369
|
e == null || e.addEventListener("abort", () => {
|
|
1370
1370
|
_(), d();
|
|
1371
1371
|
});
|
|
1372
|
-
const
|
|
1373
|
-
async function
|
|
1374
|
-
var
|
|
1372
|
+
const ke = a ?? window.fetch, je = i ?? qt;
|
|
1373
|
+
async function V() {
|
|
1374
|
+
var H;
|
|
1375
1375
|
v = new AbortController();
|
|
1376
1376
|
try {
|
|
1377
|
-
const
|
|
1378
|
-
await
|
|
1379
|
-
|
|
1380
|
-
}, (
|
|
1381
|
-
|
|
1377
|
+
const L = await ke(r, Object.assign(Object.assign({}, l), { headers: f, signal: v.signal }));
|
|
1378
|
+
await je(L), await Gt(L.body, Ft(Vt((I) => {
|
|
1379
|
+
I ? f[ue] = I : delete f[ue];
|
|
1380
|
+
}, (I) => {
|
|
1381
|
+
S = I;
|
|
1382
1382
|
}, o))), s == null || s(), _(), d();
|
|
1383
|
-
} catch (
|
|
1383
|
+
} catch (L) {
|
|
1384
1384
|
if (!v.signal.aborted)
|
|
1385
1385
|
try {
|
|
1386
|
-
const
|
|
1387
|
-
window.clearTimeout(
|
|
1388
|
-
} catch (
|
|
1389
|
-
_(),
|
|
1386
|
+
const I = (H = c == null ? void 0 : c(L)) !== null && H !== void 0 ? H : S;
|
|
1387
|
+
window.clearTimeout(w), w = window.setTimeout(V, I);
|
|
1388
|
+
} catch (I) {
|
|
1389
|
+
_(), b(I);
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
|
-
|
|
1393
|
+
V();
|
|
1394
1394
|
});
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const
|
|
1398
|
-
if (!(
|
|
1399
|
-
throw new Error(`Expected content-type to be ${
|
|
1396
|
+
function qt(r) {
|
|
1397
|
+
const t = r.headers.get("content-type");
|
|
1398
|
+
if (!(t != null && t.startsWith(J)))
|
|
1399
|
+
throw new Error(`Expected content-type to be ${J}, Actual: ${t}`);
|
|
1400
1400
|
}
|
|
1401
|
-
function Wt(
|
|
1402
|
-
const { endpoint:
|
|
1403
|
-
return new
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1401
|
+
function Wt(r) {
|
|
1402
|
+
const { endpoint: t, apiKey: e, payload: n, debugMode: i } = r;
|
|
1403
|
+
return new g((o) => {
|
|
1404
|
+
const s = new AbortController(), c = {
|
|
1405
|
+
"Content-Type": "application/json"
|
|
1406
|
+
};
|
|
1407
|
+
e && (c["X-API-KEY"] = e);
|
|
1408
|
+
const u = new URLSearchParams();
|
|
1409
|
+
i && u.set("is_debug", "true");
|
|
1410
|
+
const a = new URL(t);
|
|
1411
|
+
return u.toString() && (a.search = u.toString()), Yt(a.toString(), {
|
|
1406
1412
|
method: "POST",
|
|
1407
|
-
headers:
|
|
1408
|
-
"X-API-KEY": e,
|
|
1409
|
-
"Content-Type": "application/json"
|
|
1410
|
-
},
|
|
1413
|
+
headers: c,
|
|
1411
1414
|
body: n ? JSON.stringify(n) : void 0,
|
|
1412
|
-
signal:
|
|
1413
|
-
onopen: async (
|
|
1414
|
-
|
|
1415
|
+
signal: s.signal,
|
|
1416
|
+
onopen: async (l) => {
|
|
1417
|
+
l.ok || (o.error(l), s.abort());
|
|
1415
1418
|
},
|
|
1416
|
-
onmessage: (
|
|
1417
|
-
|
|
1419
|
+
onmessage: (l) => {
|
|
1420
|
+
o.next(JSON.parse(l.data));
|
|
1418
1421
|
},
|
|
1419
1422
|
onclose: () => {
|
|
1420
|
-
|
|
1423
|
+
o.complete();
|
|
1421
1424
|
},
|
|
1422
|
-
onerror: (
|
|
1423
|
-
throw
|
|
1425
|
+
onerror: (l) => {
|
|
1426
|
+
throw o.error(l), s.abort(), l;
|
|
1424
1427
|
}
|
|
1425
1428
|
}), () => {
|
|
1426
|
-
|
|
1429
|
+
s.abort();
|
|
1427
1430
|
};
|
|
1428
1431
|
});
|
|
1429
1432
|
}
|
|
1430
|
-
class
|
|
1431
|
-
constructor(
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1433
|
+
class Jt {
|
|
1434
|
+
constructor() {
|
|
1435
|
+
m(this, "listeners", {});
|
|
1436
|
+
}
|
|
1437
|
+
on(t, e) {
|
|
1438
|
+
this.listeners = Object.assign({}, this.listeners, {
|
|
1439
|
+
[t]: (this.listeners[t] ?? []).concat(e)
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
off(t, e) {
|
|
1443
|
+
this.listeners[t] && (this.listeners = Object.assign({}, this.listeners, {
|
|
1444
|
+
[t]: (this.listeners[t] ?? []).filter((n) => n !== e)
|
|
1445
|
+
}));
|
|
1446
|
+
}
|
|
1447
|
+
remove(t) {
|
|
1448
|
+
delete this.listeners[t];
|
|
1449
|
+
}
|
|
1450
|
+
emit(t, ...e) {
|
|
1451
|
+
this.listeners[t] && this.listeners[t].forEach((n) => n(...e));
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
class zt {
|
|
1455
|
+
constructor(t) {
|
|
1456
|
+
m(this, "apiKey");
|
|
1457
|
+
m(this, "endpoint");
|
|
1458
|
+
m(this, "debugMode");
|
|
1459
|
+
m(this, "destroy$", new Q());
|
|
1460
|
+
m(this, "sseEmitter", new Jt());
|
|
1461
|
+
m(this, "transformSsePayload");
|
|
1462
|
+
if (!t.endpoint)
|
|
1440
1463
|
throw new Error("endpoint must be required");
|
|
1441
|
-
this.apiKey =
|
|
1464
|
+
this.apiKey = t.apiKey, this.endpoint = t.endpoint, this.debugMode = t.debugMode, this.transformSsePayload = t.transformSsePayload;
|
|
1442
1465
|
}
|
|
1443
|
-
|
|
1466
|
+
on(t, e) {
|
|
1467
|
+
this.sseEmitter.remove(t), this.sseEmitter.on(t, e);
|
|
1468
|
+
}
|
|
1469
|
+
handleEvent(t) {
|
|
1470
|
+
switch (t.eventType) {
|
|
1471
|
+
case y.INIT:
|
|
1472
|
+
this.sseEmitter.emit(
|
|
1473
|
+
y.INIT,
|
|
1474
|
+
t
|
|
1475
|
+
);
|
|
1476
|
+
break;
|
|
1477
|
+
case y.PROCESS_START:
|
|
1478
|
+
case y.PROCESS_COMPLETE:
|
|
1479
|
+
this.sseEmitter.emit(
|
|
1480
|
+
y.PROCESS,
|
|
1481
|
+
t
|
|
1482
|
+
);
|
|
1483
|
+
break;
|
|
1484
|
+
case y.MESSAGE_START:
|
|
1485
|
+
case y.MESSAGE_DELTA:
|
|
1486
|
+
case y.MESSAGE_COMPLETE:
|
|
1487
|
+
this.sseEmitter.emit(
|
|
1488
|
+
y.MESSAGE,
|
|
1489
|
+
t
|
|
1490
|
+
);
|
|
1491
|
+
break;
|
|
1492
|
+
case y.DONE:
|
|
1493
|
+
this.sseEmitter.emit(
|
|
1494
|
+
y.DONE,
|
|
1495
|
+
t
|
|
1496
|
+
);
|
|
1497
|
+
break;
|
|
1498
|
+
case y.ERROR:
|
|
1499
|
+
this.sseEmitter.emit(
|
|
1500
|
+
y.ERROR,
|
|
1501
|
+
t
|
|
1502
|
+
);
|
|
1503
|
+
break;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
fetchSse(t, e) {
|
|
1444
1507
|
var n, i;
|
|
1445
1508
|
(n = e == null ? void 0 : e.onSseStart) == null || n.call(e), Wt({
|
|
1446
1509
|
apiKey: this.apiKey,
|
|
1447
1510
|
endpoint: this.endpoint,
|
|
1448
|
-
|
|
1511
|
+
debugMode: this.debugMode,
|
|
1512
|
+
payload: ((i = this.transformSsePayload) == null ? void 0 : i.call(this, t)) ?? t
|
|
1449
1513
|
}).pipe(
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1514
|
+
kt((o) => mt(o).pipe(Ut((e == null ? void 0 : e.delayTime) ?? 50))),
|
|
1515
|
+
$t(this.destroy$),
|
|
1516
|
+
Nt(3)
|
|
1453
1517
|
).subscribe({
|
|
1454
1518
|
next: (o) => {
|
|
1455
|
-
var s
|
|
1456
|
-
|
|
1457
|
-
case g.ERROR:
|
|
1458
|
-
(c = this.onExecutionError) == null || c.call(
|
|
1459
|
-
this,
|
|
1460
|
-
o.fact.runError
|
|
1461
|
-
);
|
|
1462
|
-
break;
|
|
1463
|
-
}
|
|
1519
|
+
var s;
|
|
1520
|
+
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e, o), this.handleEvent(o);
|
|
1464
1521
|
},
|
|
1465
1522
|
error: (o) => {
|
|
1466
1523
|
var s;
|
|
@@ -1476,23 +1533,23 @@ class Xt {
|
|
|
1476
1533
|
this.destroy$.next(), this.destroy$.complete();
|
|
1477
1534
|
}
|
|
1478
1535
|
}
|
|
1479
|
-
class
|
|
1480
|
-
constructor(
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
if (!
|
|
1536
|
+
class Re {
|
|
1537
|
+
constructor(t) {
|
|
1538
|
+
m(this, "client");
|
|
1539
|
+
m(this, "customChannelId");
|
|
1540
|
+
m(this, "customMessageId");
|
|
1541
|
+
m(this, "isConnecting$");
|
|
1542
|
+
m(this, "conversation$");
|
|
1543
|
+
m(this, "statesObserver");
|
|
1544
|
+
m(this, "statesSubscription");
|
|
1545
|
+
if (!t.client)
|
|
1489
1546
|
throw new Error("client must be required");
|
|
1490
|
-
if (!
|
|
1547
|
+
if (!t.customChannelId)
|
|
1491
1548
|
throw new Error("customChannelId must be required");
|
|
1492
|
-
this.client =
|
|
1549
|
+
this.client = t.client, this.customChannelId = t.customChannelId, this.customMessageId = t.customMessageId, this.isConnecting$ = new ne(!1), this.conversation$ = new ne(t.conversation), this.statesObserver = t.statesObserver;
|
|
1493
1550
|
}
|
|
1494
|
-
static async reset(
|
|
1495
|
-
const n = new
|
|
1551
|
+
static async reset(t, e) {
|
|
1552
|
+
const n = new Re(t);
|
|
1496
1553
|
try {
|
|
1497
1554
|
return n.subscribe(), await n.resetChannel(e), n;
|
|
1498
1555
|
} catch (i) {
|
|
@@ -1500,19 +1557,19 @@ class Me {
|
|
|
1500
1557
|
}
|
|
1501
1558
|
}
|
|
1502
1559
|
subscribe() {
|
|
1503
|
-
this.statesSubscription =
|
|
1560
|
+
this.statesSubscription = Ct([
|
|
1504
1561
|
this.isConnecting$,
|
|
1505
1562
|
this.conversation$
|
|
1506
1563
|
]).pipe(
|
|
1507
|
-
|
|
1508
|
-
isConnecting:
|
|
1564
|
+
F(([t, e]) => ({
|
|
1565
|
+
isConnecting: t,
|
|
1509
1566
|
conversation: e
|
|
1510
1567
|
}))
|
|
1511
1568
|
).subscribe(this.statesObserver);
|
|
1512
1569
|
}
|
|
1513
|
-
fetchSse(
|
|
1570
|
+
fetchSse(t, e) {
|
|
1514
1571
|
return new Promise((n, i) => {
|
|
1515
|
-
this.isConnecting$.next(!0), this.client.fetchSse(
|
|
1572
|
+
this.isConnecting$.next(!0), this.client.fetchSse(t, {
|
|
1516
1573
|
onSseStart: e == null ? void 0 : e.onSseStart,
|
|
1517
1574
|
onSseMessage: (o) => {
|
|
1518
1575
|
var s;
|
|
@@ -1529,19 +1586,19 @@ class Me {
|
|
|
1529
1586
|
});
|
|
1530
1587
|
});
|
|
1531
1588
|
}
|
|
1532
|
-
resetChannel(
|
|
1589
|
+
resetChannel(t) {
|
|
1533
1590
|
return this.fetchSse(
|
|
1534
1591
|
{
|
|
1535
|
-
action:
|
|
1592
|
+
action: K.RESET_CHANNEL,
|
|
1536
1593
|
customChannelId: this.customChannelId,
|
|
1537
1594
|
customMessageId: this.customMessageId,
|
|
1538
1595
|
text: ""
|
|
1539
1596
|
},
|
|
1540
|
-
|
|
1597
|
+
t
|
|
1541
1598
|
);
|
|
1542
1599
|
}
|
|
1543
|
-
sendMessage(
|
|
1544
|
-
const n =
|
|
1600
|
+
sendMessage(t, e) {
|
|
1601
|
+
const n = t.text.trim(), i = t.customMessageId ?? crypto.randomUUID();
|
|
1545
1602
|
return this.conversation$.next(
|
|
1546
1603
|
this.conversation$.value.pushMessage({
|
|
1547
1604
|
type: "user",
|
|
@@ -1551,7 +1608,7 @@ class Me {
|
|
|
1551
1608
|
})
|
|
1552
1609
|
), this.fetchSse(
|
|
1553
1610
|
{
|
|
1554
|
-
action:
|
|
1611
|
+
action: K.NONE,
|
|
1555
1612
|
customChannelId: this.customChannelId,
|
|
1556
1613
|
customMessageId: i,
|
|
1557
1614
|
text: n
|
|
@@ -1560,103 +1617,94 @@ class Me {
|
|
|
1560
1617
|
);
|
|
1561
1618
|
}
|
|
1562
1619
|
close() {
|
|
1563
|
-
var
|
|
1564
|
-
this.isConnecting$.complete(), this.conversation$.complete(), (
|
|
1620
|
+
var t;
|
|
1621
|
+
this.isConnecting$.complete(), this.conversation$.complete(), (t = this.statesSubscription) == null || t.unsubscribe();
|
|
1565
1622
|
}
|
|
1566
1623
|
}
|
|
1567
|
-
class
|
|
1568
|
-
constructor({ messages:
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
this.messages = r, this.showDebugMessage = e ?? !1;
|
|
1624
|
+
class T {
|
|
1625
|
+
constructor({ messages: t }) {
|
|
1626
|
+
m(this, "messages", null);
|
|
1627
|
+
this.messages = t;
|
|
1572
1628
|
}
|
|
1573
|
-
|
|
1574
|
-
return new ke({
|
|
1575
|
-
messages: r,
|
|
1576
|
-
showDebugMessage: this.showDebugMessage
|
|
1577
|
-
});
|
|
1578
|
-
}
|
|
1579
|
-
pushMessage(r) {
|
|
1629
|
+
pushMessage(t) {
|
|
1580
1630
|
const e = new Map(this.messages);
|
|
1581
|
-
return e.set(
|
|
1631
|
+
return e.set(t.messageId, t), new T({ messages: e });
|
|
1582
1632
|
}
|
|
1583
|
-
onMessage(
|
|
1584
|
-
switch (
|
|
1585
|
-
case
|
|
1633
|
+
onMessage(t) {
|
|
1634
|
+
switch (t.eventType) {
|
|
1635
|
+
case y.MESSAGE_START:
|
|
1586
1636
|
return this.onMessageStart(
|
|
1587
|
-
|
|
1637
|
+
t
|
|
1588
1638
|
);
|
|
1589
|
-
case
|
|
1639
|
+
case y.MESSAGE_DELTA:
|
|
1590
1640
|
return this.onMessageDelta(
|
|
1591
|
-
|
|
1641
|
+
t
|
|
1592
1642
|
);
|
|
1593
|
-
case
|
|
1643
|
+
case y.MESSAGE_COMPLETE:
|
|
1594
1644
|
return this.onMessageComplete(
|
|
1595
|
-
|
|
1645
|
+
t
|
|
1596
1646
|
);
|
|
1597
|
-
case
|
|
1598
|
-
return this.onMessageError(
|
|
1647
|
+
case y.ERROR:
|
|
1648
|
+
return this.onMessageError(t);
|
|
1599
1649
|
default:
|
|
1600
1650
|
return this;
|
|
1601
1651
|
}
|
|
1602
1652
|
}
|
|
1603
|
-
onMessageStart(
|
|
1604
|
-
const e =
|
|
1605
|
-
return
|
|
1653
|
+
onMessageStart(t) {
|
|
1654
|
+
const e = t.fact.messageStart.message, n = new Map(this.messages);
|
|
1655
|
+
return n.set(e.messageId, {
|
|
1606
1656
|
type: "bot",
|
|
1607
|
-
eventType:
|
|
1657
|
+
eventType: y.MESSAGE_START,
|
|
1608
1658
|
isTyping: !0,
|
|
1609
1659
|
typingText: "",
|
|
1610
1660
|
messageId: e.messageId,
|
|
1611
1661
|
message: e,
|
|
1612
1662
|
time: /* @__PURE__ */ new Date()
|
|
1613
|
-
}),
|
|
1663
|
+
}), new T({ messages: n });
|
|
1614
1664
|
}
|
|
1615
|
-
onMessageDelta(
|
|
1616
|
-
const e =
|
|
1665
|
+
onMessageDelta(t) {
|
|
1666
|
+
const e = t.fact.messageDelta.message, n = new Map(this.messages), i = n.get(e.messageId);
|
|
1617
1667
|
if ((i == null ? void 0 : i.type) !== "bot") return this;
|
|
1618
|
-
if (e.isDebug && !this.showDebugMessage || (i == null ? void 0 : i.eventType) === g.MESSAGE_COMPLETE)
|
|
1619
|
-
return this.create(n);
|
|
1620
1668
|
const o = `${(i == null ? void 0 : i.typingText) ?? ""}${e.text}`;
|
|
1621
1669
|
return n.set(e.messageId, {
|
|
1622
1670
|
type: "bot",
|
|
1623
|
-
eventType:
|
|
1671
|
+
eventType: y.MESSAGE_DELTA,
|
|
1624
1672
|
isTyping: !0,
|
|
1625
1673
|
typingText: o,
|
|
1626
1674
|
messageId: e.messageId,
|
|
1627
1675
|
message: e,
|
|
1628
1676
|
time: /* @__PURE__ */ new Date()
|
|
1629
|
-
}),
|
|
1677
|
+
}), new T({ messages: n });
|
|
1630
1678
|
}
|
|
1631
|
-
onMessageComplete(
|
|
1632
|
-
const e =
|
|
1633
|
-
return
|
|
1679
|
+
onMessageComplete(t) {
|
|
1680
|
+
const e = t.fact.messageComplete.message, n = new Map(this.messages);
|
|
1681
|
+
return n.set(e.messageId, {
|
|
1634
1682
|
type: "bot",
|
|
1635
|
-
eventType:
|
|
1683
|
+
eventType: y.MESSAGE_COMPLETE,
|
|
1636
1684
|
isTyping: !1,
|
|
1637
1685
|
typingText: null,
|
|
1638
1686
|
messageId: e.messageId,
|
|
1639
1687
|
message: e,
|
|
1640
1688
|
time: /* @__PURE__ */ new Date()
|
|
1641
|
-
}),
|
|
1689
|
+
}), new T({ messages: n });
|
|
1642
1690
|
}
|
|
1643
|
-
onMessageError(
|
|
1644
|
-
const e = crypto.randomUUID(), n =
|
|
1691
|
+
onMessageError(t) {
|
|
1692
|
+
const e = crypto.randomUUID(), n = t.fact.runError.error, i = new Map(this.messages);
|
|
1645
1693
|
return i.set(e, {
|
|
1646
1694
|
type: "error",
|
|
1647
|
-
eventType:
|
|
1695
|
+
eventType: y.ERROR,
|
|
1648
1696
|
messageId: e,
|
|
1649
1697
|
error: n,
|
|
1650
1698
|
time: /* @__PURE__ */ new Date()
|
|
1651
|
-
}),
|
|
1699
|
+
}), new T({ messages: i });
|
|
1652
1700
|
}
|
|
1653
1701
|
}
|
|
1654
1702
|
export {
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1703
|
+
zt as AsgardServiceClient,
|
|
1704
|
+
Re as Channel,
|
|
1705
|
+
T as Conversation,
|
|
1706
|
+
y as EventType,
|
|
1707
|
+
K as FetchSseAction,
|
|
1660
1708
|
Ue as MessageTemplateType
|
|
1661
1709
|
};
|
|
1662
1710
|
//# sourceMappingURL=index.mjs.map
|