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