@cubejs-client/ws-transport 1.3.15 → 1.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2845 +1,35 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CubejsWebSocketTransport = factory());
5
- }(this, (function () { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/defineProperty'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.for-each.js'), require('core-js/modules/es.date.to-json.js'), require('core-js/modules/es.date.to-string.js'), require('core-js/modules/es.object.keys.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.promise.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('core-js/modules/web.timers.js'), require('@babel/runtime/regenerator'), require('isomorphic-ws')) :
3
+ typeof define === 'function' && define.amd ? define(['@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/defineProperty', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.for-each.js', 'core-js/modules/es.date.to-json.js', 'core-js/modules/es.date.to-string.js', 'core-js/modules/es.object.keys.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.promise.js', 'core-js/modules/web.dom-collections.for-each.js', 'core-js/modules/web.timers.js', '@babel/runtime/regenerator', 'isomorphic-ws'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CubejsWebSocketTransport = factory(global._objectWithoutProperties, global._asyncToGenerator, global._classCallCheck, global._createClass, global._defineProperty, null, null, null, null, null, null, null, null, null, null, global._regeneratorRuntime, global.WebSocket));
5
+ }(this, (function (_objectWithoutProperties, _asyncToGenerator, _classCallCheck, _createClass, _defineProperty, es_array_filter_js, es_array_find_js, es_array_forEach_js, es_date_toJson_js, es_date_toString_js, es_object_keys_js, es_object_toString_js, es_promise_js, web_domCollections_forEach_js, web_timers_js, _regeneratorRuntime, WebSocket) { 'use strict';
6
6
 
7
- function _objectWithoutPropertiesLoose(r, e) {
8
- if (null == r) return {};
9
- var t = {};
10
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
11
- if (-1 !== e.indexOf(n)) continue;
12
- t[n] = r[n];
13
- }
14
- return t;
15
- }
16
-
17
- function _objectWithoutProperties(e, t) {
18
- if (null == e) return {};
19
- var o,
20
- r,
21
- i = _objectWithoutPropertiesLoose(e, t);
22
- if (Object.getOwnPropertySymbols) {
23
- var n = Object.getOwnPropertySymbols(e);
24
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
25
- }
26
- return i;
27
- }
28
-
29
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
30
- try {
31
- var i = n[a](c),
32
- u = i.value;
33
- } catch (n) {
34
- return void e(n);
35
- }
36
- i.done ? t(u) : Promise.resolve(u).then(r, o);
37
- }
38
- function _asyncToGenerator(n) {
39
- return function () {
40
- var t = this,
41
- e = arguments;
42
- return new Promise(function (r, o) {
43
- var a = n.apply(t, e);
44
- function _next(n) {
45
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
46
- }
47
- function _throw(n) {
48
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
49
- }
50
- _next(void 0);
51
- });
52
- };
53
- }
54
-
55
- function _classCallCheck(a, n) {
56
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
57
- }
58
-
59
- function _typeof(o) {
60
- "@babel/helpers - typeof";
61
-
62
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
63
- return typeof o;
64
- } : function (o) {
65
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
66
- }, _typeof(o);
67
- }
68
-
69
- function toPrimitive$1(t, r) {
70
- if ("object" != _typeof(t) || !t) return t;
71
- var e = t[Symbol.toPrimitive];
72
- if (void 0 !== e) {
73
- var i = e.call(t, r || "default");
74
- if ("object" != _typeof(i)) return i;
75
- throw new TypeError("@@toPrimitive must return a primitive value.");
76
- }
77
- return ("string" === r ? String : Number)(t);
78
- }
79
-
80
- function toPropertyKey$1(t) {
81
- var i = toPrimitive$1(t, "string");
82
- return "symbol" == _typeof(i) ? i : i + "";
83
- }
84
-
85
- function _defineProperties(e, r) {
86
- for (var t = 0; t < r.length; t++) {
87
- var o = r[t];
88
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$1(o.key), o);
89
- }
90
- }
91
- function _createClass(e, r, t) {
92
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
93
- writable: !1
94
- }), e;
95
- }
96
-
97
- function _defineProperty(e, r, t) {
98
- return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
99
- value: t,
100
- enumerable: !0,
101
- configurable: !0,
102
- writable: !0
103
- }) : e[r] = t, e;
104
- }
105
-
106
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
107
-
108
- function createCommonjsModule(fn) {
109
- var module = { exports: {} };
110
- return fn(module, module.exports), module.exports;
111
- }
112
-
113
- var check = function (it) {
114
- return it && it.Math === Math && it;
115
- };
116
-
117
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
118
- var global$1 =
119
- // eslint-disable-next-line es/no-global-this -- safe
120
- check(typeof globalThis == 'object' && globalThis) ||
121
- check(typeof window == 'object' && window) ||
122
- // eslint-disable-next-line no-restricted-globals -- safe
123
- check(typeof self == 'object' && self) ||
124
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
125
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
126
- // eslint-disable-next-line no-new-func -- fallback
127
- (function () { return this; })() || Function('return this')();
128
-
129
- var fails = function (exec) {
130
- try {
131
- return !!exec();
132
- } catch (error) {
133
- return true;
134
- }
135
- };
136
-
137
- // Detect IE8's incomplete defineProperty implementation
138
- var descriptors = !fails(function () {
139
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
140
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
141
- });
142
-
143
- var functionBindNative = !fails(function () {
144
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
145
- var test = (function () { /* empty */ }).bind();
146
- // eslint-disable-next-line no-prototype-builtins -- safe
147
- return typeof test != 'function' || test.hasOwnProperty('prototype');
148
- });
149
-
150
- var call$2 = Function.prototype.call;
151
-
152
- var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
153
- return call$2.apply(call$2, arguments);
154
- };
155
-
156
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
157
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
158
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
159
-
160
- // Nashorn ~ JDK8 bug
161
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
162
-
163
- // `Object.prototype.propertyIsEnumerable` method implementation
164
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
165
- var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
166
- var descriptor = getOwnPropertyDescriptor$2(this, V);
167
- return !!descriptor && descriptor.enumerable;
168
- } : $propertyIsEnumerable;
169
-
170
- var objectPropertyIsEnumerable = {
171
- f: f$6
172
- };
173
-
174
- var createPropertyDescriptor = function (bitmap, value) {
175
- return {
176
- enumerable: !(bitmap & 1),
177
- configurable: !(bitmap & 2),
178
- writable: !(bitmap & 4),
179
- value: value
180
- };
181
- };
182
-
183
- var FunctionPrototype$2 = Function.prototype;
184
- var call$1 = FunctionPrototype$2.call;
185
- var uncurryThisWithBind = functionBindNative && FunctionPrototype$2.bind.bind(call$1, call$1);
186
-
187
- var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) {
188
- return function () {
189
- return call$1.apply(fn, arguments);
190
- };
191
- };
192
-
193
- var toString$1 = functionUncurryThis({}.toString);
194
- var stringSlice = functionUncurryThis(''.slice);
195
-
196
- var classofRaw = function (it) {
197
- return stringSlice(toString$1(it), 8, -1);
198
- };
199
-
200
- var $Object$3 = Object;
201
- var split = functionUncurryThis(''.split);
202
-
203
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
204
- var indexedObject = fails(function () {
205
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
206
- // eslint-disable-next-line no-prototype-builtins -- safe
207
- return !$Object$3('z').propertyIsEnumerable(0);
208
- }) ? function (it) {
209
- return classofRaw(it) === 'String' ? split(it, '') : $Object$3(it);
210
- } : $Object$3;
211
-
212
- // we can't use just `it == null` since of `document.all` special case
213
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
214
- var isNullOrUndefined = function (it) {
215
- return it === null || it === undefined;
216
- };
217
-
218
- var $TypeError$c = TypeError;
219
-
220
- // `RequireObjectCoercible` abstract operation
221
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
222
- var requireObjectCoercible = function (it) {
223
- if (isNullOrUndefined(it)) throw new $TypeError$c("Can't call method on " + it);
224
- return it;
225
- };
226
-
227
- // toObject with fallback for non-array-like ES3 strings
228
-
229
-
230
-
231
- var toIndexedObject = function (it) {
232
- return indexedObject(requireObjectCoercible(it));
233
- };
234
-
235
- var documentAll$2 = typeof document == 'object' && document.all;
236
-
237
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
238
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
239
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
240
-
241
- var documentAll_1 = {
242
- all: documentAll$2,
243
- IS_HTMLDDA: IS_HTMLDDA
244
- };
245
-
246
- var documentAll$1 = documentAll_1.all;
247
-
248
- // `IsCallable` abstract operation
249
- // https://tc39.es/ecma262/#sec-iscallable
250
- var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
251
- return typeof argument == 'function' || argument === documentAll$1;
252
- } : function (argument) {
253
- return typeof argument == 'function';
254
- };
255
-
256
- var documentAll = documentAll_1.all;
257
-
258
- var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
259
- return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
260
- } : function (it) {
261
- return typeof it == 'object' ? it !== null : isCallable(it);
262
- };
263
-
264
- var aFunction = function (argument) {
265
- return isCallable(argument) ? argument : undefined;
266
- };
267
-
268
- var getBuiltIn = function (namespace, method) {
269
- return arguments.length < 2 ? aFunction(global$1[namespace]) : global$1[namespace] && global$1[namespace][method];
270
- };
271
-
272
- var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
273
-
274
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
275
-
276
- var process$3 = global$1.process;
277
- var Deno$1 = global$1.Deno;
278
- var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
279
- var v8 = versions && versions.v8;
280
- var match, version;
281
-
282
- if (v8) {
283
- match = v8.split('.');
284
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
285
- // but their correct versions are not interesting for us
286
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
287
- }
288
-
289
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
290
- // so check `userAgent` even if `.v8` exists, but 0
291
- if (!version && engineUserAgent) {
292
- match = engineUserAgent.match(/Edge\/(\d+)/);
293
- if (!match || match[1] >= 74) {
294
- match = engineUserAgent.match(/Chrome\/(\d+)/);
295
- if (match) version = +match[1];
296
- }
297
- }
298
-
299
- var engineV8Version = version;
300
-
301
- /* eslint-disable es/no-symbol -- required for testing */
302
-
303
-
304
-
305
-
306
- var $String$3 = global$1.String;
307
-
308
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
309
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
310
- var symbol = Symbol('symbol detection');
311
- // Chrome 38 Symbol has incorrect toString conversion
312
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
313
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
314
- // of course, fail.
315
- return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
316
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
317
- !Symbol.sham && engineV8Version && engineV8Version < 41;
318
- });
319
-
320
- /* eslint-disable es/no-symbol -- required for testing */
321
-
322
-
323
- var useSymbolAsUid = symbolConstructorDetection
324
- && !Symbol.sham
325
- && typeof Symbol.iterator == 'symbol';
326
-
327
- var $Object$2 = Object;
328
-
329
- var isSymbol = useSymbolAsUid ? function (it) {
330
- return typeof it == 'symbol';
331
- } : function (it) {
332
- var $Symbol = getBuiltIn('Symbol');
333
- return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$2(it));
334
- };
335
-
336
- var $String$2 = String;
337
-
338
- var tryToString = function (argument) {
339
- try {
340
- return $String$2(argument);
341
- } catch (error) {
342
- return 'Object';
343
- }
344
- };
345
-
346
- var $TypeError$b = TypeError;
347
-
348
- // `Assert: IsCallable(argument) is true`
349
- var aCallable = function (argument) {
350
- if (isCallable(argument)) return argument;
351
- throw new $TypeError$b(tryToString(argument) + ' is not a function');
352
- };
353
-
354
- // `GetMethod` abstract operation
355
- // https://tc39.es/ecma262/#sec-getmethod
356
- var getMethod = function (V, P) {
357
- var func = V[P];
358
- return isNullOrUndefined(func) ? undefined : aCallable(func);
359
- };
360
-
361
- var $TypeError$a = TypeError;
362
-
363
- // `OrdinaryToPrimitive` abstract operation
364
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
365
- var ordinaryToPrimitive = function (input, pref) {
366
- var fn, val;
367
- if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
368
- if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
369
- if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
370
- throw new $TypeError$a("Can't convert object to primitive value");
371
- };
372
-
373
- // eslint-disable-next-line es/no-object-defineproperty -- safe
374
- var defineProperty$2 = Object.defineProperty;
375
-
376
- var defineGlobalProperty = function (key, value) {
377
- try {
378
- defineProperty$2(global$1, key, { value: value, configurable: true, writable: true });
379
- } catch (error) {
380
- global$1[key] = value;
381
- } return value;
382
- };
383
-
384
- var SHARED = '__core-js_shared__';
385
- var store$1 = global$1[SHARED] || defineGlobalProperty(SHARED, {});
386
-
387
- var sharedStore = store$1;
388
-
389
- var shared = createCommonjsModule(function (module) {
390
-
391
-
392
-
393
- (module.exports = function (key, value) {
394
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
395
- })('versions', []).push({
396
- version: '3.34.0',
397
- mode: 'global',
398
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
399
- license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
400
- source: 'https://github.com/zloirock/core-js'
401
- });
402
- });
403
-
404
- var $Object$1 = Object;
405
-
406
- // `ToObject` abstract operation
407
- // https://tc39.es/ecma262/#sec-toobject
408
- var toObject = function (argument) {
409
- return $Object$1(requireObjectCoercible(argument));
410
- };
411
-
412
- var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
413
-
414
- // `HasOwnProperty` abstract operation
415
- // https://tc39.es/ecma262/#sec-hasownproperty
416
- // eslint-disable-next-line es/no-object-hasown -- safe
417
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
418
- return hasOwnProperty(toObject(it), key);
419
- };
420
-
421
- var id = 0;
422
- var postfix = Math.random();
423
- var toString = functionUncurryThis(1.0.toString);
424
-
425
- var uid = function (key) {
426
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
427
- };
428
-
429
- var Symbol$1 = global$1.Symbol;
430
- var WellKnownSymbolsStore = shared('wks');
431
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
432
-
433
- var wellKnownSymbol = function (name) {
434
- if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
435
- WellKnownSymbolsStore[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)
436
- ? Symbol$1[name]
437
- : createWellKnownSymbol('Symbol.' + name);
438
- } return WellKnownSymbolsStore[name];
439
- };
440
-
441
- var $TypeError$9 = TypeError;
442
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
443
-
444
- // `ToPrimitive` abstract operation
445
- // https://tc39.es/ecma262/#sec-toprimitive
446
- var toPrimitive = function (input, pref) {
447
- if (!isObject(input) || isSymbol(input)) return input;
448
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
449
- var result;
450
- if (exoticToPrim) {
451
- if (pref === undefined) pref = 'default';
452
- result = functionCall(exoticToPrim, input, pref);
453
- if (!isObject(result) || isSymbol(result)) return result;
454
- throw new $TypeError$9("Can't convert object to primitive value");
455
- }
456
- if (pref === undefined) pref = 'number';
457
- return ordinaryToPrimitive(input, pref);
458
- };
459
-
460
- // `ToPropertyKey` abstract operation
461
- // https://tc39.es/ecma262/#sec-topropertykey
462
- var toPropertyKey = function (argument) {
463
- var key = toPrimitive(argument, 'string');
464
- return isSymbol(key) ? key : key + '';
465
- };
466
-
467
- var document$3 = global$1.document;
468
- // typeof document.createElement is 'object' in old IE
469
- var EXISTS$1 = isObject(document$3) && isObject(document$3.createElement);
470
-
471
- var documentCreateElement = function (it) {
472
- return EXISTS$1 ? document$3.createElement(it) : {};
473
- };
474
-
475
- // Thanks to IE8 for its funny defineProperty
476
- var ie8DomDefine = !descriptors && !fails(function () {
477
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
478
- return Object.defineProperty(documentCreateElement('div'), 'a', {
479
- get: function () { return 7; }
480
- }).a !== 7;
481
- });
482
-
483
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
484
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
485
-
486
- // `Object.getOwnPropertyDescriptor` method
487
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
488
- var f$5 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
489
- O = toIndexedObject(O);
490
- P = toPropertyKey(P);
491
- if (ie8DomDefine) try {
492
- return $getOwnPropertyDescriptor$1(O, P);
493
- } catch (error) { /* empty */ }
494
- if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
495
- };
496
-
497
- var objectGetOwnPropertyDescriptor = {
498
- f: f$5
499
- };
500
-
501
- // V8 ~ Chrome 36-
502
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
503
- var v8PrototypeDefineBug = descriptors && fails(function () {
504
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
505
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
506
- value: 42,
507
- writable: false
508
- }).prototype !== 42;
509
- });
510
-
511
- var $String$1 = String;
512
- var $TypeError$8 = TypeError;
513
-
514
- // `Assert: Type(argument) is Object`
515
- var anObject = function (argument) {
516
- if (isObject(argument)) return argument;
517
- throw new $TypeError$8($String$1(argument) + ' is not an object');
518
- };
519
-
520
- var $TypeError$7 = TypeError;
521
- // eslint-disable-next-line es/no-object-defineproperty -- safe
522
- var $defineProperty = Object.defineProperty;
523
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
524
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
525
- var ENUMERABLE = 'enumerable';
526
- var CONFIGURABLE$1 = 'configurable';
527
- var WRITABLE = 'writable';
528
-
529
- // `Object.defineProperty` method
530
- // https://tc39.es/ecma262/#sec-object.defineproperty
531
- var f$4 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
532
- anObject(O);
533
- P = toPropertyKey(P);
534
- anObject(Attributes);
535
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
536
- var current = $getOwnPropertyDescriptor(O, P);
537
- if (current && current[WRITABLE]) {
538
- O[P] = Attributes.value;
539
- Attributes = {
540
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
541
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
542
- writable: false
543
- };
544
- }
545
- } return $defineProperty(O, P, Attributes);
546
- } : $defineProperty : function defineProperty(O, P, Attributes) {
547
- anObject(O);
548
- P = toPropertyKey(P);
549
- anObject(Attributes);
550
- if (ie8DomDefine) try {
551
- return $defineProperty(O, P, Attributes);
552
- } catch (error) { /* empty */ }
553
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$7('Accessors not supported');
554
- if ('value' in Attributes) O[P] = Attributes.value;
555
- return O;
556
- };
557
-
558
- var objectDefineProperty = {
559
- f: f$4
560
- };
561
-
562
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
563
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
564
- } : function (object, key, value) {
565
- object[key] = value;
566
- return object;
567
- };
568
-
569
- var FunctionPrototype$1 = Function.prototype;
570
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
571
- var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
572
-
573
- var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
574
- // additional protection from minified / mangled / dropped function names
575
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
576
- var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
577
-
578
- var functionName = {
579
- EXISTS: EXISTS,
580
- PROPER: PROPER,
581
- CONFIGURABLE: CONFIGURABLE
582
- };
583
-
584
- var functionToString = functionUncurryThis(Function.toString);
585
-
586
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
587
- if (!isCallable(sharedStore.inspectSource)) {
588
- sharedStore.inspectSource = function (it) {
589
- return functionToString(it);
590
- };
591
- }
592
-
593
- var inspectSource = sharedStore.inspectSource;
594
-
595
- var WeakMap$1 = global$1.WeakMap;
596
-
597
- var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
598
-
599
- var keys = shared('keys');
600
-
601
- var sharedKey = function (key) {
602
- return keys[key] || (keys[key] = uid(key));
603
- };
604
-
605
- var hiddenKeys$1 = {};
606
-
607
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
608
- var TypeError$2 = global$1.TypeError;
609
- var WeakMap = global$1.WeakMap;
610
- var set$1, get, has;
611
-
612
- var enforce = function (it) {
613
- return has(it) ? get(it) : set$1(it, {});
614
- };
615
-
616
- var getterFor = function (TYPE) {
617
- return function (it) {
618
- var state;
619
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
620
- throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
621
- } return state;
622
- };
623
- };
624
-
625
- if (weakMapBasicDetection || sharedStore.state) {
626
- var store = sharedStore.state || (sharedStore.state = new WeakMap());
627
- /* eslint-disable no-self-assign -- prototype methods protection */
628
- store.get = store.get;
629
- store.has = store.has;
630
- store.set = store.set;
631
- /* eslint-enable no-self-assign -- prototype methods protection */
632
- set$1 = function (it, metadata) {
633
- if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
634
- metadata.facade = it;
635
- store.set(it, metadata);
636
- return metadata;
637
- };
638
- get = function (it) {
639
- return store.get(it) || {};
640
- };
641
- has = function (it) {
642
- return store.has(it);
643
- };
644
- } else {
645
- var STATE = sharedKey('state');
646
- hiddenKeys$1[STATE] = true;
647
- set$1 = function (it, metadata) {
648
- if (hasOwnProperty_1(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
649
- metadata.facade = it;
650
- createNonEnumerableProperty(it, STATE, metadata);
651
- return metadata;
652
- };
653
- get = function (it) {
654
- return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
655
- };
656
- has = function (it) {
657
- return hasOwnProperty_1(it, STATE);
658
- };
659
- }
660
-
661
- var internalState = {
662
- set: set$1,
663
- get: get,
664
- has: has,
665
- enforce: enforce,
666
- getterFor: getterFor
667
- };
668
-
669
- var makeBuiltIn_1 = createCommonjsModule(function (module) {
670
-
671
-
672
-
673
-
674
-
675
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
676
-
677
-
678
-
679
- var enforceInternalState = internalState.enforce;
680
- var getInternalState = internalState.get;
681
- var $String = String;
682
- // eslint-disable-next-line es/no-object-defineproperty -- safe
683
- var defineProperty = Object.defineProperty;
684
- var stringSlice = functionUncurryThis(''.slice);
685
- var replace = functionUncurryThis(''.replace);
686
- var join = functionUncurryThis([].join);
687
-
688
- var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
689
- return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
690
- });
691
-
692
- var TEMPLATE = String(String).split('String');
693
-
694
- var makeBuiltIn = module.exports = function (value, name, options) {
695
- if (stringSlice($String(name), 0, 7) === 'Symbol(') {
696
- name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
697
- }
698
- if (options && options.getter) name = 'get ' + name;
699
- if (options && options.setter) name = 'set ' + name;
700
- if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
701
- if (descriptors) defineProperty(value, 'name', { value: name, configurable: true });
702
- else value.name = name;
703
- }
704
- if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
705
- defineProperty(value, 'length', { value: options.arity });
706
- }
707
- try {
708
- if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
709
- if (descriptors) defineProperty(value, 'prototype', { writable: false });
710
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
711
- } else if (value.prototype) value.prototype = undefined;
712
- } catch (error) { /* empty */ }
713
- var state = enforceInternalState(value);
714
- if (!hasOwnProperty_1(state, 'source')) {
715
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
716
- } return value;
717
- };
718
-
719
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
720
- // eslint-disable-next-line no-extend-native -- required
721
- Function.prototype.toString = makeBuiltIn(function toString() {
722
- return isCallable(this) && getInternalState(this).source || inspectSource(this);
723
- }, 'toString');
724
- });
725
-
726
- var defineBuiltIn = function (O, key, value, options) {
727
- if (!options) options = {};
728
- var simple = options.enumerable;
729
- var name = options.name !== undefined ? options.name : key;
730
- if (isCallable(value)) makeBuiltIn_1(value, name, options);
731
- if (options.global) {
732
- if (simple) O[key] = value;
733
- else defineGlobalProperty(key, value);
734
- } else {
735
- try {
736
- if (!options.unsafe) delete O[key];
737
- else if (O[key]) simple = true;
738
- } catch (error) { /* empty */ }
739
- if (simple) O[key] = value;
740
- else objectDefineProperty.f(O, key, {
741
- value: value,
742
- enumerable: false,
743
- configurable: !options.nonConfigurable,
744
- writable: !options.nonWritable
745
- });
746
- } return O;
747
- };
748
-
749
- var ceil = Math.ceil;
750
- var floor = Math.floor;
751
-
752
- // `Math.trunc` method
753
- // https://tc39.es/ecma262/#sec-math.trunc
754
- // eslint-disable-next-line es/no-math-trunc -- safe
755
- var mathTrunc = Math.trunc || function trunc(x) {
756
- var n = +x;
757
- return (n > 0 ? floor : ceil)(n);
758
- };
759
-
760
- // `ToIntegerOrInfinity` abstract operation
761
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
762
- var toIntegerOrInfinity = function (argument) {
763
- var number = +argument;
764
- // eslint-disable-next-line no-self-compare -- NaN check
765
- return number !== number || number === 0 ? 0 : mathTrunc(number);
766
- };
767
-
768
- var max = Math.max;
769
- var min$1 = Math.min;
770
-
771
- // Helper for a popular repeating case of the spec:
772
- // Let integer be ? ToInteger(index).
773
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
774
- var toAbsoluteIndex = function (index, length) {
775
- var integer = toIntegerOrInfinity(index);
776
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
777
- };
778
-
779
- var min = Math.min;
780
-
781
- // `ToLength` abstract operation
782
- // https://tc39.es/ecma262/#sec-tolength
783
- var toLength = function (argument) {
784
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
785
- };
786
-
787
- // `LengthOfArrayLike` abstract operation
788
- // https://tc39.es/ecma262/#sec-lengthofarraylike
789
- var lengthOfArrayLike = function (obj) {
790
- return toLength(obj.length);
791
- };
792
-
793
- // `Array.prototype.{ indexOf, includes }` methods implementation
794
- var createMethod$1 = function (IS_INCLUDES) {
795
- return function ($this, el, fromIndex) {
796
- var O = toIndexedObject($this);
797
- var length = lengthOfArrayLike(O);
798
- var index = toAbsoluteIndex(fromIndex, length);
799
- var value;
800
- // Array#includes uses SameValueZero equality algorithm
801
- // eslint-disable-next-line no-self-compare -- NaN check
802
- if (IS_INCLUDES && el !== el) while (length > index) {
803
- value = O[index++];
804
- // eslint-disable-next-line no-self-compare -- NaN check
805
- if (value !== value) return true;
806
- // Array#indexOf ignores holes, Array#includes - not
807
- } else for (;length > index; index++) {
808
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
809
- } return !IS_INCLUDES && -1;
810
- };
811
- };
812
-
813
- var arrayIncludes = {
814
- // `Array.prototype.includes` method
815
- // https://tc39.es/ecma262/#sec-array.prototype.includes
816
- includes: createMethod$1(true),
817
- // `Array.prototype.indexOf` method
818
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
819
- indexOf: createMethod$1(false)
820
- };
821
-
822
- var indexOf = arrayIncludes.indexOf;
823
-
824
-
825
- var push$1 = functionUncurryThis([].push);
826
-
827
- var objectKeysInternal = function (object, names) {
828
- var O = toIndexedObject(object);
829
- var i = 0;
830
- var result = [];
831
- var key;
832
- for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
833
- // Don't enum bug & hidden keys
834
- while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
835
- ~indexOf(result, key) || push$1(result, key);
836
- }
837
- return result;
838
- };
839
-
840
- // IE8- don't enum bug keys
841
- var enumBugKeys = [
842
- 'constructor',
843
- 'hasOwnProperty',
844
- 'isPrototypeOf',
845
- 'propertyIsEnumerable',
846
- 'toLocaleString',
847
- 'toString',
848
- 'valueOf'
849
- ];
850
-
851
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
852
-
853
- // `Object.getOwnPropertyNames` method
854
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
855
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
856
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
857
- return objectKeysInternal(O, hiddenKeys);
858
- };
859
-
860
- var objectGetOwnPropertyNames = {
861
- f: f$3
862
- };
863
-
864
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
865
- var f$2 = Object.getOwnPropertySymbols;
866
-
867
- var objectGetOwnPropertySymbols = {
868
- f: f$2
869
- };
870
-
871
- var concat = functionUncurryThis([].concat);
872
-
873
- // all object keys, includes non-enumerable and symbols
874
- var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
875
- var keys = objectGetOwnPropertyNames.f(anObject(it));
876
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
877
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
878
- };
879
-
880
- var copyConstructorProperties = function (target, source, exceptions) {
881
- var keys = ownKeys(source);
882
- var defineProperty = objectDefineProperty.f;
883
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
884
- for (var i = 0; i < keys.length; i++) {
885
- var key = keys[i];
886
- if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
887
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
888
- }
889
- }
890
- };
891
-
892
- var replacement = /#|\.prototype\./;
893
-
894
- var isForced = function (feature, detection) {
895
- var value = data[normalize(feature)];
896
- return value === POLYFILL ? true
897
- : value === NATIVE ? false
898
- : isCallable(detection) ? fails(detection)
899
- : !!detection;
900
- };
901
-
902
- var normalize = isForced.normalize = function (string) {
903
- return String(string).replace(replacement, '.').toLowerCase();
904
- };
905
-
906
- var data = isForced.data = {};
907
- var NATIVE = isForced.NATIVE = 'N';
908
- var POLYFILL = isForced.POLYFILL = 'P';
909
-
910
- var isForced_1 = isForced;
911
-
912
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
913
-
914
-
915
-
916
-
917
-
918
-
919
- /*
920
- options.target - name of the target object
921
- options.global - target is the global object
922
- options.stat - export as static methods of target
923
- options.proto - export as prototype methods of target
924
- options.real - real prototype method for the `pure` version
925
- options.forced - export even if the native feature is available
926
- options.bind - bind methods to the target, required for the `pure` version
927
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
928
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
929
- options.sham - add a flag to not completely full polyfills
930
- options.enumerable - export as enumerable property
931
- options.dontCallGetSet - prevent calling a getter on target
932
- options.name - the .name of the function if it does not match the key
933
- */
934
- var _export = function (options, source) {
935
- var TARGET = options.target;
936
- var GLOBAL = options.global;
937
- var STATIC = options.stat;
938
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
939
- if (GLOBAL) {
940
- target = global$1;
941
- } else if (STATIC) {
942
- target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
943
- } else {
944
- target = (global$1[TARGET] || {}).prototype;
945
- }
946
- if (target) for (key in source) {
947
- sourceProperty = source[key];
948
- if (options.dontCallGetSet) {
949
- descriptor = getOwnPropertyDescriptor$1(target, key);
950
- targetProperty = descriptor && descriptor.value;
951
- } else targetProperty = target[key];
952
- FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
953
- // contained in target
954
- if (!FORCED && targetProperty !== undefined) {
955
- if (typeof sourceProperty == typeof targetProperty) continue;
956
- copyConstructorProperties(sourceProperty, targetProperty);
957
- }
958
- // add a flag to not completely full polyfills
959
- if (options.sham || (targetProperty && targetProperty.sham)) {
960
- createNonEnumerableProperty(sourceProperty, 'sham', true);
961
- }
962
- defineBuiltIn(target, key, sourceProperty, options);
963
- }
964
- };
965
-
966
- var functionUncurryThisClause = function (fn) {
967
- // Nashorn bug:
968
- // https://github.com/zloirock/core-js/issues/1128
969
- // https://github.com/zloirock/core-js/issues/1130
970
- if (classofRaw(fn) === 'Function') return functionUncurryThis(fn);
971
- };
972
-
973
- var bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind);
974
-
975
- // optional / simple context binding
976
- var functionBindContext = function (fn, that) {
977
- aCallable(fn);
978
- return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function (/* ...args */) {
979
- return fn.apply(that, arguments);
980
- };
981
- };
982
-
983
- // `IsArray` abstract operation
984
- // https://tc39.es/ecma262/#sec-isarray
985
- // eslint-disable-next-line es/no-array-isarray -- safe
986
- var isArray = Array.isArray || function isArray(argument) {
987
- return classofRaw(argument) === 'Array';
988
- };
989
-
990
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
991
- var test = {};
992
-
993
- test[TO_STRING_TAG$2] = 'z';
994
-
995
- var toStringTagSupport = String(test) === '[object z]';
996
-
997
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
998
- var $Object = Object;
999
-
1000
- // ES3 wrong here
1001
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1002
-
1003
- // fallback for IE11 Script Access Denied error
1004
- var tryGet = function (it, key) {
1005
- try {
1006
- return it[key];
1007
- } catch (error) { /* empty */ }
1008
- };
1009
-
1010
- // getting tag from ES6+ `Object.prototype.toString`
1011
- var classof = toStringTagSupport ? classofRaw : function (it) {
1012
- var O, tag, result;
1013
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1014
- // @@toStringTag case
1015
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1016
- // builtinTag case
1017
- : CORRECT_ARGUMENTS ? classofRaw(O)
1018
- // ES3 arguments fallback
1019
- : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1020
- };
1021
-
1022
- var noop = function () { /* empty */ };
1023
- var empty = [];
1024
- var construct = getBuiltIn('Reflect', 'construct');
1025
- var constructorRegExp = /^\s*(?:class|function)\b/;
1026
- var exec = functionUncurryThis(constructorRegExp.exec);
1027
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1028
-
1029
- var isConstructorModern = function isConstructor(argument) {
1030
- if (!isCallable(argument)) return false;
1031
- try {
1032
- construct(noop, empty, argument);
1033
- return true;
1034
- } catch (error) {
1035
- return false;
1036
- }
1037
- };
1038
-
1039
- var isConstructorLegacy = function isConstructor(argument) {
1040
- if (!isCallable(argument)) return false;
1041
- switch (classof(argument)) {
1042
- case 'AsyncFunction':
1043
- case 'GeneratorFunction':
1044
- case 'AsyncGeneratorFunction': return false;
1045
- }
1046
- try {
1047
- // we can't check .prototype since constructors produced by .bind haven't it
1048
- // `Function#toString` throws on some built-it function in some legacy engines
1049
- // (for example, `DOMQuad` and similar in FF41-)
1050
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1051
- } catch (error) {
1052
- return true;
1053
- }
1054
- };
1055
-
1056
- isConstructorLegacy.sham = true;
1057
-
1058
- // `IsConstructor` abstract operation
1059
- // https://tc39.es/ecma262/#sec-isconstructor
1060
- var isConstructor = !construct || fails(function () {
1061
- var called;
1062
- return isConstructorModern(isConstructorModern.call)
1063
- || !isConstructorModern(Object)
1064
- || !isConstructorModern(function () { called = true; })
1065
- || called;
1066
- }) ? isConstructorLegacy : isConstructorModern;
1067
-
1068
- var SPECIES$4 = wellKnownSymbol('species');
1069
- var $Array = Array;
1070
-
1071
- // a part of `ArraySpeciesCreate` abstract operation
1072
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
1073
- var arraySpeciesConstructor = function (originalArray) {
1074
- var C;
1075
- if (isArray(originalArray)) {
1076
- C = originalArray.constructor;
1077
- // cross-realm fallback
1078
- if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
1079
- else if (isObject(C)) {
1080
- C = C[SPECIES$4];
1081
- if (C === null) C = undefined;
1082
- }
1083
- } return C === undefined ? $Array : C;
1084
- };
1085
-
1086
- // `ArraySpeciesCreate` abstract operation
1087
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
1088
- var arraySpeciesCreate = function (originalArray, length) {
1089
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1090
- };
1091
-
1092
- var push = functionUncurryThis([].push);
1093
-
1094
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1095
- var createMethod = function (TYPE) {
1096
- var IS_MAP = TYPE === 1;
1097
- var IS_FILTER = TYPE === 2;
1098
- var IS_SOME = TYPE === 3;
1099
- var IS_EVERY = TYPE === 4;
1100
- var IS_FIND_INDEX = TYPE === 6;
1101
- var IS_FILTER_REJECT = TYPE === 7;
1102
- var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
1103
- return function ($this, callbackfn, that, specificCreate) {
1104
- var O = toObject($this);
1105
- var self = indexedObject(O);
1106
- var length = lengthOfArrayLike(self);
1107
- var boundFunction = functionBindContext(callbackfn, that);
1108
- var index = 0;
1109
- var create = specificCreate || arraySpeciesCreate;
1110
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
1111
- var value, result;
1112
- for (;length > index; index++) if (NO_HOLES || index in self) {
1113
- value = self[index];
1114
- result = boundFunction(value, index, O);
1115
- if (TYPE) {
1116
- if (IS_MAP) target[index] = result; // map
1117
- else if (result) switch (TYPE) {
1118
- case 3: return true; // some
1119
- case 5: return value; // find
1120
- case 6: return index; // findIndex
1121
- case 2: push(target, value); // filter
1122
- } else switch (TYPE) {
1123
- case 4: return false; // every
1124
- case 7: push(target, value); // filterReject
1125
- }
1126
- }
1127
- }
1128
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
1129
- };
1130
- };
1131
-
1132
- var arrayIteration = {
1133
- // `Array.prototype.forEach` method
1134
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
1135
- forEach: createMethod(0),
1136
- // `Array.prototype.map` method
1137
- // https://tc39.es/ecma262/#sec-array.prototype.map
1138
- map: createMethod(1),
1139
- // `Array.prototype.filter` method
1140
- // https://tc39.es/ecma262/#sec-array.prototype.filter
1141
- filter: createMethod(2),
1142
- // `Array.prototype.some` method
1143
- // https://tc39.es/ecma262/#sec-array.prototype.some
1144
- some: createMethod(3),
1145
- // `Array.prototype.every` method
1146
- // https://tc39.es/ecma262/#sec-array.prototype.every
1147
- every: createMethod(4),
1148
- // `Array.prototype.find` method
1149
- // https://tc39.es/ecma262/#sec-array.prototype.find
1150
- find: createMethod(5),
1151
- // `Array.prototype.findIndex` method
1152
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
1153
- findIndex: createMethod(6),
1154
- // `Array.prototype.filterReject` method
1155
- // https://github.com/tc39/proposal-array-filtering
1156
- filterReject: createMethod(7)
1157
- };
1158
-
1159
- var SPECIES$3 = wellKnownSymbol('species');
1160
-
1161
- var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1162
- // We can't use this feature detection in V8 since it causes
1163
- // deoptimization and serious performance degradation
1164
- // https://github.com/zloirock/core-js/issues/677
1165
- return engineV8Version >= 51 || !fails(function () {
1166
- var array = [];
1167
- var constructor = array.constructor = {};
1168
- constructor[SPECIES$3] = function () {
1169
- return { foo: 1 };
1170
- };
1171
- return array[METHOD_NAME](Boolean).foo !== 1;
1172
- });
1173
- };
1174
-
1175
- var $filter = arrayIteration.filter;
1176
-
1177
-
1178
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
1179
-
1180
- // `Array.prototype.filter` method
1181
- // https://tc39.es/ecma262/#sec-array.prototype.filter
1182
- // with adding support of @@species
1183
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
1184
- filter: function filter(callbackfn /* , thisArg */) {
1185
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1186
- }
1187
- });
1188
-
1189
- // `Object.keys` method
1190
- // https://tc39.es/ecma262/#sec-object.keys
1191
- // eslint-disable-next-line es/no-object-keys -- safe
1192
- var objectKeys = Object.keys || function keys(O) {
1193
- return objectKeysInternal(O, enumBugKeys);
1194
- };
1195
-
1196
- // `Object.defineProperties` method
1197
- // https://tc39.es/ecma262/#sec-object.defineproperties
1198
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1199
- var f$1 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
1200
- anObject(O);
1201
- var props = toIndexedObject(Properties);
1202
- var keys = objectKeys(Properties);
1203
- var length = keys.length;
1204
- var index = 0;
1205
- var key;
1206
- while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
1207
- return O;
1208
- };
1209
-
1210
- var objectDefineProperties = {
1211
- f: f$1
1212
- };
1213
-
1214
- var html = getBuiltIn('document', 'documentElement');
1215
-
1216
- /* global ActiveXObject -- old IE, WSH */
1217
-
1218
-
1219
-
1220
-
1221
-
1222
-
1223
-
1224
-
1225
- var GT = '>';
1226
- var LT = '<';
1227
- var PROTOTYPE = 'prototype';
1228
- var SCRIPT = 'script';
1229
- var IE_PROTO = sharedKey('IE_PROTO');
1230
-
1231
- var EmptyConstructor = function () { /* empty */ };
1232
-
1233
- var scriptTag = function (content) {
1234
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1235
- };
1236
-
1237
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1238
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1239
- activeXDocument.write(scriptTag(''));
1240
- activeXDocument.close();
1241
- var temp = activeXDocument.parentWindow.Object;
1242
- activeXDocument = null; // avoid memory leak
1243
- return temp;
1244
- };
1245
-
1246
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1247
- var NullProtoObjectViaIFrame = function () {
1248
- // Thrash, waste and sodomy: IE GC bug
1249
- var iframe = documentCreateElement('iframe');
1250
- var JS = 'java' + SCRIPT + ':';
1251
- var iframeDocument;
1252
- iframe.style.display = 'none';
1253
- html.appendChild(iframe);
1254
- // https://github.com/zloirock/core-js/issues/475
1255
- iframe.src = String(JS);
1256
- iframeDocument = iframe.contentWindow.document;
1257
- iframeDocument.open();
1258
- iframeDocument.write(scriptTag('document.F=Object'));
1259
- iframeDocument.close();
1260
- return iframeDocument.F;
1261
- };
1262
-
1263
- // Check for document.domain and active x support
1264
- // No need to use active x approach when document.domain is not set
1265
- // see https://github.com/es-shims/es5-shim/issues/150
1266
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1267
- // avoid IE GC bug
1268
- var activeXDocument;
1269
- var NullProtoObject = function () {
1270
- try {
1271
- activeXDocument = new ActiveXObject('htmlfile');
1272
- } catch (error) { /* ignore */ }
1273
- NullProtoObject = typeof document != 'undefined'
1274
- ? document.domain && activeXDocument
1275
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1276
- : NullProtoObjectViaIFrame()
1277
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1278
- var length = enumBugKeys.length;
1279
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1280
- return NullProtoObject();
1281
- };
1282
-
1283
- hiddenKeys$1[IE_PROTO] = true;
1284
-
1285
- // `Object.create` method
1286
- // https://tc39.es/ecma262/#sec-object.create
1287
- // eslint-disable-next-line es/no-object-create -- safe
1288
- var objectCreate = Object.create || function create(O, Properties) {
1289
- var result;
1290
- if (O !== null) {
1291
- EmptyConstructor[PROTOTYPE] = anObject(O);
1292
- result = new EmptyConstructor();
1293
- EmptyConstructor[PROTOTYPE] = null;
1294
- // add "__proto__" for Object.getPrototypeOf polyfill
1295
- result[IE_PROTO] = O;
1296
- } else result = NullProtoObject();
1297
- return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
1298
- };
1299
-
1300
- var defineProperty$1 = objectDefineProperty.f;
1301
-
1302
- var UNSCOPABLES = wellKnownSymbol('unscopables');
1303
- var ArrayPrototype$1 = Array.prototype;
1304
-
1305
- // Array.prototype[@@unscopables]
1306
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1307
- if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
1308
- defineProperty$1(ArrayPrototype$1, UNSCOPABLES, {
1309
- configurable: true,
1310
- value: objectCreate(null)
1311
- });
1312
- }
1313
-
1314
- // add a key to Array.prototype[@@unscopables]
1315
- var addToUnscopables = function (key) {
1316
- ArrayPrototype$1[UNSCOPABLES][key] = true;
1317
- };
1318
-
1319
- var $find = arrayIteration.find;
1320
-
1321
-
1322
- var FIND = 'find';
1323
- var SKIPS_HOLES = true;
1324
-
1325
- // Shouldn't skip holes
1326
- // eslint-disable-next-line es/no-array-prototype-find -- testing
1327
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
1328
-
1329
- // `Array.prototype.find` method
1330
- // https://tc39.es/ecma262/#sec-array.prototype.find
1331
- _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1332
- find: function find(callbackfn /* , that = undefined */) {
1333
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1334
- }
1335
- });
1336
-
1337
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1338
- addToUnscopables(FIND);
1339
-
1340
- var arrayMethodIsStrict = function (METHOD_NAME, argument) {
1341
- var method = [][METHOD_NAME];
1342
- return !!method && fails(function () {
1343
- // eslint-disable-next-line no-useless-call -- required for testing
1344
- method.call(null, argument || function () { return 1; }, 1);
1345
- });
1346
- };
1347
-
1348
- var $forEach = arrayIteration.forEach;
1349
-
1350
-
1351
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
1352
-
1353
- // `Array.prototype.forEach` method implementation
1354
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
1355
- var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
1356
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1357
- // eslint-disable-next-line es/no-array-prototype-foreach -- safe
1358
- } : [].forEach;
1359
-
1360
- // `Array.prototype.forEach` method
1361
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
1362
- // eslint-disable-next-line es/no-array-prototype-foreach -- safe
1363
- _export({ target: 'Array', proto: true, forced: [].forEach !== arrayForEach }, {
1364
- forEach: arrayForEach
1365
- });
1366
-
1367
- var FORCED = fails(function () {
1368
- return new Date(NaN).toJSON() !== null
1369
- || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
1370
- });
1371
-
1372
- // `Date.prototype.toJSON` method
1373
- // https://tc39.es/ecma262/#sec-date.prototype.tojson
1374
- _export({ target: 'Date', proto: true, arity: 1, forced: FORCED }, {
1375
- // eslint-disable-next-line no-unused-vars -- required for `.length`
1376
- toJSON: function toJSON(key) {
1377
- var O = toObject(this);
1378
- var pv = toPrimitive(O, 'number');
1379
- return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
1380
- }
1381
- });
1382
-
1383
- // TODO: Remove from `core-js@4`
1384
-
1385
-
1386
-
1387
- var DatePrototype = Date.prototype;
1388
- var INVALID_DATE = 'Invalid Date';
1389
- var TO_STRING = 'toString';
1390
- var nativeDateToString = functionUncurryThis(DatePrototype[TO_STRING]);
1391
- var thisTimeValue = functionUncurryThis(DatePrototype.getTime);
1392
-
1393
- // `Date.prototype.toString` method
1394
- // https://tc39.es/ecma262/#sec-date.prototype.tostring
1395
- if (String(new Date(NaN)) !== INVALID_DATE) {
1396
- defineBuiltIn(DatePrototype, TO_STRING, function toString() {
1397
- var value = thisTimeValue(this);
1398
- // eslint-disable-next-line no-self-compare -- NaN check
1399
- return value === value ? nativeDateToString(this) : INVALID_DATE;
1400
- });
1401
- }
1402
-
1403
- var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
1404
-
1405
- // `Object.keys` method
1406
- // https://tc39.es/ecma262/#sec-object.keys
1407
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
1408
- keys: function keys(it) {
1409
- return objectKeys(toObject(it));
1410
- }
1411
- });
1412
-
1413
- // `Object.prototype.toString` method implementation
1414
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
1415
- var objectToString = toStringTagSupport ? {}.toString : function toString() {
1416
- return '[object ' + classof(this) + ']';
1417
- };
1418
-
1419
- // `Object.prototype.toString` method
1420
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
1421
- if (!toStringTagSupport) {
1422
- defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
1423
- }
1424
-
1425
- var engineIsNode = classofRaw(global$1.process) === 'process';
1426
-
1427
- var functionUncurryThisAccessor = function (object, key, method) {
1428
- try {
1429
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1430
- return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1431
- } catch (error) { /* empty */ }
1432
- };
1433
-
1434
- var $String = String;
1435
- var $TypeError$6 = TypeError;
1436
-
1437
- var aPossiblePrototype = function (argument) {
1438
- if (typeof argument == 'object' || isCallable(argument)) return argument;
1439
- throw new $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1440
- };
1441
-
1442
- /* eslint-disable no-proto -- safe */
1443
-
1444
-
1445
-
1446
-
1447
- // `Object.setPrototypeOf` method
1448
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1449
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1450
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1451
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1452
- var CORRECT_SETTER = false;
1453
- var test = {};
1454
- var setter;
1455
- try {
1456
- setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
1457
- setter(test, []);
1458
- CORRECT_SETTER = test instanceof Array;
1459
- } catch (error) { /* empty */ }
1460
- return function setPrototypeOf(O, proto) {
1461
- anObject(O);
1462
- aPossiblePrototype(proto);
1463
- if (CORRECT_SETTER) setter(O, proto);
1464
- else O.__proto__ = proto;
1465
- return O;
1466
- };
1467
- }() : undefined);
1468
-
1469
- var defineProperty = objectDefineProperty.f;
1470
-
1471
-
1472
-
1473
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1474
-
1475
- var setToStringTag = function (target, TAG, STATIC) {
1476
- if (target && !STATIC) target = target.prototype;
1477
- if (target && !hasOwnProperty_1(target, TO_STRING_TAG)) {
1478
- defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
1479
- }
1480
- };
1481
-
1482
- var defineBuiltInAccessor = function (target, name, descriptor) {
1483
- if (descriptor.get) makeBuiltIn_1(descriptor.get, name, { getter: true });
1484
- if (descriptor.set) makeBuiltIn_1(descriptor.set, name, { setter: true });
1485
- return objectDefineProperty.f(target, name, descriptor);
1486
- };
1487
-
1488
- var SPECIES$2 = wellKnownSymbol('species');
1489
-
1490
- var setSpecies = function (CONSTRUCTOR_NAME) {
1491
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1492
-
1493
- if (descriptors && Constructor && !Constructor[SPECIES$2]) {
1494
- defineBuiltInAccessor(Constructor, SPECIES$2, {
1495
- configurable: true,
1496
- get: function () { return this; }
1497
- });
1498
- }
1499
- };
1500
-
1501
- var $TypeError$5 = TypeError;
1502
-
1503
- var anInstance = function (it, Prototype) {
1504
- if (objectIsPrototypeOf(Prototype, it)) return it;
1505
- throw new $TypeError$5('Incorrect invocation');
1506
- };
1507
-
1508
- var $TypeError$4 = TypeError;
1509
-
1510
- // `Assert: IsConstructor(argument) is true`
1511
- var aConstructor = function (argument) {
1512
- if (isConstructor(argument)) return argument;
1513
- throw new $TypeError$4(tryToString(argument) + ' is not a constructor');
1514
- };
1515
-
1516
- var SPECIES$1 = wellKnownSymbol('species');
1517
-
1518
- // `SpeciesConstructor` abstract operation
1519
- // https://tc39.es/ecma262/#sec-speciesconstructor
1520
- var speciesConstructor = function (O, defaultConstructor) {
1521
- var C = anObject(O).constructor;
1522
- var S;
1523
- return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1524
- };
1525
-
1526
- var FunctionPrototype = Function.prototype;
1527
- var apply = FunctionPrototype.apply;
1528
- var call = FunctionPrototype.call;
1529
-
1530
- // eslint-disable-next-line es/no-reflect -- safe
1531
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
1532
- return call.apply(apply, arguments);
1533
- });
1534
-
1535
- var arraySlice = functionUncurryThis([].slice);
1536
-
1537
- var $TypeError$3 = TypeError;
1538
-
1539
- var validateArgumentsLength = function (passed, required) {
1540
- if (passed < required) throw new $TypeError$3('Not enough arguments');
1541
- return passed;
1542
- };
1543
-
1544
- // eslint-disable-next-line redos/no-vulnerable -- safe
1545
- var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
1546
-
1547
- var set = global$1.setImmediate;
1548
- var clear = global$1.clearImmediate;
1549
- var process$2 = global$1.process;
1550
- var Dispatch = global$1.Dispatch;
1551
- var Function$2 = global$1.Function;
1552
- var MessageChannel = global$1.MessageChannel;
1553
- var String$1 = global$1.String;
1554
- var counter = 0;
1555
- var queue$2 = {};
1556
- var ONREADYSTATECHANGE = 'onreadystatechange';
1557
- var $location, defer, channel, port;
1558
-
1559
- fails(function () {
1560
- // Deno throws a ReferenceError on `location` access without `--location` flag
1561
- $location = global$1.location;
1562
- });
1563
-
1564
- var run = function (id) {
1565
- if (hasOwnProperty_1(queue$2, id)) {
1566
- var fn = queue$2[id];
1567
- delete queue$2[id];
1568
- fn();
1569
- }
1570
- };
1571
-
1572
- var runner = function (id) {
1573
- return function () {
1574
- run(id);
1575
- };
1576
- };
1577
-
1578
- var eventListener = function (event) {
1579
- run(event.data);
1580
- };
1581
-
1582
- var globalPostMessageDefer = function (id) {
1583
- // old engines have not location.origin
1584
- global$1.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1585
- };
1586
-
1587
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1588
- if (!set || !clear) {
1589
- set = function setImmediate(handler) {
1590
- validateArgumentsLength(arguments.length, 1);
1591
- var fn = isCallable(handler) ? handler : Function$2(handler);
1592
- var args = arraySlice(arguments, 1);
1593
- queue$2[++counter] = function () {
1594
- functionApply(fn, undefined, args);
1595
- };
1596
- defer(counter);
1597
- return counter;
1598
- };
1599
- clear = function clearImmediate(id) {
1600
- delete queue$2[id];
1601
- };
1602
- // Node.js 0.8-
1603
- if (engineIsNode) {
1604
- defer = function (id) {
1605
- process$2.nextTick(runner(id));
1606
- };
1607
- // Sphere (JS game engine) Dispatch API
1608
- } else if (Dispatch && Dispatch.now) {
1609
- defer = function (id) {
1610
- Dispatch.now(runner(id));
1611
- };
1612
- // Browsers with MessageChannel, includes WebWorkers
1613
- // except iOS - https://github.com/zloirock/core-js/issues/624
1614
- } else if (MessageChannel && !engineIsIos) {
1615
- channel = new MessageChannel();
1616
- port = channel.port2;
1617
- channel.port1.onmessage = eventListener;
1618
- defer = functionBindContext(port.postMessage, port);
1619
- // Browsers with postMessage, skip WebWorkers
1620
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1621
- } else if (
1622
- global$1.addEventListener &&
1623
- isCallable(global$1.postMessage) &&
1624
- !global$1.importScripts &&
1625
- $location && $location.protocol !== 'file:' &&
1626
- !fails(globalPostMessageDefer)
1627
- ) {
1628
- defer = globalPostMessageDefer;
1629
- global$1.addEventListener('message', eventListener, false);
1630
- // IE8-
1631
- } else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
1632
- defer = function (id) {
1633
- html.appendChild(documentCreateElement('script'))[ONREADYSTATECHANGE] = function () {
1634
- html.removeChild(this);
1635
- run(id);
1636
- };
1637
- };
1638
- // Rest old browsers
1639
- } else {
1640
- defer = function (id) {
1641
- setTimeout(runner(id), 0);
1642
- };
1643
- }
1644
- }
1645
-
1646
- var task$1 = {
1647
- set: set,
1648
- clear: clear
1649
- };
1650
-
1651
- var Queue = function () {
1652
- this.head = null;
1653
- this.tail = null;
1654
- };
1655
-
1656
- Queue.prototype = {
1657
- add: function (item) {
1658
- var entry = { item: item, next: null };
1659
- var tail = this.tail;
1660
- if (tail) tail.next = entry;
1661
- else this.head = entry;
1662
- this.tail = entry;
1663
- },
1664
- get: function () {
1665
- var entry = this.head;
1666
- if (entry) {
1667
- var next = this.head = entry.next;
1668
- if (next === null) this.tail = null;
1669
- return entry.item;
1670
- }
1671
- }
1672
- };
1673
-
1674
- var queue$1 = Queue;
1675
-
1676
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && typeof Pebble != 'undefined';
1677
-
1678
- var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
1679
-
1680
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1681
- var macrotask = task$1.set;
1682
-
1683
-
1684
-
1685
-
1686
-
1687
-
1688
- var MutationObserver = global$1.MutationObserver || global$1.WebKitMutationObserver;
1689
- var document$2 = global$1.document;
1690
- var process$1 = global$1.process;
1691
- var Promise$1 = global$1.Promise;
1692
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1693
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$1, 'queueMicrotask');
1694
- var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1695
- var notify$1, toggle, node, promise, then;
1696
-
1697
- // modern engines have queueMicrotask method
1698
- if (!microtask) {
1699
- var queue = new queue$1();
1700
-
1701
- var flush = function () {
1702
- var parent, fn;
1703
- if (engineIsNode && (parent = process$1.domain)) parent.exit();
1704
- while (fn = queue.get()) try {
1705
- fn();
1706
- } catch (error) {
1707
- if (queue.head) notify$1();
1708
- throw error;
1709
- }
1710
- if (parent) parent.enter();
1711
- };
1712
-
1713
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1714
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1715
- if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) {
1716
- toggle = true;
1717
- node = document$2.createTextNode('');
1718
- new MutationObserver(flush).observe(node, { characterData: true });
1719
- notify$1 = function () {
1720
- node.data = toggle = !toggle;
1721
- };
1722
- // environments with maybe non-completely correct, but existent Promise
1723
- } else if (!engineIsIosPebble && Promise$1 && Promise$1.resolve) {
1724
- // Promise.resolve without an argument throws an error in LG WebOS 2
1725
- promise = Promise$1.resolve(undefined);
1726
- // workaround of WebKit ~ iOS Safari 10.1 bug
1727
- promise.constructor = Promise$1;
1728
- then = functionBindContext(promise.then, promise);
1729
- notify$1 = function () {
1730
- then(flush);
1731
- };
1732
- // Node.js without promises
1733
- } else if (engineIsNode) {
1734
- notify$1 = function () {
1735
- process$1.nextTick(flush);
1736
- };
1737
- // for other environments - macrotask based on:
1738
- // - setImmediate
1739
- // - MessageChannel
1740
- // - window.postMessage
1741
- // - onreadystatechange
1742
- // - setTimeout
1743
- } else {
1744
- // `webpack` dev server bug on IE global methods - use bind(fn, global)
1745
- macrotask = functionBindContext(macrotask, global$1);
1746
- notify$1 = function () {
1747
- macrotask(flush);
1748
- };
1749
- }
1750
-
1751
- microtask = function (fn) {
1752
- if (!queue.head) notify$1();
1753
- queue.add(fn);
1754
- };
1755
- }
1756
-
1757
- var microtask_1 = microtask;
1758
-
1759
- var hostReportErrors = function (a, b) {
1760
- try {
1761
- // eslint-disable-next-line no-console -- safe
1762
- arguments.length === 1 ? console.error(a) : console.error(a, b);
1763
- } catch (error) { /* empty */ }
1764
- };
1765
-
1766
- var perform = function (exec) {
1767
- try {
1768
- return { error: false, value: exec() };
1769
- } catch (error) {
1770
- return { error: true, value: error };
1771
- }
1772
- };
1773
-
1774
- var promiseNativeConstructor = global$1.Promise;
1775
-
1776
- /* global Deno -- Deno case */
1777
- var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1778
-
1779
- var engineIsBrowser = !engineIsDeno && !engineIsNode
1780
- && typeof window == 'object'
1781
- && typeof document == 'object';
1782
-
1783
- promiseNativeConstructor && promiseNativeConstructor.prototype;
1784
- var SPECIES = wellKnownSymbol('species');
1785
- var SUBCLASSING = false;
1786
- var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable(global$1.PromiseRejectionEvent);
1787
-
1788
- var FORCED_PROMISE_CONSTRUCTOR$5 = isForced_1('Promise', function () {
1789
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(promiseNativeConstructor);
1790
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(promiseNativeConstructor);
1791
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1792
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1793
- // We can't detect it synchronously, so just check versions
1794
- if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
1795
- // We can't use @@species feature detection in V8 since it causes
1796
- // deoptimization and performance degradation
1797
- // https://github.com/zloirock/core-js/issues/679
1798
- if (!engineV8Version || engineV8Version < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1799
- // Detect correctness of subclassing with @@species support
1800
- var promise = new promiseNativeConstructor(function (resolve) { resolve(1); });
1801
- var FakePromise = function (exec) {
1802
- exec(function () { /* empty */ }, function () { /* empty */ });
1803
- };
1804
- var constructor = promise.constructor = {};
1805
- constructor[SPECIES] = FakePromise;
1806
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1807
- if (!SUBCLASSING) return true;
1808
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1809
- } return !GLOBAL_CORE_JS_PROMISE && (engineIsBrowser || engineIsDeno) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1810
- });
1811
-
1812
- var promiseConstructorDetection = {
1813
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1814
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1815
- SUBCLASSING: SUBCLASSING
1816
- };
1817
-
1818
- var $TypeError$2 = TypeError;
1819
-
1820
- var PromiseCapability = function (C) {
1821
- var resolve, reject;
1822
- this.promise = new C(function ($$resolve, $$reject) {
1823
- if (resolve !== undefined || reject !== undefined) throw new $TypeError$2('Bad Promise constructor');
1824
- resolve = $$resolve;
1825
- reject = $$reject;
1826
- });
1827
- this.resolve = aCallable(resolve);
1828
- this.reject = aCallable(reject);
1829
- };
1830
-
1831
- // `NewPromiseCapability` abstract operation
1832
- // https://tc39.es/ecma262/#sec-newpromisecapability
1833
- var f = function (C) {
1834
- return new PromiseCapability(C);
1835
- };
1836
-
1837
- var newPromiseCapability$1 = {
1838
- f: f
1839
- };
1840
-
1841
- var task = task$1.set;
1842
-
1843
-
1844
-
1845
-
1846
-
1847
-
1848
-
1849
-
1850
-
1851
- var PROMISE = 'Promise';
1852
- var FORCED_PROMISE_CONSTRUCTOR$4 = promiseConstructorDetection.CONSTRUCTOR;
1853
- var NATIVE_PROMISE_REJECTION_EVENT = promiseConstructorDetection.REJECTION_EVENT;
1854
- var NATIVE_PROMISE_SUBCLASSING = promiseConstructorDetection.SUBCLASSING;
1855
- var getInternalPromiseState = internalState.getterFor(PROMISE);
1856
- var setInternalState = internalState.set;
1857
- var NativePromisePrototype$1 = promiseNativeConstructor && promiseNativeConstructor.prototype;
1858
- var PromiseConstructor = promiseNativeConstructor;
1859
- var PromisePrototype = NativePromisePrototype$1;
1860
- var TypeError$1 = global$1.TypeError;
1861
- var document$1 = global$1.document;
1862
- var process = global$1.process;
1863
- var newPromiseCapability = newPromiseCapability$1.f;
1864
- var newGenericPromiseCapability = newPromiseCapability;
1865
-
1866
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
1867
- var UNHANDLED_REJECTION = 'unhandledrejection';
1868
- var REJECTION_HANDLED = 'rejectionhandled';
1869
- var PENDING = 0;
1870
- var FULFILLED = 1;
1871
- var REJECTED = 2;
1872
- var HANDLED = 1;
1873
- var UNHANDLED = 2;
1874
-
1875
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1876
-
1877
- // helpers
1878
- var isThenable = function (it) {
1879
- var then;
1880
- return isObject(it) && isCallable(then = it.then) ? then : false;
1881
- };
1882
-
1883
- var callReaction = function (reaction, state) {
1884
- var value = state.value;
1885
- var ok = state.state === FULFILLED;
1886
- var handler = ok ? reaction.ok : reaction.fail;
1887
- var resolve = reaction.resolve;
1888
- var reject = reaction.reject;
1889
- var domain = reaction.domain;
1890
- var result, then, exited;
1891
- try {
1892
- if (handler) {
1893
- if (!ok) {
1894
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1895
- state.rejection = HANDLED;
1896
- }
1897
- if (handler === true) result = value;
1898
- else {
1899
- if (domain) domain.enter();
1900
- result = handler(value); // can throw
1901
- if (domain) {
1902
- domain.exit();
1903
- exited = true;
1904
- }
1905
- }
1906
- if (result === reaction.promise) {
1907
- reject(new TypeError$1('Promise-chain cycle'));
1908
- } else if (then = isThenable(result)) {
1909
- functionCall(then, result, resolve, reject);
1910
- } else resolve(result);
1911
- } else reject(value);
1912
- } catch (error) {
1913
- if (domain && !exited) domain.exit();
1914
- reject(error);
1915
- }
1916
- };
1917
-
1918
- var notify = function (state, isReject) {
1919
- if (state.notified) return;
1920
- state.notified = true;
1921
- microtask_1(function () {
1922
- var reactions = state.reactions;
1923
- var reaction;
1924
- while (reaction = reactions.get()) {
1925
- callReaction(reaction, state);
1926
- }
1927
- state.notified = false;
1928
- if (isReject && !state.rejection) onUnhandled(state);
1929
- });
1930
- };
1931
-
1932
- var dispatchEvent = function (name, promise, reason) {
1933
- var event, handler;
1934
- if (DISPATCH_EVENT) {
1935
- event = document$1.createEvent('Event');
1936
- event.promise = promise;
1937
- event.reason = reason;
1938
- event.initEvent(name, false, true);
1939
- global$1.dispatchEvent(event);
1940
- } else event = { promise: promise, reason: reason };
1941
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
1942
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1943
- };
1944
-
1945
- var onUnhandled = function (state) {
1946
- functionCall(task, global$1, function () {
1947
- var promise = state.facade;
1948
- var value = state.value;
1949
- var IS_UNHANDLED = isUnhandled(state);
1950
- var result;
1951
- if (IS_UNHANDLED) {
1952
- result = perform(function () {
1953
- if (engineIsNode) {
1954
- process.emit('unhandledRejection', value, promise);
1955
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1956
- });
1957
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1958
- state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED;
1959
- if (result.error) throw result.value;
1960
- }
1961
- });
1962
- };
1963
-
1964
- var isUnhandled = function (state) {
1965
- return state.rejection !== HANDLED && !state.parent;
1966
- };
1967
-
1968
- var onHandleUnhandled = function (state) {
1969
- functionCall(task, global$1, function () {
1970
- var promise = state.facade;
1971
- if (engineIsNode) {
1972
- process.emit('rejectionHandled', promise);
1973
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1974
- });
1975
- };
1976
-
1977
- var bind = function (fn, state, unwrap) {
1978
- return function (value) {
1979
- fn(state, value, unwrap);
1980
- };
1981
- };
1982
-
1983
- var internalReject = function (state, value, unwrap) {
1984
- if (state.done) return;
1985
- state.done = true;
1986
- if (unwrap) state = unwrap;
1987
- state.value = value;
1988
- state.state = REJECTED;
1989
- notify(state, true);
1990
- };
1991
-
1992
- var internalResolve = function (state, value, unwrap) {
1993
- if (state.done) return;
1994
- state.done = true;
1995
- if (unwrap) state = unwrap;
1996
- try {
1997
- if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
1998
- var then = isThenable(value);
1999
- if (then) {
2000
- microtask_1(function () {
2001
- var wrapper = { done: false };
2002
- try {
2003
- functionCall(then, value,
2004
- bind(internalResolve, wrapper, state),
2005
- bind(internalReject, wrapper, state)
2006
- );
2007
- } catch (error) {
2008
- internalReject(wrapper, error, state);
2009
- }
2010
- });
2011
- } else {
2012
- state.value = value;
2013
- state.state = FULFILLED;
2014
- notify(state, false);
2015
- }
2016
- } catch (error) {
2017
- internalReject({ done: false }, error, state);
2018
- }
2019
- };
2020
-
2021
- // constructor polyfill
2022
- if (FORCED_PROMISE_CONSTRUCTOR$4) {
2023
- // 25.4.3.1 Promise(executor)
2024
- PromiseConstructor = function Promise(executor) {
2025
- anInstance(this, PromisePrototype);
2026
- aCallable(executor);
2027
- functionCall(Internal, this);
2028
- var state = getInternalPromiseState(this);
2029
- try {
2030
- executor(bind(internalResolve, state), bind(internalReject, state));
2031
- } catch (error) {
2032
- internalReject(state, error);
2033
- }
2034
- };
2035
-
2036
- PromisePrototype = PromiseConstructor.prototype;
2037
-
2038
- // eslint-disable-next-line no-unused-vars -- required for `.length`
2039
- Internal = function Promise(executor) {
2040
- setInternalState(this, {
2041
- type: PROMISE,
2042
- done: false,
2043
- notified: false,
2044
- parent: false,
2045
- reactions: new queue$1(),
2046
- rejection: false,
2047
- state: PENDING,
2048
- value: undefined
2049
- });
2050
- };
2051
-
2052
- // `Promise.prototype.then` method
2053
- // https://tc39.es/ecma262/#sec-promise.prototype.then
2054
- Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2055
- var state = getInternalPromiseState(this);
2056
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
2057
- state.parent = true;
2058
- reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
2059
- reaction.fail = isCallable(onRejected) && onRejected;
2060
- reaction.domain = engineIsNode ? process.domain : undefined;
2061
- if (state.state === PENDING) state.reactions.add(reaction);
2062
- else microtask_1(function () {
2063
- callReaction(reaction, state);
2064
- });
2065
- return reaction.promise;
2066
- });
2067
-
2068
- OwnPromiseCapability = function () {
2069
- var promise = new Internal();
2070
- var state = getInternalPromiseState(promise);
2071
- this.promise = promise;
2072
- this.resolve = bind(internalResolve, state);
2073
- this.reject = bind(internalReject, state);
2074
- };
2075
-
2076
- newPromiseCapability$1.f = newPromiseCapability = function (C) {
2077
- return C === PromiseConstructor || C === PromiseWrapper
2078
- ? new OwnPromiseCapability(C)
2079
- : newGenericPromiseCapability(C);
2080
- };
2081
-
2082
- if (isCallable(promiseNativeConstructor) && NativePromisePrototype$1 !== Object.prototype) {
2083
- nativeThen = NativePromisePrototype$1.then;
2084
-
2085
- if (!NATIVE_PROMISE_SUBCLASSING) {
2086
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2087
- defineBuiltIn(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2088
- var that = this;
2089
- return new PromiseConstructor(function (resolve, reject) {
2090
- functionCall(nativeThen, that, resolve, reject);
2091
- }).then(onFulfilled, onRejected);
2092
- // https://github.com/zloirock/core-js/issues/640
2093
- }, { unsafe: true });
2094
- }
2095
-
2096
- // make `.constructor === Promise` work for native promise-based APIs
2097
- try {
2098
- delete NativePromisePrototype$1.constructor;
2099
- } catch (error) { /* empty */ }
2100
-
2101
- // make `instanceof Promise` work for native promise-based APIs
2102
- if (objectSetPrototypeOf) {
2103
- objectSetPrototypeOf(NativePromisePrototype$1, PromisePrototype);
2104
- }
2105
- }
2106
- }
2107
-
2108
- _export({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2109
- Promise: PromiseConstructor
2110
- });
2111
-
2112
- setToStringTag(PromiseConstructor, PROMISE, false);
2113
- setSpecies(PROMISE);
2114
-
2115
- var iterators = {};
2116
-
2117
- var ITERATOR$2 = wellKnownSymbol('iterator');
2118
- var ArrayPrototype = Array.prototype;
2119
-
2120
- // check on default Array iterator
2121
- var isArrayIteratorMethod = function (it) {
2122
- return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
2123
- };
2124
-
2125
- var ITERATOR$1 = wellKnownSymbol('iterator');
2126
-
2127
- var getIteratorMethod = function (it) {
2128
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$1)
2129
- || getMethod(it, '@@iterator')
2130
- || iterators[classof(it)];
2131
- };
2132
-
2133
- var $TypeError$1 = TypeError;
2134
-
2135
- var getIterator = function (argument, usingIterator) {
2136
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
2137
- if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
2138
- throw new $TypeError$1(tryToString(argument) + ' is not iterable');
2139
- };
2140
-
2141
- var iteratorClose = function (iterator, kind, value) {
2142
- var innerResult, innerError;
2143
- anObject(iterator);
2144
- try {
2145
- innerResult = getMethod(iterator, 'return');
2146
- if (!innerResult) {
2147
- if (kind === 'throw') throw value;
2148
- return value;
2149
- }
2150
- innerResult = functionCall(innerResult, iterator);
2151
- } catch (error) {
2152
- innerError = true;
2153
- innerResult = error;
2154
- }
2155
- if (kind === 'throw') throw value;
2156
- if (innerError) throw innerResult;
2157
- anObject(innerResult);
2158
- return value;
2159
- };
2160
-
2161
- var $TypeError = TypeError;
2162
-
2163
- var Result = function (stopped, result) {
2164
- this.stopped = stopped;
2165
- this.result = result;
2166
- };
2167
-
2168
- var ResultPrototype = Result.prototype;
2169
-
2170
- var iterate = function (iterable, unboundFunction, options) {
2171
- var that = options && options.that;
2172
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2173
- var IS_RECORD = !!(options && options.IS_RECORD);
2174
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2175
- var INTERRUPTED = !!(options && options.INTERRUPTED);
2176
- var fn = functionBindContext(unboundFunction, that);
2177
- var iterator, iterFn, index, length, result, next, step;
2178
-
2179
- var stop = function (condition) {
2180
- if (iterator) iteratorClose(iterator, 'normal', condition);
2181
- return new Result(true, condition);
2182
- };
2183
-
2184
- var callFn = function (value) {
2185
- if (AS_ENTRIES) {
2186
- anObject(value);
2187
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2188
- } return INTERRUPTED ? fn(value, stop) : fn(value);
2189
- };
2190
-
2191
- if (IS_RECORD) {
2192
- iterator = iterable.iterator;
2193
- } else if (IS_ITERATOR) {
2194
- iterator = iterable;
2195
- } else {
2196
- iterFn = getIteratorMethod(iterable);
2197
- if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
2198
- // optimisation for array iterators
2199
- if (isArrayIteratorMethod(iterFn)) {
2200
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2201
- result = callFn(iterable[index]);
2202
- if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2203
- } return new Result(false);
2204
- }
2205
- iterator = getIterator(iterable, iterFn);
2206
- }
2207
-
2208
- next = IS_RECORD ? iterable.next : iterator.next;
2209
- while (!(step = functionCall(next, iterator)).done) {
2210
- try {
2211
- result = callFn(step.value);
2212
- } catch (error) {
2213
- iteratorClose(iterator, 'throw', error);
2214
- }
2215
- if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2216
- } return new Result(false);
2217
- };
2218
-
2219
- var ITERATOR = wellKnownSymbol('iterator');
2220
- var SAFE_CLOSING = false;
2221
-
2222
- try {
2223
- var called = 0;
2224
- var iteratorWithReturn = {
2225
- next: function () {
2226
- return { done: !!called++ };
2227
- },
2228
- 'return': function () {
2229
- SAFE_CLOSING = true;
2230
- }
2231
- };
2232
- iteratorWithReturn[ITERATOR] = function () {
2233
- return this;
2234
- };
2235
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2236
- Array.from(iteratorWithReturn, function () { throw 2; });
2237
- } catch (error) { /* empty */ }
2238
-
2239
- var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
2240
- try {
2241
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2242
- } catch (error) { return false; } // workaround of old WebKit + `eval` bug
2243
- var ITERATION_SUPPORT = false;
2244
- try {
2245
- var object = {};
2246
- object[ITERATOR] = function () {
2247
- return {
2248
- next: function () {
2249
- return { done: ITERATION_SUPPORT = true };
2250
- }
2251
- };
2252
- };
2253
- exec(object);
2254
- } catch (error) { /* empty */ }
2255
- return ITERATION_SUPPORT;
2256
- };
2257
-
2258
- var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2259
-
2260
- var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2261
- promiseNativeConstructor.all(iterable).then(undefined, function () { /* empty */ });
2262
- });
2263
-
2264
- // `Promise.all` method
2265
- // https://tc39.es/ecma262/#sec-promise.all
2266
- _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
2267
- all: function all(iterable) {
2268
- var C = this;
2269
- var capability = newPromiseCapability$1.f(C);
2270
- var resolve = capability.resolve;
2271
- var reject = capability.reject;
2272
- var result = perform(function () {
2273
- var $promiseResolve = aCallable(C.resolve);
2274
- var values = [];
2275
- var counter = 0;
2276
- var remaining = 1;
2277
- iterate(iterable, function (promise) {
2278
- var index = counter++;
2279
- var alreadyCalled = false;
2280
- remaining++;
2281
- functionCall($promiseResolve, C, promise).then(function (value) {
2282
- if (alreadyCalled) return;
2283
- alreadyCalled = true;
2284
- values[index] = value;
2285
- --remaining || resolve(values);
2286
- }, reject);
2287
- });
2288
- --remaining || resolve(values);
2289
- });
2290
- if (result.error) reject(result.value);
2291
- return capability.promise;
2292
- }
2293
- });
2294
-
2295
- var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2296
-
2297
-
2298
-
2299
-
2300
-
2301
- var NativePromisePrototype = promiseNativeConstructor && promiseNativeConstructor.prototype;
2302
-
2303
- // `Promise.prototype.catch` method
2304
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
2305
- _export({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2306
- 'catch': function (onRejected) {
2307
- return this.then(undefined, onRejected);
2308
- }
2309
- });
2310
-
2311
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2312
- if (isCallable(promiseNativeConstructor)) {
2313
- var method = getBuiltIn('Promise').prototype['catch'];
2314
- if (NativePromisePrototype['catch'] !== method) {
2315
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2316
- }
2317
- }
2318
-
2319
- // `Promise.race` method
2320
- // https://tc39.es/ecma262/#sec-promise.race
2321
- _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
2322
- race: function race(iterable) {
2323
- var C = this;
2324
- var capability = newPromiseCapability$1.f(C);
2325
- var reject = capability.reject;
2326
- var result = perform(function () {
2327
- var $promiseResolve = aCallable(C.resolve);
2328
- iterate(iterable, function (promise) {
2329
- functionCall($promiseResolve, C, promise).then(capability.resolve, reject);
2330
- });
2331
- });
2332
- if (result.error) reject(result.value);
2333
- return capability.promise;
2334
- }
2335
- });
2336
-
2337
- var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2338
-
2339
- // `Promise.reject` method
2340
- // https://tc39.es/ecma262/#sec-promise.reject
2341
- _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2342
- reject: function reject(r) {
2343
- var capability = newPromiseCapability$1.f(this);
2344
- functionCall(capability.reject, undefined, r);
2345
- return capability.promise;
2346
- }
2347
- });
2348
-
2349
- var promiseResolve = function (C, x) {
2350
- anObject(C);
2351
- if (isObject(x) && x.constructor === C) return x;
2352
- var promiseCapability = newPromiseCapability$1.f(C);
2353
- var resolve = promiseCapability.resolve;
2354
- resolve(x);
2355
- return promiseCapability.promise;
2356
- };
2357
-
2358
- var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2359
-
2360
-
2361
- getBuiltIn('Promise');
2362
-
2363
- // `Promise.resolve` method
2364
- // https://tc39.es/ecma262/#sec-promise.resolve
2365
- _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2366
- resolve: function resolve(x) {
2367
- return promiseResolve(this, x);
2368
- }
2369
- });
2370
-
2371
- // iterable DOM collections
2372
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2373
- var domIterables = {
2374
- CSSRuleList: 0,
2375
- CSSStyleDeclaration: 0,
2376
- CSSValueList: 0,
2377
- ClientRectList: 0,
2378
- DOMRectList: 0,
2379
- DOMStringList: 0,
2380
- DOMTokenList: 1,
2381
- DataTransferItemList: 0,
2382
- FileList: 0,
2383
- HTMLAllCollection: 0,
2384
- HTMLCollection: 0,
2385
- HTMLFormElement: 0,
2386
- HTMLSelectElement: 0,
2387
- MediaList: 0,
2388
- MimeTypeArray: 0,
2389
- NamedNodeMap: 0,
2390
- NodeList: 1,
2391
- PaintRequestList: 0,
2392
- Plugin: 0,
2393
- PluginArray: 0,
2394
- SVGLengthList: 0,
2395
- SVGNumberList: 0,
2396
- SVGPathSegList: 0,
2397
- SVGPointList: 0,
2398
- SVGStringList: 0,
2399
- SVGTransformList: 0,
2400
- SourceBufferList: 0,
2401
- StyleSheetList: 0,
2402
- TextTrackCueList: 0,
2403
- TextTrackList: 0,
2404
- TouchList: 0
2405
- };
2406
-
2407
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2408
-
2409
-
2410
- var classList = documentCreateElement('span').classList;
2411
- var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
2412
-
2413
- var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
2414
-
2415
- var handlePrototype = function (CollectionPrototype) {
2416
- // some Chrome versions have non-configurable methods on DOMTokenList
2417
- if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2418
- createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
2419
- } catch (error) {
2420
- CollectionPrototype.forEach = arrayForEach;
2421
- }
2422
- };
2423
-
2424
- for (var COLLECTION_NAME in domIterables) {
2425
- if (domIterables[COLLECTION_NAME]) {
2426
- handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype);
2427
- }
2428
- }
2429
-
2430
- handlePrototype(domTokenListPrototype);
2431
-
2432
- /* global Bun -- Bun case */
2433
- var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
2434
-
2435
- var Function$1 = global$1.Function;
2436
- // dirty IE9- and Bun 0.3.0- checks
2437
- var WRAP = /MSIE .\./.test(engineUserAgent) || engineIsBun && (function () {
2438
- var version = global$1.Bun.version.split('.');
2439
- return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
2440
- })();
2441
-
2442
- // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
2443
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
2444
- // https://github.com/oven-sh/bun/issues/1633
2445
- var schedulersFix = function (scheduler, hasTimeArg) {
2446
- var firstParamIndex = hasTimeArg ? 2 : 1;
2447
- return WRAP ? function (handler, timeout /* , ...arguments */) {
2448
- var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
2449
- var fn = isCallable(handler) ? handler : Function$1(handler);
2450
- var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
2451
- var callback = boundArgs ? function () {
2452
- functionApply(fn, this, params);
2453
- } : fn;
2454
- return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
2455
- } : scheduler;
2456
- };
2457
-
2458
- var setInterval$1 = schedulersFix(global$1.setInterval, true);
2459
-
2460
- // Bun / IE9- setInterval additional parameters fix
2461
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
2462
- _export({ global: true, bind: true, forced: global$1.setInterval !== setInterval$1 }, {
2463
- setInterval: setInterval$1
2464
- });
2465
-
2466
- var setTimeout$1 = schedulersFix(global$1.setTimeout, true);
2467
-
2468
- // Bun / IE9- setTimeout additional parameters fix
2469
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
2470
- _export({ global: true, bind: true, forced: global$1.setTimeout !== setTimeout$1 }, {
2471
- setTimeout: setTimeout$1
2472
- });
2473
-
2474
- var _typeof_1 = createCommonjsModule(function (module) {
2475
- function _typeof(o) {
2476
- "@babel/helpers - typeof";
2477
-
2478
- return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
2479
- return typeof o;
2480
- } : function (o) {
2481
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2482
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
2483
- }
2484
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2485
- });
2486
-
2487
- var regeneratorRuntime$1 = createCommonjsModule(function (module) {
2488
- var _typeof = _typeof_1["default"];
2489
- function _regeneratorRuntime() {
2490
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2491
- return e;
2492
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
2493
- var t,
2494
- e = {},
2495
- r = Object.prototype,
2496
- n = r.hasOwnProperty,
2497
- o = Object.defineProperty || function (t, e, r) {
2498
- t[e] = r.value;
2499
- },
2500
- i = "function" == typeof Symbol ? Symbol : {},
2501
- a = i.iterator || "@@iterator",
2502
- c = i.asyncIterator || "@@asyncIterator",
2503
- u = i.toStringTag || "@@toStringTag";
2504
- function define(t, e, r) {
2505
- return Object.defineProperty(t, e, {
2506
- value: r,
2507
- enumerable: !0,
2508
- configurable: !0,
2509
- writable: !0
2510
- }), t[e];
2511
- }
2512
- try {
2513
- define({}, "");
2514
- } catch (t) {
2515
- define = function define(t, e, r) {
2516
- return t[e] = r;
2517
- };
2518
- }
2519
- function wrap(t, e, r, n) {
2520
- var i = e && e.prototype instanceof Generator ? e : Generator,
2521
- a = Object.create(i.prototype),
2522
- c = new Context(n || []);
2523
- return o(a, "_invoke", {
2524
- value: makeInvokeMethod(t, r, c)
2525
- }), a;
2526
- }
2527
- function tryCatch(t, e, r) {
2528
- try {
2529
- return {
2530
- type: "normal",
2531
- arg: t.call(e, r)
2532
- };
2533
- } catch (t) {
2534
- return {
2535
- type: "throw",
2536
- arg: t
2537
- };
2538
- }
2539
- }
2540
- e.wrap = wrap;
2541
- var h = "suspendedStart",
2542
- l = "suspendedYield",
2543
- f = "executing",
2544
- s = "completed",
2545
- y = {};
2546
- function Generator() {}
2547
- function GeneratorFunction() {}
2548
- function GeneratorFunctionPrototype() {}
2549
- var p = {};
2550
- define(p, a, function () {
2551
- return this;
2552
- });
2553
- var d = Object.getPrototypeOf,
2554
- v = d && d(d(values([])));
2555
- v && v !== r && n.call(v, a) && (p = v);
2556
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
2557
- function defineIteratorMethods(t) {
2558
- ["next", "throw", "return"].forEach(function (e) {
2559
- define(t, e, function (t) {
2560
- return this._invoke(e, t);
2561
- });
2562
- });
2563
- }
2564
- function AsyncIterator(t, e) {
2565
- function invoke(r, o, i, a) {
2566
- var c = tryCatch(t[r], t, o);
2567
- if ("throw" !== c.type) {
2568
- var u = c.arg,
2569
- h = u.value;
2570
- return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
2571
- invoke("next", t, i, a);
2572
- }, function (t) {
2573
- invoke("throw", t, i, a);
2574
- }) : e.resolve(h).then(function (t) {
2575
- u.value = t, i(u);
2576
- }, function (t) {
2577
- return invoke("throw", t, i, a);
2578
- });
2579
- }
2580
- a(c.arg);
2581
- }
2582
- var r;
2583
- o(this, "_invoke", {
2584
- value: function value(t, n) {
2585
- function callInvokeWithMethodAndArg() {
2586
- return new e(function (e, r) {
2587
- invoke(t, n, e, r);
2588
- });
2589
- }
2590
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
2591
- }
2592
- });
2593
- }
2594
- function makeInvokeMethod(e, r, n) {
2595
- var o = h;
2596
- return function (i, a) {
2597
- if (o === f) throw Error("Generator is already running");
2598
- if (o === s) {
2599
- if ("throw" === i) throw a;
2600
- return {
2601
- value: t,
2602
- done: !0
2603
- };
2604
- }
2605
- for (n.method = i, n.arg = a;;) {
2606
- var c = n.delegate;
2607
- if (c) {
2608
- var u = maybeInvokeDelegate(c, n);
2609
- if (u) {
2610
- if (u === y) continue;
2611
- return u;
2612
- }
2613
- }
2614
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
2615
- if (o === h) throw o = s, n.arg;
2616
- n.dispatchException(n.arg);
2617
- } else "return" === n.method && n.abrupt("return", n.arg);
2618
- o = f;
2619
- var p = tryCatch(e, r, n);
2620
- if ("normal" === p.type) {
2621
- if (o = n.done ? s : l, p.arg === y) continue;
2622
- return {
2623
- value: p.arg,
2624
- done: n.done
2625
- };
2626
- }
2627
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
2628
- }
2629
- };
2630
- }
2631
- function maybeInvokeDelegate(e, r) {
2632
- var n = r.method,
2633
- o = e.iterator[n];
2634
- if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
2635
- var i = tryCatch(o, e.iterator, r.arg);
2636
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
2637
- var a = i.arg;
2638
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
2639
- }
2640
- function pushTryEntry(t) {
2641
- var e = {
2642
- tryLoc: t[0]
2643
- };
2644
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
2645
- }
2646
- function resetTryEntry(t) {
2647
- var e = t.completion || {};
2648
- e.type = "normal", delete e.arg, t.completion = e;
2649
- }
2650
- function Context(t) {
2651
- this.tryEntries = [{
2652
- tryLoc: "root"
2653
- }], t.forEach(pushTryEntry, this), this.reset(!0);
2654
- }
2655
- function values(e) {
2656
- if (e || "" === e) {
2657
- var r = e[a];
2658
- if (r) return r.call(e);
2659
- if ("function" == typeof e.next) return e;
2660
- if (!isNaN(e.length)) {
2661
- var o = -1,
2662
- i = function next() {
2663
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
2664
- return next.value = t, next.done = !0, next;
2665
- };
2666
- return i.next = i;
2667
- }
2668
- }
2669
- throw new TypeError(_typeof(e) + " is not iterable");
2670
- }
2671
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
2672
- value: GeneratorFunctionPrototype,
2673
- configurable: !0
2674
- }), o(GeneratorFunctionPrototype, "constructor", {
2675
- value: GeneratorFunction,
2676
- configurable: !0
2677
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
2678
- var e = "function" == typeof t && t.constructor;
2679
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
2680
- }, e.mark = function (t) {
2681
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
2682
- }, e.awrap = function (t) {
2683
- return {
2684
- __await: t
2685
- };
2686
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
2687
- return this;
2688
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
2689
- void 0 === i && (i = Promise);
2690
- var a = new AsyncIterator(wrap(t, r, n, o), i);
2691
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
2692
- return t.done ? t.value : a.next();
2693
- });
2694
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
2695
- return this;
2696
- }), define(g, "toString", function () {
2697
- return "[object Generator]";
2698
- }), e.keys = function (t) {
2699
- var e = Object(t),
2700
- r = [];
2701
- for (var n in e) r.push(n);
2702
- return r.reverse(), function next() {
2703
- for (; r.length;) {
2704
- var t = r.pop();
2705
- if (t in e) return next.value = t, next.done = !1, next;
2706
- }
2707
- return next.done = !0, next;
2708
- };
2709
- }, e.values = values, Context.prototype = {
2710
- constructor: Context,
2711
- reset: function reset(e) {
2712
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
2713
- },
2714
- stop: function stop() {
2715
- this.done = !0;
2716
- var t = this.tryEntries[0].completion;
2717
- if ("throw" === t.type) throw t.arg;
2718
- return this.rval;
2719
- },
2720
- dispatchException: function dispatchException(e) {
2721
- if (this.done) throw e;
2722
- var r = this;
2723
- function handle(n, o) {
2724
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
2725
- }
2726
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
2727
- var i = this.tryEntries[o],
2728
- a = i.completion;
2729
- if ("root" === i.tryLoc) return handle("end");
2730
- if (i.tryLoc <= this.prev) {
2731
- var c = n.call(i, "catchLoc"),
2732
- u = n.call(i, "finallyLoc");
2733
- if (c && u) {
2734
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
2735
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
2736
- } else if (c) {
2737
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
2738
- } else {
2739
- if (!u) throw Error("try statement without catch or finally");
2740
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
2741
- }
2742
- }
2743
- }
2744
- },
2745
- abrupt: function abrupt(t, e) {
2746
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
2747
- var o = this.tryEntries[r];
2748
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
2749
- var i = o;
2750
- break;
2751
- }
2752
- }
2753
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
2754
- var a = i ? i.completion : {};
2755
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
2756
- },
2757
- complete: function complete(t, e) {
2758
- if ("throw" === t.type) throw t.arg;
2759
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
2760
- },
2761
- finish: function finish(t) {
2762
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2763
- var r = this.tryEntries[e];
2764
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
2765
- }
2766
- },
2767
- "catch": function _catch(t) {
2768
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2769
- var r = this.tryEntries[e];
2770
- if (r.tryLoc === t) {
2771
- var n = r.completion;
2772
- if ("throw" === n.type) {
2773
- var o = n.arg;
2774
- resetTryEntry(r);
2775
- }
2776
- return o;
2777
- }
2778
- }
2779
- throw Error("illegal catch attempt");
2780
- },
2781
- delegateYield: function delegateYield(e, r, n) {
2782
- return this.delegate = {
2783
- iterator: values(e),
2784
- resultName: r,
2785
- nextLoc: n
2786
- }, "next" === this.method && (this.arg = t), y;
2787
- }
2788
- }, e;
2789
- }
2790
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2791
- });
2792
-
2793
- // TODO(Babel 8): Remove this file.
2794
-
2795
- var runtime = regeneratorRuntime$1();
2796
- var regenerator = runtime;
2797
-
2798
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2799
- try {
2800
- regeneratorRuntime = runtime;
2801
- } catch (accidentalStrictMode) {
2802
- if (typeof globalThis === "object") {
2803
- globalThis.regeneratorRuntime = runtime;
2804
- } else {
2805
- Function("r", "regeneratorRuntime = r")(runtime);
2806
- }
2807
- }
2808
-
2809
- // https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js
2810
-
2811
- var ws = null;
2812
-
2813
- if (typeof WebSocket !== 'undefined') {
2814
- ws = WebSocket;
2815
- } else if (typeof MozWebSocket !== 'undefined') {
2816
- ws = MozWebSocket;
2817
- } else if (typeof commonjsGlobal !== 'undefined') {
2818
- ws = commonjsGlobal.WebSocket || commonjsGlobal.MozWebSocket;
2819
- } else if (typeof window !== 'undefined') {
2820
- ws = window.WebSocket || window.MozWebSocket;
2821
- } else if (typeof self !== 'undefined') {
2822
- ws = self.WebSocket || self.MozWebSocket;
2823
- }
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
2824
8
 
2825
- var browser = ws;
9
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
10
+ var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
11
+ var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
12
+ var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
13
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
14
+ var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
15
+ var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket);
2826
16
 
2827
17
  var _excluded = ["baseRequestId"];
2828
18
  var WebSocketTransportResult = /*#__PURE__*/function () {
2829
19
  function WebSocketTransportResult(_ref) {
2830
20
  var status = _ref.status,
2831
21
  message = _ref.message;
2832
- _classCallCheck(this, WebSocketTransportResult);
2833
- _defineProperty(this, "status", void 0);
2834
- _defineProperty(this, "result", void 0);
22
+ _classCallCheck__default['default'](this, WebSocketTransportResult);
23
+ _defineProperty__default['default'](this, "status", void 0);
24
+ _defineProperty__default['default'](this, "result", void 0);
2835
25
  this.status = status;
2836
26
  this.result = message;
2837
27
  }
2838
- return _createClass(WebSocketTransportResult, [{
28
+ return _createClass__default['default'](WebSocketTransportResult, [{
2839
29
  key: "json",
2840
30
  value: function () {
2841
- var _json = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee() {
2842
- return regenerator.wrap(function _callee$(_context) {
31
+ var _json = _asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
32
+ return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
2843
33
  while (1) switch (_context.prev = _context.next) {
2844
34
  case 0:
2845
35
  return _context.abrupt("return", this.result);
@@ -2863,8 +53,8 @@
2863
53
  }, {
2864
54
  key: "text",
2865
55
  value: function () {
2866
- var _text = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee2() {
2867
- return regenerator.wrap(function _callee2$(_context2) {
56
+ var _text = _asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
57
+ return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
2868
58
  while (1) switch (_context2.prev = _context2.next) {
2869
59
  case 0:
2870
60
  return _context2.abrupt("return", typeof this.result === 'string' ? this.result : JSON.stringify(this.result));
@@ -2887,14 +77,14 @@
2887
77
  apiUrl = _ref2.apiUrl,
2888
78
  heartBeatInterval = _ref2.heartBeatInterval,
2889
79
  hearBeatInterval = _ref2.hearBeatInterval;
2890
- _classCallCheck(this, WebSocketTransport);
2891
- _defineProperty(this, "apiUrl", void 0);
2892
- _defineProperty(this, "heartBeatInterval", 60);
2893
- _defineProperty(this, "token", void 0);
2894
- _defineProperty(this, "ws", null);
2895
- _defineProperty(this, "messageCounter", 1);
2896
- _defineProperty(this, "messageIdToSubscription", {});
2897
- _defineProperty(this, "messageQueue", []);
80
+ _classCallCheck__default['default'](this, WebSocketTransport);
81
+ _defineProperty__default['default'](this, "apiUrl", void 0);
82
+ _defineProperty__default['default'](this, "heartBeatInterval", 60);
83
+ _defineProperty__default['default'](this, "token", void 0);
84
+ _defineProperty__default['default'](this, "ws", null);
85
+ _defineProperty__default['default'](this, "messageCounter", 1);
86
+ _defineProperty__default['default'](this, "messageIdToSubscription", {});
87
+ _defineProperty__default['default'](this, "messageQueue", []);
2898
88
  this.token = authorization;
2899
89
  this.apiUrl = apiUrl;
2900
90
  if (heartBeatInterval) {
@@ -2904,7 +94,7 @@
2904
94
  this.heartBeatInterval = hearBeatInterval;
2905
95
  }
2906
96
  }
2907
- return _createClass(WebSocketTransport, [{
97
+ return _createClass__default['default'](WebSocketTransport, [{
2908
98
  key: "authorization",
2909
99
  get: function get() {
2910
100
  return this.token;
@@ -2918,8 +108,8 @@
2918
108
  }, {
2919
109
  key: "close",
2920
110
  value: function () {
2921
- var _close = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee3() {
2922
- return regenerator.wrap(function _callee3$(_context3) {
111
+ var _close = _asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
112
+ return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
2923
113
  while (1) switch (_context3.prev = _context3.next) {
2924
114
  case 0:
2925
115
  if (this.ws) {
@@ -2945,7 +135,7 @@
2945
135
  if (this.ws) {
2946
136
  return this.ws.initPromise;
2947
137
  }
2948
- var ws = new browser(this.apiUrl);
138
+ var ws = new WebSocket__default['default'](this.apiUrl);
2949
139
  ws.messageIdSent = {};
2950
140
  ws.sendMessage = function (message) {
2951
141
  if (!message.messageId || message.messageId && !ws.messageIdSent[message.messageId]) {
@@ -2993,7 +183,7 @@
2993
183
  ws.sendQueue();
2994
184
  };
2995
185
  ws.onclose = function () {
2996
- if (ws && ws.readyState !== browser.CLOSED && ws.readyState !== browser.CLOSING) {
186
+ if (ws && ws.readyState !== WebSocket__default['default'].CLOSED && ws.readyState !== WebSocket__default['default'].CLOSING) {
2997
187
  ws.close();
2998
188
  }
2999
189
  if (ws.reconcileTimer) {
@@ -3025,8 +215,8 @@
3025
215
  } else {
3026
216
  this.messageQueue.push(message);
3027
217
  }
3028
- setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee4() {
3029
- return regenerator.wrap(function _callee4$(_context4) {
218
+ setTimeout(/*#__PURE__*/_asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
219
+ return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3030
220
  while (1) switch (_context4.prev = _context4.next) {
3031
221
  case 0:
3032
222
  _context4.next = 2;
@@ -3044,7 +234,7 @@
3044
234
  key: "request",
3045
235
  value: function request(method, _ref4) {
3046
236
  var baseRequestId = _ref4.baseRequestId,
3047
- params = _objectWithoutProperties(_ref4, _excluded);
237
+ params = _objectWithoutProperties__default['default'](_ref4, _excluded);
3048
238
  var message = {
3049
239
  messageId: this.messageCounter++,
3050
240
  requestId: baseRequestId,
@@ -3070,9 +260,9 @@
3070
260
  return {
3071
261
  subscribe: function subscribe(callback) {
3072
262
  var _this3 = this;
3073
- return _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee5() {
263
+ return _asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
3074
264
  var result;
3075
- return regenerator.wrap(function _callee5$(_context5) {
265
+ return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3076
266
  while (1) switch (_context5.prev = _context5.next) {
3077
267
  case 0:
3078
268
  transport.sendMessage(message);
@@ -3096,8 +286,8 @@
3096
286
  }))();
3097
287
  },
3098
288
  unsubscribe: function unsubscribe() {
3099
- return _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee6() {
3100
- return regenerator.wrap(function _callee6$(_context6) {
289
+ return _asyncToGenerator__default['default'](/*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
290
+ return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3101
291
  while (1) switch (_context6.prev = _context6.next) {
3102
292
  case 0:
3103
293
  transport.sendMessage({