@shipengine/elements 0.1.14

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