@ninetailed/experience.js 3.0.1-beta.3 → 3.0.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import unionBy from 'lodash/unionBy';
2
- import { NinetailedApiClient, logger, ConsoleLogSink, buildTrackEvent, buildIdentifyEvent, buildPageEvent, OnLogLogSink, OnErrorLogSink } from '@ninetailed/experience.js-shared';
2
+ import { logger, ConsoleLogSink, buildPageEvent, buildTrackEvent, buildIdentifyEvent, NinetailedApiClient, OnLogLogSink, OnErrorLogSink, PageviewProperties, Properties, Traits } from '@ninetailed/experience.js-shared';
3
3
  import Analytics from 'analytics';
4
+ import { HAS_SEEN_EXPERIENCE, HAS_SEEN_COMPONENT } from '@ninetailed/experience.js-plugin-analytics';
4
5
  import flatten from 'lodash/flatten';
5
6
  import find from 'lodash/find';
6
7
  import includes from 'lodash/includes';
@@ -14,7 +15,7 @@ var check = function (it) {
14
15
  };
15
16
 
16
17
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
17
- var global$K =
18
+ var global$n =
18
19
  // eslint-disable-next-line es/no-global-this -- safe
19
20
  check(typeof globalThis == 'object' && globalThis) ||
20
21
  check(typeof window == 'object' && window) ||
@@ -26,7 +27,7 @@ var global$K =
26
27
 
27
28
  var objectGetOwnPropertyDescriptor = {};
28
29
 
29
- var fails$k = function (exec) {
30
+ var fails$m = function (exec) {
30
31
  try {
31
32
  return !!exec();
32
33
  } catch (error) {
@@ -34,17 +35,18 @@ var fails$k = function (exec) {
34
35
  }
35
36
  };
36
37
 
37
- var fails$j = fails$k;
38
+ var fails$l = fails$m;
38
39
 
39
40
  // Detect IE8's incomplete defineProperty implementation
40
- var descriptors = !fails$j(function () {
41
+ var descriptors = !fails$l(function () {
41
42
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
42
43
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
43
44
  });
44
45
 
45
- var fails$i = fails$k;
46
+ var fails$k = fails$m;
46
47
 
47
- var functionBindNative = !fails$i(function () {
48
+ var functionBindNative = !fails$k(function () {
49
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
48
50
  var test = (function () { /* empty */ }).bind();
49
51
  // eslint-disable-next-line no-prototype-builtins -- safe
50
52
  return typeof test != 'function' || test.hasOwnProperty('prototype');
@@ -52,10 +54,10 @@ var functionBindNative = !fails$i(function () {
52
54
 
53
55
  var NATIVE_BIND$3 = functionBindNative;
54
56
 
55
- var call$f = Function.prototype.call;
57
+ var call$i = Function.prototype.call;
56
58
 
57
- var functionCall = NATIVE_BIND$3 ? call$f.bind(call$f) : function () {
58
- return call$f.apply(call$f, arguments);
59
+ var functionCall = NATIVE_BIND$3 ? call$i.bind(call$i) : function () {
60
+ return call$i.apply(call$i, arguments);
59
61
  };
60
62
 
61
63
  var objectPropertyIsEnumerable = {};
@@ -74,7 +76,7 @@ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
74
76
  return !!descriptor && descriptor.enumerable;
75
77
  } : $propertyIsEnumerable;
76
78
 
77
- var createPropertyDescriptor$4 = function (bitmap, value) {
79
+ var createPropertyDescriptor$3 = function (bitmap, value) {
78
80
  return {
79
81
  enumerable: !(bitmap & 1),
80
82
  configurable: !(bitmap & 2),
@@ -86,100 +88,123 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
86
88
  var NATIVE_BIND$2 = functionBindNative;
87
89
 
88
90
  var FunctionPrototype$2 = Function.prototype;
89
- var bind$5 = FunctionPrototype$2.bind;
90
- var call$e = FunctionPrototype$2.call;
91
- var uncurryThis$o = NATIVE_BIND$2 && bind$5.bind(call$e, call$e);
92
-
93
- var functionUncurryThis = NATIVE_BIND$2 ? function (fn) {
94
- return fn && uncurryThis$o(fn);
95
- } : function (fn) {
96
- return fn && function () {
97
- return call$e.apply(fn, arguments);
91
+ var call$h = FunctionPrototype$2.call;
92
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$h, call$h);
93
+
94
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
95
+ return function () {
96
+ return call$h.apply(fn, arguments);
98
97
  };
99
98
  };
100
99
 
101
- var uncurryThis$n = functionUncurryThis;
100
+ var uncurryThis$m = functionUncurryThis;
102
101
 
103
- var toString$a = uncurryThis$n({}.toString);
104
- var stringSlice$6 = uncurryThis$n(''.slice);
102
+ var toString$9 = uncurryThis$m({}.toString);
103
+ var stringSlice$5 = uncurryThis$m(''.slice);
105
104
 
106
- var classofRaw$1 = function (it) {
107
- return stringSlice$6(toString$a(it), 8, -1);
105
+ var classofRaw$2 = function (it) {
106
+ return stringSlice$5(toString$9(it), 8, -1);
108
107
  };
109
108
 
110
- var global$J = global$K;
111
- var uncurryThis$m = functionUncurryThis;
112
- var fails$h = fails$k;
113
- var classof$7 = classofRaw$1;
109
+ var uncurryThis$l = functionUncurryThis;
110
+ var fails$j = fails$m;
111
+ var classof$7 = classofRaw$2;
114
112
 
115
- var Object$5 = global$J.Object;
116
- var split = uncurryThis$m(''.split);
113
+ var $Object$4 = Object;
114
+ var split = uncurryThis$l(''.split);
117
115
 
118
116
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
119
- var indexedObject = fails$h(function () {
117
+ var indexedObject = fails$j(function () {
120
118
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
121
119
  // eslint-disable-next-line no-prototype-builtins -- safe
122
- return !Object$5('z').propertyIsEnumerable(0);
120
+ return !$Object$4('z').propertyIsEnumerable(0);
123
121
  }) ? function (it) {
124
- return classof$7(it) == 'String' ? split(it, '') : Object$5(it);
125
- } : Object$5;
122
+ return classof$7(it) == 'String' ? split(it, '') : $Object$4(it);
123
+ } : $Object$4;
124
+
125
+ // we can't use just `it == null` since of `document.all` special case
126
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
127
+ var isNullOrUndefined$5 = function (it) {
128
+ return it === null || it === undefined;
129
+ };
126
130
 
127
- var global$I = global$K;
131
+ var isNullOrUndefined$4 = isNullOrUndefined$5;
128
132
 
129
- var TypeError$h = global$I.TypeError;
133
+ var $TypeError$f = TypeError;
130
134
 
131
135
  // `RequireObjectCoercible` abstract operation
132
136
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
133
- var requireObjectCoercible$8 = function (it) {
134
- if (it == undefined) throw TypeError$h("Can't call method on " + it);
137
+ var requireObjectCoercible$7 = function (it) {
138
+ if (isNullOrUndefined$4(it)) throw $TypeError$f("Can't call method on " + it);
135
139
  return it;
136
140
  };
137
141
 
138
142
  // toObject with fallback for non-array-like ES3 strings
139
143
  var IndexedObject$2 = indexedObject;
140
- var requireObjectCoercible$7 = requireObjectCoercible$8;
144
+ var requireObjectCoercible$6 = requireObjectCoercible$7;
141
145
 
142
146
  var toIndexedObject$5 = function (it) {
143
- return IndexedObject$2(requireObjectCoercible$7(it));
147
+ return IndexedObject$2(requireObjectCoercible$6(it));
148
+ };
149
+
150
+ var documentAll$2 = typeof document == 'object' && document.all;
151
+
152
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
153
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
154
+
155
+ var documentAll_1 = {
156
+ all: documentAll$2,
157
+ IS_HTMLDDA: IS_HTMLDDA
144
158
  };
145
159
 
160
+ var $documentAll$1 = documentAll_1;
161
+
162
+ var documentAll$1 = $documentAll$1.all;
163
+
146
164
  // `IsCallable` abstract operation
147
165
  // https://tc39.es/ecma262/#sec-iscallable
148
- var isCallable$j = function (argument) {
166
+ var isCallable$m = $documentAll$1.IS_HTMLDDA ? function (argument) {
167
+ return typeof argument == 'function' || argument === documentAll$1;
168
+ } : function (argument) {
149
169
  return typeof argument == 'function';
150
170
  };
151
171
 
152
- var isCallable$i = isCallable$j;
172
+ var isCallable$l = isCallable$m;
173
+ var $documentAll = documentAll_1;
174
+
175
+ var documentAll = $documentAll.all;
153
176
 
154
- var isObject$8 = function (it) {
155
- return typeof it == 'object' ? it !== null : isCallable$i(it);
177
+ var isObject$9 = $documentAll.IS_HTMLDDA ? function (it) {
178
+ return typeof it == 'object' ? it !== null : isCallable$l(it) || it === documentAll;
179
+ } : function (it) {
180
+ return typeof it == 'object' ? it !== null : isCallable$l(it);
156
181
  };
157
182
 
158
- var global$H = global$K;
159
- var isCallable$h = isCallable$j;
183
+ var global$m = global$n;
184
+ var isCallable$k = isCallable$m;
160
185
 
161
186
  var aFunction = function (argument) {
162
- return isCallable$h(argument) ? argument : undefined;
187
+ return isCallable$k(argument) ? argument : undefined;
163
188
  };
164
189
 
165
- var getBuiltIn$7 = function (namespace, method) {
166
- return arguments.length < 2 ? aFunction(global$H[namespace]) : global$H[namespace] && global$H[namespace][method];
190
+ var getBuiltIn$8 = function (namespace, method) {
191
+ return arguments.length < 2 ? aFunction(global$m[namespace]) : global$m[namespace] && global$m[namespace][method];
167
192
  };
168
193
 
169
- var uncurryThis$l = functionUncurryThis;
194
+ var uncurryThis$k = functionUncurryThis;
170
195
 
171
- var objectIsPrototypeOf = uncurryThis$l({}.isPrototypeOf);
196
+ var objectIsPrototypeOf = uncurryThis$k({}.isPrototypeOf);
172
197
 
173
- var getBuiltIn$6 = getBuiltIn$7;
198
+ var getBuiltIn$7 = getBuiltIn$8;
174
199
 
175
- var engineUserAgent = getBuiltIn$6('navigator', 'userAgent') || '';
200
+ var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
176
201
 
177
- var global$G = global$K;
202
+ var global$l = global$n;
178
203
  var userAgent$3 = engineUserAgent;
179
204
 
180
- var process$3 = global$G.process;
181
- var Deno = global$G.Deno;
182
- var versions = process$3 && process$3.versions || Deno && Deno.version;
205
+ var process$3 = global$l.process;
206
+ var Deno$1 = global$l.Deno;
207
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
183
208
  var v8 = versions && versions.v8;
184
209
  var match, version;
185
210
 
@@ -205,10 +230,10 @@ var engineV8Version = version;
205
230
  /* eslint-disable es/no-symbol -- required for testing */
206
231
 
207
232
  var V8_VERSION$1 = engineV8Version;
208
- var fails$g = fails$k;
233
+ var fails$i = fails$m;
209
234
 
210
235
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
211
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$g(function () {
236
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$i(function () {
212
237
  var symbol = Symbol();
213
238
  // Chrome 38 Symbol has incorrect toString conversion
214
239
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -219,97 +244,93 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$g(function () {
219
244
 
220
245
  /* eslint-disable es/no-symbol -- required for testing */
221
246
 
222
- var NATIVE_SYMBOL$1 = nativeSymbol;
247
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
223
248
 
224
249
  var useSymbolAsUid = NATIVE_SYMBOL$1
225
250
  && !Symbol.sham
226
251
  && typeof Symbol.iterator == 'symbol';
227
252
 
228
- var global$F = global$K;
229
- var getBuiltIn$5 = getBuiltIn$7;
230
- var isCallable$g = isCallable$j;
231
- var isPrototypeOf$2 = objectIsPrototypeOf;
253
+ var getBuiltIn$6 = getBuiltIn$8;
254
+ var isCallable$j = isCallable$m;
255
+ var isPrototypeOf$3 = objectIsPrototypeOf;
232
256
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
233
257
 
234
- var Object$4 = global$F.Object;
258
+ var $Object$3 = Object;
235
259
 
236
260
  var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
237
261
  return typeof it == 'symbol';
238
262
  } : function (it) {
239
- var $Symbol = getBuiltIn$5('Symbol');
240
- return isCallable$g($Symbol) && isPrototypeOf$2($Symbol.prototype, Object$4(it));
263
+ var $Symbol = getBuiltIn$6('Symbol');
264
+ return isCallable$j($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
241
265
  };
242
266
 
243
- var global$E = global$K;
244
-
245
- var String$5 = global$E.String;
267
+ var $String$3 = String;
246
268
 
247
269
  var tryToString$4 = function (argument) {
248
270
  try {
249
- return String$5(argument);
271
+ return $String$3(argument);
250
272
  } catch (error) {
251
273
  return 'Object';
252
274
  }
253
275
  };
254
276
 
255
- var global$D = global$K;
256
- var isCallable$f = isCallable$j;
277
+ var isCallable$i = isCallable$m;
257
278
  var tryToString$3 = tryToString$4;
258
279
 
259
- var TypeError$g = global$D.TypeError;
280
+ var $TypeError$e = TypeError;
260
281
 
261
282
  // `Assert: IsCallable(argument) is true`
262
- var aCallable$6 = function (argument) {
263
- if (isCallable$f(argument)) return argument;
264
- throw TypeError$g(tryToString$3(argument) + ' is not a function');
283
+ var aCallable$8 = function (argument) {
284
+ if (isCallable$i(argument)) return argument;
285
+ throw $TypeError$e(tryToString$3(argument) + ' is not a function');
265
286
  };
266
287
 
267
- var aCallable$5 = aCallable$6;
288
+ var aCallable$7 = aCallable$8;
289
+ var isNullOrUndefined$3 = isNullOrUndefined$5;
268
290
 
269
291
  // `GetMethod` abstract operation
270
292
  // https://tc39.es/ecma262/#sec-getmethod
271
- var getMethod$5 = function (V, P) {
293
+ var getMethod$4 = function (V, P) {
272
294
  var func = V[P];
273
- return func == null ? undefined : aCallable$5(func);
295
+ return isNullOrUndefined$3(func) ? undefined : aCallable$7(func);
274
296
  };
275
297
 
276
- var global$C = global$K;
277
- var call$d = functionCall;
278
- var isCallable$e = isCallable$j;
279
- var isObject$7 = isObject$8;
298
+ var call$g = functionCall;
299
+ var isCallable$h = isCallable$m;
300
+ var isObject$8 = isObject$9;
280
301
 
281
- var TypeError$f = global$C.TypeError;
302
+ var $TypeError$d = TypeError;
282
303
 
283
304
  // `OrdinaryToPrimitive` abstract operation
284
305
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
285
306
  var ordinaryToPrimitive$1 = function (input, pref) {
286
307
  var fn, val;
287
- if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$7(val = call$d(fn, input))) return val;
288
- if (isCallable$e(fn = input.valueOf) && !isObject$7(val = call$d(fn, input))) return val;
289
- if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$7(val = call$d(fn, input))) return val;
290
- throw TypeError$f("Can't convert object to primitive value");
308
+ if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$8(val = call$g(fn, input))) return val;
309
+ if (isCallable$h(fn = input.valueOf) && !isObject$8(val = call$g(fn, input))) return val;
310
+ if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$8(val = call$g(fn, input))) return val;
311
+ throw $TypeError$d("Can't convert object to primitive value");
291
312
  };
292
313
 
293
314
  var shared$4 = {exports: {}};
294
315
 
295
- var global$B = global$K;
316
+ var global$k = global$n;
296
317
 
297
318
  // eslint-disable-next-line es/no-object-defineproperty -- safe
298
- var defineProperty$3 = Object.defineProperty;
319
+ var defineProperty$5 = Object.defineProperty;
299
320
 
300
- var setGlobal$3 = function (key, value) {
321
+ var defineGlobalProperty$3 = function (key, value) {
301
322
  try {
302
- defineProperty$3(global$B, key, { value: value, configurable: true, writable: true });
323
+ defineProperty$5(global$k, key, { value: value, configurable: true, writable: true });
303
324
  } catch (error) {
304
- global$B[key] = value;
325
+ global$k[key] = value;
305
326
  } return value;
306
327
  };
307
328
 
308
- var global$A = global$K;
309
- var setGlobal$2 = setGlobal$3;
329
+ var global$j = global$n;
330
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
310
331
 
311
332
  var SHARED = '__core-js_shared__';
312
- var store$3 = global$A[SHARED] || setGlobal$2(SHARED, {});
333
+ var store$3 = global$j[SHARED] || defineGlobalProperty$2(SHARED, {});
313
334
 
314
335
  var sharedStore = store$3;
315
336
 
@@ -318,61 +339,61 @@ var store$2 = sharedStore;
318
339
  (shared$4.exports = function (key, value) {
319
340
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
320
341
  })('versions', []).push({
321
- version: '3.21.1',
342
+ version: '3.26.1',
322
343
  mode: 'global',
323
344
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
324
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
345
+ license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
325
346
  source: 'https://github.com/zloirock/core-js'
326
347
  });
327
348
 
328
- var global$z = global$K;
329
- var requireObjectCoercible$6 = requireObjectCoercible$8;
349
+ var requireObjectCoercible$5 = requireObjectCoercible$7;
330
350
 
331
- var Object$3 = global$z.Object;
351
+ var $Object$2 = Object;
332
352
 
333
353
  // `ToObject` abstract operation
334
354
  // https://tc39.es/ecma262/#sec-toobject
335
355
  var toObject$5 = function (argument) {
336
- return Object$3(requireObjectCoercible$6(argument));
356
+ return $Object$2(requireObjectCoercible$5(argument));
337
357
  };
338
358
 
339
- var uncurryThis$k = functionUncurryThis;
359
+ var uncurryThis$j = functionUncurryThis;
340
360
  var toObject$4 = toObject$5;
341
361
 
342
- var hasOwnProperty = uncurryThis$k({}.hasOwnProperty);
362
+ var hasOwnProperty = uncurryThis$j({}.hasOwnProperty);
343
363
 
344
364
  // `HasOwnProperty` abstract operation
345
365
  // https://tc39.es/ecma262/#sec-hasownproperty
366
+ // eslint-disable-next-line es/no-object-hasown -- safe
346
367
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
347
368
  return hasOwnProperty(toObject$4(it), key);
348
369
  };
349
370
 
350
- var uncurryThis$j = functionUncurryThis;
371
+ var uncurryThis$i = functionUncurryThis;
351
372
 
352
373
  var id = 0;
353
374
  var postfix = Math.random();
354
- var toString$9 = uncurryThis$j(1.0.toString);
375
+ var toString$8 = uncurryThis$i(1.0.toString);
355
376
 
356
377
  var uid$2 = function (key) {
357
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$9(++id + postfix, 36);
378
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
358
379
  };
359
380
 
360
- var global$y = global$K;
381
+ var global$i = global$n;
361
382
  var shared$3 = shared$4.exports;
362
- var hasOwn$9 = hasOwnProperty_1;
383
+ var hasOwn$a = hasOwnProperty_1;
363
384
  var uid$1 = uid$2;
364
- var NATIVE_SYMBOL = nativeSymbol;
385
+ var NATIVE_SYMBOL = symbolConstructorDetection;
365
386
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
366
387
 
367
388
  var WellKnownSymbolsStore = shared$3('wks');
368
- var Symbol$2 = global$y.Symbol;
389
+ var Symbol$2 = global$i.Symbol;
369
390
  var symbolFor = Symbol$2 && Symbol$2['for'];
370
391
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
371
392
 
372
393
  var wellKnownSymbol$i = function (name) {
373
- if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
394
+ if (!hasOwn$a(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
374
395
  var description = 'Symbol.' + name;
375
- if (NATIVE_SYMBOL && hasOwn$9(Symbol$2, name)) {
396
+ if (NATIVE_SYMBOL && hasOwn$a(Symbol$2, name)) {
376
397
  WellKnownSymbolsStore[name] = Symbol$2[name];
377
398
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
378
399
  WellKnownSymbolsStore[name] = symbolFor(description);
@@ -382,28 +403,27 @@ var wellKnownSymbol$i = function (name) {
382
403
  } return WellKnownSymbolsStore[name];
383
404
  };
384
405
 
385
- var global$x = global$K;
386
- var call$c = functionCall;
387
- var isObject$6 = isObject$8;
406
+ var call$f = functionCall;
407
+ var isObject$7 = isObject$9;
388
408
  var isSymbol$1 = isSymbol$2;
389
- var getMethod$4 = getMethod$5;
409
+ var getMethod$3 = getMethod$4;
390
410
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
391
411
  var wellKnownSymbol$h = wellKnownSymbol$i;
392
412
 
393
- var TypeError$e = global$x.TypeError;
413
+ var $TypeError$c = TypeError;
394
414
  var TO_PRIMITIVE = wellKnownSymbol$h('toPrimitive');
395
415
 
396
416
  // `ToPrimitive` abstract operation
397
417
  // https://tc39.es/ecma262/#sec-toprimitive
398
418
  var toPrimitive$1 = function (input, pref) {
399
- if (!isObject$6(input) || isSymbol$1(input)) return input;
400
- var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
419
+ if (!isObject$7(input) || isSymbol$1(input)) return input;
420
+ var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
401
421
  var result;
402
422
  if (exoticToPrim) {
403
423
  if (pref === undefined) pref = 'default';
404
- result = call$c(exoticToPrim, input, pref);
405
- if (!isObject$6(result) || isSymbol$1(result)) return result;
406
- throw TypeError$e("Can't convert object to primitive value");
424
+ result = call$f(exoticToPrim, input, pref);
425
+ if (!isObject$7(result) || isSymbol$1(result)) return result;
426
+ throw $TypeError$c("Can't convert object to primitive value");
407
427
  }
408
428
  if (pref === undefined) pref = 'number';
409
429
  return ordinaryToPrimitive(input, pref);
@@ -414,41 +434,41 @@ var isSymbol = isSymbol$2;
414
434
 
415
435
  // `ToPropertyKey` abstract operation
416
436
  // https://tc39.es/ecma262/#sec-topropertykey
417
- var toPropertyKey$3 = function (argument) {
437
+ var toPropertyKey$2 = function (argument) {
418
438
  var key = toPrimitive(argument, 'string');
419
439
  return isSymbol(key) ? key : key + '';
420
440
  };
421
441
 
422
- var global$w = global$K;
423
- var isObject$5 = isObject$8;
442
+ var global$h = global$n;
443
+ var isObject$6 = isObject$9;
424
444
 
425
- var document$3 = global$w.document;
445
+ var document$3 = global$h.document;
426
446
  // typeof document.createElement is 'object' in old IE
427
- var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
447
+ var EXISTS$1 = isObject$6(document$3) && isObject$6(document$3.createElement);
428
448
 
429
449
  var documentCreateElement$2 = function (it) {
430
450
  return EXISTS$1 ? document$3.createElement(it) : {};
431
451
  };
432
452
 
433
- var DESCRIPTORS$9 = descriptors;
434
- var fails$f = fails$k;
453
+ var DESCRIPTORS$a = descriptors;
454
+ var fails$h = fails$m;
435
455
  var createElement$1 = documentCreateElement$2;
436
456
 
437
457
  // Thanks to IE8 for its funny defineProperty
438
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$f(function () {
458
+ var ie8DomDefine = !DESCRIPTORS$a && !fails$h(function () {
439
459
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
440
460
  return Object.defineProperty(createElement$1('div'), 'a', {
441
461
  get: function () { return 7; }
442
462
  }).a != 7;
443
463
  });
444
464
 
445
- var DESCRIPTORS$8 = descriptors;
446
- var call$b = functionCall;
465
+ var DESCRIPTORS$9 = descriptors;
466
+ var call$e = functionCall;
447
467
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
448
- var createPropertyDescriptor$3 = createPropertyDescriptor$4;
468
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
449
469
  var toIndexedObject$4 = toIndexedObject$5;
450
- var toPropertyKey$2 = toPropertyKey$3;
451
- var hasOwn$8 = hasOwnProperty_1;
470
+ var toPropertyKey$1 = toPropertyKey$2;
471
+ var hasOwn$9 = hasOwnProperty_1;
452
472
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
453
473
 
454
474
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -456,23 +476,23 @@ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
456
476
 
457
477
  // `Object.getOwnPropertyDescriptor` method
458
478
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
459
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
479
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
460
480
  O = toIndexedObject$4(O);
461
- P = toPropertyKey$2(P);
481
+ P = toPropertyKey$1(P);
462
482
  if (IE8_DOM_DEFINE$1) try {
463
483
  return $getOwnPropertyDescriptor$1(O, P);
464
484
  } catch (error) { /* empty */ }
465
- if (hasOwn$8(O, P)) return createPropertyDescriptor$3(!call$b(propertyIsEnumerableModule$1.f, O, P), O[P]);
485
+ if (hasOwn$9(O, P)) return createPropertyDescriptor$2(!call$e(propertyIsEnumerableModule$1.f, O, P), O[P]);
466
486
  };
467
487
 
468
488
  var objectDefineProperty = {};
469
489
 
470
- var DESCRIPTORS$7 = descriptors;
471
- var fails$e = fails$k;
490
+ var DESCRIPTORS$8 = descriptors;
491
+ var fails$g = fails$m;
472
492
 
473
493
  // V8 ~ Chrome 36-
474
494
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
475
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$e(function () {
495
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$g(function () {
476
496
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
477
497
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
478
498
  value: 42,
@@ -480,26 +500,24 @@ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$e(function () {
480
500
  }).prototype != 42;
481
501
  });
482
502
 
483
- var global$v = global$K;
484
- var isObject$4 = isObject$8;
503
+ var isObject$5 = isObject$9;
485
504
 
486
- var String$4 = global$v.String;
487
- var TypeError$d = global$v.TypeError;
505
+ var $String$2 = String;
506
+ var $TypeError$b = TypeError;
488
507
 
489
508
  // `Assert: Type(argument) is Object`
490
509
  var anObject$e = function (argument) {
491
- if (isObject$4(argument)) return argument;
492
- throw TypeError$d(String$4(argument) + ' is not an object');
510
+ if (isObject$5(argument)) return argument;
511
+ throw $TypeError$b($String$2(argument) + ' is not an object');
493
512
  };
494
513
 
495
- var global$u = global$K;
496
- var DESCRIPTORS$6 = descriptors;
514
+ var DESCRIPTORS$7 = descriptors;
497
515
  var IE8_DOM_DEFINE = ie8DomDefine;
498
516
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
499
517
  var anObject$d = anObject$e;
500
- var toPropertyKey$1 = toPropertyKey$3;
518
+ var toPropertyKey = toPropertyKey$2;
501
519
 
502
- var TypeError$c = global$u.TypeError;
520
+ var $TypeError$a = TypeError;
503
521
  // eslint-disable-next-line es/no-object-defineproperty -- safe
504
522
  var $defineProperty = Object.defineProperty;
505
523
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -510,9 +528,9 @@ var WRITABLE = 'writable';
510
528
 
511
529
  // `Object.defineProperty` method
512
530
  // https://tc39.es/ecma262/#sec-object.defineproperty
513
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
531
+ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
514
532
  anObject$d(O);
515
- P = toPropertyKey$1(P);
533
+ P = toPropertyKey(P);
516
534
  anObject$d(Attributes);
517
535
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
518
536
  var current = $getOwnPropertyDescriptor(O, P);
@@ -527,51 +545,68 @@ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
527
545
  } return $defineProperty(O, P, Attributes);
528
546
  } : $defineProperty : function defineProperty(O, P, Attributes) {
529
547
  anObject$d(O);
530
- P = toPropertyKey$1(P);
548
+ P = toPropertyKey(P);
531
549
  anObject$d(Attributes);
532
550
  if (IE8_DOM_DEFINE) try {
533
551
  return $defineProperty(O, P, Attributes);
534
552
  } catch (error) { /* empty */ }
535
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$c('Accessors not supported');
553
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$a('Accessors not supported');
536
554
  if ('value' in Attributes) O[P] = Attributes.value;
537
555
  return O;
538
556
  };
539
557
 
540
- var DESCRIPTORS$5 = descriptors;
541
- var definePropertyModule$5 = objectDefineProperty;
542
- var createPropertyDescriptor$2 = createPropertyDescriptor$4;
558
+ var DESCRIPTORS$6 = descriptors;
559
+ var definePropertyModule$4 = objectDefineProperty;
560
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
543
561
 
544
- var createNonEnumerableProperty$6 = DESCRIPTORS$5 ? function (object, key, value) {
545
- return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
562
+ var createNonEnumerableProperty$5 = DESCRIPTORS$6 ? function (object, key, value) {
563
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
546
564
  } : function (object, key, value) {
547
565
  object[key] = value;
548
566
  return object;
549
567
  };
550
568
 
551
- var redefine$6 = {exports: {}};
569
+ var makeBuiltIn$2 = {exports: {}};
552
570
 
553
- var uncurryThis$i = functionUncurryThis;
554
- var isCallable$d = isCallable$j;
571
+ var DESCRIPTORS$5 = descriptors;
572
+ var hasOwn$8 = hasOwnProperty_1;
573
+
574
+ var FunctionPrototype$1 = Function.prototype;
575
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
576
+ var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
577
+
578
+ var EXISTS = hasOwn$8(FunctionPrototype$1, 'name');
579
+ // additional protection from minified / mangled / dropped function names
580
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
581
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype$1, 'name').configurable));
582
+
583
+ var functionName = {
584
+ EXISTS: EXISTS,
585
+ PROPER: PROPER,
586
+ CONFIGURABLE: CONFIGURABLE
587
+ };
588
+
589
+ var uncurryThis$h = functionUncurryThis;
590
+ var isCallable$g = isCallable$m;
555
591
  var store$1 = sharedStore;
556
592
 
557
- var functionToString = uncurryThis$i(Function.toString);
593
+ var functionToString = uncurryThis$h(Function.toString);
558
594
 
559
595
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
560
- if (!isCallable$d(store$1.inspectSource)) {
596
+ if (!isCallable$g(store$1.inspectSource)) {
561
597
  store$1.inspectSource = function (it) {
562
598
  return functionToString(it);
563
599
  };
564
600
  }
565
601
 
566
- var inspectSource$4 = store$1.inspectSource;
602
+ var inspectSource$3 = store$1.inspectSource;
567
603
 
568
- var global$t = global$K;
569
- var isCallable$c = isCallable$j;
570
- var inspectSource$3 = inspectSource$4;
604
+ var global$g = global$n;
605
+ var isCallable$f = isCallable$m;
571
606
 
572
- var WeakMap$1 = global$t.WeakMap;
607
+ var WeakMap$1 = global$g.WeakMap;
573
608
 
574
- var nativeWeakMap = isCallable$c(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
609
+ var weakMapBasicDetection = isCallable$f(WeakMap$1) && /native code/.test(String(WeakMap$1));
575
610
 
576
611
  var shared$2 = shared$4.exports;
577
612
  var uid = uid$2;
@@ -584,19 +619,18 @@ var sharedKey$3 = function (key) {
584
619
 
585
620
  var hiddenKeys$4 = {};
586
621
 
587
- var NATIVE_WEAK_MAP = nativeWeakMap;
588
- var global$s = global$K;
589
- var uncurryThis$h = functionUncurryThis;
590
- var isObject$3 = isObject$8;
591
- var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
622
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
623
+ var global$f = global$n;
624
+ var isObject$4 = isObject$9;
625
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
592
626
  var hasOwn$7 = hasOwnProperty_1;
593
627
  var shared$1 = sharedStore;
594
628
  var sharedKey$2 = sharedKey$3;
595
629
  var hiddenKeys$3 = hiddenKeys$4;
596
630
 
597
631
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
598
- var TypeError$b = global$s.TypeError;
599
- var WeakMap = global$s.WeakMap;
632
+ var TypeError$2 = global$f.TypeError;
633
+ var WeakMap = global$f.WeakMap;
600
634
  var set$1, get, has;
601
635
 
602
636
  var enforce = function (it) {
@@ -606,36 +640,38 @@ var enforce = function (it) {
606
640
  var getterFor = function (TYPE) {
607
641
  return function (it) {
608
642
  var state;
609
- if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
610
- throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
643
+ if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
644
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
611
645
  } return state;
612
646
  };
613
647
  };
614
648
 
615
649
  if (NATIVE_WEAK_MAP || shared$1.state) {
616
650
  var store = shared$1.state || (shared$1.state = new WeakMap());
617
- var wmget = uncurryThis$h(store.get);
618
- var wmhas = uncurryThis$h(store.has);
619
- var wmset = uncurryThis$h(store.set);
651
+ /* eslint-disable no-self-assign -- prototype methods protection */
652
+ store.get = store.get;
653
+ store.has = store.has;
654
+ store.set = store.set;
655
+ /* eslint-enable no-self-assign -- prototype methods protection */
620
656
  set$1 = function (it, metadata) {
621
- if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
657
+ if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
622
658
  metadata.facade = it;
623
- wmset(store, it, metadata);
659
+ store.set(it, metadata);
624
660
  return metadata;
625
661
  };
626
662
  get = function (it) {
627
- return wmget(store, it) || {};
663
+ return store.get(it) || {};
628
664
  };
629
665
  has = function (it) {
630
- return wmhas(store, it);
666
+ return store.has(it);
631
667
  };
632
668
  } else {
633
669
  var STATE = sharedKey$2('state');
634
670
  hiddenKeys$3[STATE] = true;
635
671
  set$1 = function (it, metadata) {
636
- if (hasOwn$7(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
672
+ if (hasOwn$7(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
637
673
  metadata.facade = it;
638
- createNonEnumerableProperty$5(it, STATE, metadata);
674
+ createNonEnumerableProperty$4(it, STATE, metadata);
639
675
  return metadata;
640
676
  };
641
677
  get = function (it) {
@@ -654,125 +690,148 @@ var internalState = {
654
690
  getterFor: getterFor
655
691
  };
656
692
 
657
- var DESCRIPTORS$4 = descriptors;
693
+ var fails$f = fails$m;
694
+ var isCallable$e = isCallable$m;
658
695
  var hasOwn$6 = hasOwnProperty_1;
659
-
660
- var FunctionPrototype$1 = Function.prototype;
661
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
662
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
663
-
664
- var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
665
- // additional protection from minified / mangled / dropped function names
666
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
667
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
668
-
669
- var functionName = {
670
- EXISTS: EXISTS,
671
- PROPER: PROPER,
672
- CONFIGURABLE: CONFIGURABLE
673
- };
674
-
675
- var global$r = global$K;
676
- var isCallable$b = isCallable$j;
677
- var hasOwn$5 = hasOwnProperty_1;
678
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
679
- var setGlobal$1 = setGlobal$3;
680
- var inspectSource$2 = inspectSource$4;
681
- var InternalStateModule$2 = internalState;
696
+ var DESCRIPTORS$4 = descriptors;
682
697
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
698
+ var inspectSource$2 = inspectSource$3;
699
+ var InternalStateModule$2 = internalState;
683
700
 
684
- var getInternalState$3 = InternalStateModule$2.get;
685
701
  var enforceInternalState = InternalStateModule$2.enforce;
702
+ var getInternalState$2 = InternalStateModule$2.get;
703
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
704
+ var defineProperty$4 = Object.defineProperty;
705
+
706
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$f(function () {
707
+ return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
708
+ });
709
+
686
710
  var TEMPLATE = String(String).split('String');
687
711
 
688
- (redefine$6.exports = function (O, key, value, options) {
689
- var unsafe = options ? !!options.unsafe : false;
690
- var simple = options ? !!options.enumerable : false;
691
- var noTargetGet = options ? !!options.noTargetGet : false;
692
- var name = options && options.name !== undefined ? options.name : key;
693
- var state;
694
- if (isCallable$b(value)) {
695
- if (String(name).slice(0, 7) === 'Symbol(') {
696
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
697
- }
698
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
699
- createNonEnumerableProperty$4(value, 'name', name);
700
- }
701
- state = enforceInternalState(value);
702
- if (!state.source) {
703
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
704
- }
712
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
713
+ if (String(name).slice(0, 7) === 'Symbol(') {
714
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
705
715
  }
706
- if (O === global$r) {
707
- if (simple) O[key] = value;
708
- else setGlobal$1(key, value);
709
- return;
710
- } else if (!unsafe) {
711
- delete O[key];
712
- } else if (!noTargetGet && O[key]) {
713
- simple = true;
716
+ if (options && options.getter) name = 'get ' + name;
717
+ if (options && options.setter) name = 'set ' + name;
718
+ if (!hasOwn$6(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
719
+ if (DESCRIPTORS$4) defineProperty$4(value, 'name', { value: name, configurable: true });
720
+ else value.name = name;
721
+ }
722
+ if (CONFIGURABLE_LENGTH && options && hasOwn$6(options, 'arity') && value.length !== options.arity) {
723
+ defineProperty$4(value, 'length', { value: options.arity });
714
724
  }
715
- if (simple) O[key] = value;
716
- else createNonEnumerableProperty$4(O, key, value);
725
+ try {
726
+ if (options && hasOwn$6(options, 'constructor') && options.constructor) {
727
+ if (DESCRIPTORS$4) defineProperty$4(value, 'prototype', { writable: false });
728
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
729
+ } else if (value.prototype) value.prototype = undefined;
730
+ } catch (error) { /* empty */ }
731
+ var state = enforceInternalState(value);
732
+ if (!hasOwn$6(state, 'source')) {
733
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
734
+ } return value;
735
+ };
736
+
717
737
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
718
- })(Function.prototype, 'toString', function toString() {
719
- return isCallable$b(this) && getInternalState$3(this).source || inspectSource$2(this);
720
- });
738
+ // eslint-disable-next-line no-extend-native -- required
739
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
740
+ return isCallable$e(this) && getInternalState$2(this).source || inspectSource$2(this);
741
+ }, 'toString');
742
+
743
+ var isCallable$d = isCallable$m;
744
+ var definePropertyModule$3 = objectDefineProperty;
745
+ var makeBuiltIn = makeBuiltIn$2.exports;
746
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
747
+
748
+ var defineBuiltIn$7 = function (O, key, value, options) {
749
+ if (!options) options = {};
750
+ var simple = options.enumerable;
751
+ var name = options.name !== undefined ? options.name : key;
752
+ if (isCallable$d(value)) makeBuiltIn(value, name, options);
753
+ if (options.global) {
754
+ if (simple) O[key] = value;
755
+ else defineGlobalProperty$1(key, value);
756
+ } else {
757
+ try {
758
+ if (!options.unsafe) delete O[key];
759
+ else if (O[key]) simple = true;
760
+ } catch (error) { /* empty */ }
761
+ if (simple) O[key] = value;
762
+ else definePropertyModule$3.f(O, key, {
763
+ value: value,
764
+ enumerable: false,
765
+ configurable: !options.nonConfigurable,
766
+ writable: !options.nonWritable
767
+ });
768
+ } return O;
769
+ };
721
770
 
722
771
  var objectGetOwnPropertyNames = {};
723
772
 
724
773
  var ceil = Math.ceil;
725
774
  var floor$1 = Math.floor;
726
775
 
776
+ // `Math.trunc` method
777
+ // https://tc39.es/ecma262/#sec-math.trunc
778
+ // eslint-disable-next-line es/no-math-trunc -- safe
779
+ var mathTrunc = Math.trunc || function trunc(x) {
780
+ var n = +x;
781
+ return (n > 0 ? floor$1 : ceil)(n);
782
+ };
783
+
784
+ var trunc = mathTrunc;
785
+
727
786
  // `ToIntegerOrInfinity` abstract operation
728
787
  // https://tc39.es/ecma262/#sec-tointegerorinfinity
729
788
  var toIntegerOrInfinity$4 = function (argument) {
730
789
  var number = +argument;
731
- // eslint-disable-next-line no-self-compare -- safe
732
- return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
790
+ // eslint-disable-next-line no-self-compare -- NaN check
791
+ return number !== number || number === 0 ? 0 : trunc(number);
733
792
  };
734
793
 
735
794
  var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
736
795
 
737
- var max$2 = Math.max;
738
- var min$4 = Math.min;
796
+ var max$1 = Math.max;
797
+ var min$3 = Math.min;
739
798
 
740
799
  // Helper for a popular repeating case of the spec:
741
800
  // Let integer be ? ToInteger(index).
742
801
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
743
- var toAbsoluteIndex$2 = function (index, length) {
802
+ var toAbsoluteIndex$1 = function (index, length) {
744
803
  var integer = toIntegerOrInfinity$3(index);
745
- return integer < 0 ? max$2(integer + length, 0) : min$4(integer, length);
804
+ return integer < 0 ? max$1(integer + length, 0) : min$3(integer, length);
746
805
  };
747
806
 
748
807
  var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
749
808
 
750
- var min$3 = Math.min;
809
+ var min$2 = Math.min;
751
810
 
752
811
  // `ToLength` abstract operation
753
812
  // https://tc39.es/ecma262/#sec-tolength
754
- var toLength$4 = function (argument) {
755
- return argument > 0 ? min$3(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
813
+ var toLength$3 = function (argument) {
814
+ return argument > 0 ? min$2(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
756
815
  };
757
816
 
758
- var toLength$3 = toLength$4;
817
+ var toLength$2 = toLength$3;
759
818
 
760
819
  // `LengthOfArrayLike` abstract operation
761
820
  // https://tc39.es/ecma262/#sec-lengthofarraylike
762
- var lengthOfArrayLike$4 = function (obj) {
763
- return toLength$3(obj.length);
821
+ var lengthOfArrayLike$3 = function (obj) {
822
+ return toLength$2(obj.length);
764
823
  };
765
824
 
766
825
  var toIndexedObject$3 = toIndexedObject$5;
767
- var toAbsoluteIndex$1 = toAbsoluteIndex$2;
768
- var lengthOfArrayLike$3 = lengthOfArrayLike$4;
826
+ var toAbsoluteIndex = toAbsoluteIndex$1;
827
+ var lengthOfArrayLike$2 = lengthOfArrayLike$3;
769
828
 
770
829
  // `Array.prototype.{ indexOf, includes }` methods implementation
771
830
  var createMethod$3 = function (IS_INCLUDES) {
772
831
  return function ($this, el, fromIndex) {
773
832
  var O = toIndexedObject$3($this);
774
- var length = lengthOfArrayLike$3(O);
775
- var index = toAbsoluteIndex$1(fromIndex, length);
833
+ var length = lengthOfArrayLike$2(O);
834
+ var index = toAbsoluteIndex(fromIndex, length);
776
835
  var value;
777
836
  // Array#includes uses SameValueZero equality algorithm
778
837
  // eslint-disable-next-line no-self-compare -- NaN check
@@ -797,22 +856,22 @@ var arrayIncludes = {
797
856
  };
798
857
 
799
858
  var uncurryThis$g = functionUncurryThis;
800
- var hasOwn$4 = hasOwnProperty_1;
859
+ var hasOwn$5 = hasOwnProperty_1;
801
860
  var toIndexedObject$2 = toIndexedObject$5;
802
861
  var indexOf$1 = arrayIncludes.indexOf;
803
862
  var hiddenKeys$2 = hiddenKeys$4;
804
863
 
805
- var push$2 = uncurryThis$g([].push);
864
+ var push$1 = uncurryThis$g([].push);
806
865
 
807
866
  var objectKeysInternal = function (object, names) {
808
867
  var O = toIndexedObject$2(object);
809
868
  var i = 0;
810
869
  var result = [];
811
870
  var key;
812
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push$2(result, key);
871
+ for (key in O) !hasOwn$5(hiddenKeys$2, key) && hasOwn$5(O, key) && push$1(result, key);
813
872
  // Don't enum bug & hidden keys
814
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
815
- ~indexOf$1(result, key) || push$2(result, key);
873
+ while (names.length > i) if (hasOwn$5(O, key = names[i++])) {
874
+ ~indexOf$1(result, key) || push$1(result, key);
816
875
  }
817
876
  return result;
818
877
  };
@@ -845,7 +904,7 @@ var objectGetOwnPropertySymbols = {};
845
904
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
846
905
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
847
906
 
848
- var getBuiltIn$4 = getBuiltIn$7;
907
+ var getBuiltIn$5 = getBuiltIn$8;
849
908
  var uncurryThis$f = functionUncurryThis;
850
909
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
851
910
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
@@ -854,31 +913,31 @@ var anObject$c = anObject$e;
854
913
  var concat$2 = uncurryThis$f([].concat);
855
914
 
856
915
  // all object keys, includes non-enumerable and symbols
857
- var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
916
+ var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
858
917
  var keys = getOwnPropertyNamesModule.f(anObject$c(it));
859
918
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
860
919
  return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
861
920
  };
862
921
 
863
- var hasOwn$3 = hasOwnProperty_1;
922
+ var hasOwn$4 = hasOwnProperty_1;
864
923
  var ownKeys = ownKeys$1;
865
924
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
866
- var definePropertyModule$4 = objectDefineProperty;
925
+ var definePropertyModule$2 = objectDefineProperty;
867
926
 
868
927
  var copyConstructorProperties$1 = function (target, source, exceptions) {
869
928
  var keys = ownKeys(source);
870
- var defineProperty = definePropertyModule$4.f;
929
+ var defineProperty = definePropertyModule$2.f;
871
930
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
872
931
  for (var i = 0; i < keys.length; i++) {
873
932
  var key = keys[i];
874
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
933
+ if (!hasOwn$4(target, key) && !(exceptions && hasOwn$4(exceptions, key))) {
875
934
  defineProperty(target, key, getOwnPropertyDescriptor(source, key));
876
935
  }
877
936
  }
878
937
  };
879
938
 
880
- var fails$d = fails$k;
881
- var isCallable$a = isCallable$j;
939
+ var fails$e = fails$m;
940
+ var isCallable$c = isCallable$m;
882
941
 
883
942
  var replacement = /#|\.prototype\./;
884
943
 
@@ -886,7 +945,7 @@ var isForced$2 = function (feature, detection) {
886
945
  var value = data[normalize$1(feature)];
887
946
  return value == POLYFILL ? true
888
947
  : value == NATIVE ? false
889
- : isCallable$a(detection) ? fails$d(detection)
948
+ : isCallable$c(detection) ? fails$e(detection)
890
949
  : !!detection;
891
950
  };
892
951
 
@@ -900,28 +959,28 @@ var POLYFILL = isForced$2.POLYFILL = 'P';
900
959
 
901
960
  var isForced_1 = isForced$2;
902
961
 
903
- var global$q = global$K;
962
+ var global$e = global$n;
904
963
  var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
905
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
906
- var redefine$5 = redefine$6.exports;
907
- var setGlobal = setGlobal$3;
964
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
965
+ var defineBuiltIn$6 = defineBuiltIn$7;
966
+ var defineGlobalProperty = defineGlobalProperty$3;
908
967
  var copyConstructorProperties = copyConstructorProperties$1;
909
968
  var isForced$1 = isForced_1;
910
969
 
911
970
  /*
912
- options.target - name of the target object
913
- options.global - target is the global object
914
- options.stat - export as static methods of target
915
- options.proto - export as prototype methods of target
916
- options.real - real prototype method for the `pure` version
917
- options.forced - export even if the native feature is available
918
- options.bind - bind methods to the target, required for the `pure` version
919
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
920
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
921
- options.sham - add a flag to not completely full polyfills
922
- options.enumerable - export as enumerable property
923
- options.noTargetGet - prevent calling a getter on target
924
- options.name - the .name of the function if it does not match the key
971
+ options.target - name of the target object
972
+ options.global - target is the global object
973
+ options.stat - export as static methods of target
974
+ options.proto - export as prototype methods of target
975
+ options.real - real prototype method for the `pure` version
976
+ options.forced - export even if the native feature is available
977
+ options.bind - bind methods to the target, required for the `pure` version
978
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
979
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
980
+ options.sham - add a flag to not completely full polyfills
981
+ options.enumerable - export as enumerable property
982
+ options.dontCallGetSet - prevent calling a getter on target
983
+ options.name - the .name of the function if it does not match the key
925
984
  */
926
985
  var _export = function (options, source) {
927
986
  var TARGET = options.target;
@@ -929,15 +988,15 @@ var _export = function (options, source) {
929
988
  var STATIC = options.stat;
930
989
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
931
990
  if (GLOBAL) {
932
- target = global$q;
991
+ target = global$e;
933
992
  } else if (STATIC) {
934
- target = global$q[TARGET] || setGlobal(TARGET, {});
993
+ target = global$e[TARGET] || defineGlobalProperty(TARGET, {});
935
994
  } else {
936
- target = (global$q[TARGET] || {}).prototype;
995
+ target = (global$e[TARGET] || {}).prototype;
937
996
  }
938
997
  if (target) for (key in source) {
939
998
  sourceProperty = source[key];
940
- if (options.noTargetGet) {
999
+ if (options.dontCallGetSet) {
941
1000
  descriptor = getOwnPropertyDescriptor$2(target, key);
942
1001
  targetProperty = descriptor && descriptor.value;
943
1002
  } else targetProperty = target[key];
@@ -951,31 +1010,23 @@ var _export = function (options, source) {
951
1010
  if (options.sham || (targetProperty && targetProperty.sham)) {
952
1011
  createNonEnumerableProperty$3(sourceProperty, 'sham', true);
953
1012
  }
954
- // extend global
955
- redefine$5(target, key, sourceProperty, options);
1013
+ defineBuiltIn$6(target, key, sourceProperty, options);
956
1014
  }
957
1015
  };
958
1016
 
959
- var global$p = global$K;
960
-
961
- var nativePromiseConstructor = global$p.Promise;
962
-
963
- var redefine$4 = redefine$6.exports;
1017
+ var classof$6 = classofRaw$2;
1018
+ var global$d = global$n;
964
1019
 
965
- var redefineAll$1 = function (target, src, options) {
966
- for (var key in src) redefine$4(target, key, src[key], options);
967
- return target;
968
- };
1020
+ var engineIsNode = classof$6(global$d.process) == 'process';
969
1021
 
970
- var global$o = global$K;
971
- var isCallable$9 = isCallable$j;
1022
+ var isCallable$b = isCallable$m;
972
1023
 
973
- var String$3 = global$o.String;
974
- var TypeError$a = global$o.TypeError;
1024
+ var $String$1 = String;
1025
+ var $TypeError$9 = TypeError;
975
1026
 
976
1027
  var aPossiblePrototype$1 = function (argument) {
977
- if (typeof argument == 'object' || isCallable$9(argument)) return argument;
978
- throw TypeError$a("Can't set " + String$3(argument) + ' as a prototype');
1028
+ if (typeof argument == 'object' || isCallable$b(argument)) return argument;
1029
+ throw $TypeError$9("Can't set " + $String$1(argument) + ' as a prototype');
979
1030
  };
980
1031
 
981
1032
  /* eslint-disable no-proto -- safe */
@@ -1007,29 +1058,29 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1007
1058
  };
1008
1059
  }() : undefined);
1009
1060
 
1010
- var defineProperty$2 = objectDefineProperty.f;
1011
- var hasOwn$2 = hasOwnProperty_1;
1061
+ var defineProperty$3 = objectDefineProperty.f;
1062
+ var hasOwn$3 = hasOwnProperty_1;
1012
1063
  var wellKnownSymbol$g = wellKnownSymbol$i;
1013
1064
 
1014
1065
  var TO_STRING_TAG$3 = wellKnownSymbol$g('toStringTag');
1015
1066
 
1016
1067
  var setToStringTag$3 = function (target, TAG, STATIC) {
1017
1068
  if (target && !STATIC) target = target.prototype;
1018
- if (target && !hasOwn$2(target, TO_STRING_TAG$3)) {
1019
- defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1069
+ if (target && !hasOwn$3(target, TO_STRING_TAG$3)) {
1070
+ defineProperty$3(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1020
1071
  }
1021
1072
  };
1022
1073
 
1023
- var getBuiltIn$3 = getBuiltIn$7;
1024
- var definePropertyModule$3 = objectDefineProperty;
1074
+ var getBuiltIn$4 = getBuiltIn$8;
1075
+ var definePropertyModule$1 = objectDefineProperty;
1025
1076
  var wellKnownSymbol$f = wellKnownSymbol$i;
1026
1077
  var DESCRIPTORS$3 = descriptors;
1027
1078
 
1028
1079
  var SPECIES$3 = wellKnownSymbol$f('species');
1029
1080
 
1030
1081
  var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1031
- var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1032
- var defineProperty = definePropertyModule$3.f;
1082
+ var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
1083
+ var defineProperty = definePropertyModule$1.f;
1033
1084
 
1034
1085
  if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$3]) {
1035
1086
  defineProperty(Constructor, SPECIES$3, {
@@ -1039,63 +1090,34 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1039
1090
  }
1040
1091
  };
1041
1092
 
1042
- var global$n = global$K;
1043
- var isPrototypeOf$1 = objectIsPrototypeOf;
1093
+ var isPrototypeOf$2 = objectIsPrototypeOf;
1044
1094
 
1045
- var TypeError$9 = global$n.TypeError;
1095
+ var $TypeError$8 = TypeError;
1046
1096
 
1047
1097
  var anInstance$1 = function (it, Prototype) {
1048
- if (isPrototypeOf$1(Prototype, it)) return it;
1049
- throw TypeError$9('Incorrect invocation');
1050
- };
1051
-
1052
- var uncurryThis$d = functionUncurryThis;
1053
- var aCallable$4 = aCallable$6;
1054
- var NATIVE_BIND$1 = functionBindNative;
1055
-
1056
- var bind$4 = uncurryThis$d(uncurryThis$d.bind);
1057
-
1058
- // optional / simple context binding
1059
- var functionBindContext = function (fn, that) {
1060
- aCallable$4(fn);
1061
- return that === undefined ? fn : NATIVE_BIND$1 ? bind$4(fn, that) : function (/* ...args */) {
1062
- return fn.apply(that, arguments);
1063
- };
1098
+ if (isPrototypeOf$2(Prototype, it)) return it;
1099
+ throw $TypeError$8('Incorrect invocation');
1064
1100
  };
1065
1101
 
1066
- var iterators = {};
1067
-
1068
1102
  var wellKnownSymbol$e = wellKnownSymbol$i;
1069
- var Iterators$4 = iterators;
1070
-
1071
- var ITERATOR$6 = wellKnownSymbol$e('iterator');
1072
- var ArrayPrototype$1 = Array.prototype;
1073
-
1074
- // check on default Array iterator
1075
- var isArrayIteratorMethod$1 = function (it) {
1076
- return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$1[ITERATOR$6] === it);
1077
- };
1078
-
1079
- var wellKnownSymbol$d = wellKnownSymbol$i;
1080
1103
 
1081
- var TO_STRING_TAG$2 = wellKnownSymbol$d('toStringTag');
1104
+ var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
1082
1105
  var test = {};
1083
1106
 
1084
1107
  test[TO_STRING_TAG$2] = 'z';
1085
1108
 
1086
1109
  var toStringTagSupport = String(test) === '[object z]';
1087
1110
 
1088
- var global$m = global$K;
1089
1111
  var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1090
- var isCallable$8 = isCallable$j;
1091
- var classofRaw = classofRaw$1;
1092
- var wellKnownSymbol$c = wellKnownSymbol$i;
1112
+ var isCallable$a = isCallable$m;
1113
+ var classofRaw$1 = classofRaw$2;
1114
+ var wellKnownSymbol$d = wellKnownSymbol$i;
1093
1115
 
1094
- var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
1095
- var Object$2 = global$m.Object;
1116
+ var TO_STRING_TAG$1 = wellKnownSymbol$d('toStringTag');
1117
+ var $Object$1 = Object;
1096
1118
 
1097
1119
  // ES3 wrong here
1098
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1120
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1099
1121
 
1100
1122
  // fallback for IE11 Script Access Denied error
1101
1123
  var tryGet = function (it, key) {
@@ -1105,279 +1127,143 @@ var tryGet = function (it, key) {
1105
1127
  };
1106
1128
 
1107
1129
  // getting tag from ES6+ `Object.prototype.toString`
1108
- var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1130
+ var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1109
1131
  var O, tag, result;
1110
1132
  return it === undefined ? 'Undefined' : it === null ? 'Null'
1111
1133
  // @@toStringTag case
1112
- : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$1)) == 'string' ? tag
1134
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1113
1135
  // builtinTag case
1114
- : CORRECT_ARGUMENTS ? classofRaw(O)
1136
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1115
1137
  // ES3 arguments fallback
1116
- : (result = classofRaw(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1138
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$a(O.callee) ? 'Arguments' : result;
1117
1139
  };
1118
1140
 
1119
- var classof$5 = classof$6;
1120
- var getMethod$3 = getMethod$5;
1121
- var Iterators$3 = iterators;
1122
- var wellKnownSymbol$b = wellKnownSymbol$i;
1141
+ var uncurryThis$d = functionUncurryThis;
1142
+ var fails$d = fails$m;
1143
+ var isCallable$9 = isCallable$m;
1144
+ var classof$4 = classof$5;
1145
+ var getBuiltIn$3 = getBuiltIn$8;
1146
+ var inspectSource$1 = inspectSource$3;
1123
1147
 
1124
- var ITERATOR$5 = wellKnownSymbol$b('iterator');
1148
+ var noop = function () { /* empty */ };
1149
+ var empty = [];
1150
+ var construct = getBuiltIn$3('Reflect', 'construct');
1151
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1152
+ var exec$2 = uncurryThis$d(constructorRegExp.exec);
1153
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1125
1154
 
1126
- var getIteratorMethod$2 = function (it) {
1127
- if (it != undefined) return getMethod$3(it, ITERATOR$5)
1128
- || getMethod$3(it, '@@iterator')
1129
- || Iterators$3[classof$5(it)];
1155
+ var isConstructorModern = function isConstructor(argument) {
1156
+ if (!isCallable$9(argument)) return false;
1157
+ try {
1158
+ construct(noop, empty, argument);
1159
+ return true;
1160
+ } catch (error) {
1161
+ return false;
1162
+ }
1130
1163
  };
1131
1164
 
1132
- var global$l = global$K;
1133
- var call$a = functionCall;
1134
- var aCallable$3 = aCallable$6;
1135
- var anObject$a = anObject$e;
1165
+ var isConstructorLegacy = function isConstructor(argument) {
1166
+ if (!isCallable$9(argument)) return false;
1167
+ switch (classof$4(argument)) {
1168
+ case 'AsyncFunction':
1169
+ case 'GeneratorFunction':
1170
+ case 'AsyncGeneratorFunction': return false;
1171
+ }
1172
+ try {
1173
+ // we can't check .prototype since constructors produced by .bind haven't it
1174
+ // `Function#toString` throws on some built-it function in some legacy engines
1175
+ // (for example, `DOMQuad` and similar in FF41-)
1176
+ return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
1177
+ } catch (error) {
1178
+ return true;
1179
+ }
1180
+ };
1181
+
1182
+ isConstructorLegacy.sham = true;
1183
+
1184
+ // `IsConstructor` abstract operation
1185
+ // https://tc39.es/ecma262/#sec-isconstructor
1186
+ var isConstructor$1 = !construct || fails$d(function () {
1187
+ var called;
1188
+ return isConstructorModern(isConstructorModern.call)
1189
+ || !isConstructorModern(Object)
1190
+ || !isConstructorModern(function () { called = true; })
1191
+ || called;
1192
+ }) ? isConstructorLegacy : isConstructorModern;
1193
+
1194
+ var isConstructor = isConstructor$1;
1136
1195
  var tryToString$2 = tryToString$4;
1137
- var getIteratorMethod$1 = getIteratorMethod$2;
1138
1196
 
1139
- var TypeError$8 = global$l.TypeError;
1197
+ var $TypeError$7 = TypeError;
1140
1198
 
1141
- var getIterator$1 = function (argument, usingIterator) {
1142
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1143
- if (aCallable$3(iteratorMethod)) return anObject$a(call$a(iteratorMethod, argument));
1144
- throw TypeError$8(tryToString$2(argument) + ' is not iterable');
1199
+ // `Assert: IsConstructor(argument) is true`
1200
+ var aConstructor$1 = function (argument) {
1201
+ if (isConstructor(argument)) return argument;
1202
+ throw $TypeError$7(tryToString$2(argument) + ' is not a constructor');
1145
1203
  };
1146
1204
 
1147
- var call$9 = functionCall;
1148
- var anObject$9 = anObject$e;
1149
- var getMethod$2 = getMethod$5;
1205
+ var anObject$a = anObject$e;
1206
+ var aConstructor = aConstructor$1;
1207
+ var isNullOrUndefined$2 = isNullOrUndefined$5;
1208
+ var wellKnownSymbol$c = wellKnownSymbol$i;
1150
1209
 
1151
- var iteratorClose$1 = function (iterator, kind, value) {
1152
- var innerResult, innerError;
1153
- anObject$9(iterator);
1154
- try {
1155
- innerResult = getMethod$2(iterator, 'return');
1156
- if (!innerResult) {
1157
- if (kind === 'throw') throw value;
1158
- return value;
1159
- }
1160
- innerResult = call$9(innerResult, iterator);
1161
- } catch (error) {
1162
- innerError = true;
1163
- innerResult = error;
1164
- }
1165
- if (kind === 'throw') throw value;
1166
- if (innerError) throw innerResult;
1167
- anObject$9(innerResult);
1168
- return value;
1210
+ var SPECIES$2 = wellKnownSymbol$c('species');
1211
+
1212
+ // `SpeciesConstructor` abstract operation
1213
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1214
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1215
+ var C = anObject$a(O).constructor;
1216
+ var S;
1217
+ return C === undefined || isNullOrUndefined$2(S = anObject$a(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
1169
1218
  };
1170
1219
 
1171
- var global$k = global$K;
1172
- var bind$3 = functionBindContext;
1173
- var call$8 = functionCall;
1174
- var anObject$8 = anObject$e;
1175
- var tryToString$1 = tryToString$4;
1176
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
1177
- var lengthOfArrayLike$2 = lengthOfArrayLike$4;
1178
- var isPrototypeOf = objectIsPrototypeOf;
1179
- var getIterator = getIterator$1;
1180
- var getIteratorMethod = getIteratorMethod$2;
1181
- var iteratorClose = iteratorClose$1;
1220
+ var NATIVE_BIND$1 = functionBindNative;
1182
1221
 
1183
- var TypeError$7 = global$k.TypeError;
1222
+ var FunctionPrototype = Function.prototype;
1223
+ var apply$2 = FunctionPrototype.apply;
1224
+ var call$d = FunctionPrototype.call;
1184
1225
 
1185
- var Result = function (stopped, result) {
1186
- this.stopped = stopped;
1187
- this.result = result;
1226
+ // eslint-disable-next-line es/no-reflect -- safe
1227
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$d.bind(apply$2) : function () {
1228
+ return call$d.apply(apply$2, arguments);
1229
+ });
1230
+
1231
+ var classofRaw = classofRaw$2;
1232
+ var uncurryThis$c = functionUncurryThis;
1233
+
1234
+ var functionUncurryThisClause = function (fn) {
1235
+ // Nashorn bug:
1236
+ // https://github.com/zloirock/core-js/issues/1128
1237
+ // https://github.com/zloirock/core-js/issues/1130
1238
+ if (classofRaw(fn) === 'Function') return uncurryThis$c(fn);
1188
1239
  };
1189
1240
 
1190
- var ResultPrototype = Result.prototype;
1241
+ var uncurryThis$b = functionUncurryThisClause;
1242
+ var aCallable$6 = aCallable$8;
1243
+ var NATIVE_BIND = functionBindNative;
1191
1244
 
1192
- var iterate$1 = function (iterable, unboundFunction, options) {
1193
- var that = options && options.that;
1194
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1195
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1196
- var INTERRUPTED = !!(options && options.INTERRUPTED);
1197
- var fn = bind$3(unboundFunction, that);
1198
- var iterator, iterFn, index, length, result, next, step;
1245
+ var bind$4 = uncurryThis$b(uncurryThis$b.bind);
1199
1246
 
1200
- var stop = function (condition) {
1201
- if (iterator) iteratorClose(iterator, 'normal', condition);
1202
- return new Result(true, condition);
1247
+ // optional / simple context binding
1248
+ var functionBindContext = function (fn, that) {
1249
+ aCallable$6(fn);
1250
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1251
+ return fn.apply(that, arguments);
1203
1252
  };
1253
+ };
1204
1254
 
1205
- var callFn = function (value) {
1206
- if (AS_ENTRIES) {
1207
- anObject$8(value);
1208
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1209
- } return INTERRUPTED ? fn(value, stop) : fn(value);
1210
- };
1211
-
1212
- if (IS_ITERATOR) {
1213
- iterator = iterable;
1214
- } else {
1215
- iterFn = getIteratorMethod(iterable);
1216
- if (!iterFn) throw TypeError$7(tryToString$1(iterable) + ' is not iterable');
1217
- // optimisation for array iterators
1218
- if (isArrayIteratorMethod(iterFn)) {
1219
- for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
1220
- result = callFn(iterable[index]);
1221
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
1222
- } return new Result(false);
1223
- }
1224
- iterator = getIterator(iterable, iterFn);
1225
- }
1226
-
1227
- next = iterator.next;
1228
- while (!(step = call$8(next, iterator)).done) {
1229
- try {
1230
- result = callFn(step.value);
1231
- } catch (error) {
1232
- iteratorClose(iterator, 'throw', error);
1233
- }
1234
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1235
- } return new Result(false);
1236
- };
1237
-
1238
- var wellKnownSymbol$a = wellKnownSymbol$i;
1239
-
1240
- var ITERATOR$4 = wellKnownSymbol$a('iterator');
1241
- var SAFE_CLOSING = false;
1242
-
1243
- try {
1244
- var called = 0;
1245
- var iteratorWithReturn = {
1246
- next: function () {
1247
- return { done: !!called++ };
1248
- },
1249
- 'return': function () {
1250
- SAFE_CLOSING = true;
1251
- }
1252
- };
1253
- iteratorWithReturn[ITERATOR$4] = function () {
1254
- return this;
1255
- };
1256
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
1257
- Array.from(iteratorWithReturn, function () { throw 2; });
1258
- } catch (error) { /* empty */ }
1259
-
1260
- var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
1261
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1262
- var ITERATION_SUPPORT = false;
1263
- try {
1264
- var object = {};
1265
- object[ITERATOR$4] = function () {
1266
- return {
1267
- next: function () {
1268
- return { done: ITERATION_SUPPORT = true };
1269
- }
1270
- };
1271
- };
1272
- exec(object);
1273
- } catch (error) { /* empty */ }
1274
- return ITERATION_SUPPORT;
1275
- };
1276
-
1277
- var uncurryThis$c = functionUncurryThis;
1278
- var fails$c = fails$k;
1279
- var isCallable$7 = isCallable$j;
1280
- var classof$4 = classof$6;
1281
- var getBuiltIn$2 = getBuiltIn$7;
1282
- var inspectSource$1 = inspectSource$4;
1283
-
1284
- var noop = function () { /* empty */ };
1285
- var empty = [];
1286
- var construct = getBuiltIn$2('Reflect', 'construct');
1287
- var constructorRegExp = /^\s*(?:class|function)\b/;
1288
- var exec$3 = uncurryThis$c(constructorRegExp.exec);
1289
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1290
-
1291
- var isConstructorModern = function isConstructor(argument) {
1292
- if (!isCallable$7(argument)) return false;
1293
- try {
1294
- construct(noop, empty, argument);
1295
- return true;
1296
- } catch (error) {
1297
- return false;
1298
- }
1299
- };
1300
-
1301
- var isConstructorLegacy = function isConstructor(argument) {
1302
- if (!isCallable$7(argument)) return false;
1303
- switch (classof$4(argument)) {
1304
- case 'AsyncFunction':
1305
- case 'GeneratorFunction':
1306
- case 'AsyncGeneratorFunction': return false;
1307
- }
1308
- try {
1309
- // we can't check .prototype since constructors produced by .bind haven't it
1310
- // `Function#toString` throws on some built-it function in some legacy engines
1311
- // (for example, `DOMQuad` and similar in FF41-)
1312
- return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource$1(argument));
1313
- } catch (error) {
1314
- return true;
1315
- }
1316
- };
1317
-
1318
- isConstructorLegacy.sham = true;
1319
-
1320
- // `IsConstructor` abstract operation
1321
- // https://tc39.es/ecma262/#sec-isconstructor
1322
- var isConstructor$1 = !construct || fails$c(function () {
1323
- var called;
1324
- return isConstructorModern(isConstructorModern.call)
1325
- || !isConstructorModern(Object)
1326
- || !isConstructorModern(function () { called = true; })
1327
- || called;
1328
- }) ? isConstructorLegacy : isConstructorModern;
1329
-
1330
- var global$j = global$K;
1331
- var isConstructor = isConstructor$1;
1332
- var tryToString = tryToString$4;
1333
-
1334
- var TypeError$6 = global$j.TypeError;
1335
-
1336
- // `Assert: IsConstructor(argument) is true`
1337
- var aConstructor$1 = function (argument) {
1338
- if (isConstructor(argument)) return argument;
1339
- throw TypeError$6(tryToString(argument) + ' is not a constructor');
1340
- };
1341
-
1342
- var anObject$7 = anObject$e;
1343
- var aConstructor = aConstructor$1;
1344
- var wellKnownSymbol$9 = wellKnownSymbol$i;
1345
-
1346
- var SPECIES$2 = wellKnownSymbol$9('species');
1347
-
1348
- // `SpeciesConstructor` abstract operation
1349
- // https://tc39.es/ecma262/#sec-speciesconstructor
1350
- var speciesConstructor$2 = function (O, defaultConstructor) {
1351
- var C = anObject$7(O).constructor;
1352
- var S;
1353
- return C === undefined || (S = anObject$7(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
1354
- };
1355
-
1356
- var NATIVE_BIND = functionBindNative;
1357
-
1358
- var FunctionPrototype = Function.prototype;
1359
- var apply$3 = FunctionPrototype.apply;
1360
- var call$7 = FunctionPrototype.call;
1361
-
1362
- // eslint-disable-next-line es/no-reflect -- safe
1363
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$7.bind(apply$3) : function () {
1364
- return call$7.apply(apply$3, arguments);
1365
- });
1366
-
1367
- var getBuiltIn$1 = getBuiltIn$7;
1255
+ var getBuiltIn$2 = getBuiltIn$8;
1368
1256
 
1369
- var html$2 = getBuiltIn$1('document', 'documentElement');
1257
+ var html$2 = getBuiltIn$2('document', 'documentElement');
1370
1258
 
1371
- var uncurryThis$b = functionUncurryThis;
1372
-
1373
- var arraySlice$2 = uncurryThis$b([].slice);
1259
+ var uncurryThis$a = functionUncurryThis;
1374
1260
 
1375
- var global$i = global$K;
1261
+ var arraySlice$1 = uncurryThis$a([].slice);
1376
1262
 
1377
- var TypeError$5 = global$i.TypeError;
1263
+ var $TypeError$6 = TypeError;
1378
1264
 
1379
1265
  var validateArgumentsLength$1 = function (passed, required) {
1380
- if (passed < required) throw TypeError$5('Not enough arguments');
1266
+ if (passed < required) throw $TypeError$6('Not enough arguments');
1381
1267
  return passed;
1382
1268
  };
1383
1269
 
@@ -1385,43 +1271,38 @@ var userAgent$2 = engineUserAgent;
1385
1271
 
1386
1272
  var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1387
1273
 
1388
- var classof$3 = classofRaw$1;
1389
- var global$h = global$K;
1390
-
1391
- var engineIsNode = classof$3(global$h.process) == 'process';
1392
-
1393
- var global$g = global$K;
1394
- var apply$2 = functionApply;
1395
- var bind$2 = functionBindContext;
1396
- var isCallable$6 = isCallable$j;
1397
- var hasOwn$1 = hasOwnProperty_1;
1398
- var fails$b = fails$k;
1274
+ var global$c = global$n;
1275
+ var apply$1 = functionApply;
1276
+ var bind$3 = functionBindContext;
1277
+ var isCallable$8 = isCallable$m;
1278
+ var hasOwn$2 = hasOwnProperty_1;
1279
+ var fails$c = fails$m;
1399
1280
  var html$1 = html$2;
1400
- var arraySlice$1 = arraySlice$2;
1281
+ var arraySlice = arraySlice$1;
1401
1282
  var createElement = documentCreateElement$2;
1402
1283
  var validateArgumentsLength = validateArgumentsLength$1;
1403
1284
  var IS_IOS$1 = engineIsIos;
1404
- var IS_NODE$3 = engineIsNode;
1405
-
1406
- var set = global$g.setImmediate;
1407
- var clear = global$g.clearImmediate;
1408
- var process$2 = global$g.process;
1409
- var Dispatch = global$g.Dispatch;
1410
- var Function$1 = global$g.Function;
1411
- var MessageChannel = global$g.MessageChannel;
1412
- var String$2 = global$g.String;
1285
+ var IS_NODE$4 = engineIsNode;
1286
+
1287
+ var set = global$c.setImmediate;
1288
+ var clear = global$c.clearImmediate;
1289
+ var process$2 = global$c.process;
1290
+ var Dispatch = global$c.Dispatch;
1291
+ var Function$1 = global$c.Function;
1292
+ var MessageChannel = global$c.MessageChannel;
1293
+ var String$1 = global$c.String;
1413
1294
  var counter = 0;
1414
1295
  var queue$1 = {};
1415
1296
  var ONREADYSTATECHANGE = 'onreadystatechange';
1416
- var location, defer, channel, port;
1297
+ var $location, defer, channel, port;
1417
1298
 
1418
1299
  try {
1419
1300
  // Deno throws a ReferenceError on `location` access without `--location` flag
1420
- location = global$g.location;
1301
+ $location = global$c.location;
1421
1302
  } catch (error) { /* empty */ }
1422
1303
 
1423
1304
  var run = function (id) {
1424
- if (hasOwn$1(queue$1, id)) {
1305
+ if (hasOwn$2(queue$1, id)) {
1425
1306
  var fn = queue$1[id];
1426
1307
  delete queue$1[id];
1427
1308
  fn();
@@ -1440,17 +1321,17 @@ var listener = function (event) {
1440
1321
 
1441
1322
  var post = function (id) {
1442
1323
  // old engines have not location.origin
1443
- global$g.postMessage(String$2(id), location.protocol + '//' + location.host);
1324
+ global$c.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1444
1325
  };
1445
1326
 
1446
1327
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1447
1328
  if (!set || !clear) {
1448
1329
  set = function setImmediate(handler) {
1449
1330
  validateArgumentsLength(arguments.length, 1);
1450
- var fn = isCallable$6(handler) ? handler : Function$1(handler);
1451
- var args = arraySlice$1(arguments, 1);
1331
+ var fn = isCallable$8(handler) ? handler : Function$1(handler);
1332
+ var args = arraySlice(arguments, 1);
1452
1333
  queue$1[++counter] = function () {
1453
- apply$2(fn, undefined, args);
1334
+ apply$1(fn, undefined, args);
1454
1335
  };
1455
1336
  defer(counter);
1456
1337
  return counter;
@@ -1459,7 +1340,7 @@ if (!set || !clear) {
1459
1340
  delete queue$1[id];
1460
1341
  };
1461
1342
  // Node.js 0.8-
1462
- if (IS_NODE$3) {
1343
+ if (IS_NODE$4) {
1463
1344
  defer = function (id) {
1464
1345
  process$2.nextTick(runner(id));
1465
1346
  };
@@ -1474,18 +1355,18 @@ if (!set || !clear) {
1474
1355
  channel = new MessageChannel();
1475
1356
  port = channel.port2;
1476
1357
  channel.port1.onmessage = listener;
1477
- defer = bind$2(port.postMessage, port);
1358
+ defer = bind$3(port.postMessage, port);
1478
1359
  // Browsers with postMessage, skip WebWorkers
1479
1360
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1480
1361
  } else if (
1481
- global$g.addEventListener &&
1482
- isCallable$6(global$g.postMessage) &&
1483
- !global$g.importScripts &&
1484
- location && location.protocol !== 'file:' &&
1485
- !fails$b(post)
1362
+ global$c.addEventListener &&
1363
+ isCallable$8(global$c.postMessage) &&
1364
+ !global$c.importScripts &&
1365
+ $location && $location.protocol !== 'file:' &&
1366
+ !fails$c(post)
1486
1367
  ) {
1487
1368
  defer = post;
1488
- global$g.addEventListener('message', listener, false);
1369
+ global$c.addEventListener('message', listener, false);
1489
1370
  // IE8-
1490
1371
  } else if (ONREADYSTATECHANGE in createElement('script')) {
1491
1372
  defer = function (id) {
@@ -1508,29 +1389,29 @@ var task$1 = {
1508
1389
  };
1509
1390
 
1510
1391
  var userAgent$1 = engineUserAgent;
1511
- var global$f = global$K;
1392
+ var global$b = global$n;
1512
1393
 
1513
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$f.Pebble !== undefined;
1394
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$b.Pebble !== undefined;
1514
1395
 
1515
1396
  var userAgent = engineUserAgent;
1516
1397
 
1517
1398
  var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
1518
1399
 
1519
- var global$e = global$K;
1520
- var bind$1 = functionBindContext;
1400
+ var global$a = global$n;
1401
+ var bind$2 = functionBindContext;
1521
1402
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1522
1403
  var macrotask = task$1.set;
1523
1404
  var IS_IOS = engineIsIos;
1524
1405
  var IS_IOS_PEBBLE = engineIsIosPebble;
1525
1406
  var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
1526
- var IS_NODE$2 = engineIsNode;
1407
+ var IS_NODE$3 = engineIsNode;
1527
1408
 
1528
- var MutationObserver = global$e.MutationObserver || global$e.WebKitMutationObserver;
1529
- var document$2 = global$e.document;
1530
- var process$1 = global$e.process;
1531
- var Promise$1 = global$e.Promise;
1409
+ var MutationObserver = global$a.MutationObserver || global$a.WebKitMutationObserver;
1410
+ var document$2 = global$a.document;
1411
+ var process$1 = global$a.process;
1412
+ var Promise$1 = global$a.Promise;
1532
1413
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1533
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor$1(global$e, 'queueMicrotask');
1414
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor$1(global$a, 'queueMicrotask');
1534
1415
  var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1535
1416
 
1536
1417
  var flush, head, last, notify$1, toggle, node, promise, then;
@@ -1539,7 +1420,7 @@ var flush, head, last, notify$1, toggle, node, promise, then;
1539
1420
  if (!queueMicrotask) {
1540
1421
  flush = function () {
1541
1422
  var parent, fn;
1542
- if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
1423
+ if (IS_NODE$3 && (parent = process$1.domain)) parent.exit();
1543
1424
  while (head) {
1544
1425
  fn = head.fn;
1545
1426
  head = head.next;
@@ -1556,7 +1437,7 @@ if (!queueMicrotask) {
1556
1437
 
1557
1438
  // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1558
1439
  // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1559
- if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1440
+ if (!IS_IOS && !IS_NODE$3 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1560
1441
  toggle = true;
1561
1442
  node = document$2.createTextNode('');
1562
1443
  new MutationObserver(flush).observe(node, { characterData: true });
@@ -1569,24 +1450,24 @@ if (!queueMicrotask) {
1569
1450
  promise = Promise$1.resolve(undefined);
1570
1451
  // workaround of WebKit ~ iOS Safari 10.1 bug
1571
1452
  promise.constructor = Promise$1;
1572
- then = bind$1(promise.then, promise);
1453
+ then = bind$2(promise.then, promise);
1573
1454
  notify$1 = function () {
1574
1455
  then(flush);
1575
1456
  };
1576
1457
  // Node.js without promises
1577
- } else if (IS_NODE$2) {
1458
+ } else if (IS_NODE$3) {
1578
1459
  notify$1 = function () {
1579
1460
  process$1.nextTick(flush);
1580
1461
  };
1581
1462
  // for other environments - macrotask based on:
1582
1463
  // - setImmediate
1583
1464
  // - MessageChannel
1584
- // - window.postMessag
1465
+ // - window.postMessage
1585
1466
  // - onreadystatechange
1586
1467
  // - setTimeout
1587
1468
  } else {
1588
1469
  // strange IE + webpack dev server bug - use .bind(global)
1589
- macrotask = bind$1(macrotask, global$e);
1470
+ macrotask = bind$2(macrotask, global$a);
1590
1471
  notify$1 = function () {
1591
1472
  macrotask(flush);
1592
1473
  };
@@ -1602,50 +1483,16 @@ var microtask$1 = queueMicrotask || function (fn) {
1602
1483
  } last = task;
1603
1484
  };
1604
1485
 
1605
- var newPromiseCapability$2 = {};
1606
-
1607
- var aCallable$2 = aCallable$6;
1608
-
1609
- var PromiseCapability = function (C) {
1610
- var resolve, reject;
1611
- this.promise = new C(function ($$resolve, $$reject) {
1612
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1613
- resolve = $$resolve;
1614
- reject = $$reject;
1615
- });
1616
- this.resolve = aCallable$2(resolve);
1617
- this.reject = aCallable$2(reject);
1618
- };
1619
-
1620
- // `NewPromiseCapability` abstract operation
1621
- // https://tc39.es/ecma262/#sec-newpromisecapability
1622
- newPromiseCapability$2.f = function (C) {
1623
- return new PromiseCapability(C);
1624
- };
1625
-
1626
- var anObject$6 = anObject$e;
1627
- var isObject$2 = isObject$8;
1628
- var newPromiseCapability$1 = newPromiseCapability$2;
1629
-
1630
- var promiseResolve$1 = function (C, x) {
1631
- anObject$6(C);
1632
- if (isObject$2(x) && x.constructor === C) return x;
1633
- var promiseCapability = newPromiseCapability$1.f(C);
1634
- var resolve = promiseCapability.resolve;
1635
- resolve(x);
1636
- return promiseCapability.promise;
1637
- };
1638
-
1639
- var global$d = global$K;
1486
+ var global$9 = global$n;
1640
1487
 
1641
1488
  var hostReportErrors$1 = function (a, b) {
1642
- var console = global$d.console;
1489
+ var console = global$9.console;
1643
1490
  if (console && console.error) {
1644
1491
  arguments.length == 1 ? console.error(a) : console.error(a, b);
1645
1492
  }
1646
1493
  };
1647
1494
 
1648
- var perform$1 = function (exec) {
1495
+ var perform$3 = function (exec) {
1649
1496
  try {
1650
1497
  return { error: false, value: exec() };
1651
1498
  } catch (error) {
@@ -1677,57 +1524,128 @@ Queue$1.prototype = {
1677
1524
 
1678
1525
  var queue = Queue$1;
1679
1526
 
1680
- var engineIsBrowser = typeof window == 'object';
1527
+ var global$8 = global$n;
1681
1528
 
1682
- var $$7 = _export;
1683
- var global$c = global$K;
1684
- var getBuiltIn = getBuiltIn$7;
1685
- var call$6 = functionCall;
1686
- var NativePromise = nativePromiseConstructor;
1687
- var redefine$3 = redefine$6.exports;
1688
- var redefineAll = redefineAll$1;
1529
+ var promiseNativeConstructor = global$8.Promise;
1530
+
1531
+ /* global Deno -- Deno case */
1532
+
1533
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1534
+
1535
+ var IS_DENO$1 = engineIsDeno;
1536
+ var IS_NODE$2 = engineIsNode;
1537
+
1538
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$2
1539
+ && typeof window == 'object'
1540
+ && typeof document == 'object';
1541
+
1542
+ var global$7 = global$n;
1543
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
1544
+ var isCallable$7 = isCallable$m;
1545
+ var isForced = isForced_1;
1546
+ var inspectSource = inspectSource$3;
1547
+ var wellKnownSymbol$b = wellKnownSymbol$i;
1548
+ var IS_BROWSER = engineIsBrowser;
1549
+ var IS_DENO = engineIsDeno;
1550
+ var V8_VERSION = engineV8Version;
1551
+
1552
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
1553
+ var SPECIES$1 = wellKnownSymbol$b('species');
1554
+ var SUBCLASSING = false;
1555
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$7(global$7.PromiseRejectionEvent);
1556
+
1557
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
1558
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
1559
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
1560
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1561
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1562
+ // We can't detect it synchronously, so just check versions
1563
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1564
+ // We can't use @@species feature detection in V8 since it causes
1565
+ // deoptimization and performance degradation
1566
+ // https://github.com/zloirock/core-js/issues/679
1567
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1568
+ // Detect correctness of subclassing with @@species support
1569
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
1570
+ var FakePromise = function (exec) {
1571
+ exec(function () { /* empty */ }, function () { /* empty */ });
1572
+ };
1573
+ var constructor = promise.constructor = {};
1574
+ constructor[SPECIES$1] = FakePromise;
1575
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1576
+ if (!SUBCLASSING) return true;
1577
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1578
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1579
+ });
1580
+
1581
+ var promiseConstructorDetection = {
1582
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1583
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1584
+ SUBCLASSING: SUBCLASSING
1585
+ };
1586
+
1587
+ var newPromiseCapability$2 = {};
1588
+
1589
+ var aCallable$5 = aCallable$8;
1590
+
1591
+ var $TypeError$5 = TypeError;
1592
+
1593
+ var PromiseCapability = function (C) {
1594
+ var resolve, reject;
1595
+ this.promise = new C(function ($$resolve, $$reject) {
1596
+ if (resolve !== undefined || reject !== undefined) throw $TypeError$5('Bad Promise constructor');
1597
+ resolve = $$resolve;
1598
+ reject = $$reject;
1599
+ });
1600
+ this.resolve = aCallable$5(resolve);
1601
+ this.reject = aCallable$5(reject);
1602
+ };
1603
+
1604
+ // `NewPromiseCapability` abstract operation
1605
+ // https://tc39.es/ecma262/#sec-newpromisecapability
1606
+ newPromiseCapability$2.f = function (C) {
1607
+ return new PromiseCapability(C);
1608
+ };
1609
+
1610
+ var $$d = _export;
1611
+ var IS_NODE$1 = engineIsNode;
1612
+ var global$6 = global$n;
1613
+ var call$c = functionCall;
1614
+ var defineBuiltIn$5 = defineBuiltIn$7;
1689
1615
  var setPrototypeOf$1 = objectSetPrototypeOf;
1690
1616
  var setToStringTag$2 = setToStringTag$3;
1691
1617
  var setSpecies = setSpecies$1;
1692
- var aCallable$1 = aCallable$6;
1693
- var isCallable$5 = isCallable$j;
1694
- var isObject$1 = isObject$8;
1618
+ var aCallable$4 = aCallable$8;
1619
+ var isCallable$6 = isCallable$m;
1620
+ var isObject$3 = isObject$9;
1695
1621
  var anInstance = anInstance$1;
1696
- var inspectSource = inspectSource$4;
1697
- var iterate = iterate$1;
1698
- var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
1699
- var speciesConstructor$1 = speciesConstructor$2;
1622
+ var speciesConstructor = speciesConstructor$1;
1700
1623
  var task = task$1.set;
1701
1624
  var microtask = microtask$1;
1702
- var promiseResolve = promiseResolve$1;
1703
1625
  var hostReportErrors = hostReportErrors$1;
1704
- var newPromiseCapabilityModule = newPromiseCapability$2;
1705
- var perform = perform$1;
1626
+ var perform$2 = perform$3;
1706
1627
  var Queue = queue;
1707
1628
  var InternalStateModule$1 = internalState;
1708
- var isForced = isForced_1;
1709
- var wellKnownSymbol$8 = wellKnownSymbol$i;
1710
- var IS_BROWSER = engineIsBrowser;
1711
- var IS_NODE$1 = engineIsNode;
1712
- var V8_VERSION = engineV8Version;
1629
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
1630
+ var PromiseConstructorDetection = promiseConstructorDetection;
1631
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
1713
1632
 
1714
- var SPECIES$1 = wellKnownSymbol$8('species');
1715
1633
  var PROMISE = 'Promise';
1716
-
1717
- var getInternalState$2 = InternalStateModule$1.getterFor(PROMISE);
1718
- var setInternalState$1 = InternalStateModule$1.set;
1634
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
1635
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
1636
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
1719
1637
  var getInternalPromiseState = InternalStateModule$1.getterFor(PROMISE);
1720
- var NativePromisePrototype = NativePromise && NativePromise.prototype;
1721
- var PromiseConstructor = NativePromise;
1722
- var PromisePrototype = NativePromisePrototype;
1723
- var TypeError$4 = global$c.TypeError;
1724
- var document$1 = global$c.document;
1725
- var process = global$c.process;
1726
- var newPromiseCapability = newPromiseCapabilityModule.f;
1727
- var newGenericPromiseCapability = newPromiseCapability;
1728
-
1729
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$c.dispatchEvent);
1730
- var NATIVE_REJECTION_EVENT = isCallable$5(global$c.PromiseRejectionEvent);
1638
+ var setInternalState$1 = InternalStateModule$1.set;
1639
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
1640
+ var PromiseConstructor = NativePromiseConstructor$2;
1641
+ var PromisePrototype = NativePromisePrototype$1;
1642
+ var TypeError$1 = global$6.TypeError;
1643
+ var document$1 = global$6.document;
1644
+ var process = global$6.process;
1645
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
1646
+ var newGenericPromiseCapability = newPromiseCapability$1;
1647
+
1648
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$6.dispatchEvent);
1731
1649
  var UNHANDLED_REJECTION = 'unhandledrejection';
1732
1650
  var REJECTION_HANDLED = 'rejectionhandled';
1733
1651
  var PENDING = 0;
@@ -1735,42 +1653,13 @@ var FULFILLED = 1;
1735
1653
  var REJECTED = 2;
1736
1654
  var HANDLED = 1;
1737
1655
  var UNHANDLED = 2;
1738
- var SUBCLASSING = false;
1739
1656
 
1740
1657
  var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1741
1658
 
1742
- var FORCED$1 = isForced(PROMISE, function () {
1743
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
1744
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
1745
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1746
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1747
- // We can't detect it synchronously, so just check versions
1748
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1749
- // We can't use @@species feature detection in V8 since it causes
1750
- // deoptimization and performance degradation
1751
- // https://github.com/zloirock/core-js/issues/679
1752
- if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
1753
- // Detect correctness of subclassing with @@species support
1754
- var promise = new PromiseConstructor(function (resolve) { resolve(1); });
1755
- var FakePromise = function (exec) {
1756
- exec(function () { /* empty */ }, function () { /* empty */ });
1757
- };
1758
- var constructor = promise.constructor = {};
1759
- constructor[SPECIES$1] = FakePromise;
1760
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1761
- if (!SUBCLASSING) return true;
1762
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1763
- return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
1764
- });
1765
-
1766
- var INCORRECT_ITERATION = FORCED$1 || !checkCorrectnessOfIteration(function (iterable) {
1767
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1768
- });
1769
-
1770
1659
  // helpers
1771
1660
  var isThenable = function (it) {
1772
1661
  var then;
1773
- return isObject$1(it) && isCallable$5(then = it.then) ? then : false;
1662
+ return isObject$3(it) && isCallable$6(then = it.then) ? then : false;
1774
1663
  };
1775
1664
 
1776
1665
  var callReaction = function (reaction, state) {
@@ -1797,9 +1686,9 @@ var callReaction = function (reaction, state) {
1797
1686
  }
1798
1687
  }
1799
1688
  if (result === reaction.promise) {
1800
- reject(TypeError$4('Promise-chain cycle'));
1689
+ reject(TypeError$1('Promise-chain cycle'));
1801
1690
  } else if (then = isThenable(result)) {
1802
- call$6(then, result, resolve, reject);
1691
+ call$c(then, result, resolve, reject);
1803
1692
  } else resolve(result);
1804
1693
  } else reject(value);
1805
1694
  } catch (error) {
@@ -1829,20 +1718,20 @@ var dispatchEvent = function (name, promise, reason) {
1829
1718
  event.promise = promise;
1830
1719
  event.reason = reason;
1831
1720
  event.initEvent(name, false, true);
1832
- global$c.dispatchEvent(event);
1721
+ global$6.dispatchEvent(event);
1833
1722
  } else event = { promise: promise, reason: reason };
1834
- if (!NATIVE_REJECTION_EVENT && (handler = global$c['on' + name])) handler(event);
1723
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$6['on' + name])) handler(event);
1835
1724
  else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1836
1725
  };
1837
1726
 
1838
1727
  var onUnhandled = function (state) {
1839
- call$6(task, global$c, function () {
1728
+ call$c(task, global$6, function () {
1840
1729
  var promise = state.facade;
1841
1730
  var value = state.value;
1842
1731
  var IS_UNHANDLED = isUnhandled(state);
1843
1732
  var result;
1844
1733
  if (IS_UNHANDLED) {
1845
- result = perform(function () {
1734
+ result = perform$2(function () {
1846
1735
  if (IS_NODE$1) {
1847
1736
  process.emit('unhandledRejection', value, promise);
1848
1737
  } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
@@ -1859,7 +1748,7 @@ var isUnhandled = function (state) {
1859
1748
  };
1860
1749
 
1861
1750
  var onHandleUnhandled = function (state) {
1862
- call$6(task, global$c, function () {
1751
+ call$c(task, global$6, function () {
1863
1752
  var promise = state.facade;
1864
1753
  if (IS_NODE$1) {
1865
1754
  process.emit('rejectionHandled', promise);
@@ -1867,7 +1756,7 @@ var onHandleUnhandled = function (state) {
1867
1756
  });
1868
1757
  };
1869
1758
 
1870
- var bind = function (fn, state, unwrap) {
1759
+ var bind$1 = function (fn, state, unwrap) {
1871
1760
  return function (value) {
1872
1761
  fn(state, value, unwrap);
1873
1762
  };
@@ -1887,15 +1776,15 @@ var internalResolve = function (state, value, unwrap) {
1887
1776
  state.done = true;
1888
1777
  if (unwrap) state = unwrap;
1889
1778
  try {
1890
- if (state.facade === value) throw TypeError$4("Promise can't be resolved itself");
1779
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
1891
1780
  var then = isThenable(value);
1892
1781
  if (then) {
1893
1782
  microtask(function () {
1894
1783
  var wrapper = { done: false };
1895
1784
  try {
1896
- call$6(then, value,
1897
- bind(internalResolve, wrapper, state),
1898
- bind(internalReject, wrapper, state)
1785
+ call$c(then, value,
1786
+ bind$1(internalResolve, wrapper, state),
1787
+ bind$1(internalReject, wrapper, state)
1899
1788
  );
1900
1789
  } catch (error) {
1901
1790
  internalReject(wrapper, error, state);
@@ -1912,20 +1801,22 @@ var internalResolve = function (state, value, unwrap) {
1912
1801
  };
1913
1802
 
1914
1803
  // constructor polyfill
1915
- if (FORCED$1) {
1804
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1916
1805
  // 25.4.3.1 Promise(executor)
1917
1806
  PromiseConstructor = function Promise(executor) {
1918
1807
  anInstance(this, PromisePrototype);
1919
- aCallable$1(executor);
1920
- call$6(Internal, this);
1921
- var state = getInternalState$2(this);
1808
+ aCallable$4(executor);
1809
+ call$c(Internal, this);
1810
+ var state = getInternalPromiseState(this);
1922
1811
  try {
1923
- executor(bind(internalResolve, state), bind(internalReject, state));
1812
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
1924
1813
  } catch (error) {
1925
1814
  internalReject(state, error);
1926
1815
  }
1927
1816
  };
1817
+
1928
1818
  PromisePrototype = PromiseConstructor.prototype;
1819
+
1929
1820
  // eslint-disable-next-line no-unused-vars -- required for `.length`
1930
1821
  Internal = function Promise(executor) {
1931
1822
  setInternalState$1(this, {
@@ -1939,117 +1830,277 @@ if (FORCED$1) {
1939
1830
  value: undefined
1940
1831
  });
1941
1832
  };
1942
- Internal.prototype = redefineAll(PromisePrototype, {
1943
- // `Promise.prototype.then` method
1944
- // https://tc39.es/ecma262/#sec-promise.prototype.then
1945
- // eslint-disable-next-line unicorn/no-thenable -- safe
1946
- then: function then(onFulfilled, onRejected) {
1947
- var state = getInternalPromiseState(this);
1948
- var reaction = newPromiseCapability(speciesConstructor$1(this, PromiseConstructor));
1949
- state.parent = true;
1950
- reaction.ok = isCallable$5(onFulfilled) ? onFulfilled : true;
1951
- reaction.fail = isCallable$5(onRejected) && onRejected;
1952
- reaction.domain = IS_NODE$1 ? process.domain : undefined;
1953
- if (state.state == PENDING) state.reactions.add(reaction);
1954
- else microtask(function () {
1955
- callReaction(reaction, state);
1956
- });
1957
- return reaction.promise;
1958
- },
1959
- // `Promise.prototype.catch` method
1960
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
1961
- 'catch': function (onRejected) {
1962
- return this.then(undefined, onRejected);
1963
- }
1833
+
1834
+ // `Promise.prototype.then` method
1835
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
1836
+ Internal.prototype = defineBuiltIn$5(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
1837
+ var state = getInternalPromiseState(this);
1838
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
1839
+ state.parent = true;
1840
+ reaction.ok = isCallable$6(onFulfilled) ? onFulfilled : true;
1841
+ reaction.fail = isCallable$6(onRejected) && onRejected;
1842
+ reaction.domain = IS_NODE$1 ? process.domain : undefined;
1843
+ if (state.state == PENDING) state.reactions.add(reaction);
1844
+ else microtask(function () {
1845
+ callReaction(reaction, state);
1846
+ });
1847
+ return reaction.promise;
1964
1848
  });
1849
+
1965
1850
  OwnPromiseCapability = function () {
1966
1851
  var promise = new Internal();
1967
- var state = getInternalState$2(promise);
1852
+ var state = getInternalPromiseState(promise);
1968
1853
  this.promise = promise;
1969
- this.resolve = bind(internalResolve, state);
1970
- this.reject = bind(internalReject, state);
1854
+ this.resolve = bind$1(internalResolve, state);
1855
+ this.reject = bind$1(internalReject, state);
1971
1856
  };
1972
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
1857
+
1858
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
1973
1859
  return C === PromiseConstructor || C === PromiseWrapper
1974
1860
  ? new OwnPromiseCapability(C)
1975
1861
  : newGenericPromiseCapability(C);
1976
1862
  };
1977
1863
 
1978
- if (isCallable$5(NativePromise) && NativePromisePrototype !== Object.prototype) {
1979
- nativeThen = NativePromisePrototype.then;
1864
+ if (isCallable$6(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
1865
+ nativeThen = NativePromisePrototype$1.then;
1980
1866
 
1981
- if (!SUBCLASSING) {
1867
+ if (!NATIVE_PROMISE_SUBCLASSING) {
1982
1868
  // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
1983
- redefine$3(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
1869
+ defineBuiltIn$5(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
1984
1870
  var that = this;
1985
1871
  return new PromiseConstructor(function (resolve, reject) {
1986
- call$6(nativeThen, that, resolve, reject);
1872
+ call$c(nativeThen, that, resolve, reject);
1987
1873
  }).then(onFulfilled, onRejected);
1988
1874
  // https://github.com/zloirock/core-js/issues/640
1989
1875
  }, { unsafe: true });
1990
-
1991
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
1992
- redefine$3(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
1993
1876
  }
1994
1877
 
1995
1878
  // make `.constructor === Promise` work for native promise-based APIs
1996
1879
  try {
1997
- delete NativePromisePrototype.constructor;
1880
+ delete NativePromisePrototype$1.constructor;
1998
1881
  } catch (error) { /* empty */ }
1999
1882
 
2000
1883
  // make `instanceof Promise` work for native promise-based APIs
2001
1884
  if (setPrototypeOf$1) {
2002
- setPrototypeOf$1(NativePromisePrototype, PromisePrototype);
1885
+ setPrototypeOf$1(NativePromisePrototype$1, PromisePrototype);
2003
1886
  }
2004
1887
  }
2005
1888
  }
2006
1889
 
2007
- $$7({ global: true, wrap: true, forced: FORCED$1 }, {
1890
+ $$d({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2008
1891
  Promise: PromiseConstructor
2009
1892
  });
2010
1893
 
2011
1894
  setToStringTag$2(PromiseConstructor, PROMISE, false);
2012
1895
  setSpecies(PROMISE);
2013
1896
 
2014
- PromiseWrapper = getBuiltIn(PROMISE);
1897
+ var iterators = {};
2015
1898
 
2016
- // statics
2017
- $$7({ target: PROMISE, stat: true, forced: FORCED$1 }, {
2018
- // `Promise.reject` method
2019
- // https://tc39.es/ecma262/#sec-promise.reject
2020
- reject: function reject(r) {
2021
- var capability = newPromiseCapability(this);
2022
- call$6(capability.reject, undefined, r);
2023
- return capability.promise;
1899
+ var wellKnownSymbol$a = wellKnownSymbol$i;
1900
+ var Iterators$4 = iterators;
1901
+
1902
+ var ITERATOR$6 = wellKnownSymbol$a('iterator');
1903
+ var ArrayPrototype$1 = Array.prototype;
1904
+
1905
+ // check on default Array iterator
1906
+ var isArrayIteratorMethod$1 = function (it) {
1907
+ return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$1[ITERATOR$6] === it);
1908
+ };
1909
+
1910
+ var classof$3 = classof$5;
1911
+ var getMethod$2 = getMethod$4;
1912
+ var isNullOrUndefined$1 = isNullOrUndefined$5;
1913
+ var Iterators$3 = iterators;
1914
+ var wellKnownSymbol$9 = wellKnownSymbol$i;
1915
+
1916
+ var ITERATOR$5 = wellKnownSymbol$9('iterator');
1917
+
1918
+ var getIteratorMethod$2 = function (it) {
1919
+ if (!isNullOrUndefined$1(it)) return getMethod$2(it, ITERATOR$5)
1920
+ || getMethod$2(it, '@@iterator')
1921
+ || Iterators$3[classof$3(it)];
1922
+ };
1923
+
1924
+ var call$b = functionCall;
1925
+ var aCallable$3 = aCallable$8;
1926
+ var anObject$9 = anObject$e;
1927
+ var tryToString$1 = tryToString$4;
1928
+ var getIteratorMethod$1 = getIteratorMethod$2;
1929
+
1930
+ var $TypeError$4 = TypeError;
1931
+
1932
+ var getIterator$1 = function (argument, usingIterator) {
1933
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1934
+ if (aCallable$3(iteratorMethod)) return anObject$9(call$b(iteratorMethod, argument));
1935
+ throw $TypeError$4(tryToString$1(argument) + ' is not iterable');
1936
+ };
1937
+
1938
+ var call$a = functionCall;
1939
+ var anObject$8 = anObject$e;
1940
+ var getMethod$1 = getMethod$4;
1941
+
1942
+ var iteratorClose$1 = function (iterator, kind, value) {
1943
+ var innerResult, innerError;
1944
+ anObject$8(iterator);
1945
+ try {
1946
+ innerResult = getMethod$1(iterator, 'return');
1947
+ if (!innerResult) {
1948
+ if (kind === 'throw') throw value;
1949
+ return value;
1950
+ }
1951
+ innerResult = call$a(innerResult, iterator);
1952
+ } catch (error) {
1953
+ innerError = true;
1954
+ innerResult = error;
2024
1955
  }
2025
- });
1956
+ if (kind === 'throw') throw value;
1957
+ if (innerError) throw innerResult;
1958
+ anObject$8(innerResult);
1959
+ return value;
1960
+ };
2026
1961
 
2027
- $$7({ target: PROMISE, stat: true, forced: FORCED$1 }, {
2028
- // `Promise.resolve` method
2029
- // https://tc39.es/ecma262/#sec-promise.resolve
2030
- resolve: function resolve(x) {
2031
- return promiseResolve(this, x);
1962
+ var bind = functionBindContext;
1963
+ var call$9 = functionCall;
1964
+ var anObject$7 = anObject$e;
1965
+ var tryToString = tryToString$4;
1966
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
1967
+ var lengthOfArrayLike$1 = lengthOfArrayLike$3;
1968
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1969
+ var getIterator = getIterator$1;
1970
+ var getIteratorMethod = getIteratorMethod$2;
1971
+ var iteratorClose = iteratorClose$1;
1972
+
1973
+ var $TypeError$3 = TypeError;
1974
+
1975
+ var Result = function (stopped, result) {
1976
+ this.stopped = stopped;
1977
+ this.result = result;
1978
+ };
1979
+
1980
+ var ResultPrototype = Result.prototype;
1981
+
1982
+ var iterate$2 = function (iterable, unboundFunction, options) {
1983
+ var that = options && options.that;
1984
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1985
+ var IS_RECORD = !!(options && options.IS_RECORD);
1986
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1987
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
1988
+ var fn = bind(unboundFunction, that);
1989
+ var iterator, iterFn, index, length, result, next, step;
1990
+
1991
+ var stop = function (condition) {
1992
+ if (iterator) iteratorClose(iterator, 'normal', condition);
1993
+ return new Result(true, condition);
1994
+ };
1995
+
1996
+ var callFn = function (value) {
1997
+ if (AS_ENTRIES) {
1998
+ anObject$7(value);
1999
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2000
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2001
+ };
2002
+
2003
+ if (IS_RECORD) {
2004
+ iterator = iterable.iterator;
2005
+ } else if (IS_ITERATOR) {
2006
+ iterator = iterable;
2007
+ } else {
2008
+ iterFn = getIteratorMethod(iterable);
2009
+ if (!iterFn) throw $TypeError$3(tryToString(iterable) + ' is not iterable');
2010
+ // optimisation for array iterators
2011
+ if (isArrayIteratorMethod(iterFn)) {
2012
+ for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
2013
+ result = callFn(iterable[index]);
2014
+ if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
2015
+ } return new Result(false);
2016
+ }
2017
+ iterator = getIterator(iterable, iterFn);
2032
2018
  }
2019
+
2020
+ next = IS_RECORD ? iterable.next : iterator.next;
2021
+ while (!(step = call$9(next, iterator)).done) {
2022
+ try {
2023
+ result = callFn(step.value);
2024
+ } catch (error) {
2025
+ iteratorClose(iterator, 'throw', error);
2026
+ }
2027
+ if (typeof result == 'object' && result && isPrototypeOf$1(ResultPrototype, result)) return result;
2028
+ } return new Result(false);
2029
+ };
2030
+
2031
+ var wellKnownSymbol$8 = wellKnownSymbol$i;
2032
+
2033
+ var ITERATOR$4 = wellKnownSymbol$8('iterator');
2034
+ var SAFE_CLOSING = false;
2035
+
2036
+ try {
2037
+ var called = 0;
2038
+ var iteratorWithReturn = {
2039
+ next: function () {
2040
+ return { done: !!called++ };
2041
+ },
2042
+ 'return': function () {
2043
+ SAFE_CLOSING = true;
2044
+ }
2045
+ };
2046
+ iteratorWithReturn[ITERATOR$4] = function () {
2047
+ return this;
2048
+ };
2049
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2050
+ Array.from(iteratorWithReturn, function () { throw 2; });
2051
+ } catch (error) { /* empty */ }
2052
+
2053
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2054
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2055
+ var ITERATION_SUPPORT = false;
2056
+ try {
2057
+ var object = {};
2058
+ object[ITERATOR$4] = function () {
2059
+ return {
2060
+ next: function () {
2061
+ return { done: ITERATION_SUPPORT = true };
2062
+ }
2063
+ };
2064
+ };
2065
+ exec(object);
2066
+ } catch (error) { /* empty */ }
2067
+ return ITERATION_SUPPORT;
2068
+ };
2069
+
2070
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2071
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2072
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2073
+
2074
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2075
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2033
2076
  });
2034
2077
 
2035
- $$7({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
2036
- // `Promise.all` method
2037
- // https://tc39.es/ecma262/#sec-promise.all
2078
+ var $$c = _export;
2079
+ var call$8 = functionCall;
2080
+ var aCallable$2 = aCallable$8;
2081
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2082
+ var perform$1 = perform$3;
2083
+ var iterate$1 = iterate$2;
2084
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2085
+
2086
+ // `Promise.all` method
2087
+ // https://tc39.es/ecma262/#sec-promise.all
2088
+ $$c({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2038
2089
  all: function all(iterable) {
2039
2090
  var C = this;
2040
- var capability = newPromiseCapability(C);
2091
+ var capability = newPromiseCapabilityModule$2.f(C);
2041
2092
  var resolve = capability.resolve;
2042
2093
  var reject = capability.reject;
2043
- var result = perform(function () {
2044
- var $promiseResolve = aCallable$1(C.resolve);
2094
+ var result = perform$1(function () {
2095
+ var $promiseResolve = aCallable$2(C.resolve);
2045
2096
  var values = [];
2046
2097
  var counter = 0;
2047
2098
  var remaining = 1;
2048
- iterate(iterable, function (promise) {
2099
+ iterate$1(iterable, function (promise) {
2049
2100
  var index = counter++;
2050
2101
  var alreadyCalled = false;
2051
2102
  remaining++;
2052
- call$6($promiseResolve, C, promise).then(function (value) {
2103
+ call$8($promiseResolve, C, promise).then(function (value) {
2053
2104
  if (alreadyCalled) return;
2054
2105
  alreadyCalled = true;
2055
2106
  values[index] = value;
@@ -2060,17 +2111,53 @@ $$7({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
2060
2111
  });
2061
2112
  if (result.error) reject(result.value);
2062
2113
  return capability.promise;
2063
- },
2064
- // `Promise.race` method
2065
- // https://tc39.es/ecma262/#sec-promise.race
2114
+ }
2115
+ });
2116
+
2117
+ var $$b = _export;
2118
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2119
+ var NativePromiseConstructor = promiseNativeConstructor;
2120
+ var getBuiltIn$1 = getBuiltIn$8;
2121
+ var isCallable$5 = isCallable$m;
2122
+ var defineBuiltIn$4 = defineBuiltIn$7;
2123
+
2124
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2125
+
2126
+ // `Promise.prototype.catch` method
2127
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2128
+ $$b({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2129
+ 'catch': function (onRejected) {
2130
+ return this.then(undefined, onRejected);
2131
+ }
2132
+ });
2133
+
2134
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2135
+ if (isCallable$5(NativePromiseConstructor)) {
2136
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2137
+ if (NativePromisePrototype['catch'] !== method) {
2138
+ defineBuiltIn$4(NativePromisePrototype, 'catch', method, { unsafe: true });
2139
+ }
2140
+ }
2141
+
2142
+ var $$a = _export;
2143
+ var call$7 = functionCall;
2144
+ var aCallable$1 = aCallable$8;
2145
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2146
+ var perform = perform$3;
2147
+ var iterate = iterate$2;
2148
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2149
+
2150
+ // `Promise.race` method
2151
+ // https://tc39.es/ecma262/#sec-promise.race
2152
+ $$a({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2066
2153
  race: function race(iterable) {
2067
2154
  var C = this;
2068
- var capability = newPromiseCapability(C);
2155
+ var capability = newPromiseCapabilityModule$1.f(C);
2069
2156
  var reject = capability.reject;
2070
2157
  var result = perform(function () {
2071
2158
  var $promiseResolve = aCallable$1(C.resolve);
2072
2159
  iterate(iterable, function (promise) {
2073
- call$6($promiseResolve, C, promise).then(capability.resolve, reject);
2160
+ call$7($promiseResolve, C, promise).then(capability.resolve, reject);
2074
2161
  });
2075
2162
  });
2076
2163
  if (result.error) reject(result.value);
@@ -2078,6 +2165,49 @@ $$7({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
2078
2165
  }
2079
2166
  });
2080
2167
 
2168
+ var $$9 = _export;
2169
+ var call$6 = functionCall;
2170
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2171
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2172
+
2173
+ // `Promise.reject` method
2174
+ // https://tc39.es/ecma262/#sec-promise.reject
2175
+ $$9({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2176
+ reject: function reject(r) {
2177
+ var capability = newPromiseCapabilityModule.f(this);
2178
+ call$6(capability.reject, undefined, r);
2179
+ return capability.promise;
2180
+ }
2181
+ });
2182
+
2183
+ var anObject$6 = anObject$e;
2184
+ var isObject$2 = isObject$9;
2185
+ var newPromiseCapability = newPromiseCapability$2;
2186
+
2187
+ var promiseResolve$1 = function (C, x) {
2188
+ anObject$6(C);
2189
+ if (isObject$2(x) && x.constructor === C) return x;
2190
+ var promiseCapability = newPromiseCapability.f(C);
2191
+ var resolve = promiseCapability.resolve;
2192
+ resolve(x);
2193
+ return promiseCapability.promise;
2194
+ };
2195
+
2196
+ var $$8 = _export;
2197
+ var getBuiltIn = getBuiltIn$8;
2198
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2199
+ var promiseResolve = promiseResolve$1;
2200
+
2201
+ getBuiltIn('Promise');
2202
+
2203
+ // `Promise.resolve` method
2204
+ // https://tc39.es/ecma262/#sec-promise.resolve
2205
+ $$8({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2206
+ resolve: function resolve(x) {
2207
+ return promiseResolve(this, x);
2208
+ }
2209
+ });
2210
+
2081
2211
  var internalObjectKeys = objectKeysInternal;
2082
2212
  var enumBugKeys$1 = enumBugKeys$3;
2083
2213
 
@@ -2089,9 +2219,9 @@ var objectKeys$2 = Object.keys || function keys(O) {
2089
2219
  };
2090
2220
 
2091
2221
  var DESCRIPTORS$2 = descriptors;
2092
- var uncurryThis$a = functionUncurryThis;
2222
+ var uncurryThis$9 = functionUncurryThis;
2093
2223
  var call$5 = functionCall;
2094
- var fails$a = fails$k;
2224
+ var fails$b = fails$m;
2095
2225
  var objectKeys$1 = objectKeys$2;
2096
2226
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2097
2227
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
@@ -2101,17 +2231,17 @@ var IndexedObject$1 = indexedObject;
2101
2231
  // eslint-disable-next-line es/no-object-assign -- safe
2102
2232
  var $assign = Object.assign;
2103
2233
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2104
- var defineProperty$1 = Object.defineProperty;
2105
- var concat$1 = uncurryThis$a([].concat);
2234
+ var defineProperty$2 = Object.defineProperty;
2235
+ var concat$1 = uncurryThis$9([].concat);
2106
2236
 
2107
2237
  // `Object.assign` method
2108
2238
  // https://tc39.es/ecma262/#sec-object.assign
2109
- var objectAssign = !$assign || fails$a(function () {
2239
+ var objectAssign = !$assign || fails$b(function () {
2110
2240
  // should have correct order of operations (Edge bug)
2111
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
2241
+ if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
2112
2242
  enumerable: true,
2113
2243
  get: function () {
2114
- defineProperty$1(this, 'b', {
2244
+ defineProperty$2(this, 'b', {
2115
2245
  value: 3,
2116
2246
  enumerable: false
2117
2247
  });
@@ -2145,53 +2275,201 @@ var objectAssign = !$assign || fails$a(function () {
2145
2275
  } return T;
2146
2276
  } : $assign;
2147
2277
 
2148
- var $$6 = _export;
2278
+ var $$7 = _export;
2149
2279
  var assign = objectAssign;
2150
2280
 
2151
2281
  // `Object.assign` method
2152
2282
  // https://tc39.es/ecma262/#sec-object.assign
2153
2283
  // eslint-disable-next-line es/no-object-assign -- required for testing
2154
- $$6({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
2284
+ $$7({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2155
2285
  assign: assign
2156
2286
  });
2157
2287
 
2158
- var isObject = isObject$8;
2159
- var classof$2 = classofRaw$1;
2288
+ var objectDefineProperties = {};
2289
+
2290
+ var DESCRIPTORS$1 = descriptors;
2291
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
2292
+ var definePropertyModule = objectDefineProperty;
2293
+ var anObject$5 = anObject$e;
2294
+ var toIndexedObject$1 = toIndexedObject$5;
2295
+ var objectKeys = objectKeys$2;
2296
+
2297
+ // `Object.defineProperties` method
2298
+ // https://tc39.es/ecma262/#sec-object.defineproperties
2299
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
2300
+ objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
2301
+ anObject$5(O);
2302
+ var props = toIndexedObject$1(Properties);
2303
+ var keys = objectKeys(Properties);
2304
+ var length = keys.length;
2305
+ var index = 0;
2306
+ var key;
2307
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
2308
+ return O;
2309
+ };
2310
+
2311
+ /* global ActiveXObject -- old IE, WSH */
2312
+
2313
+ var anObject$4 = anObject$e;
2314
+ var definePropertiesModule = objectDefineProperties;
2315
+ var enumBugKeys = enumBugKeys$3;
2316
+ var hiddenKeys = hiddenKeys$4;
2317
+ var html = html$2;
2318
+ var documentCreateElement$1 = documentCreateElement$2;
2319
+ var sharedKey$1 = sharedKey$3;
2320
+
2321
+ var GT = '>';
2322
+ var LT = '<';
2323
+ var PROTOTYPE = 'prototype';
2324
+ var SCRIPT = 'script';
2325
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
2326
+
2327
+ var EmptyConstructor = function () { /* empty */ };
2328
+
2329
+ var scriptTag = function (content) {
2330
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2331
+ };
2332
+
2333
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2334
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
2335
+ activeXDocument.write(scriptTag(''));
2336
+ activeXDocument.close();
2337
+ var temp = activeXDocument.parentWindow.Object;
2338
+ activeXDocument = null; // avoid memory leak
2339
+ return temp;
2340
+ };
2341
+
2342
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
2343
+ var NullProtoObjectViaIFrame = function () {
2344
+ // Thrash, waste and sodomy: IE GC bug
2345
+ var iframe = documentCreateElement$1('iframe');
2346
+ var JS = 'java' + SCRIPT + ':';
2347
+ var iframeDocument;
2348
+ iframe.style.display = 'none';
2349
+ html.appendChild(iframe);
2350
+ // https://github.com/zloirock/core-js/issues/475
2351
+ iframe.src = String(JS);
2352
+ iframeDocument = iframe.contentWindow.document;
2353
+ iframeDocument.open();
2354
+ iframeDocument.write(scriptTag('document.F=Object'));
2355
+ iframeDocument.close();
2356
+ return iframeDocument.F;
2357
+ };
2358
+
2359
+ // Check for document.domain and active x support
2360
+ // No need to use active x approach when document.domain is not set
2361
+ // see https://github.com/es-shims/es5-shim/issues/150
2362
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2363
+ // avoid IE GC bug
2364
+ var activeXDocument;
2365
+ var NullProtoObject = function () {
2366
+ try {
2367
+ activeXDocument = new ActiveXObject('htmlfile');
2368
+ } catch (error) { /* ignore */ }
2369
+ NullProtoObject = typeof document != 'undefined'
2370
+ ? document.domain && activeXDocument
2371
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2372
+ : NullProtoObjectViaIFrame()
2373
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
2374
+ var length = enumBugKeys.length;
2375
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2376
+ return NullProtoObject();
2377
+ };
2378
+
2379
+ hiddenKeys[IE_PROTO$1] = true;
2380
+
2381
+ // `Object.create` method
2382
+ // https://tc39.es/ecma262/#sec-object.create
2383
+ // eslint-disable-next-line es/no-object-create -- safe
2384
+ var objectCreate = Object.create || function create(O, Properties) {
2385
+ var result;
2386
+ if (O !== null) {
2387
+ EmptyConstructor[PROTOTYPE] = anObject$4(O);
2388
+ result = new EmptyConstructor();
2389
+ EmptyConstructor[PROTOTYPE] = null;
2390
+ // add "__proto__" for Object.getPrototypeOf polyfill
2391
+ result[IE_PROTO$1] = O;
2392
+ } else result = NullProtoObject();
2393
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2394
+ };
2395
+
2160
2396
  var wellKnownSymbol$7 = wellKnownSymbol$i;
2397
+ var create$2 = objectCreate;
2398
+ var defineProperty$1 = objectDefineProperty.f;
2161
2399
 
2162
- var MATCH$1 = wellKnownSymbol$7('match');
2400
+ var UNSCOPABLES = wellKnownSymbol$7('unscopables');
2401
+ var ArrayPrototype = Array.prototype;
2402
+
2403
+ // Array.prototype[@@unscopables]
2404
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2405
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
2406
+ defineProperty$1(ArrayPrototype, UNSCOPABLES, {
2407
+ configurable: true,
2408
+ value: create$2(null)
2409
+ });
2410
+ }
2411
+
2412
+ // add a key to Array.prototype[@@unscopables]
2413
+ var addToUnscopables$2 = function (key) {
2414
+ ArrayPrototype[UNSCOPABLES][key] = true;
2415
+ };
2416
+
2417
+ var $$6 = _export;
2418
+ var $includes = arrayIncludes.includes;
2419
+ var fails$a = fails$m;
2420
+ var addToUnscopables$1 = addToUnscopables$2;
2421
+
2422
+ // FF99+ bug
2423
+ var BROKEN_ON_SPARSE = fails$a(function () {
2424
+ return !Array(1).includes();
2425
+ });
2426
+
2427
+ // `Array.prototype.includes` method
2428
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
2429
+ $$6({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2430
+ includes: function includes(el /* , fromIndex = 0 */) {
2431
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2432
+ }
2433
+ });
2434
+
2435
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2436
+ addToUnscopables$1('includes');
2437
+
2438
+ var isObject$1 = isObject$9;
2439
+ var classof$2 = classofRaw$2;
2440
+ var wellKnownSymbol$6 = wellKnownSymbol$i;
2441
+
2442
+ var MATCH$1 = wellKnownSymbol$6('match');
2163
2443
 
2164
2444
  // `IsRegExp` abstract operation
2165
2445
  // https://tc39.es/ecma262/#sec-isregexp
2166
2446
  var isRegexp = function (it) {
2167
2447
  var isRegExp;
2168
- return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$2(it) == 'RegExp');
2448
+ return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$2(it) == 'RegExp');
2169
2449
  };
2170
2450
 
2171
- var global$b = global$K;
2172
- var isRegExp$1 = isRegexp;
2451
+ var isRegExp = isRegexp;
2173
2452
 
2174
- var TypeError$3 = global$b.TypeError;
2453
+ var $TypeError$2 = TypeError;
2175
2454
 
2176
2455
  var notARegexp = function (it) {
2177
- if (isRegExp$1(it)) {
2178
- throw TypeError$3("The method doesn't accept regular expressions");
2456
+ if (isRegExp(it)) {
2457
+ throw $TypeError$2("The method doesn't accept regular expressions");
2179
2458
  } return it;
2180
2459
  };
2181
2460
 
2182
- var global$a = global$K;
2183
- var classof$1 = classof$6;
2461
+ var classof$1 = classof$5;
2184
2462
 
2185
- var String$1 = global$a.String;
2463
+ var $String = String;
2186
2464
 
2187
- var toString$8 = function (argument) {
2465
+ var toString$7 = function (argument) {
2188
2466
  if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2189
- return String$1(argument);
2467
+ return $String(argument);
2190
2468
  };
2191
2469
 
2192
- var wellKnownSymbol$6 = wellKnownSymbol$i;
2470
+ var wellKnownSymbol$5 = wellKnownSymbol$i;
2193
2471
 
2194
- var MATCH = wellKnownSymbol$6('match');
2472
+ var MATCH = wellKnownSymbol$5('match');
2195
2473
 
2196
2474
  var correctIsRegexpLogic = function (METHOD_NAME) {
2197
2475
  var regexp = /./;
@@ -2206,27 +2484,27 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
2206
2484
  };
2207
2485
 
2208
2486
  var $$5 = _export;
2209
- var uncurryThis$9 = functionUncurryThis;
2487
+ var uncurryThis$8 = functionUncurryThis;
2210
2488
  var notARegExp$1 = notARegexp;
2211
- var requireObjectCoercible$5 = requireObjectCoercible$8;
2212
- var toString$7 = toString$8;
2489
+ var requireObjectCoercible$4 = requireObjectCoercible$7;
2490
+ var toString$6 = toString$7;
2213
2491
  var correctIsRegExpLogic$1 = correctIsRegexpLogic;
2214
2492
 
2215
- var stringIndexOf$1 = uncurryThis$9(''.indexOf);
2493
+ var stringIndexOf$1 = uncurryThis$8(''.indexOf);
2216
2494
 
2217
2495
  // `String.prototype.includes` method
2218
2496
  // https://tc39.es/ecma262/#sec-string.prototype.includes
2219
2497
  $$5({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
2220
2498
  includes: function includes(searchString /* , position = 0 */) {
2221
2499
  return !!~stringIndexOf$1(
2222
- toString$7(requireObjectCoercible$5(this)),
2223
- toString$7(notARegExp$1(searchString)),
2500
+ toString$6(requireObjectCoercible$4(this)),
2501
+ toString$6(notARegExp$1(searchString)),
2224
2502
  arguments.length > 1 ? arguments[1] : undefined
2225
2503
  );
2226
2504
  }
2227
2505
  });
2228
2506
 
2229
- /*! *****************************************************************************
2507
+ /******************************************************************************
2230
2508
  Copyright (c) Microsoft Corporation.
2231
2509
 
2232
2510
  Permission to use, copy, modify, and/or distribute this software for any
@@ -2268,7 +2546,6 @@ const buildClientNinetailedRequestContext = () => ({
2268
2546
  * wait time because you can simply await `Promise.timeout` inside `fn`
2269
2547
  * to wait some time before the next call.
2270
2548
  */
2271
-
2272
2549
  function asyncThrottle(fn) {
2273
2550
  let runningPromise;
2274
2551
  let queuedPromise;
@@ -2276,7 +2553,6 @@ function asyncThrottle(fn) {
2276
2553
  return args => __awaiter(this, void 0, void 0, function* () {
2277
2554
  if (runningPromise) {
2278
2555
  nextArgs = args;
2279
-
2280
2556
  if (queuedPromise) {
2281
2557
  return queuedPromise;
2282
2558
  } else {
@@ -2298,145 +2574,160 @@ const LEGACY_ANONYMOUS_ID = '__anon_id';
2298
2574
  const ANONYMOUS_ID = '__nt_anonymous_id__';
2299
2575
  const DEBUG_FLAG = '__nt_debug__';
2300
2576
  const PROFILE_FALLBACK_CACHE = '__nt_profile__';
2577
+ const PROFILE_CHANGE = 'profile-change';
2578
+ const PROFILE_RESET = 'profile-reset';
2301
2579
 
2302
- const NINETAILED_TRACKER_EVENTS = {
2303
- /**
2304
- * `profile` - Fires when the profile is returned by the cdp API.
2305
- */
2306
- profile: 'profile'
2307
- };
2308
2580
  const PLUGIN_NAME = 'ninetailed';
2309
-
2310
2581
  const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
2311
-
2312
- const emptyProfile = {
2313
- id: '',
2314
- random: 0,
2315
- audiences: [],
2316
- traits: {},
2317
- location: {}
2318
- };
2319
2582
  const ninetailedPlugin = ({
2320
- clientId,
2321
- environment,
2322
- preview: _preview = false,
2323
- url,
2583
+ apiClient,
2324
2584
  profile,
2325
- locale
2585
+ locale,
2586
+ ninetailed
2326
2587
  }) => {
2327
- const apiClient = new NinetailedApiClient({
2328
- clientId,
2329
- environment,
2330
- url
2331
- });
2588
+ let _instance;
2332
2589
  let queue = [];
2333
-
2334
- const flush = instance => __awaiter(void 0, void 0, void 0, function* () {
2590
+ const flush = () => __awaiter(void 0, void 0, void 0, function* () {
2335
2591
  const events = Object.assign([], queue);
2336
2592
  logger.info('Start flushing events.');
2337
2593
  queue = [];
2338
-
2339
2594
  if (!events.length) {
2340
- return;
2595
+ return {
2596
+ success: true
2597
+ };
2341
2598
  }
2342
-
2343
2599
  try {
2344
- const anonymousId = instance.storage.getItem(ANONYMOUS_ID);
2345
- const profile = yield apiClient.upsertProfile(events, anonymousId);
2346
- instance.storage.setItem(ANONYMOUS_ID, profile.id);
2347
- instance.storage.setItem(PROFILE_FALLBACK_CACHE, profile);
2600
+ const anonymousId = _instance.storage.getItem(ANONYMOUS_ID);
2601
+ const profile = yield apiClient.upsertProfile({
2602
+ profileId: anonymousId,
2603
+ events
2604
+ }, {
2605
+ locale
2606
+ });
2607
+ _instance.storage.setItem(ANONYMOUS_ID, profile.id);
2608
+ _instance.storage.setItem(PROFILE_FALLBACK_CACHE, profile);
2348
2609
  logger.debug('Profile from api: ', profile);
2349
- instance.dispatch({
2350
- type: NINETAILED_TRACKER_EVENTS.profile,
2610
+ _instance.dispatch({
2611
+ type: PROFILE_CHANGE,
2351
2612
  profile
2352
2613
  });
2614
+ yield delay(20);
2615
+ return {
2616
+ success: true
2617
+ };
2353
2618
  } catch (error) {
2354
2619
  logger.debug('An error occurred during flushing the events: ', error);
2355
- const fallbackProfile = instance.storage.getItem(PROFILE_FALLBACK_CACHE) || emptyProfile;
2356
- instance.dispatch({
2357
- type: NINETAILED_TRACKER_EVENTS.profile,
2358
- profile: fallbackProfile
2359
- });
2360
- } // This is necessary to make sure that the cache is updated before the next flush is performed
2361
-
2362
-
2363
- yield delay(20);
2620
+ const fallbackProfile = _instance.storage.getItem(PROFILE_FALLBACK_CACHE);
2621
+ if (fallbackProfile) {
2622
+ logger.debug('Found a fallback profile - will use this.');
2623
+ _instance.dispatch({
2624
+ type: PROFILE_CHANGE,
2625
+ profile: fallbackProfile
2626
+ });
2627
+ return {
2628
+ success: false
2629
+ };
2630
+ } else {
2631
+ logger.debug('No fallback profile found - setting profile to null.');
2632
+ _instance.dispatch({
2633
+ type: PROFILE_CHANGE,
2634
+ // TODO is it a good idea to set the profile to null?
2635
+ profile: null,
2636
+ error
2637
+ });
2638
+ return {
2639
+ success: false
2640
+ };
2641
+ }
2642
+ }
2364
2643
  });
2365
-
2366
- const throttledFlush = asyncThrottle(flush);
2367
-
2368
- const enqueueEvent = (event, instance) => __awaiter(void 0, void 0, void 0, function* () {
2644
+ const enqueueEvent = event => __awaiter(void 0, void 0, void 0, function* () {
2369
2645
  queue = unionBy([event], queue, 'messageId');
2370
- throttledFlush(instance);
2371
2646
  });
2372
-
2647
+ const abortNonClientEvents = ({
2648
+ abort,
2649
+ payload
2650
+ }) => {
2651
+ if (typeof window !== 'object') {
2652
+ return abort();
2653
+ }
2654
+ return payload;
2655
+ };
2373
2656
  return {
2374
2657
  name: 'ninetailed',
2375
2658
  config: {},
2376
2659
  initialize: ({
2377
2660
  instance
2378
2661
  }) => {
2662
+ _instance = instance;
2379
2663
  if (instance.storage.getItem(DEBUG_FLAG)) {
2380
2664
  logger.addSink(new ConsoleLogSink());
2381
2665
  logger.info('Ninetailed Debug Mode is enabled.');
2382
- } // legacy support for the old anonymousId
2383
-
2384
-
2666
+ }
2667
+ // legacy support for the old anonymousId
2385
2668
  const legacyAnonymousId = instance.storage.getItem(LEGACY_ANONYMOUS_ID);
2386
-
2387
2669
  if (legacyAnonymousId) {
2388
2670
  logger.debug('Found legacy anonymousId, migrating to new one.', legacyAnonymousId);
2389
2671
  instance.storage.setItem(ANONYMOUS_ID, legacyAnonymousId);
2390
2672
  instance.storage.removeItem(LEGACY_ANONYMOUS_ID);
2391
2673
  }
2392
-
2393
2674
  if (profile) {
2394
2675
  instance.storage.setItem(ANONYMOUS_ID, profile.id);
2395
2676
  }
2396
-
2397
2677
  logger.debug('Ninetailed Core plugin initialized.');
2398
2678
  },
2679
+ flush: asyncThrottle(flush),
2680
+ pageStart: params => {
2681
+ return abortNonClientEvents(params);
2682
+ },
2399
2683
  page: ({
2400
- payload,
2401
- instance
2684
+ payload
2402
2685
  }) => __awaiter(void 0, void 0, void 0, function* () {
2403
2686
  logger.info('Sending Page event.');
2404
2687
  const ctx = buildClientNinetailedRequestContext();
2405
- yield enqueueEvent(buildPageEvent({
2688
+ return enqueueEvent(buildPageEvent({
2406
2689
  messageId: payload.meta.rid,
2407
2690
  timestamp: payload.meta.ts,
2408
2691
  properties: payload.properties,
2409
2692
  ctx
2410
- }), instance);
2693
+ }));
2411
2694
  }),
2695
+ trackStart: params => {
2696
+ return abortNonClientEvents(params);
2697
+ },
2412
2698
  track: ({
2413
- payload,
2414
- instance
2699
+ payload
2415
2700
  }) => __awaiter(void 0, void 0, void 0, function* () {
2416
2701
  logger.info('Sending Track event.');
2417
2702
  const ctx = buildClientNinetailedRequestContext();
2418
- yield enqueueEvent(buildTrackEvent({
2703
+ return enqueueEvent(buildTrackEvent({
2419
2704
  messageId: payload.meta.rid,
2420
2705
  timestamp: payload.meta.ts,
2421
2706
  event: payload.event,
2422
2707
  properties: payload.properties,
2423
2708
  ctx
2424
- }), instance);
2709
+ }));
2425
2710
  }),
2711
+ identifyStart: params => {
2712
+ return abortNonClientEvents(params);
2713
+ },
2426
2714
  identify: ({
2427
- payload,
2428
- instance
2715
+ payload
2429
2716
  }) => __awaiter(void 0, void 0, void 0, function* () {
2430
2717
  logger.info('Sending Identify event.');
2431
2718
  const ctx = buildClientNinetailedRequestContext();
2432
- yield enqueueEvent(buildIdentifyEvent({
2719
+ if (payload.userId === '' && (!payload.traits || typeof payload.traits === 'object' && Object.keys(payload.traits).length === 0)) {
2720
+ logger.info('Skipping Identify event as no userId and no traits are set.');
2721
+ return;
2722
+ }
2723
+ return enqueueEvent(buildIdentifyEvent({
2433
2724
  // doing this here as the anonymous id is set to late from init
2434
2725
  messageId: payload.meta.rid,
2435
2726
  timestamp: payload.meta.ts,
2436
2727
  traits: payload.traits,
2437
2728
  userId: payload.userId,
2438
2729
  ctx
2439
- }), instance);
2730
+ }));
2440
2731
  }),
2441
2732
  setItemStart: ({
2442
2733
  abort,
@@ -2445,201 +2736,134 @@ const ninetailedPlugin = ({
2445
2736
  if (![ANONYMOUS_ID, DEBUG_FLAG, PROFILE_FALLBACK_CACHE].includes(payload.key)) {
2446
2737
  return abort();
2447
2738
  }
2448
-
2449
2739
  return payload;
2450
2740
  },
2451
2741
  methods: {
2452
2742
  reset: (...args) => __awaiter(void 0, void 0, void 0, function* () {
2743
+ // TODO it seems reset gets called during Next.js SSR builds. Need to verify that.
2744
+ logger.debug('Resetting profile.');
2453
2745
  const instance = args[args.length - 1];
2454
- yield instance.storage.removeItem(ANONYMOUS_ID);
2455
2746
  instance.dispatch({
2456
- type: NINETAILED_TRACKER_EVENTS.profile,
2457
- profile: emptyProfile
2747
+ type: PROFILE_RESET
2458
2748
  });
2749
+ instance.storage.removeItem(ANONYMOUS_ID);
2750
+ instance.storage.removeItem(PROFILE_FALLBACK_CACHE);
2751
+ logger.debug('Removed old profile data from localstorage.');
2752
+ yield ninetailed.track('nt_reset');
2753
+ logger.info('Profile reset successful.');
2459
2754
  yield delay(10);
2460
2755
  }),
2461
2756
  debug: (...args) => __awaiter(void 0, void 0, void 0, function* () {
2462
2757
  const enabled = args[0];
2463
2758
  const instance = args[args.length - 1];
2464
2759
  const consoleLogSink = new ConsoleLogSink();
2465
-
2466
2760
  if (enabled) {
2467
- yield instance.storage.setItem(DEBUG_FLAG, true);
2761
+ instance.storage.setItem(DEBUG_FLAG, true);
2468
2762
  logger.addSink(consoleLogSink);
2469
2763
  logger.info('Debug mode enabled.');
2470
2764
  } else {
2471
- yield instance.storage.removeItem(DEBUG_FLAG);
2765
+ instance.storage.removeItem(DEBUG_FLAG);
2472
2766
  logger.info('Debug mode disabled.');
2473
2767
  logger.removeSink(consoleLogSink.name);
2474
2768
  }
2475
- })
2476
- }
2477
- };
2478
- };
2479
-
2480
- var objectDefineProperties = {};
2481
-
2482
- var DESCRIPTORS$1 = descriptors;
2483
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
2484
- var definePropertyModule$2 = objectDefineProperty;
2485
- var anObject$5 = anObject$e;
2486
- var toIndexedObject$1 = toIndexedObject$5;
2487
- var objectKeys = objectKeys$2;
2488
-
2489
- // `Object.defineProperties` method
2490
- // https://tc39.es/ecma262/#sec-object.defineproperties
2491
- // eslint-disable-next-line es/no-object-defineproperties -- safe
2492
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
2493
- anObject$5(O);
2494
- var props = toIndexedObject$1(Properties);
2495
- var keys = objectKeys(Properties);
2496
- var length = keys.length;
2497
- var index = 0;
2498
- var key;
2499
- while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
2500
- return O;
2501
- };
2502
-
2503
- /* global ActiveXObject -- old IE, WSH */
2504
-
2505
- var anObject$4 = anObject$e;
2506
- var definePropertiesModule = objectDefineProperties;
2507
- var enumBugKeys = enumBugKeys$3;
2508
- var hiddenKeys = hiddenKeys$4;
2509
- var html = html$2;
2510
- var documentCreateElement$1 = documentCreateElement$2;
2511
- var sharedKey$1 = sharedKey$3;
2512
-
2513
- var GT = '>';
2514
- var LT = '<';
2515
- var PROTOTYPE = 'prototype';
2516
- var SCRIPT = 'script';
2517
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
2518
-
2519
- var EmptyConstructor = function () { /* empty */ };
2520
-
2521
- var scriptTag = function (content) {
2522
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2523
- };
2524
-
2525
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2526
- var NullProtoObjectViaActiveX = function (activeXDocument) {
2527
- activeXDocument.write(scriptTag(''));
2528
- activeXDocument.close();
2529
- var temp = activeXDocument.parentWindow.Object;
2530
- activeXDocument = null; // avoid memory leak
2531
- return temp;
2532
- };
2533
-
2534
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
2535
- var NullProtoObjectViaIFrame = function () {
2536
- // Thrash, waste and sodomy: IE GC bug
2537
- var iframe = documentCreateElement$1('iframe');
2538
- var JS = 'java' + SCRIPT + ':';
2539
- var iframeDocument;
2540
- iframe.style.display = 'none';
2541
- html.appendChild(iframe);
2542
- // https://github.com/zloirock/core-js/issues/475
2543
- iframe.src = String(JS);
2544
- iframeDocument = iframe.contentWindow.document;
2545
- iframeDocument.open();
2546
- iframeDocument.write(scriptTag('document.F=Object'));
2547
- iframeDocument.close();
2548
- return iframeDocument.F;
2549
- };
2550
-
2551
- // Check for document.domain and active x support
2552
- // No need to use active x approach when document.domain is not set
2553
- // see https://github.com/es-shims/es5-shim/issues/150
2554
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2555
- // avoid IE GC bug
2556
- var activeXDocument;
2557
- var NullProtoObject = function () {
2558
- try {
2559
- activeXDocument = new ActiveXObject('htmlfile');
2560
- } catch (error) { /* ignore */ }
2561
- NullProtoObject = typeof document != 'undefined'
2562
- ? document.domain && activeXDocument
2563
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2564
- : NullProtoObjectViaIFrame()
2565
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
2566
- var length = enumBugKeys.length;
2567
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2568
- return NullProtoObject();
2769
+ })
2770
+ }
2771
+ };
2569
2772
  };
2570
2773
 
2571
- hiddenKeys[IE_PROTO$1] = true;
2774
+ var anObject$3 = anObject$e;
2572
2775
 
2573
- // `Object.create` method
2574
- // https://tc39.es/ecma262/#sec-object.create
2575
- var objectCreate = Object.create || function create(O, Properties) {
2576
- var result;
2577
- if (O !== null) {
2578
- EmptyConstructor[PROTOTYPE] = anObject$4(O);
2579
- result = new EmptyConstructor();
2580
- EmptyConstructor[PROTOTYPE] = null;
2581
- // add "__proto__" for Object.getPrototypeOf polyfill
2582
- result[IE_PROTO$1] = O;
2583
- } else result = NullProtoObject();
2584
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2776
+ // `RegExp.prototype.flags` getter implementation
2777
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
2778
+ var regexpFlags$1 = function () {
2779
+ var that = anObject$3(this);
2780
+ var result = '';
2781
+ if (that.hasIndices) result += 'd';
2782
+ if (that.global) result += 'g';
2783
+ if (that.ignoreCase) result += 'i';
2784
+ if (that.multiline) result += 'm';
2785
+ if (that.dotAll) result += 's';
2786
+ if (that.unicode) result += 'u';
2787
+ if (that.unicodeSets) result += 'v';
2788
+ if (that.sticky) result += 'y';
2789
+ return result;
2585
2790
  };
2586
2791
 
2587
- var wellKnownSymbol$5 = wellKnownSymbol$i;
2588
- var create$2 = objectCreate;
2589
- var definePropertyModule$1 = objectDefineProperty;
2590
-
2591
- var UNSCOPABLES = wellKnownSymbol$5('unscopables');
2592
- var ArrayPrototype = Array.prototype;
2792
+ var call$4 = functionCall;
2793
+ var hasOwn$1 = hasOwnProperty_1;
2794
+ var isPrototypeOf = objectIsPrototypeOf;
2795
+ var regExpFlags = regexpFlags$1;
2593
2796
 
2594
- // Array.prototype[@@unscopables]
2595
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2596
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
2597
- definePropertyModule$1.f(ArrayPrototype, UNSCOPABLES, {
2598
- configurable: true,
2599
- value: create$2(null)
2600
- });
2601
- }
2797
+ var RegExpPrototype$2 = RegExp.prototype;
2602
2798
 
2603
- // add a key to Array.prototype[@@unscopables]
2604
- var addToUnscopables$1 = function (key) {
2605
- ArrayPrototype[UNSCOPABLES][key] = true;
2799
+ var regexpGetFlags = function (R) {
2800
+ var flags = R.flags;
2801
+ return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$1(R, 'flags') && isPrototypeOf(RegExpPrototype$2, R)
2802
+ ? call$4(regExpFlags, R) : flags;
2606
2803
  };
2607
2804
 
2608
- var fails$9 = fails$k;
2805
+ var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
2806
+ var defineBuiltIn$3 = defineBuiltIn$7;
2807
+ var anObject$2 = anObject$e;
2808
+ var $toString = toString$7;
2809
+ var fails$9 = fails$m;
2810
+ var getRegExpFlags = regexpGetFlags;
2811
+
2812
+ var TO_STRING = 'toString';
2813
+ var RegExpPrototype$1 = RegExp.prototype;
2814
+ var nativeToString = RegExpPrototype$1[TO_STRING];
2815
+
2816
+ var NOT_GENERIC = fails$9(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
2817
+ // FF44- RegExp#toString has a wrong name
2818
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING;
2819
+
2820
+ // `RegExp.prototype.toString` method
2821
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
2822
+ if (NOT_GENERIC || INCORRECT_NAME) {
2823
+ defineBuiltIn$3(RegExp.prototype, TO_STRING, function toString() {
2824
+ var R = anObject$2(this);
2825
+ var pattern = $toString(R.source);
2826
+ var flags = $toString(getRegExpFlags(R));
2827
+ return '/' + pattern + '/' + flags;
2828
+ }, { unsafe: true });
2829
+ }
2830
+
2831
+ var fails$8 = fails$m;
2609
2832
 
2610
- var correctPrototypeGetter = !fails$9(function () {
2833
+ var correctPrototypeGetter = !fails$8(function () {
2611
2834
  function F() { /* empty */ }
2612
2835
  F.prototype.constructor = null;
2613
2836
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2614
2837
  return Object.getPrototypeOf(new F()) !== F.prototype;
2615
2838
  });
2616
2839
 
2617
- var global$9 = global$K;
2618
2840
  var hasOwn = hasOwnProperty_1;
2619
- var isCallable$4 = isCallable$j;
2841
+ var isCallable$4 = isCallable$m;
2620
2842
  var toObject$2 = toObject$5;
2621
2843
  var sharedKey = sharedKey$3;
2622
2844
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
2623
2845
 
2624
2846
  var IE_PROTO = sharedKey('IE_PROTO');
2625
- var Object$1 = global$9.Object;
2626
- var ObjectPrototype = Object$1.prototype;
2847
+ var $Object = Object;
2848
+ var ObjectPrototype = $Object.prototype;
2627
2849
 
2628
2850
  // `Object.getPrototypeOf` method
2629
2851
  // https://tc39.es/ecma262/#sec-object.getprototypeof
2630
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$1.getPrototypeOf : function (O) {
2852
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
2853
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
2631
2854
  var object = toObject$2(O);
2632
2855
  if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
2633
2856
  var constructor = object.constructor;
2634
2857
  if (isCallable$4(constructor) && object instanceof constructor) {
2635
2858
  return constructor.prototype;
2636
- } return object instanceof Object$1 ? ObjectPrototype : null;
2859
+ } return object instanceof $Object ? ObjectPrototype : null;
2637
2860
  };
2638
2861
 
2639
- var fails$8 = fails$k;
2640
- var isCallable$3 = isCallable$j;
2862
+ var fails$7 = fails$m;
2863
+ var isCallable$3 = isCallable$m;
2864
+ var isObject = isObject$9;
2641
2865
  var getPrototypeOf$1 = objectGetPrototypeOf;
2642
- var redefine$2 = redefine$6.exports;
2866
+ var defineBuiltIn$2 = defineBuiltIn$7;
2643
2867
  var wellKnownSymbol$4 = wellKnownSymbol$i;
2644
2868
 
2645
2869
  var ITERATOR$3 = wellKnownSymbol$4('iterator');
@@ -2660,7 +2884,7 @@ if ([].keys) {
2660
2884
  }
2661
2885
  }
2662
2886
 
2663
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$8(function () {
2887
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$7(function () {
2664
2888
  var test = {};
2665
2889
  // FF44- legacy iterators case
2666
2890
  return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
@@ -2671,7 +2895,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
2671
2895
  // `%IteratorPrototype%[@@iterator]()` method
2672
2896
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2673
2897
  if (!isCallable$3(IteratorPrototype$2[ITERATOR$3])) {
2674
- redefine$2(IteratorPrototype$2, ITERATOR$3, function () {
2898
+ defineBuiltIn$2(IteratorPrototype$2, ITERATOR$3, function () {
2675
2899
  return this;
2676
2900
  });
2677
2901
  }
@@ -2683,30 +2907,30 @@ var iteratorsCore = {
2683
2907
 
2684
2908
  var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
2685
2909
  var create$1 = objectCreate;
2686
- var createPropertyDescriptor$1 = createPropertyDescriptor$4;
2910
+ var createPropertyDescriptor = createPropertyDescriptor$3;
2687
2911
  var setToStringTag$1 = setToStringTag$3;
2688
2912
  var Iterators$2 = iterators;
2689
2913
 
2690
2914
  var returnThis$1 = function () { return this; };
2691
2915
 
2692
- var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2916
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2693
2917
  var TO_STRING_TAG = NAME + ' Iterator';
2694
- IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
2918
+ IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
2695
2919
  setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
2696
2920
  Iterators$2[TO_STRING_TAG] = returnThis$1;
2697
2921
  return IteratorConstructor;
2698
2922
  };
2699
2923
 
2700
2924
  var $$4 = _export;
2701
- var call$4 = functionCall;
2925
+ var call$3 = functionCall;
2702
2926
  var FunctionName = functionName;
2703
- var isCallable$2 = isCallable$j;
2704
- var createIteratorConstructor = createIteratorConstructor$1;
2927
+ var isCallable$2 = isCallable$m;
2928
+ var createIteratorConstructor = iteratorCreateConstructor;
2705
2929
  var getPrototypeOf = objectGetPrototypeOf;
2706
2930
  var setPrototypeOf = objectSetPrototypeOf;
2707
2931
  var setToStringTag = setToStringTag$3;
2708
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
2709
- var redefine$1 = redefine$6.exports;
2932
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
2933
+ var defineBuiltIn$1 = defineBuiltIn$7;
2710
2934
  var wellKnownSymbol$3 = wellKnownSymbol$i;
2711
2935
  var Iterators$1 = iterators;
2712
2936
  var IteratorsCore = iteratorsCore;
@@ -2722,7 +2946,7 @@ var ENTRIES = 'entries';
2722
2946
 
2723
2947
  var returnThis = function () { return this; };
2724
2948
 
2725
- var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2949
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2726
2950
  createIteratorConstructor(IteratorConstructor, NAME, next);
2727
2951
 
2728
2952
  var getIterationMethod = function (KIND) {
@@ -2753,7 +2977,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
2753
2977
  if (setPrototypeOf) {
2754
2978
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
2755
2979
  } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$2])) {
2756
- redefine$1(CurrentIteratorPrototype, ITERATOR$2, returnThis);
2980
+ defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$2, returnThis);
2757
2981
  }
2758
2982
  }
2759
2983
  // Set @@toStringTag to native iterators
@@ -2767,7 +2991,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
2767
2991
  createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
2768
2992
  } else {
2769
2993
  INCORRECT_VALUES_NAME = true;
2770
- defaultIterator = function values() { return call$4(nativeIterator, this); };
2994
+ defaultIterator = function values() { return call$3(nativeIterator, this); };
2771
2995
  }
2772
2996
  }
2773
2997
 
@@ -2780,26 +3004,33 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
2780
3004
  };
2781
3005
  if (FORCED) for (KEY in methods) {
2782
3006
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2783
- redefine$1(IterablePrototype, KEY, methods[KEY]);
3007
+ defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
2784
3008
  }
2785
3009
  } else $$4({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2786
3010
  }
2787
3011
 
2788
3012
  // define iterator
2789
3013
  if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
2790
- redefine$1(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
3014
+ defineBuiltIn$1(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
2791
3015
  }
2792
3016
  Iterators$1[NAME] = defaultIterator;
2793
3017
 
2794
3018
  return methods;
2795
3019
  };
2796
3020
 
3021
+ // `CreateIterResultObject` abstract operation
3022
+ // https://tc39.es/ecma262/#sec-createiterresultobject
3023
+ var createIterResultObject$1 = function (value, done) {
3024
+ return { value: value, done: done };
3025
+ };
3026
+
2797
3027
  var toIndexedObject = toIndexedObject$5;
2798
- var addToUnscopables = addToUnscopables$1;
3028
+ var addToUnscopables = addToUnscopables$2;
2799
3029
  var Iterators = iterators;
2800
3030
  var InternalStateModule = internalState;
2801
3031
  var defineProperty = objectDefineProperty.f;
2802
- var defineIterator = defineIterator$1;
3032
+ var defineIterator = iteratorDefine;
3033
+ var createIterResultObject = createIterResultObject$1;
2803
3034
  var DESCRIPTORS = descriptors;
2804
3035
 
2805
3036
  var ARRAY_ITERATOR = 'Array Iterator';
@@ -2832,11 +3063,11 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
2832
3063
  var index = state.index++;
2833
3064
  if (!target || index >= target.length) {
2834
3065
  state.target = undefined;
2835
- return { value: undefined, done: true };
3066
+ return createIterResultObject(undefined, true);
2836
3067
  }
2837
- if (kind == 'keys') return { value: index, done: false };
2838
- if (kind == 'values') return { value: target[index], done: false };
2839
- return { value: [index, target[index]], done: false };
3068
+ if (kind == 'keys') return createIterResultObject(index, false);
3069
+ if (kind == 'values') return createIterResultObject(target[index], false);
3070
+ return createIterResultObject([index, target[index]], false);
2840
3071
  }, 'values');
2841
3072
 
2842
3073
  // argumentsList[@@iterator] is %ArrayProto_values%
@@ -2898,11 +3129,11 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
2898
3129
 
2899
3130
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2900
3131
 
2901
- var global$8 = global$K;
3132
+ var global$5 = global$n;
2902
3133
  var DOMIterables = domIterables;
2903
3134
  var DOMTokenListPrototype = domTokenListPrototype;
2904
3135
  var ArrayIteratorMethods = es_array_iterator;
2905
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
3136
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
2906
3137
  var wellKnownSymbol$2 = wellKnownSymbol$i;
2907
3138
 
2908
3139
  var ITERATOR$1 = wellKnownSymbol$2('iterator');
@@ -2932,17 +3163,13 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2932
3163
  };
2933
3164
 
2934
3165
  for (var COLLECTION_NAME in DOMIterables) {
2935
- handlePrototype(global$8[COLLECTION_NAME] && global$8[COLLECTION_NAME].prototype, COLLECTION_NAME);
3166
+ handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
2936
3167
  }
2937
3168
 
2938
3169
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2939
3170
 
2940
3171
  class Ninetailed {
2941
- constructor({
2942
- clientId,
2943
- environment,
2944
- preview
2945
- }, {
3172
+ constructor(ninetailedApiClientInstanceOrOptions, {
2946
3173
  plugins,
2947
3174
  url,
2948
3175
  profile,
@@ -2951,83 +3178,134 @@ class Ninetailed {
2951
3178
  onLog,
2952
3179
  onError
2953
3180
  } = {}) {
3181
+ this.isInitialized = false;
2954
3182
  this.page = (data, options) => __awaiter(this, void 0, void 0, function* () {
2955
- yield this.waitUntilInitialized();
2956
- return this.instance.page(data, this.buildOptions(options));
2957
- });
2958
-
2959
- this.track = (event, payload, options) => __awaiter(this, void 0, void 0, function* () {
2960
- yield this.waitUntilInitialized();
2961
- return this.instance.track(event, payload, this.buildOptions(options));
2962
- });
2963
-
2964
- this.trackHasSeenComponent = payload => __awaiter(this, void 0, void 0, function* () {
2965
- return this.track('hasSeenComponent', payload, {
2966
- plugins: {
2967
- all: true,
2968
- ninetailed: false
3183
+ try {
3184
+ const result = PageviewProperties.partial().default({}).safeParse(data);
3185
+ if (!result.success) {
3186
+ throw new Error(`[Validation Error] "page" was called with invalid params. Page data is not valid: ${result.error.format()}`);
2969
3187
  }
2970
- });
3188
+ yield this.waitUntilInitialized();
3189
+ yield this.instance.page(data, this.buildOptions(options));
3190
+ return this.eventQueue.flush();
3191
+ } catch (error) {
3192
+ logger.error(error);
3193
+ if (error instanceof RangeError) {
3194
+ throw new Error(`[Validation Error] "page" was called with invalid params. Could not validate due to "RangeError: Maximum call stack size exceeded". This can be caused by passing a cyclic data structure as a parameter. Refrain from passing a cyclic data structure or sanitize it beforehand.`);
3195
+ }
3196
+ throw error;
3197
+ }
2971
3198
  });
2972
-
2973
- this.trackExperience = payload => {
2974
- return this.track('nt_experience', payload, {
2975
- plugins: {
2976
- all: true,
2977
- ninetailed: false
3199
+ this.track = (event, properties, options) => __awaiter(this, void 0, void 0, function* () {
3200
+ try {
3201
+ const result = Properties.default({}).safeParse(properties);
3202
+ if (!result.success) {
3203
+ throw new Error(`[Validation Error] "track" was called with invalid params. Properties are no valid json object: ${result.error.format()}`);
2978
3204
  }
2979
- });
3205
+ yield this.waitUntilInitialized();
3206
+ yield this.instance.track(event.toString(), result.data, this.buildOptions(options));
3207
+ return this.eventQueue.flush();
3208
+ } catch (error) {
3209
+ logger.error(error);
3210
+ if (error instanceof RangeError) {
3211
+ throw new Error(`[Validation Error] "track" was called with invalid params. Could not validate due to "RangeError: Maximum call stack size exceeded". This can be caused by passing a cyclic data structure as a parameter. Refrain from passing a cyclic data structure or sanitize it beforehand.`);
3212
+ }
3213
+ throw error;
3214
+ }
3215
+ });
3216
+ this.trackHasSeenComponent = properties => __awaiter(this, void 0, void 0, function* () {
3217
+ return this.instance.dispatch(Object.assign(Object.assign({}, properties), {
3218
+ type: HAS_SEEN_COMPONENT
3219
+ }));
3220
+ });
3221
+ this.trackHasSeenExperience = properties => {
3222
+ return this.instance.dispatch(Object.assign(Object.assign({}, properties), {
3223
+ type: HAS_SEEN_EXPERIENCE
3224
+ }));
2980
3225
  };
2981
-
2982
3226
  this.identify = (uid, traits, options) => __awaiter(this, void 0, void 0, function* () {
3227
+ try {
3228
+ const result = Traits.default({}).safeParse(traits);
3229
+ if (!result.success) {
3230
+ throw new Error(`[Validation Error] "identify" was called with invalid params. Traits are no valid json: ${result.error.format()}`);
3231
+ }
3232
+ yield this.waitUntilInitialized();
3233
+ yield this.instance.identify(uid.toString(), result.data, this.buildOptions(options));
3234
+ return this.eventQueue.flush();
3235
+ } catch (error) {
3236
+ logger.error(error);
3237
+ if (error instanceof RangeError) {
3238
+ throw new Error(`[Validation Error] "identify" was called with invalid params. Could not validate due to "RangeError: Maximum call stack size exceeded". This can be caused by passing a cyclic data structure as a parameter. Refrain from passing a cyclic data structure or sanitize it beforehand.`);
3239
+ }
3240
+ throw error;
3241
+ }
3242
+ });
3243
+ this.reset = () => __awaiter(this, void 0, void 0, function* () {
2983
3244
  yield this.waitUntilInitialized();
2984
- return this.instance.identify(uid, traits, this.buildOptions(options));
3245
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3246
+ // @ts-ignore
3247
+ this.instance.plugins[PLUGIN_NAME].reset();
3248
+ });
3249
+ this.debug = enabled => __awaiter(this, void 0, void 0, function* () {
3250
+ yield this.waitUntilInitialized();
3251
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3252
+ // @ts-ignore
3253
+ this.instance.plugins[PLUGIN_NAME].debug(enabled);
2985
3254
  });
2986
-
2987
- this.reset = () => {
2988
- this.onIsInitialized(() => {
2989
- // @ts-ignore
2990
- this.instance.plugins[PLUGIN_NAME].reset();
2991
- });
2992
- };
2993
-
2994
- this.debug = enabled => {
2995
- this.onIsInitialized(() => {
2996
- // @ts-ignore
2997
- this.instance.plugins[PLUGIN_NAME].debug(enabled);
2998
- });
2999
- };
3000
-
3001
3255
  this.onProfileChange = cb => {
3002
3256
  cb(this.profileState);
3003
- return this.instance.on(NINETAILED_TRACKER_EVENTS.profile, ({
3257
+ return this.instance.on(PROFILE_CHANGE, ({
3004
3258
  payload
3005
3259
  }) => {
3006
- cb(Object.assign(Object.assign({}, this._profileState), {
3007
- status: 'success',
3008
- profile: payload.profile,
3009
- error: null
3010
- }));
3260
+ if (payload.error) {
3261
+ cb(Object.assign(Object.assign({}, this._profileState), {
3262
+ status: 'error',
3263
+ profile: payload.profile,
3264
+ error: payload.error
3265
+ }));
3266
+ } else {
3267
+ cb(Object.assign(Object.assign({}, this._profileState), {
3268
+ status: 'success',
3269
+ profile: payload.profile,
3270
+ error: null
3271
+ }));
3272
+ }
3011
3273
  });
3012
3274
  };
3013
-
3014
3275
  this.onIsInitialized = onIsInitialized => {
3015
3276
  if (typeof onIsInitialized === 'function') {
3016
- const detachOnReadyListener = this.instance.ready(() => {
3277
+ if (this.isInitialized) {
3017
3278
  onIsInitialized();
3018
- detachOnReadyListener();
3019
- });
3279
+ } else {
3280
+ const detachOnReadyListener = this.instance.on('ready', () => {
3281
+ this.isInitialized = true;
3282
+ onIsInitialized();
3283
+ detachOnReadyListener();
3284
+ });
3285
+ }
3020
3286
  }
3021
3287
  };
3022
-
3023
3288
  this.waitUntilInitialized = () => {
3024
3289
  return new Promise(resolve => {
3025
3290
  this.onIsInitialized(resolve);
3026
3291
  });
3027
3292
  };
3028
-
3293
+ if (ninetailedApiClientInstanceOrOptions instanceof NinetailedApiClient) {
3294
+ this.apiClient = ninetailedApiClientInstanceOrOptions;
3295
+ } else {
3296
+ const {
3297
+ clientId,
3298
+ environment,
3299
+ preview
3300
+ } = ninetailedApiClientInstanceOrOptions;
3301
+ this.apiClient = new NinetailedApiClient({
3302
+ clientId,
3303
+ environment,
3304
+ url,
3305
+ preview
3306
+ });
3307
+ }
3029
3308
  this.plugins = flatten(plugins || []);
3030
-
3031
3309
  if (profile) {
3032
3310
  this._profileState = {
3033
3311
  status: 'success',
@@ -3043,59 +3321,60 @@ class Ninetailed {
3043
3321
  from: 'api'
3044
3322
  };
3045
3323
  }
3046
-
3047
3324
  if (typeof onLog === 'function') {
3048
3325
  logger.addSink(new OnLogLogSink(onLog));
3049
3326
  }
3050
-
3051
3327
  if (typeof onError === 'function') {
3052
3328
  logger.addSink(new OnErrorLogSink(onError));
3053
3329
  }
3054
-
3055
3330
  this.logger = logger;
3331
+ this.eventQueue = ninetailedPlugin({
3332
+ apiClient: this.apiClient,
3333
+ profile,
3334
+ locale,
3335
+ requestTimeout,
3336
+ ninetailed: this
3337
+ });
3056
3338
  this.instance = Analytics({
3057
3339
  app: 'ninetailed',
3058
- plugins: [...this.plugins, ninetailedPlugin({
3059
- clientId,
3060
- environment,
3061
- url,
3062
- profile,
3063
- locale,
3064
- requestTimeout,
3065
- preview
3066
- })]
3340
+ plugins: [...this.plugins, this.eventQueue]
3067
3341
  });
3068
- this.instance.ready(() => {
3342
+ const detachOnReadyListener = this.instance.on('ready', () => {
3343
+ this.isInitialized = true;
3069
3344
  logger.info('Ninetailed Experience.js SDK is completely initialized.');
3070
- }); // put in private method
3071
-
3345
+ detachOnReadyListener();
3346
+ });
3347
+ // put in private method
3072
3348
  this.onProfileChange(profileState => {
3073
3349
  this._profileState = profileState;
3350
+ if (typeof window !== 'undefined') {
3351
+ window.ninetailed = Object.assign({}, window.ninetailed, {
3352
+ profile: this.profileState.profile
3353
+ });
3354
+ }
3074
3355
  });
3075
3356
  this.registerWindowHandlers();
3076
3357
  }
3077
-
3078
3358
  get profileState() {
3079
3359
  return this._profileState;
3080
3360
  }
3081
-
3082
3361
  buildOptions(options = {}) {
3083
3362
  return Object.assign({}, options);
3084
3363
  }
3085
-
3086
3364
  registerWindowHandlers() {
3087
3365
  if (typeof window !== 'undefined') {
3088
3366
  window.ninetailed = Object.assign({}, window.ninetailed, {
3089
3367
  page: this.page.bind(this),
3090
3368
  track: this.track.bind(this),
3091
3369
  trackHasSeenComponent: this.trackHasSeenComponent.bind(this),
3370
+ trackHasSeenExperience: this.trackHasSeenExperience.bind(this),
3092
3371
  identify: this.identify.bind(this),
3093
3372
  reset: this.reset.bind(this),
3094
- debug: this.debug.bind(this)
3373
+ debug: this.debug.bind(this),
3374
+ profile: this.profileState.profile
3095
3375
  });
3096
3376
  }
3097
3377
  }
3098
-
3099
3378
  }
3100
3379
 
3101
3380
  const selectVariant$1 = (baseline, variants, {
@@ -3121,7 +3400,6 @@ const selectVariant$1 = (baseline, variants, {
3121
3400
  error: null
3122
3401
  };
3123
3402
  }
3124
-
3125
3403
  if (status === 'error') {
3126
3404
  return {
3127
3405
  loading: false,
@@ -3138,15 +3416,11 @@ const selectVariant$1 = (baseline, variants, {
3138
3416
  error: error
3139
3417
  };
3140
3418
  }
3141
-
3142
3419
  const variant = find(variants, variant => {
3143
3420
  var _a;
3144
-
3145
3421
  return includes(profile === null || profile === void 0 ? void 0 : profile.audiences, (_a = variant.audience) === null || _a === void 0 ? void 0 : _a.id);
3146
3422
  });
3147
-
3148
3423
  if (variant) {
3149
- // @ts-ignore
3150
3424
  if ((options === null || options === void 0 ? void 0 : options.holdout) || -1 > (profile === null || profile === void 0 ? void 0 : profile.random)) {
3151
3425
  return {
3152
3426
  loading: false,
@@ -3162,7 +3436,6 @@ const selectVariant$1 = (baseline, variants, {
3162
3436
  error: null
3163
3437
  };
3164
3438
  }
3165
-
3166
3439
  return {
3167
3440
  loading: false,
3168
3441
  variant,
@@ -3176,8 +3449,6 @@ const selectVariant$1 = (baseline, variants, {
3176
3449
  /**
3177
3450
  * There was no matching audience found.
3178
3451
  */
3179
-
3180
-
3181
3452
  return {
3182
3453
  loading: false,
3183
3454
  variant: Object.assign(Object.assign({}, baseline), {
@@ -3198,17 +3469,14 @@ const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
3198
3469
 
3199
3470
  const selectBaselineWithVariants = (experience, baseline) => {
3200
3471
  var _a;
3201
-
3202
3472
  return (_a = experience.components.find(baselineWithVariants => baselineWithVariants.baseline.id === baseline.id)) !== null && _a !== void 0 ? _a : null;
3203
3473
  };
3204
3474
 
3205
3475
  const selectVariants = (experience, baseline) => {
3206
3476
  const baselineWithVariants = selectBaselineWithVariants(experience, baseline);
3207
-
3208
3477
  if (!baselineWithVariants) {
3209
3478
  return [];
3210
3479
  }
3211
-
3212
3480
  return baselineWithVariants.variants;
3213
3481
  };
3214
3482
 
@@ -3218,18 +3486,18 @@ const selectHasVariants = (experience, baseline) => {
3218
3486
  };
3219
3487
 
3220
3488
  var $$3 = _export;
3221
- var uncurryThis$8 = functionUncurryThis;
3489
+ var uncurryThis$7 = functionUncurryThisClause;
3222
3490
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3223
- var toLength$2 = toLength$4;
3224
- var toString$6 = toString$8;
3491
+ var toLength$1 = toLength$3;
3492
+ var toString$5 = toString$7;
3225
3493
  var notARegExp = notARegexp;
3226
- var requireObjectCoercible$4 = requireObjectCoercible$8;
3494
+ var requireObjectCoercible$3 = requireObjectCoercible$7;
3227
3495
  var correctIsRegExpLogic = correctIsRegexpLogic;
3228
3496
 
3229
3497
  // eslint-disable-next-line es/no-string-prototype-startswith -- safe
3230
- var un$StartsWith = uncurryThis$8(''.startsWith);
3231
- var stringSlice$5 = uncurryThis$8(''.slice);
3232
- var min$2 = Math.min;
3498
+ var nativeStartsWith = uncurryThis$7(''.startsWith);
3499
+ var stringSlice$4 = uncurryThis$7(''.slice);
3500
+ var min$1 = Math.min;
3233
3501
 
3234
3502
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
3235
3503
  // https://github.com/zloirock/core-js/pull/702
@@ -3242,39 +3510,23 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
3242
3510
  // https://tc39.es/ecma262/#sec-string.prototype.startswith
3243
3511
  $$3({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
3244
3512
  startsWith: function startsWith(searchString /* , position = 0 */) {
3245
- var that = toString$6(requireObjectCoercible$4(this));
3513
+ var that = toString$5(requireObjectCoercible$3(this));
3246
3514
  notARegExp(searchString);
3247
- var index = toLength$2(min$2(arguments.length > 1 ? arguments[1] : undefined, that.length));
3248
- var search = toString$6(searchString);
3249
- return un$StartsWith
3250
- ? un$StartsWith(that, search, index)
3251
- : stringSlice$5(that, index, index + search.length) === search;
3515
+ var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
3516
+ var search = toString$5(searchString);
3517
+ return nativeStartsWith
3518
+ ? nativeStartsWith(that, search, index)
3519
+ : stringSlice$4(that, index, index + search.length) === search;
3252
3520
  }
3253
3521
  });
3254
3522
 
3255
- var anObject$3 = anObject$e;
3256
-
3257
- // `RegExp.prototype.flags` getter implementation
3258
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
3259
- var regexpFlags$1 = function () {
3260
- var that = anObject$3(this);
3261
- var result = '';
3262
- if (that.global) result += 'g';
3263
- if (that.ignoreCase) result += 'i';
3264
- if (that.multiline) result += 'm';
3265
- if (that.dotAll) result += 's';
3266
- if (that.unicode) result += 'u';
3267
- if (that.sticky) result += 'y';
3268
- return result;
3269
- };
3270
-
3271
- var fails$7 = fails$k;
3272
- var global$7 = global$K;
3523
+ var fails$6 = fails$m;
3524
+ var global$4 = global$n;
3273
3525
 
3274
3526
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
3275
- var $RegExp$2 = global$7.RegExp;
3527
+ var $RegExp$2 = global$4.RegExp;
3276
3528
 
3277
- var UNSUPPORTED_Y$2 = fails$7(function () {
3529
+ var UNSUPPORTED_Y$1 = fails$6(function () {
3278
3530
  var re = $RegExp$2('a', 'y');
3279
3531
  re.lastIndex = 2;
3280
3532
  return re.exec('abcd') != null;
@@ -3282,11 +3534,11 @@ var UNSUPPORTED_Y$2 = fails$7(function () {
3282
3534
 
3283
3535
  // UC Browser bug
3284
3536
  // https://github.com/zloirock/core-js/issues/1008
3285
- var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$7(function () {
3537
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$6(function () {
3286
3538
  return !$RegExp$2('a', 'y').sticky;
3287
3539
  });
3288
3540
 
3289
- var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$7(function () {
3541
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$6(function () {
3290
3542
  // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
3291
3543
  var re = $RegExp$2('^r', 'gy');
3292
3544
  re.lastIndex = 2;
@@ -3296,27 +3548,27 @@ var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$7(function () {
3296
3548
  var regexpStickyHelpers = {
3297
3549
  BROKEN_CARET: BROKEN_CARET,
3298
3550
  MISSED_STICKY: MISSED_STICKY,
3299
- UNSUPPORTED_Y: UNSUPPORTED_Y$2
3551
+ UNSUPPORTED_Y: UNSUPPORTED_Y$1
3300
3552
  };
3301
3553
 
3302
- var fails$6 = fails$k;
3303
- var global$6 = global$K;
3554
+ var fails$5 = fails$m;
3555
+ var global$3 = global$n;
3304
3556
 
3305
3557
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
3306
- var $RegExp$1 = global$6.RegExp;
3558
+ var $RegExp$1 = global$3.RegExp;
3307
3559
 
3308
- var regexpUnsupportedDotAll = fails$6(function () {
3560
+ var regexpUnsupportedDotAll = fails$5(function () {
3309
3561
  var re = $RegExp$1('.', 's');
3310
3562
  return !(re.dotAll && re.exec('\n') && re.flags === 's');
3311
3563
  });
3312
3564
 
3313
- var fails$5 = fails$k;
3314
- var global$5 = global$K;
3565
+ var fails$4 = fails$m;
3566
+ var global$2 = global$n;
3315
3567
 
3316
3568
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
3317
- var $RegExp = global$5.RegExp;
3569
+ var $RegExp = global$2.RegExp;
3318
3570
 
3319
- var regexpUnsupportedNcg = fails$5(function () {
3571
+ var regexpUnsupportedNcg = fails$4(function () {
3320
3572
  var re = $RegExp('(?<a>b)', 'g');
3321
3573
  return re.exec('b').groups.a !== 'b' ||
3322
3574
  'b'.replace(re, '$<a>c') !== 'bc';
@@ -3324,11 +3576,11 @@ var regexpUnsupportedNcg = fails$5(function () {
3324
3576
 
3325
3577
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
3326
3578
  /* eslint-disable regexp/no-useless-quantifier -- testing */
3327
- var call$3 = functionCall;
3328
- var uncurryThis$7 = functionUncurryThis;
3329
- var toString$5 = toString$8;
3579
+ var call$2 = functionCall;
3580
+ var uncurryThis$6 = functionUncurryThis;
3581
+ var toString$4 = toString$7;
3330
3582
  var regexpFlags = regexpFlags$1;
3331
- var stickyHelpers$1 = regexpStickyHelpers;
3583
+ var stickyHelpers = regexpStickyHelpers;
3332
3584
  var shared = shared$4.exports;
3333
3585
  var create = objectCreate;
3334
3586
  var getInternalState = internalState.get;
@@ -3338,44 +3590,44 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
3338
3590
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
3339
3591
  var nativeExec = RegExp.prototype.exec;
3340
3592
  var patchedExec = nativeExec;
3341
- var charAt$3 = uncurryThis$7(''.charAt);
3342
- var indexOf = uncurryThis$7(''.indexOf);
3343
- var replace$2 = uncurryThis$7(''.replace);
3344
- var stringSlice$4 = uncurryThis$7(''.slice);
3593
+ var charAt$3 = uncurryThis$6(''.charAt);
3594
+ var indexOf = uncurryThis$6(''.indexOf);
3595
+ var replace$2 = uncurryThis$6(''.replace);
3596
+ var stringSlice$3 = uncurryThis$6(''.slice);
3345
3597
 
3346
3598
  var UPDATES_LAST_INDEX_WRONG = (function () {
3347
3599
  var re1 = /a/;
3348
3600
  var re2 = /b*/g;
3349
- call$3(nativeExec, re1, 'a');
3350
- call$3(nativeExec, re2, 'a');
3601
+ call$2(nativeExec, re1, 'a');
3602
+ call$2(nativeExec, re2, 'a');
3351
3603
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
3352
3604
  })();
3353
3605
 
3354
- var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
3606
+ var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
3355
3607
 
3356
3608
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
3357
3609
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
3358
3610
 
3359
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
3611
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
3360
3612
 
3361
3613
  if (PATCH) {
3362
3614
  patchedExec = function exec(string) {
3363
3615
  var re = this;
3364
3616
  var state = getInternalState(re);
3365
- var str = toString$5(string);
3617
+ var str = toString$4(string);
3366
3618
  var raw = state.raw;
3367
3619
  var result, reCopy, lastIndex, match, i, object, group;
3368
3620
 
3369
3621
  if (raw) {
3370
3622
  raw.lastIndex = re.lastIndex;
3371
- result = call$3(patchedExec, raw, str);
3623
+ result = call$2(patchedExec, raw, str);
3372
3624
  re.lastIndex = raw.lastIndex;
3373
3625
  return result;
3374
3626
  }
3375
3627
 
3376
3628
  var groups = state.groups;
3377
- var sticky = UNSUPPORTED_Y$1 && re.sticky;
3378
- var flags = call$3(regexpFlags, re);
3629
+ var sticky = UNSUPPORTED_Y && re.sticky;
3630
+ var flags = call$2(regexpFlags, re);
3379
3631
  var source = re.source;
3380
3632
  var charsAdded = 0;
3381
3633
  var strCopy = str;
@@ -3386,7 +3638,7 @@ if (PATCH) {
3386
3638
  flags += 'g';
3387
3639
  }
3388
3640
 
3389
- strCopy = stringSlice$4(str, re.lastIndex);
3641
+ strCopy = stringSlice$3(str, re.lastIndex);
3390
3642
  // Support anchored sticky behavior.
3391
3643
  if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
3392
3644
  source = '(?: ' + source + ')';
@@ -3403,12 +3655,12 @@ if (PATCH) {
3403
3655
  }
3404
3656
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
3405
3657
 
3406
- match = call$3(nativeExec, sticky ? reCopy : re, strCopy);
3658
+ match = call$2(nativeExec, sticky ? reCopy : re, strCopy);
3407
3659
 
3408
3660
  if (sticky) {
3409
3661
  if (match) {
3410
- match.input = stringSlice$4(match.input, charsAdded);
3411
- match[0] = stringSlice$4(match[0], charsAdded);
3662
+ match.input = stringSlice$3(match.input, charsAdded);
3663
+ match[0] = stringSlice$3(match[0], charsAdded);
3412
3664
  match.index = re.lastIndex;
3413
3665
  re.lastIndex += match[0].length;
3414
3666
  } else re.lastIndex = 0;
@@ -3417,8 +3669,8 @@ if (PATCH) {
3417
3669
  }
3418
3670
  if (NPCG_INCLUDED && match && match.length > 1) {
3419
3671
  // Fix browsers whose `exec` methods don't consistently return `undefined`
3420
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
3421
- call$3(nativeReplace, match[0], reCopy, function () {
3672
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
3673
+ call$2(nativeReplace, match[0], reCopy, function () {
3422
3674
  for (i = 1; i < arguments.length - 2; i++) {
3423
3675
  if (arguments[i] === undefined) match[i] = undefined;
3424
3676
  }
@@ -3437,25 +3689,25 @@ if (PATCH) {
3437
3689
  };
3438
3690
  }
3439
3691
 
3440
- var regexpExec$3 = patchedExec;
3692
+ var regexpExec$2 = patchedExec;
3441
3693
 
3442
3694
  var $$2 = _export;
3443
- var exec$2 = regexpExec$3;
3695
+ var exec$1 = regexpExec$2;
3444
3696
 
3445
3697
  // `RegExp.prototype.exec` method
3446
3698
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
3447
- $$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
3448
- exec: exec$2
3699
+ $$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
3700
+ exec: exec$1
3449
3701
  });
3450
3702
 
3451
3703
  // TODO: Remove from `core-js@4` since it's moved to entry points
3452
3704
 
3453
- var uncurryThis$6 = functionUncurryThis;
3454
- var redefine = redefine$6.exports;
3455
- var regexpExec$2 = regexpExec$3;
3456
- var fails$4 = fails$k;
3705
+ var uncurryThis$5 = functionUncurryThisClause;
3706
+ var defineBuiltIn = defineBuiltIn$7;
3707
+ var regexpExec$1 = regexpExec$2;
3708
+ var fails$3 = fails$m;
3457
3709
  var wellKnownSymbol$1 = wellKnownSymbol$i;
3458
- var createNonEnumerableProperty = createNonEnumerableProperty$6;
3710
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
3459
3711
 
3460
3712
  var SPECIES = wellKnownSymbol$1('species');
3461
3713
  var RegExpPrototype = RegExp.prototype;
@@ -3463,14 +3715,14 @@ var RegExpPrototype = RegExp.prototype;
3463
3715
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
3464
3716
  var SYMBOL = wellKnownSymbol$1(KEY);
3465
3717
 
3466
- var DELEGATES_TO_SYMBOL = !fails$4(function () {
3718
+ var DELEGATES_TO_SYMBOL = !fails$3(function () {
3467
3719
  // String methods call symbol-named RegEp methods
3468
3720
  var O = {};
3469
3721
  O[SYMBOL] = function () { return 7; };
3470
3722
  return ''[KEY](O) != 7;
3471
3723
  });
3472
3724
 
3473
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$4(function () {
3725
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$3(function () {
3474
3726
  // Symbol-named RegExp methods call .exec
3475
3727
  var execCalled = false;
3476
3728
  var re = /a/;
@@ -3499,11 +3751,11 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
3499
3751
  !DELEGATES_TO_EXEC ||
3500
3752
  FORCED
3501
3753
  ) {
3502
- var uncurriedNativeRegExpMethod = uncurryThis$6(/./[SYMBOL]);
3754
+ var uncurriedNativeRegExpMethod = uncurryThis$5(/./[SYMBOL]);
3503
3755
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
3504
- var uncurriedNativeMethod = uncurryThis$6(nativeMethod);
3756
+ var uncurriedNativeMethod = uncurryThis$5(nativeMethod);
3505
3757
  var $exec = regexp.exec;
3506
- if ($exec === regexpExec$2 || $exec === RegExpPrototype.exec) {
3758
+ if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
3507
3759
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
3508
3760
  // The native String method already delegates to @@method (this
3509
3761
  // polyfilled function), leasing to infinite recursion.
@@ -3515,25 +3767,25 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
3515
3767
  return { done: false };
3516
3768
  });
3517
3769
 
3518
- redefine(String.prototype, KEY, methods[0]);
3519
- redefine(RegExpPrototype, SYMBOL, methods[1]);
3770
+ defineBuiltIn(String.prototype, KEY, methods[0]);
3771
+ defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
3520
3772
  }
3521
3773
 
3522
3774
  if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
3523
3775
  };
3524
3776
 
3525
- var uncurryThis$5 = functionUncurryThis;
3777
+ var uncurryThis$4 = functionUncurryThis;
3526
3778
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
3527
- var toString$4 = toString$8;
3528
- var requireObjectCoercible$3 = requireObjectCoercible$8;
3779
+ var toString$3 = toString$7;
3780
+ var requireObjectCoercible$2 = requireObjectCoercible$7;
3529
3781
 
3530
- var charAt$2 = uncurryThis$5(''.charAt);
3531
- var charCodeAt = uncurryThis$5(''.charCodeAt);
3532
- var stringSlice$3 = uncurryThis$5(''.slice);
3782
+ var charAt$2 = uncurryThis$4(''.charAt);
3783
+ var charCodeAt = uncurryThis$4(''.charCodeAt);
3784
+ var stringSlice$2 = uncurryThis$4(''.slice);
3533
3785
 
3534
3786
  var createMethod$2 = function (CONVERT_TO_STRING) {
3535
3787
  return function ($this, pos) {
3536
- var S = toString$4(requireObjectCoercible$3($this));
3788
+ var S = toString$3(requireObjectCoercible$2($this));
3537
3789
  var position = toIntegerOrInfinity$1(pos);
3538
3790
  var size = S.length;
3539
3791
  var first, second;
@@ -3545,7 +3797,7 @@ var createMethod$2 = function (CONVERT_TO_STRING) {
3545
3797
  ? charAt$2(S, position)
3546
3798
  : first
3547
3799
  : CONVERT_TO_STRING
3548
- ? stringSlice$3(S, position, position + 2)
3800
+ ? stringSlice$2(S, position, position + 2)
3549
3801
  : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
3550
3802
  };
3551
3803
  };
@@ -3563,17 +3815,17 @@ var charAt$1 = stringMultibyte.charAt;
3563
3815
 
3564
3816
  // `AdvanceStringIndex` abstract operation
3565
3817
  // https://tc39.es/ecma262/#sec-advancestringindex
3566
- var advanceStringIndex$2 = function (S, index, unicode) {
3818
+ var advanceStringIndex$1 = function (S, index, unicode) {
3567
3819
  return index + (unicode ? charAt$1(S, index).length : 1);
3568
3820
  };
3569
3821
 
3570
- var uncurryThis$4 = functionUncurryThis;
3822
+ var uncurryThis$3 = functionUncurryThis;
3571
3823
  var toObject$1 = toObject$5;
3572
3824
 
3573
3825
  var floor = Math.floor;
3574
- var charAt = uncurryThis$4(''.charAt);
3575
- var replace$1 = uncurryThis$4(''.replace);
3576
- var stringSlice$2 = uncurryThis$4(''.slice);
3826
+ var charAt = uncurryThis$3(''.charAt);
3827
+ var replace$1 = uncurryThis$3(''.replace);
3828
+ var stringSlice$1 = uncurryThis$3(''.slice);
3577
3829
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
3578
3830
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
3579
3831
 
@@ -3592,10 +3844,10 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
3592
3844
  switch (charAt(ch, 0)) {
3593
3845
  case '$': return '$';
3594
3846
  case '&': return matched;
3595
- case '`': return stringSlice$2(str, 0, position);
3596
- case "'": return stringSlice$2(str, tailPos);
3847
+ case '`': return stringSlice$1(str, 0, position);
3848
+ case "'": return stringSlice$1(str, tailPos);
3597
3849
  case '<':
3598
- capture = namedCaptures[stringSlice$2(ch, 1, -1)];
3850
+ capture = namedCaptures[stringSlice$1(ch, 1, -1)];
3599
3851
  break;
3600
3852
  default: // \d\d?
3601
3853
  var n = +ch;
@@ -3612,52 +3864,52 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
3612
3864
  });
3613
3865
  };
3614
3866
 
3615
- var global$4 = global$K;
3616
- var call$2 = functionCall;
3617
- var anObject$2 = anObject$e;
3618
- var isCallable$1 = isCallable$j;
3619
- var classof = classofRaw$1;
3620
- var regexpExec$1 = regexpExec$3;
3867
+ var call$1 = functionCall;
3868
+ var anObject$1 = anObject$e;
3869
+ var isCallable$1 = isCallable$m;
3870
+ var classof = classofRaw$2;
3871
+ var regexpExec = regexpExec$2;
3621
3872
 
3622
- var TypeError$2 = global$4.TypeError;
3873
+ var $TypeError$1 = TypeError;
3623
3874
 
3624
3875
  // `RegExpExec` abstract operation
3625
3876
  // https://tc39.es/ecma262/#sec-regexpexec
3626
3877
  var regexpExecAbstract = function (R, S) {
3627
3878
  var exec = R.exec;
3628
3879
  if (isCallable$1(exec)) {
3629
- var result = call$2(exec, R, S);
3630
- if (result !== null) anObject$2(result);
3880
+ var result = call$1(exec, R, S);
3881
+ if (result !== null) anObject$1(result);
3631
3882
  return result;
3632
3883
  }
3633
- if (classof(R) === 'RegExp') return call$2(regexpExec$1, R, S);
3634
- throw TypeError$2('RegExp#exec called on incompatible receiver');
3884
+ if (classof(R) === 'RegExp') return call$1(regexpExec, R, S);
3885
+ throw $TypeError$1('RegExp#exec called on incompatible receiver');
3635
3886
  };
3636
3887
 
3637
- var apply$1 = functionApply;
3638
- var call$1 = functionCall;
3639
- var uncurryThis$3 = functionUncurryThis;
3640
- var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
3641
- var fails$3 = fails$k;
3642
- var anObject$1 = anObject$e;
3643
- var isCallable = isCallable$j;
3888
+ var apply = functionApply;
3889
+ var call = functionCall;
3890
+ var uncurryThis$2 = functionUncurryThis;
3891
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
3892
+ var fails$2 = fails$m;
3893
+ var anObject = anObject$e;
3894
+ var isCallable = isCallable$m;
3895
+ var isNullOrUndefined = isNullOrUndefined$5;
3644
3896
  var toIntegerOrInfinity = toIntegerOrInfinity$4;
3645
- var toLength$1 = toLength$4;
3646
- var toString$3 = toString$8;
3647
- var requireObjectCoercible$2 = requireObjectCoercible$8;
3648
- var advanceStringIndex$1 = advanceStringIndex$2;
3649
- var getMethod$1 = getMethod$5;
3897
+ var toLength = toLength$3;
3898
+ var toString$2 = toString$7;
3899
+ var requireObjectCoercible$1 = requireObjectCoercible$7;
3900
+ var advanceStringIndex = advanceStringIndex$1;
3901
+ var getMethod = getMethod$4;
3650
3902
  var getSubstitution = getSubstitution$1;
3651
3903
  var regExpExec = regexpExecAbstract;
3652
3904
  var wellKnownSymbol = wellKnownSymbol$i;
3653
3905
 
3654
3906
  var REPLACE = wellKnownSymbol('replace');
3655
- var max$1 = Math.max;
3656
- var min$1 = Math.min;
3657
- var concat = uncurryThis$3([].concat);
3658
- var push$1 = uncurryThis$3([].push);
3659
- var stringIndexOf = uncurryThis$3(''.indexOf);
3660
- var stringSlice$1 = uncurryThis$3(''.slice);
3907
+ var max = Math.max;
3908
+ var min = Math.min;
3909
+ var concat = uncurryThis$2([].concat);
3910
+ var push = uncurryThis$2([].push);
3911
+ var stringIndexOf = uncurryThis$2(''.indexOf);
3912
+ var stringSlice = uncurryThis$2(''.slice);
3661
3913
 
3662
3914
  var maybeToString = function (it) {
3663
3915
  return it === undefined ? it : String(it);
@@ -3678,7 +3930,7 @@ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
3678
3930
  return false;
3679
3931
  })();
3680
3932
 
3681
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$3(function () {
3933
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$2(function () {
3682
3934
  var re = /./;
3683
3935
  re.exec = function () {
3684
3936
  var result = [];
@@ -3690,24 +3942,24 @@ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$3(function () {
3690
3942
  });
3691
3943
 
3692
3944
  // @@replace logic
3693
- fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCallNative) {
3945
+ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
3694
3946
  var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
3695
3947
 
3696
3948
  return [
3697
3949
  // `String.prototype.replace` method
3698
3950
  // https://tc39.es/ecma262/#sec-string.prototype.replace
3699
3951
  function replace(searchValue, replaceValue) {
3700
- var O = requireObjectCoercible$2(this);
3701
- var replacer = searchValue == undefined ? undefined : getMethod$1(searchValue, REPLACE);
3952
+ var O = requireObjectCoercible$1(this);
3953
+ var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
3702
3954
  return replacer
3703
- ? call$1(replacer, searchValue, O, replaceValue)
3704
- : call$1(nativeReplace, toString$3(O), searchValue, replaceValue);
3955
+ ? call(replacer, searchValue, O, replaceValue)
3956
+ : call(nativeReplace, toString$2(O), searchValue, replaceValue);
3705
3957
  },
3706
3958
  // `RegExp.prototype[@@replace]` method
3707
3959
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
3708
3960
  function (string, replaceValue) {
3709
- var rx = anObject$1(this);
3710
- var S = toString$3(string);
3961
+ var rx = anObject(this);
3962
+ var S = toString$2(string);
3711
3963
 
3712
3964
  if (
3713
3965
  typeof replaceValue == 'string' &&
@@ -3719,7 +3971,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
3719
3971
  }
3720
3972
 
3721
3973
  var functionalReplace = isCallable(replaceValue);
3722
- if (!functionalReplace) replaceValue = toString$3(replaceValue);
3974
+ if (!functionalReplace) replaceValue = toString$2(replaceValue);
3723
3975
 
3724
3976
  var global = rx.global;
3725
3977
  if (global) {
@@ -3731,11 +3983,11 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
3731
3983
  var result = regExpExec(rx, S);
3732
3984
  if (result === null) break;
3733
3985
 
3734
- push$1(results, result);
3986
+ push(results, result);
3735
3987
  if (!global) break;
3736
3988
 
3737
- var matchStr = toString$3(result[0]);
3738
- if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
3989
+ var matchStr = toString$2(result[0]);
3990
+ if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
3739
3991
  }
3740
3992
 
3741
3993
  var accumulatedResult = '';
@@ -3743,37 +3995,37 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
3743
3995
  for (var i = 0; i < results.length; i++) {
3744
3996
  result = results[i];
3745
3997
 
3746
- var matched = toString$3(result[0]);
3747
- var position = max$1(min$1(toIntegerOrInfinity(result.index), S.length), 0);
3998
+ var matched = toString$2(result[0]);
3999
+ var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
3748
4000
  var captures = [];
3749
4001
  // NOTE: This is equivalent to
3750
4002
  // captures = result.slice(1).map(maybeToString)
3751
4003
  // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
3752
4004
  // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
3753
4005
  // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
3754
- for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
4006
+ for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
3755
4007
  var namedCaptures = result.groups;
3756
4008
  if (functionalReplace) {
3757
4009
  var replacerArgs = concat([matched], captures, position, S);
3758
- if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
3759
- var replacement = toString$3(apply$1(replaceValue, undefined, replacerArgs));
4010
+ if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
4011
+ var replacement = toString$2(apply(replaceValue, undefined, replacerArgs));
3760
4012
  } else {
3761
4013
  replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
3762
4014
  }
3763
4015
  if (position >= nextSourcePosition) {
3764
- accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
4016
+ accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
3765
4017
  nextSourcePosition = position + matched.length;
3766
4018
  }
3767
4019
  }
3768
- return accumulatedResult + stringSlice$1(S, nextSourcePosition);
4020
+ return accumulatedResult + stringSlice(S, nextSourcePosition);
3769
4021
  }
3770
4022
  ];
3771
4023
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
3772
4024
 
3773
4025
  const selectActiveExperiments = (experiments, profile) => {
3774
4026
  const experimentTraits = pickBy(profile.traits, (value, key) => key.startsWith(EXPERIENCE_TRAIT_PREFIX) && value === true);
3775
- const experimentTraitsIds = Object.keys(experimentTraits).map(id => id.replace(EXPERIENCE_TRAIT_PREFIX, '')); // a experiment is active when the use has it set as a true value on the traits and the experiment config is still active
3776
-
4027
+ const experimentTraitsIds = Object.keys(experimentTraits).map(id => id.replace(EXPERIENCE_TRAIT_PREFIX, ''));
4028
+ // a experiment is active when the use has it set as a true value on the traits and the experiment config is still active
3777
4029
  const activeExperiments = experiments.filter(experiment => includes(experimentTraitsIds, experiment.id));
3778
4030
  return activeExperiments;
3779
4031
  };
@@ -3783,7 +4035,6 @@ const selectActiveExperiments = (experiments, profile) => {
3783
4035
  * When going for an experiment we can only select a active experiment when 1 or more experiments are active
3784
4036
  * If the profile is not in any active experiments, we can select any expermiment
3785
4037
  */
3786
-
3787
4038
  const selectEligibleExperiences = ({
3788
4039
  experiences,
3789
4040
  activeExperiments
@@ -3795,15 +4046,12 @@ const selectEligibleExperiences = ({
3795
4046
 
3796
4047
  const LOWER_BOUND = 0;
3797
4048
  const UPPER_BOUND = 4294967295;
3798
-
3799
4049
  const normalize = (val, min, max) => (val - min) / (max - min);
3800
-
3801
4050
  const getRandom = text => {
3802
4051
  const hash = murmur3(text, 0);
3803
4052
  const random = normalize(hash, LOWER_BOUND, UPPER_BOUND);
3804
4053
  return random;
3805
4054
  };
3806
-
3807
4055
  const getTrafficRandom = (profile, experience) => getRandom(`traffic-${experience.id}-${profile.id}`);
3808
4056
  const getDistributionRandom = (profile, experience) => getRandom(`distribution-${experience.id}-${profile.id}`);
3809
4057
 
@@ -3813,6 +4061,7 @@ const isExperienceMatch = ({
3813
4061
  profile
3814
4062
  }) => {
3815
4063
  const trafficRandom = getTrafficRandom(profile, experience);
4064
+ /*console.log('has no audience', experience.id, !experience.audience);*/
3816
4065
  logger.info(`The traffic random factor for experience ${experience.id} is ${trafficRandom}. It's traffic allocation is set to ${experience.trafficAllocation}.`);
3817
4066
  const isInTrafficRange = experience.trafficAllocation > trafficRandom;
3818
4067
  const matchesAudience = !experience.audience || includes(profile.audiences, experience.audience.id);
@@ -3822,7 +4071,8 @@ const isExperienceMatch = ({
3822
4071
  logger.info(`Is the profile in traffic allocation range? ${isInTrafficRange ? 'yes' : 'no'}.\n
3823
4072
  Does the profile match the audience of the experience? ${matchesAudience ? 'yes' : 'no'}.\n
3824
4073
  Is there an active experiment for this profile? ${hasActiveExperiment ? 'yes' : 'no'}.`);
3825
- return isInTrafficRange && (matchesAudience || // if the expriment is active already then it's selectible without further contraints to be fullfilled
4074
+ return isInTrafficRange && (matchesAudience ||
4075
+ // if the expriment is active already then it's selectible without further contraints to be fullfilled
3826
4076
  hasActiveExperiment);
3827
4077
  };
3828
4078
 
@@ -3863,7 +4113,6 @@ const selectDistribution = ({
3863
4113
  end: 1
3864
4114
  };
3865
4115
  }
3866
-
3867
4116
  return distribution;
3868
4117
  };
3869
4118
 
@@ -3873,50 +4122,40 @@ const selectVariant = ({
3873
4122
  profile
3874
4123
  }) => {
3875
4124
  const variants = selectVariants(experience, baseline);
3876
-
3877
4125
  if (!variants.length) {
3878
4126
  return null;
3879
4127
  }
3880
-
3881
4128
  const distribution = selectDistribution({
3882
4129
  experience,
3883
4130
  profile
3884
4131
  });
3885
-
3886
4132
  if (!distribution) {
3887
4133
  return null;
3888
4134
  }
3889
-
3890
4135
  if (distribution.index === 0) {
3891
4136
  return Object.assign(Object.assign({}, baseline), {
3892
4137
  hidden: false
3893
4138
  });
3894
4139
  }
3895
-
3896
4140
  const correctedVariantIndex = distribution.index - 1;
3897
-
3898
4141
  if (variants.length <= correctedVariantIndex) {
3899
4142
  console.warn("A distribution for a variant was selected but it's metadata could not be found.");
3900
4143
  return null;
3901
4144
  }
3902
-
3903
4145
  const variant = variants[correctedVariantIndex];
3904
-
3905
4146
  if (!variant) {
3906
4147
  console.warn("A distribution for a variant was selected but it's metadata could not be found.");
3907
4148
  return null;
3908
4149
  }
3909
-
3910
4150
  return variant;
3911
4151
  };
3912
4152
 
3913
- var global$3 = global$K;
3914
- var aCallable = aCallable$6;
4153
+ var aCallable = aCallable$8;
3915
4154
  var toObject = toObject$5;
3916
4155
  var IndexedObject = indexedObject;
3917
- var lengthOfArrayLike$1 = lengthOfArrayLike$4;
4156
+ var lengthOfArrayLike = lengthOfArrayLike$3;
3918
4157
 
3919
- var TypeError$1 = global$3.TypeError;
4158
+ var $TypeError = TypeError;
3920
4159
 
3921
4160
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
3922
4161
  var createMethod$1 = function (IS_RIGHT) {
@@ -3924,7 +4163,7 @@ var createMethod$1 = function (IS_RIGHT) {
3924
4163
  aCallable(callbackfn);
3925
4164
  var O = toObject(that);
3926
4165
  var self = IndexedObject(O);
3927
- var length = lengthOfArrayLike$1(O);
4166
+ var length = lengthOfArrayLike(O);
3928
4167
  var index = IS_RIGHT ? length - 1 : 0;
3929
4168
  var i = IS_RIGHT ? -1 : 1;
3930
4169
  if (argumentsLength < 2) while (true) {
@@ -3935,7 +4174,7 @@ var createMethod$1 = function (IS_RIGHT) {
3935
4174
  }
3936
4175
  index += i;
3937
4176
  if (IS_RIGHT ? index < 0 : length <= index) {
3938
- throw TypeError$1('Reduce of empty array with no initial value');
4177
+ throw $TypeError('Reduce of empty array with no initial value');
3939
4178
  }
3940
4179
  }
3941
4180
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -3954,11 +4193,11 @@ var arrayReduce = {
3954
4193
  right: createMethod$1(true)
3955
4194
  };
3956
4195
 
3957
- var fails$2 = fails$k;
4196
+ var fails$1 = fails$m;
3958
4197
 
3959
4198
  var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
3960
4199
  var method = [][METHOD_NAME];
3961
- return !!method && fails$2(function () {
4200
+ return !!method && fails$1(function () {
3962
4201
  // eslint-disable-next-line no-useless-call -- required for testing
3963
4202
  method.call(null, argument || function () { return 1; }, 1);
3964
4203
  });
@@ -3984,197 +4223,13 @@ $$1({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
3984
4223
  }
3985
4224
  });
3986
4225
 
3987
- var toPropertyKey = toPropertyKey$3;
3988
- var definePropertyModule = objectDefineProperty;
3989
- var createPropertyDescriptor = createPropertyDescriptor$4;
3990
-
3991
- var createProperty$1 = function (object, key, value) {
3992
- var propertyKey = toPropertyKey(key);
3993
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
3994
- else object[propertyKey] = value;
3995
- };
3996
-
3997
- var global$2 = global$K;
3998
- var toAbsoluteIndex = toAbsoluteIndex$2;
3999
- var lengthOfArrayLike = lengthOfArrayLike$4;
4000
- var createProperty = createProperty$1;
4001
-
4002
- var Array$1 = global$2.Array;
4003
- var max = Math.max;
4004
-
4005
- var arraySliceSimple = function (O, start, end) {
4006
- var length = lengthOfArrayLike(O);
4007
- var k = toAbsoluteIndex(start, length);
4008
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
4009
- var result = Array$1(max(fin - k, 0));
4010
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
4011
- result.length = n;
4012
- return result;
4013
- };
4014
-
4015
- var apply = functionApply;
4016
- var call = functionCall;
4017
- var uncurryThis$2 = functionUncurryThis;
4018
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
4019
- var isRegExp = isRegexp;
4020
- var anObject = anObject$e;
4021
- var requireObjectCoercible$1 = requireObjectCoercible$8;
4022
- var speciesConstructor = speciesConstructor$2;
4023
- var advanceStringIndex = advanceStringIndex$2;
4024
- var toLength = toLength$4;
4025
- var toString$2 = toString$8;
4026
- var getMethod = getMethod$5;
4027
- var arraySlice = arraySliceSimple;
4028
- var callRegExpExec = regexpExecAbstract;
4029
- var regexpExec = regexpExec$3;
4030
- var stickyHelpers = regexpStickyHelpers;
4031
- var fails$1 = fails$k;
4032
-
4033
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
4034
- var MAX_UINT32 = 0xFFFFFFFF;
4035
- var min = Math.min;
4036
- var $push = [].push;
4037
- var exec$1 = uncurryThis$2(/./.exec);
4038
- var push = uncurryThis$2($push);
4039
- var stringSlice = uncurryThis$2(''.slice);
4040
-
4041
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
4042
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
4043
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$1(function () {
4044
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
4045
- var re = /(?:)/;
4046
- var originalExec = re.exec;
4047
- re.exec = function () { return originalExec.apply(this, arguments); };
4048
- var result = 'ab'.split(re);
4049
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
4050
- });
4051
-
4052
- // @@split logic
4053
- fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
4054
- var internalSplit;
4055
- if (
4056
- 'abbc'.split(/(b)*/)[1] == 'c' ||
4057
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
4058
- 'test'.split(/(?:)/, -1).length != 4 ||
4059
- 'ab'.split(/(?:ab)*/).length != 2 ||
4060
- '.'.split(/(.?)(.?)/).length != 4 ||
4061
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
4062
- '.'.split(/()()/).length > 1 ||
4063
- ''.split(/.?/).length
4064
- ) {
4065
- // based on es5-shim implementation, need to rework it
4066
- internalSplit = function (separator, limit) {
4067
- var string = toString$2(requireObjectCoercible$1(this));
4068
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
4069
- if (lim === 0) return [];
4070
- if (separator === undefined) return [string];
4071
- // If `separator` is not a regex, use native split
4072
- if (!isRegExp(separator)) {
4073
- return call(nativeSplit, string, separator, lim);
4074
- }
4075
- var output = [];
4076
- var flags = (separator.ignoreCase ? 'i' : '') +
4077
- (separator.multiline ? 'm' : '') +
4078
- (separator.unicode ? 'u' : '') +
4079
- (separator.sticky ? 'y' : '');
4080
- var lastLastIndex = 0;
4081
- // Make `global` and avoid `lastIndex` issues by working with a copy
4082
- var separatorCopy = new RegExp(separator.source, flags + 'g');
4083
- var match, lastIndex, lastLength;
4084
- while (match = call(regexpExec, separatorCopy, string)) {
4085
- lastIndex = separatorCopy.lastIndex;
4086
- if (lastIndex > lastLastIndex) {
4087
- push(output, stringSlice(string, lastLastIndex, match.index));
4088
- if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));
4089
- lastLength = match[0].length;
4090
- lastLastIndex = lastIndex;
4091
- if (output.length >= lim) break;
4092
- }
4093
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
4094
- }
4095
- if (lastLastIndex === string.length) {
4096
- if (lastLength || !exec$1(separatorCopy, '')) push(output, '');
4097
- } else push(output, stringSlice(string, lastLastIndex));
4098
- return output.length > lim ? arraySlice(output, 0, lim) : output;
4099
- };
4100
- // Chakra, V8
4101
- } else if ('0'.split(undefined, 0).length) {
4102
- internalSplit = function (separator, limit) {
4103
- return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
4104
- };
4105
- } else internalSplit = nativeSplit;
4106
-
4107
- return [
4108
- // `String.prototype.split` method
4109
- // https://tc39.es/ecma262/#sec-string.prototype.split
4110
- function split(separator, limit) {
4111
- var O = requireObjectCoercible$1(this);
4112
- var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
4113
- return splitter
4114
- ? call(splitter, separator, O, limit)
4115
- : call(internalSplit, toString$2(O), separator, limit);
4116
- },
4117
- // `RegExp.prototype[@@split]` method
4118
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
4119
- //
4120
- // NOTE: This cannot be properly polyfilled in engines that don't support
4121
- // the 'y' flag.
4122
- function (string, limit) {
4123
- var rx = anObject(this);
4124
- var S = toString$2(string);
4125
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
4126
-
4127
- if (res.done) return res.value;
4128
-
4129
- var C = speciesConstructor(rx, RegExp);
4130
-
4131
- var unicodeMatching = rx.unicode;
4132
- var flags = (rx.ignoreCase ? 'i' : '') +
4133
- (rx.multiline ? 'm' : '') +
4134
- (rx.unicode ? 'u' : '') +
4135
- (UNSUPPORTED_Y ? 'g' : 'y');
4136
-
4137
- // ^(? + rx + ) is needed, in combination with some S slicing, to
4138
- // simulate the 'y' flag.
4139
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
4140
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
4141
- if (lim === 0) return [];
4142
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
4143
- var p = 0;
4144
- var q = 0;
4145
- var A = [];
4146
- while (q < S.length) {
4147
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
4148
- var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
4149
- var e;
4150
- if (
4151
- z === null ||
4152
- (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
4153
- ) {
4154
- q = advanceStringIndex(S, q, unicodeMatching);
4155
- } else {
4156
- push(A, stringSlice(S, p, q));
4157
- if (A.length === lim) return A;
4158
- for (var i = 1; i <= z.length - 1; i++) {
4159
- push(A, z[i]);
4160
- if (A.length === lim) return A;
4161
- }
4162
- q = p = e;
4163
- }
4164
- }
4165
- push(A, stringSlice(S, p));
4166
- return A;
4167
- }
4168
- ];
4169
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
4170
-
4171
4226
  // a string of all valid unicode whitespaces
4172
4227
  var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
4173
4228
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
4174
4229
 
4175
4230
  var uncurryThis$1 = functionUncurryThis;
4176
- var requireObjectCoercible = requireObjectCoercible$8;
4177
- var toString$1 = toString$8;
4231
+ var requireObjectCoercible = requireObjectCoercible$7;
4232
+ var toString$1 = toString$7;
4178
4233
  var whitespaces$1 = whitespaces$2;
4179
4234
 
4180
4235
  var replace = uncurryThis$1(''.replace);
@@ -4204,10 +4259,10 @@ var stringTrim = {
4204
4259
  trim: createMethod(3)
4205
4260
  };
4206
4261
 
4207
- var global$1 = global$K;
4208
- var fails = fails$k;
4262
+ var global$1 = global$n;
4263
+ var fails = fails$m;
4209
4264
  var uncurryThis = functionUncurryThis;
4210
- var toString = toString$8;
4265
+ var toString = toString$7;
4211
4266
  var trim = stringTrim.trim;
4212
4267
  var whitespaces = whitespaces$2;
4213
4268
 
@@ -4240,11 +4295,9 @@ const decodeExperienceVariantsMap = encodedExperienceVariantsMap => {
4240
4295
  return encodedExperienceVariantsMap.split(',').map(experienceIdWithVariant => {
4241
4296
  const [experienceId, _variantIndex] = experienceIdWithVariant.split('=');
4242
4297
  const variantIndex = parseInt(_variantIndex);
4243
-
4244
4298
  if (!experienceId || !variantIndex) {
4245
4299
  return null;
4246
4300
  }
4247
-
4248
4301
  return {
4249
4302
  experienceId,
4250
4303
  variantIndex
@@ -4254,4 +4307,4 @@ const decodeExperienceVariantsMap = encodedExperienceVariantsMap => {
4254
4307
  }), {});
4255
4308
  };
4256
4309
 
4257
- export { EXPERIENCE_TRAIT_PREFIX, NINETAILED_TRACKER_EVENTS, Ninetailed, PLUGIN_NAME, decodeExperienceVariantsMap, isExperienceMatch, ninetailedPlugin, selectActiveExperiments, selectDistribution, selectEligibleExperiences, selectExperience, selectBaselineWithVariants as selectExperienceBaselineWithVariants, selectVariant as selectExperienceVariant, selectVariants as selectExperienceVariants, selectHasVariants as selectHasExperienceVariants, selectVariant$1 as selectVariant };
4310
+ export { ANONYMOUS_ID, DEBUG_FLAG, EXPERIENCE_TRAIT_PREFIX, LEGACY_ANONYMOUS_ID, Ninetailed, PLUGIN_NAME, PROFILE_CHANGE, PROFILE_FALLBACK_CACHE, PROFILE_RESET, decodeExperienceVariantsMap, isExperienceMatch, ninetailedPlugin, selectActiveExperiments, selectDistribution, selectEligibleExperiences, selectExperience, selectBaselineWithVariants as selectExperienceBaselineWithVariants, selectVariant as selectExperienceVariant, selectVariants as selectExperienceVariants, selectHasVariants as selectHasExperienceVariants, selectVariant$1 as selectVariant };