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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js DELETED
@@ -1,2362 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@ninetailed/experience.js'), require('react-intersection-observer'), require('@ninetailed/experience.js-shared'), require('lodash/get'), require('lodash/has')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@ninetailed/experience.js', 'react-intersection-observer', '@ninetailed/experience.js-shared', 'lodash/get', 'lodash/has'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.experience_js, global.reactIntersectionObserver, global.experience_jsShared, global.get$1, global.has$1));
5
- })(this, (function (exports, React, experience_js, reactIntersectionObserver, experience_jsShared, get$1, has$1) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
- var get__default = /*#__PURE__*/_interopDefaultLegacy(get$1);
11
- var has__default = /*#__PURE__*/_interopDefaultLegacy(has$1);
12
-
13
- var NinetailedContext = /*#__PURE__*/React.createContext(undefined);
14
-
15
- var ExperimentsContext = /*#__PURE__*/React.createContext(undefined);
16
-
17
- var ExperimentsProvider = function ExperimentsProvider(_a) {
18
- var experiments = _a.experiments,
19
- children = _a.children;
20
- return /*#__PURE__*/React__default["default"].createElement(ExperimentsContext.Provider, {
21
- value: {
22
- experiments: experiments
23
- }
24
- }, children);
25
- };
26
-
27
- var NinetailedProvider = function NinetailedProvider(_a) {
28
- var children = _a.children,
29
- clientId = _a.clientId,
30
- _b = _a.experiments,
31
- experiments = _b === void 0 ? [] : _b,
32
- environment = _a.environment,
33
- preview = _a.preview,
34
- url = _a.url,
35
- profile = _a.profile,
36
- locale = _a.locale,
37
- requestTimeout = _a.requestTimeout,
38
- _c = _a.plugins,
39
- plugins = _c === void 0 ? [] : _c,
40
- onLog = _a.onLog,
41
- onError = _a.onError;
42
- var ninetailed = React.useMemo(function () {
43
- return new experience_js.Ninetailed({
44
- clientId: clientId,
45
- environment: environment,
46
- preview: preview
47
- }, {
48
- url: url,
49
- plugins: plugins,
50
- profile: profile,
51
- locale: locale,
52
- requestTimeout: requestTimeout,
53
- onLog: onLog,
54
- onError: onError
55
- });
56
- }, []);
57
- return /*#__PURE__*/React__default["default"].createElement(NinetailedContext.Provider, {
58
- value: ninetailed
59
- }, /*#__PURE__*/React__default["default"].createElement(ExperimentsProvider, {
60
- experiments: experiments
61
- }, children));
62
- };
63
-
64
- var useNinetailed = function useNinetailed() {
65
- var ninetailed = React.useContext(NinetailedContext);
66
-
67
- if (ninetailed === undefined) {
68
- throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
69
- }
70
-
71
- return ninetailed;
72
- };
73
-
74
- /*! *****************************************************************************
75
- Copyright (c) Microsoft Corporation.
76
-
77
- Permission to use, copy, modify, and/or distribute this software for any
78
- purpose with or without fee is hereby granted.
79
-
80
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
81
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
82
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
83
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
84
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
85
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
86
- PERFORMANCE OF THIS SOFTWARE.
87
- ***************************************************************************** */
88
-
89
- var __assign = function() {
90
- __assign = Object.assign || function __assign(t) {
91
- for (var s, i = 1, n = arguments.length; i < n; i++) {
92
- s = arguments[i];
93
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
94
- }
95
- return t;
96
- };
97
- return __assign.apply(this, arguments);
98
- };
99
-
100
- function __rest(s, e) {
101
- var t = {};
102
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
103
- t[p] = s[p];
104
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
105
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
106
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
107
- t[p[i]] = s[p[i]];
108
- }
109
- return t;
110
- }
111
-
112
- var useProfile = function useProfile() {
113
- var ninetailed = useNinetailed();
114
-
115
- var _a = React.useState(ninetailed.profileState),
116
- profileState = _a[0],
117
- setProfileState = _a[1];
118
-
119
- React.useEffect(function () {
120
- return ninetailed.onProfileChange(function (profileState) {
121
- setProfileState(profileState);
122
- });
123
- }, []);
124
- return __assign(__assign({}, profileState), {
125
- loading: profileState.status === 'loading'
126
- });
127
- };
128
-
129
- var usePersonalize = function usePersonalize(baseline, variants, options) {
130
- if (options === void 0) {
131
- options = {
132
- holdout: -1
133
- };
134
- }
135
-
136
- var profile = useProfile();
137
- return experience_js.selectVariant(baseline, variants, profile, options);
138
- };
139
-
140
- var TrackHasSeenComponent = function TrackHasSeenComponent(_a) {
141
- var children = _a.children,
142
- variant = _a.variant,
143
- audience = _a.audience,
144
- isPersonalized = _a.isPersonalized;
145
- var ninetailed = useNinetailed();
146
-
147
- var _b = reactIntersectionObserver.useInView({
148
- triggerOnce: true
149
- }),
150
- ref = _b.ref,
151
- inView = _b.inView;
152
-
153
- React.useEffect(function () {
154
- if (experience_jsShared.isBrowser() && inView) {
155
- ninetailed.trackHasSeenComponent({
156
- variant: variant,
157
- audience: audience,
158
- isPersonalized: isPersonalized
159
- });
160
- }
161
- }, [inView]);
162
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
163
- ref: ref
164
- }), children);
165
- };
166
-
167
- var Personalize = function Personalize(_a) {
168
- var Component = _a.component,
169
- LoadingComponent = _a.loadingComponent,
170
- _b = _a.variants,
171
- variants = _b === void 0 ? [] : _b,
172
- _c = _a.holdout,
173
- holdout = _c === void 0 ? -1 : _c,
174
- baseline = __rest(_a, ["component", "loadingComponent", "variants", "holdout"]);
175
-
176
- var _d = usePersonalize(baseline, variants, {
177
- holdout: holdout
178
- }),
179
- loading = _d.loading,
180
- variant = _d.variant,
181
- isPersonalized = _d.isPersonalized,
182
- audience = _d.audience;
183
-
184
- var hasVariants = variants.length > 0;
185
-
186
- if (!hasVariants) {
187
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, baseline, {
188
- ninetailed: {
189
- isPersonalized: isPersonalized,
190
- audience: audience
191
- }
192
- }));
193
- }
194
-
195
- if (loading) {
196
- if (LoadingComponent) {
197
- return /*#__PURE__*/React__default["default"].createElement(LoadingComponent, null);
198
- }
199
-
200
- return /*#__PURE__*/React__default["default"].createElement("div", {
201
- key: "hide",
202
- style: {
203
- opacity: 0
204
- }
205
- }, /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, variant, {
206
- ninetailed: {
207
- isPersonalized: isPersonalized,
208
- audience: audience
209
- }
210
- })));
211
- }
212
-
213
- return /*#__PURE__*/React__default["default"].createElement(TrackHasSeenComponent, {
214
- variant: variant,
215
- audience: audience,
216
- isPersonalized: isPersonalized
217
- }, /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, variant, {
218
- key: "".concat(audience.id, "-").concat(variant.id),
219
- ninetailed: {
220
- isPersonalized: isPersonalized,
221
- audience: audience
222
- }
223
- })));
224
- };
225
-
226
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
227
-
228
- var check = function (it) {
229
- return it && it.Math == Math && it;
230
- };
231
-
232
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
233
- var global$t =
234
- // eslint-disable-next-line es/no-global-this -- safe
235
- check(typeof globalThis == 'object' && globalThis) ||
236
- check(typeof window == 'object' && window) ||
237
- // eslint-disable-next-line no-restricted-globals -- safe
238
- check(typeof self == 'object' && self) ||
239
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
240
- // eslint-disable-next-line no-new-func -- fallback
241
- (function () { return this; })() || Function('return this')();
242
-
243
- var objectGetOwnPropertyDescriptor = {};
244
-
245
- var fails$d = function (exec) {
246
- try {
247
- return !!exec();
248
- } catch (error) {
249
- return true;
250
- }
251
- };
252
-
253
- var fails$c = fails$d;
254
-
255
- // Detect IE8's incomplete defineProperty implementation
256
- var descriptors = !fails$c(function () {
257
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
258
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
259
- });
260
-
261
- var fails$b = fails$d;
262
-
263
- var functionBindNative = !fails$b(function () {
264
- var test = (function () { /* empty */ }).bind();
265
- // eslint-disable-next-line no-prototype-builtins -- safe
266
- return typeof test != 'function' || test.hasOwnProperty('prototype');
267
- });
268
-
269
- var NATIVE_BIND$2 = functionBindNative;
270
-
271
- var call$8 = Function.prototype.call;
272
-
273
- var functionCall = NATIVE_BIND$2 ? call$8.bind(call$8) : function () {
274
- return call$8.apply(call$8, arguments);
275
- };
276
-
277
- var objectPropertyIsEnumerable = {};
278
-
279
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
280
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
281
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
282
-
283
- // Nashorn ~ JDK8 bug
284
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
285
-
286
- // `Object.prototype.propertyIsEnumerable` method implementation
287
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
288
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
289
- var descriptor = getOwnPropertyDescriptor$1(this, V);
290
- return !!descriptor && descriptor.enumerable;
291
- } : $propertyIsEnumerable;
292
-
293
- var createPropertyDescriptor$2 = function (bitmap, value) {
294
- return {
295
- enumerable: !(bitmap & 1),
296
- configurable: !(bitmap & 2),
297
- writable: !(bitmap & 4),
298
- value: value
299
- };
300
- };
301
-
302
- var NATIVE_BIND$1 = functionBindNative;
303
-
304
- var FunctionPrototype$2 = Function.prototype;
305
- var bind = FunctionPrototype$2.bind;
306
- var call$7 = FunctionPrototype$2.call;
307
- var uncurryThis$e = NATIVE_BIND$1 && bind.bind(call$7, call$7);
308
-
309
- var functionUncurryThis = NATIVE_BIND$1 ? function (fn) {
310
- return fn && uncurryThis$e(fn);
311
- } : function (fn) {
312
- return fn && function () {
313
- return call$7.apply(fn, arguments);
314
- };
315
- };
316
-
317
- var uncurryThis$d = functionUncurryThis;
318
-
319
- var toString$5 = uncurryThis$d({}.toString);
320
- var stringSlice$4 = uncurryThis$d(''.slice);
321
-
322
- var classofRaw$1 = function (it) {
323
- return stringSlice$4(toString$5(it), 8, -1);
324
- };
325
-
326
- var global$s = global$t;
327
- var uncurryThis$c = functionUncurryThis;
328
- var fails$a = fails$d;
329
- var classof$4 = classofRaw$1;
330
-
331
- var Object$4 = global$s.Object;
332
- var split = uncurryThis$c(''.split);
333
-
334
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
335
- var indexedObject = fails$a(function () {
336
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
337
- // eslint-disable-next-line no-prototype-builtins -- safe
338
- return !Object$4('z').propertyIsEnumerable(0);
339
- }) ? function (it) {
340
- return classof$4(it) == 'String' ? split(it, '') : Object$4(it);
341
- } : Object$4;
342
-
343
- var global$r = global$t;
344
-
345
- var TypeError$9 = global$r.TypeError;
346
-
347
- // `RequireObjectCoercible` abstract operation
348
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
349
- var requireObjectCoercible$4 = function (it) {
350
- if (it == undefined) throw TypeError$9("Can't call method on " + it);
351
- return it;
352
- };
353
-
354
- // toObject with fallback for non-array-like ES3 strings
355
- var IndexedObject$1 = indexedObject;
356
- var requireObjectCoercible$3 = requireObjectCoercible$4;
357
-
358
- var toIndexedObject$4 = function (it) {
359
- return IndexedObject$1(requireObjectCoercible$3(it));
360
- };
361
-
362
- // `IsCallable` abstract operation
363
- // https://tc39.es/ecma262/#sec-iscallable
364
- var isCallable$c = function (argument) {
365
- return typeof argument == 'function';
366
- };
367
-
368
- var isCallable$b = isCallable$c;
369
-
370
- var isObject$5 = function (it) {
371
- return typeof it == 'object' ? it !== null : isCallable$b(it);
372
- };
373
-
374
- var global$q = global$t;
375
- var isCallable$a = isCallable$c;
376
-
377
- var aFunction = function (argument) {
378
- return isCallable$a(argument) ? argument : undefined;
379
- };
380
-
381
- var getBuiltIn$4 = function (namespace, method) {
382
- return arguments.length < 2 ? aFunction(global$q[namespace]) : global$q[namespace] && global$q[namespace][method];
383
- };
384
-
385
- var uncurryThis$b = functionUncurryThis;
386
-
387
- var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
388
-
389
- var getBuiltIn$3 = getBuiltIn$4;
390
-
391
- var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
392
-
393
- var global$p = global$t;
394
- var userAgent = engineUserAgent;
395
-
396
- var process = global$p.process;
397
- var Deno = global$p.Deno;
398
- var versions = process && process.versions || Deno && Deno.version;
399
- var v8 = versions && versions.v8;
400
- var match, version;
401
-
402
- if (v8) {
403
- match = v8.split('.');
404
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
405
- // but their correct versions are not interesting for us
406
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
407
- }
408
-
409
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
410
- // so check `userAgent` even if `.v8` exists, but 0
411
- if (!version && userAgent) {
412
- match = userAgent.match(/Edge\/(\d+)/);
413
- if (!match || match[1] >= 74) {
414
- match = userAgent.match(/Chrome\/(\d+)/);
415
- if (match) version = +match[1];
416
- }
417
- }
418
-
419
- var engineV8Version = version;
420
-
421
- /* eslint-disable es/no-symbol -- required for testing */
422
-
423
- var V8_VERSION = engineV8Version;
424
- var fails$9 = fails$d;
425
-
426
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
427
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$9(function () {
428
- var symbol = Symbol();
429
- // Chrome 38 Symbol has incorrect toString conversion
430
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
431
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
432
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
433
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
434
- });
435
-
436
- /* eslint-disable es/no-symbol -- required for testing */
437
-
438
- var NATIVE_SYMBOL$1 = nativeSymbol;
439
-
440
- var useSymbolAsUid = NATIVE_SYMBOL$1
441
- && !Symbol.sham
442
- && typeof Symbol.iterator == 'symbol';
443
-
444
- var global$o = global$t;
445
- var getBuiltIn$2 = getBuiltIn$4;
446
- var isCallable$9 = isCallable$c;
447
- var isPrototypeOf = objectIsPrototypeOf;
448
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
449
-
450
- var Object$3 = global$o.Object;
451
-
452
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
453
- return typeof it == 'symbol';
454
- } : function (it) {
455
- var $Symbol = getBuiltIn$2('Symbol');
456
- return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, Object$3(it));
457
- };
458
-
459
- var global$n = global$t;
460
-
461
- var String$3 = global$n.String;
462
-
463
- var tryToString$1 = function (argument) {
464
- try {
465
- return String$3(argument);
466
- } catch (error) {
467
- return 'Object';
468
- }
469
- };
470
-
471
- var global$m = global$t;
472
- var isCallable$8 = isCallable$c;
473
- var tryToString = tryToString$1;
474
-
475
- var TypeError$8 = global$m.TypeError;
476
-
477
- // `Assert: IsCallable(argument) is true`
478
- var aCallable$2 = function (argument) {
479
- if (isCallable$8(argument)) return argument;
480
- throw TypeError$8(tryToString(argument) + ' is not a function');
481
- };
482
-
483
- var aCallable$1 = aCallable$2;
484
-
485
- // `GetMethod` abstract operation
486
- // https://tc39.es/ecma262/#sec-getmethod
487
- var getMethod$2 = function (V, P) {
488
- var func = V[P];
489
- return func == null ? undefined : aCallable$1(func);
490
- };
491
-
492
- var global$l = global$t;
493
- var call$6 = functionCall;
494
- var isCallable$7 = isCallable$c;
495
- var isObject$4 = isObject$5;
496
-
497
- var TypeError$7 = global$l.TypeError;
498
-
499
- // `OrdinaryToPrimitive` abstract operation
500
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
501
- var ordinaryToPrimitive$1 = function (input, pref) {
502
- var fn, val;
503
- if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$4(val = call$6(fn, input))) return val;
504
- if (isCallable$7(fn = input.valueOf) && !isObject$4(val = call$6(fn, input))) return val;
505
- if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$4(val = call$6(fn, input))) return val;
506
- throw TypeError$7("Can't convert object to primitive value");
507
- };
508
-
509
- var shared$4 = {exports: {}};
510
-
511
- var global$k = global$t;
512
-
513
- // eslint-disable-next-line es/no-object-defineproperty -- safe
514
- var defineProperty = Object.defineProperty;
515
-
516
- var setGlobal$3 = function (key, value) {
517
- try {
518
- defineProperty(global$k, key, { value: value, configurable: true, writable: true });
519
- } catch (error) {
520
- global$k[key] = value;
521
- } return value;
522
- };
523
-
524
- var global$j = global$t;
525
- var setGlobal$2 = setGlobal$3;
526
-
527
- var SHARED = '__core-js_shared__';
528
- var store$3 = global$j[SHARED] || setGlobal$2(SHARED, {});
529
-
530
- var sharedStore = store$3;
531
-
532
- var store$2 = sharedStore;
533
-
534
- (shared$4.exports = function (key, value) {
535
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
536
- })('versions', []).push({
537
- version: '3.21.1',
538
- mode: 'global',
539
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
540
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
541
- source: 'https://github.com/zloirock/core-js'
542
- });
543
-
544
- var global$i = global$t;
545
- var requireObjectCoercible$2 = requireObjectCoercible$4;
546
-
547
- var Object$2 = global$i.Object;
548
-
549
- // `ToObject` abstract operation
550
- // https://tc39.es/ecma262/#sec-toobject
551
- var toObject$3 = function (argument) {
552
- return Object$2(requireObjectCoercible$2(argument));
553
- };
554
-
555
- var uncurryThis$a = functionUncurryThis;
556
- var toObject$2 = toObject$3;
557
-
558
- var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
559
-
560
- // `HasOwnProperty` abstract operation
561
- // https://tc39.es/ecma262/#sec-hasownproperty
562
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
563
- return hasOwnProperty(toObject$2(it), key);
564
- };
565
-
566
- var uncurryThis$9 = functionUncurryThis;
567
-
568
- var id = 0;
569
- var postfix = Math.random();
570
- var toString$4 = uncurryThis$9(1.0.toString);
571
-
572
- var uid$2 = function (key) {
573
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
574
- };
575
-
576
- var global$h = global$t;
577
- var shared$3 = shared$4.exports;
578
- var hasOwn$6 = hasOwnProperty_1;
579
- var uid$1 = uid$2;
580
- var NATIVE_SYMBOL = nativeSymbol;
581
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
582
-
583
- var WellKnownSymbolsStore = shared$3('wks');
584
- var Symbol$1 = global$h.Symbol;
585
- var symbolFor = Symbol$1 && Symbol$1['for'];
586
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
587
-
588
- var wellKnownSymbol$5 = function (name) {
589
- if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
590
- var description = 'Symbol.' + name;
591
- if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
592
- WellKnownSymbolsStore[name] = Symbol$1[name];
593
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
594
- WellKnownSymbolsStore[name] = symbolFor(description);
595
- } else {
596
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
597
- }
598
- } return WellKnownSymbolsStore[name];
599
- };
600
-
601
- var global$g = global$t;
602
- var call$5 = functionCall;
603
- var isObject$3 = isObject$5;
604
- var isSymbol$1 = isSymbol$2;
605
- var getMethod$1 = getMethod$2;
606
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
607
- var wellKnownSymbol$4 = wellKnownSymbol$5;
608
-
609
- var TypeError$6 = global$g.TypeError;
610
- var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
611
-
612
- // `ToPrimitive` abstract operation
613
- // https://tc39.es/ecma262/#sec-toprimitive
614
- var toPrimitive$1 = function (input, pref) {
615
- if (!isObject$3(input) || isSymbol$1(input)) return input;
616
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
617
- var result;
618
- if (exoticToPrim) {
619
- if (pref === undefined) pref = 'default';
620
- result = call$5(exoticToPrim, input, pref);
621
- if (!isObject$3(result) || isSymbol$1(result)) return result;
622
- throw TypeError$6("Can't convert object to primitive value");
623
- }
624
- if (pref === undefined) pref = 'number';
625
- return ordinaryToPrimitive(input, pref);
626
- };
627
-
628
- var toPrimitive = toPrimitive$1;
629
- var isSymbol = isSymbol$2;
630
-
631
- // `ToPropertyKey` abstract operation
632
- // https://tc39.es/ecma262/#sec-topropertykey
633
- var toPropertyKey$2 = function (argument) {
634
- var key = toPrimitive(argument, 'string');
635
- return isSymbol(key) ? key : key + '';
636
- };
637
-
638
- var global$f = global$t;
639
- var isObject$2 = isObject$5;
640
-
641
- var document$1 = global$f.document;
642
- // typeof document.createElement is 'object' in old IE
643
- var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
644
-
645
- var documentCreateElement$1 = function (it) {
646
- return EXISTS$1 ? document$1.createElement(it) : {};
647
- };
648
-
649
- var DESCRIPTORS$6 = descriptors;
650
- var fails$8 = fails$d;
651
- var createElement = documentCreateElement$1;
652
-
653
- // Thanks to IE8 for its funny defineProperty
654
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$8(function () {
655
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
656
- return Object.defineProperty(createElement('div'), 'a', {
657
- get: function () { return 7; }
658
- }).a != 7;
659
- });
660
-
661
- var DESCRIPTORS$5 = descriptors;
662
- var call$4 = functionCall;
663
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
664
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
665
- var toIndexedObject$3 = toIndexedObject$4;
666
- var toPropertyKey$1 = toPropertyKey$2;
667
- var hasOwn$5 = hasOwnProperty_1;
668
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
669
-
670
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
671
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
672
-
673
- // `Object.getOwnPropertyDescriptor` method
674
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
675
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
676
- O = toIndexedObject$3(O);
677
- P = toPropertyKey$1(P);
678
- if (IE8_DOM_DEFINE$1) try {
679
- return $getOwnPropertyDescriptor$1(O, P);
680
- } catch (error) { /* empty */ }
681
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$4(propertyIsEnumerableModule.f, O, P), O[P]);
682
- };
683
-
684
- var objectDefineProperty = {};
685
-
686
- var DESCRIPTORS$4 = descriptors;
687
- var fails$7 = fails$d;
688
-
689
- // V8 ~ Chrome 36-
690
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
691
- var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$7(function () {
692
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
693
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
694
- value: 42,
695
- writable: false
696
- }).prototype != 42;
697
- });
698
-
699
- var global$e = global$t;
700
- var isObject$1 = isObject$5;
701
-
702
- var String$2 = global$e.String;
703
- var TypeError$5 = global$e.TypeError;
704
-
705
- // `Assert: Type(argument) is Object`
706
- var anObject$7 = function (argument) {
707
- if (isObject$1(argument)) return argument;
708
- throw TypeError$5(String$2(argument) + ' is not an object');
709
- };
710
-
711
- var global$d = global$t;
712
- var DESCRIPTORS$3 = descriptors;
713
- var IE8_DOM_DEFINE = ie8DomDefine;
714
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
715
- var anObject$6 = anObject$7;
716
- var toPropertyKey = toPropertyKey$2;
717
-
718
- var TypeError$4 = global$d.TypeError;
719
- // eslint-disable-next-line es/no-object-defineproperty -- safe
720
- var $defineProperty = Object.defineProperty;
721
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
722
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
723
- var ENUMERABLE = 'enumerable';
724
- var CONFIGURABLE$1 = 'configurable';
725
- var WRITABLE = 'writable';
726
-
727
- // `Object.defineProperty` method
728
- // https://tc39.es/ecma262/#sec-object.defineproperty
729
- objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
730
- anObject$6(O);
731
- P = toPropertyKey(P);
732
- anObject$6(Attributes);
733
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
734
- var current = $getOwnPropertyDescriptor(O, P);
735
- if (current && current[WRITABLE]) {
736
- O[P] = Attributes.value;
737
- Attributes = {
738
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
739
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
740
- writable: false
741
- };
742
- }
743
- } return $defineProperty(O, P, Attributes);
744
- } : $defineProperty : function defineProperty(O, P, Attributes) {
745
- anObject$6(O);
746
- P = toPropertyKey(P);
747
- anObject$6(Attributes);
748
- if (IE8_DOM_DEFINE) try {
749
- return $defineProperty(O, P, Attributes);
750
- } catch (error) { /* empty */ }
751
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$4('Accessors not supported');
752
- if ('value' in Attributes) O[P] = Attributes.value;
753
- return O;
754
- };
755
-
756
- var DESCRIPTORS$2 = descriptors;
757
- var definePropertyModule$2 = objectDefineProperty;
758
- var createPropertyDescriptor = createPropertyDescriptor$2;
759
-
760
- var createNonEnumerableProperty$4 = DESCRIPTORS$2 ? function (object, key, value) {
761
- return definePropertyModule$2.f(object, key, createPropertyDescriptor(1, value));
762
- } : function (object, key, value) {
763
- object[key] = value;
764
- return object;
765
- };
766
-
767
- var redefine$2 = {exports: {}};
768
-
769
- var uncurryThis$8 = functionUncurryThis;
770
- var isCallable$6 = isCallable$c;
771
- var store$1 = sharedStore;
772
-
773
- var functionToString = uncurryThis$8(Function.toString);
774
-
775
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
776
- if (!isCallable$6(store$1.inspectSource)) {
777
- store$1.inspectSource = function (it) {
778
- return functionToString(it);
779
- };
780
- }
781
-
782
- var inspectSource$2 = store$1.inspectSource;
783
-
784
- var global$c = global$t;
785
- var isCallable$5 = isCallable$c;
786
- var inspectSource$1 = inspectSource$2;
787
-
788
- var WeakMap$1 = global$c.WeakMap;
789
-
790
- var nativeWeakMap = isCallable$5(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
791
-
792
- var shared$2 = shared$4.exports;
793
- var uid = uid$2;
794
-
795
- var keys = shared$2('keys');
796
-
797
- var sharedKey$2 = function (key) {
798
- return keys[key] || (keys[key] = uid(key));
799
- };
800
-
801
- var hiddenKeys$4 = {};
802
-
803
- var NATIVE_WEAK_MAP = nativeWeakMap;
804
- var global$b = global$t;
805
- var uncurryThis$7 = functionUncurryThis;
806
- var isObject = isObject$5;
807
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
808
- var hasOwn$4 = hasOwnProperty_1;
809
- var shared$1 = sharedStore;
810
- var sharedKey$1 = sharedKey$2;
811
- var hiddenKeys$3 = hiddenKeys$4;
812
-
813
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
814
- var TypeError$3 = global$b.TypeError;
815
- var WeakMap = global$b.WeakMap;
816
- var set, get, has;
817
-
818
- var enforce = function (it) {
819
- return has(it) ? get(it) : set(it, {});
820
- };
821
-
822
- var getterFor = function (TYPE) {
823
- return function (it) {
824
- var state;
825
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
826
- throw TypeError$3('Incompatible receiver, ' + TYPE + ' required');
827
- } return state;
828
- };
829
- };
830
-
831
- if (NATIVE_WEAK_MAP || shared$1.state) {
832
- var store = shared$1.state || (shared$1.state = new WeakMap());
833
- var wmget = uncurryThis$7(store.get);
834
- var wmhas = uncurryThis$7(store.has);
835
- var wmset = uncurryThis$7(store.set);
836
- set = function (it, metadata) {
837
- if (wmhas(store, it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
838
- metadata.facade = it;
839
- wmset(store, it, metadata);
840
- return metadata;
841
- };
842
- get = function (it) {
843
- return wmget(store, it) || {};
844
- };
845
- has = function (it) {
846
- return wmhas(store, it);
847
- };
848
- } else {
849
- var STATE = sharedKey$1('state');
850
- hiddenKeys$3[STATE] = true;
851
- set = function (it, metadata) {
852
- if (hasOwn$4(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
853
- metadata.facade = it;
854
- createNonEnumerableProperty$3(it, STATE, metadata);
855
- return metadata;
856
- };
857
- get = function (it) {
858
- return hasOwn$4(it, STATE) ? it[STATE] : {};
859
- };
860
- has = function (it) {
861
- return hasOwn$4(it, STATE);
862
- };
863
- }
864
-
865
- var internalState = {
866
- set: set,
867
- get: get,
868
- has: has,
869
- enforce: enforce,
870
- getterFor: getterFor
871
- };
872
-
873
- var DESCRIPTORS$1 = descriptors;
874
- var hasOwn$3 = hasOwnProperty_1;
875
-
876
- var FunctionPrototype$1 = Function.prototype;
877
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
878
- var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
879
-
880
- var EXISTS = hasOwn$3(FunctionPrototype$1, 'name');
881
- // additional protection from minified / mangled / dropped function names
882
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
883
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype$1, 'name').configurable));
884
-
885
- var functionName = {
886
- EXISTS: EXISTS,
887
- PROPER: PROPER,
888
- CONFIGURABLE: CONFIGURABLE
889
- };
890
-
891
- var global$a = global$t;
892
- var isCallable$4 = isCallable$c;
893
- var hasOwn$2 = hasOwnProperty_1;
894
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
895
- var setGlobal$1 = setGlobal$3;
896
- var inspectSource = inspectSource$2;
897
- var InternalStateModule = internalState;
898
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
899
-
900
- var getInternalState$1 = InternalStateModule.get;
901
- var enforceInternalState = InternalStateModule.enforce;
902
- var TEMPLATE = String(String).split('String');
903
-
904
- (redefine$2.exports = function (O, key, value, options) {
905
- var unsafe = options ? !!options.unsafe : false;
906
- var simple = options ? !!options.enumerable : false;
907
- var noTargetGet = options ? !!options.noTargetGet : false;
908
- var name = options && options.name !== undefined ? options.name : key;
909
- var state;
910
- if (isCallable$4(value)) {
911
- if (String(name).slice(0, 7) === 'Symbol(') {
912
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
913
- }
914
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
915
- createNonEnumerableProperty$2(value, 'name', name);
916
- }
917
- state = enforceInternalState(value);
918
- if (!state.source) {
919
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
920
- }
921
- }
922
- if (O === global$a) {
923
- if (simple) O[key] = value;
924
- else setGlobal$1(key, value);
925
- return;
926
- } else if (!unsafe) {
927
- delete O[key];
928
- } else if (!noTargetGet && O[key]) {
929
- simple = true;
930
- }
931
- if (simple) O[key] = value;
932
- else createNonEnumerableProperty$2(O, key, value);
933
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
934
- })(Function.prototype, 'toString', function toString() {
935
- return isCallable$4(this) && getInternalState$1(this).source || inspectSource(this);
936
- });
937
-
938
- var objectGetOwnPropertyNames = {};
939
-
940
- var ceil = Math.ceil;
941
- var floor$1 = Math.floor;
942
-
943
- // `ToIntegerOrInfinity` abstract operation
944
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
945
- var toIntegerOrInfinity$4 = function (argument) {
946
- var number = +argument;
947
- // eslint-disable-next-line no-self-compare -- safe
948
- return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
949
- };
950
-
951
- var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
952
-
953
- var max$1 = Math.max;
954
- var min$2 = Math.min;
955
-
956
- // Helper for a popular repeating case of the spec:
957
- // Let integer be ? ToInteger(index).
958
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
959
- var toAbsoluteIndex$1 = function (index, length) {
960
- var integer = toIntegerOrInfinity$3(index);
961
- return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
962
- };
963
-
964
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
965
-
966
- var min$1 = Math.min;
967
-
968
- // `ToLength` abstract operation
969
- // https://tc39.es/ecma262/#sec-tolength
970
- var toLength$2 = function (argument) {
971
- return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
972
- };
973
-
974
- var toLength$1 = toLength$2;
975
-
976
- // `LengthOfArrayLike` abstract operation
977
- // https://tc39.es/ecma262/#sec-lengthofarraylike
978
- var lengthOfArrayLike$2 = function (obj) {
979
- return toLength$1(obj.length);
980
- };
981
-
982
- var toIndexedObject$2 = toIndexedObject$4;
983
- var toAbsoluteIndex = toAbsoluteIndex$1;
984
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
985
-
986
- // `Array.prototype.{ indexOf, includes }` methods implementation
987
- var createMethod$2 = function (IS_INCLUDES) {
988
- return function ($this, el, fromIndex) {
989
- var O = toIndexedObject$2($this);
990
- var length = lengthOfArrayLike$1(O);
991
- var index = toAbsoluteIndex(fromIndex, length);
992
- var value;
993
- // Array#includes uses SameValueZero equality algorithm
994
- // eslint-disable-next-line no-self-compare -- NaN check
995
- if (IS_INCLUDES && el != el) while (length > index) {
996
- value = O[index++];
997
- // eslint-disable-next-line no-self-compare -- NaN check
998
- if (value != value) return true;
999
- // Array#indexOf ignores holes, Array#includes - not
1000
- } else for (;length > index; index++) {
1001
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
1002
- } return !IS_INCLUDES && -1;
1003
- };
1004
- };
1005
-
1006
- var arrayIncludes = {
1007
- // `Array.prototype.includes` method
1008
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1009
- includes: createMethod$2(true),
1010
- // `Array.prototype.indexOf` method
1011
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
1012
- indexOf: createMethod$2(false)
1013
- };
1014
-
1015
- var uncurryThis$6 = functionUncurryThis;
1016
- var hasOwn$1 = hasOwnProperty_1;
1017
- var toIndexedObject$1 = toIndexedObject$4;
1018
- var indexOf$1 = arrayIncludes.indexOf;
1019
- var hiddenKeys$2 = hiddenKeys$4;
1020
-
1021
- var push$1 = uncurryThis$6([].push);
1022
-
1023
- var objectKeysInternal = function (object, names) {
1024
- var O = toIndexedObject$1(object);
1025
- var i = 0;
1026
- var result = [];
1027
- var key;
1028
- for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
1029
- // Don't enum bug & hidden keys
1030
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
1031
- ~indexOf$1(result, key) || push$1(result, key);
1032
- }
1033
- return result;
1034
- };
1035
-
1036
- // IE8- don't enum bug keys
1037
- var enumBugKeys$3 = [
1038
- 'constructor',
1039
- 'hasOwnProperty',
1040
- 'isPrototypeOf',
1041
- 'propertyIsEnumerable',
1042
- 'toLocaleString',
1043
- 'toString',
1044
- 'valueOf'
1045
- ];
1046
-
1047
- var internalObjectKeys$1 = objectKeysInternal;
1048
- var enumBugKeys$2 = enumBugKeys$3;
1049
-
1050
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
1051
-
1052
- // `Object.getOwnPropertyNames` method
1053
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
1054
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1055
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1056
- return internalObjectKeys$1(O, hiddenKeys$1);
1057
- };
1058
-
1059
- var objectGetOwnPropertySymbols = {};
1060
-
1061
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1062
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1063
-
1064
- var getBuiltIn$1 = getBuiltIn$4;
1065
- var uncurryThis$5 = functionUncurryThis;
1066
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1067
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1068
- var anObject$5 = anObject$7;
1069
-
1070
- var concat$1 = uncurryThis$5([].concat);
1071
-
1072
- // all object keys, includes non-enumerable and symbols
1073
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
1074
- var keys = getOwnPropertyNamesModule.f(anObject$5(it));
1075
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1076
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1077
- };
1078
-
1079
- var hasOwn = hasOwnProperty_1;
1080
- var ownKeys = ownKeys$1;
1081
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1082
- var definePropertyModule$1 = objectDefineProperty;
1083
-
1084
- var copyConstructorProperties$1 = function (target, source, exceptions) {
1085
- var keys = ownKeys(source);
1086
- var defineProperty = definePropertyModule$1.f;
1087
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1088
- for (var i = 0; i < keys.length; i++) {
1089
- var key = keys[i];
1090
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
1091
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1092
- }
1093
- }
1094
- };
1095
-
1096
- var fails$6 = fails$d;
1097
- var isCallable$3 = isCallable$c;
1098
-
1099
- var replacement = /#|\.prototype\./;
1100
-
1101
- var isForced$1 = function (feature, detection) {
1102
- var value = data[normalize(feature)];
1103
- return value == POLYFILL ? true
1104
- : value == NATIVE ? false
1105
- : isCallable$3(detection) ? fails$6(detection)
1106
- : !!detection;
1107
- };
1108
-
1109
- var normalize = isForced$1.normalize = function (string) {
1110
- return String(string).replace(replacement, '.').toLowerCase();
1111
- };
1112
-
1113
- var data = isForced$1.data = {};
1114
- var NATIVE = isForced$1.NATIVE = 'N';
1115
- var POLYFILL = isForced$1.POLYFILL = 'P';
1116
-
1117
- var isForced_1 = isForced$1;
1118
-
1119
- var global$9 = global$t;
1120
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1121
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1122
- var redefine$1 = redefine$2.exports;
1123
- var setGlobal = setGlobal$3;
1124
- var copyConstructorProperties = copyConstructorProperties$1;
1125
- var isForced = isForced_1;
1126
-
1127
- /*
1128
- options.target - name of the target object
1129
- options.global - target is the global object
1130
- options.stat - export as static methods of target
1131
- options.proto - export as prototype methods of target
1132
- options.real - real prototype method for the `pure` version
1133
- options.forced - export even if the native feature is available
1134
- options.bind - bind methods to the target, required for the `pure` version
1135
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1136
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1137
- options.sham - add a flag to not completely full polyfills
1138
- options.enumerable - export as enumerable property
1139
- options.noTargetGet - prevent calling a getter on target
1140
- options.name - the .name of the function if it does not match the key
1141
- */
1142
- var _export = function (options, source) {
1143
- var TARGET = options.target;
1144
- var GLOBAL = options.global;
1145
- var STATIC = options.stat;
1146
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1147
- if (GLOBAL) {
1148
- target = global$9;
1149
- } else if (STATIC) {
1150
- target = global$9[TARGET] || setGlobal(TARGET, {});
1151
- } else {
1152
- target = (global$9[TARGET] || {}).prototype;
1153
- }
1154
- if (target) for (key in source) {
1155
- sourceProperty = source[key];
1156
- if (options.noTargetGet) {
1157
- descriptor = getOwnPropertyDescriptor(target, key);
1158
- targetProperty = descriptor && descriptor.value;
1159
- } else targetProperty = target[key];
1160
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1161
- // contained in target
1162
- if (!FORCED && targetProperty !== undefined) {
1163
- if (typeof sourceProperty == typeof targetProperty) continue;
1164
- copyConstructorProperties(sourceProperty, targetProperty);
1165
- }
1166
- // add a flag to not completely full polyfills
1167
- if (options.sham || (targetProperty && targetProperty.sham)) {
1168
- createNonEnumerableProperty$1(sourceProperty, 'sham', true);
1169
- }
1170
- // extend global
1171
- redefine$1(target, key, sourceProperty, options);
1172
- }
1173
- };
1174
-
1175
- var wellKnownSymbol$3 = wellKnownSymbol$5;
1176
-
1177
- var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
1178
- var test = {};
1179
-
1180
- test[TO_STRING_TAG$1] = 'z';
1181
-
1182
- var toStringTagSupport = String(test) === '[object z]';
1183
-
1184
- var global$8 = global$t;
1185
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1186
- var isCallable$2 = isCallable$c;
1187
- var classofRaw = classofRaw$1;
1188
- var wellKnownSymbol$2 = wellKnownSymbol$5;
1189
-
1190
- var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
1191
- var Object$1 = global$8.Object;
1192
-
1193
- // ES3 wrong here
1194
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1195
-
1196
- // fallback for IE11 Script Access Denied error
1197
- var tryGet = function (it, key) {
1198
- try {
1199
- return it[key];
1200
- } catch (error) { /* empty */ }
1201
- };
1202
-
1203
- // getting tag from ES6+ `Object.prototype.toString`
1204
- var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1205
- var O, tag, result;
1206
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1207
- // @@toStringTag case
1208
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1209
- // builtinTag case
1210
- : CORRECT_ARGUMENTS ? classofRaw(O)
1211
- // ES3 arguments fallback
1212
- : (result = classofRaw(O)) == 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
1213
- };
1214
-
1215
- var global$7 = global$t;
1216
- var classof$2 = classof$3;
1217
-
1218
- var String$1 = global$7.String;
1219
-
1220
- var toString$3 = function (argument) {
1221
- if (classof$2(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1222
- return String$1(argument);
1223
- };
1224
-
1225
- var anObject$4 = anObject$7;
1226
-
1227
- // `RegExp.prototype.flags` getter implementation
1228
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1229
- var regexpFlags$1 = function () {
1230
- var that = anObject$4(this);
1231
- var result = '';
1232
- if (that.global) result += 'g';
1233
- if (that.ignoreCase) result += 'i';
1234
- if (that.multiline) result += 'm';
1235
- if (that.dotAll) result += 's';
1236
- if (that.unicode) result += 'u';
1237
- if (that.sticky) result += 'y';
1238
- return result;
1239
- };
1240
-
1241
- var fails$5 = fails$d;
1242
- var global$6 = global$t;
1243
-
1244
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1245
- var $RegExp$2 = global$6.RegExp;
1246
-
1247
- var UNSUPPORTED_Y$1 = fails$5(function () {
1248
- var re = $RegExp$2('a', 'y');
1249
- re.lastIndex = 2;
1250
- return re.exec('abcd') != null;
1251
- });
1252
-
1253
- // UC Browser bug
1254
- // https://github.com/zloirock/core-js/issues/1008
1255
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$5(function () {
1256
- return !$RegExp$2('a', 'y').sticky;
1257
- });
1258
-
1259
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$5(function () {
1260
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1261
- var re = $RegExp$2('^r', 'gy');
1262
- re.lastIndex = 2;
1263
- return re.exec('str') != null;
1264
- });
1265
-
1266
- var regexpStickyHelpers = {
1267
- BROKEN_CARET: BROKEN_CARET,
1268
- MISSED_STICKY: MISSED_STICKY,
1269
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1270
- };
1271
-
1272
- var objectDefineProperties = {};
1273
-
1274
- var internalObjectKeys = objectKeysInternal;
1275
- var enumBugKeys$1 = enumBugKeys$3;
1276
-
1277
- // `Object.keys` method
1278
- // https://tc39.es/ecma262/#sec-object.keys
1279
- // eslint-disable-next-line es/no-object-keys -- safe
1280
- var objectKeys$1 = Object.keys || function keys(O) {
1281
- return internalObjectKeys(O, enumBugKeys$1);
1282
- };
1283
-
1284
- var DESCRIPTORS = descriptors;
1285
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1286
- var definePropertyModule = objectDefineProperty;
1287
- var anObject$3 = anObject$7;
1288
- var toIndexedObject = toIndexedObject$4;
1289
- var objectKeys = objectKeys$1;
1290
-
1291
- // `Object.defineProperties` method
1292
- // https://tc39.es/ecma262/#sec-object.defineproperties
1293
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1294
- objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1295
- anObject$3(O);
1296
- var props = toIndexedObject(Properties);
1297
- var keys = objectKeys(Properties);
1298
- var length = keys.length;
1299
- var index = 0;
1300
- var key;
1301
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1302
- return O;
1303
- };
1304
-
1305
- var getBuiltIn = getBuiltIn$4;
1306
-
1307
- var html$1 = getBuiltIn('document', 'documentElement');
1308
-
1309
- /* global ActiveXObject -- old IE, WSH */
1310
-
1311
- var anObject$2 = anObject$7;
1312
- var definePropertiesModule = objectDefineProperties;
1313
- var enumBugKeys = enumBugKeys$3;
1314
- var hiddenKeys = hiddenKeys$4;
1315
- var html = html$1;
1316
- var documentCreateElement = documentCreateElement$1;
1317
- var sharedKey = sharedKey$2;
1318
-
1319
- var GT = '>';
1320
- var LT = '<';
1321
- var PROTOTYPE = 'prototype';
1322
- var SCRIPT = 'script';
1323
- var IE_PROTO = sharedKey('IE_PROTO');
1324
-
1325
- var EmptyConstructor = function () { /* empty */ };
1326
-
1327
- var scriptTag = function (content) {
1328
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1329
- };
1330
-
1331
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1332
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1333
- activeXDocument.write(scriptTag(''));
1334
- activeXDocument.close();
1335
- var temp = activeXDocument.parentWindow.Object;
1336
- activeXDocument = null; // avoid memory leak
1337
- return temp;
1338
- };
1339
-
1340
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1341
- var NullProtoObjectViaIFrame = function () {
1342
- // Thrash, waste and sodomy: IE GC bug
1343
- var iframe = documentCreateElement('iframe');
1344
- var JS = 'java' + SCRIPT + ':';
1345
- var iframeDocument;
1346
- iframe.style.display = 'none';
1347
- html.appendChild(iframe);
1348
- // https://github.com/zloirock/core-js/issues/475
1349
- iframe.src = String(JS);
1350
- iframeDocument = iframe.contentWindow.document;
1351
- iframeDocument.open();
1352
- iframeDocument.write(scriptTag('document.F=Object'));
1353
- iframeDocument.close();
1354
- return iframeDocument.F;
1355
- };
1356
-
1357
- // Check for document.domain and active x support
1358
- // No need to use active x approach when document.domain is not set
1359
- // see https://github.com/es-shims/es5-shim/issues/150
1360
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1361
- // avoid IE GC bug
1362
- var activeXDocument;
1363
- var NullProtoObject = function () {
1364
- try {
1365
- activeXDocument = new ActiveXObject('htmlfile');
1366
- } catch (error) { /* ignore */ }
1367
- NullProtoObject = typeof document != 'undefined'
1368
- ? document.domain && activeXDocument
1369
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1370
- : NullProtoObjectViaIFrame()
1371
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1372
- var length = enumBugKeys.length;
1373
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1374
- return NullProtoObject();
1375
- };
1376
-
1377
- hiddenKeys[IE_PROTO] = true;
1378
-
1379
- // `Object.create` method
1380
- // https://tc39.es/ecma262/#sec-object.create
1381
- var objectCreate = Object.create || function create(O, Properties) {
1382
- var result;
1383
- if (O !== null) {
1384
- EmptyConstructor[PROTOTYPE] = anObject$2(O);
1385
- result = new EmptyConstructor();
1386
- EmptyConstructor[PROTOTYPE] = null;
1387
- // add "__proto__" for Object.getPrototypeOf polyfill
1388
- result[IE_PROTO] = O;
1389
- } else result = NullProtoObject();
1390
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1391
- };
1392
-
1393
- var fails$4 = fails$d;
1394
- var global$5 = global$t;
1395
-
1396
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1397
- var $RegExp$1 = global$5.RegExp;
1398
-
1399
- var regexpUnsupportedDotAll = fails$4(function () {
1400
- var re = $RegExp$1('.', 's');
1401
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
1402
- });
1403
-
1404
- var fails$3 = fails$d;
1405
- var global$4 = global$t;
1406
-
1407
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1408
- var $RegExp = global$4.RegExp;
1409
-
1410
- var regexpUnsupportedNcg = fails$3(function () {
1411
- var re = $RegExp('(?<a>b)', 'g');
1412
- return re.exec('b').groups.a !== 'b' ||
1413
- 'b'.replace(re, '$<a>c') !== 'bc';
1414
- });
1415
-
1416
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1417
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1418
- var call$3 = functionCall;
1419
- var uncurryThis$4 = functionUncurryThis;
1420
- var toString$2 = toString$3;
1421
- var regexpFlags = regexpFlags$1;
1422
- var stickyHelpers = regexpStickyHelpers;
1423
- var shared = shared$4.exports;
1424
- var create = objectCreate;
1425
- var getInternalState = internalState.get;
1426
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1427
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1428
-
1429
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1430
- var nativeExec = RegExp.prototype.exec;
1431
- var patchedExec = nativeExec;
1432
- var charAt$3 = uncurryThis$4(''.charAt);
1433
- var indexOf = uncurryThis$4(''.indexOf);
1434
- var replace$1 = uncurryThis$4(''.replace);
1435
- var stringSlice$3 = uncurryThis$4(''.slice);
1436
-
1437
- var UPDATES_LAST_INDEX_WRONG = (function () {
1438
- var re1 = /a/;
1439
- var re2 = /b*/g;
1440
- call$3(nativeExec, re1, 'a');
1441
- call$3(nativeExec, re2, 'a');
1442
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1443
- })();
1444
-
1445
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1446
-
1447
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1448
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1449
-
1450
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1451
-
1452
- if (PATCH) {
1453
- patchedExec = function exec(string) {
1454
- var re = this;
1455
- var state = getInternalState(re);
1456
- var str = toString$2(string);
1457
- var raw = state.raw;
1458
- var result, reCopy, lastIndex, match, i, object, group;
1459
-
1460
- if (raw) {
1461
- raw.lastIndex = re.lastIndex;
1462
- result = call$3(patchedExec, raw, str);
1463
- re.lastIndex = raw.lastIndex;
1464
- return result;
1465
- }
1466
-
1467
- var groups = state.groups;
1468
- var sticky = UNSUPPORTED_Y && re.sticky;
1469
- var flags = call$3(regexpFlags, re);
1470
- var source = re.source;
1471
- var charsAdded = 0;
1472
- var strCopy = str;
1473
-
1474
- if (sticky) {
1475
- flags = replace$1(flags, 'y', '');
1476
- if (indexOf(flags, 'g') === -1) {
1477
- flags += 'g';
1478
- }
1479
-
1480
- strCopy = stringSlice$3(str, re.lastIndex);
1481
- // Support anchored sticky behavior.
1482
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1483
- source = '(?: ' + source + ')';
1484
- strCopy = ' ' + strCopy;
1485
- charsAdded++;
1486
- }
1487
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1488
- // simulate the 'y' flag.
1489
- reCopy = new RegExp('^(?:' + source + ')', flags);
1490
- }
1491
-
1492
- if (NPCG_INCLUDED) {
1493
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1494
- }
1495
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1496
-
1497
- match = call$3(nativeExec, sticky ? reCopy : re, strCopy);
1498
-
1499
- if (sticky) {
1500
- if (match) {
1501
- match.input = stringSlice$3(match.input, charsAdded);
1502
- match[0] = stringSlice$3(match[0], charsAdded);
1503
- match.index = re.lastIndex;
1504
- re.lastIndex += match[0].length;
1505
- } else re.lastIndex = 0;
1506
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1507
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1508
- }
1509
- if (NPCG_INCLUDED && match && match.length > 1) {
1510
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1511
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1512
- call$3(nativeReplace, match[0], reCopy, function () {
1513
- for (i = 1; i < arguments.length - 2; i++) {
1514
- if (arguments[i] === undefined) match[i] = undefined;
1515
- }
1516
- });
1517
- }
1518
-
1519
- if (match && groups) {
1520
- match.groups = object = create(null);
1521
- for (i = 0; i < groups.length; i++) {
1522
- group = groups[i];
1523
- object[group[0]] = match[group[1]];
1524
- }
1525
- }
1526
-
1527
- return match;
1528
- };
1529
- }
1530
-
1531
- var regexpExec$2 = patchedExec;
1532
-
1533
- var $$1 = _export;
1534
- var exec = regexpExec$2;
1535
-
1536
- // `RegExp.prototype.exec` method
1537
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1538
- $$1({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1539
- exec: exec
1540
- });
1541
-
1542
- var NATIVE_BIND = functionBindNative;
1543
-
1544
- var FunctionPrototype = Function.prototype;
1545
- var apply$1 = FunctionPrototype.apply;
1546
- var call$2 = FunctionPrototype.call;
1547
-
1548
- // eslint-disable-next-line es/no-reflect -- safe
1549
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$2.bind(apply$1) : function () {
1550
- return call$2.apply(apply$1, arguments);
1551
- });
1552
-
1553
- // TODO: Remove from `core-js@4` since it's moved to entry points
1554
-
1555
- var uncurryThis$3 = functionUncurryThis;
1556
- var redefine = redefine$2.exports;
1557
- var regexpExec$1 = regexpExec$2;
1558
- var fails$2 = fails$d;
1559
- var wellKnownSymbol$1 = wellKnownSymbol$5;
1560
- var createNonEnumerableProperty = createNonEnumerableProperty$4;
1561
-
1562
- var SPECIES = wellKnownSymbol$1('species');
1563
- var RegExpPrototype = RegExp.prototype;
1564
-
1565
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1566
- var SYMBOL = wellKnownSymbol$1(KEY);
1567
-
1568
- var DELEGATES_TO_SYMBOL = !fails$2(function () {
1569
- // String methods call symbol-named RegEp methods
1570
- var O = {};
1571
- O[SYMBOL] = function () { return 7; };
1572
- return ''[KEY](O) != 7;
1573
- });
1574
-
1575
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$2(function () {
1576
- // Symbol-named RegExp methods call .exec
1577
- var execCalled = false;
1578
- var re = /a/;
1579
-
1580
- if (KEY === 'split') {
1581
- // We can't use real regex here since it causes deoptimization
1582
- // and serious performance degradation in V8
1583
- // https://github.com/zloirock/core-js/issues/306
1584
- re = {};
1585
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1586
- // a new one. We need to return the patched regex when creating the new one.
1587
- re.constructor = {};
1588
- re.constructor[SPECIES] = function () { return re; };
1589
- re.flags = '';
1590
- re[SYMBOL] = /./[SYMBOL];
1591
- }
1592
-
1593
- re.exec = function () { execCalled = true; return null; };
1594
-
1595
- re[SYMBOL]('');
1596
- return !execCalled;
1597
- });
1598
-
1599
- if (
1600
- !DELEGATES_TO_SYMBOL ||
1601
- !DELEGATES_TO_EXEC ||
1602
- FORCED
1603
- ) {
1604
- var uncurriedNativeRegExpMethod = uncurryThis$3(/./[SYMBOL]);
1605
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1606
- var uncurriedNativeMethod = uncurryThis$3(nativeMethod);
1607
- var $exec = regexp.exec;
1608
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
1609
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1610
- // The native String method already delegates to @@method (this
1611
- // polyfilled function), leasing to infinite recursion.
1612
- // We avoid it by directly calling the native @@method method.
1613
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1614
- }
1615
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1616
- }
1617
- return { done: false };
1618
- });
1619
-
1620
- redefine(String.prototype, KEY, methods[0]);
1621
- redefine(RegExpPrototype, SYMBOL, methods[1]);
1622
- }
1623
-
1624
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
1625
- };
1626
-
1627
- var uncurryThis$2 = functionUncurryThis;
1628
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1629
- var toString$1 = toString$3;
1630
- var requireObjectCoercible$1 = requireObjectCoercible$4;
1631
-
1632
- var charAt$2 = uncurryThis$2(''.charAt);
1633
- var charCodeAt = uncurryThis$2(''.charCodeAt);
1634
- var stringSlice$2 = uncurryThis$2(''.slice);
1635
-
1636
- var createMethod$1 = function (CONVERT_TO_STRING) {
1637
- return function ($this, pos) {
1638
- var S = toString$1(requireObjectCoercible$1($this));
1639
- var position = toIntegerOrInfinity$1(pos);
1640
- var size = S.length;
1641
- var first, second;
1642
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1643
- first = charCodeAt(S, position);
1644
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
1645
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1646
- ? CONVERT_TO_STRING
1647
- ? charAt$2(S, position)
1648
- : first
1649
- : CONVERT_TO_STRING
1650
- ? stringSlice$2(S, position, position + 2)
1651
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1652
- };
1653
- };
1654
-
1655
- var stringMultibyte = {
1656
- // `String.prototype.codePointAt` method
1657
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1658
- codeAt: createMethod$1(false),
1659
- // `String.prototype.at` method
1660
- // https://github.com/mathiasbynens/String.prototype.at
1661
- charAt: createMethod$1(true)
1662
- };
1663
-
1664
- var charAt$1 = stringMultibyte.charAt;
1665
-
1666
- // `AdvanceStringIndex` abstract operation
1667
- // https://tc39.es/ecma262/#sec-advancestringindex
1668
- var advanceStringIndex$1 = function (S, index, unicode) {
1669
- return index + (unicode ? charAt$1(S, index).length : 1);
1670
- };
1671
-
1672
- var uncurryThis$1 = functionUncurryThis;
1673
- var toObject$1 = toObject$3;
1674
-
1675
- var floor = Math.floor;
1676
- var charAt = uncurryThis$1(''.charAt);
1677
- var replace = uncurryThis$1(''.replace);
1678
- var stringSlice$1 = uncurryThis$1(''.slice);
1679
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1680
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1681
-
1682
- // `GetSubstitution` abstract operation
1683
- // https://tc39.es/ecma262/#sec-getsubstitution
1684
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
1685
- var tailPos = position + matched.length;
1686
- var m = captures.length;
1687
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1688
- if (namedCaptures !== undefined) {
1689
- namedCaptures = toObject$1(namedCaptures);
1690
- symbols = SUBSTITUTION_SYMBOLS;
1691
- }
1692
- return replace(replacement, symbols, function (match, ch) {
1693
- var capture;
1694
- switch (charAt(ch, 0)) {
1695
- case '$': return '$';
1696
- case '&': return matched;
1697
- case '`': return stringSlice$1(str, 0, position);
1698
- case "'": return stringSlice$1(str, tailPos);
1699
- case '<':
1700
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
1701
- break;
1702
- default: // \d\d?
1703
- var n = +ch;
1704
- if (n === 0) return match;
1705
- if (n > m) {
1706
- var f = floor(n / 10);
1707
- if (f === 0) return match;
1708
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
1709
- return match;
1710
- }
1711
- capture = captures[n - 1];
1712
- }
1713
- return capture === undefined ? '' : capture;
1714
- });
1715
- };
1716
-
1717
- var global$3 = global$t;
1718
- var call$1 = functionCall;
1719
- var anObject$1 = anObject$7;
1720
- var isCallable$1 = isCallable$c;
1721
- var classof$1 = classofRaw$1;
1722
- var regexpExec = regexpExec$2;
1723
-
1724
- var TypeError$2 = global$3.TypeError;
1725
-
1726
- // `RegExpExec` abstract operation
1727
- // https://tc39.es/ecma262/#sec-regexpexec
1728
- var regexpExecAbstract = function (R, S) {
1729
- var exec = R.exec;
1730
- if (isCallable$1(exec)) {
1731
- var result = call$1(exec, R, S);
1732
- if (result !== null) anObject$1(result);
1733
- return result;
1734
- }
1735
- if (classof$1(R) === 'RegExp') return call$1(regexpExec, R, S);
1736
- throw TypeError$2('RegExp#exec called on incompatible receiver');
1737
- };
1738
-
1739
- var apply = functionApply;
1740
- var call = functionCall;
1741
- var uncurryThis = functionUncurryThis;
1742
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
1743
- var fails$1 = fails$d;
1744
- var anObject = anObject$7;
1745
- var isCallable = isCallable$c;
1746
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
1747
- var toLength = toLength$2;
1748
- var toString = toString$3;
1749
- var requireObjectCoercible = requireObjectCoercible$4;
1750
- var advanceStringIndex = advanceStringIndex$1;
1751
- var getMethod = getMethod$2;
1752
- var getSubstitution = getSubstitution$1;
1753
- var regExpExec = regexpExecAbstract;
1754
- var wellKnownSymbol = wellKnownSymbol$5;
1755
-
1756
- var REPLACE = wellKnownSymbol('replace');
1757
- var max = Math.max;
1758
- var min = Math.min;
1759
- var concat = uncurryThis([].concat);
1760
- var push = uncurryThis([].push);
1761
- var stringIndexOf = uncurryThis(''.indexOf);
1762
- var stringSlice = uncurryThis(''.slice);
1763
-
1764
- var maybeToString = function (it) {
1765
- return it === undefined ? it : String(it);
1766
- };
1767
-
1768
- // IE <= 11 replaces $0 with the whole match, as if it was $&
1769
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
1770
- var REPLACE_KEEPS_$0 = (function () {
1771
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
1772
- return 'a'.replace(/./, '$0') === '$0';
1773
- })();
1774
-
1775
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
1776
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
1777
- if (/./[REPLACE]) {
1778
- return /./[REPLACE]('a', '$0') === '';
1779
- }
1780
- return false;
1781
- })();
1782
-
1783
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$1(function () {
1784
- var re = /./;
1785
- re.exec = function () {
1786
- var result = [];
1787
- result.groups = { a: '7' };
1788
- return result;
1789
- };
1790
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
1791
- return ''.replace(re, '$<a>') !== '7';
1792
- });
1793
-
1794
- // @@replace logic
1795
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
1796
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
1797
-
1798
- return [
1799
- // `String.prototype.replace` method
1800
- // https://tc39.es/ecma262/#sec-string.prototype.replace
1801
- function replace(searchValue, replaceValue) {
1802
- var O = requireObjectCoercible(this);
1803
- var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
1804
- return replacer
1805
- ? call(replacer, searchValue, O, replaceValue)
1806
- : call(nativeReplace, toString(O), searchValue, replaceValue);
1807
- },
1808
- // `RegExp.prototype[@@replace]` method
1809
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1810
- function (string, replaceValue) {
1811
- var rx = anObject(this);
1812
- var S = toString(string);
1813
-
1814
- if (
1815
- typeof replaceValue == 'string' &&
1816
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
1817
- stringIndexOf(replaceValue, '$<') === -1
1818
- ) {
1819
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
1820
- if (res.done) return res.value;
1821
- }
1822
-
1823
- var functionalReplace = isCallable(replaceValue);
1824
- if (!functionalReplace) replaceValue = toString(replaceValue);
1825
-
1826
- var global = rx.global;
1827
- if (global) {
1828
- var fullUnicode = rx.unicode;
1829
- rx.lastIndex = 0;
1830
- }
1831
- var results = [];
1832
- while (true) {
1833
- var result = regExpExec(rx, S);
1834
- if (result === null) break;
1835
-
1836
- push(results, result);
1837
- if (!global) break;
1838
-
1839
- var matchStr = toString(result[0]);
1840
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1841
- }
1842
-
1843
- var accumulatedResult = '';
1844
- var nextSourcePosition = 0;
1845
- for (var i = 0; i < results.length; i++) {
1846
- result = results[i];
1847
-
1848
- var matched = toString(result[0]);
1849
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
1850
- var captures = [];
1851
- // NOTE: This is equivalent to
1852
- // captures = result.slice(1).map(maybeToString)
1853
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1854
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1855
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1856
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
1857
- var namedCaptures = result.groups;
1858
- if (functionalReplace) {
1859
- var replacerArgs = concat([matched], captures, position, S);
1860
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
1861
- var replacement = toString(apply(replaceValue, undefined, replacerArgs));
1862
- } else {
1863
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1864
- }
1865
- if (position >= nextSourcePosition) {
1866
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
1867
- nextSourcePosition = position + matched.length;
1868
- }
1869
- }
1870
- return accumulatedResult + stringSlice(S, nextSourcePosition);
1871
- }
1872
- ];
1873
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
1874
-
1875
- var MergeTag = function MergeTag(_a) {
1876
- var id = _a.id;
1877
-
1878
- var _b = useProfile(),
1879
- loading = _b.loading,
1880
- profile = _b.profile;
1881
-
1882
- if (loading || !profile) {
1883
- return null;
1884
- }
1885
-
1886
- var value = get__default["default"](profile, id.replace(/_/g, '.')); // DON'T CHANGE
1887
-
1888
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, value);
1889
- };
1890
-
1891
- var TrackExperience = function TrackExperience(_a) {
1892
- var children = _a.children,
1893
- experience = _a.experience,
1894
- variant = _a.variant,
1895
- profile = _a.profile;
1896
- var ninetailed = useNinetailed();
1897
-
1898
- var _b = reactIntersectionObserver.useInView({
1899
- triggerOnce: true
1900
- }),
1901
- ref = _b.ref,
1902
- inView = _b.inView;
1903
-
1904
- React.useEffect(function () {
1905
- if (experience_jsShared.isBrowser() && inView) {
1906
- var distribution = experience_js.selectDistribution({
1907
- experience: experience,
1908
- profile: profile
1909
- });
1910
- ninetailed.trackExperience({
1911
- experience: experience,
1912
- component: variant,
1913
- variant: distribution.index
1914
- });
1915
- }
1916
- }, [inView]);
1917
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1918
- ref: ref,
1919
- id: "nt-experience-handle"
1920
- }), children);
1921
- };
1922
-
1923
- var global$2 = global$t;
1924
- var aCallable = aCallable$2;
1925
- var toObject = toObject$3;
1926
- var IndexedObject = indexedObject;
1927
- var lengthOfArrayLike = lengthOfArrayLike$2;
1928
-
1929
- var TypeError$1 = global$2.TypeError;
1930
-
1931
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1932
- var createMethod = function (IS_RIGHT) {
1933
- return function (that, callbackfn, argumentsLength, memo) {
1934
- aCallable(callbackfn);
1935
- var O = toObject(that);
1936
- var self = IndexedObject(O);
1937
- var length = lengthOfArrayLike(O);
1938
- var index = IS_RIGHT ? length - 1 : 0;
1939
- var i = IS_RIGHT ? -1 : 1;
1940
- if (argumentsLength < 2) while (true) {
1941
- if (index in self) {
1942
- memo = self[index];
1943
- index += i;
1944
- break;
1945
- }
1946
- index += i;
1947
- if (IS_RIGHT ? index < 0 : length <= index) {
1948
- throw TypeError$1('Reduce of empty array with no initial value');
1949
- }
1950
- }
1951
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1952
- memo = callbackfn(memo, self[index], index, O);
1953
- }
1954
- return memo;
1955
- };
1956
- };
1957
-
1958
- var arrayReduce = {
1959
- // `Array.prototype.reduce` method
1960
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1961
- left: createMethod(false),
1962
- // `Array.prototype.reduceRight` method
1963
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1964
- right: createMethod(true)
1965
- };
1966
-
1967
- var fails = fails$d;
1968
-
1969
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1970
- var method = [][METHOD_NAME];
1971
- return !!method && fails(function () {
1972
- // eslint-disable-next-line no-useless-call -- required for testing
1973
- method.call(null, argument || function () { return 1; }, 1);
1974
- });
1975
- };
1976
-
1977
- var classof = classofRaw$1;
1978
- var global$1 = global$t;
1979
-
1980
- var engineIsNode = classof(global$1.process) == 'process';
1981
-
1982
- var $ = _export;
1983
- var $reduce = arrayReduce.left;
1984
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1985
- var CHROME_VERSION = engineV8Version;
1986
- var IS_NODE = engineIsNode;
1987
-
1988
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
1989
- // Chrome 80-82 has a critical bug
1990
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1991
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1992
-
1993
- // `Array.prototype.reduce` method
1994
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1995
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
1996
- reduce: function reduce(callbackfn /* , initialValue */) {
1997
- var length = arguments.length;
1998
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1999
- }
2000
- });
2001
-
2002
- var useExperiments = function useExperiments() {
2003
- var context = React.useContext(ExperimentsContext);
2004
-
2005
- if (context === undefined) {
2006
- throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
2007
- }
2008
-
2009
- return {
2010
- experiments: context.experiments
2011
- };
2012
- };
2013
-
2014
- var useExperience = function useExperience(_a) {
2015
- var baseline = _a.baseline,
2016
- experiences = _a.experiences;
2017
- var profileState = useProfile();
2018
- var experiments = useExperiments().experiments;
2019
- var hasVariants = experiences.map(function (experience) {
2020
- return experience_js.selectHasExperienceVariants(experience, baseline);
2021
- }).reduce(function (acc, curr) {
2022
- return acc || curr;
2023
- }, false);
2024
- var status = profileState.status,
2025
- profile = profileState.profile;
2026
-
2027
- var baseReturn = __assign(__assign({}, profileState), {
2028
- hasVariants: hasVariants,
2029
- baseline: baseline
2030
- });
2031
-
2032
- var emptyReturn = __assign(__assign({}, baseReturn), {
2033
- experience: null,
2034
- variant: null,
2035
- audience: null,
2036
- isPersonalized: false,
2037
- profile: null
2038
- });
2039
-
2040
- if (status === 'loading') {
2041
- // @ts-ignore
2042
- return emptyReturn;
2043
- }
2044
-
2045
- if (status === 'error') {
2046
- // @ts-ignore
2047
- return emptyReturn;
2048
- }
2049
-
2050
- if (!profile) {
2051
- // @ts-ignore
2052
- return emptyReturn;
2053
- }
2054
-
2055
- var activeExperiments = experience_js.selectActiveExperiments(experiments, profile);
2056
- var experience = experience_js.selectExperience({
2057
- experiences: experiences,
2058
- activeExperiments: activeExperiments,
2059
- profile: profile
2060
- });
2061
-
2062
- if (!experience) {
2063
- // @ts-ignore
2064
- return emptyReturn;
2065
- }
2066
-
2067
- var audience = experience.audience;
2068
- var variant = experience_js.selectExperienceVariant({
2069
- baseline: baseline,
2070
- experience: experience,
2071
- profile: profile
2072
- });
2073
-
2074
- if (!variant) {
2075
- return __assign(__assign({}, baseReturn), {
2076
- status: 'success',
2077
- loading: false,
2078
- error: null,
2079
- experience: experience,
2080
- variant: null,
2081
- audience: audience ? audience : null,
2082
- profile: profile,
2083
- isPersonalized: false
2084
- });
2085
- }
2086
-
2087
- return __assign(__assign({}, baseReturn), {
2088
- status: 'success',
2089
- loading: false,
2090
- error: null,
2091
- experience: experience,
2092
- variant: variant,
2093
- audience: audience ? audience : null,
2094
- profile: profile,
2095
- isPersonalized: true
2096
- });
2097
- };
2098
-
2099
- var EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
2100
-
2101
- var useJoinExperiment = function useJoinExperiment(_a) {
2102
- var experiences = _a.experiences;
2103
- var identify = useNinetailed().identify; // TODO this gets called twice
2104
-
2105
- return React.useCallback(function (_a) {
2106
- var _b;
2107
-
2108
- var experiment = _a.experiment,
2109
- profile = _a.profile;
2110
- var activeExperiments = experience_js.selectActiveExperiments(experiences, profile);
2111
-
2112
- if (!activeExperiments.length && experiment.type === 'nt_experiment') {
2113
- identify(profile.id, (_b = {}, _b["".concat(EXPERIENCE_TRAIT_PREFIX).concat(experiment.id)] = true, _b));
2114
- }
2115
- }, [experiences]);
2116
- };
2117
-
2118
- var DefaultExperienceLoadingComponent = function DefaultExperienceLoadingComponent(_a) {
2119
- var Component = _a.component;
2120
- _a.experiences;
2121
- var _b = _a.unhideAfterMs,
2122
- unhideAfterMs = _b === void 0 ? 5000 : _b,
2123
- passthroughProps = _a.passthroughProps,
2124
- baseline = __rest(_a, ["component", "experiences", "unhideAfterMs", "passthroughProps"]);
2125
-
2126
- var logger = useNinetailed().logger;
2127
-
2128
- var _c = React.useState(true),
2129
- hidden = _c[0],
2130
- setHidden = _c[1];
2131
-
2132
- React.useEffect(function () {
2133
- var timer = setTimeout(function () {
2134
- setHidden(false);
2135
- logger.error(new Error("The experience was still in loading state after ".concat(unhideAfterMs, "ms. That happens when no events are sent to the Ninetailed API. The baseline is now shown instead.")));
2136
- }, unhideAfterMs);
2137
- return function () {
2138
- clearTimeout(timer);
2139
- };
2140
- }, []);
2141
-
2142
- if (hidden) {
2143
- return /*#__PURE__*/React__default["default"].createElement("div", {
2144
- key: "hide",
2145
- style: {
2146
- opacity: 0
2147
- }
2148
- }, /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2149
- ninetailed: {
2150
- isPersonalized: false,
2151
- audience: {
2152
- id: 'baseline'
2153
- }
2154
- }
2155
- })));
2156
- }
2157
-
2158
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2159
- ninetailed: {
2160
- isPersonalized: false,
2161
- audience: {
2162
- id: 'baseline'
2163
- }
2164
- }
2165
- }));
2166
- };
2167
- var Experience = function Experience(_a) {
2168
- var experiences = _a.experiences,
2169
- Component = _a.component,
2170
- _b = _a.loadingComponent,
2171
- LoadingComponent = _b === void 0 ? DefaultExperienceLoadingComponent : _b,
2172
- passthroughProps = _a.passthroughProps,
2173
- baseline = __rest(_a, ["experiences", "component", "loadingComponent", "passthroughProps"]);
2174
-
2175
- var _c = useExperience({
2176
- baseline: baseline,
2177
- experiences: experiences
2178
- }),
2179
- status = _c.status,
2180
- hasVariants = _c.hasVariants,
2181
- experience = _c.experience,
2182
- variant = _c.variant,
2183
- audience = _c.audience,
2184
- isPersonalized = _c.isPersonalized,
2185
- profile = _c.profile;
2186
-
2187
- var joinExperiment = useJoinExperiment({
2188
- experiences: experiences
2189
- });
2190
- React.useEffect(function () {
2191
- if (status === 'success' && experience && profile) {
2192
- joinExperiment({
2193
- experiment: experience,
2194
- profile: profile
2195
- });
2196
- }
2197
- }, [status, experience, profile]);
2198
-
2199
- if (!hasVariants) {
2200
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline));
2201
- }
2202
-
2203
- if (status === 'loading') {
2204
- return /*#__PURE__*/React__default["default"].createElement(LoadingComponent, __assign({}, baseline, {
2205
- passthroughProps: passthroughProps,
2206
- experiences: experiences,
2207
- component: Component
2208
- }));
2209
- }
2210
-
2211
- if (!experience) {
2212
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2213
- key: baseline.id,
2214
- ninetailed: {
2215
- isPersonalized: false,
2216
- audience: {
2217
- id: 'baseline'
2218
- }
2219
- }
2220
- }));
2221
- }
2222
-
2223
- if (!variant) {
2224
- return /*#__PURE__*/React__default["default"].createElement(TrackExperience, {
2225
- experience: experience,
2226
- variant: baseline,
2227
- // the profile is definitely defined, otherwise there wouldn't be an experience selected
2228
- profile: profile
2229
- }, /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2230
- key: baseline.id,
2231
- ninetailed: {
2232
- isPersonalized: false,
2233
- audience: {
2234
- id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2235
- }
2236
- }
2237
- })));
2238
- }
2239
-
2240
- return /*#__PURE__*/React__default["default"].createElement(TrackExperience, {
2241
- experience: experience,
2242
- variant: variant,
2243
- // the profile is definitely defined, otherwise there wouldn't be an experience selected
2244
- profile: profile
2245
- }, (variant === null || variant === void 0 ? void 0 : variant.hidden) ? null : /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, variant, {
2246
- key: "".concat(experience.id, "-").concat(variant.id),
2247
- ninetailed: {
2248
- isPersonalized: isPersonalized,
2249
- audience: {
2250
- id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2251
- }
2252
- }
2253
- })));
2254
- };
2255
-
2256
- var ESRContext = /*#__PURE__*/React__default["default"].createContext(undefined);
2257
- var ESRProvider = function ESRProvider(_a) {
2258
- var experienceVariantsMap = _a.experienceVariantsMap,
2259
- children = _a.children;
2260
- return /*#__PURE__*/React__default["default"].createElement(ESRContext.Provider, {
2261
- value: {
2262
- experienceVariantsMap: experienceVariantsMap
2263
- }
2264
- }, children);
2265
- };
2266
- var useESR = function useESR() {
2267
- var context = React__default["default"].useContext(ESRContext);
2268
-
2269
- if (context === undefined) {
2270
- throw new Error('The component using the the context must be a descendant of the ESRProvider');
2271
- }
2272
-
2273
- return {
2274
- experienceVariantsMap: context.experienceVariantsMap
2275
- };
2276
- };
2277
- var ESRLoadingComponent = function ESRLoadingComponent(_a) {
2278
- var experiences = _a.experiences,
2279
- Component = _a.component,
2280
- passthroughProps = _a.passthroughProps,
2281
- baseline = __rest(_a, ["experiences", "component", "passthroughProps"]);
2282
-
2283
- var experienceVariantsMap = useESR().experienceVariantsMap;
2284
- var experience = experiences.find(function (experience) {
2285
- return has__default["default"](experienceVariantsMap, experience.id);
2286
- });
2287
-
2288
- if (!experience) {
2289
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2290
- ninetailed: {
2291
- isPersonalized: false,
2292
- audience: {
2293
- id: 'baseline'
2294
- }
2295
- }
2296
- }));
2297
- }
2298
-
2299
- var component = experience.components.find(function (component) {
2300
- return component.baseline.id === baseline.id;
2301
- });
2302
-
2303
- if (!component) {
2304
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2305
- ninetailed: {
2306
- isPersonalized: false,
2307
- audience: {
2308
- id: 'baseline'
2309
- }
2310
- }
2311
- }));
2312
- }
2313
-
2314
- if (experienceVariantsMap[experience.id] === 0) {
2315
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2316
- ninetailed: {
2317
- isPersonalized: false,
2318
- audience: {
2319
- id: 'baseline'
2320
- }
2321
- }
2322
- }));
2323
- }
2324
-
2325
- var variant = component.variants[experienceVariantsMap[experience.id] - 1];
2326
-
2327
- if (!variant) {
2328
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, baseline, {
2329
- ninetailed: {
2330
- isPersonalized: false,
2331
- audience: {
2332
- id: 'baseline'
2333
- }
2334
- }
2335
- }));
2336
- }
2337
-
2338
- return /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, passthroughProps, variant, {
2339
- ninetailed: {
2340
- isPersonalized: false,
2341
- audience: {
2342
- id: 'baseline'
2343
- }
2344
- }
2345
- }));
2346
- };
2347
-
2348
- exports.DefaultExperienceLoadingComponent = DefaultExperienceLoadingComponent;
2349
- exports.ESRLoadingComponent = ESRLoadingComponent;
2350
- exports.ESRProvider = ESRProvider;
2351
- exports.Experience = Experience;
2352
- exports.MergeTag = MergeTag;
2353
- exports.NinetailedProvider = NinetailedProvider;
2354
- exports.Personalize = Personalize;
2355
- exports.TrackHasSeenComponent = TrackHasSeenComponent;
2356
- exports.useNinetailed = useNinetailed;
2357
- exports.usePersonalize = usePersonalize;
2358
- exports.useProfile = useProfile;
2359
-
2360
- Object.defineProperty(exports, '__esModule', { value: true });
2361
-
2362
- }));