@ninetailed/experience.js-react 1.0.0-beta.6

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.esm.js ADDED
@@ -0,0 +1,1708 @@
1
+ import React, { createContext, useMemo, useContext, useState, useEffect, useCallback, useRef } from 'react';
2
+ import { Ninetailed, selectVariant } from '@ninetailed/experience.js';
3
+ import VisibilitySensor from 'react-visibility-sensor';
4
+
5
+ const NinetailedContext = /*#__PURE__*/createContext(undefined);
6
+
7
+ const NinetailedProvider = ({
8
+ children,
9
+ clientId,
10
+ environment,
11
+ url,
12
+ profile,
13
+ locale,
14
+ plugins: _plugins = []
15
+ }) => {
16
+ const ninetailed = useMemo(() => new Ninetailed({
17
+ clientId,
18
+ environment
19
+ }, {
20
+ url,
21
+ plugins: _plugins,
22
+ profile,
23
+ locale
24
+ }), []);
25
+ return /*#__PURE__*/React.createElement(NinetailedContext.Provider, {
26
+ value: ninetailed
27
+ }, children);
28
+ };
29
+
30
+ const useNinetailed = () => {
31
+ const ninetailed = useContext(NinetailedContext);
32
+
33
+ if (ninetailed === undefined) {
34
+ throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
35
+ }
36
+
37
+ return ninetailed;
38
+ };
39
+
40
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
41
+
42
+ var check = function (it) {
43
+ return it && it.Math == Math && it;
44
+ };
45
+
46
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
47
+ var global$o =
48
+ // eslint-disable-next-line es/no-global-this -- safe
49
+ check(typeof globalThis == 'object' && globalThis) ||
50
+ check(typeof window == 'object' && window) ||
51
+ // eslint-disable-next-line no-restricted-globals -- safe
52
+ check(typeof self == 'object' && self) ||
53
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
54
+ // eslint-disable-next-line no-new-func -- fallback
55
+ (function () { return this; })() || Function('return this')();
56
+
57
+ var fails$a = function (exec) {
58
+ try {
59
+ return !!exec();
60
+ } catch (error) {
61
+ return true;
62
+ }
63
+ };
64
+
65
+ var fails$9 = fails$a;
66
+
67
+ var functionBindNative = !fails$9(function () {
68
+ var test = (function () { /* empty */ }).bind();
69
+ // eslint-disable-next-line no-prototype-builtins -- safe
70
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
71
+ });
72
+
73
+ var NATIVE_BIND$1 = functionBindNative;
74
+
75
+ var FunctionPrototype$1 = Function.prototype;
76
+ var bind = FunctionPrototype$1.bind;
77
+ var call$6 = FunctionPrototype$1.call;
78
+ var uncurryThis$b = NATIVE_BIND$1 && bind.bind(call$6, call$6);
79
+
80
+ var functionUncurryThis = NATIVE_BIND$1 ? function (fn) {
81
+ return fn && uncurryThis$b(fn);
82
+ } : function (fn) {
83
+ return fn && function () {
84
+ return call$6.apply(fn, arguments);
85
+ };
86
+ };
87
+
88
+ var uncurryThis$a = functionUncurryThis;
89
+
90
+ var toString$1 = uncurryThis$a({}.toString);
91
+ var stringSlice = uncurryThis$a(''.slice);
92
+
93
+ var classofRaw = function (it) {
94
+ return stringSlice(toString$1(it), 8, -1);
95
+ };
96
+
97
+ var global$n = global$o;
98
+ var uncurryThis$9 = functionUncurryThis;
99
+ var fails$8 = fails$a;
100
+ var classof = classofRaw;
101
+
102
+ var Object$4 = global$n.Object;
103
+ var split = uncurryThis$9(''.split);
104
+
105
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
106
+ var indexedObject = fails$8(function () {
107
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
108
+ // eslint-disable-next-line no-prototype-builtins -- safe
109
+ return !Object$4('z').propertyIsEnumerable(0);
110
+ }) ? function (it) {
111
+ return classof(it) == 'String' ? split(it, '') : Object$4(it);
112
+ } : Object$4;
113
+
114
+ var global$m = global$o;
115
+
116
+ var TypeError$7 = global$m.TypeError;
117
+
118
+ // `RequireObjectCoercible` abstract operation
119
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
120
+ var requireObjectCoercible$2 = function (it) {
121
+ if (it == undefined) throw TypeError$7("Can't call method on " + it);
122
+ return it;
123
+ };
124
+
125
+ // toObject with fallback for non-array-like ES3 strings
126
+ var IndexedObject$1 = indexedObject;
127
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
128
+
129
+ var toIndexedObject$5 = function (it) {
130
+ return IndexedObject$1(requireObjectCoercible$1(it));
131
+ };
132
+
133
+ var shared$3 = {exports: {}};
134
+
135
+ var global$l = global$o;
136
+
137
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
138
+ var defineProperty$3 = Object.defineProperty;
139
+
140
+ var setGlobal$3 = function (key, value) {
141
+ try {
142
+ defineProperty$3(global$l, key, { value: value, configurable: true, writable: true });
143
+ } catch (error) {
144
+ global$l[key] = value;
145
+ } return value;
146
+ };
147
+
148
+ var global$k = global$o;
149
+ var setGlobal$2 = setGlobal$3;
150
+
151
+ var SHARED = '__core-js_shared__';
152
+ var store$3 = global$k[SHARED] || setGlobal$2(SHARED, {});
153
+
154
+ var sharedStore = store$3;
155
+
156
+ var store$2 = sharedStore;
157
+
158
+ (shared$3.exports = function (key, value) {
159
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
160
+ })('versions', []).push({
161
+ version: '3.21.1',
162
+ mode: 'global',
163
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
164
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
165
+ source: 'https://github.com/zloirock/core-js'
166
+ });
167
+
168
+ var global$j = global$o;
169
+ var requireObjectCoercible = requireObjectCoercible$2;
170
+
171
+ var Object$3 = global$j.Object;
172
+
173
+ // `ToObject` abstract operation
174
+ // https://tc39.es/ecma262/#sec-toobject
175
+ var toObject$3 = function (argument) {
176
+ return Object$3(requireObjectCoercible(argument));
177
+ };
178
+
179
+ var uncurryThis$8 = functionUncurryThis;
180
+ var toObject$2 = toObject$3;
181
+
182
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
183
+
184
+ // `HasOwnProperty` abstract operation
185
+ // https://tc39.es/ecma262/#sec-hasownproperty
186
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
187
+ return hasOwnProperty(toObject$2(it), key);
188
+ };
189
+
190
+ var uncurryThis$7 = functionUncurryThis;
191
+
192
+ var id = 0;
193
+ var postfix = Math.random();
194
+ var toString = uncurryThis$7(1.0.toString);
195
+
196
+ var uid$2 = function (key) {
197
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
198
+ };
199
+
200
+ // `IsCallable` abstract operation
201
+ // https://tc39.es/ecma262/#sec-iscallable
202
+ var isCallable$d = function (argument) {
203
+ return typeof argument == 'function';
204
+ };
205
+
206
+ var global$i = global$o;
207
+ var isCallable$c = isCallable$d;
208
+
209
+ var aFunction = function (argument) {
210
+ return isCallable$c(argument) ? argument : undefined;
211
+ };
212
+
213
+ var getBuiltIn$4 = function (namespace, method) {
214
+ return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
215
+ };
216
+
217
+ var getBuiltIn$3 = getBuiltIn$4;
218
+
219
+ var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
220
+
221
+ var global$h = global$o;
222
+ var userAgent = engineUserAgent;
223
+
224
+ var process = global$h.process;
225
+ var Deno = global$h.Deno;
226
+ var versions = process && process.versions || Deno && Deno.version;
227
+ var v8 = versions && versions.v8;
228
+ var match, version;
229
+
230
+ if (v8) {
231
+ match = v8.split('.');
232
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
233
+ // but their correct versions are not interesting for us
234
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
235
+ }
236
+
237
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
238
+ // so check `userAgent` even if `.v8` exists, but 0
239
+ if (!version && userAgent) {
240
+ match = userAgent.match(/Edge\/(\d+)/);
241
+ if (!match || match[1] >= 74) {
242
+ match = userAgent.match(/Chrome\/(\d+)/);
243
+ if (match) version = +match[1];
244
+ }
245
+ }
246
+
247
+ var engineV8Version = version;
248
+
249
+ /* eslint-disable es/no-symbol -- required for testing */
250
+
251
+ var V8_VERSION = engineV8Version;
252
+ var fails$7 = fails$a;
253
+
254
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
255
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$7(function () {
256
+ var symbol = Symbol();
257
+ // Chrome 38 Symbol has incorrect toString conversion
258
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
259
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
260
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
261
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
262
+ });
263
+
264
+ /* eslint-disable es/no-symbol -- required for testing */
265
+
266
+ var NATIVE_SYMBOL$1 = nativeSymbol;
267
+
268
+ var useSymbolAsUid = NATIVE_SYMBOL$1
269
+ && !Symbol.sham
270
+ && typeof Symbol.iterator == 'symbol';
271
+
272
+ var global$g = global$o;
273
+ var shared$2 = shared$3.exports;
274
+ var hasOwn$8 = hasOwnProperty_1;
275
+ var uid$1 = uid$2;
276
+ var NATIVE_SYMBOL = nativeSymbol;
277
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
278
+
279
+ var WellKnownSymbolsStore = shared$2('wks');
280
+ var Symbol$1 = global$g.Symbol;
281
+ var symbolFor = Symbol$1 && Symbol$1['for'];
282
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
283
+
284
+ var wellKnownSymbol$6 = function (name) {
285
+ if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
286
+ var description = 'Symbol.' + name;
287
+ if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
288
+ WellKnownSymbolsStore[name] = Symbol$1[name];
289
+ } else if (USE_SYMBOL_AS_UID$1 && symbolFor) {
290
+ WellKnownSymbolsStore[name] = symbolFor(description);
291
+ } else {
292
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
293
+ }
294
+ } return WellKnownSymbolsStore[name];
295
+ };
296
+
297
+ var isCallable$b = isCallable$d;
298
+
299
+ var isObject$5 = function (it) {
300
+ return typeof it == 'object' ? it !== null : isCallable$b(it);
301
+ };
302
+
303
+ var global$f = global$o;
304
+ var isObject$4 = isObject$5;
305
+
306
+ var String$3 = global$f.String;
307
+ var TypeError$6 = global$f.TypeError;
308
+
309
+ // `Assert: Type(argument) is Object`
310
+ var anObject$5 = function (argument) {
311
+ if (isObject$4(argument)) return argument;
312
+ throw TypeError$6(String$3(argument) + ' is not an object');
313
+ };
314
+
315
+ var objectDefineProperties = {};
316
+
317
+ var fails$6 = fails$a;
318
+
319
+ // Detect IE8's incomplete defineProperty implementation
320
+ var descriptors = !fails$6(function () {
321
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
322
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
323
+ });
324
+
325
+ var DESCRIPTORS$8 = descriptors;
326
+ var fails$5 = fails$a;
327
+
328
+ // V8 ~ Chrome 36-
329
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
330
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$5(function () {
331
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
332
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
333
+ value: 42,
334
+ writable: false
335
+ }).prototype != 42;
336
+ });
337
+
338
+ var objectDefineProperty = {};
339
+
340
+ var global$e = global$o;
341
+ var isObject$3 = isObject$5;
342
+
343
+ var document$1 = global$e.document;
344
+ // typeof document.createElement is 'object' in old IE
345
+ var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
346
+
347
+ var documentCreateElement$2 = function (it) {
348
+ return EXISTS$1 ? document$1.createElement(it) : {};
349
+ };
350
+
351
+ var DESCRIPTORS$7 = descriptors;
352
+ var fails$4 = fails$a;
353
+ var createElement = documentCreateElement$2;
354
+
355
+ // Thanks to IE8 for its funny defineProperty
356
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
357
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
358
+ return Object.defineProperty(createElement('div'), 'a', {
359
+ get: function () { return 7; }
360
+ }).a != 7;
361
+ });
362
+
363
+ var NATIVE_BIND = functionBindNative;
364
+
365
+ var call$5 = Function.prototype.call;
366
+
367
+ var functionCall = NATIVE_BIND ? call$5.bind(call$5) : function () {
368
+ return call$5.apply(call$5, arguments);
369
+ };
370
+
371
+ var uncurryThis$6 = functionUncurryThis;
372
+
373
+ var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
374
+
375
+ var global$d = global$o;
376
+ var getBuiltIn$2 = getBuiltIn$4;
377
+ var isCallable$a = isCallable$d;
378
+ var isPrototypeOf = objectIsPrototypeOf;
379
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
380
+
381
+ var Object$2 = global$d.Object;
382
+
383
+ var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
384
+ return typeof it == 'symbol';
385
+ } : function (it) {
386
+ var $Symbol = getBuiltIn$2('Symbol');
387
+ return isCallable$a($Symbol) && isPrototypeOf($Symbol.prototype, Object$2(it));
388
+ };
389
+
390
+ var global$c = global$o;
391
+
392
+ var String$2 = global$c.String;
393
+
394
+ var tryToString$1 = function (argument) {
395
+ try {
396
+ return String$2(argument);
397
+ } catch (error) {
398
+ return 'Object';
399
+ }
400
+ };
401
+
402
+ var global$b = global$o;
403
+ var isCallable$9 = isCallable$d;
404
+ var tryToString = tryToString$1;
405
+
406
+ var TypeError$5 = global$b.TypeError;
407
+
408
+ // `Assert: IsCallable(argument) is true`
409
+ var aCallable$1 = function (argument) {
410
+ if (isCallable$9(argument)) return argument;
411
+ throw TypeError$5(tryToString(argument) + ' is not a function');
412
+ };
413
+
414
+ var aCallable = aCallable$1;
415
+
416
+ // `GetMethod` abstract operation
417
+ // https://tc39.es/ecma262/#sec-getmethod
418
+ var getMethod$1 = function (V, P) {
419
+ var func = V[P];
420
+ return func == null ? undefined : aCallable(func);
421
+ };
422
+
423
+ var global$a = global$o;
424
+ var call$4 = functionCall;
425
+ var isCallable$8 = isCallable$d;
426
+ var isObject$2 = isObject$5;
427
+
428
+ var TypeError$4 = global$a.TypeError;
429
+
430
+ // `OrdinaryToPrimitive` abstract operation
431
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
432
+ var ordinaryToPrimitive$1 = function (input, pref) {
433
+ var fn, val;
434
+ if (pref === 'string' && isCallable$8(fn = input.toString) && !isObject$2(val = call$4(fn, input))) return val;
435
+ if (isCallable$8(fn = input.valueOf) && !isObject$2(val = call$4(fn, input))) return val;
436
+ if (pref !== 'string' && isCallable$8(fn = input.toString) && !isObject$2(val = call$4(fn, input))) return val;
437
+ throw TypeError$4("Can't convert object to primitive value");
438
+ };
439
+
440
+ var global$9 = global$o;
441
+ var call$3 = functionCall;
442
+ var isObject$1 = isObject$5;
443
+ var isSymbol$1 = isSymbol$2;
444
+ var getMethod = getMethod$1;
445
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
446
+ var wellKnownSymbol$5 = wellKnownSymbol$6;
447
+
448
+ var TypeError$3 = global$9.TypeError;
449
+ var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
450
+
451
+ // `ToPrimitive` abstract operation
452
+ // https://tc39.es/ecma262/#sec-toprimitive
453
+ var toPrimitive$1 = function (input, pref) {
454
+ if (!isObject$1(input) || isSymbol$1(input)) return input;
455
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
456
+ var result;
457
+ if (exoticToPrim) {
458
+ if (pref === undefined) pref = 'default';
459
+ result = call$3(exoticToPrim, input, pref);
460
+ if (!isObject$1(result) || isSymbol$1(result)) return result;
461
+ throw TypeError$3("Can't convert object to primitive value");
462
+ }
463
+ if (pref === undefined) pref = 'number';
464
+ return ordinaryToPrimitive(input, pref);
465
+ };
466
+
467
+ var toPrimitive = toPrimitive$1;
468
+ var isSymbol = isSymbol$2;
469
+
470
+ // `ToPropertyKey` abstract operation
471
+ // https://tc39.es/ecma262/#sec-topropertykey
472
+ var toPropertyKey$2 = function (argument) {
473
+ var key = toPrimitive(argument, 'string');
474
+ return isSymbol(key) ? key : key + '';
475
+ };
476
+
477
+ var global$8 = global$o;
478
+ var DESCRIPTORS$6 = descriptors;
479
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
480
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
481
+ var anObject$4 = anObject$5;
482
+ var toPropertyKey$1 = toPropertyKey$2;
483
+
484
+ var TypeError$2 = global$8.TypeError;
485
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
486
+ var $defineProperty = Object.defineProperty;
487
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
488
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
489
+ var ENUMERABLE = 'enumerable';
490
+ var CONFIGURABLE$1 = 'configurable';
491
+ var WRITABLE = 'writable';
492
+
493
+ // `Object.defineProperty` method
494
+ // https://tc39.es/ecma262/#sec-object.defineproperty
495
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
496
+ anObject$4(O);
497
+ P = toPropertyKey$1(P);
498
+ anObject$4(Attributes);
499
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
500
+ var current = $getOwnPropertyDescriptor$1(O, P);
501
+ if (current && current[WRITABLE]) {
502
+ O[P] = Attributes.value;
503
+ Attributes = {
504
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
505
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
506
+ writable: false
507
+ };
508
+ }
509
+ } return $defineProperty(O, P, Attributes);
510
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
511
+ anObject$4(O);
512
+ P = toPropertyKey$1(P);
513
+ anObject$4(Attributes);
514
+ if (IE8_DOM_DEFINE$1) try {
515
+ return $defineProperty(O, P, Attributes);
516
+ } catch (error) { /* empty */ }
517
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$2('Accessors not supported');
518
+ if ('value' in Attributes) O[P] = Attributes.value;
519
+ return O;
520
+ };
521
+
522
+ var ceil = Math.ceil;
523
+ var floor = Math.floor;
524
+
525
+ // `ToIntegerOrInfinity` abstract operation
526
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
527
+ var toIntegerOrInfinity$2 = function (argument) {
528
+ var number = +argument;
529
+ // eslint-disable-next-line no-self-compare -- safe
530
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
531
+ };
532
+
533
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
534
+
535
+ var max = Math.max;
536
+ var min$1 = Math.min;
537
+
538
+ // Helper for a popular repeating case of the spec:
539
+ // Let integer be ? ToInteger(index).
540
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
541
+ var toAbsoluteIndex$1 = function (index, length) {
542
+ var integer = toIntegerOrInfinity$1(index);
543
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
544
+ };
545
+
546
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
547
+
548
+ var min = Math.min;
549
+
550
+ // `ToLength` abstract operation
551
+ // https://tc39.es/ecma262/#sec-tolength
552
+ var toLength$1 = function (argument) {
553
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
554
+ };
555
+
556
+ var toLength = toLength$1;
557
+
558
+ // `LengthOfArrayLike` abstract operation
559
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
560
+ var lengthOfArrayLike$1 = function (obj) {
561
+ return toLength(obj.length);
562
+ };
563
+
564
+ var toIndexedObject$4 = toIndexedObject$5;
565
+ var toAbsoluteIndex = toAbsoluteIndex$1;
566
+ var lengthOfArrayLike = lengthOfArrayLike$1;
567
+
568
+ // `Array.prototype.{ indexOf, includes }` methods implementation
569
+ var createMethod = function (IS_INCLUDES) {
570
+ return function ($this, el, fromIndex) {
571
+ var O = toIndexedObject$4($this);
572
+ var length = lengthOfArrayLike(O);
573
+ var index = toAbsoluteIndex(fromIndex, length);
574
+ var value;
575
+ // Array#includes uses SameValueZero equality algorithm
576
+ // eslint-disable-next-line no-self-compare -- NaN check
577
+ if (IS_INCLUDES && el != el) while (length > index) {
578
+ value = O[index++];
579
+ // eslint-disable-next-line no-self-compare -- NaN check
580
+ if (value != value) return true;
581
+ // Array#indexOf ignores holes, Array#includes - not
582
+ } else for (;length > index; index++) {
583
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
584
+ } return !IS_INCLUDES && -1;
585
+ };
586
+ };
587
+
588
+ var arrayIncludes = {
589
+ // `Array.prototype.includes` method
590
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
591
+ includes: createMethod(true),
592
+ // `Array.prototype.indexOf` method
593
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
594
+ indexOf: createMethod(false)
595
+ };
596
+
597
+ var hiddenKeys$4 = {};
598
+
599
+ var uncurryThis$5 = functionUncurryThis;
600
+ var hasOwn$7 = hasOwnProperty_1;
601
+ var toIndexedObject$3 = toIndexedObject$5;
602
+ var indexOf = arrayIncludes.indexOf;
603
+ var hiddenKeys$3 = hiddenKeys$4;
604
+
605
+ var push = uncurryThis$5([].push);
606
+
607
+ var objectKeysInternal = function (object, names) {
608
+ var O = toIndexedObject$3(object);
609
+ var i = 0;
610
+ var result = [];
611
+ var key;
612
+ for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
613
+ // Don't enum bug & hidden keys
614
+ while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
615
+ ~indexOf(result, key) || push(result, key);
616
+ }
617
+ return result;
618
+ };
619
+
620
+ // IE8- don't enum bug keys
621
+ var enumBugKeys$3 = [
622
+ 'constructor',
623
+ 'hasOwnProperty',
624
+ 'isPrototypeOf',
625
+ 'propertyIsEnumerable',
626
+ 'toLocaleString',
627
+ 'toString',
628
+ 'valueOf'
629
+ ];
630
+
631
+ var internalObjectKeys$1 = objectKeysInternal;
632
+ var enumBugKeys$2 = enumBugKeys$3;
633
+
634
+ // `Object.keys` method
635
+ // https://tc39.es/ecma262/#sec-object.keys
636
+ // eslint-disable-next-line es/no-object-keys -- safe
637
+ var objectKeys$2 = Object.keys || function keys(O) {
638
+ return internalObjectKeys$1(O, enumBugKeys$2);
639
+ };
640
+
641
+ var DESCRIPTORS$5 = descriptors;
642
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
643
+ var definePropertyModule$3 = objectDefineProperty;
644
+ var anObject$3 = anObject$5;
645
+ var toIndexedObject$2 = toIndexedObject$5;
646
+ var objectKeys$1 = objectKeys$2;
647
+
648
+ // `Object.defineProperties` method
649
+ // https://tc39.es/ecma262/#sec-object.defineproperties
650
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
651
+ objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
652
+ anObject$3(O);
653
+ var props = toIndexedObject$2(Properties);
654
+ var keys = objectKeys$1(Properties);
655
+ var length = keys.length;
656
+ var index = 0;
657
+ var key;
658
+ while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
659
+ return O;
660
+ };
661
+
662
+ var getBuiltIn$1 = getBuiltIn$4;
663
+
664
+ var html$1 = getBuiltIn$1('document', 'documentElement');
665
+
666
+ var shared$1 = shared$3.exports;
667
+ var uid = uid$2;
668
+
669
+ var keys = shared$1('keys');
670
+
671
+ var sharedKey$3 = function (key) {
672
+ return keys[key] || (keys[key] = uid(key));
673
+ };
674
+
675
+ /* global ActiveXObject -- old IE, WSH */
676
+
677
+ var anObject$2 = anObject$5;
678
+ var definePropertiesModule = objectDefineProperties;
679
+ var enumBugKeys$1 = enumBugKeys$3;
680
+ var hiddenKeys$2 = hiddenKeys$4;
681
+ var html = html$1;
682
+ var documentCreateElement$1 = documentCreateElement$2;
683
+ var sharedKey$2 = sharedKey$3;
684
+
685
+ var GT = '>';
686
+ var LT = '<';
687
+ var PROTOTYPE = 'prototype';
688
+ var SCRIPT = 'script';
689
+ var IE_PROTO$1 = sharedKey$2('IE_PROTO');
690
+
691
+ var EmptyConstructor = function () { /* empty */ };
692
+
693
+ var scriptTag = function (content) {
694
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
695
+ };
696
+
697
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
698
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
699
+ activeXDocument.write(scriptTag(''));
700
+ activeXDocument.close();
701
+ var temp = activeXDocument.parentWindow.Object;
702
+ activeXDocument = null; // avoid memory leak
703
+ return temp;
704
+ };
705
+
706
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
707
+ var NullProtoObjectViaIFrame = function () {
708
+ // Thrash, waste and sodomy: IE GC bug
709
+ var iframe = documentCreateElement$1('iframe');
710
+ var JS = 'java' + SCRIPT + ':';
711
+ var iframeDocument;
712
+ iframe.style.display = 'none';
713
+ html.appendChild(iframe);
714
+ // https://github.com/zloirock/core-js/issues/475
715
+ iframe.src = String(JS);
716
+ iframeDocument = iframe.contentWindow.document;
717
+ iframeDocument.open();
718
+ iframeDocument.write(scriptTag('document.F=Object'));
719
+ iframeDocument.close();
720
+ return iframeDocument.F;
721
+ };
722
+
723
+ // Check for document.domain and active x support
724
+ // No need to use active x approach when document.domain is not set
725
+ // see https://github.com/es-shims/es5-shim/issues/150
726
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
727
+ // avoid IE GC bug
728
+ var activeXDocument;
729
+ var NullProtoObject = function () {
730
+ try {
731
+ activeXDocument = new ActiveXObject('htmlfile');
732
+ } catch (error) { /* ignore */ }
733
+ NullProtoObject = typeof document != 'undefined'
734
+ ? document.domain && activeXDocument
735
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
736
+ : NullProtoObjectViaIFrame()
737
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
738
+ var length = enumBugKeys$1.length;
739
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
740
+ return NullProtoObject();
741
+ };
742
+
743
+ hiddenKeys$2[IE_PROTO$1] = true;
744
+
745
+ // `Object.create` method
746
+ // https://tc39.es/ecma262/#sec-object.create
747
+ var objectCreate = Object.create || function create(O, Properties) {
748
+ var result;
749
+ if (O !== null) {
750
+ EmptyConstructor[PROTOTYPE] = anObject$2(O);
751
+ result = new EmptyConstructor();
752
+ EmptyConstructor[PROTOTYPE] = null;
753
+ // add "__proto__" for Object.getPrototypeOf polyfill
754
+ result[IE_PROTO$1] = O;
755
+ } else result = NullProtoObject();
756
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
757
+ };
758
+
759
+ var wellKnownSymbol$4 = wellKnownSymbol$6;
760
+ var create$1 = objectCreate;
761
+ var definePropertyModule$2 = objectDefineProperty;
762
+
763
+ var UNSCOPABLES = wellKnownSymbol$4('unscopables');
764
+ var ArrayPrototype = Array.prototype;
765
+
766
+ // Array.prototype[@@unscopables]
767
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
768
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
769
+ definePropertyModule$2.f(ArrayPrototype, UNSCOPABLES, {
770
+ configurable: true,
771
+ value: create$1(null)
772
+ });
773
+ }
774
+
775
+ // add a key to Array.prototype[@@unscopables]
776
+ var addToUnscopables$1 = function (key) {
777
+ ArrayPrototype[UNSCOPABLES][key] = true;
778
+ };
779
+
780
+ var iterators = {};
781
+
782
+ var uncurryThis$4 = functionUncurryThis;
783
+ var isCallable$7 = isCallable$d;
784
+ var store$1 = sharedStore;
785
+
786
+ var functionToString = uncurryThis$4(Function.toString);
787
+
788
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
789
+ if (!isCallable$7(store$1.inspectSource)) {
790
+ store$1.inspectSource = function (it) {
791
+ return functionToString(it);
792
+ };
793
+ }
794
+
795
+ var inspectSource$2 = store$1.inspectSource;
796
+
797
+ var global$7 = global$o;
798
+ var isCallable$6 = isCallable$d;
799
+ var inspectSource$1 = inspectSource$2;
800
+
801
+ var WeakMap$1 = global$7.WeakMap;
802
+
803
+ var nativeWeakMap = isCallable$6(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
804
+
805
+ var createPropertyDescriptor$3 = function (bitmap, value) {
806
+ return {
807
+ enumerable: !(bitmap & 1),
808
+ configurable: !(bitmap & 2),
809
+ writable: !(bitmap & 4),
810
+ value: value
811
+ };
812
+ };
813
+
814
+ var DESCRIPTORS$4 = descriptors;
815
+ var definePropertyModule$1 = objectDefineProperty;
816
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
817
+
818
+ var createNonEnumerableProperty$5 = DESCRIPTORS$4 ? function (object, key, value) {
819
+ return definePropertyModule$1.f(object, key, createPropertyDescriptor$2(1, value));
820
+ } : function (object, key, value) {
821
+ object[key] = value;
822
+ return object;
823
+ };
824
+
825
+ var NATIVE_WEAK_MAP = nativeWeakMap;
826
+ var global$6 = global$o;
827
+ var uncurryThis$3 = functionUncurryThis;
828
+ var isObject = isObject$5;
829
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
830
+ var hasOwn$6 = hasOwnProperty_1;
831
+ var shared = sharedStore;
832
+ var sharedKey$1 = sharedKey$3;
833
+ var hiddenKeys$1 = hiddenKeys$4;
834
+
835
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
836
+ var TypeError$1 = global$6.TypeError;
837
+ var WeakMap = global$6.WeakMap;
838
+ var set, get, has;
839
+
840
+ var enforce = function (it) {
841
+ return has(it) ? get(it) : set(it, {});
842
+ };
843
+
844
+ var getterFor = function (TYPE) {
845
+ return function (it) {
846
+ var state;
847
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
848
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
849
+ } return state;
850
+ };
851
+ };
852
+
853
+ if (NATIVE_WEAK_MAP || shared.state) {
854
+ var store = shared.state || (shared.state = new WeakMap());
855
+ var wmget = uncurryThis$3(store.get);
856
+ var wmhas = uncurryThis$3(store.has);
857
+ var wmset = uncurryThis$3(store.set);
858
+ set = function (it, metadata) {
859
+ if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
860
+ metadata.facade = it;
861
+ wmset(store, it, metadata);
862
+ return metadata;
863
+ };
864
+ get = function (it) {
865
+ return wmget(store, it) || {};
866
+ };
867
+ has = function (it) {
868
+ return wmhas(store, it);
869
+ };
870
+ } else {
871
+ var STATE = sharedKey$1('state');
872
+ hiddenKeys$1[STATE] = true;
873
+ set = function (it, metadata) {
874
+ if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
875
+ metadata.facade = it;
876
+ createNonEnumerableProperty$4(it, STATE, metadata);
877
+ return metadata;
878
+ };
879
+ get = function (it) {
880
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
881
+ };
882
+ has = function (it) {
883
+ return hasOwn$6(it, STATE);
884
+ };
885
+ }
886
+
887
+ var internalState = {
888
+ set: set,
889
+ get: get,
890
+ has: has,
891
+ enforce: enforce,
892
+ getterFor: getterFor
893
+ };
894
+
895
+ var objectGetOwnPropertyDescriptor = {};
896
+
897
+ var objectPropertyIsEnumerable = {};
898
+
899
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
900
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
901
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
902
+
903
+ // Nashorn ~ JDK8 bug
904
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
905
+
906
+ // `Object.prototype.propertyIsEnumerable` method implementation
907
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
908
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
909
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
910
+ return !!descriptor && descriptor.enumerable;
911
+ } : $propertyIsEnumerable;
912
+
913
+ var DESCRIPTORS$3 = descriptors;
914
+ var call$2 = functionCall;
915
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
916
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
917
+ var toIndexedObject$1 = toIndexedObject$5;
918
+ var toPropertyKey = toPropertyKey$2;
919
+ var hasOwn$5 = hasOwnProperty_1;
920
+ var IE8_DOM_DEFINE = ie8DomDefine;
921
+
922
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
923
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
924
+
925
+ // `Object.getOwnPropertyDescriptor` method
926
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
927
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
928
+ O = toIndexedObject$1(O);
929
+ P = toPropertyKey(P);
930
+ if (IE8_DOM_DEFINE) try {
931
+ return $getOwnPropertyDescriptor(O, P);
932
+ } catch (error) { /* empty */ }
933
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
934
+ };
935
+
936
+ var redefine$3 = {exports: {}};
937
+
938
+ var DESCRIPTORS$2 = descriptors;
939
+ var hasOwn$4 = hasOwnProperty_1;
940
+
941
+ var FunctionPrototype = Function.prototype;
942
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
943
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
944
+
945
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
946
+ // additional protection from minified / mangled / dropped function names
947
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
948
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
949
+
950
+ var functionName = {
951
+ EXISTS: EXISTS,
952
+ PROPER: PROPER,
953
+ CONFIGURABLE: CONFIGURABLE
954
+ };
955
+
956
+ var global$5 = global$o;
957
+ var isCallable$5 = isCallable$d;
958
+ var hasOwn$3 = hasOwnProperty_1;
959
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
960
+ var setGlobal$1 = setGlobal$3;
961
+ var inspectSource = inspectSource$2;
962
+ var InternalStateModule$1 = internalState;
963
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
964
+
965
+ var getInternalState$1 = InternalStateModule$1.get;
966
+ var enforceInternalState = InternalStateModule$1.enforce;
967
+ var TEMPLATE = String(String).split('String');
968
+
969
+ (redefine$3.exports = function (O, key, value, options) {
970
+ var unsafe = options ? !!options.unsafe : false;
971
+ var simple = options ? !!options.enumerable : false;
972
+ var noTargetGet = options ? !!options.noTargetGet : false;
973
+ var name = options && options.name !== undefined ? options.name : key;
974
+ var state;
975
+ if (isCallable$5(value)) {
976
+ if (String(name).slice(0, 7) === 'Symbol(') {
977
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
978
+ }
979
+ if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
980
+ createNonEnumerableProperty$3(value, 'name', name);
981
+ }
982
+ state = enforceInternalState(value);
983
+ if (!state.source) {
984
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
985
+ }
986
+ }
987
+ if (O === global$5) {
988
+ if (simple) O[key] = value;
989
+ else setGlobal$1(key, value);
990
+ return;
991
+ } else if (!unsafe) {
992
+ delete O[key];
993
+ } else if (!noTargetGet && O[key]) {
994
+ simple = true;
995
+ }
996
+ if (simple) O[key] = value;
997
+ else createNonEnumerableProperty$3(O, key, value);
998
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
999
+ })(Function.prototype, 'toString', function toString() {
1000
+ return isCallable$5(this) && getInternalState$1(this).source || inspectSource(this);
1001
+ });
1002
+
1003
+ var objectGetOwnPropertyNames = {};
1004
+
1005
+ var internalObjectKeys = objectKeysInternal;
1006
+ var enumBugKeys = enumBugKeys$3;
1007
+
1008
+ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1009
+
1010
+ // `Object.getOwnPropertyNames` method
1011
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
1012
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1013
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1014
+ return internalObjectKeys(O, hiddenKeys);
1015
+ };
1016
+
1017
+ var objectGetOwnPropertySymbols = {};
1018
+
1019
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1020
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1021
+
1022
+ var getBuiltIn = getBuiltIn$4;
1023
+ var uncurryThis$2 = functionUncurryThis;
1024
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1025
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1026
+ var anObject$1 = anObject$5;
1027
+
1028
+ var concat$1 = uncurryThis$2([].concat);
1029
+
1030
+ // all object keys, includes non-enumerable and symbols
1031
+ var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1032
+ var keys = getOwnPropertyNamesModule.f(anObject$1(it));
1033
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1034
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1035
+ };
1036
+
1037
+ var hasOwn$2 = hasOwnProperty_1;
1038
+ var ownKeys = ownKeys$1;
1039
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1040
+ var definePropertyModule = objectDefineProperty;
1041
+
1042
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1043
+ var keys = ownKeys(source);
1044
+ var defineProperty = definePropertyModule.f;
1045
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1046
+ for (var i = 0; i < keys.length; i++) {
1047
+ var key = keys[i];
1048
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
1049
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1050
+ }
1051
+ }
1052
+ };
1053
+
1054
+ var fails$3 = fails$a;
1055
+ var isCallable$4 = isCallable$d;
1056
+
1057
+ var replacement = /#|\.prototype\./;
1058
+
1059
+ var isForced$1 = function (feature, detection) {
1060
+ var value = data[normalize(feature)];
1061
+ return value == POLYFILL ? true
1062
+ : value == NATIVE ? false
1063
+ : isCallable$4(detection) ? fails$3(detection)
1064
+ : !!detection;
1065
+ };
1066
+
1067
+ var normalize = isForced$1.normalize = function (string) {
1068
+ return String(string).replace(replacement, '.').toLowerCase();
1069
+ };
1070
+
1071
+ var data = isForced$1.data = {};
1072
+ var NATIVE = isForced$1.NATIVE = 'N';
1073
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1074
+
1075
+ var isForced_1 = isForced$1;
1076
+
1077
+ var global$4 = global$o;
1078
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1079
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1080
+ var redefine$2 = redefine$3.exports;
1081
+ var setGlobal = setGlobal$3;
1082
+ var copyConstructorProperties = copyConstructorProperties$1;
1083
+ var isForced = isForced_1;
1084
+
1085
+ /*
1086
+ options.target - name of the target object
1087
+ options.global - target is the global object
1088
+ options.stat - export as static methods of target
1089
+ options.proto - export as prototype methods of target
1090
+ options.real - real prototype method for the `pure` version
1091
+ options.forced - export even if the native feature is available
1092
+ options.bind - bind methods to the target, required for the `pure` version
1093
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1094
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1095
+ options.sham - add a flag to not completely full polyfills
1096
+ options.enumerable - export as enumerable property
1097
+ options.noTargetGet - prevent calling a getter on target
1098
+ options.name - the .name of the function if it does not match the key
1099
+ */
1100
+ var _export = function (options, source) {
1101
+ var TARGET = options.target;
1102
+ var GLOBAL = options.global;
1103
+ var STATIC = options.stat;
1104
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1105
+ if (GLOBAL) {
1106
+ target = global$4;
1107
+ } else if (STATIC) {
1108
+ target = global$4[TARGET] || setGlobal(TARGET, {});
1109
+ } else {
1110
+ target = (global$4[TARGET] || {}).prototype;
1111
+ }
1112
+ if (target) for (key in source) {
1113
+ sourceProperty = source[key];
1114
+ if (options.noTargetGet) {
1115
+ descriptor = getOwnPropertyDescriptor(target, key);
1116
+ targetProperty = descriptor && descriptor.value;
1117
+ } else targetProperty = target[key];
1118
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1119
+ // contained in target
1120
+ if (!FORCED && targetProperty !== undefined) {
1121
+ if (typeof sourceProperty == typeof targetProperty) continue;
1122
+ copyConstructorProperties(sourceProperty, targetProperty);
1123
+ }
1124
+ // add a flag to not completely full polyfills
1125
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1126
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1127
+ }
1128
+ // extend global
1129
+ redefine$2(target, key, sourceProperty, options);
1130
+ }
1131
+ };
1132
+
1133
+ var fails$2 = fails$a;
1134
+
1135
+ var correctPrototypeGetter = !fails$2(function () {
1136
+ function F() { /* empty */ }
1137
+ F.prototype.constructor = null;
1138
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1139
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1140
+ });
1141
+
1142
+ var global$3 = global$o;
1143
+ var hasOwn$1 = hasOwnProperty_1;
1144
+ var isCallable$3 = isCallable$d;
1145
+ var toObject$1 = toObject$3;
1146
+ var sharedKey = sharedKey$3;
1147
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1148
+
1149
+ var IE_PROTO = sharedKey('IE_PROTO');
1150
+ var Object$1 = global$3.Object;
1151
+ var ObjectPrototype = Object$1.prototype;
1152
+
1153
+ // `Object.getPrototypeOf` method
1154
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1155
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$1.getPrototypeOf : function (O) {
1156
+ var object = toObject$1(O);
1157
+ if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1158
+ var constructor = object.constructor;
1159
+ if (isCallable$3(constructor) && object instanceof constructor) {
1160
+ return constructor.prototype;
1161
+ } return object instanceof Object$1 ? ObjectPrototype : null;
1162
+ };
1163
+
1164
+ var fails$1 = fails$a;
1165
+ var isCallable$2 = isCallable$d;
1166
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1167
+ var redefine$1 = redefine$3.exports;
1168
+ var wellKnownSymbol$3 = wellKnownSymbol$6;
1169
+
1170
+ var ITERATOR$2 = wellKnownSymbol$3('iterator');
1171
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1172
+
1173
+ // `%IteratorPrototype%` object
1174
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1175
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1176
+
1177
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1178
+ if ([].keys) {
1179
+ arrayIterator = [].keys();
1180
+ // Safari 8 has buggy iterators w/o `next`
1181
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1182
+ else {
1183
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1184
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1185
+ }
1186
+ }
1187
+
1188
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$1(function () {
1189
+ var test = {};
1190
+ // FF44- legacy iterators case
1191
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1192
+ });
1193
+
1194
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1195
+
1196
+ // `%IteratorPrototype%[@@iterator]()` method
1197
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1198
+ if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
1199
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1200
+ return this;
1201
+ });
1202
+ }
1203
+
1204
+ var iteratorsCore = {
1205
+ IteratorPrototype: IteratorPrototype$2,
1206
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1207
+ };
1208
+
1209
+ var defineProperty$2 = objectDefineProperty.f;
1210
+ var hasOwn = hasOwnProperty_1;
1211
+ var wellKnownSymbol$2 = wellKnownSymbol$6;
1212
+
1213
+ var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1214
+
1215
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1216
+ if (target && !STATIC) target = target.prototype;
1217
+ if (target && !hasOwn(target, TO_STRING_TAG$1)) {
1218
+ defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
1219
+ }
1220
+ };
1221
+
1222
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1223
+ var create = objectCreate;
1224
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1225
+ var setToStringTag$1 = setToStringTag$2;
1226
+ var Iterators$2 = iterators;
1227
+
1228
+ var returnThis$1 = function () { return this; };
1229
+
1230
+ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1231
+ var TO_STRING_TAG = NAME + ' Iterator';
1232
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1233
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1234
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1235
+ return IteratorConstructor;
1236
+ };
1237
+
1238
+ var global$2 = global$o;
1239
+ var isCallable$1 = isCallable$d;
1240
+
1241
+ var String$1 = global$2.String;
1242
+ var TypeError = global$2.TypeError;
1243
+
1244
+ var aPossiblePrototype$1 = function (argument) {
1245
+ if (typeof argument == 'object' || isCallable$1(argument)) return argument;
1246
+ throw TypeError("Can't set " + String$1(argument) + ' as a prototype');
1247
+ };
1248
+
1249
+ /* eslint-disable no-proto -- safe */
1250
+
1251
+ var uncurryThis$1 = functionUncurryThis;
1252
+ var anObject = anObject$5;
1253
+ var aPossiblePrototype = aPossiblePrototype$1;
1254
+
1255
+ // `Object.setPrototypeOf` method
1256
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1257
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1258
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1259
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1260
+ var CORRECT_SETTER = false;
1261
+ var test = {};
1262
+ var setter;
1263
+ try {
1264
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1265
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1266
+ setter(test, []);
1267
+ CORRECT_SETTER = test instanceof Array;
1268
+ } catch (error) { /* empty */ }
1269
+ return function setPrototypeOf(O, proto) {
1270
+ anObject(O);
1271
+ aPossiblePrototype(proto);
1272
+ if (CORRECT_SETTER) setter(O, proto);
1273
+ else O.__proto__ = proto;
1274
+ return O;
1275
+ };
1276
+ }() : undefined);
1277
+
1278
+ var $$1 = _export;
1279
+ var call$1 = functionCall;
1280
+ var FunctionName = functionName;
1281
+ var isCallable = isCallable$d;
1282
+ var createIteratorConstructor = createIteratorConstructor$1;
1283
+ var getPrototypeOf = objectGetPrototypeOf;
1284
+ var setPrototypeOf = objectSetPrototypeOf;
1285
+ var setToStringTag = setToStringTag$2;
1286
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1287
+ var redefine = redefine$3.exports;
1288
+ var wellKnownSymbol$1 = wellKnownSymbol$6;
1289
+ var Iterators$1 = iterators;
1290
+ var IteratorsCore = iteratorsCore;
1291
+
1292
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1293
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1294
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1295
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1296
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
1297
+ var KEYS = 'keys';
1298
+ var VALUES = 'values';
1299
+ var ENTRIES = 'entries';
1300
+
1301
+ var returnThis = function () { return this; };
1302
+
1303
+ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1304
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1305
+
1306
+ var getIterationMethod = function (KIND) {
1307
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1308
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1309
+ switch (KIND) {
1310
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1311
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1312
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1313
+ } return function () { return new IteratorConstructor(this); };
1314
+ };
1315
+
1316
+ var TO_STRING_TAG = NAME + ' Iterator';
1317
+ var INCORRECT_VALUES_NAME = false;
1318
+ var IterablePrototype = Iterable.prototype;
1319
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1320
+ || IterablePrototype['@@iterator']
1321
+ || DEFAULT && IterablePrototype[DEFAULT];
1322
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1323
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1324
+ var CurrentIteratorPrototype, methods, KEY;
1325
+
1326
+ // fix native
1327
+ if (anyNativeIterator) {
1328
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1329
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1330
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1331
+ if (setPrototypeOf) {
1332
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1333
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1334
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1335
+ }
1336
+ }
1337
+ // Set @@toStringTag to native iterators
1338
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1339
+ }
1340
+ }
1341
+
1342
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1343
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1344
+ if (CONFIGURABLE_FUNCTION_NAME) {
1345
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1346
+ } else {
1347
+ INCORRECT_VALUES_NAME = true;
1348
+ defaultIterator = function values() { return call$1(nativeIterator, this); };
1349
+ }
1350
+ }
1351
+
1352
+ // export additional methods
1353
+ if (DEFAULT) {
1354
+ methods = {
1355
+ values: getIterationMethod(VALUES),
1356
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1357
+ entries: getIterationMethod(ENTRIES)
1358
+ };
1359
+ if (FORCED) for (KEY in methods) {
1360
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1361
+ redefine(IterablePrototype, KEY, methods[KEY]);
1362
+ }
1363
+ } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1364
+ }
1365
+
1366
+ // define iterator
1367
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1368
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1369
+ }
1370
+ Iterators$1[NAME] = defaultIterator;
1371
+
1372
+ return methods;
1373
+ };
1374
+
1375
+ var toIndexedObject = toIndexedObject$5;
1376
+ var addToUnscopables = addToUnscopables$1;
1377
+ var Iterators = iterators;
1378
+ var InternalStateModule = internalState;
1379
+ var defineProperty$1 = objectDefineProperty.f;
1380
+ var defineIterator = defineIterator$1;
1381
+ var DESCRIPTORS$1 = descriptors;
1382
+
1383
+ var ARRAY_ITERATOR = 'Array Iterator';
1384
+ var setInternalState = InternalStateModule.set;
1385
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1386
+
1387
+ // `Array.prototype.entries` method
1388
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1389
+ // `Array.prototype.keys` method
1390
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1391
+ // `Array.prototype.values` method
1392
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1393
+ // `Array.prototype[@@iterator]` method
1394
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1395
+ // `CreateArrayIterator` internal method
1396
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1397
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1398
+ setInternalState(this, {
1399
+ type: ARRAY_ITERATOR,
1400
+ target: toIndexedObject(iterated), // target
1401
+ index: 0, // next index
1402
+ kind: kind // kind
1403
+ });
1404
+ // `%ArrayIteratorPrototype%.next` method
1405
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1406
+ }, function () {
1407
+ var state = getInternalState(this);
1408
+ var target = state.target;
1409
+ var kind = state.kind;
1410
+ var index = state.index++;
1411
+ if (!target || index >= target.length) {
1412
+ state.target = undefined;
1413
+ return { value: undefined, done: true };
1414
+ }
1415
+ if (kind == 'keys') return { value: index, done: false };
1416
+ if (kind == 'values') return { value: target[index], done: false };
1417
+ return { value: [index, target[index]], done: false };
1418
+ }, 'values');
1419
+
1420
+ // argumentsList[@@iterator] is %ArrayProto_values%
1421
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1422
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1423
+ var values = Iterators.Arguments = Iterators.Array;
1424
+
1425
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1426
+ addToUnscopables('keys');
1427
+ addToUnscopables('values');
1428
+ addToUnscopables('entries');
1429
+
1430
+ // V8 ~ Chrome 45- bug
1431
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1432
+ defineProperty$1(values, 'name', { value: 'values' });
1433
+ } catch (error) { /* empty */ }
1434
+
1435
+ // iterable DOM collections
1436
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1437
+ var domIterables = {
1438
+ CSSRuleList: 0,
1439
+ CSSStyleDeclaration: 0,
1440
+ CSSValueList: 0,
1441
+ ClientRectList: 0,
1442
+ DOMRectList: 0,
1443
+ DOMStringList: 0,
1444
+ DOMTokenList: 1,
1445
+ DataTransferItemList: 0,
1446
+ FileList: 0,
1447
+ HTMLAllCollection: 0,
1448
+ HTMLCollection: 0,
1449
+ HTMLFormElement: 0,
1450
+ HTMLSelectElement: 0,
1451
+ MediaList: 0,
1452
+ MimeTypeArray: 0,
1453
+ NamedNodeMap: 0,
1454
+ NodeList: 1,
1455
+ PaintRequestList: 0,
1456
+ Plugin: 0,
1457
+ PluginArray: 0,
1458
+ SVGLengthList: 0,
1459
+ SVGNumberList: 0,
1460
+ SVGPathSegList: 0,
1461
+ SVGPointList: 0,
1462
+ SVGStringList: 0,
1463
+ SVGTransformList: 0,
1464
+ SourceBufferList: 0,
1465
+ StyleSheetList: 0,
1466
+ TextTrackCueList: 0,
1467
+ TextTrackList: 0,
1468
+ TouchList: 0
1469
+ };
1470
+
1471
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1472
+ var documentCreateElement = documentCreateElement$2;
1473
+
1474
+ var classList = documentCreateElement('span').classList;
1475
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1476
+
1477
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1478
+
1479
+ var global$1 = global$o;
1480
+ var DOMIterables = domIterables;
1481
+ var DOMTokenListPrototype = domTokenListPrototype;
1482
+ var ArrayIteratorMethods = es_array_iterator;
1483
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
1484
+ var wellKnownSymbol = wellKnownSymbol$6;
1485
+
1486
+ var ITERATOR = wellKnownSymbol('iterator');
1487
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1488
+ var ArrayValues = ArrayIteratorMethods.values;
1489
+
1490
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1491
+ if (CollectionPrototype) {
1492
+ // some Chrome versions have non-configurable methods on DOMTokenList
1493
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1494
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1495
+ } catch (error) {
1496
+ CollectionPrototype[ITERATOR] = ArrayValues;
1497
+ }
1498
+ if (!CollectionPrototype[TO_STRING_TAG]) {
1499
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
1500
+ }
1501
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1502
+ // some Chrome versions have non-configurable methods on DOMTokenList
1503
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1504
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1505
+ } catch (error) {
1506
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1507
+ }
1508
+ }
1509
+ }
1510
+ };
1511
+
1512
+ for (var COLLECTION_NAME in DOMIterables) {
1513
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
1514
+ }
1515
+
1516
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1517
+
1518
+ const useProfile = () => {
1519
+ const ninetailed = useNinetailed();
1520
+ const [profileState, setProfileState] = useState(ninetailed.profileState);
1521
+ useEffect(() => {
1522
+ return ninetailed.onProfileChange(profileState => {
1523
+ setProfileState(profileState);
1524
+ });
1525
+ }, []);
1526
+ return profileState;
1527
+ };
1528
+
1529
+ var DESCRIPTORS = descriptors;
1530
+ var uncurryThis = functionUncurryThis;
1531
+ var call = functionCall;
1532
+ var fails = fails$a;
1533
+ var objectKeys = objectKeys$2;
1534
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1535
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1536
+ var toObject = toObject$3;
1537
+ var IndexedObject = indexedObject;
1538
+
1539
+ // eslint-disable-next-line es/no-object-assign -- safe
1540
+ var $assign = Object.assign;
1541
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1542
+ var defineProperty = Object.defineProperty;
1543
+ var concat = uncurryThis([].concat);
1544
+
1545
+ // `Object.assign` method
1546
+ // https://tc39.es/ecma262/#sec-object.assign
1547
+ var objectAssign = !$assign || fails(function () {
1548
+ // should have correct order of operations (Edge bug)
1549
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
1550
+ enumerable: true,
1551
+ get: function () {
1552
+ defineProperty(this, 'b', {
1553
+ value: 3,
1554
+ enumerable: false
1555
+ });
1556
+ }
1557
+ }), { b: 2 })).b !== 1) return true;
1558
+ // should work with symbols and should have deterministic property order (V8 bug)
1559
+ var A = {};
1560
+ var B = {};
1561
+ // eslint-disable-next-line es/no-symbol -- safe
1562
+ var symbol = Symbol();
1563
+ var alphabet = 'abcdefghijklmnopqrst';
1564
+ A[symbol] = 7;
1565
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1566
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
1567
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1568
+ var T = toObject(target);
1569
+ var argumentsLength = arguments.length;
1570
+ var index = 1;
1571
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1572
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1573
+ while (argumentsLength > index) {
1574
+ var S = IndexedObject(arguments[index++]);
1575
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1576
+ var length = keys.length;
1577
+ var j = 0;
1578
+ var key;
1579
+ while (length > j) {
1580
+ key = keys[j++];
1581
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
1582
+ }
1583
+ } return T;
1584
+ } : $assign;
1585
+
1586
+ var $ = _export;
1587
+ var assign = objectAssign;
1588
+
1589
+ // `Object.assign` method
1590
+ // https://tc39.es/ecma262/#sec-object.assign
1591
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1592
+ $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
1593
+ assign: assign
1594
+ });
1595
+
1596
+ /*! *****************************************************************************
1597
+ Copyright (c) Microsoft Corporation.
1598
+
1599
+ Permission to use, copy, modify, and/or distribute this software for any
1600
+ purpose with or without fee is hereby granted.
1601
+
1602
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1603
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1604
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1605
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1606
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1607
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1608
+ PERFORMANCE OF THIS SOFTWARE.
1609
+ ***************************************************************************** */
1610
+
1611
+ function __rest(s, e) {
1612
+ var t = {};
1613
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1614
+ t[p] = s[p];
1615
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1616
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1617
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1618
+ t[p[i]] = s[p[i]];
1619
+ }
1620
+ return t;
1621
+ }
1622
+
1623
+ const isBrowser = () => typeof window !== 'undefined';
1624
+
1625
+ const usePersonalize = (baseline, variants, options = {
1626
+ holdout: -1
1627
+ }) => {
1628
+ const profile = useProfile();
1629
+ return selectVariant(baseline, variants, profile, options);
1630
+ };
1631
+
1632
+ const Personalize = _a => {
1633
+ var {
1634
+ component: Component,
1635
+ loadingComponent: LoadingComponent,
1636
+ variants = [],
1637
+ holdout = -1
1638
+ } = _a,
1639
+ baseline = __rest(_a, ["component", "loadingComponent", "variants", "holdout"]);
1640
+
1641
+ const {
1642
+ loading,
1643
+ variant,
1644
+ isPersonalized,
1645
+ audience
1646
+ } = usePersonalize(baseline, variants, {
1647
+ holdout
1648
+ }); // const trackSeenComponent = useTrackSeenComponent<P>();
1649
+
1650
+ const [isVisible, setIsVisible] = useState(false);
1651
+ const onChangeVisibility = useCallback(visibility => {
1652
+ if (visibility) {
1653
+ setIsVisible(true);
1654
+ }
1655
+ }, []);
1656
+ const trackCallFired = useRef(false);
1657
+ const hasVariants = variants.length > 0;
1658
+ useEffect(() => {
1659
+ if (isBrowser() && hasVariants && !loading && isVisible && variant && audience && audience.id !== 'baseline' && !trackCallFired.current) {
1660
+ // trackSeenComponent({
1661
+ // variant,
1662
+ // audience,
1663
+ // isPersonalized,
1664
+ // });
1665
+ trackCallFired.current = true;
1666
+ }
1667
+ }, [loading, isVisible, variant, baseline, isPersonalized]);
1668
+
1669
+ if (!hasVariants) {
1670
+ return /*#__PURE__*/React.createElement(Component, Object.assign({}, baseline, {
1671
+ ninetailed: {
1672
+ isPersonalized,
1673
+ audience
1674
+ }
1675
+ }));
1676
+ }
1677
+
1678
+ if (loading) {
1679
+ if (LoadingComponent) {
1680
+ return /*#__PURE__*/React.createElement(LoadingComponent, null);
1681
+ }
1682
+
1683
+ return /*#__PURE__*/React.createElement("div", {
1684
+ key: "hide",
1685
+ style: {
1686
+ opacity: 0
1687
+ }
1688
+ }, /*#__PURE__*/React.createElement(Component, Object.assign({}, variant, {
1689
+ ninetailed: {
1690
+ isPersonalized,
1691
+ audience
1692
+ }
1693
+ })));
1694
+ }
1695
+
1696
+ return /*#__PURE__*/React.createElement(VisibilitySensor, {
1697
+ key: `${audience.id}-${variant.id}`,
1698
+ partialVisibility: true,
1699
+ onChange: onChangeVisibility
1700
+ }, /*#__PURE__*/React.createElement(Component, Object.assign({}, variant, {
1701
+ ninetailed: {
1702
+ isPersonalized,
1703
+ audience
1704
+ }
1705
+ })));
1706
+ };
1707
+
1708
+ export { NinetailedProvider, Personalize, useNinetailed, useProfile };