@ninetailed/experience.js-react 4.3.0-beta.6 → 4.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -5,10 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var experience_js = require('@ninetailed/experience.js');
8
- var reactIs = require('react-is');
8
+ var reactIntersectionObserver = require('react-intersection-observer');
9
9
  var experience_jsShared = require('@ninetailed/experience.js-shared');
10
10
  var radash = require('radash');
11
- var reactIntersectionObserver = require('react-intersection-observer');
12
11
 
13
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
13
 
@@ -21,7 +20,7 @@ var check = function (it) {
21
20
  };
22
21
 
23
22
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
24
- var global$c =
23
+ var global$d =
25
24
  // eslint-disable-next-line es/no-global-this -- safe
26
25
  check(typeof globalThis == 'object' && globalThis) ||
27
26
  check(typeof window == 'object' && window) ||
@@ -103,30 +102,30 @@ var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
103
102
  };
104
103
  };
105
104
 
106
- var uncurryThis$9 = functionUncurryThis;
105
+ var uncurryThis$a = functionUncurryThis;
107
106
 
108
- var toString$1 = uncurryThis$9({}.toString);
109
- var stringSlice = uncurryThis$9(''.slice);
107
+ var toString$3 = uncurryThis$a({}.toString);
108
+ var stringSlice$1 = uncurryThis$a(''.slice);
110
109
 
111
- var classofRaw = function (it) {
112
- return stringSlice(toString$1(it), 8, -1);
110
+ var classofRaw$1 = function (it) {
111
+ return stringSlice$1(toString$3(it), 8, -1);
113
112
  };
114
113
 
115
- var uncurryThis$8 = functionUncurryThis;
114
+ var uncurryThis$9 = functionUncurryThis;
116
115
  var fails$9 = fails$c;
117
- var classof$1 = classofRaw;
116
+ var classof$3 = classofRaw$1;
118
117
 
119
- var $Object$3 = Object;
120
- var split = uncurryThis$8(''.split);
118
+ var $Object$4 = Object;
119
+ var split = uncurryThis$9(''.split);
121
120
 
122
121
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
123
122
  var indexedObject = fails$9(function () {
124
123
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
125
124
  // eslint-disable-next-line no-prototype-builtins -- safe
126
- return !$Object$3('z').propertyIsEnumerable(0);
125
+ return !$Object$4('z').propertyIsEnumerable(0);
127
126
  }) ? function (it) {
128
- return classof$1(it) == 'String' ? split(it, '') : $Object$3(it);
129
- } : $Object$3;
127
+ return classof$3(it) == 'String' ? split(it, '') : $Object$4(it);
128
+ } : $Object$4;
130
129
 
131
130
  // we can't use just `it == null` since of `document.all` special case
132
131
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
@@ -169,47 +168,47 @@ var documentAll$1 = $documentAll$1.all;
169
168
 
170
169
  // `IsCallable` abstract operation
171
170
  // https://tc39.es/ecma262/#sec-iscallable
172
- var isCallable$e = $documentAll$1.IS_HTMLDDA ? function (argument) {
171
+ var isCallable$g = $documentAll$1.IS_HTMLDDA ? function (argument) {
173
172
  return typeof argument == 'function' || argument === documentAll$1;
174
173
  } : function (argument) {
175
174
  return typeof argument == 'function';
176
175
  };
177
176
 
178
- var isCallable$d = isCallable$e;
177
+ var isCallable$f = isCallable$g;
179
178
  var $documentAll = documentAll_1;
180
179
 
181
180
  var documentAll = $documentAll.all;
182
181
 
183
182
  var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
184
- return typeof it == 'object' ? it !== null : isCallable$d(it) || it === documentAll;
183
+ return typeof it == 'object' ? it !== null : isCallable$f(it) || it === documentAll;
185
184
  } : function (it) {
186
- return typeof it == 'object' ? it !== null : isCallable$d(it);
185
+ return typeof it == 'object' ? it !== null : isCallable$f(it);
187
186
  };
188
187
 
189
- var global$b = global$c;
190
- var isCallable$c = isCallable$e;
188
+ var global$c = global$d;
189
+ var isCallable$e = isCallable$g;
191
190
 
192
191
  var aFunction = function (argument) {
193
- return isCallable$c(argument) ? argument : undefined;
192
+ return isCallable$e(argument) ? argument : undefined;
194
193
  };
195
194
 
196
195
  var getBuiltIn$4 = function (namespace, method) {
197
- return arguments.length < 2 ? aFunction(global$b[namespace]) : global$b[namespace] && global$b[namespace][method];
196
+ return arguments.length < 2 ? aFunction(global$c[namespace]) : global$c[namespace] && global$c[namespace][method];
198
197
  };
199
198
 
200
- var uncurryThis$7 = functionUncurryThis;
199
+ var uncurryThis$8 = functionUncurryThis;
201
200
 
202
- var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
201
+ var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
203
202
 
204
203
  var getBuiltIn$3 = getBuiltIn$4;
205
204
 
206
205
  var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
207
206
 
208
- var global$a = global$c;
207
+ var global$b = global$d;
209
208
  var userAgent = engineUserAgent;
210
209
 
211
- var process = global$a.process;
212
- var Deno = global$a.Deno;
210
+ var process = global$b.process;
211
+ var Deno = global$b.Deno;
213
212
  var versions = process && process.versions || Deno && Deno.version;
214
213
  var v8 = versions && versions.v8;
215
214
  var match, version;
@@ -250,44 +249,44 @@ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(func
250
249
 
251
250
  /* eslint-disable es/no-symbol -- required for testing */
252
251
 
253
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
252
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
254
253
 
255
- var useSymbolAsUid = NATIVE_SYMBOL$1
254
+ var useSymbolAsUid = NATIVE_SYMBOL$2
256
255
  && !Symbol.sham
257
256
  && typeof Symbol.iterator == 'symbol';
258
257
 
259
258
  var getBuiltIn$2 = getBuiltIn$4;
260
- var isCallable$b = isCallable$e;
261
- var isPrototypeOf = objectIsPrototypeOf;
259
+ var isCallable$d = isCallable$g;
260
+ var isPrototypeOf$1 = objectIsPrototypeOf;
262
261
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
263
262
 
264
- var $Object$2 = Object;
263
+ var $Object$3 = Object;
265
264
 
266
265
  var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
267
266
  return typeof it == 'symbol';
268
267
  } : function (it) {
269
268
  var $Symbol = getBuiltIn$2('Symbol');
270
- return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
269
+ return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
271
270
  };
272
271
 
273
- var $String$2 = String;
272
+ var $String$3 = String;
274
273
 
275
274
  var tryToString$1 = function (argument) {
276
275
  try {
277
- return $String$2(argument);
276
+ return $String$3(argument);
278
277
  } catch (error) {
279
278
  return 'Object';
280
279
  }
281
280
  };
282
281
 
283
- var isCallable$a = isCallable$e;
282
+ var isCallable$c = isCallable$g;
284
283
  var tryToString = tryToString$1;
285
284
 
286
285
  var $TypeError$6 = TypeError;
287
286
 
288
287
  // `Assert: IsCallable(argument) is true`
289
288
  var aCallable$2 = function (argument) {
290
- if (isCallable$a(argument)) return argument;
289
+ if (isCallable$c(argument)) return argument;
291
290
  throw $TypeError$6(tryToString(argument) + ' is not a function');
292
291
  };
293
292
 
@@ -302,7 +301,7 @@ var getMethod$1 = function (V, P) {
302
301
  };
303
302
 
304
303
  var call$4 = functionCall;
305
- var isCallable$9 = isCallable$e;
304
+ var isCallable$b = isCallable$g;
306
305
  var isObject$5 = isObject$6;
307
306
 
308
307
  var $TypeError$5 = TypeError;
@@ -311,32 +310,32 @@ var $TypeError$5 = TypeError;
311
310
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
312
311
  var ordinaryToPrimitive$1 = function (input, pref) {
313
312
  var fn, val;
314
- if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
315
- if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
316
- if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
313
+ if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
314
+ if (isCallable$b(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
315
+ if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
317
316
  throw $TypeError$5("Can't convert object to primitive value");
318
317
  };
319
318
 
320
319
  var shared$3 = {exports: {}};
321
320
 
322
- var global$9 = global$c;
321
+ var global$a = global$d;
323
322
 
324
323
  // eslint-disable-next-line es/no-object-defineproperty -- safe
325
- var defineProperty$5 = Object.defineProperty;
324
+ var defineProperty$6 = Object.defineProperty;
326
325
 
327
326
  var defineGlobalProperty$3 = function (key, value) {
328
327
  try {
329
- defineProperty$5(global$9, key, { value: value, configurable: true, writable: true });
328
+ defineProperty$6(global$a, key, { value: value, configurable: true, writable: true });
330
329
  } catch (error) {
331
- global$9[key] = value;
330
+ global$a[key] = value;
332
331
  } return value;
333
332
  };
334
333
 
335
- var global$8 = global$c;
334
+ var global$9 = global$d;
336
335
  var defineGlobalProperty$2 = defineGlobalProperty$3;
337
336
 
338
337
  var SHARED = '__core-js_shared__';
339
- var store$3 = global$8[SHARED] || defineGlobalProperty$2(SHARED, {});
338
+ var store$3 = global$9[SHARED] || defineGlobalProperty$2(SHARED, {});
340
339
 
341
340
  var sharedStore = store$3;
342
341
 
@@ -354,18 +353,18 @@ var store$2 = sharedStore;
354
353
 
355
354
  var requireObjectCoercible = requireObjectCoercible$2;
356
355
 
357
- var $Object$1 = Object;
356
+ var $Object$2 = Object;
358
357
 
359
358
  // `ToObject` abstract operation
360
359
  // https://tc39.es/ecma262/#sec-toobject
361
360
  var toObject$4 = function (argument) {
362
- return $Object$1(requireObjectCoercible(argument));
361
+ return $Object$2(requireObjectCoercible(argument));
363
362
  };
364
363
 
365
- var uncurryThis$6 = functionUncurryThis;
364
+ var uncurryThis$7 = functionUncurryThis;
366
365
  var toObject$3 = toObject$4;
367
366
 
368
- var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
367
+ var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
369
368
 
370
369
  // `HasOwnProperty` abstract operation
371
370
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -374,32 +373,32 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
374
373
  return hasOwnProperty(toObject$3(it), key);
375
374
  };
376
375
 
377
- var uncurryThis$5 = functionUncurryThis;
376
+ var uncurryThis$6 = functionUncurryThis;
378
377
 
379
378
  var id = 0;
380
379
  var postfix = Math.random();
381
- var toString = uncurryThis$5(1.0.toString);
380
+ var toString$2 = uncurryThis$6(1.0.toString);
382
381
 
383
382
  var uid$2 = function (key) {
384
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
383
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
385
384
  };
386
385
 
387
- var global$7 = global$c;
386
+ var global$8 = global$d;
388
387
  var shared$2 = shared$3.exports;
389
- var hasOwn$8 = hasOwnProperty_1;
388
+ var hasOwn$9 = hasOwnProperty_1;
390
389
  var uid$1 = uid$2;
391
- var NATIVE_SYMBOL = symbolConstructorDetection;
390
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
392
391
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
393
392
 
394
393
  var WellKnownSymbolsStore = shared$2('wks');
395
- var Symbol$1 = global$7.Symbol;
394
+ var Symbol$1 = global$8.Symbol;
396
395
  var symbolFor = Symbol$1 && Symbol$1['for'];
397
396
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
398
397
 
399
- var wellKnownSymbol$6 = function (name) {
400
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
398
+ var wellKnownSymbol$8 = function (name) {
399
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
401
400
  var description = 'Symbol.' + name;
402
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
401
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
403
402
  WellKnownSymbolsStore[name] = Symbol$1[name];
404
403
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
405
404
  WellKnownSymbolsStore[name] = symbolFor(description);
@@ -414,10 +413,10 @@ var isObject$4 = isObject$6;
414
413
  var isSymbol$1 = isSymbol$2;
415
414
  var getMethod = getMethod$1;
416
415
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
417
- var wellKnownSymbol$5 = wellKnownSymbol$6;
416
+ var wellKnownSymbol$7 = wellKnownSymbol$8;
418
417
 
419
418
  var $TypeError$4 = TypeError;
420
- var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
419
+ var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
421
420
 
422
421
  // `ToPrimitive` abstract operation
423
422
  // https://tc39.es/ecma262/#sec-toprimitive
@@ -445,10 +444,10 @@ var toPropertyKey$2 = function (argument) {
445
444
  return isSymbol(key) ? key : key + '';
446
445
  };
447
446
 
448
- var global$6 = global$c;
447
+ var global$7 = global$d;
449
448
  var isObject$3 = isObject$6;
450
449
 
451
- var document$1 = global$6.document;
450
+ var document$1 = global$7.document;
452
451
  // typeof document.createElement is 'object' in old IE
453
452
  var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
454
453
 
@@ -456,25 +455,25 @@ var documentCreateElement$2 = function (it) {
456
455
  return EXISTS$1 ? document$1.createElement(it) : {};
457
456
  };
458
457
 
459
- var DESCRIPTORS$9 = descriptors;
458
+ var DESCRIPTORS$a = descriptors;
460
459
  var fails$7 = fails$c;
461
460
  var createElement = documentCreateElement$2;
462
461
 
463
462
  // Thanks to IE8 for its funny defineProperty
464
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$7(function () {
463
+ var ie8DomDefine = !DESCRIPTORS$a && !fails$7(function () {
465
464
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
466
465
  return Object.defineProperty(createElement('div'), 'a', {
467
466
  get: function () { return 7; }
468
467
  }).a != 7;
469
468
  });
470
469
 
471
- var DESCRIPTORS$8 = descriptors;
470
+ var DESCRIPTORS$9 = descriptors;
472
471
  var call$2 = functionCall;
473
472
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
474
473
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
475
474
  var toIndexedObject$4 = toIndexedObject$5;
476
475
  var toPropertyKey$1 = toPropertyKey$2;
477
- var hasOwn$7 = hasOwnProperty_1;
476
+ var hasOwn$8 = hasOwnProperty_1;
478
477
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
479
478
 
480
479
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -482,23 +481,23 @@ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
482
481
 
483
482
  // `Object.getOwnPropertyDescriptor` method
484
483
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
485
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
484
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
486
485
  O = toIndexedObject$4(O);
487
486
  P = toPropertyKey$1(P);
488
487
  if (IE8_DOM_DEFINE$1) try {
489
488
  return $getOwnPropertyDescriptor$1(O, P);
490
489
  } catch (error) { /* empty */ }
491
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
490
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
492
491
  };
493
492
 
494
493
  var objectDefineProperty = {};
495
494
 
496
- var DESCRIPTORS$7 = descriptors;
495
+ var DESCRIPTORS$8 = descriptors;
497
496
  var fails$6 = fails$c;
498
497
 
499
498
  // V8 ~ Chrome 36-
500
499
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
501
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$6(function () {
500
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$6(function () {
502
501
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
503
502
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
504
503
  value: 42,
@@ -508,16 +507,16 @@ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$6(function () {
508
507
 
509
508
  var isObject$2 = isObject$6;
510
509
 
511
- var $String$1 = String;
510
+ var $String$2 = String;
512
511
  var $TypeError$3 = TypeError;
513
512
 
514
513
  // `Assert: Type(argument) is Object`
515
514
  var anObject$5 = function (argument) {
516
515
  if (isObject$2(argument)) return argument;
517
- throw $TypeError$3($String$1(argument) + ' is not an object');
516
+ throw $TypeError$3($String$2(argument) + ' is not an object');
518
517
  };
519
518
 
520
- var DESCRIPTORS$6 = descriptors;
519
+ var DESCRIPTORS$7 = descriptors;
521
520
  var IE8_DOM_DEFINE = ie8DomDefine;
522
521
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
523
522
  var anObject$4 = anObject$5;
@@ -534,7 +533,7 @@ var WRITABLE = 'writable';
534
533
 
535
534
  // `Object.defineProperty` method
536
535
  // https://tc39.es/ecma262/#sec-object.defineproperty
537
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
536
+ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
538
537
  anObject$4(O);
539
538
  P = toPropertyKey(P);
540
539
  anObject$4(Attributes);
@@ -561,11 +560,11 @@ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
561
560
  return O;
562
561
  };
563
562
 
564
- var DESCRIPTORS$5 = descriptors;
563
+ var DESCRIPTORS$6 = descriptors;
565
564
  var definePropertyModule$3 = objectDefineProperty;
566
565
  var createPropertyDescriptor$1 = createPropertyDescriptor$3;
567
566
 
568
- var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value) {
567
+ var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
569
568
  return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
570
569
  } : function (object, key, value) {
571
570
  object[key] = value;
@@ -574,17 +573,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
574
573
 
575
574
  var makeBuiltIn$2 = {exports: {}};
576
575
 
577
- var DESCRIPTORS$4 = descriptors;
578
- var hasOwn$6 = hasOwnProperty_1;
576
+ var DESCRIPTORS$5 = descriptors;
577
+ var hasOwn$7 = hasOwnProperty_1;
579
578
 
580
579
  var FunctionPrototype = Function.prototype;
581
580
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
582
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
581
+ var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
583
582
 
584
- var EXISTS = hasOwn$6(FunctionPrototype, 'name');
583
+ var EXISTS = hasOwn$7(FunctionPrototype, 'name');
585
584
  // additional protection from minified / mangled / dropped function names
586
585
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
587
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
586
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
588
587
 
589
588
  var functionName = {
590
589
  EXISTS: EXISTS,
@@ -592,14 +591,14 @@ var functionName = {
592
591
  CONFIGURABLE: CONFIGURABLE
593
592
  };
594
593
 
595
- var uncurryThis$4 = functionUncurryThis;
596
- var isCallable$8 = isCallable$e;
594
+ var uncurryThis$5 = functionUncurryThis;
595
+ var isCallable$a = isCallable$g;
597
596
  var store$1 = sharedStore;
598
597
 
599
- var functionToString = uncurryThis$4(Function.toString);
598
+ var functionToString = uncurryThis$5(Function.toString);
600
599
 
601
600
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
602
- if (!isCallable$8(store$1.inspectSource)) {
601
+ if (!isCallable$a(store$1.inspectSource)) {
603
602
  store$1.inspectSource = function (it) {
604
603
  return functionToString(it);
605
604
  };
@@ -607,12 +606,12 @@ if (!isCallable$8(store$1.inspectSource)) {
607
606
 
608
607
  var inspectSource$1 = store$1.inspectSource;
609
608
 
610
- var global$5 = global$c;
611
- var isCallable$7 = isCallable$e;
609
+ var global$6 = global$d;
610
+ var isCallable$9 = isCallable$g;
612
611
 
613
- var WeakMap$1 = global$5.WeakMap;
612
+ var WeakMap$1 = global$6.WeakMap;
614
613
 
615
- var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
614
+ var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
616
615
 
617
616
  var shared$1 = shared$3.exports;
618
617
  var uid = uid$2;
@@ -626,17 +625,17 @@ var sharedKey$3 = function (key) {
626
625
  var hiddenKeys$4 = {};
627
626
 
628
627
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
629
- var global$4 = global$c;
628
+ var global$5 = global$d;
630
629
  var isObject$1 = isObject$6;
631
630
  var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
632
- var hasOwn$5 = hasOwnProperty_1;
631
+ var hasOwn$6 = hasOwnProperty_1;
633
632
  var shared = sharedStore;
634
633
  var sharedKey$2 = sharedKey$3;
635
634
  var hiddenKeys$3 = hiddenKeys$4;
636
635
 
637
636
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
638
- var TypeError$1 = global$4.TypeError;
639
- var WeakMap = global$4.WeakMap;
637
+ var TypeError$1 = global$5.TypeError;
638
+ var WeakMap = global$5.WeakMap;
640
639
  var set, get, has;
641
640
 
642
641
  var enforce = function (it) {
@@ -675,16 +674,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
675
674
  var STATE = sharedKey$2('state');
676
675
  hiddenKeys$3[STATE] = true;
677
676
  set = function (it, metadata) {
678
- if (hasOwn$5(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
677
+ if (hasOwn$6(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
679
678
  metadata.facade = it;
680
679
  createNonEnumerableProperty$3(it, STATE, metadata);
681
680
  return metadata;
682
681
  };
683
682
  get = function (it) {
684
- return hasOwn$5(it, STATE) ? it[STATE] : {};
683
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
685
684
  };
686
685
  has = function (it) {
687
- return hasOwn$5(it, STATE);
686
+ return hasOwn$6(it, STATE);
688
687
  };
689
688
  }
690
689
 
@@ -697,9 +696,9 @@ var internalState = {
697
696
  };
698
697
 
699
698
  var fails$5 = fails$c;
700
- var isCallable$6 = isCallable$e;
701
- var hasOwn$4 = hasOwnProperty_1;
702
- var DESCRIPTORS$3 = descriptors;
699
+ var isCallable$8 = isCallable$g;
700
+ var hasOwn$5 = hasOwnProperty_1;
701
+ var DESCRIPTORS$4 = descriptors;
703
702
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
704
703
  var inspectSource = inspectSource$1;
705
704
  var InternalStateModule$1 = internalState;
@@ -707,10 +706,10 @@ var InternalStateModule$1 = internalState;
707
706
  var enforceInternalState = InternalStateModule$1.enforce;
708
707
  var getInternalState$1 = InternalStateModule$1.get;
709
708
  // eslint-disable-next-line es/no-object-defineproperty -- safe
710
- var defineProperty$4 = Object.defineProperty;
709
+ var defineProperty$5 = Object.defineProperty;
711
710
 
712
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$5(function () {
713
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
711
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$5(function () {
712
+ return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
714
713
  });
715
714
 
716
715
  var TEMPLATE = String(String).split('String');
@@ -721,21 +720,21 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
721
720
  }
722
721
  if (options && options.getter) name = 'get ' + name;
723
722
  if (options && options.setter) name = 'set ' + name;
724
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
725
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
723
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
724
+ if (DESCRIPTORS$4) defineProperty$5(value, 'name', { value: name, configurable: true });
726
725
  else value.name = name;
727
726
  }
728
- if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
729
- defineProperty$4(value, 'length', { value: options.arity });
727
+ if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
728
+ defineProperty$5(value, 'length', { value: options.arity });
730
729
  }
731
730
  try {
732
- if (options && hasOwn$4(options, 'constructor') && options.constructor) {
733
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
731
+ if (options && hasOwn$5(options, 'constructor') && options.constructor) {
732
+ if (DESCRIPTORS$4) defineProperty$5(value, 'prototype', { writable: false });
734
733
  // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
735
734
  } else if (value.prototype) value.prototype = undefined;
736
735
  } catch (error) { /* empty */ }
737
736
  var state = enforceInternalState(value);
738
- if (!hasOwn$4(state, 'source')) {
737
+ if (!hasOwn$5(state, 'source')) {
739
738
  state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
740
739
  } return value;
741
740
  };
@@ -743,10 +742,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
743
742
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
744
743
  // eslint-disable-next-line no-extend-native -- required
745
744
  Function.prototype.toString = makeBuiltIn$1(function toString() {
746
- return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
745
+ return isCallable$8(this) && getInternalState$1(this).source || inspectSource(this);
747
746
  }, 'toString');
748
747
 
749
- var isCallable$5 = isCallable$e;
748
+ var isCallable$7 = isCallable$g;
750
749
  var definePropertyModule$2 = objectDefineProperty;
751
750
  var makeBuiltIn = makeBuiltIn$2.exports;
752
751
  var defineGlobalProperty$1 = defineGlobalProperty$3;
@@ -755,7 +754,7 @@ var defineBuiltIn$3 = function (O, key, value, options) {
755
754
  if (!options) options = {};
756
755
  var simple = options.enumerable;
757
756
  var name = options.name !== undefined ? options.name : key;
758
- if (isCallable$5(value)) makeBuiltIn(value, name, options);
757
+ if (isCallable$7(value)) makeBuiltIn(value, name, options);
759
758
  if (options.global) {
760
759
  if (simple) O[key] = value;
761
760
  else defineGlobalProperty$1(key, value);
@@ -861,22 +860,22 @@ var arrayIncludes = {
861
860
  indexOf: createMethod$1(false)
862
861
  };
863
862
 
864
- var uncurryThis$3 = functionUncurryThis;
865
- var hasOwn$3 = hasOwnProperty_1;
863
+ var uncurryThis$4 = functionUncurryThis;
864
+ var hasOwn$4 = hasOwnProperty_1;
866
865
  var toIndexedObject$2 = toIndexedObject$5;
867
866
  var indexOf = arrayIncludes.indexOf;
868
867
  var hiddenKeys$2 = hiddenKeys$4;
869
868
 
870
- var push = uncurryThis$3([].push);
869
+ var push = uncurryThis$4([].push);
871
870
 
872
871
  var objectKeysInternal = function (object, names) {
873
872
  var O = toIndexedObject$2(object);
874
873
  var i = 0;
875
874
  var result = [];
876
875
  var key;
877
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
876
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
878
877
  // Don't enum bug & hidden keys
879
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
878
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
880
879
  ~indexOf(result, key) || push(result, key);
881
880
  }
882
881
  return result;
@@ -911,12 +910,12 @@ var objectGetOwnPropertySymbols = {};
911
910
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
912
911
 
913
912
  var getBuiltIn$1 = getBuiltIn$4;
914
- var uncurryThis$2 = functionUncurryThis;
913
+ var uncurryThis$3 = functionUncurryThis;
915
914
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
916
915
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
917
916
  var anObject$3 = anObject$5;
918
917
 
919
- var concat$1 = uncurryThis$2([].concat);
918
+ var concat$1 = uncurryThis$3([].concat);
920
919
 
921
920
  // all object keys, includes non-enumerable and symbols
922
921
  var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -925,25 +924,25 @@ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
925
924
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
926
925
  };
927
926
 
928
- var hasOwn$2 = hasOwnProperty_1;
927
+ var hasOwn$3 = hasOwnProperty_1;
929
928
  var ownKeys = ownKeys$1;
930
929
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
931
930
  var definePropertyModule$1 = objectDefineProperty;
932
931
 
933
- var copyConstructorProperties$1 = function (target, source, exceptions) {
932
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
934
933
  var keys = ownKeys(source);
935
934
  var defineProperty = definePropertyModule$1.f;
936
935
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
937
936
  for (var i = 0; i < keys.length; i++) {
938
937
  var key = keys[i];
939
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
938
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
940
939
  defineProperty(target, key, getOwnPropertyDescriptor(source, key));
941
940
  }
942
941
  }
943
942
  };
944
943
 
945
944
  var fails$4 = fails$c;
946
- var isCallable$4 = isCallable$e;
945
+ var isCallable$6 = isCallable$g;
947
946
 
948
947
  var replacement = /#|\.prototype\./;
949
948
 
@@ -951,7 +950,7 @@ var isForced$1 = function (feature, detection) {
951
950
  var value = data[normalize(feature)];
952
951
  return value == POLYFILL ? true
953
952
  : value == NATIVE ? false
954
- : isCallable$4(detection) ? fails$4(detection)
953
+ : isCallable$6(detection) ? fails$4(detection)
955
954
  : !!detection;
956
955
  };
957
956
 
@@ -965,12 +964,12 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
965
964
 
966
965
  var isForced_1 = isForced$1;
967
966
 
968
- var global$3 = global$c;
967
+ var global$4 = global$d;
969
968
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
970
969
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
971
970
  var defineBuiltIn$2 = defineBuiltIn$3;
972
971
  var defineGlobalProperty = defineGlobalProperty$3;
973
- var copyConstructorProperties = copyConstructorProperties$1;
972
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
974
973
  var isForced = isForced_1;
975
974
 
976
975
  /*
@@ -994,11 +993,11 @@ var _export = function (options, source) {
994
993
  var STATIC = options.stat;
995
994
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
996
995
  if (GLOBAL) {
997
- target = global$3;
996
+ target = global$4;
998
997
  } else if (STATIC) {
999
- target = global$3[TARGET] || defineGlobalProperty(TARGET, {});
998
+ target = global$4[TARGET] || defineGlobalProperty(TARGET, {});
1000
999
  } else {
1001
- target = (global$3[TARGET] || {}).prototype;
1000
+ target = (global$4[TARGET] || {}).prototype;
1002
1001
  }
1003
1002
  if (target) for (key in source) {
1004
1003
  sourceProperty = source[key];
@@ -1010,7 +1009,7 @@ var _export = function (options, source) {
1010
1009
  // contained in target
1011
1010
  if (!FORCED && targetProperty !== undefined) {
1012
1011
  if (typeof sourceProperty == typeof targetProperty) continue;
1013
- copyConstructorProperties(sourceProperty, targetProperty);
1012
+ copyConstructorProperties$1(sourceProperty, targetProperty);
1014
1013
  }
1015
1014
  // add a flag to not completely full polyfills
1016
1015
  if (options.sham || (targetProperty && targetProperty.sham)) {
@@ -1030,8 +1029,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1030
1029
  return internalObjectKeys(O, enumBugKeys$1);
1031
1030
  };
1032
1031
 
1033
- var DESCRIPTORS$2 = descriptors;
1034
- var uncurryThis$1 = functionUncurryThis;
1032
+ var DESCRIPTORS$3 = descriptors;
1033
+ var uncurryThis$2 = functionUncurryThis;
1035
1034
  var call$1 = functionCall;
1036
1035
  var fails$3 = fails$c;
1037
1036
  var objectKeys$1 = objectKeys$2;
@@ -1043,17 +1042,17 @@ var IndexedObject$1 = indexedObject;
1043
1042
  // eslint-disable-next-line es/no-object-assign -- safe
1044
1043
  var $assign = Object.assign;
1045
1044
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1046
- var defineProperty$3 = Object.defineProperty;
1047
- var concat = uncurryThis$1([].concat);
1045
+ var defineProperty$4 = Object.defineProperty;
1046
+ var concat = uncurryThis$2([].concat);
1048
1047
 
1049
1048
  // `Object.assign` method
1050
1049
  // https://tc39.es/ecma262/#sec-object.assign
1051
1050
  var objectAssign = !$assign || fails$3(function () {
1052
1051
  // should have correct order of operations (Edge bug)
1053
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1052
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1054
1053
  enumerable: true,
1055
1054
  get: function () {
1056
- defineProperty$3(this, 'b', {
1055
+ defineProperty$4(this, 'b', {
1057
1056
  value: 3,
1058
1057
  enumerable: false
1059
1058
  });
@@ -1082,18 +1081,18 @@ var objectAssign = !$assign || fails$3(function () {
1082
1081
  var key;
1083
1082
  while (length > j) {
1084
1083
  key = keys[j++];
1085
- if (!DESCRIPTORS$2 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1084
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1086
1085
  }
1087
1086
  } return T;
1088
1087
  } : $assign;
1089
1088
 
1090
- var $$2 = _export;
1089
+ var $$3 = _export;
1091
1090
  var assign = objectAssign;
1092
1091
 
1093
1092
  // `Object.assign` method
1094
1093
  // https://tc39.es/ecma262/#sec-object.assign
1095
1094
  // eslint-disable-next-line es/no-object-assign -- required for testing
1096
- $$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1095
+ $$3({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1097
1096
  assign: assign
1098
1097
  });
1099
1098
 
@@ -1101,7 +1100,7 @@ const NinetailedContext = /*#__PURE__*/React.createContext(undefined);
1101
1100
 
1102
1101
  var objectDefineProperties = {};
1103
1102
 
1104
- var DESCRIPTORS$1 = descriptors;
1103
+ var DESCRIPTORS$2 = descriptors;
1105
1104
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1106
1105
  var definePropertyModule = objectDefineProperty;
1107
1106
  var anObject$2 = anObject$5;
@@ -1111,7 +1110,7 @@ var objectKeys = objectKeys$2;
1111
1110
  // `Object.defineProperties` method
1112
1111
  // https://tc39.es/ecma262/#sec-object.defineproperties
1113
1112
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1114
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1113
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1115
1114
  anObject$2(O);
1116
1115
  var props = toIndexedObject$1(Properties);
1117
1116
  var keys = objectKeys(Properties);
@@ -1211,17 +1210,17 @@ var objectCreate = Object.create || function create(O, Properties) {
1211
1210
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1212
1211
  };
1213
1212
 
1214
- var wellKnownSymbol$4 = wellKnownSymbol$6;
1213
+ var wellKnownSymbol$6 = wellKnownSymbol$8;
1215
1214
  var create$1 = objectCreate;
1216
- var defineProperty$2 = objectDefineProperty.f;
1215
+ var defineProperty$3 = objectDefineProperty.f;
1217
1216
 
1218
- var UNSCOPABLES = wellKnownSymbol$4('unscopables');
1217
+ var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1219
1218
  var ArrayPrototype = Array.prototype;
1220
1219
 
1221
1220
  // Array.prototype[@@unscopables]
1222
1221
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1223
1222
  if (ArrayPrototype[UNSCOPABLES] == undefined) {
1224
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1223
+ defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1225
1224
  configurable: true,
1226
1225
  value: create$1(null)
1227
1226
  });
@@ -1243,36 +1242,36 @@ var correctPrototypeGetter = !fails$2(function () {
1243
1242
  return Object.getPrototypeOf(new F()) !== F.prototype;
1244
1243
  });
1245
1244
 
1246
- var hasOwn$1 = hasOwnProperty_1;
1247
- var isCallable$3 = isCallable$e;
1245
+ var hasOwn$2 = hasOwnProperty_1;
1246
+ var isCallable$5 = isCallable$g;
1248
1247
  var toObject$1 = toObject$4;
1249
1248
  var sharedKey = sharedKey$3;
1250
1249
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1251
1250
 
1252
1251
  var IE_PROTO = sharedKey('IE_PROTO');
1253
- var $Object = Object;
1254
- var ObjectPrototype = $Object.prototype;
1252
+ var $Object$1 = Object;
1253
+ var ObjectPrototype = $Object$1.prototype;
1255
1254
 
1256
1255
  // `Object.getPrototypeOf` method
1257
1256
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1258
1257
  // eslint-disable-next-line es/no-object-getprototypeof -- safe
1259
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1258
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1260
1259
  var object = toObject$1(O);
1261
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1260
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1262
1261
  var constructor = object.constructor;
1263
- if (isCallable$3(constructor) && object instanceof constructor) {
1262
+ if (isCallable$5(constructor) && object instanceof constructor) {
1264
1263
  return constructor.prototype;
1265
- } return object instanceof $Object ? ObjectPrototype : null;
1264
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1266
1265
  };
1267
1266
 
1268
1267
  var fails$1 = fails$c;
1269
- var isCallable$2 = isCallable$e;
1268
+ var isCallable$4 = isCallable$g;
1270
1269
  var isObject = isObject$6;
1271
1270
  var getPrototypeOf$1 = objectGetPrototypeOf;
1272
1271
  var defineBuiltIn$1 = defineBuiltIn$3;
1273
- var wellKnownSymbol$3 = wellKnownSymbol$6;
1272
+ var wellKnownSymbol$5 = wellKnownSymbol$8;
1274
1273
 
1275
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
1274
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1276
1275
  var BUGGY_SAFARI_ITERATORS$1 = false;
1277
1276
 
1278
1277
  // `%IteratorPrototype%` object
@@ -1300,7 +1299,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1300
1299
 
1301
1300
  // `%IteratorPrototype%[@@iterator]()` method
1302
1301
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1303
- if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
1302
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1304
1303
  defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
1305
1304
  return this;
1306
1305
  });
@@ -1311,16 +1310,16 @@ var iteratorsCore = {
1311
1310
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1312
1311
  };
1313
1312
 
1314
- var defineProperty$1 = objectDefineProperty.f;
1315
- var hasOwn = hasOwnProperty_1;
1316
- var wellKnownSymbol$2 = wellKnownSymbol$6;
1313
+ var defineProperty$2 = objectDefineProperty.f;
1314
+ var hasOwn$1 = hasOwnProperty_1;
1315
+ var wellKnownSymbol$4 = wellKnownSymbol$8;
1317
1316
 
1318
- var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1317
+ var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1319
1318
 
1320
1319
  var setToStringTag$2 = function (target, TAG, STATIC) {
1321
1320
  if (target && !STATIC) target = target.prototype;
1322
- if (target && !hasOwn(target, TO_STRING_TAG$1)) {
1323
- defineProperty$1(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
1321
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1322
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1324
1323
  }
1325
1324
  };
1326
1325
 
@@ -1340,19 +1339,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1340
1339
  return IteratorConstructor;
1341
1340
  };
1342
1341
 
1343
- var isCallable$1 = isCallable$e;
1342
+ var isCallable$3 = isCallable$g;
1344
1343
 
1345
- var $String = String;
1344
+ var $String$1 = String;
1346
1345
  var $TypeError$1 = TypeError;
1347
1346
 
1348
1347
  var aPossiblePrototype$1 = function (argument) {
1349
- if (typeof argument == 'object' || isCallable$1(argument)) return argument;
1350
- throw $TypeError$1("Can't set " + $String(argument) + ' as a prototype');
1348
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1349
+ throw $TypeError$1("Can't set " + $String$1(argument) + ' as a prototype');
1351
1350
  };
1352
1351
 
1353
1352
  /* eslint-disable no-proto -- safe */
1354
1353
 
1355
- var uncurryThis = functionUncurryThis;
1354
+ var uncurryThis$1 = functionUncurryThis;
1356
1355
  var anObject = anObject$5;
1357
1356
  var aPossiblePrototype = aPossiblePrototype$1;
1358
1357
 
@@ -1366,7 +1365,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1366
1365
  var setter;
1367
1366
  try {
1368
1367
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1369
- setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1368
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1370
1369
  setter(test, []);
1371
1370
  CORRECT_SETTER = test instanceof Array;
1372
1371
  } catch (error) { /* empty */ }
@@ -1379,17 +1378,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1379
1378
  };
1380
1379
  }() : undefined);
1381
1380
 
1382
- var $$1 = _export;
1381
+ var $$2 = _export;
1383
1382
  var call = functionCall;
1384
1383
  var FunctionName = functionName;
1385
- var isCallable = isCallable$e;
1384
+ var isCallable$2 = isCallable$g;
1386
1385
  var createIteratorConstructor = iteratorCreateConstructor;
1387
1386
  var getPrototypeOf = objectGetPrototypeOf;
1388
1387
  var setPrototypeOf = objectSetPrototypeOf;
1389
1388
  var setToStringTag = setToStringTag$2;
1390
1389
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1391
1390
  var defineBuiltIn = defineBuiltIn$3;
1392
- var wellKnownSymbol$1 = wellKnownSymbol$6;
1391
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
1393
1392
  var Iterators$1 = iterators;
1394
1393
  var IteratorsCore = iteratorsCore;
1395
1394
 
@@ -1397,7 +1396,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1397
1396
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1398
1397
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1399
1398
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1400
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
1399
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1401
1400
  var KEYS = 'keys';
1402
1401
  var VALUES = 'values';
1403
1402
  var ENTRIES = 'entries';
@@ -1434,7 +1433,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1434
1433
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1435
1434
  if (setPrototypeOf) {
1436
1435
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1437
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1436
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1438
1437
  defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1439
1438
  }
1440
1439
  }
@@ -1464,7 +1463,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1464
1463
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1465
1464
  defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1466
1465
  }
1467
- } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1466
+ } else $$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1468
1467
  }
1469
1468
 
1470
1469
  // define iterator
@@ -1486,10 +1485,10 @@ var toIndexedObject = toIndexedObject$5;
1486
1485
  var addToUnscopables = addToUnscopables$1;
1487
1486
  var Iterators = iterators;
1488
1487
  var InternalStateModule = internalState;
1489
- var defineProperty = objectDefineProperty.f;
1488
+ var defineProperty$1 = objectDefineProperty.f;
1490
1489
  var defineIterator = iteratorDefine;
1491
1490
  var createIterResultObject = createIterResultObject$1;
1492
- var DESCRIPTORS = descriptors;
1491
+ var DESCRIPTORS$1 = descriptors;
1493
1492
 
1494
1493
  var ARRAY_ITERATOR = 'Array Iterator';
1495
1494
  var setInternalState = InternalStateModule.set;
@@ -1539,8 +1538,8 @@ addToUnscopables('values');
1539
1538
  addToUnscopables('entries');
1540
1539
 
1541
1540
  // V8 ~ Chrome 45- bug
1542
- if (DESCRIPTORS && values.name !== 'values') try {
1543
- defineProperty(values, 'name', { value: 'values' });
1541
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1542
+ defineProperty$1(values, 'name', { value: 'values' });
1544
1543
  } catch (error) { /* empty */ }
1545
1544
 
1546
1545
  // iterable DOM collections
@@ -1587,15 +1586,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
1587
1586
 
1588
1587
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1589
1588
 
1590
- var global$2 = global$c;
1589
+ var global$3 = global$d;
1591
1590
  var DOMIterables = domIterables;
1592
1591
  var DOMTokenListPrototype = domTokenListPrototype;
1593
1592
  var ArrayIteratorMethods = es_array_iterator;
1594
1593
  var createNonEnumerableProperty = createNonEnumerableProperty$4;
1595
- var wellKnownSymbol = wellKnownSymbol$6;
1594
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
1596
1595
 
1597
- var ITERATOR = wellKnownSymbol('iterator');
1598
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1596
+ var ITERATOR = wellKnownSymbol$2('iterator');
1597
+ var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1599
1598
  var ArrayValues = ArrayIteratorMethods.values;
1600
1599
 
1601
1600
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
@@ -1606,8 +1605,8 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1606
1605
  } catch (error) {
1607
1606
  CollectionPrototype[ITERATOR] = ArrayValues;
1608
1607
  }
1609
- if (!CollectionPrototype[TO_STRING_TAG]) {
1610
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
1608
+ if (!CollectionPrototype[TO_STRING_TAG$2]) {
1609
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1611
1610
  }
1612
1611
  if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1613
1612
  // some Chrome versions have non-configurable methods on DOMTokenList
@@ -1621,7 +1620,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1621
1620
  };
1622
1621
 
1623
1622
  for (var COLLECTION_NAME in DOMIterables) {
1624
- handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
1623
+ handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
1625
1624
  }
1626
1625
 
1627
1626
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
@@ -1663,6 +1662,159 @@ function __awaiter(thisArg, _arguments, P, generator) {
1663
1662
  });
1664
1663
  }
1665
1664
 
1665
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
1666
+
1667
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1668
+ var test = {};
1669
+
1670
+ test[TO_STRING_TAG$1] = 'z';
1671
+
1672
+ var toStringTagSupport = String(test) === '[object z]';
1673
+
1674
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1675
+ var isCallable$1 = isCallable$g;
1676
+ var classofRaw = classofRaw$1;
1677
+ var wellKnownSymbol = wellKnownSymbol$8;
1678
+
1679
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1680
+ var $Object = Object;
1681
+
1682
+ // ES3 wrong here
1683
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1684
+
1685
+ // fallback for IE11 Script Access Denied error
1686
+ var tryGet = function (it, key) {
1687
+ try {
1688
+ return it[key];
1689
+ } catch (error) { /* empty */ }
1690
+ };
1691
+
1692
+ // getting tag from ES6+ `Object.prototype.toString`
1693
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1694
+ var O, tag, result;
1695
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1696
+ // @@toStringTag case
1697
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1698
+ // builtinTag case
1699
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1700
+ // ES3 arguments fallback
1701
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1702
+ };
1703
+
1704
+ var classof$1 = classof$2;
1705
+
1706
+ var $String = String;
1707
+
1708
+ var toString$1 = function (argument) {
1709
+ if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1710
+ return $String(argument);
1711
+ };
1712
+
1713
+ var $$1 = _export;
1714
+ var DESCRIPTORS = descriptors;
1715
+ var global$2 = global$d;
1716
+ var uncurryThis = functionUncurryThis;
1717
+ var hasOwn = hasOwnProperty_1;
1718
+ var isCallable = isCallable$g;
1719
+ var isPrototypeOf = objectIsPrototypeOf;
1720
+ var toString = toString$1;
1721
+ var defineProperty = objectDefineProperty.f;
1722
+ var copyConstructorProperties = copyConstructorProperties$2;
1723
+
1724
+ var NativeSymbol = global$2.Symbol;
1725
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1726
+
1727
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
1728
+ // Safari 12 bug
1729
+ NativeSymbol().description !== undefined
1730
+ )) {
1731
+ var EmptyStringDescriptionStore = {};
1732
+ // wrap Symbol constructor for correct work with undefined description
1733
+ var SymbolWrapper = function Symbol() {
1734
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
1735
+ var result = isPrototypeOf(SymbolPrototype, this)
1736
+ ? new NativeSymbol(description)
1737
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1738
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
1739
+ if (description === '') EmptyStringDescriptionStore[result] = true;
1740
+ return result;
1741
+ };
1742
+
1743
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
1744
+ SymbolWrapper.prototype = SymbolPrototype;
1745
+ SymbolPrototype.constructor = SymbolWrapper;
1746
+
1747
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1748
+ var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
1749
+ var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
1750
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
1751
+ var replace = uncurryThis(''.replace);
1752
+ var stringSlice = uncurryThis(''.slice);
1753
+
1754
+ defineProperty(SymbolPrototype, 'description', {
1755
+ configurable: true,
1756
+ get: function description() {
1757
+ var symbol = thisSymbolValue(this);
1758
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
1759
+ var string = symbolDescriptiveString(symbol);
1760
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
1761
+ return desc === '' ? undefined : desc;
1762
+ }
1763
+ });
1764
+
1765
+ $$1({ global: true, constructor: true, forced: true }, {
1766
+ Symbol: SymbolWrapper
1767
+ });
1768
+ }
1769
+
1770
+ const useNinetailed = () => {
1771
+ const ninetailed = React.useContext(NinetailedContext);
1772
+ if (ninetailed === undefined) {
1773
+ throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
1774
+ }
1775
+ return ninetailed;
1776
+ };
1777
+
1778
+ const TrackExperience = ({
1779
+ children,
1780
+ experience,
1781
+ variant,
1782
+ profile
1783
+ }) => {
1784
+ const ninetailed = useNinetailed();
1785
+ const {
1786
+ ref,
1787
+ inView
1788
+ } = reactIntersectionObserver.useInView({
1789
+ triggerOnce: true
1790
+ });
1791
+ React.useEffect(() => {
1792
+ if (experience_jsShared.isBrowser() && inView) {
1793
+ const distribution = experience_js.selectDistribution({
1794
+ experience,
1795
+ profile
1796
+ });
1797
+ ninetailed.trackHasSeenExperience({
1798
+ experience: {
1799
+ id: experience.id,
1800
+ type: experience.type,
1801
+ name: experience.name || '',
1802
+ description: experience.description || ''
1803
+ },
1804
+ audience: experience.audience,
1805
+ selectedVariant: variant,
1806
+ selectedVariantIndex: distribution.index
1807
+ });
1808
+ }
1809
+ }, [inView]);
1810
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1811
+ children: [jsxRuntime.jsx("div", {
1812
+ ref: ref,
1813
+ id: "nt-experience-handle"
1814
+ }), children]
1815
+ });
1816
+ };
1817
+
1666
1818
  var aCallable = aCallable$2;
1667
1819
  var toObject = toObject$4;
1668
1820
  var IndexedObject = indexedObject;
@@ -1716,8 +1868,8 @@ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1716
1868
  });
1717
1869
  };
1718
1870
 
1719
- var classof = classofRaw;
1720
- var global$1 = global$c;
1871
+ var classof = classofRaw$1;
1872
+ var global$1 = global$d;
1721
1873
 
1722
1874
  var engineIsNode = classof(global$1.process) == 'process';
1723
1875
 
@@ -1741,14 +1893,6 @@ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
1741
1893
  }
1742
1894
  });
1743
1895
 
1744
- const useNinetailed = () => {
1745
- const ninetailed = React.useContext(NinetailedContext);
1746
- if (ninetailed === undefined) {
1747
- throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
1748
- }
1749
- return ninetailed;
1750
- };
1751
-
1752
1896
  const useProfile = () => {
1753
1897
  const ninetailed = useNinetailed();
1754
1898
  const [profileState, setProfileState] = React.useState(ninetailed.profileState);
@@ -1785,23 +1929,6 @@ const useProfile = () => {
1785
1929
  });
1786
1930
  };
1787
1931
 
1788
- const ExperimentsContext = /*#__PURE__*/React.createContext(undefined);
1789
-
1790
- const useExperimentsContext = () => {
1791
- const context = React.useContext(ExperimentsContext);
1792
- if (context === undefined) {
1793
- throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
1794
- }
1795
- return context;
1796
- };
1797
-
1798
- const useExperiments = () => {
1799
- const context = useExperimentsContext();
1800
- return {
1801
- experiments: context.experiments
1802
- };
1803
- };
1804
-
1805
1932
  const useExperienceSelectionMiddleware = ({
1806
1933
  experiences,
1807
1934
  baseline,
@@ -1836,9 +1963,6 @@ const useExperience = ({
1836
1963
  experiences
1837
1964
  }) => {
1838
1965
  const profileState = useProfile();
1839
- const {
1840
- experiments
1841
- } = useExperiments();
1842
1966
  const hasVariants = experiences.map(experience => experience_js.selectHasExperienceVariants(experience, baseline)).reduce((acc, curr) => acc || curr, false);
1843
1967
  const {
1844
1968
  status,
@@ -1852,26 +1976,21 @@ const useExperience = ({
1852
1976
  const overrideResult = _a => {
1853
1977
  var {
1854
1978
  experience: originalExperience,
1855
- variant: originalVariant,
1856
- variantIndex: originalVariantIndex
1979
+ variant: originalVariant
1857
1980
  } = _a,
1858
- other = __rest(_a, ["experience", "variant", "variantIndex"]);
1981
+ other = __rest(_a, ["experience", "variant"]);
1859
1982
  const {
1860
1983
  experience,
1861
- variant,
1862
- variantIndex
1984
+ variant
1863
1985
  } = experienceSelectionMiddleware({
1864
1986
  experience: originalExperience,
1865
- variant: originalVariant,
1866
- variantIndex: originalVariantIndex
1987
+ variant: originalVariant
1867
1988
  });
1868
1989
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1869
1990
  // @ts-ignore
1870
1991
  return Object.assign(Object.assign({}, other), {
1871
- audience: (experience === null || experience === void 0 ? void 0 : experience.audience) ? experience.audience : null,
1872
1992
  experience,
1873
- variant,
1874
- variantIndex
1993
+ variant
1875
1994
  });
1876
1995
  };
1877
1996
  const baseReturn = Object.assign(Object.assign({}, profileState), {
@@ -1880,8 +1999,7 @@ const useExperience = ({
1880
1999
  });
1881
2000
  const emptyReturn = Object.assign(Object.assign({}, baseReturn), {
1882
2001
  experience: null,
1883
- variant: baseline,
1884
- variantIndex: 0,
2002
+ variant: null,
1885
2003
  audience: null,
1886
2004
  isPersonalized: false,
1887
2005
  profile: null
@@ -1901,7 +2019,7 @@ const useExperience = ({
1901
2019
  // @ts-ignore
1902
2020
  return overrideResult(emptyReturn);
1903
2021
  }
1904
- const activeExperiments = experience_js.selectActiveExperiments(experiments, profile);
2022
+ const activeExperiments = experience_js.selectActiveExperiments(experiences, profile);
1905
2023
  const experience = experience_js.selectExperience({
1906
2024
  experiences,
1907
2025
  activeExperiments,
@@ -1914,62 +2032,36 @@ const useExperience = ({
1914
2032
  profile
1915
2033
  }));
1916
2034
  }
1917
- const {
1918
- variant,
1919
- index
1920
- } = experience_js.selectExperienceVariant({
2035
+ const audience = experience.audience;
2036
+ const variant = experience_js.selectExperienceVariant({
1921
2037
  baseline,
1922
2038
  experience,
1923
2039
  profile
1924
2040
  });
2041
+ if (!variant) {
2042
+ return overrideResult(Object.assign(Object.assign({}, baseReturn), {
2043
+ status: 'success',
2044
+ loading: false,
2045
+ error: null,
2046
+ experience,
2047
+ variant: null,
2048
+ audience: audience ? audience : null,
2049
+ profile,
2050
+ isPersonalized: false
2051
+ }));
2052
+ }
1925
2053
  return overrideResult(Object.assign(Object.assign({}, baseReturn), {
1926
2054
  status: 'success',
1927
2055
  loading: false,
1928
2056
  error: null,
1929
2057
  experience,
1930
2058
  variant,
1931
- variantIndex: index,
1932
- audience: experience.audience ? experience.audience : null,
2059
+ audience: audience ? audience : null,
1933
2060
  profile,
1934
2061
  isPersonalized: true
1935
2062
  }));
1936
2063
  };
1937
2064
 
1938
- const useJoinExperiment = () => {
1939
- const context = useExperimentsContext();
1940
- return context.joinExperiment;
1941
- };
1942
-
1943
- const ComponentMarker = /*#__PURE__*/React.forwardRef((_, ref) => {
1944
- const {
1945
- logger
1946
- } = useNinetailed();
1947
- const markerRef = React.useRef(null);
1948
- React.useEffect(() => {
1949
- // TODO: Create a better message
1950
- logger.debug('Using fallback mechanism to select component.');
1951
- }, [logger]);
1952
- React.useEffect(() => {
1953
- if (markerRef.current) {
1954
- const nextSibling = markerRef.current.nextSibling;
1955
- if (ref) {
1956
- if (typeof ref === 'function') {
1957
- ref(nextSibling);
1958
- } else {
1959
- ref.current = nextSibling;
1960
- }
1961
- }
1962
- }
1963
- }, []);
1964
- return jsxRuntime.jsx("div", {
1965
- className: "nt-cmp-marker",
1966
- style: {
1967
- display: 'none !important'
1968
- },
1969
- ref: markerRef
1970
- });
1971
- });
1972
-
1973
2065
  const DefaultExperienceLoadingComponent = _a => {
1974
2066
  var {
1975
2067
  component: Component,
@@ -2023,17 +2115,12 @@ const Experience = _a => {
2023
2115
  passthroughProps
2024
2116
  } = _a,
2025
2117
  baseline = __rest(_a, ["experiences", "component", "loadingComponent", "passthroughProps"]);
2026
- const {
2027
- observeElement,
2028
- unobserveElement
2029
- } = useNinetailed();
2030
2118
  // TODO we actually could hook into the experience hook here with the plugins
2031
2119
  const {
2032
2120
  status,
2033
2121
  hasVariants,
2034
2122
  experience,
2035
2123
  variant,
2036
- variantIndex,
2037
2124
  audience,
2038
2125
  isPersonalized,
2039
2126
  profile
@@ -2041,47 +2128,30 @@ const Experience = _a => {
2041
2128
  baseline,
2042
2129
  experiences
2043
2130
  });
2044
- const joinExperiment = useJoinExperiment();
2045
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2046
- // @ts-ignore
2047
- const isComponentForwardRef = reactIs.isForwardRef(jsxRuntime.jsx(Component, {}));
2048
- const componentRef = React.useRef(null);
2049
- React.useEffect(() => {
2050
- if (status === 'success' && experience && profile) {
2051
- joinExperiment({
2052
- experiences,
2053
- experiment: experience,
2054
- profile
2055
- });
2056
- }
2057
- }, [status, experience, profile]);
2058
- React.useEffect(() => {
2059
- const componentElement = componentRef.current;
2060
- if (componentElement) {
2061
- observeElement({
2062
- element: componentElement,
2063
- experience,
2064
- audience,
2065
- variant,
2066
- variantIndex
2067
- });
2068
- }
2069
- return () => {
2070
- if (componentElement) {
2071
- unobserveElement(componentElement);
2072
- }
2073
- };
2074
- }, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience]);
2131
+ // const joinExperiment = useJoinExperiment();
2132
+ // useEffect(() => {
2133
+ // if (
2134
+ // status === 'success' &&
2135
+ // experience &&
2136
+ // experience.type === 'nt_experiment' &&
2137
+ // variant &&
2138
+ // profile
2139
+ // ) {
2140
+ // joinExperiment({
2141
+ // experiences,
2142
+ // experiment: experience,
2143
+ // variant: {
2144
+ // ...variant,
2145
+ // hidden: 'hidden' in variant ? variant.hidden : false,
2146
+ // },
2147
+ // profile,
2148
+ // });
2149
+ // }
2150
+ // }, [status, experience, variant, profile]);
2075
2151
  if (!hasVariants) {
2076
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
2077
- children: [!isComponentForwardRef && jsxRuntime.jsx(ComponentMarker, {
2078
- ref: componentRef
2079
- }, `marker-no-variants-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`), /*#__PURE__*/React.createElement(Component, Object.assign({}, passthroughProps, baseline, {
2080
- key: baseline.id
2081
- }, isComponentForwardRef ? {
2082
- ref: componentRef
2083
- } : {}))]
2084
- });
2152
+ return /*#__PURE__*/React.createElement(Component, Object.assign({}, passthroughProps, baseline, {
2153
+ key: baseline.id
2154
+ }));
2085
2155
  }
2086
2156
  if (status === 'loading') {
2087
2157
  return /*#__PURE__*/React.createElement(LoadingComponent, Object.assign({}, baseline, {
@@ -2091,27 +2161,50 @@ const Experience = _a => {
2091
2161
  component: Component
2092
2162
  }));
2093
2163
  }
2094
- const isVariantHidden = 'hidden' in variant && variant.hidden;
2095
- if (isVariantHidden) {
2096
- return jsxRuntime.jsx(ComponentMarker, {
2097
- ref: componentRef
2098
- }, `marker-hidden-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`);
2164
+ if (!experience) {
2165
+ return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
2166
+ ninetailed: {
2167
+ isPersonalized: false,
2168
+ audience: {
2169
+ id: 'baseline'
2170
+ }
2171
+ }
2172
+ }));
2099
2173
  }
2100
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
2101
- children: [!isComponentForwardRef && jsxRuntime.jsx(ComponentMarker, {
2102
- ref: componentRef
2103
- }, `marker-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`), /*#__PURE__*/React.createElement(Component, Object.assign({}, Object.assign(Object.assign({}, passthroughProps), variant), {
2104
- key: `${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`,
2174
+ if (!variant) {
2175
+ return jsxRuntime.jsx(TrackExperience, Object.assign({
2176
+ experience: experience,
2177
+ variant: baseline,
2178
+ // the profile is definitely defined, otherwise there wouldn't be an experience selected
2179
+ profile: profile
2180
+ }, {
2181
+ children: jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
2182
+ ninetailed: {
2183
+ isPersonalized: false,
2184
+ audience: {
2185
+ id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2186
+ }
2187
+ }
2188
+ }))
2189
+ }), baseline.id);
2190
+ }
2191
+ const isVariantHidden = 'hidden' in variant && variant.hidden;
2192
+ return jsxRuntime.jsx(TrackExperience, Object.assign({
2193
+ experience: experience,
2194
+ variant: variant,
2195
+ // the profile is definitely defined, otherwise there wouldn't be an experience selected
2196
+ profile: profile
2197
+ }, {
2198
+ children: !isVariantHidden ? /*#__PURE__*/React.createElement(Component, Object.assign({}, Object.assign(Object.assign({}, passthroughProps), variant), {
2199
+ key: `${experience.id}-${variant.id}`,
2105
2200
  ninetailed: {
2106
2201
  isPersonalized,
2107
2202
  audience: {
2108
2203
  id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2109
2204
  }
2110
2205
  }
2111
- }, isComponentForwardRef ? {
2112
- ref: componentRef
2113
- } : {}))]
2114
- });
2206
+ })) : null
2207
+ }));
2115
2208
  };
2116
2209
 
2117
2210
  const ESRContext = /*#__PURE__*/React__default["default"].createContext(undefined);
@@ -2199,6 +2292,8 @@ const ESRLoadingComponent = _a => {
2199
2292
  }));
2200
2293
  };
2201
2294
 
2295
+ const ExperimentsContext = /*#__PURE__*/React.createContext(undefined);
2296
+
2202
2297
  const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
2203
2298
 
2204
2299
  const debounce = (fn, wait) => {
@@ -2214,15 +2309,13 @@ const debounce = (fn, wait) => {
2214
2309
  debouncedFn();
2215
2310
  };
2216
2311
  };
2217
- const useProvideJoinExperiment = ({
2218
- experiments,
2219
- maximumActiveExperiments: _maximumActiveExperiments = 1
2220
- }) => {
2312
+ // TODO: the majority of this code should be moved to the experience.js javascript package
2313
+ const useProvideJoinExperiment = _ => {
2221
2314
  const {
2222
2315
  identify
2223
2316
  } = useNinetailed();
2224
2317
  const joinExperimentIdentify = debounce(args => {
2225
- const traits = args.slice(0, _maximumActiveExperiments).reduce((traits, [experimentJoinTraits]) => {
2318
+ const traits = args.reduce((traits, [experimentJoinTraits]) => {
2226
2319
  return Object.assign(Object.assign({}, experimentJoinTraits), traits);
2227
2320
  }, {});
2228
2321
  identify('', traits);
@@ -2230,6 +2323,7 @@ const useProvideJoinExperiment = ({
2230
2323
  return React.useCallback(data => __awaiter(void 0, void 0, void 0, function* () {
2231
2324
  const {
2232
2325
  experiment,
2326
+ variant,
2233
2327
  profile
2234
2328
  } = data;
2235
2329
  const isExperiment = experiment.type === 'nt_experiment';
@@ -2237,17 +2331,17 @@ const useProvideJoinExperiment = ({
2237
2331
  experience_jsShared.logger.warn(`The experience ${experiment.id}, which you tried to join, is not an experiment.`);
2238
2332
  return;
2239
2333
  }
2240
- const activeExperiments = experience_js.selectActiveExperiments(experiments, profile);
2241
- if (activeExperiments.length >= _maximumActiveExperiments) {
2242
- experience_jsShared.logger.warn(`The maximum number of active experiments (${_maximumActiveExperiments}) has been reached.`);
2334
+ if (!experience_jsShared.isExperienceSticky(experiment)) {
2335
+ experience_jsShared.logger.debug("Won't add experiment to traits, as it's not sticky.");
2243
2336
  return;
2244
2337
  }
2245
- if (activeExperiments.some(activeExperiment => activeExperiment.id === experiment.id)) {
2338
+ const activeExperimentIds = experience_jsShared.selectActiveExperimentIds(profile);
2339
+ if (activeExperimentIds.some(activeExperimentId => activeExperimentId === experiment.id)) {
2246
2340
  experience_jsShared.logger.debug(`The user is already part of experiment ${experiment.id}. Won't join again.`);
2247
2341
  return;
2248
2342
  }
2249
2343
  joinExperimentIdentify({
2250
- [`${EXPERIENCE_TRAIT_PREFIX}${experiment.id}`]: true
2344
+ [`${EXPERIENCE_TRAIT_PREFIX}${experiment.id}`]: variant.hidden ? 'hidden' : variant.id
2251
2345
  });
2252
2346
  experience_jsShared.logger.debug(`Sent event to join experiment ${experiment.id}.`);
2253
2347
  }), []);
@@ -2258,10 +2352,7 @@ const ExperimentsProvider = ({
2258
2352
  maximumActiveExperiments: _maximumActiveExperiments = 1,
2259
2353
  children
2260
2354
  }) => {
2261
- const joinExperiment = useProvideJoinExperiment({
2262
- experiments,
2263
- maximumActiveExperiments: _maximumActiveExperiments
2264
- });
2355
+ const joinExperiment = useProvideJoinExperiment();
2265
2356
  return jsxRuntime.jsx(ExperimentsContext.Provider, Object.assign({
2266
2357
  value: {
2267
2358
  experiments,
@@ -2272,42 +2363,71 @@ const ExperimentsProvider = ({
2272
2363
  }));
2273
2364
  };
2274
2365
 
2275
- const NinetailedProvider = ({
2276
- children,
2277
- clientId,
2278
- experiments: _experiments = [],
2279
- maximumActiveExperiments,
2280
- environment,
2281
- preview,
2282
- url,
2283
- profile,
2284
- locale,
2285
- requestTimeout,
2286
- plugins: _plugins = [],
2287
- onLog,
2288
- onError,
2289
- componentViewTrackingThreshold
2290
- }) => {
2291
- const ninetailed = React.useMemo(() => new experience_js.Ninetailed({
2292
- clientId,
2293
- environment,
2294
- preview
2295
- }, {
2296
- url,
2297
- plugins: _plugins,
2298
- profile,
2299
- locale,
2300
- requestTimeout,
2301
- onLog,
2302
- onError,
2303
- componentViewTrackingThreshold
2304
- }), []);
2366
+ const useExperimentsContext = () => {
2367
+ const context = React.useContext(ExperimentsContext);
2368
+ if (context === undefined) {
2369
+ throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
2370
+ }
2371
+ return context;
2372
+ };
2373
+
2374
+ /**
2375
+ * @deprecated
2376
+ *
2377
+ * This will get removed in v5 of the SDK.
2378
+ */
2379
+ const useExperiments = () => {
2380
+ const context = useExperimentsContext();
2381
+ return {
2382
+ experiments: context.experiments
2383
+ };
2384
+ };
2385
+
2386
+ const useJoinExperiment = () => {
2387
+ const context = useExperimentsContext();
2388
+ return context.joinExperiment;
2389
+ };
2390
+
2391
+ const NinetailedProvider = props => {
2392
+ const ninetailed = React.useMemo(() => {
2393
+ if ('ninetailed' in props) {
2394
+ return props.ninetailed;
2395
+ }
2396
+ const {
2397
+ clientId,
2398
+ environment,
2399
+ preview,
2400
+ url,
2401
+ profile,
2402
+ locale,
2403
+ requestTimeout,
2404
+ plugins = [],
2405
+ onLog,
2406
+ onError
2407
+ } = props;
2408
+ return new experience_js.Ninetailed({
2409
+ clientId,
2410
+ environment,
2411
+ preview
2412
+ }, {
2413
+ url,
2414
+ plugins,
2415
+ profile,
2416
+ locale,
2417
+ requestTimeout,
2418
+ onLog,
2419
+ onError
2420
+ });
2421
+ }, []);
2422
+ const {
2423
+ children
2424
+ } = props;
2305
2425
  return jsxRuntime.jsx(NinetailedContext.Provider, Object.assign({
2306
2426
  value: ninetailed
2307
2427
  }, {
2308
2428
  children: jsxRuntime.jsx(ExperimentsProvider, Object.assign({
2309
- experiments: _experiments,
2310
- maximumActiveExperiments: maximumActiveExperiments
2429
+ experiments: [],
2430
+ maximumActiveExperiments: 10000
2311
2431
  }, {
2312
2432
  children: children
2313
2433
  }))
@@ -2447,6 +2567,7 @@ exports.ExperimentsProvider = ExperimentsProvider;
2447
2567
  exports.MergeTag = MergeTag;
2448
2568
  exports.NinetailedProvider = NinetailedProvider;
2449
2569
  exports.Personalize = Personalize;
2570
+ exports.TrackExperience = TrackExperience;
2450
2571
  exports.TrackHasSeenComponent = TrackHasSeenComponent;
2451
2572
  exports.useExperience = useExperience;
2452
2573
  exports.useExperiments = useExperiments;