@cubejs-client/react 0.36.2 → 0.36.4

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.
@@ -60,15 +60,15 @@
60
60
 
61
61
  var $propertyIsEnumerable$2 = {}.propertyIsEnumerable;
62
62
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
63
- var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
63
+ var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor;
64
64
 
65
65
  // Nashorn ~ JDK8 bug
66
- var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$2.call({ 1: 2 }, 1);
66
+ var NASHORN_BUG = getOwnPropertyDescriptor$6 && !$propertyIsEnumerable$2.call({ 1: 2 }, 1);
67
67
 
68
68
  // `Object.prototype.propertyIsEnumerable` method implementation
69
69
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
70
70
  var f$8 = NASHORN_BUG ? function propertyIsEnumerable(V) {
71
- var descriptor = getOwnPropertyDescriptor$5(this, V);
71
+ var descriptor = getOwnPropertyDescriptor$6(this, V);
72
72
  return !!descriptor && descriptor.enumerable;
73
73
  } : $propertyIsEnumerable$2;
74
74
 
@@ -333,14 +333,14 @@
333
333
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
334
334
  };
335
335
 
336
- var Symbol$2 = global$1.Symbol;
336
+ var Symbol$3 = global$1.Symbol;
337
337
  var WellKnownSymbolsStore$1 = shared('wks');
338
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$2['for'] || Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
338
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid;
339
339
 
340
340
  var wellKnownSymbol = function (name) {
341
341
  if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name)) {
342
- WellKnownSymbolsStore$1[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$2, name)
343
- ? Symbol$2[name]
342
+ WellKnownSymbolsStore$1[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$3, name)
343
+ ? Symbol$3[name]
344
344
  : createWellKnownSymbol('Symbol.' + name);
345
345
  } return WellKnownSymbolsStore$1[name];
346
346
  };
@@ -672,23 +672,23 @@
672
672
  return number !== number || number === 0 ? 0 : mathTrunc(number);
673
673
  };
674
674
 
675
- var max$3 = Math.max;
676
- var min$4 = Math.min;
675
+ var max$4 = Math.max;
676
+ var min$5 = Math.min;
677
677
 
678
678
  // Helper for a popular repeating case of the spec:
679
679
  // Let integer be ? ToInteger(index).
680
680
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
681
681
  var toAbsoluteIndex = function (index, length) {
682
682
  var integer = toIntegerOrInfinity(index);
683
- return integer < 0 ? max$3(integer + length, 0) : min$4(integer, length);
683
+ return integer < 0 ? max$4(integer + length, 0) : min$5(integer, length);
684
684
  };
685
685
 
686
- var min$3 = Math.min;
686
+ var min$4 = Math.min;
687
687
 
688
688
  // `ToLength` abstract operation
689
689
  // https://tc39.es/ecma262/#sec-tolength
690
690
  var toLength = function (argument) {
691
- return argument > 0 ? min$3(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
691
+ return argument > 0 ? min$4(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
692
692
  };
693
693
 
694
694
  // `LengthOfArrayLike` abstract operation
@@ -816,7 +816,7 @@
816
816
 
817
817
  var isForced_1 = isForced;
818
818
 
819
- var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
819
+ var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f;
820
820
 
821
821
 
822
822
 
@@ -853,7 +853,7 @@
853
853
  if (target) for (key in source) {
854
854
  sourceProperty = source[key];
855
855
  if (options.dontCallGetSet) {
856
- descriptor = getOwnPropertyDescriptor$4(target, key);
856
+ descriptor = getOwnPropertyDescriptor$5(target, key);
857
857
  targetProperty = descriptor && descriptor.value;
858
858
  } else targetProperty = target[key];
859
859
  FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
@@ -946,7 +946,7 @@
946
946
  var empty = [];
947
947
  var construct = getBuiltIn('Reflect', 'construct');
948
948
  var constructorRegExp = /^\s*(?:class|function)\b/;
949
- var exec$2 = functionUncurryThis(constructorRegExp.exec);
949
+ var exec$3 = functionUncurryThis(constructorRegExp.exec);
950
950
  var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
951
951
 
952
952
  var isConstructorModern = function isConstructor(argument) {
@@ -970,7 +970,7 @@
970
970
  // we can't check .prototype since constructors produced by .bind haven't it
971
971
  // `Function#toString` throws on some built-it function in some legacy engines
972
972
  // (for example, `DOMQuad` and similar in FF41-)
973
- return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource(argument));
973
+ return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
974
974
  } catch (error) {
975
975
  return true;
976
976
  }
@@ -1124,9 +1124,9 @@
1124
1124
  nativeConstruct(function () { /* empty */ });
1125
1125
  });
1126
1126
 
1127
- var FORCED$9 = NEW_TARGET_BUG || ARGS_BUG;
1127
+ var FORCED$a = NEW_TARGET_BUG || ARGS_BUG;
1128
1128
 
1129
- _export({ target: 'Reflect', stat: true, forced: FORCED$9, sham: FORCED$9 }, {
1129
+ _export({ target: 'Reflect', stat: true, forced: FORCED$a, sham: FORCED$a }, {
1130
1130
  construct: function construct(Target, args /* , newTarget */) {
1131
1131
  aConstructor(Target);
1132
1132
  anObject(args);
@@ -1177,14 +1177,14 @@
1177
1177
  else object[propertyKey] = value;
1178
1178
  };
1179
1179
 
1180
- var $Array$2 = Array;
1181
- var max$2 = Math.max;
1180
+ var $Array$3 = Array;
1181
+ var max$3 = Math.max;
1182
1182
 
1183
1183
  var arraySliceSimple = function (O, start, end) {
1184
1184
  var length = lengthOfArrayLike(O);
1185
1185
  var k = toAbsoluteIndex(start, length);
1186
1186
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
1187
- var result = $Array$2(max$2(fin - k, 0));
1187
+ var result = $Array$3(max$3(fin - k, 0));
1188
1188
  var n = 0;
1189
1189
  for (; k < fin; k++, n++) createProperty(result, n, O[k]);
1190
1190
  result.length = n;
@@ -1295,8 +1295,8 @@
1295
1295
  return classofRaw(argument) === 'Array';
1296
1296
  };
1297
1297
 
1298
- var SPECIES$5 = wellKnownSymbol('species');
1299
- var $Array$1 = Array;
1298
+ var SPECIES$6 = wellKnownSymbol('species');
1299
+ var $Array$2 = Array;
1300
1300
 
1301
1301
  // a part of `ArraySpeciesCreate` abstract operation
1302
1302
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
@@ -1305,12 +1305,12 @@
1305
1305
  if (isArray(originalArray)) {
1306
1306
  C = originalArray.constructor;
1307
1307
  // cross-realm fallback
1308
- if (isConstructor(C) && (C === $Array$1 || isArray(C.prototype))) C = undefined;
1308
+ if (isConstructor(C) && (C === $Array$2 || isArray(C.prototype))) C = undefined;
1309
1309
  else if (isObject(C)) {
1310
- C = C[SPECIES$5];
1310
+ C = C[SPECIES$6];
1311
1311
  if (C === null) C = undefined;
1312
1312
  }
1313
- } return C === undefined ? $Array$1 : C;
1313
+ } return C === undefined ? $Array$2 : C;
1314
1314
  };
1315
1315
 
1316
1316
  // `ArraySpeciesCreate` abstract operation
@@ -1669,7 +1669,7 @@
1669
1669
 
1670
1670
  var $String$1 = String;
1671
1671
  var $stringify = getBuiltIn('JSON', 'stringify');
1672
- var exec$1 = functionUncurryThis(/./.exec);
1672
+ var exec$2 = functionUncurryThis(/./.exec);
1673
1673
  var charAt$7 = functionUncurryThis(''.charAt);
1674
1674
  var charCodeAt$2 = functionUncurryThis(''.charCodeAt);
1675
1675
  var replace$4 = functionUncurryThis(''.replace);
@@ -1710,7 +1710,7 @@
1710
1710
  var fixIllFormed = function (match, offset, string) {
1711
1711
  var prev = charAt$7(string, offset - 1);
1712
1712
  var next = charAt$7(string, offset + 1);
1713
- if ((exec$1(low, match) && !exec$1(hi, next)) || (exec$1(hi, match) && !exec$1(low, prev))) {
1713
+ if ((exec$2(low, match) && !exec$2(hi, next)) || (exec$2(hi, match) && !exec$2(low, prev))) {
1714
1714
  return '\\u' + numberToString(charCodeAt$2(match, 0), 16);
1715
1715
  } return match;
1716
1716
  };
@@ -1730,18 +1730,18 @@
1730
1730
 
1731
1731
  // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
1732
1732
  // https://bugs.chromium.org/p/v8/issues/detail?id=3443
1733
- var FORCED$8 = !symbolConstructorDetection || fails(function () { objectGetOwnPropertySymbols.f(1); });
1733
+ var FORCED$9 = !symbolConstructorDetection || fails(function () { objectGetOwnPropertySymbols.f(1); });
1734
1734
 
1735
1735
  // `Object.getOwnPropertySymbols` method
1736
1736
  // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
1737
- _export({ target: 'Object', stat: true, forced: FORCED$8 }, {
1737
+ _export({ target: 'Object', stat: true, forced: FORCED$9 }, {
1738
1738
  getOwnPropertySymbols: function getOwnPropertySymbols(it) {
1739
1739
  var $getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1740
1740
  return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
1741
1741
  }
1742
1742
  });
1743
1743
 
1744
- var SPECIES$4 = wellKnownSymbol('species');
1744
+ var SPECIES$5 = wellKnownSymbol('species');
1745
1745
 
1746
1746
  var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1747
1747
  // We can't use this feature detection in V8 since it causes
@@ -1750,7 +1750,7 @@
1750
1750
  return engineV8Version >= 51 || !fails(function () {
1751
1751
  var array = [];
1752
1752
  var constructor = array.constructor = {};
1753
- constructor[SPECIES$4] = function () {
1753
+ constructor[SPECIES$5] = function () {
1754
1754
  return { foo: 1 };
1755
1755
  };
1756
1756
  return array[METHOD_NAME](Boolean).foo !== 1;
@@ -1760,12 +1760,12 @@
1760
1760
  var $filter = arrayIteration.filter;
1761
1761
 
1762
1762
 
1763
- var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('filter');
1763
+ var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('filter');
1764
1764
 
1765
1765
  // `Array.prototype.filter` method
1766
1766
  // https://tc39.es/ecma262/#sec-array.prototype.filter
1767
1767
  // with adding support of @@species
1768
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
1768
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
1769
1769
  filter: function filter(callbackfn /* , thisArg */) {
1770
1770
  return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1771
1771
  }
@@ -1774,11 +1774,11 @@
1774
1774
  var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1775
1775
 
1776
1776
 
1777
- var FORCED$7 = !descriptors || fails(function () { nativeGetOwnPropertyDescriptor(1); });
1777
+ var FORCED$8 = !descriptors || fails(function () { nativeGetOwnPropertyDescriptor(1); });
1778
1778
 
1779
1779
  // `Object.getOwnPropertyDescriptor` method
1780
1780
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
1781
- _export({ target: 'Object', stat: true, forced: FORCED$7, sham: !descriptors }, {
1781
+ _export({ target: 'Object', stat: true, forced: FORCED$8, sham: !descriptors }, {
1782
1782
  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
1783
1783
  return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
1784
1784
  }
@@ -2115,7 +2115,7 @@
2115
2115
  } return object instanceof $Object ? ObjectPrototype : null;
2116
2116
  };
2117
2117
 
2118
- var ITERATOR$8 = wellKnownSymbol('iterator');
2118
+ var ITERATOR$9 = wellKnownSymbol('iterator');
2119
2119
  var BUGGY_SAFARI_ITERATORS$1 = false;
2120
2120
 
2121
2121
  // `%IteratorPrototype%` object
@@ -2136,15 +2136,15 @@
2136
2136
  var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
2137
2137
  var test = {};
2138
2138
  // FF44- legacy iterators case
2139
- return IteratorPrototype$2[ITERATOR$8].call(test) !== test;
2139
+ return IteratorPrototype$2[ITERATOR$9].call(test) !== test;
2140
2140
  });
2141
2141
 
2142
2142
  if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
2143
2143
 
2144
2144
  // `%IteratorPrototype%[@@iterator]()` method
2145
2145
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2146
- if (!isCallable(IteratorPrototype$2[ITERATOR$8])) {
2147
- defineBuiltIn(IteratorPrototype$2, ITERATOR$8, function () {
2146
+ if (!isCallable(IteratorPrototype$2[ITERATOR$9])) {
2147
+ defineBuiltIn(IteratorPrototype$2, ITERATOR$9, function () {
2148
2148
  return this;
2149
2149
  });
2150
2150
  }
@@ -2216,7 +2216,7 @@
2216
2216
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
2217
2217
  var IteratorPrototype = iteratorsCore.IteratorPrototype;
2218
2218
  var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
2219
- var ITERATOR$7 = wellKnownSymbol('iterator');
2219
+ var ITERATOR$8 = wellKnownSymbol('iterator');
2220
2220
  var KEYS = 'keys';
2221
2221
  var VALUES = 'values';
2222
2222
  var ENTRIES = 'entries';
@@ -2242,7 +2242,7 @@
2242
2242
  var TO_STRING_TAG = NAME + ' Iterator';
2243
2243
  var INCORRECT_VALUES_NAME = false;
2244
2244
  var IterablePrototype = Iterable.prototype;
2245
- var nativeIterator = IterablePrototype[ITERATOR$7]
2245
+ var nativeIterator = IterablePrototype[ITERATOR$8]
2246
2246
  || IterablePrototype['@@iterator']
2247
2247
  || DEFAULT && IterablePrototype[DEFAULT];
2248
2248
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
@@ -2256,8 +2256,8 @@
2256
2256
  if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
2257
2257
  if (objectSetPrototypeOf) {
2258
2258
  objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
2259
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$7])) {
2260
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$7, returnThis);
2259
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$8])) {
2260
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$8, returnThis);
2261
2261
  }
2262
2262
  }
2263
2263
  // Set @@toStringTag to native iterators
@@ -2290,8 +2290,8 @@
2290
2290
  }
2291
2291
 
2292
2292
  // define iterator
2293
- if (IterablePrototype[ITERATOR$7] !== defaultIterator) {
2294
- defineBuiltIn(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT });
2293
+ if (IterablePrototype[ITERATOR$8] !== defaultIterator) {
2294
+ defineBuiltIn(IterablePrototype, ITERATOR$8, defaultIterator, { name: DEFAULT });
2295
2295
  }
2296
2296
  iterators[NAME] = defaultIterator;
2297
2297
 
@@ -2376,13 +2376,13 @@
2376
2376
 
2377
2377
  var engineIsNode = classofRaw(global$1.process) === 'process';
2378
2378
 
2379
- var SPECIES$3 = wellKnownSymbol('species');
2379
+ var SPECIES$4 = wellKnownSymbol('species');
2380
2380
 
2381
2381
  var setSpecies = function (CONSTRUCTOR_NAME) {
2382
2382
  var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
2383
2383
 
2384
- if (descriptors && Constructor && !Constructor[SPECIES$3]) {
2385
- defineBuiltInAccessor(Constructor, SPECIES$3, {
2384
+ if (descriptors && Constructor && !Constructor[SPECIES$4]) {
2385
+ defineBuiltInAccessor(Constructor, SPECIES$4, {
2386
2386
  configurable: true,
2387
2387
  get: function () { return this; }
2388
2388
  });
@@ -2396,14 +2396,14 @@
2396
2396
  throw new $TypeError$a('Incorrect invocation');
2397
2397
  };
2398
2398
 
2399
- var SPECIES$2 = wellKnownSymbol('species');
2399
+ var SPECIES$3 = wellKnownSymbol('species');
2400
2400
 
2401
2401
  // `SpeciesConstructor` abstract operation
2402
2402
  // https://tc39.es/ecma262/#sec-speciesconstructor
2403
2403
  var speciesConstructor = function (O, defaultConstructor) {
2404
2404
  var C = anObject(O).constructor;
2405
2405
  var S;
2406
- return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
2406
+ return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$3]) ? defaultConstructor : aConstructor(S);
2407
2407
  };
2408
2408
 
2409
2409
  var $TypeError$9 = TypeError;
@@ -2549,7 +2549,7 @@
2549
2549
 
2550
2550
  var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
2551
2551
 
2552
- var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
2552
+ var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
2553
2553
  var macrotask = task$1.set;
2554
2554
 
2555
2555
 
@@ -2562,7 +2562,7 @@
2562
2562
  var process$1 = global$1.process;
2563
2563
  var Promise$1 = global$1.Promise;
2564
2564
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
2565
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global$1, 'queueMicrotask');
2565
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor$4(global$1, 'queueMicrotask');
2566
2566
  var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
2567
2567
  var notify$1, toggle, node, promise, then;
2568
2568
 
@@ -2653,7 +2653,7 @@
2653
2653
  && typeof document == 'object';
2654
2654
 
2655
2655
  promiseNativeConstructor && promiseNativeConstructor.prototype;
2656
- var SPECIES$1 = wellKnownSymbol('species');
2656
+ var SPECIES$2 = wellKnownSymbol('species');
2657
2657
  var SUBCLASSING = false;
2658
2658
  var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable(global$1.PromiseRejectionEvent);
2659
2659
 
@@ -2674,7 +2674,7 @@
2674
2674
  exec(function () { /* empty */ }, function () { /* empty */ });
2675
2675
  };
2676
2676
  var constructor = promise.constructor = {};
2677
- constructor[SPECIES$1] = FakePromise;
2677
+ constructor[SPECIES$2] = FakePromise;
2678
2678
  SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2679
2679
  if (!SUBCLASSING) return true;
2680
2680
  // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
@@ -2984,18 +2984,18 @@
2984
2984
  setToStringTag(PromiseConstructor, PROMISE, false);
2985
2985
  setSpecies(PROMISE);
2986
2986
 
2987
- var ITERATOR$6 = wellKnownSymbol('iterator');
2987
+ var ITERATOR$7 = wellKnownSymbol('iterator');
2988
2988
  var ArrayPrototype = Array.prototype;
2989
2989
 
2990
2990
  // check on default Array iterator
2991
2991
  var isArrayIteratorMethod = function (it) {
2992
- return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$6] === it);
2992
+ return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$7] === it);
2993
2993
  };
2994
2994
 
2995
- var ITERATOR$5 = wellKnownSymbol('iterator');
2995
+ var ITERATOR$6 = wellKnownSymbol('iterator');
2996
2996
 
2997
2997
  var getIteratorMethod = function (it) {
2998
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$5)
2998
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$6)
2999
2999
  || getMethod(it, '@@iterator')
3000
3000
  || iterators[classof(it)];
3001
3001
  };
@@ -3086,7 +3086,7 @@
3086
3086
  } return new Result(false);
3087
3087
  };
3088
3088
 
3089
- var ITERATOR$4 = wellKnownSymbol('iterator');
3089
+ var ITERATOR$5 = wellKnownSymbol('iterator');
3090
3090
  var SAFE_CLOSING = false;
3091
3091
 
3092
3092
  try {
@@ -3099,7 +3099,7 @@
3099
3099
  SAFE_CLOSING = true;
3100
3100
  }
3101
3101
  };
3102
- iteratorWithReturn[ITERATOR$4] = function () {
3102
+ iteratorWithReturn[ITERATOR$5] = function () {
3103
3103
  return this;
3104
3104
  };
3105
3105
  // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
@@ -3113,7 +3113,7 @@
3113
3113
  var ITERATION_SUPPORT = false;
3114
3114
  try {
3115
3115
  var object = {};
3116
- object[ITERATOR$4] = function () {
3116
+ object[ITERATOR$5] = function () {
3117
3117
  return {
3118
3118
  next: function () {
3119
3119
  return { done: ITERATION_SUPPORT = true };
@@ -3301,16 +3301,16 @@
3301
3301
  return createIterResultObject(point, false);
3302
3302
  });
3303
3303
 
3304
- var ITERATOR$3 = wellKnownSymbol('iterator');
3304
+ var ITERATOR$4 = wellKnownSymbol('iterator');
3305
3305
  var ArrayValues = es_array_iterator.values;
3306
3306
 
3307
3307
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3308
3308
  if (CollectionPrototype) {
3309
3309
  // some Chrome versions have non-configurable methods on DOMTokenList
3310
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
3311
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
3310
+ if (CollectionPrototype[ITERATOR$4] !== ArrayValues) try {
3311
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR$4, ArrayValues);
3312
3312
  } catch (error) {
3313
- CollectionPrototype[ITERATOR$3] = ArrayValues;
3313
+ CollectionPrototype[ITERATOR$4] = ArrayValues;
3314
3314
  }
3315
3315
  setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3316
3316
  if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
@@ -3333,12 +3333,12 @@
3333
3333
  var $map = arrayIteration.map;
3334
3334
 
3335
3335
 
3336
- var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
3336
+ var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('map');
3337
3337
 
3338
3338
  // `Array.prototype.map` method
3339
3339
  // https://tc39.es/ecma262/#sec-array.prototype.map
3340
3340
  // with adding support of @@species
3341
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
3341
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
3342
3342
  map: function map(callbackfn /* , thisArg */) {
3343
3343
  return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3344
3344
  }
@@ -4563,7 +4563,7 @@
4563
4563
  * R.slice(0, 3, 'ramda'); //=> 'ram'
4564
4564
  */
4565
4565
 
4566
- var slice =
4566
+ var slice$1 =
4567
4567
  /*#__PURE__*/
4568
4568
  _curry3(
4569
4569
  /*#__PURE__*/
@@ -4605,7 +4605,7 @@
4605
4605
  /*#__PURE__*/
4606
4606
  _checkForMethod('tail',
4607
4607
  /*#__PURE__*/
4608
- slice(1, Infinity)));
4608
+ slice$1(1, Infinity)));
4609
4609
 
4610
4610
  /**
4611
4611
  * Performs left-to-right function composition. The first argument may have
@@ -5438,7 +5438,7 @@
5438
5438
  _curry2(
5439
5439
  /*#__PURE__*/
5440
5440
  _dispatchable(['take'], _xtake, function take(n, xs) {
5441
- return slice(0, n < 0 ? Infinity : n, xs);
5441
+ return slice$1(0, n < 0 ? Infinity : n, xs);
5442
5442
  }));
5443
5443
 
5444
5444
  function dropLast$1(n, xs) {
@@ -6868,1277 +6868,1428 @@
6868
6868
 
6869
6869
  var regenerator = runtime_1;
6870
6870
 
6871
- var $includes = arrayIncludes.includes;
6872
-
6873
-
6871
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
6872
+ var $RegExp$2 = global$1.RegExp;
6874
6873
 
6875
- // FF99+ bug
6876
- var BROKEN_ON_SPARSE = fails(function () {
6877
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
6878
- return !Array(1).includes();
6874
+ var UNSUPPORTED_Y$2 = fails(function () {
6875
+ var re = $RegExp$2('a', 'y');
6876
+ re.lastIndex = 2;
6877
+ return re.exec('abcd') !== null;
6879
6878
  });
6880
6879
 
6881
- // `Array.prototype.includes` method
6882
- // https://tc39.es/ecma262/#sec-array.prototype.includes
6883
- _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
6884
- includes: function includes(el /* , fromIndex = 0 */) {
6885
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
6886
- }
6880
+ // UC Browser bug
6881
+ // https://github.com/zloirock/core-js/issues/1008
6882
+ var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
6883
+ return !$RegExp$2('a', 'y').sticky;
6887
6884
  });
6888
6885
 
6889
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
6890
- addToUnscopables('includes');
6891
-
6892
- // `Array.isArray` method
6893
- // https://tc39.es/ecma262/#sec-array.isarray
6894
- _export({ target: 'Array', stat: true }, {
6895
- isArray: isArray
6886
+ var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
6887
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
6888
+ var re = $RegExp$2('^r', 'gy');
6889
+ re.lastIndex = 2;
6890
+ return re.exec('str') !== null;
6896
6891
  });
6897
6892
 
6898
- var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
6893
+ var regexpStickyHelpers = {
6894
+ BROKEN_CARET: BROKEN_CARET,
6895
+ MISSED_STICKY: MISSED_STICKY,
6896
+ UNSUPPORTED_Y: UNSUPPORTED_Y$2
6897
+ };
6899
6898
 
6900
- var propertyIsEnumerable = functionUncurryThis($propertyIsEnumerable);
6901
- var push$4 = functionUncurryThis([].push);
6899
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
6900
+ var $RegExp$1 = global$1.RegExp;
6902
6901
 
6903
- // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
6904
- // of `null` prototype objects
6905
- var IE_BUG = descriptors && fails(function () {
6906
- // eslint-disable-next-line es/no-object-create -- safe
6907
- var O = Object.create(null);
6908
- O[2] = 2;
6909
- return !propertyIsEnumerable(O, 2);
6902
+ var regexpUnsupportedDotAll = fails(function () {
6903
+ var re = $RegExp$1('.', 's');
6904
+ return !(re.dotAll && re.test('\n') && re.flags === 's');
6910
6905
  });
6911
6906
 
6912
- // `Object.{ entries, values }` methods implementation
6913
- var createMethod$2 = function (TO_ENTRIES) {
6914
- return function (it) {
6915
- var O = toIndexedObject(it);
6916
- var keys = objectKeys(O);
6917
- var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
6918
- var length = keys.length;
6919
- var i = 0;
6920
- var result = [];
6921
- var key;
6922
- while (length > i) {
6923
- key = keys[i++];
6924
- if (!descriptors || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
6925
- push$4(result, TO_ENTRIES ? [key, O[key]] : O[key]);
6926
- }
6927
- }
6928
- return result;
6929
- };
6930
- };
6931
-
6932
- var objectToArray = {
6933
- // `Object.entries` method
6934
- // https://tc39.es/ecma262/#sec-object.entries
6935
- entries: createMethod$2(true),
6936
- // `Object.values` method
6937
- // https://tc39.es/ecma262/#sec-object.values
6938
- values: createMethod$2(false)
6939
- };
6940
-
6941
- var $entries = objectToArray.entries;
6907
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
6908
+ var $RegExp = global$1.RegExp;
6942
6909
 
6943
- // `Object.entries` method
6944
- // https://tc39.es/ecma262/#sec-object.entries
6945
- _export({ target: 'Object', stat: true }, {
6946
- entries: function entries(O) {
6947
- return $entries(O);
6948
- }
6910
+ var regexpUnsupportedNcg = fails(function () {
6911
+ var re = $RegExp('(?<a>b)', 'g');
6912
+ return re.exec('b').groups.a !== 'b' ||
6913
+ 'b'.replace(re, '$<a>c') !== 'bc';
6949
6914
  });
6950
6915
 
6951
- var $find = arrayIteration.find;
6916
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
6917
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
6952
6918
 
6953
6919
 
6954
- var FIND = 'find';
6955
- var SKIPS_HOLES = true;
6956
6920
 
6957
- // Shouldn't skip holes
6958
- // eslint-disable-next-line es/no-array-prototype-find -- testing
6959
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
6960
6921
 
6961
- // `Array.prototype.find` method
6962
- // https://tc39.es/ecma262/#sec-array.prototype.find
6963
- _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
6964
- find: function find(callbackfn /* , that = undefined */) {
6965
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
6966
- }
6967
- });
6968
6922
 
6969
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
6970
- addToUnscopables(FIND);
6971
6923
 
6972
- var $every = arrayIteration.every;
6973
6924
 
6925
+ var getInternalState = internalState.get;
6974
6926
 
6975
- var STRICT_METHOD$1 = arrayMethodIsStrict('every');
6976
6927
 
6977
- // `Array.prototype.every` method
6978
- // https://tc39.es/ecma262/#sec-array.prototype.every
6979
- _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, {
6980
- every: function every(callbackfn /* , thisArg */) {
6981
- return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
6982
- }
6983
- });
6984
6928
 
6985
- var $TypeError$5 = TypeError;
6986
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
6987
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
6929
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
6930
+ var nativeExec = RegExp.prototype.exec;
6931
+ var patchedExec = nativeExec;
6932
+ var charAt$4 = functionUncurryThis(''.charAt);
6933
+ var indexOf = functionUncurryThis(''.indexOf);
6934
+ var replace$3 = functionUncurryThis(''.replace);
6935
+ var stringSlice$5 = functionUncurryThis(''.slice);
6988
6936
 
6989
- // Safari < 13 does not throw an error in this case
6990
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = descriptors && !function () {
6991
- // makes no sense without proper strict mode support
6992
- if (this !== undefined) return true;
6993
- try {
6994
- // eslint-disable-next-line es/no-object-defineproperty -- safe
6995
- Object.defineProperty([], 'length', { writable: false }).length = 1;
6996
- } catch (error) {
6997
- return error instanceof TypeError;
6998
- }
6999
- }();
6937
+ var UPDATES_LAST_INDEX_WRONG = (function () {
6938
+ var re1 = /a/;
6939
+ var re2 = /b*/g;
6940
+ functionCall(nativeExec, re1, 'a');
6941
+ functionCall(nativeExec, re2, 'a');
6942
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
6943
+ })();
7000
6944
 
7001
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
7002
- if (isArray(O) && !getOwnPropertyDescriptor$2(O, 'length').writable) {
7003
- throw new $TypeError$5('Cannot set read only .length');
7004
- } return O.length = length;
7005
- } : function (O, length) {
7006
- return O.length = length;
7007
- };
6945
+ var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
7008
6946
 
7009
- var $TypeError$4 = TypeError;
7010
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
6947
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
6948
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
7011
6949
 
7012
- var doesNotExceedSafeInteger = function (it) {
7013
- if (it > MAX_SAFE_INTEGER) throw $TypeError$4('Maximum allowed index exceeded');
7014
- return it;
7015
- };
6950
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
7016
6951
 
7017
- var $TypeError$3 = TypeError;
6952
+ if (PATCH) {
6953
+ patchedExec = function exec(string) {
6954
+ var re = this;
6955
+ var state = getInternalState(re);
6956
+ var str = toString$1(string);
6957
+ var raw = state.raw;
6958
+ var result, reCopy, lastIndex, match, i, object, group;
7018
6959
 
7019
- var deletePropertyOrThrow = function (O, P) {
7020
- if (!delete O[P]) throw new $TypeError$3('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
7021
- };
6960
+ if (raw) {
6961
+ raw.lastIndex = re.lastIndex;
6962
+ result = functionCall(patchedExec, raw, str);
6963
+ re.lastIndex = raw.lastIndex;
6964
+ return result;
6965
+ }
7022
6966
 
7023
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
6967
+ var groups = state.groups;
6968
+ var sticky = UNSUPPORTED_Y$1 && re.sticky;
6969
+ var flags = functionCall(regexpFlags, re);
6970
+ var source = re.source;
6971
+ var charsAdded = 0;
6972
+ var strCopy = str;
7024
6973
 
7025
- var max$1 = Math.max;
7026
- var min$2 = Math.min;
6974
+ if (sticky) {
6975
+ flags = replace$3(flags, 'y', '');
6976
+ if (indexOf(flags, 'g') === -1) {
6977
+ flags += 'g';
6978
+ }
7027
6979
 
7028
- // `Array.prototype.splice` method
7029
- // https://tc39.es/ecma262/#sec-array.prototype.splice
7030
- // with adding support of @@species
7031
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
7032
- splice: function splice(start, deleteCount /* , ...items */) {
7033
- var O = toObject(this);
7034
- var len = lengthOfArrayLike(O);
7035
- var actualStart = toAbsoluteIndex(start, len);
7036
- var argumentsLength = arguments.length;
7037
- var insertCount, actualDeleteCount, A, k, from, to;
7038
- if (argumentsLength === 0) {
7039
- insertCount = actualDeleteCount = 0;
7040
- } else if (argumentsLength === 1) {
7041
- insertCount = 0;
7042
- actualDeleteCount = len - actualStart;
7043
- } else {
7044
- insertCount = argumentsLength - 2;
7045
- actualDeleteCount = min$2(max$1(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
6980
+ strCopy = stringSlice$5(str, re.lastIndex);
6981
+ // Support anchored sticky behavior.
6982
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
6983
+ source = '(?: ' + source + ')';
6984
+ strCopy = ' ' + strCopy;
6985
+ charsAdded++;
6986
+ }
6987
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
6988
+ // simulate the 'y' flag.
6989
+ reCopy = new RegExp('^(?:' + source + ')', flags);
7046
6990
  }
7047
- doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
7048
- A = arraySpeciesCreate(O, actualDeleteCount);
7049
- for (k = 0; k < actualDeleteCount; k++) {
7050
- from = actualStart + k;
7051
- if (from in O) createProperty(A, k, O[from]);
6991
+
6992
+ if (NPCG_INCLUDED) {
6993
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
7052
6994
  }
7053
- A.length = actualDeleteCount;
7054
- if (insertCount < actualDeleteCount) {
7055
- for (k = actualStart; k < len - actualDeleteCount; k++) {
7056
- from = k + actualDeleteCount;
7057
- to = k + insertCount;
7058
- if (from in O) O[to] = O[from];
7059
- else deletePropertyOrThrow(O, to);
7060
- }
7061
- for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
7062
- } else if (insertCount > actualDeleteCount) {
7063
- for (k = len - actualDeleteCount; k > actualStart; k--) {
7064
- from = k + actualDeleteCount - 1;
7065
- to = k + insertCount - 1;
7066
- if (from in O) O[to] = O[from];
7067
- else deletePropertyOrThrow(O, to);
7068
- }
6995
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
6996
+
6997
+ match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
6998
+
6999
+ if (sticky) {
7000
+ if (match) {
7001
+ match.input = stringSlice$5(match.input, charsAdded);
7002
+ match[0] = stringSlice$5(match[0], charsAdded);
7003
+ match.index = re.lastIndex;
7004
+ re.lastIndex += match[0].length;
7005
+ } else re.lastIndex = 0;
7006
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
7007
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
7069
7008
  }
7070
- for (k = 0; k < insertCount; k++) {
7071
- O[k + actualStart] = arguments[k + 2];
7009
+ if (NPCG_INCLUDED && match && match.length > 1) {
7010
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
7011
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
7012
+ functionCall(nativeReplace, match[0], reCopy, function () {
7013
+ for (i = 1; i < arguments.length - 2; i++) {
7014
+ if (arguments[i] === undefined) match[i] = undefined;
7015
+ }
7016
+ });
7072
7017
  }
7073
- arraySetLength(O, len - actualDeleteCount + insertCount);
7074
- return A;
7075
- }
7076
- });
7077
-
7078
- var $TypeError$2 = TypeError;
7079
7018
 
7080
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
7081
- var createMethod$1 = function (IS_RIGHT) {
7082
- return function (that, callbackfn, argumentsLength, memo) {
7083
- var O = toObject(that);
7084
- var self = indexedObject(O);
7085
- var length = lengthOfArrayLike(O);
7086
- aCallable(callbackfn);
7087
- var index = IS_RIGHT ? length - 1 : 0;
7088
- var i = IS_RIGHT ? -1 : 1;
7089
- if (argumentsLength < 2) while (true) {
7090
- if (index in self) {
7091
- memo = self[index];
7092
- index += i;
7093
- break;
7094
- }
7095
- index += i;
7096
- if (IS_RIGHT ? index < 0 : length <= index) {
7097
- throw new $TypeError$2('Reduce of empty array with no initial value');
7019
+ if (match && groups) {
7020
+ match.groups = object = objectCreate(null);
7021
+ for (i = 0; i < groups.length; i++) {
7022
+ group = groups[i];
7023
+ object[group[0]] = match[group[1]];
7098
7024
  }
7099
7025
  }
7100
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
7101
- memo = callbackfn(memo, self[index], index, O);
7102
- }
7103
- return memo;
7026
+
7027
+ return match;
7104
7028
  };
7105
- };
7029
+ }
7106
7030
 
7107
- var arrayReduce = {
7108
- // `Array.prototype.reduce` method
7109
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
7110
- left: createMethod$1(false),
7111
- // `Array.prototype.reduceRight` method
7112
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
7113
- right: createMethod$1(true)
7114
- };
7031
+ var regexpExec = patchedExec;
7115
7032
 
7116
- var $reduce = arrayReduce.left;
7033
+ // `RegExp.prototype.exec` method
7034
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
7035
+ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
7036
+ exec: regexpExec
7037
+ });
7117
7038
 
7039
+ // TODO: Remove from `core-js@4` since it's moved to entry points
7118
7040
 
7119
7041
 
7120
7042
 
7121
- // Chrome 80-82 has a critical bug
7122
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
7123
- var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
7124
- var FORCED$6 = CHROME_BUG || !arrayMethodIsStrict('reduce');
7125
7043
 
7126
- // `Array.prototype.reduce` method
7127
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
7128
- _export({ target: 'Array', proto: true, forced: FORCED$6 }, {
7129
- reduce: function reduce(callbackfn /* , initialValue */) {
7130
- var length = arguments.length;
7131
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
7132
- }
7133
- });
7134
7044
 
7135
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
7136
7045
 
7137
- // We can't use this feature detection in V8 since it causes
7138
- // deoptimization and serious performance degradation
7139
- // https://github.com/zloirock/core-js/issues/679
7140
- var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
7141
- var array = [];
7142
- array[IS_CONCAT_SPREADABLE] = false;
7143
- return array.concat()[0] !== array;
7144
- });
7145
7046
 
7146
- var isConcatSpreadable = function (O) {
7147
- if (!isObject(O)) return false;
7148
- var spreadable = O[IS_CONCAT_SPREADABLE];
7149
- return spreadable !== undefined ? !!spreadable : isArray(O);
7150
- };
7151
7047
 
7152
- var FORCED$5 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');
7048
+ var SPECIES$1 = wellKnownSymbol('species');
7049
+ var RegExpPrototype = RegExp.prototype;
7153
7050
 
7154
- // `Array.prototype.concat` method
7155
- // https://tc39.es/ecma262/#sec-array.prototype.concat
7156
- // with adding support of @@isConcatSpreadable and @@species
7157
- _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, {
7158
- // eslint-disable-next-line no-unused-vars -- required for `.length`
7159
- concat: function concat(arg) {
7160
- var O = toObject(this);
7161
- var A = arraySpeciesCreate(O, 0);
7162
- var n = 0;
7163
- var i, k, length, len, E;
7164
- for (i = -1, length = arguments.length; i < length; i++) {
7165
- E = i === -1 ? O : arguments[i];
7166
- if (isConcatSpreadable(E)) {
7167
- len = lengthOfArrayLike(E);
7168
- doesNotExceedSafeInteger(n + len);
7169
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7170
- } else {
7171
- doesNotExceedSafeInteger(n + 1);
7172
- createProperty(A, n++, E);
7173
- }
7174
- }
7175
- A.length = n;
7176
- return A;
7177
- }
7178
- });
7051
+ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
7052
+ var SYMBOL = wellKnownSymbol(KEY);
7179
7053
 
7180
- // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
7054
+ var DELEGATES_TO_SYMBOL = !fails(function () {
7055
+ // String methods call symbol-named RegEp methods
7056
+ var O = {};
7057
+ O[SYMBOL] = function () { return 7; };
7058
+ return ''[KEY](O) !== 7;
7059
+ });
7181
7060
 
7061
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
7062
+ // Symbol-named RegExp methods call .exec
7063
+ var execCalled = false;
7064
+ var re = /a/;
7182
7065
 
7183
- var arrayBufferNonExtensible = fails(function () {
7184
- if (typeof ArrayBuffer == 'function') {
7185
- var buffer = new ArrayBuffer(8);
7186
- // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
7187
- if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
7188
- }
7189
- });
7066
+ if (KEY === 'split') {
7067
+ // We can't use real regex here since it causes deoptimization
7068
+ // and serious performance degradation in V8
7069
+ // https://github.com/zloirock/core-js/issues/306
7070
+ re = {};
7071
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
7072
+ // a new one. We need to return the patched regex when creating the new one.
7073
+ re.constructor = {};
7074
+ re.constructor[SPECIES$1] = function () { return re; };
7075
+ re.flags = '';
7076
+ re[SYMBOL] = /./[SYMBOL];
7077
+ }
7190
7078
 
7191
- // eslint-disable-next-line es/no-object-isextensible -- safe
7192
- var $isExtensible = Object.isExtensible;
7193
- var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
7079
+ re.exec = function () {
7080
+ execCalled = true;
7081
+ return null;
7082
+ };
7194
7083
 
7195
- // `Object.isExtensible` method
7196
- // https://tc39.es/ecma262/#sec-object.isextensible
7197
- var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
7198
- if (!isObject(it)) return false;
7199
- if (arrayBufferNonExtensible && classofRaw(it) === 'ArrayBuffer') return false;
7200
- return $isExtensible ? $isExtensible(it) : true;
7201
- } : $isExtensible;
7084
+ re[SYMBOL]('');
7085
+ return !execCalled;
7086
+ });
7202
7087
 
7203
- var freezing = !fails(function () {
7204
- // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
7205
- return Object.isExtensible(Object.preventExtensions({}));
7206
- });
7088
+ if (
7089
+ !DELEGATES_TO_SYMBOL ||
7090
+ !DELEGATES_TO_EXEC ||
7091
+ FORCED
7092
+ ) {
7093
+ var uncurriedNativeRegExpMethod = functionUncurryThisClause(/./[SYMBOL]);
7094
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
7095
+ var uncurriedNativeMethod = functionUncurryThisClause(nativeMethod);
7096
+ var $exec = regexp.exec;
7097
+ if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
7098
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
7099
+ // The native String method already delegates to @@method (this
7100
+ // polyfilled function), leasing to infinite recursion.
7101
+ // We avoid it by directly calling the native @@method method.
7102
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
7103
+ }
7104
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
7105
+ }
7106
+ return { done: false };
7107
+ });
7207
7108
 
7208
- var internalMetadata = createCommonjsModule(function (module) {
7109
+ defineBuiltIn(String.prototype, KEY, methods[0]);
7110
+ defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
7111
+ }
7209
7112
 
7113
+ if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
7114
+ };
7210
7115
 
7116
+ var MATCH$1 = wellKnownSymbol('match');
7211
7117
 
7118
+ // `IsRegExp` abstract operation
7119
+ // https://tc39.es/ecma262/#sec-isregexp
7120
+ var isRegexp = function (it) {
7121
+ var isRegExp;
7122
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) === 'RegExp');
7123
+ };
7212
7124
 
7125
+ var charAt$3 = stringMultibyte.charAt;
7213
7126
 
7214
- var defineProperty = objectDefineProperty.f;
7127
+ // `AdvanceStringIndex` abstract operation
7128
+ // https://tc39.es/ecma262/#sec-advancestringindex
7129
+ var advanceStringIndex = function (S, index, unicode) {
7130
+ return index + (unicode ? charAt$3(S, index).length : 1);
7131
+ };
7215
7132
 
7133
+ var $TypeError$5 = TypeError;
7216
7134
 
7135
+ // `RegExpExec` abstract operation
7136
+ // https://tc39.es/ecma262/#sec-regexpexec
7137
+ var regexpExecAbstract = function (R, S) {
7138
+ var exec = R.exec;
7139
+ if (isCallable(exec)) {
7140
+ var result = functionCall(exec, R, S);
7141
+ if (result !== null) anObject(result);
7142
+ return result;
7143
+ }
7144
+ if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
7145
+ throw new $TypeError$5('RegExp#exec called on incompatible receiver');
7146
+ };
7217
7147
 
7148
+ var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
7149
+ var MAX_UINT32 = 0xFFFFFFFF;
7150
+ var min$3 = Math.min;
7151
+ var $push = [].push;
7152
+ var exec$1 = functionUncurryThis(/./.exec);
7153
+ var push$4 = functionUncurryThis($push);
7154
+ var stringSlice$4 = functionUncurryThis(''.slice);
7218
7155
 
7156
+ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
7157
+ // Weex JS has frozen built-in prototypes, so use try / catch wrapper
7158
+ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
7159
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
7160
+ var re = /(?:)/;
7161
+ var originalExec = re.exec;
7162
+ re.exec = function () { return originalExec.apply(this, arguments); };
7163
+ var result = 'ab'.split(re);
7164
+ return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
7165
+ });
7219
7166
 
7167
+ // @@split logic
7168
+ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
7169
+ var internalSplit;
7170
+ if (
7171
+ 'abbc'.split(/(b)*/)[1] === 'c' ||
7172
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
7173
+ 'test'.split(/(?:)/, -1).length !== 4 ||
7174
+ 'ab'.split(/(?:ab)*/).length !== 2 ||
7175
+ '.'.split(/(.?)(.?)/).length !== 4 ||
7176
+ // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
7177
+ '.'.split(/()()/).length > 1 ||
7178
+ ''.split(/.?/).length
7179
+ ) {
7180
+ // based on es5-shim implementation, need to rework it
7181
+ internalSplit = function (separator, limit) {
7182
+ var string = toString$1(requireObjectCoercible(this));
7183
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
7184
+ if (lim === 0) return [];
7185
+ if (separator === undefined) return [string];
7186
+ // If `separator` is not a regex, use native split
7187
+ if (!isRegexp(separator)) {
7188
+ return functionCall(nativeSplit, string, separator, lim);
7189
+ }
7190
+ var output = [];
7191
+ var flags = (separator.ignoreCase ? 'i' : '') +
7192
+ (separator.multiline ? 'm' : '') +
7193
+ (separator.unicode ? 'u' : '') +
7194
+ (separator.sticky ? 'y' : '');
7195
+ var lastLastIndex = 0;
7196
+ // Make `global` and avoid `lastIndex` issues by working with a copy
7197
+ var separatorCopy = new RegExp(separator.source, flags + 'g');
7198
+ var match, lastIndex, lastLength;
7199
+ while (match = functionCall(regexpExec, separatorCopy, string)) {
7200
+ lastIndex = separatorCopy.lastIndex;
7201
+ if (lastIndex > lastLastIndex) {
7202
+ push$4(output, stringSlice$4(string, lastLastIndex, match.index));
7203
+ if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
7204
+ lastLength = match[0].length;
7205
+ lastLastIndex = lastIndex;
7206
+ if (output.length >= lim) break;
7207
+ }
7208
+ if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
7209
+ }
7210
+ if (lastLastIndex === string.length) {
7211
+ if (lastLength || !exec$1(separatorCopy, '')) push$4(output, '');
7212
+ } else push$4(output, stringSlice$4(string, lastLastIndex));
7213
+ return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
7214
+ };
7215
+ // Chakra, V8
7216
+ } else if ('0'.split(undefined, 0).length) {
7217
+ internalSplit = function (separator, limit) {
7218
+ return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
7219
+ };
7220
+ } else internalSplit = nativeSplit;
7220
7221
 
7221
- var REQUIRED = false;
7222
- var METADATA = uid('meta');
7223
- var id = 0;
7222
+ return [
7223
+ // `String.prototype.split` method
7224
+ // https://tc39.es/ecma262/#sec-string.prototype.split
7225
+ function split(separator, limit) {
7226
+ var O = requireObjectCoercible(this);
7227
+ var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
7228
+ return splitter
7229
+ ? functionCall(splitter, separator, O, limit)
7230
+ : functionCall(internalSplit, toString$1(O), separator, limit);
7231
+ },
7232
+ // `RegExp.prototype[@@split]` method
7233
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
7234
+ //
7235
+ // NOTE: This cannot be properly polyfilled in engines that don't support
7236
+ // the 'y' flag.
7237
+ function (string, limit) {
7238
+ var rx = anObject(this);
7239
+ var S = toString$1(string);
7240
+ var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
7224
7241
 
7225
- var setMetadata = function (it) {
7226
- defineProperty(it, METADATA, { value: {
7227
- objectID: 'O' + id++, // object ID
7228
- weakData: {} // weak collections IDs
7229
- } });
7230
- };
7242
+ if (res.done) return res.value;
7231
7243
 
7232
- var fastKey = function (it, create) {
7233
- // return a primitive with prefix
7234
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
7235
- if (!hasOwnProperty_1(it, METADATA)) {
7236
- // can't set metadata to uncaught frozen object
7237
- if (!objectIsExtensible(it)) return 'F';
7238
- // not necessary to add metadata
7239
- if (!create) return 'E';
7240
- // add missing metadata
7241
- setMetadata(it);
7242
- // return object ID
7243
- } return it[METADATA].objectID;
7244
- };
7244
+ var C = speciesConstructor(rx, RegExp);
7245
7245
 
7246
- var getWeakData = function (it, create) {
7247
- if (!hasOwnProperty_1(it, METADATA)) {
7248
- // can't set metadata to uncaught frozen object
7249
- if (!objectIsExtensible(it)) return true;
7250
- // not necessary to add metadata
7251
- if (!create) return false;
7252
- // add missing metadata
7253
- setMetadata(it);
7254
- // return the store of weak collections IDs
7255
- } return it[METADATA].weakData;
7256
- };
7246
+ var unicodeMatching = rx.unicode;
7247
+ var flags = (rx.ignoreCase ? 'i' : '') +
7248
+ (rx.multiline ? 'm' : '') +
7249
+ (rx.unicode ? 'u' : '') +
7250
+ (UNSUPPORTED_Y ? 'g' : 'y');
7257
7251
 
7258
- // add metadata on freeze-family methods calling
7259
- var onFreeze = function (it) {
7260
- if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
7261
- return it;
7262
- };
7252
+ // ^(? + rx + ) is needed, in combination with some S slicing, to
7253
+ // simulate the 'y' flag.
7254
+ var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
7255
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
7256
+ if (lim === 0) return [];
7257
+ if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
7258
+ var p = 0;
7259
+ var q = 0;
7260
+ var A = [];
7261
+ while (q < S.length) {
7262
+ splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
7263
+ var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice$4(S, q) : S);
7264
+ var e;
7265
+ if (
7266
+ z === null ||
7267
+ (e = min$3(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
7268
+ ) {
7269
+ q = advanceStringIndex(S, q, unicodeMatching);
7270
+ } else {
7271
+ push$4(A, stringSlice$4(S, p, q));
7272
+ if (A.length === lim) return A;
7273
+ for (var i = 1; i <= z.length - 1; i++) {
7274
+ push$4(A, z[i]);
7275
+ if (A.length === lim) return A;
7276
+ }
7277
+ q = p = e;
7278
+ }
7279
+ }
7280
+ push$4(A, stringSlice$4(S, p));
7281
+ return A;
7282
+ }
7283
+ ];
7284
+ }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
7263
7285
 
7264
- var enable = function () {
7265
- meta.enable = function () { /* empty */ };
7266
- REQUIRED = true;
7267
- var getOwnPropertyNames = objectGetOwnPropertyNames.f;
7268
- var splice = functionUncurryThis([].splice);
7269
- var test = {};
7270
- test[METADATA] = 1;
7286
+ // a string of all valid unicode whitespaces
7287
+ var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
7288
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
7271
7289
 
7272
- // prevent exposing of metadata key
7273
- if (getOwnPropertyNames(test).length) {
7274
- objectGetOwnPropertyNames.f = function (it) {
7275
- var result = getOwnPropertyNames(it);
7276
- for (var i = 0, length = result.length; i < length; i++) {
7277
- if (result[i] === METADATA) {
7278
- splice(result, i, 1);
7279
- break;
7280
- }
7281
- } return result;
7282
- };
7290
+ var replace$2 = functionUncurryThis(''.replace);
7291
+ var ltrim = RegExp('^[' + whitespaces + ']+');
7292
+ var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
7283
7293
 
7284
- _export({ target: 'Object', stat: true, forced: true }, {
7285
- getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
7286
- });
7287
- }
7294
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
7295
+ var createMethod$2 = function (TYPE) {
7296
+ return function ($this) {
7297
+ var string = toString$1(requireObjectCoercible($this));
7298
+ if (TYPE & 1) string = replace$2(string, ltrim, '');
7299
+ if (TYPE & 2) string = replace$2(string, rtrim, '$1');
7300
+ return string;
7301
+ };
7288
7302
  };
7289
7303
 
7290
- var meta = module.exports = {
7291
- enable: enable,
7292
- fastKey: fastKey,
7293
- getWeakData: getWeakData,
7294
- onFreeze: onFreeze
7304
+ var stringTrim = {
7305
+ // `String.prototype.{ trimLeft, trimStart }` methods
7306
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
7307
+ start: createMethod$2(1),
7308
+ // `String.prototype.{ trimRight, trimEnd }` methods
7309
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
7310
+ end: createMethod$2(2),
7311
+ // `String.prototype.trim` method
7312
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
7313
+ trim: createMethod$2(3)
7295
7314
  };
7296
7315
 
7297
- hiddenKeys$1[METADATA] = true;
7316
+ var trim$2 = stringTrim.trim;
7317
+
7318
+
7319
+ var $parseInt = global$1.parseInt;
7320
+ var Symbol$2 = global$1.Symbol;
7321
+ var ITERATOR$3 = Symbol$2 && Symbol$2.iterator;
7322
+ var hex = /^[+-]?0x/i;
7323
+ var exec = functionUncurryThis(hex.exec);
7324
+ var FORCED$7 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
7325
+ // MS Edge 18- broken with boxed symbols
7326
+ || (ITERATOR$3 && !fails(function () { $parseInt(Object(ITERATOR$3)); }));
7327
+
7328
+ // `parseInt` method
7329
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
7330
+ var numberParseInt = FORCED$7 ? function parseInt(string, radix) {
7331
+ var S = trim$2(toString$1(string));
7332
+ return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
7333
+ } : $parseInt;
7334
+
7335
+ // `parseInt` method
7336
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
7337
+ _export({ global: true, forced: parseInt !== numberParseInt }, {
7338
+ parseInt: numberParseInt
7298
7339
  });
7299
7340
 
7300
- // makes subclassing work correct for wrapped built-ins
7301
- var inheritIfRequired = function ($this, dummy, Wrapper) {
7302
- var NewTarget, NewTargetPrototype;
7303
- if (
7304
- // it can work only with native `setPrototypeOf`
7305
- objectSetPrototypeOf &&
7306
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
7307
- isCallable(NewTarget = dummy.constructor) &&
7308
- NewTarget !== Wrapper &&
7309
- isObject(NewTargetPrototype = NewTarget.prototype) &&
7310
- NewTargetPrototype !== Wrapper.prototype
7311
- ) objectSetPrototypeOf($this, NewTargetPrototype);
7312
- return $this;
7313
- };
7341
+ var $TypeError$4 = TypeError;
7314
7342
 
7315
- var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
7316
- var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
7317
- var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
7318
- var ADDER = IS_MAP ? 'set' : 'add';
7319
- var NativeConstructor = global$1[CONSTRUCTOR_NAME];
7320
- var NativePrototype = NativeConstructor && NativeConstructor.prototype;
7321
- var Constructor = NativeConstructor;
7322
- var exported = {};
7343
+ var notARegexp = function (it) {
7344
+ if (isRegexp(it)) {
7345
+ throw new $TypeError$4("The method doesn't accept regular expressions");
7346
+ } return it;
7347
+ };
7323
7348
 
7324
- var fixMethod = function (KEY) {
7325
- var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
7326
- defineBuiltIn(NativePrototype, KEY,
7327
- KEY === 'add' ? function add(value) {
7328
- uncurriedNativeMethod(this, value === 0 ? 0 : value);
7329
- return this;
7330
- } : KEY === 'delete' ? function (key) {
7331
- return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7332
- } : KEY === 'get' ? function get(key) {
7333
- return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7334
- } : KEY === 'has' ? function has(key) {
7335
- return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7336
- } : function set(key, value) {
7337
- uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
7338
- return this;
7339
- }
7340
- );
7341
- };
7349
+ var MATCH = wellKnownSymbol('match');
7342
7350
 
7343
- var REPLACE = isForced_1(
7344
- CONSTRUCTOR_NAME,
7345
- !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
7346
- new NativeConstructor().entries().next();
7347
- }))
7348
- );
7351
+ var correctIsRegexpLogic = function (METHOD_NAME) {
7352
+ var regexp = /./;
7353
+ try {
7354
+ '/./'[METHOD_NAME](regexp);
7355
+ } catch (error1) {
7356
+ try {
7357
+ regexp[MATCH] = false;
7358
+ return '/./'[METHOD_NAME](regexp);
7359
+ } catch (error2) { /* empty */ }
7360
+ } return false;
7361
+ };
7349
7362
 
7350
- if (REPLACE) {
7351
- // create collection constructor
7352
- Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
7353
- internalMetadata.enable();
7354
- } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
7355
- var instance = new Constructor();
7356
- // early implementations not supports chaining
7357
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
7358
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
7359
- var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
7360
- // most early implementations doesn't supports iterables, most modern - not close it correctly
7361
- // eslint-disable-next-line no-new -- required for testing
7362
- var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
7363
- // for early implementations -0 and +0 not the same
7364
- var BUGGY_ZERO = !IS_WEAK && fails(function () {
7365
- // V8 ~ Chromium 42- fails only with 5+ elements
7366
- var $instance = new NativeConstructor();
7367
- var index = 5;
7368
- while (index--) $instance[ADDER](index, index);
7369
- return !$instance.has(-0);
7370
- });
7363
+ var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
7371
7364
 
7372
- if (!ACCEPT_ITERABLES) {
7373
- Constructor = wrapper(function (dummy, iterable) {
7374
- anInstance(dummy, NativePrototype);
7375
- var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
7376
- if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
7377
- return that;
7378
- });
7379
- Constructor.prototype = NativePrototype;
7380
- NativePrototype.constructor = Constructor;
7381
- }
7382
7365
 
7383
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
7384
- fixMethod('delete');
7385
- fixMethod('has');
7386
- IS_MAP && fixMethod('get');
7387
- }
7388
7366
 
7389
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
7390
7367
 
7391
- // weak collections should not contains .clear method
7392
- if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
7368
+
7369
+
7370
+
7371
+ // eslint-disable-next-line es/no-string-prototype-endswith -- safe
7372
+ var nativeEndsWith = functionUncurryThisClause(''.endsWith);
7373
+ var slice = functionUncurryThisClause(''.slice);
7374
+ var min$2 = Math.min;
7375
+
7376
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
7377
+ // https://github.com/zloirock/core-js/pull/702
7378
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
7379
+ var descriptor = getOwnPropertyDescriptor$3(String.prototype, 'endsWith');
7380
+ return descriptor && !descriptor.writable;
7381
+ }();
7382
+
7383
+ // `String.prototype.endsWith` method
7384
+ // https://tc39.es/ecma262/#sec-string.prototype.endswith
7385
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
7386
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
7387
+ var that = toString$1(requireObjectCoercible(this));
7388
+ notARegexp(searchString);
7389
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
7390
+ var len = that.length;
7391
+ var end = endPosition === undefined ? len : min$2(toLength(endPosition), len);
7392
+ var search = toString$1(searchString);
7393
+ return nativeEndsWith
7394
+ ? nativeEndsWith(that, search, end)
7395
+ : slice(that, end - search.length, end) === search;
7393
7396
  }
7397
+ });
7394
7398
 
7395
- exported[CONSTRUCTOR_NAME] = Constructor;
7396
- _export({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
7399
+ var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
7397
7400
 
7398
- setToStringTag(Constructor, CONSTRUCTOR_NAME);
7401
+ var SPECIES = wellKnownSymbol('species');
7402
+ var $Array$1 = Array;
7403
+ var max$2 = Math.max;
7399
7404
 
7400
- if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
7405
+ // `Array.prototype.slice` method
7406
+ // https://tc39.es/ecma262/#sec-array.prototype.slice
7407
+ // fallback for not array-like ES3 strings and DOM objects
7408
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
7409
+ slice: function slice(start, end) {
7410
+ var O = toIndexedObject(this);
7411
+ var length = lengthOfArrayLike(O);
7412
+ var k = toAbsoluteIndex(start, length);
7413
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
7414
+ // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
7415
+ var Constructor, result, n;
7416
+ if (isArray(O)) {
7417
+ Constructor = O.constructor;
7418
+ // cross-realm fallback
7419
+ if (isConstructor(Constructor) && (Constructor === $Array$1 || isArray(Constructor.prototype))) {
7420
+ Constructor = undefined;
7421
+ } else if (isObject(Constructor)) {
7422
+ Constructor = Constructor[SPECIES];
7423
+ if (Constructor === null) Constructor = undefined;
7424
+ }
7425
+ if (Constructor === $Array$1 || Constructor === undefined) {
7426
+ return arraySlice(O, k, fin);
7427
+ }
7428
+ }
7429
+ result = new (Constructor === undefined ? $Array$1 : Constructor)(max$2(fin - k, 0));
7430
+ for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
7431
+ result.length = n;
7432
+ return result;
7433
+ }
7434
+ });
7401
7435
 
7402
- return Constructor;
7436
+ var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
7437
+
7438
+ var propertyIsEnumerable = functionUncurryThis($propertyIsEnumerable);
7439
+ var push$3 = functionUncurryThis([].push);
7440
+
7441
+ // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
7442
+ // of `null` prototype objects
7443
+ var IE_BUG = descriptors && fails(function () {
7444
+ // eslint-disable-next-line es/no-object-create -- safe
7445
+ var O = Object.create(null);
7446
+ O[2] = 2;
7447
+ return !propertyIsEnumerable(O, 2);
7448
+ });
7449
+
7450
+ // `Object.{ entries, values }` methods implementation
7451
+ var createMethod$1 = function (TO_ENTRIES) {
7452
+ return function (it) {
7453
+ var O = toIndexedObject(it);
7454
+ var keys = objectKeys(O);
7455
+ var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
7456
+ var length = keys.length;
7457
+ var i = 0;
7458
+ var result = [];
7459
+ var key;
7460
+ while (length > i) {
7461
+ key = keys[i++];
7462
+ if (!descriptors || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
7463
+ push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
7464
+ }
7465
+ }
7466
+ return result;
7467
+ };
7403
7468
  };
7404
7469
 
7405
- var defineBuiltIns = function (target, src, options) {
7406
- for (var key in src) defineBuiltIn(target, key, src[key], options);
7407
- return target;
7470
+ var objectToArray = {
7471
+ // `Object.entries` method
7472
+ // https://tc39.es/ecma262/#sec-object.entries
7473
+ entries: createMethod$1(true),
7474
+ // `Object.values` method
7475
+ // https://tc39.es/ecma262/#sec-object.values
7476
+ values: createMethod$1(false)
7408
7477
  };
7409
7478
 
7410
- var fastKey = internalMetadata.fastKey;
7479
+ var $entries = objectToArray.entries;
7411
7480
 
7481
+ // `Object.entries` method
7482
+ // https://tc39.es/ecma262/#sec-object.entries
7483
+ _export({ target: 'Object', stat: true }, {
7484
+ entries: function entries(O) {
7485
+ return $entries(O);
7486
+ }
7487
+ });
7412
7488
 
7413
- var setInternalState$1 = internalState.set;
7414
- var internalStateGetterFor = internalState.getterFor;
7489
+ /* eslint-disable es/no-array-prototype-indexof -- required for testing */
7415
7490
 
7416
- var collectionStrong = {
7417
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
7418
- var Constructor = wrapper(function (that, iterable) {
7419
- anInstance(that, Prototype);
7420
- setInternalState$1(that, {
7421
- type: CONSTRUCTOR_NAME,
7422
- index: objectCreate(null),
7423
- first: undefined,
7424
- last: undefined,
7425
- size: 0
7426
- });
7427
- if (!descriptors) that.size = 0;
7428
- if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
7429
- });
7430
7491
 
7431
- var Prototype = Constructor.prototype;
7492
+ var $indexOf = arrayIncludes.indexOf;
7432
7493
 
7433
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
7434
7494
 
7435
- var define = function (that, key, value) {
7436
- var state = getInternalState(that);
7437
- var entry = getEntry(that, key);
7438
- var previous, index;
7439
- // change existing entry
7440
- if (entry) {
7441
- entry.value = value;
7442
- // create new entry
7443
- } else {
7444
- state.last = entry = {
7445
- index: index = fastKey(key, true),
7446
- key: key,
7447
- value: value,
7448
- previous: previous = state.last,
7449
- next: undefined,
7450
- removed: false
7451
- };
7452
- if (!state.first) state.first = entry;
7453
- if (previous) previous.next = entry;
7454
- if (descriptors) state.size++;
7455
- else that.size++;
7456
- // add to index
7457
- if (index !== 'F') state.index[index] = entry;
7458
- } return that;
7459
- };
7495
+ var nativeIndexOf = functionUncurryThisClause([].indexOf);
7460
7496
 
7461
- var getEntry = function (that, key) {
7462
- var state = getInternalState(that);
7463
- // fast case
7464
- var index = fastKey(key);
7465
- var entry;
7466
- if (index !== 'F') return state.index[index];
7467
- // frozen object case
7468
- for (entry = state.first; entry; entry = entry.next) {
7469
- if (entry.key === key) return entry;
7470
- }
7471
- };
7497
+ var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
7498
+ var FORCED$6 = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
7472
7499
 
7473
- defineBuiltIns(Prototype, {
7474
- // `{ Map, Set }.prototype.clear()` methods
7475
- // https://tc39.es/ecma262/#sec-map.prototype.clear
7476
- // https://tc39.es/ecma262/#sec-set.prototype.clear
7477
- clear: function clear() {
7478
- var that = this;
7479
- var state = getInternalState(that);
7480
- var data = state.index;
7481
- var entry = state.first;
7482
- while (entry) {
7483
- entry.removed = true;
7484
- if (entry.previous) entry.previous = entry.previous.next = undefined;
7485
- delete data[entry.index];
7486
- entry = entry.next;
7487
- }
7488
- state.first = state.last = undefined;
7489
- if (descriptors) state.size = 0;
7490
- else that.size = 0;
7491
- },
7492
- // `{ Map, Set }.prototype.delete(key)` methods
7493
- // https://tc39.es/ecma262/#sec-map.prototype.delete
7494
- // https://tc39.es/ecma262/#sec-set.prototype.delete
7495
- 'delete': function (key) {
7496
- var that = this;
7497
- var state = getInternalState(that);
7498
- var entry = getEntry(that, key);
7499
- if (entry) {
7500
- var next = entry.next;
7501
- var prev = entry.previous;
7502
- delete state.index[entry.index];
7503
- entry.removed = true;
7504
- if (prev) prev.next = next;
7505
- if (next) next.previous = prev;
7506
- if (state.first === entry) state.first = next;
7507
- if (state.last === entry) state.last = prev;
7508
- if (descriptors) state.size--;
7509
- else that.size--;
7510
- } return !!entry;
7511
- },
7512
- // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
7513
- // https://tc39.es/ecma262/#sec-map.prototype.foreach
7514
- // https://tc39.es/ecma262/#sec-set.prototype.foreach
7515
- forEach: function forEach(callbackfn /* , that = undefined */) {
7516
- var state = getInternalState(this);
7517
- var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
7518
- var entry;
7519
- while (entry = entry ? entry.next : state.first) {
7520
- boundFunction(entry.value, entry.key, this);
7521
- // revert to the last existing entry
7522
- while (entry && entry.removed) entry = entry.previous;
7523
- }
7524
- },
7525
- // `{ Map, Set}.prototype.has(key)` methods
7526
- // https://tc39.es/ecma262/#sec-map.prototype.has
7527
- // https://tc39.es/ecma262/#sec-set.prototype.has
7528
- has: function has(key) {
7529
- return !!getEntry(this, key);
7530
- }
7531
- });
7500
+ // `Array.prototype.indexOf` method
7501
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
7502
+ _export({ target: 'Array', proto: true, forced: FORCED$6 }, {
7503
+ indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
7504
+ var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
7505
+ return NEGATIVE_ZERO
7506
+ // convert -0 to +0
7507
+ ? nativeIndexOf(this, searchElement, fromIndex) || 0
7508
+ : $indexOf(this, searchElement, fromIndex);
7509
+ }
7510
+ });
7532
7511
 
7533
- defineBuiltIns(Prototype, IS_MAP ? {
7534
- // `Map.prototype.get(key)` method
7535
- // https://tc39.es/ecma262/#sec-map.prototype.get
7536
- get: function get(key) {
7537
- var entry = getEntry(this, key);
7538
- return entry && entry.value;
7539
- },
7540
- // `Map.prototype.set(key, value)` method
7541
- // https://tc39.es/ecma262/#sec-map.prototype.set
7542
- set: function set(key, value) {
7543
- return define(this, key === 0 ? 0 : key, value);
7544
- }
7545
- } : {
7546
- // `Set.prototype.add(value)` method
7547
- // https://tc39.es/ecma262/#sec-set.prototype.add
7548
- add: function add(value) {
7549
- return define(this, value = value === 0 ? 0 : value, value);
7550
- }
7551
- });
7552
- if (descriptors) defineBuiltInAccessor(Prototype, 'size', {
7553
- configurable: true,
7554
- get: function () {
7555
- return getInternalState(this).size;
7556
- }
7557
- });
7558
- return Constructor;
7559
- },
7560
- setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
7561
- var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
7562
- var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
7563
- var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
7564
- // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
7565
- // https://tc39.es/ecma262/#sec-map.prototype.entries
7566
- // https://tc39.es/ecma262/#sec-map.prototype.keys
7567
- // https://tc39.es/ecma262/#sec-map.prototype.values
7568
- // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
7569
- // https://tc39.es/ecma262/#sec-set.prototype.entries
7570
- // https://tc39.es/ecma262/#sec-set.prototype.keys
7571
- // https://tc39.es/ecma262/#sec-set.prototype.values
7572
- // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
7573
- iteratorDefine(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
7574
- setInternalState$1(this, {
7575
- type: ITERATOR_NAME,
7576
- target: iterated,
7577
- state: getInternalCollectionState(iterated),
7578
- kind: kind,
7579
- last: undefined
7580
- });
7581
- }, function () {
7582
- var state = getInternalIteratorState(this);
7583
- var kind = state.kind;
7584
- var entry = state.last;
7585
- // revert to the last existing entry
7586
- while (entry && entry.removed) entry = entry.previous;
7587
- // get next entry
7588
- if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
7589
- // or finish the iteration
7590
- state.target = undefined;
7591
- return createIterResultObject(undefined, true);
7592
- }
7593
- // return step by kind
7594
- if (kind === 'keys') return createIterResultObject(entry.key, false);
7595
- if (kind === 'values') return createIterResultObject(entry.value, false);
7596
- return createIterResultObject([entry.key, entry.value], false);
7597
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
7512
+ var $includes = arrayIncludes.includes;
7598
7513
 
7599
- // `{ Map, Set }.prototype[@@species]` accessors
7600
- // https://tc39.es/ecma262/#sec-get-map-@@species
7601
- // https://tc39.es/ecma262/#sec-get-set-@@species
7602
- setSpecies(CONSTRUCTOR_NAME);
7603
- }
7604
- };
7605
7514
 
7606
- // `Set` constructor
7607
- // https://tc39.es/ecma262/#sec-set-objects
7608
- collection('Set', function (init) {
7609
- return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
7610
- }, collectionStrong);
7611
7515
 
7612
- // `Map` constructor
7613
- // https://tc39.es/ecma262/#sec-map-objects
7614
- collection('Map', function (init) {
7615
- return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
7616
- }, collectionStrong);
7516
+ // FF99+ bug
7517
+ var BROKEN_ON_SPARSE = fails(function () {
7518
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
7519
+ return !Array(1).includes();
7520
+ });
7617
7521
 
7618
- // call something on iterator step with safe closing on error
7619
- var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
7620
- try {
7621
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
7622
- } catch (error) {
7623
- iteratorClose(iterator, 'throw', error);
7522
+ // `Array.prototype.includes` method
7523
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
7524
+ _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
7525
+ includes: function includes(el /* , fromIndex = 0 */) {
7526
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
7624
7527
  }
7625
- };
7626
-
7627
- var $Array = Array;
7528
+ });
7628
7529
 
7629
- // `Array.from` method implementation
7630
- // https://tc39.es/ecma262/#sec-array.from
7631
- var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
7632
- var O = toObject(arrayLike);
7633
- var IS_CONSTRUCTOR = isConstructor(this);
7634
- var argumentsLength = arguments.length;
7635
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
7636
- var mapping = mapfn !== undefined;
7637
- if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
7638
- var iteratorMethod = getIteratorMethod(O);
7639
- var index = 0;
7640
- var length, result, step, iterator, next, value;
7641
- // if the target is not iterable or it's an array with the default iterator - use a simple case
7642
- if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
7643
- iterator = getIterator(O, iteratorMethod);
7644
- next = iterator.next;
7645
- result = IS_CONSTRUCTOR ? new this() : [];
7646
- for (;!(step = functionCall(next, iterator)).done; index++) {
7647
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
7648
- createProperty(result, index, value);
7649
- }
7650
- } else {
7651
- length = lengthOfArrayLike(O);
7652
- result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
7653
- for (;length > index; index++) {
7654
- value = mapping ? mapfn(O[index], index) : O[index];
7655
- createProperty(result, index, value);
7656
- }
7657
- }
7658
- result.length = index;
7659
- return result;
7660
- };
7530
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7531
+ addToUnscopables('includes');
7661
7532
 
7662
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
7663
- // eslint-disable-next-line es/no-array-from -- required for testing
7664
- Array.from(iterable);
7533
+ // `Array.isArray` method
7534
+ // https://tc39.es/ecma262/#sec-array.isarray
7535
+ _export({ target: 'Array', stat: true }, {
7536
+ isArray: isArray
7665
7537
  });
7666
7538
 
7667
- // `Array.from` method
7668
- // https://tc39.es/ecma262/#sec-array.from
7669
- _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
7670
- from: arrayFrom
7671
- });
7539
+ var $find = arrayIteration.find;
7672
7540
 
7673
- var MATCH$1 = wellKnownSymbol('match');
7674
7541
 
7675
- // `IsRegExp` abstract operation
7676
- // https://tc39.es/ecma262/#sec-isregexp
7677
- var isRegexp = function (it) {
7678
- var isRegExp;
7679
- return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) === 'RegExp');
7680
- };
7542
+ var FIND = 'find';
7543
+ var SKIPS_HOLES = true;
7681
7544
 
7682
- var $TypeError$1 = TypeError;
7545
+ // Shouldn't skip holes
7546
+ // eslint-disable-next-line es/no-array-prototype-find -- testing
7547
+ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
7683
7548
 
7684
- var notARegexp = function (it) {
7685
- if (isRegexp(it)) {
7686
- throw new $TypeError$1("The method doesn't accept regular expressions");
7687
- } return it;
7688
- };
7549
+ // `Array.prototype.find` method
7550
+ // https://tc39.es/ecma262/#sec-array.prototype.find
7551
+ _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
7552
+ find: function find(callbackfn /* , that = undefined */) {
7553
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
7554
+ }
7555
+ });
7689
7556
 
7690
- var MATCH = wellKnownSymbol('match');
7557
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7558
+ addToUnscopables(FIND);
7691
7559
 
7692
- var correctIsRegexpLogic = function (METHOD_NAME) {
7693
- var regexp = /./;
7694
- try {
7695
- '/./'[METHOD_NAME](regexp);
7696
- } catch (error1) {
7697
- try {
7698
- regexp[MATCH] = false;
7699
- return '/./'[METHOD_NAME](regexp);
7700
- } catch (error2) { /* empty */ }
7701
- } return false;
7702
- };
7560
+ var $every = arrayIteration.every;
7703
7561
 
7704
- var stringIndexOf$1 = functionUncurryThis(''.indexOf);
7705
7562
 
7706
- // `String.prototype.includes` method
7707
- // https://tc39.es/ecma262/#sec-string.prototype.includes
7708
- _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
7709
- includes: function includes(searchString /* , position = 0 */) {
7710
- return !!~stringIndexOf$1(
7711
- toString$1(requireObjectCoercible(this)),
7712
- toString$1(notARegexp(searchString)),
7713
- arguments.length > 1 ? arguments[1] : undefined
7714
- );
7563
+ var STRICT_METHOD$1 = arrayMethodIsStrict('every');
7564
+
7565
+ // `Array.prototype.every` method
7566
+ // https://tc39.es/ecma262/#sec-array.prototype.every
7567
+ _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, {
7568
+ every: function every(callbackfn /* , thisArg */) {
7569
+ return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
7715
7570
  }
7716
7571
  });
7717
7572
 
7718
- var $values = objectToArray.values;
7573
+ var $TypeError$3 = TypeError;
7574
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
7575
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
7719
7576
 
7720
- // `Object.values` method
7721
- // https://tc39.es/ecma262/#sec-object.values
7722
- _export({ target: 'Object', stat: true }, {
7723
- values: function values(O) {
7724
- return $values(O);
7577
+ // Safari < 13 does not throw an error in this case
7578
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = descriptors && !function () {
7579
+ // makes no sense without proper strict mode support
7580
+ if (this !== undefined) return true;
7581
+ try {
7582
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
7583
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
7584
+ } catch (error) {
7585
+ return error instanceof TypeError;
7725
7586
  }
7726
- });
7587
+ }();
7727
7588
 
7728
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
7729
- var $RegExp$2 = global$1.RegExp;
7589
+ var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
7590
+ if (isArray(O) && !getOwnPropertyDescriptor$2(O, 'length').writable) {
7591
+ throw new $TypeError$3('Cannot set read only .length');
7592
+ } return O.length = length;
7593
+ } : function (O, length) {
7594
+ return O.length = length;
7595
+ };
7730
7596
 
7731
- var UNSUPPORTED_Y$2 = fails(function () {
7732
- var re = $RegExp$2('a', 'y');
7733
- re.lastIndex = 2;
7734
- return re.exec('abcd') !== null;
7735
- });
7597
+ var $TypeError$2 = TypeError;
7598
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
7736
7599
 
7737
- // UC Browser bug
7738
- // https://github.com/zloirock/core-js/issues/1008
7739
- var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
7740
- return !$RegExp$2('a', 'y').sticky;
7741
- });
7600
+ var doesNotExceedSafeInteger = function (it) {
7601
+ if (it > MAX_SAFE_INTEGER) throw $TypeError$2('Maximum allowed index exceeded');
7602
+ return it;
7603
+ };
7742
7604
 
7743
- var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
7744
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
7745
- var re = $RegExp$2('^r', 'gy');
7746
- re.lastIndex = 2;
7747
- return re.exec('str') !== null;
7748
- });
7605
+ var $TypeError$1 = TypeError;
7749
7606
 
7750
- var regexpStickyHelpers = {
7751
- BROKEN_CARET: BROKEN_CARET,
7752
- MISSED_STICKY: MISSED_STICKY,
7753
- UNSUPPORTED_Y: UNSUPPORTED_Y$2
7607
+ var deletePropertyOrThrow = function (O, P) {
7608
+ if (!delete O[P]) throw new $TypeError$1('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
7754
7609
  };
7755
7610
 
7756
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
7757
- var $RegExp$1 = global$1.RegExp;
7611
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
7758
7612
 
7759
- var regexpUnsupportedDotAll = fails(function () {
7760
- var re = $RegExp$1('.', 's');
7761
- return !(re.dotAll && re.test('\n') && re.flags === 's');
7613
+ var max$1 = Math.max;
7614
+ var min$1 = Math.min;
7615
+
7616
+ // `Array.prototype.splice` method
7617
+ // https://tc39.es/ecma262/#sec-array.prototype.splice
7618
+ // with adding support of @@species
7619
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
7620
+ splice: function splice(start, deleteCount /* , ...items */) {
7621
+ var O = toObject(this);
7622
+ var len = lengthOfArrayLike(O);
7623
+ var actualStart = toAbsoluteIndex(start, len);
7624
+ var argumentsLength = arguments.length;
7625
+ var insertCount, actualDeleteCount, A, k, from, to;
7626
+ if (argumentsLength === 0) {
7627
+ insertCount = actualDeleteCount = 0;
7628
+ } else if (argumentsLength === 1) {
7629
+ insertCount = 0;
7630
+ actualDeleteCount = len - actualStart;
7631
+ } else {
7632
+ insertCount = argumentsLength - 2;
7633
+ actualDeleteCount = min$1(max$1(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
7634
+ }
7635
+ doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
7636
+ A = arraySpeciesCreate(O, actualDeleteCount);
7637
+ for (k = 0; k < actualDeleteCount; k++) {
7638
+ from = actualStart + k;
7639
+ if (from in O) createProperty(A, k, O[from]);
7640
+ }
7641
+ A.length = actualDeleteCount;
7642
+ if (insertCount < actualDeleteCount) {
7643
+ for (k = actualStart; k < len - actualDeleteCount; k++) {
7644
+ from = k + actualDeleteCount;
7645
+ to = k + insertCount;
7646
+ if (from in O) O[to] = O[from];
7647
+ else deletePropertyOrThrow(O, to);
7648
+ }
7649
+ for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
7650
+ } else if (insertCount > actualDeleteCount) {
7651
+ for (k = len - actualDeleteCount; k > actualStart; k--) {
7652
+ from = k + actualDeleteCount - 1;
7653
+ to = k + insertCount - 1;
7654
+ if (from in O) O[to] = O[from];
7655
+ else deletePropertyOrThrow(O, to);
7656
+ }
7657
+ }
7658
+ for (k = 0; k < insertCount; k++) {
7659
+ O[k + actualStart] = arguments[k + 2];
7660
+ }
7661
+ arraySetLength(O, len - actualDeleteCount + insertCount);
7662
+ return A;
7663
+ }
7762
7664
  });
7763
7665
 
7764
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
7765
- var $RegExp = global$1.RegExp;
7666
+ var $TypeError = TypeError;
7766
7667
 
7767
- var regexpUnsupportedNcg = fails(function () {
7768
- var re = $RegExp('(?<a>b)', 'g');
7769
- return re.exec('b').groups.a !== 'b' ||
7770
- 'b'.replace(re, '$<a>c') !== 'bc';
7771
- });
7668
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
7669
+ var createMethod = function (IS_RIGHT) {
7670
+ return function (that, callbackfn, argumentsLength, memo) {
7671
+ var O = toObject(that);
7672
+ var self = indexedObject(O);
7673
+ var length = lengthOfArrayLike(O);
7674
+ aCallable(callbackfn);
7675
+ var index = IS_RIGHT ? length - 1 : 0;
7676
+ var i = IS_RIGHT ? -1 : 1;
7677
+ if (argumentsLength < 2) while (true) {
7678
+ if (index in self) {
7679
+ memo = self[index];
7680
+ index += i;
7681
+ break;
7682
+ }
7683
+ index += i;
7684
+ if (IS_RIGHT ? index < 0 : length <= index) {
7685
+ throw new $TypeError('Reduce of empty array with no initial value');
7686
+ }
7687
+ }
7688
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
7689
+ memo = callbackfn(memo, self[index], index, O);
7690
+ }
7691
+ return memo;
7692
+ };
7693
+ };
7772
7694
 
7773
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
7774
- /* eslint-disable regexp/no-useless-quantifier -- testing */
7695
+ var arrayReduce = {
7696
+ // `Array.prototype.reduce` method
7697
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
7698
+ left: createMethod(false),
7699
+ // `Array.prototype.reduceRight` method
7700
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
7701
+ right: createMethod(true)
7702
+ };
7775
7703
 
7704
+ var $reduce = arrayReduce.left;
7776
7705
 
7777
7706
 
7778
7707
 
7779
7708
 
7709
+ // Chrome 80-82 has a critical bug
7710
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
7711
+ var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
7712
+ var FORCED$5 = CHROME_BUG || !arrayMethodIsStrict('reduce');
7780
7713
 
7714
+ // `Array.prototype.reduce` method
7715
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
7716
+ _export({ target: 'Array', proto: true, forced: FORCED$5 }, {
7717
+ reduce: function reduce(callbackfn /* , initialValue */) {
7718
+ var length = arguments.length;
7719
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
7720
+ }
7721
+ });
7781
7722
 
7782
- var getInternalState = internalState.get;
7723
+ var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
7783
7724
 
7725
+ // We can't use this feature detection in V8 since it causes
7726
+ // deoptimization and serious performance degradation
7727
+ // https://github.com/zloirock/core-js/issues/679
7728
+ var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
7729
+ var array = [];
7730
+ array[IS_CONCAT_SPREADABLE] = false;
7731
+ return array.concat()[0] !== array;
7732
+ });
7784
7733
 
7734
+ var isConcatSpreadable = function (O) {
7735
+ if (!isObject(O)) return false;
7736
+ var spreadable = O[IS_CONCAT_SPREADABLE];
7737
+ return spreadable !== undefined ? !!spreadable : isArray(O);
7738
+ };
7785
7739
 
7786
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
7787
- var nativeExec = RegExp.prototype.exec;
7788
- var patchedExec = nativeExec;
7789
- var charAt$4 = functionUncurryThis(''.charAt);
7790
- var indexOf = functionUncurryThis(''.indexOf);
7791
- var replace$3 = functionUncurryThis(''.replace);
7792
- var stringSlice$5 = functionUncurryThis(''.slice);
7740
+ var FORCED$4 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');
7793
7741
 
7794
- var UPDATES_LAST_INDEX_WRONG = (function () {
7795
- var re1 = /a/;
7796
- var re2 = /b*/g;
7797
- functionCall(nativeExec, re1, 'a');
7798
- functionCall(nativeExec, re2, 'a');
7799
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
7800
- })();
7742
+ // `Array.prototype.concat` method
7743
+ // https://tc39.es/ecma262/#sec-array.prototype.concat
7744
+ // with adding support of @@isConcatSpreadable and @@species
7745
+ _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$4 }, {
7746
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
7747
+ concat: function concat(arg) {
7748
+ var O = toObject(this);
7749
+ var A = arraySpeciesCreate(O, 0);
7750
+ var n = 0;
7751
+ var i, k, length, len, E;
7752
+ for (i = -1, length = arguments.length; i < length; i++) {
7753
+ E = i === -1 ? O : arguments[i];
7754
+ if (isConcatSpreadable(E)) {
7755
+ len = lengthOfArrayLike(E);
7756
+ doesNotExceedSafeInteger(n + len);
7757
+ for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7758
+ } else {
7759
+ doesNotExceedSafeInteger(n + 1);
7760
+ createProperty(A, n++, E);
7761
+ }
7762
+ }
7763
+ A.length = n;
7764
+ return A;
7765
+ }
7766
+ });
7801
7767
 
7802
- var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
7768
+ // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
7803
7769
 
7804
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
7805
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
7806
7770
 
7807
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
7771
+ var arrayBufferNonExtensible = fails(function () {
7772
+ if (typeof ArrayBuffer == 'function') {
7773
+ var buffer = new ArrayBuffer(8);
7774
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
7775
+ if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
7776
+ }
7777
+ });
7808
7778
 
7809
- if (PATCH) {
7810
- patchedExec = function exec(string) {
7811
- var re = this;
7812
- var state = getInternalState(re);
7813
- var str = toString$1(string);
7814
- var raw = state.raw;
7815
- var result, reCopy, lastIndex, match, i, object, group;
7779
+ // eslint-disable-next-line es/no-object-isextensible -- safe
7780
+ var $isExtensible = Object.isExtensible;
7781
+ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
7816
7782
 
7817
- if (raw) {
7818
- raw.lastIndex = re.lastIndex;
7819
- result = functionCall(patchedExec, raw, str);
7820
- re.lastIndex = raw.lastIndex;
7821
- return result;
7822
- }
7783
+ // `Object.isExtensible` method
7784
+ // https://tc39.es/ecma262/#sec-object.isextensible
7785
+ var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
7786
+ if (!isObject(it)) return false;
7787
+ if (arrayBufferNonExtensible && classofRaw(it) === 'ArrayBuffer') return false;
7788
+ return $isExtensible ? $isExtensible(it) : true;
7789
+ } : $isExtensible;
7823
7790
 
7824
- var groups = state.groups;
7825
- var sticky = UNSUPPORTED_Y$1 && re.sticky;
7826
- var flags = functionCall(regexpFlags, re);
7827
- var source = re.source;
7828
- var charsAdded = 0;
7829
- var strCopy = str;
7791
+ var freezing = !fails(function () {
7792
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
7793
+ return Object.isExtensible(Object.preventExtensions({}));
7794
+ });
7830
7795
 
7831
- if (sticky) {
7832
- flags = replace$3(flags, 'y', '');
7833
- if (indexOf(flags, 'g') === -1) {
7834
- flags += 'g';
7835
- }
7796
+ var internalMetadata = createCommonjsModule(function (module) {
7836
7797
 
7837
- strCopy = stringSlice$5(str, re.lastIndex);
7838
- // Support anchored sticky behavior.
7839
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
7840
- source = '(?: ' + source + ')';
7841
- strCopy = ' ' + strCopy;
7842
- charsAdded++;
7843
- }
7844
- // ^(? + rx + ) is needed, in combination with some str slicing, to
7845
- // simulate the 'y' flag.
7846
- reCopy = new RegExp('^(?:' + source + ')', flags);
7847
- }
7848
7798
 
7849
- if (NPCG_INCLUDED) {
7850
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
7851
- }
7852
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
7853
7799
 
7854
- match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
7855
7800
 
7856
- if (sticky) {
7857
- if (match) {
7858
- match.input = stringSlice$5(match.input, charsAdded);
7859
- match[0] = stringSlice$5(match[0], charsAdded);
7860
- match.index = re.lastIndex;
7861
- re.lastIndex += match[0].length;
7862
- } else re.lastIndex = 0;
7863
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
7864
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
7865
- }
7866
- if (NPCG_INCLUDED && match && match.length > 1) {
7867
- // Fix browsers whose `exec` methods don't consistently return `undefined`
7868
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
7869
- functionCall(nativeReplace, match[0], reCopy, function () {
7870
- for (i = 1; i < arguments.length - 2; i++) {
7871
- if (arguments[i] === undefined) match[i] = undefined;
7872
- }
7873
- });
7874
- }
7875
7801
 
7876
- if (match && groups) {
7877
- match.groups = object = objectCreate(null);
7878
- for (i = 0; i < groups.length; i++) {
7879
- group = groups[i];
7880
- object[group[0]] = match[group[1]];
7881
- }
7882
- }
7802
+ var defineProperty = objectDefineProperty.f;
7883
7803
 
7884
- return match;
7885
- };
7886
- }
7887
7804
 
7888
- var regexpExec = patchedExec;
7889
7805
 
7890
- // `RegExp.prototype.exec` method
7891
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
7892
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
7893
- exec: regexpExec
7894
- });
7895
-
7896
- // TODO: Remove from `core-js@4` since it's moved to entry points
7897
7806
 
7898
7807
 
7899
7808
 
7809
+ var REQUIRED = false;
7810
+ var METADATA = uid('meta');
7811
+ var id = 0;
7900
7812
 
7813
+ var setMetadata = function (it) {
7814
+ defineProperty(it, METADATA, { value: {
7815
+ objectID: 'O' + id++, // object ID
7816
+ weakData: {} // weak collections IDs
7817
+ } });
7818
+ };
7901
7819
 
7820
+ var fastKey = function (it, create) {
7821
+ // return a primitive with prefix
7822
+ if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
7823
+ if (!hasOwnProperty_1(it, METADATA)) {
7824
+ // can't set metadata to uncaught frozen object
7825
+ if (!objectIsExtensible(it)) return 'F';
7826
+ // not necessary to add metadata
7827
+ if (!create) return 'E';
7828
+ // add missing metadata
7829
+ setMetadata(it);
7830
+ // return object ID
7831
+ } return it[METADATA].objectID;
7832
+ };
7902
7833
 
7834
+ var getWeakData = function (it, create) {
7835
+ if (!hasOwnProperty_1(it, METADATA)) {
7836
+ // can't set metadata to uncaught frozen object
7837
+ if (!objectIsExtensible(it)) return true;
7838
+ // not necessary to add metadata
7839
+ if (!create) return false;
7840
+ // add missing metadata
7841
+ setMetadata(it);
7842
+ // return the store of weak collections IDs
7843
+ } return it[METADATA].weakData;
7844
+ };
7903
7845
 
7846
+ // add metadata on freeze-family methods calling
7847
+ var onFreeze = function (it) {
7848
+ if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
7849
+ return it;
7850
+ };
7904
7851
 
7905
- var SPECIES = wellKnownSymbol('species');
7906
- var RegExpPrototype = RegExp.prototype;
7852
+ var enable = function () {
7853
+ meta.enable = function () { /* empty */ };
7854
+ REQUIRED = true;
7855
+ var getOwnPropertyNames = objectGetOwnPropertyNames.f;
7856
+ var splice = functionUncurryThis([].splice);
7857
+ var test = {};
7858
+ test[METADATA] = 1;
7907
7859
 
7908
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
7909
- var SYMBOL = wellKnownSymbol(KEY);
7860
+ // prevent exposing of metadata key
7861
+ if (getOwnPropertyNames(test).length) {
7862
+ objectGetOwnPropertyNames.f = function (it) {
7863
+ var result = getOwnPropertyNames(it);
7864
+ for (var i = 0, length = result.length; i < length; i++) {
7865
+ if (result[i] === METADATA) {
7866
+ splice(result, i, 1);
7867
+ break;
7868
+ }
7869
+ } return result;
7870
+ };
7910
7871
 
7911
- var DELEGATES_TO_SYMBOL = !fails(function () {
7912
- // String methods call symbol-named RegEp methods
7913
- var O = {};
7914
- O[SYMBOL] = function () { return 7; };
7915
- return ''[KEY](O) !== 7;
7916
- });
7872
+ _export({ target: 'Object', stat: true, forced: true }, {
7873
+ getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
7874
+ });
7875
+ }
7876
+ };
7917
7877
 
7918
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
7919
- // Symbol-named RegExp methods call .exec
7920
- var execCalled = false;
7921
- var re = /a/;
7878
+ var meta = module.exports = {
7879
+ enable: enable,
7880
+ fastKey: fastKey,
7881
+ getWeakData: getWeakData,
7882
+ onFreeze: onFreeze
7883
+ };
7922
7884
 
7923
- if (KEY === 'split') {
7924
- // We can't use real regex here since it causes deoptimization
7925
- // and serious performance degradation in V8
7926
- // https://github.com/zloirock/core-js/issues/306
7927
- re = {};
7928
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
7929
- // a new one. We need to return the patched regex when creating the new one.
7930
- re.constructor = {};
7931
- re.constructor[SPECIES] = function () { return re; };
7932
- re.flags = '';
7933
- re[SYMBOL] = /./[SYMBOL];
7934
- }
7885
+ hiddenKeys$1[METADATA] = true;
7886
+ });
7935
7887
 
7936
- re.exec = function () {
7937
- execCalled = true;
7938
- return null;
7939
- };
7888
+ // makes subclassing work correct for wrapped built-ins
7889
+ var inheritIfRequired = function ($this, dummy, Wrapper) {
7890
+ var NewTarget, NewTargetPrototype;
7891
+ if (
7892
+ // it can work only with native `setPrototypeOf`
7893
+ objectSetPrototypeOf &&
7894
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
7895
+ isCallable(NewTarget = dummy.constructor) &&
7896
+ NewTarget !== Wrapper &&
7897
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
7898
+ NewTargetPrototype !== Wrapper.prototype
7899
+ ) objectSetPrototypeOf($this, NewTargetPrototype);
7900
+ return $this;
7901
+ };
7940
7902
 
7941
- re[SYMBOL]('');
7942
- return !execCalled;
7943
- });
7903
+ var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
7904
+ var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
7905
+ var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
7906
+ var ADDER = IS_MAP ? 'set' : 'add';
7907
+ var NativeConstructor = global$1[CONSTRUCTOR_NAME];
7908
+ var NativePrototype = NativeConstructor && NativeConstructor.prototype;
7909
+ var Constructor = NativeConstructor;
7910
+ var exported = {};
7944
7911
 
7945
- if (
7946
- !DELEGATES_TO_SYMBOL ||
7947
- !DELEGATES_TO_EXEC ||
7948
- FORCED
7949
- ) {
7950
- var uncurriedNativeRegExpMethod = functionUncurryThisClause(/./[SYMBOL]);
7951
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
7952
- var uncurriedNativeMethod = functionUncurryThisClause(nativeMethod);
7953
- var $exec = regexp.exec;
7954
- if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
7955
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
7956
- // The native String method already delegates to @@method (this
7957
- // polyfilled function), leasing to infinite recursion.
7958
- // We avoid it by directly calling the native @@method method.
7959
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
7960
- }
7961
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
7912
+ var fixMethod = function (KEY) {
7913
+ var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
7914
+ defineBuiltIn(NativePrototype, KEY,
7915
+ KEY === 'add' ? function add(value) {
7916
+ uncurriedNativeMethod(this, value === 0 ? 0 : value);
7917
+ return this;
7918
+ } : KEY === 'delete' ? function (key) {
7919
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7920
+ } : KEY === 'get' ? function get(key) {
7921
+ return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7922
+ } : KEY === 'has' ? function has(key) {
7923
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
7924
+ } : function set(key, value) {
7925
+ uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
7926
+ return this;
7962
7927
  }
7963
- return { done: false };
7928
+ );
7929
+ };
7930
+
7931
+ var REPLACE = isForced_1(
7932
+ CONSTRUCTOR_NAME,
7933
+ !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
7934
+ new NativeConstructor().entries().next();
7935
+ }))
7936
+ );
7937
+
7938
+ if (REPLACE) {
7939
+ // create collection constructor
7940
+ Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
7941
+ internalMetadata.enable();
7942
+ } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
7943
+ var instance = new Constructor();
7944
+ // early implementations not supports chaining
7945
+ var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
7946
+ // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
7947
+ var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
7948
+ // most early implementations doesn't supports iterables, most modern - not close it correctly
7949
+ // eslint-disable-next-line no-new -- required for testing
7950
+ var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
7951
+ // for early implementations -0 and +0 not the same
7952
+ var BUGGY_ZERO = !IS_WEAK && fails(function () {
7953
+ // V8 ~ Chromium 42- fails only with 5+ elements
7954
+ var $instance = new NativeConstructor();
7955
+ var index = 5;
7956
+ while (index--) $instance[ADDER](index, index);
7957
+ return !$instance.has(-0);
7964
7958
  });
7965
7959
 
7966
- defineBuiltIn(String.prototype, KEY, methods[0]);
7967
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
7960
+ if (!ACCEPT_ITERABLES) {
7961
+ Constructor = wrapper(function (dummy, iterable) {
7962
+ anInstance(dummy, NativePrototype);
7963
+ var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
7964
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
7965
+ return that;
7966
+ });
7967
+ Constructor.prototype = NativePrototype;
7968
+ NativePrototype.constructor = Constructor;
7969
+ }
7970
+
7971
+ if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
7972
+ fixMethod('delete');
7973
+ fixMethod('has');
7974
+ IS_MAP && fixMethod('get');
7975
+ }
7976
+
7977
+ if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
7978
+
7979
+ // weak collections should not contains .clear method
7980
+ if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
7968
7981
  }
7969
7982
 
7970
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
7971
- };
7983
+ exported[CONSTRUCTOR_NAME] = Constructor;
7984
+ _export({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
7972
7985
 
7973
- var charAt$3 = stringMultibyte.charAt;
7986
+ setToStringTag(Constructor, CONSTRUCTOR_NAME);
7974
7987
 
7975
- // `AdvanceStringIndex` abstract operation
7976
- // https://tc39.es/ecma262/#sec-advancestringindex
7977
- var advanceStringIndex = function (S, index, unicode) {
7978
- return index + (unicode ? charAt$3(S, index).length : 1);
7979
- };
7988
+ if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
7980
7989
 
7981
- var $TypeError = TypeError;
7990
+ return Constructor;
7991
+ };
7982
7992
 
7983
- // `RegExpExec` abstract operation
7984
- // https://tc39.es/ecma262/#sec-regexpexec
7985
- var regexpExecAbstract = function (R, S) {
7986
- var exec = R.exec;
7987
- if (isCallable(exec)) {
7988
- var result = functionCall(exec, R, S);
7989
- if (result !== null) anObject(result);
7990
- return result;
7991
- }
7992
- if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
7993
- throw new $TypeError('RegExp#exec called on incompatible receiver');
7993
+ var defineBuiltIns = function (target, src, options) {
7994
+ for (var key in src) defineBuiltIn(target, key, src[key], options);
7995
+ return target;
7994
7996
  };
7995
7997
 
7996
- var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
7997
- var MAX_UINT32 = 0xFFFFFFFF;
7998
- var min$1 = Math.min;
7999
- var $push = [].push;
8000
- var exec = functionUncurryThis(/./.exec);
8001
- var push$3 = functionUncurryThis($push);
8002
- var stringSlice$4 = functionUncurryThis(''.slice);
7998
+ var fastKey = internalMetadata.fastKey;
8003
7999
 
8004
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
8005
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
8006
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
8007
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
8008
- var re = /(?:)/;
8009
- var originalExec = re.exec;
8010
- re.exec = function () { return originalExec.apply(this, arguments); };
8011
- var result = 'ab'.split(re);
8012
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
8013
- });
8014
8000
 
8015
- // @@split logic
8016
- fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
8017
- var internalSplit;
8018
- if (
8019
- 'abbc'.split(/(b)*/)[1] === 'c' ||
8020
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
8021
- 'test'.split(/(?:)/, -1).length !== 4 ||
8022
- 'ab'.split(/(?:ab)*/).length !== 2 ||
8023
- '.'.split(/(.?)(.?)/).length !== 4 ||
8024
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
8025
- '.'.split(/()()/).length > 1 ||
8026
- ''.split(/.?/).length
8027
- ) {
8028
- // based on es5-shim implementation, need to rework it
8029
- internalSplit = function (separator, limit) {
8030
- var string = toString$1(requireObjectCoercible(this));
8031
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
8032
- if (lim === 0) return [];
8033
- if (separator === undefined) return [string];
8034
- // If `separator` is not a regex, use native split
8035
- if (!isRegexp(separator)) {
8036
- return functionCall(nativeSplit, string, separator, lim);
8001
+ var setInternalState$1 = internalState.set;
8002
+ var internalStateGetterFor = internalState.getterFor;
8003
+
8004
+ var collectionStrong = {
8005
+ getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
8006
+ var Constructor = wrapper(function (that, iterable) {
8007
+ anInstance(that, Prototype);
8008
+ setInternalState$1(that, {
8009
+ type: CONSTRUCTOR_NAME,
8010
+ index: objectCreate(null),
8011
+ first: undefined,
8012
+ last: undefined,
8013
+ size: 0
8014
+ });
8015
+ if (!descriptors) that.size = 0;
8016
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
8017
+ });
8018
+
8019
+ var Prototype = Constructor.prototype;
8020
+
8021
+ var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
8022
+
8023
+ var define = function (that, key, value) {
8024
+ var state = getInternalState(that);
8025
+ var entry = getEntry(that, key);
8026
+ var previous, index;
8027
+ // change existing entry
8028
+ if (entry) {
8029
+ entry.value = value;
8030
+ // create new entry
8031
+ } else {
8032
+ state.last = entry = {
8033
+ index: index = fastKey(key, true),
8034
+ key: key,
8035
+ value: value,
8036
+ previous: previous = state.last,
8037
+ next: undefined,
8038
+ removed: false
8039
+ };
8040
+ if (!state.first) state.first = entry;
8041
+ if (previous) previous.next = entry;
8042
+ if (descriptors) state.size++;
8043
+ else that.size++;
8044
+ // add to index
8045
+ if (index !== 'F') state.index[index] = entry;
8046
+ } return that;
8047
+ };
8048
+
8049
+ var getEntry = function (that, key) {
8050
+ var state = getInternalState(that);
8051
+ // fast case
8052
+ var index = fastKey(key);
8053
+ var entry;
8054
+ if (index !== 'F') return state.index[index];
8055
+ // frozen object case
8056
+ for (entry = state.first; entry; entry = entry.next) {
8057
+ if (entry.key === key) return entry;
8037
8058
  }
8038
- var output = [];
8039
- var flags = (separator.ignoreCase ? 'i' : '') +
8040
- (separator.multiline ? 'm' : '') +
8041
- (separator.unicode ? 'u' : '') +
8042
- (separator.sticky ? 'y' : '');
8043
- var lastLastIndex = 0;
8044
- // Make `global` and avoid `lastIndex` issues by working with a copy
8045
- var separatorCopy = new RegExp(separator.source, flags + 'g');
8046
- var match, lastIndex, lastLength;
8047
- while (match = functionCall(regexpExec, separatorCopy, string)) {
8048
- lastIndex = separatorCopy.lastIndex;
8049
- if (lastIndex > lastLastIndex) {
8050
- push$3(output, stringSlice$4(string, lastLastIndex, match.index));
8051
- if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
8052
- lastLength = match[0].length;
8053
- lastLastIndex = lastIndex;
8054
- if (output.length >= lim) break;
8059
+ };
8060
+
8061
+ defineBuiltIns(Prototype, {
8062
+ // `{ Map, Set }.prototype.clear()` methods
8063
+ // https://tc39.es/ecma262/#sec-map.prototype.clear
8064
+ // https://tc39.es/ecma262/#sec-set.prototype.clear
8065
+ clear: function clear() {
8066
+ var that = this;
8067
+ var state = getInternalState(that);
8068
+ var data = state.index;
8069
+ var entry = state.first;
8070
+ while (entry) {
8071
+ entry.removed = true;
8072
+ if (entry.previous) entry.previous = entry.previous.next = undefined;
8073
+ delete data[entry.index];
8074
+ entry = entry.next;
8055
8075
  }
8056
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
8076
+ state.first = state.last = undefined;
8077
+ if (descriptors) state.size = 0;
8078
+ else that.size = 0;
8079
+ },
8080
+ // `{ Map, Set }.prototype.delete(key)` methods
8081
+ // https://tc39.es/ecma262/#sec-map.prototype.delete
8082
+ // https://tc39.es/ecma262/#sec-set.prototype.delete
8083
+ 'delete': function (key) {
8084
+ var that = this;
8085
+ var state = getInternalState(that);
8086
+ var entry = getEntry(that, key);
8087
+ if (entry) {
8088
+ var next = entry.next;
8089
+ var prev = entry.previous;
8090
+ delete state.index[entry.index];
8091
+ entry.removed = true;
8092
+ if (prev) prev.next = next;
8093
+ if (next) next.previous = prev;
8094
+ if (state.first === entry) state.first = next;
8095
+ if (state.last === entry) state.last = prev;
8096
+ if (descriptors) state.size--;
8097
+ else that.size--;
8098
+ } return !!entry;
8099
+ },
8100
+ // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
8101
+ // https://tc39.es/ecma262/#sec-map.prototype.foreach
8102
+ // https://tc39.es/ecma262/#sec-set.prototype.foreach
8103
+ forEach: function forEach(callbackfn /* , that = undefined */) {
8104
+ var state = getInternalState(this);
8105
+ var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
8106
+ var entry;
8107
+ while (entry = entry ? entry.next : state.first) {
8108
+ boundFunction(entry.value, entry.key, this);
8109
+ // revert to the last existing entry
8110
+ while (entry && entry.removed) entry = entry.previous;
8111
+ }
8112
+ },
8113
+ // `{ Map, Set}.prototype.has(key)` methods
8114
+ // https://tc39.es/ecma262/#sec-map.prototype.has
8115
+ // https://tc39.es/ecma262/#sec-set.prototype.has
8116
+ has: function has(key) {
8117
+ return !!getEntry(this, key);
8057
8118
  }
8058
- if (lastLastIndex === string.length) {
8059
- if (lastLength || !exec(separatorCopy, '')) push$3(output, '');
8060
- } else push$3(output, stringSlice$4(string, lastLastIndex));
8061
- return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
8062
- };
8063
- // Chakra, V8
8064
- } else if ('0'.split(undefined, 0).length) {
8065
- internalSplit = function (separator, limit) {
8066
- return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
8067
- };
8068
- } else internalSplit = nativeSplit;
8119
+ });
8069
8120
 
8070
- return [
8071
- // `String.prototype.split` method
8072
- // https://tc39.es/ecma262/#sec-string.prototype.split
8073
- function split(separator, limit) {
8074
- var O = requireObjectCoercible(this);
8075
- var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
8076
- return splitter
8077
- ? functionCall(splitter, separator, O, limit)
8078
- : functionCall(internalSplit, toString$1(O), separator, limit);
8079
- },
8080
- // `RegExp.prototype[@@split]` method
8081
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
8082
- //
8083
- // NOTE: This cannot be properly polyfilled in engines that don't support
8084
- // the 'y' flag.
8085
- function (string, limit) {
8086
- var rx = anObject(this);
8087
- var S = toString$1(string);
8088
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
8121
+ defineBuiltIns(Prototype, IS_MAP ? {
8122
+ // `Map.prototype.get(key)` method
8123
+ // https://tc39.es/ecma262/#sec-map.prototype.get
8124
+ get: function get(key) {
8125
+ var entry = getEntry(this, key);
8126
+ return entry && entry.value;
8127
+ },
8128
+ // `Map.prototype.set(key, value)` method
8129
+ // https://tc39.es/ecma262/#sec-map.prototype.set
8130
+ set: function set(key, value) {
8131
+ return define(this, key === 0 ? 0 : key, value);
8132
+ }
8133
+ } : {
8134
+ // `Set.prototype.add(value)` method
8135
+ // https://tc39.es/ecma262/#sec-set.prototype.add
8136
+ add: function add(value) {
8137
+ return define(this, value = value === 0 ? 0 : value, value);
8138
+ }
8139
+ });
8140
+ if (descriptors) defineBuiltInAccessor(Prototype, 'size', {
8141
+ configurable: true,
8142
+ get: function () {
8143
+ return getInternalState(this).size;
8144
+ }
8145
+ });
8146
+ return Constructor;
8147
+ },
8148
+ setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
8149
+ var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
8150
+ var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
8151
+ var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
8152
+ // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
8153
+ // https://tc39.es/ecma262/#sec-map.prototype.entries
8154
+ // https://tc39.es/ecma262/#sec-map.prototype.keys
8155
+ // https://tc39.es/ecma262/#sec-map.prototype.values
8156
+ // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
8157
+ // https://tc39.es/ecma262/#sec-set.prototype.entries
8158
+ // https://tc39.es/ecma262/#sec-set.prototype.keys
8159
+ // https://tc39.es/ecma262/#sec-set.prototype.values
8160
+ // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
8161
+ iteratorDefine(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
8162
+ setInternalState$1(this, {
8163
+ type: ITERATOR_NAME,
8164
+ target: iterated,
8165
+ state: getInternalCollectionState(iterated),
8166
+ kind: kind,
8167
+ last: undefined
8168
+ });
8169
+ }, function () {
8170
+ var state = getInternalIteratorState(this);
8171
+ var kind = state.kind;
8172
+ var entry = state.last;
8173
+ // revert to the last existing entry
8174
+ while (entry && entry.removed) entry = entry.previous;
8175
+ // get next entry
8176
+ if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
8177
+ // or finish the iteration
8178
+ state.target = undefined;
8179
+ return createIterResultObject(undefined, true);
8180
+ }
8181
+ // return step by kind
8182
+ if (kind === 'keys') return createIterResultObject(entry.key, false);
8183
+ if (kind === 'values') return createIterResultObject(entry.value, false);
8184
+ return createIterResultObject([entry.key, entry.value], false);
8185
+ }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
8089
8186
 
8090
- if (res.done) return res.value;
8187
+ // `{ Map, Set }.prototype[@@species]` accessors
8188
+ // https://tc39.es/ecma262/#sec-get-map-@@species
8189
+ // https://tc39.es/ecma262/#sec-get-set-@@species
8190
+ setSpecies(CONSTRUCTOR_NAME);
8191
+ }
8192
+ };
8091
8193
 
8092
- var C = speciesConstructor(rx, RegExp);
8194
+ // `Set` constructor
8195
+ // https://tc39.es/ecma262/#sec-set-objects
8196
+ collection('Set', function (init) {
8197
+ return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
8198
+ }, collectionStrong);
8093
8199
 
8094
- var unicodeMatching = rx.unicode;
8095
- var flags = (rx.ignoreCase ? 'i' : '') +
8096
- (rx.multiline ? 'm' : '') +
8097
- (rx.unicode ? 'u' : '') +
8098
- (UNSUPPORTED_Y ? 'g' : 'y');
8200
+ // `Map` constructor
8201
+ // https://tc39.es/ecma262/#sec-map-objects
8202
+ collection('Map', function (init) {
8203
+ return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
8204
+ }, collectionStrong);
8099
8205
 
8100
- // ^(? + rx + ) is needed, in combination with some S slicing, to
8101
- // simulate the 'y' flag.
8102
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
8103
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
8104
- if (lim === 0) return [];
8105
- if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
8106
- var p = 0;
8107
- var q = 0;
8108
- var A = [];
8109
- while (q < S.length) {
8110
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
8111
- var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice$4(S, q) : S);
8112
- var e;
8113
- if (
8114
- z === null ||
8115
- (e = min$1(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
8116
- ) {
8117
- q = advanceStringIndex(S, q, unicodeMatching);
8118
- } else {
8119
- push$3(A, stringSlice$4(S, p, q));
8120
- if (A.length === lim) return A;
8121
- for (var i = 1; i <= z.length - 1; i++) {
8122
- push$3(A, z[i]);
8123
- if (A.length === lim) return A;
8124
- }
8125
- q = p = e;
8126
- }
8127
- }
8128
- push$3(A, stringSlice$4(S, p));
8129
- return A;
8206
+ // call something on iterator step with safe closing on error
8207
+ var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
8208
+ try {
8209
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
8210
+ } catch (error) {
8211
+ iteratorClose(iterator, 'throw', error);
8212
+ }
8213
+ };
8214
+
8215
+ var $Array = Array;
8216
+
8217
+ // `Array.from` method implementation
8218
+ // https://tc39.es/ecma262/#sec-array.from
8219
+ var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
8220
+ var O = toObject(arrayLike);
8221
+ var IS_CONSTRUCTOR = isConstructor(this);
8222
+ var argumentsLength = arguments.length;
8223
+ var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
8224
+ var mapping = mapfn !== undefined;
8225
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
8226
+ var iteratorMethod = getIteratorMethod(O);
8227
+ var index = 0;
8228
+ var length, result, step, iterator, next, value;
8229
+ // if the target is not iterable or it's an array with the default iterator - use a simple case
8230
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
8231
+ iterator = getIterator(O, iteratorMethod);
8232
+ next = iterator.next;
8233
+ result = IS_CONSTRUCTOR ? new this() : [];
8234
+ for (;!(step = functionCall(next, iterator)).done; index++) {
8235
+ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
8236
+ createProperty(result, index, value);
8130
8237
  }
8131
- ];
8132
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
8238
+ } else {
8239
+ length = lengthOfArrayLike(O);
8240
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
8241
+ for (;length > index; index++) {
8242
+ value = mapping ? mapfn(O[index], index) : O[index];
8243
+ createProperty(result, index, value);
8244
+ }
8245
+ }
8246
+ result.length = index;
8247
+ return result;
8248
+ };
8249
+
8250
+ var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
8251
+ // eslint-disable-next-line es/no-array-from -- required for testing
8252
+ Array.from(iterable);
8253
+ });
8254
+
8255
+ // `Array.from` method
8256
+ // https://tc39.es/ecma262/#sec-array.from
8257
+ _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
8258
+ from: arrayFrom
8259
+ });
8260
+
8261
+ var stringIndexOf$1 = functionUncurryThis(''.indexOf);
8262
+
8263
+ // `String.prototype.includes` method
8264
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
8265
+ _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
8266
+ includes: function includes(searchString /* , position = 0 */) {
8267
+ return !!~stringIndexOf$1(
8268
+ toString$1(requireObjectCoercible(this)),
8269
+ toString$1(notARegexp(searchString)),
8270
+ arguments.length > 1 ? arguments[1] : undefined
8271
+ );
8272
+ }
8273
+ });
8274
+
8275
+ var $values = objectToArray.values;
8276
+
8277
+ // `Object.values` method
8278
+ // https://tc39.es/ecma262/#sec-object.values
8279
+ _export({ target: 'Object', stat: true }, {
8280
+ values: function values(O) {
8281
+ return $values(O);
8282
+ }
8283
+ });
8133
8284
 
8134
8285
  var nativeJoin = functionUncurryThis([].join);
8135
8286
 
8136
8287
  var ES3_STRINGS = indexedObject !== Object;
8137
- var FORCED$4 = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
8288
+ var FORCED$3 = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
8138
8289
 
8139
8290
  // `Array.prototype.join` method
8140
8291
  // https://tc39.es/ecma262/#sec-array.prototype.join
8141
- _export({ target: 'Array', proto: true, forced: FORCED$4 }, {
8292
+ _export({ target: 'Array', proto: true, forced: FORCED$3 }, {
8142
8293
  join: function join(separator) {
8143
8294
  return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator);
8144
8295
  }
@@ -8194,36 +8345,6 @@
8194
8345
  // https://tc39.es/ecma262/#sec-thisnumbervalue
8195
8346
  var thisNumberValue = functionUncurryThis(1.0.valueOf);
8196
8347
 
8197
- // a string of all valid unicode whitespaces
8198
- var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
8199
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
8200
-
8201
- var replace$2 = functionUncurryThis(''.replace);
8202
- var ltrim = RegExp('^[' + whitespaces + ']+');
8203
- var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
8204
-
8205
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
8206
- var createMethod = function (TYPE) {
8207
- return function ($this) {
8208
- var string = toString$1(requireObjectCoercible($this));
8209
- if (TYPE & 1) string = replace$2(string, ltrim, '');
8210
- if (TYPE & 2) string = replace$2(string, rtrim, '$1');
8211
- return string;
8212
- };
8213
- };
8214
-
8215
- var stringTrim = {
8216
- // `String.prototype.{ trimLeft, trimStart }` methods
8217
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
8218
- start: createMethod(1),
8219
- // `String.prototype.{ trimRight, trimEnd }` methods
8220
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
8221
- end: createMethod(2),
8222
- // `String.prototype.trim` method
8223
- // https://tc39.es/ecma262/#sec-string.prototype.trim
8224
- trim: createMethod(3)
8225
- };
8226
-
8227
8348
  var getOwnPropertyNames = objectGetOwnPropertyNames.f;
8228
8349
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
8229
8350
  var defineProperty = objectDefineProperty.f;
@@ -8286,7 +8407,7 @@
8286
8407
  } return +it;
8287
8408
  };
8288
8409
 
8289
- var FORCED$3 = isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
8410
+ var FORCED$2 = isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
8290
8411
 
8291
8412
  var calledWithNew = function (dummy) {
8292
8413
  // includes check on 1..constructor(foo) case
@@ -8301,9 +8422,9 @@
8301
8422
  };
8302
8423
 
8303
8424
  NumberWrapper.prototype = NumberPrototype;
8304
- if (FORCED$3 && !isPure) NumberPrototype.constructor = NumberWrapper;
8425
+ if (FORCED$2 && !isPure) NumberPrototype.constructor = NumberWrapper;
8305
8426
 
8306
- _export({ global: true, constructor: true, wrap: true, forced: FORCED$3 }, {
8427
+ _export({ global: true, constructor: true, wrap: true, forced: FORCED$2 }, {
8307
8428
  Number: NumberWrapper
8308
8429
  });
8309
8430
 
@@ -8322,7 +8443,7 @@
8322
8443
  }
8323
8444
  }
8324
8445
  };
8325
- if (FORCED$3 || isPure) copyConstructorProperties(path$1[NUMBER], NativeNumber);
8446
+ if (FORCED$2 || isPure) copyConstructorProperties(path$1[NUMBER], NativeNumber);
8326
8447
 
8327
8448
  var trim = stringTrim.trim;
8328
8449
 
@@ -8331,13 +8452,13 @@
8331
8452
  var $parseFloat = global$1.parseFloat;
8332
8453
  var Symbol$1 = global$1.Symbol;
8333
8454
  var ITERATOR$2 = Symbol$1 && Symbol$1.iterator;
8334
- var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
8455
+ var FORCED$1 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
8335
8456
  // MS Edge 18- broken with boxed symbols
8336
8457
  || (ITERATOR$2 && !fails(function () { $parseFloat(Object(ITERATOR$2)); }));
8337
8458
 
8338
8459
  // `parseFloat` method
8339
8460
  // https://tc39.es/ecma262/#sec-parsefloat-string
8340
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
8461
+ var numberParseFloat = FORCED$1 ? function parseFloat(string) {
8341
8462
  var trimmedString = trim(toString$1(string));
8342
8463
  var result = $parseFloat(trimmedString);
8343
8464
  return result === 0 && charAt$2(trimmedString, 0) === '-' ? -0 : result;
@@ -8350,29 +8471,6 @@
8350
8471
  parseFloat: numberParseFloat
8351
8472
  });
8352
8473
 
8353
- /* eslint-disable es/no-array-prototype-indexof -- required for testing */
8354
-
8355
-
8356
- var $indexOf = arrayIncludes.indexOf;
8357
-
8358
-
8359
- var nativeIndexOf = functionUncurryThisClause([].indexOf);
8360
-
8361
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
8362
- var FORCED$1 = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
8363
-
8364
- // `Array.prototype.indexOf` method
8365
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
8366
- _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
8367
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
8368
- var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
8369
- return NEGATIVE_ZERO
8370
- // convert -0 to +0
8371
- ? nativeIndexOf(this, searchElement, fromIndex) || 0
8372
- : $indexOf(this, searchElement, fromIndex);
8373
- }
8374
- });
8375
-
8376
8474
  var PROPER_FUNCTION_NAME = functionName.PROPER;
8377
8475
 
8378
8476
 
@@ -9075,6 +9173,14 @@
9075
9173
  !function(t,n){module.exports=n();}(commonjsGlobal,(function(){var t="month",n="quarter";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf("day"):this.month(3*o+2).endOf(t).endOf("day")}return u.bind(this)(e,i)};}}));
9076
9174
  });
9077
9175
 
9176
+ var duration = createCommonjsModule(function (module, exports) {
9177
+ !function(t,s){module.exports=s();}(commonjsGlobal,(function(){var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,h=2592e6,a=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d={years:u,months:h,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof p},f=function(t,s,n){return new p(t,n,s.$l)},m=function(t){return s.p(t)+"s"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},g=function(t,s){return t?l(t)?{negative:!0,format:""+y(t)+s}:{negative:!1,format:""+t+s}:{negative:!1,format:""}},p=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*d[m(s)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s];})),this.calMilliseconds(),this;if("string"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*d[n]}),0);},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/h),t%=h,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t;},y.toISOString=function(){var t=g(this.$d.years,"Y"),s=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=g(n,"D"),e=g(this.$d.hours,"H"),r=g(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=g(o,"S"),h=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?"T":"",d=(h?"-":"")+"P"+t.format+s.format+i.format+a+e.format+r.format+u.format;return "P"===d||"-P"===d?"P0D":d},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/d[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return "milliseconds"===n?s%=1e3:s="weeks"===n?$(s/d[n]):this.$d[n],0===s?0:s},y.add=function(t,s,n){var i;return i=s?t*d[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},y.milliseconds=function(){return this.get("milliseconds")},y.asMilliseconds=function(){return this.as("milliseconds")},y.seconds=function(){return this.get("seconds")},y.asSeconds=function(){return this.as("seconds")},y.minutes=function(){return this.get("minutes")},y.asMinutes=function(){return this.as("minutes")},y.hours=function(){return this.get("hours")},y.asHours=function(){return this.as("hours")},y.days=function(){return this.get("days")},y.asDays=function(){return this.as("days")},y.weeks=function(){return this.get("weeks")},y.asWeeks=function(){return this.as("weeks")},y.months=function(){return this.get("months")},y.asMonths=function(){return this.as("months")},y.years=function(){return this.get("years")},y.asYears=function(){return this.as("years")},l}();return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)&&(t=t.asMilliseconds()),r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)&&(t=t.asMilliseconds()),o.bind(this)(t,s)};}}));
9178
+ });
9179
+
9180
+ var isoWeek = createCommonjsModule(function (module, exports) {
9181
+ !function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="day";return function(t,i,s){var a=function(t){return t.add(4-t.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return "isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t)};}}));
9182
+ });
9183
+
9078
9184
  var en = createCommonjsModule(function (module, exports) {
9079
9185
  !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")}}));
9080
9186
  });
@@ -9978,13 +10084,209 @@
9978
10084
  _excluded4 = ["title", "shortTitle"];
9979
10085
  function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9980
10086
  function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10087
+ dayjs_min.extend(quarterOfYear);
10088
+ dayjs_min.extend(duration);
10089
+ dayjs_min.extend(isoWeek);
9981
10090
  var DEFAULT_GRANULARITY = 'day';
9982
- function removeEmptyQueryFields(_query) {
9983
- var query = _query || {};
9984
- return fromPairs(toPairs(query).map(function (_ref) {
10091
+
10092
+ // When granularity is week, weekStart Value must be 1. However, since the client can change it globally
10093
+ // (https://day.js.org/docs/en/i18n/changing-locale) So the function below has been added.
10094
+ var internalDayjs = function internalDayjs() {
10095
+ return dayjs_min.apply(void 0, arguments).locale(_objectSpread$7(_objectSpread$7({}, en), {}, {
10096
+ weekStart: 1
10097
+ }));
10098
+ };
10099
+ var TIME_SERIES = {
10100
+ day: function day(range) {
10101
+ return range.by('d').map(function (d) {
10102
+ return d.format('YYYY-MM-DDT00:00:00.000');
10103
+ });
10104
+ },
10105
+ month: function month(range) {
10106
+ return range.snapTo('month').by('M').map(function (d) {
10107
+ return d.format('YYYY-MM-01T00:00:00.000');
10108
+ });
10109
+ },
10110
+ year: function year(range) {
10111
+ return range.snapTo('year').by('y').map(function (d) {
10112
+ return d.format('YYYY-01-01T00:00:00.000');
10113
+ });
10114
+ },
10115
+ hour: function hour(range) {
10116
+ return range.by('h').map(function (d) {
10117
+ return d.format('YYYY-MM-DDTHH:00:00.000');
10118
+ });
10119
+ },
10120
+ minute: function minute(range) {
10121
+ return range.by('m').map(function (d) {
10122
+ return d.format('YYYY-MM-DDTHH:mm:00.000');
10123
+ });
10124
+ },
10125
+ second: function second(range) {
10126
+ return range.by('s').map(function (d) {
10127
+ return d.format('YYYY-MM-DDTHH:mm:ss.000');
10128
+ });
10129
+ },
10130
+ week: function week(range) {
10131
+ return range.snapTo('week').by('w').map(function (d) {
10132
+ return d.startOf('week').format('YYYY-MM-DDT00:00:00.000');
10133
+ });
10134
+ },
10135
+ quarter: function quarter(range) {
10136
+ return range.snapTo('quarter').by('quarter').map(function (d) {
10137
+ return d.startOf('quarter').format('YYYY-MM-DDT00:00:00.000');
10138
+ });
10139
+ }
10140
+ };
10141
+ var isPredefinedGranularity = function isPredefinedGranularity(granularity) {
10142
+ return !!TIME_SERIES[granularity];
10143
+ };
10144
+ var DateRegex = /^\d\d\d\d-\d\d-\d\d$/;
10145
+ var LocalDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;
10146
+ var dayRange = function dayRange(from, to) {
10147
+ return {
10148
+ by: function by(value) {
10149
+ var results = [];
10150
+ var start = internalDayjs(from);
10151
+ var end = internalDayjs(to);
10152
+ while (start.isBefore(end) || start.isSame(end)) {
10153
+ results.push(start);
10154
+ start = start.add(1, value);
10155
+ }
10156
+ return results;
10157
+ },
10158
+ snapTo: function snapTo(value) {
10159
+ return dayRange(internalDayjs(from).startOf(value), internalDayjs(to).endOf(value));
10160
+ },
10161
+ start: internalDayjs(from),
10162
+ end: internalDayjs(to)
10163
+ };
10164
+ };
10165
+
10166
+ /**
10167
+ * Parse PostgreSQL-like interval string into object
10168
+ * E.g. '2 years 15 months 100 weeks 99 hours 15 seconds'
10169
+ * Negative units are also supported
10170
+ * E.g. '-2 months 5 days -10 hours'
10171
+ *
10172
+ * TODO: It's copy/paste of parseSqlInterval from @cubejs-backend/shared [time.ts]
10173
+ * It's not referenced to omit imports of moment.js staff.
10174
+ * Probably one day we should choose one implementation and reuse it in other places.
10175
+ */
10176
+ function parseSqlInterval(intervalStr) {
10177
+ var interval = {};
10178
+ var parts = intervalStr.split(/\s+/);
10179
+ for (var i = 0; i < parts.length; i += 2) {
10180
+ var value = parseInt(parts[i], 10);
10181
+ var unit = parts[i + 1];
10182
+
10183
+ // Remove ending 's' (e.g., 'days' -> 'day')
10184
+ var singularUnit = unit.endsWith('s') ? unit.slice(0, -1) : unit;
10185
+ interval[singularUnit] = value;
10186
+ }
10187
+ return interval;
10188
+ }
10189
+
10190
+ /**
10191
+ * Adds interval to provided date.
10192
+ * TODO: It's copy/paste of addInterval from @cubejs-backend/shared [time.ts]
10193
+ * but operates with dayjs instead of moment.js
10194
+ * @param {dayjs} date
10195
+ * @param interval
10196
+ * @returns {dayjs}
10197
+ */
10198
+ function addInterval(date, interval) {
10199
+ var res = date.clone();
10200
+ Object.entries(interval).forEach(function (_ref) {
9985
10201
  var _ref2 = _slicedToArray(_ref, 2),
9986
10202
  key = _ref2[0],
9987
10203
  value = _ref2[1];
10204
+ res = res.add(value, key);
10205
+ });
10206
+ return res;
10207
+ }
10208
+
10209
+ /**
10210
+ * Adds interval to provided date.
10211
+ * TODO: It's copy/paste of subtractInterval from @cubejs-backend/shared [time.ts]
10212
+ * but operates with dayjs instead of moment.js
10213
+ * @param {dayjs} date
10214
+ * @param interval
10215
+ * @returns {dayjs}
10216
+ */
10217
+ function subtractInterval(date, interval) {
10218
+ var res = date.clone();
10219
+ Object.entries(interval).forEach(function (_ref3) {
10220
+ var _ref4 = _slicedToArray(_ref3, 2),
10221
+ key = _ref4[0],
10222
+ value = _ref4[1];
10223
+ res = res.subtract(value, key);
10224
+ });
10225
+ return res;
10226
+ }
10227
+
10228
+ /**
10229
+ * Returns the closest date prior to date parameter aligned with the origin point
10230
+ * TODO: It's copy/paste of alignToOrigin from @cubejs-backend/shared [time.ts]
10231
+ * but operates with dayjs instead of moment.js
10232
+ */
10233
+ function alignToOrigin(startDate, interval, origin) {
10234
+ var alignedDate = startDate.clone();
10235
+ var intervalOp;
10236
+ var isIntervalNegative = false;
10237
+ var offsetDate = addInterval(origin, interval);
10238
+
10239
+ // The easiest way to check the interval sign
10240
+ if (offsetDate.isBefore(origin)) {
10241
+ isIntervalNegative = true;
10242
+ }
10243
+ offsetDate = origin.clone();
10244
+ if (startDate.isBefore(origin)) {
10245
+ intervalOp = isIntervalNegative ? addInterval : subtractInterval;
10246
+ while (offsetDate.isAfter(startDate)) {
10247
+ offsetDate = intervalOp(offsetDate, interval);
10248
+ }
10249
+ alignedDate = offsetDate;
10250
+ } else {
10251
+ intervalOp = isIntervalNegative ? subtractInterval : addInterval;
10252
+ while (offsetDate.isBefore(startDate)) {
10253
+ alignedDate = offsetDate.clone();
10254
+ offsetDate = intervalOp(offsetDate, interval);
10255
+ }
10256
+ if (offsetDate.isSame(startDate)) {
10257
+ alignedDate = offsetDate;
10258
+ }
10259
+ }
10260
+ return alignedDate;
10261
+ }
10262
+
10263
+ /**
10264
+ * Returns the time series points for the custom interval
10265
+ * TODO: It's almost a copy/paste of timeSeriesFromCustomInterval from
10266
+ * @cubejs-backend/shared [time.ts] but operates with dayjs instead of moment.js
10267
+ */
10268
+ var timeSeriesFromCustomInterval = function timeSeriesFromCustomInterval(from, to, granularity) {
10269
+ var intervalParsed = parseSqlInterval(granularity.interval);
10270
+ var start = internalDayjs(from);
10271
+ var end = internalDayjs(to);
10272
+ var origin = granularity.origin ? internalDayjs(granularity.origin) : internalDayjs().startOf('year');
10273
+ if (granularity.offset) {
10274
+ origin = addInterval(origin, parseSqlInterval(granularity.offset));
10275
+ }
10276
+ var alignedStart = alignToOrigin(start, intervalParsed, origin);
10277
+ var dates = [];
10278
+ while (alignedStart.isBefore(end) || alignedStart.isSame(end)) {
10279
+ dates.push(alignedStart.format('YYYY-MM-DDTHH:mm:ss.000'));
10280
+ alignedStart = addInterval(alignedStart, intervalParsed);
10281
+ }
10282
+ return dates;
10283
+ };
10284
+ function removeEmptyQueryFields(_query) {
10285
+ var query = _query || {};
10286
+ return fromPairs(toPairs(query).map(function (_ref5) {
10287
+ var _ref6 = _slicedToArray(_ref5, 2),
10288
+ key = _ref6[0],
10289
+ value = _ref6[1];
9988
10290
  if (['measures', 'dimensions', 'segments', 'timeDimensions', 'filters'].includes(key)) {
9989
10291
  if (Array.isArray(value) && value.length === 0) {
9990
10292
  return null;
@@ -10055,9 +10357,9 @@
10055
10357
  });
10056
10358
  }
10057
10359
  if ((oldQuery.measures || []).length === 0 && (newQuery.measures || []).length > 0 || (oldQuery.measures || []).length === 1 && (newQuery.measures || []).length === 1 && oldQuery.measures[0] !== newQuery.measures[0]) {
10058
- var _ref6 = newQuery.timeDimensions || [],
10059
- _ref7 = _slicedToArray(_ref6, 1),
10060
- td = _ref7[0];
10360
+ var _ref10 = newQuery.timeDimensions || [],
10361
+ _ref11 = _slicedToArray(_ref10, 1),
10362
+ td = _ref11[0];
10061
10363
  var defaultTimeDimension = meta.defaultTimeDimensionNameFor(newQuery.measures[0]);
10062
10364
  newQuery = _objectSpread$7(_objectSpread$7({}, newQuery), {}, {
10063
10365
  timeDimensions: defaultTimeDimension ? [{
@@ -10218,59 +10520,6 @@
10218
10520
  }
10219
10521
  return nonNullValues;
10220
10522
  }
10221
- dayjs_min.extend(quarterOfYear);
10222
-
10223
- // When granularity is week, weekStart Value must be 1. However, since the client can change it globally (https://day.js.org/docs/en/i18n/changing-locale)
10224
- // So the function below has been added.
10225
- var internalDayjs = function internalDayjs() {
10226
- return dayjs_min.apply(void 0, arguments).locale(_objectSpread$7(_objectSpread$7({}, en), {}, {
10227
- weekStart: 1
10228
- }));
10229
- };
10230
- var TIME_SERIES = {
10231
- day: function day(range) {
10232
- return range.by('d').map(function (d) {
10233
- return d.format('YYYY-MM-DDT00:00:00.000');
10234
- });
10235
- },
10236
- month: function month(range) {
10237
- return range.snapTo('month').by('M').map(function (d) {
10238
- return d.format('YYYY-MM-01T00:00:00.000');
10239
- });
10240
- },
10241
- year: function year(range) {
10242
- return range.snapTo('year').by('y').map(function (d) {
10243
- return d.format('YYYY-01-01T00:00:00.000');
10244
- });
10245
- },
10246
- hour: function hour(range) {
10247
- return range.by('h').map(function (d) {
10248
- return d.format('YYYY-MM-DDTHH:00:00.000');
10249
- });
10250
- },
10251
- minute: function minute(range) {
10252
- return range.by('m').map(function (d) {
10253
- return d.format('YYYY-MM-DDTHH:mm:00.000');
10254
- });
10255
- },
10256
- second: function second(range) {
10257
- return range.by('s').map(function (d) {
10258
- return d.format('YYYY-MM-DDTHH:mm:ss.000');
10259
- });
10260
- },
10261
- week: function week(range) {
10262
- return range.snapTo('week').by('w').map(function (d) {
10263
- return d.startOf('week').format('YYYY-MM-DDT00:00:00.000');
10264
- });
10265
- },
10266
- quarter: function quarter(range) {
10267
- return range.snapTo('quarter').by('quarter').map(function (d) {
10268
- return d.startOf('quarter').format('YYYY-MM-DDT00:00:00.000');
10269
- });
10270
- }
10271
- };
10272
- var DateRegex = /^\d\d\d\d-\d\d-\d\d$/;
10273
- var LocalDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;
10274
10523
  var groupByToPairs = function groupByToPairs(keyFn) {
10275
10524
  var acc = new Map();
10276
10525
  return function (data) {
@@ -10293,25 +10542,6 @@
10293
10542
  });
10294
10543
  return res;
10295
10544
  };
10296
- var dayRange = function dayRange(from, to) {
10297
- return {
10298
- by: function by(value) {
10299
- var results = [];
10300
- var start = internalDayjs(from);
10301
- var end = internalDayjs(to);
10302
- while (start.isBefore(end) || start.isSame(end)) {
10303
- results.push(start);
10304
- start = start.add(1, value);
10305
- }
10306
- return results;
10307
- },
10308
- snapTo: function snapTo(value) {
10309
- return dayRange(internalDayjs(from).startOf(value), internalDayjs(to).endOf(value));
10310
- },
10311
- start: internalDayjs(from),
10312
- end: internalDayjs(to)
10313
- };
10314
- };
10315
10545
  var QUERY_TYPE = {
10316
10546
  REGULAR_QUERY: 'regularQuery',
10317
10547
  COMPARE_DATE_RANGE_QUERY: 'compareDateRangeQuery',
@@ -10367,13 +10597,13 @@
10367
10597
  _this$query$segments = _this$query.segments,
10368
10598
  segments = _this$query$segments === void 0 ? [] : _this$query$segments;
10369
10599
  var measures = this.loadResponses[0].annotation.measures;
10370
- var _ref10 = values.find(function (_ref12) {
10371
- var _ref13 = _slicedToArray(_ref12, 1),
10372
- member = _ref13[0];
10600
+ var _ref14 = values.find(function (_ref16) {
10601
+ var _ref17 = _slicedToArray(_ref16, 1),
10602
+ member = _ref17[0];
10373
10603
  return member === 'measures';
10374
10604
  }) || [],
10375
- _ref11 = _slicedToArray(_ref10, 2),
10376
- measureName = _ref11[1];
10605
+ _ref15 = _slicedToArray(_ref14, 2),
10606
+ measureName = _ref15[1];
10377
10607
  if (measureName === undefined) {
10378
10608
  var _Object$keys = Object.keys(measures);
10379
10609
  var _Object$keys2 = _slicedToArray(_Object$keys, 1);
@@ -10387,14 +10617,14 @@
10387
10617
  operator: 'measureFilter'
10388
10618
  }].concat(_toConsumableArray(parentFilters));
10389
10619
  var timeDimensions = [];
10390
- values.filter(function (_ref14) {
10391
- var _ref15 = _slicedToArray(_ref14, 1),
10392
- member = _ref15[0];
10620
+ values.filter(function (_ref18) {
10621
+ var _ref19 = _slicedToArray(_ref18, 1),
10622
+ member = _ref19[0];
10393
10623
  return member !== 'measures';
10394
- }).forEach(function (_ref16) {
10395
- var _ref17 = _slicedToArray(_ref16, 2),
10396
- member = _ref17[0],
10397
- value = _ref17[1];
10624
+ }).forEach(function (_ref20) {
10625
+ var _ref21 = _slicedToArray(_ref20, 2),
10626
+ member = _ref21[0],
10627
+ value = _ref21[1];
10398
10628
  var _member$split = member.split('.'),
10399
10629
  _member$split2 = _slicedToArray(_member$split, 3),
10400
10630
  cubeName = _member$split2[0],
@@ -10448,17 +10678,17 @@
10448
10678
  key: "series",
10449
10679
  value: function series(pivotConfig) {
10450
10680
  var _this = this;
10451
- return this.seriesNames(pivotConfig).map(function (_ref18) {
10452
- var title = _ref18.title,
10453
- shortTitle = _ref18.shortTitle,
10454
- key = _ref18.key;
10681
+ return this.seriesNames(pivotConfig).map(function (_ref22) {
10682
+ var title = _ref22.title,
10683
+ shortTitle = _ref22.shortTitle,
10684
+ key = _ref22.key;
10455
10685
  return {
10456
10686
  title: title,
10457
10687
  shortTitle: shortTitle,
10458
10688
  key: key,
10459
- series: _this.chartPivot(pivotConfig).map(function (_ref19) {
10460
- var x = _ref19.x,
10461
- obj = _objectWithoutProperties(_ref19, _excluded2);
10689
+ series: _this.chartPivot(pivotConfig).map(function (_ref23) {
10690
+ var x = _ref23.x,
10691
+ obj = _objectWithoutProperties(_ref23, _excluded2);
10462
10692
  return {
10463
10693
  value: obj[key],
10464
10694
  x: x
@@ -10509,7 +10739,7 @@
10509
10739
  }
10510
10740
  }, {
10511
10741
  key: "timeSeries",
10512
- value: function timeSeries(timeDimension, resultIndex) {
10742
+ value: function timeSeries(timeDimension, resultIndex, annotations) {
10513
10743
  if (!timeDimension.granularity) {
10514
10744
  return null;
10515
10745
  }
@@ -10536,10 +10766,13 @@
10536
10766
  start = _dateRange2[0],
10537
10767
  end = _dateRange2[1];
10538
10768
  var range = dayRange(start, end);
10539
- if (!TIME_SERIES[timeDimension.granularity]) {
10540
- throw new Error("Unsupported time granularity: ".concat(timeDimension.granularity));
10769
+ if (isPredefinedGranularity(timeDimension.granularity)) {
10770
+ return TIME_SERIES[timeDimension.granularity](padToDay ? range.snapTo('d') : range);
10771
+ }
10772
+ if (!annotations["".concat(timeDimension.dimension, ".").concat(timeDimension.granularity)]) {
10773
+ throw new Error("Granularity \"".concat(timeDimension.granularity, "\" not found in time dimension \"").concat(timeDimension.dimension, "\""));
10541
10774
  }
10542
- return TIME_SERIES[timeDimension.granularity](padToDay ? range.snapTo('d') : range);
10775
+ return timeSeriesFromCustomInterval(start, end, annotations["".concat(timeDimension.dimension, ".").concat(timeDimension.granularity)].granularity);
10543
10776
  }
10544
10777
  }, {
10545
10778
  key: "pivot",
@@ -10549,8 +10782,8 @@
10549
10782
  var query = this.loadResponse.pivotQuery;
10550
10783
  var pivotImpl = function pivotImpl() {
10551
10784
  var resultIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
10552
- var groupByXAxis = groupByToPairs(function (_ref20) {
10553
- var xValues = _ref20.xValues;
10785
+ var groupByXAxis = groupByToPairs(function (_ref24) {
10786
+ var xValues = _ref24.xValues;
10554
10787
  return _this2.axisValuesString(xValues);
10555
10788
  });
10556
10789
  var measureValue = function measureValue(row, measure) {
@@ -10562,12 +10795,12 @@
10562
10795
  return ResultSet.timeDimensionMember(td);
10563
10796
  }))) {
10564
10797
  var series = _this2.loadResponses.map(function (loadResponse) {
10565
- return _this2.timeSeries(loadResponse.query.timeDimensions[0], resultIndex);
10798
+ return _this2.timeSeries(loadResponse.query.timeDimensions[0], resultIndex, loadResponse.annotation.timeDimensions);
10566
10799
  });
10567
10800
  if (series[0]) {
10568
10801
  groupByXAxis = function groupByXAxis(rows) {
10569
- var byXValues = groupBy(function (_ref21) {
10570
- var xValues = _ref21.xValues;
10802
+ var byXValues = groupBy(function (_ref25) {
10803
+ var xValues = _ref25.xValues;
10571
10804
  return xValues[0];
10572
10805
  }, rows);
10573
10806
  return series[resultIndex].map(function (d) {
@@ -10588,11 +10821,11 @@
10588
10821
  });
10589
10822
  }), unnest, groupByXAxis)(_this2.timeDimensionBackwardCompatibleData(resultIndex));
10590
10823
  var yValuesMap = {};
10591
- xGrouped.forEach(function (_ref22) {
10592
- var _ref23 = _slicedToArray(_ref22, 2),
10593
- rows = _ref23[1];
10594
- rows.forEach(function (_ref24) {
10595
- var row = _ref24.row;
10824
+ xGrouped.forEach(function (_ref26) {
10825
+ var _ref27 = _slicedToArray(_ref26, 2),
10826
+ rows = _ref27[1];
10827
+ rows.forEach(function (_ref28) {
10828
+ var row = _ref28.row;
10596
10829
  _this2.axisValues(pivotConfig.y, resultIndex)(row).forEach(function (values) {
10597
10830
  if (Object.keys(row).length > 0) {
10598
10831
  yValuesMap[values.join()] = values;
@@ -10604,13 +10837,13 @@
10604
10837
  var measureOnX = Boolean(pivotConfig.x.find(function (d) {
10605
10838
  return d === 'measures';
10606
10839
  }));
10607
- return xGrouped.map(function (_ref25) {
10608
- var _ref26 = _slicedToArray(_ref25, 2),
10609
- rows = _ref26[1];
10840
+ return xGrouped.map(function (_ref29) {
10841
+ var _ref30 = _slicedToArray(_ref29, 2),
10842
+ rows = _ref30[1];
10610
10843
  var xValues = rows[0].xValues;
10611
10844
  var yGrouped = {};
10612
- rows.forEach(function (_ref27) {
10613
- var row = _ref27.row;
10845
+ rows.forEach(function (_ref31) {
10846
+ var row = _ref31.row;
10614
10847
  var arr = _this2.axisValues(pivotConfig.y, resultIndex)(row).map(function (yValues) {
10615
10848
  return {
10616
10849
  yValues: yValues,
@@ -10675,8 +10908,8 @@
10675
10908
  };
10676
10909
  var duplicateMeasures = new Set();
10677
10910
  if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {
10678
- var allMeasures = flatten(this.loadResponses.map(function (_ref28) {
10679
- var query = _ref28.query;
10911
+ var allMeasures = flatten(this.loadResponses.map(function (_ref32) {
10912
+ var query = _ref32.query;
10680
10913
  return query.measures;
10681
10914
  }));
10682
10915
  allMeasures.filter(function (e, i, a) {
@@ -10685,14 +10918,14 @@
10685
10918
  return duplicateMeasures.add(m);
10686
10919
  });
10687
10920
  }
10688
- return this.pivot(pivotConfig).map(function (_ref29) {
10689
- var xValues = _ref29.xValues,
10690
- yValuesArray = _ref29.yValuesArray;
10921
+ return this.pivot(pivotConfig).map(function (_ref33) {
10922
+ var xValues = _ref33.xValues,
10923
+ yValuesArray = _ref33.yValuesArray;
10691
10924
  var yValuesMap = {};
10692
- yValuesArray.forEach(function (_ref30, i) {
10693
- var _ref31 = _slicedToArray(_ref30, 2),
10694
- yValues = _ref31[0],
10695
- m = _ref31[1];
10925
+ yValuesArray.forEach(function (_ref34, i) {
10926
+ var _ref35 = _slicedToArray(_ref34, 2),
10927
+ yValues = _ref35[0],
10928
+ m = _ref35[1];
10696
10929
  yValuesMap[_this3.axisValuesString(aliasSeries(yValues, i, pivotConfig, duplicateMeasures), ',')] = m && validate(m);
10697
10930
  });
10698
10931
  return _objectSpread$7({
@@ -10706,15 +10939,15 @@
10706
10939
  value: function tablePivot(pivotConfig) {
10707
10940
  var normalizedPivotConfig = this.normalizePivotConfig(pivotConfig || {});
10708
10941
  var isMeasuresPresent = normalizedPivotConfig.x.concat(normalizedPivotConfig.y).includes('measures');
10709
- return this.pivot(normalizedPivotConfig).map(function (_ref32) {
10710
- var xValues = _ref32.xValues,
10711
- yValuesArray = _ref32.yValuesArray;
10942
+ return this.pivot(normalizedPivotConfig).map(function (_ref36) {
10943
+ var xValues = _ref36.xValues,
10944
+ yValuesArray = _ref36.yValuesArray;
10712
10945
  return fromPairs(normalizedPivotConfig.x.map(function (key, index) {
10713
10946
  return [key, xValues[index]];
10714
- }).concat(isMeasuresPresent ? yValuesArray.map(function (_ref33) {
10715
- var _ref34 = _slicedToArray(_ref33, 2),
10716
- yValues = _ref34[0],
10717
- measure = _ref34[1];
10947
+ }).concat(isMeasuresPresent ? yValuesArray.map(function (_ref37) {
10948
+ var _ref38 = _slicedToArray(_ref37, 2),
10949
+ yValues = _ref38[0],
10950
+ measure = _ref38[1];
10718
10951
  return [yValues.length ? yValues.join() : 'value', measure];
10719
10952
  }) : []));
10720
10953
  });
@@ -10729,12 +10962,12 @@
10729
10962
  }, {});
10730
10963
  var schema = {};
10731
10964
  var extractFields = function extractFields(key) {
10732
- var _ref35 = flatMeta[key] || {},
10733
- title = _ref35.title,
10734
- shortTitle = _ref35.shortTitle,
10735
- type = _ref35.type,
10736
- format = _ref35.format,
10737
- meta = _ref35.meta;
10965
+ var _ref39 = flatMeta[key] || {},
10966
+ title = _ref39.title,
10967
+ shortTitle = _ref39.shortTitle,
10968
+ type = _ref39.type,
10969
+ format = _ref39.format,
10970
+ meta = _ref39.meta;
10738
10971
  return {
10739
10972
  key: key,
10740
10973
  title: title,
@@ -10745,9 +10978,9 @@
10745
10978
  };
10746
10979
  };
10747
10980
  var pivot = this.pivot(normalizedPivotConfig);
10748
- (pivot[0] && pivot[0].yValuesArray || []).forEach(function (_ref36) {
10749
- var _ref37 = _slicedToArray(_ref36, 1),
10750
- yValues = _ref37[0];
10981
+ (pivot[0] && pivot[0].yValuesArray || []).forEach(function (_ref40) {
10982
+ var _ref41 = _slicedToArray(_ref40, 1),
10983
+ yValues = _ref41[0];
10751
10984
  if (yValues.length > 0) {
10752
10985
  var currentItem = schema;
10753
10986
  yValues.forEach(function (value, index) {
@@ -10766,9 +10999,9 @@
10766
10999
  if (Object.keys(item).length === 0) {
10767
11000
  return [];
10768
11001
  }
10769
- return Object.values(item).map(function (_ref38) {
10770
- var key = _ref38.key,
10771
- currentItem = _objectWithoutProperties(_ref38, _excluded3);
11002
+ return Object.values(item).map(function (_ref42) {
11003
+ var key = _ref42.key,
11004
+ currentItem = _objectWithoutProperties(_ref42, _excluded3);
10772
11005
  var children = toColumns(currentItem.children, [].concat(_toConsumableArray(path), [key]));
10773
11006
  var _extractFields = extractFields(currentItem.memberId),
10774
11007
  title = _extractFields.title,
@@ -10847,8 +11080,8 @@
10847
11080
  }));
10848
11081
  var duplicateMeasures = new Set();
10849
11082
  if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {
10850
- var allMeasures = flatten(this.loadResponses.map(function (_ref39) {
10851
- var query = _ref39.query;
11083
+ var allMeasures = flatten(this.loadResponses.map(function (_ref43) {
11084
+ var query = _ref43.query;
10852
11085
  return query.measures;
10853
11086
  }));
10854
11087
  allMeasures.filter(function (e, i, a) {